@ranger-testing/ranger-cli 3.0.1-alpha.ffffb5b-28 → 3.1.1-alpha.b22d278-38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/build/cli.js +1 -1
  2. package/build/commands/addEnv.js +1 -1
  3. package/build/commands/authEncrypt.js +1 -1
  4. package/build/commands/clean.js +1 -1
  5. package/build/commands/config.js +1 -1
  6. package/build/commands/deleteProfile.js +1 -1
  7. package/build/commands/env.js +1 -1
  8. package/build/commands/feature.js +1 -1
  9. package/build/commands/hook.js +1 -1
  10. package/build/commands/hooks/autoPrompt.js +1 -1
  11. package/build/commands/hooks/disable.js +1 -1
  12. package/build/commands/hooks/enable.js +1 -1
  13. package/build/commands/hooks/exitPlanMode.js +1 -1
  14. package/build/commands/hooks/index.js +1 -1
  15. package/build/commands/hooks/output.js +1 -1
  16. package/build/commands/hooks/planReminder.js +1 -1
  17. package/build/commands/hooks/planStart.js +1 -1
  18. package/build/commands/hooks/postEdit.js +1 -1
  19. package/build/commands/hooks/preCompact.js +1 -1
  20. package/build/commands/hooks/sessionEnd.js +1 -1
  21. package/build/commands/hooks/sessionStart.js +1 -1
  22. package/build/commands/hooks/stopHook.js +1 -1
  23. package/build/commands/index.js +1 -1
  24. package/build/commands/login.js +1 -1
  25. package/build/commands/mcpBootstrap.js +1 -1
  26. package/build/commands/migrateProfile.js +1 -1
  27. package/build/commands/setup/claude.js +1 -1
  28. package/build/commands/setup/opencode.js +1 -1
  29. package/build/commands/setupCi.js +1 -1
  30. package/build/commands/skillup.js +1 -1
  31. package/build/commands/start.js +1 -1
  32. package/build/commands/status.js +1 -1
  33. package/build/commands/update.js +1 -1
  34. package/build/commands/updateEnv.js +1 -1
  35. package/build/commands/useEnv.js +1 -1
  36. package/build/commands/utils/activeProfile.js +1 -1
  37. package/build/commands/utils/agentEnv.js +1 -1
  38. package/build/commands/utils/browserSessionsApi.js +1 -1
  39. package/build/commands/utils/claudeConfig.js +1 -1
  40. package/build/commands/utils/claudeOverrideSettings.js +1 -1
  41. package/build/commands/utils/claudePlugin.js +1 -1
  42. package/build/commands/utils/cloudProfile.js +1 -1
  43. package/build/commands/utils/cloudProfileSession.js +1 -1
  44. package/build/commands/utils/crypto.js +1 -1
  45. package/build/commands/utils/desirePathLog.js +1 -1
  46. package/build/commands/utils/deviceAuth.js +1 -1
  47. package/build/commands/utils/environment.js +1 -1
  48. package/build/commands/utils/featureApi.js +1 -1
  49. package/build/commands/utils/fixWebmDuration.js +1 -1
  50. package/build/commands/utils/gitTracked.js +1 -1
  51. package/build/commands/utils/keychain.js +1 -1
  52. package/build/commands/utils/legacyWarning.js +1 -1
  53. package/build/commands/utils/localAgentInstallationsApi.js +1 -1
  54. package/build/commands/utils/matchAuthEnvironment.js +1 -1
  55. package/build/commands/utils/mcpImageBase64.js +1 -1
  56. package/build/commands/utils/model.js +1 -1
  57. package/build/commands/utils/novaActCli.js +1 -1
  58. package/build/commands/utils/opencodeConfig.js +1 -1
  59. package/build/commands/utils/organizationEnvApi.js +1 -0
  60. package/build/commands/utils/playwrightCli.js +1 -1
  61. package/build/commands/utils/profileMessages.js +1 -1
  62. package/build/commands/utils/profileSetupBanner.js +1 -1
  63. package/build/commands/utils/projectsConfig.js +1 -1
  64. package/build/commands/utils/rangerConfig.js +1 -1
  65. package/build/commands/utils/rangerRoot.js +1 -1
  66. package/build/commands/utils/rangerwrightCli.js +1 -0
  67. package/build/commands/utils/resolveProfileContext.js +1 -1
  68. package/build/commands/utils/resolveProfileUrl.js +1 -1
  69. package/build/commands/utils/retry.js +1 -1
  70. package/build/commands/utils/sessionCache.js +1 -1
  71. package/build/commands/utils/settings.js +1 -1
  72. package/build/commands/utils/skillContent.js +1 -1
  73. package/build/commands/utils/skills.js +1 -1
  74. package/build/commands/utils/stitchWebmFiles.js +1 -1
  75. package/build/commands/utils/telemetry.js +1 -1
  76. package/build/commands/utils/tokenRefresh.js +1 -1
  77. package/build/commands/utils/traceSnapshotMapper.js +1 -1
  78. package/build/commands/utils/tunnelClient.js +1 -0
  79. package/build/commands/utils/userApi.js +1 -1
  80. package/build/commands/utils/version.js +1 -1
  81. package/build/commands/verifyFeature.js +1 -1
  82. package/build/commands/verifyFeatureCli.js +1 -1
  83. package/build/commands/verifyFeatureNovaCli.js +1 -1
  84. package/build/commands/verifyFeatureRangerwrightCli.js +1 -0
  85. package/package.json +4 -1
