@ranger-testing/ranger-cli 2.5.4-alpha.a70fc60-4 → 2.5.4-alpha.bc88254-5

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 (79) 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/env.js +1 -1
  7. package/build/commands/feature.js +1 -1
  8. package/build/commands/hook.js +1 -1
  9. package/build/commands/hooks/autoPrompt.js +1 -1
  10. package/build/commands/hooks/disable.js +1 -1
  11. package/build/commands/hooks/enable.js +1 -1
  12. package/build/commands/hooks/exitPlanMode.js +1 -1
  13. package/build/commands/hooks/index.js +1 -1
  14. package/build/commands/hooks/output.js +1 -1
  15. package/build/commands/hooks/planReminder.js +1 -1
  16. package/build/commands/hooks/planStart.js +1 -1
  17. package/build/commands/hooks/postEdit.js +1 -1
  18. package/build/commands/hooks/preCompact.js +1 -1
  19. package/build/commands/hooks/sessionEnd.js +1 -1
  20. package/build/commands/hooks/sessionStart.js +1 -1
  21. package/build/commands/hooks/stopHook.js +1 -1
  22. package/build/commands/index.js +1 -1
  23. package/build/commands/login.js +1 -1
  24. package/build/commands/mcpBootstrap.js +1 -1
  25. package/build/commands/migrateProfile.js +1 -1
  26. package/build/commands/setup/claude.js +1 -1
  27. package/build/commands/setup/opencode.js +1 -1
  28. package/build/commands/setupCi.js +1 -1
  29. package/build/commands/skillup.js +1 -1
  30. package/build/commands/start.js +1 -1
  31. package/build/commands/status.js +1 -1
  32. package/build/commands/update.js +1 -1
  33. package/build/commands/updateEnv.js +1 -1
  34. package/build/commands/useEnv.js +1 -1
  35. package/build/commands/utils/activeProfile.js +1 -1
  36. package/build/commands/utils/agentEnv.js +1 -1
  37. package/build/commands/utils/browserSessionsApi.js +1 -1
  38. package/build/commands/utils/claudeConfig.js +1 -1
  39. package/build/commands/utils/claudeOverrideSettings.js +1 -1
  40. package/build/commands/utils/claudePlugin.js +1 -1
  41. package/build/commands/utils/cloudProfile.js +1 -1
  42. package/build/commands/utils/cloudProfileSession.js +1 -1
  43. package/build/commands/utils/crypto.js +1 -1
  44. package/build/commands/utils/desirePathLog.js +1 -1
  45. package/build/commands/utils/deviceAuth.js +1 -1
  46. package/build/commands/utils/environment.js +1 -1
  47. package/build/commands/utils/featureApi.js +1 -1
  48. package/build/commands/utils/fixWebmDuration.js +1 -1
  49. package/build/commands/utils/gitTracked.js +1 -1
  50. package/build/commands/utils/keychain.js +1 -1
  51. package/build/commands/utils/localAgentInstallationsApi.js +1 -1
  52. package/build/commands/utils/matchAuthEnvironment.js +1 -1
  53. package/build/commands/utils/mcpImageBase64.js +1 -1
  54. package/build/commands/utils/model.js +1 -1
  55. package/build/commands/utils/opencodeConfig.js +1 -1
  56. package/build/commands/utils/playwrightCli.js +1 -1
  57. package/build/commands/utils/profileMessages.js +1 -1
  58. package/build/commands/utils/profileSetupBanner.js +1 -1
  59. package/build/commands/utils/projectsConfig.js +1 -1
  60. package/build/commands/utils/rangerConfig.js +1 -1
  61. package/build/commands/utils/rangerRoot.js +1 -1
  62. package/build/commands/utils/resolveProfileContext.js +1 -1
  63. package/build/commands/utils/resolveProfileUrl.js +1 -1
  64. package/build/commands/utils/retry.js +1 -1
  65. package/build/commands/utils/sessionCache.js +1 -1
  66. package/build/commands/utils/settings.js +1 -1
  67. package/build/commands/utils/skillContent.js +1 -1
  68. package/build/commands/utils/skills.js +1 -1
  69. package/build/commands/utils/stitchWebmFiles.js +1 -1
  70. package/build/commands/utils/telemetry.js +1 -1
  71. package/build/commands/utils/tokenRefresh.js +1 -1
  72. package/build/commands/utils/traceSnapshotMapper.js +1 -1
  73. package/build/commands/utils/userApi.js +1 -1
  74. package/build/commands/utils/version.js +1 -1
  75. package/build/commands/verifyFeature.js +1 -1
  76. package/build/commands/verifyFeatureCli.js +1 -1
  77. package/build/skills/ranger/SKILL.md +4 -3
  78. package/build/skills/ranger/verify.md +15 -3
  79. package/package.json +1 -1
