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

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/build/cli.js +1 -1
  2. package/build/commands/addEnv.js +1 -1
  3. package/build/commands/authEncrypt.js +1 -1
  4. package/build/commands/clean.js +1 -1
  5. package/build/commands/config.js +1 -1
  6. package/build/commands/deleteProfile.js +1 -0
  7. package/build/commands/env.js +1 -1
  8. package/build/commands/feature.js +1 -1
  9. package/build/commands/hook.js +1 -1
  10. package/build/commands/hooks/autoPrompt.js +1 -1
  11. package/build/commands/hooks/disable.js +1 -1
  12. package/build/commands/hooks/enable.js +1 -1
  13. package/build/commands/hooks/exitPlanMode.js +1 -1
  14. package/build/commands/hooks/index.js +1 -1
  15. package/build/commands/hooks/output.js +1 -1
  16. package/build/commands/hooks/planReminder.js +1 -1
  17. package/build/commands/hooks/planStart.js +1 -1
  18. package/build/commands/hooks/postEdit.js +1 -1
  19. package/build/commands/hooks/preCompact.js +1 -1
  20. package/build/commands/hooks/sessionEnd.js +1 -1
  21. package/build/commands/hooks/sessionStart.js +1 -1
  22. package/build/commands/hooks/stopHook.js +1 -1
  23. package/build/commands/index.js +1 -1
  24. package/build/commands/login.js +1 -1
  25. package/build/commands/mcpBootstrap.js +1 -1
  26. package/build/commands/migrateProfile.js +1 -1
  27. package/build/commands/setup/claude.js +1 -1
  28. package/build/commands/setup/opencode.js +1 -1
  29. package/build/commands/setupCi.js +1 -1
  30. package/build/commands/skillup.js +1 -1
  31. package/build/commands/start.js +1 -1
  32. package/build/commands/status.js +1 -1
  33. package/build/commands/update.js +1 -1
  34. package/build/commands/updateEnv.js +1 -1
  35. package/build/commands/useEnv.js +1 -1
  36. package/build/commands/utils/activeProfile.js +1 -1
  37. package/build/commands/utils/agentEnv.js +1 -1
  38. package/build/commands/utils/browserSessionsApi.js +1 -1
  39. package/build/commands/utils/claudeConfig.js +1 -1
  40. package/build/commands/utils/claudeOverrideSettings.js +1 -1
  41. package/build/commands/utils/claudePlugin.js +1 -1
  42. package/build/commands/utils/cloudProfile.js +1 -1
  43. package/build/commands/utils/cloudProfileSession.js +1 -1
  44. package/build/commands/utils/crypto.js +1 -1
  45. package/build/commands/utils/desirePathLog.js +1 -1
  46. package/build/commands/utils/deviceAuth.js +1 -1
  47. package/build/commands/utils/environment.js +1 -1
  48. package/build/commands/utils/featureApi.js +1 -1
  49. package/build/commands/utils/fixWebmDuration.js +1 -1
  50. package/build/commands/utils/gitTracked.js +1 -1
  51. package/build/commands/utils/keychain.js +1 -1
  52. package/build/commands/utils/legacyWarning.js +1 -1
  53. package/build/commands/utils/localAgentInstallationsApi.js +1 -1
  54. package/build/commands/utils/matchAuthEnvironment.js +1 -1
  55. package/build/commands/utils/mcpImageBase64.js +1 -1
  56. package/build/commands/utils/model.js +1 -1
  57. package/build/commands/utils/novaActCli.js +1 -0
  58. package/build/commands/utils/opencodeConfig.js +1 -1
  59. package/build/commands/utils/playwrightCli.js +1 -1
  60. package/build/commands/utils/profileMessages.js +1 -1
  61. package/build/commands/utils/profileSetupBanner.js +1 -1
  62. package/build/commands/utils/projectsConfig.js +1 -1
  63. package/build/commands/utils/rangerConfig.js +1 -1
  64. package/build/commands/utils/rangerRoot.js +1 -1
  65. package/build/commands/utils/resolveProfileContext.js +1 -1
  66. package/build/commands/utils/resolveProfileUrl.js +1 -1
  67. package/build/commands/utils/retry.js +1 -1
  68. package/build/commands/utils/sessionCache.js +1 -1
  69. package/build/commands/utils/settings.js +1 -1
  70. package/build/commands/utils/skillContent.js +1 -1
  71. package/build/commands/utils/skills.js +1 -1
  72. package/build/commands/utils/stitchWebmFiles.js +1 -1
  73. package/build/commands/utils/telemetry.js +1 -1
  74. package/build/commands/utils/tokenRefresh.js +1 -1
  75. package/build/commands/utils/traceSnapshotMapper.js +1 -1
  76. package/build/commands/utils/userApi.js +1 -1
  77. package/build/commands/utils/version.js +1 -1
  78. package/build/commands/verifyFeature.js +1 -1
  79. package/build/commands/verifyFeatureCli.js +1 -1
  80. package/build/commands/verifyFeatureNovaCli.js +1 -0
  81. package/build/skills/ranger/SKILL.md +1 -1
  82. package/package.json +1 -1
