@ranger-testing/ranger-cli 2.5.4-alpha.ed286f1-2 → 2.5.4-alpha.f6504c0-8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/migrateProfile.js +1 -0
- package/build/commands/setup/claude.js +1 -1
- package/build/commands/setup/opencode.js +1 -1
- package/build/commands/setupCi.js +1 -1
- package/build/commands/skillup.js +1 -1
- package/build/commands/start.js +1 -1
- package/build/commands/status.js +1 -1
- package/build/commands/update.js +1 -1
- package/build/commands/updateEnv.js +1 -1
- package/build/commands/useEnv.js +1 -1
- package/build/commands/utils/activeProfile.js +1 -1
- package/build/commands/utils/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/cloudProfile.js +1 -0
- package/build/commands/utils/cloudProfileSession.js +1 -0
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/gitTracked.js +1 -0
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/matchAuthEnvironment.js +1 -0
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/opencodeConfig.js +1 -1
- package/build/commands/utils/playwrightCli.js +1 -1
- package/build/commands/utils/profileMessages.js +1 -1
- package/build/commands/utils/profileSetupBanner.js +1 -1
- package/build/commands/utils/projectsConfig.js +1 -0
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/resolveProfileContext.js +1 -0
- package/build/commands/utils/resolveProfileUrl.js +1 -0
- 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 +18 -4
- package/build/skills/ranger/create.md +6 -0
- package/build/skills/ranger/verify.md +17 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function _0x2efc(){const _0x4a01ab=['plugin','✓\x20Encrypted\x20auth\x20verified\x20(will\x20decrypt\x20at\x20runtime)','xBFgw','52489VdRnXN','success','8PhPxjp','auth','mbAva','.\x20Use\x20--profile\x20to\x20specify\x20which\x20one.','\x22:\x20','\x0a✅\x20Ranger\x20CI\x20setup\x20complete!\x0a','210354LGUUIY','mUzdm','827455pvpVYP','length','✓\x20Created\x20profile\x20settings:\x20baseUrl=','sessions','skills','settings.json','RHJnB','Failed\x20to\x20install\x20plugin:','install','message','dir_setup','Auto-detected\x20CI\x20profile:\x20','path','You\x20can\x20install\x20manually:\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20project','uqCGH','\x0a🔧\x20Ranger\x20CI\x20Setup\x0a','No\x20API\x20token\x20available\x20for\x20decryption','tgeMk','ranger@trailhead','chromium','riqPB','CI\x20profile\x20\x22','isDirectory','2091397rqFlQJ','539Efhzhg','Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.','auth.json','4qpEfVM','--scope','ZYMUo','25170JJlfyX','log','trackPhaseEnd','EgFJq','15784qdRrGN','oAaON','error','\x20\x20No\x20auth\x20state\x20found\x20(app\x20may\x20not\x20require\x20authentication)','auth.json.enc','skipChromium','You\x20can\x20install\x20manually:\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','Multiple\x20CI\x20profiles\x20found:\x20','Failed\x20to\x20verify\x20encrypted\x20auth\x20for\x20profile\x20\x22','whnuZ','baseUrl','ranger-testing/trailhead','trackPhaseStart','project','cDdDU','137061hhSuOG','\x22\x20has\x20no\x20settings.json.\x20Use\x20--base-url\x20to\x20configure\x20it.','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','name','✓\x20Marketplace\x20already\x20added','Kuane','SnsGV','30kNdBka','LWxoJ','No\x20CI\x20profiles\x20found\x20in\x20.ranger/ci/.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','✓\x20Claude\x20Code\x20plugin\x20already\x20installed'];_0x2efc=function(){return _0x4a01ab;};return _0x2efc();}(function(_0x4bbab0,_0x41c323){const _0xdfef84=_0x1bd7,_0x287f09=_0x4bbab0();while(!![]){try{const _0x169b62=-parseInt(_0xdfef84(0xe2))/0x1*(parseInt(_0xdfef84(0x107))/0x2)+parseInt(_0xdfef84(0x10a))/0x3*(parseInt(_0xdfef84(0xe4))/0x4)+parseInt(_0xdfef84(0xec))/0x5+parseInt(_0xdfef84(0xea))/0x6+parseInt(_0xdfef84(0x104))/0x7*(-parseInt(_0xdfef84(0x10e))/0x8)+-parseInt(_0xdfef84(0x11d))/0x9*(parseInt(_0xdfef84(0x124))/0xa)+parseInt(_0xdfef84(0x103))/0xb;if(_0x169b62===_0x41c323)break;else _0x287f09['push'](_0x287f09['shift']());}catch(_0x7a4a95){_0x287f09['push'](_0x287f09['shift']());}}}(_0x2efc,0x199a7));import{mkdir,readFile,readdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{authenticate,ensureRangerDir,ensureChromium,writeRangerGitignore}from'./start.js';function _0x1bd7(_0x2976d6,_0x31706a){_0x2976d6=_0x2976d6-0xdf;const _0x2efce4=_0x2efc();let _0x1bd7ea=_0x2efce4[_0x2976d6];return _0x1bd7ea;}import{skillup}from'./skillup.js';import{getRangerDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{saveSettings}from'./utils/settings.js';import{decrypt}from'./utils/crypto.js';import{getToken}from'./utils/keychain.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'./utils/claudePlugin.js';async function findCiProfile(_0x5cfe63){const _0x12fb34=_0x1bd7,_0x28d9cc={'EgFJq':function(_0x4f5c19,_0x5824e6,_0x3005c0){return _0x4f5c19(_0x5824e6,_0x3005c0);},'SnsGV':function(_0x155dc0,_0x37da6d){return _0x155dc0+_0x37da6d;},'pTKbp':function(_0x195c50,_0x169a5a){return _0x195c50===_0x169a5a;},'aYuNk':function(_0x338e38,_0x3cc815,_0x31a0cd){return _0x338e38(_0x3cc815,_0x31a0cd);}},_0x196aa7=getRangerDir(),_0x541c57=join(_0x196aa7,'ci');if(_0x5cfe63){const _0x3b25b6=_0x28d9cc[_0x12fb34(0x10d)](join,_0x541c57,_0x5cfe63);return{'name':_0x5cfe63,'path':_0x3b25b6};}if(!existsSync(_0x541c57))throw new Error(_0x28d9cc[_0x12fb34(0x123)]('No\x20CI\x20profiles\x20found.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a',_0x12fb34(0x105)));const _0x468213=await readdir(_0x541c57,{'withFileTypes':!![]}),_0x4cf097=_0x468213['filter'](_0x54d6f3=>_0x54d6f3[_0x12fb34(0x102)]())['map'](_0x47347b=>_0x47347b[_0x12fb34(0x120)]);if(_0x28d9cc['pTKbp'](_0x4cf097['length'],0x0))throw new Error(_0x12fb34(0x126)+_0x12fb34(0x105));if(_0x4cf097[_0x12fb34(0xed)]===0x1){const _0x33e4d8=_0x4cf097[0x0];return console[_0x12fb34(0x10b)](_0x12fb34(0xf7)+_0x33e4d8),{'name':_0x33e4d8,'path':_0x28d9cc['aYuNk'](join,_0x541c57,_0x33e4d8)};}throw new Error(_0x12fb34(0x115)+_0x4cf097['join'](',\x20')+_0x12fb34(0xe7));}async function installPluginNonInteractive(){const _0x55a880=_0x1bd7,_0x5d721c={'oAaON':function(_0x303089,_0x42dc54){return _0x303089(_0x42dc54);},'eQkMk':_0x55a880(0xfe),'zWYgO':_0x55a880(0x127),'mbAva':function(_0x1ca870,_0x5ebd1){return _0x1ca870(_0x5ebd1);},'yJdgf':'trailhead','RHJnB':_0x55a880(0x121),'whnuZ':'plugin','ZYMUo':'add','riqPB':_0x55a880(0x108),'GiljU':_0x55a880(0x11b)},_0x260263=await _0x5d721c[_0x55a880(0x10f)](isPluginInstalled,_0x5d721c['eQkMk']);if(_0x260263)return console[_0x55a880(0x10b)](_0x5d721c['zWYgO']),![];console[_0x55a880(0x10b)]('Installing\x20Claude\x20Code\x20plugin\x20(project\x20level)...');const _0x2056c5=await _0x5d721c[_0x55a880(0xe6)](isMarketplaceAdded,_0x5d721c['yJdgf']);let _0x191293=_0x2056c5;if(_0x2056c5)console['log'](_0x5d721c[_0x55a880(0xf2)]);else{const _0x336442=await _0x5d721c['mbAva'](runClaudeCommand,[_0x5d721c[_0x55a880(0x117)],'marketplace',_0x5d721c[_0x55a880(0x109)],_0x55a880(0x119)]);!_0x336442['success']?(console[_0x55a880(0x110)]('Failed\x20to\x20add\x20marketplace:',_0x336442['error']),console['log'](_0x55a880(0x114))):_0x191293=!![];}if(_0x191293){const _0x34910b=await runClaudeCommand([_0x5d721c['whnuZ'],_0x55a880(0xf4),'ranger@trailhead',_0x5d721c[_0x55a880(0x100)],_0x5d721c['GiljU']]);!_0x34910b[_0x55a880(0xe3)]?(console[_0x55a880(0x110)](_0x55a880(0xf3),_0x34910b[_0x55a880(0x110)]),console[_0x55a880(0x10b)](_0x55a880(0xf9))):console['log']('✓\x20Claude\x20Code\x20plugin\x20installed');}return!![];}export async function setupCi(_0x3df13a,_0x5ebcac,_0x570f7e){const _0x36df64=_0x1bd7,_0x1e405f={'htulb':_0x36df64(0xf6),'xBFgw':function(_0x210ebf){return _0x210ebf();},'KDDmU':function(_0x325068,_0x1fa876){return _0x325068(_0x1fa876);},'uqCGH':function(_0x224ec5,_0x468461,_0x48ee1a){return _0x224ec5(_0x468461,_0x48ee1a);},'LWxoJ':_0x36df64(0xef),'Kuane':_0x36df64(0xff),'SMBOh':'profile_activate','RwPHZ':function(_0x30b025,_0x1325d0){return _0x30b025(_0x1325d0);},'QTvbl':function(_0x99da9e,_0x48cc88){return _0x99da9e(_0x48cc88);},'cDdDU':_0x36df64(0x106),'tgeMk':_0x36df64(0xfc),'UakDA':function(_0x39d49e,_0x3854a5,_0x29bf8e){return _0x39d49e(_0x3854a5,_0x29bf8e);},'XXBiN':function(_0x21ddfa,_0x3765b0){return _0x21ddfa instanceof _0x3765b0;},'FJlAJ':_0x36df64(0xf0),'mUzdm':'project'};console['log'](_0x36df64(0xfb)),_0x570f7e?.['trackPhaseStart']('auth'),await authenticate(_0x3df13a),_0x570f7e?.['trackPhaseEnd'](_0x36df64(0xe5)),_0x570f7e?.['trackPhaseStart'](_0x1e405f['htulb']);const {path:_0x55a5a9,installed:_0x1dca9e}=await _0x1e405f[_0x36df64(0xe1)](ensureRangerDir);await _0x1e405f['KDDmU'](writeRangerGitignore,_0x55a5a9);const _0x5acf2d=_0x1e405f[_0x36df64(0xfa)](join,_0x55a5a9,_0x1e405f[_0x36df64(0x125)]);!existsSync(_0x5acf2d)&&await mkdir(_0x5acf2d,{'recursive':!![]});_0x570f7e?.['trackPhaseEnd'](_0x36df64(0xf6),{'installed':_0x1dca9e}),_0x570f7e?.[_0x36df64(0x11a)](_0x1e405f[_0x36df64(0x122)]);let _0x2de653=![];_0x5ebcac?.['skipChromium']?console['log'](_0x36df64(0x11f)):_0x2de653=await ensureChromium();_0x570f7e?.[_0x36df64(0x10c)]('chromium',{'installed':_0x2de653,'skipped':!!_0x5ebcac?.[_0x36df64(0x113)]}),_0x570f7e?.['trackPhaseStart'](_0x1e405f['SMBOh']);const _0xa0e625=await _0x1e405f['RwPHZ'](findCiProfile,_0x5ebcac?.['profile']);let _0x2b83e2=![];_0x5ebcac?.['baseUrl']&&(await mkdir(_0xa0e625[_0x36df64(0xf8)],{'recursive':!![]}),await _0x1e405f[_0x36df64(0xfa)](saveSettings,_0xa0e625[_0x36df64(0x120)],{'baseUrl':_0x5ebcac['baseUrl'],'headless':!![]}),console['log'](_0x36df64(0xee)+_0x5ebcac[_0x36df64(0x118)]),_0x2b83e2=!![]);const _0x135076=join(_0xa0e625['path'],_0x36df64(0xf1));if(!_0x1e405f['QTvbl'](existsSync,_0x135076)&&!_0x2b83e2)throw new Error(_0x36df64(0x101)+_0xa0e625['name']+_0x36df64(0x11e));const _0x478c28=join(_0xa0e625['path'],_0x1e405f[_0x36df64(0x11c)]),_0x3e8e01=join(_0xa0e625['path'],_0x36df64(0x112)),_0x785f2c=_0x1e405f['KDDmU'](existsSync,_0x478c28),_0xe16abb=existsSync(_0x3e8e01);if(_0xe16abb)try{const _0x34c204=await getToken();if(!_0x34c204)throw new Error(_0x1e405f[_0x36df64(0xfd)]);const _0x53e80e=await readFile(_0x3e8e01);_0x1e405f['UakDA'](decrypt,_0x53e80e,_0x34c204),console['log'](_0x36df64(0xe0));}catch(_0x5df514){const _0x3c2206=_0x1e405f['XXBiN'](_0x5df514,Error)?_0x5df514[_0x36df64(0xf5)]:String(_0x5df514);throw new Error(_0x36df64(0x116)+_0xa0e625['name']+_0x36df64(0xe8)+_0x3c2206);}else _0x785f2c?console[_0x36df64(0x10b)]('✓\x20Auth\x20state\x20found'):console[_0x36df64(0x10b)](_0x36df64(0x111));await writeActiveProfileName(_0xa0e625[_0x36df64(0x120)]),console[_0x36df64(0x10b)]('✓\x20Active\x20profile:\x20'+_0xa0e625[_0x36df64(0x120)]),_0x570f7e?.[_0x36df64(0x10c)](_0x1e405f['SMBOh'],{'profileName':_0xa0e625['name'],'hasAuth':_0x785f2c,'hasEncryptedAuth':_0xe16abb,'createdSettings':_0x2b83e2}),_0x570f7e?.['trackPhaseStart'](_0x36df64(0xdf));const _0x5a6188=await _0x1e405f['xBFgw'](installPluginNonInteractive);_0x570f7e?.[_0x36df64(0x10c)](_0x36df64(0xdf),{'installed':_0x5a6188}),_0x570f7e?.[_0x36df64(0x11a)](_0x1e405f['FJlAJ']),await skillup({'autoInstall':_0x1e405f[_0x36df64(0xeb)]}),_0x570f7e?.[_0x36df64(0x10c)](_0x1e405f['FJlAJ']),console['log'](_0x36df64(0xe9));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x1bea(){const _0x38523b=['\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','platform','opencode','iaJBb','installLevel','tXxbo','\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','KZaKq','To\x20get\x20started:','7610094SDMLUP','8333801qGhPfS','To\x20use:','\x20\x203.\x20Run:\x20ranger\x20skillup','\x20--opencode','log','/skills/','AmIWc','Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20(','user','\x20<your-api-token>','27xXPUsE','NsbJl','\x0a📦\x20Installing\x20skills...\x0a','\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','/.opencode/skills/','autoInstall','ranger','386508cMqlEP','2adDZrq','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','suppressUsage','hfCZq','150392jogfCO','1964488NvbNIG','prompt','61378xIRGzG','Ohbjd','UgAqK','27cGxOkV','2501075socWir','/.claude/skills/','10kEHlSi','kCAZz'];_0x1bea=function(){return _0x38523b;};return _0x1bea();}function _0x5c3d(_0x18b6f6,_0x33d05e){_0x18b6f6=_0x18b6f6-0x6a;const _0x1beab4=_0x1bea();let _0x5c3d49=_0x1beab4[_0x18b6f6];return _0x5c3d49;}(function(_0x3e8765,_0x28a5dd){const _0x5182c5=_0x5c3d,_0x58aa47=_0x3e8765();while(!![]){try{const _0x4defa0=parseInt(_0x5182c5(0x79))/0x1*(-parseInt(_0x5182c5(0x72))/0x2)+parseInt(_0x5182c5(0x7c))/0x3*(parseInt(_0x5182c5(0x71))/0x4)+parseInt(_0x5182c5(0x7d))/0x5+parseInt(_0x5182c5(0x8a))/0x6+-parseInt(_0x5182c5(0x8b))/0x7+parseInt(_0x5182c5(0x77))/0x8*(-parseInt(_0x5182c5(0x6a))/0x9)+-parseInt(_0x5182c5(0x7f))/0xa*(parseInt(_0x5182c5(0x76))/0xb);if(_0x4defa0===_0x28a5dd)break;else _0x58aa47['push'](_0x58aa47['shift']());}catch(_0x12c8d9){_0x58aa47['push'](_0x58aa47['shift']());}}}(_0x1bea,0x9b41b));import{basename}from'path';import _0x2d0b18 from'inquirer';import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x43336b={}){const _0x1773b7=_0x5c3d,_0x1d5354={'jYqnX':_0x1773b7(0x73),'gnFVG':'\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','Ohbjd':'opencode','tXxbo':function(_0x20cdec,_0x2733a1){return _0x20cdec===_0x2733a1;},'UgAqK':'✓\x20Found\x20API\x20token','KZaKq':function(_0x29ccdd){return _0x29ccdd();},'rbYUv':function(_0x3850ea,_0x5c725f){return _0x3850ea(_0x5c725f);},'hfCZq':_0x1773b7(0x93),'ZYZQb':'list','RlChL':_0x1773b7(0x85),'AmIWc':'project','OXBfz':function(_0x2f6134){return _0x2f6134();},'Pmzwu':_0x1773b7(0x81),'NsbJl':function(_0x116574,_0x2a5718){return _0x116574>_0x2a5718;},'iaJBb':'project-level','kCAZz':'\x20\x20-\x20Open\x20Claude\x20Code\x20in\x20plan\x20mode\x20and\x20run\x20/ranger:enable.\x20Plan\x20out\x20a\x20UI\x20feature\x20with\x20Ranger\x20and\x20watch\x20Ranger\x20test\x20it\x20for\x20you!'};console['log'](_0x1773b7(0x6d));const _0x32684a=_0x43336b[_0x1773b7(0x82)]??'claude',_0x39eeb0=await getToken();if(!_0x39eeb0){console[_0x1773b7(0x8f)](_0x1d5354['jYqnX']),console['log'](_0x1773b7(0x89)),console['log'](_0x1d5354['gnFVG']),console['log']('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0x32684a===_0x1d5354[_0x1773b7(0x7a)]?'\x20--opencode':'')+_0x1773b7(0x94)),console[_0x1773b7(0x8f)](_0x1773b7(0x8d)+(_0x1d5354['tXxbo'](_0x32684a,_0x1773b7(0x83))?_0x1773b7(0x8e):'')+'\x0a');return;}console['log'](_0x1d5354[_0x1773b7(0x7b)]);const _0x3f7703=_0x1d5354[_0x1773b7(0x88)](getProjectRoot),_0x5c7418=basename(_0x3f7703),_0x5d9034=_0x1d5354[_0x1773b7(0x86)](_0x32684a,_0x1d5354['Ohbjd'])?_0x1d5354['rbYUv'](getOpencodeConfigDir,_0x1d5354[_0x1773b7(0x75)])+_0x1773b7(0x90):getClaudeConfigDir()+'/skills/',_0x5463a9=_0x1d5354['tXxbo'](_0x32684a,'opencode')?_0x3f7703+_0x1773b7(0x6e):_0x3f7703+_0x1773b7(0x7e),_0x1bfb32=process['stdin']['isTTY']&&process['stdout']['isTTY'];let _0xf363d1;if(_0x43336b['autoInstall'])_0xf363d1=_0x43336b[_0x1773b7(0x6f)];else{if(_0x1bfb32){const _0x83ef4a=await _0x2d0b18[_0x1773b7(0x78)]([{'type':_0x1d5354['ZYZQb'],'name':_0x1d5354['RlChL'],'message':'Where\x20should\x20skills\x20be\x20installed?','choices':[{'name':'All\x20projects\x20('+_0x5d9034+')','value':'user'},{'name':'This\x20project\x20only\x20('+_0x5463a9+')','value':_0x1d5354[_0x1773b7(0x91)]}]}]);_0xf363d1=_0x83ef4a[_0x1773b7(0x85)];}else _0xf363d1=_0x1d5354['AmIWc'],console['log'](_0x1773b7(0x92)+_0x5463a9+')');}let _0x392631=0x0;const _0x3a42dd=_0x1d5354['OXBfz'](getCurrentVersion);console['log'](_0x1773b7(0x6c));try{const _0x548c64=await installSkill(_0x1773b7(0x70),{'cliVersion':_0x3a42dd,'level':_0xf363d1,'platform':_0x32684a});_0x548c64&&_0x392631++;}catch(_0x49c9ea){console['warn'](_0x1d5354['Pmzwu'],_0x49c9ea instanceof Error?_0x49c9ea['message']:_0x49c9ea);}if(_0x1d5354[_0x1773b7(0x6b)](_0x392631,0x0)){const _0x3db22e=_0xf363d1==='user'?'user-level':_0x1d5354[_0x1773b7(0x84)];console['log']('\x0a✅\x20Installed\x20'+_0x392631+'\x20'+_0x3db22e+'\x20skill'+(_0x392631>0x1?'s':'')+'\x20successfully!\x0a'),!_0x43336b[_0x1773b7(0x74)]&&(console['log'](_0x1773b7(0x8c)),_0x32684a===_0x1d5354[_0x1773b7(0x7a)]?console[_0x1773b7(0x8f)](_0x1773b7(0x87)):console['log'](_0x1d5354[_0x1773b7(0x80)]));}else console['log']('\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a');}
|
package/build/commands/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x41c326=_0x48d1;(function(_0xdd56c,_0x548109){const _0x56ac20=_0x48d1,_0x183a2c=_0xdd56c();while(!![]){try{const _0x566c55=parseInt(_0x56ac20(0x208))/0x1+-parseInt(_0x56ac20(0x204))/0x2+-parseInt(_0x56ac20(0x1d7))/0x3+-parseInt(_0x56ac20(0x1fa))/0x4+parseInt(_0x56ac20(0x228))/0x5*(parseInt(_0x56ac20(0x1de))/0x6)+-parseInt(_0x56ac20(0x1d6))/0x7+parseInt(_0x56ac20(0x209))/0x8;if(_0x566c55===_0x548109)break;else _0x183a2c['push'](_0x183a2c['shift']());}catch(_0x20bd1c){_0x183a2c['push'](_0x183a2c['shift']());}}}(_0x376f,0x8d2fa));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x137ec0 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';function _0x376f(){const _0x5da841=['⚠\x20No\x20git\x20repository\x20found.\x20Run\x20`ranger\x20profile\x20add\x20local`\x20from\x20your\x20project\x20directory.',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','✓\x20Created\x20.ranger/.gitignore','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','5719308tfsBkL','951165DbcXPw','trackPhaseEnd','trackPhaseStart','playwright@','chromium','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','plugin','6414JjqHUy','You\x20can\x20install\x20it\x20manually\x20by\x20running:','pwggE','skipChromium','Authentication\x20failed:\x20','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','sJrru','Validating\x20API\x20token...','juHkD','npx','UcHff','✓\x20Stored\x20credentials\x20locally','profile','scope','UnxLu','✓\x20Already\x20authenticated\x20to\x20','log','GITHUB_ENV','win32','OBXSQ','DiVZI','VoONC','✓\x20Playwright\x20Chromium\x20browser\x20found','Non-interactive\x20mode:\x20Skipping\x20profile\x20setup.\x20To\x20set\x20up\x20a\x20profile,\x20pass\x20--url\x20or\x20run\x20later:','hioyt','ZJxhs','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','user','1427140pNQVAP','\x20\x20npx\x20playwright@','\x0a🚀\x20Ranger\x20Setup\x0a','wantsProfile','install','executablePath','isTTY','force','auth','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','1790236bqiYTH','✓\x20.ranger/\x20directory\x20already\x20exists','\x0aA\x20profile\x20gives\x20Ranger\x27s\x20browser\x20agent\x20information\x20about\x20how','\x20(fallback\x20version)','359918dgrpgT','12462648sodVfO','OvWfI','blBrq','ranger','\x20install\x20chromium','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','error','inherit','The\x20required\x20version\x20(','upiQQ','url','FJKSM','ASkRc','prompt','organizationName','skipped','env','to\x20access\x20your\x20app.\x20If\x20the\x20part\x20of\x20your\x20app\x20you\x20want\x20to\x20test\x20is\x20behind','stdout','GEqwx','provided_token','\x0aIn\x20Claude\x20Code,\x20run\x20','wstpc','gZOru','cVbVj','EVOEH','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','jdhHQ','opencode','success','4895CjdPEL','No\x20git\x20repository\x20found.\x20Please\x20run\x20`ranger\x20setup`\x20from\x20inside\x20your\x20project\x20directory,\x0a','...','ranger\x20profile\x20add\x20local','✓\x20Authenticated\x20to\x20','status','gMgxB','close','message','TZRwv','RebXR','nrWax','auth,\x20you\x20can\x20log\x20in\x20and\x20we\x27ll\x20save\x20the\x20session\x20state\x20for\x20Ranger\x20to','skills','git_check','lEOex','tCopU','allowInsecureLocalhost','\x0a❌\x20Profile\x20setup\x20failed:','LAcjK','✓\x20Created\x20.ranger/\x20directory','yyeKS','KDZjc','\x0aIn\x20order\x20for\x20Ranger\x20to\x20verify\x20your\x20work,\x20you\x27ll\x20need\x20to\x20set\x20up\x20a\x20profile\x20later\x20with:','✓\x20Skipping\x20authentication\x20(--skip-auth)','gyquM','skipAuth','Non-interactive\x20mode:\x20No\x20--scope\x20provided,\x20defaulting\x20to\x20user.','cMhkv','\x1b[1m','confirm','sdtyQ','or\x20use\x20--scope\x20user\x20to\x20install\x20at\x20the\x20user\x20level\x20without\x20a\x20project.','PGcAE','iAFKy','wgpVI','YXZHi','\x0a⚠\x20Skipping\x20Chromium\x20installation.'];_0x376f=function(){return _0x5da841;};return _0x376f();}import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.58.2';const bold=_0x19e636=>_0x41c326(0x1c9)+_0x19e636+'\x1b[0m';export function getPlaywrightVersion(){try{const _0x4850d4=require['resolve']('playwright/package.json'),_0xf272e9=require(_0x4850d4);return _0xf272e9['version'];}catch{return null;}}export function installChromiumBinary(_0xa5dad0,_0x5a6455=![]){const _0x3f5411=_0x41c326,_0xf512d6={'ewFaV':function(_0x3ab704){return _0x3ab704();},'dNDxU':_0x3f5411(0x1fe),'mLmMO':'--with-deps','TZRwv':_0x3f5411(0x1db),'wgpVI':_0x3f5411(0x1e7),'GAnjo':'ignore','jdhHQ':'inherit','FZNpB':function(_0x588d52,_0x405e9e){return _0x588d52===_0x405e9e;},'TtDGW':_0x3f5411(0x1f0),'CZBYI':_0x3f5411(0x210)};return new Promise((_0x484a49,_0x48381e)=>{const _0x2c24ee=_0x3f5411,_0x5e8043=[_0x2c24ee(0x1da)+_0xa5dad0,_0xf512d6['dNDxU'],..._0x5a6455?[_0xf512d6['mLmMO']]:[],_0xf512d6[_0x2c24ee(0x231)]],_0x41b5e4=spawn(_0xf512d6[_0x2c24ee(0x1cf)],_0x5e8043,{'stdio':[_0xf512d6['GAnjo'],_0xf512d6[_0x2c24ee(0x225)],_0x2c24ee(0x211)],'shell':_0xf512d6['FZNpB'](process['platform'],_0xf512d6['TtDGW'])});_0x41b5e4['on'](_0x2c24ee(0x22f),_0x34e6b3=>{_0x34e6b3===0x0?_0xf512d6['ewFaV'](_0x484a49):_0x48381e(new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x34e6b3));}),_0x41b5e4['on'](_0xf512d6['CZBYI'],_0x9b233a=>{_0x48381e(_0x9b233a);});});}export async function authenticate(_0x1b02dd){const _0xed3d84=_0x41c326,_0x214c6e={'UnxLu':function(_0x5b65f7){return _0x5b65f7();},'mxfNF':'existing_token','ZJxhs':function(_0x296894,_0x356b00){return _0x296894(_0x356b00);},'systq':_0xed3d84(0x1e5),'YXZHi':function(_0x1f7cf2,_0x1dd556){return _0x1f7cf2(_0x1dd556);},'GEqwx':_0xed3d84(0x21e)};if(!_0x1b02dd){const _0x3b6100=await _0x214c6e[_0xed3d84(0x1ec)](getToken);if(_0x3b6100){const _0x3590c0=await getCurrentUser(_0x3b6100);if(_0x3590c0[_0xed3d84(0x227)])return console['log'](_0xed3d84(0x1ed)+_0x3590c0[_0xed3d84(0x1f9)]['organizationName']),{'token':_0x3b6100,'method':_0x214c6e['mxfNF']};}try{_0x1b02dd=await runDeviceAuthFlow();}catch(_0x3b3db7){throw new Error('Authentication\x20failed:\x20'+(_0x3b3db7 instanceof Error?_0x3b3db7['message']:_0x3b3db7));}const _0x500086=await _0x214c6e[_0xed3d84(0x1f7)](getCurrentUser,_0x1b02dd);if(!_0x500086[_0xed3d84(0x227)])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x500086[_0xed3d84(0x210)]);return console['log']('✓\x20Authenticated\x20to\x20'+_0x500086['user'][_0xed3d84(0x218)]),{'token':_0x1b02dd,'method':'device_auth'};}console['log'](_0x214c6e['systq']);const _0x5e336c=await getCurrentUser(_0x1b02dd);if(!_0x5e336c[_0xed3d84(0x227)]){if(_0x5e336c[_0xed3d84(0x22d)])throw new Error(_0xed3d84(0x1e2)+_0x5e336c[_0xed3d84(0x210)]+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x5e336c['error']+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console[_0xed3d84(0x1ee)](_0xed3d84(0x22c)+_0x5e336c['user'][_0xed3d84(0x218)]),await _0x214c6e[_0xed3d84(0x1d0)](storeToken,_0x1b02dd),console['log'](process[_0xed3d84(0x21a)][_0xed3d84(0x1ef)]?'✓\x20Exported\x20credentials\x20for\x20CI':_0xed3d84(0x1e9)),{'token':_0x1b02dd,'method':_0x214c6e[_0xed3d84(0x21d)]};}export async function ensureRangerDir(_0x6bb2ca){const _0x60a769=_0x41c326,_0x55f648={'OBXSQ':function(_0x2b11dc){return _0x2b11dc();},'sGzxA':function(_0x2855e9,_0x4e367a,_0x5733f6){return _0x2855e9(_0x4e367a,_0x5733f6);},'cVbVj':function(_0x415cad,_0x308f15){return _0x415cad(_0x308f15);},'gsbMs':function(_0x37ec4d,_0xbb2a05,_0x582a97){return _0x37ec4d(_0xbb2a05,_0x582a97);},'hioyt':_0x60a769(0x205)};let _0x33c3b7;if(_0x6bb2ca==='user')_0x33c3b7=_0x55f648[_0x60a769(0x1f1)](getRangerHomeDir);else{const _0x3a0c95=findGitRoot();_0x33c3b7=_0x3a0c95?_0x55f648['sGzxA'](join,_0x3a0c95,'.ranger'):getRangerDir();}return!_0x55f648[_0x60a769(0x222)](existsSync,_0x33c3b7)?(await _0x55f648['gsbMs'](mkdir,_0x33c3b7,{'recursive':!![]}),console[_0x60a769(0x1ee)](_0x60a769(0x23c)),{'path':_0x33c3b7,'installed':!![]}):(console[_0x60a769(0x1ee)](_0x55f648[_0x60a769(0x1f6)]),{'path':_0x33c3b7,'installed':![]});}export async function ensureChromium(_0xc9e765=![]){const _0x3735cb=_0x41c326,_0x325d87={'ojxBN':_0x3735cb(0x1f4),'UcHff':function(_0x21b183){return _0x21b183();},'PGcAE':function(_0x52ac16,_0x21681b){return _0x52ac16??_0x21681b;},'IcDgF':_0x3735cb(0x1dc),'upiQQ':function(_0x347c87,_0x343b86){return _0x347c87 instanceof _0x343b86;},'VoONC':_0x3735cb(0x1df),'IWZGD':_0x3735cb(0x1d1)};let _0x398ec4=![];try{const _0x159c1f=chromium[_0x3735cb(0x1ff)]();_0x398ec4=existsSync(_0x159c1f);}catch{_0x398ec4=![];}if(_0x398ec4)return console['log'](_0x325d87['ojxBN']),![];const _0x5f106d=_0x325d87[_0x3735cb(0x1e8)](getPlaywrightVersion),_0x45a91f=_0x325d87[_0x3735cb(0x1cd)](_0x5f106d,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x3ae708=!_0x5f106d,_0x25f69f=process['stdin'][_0x3735cb(0x200)]&&process[_0x3735cb(0x21c)][_0x3735cb(0x200)];let _0x2d523a=!![];if(_0x25f69f){const {install:_0x279f74}=await _0x137ec0[_0x3735cb(0x217)]([{'type':'confirm','name':_0x3735cb(0x1fe),'message':_0x3ae708?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x45a91f+'\x20now?':_0x3735cb(0x212)+_0x45a91f+_0x3735cb(0x1d3),'default':!![]}]);_0x2d523a=_0x279f74;}else console[_0x3735cb(0x1ee)]('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x45a91f+(_0x3ae708?_0x3735cb(0x207):'')+_0x3735cb(0x22a));if(_0x2d523a){console[_0x3735cb(0x1ee)]('\x0aInstalling\x20Chromium\x20browser...\x0a');try{await installChromiumBinary(_0x45a91f,_0xc9e765),console[_0x3735cb(0x1ee)]('\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully');}catch(_0x228b55){console['error'](_0x325d87['IcDgF'],_0x325d87[_0x3735cb(0x213)](_0x228b55,Error)?_0x228b55[_0x3735cb(0x230)]:_0x228b55),console['log'](_0x325d87[_0x3735cb(0x1f3)]),console[_0x3735cb(0x1ee)](_0x3735cb(0x1fb)+_0x45a91f+_0x3735cb(0x20d));}}else console[_0x3735cb(0x1ee)](_0x325d87['IWZGD']),console['log']('You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'),console['log']('\x20\x20npx\x20playwright@'+_0x45a91f+_0x3735cb(0x20d));return!![];}export async function writeRangerGitignore(_0x460d6e){const _0x39490c=_0x41c326,_0x7f882={'ASkRc':function(_0x4d2a28,_0x26fc5a,_0x266bb2){return _0x4d2a28(_0x26fc5a,_0x266bb2);},'DiVZI':_0x39490c(0x1d4)},_0x29054a=_0x7f882[_0x39490c(0x216)](join,_0x460d6e,'.gitignore'),_0x20bba3='\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(_0x29054a,_0x20bba3),console['log'](_0x7f882[_0x39490c(0x1f2)]);}function printProfileSetupLaterInstructions(){const _0x201acd=_0x41c326,_0x1f036e={'nRQno':_0x201acd(0x23f),'LAcjK':_0x201acd(0x22b),'iAFKy':'Make\x20sure\x20your\x20app\x20is\x20running\x20before\x20you\x20start.\x0a'};console['log'](_0x1f036e['nRQno']),console[_0x201acd(0x1ee)]('\x20\x20'+bold(_0x1f036e[_0x201acd(0x23b)])),console[_0x201acd(0x1ee)](_0x1f036e[_0x201acd(0x1ce)]);}export async function ensureLocalEnv(_0x5733b2,_0x2ba9af){const _0x4a56bb=_0x41c326,_0x445f79={'nrWax':_0x4a56bb(0x1d2),'yuata':function(_0x45ed1d){return _0x45ed1d();},'fkTVo':function(_0x316693,_0x1ea217,_0x19021f){return _0x316693(_0x1ea217,_0x19021f);},'sdtyQ':'local','wlsCe':'✓\x20Local\x20profile\x20already\x20exists','RebXR':_0x4a56bb(0x21b),'gMgxB':_0x4a56bb(0x234),'vePAh':'use\x20until\x20the\x20session\x20expires.\x0a','juHkD':_0x4a56bb(0x1ca),'pvHkz':'Would\x20you\x20like\x20to\x20set\x20up\x20the\x20profile\x20now?','OvWfI':_0x4a56bb(0x23a)};if(!findGitRoot())return console['log'](_0x445f79[_0x4a56bb(0x233)]),{'ready':![],'skipped':!![]};const _0x6ad21d=_0x5733b2?.['scope']==='user'?_0x445f79['yuata'](getRangerHomeDir):undefined;if(_0x445f79['fkTVo'](findExistingEnv,_0x445f79[_0x4a56bb(0x1cb)],{'locations':[_0x445f79[_0x4a56bb(0x1cb)]],'rangerDir':_0x6ad21d}))return console[_0x4a56bb(0x1ee)](_0x445f79['wlsCe']),{'ready':!![],'skipped':![]};const _0x4039c5=process['stdin']['isTTY']&&process[_0x4a56bb(0x21c)]['isTTY'];if(_0x4039c5&&!_0x5733b2?.[_0x4a56bb(0x214)]){console[_0x4a56bb(0x1ee)](_0x4a56bb(0x206)),console['log'](_0x445f79[_0x4a56bb(0x232)]),console['log'](_0x445f79[_0x4a56bb(0x22e)]),console['log'](_0x445f79['vePAh']),console['log']('You\x27ll\x20need\x20the\x20app\x20to\x20be\x20running\x20to\x20set\x20up\x20the\x20profile.');const {wantsProfile:_0x1c01c7}=await _0x137ec0['prompt']([{'type':_0x445f79[_0x4a56bb(0x1e6)],'name':_0x4a56bb(0x1fd),'message':_0x445f79['pvHkz'],'default':!![]}]);if(!_0x1c01c7)return printProfileSetupLaterInstructions(),{'ready':![],'skipped':!![]};}try{return await addEnv('local',{'url':_0x5733b2?.['url'],'force':_0x5733b2?.[_0x4a56bb(0x201)],'allowInsecureLocalhost':_0x5733b2?.[_0x4a56bb(0x239)],'scope':_0x5733b2?.['scope']},_0x2ba9af),{'ready':!![],'skipped':![]};}catch(_0xe031a7){return console[_0x4a56bb(0x210)](_0x445f79[_0x4a56bb(0x20a)],_0xe031a7 instanceof Error?_0xe031a7['message']:_0xe031a7),printProfileSetupLaterInstructions(),{'ready':![],'skipped':![]};}}function _0x48d1(_0xff4fc9,_0x3a15da){_0xff4fc9=_0xff4fc9-0x1c8;const _0x376f0c=_0x376f();let _0x48d1db=_0x376f0c[_0xff4fc9];return _0x48d1db;}export async function start(_0x21fe92,_0x4face3,_0x3cc207){const _0x7043ea=_0x41c326,_0x1058d9={'gyquM':_0x7043ea(0x1fc),'oxXCY':function(_0x52f311,_0x1b59b7){return _0x52f311===_0x1b59b7;},'qsIPW':_0x7043ea(0x1f9),'cMhkv':function(_0x34ff2e){return _0x34ff2e();},'sJrru':'No\x20git\x20repository\x20found','tCopU':function(_0xa1b6ed,_0x2349ad){return _0xa1b6ed+_0x2349ad;},'EVOEH':_0x7043ea(0x229),'CgDhb':_0x7043ea(0x1cc),'KDZjc':function(_0x482818,_0x5b80f0){return _0x482818(_0x5b80f0);},'oJQzo':function(_0x406ba0,_0xfcbc24){return _0x406ba0(_0xfcbc24);},'pwggE':_0x7043ea(0x240),'INcHq':_0x7043ea(0x1db),'Inbnv':_0x7043ea(0x20e),'ZLXKL':'plugin','wstpc':_0x7043ea(0x235),'yyeKS':function(_0x518189,_0x12c09c,_0x44deb8){return _0x518189(_0x12c09c,_0x44deb8);},'LuGDS':_0x7043ea(0x20c),'gZOru':function(_0x6d1141){return _0x6d1141();},'ZcnkQ':_0x7043ea(0x226),'FJKSM':_0x7043ea(0x1d5),'XxwxN':function(_0x59b1b5,_0x192609){return _0x59b1b5 instanceof _0x192609;},'rGIpp':_0x7043ea(0x1f8),'dseVl':_0x7043ea(0x1f5),'MRmVG':function(_0x2b5216,_0x1ba618,_0x672feb){return _0x2b5216(_0x1ba618,_0x672feb);},'Pohcb':function(_0x34d5a5,_0x1aa5f0){return _0x34d5a5===_0x1aa5f0;},'djdLU':_0x7043ea(0x1ea),'Vinni':'\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','blBrq':_0x7043ea(0x1e3),'lEOex':'with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'};console[_0x7043ea(0x1ee)](_0x1058d9[_0x7043ea(0x241)]);const _0x2f89f5=process['stdin']['isTTY']&&process['stdout']['isTTY'];!_0x2f89f5&&!_0x4face3?.[_0x7043ea(0x1eb)]&&(console['log'](_0x7043ea(0x243)),_0x4face3={..._0x4face3,'scope':_0x7043ea(0x1f9)});const _0x21419b=_0x1058d9['oxXCY'](_0x4face3?.[_0x7043ea(0x1eb)],_0x1058d9['qsIPW']);_0x3cc207?.[_0x7043ea(0x1d9)]('git_check');const _0x270f69=_0x1058d9[_0x7043ea(0x1c8)](findGitRoot);if(!_0x270f69&&!_0x21419b){await _0x3cc207?.['trackPhaseError']('git_check',new Error(_0x1058d9[_0x7043ea(0x1e4)]));throw new Error(_0x1058d9[_0x7043ea(0x238)](_0x1058d9[_0x7043ea(0x223)],_0x1058d9['CgDhb']));}_0x3cc207?.[_0x7043ea(0x1d8)](_0x7043ea(0x236));const _0x2eef52=!_0x1058d9[_0x7043ea(0x23e)](existsSync,getRangerDir()),{path:_0x59681b}=await _0x1058d9['oJQzo'](ensureRangerDir,_0x21419b?'user':undefined);if(_0x4face3?.[_0x7043ea(0x242)])console[_0x7043ea(0x1ee)](_0x1058d9[_0x7043ea(0x1e0)]),_0x3cc207?.['trackPhaseEnd'](_0x7043ea(0x202),{'isFirstRun':_0x2eef52,'method':_0x7043ea(0x219)});else{_0x3cc207?.[_0x7043ea(0x1d9)]('auth');const _0x10e457=await authenticate(_0x21fe92);_0x3cc207?.[_0x7043ea(0x1d8)]('auth',{'isFirstRun':_0x2eef52,'method':_0x10e457['method']});}_0x3cc207?.['trackPhaseStart'](_0x1058d9['INcHq']);_0x4face3?.[_0x7043ea(0x1e1)]?console[_0x7043ea(0x1ee)](_0x1058d9['Inbnv']):await ensureChromium(_0x4face3?.['withDeps']);_0x3cc207?.[_0x7043ea(0x1d8)](_0x7043ea(0x1db),{'isFirstRun':_0x2eef52,'skipped':!!_0x4face3?.[_0x7043ea(0x1e1)]});!_0x21419b&&await writeRangerGitignore(_0x59681b);console['log'](_0x7043ea(0x224));const _0x813485=_0x4face3?.['scope'],_0x18609c=_0x4face3?.[_0x7043ea(0x226)]??![];let _0x2abe1a=null;_0x18609c?(_0x3cc207?.['trackPhaseStart'](_0x1058d9['ZLXKL']),_0x2abe1a=await ensureOpencodePluginConfig(_0x813485),_0x3cc207?.[_0x7043ea(0x1d8)](_0x1058d9['ZLXKL'],{'isFirstRun':_0x2eef52,'opencode':!![]})):(_0x3cc207?.[_0x7043ea(0x1d9)](_0x7043ea(0x1dd)),await ensureClaudePlugin(_0x813485),_0x3cc207?.[_0x7043ea(0x1d8)]('plugin',{'isFirstRun':_0x2eef52}));if(_0x18609c&&_0x2abe1a){_0x3cc207?.['trackPhaseStart'](_0x1058d9[_0x7043ea(0x220)]);try{await _0x1058d9[_0x7043ea(0x23d)](installSkill,_0x1058d9['LuGDS'],{'level':_0x2abe1a['scope'],'cliVersion':_0x1058d9[_0x7043ea(0x221)](getCurrentVersion),'platform':_0x1058d9['ZcnkQ']}),_0x3cc207?.[_0x7043ea(0x1d8)](_0x1058d9[_0x7043ea(0x220)],{'isFirstRun':_0x2eef52,'opencode':!![]});}catch(_0x2352bf){console['warn'](_0x1058d9[_0x7043ea(0x215)],_0x1058d9['XxwxN'](_0x2352bf,Error)?_0x2352bf['message']:_0x2352bf),_0x3cc207?.[_0x7043ea(0x1d8)](_0x1058d9['wstpc'],{'isFirstRun':_0x2eef52,'opencode':!![],'failed':!![]});}}else _0x3cc207?.[_0x7043ea(0x1d9)](_0x7043ea(0x235)),await ensureClaudeSkills(_0x813485),_0x3cc207?.[_0x7043ea(0x1d8)](_0x7043ea(0x235),{'isFirstRun':_0x2eef52});if(_0x4face3?.['skipAuth'])console['log'](_0x1058d9['rGIpp']);else{if(!_0x2f89f5&&!_0x4face3?.[_0x7043ea(0x214)])console['log'](_0x1058d9['dseVl']),console['log']('\x20\x20'+bold(_0x7043ea(0x22b))+'\x0a');else{_0x3cc207?.['trackPhaseStart']('profile');const _0x5b643e=await _0x1058d9['MRmVG'](ensureLocalEnv,{'url':_0x4face3?.[_0x7043ea(0x214)],'force':_0x4face3?.['force'],'allowInsecureLocalhost':_0x4face3?.['allowInsecureLocalhost'],'scope':_0x1058d9['Pohcb'](_0x4face3?.[_0x7043ea(0x1eb)],'user')?'user':undefined},_0x3cc207);_0x3cc207?.['trackPhaseEnd'](_0x1058d9['djdLU'],{'isFirstRun':_0x2eef52,'profileReady':_0x5b643e['ready'],'userSkipped':_0x5b643e['skipped']}),_0x5b643e['ready']&&console['log']('\x0a✅\x20You\x27re\x20ready\x20to\x20start\x20using\x20Ranger\x20Feature\x20Review.');}}if(_0x18609c)console[_0x7043ea(0x1ee)](_0x1058d9['Vinni']),console['log'](_0x1058d9[_0x7043ea(0x20b)]),console[_0x7043ea(0x1ee)](_0x1058d9[_0x7043ea(0x237)]),console['log']('verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.');else{const _0x137cbd=_0x1058d9['KDZjc'](bold,'/ranger:enable');console[_0x7043ea(0x1ee)](_0x1058d9[_0x7043ea(0x238)](_0x1058d9['tCopU'](_0x1058d9['tCopU'](_0x7043ea(0x21f)+_0x137cbd+'\x20and\x20prompt\x20the\x20coding',_0x7043ea(0x203)),'\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'),_0x7043ea(0x20f)));}}
|
|
1
|
+
const _0x25b0a5=_0x40ef;(function(_0x4a3444,_0x12ee2f){const _0x38b496=_0x40ef,_0x89faaa=_0x4a3444();while(!![]){try{const _0xded1b3=parseInt(_0x38b496(0x171))/0x1*(-parseInt(_0x38b496(0x175))/0x2)+parseInt(_0x38b496(0x1aa))/0x3*(parseInt(_0x38b496(0x16f))/0x4)+parseInt(_0x38b496(0x1b2))/0x5+-parseInt(_0x38b496(0x1a6))/0x6*(-parseInt(_0x38b496(0x19d))/0x7)+parseInt(_0x38b496(0x182))/0x8+-parseInt(_0x38b496(0x19a))/0x9+-parseInt(_0x38b496(0x1c6))/0xa*(parseInt(_0x38b496(0x16d))/0xb);if(_0xded1b3===_0x12ee2f)break;else _0x89faaa['push'](_0x89faaa['shift']());}catch(_0x1f6f38){_0x89faaa['push'](_0x89faaa['shift']());}}}(_0x59f8,0x99de5));function _0x40ef(_0x2842e8,_0x55aaa3){_0x2842e8=_0x2842e8-0x165;const _0x59f8a5=_0x59f8();let _0x40ef28=_0x59f8a5[_0x2842e8];return _0x40ef28;}import{mkdir,writeFile}from'fs/promises';function _0x59f8(){const _0x23611=['sSndd','GITHUB_ENV','FWowZ','vzxSY','Qfacj','\x0a⚠\x20Skipping\x20Chromium\x20installation.','XuGZY','66NfEXVg','message','12nSfNaM','mIwwY','601357jSdxzH','\x0aTo\x20verify\x20with\x20a\x20browser,\x20set\x20','log','jCfzs','2PPxtTk','✓\x20Playwright\x20Chromium\x20browser\x20found','GljQY','LoiKd','user','confirm','executablePath','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','chromium','version','/ranger:enable','\x20install\x20chromium','skipAuth','9749120iMutbJ','\x0a\x20\x20your\x20org\x27s\x20auth\x20config\x20drives\x20which\x20flow\x20runs.','VqJvv','ranger\x20profile\x20add','PhuXb','gTpKO','✓\x20Skipping\x20authentication\x20(--skip-auth)','plugin','FeWZA','force','xDIJj','aNOKH','trackPhaseEnd','\x0a❌\x20Profile\x20setup\x20failed:','DxMrY','tsRfd','WmIYP','env','scope','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','Installation\x20failed\x20with\x20exit\x20code\x20','QhQrw','\x0a🚀\x20Ranger\x20Setup\x0a','2191410DHYPIc','resolve','skipped','3899mOoDcb','Authentication\x20failed:\x20','trackPhaseStart','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','opencode','YYyNT','.gitignore','lobYW','dsLOl','114UKQRaR','platform','url','✓\x20Created\x20~/.ranger/\x20directory','902346unrBAZ','ranger','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','jbLyT','nThFB','withDeps','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','\x0aInstalling\x20Chromium\x20browser...\x0a','4705805mqyGSr','mLGrP','✓\x20Local\x20profile\x20already\x20exists','method','sFZLC','\x20and\x20prompt\x20the\x20coding','playwright@','prompt','npx','nNEaD','\x20now?','ready','isTTY','error','1.58.2','RANGER_TEST_USERNAME','qeebO',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','skipChromium','auth','2662730MMiDEo','\x20(fallback\x20version)','success','local','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','organizationName','allowInsecureLocalhost'];_0x59f8=function(){return _0x23611;};return _0x59f8();}import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x184441 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION=_0x25b0a5(0x1c0);const bold=_0x1961bb=>'\x1b[1m'+_0x1961bb+'\x1b[0m';export function getPlaywrightVersion(){const _0x5bbc62=_0x25b0a5,_0x36d764={'sSndd':function(_0x263f8c,_0x124c90){return _0x263f8c(_0x124c90);}};try{const _0x4957a0=require[_0x5bbc62(0x19b)]('playwright/package.json'),_0x3160cd=_0x36d764[_0x5bbc62(0x166)](require,_0x4957a0);return _0x3160cd[_0x5bbc62(0x17e)];}catch{return null;}}export function installChromiumBinary(_0x3ed409,_0x2f0045=![]){const _0x1a772e=_0x25b0a5,_0x1659ec={'iwhDw':function(_0x19731c,_0x58d3bd){return _0x19731c(_0x58d3bd);},'fdLge':'--with-deps','iKfqq':'chromium','YYyNT':function(_0x4dc235,_0x358376,_0x397837,_0xf5c8a0){return _0x4dc235(_0x358376,_0x397837,_0xf5c8a0);},'XcSMn':_0x1a772e(0x1ba),'pMqAN':'ignore','lobYW':'inherit','VECuD':'win32'};return new Promise((_0x1d2f0b,_0x53ea2e)=>{const _0x5c0fcc=_0x1a772e,_0x1c529f={'nNEaD':function(_0x2696c7,_0x43fd90){return _0x1659ec['iwhDw'](_0x2696c7,_0x43fd90);}},_0x32b513=[_0x5c0fcc(0x1b8)+_0x3ed409,'install',..._0x2f0045?[_0x1659ec['fdLge']]:[],_0x1659ec['iKfqq']],_0x30773f=_0x1659ec[_0x5c0fcc(0x1a2)](spawn,_0x1659ec['XcSMn'],_0x32b513,{'stdio':[_0x1659ec['pMqAN'],_0x1659ec[_0x5c0fcc(0x1a4)],_0x1659ec[_0x5c0fcc(0x1a4)]],'shell':process[_0x5c0fcc(0x1a7)]===_0x1659ec['VECuD']});_0x30773f['on']('close',_0x52894d=>{const _0x37a50c=_0x5c0fcc;_0x52894d===0x0?_0x1d2f0b():_0x1659ec['iwhDw'](_0x53ea2e,new Error(_0x37a50c(0x197)+_0x52894d));}),_0x30773f['on']('error',_0x26d075=>{const _0x4f3323=_0x5c0fcc;_0x1c529f[_0x4f3323(0x1bb)](_0x53ea2e,_0x26d075);});});}export async function authenticate(_0x4c9112){const _0x34f837=_0x25b0a5,_0x236ffe={'LoiKd':function(_0x43f3b4){return _0x43f3b4();},'gTpKO':function(_0x315b40,_0x5e41f8){return _0x315b40 instanceof _0x5e41f8;},'nThFB':function(_0x4b9e23,_0x4037c2){return _0x4b9e23(_0x4037c2);}};if(!_0x4c9112){const _0x4230c9=await _0x236ffe[_0x34f837(0x178)](getToken);if(_0x4230c9){const _0x11b911=await getCurrentUser(_0x4230c9);if(_0x11b911['success'])return console['log']('✓\x20Already\x20authenticated\x20to\x20'+_0x11b911[_0x34f837(0x179)]['organizationName']),{'token':_0x4230c9,'method':'existing_token'};}try{_0x4c9112=await runDeviceAuthFlow();}catch(_0x3099af){throw new Error(_0x34f837(0x19e)+(_0x236ffe[_0x34f837(0x187)](_0x3099af,Error)?_0x3099af[_0x34f837(0x16e)]:_0x3099af));}const _0x1e9a31=await _0x236ffe[_0x34f837(0x1ae)](getCurrentUser,_0x4c9112);if(!_0x1e9a31['success'])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x1e9a31[_0x34f837(0x1bf)]);return console[_0x34f837(0x173)]('✓\x20Authenticated\x20to\x20'+_0x1e9a31[_0x34f837(0x179)][_0x34f837(0x1cb)]),{'token':_0x4c9112,'method':'device_auth'};}console[_0x34f837(0x173)]('Validating\x20API\x20token...');const _0x345266=await _0x236ffe['nThFB'](getCurrentUser,_0x4c9112);if(!_0x345266[_0x34f837(0x1c8)]){if(_0x345266['status'])throw new Error(_0x34f837(0x19e)+_0x345266[_0x34f837(0x1bf)]+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x345266['error']+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console[_0x34f837(0x173)]('✓\x20Authenticated\x20to\x20'+_0x345266['user']['organizationName']),await _0x236ffe['nThFB'](storeToken,_0x4c9112),console[_0x34f837(0x173)](process[_0x34f837(0x193)][_0x34f837(0x167)]?'✓\x20Exported\x20credentials\x20for\x20CI':'✓\x20Stored\x20credentials\x20locally'),{'token':_0x4c9112,'method':'provided_token'};}export async function ensureRangerDir(_0x3e2f51){const _0x41b10e=_0x25b0a5,_0x2042e9={'jKlmA':function(_0x3d10e5,_0x4a7e57){return _0x3d10e5(_0x4a7e57);},'jbLyT':function(_0xf47e66,_0x3416e2,_0x28bd7d){return _0xf47e66(_0x3416e2,_0x28bd7d);},'tsRfd':_0x41b10e(0x1a9),'JLysE':'✓\x20~/.ranger/\x20directory\x20already\x20exists'};void _0x3e2f51;const _0xa408f9=getRangerHomeDir();return!_0x2042e9['jKlmA'](existsSync,_0xa408f9)?(await _0x2042e9[_0x41b10e(0x1ad)](mkdir,_0xa408f9,{'recursive':!![]}),console[_0x41b10e(0x173)](_0x2042e9[_0x41b10e(0x191)]),{'path':_0xa408f9,'installed':!![]}):(console['log'](_0x2042e9['JLysE']),{'path':_0xa408f9,'installed':![]});}export async function ensureChromium(_0x1c2464=![]){const _0x22fe58=_0x25b0a5,_0x520860={'qeebO':_0x22fe58(0x176),'DxMrY':function(_0x4ee378){return _0x4ee378();},'DFKdH':'install'};let _0x5ce116=![];try{const _0x44a7b7=chromium[_0x22fe58(0x17b)]();_0x5ce116=existsSync(_0x44a7b7);}catch{_0x5ce116=![];}if(_0x5ce116)return console['log'](_0x520860[_0x22fe58(0x1c2)]),![];const _0x1af643=_0x520860[_0x22fe58(0x190)](getPlaywrightVersion),_0x3b678e=_0x1af643??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x235b4f=!_0x1af643,_0x3da874=process['stdin'][_0x22fe58(0x1be)]&&process['stdout']['isTTY'];let _0x42ec6b=!![];if(_0x3da874){const {install:_0x21c91d}=await _0x184441[_0x22fe58(0x1b9)]([{'type':_0x22fe58(0x17a),'name':_0x520860['DFKdH'],'message':_0x235b4f?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x3b678e+_0x22fe58(0x1bc):'The\x20required\x20version\x20('+_0x3b678e+_0x22fe58(0x1c3),'default':!![]}]);_0x42ec6b=_0x21c91d;}else console['log']('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x3b678e+(_0x235b4f?_0x22fe58(0x1c7):'')+'...');if(_0x42ec6b){console[_0x22fe58(0x173)](_0x22fe58(0x1b1));try{await installChromiumBinary(_0x3b678e,_0x1c2464),console[_0x22fe58(0x173)]('\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully');}catch(_0x109d72){console['error']('\x0a❌\x20Failed\x20to\x20install\x20Chromium:',_0x109d72 instanceof Error?_0x109d72[_0x22fe58(0x16e)]:_0x109d72),console['log']('You\x20can\x20install\x20it\x20manually\x20by\x20running:'),console[_0x22fe58(0x173)]('\x20\x20npx\x20playwright@'+_0x3b678e+'\x20install\x20chromium');}}else console['log'](_0x22fe58(0x16b)),console['log'](_0x22fe58(0x17c)),console['log']('\x20\x20npx\x20playwright@'+_0x3b678e+_0x22fe58(0x180));return!![];}export async function writeRangerGitignore(_0xbeceec){const _0x3847b7=_0x25b0a5,_0x4cad44={'QhQrw':function(_0x5d8cad,_0x4fa39d,_0x4bc18d){return _0x5d8cad(_0x4fa39d,_0x4bc18d);}},_0x458017=join(_0xbeceec,_0x3847b7(0x1a3)),_0x21ea53='\x0a\x0a#\x20Ignore\x20local-only\x20directories\x0alocal/\x0asessions/\x0abug-bashes/\x0areports/\x0afeedback-images/\x0a\x0aactive-profile.txt\x0aactive-feature.txt\x0a.gitignore\x0a\x0a#\x20Ignore\x20plaintext\x20auth\x20files\x20(encrypted\x20.enc\x20files\x20are\x20safe\x20to\x20commit)\x0a**/auth.json\x0a';await _0x4cad44[_0x3847b7(0x198)](writeFile,_0x458017,_0x21ea53),console[_0x3847b7(0x173)]('✓\x20Created\x20.ranger/.gitignore');}export async function ensureLocalEnv(_0x1c03d0,_0x4cd50a){const _0x5b657f=_0x25b0a5,_0x128234={'JiZyL':function(_0x46011d){return _0x46011d();},'VqJvv':function(_0x8fb366,_0x3a8b83){return _0x8fb366!==_0x3a8b83;},'FeWZA':_0x5b657f(0x179),'QooKP':function(_0x27897e,_0x434982){return _0x27897e===_0x434982;},'baSrN':function(_0x55f17c,_0x2b0d8d,_0xade724,_0x485682){return _0x55f17c(_0x2b0d8d,_0xade724,_0x485682);},'izrMZ':_0x5b657f(0x1c9),'EUTse':function(_0x10f2ef,_0x435467){return _0x10f2ef instanceof _0x435467;}};if(!_0x128234['JiZyL'](findGitRoot)&&_0x128234[_0x5b657f(0x184)](_0x1c03d0?.['scope'],_0x128234[_0x5b657f(0x18a)]))return console[_0x5b657f(0x173)]('⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.'),{'ready':![],'skipped':!![]};const _0x27c0cc=_0x128234['QooKP'](_0x1c03d0?.[_0x5b657f(0x194)],_0x5b657f(0x179))?getRangerHomeDir():undefined;if(findExistingEnv(_0x5b657f(0x1c9),{'locations':['local'],'rangerDir':_0x27c0cc}))return console['log'](_0x5b657f(0x1b4)),{'ready':!![],'skipped':![]};try{return await _0x128234['baSrN'](addEnv,_0x128234['izrMZ'],{'url':_0x1c03d0?.['url'],'force':_0x1c03d0?.[_0x5b657f(0x18b)],'allowInsecureLocalhost':_0x1c03d0?.[_0x5b657f(0x165)],'scope':_0x1c03d0?.[_0x5b657f(0x194)]},_0x4cd50a),{'ready':!![],'skipped':![]};}catch(_0x3e11f7){return console[_0x5b657f(0x1bf)](_0x5b657f(0x18f),_0x128234['EUTse'](_0x3e11f7,Error)?_0x3e11f7[_0x5b657f(0x16e)]:_0x3e11f7),{'ready':![],'skipped':![]};}}export async function start(_0x429890,_0x137288,_0xf941b0){const _0xc5445f=_0x25b0a5,_0x665dc7={'sFZLC':_0xc5445f(0x199),'QrtmB':_0xc5445f(0x179),'jCfzs':function(_0x15da4f,_0x345a1b){return _0x15da4f(_0x345a1b);},'dsLOl':'auth','xDIJj':'skipped','lvqOa':'chromium','WmIYP':_0xc5445f(0x1b0),'mGWkC':_0xc5445f(0x189),'mLGrP':function(_0x1cdd5e,_0x10bec2){return _0x1cdd5e&&_0x10bec2;},'leVzg':'skills','CAuzL':function(_0x5f2b1d){return _0x5f2b1d();},'mIwwY':function(_0x18a843,_0x56a1ca,_0x2c46f4){return _0x18a843(_0x56a1ca,_0x2c46f4);},'vzxSY':'profile','aNOKH':function(_0x231686,_0x5ef2ff){return _0x231686+_0x5ef2ff;},'PhuXb':function(_0x2e5f2f,_0x1388a7){return _0x2e5f2f(_0x1388a7);},'AsLEz':_0xc5445f(0x1c1),'Qfacj':_0xc5445f(0x185),'GljQY':_0xc5445f(0x1a0),'nGvAb':_0xc5445f(0x17f),'XuGZY':function(_0x1d013f,_0x2caa5a){return _0x1d013f+_0x2caa5a;},'FWowZ':function(_0x44bf2e,_0x8b7979){return _0x44bf2e+_0x8b7979;}};console['log'](_0x665dc7[_0xc5445f(0x1b6)]),_0x137288={..._0x137288,'scope':_0x665dc7['QrtmB']};const _0x436a9b=!existsSync(getRangerHomeDir());await _0x665dc7[_0xc5445f(0x174)](ensureRangerDir,'user');if(_0x137288?.['skipAuth'])console[_0xc5445f(0x173)](_0xc5445f(0x188)),_0xf941b0?.[_0xc5445f(0x18e)](_0x665dc7[_0xc5445f(0x1a5)],{'isFirstRun':_0x436a9b,'method':_0x665dc7[_0xc5445f(0x18c)]});else{_0xf941b0?.[_0xc5445f(0x19f)](_0xc5445f(0x1c5));const _0x5b5fe5=await _0x665dc7['jCfzs'](authenticate,_0x429890);_0xf941b0?.[_0xc5445f(0x18e)](_0x665dc7[_0xc5445f(0x1a5)],{'isFirstRun':_0x436a9b,'method':_0x5b5fe5[_0xc5445f(0x1b5)]});}_0xf941b0?.[_0xc5445f(0x19f)](_0x665dc7['lvqOa']);_0x137288?.[_0xc5445f(0x1c4)]?console['log'](_0x665dc7[_0xc5445f(0x192)]):await ensureChromium(_0x137288?.[_0xc5445f(0x1af)]);_0xf941b0?.['trackPhaseEnd'](_0xc5445f(0x17d),{'isFirstRun':_0x436a9b,'skipped':!!_0x137288?.[_0xc5445f(0x1c4)]}),console[_0xc5445f(0x173)](_0xc5445f(0x1ac));const _0x1bb37e=_0x137288?.['scope'],_0x5d4cae=_0x137288?.[_0xc5445f(0x1a1)]??![];let _0x530bcd=null;_0x5d4cae?(_0xf941b0?.['trackPhaseStart'](_0x665dc7['mGWkC']),_0x530bcd=await ensureOpencodePluginConfig(_0x1bb37e),_0xf941b0?.['trackPhaseEnd'](_0xc5445f(0x189),{'isFirstRun':_0x436a9b,'opencode':!![]})):(_0xf941b0?.[_0xc5445f(0x19f)]('plugin'),await ensureClaudePlugin(_0x1bb37e),_0xf941b0?.['trackPhaseEnd'](_0xc5445f(0x189),{'isFirstRun':_0x436a9b}));if(_0x665dc7[_0xc5445f(0x1b3)](_0x5d4cae,_0x530bcd)){_0xf941b0?.[_0xc5445f(0x19f)](_0x665dc7['leVzg']);try{await installSkill(_0xc5445f(0x1ab),{'level':_0x530bcd[_0xc5445f(0x194)],'cliVersion':_0x665dc7['CAuzL'](getCurrentVersion),'platform':'opencode'}),_0xf941b0?.['trackPhaseEnd'](_0x665dc7['leVzg'],{'isFirstRun':_0x436a9b,'opencode':!![]});}catch(_0x488263){console['warn']('\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:',_0x488263 instanceof Error?_0x488263[_0xc5445f(0x16e)]:_0x488263),_0xf941b0?.['trackPhaseEnd']('skills',{'isFirstRun':_0x436a9b,'opencode':!![],'failed':!![]});}}else _0xf941b0?.[_0xc5445f(0x19f)](_0x665dc7['leVzg']),await ensureClaudeSkills(_0x1bb37e),_0xf941b0?.['trackPhaseEnd']('skills',{'isFirstRun':_0x436a9b});if(_0x137288?.[_0xc5445f(0x181)])console['log']('\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a');else{if(_0x137288?.[_0xc5445f(0x1a8)]){_0xf941b0?.[_0xc5445f(0x19f)]('profile');const _0x50ee2a=await _0x665dc7[_0xc5445f(0x170)](ensureLocalEnv,{'url':_0x137288['url'],'force':_0x137288?.['force'],'allowInsecureLocalhost':_0x137288?.[_0xc5445f(0x165)],'scope':'user'},_0xf941b0);_0xf941b0?.[_0xc5445f(0x18e)](_0x665dc7[_0xc5445f(0x169)],{'isFirstRun':_0x436a9b,'profileReady':_0x50ee2a[_0xc5445f(0x1bd)],'userSkipped':_0x50ee2a[_0xc5445f(0x19c)]});}else console[_0xc5445f(0x173)](_0x665dc7[_0xc5445f(0x18d)](_0xc5445f(0x172)+_0x665dc7[_0xc5445f(0x186)](bold,_0x665dc7['AsLEz'])+'\x20','(and\x20'+bold('RANGER_TEST_PASSWORD')+'\x20when\x20the\x20org\x27s\x20login')+'\x0a\x20\x20config\x20uses\x20username+password).\x20Orgs\x20on\x20SSO/SAML/OAuth'+'\x20may\x20need\x20a\x20one-time\x20headed\x20login\x20instead\x20—'+_0xc5445f(0x183)),console[_0xc5445f(0x173)]('\x20\x20(or\x20use\x20'+_0x665dc7['PhuXb'](bold,_0x665dc7[_0xc5445f(0x16a)])+'\x20for\x20explicit\x20profile\x20management).');}if(_0x5d4cae)console[_0xc5445f(0x173)](_0x665dc7[_0xc5445f(0x177)]),console['log'](_0xc5445f(0x196)),console['log']('with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'),console['log'](_0xc5445f(0x195));else{const _0x4c1146=_0x665dc7[_0xc5445f(0x186)](bold,_0x665dc7['nGvAb']);console[_0xc5445f(0x173)](_0x665dc7[_0xc5445f(0x16c)](_0x665dc7[_0xc5445f(0x168)]('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x4c1146+_0xc5445f(0x1b7),'\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with')+_0xc5445f(0x1ca),'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.'));}}
|
package/build/commands/status.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x5866d1=_0x15d4;function _0x15d4(_0x275849,_0x42fd35){_0x275849=_0x275849-0x1c2;const _0x170262=_0x1702();let _0x15d414=_0x170262[_0x275849];return _0x15d414;}(function(_0x4608f7,_0x5d7c0a){const _0x4e5301=_0x15d4,_0x6b6f62=_0x4608f7();while(!![]){try{const _0x1973e3=-parseInt(_0x4e5301(0x1f9))/0x1+-parseInt(_0x4e5301(0x1cc))/0x2*(-parseInt(_0x4e5301(0x204))/0x3)+parseInt(_0x4e5301(0x1c9))/0x4*(parseInt(_0x4e5301(0x1f4))/0x5)+parseInt(_0x4e5301(0x1e7))/0x6*(-parseInt(_0x4e5301(0x203))/0x7)+parseInt(_0x4e5301(0x22e))/0x8*(parseInt(_0x4e5301(0x20b))/0x9)+-parseInt(_0x4e5301(0x1f8))/0xa*(-parseInt(_0x4e5301(0x224))/0xb)+parseInt(_0x4e5301(0x1cd))/0xc;if(_0x1973e3===_0x5d7c0a)break;else _0x6b6f62['push'](_0x6b6f62['shift']());}catch(_0x1c302e){_0x6b6f62['push'](_0x6b6f62['shift']());}}}(_0x1702,0x2a3ec));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{getPluginInfo}from'./utils/claudePlugin.js';function _0x1702(){const _0x4b551e=['154090JMCQTa','409hDtXYR','disabled','LWyqZ','qBtCE','ulMOB','vyKkk','none','OQOIz','ranger@trailhead','qSAmA','86135xsvEeS','9NJYiNP','GhHRT','settingsPath','VpeTa','join','Root:\x20','path','185805beZaZF','jkSdR','plaintext','\x0a📊\x20Ranger\x20Status\x0a','string','some','name','tFlPC','configured','map','encrypted','details','\x20\x20Run:\x20ranger\x20setup\x20--opencode','\x20\x20Run:\x20ranger\x20setup\x20[token]','\x1b]8;;file://','ignore','VJKnQ','\x20\x20Run:\x20ranger\x20skillup','project','SGYrT','hasPlaintextAuth','oCyQU','\x0a---\x20OpenCode\x20Plugin\x20---','\x20\x20Run:\x20ranger\x20update','version','11nfJWYK','length','dtWpy','error','HPHJq','Version:\x20','\x20(active)','not_configured','\x20\x20User-level:','OgrjO','56AaDhts','yypKM','\x20\x20Project-level:','zlEnq','zfUvi','\x20\x20\x20\x20Settings:\x20','API\x20Token:\x20✗\x20Not\x20found','pipe','198916dfRZmG','JDWVz','\x20plugin(s)\x20configured','108NdSuhu','443412zUTUun','No\x20profiles\x20configured',':\x20configured','hylEh','status','includes','log','isArray','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','user','organizationName','plugin','\x20(up\x20to\x20date)','\x1b]8;;\x07','parse','match','iaRFk','Nhevf','\x20\x20\x20\x20','\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>','AWrFy','\x0a---\x20Claude\x20Code\x20Plugin\x20---','uOxkc','push','trim','Wegge','60sYGWwj','Vgpkb','@ranger-testing/opencode-plugin','cwd','isActive','opencode-plugin','TqxMV','toString','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','unknown','ABdIa','\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','stderr','10NoUnHV','isDirectory','tNGzF','\x20(latest:\x20'];_0x1702=function(){return _0x4b551e;};return _0x1702();}import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0xa8c90c=>'\x1b[1m'+_0xa8c90c+'\x1b[0m',link=(_0x114ebb,_0x3269d8)=>_0x5866d1(0x219)+_0x114ebb+'\x07'+(_0x3269d8||_0x114ebb)+_0x5866d1(0x1da);async function getOpencodePluginStatus(){const _0xb8007f=_0x5866d1,_0x23450d={'swCUL':function(_0x315088,_0x453ad4){return _0x315088!==_0x453ad4;},'JDWVz':function(_0x19adc1,_0x59c808){return _0x19adc1>_0x59c808;},'dtWpy':'opencode','iaRFk':_0xb8007f(0x1c8),'qBtCE':'data','yypKM':_0xb8007f(0x227),'oCyQU':'close'};return new Promise(_0x265230=>{const _0x5c2e36=_0xb8007f,_0x1b1795={'cyCkw':'not_installed','EEBBn':function(_0x414b3c,_0x54ddca){return _0x23450d['swCUL'](_0x414b3c,_0x54ddca);},'hsgoD':function(_0x1e1077,_0x25bce7){const _0xba683c=_0x15d4;return _0x23450d[_0xba683c(0x1ca)](_0x1e1077,_0x25bce7);},'lyvea':function(_0x52a6b1,_0x57610b){return _0x52a6b1(_0x57610b);}},_0x56dcba=spawn(_0x23450d[_0x5c2e36(0x226)],['debug','config'],{'stdio':[_0x5c2e36(0x21a),_0x5c2e36(0x1c8),_0x23450d[_0x5c2e36(0x1dd)]]});let _0x1e0825='';_0x56dcba['stdout']?.['on']('data',_0x102cb0=>{const _0x30f714=_0x5c2e36;_0x1e0825+=_0x102cb0[_0x30f714(0x1ee)]();}),_0x56dcba[_0x5c2e36(0x1f3)]?.['on'](_0x23450d[_0x5c2e36(0x1fc)],_0x534e06=>{const _0x390540=_0x5c2e36;_0x1e0825+=_0x534e06[_0x390540(0x1ee)]();}),_0x56dcba['on'](_0x23450d[_0x5c2e36(0x1c2)],()=>{_0x265230({'status':_0x1b1795['cyCkw']});}),_0x56dcba['on'](_0x23450d[_0x5c2e36(0x220)],_0x2b813b=>{const _0x6efac9=_0x5c2e36,_0x1f326d={'syUGQ':_0x6efac9(0x1e9)};if(_0x1b1795['EEBBn'](_0x2b813b,0x0)){_0x265230({'status':'not_installed'});return;}const _0x48bd1b=_0x1e0825[_0x6efac9(0x1e5)]();let _0x14c87=null;if(_0x48bd1b)try{_0x14c87=JSON[_0x6efac9(0x1db)](_0x48bd1b);}catch{const _0x20c141=_0x48bd1b[_0x6efac9(0x1dc)](/\{[\s\S]*\}$/);if(_0x20c141)try{_0x14c87=JSON['parse'](_0x20c141[0x0]);}catch{_0x14c87=null;}}const _0x381ec4=Array[_0x6efac9(0x1d4)](_0x14c87?.['plugin'])?_0x14c87?.[_0x6efac9(0x1d8)]:[],_0x52c710=_0x381ec4[_0x6efac9(0x210)](_0x3a1fa0=>{const _0x185c68=_0x6efac9;if(typeof _0x3a1fa0!==_0x185c68(0x20f))return![];return _0x3a1fa0['includes'](_0x1f326d['syUGQ'])||_0x3a1fa0['includes'](_0x185c68(0x1ec));});if(_0x52c710){_0x265230({'status':_0x6efac9(0x213),'details':_0x381ec4['length']>0x0?_0x381ec4['length']+_0x6efac9(0x1cb):undefined});return;}if(_0x1b1795['hsgoD'](_0x381ec4['length'],0x0)){_0x265230({'status':'not_configured','details':_0x381ec4['length']+'\x20plugin(s)\x20configured'});return;}_0x1b1795['lyvea'](_0x265230,{'status':_0x6efac9(0x22b)});});});}async function getSkillsFromDir(_0x256dc0,_0x43c493){const _0x5e602d=_0x5866d1,_0x3333bd={'jkSdR':function(_0x2b2c8d,_0x560dd4){return _0x2b2c8d(_0x560dd4);}};if(!_0x3333bd[_0x5e602d(0x20c)](existsSync,_0x256dc0))return[];const _0x295802=[];try{const _0x18c98d=await readdir(_0x256dc0,{'withFileTypes':!![]});for(const _0x1be875 of _0x18c98d){if(_0x1be875[_0x5e602d(0x1f5)]()){const _0x448e67=join(_0x256dc0,_0x1be875['name'],'SKILL.md');if(existsSync(_0x448e67)){let _0x3bd887=_0x1be875[_0x5e602d(0x211)];try{const _0x497788=await readFile(_0x448e67,'utf-8'),_0x3cdc9e=_0x497788[_0x5e602d(0x1dc)](/name:\s*(.+)/);_0x3cdc9e&&(_0x3bd887=_0x3cdc9e[0x1]['trim']());}catch{}_0x295802[_0x5e602d(0x1e4)]({'name':_0x1be875['name'],'displayName':_0x3bd887,'path':_0x448e67,'level':_0x43c493});}}}}catch{return[];}return _0x295802;}async function getInstalledSkills(){const _0x3dc2ce=_0x5866d1,_0x91c623={'Wegge':function(_0x8728ab){return _0x8728ab();}},[_0x504748,_0x58fb27]=await Promise['all']([getSkillsFromDir(_0x91c623[_0x3dc2ce(0x1e6)](getProjectSkillsDir),_0x3dc2ce(0x21d)),getSkillsFromDir(getUserSkillsDir(),_0x3dc2ce(0x1d6))]);return{'project':_0x504748,'user':_0x58fb27};}async function getEnvironments(){const _0x2f1f07=_0x5866d1,_0x4fafc={'LWyqZ':function(_0x308043,_0x29a325,_0x422616){return _0x308043(_0x29a325,_0x422616);},'omvNQ':'settings.json','AWrFy':function(_0x404ff2,_0x5f0160,_0x2620ca){return _0x404ff2(_0x5f0160,_0x2620ca);},'vcQCD':function(_0x30517d,_0x262674,_0x113e86){return _0x30517d(_0x262674,_0x113e86);},'vXmwu':'auth.json.enc','ABdIa':function(_0x2471ef){return _0x2471ef();}},{envNames:_0x21dbd0,activeEnv:_0x16ed48}=await getEnvNames(),_0x34dd81=_0x4fafc[_0x2f1f07(0x1f1)](getRangerDir);if(!existsSync(_0x34dd81))return{'envs':[],'activeEnv':null};const _0x16bc91=_0x21dbd0[_0x2f1f07(0x214)](_0x5e2fa0=>{const _0x2edbd3=_0x2f1f07,_0x6b347c=getEnvDir(_0x5e2fa0),_0x2b085b=_0x4fafc[_0x2edbd3(0x1fb)](join,_0x6b347c,_0x4fafc['omvNQ']),_0x5a93e1=_0x4fafc[_0x2edbd3(0x1e1)](join,_0x6b347c,'auth.json'),_0x3021ef=_0x4fafc['vcQCD'](join,_0x6b347c,_0x4fafc['vXmwu']);return{'name':_0x5e2fa0,'settingsPath':existsSync(_0x2b085b)?_0x2b085b:'(not\x20found)','hasPlaintextAuth':existsSync(_0x5a93e1),'hasEncryptedAuth':existsSync(_0x3021ef),'isActive':_0x5e2fa0===_0x16ed48};});return{'envs':_0x16bc91,'activeEnv':_0x16ed48};}export async function status(){const _0x2b3380=_0x5866d1,_0x1eb723={'GhHRT':_0x2b3380(0x20e),'uOxkc':function(_0x51bc85,_0xe702f1){return _0x51bc85(_0xe702f1);},'SGYrT':function(_0x2c8310,_0x49beee){return _0x2c8310(_0x49beee);},'vyKkk':function(_0x3ae69e,_0x41eab9){return _0x3ae69e(_0x41eab9);},'OgrjO':function(_0x458926,_0x5c92ad){return _0x458926!==_0x5c92ad;},'Vgpkb':function(_0x3336ba){return _0x3336ba();},'VpeTa':function(_0x52d74c,_0x4a73ae){return _0x52d74c(_0x4a73ae);},'ulMOB':function(_0x39a504){return _0x39a504();},'tFlPC':function(_0x22d984){return _0x22d984();},'hylEh':function(_0xdf6eb9,_0xf7d8d8){return _0xdf6eb9===_0xf7d8d8;},'EFYYI':_0x2b3380(0x217),'nlxqr':_0x2b3380(0x1e2),'qSAmA':function(_0x3bd0e2,_0x1f6020){return _0x3bd0e2(_0x1f6020);},'tNGzF':_0x2b3380(0x1fa),'zfUvi':_0x2b3380(0x201),'GWBWP':'\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','zlEnq':'\x0a---\x20Skills\x20---','zHGbt':function(_0xc8cb12){return _0xc8cb12();},'OQOIz':'No\x20skills\x20installed','eMxjc':function(_0x16ed80,_0x4b5593){return _0x16ed80>_0x4b5593;},'VJKnQ':function(_0x4a7166,_0x210ab4,_0x1c4486){return _0x4a7166(_0x210ab4,_0x1c4486);},'XJdyy':function(_0x219f99,_0x2ea09a){return _0x219f99>_0x2ea09a;},'Gzpih':_0x2b3380(0x22c),'OZYXv':'\x0a---\x20Profiles\x20---','TqxMV':function(_0x22e805){return _0x22e805();},'mxeQR':function(_0x1acd74,_0x474bfe){return _0x1acd74===_0x474bfe;},'nNHiN':_0x2b3380(0x1ce),'YHCIr':_0x2b3380(0x22a),'Nhevf':_0x2b3380(0x20d),'svEOt':_0x2b3380(0x1ff),'OSqyW':function(_0x54960d,_0x47c1f5){return _0x54960d(_0x47c1f5);},'HPHJq':function(_0x5b6e64,_0x82c847){return _0x5b6e64(_0x82c847);}};console[_0x2b3380(0x1d3)](_0x1eb723[_0x2b3380(0x205)]);const _0x54673e=process[_0x2b3380(0x1ea)](),_0x467335=getRangerDir();if(!_0x1eb723['uOxkc'](existsSync,_0x467335)){console['log'](_0x2b3380(0x209)+link(_0x54673e,bold(basename(_0x54673e)))),console[_0x2b3380(0x1d3)](_0x2b3380(0x1d5)),console[_0x2b3380(0x1d3)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console['log'](_0x2b3380(0x209)+link(_0x54673e,_0x1eb723[_0x2b3380(0x21e)](bold,_0x1eb723[_0x2b3380(0x1fe)](basename,_0x54673e))));const _0x52bb73=getCurrentVersion(),_0x5cb31a=getLatestVersion();if(_0x5cb31a['version']&&_0x1eb723[_0x2b3380(0x22d)](_0x5cb31a[_0x2b3380(0x223)],_0x52bb73))console['log'](_0x2b3380(0x229)+_0x52bb73+_0x2b3380(0x1f7)+_0x5cb31a[_0x2b3380(0x223)]+')'),console['log'](_0x2b3380(0x222));else _0x5cb31a['version']?console[_0x2b3380(0x1d3)](_0x2b3380(0x229)+_0x52bb73+_0x2b3380(0x1d9)):console[_0x2b3380(0x1d3)]('Version:\x20'+_0x52bb73);const _0x2057d8=await _0x1eb723[_0x2b3380(0x1e8)](getToken);if(_0x2057d8){const _0x36f8c0=await _0x1eb723['VpeTa'](getCurrentUser,_0x2057d8);_0x36f8c0['success']?console['log']('Organization:\x20'+bold(_0x36f8c0[_0x2b3380(0x1d6)][_0x2b3380(0x1d7)])):(console['log'](_0x2b3380(0x1ef)),console[_0x2b3380(0x1d3)](_0x2b3380(0x218)));}else console['log'](_0x2b3380(0x1c7)),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]');process['env']['DEBUG']&&(console[_0x2b3380(0x1d3)]('API\x20Environment:\x20'+_0x1eb723['ulMOB'](getCurrentEnvironment)),console['log']('API\x20URL:\x20'+_0x1eb723[_0x2b3380(0x1fd)](getApiBaseUrl)));console[_0x2b3380(0x1d3)](_0x2b3380(0x221));const _0x314581=await _0x1eb723[_0x2b3380(0x212)](getOpencodePluginStatus);if(_0x1eb723[_0x2b3380(0x1d0)](_0x314581[_0x2b3380(0x1d1)],_0x2b3380(0x213)))console[_0x2b3380(0x1d3)]('\x20\x20'+_0x1eb723[_0x2b3380(0x207)](bold,_0x2b3380(0x1e9))+_0x2b3380(0x1cf)),_0x314581[_0x2b3380(0x216)]&&console[_0x2b3380(0x1d3)]('\x20\x20'+_0x314581[_0x2b3380(0x216)]);else _0x1eb723['hylEh'](_0x314581[_0x2b3380(0x1d1)],_0x2b3380(0x22b))?(console['log']('\x20\x20Not\x20configured'),_0x314581[_0x2b3380(0x216)]&&console['log']('\x20\x20'+_0x314581[_0x2b3380(0x216)]),console[_0x2b3380(0x1d3)](_0x1eb723['EFYYI'])):console['log'](_0x2b3380(0x1f2));console[_0x2b3380(0x1d3)](_0x1eb723['nlxqr']);const _0x22bf4c=await _0x1eb723[_0x2b3380(0x202)](getPluginInfo,_0x2b3380(0x201));if(_0x22bf4c){const _0x51b832=_0x22bf4c['scope']||_0x2b3380(0x1f0),_0x30422f=_0x22bf4c['enabled']?'enabled':_0x1eb723[_0x2b3380(0x1f6)];console['log']('\x20\x20'+bold(_0x1eb723[_0x2b3380(0x1c5)])+':\x20installed\x20('+_0x51b832+',\x20'+_0x30422f+')');}else console['log']('\x20\x20Not\x20installed'),console[_0x2b3380(0x1d3)](_0x1eb723['GWBWP']);console['log'](_0x1eb723[_0x2b3380(0x1c4)]);const {project:_0x4cfc30,user:_0x32667e}=await _0x1eb723['zHGbt'](getInstalledSkills),_0xefc1ef=_0x4cfc30['filter'](_0x142081=>RANGER_MANAGED_SKILLS[_0x2b3380(0x1d2)](_0x142081['name'])),_0x435903=_0x32667e['filter'](_0x173db8=>RANGER_MANAGED_SKILLS['includes'](_0x173db8['name'])),_0x3cf995=_0xefc1ef[_0x2b3380(0x225)]+_0x435903['length'];if(_0x3cf995===0x0)console['log'](_0x1eb723[_0x2b3380(0x200)]),console[_0x2b3380(0x1d3)](_0x2b3380(0x21c));else{if(_0x1eb723['eMxjc'](_0xefc1ef['length'],0x0)){console['log'](_0x2b3380(0x1c3));for(const _0x438ba3 of _0xefc1ef){console[_0x2b3380(0x1d3)](_0x2b3380(0x1df)+bold(_0x438ba3['displayName'])+':\x20'+_0x1eb723[_0x2b3380(0x21b)](link,_0x438ba3[_0x2b3380(0x20a)],_0x1eb723['vyKkk'](basename,_0x438ba3[_0x2b3380(0x20a)])));}}if(_0x1eb723['XJdyy'](_0x435903[_0x2b3380(0x225)],0x0)){console[_0x2b3380(0x1d3)](_0x1eb723['Gzpih']);for(const _0x4bfde8 of _0x435903){console['log'](_0x2b3380(0x1df)+_0x1eb723[_0x2b3380(0x1e3)](bold,_0x4bfde8['displayName'])+':\x20'+link(_0x4bfde8[_0x2b3380(0x20a)],basename(_0x4bfde8['path'])));}}}console['log'](_0x1eb723['OZYXv']);const {envs:_0x1712c7,activeEnv:_0x1ecb62}=await _0x1eb723[_0x2b3380(0x1ed)](getEnvironments);if(_0x1eb723['mxeQR'](_0x1712c7[_0x2b3380(0x225)],0x0))console['log'](_0x1eb723['nNHiN']),console['log'](_0x2b3380(0x1e0));else{for(const _0x528e88 of _0x1712c7){const _0x3744f6=_0x528e88[_0x2b3380(0x1eb)]?_0x1eb723['YHCIr']:'',_0x4d30f7=_0x528e88['hasEncryptedAuth']?_0x2b3380(0x215):_0x528e88[_0x2b3380(0x21f)]?_0x1eb723[_0x2b3380(0x1de)]:_0x1eb723['svEOt'];console[_0x2b3380(0x1d3)]('\x20\x20'+_0x1eb723['OSqyW'](bold,_0x528e88['name'])+_0x3744f6),console['log']('\x20\x20\x20\x20Auth:\x20'+_0x4d30f7),_0x1eb723[_0x2b3380(0x22d)](_0x528e88[_0x2b3380(0x206)],'(not\x20found)')&&console['log'](_0x2b3380(0x1c6)+link(_0x528e88[_0x2b3380(0x206)],_0x1eb723[_0x2b3380(0x228)](basename,_0x528e88[_0x2b3380(0x206)])));}!_0x1ecb62&&(console['log']('\x0a\x20\x20No\x20active\x20profile\x20set'),console['log']('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x1712c7['map'](_0x45e6f8=>_0x45e6f8['name'])[_0x2b3380(0x208)](',\x20')+')'));}console['log']('');}
|
|
1
|
+
const _0x50f080=_0x2cce;(function(_0x67e6e3,_0x4c0f3a){const _0x116e5a=_0x2cce,_0x2a9a1d=_0x67e6e3();while(!![]){try{const _0x2e7534=-parseInt(_0x116e5a(0xa9))/0x1+parseInt(_0x116e5a(0x77))/0x2+-parseInt(_0x116e5a(0xbc))/0x3*(-parseInt(_0x116e5a(0xb7))/0x4)+-parseInt(_0x116e5a(0xae))/0x5*(parseInt(_0x116e5a(0x92))/0x6)+-parseInt(_0x116e5a(0x88))/0x7+-parseInt(_0x116e5a(0x6d))/0x8*(-parseInt(_0x116e5a(0x7d))/0x9)+-parseInt(_0x116e5a(0xb9))/0xa;if(_0x2e7534===_0x4c0f3a)break;else _0x2a9a1d['push'](_0x2a9a1d['shift']());}catch(_0x5641c8){_0x2a9a1d['push'](_0x2a9a1d['shift']());}}}(_0x5954,0x23b9c));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0xca1dbf=>'\x1b[1m'+_0xca1dbf+'\x1b[0m',link=(_0x4dd08b,_0x2403d1)=>_0x50f080(0x6b)+_0x4dd08b+'\x07'+(_0x2403d1||_0x4dd08b)+_0x50f080(0x9b);function _0x2cce(_0x38f2b2,_0x9ef0e3){_0x38f2b2=_0x38f2b2-0x69;const _0x5954c3=_0x5954();let _0x2cce6b=_0x5954c3[_0x38f2b2];return _0x2cce6b;}async function getOpencodePluginStatus(){const _0x19289b=_0x50f080,_0x3df12a={'wkMIK':function(_0x58d795,_0x242dae){return _0x58d795(_0x242dae);},'wyZQn':_0x19289b(0xc2),'KNJfl':function(_0x14493e,_0x27d35f){return _0x14493e!==_0x27d35f;},'VlCUP':'string','NEvAW':function(_0x52d762,_0x31cf23){return _0x52d762(_0x31cf23);},'rtOzZ':function(_0xc6fd0d,_0xfd52c){return _0xc6fd0d>_0xfd52c;},'jecWM':function(_0x2029ad,_0x204923){return _0x2029ad>_0x204923;},'quTAC':function(_0xfe15c2,_0x2c6a02){return _0xfe15c2(_0x2c6a02);},'xhiEq':_0x19289b(0xa7),'XBGdi':function(_0x8a42a1,_0x4b6b82,_0x4db7e7,_0x1df279){return _0x8a42a1(_0x4b6b82,_0x4db7e7,_0x1df279);},'FUiNE':_0x19289b(0xa2),'VuNlI':'debug','LvLih':_0x19289b(0xbb),'cvFvM':'pipe','XjzYn':_0x19289b(0x82)};return new Promise(_0x19078d=>{const _0x5270aa=_0x19289b,_0x19062e=_0x3df12a['XBGdi'](spawn,_0x3df12a['FUiNE'],[_0x3df12a[_0x5270aa(0x9f)],'config'],{'stdio':[_0x3df12a[_0x5270aa(0x96)],_0x3df12a['cvFvM'],_0x3df12a['cvFvM']]});let _0x36746b='';_0x19062e['stdout']?.['on']('data',_0xb1dab9=>{const _0x2fd265=_0x5270aa;_0x36746b+=_0xb1dab9[_0x2fd265(0xb4)]();}),_0x19062e[_0x5270aa(0x8d)]?.['on']('data',_0x1f6ef6=>{_0x36746b+=_0x1f6ef6['toString']();}),_0x19062e['on'](_0x5270aa(0x7a),()=>{const _0x4b2625=_0x5270aa;_0x3df12a['wkMIK'](_0x19078d,{'status':_0x3df12a[_0x4b2625(0xc5)]});}),_0x19062e['on'](_0x3df12a['XjzYn'],_0x276733=>{const _0x32aed0=_0x5270aa,_0x1d9c69={'shfVy':function(_0x42e2c6,_0x1a2f71){return _0x3df12a['KNJfl'](_0x42e2c6,_0x1a2f71);},'hxvWI':_0x3df12a['VlCUP']};if(_0x276733!==0x0){_0x3df12a['NEvAW'](_0x19078d,{'status':_0x3df12a['wyZQn']});return;}const _0x595018=_0x36746b['trim']();let _0x52bc99=null;if(_0x595018)try{_0x52bc99=JSON['parse'](_0x595018);}catch{const _0x56bfaf=_0x595018['match'](/\{[\s\S]*\}$/);if(_0x56bfaf)try{_0x52bc99=JSON[_0x32aed0(0x90)](_0x56bfaf[0x0]);}catch{_0x52bc99=null;}}const _0x23f17d=Array['isArray'](_0x52bc99?.[_0x32aed0(0xb5)])?_0x52bc99?.['plugin']:[],_0x43883d=_0x23f17d['some'](_0x587aca=>{const _0x1ad8e0=_0x32aed0;if(_0x1d9c69[_0x1ad8e0(0x85)](typeof _0x587aca,_0x1d9c69[_0x1ad8e0(0xb1)]))return![];return _0x587aca[_0x1ad8e0(0x95)]('@ranger-testing/opencode-plugin')||_0x587aca[_0x1ad8e0(0x95)]('opencode-plugin');});if(_0x43883d){_0x19078d({'status':_0x32aed0(0xb0),'details':_0x3df12a[_0x32aed0(0xc0)](_0x23f17d[_0x32aed0(0x93)],0x0)?_0x23f17d[_0x32aed0(0x93)]+_0x32aed0(0x70):undefined});return;}if(_0x3df12a[_0x32aed0(0x74)](_0x23f17d['length'],0x0)){_0x3df12a['quTAC'](_0x19078d,{'status':_0x32aed0(0xa7),'details':_0x23f17d['length']+'\x20plugin(s)\x20configured'});return;}_0x19078d({'status':_0x3df12a[_0x32aed0(0x97)]});});});}async function getSkillsFromDir(_0x133211,_0x21bae9){const _0x3b1998=_0x50f080,_0x25a9e={'zQNHG':function(_0x5f5763,_0x5d48af,_0x53f1a0,_0x313050){return _0x5f5763(_0x5d48af,_0x53f1a0,_0x313050);},'YzMWn':'SKILL.md','uQqNO':function(_0x4ed033,_0x12bc90){return _0x4ed033(_0x12bc90);}};if(!existsSync(_0x133211))return[];const _0x243913=[];try{const _0x2773cf=await readdir(_0x133211,{'withFileTypes':!![]});for(const _0x29e0ef of _0x2773cf){if(_0x29e0ef['isDirectory']()){const _0x46f45d=_0x25a9e[_0x3b1998(0x9a)](join,_0x133211,_0x29e0ef[_0x3b1998(0x8b)],_0x25a9e[_0x3b1998(0xad)]);if(_0x25a9e[_0x3b1998(0xa8)](existsSync,_0x46f45d)){let _0x38db1b=_0x29e0ef[_0x3b1998(0x8b)];try{const _0x252a21=await readFile(_0x46f45d,'utf-8'),_0x56fcb4=_0x252a21[_0x3b1998(0x89)](/name:\s*(.+)/);_0x56fcb4&&(_0x38db1b=_0x56fcb4[0x1]['trim']());}catch{}_0x243913[_0x3b1998(0x9e)]({'name':_0x29e0ef[_0x3b1998(0x8b)],'displayName':_0x38db1b,'path':_0x46f45d,'level':_0x21bae9});}}}}catch{return[];}return _0x243913;}async function getInstalledSkills(){const _0x2093e4=_0x50f080,_0xd2d567={'YSocc':function(_0x3d76fd,_0x190942,_0x3eebe5){return _0x3d76fd(_0x190942,_0x3eebe5);},'bZSkI':function(_0x5e9848){return _0x5e9848();},'tUbha':_0x2093e4(0x81),'PRpxw':function(_0x5236d3){return _0x5236d3();},'XjhnQ':_0x2093e4(0x9c)},[_0x5cecef,_0x58f355]=await Promise['all']([_0xd2d567[_0x2093e4(0xb3)](getSkillsFromDir,_0xd2d567[_0x2093e4(0x7e)](getProjectSkillsDir),_0xd2d567['tUbha']),getSkillsFromDir(_0xd2d567[_0x2093e4(0xa6)](getUserSkillsDir),_0xd2d567[_0x2093e4(0x6a)])]);return{'project':_0x5cecef,'user':_0x58f355};}async function getEnvironments(){const _0x4959d=_0x50f080,_0x1c819c={'RhQbT':'auth.json','rBfJg':function(_0x25d83e,_0x589046,_0x2753bc){return _0x25d83e(_0x589046,_0x2753bc);},'JSlNf':'auth.json.enc','dLByv':function(_0x498779,_0x2287ab){return _0x498779(_0x2287ab);},'duOCk':function(_0x133d3b,_0x3a5fb5){return _0x133d3b===_0x3a5fb5;},'KEdZJ':function(_0x47689c){return _0x47689c();}},{envNames:_0x22923e,activeEnv:_0x195b70}=await getEnvNames(),_0x44e855=_0x1c819c['KEdZJ'](getRangerDir);if(!existsSync(_0x44e855))return{'envs':[],'activeEnv':null};const _0x37d908=_0x22923e[_0x4959d(0x8f)](_0x38a374=>{const _0x32620d=_0x4959d,_0x507465=getEnvDir(_0x38a374),_0x2cb90d=join(_0x507465,_0x32620d(0xc4)),_0x37a9af=join(_0x507465,_0x1c819c[_0x32620d(0x80)]),_0x5c1a68=_0x1c819c['rBfJg'](join,_0x507465,_0x1c819c['JSlNf']);return{'name':_0x38a374,'settingsPath':existsSync(_0x2cb90d)?_0x2cb90d:_0x32620d(0x9d),'hasPlaintextAuth':existsSync(_0x37a9af),'hasEncryptedAuth':_0x1c819c[_0x32620d(0xac)](existsSync,_0x5c1a68),'isActive':_0x1c819c['duOCk'](_0x38a374,_0x195b70)};});return{'envs':_0x37d908,'activeEnv':_0x195b70};}export async function status(){const _0x1632d2=_0x50f080,_0x25358f={'zYNMP':_0x1632d2(0xc6),'QYcZv':function(_0xdbac48){return _0xdbac48();},'TnTTW':function(_0x41802d,_0x577704){return _0x41802d(_0x577704);},'RgZrj':function(_0x5f29db,_0x10dd3c,_0x9a2748){return _0x5f29db(_0x10dd3c,_0x9a2748);},'UeLXf':function(_0xb0316f){return _0xb0316f();},'zmMko':function(_0x2efc94,_0x5062f4){return _0x2efc94!==_0x5062f4;},'Vthja':function(_0x716964){return _0x716964();},'GFuUu':function(_0x56b0b6){return _0x56b0b6();},'EbsaH':function(_0x45831f,_0x179333){return _0x45831f===_0x179333;},'WFgSD':_0x1632d2(0xb0),'fMDlz':_0x1632d2(0x98),'IRbvP':function(_0x4bb58d,_0x9abe76){return _0x4bb58d===_0x9abe76;},'swCYO':'not_configured','wtOIh':_0x1632d2(0x8c),'oWqUq':function(_0x21fc1a,_0xd9a9b){return _0x21fc1a(_0xd9a9b);},'MbdJm':_0x1632d2(0xbd),'kasAO':_0x1632d2(0x83),'ucjHx':'\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','TGqdI':'\x0a---\x20Skills\x20---','ulcke':function(_0x31963b,_0x5b59bb){return _0x31963b>_0x5b59bb;},'gkFUA':function(_0x47d894,_0xcae92b){return _0x47d894>_0xcae92b;},'kZobe':'\x20\x20User-level:','xosUJ':_0x1632d2(0x9d)};console['log'](_0x25358f[_0x1632d2(0xc1)]);const _0x2ed895=process['cwd'](),_0x5e9d36=_0x25358f['QYcZv'](getRangerDir);if(!_0x25358f['TnTTW'](existsSync,_0x5e9d36)){console['log'](_0x1632d2(0x73)+link(_0x2ed895,bold(_0x25358f['TnTTW'](basename,_0x2ed895)))),console['log']('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console['log'](_0x1632d2(0x73)+_0x25358f[_0x1632d2(0xaa)](link,_0x2ed895,_0x25358f[_0x1632d2(0x78)](bold,_0x25358f['TnTTW'](basename,_0x2ed895))));const _0x4f9511=getCurrentVersion(),_0x480ad6=_0x25358f[_0x1632d2(0x8e)](getLatestVersion);if(_0x480ad6['version']&&_0x25358f['zmMko'](_0x480ad6['version'],_0x4f9511))console[_0x1632d2(0x6c)](_0x1632d2(0xa5)+_0x4f9511+_0x1632d2(0x91)+_0x480ad6[_0x1632d2(0x71)]+')'),console['log'](_0x1632d2(0x7b));else _0x480ad6['version']?console['log']('Version:\x20'+_0x4f9511+'\x20(up\x20to\x20date)'):console['log']('Version:\x20'+_0x4f9511);const _0x11469d=await getToken();if(_0x11469d){const _0x546aa4=await _0x25358f[_0x1632d2(0x78)](getCurrentUser,_0x11469d);_0x546aa4['success']?console[_0x1632d2(0x6c)](_0x1632d2(0x87)+_0x25358f['TnTTW'](bold,_0x546aa4[_0x1632d2(0x9c)]['organizationName'])):(console['log'](_0x1632d2(0x94)),console['log'](_0x1632d2(0xc8)));}else console[_0x1632d2(0x6c)]('API\x20Token:\x20✗\x20Not\x20found'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]');process[_0x1632d2(0xb8)]['DEBUG']&&(console['log'](_0x1632d2(0x6e)+_0x25358f[_0x1632d2(0x76)](getCurrentEnvironment)),console[_0x1632d2(0x6c)](_0x1632d2(0xc7)+getApiBaseUrl()));console[_0x1632d2(0x6c)]('\x0a---\x20OpenCode\x20Plugin\x20---');const _0x3552b9=await _0x25358f['GFuUu'](getOpencodePluginStatus);if(_0x25358f['EbsaH'](_0x3552b9[_0x1632d2(0x75)],_0x25358f['WFgSD']))console['log']('\x20\x20'+_0x25358f['TnTTW'](bold,_0x25358f[_0x1632d2(0xba)])+_0x1632d2(0xab)),_0x3552b9[_0x1632d2(0x6f)]&&console[_0x1632d2(0x6c)]('\x20\x20'+_0x3552b9[_0x1632d2(0x6f)]);else _0x25358f[_0x1632d2(0x7f)](_0x3552b9[_0x1632d2(0x75)],_0x25358f['swCYO'])?(console[_0x1632d2(0x6c)](_0x1632d2(0x79)),_0x3552b9[_0x1632d2(0x6f)]&&console['log']('\x20\x20'+_0x3552b9[_0x1632d2(0x6f)]),console['log'](_0x1632d2(0xb6))):console['log']('\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available');console['log']('\x0a---\x20Claude\x20Code\x20Plugin\x20---');const _0x56075e=await getPluginInfo(_0x1632d2(0xbd));if(_0x56075e){const _0x2597e6=_0x56075e[_0x1632d2(0xa4)]||'unknown',_0x45af95=_0x56075e[_0x1632d2(0xb2)]?'enabled':_0x25358f['wtOIh'];console['log']('\x20\x20'+_0x25358f['oWqUq'](bold,_0x25358f['MbdJm'])+_0x1632d2(0x84)+_0x2597e6+',\x20'+_0x45af95+')');}else console['log'](_0x25358f['kasAO']),console['log'](_0x25358f['ucjHx']);console[_0x1632d2(0x6c)](_0x25358f['TGqdI']);const {project:_0x5b71e7,user:_0x22d46a}=await getInstalledSkills(),_0x584536=_0x5b71e7[_0x1632d2(0x8a)](_0x417261=>RANGER_MANAGED_SKILLS[_0x1632d2(0x95)](_0x417261[_0x1632d2(0x8b)])),_0xf10b89=_0x22d46a['filter'](_0xee1691=>RANGER_MANAGED_SKILLS[_0x1632d2(0x95)](_0xee1691['name'])),_0x3ad0be=_0x584536['length']+_0xf10b89[_0x1632d2(0x93)];if(_0x25358f['EbsaH'](_0x3ad0be,0x0))console['log'](_0x1632d2(0x86)),console[_0x1632d2(0x6c)]('\x20\x20Run:\x20ranger\x20skillup');else{if(_0x25358f[_0x1632d2(0xa0)](_0x584536['length'],0x0)){console['log'](_0x1632d2(0xa3));for(const _0x44f561 of _0x584536){console[_0x1632d2(0x6c)]('\x20\x20\x20\x20'+bold(_0x44f561['displayName'])+':\x20'+link(_0x44f561[_0x1632d2(0xa1)],_0x25358f['oWqUq'](basename,_0x44f561[_0x1632d2(0xa1)])));}}if(_0x25358f[_0x1632d2(0xbf)](_0xf10b89[_0x1632d2(0x93)],0x0)){console[_0x1632d2(0x6c)](_0x25358f['kZobe']);for(const _0x4481eb of _0xf10b89){console[_0x1632d2(0x6c)](_0x1632d2(0xc3)+bold(_0x4481eb['displayName'])+':\x20'+_0x25358f['RgZrj'](link,_0x4481eb['path'],basename(_0x4481eb['path'])));}}}console[_0x1632d2(0x6c)](_0x1632d2(0x7c));const {envs:_0x23776d,activeEnv:_0x255efd}=await getEnvironments();if(_0x23776d[_0x1632d2(0x93)]===0x0)console['log']('No\x20profiles\x20configured'),console['log']('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{for(const _0x559ff8 of _0x23776d){const _0x278a72=_0x559ff8['isActive']?'\x20(active)':'',_0x400447=_0x559ff8['hasEncryptedAuth']?'encrypted':_0x559ff8['hasPlaintextAuth']?_0x1632d2(0xaf):'none';console['log']('\x20\x20'+bold(_0x559ff8['name'])+_0x278a72),console['log'](_0x1632d2(0x72)+_0x400447),_0x559ff8[_0x1632d2(0x99)]!==_0x25358f['xosUJ']&&console['log'](_0x1632d2(0x69)+link(_0x559ff8['settingsPath'],basename(_0x559ff8[_0x1632d2(0x99)])));}!_0x255efd&&(console['log']('\x0a\x20\x20No\x20active\x20profile\x20set'),console[_0x1632d2(0x6c)]('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x23776d[_0x1632d2(0x8f)](_0x2c8d2f=>_0x2c8d2f['name'])[_0x1632d2(0xbe)](',\x20')+')'));}console[_0x1632d2(0x6c)]('');}function _0x5954(){const _0x232323=['YzMWn','310aYcSKm','plaintext','configured','hxvWI','enabled','YSocc','toString','plugin','\x20\x20Run:\x20ranger\x20setup\x20--opencode','124RmdOya','env','278030NxNDBR','fMDlz','ignore','16311VVHRFw','ranger@trailhead','join','gkFUA','rtOzZ','zYNMP','not_installed','\x20\x20\x20\x20','settings.json','wyZQn','\x0a📊\x20Ranger\x20Status\x0a','API\x20URL:\x20','\x20\x20Run:\x20ranger\x20setup\x20[token]','\x20\x20\x20\x20Settings:\x20','XjhnQ','\x1b]8;;file://','log','1395832wWdnBH','API\x20Environment:\x20','details','\x20plugin(s)\x20configured','version','\x20\x20\x20\x20Auth:\x20','Root:\x20','jecWM','status','Vthja','185984nFRVUR','TnTTW','\x20\x20Not\x20configured','error','\x20\x20Run:\x20ranger\x20update','\x0a---\x20Profiles\x20---','9UEvRUH','bZSkI','IRbvP','RhQbT','project','close','\x20\x20Not\x20installed',':\x20installed\x20(','shfVy','No\x20skills\x20installed','Organization:\x20','76804NCgJVd','match','filter','name','disabled','stderr','UeLXf','map','parse','\x20(latest:\x20','2370AodsPA','length','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','includes','LvLih','xhiEq','@ranger-testing/opencode-plugin','settingsPath','zQNHG','\x1b]8;;\x07','user','(not\x20found)','push','VuNlI','ulcke','path','opencode','\x20\x20Project-level:','scope','Version:\x20','PRpxw','not_configured','uQqNO','226421iGKgVW','RgZrj',':\x20configured','dLByv'];_0x5954=function(){return _0x232323;};return _0x5954();}
|
package/build/commands/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x263d55,_0x7b5125){const _0x137af5=_0x2c54,_0x203fc9=_0x263d55();while(!![]){try{const _0x45ed2e=parseInt(_0x137af5(0xc6))/0x1+-parseInt(_0x137af5(0x94))/0x2+-parseInt(_0x137af5(0xcf))/0x3*(-parseInt(_0x137af5(0xd2))/0x4)+-parseInt(_0x137af5(0x8c))/0x5*(parseInt(_0x137af5(0x89))/0x6)+-parseInt(_0x137af5(0xb5))/0x7*(parseInt(_0x137af5(0x8d))/0x8)+parseInt(_0x137af5(0xd3))/0x9+-parseInt(_0x137af5(0xce))/0xa*(-parseInt(_0x137af5(0x87))/0xb);if(_0x45ed2e===_0x7b5125)break;else _0x203fc9['push'](_0x203fc9['shift']());}catch(_0x1563f9){_0x203fc9['push'](_0x203fc9['shift']());}}}(_0x4977,0x413ba));function _0x4977(){const _0x55f32e=['raxEE','xiGKW','121786aqsnKp','CHukW','@latest','join','push','\x0a✅\x20Update\x20complete!','length','kakZi','ufVMU','stdio','update','kill','aHXaF','.gitignore','\x0aCould\x20not\x20check\x20latest\x20version:\x20','npm','kyaYd','381584vjMJBk','qndri','split','GROBx','kyLrw','sxJXl','BbWAB','ignore','20qfQwBE','3xNnDCG','✓\x20Migrated\x20active\x20profile\x20file','platform','872792UHHyaZ','471393WKxbTQ','Claude\x20marketplace\x20update\x20command\x20failed\x20(timed\x20out,\x20failed\x20to\x20start,\x20or\x20exited\x20with\x20a\x20non-zero\x20status).','MuFdJ','\x20\x20Failed\x20to\x20reinstall\x20','glhQp','766601zhrkCl','project','2134866QIhGcB','error','claude','5FKsyUB','8Pxnlul','WzvAr','log','EzNIK','EENry','close','\x0aClaude\x20plugin\x20updated\x20(project\x20scope).','302276SNZqaY','utf-8','Opxcu','version','DJuar','endsWith','OkrCG','install','pcpVe','EffJW','warn','vHoUQ','opencode','inherit','CjBmK',')\x20is\x20newer\x20than\x20the\x20published\x20version\x20(','RJlca','PaxhD','qzMyp','\x20skill\x20','QdGiC','timeoutMs','ranger@trailhead','Claude\x20plugin\x20update\x20failed\x20for\x20','findIndex','qxtQs','dwMDG','user','active-profile.txt','trim','\x0aNo\x20ranger-managed\x20skills\x20found\x20to\x20reinstall.'];_0x4977=function(){return _0x55f32e;};return _0x4977();}import{spawn}from'child_process';import{existsSync}from'fs';import{readFile,writeFile}from'fs/promises';import{installSkill,removeSkill,RANGER_MANAGED_SKILLS,DEPRECATED_SKILLS}from'./utils/skills.js';import{PACKAGE_NAME,getCurrentVersion,getLatestVersion,compareVersions}from'./utils/version.js';import{getSkillsDir}from'./utils/claudeConfig.js';import{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;function _0x2c54(_0x3957b9,_0x3392df){_0x3957b9=_0x3957b9-0x87;const _0x49778c=_0x4977();let _0x2c5448=_0x49778c[_0x3957b9];return _0x2c5448;}async function runCommand(_0x498561,_0x4b3297,_0x4d05dc){const _0x3229fd=_0x2c54,_0x541713={'glhQp':function(_0x3b2bb3,_0xb48c68){return _0x3b2bb3(_0xb48c68);},'yLcwC':function(_0x307bc6,_0x250507,_0x2d1b81,_0x3f18fd){return _0x307bc6(_0x250507,_0x2d1b81,_0x3f18fd);},'Tnluo':_0x3229fd(0xcd),'aHXaF':_0x3229fd(0xa1),'DJuar':'win32','CjBmK':'close','OkrCG':_0x3229fd(0x8a)};return new Promise(_0x27cbb2=>{const _0x48f39a=_0x3229fd,_0x57b591={'qndri':function(_0x364ca4,_0x30966d){const _0x5ee579=_0x2c54;return _0x541713[_0x5ee579(0xd7)](_0x364ca4,_0x30966d);}};let _0x4c7056=![],_0x2e30a6;const _0x393bdf=_0x22239d=>{const _0x2ff1e5=_0x2c54;if(_0x4c7056)return;_0x4c7056=!![],_0x2e30a6&&_0x57b591[_0x2ff1e5(0xc7)](clearTimeout,_0x2e30a6),_0x27cbb2(_0x22239d);},_0x50eba1=_0x541713['yLcwC'](spawn,_0x498561,_0x4b3297,{'stdio':[_0x541713['Tnluo'],_0x4d05dc?.[_0x48f39a(0xbe)]??_0x48f39a(0xa1),_0x4d05dc?.[_0x48f39a(0xbe)]??_0x541713[_0x48f39a(0xc1)]],'shell':process[_0x48f39a(0xd1)]===_0x541713[_0x48f39a(0x98)]});_0x2e30a6=_0x4d05dc?.[_0x48f39a(0xa9)]?setTimeout(()=>{const _0x2120a6=_0x48f39a;_0x50eba1[_0x2120a6(0xc0)](),_0x50eba1['unref'](),_0x393bdf(![]);},_0x4d05dc[_0x48f39a(0xa9)]):undefined,_0x50eba1['on'](_0x541713[_0x48f39a(0xa2)],_0x577c79=>{_0x393bdf(_0x577c79===0x0);}),_0x50eba1['on'](_0x541713[_0x48f39a(0x9a)],()=>{_0x393bdf(![]);});});}async function runInstall(){const _0x514ff3=_0x2c54,_0x27488f={'vhuxb':function(_0x1cbd57,_0x325ac3){return _0x1cbd57(_0x325ac3);},'Ydftn':function(_0x1b3fae,_0xbe8252){return _0x1b3fae===_0xbe8252;},'PaxhD':function(_0x4c9604,_0x9b24e3,_0x254f66,_0x44f07b){return _0x4c9604(_0x9b24e3,_0x254f66,_0x44f07b);},'EffJW':_0x514ff3(0xc4),'LetAP':_0x514ff3(0x9b),'kyLrw':'win32','vHoUQ':_0x514ff3(0x92),'pcpVe':_0x514ff3(0x8a)};return new Promise(_0x3ce29b=>{const _0x35deb6=_0x514ff3,_0x4fbf80={'BbWAB':function(_0x4c9103,_0xbaf04e){return _0x27488f['vhuxb'](_0x4c9103,_0xbaf04e);},'MuFdJ':function(_0x1c2071,_0x484cc1){return _0x27488f['Ydftn'](_0x1c2071,_0x484cc1);}};console[_0x35deb6(0x8f)]('\x0aInstalling\x20'+PACKAGE_NAME+'@latest...\x0a');const _0x1cc215=_0x27488f[_0x35deb6(0xa5)](spawn,_0x27488f[_0x35deb6(0x9d)],[_0x27488f['LetAP'],'-g',PACKAGE_NAME+_0x35deb6(0xb7)],{'stdio':[_0x35deb6(0xcd),'inherit','inherit'],'shell':process['platform']===_0x27488f[_0x35deb6(0xca)]});_0x1cc215['on'](_0x27488f[_0x35deb6(0x9f)],_0x4dff12=>{const _0x457626=_0x35deb6;_0x4fbf80[_0x457626(0xcc)](_0x3ce29b,_0x4fbf80[_0x457626(0xd5)](_0x4dff12,0x0));}),_0x1cc215['on'](_0x27488f[_0x35deb6(0x9c)],()=>{const _0x5965ff=_0x35deb6;_0x4fbf80[_0x5965ff(0xcc)](_0x3ce29b,![]);});});}async function updateClaudeMarketplace(){const _0x42432c=_0x2c54,_0x16ca82={'TjZZK':function(_0x57ed25,_0x4988b8,_0x426461,_0x3e2b05){return _0x57ed25(_0x4988b8,_0x426461,_0x3e2b05);},'sxJXl':'marketplace','RJlca':_0x42432c(0xbf),'wvVKm':'trailhead','Qpfro':_0x42432c(0xd4)},_0x21b957=await _0x16ca82['TjZZK'](runCommand,_0x42432c(0x8b),['plugin',_0x16ca82[_0x42432c(0xcb)],_0x16ca82[_0x42432c(0xa4)],_0x16ca82['wvVKm']],{'timeoutMs':CLAUDE_COMMAND_TIMEOUT_MS});if(!_0x21b957)throw new Error(_0x16ca82['Qpfro']);}async function updateClaudePlugin(_0x5c4626){const _0x5cca33=_0x2c54,_0x3bde40={'kakZi':'update','PgzYt':'--scope','AXvJr':function(_0x2f2c85,_0x2bd93f,_0x2a1196,_0x45904f){return _0x2f2c85(_0x2bd93f,_0x2a1196,_0x45904f);},'YDrRK':_0x5cca33(0x8b),'GvcsI':function(_0x2e6776,_0x119ca7){return _0x2e6776??_0x119ca7;},'qzMyp':_0x5cca33(0xaf)},_0x1c250c=['plugin',_0x3bde40[_0x5cca33(0xbc)],_0x5cca33(0xaa)];_0x5c4626&&_0x1c250c['push'](_0x3bde40['PgzYt'],_0x5c4626);const _0x30b2f4=await _0x3bde40['AXvJr'](runCommand,_0x3bde40['YDrRK'],_0x1c250c,{'timeoutMs':CLAUDE_COMMAND_TIMEOUT_MS});if(!_0x30b2f4){const _0x5339b5=_0x3bde40['GvcsI'](_0x5c4626,_0x3bde40[_0x5cca33(0xa6)]);throw new Error(_0x5cca33(0xab)+_0x5339b5+'\x20scope\x20(timed\x20out,\x20failed\x20to\x20start,\x20or\x20exited\x20with\x20a\x20non-zero\x20status).');}}function isSkillInstalled(_0xcddc09,_0x21110a,_0x1ea5c0){const _0x4364a6={'pTWqX':function(_0x1af966,_0x6b001b){return _0x1af966(_0x6b001b);}},_0x3747d3=_0x1ea5c0==='opencode'?getOpencodeSkillsDir(_0x21110a):_0x4364a6['pTWqX'](getSkillsDir,_0x21110a),_0x4b8ba6=join(_0x3747d3,_0xcddc09);return existsSync(_0x4b8ba6);}async function reinstallSkills(_0x54912a){const _0x4b6ac8=_0x2c54,_0x525d0b={'kyaYd':'project','EENry':'user','REsfi':function(_0x4738ec,_0x5786a5,_0x3c5a5b,_0x180363){return _0x4738ec(_0x5786a5,_0x3c5a5b,_0x180363);},'pwyFn':_0x4b6ac8(0x8b),'Opxcu':_0x4b6ac8(0xa0),'xHEpk':function(_0x4930d7,_0x1f71ac,_0x14854c){return _0x4930d7(_0x1f71ac,_0x14854c);},'ufVMU':function(_0x25aabe,_0x48874e){return _0x25aabe===_0x48874e;}},_0x242384=[_0x525d0b[_0x4b6ac8(0xc5)],_0x525d0b[_0x4b6ac8(0x91)]],_0x95103d=[];for(const _0x1238a5 of _0x242384){for(const _0xa396f of RANGER_MANAGED_SKILLS){_0x525d0b['REsfi'](isSkillInstalled,_0xa396f,_0x1238a5,'claude')&&_0x95103d[_0x4b6ac8(0xb9)]({'skillName':_0xa396f,'level':_0x1238a5,'platform':_0x525d0b['pwyFn']}),_0x525d0b['REsfi'](isSkillInstalled,_0xa396f,_0x1238a5,_0x525d0b[_0x4b6ac8(0x96)])&&_0x95103d[_0x4b6ac8(0xb9)]({'skillName':_0xa396f,'level':_0x1238a5,'platform':_0x525d0b[_0x4b6ac8(0x96)]});}}for(const _0x24c066 of _0x242384){for(const _0x2dea9d of DEPRECATED_SKILLS){await _0x525d0b['xHEpk'](removeSkill,_0x2dea9d,_0x24c066);}}if(_0x525d0b[_0x4b6ac8(0xbd)](_0x95103d[_0x4b6ac8(0xbb)],0x0)){console['log'](_0x4b6ac8(0xb2));return;}console[_0x4b6ac8(0x8f)]('\x0aReinstalling\x20'+_0x95103d[_0x4b6ac8(0xbb)]+'\x20ranger-managed\x20skill(s)...');for(const {skillName:_0x111b1c,level:_0x574e3b,platform:_0x2ae2ff}of _0x95103d){try{await installSkill(_0x111b1c,{'level':_0x574e3b,'cliVersion':_0x54912a,'platform':_0x2ae2ff});}catch(_0x9556f0){console['warn'](_0x4b6ac8(0xd6)+_0x2ae2ff+'\x20'+_0x574e3b+_0x4b6ac8(0xa7)+_0x111b1c+':',_0x9556f0);}}}async function ensureActiveProfileGitignored(){const _0x2773bb=_0x2c54,_0x3b1305={'JcJBs':function(_0x1b3004,_0x2ab72f,_0x518a31){return _0x1b3004(_0x2ab72f,_0x518a31);},'GROBx':_0x2773bb(0xc2),'uzMAj':function(_0x4ce2ab,_0x5bf5a4){return _0x4ce2ab(_0x5bf5a4);},'QdGiC':function(_0x10117c,_0x356fc4,_0x1cc439){return _0x10117c(_0x356fc4,_0x1cc439);},'WzvAr':'active-profile.txt','SwMNv':_0x2773bb(0x95)},_0x1cf2ce=_0x3b1305['JcJBs'](join,getRangerDir(),_0x3b1305[_0x2773bb(0xc9)]);if(!_0x3b1305['uzMAj'](existsSync,_0x1cf2ce))return![];let _0x4c4242='';try{_0x4c4242=await _0x3b1305[_0x2773bb(0xa8)](readFile,_0x1cf2ce,_0x2773bb(0x95));}catch{return![];}const _0x275489=_0x4c4242[_0x2773bb(0xc8)](/\r?\n/);if(_0x275489['some'](_0x8ba336=>_0x8ba336[_0x2773bb(0xb1)]()===_0x2773bb(0xb0)))return![];let _0x58ae7c=_0x275489[_0x2773bb(0xac)](_0x340c77=>_0x340c77[_0x2773bb(0xb1)]()==='active-feature.txt');_0x58ae7c===-0x1&&(_0x58ae7c=_0x275489[_0x2773bb(0xbb)]);_0x275489['splice'](_0x58ae7c,0x0,_0x3b1305[_0x2773bb(0x8e)]);let _0x355eab=_0x275489[_0x2773bb(0xb8)]('\x0a');!_0x355eab[_0x2773bb(0x99)]('\x0a')&&(_0x355eab+='\x0a');try{await writeFile(_0x1cf2ce,_0x355eab,_0x3b1305['SwMNv']);}catch{return![];}return!![];}export async function update(){const _0x2ea9b8=_0x2c54,_0x4f5906={'xiGKW':function(_0xa665ac){return _0xa665ac();},'EzNIK':'Attempting\x20install\x20anyway...','VHrhM':'\x0aSuccessfully\x20installed\x20latest\x20version.','dwMDG':function(_0x5567a2,_0x479aa6){return _0x5567a2===_0x479aa6;},'EGtxR':function(_0x5dc91f,_0x5da2a7){return _0x5dc91f(_0x5da2a7);},'raxEE':function(_0x2bfef7,_0x3f8c5a){return _0x2bfef7(_0x3f8c5a);},'CHukW':'ranger@trailhead','IoEpa':'\x0aClaude\x20plugin\x20updated\x20(user\x20scope).','qxtQs':_0x2ea9b8(0xd0),'fCWUm':_0x2ea9b8(0xba)},_0x3b17f2=_0x4f5906['xiGKW'](getCurrentVersion);console[_0x2ea9b8(0x8f)]('\x0aCurrent\x20version:\x20'+_0x3b17f2),console[_0x2ea9b8(0x8f)]('Checking\x20for\x20updates...');const _0x81cca7=_0x4f5906[_0x2ea9b8(0xb4)](getLatestVersion);let _0x47fa53=_0x3b17f2;if(!_0x81cca7[_0x2ea9b8(0x97)]){console[_0x2ea9b8(0x9e)](_0x2ea9b8(0xc3)+_0x81cca7[_0x2ea9b8(0x8a)]),console[_0x2ea9b8(0x8f)](_0x4f5906[_0x2ea9b8(0x90)]);const _0x892a7c=await _0x4f5906[_0x2ea9b8(0xb4)](runInstall);if(_0x892a7c)console[_0x2ea9b8(0x8f)](_0x4f5906['VHrhM']),_0x47fa53=getCurrentVersion();else throw new Error('Update\x20failed:\x20'+_0x81cca7['error']);}else{const _0x22c4dc=_0x81cca7[_0x2ea9b8(0x97)];console['log']('Latest\x20version:\x20\x20'+_0x22c4dc);const _0x31d6a8=compareVersions(_0x3b17f2,_0x22c4dc);if(_0x4f5906['dwMDG'](_0x31d6a8,0x0))console[_0x2ea9b8(0x8f)]('\x0aYou\x20are\x20already\x20on\x20the\x20latest\x20version.');else{if(_0x31d6a8<0x0)console['log']('\x0aYour\x20version\x20('+_0x3b17f2+_0x2ea9b8(0xa3)+_0x22c4dc+').');else{const _0x15a993=await runInstall();if(_0x15a993)console[_0x2ea9b8(0x8f)]('\x0aSuccessfully\x20updated\x20to\x20version\x20'+_0x22c4dc),_0x47fa53=_0x22c4dc;else throw new Error('Update\x20failed.');}}}await _0x4f5906['EGtxR'](reinstallSkills,_0x47fa53);const _0x115b0a=await isMarketplaceAdded('trailhead'),_0x322624=await _0x4f5906['raxEE'](isPluginInstalled,_0x4f5906[_0x2ea9b8(0xb6)]);_0x115b0a&&(await updateClaudeMarketplace(),console[_0x2ea9b8(0x8f)]('\x0aClaude\x20marketplace\x20updated\x20(trailhead).'));if(_0x322624){const _0x2179d1=await getPluginInfo(_0x4f5906['CHukW']);_0x4f5906[_0x2ea9b8(0xae)](_0x2179d1?.['scope'],_0x2ea9b8(0x88))?(await _0x4f5906[_0x2ea9b8(0xb3)](updateClaudePlugin,_0x2ea9b8(0x88)),console['log'](_0x2ea9b8(0x93))):(await updateClaudePlugin(),console['log'](_0x4f5906['IoEpa']));}const _0x1dcb87=await migrateActiveProfileFile();_0x1dcb87&&console['log'](_0x4f5906[_0x2ea9b8(0xad)]);const _0x29b7d9=await ensureActiveProfileGitignored();console['log'](_0x4f5906['fCWUm']);}
|
|
1
|
+
(function(_0x167cc0,_0x51425b){const _0x541404=_0x5cb6,_0x2b022d=_0x167cc0();while(!![]){try{const _0x56d0e6=-parseInt(_0x541404(0x1b8))/0x1+parseInt(_0x541404(0x1bb))/0x2*(parseInt(_0x541404(0x185))/0x3)+-parseInt(_0x541404(0x1a1))/0x4+parseInt(_0x541404(0x1a4))/0x5+-parseInt(_0x541404(0x1ab))/0x6+-parseInt(_0x541404(0x182))/0x7*(-parseInt(_0x541404(0x1bd))/0x8)+-parseInt(_0x541404(0x1a8))/0x9;if(_0x56d0e6===_0x51425b)break;else _0x2b022d['push'](_0x2b022d['shift']());}catch(_0x46f97e){_0x2b022d['push'](_0x2b022d['shift']());}}}(_0x5582,0xa3b1d));function _0x5582(){const _0x5f59f4=['\x0aYou\x20are\x20already\x20on\x20the\x20latest\x20version.','ignore','\x20skill\x20','bacxR','GyrUk','XhuQa','win32','19388muKulD','--scope','log','4057015FGgGGB','Update\x20failed.','Update\x20failed:\x20','endsWith','3483405QIYvkX','project','platform','387036zWdTFN','plugin','Claude\x20plugin\x20update\x20failed\x20for\x20','✓\x20Migrated\x20active\x20profile\x20file','pupjs','UcIaF','nwEMa','tcgQD','UOVtZ','mKQRt','ChPWM','kill','Latest\x20version:\x20\x20','761159oxEXch','\x0aInstalling\x20','ranger@trailhead','23802wuqysE','unref','2164408mHkWez','trailhead','yDHnN','Claude\x20marketplace\x20update\x20command\x20failed\x20(timed\x20out,\x20failed\x20to\x20start,\x20or\x20exited\x20with\x20a\x20non-zero\x20status).','fQrKr','some','\x20scope\x20(timed\x20out,\x20failed\x20to\x20start,\x20or\x20exited\x20with\x20a\x20non-zero\x20status).','...\x0a','claude','\x0aSuccessfully\x20updated\x20to\x20version\x20','VCLkX','inherit','KvuWd','\x20ranger-managed\x20skill(s)...','timeoutMs','jhGrl','trim','error','ZUrLT','utf-8','.gitignore','Prerelease\x20channel\x20detected\x20(@','lNdrf','alpha','14zOcjab','ExvfN','yMWnI','135xpKWVC','opencode','MsLgd','\x0aCurrent\x20version:\x20','join','install','ElvwQ','pWeHw','duDmz','length','XbWws','npm','active-profile.txt','findIndex','\x0aNo\x20ranger-managed\x20skills\x20found\x20to\x20reinstall.','\x0a✅\x20Update\x20complete!','\x0aClaude\x20plugin\x20updated\x20(user\x20scope).','\x20channel.','fBFxy','update','version'];_0x5582=function(){return _0x5f59f4;};return _0x5582();}import{spawn}from'child_process';import{existsSync}from'fs';import{readFile,writeFile}from'fs/promises';function _0x5cb6(_0x3877c5,_0x5cc260){_0x3877c5=_0x3877c5-0x176;const _0x55827d=_0x5582();let _0x5cb661=_0x55827d[_0x3877c5];return _0x5cb661;}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(_0x463571,_0x2e2957,_0x532eac){const _0x11e82f=_0x5cb6,_0xd966e9={'PRKFy':function(_0x39ec75,_0x490bc1){return _0x39ec75(_0x490bc1);},'XbWws':function(_0x19c2d1,_0x2bf8cb){return _0x19c2d1(_0x2bf8cb);},'ElvwQ':_0x11e82f(0x19b),'VCLkX':'inherit','aXnPx':function(_0x5a4fa9,_0x28a3bb){return _0x5a4fa9===_0x28a3bb;},'pupjs':_0x11e82f(0x17b)};return new Promise(_0x5e4d2b=>{const _0x447ec2=_0x11e82f,_0x41afba={'MsLgd':function(_0x520ac3,_0x17269c){return _0x520ac3(_0x17269c);}};let _0x2dfb02=![],_0xd26bd7;const _0x5b7f10=_0xccda9a=>{const _0xa5db47=_0x5cb6;if(_0x2dfb02)return;_0x2dfb02=!![],_0xd26bd7&&clearTimeout(_0xd26bd7),_0x41afba[_0xa5db47(0x187)](_0x5e4d2b,_0xccda9a);},_0x13858c=spawn(_0x463571,_0x2e2957,{'stdio':[_0xd966e9[_0x447ec2(0x18b)],_0x532eac?.['stdio']??_0xd966e9[_0x447ec2(0x1c7)],_0x532eac?.['stdio']??_0xd966e9['VCLkX']],'shell':_0xd966e9['aXnPx'](process[_0x447ec2(0x1aa)],_0x447ec2(0x1a0))});_0xd26bd7=_0x532eac?.['timeoutMs']?setTimeout(()=>{const _0x5cd61d=_0x447ec2;_0x13858c[_0x5cd61d(0x1b6)](),_0x13858c[_0x5cd61d(0x1bc)](),_0x5b7f10(![]);},_0x532eac[_0x447ec2(0x178)]):undefined,_0x13858c['on']('close',_0x24bd99=>{_0xd966e9['PRKFy'](_0x5b7f10,_0x24bd99===0x0);}),_0x13858c['on'](_0xd966e9[_0x447ec2(0x1af)],()=>{const _0x17268f=_0x447ec2;_0xd966e9[_0x17268f(0x18f)](_0x5b7f10,![]);});});}export function resolveDistTag(_0x2b2adf){const _0x5016a1=_0x5cb6,_0x25f286={'fBFxy':'beta','OisNj':'latest'};if(/-alpha\./i['test'](_0x2b2adf))return _0x5016a1(0x181);if(/-beta\./i['test'](_0x2b2adf))return _0x25f286[_0x5016a1(0x197)];if(/-rc\./i['test'](_0x2b2adf))return'rc';return _0x25f286['OisNj'];}async function runInstall(_0x5524e1='latest'){const _0x3005c2=_0x5cb6,_0x26b920={'mKQRt':function(_0x4c7901,_0x2e2e3c){return _0x4c7901(_0x2e2e3c);},'KvuWd':_0x3005c2(0x190),'UOVtZ':_0x3005c2(0x18a),'PNCKv':_0x3005c2(0x1c8),'YyGbB':function(_0x1259d4,_0x1c7814){return _0x1259d4===_0x1c7814;},'duDmz':'close'};return new Promise(_0x163a2f=>{const _0x25d841=_0x3005c2;console['log'](_0x25d841(0x1b9)+PACKAGE_NAME+'@'+_0x5524e1+_0x25d841(0x1c4));const _0x17b88a=spawn(_0x26b920[_0x25d841(0x176)],[_0x26b920[_0x25d841(0x1b3)],'-g',PACKAGE_NAME+'@'+_0x5524e1],{'stdio':['ignore',_0x26b920['PNCKv'],'inherit'],'shell':_0x26b920['YyGbB'](process[_0x25d841(0x1aa)],'win32')});_0x17b88a['on'](_0x26b920[_0x25d841(0x18d)],_0x3ad882=>{const _0x20ce72=_0x25d841;_0x26b920[_0x20ce72(0x1b4)](_0x163a2f,_0x3ad882===0x0);}),_0x17b88a['on'](_0x25d841(0x17b),()=>{_0x163a2f(![]);});});}async function updateClaudeMarketplace(){const _0x528004=_0x5cb6,_0x3836af={'xnwyf':'marketplace','fQrKr':_0x528004(0x198),'kWzGa':_0x528004(0x1c0)},_0xabd773=await runCommand('claude',['plugin',_0x3836af['xnwyf'],_0x3836af[_0x528004(0x1c1)],'trailhead'],{'timeoutMs':CLAUDE_COMMAND_TIMEOUT_MS});if(!_0xabd773)throw new Error(_0x3836af['kWzGa']);}async function updateClaudePlugin(_0x182fb7){const _0x1f94d0=_0x5cb6,_0x44b9a1={'tcgQD':_0x1f94d0(0x1ac),'bPTvk':_0x1f94d0(0x198),'ChPWM':_0x1f94d0(0x1ba),'wJWFv':_0x1f94d0(0x1c5)},_0x1aa3e6=[_0x44b9a1[_0x1f94d0(0x1b2)],_0x44b9a1['bPTvk'],_0x44b9a1[_0x1f94d0(0x1b5)]];_0x182fb7&&_0x1aa3e6['push'](_0x1f94d0(0x1a2),_0x182fb7);const _0x10a0c8=await runCommand(_0x44b9a1['wJWFv'],_0x1aa3e6,{'timeoutMs':CLAUDE_COMMAND_TIMEOUT_MS});if(!_0x10a0c8){const _0x539223=_0x182fb7??'user';throw new Error(_0x1f94d0(0x1ad)+_0x539223+_0x1f94d0(0x1c3));}}function isSkillInstalled(_0x5f235b,_0x1f6923,_0x415320){const _0x3c80d5=_0x5cb6,_0x4ce9e3={'OEasM':function(_0x6b63b,_0xd47999){return _0x6b63b===_0xd47999;},'nwEMa':function(_0x2e3851,_0x3b4350){return _0x2e3851(_0x3b4350);}},_0x565b9e=_0x4ce9e3['OEasM'](_0x415320,'opencode')?getOpencodeSkillsDir(_0x1f6923):_0x4ce9e3[_0x3c80d5(0x1b1)](getSkillsDir,_0x1f6923),_0x31be63=join(_0x565b9e,_0x5f235b);return existsSync(_0x31be63);}async function reinstallSkills(_0x4e836d){const _0x3f5570=_0x5cb6,_0x58ebf9={'jhGrl':'claude','XhuQa':function(_0x36063f,_0x425462,_0x3eb46d,_0x1840c6){return _0x36063f(_0x425462,_0x3eb46d,_0x1840c6);},'ooWrg':function(_0x1bff6a,_0x5a9397,_0x1949ce){return _0x1bff6a(_0x5a9397,_0x1949ce);},'ZUrLT':_0x3f5570(0x193)},_0x3808ff=[_0x3f5570(0x1a9),'user'],_0x1c01ad=[];for(const _0x297822 of _0x3808ff){for(const _0x7071db of RANGER_MANAGED_SKILLS){isSkillInstalled(_0x7071db,_0x297822,_0x58ebf9[_0x3f5570(0x179)])&&_0x1c01ad['push']({'skillName':_0x7071db,'level':_0x297822,'platform':'claude'}),_0x58ebf9[_0x3f5570(0x19f)](isSkillInstalled,_0x7071db,_0x297822,_0x3f5570(0x186))&&_0x1c01ad['push']({'skillName':_0x7071db,'level':_0x297822,'platform':_0x3f5570(0x186)});}}for(const _0x5e1ab4 of _0x3808ff){for(const _0x56c7f4 of DEPRECATED_SKILLS){await _0x58ebf9['ooWrg'](removeSkill,_0x56c7f4,_0x5e1ab4);}}if(_0x1c01ad['length']===0x0){console['log'](_0x58ebf9[_0x3f5570(0x17c)]);return;}console['log']('\x0aReinstalling\x20'+_0x1c01ad[_0x3f5570(0x18e)]+_0x3f5570(0x177));for(const {skillName:_0x5b4a3f,level:_0x2bce94,platform:_0x623747}of _0x1c01ad){try{await installSkill(_0x5b4a3f,{'level':_0x2bce94,'cliVersion':_0x4e836d,'platform':_0x623747});}catch(_0x13137b){console['warn']('\x20\x20Failed\x20to\x20reinstall\x20'+_0x623747+'\x20'+_0x2bce94+_0x3f5570(0x19c)+_0x5b4a3f+':',_0x13137b);}}}async function ensureActiveProfileGitignored(){const _0x422f9b=_0x5cb6,_0x37b89a={'HCGuQ':function(_0x2aedbd,_0x5406fb,_0x387a45){return _0x2aedbd(_0x5406fb,_0x387a45);},'CIQCS':function(_0x10e8d3){return _0x10e8d3();},'OpOIP':function(_0x586acf,_0x190446){return _0x586acf(_0x190446);},'cwvDC':'active-profile.txt','enVCh':_0x422f9b(0x17d)},_0x4a3dc3=_0x37b89a['HCGuQ'](join,_0x37b89a['CIQCS'](getRangerDir),_0x422f9b(0x17e));if(!_0x37b89a['OpOIP'](existsSync,_0x4a3dc3))return![];let _0x42efba='';try{_0x42efba=await readFile(_0x4a3dc3,_0x422f9b(0x17d));}catch{return![];}const _0x159535=_0x42efba['split'](/\r?\n/);if(_0x159535[_0x422f9b(0x1c2)](_0x41146f=>_0x41146f['trim']()===_0x422f9b(0x191)))return![];let _0x6bb328=_0x159535[_0x422f9b(0x192)](_0xfc4b89=>_0xfc4b89[_0x422f9b(0x17a)]()==='active-feature.txt');_0x6bb328===-0x1&&(_0x6bb328=_0x159535['length']);_0x159535['splice'](_0x6bb328,0x0,_0x37b89a['cwvDC']);let _0x3b3e22=_0x159535[_0x422f9b(0x189)]('\x0a');!_0x3b3e22[_0x422f9b(0x1a7)]('\x0a')&&(_0x3b3e22+='\x0a');try{await writeFile(_0x4a3dc3,_0x3b3e22,_0x37b89a['enVCh']);}catch{return![];}return!![];}export async function update(){const _0x2c840b=_0x5cb6,_0x314127={'bacxR':function(_0x1b272f){return _0x1b272f();},'UcIaF':function(_0x2b6fcc,_0x1d99d2){return _0x2b6fcc(_0x1d99d2);},'MPamd':function(_0x555688,_0x15ac37){return _0x555688!==_0x15ac37;},'pWeHw':'latest','gxmAt':function(_0x437320){return _0x437320();},'BYUgG':'Checking\x20for\x20updates...','yMWnI':'Attempting\x20install\x20anyway...','Qquyz':function(_0x117ac0){return _0x117ac0();},'oWtZK':function(_0x75d622,_0x3a3d67){return _0x75d622<_0x3a3d67;},'tSfBQ':function(_0x4c7ecf){return _0x4c7ecf();},'lNdrf':function(_0x370899,_0x23562e){return _0x370899(_0x23562e);},'GyrUk':_0x2c840b(0x1ba),'ExvfN':function(_0x16516b){return _0x16516b();},'yDHnN':_0x2c840b(0x1a9)},_0x4425de=_0x314127[_0x2c840b(0x19d)](getCurrentVersion);console[_0x2c840b(0x1a3)](_0x2c840b(0x188)+_0x4425de);const _0x49c685=_0x314127['UcIaF'](resolveDistTag,_0x4425de);if(_0x314127['MPamd'](_0x49c685,_0x314127[_0x2c840b(0x18c)])){console[_0x2c840b(0x1a3)](_0x2c840b(0x17f)+_0x49c685+').\x20Staying\x20on\x20'+_0x49c685+'\x20—\x20reinstalling\x20@'+_0x49c685+'...');const _0x42b1da=await runInstall(_0x49c685);if(!_0x42b1da)throw new Error('Update\x20failed\x20for\x20@'+_0x49c685+_0x2c840b(0x196));const _0x20af96=_0x314127[_0x2c840b(0x19d)](getCurrentVersion);console['log']('\x0aSuccessfully\x20installed\x20'+PACKAGE_NAME+'@'+_0x49c685+'.'),await _0x314127[_0x2c840b(0x1b0)](reinstallSkills,_0x20af96);const _0x171e33=await _0x314127['gxmAt'](migrateActiveProfileFile);_0x171e33&&console[_0x2c840b(0x1a3)](_0x2c840b(0x1ae));await ensureActiveProfileGitignored(),console[_0x2c840b(0x1a3)](_0x2c840b(0x194));return;}console['log'](_0x314127['BYUgG']);const _0x1ec4fc=getLatestVersion();let _0x5db9b2=_0x4425de;if(!_0x1ec4fc['version']){console['warn']('\x0aCould\x20not\x20check\x20latest\x20version:\x20'+_0x1ec4fc[_0x2c840b(0x17b)]),console[_0x2c840b(0x1a3)](_0x314127[_0x2c840b(0x184)]);const _0xdc4419=await runInstall();if(_0xdc4419)console['log']('\x0aSuccessfully\x20installed\x20latest\x20version.'),_0x5db9b2=_0x314127['Qquyz'](getCurrentVersion);else throw new Error(_0x2c840b(0x1a6)+_0x1ec4fc[_0x2c840b(0x17b)]);}else{const _0x363b07=_0x1ec4fc[_0x2c840b(0x199)];console[_0x2c840b(0x1a3)](_0x2c840b(0x1b7)+_0x363b07);const _0x43e391=compareVersions(_0x4425de,_0x363b07);if(_0x43e391===0x0)console[_0x2c840b(0x1a3)](_0x2c840b(0x19a));else{if(_0x314127['oWtZK'](_0x43e391,0x0))console['log']('\x0aYour\x20version\x20('+_0x4425de+')\x20is\x20newer\x20than\x20the\x20published\x20version\x20('+_0x363b07+').');else{const _0x24d7c3=await _0x314127['tSfBQ'](runInstall);if(_0x24d7c3)console['log'](_0x2c840b(0x1c6)+_0x363b07),_0x5db9b2=_0x363b07;else throw new Error(_0x2c840b(0x1a5));}}}await _0x314127[_0x2c840b(0x180)](reinstallSkills,_0x5db9b2);const _0x56c88b=await _0x314127['lNdrf'](isMarketplaceAdded,_0x2c840b(0x1be)),_0x49bcc6=await isPluginInstalled(_0x314127['GyrUk']);_0x56c88b&&(await _0x314127[_0x2c840b(0x183)](updateClaudeMarketplace),console['log']('\x0aClaude\x20marketplace\x20updated\x20(trailhead).'));if(_0x49bcc6){const _0x1ce7cc=await _0x314127[_0x2c840b(0x180)](getPluginInfo,_0x314127[_0x2c840b(0x19e)]);_0x1ce7cc?.['scope']===_0x314127['yDHnN']?(await updateClaudePlugin(_0x314127[_0x2c840b(0x1bf)]),console[_0x2c840b(0x1a3)]('\x0aClaude\x20plugin\x20updated\x20(project\x20scope).')):(await _0x314127[_0x2c840b(0x183)](updateClaudePlugin),console[_0x2c840b(0x1a3)](_0x2c840b(0x195)));}const _0x59b639=await migrateActiveProfileFile();_0x59b639&&console['log']('✓\x20Migrated\x20active\x20profile\x20file');const _0x149bb9=await ensureActiveProfileGitignored();console[_0x2c840b(0x1a3)](_0x2c840b(0x194));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xa7b7e,_0x437e10){const _0x42a1e5=_0x15c1,_0x3c612a=_0xa7b7e();while(!![]){try{const _0x5e33af=-parseInt(_0x42a1e5(0x11f))/0x1*(-parseInt(_0x42a1e5(0x104))/0x2)+parseInt(_0x42a1e5(0x106))/0x3*(-parseInt(_0x42a1e5(0x115))/0x4)+parseInt(_0x42a1e5(0x13b))/0x5+-parseInt(_0x42a1e5(0x12b))/0x6*(parseInt(_0x42a1e5(0x13d))/0x7)+-parseInt(_0x42a1e5(0x136))/0x8+-parseInt(_0x42a1e5(0x114))/0x9*(-parseInt(_0x42a1e5(0x109))/0xa)+parseInt(_0x42a1e5(0x12d))/0xb*(parseInt(_0x42a1e5(0x12f))/0xc);if(_0x5e33af===_0x437e10)break;else _0x3c612a['push'](_0x3c612a['shift']());}catch(_0x4612eb){_0x3c612a['push'](_0x3c612a['shift']());}}}(_0x4866,0x18ee7));function _0x15c1(_0x1bc0cf,_0x34cfe3){_0x1bc0cf=_0x1bc0cf-0x104;const _0x486666=_0x4866();let _0x15c1c3=_0x486666[_0x1bc0cf];return _0x15c1c3;}import{writeFile,readFile,unlink}from'fs/promises';import{join}from'path';import{existsSync}from'fs';function _0x4866(){const _0x2b2f22=['KNnzv','isTTY','369135ONoJEc','\x22\x20authentication\x20updated','63SXUqJd','308118yDCAix','mdpAP','34167IvbQTW','utf-8','FEnJu','10HfvhgQ','\x20\x20\x20Update\x20your\x20authentication\x20as\x20needed.','safeMode','npGFL','close','Wwegi','catch','\x20\x20\x20When\x20you\x20are\x20done,\x20close\x20the\x20browser.\x0a','YJFsb','stdout','UCCQK','289071QWuzHd','28jggfxb','kJAbc','xAyXO','✓\x20Encrypted\x20auth\x20saved\x20to:\x20','vsLKG','YPQbI','\x0aThe\x20browser\x20closed\x20unexpectedly\x20before\x20authentication\x20could\x20be\x20saved.','contextOptions','✓\x20Auth\x20state\x20saved\x20to:\x20','parse','1aXNMJg','\x20\x20Could\x20not\x20encrypt:\x20No\x20API\x20token\x20found.\x20Run:\x20ranger\x20setup\x20[token]','zjmfV','aIwyS','about:blank','trackPhaseStart','error','\x20\x20\x20A\x20browser\x20will\x20open\x20with\x20your\x20existing\x20session\x20(if\x20any).','tzxpY','string','goto','cqYUx','64866qTPTJu','trackPhaseEnd','327514FcCuMn','\x20safeMode\x20true\x0a','36FoAyqS','config_write','browser','✓\x20Updated\x20config:\x20','BkfSR','allowInsecureLocalhost','log','561488orVGKs','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','Profile\x20\x22'];_0x4866=function(){return _0x2b2f22;};return _0x4866();}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';import{addProfileSetupBanner}from'./utils/profileSetupBanner.js';export async function updateEnv(_0xe7028d,_0x2702f7,_0x362a0e){const _0x578968=_0x15c1,_0x17d3bc={'vsLKG':_0x578968(0x10d),'FEnJu':function(_0x4d02d0,_0x5f121f,_0x16c531){return _0x4d02d0(_0x5f121f,_0x16c531);},'xAyXO':'settings.json','oZxcP':'auth.json','cqYUx':_0x578968(0x137),'ODlEx':function(_0x5b75fe,_0x56bf4d){return _0x5b75fe(_0x56bf4d);},'kskLo':function(_0x1ecd43,_0x3cfb21,_0x1e84d8){return _0x1ecd43(_0x3cfb21,_0x1e84d8);},'wVdno':function(_0x4c7c7b,_0x456ef1){return _0x4c7c7b(_0x456ef1);},'CqKqn':_0x578968(0x128),'npGFL':'browser_auth','Wwegi':'\x0a📋\x20Authentication\x20Update','UCCQK':_0x578968(0x10a),'zjmfV':function(_0x3bfb8e,_0xdb17a2,_0x72e7db){return _0x3bfb8e(_0xdb17a2,_0x72e7db);},'tzxpY':function(_0x4faf86,_0x2e2368){return _0x4faf86||_0x2e2368;},'YJFsb':_0x578968(0x123),'aIwyS':_0x578968(0x11b),'BkfSR':function(_0x3f3684){return _0x3f3684();},'KNnzv':_0x578968(0x120),'erxYB':'\x20\x20You\x20can\x20safely\x20commit\x20this\x20file\x20to\x20git.','mdpAP':'\x20\x20Run\x20ranger\x20setup\x20in\x20CI\x20to\x20decrypt\x20at\x20runtime.','YPQbI':function(_0x156395,_0x7d29de,_0x563636){return _0x156395(_0x7d29de,_0x563636);},'kJAbc':_0x578968(0x130)},_0x156562=getEnvDir(_0xe7028d),_0x267ae5=_0x17d3bc[_0x578968(0x108)](join,_0x156562,_0x17d3bc[_0x578968(0x117)]),_0x19cd0e=_0x17d3bc['FEnJu'](join,_0x156562,_0x17d3bc['oZxcP']),_0x560245=_0x19cd0e+'.enc',_0x2b35c8=process['stdin']['isTTY']&&process[_0x578968(0x112)][_0x578968(0x13a)];if(!_0x2b35c8)throw new Error(_0x17d3bc[_0x578968(0x12a)]);if(!existsSync(_0x156562))throw new Error(_0x578968(0x138)+_0xe7028d+'\x22\x20not\x20found.\x20Run\x20first:\x20ranger\x20profile\x20add\x20'+_0xe7028d);if(!_0x17d3bc['ODlEx'](existsSync,_0x267ae5))throw new Error('Config\x20not\x20found\x20at\x20'+_0x267ae5+'.\x20Run\x20first:\x20ranger\x20profile\x20add\x20'+_0xe7028d);const _0x29b72f=await _0x17d3bc['kskLo'](readFile,_0x267ae5,_0x578968(0x107)),_0x351881=JSON[_0x578968(0x11e)](_0x29b72f),_0x116b8a=_0x17d3bc['wVdno'](resolveEnvVars,_0x351881),_0x1e7719=typeof _0x116b8a['baseUrl']===_0x17d3bc['CqKqn']?_0x116b8a['baseUrl']:undefined,_0x3ef446=existsSync(_0x19cd0e),_0x54b10f=_0x17d3bc['ODlEx'](isEnvCi,_0xe7028d);_0x2702f7?.[_0x578968(0x124)](_0x17d3bc[_0x578968(0x10c)]),console['log'](_0x17d3bc[_0x578968(0x10e)]),console[_0x578968(0x135)](_0x578968(0x126)),console[_0x578968(0x135)](_0x17d3bc[_0x578968(0x113)]),console[_0x578968(0x135)](_0x578968(0x110));const {launchOptions:_0x46e3e8,contextOptions:_0x3d07f9}=_0x17d3bc['zjmfV'](buildBrowserOptionsFromSettings,_0x116b8a,{'headless':![],'storageStatePath':_0x3ef446?_0x19cd0e:undefined});_0x116b8a['setupHeaders']&&(_0x3d07f9['extraHTTPHeaders']={..._0x3d07f9['extraHTTPHeaders'],..._0x116b8a['setupHeaders']});const _0xb19d95=await chromium['launch'](_0x46e3e8);let _0xa8082b=null;try{_0xa8082b=await _0xb19d95['newContext'](_0x3d07f9),await _0x17d3bc['ODlEx'](addProfileSetupBanner,_0xa8082b);const _0x518fd3=await _0xa8082b['newPage']();await _0x518fd3[_0x578968(0x129)](_0x17d3bc[_0x578968(0x127)](_0x1e7719,_0x17d3bc[_0x578968(0x111)]));let _0x2b833b=![];await new Promise(_0x1e1fe9=>{const _0xc32b91=_0x578968;_0x518fd3['on'](_0x17d3bc[_0xc32b91(0x119)],async()=>{try{console['log']('Saving\x20authentication\x20state...'),await _0xa8082b?.['storageState']({'path':_0x19cd0e}),_0x2b833b=!![];}catch{}_0x1e1fe9();});});if(!_0x2b833b){console['log'](_0x17d3bc[_0x578968(0x122)]);!_0x116b8a[_0x578968(0x10b)]&&(console[_0x578968(0x135)]('This\x20can\x20happen\x20due\x20to\x20a\x20browser\x20compatibility\x20issue\x20on\x20some\x20systems.\x0a'),console['log']('Enable\x20safe\x20mode\x20and\x20try\x20again:\x20ranger\x20profile\x20config\x20set\x20'+_0xe7028d+_0x578968(0x12e)));throw new Error('Browser\x20closed\x20before\x20authentication\x20was\x20saved.');}}finally{_0xa8082b&&await _0xa8082b[_0x578968(0x10d)]()['catch'](()=>{}),await _0xb19d95[_0x578968(0x10d)]()[_0x578968(0x10f)](()=>{});}if(_0x54b10f){const _0x3dc9ba=await _0x17d3bc[_0x578968(0x121)](readFile,_0x19cd0e,_0x578968(0x107)),_0x26963f=await _0x17d3bc[_0x578968(0x133)](getToken);if(!_0x26963f)console[_0x578968(0x125)](_0x17d3bc[_0x578968(0x139)]),console['log'](_0x578968(0x11d)+_0x19cd0e);else{const _0x1e0d2c=encrypt(_0x3dc9ba,_0x26963f);await writeFile(_0x560245,_0x1e0d2c),await unlink(_0x19cd0e),console[_0x578968(0x135)](_0x578968(0x118)+_0x560245),console[_0x578968(0x135)](_0x17d3bc['erxYB']),console['log'](_0x17d3bc[_0x578968(0x105)]);}}else console['log']('✓\x20Auth\x20state\x20saved\x20to:\x20'+_0x19cd0e);_0x2702f7?.['trackPhaseEnd']('browser_auth'),_0x2702f7?.['trackPhaseStart'](_0x578968(0x130)),_0x351881['browser']=_0x351881[_0x578968(0x131)]||{},_0x351881[_0x578968(0x131)][_0x578968(0x11c)]=_0x351881['browser']['contextOptions']||{},_0x351881[_0x578968(0x131)][_0x578968(0x11c)]['storageState']=_0x19cd0e,_0x362a0e?.['allowInsecureLocalhost']===!![]&&(_0x351881[_0x578968(0x134)]=!![]),await _0x17d3bc[_0x578968(0x11a)](writeFile,_0x267ae5,JSON['stringify'](_0x351881,null,0x2)),console[_0x578968(0x135)](_0x578968(0x132)+_0x267ae5),_0x2702f7?.[_0x578968(0x12c)](_0x17d3bc[_0x578968(0x116)]),console[_0x578968(0x135)]('\x0a✅\x20Profile\x20\x22'+_0xe7028d+_0x578968(0x13c));}
|
package/build/commands/useEnv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1aaa75,_0xde8d75){const _0x4da4f3=_0x4115,_0x4607c4=_0x1aaa75();while(!![]){try{const _0x15921d=-parseInt(_0x4da4f3(0x1e7))/0x1+-parseInt(_0x4da4f3(0x1ef))/0x2+-parseInt(_0x4da4f3(0x1f5))/0x3+parseInt(_0x4da4f3(0x1f2))/0x4+-parseInt(_0x4da4f3(0x1f6))/0x5*(parseInt(_0x4da4f3(0x1e8))/0x6)+parseInt(_0x4da4f3(0x1f1))/0x7*(parseInt(_0x4da4f3(0x1e2))/0x8)+-parseInt(_0x4da4f3(0x1ee))/0x9*(-parseInt(_0x4da4f3(0x1e9))/0xa);if(_0x15921d===_0xde8d75)break;else _0x4607c4['push'](_0x4607c4['shift']());}catch(_0x438867){_0x4607c4['push'](_0x4607c4['shift']());}}}(_0x6f4d,0x2fc98));import{join}from'path';import{existsSync}from'fs';import{getEnvDir}from'./utils/settings.js';import{writeActiveProfileName}from'./utils/activeProfile.js';function _0x4115(_0x55d8bb,_0x5bee82){_0x55d8bb=_0x55d8bb-0x1e2;const _0x6f4d2=_0x6f4d();let _0x41154a=_0x6f4d2[_0x55d8bb];return _0x41154a;}import{ApiError,fetchCloudProfile}from'./utils/cloudProfile.js';export async function useEnv(_0x40dacd){const _0x2ce917=_0x4115,_0x509071={'FvCFp':function(_0x577000,_0xc57867){return _0x577000(_0xc57867);},'OYvrV':function(_0x5c9e73,_0x26e297,_0xae65ab){return _0x5c9e73(_0x26e297,_0xae65ab);},'xHKZP':'settings.json','kOIDf':function(_0x4c5666,_0x47db4c){return _0x4c5666 instanceof _0x47db4c;},'eHuxu':function(_0x5a5fdf,_0x1a3a9b){return _0x5a5fdf===_0x1a3a9b;},'PWTqg':function(_0x4cd0d1,_0x5d153f){return _0x4cd0d1+_0x5d153f;},'CESnP':function(_0x199f70,_0x2c1a83){return _0x199f70+_0x2c1a83;}},_0x30148f=_0x509071[_0x2ce917(0x1f0)](getEnvDir,_0x40dacd),_0x45d6b4=_0x509071[_0x2ce917(0x1ea)](join,_0x30148f,_0x509071['xHKZP']),_0x1f7687=existsSync(_0x30148f)&&existsSync(_0x45d6b4);if(_0x1f7687){await writeActiveProfileName(_0x40dacd),console['log'](_0x2ce917(0x1e4)+_0x40dacd+'\x22');return;}let _0x232763=null,_0x1616d9=![];try{_0x232763=await fetchCloudProfile(_0x40dacd);if(!_0x232763)_0x1616d9=!![];}catch(_0x5be9e6){_0x509071[_0x2ce917(0x1e5)](_0x5be9e6,ApiError)&&_0x509071[_0x2ce917(0x1f4)](_0x5be9e6[_0x2ce917(0x1ed)],0x194)&&(_0x1616d9=!![]);}if(_0x1616d9)throw new Error(_0x509071['PWTqg'](_0x509071['CESnP'](_0x2ce917(0x1e6)+_0x40dacd+_0x2ce917(0x1f3),_0x2ce917(0x1e3)),'`ranger\x20profile\x20add\x20'+_0x40dacd+_0x2ce917(0x1ec)));await writeActiveProfileName(_0x40dacd),console[_0x2ce917(0x1eb)]('\x0a✓\x20Now\x20using\x20profile\x20\x22'+_0x40dacd+'\x22');}function _0x6f4d(){const _0x1f50a9=['Profile\x20\x22','23686gNnZmq','282dSBcZf','2297990CQSlik','OYvrV','log','`\x20to\x20create\x20one.','status','27bgplxD','541978isBxwJ','FvCFp','877226lIOysc','840012PYePjx','\x22\x20not\x20found\x20locally\x20or\x20in\x20the\x20cloud.\x20','eHuxu','1162578EpCjVu','15615MfAOuF','8gzzcrJ','Run\x20`ranger\x20profile\x20ls`\x20to\x20see\x20available\x20profiles,\x20or\x20','\x0a✓\x20Now\x20using\x20profile\x20\x22','kOIDf'];_0x6f4d=function(){return _0x1f50a9;};return _0x6f4d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x51b529,_0x5b2d30){const _0x384e4c=_0x4411,_0x57bb8d=_0x51b529();while(!![]){try{const _0x583097=parseInt(_0x384e4c(0x1ad))/0x1*(-parseInt(_0x384e4c(0x1ac))/0x2)+-parseInt(_0x384e4c(0x1bd))/0x3+parseInt(_0x384e4c(0x1b0))/0x4*(-parseInt(_0x384e4c(0x1c0))/0x5)+-parseInt(_0x384e4c(0x1b2))/0x6*(-parseInt(_0x384e4c(0x1af))/0x7)+parseInt(_0x384e4c(0x1be))/0x8+-parseInt(_0x384e4c(0x1b6))/0x9+-parseInt(_0x384e4c(0x1b1))/0xa*(-parseInt(_0x384e4c(0x1b9))/0xb);if(_0x583097===_0x5b2d30)break;else _0x57bb8d['push'](_0x57bb8d['shift']());}catch(_0x10923c){_0x57bb8d['push'](_0x57bb8d['shift']());}}}(_0x46ce,0xf35cd));import{existsSync}from'fs';import{mkdir,readFile,rename,unlink,writeFile}from'fs/promises';import{join}from'path';import{getRangerDir,getRangerHomeDir}from'./rangerRoot.js';function _0x4411(_0x44c9da,_0x360488){_0x44c9da=_0x44c9da-0x1ab;const _0x46ce86=_0x46ce();let _0x441168=_0x46ce86[_0x44c9da];return _0x441168;}const ACTIVE_PROFILE_FILE='active-profile.txt',LEGACY_ACTIVE_ENV_FILE='active-env.txt';function getActiveProfilePath(){const _0x55de3d={'sAeZP':function(_0x2b4501,_0x1f841f,_0x3d2e01){return _0x2b4501(_0x1f841f,_0x3d2e01);}},_0x48b127=_0x55de3d['sAeZP'](join,getRangerDir(),ACTIVE_PROFILE_FILE);if(existsSync(_0x48b127))return _0x48b127;return join(getRangerHomeDir(),ACTIVE_PROFILE_FILE);}function getLegacyActiveEnvPath(){const _0x58ec16=_0x4411,_0x15d59d={'tlGzz':function(_0x203f83,_0x2709f5,_0x49cab4){return _0x203f83(_0x2709f5,_0x49cab4);},'KIBfi':function(_0x2bb31e){return _0x2bb31e();}},_0x108758=_0x15d59d['tlGzz'](join,_0x15d59d[_0x58ec16(0x1bb)](getRangerDir),LEGACY_ACTIVE_ENV_FILE);if(existsSync(_0x108758))return _0x108758;return join(getRangerHomeDir(),LEGACY_ACTIVE_ENV_FILE);}function _0x46ce(){const _0x370f0d=['8qTuJSI','24784130sOWhQZ','408rYgfWc','OjUAA','SUbsY','ACkgm','5722101TGhNAr','BOMPl','jHwjH','11oaRzle','rKFwn','KIBfi','bVCcE','1617183FNhZIs','4824688KJXZvf','DohKJ','4207795kzQiZO','dvBSn','znTTL','1086532LDpyFq','1ndeXCz','swkjw','135527zDgXKt'];_0x46ce=function(){return _0x370f0d;};return _0x46ce();}function getActiveProfileWritePath(){const _0x2c3207=_0x4411,_0x377d74={'rnvQK':function(_0x5a6d53,_0x14c915){return _0x5a6d53(_0x14c915);},'BOMPl':function(_0x2d92e4){return _0x2d92e4();},'SUbsY':function(_0x5c4931,_0x289b37,_0x368f26){return _0x5c4931(_0x289b37,_0x368f26);}},_0x1aba41=getRangerDir();if(_0x377d74['rnvQK'](existsSync,_0x1aba41))return{'path':join(_0x1aba41,ACTIVE_PROFILE_FILE),'dir':_0x1aba41,'isUserScope':![]};const _0x2bd14f=_0x377d74[_0x2c3207(0x1b7)](getRangerHomeDir);return{'path':_0x377d74[_0x2c3207(0x1b4)](join,_0x2bd14f,ACTIVE_PROFILE_FILE),'dir':_0x2bd14f,'isUserScope':!![]};}async function migrateLegacyActiveEnv(){const _0x35a98e=_0x4411,_0x5d1bfa={'LgjIz':'utf-8','Ipjix':function(_0x381643){return _0x381643();},'jHwjH':function(_0x12e421,_0x198334,_0x23f16d){return _0x12e421(_0x198334,_0x23f16d);},'swkjw':function(_0x236119,_0x1fa142,_0x290c4c){return _0x236119(_0x1fa142,_0x290c4c);},'KuQRC':function(_0x462777,_0x5ef82a,_0x2dbb0c,_0x5406e1){return _0x462777(_0x5ef82a,_0x2dbb0c,_0x5406e1);},'rKFwn':function(_0x11779c,_0x21d0fd){return _0x11779c(_0x21d0fd);},'OjUAA':function(_0x17c653,_0x11d16d,_0x17252f,_0x28b923){return _0x17c653(_0x11d16d,_0x17252f,_0x28b923);}},_0x1c0f84=getLegacyActiveEnvPath();if(!existsSync(_0x1c0f84))return null;let _0x2a8552=null;try{_0x2a8552=(await readFile(_0x1c0f84,_0x5d1bfa['LgjIz']))['trim']()||null;}catch{_0x2a8552=null;}if(!_0x2a8552)return null;const _0xec8bdd=_0x5d1bfa['Ipjix'](getRangerHomeDir),_0x200a6f=_0x1c0f84===_0x5d1bfa['jHwjH'](join,_0xec8bdd,LEGACY_ACTIVE_ENV_FILE);if(_0x200a6f){const _0x5092f3=_0x5d1bfa[_0x35a98e(0x1b8)](join,_0xec8bdd,ACTIVE_PROFILE_FILE);try{await _0x5d1bfa[_0x35a98e(0x1ae)](mkdir,_0xec8bdd,{'recursive':!![]}),await _0x5d1bfa['KuQRC'](writeFile,_0x5092f3,_0x2a8552,_0x5d1bfa['LgjIz']),await _0x5d1bfa['rKFwn'](unlink,_0x1c0f84);}catch{}return _0x2a8552;}const {path:_0x2fd274,dir:_0x3ebfa6}=_0x5d1bfa['Ipjix'](getActiveProfileWritePath);try{await rename(_0x1c0f84,_0x2fd274);}catch{try{await mkdir(_0x3ebfa6,{'recursive':!![]}),await _0x5d1bfa[_0x35a98e(0x1b3)](writeFile,_0x2fd274,_0x2a8552,_0x5d1bfa['LgjIz']),await _0x5d1bfa[_0x35a98e(0x1ba)](unlink,_0x1c0f84);}catch{}}return _0x2a8552;}export async function readActiveProfileName(){const _0x191b34=_0x4411,_0x4d9229={'znTTL':function(_0x15d3b2){return _0x15d3b2();},'bVCcE':function(_0x41038c,_0x3bd0aa,_0x22b047){return _0x41038c(_0x3bd0aa,_0x22b047);},'ACkgm':'utf-8'},_0x1c3169=_0x4d9229[_0x191b34(0x1ab)](getActiveProfilePath);if(existsSync(_0x1c3169))try{return(await _0x4d9229[_0x191b34(0x1bc)](readFile,_0x1c3169,_0x4d9229[_0x191b34(0x1b5)]))['trim']()||null;}catch{return null;}return await _0x4d9229['znTTL'](migrateLegacyActiveEnv);}export async function writeActiveProfileName(_0x5ea299){const _0x5c61e2=_0x4411,_0x51999f={'DohKJ':function(_0xe9a5ee){return _0xe9a5ee();},'dvBSn':function(_0xe1c273,_0x3db4d5){return _0xe1c273(_0x3db4d5);}},{path:_0x20cb79,dir:_0x2a67c4}=getActiveProfileWritePath();await mkdir(_0x2a67c4,{'recursive':!![]}),await writeFile(_0x20cb79,_0x5ea299,'utf-8');const _0x181e3f=_0x51999f[_0x5c61e2(0x1bf)](getLegacyActiveEnvPath);if(existsSync(_0x181e3f))try{await _0x51999f[_0x5c61e2(0x1c1)](unlink,_0x181e3f);}catch{}}export async function migrateActiveProfileFile(){const _0x39232a={'llBhX':function(_0x57006c){return _0x57006c();}},_0x4f57cb=await _0x39232a['llBhX'](migrateLegacyActiveEnv);return _0x4f57cb!==null;}
|