@@ -1 +1 @@
1
- function _0xcbe0(_0x58c7a9,_0x2295bb){_0x58c7a9=_0x58c7a9-0x90;const _0x4cf07a=_0x4cf0();let _0xcbe072=_0x4cf07a[_0x58c7a9];return _0xcbe072;}const _0x391073=_0xcbe0;(function(_0x233b86,_0x15ba89){const _0x8a1d7a=_0xcbe0,_0x25002e=_0x233b86();while(!![]){try{const _0x51e156=-parseInt(_0x8a1d7a(0xef))/0x1*(parseInt(_0x8a1d7a(0xba))/0x2)+-parseInt(_0x8a1d7a(0xa9))/0x3+-parseInt(_0x8a1d7a(0x9d))/0x4+-parseInt(_0x8a1d7a(0xae))/0x5*(parseInt(_0x8a1d7a(0xd2))/0x6)+parseInt(_0x8a1d7a(0xc0))/0x7*(-parseInt(_0x8a1d7a(0xa4))/0x8)+parseInt(_0x8a1d7a(0xfd))/0x9+parseInt(_0x8a1d7a(0x102))/0xa;if(_0x51e156===_0x15ba89)break;else _0x25002e['push'](_0x25002e['shift']());}catch(_0x1686cc){_0x25002e['push'](_0x25002e['shift']());}}}(_0x4cf0,0xcf611));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),_0x391073(0xfb),'mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),'.ranger',_0x391073(0xb4));export async function getMcpAuthOrigin(){const _0x24f43a=_0x391073,_0x2599df={'sDWtc':_0x24f43a(0xbb)};try{const _0x59dac6=(await readFile(AUTH_ORIGIN_PATH,_0x2599df['sDWtc']))['trim']();return _0x59dac6||null;}catch{return null;}}export async function mcpBootstrap(){const _0x4ffc58=_0x391073,_0xe7771b={'xfzcX':function(_0x529028){return _0x529028();},'yYILu':_0x4ffc58(0xb8),'BumzN':function(_0x297e59,_0x276e2c){return _0x297e59+_0x276e2c;},'bkjJh':_0x4ffc58(0xc4),'uyDgz':function(_0x1ccdc9,_0x5903c5){return _0x1ccdc9(_0x5903c5);},'CduhE':function(_0x43a92c,_0x370131,_0x2b5bcf){return _0x43a92c(_0x370131,_0x2b5bcf);}},_0xb0e1a1=_0xe7771b['xfzcX'](getMcpAuthUrl);currentOrigin=_0xb0e1a1;const _0x27bae7=process[_0x4ffc58(0x100)]['isTTY']??![];console['log'](_0x4ffc58(0xe3)+_0xb0e1a1+'\x0a');const _0x48a5fe=await tryUnauthenticated(_0xb0e1a1);let _0x2c19a1=null;if(_0x48a5fe===_0xe7771b['yYILu'])_0x2c19a1='';else{_0x2c19a1=await loadCachedToken();if(!_0x2c19a1){if(!_0x27bae7)throw new Error(_0xe7771b['BumzN'](_0x4ffc58(0xf7),_0xe7771b[_0x4ffc58(0xaf)]));_0x2c19a1=await _0xe7771b[_0x4ffc58(0x104)](oauthFlow,_0xb0e1a1);}}await _0xe7771b[_0x4ffc58(0x9e)](callGetCliToken,_0xb0e1a1,_0x2c19a1);}async function tryUnauthenticated(_0x87b3a5){const _0xb32990=_0x391073,_0x59bea6={'jlpMV':function(_0x54c6f9,_0x39fae6,_0x1bb04b){return _0x54c6f9(_0x39fae6,_0x1bb04b);},'xtqdi':'POST','vorwr':'application/json','MEPLN':_0xb32990(0xe5),'RANtW':'2025-03-26','CfouD':_0xb32990(0xa0)},_0x5d028a=await _0x59bea6['jlpMV'](fetch,_0x87b3a5,{'method':_0x59bea6['xtqdi'],'headers':{'Content-Type':_0x59bea6[_0xb32990(0x105)],'Accept':_0xb32990(0xe0)},'body':JSON[_0xb32990(0x113)]({'jsonrpc':_0x59bea6['MEPLN'],'id':0x1,'method':_0xb32990(0xde),'params':{'protocolVersion':_0x59bea6[_0xb32990(0x98)],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0xb32990(0xff)}}})});if(_0x5d028a['ok'])return await _0x5d028a['text'](),_0xb32990(0xb8);if(_0x5d028a[_0xb32990(0x9c)]===0x191)return await _0x5d028a[_0xb32990(0x111)](),_0x59bea6[_0xb32990(0x95)];const _0x513269=await _0x5d028a['text']();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x5d028a['status']+':\x20'+_0x513269);}class OAuthTimeoutError extends Error{constructor(_0x6911eb){const _0x560e6c={'yMlaz':'OAuthTimeoutError'};super(_0x6911eb),this['name']=_0x560e6c['yMlaz'];}}async function oauthFlow(_0x40b77d){const _0x3fa914=_0x391073,_0x3c94b9={'LnVez':function(_0x5e9276,_0x4f8f0e){return _0x5e9276(_0x4f8f0e);},'rUSaV':function(_0x9816a0,_0x1e9b8c){return _0x9816a0 instanceof _0x1e9b8c;}};try{return await _0x3c94b9['LnVez'](oauthFlowAttempt,_0x40b77d);}catch(_0x48e66a){if(_0x3c94b9['rUSaV'](_0x48e66a,OAuthTimeoutError)&&await loadCachedClient())return console[_0x3fa914(0xb2)](_0x3fa914(0x118)),await clearCachedClient(),await _0x3c94b9['LnVez'](oauthFlowAttempt,_0x40b77d);throw _0x48e66a;}}async function oauthFlowAttempt(_0x4e2b59){const _0x459f2b=_0x391073,_0x1360ac={'bYXJT':function(_0x49c850,_0x52895c){return _0x49c850(_0x52895c);},'hZOMf':'No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','JupIa':function(_0x44a764){return _0x44a764();},'Cebaw':'Registering\x20OAuth\x20client...','eBqcc':function(_0x3adb5e,_0x3b8b1b,_0x5ae985){return _0x3adb5e(_0x3b8b1b,_0x5ae985);},'zRWPv':'application/json','bTORP':'authorization_code','xHuhy':'refresh_token','bsmPW':'code','OdyOs':'none','DuAxT':'Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','ReCiw':function(_0x4d1d71,_0x7595e3){return _0x4d1d71(_0x7595e3);},'OdBBW':'base64url','mvMVv':_0x459f2b(0x117),'kwhvJ':'response_type','RbtVK':_0x459f2b(0x107),'bOIBQ':_0x459f2b(0xd9),'ZDWrX':_0x459f2b(0x109),'KVRRY':'resource','CkXHB':'\x0aOpening\x20browser\x20for\x20authentication...','vyIrY':function(_0x41227b,_0x55e936){return _0x41227b(_0x55e936);},'ELVRb':_0x459f2b(0xda),'DXXqF':'POST','qVKGp':_0x459f2b(0xf5)},_0x55ba5c=_0x4e2b59['replace'](/\/mcp$/,'');process['stdout'][_0x459f2b(0xab)](_0x459f2b(0x10e));const _0x4e82a6=await _0x1360ac['bYXJT'](fetch,_0x55ba5c+'/.well-known/oauth-protected-resource');if(!_0x4e82a6['ok'])throw new Error('Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server');const _0x236442=await _0x4e82a6['json'](),_0x2c08b1=_0x236442['authorization_servers']?.[0x0];if(!_0x2c08b1)throw new Error(_0x1360ac[_0x459f2b(0xad)]);console['log']('\x20'+_0x2c08b1);const _0x2464a5=await _0x1360ac[_0x459f2b(0x96)](fetchAuthServerMetadata,_0x2c08b1);let _0x214a9c,_0x5c2b8f;const _0x4c4085=await _0x1360ac['JupIa'](loadCachedClient);if(_0x4c4085)_0x214a9c=_0x4c4085[_0x459f2b(0x11b)],_0x5c2b8f=_0x4c4085['clientSecret'];else{if(_0x2464a5['registration_endpoint']){process[_0x459f2b(0x100)][_0x459f2b(0xab)](_0x1360ac['Cebaw']);const _0x16f3e6=await _0x1360ac['eBqcc'](fetch,_0x2464a5[_0x459f2b(0xeb)],{'method':_0x459f2b(0xc8),'headers':{'Content-Type':_0x1360ac[_0x459f2b(0x110)]},'body':JSON[_0x459f2b(0x113)]({'client_name':_0x459f2b(0xb1),'redirect_uris':['http://localhost:'+CALLBACK_PORT+_0x459f2b(0xd1)],'grant_types':[_0x1360ac[_0x459f2b(0xac)],_0x1360ac[_0x459f2b(0xe1)]],'response_types':[_0x1360ac[_0x459f2b(0xc1)]],'token_endpoint_auth_method':_0x1360ac[_0x459f2b(0x99)]})});if(!_0x16f3e6['ok']){const _0x482c50=await _0x16f3e6['text']();throw new Error(_0x459f2b(0x120)+_0x482c50);}const _0x38847b=await _0x16f3e6['json']();_0x214a9c=_0x38847b[_0x459f2b(0x115)],_0x5c2b8f=_0x38847b[_0x459f2b(0xda)],await _0x1360ac[_0x459f2b(0xb3)](saveCachedClient,_0x214a9c,_0x5c2b8f),console['log']('\x20done');}else throw new Error(_0x1360ac[_0x459f2b(0xc7)]);}const _0x3ba211=_0x1360ac['ReCiw'](randomBytes,0x20)[_0x459f2b(0xb0)](_0x1360ac['OdBBW']),_0xc4216=_0x1360ac['ReCiw'](createHash,_0x1360ac[_0x459f2b(0xa7)])[_0x459f2b(0x91)](_0x3ba211)['digest'](_0x459f2b(0xc5)),_0x3f3e03=randomBytes(0x10)[_0x459f2b(0xb0)]('hex'),_0x163eb5=new URL(_0x2464a5[_0x459f2b(0xb5)]);_0x163eb5['searchParams'][_0x459f2b(0x11e)](_0x1360ac[_0x459f2b(0x97)],_0x459f2b(0xd8)),_0x163eb5[_0x459f2b(0x11d)][_0x459f2b(0x11e)](_0x459f2b(0x115),_0x214a9c),_0x163eb5[_0x459f2b(0x11d)]['set'](_0x1360ac[_0x459f2b(0xce)],'http://localhost:'+CALLBACK_PORT+_0x459f2b(0xd1)),_0x163eb5['searchParams']['set'](_0x1360ac['bOIBQ'],_0xc4216),_0x163eb5[_0x459f2b(0x11d)][_0x459f2b(0x11e)](_0x1360ac['ZDWrX'],'S256'),_0x163eb5['searchParams']['set'](_0x459f2b(0x101),_0x3f3e03);_0x236442['resource']&&_0x163eb5[_0x459f2b(0x11d)]['set'](_0x1360ac[_0x459f2b(0xcd)],_0x236442['resource']);console['log'](_0x1360ac['CkXHB']),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x163eb5[_0x459f2b(0xb0)]()+'\x0a'),await _0x1360ac[_0x459f2b(0xf2)](openBrowser,_0x163eb5[_0x459f2b(0xb0)]());const _0x5d881f=await _0x1360ac['bYXJT'](waitForCallback,_0x3f3e03);process['stdout'][_0x459f2b(0xab)]('Exchanging\x20authorization\x20code...');const _0x420d1c=new URLSearchParams({'grant_type':_0x1360ac['bTORP'],'code':_0x5d881f,'redirect_uri':_0x459f2b(0xaa)+CALLBACK_PORT+_0x459f2b(0xd1),'client_id':_0x214a9c,'code_verifier':_0x3ba211});_0x5c2b8f&&_0x420d1c[_0x459f2b(0x11e)](_0x1360ac['ELVRb'],_0x5c2b8f);_0x236442['resource']&&_0x420d1c[_0x459f2b(0x11e)](_0x1360ac[_0x459f2b(0xcd)],_0x236442[_0x459f2b(0xf0)]);const _0xc24f2e=await _0x1360ac['eBqcc'](fetch,_0x2464a5[_0x459f2b(0xc2)],{'method':_0x1360ac[_0x459f2b(0xbe)],'headers':{'Content-Type':_0x1360ac[_0x459f2b(0x9a)]},'body':_0x420d1c});if(!_0xc24f2e['ok']){const _0x30cf78=await _0xc24f2e['text']();throw new Error('Token\x20exchange\x20failed:\x20'+_0x30cf78);}const _0x35ae8e=await _0xc24f2e['json']();return console['log'](_0x459f2b(0xdf)),await saveCachedToken(_0x35ae8e[_0x459f2b(0xd3)],_0x35ae8e[_0x459f2b(0xd4)],_0x35ae8e[_0x459f2b(0xf4)]),_0x35ae8e['access_token'];}async function callGetCliToken(_0x45b657,_0x434dfd){const _0x595b87=_0x391073,_0x3e7857={'dvzZf':_0x595b87(0xc8),'qNVuQ':function(_0x52a4cf,_0x153aff){return _0x52a4cf(_0x153aff);},'UkUlD':'application/json','jtijU':_0x595b87(0x94),'bAche':function(_0x218533,_0x2e5e18){return _0x218533(_0x2e5e18);},'XmeCB':'2.0','NGEDm':_0x595b87(0xfc),'XPlhh':function(_0xa5fdd5,_0x387277,_0x30cc71){return _0xa5fdd5(_0x387277,_0x30cc71);},'rekBv':'notifications/initialized','xQIdW':function(_0x1723a3,_0x9ff7bb){return _0x1723a3(_0x9ff7bb);},'JfVjD':'\x20done','OdjFZ':'Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','pKSZd':'refresh.txt','UFiSz':function(_0xd39f6f,_0x3212da,_0x553761,_0x267342){return _0xd39f6f(_0x3212da,_0x553761,_0x267342);},'ZoLYc':'auth-origin.txt'},_0x32077d={'Content-Type':_0x3e7857['UkUlD'],'Accept':_0x595b87(0xe0)};_0x434dfd&&(_0x32077d[_0x595b87(0xd7)]=_0x595b87(0xdc)+_0x434dfd);const _0xe9d8e7=async _0x5d3fdf=>{const _0x4f74be=_0x595b87,_0x23eac7=await fetch(_0x45b657,{'method':_0x3e7857['dvzZf'],'headers':_0x32077d,'body':JSON[_0x4f74be(0x113)](_0x5d3fdf)});if(!_0x23eac7['ok']){const _0x29d0cd=await _0x23eac7[_0x4f74be(0x111)]();throw new Error('HTTP\x20'+_0x23eac7['status']+':\x20'+_0x29d0cd);}return _0x3e7857['qNVuQ'](parseResponse,_0x23eac7);};process[_0x595b87(0x100)]['write'](_0x3e7857[_0x595b87(0xe7)]);const _0x51103a=await _0x3e7857['bAche'](_0xe9d8e7,{'jsonrpc':_0x3e7857[_0x595b87(0x121)],'id':0x1,'method':'initialize','params':{'protocolVersion':_0x3e7857['NGEDm'],'capabilities':{},'clientInfo':{'name':_0x595b87(0xe4),'version':_0x595b87(0xff)}}});if(_0x51103a['error'])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x51103a['error'][_0x595b87(0xc6)]??JSON['stringify'](_0x51103a[_0x595b87(0x103)])));console['log'](_0x595b87(0xdf)),await _0x3e7857['XPlhh'](fetch,_0x45b657,{'method':'POST','headers':_0x32077d,'body':JSON[_0x595b87(0x113)]({'jsonrpc':_0x595b87(0xe5),'method':_0x3e7857[_0x595b87(0xc3)]})})['then'](_0x36bdb0=>_0x36bdb0['text']()),process['stdout']['write']('Requesting\x20CLI\x20token...');const _0x186bd6=await _0x3e7857[_0x595b87(0xbd)](_0xe9d8e7,{'jsonrpc':_0x595b87(0xe5),'id':0x2,'method':'tools/call','params':{'name':'get_cli_token','arguments':{}}});if(_0x186bd6[_0x595b87(0x103)])throw new Error('get_cli_token\x20failed:\x20'+(_0x186bd6[_0x595b87(0x103)][_0x595b87(0xc6)]??JSON[_0x595b87(0x113)](_0x186bd6['error'])));console['log'](_0x3e7857['JfVjD']);const _0x134d8b=_0x3e7857['bAche'](extractToken,_0x186bd6[_0x595b87(0xf6)]);if(!_0x134d8b){console['error'](_0x595b87(0xcb)),console['error'](JSON[_0x595b87(0x113)](_0x186bd6[_0x595b87(0xf6)],null,0x2));throw new Error(_0x3e7857['OdjFZ']);}const _0x456b81=_0x3e7857['XPlhh'](join,homedir(),_0x595b87(0xfb)),_0x380207=_0x3e7857['XPlhh'](join,_0x456b81,_0x3e7857[_0x595b87(0xa5)]);await _0x3e7857['XPlhh'](mkdir,_0x456b81,{'recursive':!![]}),await writeFile(_0x380207,_0x134d8b,{'mode':0x180}),await _0x3e7857[_0x595b87(0xa3)](writeFile,_0x3e7857['XPlhh'](join,_0x456b81,_0x3e7857[_0x595b87(0xb9)]),_0x45b657,{'mode':0x180}),console[_0x595b87(0xb2)]('\x0aToken\x20written\x20to\x20'+_0x380207),console['log'](_0x595b87(0x11a));}async function fetchAuthServerMetadata(_0x138fd4){const _0x43d840=_0x391073,_0x5c6ebd=_0x138fd4+_0x43d840(0xf8),_0x7eab1b=await fetch(_0x5c6ebd);if(!_0x7eab1b['ok'])throw new Error(_0x43d840(0x106)+_0x5c6ebd+':\x20'+_0x7eab1b['status']);return _0x7eab1b[_0x43d840(0xee)]();}function waitForCallback(_0x2fe31d){const _0x320c45=_0x391073,_0xb8a446={'UBvTr':_0x320c45(0xa2),'TOKKK':_0x320c45(0x123),'cNsWk':function(_0x37d997,_0x3c9094){return _0x37d997!==_0x3c9094;},'pHFbG':'text/html'};return new Promise((_0x3a6e5a,_0xeac951)=>{const _0x20d76c=_0x320c45,_0x400f6d={'HdoMU':_0xb8a446[_0x20d76c(0x108)],'bfmXZ':_0x20d76c(0x103),'EqHsg':function(_0x3ce39e,_0x4f4b25){return _0x3ce39e(_0x4f4b25);},'Onjmx':function(_0x1a326f,_0x1fceb3){return _0xb8a446['cNsWk'](_0x1a326f,_0x1fceb3);},'JQlyN':_0xb8a446[_0x20d76c(0x10f)]},_0xda7d1a=setTimeout(()=>{const _0x52105b=_0x20d76c;_0xfea2ee[_0x52105b(0xe2)](),_0xeac951(new OAuthTimeoutError(_0xb8a446[_0x52105b(0xd6)]));},0x1d4c0),_0xfea2ee=createServer((_0x4979f0,_0xb58ae7)=>{const _0x39a93f=_0x20d76c,_0x118e4a=new URL(_0x4979f0['url']??'/','http://localhost:'+CALLBACK_PORT);if(_0x118e4a['pathname']!=='/callback'){_0xb58ae7[_0x39a93f(0xe8)](0x194),_0xb58ae7['end'](_0x400f6d[_0x39a93f(0x93)]);return;}const _0x5f083c=_0x118e4a[_0x39a93f(0x11d)][_0x39a93f(0x116)]('code'),_0x114042=_0x118e4a[_0x39a93f(0x11d)]['get']('state'),_0x3457e1=_0x118e4a[_0x39a93f(0x11d)][_0x39a93f(0x116)](_0x400f6d[_0x39a93f(0xb6)]);if(_0x3457e1){const _0x5e2cc0=_0x118e4a[_0x39a93f(0x11d)]['get']('error_description')??_0x3457e1;_0xb58ae7['writeHead'](0xc8,{'Content-Type':'text/html'}),_0xb58ae7[_0x39a93f(0x10a)](_0x39a93f(0x11c)+_0x5e2cc0+_0x39a93f(0xea)),clearTimeout(_0xda7d1a),_0xfea2ee['close'](),_0x400f6d[_0x39a93f(0xfa)](_0xeac951,new Error('OAuth\x20error:\x20'+_0x5e2cc0));return;}if(!_0x5f083c||_0x400f6d['Onjmx'](_0x114042,_0x2fe31d)){_0xb58ae7[_0x39a93f(0xe8)](0x190,{'Content-Type':_0x400f6d[_0x39a93f(0xe9)]}),_0xb58ae7['end']('<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>');return;}_0xb58ae7['writeHead'](0xc8,{'Content-Type':_0x400f6d[_0x39a93f(0xe9)]}),_0xb58ae7[_0x39a93f(0x10a)]('<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>'),_0x400f6d['EqHsg'](clearTimeout,_0xda7d1a),_0xfea2ee[_0x39a93f(0xe2)](),_0x3a6e5a(_0x5f083c);});_0xfea2ee[_0x20d76c(0xc9)](CALLBACK_PORT,'127.0.0.1');});}async function openBrowser(_0x1ec832){const _0x343f76=_0x391073,_0x2e8b8f={'RRZnP':'child_process','eNYSU':'start','FPwdA':function(_0x5d807f,_0x41ed48){return _0x5d807f(_0x41ed48);}},{exec:_0x10c016}=await import(_0x2e8b8f[_0x343f76(0xed)]),_0x1c73aa=process['platform']==='darwin'?_0x343f76(0xf3):process[_0x343f76(0x90)]==='win32'?_0x2e8b8f[_0x343f76(0x9f)]:_0x343f76(0x122);_0x2e8b8f['FPwdA'](_0x10c016,_0x1c73aa+'\x20\x22'+_0x1ec832+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x5d06d1=_0x391073,_0x4b5b40={'lkUlS':function(_0x566509,_0x309643){return _0x566509!==_0x309643;},'XMvjH':function(_0x11caeb,_0x35809b){return _0x11caeb>_0x35809b;}};try{const _0x528502=JSON[_0x5d06d1(0xec)](await readFile(TOKEN_CACHE_PATH,'utf-8'));if(_0x528502['origin']&&_0x4b5b40[_0x5d06d1(0x112)](_0x528502[_0x5d06d1(0x92)],currentOrigin))return null;if(_0x528502[_0x5d06d1(0xdd)]&&_0x4b5b40['XMvjH'](Date['now'](),_0x528502[_0x5d06d1(0xdd)]))return null;return _0x528502[_0x5d06d1(0xf9)]??null;}catch{return null;}}async function saveCachedToken(_0x1ae3c2,_0x3fdb2e,_0x5672ef){const _0x473d66=_0x391073,_0x5d1e37={'vRVNW':function(_0x240cb9){return _0x240cb9();},'VCHzS':function(_0x2b64d8,_0x568654,_0x35a309){return _0x2b64d8(_0x568654,_0x35a309);},'GAJAK':function(_0x1e6e0d,_0x3820f5,_0x422f34){return _0x1e6e0d(_0x3820f5,_0x422f34);},'QWvpI':function(_0x5a2322){return _0x5a2322();},'UYKnx':function(_0x548c20,_0x81bf86,_0x29841e,_0x274f63){return _0x548c20(_0x81bf86,_0x29841e,_0x274f63);}},_0x498869=await _0x5d1e37[_0x473d66(0x9b)](loadCachedData),_0x4a6a7f={..._0x498869,'origin':currentOrigin,'accessToken':_0x1ae3c2,'refreshToken':_0x3fdb2e??_0x498869?.[_0x473d66(0xa6)],'expiresAt':_0x5672ef?Date[_0x473d66(0xdb)]()+_0x5672ef*0x3e8:undefined};await _0x5d1e37['VCHzS'](mkdir,_0x5d1e37[_0x473d66(0xe6)](join,_0x5d1e37['QWvpI'](homedir),'.ranger'),{'recursive':!![]}),await _0x5d1e37['UYKnx'](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x4a6a7f),{'mode':0x180});}async function loadCachedClient(){const _0x6bf70b=_0x391073,_0x41395a={'BJQJJ':function(_0x61faf6,_0xdbea2f){return _0x61faf6!==_0xdbea2f;}},_0xb52d87=await loadCachedData();if(_0xb52d87?.['origin']&&_0x41395a['BJQJJ'](_0xb52d87['origin'],currentOrigin))return null;return _0xb52d87?.[_0x6bf70b(0x11b)]?{'clientId':_0xb52d87['clientId'],'clientSecret':_0xb52d87['clientSecret']}:null;}async function clearCachedClient(){const _0x2aeb14=_0x391073,_0xe3538b={'zuJGh':function(_0x337222){return _0x337222();}},_0x2e2c5f=await _0xe3538b[_0x2aeb14(0xbc)](loadCachedData);if(!_0x2e2c5f)return;const {clientId:_0x4c2f3d,clientSecret:_0x2b732f,..._0x421b67}=_0x2e2c5f;await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x421b67),{'mode':0x180});}async function saveCachedClient(_0x553ffa,_0x5140e5){const _0x41c635=_0x391073,_0x574fee={'xhugZ':'.ranger'},_0x17a176=await loadCachedData(),_0x2a87ed={..._0x17a176,'origin':currentOrigin,'accessToken':_0x17a176?.['accessToken']??'','clientId':_0x553ffa,'clientSecret':_0x5140e5};await mkdir(join(homedir(),_0x574fee[_0x41c635(0x119)]),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x2a87ed),{'mode':0x180});}function _0x4cf0(){const _0x290a53=['14610609PAliYX','match','1.0.0','stdout','state','25384880GIwJqU','error','uyDgz','vorwr','Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20','redirect_uri','TOKKK','code_challenge_method','end','jyqxT','KLpqz','string','Discovering\x20authorization\x20server...','pHFbG','zRWPv','text','lkUlS','stringify','content-type','client_id','get','sha256','\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','xhugZ','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','clientId','<html><body><h2>Authentication\x20failed</h2><p>','searchParams','set','startsWith','Client\x20registration\x20failed:\x20','XmeCB','xdg-open','Not\x20found','platform','update','origin','HdoMU','Initializing\x20MCP\x20session...','CfouD','bYXJT','kwhvJ','RANtW','OdyOs','qVKGp','vRVNW','status','4855356DpbGql','CduhE','eNYSU','needs-oauth','token','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','UFiSz','8UjyPOq','pKSZd','refreshToken','mvMVv','Server\x20returned\x20error:\x20','535953PJJarH','http://localhost:','write','bTORP','hZOMf','5TfsGev','bkjJh','toString','Ranger\x20CLI','log','eBqcc','auth-origin.txt','authorization_endpoint','bfmXZ','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','proxied','ZoLYc','8jzextT','utf-8','zuJGh','xQIdW','DXXqF','split','4397827FatJJg','bsmPW','token_endpoint','rekBv','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','base64url','message','DuAxT','POST','listen','content','\x0aUnexpected\x20response\x20structure:','MTReb','KVRRY','RbtVK','slice','isError','/callback','2134854cUHsvn','access_token','refresh_token','data:','UBvTr','Authorization','code','code_challenge','client_secret','now','Bearer\x20','expiresAt','initialize','\x20done','application/json,\x20text/event-stream','xHuhy','close','\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20','ranger-cli','2.0','GAJAK','jtijU','writeHead','JQlyN','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','registration_endpoint','parse','RRZnP','json','233976yrozCQ','resource','type','vyIrY','open','expires_in','application/x-www-form-urlencoded','result','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','/.well-known/oauth-authorization-server','accessToken','EqHsg','.ranger','2025-03-26'];_0x4cf0=function(){return _0x290a53;};return _0x4cf0();}async function loadCachedData(){const _0x517265=_0x391073;try{return JSON['parse'](await readFile(TOKEN_CACHE_PATH,_0x517265(0xbb)));}catch{return null;}}async function parseResponse(_0x4a63d5){const _0x304359=_0x391073,_0x4abc3e={'qAVgU':_0x304359(0x114),'lWaNy':_0x304359(0xb7)},_0x193440=_0x4a63d5['headers']['get'](_0x4abc3e['qAVgU'])??'';if(_0x193440['includes']('text/event-stream')){const _0x4222b9=await _0x4a63d5['text']();for(const _0x26ecd9 of _0x4222b9[_0x304359(0xbf)]('\x0a')){const _0x3224d2=_0x26ecd9['trim']();if(_0x3224d2[_0x304359(0x11f)]('data:')){const _0xe3d530=_0x3224d2[_0x304359(0xcf)](_0x304359(0xd5)['length'])['trim']();if(!_0xe3d530)continue;try{const _0x1763c1=JSON['parse'](_0xe3d530);if(_0x1763c1['id']!==undefined||_0x1763c1[_0x304359(0x103)])return _0x1763c1;}catch{}}}throw new Error(_0x4abc3e['lWaNy']);}return _0x4a63d5[_0x304359(0xee)]();}function extractToken(_0x2f34f4){const _0x2ad4c0=_0x391073,_0x380156={'MTReb':_0x2ad4c0(0x10d),'KLpqz':'Unknown\x20error','jyqxT':_0x2ad4c0(0x111),'oGPBa':function(_0x529f77,_0x51f59d){return _0x529f77===_0x51f59d;}};if(!_0x2f34f4)return null;const _0x3081dc=_0x2f34f4['structuredContent'];if(_0x3081dc?.[_0x2ad4c0(0xa1)]&&typeof _0x3081dc[_0x2ad4c0(0xa1)]===_0x380156['MTReb'])return _0x3081dc[_0x2ad4c0(0xa1)];if(_0x2f34f4[_0x2ad4c0(0xd0)]){const _0x40aeb3=_0x2f34f4['content'];throw new Error(_0x2ad4c0(0xa8)+(_0x40aeb3?.[0x0]?.['text']??_0x380156[_0x2ad4c0(0x10c)]));}const _0x3adf23=_0x2f34f4[_0x2ad4c0(0xca)];if(_0x3adf23)for(const _0x2c0490 of _0x3adf23){if(_0x2c0490[_0x2ad4c0(0xf1)]===_0x380156[_0x2ad4c0(0x10b)]&&_0x2c0490['text']){try{const _0x2cfb1d=JSON[_0x2ad4c0(0xec)](_0x2c0490['text']);if(_0x380156['oGPBa'](typeof _0x2cfb1d?.[_0x2ad4c0(0xa1)],_0x380156[_0x2ad4c0(0xcc)]))return _0x2cfb1d[_0x2ad4c0(0xa1)];}catch{}const _0x496956=_0x2c0490['text'][_0x2ad4c0(0xfe)](/(rngr_[A-Za-z0-9_-]+)/);if(_0x496956)return _0x496956[0x1];}}return null;}
1
+ const _0x3fb8af=_0x16b4;(function(_0x49ca05,_0x54e0b1){const _0x15aaa3=_0x16b4,_0x138190=_0x49ca05();while(!![]){try{const _0x8c3e8e=parseInt(_0x15aaa3(0x14e))/0x1*(parseInt(_0x15aaa3(0x1ac))/0x2)+parseInt(_0x15aaa3(0x177))/0x3+-parseInt(_0x15aaa3(0x1ab))/0x4*(-parseInt(_0x15aaa3(0x17c))/0x5)+-parseInt(_0x15aaa3(0x1be))/0x6+-parseInt(_0x15aaa3(0x16d))/0x7+parseInt(_0x15aaa3(0x1c9))/0x8*(-parseInt(_0x15aaa3(0x187))/0x9)+parseInt(_0x15aaa3(0x19d))/0xa*(parseInt(_0x15aaa3(0x13c))/0xb);if(_0x8c3e8e===_0x54e0b1)break;else _0x138190['push'](_0x138190['shift']());}catch(_0x5bb6ad){_0x138190['push'](_0x138190['shift']());}}}(_0x1a2c,0x35a56));import{mkdir,writeFile,readFile}from'fs/promises';function _0x16b4(_0x55e1f1,_0x85307d){_0x55e1f1=_0x55e1f1-0x139;const _0x1a2c0f=_0x1a2c();let _0x16b4a6=_0x1a2c0f[_0x55e1f1];return _0x16b4a6;}import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger',_0x3fb8af(0x1b6)),AUTH_ORIGIN_PATH=join(homedir(),'.ranger','auth-origin.txt');export async function getMcpAuthOrigin(){const _0x13f308=_0x3fb8af,_0x1db12e={'NonyT':_0x13f308(0x1b7)};try{const _0x4d9185=(await readFile(AUTH_ORIGIN_PATH,_0x1db12e['NonyT']))['trim']();return _0x4d9185||null;}catch{return null;}}export async function mcpBootstrap(){const _0x47d050=_0x3fb8af,_0x4f37b9={'OstgE':function(_0x4b9a39){return _0x4b9a39();},'GDBLw':function(_0x370748,_0xe04b6d){return _0x370748===_0xe04b6d;},'UqHyG':function(_0x1aa677){return _0x1aa677();},'gnqrS':_0x47d050(0x18b),'lorPJ':function(_0x585938,_0x194a65){return _0x585938(_0x194a65);}},_0x2f8313=_0x4f37b9[_0x47d050(0x1a2)](getMcpAuthUrl);currentOrigin=_0x2f8313;const _0x21cb60=process['stdout'][_0x47d050(0x141)]??![];console[_0x47d050(0x182)]('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x2f8313+'\x0a');const _0xd7a688=await tryUnauthenticated(_0x2f8313);let _0x3e6494=null;if(_0x4f37b9[_0x47d050(0x191)](_0xd7a688,_0x47d050(0x180)))_0x3e6494='';else{_0x3e6494=await _0x4f37b9['UqHyG'](loadCachedToken);if(!_0x3e6494){if(!_0x21cb60)throw new Error(_0x47d050(0x1a4)+_0x4f37b9['gnqrS']);_0x3e6494=await _0x4f37b9['lorPJ'](oauthFlow,_0x2f8313);}}await callGetCliToken(_0x2f8313,_0x3e6494);}async function tryUnauthenticated(_0x3e8dfd){const _0x366de3=_0x3fb8af,_0x211444={'auJgV':function(_0x3a305b,_0x2ec1a8,_0x45b099){return _0x3a305b(_0x2ec1a8,_0x45b099);},'PzJPK':'POST','gBGwk':_0x366de3(0x1b3),'gPrxz':_0x366de3(0x173),'IoLei':_0x366de3(0x172),'wkOfK':_0x366de3(0x1cd),'lrwoH':_0x366de3(0x14f),'qXaMX':function(_0x402afb,_0x17b8a6){return _0x402afb===_0x17b8a6;}},_0x21b931=await _0x211444[_0x366de3(0x19e)](fetch,_0x3e8dfd,{'method':_0x211444[_0x366de3(0x152)],'headers':{'Content-Type':_0x211444[_0x366de3(0x147)],'Accept':_0x211444['gPrxz']},'body':JSON[_0x366de3(0x144)]({'jsonrpc':'2.0','id':0x1,'method':_0x211444[_0x366de3(0x17d)],'params':{'protocolVersion':_0x211444['wkOfK'],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x211444[_0x366de3(0x14d)]}}})});if(_0x21b931['ok'])return await _0x21b931[_0x366de3(0x13d)](),_0x366de3(0x180);if(_0x211444['qXaMX'](_0x21b931[_0x366de3(0x192)],0x191))return await _0x21b931[_0x366de3(0x13d)](),'needs-oauth';const _0x573c51=await _0x21b931['text']();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x21b931['status']+':\x20'+_0x573c51);}class OAuthTimeoutError extends Error{constructor(_0x2f2db8){const _0x32272b=_0x3fb8af;super(_0x2f2db8),this[_0x32272b(0x151)]='OAuthTimeoutError';}}async function oauthFlow(_0xd05e7c){const _0x28531d=_0x3fb8af,_0x286598={'xpAdO':function(_0x405931,_0x13f870){return _0x405931(_0x13f870);},'vJeux':function(_0x2c9ecd){return _0x2c9ecd();}};try{return await _0x286598['xpAdO'](oauthFlowAttempt,_0xd05e7c);}catch(_0x1b1673){if(_0x1b1673 instanceof OAuthTimeoutError&&await loadCachedClient())return console['log']('\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'),await _0x286598['vJeux'](clearCachedClient),await _0x286598[_0x28531d(0x163)](oauthFlowAttempt,_0xd05e7c);throw _0x1b1673;}}async function oauthFlowAttempt(_0x6c0836){const _0x3c652c=_0x3fb8af,_0x28e422={'idJUa':function(_0x53d7c9,_0xe94577){return _0x53d7c9(_0xe94577);},'SwrhL':function(_0x11c928,_0x38fdbe){return _0x11c928(_0x38fdbe);},'QEOqk':function(_0xa0d72f,_0x434e03,_0x39c453){return _0xa0d72f(_0x434e03,_0x39c453);},'CuXpU':_0x3c652c(0x1b3),'rPxHU':_0x3c652c(0x17b),'JWvcM':_0x3c652c(0x16e),'YpVTh':_0x3c652c(0x178),'ewviE':'Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','YLtZg':'base64url','LggMb':function(_0x4a1b80,_0x331e7a){return _0x4a1b80(_0x331e7a);},'WdYHg':'response_type','seLQl':_0x3c652c(0x155),'KCfZL':'code_challenge','PmNRw':'code_challenge_method','QrWxg':function(_0x4fcc30,_0x1c9a3c){return _0x4fcc30(_0x1c9a3c);},'Vssyw':_0x3c652c(0x167),'JXWTT':_0x3c652c(0x1b2),'UMDIf':_0x3c652c(0x18c),'xYJoA':function(_0x51b26b,_0xbdf8c0,_0x163265,_0x4b11d9){return _0x51b26b(_0xbdf8c0,_0x163265,_0x4b11d9);}},_0x30d24e=_0x6c0836['replace'](/\/mcp$/,'');process['stdout'][_0x3c652c(0x1bc)](_0x3c652c(0x154));const _0x4e8918=await _0x28e422[_0x3c652c(0x16c)](fetch,_0x30d24e+'/.well-known/oauth-protected-resource');if(!_0x4e8918['ok'])throw new Error('Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server');const _0x3d1e02=await _0x4e8918[_0x3c652c(0x1c8)](),_0x5e8e24=_0x3d1e02['authorization_servers']?.[0x0];if(!_0x5e8e24)throw new Error('No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata');console[_0x3c652c(0x182)]('\x20'+_0x5e8e24);const _0x322854=await _0x28e422['SwrhL'](fetchAuthServerMetadata,_0x5e8e24);let _0x25f2d5,_0x2831e6;const _0x249724=await loadCachedClient();if(_0x249724)_0x25f2d5=_0x249724[_0x3c652c(0x13a)],_0x2831e6=_0x249724[_0x3c652c(0x15f)];else{if(_0x322854['registration_endpoint']){process[_0x3c652c(0x195)][_0x3c652c(0x1bc)](_0x3c652c(0x1af));const _0x59600a=await _0x28e422['QEOqk'](fetch,_0x322854[_0x3c652c(0x1a8)],{'method':'POST','headers':{'Content-Type':_0x28e422['CuXpU']},'body':JSON['stringify']({'client_name':_0x28e422[_0x3c652c(0x15d)],'redirect_uris':[_0x3c652c(0x13e)+CALLBACK_PORT+'/callback'],'grant_types':[_0x28e422[_0x3c652c(0x1b1)],'refresh_token'],'response_types':[_0x28e422[_0x3c652c(0x15b)]],'token_endpoint_auth_method':'none'})});if(!_0x59600a['ok']){const _0x28163c=await _0x59600a[_0x3c652c(0x13d)]();throw new Error('Client\x20registration\x20failed:\x20'+_0x28163c);}const _0x374f8f=await _0x59600a['json']();_0x25f2d5=_0x374f8f['client_id'],_0x2831e6=_0x374f8f['client_secret'],await _0x28e422['QEOqk'](saveCachedClient,_0x25f2d5,_0x2831e6),console[_0x3c652c(0x182)](_0x3c652c(0x18c));}else throw new Error(_0x28e422['ewviE']);}const _0x12c998=randomBytes(0x20)[_0x3c652c(0x14a)](_0x28e422[_0x3c652c(0x197)]),_0x135728=_0x28e422['LggMb'](createHash,'sha256')['update'](_0x12c998)[_0x3c652c(0x171)](_0x3c652c(0x1b5)),_0x8328c2=randomBytes(0x10)['toString'](_0x3c652c(0x19f)),_0x598bd7=new URL(_0x322854['authorization_endpoint']);_0x598bd7[_0x3c652c(0x189)][_0x3c652c(0x13f)](_0x28e422[_0x3c652c(0x175)],'code'),_0x598bd7['searchParams'][_0x3c652c(0x13f)](_0x28e422['seLQl'],_0x25f2d5),_0x598bd7['searchParams']['set']('redirect_uri','http://localhost:'+CALLBACK_PORT+_0x3c652c(0x160)),_0x598bd7[_0x3c652c(0x189)]['set'](_0x28e422[_0x3c652c(0x1c7)],_0x135728),_0x598bd7[_0x3c652c(0x189)]['set'](_0x28e422['PmNRw'],_0x3c652c(0x159)),_0x598bd7[_0x3c652c(0x189)][_0x3c652c(0x13f)](_0x3c652c(0x15c),_0x8328c2);_0x3d1e02['resource']&&_0x598bd7[_0x3c652c(0x189)][_0x3c652c(0x13f)](_0x3c652c(0x1c4),_0x3d1e02['resource']);console['log'](_0x3c652c(0x164)),console['log'](_0x3c652c(0x149)+_0x598bd7[_0x3c652c(0x14a)]()+'\x0a'),await _0x28e422[_0x3c652c(0x168)](openBrowser,_0x598bd7['toString']());const _0x29bbaa=await waitForCallback(_0x8328c2);process[_0x3c652c(0x195)]['write'](_0x28e422[_0x3c652c(0x1a7)]);const _0x106fc2=new URLSearchParams({'grant_type':_0x28e422[_0x3c652c(0x1b1)],'code':_0x29bbaa,'redirect_uri':_0x3c652c(0x13e)+CALLBACK_PORT+'/callback','client_id':_0x25f2d5,'code_verifier':_0x12c998});_0x2831e6&&_0x106fc2['set']('client_secret',_0x2831e6);_0x3d1e02[_0x3c652c(0x1c4)]&&_0x106fc2['set']('resource',_0x3d1e02[_0x3c652c(0x1c4)]);const _0x8a648f=await _0x28e422['QEOqk'](fetch,_0x322854[_0x3c652c(0x148)],{'method':_0x28e422[_0x3c652c(0x1a5)],'headers':{'Content-Type':_0x3c652c(0x150)},'body':_0x106fc2});if(!_0x8a648f['ok']){const _0x229ca6=await _0x8a648f[_0x3c652c(0x13d)]();throw new Error(_0x3c652c(0x1c5)+_0x229ca6);}const _0x43123f=await _0x8a648f[_0x3c652c(0x1c8)]();return console[_0x3c652c(0x182)](_0x28e422[_0x3c652c(0x1c6)]),await _0x28e422[_0x3c652c(0x1ba)](saveCachedToken,_0x43123f[_0x3c652c(0x18f)],_0x43123f[_0x3c652c(0x181)],_0x43123f[_0x3c652c(0x143)]),_0x43123f[_0x3c652c(0x18f)];}async function callGetCliToken(_0x1dcbcc,_0x593703){const _0x18a1e7=_0x3fb8af,_0x286ba0={'bIrCq':function(_0x2bd54e,_0x49b5af,_0x41f5c2){return _0x2bd54e(_0x49b5af,_0x41f5c2);},'scNlD':function(_0x58b927,_0x4a0c33){return _0x58b927(_0x4a0c33);},'IEEwA':'application/json,\x20text/event-stream','XwVaR':'Authorization','EvfCp':'2.0','BJrtA':_0x18a1e7(0x1cd),'lszCH':'ranger-cli','ntWUk':'1.0.0','jgYDj':'\x20done','pIDgV':'notifications/initialized','VxPrH':function(_0x28f49f,_0x2afcdc){return _0x28f49f(_0x2afcdc);},'gtrnO':'tools/call','ZQRuG':_0x18a1e7(0x190),'rVLng':'\x0aUnexpected\x20response\x20structure:','qUUrF':_0x18a1e7(0x1aa),'WSmcC':function(_0x3ddc8b,_0x2cc7a6,_0x1a0dfb){return _0x3ddc8b(_0x2cc7a6,_0x1a0dfb);},'GgdWn':function(_0x5b126f,_0x11a8fd,_0x425e4d,_0x26ab98){return _0x5b126f(_0x11a8fd,_0x425e4d,_0x26ab98);},'ObTSD':function(_0x3d007e,_0x2fa89b,_0x3968a0,_0x3da6e1){return _0x3d007e(_0x2fa89b,_0x3968a0,_0x3da6e1);},'FuGsI':'auth-origin.txt'},_0x169f22={'Content-Type':'application/json','Accept':_0x286ba0['IEEwA']};_0x593703&&(_0x169f22[_0x286ba0[_0x18a1e7(0x1c2)]]=_0x18a1e7(0x193)+_0x593703);const _0x1350cd=async _0x4dc398=>{const _0x501d88=_0x18a1e7,_0x2083b8=await _0x286ba0[_0x501d88(0x1ae)](fetch,_0x1dcbcc,{'method':'POST','headers':_0x169f22,'body':JSON['stringify'](_0x4dc398)});if(!_0x2083b8['ok']){const _0x8cd3fb=await _0x2083b8[_0x501d88(0x13d)]();throw new Error('HTTP\x20'+_0x2083b8[_0x501d88(0x192)]+':\x20'+_0x8cd3fb);}return _0x286ba0[_0x501d88(0x1a6)](parseResponse,_0x2083b8);};process['stdout'][_0x18a1e7(0x1bc)](_0x18a1e7(0x166));const _0x4149e4=await _0x286ba0[_0x18a1e7(0x1a6)](_0x1350cd,{'jsonrpc':_0x286ba0['EvfCp'],'id':0x1,'method':_0x18a1e7(0x172),'params':{'protocolVersion':_0x286ba0[_0x18a1e7(0x156)],'capabilities':{},'clientInfo':{'name':_0x286ba0['lszCH'],'version':_0x286ba0['ntWUk']}}});if(_0x4149e4[_0x18a1e7(0x158)])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x4149e4[_0x18a1e7(0x158)][_0x18a1e7(0x174)]??JSON[_0x18a1e7(0x144)](_0x4149e4['error'])));console[_0x18a1e7(0x182)](_0x286ba0[_0x18a1e7(0x1c3)]),await fetch(_0x1dcbcc,{'method':'POST','headers':_0x169f22,'body':JSON['stringify']({'jsonrpc':'2.0','method':_0x286ba0['pIDgV']})})['then'](_0x283eb3=>_0x283eb3[_0x18a1e7(0x13d)]()),process['stdout'][_0x18a1e7(0x1bc)]('Requesting\x20CLI\x20token...');const _0x1fcf9d=await _0x286ba0['VxPrH'](_0x1350cd,{'jsonrpc':_0x18a1e7(0x142),'id':0x2,'method':_0x286ba0[_0x18a1e7(0x170)],'params':{'name':_0x286ba0[_0x18a1e7(0x188)],'arguments':{}}});if(_0x1fcf9d['error'])throw new Error(_0x18a1e7(0x1c1)+(_0x1fcf9d[_0x18a1e7(0x158)]['message']??JSON['stringify'](_0x1fcf9d['error'])));console[_0x18a1e7(0x182)](_0x286ba0[_0x18a1e7(0x1c3)]);const _0x476e73=extractToken(_0x1fcf9d[_0x18a1e7(0x184)]);if(!_0x476e73){console['error'](_0x286ba0['rVLng']),console[_0x18a1e7(0x158)](JSON[_0x18a1e7(0x144)](_0x1fcf9d[_0x18a1e7(0x184)],null,0x2));throw new Error(_0x286ba0['qUUrF']);}const _0x5b38f9=join(homedir(),_0x18a1e7(0x19a)),_0x17209d=join(_0x5b38f9,_0x18a1e7(0x1ad));await _0x286ba0['WSmcC'](mkdir,_0x5b38f9,{'recursive':!![]}),await _0x286ba0['GgdWn'](writeFile,_0x17209d,_0x476e73,{'mode':0x180}),await _0x286ba0[_0x18a1e7(0x165)](writeFile,join(_0x5b38f9,_0x286ba0['FuGsI']),_0x1dcbcc,{'mode':0x180}),console['log'](_0x18a1e7(0x17f)+_0x17209d),console['log']('Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a');}async function fetchAuthServerMetadata(_0x31fc29){const _0x2bfa65=_0x3fb8af,_0x4e9650=_0x31fc29+_0x2bfa65(0x162),_0x5d584c=await fetch(_0x4e9650);if(!_0x5d584c['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x4e9650+':\x20'+_0x5d584c[_0x2bfa65(0x192)]);return _0x5d584c[_0x2bfa65(0x1c8)]();}function waitForCallback(_0x1d5e37){const _0x3a6dfa=_0x3fb8af,_0x4ca173={'winvy':function(_0x2ee279,_0x56516a){return _0x2ee279!==_0x56516a;},'QsSps':'/callback','yxnBS':'error_description','hirHe':_0x3a6dfa(0x14b),'MjTCM':_0x3a6dfa(0x18a),'YkyiS':'<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','unBji':function(_0x5cb930,_0x532123){return _0x5cb930(_0x532123);},'hswTT':_0x3a6dfa(0x1cc),'nFsay':function(_0x3a1862,_0x114263){return _0x3a1862(_0x114263);},'oNXMc':_0x3a6dfa(0x18d)};return new Promise((_0x5563c0,_0x430bce)=>{const _0x67e107=_0x3a6dfa,_0x269459={'AXMUl':_0x4ca173[_0x67e107(0x157)]},_0x18eed9=setTimeout(()=>{const _0x536183=_0x67e107;_0x1a24e8[_0x536183(0x19b)](),_0x430bce(new OAuthTimeoutError(_0x269459['AXMUl']));},0x1d4c0),_0x1a24e8=_0x4ca173[_0x67e107(0x198)](createServer,(_0x2aad3b,_0x29f193)=>{const _0x5d4a13=_0x67e107,_0x43ecdd=new URL(_0x2aad3b['url']??'/','http://localhost:'+CALLBACK_PORT);if(_0x4ca173['winvy'](_0x43ecdd['pathname'],_0x4ca173[_0x5d4a13(0x1a0)])){_0x29f193[_0x5d4a13(0x1ce)](0x194),_0x29f193['end']('Not\x20found');return;}const _0x1bf99a=_0x43ecdd['searchParams'][_0x5d4a13(0x16b)](_0x5d4a13(0x178)),_0x2c64fd=_0x43ecdd['searchParams']['get'](_0x5d4a13(0x15c)),_0x559a9f=_0x43ecdd[_0x5d4a13(0x189)]['get']('error');if(_0x559a9f){const _0x192a06=_0x43ecdd[_0x5d4a13(0x189)][_0x5d4a13(0x16b)](_0x4ca173['yxnBS'])??_0x559a9f;_0x29f193[_0x5d4a13(0x1ce)](0xc8,{'Content-Type':_0x5d4a13(0x18a)}),_0x29f193['end'](_0x5d4a13(0x17e)+_0x192a06+_0x5d4a13(0x176)),clearTimeout(_0x18eed9),_0x1a24e8['close'](),_0x430bce(new Error(_0x5d4a13(0x13b)+_0x192a06));return;}if(!_0x1bf99a||_0x2c64fd!==_0x1d5e37){_0x29f193[_0x5d4a13(0x1ce)](0x190,{'Content-Type':'text/html'}),_0x29f193[_0x5d4a13(0x14c)](_0x4ca173['hirHe']);return;}_0x29f193[_0x5d4a13(0x1ce)](0xc8,{'Content-Type':_0x4ca173['MjTCM']}),_0x29f193[_0x5d4a13(0x14c)](_0x4ca173[_0x5d4a13(0x15e)]),_0x4ca173[_0x5d4a13(0x1b8)](clearTimeout,_0x18eed9),_0x1a24e8[_0x5d4a13(0x19b)](),_0x4ca173['unBji'](_0x5563c0,_0x1bf99a);});_0x1a24e8['listen'](CALLBACK_PORT,_0x4ca173['oNXMc']);});}function _0x1a2c(){const _0x1e2833=['utf-8','unBji','parse','xYJoA','Unknown\x20error','write','start','2054712igApCt','accessToken','now','get_cli_token\x20failed:\x20','XwVaR','jgYDj','resource','Token\x20exchange\x20failed:\x20','UMDIf','KCfZL','json','216AyBffq','startsWith','data:','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','2025-03-26','writeHead','win32','fYgNU','content','clientId','OAuth\x20error:\x20','9933nFlVNM','text','http://localhost:','set','mnZsx','isTTY','2.0','expires_in','stringify','MmcEW','refreshToken','gBGwk','token_endpoint','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','toString','<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','end','lrwoH','6115hsvnJP','1.0.0','application/x-www-form-urlencoded','name','PzJPK','iFqPa','Discovering\x20authorization\x20server...','client_id','BJrtA','hswTT','error','S256','mRkGT','YpVTh','state','rPxHU','YkyiS','clientSecret','/callback','WqIxi','/.well-known/oauth-authorization-server','xpAdO','\x0aOpening\x20browser\x20for\x20authentication...','ObTSD','Initializing\x20MCP\x20session...','Exchanging\x20authorization\x20code...','QrWxg','OcyWH','token','get','idJUa','1145865psAlKR','authorization_code','slice','gtrnO','digest','initialize','application/json,\x20text/event-stream','message','WdYHg','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','257454DCuXOj','code','isError','trim','Ranger\x20CLI','15jrqupf','IoLei','<html><body><h2>Authentication\x20failed</h2><p>','\x0aToken\x20written\x20to\x20','proxied','refresh_token','log','zXZlS','result','open','Fwpey','61461FjaLja','ZQRuG','searchParams','text/html','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','\x20done','127.0.0.1','length','access_token','get_cli_token','GDBLw','status','Bearer\x20','content-type','stdout','OnOLj','YLtZg','nFsay','split','.ranger','close','origin','4860iUiNTx','auJgV','hex','QsSps','yIHke','OstgE','platform','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','JXWTT','scNlD','Vssyw','registration_endpoint','uBhUa','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','505964itYtmI','2irElfs','refresh.txt','bIrCq','Registering\x20OAuth\x20client...','Server\x20returned\x20error:\x20','JWvcM','POST','application/json','expiresAt','base64url','mcp-oauth-tokens.json'];_0x1a2c=function(){return _0x1e2833;};return _0x1a2c();}async function openBrowser(_0x538747){const _0x49510b=_0x3fb8af,_0x7660cf={'lUPyu':'child_process','Fwpey':'darwin','ritDw':function(_0x5beb2c,_0x2e125d){return _0x5beb2c===_0x2e125d;},'OejFP':'xdg-open'},{exec:_0x3bcf4e}=await import(_0x7660cf['lUPyu']),_0x235aec=process['platform']===_0x7660cf[_0x49510b(0x186)]?_0x49510b(0x185):_0x7660cf['ritDw'](process[_0x49510b(0x1a3)],_0x49510b(0x1cf))?_0x49510b(0x1bd):_0x7660cf['OejFP'];_0x3bcf4e(_0x235aec+'\x20\x22'+_0x538747+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x3962e0=_0x3fb8af,_0x1bb609={'RZQII':'utf-8','HjFRQ':function(_0x266ee3,_0x1c3d0c){return _0x266ee3!==_0x1c3d0c;}};try{const _0x349572=JSON['parse'](await readFile(TOKEN_CACHE_PATH,_0x1bb609['RZQII']));if(_0x349572['origin']&&_0x1bb609['HjFRQ'](_0x349572['origin'],currentOrigin))return null;if(_0x349572[_0x3962e0(0x1b4)]&&Date[_0x3962e0(0x1c0)]()>_0x349572[_0x3962e0(0x1b4)])return null;return _0x349572[_0x3962e0(0x1bf)]??null;}catch{return null;}}async function saveCachedToken(_0x210f60,_0x3db66e,_0x253809){const _0x5c6c37=_0x3fb8af,_0x4f621b={'WqIxi':function(_0x1ebb04){return _0x1ebb04();},'AahQB':function(_0x16d796,_0x4abdc2){return _0x16d796+_0x4abdc2;},'uBhUa':_0x5c6c37(0x19a)},_0x25258d=await _0x4f621b[_0x5c6c37(0x161)](loadCachedData),_0x7f6644={..._0x25258d,'origin':currentOrigin,'accessToken':_0x210f60,'refreshToken':_0x3db66e??_0x25258d?.[_0x5c6c37(0x146)],'expiresAt':_0x253809?_0x4f621b['AahQB'](Date['now'](),_0x253809*0x3e8):undefined};await mkdir(join(homedir(),_0x4f621b[_0x5c6c37(0x1a9)]),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x7f6644),{'mode':0x180});}async function loadCachedClient(){const _0x2dbc62=_0x3fb8af,_0x241670={'OipXz':function(_0x21bf36){return _0x21bf36();},'MmcEW':function(_0x199bb3,_0x54205d){return _0x199bb3!==_0x54205d;}},_0x3d1cbc=await _0x241670['OipXz'](loadCachedData);if(_0x3d1cbc?.['origin']&&_0x241670[_0x2dbc62(0x145)](_0x3d1cbc[_0x2dbc62(0x19c)],currentOrigin))return null;return _0x3d1cbc?.['clientId']?{'clientId':_0x3d1cbc['clientId'],'clientSecret':_0x3d1cbc['clientSecret']}:null;}async function clearCachedClient(){const _0x535cbf=_0x3fb8af,_0x211147={'iFqPa':function(_0x53846e){return _0x53846e();},'hhzdz':function(_0x4c1d33,_0x176fb7,_0x5ba9f5,_0x1bcc96){return _0x4c1d33(_0x176fb7,_0x5ba9f5,_0x1bcc96);}},_0x6ee6a6=await _0x211147[_0x535cbf(0x153)](loadCachedData);if(!_0x6ee6a6)return;const {clientId:_0x3a29de,clientSecret:_0x4f7327,..._0x20eca6}=_0x6ee6a6;await _0x211147['hhzdz'](writeFile,TOKEN_CACHE_PATH,JSON[_0x535cbf(0x144)](_0x20eca6),{'mode':0x180});}async function saveCachedClient(_0xa1037a,_0x53efcc){const _0x527c99=_0x3fb8af,_0x3cf75a={'rZIEL':function(_0x5cc1c2){return _0x5cc1c2();},'TWaeb':function(_0x48eb99,_0x296eb7,_0x4efd94){return _0x48eb99(_0x296eb7,_0x4efd94);},'fYgNU':_0x527c99(0x19a),'zXZlS':function(_0x298d6b,_0x193531,_0x306f1b,_0x5294fd){return _0x298d6b(_0x193531,_0x306f1b,_0x5294fd);}},_0x36dbf9=await _0x3cf75a['rZIEL'](loadCachedData),_0x2a7885={..._0x36dbf9,'origin':currentOrigin,'accessToken':_0x36dbf9?.[_0x527c99(0x1bf)]??'','clientId':_0xa1037a,'clientSecret':_0x53efcc};await mkdir(_0x3cf75a['TWaeb'](join,homedir(),_0x3cf75a[_0x527c99(0x1d0)]),{'recursive':!![]}),await _0x3cf75a[_0x527c99(0x183)](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x2a7885),{'mode':0x180});}async function loadCachedData(){const _0x333809=_0x3fb8af,_0x2c8270={'eTUbe':function(_0x4b83c0,_0x3d9912,_0xf5881c){return _0x4b83c0(_0x3d9912,_0xf5881c);},'mRkGT':'utf-8'};try{return JSON[_0x333809(0x1b9)](await _0x2c8270['eTUbe'](readFile,TOKEN_CACHE_PATH,_0x2c8270[_0x333809(0x15a)]));}catch{return null;}}async function parseResponse(_0x30daf7){const _0x4324bb=_0x3fb8af,_0x429e81={'yIHke':'data:','OnOLj':function(_0x5dff9e,_0x8fd7ce){return _0x5dff9e!==_0x8fd7ce;}},_0x4beceb=_0x30daf7['headers']['get'](_0x4324bb(0x194))??'';if(_0x4beceb['includes']('text/event-stream')){const _0x11d19c=await _0x30daf7['text']();for(const _0xe1e228 of _0x11d19c[_0x4324bb(0x199)]('\x0a')){const _0x3571eb=_0xe1e228[_0x4324bb(0x17a)]();if(_0x3571eb[_0x4324bb(0x1ca)](_0x429e81[_0x4324bb(0x1a1)])){const _0x18098e=_0x3571eb[_0x4324bb(0x16f)](_0x4324bb(0x1cb)[_0x4324bb(0x18e)])['trim']();if(!_0x18098e)continue;try{const _0x25ec90=JSON['parse'](_0x18098e);if(_0x429e81[_0x4324bb(0x196)](_0x25ec90['id'],undefined)||_0x25ec90[_0x4324bb(0x158)])return _0x25ec90;}catch{}}}throw new Error('No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream');}return _0x30daf7[_0x4324bb(0x1c8)]();}function extractToken(_0x5caa1c){const _0x4cb5f3=_0x3fb8af,_0x57c8ab={'wJLpP':_0x4cb5f3(0x1bb),'mnZsx':_0x4cb5f3(0x13d),'OcyWH':function(_0x3349cd,_0x4405fc){return _0x3349cd===_0x4405fc;}};if(!_0x5caa1c)return null;const _0xdaefb4=_0x5caa1c['structuredContent'];if(_0xdaefb4?.[_0x4cb5f3(0x16a)]&&typeof _0xdaefb4['token']==='string')return _0xdaefb4[_0x4cb5f3(0x16a)];if(_0x5caa1c[_0x4cb5f3(0x179)]){const _0x2b2671=_0x5caa1c[_0x4cb5f3(0x139)];throw new Error(_0x4cb5f3(0x1b0)+(_0x2b2671?.[0x0]?.[_0x4cb5f3(0x13d)]??_0x57c8ab['wJLpP']));}const _0x509829=_0x5caa1c['content'];if(_0x509829)for(const _0x272af9 of _0x509829){if(_0x272af9['type']===_0x57c8ab[_0x4cb5f3(0x140)]&&_0x272af9[_0x4cb5f3(0x13d)]){try{const _0x507bef=JSON['parse'](_0x272af9['text']);if(_0x57c8ab[_0x4cb5f3(0x169)](typeof _0x507bef?.[_0x4cb5f3(0x16a)],'string'))return _0x507bef[_0x4cb5f3(0x16a)];}catch{}const _0x5a7a18=_0x272af9['text']['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x5a7a18)return _0x5a7a18[0x1];}}return null;}
@@ -1 +1 @@
1
- (function(_0x1d360d,_0xbcb618){const _0x1c9650=_0x44ea,_0x2d52df=_0x1d360d();while(!![]){try{const _0x24e6a1=-parseInt(_0x1c9650(0x184))/0x1+parseInt(_0x1c9650(0x17d))/0x2+-parseInt(_0x1c9650(0x153))/0x3*(-parseInt(_0x1c9650(0x14f))/0x4)+parseInt(_0x1c9650(0x168))/0x5+parseInt(_0x1c9650(0x15a))/0x6+-parseInt(_0x1c9650(0x18e))/0x7+-parseInt(_0x1c9650(0x159))/0x8*(parseInt(_0x1c9650(0x190))/0x9);if(_0x24e6a1===_0xbcb618)break;else _0x2d52df['push'](_0x2d52df['shift']());}catch(_0x4509a2){_0x2d52df['push'](_0x2d52df['shift']());}}}(_0x3557,0x9b2c0));import{readFile,rm}from'fs/promises';import{existsSync}from'fs';import{join}from'path';import _0x36ebad from'inquirer';import{getEnvNames}from'./env.js';import{getEnvDir,loadSettings}from'./utils/settings.js';import{getRangerDir}from'./utils/rangerRoot.js';import{ApiError,createCloudProfile,fetchAuthConfig,saveCloudProfileCredentials,uploadCloudProfileSession}from'./utils/cloudProfile.js';import{matchAuthEnvironment}from'./utils/matchAuthEnvironment.js';import{readProjectsConfig,setProfileOverride,writeProjectsConfig}from'./utils/projectsConfig.js';function _0x44ea(_0x9c4f7a,_0x3b120b){_0x9c4f7a=_0x9c4f7a-0x146;const _0x355778=_0x3557();let _0x44eabb=_0x355778[_0x9c4f7a];return _0x44eabb;}function _0x3557(){const _0x3bb184=['KKnvA','message','iUnZa','oicGK','profileName','\x20→\x20cloud\x20(env:\x20','1205929ZyPStj','trackPhaseEnd','envKey','\x20local\x20director','mXDSl','stdout',',\x20baseUrl\x20override\x20→\x20projects.json)','yes','utf-8','isTTY','4090709ktzbTW','dryRun','900603GuFQsD','_warnings','some','authJsonPath',':\x20failed\x20to\x20save\x20credentials\x20(','Could\x20not\x20fetch\x20auth\x20config\x20(','domains','4|0|2|3|1','\x20\x20git\x20rm\x20-r\x20--cached\x20.ranger/','padEnd','ies','TELRT','skip','PbCky','no\x20baseUrl\x20in\x20settings.json','Provide\x20a\x20profile\x20name\x20or\x20--all.\x0a\x20\x20Example:\x20ranger\x20profile\x20migrate\x20--all\x20--dry-run','\x20profile','4fIlzRm','env','origin','push','2309082ewLnRm','jqsdZ','local\x20profile\x20directory\x20not\x20found',':\x20--save-creds\x20requested,\x20but\x20RANGER_TEST_USERNAME/PASSWORD\x20not\x20set\x20in\x20env.','baseUrl','migrate','8WojQYW','4931868XuZEhq',':\x20failed\x20to\x20write\x20projects.json\x20override\x20(',':\x20cloud\x20profile\x20with\x20this\x20name\x20already\x20exists.\x20Skipping.','\x20\x20⚠\x20','no\x20matching\x20auth\x20env','length','No\x20local\x20profiles\x20found\x20to\x20migrate.','status','Warning:\x20.ranger/\x20is\x20tracked\x20in\x20this\x20git\x20repo.','BfuZj','Continuing\x20with\x20migration...','environments','projects','reason','548980aDVhAK','join','settings','\x20migrated','preserveBaseUrl','all','\x20skipped','kind','yguzc','\x20failed','Ihhdr','Deleted\x20','CWCpg','TYEEv',':\x20session\x20upload\x20failed\x20(','\x20migrated\x20to\x20cloud\x20(env:\x20','GYUhV','DIxuT','Aborted.','log','\x20\x20echo\x20\x27.ranger/\x27\x20>>\x20.gitignore','1648998ZFCXGD'];_0x3557=function(){return _0x3bb184;};return _0x3557();}import{isPathGitTracked}from'./utils/gitTracked.js';function formatPlanLine(_0xa05d1f){const _0x29f314=_0x44ea,_0x456720={'PlQHj':'skip'};if(_0xa05d1f['kind']===_0x456720['PlQHj'])return'\x20\x20'+_0xa05d1f['profileName'][_0x29f314(0x147)](0x1e)+'\x20→\x20skip\x20('+_0xa05d1f['reason']+')';if(_0xa05d1f[_0x29f314(0x16c)]&&_0xa05d1f['baseUrl'])return'\x20\x20'+_0xa05d1f[_0x29f314(0x182)]['padEnd'](0x1e)+_0x29f314(0x183)+_0xa05d1f['envKey']+',\x20preserving\x20baseUrl\x20'+_0xa05d1f[_0x29f314(0x157)]+'\x20as\x20project\x20override)';if(_0xa05d1f[_0x29f314(0x157)])return'\x20\x20'+_0xa05d1f[_0x29f314(0x182)][_0x29f314(0x147)](0x1e)+_0x29f314(0x183)+_0xa05d1f[_0x29f314(0x186)]+',\x20matches\x20'+_0xa05d1f[_0x29f314(0x157)]+')';return'\x20\x20'+_0xa05d1f['profileName'][_0x29f314(0x147)](0x1e)+'\x20→\x20cloud\x20(env:\x20'+_0xa05d1f['envKey']+')';}function shouldWarnGitTrackedOnce(_0x1467f2){const _0x54e732=_0x44ea,_0x601987=readProjectsConfig(),_0x553481=_0x601987[_0x54e732(0x166)][_0x1467f2]??={},_0x53846e=_0x553481[_0x54e732(0x191)]??={},_0x8edd37=_0x53846e['gitTrackedRanger'],_0xf5c18c=new Date(),_0x3c8878=_0xf5c18c['toISOString']()['slice'](0x0,0xa);if(_0x8edd37===_0x3c8878)return![];return _0x53846e['gitTrackedRanger']=_0x3c8878,writeProjectsConfig(_0x601987),!![];}export async function migrateProfile(_0x3b58a2,_0x213f41){const _0x3fe15d=_0x44ea,_0x1e4af7={'yguzc':function(_0x18ff84,_0x1cdf07){return _0x18ff84===_0x1cdf07;},'fgJAT':function(_0x5c91b0,_0x48c38a){return _0x5c91b0 instanceof _0x48c38a;},'WmLJR':'No\x20cloud\x20profile\x20auth\x20config\x20found\x20for\x20this\x20org.\x20Migration\x20requires\x20at\x20least\x20one\x20configured\x20auth\x20environment.','BfuZj':function(_0x237210){return _0x237210();},'CZJYw':_0x3fe15d(0x160),'CWCpg':function(_0x2097c4,_0x49ebdb){return _0x2097c4(_0x49ebdb);},'PbCky':_0x3fe15d(0x14a),'DAEzE':_0x3fe15d(0x14c),'uUPql':function(_0x9bf860,_0x2df369,_0x42928a){return _0x9bf860(_0x2df369,_0x42928a);},'KKnvA':_0x3fe15d(0x15e),'GYUhV':_0x3fe15d(0x157),'emDib':function(_0x2bd103,_0x864fbb,_0x4f9636){return _0x2bd103(_0x864fbb,_0x4f9636);},'Hawqv':'migrate','TYEEv':'confirm','TkAwv':_0x3fe15d(0x197),'jqsdZ':_0x3fe15d(0x146),'mXDSl':_0x3fe15d(0x17c),'azSlL':'profile.migrate.started','irayU':'profile.migrate.skipped','TELRT':function(_0x20e47a,_0x22b506,_0x2f6f5b){return _0x20e47a(_0x22b506,_0x2f6f5b);},'qVarW':function(_0x115a76,_0xbaa573){return _0x115a76&&_0xbaa573;},'DIxuT':function(_0x9e5a39,_0x2f7335){return _0x9e5a39 instanceof _0x2f7335;},'IMrDU':function(_0x5851df,_0x1bc619,_0x11d1ce,_0xe0287e,_0x5f3298){return _0x5851df(_0x1bc619,_0x11d1ce,_0xe0287e,_0x5f3298);},'MEYEu':'profile.migrate.failed','iUnZa':function(_0x421abb,_0x3ab66e){return _0x421abb(_0x3ab66e);},'rBRuc':function(_0x146bc7,_0x3e2fa4){return _0x146bc7>_0x3e2fa4;},'qQnCI':function(_0x58bccc,_0x4caf0c){return _0x58bccc>_0x4caf0c;},'Ihhdr':_0x3fe15d(0x148),'oicGK':function(_0x49b957,_0x4e79d){return _0x49b957+_0x4e79d;}};if(!_0x3b58a2[_0x3fe15d(0x182)]&&!_0x3b58a2['all'])throw new Error(_0x3fe15d(0x14d));let _0x35d6ac;try{_0x35d6ac=await fetchAuthConfig();}catch(_0x53cbd9){throw new Error(_0x3fe15d(0x195)+(_0x1e4af7['fgJAT'](_0x53cbd9,Error)?_0x53cbd9['message']:String(_0x53cbd9))+').\x20Run:\x20ranger\x20setup');}if(!_0x35d6ac||!_0x35d6ac[_0x3fe15d(0x165)]||Object['keys'](_0x35d6ac[_0x3fe15d(0x165)])[_0x3fe15d(0x15f)]===0x0)throw new Error(_0x1e4af7['WmLJR']);const _0x283e76=[];if(_0x3b58a2[_0x3fe15d(0x16d)]){const {envNames:_0x201b67,envTypes:_0x247b63}=await _0x1e4af7[_0x3fe15d(0x163)](getEnvNames);for(const _0x55898a of _0x201b67){if(_0x247b63[_0x55898a]==='ci')continue;_0x283e76['push'](_0x55898a);}}else _0x3b58a2['profileName']&&_0x283e76['push'](_0x3b58a2[_0x3fe15d(0x182)]);if(_0x1e4af7['yguzc'](_0x283e76[_0x3fe15d(0x15f)],0x0)){console[_0x3fe15d(0x17b)](_0x1e4af7['CZJYw']);return;}const _0x105201=[];for(const _0x542d48 of _0x283e76){const _0x189777=getEnvDir(_0x542d48);if(!_0x1e4af7[_0x3fe15d(0x174)](existsSync,_0x189777)){_0x105201[_0x3fe15d(0x152)]({'kind':'skip','profileName':_0x542d48,'reason':_0x3fe15d(0x155)});continue;}const _0x103ad8=await loadSettings(_0x542d48),_0xcd4564=_0x103ad8['baseUrl'];if(!_0xcd4564){_0x105201[_0x3fe15d(0x152)]({'kind':_0x1e4af7[_0x3fe15d(0x14b)],'profileName':_0x542d48,'reason':_0x1e4af7['DAEzE']});continue;}const _0x390e8b=_0x1e4af7['uUPql'](matchAuthEnvironment,_0xcd4564,_0x35d6ac);if(!_0x390e8b){_0x105201['push']({'kind':_0x1e4af7[_0x3fe15d(0x14b)],'profileName':_0x542d48,'reason':_0x1e4af7[_0x3fe15d(0x17e)]});continue;}const _0x20d0fe=_0x35d6ac[_0x3fe15d(0x165)][_0x390e8b],_0x4bb71e=_0x20d0fe?.[_0x3fe15d(0x196)]??[],_0x1df2d1=_0x4bb71e[_0x3fe15d(0x192)](_0x537513=>{const _0x281afd=_0x3fe15d;try{return _0x1e4af7['yguzc'](new URL(_0x537513)['origin'],new URL(_0xcd4564)[_0x281afd(0x151)]);}catch{return![];}}),_0x1c8afc={};for(const [_0x231d6f,_0x2ceb6d]of Object['entries'](_0x103ad8)){if(_0x231d6f===_0x1e4af7[_0x3fe15d(0x178)])continue;if(_0x1e4af7[_0x3fe15d(0x170)](_0x2ceb6d,undefined))continue;_0x1c8afc[_0x231d6f]=_0x2ceb6d;}!_0x1df2d1&&(_0x1c8afc[_0x3fe15d(0x157)]=_0xcd4564);const _0x20c720=_0x1e4af7['emDib'](join,_0x189777,'auth.json'),_0x586572=existsSync(_0x20c720);_0x105201[_0x3fe15d(0x152)]({'kind':_0x1e4af7['Hawqv'],'profileName':_0x542d48,'envKey':_0x390e8b,'baseUrl':_0xcd4564,'preserveBaseUrl':!_0x1df2d1,'settings':_0x1c8afc,'authJsonPath':_0x586572?_0x20c720:null});}console['log']('Plan:');for(const _0x46398c of _0x105201){console['log'](_0x1e4af7['CWCpg'](formatPlanLine,_0x46398c));}if(_0x3b58a2[_0x3fe15d(0x18f)]){console['log']('Nothing\x20migrated.\x20Run\x20without\x20--dry-run\x20to\x20apply.');return;}const _0x471fc4=_0x1e4af7[_0x3fe15d(0x174)](Boolean,process['stdin']['isTTY']&&process[_0x3fe15d(0x189)][_0x3fe15d(0x18d)]),_0x1ea732=_0x105201[_0x3fe15d(0x192)](_0x35e67d=>_0x35e67d[_0x3fe15d(0x16f)]===_0x3fe15d(0x158));if(_0x1ea732&&_0x471fc4&&!_0x3b58a2[_0x3fe15d(0x18b)]){const {proceed:_0x108d55}=await _0x36ebad['prompt']([{'type':_0x1e4af7[_0x3fe15d(0x175)],'name':'proceed','message':'Proceed?','default':![]}]);if(!_0x108d55){console[_0x3fe15d(0x17b)](_0x3fe15d(0x17a));return;}}const _0x279233=_0x1e4af7['BfuZj'](getRangerDir);let _0x447cf2=![];if(existsSync(_0x279233))try{_0x447cf2=await isPathGitTracked(_0x279233);}catch{_0x447cf2=![];}if(_0x447cf2&&shouldWarnGitTrackedOnce(process['cwd']())){const _0x358b3d=_0x1e4af7['TkAwv']['split']('|');let _0x559d57=0x0;while(!![]){switch(_0x358b3d[_0x559d57++]){case'0':console[_0x3fe15d(0x17b)]('After\x20migration,\x20uncommit\x20it:');continue;case'1':console['log'](_0x3fe15d(0x164));continue;case'2':console['log'](_0x1e4af7[_0x3fe15d(0x154)]);continue;case'3':console['log'](_0x1e4af7[_0x3fe15d(0x188)]);continue;case'4':console['log'](_0x3fe15d(0x162));continue;}break;}}let _0x399593=0x0,_0xc18db3=0x0,_0x267560=0x0,_0x48c993=0x0;for(const _0x3e4841 of _0x105201){if(_0x3e4841['kind']===_0x1e4af7['PbCky']){_0x48c993++,_0x213f41?.[_0x3fe15d(0x185)]('profile.migrate.skipped',{'profileName':_0x3e4841['profileName'],'reason':_0x3e4841[_0x3fe15d(0x167)]});continue;}_0x213f41?.['trackPhaseStart'](_0x1e4af7['azSlL'],{'profileName':_0x3e4841[_0x3fe15d(0x182)],'envKey':_0x3e4841[_0x3fe15d(0x186)]});try{try{await createCloudProfile(_0x3e4841[_0x3fe15d(0x182)],_0x3e4841['envKey'],_0x3e4841[_0x3fe15d(0x16a)]);}catch(_0x289ac8){if(_0x289ac8 instanceof ApiError&&_0x289ac8[_0x3fe15d(0x161)]===0x199){console[_0x3fe15d(0x17b)]('\x20\x20⚠\x20'+_0x3e4841[_0x3fe15d(0x182)]+_0x3fe15d(0x15c)),_0x48c993++,_0x213f41?.['trackPhaseEnd'](_0x1e4af7['irayU'],{'profileName':_0x3e4841[_0x3fe15d(0x182)],'reason':'name_conflict'});continue;}throw _0x289ac8;}let _0x28b1c0=![],_0x1b57f6=![];if(_0x3e4841[_0x3fe15d(0x193)])try{const _0x3c22f=await _0x1e4af7['uUPql'](readFile,_0x3e4841['authJsonPath'],_0x3fe15d(0x18c)),_0x3a44f3=JSON['parse'](_0x3c22f);await _0x1e4af7[_0x3fe15d(0x149)](uploadCloudProfileSession,_0x3e4841[_0x3fe15d(0x182)],_0x3a44f3),_0x28b1c0=!![];}catch(_0x827adb){_0x1b57f6=!![],console[_0x3fe15d(0x17b)](_0x3fe15d(0x15d)+_0x3e4841[_0x3fe15d(0x182)]+_0x3fe15d(0x176)+(_0x827adb instanceof Error?_0x827adb[_0x3fe15d(0x17f)]:_0x1e4af7[_0x3fe15d(0x174)](String,_0x827adb))+').\x20Cloud\x20profile\x20created;\x20local\x20auth.json\x20left\x20in\x20place.');}let _0x23c8b0=![];if(_0x3b58a2['saveCreds']){const _0x2afc00=process[_0x3fe15d(0x150)]['RANGER_TEST_USERNAME'],_0x2d0bde=process[_0x3fe15d(0x150)]['RANGER_TEST_PASSWORD'];if(_0x1e4af7['qVarW'](_0x2afc00,_0x2d0bde))try{await saveCloudProfileCredentials(_0x3e4841['profileName'],_0x2afc00,_0x2d0bde),_0x23c8b0=!![];}catch(_0x5cd6d4){console['log']('\x20\x20⚠\x20'+_0x3e4841['profileName']+_0x3fe15d(0x194)+(_0x1e4af7[_0x3fe15d(0x179)](_0x5cd6d4,Error)?_0x5cd6d4[_0x3fe15d(0x17f)]:String(_0x5cd6d4))+').');}else console['log']('\x20\x20⚠\x20'+_0x3e4841[_0x3fe15d(0x182)]+_0x3fe15d(0x156));}if(_0x3e4841[_0x3fe15d(0x16c)]&&_0x3e4841[_0x3fe15d(0x157)])try{_0x1e4af7['IMrDU'](setProfileOverride,process['cwd'](),_0x3e4841['profileName'],_0x1e4af7['GYUhV'],_0x3e4841[_0x3fe15d(0x157)]);}catch(_0x48f5ad){console['log'](_0x3fe15d(0x15d)+_0x3e4841[_0x3fe15d(0x182)]+_0x3fe15d(0x15b)+(_0x1e4af7['DIxuT'](_0x48f5ad,Error)?_0x48f5ad[_0x3fe15d(0x17f)]:String(_0x48f5ad))+').');}const _0x5dd4cf=getEnvDir(_0x3e4841['profileName']);if(!_0x1b57f6&&existsSync(_0x5dd4cf))try{await rm(_0x5dd4cf,{'recursive':!![],'force':!![]}),_0xc18db3++;}catch(_0x1c348a){console[_0x3fe15d(0x17b)](_0x3fe15d(0x15d)+_0x3e4841['profileName']+':\x20failed\x20to\x20delete\x20local\x20dir\x20'+_0x5dd4cf+'\x20('+(_0x1c348a instanceof Error?_0x1c348a[_0x3fe15d(0x17f)]:String(_0x1c348a))+').');}_0x399593++,_0x3e4841[_0x3fe15d(0x16c)]&&_0x3e4841[_0x3fe15d(0x157)]?console[_0x3fe15d(0x17b)]('\x20\x20✓\x20'+_0x3e4841[_0x3fe15d(0x182)]+_0x3fe15d(0x177)+_0x3e4841['envKey']+_0x3fe15d(0x18a)):console[_0x3fe15d(0x17b)]('\x20\x20✓\x20'+_0x3e4841[_0x3fe15d(0x182)]+_0x3fe15d(0x177)+_0x3e4841[_0x3fe15d(0x186)]+')'),_0x213f41?.[_0x3fe15d(0x185)]('profile.migrate.succeeded',{'profileName':_0x3e4841[_0x3fe15d(0x182)],'envKey':_0x3e4841['envKey'],'wasGitTracked':_0x447cf2,'hadSession':_0x28b1c0,'savedCreds':_0x23c8b0});}catch(_0x2241ee){_0x267560++,console['log']('\x20\x20✗\x20'+_0x3e4841['profileName']+'\x20failed:\x20'+(_0x1e4af7['fgJAT'](_0x2241ee,Error)?_0x2241ee[_0x3fe15d(0x17f)]:String(_0x2241ee))),_0x213f41?.[_0x3fe15d(0x185)](_0x1e4af7['MEYEu'],{'profileName':_0x3e4841['profileName'],'error':_0x1e4af7['fgJAT'](_0x2241ee,Error)?_0x2241ee['message']:_0x1e4af7[_0x3fe15d(0x180)](String,_0x2241ee)});}}const _0x349a9d=[];if(_0x1e4af7['rBRuc'](_0x399593,0x0))_0x349a9d[_0x3fe15d(0x152)](_0x399593+_0x3fe15d(0x14e)+(_0x399593===0x1?'':'s')+_0x3fe15d(0x16b));if(_0x1e4af7['qQnCI'](_0xc18db3,0x0))_0x349a9d[_0x3fe15d(0x152)](_0x3fe15d(0x173)+_0xc18db3+_0x3fe15d(0x187)+(_0xc18db3===0x1?'y':_0x1e4af7[_0x3fe15d(0x172)]));if(_0x48c993>0x0)_0x349a9d['push'](_0x48c993+_0x3fe15d(0x16e));if(_0x267560>0x0)_0x349a9d[_0x3fe15d(0x152)](_0x267560+_0x3fe15d(0x171));if(_0x1e4af7['rBRuc'](_0x349a9d[_0x3fe15d(0x15f)],0x0))console[_0x3fe15d(0x17b)](_0x1e4af7[_0x3fe15d(0x181)](_0x349a9d[_0x3fe15d(0x169)]('.\x20'),'.'));}
1
+ (function(_0x2a8b41,_0x4b1ce2){const _0x3ef748=_0x349f,_0x5dd8c8=_0x2a8b41();while(!![]){try{const _0x56c228=-parseInt(_0x3ef748(0x17c))/0x1+-parseInt(_0x3ef748(0x143))/0x2*(-parseInt(_0x3ef748(0x156))/0x3)+-parseInt(_0x3ef748(0x157))/0x4*(-parseInt(_0x3ef748(0x176))/0x5)+parseInt(_0x3ef748(0x148))/0x6*(parseInt(_0x3ef748(0x127))/0x7)+-parseInt(_0x3ef748(0x15d))/0x8+parseInt(_0x3ef748(0x175))/0x9*(-parseInt(_0x3ef748(0x141))/0xa)+parseInt(_0x3ef748(0x16e))/0xb*(parseInt(_0x3ef748(0x171))/0xc);if(_0x56c228===_0x4b1ce2)break;else _0x5dd8c8['push'](_0x5dd8c8['shift']());}catch(_0x57fce8){_0x5dd8c8['push'](_0x5dd8c8['shift']());}}}(_0x25f7,0x19fd6));import{readFile,rm}from'fs/promises';function _0x25f7(){const _0x2e5d11=['\x20\x20⚠\x20','\x20\x20✗\x20','\x20\x20✓\x20',').\x20Cloud\x20profile\x20created;\x20local\x20auth.json\x20left\x20in\x20place.','SKhkg','1378960YXWmPg','utf-8','log','\x20→\x20cloud\x20(env:\x20','eKiJL','dryRun','baseUrl','\x20migrated','parse','\x20failed:\x20','hEHii','cwd','settings','Zvriw','projects','FONkG','XpfVu','220GmgQFA','kgdqT','\x20skipped','29100GpZNfD','Proceed?','profileName','authJsonPath','2259bxUyIl','5dulRFl','VOMsx','trackPhaseEnd','XOTmd','message','ktVkv','205482dQtVVL','some','no\x20baseUrl\x20in\x20settings.json','preserveBaseUrl',',\x20matches\x20','skip','yes','Could\x20not\x20fetch\x20auth\x20config\x20(','Enzbf','wnLIL','keys','894873iBYuRy','rBDXl','length','\x20\x20echo\x20\x27.ranger/\x27\x20>>\x20.gitignore','\x20local\x20director','oDQSK','environments','trackPhaseStart','gAMYi','stdin',':\x20failed\x20to\x20write\x20projects.json\x20override\x20(',',\x20baseUrl\x20override\x20→\x20projects.json)','Warning:\x20.ranger/\x20is\x20tracked\x20in\x20this\x20git\x20repo.','BVqwd','EawFk','origin','EZjuK','LTQUq','dsUpR','uTLof','eoVRX','Continuing\x20with\x20migration...','kind','Deleted\x20','env','JIZnl','870PWDvsA','stdout','3962GTAwlG','uJBgz','Plan:','\x20→\x20skip\x20(','WyAle','6MMTpqS','push',':\x20session\x20upload\x20failed\x20(','mDhhJ','gIlHi','gitTrackedRanger','EkqyS','migrate','profile.migrate.succeeded','YRzQN','Provide\x20a\x20profile\x20name\x20or\x20--all.\x0a\x20\x20Example:\x20ranger\x20profile\x20migrate\x20--all\x20--dry-run','envKey','Nothing\x20migrated.\x20Run\x20without\x20--dry-run\x20to\x20apply.','padEnd','201mcuPwv','788308eQerDi'];_0x25f7=function(){return _0x2e5d11;};return _0x25f7();}import{existsSync}from'fs';import{join}from'path';import _0x220dd6 from'inquirer';import{getEnvNames}from'./env.js';import{getEnvDir,loadSettings}from'./utils/settings.js';function _0x349f(_0xcf1138,_0x3f1733){_0xcf1138=_0xcf1138-0x124;const _0x25f719=_0x25f7();let _0x349fe1=_0x25f719[_0xcf1138];return _0x349fe1;}import{getRangerDir}from'./utils/rangerRoot.js';import{ApiError,createCloudProfile,fetchAuthConfig,saveCloudProfileCredentials,uploadCloudProfileSession}from'./utils/cloudProfile.js';import{matchAuthEnvironment}from'./utils/matchAuthEnvironment.js';import{readProjectsConfig,setProfileOverride,writeProjectsConfig}from'./utils/projectsConfig.js';import{isPathGitTracked}from'./utils/gitTracked.js';function formatPlanLine(_0x1d75f0){const _0x4574ca=_0x349f,_0x265744={'EZjuK':function(_0x7914c3,_0x1c8de6){return _0x7914c3===_0x1c8de6;},'WqfRp':_0x4574ca(0x181)};if(_0x265744[_0x4574ca(0x137)](_0x1d75f0['kind'],_0x265744['WqfRp']))return'\x20\x20'+_0x1d75f0['profileName'][_0x4574ca(0x155)](0x1e)+_0x4574ca(0x146)+_0x1d75f0['reason']+')';if(_0x1d75f0['preserveBaseUrl']&&_0x1d75f0[_0x4574ca(0x163)])return'\x20\x20'+_0x1d75f0['profileName'][_0x4574ca(0x155)](0x1e)+_0x4574ca(0x160)+_0x1d75f0[_0x4574ca(0x153)]+',\x20preserving\x20baseUrl\x20'+_0x1d75f0['baseUrl']+'\x20as\x20project\x20override)';if(_0x1d75f0['baseUrl'])return'\x20\x20'+_0x1d75f0[_0x4574ca(0x173)][_0x4574ca(0x155)](0x1e)+_0x4574ca(0x160)+_0x1d75f0['envKey']+_0x4574ca(0x180)+_0x1d75f0['baseUrl']+')';return'\x20\x20'+_0x1d75f0['profileName'][_0x4574ca(0x155)](0x1e)+'\x20→\x20cloud\x20(env:\x20'+_0x1d75f0['envKey']+')';}function shouldWarnGitTrackedOnce(_0x3f88ce){const _0x20474f=_0x349f,_0x1f5553=readProjectsConfig(),_0x59b470=_0x1f5553[_0x20474f(0x16b)][_0x3f88ce]??={},_0x1aed03=_0x59b470['_warnings']??={},_0x41ce57=_0x1aed03['gitTrackedRanger'],_0x85002d=new Date(),_0x1a7e44=_0x85002d['toISOString']()['slice'](0x0,0xa);if(_0x41ce57===_0x1a7e44)return![];return _0x1aed03[_0x20474f(0x14d)]=_0x1a7e44,writeProjectsConfig(_0x1f5553),!![];}export async function migrateProfile(_0xcb3938,_0x1fbc3e){const _0x2dfb70=_0x349f,_0x582e1c={'RXkhI':function(_0x505ee1){return _0x505ee1();},'SKhkg':function(_0x38cbaa,_0x1701d2){return _0x38cbaa instanceof _0x1701d2;},'XOTmd':function(_0x577721,_0x34160a){return _0x577721(_0x34160a);},'aVWWt':function(_0x12049f,_0x184a15){return _0x12049f===_0x184a15;},'BVqwd':'No\x20cloud\x20profile\x20auth\x20config\x20found\x20for\x20this\x20org.\x20Migration\x20requires\x20at\x20least\x20one\x20configured\x20auth\x20environment.','hdPCu':function(_0x4ba20a){return _0x4ba20a();},'Zvriw':function(_0x29a97e,_0x1ba124){return _0x29a97e===_0x1ba124;},'lmPVv':'No\x20local\x20profiles\x20found\x20to\x20migrate.','gAMYi':'local\x20profile\x20directory\x20not\x20found','WyAle':function(_0x278220,_0x9dddeb){return _0x278220(_0x9dddeb);},'hEHii':'skip','gIlHi':_0x2dfb70(0x17e),'MzWPB':function(_0x3a78cc,_0x332a6e,_0x15f610){return _0x3a78cc(_0x332a6e,_0x15f610);},'VOMsx':'no\x20matching\x20auth\x20env','zttGv':function(_0x753cbb,_0x3cf12c){return _0x753cbb===_0x3cf12c;},'kgdqT':'migrate','wnLIL':function(_0x38bec3,_0x36f683){return _0x38bec3(_0x36f683);},'EkqyS':_0x2dfb70(0x154),'uTLof':function(_0x22c5ea,_0x35ef18){return _0x22c5ea&&_0x35ef18;},'ktVkv':'confirm','XpfVu':function(_0x349c49){return _0x349c49();},'YRzQN':_0x2dfb70(0x133),'JIZnl':'\x20\x20git\x20rm\x20-r\x20--cached\x20.ranger/','LTQUq':_0x2dfb70(0x12a),'GHsmC':'profile.migrate.skipped','ylUrO':'profile.migrate.started','EawFk':function(_0x46024d,_0x25855a,_0x3430d1,_0x3183f7){return _0x46024d(_0x25855a,_0x3430d1,_0x3183f7);},'Enzbf':_0x2dfb70(0x15e),'uJBgz':function(_0x6de522,_0x63efd2){return _0x6de522&&_0x63efd2;},'eoVRX':_0x2dfb70(0x163),'oDQSK':function(_0xf6dbcf,_0x15d999){return _0xf6dbcf(_0x15d999);},'eKiJL':function(_0x594000,_0x521ae0){return _0x594000(_0x521ae0);},'bEbFR':function(_0x28e8d6,_0x559fee){return _0x28e8d6>_0x559fee;},'sBlfh':function(_0x2df934,_0x573994){return _0x2df934===_0x573994;},'mDhhJ':function(_0xc69a6d,_0x33e997){return _0xc69a6d===_0x33e997;},'dsUpR':'ies','FONkG':function(_0x4fddd1,_0x40b9db){return _0x4fddd1>_0x40b9db;},'rBDXl':function(_0x46b6cd,_0xac24b9){return _0x46b6cd+_0xac24b9;}};if(!_0xcb3938['profileName']&&!_0xcb3938['all'])throw new Error(_0x2dfb70(0x152));let _0x37dad2;try{_0x37dad2=await _0x582e1c['RXkhI'](fetchAuthConfig);}catch(_0x3c1419){throw new Error(_0x2dfb70(0x183)+(_0x582e1c['SKhkg'](_0x3c1419,Error)?_0x3c1419['message']:_0x582e1c[_0x2dfb70(0x179)](String,_0x3c1419))+').\x20Run:\x20ranger\x20setup');}if(!_0x37dad2||!_0x37dad2[_0x2dfb70(0x12d)]||_0x582e1c['aVWWt'](Object[_0x2dfb70(0x126)](_0x37dad2[_0x2dfb70(0x12d)])['length'],0x0))throw new Error(_0x582e1c[_0x2dfb70(0x134)]);const _0x36cf97=[];if(_0xcb3938['all']){const {envNames:_0x28879e,envTypes:_0xf0a0ef}=await _0x582e1c['hdPCu'](getEnvNames);for(const _0x158902 of _0x28879e){if(_0xf0a0ef[_0x158902]==='ci')continue;_0x36cf97[_0x2dfb70(0x149)](_0x158902);}}else _0xcb3938['profileName']&&_0x36cf97[_0x2dfb70(0x149)](_0xcb3938[_0x2dfb70(0x173)]);if(_0x582e1c[_0x2dfb70(0x16a)](_0x36cf97['length'],0x0)){console['log'](_0x582e1c['lmPVv']);return;}const _0x5bcbb2=[];for(const _0x6e3d31 of _0x36cf97){const _0x4e958f=getEnvDir(_0x6e3d31);if(!existsSync(_0x4e958f)){_0x5bcbb2['push']({'kind':'skip','profileName':_0x6e3d31,'reason':_0x582e1c[_0x2dfb70(0x12f)]});continue;}const _0x58da60=await _0x582e1c[_0x2dfb70(0x147)](loadSettings,_0x6e3d31),_0x3b6dda=_0x58da60[_0x2dfb70(0x163)];if(!_0x3b6dda){_0x5bcbb2['push']({'kind':_0x582e1c['hEHii'],'profileName':_0x6e3d31,'reason':_0x582e1c[_0x2dfb70(0x14c)]});continue;}const _0x302a1f=_0x582e1c['MzWPB'](matchAuthEnvironment,_0x3b6dda,_0x37dad2);if(!_0x302a1f){_0x5bcbb2[_0x2dfb70(0x149)]({'kind':_0x582e1c[_0x2dfb70(0x167)],'profileName':_0x6e3d31,'reason':_0x582e1c[_0x2dfb70(0x177)]});continue;}const _0x1778fe=_0x37dad2[_0x2dfb70(0x12d)][_0x302a1f],_0x329a08=_0x1778fe?.['domains']??[],_0x4d6b0e=_0x329a08[_0x2dfb70(0x17d)](_0x351af7=>{const _0x217084=_0x2dfb70;try{return new URL(_0x351af7)['origin']===new URL(_0x3b6dda)[_0x217084(0x136)];}catch{return![];}}),_0x2c08db={};for(const [_0x30af4f,_0x518060]of Object['entries'](_0x58da60)){if(_0x30af4f==='baseUrl')continue;if(_0x582e1c['zttGv'](_0x518060,undefined))continue;_0x2c08db[_0x30af4f]=_0x518060;}!_0x4d6b0e&&(_0x2c08db['baseUrl']=_0x3b6dda);const _0x2b28dd=join(_0x4e958f,'auth.json'),_0x16d794=existsSync(_0x2b28dd);_0x5bcbb2[_0x2dfb70(0x149)]({'kind':_0x582e1c[_0x2dfb70(0x16f)],'profileName':_0x6e3d31,'envKey':_0x302a1f,'baseUrl':_0x3b6dda,'preserveBaseUrl':!_0x4d6b0e,'settings':_0x2c08db,'authJsonPath':_0x16d794?_0x2b28dd:null});}console['log'](_0x2dfb70(0x145));for(const _0x13bebe of _0x5bcbb2){console['log'](_0x582e1c[_0x2dfb70(0x125)](formatPlanLine,_0x13bebe));}if(_0xcb3938[_0x2dfb70(0x162)]){console['log'](_0x582e1c[_0x2dfb70(0x14e)]);return;}const _0x10433d=_0x582e1c[_0x2dfb70(0x125)](Boolean,process[_0x2dfb70(0x130)]['isTTY']&&process[_0x2dfb70(0x142)]['isTTY']),_0x5ac4f5=_0x5bcbb2[_0x2dfb70(0x17d)](_0x29f5b8=>_0x29f5b8['kind']===_0x2dfb70(0x14f));if(_0x582e1c[_0x2dfb70(0x13a)](_0x5ac4f5,_0x10433d)&&!_0xcb3938[_0x2dfb70(0x182)]){const {proceed:_0x30687b}=await _0x220dd6['prompt']([{'type':_0x582e1c[_0x2dfb70(0x17b)],'name':'proceed','message':_0x2dfb70(0x172),'default':![]}]);if(!_0x30687b){console['log']('Aborted.');return;}}const _0x28f550=_0x582e1c[_0x2dfb70(0x16d)](getRangerDir);let _0x2f1660=![];if(existsSync(_0x28f550))try{_0x2f1660=await _0x582e1c[_0x2dfb70(0x125)](isPathGitTracked,_0x28f550);}catch{_0x2f1660=![];}_0x2f1660&&_0x582e1c['XOTmd'](shouldWarnGitTrackedOnce,process['cwd']())&&(console['log'](_0x582e1c[_0x2dfb70(0x151)]),console['log']('After\x20migration,\x20uncommit\x20it:'),console[_0x2dfb70(0x15f)](_0x582e1c[_0x2dfb70(0x140)]),console[_0x2dfb70(0x15f)](_0x582e1c[_0x2dfb70(0x138)]),console['log'](_0x2dfb70(0x13c)));let _0x4d02cc=0x0,_0x3415ae=0x0,_0x354588=0x0,_0x4823b3=0x0;for(const _0x17ced4 of _0x5bcbb2){if(_0x17ced4[_0x2dfb70(0x13d)]===_0x2dfb70(0x181)){_0x4823b3++,_0x1fbc3e?.[_0x2dfb70(0x178)](_0x582e1c['GHsmC'],{'profileName':_0x17ced4['profileName'],'reason':_0x17ced4['reason']});continue;}_0x1fbc3e?.[_0x2dfb70(0x12e)](_0x582e1c['ylUrO'],{'profileName':_0x17ced4['profileName'],'envKey':_0x17ced4['envKey']});try{try{await _0x582e1c[_0x2dfb70(0x135)](createCloudProfile,_0x17ced4['profileName'],_0x17ced4[_0x2dfb70(0x153)],{'settings':_0x17ced4[_0x2dfb70(0x169)]});}catch(_0x47ad6f){if(_0x582e1c['SKhkg'](_0x47ad6f,ApiError)&&_0x47ad6f['status']===0x199){console[_0x2dfb70(0x15f)]('\x20\x20⚠\x20'+_0x17ced4['profileName']+':\x20cloud\x20profile\x20with\x20this\x20name\x20already\x20exists.\x20Skipping.'),_0x4823b3++,_0x1fbc3e?.['trackPhaseEnd'](_0x582e1c['GHsmC'],{'profileName':_0x17ced4['profileName'],'reason':'name_conflict'});continue;}throw _0x47ad6f;}let _0xe5fc6a=![],_0x272e6c=![];if(_0x17ced4[_0x2dfb70(0x174)])try{const _0xbaacfd=await _0x582e1c['MzWPB'](readFile,_0x17ced4[_0x2dfb70(0x174)],_0x582e1c[_0x2dfb70(0x124)]),_0x4f4cba=JSON[_0x2dfb70(0x165)](_0xbaacfd);await uploadCloudProfileSession(_0x17ced4['profileName'],_0x4f4cba),_0xe5fc6a=!![];}catch(_0x41d8d8){_0x272e6c=!![],console[_0x2dfb70(0x15f)]('\x20\x20⚠\x20'+_0x17ced4['profileName']+_0x2dfb70(0x14a)+(_0x41d8d8 instanceof Error?_0x41d8d8[_0x2dfb70(0x17a)]:_0x582e1c['XOTmd'](String,_0x41d8d8))+_0x2dfb70(0x15b));}let _0x18243d=![];if(_0xcb3938['saveCreds']){const _0x539a3d=process[_0x2dfb70(0x13f)]['RANGER_TEST_USERNAME'],_0x49c7b6=process['env']['RANGER_TEST_PASSWORD'];if(_0x582e1c[_0x2dfb70(0x144)](_0x539a3d,_0x49c7b6))try{await saveCloudProfileCredentials(_0x17ced4['profileName'],_0x539a3d,_0x49c7b6),_0x18243d=!![];}catch(_0x2a6e3e){console['log']('\x20\x20⚠\x20'+_0x17ced4['profileName']+':\x20failed\x20to\x20save\x20credentials\x20('+(_0x2a6e3e instanceof Error?_0x2a6e3e['message']:String(_0x2a6e3e))+').');}else console['log'](_0x2dfb70(0x158)+_0x17ced4[_0x2dfb70(0x173)]+':\x20--save-creds\x20requested,\x20but\x20RANGER_TEST_USERNAME/PASSWORD\x20not\x20set\x20in\x20env.');}if(_0x17ced4[_0x2dfb70(0x17f)]&&_0x17ced4['baseUrl'])try{setProfileOverride(process[_0x2dfb70(0x168)](),_0x17ced4['profileName'],_0x582e1c[_0x2dfb70(0x13b)],_0x17ced4[_0x2dfb70(0x163)]);}catch(_0x13bd2c){console[_0x2dfb70(0x15f)](_0x2dfb70(0x158)+_0x17ced4['profileName']+_0x2dfb70(0x131)+(_0x13bd2c instanceof Error?_0x13bd2c['message']:String(_0x13bd2c))+').');}const _0x2ee722=getEnvDir(_0x17ced4[_0x2dfb70(0x173)]);if(!_0x272e6c&&existsSync(_0x2ee722))try{await rm(_0x2ee722,{'recursive':!![],'force':!![]}),_0x3415ae++;}catch(_0x76164e){console[_0x2dfb70(0x15f)]('\x20\x20⚠\x20'+_0x17ced4['profileName']+':\x20failed\x20to\x20delete\x20local\x20dir\x20'+_0x2ee722+'\x20('+(_0x76164e instanceof Error?_0x76164e['message']:String(_0x76164e))+').');}_0x4d02cc++,_0x17ced4[_0x2dfb70(0x17f)]&&_0x17ced4['baseUrl']?console['log']('\x20\x20✓\x20'+_0x17ced4['profileName']+'\x20migrated\x20to\x20cloud\x20(env:\x20'+_0x17ced4[_0x2dfb70(0x153)]+_0x2dfb70(0x132)):console[_0x2dfb70(0x15f)](_0x2dfb70(0x15a)+_0x17ced4['profileName']+'\x20migrated\x20to\x20cloud\x20(env:\x20'+_0x17ced4['envKey']+')'),_0x1fbc3e?.['trackPhaseEnd'](_0x2dfb70(0x150),{'profileName':_0x17ced4[_0x2dfb70(0x173)],'envKey':_0x17ced4[_0x2dfb70(0x153)],'wasGitTracked':_0x2f1660,'hadSession':_0xe5fc6a,'savedCreds':_0x18243d});}catch(_0x1dc2fa){_0x354588++,console[_0x2dfb70(0x15f)](_0x2dfb70(0x159)+_0x17ced4[_0x2dfb70(0x173)]+_0x2dfb70(0x166)+(_0x582e1c[_0x2dfb70(0x15c)](_0x1dc2fa,Error)?_0x1dc2fa['message']:_0x582e1c[_0x2dfb70(0x12c)](String,_0x1dc2fa))),_0x1fbc3e?.['trackPhaseEnd']('profile.migrate.failed',{'profileName':_0x17ced4['profileName'],'error':_0x1dc2fa instanceof Error?_0x1dc2fa[_0x2dfb70(0x17a)]:_0x582e1c[_0x2dfb70(0x161)](String,_0x1dc2fa)});}}const _0x485352=[];if(_0x582e1c['bEbFR'](_0x4d02cc,0x0))_0x485352[_0x2dfb70(0x149)](_0x4d02cc+'\x20profile'+(_0x582e1c['sBlfh'](_0x4d02cc,0x1)?'':'s')+_0x2dfb70(0x164));if(_0x3415ae>0x0)_0x485352[_0x2dfb70(0x149)](_0x2dfb70(0x13e)+_0x3415ae+_0x2dfb70(0x12b)+(_0x582e1c[_0x2dfb70(0x14b)](_0x3415ae,0x1)?'y':_0x582e1c[_0x2dfb70(0x139)]));if(_0x582e1c[_0x2dfb70(0x16c)](_0x4823b3,0x0))_0x485352['push'](_0x4823b3+_0x2dfb70(0x170));if(_0x582e1c[_0x2dfb70(0x16c)](_0x354588,0x0))_0x485352[_0x2dfb70(0x149)](_0x354588+'\x20failed');if(_0x485352[_0x2dfb70(0x129)]>0x0)console['log'](_0x582e1c[_0x2dfb70(0x128)](_0x485352['join']('.\x20'),'.'));}
@@ -1 +1 @@
1
- function _0x1e13(){const _0x3572ab=['48KwzeZg','project','ranger-testing/trailhead','KcEGn','error','NhHFG','AvLvX','28430325RWWAOx','--scope','confirm','aUSIV','\x0a📦\x20Claude\x20Code\x20Plugin\x0a','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','fXCpz','3247893vSHcCR','install','2503632NYZnOf','87879QuFimn','kSXwB','uSiNa','351232aIvZBV','✓\x20Marketplace\x20already\x20added','SKILL.md','marketplace','TeIal','HTMjC','NQxcq','gxoXq','ejByJ','nDrSc','✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','hPmbi','Wosfm','log','7WMAJRJ','ranger','❌\x20Failed\x20to\x20add\x20marketplace:','add','5HtTinm','XDGWG','684461CcSlOx','1407878Yokvyt','prompt','.claude','20idGoOX','heqUg','trailhead','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead'];_0x1e13=function(){return _0x3572ab;};return _0x1e13();}(function(_0x5475c4,_0xc520d5){const _0x29ca44=_0x1a76,_0x308098=_0x5475c4();while(!![]){try{const _0x3f155a=-parseInt(_0x29ca44(0x1ce))/0x1+-parseInt(_0x29ca44(0x1cf))/0x2+parseInt(_0x29ca44(0x1e7))/0x3*(parseInt(_0x29ca44(0x1d6))/0x4)+-parseInt(_0x29ca44(0x1fc))/0x5*(parseInt(_0x29ca44(0x1e6))/0x6)+-parseInt(_0x29ca44(0x1f8))/0x7*(-parseInt(_0x29ca44(0x1ea))/0x8)+-parseInt(_0x29ca44(0x1e4))/0x9*(parseInt(_0x29ca44(0x1d2))/0xa)+parseInt(_0x29ca44(0x1dd))/0xb;if(_0x3f155a===_0xc520d5)break;else _0x308098['push'](_0x308098['shift']());}catch(_0x30f852){_0x308098['push'](_0x308098['shift']());}}}(_0x1e13,0x6e7d9));import{join}from'path';import{existsSync}from'fs';import _0x493ddb from'inquirer';function _0x1a76(_0x1baaf7,_0x4ebdd2){_0x1baaf7=_0x1baaf7-0x1cd;const _0x1e13af=_0x1e13();let _0x1a765c=_0x1e13af[_0x1baaf7];return _0x1a765c;}import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x2ae0ad){const _0x3da89a=_0x1a76,_0x33fdfb={'heqUg':'ranger@trailhead','ksExi':function(_0xc827c7,_0x40f549){return _0xc827c7(_0x40f549);},'NMQFi':function(_0x289aa4,_0x3e371b,_0x1f5bb1){return _0x289aa4(_0x3e371b,_0x1f5bb1);},'ALgPx':_0x3da89a(0x1d1),'Bntrf':'User\x20(available\x20in\x20all\x20your\x20projects)','uSiNa':'user','CzPNL':_0x3da89a(0x1d7),'HTMjC':_0x3da89a(0x1eb),'OyJAo':function(_0x20edc0,_0x2017a8){return _0x20edc0(_0x2017a8);},'aUSIV':_0x3da89a(0x1fb),'Wosfm':_0x3da89a(0x1d8),'ejByJ':'\x0aYou\x20can\x20install\x20manually\x20with:','TeIal':_0x3da89a(0x1d5),'hPmbi':function(_0x2bac0,_0x123ad1){return _0x2bac0(_0x123ad1);},'AvLvX':'plugin','kSXwB':_0x3da89a(0x1f4),'gxoXq':'enable','nDrSc':function(_0x17c63c,_0x3db257,_0x30c30a){return _0x17c63c(_0x3db257,_0x30c30a);},'NQNYA':'⚠\x20Failed\x20to\x20enable\x20plugin:'},_0x587e3b=await isPluginInstalled(_0x33fdfb[_0x3da89a(0x1d3)]);if(_0x587e3b)return console['log']('✓\x20Claude\x20Code\x20plugin\x20already\x20installed'),![];const _0x47db5e=_0x33fdfb['ksExi'](existsSync,_0x33fdfb['NMQFi'](join,getProjectRoot(),_0x33fdfb['ALgPx']));let _0x159ac0;if(_0x2ae0ad)_0x159ac0=_0x2ae0ad;else{if(_0x47db5e)_0x159ac0=_0x3da89a(0x1d7);else{console[_0x3da89a(0x1f7)](_0x3da89a(0x1e1));const _0x1d0fa9=await _0x493ddb[_0x3da89a(0x1d0)]([{'type':'list','name':'pluginScope','message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':_0x33fdfb['Bntrf'],'value':_0x33fdfb['uSiNa']},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':_0x33fdfb['CzPNL']}],'default':_0x33fdfb[_0x3da89a(0x1e9)]}]);_0x159ac0=_0x1d0fa9['pluginScope'];}}console[_0x3da89a(0x1f7)]('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x159ac0+'\x20level)...\x0a');const _0x4a06ac=await isMarketplaceAdded(_0x3da89a(0x1d4));let _0x58bcbc=_0x4a06ac;if(_0x4a06ac)console['log'](_0x33fdfb[_0x3da89a(0x1ef)]);else{const _0x1a4faf=await _0x33fdfb['OyJAo'](runClaudeCommand,['plugin',_0x3da89a(0x1ed),_0x33fdfb[_0x3da89a(0x1e0)],_0x33fdfb[_0x3da89a(0x1f6)]]);!_0x1a4faf['success']?(console[_0x3da89a(0x1da)](_0x3da89a(0x1fa),_0x1a4faf['error']),console[_0x3da89a(0x1f7)](_0x33fdfb['ejByJ']),console[_0x3da89a(0x1f7)](_0x33fdfb[_0x3da89a(0x1ee)]),console['log']('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x159ac0)):_0x58bcbc=!![];}if(_0x58bcbc){const _0x3bd9a9=await _0x33fdfb[_0x3da89a(0x1f5)](runClaudeCommand,[_0x33fdfb['AvLvX'],_0x3da89a(0x1e5),'ranger@trailhead',_0x3da89a(0x1de),_0x159ac0]);if(!_0x3bd9a9['success'])console[_0x3da89a(0x1da)]('❌\x20Failed\x20to\x20install\x20plugin:',_0x3bd9a9[_0x3da89a(0x1da)]),console[_0x3da89a(0x1f7)](_0x33fdfb[_0x3da89a(0x1f2)]),console['log'](_0x3da89a(0x1e2)+_0x159ac0);else{console['log'](_0x33fdfb[_0x3da89a(0x1e8)]);const _0x40d66a=[_0x33fdfb[_0x3da89a(0x1dc)],_0x33fdfb[_0x3da89a(0x1f1)],'ranger@trailhead'];_0x159ac0===_0x33fdfb['CzPNL']&&_0x40d66a['push'](_0x3da89a(0x1de),_0x33fdfb['CzPNL']);const _0x477594=await _0x33fdfb[_0x3da89a(0x1f3)](runClaudeCommand,_0x40d66a,{'captureOutput':!![]}),_0x50c988=_0x477594['output']?.['includes']('already\x20enabled');!_0x477594['success']&&!_0x50c988?console['error'](_0x33fdfb['NQNYA'],_0x477594[_0x3da89a(0x1da)]):console[_0x3da89a(0x1f7)]('✓\x20Claude\x20Code\x20plugin\x20enabled');}}return!![];}export async function ensureClaudeSkills(_0x13f6a2){const _0x256702=_0x1a76,_0x1b99b7={'KcEGn':function(_0x3b510d,_0x1f7ec7){return _0x3b510d(_0x1f7ec7);},'XDGWG':function(_0x4e1ffa,_0x896969,_0x2316a5,_0x252465){return _0x4e1ffa(_0x896969,_0x2316a5,_0x252465);},'NQxcq':_0x256702(0x1f9),'NhHFG':_0x256702(0x1ec),'SKeCI':function(_0x466d7b,_0x1f43f8,_0xe61c2c,_0x4d7db8){return _0x466d7b(_0x1f43f8,_0xe61c2c,_0x4d7db8);},'fXCpz':_0x256702(0x1d7),'AulcR':_0x256702(0x1df)},_0x47d724=_0x1b99b7['KcEGn'](existsSync,_0x1b99b7[_0x256702(0x1cd)](join,getSkillsDir('user'),_0x1b99b7[_0x256702(0x1f0)],_0x1b99b7[_0x256702(0x1db)])),_0x16bed1=existsSync(_0x1b99b7['SKeCI'](join,_0x1b99b7['KcEGn'](getSkillsDir,_0x1b99b7[_0x256702(0x1e3)]),_0x256702(0x1f9),'SKILL.md'));if(_0x47d724||_0x16bed1)return console['log']('✓\x20Ranger\x20skills\x20already\x20installed'),![];const _0x1af963=existsSync(join(getProjectRoot(),'.claude'));let _0x4bcb02=!![];if(_0x13f6a2)await skillup({'autoInstall':_0x13f6a2,'suppressUsage':!![]});else{if(_0x1af963)await _0x1b99b7[_0x256702(0x1d9)](skillup,{'autoInstall':_0x1b99b7['fXCpz'],'suppressUsage':!![]});else{const _0x5870a7=await _0x493ddb['prompt']([{'type':_0x1b99b7['AulcR'],'name':'wantsSkillup','message':'Would\x20you\x20like\x20to\x20install\x20skills?','default':!![]}]);_0x4bcb02=_0x5870a7['wantsSkillup'],_0x4bcb02&&await skillup({'suppressUsage':!![]});}}return _0x4bcb02;}
1
+ (function(_0xd95e2e,_0x454ca9){const _0x467350=_0x4040,_0x49cfba=_0xd95e2e();while(!![]){try{const _0x5098ee=-parseInt(_0x467350(0x117))/0x1*(-parseInt(_0x467350(0x147))/0x2)+parseInt(_0x467350(0x116))/0x3+parseInt(_0x467350(0x146))/0x4*(parseInt(_0x467350(0x13b))/0x5)+-parseInt(_0x467350(0x13e))/0x6+parseInt(_0x467350(0x130))/0x7*(-parseInt(_0x467350(0x12b))/0x8)+-parseInt(_0x467350(0x145))/0x9+-parseInt(_0x467350(0x121))/0xa;if(_0x5098ee===_0x454ca9)break;else _0x49cfba['push'](_0x49cfba['shift']());}catch(_0x564f39){_0x49cfba['push'](_0x49cfba['shift']());}}}(_0x1c92,0xe829b));import{join}from'path';import{existsSync}from'fs';function _0x1c92(){const _0x4e2bf1=['user','9985vnaRxW','lOOZI','marketplace','1915722fpMzXS','glxzI','YQrRS','oPexQ','wVMOf','ranger','\x0aYou\x20can\x20install\x20manually\x20with:','395757MvvRQF','2084gGqgye','277898kauipW','PzrYD','Project\x20(shared\x20with\x20team\x20via\x20git)','eZGqq','ReMGa','gvTXP','❌\x20Failed\x20to\x20install\x20plugin:','rMhmJ','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','✓\x20Ranger\x20skills\x20already\x20installed','\x20level)...\x0a','4587132ArKlfW','7hbEoeF','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','ranger-testing/trailhead','ranger@trailhead','list','project','wantsSkillup','❌\x20Failed\x20to\x20add\x20marketplace:','SKILL.md','20817020gTiiaz','PrGHh','✓\x20Claude\x20Code\x20plugin\x20enabled','log','pluginScope','AtmvK','output','xjkDM','plugin','UGNKO','106344mKgQLe','success','CeUrZ','prompt','--scope','77JZbdjX','\x0a📦\x20Claude\x20Code\x20Plugin\x0a','.claude','error','LCgUY','User\x20(available\x20in\x20all\x20your\x20projects)','BaFqt','waatF','mqPDK','Would\x20you\x20like\x20to\x20install\x20skills?'];_0x1c92=function(){return _0x4e2bf1;};return _0x1c92();}import _0xcac262 from'inquirer';import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';function _0x4040(_0x84069d,_0x401085){_0x84069d=_0x84069d-0x10c;const _0x1c9281=_0x1c92();let _0x404022=_0x1c9281[_0x84069d];return _0x404022;}import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x2f82a5){const _0x31c80a=_0x4040,_0x50e629={'rMhmJ':function(_0x5632fd,_0x1ca44c){return _0x5632fd(_0x1ca44c);},'FCZhn':'ranger@trailhead','PzrYD':function(_0x508431,_0x159794,_0x3439ae){return _0x508431(_0x159794,_0x3439ae);},'COhGk':_0x31c80a(0x131),'JJNyg':'pluginScope','bcbLc':_0x31c80a(0x10d),'wVMOf':'project','YQrRS':_0x31c80a(0x13a),'BaFqt':function(_0x376061,_0x4a5cf8){return _0x376061(_0x4a5cf8);},'OiebE':_0x31c80a(0x129),'OrcxF':_0x31c80a(0x13d),'gvTXP':'add','glxzI':_0x31c80a(0x11f),'eZGqq':'\x0aYou\x20can\x20install\x20manually\x20with:','ssHMe':_0x31c80a(0x111),'mqPDK':'✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','btKSM':'enable','UGNKO':_0x31c80a(0x123)},_0x51eab6=await _0x50e629[_0x31c80a(0x112)](isPluginInstalled,_0x50e629['FCZhn']);if(_0x51eab6)return console['log'](_0x31c80a(0x118)),![];const _0x3320a5=existsSync(_0x50e629[_0x31c80a(0x10c)](join,getProjectRoot(),'.claude'));let _0x33d13d;if(_0x2f82a5)_0x33d13d=_0x2f82a5;else{if(_0x3320a5)_0x33d13d=_0x31c80a(0x11d);else{console['log'](_0x50e629['COhGk']);const _0x34af08=await _0xcac262[_0x31c80a(0x12e)]([{'type':_0x31c80a(0x11c),'name':_0x50e629['JJNyg'],'message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':_0x31c80a(0x135),'value':_0x31c80a(0x13a)},{'name':_0x50e629['bcbLc'],'value':_0x50e629[_0x31c80a(0x142)]}],'default':_0x50e629[_0x31c80a(0x140)]}]);_0x33d13d=_0x34af08[_0x31c80a(0x125)];}}console[_0x31c80a(0x124)]('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x33d13d+_0x31c80a(0x115));const _0x39d3fc=await _0x50e629[_0x31c80a(0x112)](isMarketplaceAdded,'trailhead');let _0x515d84=_0x39d3fc;if(_0x39d3fc)console[_0x31c80a(0x124)]('✓\x20Marketplace\x20already\x20added');else{const _0x2a179f=await _0x50e629[_0x31c80a(0x136)](runClaudeCommand,[_0x50e629['OiebE'],_0x50e629['OrcxF'],_0x50e629[_0x31c80a(0x110)],_0x31c80a(0x11a)]);!_0x2a179f[_0x31c80a(0x12c)]?(console[_0x31c80a(0x133)](_0x50e629[_0x31c80a(0x13f)],_0x2a179f['error']),console['log'](_0x50e629[_0x31c80a(0x10e)]),console['log'](_0x31c80a(0x113)),console['log'](_0x31c80a(0x119)+_0x33d13d)):_0x515d84=!![];}if(_0x515d84){const _0x33fa18=await _0x50e629['BaFqt'](runClaudeCommand,['plugin','install','ranger@trailhead','--scope',_0x33d13d]);if(!_0x33fa18['success'])console['error'](_0x50e629['ssHMe'],_0x33fa18[_0x31c80a(0x133)]),console[_0x31c80a(0x124)](_0x31c80a(0x144)),console[_0x31c80a(0x124)]('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x33d13d);else{console['log'](_0x50e629[_0x31c80a(0x138)]);const _0x2afdea=[_0x50e629['OiebE'],_0x50e629['btKSM'],_0x31c80a(0x11b)];_0x33d13d==='project'&&_0x2afdea['push'](_0x31c80a(0x12f),_0x50e629['wVMOf']);const _0xff0d0a=await runClaudeCommand(_0x2afdea,{'captureOutput':!![]}),_0xabaa2b=_0xff0d0a[_0x31c80a(0x127)]?.['includes']('already\x20enabled');!_0xff0d0a[_0x31c80a(0x12c)]&&!_0xabaa2b?console['error']('⚠\x20Failed\x20to\x20enable\x20plugin:',_0xff0d0a['error']):console['log'](_0x50e629[_0x31c80a(0x12a)]);}}return!![];}export async function ensureClaudeSkills(_0x38a7e6){const _0xdc43be=_0x4040,_0x5c8926={'LCgUY':'user','xjkDM':_0xdc43be(0x120),'waatF':function(_0x7e0e9,_0x33cf03){return _0x7e0e9(_0x33cf03);},'CeUrZ':function(_0x1fcbd7,_0x3308ee,_0x54c58c,_0x22cdb3){return _0x1fcbd7(_0x3308ee,_0x54c58c,_0x22cdb3);},'oPexQ':_0xdc43be(0x114),'ReMGa':function(_0x89b28f,_0x55396f,_0xff6d97){return _0x89b28f(_0x55396f,_0xff6d97);},'PrGHh':function(_0x36b640,_0x407fb4){return _0x36b640(_0x407fb4);},'izNju':'confirm','lOOZI':_0xdc43be(0x139),'AtmvK':function(_0x553d1f,_0x5577ef){return _0x553d1f(_0x5577ef);}},_0x4f09cf=existsSync(join(getSkillsDir(_0x5c8926[_0xdc43be(0x134)]),_0xdc43be(0x143),_0x5c8926[_0xdc43be(0x128)])),_0x19de23=_0x5c8926['waatF'](existsSync,_0x5c8926[_0xdc43be(0x12d)](join,_0x5c8926[_0xdc43be(0x137)](getSkillsDir,'project'),'ranger',_0xdc43be(0x120)));if(_0x4f09cf||_0x19de23)return console['log'](_0x5c8926[_0xdc43be(0x141)]),![];const _0x15792a=existsSync(_0x5c8926[_0xdc43be(0x10f)](join,getProjectRoot(),_0xdc43be(0x132)));let _0xa3b77a=!![];if(_0x38a7e6)await skillup({'autoInstall':_0x38a7e6,'suppressUsage':!![]});else{if(_0x15792a)await _0x5c8926[_0xdc43be(0x122)](skillup,{'autoInstall':_0xdc43be(0x11d),'suppressUsage':!![]});else{const _0x589f19=await _0xcac262[_0xdc43be(0x12e)]([{'type':_0x5c8926['izNju'],'name':'wantsSkillup','message':_0x5c8926[_0xdc43be(0x13c)],'default':!![]}]);_0xa3b77a=_0x589f19[_0xdc43be(0x11e)],_0xa3b77a&&await _0x5c8926[_0xdc43be(0x126)](skillup,{'suppressUsage':!![]});}}return _0xa3b77a;}
@@ -1 +1 @@
1
- (function(_0x4bacaf,_0x5df4d1){const _0x39a1c9=_0x3921,_0x85d465=_0x4bacaf();while(!![]){try{const _0x42b2d4=-parseInt(_0x39a1c9(0x1e9))/0x1+-parseInt(_0x39a1c9(0x1d1))/0x2*(-parseInt(_0x39a1c9(0x1d8))/0x3)+parseInt(_0x39a1c9(0x1e1))/0x4*(parseInt(_0x39a1c9(0x1d9))/0x5)+-parseInt(_0x39a1c9(0x1df))/0x6+-parseInt(_0x39a1c9(0x1e5))/0x7+parseInt(_0x39a1c9(0x1d0))/0x8*(parseInt(_0x39a1c9(0x1db))/0x9)+parseInt(_0x39a1c9(0x1e3))/0xa;if(_0x42b2d4===_0x5df4d1)break;else _0x85d465['push'](_0x85d465['shift']());}catch(_0x2080cf){_0x85d465['push'](_0x85d465['shift']());}}}(_0x1a16,0xafc9e));function _0x3921(_0x5ce049,_0x40e635){_0x5ce049=_0x5ce049-0x1cf;const _0x1a1696=_0x1a16();let _0x3921c8=_0x1a1696[_0x5ce049];return _0x3921c8;}import{join}from'path';import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0x3752b6 from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0x20ad2){const _0x2d12d1=_0x3921,_0x23b04f={'TxLdK':function(_0x3f63bd,_0x1ffb9b){return _0x3f63bd(_0x1ffb9b);},'GaEuc':function(_0x489ba0,_0x1c5197,_0x230c93){return _0x489ba0(_0x1c5197,_0x230c93);},'AtWge':_0x2d12d1(0x1ea),'bNBQr':'\x0a📦\x20OpenCode\x20Plugin\x0a','dgHyH':_0x2d12d1(0x1dc),'MIKIc':'Where\x20should\x20the\x20plugin\x20be\x20installed?','LImJQ':_0x2d12d1(0x1ec),'CxkEm':function(_0x2252bb,_0x12a073){return _0x2252bb(_0x12a073);},'IchRO':'https://opencode.ai/config.json','fDigz':'✓\x20OpenCode\x20plugin\x20already\x20configured','YUufr':function(_0x11b8b8,_0x1f6dac){return _0x11b8b8+_0x1f6dac;},'ExmKN':_0x2d12d1(0x1d4)},_0x4046b2=_0x23b04f[_0x2d12d1(0x1dd)](existsSync,_0x23b04f[_0x2d12d1(0x1cf)](join,_0x23b04f[_0x2d12d1(0x1dd)](getOpencodeConfigDir,_0x23b04f['AtWge']),'opencode.json'));let _0x3292ea;if(_0x20ad2)_0x3292ea=_0x20ad2;else{if(_0x4046b2)_0x3292ea=_0x23b04f[_0x2d12d1(0x1e4)];else{console['log'](_0x23b04f[_0x2d12d1(0x1e2)]);const _0x2aa85d=await _0x3752b6['prompt']([{'type':'list','name':_0x23b04f['dgHyH'],'message':_0x23b04f[_0x2d12d1(0x1de)],'choices':[{'name':'User\x20(available\x20in\x20all\x20your\x20projects)','value':'user'},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':_0x23b04f[_0x2d12d1(0x1e4)]}],'default':_0x23b04f['LImJQ']}]);_0x3292ea=_0x2aa85d[_0x2d12d1(0x1dc)];}}const _0x239609=join(_0x23b04f['CxkEm'](getOpencodeConfigDir,_0x3292ea),_0x2d12d1(0x1d5)),_0x51f7f0=_0x2d12d1(0x1e8),_0x2ce99f=_0x23b04f[_0x2d12d1(0x1ed)];let _0x13258d={};if(_0x23b04f[_0x2d12d1(0x1e0)](existsSync,_0x239609))try{const _0x402bc0=await readFile(_0x239609,'utf-8');_0x13258d=JSON['parse'](_0x402bc0);}catch(_0xddbde5){return console[_0x2d12d1(0x1d2)](_0x2d12d1(0x1e7)),{'configured':![],'scope':_0x3292ea,'error':'Failed\x20to\x20read\x20opencode.json','details':_0xddbde5};}const _0x5e15a1=Array['isArray'](_0x13258d['plugin'])?_0x13258d['plugin']:[];if(_0x5e15a1['includes'](_0x51f7f0))return console[_0x2d12d1(0x1da)](_0x23b04f[_0x2d12d1(0x1d7)]),{'configured':![],'scope':_0x3292ea};return _0x13258d['$schema']=_0x13258d[_0x2d12d1(0x1d6)]||_0x2ce99f,_0x13258d[_0x2d12d1(0x1e6)]=[..._0x5e15a1,_0x51f7f0],await _0x23b04f[_0x2d12d1(0x1cf)](mkdir,getOpencodeConfigDir(_0x3292ea),{'recursive':!![]}),await writeFile(_0x239609,_0x23b04f[_0x2d12d1(0x1eb)](JSON[_0x2d12d1(0x1d3)](_0x13258d,null,0x2),'\x0a')),console[_0x2d12d1(0x1da)](_0x23b04f['ExmKN']),{'configured':!![],'scope':_0x3292ea};}function _0x1a16(){const _0x5847ba=['CxkEm','4sdCYep','bNBQr','1624040PepCqb','AtWge','6983844KdbjDp','plugin','⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','@ranger-testing/opencode-plugin','641694EZjgGN','project','YUufr','user','IchRO','GaEuc','395288IzWjMW','4RoStsX','error','stringify','✓\x20OpenCode\x20plugin\x20configured','opencode.json','$schema','fDigz','1883691iKPeee','5232095JAUnqm','log','99EwXgnt','pluginScope','TxLdK','MIKIc','3892332BjkUrb'];_0x1a16=function(){return _0x5847ba;};return _0x1a16();}
1
+ (function(_0x509d9d,_0x4a231d){const _0x4d4758=_0x1b1c,_0x9dd1c3=_0x509d9d();while(!![]){try{const _0x5e55cf=-parseInt(_0x4d4758(0xe7))/0x1*(parseInt(_0x4d4758(0xf8))/0x2)+parseInt(_0x4d4758(0xf1))/0x3+parseInt(_0x4d4758(0xdc))/0x4*(-parseInt(_0x4d4758(0xf5))/0x5)+-parseInt(_0x4d4758(0xe3))/0x6*(parseInt(_0x4d4758(0xed))/0x7)+-parseInt(_0x4d4758(0xef))/0x8*(parseInt(_0x4d4758(0xfc))/0x9)+-parseInt(_0x4d4758(0xfb))/0xa*(parseInt(_0x4d4758(0xee))/0xb)+parseInt(_0x4d4758(0xe8))/0xc;if(_0x5e55cf===_0x4a231d)break;else _0x9dd1c3['push'](_0x9dd1c3['shift']());}catch(_0x208f39){_0x9dd1c3['push'](_0x9dd1c3['shift']());}}}(_0x43d5,0x88a87));import{join}from'path';import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';function _0x1b1c(_0x4705d2,_0xbcb6fd){_0x4705d2=_0x4705d2-0xdb;const _0x43d554=_0x43d5();let _0x1b1c7c=_0x43d554[_0x4705d2];return _0x1b1c7c;}import _0x4184ba from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';function _0x43d5(){const _0x54bb06=['Where\x20should\x20the\x20plugin\x20be\x20installed?','prompt','38330HxvMCF','pOypP','error','1584OKrVSZ','ZDNOi','zUJgS','10AgKUgZ','20151DMWbhM','$schema','pluginScope','YumJd','172ulgUcW','stringify','includes','✓\x20OpenCode\x20plugin\x20configured','https://opencode.ai/config.json','QGHxm','iGVql','114MTDpJj','clfYN','njwRJ','QPsFw','40KfbFCc','17460720ytMYIn','log','list','parse','\x0a📦\x20OpenCode\x20Plugin\x0a','55643eBvWmV','8793488ZKqZgm','808snNUnB','VOWfC','1927761PoUZnq','project'];_0x43d5=function(){return _0x54bb06;};return _0x43d5();}export async function ensureOpencodePluginConfig(_0x4610d1){const _0x5f3c5e=_0x1b1c,_0x162d93={'YumJd':_0x5f3c5e(0xf2),'QPsFw':'opencode.json','pOypP':_0x5f3c5e(0xec),'QGukd':_0x5f3c5e(0xea),'noXnX':_0x5f3c5e(0xf3),'VOWfC':'User\x20(available\x20in\x20all\x20your\x20projects)','iGVql':'user','HWvti':'Project\x20(shared\x20with\x20team\x20via\x20git)','LsHFg':function(_0x4301cb,_0x466472,_0x3c8bda){return _0x4301cb(_0x466472,_0x3c8bda);},'bKTFQ':'@ranger-testing/opencode-plugin','okEXj':_0x5f3c5e(0xe0),'GhjSK':function(_0x385895,_0x31cdbf){return _0x385895(_0x31cdbf);},'clfYN':function(_0x2de9ef,_0x4727c7,_0x15ecbf){return _0x2de9ef(_0x4727c7,_0x15ecbf);},'QGHxm':'utf-8','zUJgS':'⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','xhVAj':'✓\x20OpenCode\x20plugin\x20already\x20configured','njwRJ':function(_0x379b1d,_0x491ee4){return _0x379b1d(_0x491ee4);},'ZDNOi':_0x5f3c5e(0xdf)},_0x1b158c=existsSync(join(getOpencodeConfigDir(_0x162d93['YumJd']),_0x162d93['QPsFw']));let _0x4ed39c;if(_0x4610d1)_0x4ed39c=_0x4610d1;else{if(_0x1b158c)_0x4ed39c=_0x162d93[_0x5f3c5e(0xdb)];else{console[_0x5f3c5e(0xe9)](_0x162d93[_0x5f3c5e(0xf6)]);const _0x2306d2=await _0x4184ba[_0x5f3c5e(0xf4)]([{'type':_0x162d93['QGukd'],'name':_0x5f3c5e(0xfe),'message':_0x162d93['noXnX'],'choices':[{'name':_0x162d93[_0x5f3c5e(0xf0)],'value':_0x162d93[_0x5f3c5e(0xe2)]},{'name':_0x162d93['HWvti'],'value':_0x162d93[_0x5f3c5e(0xdb)]}],'default':_0x162d93['iGVql']}]);_0x4ed39c=_0x2306d2['pluginScope'];}}const _0x41b183=_0x162d93['LsHFg'](join,getOpencodeConfigDir(_0x4ed39c),_0x162d93[_0x5f3c5e(0xe6)]),_0x510a95=_0x162d93['bKTFQ'],_0x44e10e=_0x162d93['okEXj'];let _0x4bfc2e={};if(_0x162d93['GhjSK'](existsSync,_0x41b183))try{const _0x43a73e=await _0x162d93[_0x5f3c5e(0xe4)](readFile,_0x41b183,_0x162d93[_0x5f3c5e(0xe1)]);_0x4bfc2e=JSON[_0x5f3c5e(0xeb)](_0x43a73e);}catch(_0x540c0a){return console[_0x5f3c5e(0xf7)](_0x162d93[_0x5f3c5e(0xfa)]),{'configured':![],'scope':_0x4ed39c,'error':'Failed\x20to\x20read\x20opencode.json','details':_0x540c0a};}const _0x257b53=Array['isArray'](_0x4bfc2e['plugin'])?_0x4bfc2e['plugin']:[];if(_0x257b53[_0x5f3c5e(0xde)](_0x510a95))return console['log'](_0x162d93['xhVAj']),{'configured':![],'scope':_0x4ed39c};return _0x4bfc2e[_0x5f3c5e(0xfd)]=_0x4bfc2e[_0x5f3c5e(0xfd)]||_0x44e10e,_0x4bfc2e['plugin']=[..._0x257b53,_0x510a95],await mkdir(_0x162d93[_0x5f3c5e(0xe5)](getOpencodeConfigDir,_0x4ed39c),{'recursive':!![]}),await writeFile(_0x41b183,JSON[_0x5f3c5e(0xdd)](_0x4bfc2e,null,0x2)+'\x0a'),console[_0x5f3c5e(0xe9)](_0x162d93[_0x5f3c5e(0xf9)]),{'configured':!![],'scope':_0x4ed39c};}
@@ -1 +1 @@
1
- function _0x5d46(){const _0x266669=['You\x20can\x20install\x20manually:\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20project','project','name','VGUAT','auth','GuusU','dir_setup','Failed\x20to\x20install\x20plugin:','ranger-testing/trailhead','1545752EomiPM','9zvxPkd','PyNkZ','log','OeShw','✓\x20Active\x20profile:\x20','AZJct','Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.','path','.\x20Use\x20--profile\x20to\x20specify\x20which\x20one.','9457vBESXg','UQyXD','--scope','xlhkY','QhOSq','1194XbXkeJ','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','rSpJL','yyHPY','error','OpVhf','FYGMe','Failed\x20to\x20add\x20marketplace:','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','idTFC','561937sNBIiI','SSODK','profile_activate','filter','\x22:\x20','✓\x20Created\x20profile\x20settings:\x20baseUrl=','pniiV','✓\x20Encrypted\x20auth\x20verified\x20(will\x20decrypt\x20at\x20runtime)','trackPhaseEnd','4205410ecAGaZ','rQobz','XcFco','join','\x0a🔧\x20Ranger\x20CI\x20Setup\x0a','81471AizoiS','chromium','success','\x0a✅\x20Ranger\x20CI\x20setup\x20complete!\x0a','1919580lPKdhp','xHYIY','trackPhaseStart','kwKFl','\x22\x20has\x20no\x20settings.json.\x20Use\x20--base-url\x20to\x20configure\x20it.','10569824trfAsK','skipChromium','baseUrl'];_0x5d46=function(){return _0x266669;};return _0x5d46();}(function(_0x2db84e,_0x334f95){const _0x385d17=_0x1441,_0x34a916=_0x2db84e();while(!![]){try{const _0xebfba2=-parseInt(_0x385d17(0x1c2))/0x1+-parseInt(_0x385d17(0x1a9))/0x2+-parseInt(_0x385d17(0x1d0))/0x3+-parseInt(_0x385d17(0x1d4))/0x4+parseInt(_0x385d17(0x1cb))/0x5+parseInt(_0x385d17(0x1b8))/0x6*(parseInt(_0x385d17(0x1b3))/0x7)+parseInt(_0x385d17(0x1d9))/0x8*(parseInt(_0x385d17(0x1aa))/0x9);if(_0xebfba2===_0x334f95)break;else _0x34a916['push'](_0x34a916['shift']());}catch(_0x266069){_0x34a916['push'](_0x34a916['shift']());}}}(_0x5d46,0x8fdee));import{mkdir,readFile,readdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{authenticate,ensureRangerDir,ensureChromium,writeRangerGitignore}from'./start.js';import{skillup}from'./skillup.js';import{getRangerDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{saveSettings}from'./utils/settings.js';import{decrypt}from'./utils/crypto.js';import{getToken}from'./utils/keychain.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'./utils/claudePlugin.js';function _0x1441(_0x19a6cc,_0x3d2e97){_0x19a6cc=_0x19a6cc-0x1a9;const _0x5d46a8=_0x5d46();let _0x144181=_0x5d46a8[_0x19a6cc];return _0x144181;}async function findCiProfile(_0x595ce3){const _0x3b42f5=_0x1441,_0x2305f1={'jeFTu':function(_0xee078,_0x9e8ee9,_0x46f2b9){return _0xee078(_0x9e8ee9,_0x46f2b9);},'EKKCk':function(_0x5d572c,_0x38013e){return _0x5d572c(_0x38013e);},'GuusU':'No\x20CI\x20profiles\x20found.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','adwhZ':function(_0x175595,_0xd4eb5f){return _0x175595===_0xd4eb5f;},'yyHPY':function(_0x5b6989,_0x43485){return _0x5b6989+_0x43485;},'OeShw':_0x3b42f5(0x1b0),'XcFco':function(_0x4da0c2,_0x16a517){return _0x4da0c2===_0x16a517;}},_0x1596dc=getRangerDir(),_0x32c265=_0x2305f1['jeFTu'](join,_0x1596dc,'ci');if(_0x595ce3){const _0x511cfe=join(_0x32c265,_0x595ce3);return{'name':_0x595ce3,'path':_0x511cfe};}if(!_0x2305f1['EKKCk'](existsSync,_0x32c265))throw new Error(_0x2305f1[_0x3b42f5(0x1e1)]+'Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.');const _0x37933b=await _0x2305f1['jeFTu'](readdir,_0x32c265,{'withFileTypes':!![]}),_0x38e7ff=_0x37933b[_0x3b42f5(0x1c5)](_0x4692e5=>_0x4692e5['isDirectory']())['map'](_0x46d7b1=>_0x46d7b1[_0x3b42f5(0x1de)]);if(_0x2305f1['adwhZ'](_0x38e7ff['length'],0x0))throw new Error(_0x2305f1[_0x3b42f5(0x1bb)]('No\x20CI\x20profiles\x20found\x20in\x20.ranger/ci/.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a',_0x2305f1[_0x3b42f5(0x1ad)]));if(_0x2305f1[_0x3b42f5(0x1cd)](_0x38e7ff['length'],0x1)){const _0x135e6e=_0x38e7ff[0x0];return console['log']('Auto-detected\x20CI\x20profile:\x20'+_0x135e6e),{'name':_0x135e6e,'path':join(_0x32c265,_0x135e6e)};}throw new Error('Multiple\x20CI\x20profiles\x20found:\x20'+_0x38e7ff[_0x3b42f5(0x1ce)](',\x20')+_0x3b42f5(0x1b2));}async function installPluginNonInteractive(){const _0x1c92e6=_0x1441,_0x36696b={'eRSsa':function(_0x21d99c,_0x3b8335){return _0x21d99c(_0x3b8335);},'dMlmG':_0x1c92e6(0x1c0),'PyNkZ':'Installing\x20Claude\x20Code\x20plugin\x20(project\x20level)...','spVFd':'trailhead','idTFC':'✓\x20Marketplace\x20already\x20added','CzcKQ':'marketplace','hNUZF':_0x1c92e6(0x1e4),'Vnebr':'You\x20can\x20install\x20manually:\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','PIxBG':function(_0x531e7b,_0x549378){return _0x531e7b(_0x549378);},'AZJct':'plugin','kwKFl':'install','tYRFE':_0x1c92e6(0x1e3),'NUSnT':_0x1c92e6(0x1dc)},_0x372853=await _0x36696b['eRSsa'](isPluginInstalled,'ranger@trailhead');if(_0x372853)return console[_0x1c92e6(0x1ac)](_0x36696b['dMlmG']),![];console[_0x1c92e6(0x1ac)](_0x36696b[_0x1c92e6(0x1ab)]);const _0x93f4bd=await isMarketplaceAdded(_0x36696b['spVFd']);let _0x775041=_0x93f4bd;if(_0x93f4bd)console[_0x1c92e6(0x1ac)](_0x36696b[_0x1c92e6(0x1c1)]);else{const _0x24c40a=await runClaudeCommand(['plugin',_0x36696b['CzcKQ'],'add',_0x36696b['hNUZF']]);!_0x24c40a[_0x1c92e6(0x1d2)]?(console['error'](_0x1c92e6(0x1bf),_0x24c40a[_0x1c92e6(0x1bc)]),console['log'](_0x36696b['Vnebr'])):_0x775041=!![];}if(_0x775041){const _0x46e260=await _0x36696b['PIxBG'](runClaudeCommand,[_0x36696b[_0x1c92e6(0x1af)],_0x36696b[_0x1c92e6(0x1d7)],'ranger@trailhead',_0x1c92e6(0x1b5),_0x1c92e6(0x1dd)]);!_0x46e260['success']?(console['error'](_0x36696b['tYRFE'],_0x46e260[_0x1c92e6(0x1bc)]),console['log'](_0x36696b['NUSnT'])):console['log']('✓\x20Claude\x20Code\x20plugin\x20installed');}return!![];}export async function setupCi(_0x5dee6d,_0x3462c4,_0x3dad9e){const _0x197b83=_0x1441,_0xacd56b={'rQobz':function(_0x434ee4){return _0x434ee4();},'pniiV':function(_0x141b4a,_0x4b79a6){return _0x141b4a(_0x4b79a6);},'UQyXD':function(_0x4aec5d,_0x1e7ace,_0x368f54){return _0x4aec5d(_0x1e7ace,_0x368f54);},'qJHet':_0x197b83(0x1e2),'VGUAT':_0x197b83(0x1b9),'rSpJL':function(_0xac7a3e){return _0xac7a3e();},'FYYpN':_0x197b83(0x1d1),'SSODK':_0x197b83(0x1c4),'KPCaM':'settings.json','xlhkY':'auth.json','OpVhf':function(_0x2e5cf4,_0x555684){return _0x2e5cf4(_0x555684);},'QhOSq':function(_0x3cffff,_0x478fd9){return _0x3cffff(_0x478fd9);},'ERyDd':_0x197b83(0x1c9),'xHYIY':function(_0x1afe95,_0x2e27fd){return _0x1afe95 instanceof _0x2e27fd;},'qWZkA':'\x20\x20No\x20auth\x20state\x20found\x20(app\x20may\x20not\x20require\x20authentication)','FYGMe':'skills'};console['log'](_0x197b83(0x1cf)),_0x3dad9e?.[_0x197b83(0x1d6)](_0x197b83(0x1e0)),await authenticate(_0x5dee6d),_0x3dad9e?.['trackPhaseEnd']('auth'),_0x3dad9e?.[_0x197b83(0x1d6)]('dir_setup');const {path:_0x1c5278,installed:_0xe2d708}=await _0xacd56b[_0x197b83(0x1cc)](ensureRangerDir);await writeRangerGitignore(_0x1c5278);const _0x338ddd=join(_0x1c5278,'sessions');!_0xacd56b['pniiV'](existsSync,_0x338ddd)&&await _0xacd56b['UQyXD'](mkdir,_0x338ddd,{'recursive':!![]});_0x3dad9e?.['trackPhaseEnd'](_0xacd56b['qJHet'],{'installed':_0xe2d708}),_0x3dad9e?.['trackPhaseStart'](_0x197b83(0x1d1));let _0x42b393=![];_0x3462c4?.['skipChromium']?console['log'](_0xacd56b[_0x197b83(0x1df)]):_0x42b393=await _0xacd56b[_0x197b83(0x1ba)](ensureChromium);_0x3dad9e?.['trackPhaseEnd'](_0xacd56b['FYYpN'],{'installed':_0x42b393,'skipped':!!_0x3462c4?.[_0x197b83(0x1da)]}),_0x3dad9e?.[_0x197b83(0x1d6)](_0xacd56b[_0x197b83(0x1c3)]);const _0x2bac1f=await findCiProfile(_0x3462c4?.['profile']);let _0x3ff09e=![];_0x3462c4?.[_0x197b83(0x1db)]&&(await mkdir(_0x2bac1f[_0x197b83(0x1b1)],{'recursive':!![]}),await saveSettings(_0x2bac1f['name'],{'baseUrl':_0x3462c4[_0x197b83(0x1db)],'headless':!![]}),console['log'](_0x197b83(0x1c7)+_0x3462c4['baseUrl']),_0x3ff09e=!![]);const _0xcf3678=_0xacd56b[_0x197b83(0x1b4)](join,_0x2bac1f[_0x197b83(0x1b1)],_0xacd56b['KPCaM']);if(!_0xacd56b[_0x197b83(0x1c8)](existsSync,_0xcf3678)&&!_0x3ff09e)throw new Error('CI\x20profile\x20\x22'+_0x2bac1f['name']+_0x197b83(0x1d8));const _0x4de52a=join(_0x2bac1f[_0x197b83(0x1b1)],_0xacd56b[_0x197b83(0x1b6)]),_0x5cee8d=_0xacd56b[_0x197b83(0x1b4)](join,_0x2bac1f[_0x197b83(0x1b1)],'auth.json.enc'),_0x3198ec=_0xacd56b[_0x197b83(0x1bd)](existsSync,_0x4de52a),_0x231991=existsSync(_0x5cee8d);if(_0x231991)try{const _0x14c8ea=await _0xacd56b[_0x197b83(0x1cc)](getToken);if(!_0x14c8ea)throw new Error('No\x20API\x20token\x20available\x20for\x20decryption');const _0x115ee7=await _0xacd56b['QhOSq'](readFile,_0x5cee8d);decrypt(_0x115ee7,_0x14c8ea),console['log'](_0xacd56b['ERyDd']);}catch(_0x2e1971){const _0x12a0e2=_0xacd56b[_0x197b83(0x1d5)](_0x2e1971,Error)?_0x2e1971['message']:_0xacd56b[_0x197b83(0x1b7)](String,_0x2e1971);throw new Error('Failed\x20to\x20verify\x20encrypted\x20auth\x20for\x20profile\x20\x22'+_0x2bac1f['name']+_0x197b83(0x1c6)+_0x12a0e2);}else _0x3198ec?console['log']('✓\x20Auth\x20state\x20found'):console['log'](_0xacd56b['qWZkA']);await writeActiveProfileName(_0x2bac1f[_0x197b83(0x1de)]),console[_0x197b83(0x1ac)](_0x197b83(0x1ae)+_0x2bac1f['name']),_0x3dad9e?.['trackPhaseEnd'](_0xacd56b['SSODK'],{'profileName':_0x2bac1f[_0x197b83(0x1de)],'hasAuth':_0x3198ec,'hasEncryptedAuth':_0x231991,'createdSettings':_0x3ff09e}),_0x3dad9e?.['trackPhaseStart']('plugin');const _0x4ca5b6=await _0xacd56b[_0x197b83(0x1cc)](installPluginNonInteractive);_0x3dad9e?.[_0x197b83(0x1ca)]('plugin',{'installed':_0x4ca5b6}),_0x3dad9e?.['trackPhaseStart'](_0xacd56b[_0x197b83(0x1be)]),await skillup({'autoInstall':_0x197b83(0x1dd)}),_0x3dad9e?.[_0x197b83(0x1ca)]('skills'),console[_0x197b83(0x1ac)](_0x197b83(0x1d3));}
1
+ function _0x57e1(){const _0x56eaf9=['dgsHq','.\x20Use\x20--profile\x20to\x20specify\x20which\x20one.','Installing\x20Claude\x20Code\x20plugin\x20(project\x20level)...','success','You\x20can\x20install\x20manually:\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','swBBO','✓\x20Marketplace\x20already\x20added','2pkmYAP','1170GIlCJe','\x0a🔧\x20Ranger\x20CI\x20Setup\x0a','✓\x20Auth\x20state\x20found','XqiOs','1109010BkcEAV','marketplace','chromium','dYJNG','Multiple\x20CI\x20profiles\x20found:\x20','✓\x20Created\x20profile\x20settings:\x20baseUrl=','jqFxB','log','CaAwQ','UUegs','settings.json','skipChromium','baseUrl','246057ixeFPY','\x22:\x20','Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.','wZRKU','vpjqg','No\x20CI\x20profiles\x20found.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','RZOWn','6PfSpiQ','dir_setup','profile','KMkht','join','trackPhaseStart','Auto-detected\x20CI\x20profile:\x20','gmhvl','length','hYaoJ','20781HUjtnP','No\x20CI\x20profiles\x20found\x20in\x20.ranger/ci/.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','112532HdIgSE','Uwdiv','name','path','BqHBi','plugin','xGkfP','NQolB','QHeAW','PAHKi','trackPhaseEnd','ranger@trailhead','rewrt','2565234YLbAGG','project','cVphS','install','isDirectory','✓\x20Encrypted\x20auth\x20verified\x20(will\x20decrypt\x20at\x20runtime)','Failed\x20to\x20install\x20plugin:','auth.json.enc','profile_activate','1874745MorLgc','1323608MKIoXp','Failed\x20to\x20verify\x20encrypted\x20auth\x20for\x20profile\x20\x22'];_0x57e1=function(){return _0x56eaf9;};return _0x57e1();}(function(_0x45492b,_0x45b22d){const _0x2e0c35=_0x2400,_0x5dba16=_0x45492b();while(!![]){try{const _0x185812=-parseInt(_0x2e0c35(0x1f8))/0x1*(-parseInt(_0x2e0c35(0x1e6))/0x2)+-parseInt(_0x2e0c35(0x1eb))/0x3+parseInt(_0x2e0c35(0x1c6))/0x4+parseInt(_0x2e0c35(0x1dc))/0x5+parseInt(_0x2e0c35(0x1ba))/0x6*(parseInt(_0x2e0c35(0x1d3))/0x7)+-parseInt(_0x2e0c35(0x1dd))/0x8+-parseInt(_0x2e0c35(0x1c4))/0x9*(parseInt(_0x2e0c35(0x1e7))/0xa);if(_0x185812===_0x45b22d)break;else _0x5dba16['push'](_0x5dba16['shift']());}catch(_0x3ad1d4){_0x5dba16['push'](_0x5dba16['shift']());}}}(_0x57e1,0x33597));import{mkdir,readFile,readdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';function _0x2400(_0x33ffac,_0x11315b){_0x33ffac=_0x33ffac-0x1b6;const _0x57e17f=_0x57e1();let _0x240041=_0x57e17f[_0x33ffac];return _0x240041;}import{authenticate,ensureRangerDir,ensureChromium,writeRangerGitignore}from'./start.js';import{skillup}from'./skillup.js';import{getRangerDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{saveSettings}from'./utils/settings.js';import{decrypt}from'./utils/crypto.js';import{getToken}from'./utils/keychain.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'./utils/claudePlugin.js';async function findCiProfile(_0x3b25e8){const _0x129b05=_0x2400,_0x589f81={'dgsHq':function(_0x508c83,_0x160864,_0x561b30){return _0x508c83(_0x160864,_0x561b30);},'NQolB':function(_0x4f4d61,_0xdd217f){return _0x4f4d61+_0xdd217f;},'psLNk':_0x129b05(0x1b8),'rewrt':function(_0x38ce1a,_0x502466){return _0x38ce1a===_0x502466;}},_0xe0f4ef=getRangerDir(),_0x538259=_0x589f81[_0x129b05(0x1df)](join,_0xe0f4ef,'ci');if(_0x3b25e8){const _0x2774d0=join(_0x538259,_0x3b25e8);return{'name':_0x3b25e8,'path':_0x2774d0};}if(!existsSync(_0x538259))throw new Error(_0x589f81[_0x129b05(0x1cd)](_0x589f81['psLNk'],_0x129b05(0x1fa)));const _0x30177b=await readdir(_0x538259,{'withFileTypes':!![]}),_0x653b0f=_0x30177b['filter'](_0x10c5b5=>_0x10c5b5[_0x129b05(0x1d7)]())['map'](_0x3adefe=>_0x3adefe['name']);if(_0x589f81[_0x129b05(0x1d2)](_0x653b0f[_0x129b05(0x1c2)],0x0))throw new Error(_0x589f81[_0x129b05(0x1cd)](_0x129b05(0x1c5),'Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.'));if(_0x653b0f['length']===0x1){const _0x28da3c=_0x653b0f[0x0];return console[_0x129b05(0x1f2)](_0x129b05(0x1c0)+_0x28da3c),{'name':_0x28da3c,'path':join(_0x538259,_0x28da3c)};}throw new Error(_0x129b05(0x1ef)+_0x653b0f[_0x129b05(0x1be)](',\x20')+_0x129b05(0x1e0));}async function installPluginNonInteractive(){const _0x501b59=_0x2400,_0xe59113={'MndbM':_0x501b59(0x1d1),'jqFxB':'✓\x20Claude\x20Code\x20plugin\x20already\x20installed','gmhvl':function(_0x22ef58,_0x144c25){return _0x22ef58(_0x144c25);},'fHrtR':'trailhead','BqHBi':_0x501b59(0x1e5),'XqiOs':_0x501b59(0x1ec),'UUegs':'add','UwIyS':'ranger-testing/trailhead','kKaxd':'Failed\x20to\x20add\x20marketplace:','cVphS':_0x501b59(0x1e3),'vpjqg':_0x501b59(0x1d6),'dYJNG':'--scope','CaAwQ':'project'},_0x383e9b=await isPluginInstalled(_0xe59113['MndbM']);if(_0x383e9b)return console[_0x501b59(0x1f2)](_0xe59113[_0x501b59(0x1f1)]),![];console[_0x501b59(0x1f2)](_0x501b59(0x1e1));const _0xa0689f=await _0xe59113[_0x501b59(0x1c1)](isMarketplaceAdded,_0xe59113['fHrtR']);let _0x1b8637=_0xa0689f;if(_0xa0689f)console[_0x501b59(0x1f2)](_0xe59113[_0x501b59(0x1ca)]);else{const _0x5a788e=await runClaudeCommand(['plugin',_0xe59113[_0x501b59(0x1ea)],_0xe59113[_0x501b59(0x1f4)],_0xe59113['UwIyS']]);!_0x5a788e['success']?(console['error'](_0xe59113['kKaxd'],_0x5a788e['error']),console[_0x501b59(0x1f2)](_0xe59113[_0x501b59(0x1d5)])):_0x1b8637=!![];}if(_0x1b8637){const _0x49a0c3=await runClaudeCommand([_0x501b59(0x1cb),_0xe59113[_0x501b59(0x1b7)],_0xe59113['MndbM'],_0xe59113[_0x501b59(0x1ee)],_0xe59113[_0x501b59(0x1f3)]]);!_0x49a0c3[_0x501b59(0x1e2)]?(console['error'](_0x501b59(0x1d9),_0x49a0c3['error']),console[_0x501b59(0x1f2)]('You\x20can\x20install\x20manually:\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20project')):console['log']('✓\x20Claude\x20Code\x20plugin\x20installed');}return!![];}export async function setupCi(_0x404568,_0x2eac80,_0x24818a){const _0x1d6135=_0x2400,_0x1c8d9a={'PAHKi':_0x1d6135(0x1e8),'Uwdiv':'auth','KMkht':function(_0x36983c){return _0x36983c();},'fnhhj':function(_0x136b98,_0x28eb03){return _0x136b98(_0x28eb03);},'khxME':function(_0x4b6640,_0xc802ff){return _0x4b6640(_0xc802ff);},'aRfHt':'dir_setup','UCsdi':'✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','wZRKU':_0x1d6135(0x1ed),'XUIVr':'profile_activate','QHeAW':function(_0x1b30e5,_0x449a35,_0x369424){return _0x1b30e5(_0x449a35,_0x369424);},'xGkfP':function(_0x5c7240,_0x1bfae4){return _0x5c7240(_0x1bfae4);},'ZxJbf':function(_0x1bd297,_0x2be2b9,_0xb43ee0){return _0x1bd297(_0x2be2b9,_0xb43ee0);},'PpPki':function(_0x674e18,_0x4a288e,_0xb9bfd3){return _0x674e18(_0x4a288e,_0xb9bfd3);},'lPkvS':_0x1d6135(0x1da),'QJcZa':function(_0x51c613,_0x4cbc21){return _0x51c613(_0x4cbc21);},'swBBO':function(_0x494eff){return _0x494eff();},'yjpex':'No\x20API\x20token\x20available\x20for\x20decryption','EMFDi':function(_0x503b84,_0x3d60fb){return _0x503b84 instanceof _0x3d60fb;},'FbRmk':function(_0x148d3f,_0x3021f9){return _0x148d3f(_0x3021f9);},'mnrES':'\x20\x20No\x20auth\x20state\x20found\x20(app\x20may\x20not\x20require\x20authentication)','RZOWn':'plugin','hYaoJ':function(_0x2120a1){return _0x2120a1();}};console['log'](_0x1c8d9a[_0x1d6135(0x1cf)]),_0x24818a?.[_0x1d6135(0x1bf)](_0x1c8d9a[_0x1d6135(0x1c7)]),await authenticate(_0x404568),_0x24818a?.['trackPhaseEnd'](_0x1c8d9a['Uwdiv']),_0x24818a?.[_0x1d6135(0x1bf)](_0x1d6135(0x1bb));const {path:_0x2e3dc2,installed:_0x3ff4c5}=await _0x1c8d9a['KMkht'](ensureRangerDir);await _0x1c8d9a['fnhhj'](writeRangerGitignore,_0x2e3dc2);const _0x5aaae6=join(_0x2e3dc2,'sessions');!_0x1c8d9a['khxME'](existsSync,_0x5aaae6)&&await mkdir(_0x5aaae6,{'recursive':!![]});_0x24818a?.['trackPhaseEnd'](_0x1c8d9a['aRfHt'],{'installed':_0x3ff4c5}),_0x24818a?.['trackPhaseStart']('chromium');let _0x3956c1=![];_0x2eac80?.[_0x1d6135(0x1f6)]?console[_0x1d6135(0x1f2)](_0x1c8d9a['UCsdi']):_0x3956c1=await _0x1c8d9a[_0x1d6135(0x1bd)](ensureChromium);_0x24818a?.[_0x1d6135(0x1d0)](_0x1c8d9a[_0x1d6135(0x1b6)],{'installed':_0x3956c1,'skipped':!!_0x2eac80?.[_0x1d6135(0x1f6)]}),_0x24818a?.['trackPhaseStart'](_0x1c8d9a['XUIVr']);const _0x29d565=await _0x1c8d9a['khxME'](findCiProfile,_0x2eac80?.[_0x1d6135(0x1bc)]);let _0x2238b6=![];_0x2eac80?.[_0x1d6135(0x1f7)]&&(await mkdir(_0x29d565['path'],{'recursive':!![]}),await saveSettings(_0x29d565[_0x1d6135(0x1c8)],{'baseUrl':_0x2eac80[_0x1d6135(0x1f7)],'headless':!![]}),console['log'](_0x1d6135(0x1f0)+_0x2eac80['baseUrl']),_0x2238b6=!![]);const _0x3c20d4=_0x1c8d9a[_0x1d6135(0x1ce)](join,_0x29d565['path'],_0x1d6135(0x1f5));if(!_0x1c8d9a[_0x1d6135(0x1cc)](existsSync,_0x3c20d4)&&!_0x2238b6)throw new Error('CI\x20profile\x20\x22'+_0x29d565['name']+'\x22\x20has\x20no\x20settings.json.\x20Use\x20--base-url\x20to\x20configure\x20it.');const _0x4fa772=_0x1c8d9a['ZxJbf'](join,_0x29d565['path'],'auth.json'),_0x4174ad=_0x1c8d9a['PpPki'](join,_0x29d565[_0x1d6135(0x1c9)],_0x1c8d9a['lPkvS']),_0xd150fb=existsSync(_0x4fa772),_0x5b77f0=_0x1c8d9a['QJcZa'](existsSync,_0x4174ad);if(_0x5b77f0)try{const _0x4b881c=await _0x1c8d9a[_0x1d6135(0x1e4)](getToken);if(!_0x4b881c)throw new Error(_0x1c8d9a['yjpex']);const _0x500241=await readFile(_0x4174ad);decrypt(_0x500241,_0x4b881c),console[_0x1d6135(0x1f2)](_0x1d6135(0x1d8));}catch(_0x32e39b){const _0xd6fa8a=_0x1c8d9a['EMFDi'](_0x32e39b,Error)?_0x32e39b['message']:_0x1c8d9a['FbRmk'](String,_0x32e39b);throw new Error(_0x1d6135(0x1de)+_0x29d565['name']+_0x1d6135(0x1f9)+_0xd6fa8a);}else _0xd150fb?console[_0x1d6135(0x1f2)](_0x1d6135(0x1e9)):console[_0x1d6135(0x1f2)](_0x1c8d9a['mnrES']);await _0x1c8d9a['khxME'](writeActiveProfileName,_0x29d565[_0x1d6135(0x1c8)]),console['log']('✓\x20Active\x20profile:\x20'+_0x29d565[_0x1d6135(0x1c8)]),_0x24818a?.['trackPhaseEnd'](_0x1d6135(0x1db),{'profileName':_0x29d565[_0x1d6135(0x1c8)],'hasAuth':_0xd150fb,'hasEncryptedAuth':_0x5b77f0,'createdSettings':_0x2238b6}),_0x24818a?.[_0x1d6135(0x1bf)](_0x1c8d9a[_0x1d6135(0x1b9)]);const _0x379853=await _0x1c8d9a[_0x1d6135(0x1c3)](installPluginNonInteractive);_0x24818a?.['trackPhaseEnd'](_0x1d6135(0x1cb),{'installed':_0x379853}),_0x24818a?.['trackPhaseStart']('skills'),await skillup({'autoInstall':_0x1d6135(0x1d4)}),_0x24818a?.[_0x1d6135(0x1d0)]('skills'),console['log']('\x0a✅\x20Ranger\x20CI\x20setup\x20complete!\x0a');}
@@ -1 +1 @@
1
- (function(_0x3e0a4c,_0x2cce57){const _0x90b3e9=_0x4e16,_0x4aa39d=_0x3e0a4c();while(!![]){try{const _0x5c933f=-parseInt(_0x90b3e9(0x1ff))/0x1+parseInt(_0x90b3e9(0x1df))/0x2*(parseInt(_0x90b3e9(0x1da))/0x3)+-parseInt(_0x90b3e9(0x1f1))/0x4+-parseInt(_0x90b3e9(0x1d9))/0x5*(parseInt(_0x90b3e9(0x1dd))/0x6)+-parseInt(_0x90b3e9(0x1fe))/0x7*(-parseInt(_0x90b3e9(0x1e0))/0x8)+parseInt(_0x90b3e9(0x1e4))/0x9*(-parseInt(_0x90b3e9(0x1e3))/0xa)+parseInt(_0x90b3e9(0x1e2))/0xb*(parseInt(_0x90b3e9(0x1d7))/0xc);if(_0x5c933f===_0x2cce57)break;else _0x4aa39d['push'](_0x4aa39d['shift']());}catch(_0x5ec16c){_0x4aa39d['push'](_0x4aa39d['shift']());}}}(_0x471f,0x20270));import{basename}from'path';import _0x1b7353 from'inquirer';function _0x471f(){const _0x1b56e8=['log','list','To\x20use:','project','\x0a✅\x20Installed\x20','platform','\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a','CfwSO','prompt','7qonvzJ','149406ucxePn','message','claude','/.claude/skills/','\x20skill','OaHDe','12NYXvpu','yaTBj','40QQMdAT','3wYWGDp','split','opencode','137898MpQdcw','\x20successfully!\x0a','78682YWVulO','2102672HxZvck','\x20--opencode','3305049GBGDSO','648190XZkYUp','9jAQJNc','hXgAP','/skills/','\x20\x202.\x20Run:\x20ranger\x20setup','\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','installLevel','isTTY','GhWuK','autoInstall','Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20(','gykKM','txUab','\x20<your-api-token>','291396ygBkdU','ORduD','/.opencode/skills/','\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!'];_0x471f=function(){return _0x1b56e8;};return _0x471f();}import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';function _0x4e16(_0x5c08f6,_0x2aaf91){_0x5c08f6=_0x5c08f6-0x1d4;const _0x471f30=_0x471f();let _0x4e167e=_0x471f30[_0x5c08f6];return _0x4e167e;}export async function skillup(_0x3e00a1={}){const _0x1fd9bb=_0x4e16,_0x195f8e={'EeqMA':'3|5|0|2|1|4','GhWuK':'\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','SSJRF':_0x1fd9bb(0x1e1),'IGFHw':function(_0x379856,_0x5c044e){return _0x379856===_0x5c044e;},'CfwSO':'✓\x20Found\x20API\x20token','GTQZj':function(_0x330745,_0x380f69){return _0x330745===_0x380f69;},'txUab':'user','XeJet':_0x1fd9bb(0x1f6),'LyUUy':_0x1fd9bb(0x1e9),'QnRrw':_0x1fd9bb(0x1f8),'suoLX':function(_0x453299){return _0x453299();},'XVZut':function(_0x4426f6,_0x4194f8,_0x2d5773){return _0x4426f6(_0x4194f8,_0x2d5773);},'adPCv':'ranger','ORduD':function(_0x18cda9,_0x4df4ce){return _0x18cda9 instanceof _0x4df4ce;},'YFoJX':function(_0x5a07c9,_0x1b9ccb){return _0x5a07c9>_0x1b9ccb;},'KQlBD':'user-level','gykKM':function(_0x203342,_0x4b2d0a){return _0x203342===_0x4b2d0a;},'OaHDe':'opencode','yaTBj':'\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','hXgAP':_0x1fd9bb(0x1f4),'hpgsv':_0x1fd9bb(0x1fb)};console['log'](_0x1fd9bb(0x1e8));const _0x1f1ed0=_0x3e00a1[_0x1fd9bb(0x1fa)]??_0x1fd9bb(0x201),_0x2b993a=await getToken();if(!_0x2b993a){const _0x30c3d8=_0x195f8e['EeqMA'][_0x1fd9bb(0x1db)]('|');let _0x2417ed=0x0;while(!![]){switch(_0x30c3d8[_0x2417ed++]){case'0':console[_0x1fd9bb(0x1f5)](_0x195f8e[_0x1fd9bb(0x1eb)]);continue;case'1':console['log']('\x20\x203.\x20Run:\x20ranger\x20skillup'+(_0x1f1ed0===_0x1fd9bb(0x1dc)?_0x195f8e['SSJRF']:'')+'\x0a');continue;case'2':console[_0x1fd9bb(0x1f5)](_0x1fd9bb(0x1e7)+(_0x195f8e['IGFHw'](_0x1f1ed0,_0x1fd9bb(0x1dc))?'\x20--opencode':'')+_0x1fd9bb(0x1f0));continue;case'3':console['log']('❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a');continue;case'4':return;case'5':console['log']('To\x20get\x20started:');continue;}break;}}console[_0x1fd9bb(0x1f5)](_0x195f8e[_0x1fd9bb(0x1fc)]);const _0x540d69=getProjectRoot(),_0x17f97c=basename(_0x540d69),_0x2a472e=_0x195f8e['GTQZj'](_0x1f1ed0,_0x1fd9bb(0x1dc))?getOpencodeConfigDir(_0x195f8e[_0x1fd9bb(0x1ef)])+_0x1fd9bb(0x1e6):getClaudeConfigDir()+'/skills/',_0x49dae1=_0x1f1ed0==='opencode'?_0x540d69+_0x1fd9bb(0x1f3):_0x540d69+_0x1fd9bb(0x1d4),_0x50b248=process['stdin'][_0x1fd9bb(0x1ea)]&&process['stdout'][_0x1fd9bb(0x1ea)];let _0x3b2c1a;if(_0x3e00a1[_0x1fd9bb(0x1ec)])_0x3b2c1a=_0x3e00a1[_0x1fd9bb(0x1ec)];else{if(_0x50b248){const _0x23a8d8=await _0x1b7353[_0x1fd9bb(0x1fd)]([{'type':_0x195f8e['XeJet'],'name':_0x195f8e['LyUUy'],'message':'Where\x20should\x20skills\x20be\x20installed?','choices':[{'name':'All\x20projects\x20('+_0x2a472e+')','value':'user'},{'name':'This\x20project\x20only\x20('+_0x49dae1+')','value':_0x195f8e['QnRrw']}]}]);_0x3b2c1a=_0x23a8d8[_0x1fd9bb(0x1e9)];}else _0x3b2c1a=_0x195f8e['QnRrw'],console['log'](_0x1fd9bb(0x1ed)+_0x49dae1+')');}let _0x54d6d0=0x0;const _0x347758=_0x195f8e['suoLX'](getCurrentVersion);console['log']('\x0a📦\x20Installing\x20skills...\x0a');try{const _0x1319bd=await _0x195f8e['XVZut'](installSkill,_0x195f8e['adPCv'],{'cliVersion':_0x347758,'level':_0x3b2c1a,'platform':_0x1f1ed0});_0x1319bd&&_0x54d6d0++;}catch(_0x4df3e3){console['warn']('\x20\x20Failed\x20to\x20install\x20ranger\x20skill:',_0x195f8e[_0x1fd9bb(0x1f2)](_0x4df3e3,Error)?_0x4df3e3[_0x1fd9bb(0x200)]:_0x4df3e3);}if(_0x195f8e['YFoJX'](_0x54d6d0,0x0)){const _0x1f0b2c=_0x3b2c1a==='user'?_0x195f8e['KQlBD']:'project-level';console['log'](_0x1fd9bb(0x1f9)+_0x54d6d0+'\x20'+_0x1f0b2c+_0x1fd9bb(0x1d5)+(_0x195f8e['YFoJX'](_0x54d6d0,0x1)?'s':'')+_0x1fd9bb(0x1de)),!_0x3e00a1['suppressUsage']&&(console[_0x1fd9bb(0x1f5)](_0x1fd9bb(0x1f7)),_0x195f8e[_0x1fd9bb(0x1ee)](_0x1f1ed0,_0x195f8e[_0x1fd9bb(0x1d6)])?console['log'](_0x195f8e[_0x1fd9bb(0x1d8)]):console['log'](_0x195f8e[_0x1fd9bb(0x1e5)]));}else console['log'](_0x195f8e['hpgsv']);}
1
+ (function(_0x2a8376,_0x39b488){const _0x39b0e0=_0xe1b7,_0x27156f=_0x2a8376();while(!![]){try{const _0x5d5527=-parseInt(_0x39b0e0(0x20c))/0x1*(parseInt(_0x39b0e0(0x1f1))/0x2)+-parseInt(_0x39b0e0(0x204))/0x3+parseInt(_0x39b0e0(0x215))/0x4+-parseInt(_0x39b0e0(0x206))/0x5+-parseInt(_0x39b0e0(0x1f4))/0x6+-parseInt(_0x39b0e0(0x202))/0x7*(-parseInt(_0x39b0e0(0x217))/0x8)+parseInt(_0x39b0e0(0x1ef))/0x9*(parseInt(_0x39b0e0(0x1fa))/0xa);if(_0x5d5527===_0x39b488)break;else _0x27156f['push'](_0x27156f['shift']());}catch(_0x10bafd){_0x27156f['push'](_0x27156f['shift']());}}}(_0x255a,0xbcc9a));import{basename}from'path';import _0x213d93 from'inquirer';import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';function _0xe1b7(_0x51b342,_0x20413f){_0x51b342=_0x51b342-0x1ef;const _0x255a2b=_0x255a();let _0xe1b77d=_0x255a2b[_0x51b342];return _0xe1b77d;}import{getCurrentVersion}from'./utils/version.js';function _0x255a(){const _0x176306=['\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a','8eUarEY','user','63wqMPAs','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','1348knYNCP','Where\x20should\x20skills\x20be\x20installed?','Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20(','8230356fpMgxk','QRehH','4|5|2|3|0|1','SmVHk','platform','\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!','4086480ZgXxSp','user-level','isTTY','prompt','ranger','\x20--opencode','/skills/','KbxBG','1907171hUPxSz','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','1414614HgbkZh','message','1327460Qjxyup','LUVLo','IGGGS','oDSJq','WJiys','\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','1953AwsrBO','claude','\x20successfully!\x0a','\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','PBSee','stdin','FCbks','log','\x20\x203.\x20Run:\x20ranger\x20skillup','4261452RbhmqL'];_0x255a=function(){return _0x176306;};return _0x255a();}import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x21d70b={}){const _0x103f2d=_0xe1b7,_0x431070={'SmVHk':_0x103f2d(0x20f),'dYnjT':_0x103f2d(0x20d),'qsuBD':function(_0x53a6ac){return _0x53a6ac();},'WJiys':_0x103f2d(0x1f6),'KbxBG':function(_0x22ba41,_0x30b7c7){return _0x22ba41===_0x30b7c7;},'PBSee':'opencode','FCbks':'To\x20get\x20started:','tdGuV':function(_0x31fdde){return _0x31fdde();},'OYSot':function(_0x2144f4,_0x5d1da6){return _0x2144f4(_0x5d1da6);},'oDSJq':function(_0x495cdb,_0x4f831d){return _0x495cdb===_0x4f831d;},'QRehH':_0x103f2d(0x218),'ceDBi':function(_0x4d73bf){return _0x4d73bf();},'iIZde':'list','LUVLo':'project','GvmcN':function(_0x37ee2c){return _0x37ee2c();},'JPieW':function(_0x5f5a1,_0x694a13){return _0x5f5a1 instanceof _0x694a13;},'pCdKk':_0x103f2d(0x1fb),'fyKDj':_0x103f2d(0x20b),'IGGGS':_0x103f2d(0x1f9)};console['log'](_0x431070[_0x103f2d(0x1f7)]);const _0x4a3b59=_0x21d70b[_0x103f2d(0x1f8)]??_0x431070['dYnjT'],_0x501505=await _0x431070['qsuBD'](getToken);if(!_0x501505){const _0x39bcc0=_0x431070[_0x103f2d(0x20a)]['split']('|');let _0x1a227c=0x0;while(!![]){switch(_0x39bcc0[_0x1a227c++]){case'0':console[_0x103f2d(0x213)](_0x103f2d(0x214)+(_0x431070['KbxBG'](_0x4a3b59,_0x431070[_0x103f2d(0x210)])?'\x20--opencode':'')+'\x0a');continue;case'1':return;case'2':console[_0x103f2d(0x213)](_0x103f2d(0x203));continue;case'3':console['log']('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0x431070['KbxBG'](_0x4a3b59,_0x431070['PBSee'])?_0x103f2d(0x1ff):'')+'\x20<your-api-token>');continue;case'4':console['log'](_0x103f2d(0x1f0));continue;case'5':console['log'](_0x431070[_0x103f2d(0x212)]);continue;}break;}}console['log']('✓\x20Found\x20API\x20token');const _0x5c4f9d=_0x431070['tdGuV'](getProjectRoot),_0x3f5171=_0x431070['OYSot'](basename,_0x5c4f9d),_0x154874=_0x431070[_0x103f2d(0x209)](_0x4a3b59,_0x431070['PBSee'])?_0x431070['OYSot'](getOpencodeConfigDir,_0x431070[_0x103f2d(0x1f5)])+_0x103f2d(0x200):_0x431070['ceDBi'](getClaudeConfigDir)+'/skills/',_0x55b37d=_0x431070['KbxBG'](_0x4a3b59,_0x431070['PBSee'])?_0x5c4f9d+'/.opencode/skills/':_0x5c4f9d+'/.claude/skills/',_0x221912=process[_0x103f2d(0x211)]['isTTY']&&process['stdout'][_0x103f2d(0x1fc)];let _0x127e5d;if(_0x21d70b['autoInstall'])_0x127e5d=_0x21d70b['autoInstall'];else{if(_0x221912){const _0x516bc1=await _0x213d93[_0x103f2d(0x1fd)]([{'type':_0x431070['iIZde'],'name':'installLevel','message':_0x103f2d(0x1f2),'choices':[{'name':'All\x20projects\x20('+_0x154874+')','value':_0x431070[_0x103f2d(0x1f5)]},{'name':'This\x20project\x20only\x20('+_0x55b37d+')','value':_0x431070['LUVLo']}]}]);_0x127e5d=_0x516bc1['installLevel'];}else _0x127e5d=_0x431070[_0x103f2d(0x207)],console[_0x103f2d(0x213)](_0x103f2d(0x1f3)+_0x55b37d+')');}let _0x452f8e=0x0;const _0x60d470=_0x431070['GvmcN'](getCurrentVersion);console[_0x103f2d(0x213)]('\x0a📦\x20Installing\x20skills...\x0a');try{const _0x4320eb=await installSkill(_0x103f2d(0x1fe),{'cliVersion':_0x60d470,'level':_0x127e5d,'platform':_0x4a3b59});_0x4320eb&&_0x452f8e++;}catch(_0x2930c3){console['warn']('\x20\x20Failed\x20to\x20install\x20ranger\x20skill:',_0x431070['JPieW'](_0x2930c3,Error)?_0x2930c3[_0x103f2d(0x205)]:_0x2930c3);}if(_0x452f8e>0x0){const _0x4b222=_0x431070[_0x103f2d(0x201)](_0x127e5d,_0x431070[_0x103f2d(0x1f5)])?_0x431070['pCdKk']:'project-level';console[_0x103f2d(0x213)]('\x0a✅\x20Installed\x20'+_0x452f8e+'\x20'+_0x4b222+'\x20skill'+(_0x452f8e>0x1?'s':'')+_0x103f2d(0x20e)),!_0x21d70b['suppressUsage']&&(console[_0x103f2d(0x213)]('To\x20use:'),_0x4a3b59==='opencode'?console['log'](_0x431070['fyKDj']):console[_0x103f2d(0x213)](_0x431070[_0x103f2d(0x208)]));}else console[_0x103f2d(0x213)](_0x103f2d(0x216));}
@@ -1 +1 @@
1
- const _0xc5da9b=_0x348d;(function(_0x4d5613,_0x317877){const _0x334d65=_0x348d,_0x10495f=_0x4d5613();while(!![]){try{const _0xc9d0c3=parseInt(_0x334d65(0x1db))/0x1*(-parseInt(_0x334d65(0x190))/0x2)+-parseInt(_0x334d65(0x1b2))/0x3+-parseInt(_0x334d65(0x1a9))/0x4*(parseInt(_0x334d65(0x18c))/0x5)+-parseInt(_0x334d65(0x1d1))/0x6+-parseInt(_0x334d65(0x1cd))/0x7*(parseInt(_0x334d65(0x18a))/0x8)+-parseInt(_0x334d65(0x1a3))/0x9+-parseInt(_0x334d65(0x1ef))/0xa*(-parseInt(_0x334d65(0x1fc))/0xb);if(_0xc9d0c3===_0x317877)break;else _0x10495f['push'](_0x10495f['shift']());}catch(_0x2d8d7e){_0x10495f['push'](_0x10495f['shift']());}}}(_0x5756,0xc9035));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x48c491 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 _0x5756(){const _0x59336d=['--with-deps','withDeps','trackPhaseError','2JXCDSG','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','skipAuth','Validating\x20API\x20token...','auth,\x20you\x20can\x20log\x20in\x20and\x20we\x27ll\x20save\x20the\x20session\x20state\x20for\x20Ranger\x20to','plugin','url','playwright@','prompt','tNXow','Authentication\x20failed:\x20','/ranger:enable','pfdkl','to\x20access\x20your\x20app.\x20If\x20the\x20part\x20of\x20your\x20app\x20you\x20want\x20to\x20test\x20is\x20behind','log','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','YQEiE','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','⚠\x20No\x20git\x20repository\x20found.\x20Run\x20`ranger\x20profile\x20add\x20local`\x20from\x20your\x20project\x20directory.','14791932Pqcoog','RgeAD','KqxqR','success','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','213572HfqjJJ','FSeMe','auth','MxgHF','skipped','fpfJz','NyGUD','wantsProfile','Make\x20sure\x20your\x20app\x20is\x20running\x20before\x20you\x20start.\x0a','4840605DeHpkf','git_check','user','provided_token','inherit','jLnhm','VzjHc','chromium','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','fSRef','allowInsecureLocalhost','install','scope','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','organizationName','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','NukDd','RMZKz','local','\x0aA\x20profile\x20gives\x20Ranger\x27s\x20browser\x20agent\x20information\x20about\x20how','bYNOt','The\x20required\x20version\x20(','error','OVLTV','force','HDkMQ','4563965arPIzO','rFLYA','rewHC','zuLjS','3626658AodRFL','You\x27ll\x20need\x20the\x20app\x20to\x20be\x20running\x20to\x20set\x20up\x20the\x20profile.','Non-interactive\x20mode:\x20No\x20--scope\x20provided,\x20defaulting\x20to\x20user.','\x20(fallback\x20version)','fnZTg','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','1.58.2','rmSEY','HUzDi','lfmAw','926119qSDFic','\x1b[1m','isTTY','trackPhaseStart','✓\x20Created\x20.ranger/\x20directory','cKvaF','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','\x0a🚀\x20Ranger\x20Setup\x0a','TtMLF','stdout','ranger\x20profile\x20add\x20local','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','Non-interactive\x20mode:\x20Skipping\x20profile\x20setup.\x20To\x20set\x20up\x20a\x20profile,\x20pass\x20--url\x20or\x20run\x20later:','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','\x0aIn\x20Claude\x20Code,\x20run\x20','opencode','No\x20git\x20repository\x20found','existing_token','or\x20use\x20--scope\x20user\x20to\x20install\x20at\x20the\x20user\x20level\x20without\x20a\x20project.','stdin','10cugypG','uPKjS','HQBvU','✓\x20Exported\x20credentials\x20for\x20CI','message','oCdec','\x0a✅\x20You\x27re\x20ready\x20to\x20start\x20using\x20Ranger\x20Feature\x20Review.','trackPhaseEnd','confirm','profile','skills','ranger','ticZY','82525377FAAwbv','No\x20git\x20repository\x20found.\x20Please\x20run\x20`ranger\x20setup`\x20from\x20inside\x20your\x20project\x20directory,\x0a','ADOCE','FPgul','Would\x20you\x20like\x20to\x20set\x20up\x20the\x20profile\x20now?','\x0a❌\x20Profile\x20setup\x20failed:','\x20and\x20prompt\x20the\x20coding','use\x20until\x20the\x20session\x20expires.\x0a','16RXJqlj','heGoC','55CXpDzz'];_0x5756=function(){return _0x59336d;};return _0x5756();}import{getRangerDir,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=_0xc5da9b(0x1d7);const bold=_0x4e022b=>_0xc5da9b(0x1dc)+_0x4e022b+'\x1b[0m';export function getPlaywrightVersion(){const _0x449662={'Dfayk':function(_0x364042,_0x3cab0d){return _0x364042(_0x3cab0d);}};try{const _0xf9513b=require['resolve']('playwright/package.json'),_0x5a20ce=_0x449662['Dfayk'](require,_0xf9513b);return _0x5a20ce['version'];}catch{return null;}}export function installChromiumBinary(_0x480907,_0x31cda7=![]){const _0x301238=_0xc5da9b,_0x4c26e7={'heGoC':function(_0x8bdd27){return _0x8bdd27();},'ticZY':function(_0x433e01,_0x3b2ee5){return _0x433e01(_0x3b2ee5);},'RCcTP':_0x301238(0x18d),'eTvgm':_0x301238(0x1b9),'cKvaF':'npx','cuxsP':function(_0x1589a7,_0x26f964){return _0x1589a7===_0x26f964;},'mJdyw':'win32','VzjHc':_0x301238(0x1c9)};return new Promise((_0x17e7ad,_0x47c58d)=>{const _0x40ebca=_0x301238,_0x3ce4fa={'fRZZV':function(_0x2c02dc,_0x37c063){return _0x2c02dc===_0x37c063;},'rFLYA':function(_0xb2f4f0){const _0x2e83b7=_0x348d;return _0x4c26e7[_0x2e83b7(0x18b)](_0xb2f4f0);},'zuLjS':function(_0x377523,_0x3a865f){const _0xa4b5ee=_0x348d;return _0x4c26e7[_0xa4b5ee(0x1fb)](_0x377523,_0x3a865f);}},_0x52624b=[_0x40ebca(0x197)+_0x480907,_0x40ebca(0x1be),..._0x31cda7?[_0x4c26e7['RCcTP']]:[],_0x4c26e7['eTvgm']],_0x1e0539=spawn(_0x4c26e7[_0x40ebca(0x1e0)],_0x52624b,{'stdio':['ignore','inherit',_0x40ebca(0x1b6)],'shell':_0x4c26e7['cuxsP'](process['platform'],_0x4c26e7['mJdyw'])});_0x1e0539['on']('close',_0x2e4b7e=>{const _0x32cc65=_0x40ebca;_0x3ce4fa['fRZZV'](_0x2e4b7e,0x0)?_0x3ce4fa[_0x32cc65(0x1ce)](_0x17e7ad):_0x3ce4fa[_0x32cc65(0x1d0)](_0x47c58d,new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x2e4b7e));}),_0x1e0539['on'](_0x4c26e7[_0x40ebca(0x1b8)],_0x23a2fe=>{_0x47c58d(_0x23a2fe);});});}export async function authenticate(_0x48737f){const _0x32c0ca=_0xc5da9b,_0x34566d={'ADgoW':_0x32c0ca(0x1ec),'HUzDi':function(_0x14f8b2){return _0x14f8b2();},'nbkyN':'device_auth','MxgHF':'✓\x20Stored\x20credentials\x20locally'};if(!_0x48737f){const _0x266e08=await getToken();if(_0x266e08){const _0x5d4e2d=await getCurrentUser(_0x266e08);if(_0x5d4e2d['success'])return console['log']('✓\x20Already\x20authenticated\x20to\x20'+_0x5d4e2d[_0x32c0ca(0x1b4)][_0x32c0ca(0x1c1)]),{'token':_0x266e08,'method':_0x34566d['ADgoW']};}try{_0x48737f=await _0x34566d[_0x32c0ca(0x1d9)](runDeviceAuthFlow);}catch(_0x163513){throw new Error(_0x32c0ca(0x19a)+(_0x163513 instanceof Error?_0x163513[_0x32c0ca(0x1f3)]:_0x163513));}const _0x1e31ff=await getCurrentUser(_0x48737f);if(!_0x1e31ff[_0x32c0ca(0x1a6)])throw new Error(_0x32c0ca(0x1e8)+_0x1e31ff[_0x32c0ca(0x1c9)]);return console['log']('✓\x20Authenticated\x20to\x20'+_0x1e31ff['user']['organizationName']),{'token':_0x48737f,'method':_0x34566d['nbkyN']};}console[_0x32c0ca(0x19e)](_0x32c0ca(0x193));const _0x4e1ea6=await getCurrentUser(_0x48737f);if(!_0x4e1ea6[_0x32c0ca(0x1a6)]){if(_0x4e1ea6['status'])throw new Error('Authentication\x20failed:\x20'+_0x4e1ea6[_0x32c0ca(0x1c9)]+_0x32c0ca(0x1a1));else throw new Error(_0x32c0ca(0x1d6)+_0x4e1ea6['error']+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console[_0x32c0ca(0x19e)]('✓\x20Authenticated\x20to\x20'+_0x4e1ea6['user']['organizationName']),await storeToken(_0x48737f),console[_0x32c0ca(0x19e)](process['env']['GITHUB_ENV']?_0x32c0ca(0x1f2):_0x34566d[_0x32c0ca(0x1ac)]),{'token':_0x48737f,'method':_0x32c0ca(0x1b5)};}export async function ensureRangerDir(_0x72482f){const _0x4257f5=_0xc5da9b,_0x7e1e9c={'kYvLW':_0x4257f5(0x1b4),'mswSS':function(_0x404c20){return _0x404c20();},'cshdB':function(_0xfef1a8,_0x4f349b,_0x1dc2ee){return _0xfef1a8(_0x4f349b,_0x1dc2ee);},'lcmne':'.ranger','fpfJz':function(_0x542ccf){return _0x542ccf();},'UxPob':function(_0x3960db,_0x58bdef){return _0x3960db(_0x58bdef);},'waVto':function(_0x49618b,_0x46c5a2,_0x5e97b0){return _0x49618b(_0x46c5a2,_0x5e97b0);}};let _0x4c6358;if(_0x72482f===_0x7e1e9c['kYvLW'])_0x4c6358=getRangerHomeDir();else{const _0x16babd=_0x7e1e9c['mswSS'](findGitRoot);_0x4c6358=_0x16babd?_0x7e1e9c['cshdB'](join,_0x16babd,_0x7e1e9c['lcmne']):_0x7e1e9c[_0x4257f5(0x1ae)](getRangerDir);}return!_0x7e1e9c['UxPob'](existsSync,_0x4c6358)?(await _0x7e1e9c['waVto'](mkdir,_0x4c6358,{'recursive':!![]}),console['log'](_0x4257f5(0x1df)),{'path':_0x4c6358,'installed':!![]}):(console['log']('✓\x20.ranger/\x20directory\x20already\x20exists'),{'path':_0x4c6358,'installed':![]});}export async function ensureChromium(_0x5679bf=![]){const _0x531ac1=_0xc5da9b,_0x51cce5={'Knqej':function(_0xb7be3a,_0x1cd418){return _0xb7be3a(_0x1cd418);},'pjkvF':_0x531ac1(0x1d4),'HDkMQ':function(_0x3ea635,_0x37b01a,_0x21eafd){return _0x3ea635(_0x37b01a,_0x21eafd);},'TVJno':'\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','SnABa':'\x0a❌\x20Failed\x20to\x20install\x20Chromium:','OVLTV':function(_0x217745,_0x5486f4){return _0x217745 instanceof _0x5486f4;},'FSeMe':'You\x20can\x20install\x20it\x20manually\x20by\x20running:','szcjI':'\x0a⚠\x20Skipping\x20Chromium\x20installation.'};let _0x1323ce=![];try{const _0x28f0dc=chromium['executablePath']();_0x1323ce=_0x51cce5['Knqej'](existsSync,_0x28f0dc);}catch{_0x1323ce=![];}if(_0x1323ce)return console[_0x531ac1(0x19e)]('✓\x20Playwright\x20Chromium\x20browser\x20found'),![];const _0xc1c535=getPlaywrightVersion(),_0x3532c0=_0xc1c535??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x3ecb32=!_0xc1c535,_0x545213=process['stdin'][_0x531ac1(0x1dd)]&&process[_0x531ac1(0x1e4)][_0x531ac1(0x1dd)];let _0x21682f=!![];if(_0x545213){const {install:_0xf83906}=await _0x48c491['prompt']([{'type':'confirm','name':'install','message':_0x3ecb32?_0x531ac1(0x191)+_0x3532c0+'\x20now?':_0x531ac1(0x1c8)+_0x3532c0+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x21682f=_0xf83906;}else console['log'](_0x531ac1(0x1e6)+_0x3532c0+(_0x3ecb32?_0x51cce5['pjkvF']:'')+'...');if(_0x21682f){console[_0x531ac1(0x19e)]('\x0aInstalling\x20Chromium\x20browser...\x0a');try{await _0x51cce5[_0x531ac1(0x1cc)](installChromiumBinary,_0x3532c0,_0x5679bf),console['log'](_0x51cce5['TVJno']);}catch(_0x1c93ba){console['error'](_0x51cce5['SnABa'],_0x51cce5[_0x531ac1(0x1ca)](_0x1c93ba,Error)?_0x1c93ba['message']:_0x1c93ba),console[_0x531ac1(0x19e)](_0x51cce5[_0x531ac1(0x1aa)]),console['log']('\x20\x20npx\x20playwright@'+_0x3532c0+'\x20install\x20chromium');}}else console['log'](_0x51cce5['szcjI']),console[_0x531ac1(0x19e)](_0x531ac1(0x1bb)),console['log']('\x20\x20npx\x20playwright@'+_0x3532c0+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0xb1b317){const _0xf70164=_0xc5da9b,_0x1bb47b={'KqxqR':function(_0x9425e8,_0x50bc08,_0x275e31){return _0x9425e8(_0x50bc08,_0x275e31);},'NyGUD':'✓\x20Created\x20.ranger/.gitignore'},_0x31a3e1=_0x1bb47b[_0xf70164(0x1a5)](join,_0xb1b317,'.gitignore'),_0x224a3f='\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(_0x31a3e1,_0x224a3f),console['log'](_0x1bb47b[_0xf70164(0x1af)]);}function printProfileSetupLaterInstructions(){const _0x42b7fd=_0xc5da9b,_0x305627={'uCcEI':_0x42b7fd(0x1e5)};console['log']('\x0aIn\x20order\x20for\x20Ranger\x20to\x20verify\x20your\x20work,\x20you\x27ll\x20need\x20to\x20set\x20up\x20a\x20profile\x20later\x20with:'),console['log']('\x20\x20'+bold(_0x305627['uCcEI'])),console['log'](_0x42b7fd(0x1b1));}export async function ensureLocalEnv(_0x5b787f,_0x286ea0){const _0x21102b=_0xc5da9b,_0xc2b040={'nWETn':function(_0x3493ba){return _0x3493ba();},'YQEiE':_0x21102b(0x1a2),'tNXow':function(_0x234acf,_0xcc429c){return _0x234acf===_0xcc429c;},'ZfGTF':function(_0x44efca,_0x4b7ae5,_0x9fc83b){return _0x44efca(_0x4b7ae5,_0x9fc83b);},'jLnhm':_0x21102b(0x1c6),'rewHC':_0x21102b(0x194),'tSaqz':_0x21102b(0x189),'QfBoy':_0x21102b(0x1f7),'uPKjS':_0x21102b(0x186),'ZHmxw':function(_0x595470){return _0x595470();}};if(!_0xc2b040['nWETn'](findGitRoot))return console['log'](_0xc2b040[_0x21102b(0x1a0)]),{'ready':![],'skipped':!![]};const _0xd8e2a1=_0xc2b040[_0x21102b(0x199)](_0x5b787f?.[_0x21102b(0x1bf)],_0x21102b(0x1b4))?getRangerHomeDir():undefined;if(_0xc2b040['ZfGTF'](findExistingEnv,_0x21102b(0x1c5),{'locations':[_0x21102b(0x1c5)],'rangerDir':_0xd8e2a1}))return console['log']('✓\x20Local\x20profile\x20already\x20exists'),{'ready':!![],'skipped':![]};const _0x5c08f0=process[_0x21102b(0x1ee)][_0x21102b(0x1dd)]&&process['stdout'][_0x21102b(0x1dd)];if(_0x5c08f0&&!_0x5b787f?.['url']){console[_0x21102b(0x19e)](_0xc2b040[_0x21102b(0x1b7)]),console[_0x21102b(0x19e)](_0x21102b(0x19d)),console[_0x21102b(0x19e)](_0xc2b040[_0x21102b(0x1cf)]),console['log'](_0xc2b040['tSaqz']),console['log'](_0x21102b(0x1d2));const {wantsProfile:_0x489518}=await _0x48c491[_0x21102b(0x198)]([{'type':_0xc2b040['QfBoy'],'name':_0x21102b(0x1b0),'message':_0xc2b040[_0x21102b(0x1f0)],'default':!![]}]);if(!_0x489518)return _0xc2b040['nWETn'](printProfileSetupLaterInstructions),{'ready':![],'skipped':!![]};}try{return await addEnv(_0x21102b(0x1c5),{'url':_0x5b787f?.['url'],'force':_0x5b787f?.['force'],'allowInsecureLocalhost':_0x5b787f?.[_0x21102b(0x1bd)],'scope':_0x5b787f?.[_0x21102b(0x1bf)]},_0x286ea0),{'ready':!![],'skipped':![]};}catch(_0x48bead){return console['error'](_0x21102b(0x187),_0x48bead instanceof Error?_0x48bead[_0x21102b(0x1f3)]:_0x48bead),_0xc2b040['ZHmxw'](printProfileSetupLaterInstructions),{'ready':![],'skipped':![]};}}function _0x348d(_0x26e6b7,_0x2b3620){_0x26e6b7=_0x26e6b7-0x183;const _0x5756b4=_0x5756();let _0x348d79=_0x5756b4[_0x26e6b7];return _0x348d79;}export async function start(_0x218159,_0x510947,_0x178d41){const _0x45c284=_0xc5da9b,_0x7cad77={'eJPMq':_0x45c284(0x1e2),'BGmWu':_0x45c284(0x1d3),'bYNOt':'user','HQBvU':_0x45c284(0x1b3),'kyyaY':function(_0x155cbc,_0x240d31){return _0x155cbc&&_0x240d31;},'aAOnD':_0x45c284(0x183),'aVUOp':_0x45c284(0x1ed),'RgeAD':function(_0xdc7f44,_0x511818){return _0xdc7f44(_0x511818);},'kYFhR':function(_0x110a6d){return _0x110a6d();},'RMZKz':function(_0x299026,_0x3ce072){return _0x299026(_0x3ce072);},'fSRef':'✓\x20Skipping\x20authentication\x20(--skip-auth)','fnZTg':'auth','NukDd':'chromium','AZEJq':_0x45c284(0x1e1),'Jlicy':_0x45c284(0x1c2),'ADOCE':_0x45c284(0x195),'gDUBX':function(_0x5164db,_0x48ea28,_0x5343dd){return _0x5164db(_0x48ea28,_0x5343dd);},'mMBBw':_0x45c284(0x1fa),'rQusG':'opencode','lfmAw':_0x45c284(0x1a7),'FPgul':'skills','rmSEY':function(_0x4909ef,_0xd15a00){return _0x4909ef(_0xd15a00);},'pfdkl':_0x45c284(0x1e7),'aIntX':_0x45c284(0x1f8),'oCdec':_0x45c284(0x1a8),'MEnlX':'verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','vMQxN':_0x45c284(0x19b),'TtMLF':function(_0x47f8c6,_0xaadc6a){return _0x47f8c6+_0xaadc6a;}};console[_0x45c284(0x19e)](_0x7cad77['eJPMq']);const _0x4cd57c=process['stdin'][_0x45c284(0x1dd)]&&process['stdout'][_0x45c284(0x1dd)];!_0x4cd57c&&!_0x510947?.[_0x45c284(0x1bf)]&&(console['log'](_0x7cad77['BGmWu']),_0x510947={..._0x510947,'scope':_0x7cad77[_0x45c284(0x1c7)]});const _0x3ce0eb=_0x510947?.['scope']===_0x45c284(0x1b4);_0x178d41?.[_0x45c284(0x1de)](_0x7cad77[_0x45c284(0x1f1)]);const _0x1d01ff=findGitRoot();if(_0x7cad77['kyyaY'](!_0x1d01ff,!_0x3ce0eb)){await _0x178d41?.[_0x45c284(0x18f)](_0x7cad77['HQBvU'],new Error(_0x45c284(0x1eb)));throw new Error(_0x7cad77['aAOnD']+_0x7cad77['aVUOp']);}_0x178d41?.[_0x45c284(0x1f6)](_0x7cad77['HQBvU']);const _0x3613c4=!_0x7cad77[_0x45c284(0x1a4)](existsSync,_0x7cad77['kYFhR'](getRangerDir)),{path:_0x39f011}=await _0x7cad77[_0x45c284(0x1c4)](ensureRangerDir,_0x3ce0eb?_0x7cad77['bYNOt']:undefined);if(_0x510947?.[_0x45c284(0x192)])console['log'](_0x7cad77[_0x45c284(0x1bc)]),_0x178d41?.['trackPhaseEnd'](_0x7cad77['fnZTg'],{'isFirstRun':_0x3613c4,'method':_0x45c284(0x1ad)});else{_0x178d41?.['trackPhaseStart'](_0x7cad77[_0x45c284(0x1d5)]);const _0x4f9976=await _0x7cad77[_0x45c284(0x1c4)](authenticate,_0x218159);_0x178d41?.['trackPhaseEnd'](_0x45c284(0x1ab),{'isFirstRun':_0x3613c4,'method':_0x4f9976['method']});}_0x178d41?.['trackPhaseStart'](_0x7cad77['NukDd']);_0x510947?.['skipChromium']?console['log'](_0x7cad77['AZEJq']):await ensureChromium(_0x510947?.[_0x45c284(0x18e)]);_0x178d41?.[_0x45c284(0x1f6)](_0x7cad77[_0x45c284(0x1c3)],{'isFirstRun':_0x3613c4,'skipped':!!_0x510947?.['skipChromium']});!_0x3ce0eb&&await writeRangerGitignore(_0x39f011);console[_0x45c284(0x19e)](_0x7cad77['Jlicy']);const _0x2cbc1a=_0x510947?.['scope'],_0x51d0d3=_0x510947?.[_0x45c284(0x1ea)]??![];let _0x24b5a7=null;_0x51d0d3?(_0x178d41?.['trackPhaseStart'](_0x7cad77['ADOCE']),_0x24b5a7=await _0x7cad77[_0x45c284(0x1a4)](ensureOpencodePluginConfig,_0x2cbc1a),_0x178d41?.['trackPhaseEnd'](_0x7cad77[_0x45c284(0x184)],{'isFirstRun':_0x3613c4,'opencode':!![]})):(_0x178d41?.['trackPhaseStart'](_0x7cad77['ADOCE']),await ensureClaudePlugin(_0x2cbc1a),_0x178d41?.['trackPhaseEnd'](_0x7cad77[_0x45c284(0x184)],{'isFirstRun':_0x3613c4}));if(_0x51d0d3&&_0x24b5a7){_0x178d41?.['trackPhaseStart']('skills');try{await _0x7cad77['gDUBX'](installSkill,_0x7cad77['mMBBw'],{'level':_0x24b5a7[_0x45c284(0x1bf)],'cliVersion':_0x7cad77['kYFhR'](getCurrentVersion),'platform':_0x7cad77['rQusG']}),_0x178d41?.[_0x45c284(0x1f6)](_0x45c284(0x1f9),{'isFirstRun':_0x3613c4,'opencode':!![]});}catch(_0xff92fd){console['warn'](_0x7cad77[_0x45c284(0x1da)],_0xff92fd instanceof Error?_0xff92fd[_0x45c284(0x1f3)]:_0xff92fd),_0x178d41?.[_0x45c284(0x1f6)](_0x7cad77['FPgul'],{'isFirstRun':_0x3613c4,'opencode':!![],'failed':!![]});}}else _0x178d41?.[_0x45c284(0x1de)]('skills'),await _0x7cad77[_0x45c284(0x1d8)](ensureClaudeSkills,_0x2cbc1a),_0x178d41?.[_0x45c284(0x1f6)](_0x7cad77[_0x45c284(0x185)],{'isFirstRun':_0x3613c4});if(_0x510947?.['skipAuth'])console['log'](_0x45c284(0x1ba));else{if(!_0x4cd57c&&!_0x510947?.[_0x45c284(0x196)])console['log'](_0x7cad77[_0x45c284(0x19c)]),console[_0x45c284(0x19e)]('\x20\x20'+bold('ranger\x20profile\x20add\x20local')+'\x0a');else{_0x178d41?.[_0x45c284(0x1de)](_0x45c284(0x1f8));const _0xb5b338=await ensureLocalEnv({'url':_0x510947?.['url'],'force':_0x510947?.[_0x45c284(0x1cb)],'allowInsecureLocalhost':_0x510947?.[_0x45c284(0x1bd)],'scope':_0x510947?.['scope']===_0x7cad77[_0x45c284(0x1c7)]?_0x7cad77['bYNOt']:undefined},_0x178d41);_0x178d41?.[_0x45c284(0x1f6)](_0x7cad77['aIntX'],{'isFirstRun':_0x3613c4,'profileReady':_0xb5b338['ready'],'userSkipped':_0xb5b338['skipped']}),_0xb5b338['ready']&&console['log'](_0x45c284(0x1f5));}}if(_0x51d0d3)console['log']('\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)'),console['log']('and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review'),console['log'](_0x7cad77[_0x45c284(0x1f4)]),console['log'](_0x7cad77['MEnlX']);else{const _0xdc52a2=bold(_0x7cad77['vMQxN']);console['log'](_0x7cad77[_0x45c284(0x1e3)](_0x45c284(0x1e9)+_0xdc52a2+_0x45c284(0x188)+_0x45c284(0x19f),_0x45c284(0x1c0))+'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.');}}
1
+ const _0x4c87d1=_0xc11a;(function(_0xc38d6,_0x53665b){const _0x34f9ca=_0xc11a,_0x3c6d58=_0xc38d6();while(!![]){try{const _0x4dc06a=-parseInt(_0x34f9ca(0x194))/0x1*(parseInt(_0x34f9ca(0x185))/0x2)+-parseInt(_0x34f9ca(0x1b6))/0x3+-parseInt(_0x34f9ca(0x1d0))/0x4*(parseInt(_0x34f9ca(0x1b7))/0x5)+-parseInt(_0x34f9ca(0x181))/0x6+parseInt(_0x34f9ca(0x19c))/0x7*(parseInt(_0x34f9ca(0x1ef))/0x8)+parseInt(_0x34f9ca(0x199))/0x9+parseInt(_0x34f9ca(0x1f0))/0xa;if(_0x4dc06a===_0x53665b)break;else _0x3c6d58['push'](_0x3c6d58['shift']());}catch(_0x42e7f4){_0x3c6d58['push'](_0x3c6d58['shift']());}}}(_0x226a,0x4de0a));import{mkdir,writeFile}from'fs/promises';import{join}from'path';function _0x226a(){const _0x5d14e1=['resolve','Validating\x20API\x20token...','force','\x0aInstalling\x20Chromium\x20browser...\x0a','pQOpw','\x1b[0m','scope','git_check','Authentication\x20failed:\x20','evHlP','You\x20can\x20install\x20it\x20manually\x20by\x20running:','dHoQl','KmObV','profile','KnclH','Non-interactive\x20mode:\x20Skipping\x20profile\x20setup.\x20To\x20set\x20up\x20a\x20profile,\x20pass\x20--url\x20or\x20run\x20later:','1336hPVGTS','13081180NUlGkG','wspRe','warn','\x20now?','confirm','log','cRpVW','executablePath','dOpcP','stdout','tpSyU','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','trackPhaseEnd','stdin','✓\x20Local\x20profile\x20already\x20exists','KkxHe','\x0a✅\x20You\x27re\x20ready\x20to\x20start\x20using\x20Ranger\x20Feature\x20Review.','message','3529380sdVrRU','IqBaR','chromium','platform','280HaHUxe','win32','AHBpe','scdMl','prompt','BGUSU','install','--with-deps','CrRto','EuQux','\x0a❌\x20Profile\x20setup\x20failed:','eNecy','YzyUA','tJMnf','llaRQ','2117QbBiGa','YSECI','gGlUq','...','XibKL','356778oCEQnQ','iYQTU','\x0aIn\x20Claude\x20Code,\x20run\x20','15211bqSVHd','The\x20required\x20version\x20(','OpkOy','skipAuth',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','withDeps','\x1b[1m','FYHBk','kWtfB','✓\x20Created\x20.ranger/\x20directory','WulAf','Non-interactive\x20mode:\x20No\x20--scope\x20provided,\x20defaulting\x20to\x20user.','1.58.2','plugin','playwright@','nYDdH','skipChromium','zVQNE','skills','version','fiXBr','gHcAH','Make\x20sure\x20your\x20app\x20is\x20running\x20before\x20you\x20start.\x0a','Nglbe','\x20and\x20prompt\x20the\x20coding','PAemA','721737SETEht','666190gtWotM','error','opencode','\x0aIn\x20order\x20for\x20Ranger\x20to\x20verify\x20your\x20work,\x20you\x27ll\x20need\x20to\x20set\x20up\x20a\x20profile\x20later\x20with:','SmGlu','shcsx','SRCfC','\x0a⚠\x20Skipping\x20Chromium\x20installation.','iQvdZ','ready','\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','ranger\x20profile\x20add\x20local','OpBZp','kzqQV','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','user','✓\x20Created\x20.ranger/.gitignore','kunpp','skipped','url','trackPhaseStart','⚠\x20No\x20git\x20repository\x20found.\x20Run\x20`ranger\x20profile\x20add\x20local`\x20from\x20your\x20project\x20directory.','isTTY','fZDLx','allowInsecureLocalhost','8yMTJnL','env','organizationName','GNyGo','QcIbD','auth,\x20you\x20can\x20log\x20in\x20and\x20we\x27ll\x20save\x20the\x20session\x20state\x20for\x20Ranger\x20to','success','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','\x20install\x20chromium','local','wantsProfile','Installation\x20failed\x20with\x20exit\x20code\x20','\x0a🚀\x20Ranger\x20Setup\x0a','✓\x20Already\x20authenticated\x20to\x20','XKLST'];_0x226a=function(){return _0x5d14e1;};return _0x226a();}import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';function _0xc11a(_0x2bbc06,_0x13f10f){_0x2bbc06=_0x2bbc06-0x17b;const _0x226a99=_0x226a();let _0xc11a25=_0x226a99[_0x2bbc06];return _0xc11a25;}import _0xe70602 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerDir,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=_0x4c87d1(0x1a8);const bold=_0x28bd97=>_0x4c87d1(0x1a2)+_0x28bd97+_0x4c87d1(0x1e4);export function getPlaywrightVersion(){const _0x528d50=_0x4c87d1,_0x11ba46={'GNyGo':'playwright/package.json'};try{const _0x2bd6d9=require[_0x528d50(0x1df)](_0x11ba46[_0x528d50(0x1d3)]),_0xefdb18=require(_0x2bd6d9);return _0xefdb18[_0x528d50(0x1af)];}catch{return null;}}export function installChromiumBinary(_0x147623,_0x1c341f=![]){const _0x5800ff=_0x4c87d1,_0x52a8a0={'dHoQl':'install','gyUaW':_0x5800ff(0x18c),'kzqQV':function(_0x1fdf7b,_0x4d08b5,_0x3ac242,_0x10a5e5){return _0x1fdf7b(_0x4d08b5,_0x3ac242,_0x10a5e5);},'tpSyU':'inherit','dOpcP':'close','gxIab':'error'};return new Promise((_0xac7fe3,_0x1c5ad3)=>{const _0x437f17=_0x5800ff,_0x1d953d=[_0x437f17(0x1aa)+_0x147623,_0x52a8a0[_0x437f17(0x1ea)],..._0x1c341f?[_0x52a8a0['gyUaW']]:[],'chromium'],_0x40686d=_0x52a8a0[_0x437f17(0x1c4)](spawn,'npx',_0x1d953d,{'stdio':['ignore',_0x52a8a0['tpSyU'],_0x52a8a0[_0x437f17(0x1fa)]],'shell':process[_0x437f17(0x184)]===_0x437f17(0x186)});_0x40686d['on'](_0x52a8a0[_0x437f17(0x1f8)],_0x164e54=>{const _0x210efa=_0x437f17;_0x164e54===0x0?_0xac7fe3():_0x1c5ad3(new Error(_0x210efa(0x1db)+_0x164e54));}),_0x40686d['on'](_0x52a8a0['gxIab'],_0x414f2a=>{_0x1c5ad3(_0x414f2a);});});}export async function authenticate(_0x250886){const _0x3d39ee=_0x4c87d1,_0x47ee64={'WKLuR':function(_0x1a9a7d,_0x3c146a){return _0x1a9a7d instanceof _0x3c146a;},'KnclH':'device_auth','tJMnf':_0x3d39ee(0x1e0),'fZDLx':'✓\x20Exported\x20credentials\x20for\x20CI','XibKL':'✓\x20Stored\x20credentials\x20locally','iQvdZ':'provided_token'};if(!_0x250886){const _0x3d13c2=await getToken();if(_0x3d13c2){const _0x2124b9=await getCurrentUser(_0x3d13c2);if(_0x2124b9['success'])return console[_0x3d39ee(0x1f5)](_0x3d39ee(0x1dd)+_0x2124b9[_0x3d39ee(0x1c6)]['organizationName']),{'token':_0x3d13c2,'method':'existing_token'};}try{_0x250886=await runDeviceAuthFlow();}catch(_0x465e9f){throw new Error('Authentication\x20failed:\x20'+(_0x47ee64['WKLuR'](_0x465e9f,Error)?_0x465e9f[_0x3d39ee(0x180)]:_0x465e9f));}const _0x39259b=await getCurrentUser(_0x250886);if(!_0x39259b['success'])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x39259b['error']);return console[_0x3d39ee(0x1f5)]('✓\x20Authenticated\x20to\x20'+_0x39259b['user'][_0x3d39ee(0x1d2)]),{'token':_0x250886,'method':_0x47ee64[_0x3d39ee(0x1ed)]};}console[_0x3d39ee(0x1f5)](_0x47ee64[_0x3d39ee(0x192)]);const _0x4fb80a=await getCurrentUser(_0x250886);if(!_0x4fb80a[_0x3d39ee(0x1d6)]){if(_0x4fb80a['status'])throw new Error(_0x3d39ee(0x1e7)+_0x4fb80a[_0x3d39ee(0x1b8)]+_0x3d39ee(0x1fb));else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x4fb80a[_0x3d39ee(0x1b8)]+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console['log']('✓\x20Authenticated\x20to\x20'+_0x4fb80a[_0x3d39ee(0x1c6)][_0x3d39ee(0x1d2)]),await storeToken(_0x250886),console['log'](process[_0x3d39ee(0x1d1)]['GITHUB_ENV']?_0x47ee64[_0x3d39ee(0x1ce)]:_0x47ee64[_0x3d39ee(0x198)]),{'token':_0x250886,'method':_0x47ee64[_0x3d39ee(0x1bf)]};}export async function ensureRangerDir(_0x4056ca){const _0x1381ea=_0x4c87d1,_0xf672a7={'BtgtA':'user','BGUSU':function(_0x5bc13d){return _0x5bc13d();},'evHlP':function(_0x3c3c0f){return _0x3c3c0f();},'KOdYY':'.ranger','YSECI':function(_0x2aaabd,_0xb42e05,_0x27288b){return _0x2aaabd(_0xb42e05,_0x27288b);},'wspRe':_0x1381ea(0x1a5),'gHcAH':'✓\x20.ranger/\x20directory\x20already\x20exists'};let _0x15f356;if(_0x4056ca===_0xf672a7['BtgtA'])_0x15f356=_0xf672a7[_0x1381ea(0x18a)](getRangerHomeDir);else{const _0x69b454=_0xf672a7[_0x1381ea(0x1e8)](findGitRoot);_0x15f356=_0x69b454?join(_0x69b454,_0xf672a7['KOdYY']):getRangerDir();}return!existsSync(_0x15f356)?(await _0xf672a7[_0x1381ea(0x195)](mkdir,_0x15f356,{'recursive':!![]}),console['log'](_0xf672a7[_0x1381ea(0x1f1)]),{'path':_0x15f356,'installed':!![]}):(console['log'](_0xf672a7[_0x1381ea(0x1b1)]),{'path':_0x15f356,'installed':![]});}export async function ensureChromium(_0x1de258=![]){const _0x1501b5=_0x4c87d1,_0xf3d612={'Nglbe':function(_0x5a16d2,_0x13630d){return _0x5a16d2(_0x13630d);},'nYDdH':function(_0x5e8045,_0xe7fdb6){return _0x5e8045??_0xe7fdb6;},'scdMl':'confirm','OpBZp':_0x1501b5(0x1e2),'XKLST':function(_0x3ac00c,_0x4b590c,_0x550c25){return _0x3ac00c(_0x4b590c,_0x550c25);},'SmGlu':'\x0a❌\x20Failed\x20to\x20install\x20Chromium:','uOmKR':function(_0x49ef27,_0x4d8fd5){return _0x49ef27 instanceof _0x4d8fd5;},'YzyUA':_0x1501b5(0x1e9),'yaIuP':_0x1501b5(0x1be),'WulAf':'You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'};let _0x594037=![];try{const _0x519282=chromium[_0x1501b5(0x1f7)]();_0x594037=_0xf3d612[_0x1501b5(0x1b3)](existsSync,_0x519282);}catch{_0x594037=![];}if(_0x594037)return console['log']('✓\x20Playwright\x20Chromium\x20browser\x20found'),![];const _0xacf7c1=getPlaywrightVersion(),_0x468ad8=_0xf3d612[_0x1501b5(0x1ab)](_0xacf7c1,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x719354=!_0xacf7c1,_0x304197=process[_0x1501b5(0x17c)]['isTTY']&&process[_0x1501b5(0x1f9)]['isTTY'];let _0xf127a4=!![];if(_0x304197){const {install:_0x3fc377}=await _0xe70602[_0x1501b5(0x189)]([{'type':_0xf3d612[_0x1501b5(0x188)],'name':_0x1501b5(0x18b),'message':_0x719354?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x468ad8+_0x1501b5(0x1f3):_0x1501b5(0x19d)+_0x468ad8+_0x1501b5(0x1a0),'default':!![]}]);_0xf127a4=_0x3fc377;}else console[_0x1501b5(0x1f5)]('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x468ad8+(_0x719354?'\x20(fallback\x20version)':'')+_0x1501b5(0x197));if(_0xf127a4){console['log'](_0xf3d612[_0x1501b5(0x1c3)]);try{await _0xf3d612[_0x1501b5(0x1de)](installChromiumBinary,_0x468ad8,_0x1de258),console['log'](_0x1501b5(0x1c5));}catch(_0xefd230){console['error'](_0xf3d612[_0x1501b5(0x1bb)],_0xf3d612['uOmKR'](_0xefd230,Error)?_0xefd230[_0x1501b5(0x180)]:_0xefd230),console[_0x1501b5(0x1f5)](_0xf3d612[_0x1501b5(0x191)]),console['log']('\x20\x20npx\x20playwright@'+_0x468ad8+_0x1501b5(0x1d8));}}else console['log'](_0xf3d612['yaIuP']),console[_0x1501b5(0x1f5)](_0xf3d612[_0x1501b5(0x1a6)]),console[_0x1501b5(0x1f5)]('\x20\x20npx\x20playwright@'+_0x468ad8+_0x1501b5(0x1d8));return!![];}export async function writeRangerGitignore(_0x17f374){const _0x59f312=_0x4c87d1,_0x4e226a={'SRCfC':function(_0x1dc4fc,_0x36d5b6,_0x53d645){return _0x1dc4fc(_0x36d5b6,_0x53d645);}},_0x34dd46=_0x4e226a[_0x59f312(0x1bd)](join,_0x17f374,'.gitignore'),_0x438839=_0x59f312(0x1c1);await writeFile(_0x34dd46,_0x438839),console['log'](_0x59f312(0x1c7));}function printProfileSetupLaterInstructions(){const _0x22b5c4=_0x4c87d1,_0x547a98={'krMRm':_0x22b5c4(0x1ba),'bXQKo':'ranger\x20profile\x20add\x20local'};console['log'](_0x547a98['krMRm']),console[_0x22b5c4(0x1f5)]('\x20\x20'+bold(_0x547a98['bXQKo'])),console['log'](_0x22b5c4(0x1b2));}export async function ensureLocalEnv(_0x1bfdfb,_0x3faf70){const _0x21d0b=_0x4c87d1,_0x188d5e={'shcsx':function(_0x5b972a){return _0x5b972a();},'OpkOy':_0x21d0b(0x1cc),'ItPkb':function(_0x474a31,_0x3377f8){return _0x474a31===_0x3377f8;},'zcYNI':function(_0x4e3a12,_0x3a6b62,_0x437554){return _0x4e3a12(_0x3a6b62,_0x437554);},'CrRto':_0x21d0b(0x1d9),'hRaPD':'\x0aA\x20profile\x20gives\x20Ranger\x27s\x20browser\x20agent\x20information\x20about\x20how','QcRuR':'to\x20access\x20your\x20app.\x20If\x20the\x20part\x20of\x20your\x20app\x20you\x20want\x20to\x20test\x20is\x20behind','eNecy':'use\x20until\x20the\x20session\x20expires.\x0a','zVQNE':'Would\x20you\x20like\x20to\x20set\x20up\x20the\x20profile\x20now?','pQOpw':_0x21d0b(0x18f)};if(!_0x188d5e[_0x21d0b(0x1bc)](findGitRoot))return console['log'](_0x188d5e[_0x21d0b(0x19e)]),{'ready':![],'skipped':!![]};const _0x2994f6=_0x188d5e['ItPkb'](_0x1bfdfb?.['scope'],_0x21d0b(0x1c6))?_0x188d5e[_0x21d0b(0x1bc)](getRangerHomeDir):undefined;if(_0x188d5e['zcYNI'](findExistingEnv,_0x21d0b(0x1d9),{'locations':[_0x188d5e[_0x21d0b(0x18d)]],'rangerDir':_0x2994f6}))return console['log'](_0x21d0b(0x17d)),{'ready':!![],'skipped':![]};const _0x956d79=process['stdin'][_0x21d0b(0x1cd)]&&process['stdout'][_0x21d0b(0x1cd)];if(_0x956d79&&!_0x1bfdfb?.['url']){console[_0x21d0b(0x1f5)](_0x188d5e['hRaPD']),console[_0x21d0b(0x1f5)](_0x188d5e['QcRuR']),console[_0x21d0b(0x1f5)](_0x21d0b(0x1d5)),console[_0x21d0b(0x1f5)](_0x188d5e[_0x21d0b(0x190)]),console[_0x21d0b(0x1f5)]('You\x27ll\x20need\x20the\x20app\x20to\x20be\x20running\x20to\x20set\x20up\x20the\x20profile.');const {wantsProfile:_0x4c59aa}=await _0xe70602[_0x21d0b(0x189)]([{'type':_0x21d0b(0x1f4),'name':_0x21d0b(0x1da),'message':_0x188d5e[_0x21d0b(0x1ad)],'default':!![]}]);if(!_0x4c59aa)return printProfileSetupLaterInstructions(),{'ready':![],'skipped':!![]};}try{return await addEnv(_0x188d5e[_0x21d0b(0x18d)],{'url':_0x1bfdfb?.[_0x21d0b(0x1ca)],'force':_0x1bfdfb?.[_0x21d0b(0x1e1)],'allowInsecureLocalhost':_0x1bfdfb?.[_0x21d0b(0x1cf)],'scope':_0x1bfdfb?.[_0x21d0b(0x1e5)]},_0x3faf70),{'ready':!![],'skipped':![]};}catch(_0x21abdf){return console[_0x21d0b(0x1b8)](_0x188d5e[_0x21d0b(0x1e3)],_0x21abdf instanceof Error?_0x21abdf['message']:_0x21abdf),_0x188d5e[_0x21d0b(0x1bc)](printProfileSetupLaterInstructions),{'ready':![],'skipped':![]};}}export async function start(_0x41b724,_0x64b222,_0x2806b5){const _0x2b30f5=_0x4c87d1,_0x3cc94e={'gGlUq':function(_0x1ea920,_0x15e196){return _0x1ea920===_0x15e196;},'PAemA':'user','IqBaR':_0x2b30f5(0x1e6),'fiXBr':'No\x20git\x20repository\x20found.\x20Please\x20run\x20`ranger\x20setup`\x20from\x20inside\x20your\x20project\x20directory,\x0a','SKdVW':'or\x20use\x20--scope\x20user\x20to\x20install\x20at\x20the\x20user\x20level\x20without\x20a\x20project.','JQZPE':function(_0x3a9fca){return _0x3a9fca();},'KkxHe':'auth','llaRQ':function(_0x48038f,_0x45bf29){return _0x48038f(_0x45bf29);},'zHtjw':'\x0a✅\x20Ranger\x20setup\x20complete!\x0a','FYHBk':'plugin','EuQux':function(_0x43c193,_0x34b793){return _0x43c193(_0x34b793);},'QcIbD':function(_0x11d36b,_0x52fa57){return _0x11d36b&&_0x52fa57;},'cRpVW':'ranger','rysvD':'\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','XkDlb':'\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','kunpp':_0x2b30f5(0x1ec),'kWtfB':'with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','KmObV':'verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','AHBpe':function(_0xcbb3db,_0x2b2dc2){return _0xcbb3db(_0x2b2dc2);},'iYQTU':'/ranger:enable'};console['log'](_0x2b30f5(0x1dc));const _0x274282=process['stdin']['isTTY']&&process[_0x2b30f5(0x1f9)][_0x2b30f5(0x1cd)];!_0x274282&&!_0x64b222?.['scope']&&(console['log'](_0x2b30f5(0x1a7)),_0x64b222={..._0x64b222,'scope':'user'});const _0x53125f=_0x3cc94e[_0x2b30f5(0x196)](_0x64b222?.[_0x2b30f5(0x1e5)],_0x3cc94e[_0x2b30f5(0x1b5)]);_0x2806b5?.[_0x2b30f5(0x1cb)](_0x3cc94e[_0x2b30f5(0x182)]);const _0x30c6c8=findGitRoot();if(!_0x30c6c8&&!_0x53125f){await _0x2806b5?.['trackPhaseError']('git_check',new Error('No\x20git\x20repository\x20found'));throw new Error(_0x3cc94e[_0x2b30f5(0x1b0)]+_0x3cc94e['SKdVW']);}_0x2806b5?.['trackPhaseEnd'](_0x3cc94e['IqBaR']);const _0x5433a0=!existsSync(_0x3cc94e['JQZPE'](getRangerDir)),{path:_0x29f74b}=await ensureRangerDir(_0x53125f?_0x2b30f5(0x1c6):undefined);if(_0x64b222?.[_0x2b30f5(0x19f)])console[_0x2b30f5(0x1f5)]('✓\x20Skipping\x20authentication\x20(--skip-auth)'),_0x2806b5?.['trackPhaseEnd'](_0x3cc94e['KkxHe'],{'isFirstRun':_0x5433a0,'method':'skipped'});else{_0x2806b5?.['trackPhaseStart'](_0x3cc94e['KkxHe']);const _0x4941db=await _0x3cc94e[_0x2b30f5(0x193)](authenticate,_0x41b724);_0x2806b5?.[_0x2b30f5(0x17b)](_0x3cc94e[_0x2b30f5(0x17e)],{'isFirstRun':_0x5433a0,'method':_0x4941db['method']});}_0x2806b5?.['trackPhaseStart'](_0x2b30f5(0x183));_0x64b222?.['skipChromium']?console['log']('✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)'):await _0x3cc94e['llaRQ'](ensureChromium,_0x64b222?.[_0x2b30f5(0x1a1)]);_0x2806b5?.[_0x2b30f5(0x17b)](_0x2b30f5(0x183),{'isFirstRun':_0x5433a0,'skipped':!!_0x64b222?.[_0x2b30f5(0x1ac)]});!_0x53125f&&await writeRangerGitignore(_0x29f74b);console[_0x2b30f5(0x1f5)](_0x3cc94e['zHtjw']);const _0x2388ba=_0x64b222?.[_0x2b30f5(0x1e5)],_0x5e6109=_0x64b222?.[_0x2b30f5(0x1b9)]??![];let _0x7eccbb=null;_0x5e6109?(_0x2806b5?.['trackPhaseStart'](_0x3cc94e[_0x2b30f5(0x1a3)]),_0x7eccbb=await _0x3cc94e[_0x2b30f5(0x18e)](ensureOpencodePluginConfig,_0x2388ba),_0x2806b5?.[_0x2b30f5(0x17b)]('plugin',{'isFirstRun':_0x5433a0,'opencode':!![]})):(_0x2806b5?.['trackPhaseStart'](_0x3cc94e['FYHBk']),await ensureClaudePlugin(_0x2388ba),_0x2806b5?.[_0x2b30f5(0x17b)](_0x2b30f5(0x1a9),{'isFirstRun':_0x5433a0}));if(_0x3cc94e[_0x2b30f5(0x1d4)](_0x5e6109,_0x7eccbb)){_0x2806b5?.[_0x2b30f5(0x1cb)](_0x2b30f5(0x1ae));try{await installSkill(_0x3cc94e[_0x2b30f5(0x1f6)],{'level':_0x7eccbb['scope'],'cliVersion':_0x3cc94e['JQZPE'](getCurrentVersion),'platform':'opencode'}),_0x2806b5?.[_0x2b30f5(0x17b)]('skills',{'isFirstRun':_0x5433a0,'opencode':!![]});}catch(_0x52ba6c){console[_0x2b30f5(0x1f2)](_0x3cc94e['rysvD'],_0x52ba6c instanceof Error?_0x52ba6c['message']:_0x52ba6c),_0x2806b5?.['trackPhaseEnd']('skills',{'isFirstRun':_0x5433a0,'opencode':!![],'failed':!![]});}}else _0x2806b5?.['trackPhaseStart'](_0x2b30f5(0x1ae)),await ensureClaudeSkills(_0x2388ba),_0x2806b5?.['trackPhaseEnd']('skills',{'isFirstRun':_0x5433a0});if(_0x64b222?.['skipAuth'])console['log'](_0x3cc94e['XkDlb']);else{if(!_0x274282&&!_0x64b222?.['url'])console['log'](_0x2b30f5(0x1ee)),console['log']('\x20\x20'+bold(_0x2b30f5(0x1c2))+'\x0a');else{_0x2806b5?.['trackPhaseStart']('profile');const _0x429803=await ensureLocalEnv({'url':_0x64b222?.[_0x2b30f5(0x1ca)],'force':_0x64b222?.['force'],'allowInsecureLocalhost':_0x64b222?.[_0x2b30f5(0x1cf)],'scope':_0x3cc94e['gGlUq'](_0x64b222?.['scope'],_0x3cc94e[_0x2b30f5(0x1b5)])?'user':undefined},_0x2806b5);_0x2806b5?.[_0x2b30f5(0x17b)](_0x3cc94e[_0x2b30f5(0x1c8)],{'isFirstRun':_0x5433a0,'profileReady':_0x429803[_0x2b30f5(0x1c0)],'userSkipped':_0x429803[_0x2b30f5(0x1c9)]}),_0x429803['ready']&&console[_0x2b30f5(0x1f5)](_0x2b30f5(0x17f));}}if(_0x5e6109)console[_0x2b30f5(0x1f5)]('\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)'),console[_0x2b30f5(0x1f5)]('and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review'),console['log'](_0x3cc94e[_0x2b30f5(0x1a4)]),console[_0x2b30f5(0x1f5)](_0x3cc94e[_0x2b30f5(0x1eb)]);else{const _0x5a0e8c=_0x3cc94e[_0x2b30f5(0x187)](bold,_0x3cc94e[_0x2b30f5(0x19a)]);console['log'](_0x2b30f5(0x19b)+_0x5a0e8c+_0x2b30f5(0x1b4)+_0x2b30f5(0x1d7)+'\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'+'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.');}}