@ranger-testing/ranger-cli 3.1.5-alpha.9b89f77-48 → 3.1.5-alpha.aebd071-49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/build/cli.js +1 -1
  2. package/build/commands/addEnv.js +1 -1
  3. package/build/commands/authEncrypt.js +1 -1
  4. package/build/commands/clean.js +1 -1
  5. package/build/commands/config.js +1 -1
  6. package/build/commands/deleteProfile.js +1 -1
  7. package/build/commands/env.js +1 -1
  8. package/build/commands/feature.js +1 -1
  9. package/build/commands/hook.js +1 -1
  10. package/build/commands/hooks/autoPrompt.js +1 -1
  11. package/build/commands/hooks/disable.js +1 -1
  12. package/build/commands/hooks/enable.js +1 -1
  13. package/build/commands/hooks/exitPlanMode.js +1 -1
  14. package/build/commands/hooks/index.js +1 -1
  15. package/build/commands/hooks/output.js +1 -1
  16. package/build/commands/hooks/planReminder.js +1 -1
  17. package/build/commands/hooks/planStart.js +1 -1
  18. package/build/commands/hooks/postEdit.js +1 -1
  19. package/build/commands/hooks/preCompact.js +1 -1
  20. package/build/commands/hooks/sessionEnd.js +1 -1
  21. package/build/commands/hooks/sessionStart.js +1 -1
  22. package/build/commands/hooks/stopHook.js +1 -1
  23. package/build/commands/index.js +1 -1
  24. package/build/commands/login.js +1 -1
  25. package/build/commands/mcpBootstrap.js +1 -1
  26. package/build/commands/migrateProfile.js +1 -1
  27. package/build/commands/setup/claude.js +1 -1
  28. package/build/commands/setup/opencode.js +1 -1
  29. package/build/commands/setupCi.js +1 -1
  30. package/build/commands/skillup.js +1 -1
  31. package/build/commands/start.js +1 -1
  32. package/build/commands/status.js +1 -1
  33. package/build/commands/update.js +1 -1
  34. package/build/commands/updateEnv.js +1 -1
  35. package/build/commands/useEnv.js +1 -1
  36. package/build/commands/utils/activeProfile.js +1 -1
  37. package/build/commands/utils/agentEnv.js +1 -1
  38. package/build/commands/utils/browserSessionsApi.js +1 -1
  39. package/build/commands/utils/claudeConfig.js +1 -1
  40. package/build/commands/utils/claudeOverrideSettings.js +1 -1
  41. package/build/commands/utils/claudePlugin.js +1 -1
  42. package/build/commands/utils/cloudProfile.js +1 -1
  43. package/build/commands/utils/cloudProfileSession.js +1 -1
  44. package/build/commands/utils/crypto.js +1 -1
  45. package/build/commands/utils/desirePathLog.js +1 -1
  46. package/build/commands/utils/deviceAuth.js +1 -1
  47. package/build/commands/utils/environment.js +1 -1
  48. package/build/commands/utils/featureApi.js +1 -1
  49. package/build/commands/utils/fixWebmDuration.js +1 -1
  50. package/build/commands/utils/gitTracked.js +1 -1
  51. package/build/commands/utils/keychain.js +1 -1
  52. package/build/commands/utils/legacyWarning.js +1 -1
  53. package/build/commands/utils/localAgentInstallationsApi.js +1 -1
  54. package/build/commands/utils/matchAuthEnvironment.js +1 -1
  55. package/build/commands/utils/mcpImageBase64.js +1 -1
  56. package/build/commands/utils/model.js +1 -1
  57. package/build/commands/utils/novaActCli.js +1 -1
  58. package/build/commands/utils/opencodeConfig.js +1 -1
  59. package/build/commands/utils/organizationEnvApi.js +1 -1
  60. package/build/commands/utils/playwrightCli.js +1 -1
  61. package/build/commands/utils/profileMessages.js +1 -1
  62. package/build/commands/utils/profileSetupBanner.js +1 -1
  63. package/build/commands/utils/projectsConfig.js +1 -1
  64. package/build/commands/utils/rangerConfig.js +1 -1
  65. package/build/commands/utils/rangerRoot.js +1 -1
  66. package/build/commands/utils/rangerwrightCli.js +1 -1
  67. package/build/commands/utils/resolveProfileContext.js +1 -1
  68. package/build/commands/utils/resolveProfileUrl.js +1 -1
  69. package/build/commands/utils/retry.js +1 -1
  70. package/build/commands/utils/scenarioOriginCheck.js +1 -1
  71. package/build/commands/utils/sessionCache.js +1 -1
  72. package/build/commands/utils/settings.js +1 -1
  73. package/build/commands/utils/skillContent.js +1 -1
  74. package/build/commands/utils/skills.js +1 -1
  75. package/build/commands/utils/stitchWebmFiles.js +1 -1
  76. package/build/commands/utils/telemetry.js +1 -1
  77. package/build/commands/utils/tokenRefresh.js +1 -1
  78. package/build/commands/utils/traceSnapshotMapper.js +1 -1
  79. package/build/commands/utils/tunnelClient.js +1 -1
  80. package/build/commands/utils/userApi.js +1 -1
  81. package/build/commands/utils/version.js +1 -1
  82. package/build/commands/verifyFeature.js +1 -1
  83. package/build/commands/verifyFeatureCli.js +1 -1
  84. package/build/commands/verifyFeatureNovaCli.js +1 -1
  85. package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
  86. package/package.json +4 -2
