@ranger-testing/ranger-cli 2.5.4-alpha.f940f0d-18 → 2.5.4
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 +14 -36
- 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/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/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/keychain.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.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/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.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 +6 -36
- package/build/skills/ranger/create.md +0 -19
- package/build/skills/ranger/verify.md +7 -46
- package/package.json +3 -8
- package/build/commands/migrateProfile.js +0 -1
- package/build/commands/utils/cloudProfile.js +0 -1
- package/build/commands/utils/cloudProfileSession.js +0 -1
- package/build/commands/utils/gitTracked.js +0 -1
- package/build/commands/utils/legacyWarning.js +0 -1
- package/build/commands/utils/matchAuthEnvironment.js +0 -1
- package/build/commands/utils/projectsConfig.js +0 -1
- package/build/commands/utils/resolveProfileContext.js +0 -1
- package/build/commands/utils/resolveProfileUrl.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4622a1,_0x325909){const _0x43b3d5=_0x2ec7,_0x361540=_0x4622a1();while(!![]){try{const _0x558aae=-parseInt(_0x43b3d5(0x1f1))/0x1+-parseInt(_0x43b3d5(0x1be))/0x2*(-parseInt(_0x43b3d5(0x1cd))/0x3)+parseInt(_0x43b3d5(0x1c9))/0x4+-parseInt(_0x43b3d5(0x1ee))/0x5+parseInt(_0x43b3d5(0x1f0))/0x6*(parseInt(_0x43b3d5(0x1c0))/0x7)+parseInt(_0x43b3d5(0x1e5))/0x8+parseInt(_0x43b3d5(0x1da))/0x9*(-parseInt(_0x43b3d5(0x1e4))/0xa);if(_0x558aae===_0x325909)break;else _0x361540['push'](_0x361540['shift']());}catch(_0x22db74){_0x361540['push'](_0x361540['shift']());}}}(_0x54b6,0x346f5));import{mkdir,readFile,readdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{authenticate,ensureRangerDir,ensureChromium,writeRangerGitignore}from'./start.js';import{skillup}from'./skillup.js';function _0x2ec7(_0x129b6c,_0x2f2106){_0x129b6c=_0x129b6c-0x1be;const _0x54b695=_0x54b6();let _0x2ec747=_0x54b695[_0x129b6c];return _0x2ec747;}import{getRangerDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{saveSettings}from'./utils/settings.js';import{decrypt}from'./utils/crypto.js';import{getToken}from'./utils/keychain.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'./utils/claudePlugin.js';async function findCiProfile(_0x50ecdd){const _0x555859=_0x2ec7,_0x5b5488={'vaPlN':function(_0xf1caa7){return _0xf1caa7();},'LDQUt':function(_0x9be130,_0x32b3e5){return _0x9be130(_0x32b3e5);},'Lqqeo':function(_0x2437a8,_0x17c7a0){return _0x2437a8+_0x17c7a0;},'vSiFp':'No\x20CI\x20profiles\x20found.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','otbBD':'Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.','ArvoX':function(_0x442c94,_0x8f7176){return _0x442c94===_0x8f7176;}},_0xe79da4=_0x5b5488['vaPlN'](getRangerDir),_0xf6e013=join(_0xe79da4,'ci');if(_0x50ecdd){const _0x2d2939=join(_0xf6e013,_0x50ecdd);return{'name':_0x50ecdd,'path':_0x2d2939};}if(!_0x5b5488['LDQUt'](existsSync,_0xf6e013))throw new Error(_0x5b5488['Lqqeo'](_0x5b5488[_0x555859(0x1e9)],_0x5b5488[_0x555859(0x1e1)]));const _0x2f87f9=await readdir(_0xf6e013,{'withFileTypes':!![]}),_0x4e8181=_0x2f87f9['filter'](_0x2522b7=>_0x2522b7['isDirectory']())['map'](_0x2c43be=>_0x2c43be[_0x555859(0x1de)]);if(_0x4e8181['length']===0x0)throw new Error(_0x555859(0x1e3)+_0x555859(0x1e0));if(_0x5b5488['ArvoX'](_0x4e8181[_0x555859(0x1d3)],0x1)){const _0x16644e=_0x4e8181[0x0];return console['log'](_0x555859(0x1df)+_0x16644e),{'name':_0x16644e,'path':join(_0xf6e013,_0x16644e)};}throw new Error('Multiple\x20CI\x20profiles\x20found:\x20'+_0x4e8181[_0x555859(0x1d6)](',\x20')+'.\x20Use\x20--profile\x20to\x20specify\x20which\x20one.');}async function installPluginNonInteractive(){const _0x2374e1=_0x2ec7,_0x2a68ce={'ukAkB':_0x2374e1(0x1f2),'MFLGK':'Installing\x20Claude\x20Code\x20plugin\x20(project\x20level)...','oWopU':function(_0x118c73,_0xdc6099){return _0x118c73(_0xdc6099);},'wWZWZ':_0x2374e1(0x1cc),'WpcLb':'✓\x20Marketplace\x20already\x20added','NbcBX':_0x2374e1(0x1ea),'uPIen':_0x2374e1(0x1e6),'JWOgs':'You\x20can\x20install\x20manually:\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','vzbOj':function(_0x502bf2,_0x2448ff){return _0x502bf2(_0x2448ff);},'GDxRF':'plugin','vZlQw':_0x2374e1(0x1c2),'vPMEB':'project','RdsRO':_0x2374e1(0x1c5),'EhvzM':_0x2374e1(0x1d2)},_0x329576=await isPluginInstalled('ranger@trailhead');if(_0x329576)return console['log'](_0x2a68ce['ukAkB']),![];console['log'](_0x2a68ce['MFLGK']);const _0x38c02c=await _0x2a68ce['oWopU'](isMarketplaceAdded,_0x2a68ce[_0x2374e1(0x1dc)]);let _0x38260c=_0x38c02c;if(_0x38c02c)console[_0x2374e1(0x1cf)](_0x2a68ce['WpcLb']);else{const _0x1eeeef=await _0x2a68ce['oWopU'](runClaudeCommand,['plugin',_0x2a68ce[_0x2374e1(0x1ce)],'add',_0x2374e1(0x1ca)]);!_0x1eeeef['success']?(console[_0x2374e1(0x1d9)](_0x2a68ce['uPIen'],_0x1eeeef['error']),console[_0x2374e1(0x1cf)](_0x2a68ce['JWOgs'])):_0x38260c=!![];}if(_0x38260c){const _0x5c4eb1=await _0x2a68ce[_0x2374e1(0x1c3)](runClaudeCommand,[_0x2a68ce['GDxRF'],_0x2a68ce['vZlQw'],'ranger@trailhead','--scope',_0x2a68ce['vPMEB']]);!_0x5c4eb1['success']?(console[_0x2374e1(0x1d9)](_0x2a68ce['RdsRO'],_0x5c4eb1['error']),console[_0x2374e1(0x1cf)]('You\x20can\x20install\x20manually:\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20project')):console[_0x2374e1(0x1cf)](_0x2a68ce['EhvzM']);}return!![];}export async function setupCi(_0x4ae007,_0xc8cf2c,_0x2647d7){const _0xb45853=_0x2ec7,_0x4510ab={'beJAc':'auth','ELBHK':_0xb45853(0x1e8),'oCGCg':function(_0x4fde48){return _0x4fde48();},'myJlf':function(_0x256344,_0x2fa7fa,_0x4ba565){return _0x256344(_0x2fa7fa,_0x4ba565);},'nRUiz':function(_0x34b5f1,_0x8feb84,_0x45e951){return _0x34b5f1(_0x8feb84,_0x45e951);},'ISnFW':_0xb45853(0x1d7),'kUKEo':function(_0x2efc2f,_0x2968b2,_0x5b9f4e){return _0x2efc2f(_0x2968b2,_0x5b9f4e);},'ktWuP':function(_0xf3c1f1,_0x5829ab){return _0xf3c1f1(_0x5829ab);},'crPAr':_0xb45853(0x1db),'veyiv':'✓\x20Auth\x20state\x20found','iOMOB':_0xb45853(0x1d4),'WQABl':'skills','NBrXQ':function(_0x3729cf,_0x98f913){return _0x3729cf(_0x98f913);}};console[_0xb45853(0x1cf)](_0xb45853(0x1f3)),_0x2647d7?.['trackPhaseStart']('auth'),await authenticate(_0x4ae007),_0x2647d7?.[_0xb45853(0x1e7)](_0x4510ab[_0xb45853(0x1c4)]),_0x2647d7?.['trackPhaseStart'](_0x4510ab[_0xb45853(0x1d8)]);const {path:_0x197c7d,installed:_0x3031e9}=await _0x4510ab[_0xb45853(0x1cb)](ensureRangerDir);await writeRangerGitignore(_0x197c7d);const _0x4f1c57=_0x4510ab['myJlf'](join,_0x197c7d,_0xb45853(0x1dd));!existsSync(_0x4f1c57)&&await _0x4510ab['nRUiz'](mkdir,_0x4f1c57,{'recursive':!![]});_0x2647d7?.['trackPhaseEnd'](_0x4510ab['ELBHK'],{'installed':_0x3031e9}),_0x2647d7?.['trackPhaseStart']('chromium');let _0x16622e=![];_0xc8cf2c?.['skipChromium']?console[_0xb45853(0x1cf)](_0x4510ab['ISnFW']):_0x16622e=await ensureChromium();_0x2647d7?.['trackPhaseEnd']('chromium',{'installed':_0x16622e,'skipped':!!_0xc8cf2c?.['skipChromium']}),_0x2647d7?.['trackPhaseStart']('profile_activate');const _0x2eeb1a=await findCiProfile(_0xc8cf2c?.[_0xb45853(0x1c1)]);let _0xc3e8ec=![];_0xc8cf2c?.['baseUrl']&&(await _0x4510ab['nRUiz'](mkdir,_0x2eeb1a['path'],{'recursive':!![]}),await _0x4510ab[_0xb45853(0x1eb)](saveSettings,_0x2eeb1a['name'],{'baseUrl':_0xc8cf2c[_0xb45853(0x1c8)],'headless':!![]}),console[_0xb45853(0x1cf)]('✓\x20Created\x20profile\x20settings:\x20baseUrl='+_0xc8cf2c['baseUrl']),_0xc3e8ec=!![]);const _0x37ce32=join(_0x2eeb1a[_0xb45853(0x1ec)],'settings.json');if(!_0x4510ab[_0xb45853(0x1f5)](existsSync,_0x37ce32)&&!_0xc3e8ec)throw new Error(_0xb45853(0x1d5)+_0x2eeb1a[_0xb45853(0x1de)]+'\x22\x20has\x20no\x20settings.json.\x20Use\x20--base-url\x20to\x20configure\x20it.');const _0x3f811f=_0x4510ab[_0xb45853(0x1ed)](join,_0x2eeb1a[_0xb45853(0x1ec)],'auth.json'),_0x47b326=join(_0x2eeb1a['path'],_0x4510ab[_0xb45853(0x1f4)]),_0x562935=_0x4510ab['ktWuP'](existsSync,_0x3f811f),_0x2d5c04=existsSync(_0x47b326);if(_0x2d5c04)try{const _0x4f09e2=await getToken();if(!_0x4f09e2)throw new Error(_0xb45853(0x1ef));const _0x403cf1=await readFile(_0x47b326);_0x4510ab[_0xb45853(0x1eb)](decrypt,_0x403cf1,_0x4f09e2),console[_0xb45853(0x1cf)]('✓\x20Encrypted\x20auth\x20verified\x20(will\x20decrypt\x20at\x20runtime)');}catch(_0x583154){const _0x10b731=_0x583154 instanceof Error?_0x583154['message']:String(_0x583154);throw new Error('Failed\x20to\x20verify\x20encrypted\x20auth\x20for\x20profile\x20\x22'+_0x2eeb1a['name']+'\x22:\x20'+_0x10b731);}else _0x562935?console['log'](_0x4510ab['veyiv']):console[_0xb45853(0x1cf)]('\x20\x20No\x20auth\x20state\x20found\x20(app\x20may\x20not\x20require\x20authentication)');await writeActiveProfileName(_0x2eeb1a['name']),console[_0xb45853(0x1cf)](_0xb45853(0x1bf)+_0x2eeb1a['name']),_0x2647d7?.['trackPhaseEnd'](_0xb45853(0x1c7),{'profileName':_0x2eeb1a[_0xb45853(0x1de)],'hasAuth':_0x562935,'hasEncryptedAuth':_0x2d5c04,'createdSettings':_0xc3e8ec}),_0x2647d7?.[_0xb45853(0x1c6)](_0x4510ab['iOMOB']);const _0x5cacde=await installPluginNonInteractive();_0x2647d7?.[_0xb45853(0x1e7)](_0xb45853(0x1d4),{'installed':_0x5cacde}),_0x2647d7?.['trackPhaseStart'](_0x4510ab[_0xb45853(0x1e2)]),await _0x4510ab[_0xb45853(0x1d0)](skillup,{'autoInstall':_0xb45853(0x1d1)}),_0x2647d7?.[_0xb45853(0x1e7)](_0x4510ab['WQABl']),console[_0xb45853(0x1cf)]('\x0a✅\x20Ranger\x20CI\x20setup\x20complete!\x0a');}function _0x54b6(){const _0x4946b5=['project','✓\x20Claude\x20Code\x20plugin\x20installed','length','plugin','CI\x20profile\x20\x22','join','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','ELBHK','error','44622ShrkzB','auth.json.enc','wWZWZ','sessions','name','Auto-detected\x20CI\x20profile:\x20','Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.','otbBD','WQABl','No\x20CI\x20profiles\x20found\x20in\x20.ranger/ci/.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','1040WtjpQD','332520LuDmcx','Failed\x20to\x20add\x20marketplace:','trackPhaseEnd','dir_setup','vSiFp','marketplace','kUKEo','path','nRUiz','386570nfLfzC','No\x20API\x20token\x20available\x20for\x20decryption','4362ANXcil','31973ifIltO','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','\x0a🔧\x20Ranger\x20CI\x20Setup\x0a','crPAr','ktWuP','4286agIPJj','✓\x20Active\x20profile:\x20','504tlZTCj','profile','install','vzbOj','beJAc','Failed\x20to\x20install\x20plugin:','trackPhaseStart','profile_activate','baseUrl','1671616YtlTzj','ranger-testing/trailhead','oCGCg','trailhead','459IejZta','NbcBX','log','NBrXQ'];_0x54b6=function(){return _0x4946b5;};return _0x54b6();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x73add0,_0x503431){const _0x2fe8c0=_0x4777,_0x181d22=_0x73add0();while(!![]){try{const _0x4f4c99=-parseInt(_0x2fe8c0(0x11c))/0x1*(-parseInt(_0x2fe8c0(0x117))/0x2)+parseInt(_0x2fe8c0(0x113))/0x3+parseInt(_0x2fe8c0(0x114))/0x4+parseInt(_0x2fe8c0(0x10f))/0x5*(parseInt(_0x2fe8c0(0x10a))/0x6)+parseInt(_0x2fe8c0(0x118))/0x7*(parseInt(_0x2fe8c0(0x109))/0x8)+-parseInt(_0x2fe8c0(0xff))/0x9*(parseInt(_0x2fe8c0(0x107))/0xa)+-parseInt(_0x2fe8c0(0x119))/0xb*(parseInt(_0x2fe8c0(0x111))/0xc);if(_0x4f4c99===_0x503431)break;else _0x181d22['push'](_0x181d22['shift']());}catch(_0x275c4c){_0x181d22['push'](_0x181d22['shift']());}}}(_0x4a82,0xcbc1a));import{basename}from'path';import _0x5bd0ca from'inquirer';import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';function _0x4777(_0x173e32,_0x2b3747){_0x173e32=_0x173e32-0xf5;const _0x4a8265=_0x4a82();let _0x4777bb=_0x4a8265[_0x173e32];return _0x4777bb;}function _0x4a82(){const _0x42d7c3=['platform','suppressUsage','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','zfWDw','144TVUoRO','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','AmIqi','\x0a📦\x20Installing\x20skills...\x0a','project','To\x20get\x20started:','\x20--opencode','\x20successfully!\x0a','293470iduxuv','stdout','67720hYtGUz','37584WMywMj','\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a','All\x20projects\x20(','tOqgC','stdin','70Ynhllh','\x20\x202.\x20Run:\x20ranger\x20setup','8220876cfQDcn','rKAmf','698433FyjoUI','2913132vLGQER','xKHPt','/skills/','7472ZyyWZR','651MZTniu','11HCigrU','opencode','lBTce','41QYtKtc','OJRoD','gszCX','autoInstall','log','claude','isTTY','This\x20project\x20only\x20('];_0x4a82=function(){return _0x42d7c3;};return _0x4a82();}import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x474051={}){const _0x202116=_0x4777,_0x26e48d={'Jnjfl':_0x202116(0xf8),'ZvfzK':function(_0x4ebe7d){return _0x4ebe7d();},'OJRoD':_0x202116(0x100),'gszCX':_0x202116(0xfd),'fZNfJ':function(_0x518cf2,_0x5d73d9){return _0x518cf2===_0x5d73d9;},'AmIqi':function(_0x3b0b0e,_0x152dfa){return _0x3b0b0e===_0x152dfa;},'xKHPt':'✓\x20Found\x20API\x20token','tOqgC':_0x202116(0x11a),'iKGxb':'user','rKAmf':function(_0x54a1c2){return _0x54a1c2();},'BQDpF':'installLevel','FdlOD':'Where\x20should\x20skills\x20be\x20installed?','cTXeM':'project','jeqiY':function(_0x535e91,_0x131506,_0x5b0be1){return _0x535e91(_0x131506,_0x5b0be1);},'XkQkn':'ranger','FDYcD':'\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','yVxNk':function(_0x927fa7,_0x989594){return _0x927fa7 instanceof _0x989594;},'RHJCP':'user-level','lBTce':'project-level','Mojgu':function(_0x5ce39a,_0x2da1b5){return _0x5ce39a>_0x2da1b5;},'zfWDw':'To\x20use:'};console['log']('\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a');const _0x3cef9e=_0x474051[_0x202116(0xfb)]??_0x26e48d['Jnjfl'],_0x11d3fa=await _0x26e48d['ZvfzK'](getToken);if(!_0x11d3fa){console[_0x202116(0xf7)](_0x26e48d[_0x202116(0x11d)]),console[_0x202116(0xf7)](_0x202116(0x104)),console[_0x202116(0xf7)](_0x26e48d[_0x202116(0xf5)]),console['log'](_0x202116(0x110)+(_0x26e48d['fZNfJ'](_0x3cef9e,_0x202116(0x11a))?_0x202116(0x105):'')+'\x20<your-api-token>'),console['log']('\x20\x203.\x20Run:\x20ranger\x20skillup'+(_0x26e48d[_0x202116(0x101)](_0x3cef9e,'opencode')?'\x20--opencode':'')+'\x0a');return;}console['log'](_0x26e48d[_0x202116(0x115)]);const _0x1eb634=getProjectRoot(),_0x33b74e=basename(_0x1eb634),_0x65fcdb=_0x3cef9e===_0x26e48d['tOqgC']?getOpencodeConfigDir(_0x26e48d['iKGxb'])+_0x202116(0x116):_0x26e48d[_0x202116(0x112)](getClaudeConfigDir)+_0x202116(0x116),_0x4b26d5=_0x3cef9e==='opencode'?_0x1eb634+'/.opencode/skills/':_0x1eb634+'/.claude/skills/',_0x5943d9=process[_0x202116(0x10e)][_0x202116(0xf9)]&&process[_0x202116(0x108)][_0x202116(0xf9)];let _0x4cdedf;if(_0x474051[_0x202116(0xf6)])_0x4cdedf=_0x474051[_0x202116(0xf6)];else{if(_0x5943d9){const _0x28839e=await _0x5bd0ca['prompt']([{'type':'list','name':_0x26e48d['BQDpF'],'message':_0x26e48d['FdlOD'],'choices':[{'name':_0x202116(0x10c)+_0x65fcdb+')','value':'user'},{'name':_0x202116(0xfa)+_0x4b26d5+')','value':_0x202116(0x103)}]}]);_0x4cdedf=_0x28839e['installLevel'];}else _0x4cdedf=_0x26e48d['cTXeM'],console[_0x202116(0xf7)]('Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20('+_0x4b26d5+')');}let _0xc2336b=0x0;const _0x593d83=getCurrentVersion();console['log'](_0x202116(0x102));try{const _0xe37a02=await _0x26e48d['jeqiY'](installSkill,_0x26e48d['XkQkn'],{'cliVersion':_0x593d83,'level':_0x4cdedf,'platform':_0x3cef9e});_0xe37a02&&_0xc2336b++;}catch(_0x40230d){console['warn'](_0x26e48d['FDYcD'],_0x26e48d['yVxNk'](_0x40230d,Error)?_0x40230d['message']:_0x40230d);}if(_0xc2336b>0x0){const _0x14b262=_0x4cdedf==='user'?_0x26e48d['RHJCP']:_0x26e48d[_0x202116(0x11b)];console[_0x202116(0xf7)]('\x0a✅\x20Installed\x20'+_0xc2336b+'\x20'+_0x14b262+'\x20skill'+(_0x26e48d['Mojgu'](_0xc2336b,0x1)?'s':'')+_0x202116(0x106)),!_0x474051[_0x202116(0xfc)]&&(console['log'](_0x26e48d[_0x202116(0xfe)]),_0x26e48d['fZNfJ'](_0x3cef9e,_0x26e48d[_0x202116(0x10d)])?console[_0x202116(0xf7)]('\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.'):console[_0x202116(0xf7)]('\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!'));}else console[_0x202116(0xf7)](_0x202116(0x10b));}
|
package/build/commands/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x376451=_0x5959;(function(_0x508644,_0x1d44c1){const _0x354d63=_0x5959,_0x2aeb9d=_0x508644();while(!![]){try{const _0x51a15c=-parseInt(_0x354d63(0x124))/0x1*(parseInt(_0x354d63(0xee))/0x2)+parseInt(_0x354d63(0x10f))/0x3+parseInt(_0x354d63(0x120))/0x4*(-parseInt(_0x354d63(0x11b))/0x5)+-parseInt(_0x354d63(0x107))/0x6*(-parseInt(_0x354d63(0x113))/0x7)+parseInt(_0x354d63(0xe1))/0x8+-parseInt(_0x354d63(0xde))/0x9+parseInt(_0x354d63(0x126))/0xa;if(_0x51a15c===_0x1d44c1)break;else _0x2aeb9d['push'](_0x2aeb9d['shift']());}catch(_0x1a40f0){_0x2aeb9d['push'](_0x2aeb9d['shift']());}}}(_0x4d9d,0x49298));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x562615 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';function _0x5959(_0xb68d1b,_0x1dee61){_0xb68d1b=_0xb68d1b-0xc2;const _0x4d9d41=_0x4d9d();let _0x595951=_0x4d9d41[_0xb68d1b];return _0x595951;}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=_0x376451(0x11d);const bold=_0x492bcb=>'\x1b[1m'+_0x492bcb+'\x1b[0m';export function getPlaywrightVersion(){const _0x521ca1=_0x376451;try{const _0x27e30b=require['resolve'](_0x521ca1(0x11c)),_0x1b01a0=require(_0x27e30b);return _0x1b01a0[_0x521ca1(0xfc)];}catch{return null;}}export function installChromiumBinary(_0x47718c,_0xfb1afa=![]){const _0x1527b2=_0x376451,_0x1de8ad={'wikjw':function(_0x33eedf,_0x1c189d){return _0x33eedf===_0x1c189d;},'Vrcch':function(_0x3e9e69,_0x493286){return _0x3e9e69(_0x493286);},'OKRZm':function(_0x5b996f,_0x5b6706){return _0x5b996f(_0x5b6706);},'sJsLm':'chromium','eUZDp':_0x1527b2(0x10b),'VEcQq':_0x1527b2(0x123),'vgLOx':'error'};return new Promise((_0x6fd274,_0x48c636)=>{const _0x42235c=_0x1527b2,_0xa38ea4={'CXFOP':function(_0x2f5aeb,_0x11d1be){const _0xfa4af6=_0x5959;return _0x1de8ad[_0xfa4af6(0xea)](_0x2f5aeb,_0x11d1be);}},_0x406f5c=['playwright@'+_0x47718c,_0x42235c(0xd0),..._0xfb1afa?[_0x42235c(0x12f)]:[],_0x1de8ad[_0x42235c(0xcd)]],_0xc1ce0e=spawn('npx',_0x406f5c,{'stdio':[_0x42235c(0xcb),_0x1de8ad[_0x42235c(0xeb)],_0x1de8ad[_0x42235c(0xeb)]],'shell':process['platform']===_0x1de8ad['VEcQq']});_0xc1ce0e['on']('close',_0x449b6b=>{const _0x5817a6=_0x42235c;_0x1de8ad['wikjw'](_0x449b6b,0x0)?_0x6fd274():_0x1de8ad['Vrcch'](_0x48c636,new Error(_0x5817a6(0x10a)+_0x449b6b));}),_0xc1ce0e['on'](_0x1de8ad[_0x42235c(0x114)],_0x4eb00d=>{_0xa38ea4['CXFOP'](_0x48c636,_0x4eb00d);});});}export async function authenticate(_0x261538){const _0x2a888f=_0x376451,_0x58d398={'DifcJ':function(_0x17b202){return _0x17b202();},'aZLZR':function(_0x2ea260,_0x56d669){return _0x2ea260 instanceof _0x56d669;},'GrqBk':function(_0x306d8f,_0x1c2a93){return _0x306d8f(_0x1c2a93);},'mrtXc':'device_auth','EDetJ':_0x2a888f(0xd7)};if(!_0x261538){const _0x32f1fc=await _0x58d398['DifcJ'](getToken);if(_0x32f1fc){const _0x4cf557=await getCurrentUser(_0x32f1fc);if(_0x4cf557[_0x2a888f(0xed)])return console[_0x2a888f(0xd6)]('✓\x20Already\x20authenticated\x20to\x20'+_0x4cf557['user'][_0x2a888f(0xdd)]),{'token':_0x32f1fc,'method':_0x2a888f(0xe2)};}try{_0x261538=await runDeviceAuthFlow();}catch(_0x47f79a){throw new Error('Authentication\x20failed:\x20'+(_0x58d398[_0x2a888f(0xcf)](_0x47f79a,Error)?_0x47f79a['message']:_0x47f79a));}const _0xcc1aef=await _0x58d398[_0x2a888f(0xd8)](getCurrentUser,_0x261538);if(!_0xcc1aef[_0x2a888f(0xed)])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0xcc1aef[_0x2a888f(0xc6)]);return console['log'](_0x2a888f(0x100)+_0xcc1aef[_0x2a888f(0x115)]['organizationName']),{'token':_0x261538,'method':_0x58d398[_0x2a888f(0x106)]};}console['log']('Validating\x20API\x20token...');const _0x1a4998=await getCurrentUser(_0x261538);if(!_0x1a4998['success']){if(_0x1a4998[_0x2a888f(0xdf)])throw new Error(_0x2a888f(0xc4)+_0x1a4998[_0x2a888f(0xc6)]+_0x2a888f(0x117));else throw new Error(_0x2a888f(0x102)+_0x1a4998[_0x2a888f(0xc6)]+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console['log']('✓\x20Authenticated\x20to\x20'+_0x1a4998[_0x2a888f(0x115)][_0x2a888f(0xdd)]),await _0x58d398[_0x2a888f(0xd8)](storeToken,_0x261538),console['log'](process['env']['GITHUB_ENV']?'✓\x20Exported\x20credentials\x20for\x20CI':'✓\x20Stored\x20credentials\x20locally'),{'token':_0x261538,'method':_0x58d398['EDetJ']};}export async function ensureRangerDir(_0x12c5aa){const _0x37a40d=_0x376451,_0x3d1abb={'SBfRY':function(_0xbd0755){return _0xbd0755();},'qtygQ':_0x37a40d(0xc9),'bvaPx':'✓\x20~/.ranger/\x20directory\x20already\x20exists'};void _0x12c5aa;const _0x5176ea=_0x3d1abb['SBfRY'](getRangerHomeDir);return!existsSync(_0x5176ea)?(await mkdir(_0x5176ea,{'recursive':!![]}),console['log'](_0x3d1abb['qtygQ']),{'path':_0x5176ea,'installed':!![]}):(console[_0x37a40d(0xd6)](_0x3d1abb['bvaPx']),{'path':_0x5176ea,'installed':![]});}export async function ensureChromium(_0x16550d=![]){const _0x350565=_0x376451,_0x179634={'IfeMq':'✓\x20Playwright\x20Chromium\x20browser\x20found','wKCMW':function(_0x3184f5,_0x65b990){return _0x3184f5??_0x65b990;},'rlean':_0x350565(0x101),'KERgL':_0x350565(0xf2),'SrPlu':_0x350565(0xd9),'jynnt':function(_0x13539d,_0x56e512){return _0x13539d instanceof _0x56e512;},'bEVhm':_0x350565(0xce)};let _0x2e4429=![];try{const _0x3b883d=chromium[_0x350565(0xc2)]();_0x2e4429=existsSync(_0x3b883d);}catch{_0x2e4429=![];}if(_0x2e4429)return console['log'](_0x179634['IfeMq']),![];const _0x164dfb=getPlaywrightVersion(),_0x4cacef=_0x179634[_0x350565(0xef)](_0x164dfb,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x499dda=!_0x164dfb,_0x57606e=process[_0x350565(0x116)]['isTTY']&&process['stdout'][_0x350565(0xd1)];let _0x1a999f=!![];if(_0x57606e){const {install:_0x4c45c0}=await _0x562615[_0x350565(0x109)]([{'type':_0x179634['rlean'],'name':_0x350565(0xd0),'message':_0x499dda?_0x350565(0x105)+_0x4cacef+'\x20now?':'The\x20required\x20version\x20('+_0x4cacef+_0x350565(0xf3),'default':!![]}]);_0x1a999f=_0x4c45c0;}else console[_0x350565(0xd6)](_0x350565(0xc7)+_0x4cacef+(_0x499dda?_0x179634['KERgL']:'')+'...');if(_0x1a999f){console['log'](_0x179634['SrPlu']);try{await installChromiumBinary(_0x4cacef,_0x16550d),console[_0x350565(0xd6)]('\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully');}catch(_0x131ed0){console['error'](_0x350565(0x128),_0x179634[_0x350565(0x10d)](_0x131ed0,Error)?_0x131ed0['message']:_0x131ed0),console[_0x350565(0xd6)](_0x350565(0xd4)),console['log'](_0x350565(0xf9)+_0x4cacef+'\x20install\x20chromium');}}else console['log'](_0x179634[_0x350565(0xfe)]),console[_0x350565(0xd6)]('You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'),console[_0x350565(0xd6)](_0x350565(0xf9)+_0x4cacef+_0x350565(0x11e));return!![];}export async function writeRangerGitignore(_0x54a572){const _0x481cd5=_0x376451,_0x34b8ec={'vCWnl':'.gitignore','FgWef':_0x481cd5(0x11f)},_0x38dea4=join(_0x54a572,_0x34b8ec['vCWnl']),_0x29803f=_0x481cd5(0x12e);await writeFile(_0x38dea4,_0x29803f),console['log'](_0x34b8ec['FgWef']);}export async function ensureLocalEnv(_0x4c0cb2,_0x3c1c47){const _0xeff326=_0x376451,_0x37d62f={'MqmpU':function(_0xd0f5f){return _0xd0f5f();},'tgcMC':function(_0x5d982d,_0x2d1b26){return _0x5d982d===_0x2d1b26;},'sANtW':_0xeff326(0x12a),'RpySR':function(_0x27bc70,_0x291307){return _0x27bc70 instanceof _0x291307;}};if(!_0x37d62f[_0xeff326(0xf8)](findGitRoot)&&_0x4c0cb2?.['scope']!=='user')return console[_0xeff326(0xd6)](_0xeff326(0x127)),{'ready':![],'skipped':!![]};const _0xf99dc8=_0x37d62f[_0xeff326(0xe9)](_0x4c0cb2?.[_0xeff326(0xe5)],_0xeff326(0x115))?getRangerHomeDir():undefined;if(findExistingEnv('local',{'locations':[_0x37d62f['sANtW']],'rangerDir':_0xf99dc8}))return console[_0xeff326(0xd6)](_0xeff326(0xca)),{'ready':!![],'skipped':![]};try{return await addEnv('local',{'url':_0x4c0cb2?.[_0xeff326(0x111)],'force':_0x4c0cb2?.[_0xeff326(0xcc)],'allowInsecureLocalhost':_0x4c0cb2?.[_0xeff326(0xff)],'scope':_0x4c0cb2?.[_0xeff326(0xe5)]},_0x3c1c47),{'ready':!![],'skipped':![]};}catch(_0x124a33){return console[_0xeff326(0xc6)]('\x0a❌\x20Profile\x20setup\x20failed:',_0x37d62f[_0xeff326(0x12c)](_0x124a33,Error)?_0x124a33[_0xeff326(0x10e)]:_0x124a33),{'ready':![],'skipped':![]};}}export async function start(_0x530598,_0x49be40,_0x511cde){const _0x2e92ab=_0x376451,_0x210592={'mduFm':function(_0x12243f,_0x2b3a6b){return _0x12243f+_0x2b3a6b;},'fDYSp':function(_0xe22eef,_0x56545d){return _0xe22eef(_0x56545d);},'MnjQN':'user','SGQtB':function(_0x5b12b9){return _0x5b12b9();},'iBfmE':'auth','diMVx':'chromium','LZFJw':_0x2e92ab(0xd3),'fwNgJ':function(_0x200c85,_0x2d798f){return _0x200c85(_0x2d798f);},'bVflU':_0x2e92ab(0xfa),'MkJHz':function(_0x32f77b,_0x308039){return _0x32f77b&&_0x308039;},'eOdqh':'skills','dCzqh':function(_0x122567,_0x58b5d3,_0x4b8674){return _0x122567(_0x58b5d3,_0x4b8674);},'cgZAH':_0x2e92ab(0x119),'KFBfC':'\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','ijyEV':function(_0xd18531,_0x4ad1a9){return _0xd18531+_0x4ad1a9;},'ksZpp':_0x2e92ab(0x104),'CCuCb':_0x2e92ab(0xe3)};console[_0x2e92ab(0xd6)](_0x2e92ab(0xdc));_0x49be40?.[_0x2e92ab(0xe5)]!==undefined&&_0x49be40['scope']!=='user'&&(console['error'](_0x210592[_0x2e92ab(0xe7)](_0x2e92ab(0xf4)+_0x210592['fDYSp'](String,_0x49be40[_0x2e92ab(0xe5)])+'\x20is\x20no\x20longer\x20supported.\x20',_0x2e92ab(0xc5))+'project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.'),process[_0x2e92ab(0xd5)](0x1));_0x49be40={..._0x49be40,'scope':_0x210592['MnjQN']};const _0x36a34c=!_0x210592[_0x2e92ab(0x118)](existsSync,_0x210592['SGQtB'](getRangerHomeDir));await _0x210592[_0x2e92ab(0x118)](ensureRangerDir,_0x210592['MnjQN']);if(_0x49be40?.[_0x2e92ab(0xda)])console['log'](_0x2e92ab(0x12d)),_0x511cde?.[_0x2e92ab(0xfd)](_0x210592[_0x2e92ab(0x122)],{'isFirstRun':_0x36a34c,'method':'skipped'});else{_0x511cde?.[_0x2e92ab(0x11a)](_0x210592['iBfmE']);const _0x52702e=await authenticate(_0x530598);_0x511cde?.['trackPhaseEnd']('auth',{'isFirstRun':_0x36a34c,'method':_0x52702e['method']});}_0x511cde?.[_0x2e92ab(0x11a)](_0x210592[_0x2e92ab(0xdb)]);_0x49be40?.[_0x2e92ab(0xec)]?console['log'](_0x210592['LZFJw']):await ensureChromium(_0x49be40?.['withDeps']);_0x511cde?.[_0x2e92ab(0xfd)](_0x210592['diMVx'],{'isFirstRun':_0x36a34c,'skipped':!!_0x49be40?.['skipChromium']}),console[_0x2e92ab(0xd6)]('\x0a✅\x20Ranger\x20setup\x20complete!\x0a');const _0x3aebcf=_0x49be40?.[_0x2e92ab(0xe5)],_0x4f8045=_0x49be40?.[_0x2e92ab(0x119)]??![];let _0x29538d=null;_0x4f8045?(_0x511cde?.[_0x2e92ab(0x11a)](_0x2e92ab(0xfa)),_0x29538d=await _0x210592[_0x2e92ab(0xf1)](ensureOpencodePluginConfig,_0x3aebcf),_0x511cde?.['trackPhaseEnd'](_0x2e92ab(0xfa),{'isFirstRun':_0x36a34c,'opencode':!![]})):(_0x511cde?.['trackPhaseStart']('plugin'),await ensureClaudePlugin(_0x3aebcf),_0x511cde?.[_0x2e92ab(0xfd)](_0x210592['bVflU'],{'isFirstRun':_0x36a34c}));if(_0x210592['MkJHz'](_0x4f8045,_0x29538d)){_0x511cde?.['trackPhaseStart'](_0x210592[_0x2e92ab(0x125)]);try{await _0x210592[_0x2e92ab(0xd2)](installSkill,_0x2e92ab(0x10c),{'level':_0x29538d['scope'],'cliVersion':_0x210592[_0x2e92ab(0xe0)](getCurrentVersion),'platform':_0x210592['cgZAH']}),_0x511cde?.[_0x2e92ab(0xfd)](_0x210592[_0x2e92ab(0x125)],{'isFirstRun':_0x36a34c,'opencode':!![]});}catch(_0xcebd61){console['warn'](_0x210592[_0x2e92ab(0xe6)],_0xcebd61 instanceof Error?_0xcebd61['message']:_0xcebd61),_0x511cde?.[_0x2e92ab(0xfd)](_0x210592['eOdqh'],{'isFirstRun':_0x36a34c,'opencode':!![],'failed':!![]});}}else _0x511cde?.[_0x2e92ab(0x11a)]('skills'),await ensureClaudeSkills(_0x3aebcf),_0x511cde?.[_0x2e92ab(0xfd)]('skills',{'isFirstRun':_0x36a34c});if(_0x49be40?.[_0x2e92ab(0xda)])console['log'](_0x2e92ab(0xe4));else{if(_0x49be40?.[_0x2e92ab(0x111)]){_0x511cde?.['trackPhaseStart'](_0x2e92ab(0xc8));const _0x23cb4e=await ensureLocalEnv({'url':_0x49be40['url'],'force':_0x49be40?.['force'],'allowInsecureLocalhost':_0x49be40?.[_0x2e92ab(0xff)],'scope':_0x210592['MnjQN']},_0x511cde);_0x511cde?.[_0x2e92ab(0xfd)]('profile',{'isFirstRun':_0x36a34c,'profileReady':_0x23cb4e[_0x2e92ab(0xf5)],'userSkipped':_0x23cb4e['skipped']});}else console['log'](_0x210592['mduFm'](_0x210592[_0x2e92ab(0x108)](_0x2e92ab(0x129),_0x2e92ab(0xf0)+bold('ranger\x20profile\x20add\x20<name>'))+_0x2e92ab(0x121),_0x2e92ab(0xe8))+_0x2e92ab(0x110));}if(_0x4f8045)console[_0x2e92ab(0xd6)](_0x2e92ab(0xc3)),console[_0x2e92ab(0xd6)](_0x2e92ab(0xf6)),console[_0x2e92ab(0xd6)]('with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'),console['log'](_0x210592[_0x2e92ab(0x103)]);else{const _0x5ec45a=_0x210592[_0x2e92ab(0x118)](bold,_0x210592[_0x2e92ab(0xf7)]);console['log'](_0x210592[_0x2e92ab(0x108)](_0x210592[_0x2e92ab(0x108)](_0x210592['mduFm']('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x5ec45a+_0x2e92ab(0xfb),_0x2e92ab(0x112)),'\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'),_0x2e92ab(0x12b)));}}function _0x4d9d(){const _0x11393f=['stdin','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','fDYSp','opencode','trackPhaseStart','383485HNZoXc','playwright/package.json','1.58.2','\x20install\x20chromium','✓\x20Created\x20.ranger/.gitignore','28NQEMZk','\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','iBfmE','win32','1434bmEiWY','eOdqh','2368340fpOzJC','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','local','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','RpySR','✓\x20Skipping\x20authentication\x20(--skip-auth)','\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','--with-deps','executablePath','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','Authentication\x20failed:\x20','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','error','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','profile','✓\x20Created\x20~/.ranger/\x20directory','✓\x20Local\x20profile\x20already\x20exists','ignore','force','sJsLm','\x0a⚠\x20Skipping\x20Chromium\x20installation.','aZLZR','install','isTTY','dCzqh','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','You\x20can\x20install\x20it\x20manually\x20by\x20running:','exit','log','provided_token','GrqBk','\x0aInstalling\x20Chromium\x20browser...\x0a','skipAuth','diMVx','\x0a🚀\x20Ranger\x20Setup\x0a','organizationName','1008243OzMccY','status','SGQtB','1580384nSSZOJ','existing_token','/ranger:enable','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','scope','KFBfC','mduFm','\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','tgcMC','OKRZm','eUZDp','skipChromium','success','46eOUWxB','wKCMW','\x0a\x20\x20','fwNgJ','\x20(fallback\x20version)',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','ranger\x20setup\x20--scope=','ready','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','CCuCb','MqmpU','\x20\x20npx\x20playwright@','plugin','\x20and\x20prompt\x20the\x20coding','version','trackPhaseEnd','bEVhm','allowInsecureLocalhost','✓\x20Authenticated\x20to\x20','confirm','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','ksZpp','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','mrtXc','186BbasvX','ijyEV','prompt','Installation\x20failed\x20with\x20exit\x20code\x20','inherit','ranger','jynnt','message','1175232plAkPv','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','url','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','35098bEberS','vgLOx','user'];_0x4d9d=function(){return _0x11393f;};return _0x4d9d();}
|
|
1
|
+
function _0x1032(_0x17c1b1,_0x53d606){_0x17c1b1=_0x17c1b1-0xf5;const _0x40aef1=_0x40ae();let _0x10320b=_0x40aef1[_0x17c1b1];return _0x10320b;}(function(_0x3eddac,_0x2b54cc){const _0x26b404=_0x1032,_0x26ff0c=_0x3eddac();while(!![]){try{const _0x118abc=parseInt(_0x26b404(0x162))/0x1+parseInt(_0x26b404(0x11e))/0x2*(-parseInt(_0x26b404(0x115))/0x3)+parseInt(_0x26b404(0x12e))/0x4*(-parseInt(_0x26b404(0xfa))/0x5)+parseInt(_0x26b404(0xf7))/0x6+-parseInt(_0x26b404(0x146))/0x7+-parseInt(_0x26b404(0x142))/0x8*(parseInt(_0x26b404(0xf9))/0x9)+parseInt(_0x26b404(0x165))/0xa*(parseInt(_0x26b404(0xfb))/0xb);if(_0x118abc===_0x2b54cc)break;else _0x26ff0c['push'](_0x26ff0c['shift']());}catch(_0x335f7e){_0x26ff0c['push'](_0x26ff0c['shift']());}}}(_0x40ae,0xa4328));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x4bf64e from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerDir,getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.58.2';const bold=_0x7e5154=>'\x1b[1m'+_0x7e5154+'\x1b[0m';export function getPlaywrightVersion(){const _0x584b00=_0x1032,_0x33800b={'OBnfO':function(_0xd4fad6,_0x14de89){return _0xd4fad6(_0x14de89);}};try{const _0x12cc1b=require[_0x584b00(0x13c)]('playwright/package.json'),_0x52c768=_0x33800b[_0x584b00(0x121)](require,_0x12cc1b);return _0x52c768[_0x584b00(0x119)];}catch{return null;}}export function installChromiumBinary(_0x590ba2,_0x4623c4=![]){const _0x39271c=_0x1032,_0x1290ee={'BdmHq':'install','AzwDC':function(_0x1fa879,_0x2a6a5f,_0x20e459,_0x40cce3){return _0x1fa879(_0x2a6a5f,_0x20e459,_0x40cce3);},'FSKAp':_0x39271c(0x15a),'tImvK':function(_0x743394,_0x24d25c){return _0x743394===_0x24d25c;},'iyvpR':'win32','MjMGx':_0x39271c(0x12c)};return new Promise((_0x1432a9,_0x379100)=>{const _0x4d7186=_0x39271c,_0x11718d=['playwright@'+_0x590ba2,_0x1290ee['BdmHq'],..._0x4623c4?['--with-deps']:[],'chromium'],_0x113d01=_0x1290ee[_0x4d7186(0x157)](spawn,_0x4d7186(0x15d),_0x11718d,{'stdio':[_0x1290ee[_0x4d7186(0x100)],_0x4d7186(0xfe),_0x4d7186(0xfe)],'shell':_0x1290ee['tImvK'](process['platform'],_0x1290ee[_0x4d7186(0xfd)])});_0x113d01['on'](_0x4d7186(0x12b),_0x3f9fd7=>{const _0x4e0e54=_0x4d7186;_0x3f9fd7===0x0?_0x1432a9():_0x379100(new Error(_0x4e0e54(0x10e)+_0x3f9fd7));}),_0x113d01['on'](_0x1290ee[_0x4d7186(0x145)],_0x28cd09=>{_0x379100(_0x28cd09);});});}export async function authenticate(_0x50acfb){const _0x257da4=_0x1032,_0x1b2acd={'RIKNl':function(_0x173109,_0x17b08e){return _0x173109 instanceof _0x17b08e;},'itZhH':function(_0x76e7a2,_0x4cf863){return _0x76e7a2(_0x4cf863);},'CjuOk':'Validating\x20API\x20token...','OWWWH':_0x257da4(0x139)};if(!_0x50acfb){const _0xcd58bc=await getToken();if(_0xcd58bc){const _0x2c774f=await getCurrentUser(_0xcd58bc);if(_0x2c774f[_0x257da4(0x102)])return console['log']('✓\x20Already\x20authenticated\x20to\x20'+_0x2c774f['user']['organizationName']),{'token':_0xcd58bc,'method':'existing_token'};}try{_0x50acfb=await runDeviceAuthFlow();}catch(_0x3d0121){throw new Error(_0x257da4(0x134)+(_0x1b2acd[_0x257da4(0x10d)](_0x3d0121,Error)?_0x3d0121['message']:_0x3d0121));}const _0x23666f=await _0x1b2acd['itZhH'](getCurrentUser,_0x50acfb);if(!_0x23666f['success'])throw new Error(_0x257da4(0x109)+_0x23666f['error']);return console['log'](_0x257da4(0x14e)+_0x23666f[_0x257da4(0x149)]['organizationName']),{'token':_0x50acfb,'method':'device_auth'};}console[_0x257da4(0x108)](_0x1b2acd[_0x257da4(0x14b)]);const _0x2d3d82=await getCurrentUser(_0x50acfb);if(!_0x2d3d82[_0x257da4(0x102)]){if(_0x2d3d82[_0x257da4(0x10b)])throw new Error(_0x257da4(0x134)+_0x2d3d82[_0x257da4(0x12c)]+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error(_0x257da4(0x138)+_0x2d3d82['error']+_0x257da4(0x111));}return console['log']('✓\x20Authenticated\x20to\x20'+_0x2d3d82['user']['organizationName']),await storeToken(_0x50acfb),console[_0x257da4(0x108)](process[_0x257da4(0x12a)]['GITHUB_ENV']?_0x1b2acd['OWWWH']:'✓\x20Stored\x20credentials\x20locally'),{'token':_0x50acfb,'method':'provided_token'};}export async function ensureRangerDir(_0x57fc73){const _0x1c67fa=_0x1032,_0x2b9d1d={'XJvRY':function(_0x42ef4f){return _0x42ef4f();},'jrDTf':function(_0x306c20,_0xdf61d5){return _0x306c20(_0xdf61d5);},'Saser':'✓\x20Created\x20.ranger/\x20directory'};let _0x1e8bfe;if(_0x57fc73==='user')_0x1e8bfe=getRangerHomeDir();else{const _0x257cf6=findGitRoot();_0x1e8bfe=_0x257cf6?join(_0x257cf6,_0x1c67fa(0x10c)):_0x2b9d1d[_0x1c67fa(0x137)](getRangerDir);}return!_0x2b9d1d[_0x1c67fa(0x14a)](existsSync,_0x1e8bfe)?(await mkdir(_0x1e8bfe,{'recursive':!![]}),console[_0x1c67fa(0x108)](_0x2b9d1d['Saser']),{'path':_0x1e8bfe,'installed':!![]}):(console['log']('✓\x20.ranger/\x20directory\x20already\x20exists'),{'path':_0x1e8bfe,'installed':![]});}function _0x40ae(){const _0x20ac62=['KgHwp','xcoCI','env','close','error','QQcqx','4EjvFuD','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','\x20(fallback\x20version)','tXLfS','skipped','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','Authentication\x20failed:\x20','...','method','XJvRY','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','✓\x20Exported\x20credentials\x20for\x20CI','scope','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','resolve','use\x20until\x20the\x20session\x20expires.\x0a','stdout','sLySX','confirm','prompt','104MxIMnH','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','chromium','MjMGx','7391818BMzUQv','/ranger:enable','LjQuc','user','jrDTf','CjuOk','ready','Make\x20sure\x20your\x20app\x20is\x20running\x20before\x20you\x20start.\x0a','✓\x20Authenticated\x20to\x20','url','\x0a✅\x20You\x27re\x20ready\x20to\x20start\x20using\x20Ranger\x20Feature\x20Review.','oNCVK','warn','install','trackPhaseStart','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','AzwDC','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','\x0aIn\x20Claude\x20Code,\x20run\x20','ignore','aMNFq','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','npx','wCuOx','pCkvu','No\x20git\x20repository\x20found','skills','844303VTJdHZ','\x0a⚠\x20Skipping\x20Chromium\x20installation.','allowInsecureLocalhost','1835270YzxhGJ','mUOsW','\x20\x20npx\x20playwright@','\x20now?','local','TWcXj','3522972mzNmiM','tRdki','161613KOKryJ','4982395ddXxoq','110PMqKrb','Non-interactive\x20mode:\x20Skipping\x20profile\x20setup.\x20To\x20set\x20up\x20a\x20profile,\x20pass\x20--url\x20or\x20run\x20later:','iyvpR','inherit','sKXQA','FSKAp','stdin','success','ranger\x20profile\x20add\x20local','gGZSJ','qTsvr','hnrbU','force','log','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','xAiag','status','.ranger','RIKNl','Installation\x20failed\x20with\x20exit\x20code\x20','trackPhaseEnd','opencode','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','HWBCh','mBkNU','profile','308289wQFnlz','QuNRD','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','No\x20git\x20repository\x20found.\x20Please\x20run\x20`ranger\x20setup`\x20from\x20inside\x20your\x20project\x20directory,\x0a','version','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','message','isTTY','6IgEeoz','uVKUC','⚠\x20No\x20git\x20repository\x20found.\x20Run\x20`ranger\x20profile\x20add\x20local`\x20from\x20your\x20project\x20directory.','OBnfO','git_check','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','\x0aInstalling\x20Chromium\x20browser...\x0a','auth','\x0aIn\x20order\x20for\x20Ranger\x20to\x20verify\x20your\x20work,\x20you\x27ll\x20need\x20to\x20set\x20up\x20a\x20profile\x20later\x20with:','skipChromium'];_0x40ae=function(){return _0x20ac62;};return _0x40ae();}export async function ensureChromium(_0x396aa3=![]){const _0xcb5e26=_0x1032,_0x44d9f0={'mIRNv':function(_0x4a3843){return _0x4a3843();},'mUOsW':function(_0x188333,_0x4982f0,_0xb82f01){return _0x188333(_0x4982f0,_0xb82f01);},'EadWu':'\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','bTUKe':_0xcb5e26(0x163),'xGYff':_0xcb5e26(0x12f)};let _0x28e664=![];try{const _0x655094=chromium['executablePath']();_0x28e664=existsSync(_0x655094);}catch{_0x28e664=![];}if(_0x28e664)return console['log']('✓\x20Playwright\x20Chromium\x20browser\x20found'),![];const _0x2d4c5d=_0x44d9f0['mIRNv'](getPlaywrightVersion),_0x243cf7=_0x2d4c5d??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x485906=!_0x2d4c5d,_0x4a7997=process['stdin'][_0xcb5e26(0x11d)]&&process['stdout'][_0xcb5e26(0x11d)];let _0x2be9f6=!![];if(_0x4a7997){const {install:_0x562b48}=await _0x4bf64e[_0xcb5e26(0x141)]([{'type':'confirm','name':_0xcb5e26(0x153),'message':_0x485906?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x243cf7+_0xcb5e26(0x168):'The\x20required\x20version\x20('+_0x243cf7+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x2be9f6=_0x562b48;}else console['log'](_0xcb5e26(0x133)+_0x243cf7+(_0x485906?_0xcb5e26(0x130):'')+_0xcb5e26(0x135));if(_0x2be9f6){console[_0xcb5e26(0x108)](_0xcb5e26(0x124));try{await _0x44d9f0[_0xcb5e26(0x166)](installChromiumBinary,_0x243cf7,_0x396aa3),console[_0xcb5e26(0x108)](_0x44d9f0['EadWu']);}catch(_0x3afcb8){console[_0xcb5e26(0x12c)]('\x0a❌\x20Failed\x20to\x20install\x20Chromium:',_0x3afcb8 instanceof Error?_0x3afcb8[_0xcb5e26(0x11c)]:_0x3afcb8),console['log']('You\x20can\x20install\x20it\x20manually\x20by\x20running:'),console['log']('\x20\x20npx\x20playwright@'+_0x243cf7+'\x20install\x20chromium');}}else console[_0xcb5e26(0x108)](_0x44d9f0['bTUKe']),console[_0xcb5e26(0x108)](_0x44d9f0['xGYff']),console[_0xcb5e26(0x108)](_0xcb5e26(0x167)+_0x243cf7+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x37fcaa){const _0x4c7ecf=_0x1032,_0x2ed73b={'FOfjB':function(_0x3b1e6d,_0x53e536,_0x4db160){return _0x3b1e6d(_0x53e536,_0x4db160);},'JLZuq':'.gitignore','LkYsY':'✓\x20Created\x20.ranger/.gitignore'},_0x8c17ee=_0x2ed73b['FOfjB'](join,_0x37fcaa,_0x2ed73b['JLZuq']),_0x513e55='\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(_0x8c17ee,_0x513e55),console[_0x4c7ecf(0x108)](_0x2ed73b['LkYsY']);}function printProfileSetupLaterInstructions(){const _0x32b9ee=_0x1032,_0x11d5e4={'gTiid':_0x32b9ee(0x126),'RIJic':function(_0x8d6248,_0x5317a2){return _0x8d6248(_0x5317a2);},'hrKPa':_0x32b9ee(0x103),'tRdki':_0x32b9ee(0x14d)};console[_0x32b9ee(0x108)](_0x11d5e4['gTiid']),console[_0x32b9ee(0x108)]('\x20\x20'+_0x11d5e4['RIJic'](bold,_0x11d5e4['hrKPa'])),console['log'](_0x11d5e4[_0x32b9ee(0xf8)]);}export async function ensureLocalEnv(_0x13177c,_0x45e9d3){const _0x2f94ed=_0x1032,_0x35ac12={'sKXQA':function(_0x4fe582){return _0x4fe582();},'QuNRD':_0x2f94ed(0x120),'CAIDH':function(_0x408790,_0x3a6e35){return _0x408790===_0x3a6e35;},'xAiag':function(_0x5ef3cc,_0x3a6788,_0x376735){return _0x5ef3cc(_0x3a6788,_0x376735);},'qyHzq':'local','PcesZ':'✓\x20Local\x20profile\x20already\x20exists','hAuRh':'to\x20access\x20your\x20app.\x20If\x20the\x20part\x20of\x20your\x20app\x20you\x20want\x20to\x20test\x20is\x20behind','cycEn':_0x2f94ed(0x13d),'cFDWf':_0x2f94ed(0x140),'gpsXP':'wantsProfile','PLtHD':'Would\x20you\x20like\x20to\x20set\x20up\x20the\x20profile\x20now?','qTsvr':function(_0x43125b,_0x3041e9,_0xa371a5,_0x371e64){return _0x43125b(_0x3041e9,_0xa371a5,_0x371e64);}};if(!_0x35ac12[_0x2f94ed(0xff)](findGitRoot))return console['log'](_0x35ac12[_0x2f94ed(0x116)]),{'ready':![],'skipped':!![]};const _0x9688e=_0x35ac12['CAIDH'](_0x13177c?.['scope'],'user')?getRangerHomeDir():undefined;if(_0x35ac12[_0x2f94ed(0x10a)](findExistingEnv,_0x2f94ed(0xf5),{'locations':[_0x35ac12['qyHzq']],'rangerDir':_0x9688e}))return console[_0x2f94ed(0x108)](_0x35ac12['PcesZ']),{'ready':!![],'skipped':![]};const _0x23964c=process[_0x2f94ed(0x101)][_0x2f94ed(0x11d)]&&process['stdout']['isTTY'];if(_0x23964c&&!_0x13177c?.[_0x2f94ed(0x14f)]){console[_0x2f94ed(0x108)]('\x0aA\x20profile\x20gives\x20Ranger\x27s\x20browser\x20agent\x20information\x20about\x20how'),console['log'](_0x35ac12['hAuRh']),console[_0x2f94ed(0x108)]('auth,\x20you\x20can\x20log\x20in\x20and\x20we\x27ll\x20save\x20the\x20session\x20state\x20for\x20Ranger\x20to'),console[_0x2f94ed(0x108)](_0x35ac12['cycEn']),console['log']('You\x27ll\x20need\x20the\x20app\x20to\x20be\x20running\x20to\x20set\x20up\x20the\x20profile.');const {wantsProfile:_0xa00b6}=await _0x4bf64e[_0x2f94ed(0x141)]([{'type':_0x35ac12['cFDWf'],'name':_0x35ac12['gpsXP'],'message':_0x35ac12['PLtHD'],'default':!![]}]);if(!_0xa00b6)return printProfileSetupLaterInstructions(),{'ready':![],'skipped':!![]};}try{return await _0x35ac12[_0x2f94ed(0x105)](addEnv,_0x35ac12['qyHzq'],{'url':_0x13177c?.[_0x2f94ed(0x14f)],'force':_0x13177c?.[_0x2f94ed(0x107)],'allowInsecureLocalhost':_0x13177c?.['allowInsecureLocalhost'],'scope':_0x13177c?.['scope']},_0x45e9d3),{'ready':!![],'skipped':![]};}catch(_0x15e3b3){return console[_0x2f94ed(0x12c)]('\x0a❌\x20Profile\x20setup\x20failed:',_0x15e3b3 instanceof Error?_0x15e3b3['message']:_0x15e3b3),_0x35ac12['sKXQA'](printProfileSetupLaterInstructions),{'ready':![],'skipped':![]};}}export async function start(_0x11e61f,_0x5d4b41,_0x4ebbbb){const _0x105073=_0x1032,_0x3a5137={'XYftx':'\x0a🚀\x20Ranger\x20Setup\x0a','xcoCI':'Non-interactive\x20mode:\x20No\x20--scope\x20provided,\x20defaulting\x20to\x20user.','aMNFq':_0x105073(0x149),'eOPdh':function(_0x578cea,_0x55ed31){return _0x578cea===_0x55ed31;},'oNCVK':_0x105073(0x122),'HWBCh':function(_0x1017c6,_0x55a252){return _0x1017c6&&_0x55a252;},'mBkNU':_0x105073(0x160),'tXLfS':function(_0x145b37){return _0x145b37();},'YLZSN':'✓\x20Skipping\x20authentication\x20(--skip-auth)','LjQuc':_0x105073(0x125),'hnrbU':_0x105073(0x144),'VXtYq':_0x105073(0x156),'pCkvu':'plugin','gGZSJ':function(_0xe0a5c5,_0x45c951){return _0xe0a5c5(_0x45c951);},'uVKUC':_0x105073(0x161),'wCuOx':function(_0x1337bd){return _0x1337bd();},'pQCWo':function(_0x549dac,_0x55d5e8){return _0x549dac instanceof _0x55d5e8;},'DREuR':function(_0x245904,_0x393236){return _0x245904(_0x393236);},'QQcqx':_0x105073(0x13b),'sLySX':_0x105073(0xfc),'invQz':function(_0x3962bc,_0x4bc82e){return _0x3962bc(_0x4bc82e);},'eLtdg':function(_0x38a18f,_0x41c60c){return _0x38a18f===_0x41c60c;},'QAdDd':_0x105073(0x117),'TWcXj':_0x105073(0x123),'KgHwp':_0x105073(0x147),'IBmvW':function(_0x2fe9a2,_0x5d5508){return _0x2fe9a2+_0x5d5508;},'xzvBb':function(_0x51cd46,_0x165141){return _0x51cd46+_0x165141;}};console[_0x105073(0x108)](_0x3a5137['XYftx']);const _0x50f1e2=process['stdin']['isTTY']&&process[_0x105073(0x13e)][_0x105073(0x11d)];!_0x50f1e2&&!_0x5d4b41?.['scope']&&(console[_0x105073(0x108)](_0x3a5137[_0x105073(0x129)]),_0x5d4b41={..._0x5d4b41,'scope':_0x3a5137[_0x105073(0x15b)]});const _0x80a70a=_0x3a5137['eOPdh'](_0x5d4b41?.[_0x105073(0x13a)],_0x3a5137[_0x105073(0x15b)]);_0x4ebbbb?.['trackPhaseStart'](_0x3a5137[_0x105073(0x151)]);const _0x49a3df=findGitRoot();if(_0x3a5137[_0x105073(0x112)](!_0x49a3df,!_0x80a70a)){await _0x4ebbbb?.['trackPhaseError'](_0x105073(0x122),new Error(_0x3a5137[_0x105073(0x113)]));throw new Error(_0x105073(0x118)+'or\x20use\x20--scope\x20user\x20to\x20install\x20at\x20the\x20user\x20level\x20without\x20a\x20project.');}_0x4ebbbb?.['trackPhaseEnd'](_0x3a5137['oNCVK']);const _0x226a9d=!existsSync(_0x3a5137[_0x105073(0x131)](getRangerDir)),{path:_0x29e6e0}=await ensureRangerDir(_0x80a70a?_0x105073(0x149):undefined);if(_0x5d4b41?.['skipAuth'])console['log'](_0x3a5137['YLZSN']),_0x4ebbbb?.[_0x105073(0x10f)](_0x3a5137[_0x105073(0x148)],{'isFirstRun':_0x226a9d,'method':_0x105073(0x132)});else{_0x4ebbbb?.['trackPhaseStart'](_0x105073(0x125));const _0xb560bd=await authenticate(_0x11e61f);_0x4ebbbb?.['trackPhaseEnd'](_0x105073(0x125),{'isFirstRun':_0x226a9d,'method':_0xb560bd[_0x105073(0x136)]});}_0x4ebbbb?.[_0x105073(0x154)](_0x105073(0x144));_0x5d4b41?.[_0x105073(0x127)]?console['log'](_0x105073(0x15c)):await ensureChromium(_0x5d4b41?.['withDeps']);_0x4ebbbb?.['trackPhaseEnd'](_0x3a5137[_0x105073(0x106)],{'isFirstRun':_0x226a9d,'skipped':!!_0x5d4b41?.['skipChromium']});!_0x80a70a&&await writeRangerGitignore(_0x29e6e0);console[_0x105073(0x108)](_0x3a5137['VXtYq']);const _0x21267c=_0x5d4b41?.[_0x105073(0x13a)],_0x524528=_0x5d4b41?.[_0x105073(0x110)]??![];let _0x3da566=null;_0x524528?(_0x4ebbbb?.['trackPhaseStart'](_0x3a5137[_0x105073(0x15f)]),_0x3da566=await ensureOpencodePluginConfig(_0x21267c),_0x4ebbbb?.['trackPhaseEnd'](_0x3a5137[_0x105073(0x15f)],{'isFirstRun':_0x226a9d,'opencode':!![]})):(_0x4ebbbb?.['trackPhaseStart'](_0x3a5137['pCkvu']),await _0x3a5137[_0x105073(0x104)](ensureClaudePlugin,_0x21267c),_0x4ebbbb?.['trackPhaseEnd'](_0x3a5137['pCkvu'],{'isFirstRun':_0x226a9d}));if(_0x524528&&_0x3da566){_0x4ebbbb?.[_0x105073(0x154)](_0x3a5137['uVKUC']);try{await installSkill('ranger',{'level':_0x3da566['scope'],'cliVersion':_0x3a5137[_0x105073(0x15e)](getCurrentVersion),'platform':_0x105073(0x110)}),_0x4ebbbb?.['trackPhaseEnd'](_0x105073(0x161),{'isFirstRun':_0x226a9d,'opencode':!![]});}catch(_0x133e1e){console[_0x105073(0x152)](_0x105073(0x155),_0x3a5137['pQCWo'](_0x133e1e,Error)?_0x133e1e['message']:_0x133e1e),_0x4ebbbb?.['trackPhaseEnd'](_0x105073(0x161),{'isFirstRun':_0x226a9d,'opencode':!![],'failed':!![]});}}else _0x4ebbbb?.[_0x105073(0x154)](_0x3a5137[_0x105073(0x11f)]),await _0x3a5137['DREuR'](ensureClaudeSkills,_0x21267c),_0x4ebbbb?.[_0x105073(0x10f)](_0x3a5137[_0x105073(0x11f)],{'isFirstRun':_0x226a9d});if(_0x5d4b41?.['skipAuth'])console['log'](_0x3a5137[_0x105073(0x12d)]);else{if(!_0x50f1e2&&!_0x5d4b41?.['url'])console['log'](_0x3a5137[_0x105073(0x13f)]),console['log']('\x20\x20'+_0x3a5137['invQz'](bold,_0x105073(0x103))+'\x0a');else{_0x4ebbbb?.[_0x105073(0x154)]('profile');const _0x193a51=await ensureLocalEnv({'url':_0x5d4b41?.[_0x105073(0x14f)],'force':_0x5d4b41?.[_0x105073(0x107)],'allowInsecureLocalhost':_0x5d4b41?.[_0x105073(0x164)],'scope':_0x3a5137['eLtdg'](_0x5d4b41?.['scope'],_0x3a5137[_0x105073(0x15b)])?_0x3a5137[_0x105073(0x15b)]:undefined},_0x4ebbbb);_0x4ebbbb?.[_0x105073(0x10f)](_0x105073(0x114),{'isFirstRun':_0x226a9d,'profileReady':_0x193a51['ready'],'userSkipped':_0x193a51['skipped']}),_0x193a51[_0x105073(0x14c)]&&console['log'](_0x105073(0x150));}}if(_0x524528)console[_0x105073(0x108)]('\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)'),console[_0x105073(0x108)](_0x3a5137['QAdDd']),console['log'](_0x3a5137[_0x105073(0xf6)]),console['log'](_0x105073(0x11b));else{const _0x12d538=_0x3a5137['gGZSJ'](bold,_0x3a5137[_0x105073(0x128)]);console['log'](_0x3a5137['IBmvW'](_0x3a5137['xzvBb'](_0x105073(0x159)+_0x12d538+'\x20and\x20prompt\x20the\x20coding',_0x105073(0x143))+_0x105073(0x11a),_0x105073(0x158)));}}
|
package/build/commands/status.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x24ecd2=_0x3584;(function(_0x3a6228,_0x150c3b){const _0x640fa7=_0x3584,_0x42b38f=_0x3a6228();while(!![]){try{const _0x21114c=parseInt(_0x640fa7(0x129))/0x1*(-parseInt(_0x640fa7(0x102))/0x2)+parseInt(_0x640fa7(0x14c))/0x3+-parseInt(_0x640fa7(0x125))/0x4*(parseInt(_0x640fa7(0x140))/0x5)+parseInt(_0x640fa7(0x127))/0x6+parseInt(_0x640fa7(0x11a))/0x7+-parseInt(_0x640fa7(0x13b))/0x8+parseInt(_0x640fa7(0x105))/0x9;if(_0x21114c===_0x150c3b)break;else _0x42b38f['push'](_0x42b38f['shift']());}catch(_0x75485d){_0x42b38f['push'](_0x42b38f['shift']());}}}(_0x1539,0x7c973));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';function _0x3584(_0xe6959b,_0x33d6ab){_0xe6959b=_0xe6959b-0xf8;const _0x1539d8=_0x1539();let _0x3584fa=_0x1539d8[_0xe6959b];return _0x3584fa;}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';function _0x1539(){const _0x420a84=['path','close','Root:\x20','\x20(latest:\x20','isActive','data','\x20\x20\x20\x20Auth:\x20','\x0a---\x20Skills\x20---','enabled','VdzbX','utf-8','parse','log','Version:\x20','GqqYW','nirlm','gqzNQ','map','ziRUz','5839533TCJNYj','@ranger-testing/opencode-plugin','all','auth.json.enc','\x1b[1m','plugin','settingsPath','KHHlF','MwVtd','some','not_configured','25712TsmuAj','YHzqR','2164812fmBTby','vUpfS','1249iYUrYx','match','error','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','wZGeW','plaintext','trim','\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','stderr','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','\x20\x20Not\x20installed','opencode-plugin','filter','SVHFa','XGgkd',':\x20configured','\x20(up\x20to\x20date)','name','4936056zFTZLQ','SIvhd','jZHOJ','env','UUQuE','575cFFcnI','isDirectory','string','\x1b]8;;file://','ignore','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','version','vSnBc','includes','MipoU','displayName','API\x20Environment:\x20','497796RMBCDV','uOzWo','user','details','dMCPC','status','MrNSd','hCOnW','\x20\x20Run:\x20ranger\x20setup\x20[token]','KGMnh','\x20plugin(s)\x20configured','cwd','config','BfXbw','\x20\x20Project-level:','\x20(active)','VzQhE','disabled','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','IUSfW','\x20\x20Not\x20configured','46jHggRW','\x20\x20\x20\x20','debug','4808916JjgPkD','length'];_0x1539=function(){return _0x420a84;};return _0x1539();}import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x5e25ff=>_0x24ecd2(0x11e)+_0x5e25ff+'\x1b[0m',link=(_0x1fdefe,_0x2858cb)=>_0x24ecd2(0x143)+_0x1fdefe+'\x07'+(_0x2858cb||_0x1fdefe)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x370b3c=_0x24ecd2,_0x316031={'vqGdQ':function(_0x3b9c35,_0x9e23b3){return _0x3b9c35(_0x9e23b3);},'RICOF':function(_0x329766,_0x473cba){return _0x329766!==_0x473cba;},'wZGeW':function(_0xab6c53,_0x3d2fd7){return _0xab6c53>_0x3d2fd7;},'YHzqR':_0x370b3c(0x124),'BfXbw':function(_0x3ec8fe,_0x5b7e92,_0x5dc44d,_0x350202){return _0x3ec8fe(_0x5b7e92,_0x5dc44d,_0x350202);},'aBTRw':_0x370b3c(0x104),'EBXQW':_0x370b3c(0xf9),'dMCPC':_0x370b3c(0x144),'chUzt':'pipe','iyJnP':_0x370b3c(0x12b),'eyTcx':_0x370b3c(0x108)};return new Promise(_0xb4f758=>{const _0x32e2b4=_0x370b3c,_0x3742db={'gqzNQ':function(_0x98dfd6,_0xc2be4f){return _0x316031['vqGdQ'](_0x98dfd6,_0xc2be4f);},'hmkho':'not_installed','QyTdr':function(_0x2c90ec,_0x47273c){return _0x316031['RICOF'](_0x2c90ec,_0x47273c);},'uEOAa':_0x32e2b4(0x142),'SjPFY':_0x32e2b4(0x134),'hCOnW':function(_0x2e8de0,_0x1e3b63){return _0x316031['RICOF'](_0x2e8de0,_0x1e3b63);},'Nnrzt':function(_0x2a95aa,_0xe793fd){return _0x2a95aa>_0xe793fd;},'TfvRK':function(_0x122e03,_0x43c638){const _0x1f4666=_0x32e2b4;return _0x316031[_0x1f4666(0x12d)](_0x122e03,_0x43c638);},'SVHFa':_0x316031[_0x32e2b4(0x126)]},_0x1fb7c6=_0x316031[_0x32e2b4(0xfa)](spawn,'opencode',[_0x316031['aBTRw'],_0x316031['EBXQW']],{'stdio':[_0x316031[_0x32e2b4(0x150)],_0x316031['chUzt'],_0x316031['chUzt']]});let _0x1e43c0='';_0x1fb7c6['stdout']?.['on'](_0x32e2b4(0x10c),_0x4554f6=>{_0x1e43c0+=_0x4554f6['toString']();}),_0x1fb7c6[_0x32e2b4(0x131)]?.['on'](_0x32e2b4(0x10c),_0x1f507c=>{_0x1e43c0+=_0x1f507c['toString']();}),_0x1fb7c6['on'](_0x316031['iyJnP'],()=>{_0x3742db['gqzNQ'](_0xb4f758,{'status':_0x3742db['hmkho']});}),_0x1fb7c6['on'](_0x316031['eyTcx'],_0x5ee7b9=>{const _0x50a87c=_0x32e2b4,_0x1018b6={'vSnBc':function(_0x1c0463,_0x556f53){return _0x3742db['QyTdr'](_0x1c0463,_0x556f53);},'Okxnf':_0x3742db['uEOAa'],'RCEZd':_0x50a87c(0x11b),'uuEHP':_0x3742db['SjPFY']};if(_0x3742db[_0x50a87c(0x153)](_0x5ee7b9,0x0)){_0xb4f758({'status':'not_installed'});return;}const _0x4679ff=_0x1e43c0[_0x50a87c(0x12f)]();let _0x283cd6=null;if(_0x4679ff)try{_0x283cd6=JSON[_0x50a87c(0x112)](_0x4679ff);}catch{const _0x4adb89=_0x4679ff[_0x50a87c(0x12a)](/\{[\s\S]*\}$/);if(_0x4adb89)try{_0x283cd6=JSON['parse'](_0x4adb89[0x0]);}catch{_0x283cd6=null;}}const _0xf49a1f=Array['isArray'](_0x283cd6?.[_0x50a87c(0x11f)])?_0x283cd6?.[_0x50a87c(0x11f)]:[],_0x4055f7=_0xf49a1f[_0x50a87c(0x123)](_0x269e67=>{const _0x5c8f8a=_0x50a87c;if(_0x1018b6[_0x5c8f8a(0x147)](typeof _0x269e67,_0x1018b6['Okxnf']))return![];return _0x269e67[_0x5c8f8a(0x148)](_0x1018b6['RCEZd'])||_0x269e67[_0x5c8f8a(0x148)](_0x1018b6['uuEHP']);});if(_0x4055f7){_0xb4f758({'status':'configured','details':_0x3742db['Nnrzt'](_0xf49a1f[_0x50a87c(0x106)],0x0)?_0xf49a1f['length']+'\x20plugin(s)\x20configured':undefined});return;}if(_0x3742db['TfvRK'](_0xf49a1f['length'],0x0)){_0x3742db[_0x50a87c(0x117)](_0xb4f758,{'status':_0x50a87c(0x124),'details':_0xf49a1f[_0x50a87c(0x106)]+_0x50a87c(0x156)});return;}_0x3742db['gqzNQ'](_0xb4f758,{'status':_0x3742db[_0x50a87c(0x136)]});});});}async function getSkillsFromDir(_0x2f5719,_0x63d98b){const _0xb1fe84=_0x24ecd2,_0x59e8ee={'XGgkd':function(_0x32312f,_0x400eb9,_0x32be61){return _0x32312f(_0x400eb9,_0x32be61);},'IugFu':'SKILL.md','KHHlF':function(_0xfe282,_0x35aea9){return _0xfe282(_0x35aea9);},'pEJEE':_0xb1fe84(0x111)};if(!existsSync(_0x2f5719))return[];const _0x548361=[];try{const _0x1e330c=await _0x59e8ee[_0xb1fe84(0x137)](readdir,_0x2f5719,{'withFileTypes':!![]});for(const _0x45a58e of _0x1e330c){if(_0x45a58e[_0xb1fe84(0x141)]()){const _0x48f212=join(_0x2f5719,_0x45a58e['name'],_0x59e8ee['IugFu']);if(_0x59e8ee[_0xb1fe84(0x121)](existsSync,_0x48f212)){let _0x2eaddf=_0x45a58e['name'];try{const _0x366421=await readFile(_0x48f212,_0x59e8ee['pEJEE']),_0x15770c=_0x366421[_0xb1fe84(0x12a)](/name:\s*(.+)/);_0x15770c&&(_0x2eaddf=_0x15770c[0x1]['trim']());}catch{}_0x548361['push']({'name':_0x45a58e[_0xb1fe84(0x13a)],'displayName':_0x2eaddf,'path':_0x48f212,'level':_0x63d98b});}}}}catch{return[];}return _0x548361;}async function getInstalledSkills(){const _0x335950=_0x24ecd2,_0x48b5b2={'jKUzg':function(_0x50082e,_0x239e10,_0x23a128){return _0x50082e(_0x239e10,_0x23a128);},'ydSHM':'project'},[_0x59065a,_0xb3828d]=await Promise[_0x335950(0x11c)]([_0x48b5b2['jKUzg'](getSkillsFromDir,getProjectSkillsDir(),_0x48b5b2['ydSHM']),getSkillsFromDir(getUserSkillsDir(),'user')]);return{'project':_0x59065a,'user':_0xb3828d};}async function getEnvironments(){const _0x361de0=_0x24ecd2,_0xc39659={'VzQhE':function(_0x4759cf,_0x53ea34){return _0x4759cf(_0x53ea34);},'Wzrbl':'auth.json','nMTJU':_0x361de0(0x11d),'KGMnh':function(_0xd11fd4,_0x52eaee){return _0xd11fd4(_0x52eaee);},'NZjid':'(not\x20found)','LZHxT':function(_0x5f1063,_0x2e5bb0){return _0x5f1063===_0x2e5bb0;},'GTDjT':function(_0x375bbd,_0x5a7ce2){return _0x375bbd(_0x5a7ce2);}},{envNames:_0x35b475,activeEnv:_0x5553ce}=await getEnvNames(),_0x58b985=getRangerDir();if(!_0xc39659['GTDjT'](existsSync,_0x58b985))return{'envs':[],'activeEnv':null};const _0x2b50c6=_0x35b475[_0x361de0(0x118)](_0x11fd22=>{const _0x369291=_0x361de0,_0x437af9=_0xc39659['VzQhE'](getEnvDir,_0x11fd22),_0x52e070=join(_0x437af9,'settings.json'),_0x4d22d2=join(_0x437af9,_0xc39659['Wzrbl']),_0xfcc793=join(_0x437af9,_0xc39659['nMTJU']);return{'name':_0x11fd22,'settingsPath':_0xc39659[_0x369291(0x155)](existsSync,_0x52e070)?_0x52e070:_0xc39659['NZjid'],'hasPlaintextAuth':_0xc39659[_0x369291(0xfd)](existsSync,_0x4d22d2),'hasEncryptedAuth':existsSync(_0xfcc793),'isActive':_0xc39659['LZHxT'](_0x11fd22,_0x5553ce)};});return{'envs':_0x2b50c6,'activeEnv':_0x5553ce};}export async function status(){const _0x4aaadd=_0x24ecd2,_0x25daba={'yuORv':'\x0a📊\x20Ranger\x20Status\x0a','jZHOJ':function(_0x3f4365){return _0x3f4365();},'uOzWo':function(_0x42ff66,_0x292882){return _0x42ff66(_0x292882);},'MrNSd':function(_0x5899ad){return _0x5899ad();},'SIvhd':function(_0x5d1ef1){return _0x5d1ef1();},'fhmLR':function(_0x254c62){return _0x254c62();},'MwVtd':function(_0x3043d0){return _0x3043d0();},'BodJP':function(_0x1959c7){return _0x1959c7();},'UUQuE':function(_0x57b34e,_0x26f8f7){return _0x57b34e===_0x26f8f7;},'MipoU':'configured','tbhRJ':function(_0x1d50e7,_0x41eaf3){return _0x1d50e7(_0x41eaf3);},'yDzVw':function(_0x2be875,_0xd97a65){return _0x2be875===_0xd97a65;},'GyqGq':_0x4aaadd(0x124),'IUSfW':_0x4aaadd(0x101),'VESjY':'\x0a---\x20Claude\x20Code\x20Plugin\x20---','GqqYW':'ranger@trailhead','QBhNF':'unknown','ZJTxG':_0x4aaadd(0x10f),'ziRUz':_0x4aaadd(0xfe),'lkrpp':_0x4aaadd(0xff),'GtIsG':function(_0xbd5a77,_0x3cf8a0){return _0xbd5a77+_0x3cf8a0;},'vUpfS':function(_0x59f4ec,_0x2e1452){return _0x59f4ec>_0x2e1452;},'VDyLv':function(_0x9c769e,_0x12ee27){return _0x9c769e(_0x12ee27);},'nirlm':function(_0x2e79cd,_0x552fe8,_0x24538f){return _0x2e79cd(_0x552fe8,_0x24538f);},'GMzKX':function(_0x561333,_0x2dc1dc){return _0x561333(_0x2dc1dc);},'Zpnrp':'\x20\x20User-level:','ySWUl':'\x0a---\x20Profiles\x20---','VdzbX':'none','ASMri':function(_0x56eae8,_0x916123){return _0x56eae8(_0x916123);}};console['log'](_0x25daba['yuORv']);const _0x1aaf02=process[_0x4aaadd(0xf8)](),_0x1b7715=_0x25daba[_0x4aaadd(0x13d)](getRangerDir);if(!_0x25daba['uOzWo'](existsSync,_0x1b7715)){console['log']('Root:\x20'+link(_0x1aaf02,bold(basename(_0x1aaf02)))),console['log'](_0x4aaadd(0x132)),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console['log'](_0x4aaadd(0x109)+link(_0x1aaf02,_0x25daba[_0x4aaadd(0x14d)](bold,_0x25daba[_0x4aaadd(0x14d)](basename,_0x1aaf02))));const _0x44efbc=_0x25daba[_0x4aaadd(0x152)](getCurrentVersion),_0x4ea3f5=getLatestVersion();if(_0x4ea3f5[_0x4aaadd(0x146)]&&_0x4ea3f5['version']!==_0x44efbc)console[_0x4aaadd(0x113)](_0x4aaadd(0x114)+_0x44efbc+_0x4aaadd(0x10a)+_0x4ea3f5[_0x4aaadd(0x146)]+')'),console['log']('\x20\x20Run:\x20ranger\x20update');else _0x4ea3f5['version']?console[_0x4aaadd(0x113)]('Version:\x20'+_0x44efbc+_0x4aaadd(0x139)):console['log']('Version:\x20'+_0x44efbc);const _0x1f0e2b=await _0x25daba[_0x4aaadd(0x13c)](getToken);if(_0x1f0e2b){const _0x50f440=await _0x25daba['uOzWo'](getCurrentUser,_0x1f0e2b);_0x50f440['success']?console[_0x4aaadd(0x113)]('Organization:\x20'+bold(_0x50f440[_0x4aaadd(0x14e)]['organizationName'])):(console['log'](_0x4aaadd(0x12c)),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console[_0x4aaadd(0x113)]('API\x20Token:\x20✗\x20Not\x20found'),console[_0x4aaadd(0x113)](_0x4aaadd(0x154));process[_0x4aaadd(0x13e)]['DEBUG']&&(console['log'](_0x4aaadd(0x14b)+_0x25daba['fhmLR'](getCurrentEnvironment)),console['log']('API\x20URL:\x20'+_0x25daba[_0x4aaadd(0x122)](getApiBaseUrl)));console['log']('\x0a---\x20OpenCode\x20Plugin\x20---');const _0x29821e=await _0x25daba['BodJP'](getOpencodePluginStatus);if(_0x25daba[_0x4aaadd(0x13f)](_0x29821e[_0x4aaadd(0x151)],_0x25daba[_0x4aaadd(0x149)]))console[_0x4aaadd(0x113)]('\x20\x20'+_0x25daba['tbhRJ'](bold,_0x4aaadd(0x11b))+_0x4aaadd(0x138)),_0x29821e[_0x4aaadd(0x14f)]&&console[_0x4aaadd(0x113)]('\x20\x20'+_0x29821e['details']);else _0x25daba['yDzVw'](_0x29821e[_0x4aaadd(0x151)],_0x25daba['GyqGq'])?(console['log'](_0x25daba[_0x4aaadd(0x100)]),_0x29821e[_0x4aaadd(0x14f)]&&console[_0x4aaadd(0x113)]('\x20\x20'+_0x29821e['details']),console[_0x4aaadd(0x113)]('\x20\x20Run:\x20ranger\x20setup\x20--opencode')):console[_0x4aaadd(0x113)](_0x4aaadd(0x130));console[_0x4aaadd(0x113)](_0x25daba['VESjY']);const _0x3ca0a9=await getPluginInfo(_0x25daba[_0x4aaadd(0x115)]);if(_0x3ca0a9){const _0x34fa48=_0x3ca0a9['scope']||_0x25daba['QBhNF'],_0x4e4282=_0x3ca0a9[_0x4aaadd(0x10f)]?_0x25daba['ZJTxG']:_0x25daba[_0x4aaadd(0x119)];console['log']('\x20\x20'+_0x25daba[_0x4aaadd(0x14d)](bold,'ranger@trailhead')+':\x20installed\x20('+_0x34fa48+',\x20'+_0x4e4282+')');}else console[_0x4aaadd(0x113)](_0x4aaadd(0x133)),console[_0x4aaadd(0x113)](_0x25daba['lkrpp']);console[_0x4aaadd(0x113)](_0x4aaadd(0x10e));const {project:_0xf3a8f1,user:_0x1f9f7f}=await _0x25daba['BodJP'](getInstalledSkills),_0x576ea6=_0xf3a8f1[_0x4aaadd(0x135)](_0x65336b=>RANGER_MANAGED_SKILLS['includes'](_0x65336b[_0x4aaadd(0x13a)])),_0x9565a5=_0x1f9f7f[_0x4aaadd(0x135)](_0x5ac269=>RANGER_MANAGED_SKILLS[_0x4aaadd(0x148)](_0x5ac269['name'])),_0x5d8158=_0x25daba['GtIsG'](_0x576ea6['length'],_0x9565a5['length']);if(_0x5d8158===0x0)console['log']('No\x20skills\x20installed'),console[_0x4aaadd(0x113)]('\x20\x20Run:\x20ranger\x20skillup');else{if(_0x25daba[_0x4aaadd(0x128)](_0x576ea6['length'],0x0)){console['log'](_0x4aaadd(0xfb));for(const _0x2ed444 of _0x576ea6){console['log']('\x20\x20\x20\x20'+_0x25daba['VDyLv'](bold,_0x2ed444['displayName'])+':\x20'+_0x25daba['nirlm'](link,_0x2ed444['path'],_0x25daba['GMzKX'](basename,_0x2ed444[_0x4aaadd(0x107)])));}}if(_0x25daba['vUpfS'](_0x9565a5['length'],0x0)){console['log'](_0x25daba['Zpnrp']);for(const _0xd6f812 of _0x9565a5){console[_0x4aaadd(0x113)](_0x4aaadd(0x103)+bold(_0xd6f812[_0x4aaadd(0x14a)])+':\x20'+_0x25daba[_0x4aaadd(0x116)](link,_0xd6f812['path'],basename(_0xd6f812['path'])));}}}console[_0x4aaadd(0x113)](_0x25daba['ySWUl']);const {envs:_0x3f6350,activeEnv:_0x47ebe6}=await getEnvironments();if(_0x25daba[_0x4aaadd(0x13f)](_0x3f6350['length'],0x0))console['log']('No\x20profiles\x20configured'),console[_0x4aaadd(0x113)]('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{for(const _0x3e1e3e of _0x3f6350){const _0x329c23=_0x3e1e3e[_0x4aaadd(0x10b)]?_0x4aaadd(0xfc):'',_0x17688b=_0x3e1e3e['hasEncryptedAuth']?'encrypted':_0x3e1e3e['hasPlaintextAuth']?_0x4aaadd(0x12e):_0x25daba[_0x4aaadd(0x110)];console['log']('\x20\x20'+_0x25daba['ASMri'](bold,_0x3e1e3e[_0x4aaadd(0x13a)])+_0x329c23),console[_0x4aaadd(0x113)](_0x4aaadd(0x10d)+_0x17688b),_0x3e1e3e['settingsPath']!=='(not\x20found)'&&console['log']('\x20\x20\x20\x20Settings:\x20'+link(_0x3e1e3e['settingsPath'],_0x25daba['uOzWo'](basename,_0x3e1e3e[_0x4aaadd(0x120)])));}!_0x47ebe6&&(console[_0x4aaadd(0x113)]('\x0a\x20\x20No\x20active\x20profile\x20set'),console['log'](_0x4aaadd(0x145)+_0x3f6350['map'](_0x1518ba=>_0x1518ba[_0x4aaadd(0x13a)])['join'](',\x20')+')'));}console[_0x4aaadd(0x113)]('');}
|
|
1
|
+
const _0x55a25a=_0x585c;(function(_0xaa72a9,_0x2de347){const _0x484b1e=_0x585c,_0x2dd1f4=_0xaa72a9();while(!![]){try{const _0x239321=parseInt(_0x484b1e(0x233))/0x1*(-parseInt(_0x484b1e(0x1ee))/0x2)+-parseInt(_0x484b1e(0x1fa))/0x3*(parseInt(_0x484b1e(0x238))/0x4)+-parseInt(_0x484b1e(0x223))/0x5*(-parseInt(_0x484b1e(0x1e2))/0x6)+-parseInt(_0x484b1e(0x206))/0x7*(parseInt(_0x484b1e(0x20d))/0x8)+parseInt(_0x484b1e(0x22a))/0x9+-parseInt(_0x484b1e(0x21d))/0xa*(-parseInt(_0x484b1e(0x1ed))/0xb)+parseInt(_0x484b1e(0x1f8))/0xc*(parseInt(_0x484b1e(0x227))/0xd);if(_0x239321===_0x2de347)break;else _0x2dd1f4['push'](_0x2dd1f4['shift']());}catch(_0x12a2fd){_0x2dd1f4['push'](_0x2dd1f4['shift']());}}}(_0x50f0,0xbfeda));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';function _0x50f0(){const _0x26f109=['cwd','Root:\x20',':\x20configured','jmfxU','\x0a---\x20Profiles\x20---','includes','project','toString','YIhEc','match','oNcoU','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','9152634sooVZX','name','opencode-plugin','\x20\x20Run:\x20ranger\x20setup\x20[token]','iGksb','length','HrnUx','\x20\x20User-level:','\x20(latest:\x20','zolzE','pLFRf','56419fpsnHQ','1677964jShEOR','@ranger-testing/opencode-plugin','vaXFi','parse','oDDdf','path','details','debug','isActive','stdout','36jFixjG','version','5001OCicQc','hasEncryptedAuth','plugin','config','DEBUG','\x1b]8;;file://','Jcilq','DQhDc','dpvYT','\x20(up\x20to\x20date)','axGfv','stderr','329KlLyEW','jnrtz','hasPlaintextAuth','\x20\x20Project-level:','opencode','all','not_installed','227912uwsTDD','\x20\x20\x20\x20','\x20plugin(s)\x20configured','jQjli','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','ranger@trailhead','PzAWL','status','iNtQl','pJKUt','settings.json','imsKW','PBPjd','auth.json.enc','\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','ignore','1880wPKxVt','configured','string','(not\x20found)','error','hehUG','5RuheOY','\x20\x20\x20\x20Auth:\x20','log','\x20\x20Not\x20installed','4986293ZTJiEe','not_configured','Version:\x20','7971372JqTTyZ','pjxVk','\x0a📊\x20Ranger\x20Status\x0a','displayName','YXPmi','\x0a---\x20OpenCode\x20Plugin\x20---','zJzMJ','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','filter','1DGsZMX','DNGCu','ykqzk','\x1b]8;;\x07','oqGRQ','3748EIQiqw','Organization:\x20','trim','settingsPath','enabled'];_0x50f0=function(){return _0x26f109;};return _0x50f0();}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=_0x2e0d81=>'\x1b[1m'+_0x2e0d81+'\x1b[0m',link=(_0x3c99a7,_0x4da21a)=>_0x55a25a(0x1ff)+_0x3c99a7+'\x07'+(_0x4da21a||_0x3c99a7)+_0x55a25a(0x236);async function getOpencodePluginStatus(){const _0x21a5cc=_0x55a25a,_0x3a4761={'HrnUx':function(_0x5a2da3,_0x1b6b81){return _0x5a2da3(_0x1b6b81);},'bMjpl':'configured','pJKUt':function(_0x1cfa81,_0xed1345){return _0x1cfa81>_0xed1345;},'iGksb':'not_configured','oqGRQ':function(_0x5e85d1,_0x4b9721){return _0x5e85d1(_0x4b9721);},'blWEK':function(_0x2acdd6,_0x1a9de8,_0x1af180,_0x53f10d){return _0x2acdd6(_0x1a9de8,_0x1af180,_0x53f10d);},'vuInM':_0x21a5cc(0x1f5),'uyezp':_0x21a5cc(0x21c),'iNtQl':'pipe','YXPmi':'close'};return new Promise(_0x27490a=>{const _0x5d1594=_0x21a5cc,_0x3ce030={'hMZye':function(_0x385c5c,_0x5bf0f7){return _0x3a4761['oqGRQ'](_0x385c5c,_0x5bf0f7);}},_0x10f12e=_0x3a4761['blWEK'](spawn,_0x5d1594(0x20a),[_0x3a4761['vuInM'],_0x5d1594(0x1fd)],{'stdio':[_0x3a4761['uyezp'],_0x3a4761['iNtQl'],_0x3a4761[_0x5d1594(0x215)]]});let _0xaf4e50='';_0x10f12e[_0x5d1594(0x1f7)]?.['on']('data',_0x29e9c0=>{const _0x4369ce=_0x5d1594;_0xaf4e50+=_0x29e9c0[_0x4369ce(0x1dd)]();}),_0x10f12e[_0x5d1594(0x205)]?.['on']('data',_0x3757c5=>{const _0x1e7bca=_0x5d1594;_0xaf4e50+=_0x3757c5[_0x1e7bca(0x1dd)]();}),_0x10f12e['on'](_0x5d1594(0x221),()=>{_0x3ce030['hMZye'](_0x27490a,{'status':'not_installed'});}),_0x10f12e['on'](_0x3a4761[_0x5d1594(0x22e)],_0x4d93e9=>{const _0x3f0ba8=_0x5d1594,_0x362c1f={'bZUfI':'@ranger-testing/opencode-plugin'};if(_0x4d93e9!==0x0){_0x3a4761[_0x3f0ba8(0x1e8)](_0x27490a,{'status':_0x3f0ba8(0x20c)});return;}const _0x181b4e=_0xaf4e50[_0x3f0ba8(0x1d3)]();let _0xf2a8ba=null;if(_0x181b4e)try{_0xf2a8ba=JSON['parse'](_0x181b4e);}catch{const _0x2077ec=_0x181b4e[_0x3f0ba8(0x1df)](/\{[\s\S]*\}$/);if(_0x2077ec)try{_0xf2a8ba=JSON[_0x3f0ba8(0x1f1)](_0x2077ec[0x0]);}catch{_0xf2a8ba=null;}}const _0x4d5897=Array['isArray'](_0xf2a8ba?.['plugin'])?_0xf2a8ba?.[_0x3f0ba8(0x1fc)]:[],_0x15a8cf=_0x4d5897['some'](_0x55e7b1=>{const _0x52dff4=_0x3f0ba8;if(typeof _0x55e7b1!==_0x52dff4(0x21f))return![];return _0x55e7b1[_0x52dff4(0x1db)](_0x362c1f['bZUfI'])||_0x55e7b1['includes'](_0x52dff4(0x1e4));});if(_0x15a8cf){_0x27490a({'status':_0x3a4761['bMjpl'],'details':_0x4d5897[_0x3f0ba8(0x1e7)]>0x0?_0x4d5897['length']+_0x3f0ba8(0x20f):undefined});return;}if(_0x3a4761[_0x3f0ba8(0x216)](_0x4d5897[_0x3f0ba8(0x1e7)],0x0)){_0x27490a({'status':_0x3a4761[_0x3f0ba8(0x1e6)],'details':_0x4d5897[_0x3f0ba8(0x1e7)]+_0x3f0ba8(0x20f)});return;}_0x3a4761[_0x3f0ba8(0x237)](_0x27490a,{'status':_0x3f0ba8(0x228)});});});}async function getSkillsFromDir(_0x8109f8,_0x5ce718){const _0xfa2695=_0x55a25a,_0xce2fd2={'TpsAP':function(_0x13db3e,_0x5da9eb,_0x4a4941){return _0x13db3e(_0x5da9eb,_0x4a4941);},'hehUG':'utf-8'};if(!existsSync(_0x8109f8))return[];const _0x1ab807=[];try{const _0x19c73f=await _0xce2fd2['TpsAP'](readdir,_0x8109f8,{'withFileTypes':!![]});for(const _0x23f4aa of _0x19c73f){if(_0x23f4aa['isDirectory']()){const _0x33623c=join(_0x8109f8,_0x23f4aa[_0xfa2695(0x1e3)],'SKILL.md');if(existsSync(_0x33623c)){let _0x33c28a=_0x23f4aa['name'];try{const _0x5e15b8=await readFile(_0x33623c,_0xce2fd2[_0xfa2695(0x222)]),_0x43826f=_0x5e15b8['match'](/name:\s*(.+)/);_0x43826f&&(_0x33c28a=_0x43826f[0x1][_0xfa2695(0x1d3)]());}catch{}_0x1ab807['push']({'name':_0x23f4aa['name'],'displayName':_0x33c28a,'path':_0x33623c,'level':_0x5ce718});}}}}catch{return[];}return _0x1ab807;}function _0x585c(_0x22c779,_0x524e19){_0x22c779=_0x22c779-0x1d3;const _0x50f0e4=_0x50f0();let _0x585c85=_0x50f0e4[_0x22c779];return _0x585c85;}async function getInstalledSkills(){const _0x3ea953=_0x55a25a,_0x29e0f8={'imsKW':function(_0x24a0a5,_0x3f8e49,_0x35623d){return _0x24a0a5(_0x3f8e49,_0x35623d);},'jnrtz':function(_0x541442){return _0x541442();},'kNXNY':'user'},[_0x245f8d,_0x2da8e9]=await Promise[_0x3ea953(0x20b)]([_0x29e0f8[_0x3ea953(0x218)](getSkillsFromDir,_0x29e0f8[_0x3ea953(0x207)](getProjectSkillsDir),_0x3ea953(0x1dc)),_0x29e0f8[_0x3ea953(0x218)](getSkillsFromDir,getUserSkillsDir(),_0x29e0f8['kNXNY'])]);return{'project':_0x245f8d,'user':_0x2da8e9};}async function getEnvironments(){const _0x274577=_0x55a25a,_0x2d7c1f={'jQjli':function(_0x3bf280,_0x336769,_0x352cf7){return _0x3bf280(_0x336769,_0x352cf7);},'PBPjd':function(_0xb7f207,_0x162373,_0xd136f4){return _0xb7f207(_0x162373,_0xd136f4);},'oNcoU':_0x274577(0x21a),'vaXFi':function(_0x3a34f8,_0x13c986){return _0x3a34f8(_0x13c986);},'zJzMJ':function(_0x51182a,_0x3005af){return _0x51182a(_0x3005af);},'dnTBV':function(_0x247d65,_0x3690e3){return _0x247d65(_0x3690e3);}},{envNames:_0x1b0463,activeEnv:_0x3f6bd4}=await getEnvNames(),_0x16b45f=getRangerDir();if(!_0x2d7c1f['dnTBV'](existsSync,_0x16b45f))return{'envs':[],'activeEnv':null};const _0x5e19de=_0x1b0463['map'](_0x24c37c=>{const _0x514140=_0x274577,_0x5ec11b=getEnvDir(_0x24c37c),_0x5557dd=join(_0x5ec11b,_0x514140(0x217)),_0x40e581=_0x2d7c1f[_0x514140(0x210)](join,_0x5ec11b,'auth.json'),_0x4e8996=_0x2d7c1f[_0x514140(0x219)](join,_0x5ec11b,_0x2d7c1f[_0x514140(0x1e0)]);return{'name':_0x24c37c,'settingsPath':_0x2d7c1f[_0x514140(0x1f0)](existsSync,_0x5557dd)?_0x5557dd:_0x514140(0x220),'hasPlaintextAuth':_0x2d7c1f[_0x514140(0x230)](existsSync,_0x40e581),'hasEncryptedAuth':existsSync(_0x4e8996),'isActive':_0x24c37c===_0x3f6bd4};});return{'envs':_0x5e19de,'activeEnv':_0x3f6bd4};}export async function status(){const _0x539c9b=_0x55a25a,_0x248fd6={'zuOxA':function(_0x4dd9aa,_0x2045ed,_0x419070){return _0x4dd9aa(_0x2045ed,_0x419070);},'pjxVk':function(_0x555ad2,_0x216088){return _0x555ad2(_0x216088);},'SYiYu':function(_0x596f85,_0x1b7e11){return _0x596f85(_0x1b7e11);},'FYKfB':function(_0x180eef,_0x404ffd,_0x1a07a6){return _0x180eef(_0x404ffd,_0x1a07a6);},'zolzE':function(_0x4f624f){return _0x4f624f();},'DNGCu':function(_0x34e5a4,_0x5fc56d){return _0x34e5a4(_0x5fc56d);},'jmfxU':function(_0xed3bc1,_0x2cf4c8){return _0xed3bc1===_0x2cf4c8;},'DQhDc':_0x539c9b(0x21e),'FHjFv':_0x539c9b(0x1ef),'fIIng':'not_configured','oDDdf':'\x20\x20Not\x20configured','pLFRf':_0x539c9b(0x21b),'dpvYT':function(_0x155848,_0x3bcf43){return _0x155848(_0x3bcf43);},'axGfv':_0x539c9b(0x212),'Jcilq':'unknown','YIhEc':_0x539c9b(0x1d5),'BZfBO':function(_0x17840f,_0x399a6b){return _0x17840f+_0x399a6b;},'FOVKz':'No\x20skills\x20installed','dFjZT':function(_0x5302e0,_0x3d0ca9){return _0x5302e0>_0x3d0ca9;},'wVDkn':function(_0x2b3aab,_0x2ce294){return _0x2b3aab(_0x2ce294);},'QMrGH':_0x539c9b(0x1da),'LzvAx':'No\x20profiles\x20configured','ZDsxB':'\x20(active)','ykqzk':'none','PzAWL':_0x539c9b(0x220)};console['log'](_0x539c9b(0x22c));const _0x15ac1b=process[_0x539c9b(0x1d6)](),_0x6d933b=getRangerDir();if(!existsSync(_0x6d933b)){console[_0x539c9b(0x225)]('Root:\x20'+_0x248fd6['zuOxA'](link,_0x15ac1b,_0x248fd6[_0x539c9b(0x22b)](bold,_0x248fd6['SYiYu'](basename,_0x15ac1b)))),console[_0x539c9b(0x225)](_0x539c9b(0x231)),console[_0x539c9b(0x225)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console['log'](_0x539c9b(0x1d7)+_0x248fd6['FYKfB'](link,_0x15ac1b,bold(_0x248fd6['SYiYu'](basename,_0x15ac1b))));const _0x2d2754=_0x248fd6[_0x539c9b(0x1eb)](getCurrentVersion),_0x5239be=_0x248fd6['zolzE'](getLatestVersion);if(_0x5239be[_0x539c9b(0x1f9)]&&_0x5239be[_0x539c9b(0x1f9)]!==_0x2d2754)console[_0x539c9b(0x225)](_0x539c9b(0x229)+_0x2d2754+_0x539c9b(0x1ea)+_0x5239be['version']+')'),console['log']('\x20\x20Run:\x20ranger\x20update');else _0x5239be[_0x539c9b(0x1f9)]?console[_0x539c9b(0x225)]('Version:\x20'+_0x2d2754+_0x539c9b(0x203)):console[_0x539c9b(0x225)]('Version:\x20'+_0x2d2754);const _0x326df4=await getToken();if(_0x326df4){const _0x576b78=await _0x248fd6[_0x539c9b(0x22b)](getCurrentUser,_0x326df4);_0x576b78['success']?console[_0x539c9b(0x225)](_0x539c9b(0x239)+_0x248fd6[_0x539c9b(0x234)](bold,_0x576b78['user']['organizationName'])):(console[_0x539c9b(0x225)](_0x539c9b(0x211)),console[_0x539c9b(0x225)](_0x539c9b(0x1e5)));}else console['log']('API\x20Token:\x20✗\x20Not\x20found'),console[_0x539c9b(0x225)](_0x539c9b(0x1e5));process['env'][_0x539c9b(0x1fe)]&&(console[_0x539c9b(0x225)]('API\x20Environment:\x20'+_0x248fd6[_0x539c9b(0x1eb)](getCurrentEnvironment)),console['log']('API\x20URL:\x20'+getApiBaseUrl()));console['log'](_0x539c9b(0x22f));const _0x4b0f1f=await _0x248fd6['zolzE'](getOpencodePluginStatus);if(_0x248fd6[_0x539c9b(0x1d9)](_0x4b0f1f[_0x539c9b(0x214)],_0x248fd6[_0x539c9b(0x201)]))console[_0x539c9b(0x225)]('\x20\x20'+bold(_0x248fd6['FHjFv'])+_0x539c9b(0x1d8)),_0x4b0f1f[_0x539c9b(0x1f4)]&&console['log']('\x20\x20'+_0x4b0f1f[_0x539c9b(0x1f4)]);else _0x4b0f1f[_0x539c9b(0x214)]===_0x248fd6['fIIng']?(console[_0x539c9b(0x225)](_0x248fd6[_0x539c9b(0x1f2)]),_0x4b0f1f[_0x539c9b(0x1f4)]&&console[_0x539c9b(0x225)]('\x20\x20'+_0x4b0f1f[_0x539c9b(0x1f4)]),console[_0x539c9b(0x225)]('\x20\x20Run:\x20ranger\x20setup\x20--opencode')):console['log'](_0x248fd6[_0x539c9b(0x1ec)]);console['log']('\x0a---\x20Claude\x20Code\x20Plugin\x20---');const _0x1dd254=await _0x248fd6[_0x539c9b(0x202)](getPluginInfo,_0x248fd6[_0x539c9b(0x204)]);if(_0x1dd254){const _0x83d47c=_0x1dd254['scope']||_0x248fd6[_0x539c9b(0x200)],_0x54dcb6=_0x1dd254[_0x539c9b(0x1d5)]?_0x248fd6[_0x539c9b(0x1de)]:'disabled';console['log']('\x20\x20'+bold(_0x248fd6[_0x539c9b(0x204)])+':\x20installed\x20('+_0x83d47c+',\x20'+_0x54dcb6+')');}else console[_0x539c9b(0x225)](_0x539c9b(0x226)),console[_0x539c9b(0x225)](_0x539c9b(0x1e1));console[_0x539c9b(0x225)]('\x0a---\x20Skills\x20---');const {project:_0x64f920,user:_0x458a5c}=await getInstalledSkills(),_0x5022d2=_0x64f920['filter'](_0x212334=>RANGER_MANAGED_SKILLS['includes'](_0x212334['name'])),_0x471ef4=_0x458a5c[_0x539c9b(0x232)](_0x5edc79=>RANGER_MANAGED_SKILLS['includes'](_0x5edc79['name'])),_0x4b116d=_0x248fd6['BZfBO'](_0x5022d2['length'],_0x471ef4['length']);if(_0x4b116d===0x0)console[_0x539c9b(0x225)](_0x248fd6['FOVKz']),console[_0x539c9b(0x225)]('\x20\x20Run:\x20ranger\x20skillup');else{if(_0x248fd6['dFjZT'](_0x5022d2[_0x539c9b(0x1e7)],0x0)){console[_0x539c9b(0x225)](_0x539c9b(0x209));for(const _0x446f45 of _0x5022d2){console['log'](_0x539c9b(0x20e)+bold(_0x446f45['displayName'])+':\x20'+_0x248fd6['zuOxA'](link,_0x446f45[_0x539c9b(0x1f3)],_0x248fd6[_0x539c9b(0x202)](basename,_0x446f45['path'])));}}if(_0x471ef4[_0x539c9b(0x1e7)]>0x0){console['log'](_0x539c9b(0x1e9));for(const _0x1fceb8 of _0x471ef4){console[_0x539c9b(0x225)](_0x539c9b(0x20e)+bold(_0x1fceb8[_0x539c9b(0x22d)])+':\x20'+link(_0x1fceb8[_0x539c9b(0x1f3)],_0x248fd6['wVDkn'](basename,_0x1fceb8['path'])));}}}console[_0x539c9b(0x225)](_0x248fd6['QMrGH']);const {envs:_0x2a4321,activeEnv:_0x4af5ed}=await getEnvironments();if(_0x248fd6['jmfxU'](_0x2a4321[_0x539c9b(0x1e7)],0x0))console['log'](_0x248fd6['LzvAx']),console['log']('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{for(const _0x1a41bb of _0x2a4321){const _0x2b2c3a=_0x1a41bb[_0x539c9b(0x1f6)]?_0x248fd6['ZDsxB']:'',_0xab3a17=_0x1a41bb[_0x539c9b(0x1fb)]?'encrypted':_0x1a41bb[_0x539c9b(0x208)]?'plaintext':_0x248fd6[_0x539c9b(0x235)];console['log']('\x20\x20'+bold(_0x1a41bb['name'])+_0x2b2c3a),console[_0x539c9b(0x225)](_0x539c9b(0x224)+_0xab3a17),_0x1a41bb['settingsPath']!==_0x248fd6[_0x539c9b(0x213)]&&console[_0x539c9b(0x225)]('\x20\x20\x20\x20Settings:\x20'+link(_0x1a41bb[_0x539c9b(0x1d4)],basename(_0x1a41bb[_0x539c9b(0x1d4)])));}!_0x4af5ed&&(console[_0x539c9b(0x225)]('\x0a\x20\x20No\x20active\x20profile\x20set'),console[_0x539c9b(0x225)]('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x2a4321['map'](_0x19b65d=>_0x19b65d[_0x539c9b(0x1e3)])['join'](',\x20')+')'));}console['log']('');}
|
package/build/commands/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x1046d2=_0x14b9;(function(_0xa49fa6,_0x46277d){const _0x586522=_0x14b9,_0x480f3b=_0xa49fa6();while(!![]){try{const _0x33b5eb=-parseInt(_0x586522(0xb9))/0x1+parseInt(_0x586522(0xe9))/0x2*(-parseInt(_0x586522(0x9b))/0x3)+parseInt(_0x586522(0xc7))/0x4*(parseInt(_0x586522(0xd6))/0x5)+parseInt(_0x586522(0xc8))/0x6+-parseInt(_0x586522(0xa1))/0x7+parseInt(_0x586522(0xdb))/0x8*(-parseInt(_0x586522(0xe3))/0x9)+parseInt(_0x586522(0xe4))/0xa;if(_0x33b5eb===_0x46277d)break;else _0x480f3b['push'](_0x480f3b['shift']());}catch(_0x2091ea){_0x480f3b['push'](_0x480f3b['shift']());}}}(_0x2493,0xd460b));import{spawn}from'child_process';import{existsSync}from'fs';import{readFile,writeFile}from'fs/promises';function _0x2493(){const _0x590e3c=['183075SRJUpE','cHVXQ','\x20channel.','test','sQWYQ','212632XcdbPo','error','length','qzXYc','project','Update\x20failed:\x20','vmJIO','DjLna','333pXhDDX','18044120VqLjCg','uSmCv','JOcmn','install','marketplace','2264nxQErq','timeoutMs','stdio','plugin','NfxON','trailhead',')\x20is\x20newer\x20than\x20the\x20published\x20version\x20(','active-profile.txt',').\x20Staying\x20on\x20','645jgrPNF','latest','.gitignore','Update\x20failed.','Checking\x20for\x20updates...','\x0aYou\x20are\x20already\x20on\x20the\x20latest\x20version.','8148644pCNJlr','\x0aYour\x20version\x20(','win32','\x20ranger-managed\x20skill(s)...','CAaUg','\x0aClaude\x20plugin\x20updated\x20(project\x20scope).','yveay','vkqwB','ranger@trailhead','\x0a✅\x20Update\x20complete!','splice','\x0aSuccessfully\x20installed\x20','\x0aInstalling\x20','push','QxQcc','\x20—\x20reinstalling\x20@','paVQR','EAzAC','Latest\x20version:\x20\x20','\x0aReinstalling\x20','user','ABtPD','qVTFc','oTgCv','571958lEoUha','Claude\x20marketplace\x20update\x20command\x20failed\x20(timed\x20out,\x20failed\x20to\x20start,\x20or\x20exited\x20with\x20a\x20non-zero\x20status).','split','update','\x0aCould\x20not\x20check\x20latest\x20version:\x20','uGUpo','KaKEk','...','Prerelease\x20channel\x20detected\x20(@','\x20skill\x20','...\x0a','local','fNWGQ','inherit','124clrXVd','5359650dXkyWl','findIndex','alpha','log','Attempting\x20install\x20anyway...','HGsOe','yPjGv','claude','igVAq','EVogc','platform','nOCnE','CgXPz','\x0aClaude\x20plugin\x20updated\x20(user\x20scope).'];_0x2493=function(){return _0x590e3c;};return _0x2493();}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';function _0x14b9(_0xb9e3b4,_0x423daa){_0xb9e3b4=_0xb9e3b4-0x95;const _0x249365=_0x2493();let _0x14b952=_0x249365[_0xb9e3b4];return _0x14b952;}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(_0x50fdbc,_0x584a5f,_0x280192){const _0x5c641b=_0x14b9,_0x3ac5f3={'LXYLQ':function(_0x52add7,_0xb6a680){return _0x52add7(_0xb6a680);},'jxjGM':function(_0x4322d4,_0x39906f){return _0x4322d4(_0x39906f);},'vkqwB':function(_0x489717,_0x14c522,_0x1a15a7,_0x363452){return _0x489717(_0x14c522,_0x1a15a7,_0x363452);},'vmJIO':_0x5c641b(0xc6),'kXWFf':function(_0x489101,_0x255cd3){return _0x489101===_0x255cd3;},'RcdcJ':function(_0x11356e,_0x264484,_0x3a67ec){return _0x11356e(_0x264484,_0x3a67ec);},'jexuz':'close','LESKb':'error'};return new Promise(_0x272e27=>{const _0x388583=_0x5c641b,_0x52d137={'qVTFc':function(_0x8964b9,_0x261a0b){return _0x3ac5f3['LXYLQ'](_0x8964b9,_0x261a0b);},'HGsOe':function(_0x8bd73d,_0x28d820){return _0x8bd73d(_0x28d820);},'QxQcc':function(_0x35d3ec,_0x18aa38){return _0x3ac5f3['jxjGM'](_0x35d3ec,_0x18aa38);}};let _0x2c437a=![],_0x392d08;const _0x516d09=_0x46536d=>{if(_0x2c437a)return;_0x2c437a=!![],_0x392d08&&clearTimeout(_0x392d08),_0x272e27(_0x46536d);},_0x417d07=_0x3ac5f3[_0x388583(0xa8)](spawn,_0x50fdbc,_0x584a5f,{'stdio':['ignore',_0x280192?.[_0x388583(0xeb)]??_0x3ac5f3[_0x388583(0xe1)],_0x280192?.['stdio']??_0x3ac5f3['vmJIO']],'cwd':_0x280192?.['cwd'],'shell':_0x3ac5f3['kXWFf'](process['platform'],_0x388583(0xa3))});_0x392d08=_0x280192?.[_0x388583(0xea)]?_0x3ac5f3['RcdcJ'](setTimeout,()=>{const _0x1d9d4b=_0x388583;_0x417d07['kill'](),_0x417d07['unref'](),_0x52d137[_0x1d9d4b(0xb7)](_0x516d09,![]);},_0x280192[_0x388583(0xea)]):undefined,_0x417d07['on'](_0x3ac5f3['jexuz'],_0x145fd1=>{const _0x7e4f9d=_0x388583;_0x52d137[_0x7e4f9d(0xcd)](_0x516d09,_0x145fd1===0x0);}),_0x417d07['on'](_0x3ac5f3['LESKb'],()=>{const _0x48139b=_0x388583;_0x52d137[_0x48139b(0xaf)](_0x516d09,![]);});});}export function resolveDistTag(_0x1ed8a1){const _0x1c8fb3=_0x14b9,_0x2f3182={'EMOAT':'latest'};if(/-alpha\./i['test'](_0x1ed8a1))return _0x1c8fb3(0xca);if(/-beta\./i[_0x1c8fb3(0xd9)](_0x1ed8a1))return'beta';if(/-rc\./i[_0x1c8fb3(0xd9)](_0x1ed8a1))return'rc';return _0x2f3182['EMOAT'];}async function runInstall(_0x359b26=_0x1046d2(0x9c)){const _0x298338=_0x1046d2,_0x1a86d1={'CAaUg':'npm','xMXND':_0x298338(0xe7),'EVogc':'ignore','GScDg':function(_0x466673,_0x3d3cb3){return _0x466673===_0x3d3cb3;},'igVAq':'win32'};return new Promise(_0x29bafd=>{const _0x39f251=_0x298338;console[_0x39f251(0xcb)](_0x39f251(0xad)+PACKAGE_NAME+'@'+_0x359b26+_0x39f251(0xc3));const _0x25ff21=spawn(_0x1a86d1[_0x39f251(0xa5)],[_0x1a86d1['xMXND'],'-g',PACKAGE_NAME+'@'+_0x359b26],{'stdio':[_0x1a86d1[_0x39f251(0xd1)],_0x39f251(0xc6),'inherit'],'shell':_0x1a86d1['GScDg'](process[_0x39f251(0xd2)],_0x1a86d1[_0x39f251(0xd0)])});_0x25ff21['on']('close',_0x14af9f=>{_0x29bafd(_0x14af9f===0x0);}),_0x25ff21['on']('error',()=>{_0x29bafd(![]);});});}async function updateClaudeMarketplace(){const _0x592dc2=_0x1046d2,_0x37c5e0={'hJTac':'claude','CgXPz':_0x592dc2(0xe8),'aNlNN':_0x592dc2(0xbc),'JgClY':_0x592dc2(0xba)},_0x118632=await runCommand(_0x37c5e0['hJTac'],[_0x592dc2(0x95),_0x37c5e0[_0x592dc2(0xd4)],_0x37c5e0['aNlNN'],'trailhead'],{'timeoutMs':CLAUDE_COMMAND_TIMEOUT_MS});if(!_0x118632)throw new Error(_0x37c5e0['JgClY']);}async function updateClaudePlugin(_0x2c5ab3=_0x1046d2(0xb5)){const _0x49651d=_0x1046d2,_0x5e90e0={'xuDXw':_0x49651d(0x95),'sQWYQ':_0x49651d(0xbc),'LWpgX':'user','DjLna':_0x49651d(0xcf),'nOCnE':function(_0x59a55c,_0x304fc2){return _0x59a55c===_0x304fc2;},'vzaJO':'project','ZQIvQ':function(_0x1c149c,_0x1d4144){return _0x1c149c===_0x1d4144;}},_0x1fcf8d=[_0x5e90e0['xuDXw'],_0x5e90e0[_0x49651d(0xda)],_0x49651d(0xa9)];_0x2c5ab3!==_0x5e90e0['LWpgX']&&_0x1fcf8d['push']('--scope',_0x2c5ab3);const _0x9ce9b2=await runCommand(_0x5e90e0[_0x49651d(0xe2)],_0x1fcf8d,{'timeoutMs':CLAUDE_COMMAND_TIMEOUT_MS,'cwd':_0x5e90e0[_0x49651d(0xd3)](_0x2c5ab3,_0x5e90e0['vzaJO'])||_0x5e90e0['ZQIvQ'](_0x2c5ab3,_0x49651d(0xc4))?getProjectRoot():undefined});if(!_0x9ce9b2)throw new Error('Claude\x20plugin\x20update\x20failed\x20for\x20'+_0x2c5ab3+'\x20scope\x20(timed\x20out,\x20failed\x20to\x20start,\x20or\x20exited\x20with\x20a\x20non-zero\x20status).');}function isSkillInstalled(_0x3eafe6,_0x513675,_0x227ec5){const _0x4381fc={'HapSj':function(_0x2122b0,_0x109f8e){return _0x2122b0===_0x109f8e;},'jczgI':function(_0x5724b3,_0x90ec6d){return _0x5724b3(_0x90ec6d);},'SRtut':function(_0x56b22b,_0x43c311){return _0x56b22b(_0x43c311);}},_0x4bd216=_0x4381fc['HapSj'](_0x227ec5,'opencode')?getOpencodeSkillsDir(_0x513675):_0x4381fc['jczgI'](getSkillsDir,_0x513675),_0x25d1bb=join(_0x4bd216,_0x3eafe6);return _0x4381fc['SRtut'](existsSync,_0x25d1bb);}async function reinstallSkills(_0x53580e){const _0x3bb2b7=_0x1046d2,_0x504785={'ykpLy':function(_0x4e4aa4,_0x32f566,_0x4d3eaa,_0x33e105){return _0x4e4aa4(_0x32f566,_0x4d3eaa,_0x33e105);},'paVQR':'claude','HcVkS':function(_0x49ace9,_0x1bc328,_0x214b44){return _0x49ace9(_0x1bc328,_0x214b44);},'cHVXQ':function(_0x143079,_0x61018){return _0x143079===_0x61018;}},_0x444243=[_0x3bb2b7(0xdf),_0x3bb2b7(0xb5)],_0x41ffef=[];for(const _0x155cc2 of _0x444243){for(const _0x5e68e6 of RANGER_MANAGED_SKILLS){_0x504785['ykpLy'](isSkillInstalled,_0x5e68e6,_0x155cc2,'claude')&&_0x41ffef['push']({'skillName':_0x5e68e6,'level':_0x155cc2,'platform':_0x504785[_0x3bb2b7(0xb1)]}),_0x504785['ykpLy'](isSkillInstalled,_0x5e68e6,_0x155cc2,'opencode')&&_0x41ffef[_0x3bb2b7(0xae)]({'skillName':_0x5e68e6,'level':_0x155cc2,'platform':'opencode'});}}for(const _0x351f7d of _0x444243){for(const _0x3001ec of DEPRECATED_SKILLS){await _0x504785['HcVkS'](removeSkill,_0x3001ec,_0x351f7d);}}if(_0x504785[_0x3bb2b7(0xd7)](_0x41ffef['length'],0x0)){console[_0x3bb2b7(0xcb)]('\x0aNo\x20ranger-managed\x20skills\x20found\x20to\x20reinstall.');return;}console['log'](_0x3bb2b7(0xb4)+_0x41ffef[_0x3bb2b7(0xdd)]+_0x3bb2b7(0xa4));for(const {skillName:_0x1705ec,level:_0x23cd6b,platform:_0x401da3}of _0x41ffef){try{await installSkill(_0x1705ec,{'level':_0x23cd6b,'cliVersion':_0x53580e,'platform':_0x401da3});}catch(_0x5145e9){console['warn']('\x20\x20Failed\x20to\x20reinstall\x20'+_0x401da3+'\x20'+_0x23cd6b+_0x3bb2b7(0xc2)+_0x1705ec+':',_0x5145e9);}}}async function ensureActiveProfileGitignored(){const _0x224b31=_0x1046d2,_0x306909={'uGUpo':'active-profile.txt'},_0x4b28bd=join(getRangerDir(),_0x224b31(0x9d));if(!existsSync(_0x4b28bd))return![];let _0x1ee98e='';try{_0x1ee98e=await readFile(_0x4b28bd,'utf-8');}catch{return![];}const _0x3d061c=_0x1ee98e[_0x224b31(0xbb)](/\r?\n/);if(_0x3d061c['some'](_0x526990=>_0x526990['trim']()===_0x224b31(0x99)))return![];let _0x5b18ca=_0x3d061c[_0x224b31(0xc9)](_0x4b5b7d=>_0x4b5b7d['trim']()==='active-feature.txt');_0x5b18ca===-0x1&&(_0x5b18ca=_0x3d061c[_0x224b31(0xdd)]);_0x3d061c[_0x224b31(0xab)](_0x5b18ca,0x0,_0x306909[_0x224b31(0xbe)]);let _0x384613=_0x3d061c['join']('\x0a');!_0x384613['endsWith']('\x0a')&&(_0x384613+='\x0a');try{await writeFile(_0x4b28bd,_0x384613,'utf-8');}catch{return![];}return!![];}export async function update(){const _0x5b9bca=_0x1046d2,_0x5996ea={'uSmCv':function(_0xa44635,_0x393d3f){return _0xa44635!==_0x393d3f;},'yPjGv':function(_0x697003,_0x4984f3){return _0x697003(_0x4984f3);},'KaKEk':function(_0x1509d8){return _0x1509d8();},'fNWGQ':_0x5b9bca(0x9f),'ABtPD':_0x5b9bca(0xcc),'zdihb':'\x0aSuccessfully\x20installed\x20latest\x20version.','mEpvQ':function(_0x27b8dd,_0x105bde,_0x307166){return _0x27b8dd(_0x105bde,_0x307166);},'NfxON':function(_0x1319a3,_0x24609f){return _0x1319a3===_0x24609f;},'yveay':_0x5b9bca(0xa0),'Hpinl':function(_0x33d939,_0x5aa631){return _0x33d939<_0x5aa631;},'dtjFw':_0x5b9bca(0x9e),'xhakA':function(_0x2585b9,_0xb5f552){return _0x2585b9(_0xb5f552);},'qzXYc':_0x5b9bca(0x97),'gqDab':_0x5b9bca(0xa9),'EAzAC':function(_0x46519f){return _0x46519f();},'CmjWq':'\x0aClaude\x20marketplace\x20updated\x20(trailhead).','gnBkU':function(_0x5df67f,_0x891e){return _0x5df67f(_0x891e);},'oTgCv':'project','JOcmn':_0x5b9bca(0xa6),'ysAEp':_0x5b9bca(0xd5),'aQBzd':function(_0x12022b){return _0x12022b();}},_0x386eae=getCurrentVersion();console['log']('\x0aCurrent\x20version:\x20'+_0x386eae);const _0x2a1ded=resolveDistTag(_0x386eae);if(_0x5996ea[_0x5b9bca(0xe5)](_0x2a1ded,_0x5b9bca(0x9c))){console[_0x5b9bca(0xcb)](_0x5b9bca(0xc1)+_0x2a1ded+_0x5b9bca(0x9a)+_0x2a1ded+_0x5b9bca(0xb0)+_0x2a1ded+_0x5b9bca(0xc0));const _0x117945=await _0x5996ea['yPjGv'](runInstall,_0x2a1ded);if(!_0x117945)throw new Error('Update\x20failed\x20for\x20@'+_0x2a1ded+_0x5b9bca(0xd8));const _0x44d4d7=getCurrentVersion();console['log'](_0x5b9bca(0xac)+PACKAGE_NAME+'@'+_0x2a1ded+'.'),await reinstallSkills(_0x44d4d7),await _0x5996ea[_0x5b9bca(0xbf)](ensureActiveProfileGitignored),console[_0x5b9bca(0xcb)]('\x0a✅\x20Update\x20complete!');return;}console[_0x5b9bca(0xcb)](_0x5996ea[_0x5b9bca(0xc5)]);const _0x30e82b=_0x5996ea['KaKEk'](getLatestVersion);let _0x1bb69b=_0x386eae;if(!_0x30e82b['version']){console['warn'](_0x5b9bca(0xbd)+_0x30e82b[_0x5b9bca(0xdc)]),console['log'](_0x5996ea[_0x5b9bca(0xb6)]);const _0x267717=await runInstall();if(_0x267717)console['log'](_0x5996ea['zdihb']),_0x1bb69b=getCurrentVersion();else throw new Error(_0x5b9bca(0xe0)+_0x30e82b['error']);}else{const _0x21455a=_0x30e82b['version'];console['log'](_0x5b9bca(0xb3)+_0x21455a);const _0x30994d=_0x5996ea['mEpvQ'](compareVersions,_0x386eae,_0x21455a);if(_0x5996ea[_0x5b9bca(0x96)](_0x30994d,0x0))console[_0x5b9bca(0xcb)](_0x5996ea[_0x5b9bca(0xa7)]);else{if(_0x5996ea['Hpinl'](_0x30994d,0x0))console['log'](_0x5b9bca(0xa2)+_0x386eae+_0x5b9bca(0x98)+_0x21455a+').');else{const _0x17f2f1=await runInstall();if(_0x17f2f1)console[_0x5b9bca(0xcb)]('\x0aSuccessfully\x20updated\x20to\x20version\x20'+_0x21455a),_0x1bb69b=_0x21455a;else throw new Error(_0x5996ea['dtjFw']);}}}await _0x5996ea['xhakA'](reinstallSkills,_0x1bb69b);const _0x3e2a3c=await _0x5996ea[_0x5b9bca(0xce)](isMarketplaceAdded,_0x5996ea[_0x5b9bca(0xde)]),_0x3b67d6=await isPluginInstalled(_0x5996ea['gqDab']);_0x3e2a3c&&(await _0x5996ea[_0x5b9bca(0xb2)](updateClaudeMarketplace),console['log'](_0x5996ea['CmjWq']));if(_0x3b67d6){const _0x4bcdf9=await _0x5996ea['gnBkU'](getPluginInfo,'ranger@trailhead'),_0x130d60=_0x4bcdf9?.['scope']??'user';await _0x5996ea['yPjGv'](updateClaudePlugin,_0x130d60);if(_0x130d60===_0x5996ea[_0x5b9bca(0xb8)])console['log'](_0x5996ea[_0x5b9bca(0xe6)]);else _0x130d60==='local'?console[_0x5b9bca(0xcb)]('\x0aClaude\x20plugin\x20updated\x20(local\x20scope).'):console['log'](_0x5996ea['ysAEp']);}const _0x581b72=await _0x5996ea['aQBzd'](ensureActiveProfileGitignored);console['log'](_0x5b9bca(0xaa));}
|
|
1
|
+
(function(_0xcc81a8,_0x1b87fb){const _0xb40764=_0x4359,_0x35fc7f=_0xcc81a8();while(!![]){try{const _0x3cb0d5=-parseInt(_0xb40764(0x1fa))/0x1*(parseInt(_0xb40764(0x208))/0x2)+-parseInt(_0xb40764(0x1e9))/0x3+parseInt(_0xb40764(0x1e1))/0x4+parseInt(_0xb40764(0x1f9))/0x5+-parseInt(_0xb40764(0x21a))/0x6+-parseInt(_0xb40764(0x212))/0x7*(-parseInt(_0xb40764(0x204))/0x8)+-parseInt(_0xb40764(0x221))/0x9;if(_0x3cb0d5===_0x1b87fb)break;else _0x35fc7f['push'](_0x35fc7f['shift']());}catch(_0x49e4b0){_0x35fc7f['push'](_0x35fc7f['shift']());}}}(_0x3f48,0xe673a));import{spawn}from'child_process';import{existsSync}from'fs';import{readFile,writeFile}from'fs/promises';function _0x4359(_0xc0dc22,_0x12bf32){_0xc0dc22=_0xc0dc22-0x1e1;const _0x3f483d=_0x3f48();let _0x435969=_0x3f483d[_0xc0dc22];return _0x435969;}import{installSkill,removeSkill,RANGER_MANAGED_SKILLS,DEPRECATED_SKILLS}from'./utils/skills.js';import{PACKAGE_NAME,getCurrentVersion,getLatestVersion,compareVersions}from'./utils/version.js';import{getSkillsDir}from'./utils/claudeConfig.js';import{getOpencodeSkillsDir}from'./utils/opencodeConfig.js';import{join}from'path';import{migrateActiveProfileFile}from'./utils/activeProfile.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getPluginInfo,isMarketplaceAdded,isPluginInstalled}from'./utils/claudePlugin.js';const CLAUDE_COMMAND_TIMEOUT_MS=0x1d4c0;async function runCommand(_0x251be2,_0x20b646,_0x27b26b){const _0x2621bb={'OvDBL':function(_0x460560,_0x2500ba){return _0x460560(_0x2500ba);},'hiYAf':'ignore','dDpsl':'inherit','btOKW':function(_0x80f6c8,_0x29811f,_0x272e95){return _0x80f6c8(_0x29811f,_0x272e95);},'yCcjL':'error'};return new Promise(_0x13703f=>{const _0x3163cc=_0x4359,_0x2b3008={'WlwEm':function(_0x22b249,_0x3d65e1){return _0x2621bb['OvDBL'](_0x22b249,_0x3d65e1);},'DPAKe':function(_0x40d24a,_0x1b936b){return _0x40d24a===_0x1b936b;}};let _0x263c67=![],_0x10fa3c;const _0x3f2192=_0x35ca88=>{if(_0x263c67)return;_0x263c67=!![],_0x10fa3c&&clearTimeout(_0x10fa3c),_0x13703f(_0x35ca88);},_0x124a15=spawn(_0x251be2,_0x20b646,{'stdio':[_0x2621bb['hiYAf'],_0x27b26b?.[_0x3163cc(0x1f5)]??_0x2621bb['dDpsl'],_0x27b26b?.['stdio']??'inherit'],'shell':process[_0x3163cc(0x207)]==='win32'});_0x10fa3c=_0x27b26b?.[_0x3163cc(0x1f1)]?_0x2621bb[_0x3163cc(0x21c)](setTimeout,()=>{const _0x564f8c=_0x3163cc;_0x124a15[_0x564f8c(0x1fe)](),_0x124a15[_0x564f8c(0x1e7)](),_0x2b3008['WlwEm'](_0x3f2192,![]);},_0x27b26b['timeoutMs']):undefined,_0x124a15['on'](_0x3163cc(0x1ea),_0x3016c9=>{const _0x54182c=_0x3163cc;_0x3f2192(_0x2b3008[_0x54182c(0x20d)](_0x3016c9,0x0));}),_0x124a15['on'](_0x2621bb[_0x3163cc(0x1ef)],()=>{_0x3f2192(![]);});});}export function resolveInstallTarget(_0x4f2e3a){const _0x5afc89=_0x4359,_0x44ff20=_0x4f2e3a[_0x5afc89(0x210)]('.')[0x0],_0x19b47b=parseInt(_0x44ff20,0xa);if(!Number['isFinite'](_0x19b47b))return'latest';return'^'+_0x19b47b+_0x5afc89(0x1e2);}async function runInstall(_0x56bb1e){const _0x18c8f9=_0x4359,_0x3d767d={'ivfEE':function(_0x5e410c,_0x44f4fb){return _0x5e410c(_0x44f4fb);},'DXwGa':function(_0x208d9d,_0x487656){return _0x208d9d===_0x487656;},'SpADa':function(_0x1aadae,_0x59d37f){return _0x1aadae(_0x59d37f);},'Fyppc':_0x18c8f9(0x201)},_0x1b04cb=resolveInstallTarget(_0x56bb1e);return new Promise(_0x8a4859=>{const _0x5c2822=_0x18c8f9;console[_0x5c2822(0x1f0)]('\x0aInstalling\x20'+PACKAGE_NAME+'@'+_0x1b04cb+'...\x0a');const _0x2477dc=spawn('npm',[_0x3d767d['Fyppc'],'-g',PACKAGE_NAME+'@'+_0x1b04cb],{'stdio':[_0x5c2822(0x1ee),_0x5c2822(0x1f4),'inherit'],'shell':process['platform']==='win32'});_0x2477dc['on'](_0x5c2822(0x1ea),_0x26f7db=>{const _0x3cb83a=_0x5c2822;_0x3d767d[_0x3cb83a(0x1f7)](_0x8a4859,_0x3d767d[_0x3cb83a(0x200)](_0x26f7db,0x0));}),_0x2477dc['on']('error',()=>{const _0xf475bb=_0x5c2822;_0x3d767d[_0xf475bb(0x206)](_0x8a4859,![]);});});}async function updateClaudeMarketplace(){const _0x4a2b2d=_0x4359,_0x377855={'fqwBp':_0x4a2b2d(0x1e4),'qEQGY':'update','HbRmN':'Claude\x20marketplace\x20update\x20command\x20failed\x20(timed\x20out,\x20failed\x20to\x20start,\x20or\x20exited\x20with\x20a\x20non-zero\x20status).'},_0x18c7fc=await runCommand(_0x4a2b2d(0x1fd),[_0x377855['fqwBp'],_0x4a2b2d(0x215),_0x377855[_0x4a2b2d(0x211)],_0x4a2b2d(0x1ed)],{'timeoutMs':CLAUDE_COMMAND_TIMEOUT_MS});if(!_0x18c7fc)throw new Error(_0x377855['HbRmN']);}async function updateClaudePlugin(_0x1a2f15){const _0xea45bf=_0x4359,_0x4cd5a1={'uloud':_0xea45bf(0x1ff),'NQFiw':'--scope','lnvTi':function(_0x3afba0,_0x271e80,_0xabd74d,_0x359f40){return _0x3afba0(_0x271e80,_0xabd74d,_0x359f40);},'Guboy':'claude','vGGOz':'user'},_0x1b6bae=['plugin',_0x4cd5a1['uloud'],'ranger@trailhead'];_0x1a2f15&&_0x1b6bae[_0xea45bf(0x21e)](_0x4cd5a1[_0xea45bf(0x216)],_0x1a2f15);const _0x3e7999=await _0x4cd5a1['lnvTi'](runCommand,_0x4cd5a1[_0xea45bf(0x209)],_0x1b6bae,{'timeoutMs':CLAUDE_COMMAND_TIMEOUT_MS});if(!_0x3e7999){const _0x1464d2=_0x1a2f15??_0x4cd5a1[_0xea45bf(0x227)];throw new Error('Claude\x20plugin\x20update\x20failed\x20for\x20'+_0x1464d2+_0xea45bf(0x21b));}}function isSkillInstalled(_0x26cf11,_0x39efa5,_0x1d3727){const _0x510a22={'sQFyj':function(_0x3c236f,_0x2ff916){return _0x3c236f(_0x2ff916);}},_0x2f3a32=_0x1d3727==='opencode'?getOpencodeSkillsDir(_0x39efa5):getSkillsDir(_0x39efa5),_0x2ab453=join(_0x2f3a32,_0x26cf11);return _0x510a22['sQFyj'](existsSync,_0x2ab453);}function _0x3f48(){const _0xdcaa20=['Checking\x20for\x20updates...','trim','claude','kill','update','DXwGa','install','YthdW','\x0aSuccessfully\x20installed\x20latest\x20version.','56744VlcRFr','\x0aYour\x20version\x20(','SpADa','platform','24BXBwXv','Guboy','AIyOa','ranger@trailhead','tKlgq','DPAKe','zePoJ','opencode','split','qEQGY','1687qDHlRi','warn','kBRRP','marketplace','NQFiw','Latest\x20version:\x20\x20','VaJRz','wwiOZ','8323272GbxaiD','\x20scope\x20(timed\x20out,\x20failed\x20to\x20start,\x20or\x20exited\x20with\x20a\x20non-zero\x20status).','btOKW','\x0aClaude\x20plugin\x20updated\x20(project\x20scope).','push','\x0aCould\x20not\x20check\x20latest\x20version:\x20','CPdKR','224649jnXNls','error','\x0aSuccessfully\x20updated\x20to\x20version\x20','\x20skill\x20','length','DwAhI','vGGOz','SYrpA','Qtxyj','6525004opwWWo','.0.0','project','plugin','active-profile.txt','\x0a✅\x20Update\x20complete!','unref','Attempting\x20install\x20anyway...','1661217kSpxFX','close','BRUvL','\x0aNo\x20ranger-managed\x20skills\x20found\x20to\x20reinstall.','trailhead','ignore','yCcjL','log','timeoutMs','\x0aReinstalling\x20','HhWKh','inherit','stdio','OHYQk','ivfEE',')\x20is\x20newer\x20than\x20the\x20published\x20version\x20(','4019830wXUQKL','102899DkYssV'];_0x3f48=function(){return _0xdcaa20;};return _0x3f48();}async function reinstallSkills(_0x45937d){const _0x27aa7c=_0x4359,_0x3e2f3f={'YVsre':_0x27aa7c(0x1fd),'aeDsw':_0x27aa7c(0x20f),'xeyyf':function(_0x5d40c2,_0x5df9eb){return _0x5d40c2===_0x5df9eb;}},_0xe1d9ac=[_0x27aa7c(0x1e3),'user'],_0x5a3e65=[];for(const _0x33345b of _0xe1d9ac){for(const _0x442a0c of RANGER_MANAGED_SKILLS){isSkillInstalled(_0x442a0c,_0x33345b,_0x3e2f3f['YVsre'])&&_0x5a3e65[_0x27aa7c(0x21e)]({'skillName':_0x442a0c,'level':_0x33345b,'platform':_0x3e2f3f['YVsre']}),isSkillInstalled(_0x442a0c,_0x33345b,'opencode')&&_0x5a3e65[_0x27aa7c(0x21e)]({'skillName':_0x442a0c,'level':_0x33345b,'platform':_0x3e2f3f['aeDsw']});}}for(const _0x5ddaed of _0xe1d9ac){for(const _0x5efc94 of DEPRECATED_SKILLS){await removeSkill(_0x5efc94,_0x5ddaed);}}if(_0x3e2f3f['xeyyf'](_0x5a3e65[_0x27aa7c(0x225)],0x0)){console['log'](_0x27aa7c(0x1ec));return;}console['log'](_0x27aa7c(0x1f2)+_0x5a3e65[_0x27aa7c(0x225)]+'\x20ranger-managed\x20skill(s)...');for(const {skillName:_0x5ace24,level:_0x1b10e2,platform:_0x13001b}of _0x5a3e65){try{await installSkill(_0x5ace24,{'level':_0x1b10e2,'cliVersion':_0x45937d,'platform':_0x13001b});}catch(_0x18ecfa){console[_0x27aa7c(0x213)]('\x20\x20Failed\x20to\x20reinstall\x20'+_0x13001b+'\x20'+_0x1b10e2+_0x27aa7c(0x224)+_0x5ace24+':',_0x18ecfa);}}}async function ensureActiveProfileGitignored(){const _0x4dd5a4=_0x4359,_0x4638f={'OHYQk':function(_0x34ecd1,_0x1c100e,_0x145dec){return _0x34ecd1(_0x1c100e,_0x145dec);},'HhWKh':'utf-8','mIamh':function(_0x54a7e4,_0x1006cf){return _0x54a7e4===_0x1006cf;}},_0x17fb02=_0x4638f[_0x4dd5a4(0x1f6)](join,getRangerDir(),'.gitignore');if(!existsSync(_0x17fb02))return![];let _0xa26065='';try{_0xa26065=await readFile(_0x17fb02,_0x4638f['HhWKh']);}catch{return![];}const _0x238924=_0xa26065[_0x4dd5a4(0x210)](/\r?\n/);if(_0x238924['some'](_0xff0f29=>_0xff0f29[_0x4dd5a4(0x1fc)]()===_0x4dd5a4(0x1e5)))return![];let _0x43c3b1=_0x238924['findIndex'](_0x4ee66b=>_0x4ee66b['trim']()==='active-feature.txt');_0x4638f['mIamh'](_0x43c3b1,-0x1)&&(_0x43c3b1=_0x238924[_0x4dd5a4(0x225)]);_0x238924['splice'](_0x43c3b1,0x0,_0x4dd5a4(0x1e5));let _0x22763b=_0x238924['join']('\x0a');!_0x22763b['endsWith']('\x0a')&&(_0x22763b+='\x0a');try{await writeFile(_0x17fb02,_0x22763b,_0x4638f[_0x4dd5a4(0x1f3)]);}catch{return![];}return!![];}export async function update(){const _0x97377c=_0x4359,_0x49dc65={'YthdW':function(_0x1f395f){return _0x1f395f();},'iiokS':_0x97377c(0x1fb),'eiDGL':function(_0x115894,_0x5132b3){return _0x115894(_0x5132b3);},'zePoJ':function(_0x1d731e,_0x4b689b){return _0x1d731e<_0x4b689b;},'SYrpA':function(_0x3ecf89,_0x478b4f){return _0x3ecf89(_0x478b4f);},'dZDFr':function(_0x5beb5f,_0x27b757){return _0x5beb5f(_0x27b757);},'BRUvL':function(_0x24d2f5,_0x51eca9){return _0x24d2f5(_0x51eca9);},'kBRRP':function(_0x58c9ff,_0x3a9379){return _0x58c9ff(_0x3a9379);},'tKlgq':_0x97377c(0x20b),'Qtxyj':function(_0x156c02){return _0x156c02();},'AIyOa':function(_0x34587b,_0x3a8b73){return _0x34587b===_0x3a8b73;},'DwAhI':function(_0x90b343,_0x22a280){return _0x90b343(_0x22a280);},'CPdKR':function(_0x1bb525){return _0x1bb525();},'VaJRz':'\x0aClaude\x20plugin\x20updated\x20(user\x20scope).','wwiOZ':'✓\x20Migrated\x20active\x20profile\x20file'},_0x4692e7=_0x49dc65[_0x97377c(0x202)](getCurrentVersion);console['log']('\x0aCurrent\x20version:\x20'+_0x4692e7),console[_0x97377c(0x1f0)](_0x49dc65['iiokS']);const _0x1c893e=_0x4692e7[_0x97377c(0x210)]('.')[0x0],_0x4a5764=parseInt(_0x1c893e,0xa),_0x17a268=Number['isFinite'](_0x4a5764)?_0x4a5764:undefined,_0x334ec4=getLatestVersion(_0x17a268);let _0x535e89=_0x4692e7;if(!_0x334ec4['version']){console['warn'](_0x97377c(0x21f)+_0x334ec4[_0x97377c(0x222)]),console[_0x97377c(0x1f0)](_0x97377c(0x1e8));const _0x409a20=await _0x49dc65['eiDGL'](runInstall,_0x4692e7);if(_0x409a20)console[_0x97377c(0x1f0)](_0x97377c(0x203)),_0x535e89=getCurrentVersion();else throw new Error('Update\x20failed:\x20'+_0x334ec4[_0x97377c(0x222)]);}else{const _0x491f6a=_0x334ec4['version'];console[_0x97377c(0x1f0)](_0x97377c(0x217)+_0x491f6a);const _0xda0116=compareVersions(_0x4692e7,_0x491f6a);if(_0xda0116===0x0)console['log']('\x0aYou\x20are\x20already\x20on\x20the\x20latest\x20version.');else{if(_0x49dc65[_0x97377c(0x20e)](_0xda0116,0x0))console[_0x97377c(0x1f0)](_0x97377c(0x205)+_0x4692e7+_0x97377c(0x1f8)+_0x491f6a+').');else{const _0x146a69=await _0x49dc65[_0x97377c(0x228)](runInstall,_0x4692e7);if(_0x146a69)console['log'](_0x97377c(0x223)+_0x491f6a),_0x535e89=_0x491f6a;else throw new Error('Update\x20failed.');}}}await _0x49dc65['dZDFr'](reinstallSkills,_0x535e89);const _0x381fad=await _0x49dc65[_0x97377c(0x1eb)](isMarketplaceAdded,'trailhead'),_0x473574=await _0x49dc65[_0x97377c(0x214)](isPluginInstalled,_0x49dc65[_0x97377c(0x20c)]);_0x381fad&&(await _0x49dc65[_0x97377c(0x229)](updateClaudeMarketplace),console['log']('\x0aClaude\x20marketplace\x20updated\x20(trailhead).'));if(_0x473574){const _0x1f0957=await getPluginInfo('ranger@trailhead');_0x49dc65[_0x97377c(0x20a)](_0x1f0957?.['scope'],_0x97377c(0x1e3))?(await _0x49dc65[_0x97377c(0x226)](updateClaudePlugin,_0x97377c(0x1e3)),console[_0x97377c(0x1f0)](_0x97377c(0x21d))):(await _0x49dc65[_0x97377c(0x220)](updateClaudePlugin),console[_0x97377c(0x1f0)](_0x49dc65[_0x97377c(0x218)]));}const _0x1edfe9=await _0x49dc65[_0x97377c(0x220)](migrateActiveProfileFile);_0x1edfe9&&console['log'](_0x49dc65[_0x97377c(0x219)]);const _0x3e68a2=await ensureActiveProfileGitignored();console[_0x97377c(0x1f0)](_0x97377c(0x1e6));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x45ee2b,_0x3cf399){const _0x945f9e=_0x1d24,_0x2f1c8e=_0x45ee2b();while(!![]){try{const _0x2b3619=-parseInt(_0x945f9e(0x189))/0x1+parseInt(_0x945f9e(0x171))/0x2+parseInt(_0x945f9e(0x185))/0x3+parseInt(_0x945f9e(0x16e))/0x4+-parseInt(_0x945f9e(0x183))/0x5*(parseInt(_0x945f9e(0x15e))/0x6)+-parseInt(_0x945f9e(0x17c))/0x7+-parseInt(_0x945f9e(0x16a))/0x8;if(_0x2b3619===_0x3cf399)break;else _0x2f1c8e['push'](_0x2f1c8e['shift']());}catch(_0x15afab){_0x2f1c8e['push'](_0x2f1c8e['shift']());}}}(_0x40cd,0x4b522));function _0x1d24(_0x541055,_0x266a77){_0x541055=_0x541055-0x158;const _0x40cda8=_0x40cd();let _0x1d245d=_0x40cda8[_0x541055];return _0x1d245d;}import{writeFile,readFile,unlink}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{chromium}from'playwright';import{encrypt}from'./utils/crypto.js';import{getToken}from'./utils/keychain.js';import{buildBrowserOptionsFromSettings,getEnvDir,isEnvCi,resolveEnvVars}from'./utils/settings.js';function _0x40cd(){const _0xa53559=['auth.json','DUJNw','2082khSrdw','\x22\x20authentication\x20updated','baseUrl','pRdte','Non-interactive\x20mode\x20detected.\x0aThe\x20\x22ranger\x20profile\x20update\x22\x20command\x20requires\x20interactive\x20browser\x20authentication\x20and\x20cannot\x20be\x20run\x20in\x20non-TTY\x20environments\x20(CI,\x20scripts,\x20Claude\x20Code).\x0aTo\x20update\x20profile\x20authentication:\x0a\x20\x201.\x20Run\x20\x22ranger\x20profile\x20update\x20<name>\x22\x20in\x20an\x20interactive\x20terminal\x0a\x20\x202.\x20Commit\x20the\x20updated\x20encrypted\x20auth\x20file\x20to\x20git','\x20safeMode\x20true\x0a','pvaqY','config_write','\x20\x20Run\x20ranger\x20setup\x20in\x20CI\x20to\x20decrypt\x20at\x20runtime.','\x0a📋\x20Authentication\x20Update','Laqmc','✓\x20Auth\x20state\x20saved\x20to:\x20','4598280cTughq','BWVHm','YcxUl','allowInsecureLocalhost','1424868RrXDNr','.enc','Profile\x20\x22','1163626kuLWNE','close','log','cqZUt','sAiZs','\x0a✅\x20Profile\x20\x22','qTJzt','contextOptions','newContext','BRTDi','Saving\x20authentication\x20state...','1315538aDsokI','error','launch','trackPhaseEnd','safeMode','utf-8','browser','3115HswmkV','\x20\x20Could\x20not\x20encrypt:\x20No\x20API\x20token\x20found.\x20Run:\x20ranger\x20setup\x20[token]','1605666plAXEG','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','EaDet','XdVoj','185838QlgkWw','stdout','trackPhaseStart','extraHTTPHeaders','✓\x20Updated\x20config:\x20','\x0aThe\x20browser\x20closed\x20unexpectedly\x20before\x20authentication\x20could\x20be\x20saved.','\x20\x20\x20Update\x20your\x20authentication\x20as\x20needed.','This\x20can\x20happen\x20due\x20to\x20a\x20browser\x20compatibility\x20issue\x20on\x20some\x20systems.\x0a'];_0x40cd=function(){return _0xa53559;};return _0x40cd();}import{addProfileSetupBanner}from'./utils/profileSetupBanner.js';export async function updateEnv(_0x3b6659,_0x3817e3,_0x5c4fa8){const _0x5eb912=_0x1d24,_0x1c6c78={'BxdEm':function(_0x19651b){return _0x19651b();},'Vfhea':_0x5eb912(0x172),'IoxFU':function(_0x224ed3,_0x58cfbd,_0x3a4ef8){return _0x224ed3(_0x58cfbd,_0x3a4ef8);},'BWVHm':'settings.json','pvaqY':function(_0x5a0b73,_0x463c38){return _0x5a0b73+_0x463c38;},'KNsPW':_0x5eb912(0x16f),'WEBvw':'browser_auth','DUJNw':_0x5eb912(0x167),'XdVoj':'\x20\x20\x20A\x20browser\x20will\x20open\x20with\x20your\x20existing\x20session\x20(if\x20any).','YcxUl':'\x20\x20\x20When\x20you\x20are\x20done,\x20close\x20the\x20browser.\x0a','pRdte':function(_0x44faee,_0x1902cd,_0x72c179){return _0x44faee(_0x1902cd,_0x72c179);},'cqZUt':function(_0x36861f,_0x117941){return _0x36861f(_0x117941);},'wBdMO':function(_0x3f2a64,_0x36545e){return _0x3f2a64||_0x36545e;},'mJsxt':'about:blank','sAiZs':_0x5eb912(0x159),'brnen':_0x5eb912(0x15b),'xbEBX':_0x5eb912(0x186),'EaDet':_0x5eb912(0x181),'BRTDi':function(_0x4b2fe0){return _0x4b2fe0();},'qTJzt':function(_0x4792dd,_0x4ef0d7){return _0x4792dd(_0x4ef0d7);},'qxrwn':'\x20\x20You\x20can\x20safely\x20commit\x20this\x20file\x20to\x20git.','qNuLO':_0x5eb912(0x166),'Laqmc':_0x5eb912(0x165)},_0x350785=getEnvDir(_0x3b6659),_0x3dbbc3=_0x1c6c78['IoxFU'](join,_0x350785,_0x1c6c78[_0x5eb912(0x16b)]),_0x34f0e7=join(_0x350785,_0x5eb912(0x15c)),_0x52a849=_0x1c6c78[_0x5eb912(0x164)](_0x34f0e7,_0x1c6c78['KNsPW']),_0x1bdb45=process['stdin']['isTTY']&&process[_0x5eb912(0x18a)]['isTTY'];if(!_0x1bdb45)throw new Error(_0x5eb912(0x162));if(!existsSync(_0x350785))throw new Error(_0x5eb912(0x170)+_0x3b6659+'\x22\x20not\x20found.\x20Run\x20first:\x20ranger\x20profile\x20add\x20'+_0x3b6659);if(!existsSync(_0x3dbbc3))throw new Error('Config\x20not\x20found\x20at\x20'+_0x3dbbc3+'.\x20Run\x20first:\x20ranger\x20profile\x20add\x20'+_0x3b6659);const _0x2665a9=await readFile(_0x3dbbc3,'utf-8'),_0x2725b9=JSON['parse'](_0x2665a9),_0x531d54=resolveEnvVars(_0x2725b9),_0x1c20c6=typeof _0x531d54['baseUrl']==='string'?_0x531d54[_0x5eb912(0x160)]:undefined,_0x239497=existsSync(_0x34f0e7),_0x2c5980=isEnvCi(_0x3b6659);_0x3817e3?.[_0x5eb912(0x18b)](_0x1c6c78['WEBvw']),console['log'](_0x1c6c78[_0x5eb912(0x15d)]),console[_0x5eb912(0x173)](_0x1c6c78[_0x5eb912(0x188)]),console[_0x5eb912(0x173)](_0x5eb912(0x15a)),console[_0x5eb912(0x173)](_0x1c6c78[_0x5eb912(0x16c)]);const {launchOptions:_0x1d4f63,contextOptions:_0x55c37f}=_0x1c6c78[_0x5eb912(0x161)](buildBrowserOptionsFromSettings,_0x531d54,{'headless':![],'storageStatePath':_0x239497?_0x34f0e7:undefined});_0x531d54['setupHeaders']&&(_0x55c37f['extraHTTPHeaders']={..._0x55c37f[_0x5eb912(0x18c)],..._0x531d54['setupHeaders']});const _0x1a70ab=await chromium[_0x5eb912(0x17e)](_0x1d4f63);let _0x4c80d4=null;try{_0x4c80d4=await _0x1a70ab[_0x5eb912(0x179)](_0x55c37f),await _0x1c6c78[_0x5eb912(0x174)](addProfileSetupBanner,_0x4c80d4);const _0x2d8a85=await _0x4c80d4['newPage']();await _0x2d8a85['goto'](_0x1c6c78['wBdMO'](_0x1c20c6,_0x1c6c78['mJsxt']));let _0x22f720=![];await new Promise(_0x38e667=>{const _0x3d510f={'JslrP':function(_0x4a5b71){return _0x1c6c78['BxdEm'](_0x4a5b71);}};_0x2d8a85['on'](_0x1c6c78['Vfhea'],async()=>{const _0x384cdc=_0x1d24;try{console['log'](_0x384cdc(0x17b)),await _0x4c80d4?.['storageState']({'path':_0x34f0e7}),_0x22f720=!![];}catch{}_0x3d510f['JslrP'](_0x38e667);});});if(!_0x22f720){console[_0x5eb912(0x173)](_0x1c6c78[_0x5eb912(0x175)]);!_0x531d54[_0x5eb912(0x180)]&&(console[_0x5eb912(0x173)](_0x1c6c78['brnen']),console['log']('Enable\x20safe\x20mode\x20and\x20try\x20again:\x20ranger\x20profile\x20config\x20set\x20'+_0x3b6659+_0x5eb912(0x163)));throw new Error(_0x1c6c78['xbEBX']);}}finally{_0x4c80d4&&await _0x4c80d4['close']()['catch'](()=>{}),await _0x1a70ab[_0x5eb912(0x172)]()['catch'](()=>{});}if(_0x2c5980){const _0x33ac08=await readFile(_0x34f0e7,_0x1c6c78[_0x5eb912(0x187)]),_0x203029=await _0x1c6c78[_0x5eb912(0x17a)](getToken);if(!_0x203029)console[_0x5eb912(0x17d)](_0x5eb912(0x184)),console['log'](_0x5eb912(0x169)+_0x34f0e7);else{const _0x271fb5=encrypt(_0x33ac08,_0x203029);await writeFile(_0x52a849,_0x271fb5),await _0x1c6c78[_0x5eb912(0x177)](unlink,_0x34f0e7),console[_0x5eb912(0x173)]('✓\x20Encrypted\x20auth\x20saved\x20to:\x20'+_0x52a849),console['log'](_0x1c6c78['qxrwn']),console[_0x5eb912(0x173)](_0x1c6c78['qNuLO']);}}else console[_0x5eb912(0x173)](_0x5eb912(0x169)+_0x34f0e7);_0x3817e3?.[_0x5eb912(0x17f)]('browser_auth'),_0x3817e3?.[_0x5eb912(0x18b)](_0x1c6c78[_0x5eb912(0x168)]),_0x2725b9[_0x5eb912(0x182)]=_0x2725b9['browser']||{},_0x2725b9[_0x5eb912(0x182)]['contextOptions']=_0x2725b9['browser']['contextOptions']||{},_0x2725b9['browser'][_0x5eb912(0x178)]['storageState']=_0x34f0e7,_0x5c4fa8?.['allowInsecureLocalhost']===!![]&&(_0x2725b9[_0x5eb912(0x16d)]=!![]),await _0x1c6c78['IoxFU'](writeFile,_0x3dbbc3,JSON['stringify'](_0x2725b9,null,0x2)),console[_0x5eb912(0x173)](_0x5eb912(0x158)+_0x3dbbc3),_0x3817e3?.['trackPhaseEnd'](_0x1c6c78['Laqmc']),console['log'](_0x5eb912(0x176)+_0x3b6659+_0x5eb912(0x15f));}
|
package/build/commands/useEnv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x47bae0,_0x5d53b7){const _0x19d0fb=_0x1967,_0x229e37=_0x47bae0();while(!![]){try{const _0x4d547c=parseInt(_0x19d0fb(0xa5))/0x1*(parseInt(_0x19d0fb(0xa1))/0x2)+-parseInt(_0x19d0fb(0xaa))/0x3*(-parseInt(_0x19d0fb(0xa9))/0x4)+-parseInt(_0x19d0fb(0xa0))/0x5+-parseInt(_0x19d0fb(0xa2))/0x6+-parseInt(_0x19d0fb(0xae))/0x7*(parseInt(_0x19d0fb(0xa4))/0x8)+-parseInt(_0x19d0fb(0xac))/0x9+-parseInt(_0x19d0fb(0xb2))/0xa*(-parseInt(_0x19d0fb(0xb1))/0xb);if(_0x4d547c===_0x5d53b7)break;else _0x229e37['push'](_0x229e37['shift']());}catch(_0x2dced9){_0x229e37['push'](_0x229e37['shift']());}}}(_0x8076,0x2babe));function _0x1967(_0x548da7,_0x354105){_0x548da7=_0x548da7-0xa0;const _0x80761c=_0x8076();let _0x19679b=_0x80761c[_0x548da7];return _0x19679b;}import{join}from'path';import{existsSync}from'fs';import{getEnvDir}from'./utils/settings.js';import{writeActiveProfileName}from'./utils/activeProfile.js';function _0x8076(){const _0x2c1d0c=['settings.json','1924mGZSuv','141uTnIXB','log','2781441bKNiqh','Profile\x20\x22','7jzBuFJ','Config\x20not\x20found\x20at\x20','pxZNd','275110fDdIfM','170ZVwBpj','589875VjyamU','50byPwtv','11298IXaMDZ','\x0a✓\x20Now\x20using\x20profile\x20\x22','1015336QhRsZx','11477vsJqCa','.\x20Run\x20first:\x20ranger\x20profile\x20add\x20','XjDSk'];_0x8076=function(){return _0x2c1d0c;};return _0x8076();}export async function useEnv(_0x567f9c){const _0x4acea3=_0x1967,_0xb32b9a={'pxZNd':function(_0x521492,_0x4334a1){return _0x521492(_0x4334a1);},'KLcAm':function(_0x2eb7b9,_0x4bf4f1,_0x1a523f){return _0x2eb7b9(_0x4bf4f1,_0x1a523f);},'yTohI':_0x4acea3(0xa8),'XjDSk':function(_0x3f9932,_0xe18f3){return _0x3f9932(_0xe18f3);},'wSGdU':function(_0x4e3842,_0x307789){return _0x4e3842(_0x307789);}},_0x1ab67a=_0xb32b9a[_0x4acea3(0xb0)](getEnvDir,_0x567f9c),_0x555678=_0xb32b9a['KLcAm'](join,_0x1ab67a,_0xb32b9a['yTohI']);if(!_0xb32b9a[_0x4acea3(0xa7)](existsSync,_0x1ab67a))throw new Error(_0x4acea3(0xad)+_0x567f9c+'\x22\x20not\x20found.\x20Run\x20first:\x20ranger\x20profile\x20add\x20'+_0x567f9c);if(!existsSync(_0x555678))throw new Error(_0x4acea3(0xaf)+_0x555678+_0x4acea3(0xa6)+_0x567f9c);await _0xb32b9a['wSGdU'](writeActiveProfileName,_0x567f9c),console[_0x4acea3(0xab)](_0x4acea3(0xa3)+_0x567f9c+'\x22');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x1a1c(_0x5e689f,_0x8aaeed){_0x5e689f=_0x5e689f-0x1eb;const _0x5d17e6=_0x5d17();let _0x1a1c79=_0x5d17e6[_0x5e689f];return _0x1a1c79;}const _0xf20d2c=_0x1a1c;(function(_0x19e79a,_0x475609){const _0x1a55cd=_0x1a1c,_0x2c6e79=_0x19e79a();while(!![]){try{const _0xcb6e9f=-parseInt(_0x1a55cd(0x1f5))/0x1+parseInt(_0x1a55cd(0x1ed))/0x2+parseInt(_0x1a55cd(0x1f1))/0x3+-parseInt(_0x1a55cd(0x1fb))/0x4+parseInt(_0x1a55cd(0x1f7))/0x5+parseInt(_0x1a55cd(0x1f8))/0x6*(parseInt(_0x1a55cd(0x1fa))/0x7)+-parseInt(_0x1a55cd(0x1fc))/0x8*(-parseInt(_0x1a55cd(0x1f6))/0x9);if(_0xcb6e9f===_0x475609)break;else _0x2c6e79['push'](_0x2c6e79['shift']());}catch(_0x2fea52){_0x2c6e79['push'](_0x2c6e79['shift']());}}}(_0x5d17,0xb1c4b));import{existsSync}from'fs';import{mkdir,readFile,rename,unlink,writeFile}from'fs/promises';import{join}from'path';import{getRangerDir}from'./rangerRoot.js';const ACTIVE_PROFILE_FILE=_0xf20d2c(0x1f3),LEGACY_ACTIVE_ENV_FILE=_0xf20d2c(0x1ee);function getActiveProfilePath(){const _0xb250dc={'QHCfx':function(_0x15da2c,_0x28b000,_0x5f3a55){return _0x15da2c(_0x28b000,_0x5f3a55);}};return _0xb250dc['QHCfx'](join,getRangerDir(),ACTIVE_PROFILE_FILE);}function getLegacyActiveEnvPath(){const _0x309b45={'MZpae':function(_0x3df6ac,_0x6c825,_0x4de208){return _0x3df6ac(_0x6c825,_0x4de208);},'bPdXm':function(_0xa3cb22){return _0xa3cb22();}};return _0x309b45['MZpae'](join,_0x309b45['bPdXm'](getRangerDir),LEGACY_ACTIVE_ENV_FILE);}async function migrateLegacyActiveEnv(){const _0x38530a=_0xf20d2c,_0x4a3849={'QBJIO':function(_0x28b041){return _0x28b041();},'EqnBD':'utf-8','rkBez':function(_0x3b3271){return _0x3b3271();},'PfURA':function(_0x5507c8,_0x263253,_0x203c6f){return _0x5507c8(_0x263253,_0x203c6f);},'bXsja':function(_0x54c0ba,_0x28828f,_0x1afa79){return _0x54c0ba(_0x28828f,_0x1afa79);},'zRsxC':function(_0x2698b2,_0x72f545,_0x341046,_0xeda15e){return _0x2698b2(_0x72f545,_0x341046,_0xeda15e);},'dPJiq':function(_0x3589d7,_0x44dd13){return _0x3589d7(_0x44dd13);}},_0x10c171=_0x4a3849['QBJIO'](getLegacyActiveEnvPath);if(!existsSync(_0x10c171))return null;let _0x39e60e=null;try{_0x39e60e=(await readFile(_0x10c171,_0x4a3849[_0x38530a(0x1ef)]))['trim']()||null;}catch{_0x39e60e=null;}if(!_0x39e60e)return null;const _0x1bc5f8=_0x4a3849[_0x38530a(0x1f0)](getActiveProfilePath);try{await _0x4a3849[_0x38530a(0x1eb)](rename,_0x10c171,_0x1bc5f8);}catch{try{const _0x5e94aa=getRangerDir();await _0x4a3849['bXsja'](mkdir,_0x5e94aa,{'recursive':!![]}),await _0x4a3849['zRsxC'](writeFile,_0x1bc5f8,_0x39e60e,_0x4a3849['EqnBD']),await _0x4a3849['dPJiq'](unlink,_0x10c171);}catch{}}return _0x39e60e;}export async function readActiveProfileName(){const _0x5eadba=_0xf20d2c,_0x10f48a={'zMFLE':function(_0x5ea941){return _0x5ea941();},'NRLfN':function(_0xac5703,_0x152e6b,_0x5777f2){return _0xac5703(_0x152e6b,_0x5777f2);},'GklJQ':_0x5eadba(0x1ec)},_0xdfcafc=_0x10f48a['zMFLE'](getActiveProfilePath);if(existsSync(_0xdfcafc))try{return(await _0x10f48a[_0x5eadba(0x1f2)](readFile,_0xdfcafc,_0x10f48a[_0x5eadba(0x1f4)]))['trim']()||null;}catch{return null;}return await migrateLegacyActiveEnv();}export async function writeActiveProfileName(_0x25e08e){const _0x2d7153=_0xf20d2c,_0x472c13={'hXKEL':function(_0x4eb6fc,_0x211cf8,_0x27941b){return _0x4eb6fc(_0x211cf8,_0x27941b);},'SyecN':function(_0x1bc46f,_0x218f6a,_0x1f8e4a,_0x25a6db){return _0x1bc46f(_0x218f6a,_0x1f8e4a,_0x25a6db);},'ylhJT':function(_0x31ee74,_0x102008){return _0x31ee74(_0x102008);}},_0x12855e=getRangerDir();await _0x472c13[_0x2d7153(0x1f9)](mkdir,_0x12855e,{'recursive':!![]});const _0x2014b1=getActiveProfilePath();await _0x472c13[_0x2d7153(0x1fd)](writeFile,_0x2014b1,_0x25e08e,_0x2d7153(0x1ec));const _0x312ba5=getLegacyActiveEnvPath();if(_0x472c13[_0x2d7153(0x1fe)](existsSync,_0x312ba5))try{await unlink(_0x312ba5);}catch{}}function _0x5d17(){const _0x4a9342=['active-profile.txt','GklJQ','1294889uccyEV','63351tlOUsB','2935755QPCWgR','450HzRnHh','hXKEL','9499IvknMU','4958996KHbejo','1544nZOhIP','SyecN','ylhJT','PfURA','utf-8','44954YWIukU','active-env.txt','EqnBD','rkBez','3578541IsuZuR','NRLfN'];_0x5d17=function(){return _0x4a9342;};return _0x5d17();}export async function migrateActiveProfileFile(){const _0x3ee1b0=await migrateLegacyActiveEnv();return _0x3ee1b0!==null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const _0x218387=_0x532c;(function(_0x58e95d,_0x82d073){const _0x3d55d0=_0x532c,_0x52ef98=_0x58e95d();while(!![]){try{const _0x272caf=parseInt(_0x3d55d0(0x16d))/0x1+-parseInt(_0x3d55d0(0x15e))/0x2+-parseInt(_0x3d55d0(0x16e))/0x3*(parseInt(_0x3d55d0(0x178))/0x4)+-parseInt(_0x3d55d0(0x164))/0x5+parseInt(_0x3d55d0(0x163))/0x6*(-parseInt(_0x3d55d0(0x174))/0x7)+-parseInt(_0x3d55d0(0x159))/0x8*(-parseInt(_0x3d55d0(0x17a))/0x9)+-parseInt(_0x3d55d0(0x16a))/0xa*(-parseInt(_0x3d55d0(0x162))/0xb);if(_0x272caf===_0x82d073)break;else _0x52ef98['push'](_0x52ef98['shift']());}catch(_0x3dc186){_0x52ef98['push'](_0x52ef98['shift']());}}}(_0x3761,0x8b1dc));function _0x532c(_0x31a6d5,_0x152ade){_0x31a6d5=_0x31a6d5-0x159;const _0x3761f1=_0x3761();let _0x532c92=_0x3761f1[_0x31a6d5];return _0x532c92;}import{delimiter,join}from'path';function _0x3761(){const _0x3d28b0=['includes','PATH','ranger-claude-tmp','gUWFC','630tWcIRl','PATH\x20is\x20empty,\x20so\x20npm\x20and\x20core\x20system\x20tools\x20may\x20be\x20unavailable.','Your\x20PATH\x20looks\x20incomplete\x20for\x20browser\x20automation.\x20Ranger\x20will\x20keep\x20going,\x20but\x20browser\x20setup\x20may\x20fail.','npm_config_registry','2089212DGVSxk','NPM_CONFIG_REGISTRY','54kGsCUK','EAaWy','filter','DAnxo','CHROMIUM_BIN','${PATH}','platform','RANGER_DISABLE_MCP','Session\x20token\x20is\x20required\x20when\x20RANGER_BYOK=false','NPM_CONFIG_CACHE','some','push','XDG_CONFIG_HOME','1119208mUYtaI','win32','NODE_ENV','DEBUG','APPDATA','1218794DtgLuf','fromEntries','HWpuw','TEMP','11MyWvbd','1836vOJGkN','2878990shGjWs','string','env','TMPDIR','TMP','HOME','15628690gTNQZv','npm_config_prefix','entries','424886zSTnef','6nPYdoT','length'];_0x3761=function(){return _0x3d28b0;};return _0x3761();}import{tmpdir}from'os';import{mkdirSync}from'fs';import{getAiProxyUrl}from'./environment.js';const AGENT_ENV_PASSTHROUGH_KEYS=[_0x218387(0x171),_0x218387(0x169),_0x218387(0x167),_0x218387(0x168),_0x218387(0x161),'USERPROFILE',_0x218387(0x15d),'LOCALAPPDATA','XDG_CACHE_HOME',_0x218387(0x186),'PLAYWRIGHT_BROWSERS_PATH','PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD','CHROME_BIN',_0x218387(0x17e),'npm_config_cache',_0x218387(0x183),'npm_config_userconfig','NPM_CONFIG_USERCONFIG',_0x218387(0x16b),'NPM_CONFIG_PREFIX',_0x218387(0x177),_0x218387(0x179),_0x218387(0x15c),_0x218387(0x15b),'RANGER_TEST_SKIP_BROWSER_WAIT',_0x218387(0x181)],UNEXPANDED_PATH_TOKEN_PATTERNS=[_0x218387(0x17f),'$PATH','%PATH%'];export function getAgentPathHealthWarning(_0x19977f,_0x228b7d=process[_0x218387(0x180)]){const _0x4600c4=_0x218387,_0x2d537f={'HJxRp':'PATH\x20is\x20missing\x20core\x20system\x20directories\x20like\x20`/usr/bin`\x20and\x20`/bin`.','gUWFC':_0x4600c4(0x176)},_0x3d97a1=[],_0x3c320b=(_0x19977f||'')['split'](delimiter)[_0x4600c4(0x17c)](Boolean);_0x3c320b[_0x4600c4(0x16f)]===0x0&&_0x3d97a1[_0x4600c4(0x185)](_0x4600c4(0x175));UNEXPANDED_PATH_TOKEN_PATTERNS[_0x4600c4(0x184)](_0x1f1115=>(_0x19977f||'')[_0x4600c4(0x170)](_0x1f1115))&&_0x3d97a1['push']('PATH\x20contains\x20an\x20unexpanded\x20placeholder\x20like\x20`${PATH}`\x20instead\x20of\x20the\x20expanded\x20current\x20PATH.');if(_0x228b7d!==_0x4600c4(0x15a)){const _0x5ea800=_0x3c320b[_0x4600c4(0x170)]('/usr/bin'),_0x11ca40=_0x3c320b['includes']('/bin');!_0x5ea800&&!_0x11ca40&&_0x3d97a1[_0x4600c4(0x185)](_0x2d537f['HJxRp']);}if(_0x3d97a1['length']===0x0)return null;return{'summary':_0x2d537f[_0x4600c4(0x173)],'issues':_0x3d97a1};}export function buildAgentEnv(_0x47590f){const _0x10ce49=_0x218387,_0x1d45c0={'DAnxo':'true','UTTzA':'TMPDIR','HWpuw':function(_0x25e149,_0x15bfdf,_0x584de5){return _0x25e149(_0x15bfdf,_0x584de5);},'AFPqF':_0x10ce49(0x172),'EAaWy':_0x10ce49(0x168)};if(_0x47590f['byokEnabled'])return Object[_0x10ce49(0x15f)](Object[_0x10ce49(0x16c)](process[_0x10ce49(0x166)])['filter'](_0x56a566=>typeof _0x56a566[0x1]===_0x10ce49(0x165)));if(!_0x47590f['sessionToken'])throw new Error(_0x10ce49(0x182));const _0x387210={'ANTHROPIC_API_KEY':_0x47590f['sessionToken'],'ANTHROPIC_BASE_URL':getAiProxyUrl(),'DISABLE_TELEMETRY':_0x1d45c0[_0x10ce49(0x17d)]};for(const _0x88fbcb of AGENT_ENV_PASSTHROUGH_KEYS){const _0x2906ee=process['env'][_0x88fbcb];_0x2906ee&&![_0x1d45c0['UTTzA'],'TMP','TEMP']['includes'](_0x88fbcb)&&(_0x387210[_0x88fbcb]=_0x2906ee);}const _0x206683=_0x1d45c0[_0x10ce49(0x160)](join,tmpdir(),_0x1d45c0['AFPqF']);try{_0x1d45c0['HWpuw'](mkdirSync,_0x206683,{'recursive':!![]});}catch{}return _0x387210['TMPDIR']=_0x206683,_0x387210[_0x1d45c0[_0x10ce49(0x17b)]]=_0x206683,_0x387210[_0x10ce49(0x161)]=_0x206683,_0x387210;}
|