@ranger-testing/ranger-cli 3.1.3 → 3.1.4-alpha.96fdd81-47

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 (86) hide show
  1. package/build/cli.js +1 -1
  2. package/build/commands/addEnv.js +1 -1
  3. package/build/commands/authEncrypt.js +1 -1
  4. package/build/commands/clean.js +1 -1
  5. package/build/commands/config.js +1 -1
  6. package/build/commands/deleteProfile.js +1 -1
  7. package/build/commands/env.js +1 -1
  8. package/build/commands/feature.js +1 -1
  9. package/build/commands/hook.js +1 -1
  10. package/build/commands/hooks/autoPrompt.js +1 -1
  11. package/build/commands/hooks/disable.js +1 -1
  12. package/build/commands/hooks/enable.js +1 -1
  13. package/build/commands/hooks/exitPlanMode.js +1 -1
  14. package/build/commands/hooks/index.js +1 -1
  15. package/build/commands/hooks/output.js +1 -1
  16. package/build/commands/hooks/planReminder.js +1 -1
  17. package/build/commands/hooks/planStart.js +1 -1
  18. package/build/commands/hooks/postEdit.js +1 -1
  19. package/build/commands/hooks/preCompact.js +1 -1
  20. package/build/commands/hooks/sessionEnd.js +1 -1
  21. package/build/commands/hooks/sessionStart.js +1 -1
  22. package/build/commands/hooks/stopHook.js +1 -1
  23. package/build/commands/index.js +1 -1
  24. package/build/commands/login.js +1 -1
  25. package/build/commands/mcpBootstrap.js +1 -1
  26. package/build/commands/migrateProfile.js +1 -1
  27. package/build/commands/setup/claude.js +1 -1
  28. package/build/commands/setup/opencode.js +1 -1
  29. package/build/commands/setupCi.js +1 -1
  30. package/build/commands/skillup.js +1 -1
  31. package/build/commands/start.js +1 -1
  32. package/build/commands/status.js +1 -1
  33. package/build/commands/update.js +1 -1
  34. package/build/commands/updateEnv.js +1 -1
  35. package/build/commands/useEnv.js +1 -1
  36. package/build/commands/utils/activeProfile.js +1 -1
  37. package/build/commands/utils/agentEnv.js +1 -1
  38. package/build/commands/utils/browserSessionsApi.js +1 -1
  39. package/build/commands/utils/claudeConfig.js +1 -1
  40. package/build/commands/utils/claudeOverrideSettings.js +1 -1
  41. package/build/commands/utils/claudePlugin.js +1 -1
  42. package/build/commands/utils/cloudProfile.js +1 -1
  43. package/build/commands/utils/cloudProfileSession.js +1 -1
  44. package/build/commands/utils/crypto.js +1 -1
  45. package/build/commands/utils/desirePathLog.js +1 -1
  46. package/build/commands/utils/deviceAuth.js +1 -1
  47. package/build/commands/utils/environment.js +1 -1
  48. package/build/commands/utils/featureApi.js +1 -1
  49. package/build/commands/utils/fixWebmDuration.js +1 -1
  50. package/build/commands/utils/gitTracked.js +1 -1
  51. package/build/commands/utils/keychain.js +1 -1
  52. package/build/commands/utils/legacyWarning.js +1 -1
  53. package/build/commands/utils/localAgentInstallationsApi.js +1 -1
  54. package/build/commands/utils/matchAuthEnvironment.js +1 -1
  55. package/build/commands/utils/mcpImageBase64.js +1 -1
  56. package/build/commands/utils/model.js +1 -1
  57. package/build/commands/utils/novaActCli.js +1 -1
  58. package/build/commands/utils/opencodeConfig.js +1 -1
  59. package/build/commands/utils/organizationEnvApi.js +1 -1
  60. package/build/commands/utils/playwrightCli.js +1 -1
  61. package/build/commands/utils/profileMessages.js +1 -1
  62. package/build/commands/utils/profileSetupBanner.js +1 -1
  63. package/build/commands/utils/projectsConfig.js +1 -1
  64. package/build/commands/utils/rangerConfig.js +1 -1
  65. package/build/commands/utils/rangerRoot.js +1 -1
  66. package/build/commands/utils/rangerwrightCli.js +1 -1
  67. package/build/commands/utils/resolveProfileContext.js +1 -1
  68. package/build/commands/utils/resolveProfileUrl.js +1 -1
  69. package/build/commands/utils/retry.js +1 -1
  70. package/build/commands/utils/scenarioOriginCheck.js +1 -0
  71. package/build/commands/utils/sessionCache.js +1 -1
  72. package/build/commands/utils/settings.js +1 -1
  73. package/build/commands/utils/skillContent.js +1 -1
  74. package/build/commands/utils/skills.js +1 -1
  75. package/build/commands/utils/stitchWebmFiles.js +1 -1
  76. package/build/commands/utils/telemetry.js +1 -1
  77. package/build/commands/utils/tokenRefresh.js +1 -1
  78. package/build/commands/utils/traceSnapshotMapper.js +1 -1
  79. package/build/commands/utils/tunnelClient.js +1 -1
  80. package/build/commands/utils/userApi.js +1 -1
  81. package/build/commands/utils/version.js +1 -1
  82. package/build/commands/verifyFeature.js +1 -1
  83. package/build/commands/verifyFeatureCli.js +1 -1
  84. package/build/commands/verifyFeatureNovaCli.js +1 -1
  85. package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
  86. package/package.json +2 -1