@@ -1 +1 @@
1
- (function(_0x5a7edc,_0x16dcdb){const _0x442d50=_0xb4e6,_0x52d138=_0x5a7edc();while(!![]){try{const _0x54c05b=-parseInt(_0x442d50(0x1a9))/0x1*(parseInt(_0x442d50(0x1ab))/0x2)+parseInt(_0x442d50(0x1ac))/0x3+-parseInt(_0x442d50(0x1a6))/0x4*(parseInt(_0x442d50(0x1a7))/0x5)+parseInt(_0x442d50(0x1a8))/0x6+-parseInt(_0x442d50(0x1ae))/0x7+-parseInt(_0x442d50(0x1a5))/0x8+parseInt(_0x442d50(0x1a1))/0x9;if(_0x54c05b===_0x16dcdb)break;else _0x52d138['push'](_0x52d138['shift']());}catch(_0x5207ff){_0x52d138['push'](_0x52d138['shift']());}}}(_0x5d05,0x1c6f3));function _0x5d05(){const _0x2f7df7=['log','1567048hImKiR','580OkjMJK','1870rqEHJR','1037028sCtgcw','20chYqeE','Xmzpv','1146fkAPsp','6471IDzayr','\x0a✅\x20API\x20key\x20stored\x20successfully','595812hpZWOL','organizationName','MgASk','2593431ArYTUY','ysEJD','message'];_0x5d05=function(){return _0x2f7df7;};return _0x5d05();}import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';import{isInteractive}from'./utils/cloudProfileSession.js';function _0xb4e6(_0x507982,_0x15547d){_0x507982=_0x507982-0x1a0;const _0x5d05c5=_0x5d05();let _0xb4e6c6=_0x5d05c5[_0x507982];return _0xb4e6c6;}export async function login(){const _0x82fc2f=_0xb4e6,_0x32000b={'Xmzpv':function(_0x4ed462){return _0x4ed462();},'ysEJD':function(_0x46bef2,_0x36735d){return _0x46bef2(_0x36735d);},'MgASk':function(_0x1fbfe7,_0xf69e60){return _0x1fbfe7 instanceof _0xf69e60;}},_0x576889=await _0x32000b[_0x82fc2f(0x1aa)](getMcpAuthOrigin);if(_0x576889){console['log']('Re-authenticating\x20via\x20MCP\x20bootstrap...'),await mcpBootstrap();return;}if(!_0x32000b[_0x82fc2f(0x1aa)](isInteractive))throw new Error('Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.');try{const _0x194ad4=await runDeviceAuthFlow(),_0x3e1690=await _0x32000b[_0x82fc2f(0x1a2)](getCurrentUser,_0x194ad4);_0x3e1690['success']?console['log']('\x0a✅\x20Logged\x20in\x20to\x20'+_0x3e1690['user'][_0x82fc2f(0x1af)]):console[_0x82fc2f(0x1a4)](_0x82fc2f(0x1ad));}catch(_0x5df24f){throw new Error('Login\x20failed:\x20'+(_0x32000b[_0x82fc2f(0x1a0)](_0x5df24f,Error)?_0x5df24f[_0x82fc2f(0x1a3)]:_0x5df24f));}}
1
+ (function(_0x5e8b7d,_0x30a2dc){const _0x1bbe36=_0x22f5,_0x555ed3=_0x5e8b7d();while(!![]){try{const _0x3d5fdd=parseInt(_0x1bbe36(0xc0))/0x1+parseInt(_0x1bbe36(0xbe))/0x2*(-parseInt(_0x1bbe36(0xc9))/0x3)+parseInt(_0x1bbe36(0xc7))/0x4*(parseInt(_0x1bbe36(0xc8))/0x5)+parseInt(_0x1bbe36(0xbb))/0x6+parseInt(_0x1bbe36(0xbd))/0x7+-parseInt(_0x1bbe36(0xba))/0x8*(parseInt(_0x1bbe36(0xb9))/0x9)+-parseInt(_0x1bbe36(0xc1))/0xa*(parseInt(_0x1bbe36(0xbc))/0xb);if(_0x3d5fdd===_0x30a2dc)break;else _0x555ed3['push'](_0x555ed3['shift']());}catch(_0x3200f6){_0x555ed3['push'](_0x555ed3['shift']());}}}(_0x49fb,0x545d8));function _0x22f5(_0x370d9d,_0x3c5fbe){_0x370d9d=_0x370d9d-0xb9;const _0x49fb1d=_0x49fb();let _0x22f514=_0x49fb1d[_0x370d9d];return _0x22f514;}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 _0x4f56e9=_0x22f5,_0x305db7={'MPLpO':function(_0x20ae28){return _0x20ae28();},'mGOPN':function(_0x45c345){return _0x45c345();},'BRXCr':function(_0x91ae31){return _0x91ae31();},'lgyNG':function(_0x42a491,_0x2cdb5c){return _0x42a491(_0x2cdb5c);}},_0x683718=await _0x305db7[_0x4f56e9(0xc3)](getMcpAuthOrigin);if(_0x683718){console['log']('Re-authenticating\x20via\x20MCP\x20bootstrap...'),await _0x305db7[_0x4f56e9(0xc3)](mcpBootstrap);return;}if(!_0x305db7['mGOPN'](isInteractive))throw new Error('Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.');try{const _0x28968e=await _0x305db7['BRXCr'](runDeviceAuthFlow),_0x20fa38=await _0x305db7[_0x4f56e9(0xbf)](getCurrentUser,_0x28968e);_0x20fa38[_0x4f56e9(0xc4)]?console[_0x4f56e9(0xc2)]('\x0a✅\x20Logged\x20in\x20to\x20'+_0x20fa38[_0x4f56e9(0xc5)]['organizationName']):console[_0x4f56e9(0xc2)]('\x0a✅\x20API\x20key\x20stored\x20successfully');}catch(_0x444c13){throw new Error(_0x4f56e9(0xc6)+(_0x444c13 instanceof Error?_0x444c13['message']:_0x444c13));}}function _0x49fb(){const _0x73c8dd=['70LSLaht','log','MPLpO','success','user','Login\x20failed:\x20','84xAggdo','25700SSgATD','21qtRLpH','2194119ISSuCz','8uRDQKq','1927530eCkiMI','82049uNHixs','2409519ogyVDI','39324zsmYbo','lgyNG','5786ILyTpZ'];_0x49fb=function(){return _0x73c8dd;};return _0x49fb();}
@@ -1 +1 @@
1
- const _0x530b10=_0x5dc1;(function(_0x270c26,_0x2482f3){const _0x4c7ce6=_0x5dc1,_0x2df368=_0x270c26();while(!![]){try{const _0x225079=-parseInt(_0x4c7ce6(0x122))/0x1*(-parseInt(_0x4c7ce6(0xd6))/0x2)+parseInt(_0x4c7ce6(0x12a))/0x3+-parseInt(_0x4c7ce6(0x110))/0x4*(-parseInt(_0x4c7ce6(0x125))/0x5)+-parseInt(_0x4c7ce6(0xeb))/0x6+parseInt(_0x4c7ce6(0xfd))/0x7*(parseInt(_0x4c7ce6(0xb0))/0x8)+-parseInt(_0x4c7ce6(0x118))/0x9+parseInt(_0x4c7ce6(0x11c))/0xa*(-parseInt(_0x4c7ce6(0xfa))/0xb);if(_0x225079===_0x2482f3)break;else _0x2df368['push'](_0x2df368['shift']());}catch(_0x53df1b){_0x2df368['push'](_0x2df368['shift']());}}}(_0x2e1b,0x755e0));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(),_0x530b10(0x114),'mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),'.ranger','auth-origin.txt');export async function getMcpAuthOrigin(){const _0x47f09d=_0x530b10,_0x427d41={'YYazz':'utf-8','tuaZl':function(_0x5bac57,_0x2693b5){return _0x5bac57||_0x2693b5;}};try{const _0x6802ea=(await readFile(AUTH_ORIGIN_PATH,_0x427d41['YYazz']))[_0x47f09d(0xa3)]();return _0x427d41['tuaZl'](_0x6802ea,null);}catch{return null;}}export async function mcpBootstrap(){const _0xe1ae0c=_0x530b10,_0x42bf20={'yajPw':function(_0x558593,_0x340ee0){return _0x558593(_0x340ee0);},'iKAHl':function(_0x2c675e){return _0x2c675e();},'NQCAM':function(_0xe637a7,_0x59b868){return _0xe637a7+_0x59b868;},'fmrXN':'MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','CYxNU':function(_0x29388a,_0x2d3de3,_0x200cc3){return _0x29388a(_0x2d3de3,_0x200cc3);}},_0x1e4941=getMcpAuthUrl();currentOrigin=_0x1e4941;const _0x49839a=process['stdout']['isTTY']??![];console['log'](_0xe1ae0c(0xed)+_0x1e4941+'\x0a');const _0x52aef8=await _0x42bf20['yajPw'](tryUnauthenticated,_0x1e4941);let _0x176769=null;if(_0x52aef8===_0xe1ae0c(0x121))_0x176769='';else{_0x176769=await _0x42bf20['iKAHl'](loadCachedToken);if(!_0x176769){if(!_0x49839a)throw new Error(_0x42bf20['NQCAM'](_0x42bf20[_0xe1ae0c(0x10c)],_0xe1ae0c(0x107)));_0x176769=await _0x42bf20[_0xe1ae0c(0xe3)](oauthFlow,_0x1e4941);}}await _0x42bf20[_0xe1ae0c(0x9f)](callGetCliToken,_0x1e4941,_0x176769);}function _0x2e1b(){const _0x4f4a81=['/.well-known/oauth-protected-resource','url','close','client_id','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','yajPw','state','base64url','error','UhLjW','get','sytvs','cUACs','893820wnLZUJ','isError','\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20','Initializing\x20MCP\x20session...','startsWith','OIJmw','log','origin','UuHGR','status','pathname','refresh_token','Token\x20exchange\x20failed:\x20','iwMJX','Exchanging\x20authorization\x20code...','12860441ALMfcz','application/json,\x20text/event-stream','mZLon','604170RrFgZq','get_cli_token\x20failed:\x20','OGedG','DPGDS','BQVms','2.0','aOddD','ydnCA','end','MCP\x20initialize\x20failed:\x20','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','expires_in','token','ZPMNx','gpMad','fmrXN','qpzwQ','flqRP','Yoojg','1268876rvJMho','registration_endpoint','\x20done','FgWgd','.ranger','code','headers','yxzSj','4423959VVKhqO','CWjIH','zOFoh','uvuvt','10wiaIGd','Registering\x20OAuth\x20client...','2025-03-26','string','aVLax','proxied','411RfBONH','UPnOH','needs-oauth','10UdzApF','POST','xdg-open','toString','structuredContent','1003755NvUSYR','utf-8','length','listen','RwivN','\x0aOpening\x20browser\x20for\x20authentication...','VjwaW','access_token','\x0aToken\x20written\x20to\x20','CYxNU','update','Requesting\x20CLI\x20token...','NeDQW','trim','HTTP\x20','text','write','/callback','vKBlj','xJlNS','clientId','now','json','match','1.0.0','expiresAt','88qNwElw','slice','writeHead','text/html','CYHbr','data:','authorization_servers','Qmptu','127.0.0.1','clientSecret','content','includes','redirect_uri','notifications/initialized','resource','parse','token_endpoint','searchParams','CdVZi','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','replace','initialize','darwin','stdout','stringify','VCBUn','none','message','ranger-cli','\x0aUnexpected\x20response\x20structure:','authorization_code','name','http://localhost:','set','faOpt','Qfbcu','digest','code_challenge_method','1810kCXEjN','text/event-stream','uxhWC','uYCdo','kGQfH','Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20','sha256','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata'];_0x2e1b=function(){return _0x4f4a81;};return _0x2e1b();}function _0x5dc1(_0x43ae25,_0x247cf8){_0x43ae25=_0x43ae25-0x9b;const _0x2e1bf2=_0x2e1b();let _0x5dc12b=_0x2e1bf2[_0x43ae25];return _0x5dc12b;}async function tryUnauthenticated(_0x19a120){const _0x277099=_0x530b10,_0x44396b={'gpncf':'POST','pMkcS':_0x277099(0xfb),'ydnCA':_0x277099(0x11e),'Dhjna':function(_0x3839dd,_0x4a29a6){return _0x3839dd===_0x4a29a6;},'NeDQW':_0x277099(0x124)},_0xaedeae=await fetch(_0x19a120,{'method':_0x44396b['gpncf'],'headers':{'Content-Type':'application/json','Accept':_0x44396b['pMkcS']},'body':JSON['stringify']({'jsonrpc':'2.0','id':0x1,'method':'initialize','params':{'protocolVersion':_0x44396b[_0x277099(0x104)],'capabilities':{},'clientInfo':{'name':_0x277099(0xcc),'version':_0x277099(0xae)}}})});if(_0xaedeae['ok'])return await _0xaedeae[_0x277099(0xa5)](),'proxied';if(_0x44396b['Dhjna'](_0xaedeae[_0x277099(0xf4)],0x191))return await _0xaedeae['text'](),_0x44396b[_0x277099(0xa2)];const _0x42498f=await _0xaedeae['text']();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0xaedeae[_0x277099(0xf4)]+':\x20'+_0x42498f);}class OAuthTimeoutError extends Error{constructor(_0x4700e7){const _0x16062f=_0x530b10;super(_0x4700e7),this[_0x16062f(0xcf)]='OAuthTimeoutError';}}async function oauthFlow(_0x54e94e){const _0x3dac65=_0x530b10,_0x4872a0={'Qmptu':'\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'};try{return await oauthFlowAttempt(_0x54e94e);}catch(_0x5b7474){if(_0x5b7474 instanceof OAuthTimeoutError&&await loadCachedClient())return console['log'](_0x4872a0[_0x3dac65(0xb7)]),await clearCachedClient(),await oauthFlowAttempt(_0x54e94e);throw _0x5b7474;}}async function oauthFlowAttempt(_0x40eb47){const _0x4096ce=_0x530b10,_0x5d453d={'VnAJl':function(_0x1812dd){return _0x1812dd();},'CYHbr':function(_0x1d7165,_0x5f33c5,_0xcd1148){return _0x1d7165(_0x5f33c5,_0xcd1148);},'yVgMK':'POST','NCmvg':'application/json','RwivN':_0x4096ce(0xce),'uvuvt':'refresh_token','kGQfH':_0x4096ce(0xe5),'UuHGR':_0x4096ce(0xd5),'aVLax':'S256','DPGDS':_0x4096ce(0xe4),'YRGAL':_0x4096ce(0xbe),'DPJqo':function(_0x25fb94,_0x4d3188){return _0x25fb94(_0x4d3188);},'rsgcT':function(_0x53d877,_0x5dac4f){return _0x53d877(_0x5dac4f);},'CWjIH':_0x4096ce(0xf9),'uxhWC':'client_secret','Qfbcu':'application/x-www-form-urlencoded','faOpt':'\x20done','qtGTK':function(_0x240d0f,_0xd73cf0,_0x3b51cd,_0x5248b4){return _0x240d0f(_0xd73cf0,_0x3b51cd,_0x5248b4);}},_0x4afd56=_0x40eb47[_0x4096ce(0xc4)](/\/mcp$/,'');process['stdout']['write']('Discovering\x20authorization\x20server...');const _0x51318b=await fetch(_0x4afd56+_0x4096ce(0xde));if(!_0x51318b['ok'])throw new Error('Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server');const _0x459143=await _0x51318b['json'](),_0x3efa65=_0x459143[_0x4096ce(0xb6)]?.[0x0];if(!_0x3efa65)throw new Error(_0x4096ce(0xdd));console['log']('\x20'+_0x3efa65);const _0x47afea=await fetchAuthServerMetadata(_0x3efa65);let _0x5d8cc7,_0x2d8dd4;const _0x45d6e4=await _0x5d453d['VnAJl'](loadCachedClient);if(_0x45d6e4)_0x5d8cc7=_0x45d6e4['clientId'],_0x2d8dd4=_0x45d6e4[_0x4096ce(0xb9)];else{if(_0x47afea['registration_endpoint']){process[_0x4096ce(0xc7)][_0x4096ce(0xa6)](_0x4096ce(0x11d));const _0x5d3116=await _0x5d453d[_0x4096ce(0xb4)](fetch,_0x47afea[_0x4096ce(0x111)],{'method':_0x5d453d['yVgMK'],'headers':{'Content-Type':_0x5d453d['NCmvg']},'body':JSON['stringify']({'client_name':'Ranger\x20CLI','redirect_uris':[_0x4096ce(0xd0)+CALLBACK_PORT+_0x4096ce(0xa7)],'grant_types':[_0x5d453d['RwivN'],_0x5d453d[_0x4096ce(0x11b)]],'response_types':[_0x4096ce(0x115)],'token_endpoint_auth_method':_0x4096ce(0xca)})});if(!_0x5d3116['ok']){const _0x583f92=await _0x5d3116['text']();throw new Error('Client\x20registration\x20failed:\x20'+_0x583f92);}const _0x329fc1=await _0x5d3116[_0x4096ce(0xac)]();_0x5d8cc7=_0x329fc1[_0x4096ce(0xe1)],_0x2d8dd4=_0x329fc1['client_secret'],await saveCachedClient(_0x5d8cc7,_0x2d8dd4),console[_0x4096ce(0xf1)](_0x4096ce(0x112));}else throw new Error(_0x4096ce(0xc3));}const _0x12868d=randomBytes(0x20)['toString']('base64url'),_0x5b440e=createHash(_0x4096ce(0xdc))[_0x4096ce(0xa0)](_0x12868d)[_0x4096ce(0xd4)](_0x5d453d[_0x4096ce(0xda)]),_0x27afa4=randomBytes(0x10)[_0x4096ce(0x128)]('hex'),_0x1b9ffe=new URL(_0x47afea['authorization_endpoint']);_0x1b9ffe['searchParams']['set']('response_type','code'),_0x1b9ffe[_0x4096ce(0xc1)]['set'](_0x4096ce(0xe1),_0x5d8cc7),_0x1b9ffe['searchParams'][_0x4096ce(0xd1)](_0x4096ce(0xbc),'http://localhost:'+CALLBACK_PORT+'/callback'),_0x1b9ffe['searchParams'][_0x4096ce(0xd1)]('code_challenge',_0x5b440e),_0x1b9ffe[_0x4096ce(0xc1)]['set'](_0x5d453d[_0x4096ce(0xf3)],_0x5d453d[_0x4096ce(0x120)]),_0x1b9ffe[_0x4096ce(0xc1)][_0x4096ce(0xd1)](_0x5d453d[_0x4096ce(0x100)],_0x27afa4);_0x459143[_0x4096ce(0xbe)]&&_0x1b9ffe[_0x4096ce(0xc1)]['set'](_0x5d453d['YRGAL'],_0x459143['resource']);console[_0x4096ce(0xf1)](_0x4096ce(0x9b)),console['log'](_0x4096ce(0xe2)+_0x1b9ffe[_0x4096ce(0x128)]()+'\x0a'),await _0x5d453d['DPJqo'](openBrowser,_0x1b9ffe['toString']());const _0x34533b=await _0x5d453d['rsgcT'](waitForCallback,_0x27afa4);process['stdout'][_0x4096ce(0xa6)](_0x5d453d[_0x4096ce(0x119)]);const _0x421a93=new URLSearchParams({'grant_type':_0x5d453d[_0x4096ce(0x12e)],'code':_0x34533b,'redirect_uri':'http://localhost:'+CALLBACK_PORT+'/callback','client_id':_0x5d8cc7,'code_verifier':_0x12868d});_0x2d8dd4&&_0x421a93['set'](_0x5d453d[_0x4096ce(0xd8)],_0x2d8dd4);_0x459143[_0x4096ce(0xbe)]&&_0x421a93[_0x4096ce(0xd1)]('resource',_0x459143[_0x4096ce(0xbe)]);const _0xa35a49=await _0x5d453d['CYHbr'](fetch,_0x47afea[_0x4096ce(0xc0)],{'method':'POST','headers':{'Content-Type':_0x5d453d[_0x4096ce(0xd3)]},'body':_0x421a93});if(!_0xa35a49['ok']){const _0x102276=await _0xa35a49['text']();throw new Error(_0x4096ce(0xf7)+_0x102276);}const _0x5b013b=await _0xa35a49[_0x4096ce(0xac)]();return console['log'](_0x5d453d[_0x4096ce(0xd2)]),await _0x5d453d['qtGTK'](saveCachedToken,_0x5b013b[_0x4096ce(0x9d)],_0x5b013b[_0x4096ce(0xf6)],_0x5b013b[_0x4096ce(0x108)]),_0x5b013b[_0x4096ce(0x9d)];}async function callGetCliToken(_0x2f3783,_0x214404){const _0x163056=_0x530b10,_0x1d7aba={'zOFoh':function(_0x3c79fb,_0x31c0ab){return _0x3c79fb(_0x31c0ab);},'StFFk':'application/json','sytvs':'application/json,\x20text/event-stream','UhLjW':'Authorization','mETke':_0x163056(0xee),'MdBLh':_0x163056(0x102),'xJlNS':_0x163056(0xc5),'vSVRW':_0x163056(0xae),'igbVU':_0x163056(0x112),'iwMJX':function(_0x12533c,_0x613d56,_0x5029a2){return _0x12533c(_0x613d56,_0x5029a2);},'QfIMV':_0x163056(0x126),'cUACs':_0x163056(0xa1),'kOvWb':'tools/call','gpMad':function(_0x7ff7be,_0x47d5f5){return _0x7ff7be(_0x47d5f5);},'IubIf':'Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','tkFuu':function(_0x594931){return _0x594931();},'flqRP':function(_0x47c0c9,_0x24f78c,_0x190b81,_0x45854e){return _0x47c0c9(_0x24f78c,_0x190b81,_0x45854e);},'IFUen':'Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a'},_0x5671d2={'Content-Type':_0x1d7aba['StFFk'],'Accept':_0x1d7aba[_0x163056(0xe9)]};_0x214404&&(_0x5671d2[_0x1d7aba[_0x163056(0xe7)]]='Bearer\x20'+_0x214404);const _0x1f575b=async _0x4512b2=>{const _0x5c1a5d=_0x163056,_0x5e38df=await fetch(_0x2f3783,{'method':_0x5c1a5d(0x126),'headers':_0x5671d2,'body':JSON[_0x5c1a5d(0xc8)](_0x4512b2)});if(!_0x5e38df['ok']){const _0x2deeb3=await _0x5e38df[_0x5c1a5d(0xa5)]();throw new Error(_0x5c1a5d(0xa4)+_0x5e38df[_0x5c1a5d(0xf4)]+':\x20'+_0x2deeb3);}return _0x1d7aba[_0x5c1a5d(0x11a)](parseResponse,_0x5e38df);};process[_0x163056(0xc7)]['write'](_0x1d7aba['mETke']);const _0x40c278=await _0x1f575b({'jsonrpc':_0x1d7aba['MdBLh'],'id':0x1,'method':_0x1d7aba[_0x163056(0xa9)],'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x163056(0xcc),'version':_0x1d7aba['vSVRW']}}});if(_0x40c278['error'])throw new Error(_0x163056(0x106)+(_0x40c278[_0x163056(0xe6)][_0x163056(0xcb)]??JSON[_0x163056(0xc8)](_0x40c278[_0x163056(0xe6)])));console['log'](_0x1d7aba['igbVU']),await _0x1d7aba[_0x163056(0xf8)](fetch,_0x2f3783,{'method':_0x1d7aba['QfIMV'],'headers':_0x5671d2,'body':JSON[_0x163056(0xc8)]({'jsonrpc':'2.0','method':_0x163056(0xbd)})})['then'](_0xd2728b=>_0xd2728b[_0x163056(0xa5)]()),process['stdout'][_0x163056(0xa6)](_0x1d7aba[_0x163056(0xea)]);const _0x303447=await _0x1f575b({'jsonrpc':_0x163056(0x102),'id':0x2,'method':_0x1d7aba['kOvWb'],'params':{'name':'get_cli_token','arguments':{}}});if(_0x303447[_0x163056(0xe6)])throw new Error(_0x163056(0xfe)+(_0x303447['error'][_0x163056(0xcb)]??JSON['stringify'](_0x303447['error'])));console[_0x163056(0xf1)](_0x1d7aba['igbVU']);const _0x48cc8e=_0x1d7aba[_0x163056(0x10b)](extractToken,_0x303447['result']);if(!_0x48cc8e){console[_0x163056(0xe6)](_0x163056(0xcd)),console[_0x163056(0xe6)](JSON['stringify'](_0x303447['result'],null,0x2));throw new Error(_0x1d7aba['IubIf']);}const _0xd9ae96=join(_0x1d7aba['tkFuu'](homedir),_0x163056(0x114)),_0x1639ef=_0x1d7aba['iwMJX'](join,_0xd9ae96,'refresh.txt');await mkdir(_0xd9ae96,{'recursive':!![]}),await _0x1d7aba['flqRP'](writeFile,_0x1639ef,_0x48cc8e,{'mode':0x180}),await _0x1d7aba[_0x163056(0x10e)](writeFile,join(_0xd9ae96,'auth-origin.txt'),_0x2f3783,{'mode':0x180}),console[_0x163056(0xf1)](_0x163056(0x9e)+_0x1639ef),console['log'](_0x1d7aba['IFUen']);}async function fetchAuthServerMetadata(_0x3ad8a8){const _0x4ca1c7=_0x530b10,_0x3479aa=_0x3ad8a8+'/.well-known/oauth-authorization-server',_0x175134=await fetch(_0x3479aa);if(!_0x175134['ok'])throw new Error(_0x4ca1c7(0xdb)+_0x3479aa+':\x20'+_0x175134[_0x4ca1c7(0xf4)]);return _0x175134[_0x4ca1c7(0xac)]();}function waitForCallback(_0x506077){const _0x3d2584=_0x530b10,_0xbbf426={'DAQRh':function(_0x180aff){return _0x180aff();},'ftKEJ':_0x3d2584(0xa7),'zLwaa':'error','BQVms':function(_0x3502e2,_0x157b19){return _0x3502e2(_0x157b19);},'zpFRO':'text/html','FgWgd':'<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','VsWmz':_0x3d2584(0xb8)};return new Promise((_0x4e212a,_0x2c7152)=>{const _0x4faec5=_0x3d2584,_0x28ad13={'KttTl':function(_0x5801cd){return _0xbbf426['DAQRh'](_0x5801cd);},'qpzwQ':function(_0x5a10d9,_0x3cb7fd){return _0x5a10d9!==_0x3cb7fd;},'VjwaW':_0xbbf426['ftKEJ'],'bOIdp':'Not\x20found','ZPMNx':_0xbbf426['zLwaa'],'TmLQr':function(_0x1829b0,_0x3b6896){const _0x24b569=_0x5dc1;return _0xbbf426[_0x24b569(0x101)](_0x1829b0,_0x3b6896);},'VXHUb':function(_0x458a69){return _0x458a69();},'vKBlj':_0xbbf426['zpFRO'],'yxzSj':_0xbbf426[_0x4faec5(0x113)],'rZFlC':function(_0x1c8dfa,_0x5785c0){return _0x1c8dfa(_0x5785c0);}},_0x4ad5f8=()=>{const _0x5ad6f0=_0x4faec5;_0x54a58c['closeAllConnections'](),_0x54a58c[_0x5ad6f0(0xe0)]();},_0x39b4b8=setTimeout(()=>{_0x28ad13['KttTl'](_0x4ad5f8),_0x2c7152(new OAuthTimeoutError('OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes'));},0x1d4c0),_0x54a58c=_0xbbf426['BQVms'](createServer,(_0x131cbe,_0x2a340d)=>{const _0x76d9c1=_0x4faec5,_0x5b95e2=new URL(_0x131cbe[_0x76d9c1(0xdf)]??'/','http://localhost:'+CALLBACK_PORT);if(_0x28ad13[_0x76d9c1(0x10d)](_0x5b95e2[_0x76d9c1(0xf5)],_0x28ad13[_0x76d9c1(0x9c)])){_0x2a340d[_0x76d9c1(0xb2)](0x194),_0x2a340d[_0x76d9c1(0x105)](_0x28ad13['bOIdp']);return;}const _0xfc928b=_0x5b95e2[_0x76d9c1(0xc1)][_0x76d9c1(0xe8)]('code'),_0x115e36=_0x5b95e2['searchParams']['get'](_0x76d9c1(0xe4)),_0xaa3f04=_0x5b95e2['searchParams']['get'](_0x28ad13[_0x76d9c1(0x10a)]);if(_0xaa3f04){const _0x25ba43=_0x5b95e2['searchParams'][_0x76d9c1(0xe8)]('error_description')??_0xaa3f04;_0x2a340d['writeHead'](0xc8,{'Content-Type':_0x76d9c1(0xb3)}),_0x2a340d[_0x76d9c1(0x105)]('<html><body><h2>Authentication\x20failed</h2><p>'+_0x25ba43+'</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>'),_0x28ad13['TmLQr'](clearTimeout,_0x39b4b8),_0x28ad13['VXHUb'](_0x4ad5f8),_0x2c7152(new Error('OAuth\x20error:\x20'+_0x25ba43));return;}if(!_0xfc928b||_0x28ad13[_0x76d9c1(0x10d)](_0x115e36,_0x506077)){_0x2a340d['writeHead'](0x190,{'Content-Type':_0x28ad13[_0x76d9c1(0xa8)]}),_0x2a340d[_0x76d9c1(0x105)]('<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>');return;}_0x2a340d['writeHead'](0xc8,{'Content-Type':_0x28ad13['vKBlj']}),_0x2a340d[_0x76d9c1(0x105)](_0x28ad13[_0x76d9c1(0x117)]),_0x28ad13['rZFlC'](clearTimeout,_0x39b4b8),_0x4ad5f8(),_0x4e212a(_0xfc928b);});_0x54a58c[_0x4faec5(0x12d)](CALLBACK_PORT,_0xbbf426['VsWmz']);});}async function openBrowser(_0x56d8c2){const _0x36332d=_0x530b10,_0x453c48={'vafYl':'win32'},_0x19c18c=process['platform']===_0x36332d(0xc6)?'open':process['platform']===_0x453c48['vafYl']?'start':_0x36332d(0x127);exec(_0x19c18c+'\x20\x22'+_0x56d8c2+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x50661c=_0x530b10,_0x332210={'CdVZi':function(_0x23ac4e,_0x15272c,_0xd5c003){return _0x23ac4e(_0x15272c,_0xd5c003);},'naCPg':'utf-8'};try{const _0x59020c=JSON[_0x50661c(0xbf)](await _0x332210[_0x50661c(0xc2)](readFile,TOKEN_CACHE_PATH,_0x332210['naCPg']));if(_0x59020c['origin']&&_0x59020c['origin']!==currentOrigin)return null;if(_0x59020c['expiresAt']&&Date[_0x50661c(0xab)]()>_0x59020c[_0x50661c(0xaf)])return null;return _0x59020c['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0x488e65,_0x2b014d,_0xe3f1c6){const _0x46acd6=_0x530b10,_0x3106b1={'OIJmw':function(_0x5906fe){return _0x5906fe();}},_0x4d19a1=await _0x3106b1[_0x46acd6(0xf0)](loadCachedData),_0x4e481e={..._0x4d19a1,'origin':currentOrigin,'accessToken':_0x488e65,'refreshToken':_0x2b014d??_0x4d19a1?.['refreshToken'],'expiresAt':_0xe3f1c6?Date['now']()+_0xe3f1c6*0x3e8:undefined};await mkdir(join(homedir(),_0x46acd6(0x114)),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x4e481e),{'mode':0x180});}async function loadCachedClient(){const _0x3705b0=_0x530b10,_0xaa275b={'UQoxD':function(_0x5647b3){return _0x5647b3();},'aOddD':function(_0x36f8ef,_0x171837){return _0x36f8ef!==_0x171837;}},_0x4f9df7=await _0xaa275b['UQoxD'](loadCachedData);if(_0x4f9df7?.[_0x3705b0(0xf2)]&&_0xaa275b[_0x3705b0(0x103)](_0x4f9df7['origin'],currentOrigin))return null;return _0x4f9df7?.[_0x3705b0(0xaa)]?{'clientId':_0x4f9df7['clientId'],'clientSecret':_0x4f9df7['clientSecret']}:null;}async function clearCachedClient(){const _0x51c97d=_0x530b10,_0x2a7ce6={'Mrvsi':function(_0x38d2db){return _0x38d2db();}},_0x3a48e9=await _0x2a7ce6['Mrvsi'](loadCachedData);if(!_0x3a48e9)return;const {clientId:_0x2760d7,clientSecret:_0x5eb1ea,..._0x483d8b}=_0x3a48e9;await writeFile(TOKEN_CACHE_PATH,JSON[_0x51c97d(0xc8)](_0x483d8b),{'mode':0x180});}async function saveCachedClient(_0x7f266,_0x1b2c01){const _0x47c235=_0x530b10,_0x1ed429={'IEnol':function(_0xd80f6c){return _0xd80f6c();},'UPnOH':function(_0x1d39df,_0x243c0e,_0x1912fe){return _0x1d39df(_0x243c0e,_0x1912fe);},'bdGgn':function(_0x33cebf,_0x2d80cc,_0x3bf408){return _0x33cebf(_0x2d80cc,_0x3bf408);},'VCBUn':function(_0x3df4aa){return _0x3df4aa();},'mZLon':'.ranger'},_0x19d126=await _0x1ed429['IEnol'](loadCachedData),_0x580575={..._0x19d126,'origin':currentOrigin,'accessToken':_0x19d126?.['accessToken']??'','clientId':_0x7f266,'clientSecret':_0x1b2c01};await _0x1ed429[_0x47c235(0x123)](mkdir,_0x1ed429['bdGgn'](join,_0x1ed429[_0x47c235(0xc9)](homedir),_0x1ed429[_0x47c235(0xfc)]),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x47c235(0xc8)](_0x580575),{'mode':0x180});}async function loadCachedData(){const _0x3c1978=_0x530b10,_0x132bda={'uYCdo':function(_0x355964,_0x4a68d5,_0x22d1af){return _0x355964(_0x4a68d5,_0x22d1af);}};try{return JSON['parse'](await _0x132bda[_0x3c1978(0xd9)](readFile,TOKEN_CACHE_PATH,_0x3c1978(0x12b)));}catch{return null;}}async function parseResponse(_0x180647){const _0x2f4568=_0x530b10,_0x20f215={'oKwbN':_0x2f4568(0xd7),'isBDD':_0x2f4568(0xb5),'OGedG':function(_0x2e82a8,_0x54a8e7){return _0x2e82a8!==_0x54a8e7;}},_0xa879ab=_0x180647[_0x2f4568(0x116)][_0x2f4568(0xe8)]('content-type')??'';if(_0xa879ab[_0x2f4568(0xbb)](_0x20f215['oKwbN'])){const _0xc1e20d=await _0x180647[_0x2f4568(0xa5)]();for(const _0x37319b of _0xc1e20d['split']('\x0a')){const _0xb3be2b=_0x37319b['trim']();if(_0xb3be2b[_0x2f4568(0xef)](_0x20f215['isBDD'])){const _0x49c404=_0xb3be2b[_0x2f4568(0xb1)]('data:'[_0x2f4568(0x12c)])['trim']();if(!_0x49c404)continue;try{const _0x13e5c9=JSON['parse'](_0x49c404);if(_0x20f215[_0x2f4568(0xff)](_0x13e5c9['id'],undefined)||_0x13e5c9[_0x2f4568(0xe6)])return _0x13e5c9;}catch{}}}throw new Error('No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream');}return _0x180647[_0x2f4568(0xac)]();}function extractToken(_0x557c5c){const _0x5d3e90=_0x530b10,_0x8fbd3c={'bjrGQ':'Unknown\x20error','Yoojg':function(_0xd218ad,_0x34cf78){return _0xd218ad===_0x34cf78;},'Svmkw':_0x5d3e90(0x11f)};if(!_0x557c5c)return null;const _0x6ec253=_0x557c5c[_0x5d3e90(0x129)];if(_0x6ec253?.['token']&&typeof _0x6ec253[_0x5d3e90(0x109)]===_0x5d3e90(0x11f))return _0x6ec253['token'];if(_0x557c5c[_0x5d3e90(0xec)]){const _0x332c75=_0x557c5c['content'];throw new Error('Server\x20returned\x20error:\x20'+(_0x332c75?.[0x0]?.['text']??_0x8fbd3c['bjrGQ']));}const _0xad464f=_0x557c5c[_0x5d3e90(0xba)];if(_0xad464f)for(const _0x4b7646 of _0xad464f){if(_0x8fbd3c[_0x5d3e90(0x10f)](_0x4b7646['type'],'text')&&_0x4b7646[_0x5d3e90(0xa5)]){try{const _0x4e062c=JSON['parse'](_0x4b7646[_0x5d3e90(0xa5)]);if(typeof _0x4e062c?.['token']===_0x8fbd3c['Svmkw'])return _0x4e062c['token'];}catch{}const _0xd0d45d=_0x4b7646[_0x5d3e90(0xa5)][_0x5d3e90(0xad)](/(rngr_[A-Za-z0-9_-]+)/);if(_0xd0d45d)return _0xd0d45d[0x1];}}return null;}
1
+ const _0x56443f=_0x58a7;(function(_0x35a11c,_0x139b19){const _0xd99f04=_0x58a7,_0x31539f=_0x35a11c();while(!![]){try{const _0x1f25df=-parseInt(_0xd99f04(0x109))/0x1+-parseInt(_0xd99f04(0x124))/0x2*(parseInt(_0xd99f04(0xfc))/0x3)+-parseInt(_0xd99f04(0x155))/0x4*(-parseInt(_0xd99f04(0x10f))/0x5)+parseInt(_0xd99f04(0x120))/0x6*(-parseInt(_0xd99f04(0x122))/0x7)+-parseInt(_0xd99f04(0x14e))/0x8*(parseInt(_0xd99f04(0x15f))/0x9)+-parseInt(_0xd99f04(0x150))/0xa+-parseInt(_0xd99f04(0x12e))/0xb*(-parseInt(_0xd99f04(0x11b))/0xc);if(_0x1f25df===_0x139b19)break;else _0x31539f['push'](_0x31539f['shift']());}catch(_0x424d81){_0x31539f['push'](_0x31539f['shift']());}}}(_0x42d0,0x942e5));function _0x58a7(_0x438335,_0x5cb988){_0x438335=_0x438335-0xdf;const _0x42d0e0=_0x42d0();let _0x58a7ab=_0x42d0e0[_0x438335];return _0x58a7ab;}import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';function _0x42d0(){const _0x53247a=['\x0aOpening\x20browser\x20for\x20authentication...','close','dqWeF','ZnRzZ','Registering\x20OAuth\x20client...','bkKMP','split','XZKjk','then','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','client_id','POST','expires_in','hKCug','6skHDSu','suhcu','/callback','MxcxW','text','error','log','RToDe','ranger-cli','OQbRG','OAuth\x20error:\x20','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','Server\x20returned\x20error:\x20','707486bmElIV','\x0aToken\x20written\x20to\x20','UAory','KENcm','iZmLO','none','5931445EXADEh','2.0','proxied','ZNVKE','MCP\x20server\x20returned\x20HTTP\x20','IKhVv','toString','redirect_uri','start','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','sha256','rHITh','26844HmKdel','data:','mmlMW','HMAfR','oMcgW','356622ymIMjF','rJsRl','105sReBbx','expiresAt','756282zzVLcr','Iwovl','tHKWa','nxNkT','AqduF','authorization_endpoint','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','write','platform','result','17567JcNTXt','trim','string','stringify','LhZaP','2025-03-26','GPFMt','json','FVQxt','get_cli_token','url','pXAHy','iOYHC','now','rIeIu','open','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','Client\x20registration\x20failed:\x20','Plyju','set','xWuln','get','NpPLy','WrfAl','response_type','kmXlK','ANcXW','registration_endpoint','text/html','pathname','.ranger','kVcEf','48LUhvuH','authorization_code','8840560qxawEt','tools/call','QMaQK','parse','clientSecret','4CHgVFG','base64url','token','oYNCf','resource','Requesting\x20CLI\x20token...','jOABn','VhNrh','Exchanging\x20authorization\x20code...','stdout','1368675SgqArO','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','vCqKr','state','\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','initialize','token_endpoint','\x0aUnexpected\x20response\x20structure:','clientId','OSzxI','searchParams','status','Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','\x20done','origin','end','1.0.0','writeHead','TEbuY','code'];_0x42d0=function(){return _0x53247a;};return _0x42d0();}import{randomBytes,createHash}from'crypto';import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger','mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),_0x56443f(0x14c),'auth-origin.txt');export async function getMcpAuthOrigin(){const _0x5a4cc5=_0x56443f,_0x1a9871={'xWuln':function(_0x4cea24,_0x155064,_0x14306d){return _0x4cea24(_0x155064,_0x14306d);},'utYaC':'utf-8','GshLn':function(_0x47ebcf,_0x40000d){return _0x47ebcf||_0x40000d;}};try{const _0x65f724=(await _0x1a9871[_0x5a4cc5(0x142)](readFile,AUTH_ORIGIN_PATH,_0x1a9871['utYaC']))['trim']();return _0x1a9871['GshLn'](_0x65f724,null);}catch{return null;}}export async function mcpBootstrap(){const _0x9f00=_0x56443f,_0x1d2b25={'qDSLP':function(_0x5593e4){return _0x5593e4();},'hKEOH':function(_0x3883c0,_0x2efbb8){return _0x3883c0(_0x2efbb8);},'rHITh':function(_0x40cf02,_0x3acfe2){return _0x40cf02===_0x3acfe2;},'iZmLO':_0x9f00(0x111),'VSAeB':function(_0x3bee61,_0x3d20c0){return _0x3bee61+_0x3d20c0;},'AqduF':function(_0x330d68,_0x5d4054,_0x3e8882){return _0x330d68(_0x5d4054,_0x3e8882);}},_0x5a0a9e=_0x1d2b25['qDSLP'](getMcpAuthUrl);currentOrigin=_0x5a0a9e;const _0x582e5d=process[_0x9f00(0x15e)]['isTTY']??![];console[_0x9f00(0x102)]('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x5a0a9e+'\x0a');const _0x19041f=await _0x1d2b25['hKEOH'](tryUnauthenticated,_0x5a0a9e);let _0x164059=null;if(_0x1d2b25[_0x9f00(0x11a)](_0x19041f,_0x1d2b25[_0x9f00(0x10d)]))_0x164059='';else{_0x164059=await loadCachedToken();if(!_0x164059){if(!_0x582e5d)throw new Error(_0x1d2b25['VSAeB'](_0x9f00(0x107),'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.'));_0x164059=await oauthFlow(_0x5a0a9e);}}await _0x1d2b25[_0x9f00(0x128)](callGetCliToken,_0x5a0a9e,_0x164059);}async function tryUnauthenticated(_0x688d48){const _0x46cf74=_0x56443f,_0x4e8e79={'Iwovl':'2025-03-26','dqWeF':_0x46cf74(0x111),'CUPWq':function(_0x451dca,_0x571278){return _0x451dca===_0x571278;},'Plyju':'needs-oauth'},_0x39d3f0=await fetch(_0x688d48,{'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream'},'body':JSON[_0x46cf74(0x131)]({'jsonrpc':'2.0','id':0x1,'method':_0x46cf74(0xdf),'params':{'protocolVersion':_0x4e8e79[_0x46cf74(0x125)],'capabilities':{},'clientInfo':{'name':_0x46cf74(0x104),'version':_0x46cf74(0xea)}}})});if(_0x39d3f0['ok'])return await _0x39d3f0[_0x46cf74(0x100)](),_0x4e8e79[_0x46cf74(0xf0)];if(_0x4e8e79['CUPWq'](_0x39d3f0[_0x46cf74(0xe5)],0x191))return await _0x39d3f0[_0x46cf74(0x100)](),_0x4e8e79[_0x46cf74(0x140)];const _0x378666=await _0x39d3f0['text']();throw new Error(_0x46cf74(0x113)+_0x39d3f0[_0x46cf74(0xe5)]+':\x20'+_0x378666);}class OAuthTimeoutError extends Error{constructor(_0x5cb63d){super(_0x5cb63d),this['name']='OAuthTimeoutError';}}async function oauthFlow(_0xc2bdaa){const _0x369702=_0x56443f,_0x3d3d72={'suhcu':function(_0x2f78aa,_0x1938a0){return _0x2f78aa(_0x1938a0);},'nxNkT':function(_0x1b8fab){return _0x1b8fab();}};try{return await _0x3d3d72[_0x369702(0xfd)](oauthFlowAttempt,_0xc2bdaa);}catch(_0xd28c43){if(_0xd28c43 instanceof OAuthTimeoutError&&await _0x3d3d72[_0x369702(0x127)](loadCachedClient))return console[_0x369702(0x102)](_0x369702(0x163)),await clearCachedClient(),await _0x3d3d72[_0x369702(0xfd)](oauthFlowAttempt,_0xc2bdaa);throw _0xd28c43;}}async function oauthFlowAttempt(_0x4dbeec){const _0x348e27=_0x56443f,_0x572d27={'hVvRp':_0x348e27(0x160),'UAory':function(_0x2710ad){return _0x2710ad();},'OxtwG':_0x348e27(0xf2),'QMaQK':'application/json','kmXlK':_0x348e27(0x14f),'xmpqi':'refresh_token','mmlMW':_0x348e27(0x10e),'AhWIf':function(_0x178972,_0x42bb06,_0x19f068){return _0x178972(_0x42bb06,_0x19f068);},'myojR':'Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','pXAHy':_0x348e27(0x156),'wpySH':_0x348e27(0x119),'CwdrB':'hex','HPKSx':_0x348e27(0x146),'XZKjk':_0x348e27(0xf8),'oYIgY':'code_challenge_method','oYNCf':'state','OwVcV':function(_0x357f10,_0xf06230){return _0x357f10(_0xf06230);},'bkKMP':'client_secret','hKCug':'resource','BsdOI':'\x20done','iYKUU':function(_0x308560,_0x26af57,_0x3b6bb8,_0x998d9){return _0x308560(_0x26af57,_0x3b6bb8,_0x998d9);}},_0x88a281=_0x4dbeec['replace'](/\/mcp$/,'');process[_0x348e27(0x15e)]['write']('Discovering\x20authorization\x20server...');const _0x386a54=await fetch(_0x88a281+'/.well-known/oauth-protected-resource');if(!_0x386a54['ok'])throw new Error(_0x348e27(0xe6));const _0x3d2536=await _0x386a54['json'](),_0x706020=_0x3d2536['authorization_servers']?.[0x0];if(!_0x706020)throw new Error(_0x572d27['hVvRp']);console['log']('\x20'+_0x706020);const _0x412da2=await fetchAuthServerMetadata(_0x706020);let _0x135a52,_0x302e2;const _0x56eb02=await _0x572d27[_0x348e27(0x10b)](loadCachedClient);if(_0x56eb02)_0x135a52=_0x56eb02[_0x348e27(0xe2)],_0x302e2=_0x56eb02['clientSecret'];else{if(_0x412da2[_0x348e27(0x149)]){process[_0x348e27(0x15e)][_0x348e27(0x12b)](_0x572d27['OxtwG']);const _0x1bc797=await fetch(_0x412da2['registration_endpoint'],{'method':_0x348e27(0xf9),'headers':{'Content-Type':_0x572d27[_0x348e27(0x152)]},'body':JSON[_0x348e27(0x131)]({'client_name':'Ranger\x20CLI','redirect_uris':['http://localhost:'+CALLBACK_PORT+'/callback'],'grant_types':[_0x572d27[_0x348e27(0x147)],_0x572d27['xmpqi']],'response_types':['code'],'token_endpoint_auth_method':_0x572d27[_0x348e27(0x11d)]})});if(!_0x1bc797['ok']){const _0x59274f=await _0x1bc797['text']();throw new Error(_0x348e27(0x13f)+_0x59274f);}const _0x5ab93b=await _0x1bc797[_0x348e27(0x135)]();_0x135a52=_0x5ab93b[_0x348e27(0xf8)],_0x302e2=_0x5ab93b['client_secret'],await _0x572d27['AhWIf'](saveCachedClient,_0x135a52,_0x302e2),console['log']('\x20done');}else throw new Error(_0x572d27['myojR']);}const _0x36b967=randomBytes(0x20)[_0x348e27(0x115)](_0x572d27[_0x348e27(0x139)]),_0x46dfa7=createHash(_0x572d27['wpySH'])['update'](_0x36b967)['digest']('base64url'),_0x33774b=randomBytes(0x10)[_0x348e27(0x115)](_0x572d27['CwdrB']),_0x1bf05f=new URL(_0x412da2[_0x348e27(0x129)]);_0x1bf05f[_0x348e27(0xe4)][_0x348e27(0x141)](_0x572d27['HPKSx'],_0x348e27(0xed)),_0x1bf05f['searchParams']['set'](_0x572d27[_0x348e27(0xf5)],_0x135a52),_0x1bf05f['searchParams']['set'](_0x348e27(0x116),'http://localhost:'+CALLBACK_PORT+_0x348e27(0xfe)),_0x1bf05f['searchParams']['set']('code_challenge',_0x46dfa7),_0x1bf05f[_0x348e27(0xe4)]['set'](_0x572d27['oYIgY'],'S256'),_0x1bf05f['searchParams']['set'](_0x572d27[_0x348e27(0x158)],_0x33774b);_0x3d2536[_0x348e27(0x159)]&&_0x1bf05f['searchParams']['set'](_0x348e27(0x159),_0x3d2536['resource']);console[_0x348e27(0x102)](_0x348e27(0xee)),console[_0x348e27(0x102)]('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x1bf05f['toString']()+'\x0a'),await openBrowser(_0x1bf05f['toString']());const _0x476aab=await _0x572d27['OwVcV'](waitForCallback,_0x33774b);process['stdout'][_0x348e27(0x12b)](_0x348e27(0x15d));const _0x4bd039=new URLSearchParams({'grant_type':_0x572d27['kmXlK'],'code':_0x476aab,'redirect_uri':'http://localhost:'+CALLBACK_PORT+'/callback','client_id':_0x135a52,'code_verifier':_0x36b967});_0x302e2&&_0x4bd039['set'](_0x572d27[_0x348e27(0xf3)],_0x302e2);_0x3d2536[_0x348e27(0x159)]&&_0x4bd039['set'](_0x572d27[_0x348e27(0xfb)],_0x3d2536['resource']);const _0xe8be05=await fetch(_0x412da2[_0x348e27(0xe0)],{'method':_0x348e27(0xf9),'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x4bd039});if(!_0xe8be05['ok']){const _0xb5ae73=await _0xe8be05['text']();throw new Error('Token\x20exchange\x20failed:\x20'+_0xb5ae73);}const _0x3d9ab5=await _0xe8be05[_0x348e27(0x135)]();return console['log'](_0x572d27['BsdOI']),await _0x572d27['iYKUU'](saveCachedToken,_0x3d9ab5['access_token'],_0x3d9ab5['refresh_token'],_0x3d9ab5[_0x348e27(0xfa)]),_0x3d9ab5['access_token'];}async function callGetCliToken(_0x4ada59,_0x3a42cc){const _0x10cd2b=_0x56443f,_0x54b127={'HMAfR':function(_0x3eb122,_0x3c762f,_0x440696){return _0x3eb122(_0x3c762f,_0x440696);},'kVcEf':'application/json','oMcgW':'Initializing\x20MCP\x20session...','OSzxI':function(_0x254e6e,_0x52cbc8){return _0x254e6e(_0x52cbc8);},'HjECw':_0x10cd2b(0x133),'pmltT':function(_0x4548ba,_0x55a6ee,_0x4fd9ee){return _0x4548ba(_0x55a6ee,_0x4fd9ee);},'MxcxW':'2.0','NpPLy':_0x10cd2b(0x15a),'vCqKr':function(_0x243e8c,_0x5ae838,_0x325ead){return _0x243e8c(_0x5ae838,_0x325ead);},'WrfAl':function(_0x4c0ced){return _0x4c0ced();},'FSrZI':'.ranger','SwGrw':function(_0x91904a,_0x338115,_0x518ea4){return _0x91904a(_0x338115,_0x518ea4);},'tHKWa':function(_0x5614d2,_0x22bc13,_0x329c66,_0x16137f){return _0x5614d2(_0x22bc13,_0x329c66,_0x16137f);},'OQbRG':function(_0x34617e,_0x246b58,_0x3fdc0c){return _0x34617e(_0x246b58,_0x3fdc0c);}},_0x43a471={'Content-Type':_0x54b127[_0x10cd2b(0x14d)],'Accept':'application/json,\x20text/event-stream'};_0x3a42cc&&(_0x43a471['Authorization']='Bearer\x20'+_0x3a42cc);const _0x19bdab=async _0x4ed5e9=>{const _0x50dda3=_0x10cd2b,_0x2fd29e=await _0x54b127[_0x50dda3(0x11e)](fetch,_0x4ada59,{'method':_0x50dda3(0xf9),'headers':_0x43a471,'body':JSON[_0x50dda3(0x131)](_0x4ed5e9)});if(!_0x2fd29e['ok']){const _0x40ac21=await _0x2fd29e[_0x50dda3(0x100)]();throw new Error('HTTP\x20'+_0x2fd29e[_0x50dda3(0xe5)]+':\x20'+_0x40ac21);}return parseResponse(_0x2fd29e);};process['stdout']['write'](_0x54b127[_0x10cd2b(0x11f)]);const _0x290654=await _0x54b127[_0x10cd2b(0xe3)](_0x19bdab,{'jsonrpc':'2.0','id':0x1,'method':'initialize','params':{'protocolVersion':_0x54b127['HjECw'],'capabilities':{},'clientInfo':{'name':_0x10cd2b(0x104),'version':_0x10cd2b(0xea)}}});if(_0x290654['error'])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x290654['error']['message']??JSON[_0x10cd2b(0x131)](_0x290654['error'])));console['log'](_0x10cd2b(0xe7)),await _0x54b127['pmltT'](fetch,_0x4ada59,{'method':_0x10cd2b(0xf9),'headers':_0x43a471,'body':JSON['stringify']({'jsonrpc':_0x54b127[_0x10cd2b(0xff)],'method':'notifications/initialized'})})[_0x10cd2b(0xf6)](_0x12ad51=>_0x12ad51['text']()),process[_0x10cd2b(0x15e)]['write'](_0x54b127[_0x10cd2b(0x144)]);const _0x56e438=await _0x54b127['OSzxI'](_0x19bdab,{'jsonrpc':_0x10cd2b(0x110),'id':0x2,'method':_0x10cd2b(0x151),'params':{'name':_0x10cd2b(0x137),'arguments':{}}});if(_0x56e438[_0x10cd2b(0x101)])throw new Error('get_cli_token\x20failed:\x20'+(_0x56e438[_0x10cd2b(0x101)]['message']??JSON['stringify'](_0x56e438['error'])));console[_0x10cd2b(0x102)](_0x10cd2b(0xe7));const _0x127d40=_0x54b127['OSzxI'](extractToken,_0x56e438[_0x10cd2b(0x12d)]);if(!_0x127d40){console['error'](_0x10cd2b(0xe1)),console['error'](JSON[_0x10cd2b(0x131)](_0x56e438[_0x10cd2b(0x12d)],null,0x2));throw new Error(_0x10cd2b(0x13e));}const _0x22f327=_0x54b127[_0x10cd2b(0x161)](join,_0x54b127[_0x10cd2b(0x145)](homedir),_0x54b127['FSrZI']),_0x54020c=_0x54b127[_0x10cd2b(0x161)](join,_0x22f327,'refresh.txt');await _0x54b127['SwGrw'](mkdir,_0x22f327,{'recursive':!![]}),await _0x54b127[_0x10cd2b(0x126)](writeFile,_0x54020c,_0x127d40,{'mode':0x180}),await writeFile(_0x54b127[_0x10cd2b(0x105)](join,_0x22f327,'auth-origin.txt'),_0x4ada59,{'mode':0x180}),console[_0x10cd2b(0x102)](_0x10cd2b(0x10a)+_0x54020c),console['log'](_0x10cd2b(0x118));}async function fetchAuthServerMetadata(_0x2a426a){const _0x5081f1={'xneUt':function(_0x1cd8f7,_0x16ad6d){return _0x1cd8f7(_0x16ad6d);}},_0x2f1915=_0x2a426a+'/.well-known/oauth-authorization-server',_0x25b6d4=await _0x5081f1['xneUt'](fetch,_0x2f1915);if(!_0x25b6d4['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x2f1915+':\x20'+_0x25b6d4['status']);return _0x25b6d4['json']();}function waitForCallback(_0x348eb9){const _0x3695bb=_0x56443f,_0x57270a={'VhNrh':function(_0x13545b){return _0x13545b();},'LhZaP':function(_0x404e38,_0x572cde){return _0x404e38(_0x572cde);},'ICudw':function(_0x25bbbe,_0x4f661d){return _0x25bbbe!==_0x4f661d;},'sJxrD':'Not\x20found','RToDe':'code','KENcm':_0x3695bb(0x162),'jOABn':'error_description','GRVEq':_0x3695bb(0x14a),'TEbuY':function(_0x515d2f){return _0x515d2f();},'GSrmS':'<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','BoGyI':function(_0x57f97b){return _0x57f97b();},'VkIJZ':function(_0x21bfb6,_0x39df76){return _0x21bfb6(_0x39df76);}};return new Promise((_0x4f08d7,_0x45d34f)=>{const _0x48f7e3=()=>{const _0x3060fd=_0x58a7;_0xf2751f['closeAllConnections'](),_0xf2751f[_0x3060fd(0xef)]();},_0x2686fd=setTimeout(()=>{const _0x280167=_0x58a7;_0x57270a[_0x280167(0x15c)](_0x48f7e3),_0x57270a[_0x280167(0x132)](_0x45d34f,new OAuthTimeoutError('OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes'));},0x1d4c0),_0xf2751f=_0x57270a['LhZaP'](createServer,(_0x25cdd8,_0x4aaeb7)=>{const _0x13383c=_0x58a7,_0x5544e6=new URL(_0x25cdd8[_0x13383c(0x138)]??'/','http://localhost:'+CALLBACK_PORT);if(_0x57270a['ICudw'](_0x5544e6[_0x13383c(0x14b)],_0x13383c(0xfe))){_0x4aaeb7[_0x13383c(0xeb)](0x194),_0x4aaeb7[_0x13383c(0xe9)](_0x57270a['sJxrD']);return;}const _0x101fb9=_0x5544e6[_0x13383c(0xe4)]['get'](_0x57270a[_0x13383c(0x103)]),_0x28cd83=_0x5544e6[_0x13383c(0xe4)]['get'](_0x57270a[_0x13383c(0x10c)]),_0xc28cc0=_0x5544e6[_0x13383c(0xe4)][_0x13383c(0x143)]('error');if(_0xc28cc0){const _0x3044bc=_0x5544e6[_0x13383c(0xe4)][_0x13383c(0x143)](_0x57270a[_0x13383c(0x15b)])??_0xc28cc0;_0x4aaeb7[_0x13383c(0xeb)](0xc8,{'Content-Type':_0x57270a['GRVEq']}),_0x4aaeb7['end']('<html><body><h2>Authentication\x20failed</h2><p>'+_0x3044bc+_0x13383c(0x12a)),clearTimeout(_0x2686fd),_0x57270a[_0x13383c(0xec)](_0x48f7e3),_0x45d34f(new Error(_0x13383c(0x106)+_0x3044bc));return;}if(!_0x101fb9||_0x28cd83!==_0x348eb9){_0x4aaeb7['writeHead'](0x190,{'Content-Type':'text/html'}),_0x4aaeb7['end']('<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>');return;}_0x4aaeb7['writeHead'](0xc8,{'Content-Type':_0x57270a['GRVEq']}),_0x4aaeb7['end'](_0x57270a['GSrmS']),clearTimeout(_0x2686fd),_0x57270a['BoGyI'](_0x48f7e3),_0x57270a['VkIJZ'](_0x4f08d7,_0x101fb9);});_0xf2751f['listen'](CALLBACK_PORT,'127.0.0.1');});}async function openBrowser(_0x10b5a4){const _0x38eee1=_0x56443f,_0x591951={'ANcXW':function(_0x6df7af,_0x2c0b9b){return _0x6df7af===_0x2c0b9b;},'gzruO':'darwin','aJiBh':_0x38eee1(0x13d),'iOYHC':'win32','rIeIu':'xdg-open'},_0x460b64=_0x591951[_0x38eee1(0x148)](process[_0x38eee1(0x12c)],_0x591951['gzruO'])?_0x591951['aJiBh']:_0x591951[_0x38eee1(0x148)](process[_0x38eee1(0x12c)],_0x591951[_0x38eee1(0x13a)])?_0x38eee1(0x117):_0x591951[_0x38eee1(0x13c)];exec(_0x460b64+'\x20\x22'+_0x10b5a4+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x1ad07b=_0x56443f,_0x2d2dd2={'NPCfd':function(_0x592d9f,_0x4a4270,_0x39b52c){return _0x592d9f(_0x4a4270,_0x39b52c);},'GPFMt':function(_0x4410f8,_0x2a3e2a){return _0x4410f8>_0x2a3e2a;}};try{const _0x294d01=JSON[_0x1ad07b(0x153)](await _0x2d2dd2['NPCfd'](readFile,TOKEN_CACHE_PATH,'utf-8'));if(_0x294d01['origin']&&_0x294d01['origin']!==currentOrigin)return null;if(_0x294d01['expiresAt']&&_0x2d2dd2[_0x1ad07b(0x134)](Date[_0x1ad07b(0x13b)](),_0x294d01[_0x1ad07b(0x123)]))return null;return _0x294d01['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0x322927,_0x24ac24,_0x579913){const _0x5ce415=_0x56443f,_0x4dd4af={'SokFo':function(_0x396fd5,_0x3bf4c5){return _0x396fd5+_0x3bf4c5;},'qBwHP':'.ranger'},_0x2d5964=await loadCachedData(),_0x5ade7d={..._0x2d5964,'origin':currentOrigin,'accessToken':_0x322927,'refreshToken':_0x24ac24??_0x2d5964?.['refreshToken'],'expiresAt':_0x579913?_0x4dd4af['SokFo'](Date[_0x5ce415(0x13b)](),_0x579913*0x3e8):undefined};await mkdir(join(homedir(),_0x4dd4af['qBwHP']),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x5ce415(0x131)](_0x5ade7d),{'mode':0x180});}async function loadCachedClient(){const _0x3d77e6=_0x56443f,_0x1b5bac={'ZnRzZ':function(_0x3a673d){return _0x3a673d();}},_0x32f327=await _0x1b5bac[_0x3d77e6(0xf1)](loadCachedData);if(_0x32f327?.[_0x3d77e6(0xe8)]&&_0x32f327['origin']!==currentOrigin)return null;return _0x32f327?.['clientId']?{'clientId':_0x32f327[_0x3d77e6(0xe2)],'clientSecret':_0x32f327[_0x3d77e6(0x154)]}:null;}async function clearCachedClient(){const _0x423cb2=await loadCachedData();if(!_0x423cb2)return;const {clientId:_0x1d6f47,clientSecret:_0x50bd16,..._0x431713}=_0x423cb2;await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x431713),{'mode':0x180});}async function saveCachedClient(_0x10cd16,_0x10fe3b){const _0x5e1a19=_0x56443f,_0x3303b2={'ZNVKE':function(_0x17a3bd,_0x2c275f,_0x375b01){return _0x17a3bd(_0x2c275f,_0x375b01);},'IKhVv':function(_0xde4c0a){return _0xde4c0a();},'FFJnv':'.ranger'},_0x3e4462=await loadCachedData(),_0x5f24f2={..._0x3e4462,'origin':currentOrigin,'accessToken':_0x3e4462?.['accessToken']??'','clientId':_0x10cd16,'clientSecret':_0x10fe3b};await mkdir(_0x3303b2[_0x5e1a19(0x112)](join,_0x3303b2[_0x5e1a19(0x114)](homedir),_0x3303b2['FFJnv']),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x5f24f2),{'mode':0x180});}async function loadCachedData(){const _0x4f3d61={'WsWJJ':'utf-8'};try{return JSON['parse'](await readFile(TOKEN_CACHE_PATH,_0x4f3d61['WsWJJ']));}catch{return null;}}async function parseResponse(_0x3a2753){const _0x4eda7d=_0x56443f,_0x20b612={'nDZGD':'text/event-stream','FVQxt':_0x4eda7d(0x11c)},_0x49a099=_0x3a2753['headers'][_0x4eda7d(0x143)]('content-type')??'';if(_0x49a099['includes'](_0x20b612['nDZGD'])){const _0x55a102=await _0x3a2753['text']();for(const _0x35f29b of _0x55a102[_0x4eda7d(0xf4)]('\x0a')){const _0x11181d=_0x35f29b['trim']();if(_0x11181d['startsWith'](_0x20b612['FVQxt'])){const _0x107c5e=_0x11181d['slice'](_0x20b612[_0x4eda7d(0x136)]['length'])[_0x4eda7d(0x12f)]();if(!_0x107c5e)continue;try{const _0x44c97a=JSON[_0x4eda7d(0x153)](_0x107c5e);if(_0x44c97a['id']!==undefined||_0x44c97a['error'])return _0x44c97a;}catch{}}}throw new Error(_0x4eda7d(0xf7));}return _0x3a2753[_0x4eda7d(0x135)]();}function extractToken(_0x3c4827){const _0x309dc5=_0x56443f,_0xf953bf={'LLcEX':_0x309dc5(0x130),'rJsRl':function(_0x32addc,_0xbdc978){return _0x32addc===_0xbdc978;}};if(!_0x3c4827)return null;const _0x1466ed=_0x3c4827['structuredContent'];if(_0x1466ed?.['token']&&typeof _0x1466ed[_0x309dc5(0x157)]===_0xf953bf['LLcEX'])return _0x1466ed['token'];if(_0x3c4827['isError']){const _0x55ee77=_0x3c4827['content'];throw new Error(_0x309dc5(0x108)+(_0x55ee77?.[0x0]?.[_0x309dc5(0x100)]??'Unknown\x20error'));}const _0x286b64=_0x3c4827['content'];if(_0x286b64)for(const _0x569ee2 of _0x286b64){if(_0xf953bf[_0x309dc5(0x121)](_0x569ee2['type'],_0x309dc5(0x100))&&_0x569ee2[_0x309dc5(0x100)]){try{const _0x168431=JSON[_0x309dc5(0x153)](_0x569ee2[_0x309dc5(0x100)]);if(typeof _0x168431?.[_0x309dc5(0x157)]==='string')return _0x168431['token'];}catch{}const _0xf7254=_0x569ee2[_0x309dc5(0x100)]['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0xf7254)return _0xf7254[0x1];}}return null;}
@@ -1 +1 @@
1
- function _0x3913(_0x36d0fe,_0x19d9f1){_0x36d0fe=_0x36d0fe-0x90;var _0x1fa9b5=_0x1fa9();var _0x39133c=_0x1fa9b5[_0x36d0fe];return _0x39133c;}(function(_0x21a80a,_0x2fa89e){var _0x4b36c9=_0x3913,_0x3751fc=_0x21a80a();while(!![]){try{var _0x551699=-parseInt(_0x4b36c9(0x9f))/0x1+parseInt(_0x4b36c9(0x96))/0x2+parseInt(_0x4b36c9(0x95))/0x3*(-parseInt(_0x4b36c9(0x99))/0x4)+parseInt(_0x4b36c9(0x9a))/0x5+parseInt(_0x4b36c9(0x94))/0x6+parseInt(_0x4b36c9(0x9e))/0x7*(parseInt(_0x4b36c9(0x9b))/0x8)+-parseInt(_0x4b36c9(0x91))/0x9;if(_0x551699===_0x2fa89e)break;else _0x3751fc['push'](_0x3751fc['shift']());}catch(_0x29f064){_0x3751fc['push'](_0x3751fc['shift']());}}}(_0x1fa9,0xbb965));function _0x1fa9(){var _0x1eec33=['\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a','error','673169vXCSaJ','455815iBdEcS','fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.','21088287TbALeM','ifnQx','eZnws','8379978rfPaHx','51CwVEAH','2930208SUGraC','exit','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','222532XFAJXL','3929030DdVqfL','72ifTPhI'];_0x1fa9=function(){return _0x1eec33;};return _0x1fa9();}export async function migrateProfile(_0x5b68ec,_0x347344){var _0x47a160=_0x3913,_0x50068b={'vaZsB':function(_0xce8f6b,_0x4fa634){return _0xce8f6b+_0x4fa634;},'yGkro':function(_0x5791a3,_0x1843cf){return _0x5791a3+_0x1843cf;},'ifnQx':function(_0x3cd550,_0x7396ac){return _0x3cd550+_0x7396ac;},'zjuWP':function(_0x18dbbb,_0x50d46e){return _0x18dbbb+_0x50d46e;},'eZnws':'ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','ZCcUA':'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a'};console[_0x47a160(0x9d)](_0x50068b['vaZsB'](_0x50068b['yGkro'](_0x50068b['ifnQx'](_0x50068b['zjuWP'](_0x50068b[_0x47a160(0x92)](_0x50068b[_0x47a160(0x93)],'\x0a')+_0x50068b['ZCcUA'],_0x47a160(0x98))+'\x0a','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a')+_0x47a160(0x9c),'\x0a')+'Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a',_0x47a160(0x90))),process[_0x47a160(0x97)](0x1);}
1
+ function _0x5cc1(_0x21975e,_0x5652c3){_0x21975e=_0x21975e-0x114;var _0x193c5f=_0x193c();var _0x5cc1a7=_0x193c5f[_0x21975e];return _0x5cc1a7;}(function(_0x5941da,_0x5c45e4){var _0x37b01c=_0x5cc1,_0x3b29df=_0x5941da();while(!![]){try{var _0x5ed81f=-parseInt(_0x37b01c(0x11b))/0x1*(parseInt(_0x37b01c(0x11e))/0x2)+parseInt(_0x37b01c(0x11d))/0x3*(-parseInt(_0x37b01c(0x11c))/0x4)+parseInt(_0x37b01c(0x129))/0x5+-parseInt(_0x37b01c(0x127))/0x6*(-parseInt(_0x37b01c(0x118))/0x7)+-parseInt(_0x37b01c(0x126))/0x8*(parseInt(_0x37b01c(0x128))/0x9)+-parseInt(_0x37b01c(0x122))/0xa*(-parseInt(_0x37b01c(0x116))/0xb)+-parseInt(_0x37b01c(0x11f))/0xc*(-parseInt(_0x37b01c(0x125))/0xd);if(_0x5ed81f===_0x5c45e4)break;else _0x3b29df['push'](_0x3b29df['shift']());}catch(_0x2c75d1){_0x3b29df['push'](_0x3b29df['shift']());}}}(_0x193c,0x5f79a));export async function migrateProfile(_0x553880,_0x59f194){var _0x5058a7=_0x5cc1,_0x1e3e60={'buqui':function(_0xc89a1f,_0x1cc555){return _0xc89a1f+_0x1cc555;},'DaAMN':function(_0x2361b3,_0x39f233){return _0x2361b3+_0x39f233;},'QDHCR':_0x5058a7(0x117),'eDvLC':'\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a','ZsVDC':'Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a','qshuV':_0x5058a7(0x123)};console[_0x5058a7(0x119)](_0x1e3e60['buqui'](_0x1e3e60[_0x5058a7(0x11a)](_0x1e3e60[_0x5058a7(0x121)](_0x1e3e60['QDHCR']+'\x0a',_0x5058a7(0x115)),'\x20\x20ranger\x20profile\x20add\x20<name>\x0a')+'\x0a'+_0x5058a7(0x120)+_0x1e3e60['eDvLC'],'\x0a')+_0x1e3e60[_0x5058a7(0x124)]+_0x1e3e60['qshuV']),process[_0x5058a7(0x114)](0x1);}function _0x193c(){var _0x39d9f5=['4224961GrClFo','16zTZCMC','6RHrvrs','263925uHUKWt','1993575IkvczV','exit','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','51931dRwTid','ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','1524481klvrNc','error','buqui','97CPqUZC','4cDfvil','1643646vrYgjC','12066UtrmpK','24ufrXKj','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','DaAMN','670iDmIUR','fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.','ZsVDC'];_0x193c=function(){return _0x39d9f5;};return _0x193c();}
@@ -1 +1 @@
1
- (function(_0x43d541,_0x39be3f){const _0x9ed88f=_0x2b22,_0xfb3a0a=_0x43d541();while(!![]){try{const _0x55d5d7=parseInt(_0x9ed88f(0xd6))/0x1+parseInt(_0x9ed88f(0xbc))/0x2+-parseInt(_0x9ed88f(0xe5))/0x3*(parseInt(_0x9ed88f(0xd9))/0x4)+-parseInt(_0x9ed88f(0xd7))/0x5+-parseInt(_0x9ed88f(0xc3))/0x6+parseInt(_0x9ed88f(0xbe))/0x7*(parseInt(_0x9ed88f(0xed))/0x8)+parseInt(_0x9ed88f(0xda))/0x9*(parseInt(_0x9ed88f(0xf2))/0xa);if(_0x55d5d7===_0x39be3f)break;else _0xfb3a0a['push'](_0xfb3a0a['shift']());}catch(_0x552393){_0xfb3a0a['push'](_0xfb3a0a['shift']());}}}(_0x11ef,0xe6838));function _0x2b22(_0x3f9a90,_0x2bac72){_0x3f9a90=_0x3f9a90-0xbc;const _0x11ef46=_0x11ef();let _0x2b2207=_0x11ef46[_0x3f9a90];return _0x2b2207;}function _0x11ef(){const _0x25a82a=['enable','SKILL.md','pluginScope','FVaoN','output','error','uqPJX','ranger@trailhead','579197VbxQws','2226465XnjzQM','list','8412ptTmEn','940986kfgPjX','QvKwX','wantsSkillup','Project\x20(shared\x20with\x20team\x20via\x20git)','✓\x20Ranger\x20skills\x20already\x20installed','plugin','kaPal','Where\x20should\x20the\x20plugin\x20be\x20installed?','add','ilcdh','IxFHD','2331wdVboq','YsdmS','\x0a📦\x20Claude\x20Code\x20Plugin\x0a','ialoy','❌\x20Failed\x20to\x20add\x20marketplace:','project','\x0aYou\x20can\x20install\x20manually\x20with:','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','12527008BTmlty','bMkiL','VkQgM','✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','success','130EwFgZt','2011100TFQcpY','ranger','7TJFShe','JNXfc','log','Vejlu','LwmyI','8917902ldXhrf','HgWDI','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','Would\x20you\x20like\x20to\x20install\x20skills?','prompt','✓\x20Marketplace\x20already\x20added','YGfNH','--scope','user','qQpsP','OtRsL'];_0x11ef=function(){return _0x25a82a;};return _0x11ef();}import{join}from'path';import{existsSync}from'fs';import _0x128821 from'inquirer';import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x5c66f2){const _0x1398b0=_0x2b22,_0x1e4efb={'kaPal':function(_0x169f8f,_0x33a235){return _0x169f8f(_0x33a235);},'IxFHD':_0x1398b0(0xd5),'ZJETK':_0x1398b0(0xec),'YGfNH':function(_0x5a05cb){return _0x5a05cb();},'LwmyI':_0x1398b0(0xea),'VkQgM':_0x1398b0(0xe7),'iGJsz':_0x1398b0(0xd8),'FVaoN':_0x1398b0(0xd0),'VwzBX':_0x1398b0(0xe1),'Vejlu':'User\x20(available\x20in\x20all\x20your\x20projects)','YsdmS':'trailhead','ilcdh':'marketplace','zMKUo':_0x1398b0(0xe2),'OKOFQ':_0x1398b0(0xeb),'UPbdK':_0x1398b0(0xc5),'HgWDI':'install','qQpsP':_0x1398b0(0xca),'ztGrF':function(_0x28754b,_0x4ff989){return _0x28754b===_0x4ff989;},'ePJtB':_0x1398b0(0xf0),'obfjI':'plugin','MIxJi':_0x1398b0(0xce),'uqPJX':'already\x20enabled','mnJVd':'⚠\x20Failed\x20to\x20enable\x20plugin:'},_0xd92ce1=await _0x1e4efb[_0x1398b0(0xe0)](isPluginInstalled,_0x1e4efb['IxFHD']);if(_0xd92ce1)return console[_0x1398b0(0xc0)](_0x1e4efb['ZJETK']),![];const _0x56212c=existsSync(join(_0x1e4efb[_0x1398b0(0xc9)](getProjectRoot),'.claude'));let _0x295cca;if(_0x5c66f2)_0x295cca=_0x5c66f2;else{if(_0x56212c)_0x295cca=_0x1e4efb[_0x1398b0(0xc2)];else{console[_0x1398b0(0xc0)](_0x1e4efb[_0x1398b0(0xef)]);const _0x3e7c0b=await _0x128821[_0x1398b0(0xc7)]([{'type':_0x1e4efb['iGJsz'],'name':_0x1e4efb[_0x1398b0(0xd1)],'message':_0x1e4efb['VwzBX'],'choices':[{'name':_0x1e4efb[_0x1398b0(0xc1)],'value':_0x1398b0(0xcb)},{'name':_0x1398b0(0xdd),'value':'project'}],'default':'user'}]);_0x295cca=_0x3e7c0b['pluginScope'];}}console[_0x1398b0(0xc0)]('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x295cca+'\x20level)...\x0a');const _0x17a0bb=await _0x1e4efb[_0x1398b0(0xe0)](isMarketplaceAdded,_0x1e4efb[_0x1398b0(0xe6)]);let _0x24d812=_0x17a0bb;if(_0x17a0bb)console['log'](_0x1398b0(0xc8));else{const _0x2d1444=await runClaudeCommand(['plugin',_0x1e4efb[_0x1398b0(0xe3)],_0x1e4efb['zMKUo'],'ranger-testing/trailhead']);!_0x2d1444['success']?(console[_0x1398b0(0xd3)](_0x1398b0(0xe9),_0x2d1444[_0x1398b0(0xd3)]),console[_0x1398b0(0xc0)](_0x1e4efb['OKOFQ']),console[_0x1398b0(0xc0)](_0x1e4efb['UPbdK']),console[_0x1398b0(0xc0)]('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x295cca)):_0x24d812=!![];}if(_0x24d812){const _0x23ba9b=await runClaudeCommand([_0x1398b0(0xdf),_0x1e4efb[_0x1398b0(0xc4)],'ranger@trailhead',_0x1e4efb[_0x1398b0(0xcc)],_0x295cca],{'cwd':_0x1e4efb['ztGrF'](_0x295cca,_0x1398b0(0xea))?getProjectRoot():undefined});if(!_0x23ba9b[_0x1398b0(0xf1)])console[_0x1398b0(0xd3)]('❌\x20Failed\x20to\x20install\x20plugin:',_0x23ba9b[_0x1398b0(0xd3)]),console[_0x1398b0(0xc0)]('\x0aYou\x20can\x20install\x20manually\x20with:'),console[_0x1398b0(0xc0)]('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x295cca);else{console['log'](_0x1e4efb['ePJtB']);const _0xe0cde8=[_0x1e4efb['obfjI'],_0x1e4efb['MIxJi'],_0x1e4efb[_0x1398b0(0xe4)]];_0x295cca===_0x1e4efb[_0x1398b0(0xc2)]&&_0xe0cde8['push']('--scope',_0x1e4efb['LwmyI']);const _0x4154ee=await runClaudeCommand(_0xe0cde8,{'captureOutput':!![],'cwd':_0x1e4efb['ztGrF'](_0x295cca,_0x1398b0(0xea))?_0x1e4efb[_0x1398b0(0xc9)](getProjectRoot):undefined}),_0x5ed5a6=_0x4154ee[_0x1398b0(0xd2)]?.['includes'](_0x1e4efb[_0x1398b0(0xd4)]);!_0x4154ee[_0x1398b0(0xf1)]&&!_0x5ed5a6?console['error'](_0x1e4efb['mnJVd'],_0x4154ee[_0x1398b0(0xd3)]):console['log']('✓\x20Claude\x20Code\x20plugin\x20enabled');}}return!![];}export async function ensureClaudeSkills(_0x2fabd2){const _0x45db90=_0x2b22,_0x1f21f7={'ialoy':function(_0x5d2f8b,_0x4bd963){return _0x5d2f8b(_0x4bd963);},'QvKwX':function(_0x272372,_0x300317,_0x497069,_0x48aa6a){return _0x272372(_0x300317,_0x497069,_0x48aa6a);},'JNXfc':'user','bMkiL':_0x45db90(0xbd),'oAnJI':_0x45db90(0xde),'OtRsL':function(_0x539584,_0x4f6fce,_0x969569){return _0x539584(_0x4f6fce,_0x969569);}},_0x11cfc2=_0x1f21f7['ialoy'](existsSync,_0x1f21f7[_0x45db90(0xdb)](join,_0x1f21f7[_0x45db90(0xe8)](getSkillsDir,_0x1f21f7[_0x45db90(0xbf)]),_0x45db90(0xbd),_0x45db90(0xcf))),_0xf887e9=_0x1f21f7['ialoy'](existsSync,_0x1f21f7[_0x45db90(0xdb)](join,_0x1f21f7['ialoy'](getSkillsDir,_0x45db90(0xea)),_0x1f21f7[_0x45db90(0xee)],'SKILL.md'));if(_0x11cfc2||_0xf887e9)return console['log'](_0x1f21f7['oAnJI']),![];const _0xc02183=_0x1f21f7['ialoy'](existsSync,_0x1f21f7[_0x45db90(0xcd)](join,getProjectRoot(),'.claude'));let _0x2fe3e4=!![];if(_0x2fabd2)await _0x1f21f7['ialoy'](skillup,{'autoInstall':_0x2fabd2,'suppressUsage':!![]});else{if(_0xc02183)await _0x1f21f7['ialoy'](skillup,{'autoInstall':_0x45db90(0xea),'suppressUsage':!![]});else{const _0x13d202=await _0x128821[_0x45db90(0xc7)]([{'type':'confirm','name':_0x45db90(0xdc),'message':_0x45db90(0xc6),'default':!![]}]);_0x2fe3e4=_0x13d202[_0x45db90(0xdc)],_0x2fe3e4&&await _0x1f21f7['ialoy'](skillup,{'suppressUsage':!![]});}}return _0x2fe3e4;}
1
+ (function(_0x2f9d9f,_0xad9195){const _0x3135c6=_0xdf76,_0x34e354=_0x2f9d9f();while(!![]){try{const _0xc54d7b=-parseInt(_0x3135c6(0xe0))/0x1+-parseInt(_0x3135c6(0xba))/0x2+-parseInt(_0x3135c6(0xdc))/0x3*(parseInt(_0x3135c6(0xe1))/0x4)+-parseInt(_0x3135c6(0xd7))/0x5+parseInt(_0x3135c6(0xb1))/0x6*(-parseInt(_0x3135c6(0xbe))/0x7)+-parseInt(_0x3135c6(0xcc))/0x8+-parseInt(_0x3135c6(0xd6))/0x9*(-parseInt(_0x3135c6(0xae))/0xa);if(_0xc54d7b===_0xad9195)break;else _0x34e354['push'](_0x34e354['shift']());}catch(_0x18c5e2){_0x34e354['push'](_0x34e354['shift']());}}}(_0x4a3b,0xcd918));import{join}from'path';import{existsSync}from'fs';import _0x5ed34c from'inquirer';import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x3bfcf9){const _0x331cd8=_0xdf76,_0x2cca24={'gIGhj':function(_0x5240eb,_0x5789e9,_0xfbf211){return _0x5240eb(_0x5789e9,_0xfbf211);},'LFXJz':function(_0x2f819a){return _0x2f819a();},'AXAgw':_0x331cd8(0xb3),'TFtms':'project','GuvAj':'list','xraPh':'pluginScope','nAhOw':'Where\x20should\x20the\x20plugin\x20be\x20installed?','tvztT':function(_0x527d85,_0x30f513){return _0x527d85(_0x30f513);},'gTmcb':'trailhead','jMFkm':'add','ozykG':_0x331cd8(0xb7),'MfHDp':_0x331cd8(0xd0),'cIgeg':'\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','eWwAu':function(_0x212b0e,_0xd24827){return _0x212b0e===_0xd24827;},'bAVAX':'❌\x20Failed\x20to\x20install\x20plugin:','sqxXe':'✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','LCiWt':_0x331cd8(0xd3),'atjaD':_0x331cd8(0xe3)},_0x5b8f26=await isPluginInstalled(_0x331cd8(0xd3));if(_0x5b8f26)return console['log'](_0x331cd8(0xcb)),![];const _0xa9cf1c=existsSync(_0x2cca24[_0x331cd8(0xdf)](join,_0x2cca24[_0x331cd8(0xbf)](getProjectRoot),_0x2cca24['AXAgw']));let _0x376fa6;if(_0x3bfcf9)_0x376fa6=_0x3bfcf9;else{if(_0xa9cf1c)_0x376fa6=_0x2cca24['TFtms'];else{console['log']('\x0a📦\x20Claude\x20Code\x20Plugin\x0a');const _0x5853f3=await _0x5ed34c['prompt']([{'type':_0x2cca24[_0x331cd8(0xc6)],'name':_0x2cca24[_0x331cd8(0xb5)],'message':_0x2cca24['nAhOw'],'choices':[{'name':'User\x20(available\x20in\x20all\x20your\x20projects)','value':_0x331cd8(0xc7)},{'name':_0x331cd8(0xc3),'value':_0x2cca24['TFtms']}],'default':_0x331cd8(0xc7)}]);_0x376fa6=_0x5853f3['pluginScope'];}}console[_0x331cd8(0xb8)]('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x376fa6+_0x331cd8(0xcd));const _0x322c7d=await _0x2cca24['tvztT'](isMarketplaceAdded,_0x2cca24['gTmcb']);let _0x429357=_0x322c7d;if(_0x322c7d)console['log'](_0x331cd8(0xc2));else{const _0x167a7a=await runClaudeCommand(['plugin',_0x331cd8(0xc1),_0x2cca24['jMFkm'],_0x2cca24[_0x331cd8(0xb6)]]);!_0x167a7a['success']?(console['error'](_0x2cca24[_0x331cd8(0xc0)],_0x167a7a[_0x331cd8(0xc8)]),console[_0x331cd8(0xb8)](_0x331cd8(0xc9)),console[_0x331cd8(0xb8)](_0x2cca24['cIgeg']),console['log']('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x376fa6)):_0x429357=!![];}if(_0x429357){const _0x1b7c00=await runClaudeCommand([_0x331cd8(0xd9),_0x331cd8(0xdd),'ranger@trailhead','--scope',_0x376fa6],{'cwd':_0x2cca24['eWwAu'](_0x376fa6,'project')?getProjectRoot():undefined});if(!_0x1b7c00['success'])console['error'](_0x2cca24[_0x331cd8(0xd5)],_0x1b7c00[_0x331cd8(0xc8)]),console[_0x331cd8(0xb8)](_0x331cd8(0xc9)),console['log'](_0x331cd8(0xce)+_0x376fa6);else{console['log'](_0x2cca24[_0x331cd8(0xbb)]);const _0x50e27d=['plugin','enable',_0x2cca24[_0x331cd8(0xb9)]];_0x2cca24['eWwAu'](_0x376fa6,_0x2cca24['TFtms'])&&_0x50e27d[_0x331cd8(0xbc)](_0x2cca24[_0x331cd8(0xd8)],_0x2cca24[_0x331cd8(0xde)]);const _0xb875b3=await runClaudeCommand(_0x50e27d,{'captureOutput':!![],'cwd':_0x376fa6==='project'?getProjectRoot():undefined}),_0x51dc87=_0xb875b3[_0x331cd8(0xad)]?.['includes'](_0x331cd8(0xb0));!_0xb875b3[_0x331cd8(0xca)]&&!_0x51dc87?console['error']('⚠\x20Failed\x20to\x20enable\x20plugin:',_0xb875b3['error']):console['log'](_0x331cd8(0xbd));}}return!![];}export async function ensureClaudeSkills(_0x1e7be1){const _0x492464=_0xdf76,_0x40382a={'GSvwa':function(_0x306367,_0x5399ad){return _0x306367(_0x5399ad);},'LrEkw':function(_0xae1ef2,_0x25e5ed,_0x48a142,_0x3b87da){return _0xae1ef2(_0x25e5ed,_0x48a142,_0x3b87da);},'ueNPx':function(_0x29753a,_0x1f91d7){return _0x29753a(_0x1f91d7);},'cIzlk':function(_0x2795d2,_0x3c4d7e,_0x54542b,_0x2411ab){return _0x2795d2(_0x3c4d7e,_0x54542b,_0x2411ab);},'esebH':function(_0x5e3320,_0x5e0bf3){return _0x5e3320(_0x5e0bf3);},'UIEmS':'project','ZsqHA':function(_0x3a0b96,_0xf9224c){return _0x3a0b96||_0xf9224c;},'WPzIQ':_0x492464(0xda),'LnQIF':function(_0x392225,_0x42b825,_0x26349e){return _0x392225(_0x42b825,_0x26349e);},'mQRPh':function(_0x45cbbd){return _0x45cbbd();},'FChCj':_0x492464(0xc4),'ueJAO':_0x492464(0xd2)},_0x195119=_0x40382a[_0x492464(0xd4)](existsSync,_0x40382a[_0x492464(0xcf)](join,_0x40382a['ueNPx'](getSkillsDir,_0x492464(0xc7)),'ranger',_0x492464(0xe2))),_0x554057=existsSync(_0x40382a['cIzlk'](join,_0x40382a[_0x492464(0xab)](getSkillsDir,_0x40382a[_0x492464(0xaf)]),_0x492464(0xdb),'SKILL.md'));if(_0x40382a['ZsqHA'](_0x195119,_0x554057))return console['log'](_0x40382a['WPzIQ']),![];const _0x3eca91=existsSync(_0x40382a[_0x492464(0xd1)](join,_0x40382a[_0x492464(0xb2)](getProjectRoot),_0x492464(0xb3)));let _0x2ab837=!![];if(_0x1e7be1)await skillup({'autoInstall':_0x1e7be1,'suppressUsage':!![]});else{if(_0x3eca91)await skillup({'autoInstall':_0x40382a['UIEmS'],'suppressUsage':!![]});else{const _0x325d0a=await _0x5ed34c['prompt']([{'type':_0x40382a['FChCj'],'name':_0x40382a[_0x492464(0xb4)],'message':_0x492464(0xc5),'default':!![]}]);_0x2ab837=_0x325d0a['wantsSkillup'],_0x2ab837&&await _0x40382a[_0x492464(0xac)](skillup,{'suppressUsage':!![]});}}return _0x2ab837;}function _0xdf76(_0x2bc14e,_0xc95314){_0x2bc14e=_0x2bc14e-0xab;const _0x4a3be7=_0x4a3b();let _0xdf7631=_0x4a3be7[_0x2bc14e];return _0xdf7631;}function _0x4a3b(){const _0x5b1142=['✓\x20Claude\x20Code\x20plugin\x20already\x20installed','5969624fVYMFY','\x20level)...\x0a','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','LrEkw','❌\x20Failed\x20to\x20add\x20marketplace:','LnQIF','wantsSkillup','ranger@trailhead','GSvwa','bAVAX','38883627aUFwhG','2988970iKipSl','atjaD','plugin','✓\x20Ranger\x20skills\x20already\x20installed','ranger','65136Eqjwmh','install','TFtms','gIGhj','81965rvmnEZ','12LevZby','SKILL.md','--scope','esebH','ueNPx','output','10jMxech','UIEmS','already\x20enabled','2442Ihybwk','mQRPh','.claude','ueJAO','xraPh','ozykG','ranger-testing/trailhead','log','LCiWt','1240368zVlcvp','sqxXe','push','✓\x20Claude\x20Code\x20plugin\x20enabled','23513ynRrju','LFXJz','MfHDp','marketplace','✓\x20Marketplace\x20already\x20added','Project\x20(shared\x20with\x20team\x20via\x20git)','confirm','Would\x20you\x20like\x20to\x20install\x20skills?','GuvAj','user','error','\x0aYou\x20can\x20install\x20manually\x20with:','success'];_0x4a3b=function(){return _0x5b1142;};return _0x4a3b();}
@@ -1 +1 @@
1
- function _0x322e(){const _0x3b24fa=['63hAAtZY','\x0a📦\x20OpenCode\x20Plugin\x0a','7602oTNSUK','User\x20(available\x20in\x20all\x20your\x20projects)','2028rIGWeL','prompt','42zGgaNn','Project\x20(shared\x20with\x20team\x20via\x20git)','✓\x20OpenCode\x20plugin\x20configured','Failed\x20to\x20read\x20opencode.json','@ranger-testing/opencode-plugin','user','577256XQDaZZ','5269oXMAlb','plugin','opencode.json','pluginScope','XgHsq','75140bDumnk','pUjcM','parse','project','utf-8','27845gvdAYx','12420SjKOCw','680MUPQWK','1446bjIfoL','TcyqW','includes','13165MrRgHz','384912EyfOmF','$schema','Where\x20should\x20the\x20plugin\x20be\x20installed?','log'];_0x322e=function(){return _0x3b24fa;};return _0x322e();}(function(_0x3d80e3,_0x53b50f){const _0x5071f2=_0x46f1,_0x557e51=_0x3d80e3();while(!![]){try{const _0x2b07c0=-parseInt(_0x5071f2(0x1af))/0x1*(parseInt(_0x5071f2(0x1c0))/0x2)+-parseInt(_0x5071f2(0x1b6))/0x3+parseInt(_0x5071f2(0x1b1))/0x4*(parseInt(_0x5071f2(0x1b5))/0x5)+parseInt(_0x5071f2(0x1b2))/0x6*(-parseInt(_0x5071f2(0x1bc))/0x7)+-parseInt(_0x5071f2(0x1a4))/0x8*(-parseInt(_0x5071f2(0x1ba))/0x9)+-parseInt(_0x5071f2(0x1b0))/0xa*(parseInt(_0x5071f2(0x1a5))/0xb)+-parseInt(_0x5071f2(0x1be))/0xc*(-parseInt(_0x5071f2(0x1aa))/0xd);if(_0x2b07c0===_0x53b50f)break;else _0x557e51['push'](_0x557e51['shift']());}catch(_0x235453){_0x557e51['push'](_0x557e51['shift']());}}}(_0x322e,0x57d9c));import{join}from'path';function _0x46f1(_0x494566,_0x37e6d5){_0x494566=_0x494566-0x19f;const _0x322e4b=_0x322e();let _0x46f167=_0x322e4b[_0x494566];return _0x46f167;}import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0x2ed354 from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0x15d76e){const _0x151c3e=_0x46f1,_0x1029a8={'dwQWd':function(_0xf56e19,_0x41c561){return _0xf56e19(_0x41c561);},'XgHsq':_0x151c3e(0x1bb),'lmNxg':'pluginScope','pUjcM':_0x151c3e(0x1b8),'zNQiz':_0x151c3e(0x1bd),'bikTD':_0x151c3e(0x19f),'JtnuT':function(_0x4fe248,_0x596bae){return _0x4fe248(_0x596bae);},'negpd':'https://opencode.ai/config.json','TcyqW':_0x151c3e(0x1ae),'lWweY':'⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','yBMCu':_0x151c3e(0x1a1),'OiMEw':function(_0x5d58b9,_0x1a1413,_0xffd11a){return _0x5d58b9(_0x1a1413,_0xffd11a);},'KwJCc':function(_0x5a0da6,_0x48590a){return _0x5a0da6(_0x48590a);},'SwKXe':_0x151c3e(0x1a0)},_0xe113a8=_0x1029a8['dwQWd'](existsSync,join(getOpencodeConfigDir('project'),_0x151c3e(0x1a7)));let _0x17a74d;if(_0x15d76e)_0x17a74d=_0x15d76e;else{if(_0xe113a8)_0x17a74d='project';else{console['log'](_0x1029a8[_0x151c3e(0x1a9)]);const _0x2bb8ee=await _0x2ed354[_0x151c3e(0x1bf)]([{'type':'list','name':_0x1029a8['lmNxg'],'message':_0x1029a8[_0x151c3e(0x1ab)],'choices':[{'name':_0x1029a8['zNQiz'],'value':'user'},{'name':_0x1029a8['bikTD'],'value':_0x151c3e(0x1ad)}],'default':_0x151c3e(0x1a3)}]);_0x17a74d=_0x2bb8ee[_0x151c3e(0x1a8)];}}const _0x6d6409=join(_0x1029a8['JtnuT'](getOpencodeConfigDir,_0x17a74d),'opencode.json'),_0x25be4d=_0x151c3e(0x1a2),_0x44e3dc=_0x1029a8['negpd'];let _0x1ebf2b={};if(existsSync(_0x6d6409))try{const _0x5163d5=await readFile(_0x6d6409,_0x1029a8[_0x151c3e(0x1b3)]);_0x1ebf2b=JSON[_0x151c3e(0x1ac)](_0x5163d5);}catch(_0x49e5d7){return console['error'](_0x1029a8['lWweY']),{'configured':![],'scope':_0x17a74d,'error':_0x1029a8['yBMCu'],'details':_0x49e5d7};}const _0x2e8396=Array['isArray'](_0x1ebf2b['plugin'])?_0x1ebf2b[_0x151c3e(0x1a6)]:[];if(_0x2e8396[_0x151c3e(0x1b4)](_0x25be4d))return console['log']('✓\x20OpenCode\x20plugin\x20already\x20configured'),{'configured':![],'scope':_0x17a74d};return _0x1ebf2b[_0x151c3e(0x1b7)]=_0x1ebf2b[_0x151c3e(0x1b7)]||_0x44e3dc,_0x1ebf2b[_0x151c3e(0x1a6)]=[..._0x2e8396,_0x25be4d],await _0x1029a8['OiMEw'](mkdir,_0x1029a8['KwJCc'](getOpencodeConfigDir,_0x17a74d),{'recursive':!![]}),await writeFile(_0x6d6409,JSON['stringify'](_0x1ebf2b,null,0x2)+'\x0a'),console[_0x151c3e(0x1b9)](_0x1029a8['SwKXe']),{'configured':!![],'scope':_0x17a74d};}
1
+ (function(_0x25fefc,_0x78d745){const _0x1e44c8=_0x11e8,_0x27f49a=_0x25fefc();while(!![]){try{const _0x21d6ed=parseInt(_0x1e44c8(0x164))/0x1+parseInt(_0x1e44c8(0x174))/0x2*(parseInt(_0x1e44c8(0x17a))/0x3)+parseInt(_0x1e44c8(0x16e))/0x4*(parseInt(_0x1e44c8(0x17b))/0x5)+-parseInt(_0x1e44c8(0x16b))/0x6*(parseInt(_0x1e44c8(0x183))/0x7)+parseInt(_0x1e44c8(0x17c))/0x8+-parseInt(_0x1e44c8(0x163))/0x9*(-parseInt(_0x1e44c8(0x168))/0xa)+parseInt(_0x1e44c8(0x17d))/0xb*(-parseInt(_0x1e44c8(0x162))/0xc);if(_0x21d6ed===_0x78d745)break;else _0x27f49a['push'](_0x27f49a['shift']());}catch(_0x372988){_0x27f49a['push'](_0x27f49a['shift']());}}}(_0x2015,0x61bf8));import{join}from'path';import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';function _0x2015(){const _0x148b2f=['https://opencode.ai/config.json','440gKhyXT','gafTX','User\x20(available\x20in\x20all\x20your\x20projects)','6CIgspr','JdlRT','includes','128xNFHRP','project','pluginScope','FKblN','oPgzs','opencode.json','4CYONJJ','SFXVm','HXrng','PoekW','$schema','eEfTU','865959yVYfKO','101110kaXhYQ','1244120DrfhVu','11013717RAGksD','IGmbU','✓\x20OpenCode\x20plugin\x20configured','user','Failed\x20to\x20read\x20opencode.json','EFcFP','2144933hCfhfS','12qkhzrA','54738wREvBU','60509giXIkA','⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','\x0a📦\x20OpenCode\x20Plugin\x0a'];_0x2015=function(){return _0x148b2f;};return _0x2015();}import _0x448932 from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';function _0x11e8(_0x1b0ce7,_0xbe2e3e){_0x1b0ce7=_0x1b0ce7-0x162;const _0x2015b3=_0x2015();let _0x11e808=_0x2015b3[_0x1b0ce7];return _0x11e808;}export async function ensureOpencodePluginConfig(_0x542645){const _0x25fa3c=_0x11e8,_0x4d35fd={'PoekW':function(_0x40b4ba,_0x309355){return _0x40b4ba(_0x309355);},'SFXVm':function(_0x61042f,_0x519b1a,_0x4d01ec){return _0x61042f(_0x519b1a,_0x4d01ec);},'HXrng':_0x25fa3c(0x173),'oPgzs':_0x25fa3c(0x16f),'SQtIz':'list','gafTX':'Project\x20(shared\x20with\x20team\x20via\x20git)','EFcFP':_0x25fa3c(0x180),'VIUPt':_0x25fa3c(0x167),'BgrfE':function(_0x51d24f,_0x29a18e,_0x32fd82){return _0x51d24f(_0x29a18e,_0x32fd82);},'FKblN':_0x25fa3c(0x165),'eEfTU':'✓\x20OpenCode\x20plugin\x20already\x20configured','IGmbU':function(_0x163f7f,_0x48552b){return _0x163f7f(_0x48552b);},'JdlRT':_0x25fa3c(0x17f)},_0xf26c24=_0x4d35fd[_0x25fa3c(0x177)](existsSync,_0x4d35fd[_0x25fa3c(0x175)](join,_0x4d35fd[_0x25fa3c(0x177)](getOpencodeConfigDir,'project'),_0x4d35fd[_0x25fa3c(0x176)]));let _0x1ad841;if(_0x542645)_0x1ad841=_0x542645;else{if(_0xf26c24)_0x1ad841=_0x4d35fd['oPgzs'];else{console['log'](_0x25fa3c(0x166));const _0x198082=await _0x448932['prompt']([{'type':_0x4d35fd['SQtIz'],'name':_0x25fa3c(0x170),'message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':_0x25fa3c(0x16a),'value':_0x25fa3c(0x180)},{'name':_0x4d35fd[_0x25fa3c(0x169)],'value':_0x4d35fd[_0x25fa3c(0x172)]}],'default':_0x4d35fd[_0x25fa3c(0x182)]}]);_0x1ad841=_0x198082['pluginScope'];}}const _0x1175f7=join(_0x4d35fd['PoekW'](getOpencodeConfigDir,_0x1ad841),_0x4d35fd[_0x25fa3c(0x176)]),_0x12097c='@ranger-testing/opencode-plugin',_0x12a024=_0x4d35fd['VIUPt'];let _0x3ad1a9={};if(existsSync(_0x1175f7))try{const _0x24ec63=await _0x4d35fd['BgrfE'](readFile,_0x1175f7,'utf-8');_0x3ad1a9=JSON['parse'](_0x24ec63);}catch(_0x3c19ba){return console['error'](_0x4d35fd[_0x25fa3c(0x171)]),{'configured':![],'scope':_0x1ad841,'error':_0x25fa3c(0x181),'details':_0x3c19ba};}const _0x587bb1=Array['isArray'](_0x3ad1a9['plugin'])?_0x3ad1a9['plugin']:[];if(_0x587bb1[_0x25fa3c(0x16d)](_0x12097c))return console['log'](_0x4d35fd[_0x25fa3c(0x179)]),{'configured':![],'scope':_0x1ad841};return _0x3ad1a9['$schema']=_0x3ad1a9[_0x25fa3c(0x178)]||_0x12a024,_0x3ad1a9['plugin']=[..._0x587bb1,_0x12097c],await mkdir(_0x4d35fd[_0x25fa3c(0x17e)](getOpencodeConfigDir,_0x1ad841),{'recursive':!![]}),await writeFile(_0x1175f7,JSON['stringify'](_0x3ad1a9,null,0x2)+'\x0a'),console['log'](_0x4d35fd[_0x25fa3c(0x16c)]),{'configured':!![],'scope':_0x1ad841};}
@@ -1 +1 @@
1
- function _0x1def(_0x101f91,_0xee37){_0x101f91=_0x101f91-0x159;var _0xe03d98=_0xe03d();var _0x1def60=_0xe03d98[_0x101f91];return _0x1def60;}(function(_0xed2c77,_0x30d800){var _0x262057=_0x1def,_0x74396b=_0xed2c77();while(!![]){try{var _0x122b2e=-parseInt(_0x262057(0x15d))/0x1+-parseInt(_0x262057(0x160))/0x2*(-parseInt(_0x262057(0x15a))/0x3)+parseInt(_0x262057(0x15b))/0x4+-parseInt(_0x262057(0x15f))/0x5+parseInt(_0x262057(0x15c))/0x6*(parseInt(_0x262057(0x159))/0x7)+parseInt(_0x262057(0x167))/0x8*(-parseInt(_0x262057(0x161))/0x9)+-parseInt(_0x262057(0x166))/0xa*(-parseInt(_0x262057(0x165))/0xb);if(_0x122b2e===_0x30d800)break;else _0x74396b['push'](_0x74396b['shift']());}catch(_0x336b62){_0x74396b['push'](_0x74396b['shift']());}}}(_0xe03d,0xaddc8));export async function setupCi(_0x1e253b,_0x2494ac,_0x10d007){var _0x139b0f=_0x1def,_0x375fc4={'JFmSe':function(_0x5965f1,_0x2bb1b1){return _0x5965f1+_0x2bb1b1;},'hUrJi':'ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','EKqnA':_0x139b0f(0x162)};console['error'](_0x375fc4[_0x139b0f(0x163)](_0x375fc4['JFmSe'](_0x375fc4['hUrJi']+'\x0a'+'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a',_0x375fc4['EKqnA'])+'\x0a','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a')+_0x139b0f(0x164)),process[_0x139b0f(0x15e)](0x1);}function _0xe03d(){var _0x177702=['\x20\x20ranger\x20profile\x20add\x20<name>\x0a','JFmSe','\x20\x20https://docs.ranger.net/main/concepts/profiles','1892ixPaLG','2670rvpPLH','1888JzKokN','77oonurN','341595siEXji','4413032kgAZvQ','355692NcksqE','557637WJWnWa','exit','2318845saGSBg','4jaqMnk','11268yQwLDP'];_0xe03d=function(){return _0x177702;};return _0xe03d();}
1
+ function _0x31f9(){var _0x4e28f4=['6159020btwbTV','exit','1456749ApluTr','6487439VHxwZX','5195466ptJuJl','8ASqDmY','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','XnAkK','116HNldmt','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','1163668jbTbzg','15501PmQvMt','\x20\x20https://docs.ranger.net/main/concepts/profiles','5602095uXUAFW'];_0x31f9=function(){return _0x4e28f4;};return _0x31f9();}(function(_0xefe8d6,_0x2d95f6){var _0xd2498b=_0x2460,_0xc02c66=_0xefe8d6();while(!![]){try{var _0xd083dc=parseInt(_0xd2498b(0x1a2))/0x1+-parseInt(_0xd2498b(0x1aa))/0x2+-parseInt(_0xd2498b(0x1ab))/0x3*(parseInt(_0xd2498b(0x1a8))/0x4)+parseInt(_0xd2498b(0x1a0))/0x5+-parseInt(_0xd2498b(0x1a4))/0x6+-parseInt(_0xd2498b(0x1a3))/0x7*(parseInt(_0xd2498b(0x1a5))/0x8)+parseInt(_0xd2498b(0x19f))/0x9;if(_0xd083dc===_0x2d95f6)break;else _0xc02c66['push'](_0xc02c66['shift']());}catch(_0x481f6f){_0xc02c66['push'](_0xc02c66['shift']());}}}(_0x31f9,0xc00d3));function _0x2460(_0x3e279b,_0x339a25){_0x3e279b=_0x3e279b-0x19e;var _0x31f928=_0x31f9();var _0x2460df=_0x31f928[_0x3e279b];return _0x2460df;}export async function setupCi(_0xc2cb8c,_0x962366,_0x3c59d8){var _0x4f12eb=_0x2460,_0xcd6052={'GLfmJ':function(_0xb79ba0,_0x44c08b){return _0xb79ba0+_0x44c08b;},'SrCtX':'ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','tNONP':'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','XnAkK':_0x4f12eb(0x1a6)};console['error'](_0xcd6052['GLfmJ'](_0xcd6052['GLfmJ'](_0xcd6052['SrCtX']+'\x0a'+_0xcd6052['tNONP']+_0xcd6052[_0x4f12eb(0x1a7)],'\x0a')+_0x4f12eb(0x1a9),_0x4f12eb(0x19e))),process[_0x4f12eb(0x1a1)](0x1);}
@@ -1 +1 @@
1
- (function(_0x5cebb4,_0x5040d8){const _0x2c364d=_0x1400,_0x484eb2=_0x5cebb4();while(!![]){try{const _0x5dbdd8=-parseInt(_0x2c364d(0xc4))/0x1+-parseInt(_0x2c364d(0xc0))/0x2+-parseInt(_0x2c364d(0xdc))/0x3*(-parseInt(_0x2c364d(0xbf))/0x4)+-parseInt(_0x2c364d(0xe8))/0x5*(parseInt(_0x2c364d(0xc7))/0x6)+parseInt(_0x2c364d(0xbb))/0x7*(-parseInt(_0x2c364d(0xbc))/0x8)+parseInt(_0x2c364d(0xca))/0x9*(-parseInt(_0x2c364d(0xe5))/0xa)+parseInt(_0x2c364d(0xe0))/0xb*(parseInt(_0x2c364d(0xdb))/0xc);if(_0x5dbdd8===_0x5040d8)break;else _0x484eb2['push'](_0x484eb2['shift']());}catch(_0x988f1a){_0x484eb2['push'](_0x484eb2['shift']());}}}(_0x24c2,0x2065a));function _0x1400(_0x22455a,_0x326843){_0x22455a=_0x22455a-0xbb;const _0x24c2d7=_0x24c2();let _0x14002f=_0x24c2d7[_0x22455a];return _0x14002f;}import{basename}from'path';import _0x4ccc69 from'inquirer';function _0x24c2(){const _0x11997c=['150ilgxjs','aiIdY','Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20(','556848GTIoVh','user-level','\x20\x20-\x20Open\x20Claude\x20Code\x20in\x20plan\x20mode\x20and\x20run\x20/ranger:enable.\x20Plan\x20out\x20a\x20UI\x20feature\x20with\x20Ranger\x20and\x20watch\x20Ranger\x20test\x20it\x20for\x20you!','project-level','Bzbwa','warn','prompt','installLevel','opencode','project','guFtw','\x20successfully!\x0a','message','3|4|0|1|2|5','JVBwn','ranger','\x20--opencode','48XbvktW','471avkDuq','\x20skill','\x0a✅\x20Installed\x20','log','2129083alEoiW','rRQMU','/skills/','/.claude/skills/','✓\x20Found\x20API\x20token','20rIHZFZ','user','\x20<your-api-token>','47375HPWAiG','\x0a📦\x20Installing\x20skills...\x0a','RKlgY','list','28iIiORB','234448zMHCts','This\x20project\x20only\x20(','GdMaF','4252IkOpKN','195684UhEoln','\x20\x203.\x20Run:\x20ranger\x20skillup','dMvWX','suppressUsage','232720kfVhCf','autoInstall','To\x20use:'];_0x24c2=function(){return _0x11997c;};return _0x24c2();}import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x5df915={}){const _0xa51fa8=_0x1400,_0x2580a2={'RKlgY':'claude','dMvWX':function(_0x5df9f9){return _0x5df9f9();},'HDmgm':'\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','CFrzv':function(_0x62361,_0x140229){return _0x62361===_0x140229;},'rRQMU':'opencode','aiIdY':_0xa51fa8(0xda),'aUtPu':'❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','JVBwn':'user','Bzbwa':_0xa51fa8(0xd1),'DRdhP':_0xa51fa8(0xd3),'GdMaF':_0xa51fa8(0xe9),'guFtw':'\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','uXioR':_0xa51fa8(0xcc)};console[_0xa51fa8(0xdf)]('\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a');const _0x22947a=_0x5df915['platform']??_0x2580a2[_0xa51fa8(0xea)],_0x4051cd=await _0x2580a2[_0xa51fa8(0xc2)](getToken);if(!_0x4051cd){const _0x360c97=_0xa51fa8(0xd7)['split']('|');let _0x2653ec=0x0;while(!![]){switch(_0x360c97[_0x2653ec++]){case'0':console[_0xa51fa8(0xdf)](_0x2580a2['HDmgm']);continue;case'1':console[_0xa51fa8(0xdf)]('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0x2580a2['CFrzv'](_0x22947a,_0x2580a2[_0xa51fa8(0xe1)])?_0x2580a2[_0xa51fa8(0xc8)]:'')+_0xa51fa8(0xe7));continue;case'2':console[_0xa51fa8(0xdf)](_0xa51fa8(0xc1)+(_0x22947a===_0xa51fa8(0xd2)?'\x20--opencode':'')+'\x0a');continue;case'3':console[_0xa51fa8(0xdf)](_0x2580a2['aUtPu']);continue;case'4':console['log']('To\x20get\x20started:');continue;case'5':return;}break;}}console[_0xa51fa8(0xdf)](_0xa51fa8(0xe4));const _0x2ed0b7=_0x2580a2[_0xa51fa8(0xc2)](getProjectRoot),_0x3346be=basename(_0x2ed0b7),_0x425bc0=_0x22947a===_0x2580a2['rRQMU']?getOpencodeConfigDir(_0x2580a2[_0xa51fa8(0xd8)])+'/skills/':getClaudeConfigDir()+_0xa51fa8(0xe2),_0xbf653b=_0x2580a2['CFrzv'](_0x22947a,_0x2580a2[_0xa51fa8(0xe1)])?_0x2ed0b7+'/.opencode/skills/':_0x2ed0b7+_0xa51fa8(0xe3),_0x5b16a5=process['stdin']['isTTY']&&process['stdout']['isTTY'];let _0xbe2d1;if(_0x5df915[_0xa51fa8(0xc5)])_0xbe2d1=_0x5df915[_0xa51fa8(0xc5)];else{if(_0x5b16a5){const _0x586755=await _0x4ccc69[_0xa51fa8(0xd0)]([{'type':_0xa51fa8(0xeb),'name':_0x2580a2[_0xa51fa8(0xce)],'message':'Where\x20should\x20skills\x20be\x20installed?','choices':[{'name':'All\x20projects\x20('+_0x425bc0+')','value':'user'},{'name':_0xa51fa8(0xbd)+_0xbf653b+')','value':_0x2580a2['DRdhP']}]}]);_0xbe2d1=_0x586755[_0xa51fa8(0xd1)];}else _0xbe2d1=_0x2580a2['DRdhP'],console['log'](_0xa51fa8(0xc9)+_0xbf653b+')');}let _0xb999b2=0x0;const _0x386a01=_0x2580a2['dMvWX'](getCurrentVersion);console['log'](_0x2580a2[_0xa51fa8(0xbe)]);try{const _0x322cc7=await installSkill(_0xa51fa8(0xd9),{'cliVersion':_0x386a01,'level':_0xbe2d1,'platform':_0x22947a});_0x322cc7&&_0xb999b2++;}catch(_0x1feb43){console[_0xa51fa8(0xcf)](_0x2580a2[_0xa51fa8(0xd4)],_0x1feb43 instanceof Error?_0x1feb43[_0xa51fa8(0xd6)]:_0x1feb43);}if(_0xb999b2>0x0){const _0x4a5cb2=_0xbe2d1===_0xa51fa8(0xe6)?_0xa51fa8(0xcb):_0xa51fa8(0xcd);console[_0xa51fa8(0xdf)](_0xa51fa8(0xde)+_0xb999b2+'\x20'+_0x4a5cb2+_0xa51fa8(0xdd)+(_0xb999b2>0x1?'s':'')+_0xa51fa8(0xd5)),!_0x5df915[_0xa51fa8(0xc3)]&&(console[_0xa51fa8(0xdf)](_0xa51fa8(0xc6)),_0x22947a===_0xa51fa8(0xd2)?console[_0xa51fa8(0xdf)]('\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.'):console[_0xa51fa8(0xdf)](_0x2580a2['uXioR']));}else console['log']('\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a');}
1
+ function _0x311c(){const _0x3a7e18=['platform','To\x20use:','\x20--opencode','opencode','All\x20projects\x20(','517021gARnSR','prompt','DLTuo','\x20\x202.\x20Run:\x20ranger\x20setup','60IXUWXP','log','project-level','warn','\x0a📦\x20Installing\x20skills...\x0a','Where\x20should\x20skills\x20be\x20installed?','1130xtIDjV','CfnrH','QOpHU','✓\x20Found\x20API\x20token','iySZD','stdout','installLevel','19789gYvdxE','4920LEQKKA','2PkhMyG','28740TjQjjn','tivHh','\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!','list','\x20<your-api-token>','\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','\x20\x203.\x20Run:\x20ranger\x20skillup','NRlGB','TZgaq','isTTY','claude','\x20successfully!\x0a','49918mEVrSG','message','666477TGfxcY','16TswpNY','user','392TClfIH','37957907POAqcw','UeWYH','\x0a✅\x20Installed\x20','gJzud','iCzHL','split','This\x20project\x20only\x20(','100596DoAkGc','user-level','autoInstall'];_0x311c=function(){return _0x3a7e18;};return _0x311c();}(function(_0x1a5f06,_0x173039){const _0x396ce5=_0x5bdf,_0x1a06e1=_0x1a5f06();while(!![]){try{const _0x5fd57d=parseInt(_0x396ce5(0x17f))/0x1*(parseInt(_0x396ce5(0x192))/0x2)+parseInt(_0x396ce5(0x177))/0x3*(-parseInt(_0x396ce5(0x16d))/0x4)+parseInt(_0x396ce5(0x189))/0x5*(-parseInt(_0x396ce5(0x193))/0x6)+parseInt(_0x396ce5(0x190))/0x7*(parseInt(_0x396ce5(0x16f))/0x8)+parseInt(_0x396ce5(0x16c))/0x9*(parseInt(_0x396ce5(0x183))/0xa)+-parseInt(_0x396ce5(0x16a))/0xb*(parseInt(_0x396ce5(0x191))/0xc)+parseInt(_0x396ce5(0x170))/0xd;if(_0x5fd57d===_0x173039)break;else _0x1a06e1['push'](_0x1a06e1['shift']());}catch(_0x331177){_0x1a06e1['push'](_0x1a06e1['shift']());}}}(_0x311c,0xe6175));import{basename}from'path';import _0x45394b from'inquirer';import{getToken}from'./utils/keychain.js';function _0x5bdf(_0x5bd14e,_0x50925b){_0x5bd14e=_0x5bd14e-0x167;const _0x311ca6=_0x311c();let _0x5bdf4d=_0x311ca6[_0x5bd14e];return _0x5bdf4d;}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(_0x1e3f86={}){const _0x1bca98=_0x5bdf,_0x50067e={'TZgaq':'1|3|2|5|4|0','iCzHL':'❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','zMwzk':function(_0x51b19c,_0x5c262e){return _0x51b19c===_0x5c262e;},'iySZD':'opencode','FBrIb':_0x1bca98(0x17c),'JxSTw':function(_0x580ab6,_0xa1440d){return _0x580ab6(_0xa1440d);},'hPFBs':function(_0x46ba35,_0x2a483e){return _0x46ba35(_0x2a483e);},'UeWYH':_0x1bca98(0x16e),'DLTuo':function(_0x191083,_0x4f5cb5){return _0x191083===_0x4f5cb5;},'GRaDA':_0x1bca98(0x18f),'Zgylm':_0x1bca98(0x188),'gJzud':function(_0x150761){return _0x150761();},'NRlGB':'ranger','QOpHU':_0x1bca98(0x198),'rCdhT':function(_0x2f9e80,_0x11c6c5){return _0x2f9e80>_0x11c6c5;},'CfnrH':function(_0x48ace7,_0x4e7aea){return _0x48ace7===_0x4e7aea;},'AJbsI':'\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','tivHh':_0x1bca98(0x195)};console['log']('\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a');const _0xb77a3e=_0x1e3f86[_0x1bca98(0x17a)]??_0x1bca98(0x168),_0x55e7ff=await getToken();if(!_0x55e7ff){const _0x501b5c=_0x50067e[_0x1bca98(0x19b)][_0x1bca98(0x175)]('|');let _0x27ac02=0x0;while(!![]){switch(_0x501b5c[_0x27ac02++]){case'0':return;case'1':console[_0x1bca98(0x184)](_0x50067e[_0x1bca98(0x174)]);continue;case'2':console['log']('\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli');continue;case'3':console[_0x1bca98(0x184)]('To\x20get\x20started:');continue;case'4':console[_0x1bca98(0x184)](_0x1bca98(0x199)+(_0x50067e['zMwzk'](_0xb77a3e,_0x50067e['iySZD'])?_0x1bca98(0x17c):'')+'\x0a');continue;case'5':console['log'](_0x1bca98(0x182)+(_0xb77a3e===_0x50067e['iySZD']?_0x50067e['FBrIb']:'')+_0x1bca98(0x197));continue;}break;}}console[_0x1bca98(0x184)](_0x1bca98(0x18c));const _0x39d94a=getProjectRoot(),_0x544376=_0x50067e['JxSTw'](basename,_0x39d94a),_0x57a3f9=_0xb77a3e===_0x50067e[_0x1bca98(0x18d)]?_0x50067e['hPFBs'](getOpencodeConfigDir,_0x50067e[_0x1bca98(0x171)])+'/skills/':getClaudeConfigDir()+'/skills/',_0x3b5581=_0x50067e[_0x1bca98(0x181)](_0xb77a3e,_0x50067e['iySZD'])?_0x39d94a+'/.opencode/skills/':_0x39d94a+'/.claude/skills/',_0x254f4b=process['stdin'][_0x1bca98(0x167)]&&process[_0x1bca98(0x18e)]['isTTY'];let _0x765203;if(_0x1e3f86[_0x1bca98(0x179)])_0x765203=_0x1e3f86[_0x1bca98(0x179)];else{if(_0x254f4b){const _0x33a2da=await _0x45394b[_0x1bca98(0x180)]([{'type':_0x1bca98(0x196),'name':_0x50067e['GRaDA'],'message':_0x50067e['Zgylm'],'choices':[{'name':_0x1bca98(0x17e)+_0x57a3f9+')','value':_0x50067e[_0x1bca98(0x171)]},{'name':_0x1bca98(0x176)+_0x3b5581+')','value':'project'}]}]);_0x765203=_0x33a2da['installLevel'];}else _0x765203='project',console['log']('Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20('+_0x3b5581+')');}let _0x1c02c4=0x0;const _0x529adf=_0x50067e[_0x1bca98(0x173)](getCurrentVersion);console['log'](_0x1bca98(0x187));try{const _0x57f130=await installSkill(_0x50067e[_0x1bca98(0x19a)],{'cliVersion':_0x529adf,'level':_0x765203,'platform':_0xb77a3e});_0x57f130&&_0x1c02c4++;}catch(_0x3dd142){console[_0x1bca98(0x186)](_0x50067e[_0x1bca98(0x18b)],_0x3dd142 instanceof Error?_0x3dd142[_0x1bca98(0x16b)]:_0x3dd142);}if(_0x50067e['rCdhT'](_0x1c02c4,0x0)){const _0x1e2854=_0x50067e['zMwzk'](_0x765203,'user')?_0x1bca98(0x178):_0x1bca98(0x185);console[_0x1bca98(0x184)](_0x1bca98(0x172)+_0x1c02c4+'\x20'+_0x1e2854+'\x20skill'+(_0x50067e['rCdhT'](_0x1c02c4,0x1)?'s':'')+_0x1bca98(0x169)),!_0x1e3f86['suppressUsage']&&(console[_0x1bca98(0x184)](_0x1bca98(0x17b)),_0x50067e[_0x1bca98(0x18a)](_0xb77a3e,_0x1bca98(0x17d))?console[_0x1bca98(0x184)](_0x50067e['AJbsI']):console['log'](_0x50067e[_0x1bca98(0x194)]));}else console[_0x1bca98(0x184)]('\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a');}
@@ -1 +1 @@
1
- const _0x5071b4=_0xa611;(function(_0x481740,_0x2269b7){const _0x89418=_0xa611,_0x182230=_0x481740();while(!![]){try{const _0x396d11=parseInt(_0x89418(0xc2))/0x1*(parseInt(_0x89418(0xaf))/0x2)+-parseInt(_0x89418(0xe1))/0x3+-parseInt(_0x89418(0xda))/0x4*(-parseInt(_0x89418(0xe2))/0x5)+-parseInt(_0x89418(0xb0))/0x6*(-parseInt(_0x89418(0xa8))/0x7)+parseInt(_0x89418(0xf9))/0x8*(parseInt(_0x89418(0xe0))/0x9)+parseInt(_0x89418(0xbd))/0xa*(parseInt(_0x89418(0xb4))/0xb)+parseInt(_0x89418(0xe9))/0xc*(-parseInt(_0x89418(0xf2))/0xd);if(_0x396d11===_0x2269b7)break;else _0x182230['push'](_0x182230['shift']());}catch(_0x23bd5a){_0x182230['push'](_0x182230['shift']());}}}(_0xea47,0x56cf9));function _0xa611(_0x2b0afe,_0x5b400d){_0x2b0afe=_0x2b0afe-0x98;const _0xea47fc=_0xea47();let _0xa61153=_0xea47fc[_0x2b0afe];return _0xa61153;}import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x43049a from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION=_0x5071b4(0xf6);function _0xea47(){const _0x42f9ae=['You\x20can\x20install\x20it\x20manually\x20by\x20running:','Authentication\x20failed:\x20','GITHUB_ENV','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','68agyVxJ','knxHp','scope','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','ranger\x20profile\x20add\x20<name>','oAZhu','UEdit','NwUiA','npx','success','slopL','chromium','version','\x0a❌\x20Profile\x20setup\x20failed:','allowInsecureLocalhost','yMJMQ','bBeQr','✓\x20Playwright\x20Chromium\x20browser\x20found','inherit','FmlcH','skipped','QKGIC','vtlOh','\x20is\x20no\x20longer\x20supported.\x20','20paSrti','skipChromium','error','trackPhaseStart','user','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','126HfjlZs','243249TMYodR','566025KtBimk','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','SjFTn','auth','platform','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','\x0a\x20\x20','1291692jlSLzs','kUDzj','CfZEL','✓\x20Created\x20.ranger/.gitignore','\x20install\x20chromium','install','✓\x20Created\x20~/.ranger/\x20directory','trackPhaseEnd','HqZxD','208ygWmCz','AgJEo','naVBn','message','1.58.2','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','cQQqe','218096DiXzlq','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','The\x20required\x20version\x20(','opencode','exit','PgtdA','close','aqvvA','nBycZ','ranger','status','warn','/ranger:enable','oRKpd','resolve','log','playwright/package.json','CQPsA','url','VDkpv','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','organizationName','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','✓\x20Exported\x20credentials\x20for\x20CI','2254nhiPDv','joiio','\x0a🚀\x20Ranger\x20Setup\x0a',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','.gitignore','\x0aIn\x20Claude\x20Code,\x20run\x20','isTTY','6158EXQkRP','8106GmxFSM','✓\x20~/.ranger/\x20directory\x20already\x20exists','ignore','cipvg','11cSmQRo','✓\x20Authenticated\x20to\x20','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','\x0a⚠\x20Skipping\x20Chromium\x20installation.','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.','plugin','zFRtL','provided_token','prompt','5668290ycyDDi'];_0xea47=function(){return _0x42f9ae;};return _0xea47();}const bold=_0x113809=>'\x1b[1m'+_0x113809+'\x1b[0m';export function getPlaywrightVersion(){const _0x4e5837=_0x5071b4,_0x4f2d70={'AgJEo':_0x4e5837(0x9f),'aqvvA':function(_0x3327bf,_0x4444b9){return _0x3327bf(_0x4444b9);}};try{const _0x3421c9=require[_0x4e5837(0x9d)](_0x4f2d70[_0x4e5837(0xf3)]),_0x48f374=_0x4f2d70[_0x4e5837(0x100)](require,_0x3421c9);return _0x48f374[_0x4e5837(0xce)];}catch{return null;}}export function installChromiumBinary(_0x1aaa73,_0x3e5832=![]){const _0x4ffbbd=_0x5071b4,_0x35c3a9={'joiio':function(_0x3c286e,_0x39bd45){return _0x3c286e(_0x39bd45);},'VabGo':_0x4ffbbd(0xee),'slopL':_0x4ffbbd(0xcd),'yVALp':function(_0x4b0c2d,_0x59454d,_0x5b3ade,_0x2015bb){return _0x4b0c2d(_0x59454d,_0x5b3ade,_0x2015bb);},'qfqKr':_0x4ffbbd(0xb2),'FmlcH':_0x4ffbbd(0xd4),'guwcN':'win32','SjFTn':_0x4ffbbd(0xff),'YcaRO':'error'};return new Promise((_0x35d6c5,_0xe47e9d)=>{const _0xe49cfd=_0x4ffbbd,_0x33f688=['playwright@'+_0x1aaa73,_0x35c3a9['VabGo'],..._0x3e5832?['--with-deps']:[],_0x35c3a9[_0xe49cfd(0xcc)]],_0x140478=_0x35c3a9['yVALp'](spawn,_0xe49cfd(0xca),_0x33f688,{'stdio':[_0x35c3a9['qfqKr'],_0x35c3a9[_0xe49cfd(0xd5)],_0x35c3a9['FmlcH']],'shell':process[_0xe49cfd(0xe6)]===_0x35c3a9['guwcN']});_0x140478['on'](_0x35c3a9[_0xe49cfd(0xe4)],_0x3d68f5=>{const _0x372b27=_0xe49cfd;_0x3d68f5===0x0?_0x35d6c5():_0x35c3a9[_0x372b27(0xa9)](_0xe47e9d,new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x3d68f5));}),_0x140478['on'](_0x35c3a9['YcaRO'],_0x50ba48=>{_0xe47e9d(_0x50ba48);});});}export async function authenticate(_0x3c3559){const _0x154730=_0x5071b4,_0x382005={'JWffR':function(_0x5b7873){return _0x5b7873();},'zFRtL':'device_auth','xTlIn':'Validating\x20API\x20token...','EzCvD':'✓\x20Stored\x20credentials\x20locally'};if(!_0x3c3559){const _0x25e074=await _0x382005['JWffR'](getToken);if(_0x25e074){const _0x34ff74=await getCurrentUser(_0x25e074);if(_0x34ff74['success'])return console[_0x154730(0x9e)]('✓\x20Already\x20authenticated\x20to\x20'+_0x34ff74[_0x154730(0xde)][_0x154730(0xa5)]),{'token':_0x25e074,'method':'existing_token'};}try{_0x3c3559=await runDeviceAuthFlow();}catch(_0x1f4c97){throw new Error(_0x154730(0xbf)+(_0x1f4c97 instanceof Error?_0x1f4c97['message']:_0x1f4c97));}const _0x26d99e=await getCurrentUser(_0x3c3559);if(!_0x26d99e[_0x154730(0xcb)])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x26d99e['error']);return console['log']('✓\x20Authenticated\x20to\x20'+_0x26d99e[_0x154730(0xde)]['organizationName']),{'token':_0x3c3559,'method':_0x382005[_0x154730(0xba)]};}console['log'](_0x382005['xTlIn']);const _0xe32222=await getCurrentUser(_0x3c3559);if(!_0xe32222[_0x154730(0xcb)]){if(_0xe32222[_0x154730(0x99)])throw new Error(_0x154730(0xbf)+_0xe32222['error']+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0xe32222['error']+_0x154730(0xb6));}return console['log'](_0x154730(0xb5)+_0xe32222[_0x154730(0xde)][_0x154730(0xa5)]),await storeToken(_0x3c3559),console['log'](process['env'][_0x154730(0xc0)]?_0x154730(0xa7):_0x382005['EzCvD']),{'token':_0x3c3559,'method':_0x154730(0xbb)};}export async function ensureRangerDir(_0x1282b8){const _0x36cbba=_0x5071b4,_0x2e7cc3={'KrVOR':function(_0x5bb5bf){return _0x5bb5bf();},'qBGDb':_0x36cbba(0xb1)};void _0x1282b8;const _0x2ddcf6=_0x2e7cc3['KrVOR'](getRangerHomeDir);return!existsSync(_0x2ddcf6)?(await mkdir(_0x2ddcf6,{'recursive':!![]}),console[_0x36cbba(0x9e)](_0x36cbba(0xef)),{'path':_0x2ddcf6,'installed':!![]}):(console['log'](_0x2e7cc3['qBGDb']),{'path':_0x2ddcf6,'installed':![]});}export async function ensureChromium(_0xd49fe8=![]){const _0x14d772=_0x5071b4,_0x2e4207={'yMJMQ':'\x20(fallback\x20version)','UEdit':'\x0aInstalling\x20Chromium\x20browser...\x0a','knxHp':_0x14d772(0xa6),'PuZEr':function(_0x33f637,_0x16c6dc){return _0x33f637 instanceof _0x16c6dc;},'nBycZ':_0x14d772(0xbe),'oAZhu':_0x14d772(0xb7),'bBeQr':'You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'};let _0x1db60d=![];try{const _0x4fc80d=chromium['executablePath']();_0x1db60d=existsSync(_0x4fc80d);}catch{_0x1db60d=![];}if(_0x1db60d)return console['log'](_0x14d772(0xd3)),![];const _0x142927=getPlaywrightVersion(),_0xa20970=_0x142927??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x1bcbdb=!_0x142927,_0x135424=process['stdin'][_0x14d772(0xae)]&&process['stdout']['isTTY'];let _0x3581b9=!![];if(_0x135424){const {install:_0x49ee6a}=await _0x43049a[_0x14d772(0xbc)]([{'type':'confirm','name':_0x14d772(0xee),'message':_0x1bcbdb?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0xa20970+'\x20now?':_0x14d772(0xfb)+_0xa20970+_0x14d772(0xab),'default':!![]}]);_0x3581b9=_0x49ee6a;}else console[_0x14d772(0x9e)]('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0xa20970+(_0x1bcbdb?_0x2e4207[_0x14d772(0xd1)]:'')+'...');if(_0x3581b9){console['log'](_0x2e4207[_0x14d772(0xc8)]);try{await installChromiumBinary(_0xa20970,_0xd49fe8),console[_0x14d772(0x9e)]('\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully');}catch(_0x411962){console[_0x14d772(0xdc)](_0x2e4207[_0x14d772(0xc3)],_0x2e4207['PuZEr'](_0x411962,Error)?_0x411962[_0x14d772(0xf5)]:_0x411962),console['log'](_0x2e4207[_0x14d772(0x101)]),console[_0x14d772(0x9e)]('\x20\x20npx\x20playwright@'+_0xa20970+_0x14d772(0xed));}}else console['log'](_0x2e4207[_0x14d772(0xc7)]),console['log'](_0x2e4207[_0x14d772(0xd2)]),console[_0x14d772(0x9e)]('\x20\x20npx\x20playwright@'+_0xa20970+_0x14d772(0xed));return!![];}export async function writeRangerGitignore(_0x25f82e){const _0x57efa9=_0x5071b4,_0x353a59={'naVBn':_0x57efa9(0xec)},_0x5cfc48=join(_0x25f82e,_0x57efa9(0xac)),_0x52f151='\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(_0x5cfc48,_0x52f151),console[_0x57efa9(0x9e)](_0x353a59[_0x57efa9(0xf4)]);}export async function ensureLocalEnv(_0x217f87,_0x38dbd4){const _0x45181f=_0x5071b4,_0x1847d7={'MDUYk':function(_0x59f2f7){return _0x59f2f7();},'HkZSG':function(_0x3471a0,_0x55dfb0){return _0x3471a0!==_0x55dfb0;},'qOtiC':_0x45181f(0xde),'zsppW':'⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','rJipg':function(_0x25db7f){return _0x25db7f();},'vtlOh':'local','jOJTI':function(_0x2b7b89,_0x115a80,_0x9fb389,_0xbe72d8){return _0x2b7b89(_0x115a80,_0x9fb389,_0xbe72d8);},'jksyd':_0x45181f(0xcf),'TcqLQ':function(_0xebee52,_0x4b1d4a){return _0xebee52 instanceof _0x4b1d4a;}};if(!_0x1847d7['MDUYk'](findGitRoot)&&_0x1847d7['HkZSG'](_0x217f87?.['scope'],_0x1847d7['qOtiC']))return console['log'](_0x1847d7['zsppW']),{'ready':![],'skipped':!![]};const _0x41eeae=_0x217f87?.['scope']===_0x45181f(0xde)?_0x1847d7['rJipg'](getRangerHomeDir):undefined;if(findExistingEnv(_0x1847d7[_0x45181f(0xd8)],{'locations':[_0x1847d7[_0x45181f(0xd8)]],'rangerDir':_0x41eeae}))return console['log']('✓\x20Local\x20profile\x20already\x20exists'),{'ready':!![],'skipped':![]};try{return await _0x1847d7['jOJTI'](addEnv,'local',{'url':_0x217f87?.[_0x45181f(0xa1)],'force':_0x217f87?.['force'],'allowInsecureLocalhost':_0x217f87?.[_0x45181f(0xd0)],'scope':_0x217f87?.['scope']},_0x38dbd4),{'ready':!![],'skipped':![]};}catch(_0x38d814){return console[_0x45181f(0xdc)](_0x1847d7['jksyd'],_0x1847d7['TcqLQ'](_0x38d814,Error)?_0x38d814[_0x45181f(0xf5)]:_0x38d814),{'ready':![],'skipped':![]};}}export async function start(_0x44f8e0,_0xe22092,_0x5a1ef9){const _0x1168ef=_0x5071b4,_0x5764b7={'QxCpq':'user','PgtdA':function(_0x118c1b,_0x364eaf){return _0x118c1b(_0x364eaf);},'cipvg':function(_0x333a50){return _0x333a50();},'CfZEL':_0x1168ef(0xd6),'SzAzr':_0x1168ef(0xe5),'oRKpd':function(_0x5d9449,_0x4984dd){return _0x5d9449(_0x4984dd);},'Jntlh':'✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','vyjse':'chromium','IdPEo':'\x0a✅\x20Ranger\x20setup\x20complete!\x0a','NwUiA':_0x1168ef(0xb9),'HqZxD':function(_0x43012d,_0x5a9429){return _0x43012d(_0x5a9429);},'cQQqe':function(_0x378339,_0x445a12){return _0x378339&&_0x445a12;},'CQPsA':'skills','QKGIC':function(_0x147c55,_0x14ec06,_0x4e2dad){return _0x147c55(_0x14ec06,_0x4e2dad);},'Dyjpl':_0x1168ef(0x98),'PVVaw':_0x1168ef(0xfc),'sSfgC':function(_0x46d90c,_0x330524){return _0x46d90c instanceof _0x330524;},'kUDzj':function(_0x3be144,_0x4c4e94){return _0x3be144(_0x4c4e94);},'TZpET':_0x1168ef(0xa4),'UlGEN':function(_0x5a0704,_0x3c203d,_0x2ae8ea){return _0x5a0704(_0x3c203d,_0x2ae8ea);},'VDkpv':'profile','FeKAB':_0x1168ef(0xc6),'gsylj':_0x1168ef(0xfa),'fXgbY':'with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','OdvpU':_0x1168ef(0xe7),'oBgEc':function(_0x8bd2eb,_0x490721){return _0x8bd2eb+_0x490721;}};console[_0x1168ef(0x9e)](_0x1168ef(0xaa));_0xe22092?.['scope']!==undefined&&_0xe22092['scope']!==_0x5764b7['QxCpq']&&(console[_0x1168ef(0xdc)]('ranger\x20setup\x20--scope='+String(_0xe22092['scope'])+_0x1168ef(0xd9)+_0x1168ef(0xc5)+_0x1168ef(0xb8)),process[_0x1168ef(0xfd)](0x1));_0xe22092={..._0xe22092,'scope':_0x1168ef(0xde)};const _0x4ab3f4=!_0x5764b7[_0x1168ef(0xfe)](existsSync,_0x5764b7[_0x1168ef(0xb3)](getRangerHomeDir));await ensureRangerDir(_0x1168ef(0xde));if(_0xe22092?.['skipAuth'])console['log']('✓\x20Skipping\x20authentication\x20(--skip-auth)'),_0x5a1ef9?.['trackPhaseEnd'](_0x1168ef(0xe5),{'isFirstRun':_0x4ab3f4,'method':_0x5764b7[_0x1168ef(0xeb)]});else{_0x5a1ef9?.[_0x1168ef(0xdd)](_0x5764b7['SzAzr']);const _0x427694=await _0x5764b7[_0x1168ef(0x9c)](authenticate,_0x44f8e0);_0x5a1ef9?.['trackPhaseEnd'](_0x5764b7['SzAzr'],{'isFirstRun':_0x4ab3f4,'method':_0x427694['method']});}_0x5a1ef9?.[_0x1168ef(0xdd)](_0x1168ef(0xcd));_0xe22092?.['skipChromium']?console['log'](_0x5764b7['Jntlh']):await _0x5764b7['PgtdA'](ensureChromium,_0xe22092?.['withDeps']);_0x5a1ef9?.['trackPhaseEnd'](_0x5764b7['vyjse'],{'isFirstRun':_0x4ab3f4,'skipped':!!_0xe22092?.[_0x1168ef(0xdb)]}),console['log'](_0x5764b7['IdPEo']);const _0x3b113d=_0xe22092?.['scope'],_0x4510d4=_0xe22092?.[_0x1168ef(0xfc)]??![];let _0x5b5fc8=null;_0x4510d4?(_0x5a1ef9?.['trackPhaseStart'](_0x5764b7['NwUiA']),_0x5b5fc8=await ensureOpencodePluginConfig(_0x3b113d),_0x5a1ef9?.[_0x1168ef(0xf0)](_0x5764b7[_0x1168ef(0xc9)],{'isFirstRun':_0x4ab3f4,'opencode':!![]})):(_0x5a1ef9?.['trackPhaseStart'](_0x1168ef(0xb9)),await _0x5764b7[_0x1168ef(0xf1)](ensureClaudePlugin,_0x3b113d),_0x5a1ef9?.[_0x1168ef(0xf0)]('plugin',{'isFirstRun':_0x4ab3f4}));if(_0x5764b7[_0x1168ef(0xf8)](_0x4510d4,_0x5b5fc8)){_0x5a1ef9?.['trackPhaseStart'](_0x5764b7['CQPsA']);try{await _0x5764b7[_0x1168ef(0xd7)](installSkill,_0x5764b7['Dyjpl'],{'level':_0x5b5fc8[_0x1168ef(0xc4)],'cliVersion':getCurrentVersion(),'platform':_0x5764b7['PVVaw']}),_0x5a1ef9?.[_0x1168ef(0xf0)](_0x5764b7[_0x1168ef(0xa0)],{'isFirstRun':_0x4ab3f4,'opencode':!![]});}catch(_0x1cff47){console[_0x1168ef(0x9a)](_0x1168ef(0xdf),_0x5764b7['sSfgC'](_0x1cff47,Error)?_0x1cff47[_0x1168ef(0xf5)]:_0x1cff47),_0x5a1ef9?.[_0x1168ef(0xf0)](_0x5764b7['CQPsA'],{'isFirstRun':_0x4ab3f4,'opencode':!![],'failed':!![]});}}else _0x5a1ef9?.['trackPhaseStart']('skills'),await _0x5764b7[_0x1168ef(0xea)](ensureClaudeSkills,_0x3b113d),_0x5a1ef9?.[_0x1168ef(0xf0)](_0x5764b7['CQPsA'],{'isFirstRun':_0x4ab3f4});if(_0xe22092?.['skipAuth'])console['log'](_0x5764b7['TZpET']);else{if(_0xe22092?.[_0x1168ef(0xa1)]){_0x5a1ef9?.[_0x1168ef(0xdd)]('profile');const _0x27d255=await _0x5764b7['UlGEN'](ensureLocalEnv,{'url':_0xe22092[_0x1168ef(0xa1)],'force':_0xe22092?.['force'],'allowInsecureLocalhost':_0xe22092?.[_0x1168ef(0xd0)],'scope':_0x5764b7['QxCpq']},_0x5a1ef9);_0x5a1ef9?.[_0x1168ef(0xf0)](_0x5764b7[_0x1168ef(0xa2)],{'isFirstRun':_0x4ab3f4,'profileReady':_0x27d255['ready'],'userSkipped':_0x27d255[_0x1168ef(0xd6)]});}else console[_0x1168ef(0x9e)]('\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:'+(_0x1168ef(0xe8)+_0x5764b7[_0x1168ef(0xfe)](bold,_0x5764b7['FeKAB']))+'\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)'+'\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:'+_0x1168ef(0xe3));}if(_0x4510d4)console[_0x1168ef(0x9e)](_0x5764b7['gsylj']),console['log'](_0x1168ef(0xc1)),console[_0x1168ef(0x9e)](_0x5764b7['fXgbY']),console['log'](_0x5764b7['OdvpU']);else{const _0x2075c1=bold(_0x1168ef(0x9b));console['log'](_0x5764b7['oBgEc'](_0x5764b7['oBgEc'](_0x1168ef(0xad)+_0x2075c1+'\x20and\x20prompt\x20the\x20coding','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with'),_0x1168ef(0xa3))+_0x1168ef(0xf7));}}
1
+ const _0x47b65a=_0x8395;(function(_0x2f71f6,_0x1b8b32){const _0x27d300=_0x8395,_0x2868e7=_0x2f71f6();while(!![]){try{const _0xd4ae76=parseInt(_0x27d300(0x22f))/0x1+parseInt(_0x27d300(0x222))/0x2*(-parseInt(_0x27d300(0x1e4))/0x3)+parseInt(_0x27d300(0x1f5))/0x4+parseInt(_0x27d300(0x1fa))/0x5*(-parseInt(_0x27d300(0x1e7))/0x6)+-parseInt(_0x27d300(0x1e3))/0x7*(-parseInt(_0x27d300(0x21a))/0x8)+parseInt(_0x27d300(0x1f9))/0x9+parseInt(_0x27d300(0x230))/0xa*(parseInt(_0x27d300(0x233))/0xb);if(_0xd4ae76===_0x1b8b32)break;else _0x2868e7['push'](_0x2868e7['shift']());}catch(_0x4c66a4){_0x2868e7['push'](_0x2868e7['shift']());}}}(_0x5280,0xa1362));import{mkdir,writeFile}from'fs/promises';import{join}from'path';function _0x5280(){const _0x18a596=['chromium','\x0a⚠\x20Skipping\x20Chromium\x20installation.','\x0aIn\x20Claude\x20Code,\x20run\x20','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','isTTY','message','withDeps','yvfPM','\x0aInstalling\x20Chromium\x20browser...\x0a','Cwhsb','platform','✓\x20Skipping\x20authentication\x20(--skip-auth)','hSqUS','nHYFj','env','status','\x0a\x20\x20','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','808kjBeTf','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','skipChromium','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','QJTkN','warn','npx','402778Bwgxbm','cMsEX','.gitignore','mMnDi','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','scope','OfgzU','✓\x20Created\x20~/.ranger/\x20directory','✓\x20Authenticated\x20to\x20','plugin','success','BrrFf','OyIJQ','89923vHxQAE','1930opeVYO','NuUiD','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','16731GFAzls','\x20(fallback\x20version)','Validating\x20API\x20token...','device_auth','ranger','user','GuSqV','confirm','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','...','install','trackPhaseStart','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','skills','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','profile','organizationName','\x20is\x20no\x20longer\x20supported.\x20','auth','allowInsecureLocalhost','pOnum','19621DnQzWu','9mwKJVe','resolve','XbEin','302532pGCozb','\x20now?','\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','executablePath','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','BAQse','You\x20can\x20install\x20it\x20manually\x20by\x20running:','MHNED','url','inherit','\x1b[0m','✓\x20Stored\x20credentials\x20locally','\x0a🚀\x20Ranger\x20Setup\x0a','trackPhaseEnd','1934336ccbCpP','FdaQr','VQxST','fmBKz','6928308AozxnB','65IGopjc','skipAuth','Authentication\x20failed:\x20','error','log','nVLqu','close','skipped','vVzxU','✓\x20Playwright\x20Chromium\x20browser\x20found','mxmZM','Zipox','zOwTI','force'];_0x5280=function(){return _0x18a596;};return _0x5280();}import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x4a7d50 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';function _0x8395(_0x1cb0c9,_0x5c5c5a){_0x1cb0c9=_0x1cb0c9-0x1e2;const _0x528045=_0x5280();let _0x83957=_0x528045[_0x1cb0c9];return _0x83957;}import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.58.2';const bold=_0x23322b=>'\x1b[1m'+_0x23322b+_0x47b65a(0x1f1);export function getPlaywrightVersion(){const _0x4c762a=_0x47b65a,_0x56b27d={'BAQse':'playwright/package.json'};try{const _0x720114=require[_0x4c762a(0x1e5)](_0x56b27d[_0x4c762a(0x1ec)]),_0x31c750=require(_0x720114);return _0x31c750['version'];}catch{return null;}}export function installChromiumBinary(_0x1e2360,_0xf582b1=![]){const _0x287b9c=_0x47b65a,_0x3d17ab={'yRqde':function(_0x8cd30d){return _0x8cd30d();},'zJZrY':_0x287b9c(0x208),'mxmZM':function(_0x4689b0,_0x47a722,_0x187c17,_0x157828){return _0x4689b0(_0x47a722,_0x187c17,_0x157828);},'OfgzU':'win32'};return new Promise((_0x3bcbf5,_0x4936f7)=>{const _0x240ec2=_0x287b9c,_0x1bc49d={'dQFRG':function(_0x23f2e8,_0x33c883){return _0x23f2e8(_0x33c883);}},_0x194a91=['playwright@'+_0x1e2360,'install',..._0xf582b1?['--with-deps']:[],_0x3d17ab['zJZrY']],_0x22af81=_0x3d17ab[_0x240ec2(0x204)](spawn,_0x240ec2(0x221),_0x194a91,{'stdio':['ignore',_0x240ec2(0x1f0),_0x240ec2(0x1f0)],'shell':process[_0x240ec2(0x212)]===_0x3d17ab[_0x240ec2(0x228)]});_0x22af81['on'](_0x240ec2(0x200),_0x36449d=>{_0x36449d===0x0?_0x3d17ab['yRqde'](_0x3bcbf5):_0x4936f7(new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x36449d));}),_0x22af81['on']('error',_0x55f8f3=>{_0x1bc49d['dQFRG'](_0x4936f7,_0x55f8f3);});});}export async function authenticate(_0x3f6ec5){const _0x46af64=_0x47b65a,_0x6cbdf3={'IHfzB':function(_0x3c2e67,_0x1f4aaa){return _0x3c2e67(_0x1f4aaa);},'SGMqr':'existing_token','nVLqu':function(_0x43208a,_0x30a21a){return _0x43208a(_0x30a21a);},'fGGqN':_0x46af64(0x1f2),'OyIJQ':'provided_token'};if(!_0x3f6ec5){const _0x2c1a57=await getToken();if(_0x2c1a57){const _0x4b2450=await _0x6cbdf3['IHfzB'](getCurrentUser,_0x2c1a57);if(_0x4b2450[_0x46af64(0x22c)])return console['log']('✓\x20Already\x20authenticated\x20to\x20'+_0x4b2450[_0x46af64(0x238)][_0x46af64(0x245)]),{'token':_0x2c1a57,'method':_0x6cbdf3['SGMqr']};}try{_0x3f6ec5=await runDeviceAuthFlow();}catch(_0x5921a4){throw new Error('Authentication\x20failed:\x20'+(_0x5921a4 instanceof Error?_0x5921a4[_0x46af64(0x20d)]:_0x5921a4));}const _0x108aad=await _0x6cbdf3[_0x46af64(0x1ff)](getCurrentUser,_0x3f6ec5);if(!_0x108aad['success'])throw new Error(_0x46af64(0x21e)+_0x108aad[_0x46af64(0x1fd)]);return console['log']('✓\x20Authenticated\x20to\x20'+_0x108aad['user']['organizationName']),{'token':_0x3f6ec5,'method':_0x46af64(0x236)};}console['log'](_0x46af64(0x235));const _0x499558=await getCurrentUser(_0x3f6ec5);if(!_0x499558[_0x46af64(0x22c)]){if(_0x499558[_0x46af64(0x217)])throw new Error(_0x46af64(0x1fc)+_0x499558[_0x46af64(0x1fd)]+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x499558[_0x46af64(0x1fd)]+_0x46af64(0x23b));}return console['log'](_0x46af64(0x22a)+_0x499558[_0x46af64(0x238)]['organizationName']),await _0x6cbdf3['nVLqu'](storeToken,_0x3f6ec5),console[_0x46af64(0x1fe)](process[_0x46af64(0x216)]['GITHUB_ENV']?'✓\x20Exported\x20credentials\x20for\x20CI':_0x6cbdf3['fGGqN']),{'token':_0x3f6ec5,'method':_0x6cbdf3[_0x46af64(0x22e)]};}export async function ensureRangerDir(_0x5e8442){const _0x2326ac=_0x47b65a,_0x4b0a5c={'yvfPM':function(_0x297134,_0x2299b5){return _0x297134(_0x2299b5);},'XEcgA':_0x2326ac(0x229)};void _0x5e8442;const _0x2cc476=getRangerHomeDir();return!_0x4b0a5c[_0x2326ac(0x20f)](existsSync,_0x2cc476)?(await mkdir(_0x2cc476,{'recursive':!![]}),console['log'](_0x4b0a5c['XEcgA']),{'path':_0x2cc476,'installed':!![]}):(console[_0x2326ac(0x1fe)]('✓\x20~/.ranger/\x20directory\x20already\x20exists'),{'path':_0x2cc476,'installed':![]});}export async function ensureChromium(_0x131766=![]){const _0x3025dc=_0x47b65a,_0x2175a7={'zOwTI':function(_0x384812,_0x351631){return _0x384812(_0x351631);},'Cwhsb':_0x3025dc(0x23a),'NMhhs':_0x3025dc(0x234),'KVaqj':function(_0xa33eee,_0x2ca7c6,_0x483034){return _0xa33eee(_0x2ca7c6,_0x483034);},'vVzxU':_0x3025dc(0x1ed),'BrrFf':_0x3025dc(0x209),'jxOXt':'You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'};let _0x3d95e5=![];try{const _0x44b422=chromium[_0x3025dc(0x1ea)]();_0x3d95e5=_0x2175a7[_0x3025dc(0x206)](existsSync,_0x44b422);}catch{_0x3d95e5=![];}if(_0x3d95e5)return console[_0x3025dc(0x1fe)](_0x3025dc(0x203)),![];const _0x18356b=getPlaywrightVersion(),_0x2c0de0=_0x18356b??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x43ea94=!_0x18356b,_0x28897f=process['stdin'][_0x3025dc(0x20c)]&&process['stdout']['isTTY'];let _0x495302=!![];if(_0x28897f){const {install:_0x14deef}=await _0x4a7d50['prompt']([{'type':_0x2175a7[_0x3025dc(0x211)],'name':_0x3025dc(0x23f),'message':_0x43ea94?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x2c0de0+_0x3025dc(0x1e8):'The\x20required\x20version\x20('+_0x2c0de0+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x495302=_0x14deef;}else console[_0x3025dc(0x1fe)]('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x2c0de0+(_0x43ea94?_0x2175a7['NMhhs']:'')+_0x3025dc(0x23e));if(_0x495302){console[_0x3025dc(0x1fe)](_0x3025dc(0x210));try{await _0x2175a7['KVaqj'](installChromiumBinary,_0x2c0de0,_0x131766),console[_0x3025dc(0x1fe)](_0x3025dc(0x23c));}catch(_0x298214){console['error']('\x0a❌\x20Failed\x20to\x20install\x20Chromium:',_0x298214 instanceof Error?_0x298214['message']:_0x298214),console['log'](_0x2175a7[_0x3025dc(0x202)]),console[_0x3025dc(0x1fe)]('\x20\x20npx\x20playwright@'+_0x2c0de0+'\x20install\x20chromium');}}else console['log'](_0x2175a7[_0x3025dc(0x22d)]),console['log'](_0x2175a7['jxOXt']),console[_0x3025dc(0x1fe)]('\x20\x20npx\x20playwright@'+_0x2c0de0+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x29e4e1){const _0x2e2cfc=_0x47b65a,_0x379d46={'zaHjs':function(_0x22cce,_0x4a1670,_0x5ccebe){return _0x22cce(_0x4a1670,_0x5ccebe);}},_0x37fb98=_0x379d46['zaHjs'](join,_0x29e4e1,_0x2e2cfc(0x224)),_0x478510='\x0a\x0a#\x20Ignore\x20local-only\x20directories\x0alocal/\x0asessions/\x0abug-bashes/\x0areports/\x0afeedback-images/\x0a\x0aactive-profile.txt\x0aactive-feature.txt\x0a.gitignore\x0a\x0a#\x20Ignore\x20plaintext\x20auth\x20files\x20(encrypted\x20.enc\x20files\x20are\x20safe\x20to\x20commit)\x0a**/auth.json\x0a';await writeFile(_0x37fb98,_0x478510),console[_0x2e2cfc(0x1fe)]('✓\x20Created\x20.ranger/.gitignore');}export async function ensureLocalEnv(_0xe44787,_0xc555cf){const _0x5ad5cb=_0x47b65a,_0x54b0ab={'kowXp':function(_0x253254){return _0x253254();},'hSqUS':function(_0x1b6815,_0x5d4b28){return _0x1b6815!==_0x5d4b28;},'NuUiD':'user','QfpSp':_0x5ad5cb(0x23d),'nHYFj':'local'};if(!_0x54b0ab['kowXp'](findGitRoot)&&_0x54b0ab[_0x5ad5cb(0x214)](_0xe44787?.[_0x5ad5cb(0x227)],_0x54b0ab[_0x5ad5cb(0x231)]))return console['log'](_0x54b0ab['QfpSp']),{'ready':![],'skipped':!![]};const _0x32a6d6=_0xe44787?.[_0x5ad5cb(0x227)]==='user'?getRangerHomeDir():undefined;if(findExistingEnv(_0x54b0ab[_0x5ad5cb(0x215)],{'locations':['local'],'rangerDir':_0x32a6d6}))return console['log']('✓\x20Local\x20profile\x20already\x20exists'),{'ready':!![],'skipped':![]};try{return await addEnv('local',{'url':_0xe44787?.['url'],'force':_0xe44787?.['force'],'allowInsecureLocalhost':_0xe44787?.[_0x5ad5cb(0x248)],'scope':_0xe44787?.[_0x5ad5cb(0x227)]},_0xc555cf),{'ready':!![],'skipped':![]};}catch(_0x5107de){return console[_0x5ad5cb(0x1fd)]('\x0a❌\x20Profile\x20setup\x20failed:',_0x5107de instanceof Error?_0x5107de[_0x5ad5cb(0x20d)]:_0x5107de),{'ready':![],'skipped':![]};}}export async function start(_0x454a8d,_0x45fd3d,_0x14d39f){const _0x5d7c74=_0x47b65a,_0x47a152={'FdaQr':function(_0x474a13,_0x11273){return _0x474a13!==_0x11273;},'VQxST':function(_0x31f1f6,_0x20b65d){return _0x31f1f6+_0x20b65d;},'Zipox':function(_0x13947b,_0x5c8308){return _0x13947b(_0x5c8308);},'XbEin':_0x5d7c74(0x213),'mMnDi':_0x5d7c74(0x247),'UrwvY':'chromium','jNplB':'✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','RLDMv':function(_0x20f3f3,_0x152255){return _0x20f3f3(_0x152255);},'fmBKz':_0x5d7c74(0x22b),'QJTkN':function(_0x3647c4,_0x3ec42d){return _0x3647c4(_0x3ec42d);},'pOnum':_0x5d7c74(0x242),'cMsEX':function(_0x15bd47,_0x589751,_0x25e3e9){return _0x15bd47(_0x589751,_0x25e3e9);},'KNzin':function(_0xe8c003,_0x2af1b9){return _0xe8c003(_0x2af1b9);},'eKdsq':_0x5d7c74(0x241),'LUgZC':function(_0xc52a03,_0x573448,_0x500a1c){return _0xc52a03(_0x573448,_0x500a1c);},'uuCUP':_0x5d7c74(0x238),'vDuEO':function(_0x52e0f6,_0x52de50){return _0x52e0f6+_0x52de50;},'GuSqV':function(_0x45d057,_0x3a3536){return _0x45d057+_0x3a3536;},'OlBUT':_0x5d7c74(0x232),'MHNED':function(_0x446c01,_0x23b477){return _0x446c01+_0x23b477;}};console['log'](_0x5d7c74(0x1f3));_0x45fd3d?.['scope']!==undefined&&_0x47a152[_0x5d7c74(0x1f6)](_0x45fd3d['scope'],_0x5d7c74(0x238))&&(console[_0x5d7c74(0x1fd)](_0x47a152['VQxST']('ranger\x20setup\x20--scope='+_0x47a152[_0x5d7c74(0x205)](String,_0x45fd3d['scope'])+_0x5d7c74(0x246),_0x5d7c74(0x20b))+'project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.'),process['exit'](0x1));_0x45fd3d={..._0x45fd3d,'scope':'user'};const _0x35afaa=!existsSync(getRangerHomeDir());await _0x47a152[_0x5d7c74(0x205)](ensureRangerDir,'user');if(_0x45fd3d?.[_0x5d7c74(0x1fb)])console['log'](_0x47a152[_0x5d7c74(0x1e6)]),_0x14d39f?.['trackPhaseEnd'](_0x47a152[_0x5d7c74(0x225)],{'isFirstRun':_0x35afaa,'method':'skipped'});else{_0x14d39f?.['trackPhaseStart'](_0x47a152[_0x5d7c74(0x225)]);const _0x2cf1dc=await _0x47a152['Zipox'](authenticate,_0x454a8d);_0x14d39f?.[_0x5d7c74(0x1f4)]('auth',{'isFirstRun':_0x35afaa,'method':_0x2cf1dc['method']});}_0x14d39f?.[_0x5d7c74(0x240)](_0x47a152['UrwvY']);_0x45fd3d?.[_0x5d7c74(0x21c)]?console['log'](_0x47a152['jNplB']):await _0x47a152['RLDMv'](ensureChromium,_0x45fd3d?.[_0x5d7c74(0x20e)]);_0x14d39f?.['trackPhaseEnd'](_0x5d7c74(0x208),{'isFirstRun':_0x35afaa,'skipped':!!_0x45fd3d?.['skipChromium']}),console[_0x5d7c74(0x1fe)](_0x5d7c74(0x219));const _0x49abc9=_0x45fd3d?.[_0x5d7c74(0x227)],_0x312eec=_0x45fd3d?.['opencode']??![];let _0x4a977e=null;_0x312eec?(_0x14d39f?.[_0x5d7c74(0x240)](_0x47a152[_0x5d7c74(0x1f8)]),_0x4a977e=await _0x47a152[_0x5d7c74(0x21f)](ensureOpencodePluginConfig,_0x49abc9),_0x14d39f?.[_0x5d7c74(0x1f4)]('plugin',{'isFirstRun':_0x35afaa,'opencode':!![]})):(_0x14d39f?.['trackPhaseStart']('plugin'),await ensureClaudePlugin(_0x49abc9),_0x14d39f?.[_0x5d7c74(0x1f4)](_0x47a152['fmBKz'],{'isFirstRun':_0x35afaa}));if(_0x312eec&&_0x4a977e){_0x14d39f?.[_0x5d7c74(0x240)](_0x47a152['pOnum']);try{await _0x47a152[_0x5d7c74(0x223)](installSkill,_0x5d7c74(0x237),{'level':_0x4a977e[_0x5d7c74(0x227)],'cliVersion':getCurrentVersion(),'platform':'opencode'}),_0x14d39f?.[_0x5d7c74(0x1f4)](_0x47a152['pOnum'],{'isFirstRun':_0x35afaa,'opencode':!![]});}catch(_0x8a4494){console[_0x5d7c74(0x220)](_0x5d7c74(0x21d),_0x8a4494 instanceof Error?_0x8a4494[_0x5d7c74(0x20d)]:_0x8a4494),_0x14d39f?.[_0x5d7c74(0x1f4)]('skills',{'isFirstRun':_0x35afaa,'opencode':!![],'failed':!![]});}}else _0x14d39f?.[_0x5d7c74(0x240)](_0x47a152[_0x5d7c74(0x1e2)]),await _0x47a152['KNzin'](ensureClaudeSkills,_0x49abc9),_0x14d39f?.[_0x5d7c74(0x1f4)]('skills',{'isFirstRun':_0x35afaa});if(_0x45fd3d?.['skipAuth'])console['log'](_0x47a152['eKdsq']);else{if(_0x45fd3d?.['url']){_0x14d39f?.[_0x5d7c74(0x240)](_0x5d7c74(0x244));const _0x9d7344=await _0x47a152['LUgZC'](ensureLocalEnv,{'url':_0x45fd3d[_0x5d7c74(0x1ef)],'force':_0x45fd3d?.[_0x5d7c74(0x207)],'allowInsecureLocalhost':_0x45fd3d?.[_0x5d7c74(0x248)],'scope':_0x47a152['uuCUP']},_0x14d39f);_0x14d39f?.[_0x5d7c74(0x1f4)](_0x5d7c74(0x244),{'isFirstRun':_0x35afaa,'profileReady':_0x9d7344['ready'],'userSkipped':_0x9d7344[_0x5d7c74(0x201)]});}else console[_0x5d7c74(0x1fe)](_0x47a152['vDuEO'](_0x47a152['VQxST'](_0x47a152[_0x5d7c74(0x239)](_0x5d7c74(0x1eb)+(_0x5d7c74(0x218)+bold('ranger\x20profile\x20add\x20<name>')),_0x5d7c74(0x1e9)),'\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:'),_0x5d7c74(0x226)));}if(_0x312eec)console['log'](_0x47a152['OlBUT']),console['log']('and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review'),console[_0x5d7c74(0x1fe)](_0x5d7c74(0x21b)),console['log']('verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.');else{const _0x415596=bold('/ranger:enable');console[_0x5d7c74(0x1fe)](_0x47a152[_0x5d7c74(0x1f7)](_0x47a152['vDuEO'](_0x47a152[_0x5d7c74(0x1ee)](_0x5d7c74(0x20a)+_0x415596+'\x20and\x20prompt\x20the\x20coding',_0x5d7c74(0x243)),'\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'),'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.'));}}
@@ -1 +1 @@
1
- const _0x50e73a=_0x17d5;(function(_0x50bac9,_0x31a000){const _0x36dd0e=_0x17d5,_0xe4db85=_0x50bac9();while(!![]){try{const _0xa3e6d6=parseInt(_0x36dd0e(0xef))/0x1*(parseInt(_0x36dd0e(0xcf))/0x2)+parseInt(_0x36dd0e(0xbb))/0x3+-parseInt(_0x36dd0e(0xec))/0x4+-parseInt(_0x36dd0e(0xa9))/0x5+-parseInt(_0x36dd0e(0xdf))/0x6+parseInt(_0x36dd0e(0x9e))/0x7+-parseInt(_0x36dd0e(0xe9))/0x8*(-parseInt(_0x36dd0e(0xb6))/0x9);if(_0xa3e6d6===_0x31a000)break;else _0xe4db85['push'](_0xe4db85['shift']());}catch(_0x224d0e){_0xe4db85['push'](_0xe4db85['shift']());}}}(_0x5988,0x19e5f));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';function _0x5988(){const _0x4c70e7=['\x20\x20\x20\x20Auth:\x20','settings.json','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','VGsez','\x0a---\x20Claude\x20Code\x20Plugin\x20---','DEBUG','QEnCx','isDirectory','GYPWl','BrmTw','\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a','hasPlaintextAuth','\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)','trim','nAGhI','toString','krfDh','1094XLUVFm','\x20\x20Not\x20configured','ranger@trailhead','muywj','env','\x0a\x20\x20No\x20active\x20profile\x20set','API\x20Token:\x20✗\x20Not\x20found','pipe','\x20[local]','plugin','\x20(latest:\x20','scope','MEKTY','\x20\x20User-level:','\x20local','LyZSQ','608190xETKZk','UYmXS','tBvoR','hasEncryptedAuth','vTJMa','no\x20session','ulrze','\x20\x20Project-level:','log','\x1b[0m','32720vQnzAx','cached\x20(updated\x20','filter','618396sIfeKh','\x20(up\x20to\x20date)','not_configured','31nKNSzX','AihiS','\x20\x20Run:\x20ranger\x20update','Tyxlj','user','ZXLhd',':\x20installed\x20(','includes','\x0a---\x20Profiles\x20---','data','\x20\x20Run:\x20ranger\x20setup\x20--opencode','length','SKILL.md','mxwTJ','\x20\x20Run:\x20ranger\x20setup\x20[token]','cwd','\x0a---\x20OpenCode\x20Plugin\x20---','AxiMm','\x20plugin(s)\x20configured','opencode','organizationName','Organization:\x20','path','displayName','(not\x20found)','AuPQa','match','Version:\x20','LzSmF','close','1271907fXQrtV','parse','iDCIk','vhOtl','ABcKp','map','sessionUpdatedAt','\x20[cloud]','\x20cloud','Groro','enabled','323685SnNLaP','configured','has','GjcpK','vnRRk','debug','push','version','\x20\x20Not\x20installed','\x20profiles\x20configured\x20(','oIxjz','uLLMi','fnQQZ','450mACmKg','UgXaS','name','API\x20Environment:\x20','\x20\x20Active:\x20','70866aUahkq','status'];_0x5988=function(){return _0x4c70e7;};return _0x5988();}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';function _0x17d5(_0x2fddc6,_0x157cf8){_0x2fddc6=_0x2fddc6-0x95;const _0x598886=_0x5988();let _0x17d537=_0x598886[_0x2fddc6];return _0x17d537;}const bold=_0x4e2489=>'\x1b[1m'+_0x4e2489+_0x50e73a(0xe8),link=(_0x1fdf95,_0x243c40)=>'\x1b]8;;file://'+_0x1fdf95+'\x07'+(_0x243c40||_0x1fdf95)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x517c55=_0x50e73a,_0x5d469b={'LzSmF':'not_installed','mxwTJ':function(_0x4328b9,_0x6707f){return _0x4328b9(_0x6707f);},'pDFhe':function(_0x3be071,_0x145d5b){return _0x3be071>_0x145d5b;},'DiYSt':function(_0x308fec,_0x4f160e){return _0x308fec(_0x4f160e);},'poeSV':'string','GjcpK':_0x517c55(0xae),'vTJMa':'config','Tyxlj':'ignore','UgXaS':_0x517c55(0xd6),'GYPWl':_0x517c55(0xf8),'AihiS':_0x517c55(0x9d)};return new Promise(_0x3e15f9=>{const _0x3b4a6d=_0x517c55,_0xa06055={'rlNDG':function(_0x30819f,_0x5e47a7){return _0x30819f(_0x5e47a7);},'FNAff':_0x5d469b[_0x3b4a6d(0x9c)],'weXso':_0x5d469b['poeSV']},_0x3c874a=spawn(_0x3b4a6d(0x102),[_0x5d469b[_0x3b4a6d(0xac)],_0x5d469b[_0x3b4a6d(0xe3)]],{'stdio':[_0x5d469b[_0x3b4a6d(0xf2)],_0x5d469b[_0x3b4a6d(0xb7)],_0x5d469b[_0x3b4a6d(0xb7)]]});let _0x9915d1='';_0x3c874a['stdout']?.['on'](_0x5d469b[_0x3b4a6d(0xc6)],_0x2b0225=>{_0x9915d1+=_0x2b0225['toString']();}),_0x3c874a['stderr']?.['on'](_0x5d469b[_0x3b4a6d(0xc6)],_0x392ac6=>{const _0x548d46=_0x3b4a6d;_0x9915d1+=_0x392ac6[_0x548d46(0xcd)]();}),_0x3c874a['on']('error',()=>{_0xa06055['rlNDG'](_0x3e15f9,{'status':_0xa06055['FNAff']});}),_0x3c874a['on'](_0x5d469b[_0x3b4a6d(0xf0)],_0x188ded=>{const _0x1de884=_0x3b4a6d;if(_0x188ded!==0x0){_0x3e15f9({'status':_0x5d469b['LzSmF']});return;}const _0x431a9d=_0x9915d1[_0x1de884(0xcb)]();let _0x2195cf=null;if(_0x431a9d)try{_0x2195cf=JSON[_0x1de884(0x9f)](_0x431a9d);}catch{const _0x41d74c=_0x431a9d[_0x1de884(0x9a)](/\{[\s\S]*\}$/);if(_0x41d74c)try{_0x2195cf=JSON['parse'](_0x41d74c[0x0]);}catch{_0x2195cf=null;}}const _0x4a572b=Array['isArray'](_0x2195cf?.[_0x1de884(0xd8)])?_0x2195cf?.[_0x1de884(0xd8)]:[],_0x4f690a=_0x4a572b['some'](_0x1ea02d=>{const _0x21248c=_0x1de884;if(typeof _0x1ea02d!==_0xa06055['weXso'])return![];return _0x1ea02d[_0x21248c(0xf6)]('@ranger-testing/opencode-plugin')||_0x1ea02d['includes']('opencode-plugin');});if(_0x4f690a){_0x5d469b[_0x1de884(0xfc)](_0x3e15f9,{'status':_0x1de884(0xaa),'details':_0x5d469b['pDFhe'](_0x4a572b[_0x1de884(0xfa)],0x0)?_0x4a572b['length']+_0x1de884(0x101):undefined});return;}if(_0x5d469b['pDFhe'](_0x4a572b[_0x1de884(0xfa)],0x0)){_0x5d469b['DiYSt'](_0x3e15f9,{'status':_0x1de884(0xee),'details':_0x4a572b['length']+_0x1de884(0x101)});return;}_0x3e15f9({'status':_0x1de884(0xee)});});});}async function getSkillsFromDir(_0x5c039a,_0x2a82a1){const _0x10b153=_0x50e73a,_0x6abe21={'tBvoR':function(_0x1aa745,_0x5136ae){return _0x1aa745(_0x5136ae);},'oIxjz':function(_0x2c8b8f,_0x1b07d9,_0x319bbe){return _0x2c8b8f(_0x1b07d9,_0x319bbe);},'BrmTw':_0x10b153(0xfb),'tlFoS':'utf-8'};if(!_0x6abe21[_0x10b153(0xe1)](existsSync,_0x5c039a))return[];const _0x3e0877=[];try{const _0x1b2edd=await _0x6abe21[_0x10b153(0xb3)](readdir,_0x5c039a,{'withFileTypes':!![]});for(const _0x55044e of _0x1b2edd){if(_0x55044e[_0x10b153(0xc5)]()){const _0x3a9d00=join(_0x5c039a,_0x55044e['name'],_0x6abe21[_0x10b153(0xc7)]);if(existsSync(_0x3a9d00)){let _0x3397e0=_0x55044e['name'];try{const _0x89d04f=await readFile(_0x3a9d00,_0x6abe21['tlFoS']),_0x5c7789=_0x89d04f['match'](/name:\s*(.+)/);_0x5c7789&&(_0x3397e0=_0x5c7789[0x1]['trim']());}catch{}_0x3e0877['push']({'name':_0x55044e[_0x10b153(0xb8)],'displayName':_0x3397e0,'path':_0x3a9d00,'level':_0x2a82a1});}}}}catch{return[];}return _0x3e0877;}async function getInstalledSkills(){const _0x26ed98={'xvqZj':'project','rKtcw':function(_0x95fca8,_0x2e39df,_0x1f42b2){return _0x95fca8(_0x2e39df,_0x1f42b2);},'Fdqft':function(_0x10db7a){return _0x10db7a();}},[_0x37b261,_0x42a65b]=await Promise['all']([getSkillsFromDir(getProjectSkillsDir(),_0x26ed98['xvqZj']),_0x26ed98['rKtcw'](getSkillsFromDir,_0x26ed98['Fdqft'](getUserSkillsDir),'user')]);return{'project':_0x37b261,'user':_0x42a65b};}async function getEnvironments(){const _0x5f0c01=_0x50e73a,_0x578fbf={'vhOtl':function(_0x4c7b70,_0x2d29f3){return _0x4c7b70(_0x2d29f3);},'nAGhI':function(_0x22fcea,_0xadf5ef,_0x7ed983){return _0x22fcea(_0xadf5ef,_0x7ed983);},'nZxhj':_0x5f0c01(0xbe),'IOzZC':function(_0x20412f,_0x4c2da7){return _0x20412f(_0x4c2da7);},'VGsez':function(_0x4e1ac2){return _0x4e1ac2();}},{envNames:_0x1bfe23,activeEnv:_0x3727e3}=await _0x578fbf[_0x5f0c01(0xc1)](getEnvNames),_0x4627db=getRangerDir();if(!existsSync(_0x4627db))return{'envs':[],'activeEnv':null};const _0x2d0113=_0x1bfe23[_0x5f0c01(0xa3)](_0x51d9fa=>{const _0x4bc166=_0x5f0c01,_0x1f0005=_0x578fbf[_0x4bc166(0xa1)](getEnvDir,_0x51d9fa),_0x2fabc6=_0x578fbf[_0x4bc166(0xcc)](join,_0x1f0005,_0x578fbf['nZxhj']),_0x1dac73=join(_0x1f0005,'auth.json'),_0x2b2eca=_0x578fbf['nAGhI'](join,_0x1f0005,'auth.json.enc');return{'name':_0x51d9fa,'settingsPath':_0x578fbf['vhOtl'](existsSync,_0x2fabc6)?_0x2fabc6:_0x4bc166(0x98),'hasPlaintextAuth':existsSync(_0x1dac73),'hasEncryptedAuth':_0x578fbf['IOzZC'](existsSync,_0x2b2eca),'isActive':_0x51d9fa===_0x3727e3};});return{'envs':_0x2d0113,'activeEnv':_0x3727e3};}export async function status(){const _0x4a75e0=_0x50e73a,_0x32d95f={'QEnCx':'\x0a📊\x20Ranger\x20Status\x0a','muywj':function(_0x25da02,_0x245da8){return _0x25da02(_0x245da8);},'Groro':function(_0x283dfe,_0x275196,_0x513080){return _0x283dfe(_0x275196,_0x513080);},'ZXLhd':function(_0x44f627,_0x3945f9){return _0x44f627(_0x3945f9);},'AuPQa':function(_0x56bc5b){return _0x56bc5b();},'ulrze':function(_0x992db0,_0x490216){return _0x992db0!==_0x490216;},'gDUsT':function(_0x345972){return _0x345972();},'SwGtP':_0x4a75e0(0xaa),'AxiMm':function(_0x5cd06a,_0x14edbf){return _0x5cd06a===_0x14edbf;},'hrtBM':_0x4a75e0(0xee),'YgdjW':_0x4a75e0(0xd0),'krfDh':function(_0x42fd5c,_0x428a92){return _0x42fd5c(_0x428a92);},'UYmXS':_0x4a75e0(0xd1),'vnRRk':'unknown','SUrQf':'disabled','zIMXl':'\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','iDCIk':'\x0a---\x20Skills\x20---','etNCj':function(_0x1dd5e4,_0x2b03a7){return _0x1dd5e4>_0x2b03a7;},'QQPYC':_0x4a75e0(0xdc),'fnQQZ':_0x4a75e0(0xf7),'MEKTY':function(_0x5f18eb){return _0x5f18eb();},'uLLMi':function(_0x28cd4f,_0x322230){return _0x28cd4f+_0x322230;},'ABcKp':'No\x20profiles\x20configured','ILksC':function(_0x193d56,_0x360f66){return _0x193d56>_0x360f66;},'CUdOS':'\x20(active)','LyZSQ':function(_0x192ae8,_0x397bd3){return _0x192ae8(_0x397bd3);},'NTVpE':_0x4a75e0(0xe4),'bmNaQ':'encrypted','cTpsc':'(not\x20found)'};console['log'](_0x32d95f[_0x4a75e0(0xc4)]);const _0x5f4591=process[_0x4a75e0(0xfe)](),_0x1231c2=getRangerDir();if(!_0x32d95f['muywj'](existsSync,_0x1231c2)){console['log']('Root:\x20'+_0x32d95f[_0x4a75e0(0xa7)](link,_0x5f4591,_0x32d95f[_0x4a75e0(0xd2)](bold,basename(_0x5f4591)))),console['log'](_0x4a75e0(0xc0)),console[_0x4a75e0(0xe7)](_0x4a75e0(0xc8));return;}console[_0x4a75e0(0xe7)]('Root:\x20'+link(_0x5f4591,_0x32d95f['ZXLhd'](bold,_0x32d95f['ZXLhd'](basename,_0x5f4591))));const _0x419951=_0x32d95f[_0x4a75e0(0x99)](getCurrentVersion),_0x5e1f49=getLatestVersion();if(_0x5e1f49['version']&&_0x32d95f[_0x4a75e0(0xe5)](_0x5e1f49[_0x4a75e0(0xb0)],_0x419951))console[_0x4a75e0(0xe7)](_0x4a75e0(0x9b)+_0x419951+_0x4a75e0(0xd9)+_0x5e1f49['version']+')'),console[_0x4a75e0(0xe7)](_0x4a75e0(0xf1));else _0x5e1f49['version']?console['log']('Version:\x20'+_0x419951+_0x4a75e0(0xed)):console['log'](_0x4a75e0(0x9b)+_0x419951);const _0x4a2822=await getToken();if(_0x4a2822){const _0x90059b=await _0x32d95f[_0x4a75e0(0xd2)](getCurrentUser,_0x4a2822);_0x90059b['success']?console[_0x4a75e0(0xe7)](_0x4a75e0(0x95)+_0x32d95f[_0x4a75e0(0xf4)](bold,_0x90059b[_0x4a75e0(0xf3)][_0x4a75e0(0x103)])):(console['log'](_0x4a75e0(0xbf)),console[_0x4a75e0(0xe7)](_0x4a75e0(0xfd)));}else console['log'](_0x4a75e0(0xd5)),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]');process[_0x4a75e0(0xd3)][_0x4a75e0(0xc3)]&&(console[_0x4a75e0(0xe7)](_0x4a75e0(0xb9)+_0x32d95f['AuPQa'](getCurrentEnvironment)),console['log']('API\x20URL:\x20'+getApiBaseUrl()));console['log'](_0x4a75e0(0xff));const _0x216350=await _0x32d95f['gDUsT'](getOpencodePluginStatus);if(_0x216350['status']===_0x32d95f['SwGtP'])console['log']('\x20\x20'+bold('@ranger-testing/opencode-plugin')+':\x20configured'),_0x216350['details']&&console['log']('\x20\x20'+_0x216350['details']);else _0x32d95f[_0x4a75e0(0x100)](_0x216350[_0x4a75e0(0xbc)],_0x32d95f['hrtBM'])?(console['log'](_0x32d95f['YgdjW']),_0x216350['details']&&console[_0x4a75e0(0xe7)]('\x20\x20'+_0x216350['details']),console[_0x4a75e0(0xe7)](_0x4a75e0(0xf9))):console[_0x4a75e0(0xe7)]('\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available');console['log'](_0x4a75e0(0xc2));const _0x55579f=await _0x32d95f[_0x4a75e0(0xce)](getPluginInfo,_0x32d95f[_0x4a75e0(0xe0)]);if(_0x55579f){const _0x338a90=_0x55579f[_0x4a75e0(0xda)]||_0x32d95f[_0x4a75e0(0xad)],_0x5e98bd=_0x55579f[_0x4a75e0(0xa8)]?'enabled':_0x32d95f['SUrQf'];console[_0x4a75e0(0xe7)]('\x20\x20'+_0x32d95f['krfDh'](bold,_0x4a75e0(0xd1))+_0x4a75e0(0xf5)+_0x338a90+',\x20'+_0x5e98bd+')');}else console['log'](_0x4a75e0(0xb1)),console['log'](_0x32d95f['zIMXl']);console['log'](_0x32d95f[_0x4a75e0(0xa0)]);const {project:_0x22b6ae,user:_0xf0c510}=await _0x32d95f[_0x4a75e0(0x99)](getInstalledSkills),_0x30a236=_0x22b6ae[_0x4a75e0(0xeb)](_0x276e38=>RANGER_MANAGED_SKILLS[_0x4a75e0(0xf6)](_0x276e38['name'])),_0x3bad95=_0xf0c510['filter'](_0x1a8389=>RANGER_MANAGED_SKILLS[_0x4a75e0(0xf6)](_0x1a8389[_0x4a75e0(0xb8)])),_0x320287=_0x30a236['length']+_0x3bad95[_0x4a75e0(0xfa)];if(_0x32d95f['AxiMm'](_0x320287,0x0))console['log']('No\x20skills\x20installed'),console[_0x4a75e0(0xe7)]('\x20\x20Run:\x20ranger\x20skillup');else{if(_0x32d95f['etNCj'](_0x30a236['length'],0x0)){console['log'](_0x4a75e0(0xe6));for(const _0x275e17 of _0x30a236){console['log']('\x20\x20\x20\x20'+bold(_0x275e17['displayName'])+':\x20'+_0x32d95f[_0x4a75e0(0xa7)](link,_0x275e17['path'],_0x32d95f[_0x4a75e0(0xce)](basename,_0x275e17[_0x4a75e0(0x96)])));}}if(_0x3bad95[_0x4a75e0(0xfa)]>0x0){console['log'](_0x32d95f['QQPYC']);for(const _0x441c2a of _0x3bad95){console[_0x4a75e0(0xe7)]('\x20\x20\x20\x20'+bold(_0x441c2a[_0x4a75e0(0x97)])+':\x20'+_0x32d95f[_0x4a75e0(0xa7)](link,_0x441c2a['path'],_0x32d95f['krfDh'](basename,_0x441c2a['path'])));}}}console['log'](_0x32d95f[_0x4a75e0(0xb5)]);const {envs:_0x500df7,activeEnv:_0x369aae}=await getEnvironments();let _0xa41ca2=[];if(_0x4a2822)try{_0xa41ca2=await _0x32d95f[_0x4a75e0(0xdb)](listCloudProfiles);}catch{}const _0xf33bd2=_0x32d95f[_0x4a75e0(0xb4)](_0x500df7['length'],_0xa41ca2['length']);if(_0x32d95f[_0x4a75e0(0x100)](_0xf33bd2,0x0))console[_0x4a75e0(0xe7)](_0x32d95f[_0x4a75e0(0xa2)]),console[_0x4a75e0(0xe7)]('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{if(_0x32d95f['etNCj'](_0xf33bd2,0x5)){const _0x3a6220=[];_0x32d95f['etNCj'](_0xa41ca2['length'],0x0)&&_0x3a6220['push'](_0xa41ca2[_0x4a75e0(0xfa)]+_0x4a75e0(0xa6)),_0x32d95f['ILksC'](_0x500df7[_0x4a75e0(0xfa)],0x0)&&_0x3a6220[_0x4a75e0(0xaf)](_0x500df7[_0x4a75e0(0xfa)]+_0x4a75e0(0xdd)),console['log'](_0xf33bd2+_0x4a75e0(0xb2)+_0x3a6220['join'](',\x20')+')'),_0x369aae&&console['log'](_0x4a75e0(0xba)+bold(_0x369aae)),console[_0x4a75e0(0xe7)](_0x4a75e0(0xca));}else{for(const _0x51cc8a of _0xa41ca2){const _0xe3bc35=_0x32d95f[_0x4a75e0(0x100)](_0x51cc8a['name'],_0x369aae)?_0x32d95f['CUdOS']:'';console[_0x4a75e0(0xe7)]('\x20\x20'+_0x32d95f[_0x4a75e0(0xde)](bold,_0x51cc8a[_0x4a75e0(0xb8)])+_0x4a75e0(0xa5)+_0xe3bc35);const _0xe4ad7b=_0x51cc8a[_0x4a75e0(0xa4)]?_0x4a75e0(0xea)+_0x51cc8a['sessionUpdatedAt']+')':_0x32d95f['NTVpE'];console[_0x4a75e0(0xe7)]('\x20\x20\x20\x20Session:\x20'+_0xe4ad7b);}const _0x109a81=new Set(_0xa41ca2[_0x4a75e0(0xa3)](_0x4cc34a=>_0x4cc34a['name']));for(const _0x19d2b0 of _0x500df7){if(_0x109a81['has'](_0x19d2b0[_0x4a75e0(0xb8)]))continue;const _0x19956b=_0x19d2b0['isActive']?_0x32d95f['CUdOS']:'',_0x1bdaab=_0x19d2b0[_0x4a75e0(0xe2)]?_0x32d95f['bmNaQ']:_0x19d2b0[_0x4a75e0(0xc9)]?'plaintext':'none';console[_0x4a75e0(0xe7)]('\x20\x20'+_0x32d95f['ZXLhd'](bold,_0x19d2b0[_0x4a75e0(0xb8)])+_0x4a75e0(0xd7)+_0x19956b),console['log'](_0x4a75e0(0xbd)+_0x1bdaab),_0x19d2b0['settingsPath']!==_0x32d95f['cTpsc']&&console['log']('\x20\x20\x20\x20Settings:\x20'+_0x32d95f[_0x4a75e0(0xa7)](link,_0x19d2b0['settingsPath'],basename(_0x19d2b0['settingsPath'])));}if(!_0x369aae){console[_0x4a75e0(0xe7)](_0x4a75e0(0xd4));const _0xb832d=[..._0xa41ca2[_0x4a75e0(0xa3)](_0x5787bf=>_0x5787bf['name']),..._0x500df7['filter'](_0x508a4e=>!_0x109a81[_0x4a75e0(0xab)](_0x508a4e['name']))['map'](_0x26cd40=>_0x26cd40[_0x4a75e0(0xb8)])];console['log']('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0xb832d['join'](',\x20')+')');}}}console['log']('');}
1
+ const _0x44d257=_0x3f07;(function(_0x34d5f8,_0x32100a){const _0x24a6e4=_0x3f07,_0x201cc2=_0x34d5f8();while(!![]){try{const _0x1cea09=-parseInt(_0x24a6e4(0x1fa))/0x1*(-parseInt(_0x24a6e4(0x217))/0x2)+parseInt(_0x24a6e4(0x238))/0x3*(parseInt(_0x24a6e4(0x1fc))/0x4)+-parseInt(_0x24a6e4(0x1ee))/0x5*(parseInt(_0x24a6e4(0x1f1))/0x6)+-parseInt(_0x24a6e4(0x221))/0x7+parseInt(_0x24a6e4(0x202))/0x8+-parseInt(_0x24a6e4(0x22d))/0x9*(-parseInt(_0x24a6e4(0x23e))/0xa)+parseInt(_0x24a6e4(0x23c))/0xb*(-parseInt(_0x24a6e4(0x22c))/0xc);if(_0x1cea09===_0x32100a)break;else _0x201cc2['push'](_0x201cc2['shift']());}catch(_0x3fd825){_0x201cc2['push'](_0x201cc2['shift']());}}}(_0x1c21,0x7bbb7));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';function _0x1c21(){const _0x2e2ffe=['Root:\x20','filter','sessionUpdatedAt','utf-8','590qesCNZ','\x20(up\x20to\x20date)','8wniOXi','\x20plugin(s)\x20configured','map','stdout','config',':\x20installed\x20(','2847776TpslDB','user','xwjrD','tEIcM','hasEncryptedAuth','path','\x20\x20\x20\x20Session:\x20','not_installed','\x20profiles\x20configured\x20(','isDirectory','error','HFueq','unknown','\x20\x20\x20\x20Settings:\x20','iEzkq','XxjQY','\x20\x20\x20\x20Auth:\x20','no\x20session','qoYCR','\x20\x20Run:\x20ranger\x20update','IFpta','516mtYBJW','details','ranger@trailhead','ymWhp','JswcM','\x20\x20Not\x20configured','displayName','plugin','disabled','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','4211158yTTyeD','\x20[local]','version','close','has','scope','settingsPath','includes','VoZUP','not_configured','ZnYtR','446604XNwueQ','1035ykPWiX','hasPlaintextAuth','\x0a---\x20Claude\x20Code\x20Plugin\x20---','dJZfY','LUDyz','pWIac','\x1b]8;;\x07','(not\x20found)','\x20\x20Not\x20installed','SKILL.md','\x0a\x20\x20No\x20active\x20profile\x20set','659427XgjIeq','LgQLM','XFDdt','uhBlp','11CPGpxh','KeejS','28930iEwHfP','log','WwfDP','IBsCU','vGsew','some','length','API\x20Environment:\x20','\x0a---\x20Profiles\x20---','vfGGu','pipe','trim','\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a','status','WnYEa','Version:\x20','ifeaq','zXtgw','eBvCM','all','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','No\x20skills\x20installed','configured','\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','sqeDi','name','ctQEV','\x20local','674435IywLZd','\x20(active)','data','6KWZqxz','\x20\x20Run:\x20ranger\x20skillup','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','join','push'];_0x1c21=function(){return _0x2e2ffe;};return _0x1c21();}import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{listCloudProfiles}from'./utils/cloudProfile.js';import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x458a0c=>'\x1b[1m'+_0x458a0c+'\x1b[0m',link=(_0x584b84,_0x4cde82)=>'\x1b]8;;file://'+_0x584b84+'\x07'+(_0x4cde82||_0x584b84)+_0x44d257(0x233);async function getOpencodePluginStatus(){const _0x5717de=_0x44d257,_0x276066={'ENqXO':function(_0x2f8411,_0xeacaea){return _0x2f8411!==_0xeacaea;},'rMswA':_0x5717de(0x209),'NcKOq':function(_0x526111,_0x555f24){return _0x526111>_0x555f24;},'pWIac':function(_0xac62a1,_0x31ac15){return _0xac62a1>_0x31ac15;},'VoZUP':function(_0x2c7378,_0x53878e){return _0x2c7378(_0x53878e);},'BIQll':'not_configured','KThzf':'debug','DhBno':_0x5717de(0x200),'ymWhp':_0x5717de(0x248)};return new Promise(_0x3fa9b4=>{const _0x5e0cb1=_0x5717de,_0x364d84=spawn('opencode',[_0x276066['KThzf'],_0x276066['DhBno']],{'stdio':['ignore',_0x5e0cb1(0x248),_0x276066[_0x5e0cb1(0x21a)]]});let _0x239ba2='';_0x364d84[_0x5e0cb1(0x1ff)]?.['on']('data',_0x13765c=>{_0x239ba2+=_0x13765c['toString']();}),_0x364d84['stderr']?.['on'](_0x5e0cb1(0x1f0),_0x111b18=>{_0x239ba2+=_0x111b18['toString']();}),_0x364d84['on'](_0x5e0cb1(0x20c),()=>{_0x3fa9b4({'status':'not_installed'});}),_0x364d84['on'](_0x5e0cb1(0x224),_0x456818=>{const _0x4ca1d3=_0x5e0cb1,_0x3981f9={'XxjQY':function(_0x3b62ca,_0x3a8f43){return _0x276066['ENqXO'](_0x3b62ca,_0x3a8f43);}};if(_0x456818!==0x0){_0x3fa9b4({'status':_0x276066['rMswA']});return;}const _0x11cab9=_0x239ba2[_0x4ca1d3(0x249)]();let _0x14f406=null;if(_0x11cab9)try{_0x14f406=JSON['parse'](_0x11cab9);}catch{const _0x1351fd=_0x11cab9['match'](/\{[\s\S]*\}$/);if(_0x1351fd)try{_0x14f406=JSON['parse'](_0x1351fd[0x0]);}catch{_0x14f406=null;}}const _0x208c80=Array['isArray'](_0x14f406?.['plugin'])?_0x14f406?.[_0x4ca1d3(0x21e)]:[],_0x2f5702=_0x208c80[_0x4ca1d3(0x243)](_0x5e8d88=>{const _0x59e3b2=_0x4ca1d3;if(_0x3981f9[_0x59e3b2(0x211)](typeof _0x5e8d88,'string'))return![];return _0x5e8d88[_0x59e3b2(0x228)]('@ranger-testing/opencode-plugin')||_0x5e8d88['includes']('opencode-plugin');});if(_0x2f5702){_0x3fa9b4({'status':_0x4ca1d3(0x254),'details':_0x276066['NcKOq'](_0x208c80[_0x4ca1d3(0x244)],0x0)?_0x208c80['length']+_0x4ca1d3(0x1fd):undefined});return;}if(_0x276066[_0x4ca1d3(0x232)](_0x208c80[_0x4ca1d3(0x244)],0x0)){_0x276066[_0x4ca1d3(0x229)](_0x3fa9b4,{'status':_0x276066['BIQll'],'details':_0x208c80['length']+'\x20plugin(s)\x20configured'});return;}_0x3fa9b4({'status':'not_configured'});});});}async function getSkillsFromDir(_0x441951,_0x499596){const _0x3b2358=_0x44d257,_0x13d7d6={'vfGGu':_0x3b2358(0x236),'RnxUm':function(_0x4f049b,_0x37367f){return _0x4f049b(_0x37367f);}};if(!existsSync(_0x441951))return[];const _0x14db98=[];try{const _0x3edf79=await readdir(_0x441951,{'withFileTypes':!![]});for(const _0x74c28 of _0x3edf79){if(_0x74c28[_0x3b2358(0x20b)]()){const _0x393609=join(_0x441951,_0x74c28['name'],_0x13d7d6[_0x3b2358(0x247)]);if(_0x13d7d6['RnxUm'](existsSync,_0x393609)){let _0x4896f1=_0x74c28[_0x3b2358(0x1eb)];try{const _0x220e6e=await readFile(_0x393609,_0x3b2358(0x1f9)),_0x20137d=_0x220e6e['match'](/name:\s*(.+)/);_0x20137d&&(_0x4896f1=_0x20137d[0x1][_0x3b2358(0x249)]());}catch{}_0x14db98['push']({'name':_0x74c28['name'],'displayName':_0x4896f1,'path':_0x393609,'level':_0x499596});}}}}catch{return[];}return _0x14db98;}function _0x3f07(_0x3ba11a,_0x33df79){_0x3ba11a=_0x3ba11a-0x1e9;const _0x1c2157=_0x1c21();let _0x3f07d4=_0x1c2157[_0x3ba11a];return _0x3f07d4;}async function getInstalledSkills(){const _0x2f1202=_0x44d257,_0x2acf60={'McQxK':function(_0x43b691,_0x5e1013,_0x2b20da){return _0x43b691(_0x5e1013,_0x2b20da);},'uhBlp':function(_0x7e9e66){return _0x7e9e66();},'XFDdt':'project','LUDyz':function(_0x13453b,_0x505e34,_0xd32284){return _0x13453b(_0x505e34,_0xd32284);},'iEzkq':function(_0x7c8da4){return _0x7c8da4();},'wgTEm':_0x2f1202(0x203)},[_0x3f042,_0x484b3e]=await Promise[_0x2f1202(0x251)]([_0x2acf60['McQxK'](getSkillsFromDir,_0x2acf60[_0x2f1202(0x23b)](getProjectSkillsDir),_0x2acf60[_0x2f1202(0x23a)]),_0x2acf60[_0x2f1202(0x231)](getSkillsFromDir,_0x2acf60[_0x2f1202(0x210)](getUserSkillsDir),_0x2acf60['wgTEm'])]);return{'project':_0x3f042,'user':_0x484b3e};}async function getEnvironments(){const _0x145baf=_0x44d257,_0x131c20={'KeejS':function(_0x4b5f87,_0x48e090,_0x48a5e3){return _0x4b5f87(_0x48e090,_0x48a5e3);},'dJZfY':'settings.json','MjlPn':function(_0x5226a9,_0x248e83,_0x194ec1){return _0x5226a9(_0x248e83,_0x194ec1);},'cgnlS':_0x145baf(0x234),'JRvWf':function(_0x429c9c,_0x22fa44){return _0x429c9c===_0x22fa44;},'QEuqZ':function(_0x320df4){return _0x320df4();},'qoYCR':function(_0x5dba19,_0x23b356){return _0x5dba19(_0x23b356);}},{envNames:_0x1847ba,activeEnv:_0x40efa6}=await getEnvNames(),_0x4ccde2=_0x131c20['QEuqZ'](getRangerDir);if(!_0x131c20[_0x145baf(0x214)](existsSync,_0x4ccde2))return{'envs':[],'activeEnv':null};const _0x238e61=_0x1847ba['map'](_0x45c6a0=>{const _0xa3282c=_0x145baf,_0x19572a=getEnvDir(_0x45c6a0),_0x1e40da=_0x131c20[_0xa3282c(0x23d)](join,_0x19572a,_0x131c20[_0xa3282c(0x230)]),_0x2faa6d=join(_0x19572a,'auth.json'),_0x42cdcb=_0x131c20['MjlPn'](join,_0x19572a,'auth.json.enc');return{'name':_0x45c6a0,'settingsPath':existsSync(_0x1e40da)?_0x1e40da:_0x131c20['cgnlS'],'hasPlaintextAuth':existsSync(_0x2faa6d),'hasEncryptedAuth':existsSync(_0x42cdcb),'isActive':_0x131c20['JRvWf'](_0x45c6a0,_0x40efa6)};});return{'envs':_0x238e61,'activeEnv':_0x40efa6};}export async function status(){const _0xbb15ee=_0x44d257,_0x311f7c={'xGPyy':function(_0x4dd5d8){return _0x4dd5d8();},'icbfZ':function(_0x2e3f30,_0x589e48){return _0x2e3f30(_0x589e48);},'WnYEa':function(_0x4fde50,_0x16463a,_0x426725){return _0x4fde50(_0x16463a,_0x426725);},'MgNaU':function(_0x379672){return _0x379672();},'sqeDi':function(_0x19ea80,_0x56fb55){return _0x19ea80!==_0x56fb55;},'LgQLM':function(_0x53ed74,_0x47adaf){return _0x53ed74(_0x47adaf);},'eBvCM':function(_0x46e3a5,_0x7599f6){return _0x46e3a5(_0x7599f6);},'qKkXe':_0xbb15ee(0x254),'TzdeD':'\x20\x20Run:\x20ranger\x20setup\x20--opencode','cxkeV':_0xbb15ee(0x1e9),'JswcM':_0xbb15ee(0x20e),'ifeaq':'enabled','zXtgw':_0xbb15ee(0x235),'ctQEV':'\x0a---\x20Skills\x20---','ZnYtR':function(_0x631d82,_0x4e657a){return _0x631d82+_0x4e657a;},'WwfDP':function(_0x420063,_0x1feba5){return _0x420063===_0x1feba5;},'vGsew':function(_0x20d16b,_0x6bbabe){return _0x20d16b>_0x6bbabe;},'PZBOn':function(_0xff2d42,_0x561c9c,_0x130c46){return _0xff2d42(_0x561c9c,_0x130c46);},'oKnOo':function(_0x1be8ee,_0x205c59){return _0x1be8ee>_0x205c59;},'wEYky':'\x20\x20User-level:','klEjF':_0xbb15ee(0x246),'tEIcM':function(_0xdb5aee){return _0xdb5aee();},'IFpta':function(_0x3075b8){return _0x3075b8();},'xwjrD':'No\x20profiles\x20configured','HFueq':function(_0x3a640e,_0x6d6a54){return _0x3a640e(_0x6d6a54);},'IBsCU':'\x20(active)','xoCGK':'encrypted','jjufP':'plaintext','rSyDE':function(_0x169118,_0x25db4a){return _0x169118(_0x25db4a);},'gnplS':function(_0xe4fdf5,_0x3c3cbe,_0x110144){return _0xe4fdf5(_0x3c3cbe,_0x110144);}};console['log']('\x0a📊\x20Ranger\x20Status\x0a');const _0x479aeb=process['cwd'](),_0x493122=_0x311f7c['xGPyy'](getRangerDir);if(!_0x311f7c['icbfZ'](existsSync,_0x493122)){console[_0xbb15ee(0x23f)](_0xbb15ee(0x1f6)+_0x311f7c[_0xbb15ee(0x24c)](link,_0x479aeb,_0x311f7c['icbfZ'](bold,basename(_0x479aeb)))),console[_0xbb15ee(0x23f)](_0xbb15ee(0x220)),console['log'](_0xbb15ee(0x24a));return;}console['log'](_0xbb15ee(0x1f6)+link(_0x479aeb,bold(basename(_0x479aeb))));const _0x4b1b98=getCurrentVersion(),_0x3b5e0b=_0x311f7c['MgNaU'](getLatestVersion);if(_0x3b5e0b[_0xbb15ee(0x223)]&&_0x311f7c[_0xbb15ee(0x1ea)](_0x3b5e0b['version'],_0x4b1b98))console['log'](_0xbb15ee(0x24d)+_0x4b1b98+'\x20(latest:\x20'+_0x3b5e0b[_0xbb15ee(0x223)]+')'),console[_0xbb15ee(0x23f)](_0xbb15ee(0x215));else _0x3b5e0b[_0xbb15ee(0x223)]?console[_0xbb15ee(0x23f)](_0xbb15ee(0x24d)+_0x4b1b98+_0xbb15ee(0x1fb)):console[_0xbb15ee(0x23f)](_0xbb15ee(0x24d)+_0x4b1b98);const _0x5151e7=await getToken();if(_0x5151e7){const _0x3e5654=await _0x311f7c[_0xbb15ee(0x239)](getCurrentUser,_0x5151e7);_0x3e5654['success']?console[_0xbb15ee(0x23f)]('Organization:\x20'+_0x311f7c['eBvCM'](bold,_0x3e5654['user']['organizationName'])):(console['log'](_0xbb15ee(0x1f3)),console[_0xbb15ee(0x23f)]('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console['log']('API\x20Token:\x20✗\x20Not\x20found'),console[_0xbb15ee(0x23f)]('\x20\x20Run:\x20ranger\x20setup\x20[token]');process['env']['DEBUG']&&(console['log'](_0xbb15ee(0x245)+_0x311f7c['xGPyy'](getCurrentEnvironment)),console[_0xbb15ee(0x23f)]('API\x20URL:\x20'+getApiBaseUrl()));console['log']('\x0a---\x20OpenCode\x20Plugin\x20---');const _0x52e4d7=await _0x311f7c['MgNaU'](getOpencodePluginStatus);if(_0x52e4d7['status']===_0x311f7c['qKkXe'])console['log']('\x20\x20'+bold('@ranger-testing/opencode-plugin')+':\x20configured'),_0x52e4d7['details']&&console[_0xbb15ee(0x23f)]('\x20\x20'+_0x52e4d7['details']);else _0x52e4d7[_0xbb15ee(0x24b)]===_0xbb15ee(0x22a)?(console['log'](_0xbb15ee(0x21c)),_0x52e4d7[_0xbb15ee(0x218)]&&console['log']('\x20\x20'+_0x52e4d7['details']),console[_0xbb15ee(0x23f)](_0x311f7c['TzdeD'])):console[_0xbb15ee(0x23f)](_0x311f7c['cxkeV']);console[_0xbb15ee(0x23f)](_0xbb15ee(0x22f));const _0x58bad6=await getPluginInfo(_0xbb15ee(0x219));if(_0x58bad6){const _0x10109a=_0x58bad6[_0xbb15ee(0x226)]||_0x311f7c[_0xbb15ee(0x21b)],_0x32933d=_0x58bad6['enabled']?_0x311f7c[_0xbb15ee(0x24e)]:_0xbb15ee(0x21f);console['log']('\x20\x20'+bold('ranger@trailhead')+_0xbb15ee(0x201)+_0x10109a+',\x20'+_0x32933d+')');}else console['log'](_0x311f7c[_0xbb15ee(0x24f)]),console[_0xbb15ee(0x23f)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)');console['log'](_0x311f7c[_0xbb15ee(0x1ec)]);const {project:_0x560947,user:_0x4ecb83}=await getInstalledSkills(),_0x41c47b=_0x560947[_0xbb15ee(0x1f7)](_0x1f6504=>RANGER_MANAGED_SKILLS[_0xbb15ee(0x228)](_0x1f6504['name'])),_0x37500d=_0x4ecb83['filter'](_0x29a379=>RANGER_MANAGED_SKILLS['includes'](_0x29a379[_0xbb15ee(0x1eb)])),_0x34950b=_0x311f7c[_0xbb15ee(0x22b)](_0x41c47b['length'],_0x37500d[_0xbb15ee(0x244)]);if(_0x311f7c[_0xbb15ee(0x240)](_0x34950b,0x0))console[_0xbb15ee(0x23f)](_0xbb15ee(0x253)),console[_0xbb15ee(0x23f)](_0xbb15ee(0x1f2));else{if(_0x311f7c['vGsew'](_0x41c47b[_0xbb15ee(0x244)],0x0)){console['log']('\x20\x20Project-level:');for(const _0x89727a of _0x41c47b){console['log']('\x20\x20\x20\x20'+bold(_0x89727a['displayName'])+':\x20'+_0x311f7c['PZBOn'](link,_0x89727a[_0xbb15ee(0x207)],basename(_0x89727a[_0xbb15ee(0x207)])));}}if(_0x311f7c['oKnOo'](_0x37500d[_0xbb15ee(0x244)],0x0)){console[_0xbb15ee(0x23f)](_0x311f7c['wEYky']);for(const _0x382031 of _0x37500d){console[_0xbb15ee(0x23f)]('\x20\x20\x20\x20'+_0x311f7c['LgQLM'](bold,_0x382031[_0xbb15ee(0x21d)])+':\x20'+link(_0x382031['path'],_0x311f7c['eBvCM'](basename,_0x382031[_0xbb15ee(0x207)])));}}}console['log'](_0x311f7c['klEjF']);const {envs:_0x2b0cac,activeEnv:_0x1fa91b}=await _0x311f7c[_0xbb15ee(0x205)](getEnvironments);let _0x30f842=[];if(_0x5151e7)try{_0x30f842=await _0x311f7c[_0xbb15ee(0x216)](listCloudProfiles);}catch{}const _0x3b616e=_0x311f7c[_0xbb15ee(0x22b)](_0x2b0cac['length'],_0x30f842[_0xbb15ee(0x244)]);if(_0x3b616e===0x0)console[_0xbb15ee(0x23f)](_0x311f7c[_0xbb15ee(0x204)]),console['log']('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{if(_0x3b616e>0x5){const _0x702ecc=[];_0x311f7c[_0xbb15ee(0x242)](_0x30f842[_0xbb15ee(0x244)],0x0)&&_0x702ecc[_0xbb15ee(0x1f5)](_0x30f842[_0xbb15ee(0x244)]+'\x20cloud'),_0x2b0cac[_0xbb15ee(0x244)]>0x0&&_0x702ecc[_0xbb15ee(0x1f5)](_0x2b0cac[_0xbb15ee(0x244)]+_0xbb15ee(0x1ed)),console[_0xbb15ee(0x23f)](_0x3b616e+_0xbb15ee(0x20a)+_0x702ecc[_0xbb15ee(0x1f4)](',\x20')+')'),_0x1fa91b&&console['log']('\x20\x20Active:\x20'+_0x311f7c[_0xbb15ee(0x20d)](bold,_0x1fa91b)),console['log']('\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)');}else{for(const _0x39a0d8 of _0x30f842){const _0x714970=_0x311f7c['WwfDP'](_0x39a0d8['name'],_0x1fa91b)?_0x311f7c[_0xbb15ee(0x241)]:'';console['log']('\x20\x20'+_0x311f7c[_0xbb15ee(0x250)](bold,_0x39a0d8[_0xbb15ee(0x1eb)])+'\x20[cloud]'+_0x714970);const _0x429492=_0x39a0d8['sessionUpdatedAt']?'cached\x20(updated\x20'+_0x39a0d8[_0xbb15ee(0x1f8)]+')':_0xbb15ee(0x213);console[_0xbb15ee(0x23f)](_0xbb15ee(0x208)+_0x429492);}const _0x4cae21=new Set(_0x30f842['map'](_0x3ef762=>_0x3ef762['name']));for(const _0x4dc3c7 of _0x2b0cac){if(_0x4cae21['has'](_0x4dc3c7['name']))continue;const _0xc8987f=_0x4dc3c7['isActive']?_0xbb15ee(0x1ef):'',_0x2283e1=_0x4dc3c7[_0xbb15ee(0x206)]?_0x311f7c['xoCGK']:_0x4dc3c7[_0xbb15ee(0x22e)]?_0x311f7c['jjufP']:'none';console['log']('\x20\x20'+_0x311f7c['rSyDE'](bold,_0x4dc3c7[_0xbb15ee(0x1eb)])+_0xbb15ee(0x222)+_0xc8987f),console['log'](_0xbb15ee(0x212)+_0x2283e1),_0x4dc3c7[_0xbb15ee(0x227)]!==_0xbb15ee(0x234)&&console['log'](_0xbb15ee(0x20f)+_0x311f7c['gnplS'](link,_0x4dc3c7['settingsPath'],_0x311f7c['HFueq'](basename,_0x4dc3c7['settingsPath'])));}if(!_0x1fa91b){console['log'](_0xbb15ee(0x237));const _0xd725c4=[..._0x30f842[_0xbb15ee(0x1fe)](_0x4f96ee=>_0x4f96ee['name']),..._0x2b0cac['filter'](_0x19ad8e=>!_0x4cae21[_0xbb15ee(0x225)](_0x19ad8e[_0xbb15ee(0x1eb)]))['map'](_0x1f3e85=>_0x1f3e85['name'])];console[_0xbb15ee(0x23f)](_0xbb15ee(0x252)+_0xd725c4[_0xbb15ee(0x1f4)](',\x20')+')');}}}console['log']('');}