@ranger-testing/ranger-cli 3.0.0 → 3.0.1-alpha.476607f-31

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 (83) 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/playwrightCli.js +1 -1
  60. package/build/commands/utils/profileMessages.js +1 -1
  61. package/build/commands/utils/profileSetupBanner.js +1 -1
  62. package/build/commands/utils/projectsConfig.js +1 -1
  63. package/build/commands/utils/rangerConfig.js +1 -1
  64. package/build/commands/utils/rangerRoot.js +1 -1
  65. package/build/commands/utils/rangerwrightCli.js +1 -0
  66. package/build/commands/utils/resolveProfileContext.js +1 -1
  67. package/build/commands/utils/resolveProfileUrl.js +1 -1
  68. package/build/commands/utils/retry.js +1 -1
  69. package/build/commands/utils/sessionCache.js +1 -1
  70. package/build/commands/utils/settings.js +1 -1
  71. package/build/commands/utils/skillContent.js +1 -1
  72. package/build/commands/utils/skills.js +1 -1
  73. package/build/commands/utils/stitchWebmFiles.js +1 -1
  74. package/build/commands/utils/telemetry.js +1 -1
  75. package/build/commands/utils/tokenRefresh.js +1 -1
  76. package/build/commands/utils/traceSnapshotMapper.js +1 -1
  77. package/build/commands/utils/userApi.js +1 -1
  78. package/build/commands/utils/version.js +1 -1
  79. package/build/commands/verifyFeature.js +1 -1
  80. package/build/commands/verifyFeatureCli.js +1 -1
  81. package/build/commands/verifyFeatureNovaCli.js +1 -1
  82. package/build/commands/verifyFeatureRangerwrightCli.js +1 -0
  83. package/package.json +3 -2
