@ranger-testing/ranger-cli 2.5.4-alpha.bc88254-5 → 2.5.4-alpha.f6504c0-8

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 (80) hide show
  1. package/build/cli.js +1 -1
  2. package/build/commands/addEnv.js +1 -1
  3. package/build/commands/authEncrypt.js +1 -1
  4. package/build/commands/clean.js +1 -1
  5. package/build/commands/config.js +1 -1
  6. package/build/commands/env.js +1 -1
  7. package/build/commands/feature.js +1 -1
  8. package/build/commands/hook.js +1 -1
  9. package/build/commands/hooks/autoPrompt.js +1 -1
  10. package/build/commands/hooks/disable.js +1 -1
  11. package/build/commands/hooks/enable.js +1 -1
  12. package/build/commands/hooks/exitPlanMode.js +1 -1
  13. package/build/commands/hooks/index.js +1 -1
  14. package/build/commands/hooks/output.js +1 -1
  15. package/build/commands/hooks/planReminder.js +1 -1
  16. package/build/commands/hooks/planStart.js +1 -1
  17. package/build/commands/hooks/postEdit.js +1 -1
  18. package/build/commands/hooks/preCompact.js +1 -1
  19. package/build/commands/hooks/sessionEnd.js +1 -1
  20. package/build/commands/hooks/sessionStart.js +1 -1
  21. package/build/commands/hooks/stopHook.js +1 -1
  22. package/build/commands/index.js +1 -1
  23. package/build/commands/login.js +1 -1
  24. package/build/commands/mcpBootstrap.js +1 -1
  25. package/build/commands/migrateProfile.js +1 -1
  26. package/build/commands/setup/claude.js +1 -1
  27. package/build/commands/setup/opencode.js +1 -1
  28. package/build/commands/setupCi.js +1 -1
  29. package/build/commands/skillup.js +1 -1
  30. package/build/commands/start.js +1 -1
  31. package/build/commands/status.js +1 -1
  32. package/build/commands/update.js +1 -1
  33. package/build/commands/updateEnv.js +1 -1
  34. package/build/commands/useEnv.js +1 -1
  35. package/build/commands/utils/activeProfile.js +1 -1
  36. package/build/commands/utils/agentEnv.js +1 -1
  37. package/build/commands/utils/browserSessionsApi.js +1 -1
  38. package/build/commands/utils/claudeConfig.js +1 -1
  39. package/build/commands/utils/claudeOverrideSettings.js +1 -1
  40. package/build/commands/utils/claudePlugin.js +1 -1
  41. package/build/commands/utils/cloudProfile.js +1 -1
  42. package/build/commands/utils/cloudProfileSession.js +1 -1
  43. package/build/commands/utils/crypto.js +1 -1
  44. package/build/commands/utils/desirePathLog.js +1 -1
  45. package/build/commands/utils/deviceAuth.js +1 -1
  46. package/build/commands/utils/environment.js +1 -1
  47. package/build/commands/utils/featureApi.js +1 -1
  48. package/build/commands/utils/fixWebmDuration.js +1 -1
  49. package/build/commands/utils/gitTracked.js +1 -1
  50. package/build/commands/utils/keychain.js +1 -1
  51. package/build/commands/utils/localAgentInstallationsApi.js +1 -1
  52. package/build/commands/utils/matchAuthEnvironment.js +1 -1
  53. package/build/commands/utils/mcpImageBase64.js +1 -1
  54. package/build/commands/utils/model.js +1 -1
  55. package/build/commands/utils/opencodeConfig.js +1 -1
  56. package/build/commands/utils/playwrightCli.js +1 -1
  57. package/build/commands/utils/profileMessages.js +1 -1
  58. package/build/commands/utils/profileSetupBanner.js +1 -1
  59. package/build/commands/utils/projectsConfig.js +1 -1
  60. package/build/commands/utils/rangerConfig.js +1 -1
  61. package/build/commands/utils/rangerRoot.js +1 -1
  62. package/build/commands/utils/resolveProfileContext.js +1 -1
  63. package/build/commands/utils/resolveProfileUrl.js +1 -1
  64. package/build/commands/utils/retry.js +1 -1
  65. package/build/commands/utils/sessionCache.js +1 -1
  66. package/build/commands/utils/settings.js +1 -1
  67. package/build/commands/utils/skillContent.js +1 -1
  68. package/build/commands/utils/skills.js +1 -1
  69. package/build/commands/utils/stitchWebmFiles.js +1 -1
  70. package/build/commands/utils/telemetry.js +1 -1
  71. package/build/commands/utils/tokenRefresh.js +1 -1
  72. package/build/commands/utils/traceSnapshotMapper.js +1 -1
  73. package/build/commands/utils/userApi.js +1 -1
  74. package/build/commands/utils/version.js +1 -1
  75. package/build/commands/verifyFeature.js +1 -1
  76. package/build/commands/verifyFeatureCli.js +1 -1
  77. package/build/skills/ranger/SKILL.md +17 -4
  78. package/build/skills/ranger/create.md +6 -0
  79. package/build/skills/ranger/verify.md +13 -11
  80. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x27f23d,_0x257a34){const _0x3addd3=_0x2b24,_0x564750=_0x27f23d();while(!![]){try{const _0x24e62d=parseInt(_0x3addd3(0x1a2))/0x1*(parseInt(_0x3addd3(0x1a1))/0x2)+-parseInt(_0x3addd3(0x19c))/0x3*(parseInt(_0x3addd3(0x1a6))/0x4)+parseInt(_0x3addd3(0x1a4))/0x5+-parseInt(_0x3addd3(0x1a8))/0x6*(parseInt(_0x3addd3(0x19f))/0x7)+-parseInt(_0x3addd3(0x1a0))/0x8*(-parseInt(_0x3addd3(0x19e))/0x9)+parseInt(_0x3addd3(0x19d))/0xa+-parseInt(_0x3addd3(0x1a9))/0xb;if(_0x24e62d===_0x257a34)break;else _0x564750['push'](_0x564750['shift']());}catch(_0x567594){_0x564750['push'](_0x564750['shift']());}}}(_0x3dd1,0x621bf));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';export async function login(){const _0x2ab411=_0x2b24,_0x542aa2={'dmZnT':function(_0x14bb04){return _0x14bb04();},'jEfzX':function(_0x42236c,_0x1a2653){return _0x42236c(_0x1a2653);},'Anqrd':'\x0a✅\x20API\x20key\x20stored\x20successfully'},_0x3c6f64=await _0x542aa2[_0x2ab411(0x1a5)](getMcpAuthOrigin);if(_0x3c6f64){console['log'](_0x2ab411(0x1aa)),await mcpBootstrap();return;}const _0x2b784d=process[_0x2ab411(0x19b)][_0x2ab411(0x196)]&&process['stdout']['isTTY'];if(!_0x2b784d)throw new Error('Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.');try{const _0x42092c=await _0x542aa2[_0x2ab411(0x1a5)](runDeviceAuthFlow),_0x438241=await _0x542aa2['jEfzX'](getCurrentUser,_0x42092c);_0x438241[_0x2ab411(0x19a)]?console[_0x2ab411(0x1a7)](_0x2ab411(0x198)+_0x438241['user'][_0x2ab411(0x199)]):console['log'](_0x542aa2[_0x2ab411(0x1a3)]);}catch(_0x43ab75){throw new Error(_0x2ab411(0x197)+(_0x43ab75 instanceof Error?_0x43ab75['message']:_0x43ab75));}}function _0x2b24(_0x84499e,_0x1fc0d7){_0x84499e=_0x84499e-0x196;const _0x3dd1df=_0x3dd1();let _0x2b2443=_0x3dd1df[_0x84499e];return _0x2b2443;}function _0x3dd1(){const _0x384cdb=['success','stdin','9VWfTGg','210160mCGHvI','9XTEgPM','430458TKRIkO','1816392okvhQT','1489814elwECe','1iGZVdt','Anqrd','3458700ThaYxc','dmZnT','114756TETydS','log','60xoWGUB','6400350RAMiSE','Re-authenticating\x20via\x20MCP\x20bootstrap...','isTTY','Login\x20failed:\x20','\x0a✅\x20Logged\x20in\x20to\x20','organizationName'];_0x3dd1=function(){return _0x384cdb;};return _0x3dd1();}
