@ranger-testing/ranger-cli 2.0.4 → 2.0.6

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 (115) hide show
  1. package/build/cli.js +1 -914
  2. package/build/commands/addEnv.js +1 -1
  3. package/build/commands/authEncrypt.js +1 -36
  4. package/build/commands/clean.js +1 -1
  5. package/build/commands/config.js +1 -93
  6. package/build/commands/env.js +1 -98
  7. package/build/commands/feature.js +1 -653
  8. package/build/commands/hook.js +1 -33
  9. package/build/commands/hooks/autoPrompt.js +1 -32
  10. package/build/commands/hooks/disable.js +1 -33
  11. package/build/commands/hooks/enable.js +1 -58
  12. package/build/commands/hooks/exitPlanMode.js +1 -35
  13. package/build/commands/hooks/index.js +1 -12
  14. package/build/commands/hooks/output.js +1 -71
  15. package/build/commands/hooks/planReminder.js +1 -46
  16. package/build/commands/hooks/planStart.js +1 -30
  17. package/build/commands/hooks/postEdit.js +1 -43
  18. package/build/commands/hooks/preCompact.js +1 -30
  19. package/build/commands/hooks/sessionEnd.js +1 -25
  20. package/build/commands/hooks/sessionStart.js +1 -93
  21. package/build/commands/hooks/stopHook.js +1 -155
  22. package/build/commands/index.js +1 -12
  23. package/build/commands/login.js +1 -26
  24. package/build/commands/setupCi.js +1 -189
  25. package/build/commands/skillup.js +1 -80
  26. package/build/commands/start.js +1 -1
  27. package/build/commands/status.js +1 -198
  28. package/build/commands/update.js +1 -182
  29. package/build/commands/updateEnv.js +1 -1
  30. package/build/commands/useEnv.js +1 -1
  31. package/build/commands/utils/activeProfile.js +1 -76
  32. package/build/commands/utils/browserSessionsApi.js +1 -1
  33. package/build/commands/utils/claudeConfig.js +1 -73
  34. package/build/commands/utils/claudePlugin.js +1 -85
  35. package/build/commands/utils/crypto.js +1 -42
  36. package/build/commands/utils/desirePathLog.js +1 -139
  37. package/build/commands/utils/deviceAuth.js +1 -232
  38. package/build/commands/utils/environment.js +1 -65
  39. package/build/commands/utils/featureApi.js +1 -371
  40. package/build/commands/utils/featureReportGenerator.js +1 -204
  41. package/build/commands/utils/git.js +1 -44
  42. package/build/commands/utils/keychain.js +1 -1
  43. package/build/commands/utils/localAgentInstallationsApi.js +1 -1
  44. package/build/commands/utils/profileMessages.js +1 -8
  45. package/build/commands/utils/profileSetupBanner.js +1 -167
  46. package/build/commands/utils/rangerRoot.js +1 -60
  47. package/build/commands/utils/reportGenerator.js +1 -130
  48. package/build/commands/utils/retry.js +1 -25
  49. package/build/commands/utils/sessionCache.js +1 -299
  50. package/build/commands/utils/settings.js +1 -313
  51. package/build/commands/utils/skillContent.js +1 -28
  52. package/build/commands/utils/skills.js +1 -1
  53. package/build/commands/utils/telemetry.js +1 -254
  54. package/build/commands/utils/userApi.js +1 -32
  55. package/build/commands/utils/version.js +1 -62
  56. package/build/commands/verifyFeature.js +1 -1343
  57. package/build/commands/verifyInBrowser.js +1 -1
  58. package/package.json +1 -1
  59. package/build/cli.js.map +0 -1
  60. package/build/commands/addEnv.js.map +0 -1
  61. package/build/commands/authEncrypt.js.map +0 -1
  62. package/build/commands/clean.js.map +0 -1
  63. package/build/commands/config.js.map +0 -1
  64. package/build/commands/env.js.map +0 -1
  65. package/build/commands/feature.js.map +0 -1
  66. package/build/commands/hook.js.map +0 -1
  67. package/build/commands/hooks/autoPrompt.js.map +0 -1
  68. package/build/commands/hooks/disable.js.map +0 -1
  69. package/build/commands/hooks/enable.js.map +0 -1
  70. package/build/commands/hooks/exitPlanMode.js.map +0 -1
  71. package/build/commands/hooks/index.js.map +0 -1
  72. package/build/commands/hooks/output.js.map +0 -1
  73. package/build/commands/hooks/planReminder.js.map +0 -1
  74. package/build/commands/hooks/planStart.js.map +0 -1
  75. package/build/commands/hooks/postEdit.js.map +0 -1
  76. package/build/commands/hooks/preCompact.js.map +0 -1
  77. package/build/commands/hooks/sessionEnd.js.map +0 -1
  78. package/build/commands/hooks/sessionStart.js.map +0 -1
  79. package/build/commands/hooks/stopHook.js.map +0 -1
  80. package/build/commands/index.js.map +0 -1
  81. package/build/commands/login.js.map +0 -1
  82. package/build/commands/setupCi.js.map +0 -1
  83. package/build/commands/skillup.js.map +0 -1
  84. package/build/commands/start.js.map +0 -1
  85. package/build/commands/status.js.map +0 -1
  86. package/build/commands/update.js.map +0 -1
  87. package/build/commands/updateEnv.js.map +0 -1
  88. package/build/commands/useEnv.js.map +0 -1
  89. package/build/commands/utils/activeProfile.js.map +0 -1
  90. package/build/commands/utils/browserSessionsApi.js.map +0 -1
  91. package/build/commands/utils/claudeConfig.js.map +0 -1
  92. package/build/commands/utils/claudePlugin.js.map +0 -1
  93. package/build/commands/utils/crypto.js.map +0 -1
  94. package/build/commands/utils/desirePathLog.js.map +0 -1
  95. package/build/commands/utils/deviceAuth.js.map +0 -1
  96. package/build/commands/utils/environment.js.map +0 -1
  97. package/build/commands/utils/featureApi.js.map +0 -1
  98. package/build/commands/utils/featureReportGenerator.js.map +0 -1
  99. package/build/commands/utils/git.js.map +0 -1
  100. package/build/commands/utils/keychain.js.map +0 -1
  101. package/build/commands/utils/localAgentInstallationsApi.js.map +0 -1
  102. package/build/commands/utils/profileMessages.js.map +0 -1
  103. package/build/commands/utils/profileSetupBanner.js.map +0 -1
  104. package/build/commands/utils/rangerRoot.js.map +0 -1
  105. package/build/commands/utils/reportGenerator.js.map +0 -1
  106. package/build/commands/utils/retry.js.map +0 -1
  107. package/build/commands/utils/sessionCache.js.map +0 -1
  108. package/build/commands/utils/settings.js.map +0 -1
  109. package/build/commands/utils/skillContent.js.map +0 -1
  110. package/build/commands/utils/skills.js.map +0 -1
  111. package/build/commands/utils/telemetry.js.map +0 -1
  112. package/build/commands/utils/userApi.js.map +0 -1
  113. package/build/commands/utils/version.js.map +0 -1
  114. package/build/commands/verifyFeature.js.map +0 -1
  115. package/build/commands/verifyInBrowser.js.map +0 -1
