@ranger-testing/ranger-cli 2.5.4-alpha.f6504c0-8 → 2.5.4-alpha.f940f0d-18

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 (82) hide show
  1. package/README.md +36 -14
  2. package/build/cli.js +1 -1
  3. package/build/commands/addEnv.js +1 -1
  4. package/build/commands/authEncrypt.js +1 -1
  5. package/build/commands/clean.js +1 -1
  6. package/build/commands/config.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 -0
  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/opencodeConfig.js +1 -1
  58. package/build/commands/utils/playwrightCli.js +1 -1
  59. package/build/commands/utils/profileMessages.js +1 -1
  60. package/build/commands/utils/profileSetupBanner.js +1 -1
  61. package/build/commands/utils/projectsConfig.js +1 -1
  62. package/build/commands/utils/rangerConfig.js +1 -1
  63. package/build/commands/utils/rangerRoot.js +1 -1
  64. package/build/commands/utils/resolveProfileContext.js +1 -1
  65. package/build/commands/utils/resolveProfileUrl.js +1 -1
  66. package/build/commands/utils/retry.js +1 -1
  67. package/build/commands/utils/sessionCache.js +1 -1
  68. package/build/commands/utils/settings.js +1 -1
  69. package/build/commands/utils/skillContent.js +1 -1
  70. package/build/commands/utils/skills.js +1 -1
  71. package/build/commands/utils/stitchWebmFiles.js +1 -1
  72. package/build/commands/utils/telemetry.js +1 -1
  73. package/build/commands/utils/tokenRefresh.js +1 -1
  74. package/build/commands/utils/traceSnapshotMapper.js +1 -1
  75. package/build/commands/utils/userApi.js +1 -1
  76. package/build/commands/utils/version.js +1 -1
  77. package/build/commands/verifyFeature.js +1 -1
  78. package/build/commands/verifyFeatureCli.js +1 -1
  79. package/build/skills/ranger/SKILL.md +24 -8
  80. package/build/skills/ranger/create.md +16 -3
  81. package/build/skills/ranger/verify.md +35 -10
  82. package/package.json +3 -2