@@ -1 +1 @@
1
- (function(_0x49b562,_0xd9de7b){const _0x472fd7=_0x39dc,_0x3aca2f=_0x49b562();while(!![]){try{const _0x240ebb=-parseInt(_0x472fd7(0x156))/0x1+parseInt(_0x472fd7(0x157))/0x2+parseInt(_0x472fd7(0x151))/0x3*(parseInt(_0x472fd7(0x150))/0x4)+parseInt(_0x472fd7(0x15c))/0x5+parseInt(_0x472fd7(0x15b))/0x6*(parseInt(_0x472fd7(0x152))/0x7)+-parseInt(_0x472fd7(0x14f))/0x8+-parseInt(_0x472fd7(0x159))/0x9*(-parseInt(_0x472fd7(0x14e))/0xa);if(_0x240ebb===_0xd9de7b)break;else _0x3aca2f['push'](_0x3aca2f['shift']());}catch(_0x27a7a9){_0x3aca2f['push'](_0x3aca2f['shift']());}}}(_0x3d1b,0x7e908));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';function _0x3d1b(){const _0x3afc28=['2586Okrqqm','1330380fqNfsf','Cimfk','\x0a✅\x20API\x20key\x20stored\x20successfully','log','5245910iBJckC','6857952VgoSCG','252644yuChSb','3tUgcpv','5663JZEjgD','user','UyrJr','organizationName','292144mjJWxo','930578PHwuhS','message','9UGHOiT','\x0a✅\x20Logged\x20in\x20to\x20'];_0x3d1b=function(){return _0x3afc28;};return _0x3d1b();}import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';function _0x39dc(_0x2f793b,_0x404c74){_0x2f793b=_0x2f793b-0x14d;const _0x3d1bdb=_0x3d1b();let _0x39dce0=_0x3d1bdb[_0x2f793b];return _0x39dce0;}import{isInteractive}from'./utils/cloudProfileSession.js';export async function login(){const _0x2a8918=_0x39dc,_0x5b988e={'UyrJr':'Re-authenticating\x20via\x20MCP\x20bootstrap...','OPdXF':function(_0x2b92d4){return _0x2b92d4();},'Cimfk':function(_0x4135ee,_0x5306d1){return _0x4135ee(_0x5306d1);}},_0x28e606=await getMcpAuthOrigin();if(_0x28e606){console[_0x2a8918(0x14d)](_0x5b988e[_0x2a8918(0x154)]),await mcpBootstrap();return;}if(!isInteractive())throw new Error('Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.');try{const _0x5d8909=await _0x5b988e['OPdXF'](runDeviceAuthFlow),_0x4fd469=await _0x5b988e[_0x2a8918(0x15d)](getCurrentUser,_0x5d8909);_0x4fd469['success']?console['log'](_0x2a8918(0x15a)+_0x4fd469[_0x2a8918(0x153)][_0x2a8918(0x155)]):console['log'](_0x2a8918(0x15e));}catch(_0x4bfca2){throw new Error('Login\x20failed:\x20'+(_0x4bfca2 instanceof Error?_0x4bfca2[_0x2a8918(0x158)]:_0x4bfca2));}}
1
+ (function(_0x2aab62,_0x3b3ee3){const _0xd5c760=_0x3e21,_0x1c280e=_0x2aab62();while(!![]){try{const _0x2ccb4c=parseInt(_0xd5c760(0x105))/0x1*(-parseInt(_0xd5c760(0x10a))/0x2)+parseInt(_0xd5c760(0x10b))/0x3*(-parseInt(_0xd5c760(0x10d))/0x4)+parseInt(_0xd5c760(0x106))/0x5+-parseInt(_0xd5c760(0x10e))/0x6*(parseInt(_0xd5c760(0x112))/0x7)+-parseInt(_0xd5c760(0x103))/0x8+-parseInt(_0xd5c760(0x111))/0x9*(-parseInt(_0xd5c760(0x108))/0xa)+parseInt(_0xd5c760(0xfd))/0xb*(parseInt(_0xd5c760(0x107))/0xc);if(_0x2ccb4c===_0x3b3ee3)break;else _0x1c280e['push'](_0x1c280e['shift']());}catch(_0x3c20c7){_0x1c280e['push'](_0x1c280e['shift']());}}}(_0x10b3,0xf3c3e));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';function _0x3e21(_0x42b3c1,_0x4cb90d){_0x42b3c1=_0x42b3c1-0xfd;const _0x10b30b=_0x10b3();let _0x3e219c=_0x10b30b[_0x42b3c1];return _0x3e219c;}function _0x10b3(){const _0x484400=['log','NlkBx','11335392pZXPyR','\x0a✅\x20API\x20key\x20stored\x20successfully','325aIukOg','9674335ISzqhF','1440996flgeGK','70JCUDwy','UiIKl','7610fYmNdg','7785yJMjcu','Re-authenticating\x20via\x20MCP\x20bootstrap...','1756SiJiEi','167142eoTbKK','Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','organizationName','1535643GseEYk','35YpPJdQ','165vHDItL','Login\x20failed:\x20','message','hgwlX'];_0x10b3=function(){return _0x484400;};return _0x10b3();}import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';import{isInteractive}from'./utils/cloudProfileSession.js';export async function login(){const _0x3b7c54=_0x3e21,_0x3c6c90={'dMuxS':function(_0x3c74b2){return _0x3c74b2();},'UiIKl':_0x3b7c54(0x10c),'hgwlX':function(_0x54114a){return _0x54114a();},'HASmK':function(_0x14e7f5){return _0x14e7f5();},'NlkBx':function(_0x7c2172,_0x32e611){return _0x7c2172 instanceof _0x32e611;}},_0x278ca7=await _0x3c6c90['dMuxS'](getMcpAuthOrigin);if(_0x278ca7){console[_0x3b7c54(0x101)](_0x3c6c90[_0x3b7c54(0x109)]),await _0x3c6c90[_0x3b7c54(0x100)](mcpBootstrap);return;}if(!_0x3c6c90['HASmK'](isInteractive))throw new Error(_0x3b7c54(0x10f));try{const _0x1df2cf=await runDeviceAuthFlow(),_0x574a9c=await getCurrentUser(_0x1df2cf);_0x574a9c['success']?console['log']('\x0a✅\x20Logged\x20in\x20to\x20'+_0x574a9c['user'][_0x3b7c54(0x110)]):console[_0x3b7c54(0x101)](_0x3b7c54(0x104));}catch(_0x3b80c1){throw new Error(_0x3b7c54(0xfe)+(_0x3c6c90[_0x3b7c54(0x102)](_0x3b80c1,Error)?_0x3b80c1[_0x3b7c54(0xff)]:_0x3b80c1));}}
@@ -1 +1 @@
1
- (function(_0x35f96f,_0x2005d4){const _0x25884c=_0x2bf3,_0x5bc7be=_0x35f96f();while(!![]){try{const _0x1e05ca=parseInt(_0x25884c(0x14d))/0x1+-parseInt(_0x25884c(0x162))/0x2+parseInt(_0x25884c(0x121))/0x3*(-parseInt(_0x25884c(0x14b))/0x4)+parseInt(_0x25884c(0xea))/0x5*(parseInt(_0x25884c(0x12b))/0x6)+parseInt(_0x25884c(0x119))/0x7*(-parseInt(_0x25884c(0x16d))/0x8)+parseInt(_0x25884c(0x15b))/0x9*(parseInt(_0x25884c(0x10e))/0xa)+parseInt(_0x25884c(0xef))/0xb;if(_0x1e05ca===_0x2005d4)break;else _0x5bc7be['push'](_0x5bc7be['shift']());}catch(_0x1c6035){_0x5bc7be['push'](_0x5bc7be['shift']());}}}(_0x3e4b,0x25279));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';function _0x3e4b(){const _0x204273=['utf-8','close','RrooD','rlUWi','authorization_servers','FZHAf','slice','url','jnHnv','hzvfn','split','length','qvErp','searchParams','NxrpD','1.0.0','now','TfrqZ','error','VVGFS','OAuthTimeoutError','authorization_code','14255kXfdUU','YRkgJ','bGEEg','closeAllConnections','text/html','2199076kcTMFX','string','accessToken','.ranger','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','log','refresh_token','qPDOa','headers','parse','KLTKu','OAuth\x20error:\x20','application/json,\x20text/event-stream','hAnHQ','Discovering\x20authorization\x20server...','start','UfZIB','poPRM','oXJCW','YXhPT','end','name','response_type','Authorization','isTTY','includes','content','FcTFo','Unknown\x20error','Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','93820EdVONd','code_challenge','pRCGc','tNWut','ddKYs','proxied','kdcuA','wsDRj','origin','application/json','qRNPP','958020lThevj','MCP\x20initialize\x20failed:\x20','HTTP\x20','UkUQx','write','nFFEP','BwUgs','VibxS','19392KjrxOB','clientSecret','structuredContent','code_challenge_method','token','2025-03-26','ZoDTf','EJjQf','access_token','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','54vPDIsr','Initializing\x20MCP\x20session...','sha256','clientId','/callback','digest','NLCGH','POST','match','expires_in','OIpVb','expiresAt','stdout','BEAQK','refresh.txt','resource','qMCBs','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','bpJzN','MCP\x20server\x20returned\x20HTTP\x20','set','writeHead','Exchanging\x20authorization\x20code...','\x0aToken\x20written\x20to\x20','text','AyKTd','\x20done','plCOh','registration_endpoint','PiIzs','code','auth-origin.txt','20QhbFjL','bsGFh','189474wiPtIj','HLLpi','Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20','cvTZS','stringify','json','tUUGO','Requesting\x20CLI\x20token...','pathname','Grwwj','hlqDQ','status','OXWCe','trim','171JLIMUz','error_description','get','platform','oNIva','toString','base64url','270164uuYWgw','SmZRo','state','message','CIGOI','TpuBj','2.0','result','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','win32','content-type','16SbCeyp','yFSEb','text/event-stream','pSKqQ'];_0x3e4b=function(){return _0x204273;};return _0x3e4b();}const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger','mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),'.ranger','auth-origin.txt');export async function getMcpAuthOrigin(){const _0xf6023f=_0x2bf3;try{const _0x40e4d3=(await readFile(AUTH_ORIGIN_PATH,_0xf6023f(0x171)))[_0xf6023f(0x15a)]();return _0x40e4d3||null;}catch{return null;}}export async function mcpBootstrap(){const _0x4a54c3=_0x2bf3,_0x3beb3b={'hlqDQ':function(_0x3229ae,_0x3aab3b){return _0x3229ae(_0x3aab3b);},'LkciE':function(_0x3923f2,_0x405883){return _0x3923f2===_0x405883;}},_0x1cd609=getMcpAuthUrl();currentOrigin=_0x1cd609;const _0x47416c=process[_0x4a54c3(0x137)][_0x4a54c3(0x108)]??![];console[_0x4a54c3(0xf5)]('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x1cd609+'\x0a');const _0x4e98e1=await _0x3beb3b[_0x4a54c3(0x157)](tryUnauthenticated,_0x1cd609);let _0x307ff8=null;if(_0x3beb3b['LkciE'](_0x4e98e1,_0x4a54c3(0x113)))_0x307ff8='';else{_0x307ff8=await loadCachedToken();if(!_0x307ff8){if(!_0x47416c)throw new Error('MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a'+_0x4a54c3(0x16a));_0x307ff8=await oauthFlow(_0x1cd609);}}await callGetCliToken(_0x1cd609,_0x307ff8);}function _0x2bf3(_0x18396f,_0x29807d){_0x18396f=_0x18396f-0xdb;const _0x3e4b44=_0x3e4b();let _0x2bf315=_0x3e4b44[_0x18396f];return _0x2bf315;}async function tryUnauthenticated(_0x2afe6e){const _0x582b3b=_0x2bf3,_0x290b09={'UMpDX':function(_0x519dec,_0x2a3652,_0x2aa303){return _0x519dec(_0x2a3652,_0x2aa303);},'qvErp':_0x582b3b(0x132),'ZoDTf':'2.0','BEAQK':'initialize','kdcuA':'2025-03-26','qMCBs':_0x582b3b(0x113),'nkFJd':function(_0x1f294a,_0x35a0cf){return _0x1f294a===_0x35a0cf;},'GpkVC':'needs-oauth'},_0x52721b=await _0x290b09['UMpDX'](fetch,_0x2afe6e,{'method':_0x290b09[_0x582b3b(0xe0)],'headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream'},'body':JSON['stringify']({'jsonrpc':_0x290b09[_0x582b3b(0x127)],'id':0x1,'method':_0x290b09[_0x582b3b(0x138)],'params':{'protocolVersion':_0x290b09[_0x582b3b(0x114)],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x582b3b(0xe3)}}})});if(_0x52721b['ok'])return await _0x52721b[_0x582b3b(0x143)](),_0x290b09[_0x582b3b(0x13b)];if(_0x290b09['nkFJd'](_0x52721b['status'],0x191))return await _0x52721b[_0x582b3b(0x143)](),_0x290b09['GpkVC'];const _0x6bae40=await _0x52721b[_0x582b3b(0x143)]();throw new Error(_0x582b3b(0x13e)+_0x52721b['status']+':\x20'+_0x6bae40);}class OAuthTimeoutError extends Error{constructor(_0x5e4541){const _0x17dc23=_0x2bf3,_0x54da64={'NxrpD':_0x17dc23(0xe8)};super(_0x5e4541),this[_0x17dc23(0x105)]=_0x54da64[_0x17dc23(0xe2)];}}async function oauthFlow(_0x33c053){const _0x1367c2=_0x2bf3,_0x317bf9={'plCOh':function(_0x5bc9c2,_0x44316a){return _0x5bc9c2(_0x44316a);}};try{return await oauthFlowAttempt(_0x33c053);}catch(_0x4a1ab7){if(_0x4a1ab7 instanceof OAuthTimeoutError&&await loadCachedClient())return console['log']('\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'),await clearCachedClient(),await _0x317bf9[_0x1367c2(0x146)](oauthFlowAttempt,_0x33c053);throw _0x4a1ab7;}}async function oauthFlowAttempt(_0x44321f){const _0x176e08=_0x2bf3,_0x5beafb={'nFFEP':_0x176e08(0xfe),'InwKB':function(_0x549c1b,_0x5be84d){return _0x549c1b(_0x5be84d);},'CIGOI':_0x176e08(0x10d),'edGMW':'No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','eyNEv':function(_0x2de7ec,_0x573e3d,_0x4a38bf){return _0x2de7ec(_0x573e3d,_0x4a38bf);},'dMqlm':'Ranger\x20CLI','YRkgJ':'refresh_token','PiIzs':_0x176e08(0x145),'Grwwj':'Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','IdQFW':_0x176e08(0x12d),'zeeSf':'base64url','jbBAy':'code','qPDOa':'redirect_uri','WzDYS':_0x176e08(0x124),'AyKTd':'state','QGkQE':'resource','gmnez':'\x0aOpening\x20browser\x20for\x20authentication...','xmjnE':_0x176e08(0x141),'FZHAf':_0x176e08(0xe9),'SmZRo':function(_0x392457,_0x2af9f4,_0xdef5aa){return _0x392457(_0x2af9f4,_0xdef5aa);}},_0x143141=_0x44321f['replace'](/\/mcp$/,'');process[_0x176e08(0x137)]['write'](_0x5beafb[_0x176e08(0x11e)]);const _0x118b13=await _0x5beafb['InwKB'](fetch,_0x143141+'/.well-known/oauth-protected-resource');if(!_0x118b13['ok'])throw new Error(_0x5beafb[_0x176e08(0x166)]);const _0xaad6a9=await _0x118b13['json'](),_0x34ba59=_0xaad6a9[_0x176e08(0x175)]?.[0x0];if(!_0x34ba59)throw new Error(_0x5beafb['edGMW']);console[_0x176e08(0xf5)]('\x20'+_0x34ba59);const _0x6653d4=await _0x5beafb['InwKB'](fetchAuthServerMetadata,_0x34ba59);let _0x4f5e65,_0x21a507;const _0x9d47f6=await loadCachedClient();if(_0x9d47f6)_0x4f5e65=_0x9d47f6['clientId'],_0x21a507=_0x9d47f6[_0x176e08(0x122)];else{if(_0x6653d4[_0x176e08(0x147)]){process[_0x176e08(0x137)]['write']('Registering\x20OAuth\x20client...');const _0x5a41d5=await _0x5beafb['eyNEv'](fetch,_0x6653d4['registration_endpoint'],{'method':_0x176e08(0x132),'headers':{'Content-Type':_0x176e08(0x117)},'body':JSON[_0x176e08(0x151)]({'client_name':_0x5beafb['dMqlm'],'redirect_uris':['http://localhost:'+CALLBACK_PORT+'/callback'],'grant_types':['authorization_code',_0x5beafb[_0x176e08(0xeb)]],'response_types':['code'],'token_endpoint_auth_method':'none'})});if(!_0x5a41d5['ok']){const _0x3e1241=await _0x5a41d5['text']();throw new Error('Client\x20registration\x20failed:\x20'+_0x3e1241);}const _0x3b3501=await _0x5a41d5[_0x176e08(0x152)]();_0x4f5e65=_0x3b3501['client_id'],_0x21a507=_0x3b3501['client_secret'],await saveCachedClient(_0x4f5e65,_0x21a507),console[_0x176e08(0xf5)](_0x5beafb[_0x176e08(0x148)]);}else throw new Error(_0x5beafb[_0x176e08(0x156)]);}const _0x4b7ec3=randomBytes(0x20)[_0x176e08(0x160)](_0x176e08(0x161)),_0x4b7cd8=createHash(_0x5beafb['IdQFW'])['update'](_0x4b7ec3)[_0x176e08(0x130)](_0x5beafb['zeeSf']),_0x28b3ee=randomBytes(0x10)[_0x176e08(0x160)]('hex'),_0x534a25=new URL(_0x6653d4['authorization_endpoint']);_0x534a25[_0x176e08(0xe1)][_0x176e08(0x13f)](_0x176e08(0x106),_0x5beafb['jbBAy']),_0x534a25[_0x176e08(0xe1)][_0x176e08(0x13f)]('client_id',_0x4f5e65),_0x534a25['searchParams'][_0x176e08(0x13f)](_0x5beafb[_0x176e08(0xf7)],'http://localhost:'+CALLBACK_PORT+_0x176e08(0x12f)),_0x534a25['searchParams']['set'](_0x176e08(0x10f),_0x4b7cd8),_0x534a25['searchParams']['set'](_0x5beafb['WzDYS'],'S256'),_0x534a25['searchParams']['set'](_0x5beafb[_0x176e08(0x144)],_0x28b3ee);_0xaad6a9[_0x176e08(0x13a)]&&_0x534a25[_0x176e08(0xe1)][_0x176e08(0x13f)](_0x5beafb['QGkQE'],_0xaad6a9[_0x176e08(0x13a)]);console[_0x176e08(0xf5)](_0x5beafb['gmnez']),console['log'](_0x176e08(0xf3)+_0x534a25[_0x176e08(0x160)]()+'\x0a'),await openBrowser(_0x534a25[_0x176e08(0x160)]());const _0x4d2ca4=await waitForCallback(_0x28b3ee);process[_0x176e08(0x137)]['write'](_0x5beafb['xmjnE']);const _0x40dd1=new URLSearchParams({'grant_type':_0x5beafb[_0x176e08(0x176)],'code':_0x4d2ca4,'redirect_uri':'http://localhost:'+CALLBACK_PORT+_0x176e08(0x12f),'client_id':_0x4f5e65,'code_verifier':_0x4b7ec3});_0x21a507&&_0x40dd1[_0x176e08(0x13f)]('client_secret',_0x21a507);_0xaad6a9[_0x176e08(0x13a)]&&_0x40dd1['set'](_0x5beafb['QGkQE'],_0xaad6a9['resource']);const _0x372612=await _0x5beafb[_0x176e08(0x163)](fetch,_0x6653d4['token_endpoint'],{'method':'POST','headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x40dd1});if(!_0x372612['ok']){const _0x124b1b=await _0x372612[_0x176e08(0x143)]();throw new Error('Token\x20exchange\x20failed:\x20'+_0x124b1b);}const _0x359f46=await _0x372612[_0x176e08(0x152)]();return console[_0x176e08(0xf5)](_0x5beafb['PiIzs']),await saveCachedToken(_0x359f46[_0x176e08(0x129)],_0x359f46[_0x176e08(0xf6)],_0x359f46[_0x176e08(0x134)]),_0x359f46['access_token'];}async function callGetCliToken(_0x1f7ac5,_0x11e0ed){const _0xae12dc=_0x2bf3,_0x507d68={'EJjQf':function(_0x31f185,_0x39b811,_0x4426a7){return _0x31f185(_0x39b811,_0x4426a7);},'NLCGH':_0xae12dc(0x117),'pSKqQ':_0xae12dc(0xfc),'YXhPT':_0xae12dc(0x107),'qRNPP':function(_0x473ab9,_0x233fe6){return _0x473ab9(_0x233fe6);},'OIpVb':_0xae12dc(0x168),'KLTKu':'ranger-cli','BwUgs':function(_0x1ead33,_0x124ef6,_0x5416be){return _0x1ead33(_0x124ef6,_0x5416be);},'ddKYs':'notifications/initialized','HLLpi':_0xae12dc(0x154),'yFSEb':function(_0xe3170b,_0x228130){return _0xe3170b(_0x228130);},'ADyUo':'tools/call','rlUWi':'get_cli_token','VibxS':function(_0x3e76e8,_0x456967){return _0x3e76e8(_0x456967);},'FcTFo':'\x0aUnexpected\x20response\x20structure:','pfMjy':'Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','KcBHO':_0xae12dc(0x139)},_0x1bdd62={'Content-Type':_0x507d68[_0xae12dc(0x131)],'Accept':_0x507d68[_0xae12dc(0x170)]};_0x11e0ed&&(_0x1bdd62[_0x507d68[_0xae12dc(0x103)]]='Bearer\x20'+_0x11e0ed);const _0x59165b=async _0x4146d7=>{const _0x7d7545=_0xae12dc,_0x5214a7=await _0x507d68[_0x7d7545(0x128)](fetch,_0x1f7ac5,{'method':_0x7d7545(0x132),'headers':_0x1bdd62,'body':JSON['stringify'](_0x4146d7)});if(!_0x5214a7['ok']){const _0x3f3464=await _0x5214a7[_0x7d7545(0x143)]();throw new Error(_0x7d7545(0x11b)+_0x5214a7['status']+':\x20'+_0x3f3464);}return parseResponse(_0x5214a7);};process[_0xae12dc(0x137)]['write'](_0xae12dc(0x12c));const _0x483c3d=await _0x507d68[_0xae12dc(0x118)](_0x59165b,{'jsonrpc':_0x507d68[_0xae12dc(0x135)],'id':0x1,'method':'initialize','params':{'protocolVersion':_0xae12dc(0x126),'capabilities':{},'clientInfo':{'name':_0x507d68[_0xae12dc(0xfa)],'version':'1.0.0'}}});if(_0x483c3d[_0xae12dc(0xe6)])throw new Error(_0xae12dc(0x11a)+(_0x483c3d[_0xae12dc(0xe6)][_0xae12dc(0x165)]??JSON['stringify'](_0x483c3d['error'])));console[_0xae12dc(0xf5)]('\x20done'),await _0x507d68[_0xae12dc(0x11f)](fetch,_0x1f7ac5,{'method':'POST','headers':_0x1bdd62,'body':JSON[_0xae12dc(0x151)]({'jsonrpc':_0x507d68[_0xae12dc(0x135)],'method':_0x507d68[_0xae12dc(0x112)]})})['then'](_0x16c2b4=>_0x16c2b4[_0xae12dc(0x143)]()),process[_0xae12dc(0x137)][_0xae12dc(0x11d)](_0x507d68[_0xae12dc(0x14e)]);const _0x45bc8b=await _0x507d68[_0xae12dc(0x16e)](_0x59165b,{'jsonrpc':_0x507d68['OIpVb'],'id':0x2,'method':_0x507d68['ADyUo'],'params':{'name':_0x507d68[_0xae12dc(0x174)],'arguments':{}}});if(_0x45bc8b['error'])throw new Error('get_cli_token\x20failed:\x20'+(_0x45bc8b['error']['message']??JSON['stringify'](_0x45bc8b['error'])));console['log'](_0xae12dc(0x145));const _0x436d9d=_0x507d68[_0xae12dc(0x120)](extractToken,_0x45bc8b[_0xae12dc(0x169)]);if(!_0x436d9d){console['error'](_0x507d68[_0xae12dc(0x10b)]),console[_0xae12dc(0xe6)](JSON[_0xae12dc(0x151)](_0x45bc8b['result'],null,0x2));throw new Error(_0x507d68['pfMjy']);}const _0x145ed9=_0x507d68['BwUgs'](join,homedir(),'.ranger'),_0x1a3612=join(_0x145ed9,_0x507d68['KcBHO']);await mkdir(_0x145ed9,{'recursive':!![]}),await writeFile(_0x1a3612,_0x436d9d,{'mode':0x180}),await writeFile(join(_0x145ed9,_0xae12dc(0x14a)),_0x1f7ac5,{'mode':0x180}),console['log'](_0xae12dc(0x142)+_0x1a3612),console['log'](_0xae12dc(0x13c));}async function fetchAuthServerMetadata(_0x5a5b7f){const _0x27e2c7=_0x2bf3,_0xb35eaa={'UCgka':function(_0x3e2f46,_0xc3fac0){return _0x3e2f46(_0xc3fac0);}},_0x31e787=_0x5a5b7f+'/.well-known/oauth-authorization-server',_0x33a7a=await _0xb35eaa['UCgka'](fetch,_0x31e787);if(!_0x33a7a['ok'])throw new Error(_0x27e2c7(0x14f)+_0x31e787+':\x20'+_0x33a7a[_0x27e2c7(0x158)]);return _0x33a7a[_0x27e2c7(0x152)]();}function waitForCallback(_0x4d7b1b){const _0x45d732=_0x2bf3,_0x11b85e={'RuqOR':'OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','tNWut':_0x45d732(0x149),'hzvfn':_0x45d732(0xe6),'xHjtI':_0x45d732(0x15c),'oNIva':'<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','xwsmZ':function(_0x137535,_0xa4be2b,_0x21d4ef){return _0x137535(_0xa4be2b,_0x21d4ef);},'GUqzT':'127.0.0.1'};return new Promise((_0x43a443,_0x2f8b44)=>{const _0x2d87be=_0x45d732,_0x376918={'uOOCv':function(_0x4a22bb,_0x5a4783){return _0x4a22bb(_0x5a4783);},'UkUQx':_0x11b85e['RuqOR'],'bsGFh':function(_0x19b9a0,_0x2730ba){return _0x19b9a0!==_0x2730ba;},'ZvSUe':_0x11b85e[_0x2d87be(0x111)],'jnHnv':_0x11b85e[_0x2d87be(0xdd)],'zkGQH':_0x11b85e['xHjtI'],'vlEGZ':_0x2d87be(0xee),'TfrqZ':function(_0x57bd74,_0x17fac7){return _0x57bd74(_0x17fac7);},'hkSpP':_0x11b85e[_0x2d87be(0x15f)]},_0x19f56e=()=>{const _0x59f692=_0x2d87be;_0x478a2b[_0x59f692(0xed)](),_0x478a2b[_0x59f692(0x172)]();},_0x52c587=_0x11b85e['xwsmZ'](setTimeout,()=>{const _0x13d4bd=_0x2d87be;_0x19f56e(),_0x376918['uOOCv'](_0x2f8b44,new OAuthTimeoutError(_0x376918[_0x13d4bd(0x11c)]));},0x1d4c0),_0x478a2b=createServer((_0x1a22af,_0x3d2250)=>{const _0x1824ed=_0x2d87be,_0x49022a=new URL(_0x1a22af[_0x1824ed(0xdb)]??'/','http://localhost:'+CALLBACK_PORT);if(_0x376918['bsGFh'](_0x49022a[_0x1824ed(0x155)],_0x1824ed(0x12f))){_0x3d2250[_0x1824ed(0x140)](0x194),_0x3d2250[_0x1824ed(0x104)]('Not\x20found');return;}const _0x512726=_0x49022a['searchParams'][_0x1824ed(0x15d)](_0x376918['ZvSUe']),_0x419e14=_0x49022a['searchParams'][_0x1824ed(0x15d)](_0x1824ed(0x164)),_0x24ecef=_0x49022a[_0x1824ed(0xe1)][_0x1824ed(0x15d)](_0x376918[_0x1824ed(0xdc)]);if(_0x24ecef){const _0x419373=_0x49022a[_0x1824ed(0xe1)][_0x1824ed(0x15d)](_0x376918['zkGQH'])??_0x24ecef;_0x3d2250[_0x1824ed(0x140)](0xc8,{'Content-Type':_0x376918['vlEGZ']}),_0x3d2250[_0x1824ed(0x104)]('<html><body><h2>Authentication\x20failed</h2><p>'+_0x419373+_0x1824ed(0xf4)),clearTimeout(_0x52c587),_0x19f56e(),_0x376918[_0x1824ed(0xe5)](_0x2f8b44,new Error(_0x1824ed(0xfb)+_0x419373));return;}if(!_0x512726||_0x376918[_0x1824ed(0x14c)](_0x419e14,_0x4d7b1b)){_0x3d2250[_0x1824ed(0x140)](0x190,{'Content-Type':_0x1824ed(0xee)}),_0x3d2250[_0x1824ed(0x104)](_0x376918['hkSpP']);return;}_0x3d2250['writeHead'](0xc8,{'Content-Type':_0x1824ed(0xee)}),_0x3d2250[_0x1824ed(0x104)](_0x1824ed(0x12a)),clearTimeout(_0x52c587),_0x19f56e(),_0x43a443(_0x512726);});_0x478a2b['listen'](CALLBACK_PORT,_0x11b85e['GUqzT']);});}async function openBrowser(_0x2adffc){const _0x429aa5=_0x2bf3,_0x223cf4={'wsDRj':'darwin','OXWCe':'open','dnHLM':_0x429aa5(0x16b)},_0x4ed090=process[_0x429aa5(0x15e)]===_0x223cf4[_0x429aa5(0x115)]?_0x223cf4[_0x429aa5(0x159)]:process['platform']===_0x223cf4['dnHLM']?_0x429aa5(0xff):'xdg-open';exec(_0x4ed090+'\x20\x22'+_0x2adffc+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x3798bd=_0x2bf3,_0x3eec8e={'tUUGO':function(_0x10235c,_0x3ed142,_0xd0b43f){return _0x10235c(_0x3ed142,_0xd0b43f);},'WGGBD':function(_0x59a7cf,_0x359c47){return _0x59a7cf!==_0x359c47;},'UfZIB':function(_0xfa0de8,_0x1d32b8){return _0xfa0de8>_0x1d32b8;}};try{const _0x37fee9=JSON['parse'](await _0x3eec8e[_0x3798bd(0x153)](readFile,TOKEN_CACHE_PATH,'utf-8'));if(_0x37fee9[_0x3798bd(0x116)]&&_0x3eec8e['WGGBD'](_0x37fee9['origin'],currentOrigin))return null;if(_0x37fee9[_0x3798bd(0x136)]&&_0x3eec8e[_0x3798bd(0x100)](Date['now'](),_0x37fee9['expiresAt']))return null;return _0x37fee9[_0x3798bd(0xf1)]??null;}catch{return null;}}async function saveCachedToken(_0x4a4ca3,_0x3aa207,_0x415dbf){const _0x4b4be4=_0x2bf3,_0xff947b={'WLeMt':function(_0x26e43a,_0xa120c){return _0x26e43a*_0xa120c;},'cvTZS':function(_0x5d4651,_0x3212c5,_0x1b9c41){return _0x5d4651(_0x3212c5,_0x1b9c41);},'TpuBj':function(_0xe24e02,_0x3a0554,_0x74ea12){return _0xe24e02(_0x3a0554,_0x74ea12);},'bpJzN':function(_0x526a2d){return _0x526a2d();},'RQRYK':function(_0x20f0b6,_0x5c4fbe,_0x2ff388,_0x4224cc){return _0x20f0b6(_0x5c4fbe,_0x2ff388,_0x4224cc);}},_0x3c0269=await loadCachedData(),_0x442b04={..._0x3c0269,'origin':currentOrigin,'accessToken':_0x4a4ca3,'refreshToken':_0x3aa207??_0x3c0269?.['refreshToken'],'expiresAt':_0x415dbf?Date[_0x4b4be4(0xe4)]()+_0xff947b['WLeMt'](_0x415dbf,0x3e8):undefined};await _0xff947b[_0x4b4be4(0x150)](mkdir,_0xff947b[_0x4b4be4(0x167)](join,_0xff947b[_0x4b4be4(0x13d)](homedir),'.ranger'),{'recursive':!![]}),await _0xff947b['RQRYK'](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x442b04),{'mode':0x180});}async function loadCachedClient(){const _0x3e00e4=_0x2bf3,_0x1ad431={'OvwOt':function(_0x357212){return _0x357212();},'poPRM':function(_0x4474db,_0x4a1073){return _0x4474db!==_0x4a1073;}},_0x236c2d=await _0x1ad431['OvwOt'](loadCachedData);if(_0x236c2d?.[_0x3e00e4(0x116)]&&_0x1ad431[_0x3e00e4(0x101)](_0x236c2d['origin'],currentOrigin))return null;return _0x236c2d?.[_0x3e00e4(0x12e)]?{'clientId':_0x236c2d['clientId'],'clientSecret':_0x236c2d[_0x3e00e4(0x122)]}:null;}async function clearCachedClient(){const _0x34113d=_0x2bf3,_0x4b8880={'RSDKk':function(_0x1862ce){return _0x1862ce();},'RYTzu':function(_0x4c15f3,_0xa542ff,_0x339c3e,_0x5eefc3){return _0x4c15f3(_0xa542ff,_0x339c3e,_0x5eefc3);}},_0x2b3f6d=await _0x4b8880['RSDKk'](loadCachedData);if(!_0x2b3f6d)return;const {clientId:_0x33863c,clientSecret:_0x2e3502,..._0x342053}=_0x2b3f6d;await _0x4b8880['RYTzu'](writeFile,TOKEN_CACHE_PATH,JSON[_0x34113d(0x151)](_0x342053),{'mode':0x180});}async function saveCachedClient(_0x583a1c,_0x21096f){const _0x4fe958=_0x2bf3,_0x50e5de={'hAnHQ':function(_0x3b98ae){return _0x3b98ae();},'RrooD':function(_0x896c97){return _0x896c97();}},_0x398d70=await _0x50e5de[_0x4fe958(0xfd)](loadCachedData),_0x4cee1a={..._0x398d70,'origin':currentOrigin,'accessToken':_0x398d70?.['accessToken']??'','clientId':_0x583a1c,'clientSecret':_0x21096f};await mkdir(join(_0x50e5de[_0x4fe958(0x173)](homedir),_0x4fe958(0xf2)),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x4cee1a),{'mode':0x180});}async function loadCachedData(){const _0x1c2435={'lNIoX':function(_0x3e7146,_0x3a83cf,_0x4e82c3){return _0x3e7146(_0x3a83cf,_0x4e82c3);},'zFnGw':'utf-8'};try{return JSON['parse'](await _0x1c2435['lNIoX'](readFile,TOKEN_CACHE_PATH,_0x1c2435['zFnGw']));}catch{return null;}}async function parseResponse(_0x373a48){const _0x2f3ee6=_0x2bf3,_0x1781a5={'VVGFS':_0x2f3ee6(0x16f),'pRCGc':'data:'},_0x54d80a=_0x373a48[_0x2f3ee6(0xf8)][_0x2f3ee6(0x15d)](_0x2f3ee6(0x16c))??'';if(_0x54d80a[_0x2f3ee6(0x109)](_0x1781a5[_0x2f3ee6(0xe7)])){const _0x122a90=await _0x373a48[_0x2f3ee6(0x143)]();for(const _0x342254 of _0x122a90[_0x2f3ee6(0xde)]('\x0a')){const _0xa92a0a=_0x342254[_0x2f3ee6(0x15a)]();if(_0xa92a0a['startsWith']('data:')){const _0x5d49a4=_0xa92a0a[_0x2f3ee6(0x177)](_0x1781a5[_0x2f3ee6(0x110)][_0x2f3ee6(0xdf)])['trim']();if(!_0x5d49a4)continue;try{const _0x5d5ccc=JSON[_0x2f3ee6(0xf9)](_0x5d49a4);if(_0x5d5ccc['id']!==undefined||_0x5d5ccc['error'])return _0x5d5ccc;}catch{}}}throw new Error('No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream');}return _0x373a48['json']();}function extractToken(_0x506863){const _0x295515=_0x2bf3,_0x2022be={'oXJCW':function(_0x8062f3,_0xa34404){return _0x8062f3===_0xa34404;},'bGEEg':function(_0x33a897,_0x18a18c){return _0x33a897===_0x18a18c;},'SxURg':'string'};if(!_0x506863)return null;const _0x216bca=_0x506863[_0x295515(0x123)];if(_0x216bca?.[_0x295515(0x125)]&&_0x2022be[_0x295515(0x102)](typeof _0x216bca[_0x295515(0x125)],_0x295515(0xf0)))return _0x216bca[_0x295515(0x125)];if(_0x506863['isError']){const _0x28130c=_0x506863['content'];throw new Error('Server\x20returned\x20error:\x20'+(_0x28130c?.[0x0]?.[_0x295515(0x143)]??_0x295515(0x10c)));}const _0x39f8ea=_0x506863[_0x295515(0x10a)];if(_0x39f8ea)for(const _0x1f1b26 of _0x39f8ea){if(_0x2022be['oXJCW'](_0x1f1b26['type'],_0x295515(0x143))&&_0x1f1b26['text']){try{const _0x32c1c7=JSON[_0x295515(0xf9)](_0x1f1b26[_0x295515(0x143)]);if(_0x2022be[_0x295515(0xec)](typeof _0x32c1c7?.[_0x295515(0x125)],_0x2022be['SxURg']))return _0x32c1c7['token'];}catch{}const _0x4cbab7=_0x1f1b26[_0x295515(0x143)][_0x295515(0x133)](/(rngr_[A-Za-z0-9_-]+)/);if(_0x4cbab7)return _0x4cbab7[0x1];}}return null;}
1
+ const _0x304232=_0x156e;(function(_0x4420f0,_0x1a9c7f){const _0x36c6a0=_0x156e,_0x279499=_0x4420f0();while(!![]){try{const _0x28e668=parseInt(_0x36c6a0(0x163))/0x1*(-parseInt(_0x36c6a0(0x1a7))/0x2)+-parseInt(_0x36c6a0(0x13d))/0x3+parseInt(_0x36c6a0(0x150))/0x4+-parseInt(_0x36c6a0(0x1a6))/0x5*(-parseInt(_0x36c6a0(0x173))/0x6)+parseInt(_0x36c6a0(0x143))/0x7+parseInt(_0x36c6a0(0x193))/0x8*(parseInt(_0x36c6a0(0x1b5))/0x9)+parseInt(_0x36c6a0(0x14c))/0xa*(-parseInt(_0x36c6a0(0x190))/0xb);if(_0x28e668===_0x1a9c7f)break;else _0x279499['push'](_0x279499['shift']());}catch(_0x5acdf5){_0x279499['push'](_0x279499['shift']());}}}(_0x81f0,0x652e9));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),_0x304232(0x1bb),'mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),_0x304232(0x1bb),_0x304232(0x133));export async function getMcpAuthOrigin(){const _0x47a144=_0x304232,_0x146b19={'nqHpG':_0x47a144(0x13e),'UGVBj':function(_0x2d48ef,_0x29942d){return _0x2d48ef||_0x29942d;}};try{const _0x366ce1=(await readFile(AUTH_ORIGIN_PATH,_0x146b19['nqHpG']))['trim']();return _0x146b19['UGVBj'](_0x366ce1,null);}catch{return null;}}export async function mcpBootstrap(){const _0xffa336=_0x304232,_0x5663c9={'rybec':function(_0x54e912,_0x2dc84d){return _0x54e912(_0x2dc84d);},'YRBGs':function(_0x1fc32c,_0x3441da,_0x2a7d52){return _0x1fc32c(_0x3441da,_0x2a7d52);}},_0x393ef0=getMcpAuthUrl();currentOrigin=_0x393ef0;const _0x4b9a15=process['stdout']['isTTY']??![];console['log']('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x393ef0+'\x0a');const _0x2064b6=await tryUnauthenticated(_0x393ef0);let _0x35e7d6=null;if(_0x2064b6===_0xffa336(0x1a3))_0x35e7d6='';else{_0x35e7d6=await loadCachedToken();if(!_0x35e7d6){if(!_0x4b9a15)throw new Error(_0xffa336(0x19d)+'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.');_0x35e7d6=await _0x5663c9['rybec'](oauthFlow,_0x393ef0);}}await _0x5663c9[_0xffa336(0x1be)](callGetCliToken,_0x393ef0,_0x35e7d6);}async function tryUnauthenticated(_0x260888){const _0x4fa732=_0x304232,_0x3e9fb6={'dOZKg':_0x4fa732(0x139),'Wgaeg':'2025-03-26','KyXYU':_0x4fa732(0x1b3)},_0x1def58=await fetch(_0x260888,{'method':_0x3e9fb6[_0x4fa732(0x14e)],'headers':{'Content-Type':'application/json','Accept':_0x4fa732(0x154)},'body':JSON[_0x4fa732(0x170)]({'jsonrpc':'2.0','id':0x1,'method':'initialize','params':{'protocolVersion':_0x3e9fb6[_0x4fa732(0x140)],'capabilities':{},'clientInfo':{'name':_0x3e9fb6[_0x4fa732(0x17a)],'version':'1.0.0'}}})});if(_0x1def58['ok'])return await _0x1def58['text'](),'proxied';if(_0x1def58['status']===0x191)return await _0x1def58['text'](),_0x4fa732(0x1bf);const _0x2ff52c=await _0x1def58['text']();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x1def58[_0x4fa732(0x1a5)]+':\x20'+_0x2ff52c);}class OAuthTimeoutError extends Error{constructor(_0x41bb59){const _0x3b09bf=_0x304232;super(_0x41bb59),this[_0x3b09bf(0x151)]=_0x3b09bf(0x178);}}async function oauthFlow(_0xca72fb){const _0x38cdb=_0x304232,_0x14ea75={'djCpB':function(_0x512d6f,_0x3e1125){return _0x512d6f(_0x3e1125);},'kbVrF':function(_0x1a8cef){return _0x1a8cef();},'WNGRF':'\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','OCDyl':function(_0x48b97c){return _0x48b97c();}};try{return await _0x14ea75[_0x38cdb(0x181)](oauthFlowAttempt,_0xca72fb);}catch(_0x1016c7){if(_0x1016c7 instanceof OAuthTimeoutError&&await _0x14ea75['kbVrF'](loadCachedClient))return console[_0x38cdb(0x16c)](_0x14ea75['WNGRF']),await _0x14ea75[_0x38cdb(0x1a2)](clearCachedClient),await _0x14ea75['djCpB'](oauthFlowAttempt,_0xca72fb);throw _0x1016c7;}}async function oauthFlowAttempt(_0x1f9ad2){const _0x16aee5=_0x304232,_0xeccc59={'vSEGB':_0x16aee5(0x186),'qgOnU':_0x16aee5(0x19a),'VaZMP':function(_0xf85c84,_0x186d43){return _0xf85c84(_0x186d43);},'aDyHU':'Registering\x20OAuth\x20client...','uLYsg':function(_0x48d4e7,_0x5cbaac,_0xb7b5fb){return _0x48d4e7(_0x5cbaac,_0xb7b5fb);},'mcbzL':'refresh_token','ZwYop':_0x16aee5(0x145),'EkCbi':_0x16aee5(0x16f),'CUOeV':'Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','AYjGo':function(_0xadee52,_0x535a50){return _0xadee52(_0x535a50);},'MMrzr':function(_0xd5a341,_0x292c8a){return _0xd5a341(_0x292c8a);},'jDoxm':'sha256','Nmeds':_0x16aee5(0x138),'NfNKl':'hex','zfYOK':_0x16aee5(0x1bc),'vVHsH':'state','NQetR':'resource','TsXZT':'\x0aOpening\x20browser\x20for\x20authentication...','tjaDy':_0x16aee5(0x1b0),'xnUwE':_0x16aee5(0x1ac),'VSgwS':'client_secret','ffIoN':'POST','LNDxD':'\x20done','kpwgW':function(_0x3dcd77,_0x33d082,_0x3b018d,_0x5d8637){return _0x3dcd77(_0x33d082,_0x3b018d,_0x5d8637);}},_0x46bd34=_0x1f9ad2[_0x16aee5(0x188)](/\/mcp$/,'');process['stdout'][_0x16aee5(0x19f)](_0xeccc59[_0x16aee5(0x15d)]);const _0x281dce=await fetch(_0x46bd34+'/.well-known/oauth-protected-resource');if(!_0x281dce['ok'])throw new Error(_0x16aee5(0x172));const _0x31a9a7=await _0x281dce[_0x16aee5(0x189)](),_0x4d4dcf=_0x31a9a7[_0x16aee5(0x14d)]?.[0x0];if(!_0x4d4dcf)throw new Error(_0xeccc59['qgOnU']);console['log']('\x20'+_0x4d4dcf);const _0x3032ec=await _0xeccc59[_0x16aee5(0x179)](fetchAuthServerMetadata,_0x4d4dcf);let _0x351657,_0x4d702a;const _0x2607c4=await loadCachedClient();if(_0x2607c4)_0x351657=_0x2607c4[_0x16aee5(0x15f)],_0x4d702a=_0x2607c4[_0x16aee5(0x17c)];else{if(_0x3032ec['registration_endpoint']){process[_0x16aee5(0x18d)][_0x16aee5(0x19f)](_0xeccc59[_0x16aee5(0x153)]);const _0x549ac0=await _0xeccc59[_0x16aee5(0x191)](fetch,_0x3032ec['registration_endpoint'],{'method':_0x16aee5(0x139),'headers':{'Content-Type':_0x16aee5(0x18f)},'body':JSON['stringify']({'client_name':_0x16aee5(0x195),'redirect_uris':['http://localhost:'+CALLBACK_PORT+'/callback'],'grant_types':[_0x16aee5(0x1ac),_0xeccc59[_0x16aee5(0x155)]],'response_types':[_0xeccc59['ZwYop']],'token_endpoint_auth_method':_0xeccc59[_0x16aee5(0x1ad)]})});if(!_0x549ac0['ok']){const _0x5ea10c=await _0x549ac0[_0x16aee5(0x1c3)]();throw new Error(_0x16aee5(0x19e)+_0x5ea10c);}const _0x4b7845=await _0x549ac0['json']();_0x351657=_0x4b7845[_0x16aee5(0x182)],_0x4d702a=_0x4b7845[_0x16aee5(0x149)],await saveCachedClient(_0x351657,_0x4d702a),console['log'](_0x16aee5(0x144));}else throw new Error(_0xeccc59[_0x16aee5(0x130)]);}const _0x32d6be=_0xeccc59['AYjGo'](randomBytes,0x20)[_0x16aee5(0x17f)](_0x16aee5(0x138)),_0xd314=_0xeccc59[_0x16aee5(0x18a)](createHash,_0xeccc59[_0x16aee5(0x1c2)])[_0x16aee5(0x16d)](_0x32d6be)[_0x16aee5(0x15e)](_0xeccc59['Nmeds']),_0x1936da=_0xeccc59[_0x16aee5(0x18a)](randomBytes,0x10)['toString'](_0xeccc59['NfNKl']),_0x2c2141=new URL(_0x3032ec['authorization_endpoint']);_0x2c2141[_0x16aee5(0x164)][_0x16aee5(0x185)](_0x16aee5(0x1c5),_0xeccc59[_0x16aee5(0x15a)]),_0x2c2141[_0x16aee5(0x164)]['set'](_0x16aee5(0x182),_0x351657),_0x2c2141[_0x16aee5(0x164)][_0x16aee5(0x185)](_0xeccc59[_0x16aee5(0x1c6)],'http://localhost:'+CALLBACK_PORT+_0x16aee5(0x135)),_0x2c2141['searchParams']['set'](_0x16aee5(0x12f),_0xd314),_0x2c2141['searchParams'][_0x16aee5(0x185)]('code_challenge_method','S256'),_0x2c2141[_0x16aee5(0x164)][_0x16aee5(0x185)](_0xeccc59['vVHsH'],_0x1936da);_0x31a9a7['resource']&&_0x2c2141['searchParams']['set'](_0xeccc59[_0x16aee5(0x1af)],_0x31a9a7[_0x16aee5(0x194)]);console[_0x16aee5(0x16c)](_0xeccc59[_0x16aee5(0x167)]),console[_0x16aee5(0x16c)](_0x16aee5(0x18c)+_0x2c2141[_0x16aee5(0x17f)]()+'\x0a'),await _0xeccc59['AYjGo'](openBrowser,_0x2c2141['toString']());const _0x44e975=await waitForCallback(_0x1936da);process['stdout']['write'](_0xeccc59['tjaDy']);const _0x1cc166=new URLSearchParams({'grant_type':_0xeccc59[_0x16aee5(0x160)],'code':_0x44e975,'redirect_uri':_0x16aee5(0x19c)+CALLBACK_PORT+_0x16aee5(0x135),'client_id':_0x351657,'code_verifier':_0x32d6be});_0x4d702a&&_0x1cc166[_0x16aee5(0x185)](_0xeccc59[_0x16aee5(0x1bd)],_0x4d702a);_0x31a9a7['resource']&&_0x1cc166[_0x16aee5(0x185)](_0xeccc59[_0x16aee5(0x1af)],_0x31a9a7['resource']);const _0x344597=await fetch(_0x3032ec[_0x16aee5(0x146)],{'method':_0xeccc59[_0x16aee5(0x147)],'headers':{'Content-Type':_0x16aee5(0x134)},'body':_0x1cc166});if(!_0x344597['ok']){const _0x39962f=await _0x344597['text']();throw new Error('Token\x20exchange\x20failed:\x20'+_0x39962f);}const _0x42fe1c=await _0x344597[_0x16aee5(0x189)]();return console[_0x16aee5(0x16c)](_0xeccc59['LNDxD']),await _0xeccc59[_0x16aee5(0x196)](saveCachedToken,_0x42fe1c['access_token'],_0x42fe1c[_0x16aee5(0x1a8)],_0x42fe1c[_0x16aee5(0x13b)]),_0x42fe1c[_0x16aee5(0x16a)];}async function callGetCliToken(_0x8aefd0,_0x519b12){const _0x4e9ecc=_0x304232,_0x304672={'gDuRW':_0x4e9ecc(0x154),'jcZnL':function(_0x2632d0,_0x28514c){return _0x2632d0(_0x28514c);},'vmBCf':_0x4e9ecc(0x156),'UmzJj':'2025-03-26','EoNRu':function(_0x286756,_0x59f887,_0x1bc62d){return _0x286756(_0x59f887,_0x1bc62d);},'uxYeP':'POST','XSqEM':_0x4e9ecc(0x157),'SRdAa':'Requesting\x20CLI\x20token...','BcHlW':'get_cli_token','MNaWL':function(_0x94b412){return _0x94b412();},'QGudD':function(_0xb95c82,_0xebe0fc,_0x198d8c,_0x597c4f){return _0xb95c82(_0xebe0fc,_0x198d8c,_0x597c4f);},'DGNUs':'auth-origin.txt'},_0x24ad9a={'Content-Type':'application/json','Accept':_0x304672[_0x4e9ecc(0x166)]};_0x519b12&&(_0x24ad9a[_0x4e9ecc(0x168)]=_0x4e9ecc(0x158)+_0x519b12);const _0x856240=async _0x23ccdd=>{const _0x5cfa1b=_0x4e9ecc,_0x27dc99=await fetch(_0x8aefd0,{'method':'POST','headers':_0x24ad9a,'body':JSON['stringify'](_0x23ccdd)});if(!_0x27dc99['ok']){const _0xe9ca0=await _0x27dc99[_0x5cfa1b(0x1c3)]();throw new Error('HTTP\x20'+_0x27dc99['status']+':\x20'+_0xe9ca0);}return parseResponse(_0x27dc99);};process[_0x4e9ecc(0x18d)][_0x4e9ecc(0x19f)]('Initializing\x20MCP\x20session...');const _0x241999=await _0x304672[_0x4e9ecc(0x1b8)](_0x856240,{'jsonrpc':_0x304672['vmBCf'],'id':0x1,'method':_0x4e9ecc(0x142),'params':{'protocolVersion':_0x304672[_0x4e9ecc(0x159)],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':'1.0.0'}}});if(_0x241999[_0x4e9ecc(0x1b9)])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x241999['error']['message']??JSON['stringify'](_0x241999[_0x4e9ecc(0x1b9)])));console['log'](_0x4e9ecc(0x144)),await _0x304672['EoNRu'](fetch,_0x8aefd0,{'method':_0x304672[_0x4e9ecc(0x13f)],'headers':_0x24ad9a,'body':JSON['stringify']({'jsonrpc':'2.0','method':_0x304672['XSqEM']})})[_0x4e9ecc(0x1ae)](_0x1ca405=>_0x1ca405['text']()),process['stdout']['write'](_0x304672[_0x4e9ecc(0x17d)]);const _0x3651e9=await _0x856240({'jsonrpc':_0x4e9ecc(0x156),'id':0x2,'method':'tools/call','params':{'name':_0x304672['BcHlW'],'arguments':{}}});if(_0x3651e9[_0x4e9ecc(0x1b9)])throw new Error(_0x4e9ecc(0x165)+(_0x3651e9[_0x4e9ecc(0x1b9)][_0x4e9ecc(0x174)]??JSON[_0x4e9ecc(0x170)](_0x3651e9['error'])));console[_0x4e9ecc(0x16c)]('\x20done');const _0x31d90f=_0x304672[_0x4e9ecc(0x1b8)](extractToken,_0x3651e9['result']);if(!_0x31d90f){console['error']('\x0aUnexpected\x20response\x20structure:'),console[_0x4e9ecc(0x1b9)](JSON[_0x4e9ecc(0x170)](_0x3651e9['result'],null,0x2));throw new Error(_0x4e9ecc(0x198));}const _0x18d634=_0x304672['EoNRu'](join,_0x304672[_0x4e9ecc(0x1b7)](homedir),'.ranger'),_0x467537=join(_0x18d634,'refresh.txt');await mkdir(_0x18d634,{'recursive':!![]}),await writeFile(_0x467537,_0x31d90f,{'mode':0x180}),await _0x304672['QGudD'](writeFile,join(_0x18d634,_0x304672[_0x4e9ecc(0x1a1)]),_0x8aefd0,{'mode':0x180}),console[_0x4e9ecc(0x16c)](_0x4e9ecc(0x199)+_0x467537),console['log'](_0x4e9ecc(0x1c4));}function _0x81f0(){const _0x248d46=['resource','Ranger\x20CLI','kpwgW','end','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','\x0aToken\x20written\x20to\x20','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','wFwCP','http://localhost:','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','Client\x20registration\x20failed:\x20','write','text/event-stream','DGNUs','OCDyl','proxied','trim','status','35WWnuoU','2JqPHWl','refresh_token','127.0.0.1','text/html','yujNs','authorization_code','EkCbi','then','NQetR','Exchanging\x20authorization\x20code...','parse','listen','ranger-cli','slice','1789794EOwyIc','Not\x20found','MNaWL','jcZnL','error','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','.ranger','redirect_uri','VSgwS','YRBGs','needs-oauth','length','SJMTw','jDoxm','text','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','response_type','zfYOK','code_challenge','CUOeV','data:','state','auth-origin.txt','application/x-www-form-urlencoded','/callback','content','KVmtf','base64url','POST','token','expires_in','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','726903DkPbSz','utf-8','uxYeP','Wgaeg','qFWSH','initialize','2166311caJOoO','\x20done','code','token_endpoint','ffIoN','JHsqn','client_secret','headers','WeNNN','10pnVwBs','authorization_servers','dOZKg','start','1655076HUxvCK','name','accessToken','aDyHU','application/json,\x20text/event-stream','mcbzL','2.0','notifications/initialized','Bearer\x20','UmzJj','ZwYop','pathname','startsWith','vSEGB','digest','clientId','xnUwE','get','refreshToken','236171zTNVPQ','searchParams','get_cli_token\x20failed:\x20','gDuRW','TsXZT','Authorization','string','access_token','ONsgB','log','update','match','none','stringify','Unknown\x20error','Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','6012GhvbNp','message','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','url','xISKL','OAuthTimeoutError','VaZMP','KyXYU','origin','clientSecret','SRdAa','writeHead','toString','YZdle','djCpB','client_id','content-type','AtLbw','set','Discovering\x20authorization\x20server...','iuTXR','replace','json','MMrzr','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','stdout','darwin','application/json','398299JWSRXG','uLYsg','kCjzZ','8RWugyY'];_0x81f0=function(){return _0x248d46;};return _0x81f0();}async function fetchAuthServerMetadata(_0x55ad61){const _0x167b21=_0x304232,_0x3e29b7=_0x55ad61+'/.well-known/oauth-authorization-server',_0x4d1a3a=await fetch(_0x3e29b7);if(!_0x4d1a3a['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x3e29b7+':\x20'+_0x4d1a3a['status']);return _0x4d1a3a[_0x167b21(0x189)]();}function waitForCallback(_0x48fa4b){const _0x3b7930=_0x304232,_0x1ed086={'qFWSH':_0x3b7930(0x135),'oZUod':_0x3b7930(0x1b6),'fnNOX':function(_0x16768b){return _0x16768b();},'SJMTw':function(_0x1b2c86,_0x5a9e6b){return _0x1b2c86!==_0x5a9e6b;},'nIlGU':function(_0x2e9a41,_0x482e12,_0x153800){return _0x2e9a41(_0x482e12,_0x153800);},'Revmz':function(_0x9c90c9,_0x422593){return _0x9c90c9(_0x422593);}};return new Promise((_0x5cbc63,_0x12b00b)=>{const _0x139a56=_0x3b7930,_0x4bc1a0={'gDQHN':function(_0x115e41,_0x4a37a4){return _0x115e41!==_0x4a37a4;},'kCjzZ':_0x1ed086[_0x139a56(0x141)],'voEyQ':_0x1ed086['oZUod'],'ELjFO':_0x139a56(0x1aa),'qrIgf':function(_0x449f5e){return _0x1ed086['fnNOX'](_0x449f5e);},'ONsgB':function(_0x257d8e,_0x952c00){return _0x257d8e(_0x952c00);},'IzBMU':function(_0x4524d1,_0x1abe29){const _0x530e5c=_0x139a56;return _0x1ed086[_0x530e5c(0x1c1)](_0x4524d1,_0x1abe29);}},_0x2a620c=()=>{_0x1e8913['closeAllConnections'](),_0x1e8913['close']();},_0x2a0996=_0x1ed086['nIlGU'](setTimeout,()=>{const _0x5bf5fc=_0x139a56;_0x2a620c(),_0x12b00b(new OAuthTimeoutError(_0x5bf5fc(0x1ba)));},0x1d4c0),_0x1e8913=_0x1ed086['Revmz'](createServer,(_0x2a2237,_0x3a3788)=>{const _0x19ebb5=_0x139a56,_0x34b61a=new URL(_0x2a2237[_0x19ebb5(0x176)]??'/',_0x19ebb5(0x19c)+CALLBACK_PORT);if(_0x4bc1a0['gDQHN'](_0x34b61a[_0x19ebb5(0x15b)],_0x4bc1a0[_0x19ebb5(0x192)])){_0x3a3788['writeHead'](0x194),_0x3a3788['end'](_0x4bc1a0['voEyQ']);return;}const _0x2c5c86=_0x34b61a[_0x19ebb5(0x164)][_0x19ebb5(0x161)]('code'),_0x31196c=_0x34b61a['searchParams'][_0x19ebb5(0x161)](_0x19ebb5(0x132)),_0x413f20=_0x34b61a[_0x19ebb5(0x164)]['get']('error');if(_0x413f20){const _0x1aea1d=_0x34b61a[_0x19ebb5(0x164)][_0x19ebb5(0x161)]('error_description')??_0x413f20;_0x3a3788['writeHead'](0xc8,{'Content-Type':_0x4bc1a0['ELjFO']}),_0x3a3788['end']('<html><body><h2>Authentication\x20failed</h2><p>'+_0x1aea1d+_0x19ebb5(0x13c)),clearTimeout(_0x2a0996),_0x4bc1a0['qrIgf'](_0x2a620c),_0x4bc1a0[_0x19ebb5(0x16b)](_0x12b00b,new Error('OAuth\x20error:\x20'+_0x1aea1d));return;}if(!_0x2c5c86||_0x4bc1a0['IzBMU'](_0x31196c,_0x48fa4b)){_0x3a3788['writeHead'](0x190,{'Content-Type':_0x4bc1a0['ELjFO']}),_0x3a3788[_0x19ebb5(0x197)]('<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>');return;}_0x3a3788[_0x19ebb5(0x17e)](0xc8,{'Content-Type':_0x4bc1a0['ELjFO']}),_0x3a3788[_0x19ebb5(0x197)](_0x19ebb5(0x18b)),_0x4bc1a0['ONsgB'](clearTimeout,_0x2a0996),_0x2a620c(),_0x5cbc63(_0x2c5c86);});_0x1e8913[_0x139a56(0x1b2)](CALLBACK_PORT,_0x139a56(0x1a9));});}function _0x156e(_0x538c9a,_0x331266){_0x538c9a=_0x538c9a-0x12f;const _0x81f01f=_0x81f0();let _0x156ee1=_0x81f01f[_0x538c9a];return _0x156ee1;}async function openBrowser(_0x3b8780){const _0x3ade9b=_0x304232,_0x426c1a={'iuTXR':_0x3ade9b(0x18e),'VrBcP':'xdg-open','gAVhI':function(_0x429ece,_0x4dc191){return _0x429ece(_0x4dc191);}},_0x3366a9=process['platform']===_0x426c1a[_0x3ade9b(0x187)]?'open':process['platform']==='win32'?_0x3ade9b(0x14f):_0x426c1a['VrBcP'];_0x426c1a['gAVhI'](exec,_0x3366a9+'\x20\x22'+_0x3b8780+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0xb69796=_0x304232,_0x2c6918={'feFYm':function(_0x3e1c6c,_0xb44bbb){return _0x3e1c6c>_0xb44bbb;}};try{const _0x944c98=JSON[_0xb69796(0x1b1)](await readFile(TOKEN_CACHE_PATH,_0xb69796(0x13e)));if(_0x944c98[_0xb69796(0x17b)]&&_0x944c98[_0xb69796(0x17b)]!==currentOrigin)return null;if(_0x944c98['expiresAt']&&_0x2c6918['feFYm'](Date['now'](),_0x944c98['expiresAt']))return null;return _0x944c98[_0xb69796(0x152)]??null;}catch{return null;}}async function saveCachedToken(_0xcd5bc7,_0x5b6337,_0x2cb638){const _0x435743=_0x304232,_0x198ee5={'XUGol':function(_0x28bf27,_0x52bea6){return _0x28bf27+_0x52bea6;},'wFwCP':function(_0xe1b1be,_0x3250b7){return _0xe1b1be*_0x3250b7;},'JHsqn':function(_0x4890ac,_0x5d6d07,_0x4d893f){return _0x4890ac(_0x5d6d07,_0x4d893f);},'AtLbw':function(_0x473ac1){return _0x473ac1();},'yujNs':function(_0x4ecc38,_0x599c01,_0x39ad25,_0x531737){return _0x4ecc38(_0x599c01,_0x39ad25,_0x531737);}},_0x4ae004=await loadCachedData(),_0x531249={..._0x4ae004,'origin':currentOrigin,'accessToken':_0xcd5bc7,'refreshToken':_0x5b6337??_0x4ae004?.[_0x435743(0x162)],'expiresAt':_0x2cb638?_0x198ee5['XUGol'](Date['now'](),_0x198ee5[_0x435743(0x19b)](_0x2cb638,0x3e8)):undefined};await _0x198ee5[_0x435743(0x148)](mkdir,_0x198ee5['JHsqn'](join,_0x198ee5[_0x435743(0x184)](homedir),'.ranger'),{'recursive':!![]}),await _0x198ee5[_0x435743(0x1ab)](writeFile,TOKEN_CACHE_PATH,JSON[_0x435743(0x170)](_0x531249),{'mode':0x180});}async function loadCachedClient(){const _0x231084=_0x304232,_0xa23bcc=await loadCachedData();if(_0xa23bcc?.[_0x231084(0x17b)]&&_0xa23bcc['origin']!==currentOrigin)return null;return _0xa23bcc?.['clientId']?{'clientId':_0xa23bcc[_0x231084(0x15f)],'clientSecret':_0xa23bcc[_0x231084(0x17c)]}:null;}async function clearCachedClient(){const _0x27efa9={'GmKNd':function(_0x4ef0ce,_0x152096,_0x2d9713,_0x11f20f){return _0x4ef0ce(_0x152096,_0x2d9713,_0x11f20f);}},_0x487e27=await loadCachedData();if(!_0x487e27)return;const {clientId:_0x85de9c,clientSecret:_0x333473,..._0x3f87d7}=_0x487e27;await _0x27efa9['GmKNd'](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x3f87d7),{'mode':0x180});}async function saveCachedClient(_0x8adea,_0x28f66a){const _0x2e5fa3=_0x304232,_0x20942c={'JZhye':function(_0x84c87,_0x3b3b33,_0x1d8542){return _0x84c87(_0x3b3b33,_0x1d8542);},'WeNNN':function(_0x4d8a5b){return _0x4d8a5b();},'nagOr':function(_0x2b702b,_0x5abf3c,_0x528ef7,_0xb579d2){return _0x2b702b(_0x5abf3c,_0x528ef7,_0xb579d2);}},_0xd11c36=await loadCachedData(),_0xdea45b={..._0xd11c36,'origin':currentOrigin,'accessToken':_0xd11c36?.[_0x2e5fa3(0x152)]??'','clientId':_0x8adea,'clientSecret':_0x28f66a};await _0x20942c['JZhye'](mkdir,join(_0x20942c[_0x2e5fa3(0x14b)](homedir),_0x2e5fa3(0x1bb)),{'recursive':!![]}),await _0x20942c['nagOr'](writeFile,TOKEN_CACHE_PATH,JSON[_0x2e5fa3(0x170)](_0xdea45b),{'mode':0x180});}async function loadCachedData(){const _0x43b7c2={'WuXTf':function(_0x5ba14f,_0x1fbb58,_0x4586cd){return _0x5ba14f(_0x1fbb58,_0x4586cd);}};try{return JSON['parse'](await _0x43b7c2['WuXTf'](readFile,TOKEN_CACHE_PATH,'utf-8'));}catch{return null;}}async function parseResponse(_0x253540){const _0x3fffbe=_0x304232,_0x2380ea={'fOpgR':_0x3fffbe(0x1a0),'gZSzY':_0x3fffbe(0x131),'xISKL':function(_0x480d5f,_0xb20e03){return _0x480d5f!==_0xb20e03;},'mwzEC':_0x3fffbe(0x175)},_0x1ed26b=_0x253540[_0x3fffbe(0x14a)]['get'](_0x3fffbe(0x183))??'';if(_0x1ed26b['includes'](_0x2380ea['fOpgR'])){const _0x3e3d02=await _0x253540['text']();for(const _0xbf3657 of _0x3e3d02['split']('\x0a')){const _0x21894b=_0xbf3657[_0x3fffbe(0x1a4)]();if(_0x21894b[_0x3fffbe(0x15c)]('data:')){const _0x42c2de=_0x21894b[_0x3fffbe(0x1b4)](_0x2380ea['gZSzY'][_0x3fffbe(0x1c0)])['trim']();if(!_0x42c2de)continue;try{const _0x3d8bb1=JSON[_0x3fffbe(0x1b1)](_0x42c2de);if(_0x2380ea[_0x3fffbe(0x177)](_0x3d8bb1['id'],undefined)||_0x3d8bb1['error'])return _0x3d8bb1;}catch{}}}throw new Error(_0x2380ea['mwzEC']);}return _0x253540[_0x3fffbe(0x189)]();}function extractToken(_0x52f9f1){const _0x3584fe=_0x304232,_0x328dc6={'YZdle':_0x3584fe(0x171),'ioAUU':'text','KVmtf':_0x3584fe(0x169)};if(!_0x52f9f1)return null;const _0x18cd32=_0x52f9f1['structuredContent'];if(_0x18cd32?.['token']&&typeof _0x18cd32['token']==='string')return _0x18cd32['token'];if(_0x52f9f1['isError']){const _0x5c38cc=_0x52f9f1[_0x3584fe(0x136)];throw new Error('Server\x20returned\x20error:\x20'+(_0x5c38cc?.[0x0]?.['text']??_0x328dc6[_0x3584fe(0x180)]));}const _0x36b4a6=_0x52f9f1['content'];if(_0x36b4a6)for(const _0x5b48d5 of _0x36b4a6){if(_0x5b48d5['type']===_0x328dc6['ioAUU']&&_0x5b48d5[_0x3584fe(0x1c3)]){try{const _0x1838f7=JSON[_0x3584fe(0x1b1)](_0x5b48d5[_0x3584fe(0x1c3)]);if(typeof _0x1838f7?.[_0x3584fe(0x13a)]===_0x328dc6[_0x3584fe(0x137)])return _0x1838f7[_0x3584fe(0x13a)];}catch{}const _0x2b5d8a=_0x5b48d5['text'][_0x3584fe(0x16e)](/(rngr_[A-Za-z0-9_-]+)/);if(_0x2b5d8a)return _0x2b5d8a[0x1];}}return null;}
@@ -1 +1 @@
1
- function _0x4055(_0x512fb9,_0x1f7ffd){_0x512fb9=_0x512fb9-0x1de;var _0x17c567=_0x17c5();var _0x40553a=_0x17c567[_0x512fb9];return _0x40553a;}(function(_0x3b3f95,_0x5317e4){var _0x2456a9=_0x4055,_0x351347=_0x3b3f95();while(!![]){try{var _0x16915e=parseInt(_0x2456a9(0x1e4))/0x1*(parseInt(_0x2456a9(0x1ee))/0x2)+parseInt(_0x2456a9(0x1de))/0x3*(parseInt(_0x2456a9(0x1ec))/0x4)+parseInt(_0x2456a9(0x1e3))/0x5+parseInt(_0x2456a9(0x1eb))/0x6*(parseInt(_0x2456a9(0x1e9))/0x7)+parseInt(_0x2456a9(0x1ea))/0x8+-parseInt(_0x2456a9(0x1ed))/0x9+-parseInt(_0x2456a9(0x1df))/0xa*(parseInt(_0x2456a9(0x1e8))/0xb);if(_0x16915e===_0x5317e4)break;else _0x351347['push'](_0x351347['shift']());}catch(_0x36444e){_0x351347['push'](_0x351347['shift']());}}}(_0x17c5,0xb0652));export async function migrateProfile(_0x4734f1,_0x317ec0){var _0x25c22c=_0x4055,_0x4e16b0={'cWCLi':function(_0x50817c,_0x778ad2){return _0x50817c+_0x778ad2;},'wPaWh':function(_0x44affa,_0x41d608){return _0x44affa+_0x41d608;},'IuNTu':'ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','CROlF':'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','jbAIe':_0x25c22c(0x1e1),'kkMei':'\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a','oaflr':'Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a'};console['error'](_0x4e16b0[_0x25c22c(0x1e7)](_0x4e16b0[_0x25c22c(0x1e2)](_0x4e16b0[_0x25c22c(0x1e2)](_0x4e16b0[_0x25c22c(0x1e0)],'\x0a')+_0x4e16b0[_0x25c22c(0x1e6)]+'\x20\x20ranger\x20profile\x20add\x20<name>\x0a'+'\x0a'+_0x4e16b0['jbAIe']+_0x4e16b0[_0x25c22c(0x1e5)],'\x0a'),_0x4e16b0['oaflr'])+'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.'),process['exit'](0x1);}function _0x17c5(){var _0x4fb234=['wPaWh','3743435HZOvMG','42121fUmGGC','kkMei','CROlF','cWCLi','44YfaljT','7dmyczt','1190176FoPimi','258132hDmwwX','5725444nNgexc','8192187AaSAGa','62eEAplW','3WqKAMH','5112090PwMljG','IuNTu','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a'];_0x17c5=function(){return _0x4fb234;};return _0x17c5();}
1
+ function _0x55a6(_0x2c37a7,_0xad4d8d){_0x2c37a7=_0x2c37a7-0x1a6;var _0x2456c0=_0x2456();var _0x55a601=_0x2456c0[_0x2c37a7];return _0x55a601;}(function(_0xbbfb16,_0x1047d9){var _0x31a4c9=_0x55a6,_0x520224=_0xbbfb16();while(!![]){try{var _0x52b208=-parseInt(_0x31a4c9(0x1b2))/0x1*(-parseInt(_0x31a4c9(0x1a7))/0x2)+-parseInt(_0x31a4c9(0x1b1))/0x3*(parseInt(_0x31a4c9(0x1b5))/0x4)+parseInt(_0x31a4c9(0x1b3))/0x5*(-parseInt(_0x31a4c9(0x1ab))/0x6)+parseInt(_0x31a4c9(0x1af))/0x7*(parseInt(_0x31a4c9(0x1b0))/0x8)+-parseInt(_0x31a4c9(0x1a8))/0x9+parseInt(_0x31a4c9(0x1b7))/0xa*(-parseInt(_0x31a4c9(0x1ac))/0xb)+parseInt(_0x31a4c9(0x1ad))/0xc;if(_0x52b208===_0x1047d9)break;else _0x520224['push'](_0x520224['shift']());}catch(_0x241dfc){_0x520224['push'](_0x520224['shift']());}}}(_0x2456,0xc3f5c));function _0x2456(){var _0x1ababd=['ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','942YFxbJK','341BQLUtS','31883604lMBjJa','NOPUN','7VGWmOm','11554184wOAZNZ','48951wWHLlz','651991ZsqXRP','13170miLCPF','PLUCo','272ZmoQnL','ydwTY','510760RymgkT','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','2JDTjVn','7597161RUOQJN','error'];_0x2456=function(){return _0x1ababd;};return _0x2456();}export async function migrateProfile(_0x231dbf,_0x2e7efa){var _0x2d02f5=_0x55a6,_0x35af59={'ewkUz':function(_0x480cc6,_0x33cbf1){return _0x480cc6+_0x33cbf1;},'PLUCo':function(_0x55ce2a,_0x22ec64){return _0x55ce2a+_0x22ec64;},'ydwTY':function(_0x23acf7,_0x1e98e2){return _0x23acf7+_0x1e98e2;},'jviZv':function(_0x5f2f79,_0x2f5a70){return _0x5f2f79+_0x2f5a70;},'SPxny':_0x2d02f5(0x1aa),'NOPUN':'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','Olcid':_0x2d02f5(0x1a6),'TTifp':'Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a'};console[_0x2d02f5(0x1a9)](_0x35af59['ewkUz'](_0x35af59[_0x2d02f5(0x1b4)](_0x35af59[_0x2d02f5(0x1b6)](_0x35af59['ydwTY'](_0x35af59['jviZv'](_0x35af59['ewkUz'](_0x35af59['SPxny'],'\x0a')+_0x35af59[_0x2d02f5(0x1ae)],'\x20\x20ranger\x20profile\x20add\x20<name>\x0a'),'\x0a')+_0x35af59['Olcid'],'\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a'),'\x0a')+_0x35af59['TTifp'],'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.')),process['exit'](0x1);}
@@ -1 +1 @@
1
- (function(_0x5a4d3b,_0x19f1ba){const _0x5a8f21=_0x5d56,_0x38002b=_0x5a4d3b();while(!![]){try{const _0xdf7592=-parseInt(_0x5a8f21(0x17d))/0x1+-parseInt(_0x5a8f21(0x171))/0x2*(parseInt(_0x5a8f21(0x1a3))/0x3)+parseInt(_0x5a8f21(0x198))/0x4+parseInt(_0x5a8f21(0x19a))/0x5*(parseInt(_0x5a8f21(0x1a2))/0x6)+-parseInt(_0x5a8f21(0x16d))/0x7*(parseInt(_0x5a8f21(0x19f))/0x8)+-parseInt(_0x5a8f21(0x175))/0x9*(-parseInt(_0x5a8f21(0x170))/0xa)+parseInt(_0x5a8f21(0x190))/0xb;if(_0xdf7592===_0x19f1ba)break;else _0x38002b['push'](_0x38002b['shift']());}catch(_0x3c36cf){_0x38002b['push'](_0x38002b['shift']());}}}(_0x17f6,0x7c7af));import{join}from'path';import{existsSync}from'fs';import _0x52a815 from'inquirer';import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';function _0x5d56(_0x3e1f70,_0x21ccd0){_0x3e1f70=_0x3e1f70-0x16b;const _0x17f694=_0x17f6();let _0x5d56ac=_0x17f694[_0x3e1f70];return _0x5d56ac;}function _0x17f6(){const _0xcc043b=['wZtGl','prompt','rTigW','pluginScope','push','list','UqIVm','⚠\x20Failed\x20to\x20enable\x20plugin:','nqoJr','ustUJ','ugHcx','22865007MrFliD','success','✓\x20Marketplace\x20already\x20added','hnpNv','log','qZEfp','✓\x20Ranger\x20skills\x20already\x20installed','output','812776AGrDOj','already\x20enabled','10785NcWDZX','iBAKS','error','User\x20(available\x20in\x20all\x20your\x20projects)','wantsSkillup','3652496wkSgXB','Where\x20should\x20the\x20plugin\x20be\x20installed?','GIrul','732PBtYrD','15003WkMkQA','project','ASTCl','JbZEt','\x20level)...\x0a','14PdAUDZ','HiebS','gRhxH','3770IUtpZq','214hZAMLX','ranger@trailhead','includes','iMHXv','3744ikdkFW','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','Project\x20(shared\x20with\x20team\x20via\x20git)','\x0aYou\x20can\x20install\x20manually\x20with:','JaSBZ','.claude','ohFdQ','cpKkS','743715EdRCAo','--scope','gAvha','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','oiOhi','EWXFf','user','✓\x20Claude\x20Code\x20plugin\x20enabled'];_0x17f6=function(){return _0xcc043b;};return _0x17f6();}import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x3a2cca){const _0x3e4bf0=_0x5d56,_0x81b83={'Ahngv':function(_0x57fe6c,_0x400ca3){return _0x57fe6c(_0x400ca3);},'ohFdQ':_0x3e4bf0(0x172),'qZEfp':function(_0x2e0857,_0x446f4a,_0x4a084c){return _0x2e0857(_0x446f4a,_0x4a084c);},'DDgxr':_0x3e4bf0(0x17a),'HiebS':_0x3e4bf0(0x18a),'hpfjm':_0x3e4bf0(0x188),'iBAKS':_0x3e4bf0(0x19d),'cpKkS':'user','JaSBZ':_0x3e4bf0(0x177),'ASTCl':'project','wKTPq':'trailhead','EWXFf':_0x3e4bf0(0x192),'wZtGl':'plugin','gRhxH':'add','GIrul':'❌\x20Failed\x20to\x20add\x20marketplace:','rTigW':_0x3e4bf0(0x176),'ugHcx':'install','HGFpN':function(_0x1869de,_0x11a8a7){return _0x1869de===_0x11a8a7;},'gAvha':function(_0x19b91b){return _0x19b91b();},'yMVzn':'❌\x20Failed\x20to\x20install\x20plugin:','OHmPB':_0x3e4bf0(0x178),'ustUJ':'enable','tjtjk':_0x3e4bf0(0x17e),'JbZEt':function(_0x3b39b0,_0xef7c8d){return _0x3b39b0===_0xef7c8d;},'nqoJr':function(_0x8db4da){return _0x8db4da();}},_0x2a76a0=await _0x81b83['Ahngv'](isPluginInstalled,_0x81b83[_0x3e4bf0(0x17b)]);if(_0x2a76a0)return console['log']('✓\x20Claude\x20Code\x20plugin\x20already\x20installed'),![];const _0x551e31=existsSync(_0x81b83[_0x3e4bf0(0x195)](join,getProjectRoot(),_0x81b83['DDgxr']));let _0x1a8704;if(_0x3a2cca)_0x1a8704=_0x3a2cca;else{if(_0x551e31)_0x1a8704='project';else{console['log']('\x0a📦\x20Claude\x20Code\x20Plugin\x0a');const _0x33a01a=await _0x52a815[_0x3e4bf0(0x186)]([{'type':_0x81b83[_0x3e4bf0(0x16e)],'name':_0x81b83['hpfjm'],'message':_0x3e4bf0(0x1a0),'choices':[{'name':_0x81b83[_0x3e4bf0(0x19b)],'value':_0x81b83[_0x3e4bf0(0x17c)]},{'name':_0x81b83[_0x3e4bf0(0x179)],'value':_0x81b83[_0x3e4bf0(0x1a5)]}],'default':'user'}]);_0x1a8704=_0x33a01a['pluginScope'];}}console['log']('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x1a8704+_0x3e4bf0(0x16c));const _0x1be100=await isMarketplaceAdded(_0x81b83['wKTPq']);let _0x4e7f60=_0x1be100;if(_0x1be100)console['log'](_0x81b83[_0x3e4bf0(0x182)]);else{const _0x4e7e7e=await runClaudeCommand([_0x81b83['wZtGl'],'marketplace',_0x81b83[_0x3e4bf0(0x16f)],'ranger-testing/trailhead']);!_0x4e7e7e[_0x3e4bf0(0x191)]?(console[_0x3e4bf0(0x19c)](_0x81b83[_0x3e4bf0(0x1a1)],_0x4e7e7e['error']),console[_0x3e4bf0(0x194)]('\x0aYou\x20can\x20install\x20manually\x20with:'),console['log'](_0x81b83[_0x3e4bf0(0x187)]),console['log'](_0x3e4bf0(0x180)+_0x1a8704)):_0x4e7f60=!![];}if(_0x4e7f60){const _0xb14bd1=await runClaudeCommand(['plugin',_0x81b83[_0x3e4bf0(0x18f)],_0x81b83['ohFdQ'],_0x3e4bf0(0x17e),_0x1a8704],{'cwd':_0x81b83['HGFpN'](_0x1a8704,_0x3e4bf0(0x1a4))?_0x81b83[_0x3e4bf0(0x17f)](getProjectRoot):undefined});if(!_0xb14bd1['success'])console['error'](_0x81b83['yMVzn'],_0xb14bd1['error']),console['log'](_0x81b83['OHmPB']),console[_0x3e4bf0(0x194)](_0x3e4bf0(0x180)+_0x1a8704);else{console[_0x3e4bf0(0x194)]('✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully');const _0x4ccfcb=[_0x81b83[_0x3e4bf0(0x185)],_0x81b83[_0x3e4bf0(0x18e)],_0x81b83['ohFdQ']];_0x81b83['HGFpN'](_0x1a8704,'project')&&_0x4ccfcb[_0x3e4bf0(0x189)](_0x81b83['tjtjk'],_0x81b83['ASTCl']);const _0x3539c3=await runClaudeCommand(_0x4ccfcb,{'captureOutput':!![],'cwd':_0x81b83[_0x3e4bf0(0x16b)](_0x1a8704,_0x81b83[_0x3e4bf0(0x1a5)])?_0x81b83[_0x3e4bf0(0x18d)](getProjectRoot):undefined}),_0x38bbd6=_0x3539c3[_0x3e4bf0(0x197)]?.[_0x3e4bf0(0x173)](_0x3e4bf0(0x199));!_0x3539c3[_0x3e4bf0(0x191)]&&!_0x38bbd6?console['error'](_0x3e4bf0(0x18c),_0x3539c3[_0x3e4bf0(0x19c)]):console['log'](_0x3e4bf0(0x184));}}return!![];}export async function ensureClaudeSkills(_0x4c3c7f){const _0x580eab=_0x5d56,_0x5e8379={'xiWAI':_0x580eab(0x183),'iMHXv':function(_0x4f2e21,_0x3a221e){return _0x4f2e21(_0x3a221e);},'UqIVm':_0x580eab(0x1a4),'oiOhi':'ranger','Jxgxu':'SKILL.md','hnpNv':_0x580eab(0x196),'zjZMs':'confirm','ZoqNF':'Would\x20you\x20like\x20to\x20install\x20skills?'},_0x4010ff=existsSync(join(getSkillsDir(_0x5e8379['xiWAI']),'ranger','SKILL.md')),_0x95d06a=_0x5e8379[_0x580eab(0x174)](existsSync,join(getSkillsDir(_0x5e8379[_0x580eab(0x18b)]),_0x5e8379[_0x580eab(0x181)],_0x5e8379['Jxgxu']));if(_0x4010ff||_0x95d06a)return console[_0x580eab(0x194)](_0x5e8379[_0x580eab(0x193)]),![];const _0x255c47=existsSync(join(getProjectRoot(),'.claude'));let _0x10cbf5=!![];if(_0x4c3c7f)await skillup({'autoInstall':_0x4c3c7f,'suppressUsage':!![]});else{if(_0x255c47)await skillup({'autoInstall':_0x5e8379['UqIVm'],'suppressUsage':!![]});else{const _0x560ca2=await _0x52a815['prompt']([{'type':_0x5e8379['zjZMs'],'name':_0x580eab(0x19e),'message':_0x5e8379['ZoqNF'],'default':!![]}]);_0x10cbf5=_0x560ca2['wantsSkillup'],_0x10cbf5&&await skillup({'suppressUsage':!![]});}}return _0x10cbf5;}
1
+ function _0x5a06(){const _0x4b8833=['258fSLxNo','ghVEL','KIPBv','sVlmN','prompt','✓\x20Marketplace\x20already\x20added','288666rnaZNG','hgoRM','dPeVx','Uvlap','confirm','pluginScope','rCliR','1269037miXZXx','UzQDR','user','SKILL.md','push','uIwKe','UyDvb','GgIBY','ranger@trailhead','Bxbuk','error','NMfHi','474ytnkhX','.claude','DBuYq','includes','add','362264akHMDU','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','project','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','83320iJfqLf','dUVtW','dKxRy','uwhDK','\x0a📦\x20Claude\x20Code\x20Plugin\x0a','kpEvw','xkOUb','Where\x20should\x20the\x20plugin\x20be\x20installed?','90LAMiro','log','1560250qYQEmE','TNplg','419GftDdF','hqzrE','VyHrt','success','list','4585chHoLf','zUmme'];_0x5a06=function(){return _0x4b8833;};return _0x5a06();}(function(_0x1b6b0a,_0x498778){const _0x2b09bc=_0x327b,_0x49bfab=_0x1b6b0a();while(!![]){try{const _0x1da3cf=parseInt(_0x2b09bc(0x1f8))/0x1*(parseInt(_0x2b09bc(0x1e3))/0x2)+-parseInt(_0x2b09bc(0x205))/0x3+-parseInt(_0x2b09bc(0x1e8))/0x4+parseInt(_0x2b09bc(0x1fd))/0x5*(-parseInt(_0x2b09bc(0x1ff))/0x6)+parseInt(_0x2b09bc(0x1d7))/0x7+-parseInt(_0x2b09bc(0x1ec))/0x8*(parseInt(_0x2b09bc(0x1f4))/0x9)+parseInt(_0x2b09bc(0x1f6))/0xa;if(_0x1da3cf===_0x498778)break;else _0x49bfab['push'](_0x49bfab['shift']());}catch(_0x3d611d){_0x49bfab['push'](_0x49bfab['shift']());}}}(_0x5a06,0x19f0a));import{join}from'path';import{existsSync}from'fs';import _0x4ebcb9 from'inquirer';import{skillup}from'../skillup.js';function _0x327b(_0x272235,_0x2c28fd){_0x272235=_0x272235-0x1d1;const _0x5a062a=_0x5a06();let _0x327bcf=_0x5a062a[_0x272235];return _0x327bcf;}import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x2c6f9b){const _0x5da1ca=_0x327b,_0x10b6ef={'EkiOh':function(_0x40b8c5,_0xd670c5){return _0x40b8c5(_0xd670c5);},'kPhOI':'ranger@trailhead','VyHrt':function(_0x500967,_0x594f98,_0xd1db9c){return _0x500967(_0x594f98,_0xd1db9c);},'dPeVx':function(_0x3c1a59){return _0x3c1a59();},'uIwKe':_0x5da1ca(0x1f0),'Bxbuk':_0x5da1ca(0x1f3),'uwhDK':'User\x20(available\x20in\x20all\x20your\x20projects)','dUVtW':'user','sVlmN':function(_0x1fd670,_0x1785aa){return _0x1fd670(_0x1785aa);},'hqzrE':'trailhead','OJzwq':_0x5da1ca(0x1e7),'kpEvw':'❌\x20Failed\x20to\x20add\x20marketplace:','TNplg':'\x0aYou\x20can\x20install\x20manually\x20with:','icJaJ':_0x5da1ca(0x1e9),'uiQdr':'plugin','ovzoq':'install','rCliR':'--scope','GgIBY':function(_0x4db7c6,_0x4a772a){return _0x4db7c6===_0x4a772a;},'KIPBv':function(_0x5f41dc){return _0x5f41dc();},'UyDvb':'✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','XgZvF':'project','hgoRM':'already\x20enabled','ozxMG':'⚠\x20Failed\x20to\x20enable\x20plugin:','UzQDR':'✓\x20Claude\x20Code\x20plugin\x20enabled'},_0x5e0463=await _0x10b6ef['EkiOh'](isPluginInstalled,_0x10b6ef['kPhOI']);if(_0x5e0463)return console[_0x5da1ca(0x1f5)]('✓\x20Claude\x20Code\x20plugin\x20already\x20installed'),![];const _0x309618=existsSync(_0x10b6ef[_0x5da1ca(0x1fa)](join,_0x10b6ef[_0x5da1ca(0x1d2)](getProjectRoot),_0x5da1ca(0x1e4)));let _0x53024c;if(_0x2c6f9b)_0x53024c=_0x2c6f9b;else{if(_0x309618)_0x53024c='project';else{console['log'](_0x10b6ef[_0x5da1ca(0x1dc)]);const _0x3b5a74=await _0x4ebcb9['prompt']([{'type':_0x5da1ca(0x1fc),'name':_0x5da1ca(0x1d5),'message':_0x10b6ef[_0x5da1ca(0x1e0)],'choices':[{'name':_0x10b6ef[_0x5da1ca(0x1ef)],'value':_0x5da1ca(0x1d9)},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':_0x5da1ca(0x1ea)}],'default':_0x10b6ef[_0x5da1ca(0x1ed)]}]);_0x53024c=_0x3b5a74[_0x5da1ca(0x1d5)];}}console[_0x5da1ca(0x1f5)]('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x53024c+'\x20level)...\x0a');const _0x48a2c3=await _0x10b6ef[_0x5da1ca(0x202)](isMarketplaceAdded,_0x10b6ef[_0x5da1ca(0x1f9)]);let _0x255e8a=_0x48a2c3;if(_0x48a2c3)console['log'](_0x5da1ca(0x204));else{const _0x2f3ff2=await _0x10b6ef[_0x5da1ca(0x202)](runClaudeCommand,['plugin','marketplace',_0x10b6ef['OJzwq'],'ranger-testing/trailhead']);!_0x2f3ff2[_0x5da1ca(0x1fb)]?(console['error'](_0x10b6ef[_0x5da1ca(0x1f1)],_0x2f3ff2['error']),console['log'](_0x10b6ef[_0x5da1ca(0x1f7)]),console['log'](_0x10b6ef['icJaJ']),console[_0x5da1ca(0x1f5)](_0x5da1ca(0x1eb)+_0x53024c)):_0x255e8a=!![];}if(_0x255e8a){const _0x2dfe13=await runClaudeCommand([_0x10b6ef['uiQdr'],_0x10b6ef['ovzoq'],'ranger@trailhead',_0x10b6ef[_0x5da1ca(0x1d6)],_0x53024c],{'cwd':_0x10b6ef[_0x5da1ca(0x1de)](_0x53024c,_0x5da1ca(0x1ea))?_0x10b6ef[_0x5da1ca(0x201)](getProjectRoot):undefined});if(!_0x2dfe13['success'])console[_0x5da1ca(0x1e1)]('❌\x20Failed\x20to\x20install\x20plugin:',_0x2dfe13[_0x5da1ca(0x1e1)]),console[_0x5da1ca(0x1f5)](_0x10b6ef[_0x5da1ca(0x1f7)]),console['log'](_0x5da1ca(0x1eb)+_0x53024c);else{console[_0x5da1ca(0x1f5)](_0x10b6ef[_0x5da1ca(0x1dd)]);const _0x499ea9=[_0x10b6ef['uiQdr'],'enable',_0x5da1ca(0x1df)];_0x10b6ef['GgIBY'](_0x53024c,_0x5da1ca(0x1ea))&&_0x499ea9[_0x5da1ca(0x1db)](_0x10b6ef['rCliR'],'project');const _0x5c5026=await runClaudeCommand(_0x499ea9,{'captureOutput':!![],'cwd':_0x53024c===_0x10b6ef['XgZvF']?getProjectRoot():undefined}),_0x482f35=_0x5c5026['output']?.[_0x5da1ca(0x1e6)](_0x10b6ef[_0x5da1ca(0x1d1)]);!_0x5c5026[_0x5da1ca(0x1fb)]&&!_0x482f35?console['error'](_0x10b6ef['ozxMG'],_0x5c5026[_0x5da1ca(0x1e1)]):console[_0x5da1ca(0x1f5)](_0x10b6ef[_0x5da1ca(0x1d8)]);}}return!![];}export async function ensureClaudeSkills(_0x30bb20){const _0x33c18e=_0x327b,_0x45c253={'dKxRy':function(_0x552e22,_0x4bb707,_0x14fc2b,_0x10cfa0){return _0x552e22(_0x4bb707,_0x14fc2b,_0x10cfa0);},'zUmme':'user','DBuYq':'ranger','NMfHi':_0x33c18e(0x1da),'REdmw':function(_0x3d8c27,_0x28dfa5){return _0x3d8c27(_0x28dfa5);},'xkOUb':function(_0x449beb,_0x5bfb5e){return _0x449beb(_0x5bfb5e);},'ghVEL':function(_0x24fcb8,_0x52c5e9,_0x1aec5c){return _0x24fcb8(_0x52c5e9,_0x1aec5c);},'lTjlu':_0x33c18e(0x1d4),'icAnL':'Would\x20you\x20like\x20to\x20install\x20skills?','Uvlap':function(_0x24e9d4,_0x44b92b){return _0x24e9d4(_0x44b92b);}},_0x56df39=existsSync(_0x45c253[_0x33c18e(0x1ee)](join,getSkillsDir(_0x45c253[_0x33c18e(0x1fe)]),_0x45c253[_0x33c18e(0x1e5)],_0x45c253[_0x33c18e(0x1e2)])),_0x548e50=_0x45c253['REdmw'](existsSync,join(getSkillsDir(_0x33c18e(0x1ea)),'ranger',_0x33c18e(0x1da)));if(_0x56df39||_0x548e50)return console['log']('✓\x20Ranger\x20skills\x20already\x20installed'),![];const _0x51bdf4=_0x45c253[_0x33c18e(0x1f2)](existsSync,_0x45c253[_0x33c18e(0x200)](join,getProjectRoot(),_0x33c18e(0x1e4)));let _0x5d907f=!![];if(_0x30bb20)await _0x45c253['xkOUb'](skillup,{'autoInstall':_0x30bb20,'suppressUsage':!![]});else{if(_0x51bdf4)await skillup({'autoInstall':'project','suppressUsage':!![]});else{const _0x1ce1ed=await _0x4ebcb9[_0x33c18e(0x203)]([{'type':_0x45c253['lTjlu'],'name':'wantsSkillup','message':_0x45c253['icAnL'],'default':!![]}]);_0x5d907f=_0x1ce1ed['wantsSkillup'],_0x5d907f&&await _0x45c253[_0x33c18e(0x1d3)](skillup,{'suppressUsage':!![]});}}return _0x5d907f;}
@@ -1 +1 @@
1
- (function(_0x35025f,_0x3b0f13){const _0x41eadb=_0x7d2d,_0x4abb42=_0x35025f();while(!![]){try{const _0x20d45f=-parseInt(_0x41eadb(0xe0))/0x1*(-parseInt(_0x41eadb(0xd4))/0x2)+parseInt(_0x41eadb(0xdb))/0x3*(-parseInt(_0x41eadb(0xc6))/0x4)+-parseInt(_0x41eadb(0xd7))/0x5*(parseInt(_0x41eadb(0xcb))/0x6)+parseInt(_0x41eadb(0xdf))/0x7+-parseInt(_0x41eadb(0xce))/0x8+-parseInt(_0x41eadb(0xd5))/0x9*(-parseInt(_0x41eadb(0xca))/0xa)+-parseInt(_0x41eadb(0xd0))/0xb;if(_0x20d45f===_0x3b0f13)break;else _0x4abb42['push'](_0x4abb42['shift']());}catch(_0x3fc4ca){_0x4abb42['push'](_0x4abb42['shift']());}}}(_0x5e8f,0x20e79));import{join}from'path';function _0x7d2d(_0x7677ed,_0x446e8c){_0x7677ed=_0x7677ed-0xc4;const _0x5e8f36=_0x5e8f();let _0x7d2d8c=_0x5e8f36[_0x7677ed];return _0x7d2d8c;}import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';function _0x5e8f(){const _0x5ce4c3=['project','PGslI','1827952DUrLBR','2851LZLgDj','user','prompt','754764bPlNoq','log','Project\x20(shared\x20with\x20team\x20via\x20git)','zYCDt','30INyKwi','564mzUmDz','parse','stringify','566376ULAhQm','lOlUv','1201464mBugTE','pluginScope','ZaHxw','lxMIy','76EJvous','657819KbLUMI','plugin','4535bcUYgS','zbPRQ','https://opencode.ai/config.json','opencode.json','3XrOCoQ','sXxxD'];_0x5e8f=function(){return _0x5ce4c3;};return _0x5e8f();}import _0x49cd87 from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0xd440be){const _0x27785f=_0x7d2d,_0x32e89b={'lxMIy':function(_0x305fa5,_0x5bb603){return _0x305fa5(_0x5bb603);},'WDPfj':'project','zYCDt':'\x0a📦\x20OpenCode\x20Plugin\x0a','PGslI':'list','ZaHxw':'User\x20(available\x20in\x20all\x20your\x20projects)','rQoQL':'user','zbPRQ':_0x27785f(0xc8),'lOlUv':function(_0x5351d6,_0x46f0ce,_0x2b9bee){return _0x5351d6(_0x46f0ce,_0x2b9bee);},'sXxxD':'utf-8','wGTTQ':'⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','vfKnP':'Failed\x20to\x20read\x20opencode.json','AJVnL':'✓\x20OpenCode\x20plugin\x20configured'},_0x5f4a21=_0x32e89b[_0x27785f(0xd3)](existsSync,join(getOpencodeConfigDir(_0x32e89b['WDPfj']),_0x27785f(0xda)));let _0x35afc5;if(_0xd440be)_0x35afc5=_0xd440be;else{if(_0x5f4a21)_0x35afc5=_0x27785f(0xdd);else{console['log'](_0x32e89b[_0x27785f(0xc9)]);const _0x5434ea=await _0x49cd87[_0x27785f(0xc5)]([{'type':_0x32e89b[_0x27785f(0xde)],'name':_0x27785f(0xd1),'message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':_0x32e89b[_0x27785f(0xd2)],'value':_0x32e89b['rQoQL']},{'name':_0x32e89b[_0x27785f(0xd8)],'value':_0x32e89b['WDPfj']}],'default':_0x27785f(0xc4)}]);_0x35afc5=_0x5434ea['pluginScope'];}}const _0x2edb44=join(getOpencodeConfigDir(_0x35afc5),_0x27785f(0xda)),_0x5214df='@ranger-testing/opencode-plugin',_0x4f030a=_0x27785f(0xd9);let _0xdbf94a={};if(existsSync(_0x2edb44))try{const _0x422f6c=await _0x32e89b[_0x27785f(0xcf)](readFile,_0x2edb44,_0x32e89b[_0x27785f(0xdc)]);_0xdbf94a=JSON[_0x27785f(0xcc)](_0x422f6c);}catch(_0xa69c32){return console['error'](_0x32e89b['wGTTQ']),{'configured':![],'scope':_0x35afc5,'error':_0x32e89b['vfKnP'],'details':_0xa69c32};}const _0x488a35=Array['isArray'](_0xdbf94a[_0x27785f(0xd6)])?_0xdbf94a[_0x27785f(0xd6)]:[];if(_0x488a35['includes'](_0x5214df))return console[_0x27785f(0xc7)]('✓\x20OpenCode\x20plugin\x20already\x20configured'),{'configured':![],'scope':_0x35afc5};return _0xdbf94a['$schema']=_0xdbf94a['$schema']||_0x4f030a,_0xdbf94a['plugin']=[..._0x488a35,_0x5214df],await mkdir(_0x32e89b['lxMIy'](getOpencodeConfigDir,_0x35afc5),{'recursive':!![]}),await writeFile(_0x2edb44,JSON[_0x27785f(0xcd)](_0xdbf94a,null,0x2)+'\x0a'),console['log'](_0x32e89b['AJVnL']),{'configured':!![],'scope':_0x35afc5};}
1
+ function _0x1448(){const _0x2bcca3=['GMtVA','⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','wMGMI','Where\x20should\x20the\x20plugin\x20be\x20installed?','error','33CcjLaB','1268824kYxvva','utf-8','6tDgpJt','log','151088zxXnOw','$schema','488802cITCwN','3BSLiKS','stringify','sLRUX','2206930fJrfBk','42246INRTJa','includes','568RSlrGt','Project\x20(shared\x20with\x20team\x20via\x20git)','User\x20(available\x20in\x20all\x20your\x20projects)','dfhJq','project','2796514ggDciG','opencode.json','544010jSOJLc','YwEbU'];_0x1448=function(){return _0x2bcca3;};return _0x1448();}(function(_0x4ad9ef,_0x2fe757){const _0x2531f4=_0x3ad0,_0x11a8a7=_0x4ad9ef();while(!![]){try{const _0x302284=parseInt(_0x2531f4(0x135))/0x1+parseInt(_0x2531f4(0x133))/0x2+parseInt(_0x2531f4(0x136))/0x3*(parseInt(_0x2531f4(0x14b))/0x4)+parseInt(_0x2531f4(0x143))/0x5+-parseInt(_0x2531f4(0x131))/0x6*(parseInt(_0x2531f4(0x141))/0x7)+parseInt(_0x2531f4(0x13c))/0x8*(parseInt(_0x2531f4(0x13a))/0x9)+-parseInt(_0x2531f4(0x139))/0xa*(parseInt(_0x2531f4(0x14a))/0xb);if(_0x302284===_0x2fe757)break;else _0x11a8a7['push'](_0x11a8a7['shift']());}catch(_0x557c5c){_0x11a8a7['push'](_0x11a8a7['shift']());}}}(_0x1448,0x3ff9f));function _0x3ad0(_0xeb8a2b,_0x4900d4){_0xeb8a2b=_0xeb8a2b-0x130;const _0x14487b=_0x1448();let _0x3ad011=_0x14487b[_0xeb8a2b];return _0x3ad011;}import{join}from'path';import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0xa718a2 from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0x5b2da4){const _0x506cde=_0x3ad0,_0x1c3335={'wMGMI':function(_0x299cb7,_0x3eff16){return _0x299cb7(_0x3eff16);},'YwEbU':_0x506cde(0x148),'GMtVA':'user','sLRUX':'project','dfhJq':function(_0x392eba,_0x498720,_0x528bb1){return _0x392eba(_0x498720,_0x528bb1);},'DSXrp':'https://opencode.ai/config.json','yWskE':_0x506cde(0x130),'aKKvA':_0x506cde(0x146),'JFegh':function(_0x4121be,_0x12913e,_0x3f14bf){return _0x4121be(_0x12913e,_0x3f14bf);}},_0xc5faa2=_0x1c3335['wMGMI'](existsSync,join(getOpencodeConfigDir(_0x506cde(0x140)),_0x506cde(0x142)));let _0x3ba888;if(_0x5b2da4)_0x3ba888=_0x5b2da4;else{if(_0xc5faa2)_0x3ba888=_0x506cde(0x140);else{console[_0x506cde(0x132)]('\x0a📦\x20OpenCode\x20Plugin\x0a');const _0x3931c8=await _0xa718a2['prompt']([{'type':'list','name':'pluginScope','message':_0x1c3335[_0x506cde(0x144)],'choices':[{'name':_0x506cde(0x13e),'value':_0x1c3335[_0x506cde(0x145)]},{'name':_0x506cde(0x13d),'value':_0x1c3335[_0x506cde(0x138)]}],'default':'user'}]);_0x3ba888=_0x3931c8['pluginScope'];}}const _0x2caecf=_0x1c3335['dfhJq'](join,getOpencodeConfigDir(_0x3ba888),'opencode.json'),_0x2eb8d8='@ranger-testing/opencode-plugin',_0x4d697c=_0x1c3335['DSXrp'];let _0x19192e={};if(existsSync(_0x2caecf))try{const _0x388d9b=await readFile(_0x2caecf,_0x1c3335['yWskE']);_0x19192e=JSON['parse'](_0x388d9b);}catch(_0x36416c){return console[_0x506cde(0x149)](_0x1c3335['aKKvA']),{'configured':![],'scope':_0x3ba888,'error':'Failed\x20to\x20read\x20opencode.json','details':_0x36416c};}const _0x20e4f4=Array['isArray'](_0x19192e['plugin'])?_0x19192e['plugin']:[];if(_0x20e4f4[_0x506cde(0x13b)](_0x2eb8d8))return console[_0x506cde(0x132)]('✓\x20OpenCode\x20plugin\x20already\x20configured'),{'configured':![],'scope':_0x3ba888};return _0x19192e[_0x506cde(0x134)]=_0x19192e[_0x506cde(0x134)]||_0x4d697c,_0x19192e['plugin']=[..._0x20e4f4,_0x2eb8d8],await _0x1c3335[_0x506cde(0x13f)](mkdir,_0x1c3335[_0x506cde(0x147)](getOpencodeConfigDir,_0x3ba888),{'recursive':!![]}),await _0x1c3335['JFegh'](writeFile,_0x2caecf,JSON[_0x506cde(0x137)](_0x19192e,null,0x2)+'\x0a'),console['log']('✓\x20OpenCode\x20plugin\x20configured'),{'configured':!![],'scope':_0x3ba888};}
@@ -1 +1 @@
1
- (function(_0x1b8e0a,_0x56014b){var _0x5b3213=_0x3158,_0x279393=_0x1b8e0a();while(!![]){try{var _0x5eb3bd=-parseInt(_0x5b3213(0x168))/0x1*(parseInt(_0x5b3213(0x16c))/0x2)+parseInt(_0x5b3213(0x162))/0x3*(parseInt(_0x5b3213(0x169))/0x4)+-parseInt(_0x5b3213(0x163))/0x5*(-parseInt(_0x5b3213(0x16a))/0x6)+-parseInt(_0x5b3213(0x16b))/0x7+parseInt(_0x5b3213(0x15e))/0x8+parseInt(_0x5b3213(0x15d))/0x9+parseInt(_0x5b3213(0x161))/0xa*(-parseInt(_0x5b3213(0x15c))/0xb);if(_0x5eb3bd===_0x56014b)break;else _0x279393['push'](_0x279393['shift']());}catch(_0x46494){_0x279393['push'](_0x279393['shift']());}}}(_0xd7c0,0xda4ab));function _0x3158(_0x34c556,_0x4d5f82){_0x34c556=_0x34c556-0x15c;var _0xd7c043=_0xd7c0();var _0x31588d=_0xd7c043[_0x34c556];return _0x31588d;}export async function setupCi(_0x129432,_0x354018,_0x48a920){var _0x53b6db=_0x3158,_0x241403={'VzvpY':function(_0x75c1b3,_0x1dca3c){return _0x75c1b3+_0x1dca3c;},'LbEwW':_0x53b6db(0x164),'WUiIa':'\x20\x20https://docs.ranger.net/main/concepts/profiles'};console[_0x53b6db(0x165)](_0x241403[_0x53b6db(0x15f)](_0x241403[_0x53b6db(0x15f)](_0x241403['VzvpY']('ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','\x0a')+'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a'+_0x241403['LbEwW'],'\x0a'),_0x53b6db(0x166))+_0x241403[_0x53b6db(0x167)]),process[_0x53b6db(0x160)](0x1);}function _0xd7c0(){var _0x40b233=['exit','343250mEuHRX','588972IoctmB','981880CkgMbe','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','error','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','WUiIa','4yOoLcZ','8HGXbKj','24otnxNZ','2744476yjBDOa','248662NsJNPC','781qpreHh','15436890IwFLkW','10617824FxPWpc','VzvpY'];_0xd7c0=function(){return _0x40b233;};return _0xd7c0();}
1
+ (function(_0x1b8115,_0x4699ae){var _0x2dd8a1=_0x47b5,_0x477a00=_0x1b8115();while(!![]){try{var _0xbbd491=-parseInt(_0x2dd8a1(0xac))/0x1+-parseInt(_0x2dd8a1(0xb1))/0x2*(-parseInt(_0x2dd8a1(0xb0))/0x3)+parseInt(_0x2dd8a1(0xad))/0x4+parseInt(_0x2dd8a1(0xb5))/0x5+parseInt(_0x2dd8a1(0xaf))/0x6+parseInt(_0x2dd8a1(0xb3))/0x7+parseInt(_0x2dd8a1(0xb2))/0x8;if(_0xbbd491===_0x4699ae)break;else _0x477a00['push'](_0x477a00['shift']());}catch(_0x2f5f92){_0x477a00['push'](_0x477a00['shift']());}}}(_0xcd02,0xbd2c1));function _0x47b5(_0x58b140,_0x71fcab){_0x58b140=_0x58b140-0xac;var _0xcd0244=_0xcd02();var _0x47b58a=_0xcd0244[_0x58b140];return _0x47b58a;}export async function setupCi(_0x3b3cdc,_0x16ef3f,_0x3c7ead){var _0x36a59b=_0x47b5,_0x4b85ea={'WFEfW':function(_0x4ceeeb,_0x37fe25){return _0x4ceeeb+_0x37fe25;},'JTSKh':function(_0x1cfbd0,_0x46837b){return _0x1cfbd0+_0x46837b;},'GYyWg':'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','nbaTv':'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','LYjNM':_0x36a59b(0xae),'VQDaK':'\x20\x20https://docs.ranger.net/main/concepts/profiles'};console['error'](_0x4b85ea['WFEfW'](_0x4b85ea[_0x36a59b(0xb6)](_0x4b85ea['JTSKh']('ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a'+'\x0a',_0x4b85ea['GYyWg']),_0x4b85ea['nbaTv']),'\x0a')+_0x4b85ea['LYjNM']+_0x4b85ea['VQDaK']),process[_0x36a59b(0xb4)](0x1);}function _0xcd02(){var _0x307eef=['For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','212298gmeQCK','3MpDPoD','34082rLYhHe','1347928RIcPQq','204491LfXMNc','exit','1287360vIKMDX','WFEfW','814192HfuJEJ','4325764tkezKh'];_0xcd02=function(){return _0x307eef;};return _0xcd02();}
@@ -1 +1 @@
1
- (function(_0x456d4d,_0x25ffec){const _0x2b14eb=_0x1dfe,_0x56c139=_0x456d4d();while(!![]){try{const _0xccec0e=parseInt(_0x2b14eb(0x92))/0x1*(-parseInt(_0x2b14eb(0x9c))/0x2)+-parseInt(_0x2b14eb(0xa1))/0x3+-parseInt(_0x2b14eb(0x9a))/0x4+parseInt(_0x2b14eb(0x90))/0x5*(-parseInt(_0x2b14eb(0x88))/0x6)+parseInt(_0x2b14eb(0xa4))/0x7*(parseInt(_0x2b14eb(0xa6))/0x8)+parseInt(_0x2b14eb(0xa9))/0x9+parseInt(_0x2b14eb(0xa2))/0xa;if(_0xccec0e===_0x25ffec)break;else _0x56c139['push'](_0x56c139['shift']());}catch(_0x215bd3){_0x56c139['push'](_0x56c139['shift']());}}}(_0x589e,0x214da));import{basename}from'path';import _0xa54cf7 from'inquirer';import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';function _0x1dfe(_0x34966c,_0x52edaf){_0x34966c=_0x34966c-0x85;const _0x589ea0=_0x589e();let _0x1dfed5=_0x589ea0[_0x34966c];return _0x1dfed5;}import{getCurrentVersion}from'./utils/version.js';function _0x589e(){const _0x571845=['147RxFiWa','rvNkY','1624gVvood','✓\x20Found\x20API\x20token','\x0a📦\x20Installing\x20skills...\x0a','660582OfFgYD','\x20\x20-\x20Open\x20Claude\x20Code\x20in\x20plan\x20mode\x20and\x20run\x20/ranger:enable.\x20Plan\x20out\x20a\x20UI\x20feature\x20with\x20Ranger\x20and\x20watch\x20Ranger\x20test\x20it\x20for\x20you!','project','list','To\x20use:','JkKXL','60HTtEWi','autoInstall','user','ranger','claude','warn','\x20<your-api-token>','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','78135kWPXXg','ritIB','9dWrhUG','/.claude/skills/','installLevel','All\x20projects\x20(','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','ErmTV','This\x20project\x20only\x20(','zUdJF','242728KPzRGn','\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','45844eBmbKe','\x20\x203.\x20Run:\x20ranger\x20skillup','/skills/','EjwPw','isTTY','306387JYtYal','5841280SlSbDe','log'];_0x589e=function(){return _0x571845;};return _0x589e();}import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x57e391={}){const _0x569720=_0x1dfe,_0x3cd20e={'BPoYQ':_0x569720(0x9b),'TdyTN':_0x569720(0x96),'QPtZk':_0x569720(0x8f),'EjwPw':'opencode','aigca':'\x20--opencode','soUdC':function(_0x286369){return _0x286369();},'dCLwn':_0x569720(0x94),'rvNkY':_0x569720(0x8a),'QcaXI':'project','JkKXL':function(_0x31beef){return _0x31beef();},'qTIsn':function(_0x5c8ffc,_0x534eb5,_0x513b14){return _0x5c8ffc(_0x534eb5,_0x513b14);},'ZhovU':_0x569720(0x8b),'wnfpW':function(_0x8f365a,_0x303396){return _0x8f365a>_0x303396;},'GWyIn':function(_0x54226d,_0x5d9d6e){return _0x54226d===_0x5d9d6e;},'ErmTV':'user-level','GRGdA':'project-level','soaiJ':_0x569720(0x86),'zUdJF':'\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','ritIB':_0x569720(0xaa)};console['log'](_0x3cd20e['BPoYQ']);const _0x5792d3=_0x57e391['platform']??_0x569720(0x8c),_0x1e6e11=await getToken();if(!_0x1e6e11){console['log'](_0x3cd20e['TdyTN']),console['log']('To\x20get\x20started:'),console['log'](_0x3cd20e['QPtZk']),console['log']('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0x5792d3===_0x3cd20e[_0x569720(0x9f)]?_0x3cd20e['aigca']:'')+_0x569720(0x8e)),console['log'](_0x569720(0x9d)+(_0x5792d3==='opencode'?'\x20--opencode':'')+'\x0a');return;}console[_0x569720(0xa3)](_0x569720(0xa7));const _0x2101d7=_0x3cd20e['soUdC'](getProjectRoot),_0x28b771=basename(_0x2101d7),_0x3d4c58=_0x5792d3===_0x3cd20e['EjwPw']?getOpencodeConfigDir('user')+'/skills/':getClaudeConfigDir()+_0x569720(0x9e),_0x5576b8=_0x5792d3==='opencode'?_0x2101d7+'/.opencode/skills/':_0x2101d7+_0x569720(0x93),_0x431a60=process['stdin']['isTTY']&&process['stdout'][_0x569720(0xa0)];let _0x16a113;if(_0x57e391['autoInstall'])_0x16a113=_0x57e391[_0x569720(0x89)];else{if(_0x431a60){const _0x30d4f3=await _0xa54cf7['prompt']([{'type':_0x569720(0x85),'name':_0x3cd20e['dCLwn'],'message':'Where\x20should\x20skills\x20be\x20installed?','choices':[{'name':_0x569720(0x95)+_0x3d4c58+')','value':_0x3cd20e[_0x569720(0xa5)]},{'name':_0x569720(0x98)+_0x5576b8+')','value':_0x569720(0xab)}]}]);_0x16a113=_0x30d4f3['installLevel'];}else _0x16a113=_0x3cd20e['QcaXI'],console['log']('Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20('+_0x5576b8+')');}let _0x1add0e=0x0;const _0x17e044=_0x3cd20e[_0x569720(0x87)](getCurrentVersion);console[_0x569720(0xa3)](_0x569720(0xa8));try{const _0x201c07=await _0x3cd20e['qTIsn'](installSkill,_0x3cd20e['ZhovU'],{'cliVersion':_0x17e044,'level':_0x16a113,'platform':_0x5792d3});_0x201c07&&_0x1add0e++;}catch(_0x2e0f9e){console[_0x569720(0x8d)]('\x20\x20Failed\x20to\x20install\x20ranger\x20skill:',_0x2e0f9e instanceof Error?_0x2e0f9e['message']:_0x2e0f9e);}if(_0x3cd20e['wnfpW'](_0x1add0e,0x0)){const _0x351a92=_0x3cd20e['GWyIn'](_0x16a113,'user')?_0x3cd20e[_0x569720(0x97)]:_0x3cd20e['GRGdA'];console[_0x569720(0xa3)]('\x0a✅\x20Installed\x20'+_0x1add0e+'\x20'+_0x351a92+'\x20skill'+(_0x1add0e>0x1?'s':'')+'\x20successfully!\x0a'),!_0x57e391['suppressUsage']&&(console[_0x569720(0xa3)](_0x3cd20e['soaiJ']),_0x5792d3==='opencode'?console[_0x569720(0xa3)](_0x3cd20e[_0x569720(0x99)]):console[_0x569720(0xa3)](_0x3cd20e[_0x569720(0x91)]));}else console[_0x569720(0xa3)]('\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a');}
1
+ (function(_0x372069,_0x38fe6a){const _0x1b8aac=_0x28e5,_0xb18f3e=_0x372069();while(!![]){try{const _0x327872=-parseInt(_0x1b8aac(0x125))/0x1+-parseInt(_0x1b8aac(0x128))/0x2*(parseInt(_0x1b8aac(0x137))/0x3)+-parseInt(_0x1b8aac(0x114))/0x4*(parseInt(_0x1b8aac(0x139))/0x5)+parseInt(_0x1b8aac(0x115))/0x6*(parseInt(_0x1b8aac(0x11c))/0x7)+-parseInt(_0x1b8aac(0x13a))/0x8+parseInt(_0x1b8aac(0x12c))/0x9+parseInt(_0x1b8aac(0x12e))/0xa;if(_0x327872===_0x38fe6a)break;else _0xb18f3e['push'](_0xb18f3e['shift']());}catch(_0x352bb6){_0xb18f3e['push'](_0xb18f3e['shift']());}}}(_0x3b3c,0x8d77c));import{basename}from'path';import _0x3fd048 from'inquirer';import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';function _0x3b3c(){const _0x434601=['\x20skill','343tKzlfR','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','user-level','suppressUsage','installLevel','MUjJn','\x20\x202.\x20Run:\x20ranger\x20setup','✓\x20Found\x20API\x20token','jLFIk','787166umXuaQ','log','isTTY','2whmDvR','cHyUO','stdout','\x20successfully!\x0a','3173157VgCRCR','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','23258620UqpndI','bYeuW','\x20<your-api-token>','\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!','\x20\x203.\x20Run:\x20ranger\x20skillup','opencode','user','/skills/','DcMdY','2090157zeRGPR','claude','1390hZIzun','1166072LdBLuL','This\x20project\x20only\x20(','11572QXoTeE','41010gsSqJV','FFfwH','CkXBA','list','\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a','\x20--opencode'];_0x3b3c=function(){return _0x434601;};return _0x3b3c();}function _0x28e5(_0x68d8f2,_0x11ed0f){_0x68d8f2=_0x68d8f2-0x114;const _0x3b3cb9=_0x3b3c();let _0x28e552=_0x3b3cb9[_0x68d8f2];return _0x28e552;}import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x307a26={}){const _0x571177=_0x28e5,_0x3f7cd8={'jLFIk':_0x571177(0x138),'FFfwH':'0|1|5|2|3|4','cHyUO':_0x571177(0x12d),'CkXBA':function(_0x1a7b06,_0x22b1ff){return _0x1a7b06===_0x22b1ff;},'PKQeB':_0x571177(0x133),'xmLbT':_0x571177(0x123),'MUjJn':function(_0x52e4ae,_0x185781){return _0x52e4ae(_0x185781);},'SrNtu':function(_0x127512,_0x50d06c){return _0x127512(_0x50d06c);},'RbJuh':'user','DcMdY':'Where\x20should\x20skills\x20be\x20installed?','edsvC':'project','VwICF':function(_0x3e2c6c,_0x2f0166,_0x380ce9){return _0x3e2c6c(_0x2f0166,_0x380ce9);},'VHNMs':_0x571177(0x11e),'bYeuW':'project-level','ihRkJ':'To\x20use:','dGYDF':_0x571177(0x131),'KCLUv':_0x571177(0x119)};console['log']('\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a');const _0x45a56e=_0x307a26['platform']??_0x3f7cd8[_0x571177(0x124)],_0x1af943=await getToken();if(!_0x1af943){const _0x1f83be=_0x3f7cd8[_0x571177(0x116)]['split']('|');let _0x1e41c8=0x0;while(!![]){switch(_0x1f83be[_0x1e41c8++]){case'0':console[_0x571177(0x126)](_0x3f7cd8[_0x571177(0x129)]);continue;case'1':console[_0x571177(0x126)]('To\x20get\x20started:');continue;case'2':console['log'](_0x571177(0x122)+(_0x3f7cd8['CkXBA'](_0x45a56e,_0x3f7cd8['PKQeB'])?_0x571177(0x11a):'')+_0x571177(0x130));continue;case'3':console[_0x571177(0x126)](_0x571177(0x132)+(_0x45a56e===_0x3f7cd8['PKQeB']?'\x20--opencode':'')+'\x0a');continue;case'4':return;case'5':console['log'](_0x571177(0x11d));continue;}break;}}console[_0x571177(0x126)](_0x3f7cd8['xmLbT']);const _0x2c4863=getProjectRoot(),_0x196c18=_0x3f7cd8[_0x571177(0x121)](basename,_0x2c4863),_0x2a49eb=_0x45a56e===_0x571177(0x133)?_0x3f7cd8['SrNtu'](getOpencodeConfigDir,_0x3f7cd8['RbJuh'])+'/skills/':getClaudeConfigDir()+_0x571177(0x135),_0x2f739a=_0x45a56e===_0x3f7cd8['PKQeB']?_0x2c4863+'/.opencode/skills/':_0x2c4863+'/.claude/skills/',_0x202101=process['stdin'][_0x571177(0x127)]&&process[_0x571177(0x12a)]['isTTY'];let _0x148e35;if(_0x307a26['autoInstall'])_0x148e35=_0x307a26['autoInstall'];else{if(_0x202101){const _0x4d3a5b=await _0x3fd048['prompt']([{'type':_0x571177(0x118),'name':_0x571177(0x120),'message':_0x3f7cd8[_0x571177(0x136)],'choices':[{'name':'All\x20projects\x20('+_0x2a49eb+')','value':_0x571177(0x134)},{'name':_0x571177(0x13b)+_0x2f739a+')','value':_0x3f7cd8['edsvC']}]}]);_0x148e35=_0x4d3a5b[_0x571177(0x120)];}else _0x148e35='project',console['log']('Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20('+_0x2f739a+')');}let _0x137517=0x0;const _0x4e855a=getCurrentVersion();console['log']('\x0a📦\x20Installing\x20skills...\x0a');try{const _0x2d55ac=await _0x3f7cd8['VwICF'](installSkill,'ranger',{'cliVersion':_0x4e855a,'level':_0x148e35,'platform':_0x45a56e});_0x2d55ac&&_0x137517++;}catch(_0x1cb000){console['warn']('\x20\x20Failed\x20to\x20install\x20ranger\x20skill:',_0x1cb000 instanceof Error?_0x1cb000['message']:_0x1cb000);}if(_0x137517>0x0){const _0x16e561=_0x148e35===_0x571177(0x134)?_0x3f7cd8['VHNMs']:_0x3f7cd8[_0x571177(0x12f)];console['log']('\x0a✅\x20Installed\x20'+_0x137517+'\x20'+_0x16e561+_0x571177(0x11b)+(_0x137517>0x1?'s':'')+_0x571177(0x12b)),!_0x307a26[_0x571177(0x11f)]&&(console['log'](_0x3f7cd8['ihRkJ']),_0x3f7cd8[_0x571177(0x117)](_0x45a56e,_0x3f7cd8['PKQeB'])?console['log']('\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.'):console[_0x571177(0x126)](_0x3f7cd8['dGYDF']));}else console[_0x571177(0x126)](_0x3f7cd8['KCLUv']);}
@@ -1 +1 @@
1
- const _0x4233d0=_0x3119;(function(_0x41b9ec,_0x596495){const _0x590c36=_0x3119,_0x404664=_0x41b9ec();while(!![]){try{const _0x36f9b9=parseInt(_0x590c36(0x109))/0x1*(-parseInt(_0x590c36(0xe7))/0x2)+parseInt(_0x590c36(0xda))/0x3+-parseInt(_0x590c36(0x101))/0x4*(parseInt(_0x590c36(0xfa))/0x5)+parseInt(_0x590c36(0xdd))/0x6+-parseInt(_0x590c36(0xd4))/0x7*(parseInt(_0x590c36(0xe1))/0x8)+parseInt(_0x590c36(0xfe))/0x9*(-parseInt(_0x590c36(0x10b))/0xa)+parseInt(_0x590c36(0xef))/0xb*(parseInt(_0x590c36(0xf7))/0xc);if(_0x36f9b9===_0x596495)break;else _0x404664['push'](_0x404664['shift']());}catch(_0x1c58bc){_0x404664['push'](_0x404664['shift']());}}}(_0x47d1,0xea79d));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x40213f from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';function _0x3119(_0x15c12e,_0x45c075){_0x15c12e=_0x15c12e-0xd4;const _0x47d138=_0x47d1();let _0x3119e6=_0x47d138[_0x15c12e];return _0x3119e6;}import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';function _0x47d1(){const _0x31b704=['\x0a✅\x20Ranger\x20setup\x20complete!\x0a','3461148yrLBPJ','RaYIk','ZoPvj','8373774mAoZih','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','trackPhaseEnd','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','244856hrnrzP','YtDfY','inherit','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','...','auth','290fFqkWx','mlPlZ','\x20is\x20no\x20longer\x20supported.\x20','user','ZbDQY','\x20\x20npx\x20playwright@','env','jFOdq','11356532MGcuDU','✓\x20Created\x20~/.ranger/\x20directory','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','.gitignore','\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','ZgOAQ','24JnmKPW','Installation\x20failed\x20with\x20exit\x20code\x20','ranger','25ylhUla','sLePp','organizationName','existing_token','3096tnmlqb','EzZdQ','RMcjA','787516jYCwxR','executablePath','Wwswi','fekXA','lCdsd','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','status','ranger\x20setup\x20--scope=','2239qgutSa','kyfRZ','34350DiPUQu','skipAuth','yyYBH','beUGl','\x20install\x20chromium','Pgnjj','ltLxN','allowInsecureLocalhost','profile','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','prompt','error','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','CKCjU','scope','success','log','IaPbN','qaOHR','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','VumGP','local','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','Validating\x20API\x20token...','stdin','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.','ready','skills','CjRwW','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','message','Authentication\x20failed:\x20','VIpFq','fBYny','EHvKW','skipped','confirm','RlcoH','\x20now?','1.58.2','trackPhaseStart','tzXXM','wQgIu','LsMbG','provided_token','url','chromium','win32','✓\x20Already\x20authenticated\x20to\x20','266fKreWW','fauFP','install','✓\x20Stored\x20credentials\x20locally','✓\x20Created\x20.ranger/.gitignore'];_0x47d1=function(){return _0x31b704;};return _0x47d1();}const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION=_0x4233d0(0x133);const bold=_0x202e19=>'\x1b[1m'+_0x202e19+'\x1b[0m';export function getPlaywrightVersion(){try{const _0x59832f=require['resolve']('playwright/package.json'),_0x127675=require(_0x59832f);return _0x127675['version'];}catch{return null;}}export function installChromiumBinary(_0x262c0a,_0xd8f99f=![]){const _0x4ceefd=_0x4233d0,_0x2fc4d5={'ZgOAQ':_0x4ceefd(0xd6),'ZEhcg':'--with-deps','ADXCU':'chromium','ltLxN':function(_0x3b3f41,_0x24d29a,_0x44f66d,_0x4987eb){return _0x3b3f41(_0x24d29a,_0x44f66d,_0x4987eb);},'tzXXM':'npx','fekXA':'inherit','crvBf':'close'};return new Promise((_0xaf4596,_0x218c14)=>{const _0x53686e=_0x4ceefd,_0x48d52c={'RaYIk':function(_0x38f821,_0x2dc450){return _0x38f821===_0x2dc450;}},_0x57597e=['playwright@'+_0x262c0a,_0x2fc4d5[_0x53686e(0xf6)],..._0xd8f99f?[_0x2fc4d5['ZEhcg']]:[],_0x2fc4d5['ADXCU']],_0x31fca5=_0x2fc4d5[_0x53686e(0x111)](spawn,_0x2fc4d5[_0x53686e(0x135)],_0x57597e,{'stdio':['ignore',_0x53686e(0xe3),_0x2fc4d5[_0x53686e(0x104)]],'shell':process['platform']===_0x53686e(0x13b)});_0x31fca5['on'](_0x2fc4d5['crvBf'],_0xce9baf=>{const _0x4947f5=_0x53686e;_0x48d52c[_0x4947f5(0xdb)](_0xce9baf,0x0)?_0xaf4596():_0x218c14(new Error(_0x4947f5(0xf8)+_0xce9baf));}),_0x31fca5['on'](_0x53686e(0x116),_0x4a8de7=>{_0x218c14(_0x4a8de7);});});}export async function authenticate(_0x10a1ab){const _0x2890f9=_0x4233d0,_0x476992={'pfXeO':function(_0x4e7a5d){return _0x4e7a5d();},'wQgIu':_0x2890f9(0xfd),'OnaPl':function(_0x23413f){return _0x23413f();},'fauFP':function(_0x3c8da3,_0x326328){return _0x3c8da3 instanceof _0x326328;},'gGFyB':'device_auth','jvALb':_0x2890f9(0xd7)};if(!_0x10a1ab){const _0x936409=await _0x476992['pfXeO'](getToken);if(_0x936409){const _0x1e55be=await getCurrentUser(_0x936409);if(_0x1e55be[_0x2890f9(0x11a)])return console['log'](_0x2890f9(0x13c)+_0x1e55be['user']['organizationName']),{'token':_0x936409,'method':_0x476992[_0x2890f9(0x136)]};}try{_0x10a1ab=await _0x476992['OnaPl'](runDeviceAuthFlow);}catch(_0x3a5696){throw new Error('Authentication\x20failed:\x20'+(_0x476992[_0x2890f9(0xd5)](_0x3a5696,Error)?_0x3a5696[_0x2890f9(0x12a)]:_0x3a5696));}const _0x554727=await getCurrentUser(_0x10a1ab);if(!_0x554727[_0x2890f9(0x11a)])throw new Error(_0x2890f9(0x11e)+_0x554727['error']);return console[_0x2890f9(0x11b)]('✓\x20Authenticated\x20to\x20'+_0x554727[_0x2890f9(0xea)][_0x2890f9(0xfc)]),{'token':_0x10a1ab,'method':_0x476992['gGFyB']};}console[_0x2890f9(0x11b)](_0x2890f9(0x122));const _0x526185=await getCurrentUser(_0x10a1ab);if(!_0x526185[_0x2890f9(0x11a)]){if(_0x526185[_0x2890f9(0x107)])throw new Error(_0x2890f9(0x12b)+_0x526185[_0x2890f9(0x116)]+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x526185['error']+_0x2890f9(0xf5));}return console[_0x2890f9(0x11b)]('✓\x20Authenticated\x20to\x20'+_0x526185['user'][_0x2890f9(0xfc)]),await storeToken(_0x10a1ab),console['log'](process[_0x2890f9(0xed)]['GITHUB_ENV']?'✓\x20Exported\x20credentials\x20for\x20CI':_0x476992['jvALb']),{'token':_0x10a1ab,'method':_0x2890f9(0x138)};}export async function ensureRangerDir(_0x283159){const _0x4d97d1=_0x4233d0,_0xe98d43={'CjRwW':function(_0x49a4a0){return _0x49a4a0();},'jFOdq':function(_0x49f304,_0x3109d9,_0x2ea12f){return _0x49f304(_0x3109d9,_0x2ea12f);},'VIpFq':_0x4d97d1(0xf0),'kAAqA':'✓\x20~/.ranger/\x20directory\x20already\x20exists'};void _0x283159;const _0x25a52b=_0xe98d43[_0x4d97d1(0x127)](getRangerHomeDir);return!existsSync(_0x25a52b)?(await _0xe98d43[_0x4d97d1(0xee)](mkdir,_0x25a52b,{'recursive':!![]}),console[_0x4d97d1(0x11b)](_0xe98d43[_0x4d97d1(0x12c)]),{'path':_0x25a52b,'installed':!![]}):(console['log'](_0xe98d43['kAAqA']),{'path':_0x25a52b,'installed':![]});}export async function ensureChromium(_0xdda4c0=![]){const _0x23b110=_0x4233d0,_0x582f16={'kyfRZ':function(_0x4fb62b,_0x1f8df1){return _0x4fb62b(_0x1f8df1);},'EHvKW':function(_0x146712){return _0x146712();},'VumGP':'install','AqLiH':'\x20(fallback\x20version)','RMcjA':_0x23b110(0xde),'LeKCd':'\x0a❌\x20Failed\x20to\x20install\x20Chromium:','IaPbN':'\x0a⚠\x20Skipping\x20Chromium\x20installation.','weium':'You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'};let _0xd4048a=![];try{const _0x430d92=chromium[_0x23b110(0x102)]();_0xd4048a=_0x582f16[_0x23b110(0x10a)](existsSync,_0x430d92);}catch{_0xd4048a=![];}if(_0xd4048a)return console[_0x23b110(0x11b)]('✓\x20Playwright\x20Chromium\x20browser\x20found'),![];const _0x3c80eb=_0x582f16[_0x23b110(0x12e)](getPlaywrightVersion),_0x37c59f=_0x3c80eb??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x42e299=!_0x3c80eb,_0x2b6606=process[_0x23b110(0x123)]['isTTY']&&process['stdout']['isTTY'];let _0x459c3d=!![];if(_0x2b6606){const {install:_0x49613f}=await _0x40213f[_0x23b110(0x115)]([{'type':_0x23b110(0x130),'name':_0x582f16[_0x23b110(0x11f)],'message':_0x42e299?_0x23b110(0xe0)+_0x37c59f+_0x23b110(0x132):'The\x20required\x20version\x20('+_0x37c59f+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x459c3d=_0x49613f;}else console['log']('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x37c59f+(_0x42e299?_0x582f16['AqLiH']:'')+_0x23b110(0xe5));if(_0x459c3d){console['log']('\x0aInstalling\x20Chromium\x20browser...\x0a');try{await installChromiumBinary(_0x37c59f,_0xdda4c0),console['log'](_0x582f16[_0x23b110(0x100)]);}catch(_0x200c9a){console['error'](_0x582f16['LeKCd'],_0x200c9a instanceof Error?_0x200c9a['message']:_0x200c9a),console[_0x23b110(0x11b)]('You\x20can\x20install\x20it\x20manually\x20by\x20running:'),console[_0x23b110(0x11b)]('\x20\x20npx\x20playwright@'+_0x37c59f+_0x23b110(0x10f));}}else console[_0x23b110(0x11b)](_0x582f16[_0x23b110(0x11c)]),console['log'](_0x582f16['weium']),console[_0x23b110(0x11b)](_0x23b110(0xec)+_0x37c59f+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x150621){const _0x563210=_0x4233d0,_0x1af831={'EzZdQ':_0x563210(0xd8)},_0x520010=join(_0x150621,_0x563210(0xf3)),_0x150960='\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(_0x520010,_0x150960),console[_0x563210(0x11b)](_0x1af831[_0x563210(0xff)]);}export async function ensureLocalEnv(_0x3a896f,_0x5746a7){const _0x4f73c4=_0x4233d0,_0x212cf0={'CfHvE':function(_0x2bc60d){return _0x2bc60d();},'kCDpI':'⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','lCdsd':'local','wwsxR':'\x0a❌\x20Profile\x20setup\x20failed:','LsMbG':function(_0x4ea3b3,_0x39471f){return _0x4ea3b3 instanceof _0x39471f;}};if(!_0x212cf0['CfHvE'](findGitRoot)&&_0x3a896f?.[_0x4f73c4(0x119)]!=='user')return console[_0x4f73c4(0x11b)](_0x212cf0['kCDpI']),{'ready':![],'skipped':!![]};const _0x484d6d=_0x3a896f?.[_0x4f73c4(0x119)]===_0x4f73c4(0xea)?getRangerHomeDir():undefined;if(findExistingEnv(_0x4f73c4(0x120),{'locations':[_0x4f73c4(0x120)],'rangerDir':_0x484d6d}))return console['log']('✓\x20Local\x20profile\x20already\x20exists'),{'ready':!![],'skipped':![]};try{return await addEnv(_0x212cf0[_0x4f73c4(0x105)],{'url':_0x3a896f?.[_0x4f73c4(0x139)],'force':_0x3a896f?.['force'],'allowInsecureLocalhost':_0x3a896f?.[_0x4f73c4(0x112)],'scope':_0x3a896f?.['scope']},_0x5746a7),{'ready':!![],'skipped':![]};}catch(_0xa8864d){return console['error'](_0x212cf0['wwsxR'],_0x212cf0[_0x4f73c4(0x137)](_0xa8864d,Error)?_0xa8864d[_0x4f73c4(0x12a)]:_0xa8864d),{'ready':![],'skipped':![]};}}export async function start(_0x6d918a,_0x1582b8,_0x3f6be8){const _0x160e31=_0x4233d0,_0x32637d={'beUGl':'\x0a🚀\x20Ranger\x20Setup\x0a','yyYBH':function(_0x1f58f8,_0x485d2f){return _0x1f58f8!==_0x485d2f;},'CKCjU':function(_0x516ed3,_0x318841){return _0x516ed3!==_0x318841;},'YtDfY':function(_0x39e7c2,_0x3d39ff){return _0x39e7c2+_0x3d39ff;},'ZbDQY':_0x160e31(0xea),'fBYny':'✓\x20Skipping\x20authentication\x20(--skip-auth)','Wwswi':'auth','Pgnjj':_0x160e31(0xf2),'sLePp':function(_0x4c2d06,_0x591a2d){return _0x4c2d06(_0x591a2d);},'uKXox':_0x160e31(0xd9),'ZoPvj':'plugin','iANOK':function(_0x79ecea,_0x354a24){return _0x79ecea&&_0x354a24;},'XbQif':function(_0xb99f4,_0xab13e6,_0x514d7f){return _0xb99f4(_0xab13e6,_0x514d7f);},'qInAI':function(_0x5d3816){return _0x5d3816();},'QcApT':'opencode','RlcoH':_0x160e31(0x126),'mlPlZ':_0x160e31(0x128),'qaOHR':function(_0x3fe0d5,_0x5116d3){return _0x3fe0d5 instanceof _0x5116d3;},'VZhxp':function(_0x419087,_0x3a11e4){return _0x419087+_0x3a11e4;},'dQbHL':function(_0x55aa9f,_0x49055c){return _0x55aa9f+_0x49055c;},'HPaSI':function(_0x503f63,_0x32df1c){return _0x503f63+_0x32df1c;},'riRHV':function(_0x4eabf1,_0x3be45a){return _0x4eabf1+_0x3be45a;},'OYNzn':'ranger\x20profile\x20add\x20<name>','Gzaty':_0x160e31(0x114),'PmXpG':'and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','gBmMr':'/ranger:enable'};console['log'](_0x32637d[_0x160e31(0x10e)]);_0x32637d[_0x160e31(0x10d)](_0x1582b8?.['scope'],undefined)&&_0x32637d[_0x160e31(0x118)](_0x1582b8[_0x160e31(0x119)],'user')&&(console[_0x160e31(0x116)](_0x32637d['YtDfY'](_0x160e31(0x108)+String(_0x1582b8[_0x160e31(0x119)])+_0x160e31(0xe9)+_0x160e31(0x121),_0x160e31(0x124))),process['exit'](0x1));_0x1582b8={..._0x1582b8,'scope':_0x32637d[_0x160e31(0xeb)]};const _0x1cc3ef=!existsSync(getRangerHomeDir());await ensureRangerDir(_0x32637d['ZbDQY']);if(_0x1582b8?.[_0x160e31(0x10c)])console['log'](_0x32637d[_0x160e31(0x12d)]),_0x3f6be8?.[_0x160e31(0xdf)](_0x160e31(0xe6),{'isFirstRun':_0x1cc3ef,'method':_0x160e31(0x12f)});else{_0x3f6be8?.[_0x160e31(0x134)](_0x32637d[_0x160e31(0x103)]);const _0x50655e=await authenticate(_0x6d918a);_0x3f6be8?.[_0x160e31(0xdf)](_0x160e31(0xe6),{'isFirstRun':_0x1cc3ef,'method':_0x50655e['method']});}_0x3f6be8?.[_0x160e31(0x134)](_0x160e31(0x13a));_0x1582b8?.['skipChromium']?console['log'](_0x32637d[_0x160e31(0x110)]):await _0x32637d[_0x160e31(0xfb)](ensureChromium,_0x1582b8?.['withDeps']);_0x3f6be8?.[_0x160e31(0xdf)](_0x160e31(0x13a),{'isFirstRun':_0x1cc3ef,'skipped':!!_0x1582b8?.['skipChromium']}),console['log'](_0x32637d['uKXox']);const _0x57dded=_0x1582b8?.['scope'],_0x6c488f=_0x1582b8?.['opencode']??![];let _0x34cd1e=null;_0x6c488f?(_0x3f6be8?.[_0x160e31(0x134)]('plugin'),_0x34cd1e=await _0x32637d[_0x160e31(0xfb)](ensureOpencodePluginConfig,_0x57dded),_0x3f6be8?.['trackPhaseEnd'](_0x32637d[_0x160e31(0xdc)],{'isFirstRun':_0x1cc3ef,'opencode':!![]})):(_0x3f6be8?.[_0x160e31(0x134)](_0x32637d['ZoPvj']),await _0x32637d[_0x160e31(0xfb)](ensureClaudePlugin,_0x57dded),_0x3f6be8?.['trackPhaseEnd'](_0x32637d['ZoPvj'],{'isFirstRun':_0x1cc3ef}));if(_0x32637d['iANOK'](_0x6c488f,_0x34cd1e)){_0x3f6be8?.[_0x160e31(0x134)](_0x160e31(0x126));try{await _0x32637d['XbQif'](installSkill,_0x160e31(0xf9),{'level':_0x34cd1e[_0x160e31(0x119)],'cliVersion':_0x32637d['qInAI'](getCurrentVersion),'platform':_0x32637d['QcApT']}),_0x3f6be8?.[_0x160e31(0xdf)](_0x32637d['RlcoH'],{'isFirstRun':_0x1cc3ef,'opencode':!![]});}catch(_0x53bba1){console['warn'](_0x32637d[_0x160e31(0xe8)],_0x32637d[_0x160e31(0x11d)](_0x53bba1,Error)?_0x53bba1['message']:_0x53bba1),_0x3f6be8?.['trackPhaseEnd'](_0x32637d[_0x160e31(0x131)],{'isFirstRun':_0x1cc3ef,'opencode':!![],'failed':!![]});}}else _0x3f6be8?.[_0x160e31(0x134)](_0x32637d[_0x160e31(0x131)]),await _0x32637d['sLePp'](ensureClaudeSkills,_0x57dded),_0x3f6be8?.['trackPhaseEnd']('skills',{'isFirstRun':_0x1cc3ef});if(_0x1582b8?.[_0x160e31(0x10c)])console['log']('\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a');else{if(_0x1582b8?.[_0x160e31(0x139)]){_0x3f6be8?.[_0x160e31(0x134)](_0x160e31(0x113));const _0x13f168=await ensureLocalEnv({'url':_0x1582b8['url'],'force':_0x1582b8?.['force'],'allowInsecureLocalhost':_0x1582b8?.[_0x160e31(0x112)],'scope':'user'},_0x3f6be8);_0x3f6be8?.['trackPhaseEnd'](_0x160e31(0x113),{'isFirstRun':_0x1cc3ef,'profileReady':_0x13f168[_0x160e31(0x125)],'userSkipped':_0x13f168['skipped']});}else console['log'](_0x32637d['VZhxp'](_0x32637d['dQbHL'](_0x32637d['HPaSI'](_0x32637d['riRHV'](_0x160e31(0x129),'\x0a\x20\x20'+_0x32637d['sLePp'](bold,_0x32637d['OYNzn'])),_0x160e31(0xf4)),'\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:'),_0x160e31(0x106)));}if(_0x6c488f)console['log'](_0x32637d['Gzaty']),console[_0x160e31(0x11b)](_0x32637d['PmXpG']),console['log']('with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'),console['log'](_0x160e31(0xf1));else{const _0x3d8855=_0x32637d['sLePp'](bold,_0x32637d['gBmMr']);console['log'](_0x32637d[_0x160e31(0xe2)]('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x3d8855+'\x20and\x20prompt\x20the\x20coding'+_0x160e31(0xe4)+_0x160e31(0x117),'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.'));}}
1
+ (function(_0x5c6b56,_0x51afa3){const _0x334250=_0x2ba3,_0x461e51=_0x5c6b56();while(!![]){try{const _0x17e0f6=-parseInt(_0x334250(0x144))/0x1+parseInt(_0x334250(0x16b))/0x2*(-parseInt(_0x334250(0x171))/0x3)+-parseInt(_0x334250(0x136))/0x4*(-parseInt(_0x334250(0x11d))/0x5)+-parseInt(_0x334250(0x161))/0x6*(parseInt(_0x334250(0x16a))/0x7)+-parseInt(_0x334250(0x169))/0x8+-parseInt(_0x334250(0x185))/0x9*(parseInt(_0x334250(0x13f))/0xa)+-parseInt(_0x334250(0x126))/0xb*(-parseInt(_0x334250(0x15b))/0xc);if(_0x17e0f6===_0x51afa3)break;else _0x461e51['push'](_0x461e51['shift']());}catch(_0x9ecbf1){_0x461e51['push'](_0x461e51['shift']());}}}(_0x3d81,0xa5bb7));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x45298d from'inquirer';function _0x3d81(){const _0x18cc07=['WpJUX','win32','✓\x20Already\x20authenticated\x20to\x20','590nVpMgI','url','\x0a⚠\x20Skipping\x20Chromium\x20installation.','✓\x20Authenticated\x20to\x20','\x20install\x20chromium','599564RWIGAk','trackPhaseEnd','user','message','JwVTU','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','ranger\x20setup\x20--scope=','prompt','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','trackPhaseStart','\x0a🚀\x20Ranger\x20Setup\x0a','GITHUB_ENV','ready','executablePath','status','confirm','fAwhF','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','log','auth','nUfsy','38015004FOMCYA','isTTY','ByUuv','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','organizationName','close','18udXzGP','mYhCj','✓\x20Exported\x20credentials\x20for\x20CI','skills','success','PsJLK','playwright/package.json','iJYpr','2725680dejkpT','1522108GJILqz','416178PdBcTQ','allowInsecureLocalhost','hjxKQ','.gitignore','CgnGQ','install','18xbMqKi','error','profile','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','OAvux','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','skipAuth','PwRfz','FAkQm','jbGor','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.','NxEQC','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','local','The\x20required\x20version\x20(','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','yIGmv','81333ARCmMN','235RMrmGg','jfxQY','warn','\x0a❌\x20Profile\x20setup\x20failed:','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','Authentication\x20failed:\x20','SjcGu','VIQLW','nNmDQ','11gCiqXw','Installation\x20failed\x20with\x20exit\x20code\x20','chromium','version','skipped','scope','Pshsf','stdin','\x0aIn\x20Claude\x20Code,\x20run\x20','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','sLLnA','\x0aInstalling\x20Chromium\x20browser...\x0a','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','device_auth','BgBqR','force','75340ONQVfZ','env','tFmho','XhOYm','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','/ranger:enable'];_0x3d81=function(){return _0x18cc07;};return _0x3d81();}import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.58.2';const bold=_0x7f74a5=>'\x1b[1m'+_0x7f74a5+'\x1b[0m';export function getPlaywrightVersion(){const _0x2c0ba9=_0x2ba3,_0x2e1d15={'CgnGQ':_0x2c0ba9(0x167)};try{const _0x13e790=require['resolve'](_0x2e1d15[_0x2c0ba9(0x16f)]),_0x4a2f52=require(_0x13e790);return _0x4a2f52[_0x2c0ba9(0x129)];}catch{return null;}}export function installChromiumBinary(_0x4112eb,_0x3fe116=![]){const _0x2896a0=_0x2ba3,_0x3381b5={'EDomT':_0x2896a0(0x128),'Pshsf':function(_0x25f9a2,_0x4dfe76,_0x4a616c,_0x52cdbd){return _0x25f9a2(_0x4dfe76,_0x4a616c,_0x52cdbd);},'EuSJw':'ignore','EwLDz':'inherit','NVBmA':_0x2896a0(0x160)};return new Promise((_0x4df683,_0x23d496)=>{const _0x3f1f07=_0x2896a0,_0x2fd40c={'PeVbz':function(_0x4b5e5f){return _0x4b5e5f();}},_0x1092d2=['playwright@'+_0x4112eb,_0x3f1f07(0x170),..._0x3fe116?['--with-deps']:[],_0x3381b5['EDomT']],_0x188394=_0x3381b5[_0x3f1f07(0x12c)](spawn,'npx',_0x1092d2,{'stdio':[_0x3381b5['EuSJw'],'inherit',_0x3381b5['EwLDz']],'shell':process['platform']===_0x3f1f07(0x13d)});_0x188394['on'](_0x3381b5['NVBmA'],_0x1a6fb6=>{const _0x478fd7=_0x3f1f07;_0x1a6fb6===0x0?_0x2fd40c['PeVbz'](_0x4df683):_0x23d496(new Error(_0x478fd7(0x127)+_0x1a6fb6));}),_0x188394['on'](_0x3f1f07(0x172),_0x4cfee6=>{_0x23d496(_0x4cfee6);});});}export async function authenticate(_0x248804){const _0x5362c9=_0x2ba3,_0x188168={'yIGmv':function(_0x578855){return _0x578855();},'NiACz':function(_0x16eb0a,_0x381c35){return _0x16eb0a(_0x381c35);},'fdcGp':'existing_token','nUfsy':function(_0x39276e,_0x17c128){return _0x39276e instanceof _0x17c128;},'YyqTp':'Validating\x20API\x20token...','ByUuv':function(_0x4685fb,_0x95c23b){return _0x4685fb(_0x95c23b);},'iJYpr':'provided_token'};if(!_0x248804){const _0x5b87c8=await _0x188168[_0x5362c9(0x184)](getToken);if(_0x5b87c8){const _0x4a80ca=await _0x188168['NiACz'](getCurrentUser,_0x5b87c8);if(_0x4a80ca[_0x5362c9(0x165)])return console[_0x5362c9(0x158)](_0x5362c9(0x13e)+_0x4a80ca['user'][_0x5362c9(0x15f)]),{'token':_0x5b87c8,'method':_0x188168['fdcGp']};}try{_0x248804=await runDeviceAuthFlow();}catch(_0xf93638){throw new Error(_0x5362c9(0x122)+(_0x188168[_0x5362c9(0x15a)](_0xf93638,Error)?_0xf93638[_0x5362c9(0x147)]:_0xf93638));}const _0x369b5e=await getCurrentUser(_0x248804);if(!_0x369b5e['success'])throw new Error(_0x5362c9(0x174)+_0x369b5e[_0x5362c9(0x172)]);return console[_0x5362c9(0x158)](_0x5362c9(0x142)+_0x369b5e[_0x5362c9(0x146)]['organizationName']),{'token':_0x248804,'method':_0x5362c9(0x133)};}console['log'](_0x188168['YyqTp']);const _0x32eba7=await _0x188168[_0x5362c9(0x15d)](getCurrentUser,_0x248804);if(!_0x32eba7[_0x5362c9(0x165)]){if(_0x32eba7[_0x5362c9(0x154)])throw new Error(_0x5362c9(0x122)+_0x32eba7['error']+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x32eba7[_0x5362c9(0x172)]+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console[_0x5362c9(0x158)]('✓\x20Authenticated\x20to\x20'+_0x32eba7['user'][_0x5362c9(0x15f)]),await storeToken(_0x248804),console['log'](process[_0x5362c9(0x137)][_0x5362c9(0x151)]?_0x5362c9(0x163):'✓\x20Stored\x20credentials\x20locally'),{'token':_0x248804,'method':_0x188168[_0x5362c9(0x168)]};}export async function ensureRangerDir(_0x2b4cad){const _0x5a2886=_0x2ba3,_0x41694b={'znLPc':function(_0x5c5858,_0x422571){return _0x5c5858(_0x422571);},'sLLnA':function(_0x35fb42,_0x440373,_0x30fe16){return _0x35fb42(_0x440373,_0x30fe16);},'PwRfz':'✓\x20Created\x20~/.ranger/\x20directory','mYhCj':'✓\x20~/.ranger/\x20directory\x20already\x20exists'};void _0x2b4cad;const _0x2bfadd=getRangerHomeDir();return!_0x41694b['znLPc'](existsSync,_0x2bfadd)?(await _0x41694b[_0x5a2886(0x130)](mkdir,_0x2bfadd,{'recursive':!![]}),console[_0x5a2886(0x158)](_0x41694b[_0x5a2886(0x178)]),{'path':_0x2bfadd,'installed':!![]}):(console['log'](_0x41694b[_0x5a2886(0x162)]),{'path':_0x2bfadd,'installed':![]});}export async function ensureChromium(_0x14641c=![]){const _0x36ad7e=_0x2ba3,_0x2b0d9b={'nNmDQ':function(_0x13d8f3){return _0x13d8f3();},'FAkQm':_0x36ad7e(0x155),'xtonT':_0x36ad7e(0x170),'XhOYm':_0x36ad7e(0x121),'BgBqR':_0x36ad7e(0x15e),'jbGor':function(_0x448685,_0x16b1b9){return _0x448685 instanceof _0x16b1b9;}};let _0x5a492d=![];try{const _0x2b92c7=chromium[_0x36ad7e(0x153)]();_0x5a492d=existsSync(_0x2b92c7);}catch{_0x5a492d=![];}if(_0x5a492d)return console['log']('✓\x20Playwright\x20Chromium\x20browser\x20found'),![];const _0x4b7306=_0x2b0d9b[_0x36ad7e(0x125)](getPlaywrightVersion),_0xcb614d=_0x4b7306??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x107244=!_0x4b7306,_0x163fef=process[_0x36ad7e(0x12d)][_0x36ad7e(0x15c)]&&process['stdout']['isTTY'];let _0x3d3fd1=!![];if(_0x163fef){const {install:_0xdad447}=await _0x45298d[_0x36ad7e(0x14b)]([{'type':_0x2b0d9b[_0x36ad7e(0x179)],'name':_0x2b0d9b['xtonT'],'message':_0x107244?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0xcb614d+'\x20now?':_0x36ad7e(0x180)+_0xcb614d+_0x36ad7e(0x17e),'default':!![]}]);_0x3d3fd1=_0xdad447;}else console['log']('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0xcb614d+(_0x107244?'\x20(fallback\x20version)':'')+'...');if(_0x3d3fd1){console[_0x36ad7e(0x158)](_0x36ad7e(0x131));try{await installChromiumBinary(_0xcb614d,_0x14641c),console[_0x36ad7e(0x158)](_0x2b0d9b[_0x36ad7e(0x139)]);}catch(_0x243efc){console['error'](_0x2b0d9b[_0x36ad7e(0x134)],_0x2b0d9b[_0x36ad7e(0x17a)](_0x243efc,Error)?_0x243efc['message']:_0x243efc),console['log']('You\x20can\x20install\x20it\x20manually\x20by\x20running:'),console['log']('\x20\x20npx\x20playwright@'+_0xcb614d+_0x36ad7e(0x143));}}else console[_0x36ad7e(0x158)](_0x36ad7e(0x141)),console[_0x36ad7e(0x158)](_0x36ad7e(0x13a)),console['log']('\x20\x20npx\x20playwright@'+_0xcb614d+_0x36ad7e(0x143));return!![];}export async function writeRangerGitignore(_0x2a8053){const _0x1efb94=_0x2ba3,_0x313e6e=join(_0x2a8053,_0x1efb94(0x16e)),_0x316095='\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(_0x313e6e,_0x316095),console['log']('✓\x20Created\x20.ranger/.gitignore');}export async function ensureLocalEnv(_0x32c6fa,_0x46dbc5){const _0x457ba4=_0x2ba3,_0x1af2f2={'zYrvU':_0x457ba4(0x146),'rsZBG':_0x457ba4(0x14e),'GKCrV':function(_0x588491,_0x1ec8df){return _0x588491===_0x1ec8df;},'zLEhT':'✓\x20Local\x20profile\x20already\x20exists','xvWbf':function(_0x2a2b32,_0x392459,_0x19568c,_0x272dfe){return _0x2a2b32(_0x392459,_0x19568c,_0x272dfe);},'pUuNS':_0x457ba4(0x120)};if(!findGitRoot()&&_0x32c6fa?.[_0x457ba4(0x12b)]!==_0x1af2f2['zYrvU'])return console['log'](_0x1af2f2['rsZBG']),{'ready':![],'skipped':!![]};const _0x232b85=_0x1af2f2['GKCrV'](_0x32c6fa?.['scope'],'user')?getRangerHomeDir():undefined;if(findExistingEnv(_0x457ba4(0x17f),{'locations':['local'],'rangerDir':_0x232b85}))return console[_0x457ba4(0x158)](_0x1af2f2['zLEhT']),{'ready':!![],'skipped':![]};try{return await _0x1af2f2['xvWbf'](addEnv,_0x457ba4(0x17f),{'url':_0x32c6fa?.['url'],'force':_0x32c6fa?.[_0x457ba4(0x135)],'allowInsecureLocalhost':_0x32c6fa?.['allowInsecureLocalhost'],'scope':_0x32c6fa?.[_0x457ba4(0x12b)]},_0x46dbc5),{'ready':!![],'skipped':![]};}catch(_0x48e567){return console['error'](_0x1af2f2['pUuNS'],_0x48e567 instanceof Error?_0x48e567['message']:_0x48e567),{'ready':![],'skipped':![]};}}function _0x2ba3(_0x48c5f7,_0x1b9c99){_0x48c5f7=_0x48c5f7-0x11d;const _0x3d81e1=_0x3d81();let _0x2ba3f0=_0x3d81e1[_0x48c5f7];return _0x2ba3f0;}export async function start(_0x4a3221,_0x53fdc3,_0x54023d){const _0x27c102=_0x2ba3,_0x2720fe={'VIQLW':function(_0x413975,_0x26a650){return _0x413975!==_0x26a650;},'JwVTU':_0x27c102(0x146),'PsJLK':function(_0x5ff564,_0x381ff1){return _0x5ff564(_0x381ff1);},'tFmho':'✓\x20Skipping\x20authentication\x20(--skip-auth)','qjZRN':_0x27c102(0x159),'odDXB':'chromium','lfrjs':'\x0a✅\x20Ranger\x20setup\x20complete!\x0a','yGeiD':'plugin','WpJUX':function(_0x4051a2,_0xa6eb52){return _0x4051a2(_0xa6eb52);},'hjxKQ':function(_0x3e2012,_0x2298e0){return _0x3e2012&&_0x2298e0;},'SjcGu':function(_0x5de414,_0x5cffeb,_0x44a7b4){return _0x5de414(_0x5cffeb,_0x44a7b4);},'NxEQC':function(_0x4ddd75){return _0x4ddd75();},'OAvux':function(_0x3e82d5,_0x73b5a2){return _0x3e82d5 instanceof _0x73b5a2;},'jfxQY':_0x27c102(0x164),'AvnPx':function(_0x2d9eea,_0x3a6e7b){return _0x2d9eea+_0x3a6e7b;},'eZPXG':_0x27c102(0x12f),'fAwhF':function(_0x1f6d2d,_0x5327b0){return _0x1f6d2d(_0x5327b0);}};console[_0x27c102(0x158)](_0x27c102(0x150));_0x2720fe[_0x27c102(0x124)](_0x53fdc3?.['scope'],undefined)&&_0x53fdc3['scope']!==_0x2720fe['JwVTU']&&(console['error'](_0x27c102(0x14a)+String(_0x53fdc3['scope'])+'\x20is\x20no\x20longer\x20supported.\x20'+_0x27c102(0x157)+_0x27c102(0x17b)),process['exit'](0x1));_0x53fdc3={..._0x53fdc3,'scope':_0x27c102(0x146)};const _0x68047a=!existsSync(getRangerHomeDir());await _0x2720fe[_0x27c102(0x166)](ensureRangerDir,_0x2720fe[_0x27c102(0x148)]);if(_0x53fdc3?.[_0x27c102(0x177)])console[_0x27c102(0x158)](_0x2720fe[_0x27c102(0x138)]),_0x54023d?.[_0x27c102(0x145)](_0x2720fe['qjZRN'],{'isFirstRun':_0x68047a,'method':_0x27c102(0x12a)});else{_0x54023d?.[_0x27c102(0x14f)]('auth');const _0xb50e03=await _0x2720fe['PsJLK'](authenticate,_0x4a3221);_0x54023d?.['trackPhaseEnd'](_0x27c102(0x159),{'isFirstRun':_0x68047a,'method':_0xb50e03['method']});}_0x54023d?.[_0x27c102(0x14f)](_0x27c102(0x128));_0x53fdc3?.['skipChromium']?console['log'](_0x27c102(0x181)):await _0x2720fe['PsJLK'](ensureChromium,_0x53fdc3?.['withDeps']);_0x54023d?.['trackPhaseEnd'](_0x2720fe['odDXB'],{'isFirstRun':_0x68047a,'skipped':!!_0x53fdc3?.['skipChromium']}),console['log'](_0x2720fe['lfrjs']);const _0x5cf09b=_0x53fdc3?.['scope'],_0x49feb5=_0x53fdc3?.['opencode']??![];let _0x168806=null;_0x49feb5?(_0x54023d?.[_0x27c102(0x14f)]('plugin'),_0x168806=await ensureOpencodePluginConfig(_0x5cf09b),_0x54023d?.[_0x27c102(0x145)](_0x2720fe['yGeiD'],{'isFirstRun':_0x68047a,'opencode':!![]})):(_0x54023d?.[_0x27c102(0x14f)](_0x2720fe['yGeiD']),await _0x2720fe[_0x27c102(0x13c)](ensureClaudePlugin,_0x5cf09b),_0x54023d?.[_0x27c102(0x145)]('plugin',{'isFirstRun':_0x68047a}));if(_0x2720fe[_0x27c102(0x16d)](_0x49feb5,_0x168806)){_0x54023d?.[_0x27c102(0x14f)]('skills');try{await _0x2720fe[_0x27c102(0x123)](installSkill,'ranger',{'level':_0x168806['scope'],'cliVersion':_0x2720fe[_0x27c102(0x17c)](getCurrentVersion),'platform':'opencode'}),_0x54023d?.[_0x27c102(0x145)](_0x27c102(0x164),{'isFirstRun':_0x68047a,'opencode':!![]});}catch(_0x5ca760){console[_0x27c102(0x11f)](_0x27c102(0x132),_0x2720fe[_0x27c102(0x175)](_0x5ca760,Error)?_0x5ca760['message']:_0x5ca760),_0x54023d?.['trackPhaseEnd'](_0x27c102(0x164),{'isFirstRun':_0x68047a,'opencode':!![],'failed':!![]});}}else _0x54023d?.['trackPhaseStart']('skills'),await ensureClaudeSkills(_0x5cf09b),_0x54023d?.[_0x27c102(0x145)](_0x2720fe[_0x27c102(0x11e)],{'isFirstRun':_0x68047a});if(_0x53fdc3?.['skipAuth'])console['log'](_0x27c102(0x176));else{if(_0x53fdc3?.['url']){_0x54023d?.[_0x27c102(0x14f)]('profile');const _0x1702f5=await ensureLocalEnv({'url':_0x53fdc3[_0x27c102(0x140)],'force':_0x53fdc3?.[_0x27c102(0x135)],'allowInsecureLocalhost':_0x53fdc3?.[_0x27c102(0x16c)],'scope':_0x27c102(0x146)},_0x54023d);_0x54023d?.[_0x27c102(0x145)](_0x27c102(0x173),{'isFirstRun':_0x68047a,'profileReady':_0x1702f5[_0x27c102(0x152)],'userSkipped':_0x1702f5[_0x27c102(0x12a)]});}else console['log'](_0x2720fe['AvnPx'](_0x2720fe['AvnPx']('\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','\x0a\x20\x20'+bold('ranger\x20profile\x20add\x20<name>'))+'\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:')+_0x27c102(0x182));}if(_0x49feb5)console['log'](_0x2720fe['eZPXG']),console[_0x27c102(0x158)](_0x27c102(0x17d)),console['log'](_0x27c102(0x149)),console['log'](_0x27c102(0x14d));else{const _0x409c3f=_0x2720fe[_0x27c102(0x156)](bold,_0x27c102(0x13b));console[_0x27c102(0x158)](_0x27c102(0x12e)+_0x409c3f+'\x20and\x20prompt\x20the\x20coding'+'\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with'+_0x27c102(0x183)+_0x27c102(0x14c));}}
@@ -1 +1 @@
1
- const _0x21aeca=_0x3a2f;(function(_0x49b994,_0x472c5f){const _0x1c07c0=_0x3a2f,_0x558d33=_0x49b994();while(!![]){try{const _0x311042=parseInt(_0x1c07c0(0xf4))/0x1+-parseInt(_0x1c07c0(0x10a))/0x2+-parseInt(_0x1c07c0(0xad))/0x3+parseInt(_0x1c07c0(0xbe))/0x4*(parseInt(_0x1c07c0(0xc0))/0x5)+-parseInt(_0x1c07c0(0xbd))/0x6+parseInt(_0x1c07c0(0xfd))/0x7+parseInt(_0x1c07c0(0xd7))/0x8*(parseInt(_0x1c07c0(0xd6))/0x9);if(_0x311042===_0x472c5f)break;else _0x558d33['push'](_0x558d33['shift']());}catch(_0x326c31){_0x558d33['push'](_0x558d33['shift']());}}}(_0x1a17,0x26983));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';function _0x3a2f(_0x44dfbc,_0x43d437){_0x44dfbc=_0x44dfbc-0x9e;const _0x1a1728=_0x1a17();let _0x3a2fb3=_0x1a1728[_0x44dfbc];return _0x3a2fb3;}function _0x1a17(){const _0x36b762=['vJCAk','data','DEBUG','No\x20profiles\x20configured','has','disabled','HrYTQ','EtCfS','map','Olijs','LTQVQ','env','log','\x20plugin(s)\x20configured','QldLM','unknown','492882ztuZHg','VROxk','Version:\x20','oslgw','gflmv','\x1b[0m','join','BdJJn','isActive','gUKOZ','\x20\x20Project-level:','ignore','XtlJf','plugin','length','API\x20Token:\x20✗\x20Not\x20found','1804542tUUwak','12cJCqLC','KcYZm','474025zWGGuV','path','\x20\x20User-level:','Hpqyr','djPAk','jlXcQ','pipe','\x20\x20\x20\x20Session:\x20','@ranger-testing/opencode-plugin','WVIPz','isArray','hasEncryptedAuth','cwd','\x20profiles\x20configured\x20(','rgCeu','SKILL.md','mTBaW','version','eyfRV','\x20(active)',':\x20configured','\x20\x20Run:\x20ranger\x20setup\x20--opencode','889308hhrfxH','8MEifCK','\x20\x20Run:\x20ranger\x20skillup','NdBKr','settingsPath','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','hUWbg','\x20\x20\x20\x20','pvxKp','JfjBG','msstg','not_configured','AQzhJ','status','trim','\x20\x20Run:\x20ranger\x20setup\x20[token]','debug','encrypted','Root:\x20','cpWzg','Udxca','dxRmO','NvbAu','UUnJe','\x0a---\x20Claude\x20Code\x20Plugin\x20---','(not\x20found)','settings.json','details','\x20(up\x20to\x20date)','\x1b[1m','261064DXwRBj','stderr','name','kQpCk','ranger@trailhead','filter','AhMdp','match','IQPbg','1849540aiLsNs','string','\x0a📊\x20Ranger\x20Status\x0a','EdAIJ','includes','pXeAH','user','\x1b]8;;file://','cached\x20(updated\x20','push',':\x20installed\x20(','\x0a---\x20Skills\x20---','plaintext','570754pIpIyd','RCdnY'];_0x1a17=function(){return _0x36b762;};return _0x1a17();}import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{listCloudProfiles}from'./utils/cloudProfile.js';import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x483bce=>_0x21aeca(0xf3)+_0x483bce+_0x21aeca(0xb2),link=(_0x450212,_0x540109)=>_0x21aeca(0x104)+_0x450212+'\x07'+(_0x540109||_0x450212)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x108dc6=_0x21aeca,_0x306bf1={'Hpqyr':'not_installed','WVIPz':function(_0x19e23f,_0x3d390f){return _0x19e23f(_0x3d390f);},'EdAIJ':'not_configured','Olijs':function(_0x409318,_0x2b8c09,_0x46de3d,_0x5620ab){return _0x409318(_0x2b8c09,_0x46de3d,_0x5620ab);},'XAuEv':'config','kQpCk':_0x108dc6(0xb8),'AQzhJ':_0x108dc6(0xc6),'XtlJf':'data','GBCqP':'error'};return new Promise(_0x4e17fa=>{const _0x2d2c2c=_0x108dc6,_0x2a28b3={'jlXcQ':_0x2d2c2c(0xfe),'bPGBa':_0x2d2c2c(0xc8),'rZwBA':'opencode-plugin','LTQVQ':_0x306bf1[_0x2d2c2c(0xc3)],'oqHSm':'configured','KcYZm':function(_0x4bf9d4,_0x250c3a){const _0x25b480=_0x2d2c2c;return _0x306bf1[_0x25b480(0xc9)](_0x4bf9d4,_0x250c3a);},'jADsr':function(_0x1090aa,_0x52b110){const _0x1e55f5=_0x2d2c2c;return _0x306bf1[_0x1e55f5(0xc9)](_0x1090aa,_0x52b110);},'xIowG':_0x306bf1[_0x2d2c2c(0x100)]},_0x186098=_0x306bf1[_0x2d2c2c(0xa6)](spawn,'opencode',[_0x2d2c2c(0xe6),_0x306bf1['XAuEv']],{'stdio':[_0x306bf1[_0x2d2c2c(0xf7)],_0x2d2c2c(0xc6),_0x306bf1[_0x2d2c2c(0xe2)]]});let _0xb1b48e='';_0x186098['stdout']?.['on'](_0x2d2c2c(0x9e),_0x21afbf=>{_0xb1b48e+=_0x21afbf['toString']();}),_0x186098[_0x2d2c2c(0xf5)]?.['on'](_0x306bf1[_0x2d2c2c(0xb9)],_0x261f6c=>{_0xb1b48e+=_0x261f6c['toString']();}),_0x186098['on'](_0x306bf1['GBCqP'],()=>{_0x4e17fa({'status':'not_installed'});}),_0x186098['on']('close',_0x4affa5=>{const _0x353a79=_0x2d2c2c;if(_0x4affa5!==0x0){_0x4e17fa({'status':_0x2a28b3[_0x353a79(0xa7)]});return;}const _0x142ba1=_0xb1b48e['trim']();let _0x49a9fc=null;if(_0x142ba1)try{_0x49a9fc=JSON['parse'](_0x142ba1);}catch{const _0x238de8=_0x142ba1['match'](/\{[\s\S]*\}$/);if(_0x238de8)try{_0x49a9fc=JSON['parse'](_0x238de8[0x0]);}catch{_0x49a9fc=null;}}const _0x5eabe2=Array[_0x353a79(0xca)](_0x49a9fc?.[_0x353a79(0xba)])?_0x49a9fc?.[_0x353a79(0xba)]:[],_0x1d2abb=_0x5eabe2['some'](_0xf4ad44=>{const _0x3b88e7=_0x353a79;if(typeof _0xf4ad44!==_0x2a28b3[_0x3b88e7(0xc5)])return![];return _0xf4ad44[_0x3b88e7(0x101)](_0x2a28b3['bPGBa'])||_0xf4ad44[_0x3b88e7(0x101)](_0x2a28b3['rZwBA']);});if(_0x1d2abb){_0x4e17fa({'status':_0x2a28b3['oqHSm'],'details':_0x5eabe2['length']>0x0?_0x5eabe2[_0x353a79(0xbb)]+_0x353a79(0xaa):undefined});return;}if(_0x5eabe2[_0x353a79(0xbb)]>0x0){_0x2a28b3[_0x353a79(0xbf)](_0x4e17fa,{'status':_0x353a79(0xe1),'details':_0x5eabe2[_0x353a79(0xbb)]+'\x20plugin(s)\x20configured'});return;}_0x2a28b3['jADsr'](_0x4e17fa,{'status':_0x2a28b3['xIowG']});});});}async function getSkillsFromDir(_0x32f668,_0x3d1450){const _0x2cb4e8=_0x21aeca,_0x5d018d={'zcFAQ':function(_0x4714be,_0xe40a13){return _0x4714be(_0xe40a13);},'MKrFQ':function(_0x1e189c,_0x4b38cd,_0x1f61c8){return _0x1e189c(_0x4b38cd,_0x1f61c8);},'NdBKr':_0x2cb4e8(0xcf)};if(!_0x5d018d['zcFAQ'](existsSync,_0x32f668))return[];const _0x3cd01c=[];try{const _0x274a20=await _0x5d018d['MKrFQ'](readdir,_0x32f668,{'withFileTypes':!![]});for(const _0x4628d8 of _0x274a20){if(_0x4628d8['isDirectory']()){const _0x57b374=join(_0x32f668,_0x4628d8['name'],_0x5d018d[_0x2cb4e8(0xd9)]);if(_0x5d018d['zcFAQ'](existsSync,_0x57b374)){let _0x380700=_0x4628d8[_0x2cb4e8(0xf6)];try{const _0x438022=await readFile(_0x57b374,'utf-8'),_0x26360d=_0x438022[_0x2cb4e8(0xfb)](/name:\s*(.+)/);_0x26360d&&(_0x380700=_0x26360d[0x1][_0x2cb4e8(0xe4)]());}catch{}_0x3cd01c[_0x2cb4e8(0x106)]({'name':_0x4628d8[_0x2cb4e8(0xf6)],'displayName':_0x380700,'path':_0x57b374,'level':_0x3d1450});}}}}catch{return[];}return _0x3cd01c;}async function getInstalledSkills(){const _0x24d2b3=_0x21aeca,_0x47c0df={'NvbAu':function(_0x4381a0,_0x4412bd,_0x99e8a7){return _0x4381a0(_0x4412bd,_0x99e8a7);},'EPwud':'project','GFsRA':'user'},[_0x28c706,_0x5bd3ec]=await Promise['all']([_0x47c0df[_0x24d2b3(0xec)](getSkillsFromDir,getProjectSkillsDir(),_0x47c0df['EPwud']),getSkillsFromDir(getUserSkillsDir(),_0x47c0df['GFsRA'])]);return{'project':_0x28c706,'user':_0x5bd3ec};}async function getEnvironments(){const _0x7a637=_0x21aeca,_0x167ec1={'eyfRV':function(_0x6eec99,_0x2eb9f1){return _0x6eec99(_0x2eb9f1);},'BdJJn':function(_0xe35ec5,_0x2ac4f9,_0x2a9102){return _0xe35ec5(_0x2ac4f9,_0x2a9102);},'mTBaW':function(_0x5d1202,_0x41183e,_0x4b772a){return _0x5d1202(_0x41183e,_0x4b772a);},'pvxKp':function(_0x1cc222,_0x150c4a,_0x274d76){return _0x1cc222(_0x150c4a,_0x274d76);},'hUWbg':_0x7a637(0xef),'vJCAk':function(_0x555a19,_0x1b8ec6){return _0x555a19===_0x1b8ec6;},'bevOm':function(_0x148099){return _0x148099();}},{envNames:_0x52cba0,activeEnv:_0x12b8de}=await getEnvNames(),_0x1178cd=_0x167ec1['bevOm'](getRangerDir);if(!existsSync(_0x1178cd))return{'envs':[],'activeEnv':null};const _0x1d35f7=_0x52cba0['map'](_0x5e0495=>{const _0x1f1ad9=_0x7a637,_0x317f7d=_0x167ec1[_0x1f1ad9(0xd2)](getEnvDir,_0x5e0495),_0x2a7480=_0x167ec1[_0x1f1ad9(0xb4)](join,_0x317f7d,_0x1f1ad9(0xf0)),_0x4371d9=_0x167ec1[_0x1f1ad9(0xd0)](join,_0x317f7d,'auth.json'),_0x5a22a6=_0x167ec1[_0x1f1ad9(0xde)](join,_0x317f7d,'auth.json.enc');return{'name':_0x5e0495,'settingsPath':_0x167ec1['eyfRV'](existsSync,_0x2a7480)?_0x2a7480:_0x167ec1[_0x1f1ad9(0xdc)],'hasPlaintextAuth':existsSync(_0x4371d9),'hasEncryptedAuth':existsSync(_0x5a22a6),'isActive':_0x167ec1[_0x1f1ad9(0x10c)](_0x5e0495,_0x12b8de)};});return{'envs':_0x1d35f7,'activeEnv':_0x12b8de};}export async function status(){const _0x3bc402=_0x21aeca,_0xb2b07e={'djPAk':_0x3bc402(0xff),'nSnRS':function(_0x275818){return _0x275818();},'HrYTQ':function(_0x9c4b39,_0x889c84,_0x4fe147){return _0x9c4b39(_0x889c84,_0x4fe147);},'dxRmO':function(_0x23ace4,_0x55c0f5){return _0x23ace4(_0x55c0f5);},'gflmv':function(_0x356081,_0x4a10c2){return _0x356081!==_0x4a10c2;},'wOFsx':function(_0x274a72){return _0x274a72();},'Udxca':function(_0x378e82,_0x1054e9){return _0x378e82(_0x1054e9);},'UUnJe':function(_0x2899f7,_0x14e651){return _0x2899f7===_0x14e651;},'KZOwF':'configured','JfjBG':'@ranger-testing/opencode-plugin','oslgw':'\x20\x20Not\x20configured','rTUPc':_0x3bc402(0xd5),'cpWzg':_0x3bc402(0xf8),'fjHbi':'\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','pGmeh':_0x3bc402(0x108),'MiZJS':function(_0x40bec9,_0x23b833){return _0x40bec9+_0x23b833;},'cyEng':function(_0x1d99c0,_0x2497fd){return _0x1d99c0===_0x2497fd;},'PkAjw':'No\x20skills\x20installed','AhMdp':function(_0x9af5f1,_0x8dc499){return _0x9af5f1>_0x8dc499;},'lbZdr':_0x3bc402(0xc2),'VROxk':function(_0x4ac9a5,_0x36d648,_0x2fcca4){return _0x4ac9a5(_0x36d648,_0x2fcca4);},'msstg':function(_0x5a3c3a){return _0x5a3c3a();},'RCdnY':function(_0x280ab2,_0x35c28b){return _0x280ab2+_0x35c28b;},'QlQUa':_0x3bc402(0xa0),'IQPbg':function(_0x41d62e,_0x3da0d0){return _0x41d62e>_0x3da0d0;},'EtCfS':function(_0x5bd284,_0x5bef9e){return _0x5bd284===_0x5bef9e;},'pXeAH':'no\x20session','QldLM':_0x3bc402(0xe7),'rgCeu':'none','gUKOZ':function(_0xb9967c,_0x32663c){return _0xb9967c!==_0x32663c;}};console['log'](_0xb2b07e[_0x3bc402(0xc4)]);const _0x2ceae0=process[_0x3bc402(0xcc)](),_0x577019=_0xb2b07e['nSnRS'](getRangerDir);if(!existsSync(_0x577019)){console['log']('Root:\x20'+_0xb2b07e[_0x3bc402(0xa3)](link,_0x2ceae0,_0xb2b07e[_0x3bc402(0xeb)](bold,basename(_0x2ceae0)))),console['log'](_0x3bc402(0xdb)),console[_0x3bc402(0xa9)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console['log'](_0x3bc402(0xe8)+link(_0x2ceae0,bold(basename(_0x2ceae0))));const _0x129972=getCurrentVersion(),_0x1e220f=getLatestVersion();if(_0x1e220f[_0x3bc402(0xd1)]&&_0xb2b07e[_0x3bc402(0xb1)](_0x1e220f[_0x3bc402(0xd1)],_0x129972))console['log']('Version:\x20'+_0x129972+'\x20(latest:\x20'+_0x1e220f[_0x3bc402(0xd1)]+')'),console[_0x3bc402(0xa9)]('\x20\x20Run:\x20ranger\x20update');else _0x1e220f[_0x3bc402(0xd1)]?console['log']('Version:\x20'+_0x129972+_0x3bc402(0xf2)):console[_0x3bc402(0xa9)](_0x3bc402(0xaf)+_0x129972);const _0x56a3da=await _0xb2b07e['wOFsx'](getToken);if(_0x56a3da){const _0x2cd883=await _0xb2b07e['Udxca'](getCurrentUser,_0x56a3da);_0x2cd883['success']?console[_0x3bc402(0xa9)]('Organization:\x20'+_0xb2b07e[_0x3bc402(0xea)](bold,_0x2cd883[_0x3bc402(0x103)]['organizationName'])):(console['log']('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console[_0x3bc402(0xa9)]('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console['log'](_0x3bc402(0xbc)),console[_0x3bc402(0xa9)](_0x3bc402(0xe5));process[_0x3bc402(0xa8)][_0x3bc402(0x9f)]&&(console['log']('API\x20Environment:\x20'+_0xb2b07e['nSnRS'](getCurrentEnvironment)),console['log']('API\x20URL:\x20'+_0xb2b07e['wOFsx'](getApiBaseUrl)));console[_0x3bc402(0xa9)]('\x0a---\x20OpenCode\x20Plugin\x20---');const _0x36c0c4=await getOpencodePluginStatus();if(_0xb2b07e[_0x3bc402(0xed)](_0x36c0c4[_0x3bc402(0xe3)],_0xb2b07e['KZOwF']))console['log']('\x20\x20'+_0xb2b07e[_0x3bc402(0xea)](bold,_0xb2b07e[_0x3bc402(0xdf)])+_0x3bc402(0xd4)),_0x36c0c4['details']&&console['log']('\x20\x20'+_0x36c0c4[_0x3bc402(0xf1)]);else _0x36c0c4[_0x3bc402(0xe3)]===_0x3bc402(0xe1)?(console[_0x3bc402(0xa9)](_0xb2b07e[_0x3bc402(0xb0)]),_0x36c0c4['details']&&console['log']('\x20\x20'+_0x36c0c4[_0x3bc402(0xf1)]),console[_0x3bc402(0xa9)](_0xb2b07e['rTUPc'])):console['log']('\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available');console[_0x3bc402(0xa9)](_0x3bc402(0xee));const _0x201f70=await getPluginInfo(_0xb2b07e[_0x3bc402(0xe9)]);if(_0x201f70){const _0x2a23b6=_0x201f70['scope']||_0x3bc402(0xac),_0x346e81=_0x201f70['enabled']?'enabled':_0x3bc402(0xa2);console['log']('\x20\x20'+bold('ranger@trailhead')+_0x3bc402(0x107)+_0x2a23b6+',\x20'+_0x346e81+')');}else console[_0x3bc402(0xa9)]('\x20\x20Not\x20installed'),console[_0x3bc402(0xa9)](_0xb2b07e['fjHbi']);console[_0x3bc402(0xa9)](_0xb2b07e['pGmeh']);const {project:_0x11c5b6,user:_0x12377b}=await getInstalledSkills(),_0x3d0891=_0x11c5b6['filter'](_0x5b6ccc=>RANGER_MANAGED_SKILLS[_0x3bc402(0x101)](_0x5b6ccc[_0x3bc402(0xf6)])),_0x17ff63=_0x12377b[_0x3bc402(0xf9)](_0x488590=>RANGER_MANAGED_SKILLS['includes'](_0x488590[_0x3bc402(0xf6)])),_0x41d8fc=_0xb2b07e['MiZJS'](_0x3d0891[_0x3bc402(0xbb)],_0x17ff63['length']);if(_0xb2b07e['cyEng'](_0x41d8fc,0x0))console[_0x3bc402(0xa9)](_0xb2b07e['PkAjw']),console['log'](_0x3bc402(0xd8));else{if(_0xb2b07e['AhMdp'](_0x3d0891['length'],0x0)){console[_0x3bc402(0xa9)](_0x3bc402(0xb7));for(const _0x44b88c of _0x3d0891){console['log'](_0x3bc402(0xdd)+bold(_0x44b88c['displayName'])+':\x20'+link(_0x44b88c['path'],basename(_0x44b88c[_0x3bc402(0xc1)])));}}if(_0xb2b07e[_0x3bc402(0xfa)](_0x17ff63['length'],0x0)){console[_0x3bc402(0xa9)](_0xb2b07e['lbZdr']);for(const _0x129ecc of _0x17ff63){console['log'](_0x3bc402(0xdd)+bold(_0x129ecc['displayName'])+':\x20'+_0xb2b07e[_0x3bc402(0xae)](link,_0x129ecc[_0x3bc402(0xc1)],basename(_0x129ecc[_0x3bc402(0xc1)])));}}}console[_0x3bc402(0xa9)]('\x0a---\x20Profiles\x20---');const {envs:_0x348b9f,activeEnv:_0x47e20f}=await getEnvironments();let _0x17260c=[];if(_0x56a3da)try{_0x17260c=await _0xb2b07e[_0x3bc402(0xe0)](listCloudProfiles);}catch{}const _0x1b4df5=_0xb2b07e[_0x3bc402(0x10b)](_0x348b9f[_0x3bc402(0xbb)],_0x17260c[_0x3bc402(0xbb)]);if(_0x1b4df5===0x0)console['log'](_0xb2b07e['QlQUa']),console[_0x3bc402(0xa9)]('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{if(_0xb2b07e['AhMdp'](_0x1b4df5,0x5)){const _0x4c87d0=[];_0xb2b07e[_0x3bc402(0xfc)](_0x17260c['length'],0x0)&&_0x4c87d0['push'](_0x17260c['length']+'\x20cloud'),_0x348b9f[_0x3bc402(0xbb)]>0x0&&_0x4c87d0[_0x3bc402(0x106)](_0x348b9f[_0x3bc402(0xbb)]+'\x20local'),console['log'](_0x1b4df5+_0x3bc402(0xcd)+_0x4c87d0['join'](',\x20')+')'),_0x47e20f&&console['log']('\x20\x20Active:\x20'+bold(_0x47e20f)),console['log']('\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)');}else{for(const _0x4b87e3 of _0x17260c){const _0x401a4a=_0xb2b07e[_0x3bc402(0xa4)](_0x4b87e3[_0x3bc402(0xf6)],_0x47e20f)?_0x3bc402(0xd3):'';console['log']('\x20\x20'+_0xb2b07e['Udxca'](bold,_0x4b87e3[_0x3bc402(0xf6)])+'\x20[cloud]'+_0x401a4a);const _0x2c4a26=_0x4b87e3['sessionUpdatedAt']?_0x3bc402(0x105)+_0x4b87e3['sessionUpdatedAt']+')':_0xb2b07e[_0x3bc402(0x102)];console[_0x3bc402(0xa9)](_0x3bc402(0xc7)+_0x2c4a26);}const _0xab2114=new Set(_0x17260c[_0x3bc402(0xa5)](_0x116705=>_0x116705[_0x3bc402(0xf6)]));for(const _0x3e56bf of _0x348b9f){if(_0xab2114[_0x3bc402(0xa1)](_0x3e56bf[_0x3bc402(0xf6)]))continue;const _0x73b944=_0x3e56bf[_0x3bc402(0xb5)]?'\x20(active)':'',_0xb3097=_0x3e56bf[_0x3bc402(0xcb)]?_0xb2b07e[_0x3bc402(0xab)]:_0x3e56bf['hasPlaintextAuth']?_0x3bc402(0x109):_0xb2b07e[_0x3bc402(0xce)];console['log']('\x20\x20'+bold(_0x3e56bf['name'])+'\x20[local]'+_0x73b944),console['log']('\x20\x20\x20\x20Auth:\x20'+_0xb3097),_0xb2b07e[_0x3bc402(0xb6)](_0x3e56bf[_0x3bc402(0xda)],_0x3bc402(0xef))&&console['log']('\x20\x20\x20\x20Settings:\x20'+link(_0x3e56bf['settingsPath'],basename(_0x3e56bf['settingsPath'])));}if(!_0x47e20f){console['log']('\x0a\x20\x20No\x20active\x20profile\x20set');const _0x2e823c=[..._0x17260c['map'](_0x119960=>_0x119960[_0x3bc402(0xf6)]),..._0x348b9f[_0x3bc402(0xf9)](_0x13a079=>!_0xab2114['has'](_0x13a079['name']))['map'](_0x2e78be=>_0x2e78be[_0x3bc402(0xf6)])];console[_0x3bc402(0xa9)]('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x2e823c[_0x3bc402(0xb3)](',\x20')+')');}}}console[_0x3bc402(0xa9)]('');}
1
+ const _0x3ee617=_0x29d7;(function(_0x423521,_0x21abdc){const _0x14fd40=_0x29d7,_0x20982e=_0x423521();while(!![]){try{const _0x3631fd=-parseInt(_0x14fd40(0x14e))/0x1*(-parseInt(_0x14fd40(0x14a))/0x2)+parseInt(_0x14fd40(0x178))/0x3*(-parseInt(_0x14fd40(0x173))/0x4)+parseInt(_0x14fd40(0x15b))/0x5+-parseInt(_0x14fd40(0x135))/0x6*(-parseInt(_0x14fd40(0x127))/0x7)+-parseInt(_0x14fd40(0x13c))/0x8*(-parseInt(_0x14fd40(0x167))/0x9)+parseInt(_0x14fd40(0x131))/0xa+-parseInt(_0x14fd40(0x181))/0xb;if(_0x3631fd===_0x21abdc)break;else _0x20982e['push'](_0x20982e['shift']());}catch(_0x426724){_0x20982e['push'](_0x20982e['shift']());}}}(_0x1fd1,0x4f3d9));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';function _0x1fd1(){const _0x5516a5=['\x20(up\x20to\x20date)','jdFnC','jKhdp','(not\x20found)','3804548nFyVxc','displayName','version','\x20(latest:\x20','\x1b[1m','GKSRo','not_configured','filter','kseIk','\x20\x20Run:\x20ranger\x20setup\x20[token]','\x20cloud','npivj','PeqGO','No\x20skills\x20installed','auth.json.enc','not_installed','hasPlaintextAuth','stderr','35336iHzOLK','API\x20URL:\x20','map','settingsPath','stdout','plugin','@ranger-testing/opencode-plugin','isDirectory','FDvSC','jJqgk','6396090saRFTH','ASyKr','tUQsn','mmlOY','96DRQgMO','isActive','scope','\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a','data','yaJao','API\x20Token:\x20✗\x20Not\x20found','219656JPOqKf','\x0a---\x20Skills\x20---','\x20\x20\x20\x20Auth:\x20','Erbfv','name','pipe','\x20\x20Run:\x20ranger\x20update','JxQDH','details','XntKU','\x20[local]','\x0a\x20\x20No\x20active\x20profile\x20set','sessionUpdatedAt','\x20\x20Project-level:','6dLyJwi','unknown','utf-8','OCkQj','120723CLOVUK','wbVvT','ranger@trailhead','close','enabled','bJRjq','log','BRvRL','settings.json','Version:\x20','\x20(active)','MRJSG','no\x20session','145475DtkkFf','error','cwd','encrypted','\x20\x20\x20\x20','trim','parse','length','ignore','kgHpT','includes','\x0a---\x20Profiles\x20---','36JdVHfk',':\x20configured','nGTvF','none','ooFme','path','\x20\x20Run:\x20ranger\x20skillup','configured','nywaP','\x20\x20\x20\x20Settings:\x20','UkRAN','user','16ManGok','\x1b]8;;file://','has','rNnvc','string','413274WFEOPq','push','HRTIZ','hasEncryptedAuth','\x20\x20\x20\x20Session:\x20'];_0x1fd1=function(){return _0x5516a5;};return _0x1fd1();}import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{listCloudProfiles}from'./utils/cloudProfile.js';import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x125aaf=>_0x3ee617(0x185)+_0x125aaf+'\x1b[0m',link=(_0x2df574,_0x495d9a)=>_0x3ee617(0x174)+_0x2df574+'\x07'+(_0x495d9a||_0x2df574)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x118a18=_0x3ee617,_0x14f1e4={'wbVvT':function(_0x5dd2c2,_0x2f775f){return _0x5dd2c2(_0x2f775f);},'lpEJz':_0x118a18(0x12d),'pIibf':function(_0x5ebda0,_0x1b27ce){return _0x5ebda0!==_0x1b27ce;},'jJqgk':_0x118a18(0x124),'aGKFt':function(_0x1acd71,_0x5f1dc8){return _0x1acd71>_0x5f1dc8;},'kgHpT':'debug','JxQDH':'config','nywaP':_0x118a18(0x163),'LOdSV':_0x118a18(0x141),'sOFbe':_0x118a18(0x139),'VBHvy':_0x118a18(0x151)};return new Promise(_0x4408a6=>{const _0x5cc213=_0x118a18,_0x22a7c4={'OCkQj':_0x5cc213(0x177),'rNnvc':_0x14f1e4['lpEJz'],'gungK':function(_0x298d5b,_0x2d1f7b){return _0x14f1e4['pIibf'](_0x298d5b,_0x2d1f7b);},'kseIk':_0x14f1e4[_0x5cc213(0x130)],'dxPsk':function(_0xd3abd3,_0xd0bdbe){return _0x14f1e4['aGKFt'](_0xd3abd3,_0xd0bdbe);},'EiyMj':function(_0x1688bf,_0x6ca1f1){return _0x1688bf(_0x6ca1f1);}},_0x3ffa84=spawn('opencode',[_0x14f1e4[_0x5cc213(0x164)],_0x14f1e4[_0x5cc213(0x143)]],{'stdio':[_0x14f1e4[_0x5cc213(0x16f)],'pipe',_0x14f1e4['LOdSV']]});let _0x250511='';_0x3ffa84[_0x5cc213(0x12b)]?.['on'](_0x14f1e4['sOFbe'],_0x4ff057=>{_0x250511+=_0x4ff057['toString']();}),_0x3ffa84[_0x5cc213(0x126)]?.['on'](_0x5cc213(0x139),_0x3fc995=>{_0x250511+=_0x3fc995['toString']();}),_0x3ffa84['on'](_0x5cc213(0x15c),()=>{const _0xcee8dc=_0x5cc213;_0x14f1e4[_0xcee8dc(0x14f)](_0x4408a6,{'status':'not_installed'});}),_0x3ffa84['on'](_0x14f1e4['VBHvy'],_0x42dfd2=>{const _0x4ac958=_0x5cc213;if(_0x22a7c4['gungK'](_0x42dfd2,0x0)){_0x4408a6({'status':_0x22a7c4[_0x4ac958(0x189)]});return;}const _0x48f443=_0x250511['trim']();let _0x2e50e8=null;if(_0x48f443)try{_0x2e50e8=JSON[_0x4ac958(0x161)](_0x48f443);}catch{const _0xb1be85=_0x48f443['match'](/\{[\s\S]*\}$/);if(_0xb1be85)try{_0x2e50e8=JSON[_0x4ac958(0x161)](_0xb1be85[0x0]);}catch{_0x2e50e8=null;}}const _0x3853a8=Array['isArray'](_0x2e50e8?.[_0x4ac958(0x12c)])?_0x2e50e8?.[_0x4ac958(0x12c)]:[],_0x57d6bf=_0x3853a8['some'](_0x2f360f=>{const _0x3a1b39=_0x4ac958;if(typeof _0x2f360f!==_0x22a7c4[_0x3a1b39(0x14d)])return![];return _0x2f360f[_0x3a1b39(0x165)](_0x22a7c4[_0x3a1b39(0x176)])||_0x2f360f['includes']('opencode-plugin');});if(_0x57d6bf){_0x4408a6({'status':_0x4ac958(0x16e),'details':_0x22a7c4['dxPsk'](_0x3853a8[_0x4ac958(0x162)],0x0)?_0x3853a8['length']+'\x20plugin(s)\x20configured':undefined});return;}if(_0x3853a8['length']>0x0){_0x4408a6({'status':'not_configured','details':_0x3853a8[_0x4ac958(0x162)]+'\x20plugin(s)\x20configured'});return;}_0x22a7c4['EiyMj'](_0x4408a6,{'status':_0x4ac958(0x187)});});});}function _0x29d7(_0x386139,_0xa220cd){_0x386139=_0x386139-0x122;const _0x1fd1ed=_0x1fd1();let _0x29d720=_0x1fd1ed[_0x386139];return _0x29d720;}async function getSkillsFromDir(_0xfb009a,_0x235f3d){const _0x12ec4b=_0x3ee617,_0x3293c9={'jdFnC':function(_0x22f57b,_0x545bca,_0x181dcb){return _0x22f57b(_0x545bca,_0x181dcb);}};if(!existsSync(_0xfb009a))return[];const _0x15f584=[];try{const _0x43a0ae=await readdir(_0xfb009a,{'withFileTypes':!![]});for(const _0x473b7c of _0x43a0ae){if(_0x473b7c[_0x12ec4b(0x12e)]()){const _0x4a7b06=join(_0xfb009a,_0x473b7c['name'],'SKILL.md');if(existsSync(_0x4a7b06)){let _0x35d464=_0x473b7c[_0x12ec4b(0x140)];try{const _0x263bbc=await _0x3293c9[_0x12ec4b(0x17e)](readFile,_0x4a7b06,_0x12ec4b(0x14c)),_0xc3a9e=_0x263bbc['match'](/name:\s*(.+)/);_0xc3a9e&&(_0x35d464=_0xc3a9e[0x1][_0x12ec4b(0x160)]());}catch{}_0x15f584[_0x12ec4b(0x179)]({'name':_0x473b7c['name'],'displayName':_0x35d464,'path':_0x4a7b06,'level':_0x235f3d});}}}}catch{return[];}return _0x15f584;}async function getInstalledSkills(){const _0x5d0581=_0x3ee617,_0x1fabd4={'yaJao':function(_0x1bd6fb,_0x706c47,_0x145c62){return _0x1bd6fb(_0x706c47,_0x145c62);},'MRJSG':'project','ooFme':function(_0x3ad162){return _0x3ad162();},'EugJp':_0x5d0581(0x172)},[_0x1e43fd,_0x3ba8ca]=await Promise['all']([_0x1fabd4[_0x5d0581(0x13a)](getSkillsFromDir,getProjectSkillsDir(),_0x1fabd4[_0x5d0581(0x159)]),getSkillsFromDir(_0x1fabd4[_0x5d0581(0x16b)](getUserSkillsDir),_0x1fabd4['EugJp'])]);return{'project':_0x1e43fd,'user':_0x3ba8ca};}async function getEnvironments(){const _0x4206d9=_0x3ee617,_0x7fadcf={'EWtVa':_0x4206d9(0x156),'mmlOY':function(_0x348f56,_0x4b609d,_0x1febca){return _0x348f56(_0x4b609d,_0x1febca);},'orupo':'auth.json','PeqGO':_0x4206d9(0x180),'apdmm':function(_0x53a7cd,_0x4f3ece){return _0x53a7cd(_0x4f3ece);}},{envNames:_0x19b332,activeEnv:_0x496a5c}=await getEnvNames(),_0x53f9e5=getRangerDir();if(!_0x7fadcf['apdmm'](existsSync,_0x53f9e5))return{'envs':[],'activeEnv':null};const _0x2b7b67=_0x19b332[_0x4206d9(0x129)](_0x32fa81=>{const _0x244f0a=_0x4206d9,_0x14eda5=getEnvDir(_0x32fa81),_0xd57ebf=join(_0x14eda5,_0x7fadcf['EWtVa']),_0xb387a4=_0x7fadcf[_0x244f0a(0x134)](join,_0x14eda5,_0x7fadcf['orupo']),_0x3cafbd=_0x7fadcf[_0x244f0a(0x134)](join,_0x14eda5,_0x244f0a(0x123));return{'name':_0x32fa81,'settingsPath':existsSync(_0xd57ebf)?_0xd57ebf:_0x7fadcf[_0x244f0a(0x18d)],'hasPlaintextAuth':existsSync(_0xb387a4),'hasEncryptedAuth':_0x7fadcf['apdmm'](existsSync,_0x3cafbd),'isActive':_0x32fa81===_0x496a5c};});return{'envs':_0x2b7b67,'activeEnv':_0x496a5c};}export async function status(){const _0x10008f=_0x3ee617,_0x14843b={'bJRjq':function(_0x408de0,_0x1228e2){return _0x408de0(_0x1228e2);},'HRTIZ':function(_0x11ad6c,_0x3bfe5e,_0x1c37a0){return _0x11ad6c(_0x3bfe5e,_0x1c37a0);},'UkRAN':function(_0x4f8e97,_0xbba061){return _0x4f8e97!==_0xbba061;},'JxgCz':function(_0x171aa0){return _0x171aa0();},'GkMCh':'\x0a---\x20OpenCode\x20Plugin\x20---','npivj':function(_0x38e44b){return _0x38e44b();},'Erbfv':function(_0x2d6f7,_0x22226f){return _0x2d6f7===_0x22226f;},'rZOkW':_0x10008f(0x16e),'pqsnY':function(_0x3320fb,_0x562912){return _0x3320fb===_0x562912;},'XntKU':'\x20\x20Not\x20configured','uLjuH':'ranger@trailhead','lKGlt':'\x20\x20Not\x20installed','CubQf':'\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','GKSRo':_0x10008f(0x13d),'WMaOs':function(_0x20f09b,_0x2178d3){return _0x20f09b>_0x2178d3;},'BRvRL':function(_0x29cac6,_0x3ae5b6){return _0x29cac6(_0x3ae5b6);},'tUQsn':function(_0x136b6e,_0x32261c){return _0x136b6e(_0x32261c);},'jKhdp':'No\x20profiles\x20configured','nGTvF':function(_0x5c24f2,_0x3c3547){return _0x5c24f2>_0x3c3547;},'hgYCg':function(_0x5e4734,_0x2335cb){return _0x5e4734>_0x2335cb;},'FDvSC':function(_0x503b96,_0x474477){return _0x503b96(_0x474477);},'OxiCM':_0x10008f(0x158),'YfBLh':_0x10008f(0x16a),'taoSK':'(not\x20found)','ASyKr':function(_0x3c8008,_0x1bb753,_0x233175){return _0x3c8008(_0x1bb753,_0x233175);}};console[_0x10008f(0x154)]('\x0a📊\x20Ranger\x20Status\x0a');const _0x286f8f=process[_0x10008f(0x15d)](),_0xe29985=getRangerDir();if(!_0x14843b[_0x10008f(0x153)](existsSync,_0xe29985)){console[_0x10008f(0x154)]('Root:\x20'+_0x14843b['HRTIZ'](link,_0x286f8f,bold(basename(_0x286f8f)))),console[_0x10008f(0x154)]('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console['log'](_0x10008f(0x138));return;}console['log']('Root:\x20'+link(_0x286f8f,bold(basename(_0x286f8f))));const _0x529501=getCurrentVersion(),_0x3f584b=getLatestVersion();if(_0x3f584b[_0x10008f(0x183)]&&_0x14843b[_0x10008f(0x171)](_0x3f584b[_0x10008f(0x183)],_0x529501))console[_0x10008f(0x154)](_0x10008f(0x157)+_0x529501+_0x10008f(0x184)+_0x3f584b[_0x10008f(0x183)]+')'),console['log'](_0x10008f(0x142));else _0x3f584b[_0x10008f(0x183)]?console['log']('Version:\x20'+_0x529501+_0x10008f(0x17d)):console[_0x10008f(0x154)]('Version:\x20'+_0x529501);const _0xa16235=await getToken();if(_0xa16235){const _0x12acf5=await getCurrentUser(_0xa16235);_0x12acf5['success']?console[_0x10008f(0x154)]('Organization:\x20'+_0x14843b['bJRjq'](bold,_0x12acf5[_0x10008f(0x172)]['organizationName'])):(console[_0x10008f(0x154)]('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console[_0x10008f(0x154)](_0x10008f(0x18a)));}else console['log'](_0x10008f(0x13b)),console[_0x10008f(0x154)](_0x10008f(0x18a));process['env']['DEBUG']&&(console[_0x10008f(0x154)]('API\x20Environment:\x20'+getCurrentEnvironment()),console[_0x10008f(0x154)](_0x10008f(0x128)+_0x14843b['JxgCz'](getApiBaseUrl)));console[_0x10008f(0x154)](_0x14843b['GkMCh']);const _0x43b55c=await _0x14843b[_0x10008f(0x18c)](getOpencodePluginStatus);if(_0x14843b[_0x10008f(0x13f)](_0x43b55c['status'],_0x14843b['rZOkW']))console[_0x10008f(0x154)]('\x20\x20'+_0x14843b[_0x10008f(0x153)](bold,_0x10008f(0x12d))+_0x10008f(0x168)),_0x43b55c[_0x10008f(0x144)]&&console[_0x10008f(0x154)]('\x20\x20'+_0x43b55c[_0x10008f(0x144)]);else _0x14843b['pqsnY'](_0x43b55c['status'],'not_configured')?(console['log'](_0x14843b[_0x10008f(0x145)]),_0x43b55c['details']&&console['log']('\x20\x20'+_0x43b55c[_0x10008f(0x144)]),console[_0x10008f(0x154)]('\x20\x20Run:\x20ranger\x20setup\x20--opencode')):console['log']('\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available');console['log']('\x0a---\x20Claude\x20Code\x20Plugin\x20---');const _0x5468e9=await _0x14843b[_0x10008f(0x153)](getPluginInfo,_0x14843b['uLjuH']);if(_0x5468e9){const _0x296a09=_0x5468e9[_0x10008f(0x137)]||_0x10008f(0x14b),_0x365e5e=_0x5468e9['enabled']?_0x10008f(0x152):'disabled';console['log']('\x20\x20'+_0x14843b['bJRjq'](bold,_0x10008f(0x150))+':\x20installed\x20('+_0x296a09+',\x20'+_0x365e5e+')');}else console['log'](_0x14843b['lKGlt']),console[_0x10008f(0x154)](_0x14843b['CubQf']);console[_0x10008f(0x154)](_0x14843b[_0x10008f(0x186)]);const {project:_0x50076c,user:_0x8b1f94}=await _0x14843b['JxgCz'](getInstalledSkills),_0xadaec3=_0x50076c[_0x10008f(0x188)](_0x34ee1c=>RANGER_MANAGED_SKILLS[_0x10008f(0x165)](_0x34ee1c[_0x10008f(0x140)])),_0x5ab45e=_0x8b1f94[_0x10008f(0x188)](_0x540b64=>RANGER_MANAGED_SKILLS['includes'](_0x540b64['name'])),_0x1aa4a5=_0xadaec3[_0x10008f(0x162)]+_0x5ab45e['length'];if(_0x1aa4a5===0x0)console[_0x10008f(0x154)](_0x10008f(0x122)),console[_0x10008f(0x154)](_0x10008f(0x16d));else{if(_0x14843b['WMaOs'](_0xadaec3['length'],0x0)){console[_0x10008f(0x154)](_0x10008f(0x149));for(const _0x38f050 of _0xadaec3){console['log'](_0x10008f(0x15f)+bold(_0x38f050[_0x10008f(0x182)])+':\x20'+_0x14843b[_0x10008f(0x17a)](link,_0x38f050[_0x10008f(0x16c)],_0x14843b['bJRjq'](basename,_0x38f050['path'])));}}if(_0x5ab45e[_0x10008f(0x162)]>0x0){console[_0x10008f(0x154)]('\x20\x20User-level:');for(const _0x6bed55 of _0x5ab45e){console['log'](_0x10008f(0x15f)+_0x14843b[_0x10008f(0x155)](bold,_0x6bed55['displayName'])+':\x20'+link(_0x6bed55['path'],_0x14843b[_0x10008f(0x133)](basename,_0x6bed55['path'])));}}}console['log'](_0x10008f(0x166));const {envs:_0x58081e,activeEnv:_0x1ffdd1}=await getEnvironments();let _0x39022a=[];if(_0xa16235)try{_0x39022a=await listCloudProfiles();}catch{}const _0xb0d76c=_0x58081e['length']+_0x39022a[_0x10008f(0x162)];if(_0xb0d76c===0x0)console['log'](_0x14843b[_0x10008f(0x17f)]),console[_0x10008f(0x154)]('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{if(_0x14843b[_0x10008f(0x169)](_0xb0d76c,0x5)){const _0x135638=[];_0x14843b['hgYCg'](_0x39022a[_0x10008f(0x162)],0x0)&&_0x135638[_0x10008f(0x179)](_0x39022a['length']+_0x10008f(0x18b)),_0x58081e[_0x10008f(0x162)]>0x0&&_0x135638['push'](_0x58081e[_0x10008f(0x162)]+'\x20local'),console[_0x10008f(0x154)](_0xb0d76c+'\x20profiles\x20configured\x20('+_0x135638['join'](',\x20')+')'),_0x1ffdd1&&console['log']('\x20\x20Active:\x20'+_0x14843b['FDvSC'](bold,_0x1ffdd1)),console['log']('\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)');}else{for(const _0x56120d of _0x39022a){const _0xde50fe=_0x56120d[_0x10008f(0x140)]===_0x1ffdd1?_0x14843b['OxiCM']:'';console['log']('\x20\x20'+bold(_0x56120d[_0x10008f(0x140)])+'\x20[cloud]'+_0xde50fe);const _0x3ba4e6=_0x56120d['sessionUpdatedAt']?'cached\x20(updated\x20'+_0x56120d[_0x10008f(0x148)]+')':_0x10008f(0x15a);console[_0x10008f(0x154)](_0x10008f(0x17c)+_0x3ba4e6);}const _0x5c5937=new Set(_0x39022a['map'](_0x2ddba7=>_0x2ddba7['name']));for(const _0x4918d4 of _0x58081e){if(_0x5c5937[_0x10008f(0x175)](_0x4918d4['name']))continue;const _0x1a4ffa=_0x4918d4[_0x10008f(0x136)]?'\x20(active)':'',_0x286164=_0x4918d4[_0x10008f(0x17b)]?_0x10008f(0x15e):_0x4918d4[_0x10008f(0x125)]?'plaintext':_0x14843b['YfBLh'];console[_0x10008f(0x154)]('\x20\x20'+_0x14843b[_0x10008f(0x12f)](bold,_0x4918d4['name'])+_0x10008f(0x146)+_0x1a4ffa),console[_0x10008f(0x154)](_0x10008f(0x13e)+_0x286164),_0x14843b['UkRAN'](_0x4918d4[_0x10008f(0x12a)],_0x14843b['taoSK'])&&console[_0x10008f(0x154)](_0x10008f(0x170)+_0x14843b[_0x10008f(0x132)](link,_0x4918d4['settingsPath'],basename(_0x4918d4['settingsPath'])));}if(!_0x1ffdd1){console[_0x10008f(0x154)](_0x10008f(0x147));const _0x5a0023=[..._0x39022a[_0x10008f(0x129)](_0x5ab3d5=>_0x5ab3d5['name']),..._0x58081e[_0x10008f(0x188)](_0x1bc96f=>!_0x5c5937[_0x10008f(0x175)](_0x1bc96f['name']))[_0x10008f(0x129)](_0x44b1aa=>_0x44b1aa['name'])];console['log']('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x5a0023['join'](',\x20')+')');}}}console['log']('');}