1
+ function _0x581d(){const _0x2b0f1a=['6304100NNNNQT','message','603gurBUf','sPQeQ','295494dqUvKw','stdin','6694670ZHYYaw','40HSmRTx','organizationName','955508BvhpVo','stdout','978426aXCsqd','2bJxGun','17452Sjvwpn','log','21VJEETn','success','1071736OZOikF'];_0x581d=function(){return _0x2b0f1a;};return _0x581d();}(function(_0x1d6211,_0x29ff05){const _0x2b0644=_0x47d5,_0x662801=_0x1d6211();while(!![]){try{const _0x240a42=-parseInt(_0x2b0644(0x1b5))/0x1*(-parseInt(_0x2b0644(0x1a6))/0x2)+parseInt(_0x2b0644(0x1ae))/0x3*(parseInt(_0x2b0644(0x1a7))/0x4)+parseInt(_0x2b0644(0x1b3))/0x5*(parseInt(_0x2b0644(0x1b0))/0x6)+parseInt(_0x2b0644(0x1a9))/0x7*(-parseInt(_0x2b0644(0x1ab))/0x8)+parseInt(_0x2b0644(0x1b7))/0x9+-parseInt(_0x2b0644(0x1b2))/0xa+-parseInt(_0x2b0644(0x1ac))/0xb;if(_0x240a42===_0x29ff05)break;else _0x662801['push'](_0x662801['shift']());}catch(_0x4d2f29){_0x662801['push'](_0x662801['shift']());}}}(_0x581d,0xa8a15));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';function _0x47d5(_0x13f5c9,_0x5f599d){_0x13f5c9=_0x13f5c9-0x1a6;const _0x581de8=_0x581d();let _0x47d5df=_0x581de8[_0x13f5c9];return _0x47d5df;}export async function login(){const _0x3995e7=_0x47d5,_0x32a0c0={'sPQeQ':function(_0x33918c){return _0x33918c();},'tUBjq':function(_0x402d6d,_0x2fcdd8){return _0x402d6d(_0x2fcdd8);}},_0x30fe6e=await getMcpAuthOrigin();if(_0x30fe6e){console['log']('Re-authenticating\x20via\x20MCP\x20bootstrap...'),await _0x32a0c0[_0x3995e7(0x1af)](mcpBootstrap);return;}const _0x36cab4=process[_0x3995e7(0x1b1)]['isTTY']&&process[_0x3995e7(0x1b6)]['isTTY'];if(!_0x36cab4)throw new Error('Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.');try{const _0x2ce299=await _0x32a0c0[_0x3995e7(0x1af)](runDeviceAuthFlow),_0x4019ef=await _0x32a0c0['tUBjq'](getCurrentUser,_0x2ce299);_0x4019ef[_0x3995e7(0x1aa)]?console['log']('\x0a✅\x20Logged\x20in\x20to\x20'+_0x4019ef['user'][_0x3995e7(0x1b4)]):console[_0x3995e7(0x1a8)]('\x0a✅\x20API\x20key\x20stored\x20successfully');}catch(_0x5dd232){throw new Error('Login\x20failed:\x20'+(_0x5dd232 instanceof Error?_0x5dd232[_0x3995e7(0x1ad)]:_0x5dd232));}}
@@ -1 +1 @@
1
- const _0x3fb8af=_0x16b4;(function(_0x49ca05,_0x54e0b1){const _0x15aaa3=_0x16b4,_0x138190=_0x49ca05();while(!![]){try{const _0x8c3e8e=parseInt(_0x15aaa3(0x14e))/0x1*(parseInt(_0x15aaa3(0x1ac))/0x2)+parseInt(_0x15aaa3(0x177))/0x3+-parseInt(_0x15aaa3(0x1ab))/0x4*(-parseInt(_0x15aaa3(0x17c))/0x5)+-parseInt(_0x15aaa3(0x1be))/0x6+-parseInt(_0x15aaa3(0x16d))/0x7+parseInt(_0x15aaa3(0x1c9))/0x8*(-parseInt(_0x15aaa3(0x187))/0x9)+parseInt(_0x15aaa3(0x19d))/0xa*(parseInt(_0x15aaa3(0x13c))/0xb);if(_0x8c3e8e===_0x54e0b1)break;else _0x138190['push'](_0x138190['shift']());}catch(_0x5bb6ad){_0x138190['push'](_0x138190['shift']());}}}(_0x1a2c,0x35a56));import{mkdir,writeFile,readFile}from'fs/promises';function _0x16b4(_0x55e1f1,_0x85307d){_0x55e1f1=_0x55e1f1-0x139;const _0x1a2c0f=_0x1a2c();let _0x16b4a6=_0x1a2c0f[_0x55e1f1];return _0x16b4a6;}import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger',_0x3fb8af(0x1b6)),AUTH_ORIGIN_PATH=join(homedir(),'.ranger','auth-origin.txt');export async function getMcpAuthOrigin(){const _0x13f308=_0x3fb8af,_0x1db12e={'NonyT':_0x13f308(0x1b7)};try{const _0x4d9185=(await readFile(AUTH_ORIGIN_PATH,_0x1db12e['NonyT']))['trim']();return _0x4d9185||null;}catch{return null;}}export async function mcpBootstrap(){const _0x47d050=_0x3fb8af,_0x4f37b9={'OstgE':function(_0x4b9a39){return _0x4b9a39();},'GDBLw':function(_0x370748,_0xe04b6d){return _0x370748===_0xe04b6d;},'UqHyG':function(_0x1aa677){return _0x1aa677();},'gnqrS':_0x47d050(0x18b),'lorPJ':function(_0x585938,_0x194a65){return _0x585938(_0x194a65);}},_0x2f8313=_0x4f37b9[_0x47d050(0x1a2)](getMcpAuthUrl);currentOrigin=_0x2f8313;const _0x21cb60=process['stdout'][_0x47d050(0x141)]??![];console[_0x47d050(0x182)]('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x2f8313+'\x0a');const _0xd7a688=await tryUnauthenticated(_0x2f8313);let _0x3e6494=null;if(_0x4f37b9[_0x47d050(0x191)](_0xd7a688,_0x47d050(0x180)))_0x3e6494='';else{_0x3e6494=await _0x4f37b9['UqHyG'](loadCachedToken);if(!_0x3e6494){if(!_0x21cb60)throw new Error(_0x47d050(0x1a4)+_0x4f37b9['gnqrS']);_0x3e6494=await _0x4f37b9['lorPJ'](oauthFlow,_0x2f8313);}}await callGetCliToken(_0x2f8313,_0x3e6494);}async function tryUnauthenticated(_0x3e8dfd){const _0x366de3=_0x3fb8af,_0x211444={'auJgV':function(_0x3a305b,_0x2ec1a8,_0x45b099){return _0x3a305b(_0x2ec1a8,_0x45b099);},'PzJPK':'POST','gBGwk':_0x366de3(0x1b3),'gPrxz':_0x366de3(0x173),'IoLei':_0x366de3(0x172),'wkOfK':_0x366de3(0x1cd),'lrwoH':_0x366de3(0x14f),'qXaMX':function(_0x402afb,_0x17b8a6){return _0x402afb===_0x17b8a6;}},_0x21b931=await _0x211444[_0x366de3(0x19e)](fetch,_0x3e8dfd,{'method':_0x211444[_0x366de3(0x152)],'headers':{'Content-Type':_0x211444[_0x366de3(0x147)],'Accept':_0x211444['gPrxz']},'body':JSON[_0x366de3(0x144)]({'jsonrpc':'2.0','id':0x1,'method':_0x211444[_0x366de3(0x17d)],'params':{'protocolVersion':_0x211444['wkOfK'],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x211444[_0x366de3(0x14d)]}}})});if(_0x21b931['ok'])return await _0x21b931[_0x366de3(0x13d)](),_0x366de3(0x180);if(_0x211444['qXaMX'](_0x21b931[_0x366de3(0x192)],0x191))return await _0x21b931[_0x366de3(0x13d)](),'needs-oauth';const _0x573c51=await _0x21b931['text']();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x21b931['status']+':\x20'+_0x573c51);}class OAuthTimeoutError extends Error{constructor(_0x2f2db8){const _0x32272b=_0x3fb8af;super(_0x2f2db8),this[_0x32272b(0x151)]='OAuthTimeoutError';}}async function oauthFlow(_0xd05e7c){const _0x28531d=_0x3fb8af,_0x286598={'xpAdO':function(_0x405931,_0x13f870){return _0x405931(_0x13f870);},'vJeux':function(_0x2c9ecd){return _0x2c9ecd();}};try{return await _0x286598['xpAdO'](oauthFlowAttempt,_0xd05e7c);}catch(_0x1b1673){if(_0x1b1673 instanceof OAuthTimeoutError&&await loadCachedClient())return console['log']('\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'),await _0x286598['vJeux'](clearCachedClient),await _0x286598[_0x28531d(0x163)](oauthFlowAttempt,_0xd05e7c);throw _0x1b1673;}}async function oauthFlowAttempt(_0x6c0836){const _0x3c652c=_0x3fb8af,_0x28e422={'idJUa':function(_0x53d7c9,_0xe94577){return _0x53d7c9(_0xe94577);},'SwrhL':function(_0x11c928,_0x38fdbe){return _0x11c928(_0x38fdbe);},'QEOqk':function(_0xa0d72f,_0x434e03,_0x39c453){return _0xa0d72f(_0x434e03,_0x39c453);},'CuXpU':_0x3c652c(0x1b3),'rPxHU':_0x3c652c(0x17b),'JWvcM':_0x3c652c(0x16e),'YpVTh':_0x3c652c(0x178),'ewviE':'Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','YLtZg':'base64url','LggMb':function(_0x4a1b80,_0x331e7a){return _0x4a1b80(_0x331e7a);},'WdYHg':'response_type','seLQl':_0x3c652c(0x155),'KCfZL':'code_challenge','PmNRw':'code_challenge_method','QrWxg':function(_0x4fcc30,_0x1c9a3c){return _0x4fcc30(_0x1c9a3c);},'Vssyw':_0x3c652c(0x167),'JXWTT':_0x3c652c(0x1b2),'UMDIf':_0x3c652c(0x18c),'xYJoA':function(_0x51b26b,_0xbdf8c0,_0x163265,_0x4b11d9){return _0x51b26b(_0xbdf8c0,_0x163265,_0x4b11d9);}},_0x30d24e=_0x6c0836['replace'](/\/mcp$/,'');process['stdout'][_0x3c652c(0x1bc)](_0x3c652c(0x154));const _0x4e8918=await _0x28e422[_0x3c652c(0x16c)](fetch,_0x30d24e+'/.well-known/oauth-protected-resource');if(!_0x4e8918['ok'])throw new Error('Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server');const _0x3d1e02=await _0x4e8918[_0x3c652c(0x1c8)](),_0x5e8e24=_0x3d1e02['authorization_servers']?.[0x0];if(!_0x5e8e24)throw new Error('No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata');console[_0x3c652c(0x182)]('\x20'+_0x5e8e24);const _0x322854=await _0x28e422['SwrhL'](fetchAuthServerMetadata,_0x5e8e24);let _0x25f2d5,_0x2831e6;const _0x249724=await loadCachedClient();if(_0x249724)_0x25f2d5=_0x249724[_0x3c652c(0x13a)],_0x2831e6=_0x249724[_0x3c652c(0x15f)];else{if(_0x322854['registration_endpoint']){process[_0x3c652c(0x195)][_0x3c652c(0x1bc)](_0x3c652c(0x1af));const _0x59600a=await _0x28e422['QEOqk'](fetch,_0x322854[_0x3c652c(0x1a8)],{'method':'POST','headers':{'Content-Type':_0x28e422['CuXpU']},'body':JSON['stringify']({'client_name':_0x28e422[_0x3c652c(0x15d)],'redirect_uris':[_0x3c652c(0x13e)+CALLBACK_PORT+'/callback'],'grant_types':[_0x28e422[_0x3c652c(0x1b1)],'refresh_token'],'response_types':[_0x28e422[_0x3c652c(0x15b)]],'token_endpoint_auth_method':'none'})});if(!_0x59600a['ok']){const _0x28163c=await _0x59600a[_0x3c652c(0x13d)]();throw new Error('Client\x20registration\x20failed:\x20'+_0x28163c);}const _0x374f8f=await _0x59600a['json']();_0x25f2d5=_0x374f8f['client_id'],_0x2831e6=_0x374f8f['client_secret'],await _0x28e422['QEOqk'](saveCachedClient,_0x25f2d5,_0x2831e6),console[_0x3c652c(0x182)](_0x3c652c(0x18c));}else throw new Error(_0x28e422['ewviE']);}const _0x12c998=randomBytes(0x20)[_0x3c652c(0x14a)](_0x28e422[_0x3c652c(0x197)]),_0x135728=_0x28e422['LggMb'](createHash,'sha256')['update'](_0x12c998)[_0x3c652c(0x171)](_0x3c652c(0x1b5)),_0x8328c2=randomBytes(0x10)['toString'](_0x3c652c(0x19f)),_0x598bd7=new URL(_0x322854['authorization_endpoint']);_0x598bd7[_0x3c652c(0x189)][_0x3c652c(0x13f)](_0x28e422[_0x3c652c(0x175)],'code'),_0x598bd7['searchParams'][_0x3c652c(0x13f)](_0x28e422['seLQl'],_0x25f2d5),_0x598bd7['searchParams']['set']('redirect_uri','http://localhost:'+CALLBACK_PORT+_0x3c652c(0x160)),_0x598bd7[_0x3c652c(0x189)]['set'](_0x28e422[_0x3c652c(0x1c7)],_0x135728),_0x598bd7[_0x3c652c(0x189)]['set'](_0x28e422['PmNRw'],_0x3c652c(0x159)),_0x598bd7[_0x3c652c(0x189)][_0x3c652c(0x13f)](_0x3c652c(0x15c),_0x8328c2);_0x3d1e02['resource']&&_0x598bd7[_0x3c652c(0x189)][_0x3c652c(0x13f)](_0x3c652c(0x1c4),_0x3d1e02['resource']);console['log'](_0x3c652c(0x164)),console['log'](_0x3c652c(0x149)+_0x598bd7[_0x3c652c(0x14a)]()+'\x0a'),await _0x28e422[_0x3c652c(0x168)](openBrowser,_0x598bd7['toString']());const _0x29bbaa=await waitForCallback(_0x8328c2);process[_0x3c652c(0x195)]['write'](_0x28e422[_0x3c652c(0x1a7)]);const _0x106fc2=new URLSearchParams({'grant_type':_0x28e422[_0x3c652c(0x1b1)],'code':_0x29bbaa,'redirect_uri':_0x3c652c(0x13e)+CALLBACK_PORT+'/callback','client_id':_0x25f2d5,'code_verifier':_0x12c998});_0x2831e6&&_0x106fc2['set']('client_secret',_0x2831e6);_0x3d1e02[_0x3c652c(0x1c4)]&&_0x106fc2['set']('resource',_0x3d1e02[_0x3c652c(0x1c4)]);const _0x8a648f=await _0x28e422['QEOqk'](fetch,_0x322854[_0x3c652c(0x148)],{'method':_0x28e422[_0x3c652c(0x1a5)],'headers':{'Content-Type':_0x3c652c(0x150)},'body':_0x106fc2});if(!_0x8a648f['ok']){const _0x229ca6=await _0x8a648f[_0x3c652c(0x13d)]();throw new Error(_0x3c652c(0x1c5)+_0x229ca6);}const _0x43123f=await _0x8a648f[_0x3c652c(0x1c8)]();return console[_0x3c652c(0x182)](_0x28e422[_0x3c652c(0x1c6)]),await _0x28e422[_0x3c652c(0x1ba)](saveCachedToken,_0x43123f[_0x3c652c(0x18f)],_0x43123f[_0x3c652c(0x181)],_0x43123f[_0x3c652c(0x143)]),_0x43123f[_0x3c652c(0x18f)];}async function callGetCliToken(_0x1dcbcc,_0x593703){const _0x18a1e7=_0x3fb8af,_0x286ba0={'bIrCq':function(_0x2bd54e,_0x49b5af,_0x41f5c2){return _0x2bd54e(_0x49b5af,_0x41f5c2);},'scNlD':function(_0x58b927,_0x4a0c33){return _0x58b927(_0x4a0c33);},'IEEwA':'application/json,\x20text/event-stream','XwVaR':'Authorization','EvfCp':'2.0','BJrtA':_0x18a1e7(0x1cd),'lszCH':'ranger-cli','ntWUk':'1.0.0','jgYDj':'\x20done','pIDgV':'notifications/initialized','VxPrH':function(_0x28f49f,_0x2afcdc){return _0x28f49f(_0x2afcdc);},'gtrnO':'tools/call','ZQRuG':_0x18a1e7(0x190),'rVLng':'\x0aUnexpected\x20response\x20structure:','qUUrF':_0x18a1e7(0x1aa),'WSmcC':function(_0x3ddc8b,_0x2cc7a6,_0x1a0dfb){return _0x3ddc8b(_0x2cc7a6,_0x1a0dfb);},'GgdWn':function(_0x5b126f,_0x11a8fd,_0x425e4d,_0x26ab98){return _0x5b126f(_0x11a8fd,_0x425e4d,_0x26ab98);},'ObTSD':function(_0x3d007e,_0x2fa89b,_0x3968a0,_0x3da6e1){return _0x3d007e(_0x2fa89b,_0x3968a0,_0x3da6e1);},'FuGsI':'auth-origin.txt'},_0x169f22={'Content-Type':'application/json','Accept':_0x286ba0['IEEwA']};_0x593703&&(_0x169f22[_0x286ba0[_0x18a1e7(0x1c2)]]=_0x18a1e7(0x193)+_0x593703);const _0x1350cd=async _0x4dc398=>{const _0x501d88=_0x18a1e7,_0x2083b8=await _0x286ba0[_0x501d88(0x1ae)](fetch,_0x1dcbcc,{'method':'POST','headers':_0x169f22,'body':JSON['stringify'](_0x4dc398)});if(!_0x2083b8['ok']){const _0x8cd3fb=await _0x2083b8[_0x501d88(0x13d)]();throw new Error('HTTP\x20'+_0x2083b8[_0x501d88(0x192)]+':\x20'+_0x8cd3fb);}return _0x286ba0[_0x501d88(0x1a6)](parseResponse,_0x2083b8);};process['stdout'][_0x18a1e7(0x1bc)](_0x18a1e7(0x166));const _0x4149e4=await _0x286ba0[_0x18a1e7(0x1a6)](_0x1350cd,{'jsonrpc':_0x286ba0['EvfCp'],'id':0x1,'method':_0x18a1e7(0x172),'params':{'protocolVersion':_0x286ba0[_0x18a1e7(0x156)],'capabilities':{},'clientInfo':{'name':_0x286ba0['lszCH'],'version':_0x286ba0['ntWUk']}}});if(_0x4149e4[_0x18a1e7(0x158)])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x4149e4[_0x18a1e7(0x158)][_0x18a1e7(0x174)]??JSON[_0x18a1e7(0x144)](_0x4149e4['error'])));console[_0x18a1e7(0x182)](_0x286ba0[_0x18a1e7(0x1c3)]),await fetch(_0x1dcbcc,{'method':'POST','headers':_0x169f22,'body':JSON['stringify']({'jsonrpc':'2.0','method':_0x286ba0['pIDgV']})})['then'](_0x283eb3=>_0x283eb3[_0x18a1e7(0x13d)]()),process['stdout'][_0x18a1e7(0x1bc)]('Requesting\x20CLI\x20token...');const _0x1fcf9d=await _0x286ba0['VxPrH'](_0x1350cd,{'jsonrpc':_0x18a1e7(0x142),'id':0x2,'method':_0x286ba0[_0x18a1e7(0x170)],'params':{'name':_0x286ba0[_0x18a1e7(0x188)],'arguments':{}}});if(_0x1fcf9d['error'])throw new Error(_0x18a1e7(0x1c1)+(_0x1fcf9d[_0x18a1e7(0x158)]['message']??JSON['stringify'](_0x1fcf9d['error'])));console[_0x18a1e7(0x182)](_0x286ba0[_0x18a1e7(0x1c3)]);const _0x476e73=extractToken(_0x1fcf9d[_0x18a1e7(0x184)]);if(!_0x476e73){console['error'](_0x286ba0['rVLng']),console[_0x18a1e7(0x158)](JSON[_0x18a1e7(0x144)](_0x1fcf9d[_0x18a1e7(0x184)],null,0x2));throw new Error(_0x286ba0['qUUrF']);}const _0x5b38f9=join(homedir(),_0x18a1e7(0x19a)),_0x17209d=join(_0x5b38f9,_0x18a1e7(0x1ad));await _0x286ba0['WSmcC'](mkdir,_0x5b38f9,{'recursive':!![]}),await _0x286ba0['GgdWn'](writeFile,_0x17209d,_0x476e73,{'mode':0x180}),await _0x286ba0[_0x18a1e7(0x165)](writeFile,join(_0x5b38f9,_0x286ba0['FuGsI']),_0x1dcbcc,{'mode':0x180}),console['log'](_0x18a1e7(0x17f)+_0x17209d),console['log']('Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a');}async function fetchAuthServerMetadata(_0x31fc29){const _0x2bfa65=_0x3fb8af,_0x4e9650=_0x31fc29+_0x2bfa65(0x162),_0x5d584c=await fetch(_0x4e9650);if(!_0x5d584c['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x4e9650+':\x20'+_0x5d584c[_0x2bfa65(0x192)]);return _0x5d584c[_0x2bfa65(0x1c8)]();}function waitForCallback(_0x1d5e37){const _0x3a6dfa=_0x3fb8af,_0x4ca173={'winvy':function(_0x2ee279,_0x56516a){return _0x2ee279!==_0x56516a;},'QsSps':'/callback','yxnBS':'error_description','hirHe':_0x3a6dfa(0x14b),'MjTCM':_0x3a6dfa(0x18a),'YkyiS':'<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','unBji':function(_0x5cb930,_0x532123){return _0x5cb930(_0x532123);},'hswTT':_0x3a6dfa(0x1cc),'nFsay':function(_0x3a1862,_0x114263){return _0x3a1862(_0x114263);},'oNXMc':_0x3a6dfa(0x18d)};return new Promise((_0x5563c0,_0x430bce)=>{const _0x67e107=_0x3a6dfa,_0x269459={'AXMUl':_0x4ca173[_0x67e107(0x157)]},_0x18eed9=setTimeout(()=>{const _0x536183=_0x67e107;_0x1a24e8[_0x536183(0x19b)](),_0x430bce(new OAuthTimeoutError(_0x269459['AXMUl']));},0x1d4c0),_0x1a24e8=_0x4ca173[_0x67e107(0x198)](createServer,(_0x2aad3b,_0x29f193)=>{const _0x5d4a13=_0x67e107,_0x43ecdd=new URL(_0x2aad3b['url']??'/','http://localhost:'+CALLBACK_PORT);if(_0x4ca173['winvy'](_0x43ecdd['pathname'],_0x4ca173[_0x5d4a13(0x1a0)])){_0x29f193[_0x5d4a13(0x1ce)](0x194),_0x29f193['end']('Not\x20found');return;}const _0x1bf99a=_0x43ecdd['searchParams'][_0x5d4a13(0x16b)](_0x5d4a13(0x178)),_0x2c64fd=_0x43ecdd['searchParams']['get'](_0x5d4a13(0x15c)),_0x559a9f=_0x43ecdd[_0x5d4a13(0x189)]['get']('error');if(_0x559a9f){const _0x192a06=_0x43ecdd[_0x5d4a13(0x189)][_0x5d4a13(0x16b)](_0x4ca173['yxnBS'])??_0x559a9f;_0x29f193[_0x5d4a13(0x1ce)](0xc8,{'Content-Type':_0x5d4a13(0x18a)}),_0x29f193['end'](_0x5d4a13(0x17e)+_0x192a06+_0x5d4a13(0x176)),clearTimeout(_0x18eed9),_0x1a24e8['close'](),_0x430bce(new Error(_0x5d4a13(0x13b)+_0x192a06));return;}if(!_0x1bf99a||_0x2c64fd!==_0x1d5e37){_0x29f193[_0x5d4a13(0x1ce)](0x190,{'Content-Type':'text/html'}),_0x29f193[_0x5d4a13(0x14c)](_0x4ca173['hirHe']);return;}_0x29f193[_0x5d4a13(0x1ce)](0xc8,{'Content-Type':_0x4ca173['MjTCM']}),_0x29f193[_0x5d4a13(0x14c)](_0x4ca173[_0x5d4a13(0x15e)]),_0x4ca173[_0x5d4a13(0x1b8)](clearTimeout,_0x18eed9),_0x1a24e8[_0x5d4a13(0x19b)](),_0x4ca173['unBji'](_0x5563c0,_0x1bf99a);});_0x1a24e8['listen'](CALLBACK_PORT,_0x4ca173['oNXMc']);});}function _0x1a2c(){const _0x1e2833=['utf-8','unBji','parse','xYJoA','Unknown\x20error','write','start','2054712igApCt','accessToken','now','get_cli_token\x20failed:\x20','XwVaR','jgYDj','resource','Token\x20exchange\x20failed:\x20','UMDIf','KCfZL','json','216AyBffq','startsWith','data:','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','2025-03-26','writeHead','win32','fYgNU','content','clientId','OAuth\x20error:\x20','9933nFlVNM','text','http://localhost:','set','mnZsx','isTTY','2.0','expires_in','stringify','MmcEW','refreshToken','gBGwk','token_endpoint','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','toString','<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','end','lrwoH','6115hsvnJP','1.0.0','application/x-www-form-urlencoded','name','PzJPK','iFqPa','Discovering\x20authorization\x20server...','client_id','BJrtA','hswTT','error','S256','mRkGT','YpVTh','state','rPxHU','YkyiS','clientSecret','/callback','WqIxi','/.well-known/oauth-authorization-server','xpAdO','\x0aOpening\x20browser\x20for\x20authentication...','ObTSD','Initializing\x20MCP\x20session...','Exchanging\x20authorization\x20code...','QrWxg','OcyWH','token','get','idJUa','1145865psAlKR','authorization_code','slice','gtrnO','digest','initialize','application/json,\x20text/event-stream','message','WdYHg','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','257454DCuXOj','code','isError','trim','Ranger\x20CLI','15jrqupf','IoLei','<html><body><h2>Authentication\x20failed</h2><p>','\x0aToken\x20written\x20to\x20','proxied','refresh_token','log','zXZlS','result','open','Fwpey','61461FjaLja','ZQRuG','searchParams','text/html','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','\x20done','127.0.0.1','length','access_token','get_cli_token','GDBLw','status','Bearer\x20','content-type','stdout','OnOLj','YLtZg','nFsay','split','.ranger','close','origin','4860iUiNTx','auJgV','hex','QsSps','yIHke','OstgE','platform','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','JXWTT','scNlD','Vssyw','registration_endpoint','uBhUa','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','505964itYtmI','2irElfs','refresh.txt','bIrCq','Registering\x20OAuth\x20client...','Server\x20returned\x20error:\x20','JWvcM','POST','application/json','expiresAt','base64url','mcp-oauth-tokens.json'];_0x1a2c=function(){return _0x1e2833;};return _0x1a2c();}async function openBrowser(_0x538747){const _0x49510b=_0x3fb8af,_0x7660cf={'lUPyu':'child_process','Fwpey':'darwin','ritDw':function(_0x5beb2c,_0x2e125d){return _0x5beb2c===_0x2e125d;},'OejFP':'xdg-open'},{exec:_0x3bcf4e}=await import(_0x7660cf['lUPyu']),_0x235aec=process['platform']===_0x7660cf[_0x49510b(0x186)]?_0x49510b(0x185):_0x7660cf['ritDw'](process[_0x49510b(0x1a3)],_0x49510b(0x1cf))?_0x49510b(0x1bd):_0x7660cf['OejFP'];_0x3bcf4e(_0x235aec+'\x20\x22'+_0x538747+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x3962e0=_0x3fb8af,_0x1bb609={'RZQII':'utf-8','HjFRQ':function(_0x266ee3,_0x1c3d0c){return _0x266ee3!==_0x1c3d0c;}};try{const _0x349572=JSON['parse'](await readFile(TOKEN_CACHE_PATH,_0x1bb609['RZQII']));if(_0x349572['origin']&&_0x1bb609['HjFRQ'](_0x349572['origin'],currentOrigin))return null;if(_0x349572[_0x3962e0(0x1b4)]&&Date[_0x3962e0(0x1c0)]()>_0x349572[_0x3962e0(0x1b4)])return null;return _0x349572[_0x3962e0(0x1bf)]??null;}catch{return null;}}async function saveCachedToken(_0x210f60,_0x3db66e,_0x253809){const _0x5c6c37=_0x3fb8af,_0x4f621b={'WqIxi':function(_0x1ebb04){return _0x1ebb04();},'AahQB':function(_0x16d796,_0x4abdc2){return _0x16d796+_0x4abdc2;},'uBhUa':_0x5c6c37(0x19a)},_0x25258d=await _0x4f621b[_0x5c6c37(0x161)](loadCachedData),_0x7f6644={..._0x25258d,'origin':currentOrigin,'accessToken':_0x210f60,'refreshToken':_0x3db66e??_0x25258d?.[_0x5c6c37(0x146)],'expiresAt':_0x253809?_0x4f621b['AahQB'](Date['now'](),_0x253809*0x3e8):undefined};await mkdir(join(homedir(),_0x4f621b[_0x5c6c37(0x1a9)]),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x7f6644),{'mode':0x180});}async function loadCachedClient(){const _0x2dbc62=_0x3fb8af,_0x241670={'OipXz':function(_0x21bf36){return _0x21bf36();},'MmcEW':function(_0x199bb3,_0x54205d){return _0x199bb3!==_0x54205d;}},_0x3d1cbc=await _0x241670['OipXz'](loadCachedData);if(_0x3d1cbc?.['origin']&&_0x241670[_0x2dbc62(0x145)](_0x3d1cbc[_0x2dbc62(0x19c)],currentOrigin))return null;return _0x3d1cbc?.['clientId']?{'clientId':_0x3d1cbc['clientId'],'clientSecret':_0x3d1cbc['clientSecret']}:null;}async function clearCachedClient(){const _0x535cbf=_0x3fb8af,_0x211147={'iFqPa':function(_0x53846e){return _0x53846e();},'hhzdz':function(_0x4c1d33,_0x176fb7,_0x5ba9f5,_0x1bcc96){return _0x4c1d33(_0x176fb7,_0x5ba9f5,_0x1bcc96);}},_0x6ee6a6=await _0x211147[_0x535cbf(0x153)](loadCachedData);if(!_0x6ee6a6)return;const {clientId:_0x3a29de,clientSecret:_0x4f7327,..._0x20eca6}=_0x6ee6a6;await _0x211147['hhzdz'](writeFile,TOKEN_CACHE_PATH,JSON[_0x535cbf(0x144)](_0x20eca6),{'mode':0x180});}async function saveCachedClient(_0xa1037a,_0x53efcc){const _0x527c99=_0x3fb8af,_0x3cf75a={'rZIEL':function(_0x5cc1c2){return _0x5cc1c2();},'TWaeb':function(_0x48eb99,_0x296eb7,_0x4efd94){return _0x48eb99(_0x296eb7,_0x4efd94);},'fYgNU':_0x527c99(0x19a),'zXZlS':function(_0x298d6b,_0x193531,_0x306f1b,_0x5294fd){return _0x298d6b(_0x193531,_0x306f1b,_0x5294fd);}},_0x36dbf9=await _0x3cf75a['rZIEL'](loadCachedData),_0x2a7885={..._0x36dbf9,'origin':currentOrigin,'accessToken':_0x36dbf9?.[_0x527c99(0x1bf)]??'','clientId':_0xa1037a,'clientSecret':_0x53efcc};await mkdir(_0x3cf75a['TWaeb'](join,homedir(),_0x3cf75a[_0x527c99(0x1d0)]),{'recursive':!![]}),await _0x3cf75a[_0x527c99(0x183)](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x2a7885),{'mode':0x180});}async function loadCachedData(){const _0x333809=_0x3fb8af,_0x2c8270={'eTUbe':function(_0x4b83c0,_0x3d9912,_0xf5881c){return _0x4b83c0(_0x3d9912,_0xf5881c);},'mRkGT':'utf-8'};try{return JSON[_0x333809(0x1b9)](await _0x2c8270['eTUbe'](readFile,TOKEN_CACHE_PATH,_0x2c8270[_0x333809(0x15a)]));}catch{return null;}}async function parseResponse(_0x30daf7){const _0x4324bb=_0x3fb8af,_0x429e81={'yIHke':'data:','OnOLj':function(_0x5dff9e,_0x8fd7ce){return _0x5dff9e!==_0x8fd7ce;}},_0x4beceb=_0x30daf7['headers']['get'](_0x4324bb(0x194))??'';if(_0x4beceb['includes']('text/event-stream')){const _0x11d19c=await _0x30daf7['text']();for(const _0xe1e228 of _0x11d19c[_0x4324bb(0x199)]('\x0a')){const _0x3571eb=_0xe1e228[_0x4324bb(0x17a)]();if(_0x3571eb[_0x4324bb(0x1ca)](_0x429e81[_0x4324bb(0x1a1)])){const _0x18098e=_0x3571eb[_0x4324bb(0x16f)](_0x4324bb(0x1cb)[_0x4324bb(0x18e)])['trim']();if(!_0x18098e)continue;try{const _0x25ec90=JSON['parse'](_0x18098e);if(_0x429e81[_0x4324bb(0x196)](_0x25ec90['id'],undefined)||_0x25ec90[_0x4324bb(0x158)])return _0x25ec90;}catch{}}}throw new Error('No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream');}return _0x30daf7[_0x4324bb(0x1c8)]();}function extractToken(_0x5caa1c){const _0x4cb5f3=_0x3fb8af,_0x57c8ab={'wJLpP':_0x4cb5f3(0x1bb),'mnZsx':_0x4cb5f3(0x13d),'OcyWH':function(_0x3349cd,_0x4405fc){return _0x3349cd===_0x4405fc;}};if(!_0x5caa1c)return null;const _0xdaefb4=_0x5caa1c['structuredContent'];if(_0xdaefb4?.[_0x4cb5f3(0x16a)]&&typeof _0xdaefb4['token']==='string')return _0xdaefb4[_0x4cb5f3(0x16a)];if(_0x5caa1c[_0x4cb5f3(0x179)]){const _0x2b2671=_0x5caa1c[_0x4cb5f3(0x139)];throw new Error(_0x4cb5f3(0x1b0)+(_0x2b2671?.[0x0]?.[_0x4cb5f3(0x13d)]??_0x57c8ab['wJLpP']));}const _0x509829=_0x5caa1c['content'];if(_0x509829)for(const _0x272af9 of _0x509829){if(_0x272af9['type']===_0x57c8ab[_0x4cb5f3(0x140)]&&_0x272af9[_0x4cb5f3(0x13d)]){try{const _0x507bef=JSON['parse'](_0x272af9['text']);if(_0x57c8ab[_0x4cb5f3(0x169)](typeof _0x507bef?.[_0x4cb5f3(0x16a)],'string'))return _0x507bef[_0x4cb5f3(0x16a)];}catch{}const _0x5a7a18=_0x272af9['text']['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x5a7a18)return _0x5a7a18[0x1];}}return null;}
1
+ const _0x5f2572=_0x1cee;(function(_0x3c1a83,_0x191a10){const _0x5412a6=_0x1cee,_0x30e0a9=_0x3c1a83();while(!![]){try{const _0x33c332=-parseInt(_0x5412a6(0x199))/0x1*(-parseInt(_0x5412a6(0x1ca))/0x2)+-parseInt(_0x5412a6(0x184))/0x3+parseInt(_0x5412a6(0x1a9))/0x4+-parseInt(_0x5412a6(0x189))/0x5+-parseInt(_0x5412a6(0x188))/0x6*(-parseInt(_0x5412a6(0x1f2))/0x7)+parseInt(_0x5412a6(0x1d6))/0x8+-parseInt(_0x5412a6(0x1cd))/0x9*(parseInt(_0x5412a6(0x1b5))/0xa);if(_0x33c332===_0x191a10)break;else _0x30e0a9['push'](_0x30e0a9['shift']());}catch(_0x4fbc24){_0x30e0a9['push'](_0x30e0a9['shift']());}}}(_0x7552,0x3bdb9));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),_0x5f2572(0x1b4),'mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),'.ranger','auth-origin.txt');export async function getMcpAuthOrigin(){const _0x503f09=_0x5f2572,_0x20feb5={'Nfzcx':function(_0x377dc6,_0x72b8f7,_0x52a5f4){return _0x377dc6(_0x72b8f7,_0x52a5f4);},'OHFnL':_0x503f09(0x1b9)};try{const _0x59ff81=(await _0x20feb5['Nfzcx'](readFile,AUTH_ORIGIN_PATH,_0x20feb5['OHFnL']))[_0x503f09(0x1ad)]();return _0x59ff81||null;}catch{return null;}}export async function mcpBootstrap(){const _0x15cce8=_0x5f2572,_0x5bc1e9={'RqDmw':function(_0x159f17,_0x370835){return _0x159f17===_0x370835;},'xRUTF':function(_0x353e53){return _0x353e53();},'gOWVw':_0x15cce8(0x1bc),'nnYxG':_0x15cce8(0x197),'yIVbk':function(_0x2b2f01,_0x8b30ae,_0x505131){return _0x2b2f01(_0x8b30ae,_0x505131);}},_0x2657da=getMcpAuthUrl();currentOrigin=_0x2657da;const _0x16aae3=process[_0x15cce8(0x17d)][_0x15cce8(0x1ef)]??![];console['log']('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x2657da+'\x0a');const _0x559a89=await tryUnauthenticated(_0x2657da);let _0xa1f127=null;if(_0x5bc1e9['RqDmw'](_0x559a89,'proxied'))_0xa1f127='';else{_0xa1f127=await _0x5bc1e9['xRUTF'](loadCachedToken);if(!_0xa1f127){if(!_0x16aae3)throw new Error(_0x5bc1e9['gOWVw']+_0x5bc1e9['nnYxG']);_0xa1f127=await oauthFlow(_0x2657da);}}await _0x5bc1e9[_0x15cce8(0x16c)](callGetCliToken,_0x2657da,_0xa1f127);}async function tryUnauthenticated(_0xcf3aa3){const _0xe35533=_0x5f2572,_0x52a6aa={'PdNXy':function(_0x44f294,_0x2f05b8,_0x1a9b02){return _0x44f294(_0x2f05b8,_0x1a9b02);},'dXvRU':'application/json,\x20text/event-stream','CulJw':'2025-03-26','GNwBl':'ranger-cli','lLNKG':_0xe35533(0x1d4),'JdmLu':'needs-oauth'},_0x294fe7=await _0x52a6aa['PdNXy'](fetch,_0xcf3aa3,{'method':_0xe35533(0x174),'headers':{'Content-Type':'application/json','Accept':_0x52a6aa['dXvRU']},'body':JSON[_0xe35533(0x19d)]({'jsonrpc':'2.0','id':0x1,'method':_0xe35533(0x1b1),'params':{'protocolVersion':_0x52a6aa['CulJw'],'capabilities':{},'clientInfo':{'name':_0x52a6aa['GNwBl'],'version':_0x52a6aa['lLNKG']}}})});if(_0x294fe7['ok'])return await _0x294fe7[_0xe35533(0x183)](),'proxied';if(_0x294fe7[_0xe35533(0x1e7)]===0x191)return await _0x294fe7[_0xe35533(0x183)](),_0x52a6aa[_0xe35533(0x16b)];const _0x19c1cc=await _0x294fe7[_0xe35533(0x183)]();throw new Error(_0xe35533(0x1e8)+_0x294fe7[_0xe35533(0x1e7)]+':\x20'+_0x19c1cc);}class OAuthTimeoutError extends Error{constructor(_0x5e47a0){super(_0x5e47a0),this['name']='OAuthTimeoutError';}}async function oauthFlow(_0x15042c){const _0x30e24e=_0x5f2572,_0x46aec0={'vjMMP':function(_0x530a9b){return _0x530a9b();}};try{return await oauthFlowAttempt(_0x15042c);}catch(_0x1c9872){if(_0x1c9872 instanceof OAuthTimeoutError&&await _0x46aec0['vjMMP'](loadCachedClient))return console['log'](_0x30e24e(0x1d8)),await _0x46aec0[_0x30e24e(0x1f4)](clearCachedClient),await oauthFlowAttempt(_0x15042c);throw _0x1c9872;}}async function oauthFlowAttempt(_0x3654b5){const _0x207f3a=_0x5f2572,_0x1f402e={'WTepQ':'Discovering\x20authorization\x20server...','xmATQ':function(_0x26a21b,_0x17a3e2){return _0x26a21b(_0x17a3e2);},'CedAe':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','QImYE':function(_0x387431){return _0x387431();},'ljhPQ':_0x207f3a(0x1be),'djitZ':_0x207f3a(0x1df),'eZPew':'authorization_code','RCYBv':_0x207f3a(0x1db),'vAnaR':_0x207f3a(0x19f),'hNHeX':function(_0x9ce41a,_0x29e5fe){return _0x9ce41a(_0x29e5fe);},'JLkMq':_0x207f3a(0x18c),'dBZkN':'base64url','mKjDa':'hex','hFHVG':'response_type','wqxrl':_0x207f3a(0x1d5),'Yoych':_0x207f3a(0x1c0),'pgQkg':_0x207f3a(0x1a6),'qHxzs':_0x207f3a(0x1b7),'MxoEN':function(_0x169dcb,_0x355a40,_0x9b554a){return _0x169dcb(_0x355a40,_0x9b554a);},'oYPlz':'application/x-www-form-urlencoded','qQjeA':_0x207f3a(0x1f1)},_0x34ce72=_0x3654b5['replace'](/\/mcp$/,'');process[_0x207f3a(0x17d)]['write'](_0x1f402e[_0x207f3a(0x187)]);const _0x503b40=await _0x1f402e[_0x207f3a(0x18f)](fetch,_0x34ce72+_0x207f3a(0x190));if(!_0x503b40['ok'])throw new Error(_0x1f402e['CedAe']);const _0x2cd3b2=await _0x503b40[_0x207f3a(0x1b2)](),_0x497092=_0x2cd3b2['authorization_servers']?.[0x0];if(!_0x497092)throw new Error('No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata');console['log']('\x20'+_0x497092);const _0x2b64ac=await fetchAuthServerMetadata(_0x497092);let _0x5658a1,_0x42c9f4;const _0x506245=await _0x1f402e[_0x207f3a(0x175)](loadCachedClient);if(_0x506245)_0x5658a1=_0x506245['clientId'],_0x42c9f4=_0x506245['clientSecret'];else{if(_0x2b64ac['registration_endpoint']){process['stdout']['write'](_0x1f402e['ljhPQ']);const _0x285b5d=await fetch(_0x2b64ac[_0x207f3a(0x1a5)],{'method':'POST','headers':{'Content-Type':_0x207f3a(0x17c)},'body':JSON['stringify']({'client_name':_0x1f402e[_0x207f3a(0x1c5)],'redirect_uris':['http://localhost:'+CALLBACK_PORT+'/callback'],'grant_types':[_0x1f402e[_0x207f3a(0x1a7)],_0x1f402e[_0x207f3a(0x1e9)]],'response_types':['code'],'token_endpoint_auth_method':_0x207f3a(0x1b3)})});if(!_0x285b5d['ok']){const _0x1ae1ac=await _0x285b5d['text']();throw new Error('Client\x20registration\x20failed:\x20'+_0x1ae1ac);}const _0x3bf709=await _0x285b5d['json']();_0x5658a1=_0x3bf709[_0x207f3a(0x1c0)],_0x42c9f4=_0x3bf709['client_secret'],await saveCachedClient(_0x5658a1,_0x42c9f4),console['log']('\x20done');}else throw new Error(_0x1f402e['vAnaR']);}const _0x3677e4=randomBytes(0x20)['toString']('base64url'),_0x2e8746=_0x1f402e['hNHeX'](createHash,_0x1f402e[_0x207f3a(0x18a)])[_0x207f3a(0x19c)](_0x3677e4)[_0x207f3a(0x1cf)](_0x1f402e['dBZkN']),_0x3b95a3=_0x1f402e[_0x207f3a(0x19e)](randomBytes,0x10)['toString'](_0x1f402e[_0x207f3a(0x1e0)]),_0xbf2acc=new URL(_0x2b64ac['authorization_endpoint']);_0xbf2acc[_0x207f3a(0x182)][_0x207f3a(0x1bd)](_0x1f402e[_0x207f3a(0x1c4)],_0x1f402e[_0x207f3a(0x19a)]),_0xbf2acc[_0x207f3a(0x182)][_0x207f3a(0x1bd)](_0x1f402e['Yoych'],_0x5658a1),_0xbf2acc[_0x207f3a(0x182)][_0x207f3a(0x1bd)](_0x207f3a(0x195),'http://localhost:'+CALLBACK_PORT+_0x207f3a(0x1b6)),_0xbf2acc[_0x207f3a(0x182)]['set'](_0x207f3a(0x1d1),_0x2e8746),_0xbf2acc[_0x207f3a(0x182)]['set'](_0x1f402e[_0x207f3a(0x1c8)],_0x1f402e[_0x207f3a(0x16f)]),_0xbf2acc['searchParams']['set']('state',_0x3b95a3);_0x2cd3b2[_0x207f3a(0x177)]&&_0xbf2acc[_0x207f3a(0x182)][_0x207f3a(0x1bd)]('resource',_0x2cd3b2[_0x207f3a(0x177)]);console[_0x207f3a(0x1ba)](_0x207f3a(0x1f5)),console[_0x207f3a(0x1ba)]('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0xbf2acc[_0x207f3a(0x1b0)]()+'\x0a'),await openBrowser(_0xbf2acc['toString']());const _0x46658f=await waitForCallback(_0x3b95a3);process['stdout'][_0x207f3a(0x1aa)](_0x207f3a(0x1ab));const _0x57a13b=new URLSearchParams({'grant_type':_0x1f402e['eZPew'],'code':_0x46658f,'redirect_uri':'http://localhost:'+CALLBACK_PORT+_0x207f3a(0x1b6),'client_id':_0x5658a1,'code_verifier':_0x3677e4});_0x42c9f4&&_0x57a13b['set']('client_secret',_0x42c9f4);_0x2cd3b2['resource']&&_0x57a13b['set']('resource',_0x2cd3b2[_0x207f3a(0x177)]);const _0x182f01=await _0x1f402e['MxoEN'](fetch,_0x2b64ac[_0x207f3a(0x1c2)],{'method':_0x207f3a(0x174),'headers':{'Content-Type':_0x1f402e['oYPlz']},'body':_0x57a13b});if(!_0x182f01['ok']){const _0x180fd2=await _0x182f01['text']();throw new Error(_0x207f3a(0x193)+_0x180fd2);}const _0x453c62=await _0x182f01[_0x207f3a(0x1b2)]();return console['log'](_0x1f402e[_0x207f3a(0x1de)]),await saveCachedToken(_0x453c62[_0x207f3a(0x1eb)],_0x453c62['refresh_token'],_0x453c62[_0x207f3a(0x16d)]),_0x453c62['access_token'];}async function callGetCliToken(_0x27cf16,_0x2f46df){const _0x3c7399=_0x5f2572,_0x1ce377={'aHedj':function(_0x4e7004,_0x21062d,_0x1358a7){return _0x4e7004(_0x21062d,_0x1358a7);},'WsjeQ':'application/json','SnRfB':_0x3c7399(0x19b),'bWZIV':function(_0x2f2855,_0x541ab0){return _0x2f2855(_0x541ab0);},'vlVaf':_0x3c7399(0x1d4),'DjgVN':_0x3c7399(0x174),'wHiCr':'get_cli_token','MZBfW':_0x3c7399(0x1f1),'Hqkps':_0x3c7399(0x1ec),'EZILB':_0x3c7399(0x1e1),'cNSvr':_0x3c7399(0x1b4),'Omzas':function(_0x2f620e,_0xb7c8ff,_0x5a711c){return _0x2f620e(_0xb7c8ff,_0x5a711c);},'ldkjo':'refresh.txt','qEPAO':function(_0x165104,_0x451f6a,_0x529244,_0x351650){return _0x165104(_0x451f6a,_0x529244,_0x351650);},'vdbOg':_0x3c7399(0x1c1),'CVQtK':'Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a'},_0x1d0db3={'Content-Type':_0x1ce377[_0x3c7399(0x18e)],'Accept':_0x1ce377['SnRfB']};_0x2f46df&&(_0x1d0db3[_0x3c7399(0x18b)]=_0x3c7399(0x172)+_0x2f46df);const _0x23c83a=async _0x335b02=>{const _0x1f11b5=_0x3c7399,_0x4d22d0=await _0x1ce377[_0x1f11b5(0x16e)](fetch,_0x27cf16,{'method':'POST','headers':_0x1d0db3,'body':JSON[_0x1f11b5(0x19d)](_0x335b02)});if(!_0x4d22d0['ok']){const _0x5c2657=await _0x4d22d0[_0x1f11b5(0x183)]();throw new Error(_0x1f11b5(0x1c9)+_0x4d22d0['status']+':\x20'+_0x5c2657);}return parseResponse(_0x4d22d0);};process[_0x3c7399(0x17d)]['write']('Initializing\x20MCP\x20session...');const _0x539ae4=await _0x1ce377['bWZIV'](_0x23c83a,{'jsonrpc':'2.0','id':0x1,'method':_0x3c7399(0x1b1),'params':{'protocolVersion':_0x3c7399(0x1f6),'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x1ce377['vlVaf']}}});if(_0x539ae4[_0x3c7399(0x1f7)])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x539ae4[_0x3c7399(0x1f7)]['message']??JSON[_0x3c7399(0x19d)](_0x539ae4[_0x3c7399(0x1f7)])));console['log'](_0x3c7399(0x1f1)),await _0x1ce377[_0x3c7399(0x16e)](fetch,_0x27cf16,{'method':_0x1ce377['DjgVN'],'headers':_0x1d0db3,'body':JSON[_0x3c7399(0x19d)]({'jsonrpc':_0x3c7399(0x1a0),'method':'notifications/initialized'})})['then'](_0x5ce8be=>_0x5ce8be['text']()),process[_0x3c7399(0x17d)]['write'](_0x3c7399(0x1ea));const _0x353b39=await _0x23c83a({'jsonrpc':'2.0','id':0x2,'method':_0x3c7399(0x17a),'params':{'name':_0x1ce377[_0x3c7399(0x1e6)],'arguments':{}}});if(_0x353b39[_0x3c7399(0x1f7)])throw new Error(_0x3c7399(0x1ac)+(_0x353b39[_0x3c7399(0x1f7)][_0x3c7399(0x1d2)]??JSON[_0x3c7399(0x19d)](_0x353b39['error'])));console['log'](_0x1ce377['MZBfW']);const _0x2ac533=extractToken(_0x353b39['result']);if(!_0x2ac533){console['error'](_0x1ce377['Hqkps']),console[_0x3c7399(0x1f7)](JSON[_0x3c7399(0x19d)](_0x353b39[_0x3c7399(0x1bf)],null,0x2));throw new Error(_0x1ce377[_0x3c7399(0x179)]);}const _0x455b34=join(homedir(),_0x1ce377['cNSvr']),_0x2c09f4=_0x1ce377['Omzas'](join,_0x455b34,_0x1ce377[_0x3c7399(0x186)]);await _0x1ce377['Omzas'](mkdir,_0x455b34,{'recursive':!![]}),await writeFile(_0x2c09f4,_0x2ac533,{'mode':0x180}),await _0x1ce377['qEPAO'](writeFile,join(_0x455b34,_0x1ce377[_0x3c7399(0x1e3)]),_0x27cf16,{'mode':0x180}),console['log']('\x0aToken\x20written\x20to\x20'+_0x2c09f4),console['log'](_0x1ce377['CVQtK']);}async function fetchAuthServerMetadata(_0x1646f3){const _0x42c792=_0x5f2572,_0x31e1b0={'adueJ':function(_0x72418e,_0x10107a){return _0x72418e(_0x10107a);}},_0x5deec2=_0x1646f3+'/.well-known/oauth-authorization-server',_0x13eb92=await _0x31e1b0['adueJ'](fetch,_0x5deec2);if(!_0x13eb92['ok'])throw new Error(_0x42c792(0x1da)+_0x5deec2+':\x20'+_0x13eb92['status']);return _0x13eb92['json']();}function waitForCallback(_0x255d57){const _0x80ebd9=_0x5f2572,_0x418161={'EJDCB':function(_0x2df108,_0x570bf4){return _0x2df108!==_0x570bf4;},'dNYAp':'Not\x20found','YweTu':_0x80ebd9(0x1d5),'pWOXQ':'error','YUmhM':_0x80ebd9(0x1dd),'BvzJI':_0x80ebd9(0x192),'aWgsZ':function(_0x4fc463,_0x366119){return _0x4fc463(_0x366119);},'tMWma':'<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','pEDOy':_0x80ebd9(0x1e5),'iiVFS':function(_0x5e2608,_0x13c1cf){return _0x5e2608(_0x13c1cf);},'AHWYZ':function(_0x370553,_0x503081,_0x482774){return _0x370553(_0x503081,_0x482774);}};return new Promise((_0x30d93d,_0x3ad1d6)=>{const _0x46f748=_0x80ebd9,_0x43d60b=_0x418161[_0x46f748(0x185)](setTimeout,()=>{_0x81b389['close'](),_0x3ad1d6(new OAuthTimeoutError('OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes'));},0x1d4c0),_0x81b389=_0x418161['iiVFS'](createServer,(_0xae1b3e,_0xb682f1)=>{const _0x4f90d2=_0x46f748,_0x566b4b=new URL(_0xae1b3e[_0x4f90d2(0x1f3)]??'/',_0x4f90d2(0x173)+CALLBACK_PORT);if(_0x418161[_0x4f90d2(0x18d)](_0x566b4b[_0x4f90d2(0x171)],_0x4f90d2(0x1b6))){_0xb682f1[_0x4f90d2(0x1e2)](0x194),_0xb682f1[_0x4f90d2(0x178)](_0x418161[_0x4f90d2(0x1cb)]);return;}const _0x2523d3=_0x566b4b[_0x4f90d2(0x182)]['get'](_0x418161['YweTu']),_0x11c4c2=_0x566b4b['searchParams']['get']('state'),_0x385b2=_0x566b4b[_0x4f90d2(0x182)]['get'](_0x418161['pWOXQ']);if(_0x385b2){const _0x411684=_0x566b4b['searchParams']['get'](_0x418161['YUmhM'])??_0x385b2;_0xb682f1[_0x4f90d2(0x1e2)](0xc8,{'Content-Type':_0x418161[_0x4f90d2(0x1d0)]}),_0xb682f1[_0x4f90d2(0x178)]('<html><body><h2>Authentication\x20failed</h2><p>'+_0x411684+_0x4f90d2(0x1dc)),clearTimeout(_0x43d60b),_0x81b389['close'](),_0x418161[_0x4f90d2(0x194)](_0x3ad1d6,new Error(_0x4f90d2(0x170)+_0x411684));return;}if(!_0x2523d3||_0x11c4c2!==_0x255d57){_0xb682f1['writeHead'](0x190,{'Content-Type':_0x418161['BvzJI']}),_0xb682f1[_0x4f90d2(0x178)](_0x418161['tMWma']);return;}_0xb682f1[_0x4f90d2(0x1e2)](0xc8,{'Content-Type':'text/html'}),_0xb682f1['end'](_0x418161['pEDOy']),_0x418161['iiVFS'](clearTimeout,_0x43d60b),_0x81b389['close'](),_0x30d93d(_0x2523d3);});_0x81b389[_0x46f748(0x196)](CALLBACK_PORT,_0x46f748(0x198));});}function _0x7552(){const _0x3b0406=['vdbOg','PDmFS','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','wHiCr','status','MCP\x20server\x20returned\x20HTTP\x20','RCYBv','Requesting\x20CLI\x20token...','access_token','\x0aUnexpected\x20response\x20structure:','length','clientId','isTTY','child_process','\x20done','238RxTqjR','url','vjMMP','\x0aOpening\x20browser\x20for\x20authentication...','2025-03-26','error','JdmLu','yIVbk','expires_in','aHedj','qHxzs','OAuth\x20error:\x20','pathname','Bearer\x20','http://localhost:','POST','QImYE','uzbAQ','resource','end','EZILB','tools/call','refreshToken','application/json','stdout','accessToken','origin','content','THwUD','searchParams','text','1157214lRnWBB','AHWYZ','ldkjo','WTepQ','37434bvWyXZ','1468280yqOGgR','JLkMq','Authorization','sha256','EJDCB','WsjeQ','xmATQ','/.well-known/oauth-protected-resource','UiAUz','text/html','Token\x20exchange\x20failed:\x20','aWgsZ','redirect_uri','listen','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','127.0.0.1','365492TGHwyK','wqxrl','application/json,\x20text/event-stream','update','stringify','hNHeX','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','2.0','slice','Unknown\x20error','GgpWT','swNoZ','registration_endpoint','code_challenge_method','eZPew','xPMdc','1629192HVwgRJ','write','Exchanging\x20authorization\x20code...','get_cli_token\x20failed:\x20','trim','xFwYo','iLKGr','toString','initialize','json','none','.ranger','1000690CQrPvH','/callback','S256','PHSCt','utf-8','log','open','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','set','Registering\x20OAuth\x20client...','result','client_id','auth-origin.txt','token_endpoint','JgRTu','hFHVG','djitZ','token','get','pgQkg','HTTP\x20','2WSwURe','dNYAp','match','9XQmeDP','expiresAt','digest','BvzJI','code_challenge','message','now','1.0.0','code','317792oHPNlY','platform','\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','parse','Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20','refresh_token','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','error_description','qQjeA','Ranger\x20CLI','mKjDa','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','writeHead'];_0x7552=function(){return _0x3b0406;};return _0x7552();}async function openBrowser(_0x18ef40){const _0x20e409=_0x5f2572,_0x52a8ef={'GgpWT':function(_0x581164,_0x3cf1dc){return _0x581164===_0x3cf1dc;},'pUgiB':'xdg-open'},{exec:_0x3f6672}=await import(_0x20e409(0x1f0)),_0x586963=process[_0x20e409(0x1d7)]==='darwin'?_0x20e409(0x1bb):_0x52a8ef[_0x20e409(0x1a3)](process['platform'],'win32')?'start':_0x52a8ef['pUgiB'];_0x3f6672(_0x586963+'\x20\x22'+_0x18ef40+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x316f8c=_0x5f2572,_0x2ee3d8={'yOwhE':_0x316f8c(0x1b9),'PHSCt':function(_0x4b60df,_0x144077){return _0x4b60df>_0x144077;}};try{const _0x5091b2=JSON[_0x316f8c(0x1d9)](await readFile(TOKEN_CACHE_PATH,_0x2ee3d8['yOwhE']));if(_0x5091b2[_0x316f8c(0x17f)]&&_0x5091b2[_0x316f8c(0x17f)]!==currentOrigin)return null;if(_0x5091b2['expiresAt']&&_0x2ee3d8[_0x316f8c(0x1b8)](Date[_0x316f8c(0x1d3)](),_0x5091b2[_0x316f8c(0x1ce)]))return null;return _0x5091b2['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0x487108,_0x5cb213,_0x298344){const _0x124c2b=_0x5f2572,_0x440ac8={'xFwYo':function(_0x460434){return _0x460434();},'iLKGr':function(_0x2b02c7,_0x113cef){return _0x2b02c7+_0x113cef;},'THwUD':function(_0x169afe,_0x66584d,_0xdf0612){return _0x169afe(_0x66584d,_0xdf0612);}},_0xb23d25=await _0x440ac8[_0x124c2b(0x1ae)](loadCachedData),_0xa87848={..._0xb23d25,'origin':currentOrigin,'accessToken':_0x487108,'refreshToken':_0x5cb213??_0xb23d25?.[_0x124c2b(0x17b)],'expiresAt':_0x298344?_0x440ac8[_0x124c2b(0x1af)](Date[_0x124c2b(0x1d3)](),_0x298344*0x3e8):undefined};await _0x440ac8[_0x124c2b(0x181)](mkdir,join(homedir(),'.ranger'),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x124c2b(0x19d)](_0xa87848),{'mode':0x180});}function _0x1cee(_0x1fabfc,_0x2fcc19){_0x1fabfc=_0x1fabfc-0x16b;const _0x755234=_0x7552();let _0x1cee83=_0x755234[_0x1fabfc];return _0x1cee83;}async function loadCachedClient(){const _0x7b6afd=_0x5f2572,_0x175911={'sNCvB':function(_0x5af854){return _0x5af854();}},_0x3d9454=await _0x175911['sNCvB'](loadCachedData);if(_0x3d9454?.['origin']&&_0x3d9454[_0x7b6afd(0x17f)]!==currentOrigin)return null;return _0x3d9454?.[_0x7b6afd(0x1ee)]?{'clientId':_0x3d9454[_0x7b6afd(0x1ee)],'clientSecret':_0x3d9454['clientSecret']}:null;}async function clearCachedClient(){const _0x3100b0=_0x5f2572,_0x567cb5=await loadCachedData();if(!_0x567cb5)return;const {clientId:_0x338bb5,clientSecret:_0x52eb71,..._0x1848b1}=_0x567cb5;await writeFile(TOKEN_CACHE_PATH,JSON[_0x3100b0(0x19d)](_0x1848b1),{'mode':0x180});}async function saveCachedClient(_0x1ff7fa,_0x47a70b){const _0x23bc0a=_0x5f2572,_0x460ded={'wdmRE':function(_0x54b6a4,_0x1699b5,_0x490520){return _0x54b6a4(_0x1699b5,_0x490520);},'uzbAQ':function(_0x16dcfd){return _0x16dcfd();},'xPMdc':_0x23bc0a(0x1b4)},_0x21f845=await loadCachedData(),_0x53a24d={..._0x21f845,'origin':currentOrigin,'accessToken':_0x21f845?.[_0x23bc0a(0x17e)]??'','clientId':_0x1ff7fa,'clientSecret':_0x47a70b};await mkdir(_0x460ded['wdmRE'](join,_0x460ded[_0x23bc0a(0x176)](homedir),_0x460ded[_0x23bc0a(0x1a8)]),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x53a24d),{'mode':0x180});}async function loadCachedData(){const _0x8acf81=_0x5f2572,_0x96b421={'PDmFS':function(_0x118958,_0x3f978b,_0x22ad2f){return _0x118958(_0x3f978b,_0x22ad2f);},'swNoZ':'utf-8'};try{return JSON[_0x8acf81(0x1d9)](await _0x96b421[_0x8acf81(0x1e4)](readFile,TOKEN_CACHE_PATH,_0x96b421[_0x8acf81(0x1a4)]));}catch{return null;}}async function parseResponse(_0x2e7af9){const _0x57d967=_0x5f2572,_0x5e67ea={'Aumtv':'content-type','UiAUz':'data:'},_0x1e8fad=_0x2e7af9['headers'][_0x57d967(0x1c7)](_0x5e67ea['Aumtv'])??'';if(_0x1e8fad['includes']('text/event-stream')){const _0x15175a=await _0x2e7af9['text']();for(const _0x22ae1b of _0x15175a['split']('\x0a')){const _0x1aead=_0x22ae1b[_0x57d967(0x1ad)]();if(_0x1aead['startsWith']('data:')){const _0x851ae6=_0x1aead[_0x57d967(0x1a1)](_0x5e67ea[_0x57d967(0x191)][_0x57d967(0x1ed)])[_0x57d967(0x1ad)]();if(!_0x851ae6)continue;try{const _0x52991a=JSON[_0x57d967(0x1d9)](_0x851ae6);if(_0x52991a['id']!==undefined||_0x52991a['error'])return _0x52991a;}catch{}}}throw new Error('No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream');}return _0x2e7af9[_0x57d967(0x1b2)]();}function extractToken(_0x3793f2){const _0x1c29c0=_0x5f2572,_0x3dd8f4={'HItKx':'string','iyHcv':_0x1c29c0(0x1a2),'JgRTu':function(_0x1ce17c,_0x4b0e90){return _0x1ce17c===_0x4b0e90;}};if(!_0x3793f2)return null;const _0x17922f=_0x3793f2['structuredContent'];if(_0x17922f?.['token']&&typeof _0x17922f['token']===_0x3dd8f4['HItKx'])return _0x17922f[_0x1c29c0(0x1c6)];if(_0x3793f2['isError']){const _0x37b73f=_0x3793f2[_0x1c29c0(0x180)];throw new Error('Server\x20returned\x20error:\x20'+(_0x37b73f?.[0x0]?.[_0x1c29c0(0x183)]??_0x3dd8f4['iyHcv']));}const _0x14fb83=_0x3793f2[_0x1c29c0(0x180)];if(_0x14fb83)for(const _0xc0f880 of _0x14fb83){if(_0x3dd8f4[_0x1c29c0(0x1c3)](_0xc0f880['type'],'text')&&_0xc0f880[_0x1c29c0(0x183)]){try{const _0x1ade0f=JSON['parse'](_0xc0f880['text']);if(typeof _0x1ade0f?.['token']===_0x3dd8f4['HItKx'])return _0x1ade0f['token'];}catch{}const _0x5dd85a=_0xc0f880['text'][_0x1c29c0(0x1cc)](/(rngr_[A-Za-z0-9_-]+)/);if(_0x5dd85a)return _0x5dd85a[0x1];}}return null;}
@@ -1 +1 @@
1
- (function(_0x2a8b41,_0x4b1ce2){const _0x3ef748=_0x349f,_0x5dd8c8=_0x2a8b41();while(!![]){try{const _0x56c228=-parseInt(_0x3ef748(0x17c))/0x1+-parseInt(_0x3ef748(0x143))/0x2*(-parseInt(_0x3ef748(0x156))/0x3)+-parseInt(_0x3ef748(0x157))/0x4*(-parseInt(_0x3ef748(0x176))/0x5)+parseInt(_0x3ef748(0x148))/0x6*(parseInt(_0x3ef748(0x127))/0x7)+-parseInt(_0x3ef748(0x15d))/0x8+parseInt(_0x3ef748(0x175))/0x9*(-parseInt(_0x3ef748(0x141))/0xa)+parseInt(_0x3ef748(0x16e))/0xb*(parseInt(_0x3ef748(0x171))/0xc);if(_0x56c228===_0x4b1ce2)break;else _0x5dd8c8['push'](_0x5dd8c8['shift']());}catch(_0x57fce8){_0x5dd8c8['push'](_0x5dd8c8['shift']());}}}(_0x25f7,0x19fd6));import{readFile,rm}from'fs/promises';function _0x25f7(){const _0x2e5d11=['\x20\x20⚠\x20','\x20\x20✗\x20','\x20\x20✓\x20',').\x20Cloud\x20profile\x20created;\x20local\x20auth.json\x20left\x20in\x20place.','SKhkg','1378960YXWmPg','utf-8','log','\x20→\x20cloud\x20(env:\x20','eKiJL','dryRun','baseUrl','\x20migrated','parse','\x20failed:\x20','hEHii','cwd','settings','Zvriw','projects','FONkG','XpfVu','220GmgQFA','kgdqT','\x20skipped','29100GpZNfD','Proceed?','profileName','authJsonPath','2259bxUyIl','5dulRFl','VOMsx','trackPhaseEnd','XOTmd','message','ktVkv','205482dQtVVL','some','no\x20baseUrl\x20in\x20settings.json','preserveBaseUrl',',\x20matches\x20','skip','yes','Could\x20not\x20fetch\x20auth\x20config\x20(','Enzbf','wnLIL','keys','894873iBYuRy','rBDXl','length','\x20\x20echo\x20\x27.ranger/\x27\x20>>\x20.gitignore','\x20local\x20director','oDQSK','environments','trackPhaseStart','gAMYi','stdin',':\x20failed\x20to\x20write\x20projects.json\x20override\x20(',',\x20baseUrl\x20override\x20→\x20projects.json)','Warning:\x20.ranger/\x20is\x20tracked\x20in\x20this\x20git\x20repo.','BVqwd','EawFk','origin','EZjuK','LTQUq','dsUpR','uTLof','eoVRX','Continuing\x20with\x20migration...','kind','Deleted\x20','env','JIZnl','870PWDvsA','stdout','3962GTAwlG','uJBgz','Plan:','\x20→\x20skip\x20(','WyAle','6MMTpqS','push',':\x20session\x20upload\x20failed\x20(','mDhhJ','gIlHi','gitTrackedRanger','EkqyS','migrate','profile.migrate.succeeded','YRzQN','Provide\x20a\x20profile\x20name\x20or\x20--all.\x0a\x20\x20Example:\x20ranger\x20profile\x20migrate\x20--all\x20--dry-run','envKey','Nothing\x20migrated.\x20Run\x20without\x20--dry-run\x20to\x20apply.','padEnd','201mcuPwv','788308eQerDi'];_0x25f7=function(){return _0x2e5d11;};return _0x25f7();}import{existsSync}from'fs';import{join}from'path';import _0x220dd6 from'inquirer';import{getEnvNames}from'./env.js';import{getEnvDir,loadSettings}from'./utils/settings.js';function _0x349f(_0xcf1138,_0x3f1733){_0xcf1138=_0xcf1138-0x124;const _0x25f719=_0x25f7();let _0x349fe1=_0x25f719[_0xcf1138];return _0x349fe1;}import{getRangerDir}from'./utils/rangerRoot.js';import{ApiError,createCloudProfile,fetchAuthConfig,saveCloudProfileCredentials,uploadCloudProfileSession}from'./utils/cloudProfile.js';import{matchAuthEnvironment}from'./utils/matchAuthEnvironment.js';import{readProjectsConfig,setProfileOverride,writeProjectsConfig}from'./utils/projectsConfig.js';import{isPathGitTracked}from'./utils/gitTracked.js';function formatPlanLine(_0x1d75f0){const _0x4574ca=_0x349f,_0x265744={'EZjuK':function(_0x7914c3,_0x1c8de6){return _0x7914c3===_0x1c8de6;},'WqfRp':_0x4574ca(0x181)};if(_0x265744[_0x4574ca(0x137)](_0x1d75f0['kind'],_0x265744['WqfRp']))return'\x20\x20'+_0x1d75f0['profileName'][_0x4574ca(0x155)](0x1e)+_0x4574ca(0x146)+_0x1d75f0['reason']+')';if(_0x1d75f0['preserveBaseUrl']&&_0x1d75f0[_0x4574ca(0x163)])return'\x20\x20'+_0x1d75f0['profileName'][_0x4574ca(0x155)](0x1e)+_0x4574ca(0x160)+_0x1d75f0[_0x4574ca(0x153)]+',\x20preserving\x20baseUrl\x20'+_0x1d75f0['baseUrl']+'\x20as\x20project\x20override)';if(_0x1d75f0['baseUrl'])return'\x20\x20'+_0x1d75f0[_0x4574ca(0x173)][_0x4574ca(0x155)](0x1e)+_0x4574ca(0x160)+_0x1d75f0['envKey']+_0x4574ca(0x180)+_0x1d75f0['baseUrl']+')';return'\x20\x20'+_0x1d75f0['profileName'][_0x4574ca(0x155)](0x1e)+'\x20→\x20cloud\x20(env:\x20'+_0x1d75f0['envKey']+')';}function shouldWarnGitTrackedOnce(_0x3f88ce){const _0x20474f=_0x349f,_0x1f5553=readProjectsConfig(),_0x59b470=_0x1f5553[_0x20474f(0x16b)][_0x3f88ce]??={},_0x1aed03=_0x59b470['_warnings']??={},_0x41ce57=_0x1aed03['gitTrackedRanger'],_0x85002d=new Date(),_0x1a7e44=_0x85002d['toISOString']()['slice'](0x0,0xa);if(_0x41ce57===_0x1a7e44)return![];return _0x1aed03[_0x20474f(0x14d)]=_0x1a7e44,writeProjectsConfig(_0x1f5553),!![];}export async function migrateProfile(_0xcb3938,_0x1fbc3e){const _0x2dfb70=_0x349f,_0x582e1c={'RXkhI':function(_0x505ee1){return _0x505ee1();},'SKhkg':function(_0x38cbaa,_0x1701d2){return _0x38cbaa instanceof _0x1701d2;},'XOTmd':function(_0x577721,_0x34160a){return _0x577721(_0x34160a);},'aVWWt':function(_0x12049f,_0x184a15){return _0x12049f===_0x184a15;},'BVqwd':'No\x20cloud\x20profile\x20auth\x20config\x20found\x20for\x20this\x20org.\x20Migration\x20requires\x20at\x20least\x20one\x20configured\x20auth\x20environment.','hdPCu':function(_0x4ba20a){return _0x4ba20a();},'Zvriw':function(_0x29a97e,_0x1ba124){return _0x29a97e===_0x1ba124;},'lmPVv':'No\x20local\x20profiles\x20found\x20to\x20migrate.','gAMYi':'local\x20profile\x20directory\x20not\x20found','WyAle':function(_0x278220,_0x9dddeb){return _0x278220(_0x9dddeb);},'hEHii':'skip','gIlHi':_0x2dfb70(0x17e),'MzWPB':function(_0x3a78cc,_0x332a6e,_0x15f610){return _0x3a78cc(_0x332a6e,_0x15f610);},'VOMsx':'no\x20matching\x20auth\x20env','zttGv':function(_0x753cbb,_0x3cf12c){return _0x753cbb===_0x3cf12c;},'kgdqT':'migrate','wnLIL':function(_0x38bec3,_0x36f683){return _0x38bec3(_0x36f683);},'EkqyS':_0x2dfb70(0x154),'uTLof':function(_0x22c5ea,_0x35ef18){return _0x22c5ea&&_0x35ef18;},'ktVkv':'confirm','XpfVu':function(_0x349c49){return _0x349c49();},'YRzQN':_0x2dfb70(0x133),'JIZnl':'\x20\x20git\x20rm\x20-r\x20--cached\x20.ranger/','LTQUq':_0x2dfb70(0x12a),'GHsmC':'profile.migrate.skipped','ylUrO':'profile.migrate.started','EawFk':function(_0x46024d,_0x25855a,_0x3430d1,_0x3183f7){return _0x46024d(_0x25855a,_0x3430d1,_0x3183f7);},'Enzbf':_0x2dfb70(0x15e),'uJBgz':function(_0x6de522,_0x63efd2){return _0x6de522&&_0x63efd2;},'eoVRX':_0x2dfb70(0x163),'oDQSK':function(_0xf6dbcf,_0x15d999){return _0xf6dbcf(_0x15d999);},'eKiJL':function(_0x594000,_0x521ae0){return _0x594000(_0x521ae0);},'bEbFR':function(_0x28e8d6,_0x559fee){return _0x28e8d6>_0x559fee;},'sBlfh':function(_0x2df934,_0x573994){return _0x2df934===_0x573994;},'mDhhJ':function(_0xc69a6d,_0x33e997){return _0xc69a6d===_0x33e997;},'dsUpR':'ies','FONkG':function(_0x4fddd1,_0x40b9db){return _0x4fddd1>_0x40b9db;},'rBDXl':function(_0x46b6cd,_0xac24b9){return _0x46b6cd+_0xac24b9;}};if(!_0xcb3938['profileName']&&!_0xcb3938['all'])throw new Error(_0x2dfb70(0x152));let _0x37dad2;try{_0x37dad2=await _0x582e1c['RXkhI'](fetchAuthConfig);}catch(_0x3c1419){throw new Error(_0x2dfb70(0x183)+(_0x582e1c['SKhkg'](_0x3c1419,Error)?_0x3c1419['message']:_0x582e1c[_0x2dfb70(0x179)](String,_0x3c1419))+').\x20Run:\x20ranger\x20setup');}if(!_0x37dad2||!_0x37dad2[_0x2dfb70(0x12d)]||_0x582e1c['aVWWt'](Object[_0x2dfb70(0x126)](_0x37dad2[_0x2dfb70(0x12d)])['length'],0x0))throw new Error(_0x582e1c[_0x2dfb70(0x134)]);const _0x36cf97=[];if(_0xcb3938['all']){const {envNames:_0x28879e,envTypes:_0xf0a0ef}=await _0x582e1c['hdPCu'](getEnvNames);for(const _0x158902 of _0x28879e){if(_0xf0a0ef[_0x158902]==='ci')continue;_0x36cf97[_0x2dfb70(0x149)](_0x158902);}}else _0xcb3938['profileName']&&_0x36cf97[_0x2dfb70(0x149)](_0xcb3938[_0x2dfb70(0x173)]);if(_0x582e1c[_0x2dfb70(0x16a)](_0x36cf97['length'],0x0)){console['log'](_0x582e1c['lmPVv']);return;}const _0x5bcbb2=[];for(const _0x6e3d31 of _0x36cf97){const _0x4e958f=getEnvDir(_0x6e3d31);if(!existsSync(_0x4e958f)){_0x5bcbb2['push']({'kind':'skip','profileName':_0x6e3d31,'reason':_0x582e1c[_0x2dfb70(0x12f)]});continue;}const _0x58da60=await _0x582e1c[_0x2dfb70(0x147)](loadSettings,_0x6e3d31),_0x3b6dda=_0x58da60[_0x2dfb70(0x163)];if(!_0x3b6dda){_0x5bcbb2['push']({'kind':_0x582e1c['hEHii'],'profileName':_0x6e3d31,'reason':_0x582e1c[_0x2dfb70(0x14c)]});continue;}const _0x302a1f=_0x582e1c['MzWPB'](matchAuthEnvironment,_0x3b6dda,_0x37dad2);if(!_0x302a1f){_0x5bcbb2[_0x2dfb70(0x149)]({'kind':_0x582e1c[_0x2dfb70(0x167)],'profileName':_0x6e3d31,'reason':_0x582e1c[_0x2dfb70(0x177)]});continue;}const _0x1778fe=_0x37dad2[_0x2dfb70(0x12d)][_0x302a1f],_0x329a08=_0x1778fe?.['domains']??[],_0x4d6b0e=_0x329a08[_0x2dfb70(0x17d)](_0x351af7=>{const _0x217084=_0x2dfb70;try{return new URL(_0x351af7)['origin']===new URL(_0x3b6dda)[_0x217084(0x136)];}catch{return![];}}),_0x2c08db={};for(const [_0x30af4f,_0x518060]of Object['entries'](_0x58da60)){if(_0x30af4f==='baseUrl')continue;if(_0x582e1c['zttGv'](_0x518060,undefined))continue;_0x2c08db[_0x30af4f]=_0x518060;}!_0x4d6b0e&&(_0x2c08db['baseUrl']=_0x3b6dda);const _0x2b28dd=join(_0x4e958f,'auth.json'),_0x16d794=existsSync(_0x2b28dd);_0x5bcbb2[_0x2dfb70(0x149)]({'kind':_0x582e1c[_0x2dfb70(0x16f)],'profileName':_0x6e3d31,'envKey':_0x302a1f,'baseUrl':_0x3b6dda,'preserveBaseUrl':!_0x4d6b0e,'settings':_0x2c08db,'authJsonPath':_0x16d794?_0x2b28dd:null});}console['log'](_0x2dfb70(0x145));for(const _0x13bebe of _0x5bcbb2){console['log'](_0x582e1c[_0x2dfb70(0x125)](formatPlanLine,_0x13bebe));}if(_0xcb3938[_0x2dfb70(0x162)]){console['log'](_0x582e1c[_0x2dfb70(0x14e)]);return;}const _0x10433d=_0x582e1c[_0x2dfb70(0x125)](Boolean,process[_0x2dfb70(0x130)]['isTTY']&&process[_0x2dfb70(0x142)]['isTTY']),_0x5ac4f5=_0x5bcbb2[_0x2dfb70(0x17d)](_0x29f5b8=>_0x29f5b8['kind']===_0x2dfb70(0x14f));if(_0x582e1c[_0x2dfb70(0x13a)](_0x5ac4f5,_0x10433d)&&!_0xcb3938[_0x2dfb70(0x182)]){const {proceed:_0x30687b}=await _0x220dd6['prompt']([{'type':_0x582e1c[_0x2dfb70(0x17b)],'name':'proceed','message':_0x2dfb70(0x172),'default':![]}]);if(!_0x30687b){console['log']('Aborted.');return;}}const _0x28f550=_0x582e1c[_0x2dfb70(0x16d)](getRangerDir);let _0x2f1660=![];if(existsSync(_0x28f550))try{_0x2f1660=await _0x582e1c[_0x2dfb70(0x125)](isPathGitTracked,_0x28f550);}catch{_0x2f1660=![];}_0x2f1660&&_0x582e1c['XOTmd'](shouldWarnGitTrackedOnce,process['cwd']())&&(console['log'](_0x582e1c[_0x2dfb70(0x151)]),console['log']('After\x20migration,\x20uncommit\x20it:'),console[_0x2dfb70(0x15f)](_0x582e1c[_0x2dfb70(0x140)]),console[_0x2dfb70(0x15f)](_0x582e1c[_0x2dfb70(0x138)]),console['log'](_0x2dfb70(0x13c)));let _0x4d02cc=0x0,_0x3415ae=0x0,_0x354588=0x0,_0x4823b3=0x0;for(const _0x17ced4 of _0x5bcbb2){if(_0x17ced4[_0x2dfb70(0x13d)]===_0x2dfb70(0x181)){_0x4823b3++,_0x1fbc3e?.[_0x2dfb70(0x178)](_0x582e1c['GHsmC'],{'profileName':_0x17ced4['profileName'],'reason':_0x17ced4['reason']});continue;}_0x1fbc3e?.[_0x2dfb70(0x12e)](_0x582e1c['ylUrO'],{'profileName':_0x17ced4['profileName'],'envKey':_0x17ced4['envKey']});try{try{await _0x582e1c[_0x2dfb70(0x135)](createCloudProfile,_0x17ced4['profileName'],_0x17ced4[_0x2dfb70(0x153)],{'settings':_0x17ced4[_0x2dfb70(0x169)]});}catch(_0x47ad6f){if(_0x582e1c['SKhkg'](_0x47ad6f,ApiError)&&_0x47ad6f['status']===0x199){console[_0x2dfb70(0x15f)]('\x20\x20⚠\x20'+_0x17ced4['profileName']+':\x20cloud\x20profile\x20with\x20this\x20name\x20already\x20exists.\x20Skipping.'),_0x4823b3++,_0x1fbc3e?.['trackPhaseEnd'](_0x582e1c['GHsmC'],{'profileName':_0x17ced4['profileName'],'reason':'name_conflict'});continue;}throw _0x47ad6f;}let _0xe5fc6a=![],_0x272e6c=![];if(_0x17ced4[_0x2dfb70(0x174)])try{const _0xbaacfd=await _0x582e1c['MzWPB'](readFile,_0x17ced4[_0x2dfb70(0x174)],_0x582e1c[_0x2dfb70(0x124)]),_0x4f4cba=JSON[_0x2dfb70(0x165)](_0xbaacfd);await uploadCloudProfileSession(_0x17ced4['profileName'],_0x4f4cba),_0xe5fc6a=!![];}catch(_0x41d8d8){_0x272e6c=!![],console[_0x2dfb70(0x15f)]('\x20\x20⚠\x20'+_0x17ced4['profileName']+_0x2dfb70(0x14a)+(_0x41d8d8 instanceof Error?_0x41d8d8[_0x2dfb70(0x17a)]:_0x582e1c['XOTmd'](String,_0x41d8d8))+_0x2dfb70(0x15b));}let _0x18243d=![];if(_0xcb3938['saveCreds']){const _0x539a3d=process[_0x2dfb70(0x13f)]['RANGER_TEST_USERNAME'],_0x49c7b6=process['env']['RANGER_TEST_PASSWORD'];if(_0x582e1c[_0x2dfb70(0x144)](_0x539a3d,_0x49c7b6))try{await saveCloudProfileCredentials(_0x17ced4['profileName'],_0x539a3d,_0x49c7b6),_0x18243d=!![];}catch(_0x2a6e3e){console['log']('\x20\x20⚠\x20'+_0x17ced4['profileName']+':\x20failed\x20to\x20save\x20credentials\x20('+(_0x2a6e3e instanceof Error?_0x2a6e3e['message']:String(_0x2a6e3e))+').');}else console['log'](_0x2dfb70(0x158)+_0x17ced4[_0x2dfb70(0x173)]+':\x20--save-creds\x20requested,\x20but\x20RANGER_TEST_USERNAME/PASSWORD\x20not\x20set\x20in\x20env.');}if(_0x17ced4[_0x2dfb70(0x17f)]&&_0x17ced4['baseUrl'])try{setProfileOverride(process[_0x2dfb70(0x168)](),_0x17ced4['profileName'],_0x582e1c[_0x2dfb70(0x13b)],_0x17ced4[_0x2dfb70(0x163)]);}catch(_0x13bd2c){console[_0x2dfb70(0x15f)](_0x2dfb70(0x158)+_0x17ced4['profileName']+_0x2dfb70(0x131)+(_0x13bd2c instanceof Error?_0x13bd2c['message']:String(_0x13bd2c))+').');}const _0x2ee722=getEnvDir(_0x17ced4[_0x2dfb70(0x173)]);if(!_0x272e6c&&existsSync(_0x2ee722))try{await rm(_0x2ee722,{'recursive':!![],'force':!![]}),_0x3415ae++;}catch(_0x76164e){console[_0x2dfb70(0x15f)]('\x20\x20⚠\x20'+_0x17ced4['profileName']+':\x20failed\x20to\x20delete\x20local\x20dir\x20'+_0x2ee722+'\x20('+(_0x76164e instanceof Error?_0x76164e['message']:String(_0x76164e))+').');}_0x4d02cc++,_0x17ced4[_0x2dfb70(0x17f)]&&_0x17ced4['baseUrl']?console['log']('\x20\x20✓\x20'+_0x17ced4['profileName']+'\x20migrated\x20to\x20cloud\x20(env:\x20'+_0x17ced4[_0x2dfb70(0x153)]+_0x2dfb70(0x132)):console[_0x2dfb70(0x15f)](_0x2dfb70(0x15a)+_0x17ced4['profileName']+'\x20migrated\x20to\x20cloud\x20(env:\x20'+_0x17ced4['envKey']+')'),_0x1fbc3e?.['trackPhaseEnd'](_0x2dfb70(0x150),{'profileName':_0x17ced4[_0x2dfb70(0x173)],'envKey':_0x17ced4[_0x2dfb70(0x153)],'wasGitTracked':_0x2f1660,'hadSession':_0xe5fc6a,'savedCreds':_0x18243d});}catch(_0x1dc2fa){_0x354588++,console[_0x2dfb70(0x15f)](_0x2dfb70(0x159)+_0x17ced4[_0x2dfb70(0x173)]+_0x2dfb70(0x166)+(_0x582e1c[_0x2dfb70(0x15c)](_0x1dc2fa,Error)?_0x1dc2fa['message']:_0x582e1c[_0x2dfb70(0x12c)](String,_0x1dc2fa))),_0x1fbc3e?.['trackPhaseEnd']('profile.migrate.failed',{'profileName':_0x17ced4['profileName'],'error':_0x1dc2fa instanceof Error?_0x1dc2fa[_0x2dfb70(0x17a)]:_0x582e1c[_0x2dfb70(0x161)](String,_0x1dc2fa)});}}const _0x485352=[];if(_0x582e1c['bEbFR'](_0x4d02cc,0x0))_0x485352[_0x2dfb70(0x149)](_0x4d02cc+'\x20profile'+(_0x582e1c['sBlfh'](_0x4d02cc,0x1)?'':'s')+_0x2dfb70(0x164));if(_0x3415ae>0x0)_0x485352[_0x2dfb70(0x149)](_0x2dfb70(0x13e)+_0x3415ae+_0x2dfb70(0x12b)+(_0x582e1c[_0x2dfb70(0x14b)](_0x3415ae,0x1)?'y':_0x582e1c[_0x2dfb70(0x139)]));if(_0x582e1c[_0x2dfb70(0x16c)](_0x4823b3,0x0))_0x485352['push'](_0x4823b3+_0x2dfb70(0x170));if(_0x582e1c[_0x2dfb70(0x16c)](_0x354588,0x0))_0x485352[_0x2dfb70(0x149)](_0x354588+'\x20failed');if(_0x485352[_0x2dfb70(0x129)]>0x0)console['log'](_0x582e1c[_0x2dfb70(0x128)](_0x485352['join']('.\x20'),'.'));}
1
+ (function(_0x1eb8ce,_0x54d33a){const _0x1a655c=_0x5484,_0x1186f9=_0x1eb8ce();while(!![]){try{const _0x43f0c7=parseInt(_0x1a655c(0x13d))/0x1*(-parseInt(_0x1a655c(0x172))/0x2)+parseInt(_0x1a655c(0x184))/0x3*(-parseInt(_0x1a655c(0x137))/0x4)+parseInt(_0x1a655c(0x17f))/0x5*(-parseInt(_0x1a655c(0x147))/0x6)+-parseInt(_0x1a655c(0x145))/0x7*(-parseInt(_0x1a655c(0x181))/0x8)+-parseInt(_0x1a655c(0x154))/0x9*(-parseInt(_0x1a655c(0x150))/0xa)+-parseInt(_0x1a655c(0x182))/0xb*(-parseInt(_0x1a655c(0x165))/0xc)+-parseInt(_0x1a655c(0x164))/0xd*(-parseInt(_0x1a655c(0x149))/0xe);if(_0x43f0c7===_0x54d33a)break;else _0x1186f9['push'](_0x1186f9['shift']());}catch(_0x9b33c5){_0x1186f9['push'](_0x1186f9['shift']());}}}(_0x55e8,0x40360));import{readFile,rm}from'fs/promises';import{existsSync}from'fs';function _0x55e8(){const _0x50bda5=['750WhKfBW','XIGHv','14vUUlFv','ePjOb','eXFFX','profileName','kind','origin','XUjFR','2626420lVpXpa',':\x20failed\x20to\x20delete\x20local\x20dir\x20','prompt','IRwOp','18MWJIgb','bdoHJ','join','jiCVk','BKrNz','\x20profile','stdin','log','PYCuf','zxqhY','skip',',\x20preserving\x20baseUrl\x20','environments','FZUyD','domains','MjItr','8432125AZYnOF','261396xQmahW','\x20failed','\x20\x20⚠\x20','settings','No\x20local\x20profiles\x20found\x20to\x20migrate.',',\x20baseUrl\x20override\x20→\x20projects.json)','cwd','Qnwgu','\x20migrated\x20to\x20cloud\x20(env:\x20','envKey','no\x20baseUrl\x20in\x20settings.json','vyJrF','all','2338zYxRzW','sYudY','OHhQk','Could\x20not\x20fetch\x20auth\x20config\x20(','trackPhaseEnd','nwBOe','UMVLB',':\x20failed\x20to\x20save\x20credentials\x20(','\x20failed:\x20','\x20local\x20director','gitTrackedRanger',').\x20Cloud\x20profile\x20created;\x20local\x20auth.json\x20left\x20in\x20place.','FGEZm','6865yCRBKI','push','9280ukxaAY','44UeBlgC','profile.migrate.skipped','3XpUswZ','length','toISOString','\x20skipped','some','Continuing\x20with\x20migration...','ies','status','wBNAr','Aborted.','Proceed?','padEnd','1575116cOXdYR','parse','authJsonPath','trackPhaseStart','OBfHp','dryRun','381tSRjrq','Warning:\x20.ranger/\x20is\x20tracked\x20in\x20this\x20git\x20repo.','yes','message',':\x20failed\x20to\x20write\x20projects.json\x20override\x20(','preserveBaseUrl','baseUrl',').\x20Run:\x20ranger\x20setup','77sLuQyn','\x20\x20git\x20rm\x20-r\x20--cached\x20.ranger/'];_0x55e8=function(){return _0x50bda5;};return _0x55e8();}import{join}from'path';import _0x21ff36 from'inquirer';import{getEnvNames}from'./env.js';import{getEnvDir,loadSettings}from'./utils/settings.js';import{getRangerDir}from'./utils/rangerRoot.js';import{ApiError,createCloudProfile,fetchAuthConfig,saveCloudProfileCredentials,uploadCloudProfileSession}from'./utils/cloudProfile.js';import{matchAuthEnvironment}from'./utils/matchAuthEnvironment.js';import{readProjectsConfig,setProfileOverride,writeProjectsConfig}from'./utils/projectsConfig.js';function _0x5484(_0x12bd2b,_0xdaf48e){_0x12bd2b=_0x12bd2b-0x134;const _0x55e8ba=_0x55e8();let _0x5484b7=_0x55e8ba[_0x12bd2b];return _0x5484b7;}import{isPathGitTracked}from'./utils/gitTracked.js';function formatPlanLine(_0x34ae33){const _0x442364=_0x5484,_0x32dc59={'YtLVV':'skip'};if(_0x34ae33[_0x442364(0x14d)]===_0x32dc59['YtLVV'])return'\x20\x20'+_0x34ae33['profileName'][_0x442364(0x136)](0x1e)+'\x20→\x20skip\x20('+_0x34ae33['reason']+')';if(_0x34ae33[_0x442364(0x142)]&&_0x34ae33['baseUrl'])return'\x20\x20'+_0x34ae33[_0x442364(0x14c)]['padEnd'](0x1e)+'\x20→\x20cloud\x20(env:\x20'+_0x34ae33[_0x442364(0x16e)]+_0x442364(0x15f)+_0x34ae33[_0x442364(0x143)]+'\x20as\x20project\x20override)';if(_0x34ae33['baseUrl'])return'\x20\x20'+_0x34ae33['profileName']['padEnd'](0x1e)+'\x20→\x20cloud\x20(env:\x20'+_0x34ae33[_0x442364(0x16e)]+',\x20matches\x20'+_0x34ae33['baseUrl']+')';return'\x20\x20'+_0x34ae33[_0x442364(0x14c)][_0x442364(0x136)](0x1e)+'\x20→\x20cloud\x20(env:\x20'+_0x34ae33['envKey']+')';}function shouldWarnGitTrackedOnce(_0xd9def1){const _0x5e9f32=_0x5484,_0x2c310e={'ePjOb':function(_0xa8555d,_0x45b692){return _0xa8555d===_0x45b692;}},_0x53885a=readProjectsConfig(),_0x40ba57=_0x53885a['projects'][_0xd9def1]??={},_0x49ba1f=_0x40ba57['_warnings']??={},_0x30d9bb=_0x49ba1f[_0x5e9f32(0x17c)],_0x2a820c=new Date(),_0x4e9212=_0x2a820c[_0x5e9f32(0x186)]()['slice'](0x0,0xa);if(_0x2c310e[_0x5e9f32(0x14a)](_0x30d9bb,_0x4e9212))return![];return _0x49ba1f['gitTrackedRanger']=_0x4e9212,writeProjectsConfig(_0x53885a),!![];}export async function migrateProfile(_0x31c1c9,_0x374d59){const _0x56342e=_0x5484,_0x489d06={'vyJrF':function(_0x1cd492,_0x2a1635){return _0x1cd492 instanceof _0x2a1635;},'sYudY':function(_0x51037a,_0x42c025){return _0x51037a(_0x42c025);},'zxqhY':'No\x20cloud\x20profile\x20auth\x20config\x20found\x20for\x20this\x20org.\x20Migration\x20requires\x20at\x20least\x20one\x20configured\x20auth\x20environment.','OHhQk':function(_0xd7b83f){return _0xd7b83f();},'UMVLB':function(_0xcfb09a,_0x673a75){return _0xcfb09a===_0x673a75;},'nwBOe':function(_0x817653,_0x5b981f){return _0x817653===_0x5b981f;},'XIGHv':_0x56342e(0x15e),'gNZtZ':_0x56342e(0x16f),'PYCuf':function(_0x2d60c1,_0x4968d9,_0x2c7eb7){return _0x2d60c1(_0x4968d9,_0x2c7eb7);},'apqVv':'no\x20matching\x20auth\x20env','Qnwgu':function(_0x164023,_0x41183f){return _0x164023===_0x41183f;},'ZVWGS':'Nothing\x20migrated.\x20Run\x20without\x20--dry-run\x20to\x20apply.','bdoHJ':function(_0x24669d,_0x189f28){return _0x24669d&&_0x189f28;},'FZUyD':'confirm','BKrNz':'proceed','VEahh':function(_0x3d2834){return _0x3d2834();},'FGEZm':function(_0x4c4961,_0x49f699){return _0x4c4961(_0x49f699);},'cpMAZ':function(_0x268246,_0x40e8e8){return _0x268246(_0x40e8e8);},'wBNAr':'After\x20migration,\x20uncommit\x20it:','XUjFR':_0x56342e(0x146),'gRHYC':'\x20\x20echo\x20\x27.ranger/\x27\x20>>\x20.gitignore','JGxzG':_0x56342e(0x189),'ASPLp':function(_0x37fc61,_0x1c6b03,_0x23e8de,_0x1f51d0){return _0x37fc61(_0x1c6b03,_0x23e8de,_0x1f51d0);},'MjItr':'name_conflict','ZMeTo':'utf-8','OBfHp':function(_0x32ed09,_0x3515ed,_0x430aa5){return _0x32ed09(_0x3515ed,_0x430aa5);},'ZVBVE':function(_0x3e95ed,_0x56efd5){return _0x3e95ed instanceof _0x56efd5;},'IRwOp':function(_0x262dc0,_0x1791b1,_0x22baa6,_0x18adb1,_0x51c670){return _0x262dc0(_0x1791b1,_0x22baa6,_0x18adb1,_0x51c670);},'glZhz':'baseUrl','cyLVE':function(_0x10221e,_0x2cb7a0){return _0x10221e(_0x2cb7a0);},'NcypQ':function(_0x1f99aa,_0x3c78a9){return _0x1f99aa(_0x3c78a9);},'NNzDd':function(_0x49a931,_0x35f2a7){return _0x49a931 instanceof _0x35f2a7;},'QKhAp':'profile.migrate.failed','Ebrbl':function(_0x5005f2,_0x15d1a5){return _0x5005f2===_0x15d1a5;},'eXFFX':function(_0x297045,_0x24d96a){return _0x297045>_0x24d96a;},'jiCVk':function(_0x2c1ea3,_0x253cdf){return _0x2c1ea3+_0x253cdf;}};if(!_0x31c1c9[_0x56342e(0x14c)]&&!_0x31c1c9[_0x56342e(0x171)])throw new Error('Provide\x20a\x20profile\x20name\x20or\x20--all.\x0a\x20\x20Example:\x20ranger\x20profile\x20migrate\x20--all\x20--dry-run');let _0x370618;try{_0x370618=await fetchAuthConfig();}catch(_0x423d30){throw new Error(_0x56342e(0x175)+(_0x489d06['vyJrF'](_0x423d30,Error)?_0x423d30[_0x56342e(0x140)]:_0x489d06[_0x56342e(0x173)](String,_0x423d30))+_0x56342e(0x144));}if(!_0x370618||!_0x370618[_0x56342e(0x160)]||Object['keys'](_0x370618[_0x56342e(0x160)])[_0x56342e(0x185)]===0x0)throw new Error(_0x489d06[_0x56342e(0x15d)]);const _0x71ca2a=[];if(_0x31c1c9['all']){const {envNames:_0xaf46fc,envTypes:_0x4c2628}=await _0x489d06[_0x56342e(0x174)](getEnvNames);for(const _0x59bd73 of _0xaf46fc){if(_0x489d06[_0x56342e(0x178)](_0x4c2628[_0x59bd73],'ci'))continue;_0x71ca2a['push'](_0x59bd73);}}else _0x31c1c9[_0x56342e(0x14c)]&&_0x71ca2a['push'](_0x31c1c9['profileName']);if(_0x489d06['nwBOe'](_0x71ca2a[_0x56342e(0x185)],0x0)){console[_0x56342e(0x15b)](_0x56342e(0x169));return;}const _0x2845f9=[];for(const _0x17b89b of _0x71ca2a){const _0x31f002=_0x489d06[_0x56342e(0x173)](getEnvDir,_0x17b89b);if(!existsSync(_0x31f002)){_0x2845f9[_0x56342e(0x180)]({'kind':_0x489d06['XIGHv'],'profileName':_0x17b89b,'reason':'local\x20profile\x20directory\x20not\x20found'});continue;}const _0x46bb85=await _0x489d06['sYudY'](loadSettings,_0x17b89b),_0x3f538c=_0x46bb85[_0x56342e(0x143)];if(!_0x3f538c){_0x2845f9[_0x56342e(0x180)]({'kind':_0x489d06['XIGHv'],'profileName':_0x17b89b,'reason':_0x489d06['gNZtZ']});continue;}const _0x550254=_0x489d06[_0x56342e(0x15c)](matchAuthEnvironment,_0x3f538c,_0x370618);if(!_0x550254){_0x2845f9[_0x56342e(0x180)]({'kind':_0x489d06[_0x56342e(0x148)],'profileName':_0x17b89b,'reason':_0x489d06['apqVv']});continue;}const _0x4f5c5c=_0x370618['environments'][_0x550254],_0x495b80=_0x4f5c5c?.[_0x56342e(0x162)]??[],_0x3b9f4c=_0x495b80[_0x56342e(0x188)](_0x1f78e3=>{const _0x37dad5=_0x56342e;try{return new URL(_0x1f78e3)[_0x37dad5(0x14e)]===new URL(_0x3f538c)['origin'];}catch{return![];}}),_0x19386b={};for(const [_0x3fd7b3,_0x43261a]of Object['entries'](_0x46bb85)){if(_0x489d06['Qnwgu'](_0x3fd7b3,'baseUrl'))continue;if(_0x489d06['nwBOe'](_0x43261a,undefined))continue;_0x19386b[_0x3fd7b3]=_0x43261a;}!_0x3b9f4c&&(_0x19386b['baseUrl']=_0x3f538c);const _0xcdabc8=_0x489d06['PYCuf'](join,_0x31f002,'auth.json'),_0x10599e=_0x489d06['sYudY'](existsSync,_0xcdabc8);_0x2845f9['push']({'kind':'migrate','profileName':_0x17b89b,'envKey':_0x550254,'baseUrl':_0x3f538c,'preserveBaseUrl':!_0x3b9f4c,'settings':_0x19386b,'authJsonPath':_0x10599e?_0xcdabc8:null});}console[_0x56342e(0x15b)]('Plan:');for(const _0x3f767e of _0x2845f9){console[_0x56342e(0x15b)](formatPlanLine(_0x3f767e));}if(_0x31c1c9[_0x56342e(0x13c)]){console[_0x56342e(0x15b)](_0x489d06['ZVWGS']);return;}const _0x93b40a=Boolean(process[_0x56342e(0x15a)]['isTTY']&&process['stdout']['isTTY']),_0xd1aae=_0x2845f9[_0x56342e(0x188)](_0x1af40c=>_0x1af40c[_0x56342e(0x14d)]==='migrate');if(_0x489d06[_0x56342e(0x155)](_0xd1aae,_0x93b40a)&&!_0x31c1c9[_0x56342e(0x13f)]){const {proceed:_0x14774f}=await _0x21ff36[_0x56342e(0x152)]([{'type':_0x489d06[_0x56342e(0x161)],'name':_0x489d06[_0x56342e(0x158)],'message':_0x56342e(0x135),'default':![]}]);if(!_0x14774f){console['log'](_0x56342e(0x134));return;}}const _0x258724=_0x489d06['VEahh'](getRangerDir);let _0x33534f=![];if(_0x489d06['FGEZm'](existsSync,_0x258724))try{_0x33534f=await isPathGitTracked(_0x258724);}catch{_0x33534f=![];}_0x33534f&&_0x489d06['cpMAZ'](shouldWarnGitTrackedOnce,process['cwd']())&&(console['log'](_0x56342e(0x13e)),console['log'](_0x489d06[_0x56342e(0x18c)]),console['log'](_0x489d06[_0x56342e(0x14f)]),console[_0x56342e(0x15b)](_0x489d06['gRHYC']),console[_0x56342e(0x15b)](_0x489d06['JGxzG']));let _0x26a1e4=0x0,_0x4eaf18=0x0,_0x25337a=0x0,_0x43615b=0x0;for(const _0x357724 of _0x2845f9){if(_0x357724['kind']===_0x56342e(0x15e)){_0x43615b++,_0x374d59?.['trackPhaseEnd'](_0x56342e(0x183),{'profileName':_0x357724[_0x56342e(0x14c)],'reason':_0x357724['reason']});continue;}_0x374d59?.[_0x56342e(0x13a)]('profile.migrate.started',{'profileName':_0x357724['profileName'],'envKey':_0x357724[_0x56342e(0x16e)]});try{try{await _0x489d06['ASPLp'](createCloudProfile,_0x357724['profileName'],_0x357724[_0x56342e(0x16e)],{'settings':_0x357724[_0x56342e(0x168)]});}catch(_0x26cdf8){if(_0x489d06[_0x56342e(0x170)](_0x26cdf8,ApiError)&&_0x489d06[_0x56342e(0x177)](_0x26cdf8[_0x56342e(0x18b)],0x199)){console['log'](_0x56342e(0x167)+_0x357724[_0x56342e(0x14c)]+':\x20cloud\x20profile\x20with\x20this\x20name\x20already\x20exists.\x20Skipping.'),_0x43615b++,_0x374d59?.[_0x56342e(0x176)]('profile.migrate.skipped',{'profileName':_0x357724[_0x56342e(0x14c)],'reason':_0x489d06[_0x56342e(0x163)]});continue;}throw _0x26cdf8;}let _0xf6c1bd=![],_0x39d9d5=![];if(_0x357724['authJsonPath'])try{const _0x24c64a=await readFile(_0x357724[_0x56342e(0x139)],_0x489d06['ZMeTo']),_0x17e7be=JSON[_0x56342e(0x138)](_0x24c64a);await _0x489d06[_0x56342e(0x13b)](uploadCloudProfileSession,_0x357724[_0x56342e(0x14c)],_0x17e7be),_0xf6c1bd=!![];}catch(_0x23e747){_0x39d9d5=!![],console[_0x56342e(0x15b)](_0x56342e(0x167)+_0x357724['profileName']+':\x20session\x20upload\x20failed\x20('+(_0x489d06['ZVBVE'](_0x23e747,Error)?_0x23e747['message']:_0x489d06['FGEZm'](String,_0x23e747))+_0x56342e(0x17d));}let _0x44445b=![];if(_0x31c1c9['saveCreds']){const _0x5a0c31=process['env']['RANGER_TEST_USERNAME'],_0x6f4aae=process['env']['RANGER_TEST_PASSWORD'];if(_0x5a0c31&&_0x6f4aae)try{await saveCloudProfileCredentials(_0x357724['profileName'],_0x5a0c31,_0x6f4aae),_0x44445b=!![];}catch(_0x294fcd){console['log']('\x20\x20⚠\x20'+_0x357724[_0x56342e(0x14c)]+_0x56342e(0x179)+(_0x294fcd instanceof Error?_0x294fcd[_0x56342e(0x140)]:String(_0x294fcd))+').');}else console[_0x56342e(0x15b)](_0x56342e(0x167)+_0x357724[_0x56342e(0x14c)]+':\x20--save-creds\x20requested,\x20but\x20RANGER_TEST_USERNAME/PASSWORD\x20not\x20set\x20in\x20env.');}if(_0x357724[_0x56342e(0x142)]&&_0x357724['baseUrl'])try{_0x489d06[_0x56342e(0x153)](setProfileOverride,process[_0x56342e(0x16b)](),_0x357724[_0x56342e(0x14c)],_0x489d06['glZhz'],_0x357724[_0x56342e(0x143)]);}catch(_0x20155b){console[_0x56342e(0x15b)]('\x20\x20⚠\x20'+_0x357724[_0x56342e(0x14c)]+_0x56342e(0x141)+(_0x20155b instanceof Error?_0x20155b[_0x56342e(0x140)]:String(_0x20155b))+').');}const _0x480fff=_0x489d06['cyLVE'](getEnvDir,_0x357724['profileName']);if(!_0x39d9d5&&_0x489d06['NcypQ'](existsSync,_0x480fff))try{await rm(_0x480fff,{'recursive':!![],'force':!![]}),_0x4eaf18++;}catch(_0x335668){console[_0x56342e(0x15b)](_0x56342e(0x167)+_0x357724['profileName']+_0x56342e(0x151)+_0x480fff+'\x20('+(_0x489d06['NNzDd'](_0x335668,Error)?_0x335668[_0x56342e(0x140)]:_0x489d06[_0x56342e(0x17e)](String,_0x335668))+').');}_0x26a1e4++,_0x357724[_0x56342e(0x142)]&&_0x357724[_0x56342e(0x143)]?console[_0x56342e(0x15b)]('\x20\x20✓\x20'+_0x357724['profileName']+_0x56342e(0x16d)+_0x357724[_0x56342e(0x16e)]+_0x56342e(0x16a)):console['log']('\x20\x20✓\x20'+_0x357724[_0x56342e(0x14c)]+'\x20migrated\x20to\x20cloud\x20(env:\x20'+_0x357724['envKey']+')'),_0x374d59?.['trackPhaseEnd']('profile.migrate.succeeded',{'profileName':_0x357724['profileName'],'envKey':_0x357724[_0x56342e(0x16e)],'wasGitTracked':_0x33534f,'hadSession':_0xf6c1bd,'savedCreds':_0x44445b});}catch(_0x2170c3){_0x25337a++,console['log']('\x20\x20✗\x20'+_0x357724[_0x56342e(0x14c)]+_0x56342e(0x17a)+(_0x489d06['NNzDd'](_0x2170c3,Error)?_0x2170c3['message']:String(_0x2170c3))),_0x374d59?.['trackPhaseEnd'](_0x489d06['QKhAp'],{'profileName':_0x357724['profileName'],'error':_0x2170c3 instanceof Error?_0x2170c3[_0x56342e(0x140)]:_0x489d06['sYudY'](String,_0x2170c3)});}}const _0xeb76cc=[];if(_0x26a1e4>0x0)_0xeb76cc[_0x56342e(0x180)](_0x26a1e4+_0x56342e(0x159)+(_0x489d06[_0x56342e(0x16c)](_0x26a1e4,0x1)?'':'s')+'\x20migrated');if(_0x4eaf18>0x0)_0xeb76cc[_0x56342e(0x180)]('Deleted\x20'+_0x4eaf18+_0x56342e(0x17b)+(_0x489d06['Ebrbl'](_0x4eaf18,0x1)?'y':_0x56342e(0x18a)));if(_0x489d06[_0x56342e(0x14b)](_0x43615b,0x0))_0xeb76cc['push'](_0x43615b+_0x56342e(0x187));if(_0x25337a>0x0)_0xeb76cc[_0x56342e(0x180)](_0x25337a+_0x56342e(0x166));if(_0x489d06[_0x56342e(0x14b)](_0xeb76cc[_0x56342e(0x185)],0x0))console[_0x56342e(0x15b)](_0x489d06[_0x56342e(0x157)](_0xeb76cc[_0x56342e(0x156)]('.\x20'),'.'));}
@@ -1 +1 @@
1
- (function(_0xd95e2e,_0x454ca9){const _0x467350=_0x4040,_0x49cfba=_0xd95e2e();while(!![]){try{const _0x5098ee=-parseInt(_0x467350(0x117))/0x1*(-parseInt(_0x467350(0x147))/0x2)+parseInt(_0x467350(0x116))/0x3+parseInt(_0x467350(0x146))/0x4*(parseInt(_0x467350(0x13b))/0x5)+-parseInt(_0x467350(0x13e))/0x6+parseInt(_0x467350(0x130))/0x7*(-parseInt(_0x467350(0x12b))/0x8)+-parseInt(_0x467350(0x145))/0x9+-parseInt(_0x467350(0x121))/0xa;if(_0x5098ee===_0x454ca9)break;else _0x49cfba['push'](_0x49cfba['shift']());}catch(_0x564f39){_0x49cfba['push'](_0x49cfba['shift']());}}}(_0x1c92,0xe829b));import{join}from'path';import{existsSync}from'fs';function _0x1c92(){const _0x4e2bf1=['user','9985vnaRxW','lOOZI','marketplace','1915722fpMzXS','glxzI','YQrRS','oPexQ','wVMOf','ranger','\x0aYou\x20can\x20install\x20manually\x20with:','395757MvvRQF','2084gGqgye','277898kauipW','PzrYD','Project\x20(shared\x20with\x20team\x20via\x20git)','eZGqq','ReMGa','gvTXP','❌\x20Failed\x20to\x20install\x20plugin:','rMhmJ','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','✓\x20Ranger\x20skills\x20already\x20installed','\x20level)...\x0a','4587132ArKlfW','7hbEoeF','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','ranger-testing/trailhead','ranger@trailhead','list','project','wantsSkillup','❌\x20Failed\x20to\x20add\x20marketplace:','SKILL.md','20817020gTiiaz','PrGHh','✓\x20Claude\x20Code\x20plugin\x20enabled','log','pluginScope','AtmvK','output','xjkDM','plugin','UGNKO','106344mKgQLe','success','CeUrZ','prompt','--scope','77JZbdjX','\x0a📦\x20Claude\x20Code\x20Plugin\x0a','.claude','error','LCgUY','User\x20(available\x20in\x20all\x20your\x20projects)','BaFqt','waatF','mqPDK','Would\x20you\x20like\x20to\x20install\x20skills?'];_0x1c92=function(){return _0x4e2bf1;};return _0x1c92();}import _0xcac262 from'inquirer';import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';function _0x4040(_0x84069d,_0x401085){_0x84069d=_0x84069d-0x10c;const _0x1c9281=_0x1c92();let _0x404022=_0x1c9281[_0x84069d];return _0x404022;}import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x2f82a5){const _0x31c80a=_0x4040,_0x50e629={'rMhmJ':function(_0x5632fd,_0x1ca44c){return _0x5632fd(_0x1ca44c);},'FCZhn':'ranger@trailhead','PzrYD':function(_0x508431,_0x159794,_0x3439ae){return _0x508431(_0x159794,_0x3439ae);},'COhGk':_0x31c80a(0x131),'JJNyg':'pluginScope','bcbLc':_0x31c80a(0x10d),'wVMOf':'project','YQrRS':_0x31c80a(0x13a),'BaFqt':function(_0x376061,_0x4a5cf8){return _0x376061(_0x4a5cf8);},'OiebE':_0x31c80a(0x129),'OrcxF':_0x31c80a(0x13d),'gvTXP':'add','glxzI':_0x31c80a(0x11f),'eZGqq':'\x0aYou\x20can\x20install\x20manually\x20with:','ssHMe':_0x31c80a(0x111),'mqPDK':'✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','btKSM':'enable','UGNKO':_0x31c80a(0x123)},_0x51eab6=await _0x50e629[_0x31c80a(0x112)](isPluginInstalled,_0x50e629['FCZhn']);if(_0x51eab6)return console['log'](_0x31c80a(0x118)),![];const _0x3320a5=existsSync(_0x50e629[_0x31c80a(0x10c)](join,getProjectRoot(),'.claude'));let _0x33d13d;if(_0x2f82a5)_0x33d13d=_0x2f82a5;else{if(_0x3320a5)_0x33d13d=_0x31c80a(0x11d);else{console['log'](_0x50e629['COhGk']);const _0x34af08=await _0xcac262[_0x31c80a(0x12e)]([{'type':_0x31c80a(0x11c),'name':_0x50e629['JJNyg'],'message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':_0x31c80a(0x135),'value':_0x31c80a(0x13a)},{'name':_0x50e629['bcbLc'],'value':_0x50e629[_0x31c80a(0x142)]}],'default':_0x50e629[_0x31c80a(0x140)]}]);_0x33d13d=_0x34af08[_0x31c80a(0x125)];}}console[_0x31c80a(0x124)]('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x33d13d+_0x31c80a(0x115));const _0x39d3fc=await _0x50e629[_0x31c80a(0x112)](isMarketplaceAdded,'trailhead');let _0x515d84=_0x39d3fc;if(_0x39d3fc)console[_0x31c80a(0x124)]('✓\x20Marketplace\x20already\x20added');else{const _0x2a179f=await _0x50e629[_0x31c80a(0x136)](runClaudeCommand,[_0x50e629['OiebE'],_0x50e629['OrcxF'],_0x50e629[_0x31c80a(0x110)],_0x31c80a(0x11a)]);!_0x2a179f[_0x31c80a(0x12c)]?(console[_0x31c80a(0x133)](_0x50e629[_0x31c80a(0x13f)],_0x2a179f['error']),console['log'](_0x50e629[_0x31c80a(0x10e)]),console['log'](_0x31c80a(0x113)),console['log'](_0x31c80a(0x119)+_0x33d13d)):_0x515d84=!![];}if(_0x515d84){const _0x33fa18=await _0x50e629['BaFqt'](runClaudeCommand,['plugin','install','ranger@trailhead','--scope',_0x33d13d]);if(!_0x33fa18['success'])console['error'](_0x50e629['ssHMe'],_0x33fa18[_0x31c80a(0x133)]),console[_0x31c80a(0x124)](_0x31c80a(0x144)),console[_0x31c80a(0x124)]('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x33d13d);else{console['log'](_0x50e629[_0x31c80a(0x138)]);const _0x2afdea=[_0x50e629['OiebE'],_0x50e629['btKSM'],_0x31c80a(0x11b)];_0x33d13d==='project'&&_0x2afdea['push'](_0x31c80a(0x12f),_0x50e629['wVMOf']);const _0xff0d0a=await runClaudeCommand(_0x2afdea,{'captureOutput':!![]}),_0xabaa2b=_0xff0d0a[_0x31c80a(0x127)]?.['includes']('already\x20enabled');!_0xff0d0a[_0x31c80a(0x12c)]&&!_0xabaa2b?console['error']('⚠\x20Failed\x20to\x20enable\x20plugin:',_0xff0d0a['error']):console['log'](_0x50e629[_0x31c80a(0x12a)]);}}return!![];}export async function ensureClaudeSkills(_0x38a7e6){const _0xdc43be=_0x4040,_0x5c8926={'LCgUY':'user','xjkDM':_0xdc43be(0x120),'waatF':function(_0x7e0e9,_0x33cf03){return _0x7e0e9(_0x33cf03);},'CeUrZ':function(_0x1fcbd7,_0x3308ee,_0x54c58c,_0x22cdb3){return _0x1fcbd7(_0x3308ee,_0x54c58c,_0x22cdb3);},'oPexQ':_0xdc43be(0x114),'ReMGa':function(_0x89b28f,_0x55396f,_0xff6d97){return _0x89b28f(_0x55396f,_0xff6d97);},'PrGHh':function(_0x36b640,_0x407fb4){return _0x36b640(_0x407fb4);},'izNju':'confirm','lOOZI':_0xdc43be(0x139),'AtmvK':function(_0x553d1f,_0x5577ef){return _0x553d1f(_0x5577ef);}},_0x4f09cf=existsSync(join(getSkillsDir(_0x5c8926[_0xdc43be(0x134)]),_0xdc43be(0x143),_0x5c8926[_0xdc43be(0x128)])),_0x19de23=_0x5c8926['waatF'](existsSync,_0x5c8926[_0xdc43be(0x12d)](join,_0x5c8926[_0xdc43be(0x137)](getSkillsDir,'project'),'ranger',_0xdc43be(0x120)));if(_0x4f09cf||_0x19de23)return console['log'](_0x5c8926[_0xdc43be(0x141)]),![];const _0x15792a=existsSync(_0x5c8926[_0xdc43be(0x10f)](join,getProjectRoot(),_0xdc43be(0x132)));let _0xa3b77a=!![];if(_0x38a7e6)await skillup({'autoInstall':_0x38a7e6,'suppressUsage':!![]});else{if(_0x15792a)await _0x5c8926[_0xdc43be(0x122)](skillup,{'autoInstall':_0xdc43be(0x11d),'suppressUsage':!![]});else{const _0x589f19=await _0xcac262[_0xdc43be(0x12e)]([{'type':_0x5c8926['izNju'],'name':'wantsSkillup','message':_0x5c8926[_0xdc43be(0x13c)],'default':!![]}]);_0xa3b77a=_0x589f19[_0xdc43be(0x11e)],_0xa3b77a&&await _0x5c8926[_0xdc43be(0x126)](skillup,{'suppressUsage':!![]});}}return _0xa3b77a;}
1
+ (function(_0x56b255,_0x483dfb){const _0x46fc41=_0x5771,_0x3ba5cb=_0x56b255();while(!![]){try{const _0x2fbc2c=-parseInt(_0x46fc41(0x151))/0x1+-parseInt(_0x46fc41(0x157))/0x2*(parseInt(_0x46fc41(0x15a))/0x3)+-parseInt(_0x46fc41(0x15f))/0x4*(-parseInt(_0x46fc41(0x142))/0x5)+parseInt(_0x46fc41(0x137))/0x6*(-parseInt(_0x46fc41(0x13e))/0x7)+parseInt(_0x46fc41(0x141))/0x8+parseInt(_0x46fc41(0x154))/0x9+parseInt(_0x46fc41(0x136))/0xa;if(_0x2fbc2c===_0x483dfb)break;else _0x3ba5cb['push'](_0x3ba5cb['shift']());}catch(_0x112da1){_0x3ba5cb['push'](_0x3ba5cb['shift']());}}}(_0x34eb,0x40c46));import{join}from'path';function _0x5771(_0x39ee5e,_0x441388){_0x39ee5e=_0x39ee5e-0x133;const _0x34eb84=_0x34eb();let _0x577111=_0x34eb84[_0x39ee5e];return _0x577111;}import{existsSync}from'fs';import _0x27bd48 from'inquirer';import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';function _0x34eb(){const _0x420ec2=['ranger','SKILL.md','lLBFy','ranger@trailhead','CtjEC','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','136103jgNXsk','wantsSkillup','plugin','1146366cNJTsF','error','trailhead','16090tfNOEo','pfjIn','log','60LCbZNj','prompt','✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','CJgoD','user','182656eJHEZg','add','KLfTw','confirm','✓\x20Ranger\x20skills\x20already\x20installed','\x0a📦\x20Claude\x20Code\x20Plugin\x0a','3718730dqNMBA','2226MwtMVk','Where\x20should\x20the\x20plugin\x20be\x20installed?','project','bOqzQ','ranger-testing/trailhead','✓\x20Marketplace\x20already\x20added','Would\x20you\x20like\x20to\x20install\x20skills?','4445VSJOWo','.claude','\x0aYou\x20can\x20install\x20manually\x20with:','1293080lcFkwJ','15PKwKZy','❌\x20Failed\x20to\x20add\x20marketplace:','yDQhp','Project\x20(shared\x20with\x20team\x20via\x20git)','NOTJn','pluginScope','ZvnRg','vaKuW','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'];_0x34eb=function(){return _0x420ec2;};return _0x34eb();}export async function ensureClaudePlugin(_0x211733){const _0x310feb=_0x5771,_0x5d6858={'CtjEC':function(_0x1688c7,_0x405e8f,_0x25c745){return _0x1688c7(_0x405e8f,_0x25c745);},'ryZrk':'.claude','QvGDx':_0x310feb(0x139),'LlzWO':'list','ngHAM':_0x310feb(0x13c),'oINsj':_0x310feb(0x153),'Qaxqw':_0x310feb(0x160),'bOqzQ':_0x310feb(0x140),'yDQhp':'install','AsqSf':_0x310feb(0x15c),'kukpM':'enable','CJgoD':'already\x20enabled'},_0x89d195=await isPluginInstalled(_0x310feb(0x14e));if(_0x89d195)return console['log'](_0x310feb(0x150)),![];const _0x41dd4d=existsSync(_0x5d6858[_0x310feb(0x14f)](join,getProjectRoot(),_0x5d6858['ryZrk']));let _0x447f80;if(_0x211733)_0x447f80=_0x211733;else{if(_0x41dd4d)_0x447f80=_0x5d6858['QvGDx'];else{console[_0x310feb(0x159)](_0x310feb(0x135));const _0x3f8c21=await _0x27bd48['prompt']([{'type':_0x5d6858['LlzWO'],'name':_0x310feb(0x147),'message':_0x310feb(0x138),'choices':[{'name':'User\x20(available\x20in\x20all\x20your\x20projects)','value':_0x310feb(0x15e)},{'name':_0x310feb(0x145),'value':_0x5d6858['QvGDx']}],'default':'user'}]);_0x447f80=_0x3f8c21['pluginScope'];}}console[_0x310feb(0x159)]('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x447f80+'\x20level)...\x0a');const _0x816502=await isMarketplaceAdded(_0x310feb(0x156));let _0x40b605=_0x816502;if(_0x816502)console['log'](_0x5d6858['ngHAM']);else{const _0x472700=await runClaudeCommand([_0x5d6858['oINsj'],'marketplace',_0x5d6858['Qaxqw'],_0x310feb(0x13b)]);!_0x472700['success']?(console['error'](_0x310feb(0x143),_0x472700[_0x310feb(0x155)]),console['log'](_0x5d6858[_0x310feb(0x13a)]),console[_0x310feb(0x159)]('\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead'),console[_0x310feb(0x159)]('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x447f80)):_0x40b605=!![];}if(_0x40b605){const _0x249093=await runClaudeCommand([_0x310feb(0x153),_0x5d6858[_0x310feb(0x144)],_0x310feb(0x14e),'--scope',_0x447f80]);if(!_0x249093['success'])console['error']('❌\x20Failed\x20to\x20install\x20plugin:',_0x249093[_0x310feb(0x155)]),console['log'](_0x5d6858['bOqzQ']),console[_0x310feb(0x159)](_0x310feb(0x14a)+_0x447f80);else{console['log'](_0x5d6858['AsqSf']);const _0x9ed9ac=[_0x310feb(0x153),_0x5d6858['kukpM'],'ranger@trailhead'];_0x447f80===_0x310feb(0x139)&&_0x9ed9ac['push']('--scope',_0x5d6858['QvGDx']);const _0x1ac25d=await runClaudeCommand(_0x9ed9ac,{'captureOutput':!![]}),_0x2e03db=_0x1ac25d['output']?.['includes'](_0x5d6858[_0x310feb(0x15d)]);!_0x1ac25d['success']&&!_0x2e03db?console['error']('⚠\x20Failed\x20to\x20enable\x20plugin:',_0x1ac25d['error']):console[_0x310feb(0x159)]('✓\x20Claude\x20Code\x20plugin\x20enabled');}}return!![];}export async function ensureClaudeSkills(_0x6cf58a){const _0x3337a1=_0x5771,_0x355da4={'pfjIn':function(_0x54bcf4,_0x20f8ed,_0x2c521d,_0x550183){return _0x54bcf4(_0x20f8ed,_0x2c521d,_0x550183);},'lLBFy':function(_0x39e0ef,_0xca7025){return _0x39e0ef(_0xca7025);},'znCCn':_0x3337a1(0x14c),'vuPtf':_0x3337a1(0x139),'ZvnRg':'ranger','KLfTw':function(_0xd063bf,_0x1320ac){return _0xd063bf||_0x1320ac;},'vaKuW':function(_0x546c70,_0x3c37c5,_0x3a6a57){return _0x546c70(_0x3c37c5,_0x3a6a57);},'NOTJn':function(_0x128ef5){return _0x128ef5();},'mGCEC':function(_0x1c8e30,_0x488799){return _0x1c8e30(_0x488799);}},_0xfb3dfc=existsSync(_0x355da4[_0x3337a1(0x158)](join,_0x355da4[_0x3337a1(0x14d)](getSkillsDir,_0x3337a1(0x15e)),_0x3337a1(0x14b),_0x355da4['znCCn'])),_0x4fe792=_0x355da4['lLBFy'](existsSync,_0x355da4['pfjIn'](join,_0x355da4[_0x3337a1(0x14d)](getSkillsDir,_0x355da4['vuPtf']),_0x355da4[_0x3337a1(0x148)],_0x355da4['znCCn']));if(_0x355da4[_0x3337a1(0x161)](_0xfb3dfc,_0x4fe792))return console[_0x3337a1(0x159)](_0x3337a1(0x134)),![];const _0x924797=_0x355da4['lLBFy'](existsSync,_0x355da4[_0x3337a1(0x149)](join,_0x355da4[_0x3337a1(0x146)](getProjectRoot),_0x3337a1(0x13f)));let _0x3b1bca=!![];if(_0x6cf58a)await skillup({'autoInstall':_0x6cf58a,'suppressUsage':!![]});else{if(_0x924797)await _0x355da4['lLBFy'](skillup,{'autoInstall':'project','suppressUsage':!![]});else{const _0x599844=await _0x27bd48[_0x3337a1(0x15b)]([{'type':_0x3337a1(0x133),'name':_0x3337a1(0x152),'message':_0x3337a1(0x13d),'default':!![]}]);_0x3b1bca=_0x599844[_0x3337a1(0x152)],_0x3b1bca&&await _0x355da4['mGCEC'](skillup,{'suppressUsage':!![]});}}return _0x3b1bca;}
@@ -1 +1 @@
1
- (function(_0x509d9d,_0x4a231d){const _0x4d4758=_0x1b1c,_0x9dd1c3=_0x509d9d();while(!![]){try{const _0x5e55cf=-parseInt(_0x4d4758(0xe7))/0x1*(parseInt(_0x4d4758(0xf8))/0x2)+parseInt(_0x4d4758(0xf1))/0x3+parseInt(_0x4d4758(0xdc))/0x4*(-parseInt(_0x4d4758(0xf5))/0x5)+-parseInt(_0x4d4758(0xe3))/0x6*(parseInt(_0x4d4758(0xed))/0x7)+-parseInt(_0x4d4758(0xef))/0x8*(parseInt(_0x4d4758(0xfc))/0x9)+-parseInt(_0x4d4758(0xfb))/0xa*(parseInt(_0x4d4758(0xee))/0xb)+parseInt(_0x4d4758(0xe8))/0xc;if(_0x5e55cf===_0x4a231d)break;else _0x9dd1c3['push'](_0x9dd1c3['shift']());}catch(_0x208f39){_0x9dd1c3['push'](_0x9dd1c3['shift']());}}}(_0x43d5,0x88a87));import{join}from'path';import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';function _0x1b1c(_0x4705d2,_0xbcb6fd){_0x4705d2=_0x4705d2-0xdb;const _0x43d554=_0x43d5();let _0x1b1c7c=_0x43d554[_0x4705d2];return _0x1b1c7c;}import _0x4184ba from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';function _0x43d5(){const _0x54bb06=['Where\x20should\x20the\x20plugin\x20be\x20installed?','prompt','38330HxvMCF','pOypP','error','1584OKrVSZ','ZDNOi','zUJgS','10AgKUgZ','20151DMWbhM','$schema','pluginScope','YumJd','172ulgUcW','stringify','includes','✓\x20OpenCode\x20plugin\x20configured','https://opencode.ai/config.json','QGHxm','iGVql','114MTDpJj','clfYN','njwRJ','QPsFw','40KfbFCc','17460720ytMYIn','log','list','parse','\x0a📦\x20OpenCode\x20Plugin\x0a','55643eBvWmV','8793488ZKqZgm','808snNUnB','VOWfC','1927761PoUZnq','project'];_0x43d5=function(){return _0x54bb06;};return _0x43d5();}export async function ensureOpencodePluginConfig(_0x4610d1){const _0x5f3c5e=_0x1b1c,_0x162d93={'YumJd':_0x5f3c5e(0xf2),'QPsFw':'opencode.json','pOypP':_0x5f3c5e(0xec),'QGukd':_0x5f3c5e(0xea),'noXnX':_0x5f3c5e(0xf3),'VOWfC':'User\x20(available\x20in\x20all\x20your\x20projects)','iGVql':'user','HWvti':'Project\x20(shared\x20with\x20team\x20via\x20git)','LsHFg':function(_0x4301cb,_0x466472,_0x3c8bda){return _0x4301cb(_0x466472,_0x3c8bda);},'bKTFQ':'@ranger-testing/opencode-plugin','okEXj':_0x5f3c5e(0xe0),'GhjSK':function(_0x385895,_0x31cdbf){return _0x385895(_0x31cdbf);},'clfYN':function(_0x2de9ef,_0x4727c7,_0x15ecbf){return _0x2de9ef(_0x4727c7,_0x15ecbf);},'QGHxm':'utf-8','zUJgS':'⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','xhVAj':'✓\x20OpenCode\x20plugin\x20already\x20configured','njwRJ':function(_0x379b1d,_0x491ee4){return _0x379b1d(_0x491ee4);},'ZDNOi':_0x5f3c5e(0xdf)},_0x1b158c=existsSync(join(getOpencodeConfigDir(_0x162d93['YumJd']),_0x162d93['QPsFw']));let _0x4ed39c;if(_0x4610d1)_0x4ed39c=_0x4610d1;else{if(_0x1b158c)_0x4ed39c=_0x162d93[_0x5f3c5e(0xdb)];else{console[_0x5f3c5e(0xe9)](_0x162d93[_0x5f3c5e(0xf6)]);const _0x2306d2=await _0x4184ba[_0x5f3c5e(0xf4)]([{'type':_0x162d93['QGukd'],'name':_0x5f3c5e(0xfe),'message':_0x162d93['noXnX'],'choices':[{'name':_0x162d93[_0x5f3c5e(0xf0)],'value':_0x162d93[_0x5f3c5e(0xe2)]},{'name':_0x162d93['HWvti'],'value':_0x162d93[_0x5f3c5e(0xdb)]}],'default':_0x162d93['iGVql']}]);_0x4ed39c=_0x2306d2['pluginScope'];}}const _0x41b183=_0x162d93['LsHFg'](join,getOpencodeConfigDir(_0x4ed39c),_0x162d93[_0x5f3c5e(0xe6)]),_0x510a95=_0x162d93['bKTFQ'],_0x44e10e=_0x162d93['okEXj'];let _0x4bfc2e={};if(_0x162d93['GhjSK'](existsSync,_0x41b183))try{const _0x43a73e=await _0x162d93[_0x5f3c5e(0xe4)](readFile,_0x41b183,_0x162d93[_0x5f3c5e(0xe1)]);_0x4bfc2e=JSON[_0x5f3c5e(0xeb)](_0x43a73e);}catch(_0x540c0a){return console[_0x5f3c5e(0xf7)](_0x162d93[_0x5f3c5e(0xfa)]),{'configured':![],'scope':_0x4ed39c,'error':'Failed\x20to\x20read\x20opencode.json','details':_0x540c0a};}const _0x257b53=Array['isArray'](_0x4bfc2e['plugin'])?_0x4bfc2e['plugin']:[];if(_0x257b53[_0x5f3c5e(0xde)](_0x510a95))return console['log'](_0x162d93['xhVAj']),{'configured':![],'scope':_0x4ed39c};return _0x4bfc2e[_0x5f3c5e(0xfd)]=_0x4bfc2e[_0x5f3c5e(0xfd)]||_0x44e10e,_0x4bfc2e['plugin']=[..._0x257b53,_0x510a95],await mkdir(_0x162d93[_0x5f3c5e(0xe5)](getOpencodeConfigDir,_0x4ed39c),{'recursive':!![]}),await writeFile(_0x41b183,JSON[_0x5f3c5e(0xdd)](_0x4bfc2e,null,0x2)+'\x0a'),console[_0x5f3c5e(0xe9)](_0x162d93[_0x5f3c5e(0xf9)]),{'configured':!![],'scope':_0x4ed39c};}
1
+ function _0x317b(){const _0xd78ab2=['✓\x20OpenCode\x20plugin\x20already\x20configured','list','176652ZKoMKB','180WJMQlN','vVJEr','1029479wuXWLT','https://opencode.ai/config.json','lBWKb','gQoMz','EjGQt','708340ZqOaKi','8WUpPbE','@ranger-testing/opencode-plugin','Wvinj','isArray','utf-8','26lRvoOU','project','$schema','2786305rmpSgW','pluginScope','WJPnw','opencode.json','148905PfFmKX','CWmJd','6558237LZdmaX','320DiuFag','log','NxLcZ','User\x20(available\x20in\x20all\x20your\x20projects)','6zgVOLl','15294000cKOKvI','parse','includes','Failed\x20to\x20read\x20opencode.json','HeRiF','\x0a📦\x20OpenCode\x20Plugin\x0a','plugin'];_0x317b=function(){return _0xd78ab2;};return _0x317b();}function _0x17bf(_0x18e6e9,_0x5e5d7b){_0x18e6e9=_0x18e6e9-0x98;const _0x317bc2=_0x317b();let _0x17bf12=_0x317bc2[_0x18e6e9];return _0x17bf12;}(function(_0x437695,_0x596073){const _0x554920=_0x17bf,_0x3c3771=_0x437695();while(!![]){try{const _0x1f67b8=parseInt(_0x554920(0xad))/0x1+-parseInt(_0x554920(0xb3))/0x2*(-parseInt(_0x554920(0xba))/0x3)+parseInt(_0x554920(0xae))/0x4*(parseInt(_0x554920(0xb6))/0x5)+-parseInt(_0x554920(0x9b))/0x6*(parseInt(_0x554920(0xbc))/0x7)+-parseInt(_0x554920(0xbd))/0x8*(parseInt(_0x554920(0xa5))/0x9)+parseInt(_0x554920(0x9c))/0xa+parseInt(_0x554920(0xa8))/0xb*(-parseInt(_0x554920(0xa6))/0xc);if(_0x1f67b8===_0x596073)break;else _0x3c3771['push'](_0x3c3771['shift']());}catch(_0x460e07){_0x3c3771['push'](_0x3c3771['shift']());}}}(_0x317b,0xd4cf7));import{join}from'path';import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0xe8a89f from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0x5c144f){const _0x27391e=_0x17bf,_0x2fc8e7={'HMHPH':function(_0xa68de0,_0x47b97e){return _0xa68de0(_0x47b97e);},'sIZrA':function(_0x2ffe2c,_0x373bc7){return _0x2ffe2c(_0x373bc7);},'Wvinj':_0x27391e(0xb4),'nPCAQ':_0x27391e(0xb9),'lBWKb':'Where\x20should\x20the\x20plugin\x20be\x20installed?','vVJEr':'Project\x20(shared\x20with\x20team\x20via\x20git)','TKmZk':function(_0x10e37b,_0x40a400,_0x38e4a0){return _0x10e37b(_0x40a400,_0x38e4a0);},'WJPnw':function(_0x2dd824,_0x5f1278){return _0x2dd824(_0x5f1278);},'NxLcZ':_0x27391e(0xa9),'HeRiF':function(_0x4f3f27,_0x3a53ce){return _0x4f3f27(_0x3a53ce);},'gQoMz':'⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','xkcSs':_0x27391e(0xa3),'EjGQt':function(_0x42c73e,_0x530cd8,_0x3fb3f9){return _0x42c73e(_0x530cd8,_0x3fb3f9);},'CWmJd':'✓\x20OpenCode\x20plugin\x20configured'},_0x236828=_0x2fc8e7['HMHPH'](existsSync,join(_0x2fc8e7['sIZrA'](getOpencodeConfigDir,_0x2fc8e7[_0x27391e(0xb0)]),_0x2fc8e7['nPCAQ']));let _0x33f6ff;if(_0x5c144f)_0x33f6ff=_0x5c144f;else{if(_0x236828)_0x33f6ff=_0x27391e(0xb4);else{console[_0x27391e(0x98)](_0x27391e(0xa1));const _0x3ae138=await _0xe8a89f['prompt']([{'type':_0x27391e(0xa4),'name':_0x27391e(0xb7),'message':_0x2fc8e7[_0x27391e(0xaa)],'choices':[{'name':_0x27391e(0x9a),'value':'user'},{'name':_0x2fc8e7[_0x27391e(0xa7)],'value':_0x2fc8e7[_0x27391e(0xb0)]}],'default':'user'}]);_0x33f6ff=_0x3ae138['pluginScope'];}}const _0xcaf910=_0x2fc8e7['TKmZk'](join,_0x2fc8e7[_0x27391e(0xb8)](getOpencodeConfigDir,_0x33f6ff),'opencode.json'),_0x2f6b9f=_0x27391e(0xaf),_0x5e2283=_0x2fc8e7[_0x27391e(0x99)];let _0x5c2d6e={};if(_0x2fc8e7[_0x27391e(0xa0)](existsSync,_0xcaf910))try{const _0x4dc4e3=await readFile(_0xcaf910,_0x27391e(0xb2));_0x5c2d6e=JSON[_0x27391e(0x9d)](_0x4dc4e3);}catch(_0x1e1bdf){return console['error'](_0x2fc8e7[_0x27391e(0xab)]),{'configured':![],'scope':_0x33f6ff,'error':_0x27391e(0x9f),'details':_0x1e1bdf};}const _0x2faee9=Array[_0x27391e(0xb1)](_0x5c2d6e['plugin'])?_0x5c2d6e[_0x27391e(0xa2)]:[];if(_0x2faee9[_0x27391e(0x9e)](_0x2f6b9f))return console['log'](_0x2fc8e7['xkcSs']),{'configured':![],'scope':_0x33f6ff};return _0x5c2d6e[_0x27391e(0xb5)]=_0x5c2d6e['$schema']||_0x5e2283,_0x5c2d6e['plugin']=[..._0x2faee9,_0x2f6b9f],await mkdir(getOpencodeConfigDir(_0x33f6ff),{'recursive':!![]}),await _0x2fc8e7[_0x27391e(0xac)](writeFile,_0xcaf910,JSON['stringify'](_0x5c2d6e,null,0x2)+'\x0a'),console[_0x27391e(0x98)](_0x2fc8e7[_0x27391e(0xbb)]),{'configured':!![],'scope':_0x33f6ff};}
@@ -1 +1 @@
1
- function _0x57e1(){const _0x56eaf9=['dgsHq','.\x20Use\x20--profile\x20to\x20specify\x20which\x20one.','Installing\x20Claude\x20Code\x20plugin\x20(project\x20level)...','success','You\x20can\x20install\x20manually:\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','swBBO','✓\x20Marketplace\x20already\x20added','2pkmYAP','1170GIlCJe','\x0a🔧\x20Ranger\x20CI\x20Setup\x0a','✓\x20Auth\x20state\x20found','XqiOs','1109010BkcEAV','marketplace','chromium','dYJNG','Multiple\x20CI\x20profiles\x20found:\x20','✓\x20Created\x20profile\x20settings:\x20baseUrl=','jqFxB','log','CaAwQ','UUegs','settings.json','skipChromium','baseUrl','246057ixeFPY','\x22:\x20','Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.','wZRKU','vpjqg','No\x20CI\x20profiles\x20found.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','RZOWn','6PfSpiQ','dir_setup','profile','KMkht','join','trackPhaseStart','Auto-detected\x20CI\x20profile:\x20','gmhvl','length','hYaoJ','20781HUjtnP','No\x20CI\x20profiles\x20found\x20in\x20.ranger/ci/.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','112532HdIgSE','Uwdiv','name','path','BqHBi','plugin','xGkfP','NQolB','QHeAW','PAHKi','trackPhaseEnd','ranger@trailhead','rewrt','2565234YLbAGG','project','cVphS','install','isDirectory','✓\x20Encrypted\x20auth\x20verified\x20(will\x20decrypt\x20at\x20runtime)','Failed\x20to\x20install\x20plugin:','auth.json.enc','profile_activate','1874745MorLgc','1323608MKIoXp','Failed\x20to\x20verify\x20encrypted\x20auth\x20for\x20profile\x20\x22'];_0x57e1=function(){return _0x56eaf9;};return _0x57e1();}(function(_0x45492b,_0x45b22d){const _0x2e0c35=_0x2400,_0x5dba16=_0x45492b();while(!![]){try{const _0x185812=-parseInt(_0x2e0c35(0x1f8))/0x1*(-parseInt(_0x2e0c35(0x1e6))/0x2)+-parseInt(_0x2e0c35(0x1eb))/0x3+parseInt(_0x2e0c35(0x1c6))/0x4+parseInt(_0x2e0c35(0x1dc))/0x5+parseInt(_0x2e0c35(0x1ba))/0x6*(parseInt(_0x2e0c35(0x1d3))/0x7)+-parseInt(_0x2e0c35(0x1dd))/0x8+-parseInt(_0x2e0c35(0x1c4))/0x9*(parseInt(_0x2e0c35(0x1e7))/0xa);if(_0x185812===_0x45b22d)break;else _0x5dba16['push'](_0x5dba16['shift']());}catch(_0x3ad1d4){_0x5dba16['push'](_0x5dba16['shift']());}}}(_0x57e1,0x33597));import{mkdir,readFile,readdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';function _0x2400(_0x33ffac,_0x11315b){_0x33ffac=_0x33ffac-0x1b6;const _0x57e17f=_0x57e1();let _0x240041=_0x57e17f[_0x33ffac];return _0x240041;}import{authenticate,ensureRangerDir,ensureChromium,writeRangerGitignore}from'./start.js';import{skillup}from'./skillup.js';import{getRangerDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{saveSettings}from'./utils/settings.js';import{decrypt}from'./utils/crypto.js';import{getToken}from'./utils/keychain.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'./utils/claudePlugin.js';async function findCiProfile(_0x3b25e8){const _0x129b05=_0x2400,_0x589f81={'dgsHq':function(_0x508c83,_0x160864,_0x561b30){return _0x508c83(_0x160864,_0x561b30);},'NQolB':function(_0x4f4d61,_0xdd217f){return _0x4f4d61+_0xdd217f;},'psLNk':_0x129b05(0x1b8),'rewrt':function(_0x38ce1a,_0x502466){return _0x38ce1a===_0x502466;}},_0xe0f4ef=getRangerDir(),_0x538259=_0x589f81[_0x129b05(0x1df)](join,_0xe0f4ef,'ci');if(_0x3b25e8){const _0x2774d0=join(_0x538259,_0x3b25e8);return{'name':_0x3b25e8,'path':_0x2774d0};}if(!existsSync(_0x538259))throw new Error(_0x589f81[_0x129b05(0x1cd)](_0x589f81['psLNk'],_0x129b05(0x1fa)));const _0x30177b=await readdir(_0x538259,{'withFileTypes':!![]}),_0x653b0f=_0x30177b['filter'](_0x10c5b5=>_0x10c5b5[_0x129b05(0x1d7)]())['map'](_0x3adefe=>_0x3adefe['name']);if(_0x589f81[_0x129b05(0x1d2)](_0x653b0f[_0x129b05(0x1c2)],0x0))throw new Error(_0x589f81[_0x129b05(0x1cd)](_0x129b05(0x1c5),'Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.'));if(_0x653b0f['length']===0x1){const _0x28da3c=_0x653b0f[0x0];return console[_0x129b05(0x1f2)](_0x129b05(0x1c0)+_0x28da3c),{'name':_0x28da3c,'path':join(_0x538259,_0x28da3c)};}throw new Error(_0x129b05(0x1ef)+_0x653b0f[_0x129b05(0x1be)](',\x20')+_0x129b05(0x1e0));}async function installPluginNonInteractive(){const _0x501b59=_0x2400,_0xe59113={'MndbM':_0x501b59(0x1d1),'jqFxB':'✓\x20Claude\x20Code\x20plugin\x20already\x20installed','gmhvl':function(_0x22ef58,_0x144c25){return _0x22ef58(_0x144c25);},'fHrtR':'trailhead','BqHBi':_0x501b59(0x1e5),'XqiOs':_0x501b59(0x1ec),'UUegs':'add','UwIyS':'ranger-testing/trailhead','kKaxd':'Failed\x20to\x20add\x20marketplace:','cVphS':_0x501b59(0x1e3),'vpjqg':_0x501b59(0x1d6),'dYJNG':'--scope','CaAwQ':'project'},_0x383e9b=await isPluginInstalled(_0xe59113['MndbM']);if(_0x383e9b)return console[_0x501b59(0x1f2)](_0xe59113[_0x501b59(0x1f1)]),![];console[_0x501b59(0x1f2)](_0x501b59(0x1e1));const _0xa0689f=await _0xe59113[_0x501b59(0x1c1)](isMarketplaceAdded,_0xe59113['fHrtR']);let _0x1b8637=_0xa0689f;if(_0xa0689f)console[_0x501b59(0x1f2)](_0xe59113[_0x501b59(0x1ca)]);else{const _0x5a788e=await runClaudeCommand(['plugin',_0xe59113[_0x501b59(0x1ea)],_0xe59113[_0x501b59(0x1f4)],_0xe59113['UwIyS']]);!_0x5a788e['success']?(console['error'](_0xe59113['kKaxd'],_0x5a788e['error']),console[_0x501b59(0x1f2)](_0xe59113[_0x501b59(0x1d5)])):_0x1b8637=!![];}if(_0x1b8637){const _0x49a0c3=await runClaudeCommand([_0x501b59(0x1cb),_0xe59113[_0x501b59(0x1b7)],_0xe59113['MndbM'],_0xe59113[_0x501b59(0x1ee)],_0xe59113[_0x501b59(0x1f3)]]);!_0x49a0c3[_0x501b59(0x1e2)]?(console['error'](_0x501b59(0x1d9),_0x49a0c3['error']),console[_0x501b59(0x1f2)]('You\x20can\x20install\x20manually:\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20project')):console['log']('✓\x20Claude\x20Code\x20plugin\x20installed');}return!![];}export async function setupCi(_0x404568,_0x2eac80,_0x24818a){const _0x1d6135=_0x2400,_0x1c8d9a={'PAHKi':_0x1d6135(0x1e8),'Uwdiv':'auth','KMkht':function(_0x36983c){return _0x36983c();},'fnhhj':function(_0x136b98,_0x28eb03){return _0x136b98(_0x28eb03);},'khxME':function(_0x4b6640,_0xc802ff){return _0x4b6640(_0xc802ff);},'aRfHt':'dir_setup','UCsdi':'✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','wZRKU':_0x1d6135(0x1ed),'XUIVr':'profile_activate','QHeAW':function(_0x1b30e5,_0x449a35,_0x369424){return _0x1b30e5(_0x449a35,_0x369424);},'xGkfP':function(_0x5c7240,_0x1bfae4){return _0x5c7240(_0x1bfae4);},'ZxJbf':function(_0x1bd297,_0x2be2b9,_0xb43ee0){return _0x1bd297(_0x2be2b9,_0xb43ee0);},'PpPki':function(_0x674e18,_0x4a288e,_0xb9bfd3){return _0x674e18(_0x4a288e,_0xb9bfd3);},'lPkvS':_0x1d6135(0x1da),'QJcZa':function(_0x51c613,_0x4cbc21){return _0x51c613(_0x4cbc21);},'swBBO':function(_0x494eff){return _0x494eff();},'yjpex':'No\x20API\x20token\x20available\x20for\x20decryption','EMFDi':function(_0x503b84,_0x3d60fb){return _0x503b84 instanceof _0x3d60fb;},'FbRmk':function(_0x148d3f,_0x3021f9){return _0x148d3f(_0x3021f9);},'mnrES':'\x20\x20No\x20auth\x20state\x20found\x20(app\x20may\x20not\x20require\x20authentication)','RZOWn':'plugin','hYaoJ':function(_0x2120a1){return _0x2120a1();}};console['log'](_0x1c8d9a[_0x1d6135(0x1cf)]),_0x24818a?.[_0x1d6135(0x1bf)](_0x1c8d9a[_0x1d6135(0x1c7)]),await authenticate(_0x404568),_0x24818a?.['trackPhaseEnd'](_0x1c8d9a['Uwdiv']),_0x24818a?.[_0x1d6135(0x1bf)](_0x1d6135(0x1bb));const {path:_0x2e3dc2,installed:_0x3ff4c5}=await _0x1c8d9a['KMkht'](ensureRangerDir);await _0x1c8d9a['fnhhj'](writeRangerGitignore,_0x2e3dc2);const _0x5aaae6=join(_0x2e3dc2,'sessions');!_0x1c8d9a['khxME'](existsSync,_0x5aaae6)&&await mkdir(_0x5aaae6,{'recursive':!![]});_0x24818a?.['trackPhaseEnd'](_0x1c8d9a['aRfHt'],{'installed':_0x3ff4c5}),_0x24818a?.['trackPhaseStart']('chromium');let _0x3956c1=![];_0x2eac80?.[_0x1d6135(0x1f6)]?console[_0x1d6135(0x1f2)](_0x1c8d9a['UCsdi']):_0x3956c1=await _0x1c8d9a[_0x1d6135(0x1bd)](ensureChromium);_0x24818a?.[_0x1d6135(0x1d0)](_0x1c8d9a[_0x1d6135(0x1b6)],{'installed':_0x3956c1,'skipped':!!_0x2eac80?.[_0x1d6135(0x1f6)]}),_0x24818a?.['trackPhaseStart'](_0x1c8d9a['XUIVr']);const _0x29d565=await _0x1c8d9a['khxME'](findCiProfile,_0x2eac80?.[_0x1d6135(0x1bc)]);let _0x2238b6=![];_0x2eac80?.[_0x1d6135(0x1f7)]&&(await mkdir(_0x29d565['path'],{'recursive':!![]}),await saveSettings(_0x29d565[_0x1d6135(0x1c8)],{'baseUrl':_0x2eac80[_0x1d6135(0x1f7)],'headless':!![]}),console['log'](_0x1d6135(0x1f0)+_0x2eac80['baseUrl']),_0x2238b6=!![]);const _0x3c20d4=_0x1c8d9a[_0x1d6135(0x1ce)](join,_0x29d565['path'],_0x1d6135(0x1f5));if(!_0x1c8d9a[_0x1d6135(0x1cc)](existsSync,_0x3c20d4)&&!_0x2238b6)throw new Error('CI\x20profile\x20\x22'+_0x29d565['name']+'\x22\x20has\x20no\x20settings.json.\x20Use\x20--base-url\x20to\x20configure\x20it.');const _0x4fa772=_0x1c8d9a['ZxJbf'](join,_0x29d565['path'],'auth.json'),_0x4174ad=_0x1c8d9a['PpPki'](join,_0x29d565[_0x1d6135(0x1c9)],_0x1c8d9a['lPkvS']),_0xd150fb=existsSync(_0x4fa772),_0x5b77f0=_0x1c8d9a['QJcZa'](existsSync,_0x4174ad);if(_0x5b77f0)try{const _0x4b881c=await _0x1c8d9a[_0x1d6135(0x1e4)](getToken);if(!_0x4b881c)throw new Error(_0x1c8d9a['yjpex']);const _0x500241=await readFile(_0x4174ad);decrypt(_0x500241,_0x4b881c),console[_0x1d6135(0x1f2)](_0x1d6135(0x1d8));}catch(_0x32e39b){const _0xd6fa8a=_0x1c8d9a['EMFDi'](_0x32e39b,Error)?_0x32e39b['message']:_0x1c8d9a['FbRmk'](String,_0x32e39b);throw new Error(_0x1d6135(0x1de)+_0x29d565['name']+_0x1d6135(0x1f9)+_0xd6fa8a);}else _0xd150fb?console[_0x1d6135(0x1f2)](_0x1d6135(0x1e9)):console[_0x1d6135(0x1f2)](_0x1c8d9a['mnrES']);await _0x1c8d9a['khxME'](writeActiveProfileName,_0x29d565[_0x1d6135(0x1c8)]),console['log']('✓\x20Active\x20profile:\x20'+_0x29d565[_0x1d6135(0x1c8)]),_0x24818a?.['trackPhaseEnd'](_0x1d6135(0x1db),{'profileName':_0x29d565[_0x1d6135(0x1c8)],'hasAuth':_0xd150fb,'hasEncryptedAuth':_0x5b77f0,'createdSettings':_0x2238b6}),_0x24818a?.[_0x1d6135(0x1bf)](_0x1c8d9a[_0x1d6135(0x1b9)]);const _0x379853=await _0x1c8d9a[_0x1d6135(0x1c3)](installPluginNonInteractive);_0x24818a?.['trackPhaseEnd'](_0x1d6135(0x1cb),{'installed':_0x379853}),_0x24818a?.['trackPhaseStart']('skills'),await skillup({'autoInstall':_0x1d6135(0x1d4)}),_0x24818a?.[_0x1d6135(0x1d0)]('skills'),console['log']('\x0a✅\x20Ranger\x20CI\x20setup\x20complete!\x0a');}
1
+ function _0x2efc(){const _0x4a01ab=['plugin','✓\x20Encrypted\x20auth\x20verified\x20(will\x20decrypt\x20at\x20runtime)','xBFgw','52489VdRnXN','success','8PhPxjp','auth','mbAva','.\x20Use\x20--profile\x20to\x20specify\x20which\x20one.','\x22:\x20','\x0a✅\x20Ranger\x20CI\x20setup\x20complete!\x0a','210354LGUUIY','mUzdm','827455pvpVYP','length','✓\x20Created\x20profile\x20settings:\x20baseUrl=','sessions','skills','settings.json','RHJnB','Failed\x20to\x20install\x20plugin:','install','message','dir_setup','Auto-detected\x20CI\x20profile:\x20','path','You\x20can\x20install\x20manually:\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20project','uqCGH','\x0a🔧\x20Ranger\x20CI\x20Setup\x0a','No\x20API\x20token\x20available\x20for\x20decryption','tgeMk','ranger@trailhead','chromium','riqPB','CI\x20profile\x20\x22','isDirectory','2091397rqFlQJ','539Efhzhg','Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.','auth.json','4qpEfVM','--scope','ZYMUo','25170JJlfyX','log','trackPhaseEnd','EgFJq','15784qdRrGN','oAaON','error','\x20\x20No\x20auth\x20state\x20found\x20(app\x20may\x20not\x20require\x20authentication)','auth.json.enc','skipChromium','You\x20can\x20install\x20manually:\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','Multiple\x20CI\x20profiles\x20found:\x20','Failed\x20to\x20verify\x20encrypted\x20auth\x20for\x20profile\x20\x22','whnuZ','baseUrl','ranger-testing/trailhead','trackPhaseStart','project','cDdDU','137061hhSuOG','\x22\x20has\x20no\x20settings.json.\x20Use\x20--base-url\x20to\x20configure\x20it.','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','name','✓\x20Marketplace\x20already\x20added','Kuane','SnsGV','30kNdBka','LWxoJ','No\x20CI\x20profiles\x20found\x20in\x20.ranger/ci/.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','✓\x20Claude\x20Code\x20plugin\x20already\x20installed'];_0x2efc=function(){return _0x4a01ab;};return _0x2efc();}(function(_0x4bbab0,_0x41c323){const _0xdfef84=_0x1bd7,_0x287f09=_0x4bbab0();while(!![]){try{const _0x169b62=-parseInt(_0xdfef84(0xe2))/0x1*(parseInt(_0xdfef84(0x107))/0x2)+parseInt(_0xdfef84(0x10a))/0x3*(parseInt(_0xdfef84(0xe4))/0x4)+parseInt(_0xdfef84(0xec))/0x5+parseInt(_0xdfef84(0xea))/0x6+parseInt(_0xdfef84(0x104))/0x7*(-parseInt(_0xdfef84(0x10e))/0x8)+-parseInt(_0xdfef84(0x11d))/0x9*(parseInt(_0xdfef84(0x124))/0xa)+parseInt(_0xdfef84(0x103))/0xb;if(_0x169b62===_0x41c323)break;else _0x287f09['push'](_0x287f09['shift']());}catch(_0x7a4a95){_0x287f09['push'](_0x287f09['shift']());}}}(_0x2efc,0x199a7));import{mkdir,readFile,readdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{authenticate,ensureRangerDir,ensureChromium,writeRangerGitignore}from'./start.js';function _0x1bd7(_0x2976d6,_0x31706a){_0x2976d6=_0x2976d6-0xdf;const _0x2efce4=_0x2efc();let _0x1bd7ea=_0x2efce4[_0x2976d6];return _0x1bd7ea;}import{skillup}from'./skillup.js';import{getRangerDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{saveSettings}from'./utils/settings.js';import{decrypt}from'./utils/crypto.js';import{getToken}from'./utils/keychain.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'./utils/claudePlugin.js';async function findCiProfile(_0x5cfe63){const _0x12fb34=_0x1bd7,_0x28d9cc={'EgFJq':function(_0x4f5c19,_0x5824e6,_0x3005c0){return _0x4f5c19(_0x5824e6,_0x3005c0);},'SnsGV':function(_0x155dc0,_0x37da6d){return _0x155dc0+_0x37da6d;},'pTKbp':function(_0x195c50,_0x169a5a){return _0x195c50===_0x169a5a;},'aYuNk':function(_0x338e38,_0x3cc815,_0x31a0cd){return _0x338e38(_0x3cc815,_0x31a0cd);}},_0x196aa7=getRangerDir(),_0x541c57=join(_0x196aa7,'ci');if(_0x5cfe63){const _0x3b25b6=_0x28d9cc[_0x12fb34(0x10d)](join,_0x541c57,_0x5cfe63);return{'name':_0x5cfe63,'path':_0x3b25b6};}if(!existsSync(_0x541c57))throw new Error(_0x28d9cc[_0x12fb34(0x123)]('No\x20CI\x20profiles\x20found.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a',_0x12fb34(0x105)));const _0x468213=await readdir(_0x541c57,{'withFileTypes':!![]}),_0x4cf097=_0x468213['filter'](_0x54d6f3=>_0x54d6f3[_0x12fb34(0x102)]())['map'](_0x47347b=>_0x47347b[_0x12fb34(0x120)]);if(_0x28d9cc['pTKbp'](_0x4cf097['length'],0x0))throw new Error(_0x12fb34(0x126)+_0x12fb34(0x105));if(_0x4cf097[_0x12fb34(0xed)]===0x1){const _0x33e4d8=_0x4cf097[0x0];return console[_0x12fb34(0x10b)](_0x12fb34(0xf7)+_0x33e4d8),{'name':_0x33e4d8,'path':_0x28d9cc['aYuNk'](join,_0x541c57,_0x33e4d8)};}throw new Error(_0x12fb34(0x115)+_0x4cf097['join'](',\x20')+_0x12fb34(0xe7));}async function installPluginNonInteractive(){const _0x55a880=_0x1bd7,_0x5d721c={'oAaON':function(_0x303089,_0x42dc54){return _0x303089(_0x42dc54);},'eQkMk':_0x55a880(0xfe),'zWYgO':_0x55a880(0x127),'mbAva':function(_0x1ca870,_0x5ebd1){return _0x1ca870(_0x5ebd1);},'yJdgf':'trailhead','RHJnB':_0x55a880(0x121),'whnuZ':'plugin','ZYMUo':'add','riqPB':_0x55a880(0x108),'GiljU':_0x55a880(0x11b)},_0x260263=await _0x5d721c[_0x55a880(0x10f)](isPluginInstalled,_0x5d721c['eQkMk']);if(_0x260263)return console[_0x55a880(0x10b)](_0x5d721c['zWYgO']),![];console[_0x55a880(0x10b)]('Installing\x20Claude\x20Code\x20plugin\x20(project\x20level)...');const _0x2056c5=await _0x5d721c[_0x55a880(0xe6)](isMarketplaceAdded,_0x5d721c['yJdgf']);let _0x191293=_0x2056c5;if(_0x2056c5)console['log'](_0x5d721c[_0x55a880(0xf2)]);else{const _0x336442=await _0x5d721c['mbAva'](runClaudeCommand,[_0x5d721c[_0x55a880(0x117)],'marketplace',_0x5d721c[_0x55a880(0x109)],_0x55a880(0x119)]);!_0x336442['success']?(console[_0x55a880(0x110)]('Failed\x20to\x20add\x20marketplace:',_0x336442['error']),console['log'](_0x55a880(0x114))):_0x191293=!![];}if(_0x191293){const _0x34910b=await runClaudeCommand([_0x5d721c['whnuZ'],_0x55a880(0xf4),'ranger@trailhead',_0x5d721c[_0x55a880(0x100)],_0x5d721c['GiljU']]);!_0x34910b[_0x55a880(0xe3)]?(console[_0x55a880(0x110)](_0x55a880(0xf3),_0x34910b[_0x55a880(0x110)]),console[_0x55a880(0x10b)](_0x55a880(0xf9))):console['log']('✓\x20Claude\x20Code\x20plugin\x20installed');}return!![];}export async function setupCi(_0x3df13a,_0x5ebcac,_0x570f7e){const _0x36df64=_0x1bd7,_0x1e405f={'htulb':_0x36df64(0xf6),'xBFgw':function(_0x210ebf){return _0x210ebf();},'KDDmU':function(_0x325068,_0x1fa876){return _0x325068(_0x1fa876);},'uqCGH':function(_0x224ec5,_0x468461,_0x48ee1a){return _0x224ec5(_0x468461,_0x48ee1a);},'LWxoJ':_0x36df64(0xef),'Kuane':_0x36df64(0xff),'SMBOh':'profile_activate','RwPHZ':function(_0x30b025,_0x1325d0){return _0x30b025(_0x1325d0);},'QTvbl':function(_0x99da9e,_0x48cc88){return _0x99da9e(_0x48cc88);},'cDdDU':_0x36df64(0x106),'tgeMk':_0x36df64(0xfc),'UakDA':function(_0x39d49e,_0x3854a5,_0x29bf8e){return _0x39d49e(_0x3854a5,_0x29bf8e);},'XXBiN':function(_0x21ddfa,_0x3765b0){return _0x21ddfa instanceof _0x3765b0;},'FJlAJ':_0x36df64(0xf0),'mUzdm':'project'};console['log'](_0x36df64(0xfb)),_0x570f7e?.['trackPhaseStart']('auth'),await authenticate(_0x3df13a),_0x570f7e?.['trackPhaseEnd'](_0x36df64(0xe5)),_0x570f7e?.['trackPhaseStart'](_0x1e405f['htulb']);const {path:_0x55a5a9,installed:_0x1dca9e}=await _0x1e405f[_0x36df64(0xe1)](ensureRangerDir);await _0x1e405f['KDDmU'](writeRangerGitignore,_0x55a5a9);const _0x5acf2d=_0x1e405f[_0x36df64(0xfa)](join,_0x55a5a9,_0x1e405f[_0x36df64(0x125)]);!existsSync(_0x5acf2d)&&await mkdir(_0x5acf2d,{'recursive':!![]});_0x570f7e?.['trackPhaseEnd'](_0x36df64(0xf6),{'installed':_0x1dca9e}),_0x570f7e?.[_0x36df64(0x11a)](_0x1e405f[_0x36df64(0x122)]);let _0x2de653=![];_0x5ebcac?.['skipChromium']?console['log'](_0x36df64(0x11f)):_0x2de653=await ensureChromium();_0x570f7e?.[_0x36df64(0x10c)]('chromium',{'installed':_0x2de653,'skipped':!!_0x5ebcac?.[_0x36df64(0x113)]}),_0x570f7e?.['trackPhaseStart'](_0x1e405f['SMBOh']);const _0xa0e625=await _0x1e405f['RwPHZ'](findCiProfile,_0x5ebcac?.['profile']);let _0x2b83e2=![];_0x5ebcac?.['baseUrl']&&(await mkdir(_0xa0e625[_0x36df64(0xf8)],{'recursive':!![]}),await _0x1e405f[_0x36df64(0xfa)](saveSettings,_0xa0e625[_0x36df64(0x120)],{'baseUrl':_0x5ebcac['baseUrl'],'headless':!![]}),console['log'](_0x36df64(0xee)+_0x5ebcac[_0x36df64(0x118)]),_0x2b83e2=!![]);const _0x135076=join(_0xa0e625['path'],_0x36df64(0xf1));if(!_0x1e405f['QTvbl'](existsSync,_0x135076)&&!_0x2b83e2)throw new Error(_0x36df64(0x101)+_0xa0e625['name']+_0x36df64(0x11e));const _0x478c28=join(_0xa0e625['path'],_0x1e405f[_0x36df64(0x11c)]),_0x3e8e01=join(_0xa0e625['path'],_0x36df64(0x112)),_0x785f2c=_0x1e405f['KDDmU'](existsSync,_0x478c28),_0xe16abb=existsSync(_0x3e8e01);if(_0xe16abb)try{const _0x34c204=await getToken();if(!_0x34c204)throw new Error(_0x1e405f[_0x36df64(0xfd)]);const _0x53e80e=await readFile(_0x3e8e01);_0x1e405f['UakDA'](decrypt,_0x53e80e,_0x34c204),console['log'](_0x36df64(0xe0));}catch(_0x5df514){const _0x3c2206=_0x1e405f['XXBiN'](_0x5df514,Error)?_0x5df514[_0x36df64(0xf5)]:String(_0x5df514);throw new Error(_0x36df64(0x116)+_0xa0e625['name']+_0x36df64(0xe8)+_0x3c2206);}else _0x785f2c?console[_0x36df64(0x10b)]('✓\x20Auth\x20state\x20found'):console[_0x36df64(0x10b)](_0x36df64(0x111));await writeActiveProfileName(_0xa0e625[_0x36df64(0x120)]),console[_0x36df64(0x10b)]('✓\x20Active\x20profile:\x20'+_0xa0e625[_0x36df64(0x120)]),_0x570f7e?.[_0x36df64(0x10c)](_0x1e405f['SMBOh'],{'profileName':_0xa0e625['name'],'hasAuth':_0x785f2c,'hasEncryptedAuth':_0xe16abb,'createdSettings':_0x2b83e2}),_0x570f7e?.['trackPhaseStart'](_0x36df64(0xdf));const _0x5a6188=await _0x1e405f['xBFgw'](installPluginNonInteractive);_0x570f7e?.[_0x36df64(0x10c)](_0x36df64(0xdf),{'installed':_0x5a6188}),_0x570f7e?.[_0x36df64(0x11a)](_0x1e405f['FJlAJ']),await skillup({'autoInstall':_0x1e405f[_0x36df64(0xeb)]}),_0x570f7e?.[_0x36df64(0x10c)](_0x1e405f['FJlAJ']),console['log'](_0x36df64(0xe9));}
@@ -1 +1 @@
1
- (function(_0x2a8376,_0x39b488){const _0x39b0e0=_0xe1b7,_0x27156f=_0x2a8376();while(!![]){try{const _0x5d5527=-parseInt(_0x39b0e0(0x20c))/0x1*(parseInt(_0x39b0e0(0x1f1))/0x2)+-parseInt(_0x39b0e0(0x204))/0x3+parseInt(_0x39b0e0(0x215))/0x4+-parseInt(_0x39b0e0(0x206))/0x5+-parseInt(_0x39b0e0(0x1f4))/0x6+-parseInt(_0x39b0e0(0x202))/0x7*(-parseInt(_0x39b0e0(0x217))/0x8)+parseInt(_0x39b0e0(0x1ef))/0x9*(parseInt(_0x39b0e0(0x1fa))/0xa);if(_0x5d5527===_0x39b488)break;else _0x27156f['push'](_0x27156f['shift']());}catch(_0x10bafd){_0x27156f['push'](_0x27156f['shift']());}}}(_0x255a,0xbcc9a));import{basename}from'path';import _0x213d93 from'inquirer';import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';function _0xe1b7(_0x51b342,_0x20413f){_0x51b342=_0x51b342-0x1ef;const _0x255a2b=_0x255a();let _0xe1b77d=_0x255a2b[_0x51b342];return _0xe1b77d;}import{getCurrentVersion}from'./utils/version.js';function _0x255a(){const _0x176306=['\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a','8eUarEY','user','63wqMPAs','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','1348knYNCP','Where\x20should\x20skills\x20be\x20installed?','Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20(','8230356fpMgxk','QRehH','4|5|2|3|0|1','SmVHk','platform','\x20\x20-\x20Open\x20Claude\x20Code\x20in\x20plan\x20mode\x20and\x20run\x20/ranger:enable.\x20Plan\x20out\x20a\x20UI\x20feature\x20with\x20Ranger\x20and\x20watch\x20Ranger\x20test\x20it\x20for\x20you!','4086480ZgXxSp','user-level','isTTY','prompt','ranger','\x20--opencode','/skills/','KbxBG','1907171hUPxSz','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','1414614HgbkZh','message','1327460Qjxyup','LUVLo','IGGGS','oDSJq','WJiys','\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','1953AwsrBO','claude','\x20successfully!\x0a','\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','PBSee','stdin','FCbks','log','\x20\x203.\x20Run:\x20ranger\x20skillup','4261452RbhmqL'];_0x255a=function(){return _0x176306;};return _0x255a();}import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x21d70b={}){const _0x103f2d=_0xe1b7,_0x431070={'SmVHk':_0x103f2d(0x20f),'dYnjT':_0x103f2d(0x20d),'qsuBD':function(_0x53a6ac){return _0x53a6ac();},'WJiys':_0x103f2d(0x1f6),'KbxBG':function(_0x22ba41,_0x30b7c7){return _0x22ba41===_0x30b7c7;},'PBSee':'opencode','FCbks':'To\x20get\x20started:','tdGuV':function(_0x31fdde){return _0x31fdde();},'OYSot':function(_0x2144f4,_0x5d1da6){return _0x2144f4(_0x5d1da6);},'oDSJq':function(_0x495cdb,_0x4f831d){return _0x495cdb===_0x4f831d;},'QRehH':_0x103f2d(0x218),'ceDBi':function(_0x4d73bf){return _0x4d73bf();},'iIZde':'list','LUVLo':'project','GvmcN':function(_0x37ee2c){return _0x37ee2c();},'JPieW':function(_0x5f5a1,_0x694a13){return _0x5f5a1 instanceof _0x694a13;},'pCdKk':_0x103f2d(0x1fb),'fyKDj':_0x103f2d(0x20b),'IGGGS':_0x103f2d(0x1f9)};console['log'](_0x431070[_0x103f2d(0x1f7)]);const _0x4a3b59=_0x21d70b[_0x103f2d(0x1f8)]??_0x431070['dYnjT'],_0x501505=await _0x431070['qsuBD'](getToken);if(!_0x501505){const _0x39bcc0=_0x431070[_0x103f2d(0x20a)]['split']('|');let _0x1a227c=0x0;while(!![]){switch(_0x39bcc0[_0x1a227c++]){case'0':console[_0x103f2d(0x213)](_0x103f2d(0x214)+(_0x431070['KbxBG'](_0x4a3b59,_0x431070[_0x103f2d(0x210)])?'\x20--opencode':'')+'\x0a');continue;case'1':return;case'2':console[_0x103f2d(0x213)](_0x103f2d(0x203));continue;case'3':console['log']('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0x431070['KbxBG'](_0x4a3b59,_0x431070['PBSee'])?_0x103f2d(0x1ff):'')+'\x20<your-api-token>');continue;case'4':console['log'](_0x103f2d(0x1f0));continue;case'5':console['log'](_0x431070[_0x103f2d(0x212)]);continue;}break;}}console['log']('✓\x20Found\x20API\x20token');const _0x5c4f9d=_0x431070['tdGuV'](getProjectRoot),_0x3f5171=_0x431070['OYSot'](basename,_0x5c4f9d),_0x154874=_0x431070[_0x103f2d(0x209)](_0x4a3b59,_0x431070['PBSee'])?_0x431070['OYSot'](getOpencodeConfigDir,_0x431070[_0x103f2d(0x1f5)])+_0x103f2d(0x200):_0x431070['ceDBi'](getClaudeConfigDir)+'/skills/',_0x55b37d=_0x431070['KbxBG'](_0x4a3b59,_0x431070['PBSee'])?_0x5c4f9d+'/.opencode/skills/':_0x5c4f9d+'/.claude/skills/',_0x221912=process[_0x103f2d(0x211)]['isTTY']&&process['stdout'][_0x103f2d(0x1fc)];let _0x127e5d;if(_0x21d70b['autoInstall'])_0x127e5d=_0x21d70b['autoInstall'];else{if(_0x221912){const _0x516bc1=await _0x213d93[_0x103f2d(0x1fd)]([{'type':_0x431070['iIZde'],'name':'installLevel','message':_0x103f2d(0x1f2),'choices':[{'name':'All\x20projects\x20('+_0x154874+')','value':_0x431070[_0x103f2d(0x1f5)]},{'name':'This\x20project\x20only\x20('+_0x55b37d+')','value':_0x431070['LUVLo']}]}]);_0x127e5d=_0x516bc1['installLevel'];}else _0x127e5d=_0x431070[_0x103f2d(0x207)],console[_0x103f2d(0x213)](_0x103f2d(0x1f3)+_0x55b37d+')');}let _0x452f8e=0x0;const _0x60d470=_0x431070['GvmcN'](getCurrentVersion);console[_0x103f2d(0x213)]('\x0a📦\x20Installing\x20skills...\x0a');try{const _0x4320eb=await installSkill(_0x103f2d(0x1fe),{'cliVersion':_0x60d470,'level':_0x127e5d,'platform':_0x4a3b59});_0x4320eb&&_0x452f8e++;}catch(_0x2930c3){console['warn']('\x20\x20Failed\x20to\x20install\x20ranger\x20skill:',_0x431070['JPieW'](_0x2930c3,Error)?_0x2930c3[_0x103f2d(0x205)]:_0x2930c3);}if(_0x452f8e>0x0){const _0x4b222=_0x431070[_0x103f2d(0x201)](_0x127e5d,_0x431070[_0x103f2d(0x1f5)])?_0x431070['pCdKk']:'project-level';console[_0x103f2d(0x213)]('\x0a✅\x20Installed\x20'+_0x452f8e+'\x20'+_0x4b222+'\x20skill'+(_0x452f8e>0x1?'s':'')+_0x103f2d(0x20e)),!_0x21d70b['suppressUsage']&&(console[_0x103f2d(0x213)]('To\x20use:'),_0x4a3b59==='opencode'?console['log'](_0x431070['fyKDj']):console[_0x103f2d(0x213)](_0x431070[_0x103f2d(0x208)]));}else console[_0x103f2d(0x213)](_0x103f2d(0x216));}
1
+ function _0x1bea(){const _0x38523b=['\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','platform','opencode','iaJBb','installLevel','tXxbo','\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','KZaKq','To\x20get\x20started:','7610094SDMLUP','8333801qGhPfS','To\x20use:','\x20\x203.\x20Run:\x20ranger\x20skillup','\x20--opencode','log','/skills/','AmIWc','Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20(','user','\x20<your-api-token>','27xXPUsE','NsbJl','\x0a📦\x20Installing\x20skills...\x0a','\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','/.opencode/skills/','autoInstall','ranger','386508cMqlEP','2adDZrq','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','suppressUsage','hfCZq','150392jogfCO','1964488NvbNIG','prompt','61378xIRGzG','Ohbjd','UgAqK','27cGxOkV','2501075socWir','/.claude/skills/','10kEHlSi','kCAZz'];_0x1bea=function(){return _0x38523b;};return _0x1bea();}function _0x5c3d(_0x18b6f6,_0x33d05e){_0x18b6f6=_0x18b6f6-0x6a;const _0x1beab4=_0x1bea();let _0x5c3d49=_0x1beab4[_0x18b6f6];return _0x5c3d49;}(function(_0x3e8765,_0x28a5dd){const _0x5182c5=_0x5c3d,_0x58aa47=_0x3e8765();while(!![]){try{const _0x4defa0=parseInt(_0x5182c5(0x79))/0x1*(-parseInt(_0x5182c5(0x72))/0x2)+parseInt(_0x5182c5(0x7c))/0x3*(parseInt(_0x5182c5(0x71))/0x4)+parseInt(_0x5182c5(0x7d))/0x5+parseInt(_0x5182c5(0x8a))/0x6+-parseInt(_0x5182c5(0x8b))/0x7+parseInt(_0x5182c5(0x77))/0x8*(-parseInt(_0x5182c5(0x6a))/0x9)+-parseInt(_0x5182c5(0x7f))/0xa*(parseInt(_0x5182c5(0x76))/0xb);if(_0x4defa0===_0x28a5dd)break;else _0x58aa47['push'](_0x58aa47['shift']());}catch(_0x12c8d9){_0x58aa47['push'](_0x58aa47['shift']());}}}(_0x1bea,0x9b41b));import{basename}from'path';import _0x2d0b18 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(_0x43336b={}){const _0x1773b7=_0x5c3d,_0x1d5354={'jYqnX':_0x1773b7(0x73),'gnFVG':'\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','Ohbjd':'opencode','tXxbo':function(_0x20cdec,_0x2733a1){return _0x20cdec===_0x2733a1;},'UgAqK':'✓\x20Found\x20API\x20token','KZaKq':function(_0x29ccdd){return _0x29ccdd();},'rbYUv':function(_0x3850ea,_0x5c725f){return _0x3850ea(_0x5c725f);},'hfCZq':_0x1773b7(0x93),'ZYZQb':'list','RlChL':_0x1773b7(0x85),'AmIWc':'project','OXBfz':function(_0x2f6134){return _0x2f6134();},'Pmzwu':_0x1773b7(0x81),'NsbJl':function(_0x116574,_0x2a5718){return _0x116574>_0x2a5718;},'iaJBb':'project-level','kCAZz':'\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['log'](_0x1773b7(0x6d));const _0x32684a=_0x43336b[_0x1773b7(0x82)]??'claude',_0x39eeb0=await getToken();if(!_0x39eeb0){console[_0x1773b7(0x8f)](_0x1d5354['jYqnX']),console['log'](_0x1773b7(0x89)),console['log'](_0x1d5354['gnFVG']),console['log']('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0x32684a===_0x1d5354[_0x1773b7(0x7a)]?'\x20--opencode':'')+_0x1773b7(0x94)),console[_0x1773b7(0x8f)](_0x1773b7(0x8d)+(_0x1d5354['tXxbo'](_0x32684a,_0x1773b7(0x83))?_0x1773b7(0x8e):'')+'\x0a');return;}console['log'](_0x1d5354[_0x1773b7(0x7b)]);const _0x3f7703=_0x1d5354[_0x1773b7(0x88)](getProjectRoot),_0x5c7418=basename(_0x3f7703),_0x5d9034=_0x1d5354[_0x1773b7(0x86)](_0x32684a,_0x1d5354['Ohbjd'])?_0x1d5354['rbYUv'](getOpencodeConfigDir,_0x1d5354[_0x1773b7(0x75)])+_0x1773b7(0x90):getClaudeConfigDir()+'/skills/',_0x5463a9=_0x1d5354['tXxbo'](_0x32684a,'opencode')?_0x3f7703+_0x1773b7(0x6e):_0x3f7703+_0x1773b7(0x7e),_0x1bfb32=process['stdin']['isTTY']&&process['stdout']['isTTY'];let _0xf363d1;if(_0x43336b['autoInstall'])_0xf363d1=_0x43336b[_0x1773b7(0x6f)];else{if(_0x1bfb32){const _0x83ef4a=await _0x2d0b18[_0x1773b7(0x78)]([{'type':_0x1d5354['ZYZQb'],'name':_0x1d5354['RlChL'],'message':'Where\x20should\x20skills\x20be\x20installed?','choices':[{'name':'All\x20projects\x20('+_0x5d9034+')','value':'user'},{'name':'This\x20project\x20only\x20('+_0x5463a9+')','value':_0x1d5354[_0x1773b7(0x91)]}]}]);_0xf363d1=_0x83ef4a[_0x1773b7(0x85)];}else _0xf363d1=_0x1d5354['AmIWc'],console['log'](_0x1773b7(0x92)+_0x5463a9+')');}let _0x392631=0x0;const _0x3a42dd=_0x1d5354['OXBfz'](getCurrentVersion);console['log'](_0x1773b7(0x6c));try{const _0x548c64=await installSkill(_0x1773b7(0x70),{'cliVersion':_0x3a42dd,'level':_0xf363d1,'platform':_0x32684a});_0x548c64&&_0x392631++;}catch(_0x49c9ea){console['warn'](_0x1d5354['Pmzwu'],_0x49c9ea instanceof Error?_0x49c9ea['message']:_0x49c9ea);}if(_0x1d5354[_0x1773b7(0x6b)](_0x392631,0x0)){const _0x3db22e=_0xf363d1==='user'?'user-level':_0x1d5354[_0x1773b7(0x84)];console['log']('\x0a✅\x20Installed\x20'+_0x392631+'\x20'+_0x3db22e+'\x20skill'+(_0x392631>0x1?'s':'')+'\x20successfully!\x0a'),!_0x43336b[_0x1773b7(0x74)]&&(console['log'](_0x1773b7(0x8c)),_0x32684a===_0x1d5354[_0x1773b7(0x7a)]?console[_0x1773b7(0x8f)](_0x1773b7(0x87)):console['log'](_0x1d5354[_0x1773b7(0x80)]));}else console['log']('\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a');}
@@ -1 +1 @@
1
- const _0x4c87d1=_0xc11a;(function(_0xc38d6,_0x53665b){const _0x34f9ca=_0xc11a,_0x3c6d58=_0xc38d6();while(!![]){try{const _0x4dc06a=-parseInt(_0x34f9ca(0x194))/0x1*(parseInt(_0x34f9ca(0x185))/0x2)+-parseInt(_0x34f9ca(0x1b6))/0x3+-parseInt(_0x34f9ca(0x1d0))/0x4*(parseInt(_0x34f9ca(0x1b7))/0x5)+-parseInt(_0x34f9ca(0x181))/0x6+parseInt(_0x34f9ca(0x19c))/0x7*(parseInt(_0x34f9ca(0x1ef))/0x8)+parseInt(_0x34f9ca(0x199))/0x9+parseInt(_0x34f9ca(0x1f0))/0xa;if(_0x4dc06a===_0x53665b)break;else _0x3c6d58['push'](_0x3c6d58['shift']());}catch(_0x42e7f4){_0x3c6d58['push'](_0x3c6d58['shift']());}}}(_0x226a,0x4de0a));import{mkdir,writeFile}from'fs/promises';import{join}from'path';function _0x226a(){const _0x5d14e1=['resolve','Validating\x20API\x20token...','force','\x0aInstalling\x20Chromium\x20browser...\x0a','pQOpw','\x1b[0m','scope','git_check','Authentication\x20failed:\x20','evHlP','You\x20can\x20install\x20it\x20manually\x20by\x20running:','dHoQl','KmObV','profile','KnclH','Non-interactive\x20mode:\x20Skipping\x20profile\x20setup.\x20To\x20set\x20up\x20a\x20profile,\x20pass\x20--url\x20or\x20run\x20later:','1336hPVGTS','13081180NUlGkG','wspRe','warn','\x20now?','confirm','log','cRpVW','executablePath','dOpcP','stdout','tpSyU','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','trackPhaseEnd','stdin','✓\x20Local\x20profile\x20already\x20exists','KkxHe','\x0a✅\x20You\x27re\x20ready\x20to\x20start\x20using\x20Ranger\x20Feature\x20Review.','message','3529380sdVrRU','IqBaR','chromium','platform','280HaHUxe','win32','AHBpe','scdMl','prompt','BGUSU','install','--with-deps','CrRto','EuQux','\x0a❌\x20Profile\x20setup\x20failed:','eNecy','YzyUA','tJMnf','llaRQ','2117QbBiGa','YSECI','gGlUq','...','XibKL','356778oCEQnQ','iYQTU','\x0aIn\x20Claude\x20Code,\x20run\x20','15211bqSVHd','The\x20required\x20version\x20(','OpkOy','skipAuth',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','withDeps','\x1b[1m','FYHBk','kWtfB','✓\x20Created\x20.ranger/\x20directory','WulAf','Non-interactive\x20mode:\x20No\x20--scope\x20provided,\x20defaulting\x20to\x20user.','1.58.2','plugin','playwright@','nYDdH','skipChromium','zVQNE','skills','version','fiXBr','gHcAH','Make\x20sure\x20your\x20app\x20is\x20running\x20before\x20you\x20start.\x0a','Nglbe','\x20and\x20prompt\x20the\x20coding','PAemA','721737SETEht','666190gtWotM','error','opencode','\x0aIn\x20order\x20for\x20Ranger\x20to\x20verify\x20your\x20work,\x20you\x27ll\x20need\x20to\x20set\x20up\x20a\x20profile\x20later\x20with:','SmGlu','shcsx','SRCfC','\x0a⚠\x20Skipping\x20Chromium\x20installation.','iQvdZ','ready','\x0a\x0a#\x20Ignore\x20local-only\x20directories\x0alocal/\x0asessions/\x0abug-bashes/\x0areports/\x0afeedback-images/\x0a\x0aactive-profile.txt\x0aactive-feature.txt\x0a.gitignore\x0a\x0a#\x20Ignore\x20plaintext\x20auth\x20files\x20(encrypted\x20.enc\x20files\x20are\x20safe\x20to\x20commit)\x0a**/auth.json\x0a','ranger\x20profile\x20add\x20local','OpBZp','kzqQV','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','user','✓\x20Created\x20.ranger/.gitignore','kunpp','skipped','url','trackPhaseStart','⚠\x20No\x20git\x20repository\x20found.\x20Run\x20`ranger\x20profile\x20add\x20local`\x20from\x20your\x20project\x20directory.','isTTY','fZDLx','allowInsecureLocalhost','8yMTJnL','env','organizationName','GNyGo','QcIbD','auth,\x20you\x20can\x20log\x20in\x20and\x20we\x27ll\x20save\x20the\x20session\x20state\x20for\x20Ranger\x20to','success','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','\x20install\x20chromium','local','wantsProfile','Installation\x20failed\x20with\x20exit\x20code\x20','\x0a🚀\x20Ranger\x20Setup\x0a','✓\x20Already\x20authenticated\x20to\x20','XKLST'];_0x226a=function(){return _0x5d14e1;};return _0x226a();}import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';function _0xc11a(_0x2bbc06,_0x13f10f){_0x2bbc06=_0x2bbc06-0x17b;const _0x226a99=_0x226a();let _0xc11a25=_0x226a99[_0x2bbc06];return _0xc11a25;}import _0xe70602 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerDir,getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION=_0x4c87d1(0x1a8);const bold=_0x28bd97=>_0x4c87d1(0x1a2)+_0x28bd97+_0x4c87d1(0x1e4);export function getPlaywrightVersion(){const _0x528d50=_0x4c87d1,_0x11ba46={'GNyGo':'playwright/package.json'};try{const _0x2bd6d9=require[_0x528d50(0x1df)](_0x11ba46[_0x528d50(0x1d3)]),_0xefdb18=require(_0x2bd6d9);return _0xefdb18[_0x528d50(0x1af)];}catch{return null;}}export function installChromiumBinary(_0x147623,_0x1c341f=![]){const _0x5800ff=_0x4c87d1,_0x52a8a0={'dHoQl':'install','gyUaW':_0x5800ff(0x18c),'kzqQV':function(_0x1fdf7b,_0x4d08b5,_0x3ac242,_0x10a5e5){return _0x1fdf7b(_0x4d08b5,_0x3ac242,_0x10a5e5);},'tpSyU':'inherit','dOpcP':'close','gxIab':'error'};return new Promise((_0xac7fe3,_0x1c5ad3)=>{const _0x437f17=_0x5800ff,_0x1d953d=[_0x437f17(0x1aa)+_0x147623,_0x52a8a0[_0x437f17(0x1ea)],..._0x1c341f?[_0x52a8a0['gyUaW']]:[],'chromium'],_0x40686d=_0x52a8a0[_0x437f17(0x1c4)](spawn,'npx',_0x1d953d,{'stdio':['ignore',_0x52a8a0['tpSyU'],_0x52a8a0[_0x437f17(0x1fa)]],'shell':process[_0x437f17(0x184)]===_0x437f17(0x186)});_0x40686d['on'](_0x52a8a0[_0x437f17(0x1f8)],_0x164e54=>{const _0x210efa=_0x437f17;_0x164e54===0x0?_0xac7fe3():_0x1c5ad3(new Error(_0x210efa(0x1db)+_0x164e54));}),_0x40686d['on'](_0x52a8a0['gxIab'],_0x414f2a=>{_0x1c5ad3(_0x414f2a);});});}export async function authenticate(_0x250886){const _0x3d39ee=_0x4c87d1,_0x47ee64={'WKLuR':function(_0x1a9a7d,_0x3c146a){return _0x1a9a7d instanceof _0x3c146a;},'KnclH':'device_auth','tJMnf':_0x3d39ee(0x1e0),'fZDLx':'✓\x20Exported\x20credentials\x20for\x20CI','XibKL':'✓\x20Stored\x20credentials\x20locally','iQvdZ':'provided_token'};if(!_0x250886){const _0x3d13c2=await getToken();if(_0x3d13c2){const _0x2124b9=await getCurrentUser(_0x3d13c2);if(_0x2124b9['success'])return console[_0x3d39ee(0x1f5)](_0x3d39ee(0x1dd)+_0x2124b9[_0x3d39ee(0x1c6)]['organizationName']),{'token':_0x3d13c2,'method':'existing_token'};}try{_0x250886=await runDeviceAuthFlow();}catch(_0x465e9f){throw new Error('Authentication\x20failed:\x20'+(_0x47ee64['WKLuR'](_0x465e9f,Error)?_0x465e9f[_0x3d39ee(0x180)]:_0x465e9f));}const _0x39259b=await getCurrentUser(_0x250886);if(!_0x39259b['success'])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x39259b['error']);return console[_0x3d39ee(0x1f5)]('✓\x20Authenticated\x20to\x20'+_0x39259b['user'][_0x3d39ee(0x1d2)]),{'token':_0x250886,'method':_0x47ee64[_0x3d39ee(0x1ed)]};}console[_0x3d39ee(0x1f5)](_0x47ee64[_0x3d39ee(0x192)]);const _0x4fb80a=await getCurrentUser(_0x250886);if(!_0x4fb80a[_0x3d39ee(0x1d6)]){if(_0x4fb80a['status'])throw new Error(_0x3d39ee(0x1e7)+_0x4fb80a[_0x3d39ee(0x1b8)]+_0x3d39ee(0x1fb));else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x4fb80a[_0x3d39ee(0x1b8)]+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console['log']('✓\x20Authenticated\x20to\x20'+_0x4fb80a[_0x3d39ee(0x1c6)][_0x3d39ee(0x1d2)]),await storeToken(_0x250886),console['log'](process[_0x3d39ee(0x1d1)]['GITHUB_ENV']?_0x47ee64[_0x3d39ee(0x1ce)]:_0x47ee64[_0x3d39ee(0x198)]),{'token':_0x250886,'method':_0x47ee64[_0x3d39ee(0x1bf)]};}export async function ensureRangerDir(_0x4056ca){const _0x1381ea=_0x4c87d1,_0xf672a7={'BtgtA':'user','BGUSU':function(_0x5bc13d){return _0x5bc13d();},'evHlP':function(_0x3c3c0f){return _0x3c3c0f();},'KOdYY':'.ranger','YSECI':function(_0x2aaabd,_0xb42e05,_0x27288b){return _0x2aaabd(_0xb42e05,_0x27288b);},'wspRe':_0x1381ea(0x1a5),'gHcAH':'✓\x20.ranger/\x20directory\x20already\x20exists'};let _0x15f356;if(_0x4056ca===_0xf672a7['BtgtA'])_0x15f356=_0xf672a7[_0x1381ea(0x18a)](getRangerHomeDir);else{const _0x69b454=_0xf672a7[_0x1381ea(0x1e8)](findGitRoot);_0x15f356=_0x69b454?join(_0x69b454,_0xf672a7['KOdYY']):getRangerDir();}return!existsSync(_0x15f356)?(await _0xf672a7[_0x1381ea(0x195)](mkdir,_0x15f356,{'recursive':!![]}),console['log'](_0xf672a7[_0x1381ea(0x1f1)]),{'path':_0x15f356,'installed':!![]}):(console['log'](_0xf672a7[_0x1381ea(0x1b1)]),{'path':_0x15f356,'installed':![]});}export async function ensureChromium(_0x1de258=![]){const _0x1501b5=_0x4c87d1,_0xf3d612={'Nglbe':function(_0x5a16d2,_0x13630d){return _0x5a16d2(_0x13630d);},'nYDdH':function(_0x5e8045,_0xe7fdb6){return _0x5e8045??_0xe7fdb6;},'scdMl':'confirm','OpBZp':_0x1501b5(0x1e2),'XKLST':function(_0x3ac00c,_0x4b590c,_0x550c25){return _0x3ac00c(_0x4b590c,_0x550c25);},'SmGlu':'\x0a❌\x20Failed\x20to\x20install\x20Chromium:','uOmKR':function(_0x49ef27,_0x4d8fd5){return _0x49ef27 instanceof _0x4d8fd5;},'YzyUA':_0x1501b5(0x1e9),'yaIuP':_0x1501b5(0x1be),'WulAf':'You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'};let _0x594037=![];try{const _0x519282=chromium[_0x1501b5(0x1f7)]();_0x594037=_0xf3d612[_0x1501b5(0x1b3)](existsSync,_0x519282);}catch{_0x594037=![];}if(_0x594037)return console['log']('✓\x20Playwright\x20Chromium\x20browser\x20found'),![];const _0xacf7c1=getPlaywrightVersion(),_0x468ad8=_0xf3d612[_0x1501b5(0x1ab)](_0xacf7c1,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x719354=!_0xacf7c1,_0x304197=process[_0x1501b5(0x17c)]['isTTY']&&process[_0x1501b5(0x1f9)]['isTTY'];let _0xf127a4=!![];if(_0x304197){const {install:_0x3fc377}=await _0xe70602[_0x1501b5(0x189)]([{'type':_0xf3d612[_0x1501b5(0x188)],'name':_0x1501b5(0x18b),'message':_0x719354?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x468ad8+_0x1501b5(0x1f3):_0x1501b5(0x19d)+_0x468ad8+_0x1501b5(0x1a0),'default':!![]}]);_0xf127a4=_0x3fc377;}else console[_0x1501b5(0x1f5)]('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x468ad8+(_0x719354?'\x20(fallback\x20version)':'')+_0x1501b5(0x197));if(_0xf127a4){console['log'](_0xf3d612[_0x1501b5(0x1c3)]);try{await _0xf3d612[_0x1501b5(0x1de)](installChromiumBinary,_0x468ad8,_0x1de258),console['log'](_0x1501b5(0x1c5));}catch(_0xefd230){console['error'](_0xf3d612[_0x1501b5(0x1bb)],_0xf3d612['uOmKR'](_0xefd230,Error)?_0xefd230[_0x1501b5(0x180)]:_0xefd230),console[_0x1501b5(0x1f5)](_0xf3d612[_0x1501b5(0x191)]),console['log']('\x20\x20npx\x20playwright@'+_0x468ad8+_0x1501b5(0x1d8));}}else console['log'](_0xf3d612['yaIuP']),console[_0x1501b5(0x1f5)](_0xf3d612[_0x1501b5(0x1a6)]),console[_0x1501b5(0x1f5)]('\x20\x20npx\x20playwright@'+_0x468ad8+_0x1501b5(0x1d8));return!![];}export async function writeRangerGitignore(_0x17f374){const _0x59f312=_0x4c87d1,_0x4e226a={'SRCfC':function(_0x1dc4fc,_0x36d5b6,_0x53d645){return _0x1dc4fc(_0x36d5b6,_0x53d645);}},_0x34dd46=_0x4e226a[_0x59f312(0x1bd)](join,_0x17f374,'.gitignore'),_0x438839=_0x59f312(0x1c1);await writeFile(_0x34dd46,_0x438839),console['log'](_0x59f312(0x1c7));}function printProfileSetupLaterInstructions(){const _0x22b5c4=_0x4c87d1,_0x547a98={'krMRm':_0x22b5c4(0x1ba),'bXQKo':'ranger\x20profile\x20add\x20local'};console['log'](_0x547a98['krMRm']),console[_0x22b5c4(0x1f5)]('\x20\x20'+bold(_0x547a98['bXQKo'])),console['log'](_0x22b5c4(0x1b2));}export async function ensureLocalEnv(_0x1bfdfb,_0x3faf70){const _0x21d0b=_0x4c87d1,_0x188d5e={'shcsx':function(_0x5b972a){return _0x5b972a();},'OpkOy':_0x21d0b(0x1cc),'ItPkb':function(_0x474a31,_0x3377f8){return _0x474a31===_0x3377f8;},'zcYNI':function(_0x4e3a12,_0x3a6b62,_0x437554){return _0x4e3a12(_0x3a6b62,_0x437554);},'CrRto':_0x21d0b(0x1d9),'hRaPD':'\x0aA\x20profile\x20gives\x20Ranger\x27s\x20browser\x20agent\x20information\x20about\x20how','QcRuR':'to\x20access\x20your\x20app.\x20If\x20the\x20part\x20of\x20your\x20app\x20you\x20want\x20to\x20test\x20is\x20behind','eNecy':'use\x20until\x20the\x20session\x20expires.\x0a','zVQNE':'Would\x20you\x20like\x20to\x20set\x20up\x20the\x20profile\x20now?','pQOpw':_0x21d0b(0x18f)};if(!_0x188d5e[_0x21d0b(0x1bc)](findGitRoot))return console['log'](_0x188d5e[_0x21d0b(0x19e)]),{'ready':![],'skipped':!![]};const _0x2994f6=_0x188d5e['ItPkb'](_0x1bfdfb?.['scope'],_0x21d0b(0x1c6))?_0x188d5e[_0x21d0b(0x1bc)](getRangerHomeDir):undefined;if(_0x188d5e['zcYNI'](findExistingEnv,_0x21d0b(0x1d9),{'locations':[_0x188d5e[_0x21d0b(0x18d)]],'rangerDir':_0x2994f6}))return console['log'](_0x21d0b(0x17d)),{'ready':!![],'skipped':![]};const _0x956d79=process['stdin'][_0x21d0b(0x1cd)]&&process['stdout'][_0x21d0b(0x1cd)];if(_0x956d79&&!_0x1bfdfb?.['url']){console[_0x21d0b(0x1f5)](_0x188d5e['hRaPD']),console[_0x21d0b(0x1f5)](_0x188d5e['QcRuR']),console[_0x21d0b(0x1f5)](_0x21d0b(0x1d5)),console[_0x21d0b(0x1f5)](_0x188d5e[_0x21d0b(0x190)]),console[_0x21d0b(0x1f5)]('You\x27ll\x20need\x20the\x20app\x20to\x20be\x20running\x20to\x20set\x20up\x20the\x20profile.');const {wantsProfile:_0x4c59aa}=await _0xe70602[_0x21d0b(0x189)]([{'type':_0x21d0b(0x1f4),'name':_0x21d0b(0x1da),'message':_0x188d5e[_0x21d0b(0x1ad)],'default':!![]}]);if(!_0x4c59aa)return printProfileSetupLaterInstructions(),{'ready':![],'skipped':!![]};}try{return await addEnv(_0x188d5e[_0x21d0b(0x18d)],{'url':_0x1bfdfb?.[_0x21d0b(0x1ca)],'force':_0x1bfdfb?.[_0x21d0b(0x1e1)],'allowInsecureLocalhost':_0x1bfdfb?.[_0x21d0b(0x1cf)],'scope':_0x1bfdfb?.[_0x21d0b(0x1e5)]},_0x3faf70),{'ready':!![],'skipped':![]};}catch(_0x21abdf){return console[_0x21d0b(0x1b8)](_0x188d5e[_0x21d0b(0x1e3)],_0x21abdf instanceof Error?_0x21abdf['message']:_0x21abdf),_0x188d5e[_0x21d0b(0x1bc)](printProfileSetupLaterInstructions),{'ready':![],'skipped':![]};}}export async function start(_0x41b724,_0x64b222,_0x2806b5){const _0x2b30f5=_0x4c87d1,_0x3cc94e={'gGlUq':function(_0x1ea920,_0x15e196){return _0x1ea920===_0x15e196;},'PAemA':'user','IqBaR':_0x2b30f5(0x1e6),'fiXBr':'No\x20git\x20repository\x20found.\x20Please\x20run\x20`ranger\x20setup`\x20from\x20inside\x20your\x20project\x20directory,\x0a','SKdVW':'or\x20use\x20--scope\x20user\x20to\x20install\x20at\x20the\x20user\x20level\x20without\x20a\x20project.','JQZPE':function(_0x3a9fca){return _0x3a9fca();},'KkxHe':'auth','llaRQ':function(_0x48038f,_0x45bf29){return _0x48038f(_0x45bf29);},'zHtjw':'\x0a✅\x20Ranger\x20setup\x20complete!\x0a','FYHBk':'plugin','EuQux':function(_0x43c193,_0x34b793){return _0x43c193(_0x34b793);},'QcIbD':function(_0x11d36b,_0x52fa57){return _0x11d36b&&_0x52fa57;},'cRpVW':'ranger','rysvD':'\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','XkDlb':'\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','kunpp':_0x2b30f5(0x1ec),'kWtfB':'with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','KmObV':'verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','AHBpe':function(_0xcbb3db,_0x2b2dc2){return _0xcbb3db(_0x2b2dc2);},'iYQTU':'/ranger:enable'};console['log'](_0x2b30f5(0x1dc));const _0x274282=process['stdin']['isTTY']&&process[_0x2b30f5(0x1f9)][_0x2b30f5(0x1cd)];!_0x274282&&!_0x64b222?.['scope']&&(console['log'](_0x2b30f5(0x1a7)),_0x64b222={..._0x64b222,'scope':'user'});const _0x53125f=_0x3cc94e[_0x2b30f5(0x196)](_0x64b222?.[_0x2b30f5(0x1e5)],_0x3cc94e[_0x2b30f5(0x1b5)]);_0x2806b5?.[_0x2b30f5(0x1cb)](_0x3cc94e[_0x2b30f5(0x182)]);const _0x30c6c8=findGitRoot();if(!_0x30c6c8&&!_0x53125f){await _0x2806b5?.['trackPhaseError']('git_check',new Error('No\x20git\x20repository\x20found'));throw new Error(_0x3cc94e[_0x2b30f5(0x1b0)]+_0x3cc94e['SKdVW']);}_0x2806b5?.['trackPhaseEnd'](_0x3cc94e['IqBaR']);const _0x5433a0=!existsSync(_0x3cc94e['JQZPE'](getRangerDir)),{path:_0x29f74b}=await ensureRangerDir(_0x53125f?_0x2b30f5(0x1c6):undefined);if(_0x64b222?.[_0x2b30f5(0x19f)])console[_0x2b30f5(0x1f5)]('✓\x20Skipping\x20authentication\x20(--skip-auth)'),_0x2806b5?.['trackPhaseEnd'](_0x3cc94e['KkxHe'],{'isFirstRun':_0x5433a0,'method':'skipped'});else{_0x2806b5?.['trackPhaseStart'](_0x3cc94e['KkxHe']);const _0x4941db=await _0x3cc94e[_0x2b30f5(0x193)](authenticate,_0x41b724);_0x2806b5?.[_0x2b30f5(0x17b)](_0x3cc94e[_0x2b30f5(0x17e)],{'isFirstRun':_0x5433a0,'method':_0x4941db['method']});}_0x2806b5?.['trackPhaseStart'](_0x2b30f5(0x183));_0x64b222?.['skipChromium']?console['log']('✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)'):await _0x3cc94e['llaRQ'](ensureChromium,_0x64b222?.[_0x2b30f5(0x1a1)]);_0x2806b5?.[_0x2b30f5(0x17b)](_0x2b30f5(0x183),{'isFirstRun':_0x5433a0,'skipped':!!_0x64b222?.[_0x2b30f5(0x1ac)]});!_0x53125f&&await writeRangerGitignore(_0x29f74b);console[_0x2b30f5(0x1f5)](_0x3cc94e['zHtjw']);const _0x2388ba=_0x64b222?.[_0x2b30f5(0x1e5)],_0x5e6109=_0x64b222?.[_0x2b30f5(0x1b9)]??![];let _0x7eccbb=null;_0x5e6109?(_0x2806b5?.['trackPhaseStart'](_0x3cc94e[_0x2b30f5(0x1a3)]),_0x7eccbb=await _0x3cc94e[_0x2b30f5(0x18e)](ensureOpencodePluginConfig,_0x2388ba),_0x2806b5?.[_0x2b30f5(0x17b)]('plugin',{'isFirstRun':_0x5433a0,'opencode':!![]})):(_0x2806b5?.['trackPhaseStart'](_0x3cc94e['FYHBk']),await ensureClaudePlugin(_0x2388ba),_0x2806b5?.[_0x2b30f5(0x17b)](_0x2b30f5(0x1a9),{'isFirstRun':_0x5433a0}));if(_0x3cc94e[_0x2b30f5(0x1d4)](_0x5e6109,_0x7eccbb)){_0x2806b5?.[_0x2b30f5(0x1cb)](_0x2b30f5(0x1ae));try{await installSkill(_0x3cc94e[_0x2b30f5(0x1f6)],{'level':_0x7eccbb['scope'],'cliVersion':_0x3cc94e['JQZPE'](getCurrentVersion),'platform':'opencode'}),_0x2806b5?.[_0x2b30f5(0x17b)]('skills',{'isFirstRun':_0x5433a0,'opencode':!![]});}catch(_0x52ba6c){console[_0x2b30f5(0x1f2)](_0x3cc94e['rysvD'],_0x52ba6c instanceof Error?_0x52ba6c['message']:_0x52ba6c),_0x2806b5?.['trackPhaseEnd']('skills',{'isFirstRun':_0x5433a0,'opencode':!![],'failed':!![]});}}else _0x2806b5?.['trackPhaseStart'](_0x2b30f5(0x1ae)),await ensureClaudeSkills(_0x2388ba),_0x2806b5?.['trackPhaseEnd']('skills',{'isFirstRun':_0x5433a0});if(_0x64b222?.['skipAuth'])console['log'](_0x3cc94e['XkDlb']);else{if(!_0x274282&&!_0x64b222?.['url'])console['log'](_0x2b30f5(0x1ee)),console['log']('\x20\x20'+bold(_0x2b30f5(0x1c2))+'\x0a');else{_0x2806b5?.['trackPhaseStart']('profile');const _0x429803=await ensureLocalEnv({'url':_0x64b222?.[_0x2b30f5(0x1ca)],'force':_0x64b222?.['force'],'allowInsecureLocalhost':_0x64b222?.[_0x2b30f5(0x1cf)],'scope':_0x3cc94e['gGlUq'](_0x64b222?.['scope'],_0x3cc94e[_0x2b30f5(0x1b5)])?'user':undefined},_0x2806b5);_0x2806b5?.[_0x2b30f5(0x17b)](_0x3cc94e[_0x2b30f5(0x1c8)],{'isFirstRun':_0x5433a0,'profileReady':_0x429803[_0x2b30f5(0x1c0)],'userSkipped':_0x429803[_0x2b30f5(0x1c9)]}),_0x429803['ready']&&console[_0x2b30f5(0x1f5)](_0x2b30f5(0x17f));}}if(_0x5e6109)console[_0x2b30f5(0x1f5)]('\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)'),console[_0x2b30f5(0x1f5)]('and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review'),console['log'](_0x3cc94e[_0x2b30f5(0x1a4)]),console[_0x2b30f5(0x1f5)](_0x3cc94e[_0x2b30f5(0x1eb)]);else{const _0x5a0e8c=_0x3cc94e[_0x2b30f5(0x187)](bold,_0x3cc94e[_0x2b30f5(0x19a)]);console['log'](_0x2b30f5(0x19b)+_0x5a0e8c+_0x2b30f5(0x1b4)+_0x2b30f5(0x1d7)+'\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'+'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.');}}
1
+ const _0x25b0a5=_0x40ef;(function(_0x4a3444,_0x12ee2f){const _0x38b496=_0x40ef,_0x89faaa=_0x4a3444();while(!![]){try{const _0xded1b3=parseInt(_0x38b496(0x171))/0x1*(-parseInt(_0x38b496(0x175))/0x2)+parseInt(_0x38b496(0x1aa))/0x3*(parseInt(_0x38b496(0x16f))/0x4)+parseInt(_0x38b496(0x1b2))/0x5+-parseInt(_0x38b496(0x1a6))/0x6*(-parseInt(_0x38b496(0x19d))/0x7)+parseInt(_0x38b496(0x182))/0x8+-parseInt(_0x38b496(0x19a))/0x9+-parseInt(_0x38b496(0x1c6))/0xa*(parseInt(_0x38b496(0x16d))/0xb);if(_0xded1b3===_0x12ee2f)break;else _0x89faaa['push'](_0x89faaa['shift']());}catch(_0x1f6f38){_0x89faaa['push'](_0x89faaa['shift']());}}}(_0x59f8,0x99de5));function _0x40ef(_0x2842e8,_0x55aaa3){_0x2842e8=_0x2842e8-0x165;const _0x59f8a5=_0x59f8();let _0x40ef28=_0x59f8a5[_0x2842e8];return _0x40ef28;}import{mkdir,writeFile}from'fs/promises';function _0x59f8(){const _0x23611=['sSndd','GITHUB_ENV','FWowZ','vzxSY','Qfacj','\x0a⚠\x20Skipping\x20Chromium\x20installation.','XuGZY','66NfEXVg','message','12nSfNaM','mIwwY','601357jSdxzH','\x0aTo\x20verify\x20with\x20a\x20browser,\x20set\x20','log','jCfzs','2PPxtTk','✓\x20Playwright\x20Chromium\x20browser\x20found','GljQY','LoiKd','user','confirm','executablePath','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','chromium','version','/ranger:enable','\x20install\x20chromium','skipAuth','9749120iMutbJ','\x0a\x20\x20your\x20org\x27s\x20auth\x20config\x20drives\x20which\x20flow\x20runs.','VqJvv','ranger\x20profile\x20add','PhuXb','gTpKO','✓\x20Skipping\x20authentication\x20(--skip-auth)','plugin','FeWZA','force','xDIJj','aNOKH','trackPhaseEnd','\x0a❌\x20Profile\x20setup\x20failed:','DxMrY','tsRfd','WmIYP','env','scope','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','Installation\x20failed\x20with\x20exit\x20code\x20','QhQrw','\x0a🚀\x20Ranger\x20Setup\x0a','2191410DHYPIc','resolve','skipped','3899mOoDcb','Authentication\x20failed:\x20','trackPhaseStart','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','opencode','YYyNT','.gitignore','lobYW','dsLOl','114UKQRaR','platform','url','✓\x20Created\x20~/.ranger/\x20directory','902346unrBAZ','ranger','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','jbLyT','nThFB','withDeps','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','\x0aInstalling\x20Chromium\x20browser...\x0a','4705805mqyGSr','mLGrP','✓\x20Local\x20profile\x20already\x20exists','method','sFZLC','\x20and\x20prompt\x20the\x20coding','playwright@','prompt','npx','nNEaD','\x20now?','ready','isTTY','error','1.58.2','RANGER_TEST_USERNAME','qeebO',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','skipChromium','auth','2662730MMiDEo','\x20(fallback\x20version)','success','local','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','organizationName','allowInsecureLocalhost'];_0x59f8=function(){return _0x23611;};return _0x59f8();}import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x184441 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION=_0x25b0a5(0x1c0);const bold=_0x1961bb=>'\x1b[1m'+_0x1961bb+'\x1b[0m';export function getPlaywrightVersion(){const _0x5bbc62=_0x25b0a5,_0x36d764={'sSndd':function(_0x263f8c,_0x124c90){return _0x263f8c(_0x124c90);}};try{const _0x4957a0=require[_0x5bbc62(0x19b)]('playwright/package.json'),_0x3160cd=_0x36d764[_0x5bbc62(0x166)](require,_0x4957a0);return _0x3160cd[_0x5bbc62(0x17e)];}catch{return null;}}export function installChromiumBinary(_0x3ed409,_0x2f0045=![]){const _0x1a772e=_0x25b0a5,_0x1659ec={'iwhDw':function(_0x19731c,_0x58d3bd){return _0x19731c(_0x58d3bd);},'fdLge':'--with-deps','iKfqq':'chromium','YYyNT':function(_0x4dc235,_0x358376,_0x397837,_0xf5c8a0){return _0x4dc235(_0x358376,_0x397837,_0xf5c8a0);},'XcSMn':_0x1a772e(0x1ba),'pMqAN':'ignore','lobYW':'inherit','VECuD':'win32'};return new Promise((_0x1d2f0b,_0x53ea2e)=>{const _0x5c0fcc=_0x1a772e,_0x1c529f={'nNEaD':function(_0x2696c7,_0x43fd90){return _0x1659ec['iwhDw'](_0x2696c7,_0x43fd90);}},_0x32b513=[_0x5c0fcc(0x1b8)+_0x3ed409,'install',..._0x2f0045?[_0x1659ec['fdLge']]:[],_0x1659ec['iKfqq']],_0x30773f=_0x1659ec[_0x5c0fcc(0x1a2)](spawn,_0x1659ec['XcSMn'],_0x32b513,{'stdio':[_0x1659ec['pMqAN'],_0x1659ec[_0x5c0fcc(0x1a4)],_0x1659ec[_0x5c0fcc(0x1a4)]],'shell':process[_0x5c0fcc(0x1a7)]===_0x1659ec['VECuD']});_0x30773f['on']('close',_0x52894d=>{const _0x37a50c=_0x5c0fcc;_0x52894d===0x0?_0x1d2f0b():_0x1659ec['iwhDw'](_0x53ea2e,new Error(_0x37a50c(0x197)+_0x52894d));}),_0x30773f['on']('error',_0x26d075=>{const _0x4f3323=_0x5c0fcc;_0x1c529f[_0x4f3323(0x1bb)](_0x53ea2e,_0x26d075);});});}export async function authenticate(_0x4c9112){const _0x34f837=_0x25b0a5,_0x236ffe={'LoiKd':function(_0x43f3b4){return _0x43f3b4();},'gTpKO':function(_0x315b40,_0x5e41f8){return _0x315b40 instanceof _0x5e41f8;},'nThFB':function(_0x4b9e23,_0x4037c2){return _0x4b9e23(_0x4037c2);}};if(!_0x4c9112){const _0x4230c9=await _0x236ffe[_0x34f837(0x178)](getToken);if(_0x4230c9){const _0x11b911=await getCurrentUser(_0x4230c9);if(_0x11b911['success'])return console['log']('✓\x20Already\x20authenticated\x20to\x20'+_0x11b911[_0x34f837(0x179)]['organizationName']),{'token':_0x4230c9,'method':'existing_token'};}try{_0x4c9112=await runDeviceAuthFlow();}catch(_0x3099af){throw new Error(_0x34f837(0x19e)+(_0x236ffe[_0x34f837(0x187)](_0x3099af,Error)?_0x3099af[_0x34f837(0x16e)]:_0x3099af));}const _0x1e9a31=await _0x236ffe[_0x34f837(0x1ae)](getCurrentUser,_0x4c9112);if(!_0x1e9a31['success'])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x1e9a31[_0x34f837(0x1bf)]);return console[_0x34f837(0x173)]('✓\x20Authenticated\x20to\x20'+_0x1e9a31[_0x34f837(0x179)][_0x34f837(0x1cb)]),{'token':_0x4c9112,'method':'device_auth'};}console[_0x34f837(0x173)]('Validating\x20API\x20token...');const _0x345266=await _0x236ffe['nThFB'](getCurrentUser,_0x4c9112);if(!_0x345266[_0x34f837(0x1c8)]){if(_0x345266['status'])throw new Error(_0x34f837(0x19e)+_0x345266[_0x34f837(0x1bf)]+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x345266['error']+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console[_0x34f837(0x173)]('✓\x20Authenticated\x20to\x20'+_0x345266['user']['organizationName']),await _0x236ffe['nThFB'](storeToken,_0x4c9112),console[_0x34f837(0x173)](process[_0x34f837(0x193)][_0x34f837(0x167)]?'✓\x20Exported\x20credentials\x20for\x20CI':'✓\x20Stored\x20credentials\x20locally'),{'token':_0x4c9112,'method':'provided_token'};}export async function ensureRangerDir(_0x3e2f51){const _0x41b10e=_0x25b0a5,_0x2042e9={'jKlmA':function(_0x3d10e5,_0x4a7e57){return _0x3d10e5(_0x4a7e57);},'jbLyT':function(_0xf47e66,_0x3416e2,_0x28bd7d){return _0xf47e66(_0x3416e2,_0x28bd7d);},'tsRfd':_0x41b10e(0x1a9),'JLysE':'✓\x20~/.ranger/\x20directory\x20already\x20exists'};void _0x3e2f51;const _0xa408f9=getRangerHomeDir();return!_0x2042e9['jKlmA'](existsSync,_0xa408f9)?(await _0x2042e9[_0x41b10e(0x1ad)](mkdir,_0xa408f9,{'recursive':!![]}),console[_0x41b10e(0x173)](_0x2042e9[_0x41b10e(0x191)]),{'path':_0xa408f9,'installed':!![]}):(console['log'](_0x2042e9['JLysE']),{'path':_0xa408f9,'installed':![]});}export async function ensureChromium(_0x1c2464=![]){const _0x22fe58=_0x25b0a5,_0x520860={'qeebO':_0x22fe58(0x176),'DxMrY':function(_0x4ee378){return _0x4ee378();},'DFKdH':'install'};let _0x5ce116=![];try{const _0x44a7b7=chromium[_0x22fe58(0x17b)]();_0x5ce116=existsSync(_0x44a7b7);}catch{_0x5ce116=![];}if(_0x5ce116)return console['log'](_0x520860[_0x22fe58(0x1c2)]),![];const _0x1af643=_0x520860[_0x22fe58(0x190)](getPlaywrightVersion),_0x3b678e=_0x1af643??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x235b4f=!_0x1af643,_0x3da874=process['stdin'][_0x22fe58(0x1be)]&&process['stdout']['isTTY'];let _0x42ec6b=!![];if(_0x3da874){const {install:_0x21c91d}=await _0x184441[_0x22fe58(0x1b9)]([{'type':_0x22fe58(0x17a),'name':_0x520860['DFKdH'],'message':_0x235b4f?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x3b678e+_0x22fe58(0x1bc):'The\x20required\x20version\x20('+_0x3b678e+_0x22fe58(0x1c3),'default':!![]}]);_0x42ec6b=_0x21c91d;}else console['log']('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x3b678e+(_0x235b4f?_0x22fe58(0x1c7):'')+'...');if(_0x42ec6b){console[_0x22fe58(0x173)](_0x22fe58(0x1b1));try{await installChromiumBinary(_0x3b678e,_0x1c2464),console[_0x22fe58(0x173)]('\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully');}catch(_0x109d72){console['error']('\x0a❌\x20Failed\x20to\x20install\x20Chromium:',_0x109d72 instanceof Error?_0x109d72[_0x22fe58(0x16e)]:_0x109d72),console['log']('You\x20can\x20install\x20it\x20manually\x20by\x20running:'),console[_0x22fe58(0x173)]('\x20\x20npx\x20playwright@'+_0x3b678e+'\x20install\x20chromium');}}else console['log'](_0x22fe58(0x16b)),console['log'](_0x22fe58(0x17c)),console['log']('\x20\x20npx\x20playwright@'+_0x3b678e+_0x22fe58(0x180));return!![];}export async function writeRangerGitignore(_0xbeceec){const _0x3847b7=_0x25b0a5,_0x4cad44={'QhQrw':function(_0x5d8cad,_0x4fa39d,_0x4bc18d){return _0x5d8cad(_0x4fa39d,_0x4bc18d);}},_0x458017=join(_0xbeceec,_0x3847b7(0x1a3)),_0x21ea53='\x0a\x0a#\x20Ignore\x20local-only\x20directories\x0alocal/\x0asessions/\x0abug-bashes/\x0areports/\x0afeedback-images/\x0a\x0aactive-profile.txt\x0aactive-feature.txt\x0a.gitignore\x0a\x0a#\x20Ignore\x20plaintext\x20auth\x20files\x20(encrypted\x20.enc\x20files\x20are\x20safe\x20to\x20commit)\x0a**/auth.json\x0a';await _0x4cad44[_0x3847b7(0x198)](writeFile,_0x458017,_0x21ea53),console[_0x3847b7(0x173)]('✓\x20Created\x20.ranger/.gitignore');}export async function ensureLocalEnv(_0x1c03d0,_0x4cd50a){const _0x5b657f=_0x25b0a5,_0x128234={'JiZyL':function(_0x46011d){return _0x46011d();},'VqJvv':function(_0x8fb366,_0x3a8b83){return _0x8fb366!==_0x3a8b83;},'FeWZA':_0x5b657f(0x179),'QooKP':function(_0x27897e,_0x434982){return _0x27897e===_0x434982;},'baSrN':function(_0x55f17c,_0x2b0d8d,_0xade724,_0x485682){return _0x55f17c(_0x2b0d8d,_0xade724,_0x485682);},'izrMZ':_0x5b657f(0x1c9),'EUTse':function(_0x10f2ef,_0x435467){return _0x10f2ef instanceof _0x435467;}};if(!_0x128234['JiZyL'](findGitRoot)&&_0x128234[_0x5b657f(0x184)](_0x1c03d0?.['scope'],_0x128234[_0x5b657f(0x18a)]))return console[_0x5b657f(0x173)]('⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.'),{'ready':![],'skipped':!![]};const _0x27c0cc=_0x128234['QooKP'](_0x1c03d0?.[_0x5b657f(0x194)],_0x5b657f(0x179))?getRangerHomeDir():undefined;if(findExistingEnv(_0x5b657f(0x1c9),{'locations':['local'],'rangerDir':_0x27c0cc}))return console['log'](_0x5b657f(0x1b4)),{'ready':!![],'skipped':![]};try{return await _0x128234['baSrN'](addEnv,_0x128234['izrMZ'],{'url':_0x1c03d0?.['url'],'force':_0x1c03d0?.[_0x5b657f(0x18b)],'allowInsecureLocalhost':_0x1c03d0?.[_0x5b657f(0x165)],'scope':_0x1c03d0?.[_0x5b657f(0x194)]},_0x4cd50a),{'ready':!![],'skipped':![]};}catch(_0x3e11f7){return console[_0x5b657f(0x1bf)](_0x5b657f(0x18f),_0x128234['EUTse'](_0x3e11f7,Error)?_0x3e11f7[_0x5b657f(0x16e)]:_0x3e11f7),{'ready':![],'skipped':![]};}}export async function start(_0x429890,_0x137288,_0xf941b0){const _0xc5445f=_0x25b0a5,_0x665dc7={'sFZLC':_0xc5445f(0x199),'QrtmB':_0xc5445f(0x179),'jCfzs':function(_0x15da4f,_0x345a1b){return _0x15da4f(_0x345a1b);},'dsLOl':'auth','xDIJj':'skipped','lvqOa':'chromium','WmIYP':_0xc5445f(0x1b0),'mGWkC':_0xc5445f(0x189),'mLGrP':function(_0x1cdd5e,_0x10bec2){return _0x1cdd5e&&_0x10bec2;},'leVzg':'skills','CAuzL':function(_0x5f2b1d){return _0x5f2b1d();},'mIwwY':function(_0x18a843,_0x56a1ca,_0x2c46f4){return _0x18a843(_0x56a1ca,_0x2c46f4);},'vzxSY':'profile','aNOKH':function(_0x231686,_0x5ef2ff){return _0x231686+_0x5ef2ff;},'PhuXb':function(_0x2e5f2f,_0x1388a7){return _0x2e5f2f(_0x1388a7);},'AsLEz':_0xc5445f(0x1c1),'Qfacj':_0xc5445f(0x185),'GljQY':_0xc5445f(0x1a0),'nGvAb':_0xc5445f(0x17f),'XuGZY':function(_0x1d013f,_0x2caa5a){return _0x1d013f+_0x2caa5a;},'FWowZ':function(_0x44bf2e,_0x8b7979){return _0x44bf2e+_0x8b7979;}};console['log'](_0x665dc7[_0xc5445f(0x1b6)]),_0x137288={..._0x137288,'scope':_0x665dc7['QrtmB']};const _0x436a9b=!existsSync(getRangerHomeDir());await _0x665dc7[_0xc5445f(0x174)](ensureRangerDir,'user');if(_0x137288?.['skipAuth'])console[_0xc5445f(0x173)](_0xc5445f(0x188)),_0xf941b0?.[_0xc5445f(0x18e)](_0x665dc7[_0xc5445f(0x1a5)],{'isFirstRun':_0x436a9b,'method':_0x665dc7[_0xc5445f(0x18c)]});else{_0xf941b0?.[_0xc5445f(0x19f)](_0xc5445f(0x1c5));const _0x5b5fe5=await _0x665dc7['jCfzs'](authenticate,_0x429890);_0xf941b0?.[_0xc5445f(0x18e)](_0x665dc7[_0xc5445f(0x1a5)],{'isFirstRun':_0x436a9b,'method':_0x5b5fe5[_0xc5445f(0x1b5)]});}_0xf941b0?.[_0xc5445f(0x19f)](_0x665dc7['lvqOa']);_0x137288?.[_0xc5445f(0x1c4)]?console['log'](_0x665dc7[_0xc5445f(0x192)]):await ensureChromium(_0x137288?.[_0xc5445f(0x1af)]);_0xf941b0?.['trackPhaseEnd'](_0xc5445f(0x17d),{'isFirstRun':_0x436a9b,'skipped':!!_0x137288?.[_0xc5445f(0x1c4)]}),console[_0xc5445f(0x173)](_0xc5445f(0x1ac));const _0x1bb37e=_0x137288?.['scope'],_0x5d4cae=_0x137288?.[_0xc5445f(0x1a1)]??![];let _0x530bcd=null;_0x5d4cae?(_0xf941b0?.['trackPhaseStart'](_0x665dc7['mGWkC']),_0x530bcd=await ensureOpencodePluginConfig(_0x1bb37e),_0xf941b0?.['trackPhaseEnd'](_0xc5445f(0x189),{'isFirstRun':_0x436a9b,'opencode':!![]})):(_0xf941b0?.[_0xc5445f(0x19f)]('plugin'),await ensureClaudePlugin(_0x1bb37e),_0xf941b0?.['trackPhaseEnd'](_0xc5445f(0x189),{'isFirstRun':_0x436a9b}));if(_0x665dc7[_0xc5445f(0x1b3)](_0x5d4cae,_0x530bcd)){_0xf941b0?.[_0xc5445f(0x19f)](_0x665dc7['leVzg']);try{await installSkill(_0xc5445f(0x1ab),{'level':_0x530bcd[_0xc5445f(0x194)],'cliVersion':_0x665dc7['CAuzL'](getCurrentVersion),'platform':'opencode'}),_0xf941b0?.['trackPhaseEnd'](_0x665dc7['leVzg'],{'isFirstRun':_0x436a9b,'opencode':!![]});}catch(_0x488263){console['warn']('\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:',_0x488263 instanceof Error?_0x488263[_0xc5445f(0x16e)]:_0x488263),_0xf941b0?.['trackPhaseEnd']('skills',{'isFirstRun':_0x436a9b,'opencode':!![],'failed':!![]});}}else _0xf941b0?.[_0xc5445f(0x19f)](_0x665dc7['leVzg']),await ensureClaudeSkills(_0x1bb37e),_0xf941b0?.['trackPhaseEnd']('skills',{'isFirstRun':_0x436a9b});if(_0x137288?.[_0xc5445f(0x181)])console['log']('\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a');else{if(_0x137288?.[_0xc5445f(0x1a8)]){_0xf941b0?.[_0xc5445f(0x19f)]('profile');const _0x50ee2a=await _0x665dc7[_0xc5445f(0x170)](ensureLocalEnv,{'url':_0x137288['url'],'force':_0x137288?.['force'],'allowInsecureLocalhost':_0x137288?.[_0xc5445f(0x165)],'scope':'user'},_0xf941b0);_0xf941b0?.[_0xc5445f(0x18e)](_0x665dc7[_0xc5445f(0x169)],{'isFirstRun':_0x436a9b,'profileReady':_0x50ee2a[_0xc5445f(0x1bd)],'userSkipped':_0x50ee2a[_0xc5445f(0x19c)]});}else console[_0xc5445f(0x173)](_0x665dc7[_0xc5445f(0x18d)](_0xc5445f(0x172)+_0x665dc7[_0xc5445f(0x186)](bold,_0x665dc7['AsLEz'])+'\x20','(and\x20'+bold('RANGER_TEST_PASSWORD')+'\x20when\x20the\x20org\x27s\x20login')+'\x0a\x20\x20config\x20uses\x20username+password).\x20Orgs\x20on\x20SSO/SAML/OAuth'+'\x20may\x20need\x20a\x20one-time\x20headed\x20login\x20instead\x20—'+_0xc5445f(0x183)),console[_0xc5445f(0x173)]('\x20\x20(or\x20use\x20'+_0x665dc7['PhuXb'](bold,_0x665dc7[_0xc5445f(0x16a)])+'\x20for\x20explicit\x20profile\x20management).');}if(_0x5d4cae)console[_0xc5445f(0x173)](_0x665dc7[_0xc5445f(0x177)]),console['log'](_0xc5445f(0x196)),console['log']('with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'),console['log'](_0xc5445f(0x195));else{const _0x4c1146=_0x665dc7[_0xc5445f(0x186)](bold,_0x665dc7['nGvAb']);console[_0xc5445f(0x173)](_0x665dc7[_0xc5445f(0x16c)](_0x665dc7[_0xc5445f(0x168)]('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x4c1146+_0xc5445f(0x1b7),'\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with')+_0xc5445f(0x1ca),'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.'));}}