@@ -1 +1 @@
1
- function _0x581d(){const _0x2b0f1a=['6304100NNNNQT','message','603gurBUf','sPQeQ','295494dqUvKw','stdin','6694670ZHYYaw','40HSmRTx','organizationName','955508BvhpVo','stdout','978426aXCsqd','2bJxGun','17452Sjvwpn','log','21VJEETn','success','1071736OZOikF'];_0x581d=function(){return _0x2b0f1a;};return _0x581d();}(function(_0x1d6211,_0x29ff05){const _0x2b0644=_0x47d5,_0x662801=_0x1d6211();while(!![]){try{const _0x240a42=-parseInt(_0x2b0644(0x1b5))/0x1*(-parseInt(_0x2b0644(0x1a6))/0x2)+parseInt(_0x2b0644(0x1ae))/0x3*(parseInt(_0x2b0644(0x1a7))/0x4)+parseInt(_0x2b0644(0x1b3))/0x5*(parseInt(_0x2b0644(0x1b0))/0x6)+parseInt(_0x2b0644(0x1a9))/0x7*(-parseInt(_0x2b0644(0x1ab))/0x8)+parseInt(_0x2b0644(0x1b7))/0x9+-parseInt(_0x2b0644(0x1b2))/0xa+-parseInt(_0x2b0644(0x1ac))/0xb;if(_0x240a42===_0x29ff05)break;else _0x662801['push'](_0x662801['shift']());}catch(_0x4d2f29){_0x662801['push'](_0x662801['shift']());}}}(_0x581d,0xa8a15));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';function _0x47d5(_0x13f5c9,_0x5f599d){_0x13f5c9=_0x13f5c9-0x1a6;const _0x581de8=_0x581d();let _0x47d5df=_0x581de8[_0x13f5c9];return _0x47d5df;}export async function login(){const _0x3995e7=_0x47d5,_0x32a0c0={'sPQeQ':function(_0x33918c){return _0x33918c();},'tUBjq':function(_0x402d6d,_0x2fcdd8){return _0x402d6d(_0x2fcdd8);}},_0x30fe6e=await getMcpAuthOrigin();if(_0x30fe6e){console['log']('Re-authenticating\x20via\x20MCP\x20bootstrap...'),await _0x32a0c0[_0x3995e7(0x1af)](mcpBootstrap);return;}const _0x36cab4=process[_0x3995e7(0x1b1)]['isTTY']&&process[_0x3995e7(0x1b6)]['isTTY'];if(!_0x36cab4)throw new Error('Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.');try{const _0x2ce299=await _0x32a0c0[_0x3995e7(0x1af)](runDeviceAuthFlow),_0x4019ef=await _0x32a0c0['tUBjq'](getCurrentUser,_0x2ce299);_0x4019ef[_0x3995e7(0x1aa)]?console['log']('\x0a✅\x20Logged\x20in\x20to\x20'+_0x4019ef['user'][_0x3995e7(0x1b4)]):console[_0x3995e7(0x1a8)]('\x0a✅\x20API\x20key\x20stored\x20successfully');}catch(_0x5dd232){throw new Error('Login\x20failed:\x20'+(_0x5dd232 instanceof Error?_0x5dd232[_0x3995e7(0x1ad)]:_0x5dd232));}}
1
+ (function(_0x33580e,_0x51d2e4){const _0x73ced8=_0x2cae,_0x30217c=_0x33580e();while(!![]){try{const _0x18a7f9=-parseInt(_0x73ced8(0x175))/0x1*(-parseInt(_0x73ced8(0x166))/0x2)+parseInt(_0x73ced8(0x169))/0x3*(parseInt(_0x73ced8(0x165))/0x4)+parseInt(_0x73ced8(0x16b))/0x5+parseInt(_0x73ced8(0x176))/0x6+parseInt(_0x73ced8(0x16a))/0x7*(-parseInt(_0x73ced8(0x173))/0x8)+parseInt(_0x73ced8(0x171))/0x9*(parseInt(_0x73ced8(0x168))/0xa)+-parseInt(_0x73ced8(0x164))/0xb*(parseInt(_0x73ced8(0x167))/0xc);if(_0x18a7f9===_0x51d2e4)break;else _0x30217c['push'](_0x30217c['shift']());}catch(_0x13fd30){_0x30217c['push'](_0x30217c['shift']());}}}(_0x35ee,0x394a2));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';function _0x35ee(){const _0x4b5cb0=['53260weXENp','4pFqAqp','12OKdntW','20iNeSZd','69yXKILb','14ZHhpTX','1140525OzDaji','organizationName','\x0a✅\x20Logged\x20in\x20to\x20','log','UNYhg','stdout','1265535zTlfYz','bllnj','1585240VvftFV','\x0a✅\x20API\x20key\x20stored\x20successfully','186005NYoRpp','2242212HKlnKE','user','10233564gtxIJc'];_0x35ee=function(){return _0x4b5cb0;};return _0x35ee();}function _0x2cae(_0x3c413e,_0x518fef){_0x3c413e=_0x3c413e-0x164;const _0x35eece=_0x35ee();let _0x2cae41=_0x35eece[_0x3c413e];return _0x2cae41;}import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';export async function login(){const _0x947436=_0x2cae,_0x341a7e={'UNYhg':function(_0x1538de){return _0x1538de();},'YOkzX':function(_0x3dfaaf,_0x842ea2){return _0x3dfaaf(_0x842ea2);},'bllnj':function(_0x8c4c0,_0x19d9f6){return _0x8c4c0 instanceof _0x19d9f6;}},_0x53e2c7=await _0x341a7e[_0x947436(0x16f)](getMcpAuthOrigin);if(_0x53e2c7){console[_0x947436(0x16e)]('Re-authenticating\x20via\x20MCP\x20bootstrap...'),await mcpBootstrap();return;}const _0x45201b=process['stdin']['isTTY']&&process[_0x947436(0x170)]['isTTY'];if(!_0x45201b)throw new Error('Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.');try{const _0xb5a36e=await _0x341a7e['UNYhg'](runDeviceAuthFlow),_0x236018=await _0x341a7e['YOkzX'](getCurrentUser,_0xb5a36e);_0x236018['success']?console['log'](_0x947436(0x16d)+_0x236018[_0x947436(0x177)][_0x947436(0x16c)]):console[_0x947436(0x16e)](_0x947436(0x174));}catch(_0xc61e10){throw new Error('Login\x20failed:\x20'+(_0x341a7e[_0x947436(0x172)](_0xc61e10,Error)?_0xc61e10['message']:_0xc61e10));}}
@@ -1 +1 @@
1
- const _0x5f2572=_0x1cee;(function(_0x3c1a83,_0x191a10){const _0x5412a6=_0x1cee,_0x30e0a9=_0x3c1a83();while(!![]){try{const _0x33c332=-parseInt(_0x5412a6(0x199))/0x1*(-parseInt(_0x5412a6(0x1ca))/0x2)+-parseInt(_0x5412a6(0x184))/0x3+parseInt(_0x5412a6(0x1a9))/0x4+-parseInt(_0x5412a6(0x189))/0x5+-parseInt(_0x5412a6(0x188))/0x6*(-parseInt(_0x5412a6(0x1f2))/0x7)+parseInt(_0x5412a6(0x1d6))/0x8+-parseInt(_0x5412a6(0x1cd))/0x9*(parseInt(_0x5412a6(0x1b5))/0xa);if(_0x33c332===_0x191a10)break;else _0x30e0a9['push'](_0x30e0a9['shift']());}catch(_0x4fbc24){_0x30e0a9['push'](_0x30e0a9['shift']());}}}(_0x7552,0x3bdb9));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{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),_0x5f2572(0x1b4),'mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),'.ranger','auth-origin.txt');export async function getMcpAuthOrigin(){const _0x503f09=_0x5f2572,_0x20feb5={'Nfzcx':function(_0x377dc6,_0x72b8f7,_0x52a5f4){return _0x377dc6(_0x72b8f7,_0x52a5f4);},'OHFnL':_0x503f09(0x1b9)};try{const _0x59ff81=(await _0x20feb5['Nfzcx'](readFile,AUTH_ORIGIN_PATH,_0x20feb5['OHFnL']))[_0x503f09(0x1ad)]();return _0x59ff81||null;}catch{return null;}}export async function mcpBootstrap(){const _0x15cce8=_0x5f2572,_0x5bc1e9={'RqDmw':function(_0x159f17,_0x370835){return _0x159f17===_0x370835;},'xRUTF':function(_0x353e53){return _0x353e53();},'gOWVw':_0x15cce8(0x1bc),'nnYxG':_0x15cce8(0x197),'yIVbk':function(_0x2b2f01,_0x8b30ae,_0x505131){return _0x2b2f01(_0x8b30ae,_0x505131);}},_0x2657da=getMcpAuthUrl();currentOrigin=_0x2657da;const _0x16aae3=process[_0x15cce8(0x17d)][_0x15cce8(0x1ef)]??![];console['log']('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x2657da+'\x0a');const _0x559a89=await tryUnauthenticated(_0x2657da);let _0xa1f127=null;if(_0x5bc1e9['RqDmw'](_0x559a89,'proxied'))_0xa1f127='';else{_0xa1f127=await _0x5bc1e9['xRUTF'](loadCachedToken);if(!_0xa1f127){if(!_0x16aae3)throw new Error(_0x5bc1e9['gOWVw']+_0x5bc1e9['nnYxG']);_0xa1f127=await oauthFlow(_0x2657da);}}await _0x5bc1e9[_0x15cce8(0x16c)](callGetCliToken,_0x2657da,_0xa1f127);}async function tryUnauthenticated(_0xcf3aa3){const _0xe35533=_0x5f2572,_0x52a6aa={'PdNXy':function(_0x44f294,_0x2f05b8,_0x1a9b02){return _0x44f294(_0x2f05b8,_0x1a9b02);},'dXvRU':'application/json,\x20text/event-stream','CulJw':'2025-03-26','GNwBl':'ranger-cli','lLNKG':_0xe35533(0x1d4),'JdmLu':'needs-oauth'},_0x294fe7=await _0x52a6aa['PdNXy'](fetch,_0xcf3aa3,{'method':_0xe35533(0x174),'headers':{'Content-Type':'application/json','Accept':_0x52a6aa['dXvRU']},'body':JSON[_0xe35533(0x19d)]({'jsonrpc':'2.0','id':0x1,'method':_0xe35533(0x1b1),'params':{'protocolVersion':_0x52a6aa['CulJw'],'capabilities':{},'clientInfo':{'name':_0x52a6aa['GNwBl'],'version':_0x52a6aa['lLNKG']}}})});if(_0x294fe7['ok'])return await _0x294fe7[_0xe35533(0x183)](),'proxied';if(_0x294fe7[_0xe35533(0x1e7)]===0x191)return await _0x294fe7[_0xe35533(0x183)](),_0x52a6aa[_0xe35533(0x16b)];const _0x19c1cc=await _0x294fe7[_0xe35533(0x183)]();throw new Error(_0xe35533(0x1e8)+_0x294fe7[_0xe35533(0x1e7)]+':\x20'+_0x19c1cc);}class OAuthTimeoutError extends Error{constructor(_0x5e47a0){super(_0x5e47a0),this['name']='OAuthTimeoutError';}}async function oauthFlow(_0x15042c){const _0x30e24e=_0x5f2572,_0x46aec0={'vjMMP':function(_0x530a9b){return _0x530a9b();}};try{return await oauthFlowAttempt(_0x15042c);}catch(_0x1c9872){if(_0x1c9872 instanceof OAuthTimeoutError&&await _0x46aec0['vjMMP'](loadCachedClient))return console['log'](_0x30e24e(0x1d8)),await _0x46aec0[_0x30e24e(0x1f4)](clearCachedClient),await oauthFlowAttempt(_0x15042c);throw _0x1c9872;}}async function oauthFlowAttempt(_0x3654b5){const _0x207f3a=_0x5f2572,_0x1f402e={'WTepQ':'Discovering\x20authorization\x20server...','xmATQ':function(_0x26a21b,_0x17a3e2){return _0x26a21b(_0x17a3e2);},'CedAe':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','QImYE':function(_0x387431){return _0x387431();},'ljhPQ':_0x207f3a(0x1be),'djitZ':_0x207f3a(0x1df),'eZPew':'authorization_code','RCYBv':_0x207f3a(0x1db),'vAnaR':_0x207f3a(0x19f),'hNHeX':function(_0x9ce41a,_0x29e5fe){return _0x9ce41a(_0x29e5fe);},'JLkMq':_0x207f3a(0x18c),'dBZkN':'base64url','mKjDa':'hex','hFHVG':'response_type','wqxrl':_0x207f3a(0x1d5),'Yoych':_0x207f3a(0x1c0),'pgQkg':_0x207f3a(0x1a6),'qHxzs':_0x207f3a(0x1b7),'MxoEN':function(_0x169dcb,_0x355a40,_0x9b554a){return _0x169dcb(_0x355a40,_0x9b554a);},'oYPlz':'application/x-www-form-urlencoded','qQjeA':_0x207f3a(0x1f1)},_0x34ce72=_0x3654b5['replace'](/\/mcp$/,'');process[_0x207f3a(0x17d)]['write'](_0x1f402e[_0x207f3a(0x187)]);const _0x503b40=await _0x1f402e[_0x207f3a(0x18f)](fetch,_0x34ce72+_0x207f3a(0x190));if(!_0x503b40['ok'])throw new Error(_0x1f402e['CedAe']);const _0x2cd3b2=await _0x503b40[_0x207f3a(0x1b2)](),_0x497092=_0x2cd3b2['authorization_servers']?.[0x0];if(!_0x497092)throw new Error('No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata');console['log']('\x20'+_0x497092);const _0x2b64ac=await fetchAuthServerMetadata(_0x497092);let _0x5658a1,_0x42c9f4;const _0x506245=await _0x1f402e[_0x207f3a(0x175)](loadCachedClient);if(_0x506245)_0x5658a1=_0x506245['clientId'],_0x42c9f4=_0x506245['clientSecret'];else{if(_0x2b64ac['registration_endpoint']){process['stdout']['write'](_0x1f402e['ljhPQ']);const _0x285b5d=await fetch(_0x2b64ac[_0x207f3a(0x1a5)],{'method':'POST','headers':{'Content-Type':_0x207f3a(0x17c)},'body':JSON['stringify']({'client_name':_0x1f402e[_0x207f3a(0x1c5)],'redirect_uris':['http://localhost:'+CALLBACK_PORT+'/callback'],'grant_types':[_0x1f402e[_0x207f3a(0x1a7)],_0x1f402e[_0x207f3a(0x1e9)]],'response_types':['code'],'token_endpoint_auth_method':_0x207f3a(0x1b3)})});if(!_0x285b5d['ok']){const _0x1ae1ac=await _0x285b5d['text']();throw new Error('Client\x20registration\x20failed:\x20'+_0x1ae1ac);}const _0x3bf709=await _0x285b5d['json']();_0x5658a1=_0x3bf709[_0x207f3a(0x1c0)],_0x42c9f4=_0x3bf709['client_secret'],await saveCachedClient(_0x5658a1,_0x42c9f4),console['log']('\x20done');}else throw new Error(_0x1f402e['vAnaR']);}const _0x3677e4=randomBytes(0x20)['toString']('base64url'),_0x2e8746=_0x1f402e['hNHeX'](createHash,_0x1f402e[_0x207f3a(0x18a)])[_0x207f3a(0x19c)](_0x3677e4)[_0x207f3a(0x1cf)](_0x1f402e['dBZkN']),_0x3b95a3=_0x1f402e[_0x207f3a(0x19e)](randomBytes,0x10)['toString'](_0x1f402e[_0x207f3a(0x1e0)]),_0xbf2acc=new URL(_0x2b64ac['authorization_endpoint']);_0xbf2acc[_0x207f3a(0x182)][_0x207f3a(0x1bd)](_0x1f402e[_0x207f3a(0x1c4)],_0x1f402e[_0x207f3a(0x19a)]),_0xbf2acc[_0x207f3a(0x182)][_0x207f3a(0x1bd)](_0x1f402e['Yoych'],_0x5658a1),_0xbf2acc[_0x207f3a(0x182)][_0x207f3a(0x1bd)](_0x207f3a(0x195),'http://localhost:'+CALLBACK_PORT+_0x207f3a(0x1b6)),_0xbf2acc[_0x207f3a(0x182)]['set'](_0x207f3a(0x1d1),_0x2e8746),_0xbf2acc[_0x207f3a(0x182)]['set'](_0x1f402e[_0x207f3a(0x1c8)],_0x1f402e[_0x207f3a(0x16f)]),_0xbf2acc['searchParams']['set']('state',_0x3b95a3);_0x2cd3b2[_0x207f3a(0x177)]&&_0xbf2acc[_0x207f3a(0x182)][_0x207f3a(0x1bd)]('resource',_0x2cd3b2[_0x207f3a(0x177)]);console[_0x207f3a(0x1ba)](_0x207f3a(0x1f5)),console[_0x207f3a(0x1ba)]('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0xbf2acc[_0x207f3a(0x1b0)]()+'\x0a'),await openBrowser(_0xbf2acc['toString']());const _0x46658f=await waitForCallback(_0x3b95a3);process['stdout'][_0x207f3a(0x1aa)](_0x207f3a(0x1ab));const _0x57a13b=new URLSearchParams({'grant_type':_0x1f402e['eZPew'],'code':_0x46658f,'redirect_uri':'http://localhost:'+CALLBACK_PORT+_0x207f3a(0x1b6),'client_id':_0x5658a1,'code_verifier':_0x3677e4});_0x42c9f4&&_0x57a13b['set']('client_secret',_0x42c9f4);_0x2cd3b2['resource']&&_0x57a13b['set']('resource',_0x2cd3b2[_0x207f3a(0x177)]);const _0x182f01=await _0x1f402e['MxoEN'](fetch,_0x2b64ac[_0x207f3a(0x1c2)],{'method':_0x207f3a(0x174),'headers':{'Content-Type':_0x1f402e['oYPlz']},'body':_0x57a13b});if(!_0x182f01['ok']){const _0x180fd2=await _0x182f01['text']();throw new Error(_0x207f3a(0x193)+_0x180fd2);}const _0x453c62=await _0x182f01[_0x207f3a(0x1b2)]();return console['log'](_0x1f402e[_0x207f3a(0x1de)]),await saveCachedToken(_0x453c62[_0x207f3a(0x1eb)],_0x453c62['refresh_token'],_0x453c62[_0x207f3a(0x16d)]),_0x453c62['access_token'];}async function callGetCliToken(_0x27cf16,_0x2f46df){const _0x3c7399=_0x5f2572,_0x1ce377={'aHedj':function(_0x4e7004,_0x21062d,_0x1358a7){return _0x4e7004(_0x21062d,_0x1358a7);},'WsjeQ':'application/json','SnRfB':_0x3c7399(0x19b),'bWZIV':function(_0x2f2855,_0x541ab0){return _0x2f2855(_0x541ab0);},'vlVaf':_0x3c7399(0x1d4),'DjgVN':_0x3c7399(0x174),'wHiCr':'get_cli_token','MZBfW':_0x3c7399(0x1f1),'Hqkps':_0x3c7399(0x1ec),'EZILB':_0x3c7399(0x1e1),'cNSvr':_0x3c7399(0x1b4),'Omzas':function(_0x2f620e,_0xb7c8ff,_0x5a711c){return _0x2f620e(_0xb7c8ff,_0x5a711c);},'ldkjo':'refresh.txt','qEPAO':function(_0x165104,_0x451f6a,_0x529244,_0x351650){return _0x165104(_0x451f6a,_0x529244,_0x351650);},'vdbOg':_0x3c7399(0x1c1),'CVQtK':'Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a'},_0x1d0db3={'Content-Type':_0x1ce377[_0x3c7399(0x18e)],'Accept':_0x1ce377['SnRfB']};_0x2f46df&&(_0x1d0db3[_0x3c7399(0x18b)]=_0x3c7399(0x172)+_0x2f46df);const _0x23c83a=async _0x335b02=>{const _0x1f11b5=_0x3c7399,_0x4d22d0=await _0x1ce377[_0x1f11b5(0x16e)](fetch,_0x27cf16,{'method':'POST','headers':_0x1d0db3,'body':JSON[_0x1f11b5(0x19d)](_0x335b02)});if(!_0x4d22d0['ok']){const _0x5c2657=await _0x4d22d0[_0x1f11b5(0x183)]();throw new Error(_0x1f11b5(0x1c9)+_0x4d22d0['status']+':\x20'+_0x5c2657);}return parseResponse(_0x4d22d0);};process[_0x3c7399(0x17d)]['write']('Initializing\x20MCP\x20session...');const _0x539ae4=await _0x1ce377['bWZIV'](_0x23c83a,{'jsonrpc':'2.0','id':0x1,'method':_0x3c7399(0x1b1),'params':{'protocolVersion':_0x3c7399(0x1f6),'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x1ce377['vlVaf']}}});if(_0x539ae4[_0x3c7399(0x1f7)])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x539ae4[_0x3c7399(0x1f7)]['message']??JSON[_0x3c7399(0x19d)](_0x539ae4[_0x3c7399(0x1f7)])));console['log'](_0x3c7399(0x1f1)),await _0x1ce377[_0x3c7399(0x16e)](fetch,_0x27cf16,{'method':_0x1ce377['DjgVN'],'headers':_0x1d0db3,'body':JSON[_0x3c7399(0x19d)]({'jsonrpc':_0x3c7399(0x1a0),'method':'notifications/initialized'})})['then'](_0x5ce8be=>_0x5ce8be['text']()),process[_0x3c7399(0x17d)]['write'](_0x3c7399(0x1ea));const _0x353b39=await _0x23c83a({'jsonrpc':'2.0','id':0x2,'method':_0x3c7399(0x17a),'params':{'name':_0x1ce377[_0x3c7399(0x1e6)],'arguments':{}}});if(_0x353b39[_0x3c7399(0x1f7)])throw new Error(_0x3c7399(0x1ac)+(_0x353b39[_0x3c7399(0x1f7)][_0x3c7399(0x1d2)]??JSON[_0x3c7399(0x19d)](_0x353b39['error'])));console['log'](_0x1ce377['MZBfW']);const _0x2ac533=extractToken(_0x353b39['result']);if(!_0x2ac533){console['error'](_0x1ce377['Hqkps']),console[_0x3c7399(0x1f7)](JSON[_0x3c7399(0x19d)](_0x353b39[_0x3c7399(0x1bf)],null,0x2));throw new Error(_0x1ce377[_0x3c7399(0x179)]);}const _0x455b34=join(homedir(),_0x1ce377['cNSvr']),_0x2c09f4=_0x1ce377['Omzas'](join,_0x455b34,_0x1ce377[_0x3c7399(0x186)]);await _0x1ce377['Omzas'](mkdir,_0x455b34,{'recursive':!![]}),await writeFile(_0x2c09f4,_0x2ac533,{'mode':0x180}),await _0x1ce377['qEPAO'](writeFile,join(_0x455b34,_0x1ce377[_0x3c7399(0x1e3)]),_0x27cf16,{'mode':0x180}),console['log']('\x0aToken\x20written\x20to\x20'+_0x2c09f4),console['log'](_0x1ce377['CVQtK']);}async function fetchAuthServerMetadata(_0x1646f3){const _0x42c792=_0x5f2572,_0x31e1b0={'adueJ':function(_0x72418e,_0x10107a){return _0x72418e(_0x10107a);}},_0x5deec2=_0x1646f3+'/.well-known/oauth-authorization-server',_0x13eb92=await _0x31e1b0['adueJ'](fetch,_0x5deec2);if(!_0x13eb92['ok'])throw new Error(_0x42c792(0x1da)+_0x5deec2+':\x20'+_0x13eb92['status']);return _0x13eb92['json']();}function waitForCallback(_0x255d57){const _0x80ebd9=_0x5f2572,_0x418161={'EJDCB':function(_0x2df108,_0x570bf4){return _0x2df108!==_0x570bf4;},'dNYAp':'Not\x20found','YweTu':_0x80ebd9(0x1d5),'pWOXQ':'error','YUmhM':_0x80ebd9(0x1dd),'BvzJI':_0x80ebd9(0x192),'aWgsZ':function(_0x4fc463,_0x366119){return _0x4fc463(_0x366119);},'tMWma':'<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','pEDOy':_0x80ebd9(0x1e5),'iiVFS':function(_0x5e2608,_0x13c1cf){return _0x5e2608(_0x13c1cf);},'AHWYZ':function(_0x370553,_0x503081,_0x482774){return _0x370553(_0x503081,_0x482774);}};return new Promise((_0x30d93d,_0x3ad1d6)=>{const _0x46f748=_0x80ebd9,_0x43d60b=_0x418161[_0x46f748(0x185)](setTimeout,()=>{_0x81b389['close'](),_0x3ad1d6(new OAuthTimeoutError('OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes'));},0x1d4c0),_0x81b389=_0x418161['iiVFS'](createServer,(_0xae1b3e,_0xb682f1)=>{const _0x4f90d2=_0x46f748,_0x566b4b=new URL(_0xae1b3e[_0x4f90d2(0x1f3)]??'/',_0x4f90d2(0x173)+CALLBACK_PORT);if(_0x418161[_0x4f90d2(0x18d)](_0x566b4b[_0x4f90d2(0x171)],_0x4f90d2(0x1b6))){_0xb682f1[_0x4f90d2(0x1e2)](0x194),_0xb682f1[_0x4f90d2(0x178)](_0x418161[_0x4f90d2(0x1cb)]);return;}const _0x2523d3=_0x566b4b[_0x4f90d2(0x182)]['get'](_0x418161['YweTu']),_0x11c4c2=_0x566b4b['searchParams']['get']('state'),_0x385b2=_0x566b4b[_0x4f90d2(0x182)]['get'](_0x418161['pWOXQ']);if(_0x385b2){const _0x411684=_0x566b4b['searchParams']['get'](_0x418161['YUmhM'])??_0x385b2;_0xb682f1[_0x4f90d2(0x1e2)](0xc8,{'Content-Type':_0x418161[_0x4f90d2(0x1d0)]}),_0xb682f1[_0x4f90d2(0x178)]('<html><body><h2>Authentication\x20failed</h2><p>'+_0x411684+_0x4f90d2(0x1dc)),clearTimeout(_0x43d60b),_0x81b389['close'](),_0x418161[_0x4f90d2(0x194)](_0x3ad1d6,new Error(_0x4f90d2(0x170)+_0x411684));return;}if(!_0x2523d3||_0x11c4c2!==_0x255d57){_0xb682f1['writeHead'](0x190,{'Content-Type':_0x418161['BvzJI']}),_0xb682f1[_0x4f90d2(0x178)](_0x418161['tMWma']);return;}_0xb682f1[_0x4f90d2(0x1e2)](0xc8,{'Content-Type':'text/html'}),_0xb682f1['end'](_0x418161['pEDOy']),_0x418161['iiVFS'](clearTimeout,_0x43d60b),_0x81b389['close'](),_0x30d93d(_0x2523d3);});_0x81b389[_0x46f748(0x196)](CALLBACK_PORT,_0x46f748(0x198));});}function _0x7552(){const _0x3b0406=['vdbOg','PDmFS','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','wHiCr','status','MCP\x20server\x20returned\x20HTTP\x20','RCYBv','Requesting\x20CLI\x20token...','access_token','\x0aUnexpected\x20response\x20structure:','length','clientId','isTTY','child_process','\x20done','238RxTqjR','url','vjMMP','\x0aOpening\x20browser\x20for\x20authentication...','2025-03-26','error','JdmLu','yIVbk','expires_in','aHedj','qHxzs','OAuth\x20error:\x20','pathname','Bearer\x20','http://localhost:','POST','QImYE','uzbAQ','resource','end','EZILB','tools/call','refreshToken','application/json','stdout','accessToken','origin','content','THwUD','searchParams','text','1157214lRnWBB','AHWYZ','ldkjo','WTepQ','37434bvWyXZ','1468280yqOGgR','JLkMq','Authorization','sha256','EJDCB','WsjeQ','xmATQ','/.well-known/oauth-protected-resource','UiAUz','text/html','Token\x20exchange\x20failed:\x20','aWgsZ','redirect_uri','listen','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','127.0.0.1','365492TGHwyK','wqxrl','application/json,\x20text/event-stream','update','stringify','hNHeX','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','2.0','slice','Unknown\x20error','GgpWT','swNoZ','registration_endpoint','code_challenge_method','eZPew','xPMdc','1629192HVwgRJ','write','Exchanging\x20authorization\x20code...','get_cli_token\x20failed:\x20','trim','xFwYo','iLKGr','toString','initialize','json','none','.ranger','1000690CQrPvH','/callback','S256','PHSCt','utf-8','log','open','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','set','Registering\x20OAuth\x20client...','result','client_id','auth-origin.txt','token_endpoint','JgRTu','hFHVG','djitZ','token','get','pgQkg','HTTP\x20','2WSwURe','dNYAp','match','9XQmeDP','expiresAt','digest','BvzJI','code_challenge','message','now','1.0.0','code','317792oHPNlY','platform','\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','parse','Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20','refresh_token','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','error_description','qQjeA','Ranger\x20CLI','mKjDa','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','writeHead'];_0x7552=function(){return _0x3b0406;};return _0x7552();}async function openBrowser(_0x18ef40){const _0x20e409=_0x5f2572,_0x52a8ef={'GgpWT':function(_0x581164,_0x3cf1dc){return _0x581164===_0x3cf1dc;},'pUgiB':'xdg-open'},{exec:_0x3f6672}=await import(_0x20e409(0x1f0)),_0x586963=process[_0x20e409(0x1d7)]==='darwin'?_0x20e409(0x1bb):_0x52a8ef[_0x20e409(0x1a3)](process['platform'],'win32')?'start':_0x52a8ef['pUgiB'];_0x3f6672(_0x586963+'\x20\x22'+_0x18ef40+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x316f8c=_0x5f2572,_0x2ee3d8={'yOwhE':_0x316f8c(0x1b9),'PHSCt':function(_0x4b60df,_0x144077){return _0x4b60df>_0x144077;}};try{const _0x5091b2=JSON[_0x316f8c(0x1d9)](await readFile(TOKEN_CACHE_PATH,_0x2ee3d8['yOwhE']));if(_0x5091b2[_0x316f8c(0x17f)]&&_0x5091b2[_0x316f8c(0x17f)]!==currentOrigin)return null;if(_0x5091b2['expiresAt']&&_0x2ee3d8[_0x316f8c(0x1b8)](Date[_0x316f8c(0x1d3)](),_0x5091b2[_0x316f8c(0x1ce)]))return null;return _0x5091b2['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0x487108,_0x5cb213,_0x298344){const _0x124c2b=_0x5f2572,_0x440ac8={'xFwYo':function(_0x460434){return _0x460434();},'iLKGr':function(_0x2b02c7,_0x113cef){return _0x2b02c7+_0x113cef;},'THwUD':function(_0x169afe,_0x66584d,_0xdf0612){return _0x169afe(_0x66584d,_0xdf0612);}},_0xb23d25=await _0x440ac8[_0x124c2b(0x1ae)](loadCachedData),_0xa87848={..._0xb23d25,'origin':currentOrigin,'accessToken':_0x487108,'refreshToken':_0x5cb213??_0xb23d25?.[_0x124c2b(0x17b)],'expiresAt':_0x298344?_0x440ac8[_0x124c2b(0x1af)](Date[_0x124c2b(0x1d3)](),_0x298344*0x3e8):undefined};await _0x440ac8[_0x124c2b(0x181)](mkdir,join(homedir(),'.ranger'),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x124c2b(0x19d)](_0xa87848),{'mode':0x180});}function _0x1cee(_0x1fabfc,_0x2fcc19){_0x1fabfc=_0x1fabfc-0x16b;const _0x755234=_0x7552();let _0x1cee83=_0x755234[_0x1fabfc];return _0x1cee83;}async function loadCachedClient(){const _0x7b6afd=_0x5f2572,_0x175911={'sNCvB':function(_0x5af854){return _0x5af854();}},_0x3d9454=await _0x175911['sNCvB'](loadCachedData);if(_0x3d9454?.['origin']&&_0x3d9454[_0x7b6afd(0x17f)]!==currentOrigin)return null;return _0x3d9454?.[_0x7b6afd(0x1ee)]?{'clientId':_0x3d9454[_0x7b6afd(0x1ee)],'clientSecret':_0x3d9454['clientSecret']}:null;}async function clearCachedClient(){const _0x3100b0=_0x5f2572,_0x567cb5=await loadCachedData();if(!_0x567cb5)return;const {clientId:_0x338bb5,clientSecret:_0x52eb71,..._0x1848b1}=_0x567cb5;await writeFile(TOKEN_CACHE_PATH,JSON[_0x3100b0(0x19d)](_0x1848b1),{'mode':0x180});}async function saveCachedClient(_0x1ff7fa,_0x47a70b){const _0x23bc0a=_0x5f2572,_0x460ded={'wdmRE':function(_0x54b6a4,_0x1699b5,_0x490520){return _0x54b6a4(_0x1699b5,_0x490520);},'uzbAQ':function(_0x16dcfd){return _0x16dcfd();},'xPMdc':_0x23bc0a(0x1b4)},_0x21f845=await loadCachedData(),_0x53a24d={..._0x21f845,'origin':currentOrigin,'accessToken':_0x21f845?.[_0x23bc0a(0x17e)]??'','clientId':_0x1ff7fa,'clientSecret':_0x47a70b};await mkdir(_0x460ded['wdmRE'](join,_0x460ded[_0x23bc0a(0x176)](homedir),_0x460ded[_0x23bc0a(0x1a8)]),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x53a24d),{'mode':0x180});}async function loadCachedData(){const _0x8acf81=_0x5f2572,_0x96b421={'PDmFS':function(_0x118958,_0x3f978b,_0x22ad2f){return _0x118958(_0x3f978b,_0x22ad2f);},'swNoZ':'utf-8'};try{return JSON[_0x8acf81(0x1d9)](await _0x96b421[_0x8acf81(0x1e4)](readFile,TOKEN_CACHE_PATH,_0x96b421[_0x8acf81(0x1a4)]));}catch{return null;}}async function parseResponse(_0x2e7af9){const _0x57d967=_0x5f2572,_0x5e67ea={'Aumtv':'content-type','UiAUz':'data:'},_0x1e8fad=_0x2e7af9['headers'][_0x57d967(0x1c7)](_0x5e67ea['Aumtv'])??'';if(_0x1e8fad['includes']('text/event-stream')){const _0x15175a=await _0x2e7af9['text']();for(const _0x22ae1b of _0x15175a['split']('\x0a')){const _0x1aead=_0x22ae1b[_0x57d967(0x1ad)]();if(_0x1aead['startsWith']('data:')){const _0x851ae6=_0x1aead[_0x57d967(0x1a1)](_0x5e67ea[_0x57d967(0x191)][_0x57d967(0x1ed)])[_0x57d967(0x1ad)]();if(!_0x851ae6)continue;try{const _0x52991a=JSON[_0x57d967(0x1d9)](_0x851ae6);if(_0x52991a['id']!==undefined||_0x52991a['error'])return _0x52991a;}catch{}}}throw new Error('No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream');}return _0x2e7af9[_0x57d967(0x1b2)]();}function extractToken(_0x3793f2){const _0x1c29c0=_0x5f2572,_0x3dd8f4={'HItKx':'string','iyHcv':_0x1c29c0(0x1a2),'JgRTu':function(_0x1ce17c,_0x4b0e90){return _0x1ce17c===_0x4b0e90;}};if(!_0x3793f2)return null;const _0x17922f=_0x3793f2['structuredContent'];if(_0x17922f?.['token']&&typeof _0x17922f['token']===_0x3dd8f4['HItKx'])return _0x17922f[_0x1c29c0(0x1c6)];if(_0x3793f2['isError']){const _0x37b73f=_0x3793f2[_0x1c29c0(0x180)];throw new Error('Server\x20returned\x20error:\x20'+(_0x37b73f?.[0x0]?.[_0x1c29c0(0x183)]??_0x3dd8f4['iyHcv']));}const _0x14fb83=_0x3793f2[_0x1c29c0(0x180)];if(_0x14fb83)for(const _0xc0f880 of _0x14fb83){if(_0x3dd8f4[_0x1c29c0(0x1c3)](_0xc0f880['type'],'text')&&_0xc0f880[_0x1c29c0(0x183)]){try{const _0x1ade0f=JSON['parse'](_0xc0f880['text']);if(typeof _0x1ade0f?.['token']===_0x3dd8f4['HItKx'])return _0x1ade0f['token'];}catch{}const _0x5dd85a=_0xc0f880['text'][_0x1c29c0(0x1cc)](/(rngr_[A-Za-z0-9_-]+)/);if(_0x5dd85a)return _0x5dd85a[0x1];}}return null;}
1
+ const _0x573ffa=_0x4aaa;(function(_0x4b6934,_0x3ac533){const _0x632d79=_0x4aaa,_0x1df46e=_0x4b6934();while(!![]){try{const _0x4457ab=parseInt(_0x632d79(0xc4))/0x1*(-parseInt(_0x632d79(0x115))/0x2)+-parseInt(_0x632d79(0x120))/0x3*(parseInt(_0x632d79(0xdf))/0x4)+parseInt(_0x632d79(0xf6))/0x5*(-parseInt(_0x632d79(0xa4))/0x6)+parseInt(_0x632d79(0xe7))/0x7+-parseInt(_0x632d79(0xfc))/0x8*(-parseInt(_0x632d79(0x10c))/0x9)+parseInt(_0x632d79(0xa6))/0xa*(parseInt(_0x632d79(0x109))/0xb)+parseInt(_0x632d79(0xec))/0xc*(parseInt(_0x632d79(0x97))/0xd);if(_0x4457ab===_0x3ac533)break;else _0x1df46e['push'](_0x1df46e['shift']());}catch(_0x4273f5){_0x1df46e['push'](_0x1df46e['shift']());}}}(_0xa9e7,0xae2ad));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger','mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),'.ranger',_0x573ffa(0x10f));function _0x4aaa(_0x2dcf43,_0x1dc2f9){_0x2dcf43=_0x2dcf43-0x8c;const _0xa9e7c7=_0xa9e7();let _0x4aaa57=_0xa9e7c7[_0x2dcf43];return _0x4aaa57;}export async function getMcpAuthOrigin(){const _0x80940a=_0x573ffa,_0x41cbe7={'tceUi':function(_0x466add,_0x357f8b,_0x275ec3){return _0x466add(_0x357f8b,_0x275ec3);}};try{const _0x217cfa=(await _0x41cbe7['tceUi'](readFile,AUTH_ORIGIN_PATH,_0x80940a(0xda)))['trim']();return _0x217cfa||null;}catch{return null;}}export async function mcpBootstrap(){const _0x182d85=_0x573ffa,_0x486bf6={'uTbsp':function(_0x44dfae,_0xb3adb5){return _0x44dfae+_0xb3adb5;},'xcTEp':function(_0x203783,_0x30fc7b){return _0x203783(_0x30fc7b);},'pcqnX':function(_0x72ee81,_0x48b860,_0x12e202){return _0x72ee81(_0x48b860,_0x12e202);}},_0x4c1ec7=getMcpAuthUrl();currentOrigin=_0x4c1ec7;const _0x49576f=process['stdout'][_0x182d85(0x103)]??![];console['log'](_0x182d85(0x99)+_0x4c1ec7+'\x0a');const _0x2c2bfe=await tryUnauthenticated(_0x4c1ec7);let _0x50821b=null;if(_0x2c2bfe===_0x182d85(0xeb))_0x50821b='';else{_0x50821b=await loadCachedToken();if(!_0x50821b){if(!_0x49576f)throw new Error(_0x486bf6[_0x182d85(0x106)]('MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.'));_0x50821b=await _0x486bf6['xcTEp'](oauthFlow,_0x4c1ec7);}}await _0x486bf6['pcqnX'](callGetCliToken,_0x4c1ec7,_0x50821b);}async function tryUnauthenticated(_0x6c2899){const _0x2e3a78=_0x573ffa,_0x27360f={'kSKbc':function(_0x4a8802,_0x1d0df4,_0x43ae1e){return _0x4a8802(_0x1d0df4,_0x43ae1e);},'DzTBW':_0x2e3a78(0x105),'jHSwS':'application/json','GRrgc':'ranger-cli','JNaIQ':'1.0.0','BdEXk':_0x2e3a78(0xeb)},_0x1b6585=await _0x27360f[_0x2e3a78(0xe8)](fetch,_0x6c2899,{'method':_0x27360f[_0x2e3a78(0x11b)],'headers':{'Content-Type':_0x27360f['jHSwS'],'Accept':'application/json,\x20text/event-stream'},'body':JSON['stringify']({'jsonrpc':_0x2e3a78(0xaf),'id':0x1,'method':_0x2e3a78(0x111),'params':{'protocolVersion':_0x2e3a78(0xcd),'capabilities':{},'clientInfo':{'name':_0x27360f['GRrgc'],'version':_0x27360f[_0x2e3a78(0xf2)]}}})});if(_0x1b6585['ok'])return await _0x1b6585['text'](),_0x27360f['BdEXk'];if(_0x1b6585[_0x2e3a78(0xd4)]===0x191)return await _0x1b6585[_0x2e3a78(0x116)](),_0x2e3a78(0x114);const _0x41e065=await _0x1b6585[_0x2e3a78(0x116)]();throw new Error(_0x2e3a78(0xcb)+_0x1b6585[_0x2e3a78(0xd4)]+':\x20'+_0x41e065);}class OAuthTimeoutError extends Error{constructor(_0x6f9c2){const _0x256310=_0x573ffa,_0x15418c={'WLHRf':_0x256310(0x95)};super(_0x6f9c2),this['name']=_0x15418c['WLHRf'];}}async function oauthFlow(_0x3a581c){const _0x49c1a9=_0x573ffa,_0x17a18b={'pXmSx':function(_0x2c88dd,_0x1518c4){return _0x2c88dd instanceof _0x1518c4;},'JbSqS':function(_0x40270a){return _0x40270a();},'eRKAU':'\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'};try{return await oauthFlowAttempt(_0x3a581c);}catch(_0x43a6be){if(_0x17a18b['pXmSx'](_0x43a6be,OAuthTimeoutError)&&await _0x17a18b['JbSqS'](loadCachedClient))return console[_0x49c1a9(0x9f)](_0x17a18b['eRKAU']),await clearCachedClient(),await oauthFlowAttempt(_0x3a581c);throw _0x43a6be;}}async function oauthFlowAttempt(_0x512a3a){const _0x2aac60=_0x573ffa,_0x5d448f={'wkuxK':_0x2aac60(0xd8),'UzrCV':function(_0x3bc32a,_0xdcc696){return _0x3bc32a(_0xdcc696);},'kVAeH':function(_0x17ca69){return _0x17ca69();},'QWQuk':'Registering\x20OAuth\x20client...','nZZtN':_0x2aac60(0x92),'SaMrS':'Ranger\x20CLI','ZOZwt':'code','jBtNa':'none','hULhS':'Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','KFoMA':function(_0x502cee,_0x52c405){return _0x502cee(_0x52c405);},'Akobv':'base64url','rSOvA':'hex','VnAYM':_0x2aac60(0xb5),'QLXkf':'client_id','lfUFH':'redirect_uri','QIGWX':'code_challenge','mmpMF':'S256','XazWt':'authorization_code','asIzS':_0x2aac60(0x102),'vdgTf':'POST','UvAMA':function(_0x3f92d6,_0x5065c3,_0x53482a,_0xea3f21){return _0x3f92d6(_0x5065c3,_0x53482a,_0xea3f21);}},_0x30b396=_0x512a3a['replace'](/\/mcp$/,'');process['stdout']['write']('Discovering\x20authorization\x20server...');const _0x4fa545=await fetch(_0x30b396+_0x2aac60(0x108));if(!_0x4fa545['ok'])throw new Error(_0x5d448f[_0x2aac60(0x98)]);const _0x4abee2=await _0x4fa545['json'](),_0x4b7f52=_0x4abee2[_0x2aac60(0x8c)]?.[0x0];if(!_0x4b7f52)throw new Error(_0x2aac60(0xb9));console[_0x2aac60(0x9f)]('\x20'+_0x4b7f52);const _0x438405=await _0x5d448f[_0x2aac60(0xf4)](fetchAuthServerMetadata,_0x4b7f52);let _0x3dd795,_0x4c183b;const _0x27403d=await _0x5d448f['kVAeH'](loadCachedClient);if(_0x27403d)_0x3dd795=_0x27403d['clientId'],_0x4c183b=_0x27403d[_0x2aac60(0xaa)];else{if(_0x438405['registration_endpoint']){process[_0x2aac60(0xea)][_0x2aac60(0x110)](_0x5d448f['QWQuk']);const _0xb52060=await fetch(_0x438405[_0x2aac60(0xe9)],{'method':_0x2aac60(0x105),'headers':{'Content-Type':_0x5d448f['nZZtN']},'body':JSON['stringify']({'client_name':_0x5d448f['SaMrS'],'redirect_uris':['http://localhost:'+CALLBACK_PORT+_0x2aac60(0xee)],'grant_types':[_0x2aac60(0xc1),_0x2aac60(0xe3)],'response_types':[_0x5d448f['ZOZwt']],'token_endpoint_auth_method':_0x5d448f[_0x2aac60(0xef)]})});if(!_0xb52060['ok']){const _0x1f7e4d=await _0xb52060['text']();throw new Error('Client\x20registration\x20failed:\x20'+_0x1f7e4d);}const _0x52f02e=await _0xb52060[_0x2aac60(0xf8)]();_0x3dd795=_0x52f02e['client_id'],_0x4c183b=_0x52f02e['client_secret'],await saveCachedClient(_0x3dd795,_0x4c183b),console[_0x2aac60(0x9f)]('\x20done');}else throw new Error(_0x5d448f[_0x2aac60(0xc5)]);}const _0x363a6a=_0x5d448f['KFoMA'](randomBytes,0x20)[_0x2aac60(0xc6)](_0x5d448f[_0x2aac60(0xfe)]),_0x4d3f8f=createHash('sha256')['update'](_0x363a6a)['digest'](_0x5d448f[_0x2aac60(0xfe)]),_0x4d0d42=randomBytes(0x10)[_0x2aac60(0xc6)](_0x5d448f[_0x2aac60(0xcf)]),_0x51a347=new URL(_0x438405[_0x2aac60(0xbb)]);_0x51a347[_0x2aac60(0xd7)][_0x2aac60(0xf9)](_0x5d448f[_0x2aac60(0xa8)],_0x5d448f['ZOZwt']),_0x51a347[_0x2aac60(0xd7)]['set'](_0x5d448f['QLXkf'],_0x3dd795),_0x51a347['searchParams']['set'](_0x5d448f['lfUFH'],'http://localhost:'+CALLBACK_PORT+_0x2aac60(0xee)),_0x51a347['searchParams'][_0x2aac60(0xf9)](_0x5d448f[_0x2aac60(0xd9)],_0x4d3f8f),_0x51a347['searchParams']['set'](_0x2aac60(0xb6),_0x5d448f[_0x2aac60(0xbd)]),_0x51a347[_0x2aac60(0xd7)][_0x2aac60(0xf9)]('state',_0x4d0d42);_0x4abee2['resource']&&_0x51a347['searchParams']['set'](_0x2aac60(0x102),_0x4abee2[_0x2aac60(0x102)]);console['log']('\x0aOpening\x20browser\x20for\x20authentication...'),console[_0x2aac60(0x9f)](_0x2aac60(0x96)+_0x51a347[_0x2aac60(0xc6)]()+'\x0a'),await openBrowser(_0x51a347['toString']());const _0x1d12da=await waitForCallback(_0x4d0d42);process[_0x2aac60(0xea)][_0x2aac60(0x110)](_0x2aac60(0xa0));const _0x1faaa5=new URLSearchParams({'grant_type':_0x5d448f[_0x2aac60(0x11f)],'code':_0x1d12da,'redirect_uri':_0x2aac60(0xf5)+CALLBACK_PORT+'/callback','client_id':_0x3dd795,'code_verifier':_0x363a6a});_0x4c183b&&_0x1faaa5[_0x2aac60(0xf9)](_0x2aac60(0x11d),_0x4c183b);_0x4abee2['resource']&&_0x1faaa5[_0x2aac60(0xf9)](_0x5d448f['asIzS'],_0x4abee2['resource']);const _0x3df96d=await fetch(_0x438405[_0x2aac60(0xb3)],{'method':_0x5d448f[_0x2aac60(0xe4)],'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x1faaa5});if(!_0x3df96d['ok']){const _0x1c594f=await _0x3df96d[_0x2aac60(0x116)]();throw new Error(_0x2aac60(0xb8)+_0x1c594f);}const _0x2caf49=await _0x3df96d['json']();return console[_0x2aac60(0x9f)](_0x2aac60(0xc3)),await _0x5d448f[_0x2aac60(0xa2)](saveCachedToken,_0x2caf49['access_token'],_0x2caf49[_0x2aac60(0xe3)],_0x2caf49['expires_in']),_0x2caf49['access_token'];}async function callGetCliToken(_0x48c0bf,_0x37d28e){const _0x2559cd=_0x573ffa,_0x45996b={'KFejv':function(_0x34c7f6,_0x4d7ed2,_0x455076){return _0x34c7f6(_0x4d7ed2,_0x455076);},'Dhmwc':'POST','vqiCg':function(_0x52efec,_0x5c2a11){return _0x52efec(_0x5c2a11);},'nqTlv':_0x2559cd(0xd2),'SRGjr':_0x2559cd(0xe5),'JVCBn':function(_0xd438bc,_0xef73f5){return _0xd438bc(_0xef73f5);},'tpbPm':_0x2559cd(0xaf),'lnsmF':'initialize','HqNDn':_0x2559cd(0xb1),'vCQoJ':'\x20done','odGgJ':'Requesting\x20CLI\x20token...','iElpb':'\x0aUnexpected\x20response\x20structure:','CzwQG':'Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','OLyxZ':function(_0x895b10,_0x581a65,_0x12666c){return _0x895b10(_0x581a65,_0x12666c);},'uclwX':'.ranger','MikZV':function(_0x474658,_0x1c85ba,_0x5a5d13){return _0x474658(_0x1c85ba,_0x5a5d13);},'PWWkA':'auth-origin.txt'},_0x1c6471={'Content-Type':_0x2559cd(0x92),'Accept':'application/json,\x20text/event-stream'};_0x37d28e&&(_0x1c6471[_0x45996b['nqTlv']]=_0x2559cd(0xce)+_0x37d28e);const _0xfcd018=async _0x3b55f9=>{const _0x22f15a=_0x2559cd,_0x4ebd90=await _0x45996b['KFejv'](fetch,_0x48c0bf,{'method':_0x45996b['Dhmwc'],'headers':_0x1c6471,'body':JSON['stringify'](_0x3b55f9)});if(!_0x4ebd90['ok']){const _0xb495e2=await _0x4ebd90[_0x22f15a(0x116)]();throw new Error(_0x22f15a(0xb0)+_0x4ebd90['status']+':\x20'+_0xb495e2);}return _0x45996b[_0x22f15a(0xe0)](parseResponse,_0x4ebd90);};process[_0x2559cd(0xea)]['write'](_0x45996b[_0x2559cd(0x117)]);const _0x40eed=await _0x45996b['JVCBn'](_0xfcd018,{'jsonrpc':_0x45996b['tpbPm'],'id':0x1,'method':_0x45996b[_0x2559cd(0xc0)],'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x2559cd(0x94),'version':_0x45996b['HqNDn']}}});if(_0x40eed[_0x2559cd(0x9e)])throw new Error(_0x2559cd(0xe1)+(_0x40eed['error'][_0x2559cd(0x10e)]??JSON['stringify'](_0x40eed['error'])));console[_0x2559cd(0x9f)](_0x45996b['vCQoJ']),await _0x45996b[_0x2559cd(0xab)](fetch,_0x48c0bf,{'method':_0x2559cd(0x105),'headers':_0x1c6471,'body':JSON['stringify']({'jsonrpc':_0x45996b['tpbPm'],'method':'notifications/initialized'})})[_0x2559cd(0xed)](_0xeb981f=>_0xeb981f[_0x2559cd(0x116)]()),process[_0x2559cd(0xea)]['write'](_0x45996b[_0x2559cd(0x11a)]);const _0x14e6a9=await _0xfcd018({'jsonrpc':_0x45996b[_0x2559cd(0xbc)],'id':0x2,'method':'tools/call','params':{'name':'get_cli_token','arguments':{}}});if(_0x14e6a9['error'])throw new Error('get_cli_token\x20failed:\x20'+(_0x14e6a9[_0x2559cd(0x9e)][_0x2559cd(0x10e)]??JSON['stringify'](_0x14e6a9[_0x2559cd(0x9e)])));console[_0x2559cd(0x9f)](_0x2559cd(0xc3));const _0x274806=extractToken(_0x14e6a9[_0x2559cd(0x10a)]);if(!_0x274806){console['error'](_0x45996b[_0x2559cd(0xc7)]),console['error'](JSON[_0x2559cd(0xfb)](_0x14e6a9[_0x2559cd(0x10a)],null,0x2));throw new Error(_0x45996b[_0x2559cd(0xf7)]);}const _0x4e051a=_0x45996b[_0x2559cd(0x93)](join,homedir(),_0x45996b[_0x2559cd(0x10d)]),_0x2bd4de=join(_0x4e051a,_0x2559cd(0xb4));await mkdir(_0x4e051a,{'recursive':!![]}),await writeFile(_0x2bd4de,_0x274806,{'mode':0x180}),await writeFile(_0x45996b[_0x2559cd(0xfa)](join,_0x4e051a,_0x45996b['PWWkA']),_0x48c0bf,{'mode':0x180}),console[_0x2559cd(0x9f)]('\x0aToken\x20written\x20to\x20'+_0x2bd4de),console['log']('Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a');}async function fetchAuthServerMetadata(_0x592ae9){const _0x4b2f7e=_0x573ffa,_0x30b96e={'bBpKW':function(_0x3a1f7f,_0xd34a49){return _0x3a1f7f(_0xd34a49);}},_0x219b85=_0x592ae9+'/.well-known/oauth-authorization-server',_0x2151b0=await _0x30b96e['bBpKW'](fetch,_0x219b85);if(!_0x2151b0['ok'])throw new Error(_0x4b2f7e(0xd5)+_0x219b85+':\x20'+_0x2151b0['status']);return _0x2151b0[_0x4b2f7e(0xf8)]();}function waitForCallback(_0x5c531f){const _0x392473=_0x573ffa,_0x373689={'bRXtX':'/callback','XFSsx':'code','qxjsE':_0x392473(0x9e),'LoFUs':'error_description','uDizR':function(_0x54645a,_0x4ae2b5){return _0x54645a!==_0x4ae2b5;},'otvmB':_0x392473(0x100),'BunMQ':_0x392473(0x90),'quozI':_0x392473(0x8e),'djqvK':function(_0x3b1a1f){return _0x3b1a1f();},'ZlQPP':function(_0x124ef7,_0x29ec68){return _0x124ef7(_0x29ec68);},'xDDIk':_0x392473(0xa9)};return new Promise((_0x526f27,_0x3c6974)=>{const _0x20466e=_0x392473,_0x2550f9=()=>{const _0x4408e4=_0x4aaa;_0x23f247[_0x4408e4(0x8f)](),_0x23f247[_0x4408e4(0xd1)]();},_0x495426=setTimeout(()=>{const _0x53b7fa=_0x4aaa;_0x2550f9(),_0x3c6974(new OAuthTimeoutError(_0x53b7fa(0xca)));},0x1d4c0),_0x23f247=_0x373689['ZlQPP'](createServer,(_0x50e1c9,_0x210244)=>{const _0x25f169=_0x4aaa,_0x305f6e=new URL(_0x50e1c9[_0x25f169(0x9b)]??'/',_0x25f169(0xf5)+CALLBACK_PORT);if(_0x305f6e['pathname']!==_0x373689[_0x25f169(0xf3)]){_0x210244[_0x25f169(0xff)](0x194),_0x210244['end']('Not\x20found');return;}const _0x1f31c4=_0x305f6e['searchParams'][_0x25f169(0xbe)](_0x373689[_0x25f169(0xc8)]),_0x4bec8e=_0x305f6e['searchParams'][_0x25f169(0xbe)](_0x25f169(0x9c)),_0x387671=_0x305f6e['searchParams']['get'](_0x373689['qxjsE']);if(_0x387671){const _0x20a119=_0x305f6e['searchParams']['get'](_0x373689[_0x25f169(0xd0)])??_0x387671;_0x210244['writeHead'](0xc8,{'Content-Type':_0x25f169(0x100)}),_0x210244[_0x25f169(0x11c)](_0x25f169(0xfd)+_0x20a119+'</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>'),clearTimeout(_0x495426),_0x2550f9(),_0x3c6974(new Error('OAuth\x20error:\x20'+_0x20a119));return;}if(!_0x1f31c4||_0x373689['uDizR'](_0x4bec8e,_0x5c531f)){_0x210244[_0x25f169(0xff)](0x190,{'Content-Type':_0x373689['otvmB']}),_0x210244[_0x25f169(0x11c)](_0x373689[_0x25f169(0xf0)]);return;}_0x210244[_0x25f169(0xff)](0xc8,{'Content-Type':_0x373689[_0x25f169(0xe2)]}),_0x210244[_0x25f169(0x11c)](_0x373689[_0x25f169(0x113)]),clearTimeout(_0x495426),_0x373689['djqvK'](_0x2550f9),_0x373689[_0x25f169(0xd3)](_0x526f27,_0x1f31c4);});_0x23f247['listen'](CALLBACK_PORT,_0x373689[_0x20466e(0x91)]);});}async function openBrowser(_0x11f6e4){const _0x437e05=_0x573ffa,_0x5ca8e4={'quTpe':function(_0x54be6b,_0x385c06){return _0x54be6b===_0x385c06;},'UILkJ':'darwin','kZSET':_0x437e05(0xbf),'fHeCC':'xdg-open'},_0x2c2da8=_0x5ca8e4[_0x437e05(0xdb)](process['platform'],_0x5ca8e4[_0x437e05(0x107)])?_0x5ca8e4['kZSET']:_0x5ca8e4['quTpe'](process['platform'],'win32')?'start':_0x5ca8e4[_0x437e05(0xc9)];exec(_0x2c2da8+'\x20\x22'+_0x11f6e4+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x356564=_0x573ffa,_0x21abb1={'SIlFr':function(_0x1d29e9,_0x4e96f0,_0x5eff61){return _0x1d29e9(_0x4e96f0,_0x5eff61);},'WxqoG':'utf-8','LIEFp':function(_0x219c0d,_0x264d40){return _0x219c0d!==_0x264d40;},'HWzuP':function(_0x480a9c,_0x18742a){return _0x480a9c>_0x18742a;}};try{const _0x328ace=JSON[_0x356564(0x9a)](await _0x21abb1['SIlFr'](readFile,TOKEN_CACHE_PATH,_0x21abb1['WxqoG']));if(_0x328ace['origin']&&_0x21abb1['LIEFp'](_0x328ace[_0x356564(0xcc)],currentOrigin))return null;if(_0x328ace[_0x356564(0xc2)]&&_0x21abb1['HWzuP'](Date[_0x356564(0xa5)](),_0x328ace['expiresAt']))return null;return _0x328ace['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0x58a761,_0x1e1c73,_0x2d6d72){const _0x4f141a=_0x573ffa,_0x429b3c={'PiXLj':function(_0x2cd435){return _0x2cd435();},'vrUAo':function(_0x450a1d,_0x3f61c0){return _0x450a1d+_0x3f61c0;},'NtwWn':function(_0x3e19ac,_0x4fff36,_0x432267){return _0x3e19ac(_0x4fff36,_0x432267);},'TDymW':function(_0x33437b){return _0x33437b();},'uuJPl':'.ranger'},_0x5eafd4=await _0x429b3c['PiXLj'](loadCachedData),_0x32c6bc={..._0x5eafd4,'origin':currentOrigin,'accessToken':_0x58a761,'refreshToken':_0x1e1c73??_0x5eafd4?.[_0x4f141a(0xf1)],'expiresAt':_0x2d6d72?_0x429b3c[_0x4f141a(0x10b)](Date[_0x4f141a(0xa5)](),_0x2d6d72*0x3e8):undefined};await mkdir(_0x429b3c[_0x4f141a(0x101)](join,_0x429b3c['TDymW'](homedir),_0x429b3c['uuJPl']),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x4f141a(0xfb)](_0x32c6bc),{'mode':0x180});}async function loadCachedClient(){const _0x270259=_0x573ffa,_0x2c3da0={'apVNG':function(_0x58bcfc){return _0x58bcfc();}},_0x250330=await _0x2c3da0[_0x270259(0x9d)](loadCachedData);if(_0x250330?.['origin']&&_0x250330['origin']!==currentOrigin)return null;return _0x250330?.['clientId']?{'clientId':_0x250330['clientId'],'clientSecret':_0x250330[_0x270259(0xaa)]}:null;}async function clearCachedClient(){const _0xedabc6=_0x573ffa,_0x5545bb={'YjzKz':function(_0x4b2dc5){return _0x4b2dc5();},'tuObB':function(_0x49a91d,_0x208a1c,_0x4368d5,_0x27f7bf){return _0x49a91d(_0x208a1c,_0x4368d5,_0x27f7bf);}},_0x4b3ce3=await _0x5545bb['YjzKz'](loadCachedData);if(!_0x4b3ce3)return;const {clientId:_0x54f86f,clientSecret:_0x34cc5b,..._0x17b60b}=_0x4b3ce3;await _0x5545bb[_0xedabc6(0xd6)](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x17b60b),{'mode':0x180});}async function saveCachedClient(_0x4f1201,_0x81d8c4){const _0x930a27=_0x573ffa,_0x5df611={'DMIar':function(_0x2ee403,_0x177633,_0xc44df8){return _0x2ee403(_0x177633,_0xc44df8);},'VEHkf':_0x930a27(0xa3),'QyIIh':function(_0x1b5525,_0xcfd6d8,_0x2a7f69,_0x1d52f1){return _0x1b5525(_0xcfd6d8,_0x2a7f69,_0x1d52f1);}},_0x47b80c=await loadCachedData(),_0x50ccaa={..._0x47b80c,'origin':currentOrigin,'accessToken':_0x47b80c?.['accessToken']??'','clientId':_0x4f1201,'clientSecret':_0x81d8c4};await mkdir(_0x5df611[_0x930a27(0xa7)](join,homedir(),_0x5df611['VEHkf']),{'recursive':!![]}),await _0x5df611['QyIIh'](writeFile,TOKEN_CACHE_PATH,JSON[_0x930a27(0xfb)](_0x50ccaa),{'mode':0x180});}function _0xa9e7(){const _0x2868ec=['NtwWn','resource','isTTY','startsWith','POST','uTbsp','UILkJ','/.well-known/oauth-protected-resource','66wpHIpe','result','vrUAo','257571QHBtXD','uclwX','message','auth-origin.txt','write','initialize','string','quozI','needs-oauth','2611598KWCrqV','text','SRGjr','structuredContent','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','odGgJ','DzTBW','end','client_secret','token','XazWt','3yKuIHj','authorization_servers','text/event-stream','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','closeAllConnections','<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','xDDIk','application/json','OLyxZ','ranger-cli','OAuthTimeoutError','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','9583717OhRKcU','wkuxK','\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20','parse','url','state','apVNG','error','log','Exchanging\x20authorization\x20code...','RUDAV','UvAMA','.ranger','5972874Pzfbpb','now','2342890eIlPck','DMIar','VnAYM','127.0.0.1','clientSecret','KFejv','content','isError','length','2.0','HTTP\x20','1.0.0','Server\x20returned\x20error:\x20','token_endpoint','refresh.txt','response_type','code_challenge_method','data:','Token\x20exchange\x20failed:\x20','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','FiSCt','authorization_endpoint','tpbPm','mmpMF','get','open','lnsmF','authorization_code','expiresAt','\x20done','1KjzGys','hULhS','toString','iElpb','XFSsx','fHeCC','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','MCP\x20server\x20returned\x20HTTP\x20','origin','2025-03-26','Bearer\x20','rSOvA','LoFUs','close','Authorization','ZlQPP','status','Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20','tuObB','searchParams','Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','QIGWX','utf-8','quTpe','trim','match','headers','3789608WTTqkv','vqiCg','MCP\x20initialize\x20failed:\x20','otvmB','refresh_token','vdgTf','Initializing\x20MCP\x20session...','alcaZ','7725557iYUKrU','kSKbc','registration_endpoint','stdout','proxied','12XBEnGs','then','/callback','jBtNa','BunMQ','refreshToken','JNaIQ','bRXtX','UzrCV','http://localhost:','5VoeJff','CzwQG','json','set','MikZV','stringify','200OHpXaM','<html><body><h2>Authentication\x20failed</h2><p>','Akobv','writeHead','text/html'];_0xa9e7=function(){return _0x2868ec;};return _0xa9e7();}async function loadCachedData(){const _0x9895c8=_0x573ffa,_0x131573={'alcaZ':'utf-8'};try{return JSON['parse'](await readFile(TOKEN_CACHE_PATH,_0x131573[_0x9895c8(0xe6)]));}catch{return null;}}async function parseResponse(_0x4a5db0){const _0xf5123d=_0x573ffa,_0x23bd5e={'dCJmH':_0xf5123d(0x8d),'RUDAV':function(_0x3bfb06,_0x28e9f2){return _0x3bfb06!==_0x28e9f2;}},_0x47fc36=_0x4a5db0[_0xf5123d(0xde)][_0xf5123d(0xbe)]('content-type')??'';if(_0x47fc36['includes'](_0x23bd5e['dCJmH'])){const _0x52453c=await _0x4a5db0['text']();for(const _0x18e44d of _0x52453c['split']('\x0a')){const _0x297e08=_0x18e44d[_0xf5123d(0xdc)]();if(_0x297e08[_0xf5123d(0x104)](_0xf5123d(0xb7))){const _0x35a2e0=_0x297e08['slice']('data:'[_0xf5123d(0xae)])['trim']();if(!_0x35a2e0)continue;try{const _0x4babcd=JSON[_0xf5123d(0x9a)](_0x35a2e0);if(_0x23bd5e[_0xf5123d(0xa1)](_0x4babcd['id'],undefined)||_0x4babcd['error'])return _0x4babcd;}catch{}}}throw new Error(_0xf5123d(0x119));}return _0x4a5db0[_0xf5123d(0xf8)]();}function extractToken(_0x1f0cb5){const _0x2ab6db=_0x573ffa,_0x20f157={'FiSCt':function(_0x1cd781,_0x2ead48){return _0x1cd781===_0x2ead48;},'cHDlF':'string'};if(!_0x1f0cb5)return null;const _0x18d43e=_0x1f0cb5[_0x2ab6db(0x118)];if(_0x18d43e?.[_0x2ab6db(0x11e)]&&typeof _0x18d43e[_0x2ab6db(0x11e)]===_0x2ab6db(0x112))return _0x18d43e[_0x2ab6db(0x11e)];if(_0x1f0cb5[_0x2ab6db(0xad)]){const _0x477cc8=_0x1f0cb5['content'];throw new Error(_0x2ab6db(0xb2)+(_0x477cc8?.[0x0]?.['text']??'Unknown\x20error'));}const _0x270c81=_0x1f0cb5[_0x2ab6db(0xac)];if(_0x270c81)for(const _0x307802 of _0x270c81){if(_0x20f157[_0x2ab6db(0xba)](_0x307802['type'],_0x2ab6db(0x116))&&_0x307802['text']){try{const _0x2ca980=JSON[_0x2ab6db(0x9a)](_0x307802['text']);if(_0x20f157['FiSCt'](typeof _0x2ca980?.[_0x2ab6db(0x11e)],_0x20f157['cHDlF']))return _0x2ca980[_0x2ab6db(0x11e)];}catch{}const _0x4cdce8=_0x307802[_0x2ab6db(0x116)][_0x2ab6db(0xdd)](/(rngr_[A-Za-z0-9_-]+)/);if(_0x4cdce8)return _0x4cdce8[0x1];}}return null;}
@@ -1 +1 @@
1
- (function(_0x1eb8ce,_0x54d33a){const _0x1a655c=_0x5484,_0x1186f9=_0x1eb8ce();while(!![]){try{const _0x43f0c7=parseInt(_0x1a655c(0x13d))/0x1*(-parseInt(_0x1a655c(0x172))/0x2)+parseInt(_0x1a655c(0x184))/0x3*(-parseInt(_0x1a655c(0x137))/0x4)+parseInt(_0x1a655c(0x17f))/0x5*(-parseInt(_0x1a655c(0x147))/0x6)+-parseInt(_0x1a655c(0x145))/0x7*(-parseInt(_0x1a655c(0x181))/0x8)+-parseInt(_0x1a655c(0x154))/0x9*(-parseInt(_0x1a655c(0x150))/0xa)+-parseInt(_0x1a655c(0x182))/0xb*(-parseInt(_0x1a655c(0x165))/0xc)+-parseInt(_0x1a655c(0x164))/0xd*(-parseInt(_0x1a655c(0x149))/0xe);if(_0x43f0c7===_0x54d33a)break;else _0x1186f9['push'](_0x1186f9['shift']());}catch(_0x9b33c5){_0x1186f9['push'](_0x1186f9['shift']());}}}(_0x55e8,0x40360));import{readFile,rm}from'fs/promises';import{existsSync}from'fs';function _0x55e8(){const _0x50bda5=['750WhKfBW','XIGHv','14vUUlFv','ePjOb','eXFFX','profileName','kind','origin','XUjFR','2626420lVpXpa',':\x20failed\x20to\x20delete\x20local\x20dir\x20','prompt','IRwOp','18MWJIgb','bdoHJ','join','jiCVk','BKrNz','\x20profile','stdin','log','PYCuf','zxqhY','skip',',\x20preserving\x20baseUrl\x20','environments','FZUyD','domains','MjItr','8432125AZYnOF','261396xQmahW','\x20failed','\x20\x20⚠\x20','settings','No\x20local\x20profiles\x20found\x20to\x20migrate.',',\x20baseUrl\x20override\x20→\x20projects.json)','cwd','Qnwgu','\x20migrated\x20to\x20cloud\x20(env:\x20','envKey','no\x20baseUrl\x20in\x20settings.json','vyJrF','all','2338zYxRzW','sYudY','OHhQk','Could\x20not\x20fetch\x20auth\x20config\x20(','trackPhaseEnd','nwBOe','UMVLB',':\x20failed\x20to\x20save\x20credentials\x20(','\x20failed:\x20','\x20local\x20director','gitTrackedRanger',').\x20Cloud\x20profile\x20created;\x20local\x20auth.json\x20left\x20in\x20place.','FGEZm','6865yCRBKI','push','9280ukxaAY','44UeBlgC','profile.migrate.skipped','3XpUswZ','length','toISOString','\x20skipped','some','Continuing\x20with\x20migration...','ies','status','wBNAr','Aborted.','Proceed?','padEnd','1575116cOXdYR','parse','authJsonPath','trackPhaseStart','OBfHp','dryRun','381tSRjrq','Warning:\x20.ranger/\x20is\x20tracked\x20in\x20this\x20git\x20repo.','yes','message',':\x20failed\x20to\x20write\x20projects.json\x20override\x20(','preserveBaseUrl','baseUrl',').\x20Run:\x20ranger\x20setup','77sLuQyn','\x20\x20git\x20rm\x20-r\x20--cached\x20.ranger/'];_0x55e8=function(){return _0x50bda5;};return _0x55e8();}import{join}from'path';import _0x21ff36 from'inquirer';import{getEnvNames}from'./env.js';import{getEnvDir,loadSettings}from'./utils/settings.js';import{getRangerDir}from'./utils/rangerRoot.js';import{ApiError,createCloudProfile,fetchAuthConfig,saveCloudProfileCredentials,uploadCloudProfileSession}from'./utils/cloudProfile.js';import{matchAuthEnvironment}from'./utils/matchAuthEnvironment.js';import{readProjectsConfig,setProfileOverride,writeProjectsConfig}from'./utils/projectsConfig.js';function _0x5484(_0x12bd2b,_0xdaf48e){_0x12bd2b=_0x12bd2b-0x134;const _0x55e8ba=_0x55e8();let _0x5484b7=_0x55e8ba[_0x12bd2b];return _0x5484b7;}import{isPathGitTracked}from'./utils/gitTracked.js';function formatPlanLine(_0x34ae33){const _0x442364=_0x5484,_0x32dc59={'YtLVV':'skip'};if(_0x34ae33[_0x442364(0x14d)]===_0x32dc59['YtLVV'])return'\x20\x20'+_0x34ae33['profileName'][_0x442364(0x136)](0x1e)+'\x20→\x20skip\x20('+_0x34ae33['reason']+')';if(_0x34ae33[_0x442364(0x142)]&&_0x34ae33['baseUrl'])return'\x20\x20'+_0x34ae33[_0x442364(0x14c)]['padEnd'](0x1e)+'\x20→\x20cloud\x20(env:\x20'+_0x34ae33[_0x442364(0x16e)]+_0x442364(0x15f)+_0x34ae33[_0x442364(0x143)]+'\x20as\x20project\x20override)';if(_0x34ae33['baseUrl'])return'\x20\x20'+_0x34ae33['profileName']['padEnd'](0x1e)+'\x20→\x20cloud\x20(env:\x20'+_0x34ae33[_0x442364(0x16e)]+',\x20matches\x20'+_0x34ae33['baseUrl']+')';return'\x20\x20'+_0x34ae33[_0x442364(0x14c)][_0x442364(0x136)](0x1e)+'\x20→\x20cloud\x20(env:\x20'+_0x34ae33['envKey']+')';}function shouldWarnGitTrackedOnce(_0xd9def1){const _0x5e9f32=_0x5484,_0x2c310e={'ePjOb':function(_0xa8555d,_0x45b692){return _0xa8555d===_0x45b692;}},_0x53885a=readProjectsConfig(),_0x40ba57=_0x53885a['projects'][_0xd9def1]??={},_0x49ba1f=_0x40ba57['_warnings']??={},_0x30d9bb=_0x49ba1f[_0x5e9f32(0x17c)],_0x2a820c=new Date(),_0x4e9212=_0x2a820c[_0x5e9f32(0x186)]()['slice'](0x0,0xa);if(_0x2c310e[_0x5e9f32(0x14a)](_0x30d9bb,_0x4e9212))return![];return _0x49ba1f['gitTrackedRanger']=_0x4e9212,writeProjectsConfig(_0x53885a),!![];}export async function migrateProfile(_0x31c1c9,_0x374d59){const _0x56342e=_0x5484,_0x489d06={'vyJrF':function(_0x1cd492,_0x2a1635){return _0x1cd492 instanceof _0x2a1635;},'sYudY':function(_0x51037a,_0x42c025){return _0x51037a(_0x42c025);},'zxqhY':'No\x20cloud\x20profile\x20auth\x20config\x20found\x20for\x20this\x20org.\x20Migration\x20requires\x20at\x20least\x20one\x20configured\x20auth\x20environment.','OHhQk':function(_0xd7b83f){return _0xd7b83f();},'UMVLB':function(_0xcfb09a,_0x673a75){return _0xcfb09a===_0x673a75;},'nwBOe':function(_0x817653,_0x5b981f){return _0x817653===_0x5b981f;},'XIGHv':_0x56342e(0x15e),'gNZtZ':_0x56342e(0x16f),'PYCuf':function(_0x2d60c1,_0x4968d9,_0x2c7eb7){return _0x2d60c1(_0x4968d9,_0x2c7eb7);},'apqVv':'no\x20matching\x20auth\x20env','Qnwgu':function(_0x164023,_0x41183f){return _0x164023===_0x41183f;},'ZVWGS':'Nothing\x20migrated.\x20Run\x20without\x20--dry-run\x20to\x20apply.','bdoHJ':function(_0x24669d,_0x189f28){return _0x24669d&&_0x189f28;},'FZUyD':'confirm','BKrNz':'proceed','VEahh':function(_0x3d2834){return _0x3d2834();},'FGEZm':function(_0x4c4961,_0x49f699){return _0x4c4961(_0x49f699);},'cpMAZ':function(_0x268246,_0x40e8e8){return _0x268246(_0x40e8e8);},'wBNAr':'After\x20migration,\x20uncommit\x20it:','XUjFR':_0x56342e(0x146),'gRHYC':'\x20\x20echo\x20\x27.ranger/\x27\x20>>\x20.gitignore','JGxzG':_0x56342e(0x189),'ASPLp':function(_0x37fc61,_0x1c6b03,_0x23e8de,_0x1f51d0){return _0x37fc61(_0x1c6b03,_0x23e8de,_0x1f51d0);},'MjItr':'name_conflict','ZMeTo':'utf-8','OBfHp':function(_0x32ed09,_0x3515ed,_0x430aa5){return _0x32ed09(_0x3515ed,_0x430aa5);},'ZVBVE':function(_0x3e95ed,_0x56efd5){return _0x3e95ed instanceof _0x56efd5;},'IRwOp':function(_0x262dc0,_0x1791b1,_0x22baa6,_0x18adb1,_0x51c670){return _0x262dc0(_0x1791b1,_0x22baa6,_0x18adb1,_0x51c670);},'glZhz':'baseUrl','cyLVE':function(_0x10221e,_0x2cb7a0){return _0x10221e(_0x2cb7a0);},'NcypQ':function(_0x1f99aa,_0x3c78a9){return _0x1f99aa(_0x3c78a9);},'NNzDd':function(_0x49a931,_0x35f2a7){return _0x49a931 instanceof _0x35f2a7;},'QKhAp':'profile.migrate.failed','Ebrbl':function(_0x5005f2,_0x15d1a5){return _0x5005f2===_0x15d1a5;},'eXFFX':function(_0x297045,_0x24d96a){return _0x297045>_0x24d96a;},'jiCVk':function(_0x2c1ea3,_0x253cdf){return _0x2c1ea3+_0x253cdf;}};if(!_0x31c1c9[_0x56342e(0x14c)]&&!_0x31c1c9[_0x56342e(0x171)])throw new Error('Provide\x20a\x20profile\x20name\x20or\x20--all.\x0a\x20\x20Example:\x20ranger\x20profile\x20migrate\x20--all\x20--dry-run');let _0x370618;try{_0x370618=await fetchAuthConfig();}catch(_0x423d30){throw new Error(_0x56342e(0x175)+(_0x489d06['vyJrF'](_0x423d30,Error)?_0x423d30[_0x56342e(0x140)]:_0x489d06[_0x56342e(0x173)](String,_0x423d30))+_0x56342e(0x144));}if(!_0x370618||!_0x370618[_0x56342e(0x160)]||Object['keys'](_0x370618[_0x56342e(0x160)])[_0x56342e(0x185)]===0x0)throw new Error(_0x489d06[_0x56342e(0x15d)]);const _0x71ca2a=[];if(_0x31c1c9['all']){const {envNames:_0xaf46fc,envTypes:_0x4c2628}=await _0x489d06[_0x56342e(0x174)](getEnvNames);for(const _0x59bd73 of _0xaf46fc){if(_0x489d06[_0x56342e(0x178)](_0x4c2628[_0x59bd73],'ci'))continue;_0x71ca2a['push'](_0x59bd73);}}else _0x31c1c9[_0x56342e(0x14c)]&&_0x71ca2a['push'](_0x31c1c9['profileName']);if(_0x489d06['nwBOe'](_0x71ca2a[_0x56342e(0x185)],0x0)){console[_0x56342e(0x15b)](_0x56342e(0x169));return;}const _0x2845f9=[];for(const _0x17b89b of _0x71ca2a){const _0x31f002=_0x489d06[_0x56342e(0x173)](getEnvDir,_0x17b89b);if(!existsSync(_0x31f002)){_0x2845f9[_0x56342e(0x180)]({'kind':_0x489d06['XIGHv'],'profileName':_0x17b89b,'reason':'local\x20profile\x20directory\x20not\x20found'});continue;}const _0x46bb85=await _0x489d06['sYudY'](loadSettings,_0x17b89b),_0x3f538c=_0x46bb85[_0x56342e(0x143)];if(!_0x3f538c){_0x2845f9[_0x56342e(0x180)]({'kind':_0x489d06['XIGHv'],'profileName':_0x17b89b,'reason':_0x489d06['gNZtZ']});continue;}const _0x550254=_0x489d06[_0x56342e(0x15c)](matchAuthEnvironment,_0x3f538c,_0x370618);if(!_0x550254){_0x2845f9[_0x56342e(0x180)]({'kind':_0x489d06[_0x56342e(0x148)],'profileName':_0x17b89b,'reason':_0x489d06['apqVv']});continue;}const _0x4f5c5c=_0x370618['environments'][_0x550254],_0x495b80=_0x4f5c5c?.[_0x56342e(0x162)]??[],_0x3b9f4c=_0x495b80[_0x56342e(0x188)](_0x1f78e3=>{const _0x37dad5=_0x56342e;try{return new URL(_0x1f78e3)[_0x37dad5(0x14e)]===new URL(_0x3f538c)['origin'];}catch{return![];}}),_0x19386b={};for(const [_0x3fd7b3,_0x43261a]of Object['entries'](_0x46bb85)){if(_0x489d06['Qnwgu'](_0x3fd7b3,'baseUrl'))continue;if(_0x489d06['nwBOe'](_0x43261a,undefined))continue;_0x19386b[_0x3fd7b3]=_0x43261a;}!_0x3b9f4c&&(_0x19386b['baseUrl']=_0x3f538c);const _0xcdabc8=_0x489d06['PYCuf'](join,_0x31f002,'auth.json'),_0x10599e=_0x489d06['sYudY'](existsSync,_0xcdabc8);_0x2845f9['push']({'kind':'migrate','profileName':_0x17b89b,'envKey':_0x550254,'baseUrl':_0x3f538c,'preserveBaseUrl':!_0x3b9f4c,'settings':_0x19386b,'authJsonPath':_0x10599e?_0xcdabc8:null});}console[_0x56342e(0x15b)]('Plan:');for(const _0x3f767e of _0x2845f9){console[_0x56342e(0x15b)](formatPlanLine(_0x3f767e));}if(_0x31c1c9[_0x56342e(0x13c)]){console[_0x56342e(0x15b)](_0x489d06['ZVWGS']);return;}const _0x93b40a=Boolean(process[_0x56342e(0x15a)]['isTTY']&&process['stdout']['isTTY']),_0xd1aae=_0x2845f9[_0x56342e(0x188)](_0x1af40c=>_0x1af40c[_0x56342e(0x14d)]==='migrate');if(_0x489d06[_0x56342e(0x155)](_0xd1aae,_0x93b40a)&&!_0x31c1c9[_0x56342e(0x13f)]){const {proceed:_0x14774f}=await _0x21ff36[_0x56342e(0x152)]([{'type':_0x489d06[_0x56342e(0x161)],'name':_0x489d06[_0x56342e(0x158)],'message':_0x56342e(0x135),'default':![]}]);if(!_0x14774f){console['log'](_0x56342e(0x134));return;}}const _0x258724=_0x489d06['VEahh'](getRangerDir);let _0x33534f=![];if(_0x489d06['FGEZm'](existsSync,_0x258724))try{_0x33534f=await isPathGitTracked(_0x258724);}catch{_0x33534f=![];}_0x33534f&&_0x489d06['cpMAZ'](shouldWarnGitTrackedOnce,process['cwd']())&&(console['log'](_0x56342e(0x13e)),console['log'](_0x489d06[_0x56342e(0x18c)]),console['log'](_0x489d06[_0x56342e(0x14f)]),console[_0x56342e(0x15b)](_0x489d06['gRHYC']),console[_0x56342e(0x15b)](_0x489d06['JGxzG']));let _0x26a1e4=0x0,_0x4eaf18=0x0,_0x25337a=0x0,_0x43615b=0x0;for(const _0x357724 of _0x2845f9){if(_0x357724['kind']===_0x56342e(0x15e)){_0x43615b++,_0x374d59?.['trackPhaseEnd'](_0x56342e(0x183),{'profileName':_0x357724[_0x56342e(0x14c)],'reason':_0x357724['reason']});continue;}_0x374d59?.[_0x56342e(0x13a)]('profile.migrate.started',{'profileName':_0x357724['profileName'],'envKey':_0x357724[_0x56342e(0x16e)]});try{try{await _0x489d06['ASPLp'](createCloudProfile,_0x357724['profileName'],_0x357724[_0x56342e(0x16e)],{'settings':_0x357724[_0x56342e(0x168)]});}catch(_0x26cdf8){if(_0x489d06[_0x56342e(0x170)](_0x26cdf8,ApiError)&&_0x489d06[_0x56342e(0x177)](_0x26cdf8[_0x56342e(0x18b)],0x199)){console['log'](_0x56342e(0x167)+_0x357724[_0x56342e(0x14c)]+':\x20cloud\x20profile\x20with\x20this\x20name\x20already\x20exists.\x20Skipping.'),_0x43615b++,_0x374d59?.[_0x56342e(0x176)]('profile.migrate.skipped',{'profileName':_0x357724[_0x56342e(0x14c)],'reason':_0x489d06[_0x56342e(0x163)]});continue;}throw _0x26cdf8;}let _0xf6c1bd=![],_0x39d9d5=![];if(_0x357724['authJsonPath'])try{const _0x24c64a=await readFile(_0x357724[_0x56342e(0x139)],_0x489d06['ZMeTo']),_0x17e7be=JSON[_0x56342e(0x138)](_0x24c64a);await _0x489d06[_0x56342e(0x13b)](uploadCloudProfileSession,_0x357724[_0x56342e(0x14c)],_0x17e7be),_0xf6c1bd=!![];}catch(_0x23e747){_0x39d9d5=!![],console[_0x56342e(0x15b)](_0x56342e(0x167)+_0x357724['profileName']+':\x20session\x20upload\x20failed\x20('+(_0x489d06['ZVBVE'](_0x23e747,Error)?_0x23e747['message']:_0x489d06['FGEZm'](String,_0x23e747))+_0x56342e(0x17d));}let _0x44445b=![];if(_0x31c1c9['saveCreds']){const _0x5a0c31=process['env']['RANGER_TEST_USERNAME'],_0x6f4aae=process['env']['RANGER_TEST_PASSWORD'];if(_0x5a0c31&&_0x6f4aae)try{await saveCloudProfileCredentials(_0x357724['profileName'],_0x5a0c31,_0x6f4aae),_0x44445b=!![];}catch(_0x294fcd){console['log']('\x20\x20⚠\x20'+_0x357724[_0x56342e(0x14c)]+_0x56342e(0x179)+(_0x294fcd instanceof Error?_0x294fcd[_0x56342e(0x140)]:String(_0x294fcd))+').');}else console[_0x56342e(0x15b)](_0x56342e(0x167)+_0x357724[_0x56342e(0x14c)]+':\x20--save-creds\x20requested,\x20but\x20RANGER_TEST_USERNAME/PASSWORD\x20not\x20set\x20in\x20env.');}if(_0x357724[_0x56342e(0x142)]&&_0x357724['baseUrl'])try{_0x489d06[_0x56342e(0x153)](setProfileOverride,process[_0x56342e(0x16b)](),_0x357724[_0x56342e(0x14c)],_0x489d06['glZhz'],_0x357724[_0x56342e(0x143)]);}catch(_0x20155b){console[_0x56342e(0x15b)]('\x20\x20⚠\x20'+_0x357724[_0x56342e(0x14c)]+_0x56342e(0x141)+(_0x20155b instanceof Error?_0x20155b[_0x56342e(0x140)]:String(_0x20155b))+').');}const _0x480fff=_0x489d06['cyLVE'](getEnvDir,_0x357724['profileName']);if(!_0x39d9d5&&_0x489d06['NcypQ'](existsSync,_0x480fff))try{await rm(_0x480fff,{'recursive':!![],'force':!![]}),_0x4eaf18++;}catch(_0x335668){console[_0x56342e(0x15b)](_0x56342e(0x167)+_0x357724['profileName']+_0x56342e(0x151)+_0x480fff+'\x20('+(_0x489d06['NNzDd'](_0x335668,Error)?_0x335668[_0x56342e(0x140)]:_0x489d06[_0x56342e(0x17e)](String,_0x335668))+').');}_0x26a1e4++,_0x357724[_0x56342e(0x142)]&&_0x357724[_0x56342e(0x143)]?console[_0x56342e(0x15b)]('\x20\x20✓\x20'+_0x357724['profileName']+_0x56342e(0x16d)+_0x357724[_0x56342e(0x16e)]+_0x56342e(0x16a)):console['log']('\x20\x20✓\x20'+_0x357724[_0x56342e(0x14c)]+'\x20migrated\x20to\x20cloud\x20(env:\x20'+_0x357724['envKey']+')'),_0x374d59?.['trackPhaseEnd']('profile.migrate.succeeded',{'profileName':_0x357724['profileName'],'envKey':_0x357724[_0x56342e(0x16e)],'wasGitTracked':_0x33534f,'hadSession':_0xf6c1bd,'savedCreds':_0x44445b});}catch(_0x2170c3){_0x25337a++,console['log']('\x20\x20✗\x20'+_0x357724[_0x56342e(0x14c)]+_0x56342e(0x17a)+(_0x489d06['NNzDd'](_0x2170c3,Error)?_0x2170c3['message']:String(_0x2170c3))),_0x374d59?.['trackPhaseEnd'](_0x489d06['QKhAp'],{'profileName':_0x357724['profileName'],'error':_0x2170c3 instanceof Error?_0x2170c3[_0x56342e(0x140)]:_0x489d06['sYudY'](String,_0x2170c3)});}}const _0xeb76cc=[];if(_0x26a1e4>0x0)_0xeb76cc[_0x56342e(0x180)](_0x26a1e4+_0x56342e(0x159)+(_0x489d06[_0x56342e(0x16c)](_0x26a1e4,0x1)?'':'s')+'\x20migrated');if(_0x4eaf18>0x0)_0xeb76cc[_0x56342e(0x180)]('Deleted\x20'+_0x4eaf18+_0x56342e(0x17b)+(_0x489d06['Ebrbl'](_0x4eaf18,0x1)?'y':_0x56342e(0x18a)));if(_0x489d06[_0x56342e(0x14b)](_0x43615b,0x0))_0xeb76cc['push'](_0x43615b+_0x56342e(0x187));if(_0x25337a>0x0)_0xeb76cc[_0x56342e(0x180)](_0x25337a+_0x56342e(0x166));if(_0x489d06[_0x56342e(0x14b)](_0xeb76cc[_0x56342e(0x185)],0x0))console[_0x56342e(0x15b)](_0x489d06[_0x56342e(0x157)](_0xeb76cc[_0x56342e(0x156)]('.\x20'),'.'));}
1
+ (function(_0x14aabc,_0x5b0bb6){var _0x989c0e=_0x5175,_0x24c07a=_0x14aabc();while(!![]){try{var _0x155fa9=parseInt(_0x989c0e(0x1cc))/0x1+-parseInt(_0x989c0e(0x1db))/0x2*(parseInt(_0x989c0e(0x1de))/0x3)+parseInt(_0x989c0e(0x1d5))/0x4*(parseInt(_0x989c0e(0x1d2))/0x5)+parseInt(_0x989c0e(0x1da))/0x6+-parseInt(_0x989c0e(0x1d8))/0x7*(parseInt(_0x989c0e(0x1d3))/0x8)+parseInt(_0x989c0e(0x1d0))/0x9+parseInt(_0x989c0e(0x1cd))/0xa;if(_0x155fa9===_0x5b0bb6)break;else _0x24c07a['push'](_0x24c07a['shift']());}catch(_0x4dea74){_0x24c07a['push'](_0x24c07a['shift']());}}}(_0x364d,0xac6e2));export async function migrateProfile(_0x9bc307,_0x17b9a2){var _0x4af773=_0x5175,_0x18b227={'lmGBX':function(_0x250b06,_0x46eb1a){return _0x250b06+_0x46eb1a;},'jTBck':function(_0x53fb28,_0x24fd69){return _0x53fb28+_0x24fd69;},'RkDET':'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','VpWTi':_0x4af773(0x1d6),'AwWTn':_0x4af773(0x1d4)};console[_0x4af773(0x1d1)](_0x18b227['lmGBX'](_0x18b227['lmGBX'](_0x18b227['lmGBX'](_0x18b227[_0x4af773(0x1d9)](_0x18b227['jTBck'](_0x4af773(0x1cf),'\x0a'),'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a')+_0x4af773(0x1d7),'\x0a')+_0x18b227[_0x4af773(0x1dc)],_0x18b227[_0x4af773(0x1dd)]),'\x0a')+_0x18b227[_0x4af773(0x1ce)]+'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.'),process[_0x4af773(0x1cb)](0x1);}function _0x5175(_0x2ec8b4,_0x1181c8){_0x2ec8b4=_0x2ec8b4-0x1cb;var _0x364d17=_0x364d();var _0x517525=_0x364d17[_0x2ec8b4];return _0x517525;}function _0x364d(){var _0x1bc8dc=['3KVBqIg','exit','919890mroZmN','3626920MfHhVK','AwWTn','ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','6699357hwUKXL','error','1214335GWYjIX','248QAxcbE','Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a','12IDoqkr','\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','224413KhkLjo','lmGBX','1894818TRhxTC','2742512WdXizv','RkDET','VpWTi'];_0x364d=function(){return _0x1bc8dc;};return _0x364d();}
@@ -1 +1 @@
1
- (function(_0x56b255,_0x483dfb){const _0x46fc41=_0x5771,_0x3ba5cb=_0x56b255();while(!![]){try{const _0x2fbc2c=-parseInt(_0x46fc41(0x151))/0x1+-parseInt(_0x46fc41(0x157))/0x2*(parseInt(_0x46fc41(0x15a))/0x3)+-parseInt(_0x46fc41(0x15f))/0x4*(-parseInt(_0x46fc41(0x142))/0x5)+parseInt(_0x46fc41(0x137))/0x6*(-parseInt(_0x46fc41(0x13e))/0x7)+parseInt(_0x46fc41(0x141))/0x8+parseInt(_0x46fc41(0x154))/0x9+parseInt(_0x46fc41(0x136))/0xa;if(_0x2fbc2c===_0x483dfb)break;else _0x3ba5cb['push'](_0x3ba5cb['shift']());}catch(_0x112da1){_0x3ba5cb['push'](_0x3ba5cb['shift']());}}}(_0x34eb,0x40c46));import{join}from'path';function _0x5771(_0x39ee5e,_0x441388){_0x39ee5e=_0x39ee5e-0x133;const _0x34eb84=_0x34eb();let _0x577111=_0x34eb84[_0x39ee5e];return _0x577111;}import{existsSync}from'fs';import _0x27bd48 from'inquirer';import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';function _0x34eb(){const _0x420ec2=['ranger','SKILL.md','lLBFy','ranger@trailhead','CtjEC','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','136103jgNXsk','wantsSkillup','plugin','1146366cNJTsF','error','trailhead','16090tfNOEo','pfjIn','log','60LCbZNj','prompt','✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','CJgoD','user','182656eJHEZg','add','KLfTw','confirm','✓\x20Ranger\x20skills\x20already\x20installed','\x0a📦\x20Claude\x20Code\x20Plugin\x0a','3718730dqNMBA','2226MwtMVk','Where\x20should\x20the\x20plugin\x20be\x20installed?','project','bOqzQ','ranger-testing/trailhead','✓\x20Marketplace\x20already\x20added','Would\x20you\x20like\x20to\x20install\x20skills?','4445VSJOWo','.claude','\x0aYou\x20can\x20install\x20manually\x20with:','1293080lcFkwJ','15PKwKZy','❌\x20Failed\x20to\x20add\x20marketplace:','yDQhp','Project\x20(shared\x20with\x20team\x20via\x20git)','NOTJn','pluginScope','ZvnRg','vaKuW','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'];_0x34eb=function(){return _0x420ec2;};return _0x34eb();}export async function ensureClaudePlugin(_0x211733){const _0x310feb=_0x5771,_0x5d6858={'CtjEC':function(_0x1688c7,_0x405e8f,_0x25c745){return _0x1688c7(_0x405e8f,_0x25c745);},'ryZrk':'.claude','QvGDx':_0x310feb(0x139),'LlzWO':'list','ngHAM':_0x310feb(0x13c),'oINsj':_0x310feb(0x153),'Qaxqw':_0x310feb(0x160),'bOqzQ':_0x310feb(0x140),'yDQhp':'install','AsqSf':_0x310feb(0x15c),'kukpM':'enable','CJgoD':'already\x20enabled'},_0x89d195=await isPluginInstalled(_0x310feb(0x14e));if(_0x89d195)return console['log'](_0x310feb(0x150)),![];const _0x41dd4d=existsSync(_0x5d6858[_0x310feb(0x14f)](join,getProjectRoot(),_0x5d6858['ryZrk']));let _0x447f80;if(_0x211733)_0x447f80=_0x211733;else{if(_0x41dd4d)_0x447f80=_0x5d6858['QvGDx'];else{console[_0x310feb(0x159)](_0x310feb(0x135));const _0x3f8c21=await _0x27bd48['prompt']([{'type':_0x5d6858['LlzWO'],'name':_0x310feb(0x147),'message':_0x310feb(0x138),'choices':[{'name':'User\x20(available\x20in\x20all\x20your\x20projects)','value':_0x310feb(0x15e)},{'name':_0x310feb(0x145),'value':_0x5d6858['QvGDx']}],'default':'user'}]);_0x447f80=_0x3f8c21['pluginScope'];}}console[_0x310feb(0x159)]('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x447f80+'\x20level)...\x0a');const _0x816502=await isMarketplaceAdded(_0x310feb(0x156));let _0x40b605=_0x816502;if(_0x816502)console['log'](_0x5d6858['ngHAM']);else{const _0x472700=await runClaudeCommand([_0x5d6858['oINsj'],'marketplace',_0x5d6858['Qaxqw'],_0x310feb(0x13b)]);!_0x472700['success']?(console['error'](_0x310feb(0x143),_0x472700[_0x310feb(0x155)]),console['log'](_0x5d6858[_0x310feb(0x13a)]),console[_0x310feb(0x159)]('\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead'),console[_0x310feb(0x159)]('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x447f80)):_0x40b605=!![];}if(_0x40b605){const _0x249093=await runClaudeCommand([_0x310feb(0x153),_0x5d6858[_0x310feb(0x144)],_0x310feb(0x14e),'--scope',_0x447f80]);if(!_0x249093['success'])console['error']('❌\x20Failed\x20to\x20install\x20plugin:',_0x249093[_0x310feb(0x155)]),console['log'](_0x5d6858['bOqzQ']),console[_0x310feb(0x159)](_0x310feb(0x14a)+_0x447f80);else{console['log'](_0x5d6858['AsqSf']);const _0x9ed9ac=[_0x310feb(0x153),_0x5d6858['kukpM'],'ranger@trailhead'];_0x447f80===_0x310feb(0x139)&&_0x9ed9ac['push']('--scope',_0x5d6858['QvGDx']);const _0x1ac25d=await runClaudeCommand(_0x9ed9ac,{'captureOutput':!![]}),_0x2e03db=_0x1ac25d['output']?.['includes'](_0x5d6858[_0x310feb(0x15d)]);!_0x1ac25d['success']&&!_0x2e03db?console['error']('⚠\x20Failed\x20to\x20enable\x20plugin:',_0x1ac25d['error']):console[_0x310feb(0x159)]('✓\x20Claude\x20Code\x20plugin\x20enabled');}}return!![];}export async function ensureClaudeSkills(_0x6cf58a){const _0x3337a1=_0x5771,_0x355da4={'pfjIn':function(_0x54bcf4,_0x20f8ed,_0x2c521d,_0x550183){return _0x54bcf4(_0x20f8ed,_0x2c521d,_0x550183);},'lLBFy':function(_0x39e0ef,_0xca7025){return _0x39e0ef(_0xca7025);},'znCCn':_0x3337a1(0x14c),'vuPtf':_0x3337a1(0x139),'ZvnRg':'ranger','KLfTw':function(_0xd063bf,_0x1320ac){return _0xd063bf||_0x1320ac;},'vaKuW':function(_0x546c70,_0x3c37c5,_0x3a6a57){return _0x546c70(_0x3c37c5,_0x3a6a57);},'NOTJn':function(_0x128ef5){return _0x128ef5();},'mGCEC':function(_0x1c8e30,_0x488799){return _0x1c8e30(_0x488799);}},_0xfb3dfc=existsSync(_0x355da4[_0x3337a1(0x158)](join,_0x355da4[_0x3337a1(0x14d)](getSkillsDir,_0x3337a1(0x15e)),_0x3337a1(0x14b),_0x355da4['znCCn'])),_0x4fe792=_0x355da4['lLBFy'](existsSync,_0x355da4['pfjIn'](join,_0x355da4[_0x3337a1(0x14d)](getSkillsDir,_0x355da4['vuPtf']),_0x355da4[_0x3337a1(0x148)],_0x355da4['znCCn']));if(_0x355da4[_0x3337a1(0x161)](_0xfb3dfc,_0x4fe792))return console[_0x3337a1(0x159)](_0x3337a1(0x134)),![];const _0x924797=_0x355da4['lLBFy'](existsSync,_0x355da4[_0x3337a1(0x149)](join,_0x355da4[_0x3337a1(0x146)](getProjectRoot),_0x3337a1(0x13f)));let _0x3b1bca=!![];if(_0x6cf58a)await skillup({'autoInstall':_0x6cf58a,'suppressUsage':!![]});else{if(_0x924797)await _0x355da4['lLBFy'](skillup,{'autoInstall':'project','suppressUsage':!![]});else{const _0x599844=await _0x27bd48[_0x3337a1(0x15b)]([{'type':_0x3337a1(0x133),'name':_0x3337a1(0x152),'message':_0x3337a1(0x13d),'default':!![]}]);_0x3b1bca=_0x599844[_0x3337a1(0x152)],_0x3b1bca&&await _0x355da4['mGCEC'](skillup,{'suppressUsage':!![]});}}return _0x3b1bca;}
1
+ (function(_0x3ba8e9,_0x57e6f4){const _0x463352=_0x449c,_0x55f96f=_0x3ba8e9();while(!![]){try{const _0x53e46d=-parseInt(_0x463352(0x1fc))/0x1*(parseInt(_0x463352(0x1f2))/0x2)+-parseInt(_0x463352(0x1e4))/0x3*(parseInt(_0x463352(0x1e3))/0x4)+parseInt(_0x463352(0x1f4))/0x5*(-parseInt(_0x463352(0x1fe))/0x6)+parseInt(_0x463352(0x20e))/0x7*(-parseInt(_0x463352(0x205))/0x8)+-parseInt(_0x463352(0x204))/0x9+-parseInt(_0x463352(0x1ff))/0xa+parseInt(_0x463352(0x1fa))/0xb*(parseInt(_0x463352(0x200))/0xc);if(_0x53e46d===_0x57e6f4)break;else _0x55f96f['push'](_0x55f96f['shift']());}catch(_0x340389){_0x55f96f['push'](_0x55f96f['shift']());}}}(_0x5d65,0x590e5));import{join}from'path';import{existsSync}from'fs';import _0x472b62 from'inquirer';import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';function _0x449c(_0x47c5a8,_0x287c73){_0x47c5a8=_0x47c5a8-0x1da;const _0x5d65dc=_0x5d65();let _0x449cf0=_0x5d65dc[_0x47c5a8];return _0x449cf0;}export async function ensureClaudePlugin(_0x52aaaa){const _0x4ba0cd=_0x449c,_0x1df320={'zXADC':function(_0x8fcdbb,_0x4e0db3){return _0x8fcdbb(_0x4e0db3);},'tyNgP':'ranger@trailhead','zRjxr':_0x4ba0cd(0x214),'cMpqc':'project','UxNqk':'\x0a📦\x20Claude\x20Code\x20Plugin\x0a','ldhXJ':'Where\x20should\x20the\x20plugin\x20be\x20installed?','cfzdk':_0x4ba0cd(0x1f0),'zIgrX':function(_0x3c783f,_0x59bf56){return _0x3c783f(_0x59bf56);},'PfZDA':_0x4ba0cd(0x1e8),'XFXtF':_0x4ba0cd(0x1fb),'oqfMO':_0x4ba0cd(0x20c),'Pqukx':_0x4ba0cd(0x21a),'MibWo':function(_0x4fd026,_0x476f9b){return _0x4fd026===_0x476f9b;},'XTuFU':_0x4ba0cd(0x20f),'iJarn':_0x4ba0cd(0x1e7),'pjZBZ':_0x4ba0cd(0x1ee),'wzgQM':function(_0x3f835f,_0x147eb9,_0xe5a136){return _0x3f835f(_0x147eb9,_0xe5a136);},'IguQl':function(_0x5ef568){return _0x5ef568();},'oNxpW':_0x4ba0cd(0x1da),'DrycD':_0x4ba0cd(0x1db)},_0x25aa85=await _0x1df320['zXADC'](isPluginInstalled,_0x1df320[_0x4ba0cd(0x1dc)]);if(_0x25aa85)return console[_0x4ba0cd(0x1de)](_0x1df320['zRjxr']),![];const _0x5be21e=existsSync(join(getProjectRoot(),_0x4ba0cd(0x218)));let _0x4e2186;if(_0x52aaaa)_0x4e2186=_0x52aaaa;else{if(_0x5be21e)_0x4e2186=_0x1df320['cMpqc'];else{console['log'](_0x1df320[_0x4ba0cd(0x206)]);const _0x50c467=await _0x472b62[_0x4ba0cd(0x21c)]([{'type':'list','name':'pluginScope','message':_0x1df320['ldhXJ'],'choices':[{'name':_0x4ba0cd(0x1f6),'value':_0x1df320['cfzdk']},{'name':_0x4ba0cd(0x217),'value':_0x1df320['cMpqc']}],'default':_0x1df320[_0x4ba0cd(0x20d)]}]);_0x4e2186=_0x50c467[_0x4ba0cd(0x1df)];}}console[_0x4ba0cd(0x1de)](_0x4ba0cd(0x210)+_0x4e2186+'\x20level)...\x0a');const _0x1c521b=await _0x1df320[_0x4ba0cd(0x213)](isMarketplaceAdded,_0x1df320[_0x4ba0cd(0x20a)]);let _0x262bc9=_0x1c521b;if(_0x1c521b)console[_0x4ba0cd(0x1de)](_0x1df320[_0x4ba0cd(0x1f1)]);else{const _0x2d247e=await _0x1df320[_0x4ba0cd(0x1e6)](runClaudeCommand,[_0x4ba0cd(0x1e7),_0x1df320[_0x4ba0cd(0x1f9)],_0x1df320[_0x4ba0cd(0x219)],'ranger-testing/trailhead']);!_0x2d247e['success']?(console['error'](_0x4ba0cd(0x21b),_0x2d247e['error']),console[_0x4ba0cd(0x1de)]('\x0aYou\x20can\x20install\x20manually\x20with:'),console[_0x4ba0cd(0x1de)]('\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead'),console['log']('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x4e2186)):_0x262bc9=!![];}if(_0x262bc9){const _0x5b68fc=await runClaudeCommand([_0x4ba0cd(0x1e7),'install',_0x4ba0cd(0x1dd),'--scope',_0x4e2186],{'cwd':_0x1df320[_0x4ba0cd(0x1f5)](_0x4e2186,_0x1df320['cMpqc'])?getProjectRoot():undefined});if(!_0x5b68fc['success'])console[_0x4ba0cd(0x1e5)](_0x1df320[_0x4ba0cd(0x1f3)],_0x5b68fc[_0x4ba0cd(0x1e5)]),console[_0x4ba0cd(0x1de)](_0x4ba0cd(0x1e9)),console[_0x4ba0cd(0x1de)](_0x4ba0cd(0x1eb)+_0x4e2186);else{console['log'](_0x4ba0cd(0x203));const _0x5c6b62=[_0x1df320[_0x4ba0cd(0x1ec)],_0x4ba0cd(0x209),_0x1df320[_0x4ba0cd(0x1dc)]];_0x4e2186===_0x1df320['cMpqc']&&_0x5c6b62[_0x4ba0cd(0x201)](_0x1df320['pjZBZ'],'project');const _0x48a141=await _0x1df320[_0x4ba0cd(0x1e2)](runClaudeCommand,_0x5c6b62,{'captureOutput':!![],'cwd':_0x4e2186===_0x1df320[_0x4ba0cd(0x1e1)]?_0x1df320['IguQl'](getProjectRoot):undefined}),_0x1e9e2d=_0x48a141['output']?.['includes'](_0x4ba0cd(0x211));!_0x48a141[_0x4ba0cd(0x216)]&&!_0x1e9e2d?console['error'](_0x1df320['oNxpW'],_0x48a141['error']):console[_0x4ba0cd(0x1de)](_0x1df320['DrycD']);}}return!![];}function _0x5d65(){const _0x55eeb5=['\x0aYou\x20can\x20install\x20manually\x20with:','mPdIL','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','iJarn','HidOh','--scope','Rialy','user','XFXtF','52OYvInW','XTuFU','5505Biixse','MibWo','User\x20(available\x20in\x20all\x20your\x20projects)','MHeGu','SKILL.md','oqfMO','10109dzjuzV','✓\x20Marketplace\x20already\x20added','1046GydQLV','✓\x20Ranger\x20skills\x20already\x20installed','2004GAISGD','6769840rywIws','37476PpYJhj','push','OhChW','✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','6359139bxrUXD','5192MsOShK','UxNqk','project','ranger','enable','PfZDA','Would\x20you\x20like\x20to\x20install\x20skills?','marketplace','cfzdk','7721HUgIAG','❌\x20Failed\x20to\x20install\x20plugin:','\x0aInstalling\x20Claude\x20Code\x20plugin\x20(','already\x20enabled','iImXv','zIgrX','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','TdGNC','success','Project\x20(shared\x20with\x20team\x20via\x20git)','.claude','Pqukx','add','❌\x20Failed\x20to\x20add\x20marketplace:','prompt','WsJXP','⚠\x20Failed\x20to\x20enable\x20plugin:','✓\x20Claude\x20Code\x20plugin\x20enabled','tyNgP','ranger@trailhead','log','pluginScope','wantsSkillup','cMpqc','wzgQM','10932jstuLf','12OTQGvf','error','zXADC','plugin','trailhead'];_0x5d65=function(){return _0x55eeb5;};return _0x5d65();}export async function ensureClaudeSkills(_0x53762e){const _0x5eb65e=_0x449c,_0x296823={'OhChW':function(_0x25881d,_0x2e1e4c,_0x4d820b,_0xd8a7db){return _0x25881d(_0x2e1e4c,_0x4d820b,_0xd8a7db);},'TdGNC':function(_0x5265e3,_0x2adaf7){return _0x5265e3(_0x2adaf7);},'HidOh':'user','cFXxS':_0x5eb65e(0x208),'iscIM':_0x5eb65e(0x1f8),'WsJXP':function(_0x972c07,_0x5892dd){return _0x972c07(_0x5892dd);},'MHeGu':function(_0x2dd8a,_0x1978cb,_0x50fd41){return _0x2dd8a(_0x1978cb,_0x50fd41);},'iImXv':'confirm','mPdIL':_0x5eb65e(0x1e0),'Rialy':function(_0x3951c8,_0x236b53){return _0x3951c8(_0x236b53);}},_0x19a3be=existsSync(_0x296823[_0x5eb65e(0x202)](join,_0x296823[_0x5eb65e(0x215)](getSkillsDir,_0x296823[_0x5eb65e(0x1ed)]),_0x296823['cFXxS'],_0x5eb65e(0x1f8))),_0x4e32cb=existsSync(join(getSkillsDir('project'),_0x296823['cFXxS'],_0x296823['iscIM']));if(_0x19a3be||_0x4e32cb)return console['log'](_0x5eb65e(0x1fd)),![];const _0x514f6f=_0x296823[_0x5eb65e(0x21d)](existsSync,_0x296823[_0x5eb65e(0x1f7)](join,getProjectRoot(),'.claude'));let _0x35d59b=!![];if(_0x53762e)await skillup({'autoInstall':_0x53762e,'suppressUsage':!![]});else{if(_0x514f6f)await skillup({'autoInstall':_0x5eb65e(0x207),'suppressUsage':!![]});else{const _0x3fb2a6=await _0x472b62['prompt']([{'type':_0x296823[_0x5eb65e(0x212)],'name':_0x296823[_0x5eb65e(0x1ea)],'message':_0x5eb65e(0x20b),'default':!![]}]);_0x35d59b=_0x3fb2a6[_0x5eb65e(0x1e0)],_0x35d59b&&await _0x296823[_0x5eb65e(0x1ef)](skillup,{'suppressUsage':!![]});}}return _0x35d59b;}
@@ -1 +1 @@
1
- function _0x317b(){const _0xd78ab2=['✓\x20OpenCode\x20plugin\x20already\x20configured','list','176652ZKoMKB','180WJMQlN','vVJEr','1029479wuXWLT','https://opencode.ai/config.json','lBWKb','gQoMz','EjGQt','708340ZqOaKi','8WUpPbE','@ranger-testing/opencode-plugin','Wvinj','isArray','utf-8','26lRvoOU','project','$schema','2786305rmpSgW','pluginScope','WJPnw','opencode.json','148905PfFmKX','CWmJd','6558237LZdmaX','320DiuFag','log','NxLcZ','User\x20(available\x20in\x20all\x20your\x20projects)','6zgVOLl','15294000cKOKvI','parse','includes','Failed\x20to\x20read\x20opencode.json','HeRiF','\x0a📦\x20OpenCode\x20Plugin\x0a','plugin'];_0x317b=function(){return _0xd78ab2;};return _0x317b();}function _0x17bf(_0x18e6e9,_0x5e5d7b){_0x18e6e9=_0x18e6e9-0x98;const _0x317bc2=_0x317b();let _0x17bf12=_0x317bc2[_0x18e6e9];return _0x17bf12;}(function(_0x437695,_0x596073){const _0x554920=_0x17bf,_0x3c3771=_0x437695();while(!![]){try{const _0x1f67b8=parseInt(_0x554920(0xad))/0x1+-parseInt(_0x554920(0xb3))/0x2*(-parseInt(_0x554920(0xba))/0x3)+parseInt(_0x554920(0xae))/0x4*(parseInt(_0x554920(0xb6))/0x5)+-parseInt(_0x554920(0x9b))/0x6*(parseInt(_0x554920(0xbc))/0x7)+-parseInt(_0x554920(0xbd))/0x8*(parseInt(_0x554920(0xa5))/0x9)+parseInt(_0x554920(0x9c))/0xa+parseInt(_0x554920(0xa8))/0xb*(-parseInt(_0x554920(0xa6))/0xc);if(_0x1f67b8===_0x596073)break;else _0x3c3771['push'](_0x3c3771['shift']());}catch(_0x460e07){_0x3c3771['push'](_0x3c3771['shift']());}}}(_0x317b,0xd4cf7));import{join}from'path';import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0xe8a89f from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0x5c144f){const _0x27391e=_0x17bf,_0x2fc8e7={'HMHPH':function(_0xa68de0,_0x47b97e){return _0xa68de0(_0x47b97e);},'sIZrA':function(_0x2ffe2c,_0x373bc7){return _0x2ffe2c(_0x373bc7);},'Wvinj':_0x27391e(0xb4),'nPCAQ':_0x27391e(0xb9),'lBWKb':'Where\x20should\x20the\x20plugin\x20be\x20installed?','vVJEr':'Project\x20(shared\x20with\x20team\x20via\x20git)','TKmZk':function(_0x10e37b,_0x40a400,_0x38e4a0){return _0x10e37b(_0x40a400,_0x38e4a0);},'WJPnw':function(_0x2dd824,_0x5f1278){return _0x2dd824(_0x5f1278);},'NxLcZ':_0x27391e(0xa9),'HeRiF':function(_0x4f3f27,_0x3a53ce){return _0x4f3f27(_0x3a53ce);},'gQoMz':'⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','xkcSs':_0x27391e(0xa3),'EjGQt':function(_0x42c73e,_0x530cd8,_0x3fb3f9){return _0x42c73e(_0x530cd8,_0x3fb3f9);},'CWmJd':'✓\x20OpenCode\x20plugin\x20configured'},_0x236828=_0x2fc8e7['HMHPH'](existsSync,join(_0x2fc8e7['sIZrA'](getOpencodeConfigDir,_0x2fc8e7[_0x27391e(0xb0)]),_0x2fc8e7['nPCAQ']));let _0x33f6ff;if(_0x5c144f)_0x33f6ff=_0x5c144f;else{if(_0x236828)_0x33f6ff=_0x27391e(0xb4);else{console[_0x27391e(0x98)](_0x27391e(0xa1));const _0x3ae138=await _0xe8a89f['prompt']([{'type':_0x27391e(0xa4),'name':_0x27391e(0xb7),'message':_0x2fc8e7[_0x27391e(0xaa)],'choices':[{'name':_0x27391e(0x9a),'value':'user'},{'name':_0x2fc8e7[_0x27391e(0xa7)],'value':_0x2fc8e7[_0x27391e(0xb0)]}],'default':'user'}]);_0x33f6ff=_0x3ae138['pluginScope'];}}const _0xcaf910=_0x2fc8e7['TKmZk'](join,_0x2fc8e7[_0x27391e(0xb8)](getOpencodeConfigDir,_0x33f6ff),'opencode.json'),_0x2f6b9f=_0x27391e(0xaf),_0x5e2283=_0x2fc8e7[_0x27391e(0x99)];let _0x5c2d6e={};if(_0x2fc8e7[_0x27391e(0xa0)](existsSync,_0xcaf910))try{const _0x4dc4e3=await readFile(_0xcaf910,_0x27391e(0xb2));_0x5c2d6e=JSON[_0x27391e(0x9d)](_0x4dc4e3);}catch(_0x1e1bdf){return console['error'](_0x2fc8e7[_0x27391e(0xab)]),{'configured':![],'scope':_0x33f6ff,'error':_0x27391e(0x9f),'details':_0x1e1bdf};}const _0x2faee9=Array[_0x27391e(0xb1)](_0x5c2d6e['plugin'])?_0x5c2d6e[_0x27391e(0xa2)]:[];if(_0x2faee9[_0x27391e(0x9e)](_0x2f6b9f))return console['log'](_0x2fc8e7['xkcSs']),{'configured':![],'scope':_0x33f6ff};return _0x5c2d6e[_0x27391e(0xb5)]=_0x5c2d6e['$schema']||_0x5e2283,_0x5c2d6e['plugin']=[..._0x2faee9,_0x2f6b9f],await mkdir(getOpencodeConfigDir(_0x33f6ff),{'recursive':!![]}),await _0x2fc8e7[_0x27391e(0xac)](writeFile,_0xcaf910,JSON['stringify'](_0x5c2d6e,null,0x2)+'\x0a'),console[_0x27391e(0x98)](_0x2fc8e7[_0x27391e(0xbb)]),{'configured':!![],'scope':_0x33f6ff};}
1
+ function _0x4b72(_0x355c2c,_0x12cd06){_0x355c2c=_0x355c2c-0x1dd;const _0x272238=_0x2722();let _0x4b7201=_0x272238[_0x355c2c];return _0x4b7201;}(function(_0x418492,_0x11cd64){const _0x296dc3=_0x4b72,_0x4e4ef4=_0x418492();while(!![]){try{const _0x1a591e=parseInt(_0x296dc3(0x1f4))/0x1+-parseInt(_0x296dc3(0x1fa))/0x2+parseInt(_0x296dc3(0x1e0))/0x3*(parseInt(_0x296dc3(0x201))/0x4)+parseInt(_0x296dc3(0x1e1))/0x5*(-parseInt(_0x296dc3(0x1f3))/0x6)+parseInt(_0x296dc3(0x1f0))/0x7+-parseInt(_0x296dc3(0x1e5))/0x8*(parseInt(_0x296dc3(0x1e7))/0x9)+-parseInt(_0x296dc3(0x1f1))/0xa*(-parseInt(_0x296dc3(0x1eb))/0xb);if(_0x1a591e===_0x11cd64)break;else _0x4e4ef4['push'](_0x4e4ef4['shift']());}catch(_0x558b42){_0x4e4ef4['push'](_0x4e4ef4['shift']());}}}(_0x2722,0x3a5f0));import{join}from'path';function _0x2722(){const _0x21a5d8=['xgAhk','pluginScope','includes','158477CoRyUn','plugin','tsfpp','zixsm','RMDSa','1504307iUDQbH','210MAKDec','https://opencode.ai/config.json','6JKrZii','53895bJhxeo','log','haBAA','rRejD','GmYQi','list','637734xMvxuE','VycCi','prompt','jwdTy','JXckn','@ranger-testing/opencode-plugin','stringify','12owALtT','isArray','project','✓\x20OpenCode\x20plugin\x20already\x20configured','421569UsviKF','211045tUuaJg','\x0a📦\x20OpenCode\x20Plugin\x0a','$schema','user','523664IbCSup','YecDB','54jmybzz'];_0x2722=function(){return _0x21a5d8;};return _0x2722();}import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0x2ebaea from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0x2e23f0){const _0x53e424=_0x4b72,_0xa66d91={'Givhj':function(_0x6a1f80,_0x3cee11,_0x26353b){return _0x6a1f80(_0x3cee11,_0x26353b);},'RjddT':function(_0x1b42e6,_0x471a31){return _0x1b42e6(_0x471a31);},'GmYQi':_0x53e424(0x1de),'haBAA':_0x53e424(0x1e2),'rRejD':_0x53e424(0x1f9),'RMDSa':'User\x20(available\x20in\x20all\x20your\x20projects)','zixsm':_0x53e424(0x1e4),'VycCi':function(_0x52f0aa,_0x2a62c8,_0x4296f6){return _0x52f0aa(_0x2a62c8,_0x4296f6);},'JXckn':function(_0x412fa2,_0x408054){return _0x412fa2(_0x408054);},'ERual':'opencode.json','PsXoJ':_0x53e424(0x1ff),'aLDgZ':_0x53e424(0x1f2),'jwdTy':function(_0x1696ba,_0x3edd7b){return _0x1696ba(_0x3edd7b);},'ltfGq':function(_0x288ff2,_0x36716c,_0x5b060b){return _0x288ff2(_0x36716c,_0x5b060b);},'tsfpp':'Failed\x20to\x20read\x20opencode.json','xgAhk':function(_0x174790,_0x26a403,_0x2d9625){return _0x174790(_0x26a403,_0x2d9625);},'rgWhR':function(_0x42a452,_0x369aa2){return _0x42a452(_0x369aa2);},'xqoil':function(_0x19345a,_0x5e9071,_0x26d11b){return _0x19345a(_0x5e9071,_0x26d11b);},'YecDB':function(_0x29eb51,_0x3c8cde){return _0x29eb51+_0x3c8cde;},'ygsTe':'✓\x20OpenCode\x20plugin\x20configured'},_0x132119=existsSync(_0xa66d91['Givhj'](join,_0xa66d91['RjddT'](getOpencodeConfigDir,_0xa66d91[_0x53e424(0x1f8)]),'opencode.json'));let _0x5d7197;if(_0x2e23f0)_0x5d7197=_0x2e23f0;else{if(_0x132119)_0x5d7197=_0xa66d91['GmYQi'];else{console[_0x53e424(0x1f5)](_0xa66d91[_0x53e424(0x1f6)]);const _0x9c17b6=await _0x2ebaea[_0x53e424(0x1fc)]([{'type':_0xa66d91[_0x53e424(0x1f7)],'name':'pluginScope','message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':_0xa66d91[_0x53e424(0x1ef)],'value':_0x53e424(0x1e4)},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':'project'}],'default':_0xa66d91[_0x53e424(0x1ee)]}]);_0x5d7197=_0x9c17b6[_0x53e424(0x1e9)];}}const _0x28443c=_0xa66d91[_0x53e424(0x1fb)](join,_0xa66d91[_0x53e424(0x1fe)](getOpencodeConfigDir,_0x5d7197),_0xa66d91['ERual']),_0x347566=_0xa66d91['PsXoJ'],_0x37330e=_0xa66d91['aLDgZ'];let _0x9ab2df={};if(_0xa66d91[_0x53e424(0x1fd)](existsSync,_0x28443c))try{const _0x171719=await _0xa66d91['ltfGq'](readFile,_0x28443c,'utf-8');_0x9ab2df=JSON['parse'](_0x171719);}catch(_0x4df56f){return console['error']('⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.'),{'configured':![],'scope':_0x5d7197,'error':_0xa66d91[_0x53e424(0x1ed)],'details':_0x4df56f};}const _0x43c0b3=Array[_0x53e424(0x1dd)](_0x9ab2df['plugin'])?_0x9ab2df['plugin']:[];if(_0x43c0b3[_0x53e424(0x1ea)](_0x347566))return console[_0x53e424(0x1f5)](_0x53e424(0x1df)),{'configured':![],'scope':_0x5d7197};return _0x9ab2df[_0x53e424(0x1e3)]=_0x9ab2df[_0x53e424(0x1e3)]||_0x37330e,_0x9ab2df[_0x53e424(0x1ec)]=[..._0x43c0b3,_0x347566],await _0xa66d91[_0x53e424(0x1e8)](mkdir,_0xa66d91['rgWhR'](getOpencodeConfigDir,_0x5d7197),{'recursive':!![]}),await _0xa66d91['xqoil'](writeFile,_0x28443c,_0xa66d91[_0x53e424(0x1e6)](JSON[_0x53e424(0x200)](_0x9ab2df,null,0x2),'\x0a')),console['log'](_0xa66d91['ygsTe']),{'configured':!![],'scope':_0x5d7197};}
@@ -1 +1 @@
1
- function _0x2efc(){const _0x4a01ab=['plugin','✓\x20Encrypted\x20auth\x20verified\x20(will\x20decrypt\x20at\x20runtime)','xBFgw','52489VdRnXN','success','8PhPxjp','auth','mbAva','.\x20Use\x20--profile\x20to\x20specify\x20which\x20one.','\x22:\x20','\x0a✅\x20Ranger\x20CI\x20setup\x20complete!\x0a','210354LGUUIY','mUzdm','827455pvpVYP','length','✓\x20Created\x20profile\x20settings:\x20baseUrl=','sessions','skills','settings.json','RHJnB','Failed\x20to\x20install\x20plugin:','install','message','dir_setup','Auto-detected\x20CI\x20profile:\x20','path','You\x20can\x20install\x20manually:\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20project','uqCGH','\x0a🔧\x20Ranger\x20CI\x20Setup\x0a','No\x20API\x20token\x20available\x20for\x20decryption','tgeMk','ranger@trailhead','chromium','riqPB','CI\x20profile\x20\x22','isDirectory','2091397rqFlQJ','539Efhzhg','Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.','auth.json','4qpEfVM','--scope','ZYMUo','25170JJlfyX','log','trackPhaseEnd','EgFJq','15784qdRrGN','oAaON','error','\x20\x20No\x20auth\x20state\x20found\x20(app\x20may\x20not\x20require\x20authentication)','auth.json.enc','skipChromium','You\x20can\x20install\x20manually:\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','Multiple\x20CI\x20profiles\x20found:\x20','Failed\x20to\x20verify\x20encrypted\x20auth\x20for\x20profile\x20\x22','whnuZ','baseUrl','ranger-testing/trailhead','trackPhaseStart','project','cDdDU','137061hhSuOG','\x22\x20has\x20no\x20settings.json.\x20Use\x20--base-url\x20to\x20configure\x20it.','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','name','✓\x20Marketplace\x20already\x20added','Kuane','SnsGV','30kNdBka','LWxoJ','No\x20CI\x20profiles\x20found\x20in\x20.ranger/ci/.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','✓\x20Claude\x20Code\x20plugin\x20already\x20installed'];_0x2efc=function(){return _0x4a01ab;};return _0x2efc();}(function(_0x4bbab0,_0x41c323){const _0xdfef84=_0x1bd7,_0x287f09=_0x4bbab0();while(!![]){try{const _0x169b62=-parseInt(_0xdfef84(0xe2))/0x1*(parseInt(_0xdfef84(0x107))/0x2)+parseInt(_0xdfef84(0x10a))/0x3*(parseInt(_0xdfef84(0xe4))/0x4)+parseInt(_0xdfef84(0xec))/0x5+parseInt(_0xdfef84(0xea))/0x6+parseInt(_0xdfef84(0x104))/0x7*(-parseInt(_0xdfef84(0x10e))/0x8)+-parseInt(_0xdfef84(0x11d))/0x9*(parseInt(_0xdfef84(0x124))/0xa)+parseInt(_0xdfef84(0x103))/0xb;if(_0x169b62===_0x41c323)break;else _0x287f09['push'](_0x287f09['shift']());}catch(_0x7a4a95){_0x287f09['push'](_0x287f09['shift']());}}}(_0x2efc,0x199a7));import{mkdir,readFile,readdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{authenticate,ensureRangerDir,ensureChromium,writeRangerGitignore}from'./start.js';function _0x1bd7(_0x2976d6,_0x31706a){_0x2976d6=_0x2976d6-0xdf;const _0x2efce4=_0x2efc();let _0x1bd7ea=_0x2efce4[_0x2976d6];return _0x1bd7ea;}import{skillup}from'./skillup.js';import{getRangerDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{saveSettings}from'./utils/settings.js';import{decrypt}from'./utils/crypto.js';import{getToken}from'./utils/keychain.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'./utils/claudePlugin.js';async function findCiProfile(_0x5cfe63){const _0x12fb34=_0x1bd7,_0x28d9cc={'EgFJq':function(_0x4f5c19,_0x5824e6,_0x3005c0){return _0x4f5c19(_0x5824e6,_0x3005c0);},'SnsGV':function(_0x155dc0,_0x37da6d){return _0x155dc0+_0x37da6d;},'pTKbp':function(_0x195c50,_0x169a5a){return _0x195c50===_0x169a5a;},'aYuNk':function(_0x338e38,_0x3cc815,_0x31a0cd){return _0x338e38(_0x3cc815,_0x31a0cd);}},_0x196aa7=getRangerDir(),_0x541c57=join(_0x196aa7,'ci');if(_0x5cfe63){const _0x3b25b6=_0x28d9cc[_0x12fb34(0x10d)](join,_0x541c57,_0x5cfe63);return{'name':_0x5cfe63,'path':_0x3b25b6};}if(!existsSync(_0x541c57))throw new Error(_0x28d9cc[_0x12fb34(0x123)]('No\x20CI\x20profiles\x20found.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a',_0x12fb34(0x105)));const _0x468213=await readdir(_0x541c57,{'withFileTypes':!![]}),_0x4cf097=_0x468213['filter'](_0x54d6f3=>_0x54d6f3[_0x12fb34(0x102)]())['map'](_0x47347b=>_0x47347b[_0x12fb34(0x120)]);if(_0x28d9cc['pTKbp'](_0x4cf097['length'],0x0))throw new Error(_0x12fb34(0x126)+_0x12fb34(0x105));if(_0x4cf097[_0x12fb34(0xed)]===0x1){const _0x33e4d8=_0x4cf097[0x0];return console[_0x12fb34(0x10b)](_0x12fb34(0xf7)+_0x33e4d8),{'name':_0x33e4d8,'path':_0x28d9cc['aYuNk'](join,_0x541c57,_0x33e4d8)};}throw new Error(_0x12fb34(0x115)+_0x4cf097['join'](',\x20')+_0x12fb34(0xe7));}async function installPluginNonInteractive(){const _0x55a880=_0x1bd7,_0x5d721c={'oAaON':function(_0x303089,_0x42dc54){return _0x303089(_0x42dc54);},'eQkMk':_0x55a880(0xfe),'zWYgO':_0x55a880(0x127),'mbAva':function(_0x1ca870,_0x5ebd1){return _0x1ca870(_0x5ebd1);},'yJdgf':'trailhead','RHJnB':_0x55a880(0x121),'whnuZ':'plugin','ZYMUo':'add','riqPB':_0x55a880(0x108),'GiljU':_0x55a880(0x11b)},_0x260263=await _0x5d721c[_0x55a880(0x10f)](isPluginInstalled,_0x5d721c['eQkMk']);if(_0x260263)return console[_0x55a880(0x10b)](_0x5d721c['zWYgO']),![];console[_0x55a880(0x10b)]('Installing\x20Claude\x20Code\x20plugin\x20(project\x20level)...');const _0x2056c5=await _0x5d721c[_0x55a880(0xe6)](isMarketplaceAdded,_0x5d721c['yJdgf']);let _0x191293=_0x2056c5;if(_0x2056c5)console['log'](_0x5d721c[_0x55a880(0xf2)]);else{const _0x336442=await _0x5d721c['mbAva'](runClaudeCommand,[_0x5d721c[_0x55a880(0x117)],'marketplace',_0x5d721c[_0x55a880(0x109)],_0x55a880(0x119)]);!_0x336442['success']?(console[_0x55a880(0x110)]('Failed\x20to\x20add\x20marketplace:',_0x336442['error']),console['log'](_0x55a880(0x114))):_0x191293=!![];}if(_0x191293){const _0x34910b=await runClaudeCommand([_0x5d721c['whnuZ'],_0x55a880(0xf4),'ranger@trailhead',_0x5d721c[_0x55a880(0x100)],_0x5d721c['GiljU']]);!_0x34910b[_0x55a880(0xe3)]?(console[_0x55a880(0x110)](_0x55a880(0xf3),_0x34910b[_0x55a880(0x110)]),console[_0x55a880(0x10b)](_0x55a880(0xf9))):console['log']('✓\x20Claude\x20Code\x20plugin\x20installed');}return!![];}export async function setupCi(_0x3df13a,_0x5ebcac,_0x570f7e){const _0x36df64=_0x1bd7,_0x1e405f={'htulb':_0x36df64(0xf6),'xBFgw':function(_0x210ebf){return _0x210ebf();},'KDDmU':function(_0x325068,_0x1fa876){return _0x325068(_0x1fa876);},'uqCGH':function(_0x224ec5,_0x468461,_0x48ee1a){return _0x224ec5(_0x468461,_0x48ee1a);},'LWxoJ':_0x36df64(0xef),'Kuane':_0x36df64(0xff),'SMBOh':'profile_activate','RwPHZ':function(_0x30b025,_0x1325d0){return _0x30b025(_0x1325d0);},'QTvbl':function(_0x99da9e,_0x48cc88){return _0x99da9e(_0x48cc88);},'cDdDU':_0x36df64(0x106),'tgeMk':_0x36df64(0xfc),'UakDA':function(_0x39d49e,_0x3854a5,_0x29bf8e){return _0x39d49e(_0x3854a5,_0x29bf8e);},'XXBiN':function(_0x21ddfa,_0x3765b0){return _0x21ddfa instanceof _0x3765b0;},'FJlAJ':_0x36df64(0xf0),'mUzdm':'project'};console['log'](_0x36df64(0xfb)),_0x570f7e?.['trackPhaseStart']('auth'),await authenticate(_0x3df13a),_0x570f7e?.['trackPhaseEnd'](_0x36df64(0xe5)),_0x570f7e?.['trackPhaseStart'](_0x1e405f['htulb']);const {path:_0x55a5a9,installed:_0x1dca9e}=await _0x1e405f[_0x36df64(0xe1)](ensureRangerDir);await _0x1e405f['KDDmU'](writeRangerGitignore,_0x55a5a9);const _0x5acf2d=_0x1e405f[_0x36df64(0xfa)](join,_0x55a5a9,_0x1e405f[_0x36df64(0x125)]);!existsSync(_0x5acf2d)&&await mkdir(_0x5acf2d,{'recursive':!![]});_0x570f7e?.['trackPhaseEnd'](_0x36df64(0xf6),{'installed':_0x1dca9e}),_0x570f7e?.[_0x36df64(0x11a)](_0x1e405f[_0x36df64(0x122)]);let _0x2de653=![];_0x5ebcac?.['skipChromium']?console['log'](_0x36df64(0x11f)):_0x2de653=await ensureChromium();_0x570f7e?.[_0x36df64(0x10c)]('chromium',{'installed':_0x2de653,'skipped':!!_0x5ebcac?.[_0x36df64(0x113)]}),_0x570f7e?.['trackPhaseStart'](_0x1e405f['SMBOh']);const _0xa0e625=await _0x1e405f['RwPHZ'](findCiProfile,_0x5ebcac?.['profile']);let _0x2b83e2=![];_0x5ebcac?.['baseUrl']&&(await mkdir(_0xa0e625[_0x36df64(0xf8)],{'recursive':!![]}),await _0x1e405f[_0x36df64(0xfa)](saveSettings,_0xa0e625[_0x36df64(0x120)],{'baseUrl':_0x5ebcac['baseUrl'],'headless':!![]}),console['log'](_0x36df64(0xee)+_0x5ebcac[_0x36df64(0x118)]),_0x2b83e2=!![]);const _0x135076=join(_0xa0e625['path'],_0x36df64(0xf1));if(!_0x1e405f['QTvbl'](existsSync,_0x135076)&&!_0x2b83e2)throw new Error(_0x36df64(0x101)+_0xa0e625['name']+_0x36df64(0x11e));const _0x478c28=join(_0xa0e625['path'],_0x1e405f[_0x36df64(0x11c)]),_0x3e8e01=join(_0xa0e625['path'],_0x36df64(0x112)),_0x785f2c=_0x1e405f['KDDmU'](existsSync,_0x478c28),_0xe16abb=existsSync(_0x3e8e01);if(_0xe16abb)try{const _0x34c204=await getToken();if(!_0x34c204)throw new Error(_0x1e405f[_0x36df64(0xfd)]);const _0x53e80e=await readFile(_0x3e8e01);_0x1e405f['UakDA'](decrypt,_0x53e80e,_0x34c204),console['log'](_0x36df64(0xe0));}catch(_0x5df514){const _0x3c2206=_0x1e405f['XXBiN'](_0x5df514,Error)?_0x5df514[_0x36df64(0xf5)]:String(_0x5df514);throw new Error(_0x36df64(0x116)+_0xa0e625['name']+_0x36df64(0xe8)+_0x3c2206);}else _0x785f2c?console[_0x36df64(0x10b)]('✓\x20Auth\x20state\x20found'):console[_0x36df64(0x10b)](_0x36df64(0x111));await writeActiveProfileName(_0xa0e625[_0x36df64(0x120)]),console[_0x36df64(0x10b)]('✓\x20Active\x20profile:\x20'+_0xa0e625[_0x36df64(0x120)]),_0x570f7e?.[_0x36df64(0x10c)](_0x1e405f['SMBOh'],{'profileName':_0xa0e625['name'],'hasAuth':_0x785f2c,'hasEncryptedAuth':_0xe16abb,'createdSettings':_0x2b83e2}),_0x570f7e?.['trackPhaseStart'](_0x36df64(0xdf));const _0x5a6188=await _0x1e405f['xBFgw'](installPluginNonInteractive);_0x570f7e?.[_0x36df64(0x10c)](_0x36df64(0xdf),{'installed':_0x5a6188}),_0x570f7e?.[_0x36df64(0x11a)](_0x1e405f['FJlAJ']),await skillup({'autoInstall':_0x1e405f[_0x36df64(0xeb)]}),_0x570f7e?.[_0x36df64(0x10c)](_0x1e405f['FJlAJ']),console['log'](_0x36df64(0xe9));}
1
+ (function(_0x1ee77a,_0x3021b3){var _0x4ca527=_0x51dc,_0x31d60d=_0x1ee77a();while(!![]){try{var _0x2e938c=parseInt(_0x4ca527(0x1d2))/0x1+-parseInt(_0x4ca527(0x1d9))/0x2+parseInt(_0x4ca527(0x1d8))/0x3*(parseInt(_0x4ca527(0x1db))/0x4)+-parseInt(_0x4ca527(0x1d4))/0x5*(-parseInt(_0x4ca527(0x1ce))/0x6)+parseInt(_0x4ca527(0x1cb))/0x7*(parseInt(_0x4ca527(0x1d1))/0x8)+-parseInt(_0x4ca527(0x1d7))/0x9*(parseInt(_0x4ca527(0x1d5))/0xa)+-parseInt(_0x4ca527(0x1cd))/0xb;if(_0x2e938c===_0x3021b3)break;else _0x31d60d['push'](_0x31d60d['shift']());}catch(_0x50187c){_0x31d60d['push'](_0x31d60d['shift']());}}}(_0x5eea,0x85d92));function _0x51dc(_0x3b44c8,_0x27ea7c){_0x3b44c8=_0x3b44c8-0x1cb;var _0x5eea8c=_0x5eea();var _0x51dc0f=_0x5eea8c[_0x3b44c8];return _0x51dc0f;}function _0x5eea(){var _0x5e01da=['31542caSJwA','exit','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','549832nYVEYg','296253jNbEmB','\x20\x20https://docs.ranger.net/main/concepts/profiles','515MVfGVq','254880McXGQU','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','324cdzedR','1131ylaaht','28638IQwXzh','ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','2332TkFeBX','70SRPATV','oPsIg','2911436xngbuM'];_0x5eea=function(){return _0x5e01da;};return _0x5eea();}export async function setupCi(_0x1ee2ca,_0x86ae5a,_0x2eec95){var _0x218069=_0x51dc,_0x9b3b30={'vaQXK':function(_0x12bc94,_0x40b463){return _0x12bc94+_0x40b463;},'oPsIg':_0x218069(0x1da),'prOyh':_0x218069(0x1d0)};console['error'](_0x9b3b30['vaQXK'](_0x9b3b30[_0x218069(0x1cc)]+'\x0a',_0x9b3b30['prOyh'])+'\x20\x20ranger\x20profile\x20add\x20<name>\x0a'+'\x0a'+_0x218069(0x1d6)+_0x218069(0x1d3)),process[_0x218069(0x1cf)](0x1);}
@@ -1 +1 @@
1
- function _0x1bea(){const _0x38523b=['\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','platform','opencode','iaJBb','installLevel','tXxbo','\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','KZaKq','To\x20get\x20started:','7610094SDMLUP','8333801qGhPfS','To\x20use:','\x20\x203.\x20Run:\x20ranger\x20skillup','\x20--opencode','log','/skills/','AmIWc','Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20(','user','\x20<your-api-token>','27xXPUsE','NsbJl','\x0a📦\x20Installing\x20skills...\x0a','\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','/.opencode/skills/','autoInstall','ranger','386508cMqlEP','2adDZrq','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','suppressUsage','hfCZq','150392jogfCO','1964488NvbNIG','prompt','61378xIRGzG','Ohbjd','UgAqK','27cGxOkV','2501075socWir','/.claude/skills/','10kEHlSi','kCAZz'];_0x1bea=function(){return _0x38523b;};return _0x1bea();}function _0x5c3d(_0x18b6f6,_0x33d05e){_0x18b6f6=_0x18b6f6-0x6a;const _0x1beab4=_0x1bea();let _0x5c3d49=_0x1beab4[_0x18b6f6];return _0x5c3d49;}(function(_0x3e8765,_0x28a5dd){const _0x5182c5=_0x5c3d,_0x58aa47=_0x3e8765();while(!![]){try{const _0x4defa0=parseInt(_0x5182c5(0x79))/0x1*(-parseInt(_0x5182c5(0x72))/0x2)+parseInt(_0x5182c5(0x7c))/0x3*(parseInt(_0x5182c5(0x71))/0x4)+parseInt(_0x5182c5(0x7d))/0x5+parseInt(_0x5182c5(0x8a))/0x6+-parseInt(_0x5182c5(0x8b))/0x7+parseInt(_0x5182c5(0x77))/0x8*(-parseInt(_0x5182c5(0x6a))/0x9)+-parseInt(_0x5182c5(0x7f))/0xa*(parseInt(_0x5182c5(0x76))/0xb);if(_0x4defa0===_0x28a5dd)break;else _0x58aa47['push'](_0x58aa47['shift']());}catch(_0x12c8d9){_0x58aa47['push'](_0x58aa47['shift']());}}}(_0x1bea,0x9b41b));import{basename}from'path';import _0x2d0b18 from'inquirer';import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x43336b={}){const _0x1773b7=_0x5c3d,_0x1d5354={'jYqnX':_0x1773b7(0x73),'gnFVG':'\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','Ohbjd':'opencode','tXxbo':function(_0x20cdec,_0x2733a1){return _0x20cdec===_0x2733a1;},'UgAqK':'✓\x20Found\x20API\x20token','KZaKq':function(_0x29ccdd){return _0x29ccdd();},'rbYUv':function(_0x3850ea,_0x5c725f){return _0x3850ea(_0x5c725f);},'hfCZq':_0x1773b7(0x93),'ZYZQb':'list','RlChL':_0x1773b7(0x85),'AmIWc':'project','OXBfz':function(_0x2f6134){return _0x2f6134();},'Pmzwu':_0x1773b7(0x81),'NsbJl':function(_0x116574,_0x2a5718){return _0x116574>_0x2a5718;},'iaJBb':'project-level','kCAZz':'\x20\x20-\x20Open\x20Claude\x20Code\x20in\x20plan\x20mode\x20and\x20run\x20/ranger:enable.\x20Plan\x20out\x20a\x20UI\x20feature\x20with\x20Ranger\x20and\x20watch\x20Ranger\x20test\x20it\x20for\x20you!'};console['log'](_0x1773b7(0x6d));const _0x32684a=_0x43336b[_0x1773b7(0x82)]??'claude',_0x39eeb0=await getToken();if(!_0x39eeb0){console[_0x1773b7(0x8f)](_0x1d5354['jYqnX']),console['log'](_0x1773b7(0x89)),console['log'](_0x1d5354['gnFVG']),console['log']('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0x32684a===_0x1d5354[_0x1773b7(0x7a)]?'\x20--opencode':'')+_0x1773b7(0x94)),console[_0x1773b7(0x8f)](_0x1773b7(0x8d)+(_0x1d5354['tXxbo'](_0x32684a,_0x1773b7(0x83))?_0x1773b7(0x8e):'')+'\x0a');return;}console['log'](_0x1d5354[_0x1773b7(0x7b)]);const _0x3f7703=_0x1d5354[_0x1773b7(0x88)](getProjectRoot),_0x5c7418=basename(_0x3f7703),_0x5d9034=_0x1d5354[_0x1773b7(0x86)](_0x32684a,_0x1d5354['Ohbjd'])?_0x1d5354['rbYUv'](getOpencodeConfigDir,_0x1d5354[_0x1773b7(0x75)])+_0x1773b7(0x90):getClaudeConfigDir()+'/skills/',_0x5463a9=_0x1d5354['tXxbo'](_0x32684a,'opencode')?_0x3f7703+_0x1773b7(0x6e):_0x3f7703+_0x1773b7(0x7e),_0x1bfb32=process['stdin']['isTTY']&&process['stdout']['isTTY'];let _0xf363d1;if(_0x43336b['autoInstall'])_0xf363d1=_0x43336b[_0x1773b7(0x6f)];else{if(_0x1bfb32){const _0x83ef4a=await _0x2d0b18[_0x1773b7(0x78)]([{'type':_0x1d5354['ZYZQb'],'name':_0x1d5354['RlChL'],'message':'Where\x20should\x20skills\x20be\x20installed?','choices':[{'name':'All\x20projects\x20('+_0x5d9034+')','value':'user'},{'name':'This\x20project\x20only\x20('+_0x5463a9+')','value':_0x1d5354[_0x1773b7(0x91)]}]}]);_0xf363d1=_0x83ef4a[_0x1773b7(0x85)];}else _0xf363d1=_0x1d5354['AmIWc'],console['log'](_0x1773b7(0x92)+_0x5463a9+')');}let _0x392631=0x0;const _0x3a42dd=_0x1d5354['OXBfz'](getCurrentVersion);console['log'](_0x1773b7(0x6c));try{const _0x548c64=await installSkill(_0x1773b7(0x70),{'cliVersion':_0x3a42dd,'level':_0xf363d1,'platform':_0x32684a});_0x548c64&&_0x392631++;}catch(_0x49c9ea){console['warn'](_0x1d5354['Pmzwu'],_0x49c9ea instanceof Error?_0x49c9ea['message']:_0x49c9ea);}if(_0x1d5354[_0x1773b7(0x6b)](_0x392631,0x0)){const _0x3db22e=_0xf363d1==='user'?'user-level':_0x1d5354[_0x1773b7(0x84)];console['log']('\x0a✅\x20Installed\x20'+_0x392631+'\x20'+_0x3db22e+'\x20skill'+(_0x392631>0x1?'s':'')+'\x20successfully!\x0a'),!_0x43336b[_0x1773b7(0x74)]&&(console['log'](_0x1773b7(0x8c)),_0x32684a===_0x1d5354[_0x1773b7(0x7a)]?console[_0x1773b7(0x8f)](_0x1773b7(0x87)):console['log'](_0x1d5354[_0x1773b7(0x80)]));}else console['log']('\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a');}
1
+ (function(_0x122096,_0x1e50d6){const _0x2729fc=_0x1e1f,_0x53fe84=_0x122096();while(!![]){try{const _0x10bc00=-parseInt(_0x2729fc(0x13a))/0x1*(parseInt(_0x2729fc(0x116))/0x2)+parseInt(_0x2729fc(0x12e))/0x3+parseInt(_0x2729fc(0x133))/0x4*(-parseInt(_0x2729fc(0x139))/0x5)+-parseInt(_0x2729fc(0x121))/0x6*(-parseInt(_0x2729fc(0x131))/0x7)+-parseInt(_0x2729fc(0x115))/0x8+-parseInt(_0x2729fc(0x138))/0x9+-parseInt(_0x2729fc(0x136))/0xa*(-parseInt(_0x2729fc(0x13f))/0xb);if(_0x10bc00===_0x1e50d6)break;else _0x53fe84['push'](_0x53fe84['shift']());}catch(_0x41367b){_0x53fe84['push'](_0x53fe84['shift']());}}}(_0x3284,0xd627c));import{basename}from'path';import _0x37387c from'inquirer';import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';function _0x3284(){const _0x304a67=['\x0a✅\x20Installed\x20','\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a','oVwds','2823306JqShmM','\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!','platform','552251XOYhnK','\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','262648dDpuRJ','\x20--opencode','HtWeO','10qnJGAJ','/skills/','14574240uDnxLA','35cYsBtW','3977xrMQnf','opencode','installLevel','2|4|0|1|5|3','log','43741654BsDuav','list','sGjiO','autoInstall','/.claude/skills/','gWcgy','XtWGc','To\x20get\x20started:','GmpZq','9621376QBSQyN','818hvnnUL','To\x20use:','\x20\x203.\x20Run:\x20ranger\x20skillup','ranger','project-level','claude','Where\x20should\x20skills\x20be\x20installed?','yZPMH','stdout','✓\x20Found\x20API\x20token','vlsjl','66woVbSO','split','\x20successfully!\x0a','\x20skill','SMNQC','suppressUsage','/.opencode/skills/','HZWSQ','FlflB','warn'];_0x3284=function(){return _0x304a67;};return _0x3284();}import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';function _0x1e1f(_0x5bbcce,_0x42d436){_0x5bbcce=_0x5bbcce-0x10e;const _0x328467=_0x3284();let _0x1e1f71=_0x328467[_0x5bbcce];return _0x1e1f71;}import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x1a01b7={}){const _0x209fbc=_0x1e1f,_0x2d54bc={'vlsjl':function(_0x47af36){return _0x47af36();},'HtWeO':'\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','gWcgy':'opencode','oVwds':'❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','pTmey':_0x209fbc(0x113),'SMNQC':function(_0x4f9efd,_0x271587){return _0x4f9efd===_0x271587;},'TYMHg':_0x209fbc(0x11f),'GmpZq':function(_0xce8702){return _0xce8702();},'UOfvS':'user','sGjiO':function(_0x435af2){return _0x435af2();},'yZPMH':_0x209fbc(0x140),'sNJhQ':'installLevel','XtWGc':'project','HZWSQ':function(_0x4ae8f4){return _0x4ae8f4();},'uzCfc':_0x209fbc(0x119),'xoBrE':'\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','Qjnlu':'user-level','xrdov':function(_0x1793c2,_0x5c0659){return _0x1793c2>_0x5c0659;},'UyfEt':_0x209fbc(0x117),'gCHMb':'\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','FlflB':_0x209fbc(0x12c)};console[_0x209fbc(0x13e)](_0x209fbc(0x132));const _0x26e082=_0x1a01b7[_0x209fbc(0x130)]??_0x209fbc(0x11b),_0x48276d=await _0x2d54bc[_0x209fbc(0x120)](getToken);if(!_0x48276d){const _0x5eb3db=_0x209fbc(0x13d)[_0x209fbc(0x122)]('|');let _0x27d95f=0x0;while(!![]){switch(_0x5eb3db[_0x27d95f++]){case'0':console[_0x209fbc(0x13e)](_0x2d54bc[_0x209fbc(0x135)]);continue;case'1':console[_0x209fbc(0x13e)]('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0x26e082===_0x2d54bc['gWcgy']?'\x20--opencode':'')+'\x20<your-api-token>');continue;case'2':console[_0x209fbc(0x13e)](_0x2d54bc[_0x209fbc(0x12d)]);continue;case'3':return;case'4':console['log'](_0x2d54bc['pTmey']);continue;case'5':console[_0x209fbc(0x13e)](_0x209fbc(0x118)+(_0x2d54bc[_0x209fbc(0x125)](_0x26e082,_0x2d54bc['gWcgy'])?_0x209fbc(0x134):'')+'\x0a');continue;}break;}}console['log'](_0x2d54bc['TYMHg']);const _0x239311=_0x2d54bc[_0x209fbc(0x114)](getProjectRoot),_0x1304d2=basename(_0x239311),_0x54a2eb=_0x26e082===_0x2d54bc[_0x209fbc(0x111)]?getOpencodeConfigDir(_0x2d54bc['UOfvS'])+_0x209fbc(0x137):_0x2d54bc[_0x209fbc(0x10e)](getClaudeConfigDir)+'/skills/',_0x2bb6d2=_0x2d54bc[_0x209fbc(0x125)](_0x26e082,_0x2d54bc[_0x209fbc(0x111)])?_0x239311+_0x209fbc(0x127):_0x239311+_0x209fbc(0x110),_0x25e0c3=process['stdin']['isTTY']&&process[_0x209fbc(0x11e)]['isTTY'];let _0x22d27e;if(_0x1a01b7['autoInstall'])_0x22d27e=_0x1a01b7[_0x209fbc(0x10f)];else{if(_0x25e0c3){const _0x1d52dd=await _0x37387c['prompt']([{'type':_0x2d54bc[_0x209fbc(0x11d)],'name':_0x2d54bc['sNJhQ'],'message':_0x209fbc(0x11c),'choices':[{'name':'All\x20projects\x20('+_0x54a2eb+')','value':_0x2d54bc['UOfvS']},{'name':'This\x20project\x20only\x20('+_0x2bb6d2+')','value':_0x2d54bc['XtWGc']}]}]);_0x22d27e=_0x1d52dd[_0x209fbc(0x13c)];}else _0x22d27e=_0x2d54bc[_0x209fbc(0x112)],console['log']('Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20('+_0x2bb6d2+')');}let _0x5abdef=0x0;const _0x571a94=_0x2d54bc[_0x209fbc(0x128)](getCurrentVersion);console[_0x209fbc(0x13e)]('\x0a📦\x20Installing\x20skills...\x0a');try{const _0x3663cb=await installSkill(_0x2d54bc['uzCfc'],{'cliVersion':_0x571a94,'level':_0x22d27e,'platform':_0x26e082});_0x3663cb&&_0x5abdef++;}catch(_0x13de95){console[_0x209fbc(0x12a)](_0x2d54bc['xoBrE'],_0x13de95 instanceof Error?_0x13de95['message']:_0x13de95);}if(_0x5abdef>0x0){const _0x37d7f9=_0x22d27e===_0x2d54bc['UOfvS']?_0x2d54bc['Qjnlu']:_0x209fbc(0x11a);console['log'](_0x209fbc(0x12b)+_0x5abdef+'\x20'+_0x37d7f9+_0x209fbc(0x124)+(_0x2d54bc['xrdov'](_0x5abdef,0x1)?'s':'')+_0x209fbc(0x123)),!_0x1a01b7[_0x209fbc(0x126)]&&(console[_0x209fbc(0x13e)](_0x2d54bc['UyfEt']),_0x26e082===_0x209fbc(0x13b)?console[_0x209fbc(0x13e)](_0x2d54bc['gCHMb']):console['log'](_0x209fbc(0x12f)));}else console['log'](_0x2d54bc[_0x209fbc(0x129)]);}
@@ -1 +1 @@
1
- const _0x25b0a5=_0x40ef;(function(_0x4a3444,_0x12ee2f){const _0x38b496=_0x40ef,_0x89faaa=_0x4a3444();while(!![]){try{const _0xded1b3=parseInt(_0x38b496(0x171))/0x1*(-parseInt(_0x38b496(0x175))/0x2)+parseInt(_0x38b496(0x1aa))/0x3*(parseInt(_0x38b496(0x16f))/0x4)+parseInt(_0x38b496(0x1b2))/0x5+-parseInt(_0x38b496(0x1a6))/0x6*(-parseInt(_0x38b496(0x19d))/0x7)+parseInt(_0x38b496(0x182))/0x8+-parseInt(_0x38b496(0x19a))/0x9+-parseInt(_0x38b496(0x1c6))/0xa*(parseInt(_0x38b496(0x16d))/0xb);if(_0xded1b3===_0x12ee2f)break;else _0x89faaa['push'](_0x89faaa['shift']());}catch(_0x1f6f38){_0x89faaa['push'](_0x89faaa['shift']());}}}(_0x59f8,0x99de5));function _0x40ef(_0x2842e8,_0x55aaa3){_0x2842e8=_0x2842e8-0x165;const _0x59f8a5=_0x59f8();let _0x40ef28=_0x59f8a5[_0x2842e8];return _0x40ef28;}import{mkdir,writeFile}from'fs/promises';function _0x59f8(){const _0x23611=['sSndd','GITHUB_ENV','FWowZ','vzxSY','Qfacj','\x0a⚠\x20Skipping\x20Chromium\x20installation.','XuGZY','66NfEXVg','message','12nSfNaM','mIwwY','601357jSdxzH','\x0aTo\x20verify\x20with\x20a\x20browser,\x20set\x20','log','jCfzs','2PPxtTk','✓\x20Playwright\x20Chromium\x20browser\x20found','GljQY','LoiKd','user','confirm','executablePath','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','chromium','version','/ranger:enable','\x20install\x20chromium','skipAuth','9749120iMutbJ','\x0a\x20\x20your\x20org\x27s\x20auth\x20config\x20drives\x20which\x20flow\x20runs.','VqJvv','ranger\x20profile\x20add','PhuXb','gTpKO','✓\x20Skipping\x20authentication\x20(--skip-auth)','plugin','FeWZA','force','xDIJj','aNOKH','trackPhaseEnd','\x0a❌\x20Profile\x20setup\x20failed:','DxMrY','tsRfd','WmIYP','env','scope','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','Installation\x20failed\x20with\x20exit\x20code\x20','QhQrw','\x0a🚀\x20Ranger\x20Setup\x0a','2191410DHYPIc','resolve','skipped','3899mOoDcb','Authentication\x20failed:\x20','trackPhaseStart','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','opencode','YYyNT','.gitignore','lobYW','dsLOl','114UKQRaR','platform','url','✓\x20Created\x20~/.ranger/\x20directory','902346unrBAZ','ranger','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','jbLyT','nThFB','withDeps','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','\x0aInstalling\x20Chromium\x20browser...\x0a','4705805mqyGSr','mLGrP','✓\x20Local\x20profile\x20already\x20exists','method','sFZLC','\x20and\x20prompt\x20the\x20coding','playwright@','prompt','npx','nNEaD','\x20now?','ready','isTTY','error','1.58.2','RANGER_TEST_USERNAME','qeebO',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','skipChromium','auth','2662730MMiDEo','\x20(fallback\x20version)','success','local','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','organizationName','allowInsecureLocalhost'];_0x59f8=function(){return _0x23611;};return _0x59f8();}import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x184441 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=_0x25b0a5(0x1c0);const bold=_0x1961bb=>'\x1b[1m'+_0x1961bb+'\x1b[0m';export function getPlaywrightVersion(){const _0x5bbc62=_0x25b0a5,_0x36d764={'sSndd':function(_0x263f8c,_0x124c90){return _0x263f8c(_0x124c90);}};try{const _0x4957a0=require[_0x5bbc62(0x19b)]('playwright/package.json'),_0x3160cd=_0x36d764[_0x5bbc62(0x166)](require,_0x4957a0);return _0x3160cd[_0x5bbc62(0x17e)];}catch{return null;}}export function installChromiumBinary(_0x3ed409,_0x2f0045=![]){const _0x1a772e=_0x25b0a5,_0x1659ec={'iwhDw':function(_0x19731c,_0x58d3bd){return _0x19731c(_0x58d3bd);},'fdLge':'--with-deps','iKfqq':'chromium','YYyNT':function(_0x4dc235,_0x358376,_0x397837,_0xf5c8a0){return _0x4dc235(_0x358376,_0x397837,_0xf5c8a0);},'XcSMn':_0x1a772e(0x1ba),'pMqAN':'ignore','lobYW':'inherit','VECuD':'win32'};return new Promise((_0x1d2f0b,_0x53ea2e)=>{const _0x5c0fcc=_0x1a772e,_0x1c529f={'nNEaD':function(_0x2696c7,_0x43fd90){return _0x1659ec['iwhDw'](_0x2696c7,_0x43fd90);}},_0x32b513=[_0x5c0fcc(0x1b8)+_0x3ed409,'install',..._0x2f0045?[_0x1659ec['fdLge']]:[],_0x1659ec['iKfqq']],_0x30773f=_0x1659ec[_0x5c0fcc(0x1a2)](spawn,_0x1659ec['XcSMn'],_0x32b513,{'stdio':[_0x1659ec['pMqAN'],_0x1659ec[_0x5c0fcc(0x1a4)],_0x1659ec[_0x5c0fcc(0x1a4)]],'shell':process[_0x5c0fcc(0x1a7)]===_0x1659ec['VECuD']});_0x30773f['on']('close',_0x52894d=>{const _0x37a50c=_0x5c0fcc;_0x52894d===0x0?_0x1d2f0b():_0x1659ec['iwhDw'](_0x53ea2e,new Error(_0x37a50c(0x197)+_0x52894d));}),_0x30773f['on']('error',_0x26d075=>{const _0x4f3323=_0x5c0fcc;_0x1c529f[_0x4f3323(0x1bb)](_0x53ea2e,_0x26d075);});});}export async function authenticate(_0x4c9112){const _0x34f837=_0x25b0a5,_0x236ffe={'LoiKd':function(_0x43f3b4){return _0x43f3b4();},'gTpKO':function(_0x315b40,_0x5e41f8){return _0x315b40 instanceof _0x5e41f8;},'nThFB':function(_0x4b9e23,_0x4037c2){return _0x4b9e23(_0x4037c2);}};if(!_0x4c9112){const _0x4230c9=await _0x236ffe[_0x34f837(0x178)](getToken);if(_0x4230c9){const _0x11b911=await getCurrentUser(_0x4230c9);if(_0x11b911['success'])return console['log']('✓\x20Already\x20authenticated\x20to\x20'+_0x11b911[_0x34f837(0x179)]['organizationName']),{'token':_0x4230c9,'method':'existing_token'};}try{_0x4c9112=await runDeviceAuthFlow();}catch(_0x3099af){throw new Error(_0x34f837(0x19e)+(_0x236ffe[_0x34f837(0x187)](_0x3099af,Error)?_0x3099af[_0x34f837(0x16e)]:_0x3099af));}const _0x1e9a31=await _0x236ffe[_0x34f837(0x1ae)](getCurrentUser,_0x4c9112);if(!_0x1e9a31['success'])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x1e9a31[_0x34f837(0x1bf)]);return console[_0x34f837(0x173)]('✓\x20Authenticated\x20to\x20'+_0x1e9a31[_0x34f837(0x179)][_0x34f837(0x1cb)]),{'token':_0x4c9112,'method':'device_auth'};}console[_0x34f837(0x173)]('Validating\x20API\x20token...');const _0x345266=await _0x236ffe['nThFB'](getCurrentUser,_0x4c9112);if(!_0x345266[_0x34f837(0x1c8)]){if(_0x345266['status'])throw new Error(_0x34f837(0x19e)+_0x345266[_0x34f837(0x1bf)]+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x345266['error']+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console[_0x34f837(0x173)]('✓\x20Authenticated\x20to\x20'+_0x345266['user']['organizationName']),await _0x236ffe['nThFB'](storeToken,_0x4c9112),console[_0x34f837(0x173)](process[_0x34f837(0x193)][_0x34f837(0x167)]?'✓\x20Exported\x20credentials\x20for\x20CI':'✓\x20Stored\x20credentials\x20locally'),{'token':_0x4c9112,'method':'provided_token'};}export async function ensureRangerDir(_0x3e2f51){const _0x41b10e=_0x25b0a5,_0x2042e9={'jKlmA':function(_0x3d10e5,_0x4a7e57){return _0x3d10e5(_0x4a7e57);},'jbLyT':function(_0xf47e66,_0x3416e2,_0x28bd7d){return _0xf47e66(_0x3416e2,_0x28bd7d);},'tsRfd':_0x41b10e(0x1a9),'JLysE':'✓\x20~/.ranger/\x20directory\x20already\x20exists'};void _0x3e2f51;const _0xa408f9=getRangerHomeDir();return!_0x2042e9['jKlmA'](existsSync,_0xa408f9)?(await _0x2042e9[_0x41b10e(0x1ad)](mkdir,_0xa408f9,{'recursive':!![]}),console[_0x41b10e(0x173)](_0x2042e9[_0x41b10e(0x191)]),{'path':_0xa408f9,'installed':!![]}):(console['log'](_0x2042e9['JLysE']),{'path':_0xa408f9,'installed':![]});}export async function ensureChromium(_0x1c2464=![]){const _0x22fe58=_0x25b0a5,_0x520860={'qeebO':_0x22fe58(0x176),'DxMrY':function(_0x4ee378){return _0x4ee378();},'DFKdH':'install'};let _0x5ce116=![];try{const _0x44a7b7=chromium[_0x22fe58(0x17b)]();_0x5ce116=existsSync(_0x44a7b7);}catch{_0x5ce116=![];}if(_0x5ce116)return console['log'](_0x520860[_0x22fe58(0x1c2)]),![];const _0x1af643=_0x520860[_0x22fe58(0x190)](getPlaywrightVersion),_0x3b678e=_0x1af643??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x235b4f=!_0x1af643,_0x3da874=process['stdin'][_0x22fe58(0x1be)]&&process['stdout']['isTTY'];let _0x42ec6b=!![];if(_0x3da874){const {install:_0x21c91d}=await _0x184441[_0x22fe58(0x1b9)]([{'type':_0x22fe58(0x17a),'name':_0x520860['DFKdH'],'message':_0x235b4f?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x3b678e+_0x22fe58(0x1bc):'The\x20required\x20version\x20('+_0x3b678e+_0x22fe58(0x1c3),'default':!![]}]);_0x42ec6b=_0x21c91d;}else console['log']('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x3b678e+(_0x235b4f?_0x22fe58(0x1c7):'')+'...');if(_0x42ec6b){console[_0x22fe58(0x173)](_0x22fe58(0x1b1));try{await installChromiumBinary(_0x3b678e,_0x1c2464),console[_0x22fe58(0x173)]('\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully');}catch(_0x109d72){console['error']('\x0a❌\x20Failed\x20to\x20install\x20Chromium:',_0x109d72 instanceof Error?_0x109d72[_0x22fe58(0x16e)]:_0x109d72),console['log']('You\x20can\x20install\x20it\x20manually\x20by\x20running:'),console[_0x22fe58(0x173)]('\x20\x20npx\x20playwright@'+_0x3b678e+'\x20install\x20chromium');}}else console['log'](_0x22fe58(0x16b)),console['log'](_0x22fe58(0x17c)),console['log']('\x20\x20npx\x20playwright@'+_0x3b678e+_0x22fe58(0x180));return!![];}export async function writeRangerGitignore(_0xbeceec){const _0x3847b7=_0x25b0a5,_0x4cad44={'QhQrw':function(_0x5d8cad,_0x4fa39d,_0x4bc18d){return _0x5d8cad(_0x4fa39d,_0x4bc18d);}},_0x458017=join(_0xbeceec,_0x3847b7(0x1a3)),_0x21ea53='\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 _0x4cad44[_0x3847b7(0x198)](writeFile,_0x458017,_0x21ea53),console[_0x3847b7(0x173)]('✓\x20Created\x20.ranger/.gitignore');}export async function ensureLocalEnv(_0x1c03d0,_0x4cd50a){const _0x5b657f=_0x25b0a5,_0x128234={'JiZyL':function(_0x46011d){return _0x46011d();},'VqJvv':function(_0x8fb366,_0x3a8b83){return _0x8fb366!==_0x3a8b83;},'FeWZA':_0x5b657f(0x179),'QooKP':function(_0x27897e,_0x434982){return _0x27897e===_0x434982;},'baSrN':function(_0x55f17c,_0x2b0d8d,_0xade724,_0x485682){return _0x55f17c(_0x2b0d8d,_0xade724,_0x485682);},'izrMZ':_0x5b657f(0x1c9),'EUTse':function(_0x10f2ef,_0x435467){return _0x10f2ef instanceof _0x435467;}};if(!_0x128234['JiZyL'](findGitRoot)&&_0x128234[_0x5b657f(0x184)](_0x1c03d0?.['scope'],_0x128234[_0x5b657f(0x18a)]))return console[_0x5b657f(0x173)]('⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.'),{'ready':![],'skipped':!![]};const _0x27c0cc=_0x128234['QooKP'](_0x1c03d0?.[_0x5b657f(0x194)],_0x5b657f(0x179))?getRangerHomeDir():undefined;if(findExistingEnv(_0x5b657f(0x1c9),{'locations':['local'],'rangerDir':_0x27c0cc}))return console['log'](_0x5b657f(0x1b4)),{'ready':!![],'skipped':![]};try{return await _0x128234['baSrN'](addEnv,_0x128234['izrMZ'],{'url':_0x1c03d0?.['url'],'force':_0x1c03d0?.[_0x5b657f(0x18b)],'allowInsecureLocalhost':_0x1c03d0?.[_0x5b657f(0x165)],'scope':_0x1c03d0?.[_0x5b657f(0x194)]},_0x4cd50a),{'ready':!![],'skipped':![]};}catch(_0x3e11f7){return console[_0x5b657f(0x1bf)](_0x5b657f(0x18f),_0x128234['EUTse'](_0x3e11f7,Error)?_0x3e11f7[_0x5b657f(0x16e)]:_0x3e11f7),{'ready':![],'skipped':![]};}}export async function start(_0x429890,_0x137288,_0xf941b0){const _0xc5445f=_0x25b0a5,_0x665dc7={'sFZLC':_0xc5445f(0x199),'QrtmB':_0xc5445f(0x179),'jCfzs':function(_0x15da4f,_0x345a1b){return _0x15da4f(_0x345a1b);},'dsLOl':'auth','xDIJj':'skipped','lvqOa':'chromium','WmIYP':_0xc5445f(0x1b0),'mGWkC':_0xc5445f(0x189),'mLGrP':function(_0x1cdd5e,_0x10bec2){return _0x1cdd5e&&_0x10bec2;},'leVzg':'skills','CAuzL':function(_0x5f2b1d){return _0x5f2b1d();},'mIwwY':function(_0x18a843,_0x56a1ca,_0x2c46f4){return _0x18a843(_0x56a1ca,_0x2c46f4);},'vzxSY':'profile','aNOKH':function(_0x231686,_0x5ef2ff){return _0x231686+_0x5ef2ff;},'PhuXb':function(_0x2e5f2f,_0x1388a7){return _0x2e5f2f(_0x1388a7);},'AsLEz':_0xc5445f(0x1c1),'Qfacj':_0xc5445f(0x185),'GljQY':_0xc5445f(0x1a0),'nGvAb':_0xc5445f(0x17f),'XuGZY':function(_0x1d013f,_0x2caa5a){return _0x1d013f+_0x2caa5a;},'FWowZ':function(_0x44bf2e,_0x8b7979){return _0x44bf2e+_0x8b7979;}};console['log'](_0x665dc7[_0xc5445f(0x1b6)]),_0x137288={..._0x137288,'scope':_0x665dc7['QrtmB']};const _0x436a9b=!existsSync(getRangerHomeDir());await _0x665dc7[_0xc5445f(0x174)](ensureRangerDir,'user');if(_0x137288?.['skipAuth'])console[_0xc5445f(0x173)](_0xc5445f(0x188)),_0xf941b0?.[_0xc5445f(0x18e)](_0x665dc7[_0xc5445f(0x1a5)],{'isFirstRun':_0x436a9b,'method':_0x665dc7[_0xc5445f(0x18c)]});else{_0xf941b0?.[_0xc5445f(0x19f)](_0xc5445f(0x1c5));const _0x5b5fe5=await _0x665dc7['jCfzs'](authenticate,_0x429890);_0xf941b0?.[_0xc5445f(0x18e)](_0x665dc7[_0xc5445f(0x1a5)],{'isFirstRun':_0x436a9b,'method':_0x5b5fe5[_0xc5445f(0x1b5)]});}_0xf941b0?.[_0xc5445f(0x19f)](_0x665dc7['lvqOa']);_0x137288?.[_0xc5445f(0x1c4)]?console['log'](_0x665dc7[_0xc5445f(0x192)]):await ensureChromium(_0x137288?.[_0xc5445f(0x1af)]);_0xf941b0?.['trackPhaseEnd'](_0xc5445f(0x17d),{'isFirstRun':_0x436a9b,'skipped':!!_0x137288?.[_0xc5445f(0x1c4)]}),console[_0xc5445f(0x173)](_0xc5445f(0x1ac));const _0x1bb37e=_0x137288?.['scope'],_0x5d4cae=_0x137288?.[_0xc5445f(0x1a1)]??![];let _0x530bcd=null;_0x5d4cae?(_0xf941b0?.['trackPhaseStart'](_0x665dc7['mGWkC']),_0x530bcd=await ensureOpencodePluginConfig(_0x1bb37e),_0xf941b0?.['trackPhaseEnd'](_0xc5445f(0x189),{'isFirstRun':_0x436a9b,'opencode':!![]})):(_0xf941b0?.[_0xc5445f(0x19f)]('plugin'),await ensureClaudePlugin(_0x1bb37e),_0xf941b0?.['trackPhaseEnd'](_0xc5445f(0x189),{'isFirstRun':_0x436a9b}));if(_0x665dc7[_0xc5445f(0x1b3)](_0x5d4cae,_0x530bcd)){_0xf941b0?.[_0xc5445f(0x19f)](_0x665dc7['leVzg']);try{await installSkill(_0xc5445f(0x1ab),{'level':_0x530bcd[_0xc5445f(0x194)],'cliVersion':_0x665dc7['CAuzL'](getCurrentVersion),'platform':'opencode'}),_0xf941b0?.['trackPhaseEnd'](_0x665dc7['leVzg'],{'isFirstRun':_0x436a9b,'opencode':!![]});}catch(_0x488263){console['warn']('\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:',_0x488263 instanceof Error?_0x488263[_0xc5445f(0x16e)]:_0x488263),_0xf941b0?.['trackPhaseEnd']('skills',{'isFirstRun':_0x436a9b,'opencode':!![],'failed':!![]});}}else _0xf941b0?.[_0xc5445f(0x19f)](_0x665dc7['leVzg']),await ensureClaudeSkills(_0x1bb37e),_0xf941b0?.['trackPhaseEnd']('skills',{'isFirstRun':_0x436a9b});if(_0x137288?.[_0xc5445f(0x181)])console['log']('\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a');else{if(_0x137288?.[_0xc5445f(0x1a8)]){_0xf941b0?.[_0xc5445f(0x19f)]('profile');const _0x50ee2a=await _0x665dc7[_0xc5445f(0x170)](ensureLocalEnv,{'url':_0x137288['url'],'force':_0x137288?.['force'],'allowInsecureLocalhost':_0x137288?.[_0xc5445f(0x165)],'scope':'user'},_0xf941b0);_0xf941b0?.[_0xc5445f(0x18e)](_0x665dc7[_0xc5445f(0x169)],{'isFirstRun':_0x436a9b,'profileReady':_0x50ee2a[_0xc5445f(0x1bd)],'userSkipped':_0x50ee2a[_0xc5445f(0x19c)]});}else console[_0xc5445f(0x173)](_0x665dc7[_0xc5445f(0x18d)](_0xc5445f(0x172)+_0x665dc7[_0xc5445f(0x186)](bold,_0x665dc7['AsLEz'])+'\x20','(and\x20'+bold('RANGER_TEST_PASSWORD')+'\x20when\x20the\x20org\x27s\x20login')+'\x0a\x20\x20config\x20uses\x20username+password).\x20Orgs\x20on\x20SSO/SAML/OAuth'+'\x20may\x20need\x20a\x20one-time\x20headed\x20login\x20instead\x20—'+_0xc5445f(0x183)),console[_0xc5445f(0x173)]('\x20\x20(or\x20use\x20'+_0x665dc7['PhuXb'](bold,_0x665dc7[_0xc5445f(0x16a)])+'\x20for\x20explicit\x20profile\x20management).');}if(_0x5d4cae)console[_0xc5445f(0x173)](_0x665dc7[_0xc5445f(0x177)]),console['log'](_0xc5445f(0x196)),console['log']('with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'),console['log'](_0xc5445f(0x195));else{const _0x4c1146=_0x665dc7[_0xc5445f(0x186)](bold,_0x665dc7['nGvAb']);console[_0xc5445f(0x173)](_0x665dc7[_0xc5445f(0x16c)](_0x665dc7[_0xc5445f(0x168)]('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x4c1146+_0xc5445f(0x1b7),'\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with')+_0xc5445f(0x1ca),'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.'));}}
1
+ const _0x376451=_0x5959;(function(_0x508644,_0x1d44c1){const _0x354d63=_0x5959,_0x2aeb9d=_0x508644();while(!![]){try{const _0x51a15c=-parseInt(_0x354d63(0x124))/0x1*(parseInt(_0x354d63(0xee))/0x2)+parseInt(_0x354d63(0x10f))/0x3+parseInt(_0x354d63(0x120))/0x4*(-parseInt(_0x354d63(0x11b))/0x5)+-parseInt(_0x354d63(0x107))/0x6*(-parseInt(_0x354d63(0x113))/0x7)+parseInt(_0x354d63(0xe1))/0x8+-parseInt(_0x354d63(0xde))/0x9+parseInt(_0x354d63(0x126))/0xa;if(_0x51a15c===_0x1d44c1)break;else _0x2aeb9d['push'](_0x2aeb9d['shift']());}catch(_0x1a40f0){_0x2aeb9d['push'](_0x2aeb9d['shift']());}}}(_0x4d9d,0x49298));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x562615 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';function _0x5959(_0xb68d1b,_0x1dee61){_0xb68d1b=_0xb68d1b-0xc2;const _0x4d9d41=_0x4d9d();let _0x595951=_0x4d9d41[_0xb68d1b];return _0x595951;}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=_0x376451(0x11d);const bold=_0x492bcb=>'\x1b[1m'+_0x492bcb+'\x1b[0m';export function getPlaywrightVersion(){const _0x521ca1=_0x376451;try{const _0x27e30b=require['resolve'](_0x521ca1(0x11c)),_0x1b01a0=require(_0x27e30b);return _0x1b01a0[_0x521ca1(0xfc)];}catch{return null;}}export function installChromiumBinary(_0x47718c,_0xfb1afa=![]){const _0x1527b2=_0x376451,_0x1de8ad={'wikjw':function(_0x33eedf,_0x1c189d){return _0x33eedf===_0x1c189d;},'Vrcch':function(_0x3e9e69,_0x493286){return _0x3e9e69(_0x493286);},'OKRZm':function(_0x5b996f,_0x5b6706){return _0x5b996f(_0x5b6706);},'sJsLm':'chromium','eUZDp':_0x1527b2(0x10b),'VEcQq':_0x1527b2(0x123),'vgLOx':'error'};return new Promise((_0x6fd274,_0x48c636)=>{const _0x42235c=_0x1527b2,_0xa38ea4={'CXFOP':function(_0x2f5aeb,_0x11d1be){const _0xfa4af6=_0x5959;return _0x1de8ad[_0xfa4af6(0xea)](_0x2f5aeb,_0x11d1be);}},_0x406f5c=['playwright@'+_0x47718c,_0x42235c(0xd0),..._0xfb1afa?[_0x42235c(0x12f)]:[],_0x1de8ad[_0x42235c(0xcd)]],_0xc1ce0e=spawn('npx',_0x406f5c,{'stdio':[_0x42235c(0xcb),_0x1de8ad[_0x42235c(0xeb)],_0x1de8ad[_0x42235c(0xeb)]],'shell':process['platform']===_0x1de8ad['VEcQq']});_0xc1ce0e['on']('close',_0x449b6b=>{const _0x5817a6=_0x42235c;_0x1de8ad['wikjw'](_0x449b6b,0x0)?_0x6fd274():_0x1de8ad['Vrcch'](_0x48c636,new Error(_0x5817a6(0x10a)+_0x449b6b));}),_0xc1ce0e['on'](_0x1de8ad[_0x42235c(0x114)],_0x4eb00d=>{_0xa38ea4['CXFOP'](_0x48c636,_0x4eb00d);});});}export async function authenticate(_0x261538){const _0x2a888f=_0x376451,_0x58d398={'DifcJ':function(_0x17b202){return _0x17b202();},'aZLZR':function(_0x2ea260,_0x56d669){return _0x2ea260 instanceof _0x56d669;},'GrqBk':function(_0x306d8f,_0x1c2a93){return _0x306d8f(_0x1c2a93);},'mrtXc':'device_auth','EDetJ':_0x2a888f(0xd7)};if(!_0x261538){const _0x32f1fc=await _0x58d398['DifcJ'](getToken);if(_0x32f1fc){const _0x4cf557=await getCurrentUser(_0x32f1fc);if(_0x4cf557[_0x2a888f(0xed)])return console[_0x2a888f(0xd6)]('✓\x20Already\x20authenticated\x20to\x20'+_0x4cf557['user'][_0x2a888f(0xdd)]),{'token':_0x32f1fc,'method':_0x2a888f(0xe2)};}try{_0x261538=await runDeviceAuthFlow();}catch(_0x47f79a){throw new Error('Authentication\x20failed:\x20'+(_0x58d398[_0x2a888f(0xcf)](_0x47f79a,Error)?_0x47f79a['message']:_0x47f79a));}const _0xcc1aef=await _0x58d398[_0x2a888f(0xd8)](getCurrentUser,_0x261538);if(!_0xcc1aef[_0x2a888f(0xed)])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0xcc1aef[_0x2a888f(0xc6)]);return console['log'](_0x2a888f(0x100)+_0xcc1aef[_0x2a888f(0x115)]['organizationName']),{'token':_0x261538,'method':_0x58d398[_0x2a888f(0x106)]};}console['log']('Validating\x20API\x20token...');const _0x1a4998=await getCurrentUser(_0x261538);if(!_0x1a4998['success']){if(_0x1a4998[_0x2a888f(0xdf)])throw new Error(_0x2a888f(0xc4)+_0x1a4998[_0x2a888f(0xc6)]+_0x2a888f(0x117));else throw new Error(_0x2a888f(0x102)+_0x1a4998[_0x2a888f(0xc6)]+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console['log']('✓\x20Authenticated\x20to\x20'+_0x1a4998[_0x2a888f(0x115)][_0x2a888f(0xdd)]),await _0x58d398[_0x2a888f(0xd8)](storeToken,_0x261538),console['log'](process['env']['GITHUB_ENV']?'✓\x20Exported\x20credentials\x20for\x20CI':'✓\x20Stored\x20credentials\x20locally'),{'token':_0x261538,'method':_0x58d398['EDetJ']};}export async function ensureRangerDir(_0x12c5aa){const _0x37a40d=_0x376451,_0x3d1abb={'SBfRY':function(_0xbd0755){return _0xbd0755();},'qtygQ':_0x37a40d(0xc9),'bvaPx':'✓\x20~/.ranger/\x20directory\x20already\x20exists'};void _0x12c5aa;const _0x5176ea=_0x3d1abb['SBfRY'](getRangerHomeDir);return!existsSync(_0x5176ea)?(await mkdir(_0x5176ea,{'recursive':!![]}),console['log'](_0x3d1abb['qtygQ']),{'path':_0x5176ea,'installed':!![]}):(console[_0x37a40d(0xd6)](_0x3d1abb['bvaPx']),{'path':_0x5176ea,'installed':![]});}export async function ensureChromium(_0x16550d=![]){const _0x350565=_0x376451,_0x179634={'IfeMq':'✓\x20Playwright\x20Chromium\x20browser\x20found','wKCMW':function(_0x3184f5,_0x65b990){return _0x3184f5??_0x65b990;},'rlean':_0x350565(0x101),'KERgL':_0x350565(0xf2),'SrPlu':_0x350565(0xd9),'jynnt':function(_0x13539d,_0x56e512){return _0x13539d instanceof _0x56e512;},'bEVhm':_0x350565(0xce)};let _0x2e4429=![];try{const _0x3b883d=chromium[_0x350565(0xc2)]();_0x2e4429=existsSync(_0x3b883d);}catch{_0x2e4429=![];}if(_0x2e4429)return console['log'](_0x179634['IfeMq']),![];const _0x164dfb=getPlaywrightVersion(),_0x4cacef=_0x179634[_0x350565(0xef)](_0x164dfb,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x499dda=!_0x164dfb,_0x57606e=process[_0x350565(0x116)]['isTTY']&&process['stdout'][_0x350565(0xd1)];let _0x1a999f=!![];if(_0x57606e){const {install:_0x4c45c0}=await _0x562615[_0x350565(0x109)]([{'type':_0x179634['rlean'],'name':_0x350565(0xd0),'message':_0x499dda?_0x350565(0x105)+_0x4cacef+'\x20now?':'The\x20required\x20version\x20('+_0x4cacef+_0x350565(0xf3),'default':!![]}]);_0x1a999f=_0x4c45c0;}else console[_0x350565(0xd6)](_0x350565(0xc7)+_0x4cacef+(_0x499dda?_0x179634['KERgL']:'')+'...');if(_0x1a999f){console['log'](_0x179634['SrPlu']);try{await installChromiumBinary(_0x4cacef,_0x16550d),console[_0x350565(0xd6)]('\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully');}catch(_0x131ed0){console['error'](_0x350565(0x128),_0x179634[_0x350565(0x10d)](_0x131ed0,Error)?_0x131ed0['message']:_0x131ed0),console[_0x350565(0xd6)](_0x350565(0xd4)),console['log'](_0x350565(0xf9)+_0x4cacef+'\x20install\x20chromium');}}else console['log'](_0x179634[_0x350565(0xfe)]),console[_0x350565(0xd6)]('You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'),console[_0x350565(0xd6)](_0x350565(0xf9)+_0x4cacef+_0x350565(0x11e));return!![];}export async function writeRangerGitignore(_0x54a572){const _0x481cd5=_0x376451,_0x34b8ec={'vCWnl':'.gitignore','FgWef':_0x481cd5(0x11f)},_0x38dea4=join(_0x54a572,_0x34b8ec['vCWnl']),_0x29803f=_0x481cd5(0x12e);await writeFile(_0x38dea4,_0x29803f),console['log'](_0x34b8ec['FgWef']);}export async function ensureLocalEnv(_0x4c0cb2,_0x3c1c47){const _0xeff326=_0x376451,_0x37d62f={'MqmpU':function(_0xd0f5f){return _0xd0f5f();},'tgcMC':function(_0x5d982d,_0x2d1b26){return _0x5d982d===_0x2d1b26;},'sANtW':_0xeff326(0x12a),'RpySR':function(_0x27bc70,_0x291307){return _0x27bc70 instanceof _0x291307;}};if(!_0x37d62f[_0xeff326(0xf8)](findGitRoot)&&_0x4c0cb2?.['scope']!=='user')return console[_0xeff326(0xd6)](_0xeff326(0x127)),{'ready':![],'skipped':!![]};const _0xf99dc8=_0x37d62f[_0xeff326(0xe9)](_0x4c0cb2?.[_0xeff326(0xe5)],_0xeff326(0x115))?getRangerHomeDir():undefined;if(findExistingEnv('local',{'locations':[_0x37d62f['sANtW']],'rangerDir':_0xf99dc8}))return console[_0xeff326(0xd6)](_0xeff326(0xca)),{'ready':!![],'skipped':![]};try{return await addEnv('local',{'url':_0x4c0cb2?.[_0xeff326(0x111)],'force':_0x4c0cb2?.[_0xeff326(0xcc)],'allowInsecureLocalhost':_0x4c0cb2?.[_0xeff326(0xff)],'scope':_0x4c0cb2?.[_0xeff326(0xe5)]},_0x3c1c47),{'ready':!![],'skipped':![]};}catch(_0x124a33){return console[_0xeff326(0xc6)]('\x0a❌\x20Profile\x20setup\x20failed:',_0x37d62f[_0xeff326(0x12c)](_0x124a33,Error)?_0x124a33[_0xeff326(0x10e)]:_0x124a33),{'ready':![],'skipped':![]};}}export async function start(_0x530598,_0x49be40,_0x511cde){const _0x2e92ab=_0x376451,_0x210592={'mduFm':function(_0x12243f,_0x2b3a6b){return _0x12243f+_0x2b3a6b;},'fDYSp':function(_0xe22eef,_0x56545d){return _0xe22eef(_0x56545d);},'MnjQN':'user','SGQtB':function(_0x5b12b9){return _0x5b12b9();},'iBfmE':'auth','diMVx':'chromium','LZFJw':_0x2e92ab(0xd3),'fwNgJ':function(_0x200c85,_0x2d798f){return _0x200c85(_0x2d798f);},'bVflU':_0x2e92ab(0xfa),'MkJHz':function(_0x32f77b,_0x308039){return _0x32f77b&&_0x308039;},'eOdqh':'skills','dCzqh':function(_0x122567,_0x58b5d3,_0x4b8674){return _0x122567(_0x58b5d3,_0x4b8674);},'cgZAH':_0x2e92ab(0x119),'KFBfC':'\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','ijyEV':function(_0xd18531,_0x4ad1a9){return _0xd18531+_0x4ad1a9;},'ksZpp':_0x2e92ab(0x104),'CCuCb':_0x2e92ab(0xe3)};console[_0x2e92ab(0xd6)](_0x2e92ab(0xdc));_0x49be40?.[_0x2e92ab(0xe5)]!==undefined&&_0x49be40['scope']!=='user'&&(console['error'](_0x210592[_0x2e92ab(0xe7)](_0x2e92ab(0xf4)+_0x210592['fDYSp'](String,_0x49be40[_0x2e92ab(0xe5)])+'\x20is\x20no\x20longer\x20supported.\x20',_0x2e92ab(0xc5))+'project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.'),process[_0x2e92ab(0xd5)](0x1));_0x49be40={..._0x49be40,'scope':_0x210592['MnjQN']};const _0x36a34c=!_0x210592[_0x2e92ab(0x118)](existsSync,_0x210592['SGQtB'](getRangerHomeDir));await _0x210592[_0x2e92ab(0x118)](ensureRangerDir,_0x210592['MnjQN']);if(_0x49be40?.[_0x2e92ab(0xda)])console['log'](_0x2e92ab(0x12d)),_0x511cde?.[_0x2e92ab(0xfd)](_0x210592[_0x2e92ab(0x122)],{'isFirstRun':_0x36a34c,'method':'skipped'});else{_0x511cde?.[_0x2e92ab(0x11a)](_0x210592['iBfmE']);const _0x52702e=await authenticate(_0x530598);_0x511cde?.['trackPhaseEnd']('auth',{'isFirstRun':_0x36a34c,'method':_0x52702e['method']});}_0x511cde?.[_0x2e92ab(0x11a)](_0x210592[_0x2e92ab(0xdb)]);_0x49be40?.[_0x2e92ab(0xec)]?console['log'](_0x210592['LZFJw']):await ensureChromium(_0x49be40?.['withDeps']);_0x511cde?.[_0x2e92ab(0xfd)](_0x210592['diMVx'],{'isFirstRun':_0x36a34c,'skipped':!!_0x49be40?.['skipChromium']}),console[_0x2e92ab(0xd6)]('\x0a✅\x20Ranger\x20setup\x20complete!\x0a');const _0x3aebcf=_0x49be40?.[_0x2e92ab(0xe5)],_0x4f8045=_0x49be40?.[_0x2e92ab(0x119)]??![];let _0x29538d=null;_0x4f8045?(_0x511cde?.[_0x2e92ab(0x11a)](_0x2e92ab(0xfa)),_0x29538d=await _0x210592[_0x2e92ab(0xf1)](ensureOpencodePluginConfig,_0x3aebcf),_0x511cde?.['trackPhaseEnd'](_0x2e92ab(0xfa),{'isFirstRun':_0x36a34c,'opencode':!![]})):(_0x511cde?.['trackPhaseStart']('plugin'),await ensureClaudePlugin(_0x3aebcf),_0x511cde?.[_0x2e92ab(0xfd)](_0x210592['bVflU'],{'isFirstRun':_0x36a34c}));if(_0x210592['MkJHz'](_0x4f8045,_0x29538d)){_0x511cde?.['trackPhaseStart'](_0x210592[_0x2e92ab(0x125)]);try{await _0x210592[_0x2e92ab(0xd2)](installSkill,_0x2e92ab(0x10c),{'level':_0x29538d['scope'],'cliVersion':_0x210592[_0x2e92ab(0xe0)](getCurrentVersion),'platform':_0x210592['cgZAH']}),_0x511cde?.[_0x2e92ab(0xfd)](_0x210592[_0x2e92ab(0x125)],{'isFirstRun':_0x36a34c,'opencode':!![]});}catch(_0xcebd61){console['warn'](_0x210592[_0x2e92ab(0xe6)],_0xcebd61 instanceof Error?_0xcebd61['message']:_0xcebd61),_0x511cde?.[_0x2e92ab(0xfd)](_0x210592['eOdqh'],{'isFirstRun':_0x36a34c,'opencode':!![],'failed':!![]});}}else _0x511cde?.[_0x2e92ab(0x11a)]('skills'),await ensureClaudeSkills(_0x3aebcf),_0x511cde?.[_0x2e92ab(0xfd)]('skills',{'isFirstRun':_0x36a34c});if(_0x49be40?.[_0x2e92ab(0xda)])console['log'](_0x2e92ab(0xe4));else{if(_0x49be40?.[_0x2e92ab(0x111)]){_0x511cde?.['trackPhaseStart'](_0x2e92ab(0xc8));const _0x23cb4e=await ensureLocalEnv({'url':_0x49be40['url'],'force':_0x49be40?.['force'],'allowInsecureLocalhost':_0x49be40?.[_0x2e92ab(0xff)],'scope':_0x210592['MnjQN']},_0x511cde);_0x511cde?.[_0x2e92ab(0xfd)]('profile',{'isFirstRun':_0x36a34c,'profileReady':_0x23cb4e[_0x2e92ab(0xf5)],'userSkipped':_0x23cb4e['skipped']});}else console['log'](_0x210592['mduFm'](_0x210592[_0x2e92ab(0x108)](_0x2e92ab(0x129),_0x2e92ab(0xf0)+bold('ranger\x20profile\x20add\x20<name>'))+_0x2e92ab(0x121),_0x2e92ab(0xe8))+_0x2e92ab(0x110));}if(_0x4f8045)console[_0x2e92ab(0xd6)](_0x2e92ab(0xc3)),console[_0x2e92ab(0xd6)](_0x2e92ab(0xf6)),console[_0x2e92ab(0xd6)]('with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'),console['log'](_0x210592[_0x2e92ab(0x103)]);else{const _0x5ec45a=_0x210592[_0x2e92ab(0x118)](bold,_0x210592[_0x2e92ab(0xf7)]);console['log'](_0x210592[_0x2e92ab(0x108)](_0x210592[_0x2e92ab(0x108)](_0x210592['mduFm']('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x5ec45a+_0x2e92ab(0xfb),_0x2e92ab(0x112)),'\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'),_0x2e92ab(0x12b)));}}function _0x4d9d(){const _0x11393f=['stdin','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','fDYSp','opencode','trackPhaseStart','383485HNZoXc','playwright/package.json','1.58.2','\x20install\x20chromium','✓\x20Created\x20.ranger/.gitignore','28NQEMZk','\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','iBfmE','win32','1434bmEiWY','eOdqh','2368340fpOzJC','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','local','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','RpySR','✓\x20Skipping\x20authentication\x20(--skip-auth)','\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','--with-deps','executablePath','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','Authentication\x20failed:\x20','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','error','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','profile','✓\x20Created\x20~/.ranger/\x20directory','✓\x20Local\x20profile\x20already\x20exists','ignore','force','sJsLm','\x0a⚠\x20Skipping\x20Chromium\x20installation.','aZLZR','install','isTTY','dCzqh','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','You\x20can\x20install\x20it\x20manually\x20by\x20running:','exit','log','provided_token','GrqBk','\x0aInstalling\x20Chromium\x20browser...\x0a','skipAuth','diMVx','\x0a🚀\x20Ranger\x20Setup\x0a','organizationName','1008243OzMccY','status','SGQtB','1580384nSSZOJ','existing_token','/ranger:enable','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','scope','KFBfC','mduFm','\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','tgcMC','OKRZm','eUZDp','skipChromium','success','46eOUWxB','wKCMW','\x0a\x20\x20','fwNgJ','\x20(fallback\x20version)',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','ranger\x20setup\x20--scope=','ready','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','CCuCb','MqmpU','\x20\x20npx\x20playwright@','plugin','\x20and\x20prompt\x20the\x20coding','version','trackPhaseEnd','bEVhm','allowInsecureLocalhost','✓\x20Authenticated\x20to\x20','confirm','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','ksZpp','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','mrtXc','186BbasvX','ijyEV','prompt','Installation\x20failed\x20with\x20exit\x20code\x20','inherit','ranger','jynnt','message','1175232plAkPv','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','url','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','35098bEberS','vgLOx','user'];_0x4d9d=function(){return _0x11393f;};return _0x4d9d();}
@@ -1 +1 @@
1
- const _0x50f080=_0x2cce;(function(_0x67e6e3,_0x4c0f3a){const _0x116e5a=_0x2cce,_0x2a9a1d=_0x67e6e3();while(!![]){try{const _0x2e7534=-parseInt(_0x116e5a(0xa9))/0x1+parseInt(_0x116e5a(0x77))/0x2+-parseInt(_0x116e5a(0xbc))/0x3*(-parseInt(_0x116e5a(0xb7))/0x4)+-parseInt(_0x116e5a(0xae))/0x5*(parseInt(_0x116e5a(0x92))/0x6)+-parseInt(_0x116e5a(0x88))/0x7+-parseInt(_0x116e5a(0x6d))/0x8*(-parseInt(_0x116e5a(0x7d))/0x9)+-parseInt(_0x116e5a(0xb9))/0xa;if(_0x2e7534===_0x4c0f3a)break;else _0x2a9a1d['push'](_0x2a9a1d['shift']());}catch(_0x5641c8){_0x2a9a1d['push'](_0x2a9a1d['shift']());}}}(_0x5954,0x23b9c));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0xca1dbf=>'\x1b[1m'+_0xca1dbf+'\x1b[0m',link=(_0x4dd08b,_0x2403d1)=>_0x50f080(0x6b)+_0x4dd08b+'\x07'+(_0x2403d1||_0x4dd08b)+_0x50f080(0x9b);function _0x2cce(_0x38f2b2,_0x9ef0e3){_0x38f2b2=_0x38f2b2-0x69;const _0x5954c3=_0x5954();let _0x2cce6b=_0x5954c3[_0x38f2b2];return _0x2cce6b;}async function getOpencodePluginStatus(){const _0x19289b=_0x50f080,_0x3df12a={'wkMIK':function(_0x58d795,_0x242dae){return _0x58d795(_0x242dae);},'wyZQn':_0x19289b(0xc2),'KNJfl':function(_0x14493e,_0x27d35f){return _0x14493e!==_0x27d35f;},'VlCUP':'string','NEvAW':function(_0x52d762,_0x31cf23){return _0x52d762(_0x31cf23);},'rtOzZ':function(_0xc6fd0d,_0xfd52c){return _0xc6fd0d>_0xfd52c;},'jecWM':function(_0x2029ad,_0x204923){return _0x2029ad>_0x204923;},'quTAC':function(_0xfe15c2,_0x2c6a02){return _0xfe15c2(_0x2c6a02);},'xhiEq':_0x19289b(0xa7),'XBGdi':function(_0x8a42a1,_0x4b6b82,_0x4db7e7,_0x1df279){return _0x8a42a1(_0x4b6b82,_0x4db7e7,_0x1df279);},'FUiNE':_0x19289b(0xa2),'VuNlI':'debug','LvLih':_0x19289b(0xbb),'cvFvM':'pipe','XjzYn':_0x19289b(0x82)};return new Promise(_0x19078d=>{const _0x5270aa=_0x19289b,_0x19062e=_0x3df12a['XBGdi'](spawn,_0x3df12a['FUiNE'],[_0x3df12a[_0x5270aa(0x9f)],'config'],{'stdio':[_0x3df12a[_0x5270aa(0x96)],_0x3df12a['cvFvM'],_0x3df12a['cvFvM']]});let _0x36746b='';_0x19062e['stdout']?.['on']('data',_0xb1dab9=>{const _0x2fd265=_0x5270aa;_0x36746b+=_0xb1dab9[_0x2fd265(0xb4)]();}),_0x19062e[_0x5270aa(0x8d)]?.['on']('data',_0x1f6ef6=>{_0x36746b+=_0x1f6ef6['toString']();}),_0x19062e['on'](_0x5270aa(0x7a),()=>{const _0x4b2625=_0x5270aa;_0x3df12a['wkMIK'](_0x19078d,{'status':_0x3df12a[_0x4b2625(0xc5)]});}),_0x19062e['on'](_0x3df12a['XjzYn'],_0x276733=>{const _0x32aed0=_0x5270aa,_0x1d9c69={'shfVy':function(_0x42e2c6,_0x1a2f71){return _0x3df12a['KNJfl'](_0x42e2c6,_0x1a2f71);},'hxvWI':_0x3df12a['VlCUP']};if(_0x276733!==0x0){_0x3df12a['NEvAW'](_0x19078d,{'status':_0x3df12a['wyZQn']});return;}const _0x595018=_0x36746b['trim']();let _0x52bc99=null;if(_0x595018)try{_0x52bc99=JSON['parse'](_0x595018);}catch{const _0x56bfaf=_0x595018['match'](/\{[\s\S]*\}$/);if(_0x56bfaf)try{_0x52bc99=JSON[_0x32aed0(0x90)](_0x56bfaf[0x0]);}catch{_0x52bc99=null;}}const _0x23f17d=Array['isArray'](_0x52bc99?.[_0x32aed0(0xb5)])?_0x52bc99?.['plugin']:[],_0x43883d=_0x23f17d['some'](_0x587aca=>{const _0x1ad8e0=_0x32aed0;if(_0x1d9c69[_0x1ad8e0(0x85)](typeof _0x587aca,_0x1d9c69[_0x1ad8e0(0xb1)]))return![];return _0x587aca[_0x1ad8e0(0x95)]('@ranger-testing/opencode-plugin')||_0x587aca[_0x1ad8e0(0x95)]('opencode-plugin');});if(_0x43883d){_0x19078d({'status':_0x32aed0(0xb0),'details':_0x3df12a[_0x32aed0(0xc0)](_0x23f17d[_0x32aed0(0x93)],0x0)?_0x23f17d[_0x32aed0(0x93)]+_0x32aed0(0x70):undefined});return;}if(_0x3df12a[_0x32aed0(0x74)](_0x23f17d['length'],0x0)){_0x3df12a['quTAC'](_0x19078d,{'status':_0x32aed0(0xa7),'details':_0x23f17d['length']+'\x20plugin(s)\x20configured'});return;}_0x19078d({'status':_0x3df12a[_0x32aed0(0x97)]});});});}async function getSkillsFromDir(_0x133211,_0x21bae9){const _0x3b1998=_0x50f080,_0x25a9e={'zQNHG':function(_0x5f5763,_0x5d48af,_0x53f1a0,_0x313050){return _0x5f5763(_0x5d48af,_0x53f1a0,_0x313050);},'YzMWn':'SKILL.md','uQqNO':function(_0x4ed033,_0x12bc90){return _0x4ed033(_0x12bc90);}};if(!existsSync(_0x133211))return[];const _0x243913=[];try{const _0x2773cf=await readdir(_0x133211,{'withFileTypes':!![]});for(const _0x29e0ef of _0x2773cf){if(_0x29e0ef['isDirectory']()){const _0x46f45d=_0x25a9e[_0x3b1998(0x9a)](join,_0x133211,_0x29e0ef[_0x3b1998(0x8b)],_0x25a9e[_0x3b1998(0xad)]);if(_0x25a9e[_0x3b1998(0xa8)](existsSync,_0x46f45d)){let _0x38db1b=_0x29e0ef[_0x3b1998(0x8b)];try{const _0x252a21=await readFile(_0x46f45d,'utf-8'),_0x56fcb4=_0x252a21[_0x3b1998(0x89)](/name:\s*(.+)/);_0x56fcb4&&(_0x38db1b=_0x56fcb4[0x1]['trim']());}catch{}_0x243913[_0x3b1998(0x9e)]({'name':_0x29e0ef[_0x3b1998(0x8b)],'displayName':_0x38db1b,'path':_0x46f45d,'level':_0x21bae9});}}}}catch{return[];}return _0x243913;}async function getInstalledSkills(){const _0x2093e4=_0x50f080,_0xd2d567={'YSocc':function(_0x3d76fd,_0x190942,_0x3eebe5){return _0x3d76fd(_0x190942,_0x3eebe5);},'bZSkI':function(_0x5e9848){return _0x5e9848();},'tUbha':_0x2093e4(0x81),'PRpxw':function(_0x5236d3){return _0x5236d3();},'XjhnQ':_0x2093e4(0x9c)},[_0x5cecef,_0x58f355]=await Promise['all']([_0xd2d567[_0x2093e4(0xb3)](getSkillsFromDir,_0xd2d567[_0x2093e4(0x7e)](getProjectSkillsDir),_0xd2d567['tUbha']),getSkillsFromDir(_0xd2d567[_0x2093e4(0xa6)](getUserSkillsDir),_0xd2d567[_0x2093e4(0x6a)])]);return{'project':_0x5cecef,'user':_0x58f355};}async function getEnvironments(){const _0x4959d=_0x50f080,_0x1c819c={'RhQbT':'auth.json','rBfJg':function(_0x25d83e,_0x589046,_0x2753bc){return _0x25d83e(_0x589046,_0x2753bc);},'JSlNf':'auth.json.enc','dLByv':function(_0x498779,_0x2287ab){return _0x498779(_0x2287ab);},'duOCk':function(_0x133d3b,_0x3a5fb5){return _0x133d3b===_0x3a5fb5;},'KEdZJ':function(_0x47689c){return _0x47689c();}},{envNames:_0x22923e,activeEnv:_0x195b70}=await getEnvNames(),_0x44e855=_0x1c819c['KEdZJ'](getRangerDir);if(!existsSync(_0x44e855))return{'envs':[],'activeEnv':null};const _0x37d908=_0x22923e[_0x4959d(0x8f)](_0x38a374=>{const _0x32620d=_0x4959d,_0x507465=getEnvDir(_0x38a374),_0x2cb90d=join(_0x507465,_0x32620d(0xc4)),_0x37a9af=join(_0x507465,_0x1c819c[_0x32620d(0x80)]),_0x5c1a68=_0x1c819c['rBfJg'](join,_0x507465,_0x1c819c['JSlNf']);return{'name':_0x38a374,'settingsPath':existsSync(_0x2cb90d)?_0x2cb90d:_0x32620d(0x9d),'hasPlaintextAuth':existsSync(_0x37a9af),'hasEncryptedAuth':_0x1c819c[_0x32620d(0xac)](existsSync,_0x5c1a68),'isActive':_0x1c819c['duOCk'](_0x38a374,_0x195b70)};});return{'envs':_0x37d908,'activeEnv':_0x195b70};}export async function status(){const _0x1632d2=_0x50f080,_0x25358f={'zYNMP':_0x1632d2(0xc6),'QYcZv':function(_0xdbac48){return _0xdbac48();},'TnTTW':function(_0x41802d,_0x577704){return _0x41802d(_0x577704);},'RgZrj':function(_0x5f29db,_0x10dd3c,_0x9a2748){return _0x5f29db(_0x10dd3c,_0x9a2748);},'UeLXf':function(_0xb0316f){return _0xb0316f();},'zmMko':function(_0x2efc94,_0x5062f4){return _0x2efc94!==_0x5062f4;},'Vthja':function(_0x716964){return _0x716964();},'GFuUu':function(_0x56b0b6){return _0x56b0b6();},'EbsaH':function(_0x45831f,_0x179333){return _0x45831f===_0x179333;},'WFgSD':_0x1632d2(0xb0),'fMDlz':_0x1632d2(0x98),'IRbvP':function(_0x4bb58d,_0x9abe76){return _0x4bb58d===_0x9abe76;},'swCYO':'not_configured','wtOIh':_0x1632d2(0x8c),'oWqUq':function(_0x21fc1a,_0xd9a9b){return _0x21fc1a(_0xd9a9b);},'MbdJm':_0x1632d2(0xbd),'kasAO':_0x1632d2(0x83),'ucjHx':'\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','TGqdI':'\x0a---\x20Skills\x20---','ulcke':function(_0x31963b,_0x5b59bb){return _0x31963b>_0x5b59bb;},'gkFUA':function(_0x47d894,_0xcae92b){return _0x47d894>_0xcae92b;},'kZobe':'\x20\x20User-level:','xosUJ':_0x1632d2(0x9d)};console['log'](_0x25358f[_0x1632d2(0xc1)]);const _0x2ed895=process['cwd'](),_0x5e9d36=_0x25358f['QYcZv'](getRangerDir);if(!_0x25358f['TnTTW'](existsSync,_0x5e9d36)){console['log'](_0x1632d2(0x73)+link(_0x2ed895,bold(_0x25358f['TnTTW'](basename,_0x2ed895)))),console['log']('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console['log'](_0x1632d2(0x73)+_0x25358f[_0x1632d2(0xaa)](link,_0x2ed895,_0x25358f[_0x1632d2(0x78)](bold,_0x25358f['TnTTW'](basename,_0x2ed895))));const _0x4f9511=getCurrentVersion(),_0x480ad6=_0x25358f[_0x1632d2(0x8e)](getLatestVersion);if(_0x480ad6['version']&&_0x25358f['zmMko'](_0x480ad6['version'],_0x4f9511))console[_0x1632d2(0x6c)](_0x1632d2(0xa5)+_0x4f9511+_0x1632d2(0x91)+_0x480ad6[_0x1632d2(0x71)]+')'),console['log'](_0x1632d2(0x7b));else _0x480ad6['version']?console['log']('Version:\x20'+_0x4f9511+'\x20(up\x20to\x20date)'):console['log']('Version:\x20'+_0x4f9511);const _0x11469d=await getToken();if(_0x11469d){const _0x546aa4=await _0x25358f[_0x1632d2(0x78)](getCurrentUser,_0x11469d);_0x546aa4['success']?console[_0x1632d2(0x6c)](_0x1632d2(0x87)+_0x25358f['TnTTW'](bold,_0x546aa4[_0x1632d2(0x9c)]['organizationName'])):(console['log'](_0x1632d2(0x94)),console['log'](_0x1632d2(0xc8)));}else console[_0x1632d2(0x6c)]('API\x20Token:\x20✗\x20Not\x20found'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]');process[_0x1632d2(0xb8)]['DEBUG']&&(console['log'](_0x1632d2(0x6e)+_0x25358f[_0x1632d2(0x76)](getCurrentEnvironment)),console[_0x1632d2(0x6c)](_0x1632d2(0xc7)+getApiBaseUrl()));console[_0x1632d2(0x6c)]('\x0a---\x20OpenCode\x20Plugin\x20---');const _0x3552b9=await _0x25358f['GFuUu'](getOpencodePluginStatus);if(_0x25358f['EbsaH'](_0x3552b9[_0x1632d2(0x75)],_0x25358f['WFgSD']))console['log']('\x20\x20'+_0x25358f['TnTTW'](bold,_0x25358f[_0x1632d2(0xba)])+_0x1632d2(0xab)),_0x3552b9[_0x1632d2(0x6f)]&&console[_0x1632d2(0x6c)]('\x20\x20'+_0x3552b9[_0x1632d2(0x6f)]);else _0x25358f[_0x1632d2(0x7f)](_0x3552b9[_0x1632d2(0x75)],_0x25358f['swCYO'])?(console[_0x1632d2(0x6c)](_0x1632d2(0x79)),_0x3552b9[_0x1632d2(0x6f)]&&console['log']('\x20\x20'+_0x3552b9[_0x1632d2(0x6f)]),console['log'](_0x1632d2(0xb6))):console['log']('\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available');console['log']('\x0a---\x20Claude\x20Code\x20Plugin\x20---');const _0x56075e=await getPluginInfo(_0x1632d2(0xbd));if(_0x56075e){const _0x2597e6=_0x56075e[_0x1632d2(0xa4)]||'unknown',_0x45af95=_0x56075e[_0x1632d2(0xb2)]?'enabled':_0x25358f['wtOIh'];console['log']('\x20\x20'+_0x25358f['oWqUq'](bold,_0x25358f['MbdJm'])+_0x1632d2(0x84)+_0x2597e6+',\x20'+_0x45af95+')');}else console['log'](_0x25358f['kasAO']),console['log'](_0x25358f['ucjHx']);console[_0x1632d2(0x6c)](_0x25358f['TGqdI']);const {project:_0x5b71e7,user:_0x22d46a}=await getInstalledSkills(),_0x584536=_0x5b71e7[_0x1632d2(0x8a)](_0x417261=>RANGER_MANAGED_SKILLS[_0x1632d2(0x95)](_0x417261[_0x1632d2(0x8b)])),_0xf10b89=_0x22d46a['filter'](_0xee1691=>RANGER_MANAGED_SKILLS[_0x1632d2(0x95)](_0xee1691['name'])),_0x3ad0be=_0x584536['length']+_0xf10b89[_0x1632d2(0x93)];if(_0x25358f['EbsaH'](_0x3ad0be,0x0))console['log'](_0x1632d2(0x86)),console[_0x1632d2(0x6c)]('\x20\x20Run:\x20ranger\x20skillup');else{if(_0x25358f[_0x1632d2(0xa0)](_0x584536['length'],0x0)){console['log'](_0x1632d2(0xa3));for(const _0x44f561 of _0x584536){console[_0x1632d2(0x6c)]('\x20\x20\x20\x20'+bold(_0x44f561['displayName'])+':\x20'+link(_0x44f561[_0x1632d2(0xa1)],_0x25358f['oWqUq'](basename,_0x44f561[_0x1632d2(0xa1)])));}}if(_0x25358f[_0x1632d2(0xbf)](_0xf10b89[_0x1632d2(0x93)],0x0)){console[_0x1632d2(0x6c)](_0x25358f['kZobe']);for(const _0x4481eb of _0xf10b89){console[_0x1632d2(0x6c)](_0x1632d2(0xc3)+bold(_0x4481eb['displayName'])+':\x20'+_0x25358f['RgZrj'](link,_0x4481eb['path'],basename(_0x4481eb['path'])));}}}console[_0x1632d2(0x6c)](_0x1632d2(0x7c));const {envs:_0x23776d,activeEnv:_0x255efd}=await getEnvironments();if(_0x23776d[_0x1632d2(0x93)]===0x0)console['log']('No\x20profiles\x20configured'),console['log']('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{for(const _0x559ff8 of _0x23776d){const _0x278a72=_0x559ff8['isActive']?'\x20(active)':'',_0x400447=_0x559ff8['hasEncryptedAuth']?'encrypted':_0x559ff8['hasPlaintextAuth']?_0x1632d2(0xaf):'none';console['log']('\x20\x20'+bold(_0x559ff8['name'])+_0x278a72),console['log'](_0x1632d2(0x72)+_0x400447),_0x559ff8[_0x1632d2(0x99)]!==_0x25358f['xosUJ']&&console['log'](_0x1632d2(0x69)+link(_0x559ff8['settingsPath'],basename(_0x559ff8[_0x1632d2(0x99)])));}!_0x255efd&&(console['log']('\x0a\x20\x20No\x20active\x20profile\x20set'),console[_0x1632d2(0x6c)]('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x23776d[_0x1632d2(0x8f)](_0x2c8d2f=>_0x2c8d2f['name'])[_0x1632d2(0xbe)](',\x20')+')'));}console[_0x1632d2(0x6c)]('');}function _0x5954(){const _0x232323=['YzMWn','310aYcSKm','plaintext','configured','hxvWI','enabled','YSocc','toString','plugin','\x20\x20Run:\x20ranger\x20setup\x20--opencode','124RmdOya','env','278030NxNDBR','fMDlz','ignore','16311VVHRFw','ranger@trailhead','join','gkFUA','rtOzZ','zYNMP','not_installed','\x20\x20\x20\x20','settings.json','wyZQn','\x0a📊\x20Ranger\x20Status\x0a','API\x20URL:\x20','\x20\x20Run:\x20ranger\x20setup\x20[token]','\x20\x20\x20\x20Settings:\x20','XjhnQ','\x1b]8;;file://','log','1395832wWdnBH','API\x20Environment:\x20','details','\x20plugin(s)\x20configured','version','\x20\x20\x20\x20Auth:\x20','Root:\x20','jecWM','status','Vthja','185984nFRVUR','TnTTW','\x20\x20Not\x20configured','error','\x20\x20Run:\x20ranger\x20update','\x0a---\x20Profiles\x20---','9UEvRUH','bZSkI','IRbvP','RhQbT','project','close','\x20\x20Not\x20installed',':\x20installed\x20(','shfVy','No\x20skills\x20installed','Organization:\x20','76804NCgJVd','match','filter','name','disabled','stderr','UeLXf','map','parse','\x20(latest:\x20','2370AodsPA','length','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','includes','LvLih','xhiEq','@ranger-testing/opencode-plugin','settingsPath','zQNHG','\x1b]8;;\x07','user','(not\x20found)','push','VuNlI','ulcke','path','opencode','\x20\x20Project-level:','scope','Version:\x20','PRpxw','not_configured','uQqNO','226421iGKgVW','RgZrj',':\x20configured','dLByv'];_0x5954=function(){return _0x232323;};return _0x5954();}
1
+ const _0x24ecd2=_0x3584;(function(_0x3a6228,_0x150c3b){const _0x640fa7=_0x3584,_0x42b38f=_0x3a6228();while(!![]){try{const _0x21114c=parseInt(_0x640fa7(0x129))/0x1*(-parseInt(_0x640fa7(0x102))/0x2)+parseInt(_0x640fa7(0x14c))/0x3+-parseInt(_0x640fa7(0x125))/0x4*(parseInt(_0x640fa7(0x140))/0x5)+parseInt(_0x640fa7(0x127))/0x6+parseInt(_0x640fa7(0x11a))/0x7+-parseInt(_0x640fa7(0x13b))/0x8+parseInt(_0x640fa7(0x105))/0x9;if(_0x21114c===_0x150c3b)break;else _0x42b38f['push'](_0x42b38f['shift']());}catch(_0x75485d){_0x42b38f['push'](_0x42b38f['shift']());}}}(_0x1539,0x7c973));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 _0x3584(_0xe6959b,_0x33d6ab){_0xe6959b=_0xe6959b-0xf8;const _0x1539d8=_0x1539();let _0x3584fa=_0x1539d8[_0xe6959b];return _0x3584fa;}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';function _0x1539(){const _0x420a84=['path','close','Root:\x20','\x20(latest:\x20','isActive','data','\x20\x20\x20\x20Auth:\x20','\x0a---\x20Skills\x20---','enabled','VdzbX','utf-8','parse','log','Version:\x20','GqqYW','nirlm','gqzNQ','map','ziRUz','5839533TCJNYj','@ranger-testing/opencode-plugin','all','auth.json.enc','\x1b[1m','plugin','settingsPath','KHHlF','MwVtd','some','not_configured','25712TsmuAj','YHzqR','2164812fmBTby','vUpfS','1249iYUrYx','match','error','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','wZGeW','plaintext','trim','\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','stderr','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','\x20\x20Not\x20installed','opencode-plugin','filter','SVHFa','XGgkd',':\x20configured','\x20(up\x20to\x20date)','name','4936056zFTZLQ','SIvhd','jZHOJ','env','UUQuE','575cFFcnI','isDirectory','string','\x1b]8;;file://','ignore','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','version','vSnBc','includes','MipoU','displayName','API\x20Environment:\x20','497796RMBCDV','uOzWo','user','details','dMCPC','status','MrNSd','hCOnW','\x20\x20Run:\x20ranger\x20setup\x20[token]','KGMnh','\x20plugin(s)\x20configured','cwd','config','BfXbw','\x20\x20Project-level:','\x20(active)','VzQhE','disabled','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','IUSfW','\x20\x20Not\x20configured','46jHggRW','\x20\x20\x20\x20','debug','4808916JjgPkD','length'];_0x1539=function(){return _0x420a84;};return _0x1539();}import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x5e25ff=>_0x24ecd2(0x11e)+_0x5e25ff+'\x1b[0m',link=(_0x1fdefe,_0x2858cb)=>_0x24ecd2(0x143)+_0x1fdefe+'\x07'+(_0x2858cb||_0x1fdefe)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x370b3c=_0x24ecd2,_0x316031={'vqGdQ':function(_0x3b9c35,_0x9e23b3){return _0x3b9c35(_0x9e23b3);},'RICOF':function(_0x329766,_0x473cba){return _0x329766!==_0x473cba;},'wZGeW':function(_0xab6c53,_0x3d2fd7){return _0xab6c53>_0x3d2fd7;},'YHzqR':_0x370b3c(0x124),'BfXbw':function(_0x3ec8fe,_0x5b7e92,_0x5dc44d,_0x350202){return _0x3ec8fe(_0x5b7e92,_0x5dc44d,_0x350202);},'aBTRw':_0x370b3c(0x104),'EBXQW':_0x370b3c(0xf9),'dMCPC':_0x370b3c(0x144),'chUzt':'pipe','iyJnP':_0x370b3c(0x12b),'eyTcx':_0x370b3c(0x108)};return new Promise(_0xb4f758=>{const _0x32e2b4=_0x370b3c,_0x3742db={'gqzNQ':function(_0x98dfd6,_0xc2be4f){return _0x316031['vqGdQ'](_0x98dfd6,_0xc2be4f);},'hmkho':'not_installed','QyTdr':function(_0x2c90ec,_0x47273c){return _0x316031['RICOF'](_0x2c90ec,_0x47273c);},'uEOAa':_0x32e2b4(0x142),'SjPFY':_0x32e2b4(0x134),'hCOnW':function(_0x2e8de0,_0x1e3b63){return _0x316031['RICOF'](_0x2e8de0,_0x1e3b63);},'Nnrzt':function(_0x2a95aa,_0xe793fd){return _0x2a95aa>_0xe793fd;},'TfvRK':function(_0x122e03,_0x43c638){const _0x1f4666=_0x32e2b4;return _0x316031[_0x1f4666(0x12d)](_0x122e03,_0x43c638);},'SVHFa':_0x316031[_0x32e2b4(0x126)]},_0x1fb7c6=_0x316031[_0x32e2b4(0xfa)](spawn,'opencode',[_0x316031['aBTRw'],_0x316031['EBXQW']],{'stdio':[_0x316031[_0x32e2b4(0x150)],_0x316031['chUzt'],_0x316031['chUzt']]});let _0x1e43c0='';_0x1fb7c6['stdout']?.['on'](_0x32e2b4(0x10c),_0x4554f6=>{_0x1e43c0+=_0x4554f6['toString']();}),_0x1fb7c6[_0x32e2b4(0x131)]?.['on'](_0x32e2b4(0x10c),_0x1f507c=>{_0x1e43c0+=_0x1f507c['toString']();}),_0x1fb7c6['on'](_0x316031['iyJnP'],()=>{_0x3742db['gqzNQ'](_0xb4f758,{'status':_0x3742db['hmkho']});}),_0x1fb7c6['on'](_0x316031['eyTcx'],_0x5ee7b9=>{const _0x50a87c=_0x32e2b4,_0x1018b6={'vSnBc':function(_0x1c0463,_0x556f53){return _0x3742db['QyTdr'](_0x1c0463,_0x556f53);},'Okxnf':_0x3742db['uEOAa'],'RCEZd':_0x50a87c(0x11b),'uuEHP':_0x3742db['SjPFY']};if(_0x3742db[_0x50a87c(0x153)](_0x5ee7b9,0x0)){_0xb4f758({'status':'not_installed'});return;}const _0x4679ff=_0x1e43c0[_0x50a87c(0x12f)]();let _0x283cd6=null;if(_0x4679ff)try{_0x283cd6=JSON[_0x50a87c(0x112)](_0x4679ff);}catch{const _0x4adb89=_0x4679ff[_0x50a87c(0x12a)](/\{[\s\S]*\}$/);if(_0x4adb89)try{_0x283cd6=JSON['parse'](_0x4adb89[0x0]);}catch{_0x283cd6=null;}}const _0xf49a1f=Array['isArray'](_0x283cd6?.[_0x50a87c(0x11f)])?_0x283cd6?.[_0x50a87c(0x11f)]:[],_0x4055f7=_0xf49a1f[_0x50a87c(0x123)](_0x269e67=>{const _0x5c8f8a=_0x50a87c;if(_0x1018b6[_0x5c8f8a(0x147)](typeof _0x269e67,_0x1018b6['Okxnf']))return![];return _0x269e67[_0x5c8f8a(0x148)](_0x1018b6['RCEZd'])||_0x269e67[_0x5c8f8a(0x148)](_0x1018b6['uuEHP']);});if(_0x4055f7){_0xb4f758({'status':'configured','details':_0x3742db['Nnrzt'](_0xf49a1f[_0x50a87c(0x106)],0x0)?_0xf49a1f['length']+'\x20plugin(s)\x20configured':undefined});return;}if(_0x3742db['TfvRK'](_0xf49a1f['length'],0x0)){_0x3742db[_0x50a87c(0x117)](_0xb4f758,{'status':_0x50a87c(0x124),'details':_0xf49a1f[_0x50a87c(0x106)]+_0x50a87c(0x156)});return;}_0x3742db['gqzNQ'](_0xb4f758,{'status':_0x3742db[_0x50a87c(0x136)]});});});}async function getSkillsFromDir(_0x2f5719,_0x63d98b){const _0xb1fe84=_0x24ecd2,_0x59e8ee={'XGgkd':function(_0x32312f,_0x400eb9,_0x32be61){return _0x32312f(_0x400eb9,_0x32be61);},'IugFu':'SKILL.md','KHHlF':function(_0xfe282,_0x35aea9){return _0xfe282(_0x35aea9);},'pEJEE':_0xb1fe84(0x111)};if(!existsSync(_0x2f5719))return[];const _0x548361=[];try{const _0x1e330c=await _0x59e8ee[_0xb1fe84(0x137)](readdir,_0x2f5719,{'withFileTypes':!![]});for(const _0x45a58e of _0x1e330c){if(_0x45a58e[_0xb1fe84(0x141)]()){const _0x48f212=join(_0x2f5719,_0x45a58e['name'],_0x59e8ee['IugFu']);if(_0x59e8ee[_0xb1fe84(0x121)](existsSync,_0x48f212)){let _0x2eaddf=_0x45a58e['name'];try{const _0x366421=await readFile(_0x48f212,_0x59e8ee['pEJEE']),_0x15770c=_0x366421[_0xb1fe84(0x12a)](/name:\s*(.+)/);_0x15770c&&(_0x2eaddf=_0x15770c[0x1]['trim']());}catch{}_0x548361['push']({'name':_0x45a58e[_0xb1fe84(0x13a)],'displayName':_0x2eaddf,'path':_0x48f212,'level':_0x63d98b});}}}}catch{return[];}return _0x548361;}async function getInstalledSkills(){const _0x335950=_0x24ecd2,_0x48b5b2={'jKUzg':function(_0x50082e,_0x239e10,_0x23a128){return _0x50082e(_0x239e10,_0x23a128);},'ydSHM':'project'},[_0x59065a,_0xb3828d]=await Promise[_0x335950(0x11c)]([_0x48b5b2['jKUzg'](getSkillsFromDir,getProjectSkillsDir(),_0x48b5b2['ydSHM']),getSkillsFromDir(getUserSkillsDir(),'user')]);return{'project':_0x59065a,'user':_0xb3828d};}async function getEnvironments(){const _0x361de0=_0x24ecd2,_0xc39659={'VzQhE':function(_0x4759cf,_0x53ea34){return _0x4759cf(_0x53ea34);},'Wzrbl':'auth.json','nMTJU':_0x361de0(0x11d),'KGMnh':function(_0xd11fd4,_0x52eaee){return _0xd11fd4(_0x52eaee);},'NZjid':'(not\x20found)','LZHxT':function(_0x5f1063,_0x2e5bb0){return _0x5f1063===_0x2e5bb0;},'GTDjT':function(_0x375bbd,_0x5a7ce2){return _0x375bbd(_0x5a7ce2);}},{envNames:_0x35b475,activeEnv:_0x5553ce}=await getEnvNames(),_0x58b985=getRangerDir();if(!_0xc39659['GTDjT'](existsSync,_0x58b985))return{'envs':[],'activeEnv':null};const _0x2b50c6=_0x35b475[_0x361de0(0x118)](_0x11fd22=>{const _0x369291=_0x361de0,_0x437af9=_0xc39659['VzQhE'](getEnvDir,_0x11fd22),_0x52e070=join(_0x437af9,'settings.json'),_0x4d22d2=join(_0x437af9,_0xc39659['Wzrbl']),_0xfcc793=join(_0x437af9,_0xc39659['nMTJU']);return{'name':_0x11fd22,'settingsPath':_0xc39659[_0x369291(0x155)](existsSync,_0x52e070)?_0x52e070:_0xc39659['NZjid'],'hasPlaintextAuth':_0xc39659[_0x369291(0xfd)](existsSync,_0x4d22d2),'hasEncryptedAuth':existsSync(_0xfcc793),'isActive':_0xc39659['LZHxT'](_0x11fd22,_0x5553ce)};});return{'envs':_0x2b50c6,'activeEnv':_0x5553ce};}export async function status(){const _0x4aaadd=_0x24ecd2,_0x25daba={'yuORv':'\x0a📊\x20Ranger\x20Status\x0a','jZHOJ':function(_0x3f4365){return _0x3f4365();},'uOzWo':function(_0x42ff66,_0x292882){return _0x42ff66(_0x292882);},'MrNSd':function(_0x5899ad){return _0x5899ad();},'SIvhd':function(_0x5d1ef1){return _0x5d1ef1();},'fhmLR':function(_0x254c62){return _0x254c62();},'MwVtd':function(_0x3043d0){return _0x3043d0();},'BodJP':function(_0x1959c7){return _0x1959c7();},'UUQuE':function(_0x57b34e,_0x26f8f7){return _0x57b34e===_0x26f8f7;},'MipoU':'configured','tbhRJ':function(_0x1d50e7,_0x41eaf3){return _0x1d50e7(_0x41eaf3);},'yDzVw':function(_0x2be875,_0xd97a65){return _0x2be875===_0xd97a65;},'GyqGq':_0x4aaadd(0x124),'IUSfW':_0x4aaadd(0x101),'VESjY':'\x0a---\x20Claude\x20Code\x20Plugin\x20---','GqqYW':'ranger@trailhead','QBhNF':'unknown','ZJTxG':_0x4aaadd(0x10f),'ziRUz':_0x4aaadd(0xfe),'lkrpp':_0x4aaadd(0xff),'GtIsG':function(_0xbd5a77,_0x3cf8a0){return _0xbd5a77+_0x3cf8a0;},'vUpfS':function(_0x59f4ec,_0x2e1452){return _0x59f4ec>_0x2e1452;},'VDyLv':function(_0x9c769e,_0x12ee27){return _0x9c769e(_0x12ee27);},'nirlm':function(_0x2e79cd,_0x552fe8,_0x24538f){return _0x2e79cd(_0x552fe8,_0x24538f);},'GMzKX':function(_0x561333,_0x2dc1dc){return _0x561333(_0x2dc1dc);},'Zpnrp':'\x20\x20User-level:','ySWUl':'\x0a---\x20Profiles\x20---','VdzbX':'none','ASMri':function(_0x56eae8,_0x916123){return _0x56eae8(_0x916123);}};console['log'](_0x25daba['yuORv']);const _0x1aaf02=process[_0x4aaadd(0xf8)](),_0x1b7715=_0x25daba[_0x4aaadd(0x13d)](getRangerDir);if(!_0x25daba['uOzWo'](existsSync,_0x1b7715)){console['log']('Root:\x20'+link(_0x1aaf02,bold(basename(_0x1aaf02)))),console['log'](_0x4aaadd(0x132)),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console['log'](_0x4aaadd(0x109)+link(_0x1aaf02,_0x25daba[_0x4aaadd(0x14d)](bold,_0x25daba[_0x4aaadd(0x14d)](basename,_0x1aaf02))));const _0x44efbc=_0x25daba[_0x4aaadd(0x152)](getCurrentVersion),_0x4ea3f5=getLatestVersion();if(_0x4ea3f5[_0x4aaadd(0x146)]&&_0x4ea3f5['version']!==_0x44efbc)console[_0x4aaadd(0x113)](_0x4aaadd(0x114)+_0x44efbc+_0x4aaadd(0x10a)+_0x4ea3f5[_0x4aaadd(0x146)]+')'),console['log']('\x20\x20Run:\x20ranger\x20update');else _0x4ea3f5['version']?console[_0x4aaadd(0x113)]('Version:\x20'+_0x44efbc+_0x4aaadd(0x139)):console['log']('Version:\x20'+_0x44efbc);const _0x1f0e2b=await _0x25daba[_0x4aaadd(0x13c)](getToken);if(_0x1f0e2b){const _0x50f440=await _0x25daba['uOzWo'](getCurrentUser,_0x1f0e2b);_0x50f440['success']?console[_0x4aaadd(0x113)]('Organization:\x20'+bold(_0x50f440[_0x4aaadd(0x14e)]['organizationName'])):(console['log'](_0x4aaadd(0x12c)),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console[_0x4aaadd(0x113)]('API\x20Token:\x20✗\x20Not\x20found'),console[_0x4aaadd(0x113)](_0x4aaadd(0x154));process[_0x4aaadd(0x13e)]['DEBUG']&&(console['log'](_0x4aaadd(0x14b)+_0x25daba['fhmLR'](getCurrentEnvironment)),console['log']('API\x20URL:\x20'+_0x25daba[_0x4aaadd(0x122)](getApiBaseUrl)));console['log']('\x0a---\x20OpenCode\x20Plugin\x20---');const _0x29821e=await _0x25daba['BodJP'](getOpencodePluginStatus);if(_0x25daba[_0x4aaadd(0x13f)](_0x29821e[_0x4aaadd(0x151)],_0x25daba[_0x4aaadd(0x149)]))console[_0x4aaadd(0x113)]('\x20\x20'+_0x25daba['tbhRJ'](bold,_0x4aaadd(0x11b))+_0x4aaadd(0x138)),_0x29821e[_0x4aaadd(0x14f)]&&console[_0x4aaadd(0x113)]('\x20\x20'+_0x29821e['details']);else _0x25daba['yDzVw'](_0x29821e[_0x4aaadd(0x151)],_0x25daba['GyqGq'])?(console['log'](_0x25daba[_0x4aaadd(0x100)]),_0x29821e[_0x4aaadd(0x14f)]&&console[_0x4aaadd(0x113)]('\x20\x20'+_0x29821e['details']),console[_0x4aaadd(0x113)]('\x20\x20Run:\x20ranger\x20setup\x20--opencode')):console[_0x4aaadd(0x113)](_0x4aaadd(0x130));console[_0x4aaadd(0x113)](_0x25daba['VESjY']);const _0x3ca0a9=await getPluginInfo(_0x25daba[_0x4aaadd(0x115)]);if(_0x3ca0a9){const _0x34fa48=_0x3ca0a9['scope']||_0x25daba['QBhNF'],_0x4e4282=_0x3ca0a9[_0x4aaadd(0x10f)]?_0x25daba['ZJTxG']:_0x25daba[_0x4aaadd(0x119)];console['log']('\x20\x20'+_0x25daba[_0x4aaadd(0x14d)](bold,'ranger@trailhead')+':\x20installed\x20('+_0x34fa48+',\x20'+_0x4e4282+')');}else console[_0x4aaadd(0x113)](_0x4aaadd(0x133)),console[_0x4aaadd(0x113)](_0x25daba['lkrpp']);console[_0x4aaadd(0x113)](_0x4aaadd(0x10e));const {project:_0xf3a8f1,user:_0x1f9f7f}=await _0x25daba['BodJP'](getInstalledSkills),_0x576ea6=_0xf3a8f1[_0x4aaadd(0x135)](_0x65336b=>RANGER_MANAGED_SKILLS['includes'](_0x65336b[_0x4aaadd(0x13a)])),_0x9565a5=_0x1f9f7f[_0x4aaadd(0x135)](_0x5ac269=>RANGER_MANAGED_SKILLS[_0x4aaadd(0x148)](_0x5ac269['name'])),_0x5d8158=_0x25daba['GtIsG'](_0x576ea6['length'],_0x9565a5['length']);if(_0x5d8158===0x0)console['log']('No\x20skills\x20installed'),console[_0x4aaadd(0x113)]('\x20\x20Run:\x20ranger\x20skillup');else{if(_0x25daba[_0x4aaadd(0x128)](_0x576ea6['length'],0x0)){console['log'](_0x4aaadd(0xfb));for(const _0x2ed444 of _0x576ea6){console['log']('\x20\x20\x20\x20'+_0x25daba['VDyLv'](bold,_0x2ed444['displayName'])+':\x20'+_0x25daba['nirlm'](link,_0x2ed444['path'],_0x25daba['GMzKX'](basename,_0x2ed444[_0x4aaadd(0x107)])));}}if(_0x25daba['vUpfS'](_0x9565a5['length'],0x0)){console['log'](_0x25daba['Zpnrp']);for(const _0xd6f812 of _0x9565a5){console[_0x4aaadd(0x113)](_0x4aaadd(0x103)+bold(_0xd6f812[_0x4aaadd(0x14a)])+':\x20'+_0x25daba[_0x4aaadd(0x116)](link,_0xd6f812['path'],basename(_0xd6f812['path'])));}}}console[_0x4aaadd(0x113)](_0x25daba['ySWUl']);const {envs:_0x3f6350,activeEnv:_0x47ebe6}=await getEnvironments();if(_0x25daba[_0x4aaadd(0x13f)](_0x3f6350['length'],0x0))console['log']('No\x20profiles\x20configured'),console[_0x4aaadd(0x113)]('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{for(const _0x3e1e3e of _0x3f6350){const _0x329c23=_0x3e1e3e[_0x4aaadd(0x10b)]?_0x4aaadd(0xfc):'',_0x17688b=_0x3e1e3e['hasEncryptedAuth']?'encrypted':_0x3e1e3e['hasPlaintextAuth']?_0x4aaadd(0x12e):_0x25daba[_0x4aaadd(0x110)];console['log']('\x20\x20'+_0x25daba['ASMri'](bold,_0x3e1e3e[_0x4aaadd(0x13a)])+_0x329c23),console[_0x4aaadd(0x113)](_0x4aaadd(0x10d)+_0x17688b),_0x3e1e3e['settingsPath']!=='(not\x20found)'&&console['log']('\x20\x20\x20\x20Settings:\x20'+link(_0x3e1e3e['settingsPath'],_0x25daba['uOzWo'](basename,_0x3e1e3e[_0x4aaadd(0x120)])));}!_0x47ebe6&&(console[_0x4aaadd(0x113)]('\x0a\x20\x20No\x20active\x20profile\x20set'),console['log'](_0x4aaadd(0x145)+_0x3f6350['map'](_0x1518ba=>_0x1518ba[_0x4aaadd(0x13a)])['join'](',\x20')+')'));}console[_0x4aaadd(0x113)]('');}