@@ -1 +1 @@
1
- const _0x2f3c55=_0x306c;(function(_0x40e94b,_0x2aa088){const _0x543788=_0x306c,_0xd08cf5=_0x40e94b();while(!![]){try{const _0x5eeea4=-parseInt(_0x543788(0x161))/0x1*(-parseInt(_0x543788(0x17d))/0x2)+-parseInt(_0x543788(0x199))/0x3+parseInt(_0x543788(0x185))/0x4*(parseInt(_0x543788(0x183))/0x5)+parseInt(_0x543788(0x142))/0x6+parseInt(_0x543788(0x196))/0x7*(parseInt(_0x543788(0x166))/0x8)+-parseInt(_0x543788(0x171))/0x9*(-parseInt(_0x543788(0x16e))/0xa)+-parseInt(_0x543788(0x19d))/0xb*(parseInt(_0x543788(0x16f))/0xc);if(_0x5eeea4===_0x2aa088)break;else _0xd08cf5['push'](_0xd08cf5['shift']());}catch(_0x398b90){_0xd08cf5['push'](_0xd08cf5['shift']());}}}(_0x59ff,0x5265e));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x253b4e from'inquirer';function _0x306c(_0x51e60a,_0x365997){_0x51e60a=_0x51e60a-0x13a;const _0x59ff1a=_0x59ff();let _0x306cd1=_0x59ff1a[_0x51e60a];return _0x306cd1;}import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{skillup}from'./skillup.js';import{getRangerDir,findGitRoot}from'./utils/rangerRoot.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'./utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'./utils/claudeConfig.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';const require=createRequire(import.meta.url),bold=_0xdfa04d=>_0x2f3c55(0x158)+_0xdfa04d+_0x2f3c55(0x16b);function getPlaywrightVersion(){const _0x497345=_0x2f3c55;try{const _0x535054=require[_0x497345(0x1b6)]('playwright/package.json'),_0x529d6d=require(_0x535054);return _0x529d6d['version'];}catch{return null;}}function _0x59ff(){const _0x12afb9=['\x1b[0m','executablePath','✓\x20Created\x20.ranger/\x20directory','20ueorSm','930012EVdAdM','\x0aNext\x20steps:','1505043imIsTF','qxqmP','QcguI','✓\x20Local\x20profile\x20already\x20exists','trackPhaseStart','UOCeM','prompt','plugin','\x0a❌\x20Profile\x20setup\x20failed:','✓\x20Ranger\x20skills\x20already\x20installed','install','trailhead','10yMNltJ','deOve','XOYur','✓\x20Playwright\x20Chromium\x20browser\x20found','list','KWrig','5BvEOsS','\x0aInstalling\x20Claude\x20Code\x20plugin\x20(','190264qPtCTq','\x0aIn\x20order\x20for\x20Ranger\x20to\x20verify\x20your\x20work,\x20you\x27ll\x20need\x20to\x20set\x20up\x20a\x20profile\x20later\x20with:','enfdb','TbWzg','\x0a🚀\x20Ranger\x20Setup\x0a','wantsProfile','IvllK','Txtff','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','HJrGW','\x0a⚠\x20Skipping\x20Chromium\x20installation.','✓\x20.ranger/\x20directory\x20already\x20exists','✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','win32','ZGZOK','nUneC','The\x20required\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','7sBOxeE','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','NwtRI','217230CUivxG','skills','rwndY','\x20\x20npx\x20playwright@','121FcCjVU','error','VbraW','iBabP','ranger','NFLYD','output','✓\x20Already\x20authenticated\x20to\x20','ZKALS','skipChromium','OwWcE','confirm','\x0aYou\x20can\x20install\x20manually\x20with:','You\x27ll\x20need\x20the\x20app\x20to\x20be\x20running\x20to\x20set\x20up\x20the\x20profile.','uiflQ','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','project','organizationName','platform','push','ePkWh','local','NYgxr','log','\x20\x20\x20\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x0a','resolve','BDxoT','✓\x20Stored\x20credentials\x20locally','✓\x20Authenticated\x20to\x20','auth','stdin','iZFFk','MWJWJ','LXjfe','\x0aIn\x20Claude\x20Code,\x20run\x20','.ranger','lQzoG','GITHUB_ENV','2752902bNJojv','Make\x20sure\x20your\x20app\x20is\x20running\x20before\x20you\x20start.\x0a','✓\x20Marketplace\x20already\x20added','bvbNO','\x20\x202.\x20Run:\x20ranger\x20skillup','TyvLW','\x0a\x0a#\x20Ignore\x20local-only\x20directories\x0alocal/\x0asessions/\x0abug-bashes/\x0areports/\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','env','profile','user','WiEDw','\x20\x204.\x20Run:\x20ranger\x20profile\x20add\x20local','✓\x20Created\x20.ranger/.gitignore','success','\x20\x201.\x20Navigate\x20to\x20your\x20project\x20directory','message','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','nNlfh','pluginScope','xUkhJ','BcoLl','stdout','\x1b[1m','chromium','.gitignore','\x20and\x20prompt\x20the\x20coding','erGxw','eOHdJ','FvlZa','QVCcT','--scope','10067aZgWFr','⚠\x20No\x20git\x20repository\x20found.\x20Run\x20`ranger\x20profile\x20add\x20local`\x20from\x20your\x20project\x20directory.','Would\x20you\x20like\x20to\x20set\x20up\x20the\x20profile\x20now?','isTTY','\x0a📦\x20Claude\x20Code\x20Plugin\x0a','2970008CnWwBx','Non-interactive\x20mode\x20detected.\x20Skipping\x20optional\x20setup\x20prompts.','XpSSS','marketplace','trackPhaseEnd'];_0x59ff=function(){return _0x12afb9;};return _0x59ff();}function installChromiumBinary(_0xbd39a9){const _0x3d64c2=_0x2f3c55,_0x58c330={'UOCeM':_0x3d64c2(0x159),'LXjfe':'playwright','iBabP':_0x3d64c2(0x17b),'tDJlE':function(_0x2bb90f,_0x4ef156,_0xf37329,_0xe4edb4){return _0x2bb90f(_0x4ef156,_0xf37329,_0xe4edb4);},'Txtff':'npx','rMuOo':_0x3d64c2(0x192),'bWZKa':'close'};return new Promise((_0x365f65,_0x46aadf)=>{const _0x2f0a3f=_0x3d64c2,_0x5b6628={'TbWzg':function(_0x4a3da7){return _0x4a3da7();},'LAyhl':function(_0x2060d8,_0x2d2632){return _0x2060d8(_0x2d2632);},'HFcLz':function(_0x541f93,_0x4f6dc7){return _0x541f93(_0x4f6dc7);}},_0x1be755=_0xbd39a9?['playwright@'+_0xbd39a9,_0x2f0a3f(0x17b),_0x58c330['UOCeM']]:[_0x58c330[_0x2f0a3f(0x13d)],_0x58c330[_0x2f0a3f(0x1a0)],_0x58c330[_0x2f0a3f(0x176)]],_0x38caf4=_0x58c330['tDJlE'](spawn,_0x58c330[_0x2f0a3f(0x18c)],_0x1be755,{'stdio':'inherit','shell':process[_0x2f0a3f(0x1af)]===_0x58c330['rMuOo']});_0x38caf4['on'](_0x58c330['bWZKa'],_0x1cd9c8=>{const _0x26231e=_0x2f0a3f;_0x1cd9c8===0x0?_0x5b6628[_0x26231e(0x188)](_0x365f65):_0x5b6628['LAyhl'](_0x46aadf,new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x1cd9c8));}),_0x38caf4['on']('error',_0x318ec7=>{_0x5b6628['HFcLz'](_0x46aadf,_0x318ec7);});});}export async function authenticate(_0x656a58){const _0x5b03a7=_0x2f3c55,_0x2f015a={'BDxoT':function(_0x1e19c9){return _0x1e19c9();},'nUneC':'No\x20token\x20provided\x20and\x20running\x20in\x20non-interactive\x20mode.\x20In\x20CI,\x20pass\x20a\x20token:\x20ranger\x20setup\x20[token].\x20Or\x20set\x20the\x20RANGER_CLI_TOKEN\x20environment\x20variable.','hqKOd':function(_0x2e5924){return _0x2e5924();},'QVCcT':function(_0x35de33,_0x4b10d9){return _0x35de33(_0x4b10d9);},'uiflQ':'✓\x20Exported\x20credentials\x20for\x20CI','JRfoB':_0x5b03a7(0x1b8)};if(!_0x656a58){const _0x3672d2=await _0x2f015a[_0x5b03a7(0x1b7)](getToken);if(_0x3672d2){const _0xa672c5=await getCurrentUser(_0x3672d2);if(_0xa672c5[_0x5b03a7(0x14f)])return console[_0x5b03a7(0x1b4)](_0x5b03a7(0x1a4)+_0xa672c5[_0x5b03a7(0x14b)][_0x5b03a7(0x1ae)]),_0x3672d2;}const _0x47532a=process[_0x5b03a7(0x13a)][_0x5b03a7(0x164)]&&process['stdout']['isTTY'];if(!_0x47532a)throw new Error(_0x2f015a[_0x5b03a7(0x194)]);try{_0x656a58=await _0x2f015a['hqKOd'](runDeviceAuthFlow);}catch(_0x3bbcab){throw new Error('Authentication\x20failed:\x20'+(_0x3bbcab instanceof Error?_0x3bbcab[_0x5b03a7(0x151)]:_0x3bbcab));}const _0x38ce4d=await getCurrentUser(_0x656a58);if(!_0x38ce4d['success'])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x38ce4d['error']);return console['log'](_0x5b03a7(0x1b9)+_0x38ce4d['user'][_0x5b03a7(0x1ae)]),_0x656a58;}console['log']('Validating\x20API\x20token...');const _0x444781=await _0x2f015a[_0x5b03a7(0x15f)](getCurrentUser,_0x656a58);if(!_0x444781[_0x5b03a7(0x14f)]){if(_0x444781['status'])throw new Error('Authentication\x20failed:\x20'+_0x444781[_0x5b03a7(0x19e)]+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x444781['error']+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console['log']('✓\x20Authenticated\x20to\x20'+_0x444781[_0x5b03a7(0x14b)][_0x5b03a7(0x1ae)]),await storeToken(_0x656a58),console['log'](process[_0x5b03a7(0x149)][_0x5b03a7(0x141)]?_0x2f015a[_0x5b03a7(0x1ab)]:_0x2f015a['JRfoB']),_0x656a58;}export async function ensureRangerDir(){const _0x307fe2=_0x2f3c55,_0x5d1900={'PXFDG':function(_0x18576e){return _0x18576e();},'deOve':function(_0x7b9f86,_0x47ae2c){return _0x7b9f86(_0x47ae2c);},'HNVNu':function(_0x13d2ea,_0x504ac5,_0x3f901d){return _0x13d2ea(_0x504ac5,_0x3f901d);}},_0x3f597e=_0x5d1900['PXFDG'](getRangerDir);return!_0x5d1900[_0x307fe2(0x17e)](existsSync,_0x3f597e)?(await _0x5d1900['HNVNu'](mkdir,_0x3f597e,{'recursive':!![]}),console[_0x307fe2(0x1b4)](_0x307fe2(0x16d)),{'path':_0x3f597e,'installed':!![]}):(console[_0x307fe2(0x1b4)](_0x307fe2(0x190)),{'path':_0x3f597e,'installed':![]});}export async function ensureChromium(){const _0x20620a=_0x2f3c55,_0x26acff={'qrdmj':_0x20620a(0x180),'hgxtf':_0x20620a(0x1a8),'uJlgu':_0x20620a(0x17b),'qtQry':_0x20620a(0x152),'bvbNO':'\x20\x20npx\x20playwright\x20install\x20chromium','VbraW':_0x20620a(0x18f),'kMDtS':'You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'};let _0x109d64=![];try{const _0x4e30e7=chromium[_0x20620a(0x16c)]();_0x109d64=existsSync(_0x4e30e7);}catch{_0x109d64=![];}if(_0x109d64)return console['log'](_0x26acff['qrdmj']),![];const _0x5ed6ff=getPlaywrightVersion(),_0x59a388=process['stdin'][_0x20620a(0x164)]&&process[_0x20620a(0x157)]['isTTY'];let _0x58a330=!![];if(_0x59a388){const {install:_0x2b9657}=await _0x253b4e[_0x20620a(0x177)]([{'type':_0x26acff['hgxtf'],'name':_0x26acff['uJlgu'],'message':_0x5ed6ff?'The\x20required\x20version\x20('+_0x5ed6ff+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?':_0x20620a(0x195),'default':!![]}]);_0x58a330=_0x2b9657;}else console['log']('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium'+(_0x5ed6ff?'\x20'+_0x5ed6ff:'')+'...');if(_0x58a330){console[_0x20620a(0x1b4)]('\x0aInstalling\x20Chromium\x20browser...\x0a');try{await installChromiumBinary(_0x5ed6ff),console['log'](_0x26acff['qtQry']);}catch(_0x5a2ee1){console['error']('\x0a❌\x20Failed\x20to\x20install\x20Chromium:',_0x5a2ee1 instanceof Error?_0x5a2ee1[_0x20620a(0x151)]:_0x5a2ee1),console['log']('You\x20can\x20install\x20it\x20manually\x20by\x20running:'),_0x5ed6ff?console['log']('\x20\x20npx\x20playwright@'+_0x5ed6ff+'\x20install\x20chromium'):console['log'](_0x26acff[_0x20620a(0x145)]);}}else console['log'](_0x26acff[_0x20620a(0x19f)]),console[_0x20620a(0x1b4)](_0x26acff['kMDtS']),_0x5ed6ff?console[_0x20620a(0x1b4)](_0x20620a(0x19c)+_0x5ed6ff+'\x20install\x20chromium'):console['log']('\x20\x20npx\x20playwright\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x53a0d4){const _0x23527a=_0x2f3c55,_0x579367={'qUXvg':function(_0x52410d,_0xda812f,_0x4b1b91){return _0x52410d(_0xda812f,_0x4b1b91);},'HJrGW':function(_0x4dd417,_0x1b29c8,_0x3b5ec5){return _0x4dd417(_0x1b29c8,_0x3b5ec5);}},_0x1f8a4b=_0x579367['qUXvg'](join,_0x53a0d4,_0x23527a(0x15a)),_0x4c7765=_0x23527a(0x148);await _0x579367[_0x23527a(0x18e)](writeFile,_0x1f8a4b,_0x4c7765),console[_0x23527a(0x1b4)](_0x23527a(0x14e));}async function ensurePlugin(){const _0x256f84=_0x2f3c55,_0x505366={'eOHdJ':function(_0x59a707,_0x4b8b82){return _0x59a707(_0x4b8b82);},'XpSSS':'ranger@trailhead','ePkWh':function(_0x4e7350){return _0x4e7350();},'BcoLl':'.claude','cIfsz':_0x256f84(0x165),'ZGZOK':'User\x20(available\x20in\x20all\x20your\x20projects)','MWJWJ':'Project\x20(shared\x20with\x20team\x20via\x20git)','QoEBS':'ranger-testing/trailhead','rwndY':'❌\x20Failed\x20to\x20add\x20marketplace:','IvllK':'\x0aYou\x20can\x20install\x20manually\x20with:','Nptrs':function(_0x1bb2d9,_0x2b9ea7){return _0x1bb2d9(_0x2b9ea7);},'jKLPB':'plugin','Fvvvt':'enable','nNlfh':function(_0x109bfe,_0x3b8a11){return _0x109bfe===_0x3b8a11;},'NYgxr':_0x256f84(0x160),'WiEDw':_0x256f84(0x1ad),'QcguI':'already\x20enabled'},_0x5a7998=await _0x505366[_0x256f84(0x15d)](isPluginInstalled,_0x505366[_0x256f84(0x168)]);if(_0x5a7998)return console['log']('✓\x20Claude\x20Code\x20plugin\x20already\x20installed'),![];const _0xfc24c2=existsSync(join(_0x505366[_0x256f84(0x1b1)](getProjectRoot),_0x505366[_0x256f84(0x156)]));let _0x2df819;if(_0xfc24c2)_0x2df819='project';else{console['log'](_0x505366['cIfsz']);const _0x489ab1=await _0x253b4e[_0x256f84(0x177)]([{'type':_0x256f84(0x181),'name':_0x256f84(0x154),'message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':_0x505366[_0x256f84(0x193)],'value':'user'},{'name':_0x505366[_0x256f84(0x13c)],'value':_0x256f84(0x1ad)}],'default':_0x256f84(0x14b)}]);_0x2df819=_0x489ab1[_0x256f84(0x154)];}console[_0x256f84(0x1b4)](_0x256f84(0x184)+_0x2df819+'\x20level)...\x0a');const _0x455989=await isMarketplaceAdded(_0x256f84(0x17c));let _0x27b200=_0x455989;if(_0x455989)console['log'](_0x256f84(0x144));else{const _0xeadc76=await _0x505366['eOHdJ'](runClaudeCommand,[_0x256f84(0x178),_0x256f84(0x169),'add',_0x505366['QoEBS']]);!_0xeadc76[_0x256f84(0x14f)]?(console['error'](_0x505366[_0x256f84(0x19b)],_0xeadc76['error']),console[_0x256f84(0x1b4)](_0x505366[_0x256f84(0x18b)]),console['log'](_0x256f84(0x1ac)),console[_0x256f84(0x1b4)]('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x2df819)):_0x27b200=!![];}if(_0x27b200){const _0x4fedad=await _0x505366['Nptrs'](runClaudeCommand,[_0x256f84(0x178),'install',_0x505366[_0x256f84(0x168)],'--scope',_0x2df819]);if(!_0x4fedad[_0x256f84(0x14f)])console['error']('❌\x20Failed\x20to\x20install\x20plugin:',_0x4fedad[_0x256f84(0x19e)]),console['log'](_0x256f84(0x1a9)),console[_0x256f84(0x1b4)]('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x2df819);else{console['log'](_0x256f84(0x191));const _0x5d1696=[_0x505366['jKLPB'],_0x505366['Fvvvt'],_0x505366['XpSSS']];_0x505366[_0x256f84(0x153)](_0x2df819,_0x256f84(0x1ad))&&_0x5d1696[_0x256f84(0x1b0)](_0x505366[_0x256f84(0x1b3)],_0x505366[_0x256f84(0x14c)]);const _0x51bf6e=await runClaudeCommand(_0x5d1696,{'captureOutput':!![]});if(!_0x51bf6e[_0x256f84(0x14f)]){const _0x3a3889=_0x51bf6e[_0x256f84(0x1a3)]?.['includes'](_0x505366[_0x256f84(0x173)]);!_0x3a3889&&console[_0x256f84(0x19e)]('⚠\x20Failed\x20to\x20enable\x20plugin:',_0x51bf6e[_0x256f84(0x19e)]);}console['log']('✓\x20Claude\x20Code\x20plugin\x20enabled');}}return!![];}function printProfileSetupLaterInstructions(){const _0xd21adb=_0x2f3c55,_0x3404a5={'KWrig':function(_0x381939,_0x5155b1){return _0x381939(_0x5155b1);},'orRNf':_0xd21adb(0x143)};console['log'](_0xd21adb(0x186)),console['log']('\x20\x20'+_0x3404a5[_0xd21adb(0x182)](bold,'ranger\x20profile\x20add\x20local')),console['log'](_0x3404a5['orRNf']);}async function ensureLocalEnv(_0x3f7777){const _0x467f71=_0x2f3c55,_0x2c7014={'erGxw':_0x467f71(0x162),'XOYur':function(_0x308a32,_0x5b25cf,_0x3f60bf){return _0x308a32(_0x5b25cf,_0x3f60bf);},'xUkhJ':'local','Ehmxn':'\x0aA\x20profile\x20gives\x20Ranger\x27s\x20browser\x20agent\x20information\x20about\x20how','iZFFk':_0x467f71(0x1aa),'qxqmP':'confirm','TyvLW':function(_0x58f823){return _0x58f823();},'FvlZa':function(_0x219aad){return _0x219aad();}};if(!findGitRoot())return console[_0x467f71(0x1b4)](_0x2c7014[_0x467f71(0x15c)]),{'ready':![],'installed':![]};if(_0x2c7014[_0x467f71(0x17f)](findExistingEnv,_0x2c7014[_0x467f71(0x155)],{'locations':[_0x467f71(0x1b2)]}))return console[_0x467f71(0x1b4)](_0x467f71(0x174)),{'ready':!![],'installed':![]};console['log'](_0x2c7014['Ehmxn']),console[_0x467f71(0x1b4)]('to\x20access\x20your\x20app.\x20If\x20the\x20part\x20of\x20your\x20app\x20you\x20want\x20to\x20test\x20is\x20behind'),console[_0x467f71(0x1b4)]('auth,\x20you\x20can\x20log\x20in\x20and\x20we\x27ll\x20save\x20the\x20session\x20state\x20for\x20Ranger\x20to'),console[_0x467f71(0x1b4)]('use\x20until\x20the\x20session\x20expires.\x0a'),console['log'](_0x2c7014[_0x467f71(0x13b)]);const {wantsProfile:_0x31dc58}=await _0x253b4e['prompt']([{'type':_0x2c7014[_0x467f71(0x172)],'name':_0x467f71(0x18a),'message':_0x467f71(0x163),'default':!![]}]);if(!_0x31dc58)return _0x2c7014[_0x467f71(0x147)](printProfileSetupLaterInstructions),{'ready':![],'installed':![]};try{return await addEnv(_0x2c7014[_0x467f71(0x155)],{},_0x3f7777),{'ready':!![],'installed':!![]};}catch(_0x53b9a4){return console['error'](_0x467f71(0x179),_0x53b9a4 instanceof Error?_0x53b9a4[_0x467f71(0x151)]:_0x53b9a4),_0x2c7014[_0x467f71(0x15e)](printProfileSetupLaterInstructions),{'ready':![],'installed':![]};}}async function ensureSkills(){const _0x3ab794=_0x2f3c55,_0x2c4cb6={'ewCJz':function(_0x4d132c,_0x498ff4,_0x531420,_0x1e13cf){return _0x4d132c(_0x498ff4,_0x531420,_0x1e13cf);},'zLeqy':function(_0x5319c6,_0x4b2cb9,_0x367fb4){return _0x5319c6(_0x4b2cb9,_0x367fb4);},'Vnrkr':function(_0x58c7fe){return _0x58c7fe();},'URvYW':function(_0x486cc8,_0x7c14fb){return _0x486cc8(_0x7c14fb);},'wveXB':_0x3ab794(0x1a8),'Sulil':'wantsSkillup'},_0x42aa89=existsSync(join(getSkillsDir('user'),_0x3ab794(0x1a1),'SKILL.md')),_0x294d46=existsSync(_0x2c4cb6['ewCJz'](join,getSkillsDir('project'),'ranger','SKILL.md'));if(_0x42aa89||_0x294d46)return console[_0x3ab794(0x1b4)](_0x3ab794(0x17a)),![];const _0x2e44f3=existsSync(_0x2c4cb6['zLeqy'](join,_0x2c4cb6['Vnrkr'](getProjectRoot),'.claude'));if(_0x2e44f3)await _0x2c4cb6['URvYW'](skillup,{'autoInstall':'project','suppressUsage':!![]});else{const {wantsSkillup:_0x4ea7d7}=await _0x253b4e[_0x3ab794(0x177)]([{'type':_0x2c4cb6['wveXB'],'name':_0x2c4cb6['Sulil'],'message':'Would\x20you\x20like\x20to\x20install\x20skills?','default':!![]}]);_0x4ea7d7&&await skillup({'suppressUsage':!![]});}return!![];}export async function start(_0x45c379,_0x5c3711,_0x552399){const _0x4df0df=_0x2f3c55,_0x1a138d={'WALIT':_0x4df0df(0x189),'hcjlU':'No\x20git\x20repository\x20found.\x20Please\x20run\x20`ranger\x20setup`\x20from\x20inside\x20your\x20project\x20directory.','XQwSx':_0x4df0df(0x1ba),'slMqy':'chromium','NwtRI':'✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','iufqm':_0x4df0df(0x167),'rsKFB':'\x20\x203.\x20Install\x20Claude\x20Code\x20plugin:','OwWcE':_0x4df0df(0x14d),'LgXdr':'plugin','ZKALS':function(_0x1f3b85){return _0x1f3b85();},'DFjst':_0x4df0df(0x19a),'enfdb':function(_0x653279){return _0x653279();},'NFLYD':function(_0x43fbe0,_0x5bce2b,_0x3b44ad){return _0x43fbe0(_0x5bce2b,_0x3b44ad);},'ZuWUc':_0x4df0df(0x14a),'lQzoG':function(_0x504cbe,_0x412f72){return _0x504cbe(_0x412f72);},'tjhcz':'/ranger:enable','SKVVh':function(_0x40a135,_0x2b57a9){return _0x40a135+_0x2b57a9;}};console['log'](_0x1a138d['WALIT']);if(!findGitRoot())throw new Error(_0x1a138d['hcjlU']);_0x552399?.['trackPhaseStart'](_0x1a138d['XQwSx']),await authenticate(_0x45c379),_0x552399?.['trackPhaseEnd']('auth'),_0x552399?.[_0x4df0df(0x175)]('dir_setup');const {path:_0x1ebe17,installed:_0x5d13e9}=await ensureRangerDir();_0x552399?.['trackPhaseEnd']('dir_setup',{'installed':_0x5d13e9}),_0x552399?.[_0x4df0df(0x175)](_0x1a138d['slMqy']);let _0x5051cb=![];_0x5c3711?.[_0x4df0df(0x1a6)]?console['log'](_0x1a138d[_0x4df0df(0x198)]):_0x5051cb=await ensureChromium();_0x552399?.[_0x4df0df(0x16a)](_0x4df0df(0x159),{'installed':_0x5051cb,'skipped':!!_0x5c3711?.[_0x4df0df(0x1a6)]}),await writeRangerGitignore(_0x1ebe17),console[_0x4df0df(0x1b4)](_0x4df0df(0x18d));const _0x12c2ec=process[_0x4df0df(0x13a)]['isTTY']&&process['stdout'][_0x4df0df(0x164)];if(!_0x12c2ec){console[_0x4df0df(0x1b4)](_0x1a138d['iufqm']),console['log'](_0x4df0df(0x170)),console[_0x4df0df(0x1b4)](_0x4df0df(0x150)),console[_0x4df0df(0x1b4)](_0x4df0df(0x146)),console['log'](_0x1a138d['rsKFB']),console[_0x4df0df(0x1b4)]('\x20\x20\x20\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead'),console['log'](_0x4df0df(0x1b5)),console[_0x4df0df(0x1b4)](_0x1a138d[_0x4df0df(0x1a7)]);return;}_0x552399?.['trackPhaseStart'](_0x1a138d['LgXdr']);const _0x3ad4d5=await _0x1a138d[_0x4df0df(0x1a5)](ensurePlugin);_0x552399?.['trackPhaseEnd']('plugin',{'installed':_0x3ad4d5}),_0x552399?.['trackPhaseStart'](_0x1a138d['DFjst']);const _0x47e130=await _0x1a138d[_0x4df0df(0x187)](ensureSkills);_0x552399?.[_0x4df0df(0x16a)](_0x1a138d['DFjst'],{'installed':_0x47e130});const _0x3c4eb8=findGitRoot();if(_0x3c4eb8){const _0x5d80aa=_0x1a138d[_0x4df0df(0x1a2)](join,_0x3c4eb8,_0x4df0df(0x13f));!existsSync(_0x5d80aa)&&await _0x1a138d['NFLYD'](mkdir,_0x5d80aa,{'recursive':!![]});}_0x552399?.['trackPhaseStart'](_0x1a138d['ZuWUc']);const _0x36daff=await _0x1a138d[_0x4df0df(0x140)](ensureLocalEnv,_0x552399);_0x552399?.['trackPhaseEnd'](_0x1a138d['ZuWUc'],{'installed':_0x36daff['installed']});const _0xbf9a02=_0x36daff['ready'],_0x526a68=bold(_0x1a138d['tjhcz']);_0xbf9a02&&console[_0x4df0df(0x1b4)]('\x0a✅\x20You\x27re\x20ready\x20to\x20start\x20using\x20Ranger\x20Feature\x20Review.'),console[_0x4df0df(0x1b4)](_0x1a138d['SKVVh'](_0x4df0df(0x13e)+_0x526a68+_0x4df0df(0x15b)+'\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with'+_0x4df0df(0x197),'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.'));}
1
+ const _0x15fb3f=_0x2fe2;(function(_0x5d207b,_0x56629e){const _0x93870b=_0x2fe2,_0x4a96cd=_0x5d207b();while(!![]){try{const _0x4eec02=-parseInt(_0x93870b(0x144))/0x1+parseInt(_0x93870b(0x154))/0x2*(-parseInt(_0x93870b(0x147))/0x3)+-parseInt(_0x93870b(0x16c))/0x4+parseInt(_0x93870b(0x10f))/0x5*(-parseInt(_0x93870b(0x13d))/0x6)+parseInt(_0x93870b(0x15a))/0x7*(-parseInt(_0x93870b(0x140))/0x8)+-parseInt(_0x93870b(0x133))/0x9*(parseInt(_0x93870b(0x182))/0xa)+-parseInt(_0x93870b(0x127))/0xb*(-parseInt(_0x93870b(0x18f))/0xc);if(_0x4eec02===_0x56629e)break;else _0x4a96cd['push'](_0x4a96cd['shift']());}catch(_0xebc76f){_0x4a96cd['push'](_0x4a96cd['shift']());}}}(_0x15f4,0x9a4a3));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';function _0x15f4(){const _0x2af1cc=['sxnlN','MCCFA','SECdn','ranger\x20profile\x20add\x20local','zrWzt','trackPhaseStart','Kdoxz','PRIWL','error','Bweaz','OFGfj','22gSrPQU','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','✓\x20Exported\x20credentials\x20for\x20CI','ranger','\x0aA\x20profile\x20gives\x20Ranger\x27s\x20browser\x20agent\x20information\x20about\x20how','IiAbI','42XbVTyG','inherit','mrcnO','ALYfc','confirm','FFPQB','message','use\x20until\x20the\x20session\x20expires.\x0a','install','Authentication\x20failed:\x20','OqqRZ','Would\x20you\x20like\x20to\x20install\x20skills?','\x0a📦\x20Claude\x20Code\x20Plugin\x0a','list','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','Hivae','already\x20enabled','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','2584396yXNNGq','MRTko','prompt','\x20\x201.\x20Navigate\x20to\x20your\x20project\x20directory','playwright/package.json','jpKgm','\x0aYou\x20can\x20install\x20manually\x20with:','\x0a✅\x20You\x27re\x20ready\x20to\x20start\x20using\x20Ranger\x20Feature\x20Review.','stdin','SKILL.md','You\x20can\x20install\x20it\x20manually\x20by\x20running:','UYnvG','THZiA','PUldx','Make\x20sure\x20your\x20app\x20is\x20running\x20before\x20you\x20start.\x0a','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','QxnXb','Fusjd','...','user','\x20install\x20chromium','stdout','1470kIxfNb','ready','JpcWq','qErSk','env','AZQRe','log','The\x20required\x20version\x20(','eUVVM','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','\x20\x20\x20\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','7|5|4|2|3|8|1|6|0','36cTYQNS','You\x27ll\x20need\x20the\x20app\x20to\x20be\x20running\x20to\x20set\x20up\x20the\x20profile.','\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','project','fvUhB','device_auth','trackPhaseError','platform','EmsKa','mHpeY','1702510svQwtI','dUEYK','\x0a❌\x20Profile\x20setup\x20failed:','split','ZxPIT','method','\x1b[1m','Project\x20(shared\x20with\x20team\x20via\x20git)','eVWSv','⚠\x20No\x20git\x20repository\x20found.\x20Run\x20`ranger\x20profile\x20add\x20local`\x20from\x20your\x20project\x20directory.','isTTY','bMvYc','playwright@','close','⚠\x20Failed\x20to\x20enable\x20plugin:','✓\x20Created\x20.ranger/\x20directory','uetkL','provided_token','NmIPm','✓\x20.ranger/\x20directory\x20already\x20exists','wantsSkillup','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','version','iTodr','14678719LUYizi','trackPhaseEnd','local','jIowJ','✓\x20Ranger\x20skills\x20already\x20installed','\x20\x203.\x20Install\x20Claude\x20Code\x20plugin:','/ranger:enable','ArXBE','wOLVA','aSjLJ','✓\x20Marketplace\x20already\x20added','Non-interactive\x20mode\x20detected.\x20Skipping\x20optional\x20setup\x20prompts.','45405ignPUu','git_check','success','marketplace','status','✓\x20Created\x20.ranger/.gitignore','EQyru','auth','chromium','siYkO','18FLMzsW','KZeUO','plugin','319448JmiyCx','AiFwL','xixWy','skipChromium','606273heUlPa','tsGqx','clQel','31701RKDuWV','skills'];_0x15f4=function(){return _0x2af1cc;};return _0x15f4();}import{spawn}from'child_process';import _0x43e3dc 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{skillup}from'./skillup.js';import{getRangerDir,findGitRoot}from'./utils/rangerRoot.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'./utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'./utils/claudeConfig.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';const require=createRequire(import.meta.url),bold=_0x100099=>_0x15fb3f(0x115)+_0x100099+'\x1b[0m';function getPlaywrightVersion(){const _0x192a19=_0x15fb3f;try{const _0x3f1aed=require['resolve'](_0x192a19(0x170)),_0xe23bbf=require(_0x3f1aed);return _0xe23bbf[_0x192a19(0x125)];}catch{return null;}}function installChromiumBinary(_0x1d1354){const _0x58c388=_0x15fb3f,_0x2081cf={'aSjLJ':'install','wEVcs':function(_0x28a29b,_0x3a3853,_0x31650b,_0x5c20f2){return _0x28a29b(_0x3a3853,_0x31650b,_0x5c20f2);},'pLQfz':'npx','Fusjd':_0x58c388(0x15b),'kwYqk':function(_0x32789b,_0x1c978f){return _0x32789b===_0x1c978f;},'tsGqx':_0x58c388(0x151)};return new Promise((_0x4b2ab1,_0x493e64)=>{const _0x12c7ba=_0x58c388,_0x42b6dc={'KxcvX':function(_0x5b7dc1,_0x1e4bf9){return _0x5b7dc1===_0x1e4bf9;}},_0x130611=_0x1d1354?[_0x12c7ba(0x11b)+_0x1d1354,_0x2081cf[_0x12c7ba(0x130)],'chromium']:['playwright',_0x2081cf['aSjLJ'],_0x12c7ba(0x13b)],_0x39f061=_0x2081cf['wEVcs'](spawn,_0x2081cf['pLQfz'],_0x130611,{'stdio':_0x2081cf[_0x12c7ba(0x17d)],'shell':_0x2081cf['kwYqk'](process[_0x12c7ba(0x10c)],'win32')});_0x39f061['on'](_0x12c7ba(0x11c),_0x23dcb8=>{_0x42b6dc['KxcvX'](_0x23dcb8,0x0)?_0x4b2ab1():_0x493e64(new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x23dcb8));}),_0x39f061['on'](_0x2081cf[_0x12c7ba(0x145)],_0x205b53=>{_0x493e64(_0x205b53);});});}export async function authenticate(_0xd0e6cd){const _0x364b98=_0x15fb3f,_0x5516ab={'Hivae':function(_0x1e44df,_0x31c2ba){return _0x1e44df instanceof _0x31c2ba;},'EmsKa':function(_0x3afe39,_0x25c383){return _0x3afe39(_0x25c383);},'eHNYe':_0x364b98(0x156),'TstbD':'✓\x20Stored\x20credentials\x20locally','fvUhB':_0x364b98(0x120)};if(!_0xd0e6cd){const _0x4f2ee2=await getToken();if(_0x4f2ee2){const _0x3bbab5=await getCurrentUser(_0x4f2ee2);if(_0x3bbab5[_0x364b98(0x135)])return console['log']('✓\x20Already\x20authenticated\x20to\x20'+_0x3bbab5['user']['organizationName']),{'token':_0x4f2ee2,'method':'existing_token'};}const _0x1538ad=process[_0x364b98(0x174)][_0x364b98(0x119)]&&process['stdout'][_0x364b98(0x119)];if(!_0x1538ad)throw new Error('No\x20token\x20provided\x20and\x20running\x20in\x20non-interactive\x20mode.\x20In\x20CI,\x20pass\x20a\x20token:\x20ranger\x20setup\x20[token].\x20Or\x20set\x20the\x20RANGER_CLI_TOKEN\x20environment\x20variable.');try{_0xd0e6cd=await runDeviceAuthFlow();}catch(_0x515d58){throw new Error('Authentication\x20failed:\x20'+(_0x5516ab[_0x364b98(0x169)](_0x515d58,Error)?_0x515d58[_0x364b98(0x160)]:_0x515d58));}const _0x11a258=await getCurrentUser(_0xd0e6cd);if(!_0x11a258[_0x364b98(0x135)])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x11a258[_0x364b98(0x151)]);return console[_0x364b98(0x188)]('✓\x20Authenticated\x20to\x20'+_0x11a258[_0x364b98(0x17f)]['organizationName']),{'token':_0xd0e6cd,'method':_0x364b98(0x194)};}console[_0x364b98(0x188)]('Validating\x20API\x20token...');const _0x32a4b7=await getCurrentUser(_0xd0e6cd);if(!_0x32a4b7[_0x364b98(0x135)]){if(_0x32a4b7[_0x364b98(0x137)])throw new Error(_0x364b98(0x163)+_0x32a4b7['error']+_0x364b98(0x18b));else throw new Error(_0x364b98(0x16b)+_0x32a4b7[_0x364b98(0x151)]+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console[_0x364b98(0x188)]('✓\x20Authenticated\x20to\x20'+_0x32a4b7['user']['organizationName']),await _0x5516ab[_0x364b98(0x10d)](storeToken,_0xd0e6cd),console[_0x364b98(0x188)](process[_0x364b98(0x186)]['GITHUB_ENV']?_0x5516ab['eHNYe']:_0x5516ab['TstbD']),{'token':_0xd0e6cd,'method':_0x5516ab[_0x364b98(0x193)]};}export async function ensureRangerDir(){const _0x6e3cfe=_0x15fb3f,_0x50fe74={'ArXBE':_0x6e3cfe(0x122)},_0x4e26cd=getRangerDir();return!existsSync(_0x4e26cd)?(await mkdir(_0x4e26cd,{'recursive':!![]}),console[_0x6e3cfe(0x188)](_0x6e3cfe(0x11e)),{'path':_0x4e26cd,'installed':!![]}):(console[_0x6e3cfe(0x188)](_0x50fe74[_0x6e3cfe(0x12e)]),{'path':_0x4e26cd,'installed':![]});}export async function ensureChromium(){const _0xafda06=_0x15fb3f,_0x3f4efc={'eUVVM':function(_0x4e1ea4,_0x31aa73){return _0x4e1ea4(_0x31aa73);},'bMvYc':'✓\x20Playwright\x20Chromium\x20browser\x20found','sxnlN':_0xafda06(0x15e),'Iywxn':'The\x20required\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','zrWzt':function(_0x8f2dc6,_0x44ad6a){return _0x8f2dc6(_0x44ad6a);},'WaqaP':'\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','sFfpi':'\x0a❌\x20Failed\x20to\x20install\x20Chromium:','eDyvU':_0xafda06(0x176),'vKLRf':'\x20\x20npx\x20playwright\x20install\x20chromium'};let _0x2c5f73=![];try{const _0x2471fc=chromium['executablePath']();_0x2c5f73=_0x3f4efc[_0xafda06(0x18a)](existsSync,_0x2471fc);}catch{_0x2c5f73=![];}if(_0x2c5f73)return console[_0xafda06(0x188)](_0x3f4efc[_0xafda06(0x11a)]),![];const _0x29552e=getPlaywrightVersion(),_0x3f54f5=process[_0xafda06(0x174)][_0xafda06(0x119)]&&process[_0xafda06(0x181)]['isTTY'];let _0xd292=!![];if(_0x3f54f5){const {install:_0x4753f3}=await _0x43e3dc[_0xafda06(0x16e)]([{'type':_0x3f4efc[_0xafda06(0x149)],'name':'install','message':_0x29552e?_0xafda06(0x189)+_0x29552e+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?':_0x3f4efc['Iywxn'],'default':!![]}]);_0xd292=_0x4753f3;}else console[_0xafda06(0x188)]('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium'+(_0x29552e?'\x20'+_0x29552e:'')+_0xafda06(0x17e));if(_0xd292){console['log']('\x0aInstalling\x20Chromium\x20browser...\x0a');try{await _0x3f4efc[_0xafda06(0x14d)](installChromiumBinary,_0x29552e),console[_0xafda06(0x188)](_0x3f4efc['WaqaP']);}catch(_0x4efa64){console[_0xafda06(0x151)](_0x3f4efc['sFfpi'],_0x4efa64 instanceof Error?_0x4efa64['message']:_0x4efa64),console['log'](_0x3f4efc['eDyvU']),_0x29552e?console['log']('\x20\x20npx\x20playwright@'+_0x29552e+_0xafda06(0x180)):console['log'](_0x3f4efc['vKLRf']);}}else console[_0xafda06(0x188)]('\x0a⚠\x20Skipping\x20Chromium\x20installation.'),console[_0xafda06(0x188)]('You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'),_0x29552e?console[_0xafda06(0x188)]('\x20\x20npx\x20playwright@'+_0x29552e+'\x20install\x20chromium'):console[_0xafda06(0x188)]('\x20\x20npx\x20playwright\x20install\x20chromium');return!![];}function _0x2fe2(_0x38e94d,_0x5b51d8){_0x38e94d=_0x38e94d-0x10c;const _0x15f4d4=_0x15f4();let _0x2fe29c=_0x15f4d4[_0x38e94d];return _0x2fe29c;}export async function writeRangerGitignore(_0x4b4277){const _0x4a8829=_0x15fb3f,_0x59016a={'EQyru':function(_0x29f263,_0x2eefec,_0xd509b2){return _0x29f263(_0x2eefec,_0xd509b2);},'HnaIj':_0x4a8829(0x138)},_0x4a0d33=join(_0x4b4277,'.gitignore'),_0x148f9d=_0x4a8829(0x191);await _0x59016a[_0x4a8829(0x139)](writeFile,_0x4a0d33,_0x148f9d),console[_0x4a8829(0x188)](_0x59016a['HnaIj']);}async function ensurePlugin(){const _0x9d18f2=_0x15fb3f,_0x18a8a6={'PUldx':function(_0x6147dd,_0x5f2f5b){return _0x6147dd(_0x5f2f5b);},'OqqRZ':'ranger@trailhead','AQHqh':function(_0x68086){return _0x68086();},'UJTRZ':'.claude','mSWHt':_0x9d18f2(0x192),'UYnvG':'User\x20(available\x20in\x20all\x20your\x20projects)','ALYfc':_0x9d18f2(0x116),'JpcWq':'trailhead','phEUC':_0x9d18f2(0x136),'qErSk':'add','fKQVD':'ranger-testing/trailhead','jFwTt':function(_0xaa41bc,_0x311157){return _0xaa41bc(_0x311157);},'PRIWL':_0x9d18f2(0x13f),'QYhtt':_0x9d18f2(0x162),'GxhnK':'--scope','AiFwL':_0x9d18f2(0x172),'WQRFd':'enable','wOLVA':function(_0x2aa4d1,_0x32d69e){return _0x2aa4d1===_0x32d69e;},'oZifK':function(_0x4eca0d,_0x4bde9a,_0x387fe6){return _0x4eca0d(_0x4bde9a,_0x387fe6);},'THZiA':_0x9d18f2(0x16a),'eVWSv':'✓\x20Claude\x20Code\x20plugin\x20enabled'},_0x5385ba=await _0x18a8a6['PUldx'](isPluginInstalled,_0x18a8a6[_0x9d18f2(0x164)]);if(_0x5385ba)return console['log'](_0x9d18f2(0x168)),![];const _0x37960a=_0x18a8a6[_0x9d18f2(0x179)](existsSync,join(_0x18a8a6['AQHqh'](getProjectRoot),_0x18a8a6['UJTRZ']));let _0x9d9b67;if(_0x37960a)_0x9d9b67=_0x18a8a6['mSWHt'];else{console[_0x9d18f2(0x188)](_0x9d18f2(0x166));const _0x249b93=await _0x43e3dc['prompt']([{'type':_0x9d18f2(0x167),'name':'pluginScope','message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':_0x18a8a6[_0x9d18f2(0x177)],'value':'user'},{'name':_0x18a8a6[_0x9d18f2(0x15d)],'value':_0x9d18f2(0x192)}],'default':'user'}]);_0x9d9b67=_0x249b93['pluginScope'];}console['log']('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x9d9b67+'\x20level)...\x0a');const _0x4f408b=await _0x18a8a6[_0x9d18f2(0x179)](isMarketplaceAdded,_0x18a8a6[_0x9d18f2(0x184)]);let _0x5beccb=_0x4f408b;if(_0x4f408b)console['log'](_0x9d18f2(0x131));else{const _0x7e046b=await _0x18a8a6[_0x9d18f2(0x179)](runClaudeCommand,['plugin',_0x18a8a6['phEUC'],_0x18a8a6[_0x9d18f2(0x185)],_0x18a8a6['fKQVD']]);!_0x7e046b[_0x9d18f2(0x135)]?(console[_0x9d18f2(0x151)]('❌\x20Failed\x20to\x20add\x20marketplace:',_0x7e046b['error']),console['log'](_0x9d18f2(0x172)),console['log'](_0x9d18f2(0x124)),console[_0x9d18f2(0x188)]('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x9d9b67)):_0x5beccb=!![];}if(_0x5beccb){const _0x583a1=await _0x18a8a6['jFwTt'](runClaudeCommand,[_0x18a8a6[_0x9d18f2(0x150)],_0x18a8a6['QYhtt'],'ranger@trailhead',_0x18a8a6['GxhnK'],_0x9d9b67]);if(!_0x583a1['success'])console[_0x9d18f2(0x151)]('❌\x20Failed\x20to\x20install\x20plugin:',_0x583a1[_0x9d18f2(0x151)]),console[_0x9d18f2(0x188)](_0x18a8a6[_0x9d18f2(0x141)]),console['log'](_0x9d18f2(0x18c)+_0x9d9b67);else{console['log']('✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully');const _0x5cbbee=[_0x9d18f2(0x13f),_0x18a8a6['WQRFd'],_0x18a8a6['OqqRZ']];_0x18a8a6[_0x9d18f2(0x12f)](_0x9d9b67,_0x9d18f2(0x192))&&_0x5cbbee['push'](_0x18a8a6['GxhnK'],'project');const _0x806caa=await _0x18a8a6['oZifK'](runClaudeCommand,_0x5cbbee,{'captureOutput':!![]});if(!_0x806caa['success']){const _0x577015=_0x806caa['output']?.['includes'](_0x18a8a6[_0x9d18f2(0x178)]);!_0x577015&&console[_0x9d18f2(0x151)](_0x9d18f2(0x11d),_0x806caa[_0x9d18f2(0x151)]);}console[_0x9d18f2(0x188)](_0x18a8a6[_0x9d18f2(0x117)]);}}return!![];}function printProfileSetupLaterInstructions(){const _0x4c506e=_0x15fb3f,_0x3e47e0={'VzSDX':'\x0aIn\x20order\x20for\x20Ranger\x20to\x20verify\x20your\x20work,\x20you\x27ll\x20need\x20to\x20set\x20up\x20a\x20profile\x20later\x20with:','Bweaz':function(_0x841e61,_0x79aeb2){return _0x841e61(_0x79aeb2);},'xgNWQ':_0x4c506e(0x14c)};console[_0x4c506e(0x188)](_0x3e47e0['VzSDX']),console['log']('\x20\x20'+_0x3e47e0[_0x4c506e(0x152)](bold,_0x3e47e0['xgNWQ'])),console[_0x4c506e(0x188)](_0x4c506e(0x17a));}async function ensureLocalEnv(_0x92d7bd){const _0x1eff40=_0x15fb3f,_0xaee3b8={'GHFJp':function(_0x225f7a){return _0x225f7a();},'kHZjA':function(_0x4adb39,_0x48373e,_0x28413a){return _0x4adb39(_0x48373e,_0x28413a);},'nqdrr':'✓\x20Local\x20profile\x20already\x20exists','ywjXv':_0x1eff40(0x158),'uINYu':'to\x20access\x20your\x20app.\x20If\x20the\x20part\x20of\x20your\x20app\x20you\x20want\x20to\x20test\x20is\x20behind','XgtON':'auth,\x20you\x20can\x20log\x20in\x20and\x20we\x27ll\x20save\x20the\x20session\x20state\x20for\x20Ranger\x20to','MCCFA':'confirm','uetkL':'wantsProfile','FhdhQ':'Would\x20you\x20like\x20to\x20set\x20up\x20the\x20profile\x20now?','MCxBJ':function(_0xfca45a,_0x105de3,_0x106d33,_0x383d26){return _0xfca45a(_0x105de3,_0x106d33,_0x383d26);},'QxnXb':_0x1eff40(0x129),'jIowJ':_0x1eff40(0x111)};if(!_0xaee3b8['GHFJp'](findGitRoot))return console[_0x1eff40(0x188)](_0x1eff40(0x118)),{'ready':![],'skipped':!![]};if(_0xaee3b8['kHZjA'](findExistingEnv,_0x1eff40(0x129),{'locations':[_0x1eff40(0x129)]}))return console[_0x1eff40(0x188)](_0xaee3b8['nqdrr']),{'ready':!![],'skipped':![]};console[_0x1eff40(0x188)](_0xaee3b8['ywjXv']),console[_0x1eff40(0x188)](_0xaee3b8['uINYu']),console['log'](_0xaee3b8['XgtON']),console['log'](_0x1eff40(0x161)),console['log'](_0x1eff40(0x190));const {wantsProfile:_0x306097}=await _0x43e3dc[_0x1eff40(0x16e)]([{'type':_0xaee3b8[_0x1eff40(0x14a)],'name':_0xaee3b8[_0x1eff40(0x11f)],'message':_0xaee3b8['FhdhQ'],'default':!![]}]);if(!_0x306097)return printProfileSetupLaterInstructions(),{'ready':![],'skipped':!![]};try{return await _0xaee3b8['MCxBJ'](addEnv,_0xaee3b8[_0x1eff40(0x17c)],{},_0x92d7bd),{'ready':!![],'skipped':![]};}catch(_0x539bcb){return console['error'](_0xaee3b8[_0x1eff40(0x12a)],_0x539bcb instanceof Error?_0x539bcb['message']:_0x539bcb),printProfileSetupLaterInstructions(),{'ready':![],'skipped':![]};}}async function ensureSkills(){const _0x6863bf=_0x15fb3f,_0x26e270={'xixWy':function(_0x301690,_0x34f8cc,_0x523c0b,_0xfcba60){return _0x301690(_0x34f8cc,_0x523c0b,_0xfcba60);},'vaPzU':function(_0x5c8ad1,_0x55774b){return _0x5c8ad1(_0x55774b);},'AZQRe':_0x6863bf(0x175),'dUEYK':function(_0x532b65,_0x30cb65){return _0x532b65(_0x30cb65);},'Kdoxz':'project','SECdn':function(_0x2d7f2f,_0x3b5786){return _0x2d7f2f||_0x3b5786;},'mrcnO':function(_0x471b96,_0x7cbe){return _0x471b96(_0x7cbe);},'YMQaB':function(_0x515f0b,_0x49b93a,_0x5f50c4){return _0x515f0b(_0x49b93a,_0x5f50c4);},'ekWlj':function(_0x59c8e4){return _0x59c8e4();}},_0x3aca68=existsSync(_0x26e270['xixWy'](join,_0x26e270['vaPzU'](getSkillsDir,'user'),'ranger',_0x26e270[_0x6863bf(0x187)])),_0x345fda=existsSync(_0x26e270[_0x6863bf(0x142)](join,_0x26e270['dUEYK'](getSkillsDir,_0x26e270[_0x6863bf(0x14f)]),_0x6863bf(0x157),_0x6863bf(0x175)));if(_0x26e270[_0x6863bf(0x14b)](_0x3aca68,_0x345fda))return console[_0x6863bf(0x188)](_0x6863bf(0x12b)),![];const _0x2f135f=_0x26e270[_0x6863bf(0x15c)](existsSync,_0x26e270['YMQaB'](join,_0x26e270['ekWlj'](getProjectRoot),'.claude'));if(_0x2f135f)await _0x26e270[_0x6863bf(0x110)](skillup,{'autoInstall':_0x26e270['Kdoxz'],'suppressUsage':!![]});else{const {wantsSkillup:_0x496a5a}=await _0x43e3dc['prompt']([{'type':_0x6863bf(0x15e),'name':_0x6863bf(0x123),'message':_0x6863bf(0x165),'default':!![]}]);_0x496a5a&&await skillup({'suppressUsage':!![]});}return!![];}export async function start(_0xe16f25,_0x1b96ed,_0x3fc9ad){const _0x36d33d=_0x15fb3f,_0x3f22f5={'mHpeY':_0x36d33d(0x134),'OFGfj':function(_0x59acc3){return _0x59acc3();},'VMnAy':'No\x20git\x20repository\x20found','VAbuF':'No\x20git\x20repository\x20found.\x20Please\x20run\x20`ranger\x20setup`\x20from\x20inside\x20your\x20project\x20directory.','MRTko':function(_0x145d7f){return _0x145d7f();},'bqxUn':_0x36d33d(0x13a),'qfBxL':_0x36d33d(0x13b),'tZRyy':function(_0x1fc672,_0x4860e1){return _0x1fc672(_0x4860e1);},'iTodr':'\x0a✅\x20Ranger\x20setup\x20complete!\x0a','IiAbI':_0x36d33d(0x18e),'fDyNv':'\x20\x202.\x20Run:\x20ranger\x20skillup','NzdgN':_0x36d33d(0x12c),'dZqDd':'\x0aNext\x20steps:','jkQNB':_0x36d33d(0x132),'uDPwU':_0x36d33d(0x18d),'ZxPIT':_0x36d33d(0x13f),'jpKgm':_0x36d33d(0x148),'FFPQB':function(_0x31fe7a){return _0x31fe7a();},'KZeUO':'.ranger','siYkO':'profile','clQel':function(_0x176c14,_0xf1d27c){return _0x176c14(_0xf1d27c);},'LmMzR':_0x36d33d(0x12d),'NmIPm':function(_0x1c51f7,_0x119c1c){return _0x1c51f7+_0x119c1c;}};console['log']('\x0a🚀\x20Ranger\x20Setup\x0a'),_0x3fc9ad?.[_0x36d33d(0x14e)](_0x3f22f5[_0x36d33d(0x10e)]);if(!_0x3f22f5[_0x36d33d(0x153)](findGitRoot)){await _0x3fc9ad?.[_0x36d33d(0x195)](_0x3f22f5[_0x36d33d(0x10e)],new Error(_0x3f22f5['VMnAy']));throw new Error(_0x3f22f5['VAbuF']);}_0x3fc9ad?.['trackPhaseEnd'](_0x3f22f5['mHpeY']);const _0x4b2ca7=!existsSync(getRangerDir()),{path:_0x1ad0b6}=await _0x3f22f5[_0x36d33d(0x16d)](ensureRangerDir);_0x3fc9ad?.[_0x36d33d(0x14e)](_0x36d33d(0x13a));const _0x22f7c7=await authenticate(_0xe16f25);_0x3fc9ad?.['trackPhaseEnd'](_0x3f22f5['bqxUn'],{'isFirstRun':_0x4b2ca7,'method':_0x22f7c7[_0x36d33d(0x114)]}),_0x3fc9ad?.[_0x36d33d(0x14e)](_0x3f22f5['qfBxL']);_0x1b96ed?.['skipChromium']?console[_0x36d33d(0x188)]('✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)'):await ensureChromium();_0x3fc9ad?.[_0x36d33d(0x128)](_0x36d33d(0x13b),{'isFirstRun':_0x4b2ca7,'skipped':!!_0x1b96ed?.[_0x36d33d(0x143)]}),await _0x3f22f5['tZRyy'](writeRangerGitignore,_0x1ad0b6),console[_0x36d33d(0x188)](_0x3f22f5[_0x36d33d(0x126)]);const _0x2861ae=process[_0x36d33d(0x174)][_0x36d33d(0x119)]&&process[_0x36d33d(0x181)][_0x36d33d(0x119)];if(!_0x2861ae){const _0x5107ca=_0x3f22f5[_0x36d33d(0x159)][_0x36d33d(0x112)]('|');let _0x5daabb=0x0;while(!![]){switch(_0x5107ca[_0x5daabb++]){case'0':return;case'1':console[_0x36d33d(0x188)]('\x20\x20\x20\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x0a');continue;case'2':console[_0x36d33d(0x188)](_0x3f22f5['fDyNv']);continue;case'3':console['log'](_0x3f22f5['NzdgN']);continue;case'4':console[_0x36d33d(0x188)](_0x36d33d(0x16f));continue;case'5':console[_0x36d33d(0x188)](_0x3f22f5['dZqDd']);continue;case'6':console['log']('\x20\x204.\x20Run:\x20ranger\x20profile\x20add\x20local');continue;case'7':console[_0x36d33d(0x188)](_0x3f22f5['jkQNB']);continue;case'8':console['log'](_0x3f22f5['uDPwU']);continue;}break;}}_0x3fc9ad?.[_0x36d33d(0x14e)](_0x36d33d(0x13f)),await ensurePlugin(),_0x3fc9ad?.['trackPhaseEnd'](_0x3f22f5[_0x36d33d(0x113)],{'isFirstRun':_0x4b2ca7}),_0x3fc9ad?.[_0x36d33d(0x14e)](_0x3f22f5['jpKgm']),await _0x3f22f5[_0x36d33d(0x15f)](ensureSkills),_0x3fc9ad?.['trackPhaseEnd'](_0x3f22f5[_0x36d33d(0x171)],{'isFirstRun':_0x4b2ca7});const _0x4c66fc=_0x3f22f5[_0x36d33d(0x153)](findGitRoot);if(_0x4c66fc){const _0xcf5909=join(_0x4c66fc,_0x3f22f5[_0x36d33d(0x13e)]);!_0x3f22f5['tZRyy'](existsSync,_0xcf5909)&&await mkdir(_0xcf5909,{'recursive':!![]});}_0x3fc9ad?.[_0x36d33d(0x14e)](_0x3f22f5[_0x36d33d(0x13c)]);const _0x193304=await ensureLocalEnv(_0x3fc9ad);_0x3fc9ad?.[_0x36d33d(0x128)](_0x3f22f5[_0x36d33d(0x13c)],{'isFirstRun':_0x4b2ca7,'profileReady':_0x193304[_0x36d33d(0x183)],'userSkipped':_0x193304['skipped']});const _0x49bdf5=_0x193304['ready'],_0x45fccc=_0x3f22f5[_0x36d33d(0x146)](bold,_0x3f22f5['LmMzR']);_0x49bdf5&&console[_0x36d33d(0x188)](_0x36d33d(0x173)),console[_0x36d33d(0x188)](_0x3f22f5[_0x36d33d(0x121)](_0x3f22f5[_0x36d33d(0x121)]('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x45fccc+'\x20and\x20prompt\x20the\x20coding'+_0x36d33d(0x155),_0x36d33d(0x17b)),'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.'));}
@@ -1,198 +1 @@
1
- import { readFile, readdir } from 'fs/promises';
2
- import { join, basename } from 'path';
3
- import { existsSync } from 'fs';
4
- import { getToken } from './utils/keychain.js';
5
- import { getCurrentVersion, getLatestVersion } from './utils/version.js';
6
- import { getApiBaseUrl, getCurrentEnvironment } from './utils/environment.js';
7
- import { getProjectSkillsDir, getUserSkillsDir } from './utils/claudeConfig.js';
8
- import { getEnvNames } from './env.js';
9
- import { getCurrentUser } from './utils/userApi.js';
10
- import { getRangerDir } from './utils/rangerRoot.js';
11
- import { getEnvDir } from './utils/settings.js';
12
- import { getPluginInfo } from './utils/claudePlugin.js';
13
- import { RANGER_MANAGED_SKILLS } from './utils/skills.js';
14
- // ANSI formatting helpers
15
- const bold = (text) => `\x1b[1m${text}\x1b[0m`;
16
- const link = (path, text) => `\x1b]8;;file://${path}\x07${text || path}\x1b]8;;\x07`;
17
- async function getSkillsFromDir(skillsDir, level) {
18
- if (!existsSync(skillsDir)) {
19
- return [];
20
- }
21
- const skills = [];
22
- try {
23
- const entries = await readdir(skillsDir, { withFileTypes: true });
24
- for (const entry of entries) {
25
- if (entry.isDirectory()) {
26
- const skillPath = join(skillsDir, entry.name, 'SKILL.md');
27
- if (existsSync(skillPath)) {
28
- let displayName = entry.name;
29
- try {
30
- const content = await readFile(skillPath, 'utf-8');
31
- const nameMatch = content.match(/name:\s*(.+)/);
32
- if (nameMatch) {
33
- displayName = nameMatch[1].trim();
34
- }
35
- }
36
- catch {
37
- // Use folder name as fallback
38
- }
39
- skills.push({
40
- name: entry.name,
41
- displayName,
42
- path: skillPath,
43
- level,
44
- });
45
- }
46
- }
47
- }
48
- }
49
- catch {
50
- return [];
51
- }
52
- return skills;
53
- }
54
- async function getInstalledSkills() {
55
- const [projectSkills, userSkills] = await Promise.all([
56
- getSkillsFromDir(getProjectSkillsDir(), 'project'),
57
- getSkillsFromDir(getUserSkillsDir(), 'user'),
58
- ]);
59
- return { project: projectSkills, user: userSkills };
60
- }
61
- /**
62
- * Get profile information from .ranger directory
63
- */
64
- async function getEnvironments() {
65
- const { envNames, activeEnv } = await getEnvNames();
66
- const rangerDir = getRangerDir();
67
- if (!existsSync(rangerDir)) {
68
- return { envs: [], activeEnv: null };
69
- }
70
- const envs = envNames.map((name) => {
71
- const envDir = getEnvDir(name);
72
- const settingsPath = join(envDir, 'settings.json');
73
- const plaintextAuthPath = join(envDir, 'auth.json');
74
- const encryptedAuthPath = join(envDir, 'auth.json.enc');
75
- return {
76
- name,
77
- settingsPath: existsSync(settingsPath)
78
- ? settingsPath
79
- : '(not found)',
80
- hasPlaintextAuth: existsSync(plaintextAuthPath),
81
- hasEncryptedAuth: existsSync(encryptedAuthPath),
82
- isActive: name === activeEnv,
83
- };
84
- });
85
- return { envs, activeEnv };
86
- }
87
- export async function status() {
88
- console.log('\n📊 Ranger Status\n');
89
- // Root directory
90
- const cwd = process.cwd();
91
- const rangerDir = getRangerDir();
92
- // Check if Ranger is initialized
93
- if (!existsSync(rangerDir)) {
94
- console.log(`Root: ${link(cwd, bold(basename(cwd)))}`);
95
- console.log(`\nRanger has not been initialized in this directory.`);
96
- console.log(` Run: ranger setup [token]\n`);
97
- return;
98
- }
99
- console.log(`Root: ${link(cwd, bold(basename(cwd)))}`);
100
- // Version
101
- const version = getCurrentVersion();
102
- const latestVersion = getLatestVersion();
103
- if (latestVersion && latestVersion !== version) {
104
- console.log(`Version: ${version} (latest: ${latestVersion})`);
105
- console.log(` Run: ranger update`);
106
- }
107
- else if (latestVersion) {
108
- console.log(`Version: ${version} (up to date)`);
109
- }
110
- else {
111
- console.log(`Version: ${version}`);
112
- }
113
- // API Token & User Identity
114
- const token = await getToken();
115
- if (token) {
116
- const result = await getCurrentUser(token);
117
- if (result.success) {
118
- console.log(`Organization: ${bold(result.user.organizationName)}`);
119
- }
120
- else {
121
- console.log(`API Token: ✓ Found but invalid or expired`);
122
- console.log(` Run: ranger setup [token]`);
123
- }
124
- }
125
- else {
126
- console.log(`API Token: ✗ Not found`);
127
- console.log(` Run: ranger setup [token]`);
128
- }
129
- // Debug info (only shown if DEBUG env var is set)
130
- if (process.env.DEBUG) {
131
- console.log(`API Environment: ${getCurrentEnvironment()}`);
132
- console.log(`API URL: ${getApiBaseUrl()}`);
133
- }
134
- // Claude Code Plugin
135
- console.log('\n--- Claude Code Plugin ---');
136
- const pluginInfo = await getPluginInfo('ranger@trailhead');
137
- if (pluginInfo) {
138
- const scopeLabel = pluginInfo.scope || 'unknown';
139
- const statusLabel = pluginInfo.enabled ? 'enabled' : 'disabled';
140
- console.log(` ${bold('ranger@trailhead')}: installed (${scopeLabel}, ${statusLabel})`);
141
- }
142
- else {
143
- console.log(' Not installed');
144
- console.log(' Run: ranger setup [token] (includes plugin installation)');
145
- }
146
- // Skills (only show Ranger-managed skills)
147
- console.log('\n--- Skills ---');
148
- const { project: allProjectSkills, user: allUserSkills } = await getInstalledSkills();
149
- const projectSkills = allProjectSkills.filter((s) => RANGER_MANAGED_SKILLS.includes(s.name));
150
- const userSkills = allUserSkills.filter((s) => RANGER_MANAGED_SKILLS.includes(s.name));
151
- const totalSkills = projectSkills.length + userSkills.length;
152
- if (totalSkills === 0) {
153
- console.log('No skills installed');
154
- console.log(` Run: ranger skillup`);
155
- }
156
- else {
157
- if (projectSkills.length > 0) {
158
- console.log(' Project-level:');
159
- for (const skill of projectSkills) {
160
- console.log(` ${bold(skill.displayName)}: ${link(skill.path, basename(skill.path))}`);
161
- }
162
- }
163
- if (userSkills.length > 0) {
164
- console.log(' User-level:');
165
- for (const skill of userSkills) {
166
- console.log(` ${bold(skill.displayName)}: ${link(skill.path, basename(skill.path))}`);
167
- }
168
- }
169
- }
170
- // Profiles
171
- console.log('\n--- Profiles ---');
172
- const { envs, activeEnv } = await getEnvironments();
173
- if (envs.length === 0) {
174
- console.log('No profiles configured');
175
- console.log(` Run: ranger profile add <profile-name>`);
176
- }
177
- else {
178
- for (const env of envs) {
179
- const activeMarker = env.isActive ? ' (active)' : '';
180
- const authStatus = env.hasEncryptedAuth
181
- ? 'encrypted'
182
- : env.hasPlaintextAuth
183
- ? 'plaintext'
184
- : 'none';
185
- console.log(` ${bold(env.name)}${activeMarker}`);
186
- console.log(` Auth: ${authStatus}`);
187
- if (env.settingsPath !== '(not found)') {
188
- console.log(` Settings: ${link(env.settingsPath, basename(env.settingsPath))}`);
189
- }
190
- }
191
- if (!activeEnv) {
192
- console.log(`\n No active profile set`);
193
- console.log(` Run: ranger profile use <profile-name> (available: ${envs.map((e) => e.name).join(', ')})`);
194
- }
195
- }
196
- console.log('');
197
- }
198
- //# sourceMappingURL=status.js.map
1
+ function _0xa9de(){const _0x123a3c=['\x0a\x20\x20No\x20active\x20profile\x20set','\x0a---\x20Claude\x20Code\x20Plugin\x20---','hasEncryptedAuth','none','JGUud','settingsPath','API\x20Environment:\x20','863822KGqXmf','isDirectory','aptAR','\x0a📊\x20Ranger\x20Status\x0a','isActive','\x20\x20\x20\x20','ranger@trailhead','push','settings.json','log','2436JVoxmo','(not\x20found)','HqgSQ','426844WLhtYl','path',':\x20installed\x20(','\x0a---\x20Profiles\x20---','success','\x1b]8;;\x07','gLvba','uTxNG','plaintext','TlyMr','\x20\x20Run:\x20ranger\x20setup\x20[token]','join','\x20\x20Not\x20installed','scope','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','length','AlYUC','\x20\x20User-level:','utf-8','user','35731Jqbups','auth.json.enc','\x1b[1m','WwVMY','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','Version:\x20','unknown','env','oatvD','4746912JZZrNQ','match','No\x20skills\x20installed','No\x20profiles\x20configured','hasPlaintextAuth','\x20\x20\x20\x20Auth:\x20','1033578KqPgUH','includes','GzGoB','auth.json','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','\x20\x20Project-level:','HjqAp','RrIrg','API\x20URL:\x20','501582DjkvXB','displayName','enabled','2325LbWpsR','wWeVH','name','knIND','\x20\x20\x20\x20Settings:\x20','organizationName'];_0xa9de=function(){return _0x123a3c;};return _0xa9de();}const _0x324e03=_0xdb4e;(function(_0x31abdf,_0x12be3c){const _0x30ea10=_0xdb4e,_0x4a0d36=_0x31abdf();while(!![]){try{const _0x67984c=-parseInt(_0x30ea10(0x129))/0x1+-parseInt(_0x30ea10(0x151))/0x2+parseInt(_0x30ea10(0x141))/0x3+-parseInt(_0x30ea10(0x15e))/0x4+parseInt(_0x30ea10(0x144))/0x5*(parseInt(_0x30ea10(0x15b))/0x6)+-parseInt(_0x30ea10(0x138))/0x7+parseInt(_0x30ea10(0x132))/0x8;if(_0x67984c===_0x12be3c)break;else _0x4a0d36['push'](_0x4a0d36['shift']());}catch(_0x39e747){_0x4a0d36['push'](_0x4a0d36['shift']());}}}(_0xa9de,0x3780d));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';const bold=_0x8bac61=>_0x324e03(0x12b)+_0x8bac61+'\x1b[0m',link=(_0x482ec7,_0x15e788)=>'\x1b]8;;file://'+_0x482ec7+'\x07'+(_0x15e788||_0x482ec7)+_0x324e03(0x11a);function _0xdb4e(_0x546e7d,_0x5509ae){_0x546e7d=_0x546e7d-0x117;const _0xa9deeb=_0xa9de();let _0xdb4ed2=_0xa9deeb[_0x546e7d];return _0xdb4ed2;}async function getSkillsFromDir(_0x19a6b5,_0x29f33c){const _0xcaa07=_0x324e03,_0x54821f={'GgnKn':function(_0x5e4233,_0x395787){return _0x5e4233(_0x395787);},'fmwOh':function(_0x510d50,_0x296d83,_0x1d8dcc){return _0x510d50(_0x296d83,_0x1d8dcc);},'nnJiE':function(_0x2a3bc2,_0x1cf8ed,_0x468ba3){return _0x2a3bc2(_0x1cf8ed,_0x468ba3);}};if(!_0x54821f['GgnKn'](existsSync,_0x19a6b5))return[];const _0x3b4018=[];try{const _0x30002d=await _0x54821f['fmwOh'](readdir,_0x19a6b5,{'withFileTypes':!![]});for(const _0x9ea1b0 of _0x30002d){if(_0x9ea1b0[_0xcaa07(0x152)]()){const _0x9d8cbe=join(_0x19a6b5,_0x9ea1b0['name'],'SKILL.md');if(existsSync(_0x9d8cbe)){let _0x42cf70=_0x9ea1b0['name'];try{const _0x52fb6f=await _0x54821f['nnJiE'](readFile,_0x9d8cbe,_0xcaa07(0x127)),_0x21ef05=_0x52fb6f[_0xcaa07(0x133)](/name:\s*(.+)/);_0x21ef05&&(_0x42cf70=_0x21ef05[0x1]['trim']());}catch{}_0x3b4018[_0xcaa07(0x158)]({'name':_0x9ea1b0[_0xcaa07(0x146)],'displayName':_0x42cf70,'path':_0x9d8cbe,'level':_0x29f33c});}}}}catch{return[];}return _0x3b4018;}async function getInstalledSkills(){const _0x4d9f7a={'EgRNJ':function(_0x375b43,_0xe1c383,_0x41981d){return _0x375b43(_0xe1c383,_0x41981d);},'pEPBc':function(_0x461a03){return _0x461a03();},'KrRmp':'project'},[_0x46422b,_0x5fdae7]=await Promise['all']([_0x4d9f7a['EgRNJ'](getSkillsFromDir,_0x4d9f7a['pEPBc'](getProjectSkillsDir),_0x4d9f7a['KrRmp']),getSkillsFromDir(_0x4d9f7a['pEPBc'](getUserSkillsDir),'user')]);return{'project':_0x46422b,'user':_0x5fdae7};}async function getEnvironments(){const _0x5b51a4=_0x324e03,_0x31c97a={'aptAR':_0x5b51a4(0x13b),'FUSVE':function(_0x412480,_0x34a698,_0x4fd3ba){return _0x412480(_0x34a698,_0x4fd3ba);},'TlyMr':function(_0x5e9522,_0x5a8e0b){return _0x5e9522(_0x5a8e0b);},'AlYUC':function(_0x1e7f3d){return _0x1e7f3d();},'GzGoB':function(_0x57df83,_0x383487){return _0x57df83(_0x383487);}},{envNames:_0x43a680,activeEnv:_0x207560}=await getEnvNames(),_0x4861ac=_0x31c97a[_0x5b51a4(0x125)](getRangerDir);if(!_0x31c97a[_0x5b51a4(0x13a)](existsSync,_0x4861ac))return{'envs':[],'activeEnv':null};const _0x3c3f45=_0x43a680['map'](_0x34d7c6=>{const _0x25f75b=_0x5b51a4,_0x5c68f6=getEnvDir(_0x34d7c6),_0x41631a=join(_0x5c68f6,_0x25f75b(0x159)),_0x46190e=join(_0x5c68f6,_0x31c97a[_0x25f75b(0x153)]),_0x129831=_0x31c97a['FUSVE'](join,_0x5c68f6,_0x25f75b(0x12a));return{'name':_0x34d7c6,'settingsPath':existsSync(_0x41631a)?_0x41631a:'(not\x20found)','hasPlaintextAuth':_0x31c97a['TlyMr'](existsSync,_0x46190e),'hasEncryptedAuth':_0x31c97a[_0x25f75b(0x11e)](existsSync,_0x129831),'isActive':_0x34d7c6===_0x207560};});return{'envs':_0x3c3f45,'activeEnv':_0x207560};}export async function status(){const _0x33d23b=_0x324e03,_0x1eff65={'QlINJ':_0x33d23b(0x154),'JGUud':function(_0xc9163b){return _0xc9163b();},'KBeCA':function(_0x165cc4,_0x124ea1){return _0x165cc4(_0x124ea1);},'vvzTc':function(_0x4fe662,_0x116fb7,_0x19d965){return _0x4fe662(_0x116fb7,_0x19d965);},'FpsaI':function(_0x252de8,_0x1cb1d4,_0x2233c6){return _0x252de8(_0x1cb1d4,_0x2233c6);},'gLvba':function(_0x1b6ddf,_0x25bb70){return _0x1b6ddf!==_0x25bb70;},'UMLvZ':function(_0x5063d6){return _0x5063d6();},'uTxNG':function(_0x4bb445,_0x5e5f5f){return _0x4bb445(_0x5e5f5f);},'WwVMY':_0x33d23b(0x157),'iaArx':_0x33d23b(0x12f),'knIND':'disabled','SBLGU':function(_0x5e0ab8,_0x40ebcc){return _0x5e0ab8(_0x40ebcc);},'XgurX':_0x33d23b(0x121),'IJGeE':_0x33d23b(0x13c),'wWeVH':function(_0x4e0050,_0x8100d0){return _0x4e0050===_0x8100d0;},'HjqAp':function(_0x24cd51,_0x380dc4){return _0x24cd51>_0x380dc4;},'eTDIl':_0x33d23b(0x13d),'HqgSQ':_0x33d23b(0x118),'TTUPa':function(_0x5e0bbd,_0x52b001){return _0x5e0bbd===_0x52b001;},'PeAch':_0x33d23b(0x15c),'RrIrg':function(_0xdb1a29,_0x1f65ad,_0x4f199e){return _0xdb1a29(_0x1f65ad,_0x4f199e);},'oatvD':function(_0x387e60,_0x359c3b){return _0x387e60(_0x359c3b);}};console[_0x33d23b(0x15a)](_0x1eff65['QlINJ']);const _0x4a8131=process['cwd'](),_0x2fbc86=_0x1eff65['JGUud'](getRangerDir);if(!_0x1eff65['KBeCA'](existsSync,_0x2fbc86)){console['log']('Root:\x20'+_0x1eff65['vvzTc'](link,_0x4a8131,bold(basename(_0x4a8131)))),console['log'](_0x33d23b(0x12d)),console[_0x33d23b(0x15a)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console[_0x33d23b(0x15a)]('Root:\x20'+_0x1eff65['FpsaI'](link,_0x4a8131,bold(basename(_0x4a8131))));const _0x6636f0=getCurrentVersion(),_0x5cf1c0=_0x1eff65[_0x33d23b(0x14e)](getLatestVersion);if(_0x5cf1c0&&_0x1eff65[_0x33d23b(0x11b)](_0x5cf1c0,_0x6636f0))console[_0x33d23b(0x15a)]('Version:\x20'+_0x6636f0+'\x20(latest:\x20'+_0x5cf1c0+')'),console['log']('\x20\x20Run:\x20ranger\x20update');else _0x5cf1c0?console['log'](_0x33d23b(0x12e)+_0x6636f0+'\x20(up\x20to\x20date)'):console[_0x33d23b(0x15a)]('Version:\x20'+_0x6636f0);const _0x579f2e=await getToken();if(_0x579f2e){const _0x3cde60=await _0x1eff65['KBeCA'](getCurrentUser,_0x579f2e);_0x3cde60[_0x33d23b(0x119)]?console['log']('Organization:\x20'+bold(_0x3cde60[_0x33d23b(0x128)][_0x33d23b(0x149)])):(console[_0x33d23b(0x15a)](_0x33d23b(0x123)),console[_0x33d23b(0x15a)]('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console[_0x33d23b(0x15a)]('API\x20Token:\x20✗\x20Not\x20found'),console['log'](_0x33d23b(0x11f));process[_0x33d23b(0x130)]['DEBUG']&&(console[_0x33d23b(0x15a)](_0x33d23b(0x150)+_0x1eff65['JGUud'](getCurrentEnvironment)),console[_0x33d23b(0x15a)](_0x33d23b(0x140)+_0x1eff65['UMLvZ'](getApiBaseUrl)));console[_0x33d23b(0x15a)](_0x33d23b(0x14b));const _0x5d75b2=await _0x1eff65[_0x33d23b(0x11c)](getPluginInfo,_0x1eff65[_0x33d23b(0x12c)]);if(_0x5d75b2){const _0x1ec4a8=_0x5d75b2[_0x33d23b(0x122)]||_0x1eff65['iaArx'],_0x40564b=_0x5d75b2[_0x33d23b(0x143)]?_0x33d23b(0x143):_0x1eff65[_0x33d23b(0x147)];console['log']('\x20\x20'+_0x1eff65['SBLGU'](bold,_0x33d23b(0x157))+_0x33d23b(0x117)+_0x1ec4a8+',\x20'+_0x40564b+')');}else console['log'](_0x1eff65['XgurX']),console['log'](_0x1eff65['IJGeE']);console[_0x33d23b(0x15a)]('\x0a---\x20Skills\x20---');const {project:_0x235c1d,user:_0x2b4f6a}=await getInstalledSkills(),_0x4fb7e5=_0x235c1d['filter'](_0x4fd691=>RANGER_MANAGED_SKILLS[_0x33d23b(0x139)](_0x4fd691[_0x33d23b(0x146)])),_0x1f6e51=_0x2b4f6a['filter'](_0x169b92=>RANGER_MANAGED_SKILLS[_0x33d23b(0x139)](_0x169b92['name'])),_0x9ae2d7=_0x4fb7e5[_0x33d23b(0x124)]+_0x1f6e51[_0x33d23b(0x124)];if(_0x1eff65[_0x33d23b(0x145)](_0x9ae2d7,0x0))console[_0x33d23b(0x15a)](_0x33d23b(0x134)),console['log']('\x20\x20Run:\x20ranger\x20skillup');else{if(_0x1eff65[_0x33d23b(0x13e)](_0x4fb7e5[_0x33d23b(0x124)],0x0)){console[_0x33d23b(0x15a)](_0x1eff65['eTDIl']);for(const _0x5ae400 of _0x4fb7e5){console[_0x33d23b(0x15a)](_0x33d23b(0x156)+bold(_0x5ae400['displayName'])+':\x20'+link(_0x5ae400[_0x33d23b(0x15f)],_0x1eff65['KBeCA'](basename,_0x5ae400['path'])));}}if(_0x1f6e51['length']>0x0){console['log'](_0x33d23b(0x126));for(const _0x342587 of _0x1f6e51){console[_0x33d23b(0x15a)](_0x33d23b(0x156)+bold(_0x342587[_0x33d23b(0x142)])+':\x20'+link(_0x342587[_0x33d23b(0x15f)],_0x1eff65['SBLGU'](basename,_0x342587['path'])));}}}console[_0x33d23b(0x15a)](_0x1eff65[_0x33d23b(0x15d)]);const {envs:_0x3fe8f6,activeEnv:_0x304037}=await getEnvironments();if(_0x1eff65['TTUPa'](_0x3fe8f6['length'],0x0))console[_0x33d23b(0x15a)](_0x33d23b(0x135)),console[_0x33d23b(0x15a)]('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{for(const _0x10bab3 of _0x3fe8f6){const _0x1b1a1a=_0x10bab3[_0x33d23b(0x155)]?'\x20(active)':'',_0x27f162=_0x10bab3[_0x33d23b(0x14c)]?'encrypted':_0x10bab3[_0x33d23b(0x136)]?_0x33d23b(0x11d):_0x33d23b(0x14d);console[_0x33d23b(0x15a)]('\x20\x20'+_0x1eff65['SBLGU'](bold,_0x10bab3[_0x33d23b(0x146)])+_0x1b1a1a),console['log'](_0x33d23b(0x137)+_0x27f162),_0x10bab3[_0x33d23b(0x14f)]!==_0x1eff65['PeAch']&&console['log'](_0x33d23b(0x148)+_0x1eff65[_0x33d23b(0x13f)](link,_0x10bab3[_0x33d23b(0x14f)],_0x1eff65[_0x33d23b(0x131)](basename,_0x10bab3[_0x33d23b(0x14f)])));}!_0x304037&&(console[_0x33d23b(0x15a)](_0x33d23b(0x14a)),console['log']('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x3fe8f6['map'](_0x1f2a63=>_0x1f2a63[_0x33d23b(0x146)])[_0x33d23b(0x120)](',\x20')+')'));}console[_0x33d23b(0x15a)]('');}
@@ -1,182 +1 @@
1
- import { spawn } from 'child_process';
2
- import { existsSync } from 'fs';
3
- import { readFile, writeFile } from 'fs/promises';
4
- import { installSkill, removeSkill, RANGER_MANAGED_SKILLS, DEPRECATED_SKILLS, } from './utils/skills.js';
5
- import { PACKAGE_NAME, getCurrentVersion, getLatestVersion, compareVersions, } from './utils/version.js';
6
- import { getSkillsDir } from './utils/claudeConfig.js';
7
- import { join } from 'path';
8
- import { migrateActiveProfileFile } from './utils/activeProfile.js';
9
- import { getRangerDir } from './utils/rangerRoot.js';
10
- async function runInstall() {
11
- return new Promise((resolve) => {
12
- console.log(`\nInstalling ${PACKAGE_NAME}@latest...\n`);
13
- const child = spawn('npm', ['install', '-g', `${PACKAGE_NAME}@latest`], {
14
- stdio: 'inherit',
15
- shell: process.platform === 'win32',
16
- });
17
- child.on('close', (code) => {
18
- resolve(code === 0);
19
- });
20
- child.on('error', () => {
21
- resolve(false);
22
- });
23
- });
24
- }
25
- async function updateClaudeMarketplace() {
26
- return new Promise((resolve) => {
27
- const child = spawn('claude', ['plugin', 'marketplace', 'update', 'trailhead'], {
28
- stdio: 'pipe',
29
- shell: process.platform === 'win32',
30
- });
31
- child.on('close', (code) => {
32
- resolve(code === 0);
33
- });
34
- child.on('error', () => {
35
- resolve(false);
36
- });
37
- });
38
- }
39
- async function updateClaudePlugin(scope) {
40
- return new Promise((resolve) => {
41
- const args = ['plugin', 'update', 'ranger@trailhead'];
42
- if (scope) {
43
- args.push('--scope', scope);
44
- }
45
- const child = spawn('claude', args, {
46
- stdio: 'pipe',
47
- shell: process.platform === 'win32',
48
- });
49
- child.on('close', (code) => {
50
- resolve(code === 0);
51
- });
52
- child.on('error', () => {
53
- resolve(false);
54
- });
55
- });
56
- }
57
- /**
58
- * Check if a skill is installed at the given level
59
- */
60
- function isSkillInstalled(skillName, level) {
61
- const skillDir = join(getSkillsDir(level), skillName);
62
- return existsSync(skillDir);
63
- }
64
- /**
65
- * Reinstall ranger-managed skills that are already installed.
66
- * Only updates skills from RANGER_MANAGED_SKILLS list, ignoring user-defined skills.
67
- * Also removes any deprecated skills.
68
- */
69
- async function reinstallSkills(cliVersion) {
70
- const levels = ['project', 'user'];
71
- // Find which ranger-managed skills are installed at each level
72
- const toReinstall = [];
73
- for (const level of levels) {
74
- for (const skillName of RANGER_MANAGED_SKILLS) {
75
- if (isSkillInstalled(skillName, level)) {
76
- toReinstall.push({ skillName, level });
77
- }
78
- }
79
- }
80
- // Remove deprecated skills
81
- for (const level of levels) {
82
- for (const skillName of DEPRECATED_SKILLS) {
83
- await removeSkill(skillName, level);
84
- }
85
- }
86
- if (toReinstall.length === 0) {
87
- console.log('\nNo ranger-managed skills found to reinstall.');
88
- return;
89
- }
90
- console.log(`\nReinstalling ${toReinstall.length} ranger-managed skill(s)...`);
91
- for (const { skillName, level } of toReinstall) {
92
- try {
93
- await installSkill(skillName, { level, cliVersion });
94
- }
95
- catch (error) {
96
- console.warn(` Failed to reinstall ${level} skill ${skillName}:`, error);
97
- }
98
- }
99
- }
100
- async function ensureActiveProfileGitignored() {
101
- const rangerGitignorePath = join(getRangerDir(), '.gitignore');
102
- if (!existsSync(rangerGitignorePath)) {
103
- return false;
104
- }
105
- let content = '';
106
- try {
107
- content = await readFile(rangerGitignorePath, 'utf-8');
108
- }
109
- catch {
110
- return false;
111
- }
112
- const lines = content.split(/\r?\n/);
113
- if (lines.some((line) => line.trim() === 'active-profile.txt')) {
114
- return false;
115
- }
116
- let insertIndex = lines.findIndex((line) => line.trim() === 'active-feature.txt');
117
- if (insertIndex === -1) {
118
- insertIndex = lines.length;
119
- }
120
- lines.splice(insertIndex, 0, 'active-profile.txt');
121
- let nextContent = lines.join('\n');
122
- if (!nextContent.endsWith('\n')) {
123
- nextContent += '\n';
124
- }
125
- try {
126
- await writeFile(rangerGitignorePath, nextContent, 'utf-8');
127
- }
128
- catch {
129
- return false;
130
- }
131
- return true;
132
- }
133
- export async function update() {
134
- const currentVersion = getCurrentVersion();
135
- console.log(`\nCurrent version: ${currentVersion}`);
136
- console.log('Checking for updates...');
137
- const latestVersion = getLatestVersion();
138
- if (!latestVersion) {
139
- throw new Error('Failed to check for updates. Please check your network connection.');
140
- }
141
- console.log(`Latest version: ${latestVersion}`);
142
- const comparison = compareVersions(currentVersion, latestVersion);
143
- let versionToUse = currentVersion;
144
- if (comparison === 0) {
145
- console.log('\nYou are already on the latest version.');
146
- }
147
- else if (comparison < 0) {
148
- console.log(`\nYour version (${currentVersion}) is newer than the published version (${latestVersion}).`);
149
- }
150
- else {
151
- const success = await runInstall();
152
- if (success) {
153
- console.log(`\nSuccessfully updated to version ${latestVersion}`);
154
- versionToUse = latestVersion;
155
- }
156
- else {
157
- throw new Error(`Update failed. You may need to run with sudo: sudo npm install -g ${PACKAGE_NAME}@latest`);
158
- }
159
- }
160
- // Reinstall all skills to ensure they are up to date
161
- await reinstallSkills(versionToUse);
162
- // Update Claude marketplace and plugin
163
- const marketplaceSuccess = await updateClaudeMarketplace();
164
- if (marketplaceSuccess) {
165
- console.log('\nClaude marketplace updated (trailhead).');
166
- }
167
- const userSuccess = await updateClaudePlugin();
168
- if (userSuccess) {
169
- console.log('\nClaude plugin updated (user scope).');
170
- }
171
- const projectSuccess = await updateClaudePlugin('project');
172
- if (projectSuccess) {
173
- console.log(`${userSuccess ? '' : '\n'}Claude plugin updated (project scope).`);
174
- }
175
- const migratedProfile = await migrateActiveProfileFile();
176
- if (migratedProfile) {
177
- console.log('✓ Migrated active profile file');
178
- }
179
- const updatedGitignore = await ensureActiveProfileGitignored();
180
- console.log('\n✅ Update complete!');
181
- }
182
- //# sourceMappingURL=update.js.map
1
+ (function(_0x3e0a76,_0x5df658){const _0x20bf6e=_0x32b9,_0x1ffdaa=_0x3e0a76();while(!![]){try{const _0x4f3025=parseInt(_0x20bf6e(0x164))/0x1+parseInt(_0x20bf6e(0x15f))/0x2+parseInt(_0x20bf6e(0x150))/0x3+-parseInt(_0x20bf6e(0x151))/0x4*(parseInt(_0x20bf6e(0x168))/0x5)+-parseInt(_0x20bf6e(0x152))/0x6*(parseInt(_0x20bf6e(0x14a))/0x7)+-parseInt(_0x20bf6e(0x14f))/0x8*(-parseInt(_0x20bf6e(0x167))/0x9)+-parseInt(_0x20bf6e(0x14d))/0xa;if(_0x4f3025===_0x5df658)break;else _0x1ffdaa['push'](_0x1ffdaa['shift']());}catch(_0x2db317){_0x1ffdaa['push'](_0x1ffdaa['shift']());}}}(_0x583b,0xb9d9d));import{spawn}from'child_process';import{existsSync}from'fs';import{readFile,writeFile}from'fs/promises';import{installSkill,removeSkill,RANGER_MANAGED_SKILLS,DEPRECATED_SKILLS}from'./utils/skills.js';import{PACKAGE_NAME,getCurrentVersion,getLatestVersion,compareVersions}from'./utils/version.js';import{getSkillsDir}from'./utils/claudeConfig.js';import{join}from'path';import{migrateActiveProfileFile}from'./utils/activeProfile.js';import{getRangerDir}from'./utils/rangerRoot.js';async function runInstall(){const _0x55849e=_0x32b9,_0x5c2844={'oaeZq':function(_0x5cef61,_0x341e27,_0xcff0b4,_0x308f87){return _0x5cef61(_0x341e27,_0xcff0b4,_0x308f87);},'IsFXZ':'install','cQucj':function(_0x2e1ab0,_0x47994b){return _0x2e1ab0===_0x47994b;},'OjJTs':_0x55849e(0x16d),'AqpGq':_0x55849e(0x175)};return new Promise(_0x6e8c4d=>{const _0x3d82dd=_0x55849e;console['log'](_0x3d82dd(0x163)+PACKAGE_NAME+_0x3d82dd(0x170));const _0x3c584e=_0x5c2844[_0x3d82dd(0x15a)](spawn,'npm',[_0x5c2844[_0x3d82dd(0x174)],'-g',PACKAGE_NAME+'@latest'],{'stdio':_0x3d82dd(0x17f),'shell':_0x5c2844['cQucj'](process['platform'],_0x5c2844['OjJTs'])});_0x3c584e['on'](_0x5c2844['AqpGq'],_0x1caaf4=>{_0x6e8c4d(_0x1caaf4===0x0);}),_0x3c584e['on'](_0x3d82dd(0x16a),()=>{_0x6e8c4d(![]);});});}async function updateClaudeMarketplace(){const _0x2d6707=_0x32b9,_0x381f2a={'IMrtY':function(_0x5bb499,_0x23ff40){return _0x5bb499(_0x23ff40);},'sJwgO':function(_0x5db5b4,_0x544be9){return _0x5db5b4(_0x544be9);},'bCPfB':'plugin','XumAv':_0x2d6707(0x155),'mKMLJ':_0x2d6707(0x16d),'aQESY':_0x2d6707(0x175),'OZqRd':_0x2d6707(0x16a)};return new Promise(_0x5ec15e=>{const _0x35e875=_0x2d6707,_0x30eadf=spawn('claude',[_0x381f2a[_0x35e875(0x184)],_0x381f2a[_0x35e875(0x172)],'update',_0x35e875(0x181)],{'stdio':'pipe','shell':process[_0x35e875(0x15b)]===_0x381f2a[_0x35e875(0x149)]});_0x30eadf['on'](_0x381f2a[_0x35e875(0x16c)],_0x4b2d5f=>{const _0x31b2d6=_0x35e875;_0x381f2a[_0x31b2d6(0x153)](_0x5ec15e,_0x4b2d5f===0x0);}),_0x30eadf['on'](_0x381f2a['OZqRd'],()=>{_0x381f2a['sJwgO'](_0x5ec15e,![]);});});}function _0x583b(){const _0x2a80c4=['Checking\x20for\x20updates...','fnHNX',')\x20is\x20newer\x20than\x20the\x20published\x20version\x20(','gEJvH','\x0aReinstalling\x20','update','inherit','\x0a✅\x20Update\x20complete!','trailhead','XlKSw','project','bCPfB','--scope','mKMLJ','14kLNlbD','findIndex','OLtgc','9973120YoBgzc','some','446024vvHqjj','3585174mVBpoS','522912vWdDPM','3886638pMghGA','IMrtY','\x20ranger-managed\x20skill(s)...','marketplace','user','active-profile.txt','DnlYC','\x0aClaude\x20marketplace\x20updated\x20(trailhead).','oaeZq','platform','active-feature.txt','splice','WoICn','2841384wQaGED','JqSxd','log','loCMJ','\x0aInstalling\x20','1074684rfNQPf','xhqpm','\x0aYour\x20version\x20(','45tMggXK','35puUSRJ','XKjQQ','error','AoXxg','aQESY','win32','Ncshl','length','@latest...\x0a','\x0aClaude\x20plugin\x20updated\x20(user\x20scope).','XumAv','utf-8','IsFXZ','close','GtWzD','OqYkh','nDKcE'];_0x583b=function(){return _0x2a80c4;};return _0x583b();}async function updateClaudePlugin(_0x4a51b1){const _0x3f24d2=_0x32b9,_0x4b5e8e={'gEJvH':function(_0x550d82,_0x5772e4){return _0x550d82===_0x5772e4;},'oGSFb':'plugin','OLtgc':_0x3f24d2(0x17e),'GtWzD':'ranger@trailhead','xhqpm':_0x3f24d2(0x148),'SyXdK':function(_0x264584,_0x21b2e4,_0x4126b0,_0x4d1266){return _0x264584(_0x21b2e4,_0x4126b0,_0x4d1266);},'EXmLz':'claude','bZwnT':'pipe','RXXTy':function(_0x497c3b,_0x2acdcf){return _0x497c3b===_0x2acdcf;},'SBSGV':'close'};return new Promise(_0x166466=>{const _0x5e2892=_0x3f24d2,_0x223ecb={'StkFL':function(_0x59665f,_0xb62652){return _0x59665f(_0xb62652);},'WoICn':function(_0x1d63bc,_0x3a168d){const _0x257a5d=_0x32b9;return _0x4b5e8e[_0x257a5d(0x17c)](_0x1d63bc,_0x3a168d);}},_0xd18adb=[_0x4b5e8e['oGSFb'],_0x4b5e8e[_0x5e2892(0x14c)],_0x4b5e8e[_0x5e2892(0x176)]];_0x4a51b1&&_0xd18adb['push'](_0x4b5e8e[_0x5e2892(0x165)],_0x4a51b1);const _0x1f6919=_0x4b5e8e['SyXdK'](spawn,_0x4b5e8e['EXmLz'],_0xd18adb,{'stdio':_0x4b5e8e['bZwnT'],'shell':_0x4b5e8e['RXXTy'](process[_0x5e2892(0x15b)],_0x5e2892(0x16d))});_0x1f6919['on'](_0x4b5e8e['SBSGV'],_0x10d4b3=>{const _0x40f225=_0x5e2892;_0x223ecb['StkFL'](_0x166466,_0x223ecb[_0x40f225(0x15e)](_0x10d4b3,0x0));}),_0x1f6919['on']('error',()=>{_0x166466(![]);});});}function _0x32b9(_0x75c072,_0x581091){_0x75c072=_0x75c072-0x148;const _0x583b77=_0x583b();let _0x32b945=_0x583b77[_0x75c072];return _0x32b945;}function isSkillInstalled(_0x57d819,_0x181b1a){const _0x3689a4=_0x32b9,_0x5f25f4={'nPcLo':function(_0x3bd8ab,_0x39586f,_0x3ea416){return _0x3bd8ab(_0x39586f,_0x3ea416);},'XKjQQ':function(_0x24671c,_0x3c1bf7){return _0x24671c(_0x3c1bf7);}},_0x2e6045=_0x5f25f4['nPcLo'](join,_0x5f25f4[_0x3689a4(0x169)](getSkillsDir,_0x181b1a),_0x57d819);return existsSync(_0x2e6045);}async function reinstallSkills(_0x257e73){const _0x307406=_0x32b9,_0x5cf0f7={'QtIjO':_0x307406(0x156),'Ncshl':function(_0xe2eceb,_0x3bdd0d,_0x29278e){return _0xe2eceb(_0x3bdd0d,_0x29278e);},'FBCEA':function(_0x2144b7,_0x2d2076){return _0x2144b7===_0x2d2076;}},_0x534eff=['project',_0x5cf0f7['QtIjO']],_0x4dd82d=[];for(const _0x1a7d9a of _0x534eff){for(const _0x5cb75a of RANGER_MANAGED_SKILLS){isSkillInstalled(_0x5cb75a,_0x1a7d9a)&&_0x4dd82d['push']({'skillName':_0x5cb75a,'level':_0x1a7d9a});}}for(const _0x23c604 of _0x534eff){for(const _0xdfc2c7 of DEPRECATED_SKILLS){await _0x5cf0f7[_0x307406(0x16e)](removeSkill,_0xdfc2c7,_0x23c604);}}if(_0x5cf0f7['FBCEA'](_0x4dd82d['length'],0x0)){console[_0x307406(0x161)]('\x0aNo\x20ranger-managed\x20skills\x20found\x20to\x20reinstall.');return;}console[_0x307406(0x161)](_0x307406(0x17d)+_0x4dd82d[_0x307406(0x16f)]+_0x307406(0x154));for(const {skillName:_0x886f2,level:_0x50f519}of _0x4dd82d){try{await installSkill(_0x886f2,{'level':_0x50f519,'cliVersion':_0x257e73});}catch(_0x3674f6){console['warn']('\x20\x20Failed\x20to\x20reinstall\x20'+_0x50f519+'\x20skill\x20'+_0x886f2+':',_0x3674f6);}}}async function ensureActiveProfileGitignored(){const _0x30a3d1=_0x32b9,_0x8b1f15={'DnlYC':function(_0x561567,_0x5a9de2,_0x59d02b){return _0x561567(_0x5a9de2,_0x59d02b);},'JqSxd':function(_0x140aac){return _0x140aac();},'loCMJ':'.gitignore','hFGFO':function(_0xaa2e22,_0x4ee0ad){return _0xaa2e22===_0x4ee0ad;}},_0x3325f0=_0x8b1f15[_0x30a3d1(0x158)](join,_0x8b1f15[_0x30a3d1(0x160)](getRangerDir),_0x8b1f15[_0x30a3d1(0x162)]);if(!existsSync(_0x3325f0))return![];let _0x4f89be='';try{_0x4f89be=await readFile(_0x3325f0,'utf-8');}catch{return![];}const _0x21e10b=_0x4f89be['split'](/\r?\n/);if(_0x21e10b[_0x30a3d1(0x14e)](_0x180e11=>_0x180e11['trim']()===_0x30a3d1(0x157)))return![];let _0x1a342d=_0x21e10b[_0x30a3d1(0x14b)](_0xf9be2d=>_0xf9be2d['trim']()===_0x30a3d1(0x15c));_0x8b1f15['hFGFO'](_0x1a342d,-0x1)&&(_0x1a342d=_0x21e10b['length']);_0x21e10b[_0x30a3d1(0x15d)](_0x1a342d,0x0,_0x30a3d1(0x157));let _0x4a01af=_0x21e10b['join']('\x0a');!_0x4a01af['endsWith']('\x0a')&&(_0x4a01af+='\x0a');try{await writeFile(_0x3325f0,_0x4a01af,_0x30a3d1(0x173));}catch{return![];}return!![];}export async function update(){const _0x2733af=_0x32b9,_0x522e7b={'sumxN':function(_0x5caf88){return _0x5caf88();},'NNjdz':'Failed\x20to\x20check\x20for\x20updates.\x20Please\x20check\x20your\x20network\x20connection.','XlKSw':function(_0x2cedbb,_0x42e2ea,_0xef20c1){return _0x2cedbb(_0x42e2ea,_0xef20c1);},'MtWHD':function(_0x1b9a74,_0x4c5def){return _0x1b9a74(_0x4c5def);},'nDKcE':function(_0x298bf3){return _0x298bf3();},'OqYkh':_0x2733af(0x171),'NErXO':function(_0x2a7292,_0x360192){return _0x2a7292(_0x360192);},'NABax':_0x2733af(0x183),'fnHNX':function(_0x497d26){return _0x497d26();},'AoXxg':_0x2733af(0x180)},_0x25fc7d=getCurrentVersion();console['log']('\x0aCurrent\x20version:\x20'+_0x25fc7d),console['log'](_0x2733af(0x179));const _0x12508d=_0x522e7b['sumxN'](getLatestVersion);if(!_0x12508d)throw new Error(_0x522e7b['NNjdz']);console[_0x2733af(0x161)]('Latest\x20version:\x20\x20'+_0x12508d);const _0x3f983c=_0x522e7b[_0x2733af(0x182)](compareVersions,_0x25fc7d,_0x12508d);let _0x1a812c=_0x25fc7d;if(_0x3f983c===0x0)console['log']('\x0aYou\x20are\x20already\x20on\x20the\x20latest\x20version.');else{if(_0x3f983c<0x0)console[_0x2733af(0x161)](_0x2733af(0x166)+_0x25fc7d+_0x2733af(0x17b)+_0x12508d+').');else{const _0x18d906=await runInstall();if(_0x18d906)console['log']('\x0aSuccessfully\x20updated\x20to\x20version\x20'+_0x12508d),_0x1a812c=_0x12508d;else throw new Error('Update\x20failed.\x20You\x20may\x20need\x20to\x20run\x20with\x20sudo:\x20sudo\x20npm\x20install\x20-g\x20'+PACKAGE_NAME+'@latest');}}await _0x522e7b['MtWHD'](reinstallSkills,_0x1a812c);const _0x1bdd8d=await _0x522e7b['sumxN'](updateClaudeMarketplace);_0x1bdd8d&&console[_0x2733af(0x161)](_0x2733af(0x159));const _0x29a260=await _0x522e7b[_0x2733af(0x178)](updateClaudePlugin);_0x29a260&&console[_0x2733af(0x161)](_0x522e7b[_0x2733af(0x177)]);const _0xa18053=await _0x522e7b['NErXO'](updateClaudePlugin,_0x522e7b['NABax']);_0xa18053&&console['log']((_0x29a260?'':'\x0a')+'Claude\x20plugin\x20updated\x20(project\x20scope).');const _0x171302=await _0x522e7b[_0x2733af(0x17a)](migrateActiveProfileFile);_0x171302&&console['log']('✓\x20Migrated\x20active\x20profile\x20file');const _0x281e49=await ensureActiveProfileGitignored();console['log'](_0x522e7b[_0x2733af(0x16b)]);}
@@ -1 +1 @@
1
- (function(_0x2b4e41,_0x3b6194){const _0x4f97f2=_0x2d44,_0x46bf1a=_0x2b4e41();while(!![]){try{const _0x264489=-parseInt(_0x4f97f2(0x174))/0x1*(parseInt(_0x4f97f2(0x18f))/0x2)+parseInt(_0x4f97f2(0x192))/0x3+parseInt(_0x4f97f2(0x19d))/0x4+parseInt(_0x4f97f2(0x19a))/0x5*(-parseInt(_0x4f97f2(0x180))/0x6)+-parseInt(_0x4f97f2(0x176))/0x7+parseInt(_0x4f97f2(0x195))/0x8+parseInt(_0x4f97f2(0x18d))/0x9*(-parseInt(_0x4f97f2(0x17b))/0xa);if(_0x264489===_0x3b6194)break;else _0x46bf1a['push'](_0x46bf1a['shift']());}catch(_0x567f24){_0x46bf1a['push'](_0x46bf1a['shift']());}}}(_0x1ed8,0x9f5c6));function _0x2d44(_0x42ce53,_0x2d37d5){_0x42ce53=_0x42ce53-0x16d;const _0x1ed832=_0x1ed8();let _0x2d44fc=_0x1ed832[_0x42ce53];return _0x2d44fc;}import{writeFile,readFile,unlink}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{chromium}from'playwright';function _0x1ed8(){const _0x52d26f=['\x20\x20\x20A\x20browser\x20will\x20open\x20with\x20your\x20existing\x20session\x20(if\x20any).','\x20\x20\x20Update\x20your\x20authentication\x20as\x20needed.','7675712vKZWLt','SQIze','config_write','HlaFv','\x20\x20Run\x20ranger\x20setup\x20in\x20CI\x20to\x20decrypt\x20at\x20runtime.','14125gaIKna','browser','\x0a✅\x20Profile\x20\x22','4616488WjYTYA','pjcZM','close','log','utf-8','bgFbA','jszlT','LHVkE','storageState','✓\x20Updated\x20config:\x20','Saving\x20authentication\x20state...','ArRjn','313223YTfTHG','.\x20Run\x20first:\x20ranger\x20profile\x20add\x20','752059TTEfJL','MChjC','\x20\x20You\x20can\x20safely\x20commit\x20this\x20file\x20to\x20git.','✓\x20Encrypted\x20auth\x20saved\x20to:\x20','\x22\x20not\x20found.\x20Run\x20first:\x20ranger\x20profile\x20add\x20','50CkULih','popzW','Profile\x20\x22','jnzwG','YDyGO','2118IazZxg','newContext','nmZnm','iRDzG','mUIFY','Non-interactive\x20mode\x20detected.\x0aThe\x20\x22ranger\x20profile\x20update\x22\x20command\x20requires\x20interactive\x20browser\x20authentication\x20and\x20cannot\x20be\x20run\x20in\x20non-TTY\x20environments\x20(CI,\x20scripts,\x20Claude\x20Code).\x0aTo\x20update\x20profile\x20authentication:\x0a\x20\x201.\x20Run\x20\x22ranger\x20profile\x20update\x20<name>\x22\x20in\x20an\x20interactive\x20terminal\x0a\x20\x202.\x20Commit\x20the\x20updated\x20encrypted\x20auth\x20file\x20to\x20git','Config\x20not\x20found\x20at\x20','RGDyE','trackPhaseStart','browser_auth','contextOptions','SVNRo','auth.json','1584423paXmuS','alYHv','2gBzqur','mvEZM','goto','2511828CWPTJy'];_0x1ed8=function(){return _0x52d26f;};return _0x1ed8();}import{encrypt}from'./utils/crypto.js';import{getToken}from'./utils/keychain.js';import{getEnvDir,isEnvCi}from'./utils/settings.js';import{addProfileSetupBanner}from'./utils/profileSetupBanner.js';export async function updateEnv(_0x37d9d4,_0x25ec3f){const _0x45bf11=_0x2d44,_0x231ae2={'LDnmA':_0x45bf11(0x172),'SQIze':function(_0x4a7e6b){return _0x4a7e6b();},'jnzwG':'close','yXahD':function(_0x26febd,_0x21dae3){return _0x26febd(_0x21dae3);},'pjcZM':function(_0x45e3b2,_0x5385d8,_0x52693f){return _0x45e3b2(_0x5385d8,_0x52693f);},'jszlT':_0x45bf11(0x18c),'alYHv':function(_0x55d2c4,_0x6cf59d){return _0x55d2c4+_0x6cf59d;},'bgFbA':'.enc','SVNRo':_0x45bf11(0x1a1),'popzW':function(_0x2ee6c8,_0x5b419c){return _0x2ee6c8===_0x5b419c;},'ookhn':'string','LHVkE':_0x45bf11(0x189),'zXwSn':_0x45bf11(0x193),'HlaFv':_0x45bf11(0x194),'RRPJm':'\x20\x20\x20When\x20you\x20are\x20done,\x20close\x20the\x20browser.\x0a','iRDzG':function(_0x345974,_0x36e614){return _0x345974(_0x36e614);},'nmZnm':function(_0x3c13d2,_0x43bc08){return _0x3c13d2||_0x43bc08;},'RGDyE':function(_0x193aa7,_0x4ca93d,_0x37c536){return _0x193aa7(_0x4ca93d,_0x37c536);},'ArRjn':_0x45bf11(0x178),'mvEZM':_0x45bf11(0x199),'mUIFY':function(_0x3601c6,_0x1c6762,_0x1ea1d0){return _0x3601c6(_0x1c6762,_0x1ea1d0);},'YDyGO':'config_write'},_0xa902c8=_0x231ae2['yXahD'](getEnvDir,_0x37d9d4),_0x1ca89a=join(_0xa902c8,'settings.json'),_0x4a8954=_0x231ae2['pjcZM'](join,_0xa902c8,_0x231ae2[_0x45bf11(0x16e)]),_0x3d4b1a=_0x231ae2[_0x45bf11(0x18e)](_0x4a8954,_0x231ae2[_0x45bf11(0x16d)]),_0x18c05d=process['stdin']['isTTY']&&process['stdout']['isTTY'];if(!_0x18c05d)throw new Error(_0x45bf11(0x185));if(!existsSync(_0xa902c8))throw new Error(_0x45bf11(0x17d)+_0x37d9d4+_0x45bf11(0x17a)+_0x37d9d4);if(!existsSync(_0x1ca89a))throw new Error(_0x45bf11(0x186)+_0x1ca89a+_0x45bf11(0x175)+_0x37d9d4);const _0x186568=await readFile(_0x1ca89a,_0x231ae2['SVNRo']),_0x5b14a2=JSON['parse'](_0x186568),_0x43a468=_0x231ae2[_0x45bf11(0x17c)](typeof _0x5b14a2['baseUrl'],_0x231ae2['ookhn'])?_0x5b14a2['baseUrl']:undefined,_0x36b341=existsSync(_0x4a8954),_0x313c4a=_0x231ae2['yXahD'](isEnvCi,_0x37d9d4);_0x25ec3f?.[_0x45bf11(0x188)](_0x231ae2[_0x45bf11(0x16f)]),console['log']('\x0a📋\x20Authentication\x20Update'),console[_0x45bf11(0x1a0)](_0x231ae2['zXwSn']),console[_0x45bf11(0x1a0)](_0x231ae2[_0x45bf11(0x198)]),console[_0x45bf11(0x1a0)](_0x231ae2['RRPJm']);const _0x8e27cf=await chromium['launch']({'headless':![]}),_0x20954d=_0x36b341?{'storageState':_0x4a8954}:{};let _0x4c0681=null;try{_0x4c0681=await _0x8e27cf[_0x45bf11(0x181)](_0x20954d),await _0x231ae2[_0x45bf11(0x183)](addProfileSetupBanner,_0x4c0681);const _0x2e58a9=await _0x4c0681['newPage']();await _0x2e58a9[_0x45bf11(0x191)](_0x231ae2[_0x45bf11(0x182)](_0x43a468,'about:blank')),await new Promise(_0x5f4259=>{const _0x63de61=_0x45bf11,_0x336d6e={'MChjC':_0x231ae2['LDnmA'],'QeLHt':function(_0x586a0){const _0x1467ab=_0x2d44;return _0x231ae2[_0x1467ab(0x196)](_0x586a0);}};_0x2e58a9['on'](_0x231ae2[_0x63de61(0x17e)],async()=>{const _0x1d1b73=_0x63de61;try{console['log'](_0x336d6e[_0x1d1b73(0x177)]),await _0x4c0681?.[_0x1d1b73(0x170)]({'path':_0x4a8954}),_0x336d6e['QeLHt'](_0x5f4259);}catch{_0x5f4259();}});});}finally{_0x4c0681&&await _0x4c0681[_0x45bf11(0x19f)]()['catch'](()=>{}),await _0x8e27cf['close']()['catch'](()=>{});}if(_0x313c4a){const _0x35a3d1=await _0x231ae2[_0x45bf11(0x187)](readFile,_0x4a8954,_0x231ae2[_0x45bf11(0x18b)]),_0x4b3650=await getToken();if(!_0x4b3650)console['error']('\x20\x20Could\x20not\x20encrypt:\x20No\x20API\x20token\x20found.\x20Run:\x20ranger\x20setup\x20[token]'),console['log']('✓\x20Auth\x20state\x20saved\x20to:\x20'+_0x4a8954);else{const _0x5cea67=encrypt(_0x35a3d1,_0x4b3650);await _0x231ae2[_0x45bf11(0x19e)](writeFile,_0x3d4b1a,_0x5cea67),await unlink(_0x4a8954),console['log'](_0x45bf11(0x179)+_0x3d4b1a),console[_0x45bf11(0x1a0)](_0x231ae2[_0x45bf11(0x173)]),console[_0x45bf11(0x1a0)](_0x231ae2[_0x45bf11(0x190)]);}}else console['log']('✓\x20Auth\x20state\x20saved\x20to:\x20'+_0x4a8954);_0x25ec3f?.['trackPhaseEnd'](_0x231ae2[_0x45bf11(0x16f)]),_0x25ec3f?.['trackPhaseStart'](_0x45bf11(0x197)),_0x5b14a2[_0x45bf11(0x19b)]=_0x5b14a2['browser']||{},_0x5b14a2['browser'][_0x45bf11(0x18a)]=_0x5b14a2[_0x45bf11(0x19b)][_0x45bf11(0x18a)]||{},_0x5b14a2[_0x45bf11(0x19b)]['contextOptions'][_0x45bf11(0x170)]=_0x4a8954,await _0x231ae2[_0x45bf11(0x184)](writeFile,_0x1ca89a,JSON['stringify'](_0x5b14a2,null,0x2)),console[_0x45bf11(0x1a0)](_0x45bf11(0x171)+_0x1ca89a),_0x25ec3f?.['trackPhaseEnd'](_0x231ae2[_0x45bf11(0x17f)]),console[_0x45bf11(0x1a0)](_0x45bf11(0x19c)+_0x37d9d4+'\x22\x20authentication\x20updated');}
1
+ (function(_0x40b080,_0x807dbd){const _0x19bbe4=_0x29f6,_0x7e8523=_0x40b080();while(!![]){try{const _0xbadba=-parseInt(_0x19bbe4(0x203))/0x1*(-parseInt(_0x19bbe4(0x1ec))/0x2)+parseInt(_0x19bbe4(0x1dd))/0x3*(-parseInt(_0x19bbe4(0x200))/0x4)+-parseInt(_0x19bbe4(0x1ea))/0x5*(-parseInt(_0x19bbe4(0x1fa))/0x6)+-parseInt(_0x19bbe4(0x1f4))/0x7+-parseInt(_0x19bbe4(0x1f6))/0x8+parseInt(_0x19bbe4(0x206))/0x9+parseInt(_0x19bbe4(0x1f3))/0xa*(-parseInt(_0x19bbe4(0x1e1))/0xb);if(_0xbadba===_0x807dbd)break;else _0x7e8523['push'](_0x7e8523['shift']());}catch(_0xf0e489){_0x7e8523['push'](_0x7e8523['shift']());}}}(_0x3400,0xae811));function _0x29f6(_0x24d92f,_0x10d2db){_0x24d92f=_0x24d92f-0x1dd;const _0x3400e4=_0x3400();let _0x29f67f=_0x3400e4[_0x24d92f];return _0x29f67f;}import{writeFile,readFile,unlink}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{chromium}from'playwright';import{encrypt}from'./utils/crypto.js';import{getToken}from'./utils/keychain.js';import{getEnvDir,isEnvCi}from'./utils/settings.js';import{addProfileSetupBanner}from'./utils/profileSetupBanner.js';function _0x3400(){const _0x100132=['4RobKqZ','utf-8','storageState','11rCUoNe','trackPhaseEnd','.\x20Run\x20first:\x20ranger\x20profile\x20add\x20','11109321HSGmHB','120573rcpTmJ','catch','HeBdK','jMAWQ','33IBETyh','anoLS','oJhDj','\x20\x20You\x20can\x20safely\x20commit\x20this\x20file\x20to\x20git.','close','\x0a✅\x20Profile\x20\x22','.enc','✓\x20Auth\x20state\x20saved\x20to:\x20','browser_auth','5ZiPcad','stdout','113676eRYRow','browser','log','\x20\x20\x20When\x20you\x20are\x20done,\x20close\x20the\x20browser.\x0a','error','\x22\x20authentication\x20updated','UFHBX','4568990tdYYAO','1613948MMPOLt','jduqW','32040CmPYUW','goto','Non-interactive\x20mode\x20detected.\x0aThe\x20\x22ranger\x20profile\x20update\x22\x20command\x20requires\x20interactive\x20browser\x20authentication\x20and\x20cannot\x20be\x20run\x20in\x20non-TTY\x20environments\x20(CI,\x20scripts,\x20Claude\x20Code).\x0aTo\x20update\x20profile\x20authentication:\x0a\x20\x201.\x20Run\x20\x22ranger\x20profile\x20update\x20<name>\x22\x20in\x20an\x20interactive\x20terminal\x0a\x20\x202.\x20Commit\x20the\x20updated\x20encrypted\x20auth\x20file\x20to\x20git','config_write','3003834DZiUcA','fvykU','trackPhaseStart','newPage','newContext','atwLs'];_0x3400=function(){return _0x100132;};return _0x3400();}export async function updateEnv(_0x3acfd7,_0x307ea6){const _0x2431e5=_0x29f6,_0x2835ae={'Svbog':function(_0x20d323){return _0x20d323();},'UFHBX':function(_0x2040cf){return _0x2040cf();},'anoLS':function(_0x1ce703,_0x36fd7c,_0x5ddea8){return _0x1ce703(_0x36fd7c,_0x5ddea8);},'HeBdK':'auth.json','IVmca':function(_0x481e39,_0x355c88){return _0x481e39+_0x355c88;},'lJipA':function(_0xc859d0,_0x2369d6){return _0xc859d0(_0x2369d6);},'hQSEj':function(_0x44347d,_0x1f760b){return _0x44347d===_0x1f760b;},'ZqBXK':'\x0a📋\x20Authentication\x20Update','atwLs':_0x2431e5(0x1ef),'jMAWQ':function(_0x54e929,_0x4331a5){return _0x54e929||_0x4331a5;},'fvykU':'about:blank','oJhDj':'\x20\x20Could\x20not\x20encrypt:\x20No\x20API\x20token\x20found.\x20Run:\x20ranger\x20setup\x20[token]','hjoai':_0x2431e5(0x1e4),'jduqW':'config_write','ZQVri':function(_0x5a1bb2,_0x321384,_0x6c7f2){return _0x5a1bb2(_0x321384,_0x6c7f2);}},_0xdefd7d=getEnvDir(_0x3acfd7),_0x22fd20=join(_0xdefd7d,'settings.json'),_0x1a83ac=_0x2835ae['anoLS'](join,_0xdefd7d,_0x2835ae[_0x2431e5(0x1df)]),_0x52d248=_0x2835ae['IVmca'](_0x1a83ac,_0x2431e5(0x1e7)),_0x2f52cc=process['stdin']['isTTY']&&process[_0x2431e5(0x1eb)]['isTTY'];if(!_0x2f52cc)throw new Error(_0x2431e5(0x1f8));if(!existsSync(_0xdefd7d))throw new Error('Profile\x20\x22'+_0x3acfd7+'\x22\x20not\x20found.\x20Run\x20first:\x20ranger\x20profile\x20add\x20'+_0x3acfd7);if(!_0x2835ae['lJipA'](existsSync,_0x22fd20))throw new Error('Config\x20not\x20found\x20at\x20'+_0x22fd20+_0x2431e5(0x205)+_0x3acfd7);const _0x5a7da8=await readFile(_0x22fd20,_0x2431e5(0x201)),_0x3596d0=JSON['parse'](_0x5a7da8),_0x2241d2=_0x2835ae['hQSEj'](typeof _0x3596d0['baseUrl'],'string')?_0x3596d0['baseUrl']:undefined,_0xdc588f=existsSync(_0x1a83ac),_0x4f9b1b=isEnvCi(_0x3acfd7);_0x307ea6?.[_0x2431e5(0x1fc)](_0x2431e5(0x1e9)),console[_0x2431e5(0x1ee)](_0x2835ae['ZqBXK']),console['log']('\x20\x20\x20A\x20browser\x20will\x20open\x20with\x20your\x20existing\x20session\x20(if\x20any).'),console['log']('\x20\x20\x20Update\x20your\x20authentication\x20as\x20needed.'),console[_0x2431e5(0x1ee)](_0x2835ae[_0x2431e5(0x1ff)]);const _0x1267a6=await chromium['launch']({'headless':![]}),_0x1f6fcb=_0xdc588f?{'storageState':_0x1a83ac}:{};let _0x331d2c=null;try{_0x331d2c=await _0x1267a6[_0x2431e5(0x1fe)](_0x1f6fcb),await addProfileSetupBanner(_0x331d2c);const _0x16060a=await _0x331d2c[_0x2431e5(0x1fd)]();await _0x16060a[_0x2431e5(0x1f7)](_0x2835ae[_0x2431e5(0x1e0)](_0x2241d2,_0x2835ae[_0x2431e5(0x1fb)])),await new Promise(_0x1739cb=>{const _0x8c42c=_0x2431e5,_0x5d15af={'PnkNf':function(_0x4bd1c1){return _0x2835ae['Svbog'](_0x4bd1c1);},'PFJOp':function(_0x4b769e){const _0x2bf452=_0x29f6;return _0x2835ae[_0x2bf452(0x1f2)](_0x4b769e);}};_0x16060a['on'](_0x8c42c(0x1e5),async()=>{const _0x481322=_0x8c42c;try{console['log']('Saving\x20authentication\x20state...'),await _0x331d2c?.[_0x481322(0x202)]({'path':_0x1a83ac}),_0x5d15af['PnkNf'](_0x1739cb);}catch{_0x5d15af['PFJOp'](_0x1739cb);}});});}finally{_0x331d2c&&await _0x331d2c['close']()['catch'](()=>{}),await _0x1267a6['close']()[_0x2431e5(0x1de)](()=>{});}if(_0x4f9b1b){const _0x1e7187=await readFile(_0x1a83ac,'utf-8'),_0x4fe96f=await getToken();if(!_0x4fe96f)console[_0x2431e5(0x1f0)](_0x2835ae[_0x2431e5(0x1e3)]),console[_0x2431e5(0x1ee)]('✓\x20Auth\x20state\x20saved\x20to:\x20'+_0x1a83ac);else{const _0x58bbfe=_0x2835ae[_0x2431e5(0x1e2)](encrypt,_0x1e7187,_0x4fe96f);await writeFile(_0x52d248,_0x58bbfe),await _0x2835ae['lJipA'](unlink,_0x1a83ac),console['log']('✓\x20Encrypted\x20auth\x20saved\x20to:\x20'+_0x52d248),console['log'](_0x2835ae['hjoai']),console[_0x2431e5(0x1ee)]('\x20\x20Run\x20ranger\x20setup\x20in\x20CI\x20to\x20decrypt\x20at\x20runtime.');}}else console['log'](_0x2431e5(0x1e8)+_0x1a83ac);_0x307ea6?.['trackPhaseEnd']('browser_auth'),_0x307ea6?.[_0x2431e5(0x1fc)](_0x2835ae[_0x2431e5(0x1f5)]),_0x3596d0['browser']=_0x3596d0[_0x2431e5(0x1ed)]||{},_0x3596d0['browser']['contextOptions']=_0x3596d0[_0x2431e5(0x1ed)]['contextOptions']||{},_0x3596d0['browser']['contextOptions']['storageState']=_0x1a83ac,await _0x2835ae['ZQVri'](writeFile,_0x22fd20,JSON['stringify'](_0x3596d0,null,0x2)),console['log']('✓\x20Updated\x20config:\x20'+_0x22fd20),_0x307ea6?.[_0x2431e5(0x204)](_0x2431e5(0x1f9)),console['log'](_0x2431e5(0x1e6)+_0x3acfd7+_0x2431e5(0x1f1));}
@@ -1 +1 @@
1
- function _0xb2cf(_0x5e2187,_0x106df4){_0x5e2187=_0x5e2187-0xad;const _0x376b83=_0x376b();let _0xb2cf36=_0x376b83[_0x5e2187];return _0xb2cf36;}(function(_0xf6d158,_0xacadab){const _0x4a3186=_0xb2cf,_0x5537b0=_0xf6d158();while(!![]){try{const _0x534493=parseInt(_0x4a3186(0xbb))/0x1*(parseInt(_0x4a3186(0xad))/0x2)+parseInt(_0x4a3186(0xb9))/0x3+-parseInt(_0x4a3186(0xbf))/0x4*(-parseInt(_0x4a3186(0xb4))/0x5)+parseInt(_0x4a3186(0xb5))/0x6*(-parseInt(_0x4a3186(0xbc))/0x7)+parseInt(_0x4a3186(0xbe))/0x8*(parseInt(_0x4a3186(0xae))/0x9)+-parseInt(_0x4a3186(0xb0))/0xa*(parseInt(_0x4a3186(0xb1))/0xb)+-parseInt(_0x4a3186(0xb7))/0xc*(parseInt(_0x4a3186(0xb8))/0xd);if(_0x534493===_0xacadab)break;else _0x5537b0['push'](_0x5537b0['shift']());}catch(_0x4e43b5){_0x5537b0['push'](_0x5537b0['shift']());}}}(_0x376b,0xac0f5));import{join}from'path';import{existsSync}from'fs';function _0x376b(){const _0x216551=['11177452VVVIXl','etQRK','log','12170CpZxzi','6EThkjQ','\x0a✓\x20Now\x20using\x20profile\x20\x22','12HYAJfr','3434743xlfPzS','3885999GIqOBy','Profile\x20\x22','5RpYwXS','6344429ybrvwm','\x22\x20not\x20found.\x20Run\x20first:\x20ranger\x20profile\x20add\x20','8DDWkUu','332ZSXdqJ','535750MfYYEj','492453eMLakr','settings.json','10rADGdl'];_0x376b=function(){return _0x216551;};return _0x376b();}import{getEnvDir}from'./utils/settings.js';import{writeActiveProfileName}from'./utils/activeProfile.js';export async function useEnv(_0x57e751){const _0x401063=_0xb2cf,_0x5ea3cc={'etQRK':function(_0x55bfec,_0x415d29){return _0x55bfec(_0x415d29);}},_0x3ce4eb=_0x5ea3cc[_0x401063(0xb2)](getEnvDir,_0x57e751),_0x5117fb=join(_0x3ce4eb,_0x401063(0xaf));if(!existsSync(_0x3ce4eb))throw new Error(_0x401063(0xba)+_0x57e751+_0x401063(0xbd)+_0x57e751);if(!existsSync(_0x5117fb))throw new Error('Config\x20not\x20found\x20at\x20'+_0x5117fb+'.\x20Run\x20first:\x20ranger\x20profile\x20add\x20'+_0x57e751);await writeActiveProfileName(_0x57e751),console[_0x401063(0xb3)](_0x401063(0xb6)+_0x57e751+'\x22');}
1
+ (function(_0x3e5ad9,_0x339186){const _0x4bfe32=_0x4148,_0x4af59c=_0x3e5ad9();while(!![]){try{const _0x582879=-parseInt(_0x4bfe32(0x104))/0x1+parseInt(_0x4bfe32(0x106))/0x2*(parseInt(_0x4bfe32(0x111))/0x3)+-parseInt(_0x4bfe32(0x10a))/0x4*(-parseInt(_0x4bfe32(0x10f))/0x5)+-parseInt(_0x4bfe32(0x112))/0x6+-parseInt(_0x4bfe32(0x10d))/0x7+parseInt(_0x4bfe32(0x105))/0x8*(-parseInt(_0x4bfe32(0x109))/0x9)+-parseInt(_0x4bfe32(0x10b))/0xa*(-parseInt(_0x4bfe32(0x113))/0xb);if(_0x582879===_0x339186)break;else _0x4af59c['push'](_0x4af59c['shift']());}catch(_0x24c04e){_0x4af59c['push'](_0x4af59c['shift']());}}}(_0x4b72,0x7924c));import{join}from'path';import{existsSync}from'fs';function _0x4b72(){const _0x487e79=['settings.json','Profile\x20\x22','27GyiibB','8biSkxi','150710hxatcB','\x0a✓\x20Now\x20using\x20profile\x20\x22','6075433MTdGOP','.\x20Run\x20first:\x20ranger\x20profile\x20add\x20','1422895pELUDX','GTRPE','960aTiuzs','4446660JPHzxR','1727IsfxZa','899941qQLIIN','1601416dHzGBR','4190dfHDUI'];_0x4b72=function(){return _0x487e79;};return _0x4b72();}import{getEnvDir}from'./utils/settings.js';function _0x4148(_0x1b0c4f,_0x4b0643){_0x1b0c4f=_0x1b0c4f-0x104;const _0x4b72af=_0x4b72();let _0x414825=_0x4b72af[_0x1b0c4f];return _0x414825;}import{writeActiveProfileName}from'./utils/activeProfile.js';export async function useEnv(_0x240d15){const _0x46d06a=_0x4148,_0x5979dd={'HhSOr':function(_0xd511a0,_0x3b66bc){return _0xd511a0(_0x3b66bc);},'xXxuC':function(_0x42a98,_0x3069df,_0xbf5f4e){return _0x42a98(_0x3069df,_0xbf5f4e);},'GTRPE':_0x46d06a(0x107)},_0x465362=_0x5979dd['HhSOr'](getEnvDir,_0x240d15),_0xd25e9=_0x5979dd['xXxuC'](join,_0x465362,_0x5979dd[_0x46d06a(0x110)]);if(!existsSync(_0x465362))throw new Error(_0x46d06a(0x108)+_0x240d15+'\x22\x20not\x20found.\x20Run\x20first:\x20ranger\x20profile\x20add\x20'+_0x240d15);if(!existsSync(_0xd25e9))throw new Error('Config\x20not\x20found\x20at\x20'+_0xd25e9+_0x46d06a(0x10e)+_0x240d15);await writeActiveProfileName(_0x240d15),console['log'](_0x46d06a(0x10c)+_0x240d15+'\x22');}