@ranger-testing/ranger-cli 3.1.2-alpha.b450a14-41 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/build/cli.js +1 -1
  2. package/build/commands/addEnv.js +1 -1
  3. package/build/commands/authEncrypt.js +1 -1
  4. package/build/commands/clean.js +1 -1
  5. package/build/commands/config.js +1 -1
  6. package/build/commands/deleteProfile.js +1 -1
  7. package/build/commands/env.js +1 -1
  8. package/build/commands/feature.js +1 -1
  9. package/build/commands/hook.js +1 -1
  10. package/build/commands/hooks/autoPrompt.js +1 -1
  11. package/build/commands/hooks/disable.js +1 -1
  12. package/build/commands/hooks/enable.js +1 -1
  13. package/build/commands/hooks/exitPlanMode.js +1 -1
  14. package/build/commands/hooks/index.js +1 -1
  15. package/build/commands/hooks/output.js +1 -1
  16. package/build/commands/hooks/planReminder.js +1 -1
  17. package/build/commands/hooks/planStart.js +1 -1
  18. package/build/commands/hooks/postEdit.js +1 -1
  19. package/build/commands/hooks/preCompact.js +1 -1
  20. package/build/commands/hooks/sessionEnd.js +1 -1
  21. package/build/commands/hooks/sessionStart.js +1 -1
  22. package/build/commands/hooks/stopHook.js +1 -1
  23. package/build/commands/index.js +1 -1
  24. package/build/commands/login.js +1 -1
  25. package/build/commands/mcpBootstrap.js +1 -1
  26. package/build/commands/migrateProfile.js +1 -1
  27. package/build/commands/setup/claude.js +1 -1
  28. package/build/commands/setup/opencode.js +1 -1
  29. package/build/commands/setupCi.js +1 -1
  30. package/build/commands/skillup.js +1 -1
  31. package/build/commands/start.js +1 -1
  32. package/build/commands/status.js +1 -1
  33. package/build/commands/update.js +1 -1
  34. package/build/commands/updateEnv.js +1 -1
  35. package/build/commands/useEnv.js +1 -1
  36. package/build/commands/utils/activeProfile.js +1 -1
  37. package/build/commands/utils/agentEnv.js +1 -1
  38. package/build/commands/utils/browserSessionsApi.js +1 -1
  39. package/build/commands/utils/claudeConfig.js +1 -1
  40. package/build/commands/utils/claudeOverrideSettings.js +1 -1
  41. package/build/commands/utils/claudePlugin.js +1 -1
  42. package/build/commands/utils/cloudProfile.js +1 -1
  43. package/build/commands/utils/cloudProfileSession.js +1 -1
  44. package/build/commands/utils/crypto.js +1 -1
  45. package/build/commands/utils/desirePathLog.js +1 -1
  46. package/build/commands/utils/deviceAuth.js +1 -1
  47. package/build/commands/utils/environment.js +1 -1
  48. package/build/commands/utils/featureApi.js +1 -1
  49. package/build/commands/utils/fixWebmDuration.js +1 -1
  50. package/build/commands/utils/gitTracked.js +1 -1
  51. package/build/commands/utils/keychain.js +1 -1
  52. package/build/commands/utils/legacyWarning.js +1 -1
  53. package/build/commands/utils/localAgentInstallationsApi.js +1 -1
  54. package/build/commands/utils/matchAuthEnvironment.js +1 -1
  55. package/build/commands/utils/mcpImageBase64.js +1 -1
  56. package/build/commands/utils/model.js +1 -1
  57. package/build/commands/utils/novaActCli.js +1 -1
  58. package/build/commands/utils/opencodeConfig.js +1 -1
  59. package/build/commands/utils/organizationEnvApi.js +1 -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/sessionCache.js +1 -1
  71. package/build/commands/utils/settings.js +1 -1
  72. package/build/commands/utils/skillContent.js +1 -1
  73. package/build/commands/utils/skills.js +1 -1
  74. package/build/commands/utils/stitchWebmFiles.js +1 -1
  75. package/build/commands/utils/telemetry.js +1 -1
  76. package/build/commands/utils/tokenRefresh.js +1 -1
  77. package/build/commands/utils/traceSnapshotMapper.js +1 -1
  78. package/build/commands/utils/tunnelClient.js +1 -1
  79. package/build/commands/utils/userApi.js +1 -1
  80. package/build/commands/utils/version.js +1 -1
  81. package/build/commands/verifyFeature.js +1 -1
  82. package/build/commands/verifyFeatureCli.js +1 -1
  83. package/build/commands/verifyFeatureNovaCli.js +1 -1
  84. package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
  85. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x38dee0,_0x4afe1e){const _0x2bffa1=_0x28c4,_0x445c03=_0x38dee0();while(!![]){try{const _0x4f4b17=parseInt(_0x2bffa1(0x1a0))/0x1*(parseInt(_0x2bffa1(0x190))/0x2)+-parseInt(_0x2bffa1(0x194))/0x3*(-parseInt(_0x2bffa1(0x19c))/0x4)+-parseInt(_0x2bffa1(0x19a))/0x5*(-parseInt(_0x2bffa1(0x198))/0x6)+-parseInt(_0x2bffa1(0x192))/0x7*(-parseInt(_0x2bffa1(0x19f))/0x8)+parseInt(_0x2bffa1(0x19e))/0x9*(-parseInt(_0x2bffa1(0x1a2))/0xa)+-parseInt(_0x2bffa1(0x193))/0xb+-parseInt(_0x2bffa1(0x199))/0xc*(parseInt(_0x2bffa1(0x18e))/0xd);if(_0x4f4b17===_0x4afe1e)break;else _0x445c03['push'](_0x445c03['shift']());}catch(_0x100195){_0x445c03['push'](_0x445c03['shift']());}}}(_0x48fc,0x27f46));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';import{isInteractive}from'./utils/cloudProfileSession.js';export async function login(){const _0xd1a9b6=_0x28c4,_0x17f371={'oAOuR':function(_0x2fd8ae){return _0x2fd8ae();},'HsYzE':'Re-authenticating\x20via\x20MCP\x20bootstrap...','rpxUP':_0xd1a9b6(0x18d),'aXwIb':function(_0x2dc503){return _0x2dc503();},'BRgIc':'\x0a✅\x20API\x20key\x20stored\x20successfully','blggC':function(_0x18a23c,_0x31e928){return _0x18a23c instanceof _0x31e928;}},_0x48b9d6=await _0x17f371['oAOuR'](getMcpAuthOrigin);if(_0x48b9d6){console[_0xd1a9b6(0x1a1)](_0x17f371[_0xd1a9b6(0x195)]),await _0x17f371['oAOuR'](mcpBootstrap);return;}if(!isInteractive())throw new Error(_0x17f371[_0xd1a9b6(0x196)]);try{const _0x1c32be=await _0x17f371[_0xd1a9b6(0x19d)](runDeviceAuthFlow),_0x53fb2f=await getCurrentUser(_0x1c32be);_0x53fb2f[_0xd1a9b6(0x19b)]?console[_0xd1a9b6(0x1a1)](_0xd1a9b6(0x18f)+_0x53fb2f[_0xd1a9b6(0x197)]['organizationName']):console['log'](_0x17f371[_0xd1a9b6(0x191)]);}catch(_0x40eba8){throw new Error('Login\x20failed:\x20'+(_0x17f371['blggC'](_0x40eba8,Error)?_0x40eba8['message']:_0x40eba8));}}function _0x28c4(_0x55af19,_0x1f7b67){_0x55af19=_0x55af19-0x18d;const _0x48fcae=_0x48fc();let _0x28c4a8=_0x48fcae[_0x55af19];return _0x28c4a8;}function _0x48fc(){const _0x4717bb=['success','306260ymtKng','aXwIb','63rmWqQY','6856kXvPoj','219LktJtz','log','110570QzttUm','Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','1722799kaxLno','\x0a✅\x20Logged\x20in\x20to\x20','1822kqZWgq','BRgIc','2604IMaUjZ','1884993mBGlTA','3sDegll','HsYzE','rpxUP','user','144DwbhRC','24sdwpGz','17205NiuCKX'];_0x48fc=function(){return _0x4717bb;};return _0x48fc();}
