@ranger-testing/ranger-cli 2.5.3 → 2.5.4-alpha.1f7a251-7
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 +23 -3
- package/package.json +6 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3152ca,_0x272055){const _0x4d793b=_0x1bbd,_0x3b3321=_0x3152ca();while(!![]){try{const _0x594813=parseInt(_0x4d793b(0xf1))/0x1*(-parseInt(_0x4d793b(0xfb))/0x2)+-parseInt(_0x4d793b(0x10d))/0x3*(-parseInt(_0x4d793b(0x10c))/0x4)+-parseInt(_0x4d793b(0x10b))/0x5+-parseInt(_0x4d793b(0x113))/0x6+parseInt(_0x4d793b(0x10a))/0x7*(-parseInt(_0x4d793b(0x103))/0x8)+parseInt(_0x4d793b(0xf9))/0x9+-parseInt(_0x4d793b(0x10f))/0xa*(-parseInt(_0x4d793b(0xf5))/0xb);if(_0x594813===_0x272055)break;else _0x3b3321['push'](_0x3b3321['shift']());}catch(_0x4a66ad){_0x3b3321['push'](_0x3b3321['shift']());}}}(_0x22c5,0xf3328));import{basename}from'path';function _0x1bbd(_0x43e543,_0x43c676){_0x43e543=_0x43e543-0xf1;const _0x22c562=_0x22c5();let _0x1bbd6b=_0x22c562[_0x43e543];return _0x1bbd6b;}import _0x409abb 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';function _0x22c5(){const _0xc92820=['248969QyKoxK','9652140RvLFRz','28828EgOTQW','381wzUrPr','opencode','30jRPvul','\x20--opencode','/skills/','project','3268254iOGTfu','SZJEm','autoInstall','ANQRl','3xHKBTz','prompt','UTXUM','hfaNc','13544784sVhZvZ','rhAUh','platform','NPyJb','10582299RYRhhL','To\x20use:','783810XyJNoP','\x20skill','isTTY','jyJST','iVHZW','ZAGCZ','installLevel','warn','256VdcPKr','CwlgK','✓\x20Found\x20API\x20token','/.opencode/skills/','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','log','VoaAv'];_0x22c5=function(){return _0xc92820;};return _0x22c5();}export async function skillup(_0x4b66a4={}){const _0x508ee6=_0x1bbd,_0x1c5610={'kwZrl':'\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','tAOfs':_0x508ee6(0x107),'mxneG':'To\x20get\x20started:','ZAGCZ':'\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','rhAUh':function(_0x529dea,_0x2d387b){return _0x529dea===_0x2d387b;},'iVHZW':_0x508ee6(0x110),'CwlgK':_0x508ee6(0x10e),'NPyJb':'user','hfaNc':function(_0xed1222){return _0xed1222();},'ivGQG':_0x508ee6(0x101),'WYiQG':'project','wtKlR':'\x0a📦\x20Installing\x20skills...\x0a','VoaAv':'ranger','jwCCJ':function(_0xac8379,_0x5056e2){return _0xac8379 instanceof _0x5056e2;},'ANQRl':'user-level','pnCjx':'project-level','SZJEm':function(_0x3cce2b,_0x35c86c){return _0x3cce2b>_0x35c86c;},'jyJST':'\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','UTXUM':'\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'](_0x1c5610['kwZrl']);const _0x4ddc48=_0x4b66a4[_0x508ee6(0xf7)]??'claude',_0x442901=await getToken();if(!_0x442901){console['log'](_0x1c5610['tAOfs']),console[_0x508ee6(0x108)](_0x1c5610['mxneG']),console['log'](_0x1c5610[_0x508ee6(0x100)]),console[_0x508ee6(0x108)]('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0x1c5610[_0x508ee6(0xf6)](_0x4ddc48,'opencode')?_0x1c5610[_0x508ee6(0xff)]:'')+'\x20<your-api-token>'),console['log']('\x20\x203.\x20Run:\x20ranger\x20skillup'+(_0x4ddc48===_0x1c5610[_0x508ee6(0x104)]?_0x508ee6(0x110):'')+'\x0a');return;}console[_0x508ee6(0x108)](_0x508ee6(0x105));const _0x48d253=getProjectRoot(),_0x19bd4d=basename(_0x48d253),_0x5a6904=_0x1c5610['rhAUh'](_0x4ddc48,_0x1c5610['CwlgK'])?getOpencodeConfigDir(_0x1c5610[_0x508ee6(0xf8)])+'/skills/':_0x1c5610[_0x508ee6(0xf4)](getClaudeConfigDir)+_0x508ee6(0x111),_0x5d7ea9=_0x4ddc48===_0x1c5610['CwlgK']?_0x48d253+_0x508ee6(0x106):_0x48d253+'/.claude/skills/',_0x5bf3ee=process['stdin'][_0x508ee6(0xfd)]&&process['stdout']['isTTY'];let _0x2d5e18;if(_0x4b66a4['autoInstall'])_0x2d5e18=_0x4b66a4[_0x508ee6(0x115)];else{if(_0x5bf3ee){const _0x4f8a3c=await _0x409abb[_0x508ee6(0xf2)]([{'type':'list','name':_0x1c5610['ivGQG'],'message':'Where\x20should\x20skills\x20be\x20installed?','choices':[{'name':'All\x20projects\x20('+_0x5a6904+')','value':_0x1c5610[_0x508ee6(0xf8)]},{'name':'This\x20project\x20only\x20('+_0x5d7ea9+')','value':_0x1c5610['WYiQG']}]}]);_0x2d5e18=_0x4f8a3c['installLevel'];}else _0x2d5e18=_0x508ee6(0x112),console['log']('Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20('+_0x5d7ea9+')');}let _0x3dbb63=0x0;const _0x58c15b=_0x1c5610[_0x508ee6(0xf4)](getCurrentVersion);console[_0x508ee6(0x108)](_0x1c5610['wtKlR']);try{const _0x1ffee6=await installSkill(_0x1c5610[_0x508ee6(0x109)],{'cliVersion':_0x58c15b,'level':_0x2d5e18,'platform':_0x4ddc48});_0x1ffee6&&_0x3dbb63++;}catch(_0x5c0da5){console[_0x508ee6(0x102)]('\x20\x20Failed\x20to\x20install\x20ranger\x20skill:',_0x1c5610['jwCCJ'](_0x5c0da5,Error)?_0x5c0da5['message']:_0x5c0da5);}if(_0x3dbb63>0x0){const _0x1a92f2=_0x2d5e18==='user'?_0x1c5610[_0x508ee6(0x116)]:_0x1c5610['pnCjx'];console[_0x508ee6(0x108)]('\x0a✅\x20Installed\x20'+_0x3dbb63+'\x20'+_0x1a92f2+_0x508ee6(0xfc)+(_0x1c5610[_0x508ee6(0x114)](_0x3dbb63,0x1)?'s':'')+'\x20successfully!\x0a'),!_0x4b66a4['suppressUsage']&&(console['log'](_0x508ee6(0xfa)),_0x1c5610['rhAUh'](_0x4ddc48,_0x1c5610['CwlgK'])?console['log'](_0x1c5610[_0x508ee6(0xfe)]):console['log'](_0x1c5610[_0x508ee6(0xf3)]));}else console['log']('\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a');}
|
package/build/commands/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x294688=_0x503b;(function(_0x3354d8,_0x35ead4){const _0x579447=_0x503b,_0x3118d6=_0x3354d8();while(!![]){try{const _0x5ca64c=-parseInt(_0x579447(0x222))/0x1*(-parseInt(_0x579447(0x207))/0x2)+parseInt(_0x579447(0x252))/0x3+parseInt(_0x579447(0x230))/0x4*(-parseInt(_0x579447(0x219))/0x5)+-parseInt(_0x579447(0x224))/0x6+parseInt(_0x579447(0x201))/0x7+-parseInt(_0x579447(0x215))/0x8*(parseInt(_0x579447(0x208))/0x9)+parseInt(_0x579447(0x236))/0xa;if(_0x5ca64c===_0x35ead4)break;else _0x3118d6['push'](_0x3118d6['shift']());}catch(_0x44833b){_0x3118d6['push'](_0x3118d6['shift']());}}}(_0x4e02,0x7f61a));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x119539 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';function _0x503b(_0x388967,_0x14e696){_0x388967=_0x388967-0x1e0;const _0x4e02df=_0x4e02();let _0x503b3f=_0x4e02df[_0x388967];return _0x503b3f;}import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerDir,getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.58.2';const bold=_0x16e26b=>_0x294688(0x223)+_0x16e26b+'\x1b[0m';export function getPlaywrightVersion(){const _0x460bce=_0x294688,_0x47aba2={'PiFQK':_0x460bce(0x1fb),'kidMl':function(_0x5debec,_0x59d5fe){return _0x5debec(_0x59d5fe);}};try{const _0x41ce02=require['resolve'](_0x47aba2[_0x460bce(0x235)]),_0x233b60=_0x47aba2['kidMl'](require,_0x41ce02);return _0x233b60[_0x460bce(0x21e)];}catch{return null;}}export function installChromiumBinary(_0x3da6e0,_0x51fa60=![]){const _0x5255c6=_0x294688,_0x1007fa={'zYbVf':_0x5255c6(0x221),'sQAGM':function(_0x18262d,_0x28d1cc,_0x22988d,_0x3980f7){return _0x18262d(_0x28d1cc,_0x22988d,_0x3980f7);},'kXkRh':'npx','codyB':'inherit','sCksY':_0x5255c6(0x250)};return new Promise((_0x2c1f57,_0x2e98da)=>{const _0x2d7f83=_0x5255c6,_0x4ace37={'pCxKb':function(_0x95e136,_0x50353c){return _0x95e136(_0x50353c);}},_0x3104de=[_0x2d7f83(0x23a)+_0x3da6e0,_0x2d7f83(0x234),..._0x51fa60?['--with-deps']:[],_0x1007fa[_0x2d7f83(0x23c)]],_0x47e66c=_0x1007fa[_0x2d7f83(0x217)](spawn,_0x1007fa['kXkRh'],_0x3104de,{'stdio':['ignore','inherit',_0x1007fa['codyB']],'shell':process[_0x2d7f83(0x20c)]==='win32'});_0x47e66c['on'](_0x1007fa['sCksY'],_0x4064d9=>{_0x4064d9===0x0?_0x2c1f57():_0x2e98da(new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x4064d9));}),_0x47e66c['on'](_0x2d7f83(0x24c),_0x3b6308=>{_0x4ace37['pCxKb'](_0x2e98da,_0x3b6308);});});}export async function authenticate(_0xf37903){const _0x58b607=_0x294688,_0x2ebe29={'mIiim':function(_0xc59f39){return _0xc59f39();},'obcso':function(_0x36addb,_0xcdf49a){return _0x36addb(_0xcdf49a);},'eZTLP':_0x58b607(0x23e),'wXDRw':function(_0x1983d7,_0x411d8c){return _0x1983d7 instanceof _0x411d8c;},'SSBln':'device_auth','wipbI':_0x58b607(0x257),'KNvRC':_0x58b607(0x1e3)};if(!_0xf37903){const _0x440818=await _0x2ebe29[_0x58b607(0x226)](getToken);if(_0x440818){const _0x1c372a=await _0x2ebe29[_0x58b607(0x24e)](getCurrentUser,_0x440818);if(_0x1c372a[_0x58b607(0x247)])return console['log'](_0x58b607(0x1e6)+_0x1c372a[_0x58b607(0x228)]['organizationName']),{'token':_0x440818,'method':_0x2ebe29['eZTLP']};}try{_0xf37903=await _0x2ebe29['mIiim'](runDeviceAuthFlow);}catch(_0xf16f){throw new Error(_0x58b607(0x245)+(_0x2ebe29['wXDRw'](_0xf16f,Error)?_0xf16f[_0x58b607(0x20b)]:_0xf16f));}const _0x3ce0d2=await getCurrentUser(_0xf37903);if(!_0x3ce0d2['success'])throw new Error(_0x58b607(0x1fd)+_0x3ce0d2['error']);return console[_0x58b607(0x1eb)](_0x58b607(0x231)+_0x3ce0d2['user'][_0x58b607(0x249)]),{'token':_0xf37903,'method':_0x2ebe29['SSBln']};}console['log'](_0x58b607(0x253));const _0x488af9=await getCurrentUser(_0xf37903);if(!_0x488af9[_0x58b607(0x247)]){if(_0x488af9[_0x58b607(0x206)])throw new Error('Authentication\x20failed:\x20'+_0x488af9['error']+_0x58b607(0x209));else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x488af9[_0x58b607(0x24c)]+_0x58b607(0x210));}return console[_0x58b607(0x1eb)](_0x58b607(0x231)+_0x488af9['user']['organizationName']),await storeToken(_0xf37903),console[_0x58b607(0x1eb)](process[_0x58b607(0x22d)]['GITHUB_ENV']?_0x2ebe29['wipbI']:_0x2ebe29['KNvRC']),{'token':_0xf37903,'method':'provided_token'};}export async function ensureRangerDir(_0x47eac7){const _0x2141e2=_0x294688,_0x277cf9={'oGHkg':function(_0x1c7e78,_0x561001){return _0x1c7e78===_0x561001;},'SDyul':function(_0xaa2df1){return _0xaa2df1();},'GjLyz':_0x2141e2(0x1ff),'RszyG':function(_0x4f1d9a){return _0x4f1d9a();},'hPhGY':function(_0x3c4937,_0x32d5ac){return _0x3c4937(_0x32d5ac);},'qYbXs':'✓\x20Created\x20.ranger/\x20directory'};let _0x187e4f;if(_0x277cf9['oGHkg'](_0x47eac7,_0x2141e2(0x228)))_0x187e4f=_0x277cf9[_0x2141e2(0x1f6)](getRangerHomeDir);else{const _0x3db136=findGitRoot();_0x187e4f=_0x3db136?join(_0x3db136,_0x277cf9['GjLyz']):_0x277cf9[_0x2141e2(0x1e0)](getRangerDir);}return!_0x277cf9['hPhGY'](existsSync,_0x187e4f)?(await mkdir(_0x187e4f,{'recursive':!![]}),console['log'](_0x277cf9[_0x2141e2(0x225)]),{'path':_0x187e4f,'installed':!![]}):(console['log'](_0x2141e2(0x1ed)),{'path':_0x187e4f,'installed':![]});}export async function ensureChromium(_0x2d5355=![]){const _0x40f89f=_0x294688,_0xf90cc={'YokzH':_0x40f89f(0x232),'oEYWW':_0x40f89f(0x234),'OjdDM':_0x40f89f(0x1e2),'Grjmr':function(_0x1ad561,_0x2a91b2,_0x236318){return _0x1ad561(_0x2a91b2,_0x236318);},'umQze':'\x0a❌\x20Failed\x20to\x20install\x20Chromium:','JEVsA':'You\x20can\x20install\x20it\x20manually\x20by\x20running:'};let _0x570091=![];try{const _0x54721d=chromium[_0x40f89f(0x239)]();_0x570091=existsSync(_0x54721d);}catch{_0x570091=![];}if(_0x570091)return console['log'](_0xf90cc['YokzH']),![];const _0x5c0626=getPlaywrightVersion(),_0xa48a5=_0x5c0626??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x5665b6=!_0x5c0626,_0x46e09a=process['stdin']['isTTY']&&process['stdout']['isTTY'];let _0x32dc3b=!![];if(_0x46e09a){const {install:_0x3a62c8}=await _0x119539[_0x40f89f(0x1fa)]([{'type':_0x40f89f(0x238),'name':_0xf90cc['oEYWW'],'message':_0x5665b6?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0xa48a5+'\x20now?':_0x40f89f(0x1ec)+_0xa48a5+_0x40f89f(0x202),'default':!![]}]);_0x32dc3b=_0x3a62c8;}else console['log']('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0xa48a5+(_0x5665b6?_0xf90cc[_0x40f89f(0x1f3)]:'')+_0x40f89f(0x233));if(_0x32dc3b){console[_0x40f89f(0x1eb)](_0x40f89f(0x204));try{await _0xf90cc[_0x40f89f(0x244)](installChromiumBinary,_0xa48a5,_0x2d5355),console['log'](_0x40f89f(0x22b));}catch(_0x61c41c){console['error'](_0xf90cc[_0x40f89f(0x1f2)],_0x61c41c instanceof Error?_0x61c41c['message']:_0x61c41c),console['log'](_0xf90cc[_0x40f89f(0x237)]),console['log']('\x20\x20npx\x20playwright@'+_0xa48a5+_0x40f89f(0x23d));}}else console[_0x40f89f(0x1eb)]('\x0a⚠\x20Skipping\x20Chromium\x20installation.'),console['log']('You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'),console['log']('\x20\x20npx\x20playwright@'+_0xa48a5+_0x40f89f(0x23d));return!![];}export async function writeRangerGitignore(_0x271889){const _0x19a68a=_0x294688,_0x55b00a={'DVwaA':function(_0x3a8cf8,_0x4032e8,_0x567f47){return _0x3a8cf8(_0x4032e8,_0x567f47);},'ELaij':_0x19a68a(0x205)},_0x3f877e=join(_0x271889,'.gitignore'),_0x1d4d3a='\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 _0x55b00a[_0x19a68a(0x1fe)](writeFile,_0x3f877e,_0x1d4d3a),console[_0x19a68a(0x1eb)](_0x55b00a[_0x19a68a(0x21c)]);}function printProfileSetupLaterInstructions(){const _0x4a6413=_0x294688,_0x2c5468={'gEZXY':function(_0x269db0,_0x1fcede){return _0x269db0(_0x1fcede);},'ywsWR':'Make\x20sure\x20your\x20app\x20is\x20running\x20before\x20you\x20start.\x0a'};console['log']('\x0aIn\x20order\x20for\x20Ranger\x20to\x20verify\x20your\x20work,\x20you\x27ll\x20need\x20to\x20set\x20up\x20a\x20profile\x20later\x20with:'),console['log']('\x20\x20'+_0x2c5468[_0x4a6413(0x1e1)](bold,'ranger\x20profile\x20add\x20local')),console[_0x4a6413(0x1eb)](_0x2c5468['ywsWR']);}export async function ensureLocalEnv(_0x4759cb,_0x13d31e){const _0x13b12a=_0x294688,_0x5e4e53={'oyYuL':function(_0x585156){return _0x585156();},'JfFYz':_0x13b12a(0x254),'JmrUe':function(_0x5759d7,_0x636021){return _0x5759d7===_0x636021;},'EOtML':'user','plIOM':function(_0x1c2536,_0x22d6cf,_0x1a6ccf){return _0x1c2536(_0x22d6cf,_0x1a6ccf);},'jnfva':_0x13b12a(0x243),'TWefA':'auth,\x20you\x20can\x20log\x20in\x20and\x20we\x27ll\x20save\x20the\x20session\x20state\x20for\x20Ranger\x20to','bhnYI':_0x13b12a(0x24d),'uJqKH':'You\x27ll\x20need\x20the\x20app\x20to\x20be\x20running\x20to\x20set\x20up\x20the\x20profile.','zNoiX':_0x13b12a(0x251),'zaUXW':_0x13b12a(0x248),'HAKBH':_0x13b12a(0x22f)};if(!_0x5e4e53[_0x13b12a(0x246)](findGitRoot))return console[_0x13b12a(0x1eb)](_0x5e4e53[_0x13b12a(0x20f)]),{'ready':![],'skipped':!![]};const _0x4ded34=_0x5e4e53[_0x13b12a(0x258)](_0x4759cb?.['scope'],_0x5e4e53['EOtML'])?getRangerHomeDir():undefined;if(_0x5e4e53['plIOM'](findExistingEnv,_0x5e4e53['jnfva'],{'locations':[_0x5e4e53['jnfva']],'rangerDir':_0x4ded34}))return console['log'](_0x13b12a(0x1f9)),{'ready':!![],'skipped':![]};const _0x341caa=process[_0x13b12a(0x240)]['isTTY']&&process['stdout'][_0x13b12a(0x1f4)];if(_0x341caa&&!_0x4759cb?.[_0x13b12a(0x21b)]){console['log']('\x0aA\x20profile\x20gives\x20Ranger\x27s\x20browser\x20agent\x20information\x20about\x20how'),console[_0x13b12a(0x1eb)](_0x13b12a(0x203)),console[_0x13b12a(0x1eb)](_0x5e4e53['TWefA']),console['log'](_0x5e4e53[_0x13b12a(0x229)]),console[_0x13b12a(0x1eb)](_0x5e4e53['uJqKH']);const {wantsProfile:_0x3b87a7}=await _0x119539[_0x13b12a(0x1fa)]([{'type':'confirm','name':_0x5e4e53[_0x13b12a(0x1e9)],'message':_0x5e4e53[_0x13b12a(0x220)],'default':!![]}]);if(!_0x3b87a7)return printProfileSetupLaterInstructions(),{'ready':![],'skipped':!![]};}try{return await addEnv(_0x13b12a(0x243),{'url':_0x4759cb?.[_0x13b12a(0x21b)],'force':_0x4759cb?.['force'],'allowInsecureLocalhost':_0x4759cb?.[_0x13b12a(0x255)],'scope':_0x4759cb?.[_0x13b12a(0x1ef)]},_0x13d31e),{'ready':!![],'skipped':![]};}catch(_0x42c846){return console['error'](_0x5e4e53[_0x13b12a(0x23f)],_0x42c846 instanceof Error?_0x42c846['message']:_0x42c846),printProfileSetupLaterInstructions(),{'ready':![],'skipped':![]};}}function _0x4e02(){const _0x194fe5=['plugin','SDyul','or\x20use\x20--scope\x20user\x20to\x20install\x20at\x20the\x20user\x20level\x20without\x20a\x20project.','FXWeQ','✓\x20Local\x20profile\x20already\x20exists','prompt','playwright/package.json','/ranger:enable','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','DVwaA','.ranger','UWMoB','1488886nIWkVT',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','to\x20access\x20your\x20app.\x20If\x20the\x20part\x20of\x20your\x20app\x20you\x20want\x20to\x20test\x20is\x20behind','\x0aInstalling\x20Chromium\x20browser...\x0a','✓\x20Created\x20.ranger/.gitignore','status','297244hZjBvs','963207mKyFsJ','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','trackPhaseStart','message','platform','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','JfFYz','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','NbWye','skipped','cHRLJ','rCtLM','8dRBfhm','stdout','sQAGM','ready','1814605JRCVTq','skipAuth','url','ELaij','opencode','version','Non-interactive\x20mode:\x20No\x20--scope\x20provided,\x20defaulting\x20to\x20user.','zaUXW','chromium','7rhPBkQ','\x1b[1m','5156214lstShP','qYbXs','mIiim','mmlBV','user','bhnYI','pODnv','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','\x0a🚀\x20Ranger\x20Setup\x0a','env','Non-interactive\x20mode:\x20Skipping\x20profile\x20setup.\x20To\x20set\x20up\x20a\x20profile,\x20pass\x20--url\x20or\x20run\x20later:','\x0a❌\x20Profile\x20setup\x20failed:','4ZzRtQu','✓\x20Authenticated\x20to\x20','✓\x20Playwright\x20Chromium\x20browser\x20found','...','install','PiFQK','1200920hWpXIF','JEVsA','confirm','executablePath','playwright@','\x0aIn\x20Claude\x20Code,\x20run\x20','zYbVf','\x20install\x20chromium','existing_token','HAKBH','stdin','git_check','lvFKz','local','Grjmr','Authentication\x20failed:\x20','oyYuL','success','Would\x20you\x20like\x20to\x20set\x20up\x20the\x20profile\x20now?','organizationName','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','ranger\x20profile\x20add\x20local','error','use\x20until\x20the\x20session\x20expires.\x0a','obcso','\x0a✅\x20You\x27re\x20ready\x20to\x20start\x20using\x20Ranger\x20Feature\x20Review.','close','wantsProfile','1433769ZaPxUy','Validating\x20API\x20token...','⚠\x20No\x20git\x20repository\x20found.\x20Run\x20`ranger\x20profile\x20add\x20local`\x20from\x20your\x20project\x20directory.','allowInsecureLocalhost','xLHtH','✓\x20Exported\x20credentials\x20for\x20CI','JmrUe','RszyG','gEZXY','\x20(fallback\x20version)','✓\x20Stored\x20credentials\x20locally','auth','PZDJS','✓\x20Already\x20authenticated\x20to\x20','skipChromium','VKtGx','zNoiX','withDeps','log','The\x20required\x20version\x20(','✓\x20.ranger/\x20directory\x20already\x20exists','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','scope','KXAdL','trackPhaseEnd','umQze','OjdDM','isTTY'];_0x4e02=function(){return _0x194fe5;};return _0x4e02();}export async function start(_0x2f159b,_0x24c058,_0x8742de){const _0x7076ca=_0x294688,_0x23af5a={'IqDNj':_0x7076ca(0x21f),'FXWeQ':function(_0x430860){return _0x430860();},'KXAdL':function(_0x53df06,_0xe4a4be){return _0x53df06&&_0xe4a4be;},'RBRjb':'No\x20git\x20repository\x20found','xLHtH':'user','wuiAV':_0x7076ca(0x1e4),'BshpY':'chromium','KSjNI':_0x7076ca(0x20e),'lvFKz':function(_0x16c5fd,_0x1ec59d){return _0x16c5fd(_0x1ec59d);},'evveG':_0x7076ca(0x1ee),'qQKDq':_0x7076ca(0x1f5),'PZDJS':function(_0x2bc3f2,_0x6fb915,_0x4bef1c){return _0x2bc3f2(_0x6fb915,_0x4bef1c);},'pODnv':function(_0x8507b1){return _0x8507b1();},'cHRLJ':'skills','nHORF':_0x7076ca(0x24a),'jvbAq':'\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','rCtLM':_0x7076ca(0x22e),'mmlBV':function(_0x173aef,_0x5a9151){return _0x173aef===_0x5a9151;},'KJgHY':'\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','VKtGx':'and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','NbWye':_0x7076ca(0x1fc),'UWMoB':function(_0x287cc3,_0x557106){return _0x287cc3+_0x557106;}};console['log'](_0x7076ca(0x22c));const _0x114a9e=process['stdin'][_0x7076ca(0x1f4)]&&process[_0x7076ca(0x216)][_0x7076ca(0x1f4)];!_0x114a9e&&!_0x24c058?.['scope']&&(console[_0x7076ca(0x1eb)](_0x23af5a['IqDNj']),_0x24c058={..._0x24c058,'scope':_0x7076ca(0x228)});const _0x537873=_0x24c058?.['scope']===_0x7076ca(0x228);_0x8742de?.[_0x7076ca(0x20a)](_0x7076ca(0x241));const _0xbb58ab=_0x23af5a[_0x7076ca(0x1f8)](findGitRoot);if(_0x23af5a[_0x7076ca(0x1f0)](!_0xbb58ab,!_0x537873)){await _0x8742de?.['trackPhaseError']('git_check',new Error(_0x23af5a['RBRjb']));throw new Error('No\x20git\x20repository\x20found.\x20Please\x20run\x20`ranger\x20setup`\x20from\x20inside\x20your\x20project\x20directory,\x0a'+_0x7076ca(0x1f7));}_0x8742de?.[_0x7076ca(0x1f1)]('git_check');const _0x194169=!existsSync(getRangerDir()),{path:_0x1ffd09}=await ensureRangerDir(_0x537873?_0x23af5a[_0x7076ca(0x256)]:undefined);if(_0x24c058?.['skipAuth'])console[_0x7076ca(0x1eb)]('✓\x20Skipping\x20authentication\x20(--skip-auth)'),_0x8742de?.['trackPhaseEnd'](_0x23af5a['wuiAV'],{'isFirstRun':_0x194169,'method':_0x7076ca(0x212)});else{_0x8742de?.['trackPhaseStart'](_0x7076ca(0x1e4));const _0x356435=await authenticate(_0x2f159b);_0x8742de?.['trackPhaseEnd']('auth',{'isFirstRun':_0x194169,'method':_0x356435['method']});}_0x8742de?.['trackPhaseStart'](_0x23af5a['BshpY']);_0x24c058?.['skipChromium']?console['log'](_0x23af5a['KSjNI']):await _0x23af5a['lvFKz'](ensureChromium,_0x24c058?.[_0x7076ca(0x1ea)]);_0x8742de?.['trackPhaseEnd'](_0x23af5a['BshpY'],{'isFirstRun':_0x194169,'skipped':!!_0x24c058?.[_0x7076ca(0x1e7)]});!_0x537873&&await writeRangerGitignore(_0x1ffd09);console[_0x7076ca(0x1eb)](_0x23af5a['evveG']);const _0x324495=_0x24c058?.[_0x7076ca(0x1ef)],_0x1f0a11=_0x24c058?.[_0x7076ca(0x21d)]??![];let _0x1ba7d0=null;_0x1f0a11?(_0x8742de?.['trackPhaseStart'](_0x23af5a['qQKDq']),_0x1ba7d0=await ensureOpencodePluginConfig(_0x324495),_0x8742de?.[_0x7076ca(0x1f1)](_0x23af5a['qQKDq'],{'isFirstRun':_0x194169,'opencode':!![]})):(_0x8742de?.[_0x7076ca(0x20a)]('plugin'),await ensureClaudePlugin(_0x324495),_0x8742de?.['trackPhaseEnd'](_0x23af5a['qQKDq'],{'isFirstRun':_0x194169}));if(_0x1f0a11&&_0x1ba7d0){_0x8742de?.['trackPhaseStart']('skills');try{await _0x23af5a[_0x7076ca(0x1e5)](installSkill,'ranger',{'level':_0x1ba7d0['scope'],'cliVersion':_0x23af5a[_0x7076ca(0x22a)](getCurrentVersion),'platform':_0x7076ca(0x21d)}),_0x8742de?.['trackPhaseEnd'](_0x23af5a['cHRLJ'],{'isFirstRun':_0x194169,'opencode':!![]});}catch(_0x359e29){console['warn'](_0x23af5a['nHORF'],_0x359e29 instanceof Error?_0x359e29['message']:_0x359e29),_0x8742de?.['trackPhaseEnd'](_0x23af5a[_0x7076ca(0x213)],{'isFirstRun':_0x194169,'opencode':!![],'failed':!![]});}}else _0x8742de?.[_0x7076ca(0x20a)](_0x23af5a[_0x7076ca(0x213)]),await _0x23af5a['lvFKz'](ensureClaudeSkills,_0x324495),_0x8742de?.[_0x7076ca(0x1f1)](_0x23af5a['cHRLJ'],{'isFirstRun':_0x194169});if(_0x24c058?.[_0x7076ca(0x21a)])console['log'](_0x23af5a['jvbAq']);else{if(!_0x114a9e&&!_0x24c058?.['url'])console['log'](_0x23af5a[_0x7076ca(0x214)]),console['log']('\x20\x20'+_0x23af5a['lvFKz'](bold,_0x7076ca(0x24b))+'\x0a');else{_0x8742de?.['trackPhaseStart']('profile');const _0x4b04d2=await _0x23af5a['PZDJS'](ensureLocalEnv,{'url':_0x24c058?.[_0x7076ca(0x21b)],'force':_0x24c058?.['force'],'allowInsecureLocalhost':_0x24c058?.[_0x7076ca(0x255)],'scope':_0x23af5a[_0x7076ca(0x227)](_0x24c058?.['scope'],_0x23af5a['xLHtH'])?'user':undefined},_0x8742de);_0x8742de?.[_0x7076ca(0x1f1)]('profile',{'isFirstRun':_0x194169,'profileReady':_0x4b04d2['ready'],'userSkipped':_0x4b04d2['skipped']}),_0x4b04d2[_0x7076ca(0x218)]&&console[_0x7076ca(0x1eb)](_0x7076ca(0x24f));}}if(_0x1f0a11)console['log'](_0x23af5a['KJgHY']),console['log'](_0x23af5a[_0x7076ca(0x1e8)]),console['log']('with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'),console['log']('verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.');else{const _0x30dec5=_0x23af5a[_0x7076ca(0x242)](bold,_0x23af5a[_0x7076ca(0x211)]);console[_0x7076ca(0x1eb)](_0x23af5a[_0x7076ca(0x200)](_0x23af5a['UWMoB'](_0x7076ca(0x23b)+_0x30dec5+'\x20and\x20prompt\x20the\x20coding'+'\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'),_0x7076ca(0x20d)));}}
|
|
1
|
+
const _0x640448=_0x2773;(function(_0x4f4ee0,_0x324858){const _0x2aeb35=_0x2773,_0x1d08e4=_0x4f4ee0();while(!![]){try{const _0x14a066=parseInt(_0x2aeb35(0x17f))/0x1+-parseInt(_0x2aeb35(0x190))/0x2*(-parseInt(_0x2aeb35(0x162))/0x3)+-parseInt(_0x2aeb35(0x17c))/0x4+-parseInt(_0x2aeb35(0x19d))/0x5+-parseInt(_0x2aeb35(0x1aa))/0x6+parseInt(_0x2aeb35(0x181))/0x7+parseInt(_0x2aeb35(0x1b2))/0x8*(parseInt(_0x2aeb35(0x189))/0x9);if(_0x14a066===_0x324858)break;else _0x1d08e4['push'](_0x1d08e4['shift']());}catch(_0x3d0b52){_0x1d08e4['push'](_0x1d08e4['shift']());}}}(_0x21db,0x1c06c));import{mkdir,writeFile}from'fs/promises';function _0x2773(_0x395a92,_0x4c9459){_0x395a92=_0x395a92-0x14a;const _0x21db5b=_0x21db();let _0x2773c6=_0x21db5b[_0x395a92];return _0x2773c6;}import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x49e381 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';function _0x21db(){const _0x547098=['vbUyC','XfFYO','\x1b[0m','\x20(fallback\x20version)','XvShz','oASFQ','120CgPxmN','No\x20git\x20repository\x20found\x20for\x20--scope\x20project.\x20Re-run\x20without\x20`--scope\x20project`\x20to\x20install\x20at\x20user\x20scope.','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','message','✓\x20Created\x20','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','DPQUv','\x20and\x20prompt\x20the\x20coding','gHyRn','success','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','allowInsecureLocalhost','✓\x20Exported\x20credentials\x20for\x20CI','auth','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','\x20\x20(or\x20use\x20','skipped','ranger','confirm','error','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','Authentication\x20failed:\x20','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','resolve','qgNvg',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','\x20\x20npx\x20playwright@','close','chromium','platform','log','stdin','profile','84834ndDlxS','withDeps','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','koilT','coePI','/ranger:enable','QEjtB','GITHUB_ENV','DioGy','local','Ykpuc','ranger\x20profile\x20add','prompt','plugin','hlQya','skipChromium','1.58.2','url','organizationName','\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','DlKhs','scope','stdout','OkjSJ','playwright@','trackPhaseError','480324binNjY','trackPhaseEnd','qFPnJ','118897ypIAFq','executablePath','502299bkMhFA','\x1b[1m','skills','ready','Hjdfe','RANGER_TEST_USERNAME','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','DZrhO','81063gpwhkf','skipAuth','diaDD','trackPhaseStart','✓\x20Created\x20.ranger/.gitignore','.ranger/','user','14OtvETL','zbSME','.ranger','install','\x0a🚀\x20Ranger\x20Setup\x0a','LqTYB','Validating\x20API\x20token...','...','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','.gitignore','✓\x20Authenticated\x20to\x20','\x20for\x20explicit\x20profile\x20management).','You\x20can\x20install\x20it\x20manually\x20by\x20running:','364695mDXtzR','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','npx','git_check','PnXGy','FiScT','✓\x20Stored\x20credentials\x20locally','env','device_auth','win32','No\x20git\x20repository\x20found','\x0a⚠\x20Skipping\x20Chromium\x20installation.','nctOm','1295334sUnzUZ','force'];_0x21db=function(){return _0x547098;};return _0x21db();}import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerDir,getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION=_0x640448(0x172);const bold=_0x53dae0=>_0x640448(0x182)+_0x53dae0+_0x640448(0x1ae);export function getPlaywrightVersion(){const _0x46fd49=_0x640448;try{const _0x36089f=require[_0x46fd49(0x158)]('playwright/package.json'),_0x23df58=require(_0x36089f);return _0x23df58['version'];}catch{return null;}}export function installChromiumBinary(_0x2ed2e5,_0x18ecf3=![]){const _0x36a7ec=_0x640448,_0x1528f9={'UpVOx':function(_0xe38201,_0x314cf0){return _0xe38201(_0x314cf0);},'DEVog':_0x36a7ec(0x193),'tuADn':'ignore','Hjdfe':'inherit','ovWYW':_0x36a7ec(0x15c)};return new Promise((_0x117718,_0x5a452f)=>{const _0x15c92d=_0x36a7ec,_0x2cab9a={'DLgHK':function(_0x55f48e,_0x1a847d){return _0x1528f9['UpVOx'](_0x55f48e,_0x1a847d);}},_0xe24d40=[_0x15c92d(0x17a)+_0x2ed2e5,_0x1528f9['DEVog'],..._0x18ecf3?['--with-deps']:[],_0x15c92d(0x15d)],_0xd3aff8=spawn(_0x15c92d(0x19f),_0xe24d40,{'stdio':[_0x1528f9['tuADn'],_0x1528f9['Hjdfe'],_0x1528f9[_0x15c92d(0x185)]],'shell':process[_0x15c92d(0x15e)]===_0x15c92d(0x1a6)});_0xd3aff8['on'](_0x1528f9['ovWYW'],_0x5afa43=>{_0x5afa43===0x0?_0x117718():_0x2cab9a['DLgHK'](_0x5a452f,new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x5afa43));}),_0xd3aff8['on']('error',_0x3fea65=>{_0x5a452f(_0x3fea65);});});}export async function authenticate(_0x3c7525){const _0x3d60f4=_0x640448,_0x4c3fd7={'XfFYO':function(_0x5cce63){return _0x5cce63();},'qFPnJ':function(_0x31695c){return _0x31695c();},'PnXGy':function(_0x1650e1,_0x144eb6){return _0x1650e1 instanceof _0x144eb6;},'koilT':function(_0x40b6e4,_0x3a6ab7){return _0x40b6e4(_0x3a6ab7);},'XKUdT':_0x3d60f4(0x14c)};if(!_0x3c7525){const _0x112d61=await _0x4c3fd7[_0x3d60f4(0x1ad)](getToken);if(_0x112d61){const _0x5bcf92=await getCurrentUser(_0x112d61);if(_0x5bcf92[_0x3d60f4(0x1bb)])return console[_0x3d60f4(0x15f)]('✓\x20Already\x20authenticated\x20to\x20'+_0x5bcf92['user']['organizationName']),{'token':_0x112d61,'method':'existing_token'};}try{_0x3c7525=await _0x4c3fd7[_0x3d60f4(0x17e)](runDeviceAuthFlow);}catch(_0x176567){throw new Error(_0x3d60f4(0x155)+(_0x4c3fd7[_0x3d60f4(0x1a1)](_0x176567,Error)?_0x176567['message']:_0x176567));}const _0x5910df=await getCurrentUser(_0x3c7525);if(!_0x5910df[_0x3d60f4(0x1bb)])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x5910df[_0x3d60f4(0x153)]);return console[_0x3d60f4(0x15f)]('✓\x20Authenticated\x20to\x20'+_0x5910df['user'][_0x3d60f4(0x174)]),{'token':_0x3c7525,'method':_0x3d60f4(0x1a5)};}console[_0x3d60f4(0x15f)](_0x3d60f4(0x196));const _0x422c39=await getCurrentUser(_0x3c7525);if(!_0x422c39[_0x3d60f4(0x1bb)]){if(_0x422c39['status'])throw new Error(_0x3d60f4(0x155)+_0x422c39[_0x3d60f4(0x153)]+_0x3d60f4(0x187));else throw new Error(_0x3d60f4(0x198)+_0x422c39['error']+_0x3d60f4(0x164));}return console[_0x3d60f4(0x15f)](_0x3d60f4(0x19a)+_0x422c39['user'][_0x3d60f4(0x174)]),await _0x4c3fd7[_0x3d60f4(0x165)](storeToken,_0x3c7525),console['log'](process[_0x3d60f4(0x1a4)][_0x3d60f4(0x169)]?_0x4c3fd7['XKUdT']:_0x3d60f4(0x1a3)),{'token':_0x3c7525,'method':'provided_token'};}export async function ensureRangerDir(_0x29c8c1){const _0x4925e7=_0x640448,_0xbda11b={'WYwLf':function(_0x42df84,_0x5aa695){return _0x42df84===_0x5aa695;},'NSQWh':_0x4925e7(0x18e),'uUXwZ':_0x4925e7(0x18f),'tGyVZ':function(_0x38d654,_0x27e02b,_0x2df94b){return _0x38d654(_0x27e02b,_0x2df94b);}};let _0x44a53c;const _0x32e736=_0xbda11b['WYwLf'](_0x29c8c1,'user')?'~/.ranger/':_0xbda11b['NSQWh'];if(_0x29c8c1===_0xbda11b['uUXwZ'])_0x44a53c=getRangerHomeDir();else{const _0x10afa7=findGitRoot();_0x44a53c=_0x10afa7?_0xbda11b['tGyVZ'](join,_0x10afa7,_0x4925e7(0x192)):getRangerDir();}return!existsSync(_0x44a53c)?(await mkdir(_0x44a53c,{'recursive':!![]}),console['log'](_0x4925e7(0x1b6)+_0x32e736+'\x20directory'),{'path':_0x44a53c,'installed':!![]}):(console['log']('✓\x20'+_0x32e736+'\x20directory\x20already\x20exists'),{'path':_0x44a53c,'installed':![]});}export async function ensureChromium(_0x157e2e=![]){const _0x2a0efc=_0x640448,_0xc9a2b7={'xhSyJ':'✓\x20Playwright\x20Chromium\x20browser\x20found','gHyRn':function(_0x3cd4c6,_0x6d801a){return _0x3cd4c6??_0x6d801a;},'aSbzM':_0x2a0efc(0x1af),'McIxO':function(_0x1524ae,_0x146ee6,_0x51daeb){return _0x1524ae(_0x146ee6,_0x51daeb);}};let _0x489b02=![];try{const _0x5b7e26=chromium[_0x2a0efc(0x180)]();_0x489b02=existsSync(_0x5b7e26);}catch{_0x489b02=![];}if(_0x489b02)return console[_0x2a0efc(0x15f)](_0xc9a2b7['xhSyJ']),![];const _0x3f9f48=getPlaywrightVersion(),_0x525d16=_0xc9a2b7[_0x2a0efc(0x1ba)](_0x3f9f48,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x43e619=!_0x3f9f48,_0x47ef84=process[_0x2a0efc(0x160)]['isTTY']&&process[_0x2a0efc(0x178)]['isTTY'];let _0xd905e8=!![];if(_0x47ef84){const {install:_0x1783bb}=await _0x49e381[_0x2a0efc(0x16e)]([{'type':_0x2a0efc(0x152),'name':'install','message':_0x43e619?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x525d16+'\x20now?':'The\x20required\x20version\x20('+_0x525d16+_0x2a0efc(0x15a),'default':!![]}]);_0xd905e8=_0x1783bb;}else console[_0x2a0efc(0x15f)](_0x2a0efc(0x14e)+_0x525d16+(_0x43e619?_0xc9a2b7['aSbzM']:'')+_0x2a0efc(0x197));if(_0xd905e8){console['log']('\x0aInstalling\x20Chromium\x20browser...\x0a');try{await _0xc9a2b7['McIxO'](installChromiumBinary,_0x525d16,_0x157e2e),console['log']('\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully');}catch(_0x41c6f1){console[_0x2a0efc(0x153)]('\x0a❌\x20Failed\x20to\x20install\x20Chromium:',_0x41c6f1 instanceof Error?_0x41c6f1[_0x2a0efc(0x1b5)]:_0x41c6f1),console[_0x2a0efc(0x15f)](_0x2a0efc(0x19c)),console['log']('\x20\x20npx\x20playwright@'+_0x525d16+'\x20install\x20chromium');}}else console[_0x2a0efc(0x15f)](_0x2a0efc(0x1a8)),console[_0x2a0efc(0x15f)](_0x2a0efc(0x1b7)),console['log'](_0x2a0efc(0x15b)+_0x525d16+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x3853e3){const _0x4af62c=_0x640448,_0x44236e={'QsVwL':function(_0xa704a5,_0x2d08e3,_0x525ca0){return _0xa704a5(_0x2d08e3,_0x525ca0);}},_0x59501c=_0x44236e['QsVwL'](join,_0x3853e3,_0x4af62c(0x199)),_0x2734e9=_0x4af62c(0x175);await writeFile(_0x59501c,_0x2734e9),console['log'](_0x4af62c(0x18d));}export async function ensureLocalEnv(_0x579600,_0x4163f2){const _0x14e5e1=_0x640448,_0x579e2d={'eyzBi':function(_0x356603){return _0x356603();},'qkmur':function(_0x5de62c,_0x367902){return _0x5de62c!==_0x367902;},'QEjtB':'user','XvShz':_0x14e5e1(0x157),'DioGy':function(_0x258576,_0x4ec3d5){return _0x258576===_0x4ec3d5;},'vbUyC':_0x14e5e1(0x16b),'oPnOj':'✓\x20Local\x20profile\x20already\x20exists'};if(!_0x579e2d['eyzBi'](findGitRoot)&&_0x579e2d['qkmur'](_0x579600?.['scope'],_0x579e2d[_0x14e5e1(0x168)]))return console[_0x14e5e1(0x15f)](_0x579e2d[_0x14e5e1(0x1b0)]),{'ready':![],'skipped':!![]};const _0x425c36=_0x579e2d[_0x14e5e1(0x16a)](_0x579600?.['scope'],_0x579e2d['QEjtB'])?getRangerHomeDir():undefined;if(findExistingEnv(_0x579e2d[_0x14e5e1(0x1ac)],{'locations':[_0x579e2d['vbUyC']],'rangerDir':_0x425c36}))return console[_0x14e5e1(0x15f)](_0x579e2d['oPnOj']),{'ready':!![],'skipped':![]};try{return await addEnv('local',{'url':_0x579600?.[_0x14e5e1(0x173)],'force':_0x579600?.[_0x14e5e1(0x1ab)],'allowInsecureLocalhost':_0x579600?.['allowInsecureLocalhost'],'scope':_0x579600?.[_0x14e5e1(0x177)]},_0x4163f2),{'ready':!![],'skipped':![]};}catch(_0x1035cd){return console[_0x14e5e1(0x153)]('\x0a❌\x20Profile\x20setup\x20failed:',_0x1035cd instanceof Error?_0x1035cd['message']:_0x1035cd),{'ready':![],'skipped':![]};}}export async function start(_0x49dca3,_0x139fb9,_0x326e56){const _0x17330e=_0x640448,_0x21353a={'LqTYB':'user','nctOm':function(_0x5f43af){return _0x5f43af();},'qgNvg':_0x17330e(0x1a0),'xKPRC':_0x17330e(0x1a7),'FiScT':_0x17330e(0x1b3),'OkjSJ':function(_0x4f7ebc,_0x39db17){return _0x4f7ebc(_0x39db17);},'DlKhs':'✓\x20Skipping\x20authentication\x20(--skip-auth)','coePI':_0x17330e(0x14d),'oASFQ':'chromium','hlQya':'\x0a✅\x20Ranger\x20setup\x20complete!\x0a','zsXTF':_0x17330e(0x16f),'Ykpuc':_0x17330e(0x183),'HnBUW':function(_0x350f75,_0x5a99ab,_0x4c0482){return _0x350f75(_0x5a99ab,_0x4c0482);},'mjgpk':_0x17330e(0x151),'TOMVt':function(_0x2007b9){return _0x2007b9();},'jzAHS':function(_0x3d1f97,_0x9ba2ed){return _0x3d1f97 instanceof _0x9ba2ed;},'DZrhO':function(_0x2f7ff6,_0x1d6ac9){return _0x2f7ff6(_0x1d6ac9);},'zbSME':_0x17330e(0x186),'DPQUv':_0x17330e(0x1b4),'hWThB':function(_0x4cf20d,_0x3dc3b6){return _0x4cf20d(_0x3dc3b6);},'OFNhj':_0x17330e(0x167),'diaDD':function(_0x1d856c,_0x566fd1){return _0x1d856c+_0x566fd1;}};console['log'](_0x17330e(0x194));const _0x1ba01d=process['stdin']['isTTY']&&process['stdout']['isTTY'];!_0x139fb9?.['scope']&&(_0x139fb9={..._0x139fb9,'scope':_0x21353a[_0x17330e(0x195)]});const _0xa462c4=_0x139fb9?.['scope']==='user';_0x326e56?.['trackPhaseStart']('git_check');if(!_0xa462c4&&!_0x21353a[_0x17330e(0x1a9)](findGitRoot)){await _0x326e56?.[_0x17330e(0x17b)](_0x21353a['qgNvg'],new Error(_0x21353a['xKPRC']));throw new Error(_0x21353a[_0x17330e(0x1a2)]);}_0x326e56?.[_0x17330e(0x17d)](_0x21353a[_0x17330e(0x159)]);const _0x580854=_0xa462c4?!_0x21353a['OkjSJ'](existsSync,getRangerHomeDir()):!_0x21353a[_0x17330e(0x179)](existsSync,_0x21353a['nctOm'](getRangerDir)),{path:_0x21ec29}=await ensureRangerDir(_0xa462c4?_0x21353a[_0x17330e(0x195)]:undefined);if(_0x139fb9?.['skipAuth'])console[_0x17330e(0x15f)](_0x21353a[_0x17330e(0x176)]),_0x326e56?.[_0x17330e(0x17d)](_0x21353a[_0x17330e(0x166)],{'isFirstRun':_0x580854,'method':_0x17330e(0x150)});else{_0x326e56?.[_0x17330e(0x18c)](_0x17330e(0x14d));const _0x459cd9=await authenticate(_0x49dca3);_0x326e56?.[_0x17330e(0x17d)]('auth',{'isFirstRun':_0x580854,'method':_0x459cd9['method']});}_0x326e56?.[_0x17330e(0x18c)](_0x21353a[_0x17330e(0x1b1)]);_0x139fb9?.[_0x17330e(0x171)]?console[_0x17330e(0x15f)]('✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)'):await _0x21353a[_0x17330e(0x179)](ensureChromium,_0x139fb9?.[_0x17330e(0x163)]);_0x326e56?.['trackPhaseEnd'](_0x21353a['oASFQ'],{'isFirstRun':_0x580854,'skipped':!!_0x139fb9?.[_0x17330e(0x171)]});!_0xa462c4&&await writeRangerGitignore(_0x21ec29);console[_0x17330e(0x15f)](_0x21353a[_0x17330e(0x170)]);const _0x4249b2=_0x139fb9?.['scope'],_0x18587b=_0x139fb9?.['opencode']??![];let _0x51cdba=null;_0x18587b?(_0x326e56?.['trackPhaseStart'](_0x21353a['zsXTF']),_0x51cdba=await ensureOpencodePluginConfig(_0x4249b2),_0x326e56?.[_0x17330e(0x17d)]('plugin',{'isFirstRun':_0x580854,'opencode':!![]})):(_0x326e56?.['trackPhaseStart'](_0x17330e(0x16f)),await ensureClaudePlugin(_0x4249b2),_0x326e56?.['trackPhaseEnd'](_0x17330e(0x16f),{'isFirstRun':_0x580854}));if(_0x18587b&&_0x51cdba){_0x326e56?.['trackPhaseStart'](_0x21353a['Ykpuc']);try{await _0x21353a['HnBUW'](installSkill,_0x21353a['mjgpk'],{'level':_0x51cdba[_0x17330e(0x177)],'cliVersion':_0x21353a['TOMVt'](getCurrentVersion),'platform':'opencode'}),_0x326e56?.[_0x17330e(0x17d)](_0x17330e(0x183),{'isFirstRun':_0x580854,'opencode':!![]});}catch(_0x45aac1){console['warn'](_0x17330e(0x156),_0x21353a['jzAHS'](_0x45aac1,Error)?_0x45aac1['message']:_0x45aac1),_0x326e56?.[_0x17330e(0x17d)](_0x17330e(0x183),{'isFirstRun':_0x580854,'opencode':!![],'failed':!![]});}}else _0x326e56?.[_0x17330e(0x18c)](_0x21353a['Ykpuc']),await ensureClaudeSkills(_0x4249b2),_0x326e56?.[_0x17330e(0x17d)](_0x21353a[_0x17330e(0x16c)],{'isFirstRun':_0x580854});if(_0x139fb9?.[_0x17330e(0x18a)])console[_0x17330e(0x15f)](_0x17330e(0x14a));else{if(_0x139fb9?.[_0x17330e(0x173)]){_0x326e56?.[_0x17330e(0x18c)](_0x17330e(0x161));const _0x543a2d=await ensureLocalEnv({'url':_0x139fb9[_0x17330e(0x173)],'force':_0x139fb9?.[_0x17330e(0x1ab)],'allowInsecureLocalhost':_0x139fb9?.[_0x17330e(0x14b)],'scope':_0x139fb9?.['scope']==='user'?_0x21353a['LqTYB']:undefined},_0x326e56);_0x326e56?.['trackPhaseEnd'](_0x17330e(0x161),{'isFirstRun':_0x580854,'profileReady':_0x543a2d[_0x17330e(0x184)],'userSkipped':_0x543a2d['skipped']});}else console[_0x17330e(0x15f)]('\x0aTo\x20verify\x20with\x20a\x20browser:\x20set\x20'+_0x21353a[_0x17330e(0x188)](bold,_0x21353a[_0x17330e(0x191)])+'\x20and\x20'+_0x21353a['OkjSJ'](bold,'RANGER_TEST_PASSWORD')),console[_0x17330e(0x15f)](_0x17330e(0x14f)+_0x21353a['OkjSJ'](bold,_0x17330e(0x16d))+_0x17330e(0x19b));}if(_0x18587b)console['log'](_0x21353a[_0x17330e(0x1b8)]),console[_0x17330e(0x15f)]('and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review'),console['log'](_0x17330e(0x154)),console[_0x17330e(0x15f)](_0x17330e(0x19e));else{const _0x5616ab=_0x21353a['hWThB'](bold,_0x21353a['OFNhj']);console['log'](_0x21353a[_0x17330e(0x18b)](_0x21353a['diaDD']('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x5616ab+_0x17330e(0x1b9)+'\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'),'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.'));}}
|
package/build/commands/status.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x2a1597=_0x12ea;(function(_0x4ca14a,_0x4ba73e){const _0xbcc9c7=_0x12ea,_0x14275e=_0x4ca14a();while(!![]){try{const _0x5d2e29=parseInt(_0xbcc9c7(0x137))/0x1+-parseInt(_0xbcc9c7(0x11d))/0x2*(parseInt(_0xbcc9c7(0x110))/0x3)+parseInt(_0xbcc9c7(0x11c))/0x4*(-parseInt(_0xbcc9c7(0x158))/0x5)+parseInt(_0xbcc9c7(0x13b))/0x6*(-parseInt(_0xbcc9c7(0x169))/0x7)+parseInt(_0xbcc9c7(0x113))/0x8*(-parseInt(_0xbcc9c7(0x15c))/0x9)+parseInt(_0xbcc9c7(0x11e))/0xa*(-parseInt(_0xbcc9c7(0x16b))/0xb)+parseInt(_0xbcc9c7(0x12a))/0xc;if(_0x5d2e29===_0x4ba73e)break;else _0x14275e['push'](_0x14275e['shift']());}catch(_0x57f3c9){_0x14275e['push'](_0x14275e['shift']());}}}(_0x26e9,0xa4645));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=_0x59a4ad=>'\x1b[1m'+_0x59a4ad+_0x2a1597(0x15f),link=(_0x29b35d,_0x408e72)=>_0x2a1597(0x150)+_0x29b35d+'\x07'+(_0x408e72||_0x29b35d)+_0x2a1597(0x13f);async function getOpencodePluginStatus(){const _0x31b6bf=_0x2a1597,_0x18acd9={'xMeLw':function(_0x388083,_0x476a88){return _0x388083(_0x476a88);},'unMvH':function(_0x250961,_0x40cf30){return _0x250961!==_0x40cf30;},'fuRFk':_0x31b6bf(0x135),'szyxb':'debug','YEvbi':'pipe','hpQeR':'data','rPrMd':_0x31b6bf(0x161)};return new Promise(_0x49a83d=>{const _0x34b9b9=_0x31b6bf,_0x237a4a={'miblw':function(_0x5f2de6,_0x42548d){return _0x5f2de6!==_0x42548d;},'IgyrN':_0x34b9b9(0x106),'wDAZZ':'@ranger-testing/opencode-plugin','MQeQu':function(_0x263128,_0x4d338c){return _0x18acd9['unMvH'](_0x263128,_0x4d338c);},'zDMxv':_0x34b9b9(0x10e),'MycgW':function(_0x50fd8e,_0x2684f0){const _0x404e2d=_0x34b9b9;return _0x18acd9[_0x404e2d(0x143)](_0x50fd8e,_0x2684f0);},'SOJPp':_0x34b9b9(0x104)},_0x4ea029=spawn(_0x18acd9['fuRFk'],[_0x18acd9['szyxb'],'config'],{'stdio':[_0x34b9b9(0x139),_0x18acd9['YEvbi'],_0x18acd9['YEvbi']]});let _0x31b6b3='';_0x4ea029['stdout']?.['on'](_0x18acd9['hpQeR'],_0x1f2ad1=>{const _0x77c11e=_0x34b9b9;_0x31b6b3+=_0x1f2ad1[_0x77c11e(0x144)]();}),_0x4ea029['stderr']?.['on']('data',_0x22653e=>{_0x31b6b3+=_0x22653e['toString']();}),_0x4ea029['on'](_0x34b9b9(0x132),()=>{const _0x14a71d=_0x34b9b9;_0x18acd9['xMeLw'](_0x49a83d,{'status':_0x14a71d(0x14f)});}),_0x4ea029['on'](_0x18acd9[_0x34b9b9(0x105)],_0x3981f5=>{const _0x3244a1=_0x34b9b9;if(_0x237a4a['MQeQu'](_0x3981f5,0x0)){_0x49a83d({'status':_0x3244a1(0x14f)});return;}const _0x50bd95=_0x31b6b3['trim']();let _0x422111=null;if(_0x50bd95)try{_0x422111=JSON[_0x3244a1(0x159)](_0x50bd95);}catch{const _0x2d72af=_0x50bd95[_0x3244a1(0x127)](/\{[\s\S]*\}$/);if(_0x2d72af)try{_0x422111=JSON[_0x3244a1(0x159)](_0x2d72af[0x0]);}catch{_0x422111=null;}}const _0x5f46a9=Array['isArray'](_0x422111?.[_0x3244a1(0x126)])?_0x422111?.['plugin']:[],_0x5db55e=_0x5f46a9['some'](_0x4e0362=>{const _0xf217eb=_0x3244a1;if(_0x237a4a[_0xf217eb(0x103)](typeof _0x4e0362,_0x237a4a['IgyrN']))return![];return _0x4e0362['includes'](_0x237a4a['wDAZZ'])||_0x4e0362[_0xf217eb(0x124)]('opencode-plugin');});if(_0x5db55e){_0x49a83d({'status':_0x237a4a['zDMxv'],'details':_0x5f46a9['length']>0x0?_0x5f46a9['length']+_0x3244a1(0x160):undefined});return;}if(_0x5f46a9[_0x3244a1(0x121)]>0x0){_0x237a4a[_0x3244a1(0x15e)](_0x49a83d,{'status':_0x237a4a['SOJPp'],'details':_0x5f46a9['length']+'\x20plugin(s)\x20configured'});return;}_0x49a83d({'status':_0x237a4a['SOJPp']});});});}function _0x12ea(_0xe46a58,_0x5c1126){_0xe46a58=_0xe46a58-0x103;const _0x26e950=_0x26e9();let _0x12eae7=_0x26e950[_0xe46a58];return _0x12eae7;}async function getSkillsFromDir(_0x8758ec,_0x1800f0){const _0x189389=_0x2a1597,_0x520d22={'jtMrm':function(_0x286597,_0x352227){return _0x286597(_0x352227);},'QvouC':function(_0x21e2dc,_0x397e0c,_0x5c997b){return _0x21e2dc(_0x397e0c,_0x5c997b);},'Rccdb':function(_0x185ead,_0x52733a,_0x1ab396,_0x2e504a){return _0x185ead(_0x52733a,_0x1ab396,_0x2e504a);},'MCZUK':function(_0x191f58,_0x2240b0){return _0x191f58(_0x2240b0);},'YZmIv':_0x189389(0x123)};if(!_0x520d22[_0x189389(0x162)](existsSync,_0x8758ec))return[];const _0x56b423=[];try{const _0x44b2ca=await _0x520d22['QvouC'](readdir,_0x8758ec,{'withFileTypes':!![]});for(const _0x4971d1 of _0x44b2ca){if(_0x4971d1[_0x189389(0x112)]()){const _0x3aef69=_0x520d22[_0x189389(0x12d)](join,_0x8758ec,_0x4971d1[_0x189389(0x109)],'SKILL.md');if(_0x520d22['MCZUK'](existsSync,_0x3aef69)){let _0x1359a6=_0x4971d1['name'];try{const _0x414721=await readFile(_0x3aef69,_0x520d22['YZmIv']),_0x5a6b58=_0x414721[_0x189389(0x127)](/name:\s*(.+)/);_0x5a6b58&&(_0x1359a6=_0x5a6b58[0x1][_0x189389(0x12b)]());}catch{}_0x56b423['push']({'name':_0x4971d1[_0x189389(0x109)],'displayName':_0x1359a6,'path':_0x3aef69,'level':_0x1800f0});}}}}catch{return[];}return _0x56b423;}function _0x26e9(){const _0x4d3099=['length','cGwFg','utf-8','includes','pieiZ','plugin','match','Zmyab','Version:\x20','34288176TlGNPP','trim','ranger@trailhead','Rccdb','\x20\x20Not\x20installed','No\x20skills\x20installed','enabled','ViSfZ','error','\x20\x20Run:\x20ranger\x20update','\x0a📊\x20Ranger\x20Status\x0a','opencode','\x20\x20User-level:','653287wyDNyy','jDcbS','ignore','organizationName','1069092WvgIbv','\x20\x20\x20\x20','map','auth.json','\x1b]8;;\x07','API\x20Environment:\x20','nBfxL','\x20(active)','xMeLw','toString','version','Root:\x20','XUefW','scope','\x20\x20Run:\x20ranger\x20setup\x20--opencode','\x20\x20Project-level:','cwd','No\x20profiles\x20configured','\x0a---\x20Profiles\x20---','(not\x20found)','not_installed','\x1b]8;;file://','settingsPath','MalRE','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','\x0a\x20\x20No\x20active\x20profile\x20set','none','VCLcL','API\x20URL:\x20','3735ukussJ','parse','sXavz','unknown','9IioGXt',':\x20configured','MycgW','\x1b[0m','\x20plugin(s)\x20configured','close','jtMrm','\x20(latest:\x20','encrypted','user','nRAwc','fkGiB','displayName','21qMfXXf','success','22tKQkso','ELlJM','vDivX','\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','details','miblw','not_configured','rPrMd','string','VZYMz','project','name','\x20\x20Run:\x20ranger\x20setup\x20[token]','qCxPk','log','path','configured','disabled','1459866Clayru','\x0a---\x20Claude\x20Code\x20Plugin\x20---','isDirectory','8373856FInaIG','YKgZV','Organization:\x20','sVAHZ',':\x20installed\x20(','status','Vbbuw','env','XoNQg','344FvkHPo','4RNAYZB','1092610ONyjPx','RouSb','settings.json'];_0x26e9=function(){return _0x4d3099;};return _0x26e9();}async function getInstalledSkills(){const _0x113c2a=_0x2a1597,_0x3373a6={'cGwFg':function(_0x3d422b,_0x21f38d,_0x432216){return _0x3d422b(_0x21f38d,_0x432216);},'wjwYw':function(_0x3dffff){return _0x3dffff();},'vDivX':function(_0x43bafc,_0x45b31b,_0x237a72){return _0x43bafc(_0x45b31b,_0x237a72);},'YKgZV':_0x113c2a(0x165)},[_0xd4e8d4,_0x26e594]=await Promise['all']([_0x3373a6[_0x113c2a(0x122)](getSkillsFromDir,_0x3373a6['wjwYw'](getProjectSkillsDir),_0x113c2a(0x108)),_0x3373a6[_0x113c2a(0x16d)](getSkillsFromDir,_0x3373a6['wjwYw'](getUserSkillsDir),_0x3373a6[_0x113c2a(0x114)])]);return{'project':_0xd4e8d4,'user':_0x26e594};}async function getEnvironments(){const _0x42fdd9=_0x2a1597,_0xd7449={'jQRFS':function(_0x363325,_0x1656c8,_0x20f74d){return _0x363325(_0x1656c8,_0x20f74d);},'VZYMz':function(_0x1dc01a,_0x15a0ca,_0x205579){return _0x1dc01a(_0x15a0ca,_0x205579);},'Vbbuw':'auth.json.enc','ATeXn':function(_0x3c79e3,_0x238d62){return _0x3c79e3(_0x238d62);},'MoKZL':function(_0x797b70){return _0x797b70();},'Rkklr':function(_0x4f0a5){return _0x4f0a5();}},{envNames:_0x24c2a9,activeEnv:_0x381cb6}=await _0xd7449['MoKZL'](getEnvNames),_0x21abf7=_0xd7449['Rkklr'](getRangerDir);if(!existsSync(_0x21abf7))return{'envs':[],'activeEnv':null};const _0xd3e823=_0x24c2a9[_0x42fdd9(0x13d)](_0x1aee6c=>{const _0x4c5667=_0x42fdd9,_0x5dab03=getEnvDir(_0x1aee6c),_0x3fea4d=join(_0x5dab03,_0x4c5667(0x120)),_0x2b15fe=_0xd7449['jQRFS'](join,_0x5dab03,_0x4c5667(0x13e)),_0x500d42=_0xd7449[_0x4c5667(0x107)](join,_0x5dab03,_0xd7449[_0x4c5667(0x119)]);return{'name':_0x1aee6c,'settingsPath':existsSync(_0x3fea4d)?_0x3fea4d:_0x4c5667(0x14e),'hasPlaintextAuth':_0xd7449['ATeXn'](existsSync,_0x2b15fe),'hasEncryptedAuth':existsSync(_0x500d42),'isActive':_0x1aee6c===_0x381cb6};});return{'envs':_0xd3e823,'activeEnv':_0x381cb6};}export async function status(){const _0x1c0d04=_0x2a1597,_0x24d625={'baYEJ':_0x1c0d04(0x134),'JLWaq':function(_0x5deb15){return _0x5deb15();},'Zmyab':function(_0x48a7ec,_0x4db69f){return _0x48a7ec(_0x4db69f);},'pieiZ':function(_0x27840d,_0x1e6a50){return _0x27840d(_0x1e6a50);},'fkGiB':function(_0x4f99f1){return _0x4f99f1();},'sVAHZ':function(_0x1ba759,_0x281a17){return _0x1ba759!==_0x281a17;},'nRAwc':function(_0x2bbb95){return _0x2bbb95();},'UBICp':function(_0x241280,_0x496b4b){return _0x241280===_0x496b4b;},'qCxPk':_0x1c0d04(0x10e),'sXavz':_0x1c0d04(0x104),'RouSb':_0x1c0d04(0x149),'jDcbS':_0x1c0d04(0x16e),'xfrNe':_0x1c0d04(0x15b),'VCLcL':'enabled','WJGPG':_0x1c0d04(0x10f),'MalRE':'ranger@trailhead','UpQzP':_0x1c0d04(0x12e),'QxAhb':'\x0a---\x20Skills\x20---','KvkFu':function(_0x5d1534,_0x7b276b){return _0x5d1534===_0x7b276b;},'YpcVn':_0x1c0d04(0x12f),'XoNQg':function(_0x58dea5,_0x4239ea){return _0x58dea5>_0x4239ea;},'ZmSbn':function(_0x415800,_0x3a5cb1,_0x68c8ed){return _0x415800(_0x3a5cb1,_0x68c8ed);},'ViSfZ':function(_0x3267b5,_0x5f0c40,_0x279b63){return _0x3267b5(_0x5f0c40,_0x279b63);},'mepvQ':_0x1c0d04(0x14d),'mtdYg':_0x1c0d04(0x14c),'XUefW':_0x1c0d04(0x142),'ELlJM':_0x1c0d04(0x164),'nBfxL':'plaintext','NGvzO':_0x1c0d04(0x155),'EhcIZ':_0x1c0d04(0x14e),'VlDYu':function(_0x1888e1,_0x3bd142,_0x448466){return _0x1888e1(_0x3bd142,_0x448466);}};console[_0x1c0d04(0x10c)](_0x24d625['baYEJ']);const _0x5c2b16=process[_0x1c0d04(0x14b)](),_0x589d17=_0x24d625['JLWaq'](getRangerDir);if(!_0x24d625['Zmyab'](existsSync,_0x589d17)){console['log'](_0x1c0d04(0x146)+link(_0x5c2b16,bold(_0x24d625[_0x1c0d04(0x128)](basename,_0x5c2b16)))),console[_0x1c0d04(0x10c)]('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console[_0x1c0d04(0x10c)]('Root:\x20'+link(_0x5c2b16,bold(_0x24d625['pieiZ'](basename,_0x5c2b16))));const _0x1eb9bc=getCurrentVersion(),_0x1c0821=_0x24d625[_0x1c0d04(0x167)](getLatestVersion);if(_0x1c0821[_0x1c0d04(0x145)]&&_0x24d625[_0x1c0d04(0x116)](_0x1c0821['version'],_0x1eb9bc))console[_0x1c0d04(0x10c)](_0x1c0d04(0x129)+_0x1eb9bc+_0x1c0d04(0x163)+_0x1c0821[_0x1c0d04(0x145)]+')'),console['log'](_0x1c0d04(0x133));else _0x1c0821[_0x1c0d04(0x145)]?console[_0x1c0d04(0x10c)]('Version:\x20'+_0x1eb9bc+'\x20(up\x20to\x20date)'):console[_0x1c0d04(0x10c)](_0x1c0d04(0x129)+_0x1eb9bc);const _0x3e5224=await getToken();if(_0x3e5224){const _0x4af6c9=await _0x24d625[_0x1c0d04(0x125)](getCurrentUser,_0x3e5224);_0x4af6c9[_0x1c0d04(0x16a)]?console['log'](_0x1c0d04(0x115)+bold(_0x4af6c9['user'][_0x1c0d04(0x13a)])):(console[_0x1c0d04(0x10c)]('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console['log'](_0x1c0d04(0x10a)));}else console['log']('API\x20Token:\x20✗\x20Not\x20found'),console['log'](_0x1c0d04(0x10a));process[_0x1c0d04(0x11a)]['DEBUG']&&(console['log'](_0x1c0d04(0x140)+getCurrentEnvironment()),console[_0x1c0d04(0x10c)](_0x1c0d04(0x157)+_0x24d625[_0x1c0d04(0x166)](getApiBaseUrl)));console['log']('\x0a---\x20OpenCode\x20Plugin\x20---');const _0x3ba5c1=await getOpencodePluginStatus();if(_0x24d625['UBICp'](_0x3ba5c1[_0x1c0d04(0x118)],_0x24d625[_0x1c0d04(0x10b)]))console['log']('\x20\x20'+bold('@ranger-testing/opencode-plugin')+_0x1c0d04(0x15d)),_0x3ba5c1['details']&&console['log']('\x20\x20'+_0x3ba5c1[_0x1c0d04(0x16f)]);else _0x3ba5c1[_0x1c0d04(0x118)]===_0x24d625[_0x1c0d04(0x15a)]?(console[_0x1c0d04(0x10c)]('\x20\x20Not\x20configured'),_0x3ba5c1[_0x1c0d04(0x16f)]&&console['log']('\x20\x20'+_0x3ba5c1[_0x1c0d04(0x16f)]),console['log'](_0x24d625[_0x1c0d04(0x11f)])):console[_0x1c0d04(0x10c)](_0x24d625[_0x1c0d04(0x138)]);console[_0x1c0d04(0x10c)](_0x1c0d04(0x111));const _0x5ef667=await getPluginInfo(_0x1c0d04(0x12c));if(_0x5ef667){const _0xa2c460=_0x5ef667[_0x1c0d04(0x148)]||_0x24d625['xfrNe'],_0x529ca8=_0x5ef667[_0x1c0d04(0x130)]?_0x24d625[_0x1c0d04(0x156)]:_0x24d625['WJGPG'];console[_0x1c0d04(0x10c)]('\x20\x20'+bold(_0x24d625[_0x1c0d04(0x152)])+_0x1c0d04(0x117)+_0xa2c460+',\x20'+_0x529ca8+')');}else console['log'](_0x24d625['UpQzP']),console['log'](_0x1c0d04(0x153));console['log'](_0x24d625['QxAhb']);const {project:_0xfe70d8,user:_0x16837a}=await getInstalledSkills(),_0x5891bb=_0xfe70d8['filter'](_0x827500=>RANGER_MANAGED_SKILLS[_0x1c0d04(0x124)](_0x827500['name'])),_0x1db56b=_0x16837a['filter'](_0x5262e7=>RANGER_MANAGED_SKILLS['includes'](_0x5262e7['name'])),_0x1a2cea=_0x5891bb['length']+_0x1db56b[_0x1c0d04(0x121)];if(_0x24d625['KvkFu'](_0x1a2cea,0x0))console['log'](_0x24d625['YpcVn']),console[_0x1c0d04(0x10c)]('\x20\x20Run:\x20ranger\x20skillup');else{if(_0x24d625[_0x1c0d04(0x11b)](_0x5891bb['length'],0x0)){console['log'](_0x1c0d04(0x14a));for(const _0x378ea8 of _0x5891bb){console['log']('\x20\x20\x20\x20'+bold(_0x378ea8['displayName'])+':\x20'+_0x24d625['ZmSbn'](link,_0x378ea8['path'],basename(_0x378ea8[_0x1c0d04(0x10d)])));}}if(_0x24d625[_0x1c0d04(0x11b)](_0x1db56b[_0x1c0d04(0x121)],0x0)){console[_0x1c0d04(0x10c)](_0x1c0d04(0x136));for(const _0xc63285 of _0x1db56b){console['log'](_0x1c0d04(0x13c)+bold(_0xc63285[_0x1c0d04(0x168)])+':\x20'+_0x24d625[_0x1c0d04(0x131)](link,_0xc63285[_0x1c0d04(0x10d)],basename(_0xc63285['path'])));}}}console[_0x1c0d04(0x10c)](_0x24d625['mepvQ']);const {envs:_0x560759,activeEnv:_0x516c4a}=await getEnvironments();if(_0x560759['length']===0x0)console['log'](_0x24d625['mtdYg']),console[_0x1c0d04(0x10c)]('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{for(const _0x43f724 of _0x560759){const _0x2d093c=_0x43f724['isActive']?_0x24d625[_0x1c0d04(0x147)]:'',_0x1bcec7=_0x43f724['hasEncryptedAuth']?_0x24d625[_0x1c0d04(0x16c)]:_0x43f724['hasPlaintextAuth']?_0x24d625[_0x1c0d04(0x141)]:_0x24d625['NGvzO'];console['log']('\x20\x20'+_0x24d625['Zmyab'](bold,_0x43f724[_0x1c0d04(0x109)])+_0x2d093c),console[_0x1c0d04(0x10c)]('\x20\x20\x20\x20Auth:\x20'+_0x1bcec7),_0x43f724[_0x1c0d04(0x151)]!==_0x24d625['EhcIZ']&&console[_0x1c0d04(0x10c)]('\x20\x20\x20\x20Settings:\x20'+_0x24d625['VlDYu'](link,_0x43f724['settingsPath'],_0x24d625['Zmyab'](basename,_0x43f724['settingsPath'])));}!_0x516c4a&&(console['log'](_0x1c0d04(0x154)),console[_0x1c0d04(0x10c)]('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x560759[_0x1c0d04(0x13d)](_0x2270fb=>_0x2270fb[_0x1c0d04(0x109)])['join'](',\x20')+')'));}console['log']('');}
|
|
1
|
+
const _0x33d84d=_0x3d95;(function(_0x27f7af,_0x601ae1){const _0x4b9826=_0x3d95,_0x16a850=_0x27f7af();while(!![]){try{const _0x49455a=-parseInt(_0x4b9826(0x147))/0x1+parseInt(_0x4b9826(0x13c))/0x2+-parseInt(_0x4b9826(0x148))/0x3*(parseInt(_0x4b9826(0x189))/0x4)+-parseInt(_0x4b9826(0x181))/0x5*(parseInt(_0x4b9826(0x188))/0x6)+parseInt(_0x4b9826(0x167))/0x7*(-parseInt(_0x4b9826(0x18e))/0x8)+parseInt(_0x4b9826(0x169))/0x9*(parseInt(_0x4b9826(0x16c))/0xa)+parseInt(_0x4b9826(0x195))/0xb*(parseInt(_0x4b9826(0x15d))/0xc);if(_0x49455a===_0x601ae1)break;else _0x16a850['push'](_0x16a850['shift']());}catch(_0x861ece){_0x16a850['push'](_0x16a850['shift']());}}}(_0x1e15,0xbe53e));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';function _0x1e15(){const _0xeb4a10=['ptCZg','\x1b[0m','\x20\x20\x20\x20','358127QkLRUg','23883eKIOTo','VwXPk','\x0a---\x20Skills\x20---','vnmmL','all','includes','opencode-plugin','\x20(up\x20to\x20date)','GgxKj','length','DEBUG','data','Kbnod','Swaqy','status','pipe','parse','\x20\x20Project-level:','name','Root:\x20','jQlqe','36468lCYAXs','success','RWjtc','rSJvv','filter','\x0a---\x20Profiles\x20---','HHftL','ranger@trailhead','not_configured','details','1160999xsQpbh','vrIdy','1422JTpdrA','\x20\x20Run:\x20ranger\x20setup\x20--opencode','\x1b]8;;file://','98540UQlSeY','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','scope','isDirectory','auth.json.enc','config','stdout','\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a','WCgrG','@ranger-testing/opencode-plugin','oeXhv','fiseJ','sOhoF','Fdgqe','vqBEs','FRrrE','yiXuf','Organization:\x20','Version:\x20','OVjZS','push','1859905FQGPKG','YiUXt','\x0a\x20\x20No\x20active\x20profile\x20set','Xoldy','version','LwEyo','none','6OCQWOn','524KpTaqh','API\x20Environment:\x20','ygHub','opencode','SjdVF','8fVszuw','\x20\x20Run:\x20ranger\x20setup\x20[token]','log',':\x20configured','settingsPath','organizationName','isArray','2354JcDHid','qcIeR','SKILL.md','JlNnQ','\x1b[1m','BtlAC','IFrst','encrypted','JXVgI','configured','acwUB','\x20plugin(s)\x20configured','displayName','bwpOC','KDTjX','1022320UwxfFl','settings.json','GrDzT','ignore','gzfwV','hasEncryptedAuth','toString','\x20(active)'];_0x1e15=function(){return _0xeb4a10;};return _0x1e15();}import{getEnvDir}from'./utils/settings.js';import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';function _0x3d95(_0x41ffbd,_0x29942b){_0x41ffbd=_0x41ffbd-0x13a;const _0x1e15fc=_0x1e15();let _0x3d95b3=_0x1e15fc[_0x41ffbd];return _0x3d95b3;}import{spawn}from'child_process';const bold=_0x42293c=>_0x33d84d(0x199)+_0x42293c+_0x33d84d(0x145),link=(_0x33b297,_0x223f43)=>_0x33d84d(0x16b)+_0x33b297+'\x07'+(_0x223f43||_0x33b297)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x1f7a29=_0x33d84d,_0x2f2d87={'MxqJZ':'not_installed','ysRMq':'string','usVbD':'configured','EEOeM':_0x1f7a29(0x165),'VwXPk':function(_0x26321e,_0x1cea42){return _0x26321e(_0x1cea42);},'gzfwV':function(_0x179d99,_0x4ad013,_0x2580b4,_0x457e7d){return _0x179d99(_0x4ad013,_0x2580b4,_0x457e7d);},'BMxlU':_0x1f7a29(0x18c),'ptCZg':'debug','vnmmL':_0x1f7a29(0x157),'Xoldy':_0x1f7a29(0x153),'qcIeR':'close'};return new Promise(_0x2476de=>{const _0x4597e8=_0x1f7a29,_0x1586c1={'EspJP':_0x2f2d87['ysRMq'],'oeXhv':function(_0x2003e6,_0x4af4b6){return _0x2003e6!==_0x4af4b6;},'IgrSn':_0x2f2d87['usVbD'],'BtlAC':function(_0x14e596,_0x39bebc){return _0x14e596>_0x39bebc;},'huRsI':_0x2f2d87['EEOeM'],'OVjZS':function(_0xd31620,_0x3d19a6){const _0x19f653=_0x3d95;return _0x2f2d87[_0x19f653(0x149)](_0xd31620,_0x3d19a6);}},_0x2cd7ce=_0x2f2d87[_0x4597e8(0x140)](spawn,_0x2f2d87['BMxlU'],[_0x2f2d87[_0x4597e8(0x144)],_0x4597e8(0x171)],{'stdio':[_0x4597e8(0x13f),'pipe',_0x2f2d87[_0x4597e8(0x14b)]]});let _0x537d3c='';_0x2cd7ce[_0x4597e8(0x172)]?.['on'](_0x2f2d87[_0x4597e8(0x184)],_0x33966d=>{_0x537d3c+=_0x33966d['toString']();}),_0x2cd7ce['stderr']?.['on']('data',_0x157fca=>{const _0x4c6799=_0x4597e8;_0x537d3c+=_0x157fca[_0x4c6799(0x142)]();}),_0x2cd7ce['on']('error',()=>{_0x2476de({'status':_0x2f2d87['MxqJZ']});}),_0x2cd7ce['on'](_0x2f2d87[_0x4597e8(0x196)],_0x2b4327=>{const _0x558cc3=_0x4597e8,_0xb3c5fa={'sOhoF':function(_0x437598,_0x585c88){return _0x437598!==_0x585c88;},'XDUYq':_0x1586c1['EspJP'],'fiseJ':_0x558cc3(0x14e)};if(_0x1586c1[_0x558cc3(0x176)](_0x2b4327,0x0)){_0x2476de({'status':'not_installed'});return;}const _0x3034ee=_0x537d3c['trim']();let _0x27f9e4=null;if(_0x3034ee)try{_0x27f9e4=JSON['parse'](_0x3034ee);}catch{const _0x41033f=_0x3034ee['match'](/\{[\s\S]*\}$/);if(_0x41033f)try{_0x27f9e4=JSON[_0x558cc3(0x158)](_0x41033f[0x0]);}catch{_0x27f9e4=null;}}const _0x5a86ba=Array[_0x558cc3(0x194)](_0x27f9e4?.['plugin'])?_0x27f9e4?.['plugin']:[],_0xa780f0=_0x5a86ba['some'](_0x1278df=>{const _0x17b175=_0x558cc3;if(_0xb3c5fa[_0x17b175(0x178)](typeof _0x1278df,_0xb3c5fa['XDUYq']))return![];return _0x1278df[_0x17b175(0x14d)](_0x17b175(0x175))||_0x1278df[_0x17b175(0x14d)](_0xb3c5fa[_0x17b175(0x177)]);});if(_0xa780f0){_0x2476de({'status':_0x1586c1['IgrSn'],'details':_0x1586c1[_0x558cc3(0x19a)](_0x5a86ba[_0x558cc3(0x151)],0x0)?_0x5a86ba['length']+_0x558cc3(0x1a0):undefined});return;}if(_0x1586c1[_0x558cc3(0x19a)](_0x5a86ba[_0x558cc3(0x151)],0x0)){_0x2476de({'status':_0x1586c1['huRsI'],'details':_0x5a86ba['length']+'\x20plugin(s)\x20configured'});return;}_0x1586c1[_0x558cc3(0x17f)](_0x2476de,{'status':_0x558cc3(0x165)});});});}async function getSkillsFromDir(_0x2e0596,_0x2cd522){const _0x376ef4=_0x33d84d,_0x348eac={'ZLRZc':function(_0x197b86,_0x506e51,_0x3e2fcd){return _0x197b86(_0x506e51,_0x3e2fcd);},'RWjtc':function(_0x185a9f,_0x23f496){return _0x185a9f(_0x23f496);},'JXVgI':'utf-8'};if(!existsSync(_0x2e0596))return[];const _0x53ab6f=[];try{const _0x3b80f1=await _0x348eac['ZLRZc'](readdir,_0x2e0596,{'withFileTypes':!![]});for(const _0x4cddc7 of _0x3b80f1){if(_0x4cddc7[_0x376ef4(0x16f)]()){const _0x3623ac=join(_0x2e0596,_0x4cddc7[_0x376ef4(0x15a)],_0x376ef4(0x197));if(_0x348eac[_0x376ef4(0x15f)](existsSync,_0x3623ac)){let _0x191be0=_0x4cddc7[_0x376ef4(0x15a)];try{const _0x3a77b2=await _0x348eac['ZLRZc'](readFile,_0x3623ac,_0x348eac[_0x376ef4(0x19d)]),_0x138b4f=_0x3a77b2['match'](/name:\s*(.+)/);_0x138b4f&&(_0x191be0=_0x138b4f[0x1]['trim']());}catch{}_0x53ab6f[_0x376ef4(0x180)]({'name':_0x4cddc7[_0x376ef4(0x15a)],'displayName':_0x191be0,'path':_0x3623ac,'level':_0x2cd522});}}}}catch{return[];}return _0x53ab6f;}async function getInstalledSkills(){const _0x41fcc8=_0x33d84d,_0x18df35={'jqswH':function(_0x105004,_0x46dd3e,_0x22b891){return _0x105004(_0x46dd3e,_0x22b891);},'ugRYw':function(_0x305b42){return _0x305b42();},'gXoCx':'project'},[_0x311f86,_0x52d2ad]=await Promise[_0x41fcc8(0x14c)]([_0x18df35['jqswH'](getSkillsFromDir,_0x18df35['ugRYw'](getProjectSkillsDir),_0x18df35['gXoCx']),getSkillsFromDir(getUserSkillsDir(),'user')]);return{'project':_0x311f86,'user':_0x52d2ad};}async function getEnvironments(){const _0x4d8631={'Xeutq':function(_0x4770db,_0xff847,_0x335e07){return _0x4770db(_0xff847,_0x335e07);},'acwUB':function(_0x3df48b,_0x15bd2b){return _0x3df48b(_0x15bd2b);},'GgxKj':function(_0x4469d5,_0x1732ed){return _0x4469d5(_0x1732ed);},'EVKVX':function(_0x309d8c,_0x31439d){return _0x309d8c===_0x31439d;},'sXgYM':function(_0x5b2612){return _0x5b2612();}},{envNames:_0x4f1f2b,activeEnv:_0x2428d8}=await _0x4d8631['sXgYM'](getEnvNames),_0x26baf4=_0x4d8631['sXgYM'](getRangerDir);if(!existsSync(_0x26baf4))return{'envs':[],'activeEnv':null};const _0x33d747=_0x4f1f2b['map'](_0x4dcc0c=>{const _0x1706c7=_0x3d95,_0x322560=getEnvDir(_0x4dcc0c),_0x5767e2=_0x4d8631['Xeutq'](join,_0x322560,_0x1706c7(0x13d)),_0x49686d=join(_0x322560,'auth.json'),_0x10e69e=join(_0x322560,_0x1706c7(0x170));return{'name':_0x4dcc0c,'settingsPath':_0x4d8631[_0x1706c7(0x19f)](existsSync,_0x5767e2)?_0x5767e2:'(not\x20found)','hasPlaintextAuth':_0x4d8631[_0x1706c7(0x150)](existsSync,_0x49686d),'hasEncryptedAuth':existsSync(_0x10e69e),'isActive':_0x4d8631['EVKVX'](_0x4dcc0c,_0x2428d8)};});return{'envs':_0x33d747,'activeEnv':_0x2428d8};}export async function status(){const _0x3668f8=_0x33d84d,_0x30c4db={'KDTjX':function(_0x2376d4){return _0x2376d4();},'JlNnQ':function(_0x54a17d,_0x58e50b){return _0x54a17d(_0x58e50b);},'Kbnod':function(_0x32b421,_0x1861e6){return _0x32b421(_0x1861e6);},'vrIdy':'\x0a---\x20OpenCode\x20Plugin\x20---','SjdVF':function(_0x5900c7){return _0x5900c7();},'wYzaU':function(_0x2521fd,_0x60bf03){return _0x2521fd===_0x60bf03;},'HHftL':'not_configured','WCgrG':'\x20\x20Not\x20configured','bwpOC':_0x3668f8(0x16a),'ksbLi':'\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','QWHAU':'\x0a---\x20Claude\x20Code\x20Plugin\x20---','jQlqe':function(_0x3b8cf0,_0x199037){return _0x3b8cf0(_0x199037);},'pjyPt':'enabled','vqBEs':'disabled','Fdgqe':'ranger@trailhead','FRrrE':'\x20\x20Not\x20installed','YiUXt':'\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','Cnvja':_0x3668f8(0x14a),'eBuTo':function(_0x2c82e1,_0x2c0406){return _0x2c82e1+_0x2c0406;},'ygHub':function(_0x1e46d0,_0x372c17){return _0x1e46d0>_0x372c17;},'EaQDk':function(_0xe14f37,_0x562845,_0x1b7fe3){return _0xe14f37(_0x562845,_0x1b7fe3);},'KPsfC':function(_0x1a55ac,_0x57d45e){return _0x1a55ac>_0x57d45e;},'GrDzT':'\x20\x20User-level:','IFrst':_0x3668f8(0x162),'WiJxQ':function(_0x1c0688){return _0x1c0688();},'LwEyo':'No\x20profiles\x20configured','rSJvv':_0x3668f8(0x19c),'yiXuf':_0x3668f8(0x187),'PzaKD':function(_0x459ca4,_0x34d2d0){return _0x459ca4!==_0x34d2d0;},'Swaqy':'(not\x20found)'};console[_0x3668f8(0x190)]('\x0a📊\x20Ranger\x20Status\x0a');const _0x2b8177=process['cwd'](),_0x3804c1=_0x30c4db[_0x3668f8(0x13b)](getRangerDir);if(!_0x30c4db[_0x3668f8(0x198)](existsSync,_0x3804c1)){console['log'](_0x3668f8(0x15b)+link(_0x2b8177,bold(_0x30c4db[_0x3668f8(0x154)](basename,_0x2b8177)))),console['log']('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console['log'](_0x3668f8(0x173));return;}console['log'](_0x3668f8(0x15b)+link(_0x2b8177,bold(_0x30c4db[_0x3668f8(0x198)](basename,_0x2b8177))));const _0x587b36=getCurrentVersion(),_0x1bcee7=getLatestVersion();if(_0x1bcee7[_0x3668f8(0x185)]&&_0x1bcee7[_0x3668f8(0x185)]!==_0x587b36)console['log']('Version:\x20'+_0x587b36+'\x20(latest:\x20'+_0x1bcee7[_0x3668f8(0x185)]+')'),console[_0x3668f8(0x190)]('\x20\x20Run:\x20ranger\x20update');else _0x1bcee7[_0x3668f8(0x185)]?console[_0x3668f8(0x190)]('Version:\x20'+_0x587b36+_0x3668f8(0x14f)):console[_0x3668f8(0x190)](_0x3668f8(0x17e)+_0x587b36);const _0x75d18e=await _0x30c4db[_0x3668f8(0x13b)](getToken);if(_0x75d18e){const _0x186495=await getCurrentUser(_0x75d18e);_0x186495[_0x3668f8(0x15e)]?console[_0x3668f8(0x190)](_0x3668f8(0x17d)+bold(_0x186495['user'][_0x3668f8(0x193)])):(console['log']('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console['log'](_0x3668f8(0x18f)));}else console[_0x3668f8(0x190)]('API\x20Token:\x20✗\x20Not\x20found'),console[_0x3668f8(0x190)](_0x3668f8(0x18f));process['env'][_0x3668f8(0x152)]&&(console['log'](_0x3668f8(0x18a)+_0x30c4db[_0x3668f8(0x13b)](getCurrentEnvironment)),console['log']('API\x20URL:\x20'+_0x30c4db['KDTjX'](getApiBaseUrl)));console['log'](_0x30c4db[_0x3668f8(0x168)]);const _0x2b49b9=await _0x30c4db[_0x3668f8(0x18d)](getOpencodePluginStatus);if(_0x30c4db['wYzaU'](_0x2b49b9[_0x3668f8(0x156)],_0x3668f8(0x19e)))console['log']('\x20\x20'+_0x30c4db[_0x3668f8(0x154)](bold,_0x3668f8(0x175))+_0x3668f8(0x191)),_0x2b49b9['details']&&console[_0x3668f8(0x190)]('\x20\x20'+_0x2b49b9[_0x3668f8(0x166)]);else _0x2b49b9['status']===_0x30c4db[_0x3668f8(0x163)]?(console['log'](_0x30c4db[_0x3668f8(0x174)]),_0x2b49b9['details']&&console['log']('\x20\x20'+_0x2b49b9[_0x3668f8(0x166)]),console[_0x3668f8(0x190)](_0x30c4db[_0x3668f8(0x13a)])):console['log'](_0x30c4db['ksbLi']);console[_0x3668f8(0x190)](_0x30c4db['QWHAU']);const _0x4ff5b5=await _0x30c4db[_0x3668f8(0x15c)](getPluginInfo,_0x3668f8(0x164));if(_0x4ff5b5){const _0x52391b=_0x4ff5b5[_0x3668f8(0x16e)]||'unknown',_0x3445fc=_0x4ff5b5['enabled']?_0x30c4db['pjyPt']:_0x30c4db[_0x3668f8(0x17a)];console[_0x3668f8(0x190)]('\x20\x20'+_0x30c4db['jQlqe'](bold,_0x30c4db[_0x3668f8(0x179)])+':\x20installed\x20('+_0x52391b+',\x20'+_0x3445fc+')');}else console['log'](_0x30c4db[_0x3668f8(0x17b)]),console[_0x3668f8(0x190)](_0x30c4db[_0x3668f8(0x182)]);console[_0x3668f8(0x190)](_0x30c4db['Cnvja']);const {project:_0x35631b,user:_0x46f1a5}=await _0x30c4db['KDTjX'](getInstalledSkills),_0x2ec6f3=_0x35631b[_0x3668f8(0x161)](_0x8c7843=>RANGER_MANAGED_SKILLS[_0x3668f8(0x14d)](_0x8c7843['name'])),_0x200911=_0x46f1a5['filter'](_0xb62d6e=>RANGER_MANAGED_SKILLS['includes'](_0xb62d6e[_0x3668f8(0x15a)])),_0x33b7e9=_0x30c4db['eBuTo'](_0x2ec6f3['length'],_0x200911['length']);if(_0x33b7e9===0x0)console[_0x3668f8(0x190)]('No\x20skills\x20installed'),console[_0x3668f8(0x190)]('\x20\x20Run:\x20ranger\x20skillup');else{if(_0x30c4db[_0x3668f8(0x18b)](_0x2ec6f3['length'],0x0)){console['log'](_0x3668f8(0x159));for(const _0x4ff0b8 of _0x2ec6f3){console[_0x3668f8(0x190)]('\x20\x20\x20\x20'+bold(_0x4ff0b8[_0x3668f8(0x1a1)])+':\x20'+_0x30c4db['EaQDk'](link,_0x4ff0b8['path'],basename(_0x4ff0b8['path'])));}}if(_0x30c4db['KPsfC'](_0x200911[_0x3668f8(0x151)],0x0)){console['log'](_0x30c4db[_0x3668f8(0x13e)]);for(const _0x25e6cc of _0x200911){console['log'](_0x3668f8(0x146)+bold(_0x25e6cc[_0x3668f8(0x1a1)])+':\x20'+link(_0x25e6cc['path'],basename(_0x25e6cc['path'])));}}}console[_0x3668f8(0x190)](_0x30c4db[_0x3668f8(0x19b)]);const {envs:_0x3d1e6d,activeEnv:_0x478e23}=await _0x30c4db['WiJxQ'](getEnvironments);if(_0x3d1e6d[_0x3668f8(0x151)]===0x0)console[_0x3668f8(0x190)](_0x30c4db[_0x3668f8(0x186)]),console[_0x3668f8(0x190)]('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{for(const _0x34a35b of _0x3d1e6d){const _0x1e5368=_0x34a35b['isActive']?_0x3668f8(0x143):'',_0x49f808=_0x34a35b[_0x3668f8(0x141)]?_0x30c4db[_0x3668f8(0x160)]:_0x34a35b['hasPlaintextAuth']?'plaintext':_0x30c4db[_0x3668f8(0x17c)];console[_0x3668f8(0x190)]('\x20\x20'+_0x30c4db[_0x3668f8(0x15c)](bold,_0x34a35b[_0x3668f8(0x15a)])+_0x1e5368),console[_0x3668f8(0x190)]('\x20\x20\x20\x20Auth:\x20'+_0x49f808),_0x30c4db['PzaKD'](_0x34a35b['settingsPath'],_0x30c4db[_0x3668f8(0x155)])&&console['log']('\x20\x20\x20\x20Settings:\x20'+_0x30c4db['EaQDk'](link,_0x34a35b[_0x3668f8(0x192)],basename(_0x34a35b['settingsPath'])));}!_0x478e23&&(console['log'](_0x3668f8(0x183)),console[_0x3668f8(0x190)](_0x3668f8(0x16d)+_0x3d1e6d['map'](_0x4f63b2=>_0x4f63b2[_0x3668f8(0x15a)])['join'](',\x20')+')'));}console[_0x3668f8(0x190)]('');}
|
package/build/commands/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x37b58b,_0x24e434){const _0x3c20a5=_0x2c24,_0x6415f5=_0x37b58b();while(!![]){try{const _0x20492d=-parseInt(_0x3c20a5(0x190))/0x1+-parseInt(_0x3c20a5(0x18c))/0x2*(parseInt(_0x3c20a5(0x1a7))/0x3)+-parseInt(_0x3c20a5(0x1a2))/0x4+parseInt(_0x3c20a5(0x196))/0x5*(-parseInt(_0x3c20a5(0x183))/0x6)+parseInt(_0x3c20a5(0x182))/0x7*(parseInt(_0x3c20a5(0x1b1))/0x8)+-parseInt(_0x3c20a5(0x1b5))/0x9*(parseInt(_0x3c20a5(0x18f))/0xa)+parseInt(_0x3c20a5(0x189))/0xb;if(_0x20492d===_0x24e434)break;else _0x6415f5['push'](_0x6415f5['shift']());}catch(_0x4734dc){_0x6415f5['push'](_0x6415f5['shift']());}}}(_0x1724,0x884c7));import{spawn}from'child_process';import{existsSync}from'fs';function _0x1724(){const _0x27d777=['claude','OYwYt','vrMfw','2335mjXent','FJVgV','some','mOQbx','push','STgKI','active-feature.txt','QUoos','\x0aInstalling\x20','sHiOy','EoFqe','error','3704520tIhgUz','install','stdio','rnaoU','Claude\x20marketplace\x20update\x20command\x20failed\x20(timed\x20out,\x20failed\x20to\x20start,\x20or\x20exited\x20with\x20a\x20non-zero\x20status).','20892zhRLio','timeoutMs','GivSt','\x0aClaude\x20plugin\x20updated\x20(user\x20scope).','warn','KslaS','active-profile.txt','Update\x20failed.','@latest...\x0a','unref','76408XcQUui','log','version','marketplace','20421RbGonu','BbCuk','length','oHKpE','split','.gitignore','opencode','csvct','trailhead','update','\x0aYour\x20version\x20(','jMAru','inherit','dTNlN','loTgh','\x0aClaude\x20marketplace\x20updated\x20(trailhead).','\x0aNo\x20ranger-managed\x20skills\x20found\x20to\x20reinstall.','105eooszY','6756CKcsKv','OMByA','trim','✓\x20Migrated\x20active\x20profile\x20file','dGNSS','utf-8','44335610awvMSG','\x0aCurrent\x20version:\x20','join','198OFbtPz','cYswI','findIndex','3630wfijuW','650441plDWNu','\x20skill\x20','ignore'];_0x1724=function(){return _0x27d777;};return _0x1724();}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';function _0x2c24(_0x10a017,_0x4e2d06){_0x10a017=_0x10a017-0x17e;const _0x17242c=_0x1724();let _0x2c24b4=_0x17242c[_0x10a017];return _0x2c24b4;}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(_0x383789,_0x174968,_0x403502){const _0x6050e3=_0x2c24,_0x3ec0bb={'NzXgR':function(_0x30a3c6,_0x58d5fd){return _0x30a3c6(_0x58d5fd);},'dQwYp':function(_0x3e5a3f,_0x4866c2){return _0x3e5a3f===_0x4866c2;},'bobTt':function(_0x56f4a8,_0xfb6a5e,_0x4ace7d,_0x220396){return _0x56f4a8(_0xfb6a5e,_0x4ace7d,_0x220396);},'ofIsk':_0x6050e3(0x1c1),'WWyaT':function(_0x3cd851,_0xe9c440){return _0x3cd851===_0xe9c440;},'JfAPI':function(_0x153674,_0x2cf481,_0x333cac){return _0x153674(_0x2cf481,_0x333cac);},'HPBgZ':'close'};return new Promise(_0x42331e=>{const _0x42ec37=_0x6050e3,_0x54926d={'vrMfw':function(_0x530048,_0x1b74e6){return _0x3ec0bb['dQwYp'](_0x530048,_0x1b74e6);}};let _0x3f6cc2=![],_0x39f680;const _0x2c7298=_0x2297e7=>{if(_0x3f6cc2)return;_0x3f6cc2=!![],_0x39f680&&clearTimeout(_0x39f680),_0x42331e(_0x2297e7);},_0xefbee5=_0x3ec0bb['bobTt'](spawn,_0x383789,_0x174968,{'stdio':[_0x42ec37(0x192),_0x403502?.[_0x42ec37(0x1a4)]??_0x3ec0bb['ofIsk'],_0x403502?.['stdio']??'inherit'],'shell':_0x3ec0bb['WWyaT'](process['platform'],'win32')});_0x39f680=_0x403502?.[_0x42ec37(0x1a8)]?_0x3ec0bb['JfAPI'](setTimeout,()=>{const _0x2aa869=_0x42ec37;_0xefbee5['kill'](),_0xefbee5[_0x2aa869(0x1b0)](),_0x3ec0bb['NzXgR'](_0x2c7298,![]);},_0x403502[_0x42ec37(0x1a8)]):undefined,_0xefbee5['on'](_0x3ec0bb['HPBgZ'],_0x298898=>{const _0x568ed1=_0x42ec37;_0x2c7298(_0x54926d[_0x568ed1(0x195)](_0x298898,0x0));}),_0xefbee5['on'](_0x42ec37(0x1a1),()=>{_0x2c7298(![]);});});}async function runInstall(){const _0x2a329b=_0x2c24,_0x551dd6={'dGNSS':function(_0x3dd3e8,_0x2ce92d){return _0x3dd3e8===_0x2ce92d;},'qJQLd':_0x2a329b(0x1a3),'SEhJV':'inherit','ANbCm':'close','TJUcx':'error'};return new Promise(_0xde3932=>{const _0x573e40=_0x2a329b;console['log'](_0x573e40(0x19e)+PACKAGE_NAME+_0x573e40(0x1af));const _0xdd8f74=spawn('npm',[_0x551dd6['qJQLd'],'-g',PACKAGE_NAME+'@latest'],{'stdio':[_0x573e40(0x192),_0x551dd6['SEhJV'],_0x573e40(0x1c1)],'shell':_0x551dd6[_0x573e40(0x187)](process['platform'],'win32')});_0xdd8f74['on'](_0x551dd6['ANbCm'],_0x2d2e1d=>{_0xde3932(_0x551dd6['dGNSS'](_0x2d2e1d,0x0));}),_0xdd8f74['on'](_0x551dd6['TJUcx'],()=>{_0xde3932(![]);});});}async function updateClaudeMarketplace(){const _0x41a8ea=_0x2c24,_0x4ff3da={'rnaoU':function(_0x279629,_0x1ff178,_0x227259,_0x18b5f4){return _0x279629(_0x1ff178,_0x227259,_0x18b5f4);},'jMAru':'plugin','KslaS':_0x41a8ea(0x1a6)},_0x4adde0=await _0x4ff3da[_0x41a8ea(0x1a5)](runCommand,_0x41a8ea(0x193),[_0x4ff3da[_0x41a8ea(0x1c0)],_0x41a8ea(0x1b4),_0x41a8ea(0x1be),_0x41a8ea(0x1bd)],{'timeoutMs':CLAUDE_COMMAND_TIMEOUT_MS});if(!_0x4adde0)throw new Error(_0x4ff3da[_0x41a8ea(0x1ac)]);}async function updateClaudePlugin(_0xe760c5){const _0x2f1c50=_0x2c24,_0x2b2df3={'sHiOy':'plugin','GWAuL':'update','GmuRK':'ranger@trailhead','TywEK':_0x2f1c50(0x193)},_0x103aab=[_0x2b2df3[_0x2f1c50(0x19f)],_0x2b2df3['GWAuL'],_0x2b2df3['GmuRK']];_0xe760c5&&_0x103aab['push']('--scope',_0xe760c5);const _0x1780b7=await runCommand(_0x2b2df3['TywEK'],_0x103aab,{'timeoutMs':CLAUDE_COMMAND_TIMEOUT_MS});if(!_0x1780b7){const _0x528efb=_0xe760c5??'user';throw new Error('Claude\x20plugin\x20update\x20failed\x20for\x20'+_0x528efb+'\x20scope\x20(timed\x20out,\x20failed\x20to\x20start,\x20or\x20exited\x20with\x20a\x20non-zero\x20status).');}}function isSkillInstalled(_0xd51459,_0x55cb3d,_0x505c56){const _0x4b6023=_0x2c24,_0xf2d620={'oHKpE':function(_0x281de7,_0x145ec8){return _0x281de7===_0x145ec8;},'PFHrW':function(_0x47287e,_0x491234){return _0x47287e(_0x491234);},'loTgh':function(_0x45838c,_0x3bdfb8,_0x12b3d5){return _0x45838c(_0x3bdfb8,_0x12b3d5);},'OMByA':function(_0x57c339,_0x3bb3f7){return _0x57c339(_0x3bb3f7);}},_0x11e411=_0xf2d620[_0x4b6023(0x1b8)](_0x505c56,_0x4b6023(0x1bb))?_0xf2d620['PFHrW'](getOpencodeSkillsDir,_0x55cb3d):_0xf2d620['PFHrW'](getSkillsDir,_0x55cb3d),_0x3985bf=_0xf2d620[_0x4b6023(0x17f)](join,_0x11e411,_0xd51459);return _0xf2d620[_0x4b6023(0x184)](existsSync,_0x3985bf);}async function reinstallSkills(_0x33e259){const _0x5eb441=_0x2c24,_0x40c5f1={'VYmmv':'user','kJlDr':function(_0x435ab3,_0x17214d,_0x5baea7,_0x453100){return _0x435ab3(_0x17214d,_0x5baea7,_0x453100);},'cYswI':function(_0x2c5e6b,_0x162e85,_0x27a412,_0x15269c){return _0x2c5e6b(_0x162e85,_0x27a412,_0x15269c);},'EoFqe':function(_0xe91b8b,_0x45cd9a){return _0xe91b8b===_0x45cd9a;},'bHRfx':function(_0x5cb071,_0xe22147,_0x5b7237){return _0x5cb071(_0xe22147,_0x5b7237);}},_0x3f7ea5=['project',_0x40c5f1['VYmmv']],_0x464a94=[];for(const _0xb5eb77 of _0x3f7ea5){for(const _0x482603 of RANGER_MANAGED_SKILLS){_0x40c5f1['kJlDr'](isSkillInstalled,_0x482603,_0xb5eb77,_0x5eb441(0x193))&&_0x464a94[_0x5eb441(0x19a)]({'skillName':_0x482603,'level':_0xb5eb77,'platform':'claude'}),_0x40c5f1[_0x5eb441(0x18d)](isSkillInstalled,_0x482603,_0xb5eb77,'opencode')&&_0x464a94[_0x5eb441(0x19a)]({'skillName':_0x482603,'level':_0xb5eb77,'platform':_0x5eb441(0x1bb)});}}for(const _0xf980da of _0x3f7ea5){for(const _0x11dce2 of DEPRECATED_SKILLS){await removeSkill(_0x11dce2,_0xf980da);}}if(_0x40c5f1[_0x5eb441(0x1a0)](_0x464a94['length'],0x0)){console[_0x5eb441(0x1b2)](_0x5eb441(0x181));return;}console[_0x5eb441(0x1b2)]('\x0aReinstalling\x20'+_0x464a94['length']+'\x20ranger-managed\x20skill(s)...');for(const {skillName:_0x35ebbf,level:_0x3fb148,platform:_0x258af2}of _0x464a94){try{await _0x40c5f1['bHRfx'](installSkill,_0x35ebbf,{'level':_0x3fb148,'cliVersion':_0x33e259,'platform':_0x258af2});}catch(_0x3581e6){console[_0x5eb441(0x1ab)]('\x20\x20Failed\x20to\x20reinstall\x20'+_0x258af2+'\x20'+_0x3fb148+_0x5eb441(0x191)+_0x35ebbf+':',_0x3581e6);}}}async function ensureActiveProfileGitignored(){const _0x1c5b8a=_0x2c24,_0x32af32={'dTNlN':function(_0x3514af,_0x23de33,_0x5210c9){return _0x3514af(_0x23de33,_0x5210c9);},'VkKTE':_0x1c5b8a(0x1ba),'iXwhp':function(_0x45cbf3,_0x2d0439){return _0x45cbf3(_0x2d0439);},'FJVgV':_0x1c5b8a(0x1ad),'TAiFb':'utf-8'},_0xa60104=_0x32af32[_0x1c5b8a(0x17e)](join,getRangerDir(),_0x32af32['VkKTE']);if(!_0x32af32['iXwhp'](existsSync,_0xa60104))return![];let _0x126ad9='';try{_0x126ad9=await _0x32af32[_0x1c5b8a(0x17e)](readFile,_0xa60104,_0x1c5b8a(0x188));}catch{return![];}const _0x1f9ace=_0x126ad9[_0x1c5b8a(0x1b9)](/\r?\n/);if(_0x1f9ace[_0x1c5b8a(0x198)](_0x4d7321=>_0x4d7321['trim']()===_0x1c5b8a(0x1ad)))return![];let _0x5174e1=_0x1f9ace[_0x1c5b8a(0x18e)](_0x495f70=>_0x495f70[_0x1c5b8a(0x185)]()===_0x1c5b8a(0x19c));_0x5174e1===-0x1&&(_0x5174e1=_0x1f9ace[_0x1c5b8a(0x1b7)]);_0x1f9ace['splice'](_0x5174e1,0x0,_0x32af32[_0x1c5b8a(0x197)]);let _0x1f3445=_0x1f9ace[_0x1c5b8a(0x18b)]('\x0a');!_0x1f3445['endsWith']('\x0a')&&(_0x1f3445+='\x0a');try{await writeFile(_0xa60104,_0x1f3445,_0x32af32['TAiFb']);}catch{return![];}return!![];}export async function update(){const _0x27b2c6=_0x2c24,_0x4f4a8a={'csvct':'Checking\x20for\x20updates...','GETiO':'Attempting\x20install\x20anyway...','STgKI':function(_0x208cb5,_0x3aaee9,_0x2acca5){return _0x208cb5(_0x3aaee9,_0x2acca5);},'GivSt':function(_0x511723,_0x40d0c9){return _0x511723===_0x40d0c9;},'vLteE':function(_0x4d6d5b,_0x51cdf3){return _0x4d6d5b<_0x51cdf3;},'ixzEP':_0x27b2c6(0x1ae),'BOObk':'ranger@trailhead','zrvZp':function(_0x5de85a){return _0x5de85a();},'mOQbx':function(_0x1c3b32,_0x1b8831){return _0x1c3b32(_0x1b8831);},'pOzHi':'project','QUoos':'\x0aClaude\x20plugin\x20updated\x20(project\x20scope).','BpGbY':_0x27b2c6(0x1aa),'OYwYt':function(_0x5e568d){return _0x5e568d();},'BbCuk':_0x27b2c6(0x186)},_0x312176=getCurrentVersion();console['log'](_0x27b2c6(0x18a)+_0x312176),console[_0x27b2c6(0x1b2)](_0x4f4a8a[_0x27b2c6(0x1bc)]);const _0x1d4a5c=getLatestVersion();let _0x5f0211=_0x312176;if(!_0x1d4a5c[_0x27b2c6(0x1b3)]){console[_0x27b2c6(0x1ab)]('\x0aCould\x20not\x20check\x20latest\x20version:\x20'+_0x1d4a5c[_0x27b2c6(0x1a1)]),console[_0x27b2c6(0x1b2)](_0x4f4a8a['GETiO']);const _0x27dbba=await runInstall();if(_0x27dbba)console[_0x27b2c6(0x1b2)]('\x0aSuccessfully\x20installed\x20latest\x20version.'),_0x5f0211=getCurrentVersion();else throw new Error('Update\x20failed:\x20'+_0x1d4a5c[_0x27b2c6(0x1a1)]);}else{const _0xad231d=_0x1d4a5c[_0x27b2c6(0x1b3)];console[_0x27b2c6(0x1b2)]('Latest\x20version:\x20\x20'+_0xad231d);const _0x59670d=_0x4f4a8a[_0x27b2c6(0x19b)](compareVersions,_0x312176,_0xad231d);if(_0x4f4a8a[_0x27b2c6(0x1a9)](_0x59670d,0x0))console[_0x27b2c6(0x1b2)]('\x0aYou\x20are\x20already\x20on\x20the\x20latest\x20version.');else{if(_0x4f4a8a['vLteE'](_0x59670d,0x0))console['log'](_0x27b2c6(0x1bf)+_0x312176+')\x20is\x20newer\x20than\x20the\x20published\x20version\x20('+_0xad231d+').');else{const _0x83613b=await runInstall();if(_0x83613b)console[_0x27b2c6(0x1b2)]('\x0aSuccessfully\x20updated\x20to\x20version\x20'+_0xad231d),_0x5f0211=_0xad231d;else throw new Error(_0x4f4a8a['ixzEP']);}}}await reinstallSkills(_0x5f0211);const _0x32346d=await isMarketplaceAdded(_0x27b2c6(0x1bd)),_0x59b303=await isPluginInstalled(_0x4f4a8a['BOObk']);_0x32346d&&(await _0x4f4a8a['zrvZp'](updateClaudeMarketplace),console['log'](_0x27b2c6(0x180)));if(_0x59b303){const _0x1b3533=await _0x4f4a8a[_0x27b2c6(0x199)](getPluginInfo,_0x4f4a8a['BOObk']);_0x1b3533?.['scope']===_0x4f4a8a['pOzHi']?(await updateClaudePlugin(_0x4f4a8a['pOzHi']),console[_0x27b2c6(0x1b2)](_0x4f4a8a[_0x27b2c6(0x19d)])):(await updateClaudePlugin(),console['log'](_0x4f4a8a['BpGbY']));}const _0x607268=await _0x4f4a8a[_0x27b2c6(0x194)](migrateActiveProfileFile);_0x607268&&console[_0x27b2c6(0x1b2)](_0x4f4a8a[_0x27b2c6(0x1b6)]);const _0x3a551a=await ensureActiveProfileGitignored();console[_0x27b2c6(0x1b2)]('\x0a✅\x20Update\x20complete!');}
|
|
1
|
+
(function(_0x2986d2,_0x3a63c6){const _0x3ea99a=_0x3149,_0x304bc6=_0x2986d2();while(!![]){try{const _0x20c89f=-parseInt(_0x3ea99a(0x194))/0x1*(-parseInt(_0x3ea99a(0x183))/0x2)+-parseInt(_0x3ea99a(0x165))/0x3+parseInt(_0x3ea99a(0x162))/0x4*(parseInt(_0x3ea99a(0x1a6))/0x5)+-parseInt(_0x3ea99a(0x155))/0x6+parseInt(_0x3ea99a(0x163))/0x7+-parseInt(_0x3ea99a(0x187))/0x8*(parseInt(_0x3ea99a(0x19a))/0x9)+-parseInt(_0x3ea99a(0x1a7))/0xa*(parseInt(_0x3ea99a(0x19e))/0xb);if(_0x20c89f===_0x3a63c6)break;else _0x304bc6['push'](_0x304bc6['shift']());}catch(_0x4c5ce3){_0x304bc6['push'](_0x304bc6['shift']());}}}(_0x2271,0x875d4));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';function _0x3149(_0xaf48d1,_0x177284){_0xaf48d1=_0xaf48d1-0x152;const _0x22710f=_0x2271();let _0x3149d1=_0x22710f[_0xaf48d1];return _0x3149d1;}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';function _0x2271(){const _0x480102=['ecmSQ','SqMxf','4138194gvZsXh','wHVBo','error','.gitignore','iuwWQ','rcDFo','TMXRM','alpha','QKsEJ','UEqiN','kill','project','version','4mUVTCQ','7422870VNXZvc','GcnwW','554613WWfgEO','scope','log','findIndex','evVMR','stdio','GozFj','Update\x20failed:\x20','pRtgc','update','bliGm','\x0aClaude\x20marketplace\x20updated\x20(trailhead).','\x0aYou\x20are\x20already\x20on\x20the\x20latest\x20version.','nBdgu','\x0aClaude\x20plugin\x20updated\x20(project\x20scope).','pgIVB','split','trailhead','opencode','length',')\x20is\x20newer\x20than\x20the\x20published\x20version\x20(','test','\x0aInstalling\x20','\x0aCould\x20not\x20check\x20latest\x20version:\x20','beta','some',').\x20Staying\x20on\x20','claude','GvjYS','Attempting\x20install\x20anyway...','711638vtvObW','Update\x20failed.','pFsVD','\x20—\x20reinstalling\x20@','677504kTlenT','...\x0a','RiMjp','xPDlq','uxhWX','endsWith','Update\x20failed\x20for\x20@','inherit','gKxgZ','QvBbr','yvweH','warn','platform','1dtxipw','trim','user','win32','vqQIz','ranger@trailhead','9CdfbUq','latest','plugin','install','1333706juPsqy','✓\x20Migrated\x20active\x20profile\x20file','...','close','wcwTW','active-profile.txt','xXeKz','zmIyr','1093635RvHlLL','10KXhnkU','push'];_0x2271=function(){return _0x480102;};return _0x2271();}const CLAUDE_COMMAND_TIMEOUT_MS=0x1d4c0;async function runCommand(_0x3a3a17,_0x131826,_0x54d348){const _0x214fda={'zmIyr':function(_0x40ae64,_0x162975,_0x16ade6,_0x197318){return _0x40ae64(_0x162975,_0x16ade6,_0x197318);},'VnceH':'ignore','gKxgZ':function(_0x58939b,_0x25ad13){return _0x58939b===_0x25ad13;},'UEqiN':'win32','uxhWX':function(_0x51e593,_0x2e2ed7,_0x5ca960){return _0x51e593(_0x2e2ed7,_0x5ca960);}};return new Promise(_0x3e7f85=>{const _0x35e094=_0x3149,_0x3bdd13={'gmuAt':function(_0x3e1d35,_0x5e8bf9){return _0x3e1d35(_0x5e8bf9);}};let _0x2dd630=![],_0x4c5eaf;const _0x4a599e=_0x6e1654=>{if(_0x2dd630)return;_0x2dd630=!![],_0x4c5eaf&&clearTimeout(_0x4c5eaf),_0x3bdd13['gmuAt'](_0x3e7f85,_0x6e1654);},_0x55792b=_0x214fda[_0x35e094(0x1a5)](spawn,_0x3a3a17,_0x131826,{'stdio':[_0x214fda['VnceH'],_0x54d348?.[_0x35e094(0x16a)]??_0x35e094(0x18e),_0x54d348?.['stdio']??_0x35e094(0x18e)],'shell':_0x214fda[_0x35e094(0x18f)](process[_0x35e094(0x193)],_0x214fda[_0x35e094(0x15e)])});_0x4c5eaf=_0x54d348?.['timeoutMs']?_0x214fda[_0x35e094(0x18b)](setTimeout,()=>{const _0x576114=_0x35e094;_0x55792b[_0x576114(0x15f)](),_0x55792b['unref'](),_0x3bdd13['gmuAt'](_0x4a599e,![]);},_0x54d348['timeoutMs']):undefined,_0x55792b['on'](_0x35e094(0x1a1),_0x1fbf6c=>{_0x4a599e(_0x1fbf6c===0x0);}),_0x55792b['on']('error',()=>{_0x4a599e(![]);});});}export function resolveDistTag(_0x1682c6){const _0xbc1782=_0x3149,_0x229041={'fkDAx':'latest'};if(/-alpha\./i[_0xbc1782(0x17a)](_0x1682c6))return _0xbc1782(0x15c);if(/-beta\./i['test'](_0x1682c6))return _0xbc1782(0x17d);if(/-rc\./i['test'](_0x1682c6))return'rc';return _0x229041['fkDAx'];}async function runInstall(_0x831db2='latest'){const _0x34a955=_0x3149,_0x58606c={'xoGQG':function(_0x3775a7,_0x496b9b){return _0x3775a7(_0x496b9b);},'xXeKz':function(_0xf74b92,_0x481566,_0x43f5e4,_0x2dd02f){return _0xf74b92(_0x481566,_0x43f5e4,_0x2dd02f);},'nBdgu':_0x34a955(0x19d),'mwrWo':'ignore','QvBbr':'inherit','VMfSz':_0x34a955(0x197),'dyBAL':'close'};return new Promise(_0x3c5c42=>{const _0x11029c=_0x34a955,_0x371726={'xvmPn':function(_0x3fdb51,_0x388cc6){return _0x58606c['xoGQG'](_0x3fdb51,_0x388cc6);}};console['log'](_0x11029c(0x17b)+PACKAGE_NAME+'@'+_0x831db2+_0x11029c(0x188));const _0x2f75bf=_0x58606c[_0x11029c(0x1a4)](spawn,'npm',[_0x58606c[_0x11029c(0x172)],'-g',PACKAGE_NAME+'@'+_0x831db2],{'stdio':[_0x58606c['mwrWo'],'inherit',_0x58606c[_0x11029c(0x190)]],'shell':process[_0x11029c(0x193)]===_0x58606c['VMfSz']});_0x2f75bf['on'](_0x58606c['dyBAL'],_0x53e5f1=>{_0x371726['xvmPn'](_0x3c5c42,_0x53e5f1===0x0);}),_0x2f75bf['on'](_0x11029c(0x157),()=>{_0x3c5c42(![]);});});}async function updateClaudeMarketplace(){const _0x50c7ea=_0x3149,_0x328941={'GozFj':_0x50c7ea(0x180),'mAqZa':_0x50c7ea(0x19c),'OkllL':'Claude\x20marketplace\x20update\x20command\x20failed\x20(timed\x20out,\x20failed\x20to\x20start,\x20or\x20exited\x20with\x20a\x20non-zero\x20status).'},_0x184e71=await runCommand(_0x328941[_0x50c7ea(0x16b)],[_0x328941['mAqZa'],'marketplace','update',_0x50c7ea(0x176)],{'timeoutMs':CLAUDE_COMMAND_TIMEOUT_MS});if(!_0x184e71)throw new Error(_0x328941['OkllL']);}async function updateClaudePlugin(_0x6f30e){const _0x1f1270=_0x3149,_0x538c3a={'GlZNr':_0x1f1270(0x19c),'pLLwy':_0x1f1270(0x199),'MTIvT':'--scope','xPDlq':function(_0x21928d,_0x12e3c2){return _0x21928d??_0x12e3c2;}},_0x3c4068=[_0x538c3a['GlZNr'],_0x1f1270(0x16e),_0x538c3a['pLLwy']];_0x6f30e&&_0x3c4068[_0x1f1270(0x152)](_0x538c3a['MTIvT'],_0x6f30e);const _0x210aa4=await runCommand('claude',_0x3c4068,{'timeoutMs':CLAUDE_COMMAND_TIMEOUT_MS});if(!_0x210aa4){const _0x3f808b=_0x538c3a[_0x1f1270(0x18a)](_0x6f30e,_0x1f1270(0x196));throw new Error('Claude\x20plugin\x20update\x20failed\x20for\x20'+_0x3f808b+'\x20scope\x20(timed\x20out,\x20failed\x20to\x20start,\x20or\x20exited\x20with\x20a\x20non-zero\x20status).');}}function isSkillInstalled(_0x114e82,_0x48c1f7,_0x2789be){const _0x412a6a=_0x3149,_0x2fbb08={'cxmvA':_0x412a6a(0x177),'ghgfy':function(_0x239e6e,_0x19a7dd){return _0x239e6e(_0x19a7dd);}},_0x57f024=_0x2789be===_0x2fbb08['cxmvA']?getOpencodeSkillsDir(_0x48c1f7):getSkillsDir(_0x48c1f7),_0x476c2d=join(_0x57f024,_0x114e82);return _0x2fbb08['ghgfy'](existsSync,_0x476c2d);}async function reinstallSkills(_0x2380d2){const _0x27cca4=_0x3149,_0x3a3b9f={'vqQIz':'project','ISvVC':_0x27cca4(0x196),'xjMer':function(_0x4af42c,_0x2497a4,_0x2176ae,_0x5f5da4){return _0x4af42c(_0x2497a4,_0x2176ae,_0x5f5da4);},'wHVBo':_0x27cca4(0x180),'gwuvy':_0x27cca4(0x177),'pRtgc':function(_0x18fd84,_0x26d7ad,_0x3c707a){return _0x18fd84(_0x26d7ad,_0x3c707a);}},_0x5463a0=[_0x3a3b9f[_0x27cca4(0x198)],_0x3a3b9f['ISvVC']],_0x1bce83=[];for(const _0x322c8c of _0x5463a0){for(const _0x579862 of RANGER_MANAGED_SKILLS){_0x3a3b9f['xjMer'](isSkillInstalled,_0x579862,_0x322c8c,_0x3a3b9f[_0x27cca4(0x156)])&&_0x1bce83['push']({'skillName':_0x579862,'level':_0x322c8c,'platform':_0x3a3b9f['wHVBo']}),_0x3a3b9f['xjMer'](isSkillInstalled,_0x579862,_0x322c8c,'opencode')&&_0x1bce83['push']({'skillName':_0x579862,'level':_0x322c8c,'platform':_0x3a3b9f['gwuvy']});}}for(const _0x3d0bd7 of _0x5463a0){for(const _0x566fc6 of DEPRECATED_SKILLS){await removeSkill(_0x566fc6,_0x3d0bd7);}}if(_0x1bce83['length']===0x0){console[_0x27cca4(0x167)]('\x0aNo\x20ranger-managed\x20skills\x20found\x20to\x20reinstall.');return;}console['log']('\x0aReinstalling\x20'+_0x1bce83[_0x27cca4(0x178)]+'\x20ranger-managed\x20skill(s)...');for(const {skillName:_0xc6d2ff,level:_0x5d720d,platform:_0x11249}of _0x1bce83){try{await _0x3a3b9f[_0x27cca4(0x16d)](installSkill,_0xc6d2ff,{'level':_0x5d720d,'cliVersion':_0x2380d2,'platform':_0x11249});}catch(_0x427a83){console[_0x27cca4(0x192)]('\x20\x20Failed\x20to\x20reinstall\x20'+_0x11249+'\x20'+_0x5d720d+'\x20skill\x20'+_0xc6d2ff+':',_0x427a83);}}}async function ensureActiveProfileGitignored(){const _0x134eaa=_0x3149,_0x3b7ea3={'wWSCz':function(_0x27656a,_0x1c5f37,_0x5327f9){return _0x27656a(_0x1c5f37,_0x5327f9);},'GvjYS':_0x134eaa(0x158),'wcwTW':'utf-8','hBonm':function(_0x46278d,_0x3ef9f7){return _0x46278d===_0x3ef9f7;},'iuwWQ':_0x134eaa(0x1a3),'aHwCm':function(_0x54109f,_0x14fd66,_0x39aa93,_0x2eb4d1){return _0x54109f(_0x14fd66,_0x39aa93,_0x2eb4d1);}},_0x381a2c=_0x3b7ea3['wWSCz'](join,getRangerDir(),_0x3b7ea3[_0x134eaa(0x181)]);if(!existsSync(_0x381a2c))return![];let _0x25d62c='';try{_0x25d62c=await readFile(_0x381a2c,_0x3b7ea3[_0x134eaa(0x1a2)]);}catch{return![];}const _0x5b3c1c=_0x25d62c[_0x134eaa(0x175)](/\r?\n/);if(_0x5b3c1c[_0x134eaa(0x17e)](_0x353a68=>_0x353a68['trim']()===_0x134eaa(0x1a3)))return![];let _0x1c7e28=_0x5b3c1c[_0x134eaa(0x168)](_0x415dda=>_0x415dda[_0x134eaa(0x195)]()==='active-feature.txt');_0x3b7ea3['hBonm'](_0x1c7e28,-0x1)&&(_0x1c7e28=_0x5b3c1c['length']);_0x5b3c1c['splice'](_0x1c7e28,0x0,_0x3b7ea3[_0x134eaa(0x159)]);let _0x47fd84=_0x5b3c1c['join']('\x0a');!_0x47fd84[_0x134eaa(0x18c)]('\x0a')&&(_0x47fd84+='\x0a');try{await _0x3b7ea3['aHwCm'](writeFile,_0x381a2c,_0x47fd84,_0x3b7ea3['wcwTW']);}catch{return![];}return!![];}export async function update(){const _0x300533=_0x3149,_0x2f7cf5={'ecmSQ':function(_0xd93262){return _0xd93262();},'MTtKn':function(_0x406f2d,_0x43ee52){return _0x406f2d!==_0x43ee52;},'evVMR':_0x300533(0x19b),'weoVT':function(_0x5a787c,_0x43970b){return _0x5a787c(_0x43970b);},'GcnwW':function(_0x196a76,_0x28f7a5){return _0x196a76(_0x28f7a5);},'QKsEJ':function(_0x1b7c6e){return _0x1b7c6e();},'rcDFo':'\x0a✅\x20Update\x20complete!','pFsVD':function(_0x5bf882,_0x4fa705){return _0x5bf882===_0x4fa705;},'RiMjp':_0x300533(0x171),'SqMxf':function(_0x211b40,_0x1e9881){return _0x211b40<_0x1e9881;},'pgIVB':_0x300533(0x184),'TMXRM':'trailhead','bliGm':_0x300533(0x160),'yvweH':_0x300533(0x173),'qqwyd':'\x0aClaude\x20plugin\x20updated\x20(user\x20scope).','ODuvb':'✓\x20Migrated\x20active\x20profile\x20file'},_0x3b3258=_0x2f7cf5[_0x300533(0x153)](getCurrentVersion);console[_0x300533(0x167)]('\x0aCurrent\x20version:\x20'+_0x3b3258);const _0x25ec31=resolveDistTag(_0x3b3258);if(_0x2f7cf5['MTtKn'](_0x25ec31,_0x2f7cf5[_0x300533(0x169)])){console[_0x300533(0x167)]('Prerelease\x20channel\x20detected\x20(@'+_0x25ec31+_0x300533(0x17f)+_0x25ec31+_0x300533(0x186)+_0x25ec31+_0x300533(0x1a0));const _0x1cf18c=await _0x2f7cf5['weoVT'](runInstall,_0x25ec31);if(!_0x1cf18c)throw new Error(_0x300533(0x18d)+_0x25ec31+'\x20channel.');const _0x2b0943=_0x2f7cf5[_0x300533(0x153)](getCurrentVersion);console['log']('\x0aSuccessfully\x20installed\x20'+PACKAGE_NAME+'@'+_0x25ec31+'.'),await _0x2f7cf5[_0x300533(0x164)](reinstallSkills,_0x2b0943);const _0x1c3be2=await _0x2f7cf5['QKsEJ'](migrateActiveProfileFile);_0x1c3be2&&console['log'](_0x300533(0x19f));await _0x2f7cf5[_0x300533(0x15d)](ensureActiveProfileGitignored),console[_0x300533(0x167)](_0x2f7cf5[_0x300533(0x15a)]);return;}console[_0x300533(0x167)]('Checking\x20for\x20updates...');const _0x4048ad=_0x2f7cf5[_0x300533(0x153)](getLatestVersion);let _0x12aac5=_0x3b3258;if(!_0x4048ad['version']){console['warn'](_0x300533(0x17c)+_0x4048ad[_0x300533(0x157)]),console['log'](_0x300533(0x182));const _0xa25b26=await runInstall();if(_0xa25b26)console[_0x300533(0x167)]('\x0aSuccessfully\x20installed\x20latest\x20version.'),_0x12aac5=getCurrentVersion();else throw new Error(_0x300533(0x16c)+_0x4048ad['error']);}else{const _0x1bb371=_0x4048ad[_0x300533(0x161)];console[_0x300533(0x167)]('Latest\x20version:\x20\x20'+_0x1bb371);const _0x255183=compareVersions(_0x3b3258,_0x1bb371);if(_0x2f7cf5[_0x300533(0x185)](_0x255183,0x0))console['log'](_0x2f7cf5[_0x300533(0x189)]);else{if(_0x2f7cf5[_0x300533(0x154)](_0x255183,0x0))console['log']('\x0aYour\x20version\x20('+_0x3b3258+_0x300533(0x179)+_0x1bb371+').');else{const _0xf8b3e1=await runInstall();if(_0xf8b3e1)console[_0x300533(0x167)]('\x0aSuccessfully\x20updated\x20to\x20version\x20'+_0x1bb371),_0x12aac5=_0x1bb371;else throw new Error(_0x2f7cf5[_0x300533(0x174)]);}}}await reinstallSkills(_0x12aac5);const _0x3167a7=await _0x2f7cf5['GcnwW'](isMarketplaceAdded,_0x2f7cf5[_0x300533(0x15b)]),_0x90d9d3=await isPluginInstalled('ranger@trailhead');_0x3167a7&&(await updateClaudeMarketplace(),console['log'](_0x300533(0x170)));if(_0x90d9d3){const _0x9169ab=await getPluginInfo(_0x300533(0x199));_0x9169ab?.[_0x300533(0x166)]==='project'?(await updateClaudePlugin(_0x2f7cf5[_0x300533(0x16f)]),console['log'](_0x2f7cf5[_0x300533(0x191)])):(await updateClaudePlugin(),console[_0x300533(0x167)](_0x2f7cf5['qqwyd']));}const _0x225090=await migrateActiveProfileFile();_0x225090&&console['log'](_0x2f7cf5['ODuvb']);const _0x3f742d=await ensureActiveProfileGitignored();console[_0x300533(0x167)]('\x0a✅\x20Update\x20complete!');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3f1c12,_0x497f32){const _0x4d61fd=_0x22fd,_0x496a46=_0x3f1c12();while(!![]){try{const _0x1a0122=parseInt(_0x4d61fd(0x148))/0x1*(-parseInt(_0x4d61fd(0x178))/0x2)+parseInt(_0x4d61fd(0x154))/0x3*(-parseInt(_0x4d61fd(0x161))/0x4)+parseInt(_0x4d61fd(0x16a))/0x5+-parseInt(_0x4d61fd(0x170))/0x6*(-parseInt(_0x4d61fd(0x167))/0x7)+-parseInt(_0x4d61fd(0x14a))/0x8+parseInt(_0x4d61fd(0x15e))/0x9+parseInt(_0x4d61fd(0x176))/0xa;if(_0x1a0122===_0x497f32)break;else _0x496a46['push'](_0x496a46['shift']());}catch(_0x2410c7){_0x496a46['push'](_0x496a46['shift']());}}}(_0x5c0b,0x5e650));function _0x5c0b(){const _0x2ef709=['allowInsecureLocalhost','browser','XIJtA','aBpbE','3576357vmMJSX','KrLko','\x20\x20\x20Update\x20your\x20authentication\x20as\x20needed.','1027928ssaUzx','ujxmF','This\x20can\x20happen\x20due\x20to\x20a\x20browser\x20compatibility\x20issue\x20on\x20some\x20systems.\x0a','trackPhaseStart','.\x20Run\x20first:\x20ranger\x20profile\x20add\x20','trackPhaseEnd','203lmtqBL','IpZXn','.enc','397215QlSmGV','browser_auth','goto','parse','\x0aThe\x20browser\x20closed\x20unexpectedly\x20before\x20authentication\x20could\x20be\x20saved.','auth.json','79770jmcefx','isTTY','\x22\x20authentication\x20updated','baseUrl','✓\x20Encrypted\x20auth\x20saved\x20to:\x20','newPage','12935050KxoCKM','close','2bFhGXY','about:blank','jLjct','NuQww','settings.json','\x22\x20not\x20found.\x20Run\x20first:\x20ranger\x20profile\x20add\x20','ssMNa','log','457103qcOmrR','storageState','4329496SjPzMf','catch','KQhIB','GFEfH','\x20safeMode\x20true\x0a','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','setupHeaders','config_write','\x20\x20Could\x20not\x20encrypt:\x20No\x20API\x20token\x20found.\x20Run:\x20ranger\x20setup\x20[token]','sdzOE','9nvYoZA','XRGgp','string','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','contextOptions','error'];_0x5c0b=function(){return _0x2ef709;};return _0x5c0b();}import{writeFile,readFile,unlink}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{chromium}from'playwright';function _0x22fd(_0x539faf,_0x59bb02){_0x539faf=_0x539faf-0x148;const _0x5c0b5d=_0x5c0b();let _0x22fd0c=_0x5c0b5d[_0x539faf];return _0x22fd0c;}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(_0x52d11c,_0x18b512,_0x2a62cc){const _0x1b5b77=_0x22fd,_0x116123={'pAaHn':function(_0x4389a1){return _0x4389a1();},'XRGgp':function(_0x3ef0f8,_0x4d5e62,_0x65c2a){return _0x3ef0f8(_0x4d5e62,_0x65c2a);},'sdzOE':'utf-8','YjPSI':function(_0xb80572,_0x12d558){return _0xb80572(_0x12d558);},'FWpgr':function(_0x413754,_0x304fe1){return _0x413754===_0x304fe1;},'jLjct':_0x1b5b77(0x156),'NuQww':'\x0a📋\x20Authentication\x20Update','KrLko':_0x1b5b77(0x160),'aBpbE':'\x20\x20\x20When\x20you\x20are\x20done,\x20close\x20the\x20browser.\x0a','ssMNa':function(_0x57c8d4,_0x38e09d){return _0x57c8d4(_0x38e09d);},'IpZXn':function(_0x27928b,_0xf77957){return _0x27928b||_0xf77957;},'hQUuc':_0x1b5b77(0x179),'FZFJf':_0x1b5b77(0x16e),'ujxmF':_0x1b5b77(0x163),'OVZVp':_0x1b5b77(0x157),'vBqur':function(_0x1c9c63,_0x43a8d4,_0x2e2b6d){return _0x1c9c63(_0x43a8d4,_0x2e2b6d);},'XIJtA':function(_0x43e6cb,_0x13e95c,_0x19beb4){return _0x43e6cb(_0x13e95c,_0x19beb4);},'qUReR':'\x20\x20You\x20can\x20safely\x20commit\x20this\x20file\x20to\x20git.','yLURi':_0x1b5b77(0x16b),'KQhIB':_0x1b5b77(0x151),'GFEfH':function(_0x3d7990,_0x2f8e33){return _0x3d7990===_0x2f8e33;}},_0x38aaa0=getEnvDir(_0x52d11c),_0x32cdf9=join(_0x38aaa0,_0x1b5b77(0x17c)),_0x4a0cd2=_0x116123[_0x1b5b77(0x155)](join,_0x38aaa0,_0x1b5b77(0x16f)),_0x1dc0cf=_0x4a0cd2+_0x1b5b77(0x169),_0x3b8ecd=process['stdin']['isTTY']&&process['stdout'][_0x1b5b77(0x171)];if(!_0x3b8ecd)throw new Error(_0x1b5b77(0x14f));if(!existsSync(_0x38aaa0))throw new Error('Profile\x20\x22'+_0x52d11c+_0x1b5b77(0x17d)+_0x52d11c);if(!existsSync(_0x32cdf9))throw new Error('Config\x20not\x20found\x20at\x20'+_0x32cdf9+_0x1b5b77(0x165)+_0x52d11c);const _0x4a29d1=await readFile(_0x32cdf9,_0x116123[_0x1b5b77(0x153)]),_0x313940=JSON[_0x1b5b77(0x16d)](_0x4a29d1),_0x471ff7=_0x116123['YjPSI'](resolveEnvVars,_0x313940),_0x4a005b=_0x116123['FWpgr'](typeof _0x471ff7[_0x1b5b77(0x173)],_0x116123[_0x1b5b77(0x17a)])?_0x471ff7['baseUrl']:undefined,_0x2d1251=existsSync(_0x4a0cd2),_0x9f3c10=isEnvCi(_0x52d11c);_0x18b512?.[_0x1b5b77(0x164)](_0x1b5b77(0x16b)),console[_0x1b5b77(0x17f)](_0x116123[_0x1b5b77(0x17b)]),console['log']('\x20\x20\x20A\x20browser\x20will\x20open\x20with\x20your\x20existing\x20session\x20(if\x20any).'),console['log'](_0x116123[_0x1b5b77(0x15f)]),console['log'](_0x116123[_0x1b5b77(0x15d)]);const {launchOptions:_0x591666,contextOptions:_0x155a06}=_0x116123['XRGgp'](buildBrowserOptionsFromSettings,_0x471ff7,{'headless':![],'storageStatePath':_0x2d1251?_0x4a0cd2:undefined});_0x471ff7[_0x1b5b77(0x150)]&&(_0x155a06['extraHTTPHeaders']={..._0x155a06['extraHTTPHeaders'],..._0x471ff7['setupHeaders']});const _0x2473c3=await chromium['launch'](_0x591666);let _0x5c2a66=null;try{_0x5c2a66=await _0x2473c3['newContext'](_0x155a06),await _0x116123[_0x1b5b77(0x17e)](addProfileSetupBanner,_0x5c2a66);const _0xeb4b6=await _0x5c2a66[_0x1b5b77(0x175)]();await _0xeb4b6[_0x1b5b77(0x16c)](_0x116123[_0x1b5b77(0x168)](_0x4a005b,_0x116123['hQUuc']));let _0x357fd1=![];await new Promise(_0x275334=>{_0xeb4b6['on']('close',async()=>{const _0x4d1220=_0x22fd;try{console[_0x4d1220(0x17f)]('Saving\x20authentication\x20state...'),await _0x5c2a66?.[_0x4d1220(0x149)]({'path':_0x4a0cd2}),_0x357fd1=!![];}catch{}_0x116123['pAaHn'](_0x275334);});});if(!_0x357fd1){console[_0x1b5b77(0x17f)](_0x116123['FZFJf']);!_0x471ff7['safeMode']&&(console['log'](_0x116123[_0x1b5b77(0x162)]),console[_0x1b5b77(0x17f)]('Enable\x20safe\x20mode\x20and\x20try\x20again:\x20ranger\x20profile\x20config\x20set\x20'+_0x52d11c+_0x1b5b77(0x14e)));throw new Error(_0x116123['OVZVp']);}}finally{_0x5c2a66&&await _0x5c2a66[_0x1b5b77(0x177)]()[_0x1b5b77(0x14b)](()=>{}),await _0x2473c3[_0x1b5b77(0x177)]()[_0x1b5b77(0x14b)](()=>{});}if(_0x9f3c10){const _0x4f168b=await _0x116123['XRGgp'](readFile,_0x4a0cd2,'utf-8'),_0xb0d1fc=await getToken();if(!_0xb0d1fc)console[_0x1b5b77(0x159)](_0x1b5b77(0x152)),console[_0x1b5b77(0x17f)]('✓\x20Auth\x20state\x20saved\x20to:\x20'+_0x4a0cd2);else{const _0x6d33c4=_0x116123['vBqur'](encrypt,_0x4f168b,_0xb0d1fc);await _0x116123[_0x1b5b77(0x15c)](writeFile,_0x1dc0cf,_0x6d33c4),await unlink(_0x4a0cd2),console['log'](_0x1b5b77(0x174)+_0x1dc0cf),console['log'](_0x116123['qUReR']),console['log']('\x20\x20Run\x20ranger\x20setup\x20in\x20CI\x20to\x20decrypt\x20at\x20runtime.');}}else console[_0x1b5b77(0x17f)]('✓\x20Auth\x20state\x20saved\x20to:\x20'+_0x4a0cd2);_0x18b512?.['trackPhaseEnd'](_0x116123['yLURi']),_0x18b512?.['trackPhaseStart'](_0x116123['KQhIB']),_0x313940[_0x1b5b77(0x15b)]=_0x313940[_0x1b5b77(0x15b)]||{},_0x313940['browser'][_0x1b5b77(0x158)]=_0x313940['browser']['contextOptions']||{},_0x313940[_0x1b5b77(0x15b)]['contextOptions'][_0x1b5b77(0x149)]=_0x4a0cd2,_0x116123[_0x1b5b77(0x14d)](_0x2a62cc?.[_0x1b5b77(0x15a)],!![])&&(_0x313940['allowInsecureLocalhost']=!![]),await writeFile(_0x32cdf9,JSON['stringify'](_0x313940,null,0x2)),console[_0x1b5b77(0x17f)]('✓\x20Updated\x20config:\x20'+_0x32cdf9),_0x18b512?.[_0x1b5b77(0x166)](_0x116123[_0x1b5b77(0x14c)]),console[_0x1b5b77(0x17f)]('\x0a✅\x20Profile\x20\x22'+_0x52d11c+_0x1b5b77(0x172));}
|
package/build/commands/useEnv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3322da,_0x52fa0e){const _0x536d4c=_0x1704,_0x47251b=_0x3322da();while(!![]){try{const _0x332b69=-parseInt(_0x536d4c(0xef))/0x1+-parseInt(_0x536d4c(0xe8))/0x2+-parseInt(_0x536d4c(0xe2))/0x3+-parseInt(_0x536d4c(0xec))/0x4+-parseInt(_0x536d4c(0xe4))/0x5+parseInt(_0x536d4c(0xea))/0x6*(-parseInt(_0x536d4c(0xf1))/0x7)+parseInt(_0x536d4c(0xe1))/0x8*(parseInt(_0x536d4c(0xe3))/0x9);if(_0x332b69===_0x52fa0e)break;else _0x47251b['push'](_0x47251b['shift']());}catch(_0x20f219){_0x47251b['push'](_0x47251b['shift']());}}}(_0x2af3,0xc3ef5));import{join}from'path';function _0x1704(_0x117822,_0xd34391){_0x117822=_0x117822-0xdf;const _0x2af3ca=_0x2af3();let _0x170408=_0x2af3ca[_0x117822];return _0x170408;}import{existsSync}from'fs';function _0x2af3(){const _0x35fc8f=['Wtcvo','251823zmMuyC','status','1292417bWNeVi','\x0a✓\x20Now\x20using\x20','Profile\x20\x22','pzifG','8pBsqcP','871404sYhwiE','34044129xQTNYy','931805UMXcmb','`ranger\x20profile\x20add\x20','profile\x20\x22','jNiop','2141134pdFHIt','ioRHm','36xqEvFr','log','292508TxOnzj','\x22\x20not\x20found\x20locally\x20or\x20in\x20the\x20cloud.\x20'];_0x2af3=function(){return _0x35fc8f;};return _0x2af3();}import{getEnvDir}from'./utils/settings.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{ApiError,fetchCloudProfile}from'./utils/cloudProfile.js';export async function useEnv(_0x395775){const _0x15b0b6=_0x1704,_0x3d1f71={'jNiop':function(_0x4b70f4,_0x285ec6){return _0x4b70f4(_0x285ec6);},'nhrCb':function(_0xa78fdf,_0x205930,_0x5e6e7e){return _0xa78fdf(_0x205930,_0x5e6e7e);},'GgfTG':function(_0xf41312,_0x158ec4){return _0xf41312(_0x158ec4);},'QcCiL':function(_0x36a274,_0x2018b7){return _0x36a274(_0x2018b7);},'QQdaI':function(_0x105473,_0x265666){return _0x105473 instanceof _0x265666;},'pzifG':function(_0x4e3156,_0xfbb64b){return _0x4e3156===_0xfbb64b;},'Wtcvo':function(_0x285d9b,_0x76da5c){return _0x285d9b+_0x76da5c;},'ioRHm':function(_0x49e85d,_0x5b3a25){return _0x49e85d(_0x5b3a25);},'PVVTK':'cloud\x20'},_0x223c2c=_0x3d1f71[_0x15b0b6(0xe7)](getEnvDir,_0x395775),_0x15c808=_0x3d1f71['nhrCb'](join,_0x223c2c,'settings.json'),_0x55ace4=existsSync(_0x223c2c)&&_0x3d1f71['GgfTG'](existsSync,_0x15c808);if(_0x55ace4){await writeActiveProfileName(_0x395775),console[_0x15b0b6(0xeb)]('\x0a✓\x20Now\x20using\x20profile\x20\x22'+_0x395775+'\x22');return;}let _0x6dc9e2=null,_0x591703=![];try{_0x6dc9e2=await _0x3d1f71['QcCiL'](fetchCloudProfile,_0x395775);if(!_0x6dc9e2)_0x591703=!![];}catch(_0x3ad6bc){_0x3d1f71['QQdaI'](_0x3ad6bc,ApiError)&&_0x3d1f71[_0x15b0b6(0xe0)](_0x3ad6bc[_0x15b0b6(0xf0)],0x194)&&(_0x591703=!![]);}if(_0x591703)throw new Error(_0x3d1f71[_0x15b0b6(0xee)](_0x15b0b6(0xdf)+_0x395775+_0x15b0b6(0xed),'Run\x20`ranger\x20profile\x20ls`\x20to\x20see\x20available\x20profiles,\x20or\x20')+(_0x15b0b6(0xe5)+_0x395775+'`\x20to\x20create\x20one.'));await _0x3d1f71[_0x15b0b6(0xe9)](writeActiveProfileName,_0x395775),console['log'](_0x15b0b6(0xf2)+(_0x6dc9e2?_0x3d1f71['PVVTK']:'')+_0x15b0b6(0xe6)+_0x395775+'\x22');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1879c6,_0x10b468){const _0x48654c=_0x528f,_0x24a3c5=_0x1879c6();while(!![]){try{const _0x1119f0=parseInt(_0x48654c(0x122))/0x1*(parseInt(_0x48654c(0x121))/0x2)+parseInt(_0x48654c(0x128))/0x3*(-parseInt(_0x48654c(0x131))/0x4)+-parseInt(_0x48654c(0x11c))/0x5+parseInt(_0x48654c(0x120))/0x6*(-parseInt(_0x48654c(0x11f))/0x7)+-parseInt(_0x48654c(0x123))/0x8+-parseInt(_0x48654c(0x11e))/0x9*(parseInt(_0x48654c(0x12b))/0xa)+-parseInt(_0x48654c(0x12e))/0xb*(-parseInt(_0x48654c(0x127))/0xc);if(_0x1119f0===_0x10b468)break;else _0x24a3c5['push'](_0x24a3c5['shift']());}catch(_0x1c170a){_0x24a3c5['push'](_0x24a3c5['shift']());}}}(_0x5328,0x8efbd));import{existsSync}from'fs';import{mkdir,readFile,rename,unlink,writeFile}from'fs/promises';function _0x528f(_0x76209a,_0x43c459){_0x76209a=_0x76209a-0x11b;const _0x53284a=_0x5328();let _0x528f5c=_0x53284a[_0x76209a];return _0x528f5c;}import{join}from'path';function _0x5328(){const _0x1a126e=['7108176MffSGY','zbWgG','PgIbm','utf-8','48AuHNnF','433461CQUllU','trim','XyAvg','45200AMHgiP','NgULU','LvNii','10930909nkYrOE','SvhdA','QNWxx','32HrHEsH','rMkdw','dEJzu','qoweT','IZtmM','489045HDumhz','QyPYl','1773ZvwBEw','2944893BkZrzJ','12wIusIA','484850sEAfHi','2AVMBTB'];_0x5328=function(){return _0x1a126e;};return _0x5328();}import{getRangerDir,getRangerHomeDir}from'./rangerRoot.js';const ACTIVE_PROFILE_FILE='active-profile.txt',LEGACY_ACTIVE_ENV_FILE='active-env.txt';function getActiveProfilePath(){const _0xd9d151=_0x528f,_0x27a18e={'IZtmM':function(_0x73f286,_0x4ff656,_0x12ee75){return _0x73f286(_0x4ff656,_0x12ee75);},'LvNii':function(_0x1ef515){return _0x1ef515();}},_0x5530b6=_0x27a18e[_0xd9d151(0x11b)](join,_0x27a18e[_0xd9d151(0x12d)](getRangerDir),ACTIVE_PROFILE_FILE);if(existsSync(_0x5530b6))return _0x5530b6;return _0x27a18e['IZtmM'](join,getRangerHomeDir(),ACTIVE_PROFILE_FILE);}function getLegacyActiveEnvPath(){const _0x81f9fe={'UCnOW':function(_0x653558,_0x5a55b6,_0x53746c){return _0x653558(_0x5a55b6,_0x53746c);}},_0xf10f6b=_0x81f9fe['UCnOW'](join,getRangerDir(),LEGACY_ACTIVE_ENV_FILE);if(existsSync(_0xf10f6b))return _0xf10f6b;return join(getRangerHomeDir(),LEGACY_ACTIVE_ENV_FILE);}function getActiveProfileWritePath(){const _0x480815=_0x528f,_0x285c3e={'SvhdA':function(_0x4308c9,_0x418fb7,_0x37b939){return _0x4308c9(_0x418fb7,_0x37b939);},'PgIbm':function(_0x369dc8,_0x123080,_0xc1abb5){return _0x369dc8(_0x123080,_0xc1abb5);}},_0x5831e9=getRangerDir();if(existsSync(_0x5831e9))return{'path':_0x285c3e[_0x480815(0x12f)](join,_0x5831e9,ACTIVE_PROFILE_FILE),'dir':_0x5831e9,'isUserScope':![]};const _0x5abfdf=getRangerHomeDir();return{'path':_0x285c3e[_0x480815(0x125)](join,_0x5abfdf,ACTIVE_PROFILE_FILE),'dir':_0x5abfdf,'isUserScope':!![]};}async function migrateLegacyActiveEnv(){const _0x383450=_0x528f,_0x14fcd3={'XyAvg':function(_0x5d18d8,_0x2aebb8){return _0x5d18d8(_0x2aebb8);},'IqYFL':function(_0x440ba8,_0x27a05d,_0x9d1145){return _0x440ba8(_0x27a05d,_0x9d1145);},'ETPiS':function(_0x244c36){return _0x244c36();},'QyPYl':function(_0x37b711,_0x92046a,_0x57c127){return _0x37b711(_0x92046a,_0x57c127);},'NgULU':function(_0x5afe80,_0x575099,_0x423233,_0x2714a7){return _0x5afe80(_0x575099,_0x423233,_0x2714a7);},'dMBRE':'utf-8'},_0xc0cc2f=getLegacyActiveEnvPath();if(!_0x14fcd3['XyAvg'](existsSync,_0xc0cc2f))return null;let _0x25575a=null;try{_0x25575a=(await _0x14fcd3['IqYFL'](readFile,_0xc0cc2f,'utf-8'))['trim']()||null;}catch{_0x25575a=null;}if(!_0x25575a)return null;const {path:_0x53ff31,dir:_0x27b1a5}=_0x14fcd3['ETPiS'](getActiveProfileWritePath);try{await _0x14fcd3[_0x383450(0x11d)](rename,_0xc0cc2f,_0x53ff31);}catch{try{await _0x14fcd3['QyPYl'](mkdir,_0x27b1a5,{'recursive':!![]}),await _0x14fcd3[_0x383450(0x12c)](writeFile,_0x53ff31,_0x25575a,_0x14fcd3['dMBRE']),await _0x14fcd3[_0x383450(0x12a)](unlink,_0xc0cc2f);}catch{}}return _0x25575a;}export async function readActiveProfileName(){const _0x323e5d=_0x528f,_0x5d22ee={'rMkdw':function(_0x8fafdc,_0x41127e){return _0x8fafdc(_0x41127e);},'zbWgG':function(_0x4fb7a5,_0x576512,_0x1b7202){return _0x4fb7a5(_0x576512,_0x1b7202);},'QNWxx':_0x323e5d(0x126),'eUVSu':function(_0x38296b){return _0x38296b();}},_0x5e3fbb=getActiveProfilePath();if(_0x5d22ee[_0x323e5d(0x132)](existsSync,_0x5e3fbb))try{return(await _0x5d22ee[_0x323e5d(0x124)](readFile,_0x5e3fbb,_0x5d22ee[_0x323e5d(0x130)]))[_0x323e5d(0x129)]()||null;}catch{return null;}return await _0x5d22ee['eUVSu'](migrateLegacyActiveEnv);}export async function writeActiveProfileName(_0x219c86){const _0x52c379=_0x528f,_0x80105e={'dEJzu':function(_0xfd00eb){return _0xfd00eb();},'qoweT':function(_0x54101d,_0x2ab658,_0x3a27d2){return _0x54101d(_0x2ab658,_0x3a27d2);},'UxSnU':function(_0x54ca0a,_0x21e3fa,_0x2549b3,_0x3d84bb){return _0x54ca0a(_0x21e3fa,_0x2549b3,_0x3d84bb);},'EznOe':_0x52c379(0x126)},{path:_0x1f996e,dir:_0x30871a}=_0x80105e[_0x52c379(0x133)](getActiveProfileWritePath);await _0x80105e[_0x52c379(0x134)](mkdir,_0x30871a,{'recursive':!![]}),await _0x80105e['UxSnU'](writeFile,_0x1f996e,_0x219c86,_0x80105e['EznOe']);const _0x41f369=getLegacyActiveEnvPath();if(existsSync(_0x41f369))try{await unlink(_0x41f369);}catch{}}export async function migrateActiveProfileFile(){const _0x184213=await migrateLegacyActiveEnv();return _0x184213!==null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x4ad2d5=_0xe625;(function(_0x7fd69b,_0x43ae4c){const _0x1db8ca=_0xe625,_0x5dba31=_0x7fd69b();while(!![]){try{const _0x251cb0=parseInt(_0x1db8ca(0x1b4))/0x1+parseInt(_0x1db8ca(0x1cd))/0x2+-parseInt(_0x1db8ca(0x1b5))/0x3+-parseInt(_0x1db8ca(0x1b8))/0x4+parseInt(_0x1db8ca(0x1c9))/0x5+-parseInt(_0x1db8ca(0x1a3))/0x6+-parseInt(_0x1db8ca(0x1b1))/0x7*(-parseInt(_0x1db8ca(0x19c))/0x8);if(_0x251cb0===_0x43ae4c)break;else _0x5dba31['push'](_0x5dba31['shift']());}catch(_0xa980c1){_0x5dba31['push'](_0x5dba31['shift']());}}}(_0x33cc,0x24e0c));function _0xe625(_0x95d05d,_0xde2e73){_0x95d05d=_0x95d05d-0x19b;const _0x33cc75=_0x33cc();let _0xe625b=_0x33cc75[_0x95d05d];return _0xe625b;}import{delimiter,join}from'path';import{tmpdir}from'os';import{mkdirSync}from'fs';import{getAiProxyUrl}from'./environment.js';const AI_PROXY_METADATA_HEADERS_ENV_VAR='ANTHROPIC_CUSTOM_HEADERS',AGENT_ENV_PASSTHROUGH_KEYS=[_0x4ad2d5(0x1bc),'HOME',_0x4ad2d5(0x1be),'TMP',_0x4ad2d5(0x1c5),'USERPROFILE',_0x4ad2d5(0x1cb),_0x4ad2d5(0x1ae),'XDG_CACHE_HOME','XDG_CONFIG_HOME','PLAYWRIGHT_BROWSERS_PATH','PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD','CHROME_BIN','CHROMIUM_BIN',_0x4ad2d5(0x1b0),_0x4ad2d5(0x19f),_0x4ad2d5(0x1cc),_0x4ad2d5(0x1b2),'npm_config_prefix','NPM_CONFIG_PREFIX','npm_config_registry',_0x4ad2d5(0x1ba),_0x4ad2d5(0x1bd),'NODE_ENV',_0x4ad2d5(0x1c1),_0x4ad2d5(0x1ca),AI_PROXY_METADATA_HEADERS_ENV_VAR],UNEXPANDED_PATH_TOKEN_PATTERNS=['${PATH}','$PATH',_0x4ad2d5(0x1aa)];function _0x33cc(){const _0x13fdac=['211824SpcpLZ','push','NPM_CONFIG_REGISTRY','env','PATH','DEBUG','TMPDIR','filter','IktGD','RANGER_TEST_SKIP_BROWSER_WAIT','join','TMP','split','TEMP','sessionToken','from','true','87915ezdKQf','RANGER_DISABLE_MCP','APPDATA','npm_config_userconfig','398610ojUsLk','metadata','8GKghmo','map','indexOf','NPM_CONFIG_CACHE','entries','has','Session\x20token\x20is\x20required\x20when\x20RANGER_BYOK=false','1409520AjHPUT','slice','PATH\x20is\x20empty,\x20so\x20npm\x20and\x20core\x20system\x20tools\x20may\x20be\x20unavailable.','length','XXjkm','includes','kVPAS','%PATH%','trim','PATH\x20is\x20missing\x20core\x20system\x20directories\x20like\x20`/usr/bin`\x20and\x20`/bin`.','/bin','LOCALAPPDATA','toLowerCase','npm_config_cache','1570702stQpUw','NPM_CONFIG_USERCONFIG','dJBuo','65337pGLwPd','203049MsmfRq','MYxal','add'];_0x33cc=function(){return _0x13fdac;};return _0x33cc();}function parseCustomHeaders(_0x1f2005){const _0x3515f6=_0x4ad2d5,_0x1e8477={'IktGD':function(_0x21fbd0,_0x30143f){return _0x21fbd0+_0x30143f;}};if(!_0x1f2005)return[];return _0x1f2005[_0x3515f6(0x1c4)](/\r?\n/)[_0x3515f6(0x19d)](_0x10b756=>_0x10b756['trim']())[_0x3515f6(0x1bf)](Boolean)[_0x3515f6(0x19d)](_0x22f555=>{const _0x1d0fa6=_0x3515f6,_0x2fb27b=_0x22f555[_0x1d0fa6(0x19e)](':');if(_0x2fb27b===-0x1)return null;const _0x153e62=_0x22f555[_0x1d0fa6(0x1a4)](0x0,_0x2fb27b)['trim'](),_0x4b9436=_0x22f555['slice'](_0x1e8477[_0x1d0fa6(0x1c0)](_0x2fb27b,0x1))[_0x1d0fa6(0x1ab)]();if(!_0x153e62)return null;return[_0x153e62,_0x4b9436];})['filter'](_0x1912da=>_0x1912da!==null);}export function getAgentPathHealthWarning(_0xaf2a6,_0x5478e5=process['platform']){const _0x24cc4c=_0x4ad2d5,_0x57c54c={'SlSLb':function(_0xa885a,_0x69dff){return _0xa885a===_0x69dff;},'XXjkm':_0x24cc4c(0x1a5),'kVPAS':'win32','WkEtE':'/usr/bin','GjPPX':function(_0x3b80a4,_0x46ccd3){return _0x3b80a4&&_0x46ccd3;},'liRak':function(_0x30aadb,_0x50e832){return _0x30aadb===_0x50e832;},'auSUI':'Your\x20PATH\x20looks\x20incomplete\x20for\x20browser\x20automation.\x20Ranger\x20will\x20keep\x20going,\x20but\x20browser\x20setup\x20may\x20fail.'},_0x3af060=[],_0x305abe=(_0xaf2a6||'')['split'](delimiter)['filter'](Boolean);_0x57c54c['SlSLb'](_0x305abe[_0x24cc4c(0x1a6)],0x0)&&_0x3af060['push'](_0x57c54c[_0x24cc4c(0x1a7)]);UNEXPANDED_PATH_TOKEN_PATTERNS['some'](_0x558d64=>(_0xaf2a6||'')[_0x24cc4c(0x1a8)](_0x558d64))&&_0x3af060[_0x24cc4c(0x1b9)]('PATH\x20contains\x20an\x20unexpanded\x20placeholder\x20like\x20`${PATH}`\x20instead\x20of\x20the\x20expanded\x20current\x20PATH.');if(_0x5478e5!==_0x57c54c[_0x24cc4c(0x1a9)]){const _0x160f03=_0x305abe['includes'](_0x57c54c['WkEtE']),_0x4d7970=_0x305abe[_0x24cc4c(0x1a8)](_0x24cc4c(0x1ad));_0x57c54c['GjPPX'](!_0x160f03,!_0x4d7970)&&_0x3af060[_0x24cc4c(0x1b9)](_0x24cc4c(0x1ac));}if(_0x57c54c['liRak'](_0x3af060[_0x24cc4c(0x1a6)],0x0))return null;return{'summary':_0x57c54c['auSUI'],'issues':_0x3af060};}export function buildAgentEnv(_0x16d906){const _0x11de90=_0x4ad2d5,_0x53e91b={'RbRVn':function(_0x192903){return _0x192903();},'DWrGM':_0x11de90(0x1c8),'ZDpGb':'TMPDIR','MYxal':'TEMP','WsTnx':function(_0x3b1261,_0x47fed8,_0x591c9f){return _0x3b1261(_0x47fed8,_0x591c9f);},'dJBuo':function(_0x424ed7,_0x154ffd){return _0x424ed7(_0x154ffd);},'ZndMM':function(_0x269d55,_0x5c2f6b){return _0x269d55===_0x5c2f6b;}};if(_0x16d906['byokEnabled'])return Object['fromEntries'](Object[_0x11de90(0x1a0)](process['env'])['filter'](_0x5e29d9=>typeof _0x5e29d9[0x1]==='string'));if(!_0x16d906['sessionToken'])throw new Error(_0x11de90(0x1a2));const _0x2c13d7={'ANTHROPIC_API_KEY':_0x16d906[_0x11de90(0x1c6)],'ANTHROPIC_BASE_URL':_0x53e91b['RbRVn'](getAiProxyUrl),'DISABLE_TELEMETRY':_0x53e91b['DWrGM']};for(const _0x3054af of AGENT_ENV_PASSTHROUGH_KEYS){const _0x4923d0=process[_0x11de90(0x1bb)][_0x3054af];_0x4923d0&&![_0x53e91b['ZDpGb'],_0x11de90(0x1c3),_0x53e91b[_0x11de90(0x1b6)]]['includes'](_0x3054af)&&(_0x2c13d7[_0x3054af]=_0x4923d0);}const _0x5eff90=_0x53e91b['WsTnx'](join,tmpdir(),'ranger-claude-tmp');try{mkdirSync(_0x5eff90,{'recursive':!![]});}catch{}_0x2c13d7['TMPDIR']=_0x5eff90,_0x2c13d7['TMP']=_0x5eff90,_0x2c13d7[_0x53e91b[_0x11de90(0x1b6)]]=_0x5eff90;const _0x3d9082=_0x53e91b[_0x11de90(0x1b3)](parseCustomHeaders,process['env'][AI_PROXY_METADATA_HEADERS_ENV_VAR]),_0x289334=new Map(_0x3d9082),_0x2737d5=new Set(_0x3d9082[_0x11de90(0x19d)](([_0x295923])=>_0x295923['toLowerCase']()));if(_0x16d906[_0x11de90(0x19b)])for(const [_0x580d5b,_0x3c1781]of Object['entries'](_0x16d906[_0x11de90(0x19b)])){if(_0x3c1781==null||_0x53e91b['ZndMM'](_0x3c1781,''))continue;const _0x8b5ba1='x-ranger-'+_0x580d5b;!_0x2737d5[_0x11de90(0x1a1)](_0x8b5ba1[_0x11de90(0x1af)]())&&(_0x289334['set'](_0x8b5ba1,_0x3c1781),_0x2737d5[_0x11de90(0x1b7)](_0x8b5ba1[_0x11de90(0x1af)]()));}const _0x2b1641=Array[_0x11de90(0x1c7)](_0x289334[_0x11de90(0x1a0)]())['map'](([_0x5ddde4,_0x454500])=>_0x5ddde4+':\x20'+_0x454500)[_0x11de90(0x1c2)]('\x0a');return _0x2b1641&&(_0x2c13d7[AI_PROXY_METADATA_HEADERS_ENV_VAR]=_0x2b1641),_0x2c13d7;}
|