@@ -1 +1 @@
1
- function _0x3345(){const _0x14bade=['log','pHTES','1000044zslZAy','organizationName','1TmarOx','2003018nRZMZV','993240SUoBow','BZzen','376574zWhTKz','4524804EAIhWy','254997hpCCTh','160DYVKzJ','success','8EhQknx','Login\x20failed:\x20','IkIup','1007485JCfBvZ','42QMBPyN','EuwnY'];_0x3345=function(){return _0x14bade;};return _0x3345();}(function(_0x1ab4b2,_0x2685d7){const _0xe649bd=_0x4bda,_0x57bc75=_0x1ab4b2();while(!![]){try{const _0x23a979=-parseInt(_0xe649bd(0x105))/0x1*(-parseInt(_0xe649bd(0x106))/0x2)+-parseInt(_0xe649bd(0x10b))/0x3*(parseInt(_0xe649bd(0x10e))/0x4)+-parseInt(_0xe649bd(0x111))/0x5+parseInt(_0xe649bd(0x116))/0x6*(-parseInt(_0xe649bd(0x112))/0x7)+parseInt(_0xe649bd(0x107))/0x8+parseInt(_0xe649bd(0x10a))/0x9+-parseInt(_0xe649bd(0x10c))/0xa*(-parseInt(_0xe649bd(0x109))/0xb);if(_0x23a979===_0x2685d7)break;else _0x57bc75['push'](_0x57bc75['shift']());}catch(_0x2c43cd){_0x57bc75['push'](_0x57bc75['shift']());}}}(_0x3345,0xc4711));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';import{isInteractive}from'./utils/cloudProfileSession.js';function _0x4bda(_0x494264,_0x1473da){_0x494264=_0x494264-0x104;const _0x334536=_0x3345();let _0x4bda6e=_0x334536[_0x494264];return _0x4bda6e;}export async function login(){const _0xad4258=_0x4bda,_0x284e12={'BZzen':function(_0x7bb918){return _0x7bb918();},'IkIup':'Re-authenticating\x20via\x20MCP\x20bootstrap...','pHTES':function(_0x372e1f){return _0x372e1f();},'LHEOu':'\x0a✅\x20API\x20key\x20stored\x20successfully','EuwnY':function(_0x27869b,_0xc968c){return _0x27869b instanceof _0xc968c;}},_0x245ecd=await _0x284e12[_0xad4258(0x108)](getMcpAuthOrigin);if(_0x245ecd){console['log'](_0x284e12[_0xad4258(0x110)]),await mcpBootstrap();return;}if(!_0x284e12[_0xad4258(0x115)](isInteractive))throw new Error('Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.');try{const _0xc2939f=await runDeviceAuthFlow(),_0x4c3d88=await getCurrentUser(_0xc2939f);_0x4c3d88[_0xad4258(0x10d)]?console[_0xad4258(0x114)]('\x0a✅\x20Logged\x20in\x20to\x20'+_0x4c3d88['user'][_0xad4258(0x104)]):console[_0xad4258(0x114)](_0x284e12['LHEOu']);}catch(_0x1b6ac2){throw new Error(_0xad4258(0x10f)+(_0x284e12[_0xad4258(0x113)](_0x1b6ac2,Error)?_0x1b6ac2['message']:_0x1b6ac2));}}
1
+ (function(_0x2ea9eb,_0x543a03){const _0x4cf616=_0x3984,_0x6649c8=_0x2ea9eb();while(!![]){try{const _0x10543d=parseInt(_0x4cf616(0x80))/0x1*(-parseInt(_0x4cf616(0x7f))/0x2)+parseInt(_0x4cf616(0x7a))/0x3*(parseInt(_0x4cf616(0x89))/0x4)+-parseInt(_0x4cf616(0x86))/0x5+parseInt(_0x4cf616(0x85))/0x6*(parseInt(_0x4cf616(0x7c))/0x7)+parseInt(_0x4cf616(0x87))/0x8*(parseInt(_0x4cf616(0x7e))/0x9)+parseInt(_0x4cf616(0x84))/0xa+-parseInt(_0x4cf616(0x8a))/0xb;if(_0x10543d===_0x543a03)break;else _0x6649c8['push'](_0x6649c8['shift']());}catch(_0x315ed5){_0x6649c8['push'](_0x6649c8['shift']());}}}(_0x37aa,0xc533b));function _0x3984(_0x43fe4c,_0x2fec5d){_0x43fe4c=_0x43fe4c-0x7a;const _0x37aa3d=_0x37aa();let _0x398428=_0x37aa3d[_0x43fe4c];return _0x398428;}import{runDeviceAuthFlow}from'./utils/deviceAuth.js';function _0x37aa(){const _0x113704=['18LsVeDN','18GTMnDU','123257rcwGrX','log','\x0a✅\x20API\x20key\x20stored\x20successfully','Login\x20failed:\x20','4778950jEfvtQ','599838UmgTju','406265WsGyjA','2591192xDnNYA','message','84CmjwRS','5414695tSArRD','52161FCyBaX','EemTO','70TzFqWp','BDhAp'];_0x37aa=function(){return _0x113704;};return _0x37aa();}import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';import{isInteractive}from'./utils/cloudProfileSession.js';export async function login(){const _0x131895=_0x3984,_0x40f39b={'iGIKr':function(_0x5cf634){return _0x5cf634();},'BDhAp':'Re-authenticating\x20via\x20MCP\x20bootstrap...','jtiiW':'Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','EemTO':_0x131895(0x82),'hsoRn':function(_0x5c86f1,_0xc3a3b2){return _0x5c86f1 instanceof _0xc3a3b2;}},_0x43ff91=await _0x40f39b['iGIKr'](getMcpAuthOrigin);if(_0x43ff91){console[_0x131895(0x81)](_0x40f39b[_0x131895(0x7d)]),await mcpBootstrap();return;}if(!isInteractive())throw new Error(_0x40f39b['jtiiW']);try{const _0x59ed0c=await runDeviceAuthFlow(),_0x2e9603=await getCurrentUser(_0x59ed0c);_0x2e9603['success']?console['log']('\x0a✅\x20Logged\x20in\x20to\x20'+_0x2e9603['user']['organizationName']):console['log'](_0x40f39b[_0x131895(0x7b)]);}catch(_0x2b7ab5){throw new Error(_0x131895(0x83)+(_0x40f39b['hsoRn'](_0x2b7ab5,Error)?_0x2b7ab5[_0x131895(0x88)]:_0x2b7ab5));}}
@@ -1 +1 @@
1
- const _0x3a9246=_0x2bd8;(function(_0x238952,_0x3fb191){const _0x331bf1=_0x2bd8,_0x21a2a9=_0x238952();while(!![]){try{const _0x53e5b1=parseInt(_0x331bf1(0x205))/0x1*(parseInt(_0x331bf1(0x26d))/0x2)+-parseInt(_0x331bf1(0x1ee))/0x3+parseInt(_0x331bf1(0x22f))/0x4+parseInt(_0x331bf1(0x267))/0x5*(-parseInt(_0x331bf1(0x1f7))/0x6)+-parseInt(_0x331bf1(0x275))/0x7+-parseInt(_0x331bf1(0x20a))/0x8+parseInt(_0x331bf1(0x24f))/0x9*(parseInt(_0x331bf1(0x216))/0xa);if(_0x53e5b1===_0x3fb191)break;else _0x21a2a9['push'](_0x21a2a9['shift']());}catch(_0x5abee6){_0x21a2a9['push'](_0x21a2a9['shift']());}}}(_0x1bf3,0x5de93));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',_0x3a9246(0x20b)),AUTH_ORIGIN_PATH=join(homedir(),'.ranger',_0x3a9246(0x25e));export async function getMcpAuthOrigin(){const _0x208985=_0x3a9246,_0x1519f1={'CwVAg':function(_0x4429c5,_0x371204,_0x38946a){return _0x4429c5(_0x371204,_0x38946a);}};try{const _0x383570=(await _0x1519f1[_0x208985(0x204)](readFile,AUTH_ORIGIN_PATH,_0x208985(0x227)))['trim']();return _0x383570||null;}catch{return null;}}export async function mcpBootstrap(){const _0x28a099=_0x3a9246,_0x1c5956={'rvFCY':function(_0x5b0b74,_0x3f91a6){return _0x5b0b74(_0x3f91a6);},'MnNZs':'proxied','bJXoZ':'MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','mYXfQ':function(_0x57d786,_0x38229a,_0x53750c){return _0x57d786(_0x38229a,_0x53750c);}},_0x3e43a1=getMcpAuthUrl();currentOrigin=_0x3e43a1;const _0x56ccf0=process['stdout']['isTTY']??![];console['log']('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x3e43a1+'\x0a');const _0x4d406b=await _0x1c5956[_0x28a099(0x1ec)](tryUnauthenticated,_0x3e43a1);let _0xa4a46c=null;if(_0x4d406b===_0x1c5956[_0x28a099(0x279)])_0xa4a46c='';else{_0xa4a46c=await loadCachedToken();if(!_0xa4a46c){if(!_0x56ccf0)throw new Error(_0x1c5956[_0x28a099(0x218)]+'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.');_0xa4a46c=await _0x1c5956[_0x28a099(0x1ec)](oauthFlow,_0x3e43a1);}}await _0x1c5956[_0x28a099(0x236)](callGetCliToken,_0x3e43a1,_0xa4a46c);}async function tryUnauthenticated(_0x2f2ae5){const _0x358f3b=_0x3a9246,_0x52e6e5={'ygRTx':'POST','fLwHS':'application/json,\x20text/event-stream','gvUhV':'2.0','dKalD':'ranger-cli','HJCsu':'1.0.0','SkpKa':_0x358f3b(0x26e)},_0x5f456b=await fetch(_0x2f2ae5,{'method':_0x52e6e5['ygRTx'],'headers':{'Content-Type':'application/json','Accept':_0x52e6e5['fLwHS']},'body':JSON[_0x358f3b(0x20f)]({'jsonrpc':_0x52e6e5['gvUhV'],'id':0x1,'method':'initialize','params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x52e6e5['dKalD'],'version':_0x52e6e5['HJCsu']}}})});if(_0x5f456b['ok'])return await _0x5f456b[_0x358f3b(0x253)](),'proxied';if(_0x5f456b[_0x358f3b(0x250)]===0x191)return await _0x5f456b[_0x358f3b(0x253)](),_0x52e6e5['SkpKa'];const _0x332ddf=await _0x5f456b[_0x358f3b(0x253)]();throw new Error(_0x358f3b(0x1f2)+_0x5f456b['status']+':\x20'+_0x332ddf);}class OAuthTimeoutError extends Error{constructor(_0x89e179){const _0x5d7d4b={'TeFeJ':'OAuthTimeoutError'};super(_0x89e179),this['name']=_0x5d7d4b['TeFeJ'];}}async function oauthFlow(_0x4f1bf4){const _0x31c85e=_0x3a9246,_0xe9eeb7={'KcPIq':function(_0xa17012,_0x13a44d){return _0xa17012(_0x13a44d);},'EwFjV':function(_0x2535c7,_0x183d8d){return _0x2535c7 instanceof _0x183d8d;},'EzeQU':function(_0x3ea653){return _0x3ea653();},'bNdyR':'\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'};try{return await _0xe9eeb7['KcPIq'](oauthFlowAttempt,_0x4f1bf4);}catch(_0x42f062){if(_0xe9eeb7[_0x31c85e(0x208)](_0x42f062,OAuthTimeoutError)&&await _0xe9eeb7['EzeQU'](loadCachedClient))return console['log'](_0xe9eeb7[_0x31c85e(0x1fc)]),await _0xe9eeb7[_0x31c85e(0x226)](clearCachedClient),await _0xe9eeb7[_0x31c85e(0x27c)](oauthFlowAttempt,_0x4f1bf4);throw _0x42f062;}}async function oauthFlowAttempt(_0x4f658f){const _0x33b825=_0x3a9246,_0x56b905={'LXzTM':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','CnFqC':_0x33b825(0x23e),'DfOuL':function(_0x1fa28d,_0x522955){return _0x1fa28d(_0x522955);},'Dyhlq':function(_0x2d935f){return _0x2d935f();},'VwCZD':_0x33b825(0x200),'neNAt':_0x33b825(0x202),'kbsAK':'\x20done','MHPHA':_0x33b825(0x24e),'djbIe':function(_0x97ff02,_0x2778f0){return _0x97ff02(_0x2778f0);},'hWMJC':'sha256','VIGUZ':_0x33b825(0x220),'RNUbG':_0x33b825(0x217),'srEoe':'code_challenge','jTLFs':'S256','cALSY':'state','byaZu':function(_0x5dcaa4,_0x16031a){return _0x5dcaa4(_0x16031a);},'XwXdL':_0x33b825(0x254),'avMmG':function(_0x60f265,_0x228f06,_0x3085be){return _0x60f265(_0x228f06,_0x3085be);},'bTNsz':function(_0x544759,_0x2d397a,_0x550171,_0x1019a3){return _0x544759(_0x2d397a,_0x550171,_0x1019a3);}},_0x23b248=_0x4f658f[_0x33b825(0x219)](/\/mcp$/,'');process[_0x33b825(0x239)][_0x33b825(0x206)]('Discovering\x20authorization\x20server...');const _0x26f54c=await fetch(_0x23b248+_0x33b825(0x245));if(!_0x26f54c['ok'])throw new Error(_0x56b905[_0x33b825(0x212)]);const _0x43f1f0=await _0x26f54c['json'](),_0x320780=_0x43f1f0['authorization_servers']?.[0x0];if(!_0x320780)throw new Error(_0x56b905['CnFqC']);console[_0x33b825(0x1ef)]('\x20'+_0x320780);const _0x9c6ed7=await _0x56b905['DfOuL'](fetchAuthServerMetadata,_0x320780);let _0x5baaf1,_0x478244;const _0x1e5ce2=await _0x56b905['Dyhlq'](loadCachedClient);if(_0x1e5ce2)_0x5baaf1=_0x1e5ce2['clientId'],_0x478244=_0x1e5ce2[_0x33b825(0x25a)];else{if(_0x9c6ed7[_0x33b825(0x24b)]){process['stdout']['write'](_0x56b905['VwCZD']);const _0x5e71f8=await fetch(_0x9c6ed7['registration_endpoint'],{'method':_0x56b905[_0x33b825(0x241)],'headers':{'Content-Type':'application/json'},'body':JSON[_0x33b825(0x20f)]({'client_name':_0x33b825(0x221),'redirect_uris':[_0x33b825(0x23f)+CALLBACK_PORT+'/callback'],'grant_types':[_0x33b825(0x254),_0x33b825(0x24a)],'response_types':['code'],'token_endpoint_auth_method':'none'})});if(!_0x5e71f8['ok']){const _0x4e3d19=await _0x5e71f8[_0x33b825(0x253)]();throw new Error('Client\x20registration\x20failed:\x20'+_0x4e3d19);}const _0x40963b=await _0x5e71f8['json']();_0x5baaf1=_0x40963b[_0x33b825(0x215)],_0x478244=_0x40963b['client_secret'],await saveCachedClient(_0x5baaf1,_0x478244),console[_0x33b825(0x1ef)](_0x56b905[_0x33b825(0x278)]);}else throw new Error('Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found');}const _0x5632ea=_0x56b905['DfOuL'](randomBytes,0x20)[_0x33b825(0x266)](_0x56b905['MHPHA']),_0x41e182=_0x56b905['djbIe'](createHash,_0x56b905['hWMJC'])['update'](_0x5632ea)['digest']('base64url'),_0x4bc714=_0x56b905['djbIe'](randomBytes,0x10)[_0x33b825(0x266)](_0x33b825(0x25c)),_0x340861=new URL(_0x9c6ed7['authorization_endpoint']);_0x340861['searchParams'][_0x33b825(0x240)](_0x33b825(0x209),_0x56b905['VIGUZ']),_0x340861[_0x33b825(0x260)]['set'](_0x33b825(0x215),_0x5baaf1),_0x340861['searchParams'][_0x33b825(0x240)](_0x56b905[_0x33b825(0x235)],'http://localhost:'+CALLBACK_PORT+_0x33b825(0x262)),_0x340861['searchParams']['set'](_0x56b905['srEoe'],_0x41e182),_0x340861['searchParams'][_0x33b825(0x240)]('code_challenge_method',_0x56b905['jTLFs']),_0x340861[_0x33b825(0x260)]['set'](_0x56b905[_0x33b825(0x20c)],_0x4bc714);_0x43f1f0['resource']&&_0x340861['searchParams']['set']('resource',_0x43f1f0[_0x33b825(0x27b)]);console[_0x33b825(0x1ef)]('\x0aOpening\x20browser\x20for\x20authentication...'),console[_0x33b825(0x1ef)]('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x340861[_0x33b825(0x266)]()+'\x0a'),await _0x56b905[_0x33b825(0x274)](openBrowser,_0x340861['toString']());const _0x5fba7d=await _0x56b905[_0x33b825(0x213)](waitForCallback,_0x4bc714);process[_0x33b825(0x239)]['write']('Exchanging\x20authorization\x20code...');const _0x340dd4=new URLSearchParams({'grant_type':_0x56b905['XwXdL'],'code':_0x5fba7d,'redirect_uri':'http://localhost:'+CALLBACK_PORT+_0x33b825(0x262),'client_id':_0x5baaf1,'code_verifier':_0x5632ea});_0x478244&&_0x340dd4['set'](_0x33b825(0x273),_0x478244);_0x43f1f0[_0x33b825(0x27b)]&&_0x340dd4[_0x33b825(0x240)](_0x33b825(0x27b),_0x43f1f0['resource']);const _0x31ea4c=await _0x56b905[_0x33b825(0x268)](fetch,_0x9c6ed7['token_endpoint'],{'method':_0x56b905[_0x33b825(0x241)],'headers':{'Content-Type':_0x33b825(0x238)},'body':_0x340dd4});if(!_0x31ea4c['ok']){const _0x3c5971=await _0x31ea4c['text']();throw new Error(_0x33b825(0x210)+_0x3c5971);}const _0xa4c9b=await _0x31ea4c['json']();return console[_0x33b825(0x1ef)](_0x56b905[_0x33b825(0x278)]),await _0x56b905[_0x33b825(0x246)](saveCachedToken,_0xa4c9b['access_token'],_0xa4c9b['refresh_token'],_0xa4c9b[_0x33b825(0x222)]),_0xa4c9b[_0x33b825(0x256)];}async function callGetCliToken(_0x13d5b2,_0x382564){const _0x36a53a=_0x3a9246,_0x178e6a={'FSzpx':function(_0xc08669,_0x258508,_0x53a251){return _0xc08669(_0x258508,_0x53a251);},'jcEyI':'POST','tmUre':function(_0x6526b6,_0x3ca78e){return _0x6526b6(_0x3ca78e);},'IWZol':'application/json','jABYq':_0x36a53a(0x264),'QoxHu':'Initializing\x20MCP\x20session...','ZfQvR':function(_0x1badb6,_0x15082a){return _0x1badb6(_0x15082a);},'Fniqw':'2025-03-26','vKTRM':'Requesting\x20CLI\x20token...','oYAec':function(_0x1ecb99,_0x9233a5){return _0x1ecb99(_0x9233a5);},'MHvyI':'2.0','JAhcK':'tools/call','oLeCn':_0x36a53a(0x237),'RETeb':'\x0aUnexpected\x20response\x20structure:','lGwBM':'.ranger','rdcTS':function(_0x345ce4,_0xd008eb,_0xc1ed6c){return _0x345ce4(_0xd008eb,_0xc1ed6c);},'YRXDI':'refresh.txt','LCZNr':'Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a'},_0x56438a={'Content-Type':_0x178e6a[_0x36a53a(0x1f0)],'Accept':'application/json,\x20text/event-stream'};_0x382564&&(_0x56438a[_0x178e6a['jABYq']]=_0x36a53a(0x257)+_0x382564);const _0x2661f3=async _0x38f65b=>{const _0x2ffbd2=_0x36a53a,_0x4d49be=await _0x178e6a['FSzpx'](fetch,_0x13d5b2,{'method':_0x178e6a[_0x2ffbd2(0x20d)],'headers':_0x56438a,'body':JSON['stringify'](_0x38f65b)});if(!_0x4d49be['ok']){const _0x28c13a=await _0x4d49be[_0x2ffbd2(0x253)]();throw new Error('HTTP\x20'+_0x4d49be[_0x2ffbd2(0x250)]+':\x20'+_0x28c13a);}return _0x178e6a[_0x2ffbd2(0x242)](parseResponse,_0x4d49be);};process[_0x36a53a(0x239)][_0x36a53a(0x206)](_0x178e6a[_0x36a53a(0x23b)]);const _0x4e070c=await _0x178e6a[_0x36a53a(0x258)](_0x2661f3,{'jsonrpc':_0x36a53a(0x276),'id':0x1,'method':_0x36a53a(0x225),'params':{'protocolVersion':_0x178e6a[_0x36a53a(0x27a)],'capabilities':{},'clientInfo':{'name':_0x36a53a(0x23c),'version':'1.0.0'}}});if(_0x4e070c['error'])throw new Error(_0x36a53a(0x201)+(_0x4e070c['error'][_0x36a53a(0x1fd)]??JSON['stringify'](_0x4e070c['error'])));console[_0x36a53a(0x1ef)]('\x20done'),await fetch(_0x13d5b2,{'method':_0x36a53a(0x202),'headers':_0x56438a,'body':JSON['stringify']({'jsonrpc':'2.0','method':_0x36a53a(0x24d)})})['then'](_0x27111a=>_0x27111a[_0x36a53a(0x253)]()),process[_0x36a53a(0x239)][_0x36a53a(0x206)](_0x178e6a['vKTRM']);const _0x3b0dfc=await _0x178e6a['oYAec'](_0x2661f3,{'jsonrpc':_0x178e6a['MHvyI'],'id':0x2,'method':_0x178e6a[_0x36a53a(0x1f3)],'params':{'name':_0x178e6a['oLeCn'],'arguments':{}}});if(_0x3b0dfc['error'])throw new Error(_0x36a53a(0x261)+(_0x3b0dfc[_0x36a53a(0x26c)][_0x36a53a(0x1fd)]??JSON['stringify'](_0x3b0dfc['error'])));console[_0x36a53a(0x1ef)]('\x20done');const _0xea06c2=_0x178e6a['tmUre'](extractToken,_0x3b0dfc[_0x36a53a(0x26b)]);if(!_0xea06c2){console[_0x36a53a(0x26c)](_0x178e6a[_0x36a53a(0x1f9)]),console[_0x36a53a(0x26c)](JSON['stringify'](_0x3b0dfc['result'],null,0x2));throw new Error(_0x36a53a(0x269));}const _0x3b289a=_0x178e6a[_0x36a53a(0x1f5)](join,homedir(),_0x178e6a['lGwBM']),_0xe5a4dd=_0x178e6a['rdcTS'](join,_0x3b289a,_0x178e6a[_0x36a53a(0x1f6)]);await mkdir(_0x3b289a,{'recursive':!![]}),await writeFile(_0xe5a4dd,_0xea06c2,{'mode':0x180}),await writeFile(_0x178e6a[_0x36a53a(0x214)](join,_0x3b289a,'auth-origin.txt'),_0x13d5b2,{'mode':0x180}),console[_0x36a53a(0x1ef)]('\x0aToken\x20written\x20to\x20'+_0xe5a4dd),console['log'](_0x178e6a['LCZNr']);}async function fetchAuthServerMetadata(_0x56a95b){const _0x42d124=_0x3a9246,_0x1a8c2a=_0x56a95b+_0x42d124(0x265),_0xe7ce79=await fetch(_0x1a8c2a);if(!_0xe7ce79['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x1a8c2a+':\x20'+_0xe7ce79[_0x42d124(0x250)]);return _0xe7ce79[_0x42d124(0x277)]();}function waitForCallback(_0x16955a){const _0xcc5381=_0x3a9246,_0x42775b={'KwhvG':function(_0x55a452){return _0x55a452();},'wHanV':function(_0x2ce19f,_0x3f10b6){return _0x2ce19f!==_0x3f10b6;},'mKruE':'/callback','zJKWf':'state','SVcah':'error_description','jCMif':_0xcc5381(0x252),'QoWLe':function(_0x1e6e91,_0x5fd60a){return _0x1e6e91(_0x5fd60a);},'ekiTT':'<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','kbsJb':_0xcc5381(0x21e),'BjMfL':function(_0x2faa7d){return _0x2faa7d();}};return new Promise((_0x50778a,_0x22ef0b)=>{const _0x1bf248=_0xcc5381,_0x28ecdf=()=>{const _0x1b2c25=_0x2bd8;_0x513979[_0x1b2c25(0x223)](),_0x513979['close']();},_0x324941=setTimeout(()=>{const _0x29d8b4=_0x2bd8;_0x42775b[_0x29d8b4(0x228)](_0x28ecdf),_0x22ef0b(new OAuthTimeoutError(_0x29d8b4(0x233)));},0x1d4c0),_0x513979=_0x42775b['QoWLe'](createServer,(_0x1b8ab1,_0x1d9364)=>{const _0x4ece04=_0x2bd8,_0x4d0d12=new URL(_0x1b8ab1['url']??'/',_0x4ece04(0x23f)+CALLBACK_PORT);if(_0x42775b['wHanV'](_0x4d0d12['pathname'],_0x42775b[_0x4ece04(0x22b)])){_0x1d9364['writeHead'](0x194),_0x1d9364['end']('Not\x20found');return;}const _0x1a5ce3=_0x4d0d12[_0x4ece04(0x260)]['get'](_0x4ece04(0x220)),_0x2c1eb7=_0x4d0d12[_0x4ece04(0x260)][_0x4ece04(0x248)](_0x42775b['zJKWf']),_0x506d7b=_0x4d0d12['searchParams']['get'](_0x4ece04(0x26c));if(_0x506d7b){const _0x1b8555=_0x4d0d12['searchParams']['get'](_0x42775b[_0x4ece04(0x244)])??_0x506d7b;_0x1d9364[_0x4ece04(0x25f)](0xc8,{'Content-Type':_0x42775b[_0x4ece04(0x270)]}),_0x1d9364['end']('<html><body><h2>Authentication\x20failed</h2><p>'+_0x1b8555+_0x4ece04(0x259)),clearTimeout(_0x324941),_0x42775b['KwhvG'](_0x28ecdf),_0x42775b[_0x4ece04(0x272)](_0x22ef0b,new Error(_0x4ece04(0x263)+_0x1b8555));return;}if(!_0x1a5ce3||_0x42775b[_0x4ece04(0x21b)](_0x2c1eb7,_0x16955a)){_0x1d9364['writeHead'](0x190,{'Content-Type':_0x42775b[_0x4ece04(0x270)]}),_0x1d9364['end'](_0x42775b[_0x4ece04(0x22a)]);return;}_0x1d9364['writeHead'](0xc8,{'Content-Type':_0x42775b[_0x4ece04(0x270)]}),_0x1d9364[_0x4ece04(0x1f1)](_0x42775b[_0x4ece04(0x25d)]),_0x42775b['QoWLe'](clearTimeout,_0x324941),_0x42775b['BjMfL'](_0x28ecdf),_0x50778a(_0x1a5ce3);});_0x513979['listen'](CALLBACK_PORT,_0x1bf248(0x26f));});}function _0x2bd8(_0x51a005,_0x53d384){_0x51a005=_0x51a005-0x1ec;const _0x1bf3b0=_0x1bf3();let _0x2bd892=_0x1bf3b0[_0x51a005];return _0x2bd892;}async function openBrowser(_0x1cb3ab){const _0x5a19fd=_0x3a9246,_0x2f29ac={'tTcgO':function(_0x3d59ce,_0x3aea1d){return _0x3d59ce===_0x3aea1d;},'mCpsz':_0x5a19fd(0x22d),'NPanp':_0x5a19fd(0x1f8),'eHYJt':'xdg-open','ynwcT':function(_0x2c32bc,_0x7fc972){return _0x2c32bc(_0x7fc972);}},_0x185a05=_0x2f29ac['tTcgO'](process[_0x5a19fd(0x24c)],_0x2f29ac['mCpsz'])?_0x5a19fd(0x243):_0x2f29ac['tTcgO'](process['platform'],_0x2f29ac[_0x5a19fd(0x271)])?_0x5a19fd(0x211):_0x2f29ac[_0x5a19fd(0x20e)];_0x2f29ac['ynwcT'](exec,_0x185a05+'\x20\x22'+_0x1cb3ab+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x26ed14=_0x3a9246,_0x3b7ca4={'dYJuq':function(_0x199ab7,_0x3a7bef,_0x28be53){return _0x199ab7(_0x3a7bef,_0x28be53);},'nDCyc':function(_0x5ee7fa,_0x18f1a8){return _0x5ee7fa!==_0x18f1a8;}};try{const _0x483b59=JSON['parse'](await _0x3b7ca4['dYJuq'](readFile,TOKEN_CACHE_PATH,_0x26ed14(0x227)));if(_0x483b59['origin']&&_0x3b7ca4[_0x26ed14(0x23d)](_0x483b59[_0x26ed14(0x231)],currentOrigin))return null;if(_0x483b59[_0x26ed14(0x203)]&&Date['now']()>_0x483b59[_0x26ed14(0x203)])return null;return _0x483b59['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0x572320,_0x39e673,_0x1395f4){const _0x513626=_0x3a9246,_0xd63b4f={'bnvHg':function(_0xf15557,_0x32a43b){return _0xf15557*_0x32a43b;},'nVcMc':function(_0x4311af,_0x574d48,_0x41eac7){return _0x4311af(_0x574d48,_0x41eac7);},'GnPJr':function(_0x494428){return _0x494428();},'BDlto':_0x513626(0x22c),'PdKIj':function(_0x15ba8e,_0x42c866,_0x402a6c,_0x1b6721){return _0x15ba8e(_0x42c866,_0x402a6c,_0x1b6721);}},_0x3a093b=await loadCachedData(),_0x3a4f8f={..._0x3a093b,'origin':currentOrigin,'accessToken':_0x572320,'refreshToken':_0x39e673??_0x3a093b?.['refreshToken'],'expiresAt':_0x1395f4?Date[_0x513626(0x1fa)]()+_0xd63b4f[_0x513626(0x23a)](_0x1395f4,0x3e8):undefined};await _0xd63b4f[_0x513626(0x230)](mkdir,join(_0xd63b4f[_0x513626(0x249)](homedir),_0xd63b4f[_0x513626(0x1fe)]),{'recursive':!![]}),await _0xd63b4f['PdKIj'](writeFile,TOKEN_CACHE_PATH,JSON[_0x513626(0x20f)](_0x3a4f8f),{'mode':0x180});}async function loadCachedClient(){const _0x8b0ff0=_0x3a9246,_0x31aca8={'IOAln':function(_0x10ce74){return _0x10ce74();}},_0x54e06b=await _0x31aca8[_0x8b0ff0(0x26a)](loadCachedData);if(_0x54e06b?.[_0x8b0ff0(0x231)]&&_0x54e06b['origin']!==currentOrigin)return null;return _0x54e06b?.[_0x8b0ff0(0x234)]?{'clientId':_0x54e06b[_0x8b0ff0(0x234)],'clientSecret':_0x54e06b[_0x8b0ff0(0x25a)]}:null;}async function clearCachedClient(){const _0x5eda65=_0x3a9246,_0x2fe3f5={'hfyuK':function(_0x4c5427){return _0x4c5427();},'ZVfES':function(_0x53c972,_0x34ab07,_0x498855,_0x458bf7){return _0x53c972(_0x34ab07,_0x498855,_0x458bf7);}},_0x209e07=await _0x2fe3f5['hfyuK'](loadCachedData);if(!_0x209e07)return;const {clientId:_0x582b20,clientSecret:_0x52b803,..._0x1e1320}=_0x209e07;await _0x2fe3f5[_0x5eda65(0x1ff)](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x1e1320),{'mode':0x180});}function _0x1bf3(){const _0x29a407=['RETeb','now','WOBRg','bNdyR','message','BDlto','ZVfES','Registering\x20OAuth\x20client...','MCP\x20initialize\x20failed:\x20','POST','expiresAt','CwVAg','112917BbPfIV','write','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','EwFjV','response_type','2178504OAEaNj','mcp-oauth-tokens.json','cALSY','jcEyI','eHYJt','stringify','Token\x20exchange\x20failed:\x20','start','LXzTM','byaZu','rdcTS','client_id','10vMCcjj','redirect_uri','bJXoZ','replace','gDIOP','wHanV','length','trim','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','parse','code','Ranger\x20CLI','expires_in','closeAllConnections','content','initialize','EzeQU','utf-8','KwhvG','Unknown\x20error','ekiTT','mKruE','.ranger','darwin','data:','3020684WRyBKU','nVcMc','origin','includes','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','clientId','RNUbG','mYXfQ','get_cli_token','application/x-www-form-urlencoded','stdout','bnvHg','QoxHu','ranger-cli','nDCyc','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','http://localhost:','set','neNAt','tmUre','open','SVcah','/.well-known/oauth-protected-resource','bTNsz','eKeQh','get','GnPJr','refresh_token','registration_endpoint','platform','notifications/initialized','base64url','7850817RZKaoG','status','token','text/html','text','authorization_code','startsWith','access_token','Bearer\x20','ZfQvR','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','clientSecret','string','hex','kbsJb','auth-origin.txt','writeHead','searchParams','get_cli_token\x20failed:\x20','/callback','OAuth\x20error:\x20','Authorization','/.well-known/oauth-authorization-server','toString','869180bKUnBd','avMmG','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','IOAln','result','error','2StUmgN','needs-oauth','127.0.0.1','jCMif','NPanp','QoWLe','client_secret','DfOuL','3327863HaBTzP','2.0','json','kbsAK','MnNZs','Fniqw','resource','KcPIq','rvFCY','tmyen','781044AhNmId','log','IWZol','end','MCP\x20server\x20returned\x20HTTP\x20','JAhcK','type','FSzpx','YRXDI','12inPHWa','win32'];_0x1bf3=function(){return _0x29a407;};return _0x1bf3();}async function saveCachedClient(_0xe4e2ae,_0x55bc61){const _0x5b50a6=_0x3a9246,_0x1ce7b3={'KvtJz':function(_0xedf5f,_0xa16b23,_0x40c04c){return _0xedf5f(_0xa16b23,_0x40c04c);}},_0xecd286=await loadCachedData(),_0x188308={..._0xecd286,'origin':currentOrigin,'accessToken':_0xecd286?.['accessToken']??'','clientId':_0xe4e2ae,'clientSecret':_0x55bc61};await _0x1ce7b3['KvtJz'](mkdir,join(homedir(),_0x5b50a6(0x22c)),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x188308),{'mode':0x180});}async function loadCachedData(){const _0x3eb18e=_0x3a9246;try{return JSON[_0x3eb18e(0x21f)](await readFile(TOKEN_CACHE_PATH,_0x3eb18e(0x227)));}catch{return null;}}async function parseResponse(_0x474e6b){const _0x40de05=_0x3a9246,_0x16ef9f={'qmkyg':'content-type','eKeQh':'text/event-stream','tmyen':_0x40de05(0x22e),'WOBRg':_0x40de05(0x207)},_0x2cfeb6=_0x474e6b['headers'][_0x40de05(0x248)](_0x16ef9f['qmkyg'])??'';if(_0x2cfeb6[_0x40de05(0x232)](_0x16ef9f[_0x40de05(0x247)])){const _0x2d5e31=await _0x474e6b[_0x40de05(0x253)]();for(const _0x1cb2d1 of _0x2d5e31['split']('\x0a')){const _0x4e4b6e=_0x1cb2d1[_0x40de05(0x21d)]();if(_0x4e4b6e[_0x40de05(0x255)](_0x16ef9f[_0x40de05(0x1ed)])){const _0x2a512c=_0x4e4b6e['slice'](_0x40de05(0x22e)[_0x40de05(0x21c)])[_0x40de05(0x21d)]();if(!_0x2a512c)continue;try{const _0x105cef=JSON[_0x40de05(0x21f)](_0x2a512c);if(_0x105cef['id']!==undefined||_0x105cef[_0x40de05(0x26c)])return _0x105cef;}catch{}}}throw new Error(_0x16ef9f[_0x40de05(0x1fb)]);}return _0x474e6b[_0x40de05(0x277)]();}function extractToken(_0x342408){const _0x4597fe=_0x3a9246,_0x323a70={'ZIRln':function(_0x401eab,_0x39c618){return _0x401eab===_0x39c618;},'lFqAS':_0x4597fe(0x25b),'yXKVG':_0x4597fe(0x229),'gDIOP':function(_0x446cd8,_0x4f1204){return _0x446cd8===_0x4f1204;}};if(!_0x342408)return null;const _0x48e355=_0x342408['structuredContent'];if(_0x48e355?.['token']&&_0x323a70['ZIRln'](typeof _0x48e355['token'],_0x323a70['lFqAS']))return _0x48e355['token'];if(_0x342408['isError']){const _0x2f389d=_0x342408[_0x4597fe(0x224)];throw new Error('Server\x20returned\x20error:\x20'+(_0x2f389d?.[0x0]?.['text']??_0x323a70['yXKVG']));}const _0x49bdd2=_0x342408['content'];if(_0x49bdd2)for(const _0x24c084 of _0x49bdd2){if(_0x323a70['ZIRln'](_0x24c084[_0x4597fe(0x1f4)],_0x4597fe(0x253))&&_0x24c084[_0x4597fe(0x253)]){try{const _0x39f483=JSON[_0x4597fe(0x21f)](_0x24c084['text']);if(_0x323a70[_0x4597fe(0x21a)](typeof _0x39f483?.[_0x4597fe(0x251)],'string'))return _0x39f483['token'];}catch{}const _0x3b7ab7=_0x24c084['text']['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x3b7ab7)return _0x3b7ab7[0x1];}}return null;}
1
+ function _0x4af4(){const _0x5902dd=['UPMvO','isTTY','client_id','none','application/x-www-form-urlencoded','282UzIkho','MgOfy','token','code_challenge','WnSdc','prVrt','toString','listen','error','update','http://localhost:','lpAHq','stringify','jzQHz','get','oaEoD','write','DckUU','type','end','IPrWb','clientId','YfNOM','Qwhnv','open','xdg-open','application/json,\x20text/event-stream','hUicL','trim','QKjcj','rzNpI','UxrzQ','hfqpd','OPKyJ','688ImEyVV','origin','now','digest','isError','initialize','Token\x20exchange\x20failed:\x20','150206ejxDiC','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','nlPZh','Rajcc','application/json','Unknown\x20error','registration_endpoint','1934106MMePZV','structuredContent','tools/call','parse','MCP\x20server\x20returned\x20HTTP\x20','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','1110708plvYRW','OAuthTimeoutError','GwYKY','ziKTV','ysuvY','CNEaM','redirect_uri','EtyZA','\x20done','WYxav','\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20','Initializing\x20MCP\x20session...','vAHjO','uzyCW','sha256','tuWff','match','trAwA','Not\x20found','2.0','proxied','includes','content-type','311170DWFXnA','Registering\x20OAuth\x20client...','expires_in','needs-oauth','close','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','akBcU','response_type','writeHead','lZCFA','auth-origin.txt','data:','BNwAy','pBQoe','replace','searchParams','refresh_token','.ranger','code','\x0aOpening\x20browser\x20for\x20authentication...','text','get_cli_token\x20failed:\x20','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','591520eXRzaK','text/html','1.0.0','88NrlpRE','darwin','message','MCP\x20initialize\x20failed:\x20','EQACP','gsCYT','Bearer\x20','ByzrU','refresh.txt','EJrGh','QmyAY','status','start','4Ulpkzi','ACjRr','set','lhcUi','client_secret','result','hLPLK','stdout','Authorization','131751riqfNh','utf-8','Discovering\x20authorization\x20server...','tbDJo','json','pathname','TixVA','POST','url','log','resource','MBSpC','accessToken','2OsaQxl','2166415rfuRXF','platform','jCWTO','access_token','TBFVb','state','Xdmoj','RHivM','clientSecret','length','AslMB','authorization_code','notifications/initialized','VeeAr','fEYKi','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','/callback','WyQLx','name'];_0x4af4=function(){return _0x5902dd;};return _0x4af4();}const _0x1062a6=_0x4710;(function(_0x66d401,_0x46048b){const _0x4936ed=_0x4710,_0x504960=_0x66d401();while(!![]){try{const _0xc8fbd9=-parseInt(_0x4936ed(0x137))/0x1+parseInt(_0x4936ed(0x15d))/0x2*(-parseInt(_0x4936ed(0x103))/0x3)+parseInt(_0x4936ed(0x147))/0x4*(-parseInt(_0x4936ed(0x15e))/0x5)+parseInt(_0x4936ed(0xd3))/0x6*(parseInt(_0x4936ed(0xfc))/0x7)+-parseInt(_0x4936ed(0xf5))/0x8*(-parseInt(_0x4936ed(0x150))/0x9)+-parseInt(_0x4936ed(0x120))/0xa*(-parseInt(_0x4936ed(0x13a))/0xb)+-parseInt(_0x4936ed(0x109))/0xc;if(_0xc8fbd9===_0x46048b)break;else _0x504960['push'](_0x504960['shift']());}catch(_0x23fc47){_0x504960['push'](_0x504960['shift']());}}}(_0x4af4,0xb82b0));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger','mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),_0x1062a6(0x131),_0x1062a6(0x12a));export async function getMcpAuthOrigin(){const _0x54ce82=_0x1062a6,_0x5e0460={'AslMB':function(_0x5728fe,_0x70ddb7,_0x2aa371){return _0x5728fe(_0x70ddb7,_0x2aa371);},'EWmuP':_0x54ce82(0x151),'ARxJl':function(_0x4990e1,_0x4899dc){return _0x4990e1||_0x4899dc;}};try{const _0x9430bb=(await _0x5e0460[_0x54ce82(0xc5)](readFile,AUTH_ORIGIN_PATH,_0x5e0460['EWmuP']))['trim']();return _0x5e0460['ARxJl'](_0x9430bb,null);}catch{return null;}}export async function mcpBootstrap(){const _0x45283a=_0x1062a6,_0x3cad18={'JNJrQ':function(_0x26a2a9,_0x4052cc){return _0x26a2a9(_0x4052cc);},'mHHKN':'proxied','DDsyI':function(_0x1021dc){return _0x1021dc();},'hUicL':function(_0x7a12dc,_0x1db07f){return _0x7a12dc+_0x1db07f;},'fThzU':'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','aJeUz':function(_0x3a13fa,_0x27e2af,_0x34fa17){return _0x3a13fa(_0x27e2af,_0x34fa17);}},_0x1cc4a9=getMcpAuthUrl();currentOrigin=_0x1cc4a9;const _0x5b7c3d=process[_0x45283a(0x14e)][_0x45283a(0xcf)]??![];console['log'](_0x45283a(0x113)+_0x1cc4a9+'\x0a');const _0x473f4b=await _0x3cad18['JNJrQ'](tryUnauthenticated,_0x1cc4a9);let _0x53104f=null;if(_0x473f4b===_0x3cad18['mHHKN'])_0x53104f='';else{_0x53104f=await _0x3cad18['DDsyI'](loadCachedToken);if(!_0x53104f){if(!_0x5b7c3d)throw new Error(_0x3cad18[_0x45283a(0xee)]('MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a',_0x3cad18['fThzU']));_0x53104f=await oauthFlow(_0x1cc4a9);}}await _0x3cad18['aJeUz'](callGetCliToken,_0x1cc4a9,_0x53104f);}async function tryUnauthenticated(_0x31a950){const _0x5843ce=_0x1062a6,_0x325e25={'ziKTV':_0x5843ce(0x100),'lhcUi':_0x5843ce(0x11c),'Zgvns':_0x5843ce(0xfa),'WyQLx':function(_0x3f998a,_0x38e8dc){return _0x3f998a===_0x38e8dc;},'QKjcj':_0x5843ce(0x123)},_0x2e1a6d=await fetch(_0x31a950,{'method':_0x5843ce(0x157),'headers':{'Content-Type':_0x325e25[_0x5843ce(0x10c)],'Accept':'application/json,\x20text/event-stream'},'body':JSON['stringify']({'jsonrpc':_0x325e25[_0x5843ce(0x14a)],'id':0x1,'method':_0x325e25['Zgvns'],'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':'ranger-cli','version':'1.0.0'}}})});if(_0x2e1a6d['ok'])return await _0x2e1a6d[_0x5843ce(0x134)](),_0x5843ce(0x11d);if(_0x325e25[_0x5843ce(0xcc)](_0x2e1a6d['status'],0x191))return await _0x2e1a6d['text'](),_0x325e25[_0x5843ce(0xf0)];const _0x1c4ac8=await _0x2e1a6d['text']();throw new Error(_0x5843ce(0x107)+_0x2e1a6d['status']+':\x20'+_0x1c4ac8);}class OAuthTimeoutError extends Error{constructor(_0x4a529b){const _0x1f19e1=_0x1062a6;super(_0x4a529b),this[_0x1f19e1(0xcd)]=_0x1f19e1(0x10a);}}async function oauthFlow(_0x22de21){const _0x1d9e22=_0x1062a6,_0x1cfa2c={'OPKyJ':function(_0x2658b4,_0x4b4881){return _0x2658b4 instanceof _0x4b4881;},'jCWTO':function(_0x5c2de5){return _0x5c2de5();}};try{return await oauthFlowAttempt(_0x22de21);}catch(_0xac4506){if(_0x1cfa2c[_0x1d9e22(0xf4)](_0xac4506,OAuthTimeoutError)&&await loadCachedClient())return console[_0x1d9e22(0x159)]('\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'),await _0x1cfa2c[_0x1d9e22(0x160)](clearCachedClient),await oauthFlowAttempt(_0x22de21);throw _0xac4506;}}async function oauthFlowAttempt(_0x164c5c){const _0x145d9d=_0x1062a6,_0x298496={'TBFVb':'No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','ByzrU':_0x145d9d(0x121),'MocyI':function(_0x5f18d1,_0x464424,_0x485326){return _0x5f18d1(_0x464424,_0x485326);},'gsCYT':'POST','Xdmoj':'Ranger\x20CLI','tbDJo':'authorization_code','DckUU':'\x20done','EtyZA':function(_0x14fce0,_0x20ad8){return _0x14fce0(_0x20ad8);},'CNEaM':'base64url','IPrWb':function(_0x4d9fda,_0x52fca6){return _0x4d9fda(_0x52fca6);},'EPETQ':'hex','VxzZJ':_0x145d9d(0xd0),'tUaOH':_0x145d9d(0x10f),'SFiri':_0x145d9d(0xd6),'QDOfN':'S256','pmLeg':_0x145d9d(0x15a),'Rajcc':function(_0x4ec011,_0x5521de,_0x1a9181,_0x2419b8){return _0x4ec011(_0x5521de,_0x1a9181,_0x2419b8);}},_0x4170a8=_0x164c5c[_0x145d9d(0x12e)](/\/mcp$/,'');process['stdout'][_0x145d9d(0xe3)](_0x145d9d(0x152));const _0x44126a=await fetch(_0x4170a8+'/.well-known/oauth-protected-resource');if(!_0x44126a['ok'])throw new Error('Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server');const _0x47d038=await _0x44126a[_0x145d9d(0x154)](),_0x16cc82=_0x47d038['authorization_servers']?.[0x0];if(!_0x16cc82)throw new Error(_0x298496[_0x145d9d(0xbf)]);console[_0x145d9d(0x159)]('\x20'+_0x16cc82);const _0x427813=await fetchAuthServerMetadata(_0x16cc82);let _0x5a2f03,_0xeadb2f;const _0x588dbd=await loadCachedClient();if(_0x588dbd)_0x5a2f03=_0x588dbd[_0x145d9d(0xe8)],_0xeadb2f=_0x588dbd['clientSecret'];else{if(_0x427813[_0x145d9d(0x102)]){process[_0x145d9d(0x14e)]['write'](_0x298496[_0x145d9d(0x141)]);const _0x393e4b=await _0x298496['MocyI'](fetch,_0x427813[_0x145d9d(0x102)],{'method':_0x298496['gsCYT'],'headers':{'Content-Type':'application/json'},'body':JSON['stringify']({'client_name':_0x298496[_0x145d9d(0xc1)],'redirect_uris':['http://localhost:'+CALLBACK_PORT+_0x145d9d(0xcb)],'grant_types':[_0x298496[_0x145d9d(0x153)],_0x145d9d(0x130)],'response_types':[_0x145d9d(0x132)],'token_endpoint_auth_method':_0x145d9d(0xd1)})});if(!_0x393e4b['ok']){const _0x327d02=await _0x393e4b[_0x145d9d(0x134)]();throw new Error('Client\x20registration\x20failed:\x20'+_0x327d02);}const _0x51ff0c=await _0x393e4b['json']();_0x5a2f03=_0x51ff0c[_0x145d9d(0xd0)],_0xeadb2f=_0x51ff0c['client_secret'],await saveCachedClient(_0x5a2f03,_0xeadb2f),console['log'](_0x298496[_0x145d9d(0xe4)]);}else throw new Error('Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found');}const _0x4b83fa=_0x298496['EtyZA'](randomBytes,0x20)[_0x145d9d(0xd9)](_0x298496['CNEaM']),_0x31a12c=_0x298496[_0x145d9d(0xe7)](createHash,_0x145d9d(0x117))[_0x145d9d(0xdc)](_0x4b83fa)[_0x145d9d(0xf8)](_0x298496[_0x145d9d(0x10e)]),_0x30047d=_0x298496['IPrWb'](randomBytes,0x10)['toString'](_0x298496['EPETQ']),_0x2e19d7=new URL(_0x427813['authorization_endpoint']);_0x2e19d7[_0x145d9d(0x12f)][_0x145d9d(0x149)](_0x145d9d(0x127),'code'),_0x2e19d7[_0x145d9d(0x12f)]['set'](_0x298496['VxzZJ'],_0x5a2f03),_0x2e19d7['searchParams'][_0x145d9d(0x149)](_0x298496['tUaOH'],_0x145d9d(0xdd)+CALLBACK_PORT+'/callback'),_0x2e19d7[_0x145d9d(0x12f)][_0x145d9d(0x149)](_0x298496['SFiri'],_0x31a12c),_0x2e19d7[_0x145d9d(0x12f)]['set']('code_challenge_method',_0x298496['QDOfN']),_0x2e19d7['searchParams'][_0x145d9d(0x149)](_0x145d9d(0xc0),_0x30047d);_0x47d038['resource']&&_0x2e19d7[_0x145d9d(0x12f)]['set']('resource',_0x47d038['resource']);console[_0x145d9d(0x159)](_0x145d9d(0x133)),console['log'](_0x145d9d(0xca)+_0x2e19d7[_0x145d9d(0xd9)]()+'\x0a'),await openBrowser(_0x2e19d7[_0x145d9d(0xd9)]());const _0x754eab=await _0x298496[_0x145d9d(0x110)](waitForCallback,_0x30047d);process['stdout']['write']('Exchanging\x20authorization\x20code...');const _0x37fd95=new URLSearchParams({'grant_type':_0x145d9d(0xc6),'code':_0x754eab,'redirect_uri':'http://localhost:'+CALLBACK_PORT+_0x145d9d(0xcb),'client_id':_0x5a2f03,'code_verifier':_0x4b83fa});_0xeadb2f&&_0x37fd95['set'](_0x145d9d(0x14b),_0xeadb2f);_0x47d038['resource']&&_0x37fd95['set'](_0x298496['pmLeg'],_0x47d038[_0x145d9d(0x15a)]);const _0xb3f1c1=await fetch(_0x427813['token_endpoint'],{'method':_0x298496[_0x145d9d(0x13f)],'headers':{'Content-Type':_0x145d9d(0xd2)},'body':_0x37fd95});if(!_0xb3f1c1['ok']){const _0x36cfc5=await _0xb3f1c1[_0x145d9d(0x134)]();throw new Error(_0x145d9d(0xfb)+_0x36cfc5);}const _0x2bc26d=await _0xb3f1c1[_0x145d9d(0x154)]();return console['log'](_0x298496['DckUU']),await _0x298496[_0x145d9d(0xff)](saveCachedToken,_0x2bc26d['access_token'],_0x2bc26d['refresh_token'],_0x2bc26d[_0x145d9d(0x122)]),_0x2bc26d[_0x145d9d(0xbe)];}async function callGetCliToken(_0x3463c3,_0x321c6f){const _0x28a054=_0x1062a6,_0x3070e5={'RHivM':function(_0x4007d5,_0x12f183,_0x3f9b2c){return _0x4007d5(_0x12f183,_0x3f9b2c);},'qaMEV':_0x28a054(0x100),'eXkAL':_0x28a054(0x14f),'dhrfb':_0x28a054(0x114),'oaEoD':function(_0x3ead66,_0x47dfc9){return _0x3ead66(_0x47dfc9);},'GwYKY':_0x28a054(0x139),'DjdNf':'\x20done','MgOfy':function(_0x1cdb4b,_0xba6264,_0x54f3a7){return _0x1cdb4b(_0xba6264,_0x54f3a7);},'iFBpg':'POST','EJrGh':'Requesting\x20CLI\x20token...','nlPZh':'2.0','trAwA':'\x0aUnexpected\x20response\x20structure:','plLDe':_0x28a054(0x125),'YfNOM':_0x28a054(0x131),'lZCFA':function(_0x33421c,_0x34dc6c,_0x1272a1){return _0x33421c(_0x34dc6c,_0x1272a1);},'hLPLK':_0x28a054(0x12a),'QmyAY':_0x28a054(0xfd)},_0x38332e={'Content-Type':_0x3070e5['qaMEV'],'Accept':_0x28a054(0xed)};_0x321c6f&&(_0x38332e[_0x3070e5['eXkAL']]=_0x28a054(0x140)+_0x321c6f);const _0x2a2c43=async _0x4af292=>{const _0x30fbc0=_0x28a054,_0x2b7cef=await _0x3070e5[_0x30fbc0(0xc2)](fetch,_0x3463c3,{'method':'POST','headers':_0x38332e,'body':JSON[_0x30fbc0(0xdf)](_0x4af292)});if(!_0x2b7cef['ok']){const _0x411fb4=await _0x2b7cef[_0x30fbc0(0x134)]();throw new Error('HTTP\x20'+_0x2b7cef[_0x30fbc0(0x145)]+':\x20'+_0x411fb4);}return parseResponse(_0x2b7cef);};process['stdout'][_0x28a054(0xe3)](_0x3070e5['dhrfb']);const _0x15d972=await _0x3070e5[_0x28a054(0xe2)](_0x2a2c43,{'jsonrpc':_0x28a054(0x11c),'id':0x1,'method':'initialize','params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x3070e5[_0x28a054(0x10b)]}}});if(_0x15d972[_0x28a054(0xdb)])throw new Error(_0x28a054(0x13d)+(_0x15d972['error'][_0x28a054(0x13c)]??JSON[_0x28a054(0xdf)](_0x15d972['error'])));console['log'](_0x3070e5['DjdNf']),await _0x3070e5[_0x28a054(0xd4)](fetch,_0x3463c3,{'method':_0x3070e5['iFBpg'],'headers':_0x38332e,'body':JSON[_0x28a054(0xdf)]({'jsonrpc':'2.0','method':_0x28a054(0xc7)})})['then'](_0x4fe4ce=>_0x4fe4ce[_0x28a054(0x134)]()),process[_0x28a054(0x14e)]['write'](_0x3070e5[_0x28a054(0x143)]);const _0x1db742=await _0x2a2c43({'jsonrpc':_0x3070e5[_0x28a054(0xfe)],'id':0x2,'method':_0x28a054(0x105),'params':{'name':'get_cli_token','arguments':{}}});if(_0x1db742[_0x28a054(0xdb)])throw new Error(_0x28a054(0x135)+(_0x1db742[_0x28a054(0xdb)][_0x28a054(0x13c)]??JSON[_0x28a054(0xdf)](_0x1db742['error'])));console['log'](_0x28a054(0x111));const _0xcb04da=extractToken(_0x1db742[_0x28a054(0x14c)]);if(!_0xcb04da){console[_0x28a054(0xdb)](_0x3070e5[_0x28a054(0x11a)]),console['error'](JSON[_0x28a054(0xdf)](_0x1db742[_0x28a054(0x14c)],null,0x2));throw new Error(_0x3070e5['plLDe']);}const _0x5f298f=_0x3070e5[_0x28a054(0xd4)](join,homedir(),_0x3070e5[_0x28a054(0xe9)]),_0x1ea3c2=join(_0x5f298f,_0x28a054(0x142));await mkdir(_0x5f298f,{'recursive':!![]}),await writeFile(_0x1ea3c2,_0xcb04da,{'mode':0x180}),await writeFile(_0x3070e5[_0x28a054(0x129)](join,_0x5f298f,_0x3070e5[_0x28a054(0x14d)]),_0x3463c3,{'mode':0x180}),console[_0x28a054(0x159)]('\x0aToken\x20written\x20to\x20'+_0x1ea3c2),console[_0x28a054(0x159)](_0x3070e5[_0x28a054(0x144)]);}async function fetchAuthServerMetadata(_0xe9c903){const _0x7db6a0=_0x1062a6,_0x4743e0={'AKnRw':function(_0xc1aa66,_0x560bfd){return _0xc1aa66(_0x560bfd);}},_0x1640d2=_0xe9c903+'/.well-known/oauth-authorization-server',_0x51eace=await _0x4743e0['AKnRw'](fetch,_0x1640d2);if(!_0x51eace['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x1640d2+':\x20'+_0x51eace[_0x7db6a0(0x145)]);return _0x51eace[_0x7db6a0(0x154)]();}function waitForCallback(_0x555ecb){const _0x4a36b6=_0x1062a6,_0x4444d1={'tuWff':function(_0x1b9526,_0x4cb111){return _0x1b9526!==_0x4cb111;},'ysuvY':_0x4a36b6(0xcb),'EQACP':'code','hfqpd':function(_0x2cdaa9,_0x5ee427){return _0x2cdaa9(_0x5ee427);},'Qwhnv':'<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','IPVGU':'text/html','jzQHz':_0x4a36b6(0x136),'vAHjO':function(_0x37afaa){return _0x37afaa();},'MBSpC':function(_0x52ee8d,_0x3853b5,_0x2a69ee){return _0x52ee8d(_0x3853b5,_0x2a69ee);},'UPMvO':'127.0.0.1'};return new Promise((_0x57c29c,_0x2750b6)=>{const _0x306158=_0x4a36b6,_0xa7a998={'fEYKi':function(_0x3b78a4,_0xe307ff){return _0x3b78a4(_0xe307ff);}},_0x2cb839=()=>{const _0x2b8ba0=_0x4710;_0x523d4e['closeAllConnections'](),_0x523d4e[_0x2b8ba0(0x124)]();},_0x2e0d52=_0x4444d1[_0x306158(0x15b)](setTimeout,()=>{const _0x558751=_0x306158;_0x2cb839(),_0xa7a998[_0x558751(0xc9)](_0x2750b6,new OAuthTimeoutError('OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes'));},0x1d4c0),_0x523d4e=createServer((_0x480bbe,_0x3d7ceb)=>{const _0x997762=_0x306158,_0x18c418=new URL(_0x480bbe[_0x997762(0x158)]??'/',_0x997762(0xdd)+CALLBACK_PORT);if(_0x4444d1[_0x997762(0x118)](_0x18c418[_0x997762(0x155)],_0x4444d1[_0x997762(0x10d)])){_0x3d7ceb[_0x997762(0x128)](0x194),_0x3d7ceb[_0x997762(0xe6)](_0x997762(0x11b));return;}const _0x53a147=_0x18c418[_0x997762(0x12f)][_0x997762(0xe1)](_0x4444d1[_0x997762(0x13e)]),_0x5d0e5d=_0x18c418[_0x997762(0x12f)]['get'](_0x997762(0xc0)),_0x25b177=_0x18c418['searchParams']['get']('error');if(_0x25b177){const _0x3571ee=_0x18c418['searchParams']['get']('error_description')??_0x25b177;_0x3d7ceb['writeHead'](0xc8,{'Content-Type':_0x997762(0x138)}),_0x3d7ceb[_0x997762(0xe6)]('<html><body><h2>Authentication\x20failed</h2><p>'+_0x3571ee+_0x997762(0x108)),clearTimeout(_0x2e0d52),_0x2cb839(),_0x4444d1['hfqpd'](_0x2750b6,new Error('OAuth\x20error:\x20'+_0x3571ee));return;}if(!_0x53a147||_0x4444d1[_0x997762(0x118)](_0x5d0e5d,_0x555ecb)){_0x3d7ceb['writeHead'](0x190,{'Content-Type':_0x997762(0x138)}),_0x3d7ceb['end'](_0x4444d1[_0x997762(0xea)]);return;}_0x3d7ceb[_0x997762(0x128)](0xc8,{'Content-Type':_0x4444d1['IPVGU']}),_0x3d7ceb['end'](_0x4444d1[_0x997762(0xe0)]),clearTimeout(_0x2e0d52),_0x4444d1[_0x997762(0x115)](_0x2cb839),_0x4444d1[_0x997762(0xf3)](_0x57c29c,_0x53a147);});_0x523d4e[_0x306158(0xda)](CALLBACK_PORT,_0x4444d1[_0x306158(0xce)]);});}async function openBrowser(_0xe77537){const _0x398790=_0x1062a6,_0x3c6fe1={'rzNpI':function(_0x5cfd40,_0x2ab5ff){return _0x5cfd40===_0x2ab5ff;},'lpAHq':_0x398790(0x13b),'uzyCW':_0x398790(0x146),'LjMTl':_0x398790(0xec),'akBcU':function(_0x57d1a4,_0x342162){return _0x57d1a4(_0x342162);}},_0x25441b=_0x3c6fe1[_0x398790(0xf1)](process['platform'],_0x3c6fe1[_0x398790(0xde)])?_0x398790(0xeb):_0x3c6fe1[_0x398790(0xf1)](process[_0x398790(0x15f)],'win32')?_0x3c6fe1[_0x398790(0x116)]:_0x3c6fe1['LjMTl'];_0x3c6fe1[_0x398790(0x126)](exec,_0x25441b+'\x20\x22'+_0xe77537+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x4ebd1e=_0x1062a6;try{const _0x381062=JSON[_0x4ebd1e(0x106)](await readFile(TOKEN_CACHE_PATH,_0x4ebd1e(0x151)));if(_0x381062[_0x4ebd1e(0xf6)]&&_0x381062[_0x4ebd1e(0xf6)]!==currentOrigin)return null;if(_0x381062['expiresAt']&&Date[_0x4ebd1e(0xf7)]()>_0x381062['expiresAt'])return null;return _0x381062['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0x23f1e3,_0x39fa75,_0x1a8057){const _0x4fa532=_0x1062a6,_0x3934a3={'pBQoe':function(_0x3f8746){return _0x3f8746();},'ueGsD':function(_0x1ba196,_0x4f5288){return _0x1ba196*_0x4f5288;},'BNwAy':function(_0x9515f0,_0x2a5bab,_0x4764ff){return _0x9515f0(_0x2a5bab,_0x4764ff);},'KAKhK':function(_0x2b88b3,_0x3be585,_0xcd2ba8,_0x399581){return _0x2b88b3(_0x3be585,_0xcd2ba8,_0x399581);}},_0x55f63c=await _0x3934a3[_0x4fa532(0x12d)](loadCachedData),_0x3a9521={..._0x55f63c,'origin':currentOrigin,'accessToken':_0x23f1e3,'refreshToken':_0x39fa75??_0x55f63c?.['refreshToken'],'expiresAt':_0x1a8057?Date['now']()+_0x3934a3['ueGsD'](_0x1a8057,0x3e8):undefined};await _0x3934a3[_0x4fa532(0x12c)](mkdir,join(_0x3934a3['pBQoe'](homedir),'.ranger'),{'recursive':!![]}),await _0x3934a3['KAKhK'](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x3a9521),{'mode':0x180});}async function loadCachedClient(){const _0x45721f=_0x1062a6,_0x488e92={'VClld':function(_0x3d3412){return _0x3d3412();},'gpWmR':function(_0x5bbd28,_0x50b275){return _0x5bbd28!==_0x50b275;}},_0x59e25c=await _0x488e92['VClld'](loadCachedData);if(_0x59e25c?.['origin']&&_0x488e92['gpWmR'](_0x59e25c['origin'],currentOrigin))return null;return _0x59e25c?.['clientId']?{'clientId':_0x59e25c['clientId'],'clientSecret':_0x59e25c[_0x45721f(0xc3)]}:null;}function _0x4710(_0x2b6555,_0xeb52a1){_0x2b6555=_0x2b6555-0xbe;const _0x4af47d=_0x4af4();let _0x4710ea=_0x4af47d[_0x2b6555];return _0x4710ea;}async function clearCachedClient(){const _0xf551a6=_0x1062a6,_0x47fcec=await loadCachedData();if(!_0x47fcec)return;const {clientId:_0xd95fdd,clientSecret:_0x1ea73e,..._0x2ce0c8}=_0x47fcec;await writeFile(TOKEN_CACHE_PATH,JSON[_0xf551a6(0xdf)](_0x2ce0c8),{'mode':0x180});}async function saveCachedClient(_0x20b9e9,_0x4449ad){const _0x125497=_0x1062a6,_0x4df23b={'prVrt':function(_0x2652fc,_0x3b34c5,_0x4bce48){return _0x2652fc(_0x3b34c5,_0x4bce48);},'WnSdc':function(_0x550e94){return _0x550e94();},'TixVA':function(_0x3dd53f,_0x4daa9f,_0x3653cc,_0x431a4e){return _0x3dd53f(_0x4daa9f,_0x3653cc,_0x431a4e);}},_0x319325=await loadCachedData(),_0x5c405b={..._0x319325,'origin':currentOrigin,'accessToken':_0x319325?.[_0x125497(0x15c)]??'','clientId':_0x20b9e9,'clientSecret':_0x4449ad};await _0x4df23b[_0x125497(0xd8)](mkdir,join(_0x4df23b[_0x125497(0xd7)](homedir),'.ranger'),{'recursive':!![]}),await _0x4df23b[_0x125497(0x156)](writeFile,TOKEN_CACHE_PATH,JSON[_0x125497(0xdf)](_0x5c405b),{'mode':0x180});}async function loadCachedData(){const _0x69981d=_0x1062a6,_0x3ed205={'VeeAr':function(_0x2a3848,_0x5c9cc7,_0x468988){return _0x2a3848(_0x5c9cc7,_0x468988);}};try{return JSON[_0x69981d(0x106)](await _0x3ed205[_0x69981d(0xc8)](readFile,TOKEN_CACHE_PATH,_0x69981d(0x151)));}catch{return null;}}async function parseResponse(_0x12c97a){const _0x1182fb=_0x1062a6,_0xb0d42b={'lSGJj':'text/event-stream','UxrzQ':_0x1182fb(0x12b)},_0x13c0f8=_0x12c97a['headers'][_0x1182fb(0xe1)](_0x1182fb(0x11f))??'';if(_0x13c0f8[_0x1182fb(0x11e)](_0xb0d42b['lSGJj'])){const _0x5730af=await _0x12c97a['text']();for(const _0x4887f8 of _0x5730af['split']('\x0a')){const _0x39268c=_0x4887f8[_0x1182fb(0xef)]();if(_0x39268c['startsWith'](_0x1182fb(0x12b))){const _0x2b1d54=_0x39268c['slice'](_0xb0d42b[_0x1182fb(0xf2)][_0x1182fb(0xc4)])[_0x1182fb(0xef)]();if(!_0x2b1d54)continue;try{const _0x1ff33b=JSON['parse'](_0x2b1d54);if(_0x1ff33b['id']!==undefined||_0x1ff33b['error'])return _0x1ff33b;}catch{}}}throw new Error('No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream');}return _0x12c97a[_0x1182fb(0x154)]();}function extractToken(_0x2d4dc6){const _0x10b79a=_0x1062a6,_0x480d32={'ACjRr':function(_0x4c5599,_0x2113d3){return _0x4c5599===_0x2113d3;},'WYxav':_0x10b79a(0x134)};if(!_0x2d4dc6)return null;const _0x2376eb=_0x2d4dc6[_0x10b79a(0x104)];if(_0x2376eb?.['token']&&_0x480d32[_0x10b79a(0x148)](typeof _0x2376eb['token'],'string'))return _0x2376eb[_0x10b79a(0xd5)];if(_0x2d4dc6[_0x10b79a(0xf9)]){const _0x22a2e9=_0x2d4dc6['content'];throw new Error('Server\x20returned\x20error:\x20'+(_0x22a2e9?.[0x0]?.[_0x10b79a(0x134)]??_0x10b79a(0x101)));}const _0x11e8c3=_0x2d4dc6['content'];if(_0x11e8c3)for(const _0x1c66af of _0x11e8c3){if(_0x1c66af[_0x10b79a(0xe5)]===_0x480d32[_0x10b79a(0x112)]&&_0x1c66af[_0x10b79a(0x134)]){try{const _0x5aca94=JSON[_0x10b79a(0x106)](_0x1c66af['text']);if(typeof _0x5aca94?.['token']==='string')return _0x5aca94[_0x10b79a(0xd5)];}catch{}const _0x128b19=_0x1c66af[_0x10b79a(0x134)][_0x10b79a(0x119)](/(rngr_[A-Za-z0-9_-]+)/);if(_0x128b19)return _0x128b19[0x1];}}return null;}
@@ -1 +1 @@
1
- function _0x592f(_0x5a293b,_0x3c8e67){_0x5a293b=_0x5a293b-0x137;var _0x505228=_0x5052();var _0x592f5a=_0x505228[_0x5a293b];return _0x592f5a;}(function(_0x2401c1,_0x22254a){var _0x6091b0=_0x592f,_0x586a80=_0x2401c1();while(!![]){try{var _0x2bce83=parseInt(_0x6091b0(0x13f))/0x1+parseInt(_0x6091b0(0x137))/0x2+-parseInt(_0x6091b0(0x140))/0x3*(parseInt(_0x6091b0(0x142))/0x4)+parseInt(_0x6091b0(0x143))/0x5+parseInt(_0x6091b0(0x145))/0x6*(-parseInt(_0x6091b0(0x146))/0x7)+-parseInt(_0x6091b0(0x138))/0x8*(parseInt(_0x6091b0(0x13d))/0x9)+parseInt(_0x6091b0(0x13c))/0xa;if(_0x2bce83===_0x22254a)break;else _0x586a80['push'](_0x586a80['shift']());}catch(_0x1fce98){_0x586a80['push'](_0x586a80['shift']());}}}(_0x5052,0x216d8));export async function migrateProfile(_0x575ac6,_0x354c1f){var _0x157eb8=_0x592f,_0x5a46fa={'oygYg':function(_0x31c5d3,_0x2720b8){return _0x31c5d3+_0x2720b8;},'IIpZn':function(_0x59f3b1,_0x581293){return _0x59f3b1+_0x581293;},'qftZf':_0x157eb8(0x144),'nKzww':'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','enBKO':'Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a','EBqdW':'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.'};console['error'](_0x5a46fa[_0x157eb8(0x13b)](_0x5a46fa[_0x157eb8(0x139)](_0x5a46fa['IIpZn'](_0x5a46fa['IIpZn']('ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','\x0a'),_0x5a46fa['qftZf'])+_0x5a46fa[_0x157eb8(0x13a)],'\x0a')+'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a')+'\x0a'+_0x5a46fa['enBKO']+_0x5a46fa[_0x157eb8(0x141)]),process[_0x157eb8(0x13e)](0x1);}function _0x5052(){var _0x269526=['847TqaHwt','283660MsWZQj','232XQwGGE','IIpZn','nKzww','oygYg','822660DmknwZ','76851tlzwpx','exit','259717lLsUoj','9qrKlgU','EBqdW','62164FEtaFk','778010UVtjyR','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','10326qFQcCE'];_0x5052=function(){return _0x269526;};return _0x5052();}
1
+ function _0x5c89(_0x386599,_0x523dcd){_0x386599=_0x386599-0x1e0;var _0x2038e0=_0x2038();var _0x5c891e=_0x2038e0[_0x386599];return _0x5c891e;}(function(_0x3d417b,_0x95c047){var _0x45084d=_0x5c89,_0x3066ac=_0x3d417b();while(!![]){try{var _0xf72646=-parseInt(_0x45084d(0x1e4))/0x1*(parseInt(_0x45084d(0x1e8))/0x2)+parseInt(_0x45084d(0x1e2))/0x3*(-parseInt(_0x45084d(0x1f0))/0x4)+-parseInt(_0x45084d(0x1f1))/0x5+-parseInt(_0x45084d(0x1ea))/0x6*(-parseInt(_0x45084d(0x1f2))/0x7)+-parseInt(_0x45084d(0x1e1))/0x8+parseInt(_0x45084d(0x1ec))/0x9+parseInt(_0x45084d(0x1ef))/0xa*(parseInt(_0x45084d(0x1eb))/0xb);if(_0xf72646===_0x95c047)break;else _0x3066ac['push'](_0x3066ac['shift']());}catch(_0x2af4d4){_0x3066ac['push'](_0x3066ac['shift']());}}}(_0x2038,0x39ae5));function _0x2038(){var _0x1aee13=['fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.','MqPZq','204880VDCASI','exit','12FFamMf','1984477vZxMAo','1307367GFrVTq','error','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','50JpwaRr','68qGDBnA','1895040cHfvip','412349DKpiOT','TEroq','392080NACExz','52227LiiGaJ','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','2UEbsOL','\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a'];_0x2038=function(){return _0x1aee13;};return _0x2038();}export async function migrateProfile(_0x299c57,_0x483f6d){var _0x47b6eb=_0x5c89,_0x38e752={'TEroq':function(_0xe2bb66,_0xe19ff7){return _0xe2bb66+_0xe19ff7;},'CSsdE':function(_0x548a45,_0x5b9261){return _0x548a45+_0x5b9261;},'MqPZq':_0x47b6eb(0x1e3)};console[_0x47b6eb(0x1ed)](_0x38e752[_0x47b6eb(0x1e0)](_0x38e752['CSsdE']('ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a'+'\x0a'+_0x47b6eb(0x1ee)+_0x38e752[_0x47b6eb(0x1e7)]+'\x0a'+'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a',_0x47b6eb(0x1e5))+'\x0a','Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a')+_0x47b6eb(0x1e6)),process[_0x47b6eb(0x1e9)](0x1);}
@@ -1 +1 @@
1
- (function(_0x12302f,_0x33d0d2){const _0x167796=_0x2208,_0x3df60b=_0x12302f();while(!![]){try{const _0x2dfd4f=-parseInt(_0x167796(0x151))/0x1*(parseInt(_0x167796(0x15a))/0x2)+-parseInt(_0x167796(0x14a))/0x3+parseInt(_0x167796(0x12f))/0x4*(-parseInt(_0x167796(0x152))/0x5)+parseInt(_0x167796(0x154))/0x6+-parseInt(_0x167796(0x143))/0x7+parseInt(_0x167796(0x133))/0x8+parseInt(_0x167796(0x15d))/0x9;if(_0x2dfd4f===_0x33d0d2)break;else _0x3df60b['push'](_0x3df60b['shift']());}catch(_0x31385c){_0x3df60b['push'](_0x3df60b['shift']());}}}(_0x32b3,0xa4fbb));import{join}from'path';import{existsSync}from'fs';import _0xa97010 from'inquirer';import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';function _0x2208(_0x3c3060,_0x36177e){_0x3c3060=_0x3c3060-0x12a;const _0x32b3e9=_0x32b3();let _0x220874=_0x32b3e9[_0x3c3060];return _0x220874;}export async function ensureClaudePlugin(_0x2b3d66){const _0x473845=_0x2208,_0xd16d95={'mOrns':function(_0xb7debb,_0x3bfaba){return _0xb7debb(_0x3bfaba);},'MQaYn':_0x473845(0x13d),'YhtSJ':'✓\x20Claude\x20Code\x20plugin\x20already\x20installed','kGLSS':function(_0x1a9d07){return _0x1a9d07();},'rWzvm':_0x473845(0x153),'TiGli':'\x0a📦\x20Claude\x20Code\x20Plugin\x0a','EKLIh':_0x473845(0x15b),'jXTTg':_0x473845(0x158),'cAZBw':'Project\x20(shared\x20with\x20team\x20via\x20git)','oRois':function(_0x17ddb6,_0x54d5bf){return _0x17ddb6(_0x54d5bf);},'gFBDn':_0x473845(0x159),'cBwdr':_0x473845(0x15e),'NxtuI':_0x473845(0x134),'EPSKQ':_0x473845(0x13a),'UNhBa':_0x473845(0x142),'yrUGY':function(_0x9b4735,_0x184617,_0x366565){return _0x9b4735(_0x184617,_0x366565);},'xlSSU':'plugin','tqmRJ':function(_0x568eff){return _0x568eff();},'gyzVE':_0x473845(0x12d),'ZmPLS':_0x473845(0x15c),'qwoop':function(_0x3eb59b,_0x351690){return _0x3eb59b===_0x351690;},'txWtq':'--scope','yxjos':function(_0x53a064){return _0x53a064();},'fxndH':'already\x20enabled','fqRUa':'⚠\x20Failed\x20to\x20enable\x20plugin:','ZrQww':'✓\x20Claude\x20Code\x20plugin\x20enabled'},_0x1abd04=await _0xd16d95[_0x473845(0x14e)](isPluginInstalled,_0xd16d95['MQaYn']);if(_0x1abd04)return console['log'](_0xd16d95[_0x473845(0x14c)]),![];const _0x3e143e=_0xd16d95['mOrns'](existsSync,join(_0xd16d95[_0x473845(0x12e)](getProjectRoot),'.claude'));let _0x2f954c;if(_0x2b3d66)_0x2f954c=_0x2b3d66;else{if(_0x3e143e)_0x2f954c=_0xd16d95['rWzvm'];else{console['log'](_0xd16d95[_0x473845(0x163)]);const _0x3a235b=await _0xa97010['prompt']([{'type':'list','name':_0xd16d95['EKLIh'],'message':_0x473845(0x14d),'choices':[{'name':'User\x20(available\x20in\x20all\x20your\x20projects)','value':_0xd16d95[_0x473845(0x14b)]},{'name':_0xd16d95[_0x473845(0x137)],'value':'project'}],'default':_0x473845(0x158)}]);_0x2f954c=_0x3a235b[_0x473845(0x15b)];}}console['log'](_0x473845(0x15f)+_0x2f954c+_0x473845(0x138));const _0x282334=await _0xd16d95[_0x473845(0x162)](isMarketplaceAdded,'trailhead');let _0x2a2c06=_0x282334;if(_0x282334)console[_0x473845(0x14f)](_0xd16d95[_0x473845(0x156)]);else{const _0x4ae76d=await runClaudeCommand(['plugin',_0xd16d95['cBwdr'],_0xd16d95['NxtuI'],_0xd16d95['EPSKQ']]);!_0x4ae76d[_0x473845(0x12a)]?(console[_0x473845(0x160)](_0x473845(0x155),_0x4ae76d['error']),console[_0x473845(0x14f)]('\x0aYou\x20can\x20install\x20manually\x20with:'),console['log'](_0xd16d95[_0x473845(0x149)]),console[_0x473845(0x14f)](_0x473845(0x13f)+_0x2f954c)):_0x2a2c06=!![];}if(_0x2a2c06){const _0x25f92e=await _0xd16d95[_0x473845(0x12c)](runClaudeCommand,[_0xd16d95['xlSSU'],'install',_0x473845(0x13d),_0x473845(0x136),_0x2f954c],{'cwd':_0x2f954c===_0x473845(0x153)?_0xd16d95[_0x473845(0x13c)](getProjectRoot):undefined});if(!_0x25f92e[_0x473845(0x12a)])console[_0x473845(0x160)](_0xd16d95[_0x473845(0x146)],_0x25f92e[_0x473845(0x160)]),console[_0x473845(0x14f)](_0x473845(0x135)),console['log'](_0x473845(0x13f)+_0x2f954c);else{console[_0x473845(0x14f)]('✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully');const _0x402cd3=['plugin',_0xd16d95[_0x473845(0x130)],_0xd16d95['MQaYn']];_0xd16d95[_0x473845(0x144)](_0x2f954c,_0x473845(0x153))&&_0x402cd3['push'](_0xd16d95[_0x473845(0x145)],'project');const _0x40c236=await runClaudeCommand(_0x402cd3,{'captureOutput':!![],'cwd':_0xd16d95[_0x473845(0x144)](_0x2f954c,_0xd16d95[_0x473845(0x147)])?_0xd16d95['yxjos'](getProjectRoot):undefined}),_0x5cae83=_0x40c236[_0x473845(0x12b)]?.['includes'](_0xd16d95[_0x473845(0x139)]);!_0x40c236['success']&&!_0x5cae83?console['error'](_0xd16d95['fqRUa'],_0x40c236['error']):console[_0x473845(0x14f)](_0xd16d95['ZrQww']);}}return!![];}export async function ensureClaudeSkills(_0x36f164){const _0x38697b=_0x2208,_0x5577d8={'iWgJO':function(_0x464227,_0x2858e0){return _0x464227(_0x2858e0);},'bwiva':function(_0x227445,_0x338aa2){return _0x227445(_0x338aa2);},'tSHlZ':'SKILL.md','JksgX':_0x38697b(0x140),'gPnTV':function(_0x5adb13,_0x10dae2){return _0x5adb13(_0x10dae2);},'WnTCJ':_0x38697b(0x153),'rAjLC':_0x38697b(0x141)},_0x3864d4=_0x5577d8[_0x38697b(0x150)](existsSync,join(getSkillsDir('user'),'ranger',_0x38697b(0x13b))),_0x1069ce=_0x5577d8[_0x38697b(0x131)](existsSync,join(getSkillsDir('project'),'ranger',_0x5577d8[_0x38697b(0x157)]));if(_0x3864d4||_0x1069ce)return console[_0x38697b(0x14f)](_0x5577d8[_0x38697b(0x161)]),![];const _0x2f721a=_0x5577d8['gPnTV'](existsSync,join(getProjectRoot(),_0x38697b(0x132)));let _0xeda2b0=!![];if(_0x36f164)await skillup({'autoInstall':_0x36f164,'suppressUsage':!![]});else{if(_0x2f721a)await _0x5577d8[_0x38697b(0x150)](skillup,{'autoInstall':_0x5577d8['WnTCJ'],'suppressUsage':!![]});else{const _0x4af997=await _0xa97010['prompt']([{'type':'confirm','name':_0x38697b(0x148),'message':_0x5577d8[_0x38697b(0x13e)],'default':!![]}]);_0xeda2b0=_0x4af997[_0x38697b(0x148)],_0xeda2b0&&await skillup({'suppressUsage':!![]});}}return _0xeda2b0;}function _0x32b3(){const _0xb0e38e=['project','2786532qmYsFC','❌\x20Failed\x20to\x20add\x20marketplace:','gFBDn','tSHlZ','user','✓\x20Marketplace\x20already\x20added','2QDqBJm','pluginScope','enable','32194746wakDiJ','marketplace','\x0aInstalling\x20Claude\x20Code\x20plugin\x20(','error','JksgX','oRois','TiGli','success','output','yrUGY','❌\x20Failed\x20to\x20install\x20plugin:','kGLSS','3375628RcSOxv','ZmPLS','bwiva','.claude','1348424isqUHt','add','\x0aYou\x20can\x20install\x20manually\x20with:','--scope','cAZBw','\x20level)...\x0a','fxndH','ranger-testing/trailhead','SKILL.md','tqmRJ','ranger@trailhead','rAjLC','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','✓\x20Ranger\x20skills\x20already\x20installed','Would\x20you\x20like\x20to\x20install\x20skills?','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','4369134puQXZW','qwoop','txWtq','gyzVE','rWzvm','wantsSkillup','UNhBa','2161968mDcoEK','jXTTg','YhtSJ','Where\x20should\x20the\x20plugin\x20be\x20installed?','mOrns','log','iWgJO','1345673qghIXG','5gOIHSP'];_0x32b3=function(){return _0xb0e38e;};return _0x32b3();}
1
+ (function(_0xf32bce,_0x10f11b){const _0x2728b5=_0x460f,_0x3cefd9=_0xf32bce();while(!![]){try{const _0x363a2e=parseInt(_0x2728b5(0x1fc))/0x1*(-parseInt(_0x2728b5(0x204))/0x2)+-parseInt(_0x2728b5(0x1f4))/0x3*(parseInt(_0x2728b5(0x21b))/0x4)+-parseInt(_0x2728b5(0x209))/0x5*(-parseInt(_0x2728b5(0x1fe))/0x6)+parseInt(_0x2728b5(0x216))/0x7+-parseInt(_0x2728b5(0x1ef))/0x8*(-parseInt(_0x2728b5(0x203))/0x9)+parseInt(_0x2728b5(0x1f2))/0xa*(parseInt(_0x2728b5(0x218))/0xb)+-parseInt(_0x2728b5(0x200))/0xc;if(_0x363a2e===_0x10f11b)break;else _0x3cefd9['push'](_0x3cefd9['shift']());}catch(_0xad3ab3){_0x3cefd9['push'](_0x3cefd9['shift']());}}}(_0x38e1,0xbf0ec));import{join}from'path';import{existsSync}from'fs';import _0x3e3ac7 from'inquirer';import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';function _0x460f(_0x23d69d,_0x294b65){_0x23d69d=_0x23d69d-0x1eb;const _0x38e130=_0x38e1();let _0x460f55=_0x38e130[_0x23d69d];return _0x460f55;}import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';function _0x38e1(){const _0xb11143=['trailhead','list','✓\x20Ranger\x20skills\x20already\x20installed','pluginScope','User\x20(available\x20in\x20all\x20your\x20projects)','❌\x20Failed\x20to\x20install\x20plugin:','nIxqa','vVlaA','7573286LwryQd','dvdNF','131065gEyuwY','error','aGsUP','277124fyvyqp','Where\x20should\x20the\x20plugin\x20be\x20installed?','prompt','ranger-testing/trailhead','JGLEO','mhuhI','tGEMy','MVHJs','IPuXI','ranger','\x20level)...\x0a','vAtUR','success','19520mfffCe','lKgKE','\x0aInstalling\x20Claude\x20Code\x20plugin\x20(','1290efeKPf','xzywY','3SXvyjW','enable','plugin','push','VfbVR','RTpUQ','QDsEq','.claude','1BOthBp','includes','2178762pNkiFu','output','26833992KjoqDD','UDjJb','aUGHv','4365KqPxji','2881136jFHtTG','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','rFpId','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','log','10fIySzU','project','JlpYM','user','✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully'];_0x38e1=function(){return _0xb11143;};return _0x38e1();}export async function ensureClaudePlugin(_0x4652df){const _0x2f0e98=_0x460f,_0x39dbf7={'RTpUQ':'ranger@trailhead','lKgKE':'✓\x20Claude\x20Code\x20plugin\x20already\x20installed','QDsEq':function(_0x3f5d24,_0x2c35af){return _0x3f5d24(_0x2c35af);},'dvdNF':function(_0xf3225d,_0x4db3ed,_0x38ea22){return _0xf3225d(_0x4db3ed,_0x38ea22);},'aUGHv':_0x2f0e98(0x211),'vAtUR':_0x2f0e98(0x21c),'SRmCm':_0x2f0e98(0x20c),'VfbVR':'Project\x20(shared\x20with\x20team\x20via\x20git)','ulPXY':function(_0x48fa74,_0x4628f5){return _0x48fa74(_0x4628f5);},'tPYXt':_0x2f0e98(0x20e),'UYJCY':'✓\x20Marketplace\x20already\x20added','HrJZF':'marketplace','tGEMy':_0x2f0e98(0x21e),'JGLEO':function(_0x406033,_0x262c5d,_0x316e27){return _0x406033(_0x262c5d,_0x316e27);},'JlpYM':_0x2f0e98(0x1f6),'xzywY':function(_0x355789,_0x56f2af){return _0x355789===_0x56f2af;},'mhuhI':'\x0aYou\x20can\x20install\x20manually\x20with:','CiPdl':_0x2f0e98(0x20d),'IGaaM':function(_0x483122,_0x24d306){return _0x483122===_0x24d306;},'zzyJi':function(_0x1cbbca){return _0x1cbbca();},'UDjJb':'already\x20enabled'},_0xa28bd1=await isPluginInstalled(_0x39dbf7[_0x2f0e98(0x1f9)]);if(_0xa28bd1)return console['log'](_0x39dbf7[_0x2f0e98(0x1f0)]),![];const _0x14a63e=_0x39dbf7[_0x2f0e98(0x1fa)](existsSync,_0x39dbf7[_0x2f0e98(0x217)](join,getProjectRoot(),_0x2f0e98(0x1fb)));let _0x4f2275;if(_0x4652df)_0x4f2275=_0x4652df;else{if(_0x14a63e)_0x4f2275=_0x2f0e98(0x20a);else{console[_0x2f0e98(0x208)]('\x0a📦\x20Claude\x20Code\x20Plugin\x0a');const _0x315aab=await _0x3e3ac7[_0x2f0e98(0x21d)]([{'type':_0x2f0e98(0x20f),'name':_0x39dbf7[_0x2f0e98(0x202)],'message':_0x39dbf7[_0x2f0e98(0x1ed)],'choices':[{'name':_0x2f0e98(0x212),'value':_0x39dbf7['SRmCm']},{'name':_0x39dbf7[_0x2f0e98(0x1f8)],'value':'project'}],'default':'user'}]);_0x4f2275=_0x315aab['pluginScope'];}}console[_0x2f0e98(0x208)](_0x2f0e98(0x1f1)+_0x4f2275+_0x2f0e98(0x1ec));const _0x4e290e=await _0x39dbf7['ulPXY'](isMarketplaceAdded,_0x39dbf7['tPYXt']);let _0x5977f9=_0x4e290e;if(_0x4e290e)console['log'](_0x39dbf7['UYJCY']);else{const _0x57af24=await runClaudeCommand([_0x2f0e98(0x1f6),_0x39dbf7['HrJZF'],'add',_0x39dbf7[_0x2f0e98(0x221)]]);!_0x57af24[_0x2f0e98(0x1ee)]?(console['error']('❌\x20Failed\x20to\x20add\x20marketplace:',_0x57af24[_0x2f0e98(0x219)]),console[_0x2f0e98(0x208)]('\x0aYou\x20can\x20install\x20manually\x20with:'),console[_0x2f0e98(0x208)](_0x2f0e98(0x205)),console[_0x2f0e98(0x208)]('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x4f2275)):_0x5977f9=!![];}if(_0x5977f9){const _0x182fdc=await _0x39dbf7[_0x2f0e98(0x21f)](runClaudeCommand,[_0x39dbf7[_0x2f0e98(0x20b)],'install',_0x39dbf7['RTpUQ'],'--scope',_0x4f2275],{'cwd':_0x39dbf7[_0x2f0e98(0x1f3)](_0x4f2275,_0x2f0e98(0x20a))?getProjectRoot():undefined});if(!_0x182fdc[_0x2f0e98(0x1ee)])console['error'](_0x2f0e98(0x213),_0x182fdc[_0x2f0e98(0x219)]),console[_0x2f0e98(0x208)](_0x39dbf7[_0x2f0e98(0x220)]),console['log'](_0x2f0e98(0x207)+_0x4f2275);else{console['log'](_0x39dbf7['CiPdl']);const _0x5a7c09=['plugin',_0x2f0e98(0x1f5),_0x39dbf7[_0x2f0e98(0x1f9)]];_0x39dbf7['IGaaM'](_0x4f2275,'project')&&_0x5a7c09[_0x2f0e98(0x1f7)]('--scope',_0x2f0e98(0x20a));const _0x1b3cdf=await runClaudeCommand(_0x5a7c09,{'captureOutput':!![],'cwd':_0x4f2275===_0x2f0e98(0x20a)?_0x39dbf7['zzyJi'](getProjectRoot):undefined}),_0x31fc22=_0x1b3cdf[_0x2f0e98(0x1ff)]?.[_0x2f0e98(0x1fd)](_0x39dbf7[_0x2f0e98(0x201)]);!_0x1b3cdf[_0x2f0e98(0x1ee)]&&!_0x31fc22?console[_0x2f0e98(0x219)]('⚠\x20Failed\x20to\x20enable\x20plugin:',_0x1b3cdf['error']):console[_0x2f0e98(0x208)]('✓\x20Claude\x20Code\x20plugin\x20enabled');}}return!![];}export async function ensureClaudeSkills(_0x586d46){const _0x2828e8=_0x460f,_0x23e1c3={'vVlaA':function(_0x7f32da,_0x1c625e){return _0x7f32da(_0x1c625e);},'PJuPv':function(_0x34523d,_0x5299bb,_0x2c3ee5,_0x3602f7){return _0x34523d(_0x5299bb,_0x2c3ee5,_0x3602f7);},'BWpLR':'SKILL.md','IPuXI':_0x2828e8(0x210),'rFpId':function(_0xa8a1aa,_0x32b452,_0x9b1835){return _0xa8a1aa(_0x32b452,_0x9b1835);},'AbGOT':function(_0x33c630){return _0x33c630();},'MVHJs':'.claude','aGsUP':function(_0x154444,_0x177059){return _0x154444(_0x177059);},'nIxqa':function(_0x3c2ec8,_0xc9b1b3){return _0x3c2ec8(_0xc9b1b3);}},_0x49916e=_0x23e1c3[_0x2828e8(0x215)](existsSync,_0x23e1c3['PJuPv'](join,getSkillsDir('user'),'ranger',_0x23e1c3['BWpLR'])),_0x2efb59=_0x23e1c3[_0x2828e8(0x215)](existsSync,join(getSkillsDir('project'),_0x2828e8(0x1eb),'SKILL.md'));if(_0x49916e||_0x2efb59)return console[_0x2828e8(0x208)](_0x23e1c3[_0x2828e8(0x223)]),![];const _0x1a9c93=existsSync(_0x23e1c3[_0x2828e8(0x206)](join,_0x23e1c3['AbGOT'](getProjectRoot),_0x23e1c3[_0x2828e8(0x222)]));let _0x53977e=!![];if(_0x586d46)await skillup({'autoInstall':_0x586d46,'suppressUsage':!![]});else{if(_0x1a9c93)await _0x23e1c3[_0x2828e8(0x21a)](skillup,{'autoInstall':_0x2828e8(0x20a),'suppressUsage':!![]});else{const _0x4c61aa=await _0x3e3ac7['prompt']([{'type':'confirm','name':'wantsSkillup','message':'Would\x20you\x20like\x20to\x20install\x20skills?','default':!![]}]);_0x53977e=_0x4c61aa['wantsSkillup'],_0x53977e&&await _0x23e1c3[_0x2828e8(0x214)](skillup,{'suppressUsage':!![]});}}return _0x53977e;}
@@ -1 +1 @@
1
- (function(_0x3bd01b,_0x37f001){const _0x3482f1=_0x3f2f,_0x48f1a8=_0x3bd01b();while(!![]){try{const _0x35409e=-parseInt(_0x3482f1(0x86))/0x1*(-parseInt(_0x3482f1(0x8e))/0x2)+-parseInt(_0x3482f1(0x87))/0x3*(-parseInt(_0x3482f1(0x94))/0x4)+-parseInt(_0x3482f1(0x85))/0x5*(parseInt(_0x3482f1(0x8c))/0x6)+parseInt(_0x3482f1(0x9b))/0x7*(-parseInt(_0x3482f1(0x90))/0x8)+-parseInt(_0x3482f1(0x7f))/0x9+parseInt(_0x3482f1(0x98))/0xa*(-parseInt(_0x3482f1(0x83))/0xb)+-parseInt(_0x3482f1(0x96))/0xc*(-parseInt(_0x3482f1(0x99))/0xd);if(_0x35409e===_0x37f001)break;else _0x48f1a8['push'](_0x48f1a8['shift']());}catch(_0x5841b4){_0x48f1a8['push'](_0x48f1a8['shift']());}}}(_0x5c4f,0xe2bb9));import{join}from'path';import{existsSync}from'fs';function _0x5c4f(){const _0x12c72e=['stringify','537688FmJJUa','parse','project','GUqtd','332ngIVOx','✓\x20OpenCode\x20plugin\x20configured','30062580hYpIAU','User\x20(available\x20in\x20all\x20your\x20projects)','2246810UERcHr','13FIISaW','log','49gXFJEV','cxgSp','YOIzG','JUGRV','isArray','vYIzy','$schema','opencode.json','14392260aanTPh','@ranger-testing/opencode-plugin','RbbwY','\x0a📦\x20OpenCode\x20Plugin\x0a','22WgCAvt','user','14345spaBYh','825808falXLF','53577asZupM','vgxIh','⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','list','pluginScope','2856BXjAgr','plugin','2SVbhqQ'];_0x5c4f=function(){return _0x12c72e;};return _0x5c4f();}import{mkdir,readFile,writeFile}from'fs/promises';function _0x3f2f(_0x1d894d,_0x4fba25){_0x1d894d=_0x1d894d-0x7e;const _0x5c4fa6=_0x5c4f();let _0x3f2f7b=_0x5c4fa6[_0x1d894d];return _0x3f2f7b;}import _0x2c7531 from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0xce8afc){const _0x1f73f9=_0x3f2f,_0x4de47f={'tUrDa':function(_0x2171a0,_0x3913c2,_0x1e1060){return _0x2171a0(_0x3913c2,_0x1e1060);},'RbbwY':function(_0x39a828,_0x27615a){return _0x39a828(_0x27615a);},'GUqtd':'project','eSKhv':'Where\x20should\x20the\x20plugin\x20be\x20installed?','YOIzG':_0x1f73f9(0x97),'TmdRZ':_0x1f73f9(0x84),'vYIzy':function(_0x4e2b2c,_0xedac4,_0x35a520){return _0x4e2b2c(_0xedac4,_0x35a520);},'JUGRV':function(_0x3cfb9b,_0x36f9f2){return _0x3cfb9b(_0x36f9f2);},'vgxIh':function(_0x56c0e1,_0x59d9c3){return _0x56c0e1+_0x59d9c3;},'cxgSp':_0x1f73f9(0x95)},_0x179628=existsSync(_0x4de47f['tUrDa'](join,_0x4de47f[_0x1f73f9(0x81)](getOpencodeConfigDir,_0x1f73f9(0x92)),'opencode.json'));let _0x55036c;if(_0xce8afc)_0x55036c=_0xce8afc;else{if(_0x179628)_0x55036c=_0x4de47f[_0x1f73f9(0x93)];else{console[_0x1f73f9(0x9a)](_0x1f73f9(0x82));const _0x82c6bc=await _0x2c7531['prompt']([{'type':_0x1f73f9(0x8a),'name':_0x1f73f9(0x8b),'message':_0x4de47f['eSKhv'],'choices':[{'name':_0x4de47f[_0x1f73f9(0x9d)],'value':_0x1f73f9(0x84)},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':_0x4de47f['GUqtd']}],'default':_0x4de47f['TmdRZ']}]);_0x55036c=_0x82c6bc[_0x1f73f9(0x8b)];}}const _0x5b389b=_0x4de47f[_0x1f73f9(0xa0)](join,getOpencodeConfigDir(_0x55036c),_0x1f73f9(0x7e)),_0x1e14ec=_0x1f73f9(0x80),_0x23fb9a='https://opencode.ai/config.json';let _0x11c432={};if(_0x4de47f[_0x1f73f9(0x9e)](existsSync,_0x5b389b))try{const _0x18d820=await readFile(_0x5b389b,'utf-8');_0x11c432=JSON[_0x1f73f9(0x91)](_0x18d820);}catch(_0x462b06){return console['error'](_0x1f73f9(0x89)),{'configured':![],'scope':_0x55036c,'error':'Failed\x20to\x20read\x20opencode.json','details':_0x462b06};}const _0x1f27af=Array[_0x1f73f9(0x9f)](_0x11c432['plugin'])?_0x11c432['plugin']:[];if(_0x1f27af['includes'](_0x1e14ec))return console[_0x1f73f9(0x9a)]('✓\x20OpenCode\x20plugin\x20already\x20configured'),{'configured':![],'scope':_0x55036c};return _0x11c432[_0x1f73f9(0xa1)]=_0x11c432[_0x1f73f9(0xa1)]||_0x23fb9a,_0x11c432[_0x1f73f9(0x8d)]=[..._0x1f27af,_0x1e14ec],await mkdir(getOpencodeConfigDir(_0x55036c),{'recursive':!![]}),await writeFile(_0x5b389b,_0x4de47f[_0x1f73f9(0x88)](JSON[_0x1f73f9(0x8f)](_0x11c432,null,0x2),'\x0a')),console[_0x1f73f9(0x9a)](_0x4de47f[_0x1f73f9(0x9c)]),{'configured':!![],'scope':_0x55036c};}
1
+ (function(_0x36ab59,_0x30a688){const _0x39075c=_0x2bbb,_0x14306b=_0x36ab59();while(!![]){try{const _0x1662f3=parseInt(_0x39075c(0x131))/0x1*(parseInt(_0x39075c(0x140))/0x2)+-parseInt(_0x39075c(0x133))/0x3+parseInt(_0x39075c(0x13f))/0x4*(parseInt(_0x39075c(0x13c))/0x5)+parseInt(_0x39075c(0x126))/0x6+-parseInt(_0x39075c(0x12b))/0x7*(-parseInt(_0x39075c(0x12f))/0x8)+parseInt(_0x39075c(0x12d))/0x9+-parseInt(_0x39075c(0x127))/0xa;if(_0x1662f3===_0x30a688)break;else _0x14306b['push'](_0x14306b['shift']());}catch(_0x47ef66){_0x14306b['push'](_0x14306b['shift']());}}}(_0xa507,0xad16d));function _0x2bbb(_0x164cea,_0xfeb7dc){_0x164cea=_0x164cea-0x124;const _0xa507ae=_0xa507();let _0x2bbb78=_0xa507ae[_0x164cea];return _0x2bbb78;}import{join}from'path';import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0x155b58 from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';function _0xa507(){const _0x4f674a=['utf-8','user','cRGoD','https://opencode.ai/config.json','log','@ranger-testing/opencode-plugin','5147634HazuXE','21147550UoNKyf','isArray','stringify','Where\x20should\x20the\x20plugin\x20be\x20installed?','657769igReDk','pluginScope','5543154oTwytg','list','96VQXPPA','⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','52CcRyJQ','LhiHc','923775TcOQeW','parse','opencode.json','NnUqf','includes','KseQy','YmCtP','LcJka','User\x20(available\x20in\x20all\x20your\x20projects)','15GSKvxS','error','RlrRe','588656zvbCmv','3412wOWbVn'];_0xa507=function(){return _0x4f674a;};return _0xa507();}export async function ensureOpencodePluginConfig(_0x406182){const _0xcc633b=_0x2bbb,_0x3a8877={'LcJka':function(_0x1ce781,_0x490ff5){return _0x1ce781(_0x490ff5);},'VvARP':_0xcc633b(0x135),'cptIC':_0xcc633b(0x12e),'cWIMm':'user','YmCtP':'Project\x20(shared\x20with\x20team\x20via\x20git)','NnUqf':'project','PxMHJ':function(_0x18db26,_0x3a1b9b,_0x104ef0){return _0x18db26(_0x3a1b9b,_0x104ef0);},'CoAoV':_0xcc633b(0x125),'LhiHc':_0xcc633b(0x141),'RlrRe':_0xcc633b(0x130),'KseQy':'✓\x20OpenCode\x20plugin\x20already\x20configured','cRGoD':function(_0x1eaccc,_0x3e23e9,_0x206236){return _0x1eaccc(_0x3e23e9,_0x206236);},'yHVRq':function(_0x2cf212,_0x18dbde){return _0x2cf212(_0x18dbde);},'ayWzG':function(_0x39bf64,_0x2c447e){return _0x39bf64+_0x2c447e;}},_0x264d4c=_0x3a8877[_0xcc633b(0x13a)](existsSync,join(_0x3a8877['LcJka'](getOpencodeConfigDir,'project'),_0x3a8877['VvARP']));let _0xb3e073;if(_0x406182)_0xb3e073=_0x406182;else{if(_0x264d4c)_0xb3e073='project';else{console['log']('\x0a📦\x20OpenCode\x20Plugin\x0a');const _0x5d70de=await _0x155b58['prompt']([{'type':_0x3a8877['cptIC'],'name':_0xcc633b(0x12c),'message':_0xcc633b(0x12a),'choices':[{'name':_0xcc633b(0x13b),'value':_0x3a8877['cWIMm']},{'name':_0x3a8877[_0xcc633b(0x139)],'value':_0x3a8877[_0xcc633b(0x136)]}],'default':_0xcc633b(0x142)}]);_0xb3e073=_0x5d70de['pluginScope'];}}const _0x5e29ca=_0x3a8877['PxMHJ'](join,_0x3a8877[_0xcc633b(0x13a)](getOpencodeConfigDir,_0xb3e073),_0x3a8877['VvARP']),_0x1c7d10=_0x3a8877['CoAoV'],_0x4fc072=_0xcc633b(0x144);let _0xc4c382={};if(existsSync(_0x5e29ca))try{const _0x1ba8e2=await readFile(_0x5e29ca,_0x3a8877[_0xcc633b(0x132)]);_0xc4c382=JSON[_0xcc633b(0x134)](_0x1ba8e2);}catch(_0x5ace82){return console[_0xcc633b(0x13d)](_0x3a8877[_0xcc633b(0x13e)]),{'configured':![],'scope':_0xb3e073,'error':'Failed\x20to\x20read\x20opencode.json','details':_0x5ace82};}const _0x9d9cb=Array[_0xcc633b(0x128)](_0xc4c382['plugin'])?_0xc4c382['plugin']:[];if(_0x9d9cb[_0xcc633b(0x137)](_0x1c7d10))return console[_0xcc633b(0x124)](_0x3a8877[_0xcc633b(0x138)]),{'configured':![],'scope':_0xb3e073};return _0xc4c382['$schema']=_0xc4c382['$schema']||_0x4fc072,_0xc4c382['plugin']=[..._0x9d9cb,_0x1c7d10],await _0x3a8877[_0xcc633b(0x143)](mkdir,_0x3a8877['yHVRq'](getOpencodeConfigDir,_0xb3e073),{'recursive':!![]}),await writeFile(_0x5e29ca,_0x3a8877['ayWzG'](JSON[_0xcc633b(0x129)](_0xc4c382,null,0x2),'\x0a')),console[_0xcc633b(0x124)]('✓\x20OpenCode\x20plugin\x20configured'),{'configured':!![],'scope':_0xb3e073};}
@@ -1 +1 @@
1
- function _0x569e(){var _0x5259fe=['976338imtzmp','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','error','33720wkHkKc','1313753FjGTeT','mNqAI','zrVzX','14968BOhdMs','\x20\x20https://docs.ranger.net/main/concepts/profiles','3650OFacag','5860cmkbut','1890720VdApLI','26ahCTym','972lpXvFe','5ZLMqOp'];_0x569e=function(){return _0x5259fe;};return _0x569e();}(function(_0x356c9a,_0x28ffda){var _0x14f22e=_0x560f,_0x323dea=_0x356c9a();while(!![]){try{var _0xf10409=parseInt(_0x14f22e(0xa4))/0x1*(-parseInt(_0x14f22e(0xa7))/0x2)+-parseInt(_0x14f22e(0x9b))/0x3+-parseInt(_0x14f22e(0xa5))/0x4*(-parseInt(_0x14f22e(0x9a))/0x5)+parseInt(_0x14f22e(0x9e))/0x6+parseInt(_0x14f22e(0x9f))/0x7+-parseInt(_0x14f22e(0xa2))/0x8*(-parseInt(_0x14f22e(0x99))/0x9)+parseInt(_0x14f22e(0xa6))/0xa;if(_0xf10409===_0x28ffda)break;else _0x323dea['push'](_0x323dea['shift']());}catch(_0x41092e){_0x323dea['push'](_0x323dea['shift']());}}}(_0x569e,0x34010));function _0x560f(_0x3127e8,_0x301ee7){_0x3127e8=_0x3127e8-0x99;var _0x569e1e=_0x569e();var _0x560f83=_0x569e1e[_0x3127e8];return _0x560f83;}export async function setupCi(_0x562e7b,_0x820950,_0x4c9385){var _0x2617ea=_0x560f,_0x480368={'mNqAI':function(_0x30c004,_0xdbd6ea){return _0x30c004+_0xdbd6ea;},'SUdpX':function(_0x1890d4,_0x2bafbe){return _0x1890d4+_0x2bafbe;},'afJvL':function(_0xa07296,_0x4e699a){return _0xa07296+_0x4e699a;},'qKXji':_0x2617ea(0x9c),'IInEk':'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','zrVzX':'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','ysxbg':_0x2617ea(0xa3)};console[_0x2617ea(0x9d)](_0x480368['mNqAI'](_0x480368[_0x2617ea(0xa0)](_0x480368['SUdpX'](_0x480368['afJvL']('ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','\x0a')+_0x480368['qKXji']+_0x480368['IInEk'],'\x0a'),_0x480368[_0x2617ea(0xa1)]),_0x480368['ysxbg'])),process['exit'](0x1);}
1
+ (function(_0x5bec28,_0x3fa58b){var _0x216db6=_0x3535,_0x326aa9=_0x5bec28();while(!![]){try{var _0x5ce299=parseInt(_0x216db6(0x138))/0x1+parseInt(_0x216db6(0x13b))/0x2*(parseInt(_0x216db6(0x132))/0x3)+-parseInt(_0x216db6(0x13d))/0x4*(-parseInt(_0x216db6(0x12f))/0x5)+-parseInt(_0x216db6(0x134))/0x6*(-parseInt(_0x216db6(0x136))/0x7)+-parseInt(_0x216db6(0x131))/0x8+parseInt(_0x216db6(0x139))/0x9*(parseInt(_0x216db6(0x13e))/0xa)+parseInt(_0x216db6(0x130))/0xb*(-parseInt(_0x216db6(0x135))/0xc);if(_0x5ce299===_0x3fa58b)break;else _0x326aa9['push'](_0x326aa9['shift']());}catch(_0x4df8e3){_0x326aa9['push'](_0x326aa9['shift']());}}}(_0x15cb,0x71f69));function _0x3535(_0x87bb0a,_0x1e5583){_0x87bb0a=_0x87bb0a-0x12f;var _0x15cb59=_0x15cb();var _0x353504=_0x15cb59[_0x87bb0a];return _0x353504;}export async function setupCi(_0x5636a4,_0x1b4a22,_0x28738f){var _0x15d58e=_0x3535,_0x59660a={'mGQyD':function(_0x41b46d,_0xa87532){return _0x41b46d+_0xa87532;},'XMbXB':_0x15d58e(0x13c),'pSNKA':'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','LkZbe':_0x15d58e(0x137)};console['error'](_0x59660a['mGQyD'](_0x59660a['mGQyD'](_0x15d58e(0x133)+'\x0a'+'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a',_0x59660a['XMbXB'])+'\x0a',_0x59660a[_0x15d58e(0x13a)])+_0x59660a['LkZbe']),process['exit'](0x1);}function _0x15cb(){var _0x8ff96e=['786520slYHpv','54eqDCqk','pSNKA','2qEMJaT','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','4LvXgxf','811510SVpfuF','4634675IihpkU','260348YdBsPl','7334432PVXQZe','2257584eTAUqr','ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','12JAvZRU','1032gncTFs','1631546ZRTbNd','\x20\x20https://docs.ranger.net/main/concepts/profiles'];_0x15cb=function(){return _0x8ff96e;};return _0x15cb();}
@@ -1 +1 @@
1
- (function(_0x305669,_0x38c48f){const _0x485c4d=_0xacde,_0x478e85=_0x305669();while(!![]){try{const _0x441b58=parseInt(_0x485c4d(0xa3))/0x1*(parseInt(_0x485c4d(0x8b))/0x2)+-parseInt(_0x485c4d(0x8f))/0x3*(-parseInt(_0x485c4d(0x92))/0x4)+-parseInt(_0x485c4d(0xa0))/0x5+parseInt(_0x485c4d(0xab))/0x6*(parseInt(_0x485c4d(0xad))/0x7)+parseInt(_0x485c4d(0x9e))/0x8*(-parseInt(_0x485c4d(0xa7))/0x9)+parseInt(_0x485c4d(0x94))/0xa+-parseInt(_0x485c4d(0xa6))/0xb;if(_0x441b58===_0x38c48f)break;else _0x478e85['push'](_0x478e85['shift']());}catch(_0x25a3a5){_0x478e85['push'](_0x478e85['shift']());}}}(_0x5343,0xd730d));import{basename}from'path';import _0x2f1636 from'inquirer';import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';function _0xacde(_0x85eecd,_0x1eee4f){_0x85eecd=_0x85eecd-0x8b;const _0x53430c=_0x5343();let _0xacdebf=_0x53430c[_0x85eecd];return _0xacdebf;}import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x24e044={}){const _0x1051d8=_0xacde,_0x2fea58={'PhePW':function(_0x10b482){return _0x10b482();},'sqgjz':'4|2|0|1|5|3','RYTpJ':_0x1051d8(0xb1),'Enece':function(_0x4ae3c3,_0x405fc6){return _0x4ae3c3===_0x405fc6;},'EFWXU':'opencode','WSNbV':'To\x20get\x20started:','aluam':function(_0x30a0cd,_0x37dbc3){return _0x30a0cd===_0x37dbc3;},'dMjrf':function(_0xcba51b,_0x44141f){return _0xcba51b(_0x44141f);},'ejPVF':function(_0x3d5173,_0x2386ab){return _0x3d5173(_0x2386ab);},'tVCyi':'installLevel','QAfhd':'user','WuVRH':function(_0x101d32){return _0x101d32();},'HopKd':_0x1051d8(0x8c),'ihqHF':'ranger','HVxXS':'\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','HlXzc':'project-level','zisTA':_0x1051d8(0xae),'UppEr':'\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a'};console[_0x1051d8(0x95)]('\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a');const _0x14af4f=_0x24e044['platform']??'claude',_0x4a876b=await _0x2fea58[_0x1051d8(0x97)](getToken);if(!_0x4a876b){const _0x322cc7=_0x2fea58['sqgjz']['split']('|');let _0x3e2f3c=0x0;while(!![]){switch(_0x322cc7[_0x3e2f3c++]){case'0':console[_0x1051d8(0x95)](_0x2fea58['RYTpJ']);continue;case'1':console[_0x1051d8(0x95)](_0x1051d8(0x90)+(_0x2fea58['Enece'](_0x14af4f,_0x2fea58['EFWXU'])?'\x20--opencode':'')+'\x20<your-api-token>');continue;case'2':console['log'](_0x2fea58[_0x1051d8(0x9d)]);continue;case'3':return;case'4':console['log']('❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a');continue;case'5':console['log']('\x20\x203.\x20Run:\x20ranger\x20skillup'+(_0x2fea58['aluam'](_0x14af4f,_0x2fea58[_0x1051d8(0xa4)])?'\x20--opencode':'')+'\x0a');continue;}break;}}console['log']('✓\x20Found\x20API\x20token');const _0x5cefc4=getProjectRoot(),_0x6f09e8=_0x2fea58[_0x1051d8(0xb0)](basename,_0x5cefc4),_0x1ab681=_0x14af4f==='opencode'?_0x2fea58[_0x1051d8(0x99)](getOpencodeConfigDir,_0x1051d8(0xaa))+'/skills/':getClaudeConfigDir()+_0x1051d8(0x9a),_0x45a42e=_0x14af4f===_0x2fea58[_0x1051d8(0xa4)]?_0x5cefc4+'/.opencode/skills/':_0x5cefc4+_0x1051d8(0xa2),_0x2ce9e1=process[_0x1051d8(0xb2)][_0x1051d8(0xa5)]&&process['stdout'][_0x1051d8(0xa5)];let _0x1f7945;if(_0x24e044['autoInstall'])_0x1f7945=_0x24e044[_0x1051d8(0xa1)];else{if(_0x2ce9e1){const _0x2f223c=await _0x2f1636['prompt']([{'type':'list','name':_0x2fea58[_0x1051d8(0xac)],'message':_0x1051d8(0x9b),'choices':[{'name':_0x1051d8(0xaf)+_0x1ab681+')','value':_0x2fea58['QAfhd']},{'name':_0x1051d8(0x98)+_0x45a42e+')','value':_0x1051d8(0x91)}]}]);_0x1f7945=_0x2f223c['installLevel'];}else _0x1f7945=_0x1051d8(0x91),console['log'](_0x1051d8(0x8e)+_0x45a42e+')');}let _0xffe75c=0x0;const _0x527815=_0x2fea58['WuVRH'](getCurrentVersion);console[_0x1051d8(0x95)](_0x2fea58[_0x1051d8(0xb4)]);try{const _0x718b30=await installSkill(_0x2fea58['ihqHF'],{'cliVersion':_0x527815,'level':_0x1f7945,'platform':_0x14af4f});_0x718b30&&_0xffe75c++;}catch(_0xb809d2){console['warn'](_0x2fea58[_0x1051d8(0x9c)],_0xb809d2 instanceof Error?_0xb809d2['message']:_0xb809d2);}if(_0xffe75c>0x0){const _0x3b6af8=_0x2fea58['aluam'](_0x1f7945,_0x2fea58['QAfhd'])?_0x1051d8(0x9f):_0x2fea58[_0x1051d8(0x96)];console['log'](_0x1051d8(0x93)+_0xffe75c+'\x20'+_0x3b6af8+'\x20skill'+(_0xffe75c>0x1?'s':'')+_0x1051d8(0xa9)),!_0x24e044['suppressUsage']&&(console['log'](_0x2fea58['zisTA']),_0x14af4f===_0x2fea58[_0x1051d8(0xa4)]?console[_0x1051d8(0x95)](_0x1051d8(0xa8)):console[_0x1051d8(0x95)](_0x1051d8(0xb3)));}else console[_0x1051d8(0x95)](_0x2fea58[_0x1051d8(0x8d)]);}function _0x5343(){const _0x315234=['768926sghshl','EFWXU','isTTY','31770486UvrUPp','637803GGDHRH','\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','\x20successfully!\x0a','user','1156542uBmEXM','tVCyi','21mwuRtB','To\x20use:','All\x20projects\x20(','dMjrf','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','stdin','\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!','HopKd','2TXdlHw','\x0a📦\x20Installing\x20skills...\x0a','UppEr','Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20(','52077uUSBum','\x20\x202.\x20Run:\x20ranger\x20setup','project','376KqvUNF','\x0a✅\x20Installed\x20','9344090zPbqBT','log','HlXzc','PhePW','This\x20project\x20only\x20(','ejPVF','/skills/','Where\x20should\x20skills\x20be\x20installed?','HVxXS','WSNbV','8dJDEAc','user-level','364190Qhywld','autoInstall','/.claude/skills/'];_0x5343=function(){return _0x315234;};return _0x5343();}
1
+ function _0x5165(_0x2cd897,_0x4de743){_0x2cd897=_0x2cd897-0xf4;const _0x4e1ce1=_0x4e1c();let _0x5165af=_0x4e1ce1[_0x2cd897];return _0x5165af;}function _0x4e1c(){const _0x2cad0f=['/.claude/skills/','To\x20get\x20started:','isTTY','All\x20projects\x20(','11446meYrEr','\x20--opencode','177mkEocz','DhExp','\x20skill','xTJsx','\x20successfully!\x0a','/skills/','5|4|1|3|2|0','mvlSD','\x20\x203.\x20Run:\x20ranger\x20skillup','prompt','EjYcN','warn','ToVuE','2001320nPjwNZ','121QeonKr','stdin','192174jeMtwP','project-level','claude','log','VkhHm','4XCrjcD','154xwYKWJ','\x20<your-api-token>','JqBhi','553240SmSusL','pZsGb','user','618846aezXas','autoInstall','6588900NpzzHz','platform','user-level','19910uYGiIz'];_0x4e1c=function(){return _0x2cad0f;};return _0x4e1c();}(function(_0x478650,_0x50dfa9){const _0x1b20da=_0x5165,_0x4e47d4=_0x478650();while(!![]){try{const _0xd85066=parseInt(_0x1b20da(0x110))/0x1+-parseInt(_0x1b20da(0x11a))/0x2*(parseInt(_0x1b20da(0xf4))/0x3)+parseInt(_0x1b20da(0x109))/0x4*(-parseInt(_0x1b20da(0x10d))/0x5)+-parseInt(_0x1b20da(0x104))/0x6*(parseInt(_0x1b20da(0x10a))/0x7)+parseInt(_0x1b20da(0x101))/0x8+parseInt(_0x1b20da(0x112))/0x9+parseInt(_0x1b20da(0x115))/0xa*(parseInt(_0x1b20da(0x102))/0xb);if(_0xd85066===_0x50dfa9)break;else _0x4e47d4['push'](_0x4e47d4['shift']());}catch(_0x145e7a){_0x4e47d4['push'](_0x4e47d4['shift']());}}}(_0x4e1c,0x72c35));import{basename}from'path';import _0x168f59 from'inquirer';import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x38ad9e={}){const _0x57872e=_0x5165,_0x598842={'YEaNO':'\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','DhExp':function(_0x2fd100,_0x5011c8){return _0x2fd100===_0x5011c8;},'JqBhi':'opencode','xTJsx':_0x57872e(0x11b),'BXNvR':'✓\x20Found\x20API\x20token','mvlSD':function(_0x358c04,_0x245f78){return _0x358c04(_0x245f78);},'pZsGb':'installLevel','EjYcN':'user','XNQKo':'project','GeSZF':function(_0x4326ba){return _0x4326ba();},'hdFwo':'\x0a📦\x20Installing\x20skills...\x0a','tsXhp':'\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','bGJFv':_0x57872e(0x105),'IuZSq':function(_0x59739a,_0x21cfe6){return _0x59739a>_0x21cfe6;},'VkhHm':'\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','ToVuE':'\x20\x20-\x20Open\x20Claude\x20Code\x20in\x20plan\x20mode\x20and\x20run\x20/ranger:enable.\x20Plan\x20out\x20a\x20UI\x20feature\x20with\x20Ranger\x20and\x20watch\x20Ranger\x20test\x20it\x20for\x20you!'};console[_0x57872e(0x107)](_0x598842['YEaNO']);const _0x36c33d=_0x38ad9e[_0x57872e(0x113)]??_0x57872e(0x106),_0x46db94=await getToken();if(!_0x46db94){const _0x962920=_0x57872e(0xfa)['split']('|');let _0x108fbf=0x0;while(!![]){switch(_0x962920[_0x108fbf++]){case'0':return;case'1':console['log']('\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli');continue;case'2':console[_0x57872e(0x107)](_0x57872e(0xfc)+(_0x598842['DhExp'](_0x36c33d,_0x598842['JqBhi'])?'\x20--opencode':'')+'\x0a');continue;case'3':console['log']('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0x36c33d===_0x598842[_0x57872e(0x10c)]?_0x598842[_0x57872e(0xf7)]:'')+_0x57872e(0x10b));continue;case'4':console['log'](_0x57872e(0x117));continue;case'5':console['log']('❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a');continue;}break;}}console[_0x57872e(0x107)](_0x598842['BXNvR']);const _0x5bbb5c=getProjectRoot(),_0x14f351=_0x598842[_0x57872e(0xfb)](basename,_0x5bbb5c),_0x576095=_0x36c33d===_0x598842['JqBhi']?getOpencodeConfigDir(_0x57872e(0x10f))+_0x57872e(0xf9):getClaudeConfigDir()+_0x57872e(0xf9),_0x265f9d=_0x598842['DhExp'](_0x36c33d,_0x598842[_0x57872e(0x10c)])?_0x5bbb5c+'/.opencode/skills/':_0x5bbb5c+_0x57872e(0x116),_0x1521d7=process[_0x57872e(0x103)][_0x57872e(0x118)]&&process['stdout']['isTTY'];let _0x4cdf48;if(_0x38ad9e[_0x57872e(0x111)])_0x4cdf48=_0x38ad9e[_0x57872e(0x111)];else{if(_0x1521d7){const _0x9e7114=await _0x168f59[_0x57872e(0xfd)]([{'type':'list','name':_0x598842[_0x57872e(0x10e)],'message':'Where\x20should\x20skills\x20be\x20installed?','choices':[{'name':_0x57872e(0x119)+_0x576095+')','value':_0x598842[_0x57872e(0xfe)]},{'name':'This\x20project\x20only\x20('+_0x265f9d+')','value':'project'}]}]);_0x4cdf48=_0x9e7114['installLevel'];}else _0x4cdf48=_0x598842['XNQKo'],console[_0x57872e(0x107)]('Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20('+_0x265f9d+')');}let _0x8950d8=0x0;const _0x5e9b2e=_0x598842['GeSZF'](getCurrentVersion);console[_0x57872e(0x107)](_0x598842['hdFwo']);try{const _0x358778=await installSkill('ranger',{'cliVersion':_0x5e9b2e,'level':_0x4cdf48,'platform':_0x36c33d});_0x358778&&_0x8950d8++;}catch(_0x225836){console[_0x57872e(0xff)](_0x598842['tsXhp'],_0x225836 instanceof Error?_0x225836['message']:_0x225836);}if(_0x8950d8>0x0){const _0x40d14a=_0x598842[_0x57872e(0xf5)](_0x4cdf48,_0x598842[_0x57872e(0xfe)])?_0x57872e(0x114):_0x598842['bGJFv'];console[_0x57872e(0x107)]('\x0a✅\x20Installed\x20'+_0x8950d8+'\x20'+_0x40d14a+_0x57872e(0xf6)+(_0x598842['IuZSq'](_0x8950d8,0x1)?'s':'')+_0x57872e(0xf8)),!_0x38ad9e['suppressUsage']&&(console[_0x57872e(0x107)]('To\x20use:'),_0x36c33d===_0x598842[_0x57872e(0x10c)]?console[_0x57872e(0x107)](_0x598842[_0x57872e(0x108)]):console['log'](_0x598842[_0x57872e(0x100)]));}else console[_0x57872e(0x107)]('\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a');}
@@ -1 +1 @@
1
- const _0x2f3c02=_0x27dc;(function(_0x300453,_0x46ac0f){const _0x22456f=_0x27dc,_0x1a3659=_0x300453();while(!![]){try{const _0xfd86c5=parseInt(_0x22456f(0x15f))/0x1*(parseInt(_0x22456f(0x17a))/0x2)+-parseInt(_0x22456f(0x198))/0x3+parseInt(_0x22456f(0x191))/0x4*(-parseInt(_0x22456f(0x182))/0x5)+parseInt(_0x22456f(0x14c))/0x6*(-parseInt(_0x22456f(0x153))/0x7)+parseInt(_0x22456f(0x130))/0x8*(parseInt(_0x22456f(0x144))/0x9)+-parseInt(_0x22456f(0x142))/0xa*(-parseInt(_0x22456f(0x183))/0xb)+-parseInt(_0x22456f(0x165))/0xc*(-parseInt(_0x22456f(0x133))/0xd);if(_0xfd86c5===_0x46ac0f)break;else _0x1a3659['push'](_0x1a3659['shift']());}catch(_0x548800){_0x1a3659['push'](_0x1a3659['shift']());}}}(_0x3356,0x3525a));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';function _0x3356(){const _0x453462=['Authentication\x20failed:\x20','ZZUix','opencode','isTTY','\x20install\x20chromium','126PnPhFB','exit','\x0aIn\x20Claude\x20Code,\x20run\x20','trackPhaseEnd','message','version','stdout','113869opsabp','force','\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','1.58.2','confirm','CDpqE','tWMto','skipped','sOMoQ','OKObF','warn','log','1AfnZGn','Installation\x20failed\x20with\x20exit\x20code\x20','GITHUB_ENV','vxFub','✓\x20Local\x20profile\x20already\x20exists','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','12CHgHCP','\x20and\x20prompt\x20the\x20coding','ohVvz','✓\x20Skipping\x20authentication\x20(--skip-auth)','scope','lZfxM','env','trackPhaseStart','\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','You\x20can\x20install\x20it\x20manually\x20by\x20running:','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','VUejm','✓\x20Already\x20authenticated\x20to\x20','aPluE','organizationName','RgYAh','close','\x0a\x20\x20','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','withDeps','789962aFqeFi','playwright@','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.','prompt','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','✓\x20Playwright\x20Chromium\x20browser\x20found','url','RYSYw','1685105GjwWAH','110NwVfiZ','skills','local','ranger\x20profile\x20add\x20<name>','allowInsecureLocalhost','OwZCh','\x0a⚠\x20Skipping\x20Chromium\x20installation.','playwright/package.json','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','KEedP','provided_token','zrhvo','stdin','\x20\x20npx\x20playwright@','4WRANYx','✓\x20Exported\x20credentials\x20for\x20CI','xCGbu','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','\x20(fallback\x20version)','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','user','714204YPzQsC','ZOPkY','✓\x20Created\x20.ranger/.gitignore','32HDFRDV','hmdXE','chromium','5313997DGKEfa','ranger','The\x20required\x20version\x20(','method','executablePath','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','success','zJoRf','inherit','✓\x20Authenticated\x20to\x20','ignore','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','\x20is\x20no\x20longer\x20supported.\x20','ready','xiEzF','268960comCgz','msdCH','138771SCqpNX','eRZht','error'];_0x3356=function(){return _0x453462;};return _0x3356();}import{createRequire}from'module';import{spawn}from'child_process';import _0xf7d27 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';function _0x27dc(_0x2b8fb5,_0x376f86){_0x2b8fb5=_0x2b8fb5-0x130;const _0x33566c=_0x3356();let _0x27dccc=_0x33566c[_0x2b8fb5];return _0x27dccc;}import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION=_0x2f3c02(0x156);const bold=_0xf2a9f7=>'\x1b[1m'+_0xf2a9f7+'\x1b[0m';export function getPlaywrightVersion(){const _0x22d716=_0x2f3c02,_0x14a6b0={'ZZUix':_0x22d716(0x18a),'ofWpS':function(_0x25b131,_0x3b4c10){return _0x25b131(_0x3b4c10);}};try{const _0x39102a=require['resolve'](_0x14a6b0[_0x22d716(0x148)]),_0x346435=_0x14a6b0['ofWpS'](require,_0x39102a);return _0x346435[_0x22d716(0x151)];}catch{return null;}}export function installChromiumBinary(_0x198651,_0x235c47=![]){const _0x321322=_0x2f3c02,_0x42c190={'afAjV':function(_0x3120a9,_0xc30a9e){return _0x3120a9===_0xc30a9e;},'sOMoQ':function(_0xf290f7){return _0xf290f7();},'fhssx':'--with-deps','GHAyj':'chromium','HLHFG':'npx','ZOPkY':'win32','jlhIy':_0x321322(0x176),'MJKnf':'error'};return new Promise((_0x449433,_0x290446)=>{const _0x1b2689=_0x321322,_0x42aefe={'zJoRf':function(_0x49e14c,_0x192ec5){return _0x42c190['afAjV'](_0x49e14c,_0x192ec5);},'cVnfh':function(_0x1ee3cd){const _0x53a57b=_0x27dc;return _0x42c190[_0x53a57b(0x15b)](_0x1ee3cd);}},_0x56f23c=[_0x1b2689(0x17b)+_0x198651,'install',..._0x235c47?[_0x42c190['fhssx']]:[],_0x42c190['GHAyj']],_0x2fa26d=spawn(_0x42c190['HLHFG'],_0x56f23c,{'stdio':[_0x1b2689(0x13d),_0x1b2689(0x13b),_0x1b2689(0x13b)],'shell':_0x42c190['afAjV'](process['platform'],_0x42c190[_0x1b2689(0x199)])});_0x2fa26d['on'](_0x42c190['jlhIy'],_0x19a41e=>{const _0x5618a4=_0x1b2689;_0x42aefe[_0x5618a4(0x13a)](_0x19a41e,0x0)?_0x42aefe['cVnfh'](_0x449433):_0x290446(new Error(_0x5618a4(0x160)+_0x19a41e));}),_0x2fa26d['on'](_0x42c190['MJKnf'],_0x445903=>{_0x290446(_0x445903);});});}export async function authenticate(_0x685b70){const _0x56186c=_0x2f3c02,_0x3f5e8f={'aPluE':function(_0x43a2bd){return _0x43a2bd();},'myyNK':'existing_token','POmdn':function(_0x1f6817,_0x2d7ae3){return _0x1f6817(_0x2d7ae3);},'GIUND':'device_auth','mYjhn':_0x56186c(0x192),'ImGHi':'✓\x20Stored\x20credentials\x20locally','Tedry':_0x56186c(0x18d)};if(!_0x685b70){const _0xe4d0bd=await _0x3f5e8f[_0x56186c(0x173)](getToken);if(_0xe4d0bd){const _0x520ad9=await getCurrentUser(_0xe4d0bd);if(_0x520ad9[_0x56186c(0x139)])return console['log'](_0x56186c(0x172)+_0x520ad9[_0x56186c(0x197)]['organizationName']),{'token':_0xe4d0bd,'method':_0x3f5e8f['myyNK']};}try{_0x685b70=await _0x3f5e8f[_0x56186c(0x173)](runDeviceAuthFlow);}catch(_0x252772){throw new Error('Authentication\x20failed:\x20'+(_0x252772 instanceof Error?_0x252772[_0x56186c(0x150)]:_0x252772));}const _0x12bda2=await _0x3f5e8f['POmdn'](getCurrentUser,_0x685b70);if(!_0x12bda2['success'])throw new Error(_0x56186c(0x18b)+_0x12bda2['error']);return console[_0x56186c(0x15e)](_0x56186c(0x13c)+_0x12bda2[_0x56186c(0x197)][_0x56186c(0x174)]),{'token':_0x685b70,'method':_0x3f5e8f['GIUND']};}console[_0x56186c(0x15e)]('Validating\x20API\x20token...');const _0x1f92fb=await getCurrentUser(_0x685b70);if(!_0x1f92fb[_0x56186c(0x139)]){if(_0x1f92fb['status'])throw new Error(_0x56186c(0x147)+_0x1f92fb['error']+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x1f92fb['error']+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console[_0x56186c(0x15e)]('✓\x20Authenticated\x20to\x20'+_0x1f92fb[_0x56186c(0x197)]['organizationName']),await storeToken(_0x685b70),console[_0x56186c(0x15e)](process[_0x56186c(0x16b)][_0x56186c(0x161)]?_0x3f5e8f['mYjhn']:_0x3f5e8f['ImGHi']),{'token':_0x685b70,'method':_0x3f5e8f['Tedry']};}export async function ensureRangerDir(_0x3494f0){const _0x1ae690=_0x2f3c02,_0x48765f={'lZfxM':function(_0x5c02d1){return _0x5c02d1();},'jmKIa':'✓\x20~/.ranger/\x20directory\x20already\x20exists'};void _0x3494f0;const _0x3cd711=_0x48765f[_0x1ae690(0x16a)](getRangerHomeDir);return!existsSync(_0x3cd711)?(await mkdir(_0x3cd711,{'recursive':!![]}),console[_0x1ae690(0x15e)]('✓\x20Created\x20~/.ranger/\x20directory'),{'path':_0x3cd711,'installed':!![]}):(console['log'](_0x48765f['jmKIa']),{'path':_0x3cd711,'installed':![]});}export async function ensureChromium(_0xfd233d=![]){const _0x1d1bc3=_0x2f3c02,_0x28c384={'aWTlg':_0x1d1bc3(0x157),'hmdXE':_0x1d1bc3(0x195),'XcnMC':'\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','MgBcb':function(_0x185428,_0x49a030){return _0x185428 instanceof _0x49a030;},'KEedP':_0x1d1bc3(0x189),'hpRlf':'You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'};let _0x1c4eaf=![];try{const _0x4e2485=chromium[_0x1d1bc3(0x137)]();_0x1c4eaf=existsSync(_0x4e2485);}catch{_0x1c4eaf=![];}if(_0x1c4eaf)return console[_0x1d1bc3(0x15e)](_0x1d1bc3(0x17f)),![];const _0x49b7fb=getPlaywrightVersion(),_0x23cb36=_0x49b7fb??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x3f763e=!_0x49b7fb,_0x486e30=process[_0x1d1bc3(0x18f)][_0x1d1bc3(0x14a)]&&process[_0x1d1bc3(0x152)]['isTTY'];let _0x585e74=!![];if(_0x486e30){const {install:_0x1a064f}=await _0xf7d27[_0x1d1bc3(0x17d)]([{'type':_0x28c384['aWTlg'],'name':'install','message':_0x3f763e?_0x1d1bc3(0x138)+_0x23cb36+'\x20now?':_0x1d1bc3(0x135)+_0x23cb36+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x585e74=_0x1a064f;}else console['log'](_0x1d1bc3(0x13e)+_0x23cb36+(_0x3f763e?_0x28c384[_0x1d1bc3(0x131)]:'')+'...');if(_0x585e74){console['log']('\x0aInstalling\x20Chromium\x20browser...\x0a');try{await installChromiumBinary(_0x23cb36,_0xfd233d),console[_0x1d1bc3(0x15e)](_0x28c384['XcnMC']);}catch(_0x2f251a){console['error'](_0x1d1bc3(0x170),_0x28c384['MgBcb'](_0x2f251a,Error)?_0x2f251a['message']:_0x2f251a),console[_0x1d1bc3(0x15e)](_0x1d1bc3(0x16e)),console[_0x1d1bc3(0x15e)](_0x1d1bc3(0x190)+_0x23cb36+_0x1d1bc3(0x14b));}}else console['log'](_0x28c384[_0x1d1bc3(0x18c)]),console[_0x1d1bc3(0x15e)](_0x28c384['hpRlf']),console['log']('\x20\x20npx\x20playwright@'+_0x23cb36+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x520787){const _0x51f897=_0x2f3c02,_0x23634a={'eRZht':function(_0x427187,_0x4d1320,_0x515177){return _0x427187(_0x4d1320,_0x515177);},'VUejm':_0x51f897(0x19a)},_0x103c22=join(_0x520787,'.gitignore'),_0x5d7d54=_0x51f897(0x16d);await _0x23634a[_0x51f897(0x145)](writeFile,_0x103c22,_0x5d7d54),console[_0x51f897(0x15e)](_0x23634a[_0x51f897(0x171)]);}export async function ensureLocalEnv(_0x46e017,_0x4243ac){const _0x46d67b=_0x2f3c02,_0x404d51={'FPhns':function(_0x4bf559){return _0x4bf559();},'zEugL':function(_0x2ff81f,_0x33b263){return _0x2ff81f===_0x33b263;},'CDpqE':_0x46d67b(0x185),'XOYkc':function(_0x5555f7,_0x27272a,_0x36234a,_0x36fcff){return _0x5555f7(_0x27272a,_0x36234a,_0x36fcff);},'OwZCh':'\x0a❌\x20Profile\x20setup\x20failed:'};if(!_0x404d51['FPhns'](findGitRoot)&&_0x46e017?.['scope']!=='user')return console['log']('⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.'),{'ready':![],'skipped':!![]};const _0x3f05c9=_0x404d51['zEugL'](_0x46e017?.['scope'],'user')?getRangerHomeDir():undefined;if(findExistingEnv(_0x404d51[_0x46d67b(0x158)],{'locations':[_0x404d51['CDpqE']],'rangerDir':_0x3f05c9}))return console[_0x46d67b(0x15e)](_0x46d67b(0x163)),{'ready':!![],'skipped':![]};try{return await _0x404d51['XOYkc'](addEnv,_0x404d51['CDpqE'],{'url':_0x46e017?.[_0x46d67b(0x180)],'force':_0x46e017?.['force'],'allowInsecureLocalhost':_0x46e017?.['allowInsecureLocalhost'],'scope':_0x46e017?.[_0x46d67b(0x169)]},_0x4243ac),{'ready':!![],'skipped':![]};}catch(_0x3ef5cc){return console[_0x46d67b(0x146)](_0x404d51[_0x46d67b(0x188)],_0x3ef5cc instanceof Error?_0x3ef5cc[_0x46d67b(0x150)]:_0x3ef5cc),{'ready':![],'skipped':![]};}}export async function start(_0x2ec5b0,_0x3e4398,_0x57d510){const _0x303faf=_0x2f3c02,_0x30d6b1={'RgYAh':'\x0a🚀\x20Ranger\x20Setup\x0a','bVcfE':function(_0x574898,_0x2b0948){return _0x574898!==_0x2b0948;},'zrhvo':_0x303faf(0x197),'RYSYw':function(_0x1f1c7b,_0x514578){return _0x1f1c7b(_0x514578);},'ohVvz':_0x303faf(0x168),'tWMto':'auth','OcQYe':function(_0x4faa0b,_0x273a57){return _0x4faa0b(_0x273a57);},'bDarl':_0x303faf(0x132),'xiEzF':'plugin','xCGbu':function(_0x3ec4c5,_0x4519b8){return _0x3ec4c5&&_0x4519b8;},'JtrwJ':function(_0x47a16e,_0x18d809,_0x3e14ca){return _0x47a16e(_0x18d809,_0x3e14ca);},'vxFub':_0x303faf(0x134),'EwprS':function(_0x57bffa){return _0x57bffa();},'iVqzp':_0x303faf(0x184),'luoPC':function(_0x5d6c32,_0x5c850c){return _0x5d6c32(_0x5c850c);},'msdCH':'profile','OKObF':function(_0x177fc3,_0x2aeb33,_0x35f548){return _0x177fc3(_0x2aeb33,_0x35f548);},'LOKqp':function(_0x2d9eae,_0x3df7e4){return _0x2d9eae+_0x3df7e4;},'MRbCc':_0x303faf(0x178),'AwEMh':'with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','Aqgdz':function(_0x5f48b7,_0x5b30c9){return _0x5f48b7+_0x5b30c9;}};console[_0x303faf(0x15e)](_0x30d6b1[_0x303faf(0x175)]);_0x30d6b1['bVcfE'](_0x3e4398?.['scope'],undefined)&&_0x3e4398['scope']!==_0x303faf(0x197)&&(console[_0x303faf(0x146)]('ranger\x20setup\x20--scope='+String(_0x3e4398[_0x303faf(0x169)])+_0x303faf(0x13f)+_0x303faf(0x17e)+_0x303faf(0x17c)),process[_0x303faf(0x14d)](0x1));_0x3e4398={..._0x3e4398,'scope':_0x30d6b1[_0x303faf(0x18e)]};const _0x50abbf=!_0x30d6b1[_0x303faf(0x181)](existsSync,getRangerHomeDir());await ensureRangerDir(_0x30d6b1['zrhvo']);if(_0x3e4398?.['skipAuth'])console['log'](_0x30d6b1[_0x303faf(0x167)]),_0x57d510?.[_0x303faf(0x14f)]('auth',{'isFirstRun':_0x50abbf,'method':'skipped'});else{_0x57d510?.['trackPhaseStart'](_0x30d6b1[_0x303faf(0x159)]);const _0x1933fd=await _0x30d6b1['OcQYe'](authenticate,_0x2ec5b0);_0x57d510?.[_0x303faf(0x14f)]('auth',{'isFirstRun':_0x50abbf,'method':_0x1933fd[_0x303faf(0x136)]});}_0x57d510?.[_0x303faf(0x16c)](_0x30d6b1['bDarl']);_0x3e4398?.['skipChromium']?console[_0x303faf(0x15e)]('✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)'):await _0x30d6b1['OcQYe'](ensureChromium,_0x3e4398?.[_0x303faf(0x179)]);_0x57d510?.[_0x303faf(0x14f)](_0x303faf(0x132),{'isFirstRun':_0x50abbf,'skipped':!!_0x3e4398?.['skipChromium']}),console[_0x303faf(0x15e)]('\x0a✅\x20Ranger\x20setup\x20complete!\x0a');const _0x1000ac=_0x3e4398?.['scope'],_0x1c4dfb=_0x3e4398?.[_0x303faf(0x149)]??![];let _0x525f4a=null;_0x1c4dfb?(_0x57d510?.['trackPhaseStart'](_0x30d6b1[_0x303faf(0x141)]),_0x525f4a=await _0x30d6b1['OcQYe'](ensureOpencodePluginConfig,_0x1000ac),_0x57d510?.[_0x303faf(0x14f)](_0x30d6b1['xiEzF'],{'isFirstRun':_0x50abbf,'opencode':!![]})):(_0x57d510?.[_0x303faf(0x16c)]('plugin'),await _0x30d6b1['OcQYe'](ensureClaudePlugin,_0x1000ac),_0x57d510?.[_0x303faf(0x14f)](_0x30d6b1['xiEzF'],{'isFirstRun':_0x50abbf}));if(_0x30d6b1[_0x303faf(0x193)](_0x1c4dfb,_0x525f4a)){_0x57d510?.[_0x303faf(0x16c)](_0x303faf(0x184));try{await _0x30d6b1['JtrwJ'](installSkill,_0x30d6b1[_0x303faf(0x162)],{'level':_0x525f4a['scope'],'cliVersion':_0x30d6b1['EwprS'](getCurrentVersion),'platform':_0x303faf(0x149)}),_0x57d510?.['trackPhaseEnd'](_0x30d6b1['iVqzp'],{'isFirstRun':_0x50abbf,'opencode':!![]});}catch(_0x147ec3){console[_0x303faf(0x15d)]('\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:',_0x147ec3 instanceof Error?_0x147ec3[_0x303faf(0x150)]:_0x147ec3),_0x57d510?.['trackPhaseEnd']('skills',{'isFirstRun':_0x50abbf,'opencode':!![],'failed':!![]});}}else _0x57d510?.[_0x303faf(0x16c)]('skills'),await _0x30d6b1['luoPC'](ensureClaudeSkills,_0x1000ac),_0x57d510?.['trackPhaseEnd'](_0x303faf(0x184),{'isFirstRun':_0x50abbf});if(_0x3e4398?.['skipAuth'])console[_0x303faf(0x15e)](_0x303faf(0x196));else{if(_0x3e4398?.['url']){_0x57d510?.[_0x303faf(0x16c)](_0x30d6b1[_0x303faf(0x143)]);const _0xbd15ba=await _0x30d6b1[_0x303faf(0x15c)](ensureLocalEnv,{'url':_0x3e4398['url'],'force':_0x3e4398?.[_0x303faf(0x154)],'allowInsecureLocalhost':_0x3e4398?.[_0x303faf(0x187)],'scope':_0x30d6b1[_0x303faf(0x18e)]},_0x57d510);_0x57d510?.[_0x303faf(0x14f)]('profile',{'isFirstRun':_0x50abbf,'profileReady':_0xbd15ba[_0x303faf(0x140)],'userSkipped':_0xbd15ba[_0x303faf(0x15a)]});}else console[_0x303faf(0x15e)](_0x30d6b1['LOKqp']('\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:'+(_0x303faf(0x177)+bold(_0x303faf(0x186)))+_0x303faf(0x155),'\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:')+_0x303faf(0x164));}if(_0x1c4dfb)console[_0x303faf(0x15e)](_0x30d6b1['MRbCc']),console[_0x303faf(0x15e)](_0x303faf(0x194)),console[_0x303faf(0x15e)](_0x30d6b1['AwEMh']),console['log']('verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.');else{const _0x3c8151=_0x30d6b1[_0x303faf(0x181)](bold,'/ranger:enable');console[_0x303faf(0x15e)](_0x30d6b1['Aqgdz'](_0x30d6b1['Aqgdz'](_0x303faf(0x14e)+_0x3c8151+_0x303faf(0x166),'\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with'),'\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser')+_0x303faf(0x16f));}}
1
+ const _0x5782b5=_0x176a;(function(_0x3731c0,_0x284f4b){const _0x4ee03b=_0x176a,_0xfbada0=_0x3731c0();while(!![]){try{const _0x5f4063=parseInt(_0x4ee03b(0xe5))/0x1+parseInt(_0x4ee03b(0xe7))/0x2+parseInt(_0x4ee03b(0xe4))/0x3+parseInt(_0x4ee03b(0xbf))/0x4+parseInt(_0x4ee03b(0x11b))/0x5*(parseInt(_0x4ee03b(0xf7))/0x6)+parseInt(_0x4ee03b(0xd3))/0x7*(-parseInt(_0x4ee03b(0xe6))/0x8)+-parseInt(_0x4ee03b(0xfb))/0x9;if(_0x5f4063===_0x284f4b)break;else _0xfbada0['push'](_0xfbada0['shift']());}catch(_0x463fa2){_0xfbada0['push'](_0xfbada0['shift']());}}}(_0x14a9,0x6b655));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';function _0x14a9(){const _0x64104f=['skipChromium','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','warn','lrRYv','LoXAP','.gitignore','method','\x0a🚀\x20Ranger\x20Setup\x0a','organizationName','\x20\x20npx\x20playwright@','auth','log','VdVXR','chromium','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','stdin','existing_token','npx','7YsednA','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','scope','TFZpF','platform','GITHUB_ENV','url','RtYRT','✓\x20Created\x20~/.ranger/\x20directory','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','user','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','YswWP','\x1b[0m','✓\x20Playwright\x20Chromium\x20browser\x20found','skills','2053470lVaqXt','796782eLHQzD','498248QuBYXA','1430906iiVGNC','zkBKq','skipAuth','✓\x20Created\x20.ranger/.gitignore','The\x20required\x20version\x20(','ymKlY','HLbQD','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','success','vsoFW','✓\x20Exported\x20credentials\x20for\x20CI','sjcfg','FhWaV','inherit','SQqpu','skipped','5268084OCsQgL','\x0a⚠\x20Skipping\x20Chromium\x20installation.','opencode','version','23387607GSmOoB','stdout','exit','\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','\x0a\x20\x20','pmzWP','\x20now?','You\x20can\x20install\x20it\x20manually\x20by\x20running:','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','ranger\x20setup\x20--scope=','\x0a❌\x20Profile\x20setup\x20failed:','ready','fPLuC','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','✓\x20Already\x20authenticated\x20to\x20','MRfHt','xUSDB','withDeps','device_auth','OoUfm','txNws','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','isTTY','1.58.2','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','\x1b[1m','SFKmg','--with-deps','ignore','trackPhaseEnd','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','UJrkh','5sWQtNE','\x20(fallback\x20version)','Authentication\x20failed:\x20','...','trackPhaseStart','error','install','OsUTb','force','✓\x20Authenticated\x20to\x20','playwright@','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','sdUho','ranger','message','xLcdl','WXhyI','104232KwuXNJ','\x20install\x20chromium'];_0x14a9=function(){return _0x64104f;};return _0x14a9();}import{spawn}from'child_process';import _0x3b8a3a 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';function _0x176a(_0xd10cb,_0x451a8a){_0xd10cb=_0xd10cb-0xb3;const _0x14a91f=_0x14a9();let _0x176abd=_0x14a91f[_0xd10cb];return _0x176abd;}import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION=_0x5782b5(0x112);const bold=_0x32af46=>_0x5782b5(0x114)+_0x32af46+_0x5782b5(0xe1);export function getPlaywrightVersion(){const _0x395f0b=_0x5782b5,_0x36e089={'CkMYG':'playwright/package.json'};try{const _0x1e6ed6=require['resolve'](_0x36e089['CkMYG']),_0x17f424=require(_0x1e6ed6);return _0x17f424[_0x395f0b(0xfa)];}catch{return null;}}export function installChromiumBinary(_0x345c6b,_0x4ea5d2=![]){const _0x1f992c=_0x5782b5,_0x40211a={'piitl':function(_0x2a4e6d,_0x4bcb03){return _0x2a4e6d===_0x4bcb03;},'PReOC':function(_0x2786fa,_0x45eb15){return _0x2786fa(_0x45eb15);},'dOFtx':_0x1f992c(0xb4),'TKWep':function(_0x58a0fe,_0x752810,_0x563b9c,_0x431e97){return _0x58a0fe(_0x752810,_0x563b9c,_0x431e97);},'xLcdl':_0x1f992c(0xd2),'RtYRT':_0x1f992c(0xf4),'pmzWP':'win32','VdVXR':'close','RtwmB':'error'};return new Promise((_0x30806b,_0x2031c5)=>{const _0x582b38=_0x1f992c,_0x2b7991={'zkBKq':function(_0x22b1b5,_0x153a2c){return _0x40211a['piitl'](_0x22b1b5,_0x153a2c);},'cflNX':function(_0x486000,_0x267811){return _0x40211a['PReOC'](_0x486000,_0x267811);}},_0x567062=[_0x582b38(0xb8)+_0x345c6b,_0x40211a['dOFtx'],..._0x4ea5d2?[_0x582b38(0x116)]:[],_0x582b38(0xce)],_0x4296d6=_0x40211a['TKWep'](spawn,_0x40211a[_0x582b38(0xbd)],_0x567062,{'stdio':[_0x582b38(0x117),_0x40211a[_0x582b38(0xda)],_0x40211a['RtYRT']],'shell':process[_0x582b38(0xd7)]===_0x40211a[_0x582b38(0x100)]});_0x4296d6['on'](_0x40211a[_0x582b38(0xcd)],_0x43c8f7=>{const _0x46cf80=_0x582b38;_0x2b7991[_0x46cf80(0xe8)](_0x43c8f7,0x0)?_0x30806b():_0x2b7991['cflNX'](_0x2031c5,new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x43c8f7));}),_0x4296d6['on'](_0x40211a['RtwmB'],_0x384d30=>{_0x2b7991['cflNX'](_0x2031c5,_0x384d30);});});}export async function authenticate(_0x4a6adb){const _0x1c17bb=_0x5782b5,_0x246ac8={'AzTEM':function(_0x1b87f6,_0x588ec7){return _0x1b87f6(_0x588ec7);},'OfHGM':function(_0x4c6cf0){return _0x4c6cf0();},'oiGPV':function(_0x5e73e5,_0x525950){return _0x5e73e5 instanceof _0x525950;},'FhWaV':function(_0x23153c,_0x173b21){return _0x23153c(_0x173b21);},'NSeau':_0x1c17bb(0xf1),'OsUTb':'✓\x20Stored\x20credentials\x20locally'};if(!_0x4a6adb){const _0x4b4b57=await getToken();if(_0x4b4b57){const _0x621f9f=await _0x246ac8['AzTEM'](getCurrentUser,_0x4b4b57);if(_0x621f9f['success'])return console['log'](_0x1c17bb(0x109)+_0x621f9f[_0x1c17bb(0xdd)][_0x1c17bb(0xc9)]),{'token':_0x4b4b57,'method':_0x1c17bb(0xd1)};}try{_0x4a6adb=await _0x246ac8['OfHGM'](runDeviceAuthFlow);}catch(_0x41b56f){throw new Error(_0x1c17bb(0x11d)+(_0x246ac8['oiGPV'](_0x41b56f,Error)?_0x41b56f[_0x1c17bb(0xbc)]:_0x41b56f));}const _0x4eab12=await getCurrentUser(_0x4a6adb);if(!_0x4eab12[_0x1c17bb(0xef)])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x4eab12[_0x1c17bb(0xb3)]);return console[_0x1c17bb(0xcc)](_0x1c17bb(0xb7)+_0x4eab12[_0x1c17bb(0xdd)]['organizationName']),{'token':_0x4a6adb,'method':_0x1c17bb(0x10d)};}console[_0x1c17bb(0xcc)]('Validating\x20API\x20token...');const _0x43a5d8=await _0x246ac8[_0x1c17bb(0xf3)](getCurrentUser,_0x4a6adb);if(!_0x43a5d8['success']){if(_0x43a5d8['status'])throw new Error(_0x1c17bb(0x11d)+_0x43a5d8['error']+_0x1c17bb(0x110));else throw new Error(_0x1c17bb(0x119)+_0x43a5d8[_0x1c17bb(0xb3)]+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console[_0x1c17bb(0xcc)](_0x1c17bb(0xb7)+_0x43a5d8['user']['organizationName']),await _0x246ac8[_0x1c17bb(0xf3)](storeToken,_0x4a6adb),console[_0x1c17bb(0xcc)](process['env'][_0x1c17bb(0xd8)]?_0x246ac8['NSeau']:_0x246ac8[_0x1c17bb(0xb5)]),{'token':_0x4a6adb,'method':'provided_token'};}export async function ensureRangerDir(_0x527d24){const _0x356145=_0x5782b5,_0x226da6={'rPgTb':function(_0x3b0935){return _0x3b0935();},'fCjfh':function(_0x57fb92,_0x3402d7){return _0x57fb92(_0x3402d7);},'Bgzsm':function(_0x39fa5f,_0x3c1c8a,_0x529bf1){return _0x39fa5f(_0x3c1c8a,_0x529bf1);},'cVDCc':_0x356145(0xdb),'leAVD':'✓\x20~/.ranger/\x20directory\x20already\x20exists'};void _0x527d24;const _0x5a9b46=_0x226da6['rPgTb'](getRangerHomeDir);return!_0x226da6['fCjfh'](existsSync,_0x5a9b46)?(await _0x226da6['Bgzsm'](mkdir,_0x5a9b46,{'recursive':!![]}),console['log'](_0x226da6['cVDCc']),{'path':_0x5a9b46,'installed':!![]}):(console['log'](_0x226da6['leAVD']),{'path':_0x5a9b46,'installed':![]});}export async function ensureChromium(_0x33ab71=![]){const _0x2b36aa=_0x5782b5,_0x2cae2a={'HLbQD':function(_0xe525aa,_0x500ab8){return _0xe525aa(_0x500ab8);},'xUSDB':function(_0x471039){return _0x471039();},'LoXAP':'confirm','BgzIq':'install','SFKmg':'\x0aInstalling\x20Chromium\x20browser...\x0a','FfzHD':function(_0x47916f,_0x44826f,_0x2cd616){return _0x47916f(_0x44826f,_0x2cd616);},'sdUho':function(_0x451076,_0xbd09c4){return _0x451076 instanceof _0xbd09c4;},'ymKlY':_0x2b36aa(0xd4)};let _0x348db3=![];try{const _0x6a84cf=chromium['executablePath']();_0x348db3=_0x2cae2a[_0x2b36aa(0xed)](existsSync,_0x6a84cf);}catch{_0x348db3=![];}if(_0x348db3)return console['log'](_0x2b36aa(0xe2)),![];const _0x1bdb83=_0x2cae2a[_0x2b36aa(0x10b)](getPlaywrightVersion),_0x39614b=_0x1bdb83??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0xe424aa=!_0x1bdb83,_0x4f527d=process[_0x2b36aa(0xd0)][_0x2b36aa(0x111)]&&process[_0x2b36aa(0xfc)][_0x2b36aa(0x111)];let _0x4e003a=!![];if(_0x4f527d){const {install:_0x36e67a}=await _0x3b8a3a['prompt']([{'type':_0x2cae2a[_0x2b36aa(0xc5)],'name':_0x2cae2a['BgzIq'],'message':_0xe424aa?_0x2b36aa(0xc2)+_0x39614b+_0x2b36aa(0x101):_0x2b36aa(0xeb)+_0x39614b+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x4e003a=_0x36e67a;}else console[_0x2b36aa(0xcc)]('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x39614b+(_0xe424aa?_0x2b36aa(0x11c):'')+_0x2b36aa(0x11e));if(_0x4e003a){console[_0x2b36aa(0xcc)](_0x2cae2a[_0x2b36aa(0x115)]);try{await _0x2cae2a['FfzHD'](installChromiumBinary,_0x39614b,_0x33ab71),console['log'](_0x2b36aa(0x108));}catch(_0x439f05){console[_0x2b36aa(0xb3)]('\x0a❌\x20Failed\x20to\x20install\x20Chromium:',_0x2cae2a[_0x2b36aa(0xba)](_0x439f05,Error)?_0x439f05[_0x2b36aa(0xbc)]:_0x439f05),console[_0x2b36aa(0xcc)](_0x2b36aa(0x102)),console[_0x2b36aa(0xcc)](_0x2b36aa(0xca)+_0x39614b+_0x2b36aa(0xc0));}}else console['log'](_0x2b36aa(0xf8)),console[_0x2b36aa(0xcc)](_0x2cae2a[_0x2b36aa(0xec)]),console[_0x2b36aa(0xcc)](_0x2b36aa(0xca)+_0x39614b+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x38b7b6){const _0x2fecc1=_0x5782b5,_0x4bc8a5={'ZYsWH':function(_0x2f9079,_0x12be31,_0x2b83f6){return _0x2f9079(_0x12be31,_0x2b83f6);}},_0x35561a=join(_0x38b7b6,_0x2fecc1(0xc6)),_0x3f2e77=_0x2fecc1(0xfe);await _0x4bc8a5['ZYsWH'](writeFile,_0x35561a,_0x3f2e77),console['log'](_0x2fecc1(0xea));}export async function ensureLocalEnv(_0x415eea,_0x1d2fa6){const _0x20d073=_0x5782b5,_0x17f957={'TtsfF':function(_0x3963f1){return _0x3963f1();},'foiQm':function(_0x5889af,_0x49ba12,_0x265721){return _0x5889af(_0x49ba12,_0x265721);},'WXhyI':'local','rRgVo':'✓\x20Local\x20profile\x20already\x20exists','Aqarh':function(_0x2dea65,_0x2823de,_0x468549,_0x3cb815){return _0x2dea65(_0x2823de,_0x468549,_0x3cb815);},'IKbXx':_0x20d073(0x105),'SQqpu':function(_0x31bf0a,_0x215d8f){return _0x31bf0a instanceof _0x215d8f;}};if(!_0x17f957['TtsfF'](findGitRoot)&&_0x415eea?.[_0x20d073(0xd5)]!==_0x20d073(0xdd))return console[_0x20d073(0xcc)](_0x20d073(0xee)),{'ready':![],'skipped':!![]};const _0x5813df=_0x415eea?.['scope']===_0x20d073(0xdd)?getRangerHomeDir():undefined;if(_0x17f957['foiQm'](findExistingEnv,_0x17f957[_0x20d073(0xbe)],{'locations':[_0x17f957[_0x20d073(0xbe)]],'rangerDir':_0x5813df}))return console[_0x20d073(0xcc)](_0x17f957['rRgVo']),{'ready':!![],'skipped':![]};try{return await _0x17f957['Aqarh'](addEnv,'local',{'url':_0x415eea?.['url'],'force':_0x415eea?.[_0x20d073(0xb6)],'allowInsecureLocalhost':_0x415eea?.['allowInsecureLocalhost'],'scope':_0x415eea?.['scope']},_0x1d2fa6),{'ready':!![],'skipped':![]};}catch(_0x35bb5f){return console['error'](_0x17f957['IKbXx'],_0x17f957[_0x20d073(0xf5)](_0x35bb5f,Error)?_0x35bb5f[_0x20d073(0xbc)]:_0x35bb5f),{'ready':![],'skipped':![]};}}export async function start(_0x4cc81c,_0x1deb97,_0x13735a){const _0x2b94a0=_0x5782b5,_0x38ab3f={'LiThe':_0x2b94a0(0xdd),'MRfHt':function(_0x46f9ee,_0x54a414){return _0x46f9ee(_0x54a414);},'qyOeH':function(_0x293459,_0xce14bc){return _0x293459(_0xce14bc);},'sjcfg':_0x2b94a0(0xf6),'OkExd':'auth','txNws':'✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','ZNEcD':_0x2b94a0(0xce),'seDfG':_0x2b94a0(0xde),'UJrkh':'plugin','fPLuC':function(_0x3eb065,_0x3a57fe){return _0x3eb065(_0x3a57fe);},'YswWP':function(_0x3c5fbe,_0x1cad06){return _0x3c5fbe&&_0x1cad06;},'govSn':'opencode','lrRYv':_0x2b94a0(0xe3),'JqEKZ':_0x2b94a0(0x103),'PLlfJ':'profile','TFZpF':function(_0x57c818,_0x312e9b){return _0x57c818+_0x312e9b;},'vsoFW':'ranger\x20profile\x20add\x20<name>','OoUfm':_0x2b94a0(0x113),'ssEHk':_0x2b94a0(0xb9),'PKSMz':'/ranger:enable'};console['log'](_0x2b94a0(0xc8));_0x1deb97?.['scope']!==undefined&&_0x1deb97[_0x2b94a0(0xd5)]!==_0x2b94a0(0xdd)&&(console[_0x2b94a0(0xb3)](_0x2b94a0(0x104)+String(_0x1deb97['scope'])+'\x20is\x20no\x20longer\x20supported.\x20'+_0x2b94a0(0xdf)+'project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.'),process[_0x2b94a0(0xfd)](0x1));_0x1deb97={..._0x1deb97,'scope':_0x38ab3f['LiThe']};const _0x2c46d5=!_0x38ab3f[_0x2b94a0(0x10a)](existsSync,getRangerHomeDir());await _0x38ab3f['qyOeH'](ensureRangerDir,'user');if(_0x1deb97?.[_0x2b94a0(0xe9)])console['log']('✓\x20Skipping\x20authentication\x20(--skip-auth)'),_0x13735a?.[_0x2b94a0(0x118)](_0x2b94a0(0xcb),{'isFirstRun':_0x2c46d5,'method':_0x38ab3f[_0x2b94a0(0xf2)]});else{_0x13735a?.['trackPhaseStart']('auth');const _0x308c10=await authenticate(_0x4cc81c);_0x13735a?.['trackPhaseEnd'](_0x38ab3f['OkExd'],{'isFirstRun':_0x2c46d5,'method':_0x308c10[_0x2b94a0(0xc7)]});}_0x13735a?.['trackPhaseStart'](_0x2b94a0(0xce));_0x1deb97?.[_0x2b94a0(0xc1)]?console['log'](_0x38ab3f[_0x2b94a0(0x10f)]):await ensureChromium(_0x1deb97?.[_0x2b94a0(0x10c)]);_0x13735a?.[_0x2b94a0(0x118)](_0x38ab3f['ZNEcD'],{'isFirstRun':_0x2c46d5,'skipped':!!_0x1deb97?.['skipChromium']}),console['log'](_0x38ab3f['seDfG']);const _0x3d010a=_0x1deb97?.['scope'],_0x1a6c96=_0x1deb97?.[_0x2b94a0(0xf9)]??![];let _0x5244cf=null;_0x1a6c96?(_0x13735a?.['trackPhaseStart'](_0x38ab3f['UJrkh']),_0x5244cf=await _0x38ab3f['fPLuC'](ensureOpencodePluginConfig,_0x3d010a),_0x13735a?.['trackPhaseEnd']('plugin',{'isFirstRun':_0x2c46d5,'opencode':!![]})):(_0x13735a?.[_0x2b94a0(0x11f)](_0x38ab3f[_0x2b94a0(0x11a)]),await _0x38ab3f[_0x2b94a0(0x107)](ensureClaudePlugin,_0x3d010a),_0x13735a?.[_0x2b94a0(0x118)]('plugin',{'isFirstRun':_0x2c46d5}));if(_0x38ab3f[_0x2b94a0(0xe0)](_0x1a6c96,_0x5244cf)){_0x13735a?.[_0x2b94a0(0x11f)]('skills');try{await installSkill(_0x2b94a0(0xbb),{'level':_0x5244cf[_0x2b94a0(0xd5)],'cliVersion':getCurrentVersion(),'platform':_0x38ab3f['govSn']}),_0x13735a?.['trackPhaseEnd'](_0x38ab3f['lrRYv'],{'isFirstRun':_0x2c46d5,'opencode':!![]});}catch(_0x26c375){console[_0x2b94a0(0xc3)](_0x38ab3f['JqEKZ'],_0x26c375 instanceof Error?_0x26c375['message']:_0x26c375),_0x13735a?.['trackPhaseEnd'](_0x38ab3f[_0x2b94a0(0xc4)],{'isFirstRun':_0x2c46d5,'opencode':!![],'failed':!![]});}}else _0x13735a?.[_0x2b94a0(0x11f)]('skills'),await ensureClaudeSkills(_0x3d010a),_0x13735a?.['trackPhaseEnd'](_0x2b94a0(0xe3),{'isFirstRun':_0x2c46d5});if(_0x1deb97?.['skipAuth'])console['log']('\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a');else{if(_0x1deb97?.['url']){_0x13735a?.[_0x2b94a0(0x11f)](_0x38ab3f['PLlfJ']);const _0x2ffa66=await ensureLocalEnv({'url':_0x1deb97[_0x2b94a0(0xd9)],'force':_0x1deb97?.[_0x2b94a0(0xb6)],'allowInsecureLocalhost':_0x1deb97?.['allowInsecureLocalhost'],'scope':_0x2b94a0(0xdd)},_0x13735a);_0x13735a?.['trackPhaseEnd'](_0x38ab3f['PLlfJ'],{'isFirstRun':_0x2c46d5,'profileReady':_0x2ffa66[_0x2b94a0(0x106)],'userSkipped':_0x2ffa66['skipped']});}else console['log'](_0x38ab3f['TFZpF'](_0x38ab3f[_0x2b94a0(0xd6)](_0x2b94a0(0xcf)+(_0x2b94a0(0xff)+bold(_0x38ab3f[_0x2b94a0(0xf0)])),'\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)')+'\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles'));}if(_0x1a6c96)console[_0x2b94a0(0xcc)](_0x38ab3f[_0x2b94a0(0x10e)]),console[_0x2b94a0(0xcc)]('and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review'),console['log'](_0x38ab3f['ssEHk']),console[_0x2b94a0(0xcc)]('verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.');else{const _0x237908=bold(_0x38ab3f['PKSMz']);console['log']('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x237908+'\x20and\x20prompt\x20the\x20coding'+_0x2b94a0(0xdc)+'\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'+'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.');}}
@@ -1 +1 @@
1
- const _0x3921db=_0x4c60;(function(_0x107dfe,_0x35795a){const _0x538da0=_0x4c60,_0xb217da=_0x107dfe();while(!![]){try{const _0x5f5bae=parseInt(_0x538da0(0x227))/0x1*(parseInt(_0x538da0(0x21c))/0x2)+-parseInt(_0x538da0(0x20c))/0x3+-parseInt(_0x538da0(0x22b))/0x4*(-parseInt(_0x538da0(0x23c))/0x5)+-parseInt(_0x538da0(0x1de))/0x6+-parseInt(_0x538da0(0x23d))/0x7*(-parseInt(_0x538da0(0x1e7))/0x8)+parseInt(_0x538da0(0x20b))/0x9*(-parseInt(_0x538da0(0x236))/0xa)+parseInt(_0x538da0(0x1f1))/0xb;if(_0x5f5bae===_0x35795a)break;else _0xb217da['push'](_0xb217da['shift']());}catch(_0x3ec75b){_0xb217da['push'](_0xb217da['shift']());}}}(_0x2d83,0xd046c));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';function _0x4c60(_0x2bd818,_0x530a9b){_0x2bd818=_0x2bd818-0x1d5;const _0x2d83ff=_0x2d83();let _0x4c605a=_0x2d83ff[_0x2bd818];return _0x4c605a;}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=_0x3fcc4a=>_0x3921db(0x1dc)+_0x3fcc4a+_0x3921db(0x238),link=(_0x450904,_0x97a9fa)=>'\x1b]8;;file://'+_0x450904+'\x07'+(_0x97a9fa||_0x450904)+_0x3921db(0x248);function _0x2d83(){const _0x3197f9=['API\x20Environment:\x20','details','19544oQhTfz','UZgju','disabled','push','Root:\x20','SnpuS','organizationName','UdKYN','ranger@trailhead','\x20[local]','4768467DThsVN','stdout','scope','name','HByie','configured','yizYw','hCGSe','aqPAn','\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>','filter','settings.json','no\x20session','none','version','(not\x20found)','GDLgW','data','log','bqdFV','bulwc','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','unknown','Organization:\x20','error','CseLz','11871xJaYoj','1575138bYTFXZ','bhoDS','\x20\x20Run:\x20ranger\x20skillup','env','isDirectory','includes','\x0a\x20\x20No\x20active\x20profile\x20set','FPzAZ','WotlD','\x20(active)','toString','auth.json','sXEeT','MqEsq','isActive','GSLGD','6pjxNgb','CaupT','\x20\x20\x20\x20Session:\x20','kldDd','WoMyi','GaNLi','ejMgz','displayName','status','bEkbD','isArray','41147UieKos','success','\x20\x20\x20\x20','\x20\x20User-level:','4783820qPbaYx','not_configured','ZxpHe','ePavf','\x20plugin(s)\x20configured','dSjdJ','yuOdF','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','API\x20Token:\x20✗\x20Not\x20found','vckbN','mWqwM','12120wHkUiO','dVbRv','\x1b[0m','\x20\x20Run:\x20ranger\x20setup\x20[token]','CMSAD','No\x20profiles\x20configured','5EweVGn','4648pGIuUa','has','opencode-plugin','\x20\x20Not\x20installed','plugin','user','path','API\x20URL:\x20','\x20cloud','debug','AJuRw','\x1b]8;;\x07','hasPlaintextAuth','\x20\x20Project-level:','some','join','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','sessionUpdatedAt','vNcQE','\x20\x20Run:\x20ranger\x20update','\x0a---\x20OpenCode\x20Plugin\x20---','\x20profiles\x20configured\x20(','zykIK','YHnRh','DEBUG','map','\x1b[1m','No\x20skills\x20installed','2389626AioikE','length','\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a','\x20local','not_installed','hasEncryptedAuth','aUZnC'];_0x2d83=function(){return _0x3197f9;};return _0x2d83();}async function getOpencodePluginStatus(){const _0x5f0a98=_0x3921db,_0x28f0dd={'rKDjL':'string','Uhhmh':function(_0x23ea1e,_0x31290d,_0x38c173,_0x29be17){return _0x23ea1e(_0x31290d,_0x38c173,_0x29be17);},'GDLgW':'opencode','ePavf':'config','PpZvy':'ignore','UZgju':'pipe','QahDm':_0x5f0a98(0x202),'MqEsq':_0x5f0a98(0x209)};return new Promise(_0x54af18=>{const _0x2f5a64=_0x5f0a98,_0x38ff1e={'GSLGD':function(_0x3a22fa,_0x4aabeb){return _0x3a22fa!==_0x4aabeb;},'YHnRh':_0x28f0dd['rKDjL'],'ZxpHe':function(_0x1793aa,_0x49e5a0){return _0x1793aa(_0x49e5a0);},'UdKYN':_0x2f5a64(0x1e2),'hjUDl':function(_0x238b65,_0x4ce181){return _0x238b65(_0x4ce181);},'ouqiG':_0x2f5a64(0x22c)},_0xa151b8=_0x28f0dd['Uhhmh'](spawn,_0x28f0dd[_0x2f5a64(0x201)],[_0x2f5a64(0x246),_0x28f0dd[_0x2f5a64(0x22e)]],{'stdio':[_0x28f0dd['PpZvy'],_0x28f0dd[_0x2f5a64(0x1e8)],'pipe']});let _0x43e490='';_0xa151b8[_0x2f5a64(0x1f2)]?.['on'](_0x28f0dd['QahDm'],_0x5d2057=>{const _0x4faac3=_0x2f5a64;_0x43e490+=_0x5d2057[_0x4faac3(0x216)]();}),_0xa151b8['stderr']?.['on'](_0x28f0dd['QahDm'],_0x3b335d=>{_0x43e490+=_0x3b335d['toString']();}),_0xa151b8['on'](_0x28f0dd[_0x2f5a64(0x219)],()=>{_0x54af18({'status':'not_installed'});}),_0xa151b8['on']('close',_0x277673=>{const _0x190bab=_0x2f5a64;if(_0x277673!==0x0){_0x38ff1e[_0x190bab(0x22d)](_0x54af18,{'status':_0x38ff1e[_0x190bab(0x1ee)]});return;}const _0x2ef133=_0x43e490['trim']();let _0x5790ae=null;if(_0x2ef133)try{_0x5790ae=JSON['parse'](_0x2ef133);}catch{const _0x315d13=_0x2ef133['match'](/\{[\s\S]*\}$/);if(_0x315d13)try{_0x5790ae=JSON['parse'](_0x315d13[0x0]);}catch{_0x5790ae=null;}}const _0x2b3d12=Array[_0x190bab(0x226)](_0x5790ae?.[_0x190bab(0x241)])?_0x5790ae?.[_0x190bab(0x241)]:[],_0x240a77=_0x2b3d12[_0x190bab(0x24b)](_0x34b87f=>{const _0x32c014=_0x190bab;if(_0x38ff1e[_0x32c014(0x21b)](typeof _0x34b87f,_0x38ff1e[_0x32c014(0x1d9)]))return![];return _0x34b87f['includes']('@ranger-testing/opencode-plugin')||_0x34b87f['includes'](_0x32c014(0x23f));});if(_0x240a77){_0x38ff1e['ZxpHe'](_0x54af18,{'status':_0x190bab(0x1f6),'details':_0x2b3d12[_0x190bab(0x1df)]>0x0?_0x2b3d12[_0x190bab(0x1df)]+_0x190bab(0x22f):undefined});return;}if(_0x2b3d12['length']>0x0){_0x38ff1e['hjUDl'](_0x54af18,{'status':_0x38ff1e['ouqiG'],'details':_0x2b3d12['length']+'\x20plugin(s)\x20configured'});return;}_0x38ff1e['hjUDl'](_0x54af18,{'status':'not_configured'});});});}async function getSkillsFromDir(_0x16d9e6,_0x516005){const _0x28a2d9=_0x3921db,_0x5439d8={'hoUgS':function(_0x1a1b22,_0x542075,_0x3d8b7c,_0x113e06){return _0x1a1b22(_0x542075,_0x3d8b7c,_0x113e06);},'dSjdJ':function(_0x1d16d4,_0x517c5a,_0x23562f){return _0x1d16d4(_0x517c5a,_0x23562f);}};if(!existsSync(_0x16d9e6))return[];const _0x254591=[];try{const _0xd2c5aa=await readdir(_0x16d9e6,{'withFileTypes':!![]});for(const _0x11eb7f of _0xd2c5aa){if(_0x11eb7f[_0x28a2d9(0x210)]()){const _0x5907ec=_0x5439d8['hoUgS'](join,_0x16d9e6,_0x11eb7f['name'],'SKILL.md');if(existsSync(_0x5907ec)){let _0x130bb7=_0x11eb7f[_0x28a2d9(0x1f4)];try{const _0xa801d4=await _0x5439d8[_0x28a2d9(0x230)](readFile,_0x5907ec,'utf-8'),_0x546873=_0xa801d4['match'](/name:\s*(.+)/);_0x546873&&(_0x130bb7=_0x546873[0x1]['trim']());}catch{}_0x254591[_0x28a2d9(0x1ea)]({'name':_0x11eb7f[_0x28a2d9(0x1f4)],'displayName':_0x130bb7,'path':_0x5907ec,'level':_0x516005});}}}}catch{return[];}return _0x254591;}async function getInstalledSkills(){const _0x1c2c0d=_0x3921db,_0x369084={'yuOdF':function(_0x57507f,_0x246aef,_0x58e95b){return _0x57507f(_0x246aef,_0x58e95b);},'RRoJh':function(_0x283c79){return _0x283c79();},'aUZnC':_0x1c2c0d(0x242)},[_0x571a29,_0x458ddb]=await Promise['all']([_0x369084[_0x1c2c0d(0x231)](getSkillsFromDir,_0x369084['RRoJh'](getProjectSkillsDir),'project'),_0x369084[_0x1c2c0d(0x231)](getSkillsFromDir,getUserSkillsDir(),_0x369084[_0x1c2c0d(0x1e4)])]);return{'project':_0x571a29,'user':_0x458ddb};}async function getEnvironments(){const _0x16ab3b=_0x3921db,_0x1e4074={'CseLz':function(_0x501ea4,_0x52d503){return _0x501ea4(_0x52d503);},'Zscmj':function(_0x20c2d9,_0x21007c,_0x4b6cf7){return _0x20c2d9(_0x21007c,_0x4b6cf7);},'isHEh':_0x16ab3b(0x1fc),'vckbN':function(_0x1efa0a,_0x36dc06,_0x11d2d2){return _0x1efa0a(_0x36dc06,_0x11d2d2);},'TmQan':function(_0x51b03a,_0x4024ed,_0x4da9e7){return _0x51b03a(_0x4024ed,_0x4da9e7);},'sXMRl':_0x16ab3b(0x200),'zykIK':function(_0x547a06,_0x5cef80){return _0x547a06(_0x5cef80);},'AJuRw':function(_0x2d7a16,_0x3edf8c){return _0x2d7a16===_0x3edf8c;},'CMSAD':function(_0x3ec811){return _0x3ec811();}},{envNames:_0x2320bb,activeEnv:_0x190532}=await getEnvNames(),_0xe7d4e3=_0x1e4074[_0x16ab3b(0x23a)](getRangerDir);if(!_0x1e4074['CseLz'](existsSync,_0xe7d4e3))return{'envs':[],'activeEnv':null};const _0x3fc242=_0x2320bb[_0x16ab3b(0x1db)](_0x98a6d3=>{const _0x3b7c69=_0x16ab3b,_0x1a11f1=_0x1e4074[_0x3b7c69(0x20a)](getEnvDir,_0x98a6d3),_0x59b7af=_0x1e4074['Zscmj'](join,_0x1a11f1,_0x1e4074['isHEh']),_0x273cf1=_0x1e4074[_0x3b7c69(0x234)](join,_0x1a11f1,_0x3b7c69(0x217)),_0x16bc59=_0x1e4074['TmQan'](join,_0x1a11f1,'auth.json.enc');return{'name':_0x98a6d3,'settingsPath':_0x1e4074['CseLz'](existsSync,_0x59b7af)?_0x59b7af:_0x1e4074['sXMRl'],'hasPlaintextAuth':existsSync(_0x273cf1),'hasEncryptedAuth':_0x1e4074[_0x3b7c69(0x1d8)](existsSync,_0x16bc59),'isActive':_0x1e4074[_0x3b7c69(0x247)](_0x98a6d3,_0x190532)};});return{'envs':_0x3fc242,'activeEnv':_0x190532};}export async function status(){const _0x374b92=_0x3921db,_0x3196de={'bEkbD':'\x0a📊\x20Ranger\x20Status\x0a','dVbRv':function(_0x1f6f0a,_0x3733c7){return _0x1f6f0a(_0x3733c7);},'GaNLi':function(_0x2ed6bf,_0x29ae1d,_0x41809c){return _0x2ed6bf(_0x29ae1d,_0x41809c);},'gIMhb':function(_0x5ccefe,_0x5326d8){return _0x5ccefe(_0x5326d8);},'hCGSe':function(_0x1c11e1,_0x401cf6){return _0x1c11e1(_0x401cf6);},'jktVn':function(_0x4ff89b){return _0x4ff89b();},'PLpDp':function(_0x44897d){return _0x44897d();},'FPzAZ':function(_0x2c1ae3){return _0x2c1ae3();},'oZfhI':function(_0x33d92b,_0x3e1300){return _0x33d92b(_0x3e1300);},'WotlD':function(_0x378f01){return _0x378f01();},'CaupT':function(_0x1e95d3){return _0x1e95d3();},'BSZmw':_0x374b92(0x1d6),'WoMyi':function(_0x57aca,_0x5eceab){return _0x57aca===_0x5eceab;},'kldDd':'configured','sXEeT':'@ranger-testing/opencode-plugin','EPlos':'\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','TpZsL':_0x374b92(0x207),'GbLJt':'enabled','bulwc':'ranger@trailhead','yizYw':_0x374b92(0x240),'bhoDS':function(_0x2448b0,_0xe94796){return _0x2448b0>_0xe94796;},'yZSBH':_0x374b92(0x24a),'aqPAn':_0x374b92(0x22a),'jpgls':function(_0x2ec58a,_0x5e4eea,_0xa00d05){return _0x2ec58a(_0x5e4eea,_0xa00d05);},'CufAs':function(_0x3d0945,_0x3d4d94){return _0x3d0945(_0x3d4d94);},'SnpuS':function(_0x14e701){return _0x14e701();},'bMzDP':function(_0x565ef8,_0x5372d3){return _0x565ef8+_0x5372d3;},'mWqwM':function(_0x18284a,_0x2766ac){return _0x18284a===_0x2766ac;},'bqdFV':function(_0x41288d,_0x27bde0){return _0x41288d>_0x27bde0;},'HByie':function(_0x11781a,_0x52e860){return _0x11781a>_0x52e860;},'qdLRs':function(_0x4570a9,_0x40baf8){return _0x4570a9(_0x40baf8);},'ejMgz':_0x374b92(0x215),'vNcQE':_0x374b92(0x1fd),'rutFK':'encrypted','kIkjB':_0x374b92(0x1fe)};console[_0x374b92(0x203)](_0x3196de[_0x374b92(0x225)]);const _0x5b6f98=process['cwd'](),_0x5bd9ce=getRangerDir();if(!_0x3196de['dVbRv'](existsSync,_0x5bd9ce)){console[_0x374b92(0x203)](_0x374b92(0x1eb)+_0x3196de['GaNLi'](link,_0x5b6f98,_0x3196de['dVbRv'](bold,basename(_0x5b6f98)))),console['log']('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console['log'](_0x374b92(0x1e0));return;}console[_0x374b92(0x203)](_0x374b92(0x1eb)+_0x3196de[_0x374b92(0x221)](link,_0x5b6f98,_0x3196de['gIMhb'](bold,_0x3196de[_0x374b92(0x1f8)](basename,_0x5b6f98))));const _0x3d3883=_0x3196de['jktVn'](getCurrentVersion),_0x351423=_0x3196de['PLpDp'](getLatestVersion);if(_0x351423['version']&&_0x351423[_0x374b92(0x1ff)]!==_0x3d3883)console[_0x374b92(0x203)]('Version:\x20'+_0x3d3883+'\x20(latest:\x20'+_0x351423['version']+')'),console['log'](_0x374b92(0x1d5));else _0x351423[_0x374b92(0x1ff)]?console['log']('Version:\x20'+_0x3d3883+'\x20(up\x20to\x20date)'):console[_0x374b92(0x203)]('Version:\x20'+_0x3d3883);const _0x3e1219=await _0x3196de[_0x374b92(0x213)](getToken);if(_0x3e1219){const _0x16b28b=await _0x3196de['oZfhI'](getCurrentUser,_0x3e1219);_0x16b28b[_0x374b92(0x228)]?console['log'](_0x374b92(0x208)+_0x3196de[_0x374b92(0x1f8)](bold,_0x16b28b['user'][_0x374b92(0x1ed)])):(console['log'](_0x374b92(0x232)),console[_0x374b92(0x203)](_0x374b92(0x239)));}else console[_0x374b92(0x203)](_0x374b92(0x233)),console[_0x374b92(0x203)]('\x20\x20Run:\x20ranger\x20setup\x20[token]');process[_0x374b92(0x20f)][_0x374b92(0x1da)]&&(console['log'](_0x374b92(0x1e5)+_0x3196de[_0x374b92(0x214)](getCurrentEnvironment)),console['log'](_0x374b92(0x244)+_0x3196de[_0x374b92(0x21d)](getApiBaseUrl)));console[_0x374b92(0x203)](_0x3196de['BSZmw']);const _0xb80109=await getOpencodePluginStatus();if(_0x3196de[_0x374b92(0x220)](_0xb80109['status'],_0x3196de[_0x374b92(0x21f)]))console[_0x374b92(0x203)]('\x20\x20'+bold(_0x3196de[_0x374b92(0x218)])+':\x20configured'),_0xb80109[_0x374b92(0x1e6)]&&console[_0x374b92(0x203)]('\x20\x20'+_0xb80109['details']);else _0xb80109[_0x374b92(0x224)]==='not_configured'?(console['log']('\x20\x20Not\x20configured'),_0xb80109['details']&&console[_0x374b92(0x203)]('\x20\x20'+_0xb80109['details']),console[_0x374b92(0x203)]('\x20\x20Run:\x20ranger\x20setup\x20--opencode')):console[_0x374b92(0x203)](_0x3196de['EPlos']);console[_0x374b92(0x203)]('\x0a---\x20Claude\x20Code\x20Plugin\x20---');const _0x58c0ea=await getPluginInfo(_0x374b92(0x1ef));if(_0x58c0ea){const _0x2659f4=_0x58c0ea[_0x374b92(0x1f3)]||_0x3196de['TpZsL'],_0x3a88e5=_0x58c0ea['enabled']?_0x3196de['GbLJt']:_0x374b92(0x1e9);console['log']('\x20\x20'+_0x3196de['hCGSe'](bold,_0x3196de[_0x374b92(0x205)])+':\x20installed\x20('+_0x2659f4+',\x20'+_0x3a88e5+')');}else console['log'](_0x3196de[_0x374b92(0x1f7)]),console[_0x374b92(0x203)](_0x374b92(0x24d));console['log']('\x0a---\x20Skills\x20---');const {project:_0x2fb3ca,user:_0x286ba4}=await _0x3196de['CaupT'](getInstalledSkills),_0x143d73=_0x2fb3ca['filter'](_0x136558=>RANGER_MANAGED_SKILLS[_0x374b92(0x211)](_0x136558['name'])),_0x2aa5b=_0x286ba4[_0x374b92(0x1fb)](_0x3cd494=>RANGER_MANAGED_SKILLS['includes'](_0x3cd494[_0x374b92(0x1f4)])),_0x2f9da4=_0x143d73['length']+_0x2aa5b['length'];if(_0x2f9da4===0x0)console['log'](_0x374b92(0x1dd)),console['log'](_0x374b92(0x20e));else{if(_0x3196de[_0x374b92(0x20d)](_0x143d73[_0x374b92(0x1df)],0x0)){console['log'](_0x3196de['yZSBH']);for(const _0x4c3d99 of _0x143d73){console[_0x374b92(0x203)]('\x20\x20\x20\x20'+bold(_0x4c3d99[_0x374b92(0x223)])+':\x20'+link(_0x4c3d99[_0x374b92(0x243)],_0x3196de['oZfhI'](basename,_0x4c3d99[_0x374b92(0x243)])));}}if(_0x2aa5b['length']>0x0){console['log'](_0x3196de[_0x374b92(0x1f9)]);for(const _0xa7d7b3 of _0x2aa5b){console[_0x374b92(0x203)](_0x374b92(0x229)+_0x3196de[_0x374b92(0x237)](bold,_0xa7d7b3[_0x374b92(0x223)])+':\x20'+_0x3196de['jpgls'](link,_0xa7d7b3[_0x374b92(0x243)],_0x3196de['CufAs'](basename,_0xa7d7b3[_0x374b92(0x243)])));}}}console[_0x374b92(0x203)]('\x0a---\x20Profiles\x20---');const {envs:_0x3ced86,activeEnv:_0x548a17}=await getEnvironments();let _0x4db6f4=[];if(_0x3e1219)try{_0x4db6f4=await _0x3196de[_0x374b92(0x1ec)](listCloudProfiles);}catch{}const _0x254811=_0x3196de['bMzDP'](_0x3ced86['length'],_0x4db6f4['length']);if(_0x3196de[_0x374b92(0x235)](_0x254811,0x0))console[_0x374b92(0x203)](_0x374b92(0x23b)),console[_0x374b92(0x203)](_0x374b92(0x1fa));else{if(_0x3196de[_0x374b92(0x204)](_0x254811,0x5)){const _0x353bdd=[];_0x3196de[_0x374b92(0x1f5)](_0x4db6f4['length'],0x0)&&_0x353bdd[_0x374b92(0x1ea)](_0x4db6f4[_0x374b92(0x1df)]+_0x374b92(0x245)),_0x3196de['HByie'](_0x3ced86[_0x374b92(0x1df)],0x0)&&_0x353bdd['push'](_0x3ced86[_0x374b92(0x1df)]+_0x374b92(0x1e1)),console['log'](_0x254811+_0x374b92(0x1d7)+_0x353bdd['join'](',\x20')+')'),_0x548a17&&console[_0x374b92(0x203)]('\x20\x20Active:\x20'+_0x3196de['qdLRs'](bold,_0x548a17)),console[_0x374b92(0x203)]('\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)');}else{for(const _0x426412 of _0x4db6f4){const _0x2b6dc7=_0x426412[_0x374b92(0x1f4)]===_0x548a17?_0x3196de[_0x374b92(0x222)]:'';console[_0x374b92(0x203)]('\x20\x20'+bold(_0x426412[_0x374b92(0x1f4)])+'\x20[cloud]'+_0x2b6dc7);const _0xf16729=_0x426412['sessionUpdatedAt']?'cached\x20(updated\x20'+_0x426412[_0x374b92(0x24e)]+')':_0x3196de[_0x374b92(0x24f)];console[_0x374b92(0x203)](_0x374b92(0x21e)+_0xf16729);}const _0x45e7da=new Set(_0x4db6f4[_0x374b92(0x1db)](_0x47e938=>_0x47e938[_0x374b92(0x1f4)]));for(const _0x39f8c0 of _0x3ced86){if(_0x45e7da[_0x374b92(0x23e)](_0x39f8c0[_0x374b92(0x1f4)]))continue;const _0x54457a=_0x39f8c0[_0x374b92(0x21a)]?_0x3196de[_0x374b92(0x222)]:'',_0x32b428=_0x39f8c0[_0x374b92(0x1e3)]?_0x3196de['rutFK']:_0x39f8c0[_0x374b92(0x249)]?'plaintext':_0x3196de['kIkjB'];console['log']('\x20\x20'+bold(_0x39f8c0[_0x374b92(0x1f4)])+_0x374b92(0x1f0)+_0x54457a),console['log']('\x20\x20\x20\x20Auth:\x20'+_0x32b428),_0x39f8c0['settingsPath']!==_0x374b92(0x200)&&console[_0x374b92(0x203)]('\x20\x20\x20\x20Settings:\x20'+link(_0x39f8c0['settingsPath'],basename(_0x39f8c0['settingsPath'])));}if(!_0x548a17){console[_0x374b92(0x203)](_0x374b92(0x212));const _0x36257b=[..._0x4db6f4['map'](_0x1fecd1=>_0x1fecd1['name']),..._0x3ced86['filter'](_0x382a3f=>!_0x45e7da['has'](_0x382a3f[_0x374b92(0x1f4)]))[_0x374b92(0x1db)](_0x36937f=>_0x36937f['name'])];console['log'](_0x374b92(0x206)+_0x36257b[_0x374b92(0x24c)](',\x20')+')');}}}console['log']('');}
1
+ const _0x52b416=_0x3ba0;(function(_0x51a743,_0xdd6946){const _0x13a06b=_0x3ba0,_0x1e9262=_0x51a743();while(!![]){try{const _0x19f947=-parseInt(_0x13a06b(0xb5))/0x1*(-parseInt(_0x13a06b(0xd8))/0x2)+-parseInt(_0x13a06b(0x10c))/0x3+-parseInt(_0x13a06b(0xb8))/0x4+-parseInt(_0x13a06b(0xe3))/0x5*(-parseInt(_0x13a06b(0x114))/0x6)+-parseInt(_0x13a06b(0xc9))/0x7*(parseInt(_0x13a06b(0x100))/0x8)+-parseInt(_0x13a06b(0xae))/0x9+parseInt(_0x13a06b(0xb9))/0xa;if(_0x19f947===_0xdd6946)break;else _0x1e9262['push'](_0x1e9262['shift']());}catch(_0x485d33){_0x1e9262['push'](_0x1e9262['shift']());}}}(_0x18d7,0x55ca3));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';function _0x18d7(){const _0x1659d9=['API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','\x20\x20Active:\x20','name','MogDP','user','close','stderr','6fgPVho','Mwtqj',':\x20installed\x20(','path','\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>','none','has','\x20\x20\x20\x20Settings:\x20','XxFKB','length','5233248DYGsLF','\x20plugin(s)\x20configured','Version:\x20','vnoXn','ranger@trailhead','configured','CTQus','1VtEdIt','\x0a---\x20Claude\x20Code\x20Plugin\x20---','AsIIY','300792lUTiEx','10888100EtkLIp','VRXIG','success','version','\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','Fsrjf','(not\x20found)','isArray','Organization:\x20','ReVDY','displayName','pipe','cvjJS','ZYhFw','ruDaF','details','4066867IAqhEb','filter','ignore','BuVOl','\x0a---\x20Profiles\x20---','status','stdout','disabled','enabled','encrypted','eQEPI','XuuSx','\x20cloud','\x0a📊\x20Ranger\x20Status\x0a','organizationName','21932nQFrqg','PBnyg','opencode-plugin','DnNRu','push','OARQZ','\x20[local]','string','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','settingsPath','parse','3419795aSnQMx','\x20\x20Run:\x20ranger\x20skillup','\x20(latest:\x20','Root:\x20','Waqtx','\x20profiles\x20configured\x20(','env','iDtlv','includes','log','join',':\x20configured','\x20\x20User-level:','\x20local','scope','utf-8','hfcJh','rrLce','pCAcN','not_installed','config','API\x20URL:\x20','API\x20Token:\x20✗\x20Not\x20found','IeDJt','auth.json.enc','not_configured','settings.json','map','project','8haFwkr','\x1b[0m','\x20\x20\x20\x20Session:\x20','WZuoV','\x20\x20Run:\x20ranger\x20setup\x20[token]','\x1b]8;;\x07','trim','No\x20profiles\x20configured','\x20\x20\x20\x20','error','xGBeX','IzDoE','584067twAAgT'];_0x18d7=function(){return _0x1659d9;};return _0x18d7();}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=_0x255caa=>'\x1b[1m'+_0x255caa+_0x52b416(0x101),link=(_0x1a4fdd,_0x1b9fab)=>'\x1b]8;;file://'+_0x1a4fdd+'\x07'+(_0x1b9fab||_0x1a4fdd)+_0x52b416(0x105);async function getOpencodePluginStatus(){const _0x25523e=_0x52b416,_0xf0e01e={'XuuSx':function(_0x388641,_0x3095bb){return _0x388641(_0x3095bb);},'xkwVk':_0x25523e(0xdf),'DnNRu':'@ranger-testing/opencode-plugin','CJNwd':function(_0x15ed78,_0x178bf9){return _0x15ed78!==_0x178bf9;},'AsIIY':_0x25523e(0xb3),'QDeFv':function(_0x3d9c03,_0x2e1ffc){return _0x3d9c03>_0x2e1ffc;},'BSIZy':_0x25523e(0xfc),'Fsrjf':'opencode','MPjPS':_0x25523e(0xf7),'giCku':_0x25523e(0xcb),'ItvRJ':_0x25523e(0xc4),'czllF':'data','jcbAA':_0x25523e(0x109),'fezfL':_0x25523e(0x112)};return new Promise(_0x494da0=>{const _0x53e2a6=_0x25523e,_0x35f278=spawn(_0xf0e01e[_0x53e2a6(0xbe)],['debug',_0xf0e01e['MPjPS']],{'stdio':[_0xf0e01e['giCku'],_0xf0e01e['ItvRJ'],'pipe']});let _0x14f863='';_0x35f278[_0x53e2a6(0xcf)]?.['on'](_0xf0e01e['czllF'],_0x2f5b9d=>{_0x14f863+=_0x2f5b9d['toString']();}),_0x35f278[_0x53e2a6(0x113)]?.['on']('data',_0x44529c=>{_0x14f863+=_0x44529c['toString']();}),_0x35f278['on'](_0xf0e01e['jcbAA'],()=>{const _0x3f1a1d=_0x53e2a6;_0xf0e01e[_0x3f1a1d(0xd4)](_0x494da0,{'status':_0x3f1a1d(0xf6)});}),_0x35f278['on'](_0xf0e01e['fezfL'],_0x4cddff=>{const _0x415e2f=_0x53e2a6,_0xdc2636={'BuVOl':_0xf0e01e['xkwVk'],'tPdtZ':_0xf0e01e[_0x415e2f(0xdb)]};if(_0xf0e01e['CJNwd'](_0x4cddff,0x0)){_0x494da0({'status':'not_installed'});return;}const _0x6dae2d=_0x14f863[_0x415e2f(0x106)]();let _0x4bbf15=null;if(_0x6dae2d)try{_0x4bbf15=JSON[_0x415e2f(0xe2)](_0x6dae2d);}catch{const _0xee3e31=_0x6dae2d['match'](/\{[\s\S]*\}$/);if(_0xee3e31)try{_0x4bbf15=JSON['parse'](_0xee3e31[0x0]);}catch{_0x4bbf15=null;}}const _0x3d1e3b=Array[_0x415e2f(0xc0)](_0x4bbf15?.['plugin'])?_0x4bbf15?.['plugin']:[],_0x4922dd=_0x3d1e3b['some'](_0x2520ad=>{const _0x342f6a=_0x415e2f;if(typeof _0x2520ad!==_0xdc2636[_0x342f6a(0xcc)])return![];return _0x2520ad['includes'](_0xdc2636['tPdtZ'])||_0x2520ad[_0x342f6a(0xeb)](_0x342f6a(0xda));});if(_0x4922dd){_0x494da0({'status':_0xf0e01e[_0x415e2f(0xb7)],'details':_0xf0e01e['QDeFv'](_0x3d1e3b['length'],0x0)?_0x3d1e3b['length']+'\x20plugin(s)\x20configured':undefined});return;}if(_0x3d1e3b['length']>0x0){_0x494da0({'status':_0xf0e01e['BSIZy'],'details':_0x3d1e3b['length']+_0x415e2f(0xaf)});return;}_0xf0e01e['XuuSx'](_0x494da0,{'status':_0x415e2f(0xfc)});});});}async function getSkillsFromDir(_0x412a52,_0x1e5360){const _0x9b89c6=_0x52b416,_0x43379c={'vnoXn':function(_0x4c659f,_0x2cdcae){return _0x4c659f(_0x2cdcae);},'cvjJS':function(_0x4b6978,_0x296cbb,_0x4cd3a4){return _0x4b6978(_0x296cbb,_0x4cd3a4);},'JxtGq':function(_0x428edd,_0x2588cd,_0x17ec0f){return _0x428edd(_0x2588cd,_0x17ec0f);}};if(!_0x43379c[_0x9b89c6(0xb1)](existsSync,_0x412a52))return[];const _0x599c0c=[];try{const _0x42f35d=await _0x43379c[_0x9b89c6(0xc5)](readdir,_0x412a52,{'withFileTypes':!![]});for(const _0x3a3c9a of _0x42f35d){if(_0x3a3c9a['isDirectory']()){const _0x39e3dd=join(_0x412a52,_0x3a3c9a[_0x9b89c6(0x10f)],'SKILL.md');if(existsSync(_0x39e3dd)){let _0x568be1=_0x3a3c9a['name'];try{const _0x5c83ef=await _0x43379c['JxtGq'](readFile,_0x39e3dd,_0x9b89c6(0xf2)),_0x5460e1=_0x5c83ef['match'](/name:\s*(.+)/);_0x5460e1&&(_0x568be1=_0x5460e1[0x1][_0x9b89c6(0x106)]());}catch{}_0x599c0c[_0x9b89c6(0xdc)]({'name':_0x3a3c9a[_0x9b89c6(0x10f)],'displayName':_0x568be1,'path':_0x39e3dd,'level':_0x1e5360});}}}}catch{return[];}return _0x599c0c;}async function getInstalledSkills(){const _0x3d5b0d=_0x52b416,_0x33bd4b={'iDtlv':function(_0x25485f,_0x34bcd3,_0x1f416a){return _0x25485f(_0x34bcd3,_0x1f416a);},'ZYhFw':function(_0x3d3d78){return _0x3d3d78();}},[_0x1ea474,_0x55e969]=await Promise['all']([_0x33bd4b['iDtlv'](getSkillsFromDir,_0x33bd4b[_0x3d5b0d(0xc6)](getProjectSkillsDir),_0x3d5b0d(0xff)),_0x33bd4b[_0x3d5b0d(0xea)](getSkillsFromDir,_0x33bd4b['ZYhFw'](getUserSkillsDir),_0x3d5b0d(0x111))]);return{'project':_0x1ea474,'user':_0x55e969};}async function getEnvironments(){const _0x39d0a9=_0x52b416,_0x5a4621={'Mwtqj':_0x39d0a9(0xfd),'CTQus':function(_0xfeba8c,_0x149c7c,_0xed602b){return _0xfeba8c(_0x149c7c,_0xed602b);},'WZuoV':'auth.json','xGBeX':_0x39d0a9(0xfb),'hfcJh':function(_0x524e26,_0x246ea2){return _0x524e26(_0x246ea2);},'JjJMM':_0x39d0a9(0xbf),'XxFKB':function(_0x5af87d,_0x3b5970){return _0x5af87d(_0x3b5970);},'vFJOu':function(_0x1538c9,_0x3035c3){return _0x1538c9===_0x3035c3;},'IeDJt':function(_0x1110c1){return _0x1110c1();}},{envNames:_0x99738,activeEnv:_0x11bce2}=await getEnvNames(),_0x48684f=_0x5a4621[_0x39d0a9(0xfa)](getRangerDir);if(!_0x5a4621['hfcJh'](existsSync,_0x48684f))return{'envs':[],'activeEnv':null};const _0x5448e3=_0x99738[_0x39d0a9(0xfe)](_0x540d8f=>{const _0x27bdc1=_0x39d0a9,_0x12409f=getEnvDir(_0x540d8f),_0x35a305=join(_0x12409f,_0x5a4621[_0x27bdc1(0x115)]),_0x37ac21=_0x5a4621[_0x27bdc1(0xb4)](join,_0x12409f,_0x5a4621[_0x27bdc1(0x103)]),_0x57bf21=_0x5a4621['CTQus'](join,_0x12409f,_0x5a4621[_0x27bdc1(0x10a)]);return{'name':_0x540d8f,'settingsPath':_0x5a4621[_0x27bdc1(0xf3)](existsSync,_0x35a305)?_0x35a305:_0x5a4621['JjJMM'],'hasPlaintextAuth':existsSync(_0x37ac21),'hasEncryptedAuth':_0x5a4621[_0x27bdc1(0xac)](existsSync,_0x57bf21),'isActive':_0x5a4621['vFJOu'](_0x540d8f,_0x11bce2)};});return{'envs':_0x5448e3,'activeEnv':_0x11bce2};}function _0x3ba0(_0x4adc56,_0x265c2d){_0x4adc56=_0x4adc56-0xab;const _0x18d70c=_0x18d7();let _0x3ba0e4=_0x18d70c[_0x4adc56];return _0x3ba0e4;}export async function status(){const _0x4c68d4=_0x52b416,_0x2add21={'RLCdw':_0x4c68d4(0xd6),'rrLce':function(_0x379fa9){return _0x379fa9();},'ruDaF':function(_0x369a29,_0x40e048){return _0x369a29(_0x40e048);},'MogDP':function(_0x47200b,_0x59f71e,_0x893ff1){return _0x47200b(_0x59f71e,_0x893ff1);},'iAArR':function(_0x4151e9){return _0x4151e9();},'yxBXl':function(_0x3ba306){return _0x3ba306();},'mxHyi':function(_0x28125b){return _0x28125b();},'vFRhQ':'configured','sSSGR':'@ranger-testing/opencode-plugin','lNruB':_0x4c68d4(0xfc),'OARQZ':'\x20\x20Run:\x20ranger\x20setup\x20--opencode','Waqtx':function(_0xa37965,_0x48ec84){return _0xa37965(_0x48ec84);},'mnzdT':'ranger@trailhead','cETcb':'unknown','pCAcN':_0x4c68d4(0xd1),'bPoCp':'\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','eXCMd':'\x0a---\x20Skills\x20---','VsFVd':function(_0x187ba5,_0x1e3bf6){return _0x187ba5===_0x1e3bf6;},'ReVDY':'No\x20skills\x20installed','iAatM':'\x20\x20Project-level:','VRXIG':function(_0x85454d,_0x5a7f95){return _0x85454d(_0x5a7f95);},'QlPBq':_0x4c68d4(0xef),'ubREo':_0x4c68d4(0xcd),'PBnyg':function(_0x2ba97a){return _0x2ba97a();},'uMXxG':function(_0x420275,_0x598230){return _0x420275+_0x598230;},'CMDcV':_0x4c68d4(0x107),'wJPmp':function(_0x4dd9e2,_0x4a662c){return _0x4dd9e2>_0x4a662c;},'IzDoE':'\x20(active)','eUpAc':_0x4c68d4(0xd2),'eQEPI':_0x4c68d4(0x119),'bkdLW':function(_0x21b1c7,_0x5dbb56){return _0x21b1c7(_0x5dbb56);},'uiNqW':function(_0x34aca2,_0x530bc4){return _0x34aca2!==_0x530bc4;}};console['log'](_0x2add21['RLCdw']);const _0x3338a7=process['cwd'](),_0x37b3a5=_0x2add21['rrLce'](getRangerDir);if(!_0x2add21['ruDaF'](existsSync,_0x37b3a5)){console['log']('Root:\x20'+link(_0x3338a7,bold(basename(_0x3338a7)))),console[_0x4c68d4(0xec)](_0x4c68d4(0xe0)),console[_0x4c68d4(0xec)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console[_0x4c68d4(0xec)](_0x4c68d4(0xe6)+_0x2add21[_0x4c68d4(0x110)](link,_0x3338a7,bold(_0x2add21['ruDaF'](basename,_0x3338a7))));const _0x4a769c=_0x2add21['iAArR'](getCurrentVersion),_0x4becbc=getLatestVersion();if(_0x4becbc[_0x4c68d4(0xbc)]&&_0x4becbc['version']!==_0x4a769c)console['log']('Version:\x20'+_0x4a769c+_0x4c68d4(0xe5)+_0x4becbc['version']+')'),console[_0x4c68d4(0xec)]('\x20\x20Run:\x20ranger\x20update');else _0x4becbc[_0x4c68d4(0xbc)]?console['log'](_0x4c68d4(0xb0)+_0x4a769c+'\x20(up\x20to\x20date)'):console['log'](_0x4c68d4(0xb0)+_0x4a769c);const _0x1f582b=await _0x2add21['yxBXl'](getToken);if(_0x1f582b){const _0x65494e=await _0x2add21['ruDaF'](getCurrentUser,_0x1f582b);_0x65494e[_0x4c68d4(0xbb)]?console[_0x4c68d4(0xec)](_0x4c68d4(0xc1)+bold(_0x65494e[_0x4c68d4(0x111)][_0x4c68d4(0xd7)])):(console[_0x4c68d4(0xec)](_0x4c68d4(0x10d)),console[_0x4c68d4(0xec)](_0x4c68d4(0x104)));}else console[_0x4c68d4(0xec)](_0x4c68d4(0xf9)),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]');process[_0x4c68d4(0xe9)]['DEBUG']&&(console[_0x4c68d4(0xec)]('API\x20Environment:\x20'+getCurrentEnvironment()),console[_0x4c68d4(0xec)](_0x4c68d4(0xf8)+_0x2add21[_0x4c68d4(0xf4)](getApiBaseUrl)));console['log']('\x0a---\x20OpenCode\x20Plugin\x20---');const _0x311581=await _0x2add21['mxHyi'](getOpencodePluginStatus);if(_0x311581[_0x4c68d4(0xce)]===_0x2add21['vFRhQ'])console[_0x4c68d4(0xec)]('\x20\x20'+_0x2add21[_0x4c68d4(0xc7)](bold,_0x2add21['sSSGR'])+_0x4c68d4(0xee)),_0x311581[_0x4c68d4(0xc8)]&&console[_0x4c68d4(0xec)]('\x20\x20'+_0x311581['details']);else _0x311581[_0x4c68d4(0xce)]===_0x2add21['lNruB']?(console['log']('\x20\x20Not\x20configured'),_0x311581['details']&&console['log']('\x20\x20'+_0x311581['details']),console['log'](_0x2add21[_0x4c68d4(0xdd)])):console[_0x4c68d4(0xec)](_0x4c68d4(0xbd));console['log'](_0x4c68d4(0xb6));const _0x1037c3=await _0x2add21[_0x4c68d4(0xe7)](getPluginInfo,_0x2add21['mnzdT']);if(_0x1037c3){const _0x27d6e4=_0x1037c3[_0x4c68d4(0xf1)]||_0x2add21['cETcb'],_0x573ddd=_0x1037c3['enabled']?_0x2add21[_0x4c68d4(0xf5)]:_0x4c68d4(0xd0);console[_0x4c68d4(0xec)]('\x20\x20'+bold(_0x4c68d4(0xb2))+_0x4c68d4(0x116)+_0x27d6e4+',\x20'+_0x573ddd+')');}else console[_0x4c68d4(0xec)]('\x20\x20Not\x20installed'),console['log'](_0x2add21['bPoCp']);console['log'](_0x2add21['eXCMd']);const {project:_0x32a1bc,user:_0x2c9fc5}=await _0x2add21['yxBXl'](getInstalledSkills),_0x293695=_0x32a1bc['filter'](_0x8fd36f=>RANGER_MANAGED_SKILLS[_0x4c68d4(0xeb)](_0x8fd36f['name'])),_0x240843=_0x2c9fc5[_0x4c68d4(0xca)](_0x28454b=>RANGER_MANAGED_SKILLS[_0x4c68d4(0xeb)](_0x28454b[_0x4c68d4(0x10f)])),_0x21824c=_0x293695[_0x4c68d4(0xad)]+_0x240843['length'];if(_0x2add21['VsFVd'](_0x21824c,0x0))console[_0x4c68d4(0xec)](_0x2add21[_0x4c68d4(0xc2)]),console['log'](_0x4c68d4(0xe4));else{if(_0x293695[_0x4c68d4(0xad)]>0x0){console['log'](_0x2add21['iAatM']);for(const _0x294e0d of _0x293695){console[_0x4c68d4(0xec)](_0x4c68d4(0x108)+bold(_0x294e0d[_0x4c68d4(0xc3)])+':\x20'+link(_0x294e0d['path'],_0x2add21[_0x4c68d4(0xba)](basename,_0x294e0d['path'])));}}if(_0x240843[_0x4c68d4(0xad)]>0x0){console[_0x4c68d4(0xec)](_0x2add21['QlPBq']);for(const _0x4c1ba7 of _0x240843){console['log']('\x20\x20\x20\x20'+bold(_0x4c1ba7[_0x4c68d4(0xc3)])+':\x20'+link(_0x4c1ba7['path'],_0x2add21['ruDaF'](basename,_0x4c1ba7[_0x4c68d4(0x117)])));}}}console['log'](_0x2add21['ubREo']);const {envs:_0x445ee4,activeEnv:_0x5b1179}=await _0x2add21[_0x4c68d4(0xd9)](getEnvironments);let _0x49637b=[];if(_0x1f582b)try{_0x49637b=await listCloudProfiles();}catch{}const _0x4d3502=_0x2add21['uMXxG'](_0x445ee4[_0x4c68d4(0xad)],_0x49637b['length']);if(_0x4d3502===0x0)console[_0x4c68d4(0xec)](_0x2add21['CMDcV']),console[_0x4c68d4(0xec)](_0x4c68d4(0x118));else{if(_0x2add21['wJPmp'](_0x4d3502,0x5)){const _0x3d5297=[];_0x49637b[_0x4c68d4(0xad)]>0x0&&_0x3d5297['push'](_0x49637b[_0x4c68d4(0xad)]+_0x4c68d4(0xd5)),_0x445ee4['length']>0x0&&_0x3d5297[_0x4c68d4(0xdc)](_0x445ee4['length']+_0x4c68d4(0xf0)),console[_0x4c68d4(0xec)](_0x4d3502+_0x4c68d4(0xe8)+_0x3d5297['join'](',\x20')+')'),_0x5b1179&&console['log'](_0x4c68d4(0x10e)+bold(_0x5b1179)),console['log']('\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)');}else{for(const _0x117ae0 of _0x49637b){const _0x522e7e=_0x117ae0[_0x4c68d4(0x10f)]===_0x5b1179?_0x2add21[_0x4c68d4(0x10b)]:'';console[_0x4c68d4(0xec)]('\x20\x20'+bold(_0x117ae0['name'])+'\x20[cloud]'+_0x522e7e);const _0x53c870=_0x117ae0['sessionUpdatedAt']?'cached\x20(updated\x20'+_0x117ae0['sessionUpdatedAt']+')':'no\x20session';console[_0x4c68d4(0xec)](_0x4c68d4(0x102)+_0x53c870);}const _0x5638bf=new Set(_0x49637b['map'](_0x18fcf3=>_0x18fcf3[_0x4c68d4(0x10f)]));for(const _0x4f400f of _0x445ee4){if(_0x5638bf['has'](_0x4f400f['name']))continue;const _0x2dec19=_0x4f400f['isActive']?'\x20(active)':'',_0x5c9b81=_0x4f400f['hasEncryptedAuth']?_0x2add21['eUpAc']:_0x4f400f['hasPlaintextAuth']?'plaintext':_0x2add21[_0x4c68d4(0xd3)];console[_0x4c68d4(0xec)]('\x20\x20'+_0x2add21['bkdLW'](bold,_0x4f400f[_0x4c68d4(0x10f)])+_0x4c68d4(0xde)+_0x2dec19),console['log']('\x20\x20\x20\x20Auth:\x20'+_0x5c9b81),_0x2add21['uiNqW'](_0x4f400f[_0x4c68d4(0xe1)],_0x4c68d4(0xbf))&&console[_0x4c68d4(0xec)](_0x4c68d4(0xab)+link(_0x4f400f[_0x4c68d4(0xe1)],basename(_0x4f400f['settingsPath'])));}if(!_0x5b1179){console['log']('\x0a\x20\x20No\x20active\x20profile\x20set');const _0x341181=[..._0x49637b[_0x4c68d4(0xfe)](_0xf382b7=>_0xf382b7['name']),..._0x445ee4[_0x4c68d4(0xca)](_0x2d923b=>!_0x5638bf[_0x4c68d4(0x11a)](_0x2d923b[_0x4c68d4(0x10f)]))[_0x4c68d4(0xfe)](_0x3b7b09=>_0x3b7b09[_0x4c68d4(0x10f)])];console[_0x4c68d4(0xec)]('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x341181[_0x4c68d4(0xed)](',\x20')+')');}}}console[_0x4c68d4(0xec)]('');}