@ranger-testing/ranger-cli 2.5.4-alpha.57338f5-12 → 2.5.4-alpha.8c24bb2-15
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.
- package/README.md +36 -14
- package/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/migrateProfile.js +1 -1
- package/build/commands/setup/claude.js +1 -1
- package/build/commands/setup/opencode.js +1 -1
- package/build/commands/setupCi.js +1 -1
- package/build/commands/skillup.js +1 -1
- package/build/commands/start.js +1 -1
- package/build/commands/status.js +1 -1
- package/build/commands/update.js +1 -1
- package/build/commands/updateEnv.js +1 -1
- package/build/commands/useEnv.js +1 -1
- package/build/commands/utils/activeProfile.js +1 -1
- package/build/commands/utils/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/cloudProfile.js +1 -1
- package/build/commands/utils/cloudProfileSession.js +1 -1
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/gitTracked.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/legacyWarning.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/matchAuthEnvironment.js +1 -1
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/opencodeConfig.js +1 -1
- package/build/commands/utils/playwrightCli.js +1 -1
- package/build/commands/utils/profileMessages.js +1 -1
- package/build/commands/utils/profileSetupBanner.js +1 -1
- package/build/commands/utils/projectsConfig.js +1 -1
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/resolveProfileContext.js +1 -1
- package/build/commands/utils/resolveProfileUrl.js +1 -1
- package/build/commands/utils/retry.js +1 -1
- package/build/commands/utils/sessionCache.js +1 -1
- package/build/commands/utils/settings.js +1 -1
- package/build/commands/utils/skillContent.js +1 -1
- package/build/commands/utils/skills.js +1 -1
- package/build/commands/utils/stitchWebmFiles.js +1 -1
- package/build/commands/utils/telemetry.js +1 -1
- package/build/commands/utils/tokenRefresh.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -1
- package/build/commands/utils/userApi.js +1 -1
- package/build/commands/utils/version.js +1 -1
- package/build/commands/verifyFeature.js +1 -1
- package/build/commands/verifyFeatureCli.js +1 -1
- package/build/skills/ranger/SKILL.md +15 -5
- package/build/skills/ranger/verify.md +15 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2a89b5,_0x540135){const _0x40afbf=_0x3803,_0x5caef1=_0x2a89b5();while(!![]){try{const _0x20ba68=-parseInt(_0x40afbf(0x15b))/0x1+parseInt(_0x40afbf(0x15c))/0x2+parseInt(_0x40afbf(0x161))/0x3*(-parseInt(_0x40afbf(0x153))/0x4)+parseInt(_0x40afbf(0x16b))/0x5*(-parseInt(_0x40afbf(0x16f))/0x6)+-parseInt(_0x40afbf(0x174))/0x7*(parseInt(_0x40afbf(0x177))/0x8)+-parseInt(_0x40afbf(0x175))/0x9*(-parseInt(_0x40afbf(0x155))/0xa)+parseInt(_0x40afbf(0x15a))/0xb*(parseInt(_0x40afbf(0x16e))/0xc);if(_0x20ba68===_0x540135)break;else _0x5caef1['push'](_0x5caef1['shift']());}catch(_0x4b1f16){_0x5caef1['push'](_0x5caef1['shift']());}}}(_0x918a,0xdf62d));import{join}from'path';function _0x3803(_0x210aff,_0x25c011){_0x210aff=_0x210aff-0x152;const _0x918a08=_0x918a();let _0x380352=_0x918a08[_0x210aff];return _0x380352;}import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0x306a4f from'inquirer';function _0x918a(){const _0x456125=['3RPUMew','log','user','prompt','UaaEJ','utf-8','\x0a📦\x20OpenCode\x20Plugin\x0a','plugin','parse','includes','2458805HLXruV','error','$schema','156HXthwu','12IsogGE','FQqyS','BVjCp','WdLQb','✓\x20OpenCode\x20plugin\x20configured','7vIvsFp','2094768DXaoDV','WFfXb','11501264lnWBHG','opencode.json','5361904XEKOCp','Where\x20should\x20the\x20plugin\x20be\x20installed?','20ObsCej','pluginScope','pXflB','WuSHY','project','3367727wUjcfh','974523BLsRHb','2411246jjCdPL','ZoLYB','JAiGT','Project\x20(shared\x20with\x20team\x20via\x20git)','KomnB'];_0x918a=function(){return _0x456125;};return _0x918a();}import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0x10b82e){const _0x54bed8=_0x3803,_0x8d9567={'NxQrF':function(_0x32b220,_0x5160ad){return _0x32b220(_0x5160ad);},'WFfXb':_0x54bed8(0x159),'pmzAB':_0x54bed8(0x152),'WdLQb':_0x54bed8(0x167),'eqAOr':'list','pXflB':_0x54bed8(0x156),'WuSHY':_0x54bed8(0x154),'UaaEJ':'User\x20(available\x20in\x20all\x20your\x20projects)','ZoLYB':_0x54bed8(0x15f),'KomnB':_0x54bed8(0x163),'DpkYD':'https://opencode.ai/config.json','YlCCE':function(_0x2c9318,_0x4a5191,_0x193b07){return _0x2c9318(_0x4a5191,_0x193b07);},'hUtIk':_0x54bed8(0x166),'JAiGT':'⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','gUXrO':'Failed\x20to\x20read\x20opencode.json','wieXs':'✓\x20OpenCode\x20plugin\x20already\x20configured','BVjCp':function(_0x5d2a99,_0x43021b,_0x5da6df){return _0x5d2a99(_0x43021b,_0x5da6df);},'FQqyS':function(_0x3f06ea,_0x35da07){return _0x3f06ea(_0x35da07);}},_0x5cdb2f=existsSync(join(_0x8d9567['NxQrF'](getOpencodeConfigDir,_0x8d9567[_0x54bed8(0x176)]),_0x8d9567['pmzAB']));let _0x41cfea;if(_0x10b82e)_0x41cfea=_0x10b82e;else{if(_0x5cdb2f)_0x41cfea='project';else{console['log'](_0x8d9567[_0x54bed8(0x172)]);const _0x364dc9=await _0x306a4f[_0x54bed8(0x164)]([{'type':_0x8d9567['eqAOr'],'name':_0x8d9567[_0x54bed8(0x157)],'message':_0x8d9567[_0x54bed8(0x158)],'choices':[{'name':_0x8d9567[_0x54bed8(0x165)],'value':'user'},{'name':_0x8d9567[_0x54bed8(0x15d)],'value':_0x8d9567[_0x54bed8(0x176)]}],'default':_0x8d9567[_0x54bed8(0x160)]}]);_0x41cfea=_0x364dc9[_0x54bed8(0x156)];}}const _0x18d512=join(getOpencodeConfigDir(_0x41cfea),_0x8d9567['pmzAB']),_0x211d8e='@ranger-testing/opencode-plugin',_0x2c0439=_0x8d9567['DpkYD'];let _0xfca833={};if(existsSync(_0x18d512))try{const _0x321859=await _0x8d9567['YlCCE'](readFile,_0x18d512,_0x8d9567['hUtIk']);_0xfca833=JSON[_0x54bed8(0x169)](_0x321859);}catch(_0x536bf6){return console[_0x54bed8(0x16c)](_0x8d9567[_0x54bed8(0x15e)]),{'configured':![],'scope':_0x41cfea,'error':_0x8d9567['gUXrO'],'details':_0x536bf6};}const _0x2ef857=Array['isArray'](_0xfca833['plugin'])?_0xfca833[_0x54bed8(0x168)]:[];if(_0x2ef857[_0x54bed8(0x16a)](_0x211d8e))return console['log'](_0x8d9567['wieXs']),{'configured':![],'scope':_0x41cfea};return _0xfca833['$schema']=_0xfca833[_0x54bed8(0x16d)]||_0x2c0439,_0xfca833['plugin']=[..._0x2ef857,_0x211d8e],await _0x8d9567[_0x54bed8(0x171)](mkdir,_0x8d9567[_0x54bed8(0x170)](getOpencodeConfigDir,_0x41cfea),{'recursive':!![]}),await writeFile(_0x18d512,JSON['stringify'](_0xfca833,null,0x2)+'\x0a'),console[_0x54bed8(0x162)](_0x54bed8(0x173)),{'configured':!![],'scope':_0x41cfea};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x29a7(){var _0x3b3a92=['93267IuNZXx','916eOxmzB','1755608oBeyaz','ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','exit','2096633diLfgQ','197671GzinLA','14HJWnFO','1220PpObmG','2PzUseU','RrRpH','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','793404qqQiwW','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','280839vCFGPa','210SwgmwV'];_0x29a7=function(){return _0x3b3a92;};return _0x29a7();}function _0x1eaf(_0x57c11f,_0x1ef4de){_0x57c11f=_0x57c11f-0x88;var _0x29a7a3=_0x29a7();var _0x1eafda=_0x29a7a3[_0x57c11f];return _0x1eafda;}(function(_0x53974f,_0x2b4ce3){var _0x1697cd=_0x1eaf,_0x5b266f=_0x53974f();while(!![]){try{var _0x2cfcb3=-parseInt(_0x1697cd(0x91))/0x1*(-parseInt(_0x1697cd(0x94))/0x2)+-parseInt(_0x1697cd(0x89))/0x3+parseInt(_0x1697cd(0x8c))/0x4*(parseInt(_0x1697cd(0x93))/0x5)+-parseInt(_0x1697cd(0x97))/0x6*(parseInt(_0x1697cd(0x92))/0x7)+parseInt(_0x1697cd(0x8d))/0x8+parseInt(_0x1697cd(0x8b))/0x9*(parseInt(_0x1697cd(0x8a))/0xa)+-parseInt(_0x1697cd(0x90))/0xb;if(_0x2cfcb3===_0x2b4ce3)break;else _0x5b266f['push'](_0x5b266f['shift']());}catch(_0x438b74){_0x5b266f['push'](_0x5b266f['shift']());}}}(_0x29a7,0x22a71));export async function setupCi(_0x578302,_0xe365fb,_0xdf9073){var _0x144d0b=_0x1eaf,_0x196502={'RrRpH':function(_0x37626f,_0xf865a9){return _0x37626f+_0xf865a9;},'MwkpD':function(_0xc864fc,_0x50908e){return _0xc864fc+_0x50908e;},'eMSEo':function(_0x599efb,_0x4ba199){return _0x599efb+_0x4ba199;},'SKjFb':_0x144d0b(0x8e)};console['error'](_0x196502[_0x144d0b(0x95)](_0x196502['MwkpD'](_0x196502['eMSEo'](_0x196502['SKjFb'],'\x0a'),_0x144d0b(0x88))+'\x20\x20ranger\x20profile\x20add\x20<name>\x0a'+'\x0a'+_0x144d0b(0x96),'\x20\x20https://docs.ranger.net/main/concepts/profiles')),process[_0x144d0b(0x8f)](0x1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x53bfda,_0x434e69){const _0x1ae76d=_0x1feb,_0x2f3cb3=_0x53bfda();while(!![]){try{const _0xbcd292=parseInt(_0x1ae76d(0x149))/0x1+parseInt(_0x1ae76d(0x131))/0x2+parseInt(_0x1ae76d(0x151))/0x3+-parseInt(_0x1ae76d(0x140))/0x4+parseInt(_0x1ae76d(0x12a))/0x5+parseInt(_0x1ae76d(0x144))/0x6*(-parseInt(_0x1ae76d(0x148))/0x7)+parseInt(_0x1ae76d(0x137))/0x8;if(_0xbcd292===_0x434e69)break;else _0x2f3cb3['push'](_0x2f3cb3['shift']());}catch(_0x184fac){_0x2f3cb3['push'](_0x2f3cb3['shift']());}}}(_0x5d70,0x87206));import{basename}from'path';import _0x26dc88 from'inquirer';function _0x1feb(_0x6e69f1,_0x167e75){_0x6e69f1=_0x6e69f1-0x12a;const _0x5d70be=_0x5d70();let _0x1feb9c=_0x5d70be[_0x6e69f1];return _0x1feb9c;}import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';function _0x5d70(){const _0x2519cb=['To\x20get\x20started:','This\x20project\x20only\x20(','autoInstall','prompt','373786JjVWWO','✓\x20Found\x20API\x20token','user','\x0a✅\x20Installed\x20','xugwN','Where\x20should\x20skills\x20be\x20installed?','9642392DbMlMa','log','\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a','To\x20use:','installLevel','DgNdB','mcIkv','QSQes','\x20--opencode','4124536ZwLUnm','opencode','claude','/skills/','3049962ilKSns','\x20\x202.\x20Run:\x20ranger\x20setup','uvwSB','cWGCz','14WBmDxI','274743uAIJep','NwtMx','XyKNv','stdout','KmgKp','xhHPF','\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','suppressUsage','1546068WZBbxE','Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20(','\x20successfully!\x0a','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','UihCJ','project-level','2094875LDhhFO','platform','pZiun'];_0x5d70=function(){return _0x2519cb;};return _0x5d70();}import{getCurrentVersion}from'./utils/version.js';import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0xc53ae1={}){const _0x37bc91=_0x1feb,_0x369a43={'NwtMx':_0x37bc91(0x142),'uvwSB':function(_0x5af69f){return _0x5af69f();},'XnLzd':'❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','QSQes':_0x37bc91(0x12d),'XyKNv':_0x37bc91(0x154),'teuyu':_0x37bc91(0x141),'hqfQU':function(_0x46e912,_0x4de1c3){return _0x46e912===_0x4de1c3;},'KqAGd':_0x37bc91(0x132),'xugwN':function(_0x1928dd,_0x1fad8d){return _0x1928dd(_0x1fad8d);},'ExzTa':function(_0x104527,_0x4783da){return _0x104527===_0x4783da;},'gCYaZ':function(_0x2f735e){return _0x2f735e();},'CKXqO':_0x37bc91(0x136),'xhHPF':'user','mcIkv':'project','kpOFI':function(_0x478740){return _0x478740();},'dggGK':'\x0a📦\x20Installing\x20skills...\x0a','cWGCz':function(_0x659887,_0x56f727,_0x77a25){return _0x659887(_0x56f727,_0x77a25);},'KmgKp':_0x37bc91(0x14f),'OBHir':function(_0x1ebbcd,_0x41dee2){return _0x1ebbcd instanceof _0x41dee2;},'Vvrak':function(_0x44bb1b,_0x39d84e){return _0x44bb1b===_0x39d84e;},'wfguc':_0x37bc91(0x13a),'UihCJ':function(_0x5277f2,_0x219af1){return _0x5277f2===_0x219af1;},'pZiun':'\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','DgNdB':'\x20\x20-\x20Open\x20Claude\x20Code\x20in\x20plan\x20mode\x20and\x20run\x20/ranger:enable.\x20Plan\x20out\x20a\x20UI\x20feature\x20with\x20Ranger\x20and\x20watch\x20Ranger\x20test\x20it\x20for\x20you!'};console[_0x37bc91(0x138)]('\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a');const _0x42628a=_0xc53ae1[_0x37bc91(0x12b)]??_0x369a43[_0x37bc91(0x14a)],_0x74c731=await _0x369a43[_0x37bc91(0x146)](getToken);if(!_0x74c731){console['log'](_0x369a43['XnLzd']),console['log'](_0x369a43[_0x37bc91(0x13e)]),console[_0x37bc91(0x138)](_0x369a43[_0x37bc91(0x14b)]),console[_0x37bc91(0x138)](_0x37bc91(0x145)+(_0x42628a===_0x369a43['teuyu']?'\x20--opencode':'')+'\x20<your-api-token>'),console[_0x37bc91(0x138)]('\x20\x203.\x20Run:\x20ranger\x20skillup'+(_0x369a43['hqfQU'](_0x42628a,_0x37bc91(0x141))?_0x37bc91(0x13f):'')+'\x0a');return;}console[_0x37bc91(0x138)](_0x369a43['KqAGd']);const _0xa891e9=getProjectRoot(),_0x44a4da=_0x369a43[_0x37bc91(0x135)](basename,_0xa891e9),_0x164379=_0x369a43['ExzTa'](_0x42628a,_0x369a43['teuyu'])?getOpencodeConfigDir(_0x37bc91(0x133))+_0x37bc91(0x143):_0x369a43['gCYaZ'](getClaudeConfigDir)+'/skills/',_0x351705=_0x42628a===_0x369a43['teuyu']?_0xa891e9+'/.opencode/skills/':_0xa891e9+'/.claude/skills/',_0x2c0af1=process['stdin']['isTTY']&&process[_0x37bc91(0x14c)]['isTTY'];let _0x517b70;if(_0xc53ae1['autoInstall'])_0x517b70=_0xc53ae1[_0x37bc91(0x12f)];else{if(_0x2c0af1){const _0x45af7f=await _0x26dc88[_0x37bc91(0x130)]([{'type':'list','name':'installLevel','message':_0x369a43['CKXqO'],'choices':[{'name':'All\x20projects\x20('+_0x164379+')','value':_0x369a43[_0x37bc91(0x14e)]},{'name':_0x37bc91(0x12e)+_0x351705+')','value':_0x369a43[_0x37bc91(0x13d)]}]}]);_0x517b70=_0x45af7f[_0x37bc91(0x13b)];}else _0x517b70=_0x369a43[_0x37bc91(0x13d)],console['log'](_0x37bc91(0x152)+_0x351705+')');}let _0x31acbc=0x0;const _0x51ddc9=_0x369a43['kpOFI'](getCurrentVersion);console[_0x37bc91(0x138)](_0x369a43['dggGK']);try{const _0x37c1bb=await _0x369a43[_0x37bc91(0x147)](installSkill,'ranger',{'cliVersion':_0x51ddc9,'level':_0x517b70,'platform':_0x42628a});_0x37c1bb&&_0x31acbc++;}catch(_0x1e3eff){console['warn'](_0x369a43[_0x37bc91(0x14d)],_0x369a43['OBHir'](_0x1e3eff,Error)?_0x1e3eff['message']:_0x1e3eff);}if(_0x31acbc>0x0){const _0x4154ad=_0x369a43['Vvrak'](_0x517b70,_0x369a43[_0x37bc91(0x14e)])?'user-level':_0x37bc91(0x156);console['log'](_0x37bc91(0x134)+_0x31acbc+'\x20'+_0x4154ad+'\x20skill'+(_0x31acbc>0x1?'s':'')+_0x37bc91(0x153)),!_0xc53ae1[_0x37bc91(0x150)]&&(console['log'](_0x369a43['wfguc']),_0x369a43[_0x37bc91(0x155)](_0x42628a,'opencode')?console['log'](_0x369a43[_0x37bc91(0x12c)]):console['log'](_0x369a43[_0x37bc91(0x13c)]));}else console['log'](_0x37bc91(0x139));}
|
package/build/commands/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x12da14=_0x5a86;(function(_0x4f7829,_0x5528be){const _0x265e13=_0x5a86,_0x49e020=_0x4f7829();while(!![]){try{const _0x168bb2=parseInt(_0x265e13(0x179))/0x1+parseInt(_0x265e13(0x18a))/0x2*(-parseInt(_0x265e13(0x1b0))/0x3)+-parseInt(_0x265e13(0x1ac))/0x4*(parseInt(_0x265e13(0x1cb))/0x5)+parseInt(_0x265e13(0x1e4))/0x6*(parseInt(_0x265e13(0x184))/0x7)+-parseInt(_0x265e13(0x1e1))/0x8+-parseInt(_0x265e13(0x177))/0x9*(-parseInt(_0x265e13(0x1b3))/0xa)+parseInt(_0x265e13(0x1da))/0xb*(-parseInt(_0x265e13(0x1dd))/0xc);if(_0x168bb2===_0x5528be)break;else _0x49e020['push'](_0x49e020['shift']());}catch(_0x3d49e9){_0x49e020['push'](_0x49e020['shift']());}}}(_0x95d4,0x59fa1));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x1287d4 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION=_0x12da14(0x193);const bold=_0x369f67=>_0x12da14(0x1db)+_0x369f67+'\x1b[0m';export function getPlaywrightVersion(){try{const _0x25d3e7=require['resolve']('playwright/package.json'),_0x44355c=require(_0x25d3e7);return _0x44355c['version'];}catch{return null;}}export function installChromiumBinary(_0x2bf272,_0x459ab0=![]){const _0x32a197=_0x12da14,_0x7378d9={'bGoYy':function(_0x5a2b88,_0x5406c4){return _0x5a2b88(_0x5406c4);},'ThgfW':function(_0x140018){return _0x140018();},'TjvQx':_0x32a197(0x1d0),'WzDCY':function(_0x2bf31d,_0x2e8f2d,_0x585cc4,_0x1f588a){return _0x2bf31d(_0x2e8f2d,_0x585cc4,_0x1f588a);},'ahdGQ':_0x32a197(0x174),'qfqxj':'ignore','oKHzm':_0x32a197(0x1b5),'fwNWg':function(_0x3101ad,_0x83c046){return _0x3101ad===_0x83c046;},'rPTrR':_0x32a197(0x170),'RbOcw':_0x32a197(0x178),'FZXex':'error'};return new Promise((_0x4fb238,_0x1d1b80)=>{const _0xaf1d66=_0x32a197,_0x3617e2={'OlNGN':function(_0x3576b2){const _0x16be7b=_0x5a86;return _0x7378d9[_0x16be7b(0x1e6)](_0x3576b2);}},_0x2eb552=['playwright@'+_0x2bf272,'install',..._0x459ab0?['--with-deps']:[],_0x7378d9[_0xaf1d66(0x17f)]],_0x5a2759=_0x7378d9['WzDCY'](spawn,_0x7378d9[_0xaf1d66(0x186)],_0x2eb552,{'stdio':[_0x7378d9['qfqxj'],_0x7378d9['oKHzm'],'inherit'],'shell':_0x7378d9['fwNWg'](process[_0xaf1d66(0x1a6)],_0x7378d9['rPTrR'])});_0x5a2759['on'](_0x7378d9['RbOcw'],_0x2cb176=>{const _0x474a00=_0xaf1d66;_0x2cb176===0x0?_0x3617e2[_0x474a00(0x1a9)](_0x4fb238):_0x1d1b80(new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x2cb176));}),_0x5a2759['on'](_0x7378d9['FZXex'],_0x5739ed=>{const _0x5d44ce=_0xaf1d66;_0x7378d9[_0x5d44ce(0x1cd)](_0x1d1b80,_0x5739ed);});});}export async function authenticate(_0xf57481){const _0x3dd560=_0x12da14,_0x29fe31={'TdUPQ':function(_0x43b67d){return _0x43b67d();},'UefMW':function(_0x4cd1ba,_0x3c5cd7){return _0x4cd1ba(_0x3c5cd7);},'eAssv':_0x3dd560(0x1bb),'ruMyX':function(_0x384daf,_0x2bd3d1){return _0x384daf(_0x2bd3d1);}};if(!_0xf57481){const _0x44a34b=await _0x29fe31['TdUPQ'](getToken);if(_0x44a34b){const _0x37727c=await _0x29fe31[_0x3dd560(0x1d4)](getCurrentUser,_0x44a34b);if(_0x37727c[_0x3dd560(0x1b9)])return console[_0x3dd560(0x1a2)](_0x3dd560(0x18f)+_0x37727c[_0x3dd560(0x1bf)]['organizationName']),{'token':_0x44a34b,'method':'existing_token'};}try{_0xf57481=await _0x29fe31[_0x3dd560(0x19a)](runDeviceAuthFlow);}catch(_0x4c45d2){throw new Error('Authentication\x20failed:\x20'+(_0x4c45d2 instanceof Error?_0x4c45d2[_0x3dd560(0x188)]:_0x4c45d2));}const _0x2582b6=await getCurrentUser(_0xf57481);if(!_0x2582b6['success'])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x2582b6[_0x3dd560(0x1d7)]);return console['log'](_0x3dd560(0x1c5)+_0x2582b6['user'][_0x3dd560(0x17b)]),{'token':_0xf57481,'method':_0x3dd560(0x19e)};}console['log'](_0x29fe31['eAssv']);const _0xdb1952=await _0x29fe31[_0x3dd560(0x198)](getCurrentUser,_0xf57481);if(!_0xdb1952['success']){if(_0xdb1952[_0x3dd560(0x1a0)])throw new Error(_0x3dd560(0x1c3)+_0xdb1952['error']+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error(_0x3dd560(0x171)+_0xdb1952[_0x3dd560(0x1d7)]+_0x3dd560(0x17d));}return console['log']('✓\x20Authenticated\x20to\x20'+_0xdb1952[_0x3dd560(0x1bf)][_0x3dd560(0x17b)]),await _0x29fe31[_0x3dd560(0x198)](storeToken,_0xf57481),console['log'](process['env']['GITHUB_ENV']?'✓\x20Exported\x20credentials\x20for\x20CI':_0x3dd560(0x1b4)),{'token':_0xf57481,'method':'provided_token'};}export async function ensureRangerDir(_0x361d26){const _0xed6ef=_0x12da14,_0x33a9d2={'MCTji':function(_0x240e33,_0x32b92d){return _0x240e33(_0x32b92d);},'TklmY':_0xed6ef(0x194)};void _0x361d26;const _0x4b1cf1=getRangerHomeDir();return!_0x33a9d2[_0xed6ef(0x1c9)](existsSync,_0x4b1cf1)?(await mkdir(_0x4b1cf1,{'recursive':!![]}),console[_0xed6ef(0x1a2)](_0x33a9d2[_0xed6ef(0x1a5)]),{'path':_0x4b1cf1,'installed':!![]}):(console['log']('✓\x20~/.ranger/\x20directory\x20already\x20exists'),{'path':_0x4b1cf1,'installed':![]});}export async function ensureChromium(_0x5b37ea=![]){const _0x2d565f=_0x12da14,_0x43a53a={'nOyLv':function(_0x1fbc18,_0x132d25){return _0x1fbc18(_0x132d25);},'YIFJM':function(_0x13f6bd,_0x471fd8){return _0x13f6bd??_0x471fd8;},'OfSbb':'confirm','lCwoP':'\x0aInstalling\x20Chromium\x20browser...\x0a','WsLhk':'\x0a❌\x20Failed\x20to\x20install\x20Chromium:','duLng':function(_0x916e1,_0x2d9cfa){return _0x916e1 instanceof _0x2d9cfa;}};let _0x40951e=![];try{const _0x4490a9=chromium[_0x2d565f(0x1e2)]();_0x40951e=_0x43a53a['nOyLv'](existsSync,_0x4490a9);}catch{_0x40951e=![];}if(_0x40951e)return console['log'](_0x2d565f(0x1b1)),![];const _0x33e6a7=getPlaywrightVersion(),_0xa5cf24=_0x43a53a['YIFJM'](_0x33e6a7,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x5fa35b=!_0x33e6a7,_0x173020=process[_0x2d565f(0x1a8)]['isTTY']&&process[_0x2d565f(0x1ba)]['isTTY'];let _0x4485ea=!![];if(_0x173020){const {install:_0x3aae04}=await _0x1287d4['prompt']([{'type':_0x43a53a[_0x2d565f(0x187)],'name':_0x2d565f(0x1b2),'message':_0x5fa35b?_0x2d565f(0x17e)+_0xa5cf24+_0x2d565f(0x190):_0x2d565f(0x192)+_0xa5cf24+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x4485ea=_0x3aae04;}else console['log']('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0xa5cf24+(_0x5fa35b?'\x20(fallback\x20version)':'')+'...');if(_0x4485ea){console['log'](_0x43a53a['lCwoP']);try{await installChromiumBinary(_0xa5cf24,_0x5b37ea),console['log'](_0x2d565f(0x1d2));}catch(_0x7dcbd){console[_0x2d565f(0x1d7)](_0x43a53a['WsLhk'],_0x43a53a['duLng'](_0x7dcbd,Error)?_0x7dcbd[_0x2d565f(0x188)]:_0x7dcbd),console[_0x2d565f(0x1a2)](_0x2d565f(0x18b)),console['log'](_0x2d565f(0x1e5)+_0xa5cf24+_0x2d565f(0x185));}}else console['log']('\x0a⚠\x20Skipping\x20Chromium\x20installation.'),console[_0x2d565f(0x1a2)]('You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'),console['log'](_0x2d565f(0x1e5)+_0xa5cf24+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x535c8b){const _0x2a2a7c=_0x12da14,_0x195a27={'OnLOa':function(_0x4ec462,_0x314e23,_0x41c648){return _0x4ec462(_0x314e23,_0x41c648);},'ahlVK':'✓\x20Created\x20.ranger/.gitignore'},_0x56832b=_0x195a27[_0x2a2a7c(0x1c2)](join,_0x535c8b,_0x2a2a7c(0x18d)),_0xb9a37a=_0x2a2a7c(0x1e0);await _0x195a27[_0x2a2a7c(0x1c2)](writeFile,_0x56832b,_0xb9a37a),console[_0x2a2a7c(0x1a2)](_0x195a27[_0x2a2a7c(0x1cf)]);}function _0x5a86(_0x579157,_0x4ce8fb){_0x579157=_0x579157-0x16f;const _0x95d48e=_0x95d4();let _0x5a8655=_0x95d48e[_0x579157];return _0x5a8655;}function _0x95d4(){const _0x4fa806=['You\x20can\x20install\x20it\x20manually\x20by\x20running:','\x0aIn\x20Claude\x20Code,\x20run\x20','.gitignore','/ranger:enable','✓\x20Already\x20authenticated\x20to\x20','\x20now?','\x0aTo\x20verify\x20with\x20a\x20browser,\x20set\x20','The\x20required\x20version\x20(','1.58.2','✓\x20Created\x20~/.ranger/\x20directory','ranger\x20profile\x20add','\x20and\x20prompt\x20the\x20coding','\x0a\x20\x20config\x20uses\x20username+password).\x20Orgs\x20on\x20SSO/SAML/OAuth','ruMyX','qBaHQ','TdUPQ','auth','HsMQk','✓\x20Local\x20profile\x20already\x20exists','device_auth','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','status','XPIHA','log','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','scope','TklmY','platform','allowInsecureLocalhost','stdin','OlNGN','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','UgiBN','5452vggeCw','✓\x20Skipping\x20authentication\x20(--skip-auth)','trackPhaseEnd','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','9AGZGuk','✓\x20Playwright\x20Chromium\x20browser\x20found','install','10wwomXy','✓\x20Stored\x20credentials\x20locally','inherit','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','\x0a\x20\x20your\x20org\x27s\x20auth\x20config\x20drives\x20which\x20flow\x20runs.','success','stdout','Validating\x20API\x20token...','gDXYr','cZKDq','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','user','opencode','profile','OnLOa','Authentication\x20failed:\x20','\x20may\x20need\x20a\x20one-time\x20headed\x20login\x20instead\x20—','✓\x20Authenticated\x20to\x20','ready','BoULs','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','MCTji','\x20is\x20no\x20longer\x20supported.\x20','1610hnoqsH','LrBmS','bGoYy','trackPhaseStart','ahlVK','chromium','skills','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','skipAuth','UefMW','IVbkg','plugin','error','skipped','HYqPw','22zpakuw','\x1b[1m','\x20\x20(or\x20use\x20','2216316fYgzgz','jPNAQ','vhNJS','\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','437280vvfgdP','executablePath','CsGDX','48TwogbS','\x20\x20npx\x20playwright@','ThgfW','RANGER_TEST_USERNAME','OGXek','win32','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','fXcaX','VKxjs','npx','\x0a❌\x20Profile\x20setup\x20failed:','cSpaC','5152392VGPUnv','close','265264zlSLcI','dECrW','organizationName','ranger\x20setup\x20--scope=','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','TjvQx','buNdk','ZyPZT','force','url','561358OmxKFk','\x20install\x20chromium','ahdGQ','OfSbb','message','local','165218aWZvVO'];_0x95d4=function(){return _0x4fa806;};return _0x95d4();}export async function ensureLocalEnv(_0xdabcfb,_0x956764){const _0x5130e5=_0x12da14,_0x82245c={'cSpaC':function(_0x2c6163){return _0x2c6163();},'vhNJS':function(_0x35cf1a,_0x185ba7){return _0x35cf1a!==_0x185ba7;},'IVbkg':_0x5130e5(0x1bf),'ufDQD':_0x5130e5(0x1be),'dECrW':function(_0x12a893){return _0x12a893();},'zEYrf':function(_0x367ff0,_0x1dbdff,_0x544011){return _0x367ff0(_0x1dbdff,_0x544011);},'XPIHA':_0x5130e5(0x189),'qBaHQ':_0x5130e5(0x19d),'tJTUX':function(_0x348c0f,_0x404e8f,_0x3a9972,_0x536e81){return _0x348c0f(_0x404e8f,_0x3a9972,_0x536e81);},'nntpm':_0x5130e5(0x175),'LsJWE':function(_0x3c306c,_0x3b5062){return _0x3c306c instanceof _0x3b5062;}};if(!_0x82245c[_0x5130e5(0x176)](findGitRoot)&&_0x82245c[_0x5130e5(0x1df)](_0xdabcfb?.['scope'],_0x82245c[_0x5130e5(0x1d5)]))return console[_0x5130e5(0x1a2)](_0x82245c['ufDQD']),{'ready':![],'skipped':!![]};const _0x233202=_0xdabcfb?.['scope']===_0x82245c['IVbkg']?_0x82245c[_0x5130e5(0x17a)](getRangerHomeDir):undefined;if(_0x82245c['zEYrf'](findExistingEnv,_0x82245c[_0x5130e5(0x1a1)],{'locations':[_0x82245c[_0x5130e5(0x1a1)]],'rangerDir':_0x233202}))return console['log'](_0x82245c[_0x5130e5(0x199)]),{'ready':!![],'skipped':![]};try{return await _0x82245c['tJTUX'](addEnv,'local',{'url':_0xdabcfb?.['url'],'force':_0xdabcfb?.[_0x5130e5(0x182)],'allowInsecureLocalhost':_0xdabcfb?.['allowInsecureLocalhost'],'scope':_0xdabcfb?.['scope']},_0x956764),{'ready':!![],'skipped':![]};}catch(_0x272339){return console['error'](_0x82245c['nntpm'],_0x82245c['LsJWE'](_0x272339,Error)?_0x272339['message']:_0x272339),{'ready':![],'skipped':![]};}}export async function start(_0x527efe,_0x3aa466,_0x2ff430){const _0x532cc2=_0x12da14,_0x427ea9={'ZyPZT':'\x0a🚀\x20Ranger\x20Setup\x0a','OGXek':function(_0x2446ad,_0x2daaf6){return _0x2446ad!==_0x2daaf6;},'RLAwz':function(_0xe527c1,_0x55e73d){return _0xe527c1+_0x55e73d;},'gDXYr':function(_0x5e409e,_0x2c1ada){return _0x5e409e(_0x2c1ada);},'jPNAQ':function(_0x3e5567,_0x410455){return _0x3e5567(_0x410455);},'LrBmS':_0x532cc2(0x1ad),'tOVVM':_0x532cc2(0x19b),'ynnHg':function(_0x779509,_0x2dd81a){return _0x779509(_0x2dd81a);},'UgiBN':function(_0x276e4d,_0x470946){return _0x276e4d(_0x470946);},'CsGDX':'plugin','xNoSE':function(_0x1db47e,_0x37bb7d){return _0x1db47e(_0x37bb7d);},'Bqdzb':_0x532cc2(0x1d1),'buNdk':function(_0x14889e,_0x29d46d,_0x25b4a0){return _0x14889e(_0x29d46d,_0x25b4a0);},'SHJRR':_0x532cc2(0x1c0),'hpfou':function(_0x5b197c,_0x4a1ed0){return _0x5b197c instanceof _0x4a1ed0;},'BoULs':function(_0x501794,_0x1943ad){return _0x501794(_0x1943ad);},'cZKDq':_0x532cc2(0x1c1),'fXcaX':function(_0x3b4db8,_0x5acaba,_0x3b118d){return _0x3b4db8(_0x5acaba,_0x3b118d);},'fSuHy':function(_0xcab11d,_0x2b29e0){return _0xcab11d(_0x2b29e0);},'VKxjs':'RANGER_TEST_PASSWORD','UFdNF':function(_0x232391,_0x405605){return _0x232391(_0x405605);},'zxPdc':_0x532cc2(0x195),'HsMQk':'\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','HYqPw':'verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','TjFuQ':function(_0x2b5a0d,_0x522561){return _0x2b5a0d+_0x522561;},'IAYKV':function(_0x3c7163,_0x49c841){return _0x3c7163+_0x49c841;}};console['log'](_0x427ea9[_0x532cc2(0x181)]);_0x3aa466?.[_0x532cc2(0x1a4)]!==undefined&&_0x427ea9[_0x532cc2(0x16f)](_0x3aa466['scope'],'user')&&(console[_0x532cc2(0x1d7)](_0x427ea9['RLAwz'](_0x532cc2(0x17c)+_0x427ea9[_0x532cc2(0x1bc)](String,_0x3aa466[_0x532cc2(0x1a4)])+_0x532cc2(0x1ca)+_0x532cc2(0x1a3),'project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.')),process['exit'](0x1));_0x3aa466={..._0x3aa466,'scope':_0x532cc2(0x1bf)};const _0x3ebd74=!existsSync(getRangerHomeDir());await _0x427ea9['jPNAQ'](ensureRangerDir,_0x532cc2(0x1bf));if(_0x3aa466?.['skipAuth'])console[_0x532cc2(0x1a2)](_0x427ea9[_0x532cc2(0x1cc)]),_0x2ff430?.[_0x532cc2(0x1ae)]('auth',{'isFirstRun':_0x3ebd74,'method':'skipped'});else{_0x2ff430?.[_0x532cc2(0x1ce)](_0x427ea9['tOVVM']);const _0x3b74c6=await _0x427ea9['ynnHg'](authenticate,_0x527efe);_0x2ff430?.[_0x532cc2(0x1ae)]('auth',{'isFirstRun':_0x3ebd74,'method':_0x3b74c6['method']});}_0x2ff430?.['trackPhaseStart'](_0x532cc2(0x1d0));_0x3aa466?.['skipChromium']?console['log'](_0x532cc2(0x19f)):await _0x427ea9[_0x532cc2(0x1de)](ensureChromium,_0x3aa466?.['withDeps']);_0x2ff430?.['trackPhaseEnd'](_0x532cc2(0x1d0),{'isFirstRun':_0x3ebd74,'skipped':!!_0x3aa466?.['skipChromium']}),console[_0x532cc2(0x1a2)]('\x0a✅\x20Ranger\x20setup\x20complete!\x0a');const _0x41447a=_0x3aa466?.[_0x532cc2(0x1a4)],_0xec96a8=_0x3aa466?.['opencode']??![];let _0x53a665=null;_0xec96a8?(_0x2ff430?.[_0x532cc2(0x1ce)](_0x532cc2(0x1d6)),_0x53a665=await _0x427ea9[_0x532cc2(0x1ab)](ensureOpencodePluginConfig,_0x41447a),_0x2ff430?.['trackPhaseEnd'](_0x427ea9[_0x532cc2(0x1e3)],{'isFirstRun':_0x3ebd74,'opencode':!![]})):(_0x2ff430?.[_0x532cc2(0x1ce)](_0x427ea9[_0x532cc2(0x1e3)]),await _0x427ea9['xNoSE'](ensureClaudePlugin,_0x41447a),_0x2ff430?.['trackPhaseEnd']('plugin',{'isFirstRun':_0x3ebd74}));if(_0xec96a8&&_0x53a665){_0x2ff430?.[_0x532cc2(0x1ce)](_0x427ea9['Bqdzb']);try{await _0x427ea9[_0x532cc2(0x180)](installSkill,'ranger',{'level':_0x53a665[_0x532cc2(0x1a4)],'cliVersion':getCurrentVersion(),'platform':_0x427ea9['SHJRR']}),_0x2ff430?.['trackPhaseEnd'](_0x532cc2(0x1d1),{'isFirstRun':_0x3ebd74,'opencode':!![]});}catch(_0x3a59b4){console['warn'](_0x532cc2(0x1b6),_0x427ea9['hpfou'](_0x3a59b4,Error)?_0x3a59b4['message']:_0x3a59b4),_0x2ff430?.[_0x532cc2(0x1ae)](_0x532cc2(0x1d1),{'isFirstRun':_0x3ebd74,'opencode':!![],'failed':!![]});}}else _0x2ff430?.[_0x532cc2(0x1ce)](_0x532cc2(0x1d1)),await _0x427ea9[_0x532cc2(0x1c7)](ensureClaudeSkills,_0x41447a),_0x2ff430?.[_0x532cc2(0x1ae)](_0x427ea9['Bqdzb'],{'isFirstRun':_0x3ebd74});if(_0x3aa466?.[_0x532cc2(0x1d3)])console[_0x532cc2(0x1a2)](_0x532cc2(0x1b7));else{if(_0x3aa466?.[_0x532cc2(0x183)]){_0x2ff430?.[_0x532cc2(0x1ce)](_0x427ea9[_0x532cc2(0x1bd)]);const _0x1fbf4e=await _0x427ea9[_0x532cc2(0x172)](ensureLocalEnv,{'url':_0x3aa466[_0x532cc2(0x183)],'force':_0x3aa466?.['force'],'allowInsecureLocalhost':_0x3aa466?.[_0x532cc2(0x1a7)],'scope':_0x532cc2(0x1bf)},_0x2ff430);_0x2ff430?.[_0x532cc2(0x1ae)](_0x427ea9['cZKDq'],{'isFirstRun':_0x3ebd74,'profileReady':_0x1fbf4e[_0x532cc2(0x1c6)],'userSkipped':_0x1fbf4e[_0x532cc2(0x1d8)]});}else console['log'](_0x427ea9['RLAwz'](_0x532cc2(0x191)+_0x427ea9['fSuHy'](bold,_0x532cc2(0x1e7))+'\x20','(and\x20'+_0x427ea9['gDXYr'](bold,_0x427ea9[_0x532cc2(0x173)])+'\x20when\x20the\x20org\x27s\x20login')+_0x532cc2(0x197)+_0x532cc2(0x1c4)+_0x532cc2(0x1b8)),console['log'](_0x532cc2(0x1dc)+_0x427ea9['UFdNF'](bold,_0x427ea9['zxPdc'])+'\x20for\x20explicit\x20profile\x20management).');}if(_0xec96a8)console[_0x532cc2(0x1a2)](_0x427ea9[_0x532cc2(0x19c)]),console[_0x532cc2(0x1a2)]('and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review'),console['log'](_0x532cc2(0x1aa)),console['log'](_0x427ea9[_0x532cc2(0x1d9)]);else{const _0x21a93e=bold(_0x532cc2(0x18e));console[_0x532cc2(0x1a2)](_0x427ea9['TjFuQ'](_0x427ea9['IAYKV'](_0x532cc2(0x18c)+_0x21a93e+_0x532cc2(0x196)+_0x532cc2(0x1af),_0x532cc2(0x1c8)),'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.'));}}
|
|
1
|
+
const _0x3ec517=_0x14a3;(function(_0xac4843,_0x383870){const _0x4c7e9d=_0x14a3,_0x48501f=_0xac4843();while(!![]){try{const _0x23e3e9=-parseInt(_0x4c7e9d(0x10a))/0x1*(-parseInt(_0x4c7e9d(0xf6))/0x2)+-parseInt(_0x4c7e9d(0xca))/0x3*(parseInt(_0x4c7e9d(0xe5))/0x4)+parseInt(_0x4c7e9d(0x106))/0x5+-parseInt(_0x4c7e9d(0x11c))/0x6+parseInt(_0x4c7e9d(0xd1))/0x7*(-parseInt(_0x4c7e9d(0x126))/0x8)+-parseInt(_0x4c7e9d(0xdf))/0x9+parseInt(_0x4c7e9d(0xf4))/0xa*(parseInt(_0x4c7e9d(0xd9))/0xb);if(_0x23e3e9===_0x383870)break;else _0x48501f['push'](_0x48501f['shift']());}catch(_0xea984c){_0x48501f['push'](_0x48501f['shift']());}}}(_0x22b6,0x36dc0));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x2c39e5 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';function _0x22b6(){const _0xc90e5=['\x0aTo\x20verify\x20with\x20a\x20browser,\x20set\x20','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','profile','KyKJh','\x0aIn\x20Claude\x20Code,\x20run\x20','GFxpM','RANGER_TEST_USERNAME','NXiGQ','allowInsecureLocalhost','DOnNb','executablePath','10eXdWVw','close','34xdkTjE','\x20\x20(or\x20use\x20','KPGjf','\x0a⚠\x20Skipping\x20Chromium\x20installation.','\x20(fallback\x20version)','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','isTTY','MMKUu','error','playwright@','nTNAN','skipChromium','force','url','trackPhaseStart','\x20\x20npx\x20playwright@','1462675nKvjDz','✓\x20Created\x20~/.ranger/\x20directory','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','MMvfw','8709jpmHgz','scope','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','✓\x20Exported\x20credentials\x20for\x20CI','Validating\x20API\x20token...','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','SLNcq','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','KuDOq','prompt','NJvWy','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','.gitignore','chromium','trackPhaseEnd','plugin','✓\x20Created\x20.ranger/.gitignore','(and\x20','948288flbZAc','QGUtw','NvOXC','inherit','skipped','\x1b[1m','AMTKL','log','ranger','ledLC','174904sVKaSH','dLXiz','jBbXs','kcTOK','existing_token','auth','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','RmDUM','user','The\x20required\x20version\x20(','1.58.2','hJpfh','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','593682bKpaWM','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.','success','LwFSy','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','skills','✓\x20Playwright\x20Chromium\x20browser\x20found','56EhcVAc','Ydtlc','--with-deps','install','/ranger:enable','skipAuth','\x20install\x20chromium','PmWPf','7215934oFvFuW','RANGER_TEST_PASSWORD','hgudP','✓\x20Authenticated\x20to\x20','SkbdT','NyLur','1288242eWPdLq','ranger\x20profile\x20add','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','playwright/package.json','AfxxC','Authentication\x20failed:\x20','8yJieul','organizationName','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','local'];_0x22b6=function(){return _0xc90e5;};return _0x22b6();}import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION=_0x3ec517(0x130);const bold=_0xdf807d=>_0x3ec517(0x121)+_0xdf807d+'\x1b[0m';export function getPlaywrightVersion(){const _0x5e478d=_0x3ec517,_0x4aa777={'SQBNM':_0x5e478d(0xe2),'fazMp':function(_0x4d138e,_0x4a5320){return _0x4d138e(_0x4a5320);}};try{const _0x339331=require['resolve'](_0x4aa777['SQBNM']),_0x2ebbea=_0x4aa777['fazMp'](require,_0x339331);return _0x2ebbea['version'];}catch{return null;}}export function installChromiumBinary(_0x4297c1,_0x1aafc2=![]){const _0x174e88=_0x3ec517,_0x9292e7={'EFkxn':_0x174e88(0xd3),'KyKJh':function(_0x5f0741,_0x300fac,_0x4b91fd,_0x389e05){return _0x5f0741(_0x300fac,_0x4b91fd,_0x389e05);},'MMvfw':'npx','NvOXC':'ignore','QGUtw':function(_0x57edb5,_0x860514){return _0x57edb5===_0x860514;}};return new Promise((_0x1e30dd,_0x2f8308)=>{const _0x1db54e=_0x174e88,_0x227752={'bxcTz':function(_0x247a29,_0x456d70){return _0x247a29(_0x456d70);}},_0x427a85=[_0x1db54e(0xff)+_0x4297c1,_0x1db54e(0xd4),..._0x1aafc2?[_0x9292e7['EFkxn']]:[],'chromium'],_0x38b004=_0x9292e7[_0x1db54e(0xec)](spawn,_0x9292e7[_0x1db54e(0x109)],_0x427a85,{'stdio':[_0x9292e7[_0x1db54e(0x11e)],'inherit',_0x1db54e(0x11f)],'shell':_0x9292e7[_0x1db54e(0x11d)](process['platform'],'win32')});_0x38b004['on'](_0x1db54e(0xf5),_0x40f4f1=>{_0x40f4f1===0x0?_0x1e30dd():_0x2f8308(new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x40f4f1));}),_0x38b004['on'](_0x1db54e(0xfe),_0x20adf8=>{_0x227752['bxcTz'](_0x2f8308,_0x20adf8);});});}export async function authenticate(_0x4e593e){const _0x580a96=_0x3ec517,_0x21e163={'tzhup':function(_0x35cb40){return _0x35cb40();},'mGDak':_0x580a96(0x10e),'nTNAN':function(_0x562e71,_0x102ee2){return _0x562e71(_0x102ee2);},'Ydtlc':'provided_token'};if(!_0x4e593e){const _0x7a2360=await _0x21e163['tzhup'](getToken);if(_0x7a2360){const _0x132ce8=await getCurrentUser(_0x7a2360);if(_0x132ce8[_0x580a96(0xcc)])return console['log']('✓\x20Already\x20authenticated\x20to\x20'+_0x132ce8[_0x580a96(0x12e)][_0x580a96(0xe6)]),{'token':_0x7a2360,'method':_0x580a96(0x12a)};}try{_0x4e593e=await runDeviceAuthFlow();}catch(_0x408334){throw new Error(_0x580a96(0xe4)+(_0x408334 instanceof Error?_0x408334['message']:_0x408334));}const _0x3a07c7=await getCurrentUser(_0x4e593e);if(!_0x3a07c7[_0x580a96(0xcc)])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x3a07c7[_0x580a96(0xfe)]);return console['log']('✓\x20Authenticated\x20to\x20'+_0x3a07c7[_0x580a96(0x12e)]['organizationName']),{'token':_0x4e593e,'method':'device_auth'};}console[_0x580a96(0x123)](_0x21e163['mGDak']);const _0x140934=await _0x21e163[_0x580a96(0x100)](getCurrentUser,_0x4e593e);if(!_0x140934['success']){if(_0x140934['status'])throw new Error('Authentication\x20failed:\x20'+_0x140934['error']+_0x580a96(0x12c));else throw new Error(_0x580a96(0x111)+_0x140934['error']+_0x580a96(0xe1));}return console['log'](_0x580a96(0xdc)+_0x140934[_0x580a96(0x12e)]['organizationName']),await storeToken(_0x4e593e),console['log'](process['env']['GITHUB_ENV']?_0x580a96(0x10d):'✓\x20Stored\x20credentials\x20locally'),{'token':_0x4e593e,'method':_0x21e163[_0x580a96(0xd2)]};}export async function ensureRangerDir(_0x49d4d6){const _0x2f1096=_0x3ec517,_0x5a5c3a={'WDBnf':function(_0x541d20,_0x3a826c){return _0x541d20(_0x3a826c);},'TWnvw':_0x2f1096(0x107),'KPGjf':'✓\x20~/.ranger/\x20directory\x20already\x20exists'};void _0x49d4d6;const _0x12ce52=getRangerHomeDir();return!_0x5a5c3a['WDBnf'](existsSync,_0x12ce52)?(await mkdir(_0x12ce52,{'recursive':!![]}),console[_0x2f1096(0x123)](_0x5a5c3a['TWnvw']),{'path':_0x12ce52,'installed':!![]}):(console[_0x2f1096(0x123)](_0x5a5c3a[_0x2f1096(0xf8)]),{'path':_0x12ce52,'installed':![]});}function _0x14a3(_0x56f51d,_0x1e0bd0){_0x56f51d=_0x56f51d-0xc9;const _0x22b691=_0x22b6();let _0x14a36e=_0x22b691[_0x56f51d];return _0x14a36e;}export async function ensureChromium(_0x972cb7=![]){const _0x585726=_0x3ec517,_0x5bea85={'JhJDO':function(_0xee6ad9,_0x373c97){return _0xee6ad9(_0x373c97);},'UHGSi':function(_0x72d4a1){return _0x72d4a1();},'kcTOK':function(_0x180274,_0x2279b0){return _0x180274??_0x2279b0;},'YBHAK':'confirm','RzrKo':_0x585726(0xfa),'RNHlt':_0x585726(0xe7),'nfUHz':function(_0x1ce03,_0x3e153d){return _0x1ce03 instanceof _0x3e153d;},'OxHFI':'You\x20can\x20install\x20it\x20manually\x20by\x20running:','dLXiz':_0x585726(0xf9),'RmDUM':'You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'};let _0x3aa794=![];try{const _0x26068f=chromium[_0x585726(0xf3)]();_0x3aa794=_0x5bea85['JhJDO'](existsSync,_0x26068f);}catch{_0x3aa794=![];}if(_0x3aa794)return console[_0x585726(0x123)](_0x585726(0xd0)),![];const _0x4e7e1e=_0x5bea85['UHGSi'](getPlaywrightVersion),_0x2e0250=_0x5bea85[_0x585726(0x129)](_0x4e7e1e,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x155f7f=!_0x4e7e1e,_0x5bc08c=process['stdin'][_0x585726(0xfc)]&&process['stdout']['isTTY'];let _0x5876f9=!![];if(_0x5bc08c){const {install:_0x495b87}=await _0x2c39e5[_0x585726(0x113)]([{'type':_0x5bea85['YBHAK'],'name':'install','message':_0x155f7f?_0x585726(0x108)+_0x2e0250+'\x20now?':_0x585726(0x12f)+_0x2e0250+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x5876f9=_0x495b87;}else console['log']('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x2e0250+(_0x155f7f?_0x5bea85['RzrKo']:'')+'...');if(_0x5876f9){console[_0x585726(0x123)]('\x0aInstalling\x20Chromium\x20browser...\x0a');try{await installChromiumBinary(_0x2e0250,_0x972cb7),console[_0x585726(0x123)](_0x5bea85['RNHlt']);}catch(_0x11b71f){console[_0x585726(0xfe)]('\x0a❌\x20Failed\x20to\x20install\x20Chromium:',_0x5bea85['nfUHz'](_0x11b71f,Error)?_0x11b71f['message']:_0x11b71f),console['log'](_0x5bea85['OxHFI']),console[_0x585726(0x123)](_0x585726(0x105)+_0x2e0250+'\x20install\x20chromium');}}else console['log'](_0x5bea85[_0x585726(0x127)]),console[_0x585726(0x123)](_0x5bea85[_0x585726(0x12d)]),console[_0x585726(0x123)](_0x585726(0x105)+_0x2e0250+_0x585726(0xd7));return!![];}export async function writeRangerGitignore(_0xc0a4d3){const _0x5a1cc6=_0x3ec517,_0x48382b={'hgudP':_0x5a1cc6(0x116),'xvxJZ':_0x5a1cc6(0x11a)},_0x13248d=join(_0xc0a4d3,_0x48382b[_0x5a1cc6(0xdb)]),_0x221a44='\x0a\x0a#\x20Ignore\x20local-only\x20directories\x0alocal/\x0asessions/\x0abug-bashes/\x0areports/\x0afeedback-images/\x0a\x0aactive-profile.txt\x0aactive-feature.txt\x0a.gitignore\x0a\x0a#\x20Ignore\x20plaintext\x20auth\x20files\x20(encrypted\x20.enc\x20files\x20are\x20safe\x20to\x20commit)\x0a**/auth.json\x0a';await writeFile(_0x13248d,_0x221a44),console[_0x5a1cc6(0x123)](_0x48382b['xvxJZ']);}export async function ensureLocalEnv(_0x32dcb2,_0x2cba4f){const _0x2201dd=_0x3ec517,_0x40147a={'WpccE':function(_0x54fd9c){return _0x54fd9c();},'OoKpW':function(_0x487e89,_0x1de3a3){return _0x487e89!==_0x1de3a3;},'MydFO':_0x2201dd(0x12e),'DdHET':function(_0x41cd8f,_0x34b6b9,_0x5bedcc){return _0x41cd8f(_0x34b6b9,_0x5bedcc);},'XSVDp':_0x2201dd(0xe8),'NyLur':'✓\x20Local\x20profile\x20already\x20exists'};if(!_0x40147a['WpccE'](findGitRoot)&&_0x40147a['OoKpW'](_0x32dcb2?.[_0x2201dd(0x10b)],_0x2201dd(0x12e)))return console[_0x2201dd(0x123)](_0x2201dd(0x10f)),{'ready':![],'skipped':!![]};const _0x43c39c=_0x32dcb2?.['scope']===_0x40147a['MydFO']?getRangerHomeDir():undefined;if(_0x40147a['DdHET'](findExistingEnv,_0x40147a['XSVDp'],{'locations':[_0x2201dd(0xe8)],'rangerDir':_0x43c39c}))return console['log'](_0x40147a[_0x2201dd(0xde)]),{'ready':!![],'skipped':![]};try{return await addEnv(_0x2201dd(0xe8),{'url':_0x32dcb2?.[_0x2201dd(0x103)],'force':_0x32dcb2?.[_0x2201dd(0x102)],'allowInsecureLocalhost':_0x32dcb2?.[_0x2201dd(0xf1)],'scope':_0x32dcb2?.['scope']},_0x2cba4f),{'ready':!![],'skipped':![]};}catch(_0x111570){return console[_0x2201dd(0xfe)]('\x0a❌\x20Profile\x20setup\x20failed:',_0x111570 instanceof Error?_0x111570['message']:_0x111570),{'ready':![],'skipped':![]};}}export async function start(_0x2c4fca,_0x545567,_0x25eed0){const _0x11d5f3=_0x3ec517,_0x587a16={'ledLC':'\x0a🚀\x20Ranger\x20Setup\x0a','PmWPf':function(_0x5f065d,_0x241ac0){return _0x5f065d!==_0x241ac0;},'bHqDp':'user','AMTKL':function(_0x17a94f,_0x20b1ee){return _0x17a94f+_0x20b1ee;},'LqjgP':function(_0x59fa37){return _0x59fa37();},'hJpfh':function(_0x2756f2,_0x436290){return _0x2756f2(_0x436290);},'COUUv':'✓\x20Skipping\x20authentication\x20(--skip-auth)','UHqIJ':'auth','fIWST':function(_0x425a02,_0x518e8a){return _0x425a02(_0x518e8a);},'MMKUu':'\x0a✅\x20Ranger\x20setup\x20complete!\x0a','SLNcq':'plugin','LVkEO':function(_0x3d930e,_0x855d4){return _0x3d930e&&_0x855d4;},'NJvWy':function(_0x703b47,_0x281978,_0x10f563){return _0x703b47(_0x281978,_0x10f563);},'jBbXs':_0x11d5f3(0x124),'Hbpkg':function(_0xf64a9b){return _0xf64a9b();},'GFxpM':'skills','QAcBe':'\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','AfxxC':_0x11d5f3(0xeb),'EDHkE':_0x11d5f3(0xef),'hVIEo':function(_0x33d7fd,_0x2f4d4a){return _0x33d7fd(_0x2f4d4a);},'LwFSy':_0x11d5f3(0xda),'SkbdT':_0x11d5f3(0xe0),'KuDOq':'and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','eJSoU':_0x11d5f3(0xea),'NXiGQ':_0x11d5f3(0xd5),'DOnNb':function(_0x21f5eb,_0x1d376e){return _0x21f5eb+_0x1d376e;},'PPPKe':function(_0x4a8aef,_0x376f77){return _0x4a8aef+_0x376f77;}};console['log'](_0x587a16[_0x11d5f3(0x125)]);_0x545567?.[_0x11d5f3(0x10b)]!==undefined&&_0x587a16[_0x11d5f3(0xd8)](_0x545567[_0x11d5f3(0x10b)],_0x587a16['bHqDp'])&&(console['error'](_0x587a16[_0x11d5f3(0x122)]('ranger\x20setup\x20--scope='+String(_0x545567[_0x11d5f3(0x10b)])+'\x20is\x20no\x20longer\x20supported.\x20'+_0x11d5f3(0xc9),_0x11d5f3(0xcb))),process['exit'](0x1));_0x545567={..._0x545567,'scope':_0x11d5f3(0x12e)};const _0x583a76=!existsSync(_0x587a16['LqjgP'](getRangerHomeDir));await _0x587a16['hJpfh'](ensureRangerDir,_0x11d5f3(0x12e));if(_0x545567?.[_0x11d5f3(0xd6)])console[_0x11d5f3(0x123)](_0x587a16['COUUv']),_0x25eed0?.[_0x11d5f3(0x118)](_0x11d5f3(0x12b),{'isFirstRun':_0x583a76,'method':'skipped'});else{_0x25eed0?.[_0x11d5f3(0x104)](_0x587a16['UHqIJ']);const _0x5c3df8=await _0x587a16['fIWST'](authenticate,_0x2c4fca);_0x25eed0?.['trackPhaseEnd']('auth',{'isFirstRun':_0x583a76,'method':_0x5c3df8['method']});}_0x25eed0?.['trackPhaseStart']('chromium');_0x545567?.['skipChromium']?console['log']('✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)'):await ensureChromium(_0x545567?.['withDeps']);_0x25eed0?.['trackPhaseEnd'](_0x11d5f3(0x117),{'isFirstRun':_0x583a76,'skipped':!!_0x545567?.[_0x11d5f3(0x101)]}),console[_0x11d5f3(0x123)](_0x587a16[_0x11d5f3(0xfd)]);const _0x58202d=_0x545567?.[_0x11d5f3(0x10b)],_0x24fb50=_0x545567?.['opencode']??![];let _0x5bd27a=null;_0x24fb50?(_0x25eed0?.[_0x11d5f3(0x104)](_0x587a16[_0x11d5f3(0x110)]),_0x5bd27a=await _0x587a16['hJpfh'](ensureOpencodePluginConfig,_0x58202d),_0x25eed0?.[_0x11d5f3(0x118)](_0x587a16[_0x11d5f3(0x110)],{'isFirstRun':_0x583a76,'opencode':!![]})):(_0x25eed0?.[_0x11d5f3(0x104)](_0x11d5f3(0x119)),await ensureClaudePlugin(_0x58202d),_0x25eed0?.[_0x11d5f3(0x118)](_0x587a16['SLNcq'],{'isFirstRun':_0x583a76}));if(_0x587a16['LVkEO'](_0x24fb50,_0x5bd27a)){_0x25eed0?.[_0x11d5f3(0x104)]('skills');try{await _0x587a16[_0x11d5f3(0x114)](installSkill,_0x587a16[_0x11d5f3(0x128)],{'level':_0x5bd27a['scope'],'cliVersion':_0x587a16['Hbpkg'](getCurrentVersion),'platform':'opencode'}),_0x25eed0?.['trackPhaseEnd'](_0x11d5f3(0xcf),{'isFirstRun':_0x583a76,'opencode':!![]});}catch(_0x4bd365){console['warn'](_0x11d5f3(0xfb),_0x4bd365 instanceof Error?_0x4bd365['message']:_0x4bd365),_0x25eed0?.[_0x11d5f3(0x118)]('skills',{'isFirstRun':_0x583a76,'opencode':!![],'failed':!![]});}}else _0x25eed0?.[_0x11d5f3(0x104)](_0x587a16[_0x11d5f3(0xee)]),await _0x587a16[_0x11d5f3(0x131)](ensureClaudeSkills,_0x58202d),_0x25eed0?.[_0x11d5f3(0x118)](_0x587a16[_0x11d5f3(0xee)],{'isFirstRun':_0x583a76});if(_0x545567?.['skipAuth'])console['log'](_0x587a16['QAcBe']);else{if(_0x545567?.['url']){_0x25eed0?.[_0x11d5f3(0x104)](_0x587a16[_0x11d5f3(0xe3)]);const _0x5790e0=await ensureLocalEnv({'url':_0x545567['url'],'force':_0x545567?.[_0x11d5f3(0x102)],'allowInsecureLocalhost':_0x545567?.['allowInsecureLocalhost'],'scope':_0x11d5f3(0x12e)},_0x25eed0);_0x25eed0?.['trackPhaseEnd']('profile',{'isFirstRun':_0x583a76,'profileReady':_0x5790e0['ready'],'userSkipped':_0x5790e0[_0x11d5f3(0x120)]});}else console['log'](_0x587a16['AMTKL'](_0x587a16['AMTKL'](_0x587a16['AMTKL'](_0x11d5f3(0xe9)+bold(_0x587a16['EDHkE'])+'\x20',_0x11d5f3(0x11b)+_0x587a16['hVIEo'](bold,_0x587a16[_0x11d5f3(0xcd)])+'\x20when\x20the\x20org\x27s\x20login'),'\x0a\x20\x20config\x20uses\x20username+password).\x20Orgs\x20on\x20SSO/SAML/OAuth'),'\x20may\x20need\x20a\x20one-time\x20headed\x20login\x20instead\x20—')+'\x0a\x20\x20your\x20org\x27s\x20auth\x20config\x20drives\x20which\x20flow\x20runs.'),console[_0x11d5f3(0x123)](_0x11d5f3(0xf7)+_0x587a16['hVIEo'](bold,_0x587a16[_0x11d5f3(0xdd)])+'\x20for\x20explicit\x20profile\x20management).');}if(_0x24fb50)console[_0x11d5f3(0x123)]('\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)'),console[_0x11d5f3(0x123)](_0x587a16[_0x11d5f3(0x112)]),console[_0x11d5f3(0x123)]('with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'),console['log'](_0x587a16['eJSoU']);else{const _0x1eb266=bold(_0x587a16[_0x11d5f3(0xf0)]);console[_0x11d5f3(0x123)](_0x587a16[_0x11d5f3(0xf2)](_0x587a16['PPPKe'](_0x587a16['PPPKe'](_0x11d5f3(0xed)+_0x1eb266+'\x20and\x20prompt\x20the\x20coding',_0x11d5f3(0x10c)),_0x11d5f3(0xce)),_0x11d5f3(0x115)));}}
|
package/build/commands/status.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x44fe5d=_0x129c;(function(_0x5a143a,_0x1740cd){const _0x4f1e39=_0x129c,_0x20bacb=_0x5a143a();while(!![]){try{const _0x3531ca=-parseInt(_0x4f1e39(0x92))/0x1+-parseInt(_0x4f1e39(0xd7))/0x2+parseInt(_0x4f1e39(0xd8))/0x3*(-parseInt(_0x4f1e39(0x7c))/0x4)+-parseInt(_0x4f1e39(0x81))/0x5+parseInt(_0x4f1e39(0xa6))/0x6*(-parseInt(_0x4f1e39(0xc5))/0x7)+-parseInt(_0x4f1e39(0x8d))/0x8+-parseInt(_0x4f1e39(0xa7))/0x9*(-parseInt(_0x4f1e39(0x85))/0xa);if(_0x3531ca===_0x1740cd)break;else _0x20bacb['push'](_0x20bacb['shift']());}catch(_0x4c63f9){_0x20bacb['push'](_0x20bacb['shift']());}}}(_0x3d66,0x84d37));import{readFile,readdir}from'fs/promises';function _0x129c(_0x4f604c,_0x249bbc){_0x4f604c=_0x4f604c-0x7c;const _0x3d66bb=_0x3d66();let _0x129cfa=_0x3d66bb[_0x4f604c];return _0x129cfa;}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';import{spawn}from'child_process';const bold=_0xd95dea=>_0x44fe5d(0xc2)+_0xd95dea+'\x1b[0m',link=(_0x55f39f,_0x2b48f5)=>_0x44fe5d(0xcb)+_0x55f39f+'\x07'+(_0x2b48f5||_0x55f39f)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x52147f=_0x44fe5d,_0x3173fd={'pWwhz':function(_0x15627e,_0x57a887){return _0x15627e(_0x57a887);},'WimtV':function(_0x3dbdb6,_0x5eaa2e){return _0x3dbdb6!==_0x5eaa2e;},'ydfxV':_0x52147f(0xb2),'Zttfx':function(_0x2e6a70,_0x27700b){return _0x2e6a70>_0x27700b;},'bIXjh':'not_configured','kawnX':_0x52147f(0xd3),'KLZUE':_0x52147f(0xb4),'uxikz':_0x52147f(0xd0)};return new Promise(_0x51dda7=>{const _0x46e28e=_0x52147f,_0x125e18={'PoDDA':function(_0x378f12,_0x211f32){const _0x2d9022=_0x129c;return _0x3173fd[_0x2d9022(0x93)](_0x378f12,_0x211f32);},'QCFOx':_0x46e28e(0x89),'tPOyv':function(_0x442463,_0x26487d){return _0x3173fd['WimtV'](_0x442463,_0x26487d);},'aYsPx':_0x3173fd['ydfxV'],'GzZFV':function(_0x55956e,_0x4851df){const _0x88e37e=_0x46e28e;return _0x3173fd[_0x88e37e(0xc8)](_0x55956e,_0x4851df);},'XsoAj':_0x3173fd[_0x46e28e(0x90)]},_0x2fd5ed=spawn('opencode',['debug',_0x46e28e(0xd4)],{'stdio':['ignore','pipe',_0x3173fd['kawnX']]});let _0x4bff22='';_0x2fd5ed[_0x46e28e(0xa5)]?.['on'](_0x46e28e(0xb4),_0x454fa3=>{const _0x333905=_0x46e28e;_0x4bff22+=_0x454fa3[_0x333905(0x83)]();}),_0x2fd5ed[_0x46e28e(0x9b)]?.['on'](_0x3173fd['KLZUE'],_0x2159ee=>{const _0x12354c=_0x46e28e;_0x4bff22+=_0x2159ee[_0x12354c(0x83)]();}),_0x2fd5ed['on'](_0x46e28e(0x8f),()=>{const _0x1de091=_0x46e28e;_0x125e18[_0x1de091(0x7e)](_0x51dda7,{'status':_0x125e18['QCFOx']});}),_0x2fd5ed['on'](_0x3173fd['uxikz'],_0x3bb556=>{const _0x93431e=_0x46e28e;if(_0x125e18['tPOyv'](_0x3bb556,0x0)){_0x125e18['PoDDA'](_0x51dda7,{'status':_0x93431e(0x89)});return;}const _0x2a60f3=_0x4bff22[_0x93431e(0xb7)]();let _0x4464c1=null;if(_0x2a60f3)try{_0x4464c1=JSON['parse'](_0x2a60f3);}catch{const _0x2ff866=_0x2a60f3[_0x93431e(0x86)](/\{[\s\S]*\}$/);if(_0x2ff866)try{_0x4464c1=JSON['parse'](_0x2ff866[0x0]);}catch{_0x4464c1=null;}}const _0x2a6270=Array['isArray'](_0x4464c1?.['plugin'])?_0x4464c1?.['plugin']:[],_0x443078=_0x2a6270[_0x93431e(0xba)](_0x219bfe=>{const _0x57bf0d=_0x93431e;if(_0x125e18[_0x57bf0d(0xc9)](typeof _0x219bfe,'string'))return![];return _0x219bfe[_0x57bf0d(0xbe)](_0x57bf0d(0x98))||_0x219bfe[_0x57bf0d(0xbe)]('opencode-plugin');});if(_0x443078){_0x51dda7({'status':_0x125e18['aYsPx'],'details':_0x125e18['GzZFV'](_0x2a6270[_0x93431e(0xb8)],0x0)?_0x2a6270[_0x93431e(0xb8)]+'\x20plugin(s)\x20configured':undefined});return;}if(_0x2a6270['length']>0x0){_0x51dda7({'status':_0x125e18['XsoAj'],'details':_0x2a6270[_0x93431e(0xb8)]+'\x20plugin(s)\x20configured'});return;}_0x51dda7({'status':_0x125e18[_0x93431e(0x88)]});});});}async function getSkillsFromDir(_0x63ae91,_0x1172e2){const _0x2332f2=_0x44fe5d,_0x2989d7={'pwKbY':function(_0x599ded,_0x3b0c36,_0xfc68b3){return _0x599ded(_0x3b0c36,_0xfc68b3);},'wBbaZ':function(_0x54b1e9,_0xb73e68,_0x1774d1,_0x5a7075){return _0x54b1e9(_0xb73e68,_0x1774d1,_0x5a7075);},'uIBhi':'SKILL.md','MbyDP':function(_0x5a8b28,_0x4b39f5){return _0x5a8b28(_0x4b39f5);},'OBwhS':function(_0x432aea,_0x673cb0,_0x9dbfda){return _0x432aea(_0x673cb0,_0x9dbfda);},'QAbkI':'utf-8'};if(!existsSync(_0x63ae91))return[];const _0x4bd464=[];try{const _0x123122=await _0x2989d7['pwKbY'](readdir,_0x63ae91,{'withFileTypes':!![]});for(const _0x525111 of _0x123122){if(_0x525111['isDirectory']()){const _0x2d8d41=_0x2989d7['wBbaZ'](join,_0x63ae91,_0x525111['name'],_0x2989d7[_0x2332f2(0xcf)]);if(_0x2989d7['MbyDP'](existsSync,_0x2d8d41)){let _0x130169=_0x525111[_0x2332f2(0xaa)];try{const _0x583dd8=await _0x2989d7[_0x2332f2(0xbd)](readFile,_0x2d8d41,_0x2989d7['QAbkI']),_0x769663=_0x583dd8[_0x2332f2(0x86)](/name:\s*(.+)/);_0x769663&&(_0x130169=_0x769663[0x1][_0x2332f2(0xb7)]());}catch{}_0x4bd464[_0x2332f2(0x87)]({'name':_0x525111['name'],'displayName':_0x130169,'path':_0x2d8d41,'level':_0x1172e2});}}}}catch{return[];}return _0x4bd464;}async function getInstalledSkills(){const _0x1b2445=_0x44fe5d,_0x16ca12={'eFmLR':function(_0x56aaf9,_0x4a4df6,_0x4af89d){return _0x56aaf9(_0x4a4df6,_0x4af89d);},'sPwDT':_0x1b2445(0x91),'MSrUm':function(_0xbea098,_0x95cab0,_0x2aa7c0){return _0xbea098(_0x95cab0,_0x2aa7c0);},'vLykE':function(_0xe00b52){return _0xe00b52();}},[_0x1c272b,_0x566026]=await Promise[_0x1b2445(0xdb)]([_0x16ca12[_0x1b2445(0xc3)](getSkillsFromDir,getProjectSkillsDir(),_0x16ca12['sPwDT']),_0x16ca12[_0x1b2445(0x9a)](getSkillsFromDir,_0x16ca12[_0x1b2445(0xa1)](getUserSkillsDir),_0x1b2445(0xb1))]);return{'project':_0x1c272b,'user':_0x566026};}async function getEnvironments(){const _0x2272ec=_0x44fe5d,_0x253803={'UmgzB':function(_0x5df3a7,_0x40b38c,_0x3d33b3){return _0x5df3a7(_0x40b38c,_0x3d33b3);},'YxSuE':_0x2272ec(0xb5),'adrBm':function(_0xc1f0ac,_0x1af590){return _0xc1f0ac(_0x1af590);},'cqAuV':function(_0xe7faf4,_0x2d1a77){return _0xe7faf4(_0x2d1a77);},'GGQlC':function(_0x2829a8,_0x4e5b3d){return _0x2829a8===_0x4e5b3d;},'NempO':function(_0x163ca4){return _0x163ca4();}},{envNames:_0xbee584,activeEnv:_0x1af0d8}=await _0x253803['NempO'](getEnvNames),_0x1ad3bb=getRangerDir();if(!existsSync(_0x1ad3bb))return{'envs':[],'activeEnv':null};const _0x5a5a56=_0xbee584[_0x2272ec(0x95)](_0x25938f=>{const _0x2c26c5=_0x2272ec,_0x38aaa1=getEnvDir(_0x25938f),_0x1a65ff=_0x253803['UmgzB'](join,_0x38aaa1,'settings.json'),_0x1507cf=join(_0x38aaa1,'auth.json'),_0x42b077=join(_0x38aaa1,_0x253803[_0x2c26c5(0x96)]);return{'name':_0x25938f,'settingsPath':_0x253803['adrBm'](existsSync,_0x1a65ff)?_0x1a65ff:_0x2c26c5(0xb9),'hasPlaintextAuth':_0x253803['cqAuV'](existsSync,_0x1507cf),'hasEncryptedAuth':_0x253803[_0x2c26c5(0xcd)](existsSync,_0x42b077),'isActive':_0x253803[_0x2c26c5(0x9e)](_0x25938f,_0x1af0d8)};});return{'envs':_0x5a5a56,'activeEnv':_0x1af0d8};}export async function status(){const _0x23f008=_0x44fe5d,_0x49ed78={'eepwL':function(_0x1c8ac8){return _0x1c8ac8();},'aWVyu':function(_0x2d94ba,_0x549bcd){return _0x2d94ba(_0x549bcd);},'gvMEk':function(_0x396a71,_0x394a5c,_0x52089c){return _0x396a71(_0x394a5c,_0x52089c);},'Kthlg':'\x0a---\x20OpenCode\x20Plugin\x20---','dkGYK':function(_0x552943,_0x572fbb){return _0x552943===_0x572fbb;},'hUsRE':'@ranger-testing/opencode-plugin','SLfSg':_0x23f008(0xca),'wddiq':'\x20\x20Not\x20configured','BmNIk':_0x23f008(0x9c),'BObZS':_0x23f008(0xa8),'pxCPc':_0x23f008(0xa4),'lvMQO':'\x20\x20Project-level:','QuRgV':function(_0x1906a9,_0x55c721,_0x3b547e){return _0x1906a9(_0x55c721,_0x3b547e);},'MefuI':function(_0x2051a2,_0x45a6a7){return _0x2051a2>_0x45a6a7;},'JKBkW':'\x20\x20User-level:','CMJCK':function(_0x4e7ef6,_0x5d98b8){return _0x4e7ef6(_0x5d98b8);},'sgEJT':function(_0x1c89b4,_0x1f9811){return _0x1c89b4(_0x1f9811);},'IAROF':'\x0a---\x20Profiles\x20---','EgvXm':function(_0x2361bd){return _0x2361bd();},'jXaSF':'\x20(active)','OIsGI':'encrypted'};console['log'](_0x23f008(0x8c));const _0x28f642=process[_0x23f008(0xa2)](),_0x44a84a=_0x49ed78[_0x23f008(0xcc)](getRangerDir);if(!existsSync(_0x44a84a)){console[_0x23f008(0x94)](_0x23f008(0xbf)+link(_0x28f642,_0x49ed78[_0x23f008(0x8b)](bold,basename(_0x28f642)))),console[_0x23f008(0x94)]('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console[_0x23f008(0x94)]('Root:\x20'+_0x49ed78['gvMEk'](link,_0x28f642,bold(basename(_0x28f642))));const _0x4c7d7b=getCurrentVersion(),_0x39d922=getLatestVersion();if(_0x39d922['version']&&_0x39d922['version']!==_0x4c7d7b)console['log']('Version:\x20'+_0x4c7d7b+'\x20(latest:\x20'+_0x39d922[_0x23f008(0x7f)]+')'),console[_0x23f008(0x94)](_0x23f008(0xd5));else _0x39d922[_0x23f008(0x7f)]?console['log']('Version:\x20'+_0x4c7d7b+_0x23f008(0x84)):console['log']('Version:\x20'+_0x4c7d7b);const _0x1ea93f=await getToken();if(_0x1ea93f){const _0x4d15d3=await getCurrentUser(_0x1ea93f);_0x4d15d3['success']?console[_0x23f008(0x94)](_0x23f008(0xd9)+bold(_0x4d15d3[_0x23f008(0xb1)]['organizationName'])):(console['log']('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console[_0x23f008(0x94)]('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console['log']('API\x20Token:\x20✗\x20Not\x20found'),console['log'](_0x23f008(0x8a));process['env'][_0x23f008(0x80)]&&(console[_0x23f008(0x94)]('API\x20Environment:\x20'+getCurrentEnvironment()),console[_0x23f008(0x94)](_0x23f008(0xae)+_0x49ed78[_0x23f008(0xcc)](getApiBaseUrl)));console['log'](_0x49ed78['Kthlg']);const _0x409c51=await getOpencodePluginStatus();if(_0x49ed78[_0x23f008(0xc7)](_0x409c51['status'],'configured'))console['log']('\x20\x20'+bold(_0x49ed78[_0x23f008(0x82)])+':\x20configured'),_0x409c51['details']&&console['log']('\x20\x20'+_0x409c51[_0x23f008(0xab)]);else _0x409c51['status']===_0x49ed78[_0x23f008(0xda)]?(console[_0x23f008(0x94)](_0x49ed78[_0x23f008(0xdc)]),_0x409c51['details']&&console[_0x23f008(0x94)]('\x20\x20'+_0x409c51[_0x23f008(0xab)]),console['log'](_0x49ed78['BmNIk'])):console[_0x23f008(0x94)](_0x23f008(0x8e));console[_0x23f008(0x94)]('\x0a---\x20Claude\x20Code\x20Plugin\x20---');const _0x5f1153=await getPluginInfo(_0x49ed78['BObZS']);if(_0x5f1153){const _0xdd2967=_0x5f1153[_0x23f008(0xc4)]||_0x23f008(0xc0),_0x2f2d75=_0x5f1153['enabled']?_0x23f008(0xce):'disabled';console[_0x23f008(0x94)]('\x20\x20'+bold('ranger@trailhead')+_0x23f008(0x97)+_0xdd2967+',\x20'+_0x2f2d75+')');}else console[_0x23f008(0x94)]('\x20\x20Not\x20installed'),console[_0x23f008(0x94)](_0x49ed78['pxCPc']);console[_0x23f008(0x94)]('\x0a---\x20Skills\x20---');const {project:_0x352909,user:_0x506a44}=await _0x49ed78[_0x23f008(0xcc)](getInstalledSkills),_0x5e310d=_0x352909[_0x23f008(0x9d)](_0x5128b1=>RANGER_MANAGED_SKILLS['includes'](_0x5128b1[_0x23f008(0xaa)])),_0x319f24=_0x506a44[_0x23f008(0x9d)](_0x1359d4=>RANGER_MANAGED_SKILLS['includes'](_0x1359d4['name'])),_0x2e2149=_0x5e310d[_0x23f008(0xb8)]+_0x319f24['length'];if(_0x2e2149===0x0)console[_0x23f008(0x94)](_0x23f008(0xd2)),console[_0x23f008(0x94)]('\x20\x20Run:\x20ranger\x20skillup');else{if(_0x5e310d['length']>0x0){console['log'](_0x49ed78['lvMQO']);for(const _0x31122d of _0x5e310d){console['log']('\x20\x20\x20\x20'+bold(_0x31122d[_0x23f008(0xb6)])+':\x20'+_0x49ed78[_0x23f008(0xaf)](link,_0x31122d['path'],basename(_0x31122d[_0x23f008(0xa0)])));}}if(_0x49ed78[_0x23f008(0xbb)](_0x319f24[_0x23f008(0xb8)],0x0)){console[_0x23f008(0x94)](_0x49ed78[_0x23f008(0xad)]);for(const _0x493ffa of _0x319f24){console[_0x23f008(0x94)]('\x20\x20\x20\x20'+_0x49ed78['CMJCK'](bold,_0x493ffa['displayName'])+':\x20'+link(_0x493ffa[_0x23f008(0xa0)],_0x49ed78['sgEJT'](basename,_0x493ffa['path'])));}}}console['log'](_0x49ed78[_0x23f008(0xa3)]);const {envs:_0x3b64b5,activeEnv:_0x3af80c}=await _0x49ed78['EgvXm'](getEnvironments);if(_0x49ed78[_0x23f008(0xc7)](_0x3b64b5[_0x23f008(0xb8)],0x0))console[_0x23f008(0x94)]('No\x20profiles\x20configured'),console['log']('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{for(const _0x41ceb7 of _0x3b64b5){const _0x3f66cc=_0x41ceb7[_0x23f008(0xc1)]?_0x49ed78[_0x23f008(0x9f)]:'',_0x3a226d=_0x41ceb7['hasEncryptedAuth']?_0x49ed78[_0x23f008(0xa9)]:_0x41ceb7[_0x23f008(0xbc)]?_0x23f008(0xb0):'none';console[_0x23f008(0x94)]('\x20\x20'+_0x49ed78[_0x23f008(0xb3)](bold,_0x41ceb7[_0x23f008(0xaa)])+_0x3f66cc),console[_0x23f008(0x94)](_0x23f008(0x7d)+_0x3a226d),_0x41ceb7[_0x23f008(0xac)]!=='(not\x20found)'&&console[_0x23f008(0x94)](_0x23f008(0xc6)+link(_0x41ceb7[_0x23f008(0xac)],basename(_0x41ceb7['settingsPath'])));}!_0x3af80c&&(console['log'](_0x23f008(0xd1)),console['log'](_0x23f008(0xd6)+_0x3b64b5['map'](_0xffdbb=>_0xffdbb[_0x23f008(0xaa)])[_0x23f008(0x99)](',\x20')+')'));}console[_0x23f008(0x94)]('');}function _0x3d66(){const _0x14c302=['toString','\x20(up\x20to\x20date)','950BBgxeL','match','push','XsoAj','not_installed','\x20\x20Run:\x20ranger\x20setup\x20[token]','aWVyu','\x0a📊\x20Ranger\x20Status\x0a','3958000JFUMKp','\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','error','bIXjh','project','137650Xapfax','pWwhz','log','map','YxSuE',':\x20installed\x20(','@ranger-testing/opencode-plugin','join','MSrUm','stderr','\x20\x20Run:\x20ranger\x20setup\x20--opencode','filter','GGQlC','jXaSF','path','vLykE','cwd','IAROF','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','stdout','12bAZmMH','271377uKUPZo','ranger@trailhead','OIsGI','name','details','settingsPath','JKBkW','API\x20URL:\x20','QuRgV','plaintext','user','configured','sgEJT','data','auth.json.enc','displayName','trim','length','(not\x20found)','some','MefuI','hasPlaintextAuth','OBwhS','includes','Root:\x20','unknown','isActive','\x1b[1m','eFmLR','scope','1478666pvLnFi','\x20\x20\x20\x20Settings:\x20','dkGYK','Zttfx','tPOyv','not_configured','\x1b]8;;file://','eepwL','adrBm','enabled','uIBhi','close','\x0a\x20\x20No\x20active\x20profile\x20set','No\x20skills\x20installed','pipe','config','\x20\x20Run:\x20ranger\x20update','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','714450Wszhap','1258539PvzvaZ','Organization:\x20','SLfSg','all','wddiq','8TzryAo','\x20\x20\x20\x20Auth:\x20','PoDDA','version','DEBUG','346765LYmaSM','hUsRE'];_0x3d66=function(){return _0x14c302;};return _0x3d66();}
|
|
1
|
+
const _0x215774=_0x7e1a;(function(_0x517f4b,_0x113be6){const _0x2dd760=_0x7e1a,_0x3d6818=_0x517f4b();while(!![]){try{const _0xe7b9ca=parseInt(_0x2dd760(0x1ad))/0x1*(parseInt(_0x2dd760(0x1e2))/0x2)+parseInt(_0x2dd760(0x190))/0x3*(-parseInt(_0x2dd760(0x1bf))/0x4)+parseInt(_0x2dd760(0x1a7))/0x5*(parseInt(_0x2dd760(0x1b2))/0x6)+parseInt(_0x2dd760(0x1d7))/0x7+-parseInt(_0x2dd760(0x18c))/0x8+-parseInt(_0x2dd760(0x19a))/0x9+parseInt(_0x2dd760(0x193))/0xa;if(_0xe7b9ca===_0x113be6)break;else _0x3d6818['push'](_0x3d6818['shift']());}catch(_0x4c135a){_0x3d6818['push'](_0x3d6818['shift']());}}}(_0x2e25,0x59801));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';function _0x2e25(){const _0x182594=['\x20(up\x20to\x20date)','@ranger-testing/opencode-plugin','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','path','auth.json.enc','WagHU','all','none','3598064XHdQOW','settingsPath','includes','wKtVY','1943295tAzLFQ','isDirectory','length','10990910nFeZXF','project','displayName','JEyhb','AAuze','\x0a---\x20Claude\x20Code\x20Plugin\x20---','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','4328154TmbKUn','SLeXd','\x20(latest:\x20','SKILL.md','map','API\x20URL:\x20','rOhEw','disabled','utTEt','configured','\x20\x20Not\x20installed','No\x20profiles\x20configured','\x20\x20\x20\x20Auth:\x20','10SOsPvg','snCux','trim','success','ignore','user','54046PgIfvl','lPBAc','name','Ftrvt','QOizZ','1125870JGCtyk','abIMR','yHYmy','XXENF',':\x20configured','ErTfx','HIStb','cwd','CTWyo','status','jFjeC','\x20\x20\x20\x20','lSDSk','4IfzIvL','isArray','hJJmP','filter','Logch','not_configured','data','pAggS','API\x20Environment:\x20','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','XzJvX','oQvph','match','details','SqPYN','\x0a---\x20OpenCode\x20Plugin\x20---','plugin','version','\x0a\x20\x20No\x20active\x20profile\x20set','\x1b]8;;\x07','jbQrO','LuPgh','error','ZGLQT','267911CTWxPa','VbxtT','enabled','\x20\x20Run:\x20ranger\x20skillup','SARDW','\x20\x20Run:\x20ranger\x20update','toString','eJzsy','\x20\x20\x20\x20Settings:\x20','log','djPUl','16yBOuNy','opencode','(not\x20found)','auth.json','env','jDYKH'];_0x2e25=function(){return _0x182594;};return _0x2e25();}import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';function _0x7e1a(_0x309a04,_0x275688){_0x309a04=_0x309a04-0x187;const _0x2e2594=_0x2e25();let _0x7e1acc=_0x2e2594[_0x309a04];return _0x7e1acc;}import{getEnvDir}from'./utils/settings.js';import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x474cc1=>'\x1b[1m'+_0x474cc1+'\x1b[0m',link=(_0x2493f7,_0x333a8f)=>'\x1b]8;;file://'+_0x2493f7+'\x07'+(_0x333a8f||_0x2493f7)+_0x215774(0x1d2);async function getOpencodePluginStatus(){const _0x390cfd=_0x215774,_0xf2b903={'lYhox':function(_0x4f036a,_0x106d79){return _0x4f036a!==_0x106d79;},'WagHU':'not_installed','PHlLF':_0x390cfd(0x1c4),'JEyhb':'debug','xhAvW':_0x390cfd(0x1ab),'jDYKH':'pipe','QOizZ':'data','SLeXd':_0x390cfd(0x1d5),'yHYmy':'close'};return new Promise(_0x628f6a=>{const _0x307eaf=_0x390cfd,_0x463815={'wKtVY':_0xf2b903['WagHU']},_0x32a669=spawn(_0x307eaf(0x1e3),[_0xf2b903[_0x307eaf(0x196)],'config'],{'stdio':[_0xf2b903['xhAvW'],_0xf2b903[_0x307eaf(0x1e7)],_0xf2b903[_0x307eaf(0x1e7)]]});let _0x11d4ae='';_0x32a669['stdout']?.['on'](_0xf2b903[_0x307eaf(0x1b1)],_0x22dabc=>{_0x11d4ae+=_0x22dabc['toString']();}),_0x32a669['stderr']?.['on'](_0x307eaf(0x1c5),_0x2a25f7=>{const _0x549371=_0x307eaf;_0x11d4ae+=_0x2a25f7[_0x549371(0x1dd)]();}),_0x32a669['on'](_0xf2b903[_0x307eaf(0x19b)],()=>{const _0x291c35=_0x307eaf;_0x628f6a({'status':_0x463815[_0x291c35(0x18f)]});}),_0x32a669['on'](_0xf2b903[_0x307eaf(0x1b4)],_0x959b89=>{const _0x18a1f3=_0x307eaf,_0x5e5b72={'RjvVG':function(_0x19dd0d,_0x4980cf){return _0xf2b903['lYhox'](_0x19dd0d,_0x4980cf);},'SARDW':'string','hJJmP':'opencode-plugin'};if(_0xf2b903['lYhox'](_0x959b89,0x0)){_0x628f6a({'status':_0xf2b903[_0x18a1f3(0x189)]});return;}const _0x486286=_0x11d4ae[_0x18a1f3(0x1a9)]();let _0x47af4c=null;if(_0x486286)try{_0x47af4c=JSON['parse'](_0x486286);}catch{const _0x1db16d=_0x486286[_0x18a1f3(0x1cb)](/\{[\s\S]*\}$/);if(_0x1db16d)try{_0x47af4c=JSON['parse'](_0x1db16d[0x0]);}catch{_0x47af4c=null;}}const _0x31ff91=Array[_0x18a1f3(0x1c0)](_0x47af4c?.[_0x18a1f3(0x1cf)])?_0x47af4c?.[_0x18a1f3(0x1cf)]:[],_0xb11062=_0x31ff91['some'](_0x190a54=>{const _0x2cce07=_0x18a1f3;if(_0x5e5b72['RjvVG'](typeof _0x190a54,_0x5e5b72[_0x2cce07(0x1db)]))return![];return _0x190a54[_0x2cce07(0x18e)](_0x2cce07(0x1e9))||_0x190a54['includes'](_0x5e5b72[_0x2cce07(0x1c1)]);});if(_0xb11062){_0x628f6a({'status':_0x18a1f3(0x1a3),'details':_0x31ff91['length']>0x0?_0x31ff91['length']+'\x20plugin(s)\x20configured':undefined});return;}if(_0x31ff91[_0x18a1f3(0x192)]>0x0){_0x628f6a({'status':_0xf2b903['PHlLF'],'details':_0x31ff91[_0x18a1f3(0x192)]+'\x20plugin(s)\x20configured'});return;}_0x628f6a({'status':'not_configured'});});});}async function getSkillsFromDir(_0x4a6272,_0x2d14b8){const _0x6bbbe5=_0x215774,_0xd9a730={'PHESj':function(_0x132bd0,_0x2a5854){return _0x132bd0(_0x2a5854);},'kASqD':_0x6bbbe5(0x19d),'LuPgh':function(_0x34b74d,_0x59767d,_0x5e2702){return _0x34b74d(_0x59767d,_0x5e2702);},'rOhEw':'utf-8'};if(!_0xd9a730['PHESj'](existsSync,_0x4a6272))return[];const _0x2ebd6f=[];try{const _0x54728f=await readdir(_0x4a6272,{'withFileTypes':!![]});for(const _0x5bffca of _0x54728f){if(_0x5bffca[_0x6bbbe5(0x191)]()){const _0x51bf60=join(_0x4a6272,_0x5bffca['name'],_0xd9a730['kASqD']);if(_0xd9a730['PHESj'](existsSync,_0x51bf60)){let _0x56e99b=_0x5bffca['name'];try{const _0x4ec51a=await _0xd9a730[_0x6bbbe5(0x1d4)](readFile,_0x51bf60,_0xd9a730[_0x6bbbe5(0x1a0)]),_0x478f4d=_0x4ec51a[_0x6bbbe5(0x1cb)](/name:\s*(.+)/);_0x478f4d&&(_0x56e99b=_0x478f4d[0x1]['trim']());}catch{}_0x2ebd6f['push']({'name':_0x5bffca['name'],'displayName':_0x56e99b,'path':_0x51bf60,'level':_0x2d14b8});}}}}catch{return[];}return _0x2ebd6f;}async function getInstalledSkills(){const _0xca6b96=_0x215774,_0x151df8={'XWRQS':function(_0x4d2426,_0x1725c1,_0x293e75){return _0x4d2426(_0x1725c1,_0x293e75);},'izBmr':function(_0x60d87e){return _0x60d87e();},'cbKAS':function(_0x49c2fb){return _0x49c2fb();},'HIStb':'user'},[_0x35c327,_0x4c25fd]=await Promise[_0xca6b96(0x18a)]([_0x151df8['XWRQS'](getSkillsFromDir,_0x151df8['izBmr'](getProjectSkillsDir),_0xca6b96(0x194)),_0x151df8['XWRQS'](getSkillsFromDir,_0x151df8['cbKAS'](getUserSkillsDir),_0x151df8[_0xca6b96(0x1b8)])]);return{'project':_0x35c327,'user':_0x4c25fd};}async function getEnvironments(){const _0xf99a58=_0x215774,_0x4f7cc2={'AAuze':function(_0x31891e,_0xce74ad,_0x257cc1){return _0x31891e(_0xce74ad,_0x257cc1);},'XzJvX':function(_0x4410b7,_0x6c403e){return _0x4410b7(_0x6c403e);},'Ftrvt':_0xf99a58(0x1e4),'BQarH':function(_0xa3f334,_0x116b7f){return _0xa3f334(_0x116b7f);},'wjxxH':function(_0xab00bc,_0x2c5c07){return _0xab00bc===_0x2c5c07;},'lPBAc':function(_0x5bed34){return _0x5bed34();}},{envNames:_0x1695da,activeEnv:_0x293a76}=await _0x4f7cc2['lPBAc'](getEnvNames),_0x22f679=_0x4f7cc2[_0xf99a58(0x1ae)](getRangerDir);if(!_0x4f7cc2['XzJvX'](existsSync,_0x22f679))return{'envs':[],'activeEnv':null};const _0x53fdc1=_0x1695da[_0xf99a58(0x19e)](_0x276cf9=>{const _0x2e53cd=_0xf99a58,_0x4cdf74=getEnvDir(_0x276cf9),_0x22d4af=join(_0x4cdf74,'settings.json'),_0x447bfd=_0x4f7cc2[_0x2e53cd(0x197)](join,_0x4cdf74,_0x2e53cd(0x1e5)),_0x3c6ece=join(_0x4cdf74,_0x2e53cd(0x188));return{'name':_0x276cf9,'settingsPath':_0x4f7cc2[_0x2e53cd(0x1c9)](existsSync,_0x22d4af)?_0x22d4af:_0x4f7cc2[_0x2e53cd(0x1b0)],'hasPlaintextAuth':existsSync(_0x447bfd),'hasEncryptedAuth':_0x4f7cc2['BQarH'](existsSync,_0x3c6ece),'isActive':_0x4f7cc2['wjxxH'](_0x276cf9,_0x293a76)};});return{'envs':_0x53fdc1,'activeEnv':_0x293a76};}export async function status(){const _0x3d39e3=_0x215774,_0x286b86={'lIihg':'\x0a📊\x20Ranger\x20Status\x0a','fvmyq':function(_0x3e077e){return _0x3e077e();},'abIMR':function(_0x2ea44b,_0x3d2c07){return _0x2ea44b(_0x3d2c07);},'Logch':function(_0x5a463e,_0x4bc890){return _0x5a463e!==_0x4bc890;},'CTWyo':function(_0x5cf6f3,_0x92bd50){return _0x5cf6f3(_0x92bd50);},'ZGLQT':function(_0x26aff7){return _0x26aff7();},'SqPYN':function(_0x34f6be,_0x2ff73e){return _0x34f6be===_0x2ff73e;},'sjZqN':function(_0x44b968,_0x65b072){return _0x44b968===_0x65b072;},'djPUl':'\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','snCux':'ranger@trailhead','BzKvV':function(_0x17fa86,_0x1a6904){return _0x17fa86(_0x1a6904);},'jbQrO':'\x0a---\x20Skills\x20---','pAggS':function(_0x368f50,_0x4951c7){return _0x368f50+_0x4951c7;},'ptOvp':function(_0x3f6946,_0x483001){return _0x3f6946===_0x483001;},'ErTfx':function(_0xcda6a6,_0x4be28a){return _0xcda6a6>_0x4be28a;},'XXENF':function(_0x2bf928,_0x37f15b,_0x2e37fd){return _0x2bf928(_0x37f15b,_0x2e37fd);},'utTEt':function(_0x5e3a4f,_0x491535){return _0x5e3a4f(_0x491535);},'AHcHf':'\x20\x20User-level:','oDfqF':function(_0xbcac99,_0x20f1b1){return _0xbcac99(_0x20f1b1);},'czUSZ':'\x0a---\x20Profiles\x20---','VbxtT':function(_0x178ce8){return _0x178ce8();},'oQvph':function(_0x89a35d,_0x702585){return _0x89a35d===_0x702585;},'jFjeC':'\x20(active)','eJzsy':'plaintext','lSDSk':function(_0x5b85fe,_0x3a5596,_0x34d51c){return _0x5b85fe(_0x3a5596,_0x34d51c);}};console['log'](_0x286b86['lIihg']);const _0x4aa727=process[_0x3d39e3(0x1b9)](),_0x4ecea2=_0x286b86['fvmyq'](getRangerDir);if(!existsSync(_0x4ecea2)){console[_0x3d39e3(0x1e0)]('Root:\x20'+link(_0x4aa727,_0x286b86[_0x3d39e3(0x1b3)](bold,basename(_0x4aa727)))),console['log'](_0x3d39e3(0x199)),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console[_0x3d39e3(0x1e0)]('Root:\x20'+link(_0x4aa727,bold(basename(_0x4aa727))));const _0x33c2ad=getCurrentVersion(),_0x580a34=getLatestVersion();if(_0x580a34[_0x3d39e3(0x1d0)]&&_0x286b86[_0x3d39e3(0x1c3)](_0x580a34[_0x3d39e3(0x1d0)],_0x33c2ad))console['log']('Version:\x20'+_0x33c2ad+_0x3d39e3(0x19c)+_0x580a34[_0x3d39e3(0x1d0)]+')'),console['log'](_0x3d39e3(0x1dc));else _0x580a34['version']?console['log']('Version:\x20'+_0x33c2ad+_0x3d39e3(0x1e8)):console['log']('Version:\x20'+_0x33c2ad);const _0x31bb1c=await getToken();if(_0x31bb1c){const _0x15f250=await _0x286b86['CTWyo'](getCurrentUser,_0x31bb1c);_0x15f250[_0x3d39e3(0x1aa)]?console['log']('Organization:\x20'+bold(_0x15f250[_0x3d39e3(0x1ac)]['organizationName'])):(console[_0x3d39e3(0x1e0)](_0x3d39e3(0x1ea)),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console[_0x3d39e3(0x1e0)]('API\x20Token:\x20✗\x20Not\x20found'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]');process[_0x3d39e3(0x1e6)]['DEBUG']&&(console[_0x3d39e3(0x1e0)](_0x3d39e3(0x1c7)+getCurrentEnvironment()),console['log'](_0x3d39e3(0x19f)+_0x286b86[_0x3d39e3(0x1d6)](getApiBaseUrl)));console['log'](_0x3d39e3(0x1ce));const _0x2ba633=await getOpencodePluginStatus();if(_0x286b86[_0x3d39e3(0x1cd)](_0x2ba633['status'],_0x3d39e3(0x1a3)))console[_0x3d39e3(0x1e0)]('\x20\x20'+_0x286b86[_0x3d39e3(0x1b3)](bold,_0x3d39e3(0x1e9))+_0x3d39e3(0x1b6)),_0x2ba633[_0x3d39e3(0x1cc)]&&console[_0x3d39e3(0x1e0)]('\x20\x20'+_0x2ba633[_0x3d39e3(0x1cc)]);else _0x286b86['sjZqN'](_0x2ba633[_0x3d39e3(0x1bb)],'not_configured')?(console[_0x3d39e3(0x1e0)]('\x20\x20Not\x20configured'),_0x2ba633[_0x3d39e3(0x1cc)]&&console['log']('\x20\x20'+_0x2ba633[_0x3d39e3(0x1cc)]),console[_0x3d39e3(0x1e0)]('\x20\x20Run:\x20ranger\x20setup\x20--opencode')):console['log'](_0x286b86[_0x3d39e3(0x1e1)]);console['log'](_0x3d39e3(0x198));const _0x51d42a=await getPluginInfo(_0x286b86[_0x3d39e3(0x1a8)]);if(_0x51d42a){const _0x15f78b=_0x51d42a['scope']||'unknown',_0x468a0f=_0x51d42a[_0x3d39e3(0x1d9)]?'enabled':_0x3d39e3(0x1a1);console['log']('\x20\x20'+_0x286b86['BzKvV'](bold,_0x286b86[_0x3d39e3(0x1a8)])+':\x20installed\x20('+_0x15f78b+',\x20'+_0x468a0f+')');}else console['log'](_0x3d39e3(0x1a4)),console['log'](_0x3d39e3(0x1c8));console[_0x3d39e3(0x1e0)](_0x286b86[_0x3d39e3(0x1d3)]);const {project:_0x2d18ab,user:_0x3ec9dc}=await _0x286b86['ZGLQT'](getInstalledSkills),_0x2885d3=_0x2d18ab['filter'](_0xd582cc=>RANGER_MANAGED_SKILLS[_0x3d39e3(0x18e)](_0xd582cc[_0x3d39e3(0x1af)])),_0x4d0ba4=_0x3ec9dc[_0x3d39e3(0x1c2)](_0x43e72e=>RANGER_MANAGED_SKILLS[_0x3d39e3(0x18e)](_0x43e72e[_0x3d39e3(0x1af)])),_0x19467b=_0x286b86[_0x3d39e3(0x1c6)](_0x2885d3['length'],_0x4d0ba4[_0x3d39e3(0x192)]);if(_0x286b86['ptOvp'](_0x19467b,0x0))console['log']('No\x20skills\x20installed'),console['log'](_0x3d39e3(0x1da));else{if(_0x286b86[_0x3d39e3(0x1b7)](_0x2885d3['length'],0x0)){console['log']('\x20\x20Project-level:');for(const _0x18f445 of _0x2885d3){console['log'](_0x3d39e3(0x1bd)+bold(_0x18f445[_0x3d39e3(0x195)])+':\x20'+_0x286b86[_0x3d39e3(0x1b5)](link,_0x18f445['path'],_0x286b86[_0x3d39e3(0x1a2)](basename,_0x18f445[_0x3d39e3(0x187)])));}}if(_0x286b86['ErTfx'](_0x4d0ba4[_0x3d39e3(0x192)],0x0)){console[_0x3d39e3(0x1e0)](_0x286b86['AHcHf']);for(const _0x3e5cf8 of _0x4d0ba4){console['log']('\x20\x20\x20\x20'+bold(_0x3e5cf8['displayName'])+':\x20'+link(_0x3e5cf8['path'],_0x286b86['oDfqF'](basename,_0x3e5cf8['path'])));}}}console[_0x3d39e3(0x1e0)](_0x286b86['czUSZ']);const {envs:_0x207f1a,activeEnv:_0x1db308}=await _0x286b86[_0x3d39e3(0x1d8)](getEnvironments);if(_0x286b86[_0x3d39e3(0x1ca)](_0x207f1a[_0x3d39e3(0x192)],0x0))console[_0x3d39e3(0x1e0)](_0x3d39e3(0x1a5)),console[_0x3d39e3(0x1e0)]('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{for(const _0x5c97c5 of _0x207f1a){const _0x3ff6c7=_0x5c97c5['isActive']?_0x286b86[_0x3d39e3(0x1bc)]:'',_0x581feb=_0x5c97c5['hasEncryptedAuth']?'encrypted':_0x5c97c5['hasPlaintextAuth']?_0x286b86[_0x3d39e3(0x1de)]:_0x3d39e3(0x18b);console[_0x3d39e3(0x1e0)]('\x20\x20'+_0x286b86[_0x3d39e3(0x1a2)](bold,_0x5c97c5[_0x3d39e3(0x1af)])+_0x3ff6c7),console['log'](_0x3d39e3(0x1a6)+_0x581feb),_0x5c97c5['settingsPath']!=='(not\x20found)'&&console[_0x3d39e3(0x1e0)](_0x3d39e3(0x1df)+_0x286b86[_0x3d39e3(0x1be)](link,_0x5c97c5[_0x3d39e3(0x18d)],_0x286b86[_0x3d39e3(0x1ba)](basename,_0x5c97c5[_0x3d39e3(0x18d)])));}!_0x1db308&&(console['log'](_0x3d39e3(0x1d1)),console[_0x3d39e3(0x1e0)]('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x207f1a['map'](_0x150ffa=>_0x150ffa['name'])['join'](',\x20')+')'));}console['log']('');}
|
package/build/commands/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x3edbc4=_0x38f3;(function(_0x3cc98b,_0x356ebc){const _0x3cdf27=_0x38f3,_0x5c88fc=_0x3cc98b();while(!![]){try{const _0x536537=parseInt(_0x3cdf27(0x176))/0x1*(parseInt(_0x3cdf27(0x186))/0x2)+parseInt(_0x3cdf27(0x152))/0x3+parseInt(_0x3cdf27(0x141))/0x4*(parseInt(_0x3cdf27(0x180))/0x5)+parseInt(_0x3cdf27(0x165))/0x6*(-parseInt(_0x3cdf27(0x188))/0x7)+parseInt(_0x3cdf27(0x184))/0x8*(-parseInt(_0x3cdf27(0x14e))/0x9)+parseInt(_0x3cdf27(0x18b))/0xa*(parseInt(_0x3cdf27(0x162))/0xb)+-parseInt(_0x3cdf27(0x16a))/0xc;if(_0x536537===_0x356ebc)break;else _0x5c88fc['push'](_0x5c88fc['shift']());}catch(_0x4d8365){_0x5c88fc['push'](_0x5c88fc['shift']());}}}(_0x4d46,0x36ea3));import{spawn}from'child_process';function _0x38f3(_0x27ee43,_0x2f2c8d){_0x27ee43=_0x27ee43-0x13f;const _0x4d46a3=_0x4d46();let _0x38f3f5=_0x4d46a3[_0x27ee43];return _0x38f3f5;}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{getProjectRoot,getSkillsDir}from'./utils/claudeConfig.js';import{getOpencodeSkillsDir}from'./utils/opencodeConfig.js';import{join}from'path';import{getRangerDir}from'./utils/rangerRoot.js';import{getPluginInfo,isMarketplaceAdded,isPluginInstalled}from'./utils/claudePlugin.js';const CLAUDE_COMMAND_TIMEOUT_MS=0x1d4c0;async function runCommand(_0x3fa286,_0x15d4c1,_0x1cb032){const _0x4817b0=_0x38f3,_0x5ba5fe={'DyEru':function(_0x87e47,_0x27925a){return _0x87e47(_0x27925a);},'Olaub':function(_0x4c2d43,_0x426200){return _0x4c2d43===_0x426200;},'buOVb':'ignore','ojgeH':_0x4817b0(0x143),'LfJpb':function(_0x30a499,_0x195d46){return _0x30a499===_0x195d46;},'SyyON':'win32'};return new Promise(_0x381c58=>{const _0x4661bf=_0x4817b0;let _0x1ef498=![],_0x1d3d81;const _0x3151f1=_0x30a68a=>{if(_0x1ef498)return;_0x1ef498=!![],_0x1d3d81&&clearTimeout(_0x1d3d81),_0x381c58(_0x30a68a);},_0x148df4=spawn(_0x3fa286,_0x15d4c1,{'stdio':[_0x5ba5fe['buOVb'],_0x1cb032?.['stdio']??_0x4661bf(0x143),_0x1cb032?.[_0x4661bf(0x179)]??_0x5ba5fe[_0x4661bf(0x15b)]],'cwd':_0x1cb032?.['cwd'],'shell':_0x5ba5fe[_0x4661bf(0x17d)](process[_0x4661bf(0x159)],_0x5ba5fe[_0x4661bf(0x191)])});_0x1d3d81=_0x1cb032?.['timeoutMs']?setTimeout(()=>{const _0x28d588=_0x4661bf;_0x148df4['kill'](),_0x148df4[_0x28d588(0x17e)](),_0x3151f1(![]);},_0x1cb032[_0x4661bf(0x166)]):undefined,_0x148df4['on']('close',_0x39f857=>{const _0x4b91b4=_0x4661bf;_0x5ba5fe[_0x4b91b4(0x192)](_0x3151f1,_0x5ba5fe[_0x4b91b4(0x17c)](_0x39f857,0x0));}),_0x148df4['on']('error',()=>{_0x3151f1(![]);});});}export function resolveDistTag(_0x1cba0f){const _0x4d136f=_0x38f3,_0x2f2487={'HqTgz':_0x4d136f(0x164)};if(/-alpha\./i['test'](_0x1cba0f))return _0x2f2487[_0x4d136f(0x18f)];if(/-beta\./i['test'](_0x1cba0f))return'beta';if(/-rc\./i[_0x4d136f(0x145)](_0x1cba0f))return'rc';return'latest';}async function runInstall(_0x1b31f3='latest'){const _0x4b0b01=_0x38f3,_0x148b71={'HNFLu':function(_0x396d41,_0x2d3172,_0x99fb0b,_0x57975d){return _0x396d41(_0x2d3172,_0x99fb0b,_0x57975d);},'UKfEO':_0x4b0b01(0x160),'saTBZ':'ignore','ZARaa':'close'};return new Promise(_0x24676b=>{const _0x347105=_0x4b0b01;console[_0x347105(0x163)](_0x347105(0x144)+PACKAGE_NAME+'@'+_0x1b31f3+_0x347105(0x15a));const _0x43abec=_0x148b71['HNFLu'](spawn,'npm',[_0x148b71['UKfEO'],'-g',PACKAGE_NAME+'@'+_0x1b31f3],{'stdio':[_0x148b71[_0x347105(0x173)],_0x347105(0x143),_0x347105(0x143)],'shell':process['platform']==='win32'});_0x43abec['on'](_0x148b71[_0x347105(0x151)],_0x2cdec8=>{_0x24676b(_0x2cdec8===0x0);}),_0x43abec['on']('error',()=>{_0x24676b(![]);});});}async function updateClaudeMarketplace(){const _0x1ee044=_0x38f3,_0xbd7908={'FWyna':_0x1ee044(0x15e),'TfVsw':_0x1ee044(0x13f),'Cmnyz':'marketplace','nWJRI':_0x1ee044(0x168),'QGTyO':'Claude\x20marketplace\x20update\x20command\x20failed\x20(timed\x20out,\x20failed\x20to\x20start,\x20or\x20exited\x20with\x20a\x20non-zero\x20status).'},_0x415954=await runCommand(_0xbd7908['FWyna'],[_0xbd7908[_0x1ee044(0x18c)],_0xbd7908['Cmnyz'],'update',_0xbd7908[_0x1ee044(0x18e)]],{'timeoutMs':CLAUDE_COMMAND_TIMEOUT_MS});if(!_0x415954)throw new Error(_0xbd7908[_0x1ee044(0x189)]);}async function updateClaudePlugin(_0x1d2c40=_0x3edbc4(0x16d)){const _0x6f5149=_0x3edbc4,_0x14d6a6={'dYwAc':'plugin','cJnoO':_0x6f5149(0x14a),'lrnKW':function(_0x15c3c3,_0xf45ac7){return _0x15c3c3!==_0xf45ac7;},'sFxlX':function(_0x25f3a3,_0x332cf0,_0x5c868c,_0x45a126){return _0x25f3a3(_0x332cf0,_0x5c868c,_0x45a126);},'WCjXU':'project','bnvHt':function(_0x4e4d79,_0x3531d1){return _0x4e4d79===_0x3531d1;},'Skmlc':'local'},_0x31bfca=[_0x14d6a6[_0x6f5149(0x14b)],'update',_0x14d6a6[_0x6f5149(0x16e)]];_0x14d6a6['lrnKW'](_0x1d2c40,'user')&&_0x31bfca[_0x6f5149(0x171)](_0x6f5149(0x14f),_0x1d2c40);const _0x50e0fa=await _0x14d6a6['sFxlX'](runCommand,'claude',_0x31bfca,{'timeoutMs':CLAUDE_COMMAND_TIMEOUT_MS,'cwd':_0x1d2c40===_0x14d6a6[_0x6f5149(0x154)]||_0x14d6a6[_0x6f5149(0x158)](_0x1d2c40,_0x14d6a6['Skmlc'])?getProjectRoot():undefined});if(!_0x50e0fa)throw new Error('Claude\x20plugin\x20update\x20failed\x20for\x20'+_0x1d2c40+'\x20scope\x20(timed\x20out,\x20failed\x20to\x20start,\x20or\x20exited\x20with\x20a\x20non-zero\x20status).');}function isSkillInstalled(_0x28b8fd,_0x230129,_0x5ba117){const _0x5ae101=_0x3edbc4,_0x409f0b={'Zvsko':function(_0xa2383a,_0x49c5b3){return _0xa2383a===_0x49c5b3;},'gjMqN':_0x5ae101(0x15f),'CzNwU':function(_0x4b7840,_0x50a19b){return _0x4b7840(_0x50a19b);},'hyiWh':function(_0x1dc965,_0x3df063){return _0x1dc965(_0x3df063);}},_0x1e9ae6=_0x409f0b[_0x5ae101(0x15c)](_0x5ba117,_0x409f0b['gjMqN'])?getOpencodeSkillsDir(_0x230129):_0x409f0b['CzNwU'](getSkillsDir,_0x230129),_0xde8d2=join(_0x1e9ae6,_0x28b8fd);return _0x409f0b['hyiWh'](existsSync,_0xde8d2);}function _0x4d46(){const _0xb52e97=['DhWnv','splice','36CfKzlb','--scope','GejMy','ZARaa','1047618qzahAK','active-feature.txt','WCjXU','\x0aClaude\x20plugin\x20updated\x20(local\x20scope).','DhOpX','dWYyM','bnvHt','platform','...\x0a','ojgeH','Zvsko','\x0aClaude\x20plugin\x20updated\x20(project\x20scope).','claude','opencode','install','\x20ranger-managed\x20skill(s)...','451FiCQYz','log','alpha','138aHfcIJ','timeoutMs','trim','trailhead','\x0aYou\x20are\x20already\x20on\x20the\x20latest\x20version.','7419300MCAAlL','warn','QfBVx','user','cJnoO','Latest\x20version:\x20\x20','\x20channel.','push','\x0aCurrent\x20version:\x20','saTBZ','length','scope','4083qxOISP','mTaOr','Rxhuw','stdio','local','mPVht','Olaub','LfJpb','unref','.gitignore','686945QwbqqO','project','error','Attempting\x20install\x20anyway...','863368gZmBBi','utf-8','206ZYJaqI','FisnD','100219wUTxmW','QGTyO','\x0aYour\x20version\x20(','102990UbryzG','TfVsw','endsWith','nWJRI','HqTgz','\x0aClaude\x20marketplace\x20updated\x20(trailhead).','SyyON','DyEru','plugin','NUUAG','12HcmlZE','PkFxW','inherit','\x0aInstalling\x20','test','\x0a✅\x20Update\x20complete!',').\x20Staying\x20on\x20','DcYxS',')\x20is\x20newer\x20than\x20the\x20published\x20version\x20(','ranger@trailhead','dYwAc'];_0x4d46=function(){return _0xb52e97;};return _0x4d46();}async function reinstallSkills(_0x132f43){const _0x1b49a3=_0x3edbc4,_0x5d3cc9={'grGbi':'claude','MbssX':function(_0x1bc204,_0x34b5dc,_0x44167c,_0x58fcf7){return _0x1bc204(_0x34b5dc,_0x44167c,_0x58fcf7);},'DhOpX':function(_0x41a526,_0xd1ad65){return _0x41a526===_0xd1ad65;},'KBfjd':'\x0aNo\x20ranger-managed\x20skills\x20found\x20to\x20reinstall.'},_0x469204=[_0x1b49a3(0x181),'user'],_0x1b86a1=[];for(const _0x330278 of _0x469204){for(const _0x4f36dc of RANGER_MANAGED_SKILLS){isSkillInstalled(_0x4f36dc,_0x330278,_0x5d3cc9['grGbi'])&&_0x1b86a1['push']({'skillName':_0x4f36dc,'level':_0x330278,'platform':'claude'}),_0x5d3cc9['MbssX'](isSkillInstalled,_0x4f36dc,_0x330278,'opencode')&&_0x1b86a1['push']({'skillName':_0x4f36dc,'level':_0x330278,'platform':'opencode'});}}for(const _0x15189a of _0x469204){for(const _0x2f820d of DEPRECATED_SKILLS){await removeSkill(_0x2f820d,_0x15189a);}}if(_0x5d3cc9[_0x1b49a3(0x156)](_0x1b86a1[_0x1b49a3(0x174)],0x0)){console[_0x1b49a3(0x163)](_0x5d3cc9['KBfjd']);return;}console[_0x1b49a3(0x163)]('\x0aReinstalling\x20'+_0x1b86a1['length']+_0x1b49a3(0x161));for(const {skillName:_0x30eeab,level:_0x1c4329,platform:_0x32d5bf}of _0x1b86a1){try{await installSkill(_0x30eeab,{'level':_0x1c4329,'cliVersion':_0x132f43,'platform':_0x32d5bf});}catch(_0x19214f){console[_0x1b49a3(0x16b)]('\x20\x20Failed\x20to\x20reinstall\x20'+_0x32d5bf+'\x20'+_0x1c4329+'\x20skill\x20'+_0x30eeab+':',_0x19214f);}}}async function ensureActiveProfileGitignored(){const _0x3d64d9=_0x3edbc4,_0x3a5539={'BYrCf':function(_0x28920b){return _0x28920b();},'fWejc':_0x3d64d9(0x17f),'wyWGT':function(_0x3c9e25,_0x4c91c3){return _0x3c9e25(_0x4c91c3);},'wSmJc':'active-profile.txt','QfBVx':_0x3d64d9(0x185)},_0x5345aa=join(_0x3a5539['BYrCf'](getRangerDir),_0x3a5539['fWejc']);if(!_0x3a5539['wyWGT'](existsSync,_0x5345aa))return![];let _0x252fb6='';try{_0x252fb6=await readFile(_0x5345aa,'utf-8');}catch{return![];}const _0x474211=_0x252fb6['split'](/\r?\n/);if(_0x474211['some'](_0x5602a5=>_0x5602a5[_0x3d64d9(0x167)]()==='active-profile.txt'))return![];let _0x45ce9a=_0x474211['findIndex'](_0xfd72af=>_0xfd72af[_0x3d64d9(0x167)]()===_0x3d64d9(0x153));_0x45ce9a===-0x1&&(_0x45ce9a=_0x474211['length']);_0x474211[_0x3d64d9(0x14d)](_0x45ce9a,0x0,_0x3a5539['wSmJc']);let _0x288e98=_0x474211['join']('\x0a');!_0x288e98[_0x3d64d9(0x18d)]('\x0a')&&(_0x288e98+='\x0a');try{await writeFile(_0x5345aa,_0x288e98,_0x3a5539[_0x3d64d9(0x16c)]);}catch{return![];}return!![];}export async function update(){const _0x58051a=_0x3edbc4,_0x23ebe7={'Rxhuw':function(_0x58f723){return _0x58f723();},'PkFxW':function(_0x1b11d2,_0x3d068a){return _0x1b11d2(_0x3d068a);},'NUUAG':function(_0xe9ca70){return _0xe9ca70();},'mTaOr':_0x58051a(0x183),'XCstK':_0x58051a(0x169),'mPVht':'Update\x20failed.','dWYyM':_0x58051a(0x14a),'jgTuT':function(_0x553c8d){return _0x553c8d();},'FisnD':function(_0x220ef9,_0x269eaa){return _0x220ef9===_0x269eaa;},'DhWnv':'project','DcYxS':function(_0x5e7700,_0x409199){return _0x5e7700===_0x409199;},'GejMy':'\x0aClaude\x20plugin\x20updated\x20(user\x20scope).'},_0x190f9f=_0x23ebe7[_0x58051a(0x178)](getCurrentVersion);console['log'](_0x58051a(0x172)+_0x190f9f);const _0x14fddc=resolveDistTag(_0x190f9f);if(_0x14fddc!=='latest'){console['log']('Prerelease\x20channel\x20detected\x20(@'+_0x14fddc+_0x58051a(0x147)+_0x14fddc+'\x20—\x20reinstalling\x20@'+_0x14fddc+'...');const _0x459699=await runInstall(_0x14fddc);if(!_0x459699)throw new Error('Update\x20failed\x20for\x20@'+_0x14fddc+_0x58051a(0x170));const _0x33f4e8=getCurrentVersion();console['log']('\x0aSuccessfully\x20installed\x20'+PACKAGE_NAME+'@'+_0x14fddc+'.'),await _0x23ebe7[_0x58051a(0x142)](reinstallSkills,_0x33f4e8),await _0x23ebe7['NUUAG'](ensureActiveProfileGitignored),console['log'](_0x58051a(0x146));return;}console['log']('Checking\x20for\x20updates...');const _0xe6541=getLatestVersion();let _0x2bf084=_0x190f9f;if(!_0xe6541['version']){console[_0x58051a(0x16b)]('\x0aCould\x20not\x20check\x20latest\x20version:\x20'+_0xe6541['error']),console[_0x58051a(0x163)](_0x23ebe7[_0x58051a(0x177)]);const _0x2869af=await _0x23ebe7[_0x58051a(0x140)](runInstall);if(_0x2869af)console['log']('\x0aSuccessfully\x20installed\x20latest\x20version.'),_0x2bf084=getCurrentVersion();else throw new Error('Update\x20failed:\x20'+_0xe6541[_0x58051a(0x182)]);}else{const _0x2cafa0=_0xe6541['version'];console[_0x58051a(0x163)](_0x58051a(0x16f)+_0x2cafa0);const _0x1f086c=compareVersions(_0x190f9f,_0x2cafa0);if(_0x1f086c===0x0)console['log'](_0x23ebe7['XCstK']);else{if(_0x1f086c<0x0)console[_0x58051a(0x163)](_0x58051a(0x18a)+_0x190f9f+_0x58051a(0x149)+_0x2cafa0+').');else{const _0x3ecc25=await _0x23ebe7[_0x58051a(0x140)](runInstall);if(_0x3ecc25)console[_0x58051a(0x163)]('\x0aSuccessfully\x20updated\x20to\x20version\x20'+_0x2cafa0),_0x2bf084=_0x2cafa0;else throw new Error(_0x23ebe7[_0x58051a(0x17b)]);}}}await reinstallSkills(_0x2bf084);const _0x1d576a=await isMarketplaceAdded('trailhead'),_0xa158e4=await isPluginInstalled(_0x23ebe7[_0x58051a(0x157)]);_0x1d576a&&(await _0x23ebe7['jgTuT'](updateClaudeMarketplace),console['log'](_0x58051a(0x190)));if(_0xa158e4){const _0x3ca3c9=await _0x23ebe7['PkFxW'](getPluginInfo,_0x58051a(0x14a)),_0x4acc3f=_0x3ca3c9?.[_0x58051a(0x175)]??'user';await updateClaudePlugin(_0x4acc3f);if(_0x23ebe7[_0x58051a(0x187)](_0x4acc3f,_0x23ebe7[_0x58051a(0x14c)]))console['log'](_0x58051a(0x15d));else _0x23ebe7[_0x58051a(0x148)](_0x4acc3f,_0x58051a(0x17a))?console['log'](_0x58051a(0x155)):console[_0x58051a(0x163)](_0x23ebe7[_0x58051a(0x150)]);}const _0x2f3d5e=await ensureActiveProfileGitignored();console['log'](_0x58051a(0x146));}
|
|
1
|
+
(function(_0x5301df,_0x3f0849){const _0x34237f=_0x349c,_0x259f5c=_0x5301df();while(!![]){try{const _0x32af6f=parseInt(_0x34237f(0x23c))/0x1+-parseInt(_0x34237f(0x1ef))/0x2+-parseInt(_0x34237f(0x225))/0x3*(parseInt(_0x34237f(0x214))/0x4)+-parseInt(_0x34237f(0x202))/0x5+parseInt(_0x34237f(0x239))/0x6*(parseInt(_0x34237f(0x1f2))/0x7)+parseInt(_0x34237f(0x22d))/0x8+-parseInt(_0x34237f(0x21a))/0x9*(-parseInt(_0x34237f(0x227))/0xa);if(_0x32af6f===_0x3f0849)break;else _0x259f5c['push'](_0x259f5c['shift']());}catch(_0xd8f6ff){_0x259f5c['push'](_0x259f5c['shift']());}}}(_0x4e1e,0x5b0da));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{getProjectRoot,getSkillsDir}from'./utils/claudeConfig.js';function _0x349c(_0x4b99b4,_0x3a4152){_0x4b99b4=_0x4b99b4-0x1e7;const _0x4e1e36=_0x4e1e();let _0x349cfc=_0x4e1e36[_0x4b99b4];return _0x349cfc;}import{getOpencodeSkillsDir}from'./utils/opencodeConfig.js';import{join}from'path';import{getRangerDir}from'./utils/rangerRoot.js';function _0x4e1e(){const _0x54f856=['split','active-profile.txt','claude','INPze','lCUKd','\x0aClaude\x20plugin\x20updated\x20(user\x20scope).','pEjlg','inherit','eOtLY','local','utf-8','162006lhBwED','vIxiH','stdio','637553btQUzp','Arkxq','Update\x20failed.','xczcA','...\x0a','test','OWqNh','\x0aClaude\x20plugin\x20updated\x20(local\x20scope).','PXmcL','FRPjR','1420770VnQTho','length','\x20—\x20reinstalling\x20@','63NLFSwj','platform','version','alpha','pNUFs','push','VDFQe','Update\x20failed:\x20','error','ceViB','\x0aCould\x20not\x20check\x20latest\x20version:\x20','trim','ABVpZ','uZTTB','OFfNe',').\x20Staying\x20on\x20','1135135JGXYUT','\x0aSuccessfully\x20updated\x20to\x20version\x20','beta','user','hBGOY','AVseN','Latest\x20version:\x20\x20','CcscQ','ngoUx','SOKpj','\x0aNo\x20ranger-managed\x20skills\x20found\x20to\x20reinstall.','\x0a✅\x20Update\x20complete!','\x0aSuccessfully\x20installed\x20','update','marketplace','ranger@trailhead','LvqzD','YiaFd','72RJLuLJ','\x0aInstalling\x20','CBqKh','warn','log','close','3962295pOjuGn','pRMnT','JCOIH','\x0aSuccessfully\x20installed\x20latest\x20version.','GYsNU','.gitignore','sGvXy','\x20ranger-managed\x20skill(s)...','win32','install','TRBTG','89805lTIIuu','trailhead','10KkkdeJ','PdJaH','plugin','\x0aClaude\x20plugin\x20updated\x20(project\x20scope).','CGRyT','EaDAd','4227032lQkaob'];_0x4e1e=function(){return _0x54f856;};return _0x4e1e();}import{getPluginInfo,isMarketplaceAdded,isPluginInstalled}from'./utils/claudePlugin.js';const CLAUDE_COMMAND_TIMEOUT_MS=0x1d4c0;async function runCommand(_0x18b13e,_0x1d70e7,_0x2137c7){const _0x5e86ed={'UixrU':function(_0x23d219,_0x583615){return _0x23d219(_0x583615);},'Arkxq':function(_0x42599d,_0x3a4b8d){return _0x42599d(_0x3a4b8d);},'bmFgv':'inherit','ABVpZ':'win32','VDFQe':function(_0x3bd2af,_0x5c1a19,_0x34adc3){return _0x3bd2af(_0x5c1a19,_0x34adc3);}};return new Promise(_0x280bec=>{const _0x42ef50=_0x349c,_0x2e977f={'OjMbZ':function(_0x333faf,_0xf5dc34){const _0x4bad7e=_0x349c;return _0x5e86ed[_0x4bad7e(0x23d)](_0x333faf,_0xf5dc34);},'pEjlg':function(_0x466f64,_0x2398d2){return _0x5e86ed['UixrU'](_0x466f64,_0x2398d2);}};let _0x280963=![],_0x3f30db;const _0x3dadb8=_0xe2ceb6=>{const _0x4699b4=_0x349c;if(_0x280963)return;_0x280963=!![],_0x3f30db&&_0x2e977f['OjMbZ'](clearTimeout,_0x3f30db),_0x2e977f[_0x4699b4(0x234)](_0x280bec,_0xe2ceb6);},_0x47bf7b=spawn(_0x18b13e,_0x1d70e7,{'stdio':['ignore',_0x2137c7?.[_0x42ef50(0x23b)]??_0x5e86ed['bmFgv'],_0x2137c7?.['stdio']??'inherit'],'cwd':_0x2137c7?.['cwd'],'shell':process['platform']===_0x5e86ed[_0x42ef50(0x1fe)]});_0x3f30db=_0x2137c7?.['timeoutMs']?_0x5e86ed[_0x42ef50(0x1f8)](setTimeout,()=>{_0x47bf7b['kill'](),_0x47bf7b['unref'](),_0x3dadb8(![]);},_0x2137c7['timeoutMs']):undefined,_0x47bf7b['on'](_0x42ef50(0x219),_0x4c9acd=>{_0x3dadb8(_0x4c9acd===0x0);}),_0x47bf7b['on'](_0x42ef50(0x1fa),()=>{_0x5e86ed['UixrU'](_0x3dadb8,![]);});});}export function resolveDistTag(_0x57155d){const _0x42fa6a=_0x349c;if(/-alpha\./i[_0x42fa6a(0x1ea)](_0x57155d))return _0x42fa6a(0x1f5);if(/-beta\./i['test'](_0x57155d))return _0x42fa6a(0x204);if(/-rc\./i['test'](_0x57155d))return'rc';return'latest';}async function runInstall(_0x55785c='latest'){const _0x467240=_0x349c,_0x2ee0d2={'glWXE':function(_0x2aca62,_0x301008,_0x2dceb1,_0x2ed244){return _0x2aca62(_0x301008,_0x2dceb1,_0x2ed244);},'YiaFd':_0x467240(0x223),'Disfg':_0x467240(0x235),'LvqzD':_0x467240(0x222),'eOtLY':_0x467240(0x1fa)};return new Promise(_0x17b1fc=>{const _0xe8810d=_0x467240,_0x9d036e={'JCOIH':function(_0x35a81d,_0x1a2ee9){return _0x35a81d(_0x1a2ee9);},'pRMnT':function(_0x5d6a4b,_0x486d76){return _0x5d6a4b(_0x486d76);}};console[_0xe8810d(0x218)](_0xe8810d(0x215)+PACKAGE_NAME+'@'+_0x55785c+_0xe8810d(0x1e9));const _0x1fbf80=_0x2ee0d2['glWXE'](spawn,'npm',[_0x2ee0d2[_0xe8810d(0x213)],'-g',PACKAGE_NAME+'@'+_0x55785c],{'stdio':['ignore',_0x2ee0d2['Disfg'],_0xe8810d(0x235)],'shell':process[_0xe8810d(0x1f3)]===_0x2ee0d2[_0xe8810d(0x212)]});_0x1fbf80['on']('close',_0x270be9=>{const _0x41e9b0=_0xe8810d;_0x9d036e[_0x41e9b0(0x21c)](_0x17b1fc,_0x270be9===0x0);}),_0x1fbf80['on'](_0x2ee0d2[_0xe8810d(0x236)],()=>{const _0x1ae184=_0xe8810d;_0x9d036e[_0x1ae184(0x21b)](_0x17b1fc,![]);});});}async function updateClaudeMarketplace(){const _0x497161=_0x349c,_0xac618c={'pNUFs':function(_0x17a226,_0x454417,_0x2ee0d6,_0x24a258){return _0x17a226(_0x454417,_0x2ee0d6,_0x24a258);},'OWqNh':'plugin','RJrhO':_0x497161(0x210),'HInBr':_0x497161(0x20f),'GYsNU':_0x497161(0x226),'dvVeu':'Claude\x20marketplace\x20update\x20command\x20failed\x20(timed\x20out,\x20failed\x20to\x20start,\x20or\x20exited\x20with\x20a\x20non-zero\x20status).'},_0x48eb12=await _0xac618c[_0x497161(0x1f6)](runCommand,_0x497161(0x230),[_0xac618c[_0x497161(0x1eb)],_0xac618c['RJrhO'],_0xac618c['HInBr'],_0xac618c[_0x497161(0x21e)]],{'timeoutMs':CLAUDE_COMMAND_TIMEOUT_MS});if(!_0x48eb12)throw new Error(_0xac618c['dvVeu']);}async function updateClaudePlugin(_0x48aced='user'){const _0x2c8770=_0x349c,_0x554376={'sGvXy':_0x2c8770(0x229),'ceViB':'ranger@trailhead','ldREJ':_0x2c8770(0x230),'CGRyT':'project','hBGOY':function(_0x3e28b4,_0x3ac868){return _0x3e28b4===_0x3ac868;}},_0x4d6457=[_0x554376[_0x2c8770(0x220)],'update',_0x554376[_0x2c8770(0x1fb)]];_0x48aced!=='user'&&_0x4d6457['push']('--scope',_0x48aced);const _0x2c4522=await runCommand(_0x554376['ldREJ'],_0x4d6457,{'timeoutMs':CLAUDE_COMMAND_TIMEOUT_MS,'cwd':_0x48aced===_0x554376[_0x2c8770(0x22b)]||_0x554376[_0x2c8770(0x206)](_0x48aced,'local')?getProjectRoot():undefined});if(!_0x2c4522)throw new Error('Claude\x20plugin\x20update\x20failed\x20for\x20'+_0x48aced+'\x20scope\x20(timed\x20out,\x20failed\x20to\x20start,\x20or\x20exited\x20with\x20a\x20non-zero\x20status).');}function isSkillInstalled(_0x287e5a,_0x413eab,_0x1f2a86){const _0x4a7d83=_0x349c,_0x5b244a={'EaDAd':function(_0x5da9a1,_0x45bb81){return _0x5da9a1===_0x45bb81;},'awaAU':function(_0x5a2db0,_0x4bf3ca){return _0x5a2db0(_0x4bf3ca);}},_0x374902=_0x5b244a[_0x4a7d83(0x22c)](_0x1f2a86,'opencode')?getOpencodeSkillsDir(_0x413eab):_0x5b244a['awaAU'](getSkillsDir,_0x413eab),_0x1a16dc=join(_0x374902,_0x287e5a);return _0x5b244a['awaAU'](existsSync,_0x1a16dc);}async function reinstallSkills(_0x2f200d){const _0x402248=_0x349c,_0x1e593d={'Yrzyv':_0x402248(0x205),'PXmcL':function(_0x41f90d,_0x3fbed8,_0x33eb6c,_0x1cc77d){return _0x41f90d(_0x3fbed8,_0x33eb6c,_0x1cc77d);},'QTQNB':_0x402248(0x230),'LdJVn':'opencode','TRBTG':function(_0x50f0b9,_0x4558be){return _0x50f0b9===_0x4558be;},'CcscQ':_0x402248(0x20c)},_0x8683e8=['project',_0x1e593d['Yrzyv']],_0x36207a=[];for(const _0x16ecfa of _0x8683e8){for(const _0x4997e9 of RANGER_MANAGED_SKILLS){_0x1e593d['PXmcL'](isSkillInstalled,_0x4997e9,_0x16ecfa,_0x1e593d['QTQNB'])&&_0x36207a[_0x402248(0x1f7)]({'skillName':_0x4997e9,'level':_0x16ecfa,'platform':_0x1e593d['QTQNB']}),_0x1e593d[_0x402248(0x1ed)](isSkillInstalled,_0x4997e9,_0x16ecfa,_0x1e593d['LdJVn'])&&_0x36207a[_0x402248(0x1f7)]({'skillName':_0x4997e9,'level':_0x16ecfa,'platform':'opencode'});}}for(const _0x2b4ae8 of _0x8683e8){for(const _0x3074fc of DEPRECATED_SKILLS){await removeSkill(_0x3074fc,_0x2b4ae8);}}if(_0x1e593d[_0x402248(0x224)](_0x36207a['length'],0x0)){console[_0x402248(0x218)](_0x1e593d[_0x402248(0x209)]);return;}console['log']('\x0aReinstalling\x20'+_0x36207a[_0x402248(0x1f0)]+_0x402248(0x221));for(const {skillName:_0x31ff5f,level:_0x1952e4,platform:_0x11b627}of _0x36207a){try{await installSkill(_0x31ff5f,{'level':_0x1952e4,'cliVersion':_0x2f200d,'platform':_0x11b627});}catch(_0x25819a){console[_0x402248(0x217)]('\x20\x20Failed\x20to\x20reinstall\x20'+_0x11b627+'\x20'+_0x1952e4+'\x20skill\x20'+_0x31ff5f+':',_0x25819a);}}}async function ensureActiveProfileGitignored(){const _0x23a0c6=_0x349c,_0x5d604a={'PdJaH':function(_0x70fa45,_0x4f21cf,_0x386c9e){return _0x70fa45(_0x4f21cf,_0x386c9e);},'hoRGV':function(_0x306ebc,_0x55cfff){return _0x306ebc(_0x55cfff);},'AVseN':_0x23a0c6(0x238),'OFfNe':'active-profile.txt','yCJZO':function(_0x51092c,_0x16399e,_0x5b2c5e,_0x4ec85d){return _0x51092c(_0x16399e,_0x5b2c5e,_0x4ec85d);}},_0x9f5cd5=_0x5d604a[_0x23a0c6(0x228)](join,getRangerDir(),_0x23a0c6(0x21f));if(!_0x5d604a['hoRGV'](existsSync,_0x9f5cd5))return![];let _0x89f7d3='';try{_0x89f7d3=await readFile(_0x9f5cd5,_0x5d604a[_0x23a0c6(0x207)]);}catch{return![];}const _0x253018=_0x89f7d3[_0x23a0c6(0x22e)](/\r?\n/);if(_0x253018['some'](_0x366326=>_0x366326[_0x23a0c6(0x1fd)]()===_0x23a0c6(0x22f)))return![];let _0x1400b7=_0x253018['findIndex'](_0x31cc15=>_0x31cc15['trim']()==='active-feature.txt');_0x1400b7===-0x1&&(_0x1400b7=_0x253018[_0x23a0c6(0x1f0)]);_0x253018['splice'](_0x1400b7,0x0,_0x5d604a[_0x23a0c6(0x200)]);let _0x5aa87f=_0x253018['join']('\x0a');!_0x5aa87f['endsWith']('\x0a')&&(_0x5aa87f+='\x0a');try{await _0x5d604a['yCJZO'](writeFile,_0x9f5cd5,_0x5aa87f,'utf-8');}catch{return![];}return!![];}export async function update(){const _0x518017=_0x349c,_0x1efa6b={'ikmjI':function(_0x222fb8){return _0x222fb8();},'SOKpj':function(_0x29756d,_0x16d7c1){return _0x29756d(_0x16d7c1);},'CdRPY':function(_0x22560a){return _0x22560a();},'ngoUx':'Checking\x20for\x20updates...','sMPvw':function(_0x11c413){return _0x11c413();},'CBqKh':'Attempting\x20install\x20anyway...','FRPjR':function(_0x7f8ec){return _0x7f8ec();},'iKktw':function(_0x2bc1b5,_0x16c6f3,_0x26d181){return _0x2bc1b5(_0x16c6f3,_0x26d181);},'lCUKd':'\x0aYou\x20are\x20already\x20on\x20the\x20latest\x20version.','EaUzk':function(_0x54f1e7){return _0x54f1e7();},'INPze':_0x518017(0x1e7),'uZTTB':function(_0x482fd1,_0x4031ce){return _0x482fd1(_0x4031ce);},'iXiBh':'ranger@trailhead','xczcA':function(_0x4e0b45,_0x32408c){return _0x4e0b45===_0x32408c;},'ZFhOP':_0x518017(0x22a),'vLJWJ':_0x518017(0x237),'vIxiH':_0x518017(0x233)},_0x255a5b=_0x1efa6b['ikmjI'](getCurrentVersion);console[_0x518017(0x218)]('\x0aCurrent\x20version:\x20'+_0x255a5b);const _0x19f674=_0x1efa6b[_0x518017(0x20b)](resolveDistTag,_0x255a5b);if(_0x19f674!=='latest'){console['log']('Prerelease\x20channel\x20detected\x20(@'+_0x19f674+_0x518017(0x201)+_0x19f674+_0x518017(0x1f1)+_0x19f674+'...');const _0x4fc0c0=await _0x1efa6b['SOKpj'](runInstall,_0x19f674);if(!_0x4fc0c0)throw new Error('Update\x20failed\x20for\x20@'+_0x19f674+'\x20channel.');const _0x12f362=_0x1efa6b['CdRPY'](getCurrentVersion);console['log'](_0x518017(0x20e)+PACKAGE_NAME+'@'+_0x19f674+'.'),await reinstallSkills(_0x12f362),await ensureActiveProfileGitignored(),console[_0x518017(0x218)](_0x518017(0x20d));return;}console['log'](_0x1efa6b[_0x518017(0x20a)]);const _0x5176ad=_0x1efa6b['sMPvw'](getLatestVersion);let _0x582498=_0x255a5b;if(!_0x5176ad['version']){console['warn'](_0x518017(0x1fc)+_0x5176ad[_0x518017(0x1fa)]),console['log'](_0x1efa6b[_0x518017(0x216)]);const _0x317992=await _0x1efa6b[_0x518017(0x1ee)](runInstall);if(_0x317992)console[_0x518017(0x218)](_0x518017(0x21d)),_0x582498=getCurrentVersion();else throw new Error(_0x518017(0x1f9)+_0x5176ad['error']);}else{const _0x217219=_0x5176ad[_0x518017(0x1f4)];console[_0x518017(0x218)](_0x518017(0x208)+_0x217219);const _0x26388d=_0x1efa6b['iKktw'](compareVersions,_0x255a5b,_0x217219);if(_0x26388d===0x0)console['log'](_0x1efa6b[_0x518017(0x232)]);else{if(_0x26388d<0x0)console[_0x518017(0x218)]('\x0aYour\x20version\x20('+_0x255a5b+')\x20is\x20newer\x20than\x20the\x20published\x20version\x20('+_0x217219+').');else{const _0x134a28=await _0x1efa6b['EaUzk'](runInstall);if(_0x134a28)console[_0x518017(0x218)](_0x518017(0x203)+_0x217219),_0x582498=_0x217219;else throw new Error(_0x1efa6b[_0x518017(0x231)]);}}}await _0x1efa6b['SOKpj'](reinstallSkills,_0x582498);const _0x267884=await isMarketplaceAdded('trailhead'),_0x5da068=await _0x1efa6b['SOKpj'](isPluginInstalled,_0x518017(0x211));_0x267884&&(await _0x1efa6b['FRPjR'](updateClaudeMarketplace),console[_0x518017(0x218)]('\x0aClaude\x20marketplace\x20updated\x20(trailhead).'));if(_0x5da068){const _0x91c428=await _0x1efa6b[_0x518017(0x1ff)](getPluginInfo,_0x1efa6b['iXiBh']),_0x51622d=_0x91c428?.['scope']??_0x518017(0x205);await _0x1efa6b[_0x518017(0x1ff)](updateClaudePlugin,_0x51622d);if(_0x1efa6b[_0x518017(0x1e8)](_0x51622d,'project'))console['log'](_0x1efa6b['ZFhOP']);else _0x1efa6b['xczcA'](_0x51622d,_0x1efa6b['vLJWJ'])?console[_0x518017(0x218)](_0x518017(0x1ec)):console[_0x518017(0x218)](_0x1efa6b[_0x518017(0x23a)]);}const _0x41f913=await ensureActiveProfileGitignored();console['log'](_0x518017(0x20d));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1b1a2d,_0x4c3a32){var _0x1de5a6=_0x36e8,_0xaae52b=_0x1b1a2d();while(!![]){try{var _0x44ee67=-parseInt(_0x1de5a6(0x18d))/0x1*(parseInt(_0x1de5a6(0x18b))/0x2)+parseInt(_0x1de5a6(0x194))/0x3*(-parseInt(_0x1de5a6(0x190))/0x4)+parseInt(_0x1de5a6(0x18e))/0x5*(parseInt(_0x1de5a6(0x18a))/0x6)+parseInt(_0x1de5a6(0x192))/0x7*(parseInt(_0x1de5a6(0x189))/0x8)+-parseInt(_0x1de5a6(0x191))/0x9*(-parseInt(_0x1de5a6(0x18f))/0xa)+-parseInt(_0x1de5a6(0x196))/0xb+-parseInt(_0x1de5a6(0x193))/0xc;if(_0x44ee67===_0x4c3a32)break;else _0xaae52b['push'](_0xaae52b['shift']());}catch(_0x24f20f){_0xaae52b['push'](_0xaae52b['shift']());}}}(_0x5c64,0x57462));function _0x5c64(){var _0x112099=['138VeVCuh','20310EuTVMW','\x20\x20https://docs.ranger.net/main/concepts/profiles','26FiEwIW','71065jnfhPo','10AUTnGl','1182652fWGqQA','6053958dnPrkR','16877lXjZkj','3139356MGgnba','3fevQbT','re-run\x20the\x20same\x20setup\x20that\x20created\x20the\x20profile:\x0a','3889732HDhAsc','UvSRr','WhbrR','ranger\x20profile\x20update\x20is\x20no\x20longer\x20supported.\x20To\x20refresh\x20authentication,\x0a','1768DKybyM'];_0x5c64=function(){return _0x112099;};return _0x5c64();}function _0x36e8(_0x2af80c,_0x5a7e65){_0x2af80c=_0x2af80c-0x189;var _0x5c6403=_0x5c64();var _0x36e810=_0x5c6403[_0x2af80c];return _0x36e810;}export async function updateEnv(_0x2396a5,_0x39401d,_0x31e7fb){var _0xd0e07b=_0x36e8,_0x260f65={'UvSRr':function(_0x50a7dc,_0x950e32){return _0x50a7dc+_0x950e32;},'WhbrR':_0xd0e07b(0x195)};console['error'](_0x260f65[_0xd0e07b(0x197)](_0x260f65[_0xd0e07b(0x197)](_0xd0e07b(0x199)+_0x260f65[_0xd0e07b(0x198)],'\x0a'),'\x20\x20ranger\x20profile\x20add\x20<name>\x0a')+'\x0a'+'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a'+_0xd0e07b(0x18c)),process['exit'](0x1);}
|
package/build/commands/useEnv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x25fc08,_0x27f0ee){const _0x1e37f0=_0x2436,_0x4724b8=_0x25fc08();while(!![]){try{const _0x3131de=-parseInt(_0x1e37f0(0x189))/0x1+-parseInt(_0x1e37f0(0x182))/0x2*(-parseInt(_0x1e37f0(0x191))/0x3)+-parseInt(_0x1e37f0(0x185))/0x4+parseInt(_0x1e37f0(0x18e))/0x5+-parseInt(_0x1e37f0(0x18d))/0x6+-parseInt(_0x1e37f0(0x18c))/0x7*(parseInt(_0x1e37f0(0x18b))/0x8)+parseInt(_0x1e37f0(0x190))/0x9;if(_0x3131de===_0x27f0ee)break;else _0x4724b8['push'](_0x4724b8['shift']());}catch(_0x30cd63){_0x4724b8['push'](_0x4724b8['shift']());}}}(_0x59eb,0x687ae));function _0x59eb(){const _0x499115=['72WUMyTc','496258kCrEMy','2557710YVoMBL','54035FtgPqe','log','13325481TsSlCB','213GpHkQk','17164CgkEok','\x22\x20not\x20found\x20locally\x20or\x20in\x20the\x20cloud.\x20','TssCC','2149716MstzJV','`ranger\x20profile\x20add\x20','Run\x20`ranger\x20profile\x20ls`\x20to\x20see\x20available\x20profiles,\x20or\x20','status','71028canJkb','`\x20to\x20create\x20one.'];_0x59eb=function(){return _0x499115;};return _0x59eb();}import{join}from'path';import{existsSync}from'fs';function _0x2436(_0x2b7dc7,_0x32903e){_0x2b7dc7=_0x2b7dc7-0x182;const _0x59ebdc=_0x59eb();let _0x2436eb=_0x59ebdc[_0x2b7dc7];return _0x2436eb;}import{getEnvDir}from'./utils/settings.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{ApiError,fetchCloudProfile}from'./utils/cloudProfile.js';export async function useEnv(_0x614106){const _0x260dc3=_0x2436,_0x273fe5={'TssCC':function(_0x1162cd,_0x46c13f,_0x2cf68d){return _0x1162cd(_0x46c13f,_0x2cf68d);},'oCUhs':function(_0xeb340f,_0x4a6ae5){return _0xeb340f(_0x4a6ae5);}},_0x34f82f=getEnvDir(_0x614106),_0x43e6ef=_0x273fe5[_0x260dc3(0x184)](join,_0x34f82f,'settings.json'),_0x387889=_0x273fe5['oCUhs'](existsSync,_0x34f82f)&&existsSync(_0x43e6ef);if(_0x387889){await writeActiveProfileName(_0x614106),console[_0x260dc3(0x18f)]('\x0a✓\x20Now\x20using\x20profile\x20\x22'+_0x614106+'\x22');return;}let _0x3dcf7f=null,_0x3a644b=![];try{_0x3dcf7f=await fetchCloudProfile(_0x614106);if(!_0x3dcf7f)_0x3a644b=!![];}catch(_0x53caf6){_0x53caf6 instanceof ApiError&&_0x53caf6[_0x260dc3(0x188)]===0x194&&(_0x3a644b=!![]);}if(_0x3a644b)throw new Error('Profile\x20\x22'+_0x614106+_0x260dc3(0x183)+_0x260dc3(0x187)+(_0x260dc3(0x186)+_0x614106+_0x260dc3(0x18a)));await _0x273fe5['oCUhs'](writeActiveProfileName,_0x614106),console['log']('\x0a✓\x20Now\x20using\x20profile\x20\x22'+_0x614106+'\x22');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function _0x3c6a(_0x5471dd,_0x2f2aa4){_0x5471dd=_0x5471dd-0x7d;const _0x3ded95=_0x3ded();let _0x3c6af9=_0x3ded95[_0x5471dd];return _0x3c6af9;}function _0x3ded(){const _0x236f3d=['utf-8','MDzld','UxomB','773308IGaYxx','683859ZTarvK','65176BvfhVc','4192559igJmai','cwd','trim','390244GBqVOY','522SaEyqv','Pefvm','1466490AQpcsB','776946cZJAuu','active-env.txt','3HJdzlg'];_0x3ded=function(){return _0x236f3d;};return _0x3ded();}const _0x516ce4=_0x3c6a;(function(_0x273ca6,_0x59e10e){const _0x32394c=_0x3c6a,_0x931298=_0x273ca6();while(!![]){try{const _0x40d5a2=parseInt(_0x32394c(0x7d))/0x1+parseInt(_0x32394c(0x82))/0x2*(parseInt(_0x32394c(0x88))/0x3)+-parseInt(_0x32394c(0x8c))/0x4+-parseInt(_0x32394c(0x85))/0x5+-parseInt(_0x32394c(0x86))/0x6+parseInt(_0x32394c(0x7f))/0x7+parseInt(_0x32394c(0x7e))/0x8*(-parseInt(_0x32394c(0x83))/0x9);if(_0x40d5a2===_0x59e10e)break;else _0x931298['push'](_0x931298['shift']());}catch(_0x1254ff){_0x931298['push'](_0x931298['shift']());}}}(_0x3ded,0x5f09c));import{existsSync}from'fs';import{readFile}from'fs/promises';import{join}from'path';import{getRangerDir,getRangerHomeDir}from'./rangerRoot.js';import{readLastProfile,writeLastProfile}from'./projectsConfig.js';const LEGACY_ACTIVE_PROFILE_FILE='active-profile.txt',LEGACY_ACTIVE_ENV_FILE=_0x516ce4(0x87);function readLegacyActiveProfileFile(){const _0x482f63=_0x516ce4,_0x12e7a2={'Pefvm':function(_0x1e0528,_0x38dafd,_0x3b99e6){return _0x1e0528(_0x38dafd,_0x3b99e6);},'UxomB':function(_0x29e7d6){return _0x29e7d6();}},_0x42728a=[_0x12e7a2[_0x482f63(0x84)](join,_0x12e7a2['UxomB'](getRangerDir),LEGACY_ACTIVE_PROFILE_FILE),join(getRangerHomeDir(),LEGACY_ACTIVE_PROFILE_FILE),join(getRangerDir(),LEGACY_ACTIVE_ENV_FILE),join(_0x12e7a2[_0x482f63(0x8b)](getRangerHomeDir),LEGACY_ACTIVE_ENV_FILE)];for(const _0x3831d4 of _0x42728a){if(existsSync(_0x3831d4))return _0x3831d4;}return null;}export async function readActiveProfileName(){const _0x3d3580=_0x516ce4,_0x5b3a8c={'MDzld':function(_0x56c681,_0x3cce35,_0x4e22d3){return _0x56c681(_0x3cce35,_0x4e22d3);}},_0x3b2109=readLastProfile(process[_0x3d3580(0x80)]());if(_0x3b2109)return _0x3b2109;const _0x1bd613=readLegacyActiveProfileFile();if(!_0x1bd613)return null;try{return(await _0x5b3a8c[_0x3d3580(0x8a)](readFile,_0x1bd613,_0x3d3580(0x89)))[_0x3d3580(0x81)]()||null;}catch{return null;}}export async function writeActiveProfileName(_0x687d9a){const _0x40ba1b=_0x516ce4;writeLastProfile(process[_0x40ba1b(0x80)](),_0x687d9a);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0xdde3bc=_0x1a92;(function(_0x36d527,_0xebf8a0){const _0x1a50d8=_0x1a92,_0x2b2264=_0x36d527();while(!![]){try{const _0x25adda=parseInt(_0x1a50d8(0x108))/0x1+parseInt(_0x1a50d8(0x11e))/0x2+parseInt(_0x1a50d8(0x103))/0x3*(-parseInt(_0x1a50d8(0x115))/0x4)+parseInt(_0x1a50d8(0x10a))/0x5+-parseInt(_0x1a50d8(0x127))/0x6*(-parseInt(_0x1a50d8(0x117))/0x7)+-parseInt(_0x1a50d8(0x11d))/0x8*(-parseInt(_0x1a50d8(0x11f))/0x9)+-parseInt(_0x1a50d8(0x102))/0xa;if(_0x25adda===_0xebf8a0)break;else _0x2b2264['push'](_0x2b2264['shift']());}catch(_0x1cb80d){_0x2b2264['push'](_0x2b2264['shift']());}}}(_0x318f,0xa46c6));import{delimiter,join}from'path';import{tmpdir}from'os';import{mkdirSync}from'fs';function _0x318f(){const _0x3dbe6f=['slice','1045610ZvpcBj','TEMP','735310IgUvWP','env','split','push','CHROME_BIN','APPDATA','map','DEBUG','set','PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD','LijFE','140xTsYeq','trim','40201fbsYtA','HqGpR','/usr/bin','npm_config_prefix','metadata','USERPROFILE','1187264LQZYND','242204TesXuA','81yTAXHO','join','TMP','filter','npm_config_registry','rMIaU','$PATH','fromEntries','246lDZGqQ','NODE_ENV','NPM_CONFIG_USERCONFIG','toLowerCase','%PATH%','WRbTN','win32','entries','bLWkr','length','RANGER_TEST_SKIP_BROWSER_WAIT','includes','add','19255160yLOxcb','24507cCXrem','PATH\x20is\x20missing\x20core\x20system\x20directories\x20like\x20`/usr/bin`\x20and\x20`/bin`.','has','XDG_CACHE_HOME'];_0x318f=function(){return _0x3dbe6f;};return _0x318f();}function _0x1a92(_0x82247,_0x517711){_0x82247=_0x82247-0x101;const _0x318fd6=_0x318f();let _0x1a92c1=_0x318fd6[_0x82247];return _0x1a92c1;}import{getAiProxyUrl}from'./environment.js';const AI_PROXY_METADATA_HEADERS_ENV_VAR='ANTHROPIC_CUSTOM_HEADERS',AGENT_ENV_PASSTHROUGH_KEYS=['PATH','HOME','TMPDIR',_0xdde3bc(0x121),_0xdde3bc(0x109),_0xdde3bc(0x11c),_0xdde3bc(0x10f),'LOCALAPPDATA',_0xdde3bc(0x106),'XDG_CONFIG_HOME','PLAYWRIGHT_BROWSERS_PATH',_0xdde3bc(0x113),_0xdde3bc(0x10e),'CHROMIUM_BIN','npm_config_cache','NPM_CONFIG_CACHE','npm_config_userconfig',_0xdde3bc(0x129),_0xdde3bc(0x11a),'NPM_CONFIG_PREFIX',_0xdde3bc(0x123),'NPM_CONFIG_REGISTRY',_0xdde3bc(0x111),_0xdde3bc(0x128),_0xdde3bc(0x131),'RANGER_DISABLE_MCP',AI_PROXY_METADATA_HEADERS_ENV_VAR],UNEXPANDED_PATH_TOKEN_PATTERNS=['${PATH}',_0xdde3bc(0x125),_0xdde3bc(0x12b)];function parseCustomHeaders(_0x189884){const _0x17c181=_0xdde3bc,_0x48794b={'WRbTN':function(_0x2dfc25,_0x50fb15){return _0x2dfc25===_0x50fb15;}};if(!_0x189884)return[];return _0x189884['split'](/\r?\n/)[_0x17c181(0x110)](_0x2f9ee5=>_0x2f9ee5['trim']())['filter'](Boolean)['map'](_0x4a726d=>{const _0x4ac1c2=_0x17c181,_0x149387=_0x4a726d['indexOf'](':');if(_0x48794b[_0x4ac1c2(0x12c)](_0x149387,-0x1))return null;const _0x29eb2a=_0x4a726d[_0x4ac1c2(0x107)](0x0,_0x149387)['trim'](),_0x491c24=_0x4a726d['slice'](_0x149387+0x1)[_0x4ac1c2(0x116)]();if(!_0x29eb2a)return null;return[_0x29eb2a,_0x491c24];})[_0x17c181(0x122)](_0x135045=>_0x135045!==null);}export function getAgentPathHealthWarning(_0x5e451b,_0x11b303=process['platform']){const _0x1f9a39=_0xdde3bc,_0x2b024e={'ZCydx':function(_0xcf4509,_0x51284c){return _0xcf4509||_0x51284c;},'DNdkt':'PATH\x20is\x20empty,\x20so\x20npm\x20and\x20core\x20system\x20tools\x20may\x20be\x20unavailable.','bLWkr':'PATH\x20contains\x20an\x20unexpanded\x20placeholder\x20like\x20`${PATH}`\x20instead\x20of\x20the\x20expanded\x20current\x20PATH.','seMJU':function(_0xdfbe87,_0x2b329d){return _0xdfbe87!==_0x2b329d;},'aeRcI':function(_0x42442f,_0x936734){return _0x42442f&&_0x936734;},'iiwZf':_0x1f9a39(0x104),'PVdGo':function(_0x19b114,_0x2852a6){return _0x19b114===_0x2852a6;},'HqGpR':'Your\x20PATH\x20looks\x20incomplete\x20for\x20browser\x20automation.\x20Ranger\x20will\x20keep\x20going,\x20but\x20browser\x20setup\x20may\x20fail.'},_0x5e8f33=[],_0x206c62=_0x2b024e['ZCydx'](_0x5e451b,'')[_0x1f9a39(0x10c)](delimiter)[_0x1f9a39(0x122)](Boolean);_0x206c62['length']===0x0&&_0x5e8f33[_0x1f9a39(0x10d)](_0x2b024e['DNdkt']);UNEXPANDED_PATH_TOKEN_PATTERNS['some'](_0x8fcab2=>(_0x5e451b||'')['includes'](_0x8fcab2))&&_0x5e8f33['push'](_0x2b024e[_0x1f9a39(0x12f)]);if(_0x2b024e['seMJU'](_0x11b303,_0x1f9a39(0x12d))){const _0xcd90dc=_0x206c62[_0x1f9a39(0x132)](_0x1f9a39(0x119)),_0x3c0dfc=_0x206c62['includes']('/bin');_0x2b024e['aeRcI'](!_0xcd90dc,!_0x3c0dfc)&&_0x5e8f33['push'](_0x2b024e['iiwZf']);}if(_0x2b024e['PVdGo'](_0x5e8f33[_0x1f9a39(0x130)],0x0))return null;return{'summary':_0x2b024e[_0x1f9a39(0x118)],'issues':_0x5e8f33};}export function buildAgentEnv(_0x3edeef){const _0x122111=_0xdde3bc,_0x2db651={'VcYUI':function(_0x2f1050,_0x3ae633,_0x28932c){return _0x2f1050(_0x3ae633,_0x28932c);},'LijFE':'ranger-claude-tmp','rMIaU':function(_0x19b78e,_0x27b65b){return _0x19b78e(_0x27b65b);},'AscEq':function(_0x43bc48,_0x444e28){return _0x43bc48===_0x444e28;}};if(_0x3edeef['byokEnabled'])return Object[_0x122111(0x126)](Object[_0x122111(0x12e)](process[_0x122111(0x10b)])['filter'](_0x4303fa=>typeof _0x4303fa[0x1]==='string'));if(!_0x3edeef['sessionToken'])throw new Error('Session\x20token\x20is\x20required\x20when\x20RANGER_BYOK=false');const _0x4f8e18={'ANTHROPIC_API_KEY':_0x3edeef['sessionToken'],'ANTHROPIC_BASE_URL':getAiProxyUrl(),'DISABLE_TELEMETRY':'true'};for(const _0xb77d97 of AGENT_ENV_PASSTHROUGH_KEYS){const _0x2894b2=process[_0x122111(0x10b)][_0xb77d97];_0x2894b2&&!['TMPDIR','TMP',_0x122111(0x109)]['includes'](_0xb77d97)&&(_0x4f8e18[_0xb77d97]=_0x2894b2);}const _0x3b9268=_0x2db651['VcYUI'](join,tmpdir(),_0x2db651[_0x122111(0x114)]);try{mkdirSync(_0x3b9268,{'recursive':!![]});}catch{}_0x4f8e18['TMPDIR']=_0x3b9268,_0x4f8e18[_0x122111(0x121)]=_0x3b9268,_0x4f8e18['TEMP']=_0x3b9268;const _0x5ad723=_0x2db651[_0x122111(0x124)](parseCustomHeaders,process['env'][AI_PROXY_METADATA_HEADERS_ENV_VAR]),_0x24ce94=new Map(_0x5ad723),_0x4794ec=new Set(_0x5ad723[_0x122111(0x110)](([_0x5bd973])=>_0x5bd973['toLowerCase']()));if(_0x3edeef[_0x122111(0x11b)])for(const [_0x1a03f0,_0x504a2e]of Object[_0x122111(0x12e)](_0x3edeef['metadata'])){if(_0x504a2e==null||_0x2db651['AscEq'](_0x504a2e,''))continue;const _0x449157='x-ranger-'+_0x1a03f0;!_0x4794ec[_0x122111(0x105)](_0x449157[_0x122111(0x12a)]())&&(_0x24ce94[_0x122111(0x112)](_0x449157,_0x504a2e),_0x4794ec[_0x122111(0x101)](_0x449157['toLowerCase']()));}const _0x453f8c=Array['from'](_0x24ce94['entries']())[_0x122111(0x110)](([_0x2457bb,_0x2c102d])=>_0x2457bb+':\x20'+_0x2c102d)[_0x122111(0x120)]('\x0a');return _0x453f8c&&(_0x4f8e18[AI_PROXY_METADATA_HEADERS_ENV_VAR]=_0x453f8c),_0x4f8e18;}
|