@@ -1 +1 @@
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
+ (function(_0x97e857,_0x1e0a26){const _0x553e6c=_0x16f9,_0x18393a=_0x97e857();while(!![]){try{const _0x371baa=parseInt(_0x553e6c(0x143))/0x1+parseInt(_0x553e6c(0x138))/0x2*(parseInt(_0x553e6c(0x136))/0x3)+-parseInt(_0x553e6c(0x145))/0x4+parseInt(_0x553e6c(0x141))/0x5*(parseInt(_0x553e6c(0x147))/0x6)+-parseInt(_0x553e6c(0x142))/0x7*(-parseInt(_0x553e6c(0x13d))/0x8)+-parseInt(_0x553e6c(0x146))/0x9+-parseInt(_0x553e6c(0x148))/0xa;if(_0x371baa===_0x1e0a26)break;else _0x18393a['push'](_0x18393a['shift']());}catch(_0x2688d7){_0x18393a['push'](_0x18393a['shift']());}}}(_0x251b,0x70703));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';import{isInteractive}from'./utils/cloudProfileSession.js';export async function login(){const _0xc73b99=_0x16f9,_0x21e1f4={'yxGTo':function(_0x3fa7df){return _0x3fa7df();},'qnBGf':_0xc73b99(0x137),'RBQyr':function(_0x294f88){return _0x294f88();},'qQQrA':function(_0x5dd825,_0x30c448){return _0x5dd825(_0x30c448);}},_0x495c78=await _0x21e1f4[_0xc73b99(0x13a)](getMcpAuthOrigin);if(_0x495c78){console[_0xc73b99(0x139)](_0x21e1f4[_0xc73b99(0x13e)]),await mcpBootstrap();return;}if(!_0x21e1f4[_0xc73b99(0x135)](isInteractive))throw new Error(_0xc73b99(0x13f));try{const _0x4a3f80=await runDeviceAuthFlow(),_0x31d7bd=await _0x21e1f4['qQQrA'](getCurrentUser,_0x4a3f80);_0x31d7bd[_0xc73b99(0x140)]?console['log']('\x0a✅\x20Logged\x20in\x20to\x20'+_0x31d7bd[_0xc73b99(0x144)][_0xc73b99(0x149)]):console[_0xc73b99(0x139)](_0xc73b99(0x13c));}catch(_0x2aad47){throw new Error(_0xc73b99(0x13b)+(_0x2aad47 instanceof Error?_0x2aad47['message']:_0x2aad47));}}function _0x16f9(_0x2dcb27,_0x4c424c){_0x2dcb27=_0x2dcb27-0x135;const _0x251b5e=_0x251b();let _0x16f91a=_0x251b5e[_0x2dcb27];return _0x16f91a;}function _0x251b(){const _0x133a5d=['499729vDxOfD','user','442088fqLwfm','5905944TAKMtK','108156ukbeeu','7182290PEZmqn','organizationName','RBQyr','57NXtTSI','Re-authenticating\x20via\x20MCP\x20bootstrap...','60886fOSBge','log','yxGTo','Login\x20failed:\x20','\x0a✅\x20API\x20key\x20stored\x20successfully','3333744qaRBML','qnBGf','Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','success','125sTeYlC','7kmyJCl'];_0x251b=function(){return _0x133a5d;};return _0x251b();}
@@ -1 +1 @@
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
+ const _0x51ab1e=_0x169f;function _0x169f(_0x250ef7,_0x4a1191){_0x250ef7=_0x250ef7-0x144;const _0x335a58=_0x335a();let _0x169f29=_0x335a58[_0x250ef7];return _0x169f29;}function _0x335a(){const _0x3fc26b=['NsBKc','refreshToken','yGlKo','bPeQU','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','77ggiWNh','jmlKx','authorization_servers','\x0aOpening\x20browser\x20for\x20authentication...','hex','toString','aZsKw','text/html','origin','get','slice','http://localhost:','2.0','RSiaH','authorization_code','dnbfw','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','clientId','qZxzN','qpMai','write','1095984WcGfVp','mcp-oauth-tokens.json','message','replace','auth-origin.txt','nsxld','response_type','ppnqC','/.well-known/oauth-authorization-server','Authorization','TMqrr','get_cli_token\x20failed:\x20','BDXPs','lbSXG','LqSaW','utf-8','\x0aUnexpected\x20response\x20structure:','isError','writeHead','Token\x20exchange\x20failed:\x20','accessToken','1924480pOZtSw','registration_endpoint','error','application/json','text','text/event-stream','PGhaQ','code','headers','error_description','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','parse','data:','Ranger\x20CLI','Discovering\x20authorization\x20server...','vExwN','OAuthTimeoutError','bVtgj','searchParams','/.well-known/oauth-protected-resource','token','close','CWQpb','stringify','AObse','1412832AfnUUf','trim','191892ayzuRR','Requesting\x20CLI\x20token...','code_challenge','SpAcX','expiresAt','stdout','DDHoK','refresh_token','.ranger','Initializing\x20MCP\x20session...','315208yuCfNH','ShgRM','get_cli_token','1.0.0','win32','redirect_uri','ifrSJ','tools/call','client_id','log','9794088YczFJx','JiqiZ','state','hSJGv','fYPcq','maBqd','<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','2025-03-26','zwtdY','CTtOM','VMiAS','xtkbM','ZsQxW','initialize','resource','dSaqS','isTTY','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','json','set','2XZLPmo','127.0.0.1','POST','JCLmM','split','structuredContent','XammJ','KHvPo','3613630DaCrmo','/callback','lSylx','QgPLD','LLuhh','end','proxied','status','now'];_0x335a=function(){return _0x3fc26b;};return _0x335a();}(function(_0x3ee9db,_0x264bb1){const _0x592560=_0x169f,_0x65c5de=_0x3ee9db();while(!![]){try{const _0x2fce73=-parseInt(_0x592560(0x161))/0x1*(-parseInt(_0x592560(0x189))/0x2)+parseInt(_0x592560(0x1b4))/0x3+-parseInt(_0x592560(0x146))/0x4+parseInt(_0x592560(0x191))/0x5+parseInt(_0x592560(0x15f))/0x6+parseInt(_0x592560(0x19f))/0x7*(parseInt(_0x592560(0x16b))/0x8)+-parseInt(_0x592560(0x175))/0x9;if(_0x2fce73===_0x264bb1)break;else _0x65c5de['push'](_0x65c5de['shift']());}catch(_0x51df8a){_0x65c5de['push'](_0x65c5de['shift']());}}}(_0x335a,0x5ca55));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),_0x51ab1e(0x169),_0x51ab1e(0x1b5)),AUTH_ORIGIN_PATH=join(homedir(),_0x51ab1e(0x169),_0x51ab1e(0x1b8));export async function getMcpAuthOrigin(){const _0x1e2255=_0x51ab1e,_0x37c6f3={'ShgRM':function(_0x33ac12,_0x405f91,_0x1b546e){return _0x33ac12(_0x405f91,_0x1b546e);},'JCLmM':_0x1e2255(0x1c3)};try{const _0x5cfcfd=(await _0x37c6f3[_0x1e2255(0x16c)](readFile,AUTH_ORIGIN_PATH,_0x37c6f3[_0x1e2255(0x18c)]))['trim']();return _0x5cfcfd||null;}catch{return null;}}export async function mcpBootstrap(){const _0x4788c7=_0x51ab1e,_0x593839={'PGhaQ':function(_0x1dcecf,_0x145ea8){return _0x1dcecf(_0x145ea8);},'ppnqC':function(_0x21cd2f,_0x24344e){return _0x21cd2f===_0x24344e;},'fRlum':_0x4788c7(0x197),'gcxoJ':function(_0x278c51){return _0x278c51();},'jmlKx':function(_0x1a27ed,_0x5d31e7){return _0x1a27ed+_0x5d31e7;},'vExwN':'MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a'},_0x3c5133=getMcpAuthUrl();currentOrigin=_0x3c5133;const _0x4d2d62=process[_0x4788c7(0x166)][_0x4788c7(0x185)]??![];console['log']('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x3c5133+'\x0a');const _0x26dbb1=await _0x593839[_0x4788c7(0x14c)](tryUnauthenticated,_0x3c5133);let _0x407993=null;if(_0x593839[_0x4788c7(0x1bb)](_0x26dbb1,_0x593839['fRlum']))_0x407993='';else{_0x407993=await _0x593839['gcxoJ'](loadCachedToken);if(!_0x407993){if(!_0x4d2d62)throw new Error(_0x593839[_0x4788c7(0x1a0)](_0x593839[_0x4788c7(0x155)],'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.'));_0x407993=await oauthFlow(_0x3c5133);}}await callGetCliToken(_0x3c5133,_0x407993);}async function tryUnauthenticated(_0x56be17){const _0x4d66cc=_0x51ab1e,_0x36b439={'QgPLD':function(_0x5377ef,_0x473618,_0x249d21){return _0x5377ef(_0x473618,_0x249d21);},'XXZZo':_0x4d66cc(0x18b),'USAJF':'application/json','lSylx':'application/json,\x20text/event-stream','IxkQM':_0x4d66cc(0x1ab),'bVtgj':_0x4d66cc(0x182),'zwtdY':_0x4d66cc(0x16e),'fWijl':_0x4d66cc(0x197)},_0x447449=await _0x36b439[_0x4d66cc(0x194)](fetch,_0x56be17,{'method':_0x36b439['XXZZo'],'headers':{'Content-Type':_0x36b439['USAJF'],'Accept':_0x36b439[_0x4d66cc(0x193)]},'body':JSON[_0x4d66cc(0x15d)]({'jsonrpc':_0x36b439['IxkQM'],'id':0x1,'method':_0x36b439[_0x4d66cc(0x157)],'params':{'protocolVersion':_0x4d66cc(0x17c),'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x36b439[_0x4d66cc(0x17d)]}}})});if(_0x447449['ok'])return await _0x447449['text'](),_0x36b439['fWijl'];if(_0x447449[_0x4d66cc(0x198)]===0x191)return await _0x447449['text'](),'needs-oauth';const _0x584779=await _0x447449[_0x4d66cc(0x14a)]();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x447449['status']+':\x20'+_0x584779);}class OAuthTimeoutError extends Error{constructor(_0x8f9389){const _0xd0e039=_0x51ab1e,_0x59a5d9={'RLjlb':_0xd0e039(0x156)};super(_0x8f9389),this['name']=_0x59a5d9['RLjlb'];}}async function oauthFlow(_0x30d093){const _0x2c1246=_0x51ab1e,_0x43ddb9={'oShFH':function(_0x3a9233){return _0x3a9233();},'CTtOM':function(_0x4b9c8e,_0x54d254){return _0x4b9c8e(_0x54d254);}};try{return await oauthFlowAttempt(_0x30d093);}catch(_0x3e0667){if(_0x3e0667 instanceof OAuthTimeoutError&&await loadCachedClient())return console[_0x2c1246(0x174)]('\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'),await _0x43ddb9['oShFH'](clearCachedClient),await _0x43ddb9[_0x2c1246(0x17e)](oauthFlowAttempt,_0x30d093);throw _0x3e0667;}}async function oauthFlowAttempt(_0x3cf36d){const _0x239200=_0x51ab1e,_0x4a53ce={'GfwPw':_0x239200(0x154),'vysHU':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','UPnwX':'No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','mxqsq':function(_0x52c186,_0xa1953b){return _0x52c186(_0xa1953b);},'qUisR':_0x239200(0x153),'qZxzN':_0x239200(0x1ad),'VMiAS':'refresh_token','TZrpC':'\x20done','qpMai':_0x239200(0x186),'JiqiZ':function(_0x2d5558,_0x554d49){return _0x2d5558(_0x554d49);},'nsxld':'base64url','gaHhz':function(_0x411c8b,_0x447cf0){return _0x411c8b(_0x447cf0);},'AObse':'sha256','lbSXG':_0x239200(0x1a3),'KIfkt':_0x239200(0x1ba),'eIwlE':_0x239200(0x170),'RuLAN':_0x239200(0x163),'xtkbM':'code_challenge_method','rmGXN':'resource','REEqV':_0x239200(0x1a2),'Pslbr':function(_0x5838a1,_0x57d066){return _0x5838a1(_0x57d066);},'CgiSZ':'Exchanging\x20authorization\x20code...','VrHOh':'client_secret','yLwUN':function(_0x1b2bbe,_0x516f11,_0x416092){return _0x1b2bbe(_0x516f11,_0x416092);},'KHvPo':'application/x-www-form-urlencoded'},_0x5b7b5a=_0x3cf36d[_0x239200(0x1b7)](/\/mcp$/,'');process[_0x239200(0x166)]['write'](_0x4a53ce['GfwPw']);const _0x2a4e31=await fetch(_0x5b7b5a+_0x239200(0x159));if(!_0x2a4e31['ok'])throw new Error(_0x4a53ce['vysHU']);const _0x33aff0=await _0x2a4e31['json'](),_0x3bd0fe=_0x33aff0[_0x239200(0x1a1)]?.[0x0];if(!_0x3bd0fe)throw new Error(_0x4a53ce['UPnwX']);console[_0x239200(0x174)]('\x20'+_0x3bd0fe);const _0x4c819c=await _0x4a53ce['mxqsq'](fetchAuthServerMetadata,_0x3bd0fe);let _0x5eea4f,_0x5808e4;const _0x18d40d=await loadCachedClient();if(_0x18d40d)_0x5eea4f=_0x18d40d['clientId'],_0x5808e4=_0x18d40d['clientSecret'];else{if(_0x4c819c['registration_endpoint']){process['stdout'][_0x239200(0x1b3)]('Registering\x20OAuth\x20client...');const _0x572de2=await fetch(_0x4c819c[_0x239200(0x147)],{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify']({'client_name':_0x4a53ce['qUisR'],'redirect_uris':[_0x239200(0x1aa)+CALLBACK_PORT+'/callback'],'grant_types':[_0x4a53ce[_0x239200(0x1b1)],_0x4a53ce[_0x239200(0x17f)]],'response_types':['code'],'token_endpoint_auth_method':'none'})});if(!_0x572de2['ok']){const _0x27a376=await _0x572de2[_0x239200(0x14a)]();throw new Error('Client\x20registration\x20failed:\x20'+_0x27a376);}const _0x2de5dc=await _0x572de2[_0x239200(0x187)]();_0x5eea4f=_0x2de5dc[_0x239200(0x173)],_0x5808e4=_0x2de5dc['client_secret'],await saveCachedClient(_0x5eea4f,_0x5808e4),console[_0x239200(0x174)](_0x4a53ce['TZrpC']);}else throw new Error(_0x4a53ce[_0x239200(0x1b2)]);}const _0x26d080=_0x4a53ce[_0x239200(0x176)](randomBytes,0x20)['toString'](_0x4a53ce[_0x239200(0x1b9)]),_0x294d30=_0x4a53ce['gaHhz'](createHash,_0x4a53ce[_0x239200(0x15e)])['update'](_0x26d080)['digest'](_0x4a53ce[_0x239200(0x1b9)]),_0x48eaa1=_0x4a53ce['gaHhz'](randomBytes,0x10)[_0x239200(0x1a4)](_0x4a53ce[_0x239200(0x1c1)]),_0x55a200=new URL(_0x4c819c['authorization_endpoint']);_0x55a200['searchParams']['set'](_0x4a53ce['KIfkt'],_0x239200(0x14d)),_0x55a200['searchParams'][_0x239200(0x188)](_0x239200(0x173),_0x5eea4f),_0x55a200['searchParams'][_0x239200(0x188)](_0x4a53ce['eIwlE'],_0x239200(0x1aa)+CALLBACK_PORT+'/callback'),_0x55a200[_0x239200(0x158)][_0x239200(0x188)](_0x4a53ce['RuLAN'],_0x294d30),_0x55a200[_0x239200(0x158)][_0x239200(0x188)](_0x4a53ce[_0x239200(0x180)],'S256'),_0x55a200[_0x239200(0x158)]['set']('state',_0x48eaa1);_0x33aff0[_0x239200(0x183)]&&_0x55a200['searchParams'][_0x239200(0x188)](_0x4a53ce['rmGXN'],_0x33aff0['resource']);console[_0x239200(0x174)](_0x4a53ce['REEqV']),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x55a200[_0x239200(0x1a4)]()+'\x0a'),await openBrowser(_0x55a200['toString']());const _0x34ec32=await _0x4a53ce['Pslbr'](waitForCallback,_0x48eaa1);process[_0x239200(0x166)][_0x239200(0x1b3)](_0x4a53ce['CgiSZ']);const _0x1d157c=new URLSearchParams({'grant_type':'authorization_code','code':_0x34ec32,'redirect_uri':'http://localhost:'+CALLBACK_PORT+'/callback','client_id':_0x5eea4f,'code_verifier':_0x26d080});_0x5808e4&&_0x1d157c[_0x239200(0x188)](_0x4a53ce['VrHOh'],_0x5808e4);_0x33aff0['resource']&&_0x1d157c[_0x239200(0x188)](_0x239200(0x183),_0x33aff0['resource']);const _0x377061=await _0x4a53ce['yLwUN'](fetch,_0x4c819c['token_endpoint'],{'method':'POST','headers':{'Content-Type':_0x4a53ce[_0x239200(0x190)]},'body':_0x1d157c});if(!_0x377061['ok']){const _0x310b99=await _0x377061['text']();throw new Error(_0x239200(0x144)+_0x310b99);}const _0x444d97=await _0x377061[_0x239200(0x187)]();return console['log']('\x20done'),await saveCachedToken(_0x444d97['access_token'],_0x444d97[_0x239200(0x168)],_0x444d97['expires_in']),_0x444d97['access_token'];}async function callGetCliToken(_0x4b50e1,_0x447bc0){const _0xd99194=_0x51ab1e,_0xd2b839={'bPeQU':_0xd99194(0x149),'wOEJQ':function(_0x3cf645,_0x5ee155){return _0x3cf645(_0x5ee155);},'DDHoK':'2025-03-26','Uqaef':'\x20done','aTdiI':function(_0x20b288,_0x5d4587,_0x4fbc15){return _0x20b288(_0x5d4587,_0x4fbc15);},'EBpZa':_0xd99194(0x18b),'yGlKo':'notifications/initialized','xunHG':_0xd99194(0x1c4),'waESQ':function(_0x44907e,_0x311bf9,_0x12db5b){return _0x44907e(_0x311bf9,_0x12db5b);},'fYPcq':function(_0xe4d316){return _0xe4d316();},'uomlz':'.ranger','maBqd':'auth-origin.txt'},_0xc5f668={'Content-Type':_0xd2b839[_0xd99194(0x19d)],'Accept':'application/json,\x20text/event-stream'};_0x447bc0&&(_0xc5f668[_0xd99194(0x1bd)]='Bearer\x20'+_0x447bc0);const _0x103914=async _0x1fd746=>{const _0x13a4d8=_0xd99194,_0xa6d39=await fetch(_0x4b50e1,{'method':_0x13a4d8(0x18b),'headers':_0xc5f668,'body':JSON[_0x13a4d8(0x15d)](_0x1fd746)});if(!_0xa6d39['ok']){const _0x1e73d7=await _0xa6d39['text']();throw new Error('HTTP\x20'+_0xa6d39[_0x13a4d8(0x198)]+':\x20'+_0x1e73d7);}return parseResponse(_0xa6d39);};process[_0xd99194(0x166)][_0xd99194(0x1b3)](_0xd99194(0x16a));const _0x1b81d8=await _0xd2b839['wOEJQ'](_0x103914,{'jsonrpc':'2.0','id':0x1,'method':'initialize','params':{'protocolVersion':_0xd2b839[_0xd99194(0x167)],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0xd99194(0x16e)}}});if(_0x1b81d8['error'])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x1b81d8[_0xd99194(0x148)][_0xd99194(0x1b6)]??JSON[_0xd99194(0x15d)](_0x1b81d8[_0xd99194(0x148)])));console['log'](_0xd2b839['Uqaef']),await _0xd2b839['aTdiI'](fetch,_0x4b50e1,{'method':_0xd2b839['EBpZa'],'headers':_0xc5f668,'body':JSON[_0xd99194(0x15d)]({'jsonrpc':'2.0','method':_0xd2b839[_0xd99194(0x19c)]})})['then'](_0x2e1c7c=>_0x2e1c7c[_0xd99194(0x14a)]()),process['stdout']['write'](_0xd99194(0x162));const _0x25ef0d=await _0x103914({'jsonrpc':'2.0','id':0x2,'method':_0xd99194(0x172),'params':{'name':_0xd99194(0x16d),'arguments':{}}});if(_0x25ef0d['error'])throw new Error(_0xd99194(0x1bf)+(_0x25ef0d['error'][_0xd99194(0x1b6)]??JSON['stringify'](_0x25ef0d[_0xd99194(0x148)])));console[_0xd99194(0x174)](_0xd2b839['Uqaef']);const _0x251f89=extractToken(_0x25ef0d['result']);if(!_0x251f89){console[_0xd99194(0x148)](_0xd2b839['xunHG']),console[_0xd99194(0x148)](JSON['stringify'](_0x25ef0d['result'],null,0x2));throw new Error(_0xd99194(0x150));}const _0x5c0ee0=_0xd2b839['waESQ'](join,_0xd2b839[_0xd99194(0x179)](homedir),_0xd2b839['uomlz']),_0x50b2c4=join(_0x5c0ee0,'refresh.txt');await mkdir(_0x5c0ee0,{'recursive':!![]}),await writeFile(_0x50b2c4,_0x251f89,{'mode':0x180}),await writeFile(join(_0x5c0ee0,_0xd2b839[_0xd99194(0x17a)]),_0x4b50e1,{'mode':0x180}),console['log']('\x0aToken\x20written\x20to\x20'+_0x50b2c4),console[_0xd99194(0x174)]('Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a');}async function fetchAuthServerMetadata(_0x5ef744){const _0x5cb45a=_0x51ab1e,_0x370ff0={'aZsKw':function(_0x1a8c2b,_0x7eb08a){return _0x1a8c2b(_0x7eb08a);}},_0xa3cb7a=_0x5ef744+_0x5cb45a(0x1bc),_0x52aa4f=await _0x370ff0[_0x5cb45a(0x1a5)](fetch,_0xa3cb7a);if(!_0x52aa4f['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0xa3cb7a+':\x20'+_0x52aa4f[_0x5cb45a(0x198)]);return _0x52aa4f['json']();}function waitForCallback(_0x4a062a){const _0x47704a=_0x51ab1e,_0x347812={'ifrSJ':_0x47704a(0x1af),'SpAcX':'code','JslLw':_0x47704a(0x17b),'dSaqS':_0x47704a(0x19e)};return new Promise((_0xdcbe73,_0x1d10d0)=>{const _0x5a9753=_0x47704a,_0x4505bf={'xCjBv':_0x347812[_0x5a9753(0x171)],'DposO':function(_0x1170f2,_0x4d68bb){return _0x1170f2!==_0x4d68bb;},'DnPpi':_0x5a9753(0x192),'XammJ':_0x347812[_0x5a9753(0x164)],'BDXPs':_0x5a9753(0x1a6),'TMqrr':_0x347812['JslLw'],'pxoUp':_0x347812[_0x5a9753(0x184)],'LqSaW':function(_0x3be062,_0x2bc30b){return _0x3be062(_0x2bc30b);}},_0x17efba=()=>{const _0x37eb3c=_0x5a9753;_0x33d35c['closeAllConnections'](),_0x33d35c[_0x37eb3c(0x15b)]();},_0x36b1cd=setTimeout(()=>{_0x17efba(),_0x1d10d0(new OAuthTimeoutError(_0x4505bf['xCjBv']));},0x1d4c0),_0x33d35c=createServer((_0x4260e2,_0x284ef1)=>{const _0x2bf8e5=_0x5a9753,_0x418f2c=new URL(_0x4260e2['url']??'/',_0x2bf8e5(0x1aa)+CALLBACK_PORT);if(_0x4505bf['DposO'](_0x418f2c['pathname'],_0x4505bf['DnPpi'])){_0x284ef1[_0x2bf8e5(0x1c6)](0x194),_0x284ef1[_0x2bf8e5(0x196)]('Not\x20found');return;}const _0x57f0cf=_0x418f2c['searchParams']['get'](_0x4505bf[_0x2bf8e5(0x18f)]),_0x4d3c42=_0x418f2c['searchParams']['get'](_0x2bf8e5(0x177)),_0x2e047d=_0x418f2c[_0x2bf8e5(0x158)][_0x2bf8e5(0x1a8)]('error');if(_0x2e047d){const _0x4d2620=_0x418f2c['searchParams']['get'](_0x2bf8e5(0x14f))??_0x2e047d;_0x284ef1['writeHead'](0xc8,{'Content-Type':_0x4505bf[_0x2bf8e5(0x1c0)]}),_0x284ef1['end']('<html><body><h2>Authentication\x20failed</h2><p>'+_0x4d2620+'</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>'),clearTimeout(_0x36b1cd),_0x17efba(),_0x1d10d0(new Error('OAuth\x20error:\x20'+_0x4d2620));return;}if(!_0x57f0cf||_0x4d3c42!==_0x4a062a){_0x284ef1['writeHead'](0x190,{'Content-Type':_0x2bf8e5(0x1a6)}),_0x284ef1['end'](_0x4505bf[_0x2bf8e5(0x1be)]);return;}_0x284ef1[_0x2bf8e5(0x1c6)](0xc8,{'Content-Type':_0x4505bf['BDXPs']}),_0x284ef1[_0x2bf8e5(0x196)](_0x4505bf['pxoUp']),clearTimeout(_0x36b1cd),_0x17efba(),_0x4505bf[_0x2bf8e5(0x1c2)](_0xdcbe73,_0x57f0cf);});_0x33d35c['listen'](CALLBACK_PORT,_0x5a9753(0x18a));});}async function openBrowser(_0x5b1435){const _0x4d8bb6=_0x51ab1e,_0xfaf3ed={'sHLjt':function(_0x50edc8,_0x1b3aba){return _0x50edc8===_0x1b3aba;},'Vtezo':'darwin'},_0x47395d=_0xfaf3ed['sHLjt'](process['platform'],_0xfaf3ed['Vtezo'])?'open':process['platform']===_0x4d8bb6(0x16f)?'start':'xdg-open';exec(_0x47395d+'\x20\x22'+_0x5b1435+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x22460b=_0x51ab1e,_0xd1b6cf={'ZsQxW':function(_0x511678,_0xbc0ad){return _0x511678>_0xbc0ad;}};try{const _0x38200d=JSON['parse'](await readFile(TOKEN_CACHE_PATH,'utf-8'));if(_0x38200d[_0x22460b(0x1a7)]&&_0x38200d[_0x22460b(0x1a7)]!==currentOrigin)return null;if(_0x38200d[_0x22460b(0x165)]&&_0xd1b6cf[_0x22460b(0x181)](Date[_0x22460b(0x199)](),_0x38200d[_0x22460b(0x165)]))return null;return _0x38200d[_0x22460b(0x145)]??null;}catch{return null;}}async function saveCachedToken(_0x324d6b,_0x268955,_0x570f7c){const _0x3cad33=_0x51ab1e,_0x16db59={'dnbfw':function(_0x522a72){return _0x522a72();},'sQiPs':function(_0x1d81a5,_0x6a1c05){return _0x1d81a5*_0x6a1c05;},'YyvlL':function(_0x4ae8f0,_0x2a65a3,_0x2a2276){return _0x4ae8f0(_0x2a65a3,_0x2a2276);},'hSJGv':function(_0x1ab699,_0x295730,_0x4a6b9e,_0x351254){return _0x1ab699(_0x295730,_0x4a6b9e,_0x351254);}},_0x300c0f=await _0x16db59[_0x3cad33(0x1ae)](loadCachedData),_0x258f0a={..._0x300c0f,'origin':currentOrigin,'accessToken':_0x324d6b,'refreshToken':_0x268955??_0x300c0f?.[_0x3cad33(0x19b)],'expiresAt':_0x570f7c?Date['now']()+_0x16db59['sQiPs'](_0x570f7c,0x3e8):undefined};await _0x16db59['YyvlL'](mkdir,join(_0x16db59[_0x3cad33(0x1ae)](homedir),_0x3cad33(0x169)),{'recursive':!![]}),await _0x16db59[_0x3cad33(0x178)](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x258f0a),{'mode':0x180});}async function loadCachedClient(){const _0x2bf35b=_0x51ab1e,_0x1cb52d={'owSjD':function(_0x344929,_0x1dbde5){return _0x344929!==_0x1dbde5;}},_0x15cfec=await loadCachedData();if(_0x15cfec?.[_0x2bf35b(0x1a7)]&&_0x1cb52d['owSjD'](_0x15cfec[_0x2bf35b(0x1a7)],currentOrigin))return null;return _0x15cfec?.[_0x2bf35b(0x1b0)]?{'clientId':_0x15cfec[_0x2bf35b(0x1b0)],'clientSecret':_0x15cfec['clientSecret']}:null;}async function clearCachedClient(){const _0x93ed7e=_0x51ab1e,_0x1ba3e0={'LLuhh':function(_0xa01af2){return _0xa01af2();}},_0x3ecac6=await _0x1ba3e0[_0x93ed7e(0x195)](loadCachedData);if(!_0x3ecac6)return;const {clientId:_0x1d2c46,clientSecret:_0x5a7e4a,..._0xa24778}=_0x3ecac6;await writeFile(TOKEN_CACHE_PATH,JSON[_0x93ed7e(0x15d)](_0xa24778),{'mode':0x180});}async function saveCachedClient(_0x5d619b,_0x19294c){const _0x13c435=_0x51ab1e,_0x2632ac={'HuPDL':function(_0x10e37a){return _0x10e37a();},'AUoQv':function(_0xa2a339,_0x362ba9,_0x331ed9){return _0xa2a339(_0x362ba9,_0x331ed9);},'Ffvym':function(_0x205cf5,_0x3241ae,_0x3d66f7){return _0x205cf5(_0x3241ae,_0x3d66f7);},'liabH':'.ranger'},_0x76482e=await _0x2632ac['HuPDL'](loadCachedData),_0x41c9a9={..._0x76482e,'origin':currentOrigin,'accessToken':_0x76482e?.['accessToken']??'','clientId':_0x5d619b,'clientSecret':_0x19294c};await _0x2632ac['AUoQv'](mkdir,_0x2632ac['Ffvym'](join,_0x2632ac['HuPDL'](homedir),_0x2632ac['liabH']),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x13c435(0x15d)](_0x41c9a9),{'mode':0x180});}async function loadCachedData(){const _0x263e42=_0x51ab1e;try{return JSON[_0x263e42(0x151)](await readFile(TOKEN_CACHE_PATH,_0x263e42(0x1c3)));}catch{return null;}}async function parseResponse(_0x46c3c4){const _0x30721c=_0x51ab1e,_0x3c8aed={'vIUek':'content-type','CWQpb':_0x30721c(0x14b),'VhGes':function(_0x5daba1,_0x21b798){return _0x5daba1!==_0x21b798;}},_0x4054b3=_0x46c3c4[_0x30721c(0x14e)]['get'](_0x3c8aed['vIUek'])??'';if(_0x4054b3['includes'](_0x3c8aed[_0x30721c(0x15c)])){const _0x365118=await _0x46c3c4[_0x30721c(0x14a)]();for(const _0x20b011 of _0x365118[_0x30721c(0x18d)]('\x0a')){const _0x2b1615=_0x20b011[_0x30721c(0x160)]();if(_0x2b1615['startsWith'](_0x30721c(0x152))){const _0x3cd936=_0x2b1615[_0x30721c(0x1a9)](_0x30721c(0x152)['length'])['trim']();if(!_0x3cd936)continue;try{const _0x1589ec=JSON['parse'](_0x3cd936);if(_0x3c8aed['VhGes'](_0x1589ec['id'],undefined)||_0x1589ec['error'])return _0x1589ec;}catch{}}}throw new Error('No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream');}return _0x46c3c4['json']();}function extractToken(_0x27e93e){const _0x2d8f2f=_0x51ab1e,_0x47e574={'NsBKc':'string','hpQrX':'Unknown\x20error','RSiaH':_0x2d8f2f(0x14a)};if(!_0x27e93e)return null;const _0x40edbb=_0x27e93e[_0x2d8f2f(0x18e)];if(_0x40edbb?.['token']&&typeof _0x40edbb[_0x2d8f2f(0x15a)]===_0x47e574[_0x2d8f2f(0x19a)])return _0x40edbb['token'];if(_0x27e93e[_0x2d8f2f(0x1c5)]){const _0x30efcc=_0x27e93e['content'];throw new Error('Server\x20returned\x20error:\x20'+(_0x30efcc?.[0x0]?.['text']??_0x47e574['hpQrX']));}const _0x4cb2da=_0x27e93e['content'];if(_0x4cb2da)for(const _0x23487a of _0x4cb2da){if(_0x23487a['type']===_0x47e574[_0x2d8f2f(0x1ac)]&&_0x23487a[_0x2d8f2f(0x14a)]){try{const _0x5e987b=JSON[_0x2d8f2f(0x151)](_0x23487a['text']);if(typeof _0x5e987b?.[_0x2d8f2f(0x15a)]===_0x47e574['NsBKc'])return _0x5e987b['token'];}catch{}const _0x512ade=_0x23487a['text']['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x512ade)return _0x512ade[0x1];}}return null;}
@@ -1 +1 @@
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
+ function _0x7bea(){var _0x4d6c3b=['BNnxE','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','exit','fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.','10424GYpkJR','5873252RYyaLJ','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','6jIcSQr','5898455GaUagQ','RWsuV','4735791VeWgfU','3512108fxLASl','109VuHObC','3147793WtQUZS','10BCEghx','24cHbtKB','2418774dLPUKn'];_0x7bea=function(){return _0x4d6c3b;};return _0x7bea();}(function(_0x5b30b3,_0x5106bb){var _0x2d7065=_0x3212,_0x34de2b=_0x5b30b3();while(!![]){try{var _0xdcb603=-parseInt(_0x2d7065(0x1a7))/0x1*(parseInt(_0x2d7065(0x19f))/0x2)+parseInt(_0x2d7065(0x1ab))/0x3+-parseInt(_0x2d7065(0x1a6))/0x4+-parseInt(_0x2d7065(0x1a3))/0x5+parseInt(_0x2d7065(0x1a2))/0x6*(parseInt(_0x2d7065(0x1a0))/0x7)+-parseInt(_0x2d7065(0x1aa))/0x8*(-parseInt(_0x2d7065(0x1a5))/0x9)+-parseInt(_0x2d7065(0x1a9))/0xa*(-parseInt(_0x2d7065(0x1a8))/0xb);if(_0xdcb603===_0x5106bb)break;else _0x34de2b['push'](_0x34de2b['shift']());}catch(_0x5b25fa){_0x34de2b['push'](_0x34de2b['shift']());}}}(_0x7bea,0xd7e04));function _0x3212(_0x2ffdee,_0x5a927d){_0x2ffdee=_0x2ffdee-0x19f;var _0x7beaad=_0x7bea();var _0x321264=_0x7beaad[_0x2ffdee];return _0x321264;}export async function migrateProfile(_0x5d5970,_0x1ebc9f){var _0x48620c=_0x3212,_0x4c198b={'BNnxE':function(_0x293b6b,_0x4e7c2d){return _0x293b6b+_0x4e7c2d;},'itvAb':function(_0x3ced5e,_0x5e9d70){return _0x3ced5e+_0x5e9d70;},'IzfVK':function(_0x23a493,_0x2f09e7){return _0x23a493+_0x2f09e7;},'VaamY':'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','RWsuV':_0x48620c(0x1a1)};console['error'](_0x4c198b[_0x48620c(0x1ac)](_0x4c198b['itvAb'](_0x4c198b['IzfVK'](_0x4c198b['IzfVK']('ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a'+'\x0a'+_0x48620c(0x1ad)+_0x4c198b['VaamY'],'\x0a'),_0x4c198b[_0x48620c(0x1a4)]),'\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a')+'\x0a','Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a')+_0x48620c(0x1af)),process[_0x48620c(0x1ae)](0x1);}
@@ -1 +1 @@
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
+ (function(_0x49d510,_0x143429){const _0x439838=_0x3e24,_0x1f7d26=_0x49d510();while(!![]){try{const _0x3e7da9=-parseInt(_0x439838(0x97))/0x1+-parseInt(_0x439838(0xab))/0x2+-parseInt(_0x439838(0xb4))/0x3+parseInt(_0x439838(0x8d))/0x4+-parseInt(_0x439838(0xb2))/0x5*(-parseInt(_0x439838(0x9b))/0x6)+-parseInt(_0x439838(0x9e))/0x7*(-parseInt(_0x439838(0xbf))/0x8)+-parseInt(_0x439838(0xbe))/0x9*(-parseInt(_0x439838(0xbd))/0xa);if(_0x3e7da9===_0x143429)break;else _0x1f7d26['push'](_0x1f7d26['shift']());}catch(_0x48a73a){_0x1f7d26['push'](_0x1f7d26['shift']());}}}(_0x599e,0xefa34));import{join}from'path';import{existsSync}from'fs';import _0x3a1e02 from'inquirer';import{skillup}from'../skillup.js';function _0x599e(){const _0x513426=['ReUgm','.claude','enable','2993984lFguAF','zovFO','error','output','pluginScope','marketplace','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','470QHbbqQ','fhKxM','4925979niPmdd','ycCUZ','ranger','PyemM','\x20level)...\x0a','ranger-testing/trailhead','BHZIS','ranger@trailhead','Dezze','20YIzeth','15291999vapeAo','248uhCHnH','❌\x20Failed\x20to\x20add\x20marketplace:','uqaiq','yTxhu','768992dabxSS','trailhead','includes','✓\x20Ranger\x20skills\x20already\x20installed','❌\x20Failed\x20to\x20install\x20plugin:','SKILL.md','RBdVs','UdDJp','project','wantsSkillup','1509826DJvTmS','success','GksOn','\x0aYou\x20can\x20install\x20manually\x20with:','49686xRNKsZ','prompt','\x0aInstalling\x20Claude\x20Code\x20plugin\x20(','284851MdgBPN','✓\x20Claude\x20Code\x20plugin\x20enabled','already\x20enabled','aMqhF','GTHbv','MlqtI','arzJm','log','user','TMZiV'];_0x599e=function(){return _0x513426;};return _0x599e();}function _0x3e24(_0x2e95d2,_0x1a72f1){_0x2e95d2=_0x2e95d2-0x8b;const _0x599ec1=_0x599e();let _0x3e24df=_0x599ec1[_0x2e95d2];return _0x3e24df;}import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x20b8d5){const _0x3eeb17=_0x3e24,_0x4f8735={'zovFO':_0x3eeb17(0xbb),'aRFCy':function(_0x2fa965,_0x4e9112){return _0x2fa965(_0x4e9112);},'yTxhu':function(_0x63c15b,_0x2f71fe,_0x1a31ae){return _0x63c15b(_0x2f71fe,_0x1a31ae);},'RBdVs':'.claude','fhKxM':_0x3eeb17(0x95),'arzJm':'\x0a📦\x20Claude\x20Code\x20Plugin\x0a','ReUgm':_0x3eeb17(0xaf),'mvfPr':'Where\x20should\x20the\x20plugin\x20be\x20installed?','CkIiQ':'User\x20(available\x20in\x20all\x20your\x20projects)','Dezze':_0x3eeb17(0xa6),'MlqtI':function(_0x5598ff,_0x29c014){return _0x5598ff(_0x29c014);},'uzJBI':'plugin','OSWsM':'--scope','vFefw':function(_0x2a8a0a,_0x2dc5e5){return _0x2a8a0a===_0x2dc5e5;},'GksOn':_0x3eeb17(0x91),'uqaiq':function(_0x27f885,_0x3efcb7){return _0x27f885===_0x3efcb7;},'GTHbv':function(_0x552a7b,_0x52a88d,_0x55786b){return _0x552a7b(_0x52a88d,_0x55786b);},'aMqhF':_0x3eeb17(0x9f)},_0x9c3a6f=await isPluginInstalled(_0x4f8735['zovFO']);if(_0x9c3a6f)return console['log']('✓\x20Claude\x20Code\x20plugin\x20already\x20installed'),![];const _0x5d0ef5=_0x4f8735['aRFCy'](existsSync,_0x4f8735[_0x3eeb17(0x8c)](join,getProjectRoot(),_0x4f8735[_0x3eeb17(0x93)]));let _0x1e8b75;if(_0x20b8d5)_0x1e8b75=_0x20b8d5;else{if(_0x5d0ef5)_0x1e8b75=_0x4f8735['fhKxM'];else{console[_0x3eeb17(0xa5)](_0x4f8735[_0x3eeb17(0xa4)]);const _0x4f8492=await _0x3a1e02[_0x3eeb17(0x9c)]([{'type':'list','name':_0x4f8735[_0x3eeb17(0xa8)],'message':_0x4f8735['mvfPr'],'choices':[{'name':_0x4f8735['CkIiQ'],'value':_0x4f8735['Dezze']},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':_0x4f8735['fhKxM']}],'default':_0x4f8735[_0x3eeb17(0xbc)]}]);_0x1e8b75=_0x4f8492['pluginScope'];}}console['log'](_0x3eeb17(0x9d)+_0x1e8b75+_0x3eeb17(0xb8));const _0x14fc65=await isMarketplaceAdded(_0x3eeb17(0x8e));let _0x229dc5=_0x14fc65;if(_0x14fc65)console['log']('✓\x20Marketplace\x20already\x20added');else{const _0x542413=await _0x4f8735[_0x3eeb17(0xa3)](runClaudeCommand,['plugin',_0x3eeb17(0xb0),'add',_0x3eeb17(0xb9)]);!_0x542413['success']?(console['error'](_0x3eeb17(0xc0),_0x542413['error']),console[_0x3eeb17(0xa5)](_0x3eeb17(0x9a)),console[_0x3eeb17(0xa5)]('\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead'),console[_0x3eeb17(0xa5)](_0x3eeb17(0xb1)+_0x1e8b75)):_0x229dc5=!![];}if(_0x229dc5){const _0x295931=await runClaudeCommand([_0x4f8735['uzJBI'],'install',_0x4f8735[_0x3eeb17(0xac)],_0x4f8735['OSWsM'],_0x1e8b75],{'cwd':_0x4f8735['vFefw'](_0x1e8b75,'project')?getProjectRoot():undefined});if(!_0x295931[_0x3eeb17(0x98)])console[_0x3eeb17(0xad)](_0x4f8735[_0x3eeb17(0x99)],_0x295931[_0x3eeb17(0xad)]),console['log']('\x0aYou\x20can\x20install\x20manually\x20with:'),console['log']('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x1e8b75);else{console[_0x3eeb17(0xa5)]('✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully');const _0x42a5ff=[_0x4f8735['uzJBI'],_0x3eeb17(0xaa),_0x4f8735[_0x3eeb17(0xac)]];_0x4f8735[_0x3eeb17(0x8b)](_0x1e8b75,'project')&&_0x42a5ff['push']('--scope',_0x3eeb17(0x95));const _0x12f796=await _0x4f8735[_0x3eeb17(0xa2)](runClaudeCommand,_0x42a5ff,{'captureOutput':!![],'cwd':_0x1e8b75===_0x4f8735[_0x3eeb17(0xb3)]?getProjectRoot():undefined}),_0xc60130=_0x12f796[_0x3eeb17(0xae)]?.[_0x3eeb17(0x8f)](_0x3eeb17(0xa0));!_0x12f796[_0x3eeb17(0x98)]&&!_0xc60130?console['error']('⚠\x20Failed\x20to\x20enable\x20plugin:',_0x12f796[_0x3eeb17(0xad)]):console[_0x3eeb17(0xa5)](_0x4f8735[_0x3eeb17(0xa1)]);}}return!![];}export async function ensureClaudeSkills(_0x53cafb){const _0x513033=_0x3e24,_0x498236={'dzmbM':function(_0x270d0d,_0x292115,_0x5cb25a,_0x533b00){return _0x270d0d(_0x292115,_0x5cb25a,_0x533b00);},'ycCUZ':function(_0x2fb46d,_0x273cab){return _0x2fb46d(_0x273cab);},'UdDJp':'user','TMZiV':function(_0x499269,_0x6783ed,_0xda97f6,_0x4d939e){return _0x499269(_0x6783ed,_0xda97f6,_0x4d939e);},'eDdsH':'ranger','RXttS':function(_0x1f679a,_0x328c9a){return _0x1f679a(_0x328c9a);},'BHZIS':function(_0x282622,_0x4197e9,_0x744fb1){return _0x282622(_0x4197e9,_0x744fb1);},'uCuBX':function(_0x401ae7){return _0x401ae7();},'PyemM':_0x513033(0xa9),'MmMUY':_0x513033(0x96),'mIkFi':'Would\x20you\x20like\x20to\x20install\x20skills?','xXdME':function(_0x47323d,_0x6281cc){return _0x47323d(_0x6281cc);}},_0x1824f6=existsSync(_0x498236['dzmbM'](join,_0x498236['ycCUZ'](getSkillsDir,_0x498236[_0x513033(0x94)]),_0x513033(0xb6),_0x513033(0x92))),_0x55ed66=existsSync(_0x498236[_0x513033(0xa7)](join,getSkillsDir('project'),_0x498236['eDdsH'],_0x513033(0x92)));if(_0x1824f6||_0x55ed66)return console[_0x513033(0xa5)](_0x513033(0x90)),![];const _0x3e3bd8=_0x498236['RXttS'](existsSync,_0x498236[_0x513033(0xba)](join,_0x498236['uCuBX'](getProjectRoot),_0x498236[_0x513033(0xb7)]));let _0x19db91=!![];if(_0x53cafb)await _0x498236['ycCUZ'](skillup,{'autoInstall':_0x53cafb,'suppressUsage':!![]});else{if(_0x3e3bd8)await _0x498236[_0x513033(0xb5)](skillup,{'autoInstall':'project','suppressUsage':!![]});else{const _0xdfe203=await _0x3a1e02['prompt']([{'type':'confirm','name':_0x498236['MmMUY'],'message':_0x498236['mIkFi'],'default':!![]}]);_0x19db91=_0xdfe203['wantsSkillup'],_0x19db91&&await _0x498236['xXdME'](skillup,{'suppressUsage':!![]});}}return _0x19db91;}
@@ -1 +1 @@
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
+ function _0x2cd6(_0x356f95,_0x187478){_0x356f95=_0x356f95-0x1bf;const _0x2ac078=_0x2ac0();let _0x2cd695=_0x2ac078[_0x356f95];return _0x2cd695;}(function(_0x549665,_0x2d67b5){const _0x55a33c=_0x2cd6,_0xc9b8a3=_0x549665();while(!![]){try{const _0x447b4a=parseInt(_0x55a33c(0x1c1))/0x1*(parseInt(_0x55a33c(0x1c9))/0x2)+-parseInt(_0x55a33c(0x1c3))/0x3*(-parseInt(_0x55a33c(0x1d5))/0x4)+parseInt(_0x55a33c(0x1d9))/0x5+parseInt(_0x55a33c(0x1d4))/0x6+-parseInt(_0x55a33c(0x1c0))/0x7+parseInt(_0x55a33c(0x1ca))/0x8+-parseInt(_0x55a33c(0x1c5))/0x9*(parseInt(_0x55a33c(0x1cc))/0xa);if(_0x447b4a===_0x2d67b5)break;else _0xc9b8a3['push'](_0xc9b8a3['shift']());}catch(_0x422815){_0xc9b8a3['push'](_0xc9b8a3['shift']());}}}(_0x2ac0,0xa75e4));import{join}from'path';import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0x4d7a24 from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';function _0x2ac0(){const _0x79d3de=['YHWOr','JVMOm','@ranger-testing/opencode-plugin','plugin','mirVp','Failed\x20to\x20read\x20opencode.json','pluginScope','project','9569693uunQij','1XPePyT','prompt','15261CBKxzw','mrtAq','11736WAZpmJ','stringify','\x0a📦\x20OpenCode\x20Plugin\x0a','PHokh','1251322rBAkOl','9541464TVJZem','WRqxi','13670rwBfGR','BVetg','wiVkf','parse','LfzhO','✓\x20OpenCode\x20plugin\x20already\x20configured','log','opencode.json','2286354lsmoPF','736kDILcW','user','fqVFg','mjCEY','3498980OxYtix','utf-8'];_0x2ac0=function(){return _0x79d3de;};return _0x2ac0();}export async function ensureOpencodePluginConfig(_0x3f89a6){const _0x415382=_0x2cd6,_0x215f8d={'LfzhO':function(_0x3ce3a7,_0x3727cf){return _0x3ce3a7(_0x3727cf);},'rAyZU':function(_0xe17e01,_0x319402,_0x5409b9){return _0xe17e01(_0x319402,_0x5409b9);},'CHABT':function(_0x584b67,_0x5cd474){return _0x584b67(_0x5cd474);},'YHWOr':_0x415382(0x1d3),'PHokh':'project','wiVkf':_0x415382(0x1c7),'uFcYk':'Where\x20should\x20the\x20plugin\x20be\x20installed?','jIHnT':'User\x20(available\x20in\x20all\x20your\x20projects)','WRqxi':_0x415382(0x1d6),'mjCEY':function(_0x1c70b8,_0x173987,_0x2389d9){return _0x1c70b8(_0x173987,_0x2389d9);},'BVetg':_0x415382(0x1dd),'mrtAq':'https://opencode.ai/config.json','mSkvl':'⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','wYJWJ':_0x415382(0x1e0),'fqVFg':function(_0x5ce1fb,_0xddbc10){return _0x5ce1fb(_0xddbc10);},'JVMOm':function(_0x460358,_0x24af4a){return _0x460358+_0x24af4a;},'mirVp':'✓\x20OpenCode\x20plugin\x20configured'},_0x337e8c=_0x215f8d[_0x415382(0x1d0)](existsSync,_0x215f8d['rAyZU'](join,_0x215f8d['CHABT'](getOpencodeConfigDir,_0x415382(0x1bf)),_0x215f8d['YHWOr']));let _0x537da4;if(_0x3f89a6)_0x537da4=_0x3f89a6;else{if(_0x337e8c)_0x537da4=_0x215f8d['PHokh'];else{console[_0x415382(0x1d2)](_0x215f8d[_0x415382(0x1ce)]);const _0x4072d6=await _0x4d7a24[_0x415382(0x1c2)]([{'type':'list','name':'pluginScope','message':_0x215f8d['uFcYk'],'choices':[{'name':_0x215f8d['jIHnT'],'value':_0x215f8d[_0x415382(0x1cb)]},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':_0x215f8d[_0x415382(0x1c8)]}],'default':'user'}]);_0x537da4=_0x4072d6[_0x415382(0x1e1)];}}const _0x3175f0=_0x215f8d[_0x415382(0x1d8)](join,_0x215f8d['LfzhO'](getOpencodeConfigDir,_0x537da4),_0x215f8d[_0x415382(0x1db)]),_0x59e77c=_0x215f8d[_0x415382(0x1cd)],_0x327812=_0x215f8d[_0x415382(0x1c4)];let _0x130d16={};if(_0x215f8d['LfzhO'](existsSync,_0x3175f0))try{const _0x493370=await _0x215f8d[_0x415382(0x1d8)](readFile,_0x3175f0,_0x415382(0x1da));_0x130d16=JSON[_0x415382(0x1cf)](_0x493370);}catch(_0x568746){return console['error'](_0x215f8d['mSkvl']),{'configured':![],'scope':_0x537da4,'error':_0x215f8d['wYJWJ'],'details':_0x568746};}const _0x1c59a7=Array['isArray'](_0x130d16['plugin'])?_0x130d16[_0x415382(0x1de)]:[];if(_0x1c59a7['includes'](_0x59e77c))return console[_0x415382(0x1d2)](_0x415382(0x1d1)),{'configured':![],'scope':_0x537da4};return _0x130d16['$schema']=_0x130d16['$schema']||_0x327812,_0x130d16[_0x415382(0x1de)]=[..._0x1c59a7,_0x59e77c],await mkdir(_0x215f8d[_0x415382(0x1d7)](getOpencodeConfigDir,_0x537da4),{'recursive':!![]}),await writeFile(_0x3175f0,_0x215f8d[_0x415382(0x1dc)](JSON[_0x415382(0x1c6)](_0x130d16,null,0x2),'\x0a')),console[_0x415382(0x1d2)](_0x215f8d[_0x415382(0x1df)]),{'configured':!![],'scope':_0x537da4};}
@@ -1 +1 @@
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
+ function _0x6e6b(){var _0x475f87=['6365936LpivVQ','262HqOasa','HkTxJ','YNewi','5745wROOXW','1380936YWZlTy','18cnJYBf','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','1400730QBfgNX','NZakv','108rrSlRI','349525LBAvPy','968190GpGXhP','68887DsLmhD'];_0x6e6b=function(){return _0x475f87;};return _0x6e6b();}function _0xfdac(_0x4c0944,_0xd7d9e5){_0x4c0944=_0x4c0944-0x1b1;var _0xfdac51=_0x6e6b();var _0x23916=_0xfdac51[_0x4c0944];return _0x23916;}(function(_0x4282a2,_0x34e41e){var _0x1c2d50=_0xfdac,_0x45584f=_0x4282a2();while(!![]){try{var _0x1d49d3=parseInt(_0x1c2d50(0x1b7))/0x1+-parseInt(_0x1c2d50(0x1ba))/0x2*(-parseInt(_0x1c2d50(0x1bd))/0x3)+parseInt(_0x1c2d50(0x1be))/0x4+-parseInt(_0x1c2d50(0x1b6))/0x5+-parseInt(_0x1c2d50(0x1b1))/0x6*(parseInt(_0x1c2d50(0x1b8))/0x7)+parseInt(_0x1c2d50(0x1b9))/0x8+parseInt(_0x1c2d50(0x1b5))/0x9*(-parseInt(_0x1c2d50(0x1b3))/0xa);if(_0x1d49d3===_0x34e41e)break;else _0x45584f['push'](_0x45584f['shift']());}catch(_0x3562fd){_0x45584f['push'](_0x45584f['shift']());}}}(_0x6e6b,0x8d88f));export async function setupCi(_0x55036d,_0xbf3261,_0x106c5e){var _0x55199e=_0xfdac,_0x475a37={'NZakv':function(_0x12591d,_0x20396b){return _0x12591d+_0x20396b;},'VKNjY':function(_0x32442b,_0xdb6141){return _0x32442b+_0xdb6141;},'HkTxJ':_0x55199e(0x1b2),'Dzdcw':'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','YNewi':'\x20\x20https://docs.ranger.net/main/concepts/profiles'};console['error'](_0x475a37[_0x55199e(0x1b4)](_0x475a37['NZakv'](_0x475a37['VKNjY']('ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a'+'\x0a','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a')+_0x475a37[_0x55199e(0x1bb)],'\x0a'),_0x475a37['Dzdcw'])+_0x475a37[_0x55199e(0x1bc)]),process['exit'](0x1);}
@@ -1 +1 @@
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
+ (function(_0x45811e,_0x150dd5){const _0x52942b=_0x1f1c,_0x35d32a=_0x45811e();while(!![]){try{const _0x2e7305=parseInt(_0x52942b(0x1f3))/0x1+parseInt(_0x52942b(0x1d7))/0x2*(-parseInt(_0x52942b(0x1de))/0x3)+parseInt(_0x52942b(0x1ef))/0x4*(parseInt(_0x52942b(0x1d3))/0x5)+-parseInt(_0x52942b(0x1ea))/0x6*(-parseInt(_0x52942b(0x1fc))/0x7)+parseInt(_0x52942b(0x1dc))/0x8*(parseInt(_0x52942b(0x1e5))/0x9)+parseInt(_0x52942b(0x1fb))/0xa+-parseInt(_0x52942b(0x1f8))/0xb;if(_0x2e7305===_0x150dd5)break;else _0x35d32a['push'](_0x35d32a['shift']());}catch(_0x687ed4){_0x35d32a['push'](_0x35d32a['shift']());}}}(_0x1b3b,0x83da9));import{basename}from'path';import _0x4b01f9 from'inquirer';import{getToken}from'./utils/keychain.js';function _0x1f1c(_0x681ec,_0x527081){_0x681ec=_0x681ec-0x1d2;const _0x1b3b70=_0x1b3b();let _0x1f1c4a=_0x1b3b70[_0x681ec];return _0x1f1c4a;}import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x4fb019={}){const _0x24035f=_0x1f1c,_0x603c66={'IHCni':'\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','MUYgI':_0x24035f(0x1ee),'goHLE':function(_0x2f03db){return _0x2f03db();},'mUFVX':'❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','SEQtm':'To\x20get\x20started:','qTNCE':_0x24035f(0x1e1),'ipKar':function(_0x362b33,_0x5ecc28){return _0x362b33===_0x5ecc28;},'eYcHR':function(_0x2064ae,_0x527014){return _0x2064ae===_0x527014;},'yuLHc':_0x24035f(0x1e3),'ZTRDx':'✓\x20Found\x20API\x20token','LHMNK':function(_0x235896,_0x1d6bd6){return _0x235896(_0x1d6bd6);},'kXrJO':'opencode','hUoEW':_0x24035f(0x1da),'izLPY':_0x24035f(0x1e0),'yzQGy':_0x24035f(0x1e9),'KKfgm':'\x0a📦\x20Installing\x20skills...\x0a','PfMTo':function(_0x2306eb,_0x4a67c0,_0x59ed0e){return _0x2306eb(_0x4a67c0,_0x59ed0e);},'FBDKs':_0x24035f(0x1dd),'wgDGb':function(_0x58aa5f,_0x5dae97){return _0x58aa5f>_0x5dae97;},'ukOjy':function(_0x571e2e,_0x983a15){return _0x571e2e===_0x983a15;},'MmEXp':'user-level','Atrgx':_0x24035f(0x1df),'UntaH':function(_0x21ab09,_0x57a455){return _0x21ab09===_0x57a455;}};console['log'](_0x603c66[_0x24035f(0x1f0)]);const _0x483f47=_0x4fb019['platform']??_0x603c66[_0x24035f(0x1e6)],_0x322ed9=await _0x603c66[_0x24035f(0x1d5)](getToken);if(!_0x322ed9){console['log'](_0x603c66[_0x24035f(0x1f9)]),console['log'](_0x603c66['SEQtm']),console[_0x24035f(0x1fe)](_0x603c66['qTNCE']),console[_0x24035f(0x1fe)]('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0x603c66[_0x24035f(0x1e7)](_0x483f47,_0x24035f(0x1f6))?'\x20--opencode':'')+_0x24035f(0x1db)),console[_0x24035f(0x1fe)]('\x20\x203.\x20Run:\x20ranger\x20skillup'+(_0x603c66['eYcHR'](_0x483f47,'opencode')?_0x603c66['yuLHc']:'')+'\x0a');return;}console[_0x24035f(0x1fe)](_0x603c66['ZTRDx']);const _0x2984bf=getProjectRoot(),_0x5a1067=_0x603c66['LHMNK'](basename,_0x2984bf),_0x2379d2=_0x603c66['eYcHR'](_0x483f47,'opencode')?_0x603c66[_0x24035f(0x1f5)](getOpencodeConfigDir,_0x24035f(0x1e0))+'/skills/':_0x603c66['goHLE'](getClaudeConfigDir)+'/skills/',_0x3d5e19=_0x483f47===_0x603c66[_0x24035f(0x1e8)]?_0x2984bf+'/.opencode/skills/':_0x2984bf+_0x24035f(0x1f7),_0x3ebb3f=process['stdin'][_0x24035f(0x1f2)]&&process['stdout']['isTTY'];let _0x1d5512;if(_0x4fb019['autoInstall'])_0x1d5512=_0x4fb019[_0x24035f(0x1d2)];else{if(_0x3ebb3f){const _0x128cbd=await _0x4b01f9[_0x24035f(0x1fd)]([{'type':'list','name':'installLevel','message':_0x603c66[_0x24035f(0x1fa)],'choices':[{'name':_0x24035f(0x1eb)+_0x2379d2+')','value':_0x603c66[_0x24035f(0x1ec)]},{'name':_0x24035f(0x1d8)+_0x3d5e19+')','value':_0x603c66['yzQGy']}]}]);_0x1d5512=_0x128cbd[_0x24035f(0x1e2)];}else _0x1d5512=_0x603c66[_0x24035f(0x1d6)],console[_0x24035f(0x1fe)]('Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20('+_0x3d5e19+')');}let _0x442994=0x0;const _0x1a5ae9=getCurrentVersion();console['log'](_0x603c66['KKfgm']);try{const _0x50de79=await _0x603c66['PfMTo'](installSkill,'ranger',{'cliVersion':_0x1a5ae9,'level':_0x1d5512,'platform':_0x483f47});_0x50de79&&_0x442994++;}catch(_0x39bcb5){console['warn'](_0x603c66[_0x24035f(0x1f1)],_0x39bcb5 instanceof Error?_0x39bcb5['message']:_0x39bcb5);}if(_0x603c66['wgDGb'](_0x442994,0x0)){const _0x5dc58f=_0x603c66['ukOjy'](_0x1d5512,_0x603c66[_0x24035f(0x1ec)])?_0x603c66['MmEXp']:_0x603c66[_0x24035f(0x1d4)];console['log'](_0x24035f(0x1d9)+_0x442994+'\x20'+_0x5dc58f+_0x24035f(0x1f4)+(_0x442994>0x1?'s':'')+'\x20successfully!\x0a'),!_0x4fb019[_0x24035f(0x1ed)]&&(console[_0x24035f(0x1fe)]('To\x20use:'),_0x603c66[_0x24035f(0x1e4)](_0x483f47,_0x603c66['kXrJO'])?console['log']('\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.'):console[_0x24035f(0x1fe)]('\x20\x20-\x20Open\x20Claude\x20Code\x20in\x20plan\x20mode\x20and\x20run\x20/ranger:enable.\x20Plan\x20out\x20a\x20UI\x20feature\x20with\x20Ranger\x20and\x20watch\x20Ranger\x20test\x20it\x20for\x20you!'));}else console[_0x24035f(0x1fe)]('\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a');}function _0x1b3b(){const _0x3e5064=['isTTY','977911Rwbves','\x20skill','LHMNK','opencode','/.claude/skills/','26522155vKnpCb','mUFVX','hUoEW','7005500ZvwKQO','7fAMyQq','prompt','log','autoInstall','235ZDwduT','Atrgx','goHLE','yzQGy','57100QDbxUZ','This\x20project\x20only\x20(','\x0a✅\x20Installed\x20','Where\x20should\x20skills\x20be\x20installed?','\x20<your-api-token>','136oMukZV','\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','57FYYueG','project-level','user','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','installLevel','\x20--opencode','UntaH','85518uRwyHF','MUYgI','ipKar','kXrJO','project','5463096FNgYUT','All\x20projects\x20(','izLPY','suppressUsage','claude','63244HxFeBJ','IHCni','FBDKs'];_0x1b3b=function(){return _0x3e5064;};return _0x1b3b();}
@@ -1 +1 @@
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
+ (function(_0x386fcf,_0x49f121){const _0x3546af=_0x52ae,_0xab571=_0x386fcf();while(!![]){try{const _0x2b2d18=-parseInt(_0x3546af(0x1fd))/0x1+parseInt(_0x3546af(0x20b))/0x2+-parseInt(_0x3546af(0x1f2))/0x3*(-parseInt(_0x3546af(0x239))/0x4)+parseInt(_0x3546af(0x226))/0x5*(-parseInt(_0x3546af(0x224))/0x6)+-parseInt(_0x3546af(0x218))/0x7*(parseInt(_0x3546af(0x22c))/0x8)+-parseInt(_0x3546af(0x228))/0x9+parseInt(_0x3546af(0x241))/0xa;if(_0x2b2d18===_0x49f121)break;else _0xab571['push'](_0xab571['shift']());}catch(_0x30d558){_0xab571['push'](_0xab571['shift']());}}}(_0x1922,0xd90d7));function _0x52ae(_0x5d52a8,_0x3d7ebc){_0x5d52a8=_0x5d52a8-0x1e9;const _0x19222c=_0x1922();let _0x52aebd=_0x19222c[_0x5d52a8];return _0x52aebd;}import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x3cf803 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';function _0x1922(){const _0x1baa1b=['4FnWsZC','ignore','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','success','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','✓\x20Exported\x20credentials\x20for\x20CI','user','39035840QWwfwN','bJULT','plugin','trackPhaseStart','url','...','hdtlU','SgdVE','stdin','install','platform','✓\x20Playwright\x20Chromium\x20browser\x20found','jupxC','\x0a⚠\x20Skipping\x20Chromium\x20installation.','force','skipChromium','qyGFJ','\x20(fallback\x20version)','318495iOthFb','✓\x20Stored\x20credentials\x20locally','trackPhaseEnd','--with-deps','JllgR','nhgFT','skills','rjjli','GITHUB_ENV','HBvAk','JmeHI','299911rqrSPh','withDeps','ttgQQ','device_auth','\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','.gitignore','CvaPN','\x0aInstalling\x20Chromium\x20browser...\x0a','prompt','profile','npx','XDSKD','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','49992ofmfdn','\x20install\x20chromium','provided_token','log','\x0aIn\x20Claude\x20Code,\x20run\x20','chromium','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','\x20is\x20no\x20longer\x20supported.\x20','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','skipped','✓\x20Local\x20profile\x20already\x20exists','NLCBV','175MrHFnV','Validating\x20API\x20token...','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','sgSgn','playwright@','existing_token','auth','✓\x20Already\x20authenticated\x20to\x20','Installation\x20failed\x20with\x20exit\x20code\x20','error','message','inherit','438jVedzk','SYxEt','82555lRdCKi','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','4468806JvPdhW','eaASL','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','dGaFo','366064JUqfyZ','✓\x20Authenticated\x20to\x20','✓\x20~/.ranger/\x20directory\x20already\x20exists','wiIQA','Authentication\x20failed:\x20','SJEVy','allowInsecureLocalhost','scope','bPPYw','organizationName','rBRUX','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.','playwright/package.json'];_0x1922=function(){return _0x1baa1b;};return _0x1922();}import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.58.2';const bold=_0x484b70=>'\x1b[1m'+_0x484b70+'\x1b[0m';export function getPlaywrightVersion(){const _0x4709e6=_0x52ae;try{const _0x7ba15f=require['resolve'](_0x4709e6(0x238)),_0x5497c1=require(_0x7ba15f);return _0x5497c1['version'];}catch{return null;}}export function installChromiumBinary(_0x3badf5,_0x2cbd9a=![]){const _0x5659b6=_0x52ae,_0x1b3665={'lFguW':function(_0x2025bc,_0x4eaca5){return _0x2025bc(_0x4eaca5);},'OntZs':'chromium','zyRcd':function(_0x1f0839,_0x5917b0,_0x16200d,_0x30dd22){return _0x1f0839(_0x5917b0,_0x16200d,_0x30dd22);},'SJEVy':_0x5659b6(0x208)};return new Promise((_0x524451,_0x1b84e5)=>{const _0xb35000=_0x5659b6,_0x394b57={'GQziK':function(_0xa83af4,_0x54cff6){return _0xa83af4===_0x54cff6;},'ttgQQ':function(_0x3b77c1,_0x192be0){return _0x1b3665['lFguW'](_0x3b77c1,_0x192be0);}},_0x170ee3=[_0xb35000(0x21c)+_0x3badf5,'install',..._0x2cbd9a?[_0xb35000(0x1f5)]:[],_0x1b3665['OntZs']],_0x38c2e6=_0x1b3665['zyRcd'](spawn,_0x1b3665[_0xb35000(0x231)],_0x170ee3,{'stdio':[_0xb35000(0x23a),_0xb35000(0x223),_0xb35000(0x223)],'shell':process[_0xb35000(0x1ea)]==='win32'});_0x38c2e6['on']('close',_0x23c21c=>{const _0x2d30d9=_0xb35000;_0x394b57['GQziK'](_0x23c21c,0x0)?_0x524451():_0x1b84e5(new Error(_0x2d30d9(0x220)+_0x23c21c));}),_0x38c2e6['on'](_0xb35000(0x221),_0x44b8ef=>{const _0x57ddc6=_0xb35000;_0x394b57[_0x57ddc6(0x1ff)](_0x1b84e5,_0x44b8ef);});});}export async function authenticate(_0x4f69be){const _0x4f0525=_0x52ae,_0x45191a={'OdeCw':function(_0x26c84c,_0x4be85b){return _0x26c84c(_0x4be85b);},'RjXIn':_0x4f0525(0x21d),'DSaem':_0x4f0525(0x200),'rBRUX':_0x4f0525(0x23f)};if(!_0x4f69be){const _0x28140c=await getToken();if(_0x28140c){const _0x271b4c=await _0x45191a['OdeCw'](getCurrentUser,_0x28140c);if(_0x271b4c['success'])return console['log'](_0x4f0525(0x21f)+_0x271b4c['user']['organizationName']),{'token':_0x28140c,'method':_0x45191a['RjXIn']};}try{_0x4f69be=await runDeviceAuthFlow();}catch(_0x5776a5){throw new Error('Authentication\x20failed:\x20'+(_0x5776a5 instanceof Error?_0x5776a5[_0x4f0525(0x222)]:_0x5776a5));}const _0x44e3dd=await getCurrentUser(_0x4f69be);if(!_0x44e3dd[_0x4f0525(0x23d)])throw new Error(_0x4f0525(0x23b)+_0x44e3dd[_0x4f0525(0x221)]);return console[_0x4f0525(0x20e)](_0x4f0525(0x22d)+_0x44e3dd['user']['organizationName']),{'token':_0x4f69be,'method':_0x45191a['DSaem']};}console[_0x4f0525(0x20e)](_0x4f0525(0x219));const _0xaa58b3=await getCurrentUser(_0x4f69be);if(!_0xaa58b3[_0x4f0525(0x23d)]){if(_0xaa58b3['status'])throw new Error(_0x4f0525(0x230)+_0xaa58b3[_0x4f0525(0x221)]+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0xaa58b3[_0x4f0525(0x221)]+_0x4f0525(0x202));}return console[_0x4f0525(0x20e)](_0x4f0525(0x22d)+_0xaa58b3[_0x4f0525(0x240)][_0x4f0525(0x235)]),await storeToken(_0x4f69be),console[_0x4f0525(0x20e)](process['env'][_0x4f0525(0x1fa)]?_0x45191a[_0x4f0525(0x236)]:_0x4f0525(0x1f3)),{'token':_0x4f69be,'method':_0x4f0525(0x20d)};}export async function ensureRangerDir(_0x2b8d54){const _0x30e7cd=_0x52ae,_0x2ee54c={'cRPeA':function(_0x3a62c5){return _0x3a62c5();},'oULmb':function(_0x205307,_0xa132ef){return _0x205307(_0xa132ef);},'NTjUm':'✓\x20Created\x20~/.ranger/\x20directory','yULUX':_0x30e7cd(0x22e)};void _0x2b8d54;const _0x30bba9=_0x2ee54c['cRPeA'](getRangerHomeDir);return!_0x2ee54c['oULmb'](existsSync,_0x30bba9)?(await mkdir(_0x30bba9,{'recursive':!![]}),console['log'](_0x2ee54c['NTjUm']),{'path':_0x30bba9,'installed':!![]}):(console[_0x30e7cd(0x20e)](_0x2ee54c['yULUX']),{'path':_0x30bba9,'installed':![]});}export async function ensureChromium(_0x559740=![]){const _0x3ad034=_0x52ae,_0x2407e6={'KPIAZ':function(_0x39cef6,_0x278b31){return _0x39cef6(_0x278b31);},'sgSgn':_0x3ad034(0x1eb),'rulBF':function(_0xdf995e,_0x4c3d8a){return _0xdf995e??_0x4c3d8a;},'Bacgd':'confirm','rjjli':_0x3ad034(0x1f1),'jupxC':_0x3ad034(0x205),'zStOT':function(_0x278809,_0x58fc54){return _0x278809 instanceof _0x58fc54;}};let _0xc1fab8=![];try{const _0x2854c7=chromium['executablePath']();_0xc1fab8=_0x2407e6['KPIAZ'](existsSync,_0x2854c7);}catch{_0xc1fab8=![];}if(_0xc1fab8)return console[_0x3ad034(0x20e)](_0x2407e6[_0x3ad034(0x21b)]),![];const _0x51a6d5=getPlaywrightVersion(),_0x252040=_0x2407e6['rulBF'](_0x51a6d5,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x1ff5e4=!_0x51a6d5,_0x43c7a2=process[_0x3ad034(0x249)]['isTTY']&&process['stdout']['isTTY'];let _0x275239=!![];if(_0x43c7a2){const {install:_0x6600c}=await _0x3cf803[_0x3ad034(0x206)]([{'type':_0x2407e6['Bacgd'],'name':_0x3ad034(0x1e9),'message':_0x1ff5e4?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x252040+'\x20now?':'The\x20required\x20version\x20('+_0x252040+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x275239=_0x6600c;}else console['log'](_0x3ad034(0x23e)+_0x252040+(_0x1ff5e4?_0x2407e6[_0x3ad034(0x1f9)]:'')+_0x3ad034(0x246));if(_0x275239){console['log'](_0x2407e6[_0x3ad034(0x1ec)]);try{await installChromiumBinary(_0x252040,_0x559740),console['log']('\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully');}catch(_0x4b1de0){console[_0x3ad034(0x221)]('\x0a❌\x20Failed\x20to\x20install\x20Chromium:',_0x2407e6['zStOT'](_0x4b1de0,Error)?_0x4b1de0[_0x3ad034(0x222)]:_0x4b1de0),console['log']('You\x20can\x20install\x20it\x20manually\x20by\x20running:'),console[_0x3ad034(0x20e)]('\x20\x20npx\x20playwright@'+_0x252040+_0x3ad034(0x20c));}}else console[_0x3ad034(0x20e)](_0x3ad034(0x1ed)),console[_0x3ad034(0x20e)]('You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'),console['log']('\x20\x20npx\x20playwright@'+_0x252040+_0x3ad034(0x20c));return!![];}export async function writeRangerGitignore(_0x4c28bc){const _0x4bdbc5=_0x52ae,_0x5e5188={'JmeHI':_0x4bdbc5(0x203)},_0x3dde04=join(_0x4c28bc,_0x5e5188[_0x4bdbc5(0x1fc)]),_0x4eee2a='\x0a\x0a#\x20Ignore\x20local-only\x20directories\x0alocal/\x0asessions/\x0abug-bashes/\x0areports/\x0afeedback-images/\x0a\x0aactive-profile.txt\x0aactive-feature.txt\x0a.gitignore\x0a\x0a#\x20Ignore\x20plaintext\x20auth\x20files\x20(encrypted\x20.enc\x20files\x20are\x20safe\x20to\x20commit)\x0a**/auth.json\x0a';await writeFile(_0x3dde04,_0x4eee2a),console['log']('✓\x20Created\x20.ranger/.gitignore');}export async function ensureLocalEnv(_0x23ceaa,_0x2397eb){const _0x5a6f5f=_0x52ae,_0x317835={'Ohzjn':_0x5a6f5f(0x240),'yyQIk':_0x5a6f5f(0x214),'QqybU':function(_0x369639,_0x3416a4){return _0x369639===_0x3416a4;},'BWFXQ':function(_0x32217b,_0x4337b7,_0x324618){return _0x32217b(_0x4337b7,_0x324618);},'xoLRE':'local','dUhJg':_0x5a6f5f(0x216),'dlIdL':'\x0a❌\x20Profile\x20setup\x20failed:','JllgR':function(_0x413bf,_0x310054){return _0x413bf instanceof _0x310054;}};if(!findGitRoot()&&_0x23ceaa?.['scope']!==_0x317835['Ohzjn'])return console[_0x5a6f5f(0x20e)](_0x317835['yyQIk']),{'ready':![],'skipped':!![]};const _0x7f0b2f=_0x317835['QqybU'](_0x23ceaa?.['scope'],_0x5a6f5f(0x240))?getRangerHomeDir():undefined;if(_0x317835['BWFXQ'](findExistingEnv,'local',{'locations':[_0x317835['xoLRE']],'rangerDir':_0x7f0b2f}))return console['log'](_0x317835['dUhJg']),{'ready':!![],'skipped':![]};try{return await addEnv(_0x317835['xoLRE'],{'url':_0x23ceaa?.[_0x5a6f5f(0x245)],'force':_0x23ceaa?.[_0x5a6f5f(0x1ee)],'allowInsecureLocalhost':_0x23ceaa?.['allowInsecureLocalhost'],'scope':_0x23ceaa?.['scope']},_0x2397eb),{'ready':!![],'skipped':![]};}catch(_0x116f25){return console['error'](_0x317835['dlIdL'],_0x317835[_0x5a6f5f(0x1f6)](_0x116f25,Error)?_0x116f25['message']:_0x116f25),{'ready':![],'skipped':![]};}}export async function start(_0xc8be1f,_0x18d355,_0x2f946b){const _0x1399e5=_0x52ae,_0x437273={'XDSKD':function(_0x20d5cf,_0x426689){return _0x20d5cf!==_0x426689;},'NLCBV':_0x1399e5(0x240),'uGRqO':function(_0x3c6da1,_0x50358a){return _0x3c6da1+_0x50358a;},'mpjrm':function(_0x273454,_0x3e55ca){return _0x273454(_0x3e55ca);},'bQCXo':function(_0x43ea2a){return _0x43ea2a();},'eaASL':function(_0x42d353,_0x4d6252){return _0x42d353(_0x4d6252);},'MXYGz':'✓\x20Skipping\x20authentication\x20(--skip-auth)','nhgFT':_0x1399e5(0x21e),'dGaFo':function(_0x685258,_0x188b84){return _0x685258(_0x188b84);},'hdtlU':'chromium','SYxEt':_0x1399e5(0x213),'cjCCJ':_0x1399e5(0x243),'bPPYw':_0x1399e5(0x1f8),'HBvAk':function(_0x2af99c,_0x3b9f65,_0x3d3ba3){return _0x2af99c(_0x3b9f65,_0x3d3ba3);},'qyGFJ':'opencode','CvaPN':function(_0x41ce08,_0x351dd3){return _0x41ce08(_0x351dd3);},'SgdVE':function(_0x4fd6dc,_0x268714){return _0x4fd6dc+_0x268714;},'bJULT':'ranger\x20profile\x20add\x20<name>','wiIQA':'with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'};console[_0x1399e5(0x20e)]('\x0a🚀\x20Ranger\x20Setup\x0a');_0x18d355?.['scope']!==undefined&&_0x437273[_0x1399e5(0x209)](_0x18d355[_0x1399e5(0x233)],_0x437273[_0x1399e5(0x217)])&&(console[_0x1399e5(0x221)](_0x437273['uGRqO']('ranger\x20setup\x20--scope='+_0x437273['mpjrm'](String,_0x18d355['scope'])+_0x1399e5(0x212)+'Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20',_0x1399e5(0x237))),process['exit'](0x1));_0x18d355={..._0x18d355,'scope':_0x437273[_0x1399e5(0x217)]};const _0x2b6bd5=!existsSync(_0x437273['bQCXo'](getRangerHomeDir));await _0x437273[_0x1399e5(0x229)](ensureRangerDir,_0x437273[_0x1399e5(0x217)]);if(_0x18d355?.['skipAuth'])console['log'](_0x437273['MXYGz']),_0x2f946b?.[_0x1399e5(0x1f4)](_0x437273[_0x1399e5(0x1f7)],{'isFirstRun':_0x2b6bd5,'method':'skipped'});else{_0x2f946b?.['trackPhaseStart'](_0x437273['nhgFT']);const _0x25f074=await authenticate(_0xc8be1f);_0x2f946b?.[_0x1399e5(0x1f4)]('auth',{'isFirstRun':_0x2b6bd5,'method':_0x25f074['method']});}_0x2f946b?.[_0x1399e5(0x244)](_0x1399e5(0x210));_0x18d355?.[_0x1399e5(0x1ef)]?console[_0x1399e5(0x20e)]('✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)'):await _0x437273[_0x1399e5(0x22b)](ensureChromium,_0x18d355?.[_0x1399e5(0x1fe)]);_0x2f946b?.['trackPhaseEnd'](_0x437273[_0x1399e5(0x247)],{'isFirstRun':_0x2b6bd5,'skipped':!!_0x18d355?.[_0x1399e5(0x1ef)]}),console['log'](_0x437273[_0x1399e5(0x225)]);const _0x5cd509=_0x18d355?.[_0x1399e5(0x233)],_0x4299f1=_0x18d355?.['opencode']??![];let _0x4dc786=null;_0x4299f1?(_0x2f946b?.[_0x1399e5(0x244)](_0x437273['cjCCJ']),_0x4dc786=await _0x437273['eaASL'](ensureOpencodePluginConfig,_0x5cd509),_0x2f946b?.['trackPhaseEnd'](_0x437273['cjCCJ'],{'isFirstRun':_0x2b6bd5,'opencode':!![]})):(_0x2f946b?.[_0x1399e5(0x244)]('plugin'),await ensureClaudePlugin(_0x5cd509),_0x2f946b?.['trackPhaseEnd']('plugin',{'isFirstRun':_0x2b6bd5}));if(_0x4299f1&&_0x4dc786){_0x2f946b?.['trackPhaseStart'](_0x437273['bPPYw']);try{await _0x437273[_0x1399e5(0x1fb)](installSkill,'ranger',{'level':_0x4dc786['scope'],'cliVersion':getCurrentVersion(),'platform':_0x437273[_0x1399e5(0x1f0)]}),_0x2f946b?.['trackPhaseEnd'](_0x437273[_0x1399e5(0x234)],{'isFirstRun':_0x2b6bd5,'opencode':!![]});}catch(_0x3f5fff){console['warn'](_0x1399e5(0x22a),_0x3f5fff instanceof Error?_0x3f5fff[_0x1399e5(0x222)]:_0x3f5fff),_0x2f946b?.['trackPhaseEnd'](_0x1399e5(0x1f8),{'isFirstRun':_0x2b6bd5,'opencode':!![],'failed':!![]});}}else _0x2f946b?.[_0x1399e5(0x244)](_0x437273[_0x1399e5(0x234)]),await _0x437273[_0x1399e5(0x204)](ensureClaudeSkills,_0x5cd509),_0x2f946b?.[_0x1399e5(0x1f4)]('skills',{'isFirstRun':_0x2b6bd5});if(_0x18d355?.['skipAuth'])console[_0x1399e5(0x20e)](_0x1399e5(0x211));else{if(_0x18d355?.[_0x1399e5(0x245)]){_0x2f946b?.[_0x1399e5(0x244)](_0x1399e5(0x207));const _0x18b69a=await _0x437273[_0x1399e5(0x1fb)](ensureLocalEnv,{'url':_0x18d355[_0x1399e5(0x245)],'force':_0x18d355?.['force'],'allowInsecureLocalhost':_0x18d355?.[_0x1399e5(0x232)],'scope':'user'},_0x2f946b);_0x2f946b?.['trackPhaseEnd'](_0x1399e5(0x207),{'isFirstRun':_0x2b6bd5,'profileReady':_0x18b69a['ready'],'userSkipped':_0x18b69a[_0x1399e5(0x215)]});}else console['log'](_0x437273[_0x1399e5(0x248)](_0x437273[_0x1399e5(0x248)](_0x1399e5(0x20a)+('\x0a\x20\x20'+bold(_0x437273[_0x1399e5(0x242)]))+'\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)',_0x1399e5(0x201)),'\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles'));}if(_0x4299f1)console['log'](_0x1399e5(0x227)),console[_0x1399e5(0x20e)]('and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review'),console['log'](_0x437273[_0x1399e5(0x22f)]),console[_0x1399e5(0x20e)]('verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.');else{const _0x3eb060=bold('/ranger:enable');console[_0x1399e5(0x20e)](_0x437273['uGRqO'](_0x1399e5(0x20f)+_0x3eb060+'\x20and\x20prompt\x20the\x20coding'+'\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with',_0x1399e5(0x21a))+_0x1399e5(0x23c));}}
@@ -1 +1 @@
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)]('');}
1
+ const _0x22c896=_0x5ae1;(function(_0x1991cc,_0x3b201d){const _0x1c30c9=_0x5ae1,_0x236654=_0x1991cc();while(!![]){try{const _0x2d062c=parseInt(_0x1c30c9(0x1d1))/0x1*(parseInt(_0x1c30c9(0x1fc))/0x2)+-parseInt(_0x1c30c9(0x1d3))/0x3+parseInt(_0x1c30c9(0x1ed))/0x4+-parseInt(_0x1c30c9(0x1ea))/0x5*(parseInt(_0x1c30c9(0x1c9))/0x6)+-parseInt(_0x1c30c9(0x1da))/0x7+parseInt(_0x1c30c9(0x1f8))/0x8*(parseInt(_0x1c30c9(0x1df))/0x9)+parseInt(_0x1c30c9(0x213))/0xa*(parseInt(_0x1c30c9(0x20f))/0xb);if(_0x2d062c===_0x3b201d)break;else _0x236654['push'](_0x236654['shift']());}catch(_0x1e0b8f){_0x236654['push'](_0x236654['shift']());}}}(_0x55a9,0x9699e));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{listCloudProfiles}from'./utils/cloudProfile.js';import{getPluginInfo}from'./utils/claudePlugin.js';function _0x55a9(){const _0x148261=['\x0a---\x20Claude\x20Code\x20Plugin\x20---','\x20\x20\x20\x20Auth:\x20','1989204omjmkG','Root:\x20','KpLmb','env','\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','\x0a---\x20Profiles\x20---','not_installed','\x1b[0m','opencode','isActive','dQITu','568wYnmVs','settingsPath','TpaGM','all','676HkLEDG','\x20\x20Project-level:','ranger@trailhead','utf-8','zEBqA','BddMO','HHdzm','auth.json','aiCBD','\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a','configured','isArray','IYKYc','jKNJp','TFMEz','sessionUpdatedAt','stdout','user',':\x20installed\x20(','814qwTNqv','plaintext','\x20\x20Run:\x20ranger\x20update','API\x20Environment:\x20','193580ffyaFx','\x20\x20Not\x20configured','@ranger-testing/opencode-plugin','\x1b[1m','iGWcT','log','uQhEM','zBvmT','\x20\x20Run:\x20ranger\x20skillup','map','success','not_configured','stderr','VKAew','cwd','\x20\x20Run:\x20ranger\x20setup\x20[token]','includes','\x0a---\x20OpenCode\x20Plugin\x20---','path','filter','plugin',':\x20configured','XMZrI','details','string','\x20(active)','\x0a---\x20Skills\x20---','53166koMWMY','has','\x1b]8;;\x07','\x20\x20\x20\x20Session:\x20','displayName','length','PNAeT','ppTez','1106EvYcUE','DEBUG','2677209upVBMt','DSoYt','\x20local','\x20\x20\x20\x20','\x20(up\x20to\x20date)','\x20\x20Run:\x20ranger\x20setup\x20--opencode','FmtHG','5647845guiSaW','enabled','\x20\x20\x20\x20Settings:\x20','API\x20Token:\x20✗\x20Not\x20found','\x20[local]','17307ufwKNU','name','bjAGv','ATzuv','Version:\x20','No\x20skills\x20installed','oUusb','RUaic','(not\x20found)','status','opencode-plugin','70lARCkd'];_0x55a9=function(){return _0x148261;};return _0x55a9();}import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x4b1001=>_0x22c896(0x216)+_0x4b1001+_0x22c896(0x1f4),link=(_0x4b90cb,_0xac0c2a)=>'\x1b]8;;file://'+_0x4b90cb+'\x07'+(_0xac0c2a||_0x4b90cb)+_0x22c896(0x1cb);async function getOpencodePluginStatus(){const _0x495190=_0x22c896,_0x1893b4={'BddMO':function(_0x229c47,_0x264bfd){return _0x229c47(_0x264bfd);},'dQITu':'configured','zBvmT':function(_0x27e28e,_0x3b837f){return _0x27e28e>_0x3b837f;},'XMZrI':_0x495190(0x22b),'cUeZo':_0x495190(0x215),'UJpek':'debug','LBEff':'config','TpaGM':'ignore','aiCBD':'pipe','QwPSf':'data','jKNJp':'close'};return new Promise(_0x1f61c5=>{const _0x56d5ff=_0x495190,_0x483cda={'bjAGv':_0x1893b4[_0x56d5ff(0x229)],'dOcPZ':_0x1893b4['cUeZo']},_0x1d55c2=spawn(_0x56d5ff(0x1f5),[_0x1893b4['UJpek'],_0x1893b4['LBEff']],{'stdio':[_0x1893b4[_0x56d5ff(0x1fa)],_0x1893b4[_0x56d5ff(0x204)],_0x1893b4['aiCBD']]});let _0x47e359='';_0x1d55c2[_0x56d5ff(0x20c)]?.['on'](_0x1893b4['QwPSf'],_0x558bb5=>{_0x47e359+=_0x558bb5['toString']();}),_0x1d55c2[_0x56d5ff(0x21f)]?.['on'](_0x1893b4['QwPSf'],_0x38a0d5=>{_0x47e359+=_0x38a0d5['toString']();}),_0x1d55c2['on']('error',()=>{const _0x470d34=_0x56d5ff;_0x1f61c5({'status':_0x470d34(0x1f3)});}),_0x1d55c2['on'](_0x1893b4[_0x56d5ff(0x209)],_0x5b6d19=>{const _0x45ecd4=_0x56d5ff;if(_0x5b6d19!==0x0){_0x1893b4[_0x45ecd4(0x201)](_0x1f61c5,{'status':_0x45ecd4(0x1f3)});return;}const _0x9af332=_0x47e359['trim']();let _0xc2663a=null;if(_0x9af332)try{_0xc2663a=JSON['parse'](_0x9af332);}catch{const _0x3b05cc=_0x9af332['match'](/\{[\s\S]*\}$/);if(_0x3b05cc)try{_0xc2663a=JSON['parse'](_0x3b05cc[0x0]);}catch{_0xc2663a=null;}}const _0x72ebcc=Array[_0x45ecd4(0x207)](_0xc2663a?.['plugin'])?_0xc2663a?.[_0x45ecd4(0x227)]:[],_0x32ac4c=_0x72ebcc['some'](_0x922f78=>{const _0x5c7bd2=_0x45ecd4;if(typeof _0x922f78!==_0x483cda[_0x5c7bd2(0x1e1)])return![];return _0x922f78[_0x5c7bd2(0x223)](_0x483cda['dOcPZ'])||_0x922f78['includes'](_0x5c7bd2(0x1e9));});if(_0x32ac4c){_0x1f61c5({'status':_0x1893b4[_0x45ecd4(0x1f7)],'details':_0x72ebcc[_0x45ecd4(0x1ce)]>0x0?_0x72ebcc[_0x45ecd4(0x1ce)]+'\x20plugin(s)\x20configured':undefined});return;}if(_0x1893b4[_0x45ecd4(0x21a)](_0x72ebcc[_0x45ecd4(0x1ce)],0x0)){_0x1f61c5({'status':_0x45ecd4(0x21e),'details':_0x72ebcc[_0x45ecd4(0x1ce)]+'\x20plugin(s)\x20configured'});return;}_0x1f61c5({'status':'not_configured'});});});}async function getSkillsFromDir(_0x55dc7e,_0x359032){const _0x97c20f=_0x22c896,_0x2e8343={'uQhEM':function(_0x1e93b8,_0xafb512){return _0x1e93b8(_0xafb512);},'FmtHG':function(_0x3ee7ab,_0x3b4e47,_0xc7154e,_0x305315){return _0x3ee7ab(_0x3b4e47,_0xc7154e,_0x305315);},'ATzuv':'SKILL.md','rlSyg':function(_0x4aeea2,_0x4c0cb8,_0x271a0c){return _0x4aeea2(_0x4c0cb8,_0x271a0c);}};if(!_0x2e8343[_0x97c20f(0x219)](existsSync,_0x55dc7e))return[];const _0x143130=[];try{const _0xa00f6e=await readdir(_0x55dc7e,{'withFileTypes':!![]});for(const _0x43211a of _0xa00f6e){if(_0x43211a['isDirectory']()){const _0x4d0657=_0x2e8343[_0x97c20f(0x1d9)](join,_0x55dc7e,_0x43211a['name'],_0x2e8343[_0x97c20f(0x1e2)]);if(_0x2e8343['uQhEM'](existsSync,_0x4d0657)){let _0x12f01a=_0x43211a[_0x97c20f(0x1e0)];try{const _0x3d95bb=await _0x2e8343['rlSyg'](readFile,_0x4d0657,_0x97c20f(0x1ff)),_0x89adbc=_0x3d95bb['match'](/name:\s*(.+)/);_0x89adbc&&(_0x12f01a=_0x89adbc[0x1]['trim']());}catch{}_0x143130['push']({'name':_0x43211a[_0x97c20f(0x1e0)],'displayName':_0x12f01a,'path':_0x4d0657,'level':_0x359032});}}}}catch{return[];}return _0x143130;}async function getInstalledSkills(){const _0xbae091=_0x22c896,[_0x5d2353,_0x49ba3a]=await Promise[_0xbae091(0x1fb)]([getSkillsFromDir(getProjectSkillsDir(),'project'),getSkillsFromDir(getUserSkillsDir(),_0xbae091(0x20d))]);return{'project':_0x5d2353,'user':_0x49ba3a};}async function getEnvironments(){const _0x17ac22=_0x22c896,_0x303309={'BDzhn':function(_0x4728fb,_0x72fd63,_0x4d0bd6){return _0x4728fb(_0x72fd63,_0x4d0bd6);},'viiGj':_0x17ac22(0x203),'mJBJm':function(_0x1fd0f9,_0x507dde,_0xaf28c2){return _0x1fd0f9(_0x507dde,_0xaf28c2);},'zYtpv':'auth.json.enc','KpLmb':function(_0x879e86,_0x1deb52){return _0x879e86===_0x1deb52;},'KaNtD':function(_0x2ae701){return _0x2ae701();}},{envNames:_0x513d03,activeEnv:_0x110eea}=await _0x303309['KaNtD'](getEnvNames),_0x4f6c19=getRangerDir();if(!existsSync(_0x4f6c19))return{'envs':[],'activeEnv':null};const _0x2f02c2=_0x513d03[_0x17ac22(0x21c)](_0x286ea6=>{const _0x21f478=_0x17ac22,_0x2b57b9=getEnvDir(_0x286ea6),_0x5775d5=_0x303309['BDzhn'](join,_0x2b57b9,'settings.json'),_0x2944a9=_0x303309['BDzhn'](join,_0x2b57b9,_0x303309['viiGj']),_0x5058fa=_0x303309['mJBJm'](join,_0x2b57b9,_0x303309['zYtpv']);return{'name':_0x286ea6,'settingsPath':existsSync(_0x5775d5)?_0x5775d5:_0x21f478(0x1e7),'hasPlaintextAuth':existsSync(_0x2944a9),'hasEncryptedAuth':existsSync(_0x5058fa),'isActive':_0x303309[_0x21f478(0x1ef)](_0x286ea6,_0x110eea)};});return{'envs':_0x2f02c2,'activeEnv':_0x110eea};}function _0x5ae1(_0xabb67c,_0x534fc3){_0xabb67c=_0xabb67c-0x1c8;const _0x55a9e1=_0x55a9();let _0x5ae1d9=_0x55a9e1[_0xabb67c];return _0x5ae1d9;}export async function status(){const _0xd57bae=_0x22c896,_0xfbb3f9={'zEBqA':function(_0x6ffe15,_0x42ff89,_0x5c22f5){return _0x6ffe15(_0x42ff89,_0x5c22f5);},'ppTez':function(_0x59d203,_0x1fda2d){return _0x59d203(_0x1fda2d);},'DSoYt':function(_0x2fa9fc){return _0x2fa9fc();},'VKAew':function(_0x33c960){return _0x33c960();},'PNAeT':function(_0x56c6b0,_0x28df6a){return _0x56c6b0===_0x28df6a;},'TDrnU':'not_configured','ECHKE':function(_0x1608d6,_0x578977){return _0x1608d6(_0x578977);},'PNUrm':_0xd57bae(0x1db),'gERIN':function(_0x35ddae,_0x3b7e63){return _0x35ddae(_0x3b7e63);},'uGmWQ':function(_0x29350c,_0x368fd1){return _0x29350c+_0x368fd1;},'RUaic':_0xd57bae(0x1e4),'cHLlj':function(_0xc763c1,_0x6008ca){return _0xc763c1(_0x6008ca);},'FzAmQ':function(_0x32cbc7,_0x453307,_0x23ae32){return _0x32cbc7(_0x453307,_0x23ae32);},'HHdzm':function(_0x3fd41b,_0x2d4e90){return _0x3fd41b===_0x2d4e90;},'WzlTu':'No\x20profiles\x20configured','IYKYc':function(_0x54a16f,_0x4305df){return _0x54a16f>_0x4305df;},'oUusb':function(_0x3e06be,_0x38c4e5){return _0x3e06be(_0x38c4e5);},'TFMEz':'no\x20session','NLQsp':'none','grYmo':function(_0x168ae6,_0x37a914){return _0x168ae6(_0x37a914);},'hlpJa':function(_0x4f3e29,_0x243409){return _0x4f3e29!==_0x243409;},'iGWcT':_0xd57bae(0x1e7),'QCLnZ':function(_0x506777,_0x50e71e,_0x12fb0e){return _0x506777(_0x50e71e,_0x12fb0e);}};console[_0xd57bae(0x218)]('\x0a📊\x20Ranger\x20Status\x0a');const _0x4d3fed=process[_0xd57bae(0x221)](),_0x287bfd=getRangerDir();if(!existsSync(_0x287bfd)){console[_0xd57bae(0x218)](_0xd57bae(0x1ee)+_0xfbb3f9[_0xd57bae(0x200)](link,_0x4d3fed,_0xfbb3f9['ppTez'](bold,_0xfbb3f9[_0xd57bae(0x1d0)](basename,_0x4d3fed)))),console[_0xd57bae(0x218)]('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console['log'](_0xd57bae(0x205));return;}console[_0xd57bae(0x218)](_0xd57bae(0x1ee)+link(_0x4d3fed,bold(basename(_0x4d3fed))));const _0x56b43a=_0xfbb3f9['DSoYt'](getCurrentVersion),_0xe6b411=_0xfbb3f9[_0xd57bae(0x220)](getLatestVersion);if(_0xe6b411['version']&&_0xe6b411['version']!==_0x56b43a)console['log']('Version:\x20'+_0x56b43a+'\x20(latest:\x20'+_0xe6b411['version']+')'),console[_0xd57bae(0x218)](_0xd57bae(0x211));else _0xe6b411['version']?console[_0xd57bae(0x218)](_0xd57bae(0x1e3)+_0x56b43a+_0xd57bae(0x1d7)):console[_0xd57bae(0x218)](_0xd57bae(0x1e3)+_0x56b43a);const _0x144b83=await getToken();if(_0x144b83){const _0x5b6fa6=await _0xfbb3f9[_0xd57bae(0x1d0)](getCurrentUser,_0x144b83);_0x5b6fa6[_0xd57bae(0x21d)]?console['log']('Organization:\x20'+_0xfbb3f9[_0xd57bae(0x1d0)](bold,_0x5b6fa6['user']['organizationName'])):(console[_0xd57bae(0x218)]('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console[_0xd57bae(0x218)](_0xd57bae(0x222)));}else console[_0xd57bae(0x218)](_0xd57bae(0x1dd)),console[_0xd57bae(0x218)]('\x20\x20Run:\x20ranger\x20setup\x20[token]');process[_0xd57bae(0x1f0)][_0xd57bae(0x1d2)]&&(console['log'](_0xd57bae(0x212)+getCurrentEnvironment()),console[_0xd57bae(0x218)]('API\x20URL:\x20'+getApiBaseUrl()));console['log'](_0xd57bae(0x224));const _0x144168=await getOpencodePluginStatus();if(_0x144168[_0xd57bae(0x1e8)]===_0xd57bae(0x206))console['log']('\x20\x20'+_0xfbb3f9[_0xd57bae(0x1d0)](bold,_0xd57bae(0x215))+_0xd57bae(0x228)),_0x144168['details']&&console[_0xd57bae(0x218)]('\x20\x20'+_0x144168[_0xd57bae(0x22a)]);else _0xfbb3f9[_0xd57bae(0x1cf)](_0x144168['status'],_0xfbb3f9['TDrnU'])?(console['log'](_0xd57bae(0x214)),_0x144168['details']&&console['log']('\x20\x20'+_0x144168[_0xd57bae(0x22a)]),console['log'](_0xd57bae(0x1d8))):console[_0xd57bae(0x218)](_0xd57bae(0x1f1));console['log'](_0xd57bae(0x1eb));const _0x476c89=await _0xfbb3f9['ECHKE'](getPluginInfo,_0xd57bae(0x1fe));if(_0x476c89){const _0x2afc6b=_0x476c89['scope']||'unknown',_0x1cde91=_0x476c89[_0xd57bae(0x1db)]?_0xfbb3f9['PNUrm']:'disabled';console[_0xd57bae(0x218)]('\x20\x20'+_0xfbb3f9['gERIN'](bold,'ranger@trailhead')+_0xd57bae(0x20e)+_0x2afc6b+',\x20'+_0x1cde91+')');}else console['log']('\x20\x20Not\x20installed'),console[_0xd57bae(0x218)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)');console[_0xd57bae(0x218)](_0xd57bae(0x1c8));const {project:_0x87eb58,user:_0x58e8b1}=await getInstalledSkills(),_0x1be2c0=_0x87eb58['filter'](_0x5accbf=>RANGER_MANAGED_SKILLS['includes'](_0x5accbf[_0xd57bae(0x1e0)])),_0x561ec3=_0x58e8b1[_0xd57bae(0x226)](_0x13fdd1=>RANGER_MANAGED_SKILLS['includes'](_0x13fdd1['name'])),_0x57853d=_0xfbb3f9['uGmWQ'](_0x1be2c0['length'],_0x561ec3[_0xd57bae(0x1ce)]);if(_0x57853d===0x0)console['log'](_0xfbb3f9[_0xd57bae(0x1e6)]),console['log'](_0xd57bae(0x21b));else{if(_0x1be2c0['length']>0x0){console['log'](_0xd57bae(0x1fd));for(const _0x2923e8 of _0x1be2c0){console[_0xd57bae(0x218)](_0xd57bae(0x1d6)+_0xfbb3f9['cHLlj'](bold,_0x2923e8[_0xd57bae(0x1cd)])+':\x20'+link(_0x2923e8['path'],basename(_0x2923e8[_0xd57bae(0x225)])));}}if(_0x561ec3[_0xd57bae(0x1ce)]>0x0){console[_0xd57bae(0x218)]('\x20\x20User-level:');for(const _0x23a100 of _0x561ec3){console[_0xd57bae(0x218)]('\x20\x20\x20\x20'+bold(_0x23a100['displayName'])+':\x20'+_0xfbb3f9['FzAmQ'](link,_0x23a100['path'],_0xfbb3f9['cHLlj'](basename,_0x23a100['path'])));}}}console['log'](_0xd57bae(0x1f2));const {envs:_0xd0fd82,activeEnv:_0x320ffe}=await _0xfbb3f9[_0xd57bae(0x1d4)](getEnvironments);let _0xac0b21=[];if(_0x144b83)try{_0xac0b21=await listCloudProfiles();}catch{}const _0x39cff2=_0xd0fd82['length']+_0xac0b21[_0xd57bae(0x1ce)];if(_0xfbb3f9[_0xd57bae(0x202)](_0x39cff2,0x0))console['log'](_0xfbb3f9['WzlTu']),console[_0xd57bae(0x218)]('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{if(_0xfbb3f9[_0xd57bae(0x208)](_0x39cff2,0x5)){const _0x461f7b=[];_0xac0b21[_0xd57bae(0x1ce)]>0x0&&_0x461f7b['push'](_0xac0b21['length']+'\x20cloud'),_0xd0fd82[_0xd57bae(0x1ce)]>0x0&&_0x461f7b['push'](_0xd0fd82[_0xd57bae(0x1ce)]+_0xd57bae(0x1d5)),console['log'](_0x39cff2+'\x20profiles\x20configured\x20('+_0x461f7b['join'](',\x20')+')'),_0x320ffe&&console['log']('\x20\x20Active:\x20'+_0xfbb3f9[_0xd57bae(0x1e5)](bold,_0x320ffe)),console[_0xd57bae(0x218)]('\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)');}else{for(const _0x21c80b of _0xac0b21){const _0x3a53f1=_0xfbb3f9[_0xd57bae(0x1cf)](_0x21c80b['name'],_0x320ffe)?'\x20(active)':'';console[_0xd57bae(0x218)]('\x20\x20'+bold(_0x21c80b[_0xd57bae(0x1e0)])+'\x20[cloud]'+_0x3a53f1);const _0x25fc7a=_0x21c80b[_0xd57bae(0x20b)]?'cached\x20(updated\x20'+_0x21c80b[_0xd57bae(0x20b)]+')':_0xfbb3f9[_0xd57bae(0x20a)];console[_0xd57bae(0x218)](_0xd57bae(0x1cc)+_0x25fc7a);}const _0x596d34=new Set(_0xac0b21['map'](_0x335053=>_0x335053['name']));for(const _0x3ae49d of _0xd0fd82){if(_0x596d34[_0xd57bae(0x1ca)](_0x3ae49d['name']))continue;const _0x42e6df=_0x3ae49d[_0xd57bae(0x1f6)]?_0xd57bae(0x22c):'',_0x3ab753=_0x3ae49d['hasEncryptedAuth']?'encrypted':_0x3ae49d['hasPlaintextAuth']?_0xd57bae(0x210):_0xfbb3f9['NLQsp'];console[_0xd57bae(0x218)]('\x20\x20'+_0xfbb3f9['grYmo'](bold,_0x3ae49d['name'])+_0xd57bae(0x1de)+_0x42e6df),console['log'](_0xd57bae(0x1ec)+_0x3ab753),_0xfbb3f9['hlpJa'](_0x3ae49d[_0xd57bae(0x1f9)],_0xfbb3f9[_0xd57bae(0x217)])&&console[_0xd57bae(0x218)](_0xd57bae(0x1dc)+_0xfbb3f9['QCLnZ'](link,_0x3ae49d['settingsPath'],basename(_0x3ae49d['settingsPath'])));}if(!_0x320ffe){console['log']('\x0a\x20\x20No\x20active\x20profile\x20set');const _0x2a0200=[..._0xac0b21[_0xd57bae(0x21c)](_0x4ebc4a=>_0x4ebc4a['name']),..._0xd0fd82[_0xd57bae(0x226)](_0x574140=>!_0x596d34[_0xd57bae(0x1ca)](_0x574140[_0xd57bae(0x1e0)]))['map'](_0x5d91f8=>_0x5d91f8['name'])];console[_0xd57bae(0x218)]('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x2a0200['join'](',\x20')+')');}}}console[_0xd57bae(0x218)]('');}