@@ -1 +1 @@
1
- (function(_0x97e857,_0x1e0a26){const _0x553e6c=_0x16f9,_0x18393a=_0x97e857();while(!![]){try{const _0x371baa=parseInt(_0x553e6c(0x143))/0x1+parseInt(_0x553e6c(0x138))/0x2*(parseInt(_0x553e6c(0x136))/0x3)+-parseInt(_0x553e6c(0x145))/0x4+parseInt(_0x553e6c(0x141))/0x5*(parseInt(_0x553e6c(0x147))/0x6)+-parseInt(_0x553e6c(0x142))/0x7*(-parseInt(_0x553e6c(0x13d))/0x8)+-parseInt(_0x553e6c(0x146))/0x9+-parseInt(_0x553e6c(0x148))/0xa;if(_0x371baa===_0x1e0a26)break;else _0x18393a['push'](_0x18393a['shift']());}catch(_0x2688d7){_0x18393a['push'](_0x18393a['shift']());}}}(_0x251b,0x70703));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 _0xc73b99=_0x16f9,_0x21e1f4={'yxGTo':function(_0x3fa7df){return _0x3fa7df();},'qnBGf':_0xc73b99(0x137),'RBQyr':function(_0x294f88){return _0x294f88();},'qQQrA':function(_0x5dd825,_0x30c448){return _0x5dd825(_0x30c448);}},_0x495c78=await _0x21e1f4[_0xc73b99(0x13a)](getMcpAuthOrigin);if(_0x495c78){console[_0xc73b99(0x139)](_0x21e1f4[_0xc73b99(0x13e)]),await mcpBootstrap();return;}if(!_0x21e1f4[_0xc73b99(0x135)](isInteractive))throw new Error(_0xc73b99(0x13f));try{const _0x4a3f80=await runDeviceAuthFlow(),_0x31d7bd=await _0x21e1f4['qQQrA'](getCurrentUser,_0x4a3f80);_0x31d7bd[_0xc73b99(0x140)]?console['log']('\x0a✅\x20Logged\x20in\x20to\x20'+_0x31d7bd[_0xc73b99(0x144)][_0xc73b99(0x149)]):console[_0xc73b99(0x139)](_0xc73b99(0x13c));}catch(_0x2aad47){throw new Error(_0xc73b99(0x13b)+(_0x2aad47 instanceof Error?_0x2aad47['message']:_0x2aad47));}}function _0x16f9(_0x2dcb27,_0x4c424c){_0x2dcb27=_0x2dcb27-0x135;const _0x251b5e=_0x251b();let _0x16f91a=_0x251b5e[_0x2dcb27];return _0x16f91a;}function _0x251b(){const _0x133a5d=['499729vDxOfD','user','442088fqLwfm','5905944TAKMtK','108156ukbeeu','7182290PEZmqn','organizationName','RBQyr','57NXtTSI','Re-authenticating\x20via\x20MCP\x20bootstrap...','60886fOSBge','log','yxGTo','Login\x20failed:\x20','\x0a✅\x20API\x20key\x20stored\x20successfully','3333744qaRBML','qnBGf','Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','success','125sTeYlC','7kmyJCl'];_0x251b=function(){return _0x133a5d;};return _0x251b();}
1
+ (function(_0x3f0244,_0x278874){const _0x4239f0=_0x5d63,_0x508c07=_0x3f0244();while(!![]){try{const _0x2d88ee=-parseInt(_0x4239f0(0x7c))/0x1+-parseInt(_0x4239f0(0x7f))/0x2*(-parseInt(_0x4239f0(0x79))/0x3)+-parseInt(_0x4239f0(0x83))/0x4+-parseInt(_0x4239f0(0x77))/0x5*(parseInt(_0x4239f0(0x84))/0x6)+-parseInt(_0x4239f0(0x81))/0x7+parseInt(_0x4239f0(0x78))/0x8*(-parseInt(_0x4239f0(0x7b))/0x9)+parseInt(_0x4239f0(0x80))/0xa;if(_0x2d88ee===_0x278874)break;else _0x508c07['push'](_0x508c07['shift']());}catch(_0x82808c){_0x508c07['push'](_0x508c07['shift']());}}}(_0xee2b,0xaafe8));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';function _0x5d63(_0xf5d726,_0x9ed34f){_0xf5d726=_0xf5d726-0x76;const _0xee2b68=_0xee2b();let _0x5d638a=_0xee2b68[_0xf5d726];return _0x5d638a;}import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';import{isInteractive}from'./utils/cloudProfileSession.js';function _0xee2b(){const _0x5e3065=['Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','1502880znKpux','6WYwawu','organizationName','Login\x20failed:\x20','4725430hzqHEX','182048JsJrFi','21jIFhkE','success','477rhztMz','970813qjSdqf','kQnpI','log','136678GwKFbs','38795630CLULWn','1118999RTVbuc'];_0xee2b=function(){return _0x5e3065;};return _0xee2b();}export async function login(){const _0x362f54=_0x5d63,_0x5174e1={'kQnpI':function(_0x4a5501){return _0x4a5501();},'xBHTk':_0x362f54(0x82)},_0x4d2170=await getMcpAuthOrigin();if(_0x4d2170){console[_0x362f54(0x7e)]('Re-authenticating\x20via\x20MCP\x20bootstrap...'),await mcpBootstrap();return;}if(!_0x5174e1[_0x362f54(0x7d)](isInteractive))throw new Error(_0x5174e1['xBHTk']);try{const _0x41597b=await runDeviceAuthFlow(),_0x3b0241=await getCurrentUser(_0x41597b);_0x3b0241[_0x362f54(0x7a)]?console[_0x362f54(0x7e)]('\x0a✅\x20Logged\x20in\x20to\x20'+_0x3b0241['user'][_0x362f54(0x85)]):console['log']('\x0a✅\x20API\x20key\x20stored\x20successfully');}catch(_0x314a33){throw new Error(_0x362f54(0x76)+(_0x314a33 instanceof Error?_0x314a33['message']:_0x314a33));}}
@@ -1 +1 @@
1
- const _0x51ab1e=_0x169f;function _0x169f(_0x250ef7,_0x4a1191){_0x250ef7=_0x250ef7-0x144;const _0x335a58=_0x335a();let _0x169f29=_0x335a58[_0x250ef7];return _0x169f29;}function _0x335a(){const _0x3fc26b=['NsBKc','refreshToken','yGlKo','bPeQU','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','77ggiWNh','jmlKx','authorization_servers','\x0aOpening\x20browser\x20for\x20authentication...','hex','toString','aZsKw','text/html','origin','get','slice','http://localhost:','2.0','RSiaH','authorization_code','dnbfw','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','clientId','qZxzN','qpMai','write','1095984WcGfVp','mcp-oauth-tokens.json','message','replace','auth-origin.txt','nsxld','response_type','ppnqC','/.well-known/oauth-authorization-server','Authorization','TMqrr','get_cli_token\x20failed:\x20','BDXPs','lbSXG','LqSaW','utf-8','\x0aUnexpected\x20response\x20structure:','isError','writeHead','Token\x20exchange\x20failed:\x20','accessToken','1924480pOZtSw','registration_endpoint','error','application/json','text','text/event-stream','PGhaQ','code','headers','error_description','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','parse','data:','Ranger\x20CLI','Discovering\x20authorization\x20server...','vExwN','OAuthTimeoutError','bVtgj','searchParams','/.well-known/oauth-protected-resource','token','close','CWQpb','stringify','AObse','1412832AfnUUf','trim','191892ayzuRR','Requesting\x20CLI\x20token...','code_challenge','SpAcX','expiresAt','stdout','DDHoK','refresh_token','.ranger','Initializing\x20MCP\x20session...','315208yuCfNH','ShgRM','get_cli_token','1.0.0','win32','redirect_uri','ifrSJ','tools/call','client_id','log','9794088YczFJx','JiqiZ','state','hSJGv','fYPcq','maBqd','<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','2025-03-26','zwtdY','CTtOM','VMiAS','xtkbM','ZsQxW','initialize','resource','dSaqS','isTTY','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','json','set','2XZLPmo','127.0.0.1','POST','JCLmM','split','structuredContent','XammJ','KHvPo','3613630DaCrmo','/callback','lSylx','QgPLD','LLuhh','end','proxied','status','now'];_0x335a=function(){return _0x3fc26b;};return _0x335a();}(function(_0x3ee9db,_0x264bb1){const _0x592560=_0x169f,_0x65c5de=_0x3ee9db();while(!![]){try{const _0x2fce73=-parseInt(_0x592560(0x161))/0x1*(-parseInt(_0x592560(0x189))/0x2)+parseInt(_0x592560(0x1b4))/0x3+-parseInt(_0x592560(0x146))/0x4+parseInt(_0x592560(0x191))/0x5+parseInt(_0x592560(0x15f))/0x6+parseInt(_0x592560(0x19f))/0x7*(parseInt(_0x592560(0x16b))/0x8)+-parseInt(_0x592560(0x175))/0x9;if(_0x2fce73===_0x264bb1)break;else _0x65c5de['push'](_0x65c5de['shift']());}catch(_0x51df8a){_0x65c5de['push'](_0x65c5de['shift']());}}}(_0x335a,0x5ca55));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),_0x51ab1e(0x169),_0x51ab1e(0x1b5)),AUTH_ORIGIN_PATH=join(homedir(),_0x51ab1e(0x169),_0x51ab1e(0x1b8));export async function getMcpAuthOrigin(){const _0x1e2255=_0x51ab1e,_0x37c6f3={'ShgRM':function(_0x33ac12,_0x405f91,_0x1b546e){return _0x33ac12(_0x405f91,_0x1b546e);},'JCLmM':_0x1e2255(0x1c3)};try{const _0x5cfcfd=(await _0x37c6f3[_0x1e2255(0x16c)](readFile,AUTH_ORIGIN_PATH,_0x37c6f3[_0x1e2255(0x18c)]))['trim']();return _0x5cfcfd||null;}catch{return null;}}export async function mcpBootstrap(){const _0x4788c7=_0x51ab1e,_0x593839={'PGhaQ':function(_0x1dcecf,_0x145ea8){return _0x1dcecf(_0x145ea8);},'ppnqC':function(_0x21cd2f,_0x24344e){return _0x21cd2f===_0x24344e;},'fRlum':_0x4788c7(0x197),'gcxoJ':function(_0x278c51){return _0x278c51();},'jmlKx':function(_0x1a27ed,_0x5d31e7){return _0x1a27ed+_0x5d31e7;},'vExwN':'MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a'},_0x3c5133=getMcpAuthUrl();currentOrigin=_0x3c5133;const _0x4d2d62=process[_0x4788c7(0x166)][_0x4788c7(0x185)]??![];console['log']('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x3c5133+'\x0a');const _0x26dbb1=await _0x593839[_0x4788c7(0x14c)](tryUnauthenticated,_0x3c5133);let _0x407993=null;if(_0x593839[_0x4788c7(0x1bb)](_0x26dbb1,_0x593839['fRlum']))_0x407993='';else{_0x407993=await _0x593839['gcxoJ'](loadCachedToken);if(!_0x407993){if(!_0x4d2d62)throw new Error(_0x593839[_0x4788c7(0x1a0)](_0x593839[_0x4788c7(0x155)],'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.'));_0x407993=await oauthFlow(_0x3c5133);}}await callGetCliToken(_0x3c5133,_0x407993);}async function tryUnauthenticated(_0x56be17){const _0x4d66cc=_0x51ab1e,_0x36b439={'QgPLD':function(_0x5377ef,_0x473618,_0x249d21){return _0x5377ef(_0x473618,_0x249d21);},'XXZZo':_0x4d66cc(0x18b),'USAJF':'application/json','lSylx':'application/json,\x20text/event-stream','IxkQM':_0x4d66cc(0x1ab),'bVtgj':_0x4d66cc(0x182),'zwtdY':_0x4d66cc(0x16e),'fWijl':_0x4d66cc(0x197)},_0x447449=await _0x36b439[_0x4d66cc(0x194)](fetch,_0x56be17,{'method':_0x36b439['XXZZo'],'headers':{'Content-Type':_0x36b439['USAJF'],'Accept':_0x36b439[_0x4d66cc(0x193)]},'body':JSON[_0x4d66cc(0x15d)]({'jsonrpc':_0x36b439['IxkQM'],'id':0x1,'method':_0x36b439[_0x4d66cc(0x157)],'params':{'protocolVersion':_0x4d66cc(0x17c),'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x36b439[_0x4d66cc(0x17d)]}}})});if(_0x447449['ok'])return await _0x447449['text'](),_0x36b439['fWijl'];if(_0x447449[_0x4d66cc(0x198)]===0x191)return await _0x447449['text'](),'needs-oauth';const _0x584779=await _0x447449[_0x4d66cc(0x14a)]();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x447449['status']+':\x20'+_0x584779);}class OAuthTimeoutError extends Error{constructor(_0x8f9389){const _0xd0e039=_0x51ab1e,_0x59a5d9={'RLjlb':_0xd0e039(0x156)};super(_0x8f9389),this['name']=_0x59a5d9['RLjlb'];}}async function oauthFlow(_0x30d093){const _0x2c1246=_0x51ab1e,_0x43ddb9={'oShFH':function(_0x3a9233){return _0x3a9233();},'CTtOM':function(_0x4b9c8e,_0x54d254){return _0x4b9c8e(_0x54d254);}};try{return await oauthFlowAttempt(_0x30d093);}catch(_0x3e0667){if(_0x3e0667 instanceof OAuthTimeoutError&&await loadCachedClient())return console[_0x2c1246(0x174)]('\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'),await _0x43ddb9['oShFH'](clearCachedClient),await _0x43ddb9[_0x2c1246(0x17e)](oauthFlowAttempt,_0x30d093);throw _0x3e0667;}}async function oauthFlowAttempt(_0x3cf36d){const _0x239200=_0x51ab1e,_0x4a53ce={'GfwPw':_0x239200(0x154),'vysHU':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','UPnwX':'No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','mxqsq':function(_0x52c186,_0xa1953b){return _0x52c186(_0xa1953b);},'qUisR':_0x239200(0x153),'qZxzN':_0x239200(0x1ad),'VMiAS':'refresh_token','TZrpC':'\x20done','qpMai':_0x239200(0x186),'JiqiZ':function(_0x2d5558,_0x554d49){return _0x2d5558(_0x554d49);},'nsxld':'base64url','gaHhz':function(_0x411c8b,_0x447cf0){return _0x411c8b(_0x447cf0);},'AObse':'sha256','lbSXG':_0x239200(0x1a3),'KIfkt':_0x239200(0x1ba),'eIwlE':_0x239200(0x170),'RuLAN':_0x239200(0x163),'xtkbM':'code_challenge_method','rmGXN':'resource','REEqV':_0x239200(0x1a2),'Pslbr':function(_0x5838a1,_0x57d066){return _0x5838a1(_0x57d066);},'CgiSZ':'Exchanging\x20authorization\x20code...','VrHOh':'client_secret','yLwUN':function(_0x1b2bbe,_0x516f11,_0x416092){return _0x1b2bbe(_0x516f11,_0x416092);},'KHvPo':'application/x-www-form-urlencoded'},_0x5b7b5a=_0x3cf36d[_0x239200(0x1b7)](/\/mcp$/,'');process[_0x239200(0x166)]['write'](_0x4a53ce['GfwPw']);const _0x2a4e31=await fetch(_0x5b7b5a+_0x239200(0x159));if(!_0x2a4e31['ok'])throw new Error(_0x4a53ce['vysHU']);const _0x33aff0=await _0x2a4e31['json'](),_0x3bd0fe=_0x33aff0[_0x239200(0x1a1)]?.[0x0];if(!_0x3bd0fe)throw new Error(_0x4a53ce['UPnwX']);console[_0x239200(0x174)]('\x20'+_0x3bd0fe);const _0x4c819c=await _0x4a53ce['mxqsq'](fetchAuthServerMetadata,_0x3bd0fe);let _0x5eea4f,_0x5808e4;const _0x18d40d=await loadCachedClient();if(_0x18d40d)_0x5eea4f=_0x18d40d['clientId'],_0x5808e4=_0x18d40d['clientSecret'];else{if(_0x4c819c['registration_endpoint']){process['stdout'][_0x239200(0x1b3)]('Registering\x20OAuth\x20client...');const _0x572de2=await fetch(_0x4c819c[_0x239200(0x147)],{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify']({'client_name':_0x4a53ce['qUisR'],'redirect_uris':[_0x239200(0x1aa)+CALLBACK_PORT+'/callback'],'grant_types':[_0x4a53ce[_0x239200(0x1b1)],_0x4a53ce[_0x239200(0x17f)]],'response_types':['code'],'token_endpoint_auth_method':'none'})});if(!_0x572de2['ok']){const _0x27a376=await _0x572de2[_0x239200(0x14a)]();throw new Error('Client\x20registration\x20failed:\x20'+_0x27a376);}const _0x2de5dc=await _0x572de2[_0x239200(0x187)]();_0x5eea4f=_0x2de5dc[_0x239200(0x173)],_0x5808e4=_0x2de5dc['client_secret'],await saveCachedClient(_0x5eea4f,_0x5808e4),console[_0x239200(0x174)](_0x4a53ce['TZrpC']);}else throw new Error(_0x4a53ce[_0x239200(0x1b2)]);}const _0x26d080=_0x4a53ce[_0x239200(0x176)](randomBytes,0x20)['toString'](_0x4a53ce[_0x239200(0x1b9)]),_0x294d30=_0x4a53ce['gaHhz'](createHash,_0x4a53ce[_0x239200(0x15e)])['update'](_0x26d080)['digest'](_0x4a53ce[_0x239200(0x1b9)]),_0x48eaa1=_0x4a53ce['gaHhz'](randomBytes,0x10)[_0x239200(0x1a4)](_0x4a53ce[_0x239200(0x1c1)]),_0x55a200=new URL(_0x4c819c['authorization_endpoint']);_0x55a200['searchParams']['set'](_0x4a53ce['KIfkt'],_0x239200(0x14d)),_0x55a200['searchParams'][_0x239200(0x188)](_0x239200(0x173),_0x5eea4f),_0x55a200['searchParams'][_0x239200(0x188)](_0x4a53ce['eIwlE'],_0x239200(0x1aa)+CALLBACK_PORT+'/callback'),_0x55a200[_0x239200(0x158)][_0x239200(0x188)](_0x4a53ce['RuLAN'],_0x294d30),_0x55a200[_0x239200(0x158)][_0x239200(0x188)](_0x4a53ce[_0x239200(0x180)],'S256'),_0x55a200[_0x239200(0x158)]['set']('state',_0x48eaa1);_0x33aff0[_0x239200(0x183)]&&_0x55a200['searchParams'][_0x239200(0x188)](_0x4a53ce['rmGXN'],_0x33aff0['resource']);console[_0x239200(0x174)](_0x4a53ce['REEqV']),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x55a200[_0x239200(0x1a4)]()+'\x0a'),await openBrowser(_0x55a200['toString']());const _0x34ec32=await _0x4a53ce['Pslbr'](waitForCallback,_0x48eaa1);process[_0x239200(0x166)][_0x239200(0x1b3)](_0x4a53ce['CgiSZ']);const _0x1d157c=new URLSearchParams({'grant_type':'authorization_code','code':_0x34ec32,'redirect_uri':'http://localhost:'+CALLBACK_PORT+'/callback','client_id':_0x5eea4f,'code_verifier':_0x26d080});_0x5808e4&&_0x1d157c[_0x239200(0x188)](_0x4a53ce['VrHOh'],_0x5808e4);_0x33aff0['resource']&&_0x1d157c[_0x239200(0x188)](_0x239200(0x183),_0x33aff0['resource']);const _0x377061=await _0x4a53ce['yLwUN'](fetch,_0x4c819c['token_endpoint'],{'method':'POST','headers':{'Content-Type':_0x4a53ce[_0x239200(0x190)]},'body':_0x1d157c});if(!_0x377061['ok']){const _0x310b99=await _0x377061['text']();throw new Error(_0x239200(0x144)+_0x310b99);}const _0x444d97=await _0x377061[_0x239200(0x187)]();return console['log']('\x20done'),await saveCachedToken(_0x444d97['access_token'],_0x444d97[_0x239200(0x168)],_0x444d97['expires_in']),_0x444d97['access_token'];}async function callGetCliToken(_0x4b50e1,_0x447bc0){const _0xd99194=_0x51ab1e,_0xd2b839={'bPeQU':_0xd99194(0x149),'wOEJQ':function(_0x3cf645,_0x5ee155){return _0x3cf645(_0x5ee155);},'DDHoK':'2025-03-26','Uqaef':'\x20done','aTdiI':function(_0x20b288,_0x5d4587,_0x4fbc15){return _0x20b288(_0x5d4587,_0x4fbc15);},'EBpZa':_0xd99194(0x18b),'yGlKo':'notifications/initialized','xunHG':_0xd99194(0x1c4),'waESQ':function(_0x44907e,_0x311bf9,_0x12db5b){return _0x44907e(_0x311bf9,_0x12db5b);},'fYPcq':function(_0xe4d316){return _0xe4d316();},'uomlz':'.ranger','maBqd':'auth-origin.txt'},_0xc5f668={'Content-Type':_0xd2b839[_0xd99194(0x19d)],'Accept':'application/json,\x20text/event-stream'};_0x447bc0&&(_0xc5f668[_0xd99194(0x1bd)]='Bearer\x20'+_0x447bc0);const _0x103914=async _0x1fd746=>{const _0x13a4d8=_0xd99194,_0xa6d39=await fetch(_0x4b50e1,{'method':_0x13a4d8(0x18b),'headers':_0xc5f668,'body':JSON[_0x13a4d8(0x15d)](_0x1fd746)});if(!_0xa6d39['ok']){const _0x1e73d7=await _0xa6d39['text']();throw new Error('HTTP\x20'+_0xa6d39[_0x13a4d8(0x198)]+':\x20'+_0x1e73d7);}return parseResponse(_0xa6d39);};process[_0xd99194(0x166)][_0xd99194(0x1b3)](_0xd99194(0x16a));const _0x1b81d8=await _0xd2b839['wOEJQ'](_0x103914,{'jsonrpc':'2.0','id':0x1,'method':'initialize','params':{'protocolVersion':_0xd2b839[_0xd99194(0x167)],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0xd99194(0x16e)}}});if(_0x1b81d8['error'])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x1b81d8[_0xd99194(0x148)][_0xd99194(0x1b6)]??JSON[_0xd99194(0x15d)](_0x1b81d8[_0xd99194(0x148)])));console['log'](_0xd2b839['Uqaef']),await _0xd2b839['aTdiI'](fetch,_0x4b50e1,{'method':_0xd2b839['EBpZa'],'headers':_0xc5f668,'body':JSON[_0xd99194(0x15d)]({'jsonrpc':'2.0','method':_0xd2b839[_0xd99194(0x19c)]})})['then'](_0x2e1c7c=>_0x2e1c7c[_0xd99194(0x14a)]()),process['stdout']['write'](_0xd99194(0x162));const _0x25ef0d=await _0x103914({'jsonrpc':'2.0','id':0x2,'method':_0xd99194(0x172),'params':{'name':_0xd99194(0x16d),'arguments':{}}});if(_0x25ef0d['error'])throw new Error(_0xd99194(0x1bf)+(_0x25ef0d['error'][_0xd99194(0x1b6)]??JSON['stringify'](_0x25ef0d[_0xd99194(0x148)])));console[_0xd99194(0x174)](_0xd2b839['Uqaef']);const _0x251f89=extractToken(_0x25ef0d['result']);if(!_0x251f89){console[_0xd99194(0x148)](_0xd2b839['xunHG']),console[_0xd99194(0x148)](JSON['stringify'](_0x25ef0d['result'],null,0x2));throw new Error(_0xd99194(0x150));}const _0x5c0ee0=_0xd2b839['waESQ'](join,_0xd2b839[_0xd99194(0x179)](homedir),_0xd2b839['uomlz']),_0x50b2c4=join(_0x5c0ee0,'refresh.txt');await mkdir(_0x5c0ee0,{'recursive':!![]}),await writeFile(_0x50b2c4,_0x251f89,{'mode':0x180}),await writeFile(join(_0x5c0ee0,_0xd2b839[_0xd99194(0x17a)]),_0x4b50e1,{'mode':0x180}),console['log']('\x0aToken\x20written\x20to\x20'+_0x50b2c4),console[_0xd99194(0x174)]('Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a');}async function fetchAuthServerMetadata(_0x5ef744){const _0x5cb45a=_0x51ab1e,_0x370ff0={'aZsKw':function(_0x1a8c2b,_0x7eb08a){return _0x1a8c2b(_0x7eb08a);}},_0xa3cb7a=_0x5ef744+_0x5cb45a(0x1bc),_0x52aa4f=await _0x370ff0[_0x5cb45a(0x1a5)](fetch,_0xa3cb7a);if(!_0x52aa4f['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0xa3cb7a+':\x20'+_0x52aa4f[_0x5cb45a(0x198)]);return _0x52aa4f['json']();}function waitForCallback(_0x4a062a){const _0x47704a=_0x51ab1e,_0x347812={'ifrSJ':_0x47704a(0x1af),'SpAcX':'code','JslLw':_0x47704a(0x17b),'dSaqS':_0x47704a(0x19e)};return new Promise((_0xdcbe73,_0x1d10d0)=>{const _0x5a9753=_0x47704a,_0x4505bf={'xCjBv':_0x347812[_0x5a9753(0x171)],'DposO':function(_0x1170f2,_0x4d68bb){return _0x1170f2!==_0x4d68bb;},'DnPpi':_0x5a9753(0x192),'XammJ':_0x347812[_0x5a9753(0x164)],'BDXPs':_0x5a9753(0x1a6),'TMqrr':_0x347812['JslLw'],'pxoUp':_0x347812[_0x5a9753(0x184)],'LqSaW':function(_0x3be062,_0x2bc30b){return _0x3be062(_0x2bc30b);}},_0x17efba=()=>{const _0x37eb3c=_0x5a9753;_0x33d35c['closeAllConnections'](),_0x33d35c[_0x37eb3c(0x15b)]();},_0x36b1cd=setTimeout(()=>{_0x17efba(),_0x1d10d0(new OAuthTimeoutError(_0x4505bf['xCjBv']));},0x1d4c0),_0x33d35c=createServer((_0x4260e2,_0x284ef1)=>{const _0x2bf8e5=_0x5a9753,_0x418f2c=new URL(_0x4260e2['url']??'/',_0x2bf8e5(0x1aa)+CALLBACK_PORT);if(_0x4505bf['DposO'](_0x418f2c['pathname'],_0x4505bf['DnPpi'])){_0x284ef1[_0x2bf8e5(0x1c6)](0x194),_0x284ef1[_0x2bf8e5(0x196)]('Not\x20found');return;}const _0x57f0cf=_0x418f2c['searchParams']['get'](_0x4505bf[_0x2bf8e5(0x18f)]),_0x4d3c42=_0x418f2c['searchParams']['get'](_0x2bf8e5(0x177)),_0x2e047d=_0x418f2c[_0x2bf8e5(0x158)][_0x2bf8e5(0x1a8)]('error');if(_0x2e047d){const _0x4d2620=_0x418f2c['searchParams']['get'](_0x2bf8e5(0x14f))??_0x2e047d;_0x284ef1['writeHead'](0xc8,{'Content-Type':_0x4505bf[_0x2bf8e5(0x1c0)]}),_0x284ef1['end']('<html><body><h2>Authentication\x20failed</h2><p>'+_0x4d2620+'</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>'),clearTimeout(_0x36b1cd),_0x17efba(),_0x1d10d0(new Error('OAuth\x20error:\x20'+_0x4d2620));return;}if(!_0x57f0cf||_0x4d3c42!==_0x4a062a){_0x284ef1['writeHead'](0x190,{'Content-Type':_0x2bf8e5(0x1a6)}),_0x284ef1['end'](_0x4505bf[_0x2bf8e5(0x1be)]);return;}_0x284ef1[_0x2bf8e5(0x1c6)](0xc8,{'Content-Type':_0x4505bf['BDXPs']}),_0x284ef1[_0x2bf8e5(0x196)](_0x4505bf['pxoUp']),clearTimeout(_0x36b1cd),_0x17efba(),_0x4505bf[_0x2bf8e5(0x1c2)](_0xdcbe73,_0x57f0cf);});_0x33d35c['listen'](CALLBACK_PORT,_0x5a9753(0x18a));});}async function openBrowser(_0x5b1435){const _0x4d8bb6=_0x51ab1e,_0xfaf3ed={'sHLjt':function(_0x50edc8,_0x1b3aba){return _0x50edc8===_0x1b3aba;},'Vtezo':'darwin'},_0x47395d=_0xfaf3ed['sHLjt'](process['platform'],_0xfaf3ed['Vtezo'])?'open':process['platform']===_0x4d8bb6(0x16f)?'start':'xdg-open';exec(_0x47395d+'\x20\x22'+_0x5b1435+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x22460b=_0x51ab1e,_0xd1b6cf={'ZsQxW':function(_0x511678,_0xbc0ad){return _0x511678>_0xbc0ad;}};try{const _0x38200d=JSON['parse'](await readFile(TOKEN_CACHE_PATH,'utf-8'));if(_0x38200d[_0x22460b(0x1a7)]&&_0x38200d[_0x22460b(0x1a7)]!==currentOrigin)return null;if(_0x38200d[_0x22460b(0x165)]&&_0xd1b6cf[_0x22460b(0x181)](Date[_0x22460b(0x199)](),_0x38200d[_0x22460b(0x165)]))return null;return _0x38200d[_0x22460b(0x145)]??null;}catch{return null;}}async function saveCachedToken(_0x324d6b,_0x268955,_0x570f7c){const _0x3cad33=_0x51ab1e,_0x16db59={'dnbfw':function(_0x522a72){return _0x522a72();},'sQiPs':function(_0x1d81a5,_0x6a1c05){return _0x1d81a5*_0x6a1c05;},'YyvlL':function(_0x4ae8f0,_0x2a65a3,_0x2a2276){return _0x4ae8f0(_0x2a65a3,_0x2a2276);},'hSJGv':function(_0x1ab699,_0x295730,_0x4a6b9e,_0x351254){return _0x1ab699(_0x295730,_0x4a6b9e,_0x351254);}},_0x300c0f=await _0x16db59[_0x3cad33(0x1ae)](loadCachedData),_0x258f0a={..._0x300c0f,'origin':currentOrigin,'accessToken':_0x324d6b,'refreshToken':_0x268955??_0x300c0f?.[_0x3cad33(0x19b)],'expiresAt':_0x570f7c?Date['now']()+_0x16db59['sQiPs'](_0x570f7c,0x3e8):undefined};await _0x16db59['YyvlL'](mkdir,join(_0x16db59[_0x3cad33(0x1ae)](homedir),_0x3cad33(0x169)),{'recursive':!![]}),await _0x16db59[_0x3cad33(0x178)](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x258f0a),{'mode':0x180});}async function loadCachedClient(){const _0x2bf35b=_0x51ab1e,_0x1cb52d={'owSjD':function(_0x344929,_0x1dbde5){return _0x344929!==_0x1dbde5;}},_0x15cfec=await loadCachedData();if(_0x15cfec?.[_0x2bf35b(0x1a7)]&&_0x1cb52d['owSjD'](_0x15cfec[_0x2bf35b(0x1a7)],currentOrigin))return null;return _0x15cfec?.[_0x2bf35b(0x1b0)]?{'clientId':_0x15cfec[_0x2bf35b(0x1b0)],'clientSecret':_0x15cfec['clientSecret']}:null;}async function clearCachedClient(){const _0x93ed7e=_0x51ab1e,_0x1ba3e0={'LLuhh':function(_0xa01af2){return _0xa01af2();}},_0x3ecac6=await _0x1ba3e0[_0x93ed7e(0x195)](loadCachedData);if(!_0x3ecac6)return;const {clientId:_0x1d2c46,clientSecret:_0x5a7e4a,..._0xa24778}=_0x3ecac6;await writeFile(TOKEN_CACHE_PATH,JSON[_0x93ed7e(0x15d)](_0xa24778),{'mode':0x180});}async function saveCachedClient(_0x5d619b,_0x19294c){const _0x13c435=_0x51ab1e,_0x2632ac={'HuPDL':function(_0x10e37a){return _0x10e37a();},'AUoQv':function(_0xa2a339,_0x362ba9,_0x331ed9){return _0xa2a339(_0x362ba9,_0x331ed9);},'Ffvym':function(_0x205cf5,_0x3241ae,_0x3d66f7){return _0x205cf5(_0x3241ae,_0x3d66f7);},'liabH':'.ranger'},_0x76482e=await _0x2632ac['HuPDL'](loadCachedData),_0x41c9a9={..._0x76482e,'origin':currentOrigin,'accessToken':_0x76482e?.['accessToken']??'','clientId':_0x5d619b,'clientSecret':_0x19294c};await _0x2632ac['AUoQv'](mkdir,_0x2632ac['Ffvym'](join,_0x2632ac['HuPDL'](homedir),_0x2632ac['liabH']),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x13c435(0x15d)](_0x41c9a9),{'mode':0x180});}async function loadCachedData(){const _0x263e42=_0x51ab1e;try{return JSON[_0x263e42(0x151)](await readFile(TOKEN_CACHE_PATH,_0x263e42(0x1c3)));}catch{return null;}}async function parseResponse(_0x46c3c4){const _0x30721c=_0x51ab1e,_0x3c8aed={'vIUek':'content-type','CWQpb':_0x30721c(0x14b),'VhGes':function(_0x5daba1,_0x21b798){return _0x5daba1!==_0x21b798;}},_0x4054b3=_0x46c3c4[_0x30721c(0x14e)]['get'](_0x3c8aed['vIUek'])??'';if(_0x4054b3['includes'](_0x3c8aed[_0x30721c(0x15c)])){const _0x365118=await _0x46c3c4[_0x30721c(0x14a)]();for(const _0x20b011 of _0x365118[_0x30721c(0x18d)]('\x0a')){const _0x2b1615=_0x20b011[_0x30721c(0x160)]();if(_0x2b1615['startsWith'](_0x30721c(0x152))){const _0x3cd936=_0x2b1615[_0x30721c(0x1a9)](_0x30721c(0x152)['length'])['trim']();if(!_0x3cd936)continue;try{const _0x1589ec=JSON['parse'](_0x3cd936);if(_0x3c8aed['VhGes'](_0x1589ec['id'],undefined)||_0x1589ec['error'])return _0x1589ec;}catch{}}}throw new Error('No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream');}return _0x46c3c4['json']();}function extractToken(_0x27e93e){const _0x2d8f2f=_0x51ab1e,_0x47e574={'NsBKc':'string','hpQrX':'Unknown\x20error','RSiaH':_0x2d8f2f(0x14a)};if(!_0x27e93e)return null;const _0x40edbb=_0x27e93e[_0x2d8f2f(0x18e)];if(_0x40edbb?.['token']&&typeof _0x40edbb[_0x2d8f2f(0x15a)]===_0x47e574[_0x2d8f2f(0x19a)])return _0x40edbb['token'];if(_0x27e93e[_0x2d8f2f(0x1c5)]){const _0x30efcc=_0x27e93e['content'];throw new Error('Server\x20returned\x20error:\x20'+(_0x30efcc?.[0x0]?.['text']??_0x47e574['hpQrX']));}const _0x4cb2da=_0x27e93e['content'];if(_0x4cb2da)for(const _0x23487a of _0x4cb2da){if(_0x23487a['type']===_0x47e574[_0x2d8f2f(0x1ac)]&&_0x23487a[_0x2d8f2f(0x14a)]){try{const _0x5e987b=JSON[_0x2d8f2f(0x151)](_0x23487a['text']);if(typeof _0x5e987b?.[_0x2d8f2f(0x15a)]===_0x47e574['NsBKc'])return _0x5e987b['token'];}catch{}const _0x512ade=_0x23487a['text']['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x512ade)return _0x512ade[0x1];}}return null;}
1
+ const _0x5a5d54=_0x3d82;(function(_0x52c2da,_0x51bdb3){const _0x1947a7=_0x3d82,_0x3af942=_0x52c2da();while(!![]){try{const _0xd7ea7f=-parseInt(_0x1947a7(0x1f4))/0x1+-parseInt(_0x1947a7(0x24c))/0x2*(-parseInt(_0x1947a7(0x1db))/0x3)+parseInt(_0x1947a7(0x1cd))/0x4*(parseInt(_0x1947a7(0x23d))/0x5)+-parseInt(_0x1947a7(0x22a))/0x6*(parseInt(_0x1947a7(0x1ca))/0x7)+parseInt(_0x1947a7(0x23a))/0x8+parseInt(_0x1947a7(0x213))/0x9+parseInt(_0x1947a7(0x1b9))/0xa;if(_0xd7ea7f===_0x51bdb3)break;else _0x3af942['push'](_0x3af942['shift']());}catch(_0x2cc061){_0x3af942['push'](_0x3af942['shift']());}}}(_0x4b0b,0x785bd));import{mkdir,writeFile,readFile}from'fs/promises';function _0x3d82(_0x4f241a,_0x4af27c){_0x4f241a=_0x4f241a-0x1b7;const _0x4b0b33=_0x4b0b();let _0x3d8283=_0x4b0b33[_0x4f241a];return _0x3d8283;}import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger',_0x5a5d54(0x22f)),AUTH_ORIGIN_PATH=join(homedir(),_0x5a5d54(0x24b),_0x5a5d54(0x229));export async function getMcpAuthOrigin(){const _0x129b36=_0x5a5d54,_0x52277a={'FmCvh':'utf-8'};try{const _0x1a65c1=(await readFile(AUTH_ORIGIN_PATH,_0x52277a[_0x129b36(0x1f2)]))[_0x129b36(0x209)]();return _0x1a65c1||null;}catch{return null;}}export async function mcpBootstrap(){const _0x245089=_0x5a5d54,_0x6e480a={'DSEpA':function(_0x29ffbe,_0x3d37e7){return _0x29ffbe+_0x3d37e7;},'NQxyE':_0x245089(0x1c8),'LRHsv':_0x245089(0x1d6)},_0x10f88e=getMcpAuthUrl();currentOrigin=_0x10f88e;const _0x145d2f=process['stdout'][_0x245089(0x1bc)]??![];console[_0x245089(0x201)](_0x245089(0x235)+_0x10f88e+'\x0a');const _0x2f4592=await tryUnauthenticated(_0x10f88e);let _0x111052=null;if(_0x2f4592==='proxied')_0x111052='';else{_0x111052=await loadCachedToken();if(!_0x111052){if(!_0x145d2f)throw new Error(_0x6e480a['DSEpA'](_0x6e480a['NQxyE'],_0x6e480a['LRHsv']));_0x111052=await oauthFlow(_0x10f88e);}}await callGetCliToken(_0x10f88e,_0x111052);}function _0x4b0b(){const _0x1c370d=['startsWith','clientSecret','structuredContent','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','result','code','POST','MCP\x20server\x20returned\x20HTTP\x20','7347915IdONCy','Bearer\x20','igSrp','IyFkG','expiresAt','status','sUYZo','text/html','type','1.0.0','WbRfr','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','ranger-cli','<html><body><h2>Authentication\x20failed</h2><p>','resource','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','YmSJY','\x0aUnexpected\x20response\x20structure:','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','sZwdC','writeHead','Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20','auth-origin.txt','60PAzhMO','KjQEs','vLrLy','S256','end','mcp-oauth-tokens.json','pfhnY','Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','open','json','Token\x20exchange\x20failed:\x20','\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20','gatDy','Client\x20registration\x20failed:\x20','sha256','expires_in','961128jWUeqp','code_challenge','VrUMo','2125715iuNzFs','WwILT','Unknown\x20error','kDyeY','needs-oauth','OAuth\x20error:\x20','client_secret','fiAyj','access_token','jtMzC','Not\x20found','client_id','xJPRC','parse','.ranger','58620ntaZZF','ltVtN','text','rkYym','OAuthTimeoutError','523030oJjtAr','SFnDb','\x0aToken\x20written\x20to\x20','isTTY','gtysN','/callback','Initializing\x20MCP\x20session...','initialize','clientId','data:','get','2.0','eAwlK','then','IRQLK','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','authorization_code','624533rMcNvB','headers','UDSWA','4UfeWXX','VTjDJ','kmeXT','bSAwf','Exchanging\x20authorization\x20code...','application/x-www-form-urlencoded','NcuOL','GWmLs','ZzYOa','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','IgwzH','tnZZb','refreshToken','stdout','51iCzlKi','http://localhost:','\x20done','SSRDo','udDvL','/.well-known/oauth-authorization-server','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','toString','OsvSo','write','DRgIe','BdjHe','set','text/event-stream','MCP\x20initialize\x20failed:\x20','yrVwA','utf-8','content','stringify','darwin','refresh_token','auKyF','includes','FmCvh','wuCmJ','527113zVxRgz','application/json,\x20text/event-stream','notifications/initialized','refxl','XCuyC','authorization_endpoint','origin','url','Ranger\x20CLI','message','authorization_servers','error','EcjGO','log','token_endpoint','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','now','token','listen','searchParams','2025-03-26','trim','registration_endpoint'];_0x4b0b=function(){return _0x1c370d;};return _0x4b0b();}async function tryUnauthenticated(_0x5e843e){const _0x3bd43a=_0x5a5d54,_0x69c111={'XIzII':function(_0x466827,_0x2b8fb2,_0x1536c8){return _0x466827(_0x2b8fb2,_0x1536c8);},'YBFtl':_0x3bd43a(0x211),'DRgIe':_0x3bd43a(0x1c4),'fiAyj':_0x3bd43a(0x1c0),'AjaCb':_0x3bd43a(0x21c),'exOFo':'proxied','eQdKB':function(_0xeb02d9,_0x9e4fad){return _0xeb02d9===_0x9e4fad;},'WwILT':_0x3bd43a(0x241)},_0x3418e9=await _0x69c111['XIzII'](fetch,_0x5e843e,{'method':_0x69c111['YBFtl'],'headers':{'Content-Type':'application/json','Accept':_0x3bd43a(0x1f5)},'body':JSON['stringify']({'jsonrpc':_0x69c111[_0x3bd43a(0x1e5)],'id':0x1,'method':_0x69c111[_0x3bd43a(0x244)],'params':{'protocolVersion':_0x3bd43a(0x208),'capabilities':{},'clientInfo':{'name':_0x3bd43a(0x21f),'version':_0x69c111['AjaCb']}}})});if(_0x3418e9['ok'])return await _0x3418e9[_0x3bd43a(0x24e)](),_0x69c111['exOFo'];if(_0x69c111['eQdKB'](_0x3418e9['status'],0x191))return await _0x3418e9['text'](),_0x69c111[_0x3bd43a(0x23e)];const _0x2833e7=await _0x3418e9[_0x3bd43a(0x24e)]();throw new Error(_0x3bd43a(0x212)+_0x3418e9[_0x3bd43a(0x218)]+':\x20'+_0x2833e7);}class OAuthTimeoutError extends Error{constructor(_0x33bd14){const _0x400f7e=_0x5a5d54,_0x34fd93={'ltVtN':_0x400f7e(0x1b8)};super(_0x33bd14),this['name']=_0x34fd93[_0x400f7e(0x24d)];}}async function oauthFlow(_0x444bcd){const _0xa1c71e=_0x5a5d54,_0x31a262={'ZDgfq':function(_0x274bf0,_0x5ad544){return _0x274bf0(_0x5ad544);},'WbRfr':function(_0x479bdd,_0x5a8d2c){return _0x479bdd instanceof _0x5a8d2c;},'VrUMo':function(_0x154ae3){return _0x154ae3();},'CscER':'\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'};try{return await _0x31a262['ZDgfq'](oauthFlowAttempt,_0x444bcd);}catch(_0x5de107){if(_0x31a262[_0xa1c71e(0x21d)](_0x5de107,OAuthTimeoutError)&&await _0x31a262[_0xa1c71e(0x23c)](loadCachedClient))return console['log'](_0x31a262['CscER']),await clearCachedClient(),await oauthFlowAttempt(_0x444bcd);throw _0x5de107;}}async function oauthFlowAttempt(_0x1769db){const _0x4160a8=_0x5a5d54,_0x55f744={'IyFkG':'Discovering\x20authorization\x20server...','ZvNls':function(_0xa43ec9,_0x1497ac){return _0xa43ec9(_0x1497ac);},'fffoy':function(_0x2f8b39){return _0x2f8b39();},'refxl':'Registering\x20OAuth\x20client...','jtMzC':function(_0x5686ef,_0x2f6566,_0x5bf18d){return _0x5686ef(_0x2f6566,_0x5bf18d);},'StUgu':_0x4160a8(0x211),'pUkda':'application/json','AlbgV':_0x4160a8(0x1fc),'DjCTv':'authorization_code','xggmu':'none','ARjXq':'base64url','pbHRZ':'hex','chrIh':'response_type','inOrC':_0x4160a8(0x248),'sUYZo':'redirect_uri','udDvL':'code_challenge_method','SSRDo':_0x4160a8(0x22d),'wuCmJ':'state','rDCQH':'\x0aOpening\x20browser\x20for\x20authentication...','IgwzH':function(_0x4255e0,_0x1eb92c){return _0x4255e0(_0x1eb92c);},'NiSyO':function(_0x4d1fe5,_0x5257fe){return _0x4d1fe5(_0x5257fe);},'knlms':_0x4160a8(0x221),'BdjHe':_0x4160a8(0x1d2),'Ecghi':function(_0x369b81,_0x13aa95,_0x276c4f,_0x515eb9){return _0x369b81(_0x13aa95,_0x276c4f,_0x515eb9);}},_0x51d61e=_0x1769db['replace'](/\/mcp$/,'');process[_0x4160a8(0x1da)][_0x4160a8(0x1e4)](_0x55f744[_0x4160a8(0x216)]);const _0x13eaac=await _0x55f744['ZvNls'](fetch,_0x51d61e+'/.well-known/oauth-protected-resource');if(!_0x13eaac['ok'])throw new Error(_0x4160a8(0x231));const _0x350ff7=await _0x13eaac['json'](),_0x4dde37=_0x350ff7[_0x4160a8(0x1fe)]?.[0x0];if(!_0x4dde37)throw new Error(_0x4160a8(0x21e));console['log']('\x20'+_0x4dde37);const _0x481e08=await fetchAuthServerMetadata(_0x4dde37);let _0x34d94a,_0x30dfc4;const _0x321344=await _0x55f744['fffoy'](loadCachedClient);if(_0x321344)_0x34d94a=_0x321344[_0x4160a8(0x1c1)],_0x30dfc4=_0x321344[_0x4160a8(0x20c)];else{if(_0x481e08[_0x4160a8(0x20a)]){process['stdout']['write'](_0x55f744[_0x4160a8(0x1f7)]);const _0x5c3dae=await _0x55f744[_0x4160a8(0x246)](fetch,_0x481e08['registration_endpoint'],{'method':_0x55f744['StUgu'],'headers':{'Content-Type':_0x55f744['pUkda']},'body':JSON[_0x4160a8(0x1ed)]({'client_name':_0x55f744['AlbgV'],'redirect_uris':['http://localhost:'+CALLBACK_PORT+'/callback'],'grant_types':[_0x55f744['DjCTv'],_0x4160a8(0x1ef)],'response_types':[_0x4160a8(0x210)],'token_endpoint_auth_method':_0x55f744['xggmu']})});if(!_0x5c3dae['ok']){const _0x65e39b=await _0x5c3dae[_0x4160a8(0x24e)]();throw new Error(_0x4160a8(0x237)+_0x65e39b);}const _0x284ec4=await _0x5c3dae[_0x4160a8(0x233)]();_0x34d94a=_0x284ec4[_0x4160a8(0x248)],_0x30dfc4=_0x284ec4[_0x4160a8(0x243)],await saveCachedClient(_0x34d94a,_0x30dfc4),console[_0x4160a8(0x201)](_0x4160a8(0x1dd));}else throw new Error(_0x4160a8(0x203));}const _0xedad1e=randomBytes(0x20)[_0x4160a8(0x1e2)](_0x55f744['ARjXq']),_0x4c9f44=createHash(_0x4160a8(0x238))['update'](_0xedad1e)['digest'](_0x55f744['ARjXq']),_0x5b72d3=randomBytes(0x10)['toString'](_0x55f744['pbHRZ']),_0x1f3b8a=new URL(_0x481e08[_0x4160a8(0x1f9)]);_0x1f3b8a[_0x4160a8(0x207)]['set'](_0x55f744['chrIh'],'code'),_0x1f3b8a['searchParams'][_0x4160a8(0x1e7)](_0x55f744['inOrC'],_0x34d94a),_0x1f3b8a['searchParams'][_0x4160a8(0x1e7)](_0x55f744[_0x4160a8(0x219)],_0x4160a8(0x1dc)+CALLBACK_PORT+'/callback'),_0x1f3b8a[_0x4160a8(0x207)][_0x4160a8(0x1e7)](_0x4160a8(0x23b),_0x4c9f44),_0x1f3b8a['searchParams']['set'](_0x55f744[_0x4160a8(0x1df)],_0x55f744[_0x4160a8(0x1de)]),_0x1f3b8a[_0x4160a8(0x207)][_0x4160a8(0x1e7)](_0x55f744[_0x4160a8(0x1f3)],_0x5b72d3);_0x350ff7[_0x4160a8(0x221)]&&_0x1f3b8a[_0x4160a8(0x207)]['set'](_0x4160a8(0x221),_0x350ff7['resource']);console['log'](_0x55f744['rDCQH']),console[_0x4160a8(0x201)](_0x4160a8(0x1e1)+_0x1f3b8a[_0x4160a8(0x1e2)]()+'\x0a'),await _0x55f744[_0x4160a8(0x1d7)](openBrowser,_0x1f3b8a['toString']());const _0x2b87c2=await _0x55f744['NiSyO'](waitForCallback,_0x5b72d3);process[_0x4160a8(0x1da)]['write'](_0x4160a8(0x1d1));const _0x4c071a=new URLSearchParams({'grant_type':_0x4160a8(0x1c9),'code':_0x2b87c2,'redirect_uri':_0x4160a8(0x1dc)+CALLBACK_PORT+'/callback','client_id':_0x34d94a,'code_verifier':_0xedad1e});_0x30dfc4&&_0x4c071a[_0x4160a8(0x1e7)]('client_secret',_0x30dfc4);_0x350ff7['resource']&&_0x4c071a['set'](_0x55f744['knlms'],_0x350ff7[_0x4160a8(0x221)]);const _0x135e5b=await fetch(_0x481e08[_0x4160a8(0x202)],{'method':'POST','headers':{'Content-Type':_0x55f744[_0x4160a8(0x1e6)]},'body':_0x4c071a});if(!_0x135e5b['ok']){const _0x556db1=await _0x135e5b[_0x4160a8(0x24e)]();throw new Error(_0x4160a8(0x234)+_0x556db1);}const _0x43338a=await _0x135e5b['json']();return console['log']('\x20done'),await _0x55f744['Ecghi'](saveCachedToken,_0x43338a[_0x4160a8(0x245)],_0x43338a[_0x4160a8(0x1ef)],_0x43338a[_0x4160a8(0x239)]),_0x43338a[_0x4160a8(0x245)];}async function callGetCliToken(_0x3bce0d,_0x1a870e){const _0x2bbe7f=_0x5a5d54,_0x4fd8b5={'bSAwf':function(_0x17b102,_0x28827a,_0x55a9cf){return _0x17b102(_0x28827a,_0x55a9cf);},'gatDy':'application/json','yXCnY':_0x2bbe7f(0x1f5),'SFnDb':'Authorization','ZwLDL':'2.0','EcjGO':_0x2bbe7f(0x208),'igSrp':'ranger-cli','kmeXT':_0x2bbe7f(0x1dd),'uyuge':'Requesting\x20CLI\x20token...','NcuOL':function(_0x43b5f9,_0x5da20b){return _0x43b5f9(_0x5da20b);},'xJPRC':function(_0x4404cd,_0x28b3a7){return _0x4404cd(_0x28b3a7);},'eAwlK':_0x2bbe7f(0x224),'vLrLy':function(_0x5880b2,_0x5eaa13,_0x42bb08,_0x776091){return _0x5880b2(_0x5eaa13,_0x42bb08,_0x776091);},'NZrBH':function(_0x551cb7,_0x41ae8c,_0x478c27){return _0x551cb7(_0x41ae8c,_0x478c27);},'hBqSB':'auth-origin.txt','auKyF':_0x2bbe7f(0x222)},_0x36b0e5={'Content-Type':_0x4fd8b5[_0x2bbe7f(0x236)],'Accept':_0x4fd8b5['yXCnY']};_0x1a870e&&(_0x36b0e5[_0x4fd8b5[_0x2bbe7f(0x1ba)]]=_0x2bbe7f(0x214)+_0x1a870e);const _0xfdf1c9=async _0x136863=>{const _0x577189=_0x2bbe7f,_0x1c5467=await _0x4fd8b5[_0x577189(0x1d0)](fetch,_0x3bce0d,{'method':_0x577189(0x211),'headers':_0x36b0e5,'body':JSON[_0x577189(0x1ed)](_0x136863)});if(!_0x1c5467['ok']){const _0x5095c0=await _0x1c5467[_0x577189(0x24e)]();throw new Error('HTTP\x20'+_0x1c5467['status']+':\x20'+_0x5095c0);}return parseResponse(_0x1c5467);};process[_0x2bbe7f(0x1da)][_0x2bbe7f(0x1e4)](_0x2bbe7f(0x1bf));const _0x15fd7b=await _0xfdf1c9({'jsonrpc':_0x4fd8b5['ZwLDL'],'id':0x1,'method':'initialize','params':{'protocolVersion':_0x4fd8b5[_0x2bbe7f(0x200)],'capabilities':{},'clientInfo':{'name':_0x4fd8b5[_0x2bbe7f(0x215)],'version':_0x2bbe7f(0x21c)}}});if(_0x15fd7b[_0x2bbe7f(0x1ff)])throw new Error(_0x2bbe7f(0x1e9)+(_0x15fd7b['error']['message']??JSON['stringify'](_0x15fd7b['error'])));console[_0x2bbe7f(0x201)](_0x4fd8b5[_0x2bbe7f(0x1cf)]),await fetch(_0x3bce0d,{'method':'POST','headers':_0x36b0e5,'body':JSON['stringify']({'jsonrpc':'2.0','method':_0x2bbe7f(0x1f6)})})[_0x2bbe7f(0x1c6)](_0x55c42a=>_0x55c42a['text']()),process['stdout'][_0x2bbe7f(0x1e4)](_0x4fd8b5['uyuge']);const _0x1fbee4=await _0x4fd8b5[_0x2bbe7f(0x1d3)](_0xfdf1c9,{'jsonrpc':_0x4fd8b5['ZwLDL'],'id':0x2,'method':'tools/call','params':{'name':'get_cli_token','arguments':{}}});if(_0x1fbee4['error'])throw new Error('get_cli_token\x20failed:\x20'+(_0x1fbee4['error'][_0x2bbe7f(0x1fd)]??JSON[_0x2bbe7f(0x1ed)](_0x1fbee4['error'])));console[_0x2bbe7f(0x201)](_0x4fd8b5[_0x2bbe7f(0x1cf)]);const _0x25a256=_0x4fd8b5[_0x2bbe7f(0x249)](extractToken,_0x1fbee4[_0x2bbe7f(0x20f)]);if(!_0x25a256){console[_0x2bbe7f(0x1ff)](_0x4fd8b5[_0x2bbe7f(0x1c5)]),console['error'](JSON[_0x2bbe7f(0x1ed)](_0x1fbee4[_0x2bbe7f(0x20f)],null,0x2));throw new Error('Could\x20not\x20extract\x20token\x20from\x20MCP\x20response');}const _0x34485d=join(homedir(),_0x2bbe7f(0x24b)),_0x40a5c3=_0x4fd8b5[_0x2bbe7f(0x1d0)](join,_0x34485d,'refresh.txt');await mkdir(_0x34485d,{'recursive':!![]}),await writeFile(_0x40a5c3,_0x25a256,{'mode':0x180}),await _0x4fd8b5[_0x2bbe7f(0x22c)](writeFile,_0x4fd8b5['NZrBH'](join,_0x34485d,_0x4fd8b5['hBqSB']),_0x3bce0d,{'mode':0x180}),console[_0x2bbe7f(0x201)](_0x2bbe7f(0x1bb)+_0x40a5c3),console['log'](_0x4fd8b5[_0x2bbe7f(0x1f0)]);}async function fetchAuthServerMetadata(_0x40ec60){const _0x1b6ba7=_0x5a5d54,_0xc7e5b0={'gUuND':function(_0xc9eeac,_0x131f56){return _0xc9eeac(_0x131f56);}},_0x49c1b5=_0x40ec60+_0x1b6ba7(0x1e0),_0x2a16fd=await _0xc7e5b0['gUuND'](fetch,_0x49c1b5);if(!_0x2a16fd['ok'])throw new Error(_0x1b6ba7(0x228)+_0x49c1b5+':\x20'+_0x2a16fd[_0x1b6ba7(0x218)]);return _0x2a16fd['json']();}function waitForCallback(_0x23f693){const _0x3e54bf=_0x5a5d54,_0x2964cf={'dFvGM':_0x3e54bf(0x1ff),'VTjDJ':'error_description','NHtVe':_0x3e54bf(0x21a)};return new Promise((_0x32d1c3,_0x6a02f2)=>{const _0x2e80ad=_0x3e54bf,_0x424217={'ZUJkx':function(_0x39eb87,_0x5c7f20){return _0x39eb87(_0x5c7f20);},'YwmAH':'state','GWmLs':_0x2964cf['dFvGM'],'JoKCB':_0x2964cf[_0x2e80ad(0x1ce)],'tnZZb':_0x2964cf['NHtVe'],'DZsUa':function(_0x11b9f0,_0x38e9ea){return _0x11b9f0(_0x38e9ea);}},_0x43b7c3=()=>{_0x2bce09['closeAllConnections'](),_0x2bce09['close']();},_0x227942=setTimeout(()=>{const _0x163ea7=_0x2e80ad;_0x43b7c3(),_0x424217['ZUJkx'](_0x6a02f2,new OAuthTimeoutError(_0x163ea7(0x225)));},0x1d4c0),_0x2bce09=createServer((_0x3c3e40,_0x43c759)=>{const _0x241573=_0x2e80ad,_0x38f80a=new URL(_0x3c3e40[_0x241573(0x1fb)]??'/',_0x241573(0x1dc)+CALLBACK_PORT);if(_0x38f80a['pathname']!==_0x241573(0x1be)){_0x43c759[_0x241573(0x227)](0x194),_0x43c759['end'](_0x241573(0x247));return;}const _0x22acd0=_0x38f80a[_0x241573(0x207)][_0x241573(0x1c3)](_0x241573(0x210)),_0x4c6d13=_0x38f80a[_0x241573(0x207)][_0x241573(0x1c3)](_0x424217['YwmAH']),_0x4e2707=_0x38f80a[_0x241573(0x207)]['get'](_0x424217[_0x241573(0x1d4)]);if(_0x4e2707){const _0x4e8fd1=_0x38f80a['searchParams']['get'](_0x424217['JoKCB'])??_0x4e2707;_0x43c759['writeHead'](0xc8,{'Content-Type':_0x424217[_0x241573(0x1d8)]}),_0x43c759['end'](_0x241573(0x220)+_0x4e8fd1+'</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>'),_0x424217['ZUJkx'](clearTimeout,_0x227942),_0x43b7c3(),_0x424217['DZsUa'](_0x6a02f2,new Error(_0x241573(0x242)+_0x4e8fd1));return;}if(!_0x22acd0||_0x4c6d13!==_0x23f693){_0x43c759['writeHead'](0x190,{'Content-Type':_0x241573(0x21a)}),_0x43c759[_0x241573(0x22e)]('<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>');return;}_0x43c759[_0x241573(0x227)](0xc8,{'Content-Type':_0x424217[_0x241573(0x1d8)]}),_0x43c759['end']('<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>'),clearTimeout(_0x227942),_0x43b7c3(),_0x32d1c3(_0x22acd0);});_0x2bce09[_0x2e80ad(0x206)](CALLBACK_PORT,'127.0.0.1');});}async function openBrowser(_0x397c08){const _0x313747=_0x5a5d54,_0x438d8f={'YmSJY':function(_0x57d62b,_0x435ab7){return _0x57d62b===_0x435ab7;},'KjQEs':'start','sZwdC':function(_0x2d82ec,_0x266072){return _0x2d82ec(_0x266072);}},_0x3c519f=process['platform']===_0x313747(0x1ee)?_0x313747(0x232):_0x438d8f[_0x313747(0x223)](process['platform'],'win32')?_0x438d8f[_0x313747(0x22b)]:'xdg-open';_0x438d8f[_0x313747(0x226)](exec,_0x3c519f+'\x20\x22'+_0x397c08+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x28dcb6=_0x5a5d54,_0x32f8cb={'UDSWA':function(_0x5f4ce0,_0x2ca9dc){return _0x5f4ce0!==_0x2ca9dc;},'jxzsA':function(_0x54e9d9,_0x217bb8){return _0x54e9d9>_0x217bb8;}};try{const _0x156277=JSON['parse'](await readFile(TOKEN_CACHE_PATH,'utf-8'));if(_0x156277[_0x28dcb6(0x1fa)]&&_0x32f8cb[_0x28dcb6(0x1cc)](_0x156277['origin'],currentOrigin))return null;if(_0x156277['expiresAt']&&_0x32f8cb['jxzsA'](Date['now'](),_0x156277[_0x28dcb6(0x217)]))return null;return _0x156277['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0x287265,_0x233c6b,_0xcc808d){const _0x207e1d=_0x5a5d54,_0x3e1229={'Jdmzv':function(_0x57587b,_0x171ee1){return _0x57587b+_0x171ee1;},'rkYym':function(_0x89b996,_0x1ebb43){return _0x89b996*_0x1ebb43;},'kDyeY':function(_0x2d740d,_0x57a7ab,_0x2c914c){return _0x2d740d(_0x57a7ab,_0x2c914c);},'yrVwA':function(_0x2b1094,_0x16a186,_0x5992a8,_0x447668){return _0x2b1094(_0x16a186,_0x5992a8,_0x447668);}},_0x1340c4=await loadCachedData(),_0x6e2b50={..._0x1340c4,'origin':currentOrigin,'accessToken':_0x287265,'refreshToken':_0x233c6b??_0x1340c4?.[_0x207e1d(0x1d9)],'expiresAt':_0xcc808d?_0x3e1229['Jdmzv'](Date[_0x207e1d(0x204)](),_0x3e1229[_0x207e1d(0x1b7)](_0xcc808d,0x3e8)):undefined};await mkdir(_0x3e1229[_0x207e1d(0x240)](join,homedir(),_0x207e1d(0x24b)),{'recursive':!![]}),await _0x3e1229[_0x207e1d(0x1ea)](writeFile,TOKEN_CACHE_PATH,JSON[_0x207e1d(0x1ed)](_0x6e2b50),{'mode':0x180});}async function loadCachedClient(){const _0x490df7=_0x5a5d54,_0x45b7ef={'pfhnY':function(_0x469d3b){return _0x469d3b();}},_0x266e1e=await _0x45b7ef[_0x490df7(0x230)](loadCachedData);if(_0x266e1e?.[_0x490df7(0x1fa)]&&_0x266e1e[_0x490df7(0x1fa)]!==currentOrigin)return null;return _0x266e1e?.['clientId']?{'clientId':_0x266e1e['clientId'],'clientSecret':_0x266e1e['clientSecret']}:null;}async function clearCachedClient(){const _0x489540=_0x5a5d54,_0x45741c=await loadCachedData();if(!_0x45741c)return;const {clientId:_0x1928c3,clientSecret:_0x3cc607,..._0x4dbe69}=_0x45741c;await writeFile(TOKEN_CACHE_PATH,JSON[_0x489540(0x1ed)](_0x4dbe69),{'mode':0x180});}async function saveCachedClient(_0x53f1d1,_0x1f243e){const _0x2f91b3=_0x5a5d54,_0x5c04ae={'ZzYOa':function(_0x49aaec){return _0x49aaec();},'OsvSo':_0x2f91b3(0x24b),'XCuyC':function(_0x32cb8e,_0x4b9b51,_0x16de05,_0xbd9230){return _0x32cb8e(_0x4b9b51,_0x16de05,_0xbd9230);}},_0x12272f=await _0x5c04ae[_0x2f91b3(0x1d5)](loadCachedData),_0xfc526d={..._0x12272f,'origin':currentOrigin,'accessToken':_0x12272f?.['accessToken']??'','clientId':_0x53f1d1,'clientSecret':_0x1f243e};await mkdir(join(homedir(),_0x5c04ae[_0x2f91b3(0x1e3)]),{'recursive':!![]}),await _0x5c04ae[_0x2f91b3(0x1f8)](writeFile,TOKEN_CACHE_PATH,JSON[_0x2f91b3(0x1ed)](_0xfc526d),{'mode':0x180});}async function loadCachedData(){const _0x4c1cce=_0x5a5d54,_0x4fd288={'gtysN':function(_0x585466,_0x5e5392,_0x1880a4){return _0x585466(_0x5e5392,_0x1880a4);},'wxWML':_0x4c1cce(0x1eb)};try{return JSON['parse'](await _0x4fd288[_0x4c1cce(0x1bd)](readFile,TOKEN_CACHE_PATH,_0x4fd288['wxWML']));}catch{return null;}}async function parseResponse(_0x18ce2f){const _0x279e62=_0x5a5d54,_0x43dfe6={'IRQLK':'content-type','UjtrP':_0x279e62(0x1e8),'soTHT':function(_0x39298e,_0x17e358){return _0x39298e!==_0x17e358;}},_0x245e27=_0x18ce2f[_0x279e62(0x1cb)]['get'](_0x43dfe6[_0x279e62(0x1c7)])??'';if(_0x245e27[_0x279e62(0x1f1)](_0x43dfe6['UjtrP'])){const _0x5061c6=await _0x18ce2f['text']();for(const _0x419864 of _0x5061c6['split']('\x0a')){const _0x36dc3e=_0x419864['trim']();if(_0x36dc3e[_0x279e62(0x20b)](_0x279e62(0x1c2))){const _0x37a414=_0x36dc3e['slice'](_0x279e62(0x1c2)['length'])[_0x279e62(0x209)]();if(!_0x37a414)continue;try{const _0x37f9b2=JSON['parse'](_0x37a414);if(_0x43dfe6['soTHT'](_0x37f9b2['id'],undefined)||_0x37f9b2['error'])return _0x37f9b2;}catch{}}}throw new Error(_0x279e62(0x20e));}return _0x18ce2f['json']();}function extractToken(_0x2a8319){const _0x341e22=_0x5a5d54,_0x2b2449={'YtipN':function(_0x5204da,_0x420b5f){return _0x5204da===_0x420b5f;},'jviau':'string','NrGKR':_0x341e22(0x23f)};if(!_0x2a8319)return null;const _0x1d4fd7=_0x2a8319[_0x341e22(0x20d)];if(_0x1d4fd7?.['token']&&_0x2b2449['YtipN'](typeof _0x1d4fd7['token'],_0x2b2449['jviau']))return _0x1d4fd7[_0x341e22(0x205)];if(_0x2a8319['isError']){const _0x2bb6c0=_0x2a8319[_0x341e22(0x1ec)];throw new Error('Server\x20returned\x20error:\x20'+(_0x2bb6c0?.[0x0]?.['text']??_0x2b2449['NrGKR']));}const _0x28ca9e=_0x2a8319['content'];if(_0x28ca9e)for(const _0x2e68fc of _0x28ca9e){if(_0x2b2449['YtipN'](_0x2e68fc[_0x341e22(0x21b)],'text')&&_0x2e68fc[_0x341e22(0x24e)]){try{const _0x7f3b69=JSON[_0x341e22(0x24a)](_0x2e68fc['text']);if(typeof _0x7f3b69?.['token']===_0x2b2449['jviau'])return _0x7f3b69[_0x341e22(0x205)];}catch{}const _0x3a3ac3=_0x2e68fc['text']['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x3a3ac3)return _0x3a3ac3[0x1];}}return null;}
@@ -1 +1 @@
1
- function _0x7bea(){var _0x4d6c3b=['BNnxE','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','exit','fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.','10424GYpkJR','5873252RYyaLJ','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','6jIcSQr','5898455GaUagQ','RWsuV','4735791VeWgfU','3512108fxLASl','109VuHObC','3147793WtQUZS','10BCEghx','24cHbtKB','2418774dLPUKn'];_0x7bea=function(){return _0x4d6c3b;};return _0x7bea();}(function(_0x5b30b3,_0x5106bb){var _0x2d7065=_0x3212,_0x34de2b=_0x5b30b3();while(!![]){try{var _0xdcb603=-parseInt(_0x2d7065(0x1a7))/0x1*(parseInt(_0x2d7065(0x19f))/0x2)+parseInt(_0x2d7065(0x1ab))/0x3+-parseInt(_0x2d7065(0x1a6))/0x4+-parseInt(_0x2d7065(0x1a3))/0x5+parseInt(_0x2d7065(0x1a2))/0x6*(parseInt(_0x2d7065(0x1a0))/0x7)+-parseInt(_0x2d7065(0x1aa))/0x8*(-parseInt(_0x2d7065(0x1a5))/0x9)+-parseInt(_0x2d7065(0x1a9))/0xa*(-parseInt(_0x2d7065(0x1a8))/0xb);if(_0xdcb603===_0x5106bb)break;else _0x34de2b['push'](_0x34de2b['shift']());}catch(_0x5b25fa){_0x34de2b['push'](_0x34de2b['shift']());}}}(_0x7bea,0xd7e04));function _0x3212(_0x2ffdee,_0x5a927d){_0x2ffdee=_0x2ffdee-0x19f;var _0x7beaad=_0x7bea();var _0x321264=_0x7beaad[_0x2ffdee];return _0x321264;}export async function migrateProfile(_0x5d5970,_0x1ebc9f){var _0x48620c=_0x3212,_0x4c198b={'BNnxE':function(_0x293b6b,_0x4e7c2d){return _0x293b6b+_0x4e7c2d;},'itvAb':function(_0x3ced5e,_0x5e9d70){return _0x3ced5e+_0x5e9d70;},'IzfVK':function(_0x23a493,_0x2f09e7){return _0x23a493+_0x2f09e7;},'VaamY':'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','RWsuV':_0x48620c(0x1a1)};console['error'](_0x4c198b[_0x48620c(0x1ac)](_0x4c198b['itvAb'](_0x4c198b['IzfVK'](_0x4c198b['IzfVK']('ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a'+'\x0a'+_0x48620c(0x1ad)+_0x4c198b['VaamY'],'\x0a'),_0x4c198b[_0x48620c(0x1a4)]),'\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a')+'\x0a','Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a')+_0x48620c(0x1af)),process[_0x48620c(0x1ae)](0x1);}
1
+ function _0x2371(_0x4c34fe,_0x450f8f){_0x4c34fe=_0x4c34fe-0x151;var _0x5c0a54=_0x5c0a();var _0x237152=_0x5c0a54[_0x4c34fe];return _0x237152;}(function(_0x2ef4ea,_0x10e44e){var _0x5cde0b=_0x2371,_0x58bf26=_0x2ef4ea();while(!![]){try{var _0x5c88ad=-parseInt(_0x5cde0b(0x151))/0x1*(parseInt(_0x5cde0b(0x158))/0x2)+parseInt(_0x5cde0b(0x153))/0x3+parseInt(_0x5cde0b(0x157))/0x4+parseInt(_0x5cde0b(0x156))/0x5+parseInt(_0x5cde0b(0x162))/0x6+parseInt(_0x5cde0b(0x161))/0x7*(parseInt(_0x5cde0b(0x15c))/0x8)+-parseInt(_0x5cde0b(0x15d))/0x9*(parseInt(_0x5cde0b(0x15b))/0xa);if(_0x5c88ad===_0x10e44e)break;else _0x58bf26['push'](_0x58bf26['shift']());}catch(_0x5f0087){_0x58bf26['push'](_0x58bf26['shift']());}}}(_0x5c0a,0x843e2));export async function migrateProfile(_0x15753e,_0xa4a9d6){var _0xb8f265=_0x2371,_0x3c950a={'qwTrc':function(_0x44a51c,_0x294e72){return _0x44a51c+_0x294e72;},'nNdDv':function(_0x44e5b7,_0x243f8a){return _0x44e5b7+_0x243f8a;},'wEJEa':function(_0x15e877,_0x564b26){return _0x15e877+_0x564b26;},'zidCv':_0xb8f265(0x160),'tHVGQ':'\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a'};console[_0xb8f265(0x159)](_0x3c950a[_0xb8f265(0x154)](_0x3c950a[_0xb8f265(0x154)](_0x3c950a['nNdDv'](_0x3c950a['wEJEa'](_0x3c950a['nNdDv'](_0x3c950a[_0xb8f265(0x152)]+'\x0a'+_0xb8f265(0x163),_0xb8f265(0x15e)),'\x0a')+_0xb8f265(0x15a),_0x3c950a[_0xb8f265(0x155)])+'\x0a','Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a'),_0xb8f265(0x15f))),process['exit'](0x1);}function _0x5c0a(){var _0x33a470=['\x20\x20ranger\x20profile\x20add\x20<name>\x0a','fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.','ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','3341317pNsWhv','5153928cMqvQW','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','72543KpNnVx','zidCv','67860yQrUev','qwTrc','tHVGQ','273610VeBRpU','3990212UyiXQz','18FBPJHK','error','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','8810JQWCPm','8YFnQcb','12429CoqHvM'];_0x5c0a=function(){return _0x33a470;};return _0x5c0a();}
@@ -1 +1 @@
1
- (function(_0x49d510,_0x143429){const _0x439838=_0x3e24,_0x1f7d26=_0x49d510();while(!![]){try{const _0x3e7da9=-parseInt(_0x439838(0x97))/0x1+-parseInt(_0x439838(0xab))/0x2+-parseInt(_0x439838(0xb4))/0x3+parseInt(_0x439838(0x8d))/0x4+-parseInt(_0x439838(0xb2))/0x5*(-parseInt(_0x439838(0x9b))/0x6)+-parseInt(_0x439838(0x9e))/0x7*(-parseInt(_0x439838(0xbf))/0x8)+-parseInt(_0x439838(0xbe))/0x9*(-parseInt(_0x439838(0xbd))/0xa);if(_0x3e7da9===_0x143429)break;else _0x1f7d26['push'](_0x1f7d26['shift']());}catch(_0x48a73a){_0x1f7d26['push'](_0x1f7d26['shift']());}}}(_0x599e,0xefa34));import{join}from'path';import{existsSync}from'fs';import _0x3a1e02 from'inquirer';import{skillup}from'../skillup.js';function _0x599e(){const _0x513426=['ReUgm','.claude','enable','2993984lFguAF','zovFO','error','output','pluginScope','marketplace','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','470QHbbqQ','fhKxM','4925979niPmdd','ycCUZ','ranger','PyemM','\x20level)...\x0a','ranger-testing/trailhead','BHZIS','ranger@trailhead','Dezze','20YIzeth','15291999vapeAo','248uhCHnH','❌\x20Failed\x20to\x20add\x20marketplace:','uqaiq','yTxhu','768992dabxSS','trailhead','includes','✓\x20Ranger\x20skills\x20already\x20installed','❌\x20Failed\x20to\x20install\x20plugin:','SKILL.md','RBdVs','UdDJp','project','wantsSkillup','1509826DJvTmS','success','GksOn','\x0aYou\x20can\x20install\x20manually\x20with:','49686xRNKsZ','prompt','\x0aInstalling\x20Claude\x20Code\x20plugin\x20(','284851MdgBPN','✓\x20Claude\x20Code\x20plugin\x20enabled','already\x20enabled','aMqhF','GTHbv','MlqtI','arzJm','log','user','TMZiV'];_0x599e=function(){return _0x513426;};return _0x599e();}function _0x3e24(_0x2e95d2,_0x1a72f1){_0x2e95d2=_0x2e95d2-0x8b;const _0x599ec1=_0x599e();let _0x3e24df=_0x599ec1[_0x2e95d2];return _0x3e24df;}import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x20b8d5){const _0x3eeb17=_0x3e24,_0x4f8735={'zovFO':_0x3eeb17(0xbb),'aRFCy':function(_0x2fa965,_0x4e9112){return _0x2fa965(_0x4e9112);},'yTxhu':function(_0x63c15b,_0x2f71fe,_0x1a31ae){return _0x63c15b(_0x2f71fe,_0x1a31ae);},'RBdVs':'.claude','fhKxM':_0x3eeb17(0x95),'arzJm':'\x0a📦\x20Claude\x20Code\x20Plugin\x0a','ReUgm':_0x3eeb17(0xaf),'mvfPr':'Where\x20should\x20the\x20plugin\x20be\x20installed?','CkIiQ':'User\x20(available\x20in\x20all\x20your\x20projects)','Dezze':_0x3eeb17(0xa6),'MlqtI':function(_0x5598ff,_0x29c014){return _0x5598ff(_0x29c014);},'uzJBI':'plugin','OSWsM':'--scope','vFefw':function(_0x2a8a0a,_0x2dc5e5){return _0x2a8a0a===_0x2dc5e5;},'GksOn':_0x3eeb17(0x91),'uqaiq':function(_0x27f885,_0x3efcb7){return _0x27f885===_0x3efcb7;},'GTHbv':function(_0x552a7b,_0x52a88d,_0x55786b){return _0x552a7b(_0x52a88d,_0x55786b);},'aMqhF':_0x3eeb17(0x9f)},_0x9c3a6f=await isPluginInstalled(_0x4f8735['zovFO']);if(_0x9c3a6f)return console['log']('✓\x20Claude\x20Code\x20plugin\x20already\x20installed'),![];const _0x5d0ef5=_0x4f8735['aRFCy'](existsSync,_0x4f8735[_0x3eeb17(0x8c)](join,getProjectRoot(),_0x4f8735[_0x3eeb17(0x93)]));let _0x1e8b75;if(_0x20b8d5)_0x1e8b75=_0x20b8d5;else{if(_0x5d0ef5)_0x1e8b75=_0x4f8735['fhKxM'];else{console[_0x3eeb17(0xa5)](_0x4f8735[_0x3eeb17(0xa4)]);const _0x4f8492=await _0x3a1e02[_0x3eeb17(0x9c)]([{'type':'list','name':_0x4f8735[_0x3eeb17(0xa8)],'message':_0x4f8735['mvfPr'],'choices':[{'name':_0x4f8735['CkIiQ'],'value':_0x4f8735['Dezze']},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':_0x4f8735['fhKxM']}],'default':_0x4f8735[_0x3eeb17(0xbc)]}]);_0x1e8b75=_0x4f8492['pluginScope'];}}console['log'](_0x3eeb17(0x9d)+_0x1e8b75+_0x3eeb17(0xb8));const _0x14fc65=await isMarketplaceAdded(_0x3eeb17(0x8e));let _0x229dc5=_0x14fc65;if(_0x14fc65)console['log']('✓\x20Marketplace\x20already\x20added');else{const _0x542413=await _0x4f8735[_0x3eeb17(0xa3)](runClaudeCommand,['plugin',_0x3eeb17(0xb0),'add',_0x3eeb17(0xb9)]);!_0x542413['success']?(console['error'](_0x3eeb17(0xc0),_0x542413['error']),console[_0x3eeb17(0xa5)](_0x3eeb17(0x9a)),console[_0x3eeb17(0xa5)]('\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead'),console[_0x3eeb17(0xa5)](_0x3eeb17(0xb1)+_0x1e8b75)):_0x229dc5=!![];}if(_0x229dc5){const _0x295931=await runClaudeCommand([_0x4f8735['uzJBI'],'install',_0x4f8735[_0x3eeb17(0xac)],_0x4f8735['OSWsM'],_0x1e8b75],{'cwd':_0x4f8735['vFefw'](_0x1e8b75,'project')?getProjectRoot():undefined});if(!_0x295931[_0x3eeb17(0x98)])console[_0x3eeb17(0xad)](_0x4f8735[_0x3eeb17(0x99)],_0x295931[_0x3eeb17(0xad)]),console['log']('\x0aYou\x20can\x20install\x20manually\x20with:'),console['log']('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x1e8b75);else{console[_0x3eeb17(0xa5)]('✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully');const _0x42a5ff=[_0x4f8735['uzJBI'],_0x3eeb17(0xaa),_0x4f8735[_0x3eeb17(0xac)]];_0x4f8735[_0x3eeb17(0x8b)](_0x1e8b75,'project')&&_0x42a5ff['push']('--scope',_0x3eeb17(0x95));const _0x12f796=await _0x4f8735[_0x3eeb17(0xa2)](runClaudeCommand,_0x42a5ff,{'captureOutput':!![],'cwd':_0x1e8b75===_0x4f8735[_0x3eeb17(0xb3)]?getProjectRoot():undefined}),_0xc60130=_0x12f796[_0x3eeb17(0xae)]?.[_0x3eeb17(0x8f)](_0x3eeb17(0xa0));!_0x12f796[_0x3eeb17(0x98)]&&!_0xc60130?console['error']('⚠\x20Failed\x20to\x20enable\x20plugin:',_0x12f796[_0x3eeb17(0xad)]):console[_0x3eeb17(0xa5)](_0x4f8735[_0x3eeb17(0xa1)]);}}return!![];}export async function ensureClaudeSkills(_0x53cafb){const _0x513033=_0x3e24,_0x498236={'dzmbM':function(_0x270d0d,_0x292115,_0x5cb25a,_0x533b00){return _0x270d0d(_0x292115,_0x5cb25a,_0x533b00);},'ycCUZ':function(_0x2fb46d,_0x273cab){return _0x2fb46d(_0x273cab);},'UdDJp':'user','TMZiV':function(_0x499269,_0x6783ed,_0xda97f6,_0x4d939e){return _0x499269(_0x6783ed,_0xda97f6,_0x4d939e);},'eDdsH':'ranger','RXttS':function(_0x1f679a,_0x328c9a){return _0x1f679a(_0x328c9a);},'BHZIS':function(_0x282622,_0x4197e9,_0x744fb1){return _0x282622(_0x4197e9,_0x744fb1);},'uCuBX':function(_0x401ae7){return _0x401ae7();},'PyemM':_0x513033(0xa9),'MmMUY':_0x513033(0x96),'mIkFi':'Would\x20you\x20like\x20to\x20install\x20skills?','xXdME':function(_0x47323d,_0x6281cc){return _0x47323d(_0x6281cc);}},_0x1824f6=existsSync(_0x498236['dzmbM'](join,_0x498236['ycCUZ'](getSkillsDir,_0x498236[_0x513033(0x94)]),_0x513033(0xb6),_0x513033(0x92))),_0x55ed66=existsSync(_0x498236[_0x513033(0xa7)](join,getSkillsDir('project'),_0x498236['eDdsH'],_0x513033(0x92)));if(_0x1824f6||_0x55ed66)return console[_0x513033(0xa5)](_0x513033(0x90)),![];const _0x3e3bd8=_0x498236['RXttS'](existsSync,_0x498236[_0x513033(0xba)](join,_0x498236['uCuBX'](getProjectRoot),_0x498236[_0x513033(0xb7)]));let _0x19db91=!![];if(_0x53cafb)await _0x498236['ycCUZ'](skillup,{'autoInstall':_0x53cafb,'suppressUsage':!![]});else{if(_0x3e3bd8)await _0x498236[_0x513033(0xb5)](skillup,{'autoInstall':'project','suppressUsage':!![]});else{const _0xdfe203=await _0x3a1e02['prompt']([{'type':'confirm','name':_0x498236['MmMUY'],'message':_0x498236['mIkFi'],'default':!![]}]);_0x19db91=_0xdfe203['wantsSkillup'],_0x19db91&&await _0x498236['xXdME'](skillup,{'suppressUsage':!![]});}}return _0x19db91;}
1
+ (function(_0x3c372d,_0xd3f44b){const _0x15c268=_0x5b35,_0x3b2dad=_0x3c372d();while(!![]){try{const _0x1c03c8=-parseInt(_0x15c268(0x1cf))/0x1*(parseInt(_0x15c268(0x1c7))/0x2)+-parseInt(_0x15c268(0x1eb))/0x3+-parseInt(_0x15c268(0x1ea))/0x4*(-parseInt(_0x15c268(0x1ba))/0x5)+-parseInt(_0x15c268(0x1be))/0x6*(-parseInt(_0x15c268(0x1db))/0x7)+parseInt(_0x15c268(0x1e0))/0x8*(-parseInt(_0x15c268(0x1e6))/0x9)+-parseInt(_0x15c268(0x1c5))/0xa+parseInt(_0x15c268(0x1d5))/0xb*(parseInt(_0x15c268(0x1e5))/0xc);if(_0x1c03c8===_0xd3f44b)break;else _0x3b2dad['push'](_0x3b2dad['shift']());}catch(_0x289e64){_0x3b2dad['push'](_0x3b2dad['shift']());}}}(_0x3276,0xdd4a6));import{join}from'path';function _0x5b35(_0x1bd2aa,_0x47b782){_0x1bd2aa=_0x1bd2aa-0x1b3;const _0x32768c=_0x3276();let _0x5b3590=_0x32768c[_0x1bd2aa];return _0x5b3590;}import{existsSync}from'fs';import _0x2af99a from'inquirer';function _0x3276(){const _0x109f74=['plugin','218nijwHn','project','\x20level)...\x0a','EsHdH','gpNgf','❌\x20Failed\x20to\x20add\x20marketplace:','ranger@trailhead','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','8027GiwOSu','enable','push','prLGu','tFqQk','jJIkA','496507mhHlEW','LKjYG','KXHWT','ranger','CeDFw','.claude','133mBUnMS','\x0aYou\x20can\x20install\x20manually\x20with:','QtIxE','madco','mepoU','81224lpjswK','error','GGLtD','Project\x20(shared\x20with\x20team\x20via\x20git)','hVYXD','600MtckIb','1251utpkVa','Where\x20should\x20the\x20plugin\x20be\x20installed?','SHLca','TnotL','37404qtYJyZ','1902036EPhDbP','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','confirm','log','MpvVQ','yqVoh','✓\x20Claude\x20Code\x20plugin\x20enabled','marketplace','515xhRhWQ','⚠\x20Failed\x20to\x20enable\x20plugin:','MmurO','gSsFZ','507972HVUrcJ','GdmkU','SKILL.md','Rgirl','dYRdb','kHreA','FgqGN','10019530bKaivT'];_0x3276=function(){return _0x109f74;};return _0x3276();}import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x484de6){const _0x45a00e=_0x5b35,_0x4b4f75={'FgqGN':function(_0x4be750,_0x44d2ef){return _0x4be750(_0x44d2ef);},'MTxgh':_0x45a00e(0x1cd),'Ivlpy':'✓\x20Claude\x20Code\x20plugin\x20already\x20installed','Rgirl':function(_0x139f78,_0xfdbeab,_0x3c635e){return _0x139f78(_0xfdbeab,_0x3c635e);},'MmurO':function(_0x3a08ac){return _0x3a08ac();},'tFqQk':_0x45a00e(0x1c8),'PCjen':'\x0a📦\x20Claude\x20Code\x20Plugin\x0a','SHLca':'list','JgVlG':'pluginScope','axxud':_0x45a00e(0x1e7),'RuzFb':'User\x20(available\x20in\x20all\x20your\x20projects)','madco':'user','ugeKK':_0x45a00e(0x1e3),'gSsFZ':'✓\x20Marketplace\x20already\x20added','kDtgl':_0x45a00e(0x1c6),'fteAC':_0x45a00e(0x1b9),'LKjYG':'add','YkPmo':_0x45a00e(0x1cc),'MpvVQ':'--scope','CeDFw':function(_0x32c756,_0x4f5bb3){return _0x32c756===_0x4f5bb3;},'gpNgf':'❌\x20Failed\x20to\x20install\x20plugin:','dYRdb':_0x45a00e(0x1dc),'mlckd':'✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','kHreA':_0x45a00e(0x1d0),'yqVoh':function(_0x16ad44,_0x416e2e){return _0x16ad44===_0x416e2e;},'KXHWT':function(_0xd58671,_0xde98eb){return _0xd58671===_0xde98eb;},'mepoU':'already\x20enabled','GGLtD':_0x45a00e(0x1bb)},_0x4bb46d=await _0x4b4f75['FgqGN'](isPluginInstalled,_0x4b4f75['MTxgh']);if(_0x4bb46d)return console[_0x45a00e(0x1b5)](_0x4b4f75['Ivlpy']),![];const _0x1272a8=existsSync(_0x4b4f75[_0x45a00e(0x1c1)](join,_0x4b4f75['MmurO'](getProjectRoot),_0x45a00e(0x1da)));let _0x23ba49;if(_0x484de6)_0x23ba49=_0x484de6;else{if(_0x1272a8)_0x23ba49=_0x4b4f75[_0x45a00e(0x1d3)];else{console[_0x45a00e(0x1b5)](_0x4b4f75['PCjen']);const _0x43eab9=await _0x2af99a['prompt']([{'type':_0x4b4f75[_0x45a00e(0x1e8)],'name':_0x4b4f75['JgVlG'],'message':_0x4b4f75['axxud'],'choices':[{'name':_0x4b4f75['RuzFb'],'value':_0x4b4f75[_0x45a00e(0x1de)]},{'name':_0x4b4f75['ugeKK'],'value':_0x45a00e(0x1c8)}],'default':'user'}]);_0x23ba49=_0x43eab9['pluginScope'];}}console['log']('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x23ba49+_0x45a00e(0x1c9));const _0x446e1e=await _0x4b4f75[_0x45a00e(0x1c4)](isMarketplaceAdded,'trailhead');let _0x2dcf2d=_0x446e1e;if(_0x446e1e)console[_0x45a00e(0x1b5)](_0x4b4f75[_0x45a00e(0x1bd)]);else{const _0x54f94b=await runClaudeCommand([_0x4b4f75['kDtgl'],_0x4b4f75['fteAC'],_0x4b4f75[_0x45a00e(0x1d6)],'ranger-testing/trailhead']);!_0x54f94b['success']?(console[_0x45a00e(0x1e1)](_0x4b4f75['YkPmo'],_0x54f94b[_0x45a00e(0x1e1)]),console['log']('\x0aYou\x20can\x20install\x20manually\x20with:'),console['log'](_0x45a00e(0x1ce)),console[_0x45a00e(0x1b5)](_0x45a00e(0x1b3)+_0x23ba49)):_0x2dcf2d=!![];}if(_0x2dcf2d){const _0x3ecf11=await runClaudeCommand([_0x4b4f75['kDtgl'],'install','ranger@trailhead',_0x4b4f75[_0x45a00e(0x1b6)],_0x23ba49],{'cwd':_0x4b4f75[_0x45a00e(0x1d9)](_0x23ba49,_0x45a00e(0x1c8))?_0x4b4f75['MmurO'](getProjectRoot):undefined});if(!_0x3ecf11['success'])console['error'](_0x4b4f75[_0x45a00e(0x1cb)],_0x3ecf11['error']),console[_0x45a00e(0x1b5)](_0x4b4f75[_0x45a00e(0x1c2)]),console[_0x45a00e(0x1b5)](_0x45a00e(0x1b3)+_0x23ba49);else{console['log'](_0x4b4f75['mlckd']);const _0x24b3d2=[_0x45a00e(0x1c6),_0x4b4f75[_0x45a00e(0x1c3)],_0x4b4f75['MTxgh']];_0x4b4f75[_0x45a00e(0x1b7)](_0x23ba49,_0x45a00e(0x1c8))&&_0x24b3d2[_0x45a00e(0x1d1)]('--scope',_0x4b4f75['tFqQk']);const _0x32c72b=await runClaudeCommand(_0x24b3d2,{'captureOutput':!![],'cwd':_0x4b4f75[_0x45a00e(0x1d7)](_0x23ba49,_0x4b4f75[_0x45a00e(0x1d3)])?_0x4b4f75[_0x45a00e(0x1bc)](getProjectRoot):undefined}),_0x14736e=_0x32c72b['output']?.['includes'](_0x4b4f75[_0x45a00e(0x1df)]);!_0x32c72b['success']&&!_0x14736e?console['error'](_0x4b4f75[_0x45a00e(0x1e2)],_0x32c72b['error']):console['log'](_0x45a00e(0x1b8));}}return!![];}export async function ensureClaudeSkills(_0x31133f){const _0xa4999b=_0x5b35,_0x2accde={'prLGu':function(_0x4bfd44,_0x53e736){return _0x4bfd44(_0x53e736);},'QtIxE':function(_0x30b925,_0xc5d88f,_0x1fa60c,_0x35e3be){return _0x30b925(_0xc5d88f,_0x1fa60c,_0x35e3be);},'TnotL':'project','KFCPf':_0xa4999b(0x1d8),'hVYXD':function(_0x547770,_0x149662){return _0x547770||_0x149662;},'jJIkA':'✓\x20Ranger\x20skills\x20already\x20installed','EsHdH':function(_0xb75352,_0x735c65,_0x14d41c){return _0xb75352(_0x735c65,_0x14d41c);},'VXcgE':function(_0x1fbfb1){return _0x1fbfb1();},'GdmkU':'.claude','OQXgq':'wantsSkillup','Siaex':'Would\x20you\x20like\x20to\x20install\x20skills?','DZilz':function(_0x5b52a3,_0x3dcdf4){return _0x5b52a3(_0x3dcdf4);}},_0x215b82=_0x2accde['prLGu'](existsSync,_0x2accde[_0xa4999b(0x1dd)](join,_0x2accde['prLGu'](getSkillsDir,'user'),'ranger',_0xa4999b(0x1c0))),_0x3f3dca=existsSync(join(_0x2accde['prLGu'](getSkillsDir,_0x2accde[_0xa4999b(0x1e9)]),_0x2accde['KFCPf'],'SKILL.md'));if(_0x2accde[_0xa4999b(0x1e4)](_0x215b82,_0x3f3dca))return console['log'](_0x2accde[_0xa4999b(0x1d4)]),![];const _0x5a9c9f=_0x2accde[_0xa4999b(0x1d2)](existsSync,_0x2accde[_0xa4999b(0x1ca)](join,_0x2accde['VXcgE'](getProjectRoot),_0x2accde[_0xa4999b(0x1bf)]));let _0x12e9bc=!![];if(_0x31133f)await skillup({'autoInstall':_0x31133f,'suppressUsage':!![]});else{if(_0x5a9c9f)await skillup({'autoInstall':'project','suppressUsage':!![]});else{const _0x261559=await _0x2af99a['prompt']([{'type':_0xa4999b(0x1b4),'name':_0x2accde['OQXgq'],'message':_0x2accde['Siaex'],'default':!![]}]);_0x12e9bc=_0x261559['wantsSkillup'],_0x12e9bc&&await _0x2accde['DZilz'](skillup,{'suppressUsage':!![]});}}return _0x12e9bc;}
@@ -1 +1 @@
1
- function _0x2cd6(_0x356f95,_0x187478){_0x356f95=_0x356f95-0x1bf;const _0x2ac078=_0x2ac0();let _0x2cd695=_0x2ac078[_0x356f95];return _0x2cd695;}(function(_0x549665,_0x2d67b5){const _0x55a33c=_0x2cd6,_0xc9b8a3=_0x549665();while(!![]){try{const _0x447b4a=parseInt(_0x55a33c(0x1c1))/0x1*(parseInt(_0x55a33c(0x1c9))/0x2)+-parseInt(_0x55a33c(0x1c3))/0x3*(-parseInt(_0x55a33c(0x1d5))/0x4)+parseInt(_0x55a33c(0x1d9))/0x5+parseInt(_0x55a33c(0x1d4))/0x6+-parseInt(_0x55a33c(0x1c0))/0x7+parseInt(_0x55a33c(0x1ca))/0x8+-parseInt(_0x55a33c(0x1c5))/0x9*(parseInt(_0x55a33c(0x1cc))/0xa);if(_0x447b4a===_0x2d67b5)break;else _0xc9b8a3['push'](_0xc9b8a3['shift']());}catch(_0x422815){_0xc9b8a3['push'](_0xc9b8a3['shift']());}}}(_0x2ac0,0xa75e4));import{join}from'path';import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0x4d7a24 from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';function _0x2ac0(){const _0x79d3de=['YHWOr','JVMOm','@ranger-testing/opencode-plugin','plugin','mirVp','Failed\x20to\x20read\x20opencode.json','pluginScope','project','9569693uunQij','1XPePyT','prompt','15261CBKxzw','mrtAq','11736WAZpmJ','stringify','\x0a📦\x20OpenCode\x20Plugin\x0a','PHokh','1251322rBAkOl','9541464TVJZem','WRqxi','13670rwBfGR','BVetg','wiVkf','parse','LfzhO','✓\x20OpenCode\x20plugin\x20already\x20configured','log','opencode.json','2286354lsmoPF','736kDILcW','user','fqVFg','mjCEY','3498980OxYtix','utf-8'];_0x2ac0=function(){return _0x79d3de;};return _0x2ac0();}export async function ensureOpencodePluginConfig(_0x3f89a6){const _0x415382=_0x2cd6,_0x215f8d={'LfzhO':function(_0x3ce3a7,_0x3727cf){return _0x3ce3a7(_0x3727cf);},'rAyZU':function(_0xe17e01,_0x319402,_0x5409b9){return _0xe17e01(_0x319402,_0x5409b9);},'CHABT':function(_0x584b67,_0x5cd474){return _0x584b67(_0x5cd474);},'YHWOr':_0x415382(0x1d3),'PHokh':'project','wiVkf':_0x415382(0x1c7),'uFcYk':'Where\x20should\x20the\x20plugin\x20be\x20installed?','jIHnT':'User\x20(available\x20in\x20all\x20your\x20projects)','WRqxi':_0x415382(0x1d6),'mjCEY':function(_0x1c70b8,_0x173987,_0x2389d9){return _0x1c70b8(_0x173987,_0x2389d9);},'BVetg':_0x415382(0x1dd),'mrtAq':'https://opencode.ai/config.json','mSkvl':'⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','wYJWJ':_0x415382(0x1e0),'fqVFg':function(_0x5ce1fb,_0xddbc10){return _0x5ce1fb(_0xddbc10);},'JVMOm':function(_0x460358,_0x24af4a){return _0x460358+_0x24af4a;},'mirVp':'✓\x20OpenCode\x20plugin\x20configured'},_0x337e8c=_0x215f8d[_0x415382(0x1d0)](existsSync,_0x215f8d['rAyZU'](join,_0x215f8d['CHABT'](getOpencodeConfigDir,_0x415382(0x1bf)),_0x215f8d['YHWOr']));let _0x537da4;if(_0x3f89a6)_0x537da4=_0x3f89a6;else{if(_0x337e8c)_0x537da4=_0x215f8d['PHokh'];else{console[_0x415382(0x1d2)](_0x215f8d[_0x415382(0x1ce)]);const _0x4072d6=await _0x4d7a24[_0x415382(0x1c2)]([{'type':'list','name':'pluginScope','message':_0x215f8d['uFcYk'],'choices':[{'name':_0x215f8d['jIHnT'],'value':_0x215f8d[_0x415382(0x1cb)]},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':_0x215f8d[_0x415382(0x1c8)]}],'default':'user'}]);_0x537da4=_0x4072d6[_0x415382(0x1e1)];}}const _0x3175f0=_0x215f8d[_0x415382(0x1d8)](join,_0x215f8d['LfzhO'](getOpencodeConfigDir,_0x537da4),_0x215f8d[_0x415382(0x1db)]),_0x59e77c=_0x215f8d[_0x415382(0x1cd)],_0x327812=_0x215f8d[_0x415382(0x1c4)];let _0x130d16={};if(_0x215f8d['LfzhO'](existsSync,_0x3175f0))try{const _0x493370=await _0x215f8d[_0x415382(0x1d8)](readFile,_0x3175f0,_0x415382(0x1da));_0x130d16=JSON[_0x415382(0x1cf)](_0x493370);}catch(_0x568746){return console['error'](_0x215f8d['mSkvl']),{'configured':![],'scope':_0x537da4,'error':_0x215f8d['wYJWJ'],'details':_0x568746};}const _0x1c59a7=Array['isArray'](_0x130d16['plugin'])?_0x130d16[_0x415382(0x1de)]:[];if(_0x1c59a7['includes'](_0x59e77c))return console[_0x415382(0x1d2)](_0x415382(0x1d1)),{'configured':![],'scope':_0x537da4};return _0x130d16['$schema']=_0x130d16['$schema']||_0x327812,_0x130d16[_0x415382(0x1de)]=[..._0x1c59a7,_0x59e77c],await mkdir(_0x215f8d[_0x415382(0x1d7)](getOpencodeConfigDir,_0x537da4),{'recursive':!![]}),await writeFile(_0x3175f0,_0x215f8d[_0x415382(0x1dc)](JSON[_0x415382(0x1c6)](_0x130d16,null,0x2),'\x0a')),console[_0x415382(0x1d2)](_0x215f8d[_0x415382(0x1df)]),{'configured':!![],'scope':_0x537da4};}
1
+ (function(_0x3fefed,_0x99d3a3){const _0x1062a5=_0x3eca,_0x53c839=_0x3fefed();while(!![]){try{const _0x1205a8=-parseInt(_0x1062a5(0x1e4))/0x1+parseInt(_0x1062a5(0x1ea))/0x2+parseInt(_0x1062a5(0x1e8))/0x3+parseInt(_0x1062a5(0x1e3))/0x4+-parseInt(_0x1062a5(0x1ec))/0x5+-parseInt(_0x1062a5(0x1e5))/0x6+-parseInt(_0x1062a5(0x1e1))/0x7*(-parseInt(_0x1062a5(0x1e7))/0x8);if(_0x1205a8===_0x99d3a3)break;else _0x53c839['push'](_0x53c839['shift']());}catch(_0x4105c1){_0x53c839['push'](_0x53c839['shift']());}}}(_0x4ac7,0xb21ee));import{join}from'path';import{existsSync}from'fs';function _0x4ac7(){const _0x31cda3=['stringify','pluginScope','log','plugin','bCWRT','⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','User\x20(available\x20in\x20all\x20your\x20projects)','list','330659QtZmCz','Lfjbs','4272120GukEUE','842556gDSprK','4657374YODLWQ','zeKFC','64RnIkkm','2644263pexVBZ','user','217050iKqDjG','utf-8','437525rbQSnj','prompt','cmNor'];_0x4ac7=function(){return _0x31cda3;};return _0x4ac7();}import{mkdir,readFile,writeFile}from'fs/promises';import _0x329b04 from'inquirer';function _0x3eca(_0x2853a5,_0x2919b4){_0x2853a5=_0x2853a5-0x1dc;const _0x4ac7e7=_0x4ac7();let _0x3eca71=_0x4ac7e7[_0x2853a5];return _0x3eca71;}import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0x305690){const _0x183526=_0x3eca,_0x2329fe={'cmNor':function(_0x1d4d75,_0x103ea8,_0x55929e){return _0x1d4d75(_0x103ea8,_0x55929e);},'bCWRT':'project','wLzzo':'opencode.json','pIJAD':_0x183526(0x1e0),'CVBfk':'Where\x20should\x20the\x20plugin\x20be\x20installed?','YBZRs':_0x183526(0x1df),'NnnZb':_0x183526(0x1e9),'Lfjbs':_0x183526(0x1eb),'NBVdo':'✓\x20OpenCode\x20plugin\x20already\x20configured','zeKFC':function(_0x5de603,_0x25d2d8){return _0x5de603+_0x25d2d8;},'rlhnW':'✓\x20OpenCode\x20plugin\x20configured'},_0x4d2d1d=existsSync(_0x2329fe['cmNor'](join,getOpencodeConfigDir(_0x2329fe[_0x183526(0x1dd)]),_0x2329fe['wLzzo']));let _0x27beb8;if(_0x305690)_0x27beb8=_0x305690;else{if(_0x4d2d1d)_0x27beb8=_0x2329fe['bCWRT'];else{console[_0x183526(0x1f1)]('\x0a📦\x20OpenCode\x20Plugin\x0a');const _0x50363d=await _0x329b04[_0x183526(0x1ed)]([{'type':_0x2329fe['pIJAD'],'name':_0x183526(0x1f0),'message':_0x2329fe['CVBfk'],'choices':[{'name':_0x2329fe['YBZRs'],'value':_0x2329fe['NnnZb']},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':'project'}],'default':_0x183526(0x1e9)}]);_0x27beb8=_0x50363d[_0x183526(0x1f0)];}}const _0x447b16=join(getOpencodeConfigDir(_0x27beb8),'opencode.json'),_0x340dbc='@ranger-testing/opencode-plugin',_0x54fa64='https://opencode.ai/config.json';let _0x47d150={};if(existsSync(_0x447b16))try{const _0x4e702a=await _0x2329fe[_0x183526(0x1ee)](readFile,_0x447b16,_0x2329fe[_0x183526(0x1e2)]);_0x47d150=JSON['parse'](_0x4e702a);}catch(_0x444dd2){return console['error'](_0x183526(0x1de)),{'configured':![],'scope':_0x27beb8,'error':'Failed\x20to\x20read\x20opencode.json','details':_0x444dd2};}const _0x447853=Array['isArray'](_0x47d150[_0x183526(0x1dc)])?_0x47d150[_0x183526(0x1dc)]:[];if(_0x447853['includes'](_0x340dbc))return console['log'](_0x2329fe['NBVdo']),{'configured':![],'scope':_0x27beb8};return _0x47d150['$schema']=_0x47d150['$schema']||_0x54fa64,_0x47d150['plugin']=[..._0x447853,_0x340dbc],await _0x2329fe[_0x183526(0x1ee)](mkdir,getOpencodeConfigDir(_0x27beb8),{'recursive':!![]}),await _0x2329fe[_0x183526(0x1ee)](writeFile,_0x447b16,_0x2329fe[_0x183526(0x1e6)](JSON[_0x183526(0x1ef)](_0x47d150,null,0x2),'\x0a')),console['log'](_0x2329fe['rlhnW']),{'configured':!![],'scope':_0x27beb8};}
@@ -1 +1 @@
1
- function _0x6e6b(){var _0x475f87=['6365936LpivVQ','262HqOasa','HkTxJ','YNewi','5745wROOXW','1380936YWZlTy','18cnJYBf','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','1400730QBfgNX','NZakv','108rrSlRI','349525LBAvPy','968190GpGXhP','68887DsLmhD'];_0x6e6b=function(){return _0x475f87;};return _0x6e6b();}function _0xfdac(_0x4c0944,_0xd7d9e5){_0x4c0944=_0x4c0944-0x1b1;var _0xfdac51=_0x6e6b();var _0x23916=_0xfdac51[_0x4c0944];return _0x23916;}(function(_0x4282a2,_0x34e41e){var _0x1c2d50=_0xfdac,_0x45584f=_0x4282a2();while(!![]){try{var _0x1d49d3=parseInt(_0x1c2d50(0x1b7))/0x1+-parseInt(_0x1c2d50(0x1ba))/0x2*(-parseInt(_0x1c2d50(0x1bd))/0x3)+parseInt(_0x1c2d50(0x1be))/0x4+-parseInt(_0x1c2d50(0x1b6))/0x5+-parseInt(_0x1c2d50(0x1b1))/0x6*(parseInt(_0x1c2d50(0x1b8))/0x7)+parseInt(_0x1c2d50(0x1b9))/0x8+parseInt(_0x1c2d50(0x1b5))/0x9*(-parseInt(_0x1c2d50(0x1b3))/0xa);if(_0x1d49d3===_0x34e41e)break;else _0x45584f['push'](_0x45584f['shift']());}catch(_0x3562fd){_0x45584f['push'](_0x45584f['shift']());}}}(_0x6e6b,0x8d88f));export async function setupCi(_0x55036d,_0xbf3261,_0x106c5e){var _0x55199e=_0xfdac,_0x475a37={'NZakv':function(_0x12591d,_0x20396b){return _0x12591d+_0x20396b;},'VKNjY':function(_0x32442b,_0xdb6141){return _0x32442b+_0xdb6141;},'HkTxJ':_0x55199e(0x1b2),'Dzdcw':'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','YNewi':'\x20\x20https://docs.ranger.net/main/concepts/profiles'};console['error'](_0x475a37[_0x55199e(0x1b4)](_0x475a37['NZakv'](_0x475a37['VKNjY']('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')+_0x475a37[_0x55199e(0x1bb)],'\x0a'),_0x475a37['Dzdcw'])+_0x475a37[_0x55199e(0x1bc)]),process['exit'](0x1);}
1
+ (function(_0x322212,_0x43739f){var _0x5645e3=_0x2d21,_0x51d824=_0x322212();while(!![]){try{var _0x3c6702=-parseInt(_0x5645e3(0x182))/0x1*(parseInt(_0x5645e3(0x18a))/0x2)+-parseInt(_0x5645e3(0x185))/0x3+-parseInt(_0x5645e3(0x187))/0x4+-parseInt(_0x5645e3(0x18b))/0x5+-parseInt(_0x5645e3(0x17d))/0x6+parseInt(_0x5645e3(0x184))/0x7*(parseInt(_0x5645e3(0x188))/0x8)+-parseInt(_0x5645e3(0x186))/0x9*(-parseInt(_0x5645e3(0x183))/0xa);if(_0x3c6702===_0x43739f)break;else _0x51d824['push'](_0x51d824['shift']());}catch(_0x844284){_0x51d824['push'](_0x51d824['shift']());}}}(_0x38ea,0x8638c));function _0x38ea(){var _0x4266a4=['CfcgB','tPJZd','1skgomA','10qgWzUT','189JYlJPb','1664637FCtYVI','23621931fCHqgb','2130056rbQrcF','101488rWjrCl','exit','1975852spEbDm','612850xbJdVw','LgWTK','TGNFB','1317120nqvbWZ','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','RzgCW'];_0x38ea=function(){return _0x4266a4;};return _0x38ea();}function _0x2d21(_0x47a3f5,_0x47b97e){_0x47a3f5=_0x47a3f5-0x17b;var _0x38ea42=_0x38ea();var _0x2d214b=_0x38ea42[_0x47a3f5];return _0x2d214b;}export async function setupCi(_0x5e20f8,_0x193470,_0x125ea3){var _0x4fb526=_0x2d21,_0xf5f36f={'CfcgB':function(_0x1f7005,_0xc331fe){return _0x1f7005+_0xc331fe;},'RzgCW':function(_0x455c01,_0x39312b){return _0x455c01+_0x39312b;},'LgWTK':'ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','tPJZd':_0x4fb526(0x17e),'TGNFB':'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','nqBiK':'\x20\x20https://docs.ranger.net/main/concepts/profiles'};console['error'](_0xf5f36f[_0x4fb526(0x180)](_0xf5f36f[_0x4fb526(0x17f)](_0xf5f36f[_0x4fb526(0x17b)]+'\x0a'+'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a'+_0xf5f36f[_0x4fb526(0x181)],'\x0a')+_0xf5f36f[_0x4fb526(0x17c)],_0xf5f36f['nqBiK'])),process[_0x4fb526(0x189)](0x1);}
@@ -1 +1 @@
1
- (function(_0x45811e,_0x150dd5){const _0x52942b=_0x1f1c,_0x35d32a=_0x45811e();while(!![]){try{const _0x2e7305=parseInt(_0x52942b(0x1f3))/0x1+parseInt(_0x52942b(0x1d7))/0x2*(-parseInt(_0x52942b(0x1de))/0x3)+parseInt(_0x52942b(0x1ef))/0x4*(parseInt(_0x52942b(0x1d3))/0x5)+-parseInt(_0x52942b(0x1ea))/0x6*(-parseInt(_0x52942b(0x1fc))/0x7)+parseInt(_0x52942b(0x1dc))/0x8*(parseInt(_0x52942b(0x1e5))/0x9)+parseInt(_0x52942b(0x1fb))/0xa+-parseInt(_0x52942b(0x1f8))/0xb;if(_0x2e7305===_0x150dd5)break;else _0x35d32a['push'](_0x35d32a['shift']());}catch(_0x687ed4){_0x35d32a['push'](_0x35d32a['shift']());}}}(_0x1b3b,0x83da9));import{basename}from'path';import _0x4b01f9 from'inquirer';import{getToken}from'./utils/keychain.js';function _0x1f1c(_0x681ec,_0x527081){_0x681ec=_0x681ec-0x1d2;const _0x1b3b70=_0x1b3b();let _0x1f1c4a=_0x1b3b70[_0x681ec];return _0x1f1c4a;}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(_0x4fb019={}){const _0x24035f=_0x1f1c,_0x603c66={'IHCni':'\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','MUYgI':_0x24035f(0x1ee),'goHLE':function(_0x2f03db){return _0x2f03db();},'mUFVX':'❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','SEQtm':'To\x20get\x20started:','qTNCE':_0x24035f(0x1e1),'ipKar':function(_0x362b33,_0x5ecc28){return _0x362b33===_0x5ecc28;},'eYcHR':function(_0x2064ae,_0x527014){return _0x2064ae===_0x527014;},'yuLHc':_0x24035f(0x1e3),'ZTRDx':'✓\x20Found\x20API\x20token','LHMNK':function(_0x235896,_0x1d6bd6){return _0x235896(_0x1d6bd6);},'kXrJO':'opencode','hUoEW':_0x24035f(0x1da),'izLPY':_0x24035f(0x1e0),'yzQGy':_0x24035f(0x1e9),'KKfgm':'\x0a📦\x20Installing\x20skills...\x0a','PfMTo':function(_0x2306eb,_0x4a67c0,_0x59ed0e){return _0x2306eb(_0x4a67c0,_0x59ed0e);},'FBDKs':_0x24035f(0x1dd),'wgDGb':function(_0x58aa5f,_0x5dae97){return _0x58aa5f>_0x5dae97;},'ukOjy':function(_0x571e2e,_0x983a15){return _0x571e2e===_0x983a15;},'MmEXp':'user-level','Atrgx':_0x24035f(0x1df),'UntaH':function(_0x21ab09,_0x57a455){return _0x21ab09===_0x57a455;}};console['log'](_0x603c66[_0x24035f(0x1f0)]);const _0x483f47=_0x4fb019['platform']??_0x603c66[_0x24035f(0x1e6)],_0x322ed9=await _0x603c66[_0x24035f(0x1d5)](getToken);if(!_0x322ed9){console['log'](_0x603c66[_0x24035f(0x1f9)]),console['log'](_0x603c66['SEQtm']),console[_0x24035f(0x1fe)](_0x603c66['qTNCE']),console[_0x24035f(0x1fe)]('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0x603c66[_0x24035f(0x1e7)](_0x483f47,_0x24035f(0x1f6))?'\x20--opencode':'')+_0x24035f(0x1db)),console[_0x24035f(0x1fe)]('\x20\x203.\x20Run:\x20ranger\x20skillup'+(_0x603c66['eYcHR'](_0x483f47,'opencode')?_0x603c66['yuLHc']:'')+'\x0a');return;}console[_0x24035f(0x1fe)](_0x603c66['ZTRDx']);const _0x2984bf=getProjectRoot(),_0x5a1067=_0x603c66['LHMNK'](basename,_0x2984bf),_0x2379d2=_0x603c66['eYcHR'](_0x483f47,'opencode')?_0x603c66[_0x24035f(0x1f5)](getOpencodeConfigDir,_0x24035f(0x1e0))+'/skills/':_0x603c66['goHLE'](getClaudeConfigDir)+'/skills/',_0x3d5e19=_0x483f47===_0x603c66[_0x24035f(0x1e8)]?_0x2984bf+'/.opencode/skills/':_0x2984bf+_0x24035f(0x1f7),_0x3ebb3f=process['stdin'][_0x24035f(0x1f2)]&&process['stdout']['isTTY'];let _0x1d5512;if(_0x4fb019['autoInstall'])_0x1d5512=_0x4fb019[_0x24035f(0x1d2)];else{if(_0x3ebb3f){const _0x128cbd=await _0x4b01f9[_0x24035f(0x1fd)]([{'type':'list','name':'installLevel','message':_0x603c66[_0x24035f(0x1fa)],'choices':[{'name':_0x24035f(0x1eb)+_0x2379d2+')','value':_0x603c66[_0x24035f(0x1ec)]},{'name':_0x24035f(0x1d8)+_0x3d5e19+')','value':_0x603c66['yzQGy']}]}]);_0x1d5512=_0x128cbd[_0x24035f(0x1e2)];}else _0x1d5512=_0x603c66[_0x24035f(0x1d6)],console[_0x24035f(0x1fe)]('Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20('+_0x3d5e19+')');}let _0x442994=0x0;const _0x1a5ae9=getCurrentVersion();console['log'](_0x603c66['KKfgm']);try{const _0x50de79=await _0x603c66['PfMTo'](installSkill,'ranger',{'cliVersion':_0x1a5ae9,'level':_0x1d5512,'platform':_0x483f47});_0x50de79&&_0x442994++;}catch(_0x39bcb5){console['warn'](_0x603c66[_0x24035f(0x1f1)],_0x39bcb5 instanceof Error?_0x39bcb5['message']:_0x39bcb5);}if(_0x603c66['wgDGb'](_0x442994,0x0)){const _0x5dc58f=_0x603c66['ukOjy'](_0x1d5512,_0x603c66[_0x24035f(0x1ec)])?_0x603c66['MmEXp']:_0x603c66[_0x24035f(0x1d4)];console['log'](_0x24035f(0x1d9)+_0x442994+'\x20'+_0x5dc58f+_0x24035f(0x1f4)+(_0x442994>0x1?'s':'')+'\x20successfully!\x0a'),!_0x4fb019[_0x24035f(0x1ed)]&&(console[_0x24035f(0x1fe)]('To\x20use:'),_0x603c66[_0x24035f(0x1e4)](_0x483f47,_0x603c66['kXrJO'])?console['log']('\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.'):console[_0x24035f(0x1fe)]('\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!'));}else console[_0x24035f(0x1fe)]('\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a');}function _0x1b3b(){const _0x3e5064=['isTTY','977911Rwbves','\x20skill','LHMNK','opencode','/.claude/skills/','26522155vKnpCb','mUFVX','hUoEW','7005500ZvwKQO','7fAMyQq','prompt','log','autoInstall','235ZDwduT','Atrgx','goHLE','yzQGy','57100QDbxUZ','This\x20project\x20only\x20(','\x0a✅\x20Installed\x20','Where\x20should\x20skills\x20be\x20installed?','\x20<your-api-token>','136oMukZV','\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','57FYYueG','project-level','user','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','installLevel','\x20--opencode','UntaH','85518uRwyHF','MUYgI','ipKar','kXrJO','project','5463096FNgYUT','All\x20projects\x20(','izLPY','suppressUsage','claude','63244HxFeBJ','IHCni','FBDKs'];_0x1b3b=function(){return _0x3e5064;};return _0x1b3b();}
1
+ (function(_0x1064f3,_0x447348){const _0x5af50d=_0x55c7,_0x3f7b09=_0x1064f3();while(!![]){try{const _0x4d2195=parseInt(_0x5af50d(0xa5))/0x1+-parseInt(_0x5af50d(0xb7))/0x2+parseInt(_0x5af50d(0xa7))/0x3+parseInt(_0x5af50d(0xa6))/0x4*(parseInt(_0x5af50d(0xaa))/0x5)+parseInt(_0x5af50d(0xa1))/0x6*(-parseInt(_0x5af50d(0xad))/0x7)+parseInt(_0x5af50d(0xb4))/0x8+parseInt(_0x5af50d(0x9e))/0x9*(parseInt(_0x5af50d(0xb9))/0xa);if(_0x4d2195===_0x447348)break;else _0x3f7b09['push'](_0x3f7b09['shift']());}catch(_0x338439){_0x3f7b09['push'](_0x3f7b09['shift']());}}}(_0xeef8,0xef136));function _0x55c7(_0x221509,_0x5241a9){_0x221509=_0x221509-0x97;const _0xeef80a=_0xeef8();let _0x55c78e=_0xeef80a[_0x221509];return _0x55c78e;}import{basename}from'path';import _0x3f73e2 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';function _0xeef8(){const _0x1cc1ea=['opencode','user','ranger','hQKwO','\x20successfully!\x0a','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','cekgD','HfZGf','This\x20project\x20only\x20(','18NjIQWA','\x20\x202.\x20Run:\x20ranger\x20setup','\x20<your-api-token>','6OpefDR','user-level','All\x20projects\x20(','isTTY','831512UozlsJ','4ereyBT','1810851veWtWI','To\x20get\x20started:','suppressUsage','3599785zuuRao','XsyvE','Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20(','9665831DatVFf','nUYEw','Where\x20should\x20skills\x20be\x20installed?','prompt','To\x20use:','XWrbV','PVwDq','8385688JoljGV','autoInstall','stdin','3592588JtlhBF','message','4765420fsJVpG','log','\x0a✅\x20Installed\x20','dURHQ','kXIzj','installLevel'];_0xeef8=function(){return _0x1cc1ea;};return _0xeef8();}export async function skillup(_0x360ee0={}){const _0x45f9cc=_0x55c7,_0x384c7c={'XsyvE':'\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','XWrbV':'2|0|4|3|5|1','PVwDq':_0x45f9cc(0x9a),'Duglj':function(_0x536d59,_0x4cec05){return _0x536d59===_0x4cec05;},'cekgD':_0x45f9cc(0xbf),'dURHQ':'\x20--opencode','kXIzj':function(_0x1f9c6b,_0x5c4440){return _0x1f9c6b===_0x5c4440;},'tFGhp':_0x45f9cc(0xaf),'EyfLN':'project','wtOdA':function(_0x1e4bb6){return _0x1e4bb6();},'anZEo':'\x0a📦\x20Installing\x20skills...\x0a','HfZGf':'\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','hQKwO':function(_0x1b6bad,_0x4a733d){return _0x1b6bad instanceof _0x4a733d;},'mVpbG':function(_0x5907ba,_0x570618){return _0x5907ba>_0x570618;},'dhqFe':_0x45f9cc(0xa2),'nUYEw':'project-level','qzMQB':_0x45f9cc(0xb1),'WePnl':'\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','yDIYw':'\x20\x20-\x20Open\x20Claude\x20Code\x20in\x20plan\x20mode\x20and\x20run\x20/ranger:enable.\x20Plan\x20out\x20a\x20UI\x20feature\x20with\x20Ranger\x20and\x20watch\x20Ranger\x20test\x20it\x20for\x20you!'};console['log'](_0x384c7c[_0x45f9cc(0xab)]);const _0x7ff76d=_0x360ee0['platform']??'claude',_0x282797=await getToken();if(!_0x282797){const _0x42248e=_0x384c7c[_0x45f9cc(0xb2)]['split']('|');let _0x82f732=0x0;while(!![]){switch(_0x42248e[_0x82f732++]){case'0':console['log'](_0x45f9cc(0xa8));continue;case'1':return;case'2':console['log'](_0x384c7c[_0x45f9cc(0xb3)]);continue;case'3':console['log'](_0x45f9cc(0x9f)+(_0x384c7c['Duglj'](_0x7ff76d,_0x384c7c[_0x45f9cc(0x9b)])?_0x384c7c[_0x45f9cc(0xbc)]:'')+_0x45f9cc(0xa0));continue;case'4':console[_0x45f9cc(0xba)]('\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli');continue;case'5':console['log']('\x20\x203.\x20Run:\x20ranger\x20skillup'+(_0x7ff76d==='opencode'?_0x384c7c[_0x45f9cc(0xbc)]:'')+'\x0a');continue;}break;}}console[_0x45f9cc(0xba)]('✓\x20Found\x20API\x20token');const _0x144a1f=getProjectRoot(),_0x1f9c0f=basename(_0x144a1f),_0x18a96d=_0x384c7c['kXIzj'](_0x7ff76d,_0x45f9cc(0xbf))?getOpencodeConfigDir(_0x45f9cc(0xc0))+'/skills/':getClaudeConfigDir()+'/skills/',_0x36784e=_0x384c7c['kXIzj'](_0x7ff76d,_0x384c7c[_0x45f9cc(0x9b)])?_0x144a1f+'/.opencode/skills/':_0x144a1f+'/.claude/skills/',_0x1e332f=process[_0x45f9cc(0xb6)]['isTTY']&&process['stdout'][_0x45f9cc(0xa4)];let _0xa94dc2;if(_0x360ee0[_0x45f9cc(0xb5)])_0xa94dc2=_0x360ee0['autoInstall'];else{if(_0x1e332f){const _0x4c8895=await _0x3f73e2[_0x45f9cc(0xb0)]([{'type':'list','name':_0x45f9cc(0xbe),'message':_0x384c7c['tFGhp'],'choices':[{'name':_0x45f9cc(0xa3)+_0x18a96d+')','value':_0x45f9cc(0xc0)},{'name':_0x45f9cc(0x9d)+_0x36784e+')','value':_0x384c7c['EyfLN']}]}]);_0xa94dc2=_0x4c8895['installLevel'];}else _0xa94dc2=_0x384c7c['EyfLN'],console[_0x45f9cc(0xba)](_0x45f9cc(0xac)+_0x36784e+')');}let _0xf3822b=0x0;const _0x4b633e=_0x384c7c['wtOdA'](getCurrentVersion);console['log'](_0x384c7c['anZEo']);try{const _0x1e45a3=await installSkill(_0x45f9cc(0x97),{'cliVersion':_0x4b633e,'level':_0xa94dc2,'platform':_0x7ff76d});_0x1e45a3&&_0xf3822b++;}catch(_0x32cace){console['warn'](_0x384c7c[_0x45f9cc(0x9c)],_0x384c7c[_0x45f9cc(0x98)](_0x32cace,Error)?_0x32cace[_0x45f9cc(0xb8)]:_0x32cace);}if(_0x384c7c['mVpbG'](_0xf3822b,0x0)){const _0xc19c51=_0x384c7c['Duglj'](_0xa94dc2,_0x45f9cc(0xc0))?_0x384c7c['dhqFe']:_0x384c7c[_0x45f9cc(0xae)];console['log'](_0x45f9cc(0xbb)+_0xf3822b+'\x20'+_0xc19c51+'\x20skill'+(_0xf3822b>0x1?'s':'')+_0x45f9cc(0x99)),!_0x360ee0[_0x45f9cc(0xa9)]&&(console[_0x45f9cc(0xba)](_0x384c7c['qzMQB']),_0x384c7c[_0x45f9cc(0xbd)](_0x7ff76d,_0x384c7c['cekgD'])?console['log'](_0x384c7c['WePnl']):console[_0x45f9cc(0xba)](_0x384c7c['yDIYw']));}else console[_0x45f9cc(0xba)]('\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a');}
@@ -1 +1 @@
1
- (function(_0x386fcf,_0x49f121){const _0x3546af=_0x52ae,_0xab571=_0x386fcf();while(!![]){try{const _0x2b2d18=-parseInt(_0x3546af(0x1fd))/0x1+parseInt(_0x3546af(0x20b))/0x2+-parseInt(_0x3546af(0x1f2))/0x3*(-parseInt(_0x3546af(0x239))/0x4)+parseInt(_0x3546af(0x226))/0x5*(-parseInt(_0x3546af(0x224))/0x6)+-parseInt(_0x3546af(0x218))/0x7*(parseInt(_0x3546af(0x22c))/0x8)+-parseInt(_0x3546af(0x228))/0x9+parseInt(_0x3546af(0x241))/0xa;if(_0x2b2d18===_0x49f121)break;else _0xab571['push'](_0xab571['shift']());}catch(_0x30d558){_0xab571['push'](_0xab571['shift']());}}}(_0x1922,0xd90d7));function _0x52ae(_0x5d52a8,_0x3d7ebc){_0x5d52a8=_0x5d52a8-0x1e9;const _0x19222c=_0x1922();let _0x52aebd=_0x19222c[_0x5d52a8];return _0x52aebd;}import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x3cf803 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';function _0x1922(){const _0x1baa1b=['4FnWsZC','ignore','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','success','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','✓\x20Exported\x20credentials\x20for\x20CI','user','39035840QWwfwN','bJULT','plugin','trackPhaseStart','url','...','hdtlU','SgdVE','stdin','install','platform','✓\x20Playwright\x20Chromium\x20browser\x20found','jupxC','\x0a⚠\x20Skipping\x20Chromium\x20installation.','force','skipChromium','qyGFJ','\x20(fallback\x20version)','318495iOthFb','✓\x20Stored\x20credentials\x20locally','trackPhaseEnd','--with-deps','JllgR','nhgFT','skills','rjjli','GITHUB_ENV','HBvAk','JmeHI','299911rqrSPh','withDeps','ttgQQ','device_auth','\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','.gitignore','CvaPN','\x0aInstalling\x20Chromium\x20browser...\x0a','prompt','profile','npx','XDSKD','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','49992ofmfdn','\x20install\x20chromium','provided_token','log','\x0aIn\x20Claude\x20Code,\x20run\x20','chromium','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','\x20is\x20no\x20longer\x20supported.\x20','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','skipped','✓\x20Local\x20profile\x20already\x20exists','NLCBV','175MrHFnV','Validating\x20API\x20token...','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','sgSgn','playwright@','existing_token','auth','✓\x20Already\x20authenticated\x20to\x20','Installation\x20failed\x20with\x20exit\x20code\x20','error','message','inherit','438jVedzk','SYxEt','82555lRdCKi','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','4468806JvPdhW','eaASL','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','dGaFo','366064JUqfyZ','✓\x20Authenticated\x20to\x20','✓\x20~/.ranger/\x20directory\x20already\x20exists','wiIQA','Authentication\x20failed:\x20','SJEVy','allowInsecureLocalhost','scope','bPPYw','organizationName','rBRUX','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.','playwright/package.json'];_0x1922=function(){return _0x1baa1b;};return _0x1922();}import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.58.2';const bold=_0x484b70=>'\x1b[1m'+_0x484b70+'\x1b[0m';export function getPlaywrightVersion(){const _0x4709e6=_0x52ae;try{const _0x7ba15f=require['resolve'](_0x4709e6(0x238)),_0x5497c1=require(_0x7ba15f);return _0x5497c1['version'];}catch{return null;}}export function installChromiumBinary(_0x3badf5,_0x2cbd9a=![]){const _0x5659b6=_0x52ae,_0x1b3665={'lFguW':function(_0x2025bc,_0x4eaca5){return _0x2025bc(_0x4eaca5);},'OntZs':'chromium','zyRcd':function(_0x1f0839,_0x5917b0,_0x16200d,_0x30dd22){return _0x1f0839(_0x5917b0,_0x16200d,_0x30dd22);},'SJEVy':_0x5659b6(0x208)};return new Promise((_0x524451,_0x1b84e5)=>{const _0xb35000=_0x5659b6,_0x394b57={'GQziK':function(_0xa83af4,_0x54cff6){return _0xa83af4===_0x54cff6;},'ttgQQ':function(_0x3b77c1,_0x192be0){return _0x1b3665['lFguW'](_0x3b77c1,_0x192be0);}},_0x170ee3=[_0xb35000(0x21c)+_0x3badf5,'install',..._0x2cbd9a?[_0xb35000(0x1f5)]:[],_0x1b3665['OntZs']],_0x38c2e6=_0x1b3665['zyRcd'](spawn,_0x1b3665[_0xb35000(0x231)],_0x170ee3,{'stdio':[_0xb35000(0x23a),_0xb35000(0x223),_0xb35000(0x223)],'shell':process[_0xb35000(0x1ea)]==='win32'});_0x38c2e6['on']('close',_0x23c21c=>{const _0x2d30d9=_0xb35000;_0x394b57['GQziK'](_0x23c21c,0x0)?_0x524451():_0x1b84e5(new Error(_0x2d30d9(0x220)+_0x23c21c));}),_0x38c2e6['on'](_0xb35000(0x221),_0x44b8ef=>{const _0x57ddc6=_0xb35000;_0x394b57[_0x57ddc6(0x1ff)](_0x1b84e5,_0x44b8ef);});});}export async function authenticate(_0x4f69be){const _0x4f0525=_0x52ae,_0x45191a={'OdeCw':function(_0x26c84c,_0x4be85b){return _0x26c84c(_0x4be85b);},'RjXIn':_0x4f0525(0x21d),'DSaem':_0x4f0525(0x200),'rBRUX':_0x4f0525(0x23f)};if(!_0x4f69be){const _0x28140c=await getToken();if(_0x28140c){const _0x271b4c=await _0x45191a['OdeCw'](getCurrentUser,_0x28140c);if(_0x271b4c['success'])return console['log'](_0x4f0525(0x21f)+_0x271b4c['user']['organizationName']),{'token':_0x28140c,'method':_0x45191a['RjXIn']};}try{_0x4f69be=await runDeviceAuthFlow();}catch(_0x5776a5){throw new Error('Authentication\x20failed:\x20'+(_0x5776a5 instanceof Error?_0x5776a5[_0x4f0525(0x222)]:_0x5776a5));}const _0x44e3dd=await getCurrentUser(_0x4f69be);if(!_0x44e3dd[_0x4f0525(0x23d)])throw new Error(_0x4f0525(0x23b)+_0x44e3dd[_0x4f0525(0x221)]);return console[_0x4f0525(0x20e)](_0x4f0525(0x22d)+_0x44e3dd['user']['organizationName']),{'token':_0x4f69be,'method':_0x45191a['DSaem']};}console[_0x4f0525(0x20e)](_0x4f0525(0x219));const _0xaa58b3=await getCurrentUser(_0x4f69be);if(!_0xaa58b3[_0x4f0525(0x23d)]){if(_0xaa58b3['status'])throw new Error(_0x4f0525(0x230)+_0xaa58b3[_0x4f0525(0x221)]+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0xaa58b3[_0x4f0525(0x221)]+_0x4f0525(0x202));}return console[_0x4f0525(0x20e)](_0x4f0525(0x22d)+_0xaa58b3[_0x4f0525(0x240)][_0x4f0525(0x235)]),await storeToken(_0x4f69be),console[_0x4f0525(0x20e)](process['env'][_0x4f0525(0x1fa)]?_0x45191a[_0x4f0525(0x236)]:_0x4f0525(0x1f3)),{'token':_0x4f69be,'method':_0x4f0525(0x20d)};}export async function ensureRangerDir(_0x2b8d54){const _0x30e7cd=_0x52ae,_0x2ee54c={'cRPeA':function(_0x3a62c5){return _0x3a62c5();},'oULmb':function(_0x205307,_0xa132ef){return _0x205307(_0xa132ef);},'NTjUm':'✓\x20Created\x20~/.ranger/\x20directory','yULUX':_0x30e7cd(0x22e)};void _0x2b8d54;const _0x30bba9=_0x2ee54c['cRPeA'](getRangerHomeDir);return!_0x2ee54c['oULmb'](existsSync,_0x30bba9)?(await mkdir(_0x30bba9,{'recursive':!![]}),console['log'](_0x2ee54c['NTjUm']),{'path':_0x30bba9,'installed':!![]}):(console[_0x30e7cd(0x20e)](_0x2ee54c['yULUX']),{'path':_0x30bba9,'installed':![]});}export async function ensureChromium(_0x559740=![]){const _0x3ad034=_0x52ae,_0x2407e6={'KPIAZ':function(_0x39cef6,_0x278b31){return _0x39cef6(_0x278b31);},'sgSgn':_0x3ad034(0x1eb),'rulBF':function(_0xdf995e,_0x4c3d8a){return _0xdf995e??_0x4c3d8a;},'Bacgd':'confirm','rjjli':_0x3ad034(0x1f1),'jupxC':_0x3ad034(0x205),'zStOT':function(_0x278809,_0x58fc54){return _0x278809 instanceof _0x58fc54;}};let _0xc1fab8=![];try{const _0x2854c7=chromium['executablePath']();_0xc1fab8=_0x2407e6['KPIAZ'](existsSync,_0x2854c7);}catch{_0xc1fab8=![];}if(_0xc1fab8)return console[_0x3ad034(0x20e)](_0x2407e6[_0x3ad034(0x21b)]),![];const _0x51a6d5=getPlaywrightVersion(),_0x252040=_0x2407e6['rulBF'](_0x51a6d5,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x1ff5e4=!_0x51a6d5,_0x43c7a2=process[_0x3ad034(0x249)]['isTTY']&&process['stdout']['isTTY'];let _0x275239=!![];if(_0x43c7a2){const {install:_0x6600c}=await _0x3cf803[_0x3ad034(0x206)]([{'type':_0x2407e6['Bacgd'],'name':_0x3ad034(0x1e9),'message':_0x1ff5e4?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x252040+'\x20now?':'The\x20required\x20version\x20('+_0x252040+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x275239=_0x6600c;}else console['log'](_0x3ad034(0x23e)+_0x252040+(_0x1ff5e4?_0x2407e6[_0x3ad034(0x1f9)]:'')+_0x3ad034(0x246));if(_0x275239){console['log'](_0x2407e6[_0x3ad034(0x1ec)]);try{await installChromiumBinary(_0x252040,_0x559740),console['log']('\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully');}catch(_0x4b1de0){console[_0x3ad034(0x221)]('\x0a❌\x20Failed\x20to\x20install\x20Chromium:',_0x2407e6['zStOT'](_0x4b1de0,Error)?_0x4b1de0[_0x3ad034(0x222)]:_0x4b1de0),console['log']('You\x20can\x20install\x20it\x20manually\x20by\x20running:'),console[_0x3ad034(0x20e)]('\x20\x20npx\x20playwright@'+_0x252040+_0x3ad034(0x20c));}}else console[_0x3ad034(0x20e)](_0x3ad034(0x1ed)),console[_0x3ad034(0x20e)]('You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'),console['log']('\x20\x20npx\x20playwright@'+_0x252040+_0x3ad034(0x20c));return!![];}export async function writeRangerGitignore(_0x4c28bc){const _0x4bdbc5=_0x52ae,_0x5e5188={'JmeHI':_0x4bdbc5(0x203)},_0x3dde04=join(_0x4c28bc,_0x5e5188[_0x4bdbc5(0x1fc)]),_0x4eee2a='\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(_0x3dde04,_0x4eee2a),console['log']('✓\x20Created\x20.ranger/.gitignore');}export async function ensureLocalEnv(_0x23ceaa,_0x2397eb){const _0x5a6f5f=_0x52ae,_0x317835={'Ohzjn':_0x5a6f5f(0x240),'yyQIk':_0x5a6f5f(0x214),'QqybU':function(_0x369639,_0x3416a4){return _0x369639===_0x3416a4;},'BWFXQ':function(_0x32217b,_0x4337b7,_0x324618){return _0x32217b(_0x4337b7,_0x324618);},'xoLRE':'local','dUhJg':_0x5a6f5f(0x216),'dlIdL':'\x0a❌\x20Profile\x20setup\x20failed:','JllgR':function(_0x413bf,_0x310054){return _0x413bf instanceof _0x310054;}};if(!findGitRoot()&&_0x23ceaa?.['scope']!==_0x317835['Ohzjn'])return console[_0x5a6f5f(0x20e)](_0x317835['yyQIk']),{'ready':![],'skipped':!![]};const _0x7f0b2f=_0x317835['QqybU'](_0x23ceaa?.['scope'],_0x5a6f5f(0x240))?getRangerHomeDir():undefined;if(_0x317835['BWFXQ'](findExistingEnv,'local',{'locations':[_0x317835['xoLRE']],'rangerDir':_0x7f0b2f}))return console['log'](_0x317835['dUhJg']),{'ready':!![],'skipped':![]};try{return await addEnv(_0x317835['xoLRE'],{'url':_0x23ceaa?.[_0x5a6f5f(0x245)],'force':_0x23ceaa?.[_0x5a6f5f(0x1ee)],'allowInsecureLocalhost':_0x23ceaa?.['allowInsecureLocalhost'],'scope':_0x23ceaa?.['scope']},_0x2397eb),{'ready':!![],'skipped':![]};}catch(_0x116f25){return console['error'](_0x317835['dlIdL'],_0x317835[_0x5a6f5f(0x1f6)](_0x116f25,Error)?_0x116f25['message']:_0x116f25),{'ready':![],'skipped':![]};}}export async function start(_0xc8be1f,_0x18d355,_0x2f946b){const _0x1399e5=_0x52ae,_0x437273={'XDSKD':function(_0x20d5cf,_0x426689){return _0x20d5cf!==_0x426689;},'NLCBV':_0x1399e5(0x240),'uGRqO':function(_0x3c6da1,_0x50358a){return _0x3c6da1+_0x50358a;},'mpjrm':function(_0x273454,_0x3e55ca){return _0x273454(_0x3e55ca);},'bQCXo':function(_0x43ea2a){return _0x43ea2a();},'eaASL':function(_0x42d353,_0x4d6252){return _0x42d353(_0x4d6252);},'MXYGz':'✓\x20Skipping\x20authentication\x20(--skip-auth)','nhgFT':_0x1399e5(0x21e),'dGaFo':function(_0x685258,_0x188b84){return _0x685258(_0x188b84);},'hdtlU':'chromium','SYxEt':_0x1399e5(0x213),'cjCCJ':_0x1399e5(0x243),'bPPYw':_0x1399e5(0x1f8),'HBvAk':function(_0x2af99c,_0x3b9f65,_0x3d3ba3){return _0x2af99c(_0x3b9f65,_0x3d3ba3);},'qyGFJ':'opencode','CvaPN':function(_0x41ce08,_0x351dd3){return _0x41ce08(_0x351dd3);},'SgdVE':function(_0x4fd6dc,_0x268714){return _0x4fd6dc+_0x268714;},'bJULT':'ranger\x20profile\x20add\x20<name>','wiIQA':'with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'};console[_0x1399e5(0x20e)]('\x0a🚀\x20Ranger\x20Setup\x0a');_0x18d355?.['scope']!==undefined&&_0x437273[_0x1399e5(0x209)](_0x18d355[_0x1399e5(0x233)],_0x437273[_0x1399e5(0x217)])&&(console[_0x1399e5(0x221)](_0x437273['uGRqO']('ranger\x20setup\x20--scope='+_0x437273['mpjrm'](String,_0x18d355['scope'])+_0x1399e5(0x212)+'Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20',_0x1399e5(0x237))),process['exit'](0x1));_0x18d355={..._0x18d355,'scope':_0x437273[_0x1399e5(0x217)]};const _0x2b6bd5=!existsSync(_0x437273['bQCXo'](getRangerHomeDir));await _0x437273[_0x1399e5(0x229)](ensureRangerDir,_0x437273[_0x1399e5(0x217)]);if(_0x18d355?.['skipAuth'])console['log'](_0x437273['MXYGz']),_0x2f946b?.[_0x1399e5(0x1f4)](_0x437273[_0x1399e5(0x1f7)],{'isFirstRun':_0x2b6bd5,'method':'skipped'});else{_0x2f946b?.['trackPhaseStart'](_0x437273['nhgFT']);const _0x25f074=await authenticate(_0xc8be1f);_0x2f946b?.[_0x1399e5(0x1f4)]('auth',{'isFirstRun':_0x2b6bd5,'method':_0x25f074['method']});}_0x2f946b?.[_0x1399e5(0x244)](_0x1399e5(0x210));_0x18d355?.[_0x1399e5(0x1ef)]?console[_0x1399e5(0x20e)]('✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)'):await _0x437273[_0x1399e5(0x22b)](ensureChromium,_0x18d355?.[_0x1399e5(0x1fe)]);_0x2f946b?.['trackPhaseEnd'](_0x437273[_0x1399e5(0x247)],{'isFirstRun':_0x2b6bd5,'skipped':!!_0x18d355?.[_0x1399e5(0x1ef)]}),console['log'](_0x437273[_0x1399e5(0x225)]);const _0x5cd509=_0x18d355?.[_0x1399e5(0x233)],_0x4299f1=_0x18d355?.['opencode']??![];let _0x4dc786=null;_0x4299f1?(_0x2f946b?.[_0x1399e5(0x244)](_0x437273['cjCCJ']),_0x4dc786=await _0x437273['eaASL'](ensureOpencodePluginConfig,_0x5cd509),_0x2f946b?.['trackPhaseEnd'](_0x437273['cjCCJ'],{'isFirstRun':_0x2b6bd5,'opencode':!![]})):(_0x2f946b?.[_0x1399e5(0x244)]('plugin'),await ensureClaudePlugin(_0x5cd509),_0x2f946b?.['trackPhaseEnd']('plugin',{'isFirstRun':_0x2b6bd5}));if(_0x4299f1&&_0x4dc786){_0x2f946b?.['trackPhaseStart'](_0x437273['bPPYw']);try{await _0x437273[_0x1399e5(0x1fb)](installSkill,'ranger',{'level':_0x4dc786['scope'],'cliVersion':getCurrentVersion(),'platform':_0x437273[_0x1399e5(0x1f0)]}),_0x2f946b?.['trackPhaseEnd'](_0x437273[_0x1399e5(0x234)],{'isFirstRun':_0x2b6bd5,'opencode':!![]});}catch(_0x3f5fff){console['warn'](_0x1399e5(0x22a),_0x3f5fff instanceof Error?_0x3f5fff[_0x1399e5(0x222)]:_0x3f5fff),_0x2f946b?.['trackPhaseEnd'](_0x1399e5(0x1f8),{'isFirstRun':_0x2b6bd5,'opencode':!![],'failed':!![]});}}else _0x2f946b?.[_0x1399e5(0x244)](_0x437273[_0x1399e5(0x234)]),await _0x437273[_0x1399e5(0x204)](ensureClaudeSkills,_0x5cd509),_0x2f946b?.[_0x1399e5(0x1f4)]('skills',{'isFirstRun':_0x2b6bd5});if(_0x18d355?.['skipAuth'])console[_0x1399e5(0x20e)](_0x1399e5(0x211));else{if(_0x18d355?.[_0x1399e5(0x245)]){_0x2f946b?.[_0x1399e5(0x244)](_0x1399e5(0x207));const _0x18b69a=await _0x437273[_0x1399e5(0x1fb)](ensureLocalEnv,{'url':_0x18d355[_0x1399e5(0x245)],'force':_0x18d355?.['force'],'allowInsecureLocalhost':_0x18d355?.[_0x1399e5(0x232)],'scope':'user'},_0x2f946b);_0x2f946b?.['trackPhaseEnd'](_0x1399e5(0x207),{'isFirstRun':_0x2b6bd5,'profileReady':_0x18b69a['ready'],'userSkipped':_0x18b69a[_0x1399e5(0x215)]});}else console['log'](_0x437273[_0x1399e5(0x248)](_0x437273[_0x1399e5(0x248)](_0x1399e5(0x20a)+('\x0a\x20\x20'+bold(_0x437273[_0x1399e5(0x242)]))+'\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)',_0x1399e5(0x201)),'\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles'));}if(_0x4299f1)console['log'](_0x1399e5(0x227)),console[_0x1399e5(0x20e)]('and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review'),console['log'](_0x437273[_0x1399e5(0x22f)]),console[_0x1399e5(0x20e)]('verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.');else{const _0x3eb060=bold('/ranger:enable');console[_0x1399e5(0x20e)](_0x437273['uGRqO'](_0x1399e5(0x20f)+_0x3eb060+'\x20and\x20prompt\x20the\x20coding'+'\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with',_0x1399e5(0x21a))+_0x1399e5(0x23c));}}
1
+ const _0x1a29c5=_0x4806;(function(_0x5f0358,_0x3b4819){const _0x5d8a29=_0x4806,_0x4632f2=_0x5f0358();while(!![]){try{const _0x1a394f=-parseInt(_0x5d8a29(0x1e0))/0x1+parseInt(_0x5d8a29(0x1de))/0x2*(-parseInt(_0x5d8a29(0x1df))/0x3)+parseInt(_0x5d8a29(0x209))/0x4+parseInt(_0x5d8a29(0x1ba))/0x5*(parseInt(_0x5d8a29(0x205))/0x6)+-parseInt(_0x5d8a29(0x208))/0x7*(parseInt(_0x5d8a29(0x1fc))/0x8)+parseInt(_0x5d8a29(0x1d5))/0x9+-parseInt(_0x5d8a29(0x1cd))/0xa*(-parseInt(_0x5d8a29(0x1eb))/0xb);if(_0x1a394f===_0x3b4819)break;else _0x4632f2['push'](_0x4632f2['shift']());}catch(_0x138527){_0x4632f2['push'](_0x4632f2['shift']());}}}(_0x56b1,0xd4122));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x43e129 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';function _0x4806(_0x18e08d,_0x559b1b){_0x18e08d=_0x18e08d-0x1b0;const _0x56b1ab=_0x56b1();let _0x480698=_0x56b1ab[_0x18e08d];return _0x480698;}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 _0x56b1(){const _0x29172e=['✓\x20Created\x20.ranger/.gitignore','log','12ffdTJI','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','7mKIGwQ','4565432HKrURj','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','\x20now?','✓\x20Exported\x20credentials\x20for\x20CI','gMzzt','\x0a\x20\x20','playwright/package.json','ignore','BoUdj','trackPhaseStart','stdin','confirm','gAkLJ','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','1.58.2','success','yKiDd','ranger\x20setup\x20--scope=','plugin','skipped','env','ranger','AOFnp','\x0a⚠\x20Skipping\x20Chromium\x20installation.','organizationName','message','✓\x20Already\x20authenticated\x20to\x20','skipChromium','XDoOI','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','sRLfb','tOMxT','213865LvFazb','aVGMy','auth','RJgKu','user','executablePath','ready','RgYdd','ZTmiD','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','eLHBT','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','chromium','BHpdh','Authentication\x20failed:\x20','yAxbZ','awZMo','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','yOGlM','2540EktdVS','zBvLQ','allowInsecureLocalhost','\x20install\x20chromium','EpOnu','bGWnl','close','\x0aInstalling\x20Chromium\x20browser...\x0a','1964169ZyrEeZ','KkHWe','method','exit','trackPhaseEnd','aLcrb','...','error','hqReZ','9928rWumAc','939twCybI','1321398tKKVRb','mQTtA','Sxlru','pAeef','url','skills','.gitignore','\x20and\x20prompt\x20the\x20coding','✓\x20Authenticated\x20to\x20','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','✓\x20Skipping\x20authentication\x20(--skip-auth)','119779iEsnmm','\x1b[0m','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','local','pHqfs','\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','\x20(fallback\x20version)','USczp','TVwuJ','platform','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','Installation\x20failed\x20with\x20exit\x20code\x20','3737432qHldBW','\x20\x20npx\x20playwright@','scope','qwxod','install','existing_token','status'];_0x56b1=function(){return _0x29172e;};return _0x56b1();}const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION=_0x1a29c5(0x217);const bold=_0x7e923=>'\x1b[1m'+_0x7e923+_0x1a29c5(0x1ec);export function getPlaywrightVersion(){const _0x1c4620=_0x1a29c5;try{const _0x4fcff0=require['resolve'](_0x1c4620(0x20f)),_0x4e1332=require(_0x4fcff0);return _0x4e1332['version'];}catch{return null;}}export function installChromiumBinary(_0xcf6c4b,_0x593a20=![]){const _0xb45332=_0x1a29c5,_0x1a2723={'bGWnl':function(_0x5e0678,_0x1542ca){return _0x5e0678===_0x1542ca;},'cExwC':function(_0x12c34b,_0x1c0e56){return _0x12c34b(_0x1c0e56);},'YqCxx':function(_0x4fa4ba,_0x4921e4,_0x4682c5,_0x494d8a){return _0x4fa4ba(_0x4921e4,_0x4682c5,_0x494d8a);},'hqReZ':_0xb45332(0x210),'yAxbZ':'inherit','PzWAh':'win32','rpRqL':_0xb45332(0x1d3)};return new Promise((_0x1ac18d,_0x13018f)=>{const _0x2d0f10=_0xb45332,_0x3b2563={'DsPpu':function(_0x2acac7,_0x2c16ed){const _0x4650f4=_0x4806;return _0x1a2723[_0x4650f4(0x1d2)](_0x2acac7,_0x2c16ed);},'QZMxq':function(_0x6a5b52){return _0x6a5b52();},'Sxlru':function(_0x15490b,_0x4b71d3){return _0x1a2723['cExwC'](_0x15490b,_0x4b71d3);}},_0x10646c=['playwright@'+_0xcf6c4b,_0x2d0f10(0x200),..._0x593a20?['--with-deps']:[],_0x2d0f10(0x1c6)],_0x5e7eae=_0x1a2723['YqCxx'](spawn,'npx',_0x10646c,{'stdio':[_0x1a2723[_0x2d0f10(0x1dd)],_0x1a2723[_0x2d0f10(0x1c9)],_0x1a2723[_0x2d0f10(0x1c9)]],'shell':_0x1a2723[_0x2d0f10(0x1d2)](process[_0x2d0f10(0x1f6)],_0x1a2723['PzWAh'])});_0x5e7eae['on'](_0x1a2723['rpRqL'],_0x172641=>{const _0xc70489=_0x2d0f10;_0x3b2563['DsPpu'](_0x172641,0x0)?_0x3b2563['QZMxq'](_0x1ac18d):_0x3b2563[_0xc70489(0x1e2)](_0x13018f,new Error(_0xc70489(0x1fb)+_0x172641));}),_0x5e7eae['on']('error',_0x3e3413=>{_0x13018f(_0x3e3413);});});}export async function authenticate(_0x318e7f){const _0x6ef414=_0x1a29c5,_0x113698={'zBvLQ':function(_0x3a8515){return _0x3a8515();},'aLcrb':function(_0x4e8741,_0x4a898e){return _0x4e8741(_0x4a898e);},'Defoo':_0x6ef414(0x201),'IrvJl':function(_0x1cf39a){return _0x1cf39a();},'awZMo':'device_auth','XDoOI':'Validating\x20API\x20token...','pHqfs':_0x6ef414(0x20c)};if(!_0x318e7f){const _0x19b7ae=await _0x113698[_0x6ef414(0x1ce)](getToken);if(_0x19b7ae){const _0x409cfb=await _0x113698[_0x6ef414(0x1da)](getCurrentUser,_0x19b7ae);if(_0x409cfb[_0x6ef414(0x218)])return console[_0x6ef414(0x204)](_0x6ef414(0x1b4)+_0x409cfb[_0x6ef414(0x1be)][_0x6ef414(0x1b2)]),{'token':_0x19b7ae,'method':_0x113698['Defoo']};}try{_0x318e7f=await _0x113698['IrvJl'](runDeviceAuthFlow);}catch(_0x965ecb){throw new Error(_0x6ef414(0x1c8)+(_0x965ecb instanceof Error?_0x965ecb[_0x6ef414(0x1b3)]:_0x965ecb));}const _0x473fae=await getCurrentUser(_0x318e7f);if(!_0x473fae['success'])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x473fae[_0x6ef414(0x1dc)]);return console[_0x6ef414(0x204)](_0x6ef414(0x1e8)+_0x473fae['user'][_0x6ef414(0x1b2)]),{'token':_0x318e7f,'method':_0x113698[_0x6ef414(0x1ca)]};}console[_0x6ef414(0x204)](_0x113698[_0x6ef414(0x1b6)]);const _0x49b489=await getCurrentUser(_0x318e7f);if(!_0x49b489[_0x6ef414(0x218)]){if(_0x49b489[_0x6ef414(0x202)])throw new Error('Authentication\x20failed:\x20'+_0x49b489[_0x6ef414(0x1dc)]+_0x6ef414(0x1fa));else throw new Error(_0x6ef414(0x1f9)+_0x49b489[_0x6ef414(0x1dc)]+_0x6ef414(0x1cb));}return console['log']('✓\x20Authenticated\x20to\x20'+_0x49b489[_0x6ef414(0x1be)][_0x6ef414(0x1b2)]),await _0x113698[_0x6ef414(0x1da)](storeToken,_0x318e7f),console[_0x6ef414(0x204)](process[_0x6ef414(0x21d)]['GITHUB_ENV']?_0x113698[_0x6ef414(0x1ef)]:'✓\x20Stored\x20credentials\x20locally'),{'token':_0x318e7f,'method':'provided_token'};}export async function ensureRangerDir(_0x13235e){const _0x54ebbc=_0x1a29c5,_0x5b23dd={'RJgKu':function(_0x316ae7){return _0x316ae7();}};void _0x13235e;const _0x1fb721=_0x5b23dd[_0x54ebbc(0x1bd)](getRangerHomeDir);return!existsSync(_0x1fb721)?(await mkdir(_0x1fb721,{'recursive':!![]}),console[_0x54ebbc(0x204)]('✓\x20Created\x20~/.ranger/\x20directory'),{'path':_0x1fb721,'installed':!![]}):(console[_0x54ebbc(0x204)]('✓\x20~/.ranger/\x20directory\x20already\x20exists'),{'path':_0x1fb721,'installed':![]});}export async function ensureChromium(_0x15f874=![]){const _0xd5b682=_0x1a29c5,_0x280ed2={'eIMzt':function(_0x473115,_0xf42191){return _0x473115(_0xf42191);},'aVGMy':function(_0x12bc5b,_0x3e3a6c){return _0x12bc5b??_0x3e3a6c;},'bTaVp':_0xd5b682(0x1d4),'qwxod':function(_0x14d90c,_0x420707){return _0x14d90c instanceof _0x420707;},'DgGed':'You\x20can\x20install\x20it\x20manually\x20by\x20running:','SAoVM':_0xd5b682(0x1b1),'mYUBd':_0xd5b682(0x206)};let _0x3552ab=![];try{const _0x95a991=chromium[_0xd5b682(0x1bf)]();_0x3552ab=_0x280ed2['eIMzt'](existsSync,_0x95a991);}catch{_0x3552ab=![];}if(_0x3552ab)return console[_0xd5b682(0x204)]('✓\x20Playwright\x20Chromium\x20browser\x20found'),![];const _0x1a4b7c=getPlaywrightVersion(),_0x71f482=_0x280ed2[_0xd5b682(0x1bb)](_0x1a4b7c,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x5014ab=!_0x1a4b7c,_0x5f2d8b=process[_0xd5b682(0x213)]['isTTY']&&process['stdout']['isTTY'];let _0xcb8641=!![];if(_0x5f2d8b){const {install:_0x2a9e73}=await _0x43e129['prompt']([{'type':_0xd5b682(0x214),'name':_0xd5b682(0x200),'message':_0x5014ab?_0xd5b682(0x1c5)+_0x71f482+_0xd5b682(0x20b):'The\x20required\x20version\x20('+_0x71f482+_0xd5b682(0x1f2),'default':!![]}]);_0xcb8641=_0x2a9e73;}else console[_0xd5b682(0x204)](_0xd5b682(0x20a)+_0x71f482+(_0x5014ab?_0xd5b682(0x1f3):'')+_0xd5b682(0x1db));if(_0xcb8641){console['log'](_0x280ed2['bTaVp']);try{await installChromiumBinary(_0x71f482,_0x15f874),console[_0xd5b682(0x204)](_0xd5b682(0x1e9));}catch(_0x348b80){console['error']('\x0a❌\x20Failed\x20to\x20install\x20Chromium:',_0x280ed2[_0xd5b682(0x1ff)](_0x348b80,Error)?_0x348b80['message']:_0x348b80),console['log'](_0x280ed2['DgGed']),console['log'](_0xd5b682(0x1fd)+_0x71f482+_0xd5b682(0x1d0));}}else console['log'](_0x280ed2['SAoVM']),console[_0xd5b682(0x204)](_0x280ed2['mYUBd']),console[_0xd5b682(0x204)](_0xd5b682(0x1fd)+_0x71f482+_0xd5b682(0x1d0));return!![];}export async function writeRangerGitignore(_0x101170){const _0x3aea95=_0x1a29c5,_0x3f1f56={'RgYdd':_0x3aea95(0x203)},_0xe4af82=join(_0x101170,_0x3aea95(0x1e6)),_0xb04a63='\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(_0xe4af82,_0xb04a63),console['log'](_0x3f1f56[_0x3aea95(0x1c1)]);}export async function ensureLocalEnv(_0x2df000,_0xc6dd3d){const _0x463da7=_0x1a29c5,_0x3aaea={'BoUdj':function(_0x2bc86e){return _0x2bc86e();},'BHpdh':function(_0x695b44,_0xb1249f){return _0x695b44!==_0xb1249f;},'UlnRf':'user','AOFnp':_0x463da7(0x207),'gMzzt':_0x463da7(0x1ee),'mQTtA':function(_0xd9d74a,_0x582719){return _0xd9d74a instanceof _0x582719;}};if(!_0x3aaea[_0x463da7(0x211)](findGitRoot)&&_0x3aaea[_0x463da7(0x1c7)](_0x2df000?.['scope'],_0x3aaea['UlnRf']))return console[_0x463da7(0x204)](_0x3aaea[_0x463da7(0x1b0)]),{'ready':![],'skipped':!![]};const _0x102caa=_0x2df000?.['scope']==='user'?_0x3aaea[_0x463da7(0x211)](getRangerHomeDir):undefined;if(findExistingEnv(_0x3aaea['gMzzt'],{'locations':[_0x3aaea['gMzzt']],'rangerDir':_0x102caa}))return console[_0x463da7(0x204)]('✓\x20Local\x20profile\x20already\x20exists'),{'ready':!![],'skipped':![]};try{return await addEnv(_0x3aaea[_0x463da7(0x20d)],{'url':_0x2df000?.[_0x463da7(0x1e4)],'force':_0x2df000?.['force'],'allowInsecureLocalhost':_0x2df000?.[_0x463da7(0x1cf)],'scope':_0x2df000?.['scope']},_0xc6dd3d),{'ready':!![],'skipped':![]};}catch(_0x400019){return console[_0x463da7(0x1dc)]('\x0a❌\x20Profile\x20setup\x20failed:',_0x3aaea[_0x463da7(0x1e1)](_0x400019,Error)?_0x400019[_0x463da7(0x1b3)]:_0x400019),{'ready':![],'skipped':![]};}}export async function start(_0x493c89,_0x198f7c,_0x5c60a5){const _0x39d7a6=_0x1a29c5,_0x29c2a0={'QQeJY':function(_0x38a83a,_0x93d73a){return _0x38a83a+_0x93d73a;},'GFvSN':_0x39d7a6(0x1be),'eLHBT':function(_0x5420b0,_0x35b454){return _0x5420b0(_0x35b454);},'CQIwr':function(_0x10a01a){return _0x10a01a();},'gAkLJ':_0x39d7a6(0x1bc),'Lruyw':'skipped','umCES':function(_0x1da641,_0x545276){return _0x1da641(_0x545276);},'yKiDd':'✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','EpOnu':'chromium','weBCa':function(_0x2f4faa,_0x4a36e5){return _0x2f4faa&&_0x4a36e5;},'WCWeC':_0x39d7a6(0x1e5),'KkHWe':_0x39d7a6(0x1f1),'xBhhz':'\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','USczp':'profile','tOMxT':function(_0x599f5b,_0x1522cf,_0x12cd1c){return _0x599f5b(_0x1522cf,_0x12cd1c);},'ZTmiD':function(_0x2d4847,_0x40bfbd){return _0x2d4847+_0x40bfbd;},'yOGlM':function(_0xcd4344,_0x19c8a5){return _0xcd4344+_0x19c8a5;},'TVwuJ':function(_0x2bc971,_0xe50c2e){return _0x2bc971(_0xe50c2e);},'YxEbk':'ranger\x20profile\x20add\x20<name>','uviXH':_0x39d7a6(0x1c3),'sRLfb':_0x39d7a6(0x1ed),'pAeef':'verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','ChHoz':function(_0x81c2a4,_0x20ba7f){return _0x81c2a4(_0x20ba7f);},'sekav':function(_0x541146,_0x5232e5){return _0x541146+_0x5232e5;}};console['log']('\x0a🚀\x20Ranger\x20Setup\x0a');_0x198f7c?.['scope']!==undefined&&_0x198f7c[_0x39d7a6(0x1fe)]!=='user'&&(console[_0x39d7a6(0x1dc)](_0x29c2a0['QQeJY'](_0x39d7a6(0x21a)+String(_0x198f7c[_0x39d7a6(0x1fe)])+'\x20is\x20no\x20longer\x20supported.\x20','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20')+'project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.'),process[_0x39d7a6(0x1d8)](0x1));_0x198f7c={..._0x198f7c,'scope':_0x29c2a0['GFvSN']};const _0x125915=!_0x29c2a0[_0x39d7a6(0x1c4)](existsSync,_0x29c2a0['CQIwr'](getRangerHomeDir));await ensureRangerDir(_0x29c2a0['GFvSN']);if(_0x198f7c?.['skipAuth'])console['log'](_0x39d7a6(0x1ea)),_0x5c60a5?.[_0x39d7a6(0x1d9)](_0x29c2a0[_0x39d7a6(0x215)],{'isFirstRun':_0x125915,'method':_0x29c2a0['Lruyw']});else{_0x5c60a5?.['trackPhaseStart'](_0x29c2a0['gAkLJ']);const _0xce8aed=await _0x29c2a0['umCES'](authenticate,_0x493c89);_0x5c60a5?.[_0x39d7a6(0x1d9)](_0x39d7a6(0x1bc),{'isFirstRun':_0x125915,'method':_0xce8aed[_0x39d7a6(0x1d7)]});}_0x5c60a5?.[_0x39d7a6(0x212)]('chromium');_0x198f7c?.['skipChromium']?console[_0x39d7a6(0x204)](_0x29c2a0[_0x39d7a6(0x219)]):await _0x29c2a0[_0x39d7a6(0x1c4)](ensureChromium,_0x198f7c?.['withDeps']);_0x5c60a5?.[_0x39d7a6(0x1d9)](_0x29c2a0[_0x39d7a6(0x1d1)],{'isFirstRun':_0x125915,'skipped':!!_0x198f7c?.[_0x39d7a6(0x1b5)]}),console[_0x39d7a6(0x204)]('\x0a✅\x20Ranger\x20setup\x20complete!\x0a');const _0x22844b=_0x198f7c?.[_0x39d7a6(0x1fe)],_0x2b4f5d=_0x198f7c?.['opencode']??![];let _0x386b4f=null;_0x2b4f5d?(_0x5c60a5?.[_0x39d7a6(0x212)]('plugin'),_0x386b4f=await ensureOpencodePluginConfig(_0x22844b),_0x5c60a5?.['trackPhaseEnd'](_0x39d7a6(0x21b),{'isFirstRun':_0x125915,'opencode':!![]})):(_0x5c60a5?.['trackPhaseStart']('plugin'),await ensureClaudePlugin(_0x22844b),_0x5c60a5?.['trackPhaseEnd'](_0x39d7a6(0x21b),{'isFirstRun':_0x125915}));if(_0x29c2a0['weBCa'](_0x2b4f5d,_0x386b4f)){_0x5c60a5?.['trackPhaseStart'](_0x29c2a0['WCWeC']);try{await installSkill(_0x39d7a6(0x21e),{'level':_0x386b4f['scope'],'cliVersion':getCurrentVersion(),'platform':'opencode'}),_0x5c60a5?.['trackPhaseEnd'](_0x29c2a0['WCWeC'],{'isFirstRun':_0x125915,'opencode':!![]});}catch(_0x1e2140){console['warn'](_0x29c2a0[_0x39d7a6(0x1d6)],_0x1e2140 instanceof Error?_0x1e2140[_0x39d7a6(0x1b3)]:_0x1e2140),_0x5c60a5?.['trackPhaseEnd'](_0x29c2a0['WCWeC'],{'isFirstRun':_0x125915,'opencode':!![],'failed':!![]});}}else _0x5c60a5?.['trackPhaseStart'](_0x29c2a0['WCWeC']),await _0x29c2a0['umCES'](ensureClaudeSkills,_0x22844b),_0x5c60a5?.[_0x39d7a6(0x1d9)]('skills',{'isFirstRun':_0x125915});if(_0x198f7c?.['skipAuth'])console[_0x39d7a6(0x204)](_0x29c2a0['xBhhz']);else{if(_0x198f7c?.[_0x39d7a6(0x1e4)]){_0x5c60a5?.['trackPhaseStart'](_0x29c2a0[_0x39d7a6(0x1f4)]);const _0x46aec8=await _0x29c2a0[_0x39d7a6(0x1b9)](ensureLocalEnv,{'url':_0x198f7c[_0x39d7a6(0x1e4)],'force':_0x198f7c?.['force'],'allowInsecureLocalhost':_0x198f7c?.['allowInsecureLocalhost'],'scope':_0x29c2a0['GFvSN']},_0x5c60a5);_0x5c60a5?.['trackPhaseEnd'](_0x29c2a0[_0x39d7a6(0x1f4)],{'isFirstRun':_0x125915,'profileReady':_0x46aec8[_0x39d7a6(0x1c0)],'userSkipped':_0x46aec8[_0x39d7a6(0x21c)]});}else console['log'](_0x29c2a0['QQeJY'](_0x29c2a0[_0x39d7a6(0x1c2)](_0x29c2a0[_0x39d7a6(0x1cc)]('\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:',_0x39d7a6(0x20e)+_0x29c2a0[_0x39d7a6(0x1f5)](bold,_0x29c2a0['YxEbk'])),'\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)')+_0x39d7a6(0x1f0),_0x39d7a6(0x1b7)));}if(_0x2b4f5d)console['log'](_0x29c2a0['uviXH']),console['log'](_0x39d7a6(0x1f8)),console[_0x39d7a6(0x204)](_0x29c2a0[_0x39d7a6(0x1b8)]),console['log'](_0x29c2a0[_0x39d7a6(0x1e3)]);else{const _0x57645a=_0x29c2a0['ChHoz'](bold,'/ranger:enable');console[_0x39d7a6(0x204)](_0x29c2a0['sekav']('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x57645a+_0x39d7a6(0x1e7),_0x39d7a6(0x1f7))+_0x39d7a6(0x216)+'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.');}}
@@ -1 +1 @@
1
- const _0x22c896=_0x5ae1;(function(_0x1991cc,_0x3b201d){const _0x1c30c9=_0x5ae1,_0x236654=_0x1991cc();while(!![]){try{const _0x2d062c=parseInt(_0x1c30c9(0x1d1))/0x1*(parseInt(_0x1c30c9(0x1fc))/0x2)+-parseInt(_0x1c30c9(0x1d3))/0x3+parseInt(_0x1c30c9(0x1ed))/0x4+-parseInt(_0x1c30c9(0x1ea))/0x5*(parseInt(_0x1c30c9(0x1c9))/0x6)+-parseInt(_0x1c30c9(0x1da))/0x7+parseInt(_0x1c30c9(0x1f8))/0x8*(parseInt(_0x1c30c9(0x1df))/0x9)+parseInt(_0x1c30c9(0x213))/0xa*(parseInt(_0x1c30c9(0x20f))/0xb);if(_0x2d062c===_0x3b201d)break;else _0x236654['push'](_0x236654['shift']());}catch(_0x1e0b8f){_0x236654['push'](_0x236654['shift']());}}}(_0x55a9,0x9699e));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{listCloudProfiles}from'./utils/cloudProfile.js';import{getPluginInfo}from'./utils/claudePlugin.js';function _0x55a9(){const _0x148261=['\x0a---\x20Claude\x20Code\x20Plugin\x20---','\x20\x20\x20\x20Auth:\x20','1989204omjmkG','Root:\x20','KpLmb','env','\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','\x0a---\x20Profiles\x20---','not_installed','\x1b[0m','opencode','isActive','dQITu','568wYnmVs','settingsPath','TpaGM','all','676HkLEDG','\x20\x20Project-level:','ranger@trailhead','utf-8','zEBqA','BddMO','HHdzm','auth.json','aiCBD','\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a','configured','isArray','IYKYc','jKNJp','TFMEz','sessionUpdatedAt','stdout','user',':\x20installed\x20(','814qwTNqv','plaintext','\x20\x20Run:\x20ranger\x20update','API\x20Environment:\x20','193580ffyaFx','\x20\x20Not\x20configured','@ranger-testing/opencode-plugin','\x1b[1m','iGWcT','log','uQhEM','zBvmT','\x20\x20Run:\x20ranger\x20skillup','map','success','not_configured','stderr','VKAew','cwd','\x20\x20Run:\x20ranger\x20setup\x20[token]','includes','\x0a---\x20OpenCode\x20Plugin\x20---','path','filter','plugin',':\x20configured','XMZrI','details','string','\x20(active)','\x0a---\x20Skills\x20---','53166koMWMY','has','\x1b]8;;\x07','\x20\x20\x20\x20Session:\x20','displayName','length','PNAeT','ppTez','1106EvYcUE','DEBUG','2677209upVBMt','DSoYt','\x20local','\x20\x20\x20\x20','\x20(up\x20to\x20date)','\x20\x20Run:\x20ranger\x20setup\x20--opencode','FmtHG','5647845guiSaW','enabled','\x20\x20\x20\x20Settings:\x20','API\x20Token:\x20✗\x20Not\x20found','\x20[local]','17307ufwKNU','name','bjAGv','ATzuv','Version:\x20','No\x20skills\x20installed','oUusb','RUaic','(not\x20found)','status','opencode-plugin','70lARCkd'];_0x55a9=function(){return _0x148261;};return _0x55a9();}import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x4b1001=>_0x22c896(0x216)+_0x4b1001+_0x22c896(0x1f4),link=(_0x4b90cb,_0xac0c2a)=>'\x1b]8;;file://'+_0x4b90cb+'\x07'+(_0xac0c2a||_0x4b90cb)+_0x22c896(0x1cb);async function getOpencodePluginStatus(){const _0x495190=_0x22c896,_0x1893b4={'BddMO':function(_0x229c47,_0x264bfd){return _0x229c47(_0x264bfd);},'dQITu':'configured','zBvmT':function(_0x27e28e,_0x3b837f){return _0x27e28e>_0x3b837f;},'XMZrI':_0x495190(0x22b),'cUeZo':_0x495190(0x215),'UJpek':'debug','LBEff':'config','TpaGM':'ignore','aiCBD':'pipe','QwPSf':'data','jKNJp':'close'};return new Promise(_0x1f61c5=>{const _0x56d5ff=_0x495190,_0x483cda={'bjAGv':_0x1893b4[_0x56d5ff(0x229)],'dOcPZ':_0x1893b4['cUeZo']},_0x1d55c2=spawn(_0x56d5ff(0x1f5),[_0x1893b4['UJpek'],_0x1893b4['LBEff']],{'stdio':[_0x1893b4[_0x56d5ff(0x1fa)],_0x1893b4[_0x56d5ff(0x204)],_0x1893b4['aiCBD']]});let _0x47e359='';_0x1d55c2[_0x56d5ff(0x20c)]?.['on'](_0x1893b4['QwPSf'],_0x558bb5=>{_0x47e359+=_0x558bb5['toString']();}),_0x1d55c2[_0x56d5ff(0x21f)]?.['on'](_0x1893b4['QwPSf'],_0x38a0d5=>{_0x47e359+=_0x38a0d5['toString']();}),_0x1d55c2['on']('error',()=>{const _0x470d34=_0x56d5ff;_0x1f61c5({'status':_0x470d34(0x1f3)});}),_0x1d55c2['on'](_0x1893b4[_0x56d5ff(0x209)],_0x5b6d19=>{const _0x45ecd4=_0x56d5ff;if(_0x5b6d19!==0x0){_0x1893b4[_0x45ecd4(0x201)](_0x1f61c5,{'status':_0x45ecd4(0x1f3)});return;}const _0x9af332=_0x47e359['trim']();let _0xc2663a=null;if(_0x9af332)try{_0xc2663a=JSON['parse'](_0x9af332);}catch{const _0x3b05cc=_0x9af332['match'](/\{[\s\S]*\}$/);if(_0x3b05cc)try{_0xc2663a=JSON['parse'](_0x3b05cc[0x0]);}catch{_0xc2663a=null;}}const _0x72ebcc=Array[_0x45ecd4(0x207)](_0xc2663a?.['plugin'])?_0xc2663a?.[_0x45ecd4(0x227)]:[],_0x32ac4c=_0x72ebcc['some'](_0x922f78=>{const _0x5c7bd2=_0x45ecd4;if(typeof _0x922f78!==_0x483cda[_0x5c7bd2(0x1e1)])return![];return _0x922f78[_0x5c7bd2(0x223)](_0x483cda['dOcPZ'])||_0x922f78['includes'](_0x5c7bd2(0x1e9));});if(_0x32ac4c){_0x1f61c5({'status':_0x1893b4[_0x45ecd4(0x1f7)],'details':_0x72ebcc[_0x45ecd4(0x1ce)]>0x0?_0x72ebcc[_0x45ecd4(0x1ce)]+'\x20plugin(s)\x20configured':undefined});return;}if(_0x1893b4[_0x45ecd4(0x21a)](_0x72ebcc[_0x45ecd4(0x1ce)],0x0)){_0x1f61c5({'status':_0x45ecd4(0x21e),'details':_0x72ebcc[_0x45ecd4(0x1ce)]+'\x20plugin(s)\x20configured'});return;}_0x1f61c5({'status':'not_configured'});});});}async function getSkillsFromDir(_0x55dc7e,_0x359032){const _0x97c20f=_0x22c896,_0x2e8343={'uQhEM':function(_0x1e93b8,_0xafb512){return _0x1e93b8(_0xafb512);},'FmtHG':function(_0x3ee7ab,_0x3b4e47,_0xc7154e,_0x305315){return _0x3ee7ab(_0x3b4e47,_0xc7154e,_0x305315);},'ATzuv':'SKILL.md','rlSyg':function(_0x4aeea2,_0x4c0cb8,_0x271a0c){return _0x4aeea2(_0x4c0cb8,_0x271a0c);}};if(!_0x2e8343[_0x97c20f(0x219)](existsSync,_0x55dc7e))return[];const _0x143130=[];try{const _0xa00f6e=await readdir(_0x55dc7e,{'withFileTypes':!![]});for(const _0x43211a of _0xa00f6e){if(_0x43211a['isDirectory']()){const _0x4d0657=_0x2e8343[_0x97c20f(0x1d9)](join,_0x55dc7e,_0x43211a['name'],_0x2e8343[_0x97c20f(0x1e2)]);if(_0x2e8343['uQhEM'](existsSync,_0x4d0657)){let _0x12f01a=_0x43211a[_0x97c20f(0x1e0)];try{const _0x3d95bb=await _0x2e8343['rlSyg'](readFile,_0x4d0657,_0x97c20f(0x1ff)),_0x89adbc=_0x3d95bb['match'](/name:\s*(.+)/);_0x89adbc&&(_0x12f01a=_0x89adbc[0x1]['trim']());}catch{}_0x143130['push']({'name':_0x43211a[_0x97c20f(0x1e0)],'displayName':_0x12f01a,'path':_0x4d0657,'level':_0x359032});}}}}catch{return[];}return _0x143130;}async function getInstalledSkills(){const _0xbae091=_0x22c896,[_0x5d2353,_0x49ba3a]=await Promise[_0xbae091(0x1fb)]([getSkillsFromDir(getProjectSkillsDir(),'project'),getSkillsFromDir(getUserSkillsDir(),_0xbae091(0x20d))]);return{'project':_0x5d2353,'user':_0x49ba3a};}async function getEnvironments(){const _0x17ac22=_0x22c896,_0x303309={'BDzhn':function(_0x4728fb,_0x72fd63,_0x4d0bd6){return _0x4728fb(_0x72fd63,_0x4d0bd6);},'viiGj':_0x17ac22(0x203),'mJBJm':function(_0x1fd0f9,_0x507dde,_0xaf28c2){return _0x1fd0f9(_0x507dde,_0xaf28c2);},'zYtpv':'auth.json.enc','KpLmb':function(_0x879e86,_0x1deb52){return _0x879e86===_0x1deb52;},'KaNtD':function(_0x2ae701){return _0x2ae701();}},{envNames:_0x513d03,activeEnv:_0x110eea}=await _0x303309['KaNtD'](getEnvNames),_0x4f6c19=getRangerDir();if(!existsSync(_0x4f6c19))return{'envs':[],'activeEnv':null};const _0x2f02c2=_0x513d03[_0x17ac22(0x21c)](_0x286ea6=>{const _0x21f478=_0x17ac22,_0x2b57b9=getEnvDir(_0x286ea6),_0x5775d5=_0x303309['BDzhn'](join,_0x2b57b9,'settings.json'),_0x2944a9=_0x303309['BDzhn'](join,_0x2b57b9,_0x303309['viiGj']),_0x5058fa=_0x303309['mJBJm'](join,_0x2b57b9,_0x303309['zYtpv']);return{'name':_0x286ea6,'settingsPath':existsSync(_0x5775d5)?_0x5775d5:_0x21f478(0x1e7),'hasPlaintextAuth':existsSync(_0x2944a9),'hasEncryptedAuth':existsSync(_0x5058fa),'isActive':_0x303309[_0x21f478(0x1ef)](_0x286ea6,_0x110eea)};});return{'envs':_0x2f02c2,'activeEnv':_0x110eea};}function _0x5ae1(_0xabb67c,_0x534fc3){_0xabb67c=_0xabb67c-0x1c8;const _0x55a9e1=_0x55a9();let _0x5ae1d9=_0x55a9e1[_0xabb67c];return _0x5ae1d9;}export async function status(){const _0xd57bae=_0x22c896,_0xfbb3f9={'zEBqA':function(_0x6ffe15,_0x42ff89,_0x5c22f5){return _0x6ffe15(_0x42ff89,_0x5c22f5);},'ppTez':function(_0x59d203,_0x1fda2d){return _0x59d203(_0x1fda2d);},'DSoYt':function(_0x2fa9fc){return _0x2fa9fc();},'VKAew':function(_0x33c960){return _0x33c960();},'PNAeT':function(_0x56c6b0,_0x28df6a){return _0x56c6b0===_0x28df6a;},'TDrnU':'not_configured','ECHKE':function(_0x1608d6,_0x578977){return _0x1608d6(_0x578977);},'PNUrm':_0xd57bae(0x1db),'gERIN':function(_0x35ddae,_0x3b7e63){return _0x35ddae(_0x3b7e63);},'uGmWQ':function(_0x29350c,_0x368fd1){return _0x29350c+_0x368fd1;},'RUaic':_0xd57bae(0x1e4),'cHLlj':function(_0xc763c1,_0x6008ca){return _0xc763c1(_0x6008ca);},'FzAmQ':function(_0x32cbc7,_0x453307,_0x23ae32){return _0x32cbc7(_0x453307,_0x23ae32);},'HHdzm':function(_0x3fd41b,_0x2d4e90){return _0x3fd41b===_0x2d4e90;},'WzlTu':'No\x20profiles\x20configured','IYKYc':function(_0x54a16f,_0x4305df){return _0x54a16f>_0x4305df;},'oUusb':function(_0x3e06be,_0x38c4e5){return _0x3e06be(_0x38c4e5);},'TFMEz':'no\x20session','NLQsp':'none','grYmo':function(_0x168ae6,_0x37a914){return _0x168ae6(_0x37a914);},'hlpJa':function(_0x4f3e29,_0x243409){return _0x4f3e29!==_0x243409;},'iGWcT':_0xd57bae(0x1e7),'QCLnZ':function(_0x506777,_0x50e71e,_0x12fb0e){return _0x506777(_0x50e71e,_0x12fb0e);}};console[_0xd57bae(0x218)]('\x0a📊\x20Ranger\x20Status\x0a');const _0x4d3fed=process[_0xd57bae(0x221)](),_0x287bfd=getRangerDir();if(!existsSync(_0x287bfd)){console[_0xd57bae(0x218)](_0xd57bae(0x1ee)+_0xfbb3f9[_0xd57bae(0x200)](link,_0x4d3fed,_0xfbb3f9['ppTez'](bold,_0xfbb3f9[_0xd57bae(0x1d0)](basename,_0x4d3fed)))),console[_0xd57bae(0x218)]('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console['log'](_0xd57bae(0x205));return;}console[_0xd57bae(0x218)](_0xd57bae(0x1ee)+link(_0x4d3fed,bold(basename(_0x4d3fed))));const _0x56b43a=_0xfbb3f9['DSoYt'](getCurrentVersion),_0xe6b411=_0xfbb3f9[_0xd57bae(0x220)](getLatestVersion);if(_0xe6b411['version']&&_0xe6b411['version']!==_0x56b43a)console['log']('Version:\x20'+_0x56b43a+'\x20(latest:\x20'+_0xe6b411['version']+')'),console[_0xd57bae(0x218)](_0xd57bae(0x211));else _0xe6b411['version']?console[_0xd57bae(0x218)](_0xd57bae(0x1e3)+_0x56b43a+_0xd57bae(0x1d7)):console[_0xd57bae(0x218)](_0xd57bae(0x1e3)+_0x56b43a);const _0x144b83=await getToken();if(_0x144b83){const _0x5b6fa6=await _0xfbb3f9[_0xd57bae(0x1d0)](getCurrentUser,_0x144b83);_0x5b6fa6[_0xd57bae(0x21d)]?console['log']('Organization:\x20'+_0xfbb3f9[_0xd57bae(0x1d0)](bold,_0x5b6fa6['user']['organizationName'])):(console[_0xd57bae(0x218)]('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console[_0xd57bae(0x218)](_0xd57bae(0x222)));}else console[_0xd57bae(0x218)](_0xd57bae(0x1dd)),console[_0xd57bae(0x218)]('\x20\x20Run:\x20ranger\x20setup\x20[token]');process[_0xd57bae(0x1f0)][_0xd57bae(0x1d2)]&&(console['log'](_0xd57bae(0x212)+getCurrentEnvironment()),console[_0xd57bae(0x218)]('API\x20URL:\x20'+getApiBaseUrl()));console['log'](_0xd57bae(0x224));const _0x144168=await getOpencodePluginStatus();if(_0x144168[_0xd57bae(0x1e8)]===_0xd57bae(0x206))console['log']('\x20\x20'+_0xfbb3f9[_0xd57bae(0x1d0)](bold,_0xd57bae(0x215))+_0xd57bae(0x228)),_0x144168['details']&&console[_0xd57bae(0x218)]('\x20\x20'+_0x144168[_0xd57bae(0x22a)]);else _0xfbb3f9[_0xd57bae(0x1cf)](_0x144168['status'],_0xfbb3f9['TDrnU'])?(console['log'](_0xd57bae(0x214)),_0x144168['details']&&console['log']('\x20\x20'+_0x144168[_0xd57bae(0x22a)]),console['log'](_0xd57bae(0x1d8))):console[_0xd57bae(0x218)](_0xd57bae(0x1f1));console['log'](_0xd57bae(0x1eb));const _0x476c89=await _0xfbb3f9['ECHKE'](getPluginInfo,_0xd57bae(0x1fe));if(_0x476c89){const _0x2afc6b=_0x476c89['scope']||'unknown',_0x1cde91=_0x476c89[_0xd57bae(0x1db)]?_0xfbb3f9['PNUrm']:'disabled';console[_0xd57bae(0x218)]('\x20\x20'+_0xfbb3f9['gERIN'](bold,'ranger@trailhead')+_0xd57bae(0x20e)+_0x2afc6b+',\x20'+_0x1cde91+')');}else console['log']('\x20\x20Not\x20installed'),console[_0xd57bae(0x218)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)');console[_0xd57bae(0x218)](_0xd57bae(0x1c8));const {project:_0x87eb58,user:_0x58e8b1}=await getInstalledSkills(),_0x1be2c0=_0x87eb58['filter'](_0x5accbf=>RANGER_MANAGED_SKILLS['includes'](_0x5accbf[_0xd57bae(0x1e0)])),_0x561ec3=_0x58e8b1[_0xd57bae(0x226)](_0x13fdd1=>RANGER_MANAGED_SKILLS['includes'](_0x13fdd1['name'])),_0x57853d=_0xfbb3f9['uGmWQ'](_0x1be2c0['length'],_0x561ec3[_0xd57bae(0x1ce)]);if(_0x57853d===0x0)console['log'](_0xfbb3f9[_0xd57bae(0x1e6)]),console['log'](_0xd57bae(0x21b));else{if(_0x1be2c0['length']>0x0){console['log'](_0xd57bae(0x1fd));for(const _0x2923e8 of _0x1be2c0){console[_0xd57bae(0x218)](_0xd57bae(0x1d6)+_0xfbb3f9['cHLlj'](bold,_0x2923e8[_0xd57bae(0x1cd)])+':\x20'+link(_0x2923e8['path'],basename(_0x2923e8[_0xd57bae(0x225)])));}}if(_0x561ec3[_0xd57bae(0x1ce)]>0x0){console[_0xd57bae(0x218)]('\x20\x20User-level:');for(const _0x23a100 of _0x561ec3){console[_0xd57bae(0x218)]('\x20\x20\x20\x20'+bold(_0x23a100['displayName'])+':\x20'+_0xfbb3f9['FzAmQ'](link,_0x23a100['path'],_0xfbb3f9['cHLlj'](basename,_0x23a100['path'])));}}}console['log'](_0xd57bae(0x1f2));const {envs:_0xd0fd82,activeEnv:_0x320ffe}=await _0xfbb3f9[_0xd57bae(0x1d4)](getEnvironments);let _0xac0b21=[];if(_0x144b83)try{_0xac0b21=await listCloudProfiles();}catch{}const _0x39cff2=_0xd0fd82['length']+_0xac0b21[_0xd57bae(0x1ce)];if(_0xfbb3f9[_0xd57bae(0x202)](_0x39cff2,0x0))console['log'](_0xfbb3f9['WzlTu']),console[_0xd57bae(0x218)]('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{if(_0xfbb3f9[_0xd57bae(0x208)](_0x39cff2,0x5)){const _0x461f7b=[];_0xac0b21[_0xd57bae(0x1ce)]>0x0&&_0x461f7b['push'](_0xac0b21['length']+'\x20cloud'),_0xd0fd82[_0xd57bae(0x1ce)]>0x0&&_0x461f7b['push'](_0xd0fd82[_0xd57bae(0x1ce)]+_0xd57bae(0x1d5)),console['log'](_0x39cff2+'\x20profiles\x20configured\x20('+_0x461f7b['join'](',\x20')+')'),_0x320ffe&&console['log']('\x20\x20Active:\x20'+_0xfbb3f9[_0xd57bae(0x1e5)](bold,_0x320ffe)),console[_0xd57bae(0x218)]('\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)');}else{for(const _0x21c80b of _0xac0b21){const _0x3a53f1=_0xfbb3f9[_0xd57bae(0x1cf)](_0x21c80b['name'],_0x320ffe)?'\x20(active)':'';console[_0xd57bae(0x218)]('\x20\x20'+bold(_0x21c80b[_0xd57bae(0x1e0)])+'\x20[cloud]'+_0x3a53f1);const _0x25fc7a=_0x21c80b[_0xd57bae(0x20b)]?'cached\x20(updated\x20'+_0x21c80b[_0xd57bae(0x20b)]+')':_0xfbb3f9[_0xd57bae(0x20a)];console[_0xd57bae(0x218)](_0xd57bae(0x1cc)+_0x25fc7a);}const _0x596d34=new Set(_0xac0b21['map'](_0x335053=>_0x335053['name']));for(const _0x3ae49d of _0xd0fd82){if(_0x596d34[_0xd57bae(0x1ca)](_0x3ae49d['name']))continue;const _0x42e6df=_0x3ae49d[_0xd57bae(0x1f6)]?_0xd57bae(0x22c):'',_0x3ab753=_0x3ae49d['hasEncryptedAuth']?'encrypted':_0x3ae49d['hasPlaintextAuth']?_0xd57bae(0x210):_0xfbb3f9['NLQsp'];console[_0xd57bae(0x218)]('\x20\x20'+_0xfbb3f9['grYmo'](bold,_0x3ae49d['name'])+_0xd57bae(0x1de)+_0x42e6df),console['log'](_0xd57bae(0x1ec)+_0x3ab753),_0xfbb3f9['hlpJa'](_0x3ae49d[_0xd57bae(0x1f9)],_0xfbb3f9[_0xd57bae(0x217)])&&console[_0xd57bae(0x218)](_0xd57bae(0x1dc)+_0xfbb3f9['QCLnZ'](link,_0x3ae49d['settingsPath'],basename(_0x3ae49d['settingsPath'])));}if(!_0x320ffe){console['log']('\x0a\x20\x20No\x20active\x20profile\x20set');const _0x2a0200=[..._0xac0b21[_0xd57bae(0x21c)](_0x4ebc4a=>_0x4ebc4a['name']),..._0xd0fd82[_0xd57bae(0x226)](_0x574140=>!_0x596d34[_0xd57bae(0x1ca)](_0x574140[_0xd57bae(0x1e0)]))['map'](_0x5d91f8=>_0x5d91f8['name'])];console[_0xd57bae(0x218)]('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x2a0200['join'](',\x20')+')');}}}console[_0xd57bae(0x218)]('');}
1
+ const _0x95941a=_0x4fcf;(function(_0xa3d105,_0x2be40d){const _0x26691e=_0x4fcf,_0x3c6010=_0xa3d105();while(!![]){try{const _0x29f305=-parseInt(_0x26691e(0x1ff))/0x1+parseInt(_0x26691e(0x1fa))/0x2+-parseInt(_0x26691e(0x1d7))/0x3*(parseInt(_0x26691e(0x1c1))/0x4)+parseInt(_0x26691e(0x1c3))/0x5*(-parseInt(_0x26691e(0x207))/0x6)+parseInt(_0x26691e(0x1dc))/0x7+parseInt(_0x26691e(0x1ec))/0x8+parseInt(_0x26691e(0x1f6))/0x9*(parseInt(_0x26691e(0x1d6))/0xa);if(_0x29f305===_0x2be40d)break;else _0x3c6010['push'](_0x3c6010['shift']());}catch(_0x55327f){_0x3c6010['push'](_0x3c6010['shift']());}}}(_0x2f95,0x56136));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';function _0x2f95(){const _0x2d8fe4=['\x0a---\x20OpenCode\x20Plugin\x20---','user','37143EybMjj','auth.json.enc','MBDzb','toString','309604KaJHJq','isArray','parse','match','MNkzf','325403UawBka','\x20\x20\x20\x20Auth:\x20','hasEncryptedAuth','\x20\x20Project-level:','pPuPc','name','feeOk','ihTKA','126042JxpVGd','\x0a---\x20Claude\x20Code\x20Plugin\x20---','env','Root:\x20','\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>','\x1b]8;;file://','isDirectory','ignore','JZGhz','NuOxs','sessionUpdatedAt','map','plugin','push','API\x20Token:\x20✗\x20Not\x20found','vVwLB','\x20cloud','API\x20URL:\x20','path','filter','utf-8','Version:\x20','Bkyog','includes','length','4gmCCXH','BIWfk','35KTFcTF','pWVuD','\x20\x20Run:\x20ranger\x20skillup','stdout','cached\x20(updated\x20','join','\x20[local]','\x20(up\x20to\x20date)','xwwUl','SKILL.md','\x20(latest:\x20','status','\x1b[1m','\x20\x20Run:\x20ranger\x20setup\x20[token]','settingsPath','log','data','\x20\x20\x20\x20','VglKe','640UxeTos','73335RHaGWR','\x20\x20Run:\x20ranger\x20update','\x0a\x20\x20No\x20active\x20profile\x20set','wHyKX','opencode-plugin','1140209fbCEka','not_installed','disabled','(not\x20found)','\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)','VKBvK','NxzxU','No\x20profiles\x20configured','\x20(active)','details','gAEvP','displayName','ceHLp','QOcZO','Oeffs','ZxHMZ','2141168KRAKmF','PXIfG','Organization:\x20','sUohW','pipe','\x20plugin(s)\x20configured','\x20[cloud]','not_configured'];_0x2f95=function(){return _0x2d8fe4;};return _0x2f95();}import{existsSync}from'fs';function _0x4fcf(_0x4ae98e,_0x26b1ef){_0x4ae98e=_0x4ae98e-0x1be;const _0x2f9571=_0x2f95();let _0x4fcf23=_0x2f9571[_0x4ae98e];return _0x4fcf23;}import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{listCloudProfiles}from'./utils/cloudProfile.js';import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x401fcc=>_0x95941a(0x1cf)+_0x401fcc+'\x1b[0m',link=(_0x3e8d34,_0x108031)=>_0x95941a(0x20c)+_0x3e8d34+'\x07'+(_0x108031||_0x3e8d34)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x40b15c=_0x95941a,_0x4b1158={'zcPqy':function(_0x21efce,_0x343675){return _0x21efce!==_0x343675;},'feeOk':function(_0x2c256a,_0x5df0e4){return _0x2c256a(_0x5df0e4);},'MBDzb':function(_0x18f319,_0x16b88f){return _0x18f319>_0x16b88f;},'jPDWR':_0x40b15c(0x1f3),'YbbQs':'config','dPrdC':'pipe','Oeffs':_0x40b15c(0x1d3),'EfMNi':'error','vVwLB':'close'};return new Promise(_0x443a7b=>{const _0x2d3e76=_0x40b15c,_0x41297f={'MNkzf':'@ranger-testing/opencode-plugin'},_0xdd4418=spawn('opencode',['debug',_0x4b1158['YbbQs']],{'stdio':[_0x2d3e76(0x20e),_0x4b1158['dPrdC'],_0x2d3e76(0x1f0)]});let _0x1fe3ac='';_0xdd4418[_0x2d3e76(0x1c6)]?.['on']('data',_0x6bc8a2=>{_0x1fe3ac+=_0x6bc8a2['toString']();}),_0xdd4418['stderr']?.['on'](_0x4b1158[_0x2d3e76(0x1ea)],_0x4120a8=>{const _0x1b762f=_0x2d3e76;_0x1fe3ac+=_0x4120a8[_0x1b762f(0x1f9)]();}),_0xdd4418['on'](_0x4b1158['EfMNi'],()=>{const _0x2fd0eb=_0x2d3e76;_0x443a7b({'status':_0x2fd0eb(0x1dd)});}),_0xdd4418['on'](_0x4b1158[_0x2d3e76(0x216)],_0x27d49a=>{const _0x302066=_0x2d3e76;if(_0x4b1158['zcPqy'](_0x27d49a,0x0)){_0x4b1158['feeOk'](_0x443a7b,{'status':_0x302066(0x1dd)});return;}const _0x3b7770=_0x1fe3ac['trim']();let _0x3c41f7=null;if(_0x3b7770)try{_0x3c41f7=JSON['parse'](_0x3b7770);}catch{const _0x3a754b=_0x3b7770['match'](/\{[\s\S]*\}$/);if(_0x3a754b)try{_0x3c41f7=JSON[_0x302066(0x1fc)](_0x3a754b[0x0]);}catch{_0x3c41f7=null;}}const _0x2f77be=Array[_0x302066(0x1fb)](_0x3c41f7?.['plugin'])?_0x3c41f7?.[_0x302066(0x213)]:[],_0x57fdf0=_0x2f77be['some'](_0x1bf47e=>{const _0x27b1d1=_0x302066;if(typeof _0x1bf47e!=='string')return![];return _0x1bf47e[_0x27b1d1(0x1bf)](_0x41297f[_0x27b1d1(0x1fe)])||_0x1bf47e['includes'](_0x27b1d1(0x1db));});if(_0x57fdf0){_0x443a7b({'status':'configured','details':_0x4b1158[_0x302066(0x1f8)](_0x2f77be['length'],0x0)?_0x2f77be[_0x302066(0x1c0)]+_0x302066(0x1f1):undefined});return;}if(_0x2f77be[_0x302066(0x1c0)]>0x0){_0x443a7b({'status':'not_configured','details':_0x2f77be[_0x302066(0x1c0)]+_0x302066(0x1f1)});return;}_0x4b1158[_0x302066(0x205)](_0x443a7b,{'status':_0x4b1158['jPDWR']});});});}async function getSkillsFromDir(_0x293d0c,_0x381bb7){const _0x3860f5=_0x95941a,_0x2121b9={'Bkyog':function(_0x6517f0,_0x59baf7){return _0x6517f0(_0x59baf7);},'ectqJ':function(_0x108ac5,_0x232905,_0x480455){return _0x108ac5(_0x232905,_0x480455);}};if(!existsSync(_0x293d0c))return[];const _0x5a204c=[];try{const _0x4f5e3d=await readdir(_0x293d0c,{'withFileTypes':!![]});for(const _0x497a4e of _0x4f5e3d){if(_0x497a4e[_0x3860f5(0x20d)]()){const _0x48be69=join(_0x293d0c,_0x497a4e[_0x3860f5(0x204)],_0x3860f5(0x1cc));if(_0x2121b9[_0x3860f5(0x1be)](existsSync,_0x48be69)){let _0x37b6e2=_0x497a4e['name'];try{const _0x3e2a62=await _0x2121b9['ectqJ'](readFile,_0x48be69,_0x3860f5(0x21b)),_0x46fec8=_0x3e2a62[_0x3860f5(0x1fd)](/name:\s*(.+)/);_0x46fec8&&(_0x37b6e2=_0x46fec8[0x1]['trim']());}catch{}_0x5a204c[_0x3860f5(0x214)]({'name':_0x497a4e['name'],'displayName':_0x37b6e2,'path':_0x48be69,'level':_0x381bb7});}}}}catch{return[];}return _0x5a204c;}async function getInstalledSkills(){const _0x11f6ad={'BhlUC':function(_0x40d27d){return _0x40d27d();}},[_0x5c5cf6,_0x1b6c2b]=await Promise['all']([getSkillsFromDir(_0x11f6ad['BhlUC'](getProjectSkillsDir),'project'),getSkillsFromDir(getUserSkillsDir(),'user')]);return{'project':_0x5c5cf6,'user':_0x1b6c2b};}async function getEnvironments(){const _0x4872a9=_0x95941a,_0x211d12={'bXwAz':function(_0x484759,_0x6a3d2f,_0x345060){return _0x484759(_0x6a3d2f,_0x345060);},'BIWfk':'settings.json','ZxHMZ':function(_0x2bcea5,_0x185538){return _0x2bcea5(_0x185538);},'pPuPc':function(_0x4606df,_0x56538e){return _0x4606df===_0x56538e;},'NuOxs':function(_0x26bf03,_0x36c6cc){return _0x26bf03(_0x36c6cc);}},{envNames:_0x4348d5,activeEnv:_0x30ac41}=await getEnvNames(),_0x16655f=getRangerDir();if(!_0x211d12[_0x4872a9(0x210)](existsSync,_0x16655f))return{'envs':[],'activeEnv':null};const _0x55906f=_0x4348d5[_0x4872a9(0x212)](_0x588c06=>{const _0x24a220=_0x4872a9,_0x939db=getEnvDir(_0x588c06),_0x27119c=_0x211d12['bXwAz'](join,_0x939db,_0x211d12[_0x24a220(0x1c2)]),_0x57ab39=join(_0x939db,'auth.json'),_0x1d9b03=join(_0x939db,_0x24a220(0x1f7));return{'name':_0x588c06,'settingsPath':existsSync(_0x27119c)?_0x27119c:_0x24a220(0x1df),'hasPlaintextAuth':_0x211d12[_0x24a220(0x1eb)](existsSync,_0x57ab39),'hasEncryptedAuth':_0x211d12[_0x24a220(0x1eb)](existsSync,_0x1d9b03),'isActive':_0x211d12[_0x24a220(0x203)](_0x588c06,_0x30ac41)};});return{'envs':_0x55906f,'activeEnv':_0x30ac41};}export async function status(){const _0x19566b=_0x95941a,_0x3adcca={'nMxUZ':function(_0x397a0d){return _0x397a0d();},'gAEvP':function(_0x1a8b8a,_0x4ce5d1,_0x139668){return _0x1a8b8a(_0x4ce5d1,_0x139668);},'pWVuD':function(_0x4f3b32,_0x5afe18){return _0x4f3b32(_0x5afe18);},'PUGHt':function(_0x319012){return _0x319012();},'fZQOB':function(_0x948501){return _0x948501();},'JZGhz':function(_0x57cd27,_0x1b457b){return _0x57cd27===_0x1b457b;},'PXIfG':'configured','DodDX':_0x19566b(0x1f3),'wHyKX':'\x20\x20Run:\x20ranger\x20setup\x20--opencode','XDtaP':'\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','NxzxU':_0x19566b(0x208),'xwwUl':function(_0x30a65c,_0x4754de){return _0x30a65c(_0x4754de);},'vsuRb':'ranger@trailhead','DJfDg':'enabled','XxvQJ':_0x19566b(0x1de),'ceHLp':function(_0x5b4819,_0x2be909){return _0x5b4819(_0x2be909);},'zfYoj':'\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','swmhJ':function(_0x3c6543){return _0x3c6543();},'QOcZO':function(_0x415782,_0x41bf2b){return _0x415782+_0x41bf2b;},'VKBvK':'No\x20skills\x20installed','VglKe':function(_0x22fac6,_0x538a65){return _0x22fac6>_0x538a65;},'oFIJX':'\x20\x20User-level:','ihTKA':function(_0x4163a2){return _0x4163a2();},'MaKQJ':function(_0x5202da,_0x21bcd1){return _0x5202da>_0x21bcd1;},'lWYgu':'no\x20session','YaPJV':_0x19566b(0x1e4),'BqrNf':'encrypted','pCEMf':function(_0x7967e9,_0x540ee1){return _0x7967e9!==_0x540ee1;},'sUohW':function(_0x55334f,_0x514200){return _0x55334f(_0x514200);}};console[_0x19566b(0x1d2)]('\x0a📊\x20Ranger\x20Status\x0a');const _0x53c105=process['cwd'](),_0x565868=_0x3adcca['nMxUZ'](getRangerDir);if(!existsSync(_0x565868)){console[_0x19566b(0x1d2)](_0x19566b(0x20a)+_0x3adcca[_0x19566b(0x1e6)](link,_0x53c105,bold(basename(_0x53c105)))),console[_0x19566b(0x1d2)]('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console[_0x19566b(0x1d2)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console['log']('Root:\x20'+link(_0x53c105,_0x3adcca['pWVuD'](bold,basename(_0x53c105))));const _0x42c249=_0x3adcca['nMxUZ'](getCurrentVersion),_0x4086bb=getLatestVersion();if(_0x4086bb['version']&&_0x4086bb['version']!==_0x42c249)console[_0x19566b(0x1d2)](_0x19566b(0x21c)+_0x42c249+_0x19566b(0x1cd)+_0x4086bb['version']+')'),console['log'](_0x19566b(0x1d8));else _0x4086bb['version']?console[_0x19566b(0x1d2)](_0x19566b(0x21c)+_0x42c249+_0x19566b(0x1ca)):console[_0x19566b(0x1d2)]('Version:\x20'+_0x42c249);const _0x528224=await _0x3adcca['PUGHt'](getToken);if(_0x528224){const _0x1333c9=await getCurrentUser(_0x528224);_0x1333c9['success']?console[_0x19566b(0x1d2)](_0x19566b(0x1ee)+bold(_0x1333c9[_0x19566b(0x1f5)]['organizationName'])):(console['log']('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console[_0x19566b(0x1d2)]('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console[_0x19566b(0x1d2)](_0x19566b(0x215)),console['log'](_0x19566b(0x1d0));process[_0x19566b(0x209)]['DEBUG']&&(console[_0x19566b(0x1d2)]('API\x20Environment:\x20'+_0x3adcca['fZQOB'](getCurrentEnvironment)),console['log'](_0x19566b(0x218)+getApiBaseUrl()));console[_0x19566b(0x1d2)](_0x19566b(0x1f4));const _0x297250=await getOpencodePluginStatus();if(_0x3adcca[_0x19566b(0x20f)](_0x297250['status'],_0x3adcca[_0x19566b(0x1ed)]))console['log']('\x20\x20'+bold('@ranger-testing/opencode-plugin')+':\x20configured'),_0x297250['details']&&console[_0x19566b(0x1d2)]('\x20\x20'+_0x297250[_0x19566b(0x1e5)]);else _0x297250[_0x19566b(0x1ce)]===_0x3adcca['DodDX']?(console[_0x19566b(0x1d2)]('\x20\x20Not\x20configured'),_0x297250['details']&&console[_0x19566b(0x1d2)]('\x20\x20'+_0x297250[_0x19566b(0x1e5)]),console[_0x19566b(0x1d2)](_0x3adcca[_0x19566b(0x1da)])):console['log'](_0x3adcca['XDtaP']);console[_0x19566b(0x1d2)](_0x3adcca[_0x19566b(0x1e2)]);const _0x3b3e49=await _0x3adcca[_0x19566b(0x1cb)](getPluginInfo,_0x3adcca['vsuRb']);if(_0x3b3e49){const _0x2d5370=_0x3b3e49['scope']||'unknown',_0x283e32=_0x3b3e49['enabled']?_0x3adcca['DJfDg']:_0x3adcca['XxvQJ'];console['log']('\x20\x20'+_0x3adcca['ceHLp'](bold,'ranger@trailhead')+':\x20installed\x20('+_0x2d5370+',\x20'+_0x283e32+')');}else console[_0x19566b(0x1d2)]('\x20\x20Not\x20installed'),console[_0x19566b(0x1d2)](_0x3adcca['zfYoj']);console['log']('\x0a---\x20Skills\x20---');const {project:_0x36fe02,user:_0x294b5d}=await _0x3adcca['swmhJ'](getInstalledSkills),_0x3407c6=_0x36fe02[_0x19566b(0x21a)](_0x5200ca=>RANGER_MANAGED_SKILLS[_0x19566b(0x1bf)](_0x5200ca['name'])),_0x2a71d5=_0x294b5d['filter'](_0xc1b389=>RANGER_MANAGED_SKILLS[_0x19566b(0x1bf)](_0xc1b389[_0x19566b(0x204)])),_0x3eaaf2=_0x3adcca[_0x19566b(0x1e9)](_0x3407c6[_0x19566b(0x1c0)],_0x2a71d5['length']);if(_0x3eaaf2===0x0)console['log'](_0x3adcca[_0x19566b(0x1e1)]),console['log'](_0x19566b(0x1c5));else{if(_0x3adcca['VglKe'](_0x3407c6['length'],0x0)){console['log'](_0x19566b(0x202));for(const _0x9c4bba of _0x3407c6){console['log'](_0x19566b(0x1d4)+_0x3adcca[_0x19566b(0x1cb)](bold,_0x9c4bba[_0x19566b(0x1e7)])+':\x20'+link(_0x9c4bba['path'],_0x3adcca[_0x19566b(0x1c4)](basename,_0x9c4bba['path'])));}}if(_0x3adcca[_0x19566b(0x1d5)](_0x2a71d5[_0x19566b(0x1c0)],0x0)){console[_0x19566b(0x1d2)](_0x3adcca['oFIJX']);for(const _0x2c9833 of _0x2a71d5){console['log'](_0x19566b(0x1d4)+bold(_0x2c9833[_0x19566b(0x1e7)])+':\x20'+link(_0x2c9833[_0x19566b(0x219)],_0x3adcca[_0x19566b(0x1e8)](basename,_0x2c9833[_0x19566b(0x219)])));}}}console[_0x19566b(0x1d2)]('\x0a---\x20Profiles\x20---');const {envs:_0x119486,activeEnv:_0x274269}=await _0x3adcca[_0x19566b(0x206)](getEnvironments);let _0x4244bf=[];if(_0x528224)try{_0x4244bf=await listCloudProfiles();}catch{}const _0x3a9574=_0x119486['length']+_0x4244bf['length'];if(_0x3a9574===0x0)console[_0x19566b(0x1d2)](_0x19566b(0x1e3)),console[_0x19566b(0x1d2)](_0x19566b(0x20b));else{if(_0x3adcca['MaKQJ'](_0x3a9574,0x5)){const _0x41097c=[];_0x4244bf['length']>0x0&&_0x41097c[_0x19566b(0x214)](_0x4244bf[_0x19566b(0x1c0)]+_0x19566b(0x217)),_0x119486[_0x19566b(0x1c0)]>0x0&&_0x41097c[_0x19566b(0x214)](_0x119486['length']+'\x20local'),console['log'](_0x3a9574+'\x20profiles\x20configured\x20('+_0x41097c[_0x19566b(0x1c8)](',\x20')+')'),_0x274269&&console[_0x19566b(0x1d2)]('\x20\x20Active:\x20'+_0x3adcca[_0x19566b(0x1cb)](bold,_0x274269)),console['log'](_0x19566b(0x1e0));}else{for(const _0x19c096 of _0x4244bf){const _0x42a50c=_0x19c096['name']===_0x274269?_0x19566b(0x1e4):'';console[_0x19566b(0x1d2)]('\x20\x20'+bold(_0x19c096['name'])+_0x19566b(0x1f2)+_0x42a50c);const _0x274824=_0x19c096['sessionUpdatedAt']?_0x19566b(0x1c7)+_0x19c096[_0x19566b(0x211)]+')':_0x3adcca['lWYgu'];console[_0x19566b(0x1d2)]('\x20\x20\x20\x20Session:\x20'+_0x274824);}const _0x5bd110=new Set(_0x4244bf[_0x19566b(0x212)](_0x4e1241=>_0x4e1241[_0x19566b(0x204)]));for(const _0x551706 of _0x119486){if(_0x5bd110['has'](_0x551706[_0x19566b(0x204)]))continue;const _0x1ec307=_0x551706['isActive']?_0x3adcca['YaPJV']:'',_0x2d3ed1=_0x551706[_0x19566b(0x201)]?_0x3adcca['BqrNf']:_0x551706['hasPlaintextAuth']?'plaintext':'none';console['log']('\x20\x20'+_0x3adcca['ceHLp'](bold,_0x551706[_0x19566b(0x204)])+_0x19566b(0x1c9)+_0x1ec307),console[_0x19566b(0x1d2)](_0x19566b(0x200)+_0x2d3ed1),_0x3adcca['pCEMf'](_0x551706[_0x19566b(0x1d1)],'(not\x20found)')&&console['log']('\x20\x20\x20\x20Settings:\x20'+link(_0x551706[_0x19566b(0x1d1)],_0x3adcca[_0x19566b(0x1ef)](basename,_0x551706['settingsPath'])));}if(!_0x274269){console[_0x19566b(0x1d2)](_0x19566b(0x1d9));const _0x2aebe9=[..._0x4244bf[_0x19566b(0x212)](_0x5b437f=>_0x5b437f['name']),..._0x119486[_0x19566b(0x21a)](_0x27e75b=>!_0x5bd110['has'](_0x27e75b['name']))[_0x19566b(0x212)](_0x4e0432=>_0x4e0432[_0x19566b(0x204)])];console[_0x19566b(0x1d2)]('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x2aebe9['join'](',\x20')+')');}}}console[_0x19566b(0x1d2)]('');}