1
+ (function(_0x18c185,_0x3298ab){const _0xa12e2d=_0x2aa8,_0x16a67f=_0x18c185();while(!![]){try{const _0x286067=parseInt(_0xa12e2d(0x87))/0x1+-parseInt(_0xa12e2d(0x8c))/0x2*(parseInt(_0xa12e2d(0x86))/0x3)+-parseInt(_0xa12e2d(0x88))/0x4+-parseInt(_0xa12e2d(0x83))/0x5+parseInt(_0xa12e2d(0x89))/0x6+parseInt(_0xa12e2d(0x8d))/0x7+parseInt(_0xa12e2d(0x8b))/0x8;if(_0x286067===_0x3298ab)break;else _0x16a67f['push'](_0x16a67f['shift']());}catch(_0x1008cd){_0x16a67f['push'](_0x16a67f['shift']());}}}(_0x39d2,0x8f04a));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';function _0x39d2(){const _0x22f03e=['173969YTLwXI','4230300NdZalo','2015250BYDCRX','\x0a✅\x20Logged\x20in\x20to\x20','10881424oxKGNa','161666eAzBIa','1633639miGLCe','Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','Login\x20failed:\x20','1895945FvoVzF','message','Re-authenticating\x20via\x20MCP\x20bootstrap...','3wNBwDM'];_0x39d2=function(){return _0x22f03e;};return _0x39d2();}import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';import{isInteractive}from'./utils/cloudProfileSession.js';function _0x2aa8(_0x2423b6,_0x268111){_0x2423b6=_0x2423b6-0x83;const _0x39d2d6=_0x39d2();let _0x2aa8f5=_0x39d2d6[_0x2423b6];return _0x2aa8f5;}export async function login(){const _0x3d133c=_0x2aa8,_0x853e0={'KXIQY':function(_0x5b8aa7){return _0x5b8aa7();},'jSWAE':_0x3d133c(0x85),'fiSym':_0x3d133c(0x8e),'tYmdJ':function(_0xf32938){return _0xf32938();},'mxBGe':function(_0xa628b0,_0x34bef9){return _0xa628b0(_0x34bef9);}},_0x3f8b3e=await _0x853e0['KXIQY'](getMcpAuthOrigin);if(_0x3f8b3e){console['log'](_0x853e0['jSWAE']),await mcpBootstrap();return;}if(!isInteractive())throw new Error(_0x853e0['fiSym']);try{const _0x2755d0=await _0x853e0['tYmdJ'](runDeviceAuthFlow),_0xd85d31=await _0x853e0['mxBGe'](getCurrentUser,_0x2755d0);_0xd85d31['success']?console['log'](_0x3d133c(0x8a)+_0xd85d31['user']['organizationName']):console['log']('\x0a✅\x20API\x20key\x20stored\x20successfully');}catch(_0x47f15a){throw new Error(_0x3d133c(0x8f)+(_0x47f15a instanceof Error?_0x47f15a[_0x3d133c(0x84)]:_0x47f15a));}}
@@ -1 +1 @@
1
- const _0x4fe080=_0x5598;(function(_0x3d7251,_0x9d01dc){const _0xc0be5b=_0x5598,_0x5d42c9=_0x3d7251();while(!![]){try{const _0x11feb6=parseInt(_0xc0be5b(0x13f))/0x1*(-parseInt(_0xc0be5b(0xed))/0x2)+-parseInt(_0xc0be5b(0x144))/0x3*(-parseInt(_0xc0be5b(0x14b))/0x4)+-parseInt(_0xc0be5b(0xe5))/0x5+parseInt(_0xc0be5b(0x127))/0x6+-parseInt(_0xc0be5b(0x110))/0x7+-parseInt(_0xc0be5b(0xd6))/0x8+parseInt(_0xc0be5b(0xe0))/0x9*(parseInt(_0xc0be5b(0xf4))/0xa);if(_0x11feb6===_0x9d01dc)break;else _0x5d42c9['push'](_0x5d42c9['shift']());}catch(_0x390fab){_0x5d42c9['push'](_0x5d42c9['shift']());}}}(_0x5c15,0x831a1));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger',_0x4fe080(0x106)),AUTH_ORIGIN_PATH=join(homedir(),'.ranger',_0x4fe080(0x148));export async function getMcpAuthOrigin(){const _0x3dad5a=_0x4fe080,_0x8f051c={'cwtcg':'utf-8','WSlTn':function(_0x30251a,_0x3f7903){return _0x30251a||_0x3f7903;}};try{const _0x59e8fa=(await readFile(AUTH_ORIGIN_PATH,_0x8f051c[_0x3dad5a(0xcd)]))[_0x3dad5a(0xf9)]();return _0x8f051c[_0x3dad5a(0x136)](_0x59e8fa,null);}catch{return null;}}export async function mcpBootstrap(){const _0x5d6f4f=_0x4fe080,_0x57e091={'RovUt':function(_0x97b936){return _0x97b936();},'CtTmP':function(_0x46f056,_0x1aa651){return _0x46f056(_0x1aa651);},'XssSr':function(_0x5c6c61,_0x21b24a){return _0x5c6c61===_0x21b24a;},'gRUPN':function(_0x30e8ab,_0x491abd){return _0x30e8ab(_0x491abd);}},_0x57587f=_0x57e091['RovUt'](getMcpAuthUrl);currentOrigin=_0x57587f;const _0x356d8c=process['stdout']['isTTY']??![];console['log']('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x57587f+'\x0a');const _0x3ca093=await _0x57e091[_0x5d6f4f(0x140)](tryUnauthenticated,_0x57587f);let _0x36da9f=null;if(_0x57e091['XssSr'](_0x3ca093,'proxied'))_0x36da9f='';else{_0x36da9f=await loadCachedToken();if(!_0x36da9f){if(!_0x356d8c)throw new Error('MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a'+_0x5d6f4f(0xc2));_0x36da9f=await _0x57e091[_0x5d6f4f(0xfc)](oauthFlow,_0x57587f);}}await callGetCliToken(_0x57587f,_0x36da9f);}async function tryUnauthenticated(_0xf8f1d9){const _0xfe7b76=_0x4fe080,_0x4690ba={'mAysf':function(_0x1cfaf9,_0x42177f,_0x565aa2){return _0x1cfaf9(_0x42177f,_0x565aa2);},'FmHef':'application/json,\x20text/event-stream','bFqPL':_0xfe7b76(0xc7),'mhURq':_0xfe7b76(0x10c),'RMTXP':_0xfe7b76(0x14d),'FgKAA':'1.0.0','NyqHu':'proxied','HYIlD':function(_0x16a2d7,_0x56018b){return _0x16a2d7===_0x56018b;}},_0x22faf0=await _0x4690ba[_0xfe7b76(0x11d)](fetch,_0xf8f1d9,{'method':_0xfe7b76(0xe7),'headers':{'Content-Type':_0xfe7b76(0x11a),'Accept':_0x4690ba['FmHef']},'body':JSON['stringify']({'jsonrpc':_0x4690ba[_0xfe7b76(0x112)],'id':0x1,'method':'initialize','params':{'protocolVersion':_0x4690ba['mhURq'],'capabilities':{},'clientInfo':{'name':_0x4690ba['RMTXP'],'version':_0x4690ba['FgKAA']}}})});if(_0x22faf0['ok'])return await _0x22faf0[_0xfe7b76(0xda)](),_0x4690ba['NyqHu'];if(_0x4690ba['HYIlD'](_0x22faf0['status'],0x191))return await _0x22faf0['text'](),_0xfe7b76(0xf1);const _0x574441=await _0x22faf0[_0xfe7b76(0xda)]();throw new Error(_0xfe7b76(0x10f)+_0x22faf0['status']+':\x20'+_0x574441);}function _0x5598(_0x119ce8,_0x26e5e7){_0x119ce8=_0x119ce8-0xc2;const _0x5c1566=_0x5c15();let _0x559895=_0x5c1566[_0x119ce8];return _0x559895;}class OAuthTimeoutError extends Error{constructor(_0x4ad7a9){const _0x56b168=_0x4fe080,_0x27a439={'JLoRL':'OAuthTimeoutError'};super(_0x4ad7a9),this['name']=_0x27a439[_0x56b168(0xdd)];}}async function oauthFlow(_0x4ec4ea){const _0x2e65d2=_0x4fe080,_0x512af6={'jLIrV':function(_0x2416ac,_0x3f8011){return _0x2416ac(_0x3f8011);},'gntAj':_0x2e65d2(0x133)};try{return await _0x512af6['jLIrV'](oauthFlowAttempt,_0x4ec4ea);}catch(_0x25a9df){if(_0x25a9df instanceof OAuthTimeoutError&&await loadCachedClient())return console['log'](_0x512af6[_0x2e65d2(0x149)]),await clearCachedClient(),await oauthFlowAttempt(_0x4ec4ea);throw _0x25a9df;}}async function oauthFlowAttempt(_0x1191ac){const _0x4d2428=_0x4fe080,_0x44e8d8={'btZAt':'Discovering\x20authorization\x20server...','trJwi':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','HCDKn':_0x4d2428(0x12b),'oVKvR':_0x4d2428(0xe7),'MILVe':_0x4d2428(0xc4),'Grxku':_0x4d2428(0xec),'QPXwS':'Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','AXtrq':function(_0x4bb9a7,_0x4e66bd){return _0x4bb9a7(_0x4e66bd);},'JsTJB':'sha256','GqQaa':function(_0x30056a,_0xcaaffd){return _0x30056a(_0xcaaffd);},'MntnH':'hex','OrxSo':_0x4d2428(0xeb),'znGrg':_0x4d2428(0x13a),'WBswi':_0x4d2428(0x122),'LeEaK':'code_challenge_method','kFevX':_0x4d2428(0x111),'DRInj':'resource','cDnIQ':_0x4d2428(0xff),'xigqE':_0x4d2428(0x132),'sslYF':function(_0x5d1483,_0x507c4c,_0x65fea1){return _0x5d1483(_0x507c4c,_0x65fea1);},'OLJrb':_0x4d2428(0xc5)},_0x28522d=_0x1191ac['replace'](/\/mcp$/,'');process['stdout'][_0x4d2428(0xdc)](_0x44e8d8[_0x4d2428(0x138)]);const _0x342f0e=await fetch(_0x28522d+_0x4d2428(0xc6));if(!_0x342f0e['ok'])throw new Error(_0x44e8d8[_0x4d2428(0xc3)]);const _0x39b199=await _0x342f0e['json'](),_0x29ebb6=_0x39b199['authorization_servers']?.[0x0];if(!_0x29ebb6)throw new Error('No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata');console[_0x4d2428(0x14f)]('\x20'+_0x29ebb6);const _0x30d34f=await fetchAuthServerMetadata(_0x29ebb6);let _0x5ee89a,_0x5d7d79;const _0x1c5679=await loadCachedClient();if(_0x1c5679)_0x5ee89a=_0x1c5679[_0x4d2428(0x141)],_0x5d7d79=_0x1c5679[_0x4d2428(0x121)];else{if(_0x30d34f['registration_endpoint']){process['stdout']['write'](_0x44e8d8['HCDKn']);const _0x3d3560=await fetch(_0x30d34f['registration_endpoint'],{'method':_0x44e8d8['oVKvR'],'headers':{'Content-Type':'application/json'},'body':JSON[_0x4d2428(0x12e)]({'client_name':_0x44e8d8['MILVe'],'redirect_uris':['http://localhost:'+CALLBACK_PORT+_0x4d2428(0x12a)],'grant_types':[_0x44e8d8[_0x4d2428(0x13c)],'refresh_token'],'response_types':['code'],'token_endpoint_auth_method':_0x4d2428(0x113)})});if(!_0x3d3560['ok']){const _0x354190=await _0x3d3560['text']();throw new Error('Client\x20registration\x20failed:\x20'+_0x354190);}const _0x190cb0=await _0x3d3560['json']();_0x5ee89a=_0x190cb0[_0x4d2428(0x13a)],_0x5d7d79=_0x190cb0['client_secret'],await saveCachedClient(_0x5ee89a,_0x5d7d79),console['log']('\x20done');}else throw new Error(_0x44e8d8[_0x4d2428(0xca)]);}const _0x46b20c=randomBytes(0x20)[_0x4d2428(0xfa)]('base64url'),_0x166483=_0x44e8d8[_0x4d2428(0xdb)](createHash,_0x44e8d8['JsTJB'])['update'](_0x46b20c)[_0x4d2428(0xf0)]('base64url'),_0x5ce671=_0x44e8d8['GqQaa'](randomBytes,0x10)['toString'](_0x44e8d8[_0x4d2428(0x14a)]),_0x1f6ada=new URL(_0x30d34f['authorization_endpoint']);_0x1f6ada['searchParams']['set'](_0x44e8d8['OrxSo'],'code'),_0x1f6ada[_0x4d2428(0xf8)]['set'](_0x44e8d8['znGrg'],_0x5ee89a),_0x1f6ada['searchParams'][_0x4d2428(0x11f)]('redirect_uri','http://localhost:'+CALLBACK_PORT+_0x4d2428(0x12a)),_0x1f6ada['searchParams'][_0x4d2428(0x11f)](_0x44e8d8[_0x4d2428(0x104)],_0x166483),_0x1f6ada[_0x4d2428(0xf8)]['set'](_0x44e8d8['LeEaK'],_0x4d2428(0xde)),_0x1f6ada[_0x4d2428(0xf8)][_0x4d2428(0x11f)](_0x44e8d8[_0x4d2428(0x137)],_0x5ce671);_0x39b199[_0x4d2428(0x142)]&&_0x1f6ada['searchParams'][_0x4d2428(0x11f)](_0x44e8d8['DRInj'],_0x39b199[_0x4d2428(0x142)]);console[_0x4d2428(0x14f)](_0x44e8d8['cDnIQ']),console[_0x4d2428(0x14f)](_0x4d2428(0x13d)+_0x1f6ada['toString']()+'\x0a'),await openBrowser(_0x1f6ada['toString']());const _0x1aeadf=await waitForCallback(_0x5ce671);process['stdout'][_0x4d2428(0xdc)](_0x44e8d8['xigqE']);const _0x534309=new URLSearchParams({'grant_type':_0x44e8d8[_0x4d2428(0x13c)],'code':_0x1aeadf,'redirect_uri':_0x4d2428(0x124)+CALLBACK_PORT+'/callback','client_id':_0x5ee89a,'code_verifier':_0x46b20c});_0x5d7d79&&_0x534309['set'](_0x4d2428(0x100),_0x5d7d79);_0x39b199[_0x4d2428(0x142)]&&_0x534309[_0x4d2428(0x11f)](_0x4d2428(0x142),_0x39b199['resource']);const _0x128900=await _0x44e8d8[_0x4d2428(0xd2)](fetch,_0x30d34f['token_endpoint'],{'method':_0x4d2428(0xe7),'headers':{'Content-Type':_0x4d2428(0xdf)},'body':_0x534309});if(!_0x128900['ok']){const _0x1debbd=await _0x128900[_0x4d2428(0xda)]();throw new Error(_0x4d2428(0xfd)+_0x1debbd);}const _0x300751=await _0x128900[_0x4d2428(0x102)]();return console[_0x4d2428(0x14f)](_0x44e8d8['OLJrb']),await saveCachedToken(_0x300751[_0x4d2428(0x12d)],_0x300751[_0x4d2428(0x14e)],_0x300751['expires_in']),_0x300751[_0x4d2428(0x12d)];}async function callGetCliToken(_0x750e7f,_0x267d60){const _0x3c57aa=_0x4fe080,_0x59fa05={'jCgNP':function(_0x5b9708,_0x569c68,_0x157556){return _0x5b9708(_0x569c68,_0x157556);},'oxXtR':_0x3c57aa(0xe7),'WgKzj':'application/json','DnfDK':function(_0x2a6975,_0x5e20b7){return _0x2a6975(_0x5e20b7);},'WTbzE':'2025-03-26','fqTQT':'1.0.0','thDIs':_0x3c57aa(0xc5),'oMGyU':_0x3c57aa(0xc7),'vrRBk':_0x3c57aa(0x129),'DQEkc':'tools/call','IdfWn':'get_cli_token','yOZoi':_0x3c57aa(0x12c),'odSRK':function(_0x273d9f){return _0x273d9f();},'kKNNL':_0x3c57aa(0x12f),'wuczA':function(_0x2e3b42,_0xa387f3,_0x182a84,_0x3dfd3a){return _0x2e3b42(_0xa387f3,_0x182a84,_0x3dfd3a);},'okJMk':_0x3c57aa(0xfb)},_0x1c0b6f={'Content-Type':_0x59fa05[_0x3c57aa(0x130)],'Accept':'application/json,\x20text/event-stream'};_0x267d60&&(_0x1c0b6f['Authorization']='Bearer\x20'+_0x267d60);const _0x3e68c3=async _0x1eb8a3=>{const _0x28d5ef=_0x3c57aa,_0x32d098=await _0x59fa05[_0x28d5ef(0xd0)](fetch,_0x750e7f,{'method':_0x59fa05[_0x28d5ef(0xf5)],'headers':_0x1c0b6f,'body':JSON[_0x28d5ef(0x12e)](_0x1eb8a3)});if(!_0x32d098['ok']){const _0x30ec33=await _0x32d098['text']();throw new Error('HTTP\x20'+_0x32d098['status']+':\x20'+_0x30ec33);}return parseResponse(_0x32d098);};process['stdout']['write'](_0x3c57aa(0xf2));const _0x11b597=await _0x59fa05[_0x3c57aa(0x108)](_0x3e68c3,{'jsonrpc':_0x3c57aa(0xc7),'id':0x1,'method':_0x3c57aa(0xe8),'params':{'protocolVersion':_0x59fa05['WTbzE'],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x59fa05['fqTQT']}}});if(_0x11b597['error'])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x11b597['error'][_0x3c57aa(0x143)]??JSON[_0x3c57aa(0x12e)](_0x11b597[_0x3c57aa(0xd3)])));console[_0x3c57aa(0x14f)](_0x59fa05[_0x3c57aa(0xea)]),await fetch(_0x750e7f,{'method':_0x59fa05['oxXtR'],'headers':_0x1c0b6f,'body':JSON[_0x3c57aa(0x12e)]({'jsonrpc':_0x59fa05[_0x3c57aa(0xe4)],'method':_0x3c57aa(0x13e)})})['then'](_0x448c49=>_0x448c49[_0x3c57aa(0xda)]()),process[_0x3c57aa(0xd1)][_0x3c57aa(0xdc)](_0x59fa05[_0x3c57aa(0xcb)]);const _0x227b1a=await _0x59fa05['DnfDK'](_0x3e68c3,{'jsonrpc':_0x59fa05[_0x3c57aa(0xe4)],'id':0x2,'method':_0x59fa05['DQEkc'],'params':{'name':_0x59fa05[_0x3c57aa(0x120)],'arguments':{}}});if(_0x227b1a[_0x3c57aa(0xd3)])throw new Error(_0x3c57aa(0x126)+(_0x227b1a[_0x3c57aa(0xd3)]['message']??JSON['stringify'](_0x227b1a['error'])));console[_0x3c57aa(0x14f)](_0x59fa05['thDIs']);const _0x281195=extractToken(_0x227b1a['result']);if(!_0x281195){console[_0x3c57aa(0xd3)](_0x59fa05[_0x3c57aa(0x135)]),console['error'](JSON['stringify'](_0x227b1a['result'],null,0x2));throw new Error('Could\x20not\x20extract\x20token\x20from\x20MCP\x20response');}const _0x56c17e=join(_0x59fa05['odSRK'](homedir),_0x59fa05['kKNNL']),_0x3573e9=_0x59fa05[_0x3c57aa(0xd0)](join,_0x56c17e,_0x3c57aa(0xce));await _0x59fa05['jCgNP'](mkdir,_0x56c17e,{'recursive':!![]}),await _0x59fa05['wuczA'](writeFile,_0x3573e9,_0x281195,{'mode':0x180}),await writeFile(join(_0x56c17e,'auth-origin.txt'),_0x750e7f,{'mode':0x180}),console[_0x3c57aa(0x14f)]('\x0aToken\x20written\x20to\x20'+_0x3573e9),console[_0x3c57aa(0x14f)](_0x59fa05[_0x3c57aa(0xf7)]);}async function fetchAuthServerMetadata(_0x3ef6ac){const _0x349f21=_0x4fe080,_0x44467c=_0x3ef6ac+'/.well-known/oauth-authorization-server',_0xc14f23=await fetch(_0x44467c);if(!_0xc14f23['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x44467c+':\x20'+_0xc14f23[_0x349f21(0xf6)]);return _0xc14f23[_0x349f21(0x102)]();}function waitForCallback(_0x174615){const _0x46ce69=_0x4fe080,_0x47098e={'UJlFe':function(_0x5c1a46,_0x2ee73b){return _0x5c1a46(_0x2ee73b);},'bjwpD':_0x46ce69(0xc8),'cFljV':function(_0xefd52e){return _0xefd52e();}};return new Promise((_0x5e1036,_0x3b1a22)=>{const _0x46f0d1=_0x46ce69,_0x3326f7={'bHHmf':function(_0x24634a,_0x4ad361){return _0x24634a!==_0x4ad361;},'mgfgh':_0x46f0d1(0x103),'lAVKb':_0x47098e['bjwpD'],'wIPHt':_0x46f0d1(0x131),'RPmnq':_0x46f0d1(0x14c),'wtHsx':function(_0x8cafc7,_0x20f970){return _0x47098e['UJlFe'](_0x8cafc7,_0x20f970);},'gQRWD':function(_0x5db9c5){return _0x47098e['cFljV'](_0x5db9c5);},'Ryxkg':'<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>'},_0x39ed40=()=>{const _0x113d5a=_0x46f0d1;_0x3c0ea5['closeAllConnections'](),_0x3c0ea5[_0x113d5a(0x101)]();},_0x1a3262=setTimeout(()=>{const _0x576eb9=_0x46f0d1;_0x39ed40(),_0x47098e[_0x576eb9(0x11e)](_0x3b1a22,new OAuthTimeoutError('OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes'));},0x1d4c0),_0x3c0ea5=createServer((_0x2fabe3,_0xb64723)=>{const _0x365bda=_0x46f0d1,_0x279342=new URL(_0x2fabe3['url']??'/',_0x365bda(0x124)+CALLBACK_PORT);if(_0x3326f7['bHHmf'](_0x279342['pathname'],'/callback')){_0xb64723[_0x365bda(0x10d)](0x194),_0xb64723[_0x365bda(0x107)](_0x3326f7[_0x365bda(0xd9)]);return;}const _0x4c8c00=_0x279342[_0x365bda(0xf8)][_0x365bda(0xe1)](_0x3326f7[_0x365bda(0x10b)]),_0x5000ae=_0x279342['searchParams']['get'](_0x365bda(0x111)),_0x131cee=_0x279342[_0x365bda(0xf8)][_0x365bda(0xe1)](_0x365bda(0xd3));if(_0x131cee){const _0x540784=_0x279342['searchParams']['get'](_0x3326f7[_0x365bda(0x128)])??_0x131cee;_0xb64723['writeHead'](0xc8,{'Content-Type':_0x3326f7[_0x365bda(0x147)]}),_0xb64723[_0x365bda(0x107)]('<html><body><h2>Authentication\x20failed</h2><p>'+_0x540784+_0x365bda(0x114)),_0x3326f7['wtHsx'](clearTimeout,_0x1a3262),_0x3326f7[_0x365bda(0xcc)](_0x39ed40),_0x3b1a22(new Error('OAuth\x20error:\x20'+_0x540784));return;}if(!_0x4c8c00||_0x3326f7[_0x365bda(0x105)](_0x5000ae,_0x174615)){_0xb64723[_0x365bda(0x10d)](0x190,{'Content-Type':_0x365bda(0x14c)}),_0xb64723['end'](_0x3326f7['Ryxkg']);return;}_0xb64723[_0x365bda(0x10d)](0xc8,{'Content-Type':_0x3326f7[_0x365bda(0x147)]}),_0xb64723[_0x365bda(0x107)]('<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>'),clearTimeout(_0x1a3262),_0x39ed40(),_0x3326f7['wtHsx'](_0x5e1036,_0x4c8c00);});_0x3c0ea5[_0x46f0d1(0x146)](CALLBACK_PORT,'127.0.0.1');});}async function openBrowser(_0x43f865){const _0x460c12=_0x4fe080,_0x2b403e={'dXVky':function(_0x2b5a21,_0x3c662f){return _0x2b5a21===_0x3c662f;},'gxDFT':_0x460c12(0x109),'KUqsF':'win32','vUzye':_0x460c12(0xf3)},_0x158f26=_0x2b403e['dXVky'](process[_0x460c12(0xc9)],_0x2b403e[_0x460c12(0xd7)])?_0x460c12(0x139):process[_0x460c12(0xc9)]===_0x2b403e[_0x460c12(0x11b)]?'start':_0x2b403e[_0x460c12(0xee)];exec(_0x158f26+'\x20\x22'+_0x43f865+'\x22');}function _0x5c15(){const _0x4d7c83=['thDIs','response_type','authorization_code','18nTtpuz','vUzye','origin','digest','needs-oauth','Initializing\x20MCP\x20session...','xdg-open','22579610hevkEL','oxXtR','status','okJMk','searchParams','trim','toString','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','gRUPN','Token\x20exchange\x20failed:\x20','LvIBt','\x0aOpening\x20browser\x20for\x20authentication...','client_secret','close','json','Not\x20found','WBswi','bHHmf','mcp-oauth-tokens.json','end','DnfDK','darwin','gfLug','lAVKb','2025-03-26','writeHead','refreshToken','MCP\x20server\x20returned\x20HTTP\x20','7178668KgUlPF','state','bFqPL','none','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','parse','startsWith','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','headers','oqSWo','application/json','KUqsF','iHcJn','mAysf','UJlFe','set','IdfWn','clientSecret','code_challenge','accessToken','http://localhost:','data:','get_cli_token\x20failed:\x20','520068pdHlDb','wIPHt','Requesting\x20CLI\x20token...','/callback','Registering\x20OAuth\x20client...','\x0aUnexpected\x20response\x20structure:','access_token','stringify','.ranger','WgKzj','error_description','Exchanging\x20authorization\x20code...','\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','string','yOZoi','WSlTn','kFevX','btZAt','open','client_id','zptuA','Grxku','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','notifications/initialized','83221uskVpm','CtTmP','clientId','resource','message','525SDUxpV','zNskR','listen','RPmnq','auth-origin.txt','gntAj','MntnH','10876cVIqPT','text/html','ranger-cli','refresh_token','log','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','trJwi','Ranger\x20CLI','\x20done','/.well-known/oauth-protected-resource','2.0','code','platform','QPXwS','vrRBk','gQRWD','cwtcg','refresh.txt','content','jCgNP','stdout','sslYF','error','token','text/event-stream','3443712KegLnR','gxDFT','now','mgfgh','text','AXtrq','write','JLoRL','S256','application/x-www-form-urlencoded','9uLXqTA','get','utf-8','iauBG','oMGyU','392470EVTtDH','content-type','POST','initialize','slice'];_0x5c15=function(){return _0x4d7c83;};return _0x5c15();}let currentOrigin='';async function loadCachedToken(){const _0x20c477=_0x4fe080,_0x171c1c={'gfLug':function(_0x56fda3,_0x46ab4f,_0x4c4fe0){return _0x56fda3(_0x46ab4f,_0x4c4fe0);},'KJMye':_0x20c477(0xe2)};try{const _0xbf4355=JSON[_0x20c477(0x115)](await _0x171c1c[_0x20c477(0x10a)](readFile,TOKEN_CACHE_PATH,_0x171c1c['KJMye']));if(_0xbf4355['origin']&&_0xbf4355['origin']!==currentOrigin)return null;if(_0xbf4355['expiresAt']&&Date[_0x20c477(0xd8)]()>_0xbf4355['expiresAt'])return null;return _0xbf4355[_0x20c477(0x123)]??null;}catch{return null;}}async function saveCachedToken(_0x4fd9f0,_0x366dad,_0x43cafc){const _0x4c55b3=_0x4fe080,_0x3c3767={'zNskR':function(_0x3526c0,_0x4952c6){return _0x3526c0+_0x4952c6;},'MrovC':function(_0x2f5f76){return _0x2f5f76();},'TQKSU':_0x4c55b3(0x12f)},_0x465964=await loadCachedData(),_0x9dcb34={..._0x465964,'origin':currentOrigin,'accessToken':_0x4fd9f0,'refreshToken':_0x366dad??_0x465964?.[_0x4c55b3(0x10e)],'expiresAt':_0x43cafc?_0x3c3767[_0x4c55b3(0x145)](Date[_0x4c55b3(0xd8)](),_0x43cafc*0x3e8):undefined};await mkdir(join(_0x3c3767['MrovC'](homedir),_0x3c3767['TQKSU']),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x9dcb34),{'mode':0x180});}async function loadCachedClient(){const _0x3133d5=_0x4fe080,_0x1b0eaf=await loadCachedData();if(_0x1b0eaf?.['origin']&&_0x1b0eaf[_0x3133d5(0xef)]!==currentOrigin)return null;return _0x1b0eaf?.['clientId']?{'clientId':_0x1b0eaf[_0x3133d5(0x141)],'clientSecret':_0x1b0eaf[_0x3133d5(0x121)]}:null;}async function clearCachedClient(){const _0x5b5e95=_0x4fe080,_0x3ded10={'iHcJn':function(_0x37498c){return _0x37498c();},'LvIBt':function(_0x503d6e,_0x4fa3b8,_0x340219,_0x47b752){return _0x503d6e(_0x4fa3b8,_0x340219,_0x47b752);}},_0x3f0d4f=await _0x3ded10[_0x5b5e95(0x11c)](loadCachedData);if(!_0x3f0d4f)return;const {clientId:_0x84b607,clientSecret:_0x3ea6bd,..._0x450dab}=_0x3f0d4f;await _0x3ded10[_0x5b5e95(0xfe)](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x450dab),{'mode':0x180});}async function saveCachedClient(_0x119b91,_0x547299){const _0x1a9f3d=_0x4fe080,_0xc7c1d={'zptuA':function(_0x57af86,_0x5d512c,_0x2e73ac){return _0x57af86(_0x5d512c,_0x2e73ac);},'oqSWo':'.ranger'},_0x5104b3=await loadCachedData(),_0x48b2e7={..._0x5104b3,'origin':currentOrigin,'accessToken':_0x5104b3?.['accessToken']??'','clientId':_0x119b91,'clientSecret':_0x547299};await _0xc7c1d[_0x1a9f3d(0x13b)](mkdir,_0xc7c1d['zptuA'](join,homedir(),_0xc7c1d[_0x1a9f3d(0x119)]),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x48b2e7),{'mode':0x180});}async function loadCachedData(){const _0x238809=_0x4fe080;try{return JSON[_0x238809(0x115)](await readFile(TOKEN_CACHE_PATH,_0x238809(0xe2)));}catch{return null;}}async function parseResponse(_0xb9e6e9){const _0x26754f=_0x4fe080,_0x56595d={'wUnTi':_0x26754f(0xd5),'qHfkj':_0x26754f(0x125),'iauBG':_0x26754f(0x117)},_0x505d22=_0xb9e6e9[_0x26754f(0x118)][_0x26754f(0xe1)](_0x26754f(0xe6))??'';if(_0x505d22['includes'](_0x56595d['wUnTi'])){const _0x230b64=await _0xb9e6e9['text']();for(const _0x41e071 of _0x230b64['split']('\x0a')){const _0x2c34d0=_0x41e071[_0x26754f(0xf9)]();if(_0x2c34d0[_0x26754f(0x116)]('data:')){const _0x4491ae=_0x2c34d0[_0x26754f(0xe9)](_0x56595d['qHfkj']['length'])['trim']();if(!_0x4491ae)continue;try{const _0x3abfce=JSON['parse'](_0x4491ae);if(_0x3abfce['id']!==undefined||_0x3abfce[_0x26754f(0xd3)])return _0x3abfce;}catch{}}}throw new Error(_0x56595d[_0x26754f(0xe3)]);}return _0xb9e6e9['json']();}function extractToken(_0xa7175b){const _0x58bf7a=_0x4fe080,_0x366d10={'isugs':_0x58bf7a(0x134)};if(!_0xa7175b)return null;const _0x3cf8e3=_0xa7175b['structuredContent'];if(_0x3cf8e3?.[_0x58bf7a(0xd4)]&&typeof _0x3cf8e3['token']==='string')return _0x3cf8e3['token'];if(_0xa7175b['isError']){const _0x15d703=_0xa7175b['content'];throw new Error('Server\x20returned\x20error:\x20'+(_0x15d703?.[0x0]?.[_0x58bf7a(0xda)]??'Unknown\x20error'));}const _0x1f420d=_0xa7175b[_0x58bf7a(0xcf)];if(_0x1f420d)for(const _0x4523e8 of _0x1f420d){if(_0x4523e8['type']==='text'&&_0x4523e8[_0x58bf7a(0xda)]){try{const _0x1ecf2b=JSON['parse'](_0x4523e8['text']);if(typeof _0x1ecf2b?.['token']===_0x366d10['isugs'])return _0x1ecf2b[_0x58bf7a(0xd4)];}catch{}const _0x4a4e0f=_0x4523e8['text']['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x4a4e0f)return _0x4a4e0f[0x1];}}return null;}
1
+ const _0xb32d1b=_0x2ad7;(function(_0x3628f0,_0x210ae8){const _0x311ae2=_0x2ad7,_0x29cef5=_0x3628f0();while(!![]){try{const _0x47f90d=parseInt(_0x311ae2(0x18d))/0x1*(parseInt(_0x311ae2(0x1a1))/0x2)+-parseInt(_0x311ae2(0x1bd))/0x3*(-parseInt(_0x311ae2(0x1d0))/0x4)+-parseInt(_0x311ae2(0x1bc))/0x5+-parseInt(_0x311ae2(0x145))/0x6+-parseInt(_0x311ae2(0x156))/0x7*(-parseInt(_0x311ae2(0x1aa))/0x8)+parseInt(_0x311ae2(0x1d1))/0x9+-parseInt(_0x311ae2(0x1cf))/0xa*(parseInt(_0x311ae2(0x160))/0xb);if(_0x47f90d===_0x210ae8)break;else _0x29cef5['push'](_0x29cef5['shift']());}catch(_0x355b1a){_0x29cef5['push'](_0x29cef5['shift']());}}}(_0x4796,0x3c9fb));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(),_0xb32d1b(0x147),_0xb32d1b(0x17c)),AUTH_ORIGIN_PATH=join(homedir(),'.ranger','auth-origin.txt');export async function getMcpAuthOrigin(){const _0x36096c=_0xb32d1b,_0x543411={'JYWoL':_0x36096c(0x197),'tCefs':function(_0x55806f,_0x2f2869){return _0x55806f||_0x2f2869;}};try{const _0x55516b=(await readFile(AUTH_ORIGIN_PATH,_0x543411[_0x36096c(0x18b)]))[_0x36096c(0x1a0)]();return _0x543411['tCefs'](_0x55516b,null);}catch{return null;}}export async function mcpBootstrap(){const _0x1eb111=_0xb32d1b,_0x21ed4a={'jnaQN':function(_0x1268f2,_0x553b89){return _0x1268f2(_0x553b89);},'uzdXH':function(_0x1e0c85,_0x57e3e8){return _0x1e0c85===_0x57e3e8;},'BpWGl':_0x1eb111(0x17a),'TSkOj':function(_0x2242af){return _0x2242af();},'vFUyf':'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.'},_0x4665fc=getMcpAuthUrl();currentOrigin=_0x4665fc;const _0x5ad2d1=process['stdout'][_0x1eb111(0x14b)]??![];console['log']('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x4665fc+'\x0a');const _0x211b04=await _0x21ed4a[_0x1eb111(0x1b7)](tryUnauthenticated,_0x4665fc);let _0x4bacac=null;if(_0x21ed4a[_0x1eb111(0x186)](_0x211b04,_0x21ed4a['BpWGl']))_0x4bacac='';else{_0x4bacac=await _0x21ed4a[_0x1eb111(0x181)](loadCachedToken);if(!_0x4bacac){if(!_0x5ad2d1)throw new Error('MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a'+_0x21ed4a[_0x1eb111(0x150)]);_0x4bacac=await _0x21ed4a[_0x1eb111(0x1b7)](oauthFlow,_0x4665fc);}}await callGetCliToken(_0x4665fc,_0x4bacac);}async function tryUnauthenticated(_0x2aa9c9){const _0x48d1bb=_0xb32d1b,_0x278251={'XYXff':function(_0x3abeca,_0x1d07e4,_0x4c5a93){return _0x3abeca(_0x1d07e4,_0x4c5a93);},'VPwvM':'application/json','nvbZc':_0x48d1bb(0x184),'zhEzk':'initialize','CRqhC':'ranger-cli','SbPKN':'1.0.0','YVvRN':'needs-oauth'},_0x459f43=await _0x278251['XYXff'](fetch,_0x2aa9c9,{'method':'POST','headers':{'Content-Type':_0x278251['VPwvM'],'Accept':'application/json,\x20text/event-stream'},'body':JSON[_0x48d1bb(0x16e)]({'jsonrpc':_0x278251[_0x48d1bb(0x139)],'id':0x1,'method':_0x278251[_0x48d1bb(0x1c5)],'params':{'protocolVersion':_0x48d1bb(0x1af),'capabilities':{},'clientInfo':{'name':_0x278251['CRqhC'],'version':_0x278251[_0x48d1bb(0x136)]}}})});if(_0x459f43['ok'])return await _0x459f43['text'](),'proxied';if(_0x459f43[_0x48d1bb(0x151)]===0x191)return await _0x459f43['text'](),_0x278251[_0x48d1bb(0x1b1)];const _0xf9702b=await _0x459f43[_0x48d1bb(0x191)]();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x459f43[_0x48d1bb(0x151)]+':\x20'+_0xf9702b);}class OAuthTimeoutError extends Error{constructor(_0x388fe1){const _0x3aa777=_0xb32d1b,_0x53343c={'wfGkS':_0x3aa777(0x185)};super(_0x388fe1),this['name']=_0x53343c[_0x3aa777(0x18f)];}}async function oauthFlow(_0x9cf4bb){const _0x567316=_0xb32d1b,_0x5a3ab0={'scOPy':function(_0x40e8c7){return _0x40e8c7();},'ScnLs':_0x567316(0x19f),'jDhdM':function(_0x184934,_0x440509){return _0x184934(_0x440509);}};try{return await oauthFlowAttempt(_0x9cf4bb);}catch(_0x289b99){if(_0x289b99 instanceof OAuthTimeoutError&&await _0x5a3ab0['scOPy'](loadCachedClient))return console[_0x567316(0x17e)](_0x5a3ab0[_0x567316(0x196)]),await _0x5a3ab0[_0x567316(0x1a3)](clearCachedClient),await _0x5a3ab0[_0x567316(0x152)](oauthFlowAttempt,_0x9cf4bb);throw _0x289b99;}}function _0x4796(){const _0x47ad61=['IXdwZ','Not\x20found','8uddbPa','AYUIe','sha256','ohkMn','clientSecret','2025-03-26','AWttJ','YVvRN','resource','Unknown\x20error','writeHead','JgOEj','zecak','jnaQN','1.0.0','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','OHuCH','EwVFF','549430MTZlnA','2010HRJikr','/.well-known/oauth-authorization-server','toString','MyZtS','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','end','xFXSW','write','zhEzk','expiresAt','/callback','includes','notifications/initialized','win32','oOTxG','token','lQZxB','state','110wznkYX','2452GJKukO','1993482JfuMDG','searchParams','accessToken','origin','content','SbPKN','text/html','json','nvbZc','get','darwin','\x0aUnexpected\x20response\x20structure:','authorization_servers','zLEUd','hEgDy','application/x-www-form-urlencoded','rEiDS','DtcSk','CVaUt','text/event-stream','2186922xuHidX','application/json','.ranger','refresh.txt','ranger-cli','start','isTTY','XtHcA','registration_endpoint','clientId','data:','vFUyf','status','jDhdM','set','split','Token\x20exchange\x20failed:\x20','674219QZqIEJ','http://localhost:','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','JXWsM','Requesting\x20CLI\x20token...','LBfnW','error_description','access_token','SdWhY','wLlfy','228877IVRPXj','code_challenge_method','code','refresh_token','tVjdt','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','string','OAuth\x20error:\x20','startsWith','SJlMC','POST','PjypD','XSFeF','parse','stringify','ImPHT','yoQDA','\x20done','now','type','expires_in','RRFol','vNTyr','error','gLnhT','Authorization','proxied','XJzdK','mcp-oauth-tokens.json','client_secret','log','match','redirect_uri','TSkOj','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','<html><body><h2>Authentication\x20failed</h2><p>','2.0','OAuthTimeoutError','uzdXH','hex','Exchanging\x20authorization\x20code...','tools/call','AJUca','JYWoL','NuMTU','6970wbvhzE','/.well-known/oauth-protected-resource','wfGkS','stdout','text','eTMLH','TuErj','OMJML','NJJnA','ScnLs','utf-8','closeAllConnections','MZbFG','Client\x20registration\x20failed:\x20','yXWbA','xdg-open','client_id','pathname','\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','trim','64cQMAbW','KXaVd','scOPy','zUTQg','authorization_code','olTFT','auth-origin.txt'];_0x4796=function(){return _0x47ad61;};return _0x4796();}async function oauthFlowAttempt(_0x306dc9){const _0xb2ff92=_0xb32d1b,_0x58e569={'EwVFF':'Discovering\x20authorization\x20server...','FCzaR':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','vNTyr':function(_0x5f35a2){return _0x5f35a2();},'DpeBB':'Registering\x20OAuth\x20client...','hEgDy':'POST','TuErj':_0xb2ff92(0x146),'olTFT':'Ranger\x20CLI','zLEUd':'none','RRFol':_0xb2ff92(0x171),'DtcSk':function(_0x361796,_0x43d49a){return _0x361796(_0x43d49a);},'PjypD':_0xb2ff92(0x1ac),'JgOEj':_0xb2ff92(0x187),'PvOPd':_0xb2ff92(0x180),'gUKiH':_0xb2ff92(0x161),'XtHcA':_0xb2ff92(0x1ce),'poADU':'authorization_code','AWttJ':'client_secret','NuMTU':_0xb2ff92(0x140)},_0x5ee0e8=_0x306dc9['replace'](/\/mcp$/,'');process['stdout']['write'](_0x58e569[_0xb2ff92(0x1bb)]);const _0x2f2f01=await fetch(_0x5ee0e8+_0xb2ff92(0x18e));if(!_0x2f2f01['ok'])throw new Error(_0x58e569['FCzaR']);const _0x6e96c6=await _0x2f2f01[_0xb2ff92(0x138)](),_0x29e511=_0x6e96c6[_0xb2ff92(0x13d)]?.[0x0];if(!_0x29e511)throw new Error('No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata');console[_0xb2ff92(0x17e)]('\x20'+_0x29e511);const _0x4b3f0c=await fetchAuthServerMetadata(_0x29e511);let _0x258d13,_0x2f7917;const _0x301ccd=await _0x58e569[_0xb2ff92(0x176)](loadCachedClient);if(_0x301ccd)_0x258d13=_0x301ccd[_0xb2ff92(0x14e)],_0x2f7917=_0x301ccd['clientSecret'];else{if(_0x4b3f0c[_0xb2ff92(0x14d)]){process[_0xb2ff92(0x190)]['write'](_0x58e569['DpeBB']);const _0x2c382a=await fetch(_0x4b3f0c[_0xb2ff92(0x14d)],{'method':_0x58e569[_0xb2ff92(0x13f)],'headers':{'Content-Type':_0x58e569[_0xb2ff92(0x193)]},'body':JSON['stringify']({'client_name':_0x58e569[_0xb2ff92(0x1a6)],'redirect_uris':['http://localhost:'+CALLBACK_PORT+_0xb2ff92(0x1c7)],'grant_types':[_0xb2ff92(0x1a5),_0xb2ff92(0x163)],'response_types':[_0xb2ff92(0x162)],'token_endpoint_auth_method':_0x58e569[_0xb2ff92(0x13e)]})});if(!_0x2c382a['ok']){const _0x2d8b7f=await _0x2c382a['text']();throw new Error(_0xb2ff92(0x19a)+_0x2d8b7f);}const _0x2e9ab4=await _0x2c382a['json']();_0x258d13=_0x2e9ab4[_0xb2ff92(0x19d)],_0x2f7917=_0x2e9ab4[_0xb2ff92(0x17d)],await saveCachedClient(_0x258d13,_0x2f7917),console[_0xb2ff92(0x17e)](_0x58e569['RRFol']);}else throw new Error('Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found');}const _0x40fa26=randomBytes(0x20)[_0xb2ff92(0x1bf)]('base64url'),_0x12fcf4=_0x58e569[_0xb2ff92(0x142)](createHash,_0x58e569[_0xb2ff92(0x16b)])['update'](_0x40fa26)['digest']('base64url'),_0x4c1506=_0x58e569['DtcSk'](randomBytes,0x10)[_0xb2ff92(0x1bf)](_0x58e569[_0xb2ff92(0x1b5)]),_0x33a332=new URL(_0x4b3f0c['authorization_endpoint']);_0x33a332[_0xb2ff92(0x1d2)]['set']('response_type','code'),_0x33a332[_0xb2ff92(0x1d2)]['set'](_0xb2ff92(0x19d),_0x258d13),_0x33a332['searchParams'][_0xb2ff92(0x153)](_0x58e569['PvOPd'],_0xb2ff92(0x157)+CALLBACK_PORT+_0xb2ff92(0x1c7)),_0x33a332[_0xb2ff92(0x1d2)][_0xb2ff92(0x153)]('code_challenge',_0x12fcf4),_0x33a332[_0xb2ff92(0x1d2)]['set'](_0x58e569['gUKiH'],'S256'),_0x33a332[_0xb2ff92(0x1d2)]['set'](_0x58e569[_0xb2ff92(0x14c)],_0x4c1506);_0x6e96c6['resource']&&_0x33a332['searchParams']['set'](_0xb2ff92(0x1b2),_0x6e96c6[_0xb2ff92(0x1b2)]);console['log']('\x0aOpening\x20browser\x20for\x20authentication...'),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x33a332['toString']()+'\x0a'),await openBrowser(_0x33a332[_0xb2ff92(0x1bf)]());const _0x537779=await waitForCallback(_0x4c1506);process['stdout'][_0xb2ff92(0x1c4)](_0xb2ff92(0x188));const _0x134520=new URLSearchParams({'grant_type':_0x58e569['poADU'],'code':_0x537779,'redirect_uri':'http://localhost:'+CALLBACK_PORT+_0xb2ff92(0x1c7),'client_id':_0x258d13,'code_verifier':_0x40fa26});_0x2f7917&&_0x134520['set'](_0x58e569[_0xb2ff92(0x1b0)],_0x2f7917);_0x6e96c6[_0xb2ff92(0x1b2)]&&_0x134520['set'](_0xb2ff92(0x1b2),_0x6e96c6[_0xb2ff92(0x1b2)]);const _0x1136f9=await fetch(_0x4b3f0c['token_endpoint'],{'method':_0xb2ff92(0x16a),'headers':{'Content-Type':_0x58e569[_0xb2ff92(0x18c)]},'body':_0x134520});if(!_0x1136f9['ok']){const _0x5ab091=await _0x1136f9[_0xb2ff92(0x191)]();throw new Error(_0xb2ff92(0x155)+_0x5ab091);}const _0x381048=await _0x1136f9[_0xb2ff92(0x138)]();return console['log'](_0x58e569[_0xb2ff92(0x175)]),await saveCachedToken(_0x381048[_0xb2ff92(0x15d)],_0x381048['refresh_token'],_0x381048[_0xb2ff92(0x174)]),_0x381048[_0xb2ff92(0x15d)];}async function callGetCliToken(_0x26493b,_0xbfbed2){const _0x2928e1=_0xb32d1b,_0x1a4f73={'XJzdK':function(_0x152209,_0xda61f4,_0x39fb46){return _0x152209(_0xda61f4,_0x39fb46);},'qORHm':_0x2928e1(0x16a),'FbuhH':function(_0x5c88ad,_0xd221cd){return _0x5c88ad(_0xd221cd);},'SdWhY':'application/json,\x20text/event-stream','eHUrt':'Initializing\x20MCP\x20session...','oOTxG':function(_0x5ba580,_0x577e18){return _0x5ba580(_0x577e18);},'buPbl':_0x2928e1(0x1af),'MZbFG':_0x2928e1(0x1b8),'yoQDA':_0x2928e1(0x184),'wWNTw':_0x2928e1(0x1c9),'OHuCH':_0x2928e1(0x15a),'zUTQg':'\x20done','tVjdt':function(_0x8f6fb4,_0x569a57){return _0x8f6fb4(_0x569a57);},'OMJML':_0x2928e1(0x182),'AYUIe':function(_0x44918e,_0xdb2fe1,_0x3a0eb8){return _0x44918e(_0xdb2fe1,_0x3a0eb8);},'lQZxB':_0x2928e1(0x148),'ImPHT':function(_0xd50f14,_0x50610e,_0x377e3c,_0x184f35){return _0xd50f14(_0x50610e,_0x377e3c,_0x184f35);},'hKlzv':function(_0x96548b,_0xb125d3,_0x233b94,_0x3f7350){return _0x96548b(_0xb125d3,_0x233b94,_0x3f7350);},'ohkMn':_0x2928e1(0x1a7),'yXWbA':'Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a'},_0x9732c6={'Content-Type':_0x2928e1(0x146),'Accept':_0x1a4f73[_0x2928e1(0x15e)]};_0xbfbed2&&(_0x9732c6[_0x2928e1(0x179)]='Bearer\x20'+_0xbfbed2);const _0x5c6254=async _0x1dde0d=>{const _0x280628=_0x2928e1,_0x3457d6=await _0x1a4f73[_0x280628(0x17b)](fetch,_0x26493b,{'method':_0x1a4f73['qORHm'],'headers':_0x9732c6,'body':JSON['stringify'](_0x1dde0d)});if(!_0x3457d6['ok']){const _0x299641=await _0x3457d6['text']();throw new Error('HTTP\x20'+_0x3457d6['status']+':\x20'+_0x299641);}return _0x1a4f73['FbuhH'](parseResponse,_0x3457d6);};process[_0x2928e1(0x190)][_0x2928e1(0x1c4)](_0x1a4f73['eHUrt']);const _0x5ca22d=await _0x1a4f73[_0x2928e1(0x1cb)](_0x5c6254,{'jsonrpc':_0x2928e1(0x184),'id':0x1,'method':'initialize','params':{'protocolVersion':_0x1a4f73['buPbl'],'capabilities':{},'clientInfo':{'name':_0x2928e1(0x149),'version':_0x1a4f73[_0x2928e1(0x199)]}}});if(_0x5ca22d['error'])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x5ca22d[_0x2928e1(0x177)]['message']??JSON['stringify'](_0x5ca22d[_0x2928e1(0x177)])));console[_0x2928e1(0x17e)]('\x20done'),await fetch(_0x26493b,{'method':'POST','headers':_0x9732c6,'body':JSON['stringify']({'jsonrpc':_0x1a4f73[_0x2928e1(0x170)],'method':_0x1a4f73['wWNTw']})})['then'](_0x4b959e=>_0x4b959e[_0x2928e1(0x191)]()),process[_0x2928e1(0x190)]['write'](_0x1a4f73[_0x2928e1(0x1ba)]);const _0x2bc54f=await _0x5c6254({'jsonrpc':_0x1a4f73[_0x2928e1(0x170)],'id':0x2,'method':_0x2928e1(0x189),'params':{'name':'get_cli_token','arguments':{}}});if(_0x2bc54f['error'])throw new Error('get_cli_token\x20failed:\x20'+(_0x2bc54f['error']['message']??JSON['stringify'](_0x2bc54f[_0x2928e1(0x177)])));console['log'](_0x1a4f73[_0x2928e1(0x1a4)]);const _0x368de7=_0x1a4f73[_0x2928e1(0x164)](extractToken,_0x2bc54f['result']);if(!_0x368de7){console['error'](_0x2928e1(0x13c)),console['error'](JSON[_0x2928e1(0x16e)](_0x2bc54f['result'],null,0x2));throw new Error(_0x1a4f73[_0x2928e1(0x194)]);}const _0x13a09a=_0x1a4f73['AYUIe'](join,homedir(),'.ranger'),_0x5a900c=_0x1a4f73[_0x2928e1(0x17b)](join,_0x13a09a,_0x1a4f73[_0x2928e1(0x1cd)]);await mkdir(_0x13a09a,{'recursive':!![]}),await _0x1a4f73[_0x2928e1(0x16f)](writeFile,_0x5a900c,_0x368de7,{'mode':0x180}),await _0x1a4f73['hKlzv'](writeFile,_0x1a4f73[_0x2928e1(0x1ab)](join,_0x13a09a,_0x1a4f73[_0x2928e1(0x1ad)]),_0x26493b,{'mode':0x180}),console['log']('\x0aToken\x20written\x20to\x20'+_0x5a900c),console['log'](_0x1a4f73[_0x2928e1(0x19b)]);}async function fetchAuthServerMetadata(_0x388faf){const _0x45b31=_0xb32d1b,_0x1cb0fb={'jnmUV':function(_0x5f5b1c,_0x5749c3){return _0x5f5b1c(_0x5749c3);}},_0x3d97b9=_0x388faf+_0x45b31(0x1be),_0x47b810=await _0x1cb0fb['jnmUV'](fetch,_0x3d97b9);if(!_0x47b810['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x3d97b9+':\x20'+_0x47b810[_0x45b31(0x151)]);return _0x47b810['json']();}function waitForCallback(_0x4e3538){const _0x35592a=_0xb32d1b,_0x316f21={'KXaVd':function(_0x5a323a,_0x83bde3){return _0x5a323a!==_0x83bde3;},'xFXSW':_0x35592a(0x1a9),'wOKkC':'state','pBiaU':'error','XSFeF':function(_0x3414af,_0x30ccca){return _0x3414af(_0x30ccca);},'rEiDS':'text/html','uCLPo':'<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','IXdwZ':function(_0x58b514){return _0x58b514();},'CVaUt':_0x35592a(0x1c1),'IrxcV':function(_0x2b6b02,_0x50719f){return _0x2b6b02(_0x50719f);},'LBfnW':'127.0.0.1'};return new Promise((_0x526d17,_0x153880)=>{const _0x553619=_0x35592a,_0x5e0269={'TIEZk':function(_0x4c32b9){return _0x316f21['IXdwZ'](_0x4c32b9);},'JXWsM':_0x316f21[_0x553619(0x143)]},_0x3a14cd=()=>{const _0xe56738=_0x553619;_0x4fd0b4[_0xe56738(0x198)](),_0x4fd0b4['close']();},_0x38ca0d=setTimeout(()=>{const _0x39d92c=_0x553619;_0x5e0269['TIEZk'](_0x3a14cd),_0x153880(new OAuthTimeoutError(_0x5e0269[_0x39d92c(0x159)]));},0x1d4c0),_0x4fd0b4=_0x316f21['IrxcV'](createServer,(_0x27920a,_0x573ae1)=>{const _0xe369ec=_0x553619,_0x28edbb=new URL(_0x27920a['url']??'/','http://localhost:'+CALLBACK_PORT);if(_0x316f21[_0xe369ec(0x1a2)](_0x28edbb[_0xe369ec(0x19e)],_0xe369ec(0x1c7))){_0x573ae1['writeHead'](0x194),_0x573ae1[_0xe369ec(0x1c2)](_0x316f21[_0xe369ec(0x1c3)]);return;}const _0x33ba47=_0x28edbb[_0xe369ec(0x1d2)][_0xe369ec(0x13a)](_0xe369ec(0x162)),_0x583ec7=_0x28edbb['searchParams'][_0xe369ec(0x13a)](_0x316f21['wOKkC']),_0x5582bc=_0x28edbb['searchParams']['get'](_0x316f21['pBiaU']);if(_0x5582bc){const _0x4634d2=_0x28edbb['searchParams']['get'](_0xe369ec(0x15c))??_0x5582bc;_0x573ae1[_0xe369ec(0x1b4)](0xc8,{'Content-Type':_0xe369ec(0x137)}),_0x573ae1['end'](_0xe369ec(0x183)+_0x4634d2+_0xe369ec(0x1b9)),_0x316f21['XSFeF'](clearTimeout,_0x38ca0d),_0x3a14cd(),_0x316f21[_0xe369ec(0x16c)](_0x153880,new Error(_0xe369ec(0x167)+_0x4634d2));return;}if(!_0x33ba47||_0x583ec7!==_0x4e3538){_0x573ae1[_0xe369ec(0x1b4)](0x190,{'Content-Type':_0x316f21[_0xe369ec(0x141)]}),_0x573ae1['end'](_0x316f21['uCLPo']);return;}_0x573ae1[_0xe369ec(0x1b4)](0xc8,{'Content-Type':_0xe369ec(0x137)}),_0x573ae1[_0xe369ec(0x1c2)](_0xe369ec(0x158)),_0x316f21[_0xe369ec(0x16c)](clearTimeout,_0x38ca0d),_0x316f21[_0xe369ec(0x1a8)](_0x3a14cd),_0x316f21[_0xe369ec(0x16c)](_0x526d17,_0x33ba47);});_0x4fd0b4['listen'](CALLBACK_PORT,_0x316f21[_0x553619(0x15b)]);});}async function openBrowser(_0x1197f4){const _0x26d782=_0xb32d1b,_0x50abfb={'vMJhX':function(_0x22bd66,_0x5bdf10){return _0x22bd66===_0x5bdf10;},'RqSRU':'open','aaKFh':function(_0x4137cc,_0xeb6893){return _0x4137cc===_0xeb6893;},'MyZtS':_0x26d782(0x1ca),'UddAk':_0x26d782(0x14a),'OEsHq':function(_0xe29070,_0x5ac576){return _0xe29070(_0x5ac576);}},_0x4ebd16=_0x50abfb['vMJhX'](process['platform'],_0x26d782(0x13b))?_0x50abfb['RqSRU']:_0x50abfb['aaKFh'](process['platform'],_0x50abfb[_0x26d782(0x1c0)])?_0x50abfb['UddAk']:_0x26d782(0x19c);_0x50abfb['OEsHq'](exec,_0x4ebd16+'\x20\x22'+_0x1197f4+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x1a7e21=_0xb32d1b,_0x4f3a37={'cqssX':'utf-8','NJJnA':function(_0x5c9a9e,_0x18f4a0){return _0x5c9a9e!==_0x18f4a0;}};try{const _0x52af39=JSON[_0x1a7e21(0x16d)](await readFile(TOKEN_CACHE_PATH,_0x4f3a37['cqssX']));if(_0x52af39['origin']&&_0x4f3a37[_0x1a7e21(0x195)](_0x52af39['origin'],currentOrigin))return null;if(_0x52af39[_0x1a7e21(0x1c6)]&&Date[_0x1a7e21(0x172)]()>_0x52af39[_0x1a7e21(0x1c6)])return null;return _0x52af39[_0x1a7e21(0x1d3)]??null;}catch{return null;}}function _0x2ad7(_0x2291a5,_0x3b3275){_0x2291a5=_0x2291a5-0x134;const _0x4796d9=_0x4796();let _0x2ad7be=_0x4796d9[_0x2291a5];return _0x2ad7be;}async function saveCachedToken(_0x12d3b7,_0x54d293,_0x1b5fd0){const _0x1b3d53=_0xb32d1b,_0x39f858={'LbiFa':function(_0x42018b){return _0x42018b();},'jIRnf':function(_0xc093f,_0x5d38b3){return _0xc093f*_0x5d38b3;},'zecak':function(_0x101741,_0x1122bb,_0x4d2568){return _0x101741(_0x1122bb,_0x4d2568);}},_0x1d69da=await _0x39f858['LbiFa'](loadCachedData),_0x4a69e8={..._0x1d69da,'origin':currentOrigin,'accessToken':_0x12d3b7,'refreshToken':_0x54d293??_0x1d69da?.['refreshToken'],'expiresAt':_0x1b5fd0?Date[_0x1b3d53(0x172)]()+_0x39f858['jIRnf'](_0x1b5fd0,0x3e8):undefined};await _0x39f858[_0x1b3d53(0x1b6)](mkdir,join(homedir(),'.ranger'),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x1b3d53(0x16e)](_0x4a69e8),{'mode':0x180});}async function loadCachedClient(){const _0x4e162d=_0xb32d1b,_0x4ef705={'BzyQv':function(_0x10c14b){return _0x10c14b();}},_0x35b979=await _0x4ef705['BzyQv'](loadCachedData);if(_0x35b979?.[_0x4e162d(0x134)]&&_0x35b979[_0x4e162d(0x134)]!==currentOrigin)return null;return _0x35b979?.['clientId']?{'clientId':_0x35b979[_0x4e162d(0x14e)],'clientSecret':_0x35b979[_0x4e162d(0x1ae)]}:null;}async function clearCachedClient(){const _0x1b7af2={'LaQuv':function(_0x3e180b,_0x195f49,_0x157c3d,_0x5194d1){return _0x3e180b(_0x195f49,_0x157c3d,_0x5194d1);}},_0x11afb1=await loadCachedData();if(!_0x11afb1)return;const {clientId:_0x367c14,clientSecret:_0x20ead4,..._0x580da2}=_0x11afb1;await _0x1b7af2['LaQuv'](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x580da2),{'mode':0x180});}async function saveCachedClient(_0x2300c8,_0xeafe68){const _0x23eb89=_0xb32d1b,_0x514a77={'CPVsa':function(_0x53cacb,_0x156e91,_0x5def90){return _0x53cacb(_0x156e91,_0x5def90);},'SJlMC':function(_0x5a0bcd){return _0x5a0bcd();},'wLlfy':function(_0x321ff5,_0x54386a,_0x26aa71,_0x32e94c){return _0x321ff5(_0x54386a,_0x26aa71,_0x32e94c);}},_0xc314ab=await loadCachedData(),_0x7dbc9a={..._0xc314ab,'origin':currentOrigin,'accessToken':_0xc314ab?.[_0x23eb89(0x1d3)]??'','clientId':_0x2300c8,'clientSecret':_0xeafe68};await _0x514a77['CPVsa'](mkdir,join(_0x514a77[_0x23eb89(0x169)](homedir),'.ranger'),{'recursive':!![]}),await _0x514a77[_0x23eb89(0x15f)](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x7dbc9a),{'mode':0x180});}async function loadCachedData(){const _0x593bc1=_0xb32d1b,_0x19eadc={'gZatD':_0x593bc1(0x197)};try{return JSON[_0x593bc1(0x16d)](await readFile(TOKEN_CACHE_PATH,_0x19eadc['gZatD']));}catch{return null;}}async function parseResponse(_0x4d4f84){const _0x25aebb=_0xb32d1b,_0x35ee0f={'GleZU':_0x25aebb(0x14f),'AJUca':function(_0x483ab7,_0x4372d5){return _0x483ab7!==_0x4372d5;},'QOUtM':_0x25aebb(0x165)},_0x2348b0=_0x4d4f84['headers'][_0x25aebb(0x13a)]('content-type')??'';if(_0x2348b0[_0x25aebb(0x1c8)](_0x25aebb(0x144))){const _0x5299ec=await _0x4d4f84[_0x25aebb(0x191)]();for(const _0x27554f of _0x5299ec[_0x25aebb(0x154)]('\x0a')){const _0x2f3b92=_0x27554f['trim']();if(_0x2f3b92[_0x25aebb(0x168)](_0x35ee0f['GleZU'])){const _0x56b804=_0x2f3b92['slice'](_0x25aebb(0x14f)['length'])[_0x25aebb(0x1a0)]();if(!_0x56b804)continue;try{const _0x1be112=JSON[_0x25aebb(0x16d)](_0x56b804);if(_0x35ee0f[_0x25aebb(0x18a)](_0x1be112['id'],undefined)||_0x1be112[_0x25aebb(0x177)])return _0x1be112;}catch{}}}throw new Error(_0x35ee0f['QOUtM']);}return _0x4d4f84['json']();}function extractToken(_0x292d50){const _0x21b711=_0xb32d1b,_0x2ee72f={'gLnhT':'string','wiEiq':_0x21b711(0x1b3),'eTMLH':'text','jogFM':function(_0x2858fe,_0x271e48){return _0x2858fe===_0x271e48;}};if(!_0x292d50)return null;const _0x3a8e63=_0x292d50['structuredContent'];if(_0x3a8e63?.[_0x21b711(0x1cc)]&&typeof _0x3a8e63['token']===_0x2ee72f[_0x21b711(0x178)])return _0x3a8e63['token'];if(_0x292d50['isError']){const _0xa172bd=_0x292d50[_0x21b711(0x135)];throw new Error('Server\x20returned\x20error:\x20'+(_0xa172bd?.[0x0]?.['text']??_0x2ee72f['wiEiq']));}const _0x157538=_0x292d50['content'];if(_0x157538)for(const _0x3e0808 of _0x157538){if(_0x3e0808[_0x21b711(0x173)]===_0x2ee72f[_0x21b711(0x192)]&&_0x3e0808['text']){try{const _0x1d1ffd=JSON[_0x21b711(0x16d)](_0x3e0808['text']);if(_0x2ee72f['jogFM'](typeof _0x1d1ffd?.[_0x21b711(0x1cc)],_0x21b711(0x166)))return _0x1d1ffd['token'];}catch{}const _0xe307d8=_0x3e0808[_0x21b711(0x191)][_0x21b711(0x17f)](/(rngr_[A-Za-z0-9_-]+)/);if(_0xe307d8)return _0xe307d8[0x1];}}return null;}
@@ -1 +1 @@
1
- (function(_0x5a71b8,_0x502e3b){var _0x2febe7=_0x7120,_0x418972=_0x5a71b8();while(!![]){try{var _0x19946b=parseInt(_0x2febe7(0x145))/0x1*(-parseInt(_0x2febe7(0x146))/0x2)+-parseInt(_0x2febe7(0x147))/0x3*(parseInt(_0x2febe7(0x13c))/0x4)+-parseInt(_0x2febe7(0x142))/0x5+parseInt(_0x2febe7(0x141))/0x6+parseInt(_0x2febe7(0x143))/0x7+-parseInt(_0x2febe7(0x13d))/0x8+-parseInt(_0x2febe7(0x149))/0x9*(-parseInt(_0x2febe7(0x13f))/0xa);if(_0x19946b===_0x502e3b)break;else _0x418972['push'](_0x418972['shift']());}catch(_0x46b279){_0x418972['push'](_0x418972['shift']());}}}(_0x58a2,0x2d33d));function _0x7120(_0x415180,_0x368b54){_0x415180=_0x415180-0x13c;var _0x58a258=_0x58a2();var _0x7120fe=_0x58a258[_0x415180];return _0x7120fe;}export async function migrateProfile(_0x20dece,_0x15c3f8){var _0x34d594=_0x7120,_0x2113cb={'iRcJC':function(_0x191c82,_0x42f1ad){return _0x191c82+_0x42f1ad;},'EFHvb':'ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','MwAoC':'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','gXupr':'Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a','acRHS':'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.'};console[_0x34d594(0x14a)](_0x2113cb[_0x34d594(0x13e)](_0x2113cb[_0x34d594(0x13e)](_0x2113cb[_0x34d594(0x140)]+'\x0a'+_0x34d594(0x144)+_0x2113cb['MwAoC']+'\x0a',_0x34d594(0x148))+'\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a'+'\x0a',_0x2113cb['gXupr'])+_0x2113cb['acRHS']),process['exit'](0x1);}function _0x58a2(){var _0x4d6e54=['To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','20yHLWzs','9862jAopkZ','12gquAxc','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','3597786IUcqdM','error','95156MviuOW','551200HJJaTN','iRcJC','10fccTWo','EFHvb','1558062CFAhjD','1463520wbAtYx','567686ufGzjM'];_0x58a2=function(){return _0x4d6e54;};return _0x58a2();}
1
+ function _0x16b7(){var _0x1e4fc7=['18783sKhrmH','CvMVn','176oJrfbJ','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','RiuqR','10UVYtRE','788DEvIjc','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','1293042fLqdTm','624xzTjvV','7xCrORA','4vwvHwi','tuiwu','Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a','2801985Nsyvhe','10001953oWGPdU','2195925XuQNKz','892001GaEgBx','\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a','12dPgTbx','WsgDl'];_0x16b7=function(){return _0x1e4fc7;};return _0x16b7();}(function(_0x46fc76,_0x582ba8){var _0x35afcf=_0x4a06,_0x40133a=_0x46fc76();while(!![]){try{var _0x530699=-parseInt(_0x35afcf(0x19b))/0x1*(parseInt(_0x35afcf(0x197))/0x2)+-parseInt(_0x35afcf(0x190))/0x3+parseInt(_0x35afcf(0x18b))/0x4*(parseInt(_0x35afcf(0x18e))/0x5)+-parseInt(_0x35afcf(0x19d))/0x6*(parseInt(_0x35afcf(0x18a))/0x7)+parseInt(_0x35afcf(0x19e))/0x8*(parseInt(_0x35afcf(0x195))/0x9)+parseInt(_0x35afcf(0x19a))/0xa*(-parseInt(_0x35afcf(0x191))/0xb)+parseInt(_0x35afcf(0x193))/0xc*(parseInt(_0x35afcf(0x18f))/0xd);if(_0x530699===_0x582ba8)break;else _0x40133a['push'](_0x40133a['shift']());}catch(_0x1f97e3){_0x40133a['push'](_0x40133a['shift']());}}}(_0x16b7,0x60597));function _0x4a06(_0x91a73b,_0x4878bb){_0x91a73b=_0x91a73b-0x18a;var _0x16b7bb=_0x16b7();var _0x4a0683=_0x16b7bb[_0x91a73b];return _0x4a0683;}export async function migrateProfile(_0x490b96,_0x4a1999){var _0xfa242c=_0x4a06,_0x401222={'OjsPh':function(_0x20d27d,_0x252f4b){return _0x20d27d+_0x252f4b;},'xjoMi':'ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','tuiwu':_0xfa242c(0x198),'WsgDl':'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','RiuqR':_0xfa242c(0x18d),'CvMVn':'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.'};console['error'](_0x401222['OjsPh'](_0x401222['xjoMi']+'\x0a'+_0xfa242c(0x19c)+_0x401222[_0xfa242c(0x18c)]+'\x0a'+_0x401222[_0xfa242c(0x194)],_0xfa242c(0x192))+'\x0a'+_0x401222[_0xfa242c(0x199)]+_0x401222[_0xfa242c(0x196)]),process['exit'](0x1);}
@@ -1 +1 @@
1
- (function(_0x19dd09,_0x2de59c){const _0x5c0c14=_0x2735,_0x439766=_0x19dd09();while(!![]){try{const _0x3ab31e=-parseInt(_0x5c0c14(0xcf))/0x1+parseInt(_0x5c0c14(0xa5))/0x2*(-parseInt(_0x5c0c14(0xd0))/0x3)+-parseInt(_0x5c0c14(0xd6))/0x4+-parseInt(_0x5c0c14(0xd1))/0x5+-parseInt(_0x5c0c14(0xc7))/0x6*(parseInt(_0x5c0c14(0xa7))/0x7)+-parseInt(_0x5c0c14(0xd3))/0x8*(parseInt(_0x5c0c14(0xc1))/0x9)+parseInt(_0x5c0c14(0xaf))/0xa;if(_0x3ab31e===_0x2de59c)break;else _0x439766['push'](_0x439766['shift']());}catch(_0x5a47de){_0x439766['push'](_0x439766['shift']());}}}(_0x3018,0x26f10));import{join}from'path';function _0x2735(_0x6c1d5b,_0x5651a2){_0x6c1d5b=_0x6c1d5b-0xa2;const _0x30188e=_0x3018();let _0x273525=_0x30188e[_0x6c1d5b];return _0x273525;}import{existsSync}from'fs';import _0x171137 from'inquirer';import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x310cc8){const _0x203d51=_0x2735,_0x2bcf10={'MtYcO':function(_0x2f7169,_0x632654){return _0x2f7169(_0x632654);},'YBBkR':'✓\x20Claude\x20Code\x20plugin\x20already\x20installed','viGPW':_0x203d51(0xca),'vZack':_0x203d51(0xc5),'JTbOH':_0x203d51(0xb0),'kkChY':_0x203d51(0xb8),'fOJGB':'User\x20(available\x20in\x20all\x20your\x20projects)','wYHGC':'Project\x20(shared\x20with\x20team\x20via\x20git)','XTizp':_0x203d51(0xcc),'sXdRj':'user','bKvMU':_0x203d51(0xc0),'gkvTz':'plugin','uvgtN':'marketplace','HrEqW':_0x203d51(0xb7),'TBUEU':'ranger-testing/trailhead','IPRgB':'❌\x20Failed\x20to\x20add\x20marketplace:','zYbSk':'\x0aYou\x20can\x20install\x20manually\x20with:','uPcYq':'ranger@trailhead','IYeSs':'--scope','zPoGW':function(_0x126336){return _0x126336();},'hlOoK':'✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','KkJMH':'enable','FVMJv':function(_0x3a5ed1,_0x297e71,_0x1742d5){return _0x3a5ed1(_0x297e71,_0x1742d5);},'bJUEW':function(_0x5d4c8a,_0x5da581){return _0x5d4c8a===_0x5da581;},'HpgNH':_0x203d51(0xbb)},_0x324a20=await _0x2bcf10[_0x203d51(0xbf)](isPluginInstalled,_0x203d51(0xae));if(_0x324a20)return console[_0x203d51(0xcb)](_0x2bcf10[_0x203d51(0xc2)]),![];const _0x179024=_0x2bcf10['MtYcO'](existsSync,join(getProjectRoot(),_0x2bcf10['viGPW']));let _0x2892e2;if(_0x310cc8)_0x2892e2=_0x310cc8;else{if(_0x179024)_0x2892e2='project';else{console['log'](_0x2bcf10['vZack']);const _0x22719e=await _0x171137[_0x203d51(0xa4)]([{'type':'list','name':_0x2bcf10['JTbOH'],'message':_0x2bcf10[_0x203d51(0xaa)],'choices':[{'name':_0x2bcf10['fOJGB'],'value':'user'},{'name':_0x2bcf10['wYHGC'],'value':_0x2bcf10['XTizp']}],'default':_0x2bcf10[_0x203d51(0xbd)]}]);_0x2892e2=_0x22719e['pluginScope'];}}console[_0x203d51(0xcb)](_0x203d51(0xba)+_0x2892e2+'\x20level)...\x0a');const _0x10d8b7=await _0x2bcf10['MtYcO'](isMarketplaceAdded,_0x2bcf10[_0x203d51(0xa2)]);let _0x4d5a83=_0x10d8b7;if(_0x10d8b7)console['log']('✓\x20Marketplace\x20already\x20added');else{const _0x524f0b=await runClaudeCommand([_0x2bcf10['gkvTz'],_0x2bcf10[_0x203d51(0xbe)],_0x2bcf10['HrEqW'],_0x2bcf10[_0x203d51(0xc3)]]);!_0x524f0b['success']?(console['error'](_0x2bcf10['IPRgB'],_0x524f0b[_0x203d51(0xa6)]),console[_0x203d51(0xcb)](_0x2bcf10[_0x203d51(0xb9)]),console[_0x203d51(0xcb)](_0x203d51(0xac)),console[_0x203d51(0xcb)](_0x203d51(0xbc)+_0x2892e2)):_0x4d5a83=!![];}if(_0x4d5a83){const _0xef6eb3=await runClaudeCommand([_0x2bcf10['gkvTz'],_0x203d51(0xc9),_0x2bcf10[_0x203d51(0xb4)],_0x2bcf10[_0x203d51(0xd5)],_0x2892e2],{'cwd':_0x2892e2===_0x203d51(0xcc)?_0x2bcf10[_0x203d51(0xa3)](getProjectRoot):undefined});if(!_0xef6eb3['success'])console[_0x203d51(0xa6)](_0x203d51(0xce),_0xef6eb3['error']),console['log'](_0x203d51(0xc6)),console['log'](_0x203d51(0xbc)+_0x2892e2);else{console[_0x203d51(0xcb)](_0x2bcf10['hlOoK']);const _0x4a6a77=[_0x203d51(0xb5),_0x2bcf10['KkJMH'],_0x2bcf10[_0x203d51(0xb4)]];_0x2892e2===_0x2bcf10[_0x203d51(0xc4)]&&_0x4a6a77[_0x203d51(0xc8)](_0x2bcf10[_0x203d51(0xd5)],'project');const _0x5cbd67=await _0x2bcf10['FVMJv'](runClaudeCommand,_0x4a6a77,{'captureOutput':!![],'cwd':_0x2bcf10['bJUEW'](_0x2892e2,_0x2bcf10['XTizp'])?getProjectRoot():undefined}),_0x4e4755=_0x5cbd67[_0x203d51(0xb6)]?.[_0x203d51(0xb3)]('already\x20enabled');!_0x5cbd67[_0x203d51(0xb1)]&&!_0x4e4755?console[_0x203d51(0xa6)](_0x203d51(0xcd),_0x5cbd67['error']):console[_0x203d51(0xcb)](_0x2bcf10['HpgNH']);}}return!![];}function _0x3018(){const _0x413aba=['confirm','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','ajEkH','ranger@trailhead','12023390jUQtBK','pluginScope','success','SKILL.md','includes','uPcYq','plugin','output','add','Where\x20should\x20the\x20plugin\x20be\x20installed?','zYbSk','\x0aInstalling\x20Claude\x20Code\x20plugin\x20(','✓\x20Claude\x20Code\x20plugin\x20enabled','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','sXdRj','uvgtN','MtYcO','trailhead','9sNCaje','YBBkR','TBUEU','XTizp','\x0a📦\x20Claude\x20Code\x20Plugin\x0a','\x0aYou\x20can\x20install\x20manually\x20with:','6sJtetI','push','install','.claude','log','project','⚠\x20Failed\x20to\x20enable\x20plugin:','❌\x20Failed\x20to\x20install\x20plugin:','91176Hxngir','3ijyMpn','418140VuKTAw','wantsSkillup','754104DYRVRz','GoUTA','IYeSs','1269188ejAHyl','bKvMU','zPoGW','prompt','520794UtRYsd','error','1372518GuBlec','ranger','vsMXl','kkChY'];_0x3018=function(){return _0x413aba;};return _0x3018();}export async function ensureClaudeSkills(_0x5e0334){const _0x22e784=_0x2735,_0x3023ad={'ajEkH':function(_0x1c4e0f,_0x1da4a9){return _0x1c4e0f(_0x1da4a9);},'ZUbsW':'ranger','asoMt':function(_0x28d71e,_0x5cb07c,_0x554ca0,_0x52b668){return _0x28d71e(_0x5cb07c,_0x554ca0,_0x52b668);},'vsMXl':'SKILL.md','zVQBm':'✓\x20Ranger\x20skills\x20already\x20installed','ppkrj':function(_0x2b5a46,_0x18d54a,_0x171485){return _0x2b5a46(_0x18d54a,_0x171485);},'FAojJ':function(_0x2431e3){return _0x2431e3();},'GoUTA':'project','aYqKC':_0x22e784(0xd2)},_0x530593=_0x3023ad[_0x22e784(0xad)](existsSync,join(getSkillsDir('user'),_0x3023ad['ZUbsW'],_0x22e784(0xb2))),_0x9a174f=existsSync(_0x3023ad['asoMt'](join,getSkillsDir(_0x22e784(0xcc)),_0x22e784(0xa8),_0x3023ad[_0x22e784(0xa9)]));if(_0x530593||_0x9a174f)return console[_0x22e784(0xcb)](_0x3023ad['zVQBm']),![];const _0x275d86=existsSync(_0x3023ad['ppkrj'](join,_0x3023ad['FAojJ'](getProjectRoot),'.claude'));let _0x1a8b9d=!![];if(_0x5e0334)await skillup({'autoInstall':_0x5e0334,'suppressUsage':!![]});else{if(_0x275d86)await skillup({'autoInstall':_0x3023ad[_0x22e784(0xd4)],'suppressUsage':!![]});else{const _0x1884cb=await _0x171137[_0x22e784(0xa4)]([{'type':_0x22e784(0xab),'name':_0x3023ad['aYqKC'],'message':'Would\x20you\x20like\x20to\x20install\x20skills?','default':!![]}]);_0x1a8b9d=_0x1884cb[_0x22e784(0xd2)],_0x1a8b9d&&await skillup({'suppressUsage':!![]});}}return _0x1a8b9d;}
1
+ (function(_0x1b0b67,_0x19da6f){const _0x55c583=_0x1920,_0x143066=_0x1b0b67();while(!![]){try{const _0x351f39=parseInt(_0x55c583(0x9b))/0x1+-parseInt(_0x55c583(0xb1))/0x2*(parseInt(_0x55c583(0xbe))/0x3)+-parseInt(_0x55c583(0xcf))/0x4+-parseInt(_0x55c583(0xa2))/0x5*(-parseInt(_0x55c583(0xbd))/0x6)+parseInt(_0x55c583(0xc9))/0x7*(parseInt(_0x55c583(0xc8))/0x8)+parseInt(_0x55c583(0xb6))/0x9*(-parseInt(_0x55c583(0xc0))/0xa)+-parseInt(_0x55c583(0xb9))/0xb;if(_0x351f39===_0x19da6f)break;else _0x143066['push'](_0x143066['shift']());}catch(_0x42fa68){_0x143066['push'](_0x143066['shift']());}}}(_0x52fc,0x3fa05));function _0x1920(_0x45858e,_0x3e7d64){_0x45858e=_0x45858e-0x98;const _0x52fcb5=_0x52fc();let _0x192034=_0x52fcb5[_0x45858e];return _0x192034;}import{join}from'path';import{existsSync}from'fs';import _0x421cdc from'inquirer';function _0x52fc(){const _0x35f207=['\x0aInstalling\x20Claude\x20Code\x20plugin\x20(','project','1983234VrsbkE','enable','list','pluginScope','524946CsvpTd','45AjFWNj','tMLWO','112570UNkByN','plugin','❌\x20Failed\x20to\x20add\x20marketplace:','WvwyZ','confirm','StTJo','Would\x20you\x20like\x20to\x20install\x20skills?','✓\x20Marketplace\x20already\x20added','1364312FlsAVX','21mARgYl','includes','install','push','success','FLyxc','130112WCRhxS','fUYHe','SKILL.md','vNiOH','log','246519AsthOW','BDMiT','zuLNJ','already\x20enabled','ranger','User\x20(available\x20in\x20all\x20your\x20projects)','⚠\x20Failed\x20to\x20enable\x20plugin:','5zCELMw','\x0a📦\x20Claude\x20Code\x20Plugin\x0a','error','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','QqEoq','prompt','❌\x20Failed\x20to\x20install\x20plugin:','✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','JxVIT','\x0aYou\x20can\x20install\x20manually\x20with:','.claude','dYPdJ','YZPZL','user','ranger-testing/trailhead','18106PkTDXI','output','SHZdZ','--scope','ranger@trailhead','189bqbRFb'];_0x52fc=function(){return _0x35f207;};return _0x52fc();}import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x285ed8){const _0x353009=_0x1920,_0x5092b3={'EwdFi':function(_0x3bb908){return _0x3bb908();},'KWRQm':_0x353009(0xa3),'fUYHe':_0x353009(0xa0),'FLyxc':_0x353009(0xb8),'BDMiT':'user','nUvwu':'trailhead','tMLWO':_0x353009(0xc7),'Eykik':_0x353009(0xc1),'JDKsd':'marketplace','zuLNJ':_0x353009(0xc2),'JxVIT':_0x353009(0xab),'shbdm':function(_0x33c952,_0x37a3ef,_0x89fd08){return _0x33c952(_0x37a3ef,_0x89fd08);},'WvwyZ':function(_0x58c9af,_0x2e7fa3){return _0x58c9af===_0x2e7fa3;},'TarKF':_0x353009(0xa8),'fbOki':_0x353009(0xba),'SHZdZ':'ranger@trailhead','QYcda':'✓\x20Claude\x20Code\x20plugin\x20enabled'},_0x7542d0=await isPluginInstalled('ranger@trailhead');if(_0x7542d0)return console['log'](_0x353009(0xa5)),![];const _0x37eb04=existsSync(join(_0x5092b3['EwdFi'](getProjectRoot),_0x353009(0xac)));let _0x89b301;if(_0x285ed8)_0x89b301=_0x285ed8;else{if(_0x37eb04)_0x89b301=_0x353009(0xb8);else{console[_0x353009(0x9a)](_0x5092b3['KWRQm']);const _0x435d24=await _0x421cdc[_0x353009(0xa7)]([{'type':_0x353009(0xbb),'name':'pluginScope','message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':_0x5092b3[_0x353009(0xd0)],'value':_0x353009(0xaf)},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':_0x5092b3['FLyxc']}],'default':_0x5092b3[_0x353009(0x9c)]}]);_0x89b301=_0x435d24[_0x353009(0xbc)];}}console[_0x353009(0x9a)](_0x353009(0xb7)+_0x89b301+'\x20level)...\x0a');const _0xf3aa1=await isMarketplaceAdded(_0x5092b3['nUvwu']);let _0x4a4019=_0xf3aa1;if(_0xf3aa1)console['log'](_0x5092b3[_0x353009(0xbf)]);else{const _0x2d9935=await runClaudeCommand([_0x5092b3['Eykik'],_0x5092b3['JDKsd'],'add',_0x353009(0xb0)]);!_0x2d9935[_0x353009(0xcd)]?(console['error'](_0x5092b3[_0x353009(0x9d)],_0x2d9935[_0x353009(0xa4)]),console[_0x353009(0x9a)](_0x5092b3[_0x353009(0xaa)]),console['log']('\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead'),console[_0x353009(0x9a)]('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x89b301)):_0x4a4019=!![];}if(_0x4a4019){const _0x359225=await _0x5092b3['shbdm'](runClaudeCommand,[_0x353009(0xc1),_0x353009(0xcb),_0x353009(0xb5),_0x353009(0xb4),_0x89b301],{'cwd':_0x5092b3[_0x353009(0xc3)](_0x89b301,_0x5092b3[_0x353009(0xce)])?getProjectRoot():undefined});if(!_0x359225['success'])console['error'](_0x5092b3['TarKF'],_0x359225['error']),console['log'](_0x5092b3[_0x353009(0xaa)]),console['log']('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x89b301);else{console['log'](_0x353009(0xa9));const _0xa4226c=[_0x353009(0xc1),_0x5092b3['fbOki'],_0x5092b3[_0x353009(0xb3)]];_0x89b301==='project'&&_0xa4226c[_0x353009(0xcc)]('--scope',_0x353009(0xb8));const _0x59c102=await runClaudeCommand(_0xa4226c,{'captureOutput':!![],'cwd':_0x89b301==='project'?_0x5092b3['EwdFi'](getProjectRoot):undefined}),_0x2c9795=_0x59c102[_0x353009(0xb2)]?.[_0x353009(0xca)](_0x353009(0x9e));!_0x59c102['success']&&!_0x2c9795?console[_0x353009(0xa4)](_0x353009(0xa1),_0x59c102['error']):console['log'](_0x5092b3['QYcda']);}}return!![];}export async function ensureClaudeSkills(_0x5dbd09){const _0x5641b8=_0x1920,_0x986e9={'dYPdJ':function(_0x142c8b,_0x16e1fb){return _0x142c8b(_0x16e1fb);},'QqEoq':function(_0x2b8436,_0x1fa8ea){return _0x2b8436(_0x1fa8ea);},'htdyU':'user','vNiOH':_0x5641b8(0x9f),'CBRxq':_0x5641b8(0x98),'ywdRb':function(_0x394f1e,_0x57b0ea){return _0x394f1e||_0x57b0ea;},'sSBrT':'✓\x20Ranger\x20skills\x20already\x20installed','PSaVc':function(_0x1edc5a,_0x3c23bc,_0x59b968){return _0x1edc5a(_0x3c23bc,_0x59b968);},'zAwTa':'.claude','YZPZL':_0x5641b8(0xc4),'StTJo':'wantsSkillup'},_0x2bed2a=_0x986e9[_0x5641b8(0xad)](existsSync,join(_0x986e9[_0x5641b8(0xa6)](getSkillsDir,_0x986e9['htdyU']),'ranger','SKILL.md')),_0x3be860=existsSync(join(_0x986e9[_0x5641b8(0xad)](getSkillsDir,_0x5641b8(0xb8)),_0x986e9[_0x5641b8(0x99)],_0x986e9['CBRxq']));if(_0x986e9['ywdRb'](_0x2bed2a,_0x3be860))return console['log'](_0x986e9['sSBrT']),![];const _0x407897=existsSync(_0x986e9['PSaVc'](join,getProjectRoot(),_0x986e9['zAwTa']));let _0x141baf=!![];if(_0x5dbd09)await _0x986e9[_0x5641b8(0xa6)](skillup,{'autoInstall':_0x5dbd09,'suppressUsage':!![]});else{if(_0x407897)await skillup({'autoInstall':_0x5641b8(0xb8),'suppressUsage':!![]});else{const _0x39033b=await _0x421cdc[_0x5641b8(0xa7)]([{'type':_0x986e9[_0x5641b8(0xae)],'name':_0x986e9[_0x5641b8(0xc5)],'message':_0x5641b8(0xc6),'default':!![]}]);_0x141baf=_0x39033b['wantsSkillup'],_0x141baf&&await _0x986e9[_0x5641b8(0xad)](skillup,{'suppressUsage':!![]});}}return _0x141baf;}
@@ -1 +1 @@
1
- function _0x3423(_0x16611a,_0x4f93a3){_0x16611a=_0x16611a-0x1a4;const _0x19ba98=_0x19ba();let _0x3423b6=_0x19ba98[_0x16611a];return _0x3423b6;}function _0x19ba(){const _0x527fe3=['6wPbiFw','104302oRluLC','Project\x20(shared\x20with\x20team\x20via\x20git)','389618hcnzQi','40ygYhDe','pluginScope','9FBgoWZ','270262yWlKjD','⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','project','1050126BoSmah','https://opencode.ai/config.json','plugin','154450fUpqpp','opencode.json','Failed\x20to\x20read\x20opencode.json','MsPvu','3262408yxVssP','290JictkE','isArray','KRwPt','list','\x0a📦\x20OpenCode\x20Plugin\x0a','User\x20(available\x20in\x20all\x20your\x20projects)','$schema','2119146AsHJBr','user'];_0x19ba=function(){return _0x527fe3;};return _0x19ba();}(function(_0x1f5c33,_0x13d8fb){const _0x1d7f83=_0x3423,_0x401eed=_0x1f5c33();while(!![]){try{const _0x5649b3=parseInt(_0x1d7f83(0x1a5))/0x1+parseInt(_0x1d7f83(0x1bc))/0x2*(-parseInt(_0x1d7f83(0x1b9))/0x3)+-parseInt(_0x1d7f83(0x1bd))/0x4*(-parseInt(_0x1d7f83(0x1ab))/0x5)+parseInt(_0x1d7f83(0x1b7))/0x6+-parseInt(_0x1d7f83(0x1a8))/0x7+-parseInt(_0x1d7f83(0x1af))/0x8*(parseInt(_0x1d7f83(0x1a4))/0x9)+-parseInt(_0x1d7f83(0x1b0))/0xa*(-parseInt(_0x1d7f83(0x1ba))/0xb);if(_0x5649b3===_0x13d8fb)break;else _0x401eed['push'](_0x401eed['shift']());}catch(_0x121097){_0x401eed['push'](_0x401eed['shift']());}}}(_0x19ba,0x3f736));import{join}from'path';import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0x5a298e from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0x887173){const _0x58da82=_0x3423,_0x520093={'MsPvu':_0x58da82(0x1a7),'ofpKs':_0x58da82(0x1b4),'pAEcU':'pluginScope','aetqA':_0x58da82(0x1b5),'KRwPt':_0x58da82(0x1b8),'tBBnl':function(_0x321fcf,_0x550ce1){return _0x321fcf(_0x550ce1);},'sxmxd':_0x58da82(0x1a6),'zWfzh':_0x58da82(0x1ad),'rSDmz':function(_0x5a63eb,_0x2c072a,_0x301a97){return _0x5a63eb(_0x2c072a,_0x301a97);},'GKnDw':function(_0x18baeb,_0x18171c,_0x7ad589){return _0x18baeb(_0x18171c,_0x7ad589);}},_0xd16b4f=existsSync(join(getOpencodeConfigDir(_0x58da82(0x1a7)),'opencode.json'));let _0x50b32a;if(_0x887173)_0x50b32a=_0x887173;else{if(_0xd16b4f)_0x50b32a=_0x520093[_0x58da82(0x1ae)];else{console['log'](_0x520093['ofpKs']);const _0x4985f9=await _0x5a298e['prompt']([{'type':_0x58da82(0x1b3),'name':_0x520093['pAEcU'],'message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':_0x520093['aetqA'],'value':_0x520093[_0x58da82(0x1b2)]},{'name':_0x58da82(0x1bb),'value':_0x520093[_0x58da82(0x1ae)]}],'default':'user'}]);_0x50b32a=_0x4985f9[_0x58da82(0x1be)];}}const _0x14c981=join(_0x520093['tBBnl'](getOpencodeConfigDir,_0x50b32a),_0x58da82(0x1ac)),_0x4b6f12='@ranger-testing/opencode-plugin',_0x26a4d7=_0x58da82(0x1a9);let _0x338366={};if(existsSync(_0x14c981))try{const _0xd0dc27=await readFile(_0x14c981,'utf-8');_0x338366=JSON['parse'](_0xd0dc27);}catch(_0x5aa86d){return console['error'](_0x520093['sxmxd']),{'configured':![],'scope':_0x50b32a,'error':_0x520093['zWfzh'],'details':_0x5aa86d};}const _0x14ddf7=Array[_0x58da82(0x1b1)](_0x338366['plugin'])?_0x338366[_0x58da82(0x1aa)]:[];if(_0x14ddf7['includes'](_0x4b6f12))return console['log']('✓\x20OpenCode\x20plugin\x20already\x20configured'),{'configured':![],'scope':_0x50b32a};return _0x338366[_0x58da82(0x1b6)]=_0x338366[_0x58da82(0x1b6)]||_0x26a4d7,_0x338366['plugin']=[..._0x14ddf7,_0x4b6f12],await _0x520093['rSDmz'](mkdir,getOpencodeConfigDir(_0x50b32a),{'recursive':!![]}),await _0x520093['GKnDw'](writeFile,_0x14c981,JSON['stringify'](_0x338366,null,0x2)+'\x0a'),console['log']('✓\x20OpenCode\x20plugin\x20configured'),{'configured':!![],'scope':_0x50b32a};}
1
+ (function(_0x1f76fd,_0x1e3c80){const _0x4f891b=_0x5188,_0x4cf8b7=_0x1f76fd();while(!![]){try{const _0x2a2098=parseInt(_0x4f891b(0xae))/0x1+parseInt(_0x4f891b(0xaa))/0x2+parseInt(_0x4f891b(0xb4))/0x3*(-parseInt(_0x4f891b(0xa3))/0x4)+-parseInt(_0x4f891b(0xb9))/0x5+-parseInt(_0x4f891b(0xb6))/0x6+parseInt(_0x4f891b(0xa7))/0x7+parseInt(_0x4f891b(0xbb))/0x8*(-parseInt(_0x4f891b(0xa6))/0x9);if(_0x2a2098===_0x1e3c80)break;else _0x4cf8b7['push'](_0x4cf8b7['shift']());}catch(_0x192b96){_0x4cf8b7['push'](_0x4cf8b7['shift']());}}}(_0x2965,0xa9696));import{join}from'path';import{existsSync}from'fs';function _0x2965(){const _0x597f35=['✓\x20OpenCode\x20plugin\x20configured','opencode.json','2920795GZpIeZ','Failed\x20to\x20read\x20opencode.json','27728IvyMSV','\x0a📦\x20OpenCode\x20Plugin\x0a','$schema','WBTcw','log','prompt','zHsqq','55716hKewqd','rQvxN','utf-8','9UZGABE','1675891uoyWxd','tRAky','includes','2279940bxDYTw','✓\x20OpenCode\x20plugin\x20already\x20configured','parse','UEAFK','1382269CKNxso','user','error','Where\x20should\x20the\x20plugin\x20be\x20installed?','SUjHD','https://opencode.ai/config.json','81PpDYJH','ySGDR','6624204PvyDgP'];_0x2965=function(){return _0x597f35;};return _0x2965();}import{mkdir,readFile,writeFile}from'fs/promises';import _0x2fff14 from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';function _0x5188(_0x404a10,_0x57755f){_0x404a10=_0x404a10-0x9d;const _0x29656d=_0x2965();let _0x5188da=_0x29656d[_0x404a10];return _0x5188da;}export async function ensureOpencodePluginConfig(_0x460d0b){const _0x5087df=_0x5188,_0x235a19={'UEAFK':function(_0x4af438,_0x4d1194){return _0x4af438(_0x4d1194);},'FqdMe':function(_0x5192a0,_0x16166c,_0x14689f){return _0x5192a0(_0x16166c,_0x14689f);},'SUjHD':'project','WBTcw':'list','DmEry':'pluginScope','rcIKY':_0x5087df(0xb1),'ySGDR':_0x5087df(0xaf),'SHgFv':_0x5087df(0xb8),'zHsqq':'@ranger-testing/opencode-plugin','bYXnU':_0x5087df(0xb3),'lhLQu':function(_0x24e7b3,_0x3e6d42,_0x1bcc01){return _0x24e7b3(_0x3e6d42,_0x1bcc01);},'rQvxN':function(_0x4bd718,_0xe7ba,_0x39287d){return _0x4bd718(_0xe7ba,_0x39287d);},'tRAky':function(_0xf06d96,_0x576c57){return _0xf06d96+_0x576c57;}},_0x522d9b=_0x235a19[_0x5087df(0xad)](existsSync,_0x235a19['FqdMe'](join,getOpencodeConfigDir('project'),'opencode.json'));let _0x3f5c72;if(_0x460d0b)_0x3f5c72=_0x460d0b;else{if(_0x522d9b)_0x3f5c72=_0x235a19[_0x5087df(0xb2)];else{console['log'](_0x5087df(0x9d));const _0x189ac0=await _0x2fff14[_0x5087df(0xa1)]([{'type':_0x235a19[_0x5087df(0x9f)],'name':_0x235a19['DmEry'],'message':_0x235a19['rcIKY'],'choices':[{'name':'User\x20(available\x20in\x20all\x20your\x20projects)','value':_0x235a19[_0x5087df(0xb5)]},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':_0x235a19[_0x5087df(0xb2)]}],'default':'user'}]);_0x3f5c72=_0x189ac0['pluginScope'];}}const _0x34d3c5=_0x235a19['FqdMe'](join,getOpencodeConfigDir(_0x3f5c72),_0x235a19['SHgFv']),_0x4cd8de=_0x235a19[_0x5087df(0xa2)],_0x2804fa=_0x235a19['bYXnU'];let _0x3f74e4={};if(existsSync(_0x34d3c5))try{const _0x21deaf=await readFile(_0x34d3c5,_0x5087df(0xa5));_0x3f74e4=JSON[_0x5087df(0xac)](_0x21deaf);}catch(_0x2d7a8b){return console[_0x5087df(0xb0)]('⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.'),{'configured':![],'scope':_0x3f5c72,'error':_0x5087df(0xba),'details':_0x2d7a8b};}const _0x5bd211=Array['isArray'](_0x3f74e4['plugin'])?_0x3f74e4['plugin']:[];if(_0x5bd211[_0x5087df(0xa9)](_0x4cd8de))return console[_0x5087df(0xa0)](_0x5087df(0xab)),{'configured':![],'scope':_0x3f5c72};return _0x3f74e4['$schema']=_0x3f74e4[_0x5087df(0x9e)]||_0x2804fa,_0x3f74e4['plugin']=[..._0x5bd211,_0x4cd8de],await _0x235a19['lhLQu'](mkdir,getOpencodeConfigDir(_0x3f5c72),{'recursive':!![]}),await _0x235a19[_0x5087df(0xa4)](writeFile,_0x34d3c5,_0x235a19[_0x5087df(0xa8)](JSON['stringify'](_0x3f74e4,null,0x2),'\x0a')),console[_0x5087df(0xa0)](_0x5087df(0xb7)),{'configured':!![],'scope':_0x3f5c72};}
@@ -1 +1 @@
1
- (function(_0xab84c2,_0x54cb03){var _0x992549=_0x4477,_0x54ae0=_0xab84c2();while(!![]){try{var _0x2051e4=parseInt(_0x992549(0x6c))/0x1+-parseInt(_0x992549(0x71))/0x2+parseInt(_0x992549(0x6d))/0x3+-parseInt(_0x992549(0x6f))/0x4+-parseInt(_0x992549(0x70))/0x5+-parseInt(_0x992549(0x74))/0x6+parseInt(_0x992549(0x6b))/0x7*(parseInt(_0x992549(0x75))/0x8);if(_0x2051e4===_0x54cb03)break;else _0x54ae0['push'](_0x54ae0['shift']());}catch(_0x437db8){_0x54ae0['push'](_0x54ae0['shift']());}}}(_0x3495,0x8dd09));function _0x4477(_0x5bdd63,_0x10fc2e){_0x5bdd63=_0x5bdd63-0x6a;var _0x349562=_0x3495();var _0x447758=_0x349562[_0x5bdd63];return _0x447758;}function _0x3495(){var _0xfe0e71=['ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','1862344WQtkMe','4268875umUCOe','640032VdMSxR','exit','QPDjP','376296qIGOYv','246272ZtwQSt','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','231LdWzJA','884563gpfTBP','1147593lzYCPL'];_0x3495=function(){return _0xfe0e71;};return _0x3495();}export async function setupCi(_0x14ab1e,_0x5771a8,_0x530e07){var _0x27399f=_0x4477,_0x564047={'QPDjP':function(_0x22e48d,_0x362a96){return _0x22e48d+_0x362a96;}};console['error'](_0x564047[_0x27399f(0x73)](_0x564047[_0x27399f(0x73)](_0x564047[_0x27399f(0x73)](_0x564047['QPDjP'](_0x27399f(0x6e)+'\x0a','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a')+'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','\x0a'),_0x27399f(0x6a)),'\x20\x20https://docs.ranger.net/main/concepts/profiles')),process[_0x27399f(0x72)](0x1);}
1
+ function _0x186d(){var _0x3a1005=['1772960NHOMXb','562512nVwDZi','EayRV','88101NJpkNe','12hEclvR','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','247518gZVvXa','67296yhUzoE','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','UbeUt','690dLtdnk','422440fWeDXX','150uFxhHx','37295kbsvNv'];_0x186d=function(){return _0x3a1005;};return _0x186d();}function _0x226d(_0x105427,_0x14d551){_0x105427=_0x105427-0x184;var _0x186daf=_0x186d();var _0x226de5=_0x186daf[_0x105427];return _0x226de5;}(function(_0xd3df27,_0x8a4d8f){var _0x417e18=_0x226d,_0x295ba0=_0xd3df27();while(!![]){try{var _0x3b77f3=-parseInt(_0x417e18(0x18c))/0x1+-parseInt(_0x417e18(0x190))/0x2+parseInt(_0x417e18(0x18b))/0x3*(-parseInt(_0x417e18(0x188))/0x4)+parseInt(_0x417e18(0x192))/0x5*(-parseInt(_0x417e18(0x191))/0x6)+parseInt(_0x417e18(0x184))/0x7+-parseInt(_0x417e18(0x185))/0x8+parseInt(_0x417e18(0x187))/0x9*(parseInt(_0x417e18(0x18f))/0xa);if(_0x3b77f3===_0x8a4d8f)break;else _0x295ba0['push'](_0x295ba0['shift']());}catch(_0x3c5489){_0x295ba0['push'](_0x295ba0['shift']());}}}(_0x186d,0x239ea));export async function setupCi(_0xc2497b,_0x398d41,_0x4f39d9){var _0x45a56a=_0x226d,_0x38ad42={'UbeUt':function(_0x266302,_0x1aedfd){return _0x266302+_0x1aedfd;},'EayRV':_0x45a56a(0x18a),'VPsCC':_0x45a56a(0x18d),'HKpCD':_0x45a56a(0x189),'uQBnp':'\x20\x20https://docs.ranger.net/main/concepts/profiles'};console['error'](_0x38ad42['UbeUt'](_0x38ad42[_0x45a56a(0x18e)](_0x38ad42[_0x45a56a(0x18e)](_0x38ad42[_0x45a56a(0x186)],'\x0a')+'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a',_0x38ad42['VPsCC'])+'\x0a'+_0x38ad42['HKpCD'],_0x38ad42['uQBnp'])),process['exit'](0x1);}
@@ -1 +1 @@
1
- (function(_0x39f698,_0x176205){const _0x421845=_0x4b4c,_0x54ce4c=_0x39f698();while(!![]){try{const _0x350399=-parseInt(_0x421845(0x12a))/0x1+-parseInt(_0x421845(0x127))/0x2*(-parseInt(_0x421845(0x135))/0x3)+parseInt(_0x421845(0x14a))/0x4*(parseInt(_0x421845(0x141))/0x5)+-parseInt(_0x421845(0x133))/0x6+-parseInt(_0x421845(0x14d))/0x7*(-parseInt(_0x421845(0x148))/0x8)+parseInt(_0x421845(0x132))/0x9*(-parseInt(_0x421845(0x137))/0xa)+-parseInt(_0x421845(0x13e))/0xb;if(_0x350399===_0x176205)break;else _0x54ce4c['push'](_0x54ce4c['shift']());}catch(_0x20ae1b){_0x54ce4c['push'](_0x54ce4c['shift']());}}}(_0x4523,0x8f1bf));import{basename}from'path';import _0x1396b1 from'inquirer';import{getToken}from'./utils/keychain.js';function _0x4b4c(_0x3b7b4c,_0x477e21){_0x3b7b4c=_0x3b7b4c-0x124;const _0x4523e1=_0x4523();let _0x4b4c2e=_0x4523e1[_0x3b7b4c];return _0x4b4c2e;}import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';function _0x4523(){const _0x429018=['ranger','stdin','message','637641BNZvzs','1938756svTzUJ','BaBDQ','57NzTVbv','\x20\x202.\x20Run:\x20ranger\x20setup','60XLwAga','autoInstall','installLevel','Where\x20should\x20skills\x20be\x20installed?','To\x20use:','kWLzm','log','8306958Lbjmgb','\x20--opencode','claude','15SqkBUw','opencode','Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20(','jlhrS','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','\x20skill','FNtsi','8ENSagx','djeqo','346252CjaoMy','StPiW','\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','5737473JahbOm','\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!','This\x20project\x20only\x20(','ijOpS','stdout','\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a','UWODQ','/skills/','isTTY','To\x20get\x20started:','119694CMjAQG','/.opencode/skills/','KVxek','126848fskbmu','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','warn','user','QAoOn'];_0x4523=function(){return _0x429018;};return _0x4523();}import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x4a90fb={}){const _0x44f0c0=_0x4b4c,_0x44fabb={'StPiW':_0x44f0c0(0x140),'kWLzm':_0x44f0c0(0x145),'FNtsi':function(_0x4f7564,_0x3b32be){return _0x4f7564===_0x3b32be;},'jlhrS':'opencode','BaBDQ':_0x44f0c0(0x13f),'djeqo':_0x44f0c0(0x12b),'CiwYq':function(_0x248e53){return _0x248e53();},'JXnrp':function(_0x24339b,_0x302ec3){return _0x24339b===_0x302ec3;},'GRHnm':function(_0x432bfd,_0xa175aa){return _0x432bfd(_0xa175aa);},'KVxek':'installLevel','hxmRm':_0x44f0c0(0x13a),'BZruJ':_0x44f0c0(0x12d),'UWODQ':'project','ijOpS':'\x0a📦\x20Installing\x20skills...\x0a','ozNRT':function(_0x3b15de,_0x30ce1b){return _0x3b15de>_0x30ce1b;},'nVJvL':function(_0x5c52c6,_0x109d81){return _0x5c52c6>_0x109d81;},'QAoOn':_0x44f0c0(0x13b),'ZTIJX':function(_0x579257,_0x8b427f){return _0x579257===_0x8b427f;},'TLTCp':'\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.'};console['log']('\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a');const _0x43bcbd=_0x4a90fb['platform']??_0x44fabb[_0x44f0c0(0x14b)],_0x2d10a5=await getToken();if(!_0x2d10a5){const _0x3fc6de='0|3|4|1|5|2'['split']('|');let _0xc4bbfb=0x0;while(!![]){switch(_0x3fc6de[_0xc4bbfb++]){case'0':console[_0x44f0c0(0x13d)](_0x44fabb[_0x44f0c0(0x13c)]);continue;case'1':console[_0x44f0c0(0x13d)](_0x44f0c0(0x136)+(_0x44fabb[_0x44f0c0(0x147)](_0x43bcbd,_0x44fabb[_0x44f0c0(0x144)])?_0x44fabb['BaBDQ']:'')+'\x20<your-api-token>');continue;case'2':return;case'3':console['log'](_0x44f0c0(0x126));continue;case'4':console[_0x44f0c0(0x13d)](_0x44fabb[_0x44f0c0(0x149)]);continue;case'5':console['log']('\x20\x203.\x20Run:\x20ranger\x20skillup'+(_0x43bcbd==='opencode'?_0x44fabb[_0x44f0c0(0x134)]:'')+'\x0a');continue;}break;}}console[_0x44f0c0(0x13d)]('✓\x20Found\x20API\x20token');const _0x567b72=_0x44fabb['CiwYq'](getProjectRoot),_0x410b13=basename(_0x567b72),_0x3233e7=_0x44fabb['JXnrp'](_0x43bcbd,_0x44fabb[_0x44f0c0(0x144)])?_0x44fabb['GRHnm'](getOpencodeConfigDir,_0x44f0c0(0x12d))+_0x44f0c0(0x124):getClaudeConfigDir()+_0x44f0c0(0x124),_0x53e0c8=_0x43bcbd===_0x44f0c0(0x142)?_0x567b72+_0x44f0c0(0x128):_0x567b72+'/.claude/skills/',_0x44313d=process[_0x44f0c0(0x130)][_0x44f0c0(0x125)]&&process[_0x44f0c0(0x151)][_0x44f0c0(0x125)];let _0x3fefc7;if(_0x4a90fb[_0x44f0c0(0x138)])_0x3fefc7=_0x4a90fb[_0x44f0c0(0x138)];else{if(_0x44313d){const _0x1f10b9=await _0x1396b1['prompt']([{'type':'list','name':_0x44fabb[_0x44f0c0(0x129)],'message':_0x44fabb['hxmRm'],'choices':[{'name':'All\x20projects\x20('+_0x3233e7+')','value':_0x44fabb['BZruJ']},{'name':_0x44f0c0(0x14f)+_0x53e0c8+')','value':_0x44fabb[_0x44f0c0(0x153)]}]}]);_0x3fefc7=_0x1f10b9[_0x44f0c0(0x139)];}else _0x3fefc7=_0x44fabb['UWODQ'],console['log'](_0x44f0c0(0x143)+_0x53e0c8+')');}let _0xbda909=0x0;const _0x435bfc=getCurrentVersion();console[_0x44f0c0(0x13d)](_0x44fabb[_0x44f0c0(0x150)]);try{const _0x4b29cb=await installSkill(_0x44f0c0(0x12f),{'cliVersion':_0x435bfc,'level':_0x3fefc7,'platform':_0x43bcbd});_0x4b29cb&&_0xbda909++;}catch(_0x1053e5){console[_0x44f0c0(0x12c)](_0x44f0c0(0x14c),_0x1053e5 instanceof Error?_0x1053e5[_0x44f0c0(0x131)]:_0x1053e5);}if(_0x44fabb['ozNRT'](_0xbda909,0x0)){const _0x3be209=_0x3fefc7===_0x44fabb['BZruJ']?'user-level':'project-level';console['log']('\x0a✅\x20Installed\x20'+_0xbda909+'\x20'+_0x3be209+_0x44f0c0(0x146)+(_0x44fabb['nVJvL'](_0xbda909,0x1)?'s':'')+'\x20successfully!\x0a'),!_0x4a90fb['suppressUsage']&&(console['log'](_0x44fabb[_0x44f0c0(0x12e)]),_0x44fabb['ZTIJX'](_0x43bcbd,_0x44f0c0(0x142))?console['log'](_0x44fabb['TLTCp']):console['log'](_0x44f0c0(0x14e)));}else console[_0x44f0c0(0x13d)](_0x44f0c0(0x152));}
1
+ (function(_0x362d6c,_0x3ea506){const _0x2b6538=_0x4950,_0x4d9407=_0x362d6c();while(!![]){try{const _0x2f0f5b=parseInt(_0x2b6538(0x17e))/0x1+-parseInt(_0x2b6538(0x186))/0x2*(-parseInt(_0x2b6538(0x17a))/0x3)+-parseInt(_0x2b6538(0x197))/0x4*(parseInt(_0x2b6538(0x192))/0x5)+-parseInt(_0x2b6538(0x172))/0x6+parseInt(_0x2b6538(0x182))/0x7+-parseInt(_0x2b6538(0x18a))/0x8*(parseInt(_0x2b6538(0x199))/0x9)+-parseInt(_0x2b6538(0x16a))/0xa*(parseInt(_0x2b6538(0x185))/0xb);if(_0x2f0f5b===_0x3ea506)break;else _0x4d9407['push'](_0x4d9407['shift']());}catch(_0x207a57){_0x4d9407['push'](_0x4d9407['shift']());}}}(_0x40cb,0xbc6c3));import{basename}from'path';import _0x1bc068 from'inquirer';import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';function _0x4950(_0x987384,_0x39c9b0){_0x987384=_0x987384-0x168;const _0x40cbf4=_0x40cb();let _0x4950e1=_0x40cbf4[_0x987384];return _0x4950e1;}function _0x40cb(){const _0xa0637f=['\x20successfully!\x0a','WgZFz','\x20<your-api-token>','248KRbAVD','\x20skill','DVcrn','/skills/','Where\x20should\x20skills\x20be\x20installed?','\x0a📦\x20Installing\x20skills...\x0a','✓\x20Found\x20API\x20token','\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','335kZBAqz','project-level','user-level','autoInstall','log','22036OlQyio','\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','109503gHYqhH','TMfoH','\x20\x202.\x20Run:\x20ranger\x20setup','prompt','list','/.claude/skills/','All\x20projects\x20(','installLevel','120ganixi','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','user','yfkaj','To\x20use:','xTKQj','WfHZT','\x20\x203.\x20Run:\x20ranger\x20skillup','8594298lIPxZQ','\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!','opencode','YFNxf','Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20(','stdout','/.opencode/skills/','platform','3ruryBb','\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a','xfMRN','TIzQX','1333688vJOWJV','\x20--opencode','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','project','10266046wOJGdU','stdin','uwYNv','488994eBCszQ','1367248oEWHgj'];_0x40cb=function(){return _0xa0637f;};return _0x40cb();}import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x3f656e={}){const _0x4d73df=_0x4950,_0x3c89df={'WfHZT':'4|3|1|2|0|5','ShSNu':_0x4d73df(0x16b),'LytBj':_0x4d73df(0x17f),'lzqnH':'To\x20get\x20started:','oeAXo':_0x4d73df(0x180),'TMfoH':function(_0x14a241){return _0x14a241();},'xKVEW':_0x4d73df(0x174),'uwYNv':function(_0x3b19e5){return _0x3b19e5();},'DVcrn':function(_0x38cf8b,_0x110283){return _0x38cf8b===_0x110283;},'ooSgo':_0x4d73df(0x19d),'lvFwb':_0x4d73df(0x169),'yfkaj':_0x4d73df(0x18e),'xfMRN':_0x4d73df(0x181),'WgZFz':function(_0x4b4134){return _0x4b4134();},'TIzQX':_0x4d73df(0x18f),'YFNxf':function(_0x1da60a,_0x54a5b9,_0xb89b30){return _0x1da60a(_0x54a5b9,_0xb89b30);},'EdFgw':'ranger','xTKQj':_0x4d73df(0x193)};console['log'](_0x4d73df(0x191));const _0x519b5b=_0x3f656e[_0x4d73df(0x179)]??'claude',_0x3231d1=await getToken();if(!_0x3231d1){const _0x2f86bc=_0x3c89df[_0x4d73df(0x170)]['split']('|');let _0x157757=0x0;while(!![]){switch(_0x2f86bc[_0x157757++]){case'0':console[_0x4d73df(0x196)](_0x4d73df(0x171)+(_0x519b5b==='opencode'?'\x20--opencode':'')+'\x0a');continue;case'1':console[_0x4d73df(0x196)](_0x3c89df['ShSNu']);continue;case'2':console[_0x4d73df(0x196)](_0x4d73df(0x19b)+(_0x519b5b===_0x4d73df(0x174)?_0x3c89df['LytBj']:'')+_0x4d73df(0x189));continue;case'3':console[_0x4d73df(0x196)](_0x3c89df['lzqnH']);continue;case'4':console['log'](_0x3c89df['oeAXo']);continue;case'5':return;}break;}}console[_0x4d73df(0x196)](_0x4d73df(0x190));const _0x1f1d76=_0x3c89df[_0x4d73df(0x19a)](getProjectRoot),_0x4230c5=basename(_0x1f1d76),_0x49573f=_0x519b5b===_0x3c89df['xKVEW']?getOpencodeConfigDir(_0x4d73df(0x16c))+_0x4d73df(0x18d):_0x3c89df[_0x4d73df(0x184)](getClaudeConfigDir)+_0x4d73df(0x18d),_0x1df843=_0x3c89df['DVcrn'](_0x519b5b,_0x4d73df(0x174))?_0x1f1d76+_0x4d73df(0x178):_0x1f1d76+_0x4d73df(0x19e),_0x43b8d0=process[_0x4d73df(0x183)]['isTTY']&&process[_0x4d73df(0x177)]['isTTY'];let _0x18b551;if(_0x3f656e['autoInstall'])_0x18b551=_0x3f656e[_0x4d73df(0x195)];else{if(_0x43b8d0){const _0x56a135=await _0x1bc068[_0x4d73df(0x19c)]([{'type':_0x3c89df['ooSgo'],'name':_0x3c89df['lvFwb'],'message':_0x3c89df[_0x4d73df(0x16d)],'choices':[{'name':_0x4d73df(0x168)+_0x49573f+')','value':_0x4d73df(0x16c)},{'name':'This\x20project\x20only\x20('+_0x1df843+')','value':_0x3c89df[_0x4d73df(0x17c)]}]}]);_0x18b551=_0x56a135[_0x4d73df(0x169)];}else _0x18b551=_0x3c89df[_0x4d73df(0x17c)],console['log'](_0x4d73df(0x176)+_0x1df843+')');}let _0xbebb6a=0x0;const _0x123ada=_0x3c89df[_0x4d73df(0x188)](getCurrentVersion);console['log'](_0x3c89df[_0x4d73df(0x17d)]);try{const _0x43901a=await _0x3c89df[_0x4d73df(0x175)](installSkill,_0x3c89df['EdFgw'],{'cliVersion':_0x123ada,'level':_0x18b551,'platform':_0x519b5b});_0x43901a&&_0xbebb6a++;}catch(_0x4fe501){console['warn'](_0x4d73df(0x198),_0x4fe501 instanceof Error?_0x4fe501['message']:_0x4fe501);}if(_0xbebb6a>0x0){const _0xff202e=_0x18b551===_0x4d73df(0x16c)?_0x4d73df(0x194):_0x3c89df[_0x4d73df(0x16f)];console[_0x4d73df(0x196)]('\x0a✅\x20Installed\x20'+_0xbebb6a+'\x20'+_0xff202e+_0x4d73df(0x18b)+(_0xbebb6a>0x1?'s':'')+_0x4d73df(0x187)),!_0x3f656e['suppressUsage']&&(console[_0x4d73df(0x196)](_0x4d73df(0x16e)),_0x3c89df[_0x4d73df(0x18c)](_0x519b5b,_0x4d73df(0x174))?console[_0x4d73df(0x196)]('\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.'):console['log'](_0x4d73df(0x173)));}else console['log'](_0x4d73df(0x17b));}
@@ -1 +1 @@
1
- (function(_0x43f370,_0xf392d5){const _0x357ed6=_0x426c,_0x41e90e=_0x43f370();while(!![]){try{const _0x295eb0=parseInt(_0x357ed6(0x1cf))/0x1*(-parseInt(_0x357ed6(0x1c2))/0x2)+parseInt(_0x357ed6(0x1b3))/0x3+-parseInt(_0x357ed6(0x223))/0x4+-parseInt(_0x357ed6(0x21f))/0x5+-parseInt(_0x357ed6(0x205))/0x6*(parseInt(_0x357ed6(0x1d6))/0x7)+parseInt(_0x357ed6(0x1b8))/0x8*(-parseInt(_0x357ed6(0x1df))/0x9)+-parseInt(_0x357ed6(0x1fc))/0xa*(-parseInt(_0x357ed6(0x213))/0xb);if(_0x295eb0===_0xf392d5)break;else _0x41e90e['push'](_0x41e90e['shift']());}catch(_0x24360e){_0x41e90e['push'](_0x41e90e['shift']());}}}(_0x2b07,0x4b485));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';function _0x426c(_0x2e38be,_0x3ef5d7){_0x2e38be=_0x2e38be-0x1b2;const _0x2b07b8=_0x2b07();let _0x426c93=_0x2b07b8[_0x2e38be];return _0x426c93;}import{createRequire}from'module';import{spawn}from'child_process';import _0x53a6b0 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);function _0x2b07(){const _0xa4696=['\x20now?','✓\x20Authenticated\x20to\x20','✓\x20Exported\x20credentials\x20for\x20CI','local','method','plugin','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','37JGZldS','REPoX','skipChromium','xsSVx','version','organizationName','Validating\x20API\x20token...','1062502YGGqRa','auXui','ranger','YhgIN','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','\x20is\x20no\x20longer\x20supported.\x20','confirm','9sdrOqx','resolve','\x0a🚀\x20Ranger\x20Setup\x0a','status','ready','url','profile','chromium','ignore','\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','close','tfVZQ','UmrYq','mBjlD','rrNOB','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','trackPhaseEnd','aHNLo','\x20(fallback\x20version)','ZZJLK','success','The\x20required\x20version\x20(','skipAuth','GBGTp','rpiYp','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','1150zKfzQx','bzfNC','platform','scope','✓\x20Already\x20authenticated\x20to\x20','existing_token','pBlFQ','...','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','6SENIle','\x0aInstalling\x20Chromium\x20browser...\x0a','user','geJTy','DnDkR','igzdi','ENWEj','error','OSIwM','playwright/package.json','lHlLC','inherit','win32','isTTY','133265CeKJXZ','trackPhaseStart','warn','GITHUB_ENV','provided_token','/ranger:enable','CMTXz','YYGHh','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','exit','xdPoa','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','328850xWsfPF','\x0a\x20\x20','opencode','skipped','453280pwXGoY','message','ilOHP','--with-deps','coboP','force','✓\x20Created\x20~/.ranger/\x20directory','880017pPAfmJ','log','stdout','cevzZ','\x20and\x20prompt\x20the\x20coding','4616488KKimgi','device_auth','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','wKvSa','skills','DEcgd','lDfoE','JxYJG','25420CBziTO','npx','.gitignore','\x20\x20npx\x20playwright@',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','zHxNt'];_0x2b07=function(){return _0xa4696;};return _0x2b07();}export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.58.2';const bold=_0x888b14=>'\x1b[1m'+_0x888b14+'\x1b[0m';export function getPlaywrightVersion(){const _0x1ae2f0=_0x426c;try{const _0x792ae4=require[_0x1ae2f0(0x1e0)](_0x1ae2f0(0x20e)),_0x140b83=require(_0x792ae4);return _0x140b83[_0x1ae2f0(0x1d3)];}catch{return null;}}export function installChromiumBinary(_0x1e8ad3,_0x2848cb=![]){const _0x138f73=_0x426c,_0x299aed={'otxmL':function(_0x32237d){return _0x32237d();},'lzHgg':_0x138f73(0x226),'ZZJLK':'chromium','NbQwg':function(_0x361c67,_0x5e3cfd,_0x4a41ff,_0x48c468){return _0x361c67(_0x5e3cfd,_0x4a41ff,_0x48c468);},'MNYEz':_0x138f73(0x1e7),'wKvSa':_0x138f73(0x210),'cwCUB':_0x138f73(0x1eb),'igzdi':'error'};return new Promise((_0x2e1aa7,_0x1e3dde)=>{const _0x2ff49d=_0x138f73,_0x58b497={'IXogc':function(_0xc7fe65,_0x58c315){return _0xc7fe65(_0x58c315);}},_0x25eab3=['playwright@'+_0x1e8ad3,'install',..._0x2848cb?[_0x299aed['lzHgg']]:[],_0x299aed[_0x2ff49d(0x1f5)]],_0x352f81=_0x299aed['NbQwg'](spawn,_0x2ff49d(0x1c3),_0x25eab3,{'stdio':[_0x299aed['MNYEz'],_0x299aed[_0x2ff49d(0x1bd)],_0x2ff49d(0x210)],'shell':process[_0x2ff49d(0x1fe)]===_0x2ff49d(0x211)});_0x352f81['on'](_0x299aed['cwCUB'],_0x4116b5=>{_0x4116b5===0x0?_0x299aed['otxmL'](_0x2e1aa7):_0x1e3dde(new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x4116b5));}),_0x352f81['on'](_0x299aed[_0x2ff49d(0x20a)],_0xd15bb3=>{_0x58b497['IXogc'](_0x1e3dde,_0xd15bb3);});});}export async function authenticate(_0x2b554a){const _0x193f9b=_0x426c,_0x50455c={'xsSVx':function(_0xb8c422){return _0xb8c422();},'YhgIN':function(_0x3f3ef4,_0x1596f2){return _0x3f3ef4(_0x1596f2);},'DnDkR':function(_0x33f167,_0x81cafc){return _0x33f167(_0x81cafc);},'xGdhM':_0x193f9b(0x1b9),'SykQX':_0x193f9b(0x1d5)};if(!_0x2b554a){const _0x108d47=await _0x50455c[_0x193f9b(0x1d2)](getToken);if(_0x108d47){const _0xea928b=await _0x50455c['YhgIN'](getCurrentUser,_0x108d47);if(_0xea928b[_0x193f9b(0x1f6)])return console[_0x193f9b(0x1b4)](_0x193f9b(0x200)+_0xea928b[_0x193f9b(0x207)]['organizationName']),{'token':_0x108d47,'method':_0x193f9b(0x201)};}try{_0x2b554a=await _0x50455c[_0x193f9b(0x1d2)](runDeviceAuthFlow);}catch(_0xe0dc74){throw new Error('Authentication\x20failed:\x20'+(_0xe0dc74 instanceof Error?_0xe0dc74[_0x193f9b(0x224)]:_0xe0dc74));}const _0x33bc83=await _0x50455c[_0x193f9b(0x209)](getCurrentUser,_0x2b554a);if(!_0x33bc83['success'])throw new Error(_0x193f9b(0x1bc)+_0x33bc83[_0x193f9b(0x20c)]);return console[_0x193f9b(0x1b4)](_0x193f9b(0x1c9)+_0x33bc83['user']['organizationName']),{'token':_0x2b554a,'method':_0x50455c['xGdhM']};}console[_0x193f9b(0x1b4)](_0x50455c['SykQX']);const _0x3dc51a=await getCurrentUser(_0x2b554a);if(!_0x3dc51a[_0x193f9b(0x1f6)]){if(_0x3dc51a[_0x193f9b(0x1e2)])throw new Error('Authentication\x20failed:\x20'+_0x3dc51a[_0x193f9b(0x20c)]+_0x193f9b(0x1ce));else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x3dc51a['error']+_0x193f9b(0x21b));}return console['log']('✓\x20Authenticated\x20to\x20'+_0x3dc51a['user'][_0x193f9b(0x1d4)]),await _0x50455c[_0x193f9b(0x1d9)](storeToken,_0x2b554a),console['log'](process['env'][_0x193f9b(0x216)]?_0x193f9b(0x1ca):'✓\x20Stored\x20credentials\x20locally'),{'token':_0x2b554a,'method':_0x193f9b(0x217)};}export async function ensureRangerDir(_0x3d3bf3){const _0x3b9616=_0x426c,_0x3126b8={'tfVZQ':function(_0x14db8b,_0x2567b5,_0x546b0b){return _0x14db8b(_0x2567b5,_0x546b0b);},'REPoX':'✓\x20~/.ranger/\x20directory\x20already\x20exists'};void _0x3d3bf3;const _0x3c5597=getRangerHomeDir();return!existsSync(_0x3c5597)?(await _0x3126b8[_0x3b9616(0x1ec)](mkdir,_0x3c5597,{'recursive':!![]}),console[_0x3b9616(0x1b4)](_0x3b9616(0x1b2)),{'path':_0x3c5597,'installed':!![]}):(console[_0x3b9616(0x1b4)](_0x3126b8[_0x3b9616(0x1d0)]),{'path':_0x3c5597,'installed':![]});}export async function ensureChromium(_0x417eef=![]){const _0x19d84a=_0x426c,_0x7f4ae0={'DUSIF':function(_0x4859b5,_0x1702e3){return _0x4859b5(_0x1702e3);},'rpiYp':function(_0xe3c78b){return _0xe3c78b();},'rFvGi':_0x19d84a(0x1de),'cevzZ':'install','JxYJG':function(_0x424526,_0x49d380,_0x873e70){return _0x424526(_0x49d380,_0x873e70);},'NcZlR':'\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','ztbOn':function(_0x34a666,_0x54bbb7){return _0x34a666 instanceof _0x54bbb7;},'eDefO':'You\x20can\x20install\x20it\x20manually\x20by\x20running:','bTtLM':'\x0a⚠\x20Skipping\x20Chromium\x20installation.','ppmVO':_0x19d84a(0x1ea)};let _0x5229ed=![];try{const _0xca96bb=chromium['executablePath']();_0x5229ed=_0x7f4ae0['DUSIF'](existsSync,_0xca96bb);}catch{_0x5229ed=![];}if(_0x5229ed)return console[_0x19d84a(0x1b4)]('✓\x20Playwright\x20Chromium\x20browser\x20found'),![];const _0x216e4c=_0x7f4ae0[_0x19d84a(0x1fa)](getPlaywrightVersion),_0x16fdaf=_0x216e4c??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x10f6b3=!_0x216e4c,_0x4ce33c=process['stdin'][_0x19d84a(0x212)]&&process[_0x19d84a(0x1b5)][_0x19d84a(0x212)];let _0x289bd0=!![];if(_0x4ce33c){const {install:_0xe9797}=await _0x53a6b0['prompt']([{'type':_0x7f4ae0['rFvGi'],'name':_0x7f4ae0[_0x19d84a(0x1b6)],'message':_0x10f6b3?_0x19d84a(0x1f0)+_0x16fdaf+_0x19d84a(0x1c8):_0x19d84a(0x1f7)+_0x16fdaf+_0x19d84a(0x1c6),'default':!![]}]);_0x289bd0=_0xe9797;}else console[_0x19d84a(0x1b4)](_0x19d84a(0x1fb)+_0x16fdaf+(_0x10f6b3?_0x19d84a(0x1f4):'')+_0x19d84a(0x203));if(_0x289bd0){console[_0x19d84a(0x1b4)](_0x19d84a(0x206));try{await _0x7f4ae0[_0x19d84a(0x1c1)](installChromiumBinary,_0x16fdaf,_0x417eef),console[_0x19d84a(0x1b4)](_0x7f4ae0['NcZlR']);}catch(_0x3c6976){console['error']('\x0a❌\x20Failed\x20to\x20install\x20Chromium:',_0x7f4ae0['ztbOn'](_0x3c6976,Error)?_0x3c6976['message']:_0x3c6976),console[_0x19d84a(0x1b4)](_0x7f4ae0['eDefO']),console[_0x19d84a(0x1b4)](_0x19d84a(0x1c5)+_0x16fdaf+'\x20install\x20chromium');}}else console['log'](_0x7f4ae0['bTtLM']),console['log'](_0x7f4ae0['ppmVO']),console[_0x19d84a(0x1b4)]('\x20\x20npx\x20playwright@'+_0x16fdaf+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x4aafd9){const _0x3bcdc5=_0x426c,_0x13389e={'GBGTp':function(_0x217daf,_0x4e1c50,_0x2d8fb9){return _0x217daf(_0x4e1c50,_0x2d8fb9);},'ilOHP':_0x3bcdc5(0x1c4),'vAbnL':function(_0x2e0823,_0x1240fc,_0x511063){return _0x2e0823(_0x1240fc,_0x511063);},'epjvk':'✓\x20Created\x20.ranger/.gitignore'},_0x1955e7=_0x13389e[_0x3bcdc5(0x1f9)](join,_0x4aafd9,_0x13389e[_0x3bcdc5(0x225)]),_0x5fd6ed='\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 _0x13389e['vAbnL'](writeFile,_0x1955e7,_0x5fd6ed),console['log'](_0x13389e['epjvk']);}export async function ensureLocalEnv(_0x468b5f,_0x2e0485){const _0x2712cc=_0x426c,_0x5b53e1={'XAfTa':'⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','rrNOB':_0x2712cc(0x207),'JfQRj':_0x2712cc(0x1cb),'ulXzI':'✓\x20Local\x20profile\x20already\x20exists','bzfNC':function(_0x180e7c,_0x52eff7,_0x3739b7,_0x3bc48e){return _0x180e7c(_0x52eff7,_0x3739b7,_0x3bc48e);},'amhyC':'\x0a❌\x20Profile\x20setup\x20failed:'};if(!findGitRoot()&&_0x468b5f?.[_0x2712cc(0x1ff)]!==_0x2712cc(0x207))return console[_0x2712cc(0x1b4)](_0x5b53e1['XAfTa']),{'ready':![],'skipped':!![]};const _0x139442=_0x468b5f?.['scope']===_0x5b53e1[_0x2712cc(0x1ef)]?getRangerHomeDir():undefined;if(findExistingEnv(_0x5b53e1['JfQRj'],{'locations':['local'],'rangerDir':_0x139442}))return console[_0x2712cc(0x1b4)](_0x5b53e1['ulXzI']),{'ready':!![],'skipped':![]};try{return await _0x5b53e1[_0x2712cc(0x1fd)](addEnv,_0x2712cc(0x1cb),{'url':_0x468b5f?.[_0x2712cc(0x1e4)],'force':_0x468b5f?.[_0x2712cc(0x228)],'allowInsecureLocalhost':_0x468b5f?.['allowInsecureLocalhost'],'scope':_0x468b5f?.[_0x2712cc(0x1ff)]},_0x2e0485),{'ready':!![],'skipped':![]};}catch(_0x494a04){return console[_0x2712cc(0x20c)](_0x5b53e1['amhyC'],_0x494a04 instanceof Error?_0x494a04['message']:_0x494a04),{'ready':![],'skipped':![]};}}export async function start(_0x23dd1d,_0x10a241,_0x17f365){const _0x596c6a=_0x426c,_0x2dfed8={'geJTy':_0x596c6a(0x207),'auXui':function(_0x3adf20,_0x4772bb){return _0x3adf20+_0x4772bb;},'mBjlD':function(_0x17defa,_0x3ab003){return _0x17defa(_0x3ab003);},'lDfoE':'auth','pBlFQ':_0x596c6a(0x1cd),'UmrYq':function(_0x241e7f,_0x3d0e30){return _0x241e7f(_0x3d0e30);},'coboP':function(_0x2145ec){return _0x2145ec();},'ENWEj':_0x596c6a(0x1be),'CMTXz':function(_0x134270,_0x96e414){return _0x134270(_0x96e414);},'xdPoa':function(_0x17c658,_0x348ee8,_0x185db1){return _0x17c658(_0x348ee8,_0x185db1);},'aHNLo':_0x596c6a(0x1e5),'zHxNt':function(_0x3d480c,_0x3af78d){return _0x3d480c+_0x3af78d;},'lHlLC':function(_0x1c44d6,_0x1f7891){return _0x1c44d6(_0x1f7891);},'IGsaJ':'ranger\x20profile\x20add\x20<name>','YYGHh':'\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','KPQMV':'and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','OSIwM':'with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','RUPOS':_0x596c6a(0x1dc),'PKgYI':function(_0x5c1abb,_0x6001c){return _0x5c1abb(_0x6001c);},'tbgvU':_0x596c6a(0x218),'DEcgd':function(_0xafed1d,_0x23b8d8){return _0xafed1d+_0x23b8d8;}};console[_0x596c6a(0x1b4)](_0x596c6a(0x1e1));_0x10a241?.['scope']!==undefined&&_0x10a241[_0x596c6a(0x1ff)]!==_0x2dfed8[_0x596c6a(0x208)]&&(console['error'](_0x2dfed8[_0x596c6a(0x1d7)]('ranger\x20setup\x20--scope='+String(_0x10a241[_0x596c6a(0x1ff)])+_0x596c6a(0x1dd),_0x596c6a(0x1ba))+'project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.'),process[_0x596c6a(0x21c)](0x1));_0x10a241={..._0x10a241,'scope':'user'};const _0x10c7bc=!_0x2dfed8[_0x596c6a(0x1ee)](existsSync,getRangerHomeDir());await _0x2dfed8['mBjlD'](ensureRangerDir,_0x2dfed8[_0x596c6a(0x208)]);if(_0x10a241?.[_0x596c6a(0x1f8)])console[_0x596c6a(0x1b4)]('✓\x20Skipping\x20authentication\x20(--skip-auth)'),_0x17f365?.['trackPhaseEnd'](_0x2dfed8[_0x596c6a(0x1c0)],{'isFirstRun':_0x10c7bc,'method':'skipped'});else{_0x17f365?.['trackPhaseStart']('auth');const _0x2779d8=await authenticate(_0x23dd1d);_0x17f365?.['trackPhaseEnd'](_0x2dfed8[_0x596c6a(0x1c0)],{'isFirstRun':_0x10c7bc,'method':_0x2779d8[_0x596c6a(0x1cc)]});}_0x17f365?.[_0x596c6a(0x214)](_0x596c6a(0x1e6));_0x10a241?.[_0x596c6a(0x1d1)]?console[_0x596c6a(0x1b4)](_0x596c6a(0x21e)):await _0x2dfed8['mBjlD'](ensureChromium,_0x10a241?.['withDeps']);_0x17f365?.[_0x596c6a(0x1f2)](_0x596c6a(0x1e6),{'isFirstRun':_0x10c7bc,'skipped':!!_0x10a241?.[_0x596c6a(0x1d1)]}),console[_0x596c6a(0x1b4)]('\x0a✅\x20Ranger\x20setup\x20complete!\x0a');const _0x10c6fa=_0x10a241?.[_0x596c6a(0x1ff)],_0x5007d6=_0x10a241?.['opencode']??![];let _0x3e23a7=null;_0x5007d6?(_0x17f365?.['trackPhaseStart'](_0x2dfed8[_0x596c6a(0x202)]),_0x3e23a7=await ensureOpencodePluginConfig(_0x10c6fa),_0x17f365?.[_0x596c6a(0x1f2)](_0x2dfed8['pBlFQ'],{'isFirstRun':_0x10c7bc,'opencode':!![]})):(_0x17f365?.[_0x596c6a(0x214)](_0x2dfed8[_0x596c6a(0x202)]),await _0x2dfed8[_0x596c6a(0x1ed)](ensureClaudePlugin,_0x10c6fa),_0x17f365?.[_0x596c6a(0x1f2)]('plugin',{'isFirstRun':_0x10c7bc}));if(_0x5007d6&&_0x3e23a7){_0x17f365?.['trackPhaseStart']('skills');try{await installSkill(_0x596c6a(0x1d8),{'level':_0x3e23a7[_0x596c6a(0x1ff)],'cliVersion':_0x2dfed8[_0x596c6a(0x227)](getCurrentVersion),'platform':_0x596c6a(0x221)}),_0x17f365?.[_0x596c6a(0x1f2)](_0x2dfed8[_0x596c6a(0x20b)],{'isFirstRun':_0x10c7bc,'opencode':!![]});}catch(_0x7d7273){console[_0x596c6a(0x215)]('\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:',_0x7d7273 instanceof Error?_0x7d7273[_0x596c6a(0x224)]:_0x7d7273),_0x17f365?.[_0x596c6a(0x1f2)](_0x2dfed8[_0x596c6a(0x20b)],{'isFirstRun':_0x10c7bc,'opencode':!![],'failed':!![]});}}else _0x17f365?.[_0x596c6a(0x214)](_0x2dfed8[_0x596c6a(0x20b)]),await _0x2dfed8[_0x596c6a(0x219)](ensureClaudeSkills,_0x10c6fa),_0x17f365?.[_0x596c6a(0x1f2)](_0x2dfed8['ENWEj'],{'isFirstRun':_0x10c7bc});if(_0x10a241?.['skipAuth'])console['log'](_0x596c6a(0x204));else{if(_0x10a241?.['url']){_0x17f365?.[_0x596c6a(0x214)]('profile');const _0x54f3f3=await _0x2dfed8[_0x596c6a(0x21d)](ensureLocalEnv,{'url':_0x10a241['url'],'force':_0x10a241?.[_0x596c6a(0x228)],'allowInsecureLocalhost':_0x10a241?.['allowInsecureLocalhost'],'scope':_0x596c6a(0x207)},_0x17f365);_0x17f365?.['trackPhaseEnd'](_0x2dfed8[_0x596c6a(0x1f3)],{'isFirstRun':_0x10c7bc,'profileReady':_0x54f3f3[_0x596c6a(0x1e3)],'userSkipped':_0x54f3f3[_0x596c6a(0x222)]});}else console[_0x596c6a(0x1b4)](_0x2dfed8['auXui'](_0x2dfed8[_0x596c6a(0x1d7)](_0x2dfed8['zHxNt'](_0x596c6a(0x1f1),_0x596c6a(0x220)+_0x2dfed8[_0x596c6a(0x20f)](bold,_0x2dfed8['IGsaJ']))+_0x596c6a(0x1e9),_0x596c6a(0x1e8)),_0x596c6a(0x1da)));}if(_0x5007d6)console['log'](_0x2dfed8[_0x596c6a(0x21a)]),console['log'](_0x2dfed8['KPQMV']),console['log'](_0x2dfed8[_0x596c6a(0x20d)]),console[_0x596c6a(0x1b4)](_0x2dfed8['RUPOS']);else{const _0x297575=_0x2dfed8['PKgYI'](bold,_0x2dfed8['tbgvU']);console['log'](_0x2dfed8[_0x596c6a(0x1c7)](_0x2dfed8['auXui'](_0x2dfed8[_0x596c6a(0x1bf)]('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x297575+_0x596c6a(0x1b7),'\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with'),_0x596c6a(0x1db)),_0x596c6a(0x1bb)));}}
1
+ const _0x234b51=_0x5494;(function(_0x22b581,_0x25ff83){const _0x400124=_0x5494,_0x5f1fef=_0x22b581();while(!![]){try{const _0xeb5ddf=parseInt(_0x400124(0x214))/0x1+-parseInt(_0x400124(0x1f7))/0x2*(parseInt(_0x400124(0x1e2))/0x3)+-parseInt(_0x400124(0x212))/0x4+-parseInt(_0x400124(0x204))/0x5+-parseInt(_0x400124(0x1f1))/0x6+parseInt(_0x400124(0x22c))/0x7+parseInt(_0x400124(0x224))/0x8*(parseInt(_0x400124(0x21d))/0x9);if(_0xeb5ddf===_0x25ff83)break;else _0x5f1fef['push'](_0x5f1fef['shift']());}catch(_0x382577){_0x5f1fef['push'](_0x5f1fef['shift']());}}}(_0x424f,0x277e1));function _0x424f(){const _0x1eab35=['wnCfT','skipped','message','device_auth','\x20\x20npx\x20playwright@','inherit','.gitignore','\x0aIn\x20Claude\x20Code,\x20run\x20','win32','294590HHQoIp','isTTY','allowInsecureLocalhost','ignore','✓\x20Created\x20~/.ranger/\x20directory','plugin','/ranger:enable','knvnN','scope','skipAuth','GbQMO','GITHUB_ENV','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','log','1026860MJoIzT','platform','29529coryyO','✓\x20Skipping\x20authentication\x20(--skip-auth)','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','✓\x20Authenticated\x20to\x20','url','pcrXr','\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','\x20(fallback\x20version)','method','6884244ZjdVut','opencode','skipChromium','profile','success','npx','\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','8pTTtkj','Gcvpy','skills','\x20now?','DBxPq','CkBrr','qVTNM','user','1770006ZKMEPO','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','\x0a\x20\x20','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','wGxzy','✓\x20Playwright\x20Chromium\x20browser\x20found','trackPhaseEnd','asATg','1.58.2','stdin','force','auth','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','\x0a❌\x20Profile\x20setup\x20failed:','ranger\x20profile\x20add\x20<name>','cneyS','MWmtC','6zDnFWO','✓\x20Already\x20authenticated\x20to\x20','dovjL','✓\x20Exported\x20credentials\x20for\x20CI','trackPhaseStart','\x20is\x20no\x20longer\x20supported.\x20','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','\x1b[0m','hlQOj','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','error','ZJCiq','PNmZV','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','xOBCO','1531962GErpcO','wDmYi','warn','Validating\x20API\x20token...','HBuqg','nmmAq','314582seUhXi','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','organizationName','oyNnh'];_0x424f=function(){return _0x1eab35;};return _0x424f();}import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x4f2615 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';function _0x5494(_0x14a094,_0x550eaf){_0x14a094=_0x14a094-0x1df;const _0x424fd6=_0x424f();let _0x549425=_0x424fd6[_0x14a094];return _0x549425;}const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION=_0x234b51(0x234);const bold=_0x3f6d08=>'\x1b[1m'+_0x3f6d08+_0x234b51(0x1e9);export function getPlaywrightVersion(){try{const _0x36ec14=require['resolve']('playwright/package.json'),_0x11210a=require(_0x36ec14);return _0x11210a['version'];}catch{return null;}}export function installChromiumBinary(_0x4b0df,_0x32b170=![]){const _0x107585=_0x234b51,_0x2ac1b8={'asATg':function(_0x23b166){return _0x23b166();},'nPqId':function(_0x4f6741,_0x4096fd){return _0x4f6741(_0x4096fd);},'nmmAq':'install','xOBCO':'chromium','uqYSd':_0x107585(0x222),'DVIRx':_0x107585(0x207),'OELtf':_0x107585(0x200),'olIcz':function(_0x7337fa,_0x25a227){return _0x7337fa===_0x25a227;},'PNmZV':_0x107585(0x203),'yqMpn':'close','wnCfT':_0x107585(0x1ec)};return new Promise((_0x3114ca,_0xb8082d)=>{const _0x51b34f=_0x107585,_0x4efa41=['playwright@'+_0x4b0df,_0x2ac1b8[_0x51b34f(0x1f6)],..._0x32b170?['--with-deps']:[],_0x2ac1b8[_0x51b34f(0x1f0)]],_0x39f468=spawn(_0x2ac1b8['uqYSd'],_0x4efa41,{'stdio':[_0x2ac1b8['DVIRx'],_0x2ac1b8['OELtf'],_0x51b34f(0x200)],'shell':_0x2ac1b8['olIcz'](process[_0x51b34f(0x213)],_0x2ac1b8[_0x51b34f(0x1ee)])});_0x39f468['on'](_0x2ac1b8['yqMpn'],_0x49a024=>{const _0x27555e=_0x51b34f;_0x49a024===0x0?_0x2ac1b8[_0x27555e(0x233)](_0x3114ca):_0x2ac1b8['nPqId'](_0xb8082d,new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x49a024));}),_0x39f468['on'](_0x2ac1b8[_0x51b34f(0x1fb)],_0x2ce2d1=>{_0xb8082d(_0x2ce2d1);});});}export async function authenticate(_0x84a82a){const _0x41c0cd=_0x234b51,_0x39176d={'FTeka':function(_0x4ea1f7){return _0x4ea1f7();},'LJAjH':function(_0x5e58b4,_0x52cb90){return _0x5e58b4 instanceof _0x52cb90;},'nVCzk':function(_0x4e50f6,_0x3bd41f){return _0x4e50f6(_0x3bd41f);},'lWlvK':_0x41c0cd(0x1fe),'HBuqg':function(_0x4a75f0,_0x3e8e3f){return _0x4a75f0(_0x3e8e3f);},'hlQOj':'✓\x20Stored\x20credentials\x20locally','piAVY':'provided_token'};if(!_0x84a82a){const _0x29b983=await getToken();if(_0x29b983){const _0x2451ea=await getCurrentUser(_0x29b983);if(_0x2451ea[_0x41c0cd(0x221)])return console['log'](_0x41c0cd(0x1e3)+_0x2451ea[_0x41c0cd(0x22b)][_0x41c0cd(0x1f9)]),{'token':_0x29b983,'method':'existing_token'};}try{_0x84a82a=await _0x39176d['FTeka'](runDeviceAuthFlow);}catch(_0x54be8f){throw new Error('Authentication\x20failed:\x20'+(_0x39176d['LJAjH'](_0x54be8f,Error)?_0x54be8f[_0x41c0cd(0x1fd)]:_0x54be8f));}const _0x2b3973=await _0x39176d['nVCzk'](getCurrentUser,_0x84a82a);if(!_0x2b3973[_0x41c0cd(0x221)])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x2b3973['error']);return console['log'](_0x41c0cd(0x217)+_0x2b3973['user'][_0x41c0cd(0x1f9)]),{'token':_0x84a82a,'method':_0x39176d['lWlvK']};}console['log'](_0x41c0cd(0x1f4));const _0x5b24da=await _0x39176d['nVCzk'](getCurrentUser,_0x84a82a);if(!_0x5b24da[_0x41c0cd(0x221)]){if(_0x5b24da['status'])throw new Error('Authentication\x20failed:\x20'+_0x5b24da['error']+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x5b24da[_0x41c0cd(0x1ec)]+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console['log'](_0x41c0cd(0x217)+_0x5b24da['user']['organizationName']),await _0x39176d[_0x41c0cd(0x1f5)](storeToken,_0x84a82a),console[_0x41c0cd(0x211)](process['env'][_0x41c0cd(0x20f)]?_0x41c0cd(0x1e5):_0x39176d[_0x41c0cd(0x1ea)]),{'token':_0x84a82a,'method':_0x39176d['piAVY']};}export async function ensureRangerDir(_0x46c8e3){const _0x5052d9=_0x234b51,_0x87898e={'ZJCiq':function(_0xc1a86e){return _0xc1a86e();},'AQwSO':function(_0x31e627,_0x108703,_0x1a813c){return _0x31e627(_0x108703,_0x1a813c);},'DBxPq':_0x5052d9(0x208)};void _0x46c8e3;const _0x3cf183=_0x87898e[_0x5052d9(0x1ed)](getRangerHomeDir);return!existsSync(_0x3cf183)?(await _0x87898e['AQwSO'](mkdir,_0x3cf183,{'recursive':!![]}),console['log'](_0x87898e[_0x5052d9(0x228)]),{'path':_0x3cf183,'installed':!![]}):(console[_0x5052d9(0x211)]('✓\x20~/.ranger/\x20directory\x20already\x20exists'),{'path':_0x3cf183,'installed':![]});}export async function ensureChromium(_0x14dd92=![]){const _0x1a2935=_0x234b51,_0x5cfd15={'oyNnh':function(_0x4f324a,_0x2b09df){return _0x4f324a(_0x2b09df);},'LtdRb':_0x1a2935(0x231),'LfQdZ':function(_0x2efcf7){return _0x2efcf7();},'dBKyg':'confirm','cneyS':'install','knvnN':'\x0aInstalling\x20Chromium\x20browser...\x0a','IoLyC':'\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','QYyHa':function(_0x4b9ce1,_0x365b39){return _0x4b9ce1 instanceof _0x365b39;},'WCHab':'You\x20can\x20install\x20it\x20manually\x20by\x20running:','qtmmz':_0x1a2935(0x22d)};let _0x1a884f=![];try{const _0x29b940=chromium['executablePath']();_0x1a884f=_0x5cfd15[_0x1a2935(0x1fa)](existsSync,_0x29b940);}catch{_0x1a884f=![];}if(_0x1a884f)return console['log'](_0x5cfd15['LtdRb']),![];const _0x256186=_0x5cfd15['LfQdZ'](getPlaywrightVersion),_0x5cfe40=_0x256186??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x1b3462=!_0x256186,_0x152db2=process[_0x1a2935(0x235)][_0x1a2935(0x205)]&&process['stdout'][_0x1a2935(0x205)];let _0xed74aa=!![];if(_0x152db2){const {install:_0x4d56d3}=await _0x4f2615['prompt']([{'type':_0x5cfd15['dBKyg'],'name':_0x5cfd15[_0x1a2935(0x1e0)],'message':_0x1b3462?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x5cfe40+_0x1a2935(0x227):'The\x20required\x20version\x20('+_0x5cfe40+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0xed74aa=_0x4d56d3;}else console[_0x1a2935(0x211)]('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x5cfe40+(_0x1b3462?_0x1a2935(0x21b):'')+'...');if(_0xed74aa){console[_0x1a2935(0x211)](_0x5cfd15[_0x1a2935(0x20b)]);try{await installChromiumBinary(_0x5cfe40,_0x14dd92),console['log'](_0x5cfd15['IoLyC']);}catch(_0x4a03b8){console['error']('\x0a❌\x20Failed\x20to\x20install\x20Chromium:',_0x5cfd15['QYyHa'](_0x4a03b8,Error)?_0x4a03b8[_0x1a2935(0x1fd)]:_0x4a03b8),console[_0x1a2935(0x211)](_0x5cfd15['WCHab']),console['log']('\x20\x20npx\x20playwright@'+_0x5cfe40+'\x20install\x20chromium');}}else console[_0x1a2935(0x211)]('\x0a⚠\x20Skipping\x20Chromium\x20installation.'),console['log'](_0x5cfd15['qtmmz']),console[_0x1a2935(0x211)](_0x1a2935(0x1ff)+_0x5cfe40+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0xa52130){const _0x5eb7dd=_0x234b51,_0x4f7b92={'oJuVE':_0x5eb7dd(0x201)},_0x2ef441=join(_0xa52130,_0x4f7b92['oJuVE']),_0x5e2870=_0x5eb7dd(0x21a);await writeFile(_0x2ef441,_0x5e2870),console['log']('✓\x20Created\x20.ranger/.gitignore');}export async function ensureLocalEnv(_0x1fdb67,_0xe6f23d){const _0xbd271b=_0x234b51,_0x2dd426={'GbQMO':'user','CkBrr':function(_0x3f402b,_0x8573a2,_0x5d5c61){return _0x3f402b(_0x8573a2,_0x5d5c61);},'jiNGD':'local'};if(!findGitRoot()&&_0x1fdb67?.['scope']!=='user')return console['log'](_0xbd271b(0x22f)),{'ready':![],'skipped':!![]};const _0x5977bc=_0x1fdb67?.['scope']===_0x2dd426[_0xbd271b(0x20e)]?getRangerHomeDir():undefined;if(_0x2dd426[_0xbd271b(0x229)](findExistingEnv,_0x2dd426['jiNGD'],{'locations':[_0x2dd426['jiNGD']],'rangerDir':_0x5977bc}))return console[_0xbd271b(0x211)]('✓\x20Local\x20profile\x20already\x20exists'),{'ready':!![],'skipped':![]};try{return await addEnv(_0x2dd426['jiNGD'],{'url':_0x1fdb67?.['url'],'force':_0x1fdb67?.['force'],'allowInsecureLocalhost':_0x1fdb67?.['allowInsecureLocalhost'],'scope':_0x1fdb67?.['scope']},_0xe6f23d),{'ready':!![],'skipped':![]};}catch(_0x18f75c){return console[_0xbd271b(0x1ec)](_0xbd271b(0x239),_0x18f75c instanceof Error?_0x18f75c['message']:_0x18f75c),{'ready':![],'skipped':![]};}}export async function start(_0x8eecc3,_0x182f48,_0x1f9eb7){const _0x5834ef=_0x234b51,_0xb5f357={'dovjL':function(_0x76b0af,_0x305c9e){return _0x76b0af+_0x305c9e;},'hzkEV':_0x5834ef(0x22b),'POdhX':function(_0x892829,_0x412d70){return _0x892829(_0x412d70);},'dKivV':function(_0x2d41e1){return _0x2d41e1();},'pcrXr':function(_0x4d1881,_0x58d612){return _0x4d1881(_0x58d612);},'KqEEG':'✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','TGjzx':_0x5834ef(0x209),'qVTNM':function(_0x40fa8c,_0xb843a8){return _0x40fa8c(_0xb843a8);},'MWmtC':function(_0x2a02ec,_0xe4ac4c){return _0x2a02ec&&_0xe4ac4c;},'CeYFq':function(_0x134f18,_0x158dfe,_0x171b48){return _0x134f18(_0x158dfe,_0x171b48);},'pkRIQ':_0x5834ef(0x21e),'tDzlp':'skills','Novyj':_0x5834ef(0x220),'wGxzy':function(_0x5c4183,_0x145b7b,_0x29a70d){return _0x5c4183(_0x145b7b,_0x29a70d);},'Gcvpy':_0x5834ef(0x210),'PlQDF':'with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','wDmYi':'verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','tTDoS':function(_0x4d4520,_0x3efc8f){return _0x4d4520(_0x3efc8f);},'gRSyY':function(_0x2b11fe,_0x6a9f95){return _0x2b11fe+_0x6a9f95;}};console['log']('\x0a🚀\x20Ranger\x20Setup\x0a');_0x182f48?.[_0x5834ef(0x20c)]!==undefined&&_0x182f48[_0x5834ef(0x20c)]!=='user'&&(console[_0x5834ef(0x1ec)](_0xb5f357['dovjL']('ranger\x20setup\x20--scope='+String(_0x182f48[_0x5834ef(0x20c)])+_0x5834ef(0x1e7)+'Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.')),process['exit'](0x1));_0x182f48={..._0x182f48,'scope':_0xb5f357['hzkEV']};const _0x1f0af9=!_0xb5f357['POdhX'](existsSync,_0xb5f357['dKivV'](getRangerHomeDir));await _0xb5f357[_0x5834ef(0x219)](ensureRangerDir,'user');if(_0x182f48?.['skipAuth'])console[_0x5834ef(0x211)](_0x5834ef(0x215)),_0x1f9eb7?.['trackPhaseEnd']('auth',{'isFirstRun':_0x1f0af9,'method':_0x5834ef(0x1fc)});else{_0x1f9eb7?.['trackPhaseStart']('auth');const _0x5de542=await authenticate(_0x8eecc3);_0x1f9eb7?.['trackPhaseEnd'](_0x5834ef(0x237),{'isFirstRun':_0x1f0af9,'method':_0x5de542[_0x5834ef(0x21c)]});}_0x1f9eb7?.['trackPhaseStart']('chromium');_0x182f48?.[_0x5834ef(0x21f)]?console['log'](_0xb5f357['KqEEG']):await ensureChromium(_0x182f48?.['withDeps']);_0x1f9eb7?.[_0x5834ef(0x232)]('chromium',{'isFirstRun':_0x1f0af9,'skipped':!!_0x182f48?.[_0x5834ef(0x21f)]}),console[_0x5834ef(0x211)](_0x5834ef(0x1e8));const _0x332ba8=_0x182f48?.[_0x5834ef(0x20c)],_0x124dd4=_0x182f48?.['opencode']??![];let _0x34c055=null;_0x124dd4?(_0x1f9eb7?.['trackPhaseStart'](_0xb5f357['TGjzx']),_0x34c055=await _0xb5f357[_0x5834ef(0x22a)](ensureOpencodePluginConfig,_0x332ba8),_0x1f9eb7?.['trackPhaseEnd'](_0x5834ef(0x209),{'isFirstRun':_0x1f0af9,'opencode':!![]})):(_0x1f9eb7?.['trackPhaseStart']('plugin'),await ensureClaudePlugin(_0x332ba8),_0x1f9eb7?.['trackPhaseEnd']('plugin',{'isFirstRun':_0x1f0af9}));if(_0xb5f357[_0x5834ef(0x1e1)](_0x124dd4,_0x34c055)){_0x1f9eb7?.['trackPhaseStart'](_0x5834ef(0x226));try{await _0xb5f357['CeYFq'](installSkill,'ranger',{'level':_0x34c055[_0x5834ef(0x20c)],'cliVersion':_0xb5f357['dKivV'](getCurrentVersion),'platform':_0xb5f357['pkRIQ']}),_0x1f9eb7?.['trackPhaseEnd'](_0xb5f357['tDzlp'],{'isFirstRun':_0x1f0af9,'opencode':!![]});}catch(_0x3b4cb9){console[_0x5834ef(0x1f3)]('\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:',_0x3b4cb9 instanceof Error?_0x3b4cb9['message']:_0x3b4cb9),_0x1f9eb7?.['trackPhaseEnd']('skills',{'isFirstRun':_0x1f0af9,'opencode':!![],'failed':!![]});}}else _0x1f9eb7?.[_0x5834ef(0x1e6)]('skills'),await ensureClaudeSkills(_0x332ba8),_0x1f9eb7?.['trackPhaseEnd'](_0xb5f357['tDzlp'],{'isFirstRun':_0x1f0af9});if(_0x182f48?.[_0x5834ef(0x20d)])console['log'](_0x5834ef(0x238));else{if(_0x182f48?.['url']){_0x1f9eb7?.[_0x5834ef(0x1e6)](_0xb5f357['Novyj']);const _0xfd9745=await _0xb5f357[_0x5834ef(0x230)](ensureLocalEnv,{'url':_0x182f48[_0x5834ef(0x218)],'force':_0x182f48?.[_0x5834ef(0x236)],'allowInsecureLocalhost':_0x182f48?.[_0x5834ef(0x206)],'scope':'user'},_0x1f9eb7);_0x1f9eb7?.['trackPhaseEnd'](_0xb5f357['Novyj'],{'isFirstRun':_0x1f0af9,'profileReady':_0xfd9745['ready'],'userSkipped':_0xfd9745[_0x5834ef(0x1fc)]});}else console[_0x5834ef(0x211)]('\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:'+(_0x5834ef(0x22e)+bold(_0x5834ef(0x1df)))+'\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)'+_0x5834ef(0x223)+'\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles');}if(_0x124dd4)console['log'](_0x5834ef(0x1f8)),console[_0x5834ef(0x211)](_0xb5f357[_0x5834ef(0x225)]),console[_0x5834ef(0x211)](_0xb5f357['PlQDF']),console['log'](_0xb5f357[_0x5834ef(0x1f2)]);else{const _0x2acccb=_0xb5f357['tTDoS'](bold,_0x5834ef(0x20a));console['log'](_0xb5f357['gRSyY'](_0xb5f357[_0x5834ef(0x1e4)](_0x5834ef(0x202)+_0x2acccb+'\x20and\x20prompt\x20the\x20coding',_0x5834ef(0x216)),_0x5834ef(0x1eb))+_0x5834ef(0x1ef));}}
@@ -1 +1 @@
1
- const _0x54954e=_0x3c88;(function(_0x3053d3,_0x527049){const _0x4b4cea=_0x3c88,_0x4f14e2=_0x3053d3();while(!![]){try{const _0x3dad6a=parseInt(_0x4b4cea(0x14d))/0x1*(-parseInt(_0x4b4cea(0xfe))/0x2)+parseInt(_0x4b4cea(0xf2))/0x3*(parseInt(_0x4b4cea(0x111))/0x4)+-parseInt(_0x4b4cea(0xea))/0x5*(-parseInt(_0x4b4cea(0x145))/0x6)+-parseInt(_0x4b4cea(0x13a))/0x7*(parseInt(_0x4b4cea(0x123))/0x8)+parseInt(_0x4b4cea(0x143))/0x9+parseInt(_0x4b4cea(0x107))/0xa+-parseInt(_0x4b4cea(0x144))/0xb*(parseInt(_0x4b4cea(0x147))/0xc);if(_0x3dad6a===_0x527049)break;else _0x4f14e2['push'](_0x4f14e2['shift']());}catch(_0x34b089){_0x4f14e2['push'](_0x4f14e2['shift']());}}}(_0x3968,0xc8fc2));import{readFile,readdir}from'fs/promises';function _0x3c88(_0x29798d,_0x3738e4){_0x29798d=_0x29798d-0xe6;const _0x3968e2=_0x3968();let _0x3c88de=_0x3968e2[_0x29798d];return _0x3c88de;}import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{listCloudProfiles}from'./utils/cloudProfile.js';import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x5c773b=>'\x1b[1m'+_0x5c773b+_0x54954e(0x135),link=(_0x29e6a1,_0x33d27c)=>_0x54954e(0x148)+_0x29e6a1+'\x07'+(_0x33d27c||_0x29e6a1)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x317634=_0x54954e,_0x33c722={'KVRnf':_0x317634(0xe8),'wAljD':_0x317634(0xfc),'Yddqr':_0x317634(0x149),'plEDN':'not_configured','fLplX':_0x317634(0x10c),'ALwOb':_0x317634(0x11a),'MiuYD':_0x317634(0x130),'UbdMC':_0x317634(0x137)};return new Promise(_0x177bc7=>{const _0x2400d2=_0x317634,_0x3d8336={'MwESw':_0x33c722[_0x2400d2(0x115)],'wVfqC':_0x33c722[_0x2400d2(0x110)],'cSeDW':_0x33c722[_0x2400d2(0x113)],'MGOSa':function(_0x34ee40,_0x2d4a66){return _0x34ee40(_0x2d4a66);},'HTrWB':_0x33c722['plEDN']},_0x4718c4=spawn('opencode',[_0x33c722['fLplX'],_0x33c722[_0x2400d2(0x14e)]],{'stdio':[_0x33c722['MiuYD'],'pipe','pipe']});let _0x4ffaf5='';_0x4718c4[_0x2400d2(0x11b)]?.['on']('data',_0x403523=>{const _0x5b0027=_0x2400d2;_0x4ffaf5+=_0x403523[_0x5b0027(0xf1)]();}),_0x4718c4['stderr']?.['on'](_0x33c722[_0x2400d2(0x119)],_0x10b89f=>{_0x4ffaf5+=_0x10b89f['toString']();}),_0x4718c4['on'](_0x2400d2(0x109),()=>{_0x177bc7({'status':'not_installed'});}),_0x4718c4['on'](_0x2400d2(0x128),_0x38d9ac=>{const _0x50ac10=_0x2400d2;if(_0x38d9ac!==0x0){_0x177bc7({'status':_0x50ac10(0x14f)});return;}const _0x26387f=_0x4ffaf5['trim']();let _0x1d17fd=null;if(_0x26387f)try{_0x1d17fd=JSON['parse'](_0x26387f);}catch{const _0x3384df=_0x26387f['match'](/\{[\s\S]*\}$/);if(_0x3384df)try{_0x1d17fd=JSON['parse'](_0x3384df[0x0]);}catch{_0x1d17fd=null;}}const _0x1a34ab=Array['isArray'](_0x1d17fd?.['plugin'])?_0x1d17fd?.[_0x50ac10(0xf6)]:[],_0x75775c=_0x1a34ab['some'](_0x406810=>{const _0x295c5b=_0x50ac10;if(typeof _0x406810!==_0x3d8336['MwESw'])return![];return _0x406810['includes'](_0x295c5b(0x14b))||_0x406810[_0x295c5b(0x105)](_0x3d8336[_0x295c5b(0x14a)]);});if(_0x75775c){_0x177bc7({'status':_0x3d8336['cSeDW'],'details':_0x1a34ab[_0x50ac10(0xf8)]>0x0?_0x1a34ab['length']+'\x20plugin(s)\x20configured':undefined});return;}if(_0x1a34ab['length']>0x0){_0x3d8336[_0x50ac10(0xf0)](_0x177bc7,{'status':_0x3d8336['HTrWB'],'details':_0x1a34ab['length']+'\x20plugin(s)\x20configured'});return;}_0x3d8336[_0x50ac10(0xf0)](_0x177bc7,{'status':_0x50ac10(0x11e)});});});}async function getSkillsFromDir(_0x4a1428,_0x1ff255){const _0x4b848c=_0x54954e,_0x4a9667={'nzGvf':function(_0x446dc6,_0x9423a6){return _0x446dc6(_0x9423a6);},'OtxBg':function(_0x4fcb3f,_0x23f049,_0x54c405){return _0x4fcb3f(_0x23f049,_0x54c405);},'pKByD':'SKILL.md','CLnKv':function(_0x55efe6,_0x54da81){return _0x55efe6(_0x54da81);},'udWZs':function(_0x308637,_0x179c59,_0xd09979){return _0x308637(_0x179c59,_0xd09979);}};if(!_0x4a9667[_0x4b848c(0x131)](existsSync,_0x4a1428))return[];const _0x5373d3=[];try{const _0x354ee2=await _0x4a9667[_0x4b848c(0xee)](readdir,_0x4a1428,{'withFileTypes':!![]});for(const _0x2cfeb1 of _0x354ee2){if(_0x2cfeb1[_0x4b848c(0x146)]()){const _0x5f29ad=join(_0x4a1428,_0x2cfeb1[_0x4b848c(0x150)],_0x4a9667['pKByD']);if(_0x4a9667['CLnKv'](existsSync,_0x5f29ad)){let _0x11351d=_0x2cfeb1['name'];try{const _0x253b14=await _0x4a9667[_0x4b848c(0x104)](readFile,_0x5f29ad,_0x4b848c(0x11f)),_0x50cc8a=_0x253b14['match'](/name:\s*(.+)/);_0x50cc8a&&(_0x11351d=_0x50cc8a[0x1]['trim']());}catch{}_0x5373d3[_0x4b848c(0x14c)]({'name':_0x2cfeb1[_0x4b848c(0x150)],'displayName':_0x11351d,'path':_0x5f29ad,'level':_0x1ff255});}}}}catch{return[];}return _0x5373d3;}function _0x3968(){const _0x2641fa=['project','bTqBh','\x0a---\x20Profiles\x20---','\x20\x20\x20\x20Session:\x20','DEBUG','string','VSzFL','615SGMBIE','settingsPath','version','No\x20profiles\x20configured','OtxBg','\x0a---\x20Claude\x20Code\x20Plugin\x20---','MGOSa','toString','9IvaWri','YoAbc','rlUKs','scope','plugin','GIMSD','length','ranger@trailhead','UAGhE','path','opencode-plugin','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','14426jDbZbQ','disabled','all','map','Xsfmt','cwd','udWZs','includes','PWqdF','14702160UgEQTI','organizationName','error','\x0a---\x20OpenCode\x20Plugin\x20---','unknown','debug','\x20\x20\x20\x20','\x20\x20Run:\x20ranger\x20update','\x0a\x20\x20No\x20active\x20profile\x20set','wAljD','1734556QucfWz','hasEncryptedAuth','Yddqr','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','KVRnf','TClPI','\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>','no\x20session','UbdMC','config','stdout','has','\x0a📊\x20Ranger\x20Status\x0a','not_configured','utf-8','\x20(up\x20to\x20date)','KdKdi','Root:\x20','1208edwPIJ','\x20\x20Not\x20installed','\x20\x20\x20\x20Auth:\x20','uqyWQ','success','close','join','isActive','\x20\x20Run:\x20ranger\x20setup\x20--opencode','\x20\x20Project-level:','\x20local','\x20\x20Run:\x20ranger\x20skillup','filter','ignore','nzGvf','enabled','Organization:\x20','details','\x1b[0m','env','data',':\x20installed\x20(','log','5348grwCdt','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','cached\x20(updated\x20','displayName','hasPlaintextAuth','Version:\x20','lKRNJ','QUfWc','\x20\x20\x20\x20Settings:\x20','3658284lcilpt','29330312PSOLur','63774VfLIGy','isDirectory','12BamHwL','\x1b]8;;file://','configured','wVfqC','@ranger-testing/opencode-plugin','push','122kvtOFA','ALwOb','not_installed','name'];_0x3968=function(){return _0x2641fa;};return _0x3968();}async function getInstalledSkills(){const _0x2a73f=_0x54954e,_0x2febdb={'UWoxR':function(_0x215afd,_0x1e35b7,_0x1bc5cc){return _0x215afd(_0x1e35b7,_0x1bc5cc);},'pGrgQ':function(_0x119106){return _0x119106();}},[_0x388bc7,_0x32abe0]=await Promise[_0x2a73f(0x100)]([_0x2febdb['UWoxR'](getSkillsFromDir,_0x2febdb['pGrgQ'](getProjectSkillsDir),_0x2a73f(0x151)),_0x2febdb['UWoxR'](getSkillsFromDir,getUserSkillsDir(),'user')]);return{'project':_0x388bc7,'user':_0x32abe0};}async function getEnvironments(){const _0xc775d5={'Xsfmt':'settings.json','ZvgMF':function(_0x52802b,_0x2dd05e){return _0x52802b(_0x2dd05e);},'ZbDhG':'(not\x20found)'},{envNames:_0x2aadde,activeEnv:_0x2806fb}=await getEnvNames(),_0x4fece1=getRangerDir();if(!existsSync(_0x4fece1))return{'envs':[],'activeEnv':null};const _0x3bb61b=_0x2aadde['map'](_0x1ddcf0=>{const _0x48e338=_0x3c88,_0x18e008=getEnvDir(_0x1ddcf0),_0x3be000=join(_0x18e008,_0xc775d5[_0x48e338(0x102)]),_0x456765=join(_0x18e008,'auth.json'),_0xb72b4=join(_0x18e008,'auth.json.enc');return{'name':_0x1ddcf0,'settingsPath':_0xc775d5['ZvgMF'](existsSync,_0x3be000)?_0x3be000:_0xc775d5['ZbDhG'],'hasPlaintextAuth':existsSync(_0x456765),'hasEncryptedAuth':_0xc775d5['ZvgMF'](existsSync,_0xb72b4),'isActive':_0x1ddcf0===_0x2806fb};});return{'envs':_0x3bb61b,'activeEnv':_0x2806fb};}export async function status(){const _0xd2682f=_0x54954e,_0x31655b={'bTqBh':function(_0x32e7f3,_0x8e5526){return _0x32e7f3(_0x8e5526);},'VSzFL':function(_0xa6e807,_0x36baa9){return _0xa6e807(_0x36baa9);},'gwSoZ':function(_0x577ae2,_0x3ba73e){return _0x577ae2(_0x3ba73e);},'rwpEk':function(_0x3988ce,_0x1793f9){return _0x3988ce(_0x1793f9);},'oJBlY':function(_0x46d14c){return _0x46d14c();},'lKRNJ':function(_0x1942fd){return _0x1942fd();},'CsceK':function(_0x3b5fd5,_0x29e98e){return _0x3b5fd5(_0x29e98e);},'CxOEh':function(_0x1e34c1){return _0x1e34c1();},'hCYYH':function(_0x4fc09b){return _0x4fc09b();},'GIMSD':_0xd2682f(0x10a),'QWSnU':function(_0x16dcc2){return _0x16dcc2();},'CWBqJ':function(_0x4131d1,_0xaeed42){return _0x4131d1===_0xaeed42;},'mansY':_0xd2682f(0x149),'UAGhE':'@ranger-testing/opencode-plugin','KdKdi':function(_0x1e401f,_0x499899){return _0x1e401f===_0x499899;},'rlUKs':'\x20\x20Not\x20configured','JOyjz':_0xd2682f(0x12b),'QUfWc':'\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','uqyWQ':_0xd2682f(0xef),'YxxwV':_0xd2682f(0x10b),'tGHZP':_0xd2682f(0x124),'Sazrl':'\x0a---\x20Skills\x20---','gciEy':function(_0x16c5c8,_0x276414){return _0x16c5c8+_0x276414;},'PWqdF':function(_0x2e1ac9,_0x4c0b24,_0x2fbdd2){return _0x2e1ac9(_0x4c0b24,_0x2fbdd2);},'qoaeg':function(_0x3d95cd,_0x3b2c04){return _0x3d95cd>_0x3b2c04;},'YoAbc':_0xd2682f(0x153),'yqlfC':function(_0x4fef68){return _0x4fef68();},'rZXRg':function(_0x1e30c4,_0x436d85){return _0x1e30c4+_0x436d85;},'RtAAn':function(_0x474727,_0x3cd2eb){return _0x474727>_0x3cd2eb;},'IAtaM':function(_0x2b70f5,_0x351d4a){return _0x2b70f5>_0x351d4a;},'TClPI':'\x20(active)','fgfZI':'(not\x20found)'};console['log'](_0xd2682f(0x11d));const _0x45fea1=process[_0xd2682f(0x103)](),_0x1abbe4=getRangerDir();if(!_0x31655b[_0xd2682f(0x152)](existsSync,_0x1abbe4)){console['log']('Root:\x20'+link(_0x45fea1,_0x31655b[_0xd2682f(0xe9)](bold,_0x31655b['gwSoZ'](basename,_0x45fea1)))),console['log'](_0xd2682f(0x13b)),console[_0xd2682f(0x139)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console[_0xd2682f(0x139)](_0xd2682f(0x122)+link(_0x45fea1,_0x31655b['gwSoZ'](bold,_0x31655b['rwpEk'](basename,_0x45fea1))));const _0x84951d=getCurrentVersion(),_0x23db44=_0x31655b['oJBlY'](getLatestVersion);if(_0x23db44['version']&&_0x23db44[_0xd2682f(0xec)]!==_0x84951d)console[_0xd2682f(0x139)](_0xd2682f(0x13f)+_0x84951d+'\x20(latest:\x20'+_0x23db44[_0xd2682f(0xec)]+')'),console['log'](_0xd2682f(0x10e));else _0x23db44[_0xd2682f(0xec)]?console[_0xd2682f(0x139)]('Version:\x20'+_0x84951d+_0xd2682f(0x120)):console[_0xd2682f(0x139)](_0xd2682f(0x13f)+_0x84951d);const _0x480c38=await _0x31655b[_0xd2682f(0x140)](getToken);if(_0x480c38){const _0x350dcd=await _0x31655b['CsceK'](getCurrentUser,_0x480c38);_0x350dcd[_0xd2682f(0x127)]?console[_0xd2682f(0x139)](_0xd2682f(0x133)+bold(_0x350dcd['user'][_0xd2682f(0x108)])):(console['log']('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console[_0xd2682f(0x139)]('API\x20Token:\x20✗\x20Not\x20found'),console[_0xd2682f(0x139)]('\x20\x20Run:\x20ranger\x20setup\x20[token]');process[_0xd2682f(0x136)][_0xd2682f(0xe7)]&&(console[_0xd2682f(0x139)]('API\x20Environment:\x20'+_0x31655b['CxOEh'](getCurrentEnvironment)),console['log']('API\x20URL:\x20'+_0x31655b['hCYYH'](getApiBaseUrl)));console[_0xd2682f(0x139)](_0x31655b[_0xd2682f(0xf7)]);const _0xe6148=await _0x31655b['QWSnU'](getOpencodePluginStatus);if(_0x31655b['CWBqJ'](_0xe6148['status'],_0x31655b['mansY']))console['log']('\x20\x20'+bold(_0x31655b[_0xd2682f(0xfa)])+':\x20configured'),_0xe6148[_0xd2682f(0x134)]&&console['log']('\x20\x20'+_0xe6148['details']);else _0x31655b[_0xd2682f(0x121)](_0xe6148['status'],'not_configured')?(console[_0xd2682f(0x139)](_0x31655b[_0xd2682f(0xf4)]),_0xe6148[_0xd2682f(0x134)]&&console[_0xd2682f(0x139)]('\x20\x20'+_0xe6148['details']),console['log'](_0x31655b['JOyjz'])):console[_0xd2682f(0x139)](_0x31655b[_0xd2682f(0x141)]);console['log'](_0x31655b[_0xd2682f(0x126)]);const _0x300893=await getPluginInfo(_0xd2682f(0xf9));if(_0x300893){const _0xf8cdc8=_0x300893[_0xd2682f(0xf5)]||_0x31655b['YxxwV'],_0x120ddc=_0x300893[_0xd2682f(0x132)]?_0xd2682f(0x132):_0xd2682f(0xff);console['log']('\x20\x20'+bold(_0xd2682f(0xf9))+_0xd2682f(0x138)+_0xf8cdc8+',\x20'+_0x120ddc+')');}else console['log'](_0x31655b['tGHZP']),console[_0xd2682f(0x139)](_0xd2682f(0x114));console[_0xd2682f(0x139)](_0x31655b['Sazrl']);const {project:_0xb10494,user:_0x229cd8}=await getInstalledSkills(),_0x9cb307=_0xb10494[_0xd2682f(0x12f)](_0x18bcbb=>RANGER_MANAGED_SKILLS[_0xd2682f(0x105)](_0x18bcbb[_0xd2682f(0x150)])),_0x1785de=_0x229cd8[_0xd2682f(0x12f)](_0x50cb7f=>RANGER_MANAGED_SKILLS[_0xd2682f(0x105)](_0x50cb7f[_0xd2682f(0x150)])),_0x1428eb=_0x31655b['gciEy'](_0x9cb307[_0xd2682f(0xf8)],_0x1785de[_0xd2682f(0xf8)]);if(_0x31655b['KdKdi'](_0x1428eb,0x0))console['log']('No\x20skills\x20installed'),console['log'](_0xd2682f(0x12e));else{if(_0x9cb307[_0xd2682f(0xf8)]>0x0){console['log'](_0xd2682f(0x12c));for(const _0x1efea3 of _0x9cb307){console['log'](_0xd2682f(0x10d)+bold(_0x1efea3['displayName'])+':\x20'+_0x31655b[_0xd2682f(0x106)](link,_0x1efea3[_0xd2682f(0xfb)],basename(_0x1efea3[_0xd2682f(0xfb)])));}}if(_0x31655b['qoaeg'](_0x1785de[_0xd2682f(0xf8)],0x0)){console[_0xd2682f(0x139)]('\x20\x20User-level:');for(const _0x422ac5 of _0x1785de){console[_0xd2682f(0x139)]('\x20\x20\x20\x20'+_0x31655b['VSzFL'](bold,_0x422ac5[_0xd2682f(0x13d)])+':\x20'+link(_0x422ac5['path'],basename(_0x422ac5['path'])));}}}console['log'](_0x31655b[_0xd2682f(0xf3)]);const {envs:_0x4d3a2c,activeEnv:_0x1ede43}=await _0x31655b['CxOEh'](getEnvironments);let _0x235c65=[];if(_0x480c38)try{_0x235c65=await _0x31655b['yqlfC'](listCloudProfiles);}catch{}const _0x2dabee=_0x31655b['rZXRg'](_0x4d3a2c[_0xd2682f(0xf8)],_0x235c65[_0xd2682f(0xf8)]);if(_0x31655b['KdKdi'](_0x2dabee,0x0))console[_0xd2682f(0x139)](_0xd2682f(0xed)),console[_0xd2682f(0x139)](_0xd2682f(0x117));else{if(_0x31655b['RtAAn'](_0x2dabee,0x5)){const _0xb77f09=[];_0x235c65['length']>0x0&&_0xb77f09['push'](_0x235c65['length']+'\x20cloud'),_0x31655b['IAtaM'](_0x4d3a2c['length'],0x0)&&_0xb77f09[_0xd2682f(0x14c)](_0x4d3a2c['length']+_0xd2682f(0x12d)),console[_0xd2682f(0x139)](_0x2dabee+'\x20profiles\x20configured\x20('+_0xb77f09[_0xd2682f(0x129)](',\x20')+')'),_0x1ede43&&console['log']('\x20\x20Active:\x20'+bold(_0x1ede43)),console['log']('\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)');}else{for(const _0x227afc of _0x235c65){const _0x60e761=_0x227afc['name']===_0x1ede43?'\x20(active)':'';console[_0xd2682f(0x139)]('\x20\x20'+bold(_0x227afc[_0xd2682f(0x150)])+'\x20[cloud]'+_0x60e761);const _0x5b6b06=_0x227afc['sessionUpdatedAt']?_0xd2682f(0x13c)+_0x227afc['sessionUpdatedAt']+')':_0xd2682f(0x118);console['log'](_0xd2682f(0xe6)+_0x5b6b06);}const _0x7e9a43=new Set(_0x235c65[_0xd2682f(0x101)](_0x44f5dc=>_0x44f5dc[_0xd2682f(0x150)]));for(const _0x25b987 of _0x4d3a2c){if(_0x7e9a43[_0xd2682f(0x11c)](_0x25b987['name']))continue;const _0x48842d=_0x25b987[_0xd2682f(0x12a)]?_0x31655b[_0xd2682f(0x116)]:'',_0x45666d=_0x25b987[_0xd2682f(0x112)]?'encrypted':_0x25b987[_0xd2682f(0x13e)]?'plaintext':'none';console['log']('\x20\x20'+_0x31655b['rwpEk'](bold,_0x25b987[_0xd2682f(0x150)])+'\x20[local]'+_0x48842d),console[_0xd2682f(0x139)](_0xd2682f(0x125)+_0x45666d),_0x25b987[_0xd2682f(0xeb)]!==_0x31655b['fgfZI']&&console['log'](_0xd2682f(0x142)+_0x31655b[_0xd2682f(0x106)](link,_0x25b987['settingsPath'],basename(_0x25b987[_0xd2682f(0xeb)])));}if(!_0x1ede43){console['log'](_0xd2682f(0x10f));const _0x36a968=[..._0x235c65['map'](_0x5c063b=>_0x5c063b[_0xd2682f(0x150)]),..._0x4d3a2c[_0xd2682f(0x12f)](_0xb7e5b6=>!_0x7e9a43[_0xd2682f(0x11c)](_0xb7e5b6['name']))['map'](_0x243a7e=>_0x243a7e[_0xd2682f(0x150)])];console['log'](_0xd2682f(0xfd)+_0x36a968['join'](',\x20')+')');}}}console[_0xd2682f(0x139)]('');}
1
+ const _0x71e86f=_0x410b;(function(_0xdaee1c,_0x5a797c){const _0xf94a79=_0x410b,_0x4e07ef=_0xdaee1c();while(!![]){try{const _0x2d71f2=parseInt(_0xf94a79(0x116))/0x1+-parseInt(_0xf94a79(0x132))/0x2+-parseInt(_0xf94a79(0x11a))/0x3*(-parseInt(_0xf94a79(0x148))/0x4)+parseInt(_0xf94a79(0x14c))/0x5+parseInt(_0xf94a79(0x145))/0x6+parseInt(_0xf94a79(0x109))/0x7+-parseInt(_0xf94a79(0x10c))/0x8*(parseInt(_0xf94a79(0x13c))/0x9);if(_0x2d71f2===_0x5a797c)break;else _0x4e07ef['push'](_0x4e07ef['shift']());}catch(_0x3d08b2){_0x4e07ef['push'](_0x4e07ef['shift']());}}}(_0x269c,0xed64d));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';function _0x269c(){const _0x314d00=['Root:\x20','log','AVuxv','project','GIfOS','\x20(up\x20to\x20date)','displayName','623485ykCYGZ','dLKwT','parse','MQfTT','3ZpLCKM','MqMmt','status','sessionUpdatedAt','\x20\x20User-level:','FAmLw','\x1b]8;;file://','enabled','user','hasPlaintextAuth','opencode-plugin','string','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','MtLfn','\x20(active)','scope','FhyXW','name','ranger@trailhead','UXXPs','OYMrB','\x20[local]','IzopY','dzAFA','3301430OKGOZZ','DEBUG','WkKCY','includes','SKILL.md','YKSwG','match','none','keGsD','pdvRU','797913uWKAtd','length','OHjzA','hasEncryptedAuth','some','\x20\x20Active:\x20','join','map','API\x20Token:\x20✗\x20Not\x20found','9320802kxkNOs','JGkFh','not_installed','3308296YWaCyI','DYWFV','BbAQU','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','7891585ZzSWYk','nnCXY','Version:\x20','CnnQs','(not\x20found)','unknown','\x1b]8;;\x07','\x20(latest:\x20','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','AJOgR','\x20local','ZerFM','version','\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>','has','not_configured','No\x20skills\x20installed','\x20\x20Run:\x20ranger\x20skillup','path','details','settingsPath','plugin','\x20\x20Run:\x20ranger\x20setup\x20[token]','push','tPGiV','BeEOm','error','pipe','utf-8','Ufxsa','auth.json.enc','DJRlD','13591515ZrgiOb','\x0a\x20\x20No\x20active\x20profile\x20set','config','352pGtOuI','Rfawz','isActive'];_0x269c=function(){return _0x314d00;};return _0x269c();}import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';function _0x410b(_0x5e5031,_0x5adc48){_0x5e5031=_0x5e5031-0xf2;const _0x269cfc=_0x269c();let _0x410b4f=_0x269cfc[_0x5e5031];return _0x410b4f;}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=_0x54bb50=>'\x1b[1m'+_0x54bb50+'\x1b[0m',link=(_0x294851,_0x3bf893)=>_0x71e86f(0x120)+_0x294851+'\x07'+(_0x3bf893||_0x294851)+_0x71e86f(0x152);async function getOpencodePluginStatus(){const _0x190186=_0x71e86f,_0x5314b0={'MqMmt':_0x190186(0x147),'uPKoi':_0x190186(0x124),'FhyXW':function(_0x12d24a,_0x5a82b3,_0x12d5ed,_0xed4638){return _0x12d24a(_0x5a82b3,_0x12d5ed,_0xed4638);},'OkFqI':'ignore','MQfTT':'pipe','MtLfn':'data','ksJwm':'close'};return new Promise(_0x19ed5e=>{const _0x585c5e=_0x190186,_0x287d86={'nnCXY':_0x585c5e(0x125),'WkKCY':_0x5314b0['uPKoi'],'keGsD':function(_0xe4d24,_0x59e361){return _0xe4d24!==_0x59e361;},'QaMWj':function(_0x4baeac,_0x16b529){return _0x4baeac(_0x16b529);},'FHGdE':function(_0x33c823,_0x530f8c){return _0x33c823>_0x530f8c;},'CnnQs':'not_configured'},_0x21adde=_0x5314b0[_0x585c5e(0x12a)](spawn,'opencode',['debug',_0x585c5e(0x10b)],{'stdio':[_0x5314b0['OkFqI'],_0x5314b0[_0x585c5e(0x119)],_0x585c5e(0x104)]});let _0x3c889c='';_0x21adde['stdout']?.['on']('data',_0x194f9b=>{_0x3c889c+=_0x194f9b['toString']();}),_0x21adde['stderr']?.['on'](_0x5314b0[_0x585c5e(0x127)],_0x37c2a3=>{_0x3c889c+=_0x37c2a3['toString']();}),_0x21adde['on'](_0x585c5e(0x103),()=>{const _0x4decdd=_0x585c5e;_0x19ed5e({'status':_0x5314b0[_0x4decdd(0x11b)]});}),_0x21adde['on'](_0x5314b0['ksJwm'],_0x20e45d=>{const _0x4638c6=_0x585c5e;if(_0x287d86[_0x4638c6(0x13a)](_0x20e45d,0x0)){_0x287d86['QaMWj'](_0x19ed5e,{'status':_0x4638c6(0x147)});return;}const _0x40aa63=_0x3c889c['trim']();let _0x336e3d=null;if(_0x40aa63)try{_0x336e3d=JSON[_0x4638c6(0x118)](_0x40aa63);}catch{const _0xbb9eb7=_0x40aa63[_0x4638c6(0x138)](/\{[\s\S]*\}$/);if(_0xbb9eb7)try{_0x336e3d=JSON[_0x4638c6(0x118)](_0xbb9eb7[0x0]);}catch{_0x336e3d=null;}}const _0x5831d7=Array['isArray'](_0x336e3d?.[_0x4638c6(0xfe)])?_0x336e3d?.['plugin']:[],_0x3226f8=_0x5831d7[_0x4638c6(0x140)](_0x2fe68c=>{const _0x4915af=_0x4638c6;if(typeof _0x2fe68c!==_0x287d86[_0x4915af(0x14d)])return![];return _0x2fe68c['includes']('@ranger-testing/opencode-plugin')||_0x2fe68c[_0x4915af(0x135)](_0x287d86[_0x4915af(0x134)]);});if(_0x3226f8){_0x19ed5e({'status':'configured','details':_0x5831d7[_0x4638c6(0x13d)]>0x0?_0x5831d7['length']+'\x20plugin(s)\x20configured':undefined});return;}if(_0x287d86['FHGdE'](_0x5831d7['length'],0x0)){_0x19ed5e({'status':_0x287d86[_0x4638c6(0x14f)],'details':_0x5831d7['length']+'\x20plugin(s)\x20configured'});return;}_0x19ed5e({'status':_0x287d86['CnnQs']});});});}async function getSkillsFromDir(_0x41f85e,_0xf3ff55){const _0x4eed11=_0x71e86f,_0x324649={'nWIbe':function(_0xb6cac2,_0x4d3618){return _0xb6cac2(_0x4d3618);},'kERMD':function(_0x5aa514,_0x1fc201,_0x4e5242){return _0x5aa514(_0x1fc201,_0x4e5242);}};if(!_0x324649['nWIbe'](existsSync,_0x41f85e))return[];const _0x3c30da=[];try{const _0x5204ac=await readdir(_0x41f85e,{'withFileTypes':!![]});for(const _0x5744f6 of _0x5204ac){if(_0x5744f6['isDirectory']()){const _0x513537=join(_0x41f85e,_0x5744f6[_0x4eed11(0x12b)],_0x4eed11(0x136));if(existsSync(_0x513537)){let _0x3d4cd6=_0x5744f6[_0x4eed11(0x12b)];try{const _0x29d5af=await _0x324649['kERMD'](readFile,_0x513537,_0x4eed11(0x105)),_0x25803b=_0x29d5af[_0x4eed11(0x138)](/name:\s*(.+)/);_0x25803b&&(_0x3d4cd6=_0x25803b[0x1]['trim']());}catch{}_0x3c30da['push']({'name':_0x5744f6[_0x4eed11(0x12b)],'displayName':_0x3d4cd6,'path':_0x513537,'level':_0xf3ff55});}}}}catch{return[];}return _0x3c30da;}async function getInstalledSkills(){const _0x239ab4=_0x71e86f,_0x35b029={'OHjzA':function(_0xc4673f){return _0xc4673f();}},[_0x583d54,_0x58e076]=await Promise['all']([getSkillsFromDir(getProjectSkillsDir(),_0x239ab4(0x112)),getSkillsFromDir(_0x35b029[_0x239ab4(0x13e)](getUserSkillsDir),'user')]);return{'project':_0x583d54,'user':_0x58e076};}async function getEnvironments(){const _0x36ed9f=_0x71e86f,_0x43e50d={'BeEOm':function(_0x2817e0,_0x2d4d0d){return _0x2817e0(_0x2d4d0d);},'ppgXK':function(_0x5eb630,_0x50e507,_0x3202c4){return _0x5eb630(_0x50e507,_0x3202c4);},'DJRlD':function(_0x21181f,_0x5dbedb,_0x1d0d46){return _0x21181f(_0x5dbedb,_0x1d0d46);},'YKSwG':'auth.json','OYMrB':function(_0x24b5b4,_0x55cd37){return _0x24b5b4(_0x55cd37);},'TpfvS':function(_0xa324bc){return _0xa324bc();},'GJHJp':function(_0x4c15f0){return _0x4c15f0();}},{envNames:_0x500974,activeEnv:_0x43610f}=await _0x43e50d['TpfvS'](getEnvNames),_0xce70bf=_0x43e50d['GJHJp'](getRangerDir);if(!_0x43e50d[_0x36ed9f(0x12e)](existsSync,_0xce70bf))return{'envs':[],'activeEnv':null};const _0x4883f4=_0x500974[_0x36ed9f(0x143)](_0x5daee3=>{const _0x131a61=_0x36ed9f,_0x357bfe=_0x43e50d[_0x131a61(0x102)](getEnvDir,_0x5daee3),_0x4a24bb=_0x43e50d['ppgXK'](join,_0x357bfe,'settings.json'),_0x25059d=_0x43e50d[_0x131a61(0x108)](join,_0x357bfe,_0x43e50d[_0x131a61(0x137)]),_0x47890e=_0x43e50d['ppgXK'](join,_0x357bfe,_0x131a61(0x107));return{'name':_0x5daee3,'settingsPath':_0x43e50d['OYMrB'](existsSync,_0x4a24bb)?_0x4a24bb:'(not\x20found)','hasPlaintextAuth':existsSync(_0x25059d),'hasEncryptedAuth':existsSync(_0x47890e),'isActive':_0x5daee3===_0x43610f};});return{'envs':_0x4883f4,'activeEnv':_0x43610f};}export async function status(){const _0x34cfd5=_0x71e86f,_0x255519={'AVuxv':function(_0x4e7040){return _0x4e7040();},'Ufxsa':function(_0x1a2ffd,_0x4d90f9){return _0x1a2ffd(_0x4d90f9);},'dLKwT':function(_0x3a81ca,_0x29fb3a){return _0x3a81ca(_0x29fb3a);},'FAmLw':function(_0x6793f,_0x100368){return _0x6793f!==_0x100368;},'KrPLk':function(_0x4906eb,_0xa191cc){return _0x4906eb(_0xa191cc);},'ovTLg':'\x0a---\x20OpenCode\x20Plugin\x20---','Rfawz':function(_0x1e8ab7,_0x50fa84){return _0x1e8ab7===_0x50fa84;},'pdvRU':'configured','IzopY':_0x34cfd5(0xf8),'goxmL':'\x20\x20Not\x20configured','aCJRi':'\x20\x20Run:\x20ranger\x20setup\x20--opencode','DYWFV':'\x0a---\x20Claude\x20Code\x20Plugin\x20---','bJjCy':_0x34cfd5(0x12c),'YbWDy':_0x34cfd5(0x121),'wbgma':'\x20\x20Not\x20installed','BbAQU':function(_0x420792,_0x9b9108){return _0x420792+_0x9b9108;},'GIfOS':function(_0x17076f,_0xfff1a6){return _0x17076f===_0xfff1a6;},'dfpun':'\x20\x20Project-level:','ZerFM':function(_0x26c28e,_0x68bfcc,_0x34634f){return _0x26c28e(_0x68bfcc,_0x34634f);},'tPGiV':function(_0x503cef,_0x2cfb3b){return _0x503cef>_0x2cfb3b;},'AJOgR':_0x34cfd5(0x11e),'vwGLh':function(_0x3d2b14,_0x1bd7f0){return _0x3d2b14(_0x1bd7f0);},'VTqNB':function(_0x5d92d0,_0x1de688,_0x44508f){return _0x5d92d0(_0x1de688,_0x44508f);},'dzAFA':function(_0xcfd5c2,_0x1e7293){return _0xcfd5c2(_0x1e7293);},'YVnLI':function(_0x23161c,_0x58858c){return _0x23161c(_0x58858c);},'JGkFh':_0x34cfd5(0x128),'UXXPs':function(_0x37349c,_0x5ac70a){return _0x37349c(_0x5ac70a);}};console[_0x34cfd5(0x110)]('\x0a📊\x20Ranger\x20Status\x0a');const _0x138983=process['cwd'](),_0x411614=_0x255519['AVuxv'](getRangerDir);if(!_0x255519['Ufxsa'](existsSync,_0x411614)){console['log'](_0x34cfd5(0x10f)+link(_0x138983,_0x255519[_0x34cfd5(0x117)](bold,basename(_0x138983)))),console[_0x34cfd5(0x110)](_0x34cfd5(0x154)),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console[_0x34cfd5(0x110)]('Root:\x20'+link(_0x138983,bold(_0x255519[_0x34cfd5(0x106)](basename,_0x138983))));const _0xd7fe40=getCurrentVersion(),_0x5e48ad=_0x255519[_0x34cfd5(0x111)](getLatestVersion);if(_0x5e48ad['version']&&_0x255519['FAmLw'](_0x5e48ad['version'],_0xd7fe40))console['log'](_0x34cfd5(0x14e)+_0xd7fe40+_0x34cfd5(0x153)+_0x5e48ad[_0x34cfd5(0xf5)]+')'),console[_0x34cfd5(0x110)]('\x20\x20Run:\x20ranger\x20update');else _0x5e48ad[_0x34cfd5(0xf5)]?console['log'](_0x34cfd5(0x14e)+_0xd7fe40+_0x34cfd5(0x114)):console[_0x34cfd5(0x110)](_0x34cfd5(0x14e)+_0xd7fe40);const _0x3d5e26=await getToken();if(_0x3d5e26){const _0x54b5d7=await getCurrentUser(_0x3d5e26);_0x54b5d7['success']?console[_0x34cfd5(0x110)]('Organization:\x20'+_0x255519['KrPLk'](bold,_0x54b5d7[_0x34cfd5(0x122)]['organizationName'])):(console['log'](_0x34cfd5(0x14b)),console['log'](_0x34cfd5(0xff)));}else console['log'](_0x34cfd5(0x144)),console['log'](_0x34cfd5(0xff));process['env'][_0x34cfd5(0x133)]&&(console['log']('API\x20Environment:\x20'+getCurrentEnvironment()),console[_0x34cfd5(0x110)]('API\x20URL:\x20'+getApiBaseUrl()));console['log'](_0x255519['ovTLg']);const _0x48cc78=await _0x255519[_0x34cfd5(0x111)](getOpencodePluginStatus);if(_0x255519[_0x34cfd5(0x10d)](_0x48cc78[_0x34cfd5(0x11c)],_0x255519[_0x34cfd5(0x13b)]))console[_0x34cfd5(0x110)]('\x20\x20'+_0x255519['dLKwT'](bold,'@ranger-testing/opencode-plugin')+':\x20configured'),_0x48cc78[_0x34cfd5(0xfc)]&&console['log']('\x20\x20'+_0x48cc78[_0x34cfd5(0xfc)]);else _0x48cc78['status']===_0x255519[_0x34cfd5(0x130)]?(console['log'](_0x255519['goxmL']),_0x48cc78['details']&&console['log']('\x20\x20'+_0x48cc78[_0x34cfd5(0xfc)]),console['log'](_0x255519['aCJRi'])):console['log']('\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available');console[_0x34cfd5(0x110)](_0x255519[_0x34cfd5(0x149)]);const _0x393943=await getPluginInfo(_0x255519['bJjCy']);if(_0x393943){const _0x8b12f6=_0x393943[_0x34cfd5(0x129)]||_0x34cfd5(0x151),_0x31f308=_0x393943['enabled']?_0x255519['YbWDy']:'disabled';console['log']('\x20\x20'+_0x255519['Ufxsa'](bold,'ranger@trailhead')+':\x20installed\x20('+_0x8b12f6+',\x20'+_0x31f308+')');}else console['log'](_0x255519['wbgma']),console[_0x34cfd5(0x110)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)');console[_0x34cfd5(0x110)]('\x0a---\x20Skills\x20---');const {project:_0x54ba64,user:_0x311bb4}=await getInstalledSkills(),_0x17888a=_0x54ba64['filter'](_0x1cdf13=>RANGER_MANAGED_SKILLS['includes'](_0x1cdf13[_0x34cfd5(0x12b)])),_0x12b501=_0x311bb4['filter'](_0x3d9e49=>RANGER_MANAGED_SKILLS[_0x34cfd5(0x135)](_0x3d9e49['name'])),_0x13851b=_0x255519[_0x34cfd5(0x14a)](_0x17888a['length'],_0x12b501['length']);if(_0x255519[_0x34cfd5(0x113)](_0x13851b,0x0))console['log'](_0x34cfd5(0xf9)),console[_0x34cfd5(0x110)](_0x34cfd5(0xfa));else{if(_0x17888a['length']>0x0){console[_0x34cfd5(0x110)](_0x255519['dfpun']);for(const _0x2d858f of _0x17888a){console['log']('\x20\x20\x20\x20'+bold(_0x2d858f['displayName'])+':\x20'+_0x255519[_0x34cfd5(0xf4)](link,_0x2d858f[_0x34cfd5(0xfb)],basename(_0x2d858f['path'])));}}if(_0x255519['tPGiV'](_0x12b501['length'],0x0)){console[_0x34cfd5(0x110)](_0x255519[_0x34cfd5(0xf2)]);for(const _0x19d63b of _0x12b501){console['log']('\x20\x20\x20\x20'+_0x255519['vwGLh'](bold,_0x19d63b[_0x34cfd5(0x115)])+':\x20'+_0x255519['VTqNB'](link,_0x19d63b[_0x34cfd5(0xfb)],basename(_0x19d63b['path'])));}}}console['log']('\x0a---\x20Profiles\x20---');const {envs:_0x1e1dfc,activeEnv:_0x1a956e}=await getEnvironments();let _0x5d66ea=[];if(_0x3d5e26)try{_0x5d66ea=await _0x255519[_0x34cfd5(0x111)](listCloudProfiles);}catch{}const _0x2cc2de=_0x1e1dfc[_0x34cfd5(0x13d)]+_0x5d66ea[_0x34cfd5(0x13d)];if(_0x2cc2de===0x0)console[_0x34cfd5(0x110)]('No\x20profiles\x20configured'),console['log'](_0x34cfd5(0xf6));else{if(_0x255519[_0x34cfd5(0x101)](_0x2cc2de,0x5)){const _0x4c79e9=[];_0x5d66ea['length']>0x0&&_0x4c79e9['push'](_0x5d66ea['length']+'\x20cloud'),_0x1e1dfc['length']>0x0&&_0x4c79e9[_0x34cfd5(0x100)](_0x1e1dfc['length']+_0x34cfd5(0xf3)),console[_0x34cfd5(0x110)](_0x2cc2de+'\x20profiles\x20configured\x20('+_0x4c79e9[_0x34cfd5(0x142)](',\x20')+')'),_0x1a956e&&console['log'](_0x34cfd5(0x141)+_0x255519[_0x34cfd5(0x131)](bold,_0x1a956e)),console['log']('\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)');}else{for(const _0x2c8b6e of _0x5d66ea){const _0x26bc1b=_0x255519['Rfawz'](_0x2c8b6e['name'],_0x1a956e)?_0x34cfd5(0x128):'';console['log']('\x20\x20'+_0x255519['YVnLI'](bold,_0x2c8b6e['name'])+'\x20[cloud]'+_0x26bc1b);const _0x2d5c3e=_0x2c8b6e[_0x34cfd5(0x11d)]?'cached\x20(updated\x20'+_0x2c8b6e['sessionUpdatedAt']+')':'no\x20session';console[_0x34cfd5(0x110)]('\x20\x20\x20\x20Session:\x20'+_0x2d5c3e);}const _0x5b81a6=new Set(_0x5d66ea[_0x34cfd5(0x143)](_0x269291=>_0x269291['name']));for(const _0x4324f7 of _0x1e1dfc){if(_0x5b81a6[_0x34cfd5(0xf7)](_0x4324f7['name']))continue;const _0x16594f=_0x4324f7[_0x34cfd5(0x10e)]?_0x255519[_0x34cfd5(0x146)]:'',_0x1b5d9f=_0x4324f7[_0x34cfd5(0x13f)]?'encrypted':_0x4324f7[_0x34cfd5(0x123)]?'plaintext':_0x34cfd5(0x139);console[_0x34cfd5(0x110)]('\x20\x20'+_0x255519[_0x34cfd5(0x12d)](bold,_0x4324f7['name'])+_0x34cfd5(0x12f)+_0x16594f),console[_0x34cfd5(0x110)]('\x20\x20\x20\x20Auth:\x20'+_0x1b5d9f),_0x255519[_0x34cfd5(0x11f)](_0x4324f7[_0x34cfd5(0xfd)],_0x34cfd5(0x150))&&console[_0x34cfd5(0x110)]('\x20\x20\x20\x20Settings:\x20'+link(_0x4324f7['settingsPath'],basename(_0x4324f7[_0x34cfd5(0xfd)])));}if(!_0x1a956e){console[_0x34cfd5(0x110)](_0x34cfd5(0x10a));const _0x4a3e27=[..._0x5d66ea[_0x34cfd5(0x143)](_0x2930dc=>_0x2930dc['name']),..._0x1e1dfc['filter'](_0x1c257e=>!_0x5b81a6['has'](_0x1c257e['name']))[_0x34cfd5(0x143)](_0x4396d7=>_0x4396d7[_0x34cfd5(0x12b)])];console[_0x34cfd5(0x110)](_0x34cfd5(0x126)+_0x4a3e27[_0x34cfd5(0x142)](',\x20')+')');}}}console['log']('');}