@ranger-testing/ranger-cli 2.1.2 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/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/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/featureReportGenerator.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/git.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/opencodeConfig.js +1 -1
- package/build/commands/utils/profileMessages.js +1 -1
- package/build/commands/utils/profileSetupBanner.js +1 -1
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/reportGenerator.js +1 -1
- package/build/commands/utils/retry.js +1 -1
- package/build/commands/utils/sessionCache.js +1 -1
- package/build/commands/utils/settings.js +1 -1
- package/build/commands/utils/skillContent.js +1 -1
- package/build/commands/utils/skills.js +1 -1
- package/build/commands/utils/telemetry.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -0
- 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/verifyInBrowser.js +1 -1
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x4dd7(){const _0x1d0067=['stat','266frkYDi','NvPZq','featureId','AHJvH','oQDhV','size','297846ixYKkJ','89rqPoig','\x20for\x20\x22','JrZZL','RANGER_SKIP_VERIFICATION','12vabXES','1337192TzlugD','ztBkJ','AFJKk','6614XdPvPx','utf8','alloc','message','input','trackCommandStart','27FYrEdv','stringify','157758bUCQwP',':\x0a\x0a','28732860BMcYaW','stop_hook_active','log','130cprcQM','283715rIgVOG','468325RZfuVo','\x0a\x0aThis\x20is\x20most\x20likely\x20due\x20to\x20pending\x20scenarios\x20that\x20need\x20to\x20be\x20verified.\x20Please\x20resolve\x20the\x20issue\x20or\x20resume\x20later\x20with:\x0a\x20\x20ranger\x20resume\x0a\x0aIf\x20you\x20are\x20extremely\x20sure\x20this\x20is\x20the\x20user\x27s\x20requirement\x20and\x20want\x20to\x20skip\x20verification\x20for\x20now,\x20send\x20a\x20final\x20message\x20that\x20includes\x20the\x20feature\x20review\x20link\x20(','DkTJT','https://dashboard.ranger.net/features/','QrfIb','includes','toString'];_0x4dd7=function(){return _0x1d0067;};return _0x4dd7();}(function(_0x232080,_0x9bee4d){const _0x5a709f=_0x2b08,_0x47e1bf=_0x232080();while(!![]){try{const _0x297c97=-parseInt(_0x5a709f(0xb0))/0x1*(-parseInt(_0x5a709f(0x92))/0x2)+parseInt(_0x5a709f(0xaf))/0x3+-parseInt(_0x5a709f(0xb4))/0x4*(parseInt(_0x5a709f(0xa0))/0x5)+parseInt(_0x5a709f(0x9a))/0x6*(-parseInt(_0x5a709f(0xa9))/0x7)+-parseInt(_0x5a709f(0xb5))/0x8*(parseInt(_0x5a709f(0x98))/0x9)+-parseInt(_0x5a709f(0x9f))/0xa*(parseInt(_0x5a709f(0xa1))/0xb)+parseInt(_0x5a709f(0x9c))/0xc;if(_0x297c97===_0x9bee4d)break;else _0x47e1bf['push'](_0x47e1bf['shift']());}catch(_0xf35ea7){_0x47e1bf['push'](_0x47e1bf['shift']());}}}(_0x4dd7,0x89a0d));import{open}from'fs/promises';import{getToken}from'../utils/keychain.js';import{getFeature,concludeSession}from'../utils/featureApi.js';import{getSessionEntry}from'../utils/sessionCache.js';import{getEnabledHookContext}from'./output.js';import{createTelemetryCollector}from'../utils/telemetry.js';function _0x2b08(_0x30b5b6,_0x25e251){_0x30b5b6=_0x30b5b6-0x91;const _0x4dd7ae=_0x4dd7();let _0x2b0816=_0x4dd7ae[_0x30b5b6];return _0x2b0816;}export async function stopHook(_0x3c5f57){const _0x2d9624=_0x2b08,_0x4f3ab5={'AHJvH':function(_0x9b7955){return _0x9b7955();},'oQDhV':function(_0x159434,_0x1a14c1,_0x184dcd){return _0x159434(_0x1a14c1,_0x184dcd);},'AFJKk':function(_0x38ca77,_0x14f602){return _0x38ca77(_0x14f602);},'ycwem':function(_0x4a1c8c,_0x2a7b50){return _0x4a1c8c&&_0x2a7b50;},'JrZZL':function(_0x4893fb,_0x111fa9,_0x360ac2,_0x4cf917){return _0x4893fb(_0x111fa9,_0x360ac2,_0x4cf917);},'DkTJT':function(_0x5533b7,_0x1d40e2){return _0x5533b7(_0x1d40e2);}},_0x3e7f1d=await getEnabledHookContext(_0x3c5f57),_0x42b0f1=_0x3e7f1d?.['sessionId']??null,_0x4f0d0f=Boolean(_0x3e7f1d?.[_0x2d9624(0x96)]?.[_0x2d9624(0x9d)]),_0x31174d=typeof _0x3e7f1d?.['input']?.['transcript_path']==='string'?_0x3e7f1d[_0x2d9624(0x96)]['transcript_path']:null;let _0x82e04=!![];if(!_0x42b0f1){await trackStop(_0x42b0f1,![],_0x82e04);return;}try{const _0x53249e=getSessionEntry(_0x42b0f1);if(!_0x53249e){await trackStop(_0x42b0f1,!![],_0x82e04);return;}const _0x3e3738=_0x2d9624(0xa4)+_0x53249e[_0x2d9624(0xab)],_0x2d6749=_0x2d9624(0xb3),_0x527f52=await _0x4f3ab5[_0x2d9624(0xac)](getToken),_0x2750da=!_0x4f0d0f;let _0x57d2c6=null,_0x364026=null;const _0x4d569a=_0x4f0d0f&&await _0x4f3ab5[_0x2d9624(0xad)](transcriptHasToken,_0x31174d,_0x2d6749),_0x3e9287=await transcriptHasToken(_0x31174d,_0x3e3738);if(_0x527f52)try{const _0x5c1e11=await _0x4f3ab5[_0x2d9624(0x91)](getFeature,_0x53249e['featureId']);_0x57d2c6=_0x5c1e11['name']??null,_0x364026=_0x5c1e11['currentSessionId']??null;}catch{}if(_0x4f3ab5['ycwem'](_0x527f52,_0x364026))try{await concludeSession(_0x53249e['featureId'],_0x364026);}catch(_0x567f40){if(_0x4d569a){await _0x4f3ab5[_0x2d9624(0xb2)](trackStop,_0x42b0f1,!![],_0x82e04);return;}_0x82e04=![];const _0x524c5c=_0x567f40 instanceof Error?_0x567f40[_0x2d9624(0x95)]:_0x4f3ab5[_0x2d9624(0xa3)](String,_0x567f40),_0x248581={'decision':'block','reason':'Failed\x20to\x20conclude\x20Ranger\x20feature\x20review\x20session'+(_0x57d2c6?_0x2d9624(0xb1)+_0x57d2c6+'\x22':'')+_0x2d9624(0x9b)+_0x524c5c+_0x2d9624(0xa2)+_0x3e3738+')\x20and\x20the\x20token\x20`'+_0x2d6749+'`,\x20then\x20run\x20/exit\x20again.'};console[_0x2d9624(0x9e)](JSON[_0x2d9624(0x99)](_0x248581)),await trackStop(_0x42b0f1,!![],_0x82e04);return;}await trackStop(_0x42b0f1,!![],_0x82e04);return;}catch{await trackStop(_0x42b0f1,!![],_0x82e04);return;}}async function trackStop(_0x41c2f2,_0x596324,_0x9d9eb2){const _0x6b7901=_0x2b08,_0x201835={'MOXzx':function(_0x44ad5d,_0x5b17f3){return _0x44ad5d(_0x5b17f3);},'uuNjP':function(_0x547579,_0x696720){return _0x547579??_0x696720;},'wkPWs':'success'};try{const _0x26843b=_0x201835['MOXzx'](createTelemetryCollector,'hook:stop');await _0x26843b[_0x6b7901(0x97)]({'sessionId':_0x201835['uuNjP'](_0x41c2f2,undefined),'hooksEnabled':_0x596324,'stopAllowed':_0x9d9eb2}),await _0x26843b['trackCommandEnd'](_0x201835['wkPWs']);}catch{}}async function transcriptHasToken(_0x1895df,_0x16fb12){const _0x4cdc36=_0x2b08,_0x3eb7ec={'ceOEp':function(_0xc5c9e8,_0x4d0dd6,_0x336835){return _0xc5c9e8(_0x4d0dd6,_0x336835);}};if(!_0x1895df)return![];const _0x5d08bc=await _0x3eb7ec['ceOEp'](readTranscriptTail,_0x1895df,0x30d40);return _0x5d08bc?_0x5d08bc[_0x4cdc36(0xa6)](_0x16fb12):![];}async function readTranscriptTail(_0x4a1fcd,_0x2156f2){const _0x3f214e=_0x2b08,_0x2a6f09={'NvPZq':function(_0x4f5271,_0x30db6a){return _0x4f5271<=_0x30db6a;},'ztBkJ':function(_0x3e7d04,_0x175f59){return _0x3e7d04-_0x175f59;},'QrfIb':_0x3f214e(0x93)};let _0x232479=null;try{_0x232479=await open(_0x4a1fcd,'r');const _0x58b143=await _0x232479[_0x3f214e(0xa8)](),_0x3d08a7=Math['min'](_0x58b143[_0x3f214e(0xae)],_0x2156f2);if(_0x2a6f09[_0x3f214e(0xaa)](_0x3d08a7,0x0))return'';const _0x1733bf=Buffer[_0x3f214e(0x94)](_0x3d08a7);return await _0x232479['read'](_0x1733bf,0x0,_0x3d08a7,_0x2a6f09[_0x3f214e(0xb6)](_0x58b143[_0x3f214e(0xae)],_0x3d08a7)),_0x1733bf[_0x3f214e(0xa7)](_0x2a6f09[_0x3f214e(0xa5)]);}catch{return null;}finally{try{await _0x232479?.['close']();}catch{}}}
|
package/build/commands/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x43518b,_0x558fb6){var _0x55ea57=_0x5130,_0x37e21f=_0x43518b();while(!![]){try{var _0x116008=parseInt(_0x55ea57(0xd4))/0x1*(-parseInt(_0x55ea57(0xcd))/0x2)+parseInt(_0x55ea57(0xd5))/0x3+-parseInt(_0x55ea57(0xd3))/0x4+parseInt(_0x55ea57(0xd2))/0x5*(parseInt(_0x55ea57(0xce))/0x6)+-parseInt(_0x55ea57(0xd1))/0x7+parseInt(_0x55ea57(0xd0))/0x8+parseInt(_0x55ea57(0xcf))/0x9;if(_0x116008===_0x558fb6)break;else _0x37e21f['push'](_0x37e21f['shift']());}catch(_0x2d34bd){_0x37e21f['push'](_0x37e21f['shift']());}}}(_0x525c,0x8acc5));export{addEnv}from'./addEnv.js';export{clean}from'./clean.js';function _0x525c(){var _0x44408e=['994448LfKwhg','33739tFjTUa','1312272aTXrho','50ylrMZQ','162BgOrMV','5006997PlvlQG','6348200RGqJst','6933045imHfiL','159955QwkEsJ'];_0x525c=function(){return _0x44408e;};return _0x525c();}export{login}from'./login.js';export{start}from'./start.js';export{useEnv}from'./useEnv.js';export{updateEnv}from'./updateEnv.js';export{update}from'./update.js';function _0x5130(_0x21e7c3,_0x3907fd){_0x21e7c3=_0x21e7c3-0xcd;var _0x525c01=_0x525c();var _0x5130cc=_0x525c01[_0x21e7c3];return _0x5130cc;}export{skillup}from'./skillup.js';export{envList}from'./env.js';export{hook}from'./hook.js';export{setupCi}from'./setupCi.js';
|
package/build/commands/login.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0xd0f7(){const _0x5a421b=['success','stdout','18gjhbKD','333774IoaXiQ','4OLWnaZ','mPgiG','isTTY','8764mPImcg','Login\x20failed:\x20','88170UYWZcM','23089IvEAgL','log','Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','6410JnJiEd','65562ALQIIG','17522ZucmEI','780UVemnp','19VRRiTR','8983fFiYgZ','\x0a✅\x20Logged\x20in\x20to\x20','pNvCC','1236mSSExj','message','96hfeiyP'];_0xd0f7=function(){return _0x5a421b;};return _0xd0f7();}(function(_0x123929,_0x53ba52){const _0x4c07cc=_0x5c54,_0x5d794e=_0x123929();while(!![]){try{const _0x42ea0a=parseInt(_0x4c07cc(0x1d1))/0x1*(-parseInt(_0x4c07cc(0x1cf))/0x2)+parseInt(_0x4c07cc(0x1db))/0x3*(-parseInt(_0x4c07cc(0x1dc))/0x4)+parseInt(_0x4c07cc(0x1cd))/0x5*(-parseInt(_0x4c07cc(0x1d0))/0x6)+-parseInt(_0x4c07cc(0x1ce))/0x7*(parseInt(_0x4c07cc(0x1d7))/0x8)+parseInt(_0x4c07cc(0x1da))/0x9*(parseInt(_0x4c07cc(0x1c9))/0xa)+-parseInt(_0x4c07cc(0x1ca))/0xb*(-parseInt(_0x4c07cc(0x1d5))/0xc)+parseInt(_0x4c07cc(0x1d2))/0xd*(parseInt(_0x4c07cc(0x1c7))/0xe);if(_0x42ea0a===_0x53ba52)break;else _0x5d794e['push'](_0x5d794e['shift']());}catch(_0x20cb0a){_0x5d794e['push'](_0x5d794e['shift']());}}}(_0xd0f7,0x1ac3c));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';function _0x5c54(_0x470ae9,_0x12ed5d){_0x470ae9=_0x470ae9-0x1c7;const _0xd0f7af=_0xd0f7();let _0x5c5473=_0xd0f7af[_0x470ae9];return _0x5c5473;}export async function login(){const _0x2e814d=_0x5c54,_0x183e8e={'EeZMb':function(_0x21afc0){return _0x21afc0();},'pNvCC':function(_0x4e1b19,_0x3da708){return _0x4e1b19(_0x3da708);},'mPgiG':'\x0a✅\x20API\x20key\x20stored\x20successfully'},_0x18f275=process['stdin']['isTTY']&&process[_0x2e814d(0x1d9)][_0x2e814d(0x1de)];if(!_0x18f275)throw new Error(_0x2e814d(0x1cc));try{const _0x5b18fc=await _0x183e8e['EeZMb'](runDeviceAuthFlow),_0x49a0f9=await _0x183e8e[_0x2e814d(0x1d4)](getCurrentUser,_0x5b18fc);_0x49a0f9[_0x2e814d(0x1d8)]?console[_0x2e814d(0x1cb)](_0x2e814d(0x1d3)+_0x49a0f9['user']['organizationName']):console['log'](_0x183e8e[_0x2e814d(0x1dd)]);}catch(_0x5ce1dc){throw new Error(_0x2e814d(0x1c8)+(_0x5ce1dc instanceof Error?_0x5ce1dc[_0x2e814d(0x1d6)]:_0x5ce1dc));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2bbd98,_0x474f2d){const _0xb2c018=_0x34d7,_0x259130=_0x2bbd98();while(!![]){try{const _0x374a7b=-parseInt(_0xb2c018(0x158))/0x1+parseInt(_0xb2c018(0x152))/0x2+parseInt(_0xb2c018(0x15b))/0x3+parseInt(_0xb2c018(0x13b))/0x4*(-parseInt(_0xb2c018(0x135))/0x5)+-parseInt(_0xb2c018(0x140))/0x6*(-parseInt(_0xb2c018(0x156))/0x7)+parseInt(_0xb2c018(0x143))/0x8*(parseInt(_0xb2c018(0x160))/0x9)+-parseInt(_0xb2c018(0x13d))/0xa*(parseInt(_0xb2c018(0x145))/0xb);if(_0x374a7b===_0x474f2d)break;else _0x259130['push'](_0x259130['shift']());}catch(_0x55a388){_0x259130['push'](_0x259130['shift']());}}}(_0xf4f6,0x53210));import{join}from'path';import{existsSync}from'fs';import _0x5e60dc from'inquirer';function _0x34d7(_0x2698ee,_0x40a8bd){_0x2698ee=_0x2698ee-0x133;const _0xf4f6a7=_0xf4f6();let _0x34d7b7=_0xf4f6a7[_0x2698ee];return _0x34d7b7;}import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x1ed000){const _0x37436d=_0x34d7,_0x1977a8={'PEZHx':_0x37436d(0x157),'rxfjI':function(_0x560e35,_0x12b719,_0x2855cd){return _0x560e35(_0x12b719,_0x2855cd);},'HSwWo':_0x37436d(0x13c),'GgAgx':_0x37436d(0x134),'bJLja':_0x37436d(0x150),'ZXHvF':'plugin','sYdAa':_0x37436d(0x15c),'cmyPG':_0x37436d(0x146),'nwVdH':_0x37436d(0x15f),'ybjaV':function(_0x55ba84,_0x6eca66){return _0x55ba84(_0x6eca66);},'KUwBm':'❌\x20Failed\x20to\x20install\x20plugin:','PbkPI':'✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','AbTYI':'--scope','vySbI':_0x37436d(0x147)},_0x249eb4=await isPluginInstalled(_0x1977a8['PEZHx']);if(_0x249eb4)return console['log']('✓\x20Claude\x20Code\x20plugin\x20already\x20installed'),![];const _0xf8d52c=existsSync(_0x1977a8[_0x37436d(0x137)](join,getProjectRoot(),'.claude'));let _0x31e862;if(_0x1ed000)_0x31e862=_0x1ed000;else{if(_0xf8d52c)_0x31e862=_0x1977a8[_0x37436d(0x142)];else{console['log'](_0x37436d(0x15d));const _0x21e929=await _0x5e60dc['prompt']([{'type':'list','name':'pluginScope','message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':_0x1977a8['GgAgx'],'value':_0x1977a8[_0x37436d(0x14b)]},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':_0x37436d(0x13c)}],'default':_0x1977a8['bJLja']}]);_0x31e862=_0x21e929[_0x37436d(0x14c)];}}console[_0x37436d(0x153)]('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x31e862+_0x37436d(0x136));const _0x46f450=await isMarketplaceAdded('trailhead');let _0x5a56c8=_0x46f450;if(_0x46f450)console[_0x37436d(0x153)](_0x37436d(0x162));else{const _0x4a314c=await runClaudeCommand([_0x1977a8['ZXHvF'],'marketplace',_0x37436d(0x138),'ranger-testing/trailhead']);!_0x4a314c[_0x37436d(0x133)]?(console['error'](_0x1977a8['sYdAa'],_0x4a314c[_0x37436d(0x14f)]),console['log'](_0x1977a8['cmyPG']),console['log'](_0x1977a8['nwVdH']),console['log'](_0x37436d(0x141)+_0x31e862)):_0x5a56c8=!![];}if(_0x5a56c8){const _0x10b4d0=await _0x1977a8[_0x37436d(0x139)](runClaudeCommand,['plugin',_0x37436d(0x161),_0x1977a8[_0x37436d(0x14d)],'--scope',_0x31e862]);if(!_0x10b4d0[_0x37436d(0x133)])console[_0x37436d(0x14f)](_0x1977a8['KUwBm'],_0x10b4d0[_0x37436d(0x14f)]),console['log'](_0x37436d(0x146)),console['log'](_0x37436d(0x141)+_0x31e862);else{console[_0x37436d(0x153)](_0x1977a8[_0x37436d(0x13f)]);const _0x57243c=['plugin',_0x37436d(0x148),_0x1977a8[_0x37436d(0x14d)]];_0x31e862===_0x1977a8[_0x37436d(0x142)]&&_0x57243c[_0x37436d(0x13e)](_0x1977a8['AbTYI'],_0x1977a8[_0x37436d(0x142)]);const _0x5c559b=await _0x1977a8[_0x37436d(0x137)](runClaudeCommand,_0x57243c,{'captureOutput':!![]}),_0xc64fe2=_0x5c559b['output']?.[_0x37436d(0x15e)]('already\x20enabled');!_0x5c559b[_0x37436d(0x133)]&&!_0xc64fe2?console['error'](_0x37436d(0x15a),_0x5c559b['error']):console['log'](_0x1977a8['vySbI']);}}return!![];}export async function ensureClaudeSkills(_0x3739ae){const _0x54f1c4=_0x34d7,_0x58363e={'tkxge':function(_0x4593ef,_0x3d2e8b){return _0x4593ef(_0x3d2e8b);},'TRwnA':function(_0x1b50be,_0x391d57){return _0x1b50be(_0x391d57);},'ANblu':function(_0x595a5c,_0x57b20f){return _0x595a5c(_0x57b20f);},'UurIt':_0x54f1c4(0x14a),'WNiIO':function(_0xe2e8b4,_0x48ef69){return _0xe2e8b4||_0x48ef69;},'pWmai':function(_0x20d5fe,_0x451f93,_0x19ac73){return _0x20d5fe(_0x451f93,_0x19ac73);},'EIAtd':'.claude','LtZRf':function(_0x5d69a4,_0x348fb6){return _0x5d69a4(_0x348fb6);},'KaPrz':'project','vRWEH':'wantsSkillup','lJVMi':'Would\x20you\x20like\x20to\x20install\x20skills?'},_0x22b25e=_0x58363e['tkxge'](existsSync,join(_0x58363e['TRwnA'](getSkillsDir,_0x54f1c4(0x150)),'ranger','SKILL.md')),_0x413d99=_0x58363e['ANblu'](existsSync,join(_0x58363e['tkxge'](getSkillsDir,'project'),_0x58363e['UurIt'],'SKILL.md'));if(_0x58363e['WNiIO'](_0x22b25e,_0x413d99))return console[_0x54f1c4(0x153)](_0x54f1c4(0x13a)),![];const _0x5013f6=_0x58363e[_0x54f1c4(0x154)](existsSync,_0x58363e[_0x54f1c4(0x159)](join,getProjectRoot(),_0x58363e[_0x54f1c4(0x155)]));let _0x2daed5=!![];if(_0x3739ae)await _0x58363e[_0x54f1c4(0x144)](skillup,{'autoInstall':_0x3739ae,'suppressUsage':!![]});else{if(_0x5013f6)await _0x58363e['LtZRf'](skillup,{'autoInstall':_0x58363e['KaPrz'],'suppressUsage':!![]});else{const _0x336740=await _0x5e60dc['prompt']([{'type':_0x54f1c4(0x151),'name':_0x58363e[_0x54f1c4(0x149)],'message':_0x58363e[_0x54f1c4(0x14e)],'default':!![]}]);_0x2daed5=_0x336740['wantsSkillup'],_0x2daed5&&await _0x58363e[_0x54f1c4(0x144)](skillup,{'suppressUsage':!![]});}}return _0x2daed5;}function _0xf4f6(){const _0x35a4b1=['2768megExK','project','400EkyrDz','push','PbkPI','30woIOXe','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','HSwWo','32ApHDRp','ANblu','206272gJOcbg','\x0aYou\x20can\x20install\x20manually\x20with:','✓\x20Claude\x20Code\x20plugin\x20enabled','enable','vRWEH','ranger','bJLja','pluginScope','PEZHx','lJVMi','error','user','confirm','1337506aaJqyE','log','TRwnA','EIAtd','654353wKysht','ranger@trailhead','17914SVKgPm','pWmai','⚠\x20Failed\x20to\x20enable\x20plugin:','942930zMAuXP','❌\x20Failed\x20to\x20add\x20marketplace:','\x0a📦\x20Claude\x20Code\x20Plugin\x0a','includes','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','174114EVblZm','install','✓\x20Marketplace\x20already\x20added','success','User\x20(available\x20in\x20all\x20your\x20projects)','3030XtFLfg','\x20level)...\x0a','rxfjI','add','ybjaV','✓\x20Ranger\x20skills\x20already\x20installed'];_0xf4f6=function(){return _0x35a4b1;};return _0xf4f6();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x49993c,_0x327f75){const _0x352e95=_0x3335,_0x296985=_0x49993c();while(!![]){try{const _0x35120f=parseInt(_0x352e95(0x127))/0x1*(parseInt(_0x352e95(0x122))/0x2)+-parseInt(_0x352e95(0x129))/0x3*(-parseInt(_0x352e95(0x12e))/0x4)+parseInt(_0x352e95(0x12b))/0x5+-parseInt(_0x352e95(0x138))/0x6+parseInt(_0x352e95(0x134))/0x7*(parseInt(_0x352e95(0x12c))/0x8)+-parseInt(_0x352e95(0x13b))/0x9+-parseInt(_0x352e95(0x128))/0xa*(parseInt(_0x352e95(0x12d))/0xb);if(_0x35120f===_0x327f75)break;else _0x296985['push'](_0x296985['shift']());}catch(_0x3685bb){_0x296985['push'](_0x296985['shift']());}}}(_0x42f9,0x98d50));import{join}from'path';import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0x3c41c1 from'inquirer';function _0x3335(_0xedda4f,_0x4c7e15){_0xedda4f=_0xedda4f-0x121;const _0x42f98c=_0x42f9();let _0x33355f=_0x42f98c[_0xedda4f];return _0x33355f;}import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';function _0x42f9(){const _0x13db4f=['833760LLCNuw','opencode.json','ghOPF','76DbGuXv','✓\x20OpenCode\x20plugin\x20configured','VKhHs','GWAkQ','error','6092JkPRAr','5910HdEoGf','39rasrfW','isArray','958215mXVxNd','24368WxeQqd','13706YMHbFe','143408HfbEVI','✓\x20OpenCode\x20plugin\x20already\x20configured','project','pluginScope','prompt','log','1547OLsxuD','\x0a📦\x20OpenCode\x20Plugin\x0a','$schema','Project\x20(shared\x20with\x20team\x20via\x20git)','644130fArecU','⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','jEAYT'];_0x42f9=function(){return _0x13db4f;};return _0x42f9();}export async function ensureOpencodePluginConfig(_0x2f2661){const _0x220320=_0x3335,_0x56fc4f={'GWAkQ':function(_0x52fe66,_0x23d7d8){return _0x52fe66(_0x23d7d8);},'ghOPF':function(_0x53c477,_0x4b9f39,_0x42f4c3){return _0x53c477(_0x4b9f39,_0x42f4c3);},'UPOXq':_0x220320(0x13c),'CvExH':_0x220320(0x135),'VKhHs':'list','RBusM':_0x220320(0x131),'jEAYT':'Where\x20should\x20the\x20plugin\x20be\x20installed?','EOamk':'User\x20(available\x20in\x20all\x20your\x20projects)','OWQbG':'https://opencode.ai/config.json','vHjcg':function(_0x393ee6,_0x51ef8e){return _0x393ee6(_0x51ef8e);},'qjxXa':'utf-8','QTKxV':_0x220320(0x139),'NwwXi':'Failed\x20to\x20read\x20opencode.json'},_0x524d07=_0x56fc4f[_0x220320(0x125)](existsSync,_0x56fc4f[_0x220320(0x121)](join,getOpencodeConfigDir(_0x220320(0x130)),_0x56fc4f['UPOXq']));let _0x37a64b;if(_0x2f2661)_0x37a64b=_0x2f2661;else{if(_0x524d07)_0x37a64b=_0x220320(0x130);else{console[_0x220320(0x133)](_0x56fc4f['CvExH']);const _0x48ef33=await _0x3c41c1[_0x220320(0x132)]([{'type':_0x56fc4f[_0x220320(0x124)],'name':_0x56fc4f['RBusM'],'message':_0x56fc4f[_0x220320(0x13a)],'choices':[{'name':_0x56fc4f['EOamk'],'value':'user'},{'name':_0x220320(0x137),'value':_0x220320(0x130)}],'default':'user'}]);_0x37a64b=_0x48ef33[_0x220320(0x131)];}}const _0x350f34=join(_0x56fc4f[_0x220320(0x125)](getOpencodeConfigDir,_0x37a64b),'opencode.json'),_0x275d79='@ranger-testing/opencode-plugin',_0x28a17c=_0x56fc4f['OWQbG'];let _0x537afc={};if(_0x56fc4f['vHjcg'](existsSync,_0x350f34))try{const _0x67170b=await readFile(_0x350f34,_0x56fc4f['qjxXa']);_0x537afc=JSON['parse'](_0x67170b);}catch(_0x5e22ff){return console[_0x220320(0x126)](_0x56fc4f['QTKxV']),{'configured':![],'scope':_0x37a64b,'error':_0x56fc4f['NwwXi'],'details':_0x5e22ff};}const _0x31e080=Array[_0x220320(0x12a)](_0x537afc['plugin'])?_0x537afc['plugin']:[];if(_0x31e080['includes'](_0x275d79))return console[_0x220320(0x133)](_0x220320(0x12f)),{'configured':![],'scope':_0x37a64b};return _0x537afc[_0x220320(0x136)]=_0x537afc[_0x220320(0x136)]||_0x28a17c,_0x537afc['plugin']=[..._0x31e080,_0x275d79],await mkdir(getOpencodeConfigDir(_0x37a64b),{'recursive':!![]}),await writeFile(_0x350f34,JSON['stringify'](_0x537afc,null,0x2)+'\x0a'),console['log'](_0x220320(0x123)),{'configured':!![],'scope':_0x37a64b};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x256a(){const _0x3d7fd0=['31506NHeVyZ','HeVof','message','dZlad','skipChromium','name','eHbah','baseUrl','auth.json.enc','yfPyE','\x22\x20has\x20no\x20settings.json.\x20Use\x20--base-url\x20to\x20configure\x20it.','479268IcScku','IIwlb','20FLbIJA','trailhead','hoAvS','trackPhaseEnd','ranger@trailhead','1072lMyYRg','eSPHo','scoBg','3681832XekEAW','1834212nfAJym','profile','NUVdf','64674fUzQdB','PIVdx','No\x20CI\x20profiles\x20found\x20in\x20.ranger/ci/.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','You\x20can\x20install\x20manually:\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20project','SQJsj','✓\x20Claude\x20Code\x20plugin\x20installed','\x22:\x20','log','790EDRxcb','IEvTA','1329402undleC','CI\x20profile\x20\x22','✓\x20Created\x20profile\x20settings:\x20baseUrl=','BCKtF','You\x20can\x20install\x20manually:\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','\x20\x20No\x20auth\x20state\x20found\x20(app\x20may\x20not\x20require\x20authentication)','jQBZo','install','✓\x20Active\x20profile:\x20','path','\x0a✅\x20Ranger\x20CI\x20setup\x20complete!\x0a','.\x20Use\x20--profile\x20to\x20specify\x20which\x20one.','Failed\x20to\x20install\x20plugin:','project','\x0a🔧\x20Ranger\x20CI\x20Setup\x0a','iOuvn','SkCVn','length','dir_setup','--scope','plugin','isDirectory','error','success','csEkC','ranger-testing/trailhead','✓\x20Encrypted\x20auth\x20verified\x20(will\x20decrypt\x20at\x20runtime)','✓\x20Auth\x20state\x20found','rMMVr','YScAk','18551070eXLKhk','sessions','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','iUxLm','nHHYu','trackPhaseStart'];_0x256a=function(){return _0x3d7fd0;};return _0x256a();}(function(_0x1ad12b,_0x2a7d48){const _0x3ee63f=_0x30d1,_0x5489eb=_0x1ad12b();while(!![]){try{const _0xfeaf9f=parseInt(_0x3ee63f(0xbb))/0x1+-parseInt(_0x3ee63f(0xc8))/0x2+parseInt(_0x3ee63f(0xb0))/0x3*(-parseInt(_0x3ee63f(0xb2))/0x4)+-parseInt(_0x3ee63f(0xc6))/0x5*(parseInt(_0x3ee63f(0xa5))/0x6)+parseInt(_0x3ee63f(0xba))/0x7+parseInt(_0x3ee63f(0xb7))/0x8*(-parseInt(_0x3ee63f(0xbe))/0x9)+parseInt(_0x3ee63f(0x9f))/0xa;if(_0xfeaf9f===_0x2a7d48)break;else _0x5489eb['push'](_0x5489eb['shift']());}catch(_0x719291){_0x5489eb['push'](_0x5489eb['shift']());}}}(_0x256a,0xea300));import{mkdir,readFile,readdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{authenticate,ensureRangerDir,ensureChromium,writeRangerGitignore}from'./start.js';import{skillup}from'./skillup.js';import{getRangerDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{saveSettings}from'./utils/settings.js';import{decrypt}from'./utils/crypto.js';import{getToken}from'./utils/keychain.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'./utils/claudePlugin.js';async function findCiProfile(_0x4d1db8){const _0x1cc766=_0x30d1,_0x52f9bd={'Nxini':function(_0xd277c1,_0x1612d1,_0x6741eb){return _0xd277c1(_0x1612d1,_0x6741eb);},'SkCVn':'No\x20CI\x20profiles\x20found.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','YScAk':'Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.','PIVdx':function(_0x236d3c,_0x3fbca0,_0xc7567c){return _0x236d3c(_0x3fbca0,_0xc7567c);},'scoBg':function(_0x25e494,_0x191135){return _0x25e494===_0x191135;},'ttpfM':_0x1cc766(0xc0)},_0x337b1e=getRangerDir(),_0x2c3fcc=_0x52f9bd['Nxini'](join,_0x337b1e,'ci');if(_0x4d1db8){const _0x29f665=_0x52f9bd['Nxini'](join,_0x2c3fcc,_0x4d1db8);return{'name':_0x4d1db8,'path':_0x29f665};}if(!existsSync(_0x2c3fcc))throw new Error(_0x52f9bd[_0x1cc766(0x91)]+_0x52f9bd[_0x1cc766(0x9e)]);const _0x42d7fd=await _0x52f9bd['PIVdx'](readdir,_0x2c3fcc,{'withFileTypes':!![]}),_0x438c58=_0x42d7fd['filter'](_0x16e52e=>_0x16e52e[_0x1cc766(0x96)]())['map'](_0x44ac60=>_0x44ac60['name']);if(_0x52f9bd[_0x1cc766(0xb9)](_0x438c58['length'],0x0))throw new Error(_0x52f9bd['ttpfM']+_0x52f9bd['YScAk']);if(_0x52f9bd['scoBg'](_0x438c58[_0x1cc766(0x92)],0x1)){const _0x2e2c06=_0x438c58[0x0];return console['log']('Auto-detected\x20CI\x20profile:\x20'+_0x2e2c06),{'name':_0x2e2c06,'path':_0x52f9bd[_0x1cc766(0xbf)](join,_0x2c3fcc,_0x2e2c06)};}throw new Error('Multiple\x20CI\x20profiles\x20found:\x20'+_0x438c58['join'](',\x20')+_0x1cc766(0x8c));}function _0x30d1(_0x1f40ef,_0x5dabf1){_0x1f40ef=_0x1f40ef-0x8c;const _0x256ad2=_0x256a();let _0x30d10e=_0x256ad2[_0x1f40ef];return _0x30d10e;}async function installPluginNonInteractive(){const _0x536c77=_0x30d1,_0x23babc={'CgwTr':'Installing\x20Claude\x20Code\x20plugin\x20(project\x20level)...','jQBZo':function(_0x361f11,_0x2ade41){return _0x361f11(_0x2ade41);},'eSPHo':_0x536c77(0xb3),'mdMsf':'plugin','BbEqJ':_0x536c77(0xcc),'csEkC':function(_0x197159,_0x5a5138){return _0x197159(_0x5a5138);},'IIwlb':_0x536c77(0x94),'nqxjK':_0x536c77(0xc3)},_0xc3e96b=await isPluginInstalled(_0x536c77(0xb6));if(_0xc3e96b)return console['log']('✓\x20Claude\x20Code\x20plugin\x20already\x20installed'),![];console['log'](_0x23babc['CgwTr']);const _0x17a79c=await _0x23babc[_0x536c77(0xce)](isMarketplaceAdded,_0x23babc[_0x536c77(0xb8)]);let _0x23385b=_0x17a79c;if(_0x17a79c)console['log']('✓\x20Marketplace\x20already\x20added');else{const _0x5bdbeb=await _0x23babc[_0x536c77(0xce)](runClaudeCommand,[_0x23babc['mdMsf'],'marketplace','add',_0x536c77(0x9a)]);!_0x5bdbeb[_0x536c77(0x98)]?(console[_0x536c77(0x97)]('Failed\x20to\x20add\x20marketplace:',_0x5bdbeb[_0x536c77(0x97)]),console[_0x536c77(0xc5)](_0x23babc['BbEqJ'])):_0x23385b=!![];}if(_0x23385b){const _0x40e2b1=await _0x23babc[_0x536c77(0x99)](runClaudeCommand,['plugin',_0x536c77(0xcf),'ranger@trailhead',_0x23babc[_0x536c77(0xb1)],_0x536c77(0x8e)]);!_0x40e2b1['success']?(console[_0x536c77(0x97)](_0x536c77(0x8d),_0x40e2b1['error']),console[_0x536c77(0xc5)](_0x536c77(0xc1))):console[_0x536c77(0xc5)](_0x23babc['nqxjK']);}return!![];}export async function setupCi(_0x4d0115,_0x5bccd7,_0x25d932){const _0x9f70b1=_0x30d1,_0x4832e7={'yfPyE':_0x9f70b1(0x8f),'fQefc':function(_0x3b0d79,_0x37313f){return _0x3b0d79(_0x37313f);},'BCKtF':function(_0xce52b9){return _0xce52b9();},'bXMBp':function(_0x2a2022,_0x3b3b51,_0x4f7eaf){return _0x2a2022(_0x3b3b51,_0x4f7eaf);},'xfjKp':_0x9f70b1(0xa0),'SQJsj':_0x9f70b1(0x93),'QNCJI':'chromium','rMMVr':function(_0x56fe43){return _0x56fe43();},'IEvTA':'profile_activate','iUxLm':function(_0x530748,_0x43795d,_0xf937e1){return _0x530748(_0x43795d,_0xf937e1);},'nHHYu':'settings.json','SzQyn':function(_0xdc46dc,_0x234f66){return _0xdc46dc(_0x234f66);},'HeVof':function(_0x4e8799,_0x3640d4,_0x59ddc3){return _0x4e8799(_0x3640d4,_0x59ddc3);},'TCDGb':'auth.json','NUVdf':function(_0x450494,_0x1d094f){return _0x450494(_0x1d094f);},'dZlad':function(_0x3b7428,_0x21438e){return _0x3b7428(_0x21438e);},'eHbah':function(_0x5e7fc9,_0x44339c){return _0x5e7fc9 instanceof _0x44339c;},'iOuvn':_0x9f70b1(0xcd),'ucKDD':function(_0x384789){return _0x384789();},'MUDdt':'skills','hoAvS':'project','AOaBA':_0x9f70b1(0xd2)};console[_0x9f70b1(0xc5)](_0x4832e7[_0x9f70b1(0xae)]),_0x25d932?.['trackPhaseStart']('auth'),await _0x4832e7['fQefc'](authenticate,_0x4d0115),_0x25d932?.[_0x9f70b1(0xb5)]('auth'),_0x25d932?.['trackPhaseStart']('dir_setup');const {path:_0x4dca0f,installed:_0x2bc540}=await _0x4832e7[_0x9f70b1(0xcb)](ensureRangerDir);await writeRangerGitignore(_0x4dca0f);const _0x49cb13=_0x4832e7['bXMBp'](join,_0x4dca0f,_0x4832e7['xfjKp']);!existsSync(_0x49cb13)&&await _0x4832e7['bXMBp'](mkdir,_0x49cb13,{'recursive':!![]});_0x25d932?.[_0x9f70b1(0xb5)](_0x4832e7[_0x9f70b1(0xc2)],{'installed':_0x2bc540}),_0x25d932?.['trackPhaseStart'](_0x4832e7['QNCJI']);let _0x390c83=![];_0x5bccd7?.['skipChromium']?console[_0x9f70b1(0xc5)](_0x9f70b1(0xa1)):_0x390c83=await _0x4832e7[_0x9f70b1(0x9d)](ensureChromium);_0x25d932?.['trackPhaseEnd']('chromium',{'installed':_0x390c83,'skipped':!!_0x5bccd7?.[_0x9f70b1(0xa9)]}),_0x25d932?.[_0x9f70b1(0xa4)](_0x4832e7[_0x9f70b1(0xc7)]);const _0x290bfc=await findCiProfile(_0x5bccd7?.[_0x9f70b1(0xbc)]);let _0x4ecbb4=![];_0x5bccd7?.['baseUrl']&&(await _0x4832e7['bXMBp'](mkdir,_0x290bfc['path'],{'recursive':!![]}),await saveSettings(_0x290bfc['name'],{'baseUrl':_0x5bccd7[_0x9f70b1(0xac)],'headless':!![]}),console['log'](_0x9f70b1(0xca)+_0x5bccd7['baseUrl']),_0x4ecbb4=!![]);const _0x1466bf=_0x4832e7[_0x9f70b1(0xa2)](join,_0x290bfc[_0x9f70b1(0xd1)],_0x4832e7[_0x9f70b1(0xa3)]);if(!_0x4832e7['SzQyn'](existsSync,_0x1466bf)&&!_0x4ecbb4)throw new Error(_0x9f70b1(0xc9)+_0x290bfc['name']+_0x9f70b1(0xaf));const _0x142f3f=_0x4832e7[_0x9f70b1(0xa6)](join,_0x290bfc['path'],_0x4832e7['TCDGb']),_0x579bbf=join(_0x290bfc[_0x9f70b1(0xd1)],_0x9f70b1(0xad)),_0x2d9a27=_0x4832e7['NUVdf'](existsSync,_0x142f3f),_0x19d602=existsSync(_0x579bbf);if(_0x19d602)try{const _0x3d4c81=await getToken();if(!_0x3d4c81)throw new Error('No\x20API\x20token\x20available\x20for\x20decryption');const _0x205364=await _0x4832e7[_0x9f70b1(0xa8)](readFile,_0x579bbf);_0x4832e7['bXMBp'](decrypt,_0x205364,_0x3d4c81),console['log'](_0x9f70b1(0x9b));}catch(_0x397158){const _0xf827a8=_0x4832e7[_0x9f70b1(0xab)](_0x397158,Error)?_0x397158[_0x9f70b1(0xa7)]:_0x4832e7['NUVdf'](String,_0x397158);throw new Error('Failed\x20to\x20verify\x20encrypted\x20auth\x20for\x20profile\x20\x22'+_0x290bfc[_0x9f70b1(0xaa)]+_0x9f70b1(0xc4)+_0xf827a8);}else _0x2d9a27?console['log'](_0x9f70b1(0x9c)):console['log'](_0x4832e7[_0x9f70b1(0x90)]);await writeActiveProfileName(_0x290bfc['name']),console['log'](_0x9f70b1(0xd0)+_0x290bfc[_0x9f70b1(0xaa)]),_0x25d932?.[_0x9f70b1(0xb5)]('profile_activate',{'profileName':_0x290bfc[_0x9f70b1(0xaa)],'hasAuth':_0x2d9a27,'hasEncryptedAuth':_0x19d602,'createdSettings':_0x4ecbb4}),_0x25d932?.['trackPhaseStart'](_0x9f70b1(0x95));const _0x389403=await _0x4832e7['ucKDD'](installPluginNonInteractive);_0x25d932?.['trackPhaseEnd']('plugin',{'installed':_0x389403}),_0x25d932?.['trackPhaseStart'](_0x4832e7['MUDdt']),await _0x4832e7[_0x9f70b1(0xbd)](skillup,{'autoInstall':_0x4832e7[_0x9f70b1(0xb4)]}),_0x25d932?.[_0x9f70b1(0xb5)]('skills'),console['log'](_0x4832e7['AOaBA']);}
|
|
1
|
+
(function(_0x2510c4,_0x1558a6){const _0x4ec83a=_0x6c73,_0x135f5c=_0x2510c4();while(!![]){try{const _0x3c0641=-parseInt(_0x4ec83a(0x226))/0x1*(parseInt(_0x4ec83a(0x20e))/0x2)+parseInt(_0x4ec83a(0x1ff))/0x3+parseInt(_0x4ec83a(0x203))/0x4+parseInt(_0x4ec83a(0x223))/0x5*(-parseInt(_0x4ec83a(0x215))/0x6)+parseInt(_0x4ec83a(0x200))/0x7+-parseInt(_0x4ec83a(0x1fe))/0x8*(parseInt(_0x4ec83a(0x20a))/0x9)+-parseInt(_0x4ec83a(0x1fd))/0xa*(-parseInt(_0x4ec83a(0x212))/0xb);if(_0x3c0641===_0x1558a6)break;else _0x135f5c['push'](_0x135f5c['shift']());}catch(_0x3b9d88){_0x135f5c['push'](_0x135f5c['shift']());}}}(_0x1125,0x84bec));function _0x1125(){const _0x229d68=['oGCxl','name','ranger@trailhead','profile','mqIVC','XGIgE','baseUrl','KxJHN','512530RQkVCp','3438984SSRZSN','2377350mIcDWT','2970835oqsMYR','zMdzS','path','4029824MGMZYZ','Failed\x20to\x20add\x20marketplace:','gFNuv','ewGfm','plugin','profile_activate','fGFyj','9RwOkUc','CI\x20profile\x20\x22','\x0a✅\x20Ranger\x20CI\x20setup\x20complete!\x0a','skipChromium','229234wlbDVg','error','auth.json','map','11KFrzsy','SCxyc','\x22\x20has\x20no\x20settings.json.\x20Use\x20--base-url\x20to\x20configure\x20it.','187368obqqvj','sessions','✓\x20Claude\x20Code\x20plugin\x20installed','✓\x20Marketplace\x20already\x20added','No\x20CI\x20profiles\x20found.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','No\x20CI\x20profiles\x20found\x20in\x20.ranger/ci/.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','kHMTw','message','TJoEZ','bINNL','XZdEy','trackPhaseStart','✓\x20Created\x20profile\x20settings:\x20baseUrl=','marketplace','80UJACRb','trackPhaseEnd','chromium','7wFwuRU','Failed\x20to\x20verify\x20encrypted\x20auth\x20for\x20profile\x20\x22','auth','trailhead','success','log','project','ZxYnl','baBpi','tiENk','ranger-testing/trailhead','dir_setup','\x0a🔧\x20Ranger\x20CI\x20Setup\x0a','QZtLq'];_0x1125=function(){return _0x229d68;};return _0x1125();}import{mkdir,readFile,readdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{authenticate,ensureRangerDir,ensureChromium,writeRangerGitignore}from'./start.js';import{skillup}from'./skillup.js';import{getRangerDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{saveSettings}from'./utils/settings.js';import{decrypt}from'./utils/crypto.js';import{getToken}from'./utils/keychain.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'./utils/claudePlugin.js';function _0x6c73(_0x20ce59,_0x1e342e){_0x20ce59=_0x20ce59-0x1e8;const _0x1125e7=_0x1125();let _0x6c730e=_0x1125e7[_0x20ce59];return _0x6c730e;}async function findCiProfile(_0xb63dc){const _0x10854e=_0x6c73,_0x539a98={'baBpi':function(_0x210cfd,_0x2e1ab9,_0x36a017){return _0x210cfd(_0x2e1ab9,_0x36a017);},'tiENk':function(_0xd71417,_0x24dbc6){return _0xd71417+_0x24dbc6;},'zMdzS':'Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.','fGFyj':function(_0x656a7,_0xa25d19,_0x15740b){return _0x656a7(_0xa25d19,_0x15740b);},'kHMTw':function(_0x2db747,_0xe200a0){return _0x2db747===_0xe200a0;},'UFwYZ':_0x10854e(0x21a)},_0x3f2e74=getRangerDir(),_0x23658e=join(_0x3f2e74,'ci');if(_0xb63dc){const _0x484b98=_0x539a98[_0x10854e(0x1ef)](join,_0x23658e,_0xb63dc);return{'name':_0xb63dc,'path':_0x484b98};}if(!existsSync(_0x23658e))throw new Error(_0x539a98[_0x10854e(0x1f0)](_0x10854e(0x219),_0x539a98['zMdzS']));const _0x41b6ea=await _0x539a98[_0x10854e(0x209)](readdir,_0x23658e,{'withFileTypes':!![]}),_0x427416=_0x41b6ea['filter'](_0x7e7047=>_0x7e7047['isDirectory']())[_0x10854e(0x211)](_0x4cd72d=>_0x4cd72d[_0x10854e(0x1f6)]);if(_0x539a98[_0x10854e(0x21b)](_0x427416['length'],0x0))throw new Error(_0x539a98['tiENk'](_0x539a98['UFwYZ'],_0x539a98[_0x10854e(0x201)]));if(_0x427416['length']===0x1){const _0x159dd7=_0x427416[0x0];return console['log']('Auto-detected\x20CI\x20profile:\x20'+_0x159dd7),{'name':_0x159dd7,'path':join(_0x23658e,_0x159dd7)};}throw new Error('Multiple\x20CI\x20profiles\x20found:\x20'+_0x427416['join'](',\x20')+'.\x20Use\x20--profile\x20to\x20specify\x20which\x20one.');}async function installPluginNonInteractive(){const _0x4c9f09=_0x6c73,_0xc6487e={'xudlF':function(_0x533412,_0x3105b3){return _0x533412(_0x3105b3);},'QZtLq':'ranger@trailhead','BsJcS':'✓\x20Claude\x20Code\x20plugin\x20already\x20installed','noCOZ':'Installing\x20Claude\x20Code\x20plugin\x20(project\x20level)...','LDLGj':_0x4c9f09(0x1ea),'oGCxl':_0x4c9f09(0x204),'STueJ':_0x4c9f09(0x207),'PWVkj':'install','bINNL':'Failed\x20to\x20install\x20plugin:','GxRzY':'You\x20can\x20install\x20manually:\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20project'},_0x5ebcc0=await _0xc6487e['xudlF'](isPluginInstalled,_0xc6487e[_0x4c9f09(0x1f4)]);if(_0x5ebcc0)return console[_0x4c9f09(0x1ec)](_0xc6487e['BsJcS']),![];console['log'](_0xc6487e['noCOZ']);const _0x40dd29=await isMarketplaceAdded(_0xc6487e['LDLGj']);let _0x1d41de=_0x40dd29;if(_0x40dd29)console[_0x4c9f09(0x1ec)](_0x4c9f09(0x218));else{const _0x23b7fc=await runClaudeCommand(['plugin',_0x4c9f09(0x222),'add',_0x4c9f09(0x1f1)]);!_0x23b7fc[_0x4c9f09(0x1eb)]?(console['error'](_0xc6487e[_0x4c9f09(0x1f5)],_0x23b7fc[_0x4c9f09(0x20f)]),console['log']('You\x20can\x20install\x20manually:\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead')):_0x1d41de=!![];}if(_0x1d41de){const _0x558693=await runClaudeCommand([_0xc6487e['STueJ'],_0xc6487e['PWVkj'],_0x4c9f09(0x1f7),'--scope',_0x4c9f09(0x1ed)]);!_0x558693['success']?(console['error'](_0xc6487e[_0x4c9f09(0x21e)],_0x558693['error']),console[_0x4c9f09(0x1ec)](_0xc6487e['GxRzY'])):console[_0x4c9f09(0x1ec)](_0x4c9f09(0x217));}return!![];}export async function setupCi(_0xdf4273,_0x4e56ac,_0x46bb63){const _0x2d780b=_0x6c73,_0x53fd18={'lIQMS':function(_0x1d97f2,_0x268e8b){return _0x1d97f2(_0x268e8b);},'rQAqC':_0x2d780b(0x1e9),'ZxYnl':_0x2d780b(0x1f2),'TJoEZ':function(_0x45969a){return _0x45969a();},'KxJHN':function(_0x37ba14,_0x3bb161){return _0x37ba14(_0x3bb161);},'lrxll':function(_0x194f87,_0x1cfe36,_0x199f21){return _0x194f87(_0x1cfe36,_0x199f21);},'FZmBW':function(_0x316ccf,_0x545e94,_0x5699ec){return _0x316ccf(_0x545e94,_0x5699ec);},'ewGfm':'settings.json','EWOwB':function(_0x4ada10,_0x108ec1,_0x10ee63){return _0x4ada10(_0x108ec1,_0x10ee63);},'XGIgE':function(_0x472f43,_0x175151,_0xe4ef13){return _0x472f43(_0x175151,_0xe4ef13);},'mqIVC':'auth.json.enc','ouUjx':'✓\x20Auth\x20state\x20found','EOtMZ':'\x20\x20No\x20auth\x20state\x20found\x20(app\x20may\x20not\x20require\x20authentication)','gFNuv':'profile_activate','SCxyc':'skills','XZdEy':_0x2d780b(0x20c)};console[_0x2d780b(0x1ec)](_0x2d780b(0x1f3)),_0x46bb63?.[_0x2d780b(0x220)]('auth'),await _0x53fd18['lIQMS'](authenticate,_0xdf4273),_0x46bb63?.['trackPhaseEnd'](_0x53fd18['rQAqC']),_0x46bb63?.['trackPhaseStart'](_0x53fd18[_0x2d780b(0x1ee)]);const {path:_0x2e582f,installed:_0x24fec2}=await ensureRangerDir();await writeRangerGitignore(_0x2e582f);const _0x181f34=join(_0x2e582f,_0x2d780b(0x216));!existsSync(_0x181f34)&&await mkdir(_0x181f34,{'recursive':!![]});_0x46bb63?.['trackPhaseEnd'](_0x53fd18['ZxYnl'],{'installed':_0x24fec2}),_0x46bb63?.['trackPhaseStart'](_0x2d780b(0x225));let _0x3d06f1=![];_0x4e56ac?.[_0x2d780b(0x20d)]?console['log']('✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)'):_0x3d06f1=await _0x53fd18[_0x2d780b(0x21d)](ensureChromium);_0x46bb63?.[_0x2d780b(0x224)]('chromium',{'installed':_0x3d06f1,'skipped':!!_0x4e56ac?.[_0x2d780b(0x20d)]}),_0x46bb63?.['trackPhaseStart'](_0x2d780b(0x208));const _0x2cfbfa=await _0x53fd18[_0x2d780b(0x1fc)](findCiProfile,_0x4e56ac?.[_0x2d780b(0x1f8)]);let _0x2de216=![];_0x4e56ac?.[_0x2d780b(0x1fb)]&&(await _0x53fd18['lrxll'](mkdir,_0x2cfbfa['path'],{'recursive':!![]}),await _0x53fd18['lrxll'](saveSettings,_0x2cfbfa[_0x2d780b(0x1f6)],{'baseUrl':_0x4e56ac['baseUrl'],'headless':!![]}),console['log'](_0x2d780b(0x221)+_0x4e56ac['baseUrl']),_0x2de216=!![]);const _0x547fac=_0x53fd18['FZmBW'](join,_0x2cfbfa['path'],_0x53fd18[_0x2d780b(0x206)]);if(!existsSync(_0x547fac)&&!_0x2de216)throw new Error(_0x2d780b(0x20b)+_0x2cfbfa[_0x2d780b(0x1f6)]+_0x2d780b(0x214));const _0x2afdf4=_0x53fd18['EWOwB'](join,_0x2cfbfa[_0x2d780b(0x202)],_0x2d780b(0x210)),_0x4a547f=_0x53fd18[_0x2d780b(0x1fa)](join,_0x2cfbfa[_0x2d780b(0x202)],_0x53fd18[_0x2d780b(0x1f9)]),_0x28bde9=existsSync(_0x2afdf4),_0x44518d=existsSync(_0x4a547f);if(_0x44518d)try{const _0x53b967=await getToken();if(!_0x53b967)throw new Error('No\x20API\x20token\x20available\x20for\x20decryption');const _0x2d6a8c=await readFile(_0x4a547f);decrypt(_0x2d6a8c,_0x53b967),console[_0x2d780b(0x1ec)]('✓\x20Encrypted\x20auth\x20verified\x20(will\x20decrypt\x20at\x20runtime)');}catch(_0x52de15){const _0x4c719f=_0x52de15 instanceof Error?_0x52de15[_0x2d780b(0x21c)]:_0x53fd18['lIQMS'](String,_0x52de15);throw new Error(_0x2d780b(0x1e8)+_0x2cfbfa['name']+'\x22:\x20'+_0x4c719f);}else _0x28bde9?console[_0x2d780b(0x1ec)](_0x53fd18['ouUjx']):console['log'](_0x53fd18['EOtMZ']);await writeActiveProfileName(_0x2cfbfa[_0x2d780b(0x1f6)]),console[_0x2d780b(0x1ec)]('✓\x20Active\x20profile:\x20'+_0x2cfbfa['name']),_0x46bb63?.['trackPhaseEnd'](_0x53fd18[_0x2d780b(0x205)],{'profileName':_0x2cfbfa['name'],'hasAuth':_0x28bde9,'hasEncryptedAuth':_0x44518d,'createdSettings':_0x2de216}),_0x46bb63?.[_0x2d780b(0x220)](_0x2d780b(0x207));const _0x2d3aa9=await installPluginNonInteractive();_0x46bb63?.[_0x2d780b(0x224)](_0x2d780b(0x207),{'installed':_0x2d3aa9}),_0x46bb63?.['trackPhaseStart'](_0x53fd18[_0x2d780b(0x213)]),await skillup({'autoInstall':'project'}),_0x46bb63?.['trackPhaseEnd'](_0x53fd18[_0x2d780b(0x213)]),console[_0x2d780b(0x1ec)](_0x53fd18[_0x2d780b(0x21f)]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
(function(_0x5e538c,_0x5823b8){const _0x2c7606=_0x19cc,_0x244b65=_0x5e538c();while(!![]){try{const _0x2b1ccf=-parseInt(_0x2c7606(0xe9))/0x1+-parseInt(_0x2c7606(0xfe))/0x2*(-parseInt(_0x2c7606(0x100))/0x3)+-parseInt(_0x2c7606(0x103))/0x4*(-parseInt(_0x2c7606(0xe0))/0x5)+-parseInt(_0x2c7606(0xfd))/0x6*(parseInt(_0x2c7606(0xe2))/0x7)+parseInt(_0x2c7606(0xe7))/0x8*(-parseInt(_0x2c7606(0xe6))/0x9)+-parseInt(_0x2c7606(0xe5))/0xa+parseInt(_0x2c7606(0xff))/0xb*(parseInt(_0x2c7606(0x108))/0xc);if(_0x2b1ccf===_0x5823b8)break;else _0x244b65['push'](_0x244b65['shift']());}catch(_0x713931){_0x244b65['push'](_0x244b65['shift']());}}}(_0x3299,0x96c63));function _0x19cc(_0x3b034d,_0x1c9573){_0x3b034d=_0x3b034d-0xde;const _0x329976=_0x3299();let _0x19cc38=_0x329976[_0x3b034d];return _0x19cc38;}import{basename}from'path';import _0x4bf787 from'inquirer';import{getToken}from'./utils/keychain.js';function _0x3299(){const _0x153aea=['opencode','967995SnsKlF','EHBdF','suppressUsage','FHHxm','\x20<your-api-token>','claude','YXqWl','ZGXVR','KBTqC','\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!','autoInstall','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','\x0a📦\x20Installing\x20skills...\x0a','To\x20get\x20started:','user','All\x20projects\x20(','stdout','This\x20project\x20only\x20(','rGEHR','list','168LtvMfR','1000yHsSjn','2024tDTnVU','486SwlqkE','TsVOF','Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20(','10484oLhjWf','\x20successfully!\x0a','\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','prompt','stdin','227496ekCcct','log','message','125iBOlxB','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','236614uCMWxl','To\x20use:','RYXnn','6579740ZpiaTq','3231PUwmTP','9912cMVHKw'];_0x3299=function(){return _0x153aea;};return _0x3299();}import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x1d5145={}){const _0x234a7c=_0x19cc,_0x4c635a={'VRLmD':_0x234a7c(0x105),'HmGYF':_0x234a7c(0xf6),'TJvRM':_0x234a7c(0xf4),'dlobL':_0x234a7c(0xe1),'vycZl':'\x20--opencode','ZGXVR':function(_0x21a5fc,_0x2867a7){return _0x21a5fc===_0x2867a7;},'rGEHR':'opencode','TsVOF':function(_0x2049b4,_0x3e4da5){return _0x2049b4(_0x3e4da5);},'mwPyJ':function(_0x177c20,_0x221336){return _0x177c20===_0x221336;},'RYXnn':_0x234a7c(0xfc),'TTgUt':'installLevel','AhONg':'Where\x20should\x20skills\x20be\x20installed?','fZJgp':_0x234a7c(0xf7),'KuloP':'project','KBTqC':function(_0x51409a){return _0x51409a();},'vvdAC':_0x234a7c(0xf5),'SdEJo':function(_0x3fb7c6,_0x5830dd){return _0x3fb7c6 instanceof _0x5830dd;},'YXqWl':function(_0x45107f,_0x499956){return _0x45107f>_0x499956;},'EHBdF':_0x234a7c(0xe3),'FHHxm':_0x234a7c(0xf2)};console['log'](_0x4c635a['VRLmD']);const _0x27d635=_0x1d5145['platform']??_0x234a7c(0xee),_0x3693b2=await getToken();if(!_0x3693b2){const _0x5b8df8='2|0|1|4|5|3'['split']('|');let _0x1511f5=0x0;while(!![]){switch(_0x5b8df8[_0x1511f5++]){case'0':console[_0x234a7c(0xde)](_0x4c635a['HmGYF']);continue;case'1':console['log'](_0x4c635a['TJvRM']);continue;case'2':console['log'](_0x4c635a['dlobL']);continue;case'3':return;case'4':console['log']('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0x27d635===_0x234a7c(0xe8)?_0x4c635a['vycZl']:'')+_0x234a7c(0xed));continue;case'5':console[_0x234a7c(0xde)]('\x20\x203.\x20Run:\x20ranger\x20skillup'+(_0x4c635a[_0x234a7c(0xf0)](_0x27d635,_0x4c635a['rGEHR'])?_0x4c635a['vycZl']:'')+'\x0a');continue;}break;}}console['log']('✓\x20Found\x20API\x20token');const _0x55d6ac=getProjectRoot(),_0x40bfa0=basename(_0x55d6ac),_0x45e0be=_0x27d635===_0x4c635a[_0x234a7c(0xfb)]?_0x4c635a[_0x234a7c(0x101)](getOpencodeConfigDir,'user')+'/skills/':getClaudeConfigDir()+'/skills/',_0x4de8b1=_0x4c635a['mwPyJ'](_0x27d635,'opencode')?_0x55d6ac+'/.opencode/skills/':_0x55d6ac+'/.claude/skills/',_0x4912f3=process[_0x234a7c(0x107)]['isTTY']&&process[_0x234a7c(0xf9)]['isTTY'];let _0x2e9642;if(_0x1d5145[_0x234a7c(0xf3)])_0x2e9642=_0x1d5145['autoInstall'];else{if(_0x4912f3){const _0x3cdc61=await _0x4bf787[_0x234a7c(0x106)]([{'type':_0x4c635a[_0x234a7c(0xe4)],'name':_0x4c635a['TTgUt'],'message':_0x4c635a['AhONg'],'choices':[{'name':_0x234a7c(0xf8)+_0x45e0be+')','value':_0x4c635a['fZJgp']},{'name':_0x234a7c(0xfa)+_0x4de8b1+')','value':_0x4c635a['KuloP']}]}]);_0x2e9642=_0x3cdc61['installLevel'];}else _0x2e9642='project',console[_0x234a7c(0xde)](_0x234a7c(0x102)+_0x4de8b1+')');}let _0x453521=0x0;const _0x38a4f8=_0x4c635a[_0x234a7c(0xf1)](getCurrentVersion);console[_0x234a7c(0xde)](_0x4c635a['vvdAC']);try{const _0x35d76c=await installSkill('ranger',{'cliVersion':_0x38a4f8,'level':_0x2e9642,'platform':_0x27d635});_0x35d76c&&_0x453521++;}catch(_0x57d987){console['warn']('\x20\x20Failed\x20to\x20install\x20ranger\x20skill:',_0x4c635a['SdEJo'](_0x57d987,Error)?_0x57d987[_0x234a7c(0xdf)]:_0x57d987);}if(_0x4c635a['YXqWl'](_0x453521,0x0)){const _0x3d1ce3=_0x2e9642===_0x234a7c(0xf7)?'user-level':'project-level';console[_0x234a7c(0xde)]('\x0a✅\x20Installed\x20'+_0x453521+'\x20'+_0x3d1ce3+'\x20skill'+(_0x4c635a[_0x234a7c(0xef)](_0x453521,0x1)?'s':'')+_0x234a7c(0x104)),!_0x1d5145[_0x234a7c(0xeb)]&&(console['log'](_0x4c635a[_0x234a7c(0xea)]),_0x27d635===_0x4c635a['rGEHR']?console['log']('\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.'):console[_0x234a7c(0xde)](_0x4c635a[_0x234a7c(0xec)]));}else console[_0x234a7c(0xde)]('\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a');}
|
package/build/commands/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x18df7c=_0x5725;(function(_0x415af3,_0x4389a3){const _0x3e4e1b=_0x5725,_0x29f794=_0x415af3();while(!![]){try{const _0x59e37b=parseInt(_0x3e4e1b(0x171))/0x1+-parseInt(_0x3e4e1b(0x16f))/0x2+-parseInt(_0x3e4e1b(0x1b2))/0x3*(-parseInt(_0x3e4e1b(0x17c))/0x4)+-parseInt(_0x3e4e1b(0x197))/0x5*(parseInt(_0x3e4e1b(0x195))/0x6)+-parseInt(_0x3e4e1b(0x18d))/0x7+parseInt(_0x3e4e1b(0x17e))/0x8+-parseInt(_0x3e4e1b(0x1b7))/0x9*(parseInt(_0x3e4e1b(0x16c))/0xa);if(_0x59e37b===_0x4389a3)break;else _0x29f794['push'](_0x29f794['shift']());}catch(_0x5170c0){_0x29f794['push'](_0x29f794['shift']());}}}(_0x3a7c,0xcb8e5));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';function _0x5725(_0x146e39,_0x41a8f6){_0x146e39=_0x146e39-0x14f;const _0x3a7cf5=_0x3a7c();let _0x572516=_0x3a7cf5[_0x146e39];return _0x572516;}import{spawn}from'child_process';import _0x13ff2b from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerDir,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),bold=_0x11ce90=>_0x18df7c(0x152)+_0x11ce90+_0x18df7c(0x19b);function getPlaywrightVersion(){const _0xa75e14=_0x18df7c,_0x162e0a={'iTdiG':'playwright/package.json'};try{const _0x5998ca=require[_0xa75e14(0x170)](_0x162e0a['iTdiG']),_0x2db290=require(_0x5998ca);return _0x2db290[_0xa75e14(0x19c)];}catch{return null;}}function installChromiumBinary(_0x4a9707){const _0x56cc6c=_0x18df7c,_0x4519fe={'KyyQT':function(_0x455615,_0x15d3d9){return _0x455615(_0x15d3d9);},'IewbM':_0x56cc6c(0x1ae),'GQLGJ':_0x56cc6c(0x18a),'edWOR':_0x56cc6c(0x1a5),'YmxIs':'win32','cQKNX':_0x56cc6c(0x1b5)};return new Promise((_0x2a3dfa,_0x340d28)=>{const _0x344816=_0x56cc6c,_0x730609={'ZMJMW':function(_0x1c6daa,_0x4064b4){return _0x1c6daa(_0x4064b4);}},_0x168c12=_0x4a9707?['playwright@'+_0x4a9707,'install',_0x4519fe['IewbM']]:[_0x344816(0x19f),_0x4519fe[_0x344816(0x1a8)],_0x4519fe[_0x344816(0x198)]],_0x3e2f6f=spawn('npx',_0x168c12,{'stdio':_0x4519fe[_0x344816(0x1a7)],'shell':process[_0x344816(0x161)]===_0x4519fe[_0x344816(0x189)]});_0x3e2f6f['on'](_0x4519fe['cQKNX'],_0x3c2eb1=>{const _0x172142=_0x344816;_0x3c2eb1===0x0?_0x2a3dfa():_0x4519fe[_0x172142(0x183)](_0x340d28,new Error(_0x172142(0x19d)+_0x3c2eb1));}),_0x3e2f6f['on']('error',_0x4231b4=>{const _0x5c980e=_0x344816;_0x730609[_0x5c980e(0x158)](_0x340d28,_0x4231b4);});});}export async function authenticate(_0x204b5d){const _0x288ab2=_0x18df7c,_0x1fec71={'eNPCR':function(_0x453dea){return _0x453dea();},'FkNQr':function(_0x2b9b5b,_0x5679da){return _0x2b9b5b(_0x5679da);},'wdgll':_0x288ab2(0x192),'kyuvV':'Validating\x20API\x20token...','gpNxZ':'provided_token'};if(!_0x204b5d){const _0x35f05f=await _0x1fec71[_0x288ab2(0x188)](getToken);if(_0x35f05f){const _0x21b6c0=await _0x1fec71[_0x288ab2(0x1a3)](getCurrentUser,_0x35f05f);if(_0x21b6c0[_0x288ab2(0x17a)])return console['log']('✓\x20Already\x20authenticated\x20to\x20'+_0x21b6c0['user']['organizationName']),{'token':_0x35f05f,'method':_0x1fec71['wdgll']};}try{_0x204b5d=await _0x1fec71[_0x288ab2(0x188)](runDeviceAuthFlow);}catch(_0x4361c1){throw new Error('Authentication\x20failed:\x20'+(_0x4361c1 instanceof Error?_0x4361c1[_0x288ab2(0x17b)]:_0x4361c1));}const _0x20c430=await getCurrentUser(_0x204b5d);if(!_0x20c430['success'])throw new Error(_0x288ab2(0x193)+_0x20c430[_0x288ab2(0x1ba)]);return console['log']('✓\x20Authenticated\x20to\x20'+_0x20c430[_0x288ab2(0x160)]['organizationName']),{'token':_0x204b5d,'method':_0x288ab2(0x15c)};}console['log'](_0x1fec71['kyuvV']);const _0x41fc72=await getCurrentUser(_0x204b5d);if(!_0x41fc72['success']){if(_0x41fc72['status'])throw new Error('Authentication\x20failed:\x20'+_0x41fc72['error']+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error(_0x288ab2(0x168)+_0x41fc72['error']+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console['log']('✓\x20Authenticated\x20to\x20'+_0x41fc72['user']['organizationName']),await _0x1fec71['FkNQr'](storeToken,_0x204b5d),console['log'](process['env']['GITHUB_ENV']?'✓\x20Exported\x20credentials\x20for\x20CI':_0x288ab2(0x1b0)),{'token':_0x204b5d,'method':_0x1fec71[_0x288ab2(0x180)]};}function _0x3a7c(){const _0xbad999=['✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','stdout','wantsProfile','eNPCR','YmxIs','install','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','IbLtX','329133hUdtxa','✓\x20Created\x20.ranger/.gitignore','confirm','skipped','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','existing_token','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','dzPpW','9156ywqeeD','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','165VufPrB','IewbM','auth,\x20you\x20can\x20log\x20in\x20and\x20we\x27ll\x20save\x20the\x20session\x20state\x20for\x20Ranger\x20to','url','\x1b[0m','version','Installation\x20failed\x20with\x20exit\x20code\x20','iPvdL','playwright','\x0aA\x20profile\x20gives\x20Ranger\x27s\x20browser\x20agent\x20information\x20about\x20how','trackPhaseStart','OCLwE','FkNQr','bVEjz','inherit','CdRjD','edWOR','GQLGJ','use\x20until\x20the\x20session\x20expires.\x0a','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','tcAFv','aeqxM','AgNhl','chromium','soPtp','✓\x20Stored\x20credentials\x20locally','ninhg','64326bqwDcS','stdin','plugin','close','\x20\x20npx\x20playwright@','19334475NWYUWn','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium','\x0a❌\x20Profile\x20setup\x20failed:','error','YTWea','Aedjv','ygiTg','WAEzd','⚠\x20No\x20git\x20repository\x20found.\x20Run\x20`ranger\x20profile\x20add\x20local`\x20from\x20your\x20project\x20directory.','Make\x20sure\x20your\x20app\x20is\x20running\x20before\x20you\x20start.\x0a','log','profile','\x1b[1m','The\x20required\x20version\x20(','XcwqD','skipChromium','executablePath','vJAzo','ZMJMW','uKPUh','trCFT','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','device_auth','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','No\x20git\x20repository\x20found.\x20Please\x20run\x20`ranger\x20setup`\x20from\x20inside\x20your\x20project\x20directory.','nCAsn','user','platform','force','opencode','Non-interactive\x20mode:\x20No\x20--scope\x20provided,\x20defaulting\x20to\x20user.','CoppT','pSgLM','.gitignore','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','scope','bauUT','trackPhaseEnd','10KNaZYx','isTTY','LRbKs','532120ITrmjz','resolve','1519842ZBKKbY','vBJCh','stKBU','\x0a⚠\x20Skipping\x20Chromium\x20installation.','The\x20required\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','✓\x20Created\x20.ranger/\x20directory','eVsQT','\x20\x20npx\x20playwright\x20install\x20chromium','prompt','success','message','208mLTPHq','You\x20can\x20install\x20it\x20manually\x20by\x20running:','5685208dVJVVO','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','gpNxZ','BTIGc','PtaVo','KyyQT','ETxfw'];_0x3a7c=function(){return _0xbad999;};return _0x3a7c();}export async function ensureRangerDir(){const _0x4435d2=_0x18df7c,_0x4f1f4c={'OCLwE':function(_0x3b69d7,_0x48157b){return _0x3b69d7(_0x48157b);},'TgJcb':function(_0x3faf99,_0x4b2f0f,_0xc410fb){return _0x3faf99(_0x4b2f0f,_0xc410fb);},'PtaVo':_0x4435d2(0x176)},_0x5de474=getRangerDir();return!_0x4f1f4c[_0x4435d2(0x1a2)](existsSync,_0x5de474)?(await _0x4f1f4c['TgJcb'](mkdir,_0x5de474,{'recursive':!![]}),console[_0x4435d2(0x150)](_0x4f1f4c[_0x4435d2(0x182)]),{'path':_0x5de474,'installed':!![]}):(console[_0x4435d2(0x150)]('✓\x20.ranger/\x20directory\x20already\x20exists'),{'path':_0x5de474,'installed':![]});}export async function ensureChromium(){const _0x2fffec=_0x18df7c,_0x2ded78={'YTWea':'✓\x20Playwright\x20Chromium\x20browser\x20found','XnCwC':function(_0x78b0b7){return _0x78b0b7();},'trCFT':_0x2fffec(0x18f),'Aedjv':'install','NDahU':_0x2fffec(0x175),'Ntggn':_0x2fffec(0x191),'cBWqb':_0x2fffec(0x196),'BTIGc':function(_0x2f79ac,_0x6912f7){return _0x2f79ac instanceof _0x6912f7;},'sjJMK':_0x2fffec(0x178),'IbLtX':'You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'};let _0x4432a5=![];try{const _0x2ae4f4=chromium[_0x2fffec(0x156)]();_0x4432a5=existsSync(_0x2ae4f4);}catch{_0x4432a5=![];}if(_0x4432a5)return console[_0x2fffec(0x150)](_0x2ded78[_0x2fffec(0x1bb)]),![];const _0x3b03dc=_0x2ded78['XnCwC'](getPlaywrightVersion),_0x407eaa=process[_0x2fffec(0x1b3)][_0x2fffec(0x16d)]&&process['stdout']['isTTY'];let _0x502c74=!![];if(_0x407eaa){const {install:_0x24d096}=await _0x13ff2b['prompt']([{'type':_0x2ded78[_0x2fffec(0x15a)],'name':_0x2ded78[_0x2fffec(0x1bc)],'message':_0x3b03dc?_0x2fffec(0x153)+_0x3b03dc+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?':_0x2ded78['NDahU'],'default':!![]}]);_0x502c74=_0x24d096;}else console['log'](_0x2fffec(0x1b8)+(_0x3b03dc?'\x20'+_0x3b03dc:'')+'...');if(_0x502c74){console['log']('\x0aInstalling\x20Chromium\x20browser...\x0a');try{await installChromiumBinary(_0x3b03dc),console['log'](_0x2ded78['Ntggn']);}catch(_0x56d613){console[_0x2fffec(0x1ba)](_0x2ded78['cBWqb'],_0x2ded78[_0x2fffec(0x181)](_0x56d613,Error)?_0x56d613['message']:_0x56d613),console['log'](_0x2fffec(0x17d)),_0x3b03dc?console[_0x2fffec(0x150)](_0x2fffec(0x1b6)+_0x3b03dc+'\x20install\x20chromium'):console[_0x2fffec(0x150)](_0x2ded78['sjJMK']);}}else console['log'](_0x2fffec(0x174)),console[_0x2fffec(0x150)](_0x2ded78[_0x2fffec(0x18c)]),_0x3b03dc?console['log'](_0x2fffec(0x1b6)+_0x3b03dc+'\x20install\x20chromium'):console['log'](_0x2ded78['sjJMK']);return!![];}export async function writeRangerGitignore(_0x31aa98){const _0x539a20=_0x18df7c,_0x5b4cbd={'tMuDB':function(_0x3b021d,_0x29afad,_0x9dcd02){return _0x3b021d(_0x29afad,_0x9dcd02);},'HVrhM':_0x539a20(0x18e)},_0x19b8c1=_0x5b4cbd['tMuDB'](join,_0x31aa98,_0x539a20(0x167)),_0x240d01='\x0a\x0a#\x20Ignore\x20local-only\x20directories\x0alocal/\x0asessions/\x0abug-bashes/\x0areports/\x0afeedback-images/\x0a\x0aactive-profile.txt\x0aactive-feature.txt\x0a.gitignore\x0a\x0a#\x20Ignore\x20plaintext\x20auth\x20files\x20(encrypted\x20.enc\x20files\x20are\x20safe\x20to\x20commit)\x0a**/auth.json\x0a';await writeFile(_0x19b8c1,_0x240d01),console[_0x539a20(0x150)](_0x5b4cbd['HVrhM']);}function printProfileSetupLaterInstructions(){const _0xc4781e=_0x18df7c,_0x5a2028={'pSgLM':'\x0aIn\x20order\x20for\x20Ranger\x20to\x20verify\x20your\x20work,\x20you\x27ll\x20need\x20to\x20set\x20up\x20a\x20profile\x20later\x20with:','dzPpW':function(_0xdb685f,_0x33dcc6){return _0xdb685f(_0x33dcc6);},'LRbKs':'ranger\x20profile\x20add\x20local','CdRjD':_0xc4781e(0x14f)};console['log'](_0x5a2028[_0xc4781e(0x166)]),console['log']('\x20\x20'+_0x5a2028[_0xc4781e(0x194)](bold,_0x5a2028[_0xc4781e(0x16e)])),console['log'](_0x5a2028[_0xc4781e(0x1a6)]);}async function ensureLocalEnv(_0x3fcc55,_0x262c52){const _0x4988d3=_0x18df7c,_0x4447f7={'mANym':_0x4988d3(0x1bf),'aeqxM':'local','CoppT':'to\x20access\x20your\x20app.\x20If\x20the\x20part\x20of\x20your\x20app\x20you\x20want\x20to\x20test\x20is\x20behind','bABli':_0x4988d3(0x1a9),'sGOlm':'You\x27ll\x20need\x20the\x20app\x20to\x20be\x20running\x20to\x20set\x20up\x20the\x20profile.','nCAsn':'confirm','bVEjz':_0x4988d3(0x187),'ninhg':'Would\x20you\x20like\x20to\x20set\x20up\x20the\x20profile\x20now?','uKPUh':_0x4988d3(0x1b9),'ryuEk':function(_0x6ece7f,_0x4a2617){return _0x6ece7f instanceof _0x4a2617;}};if(!findGitRoot())return console['log'](_0x4447f7['mANym']),{'ready':![],'skipped':!![]};if(findExistingEnv(_0x4447f7['aeqxM'],{'locations':['local']}))return console['log']('✓\x20Local\x20profile\x20already\x20exists'),{'ready':!![],'skipped':![]};const _0x408842=process[_0x4988d3(0x1b3)][_0x4988d3(0x16d)]&&process['stdout'][_0x4988d3(0x16d)];if(_0x408842&&!_0x3fcc55?.['url']){console['log'](_0x4988d3(0x1a0)),console[_0x4988d3(0x150)](_0x4447f7[_0x4988d3(0x165)]),console[_0x4988d3(0x150)](_0x4988d3(0x199)),console['log'](_0x4447f7['bABli']),console[_0x4988d3(0x150)](_0x4447f7['sGOlm']);const {wantsProfile:_0x2e85b6}=await _0x13ff2b[_0x4988d3(0x179)]([{'type':_0x4447f7[_0x4988d3(0x15f)],'name':_0x4447f7[_0x4988d3(0x1a4)],'message':_0x4447f7[_0x4988d3(0x1b1)],'default':!![]}]);if(!_0x2e85b6)return printProfileSetupLaterInstructions(),{'ready':![],'skipped':!![]};}try{return await addEnv(_0x4447f7[_0x4988d3(0x1ac)],{'url':_0x3fcc55?.['url'],'force':_0x3fcc55?.[_0x4988d3(0x162)]},_0x262c52),{'ready':!![],'skipped':![]};}catch(_0x2e4c54){return console[_0x4988d3(0x1ba)](_0x4447f7[_0x4988d3(0x159)],_0x4447f7['ryuEk'](_0x2e4c54,Error)?_0x2e4c54['message']:_0x2e4c54),printProfileSetupLaterInstructions(),{'ready':![],'skipped':![]};}}export async function start(_0x2eb262,_0x4da89d,_0x55998b){const _0x396cda=_0x18df7c,_0x213a8a={'hRtvR':'\x0a🚀\x20Ranger\x20Setup\x0a','eVsQT':_0x396cda(0x164),'xUWUY':'user','WAEzd':'git_check','VuRAQ':'No\x20git\x20repository\x20found','bxsCP':function(_0x16e657){return _0x16e657();},'soPtp':'auth','JNbhr':'plugin','AgNhl':'skills','ygiTg':function(_0x26ccf5,_0x4dfdda,_0x231f8c){return _0x26ccf5(_0x4dfdda,_0x231f8c);},'fWUTy':'ranger','ETxfw':'\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','vBJCh':function(_0x3f3284,_0x1b1ad4){return _0x3f3284 instanceof _0x1b1ad4;},'stKBU':function(_0x4c8141,_0x1d62b3){return _0x4c8141(_0x1d62b3);},'XcwqD':function(_0x174cba,_0x114191,_0x12e9a3){return _0x174cba(_0x114191,_0x12e9a3);},'NOqhk':'profile','tcAFv':_0x396cda(0x17f),'wfJpi':function(_0x4ea2b7,_0x4b4cd6){return _0x4ea2b7(_0x4b4cd6);},'iPvdL':function(_0xf1f3ff,_0x1dbc5f){return _0xf1f3ff+_0x1dbc5f;},'vJAzo':function(_0x390c16,_0x21fd02){return _0x390c16+_0x21fd02;},'bauUT':function(_0x3fb6a9,_0x7b16ef){return _0x3fb6a9+_0x7b16ef;}};console['log'](_0x213a8a['hRtvR']);const _0x1546a4=process['stdin'][_0x396cda(0x16d)]&&process[_0x396cda(0x186)]['isTTY'];!_0x1546a4&&!_0x4da89d?.[_0x396cda(0x169)]&&(console['log'](_0x213a8a[_0x396cda(0x177)]),_0x4da89d={..._0x4da89d,'scope':_0x213a8a['xUWUY']});_0x55998b?.[_0x396cda(0x1a1)](_0x213a8a[_0x396cda(0x1be)]);if(!findGitRoot()){await _0x55998b?.['trackPhaseError'](_0x213a8a[_0x396cda(0x1be)],new Error(_0x213a8a['VuRAQ']));throw new Error(_0x396cda(0x15e));}_0x55998b?.[_0x396cda(0x16b)](_0x213a8a['WAEzd']);const _0x9d5c29=!existsSync(_0x213a8a['bxsCP'](getRangerDir)),{path:_0x5a9783}=await _0x213a8a['bxsCP'](ensureRangerDir);_0x55998b?.['trackPhaseStart'](_0x213a8a['soPtp']);const _0x436f5b=await authenticate(_0x2eb262);_0x55998b?.['trackPhaseEnd'](_0x213a8a[_0x396cda(0x1af)],{'isFirstRun':_0x9d5c29,'method':_0x436f5b['method']}),_0x55998b?.[_0x396cda(0x1a1)](_0x396cda(0x1ae));_0x4da89d?.[_0x396cda(0x155)]?console[_0x396cda(0x150)](_0x396cda(0x185)):await ensureChromium();_0x55998b?.['trackPhaseEnd'](_0x396cda(0x1ae),{'isFirstRun':_0x9d5c29,'skipped':!!_0x4da89d?.['skipChromium']}),await writeRangerGitignore(_0x5a9783),console[_0x396cda(0x150)]('\x0a✅\x20Ranger\x20setup\x20complete!\x0a');const _0x31228e=_0x4da89d?.['scope'],_0x34fb8f=_0x4da89d?.[_0x396cda(0x163)]??![];let _0x3bb58a=null;_0x34fb8f?(_0x55998b?.[_0x396cda(0x1a1)](_0x396cda(0x1b4)),_0x3bb58a=await ensureOpencodePluginConfig(_0x31228e),_0x55998b?.['trackPhaseEnd'](_0x396cda(0x1b4),{'isFirstRun':_0x9d5c29,'opencode':!![]})):(_0x55998b?.[_0x396cda(0x1a1)](_0x213a8a['JNbhr']),await ensureClaudePlugin(_0x31228e),_0x55998b?.[_0x396cda(0x16b)]('plugin',{'isFirstRun':_0x9d5c29}));if(_0x34fb8f&&_0x3bb58a){_0x55998b?.[_0x396cda(0x1a1)](_0x213a8a[_0x396cda(0x1ad)]);try{await _0x213a8a[_0x396cda(0x1bd)](installSkill,_0x213a8a['fWUTy'],{'level':_0x3bb58a['scope'],'cliVersion':getCurrentVersion(),'platform':'opencode'}),_0x55998b?.[_0x396cda(0x16b)](_0x213a8a['AgNhl'],{'isFirstRun':_0x9d5c29,'opencode':!![]});}catch(_0x2cc03c){console['warn'](_0x213a8a[_0x396cda(0x184)],_0x213a8a[_0x396cda(0x172)](_0x2cc03c,Error)?_0x2cc03c[_0x396cda(0x17b)]:_0x2cc03c),_0x55998b?.[_0x396cda(0x16b)](_0x213a8a['AgNhl'],{'isFirstRun':_0x9d5c29,'opencode':!![],'failed':!![]});}}else _0x55998b?.[_0x396cda(0x1a1)](_0x213a8a[_0x396cda(0x1ad)]),await _0x213a8a[_0x396cda(0x173)](ensureClaudeSkills,_0x31228e),_0x55998b?.[_0x396cda(0x16b)](_0x213a8a['AgNhl'],{'isFirstRun':_0x9d5c29});const _0x1f4aaf=findGitRoot();if(_0x1f4aaf){const _0x42954e=_0x213a8a[_0x396cda(0x154)](join,_0x1f4aaf,'.ranger');!existsSync(_0x42954e)&&await mkdir(_0x42954e,{'recursive':!![]});}if(!_0x1546a4&&!_0x4da89d?.[_0x396cda(0x19a)])console['log']('Non-interactive\x20mode:\x20Skipping\x20profile\x20setup.\x20To\x20set\x20up\x20a\x20profile,\x20pass\x20--url\x20or\x20run\x20later:'),console[_0x396cda(0x150)]('\x20\x20'+_0x213a8a['stKBU'](bold,'ranger\x20profile\x20add\x20local')+'\x0a');else{_0x55998b?.[_0x396cda(0x1a1)](_0x396cda(0x151));const _0x40da5f=await ensureLocalEnv({'url':_0x4da89d?.['url'],'force':_0x4da89d?.['force']},_0x55998b);_0x55998b?.['trackPhaseEnd'](_0x213a8a['NOqhk'],{'isFirstRun':_0x9d5c29,'profileReady':_0x40da5f['ready'],'userSkipped':_0x40da5f[_0x396cda(0x190)]}),_0x40da5f['ready']&&console['log']('\x0a✅\x20You\x27re\x20ready\x20to\x20start\x20using\x20Ranger\x20Feature\x20Review.');}if(_0x34fb8f)console[_0x396cda(0x150)](_0x396cda(0x15d)),console[_0x396cda(0x150)]('and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review'),console[_0x396cda(0x150)](_0x396cda(0x18b)),console['log'](_0x213a8a[_0x396cda(0x1ab)]);else{const _0x9a79df=_0x213a8a['wfJpi'](bold,'/ranger:enable');console['log'](_0x213a8a[_0x396cda(0x19e)](_0x213a8a[_0x396cda(0x157)](_0x213a8a[_0x396cda(0x16a)]('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x9a79df+'\x20and\x20prompt\x20the\x20coding',_0x396cda(0x15b)),_0x396cda(0x1aa)),'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.'));}}
|
|
1
|
+
const _0xe9c477=_0x5c08;(function(_0x3ce1e0,_0x294b37){const _0x36fe47=_0x5c08,_0x38127c=_0x3ce1e0();while(!![]){try{const _0xf8d7a=-parseInt(_0x36fe47(0x18c))/0x1*(parseInt(_0x36fe47(0x1a8))/0x2)+-parseInt(_0x36fe47(0x163))/0x3*(parseInt(_0x36fe47(0x1a3))/0x4)+parseInt(_0x36fe47(0x18a))/0x5+-parseInt(_0x36fe47(0x157))/0x6+parseInt(_0x36fe47(0x19d))/0x7+-parseInt(_0x36fe47(0x161))/0x8+parseInt(_0x36fe47(0x15c))/0x9;if(_0xf8d7a===_0x294b37)break;else _0x38127c['push'](_0x38127c['shift']());}catch(_0x4b0e52){_0x38127c['push'](_0x38127c['shift']());}}}(_0x4c90,0xb3543));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x259226 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';function _0x4c90(){const _0x465dca=['nNftN','\x0a🚀\x20Ranger\x20Setup\x0a','Validating\x20API\x20token...','4610025WhbpqD','isTTY','yZRvF','\x20\x20npx\x20playwright@','opencode','2964528VnbBIi','✓\x20Exported\x20credentials\x20for\x20CI','1890243CSyuTR','xMoqh','MZcUi','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','stdin','log','GITHUB_ENV','Installation\x20failed\x20with\x20exit\x20code\x20','BdpJO','skipChromium','RkfcS','Would\x20you\x20like\x20to\x20set\x20up\x20the\x20profile\x20now?','✓\x20Already\x20authenticated\x20to\x20','✓\x20Playwright\x20Chromium\x20browser\x20found','stdout','oHSpb','mgZTA','fsOJR','npx','✓\x20Authenticated\x20to\x20','gyExr','\x20\x20npx\x20playwright\x20install\x20chromium','auth','qESYU','chromium','mgbbW','YYocM','ranger','error','Make\x20sure\x20your\x20app\x20is\x20running\x20before\x20you\x20start.\x0a','install','FKukx','JrVey','success','organizationName','mzbvx','skills','✓\x20Local\x20profile\x20already\x20exists','auth,\x20you\x20can\x20log\x20in\x20and\x20we\x27ll\x20save\x20the\x20session\x20state\x20for\x20Ranger\x20to','5721295GEVKyf','trackPhaseStart','22853YlUQRw','SkGso','prompt','executablePath','plugin','kPGtj','warn','fMqGf','\x1b[0m','XOZNe','ExbkB','force','message','wantsProfile','QLfXY','Non-interactive\x20mode:\x20Skipping\x20profile\x20setup.\x20To\x20set\x20up\x20a\x20profile,\x20pass\x20--url\x20or\x20run\x20later:','UiRID','8554217mUDlzD','No\x20git\x20repository\x20found.\x20Please\x20run\x20`ranger\x20setup`\x20from\x20inside\x20your\x20project\x20directory.','uamqW','/ranger:enable','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','playwright','8EMzzua','EGFrw','fZxQe','LqHCx','close','34iucEbc','method','skipped','bMnso','ggEVr','AJOpk','url','env','to\x20access\x20your\x20app.\x20If\x20the\x20part\x20of\x20your\x20app\x20you\x20want\x20to\x20test\x20is\x20behind','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','user','gAvIw','AUXmT','fPWmJ','The\x20required\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','ranger\x20profile\x20add\x20local','sKEKy','No\x20git\x20repository\x20found','AHAqb','Authentication\x20failed:\x20','use\x20until\x20the\x20session\x20expires.\x0a','trackPhaseEnd','kNcpA','Hlafr','QvJbG','qbNkG','eVOCF','qMeQC','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','platform','git_check','lZySo','qcpvy','LqEWV','748530NBgIIo','CpTUy'];_0x4c90=function(){return _0x465dca;};return _0x4c90();}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';function _0x5c08(_0x47fcac,_0x1b16fc){_0x47fcac=_0x47fcac-0x155;const _0x4c900c=_0x4c90();let _0x5c08ec=_0x4c900c[_0x47fcac];return _0x5c08ec;}const require=createRequire(import.meta.url),bold=_0x1e67f1=>'\x1b[1m'+_0x1e67f1+_0xe9c477(0x194);function getPlaywrightVersion(){const _0x199a5f=_0xe9c477,_0x390908={'qcpvy':'playwright/package.json','lZySo':function(_0x2e7ecd,_0x44b36f){return _0x2e7ecd(_0x44b36f);}};try{const _0x18a6b4=require['resolve'](_0x390908[_0x199a5f(0x155)]),_0x275031=_0x390908[_0x199a5f(0x1c7)](require,_0x18a6b4);return _0x275031['version'];}catch{return null;}}function installChromiumBinary(_0x14d6e4){const _0x464989=_0xe9c477,_0x4855fa={'HNZbJ':_0x464989(0x181),'LqHCx':_0x464989(0x17b),'oNgNW':_0x464989(0x175),'kNcpA':'inherit','RkfcS':function(_0x1da76c,_0x12512c){return _0x1da76c===_0x12512c;},'oHSpb':'win32','nNRVu':_0x464989(0x17f)};return new Promise((_0x302191,_0x48e959)=>{const _0x1c450e=_0x464989,_0x4b0d24=_0x14d6e4?['playwright@'+_0x14d6e4,_0x4855fa['HNZbJ'],_0x4855fa[_0x1c450e(0x1a6)]]:[_0x1c450e(0x1a2),'install','chromium'],_0x7ef821=spawn(_0x4855fa['oNgNW'],_0x4b0d24,{'stdio':_0x4855fa[_0x1c450e(0x1be)],'shell':_0x4855fa[_0x1c450e(0x16d)](process[_0x1c450e(0x1c5)],_0x4855fa[_0x1c450e(0x172)])});_0x7ef821['on'](_0x1c450e(0x1a7),_0x6e0c83=>{const _0x371598=_0x1c450e;_0x6e0c83===0x0?_0x302191():_0x48e959(new Error(_0x371598(0x16a)+_0x6e0c83));}),_0x7ef821['on'](_0x4855fa['nNRVu'],_0x46eb6a=>{_0x48e959(_0x46eb6a);});});}export async function authenticate(_0x225b5b){const _0x5e04e3=_0xe9c477,_0x5aa5ba={'fsOJR':function(_0x4d2bc0,_0x1ab7c9){return _0x4d2bc0(_0x1ab7c9);},'ajbSv':'existing_token','QLfXY':function(_0x7ccad8,_0x503cbd){return _0x7ccad8(_0x503cbd);},'AHAqb':'device_auth'};if(!_0x225b5b){const _0x546127=await getToken();if(_0x546127){const _0xaa1b0b=await _0x5aa5ba[_0x5e04e3(0x174)](getCurrentUser,_0x546127);if(_0xaa1b0b['success'])return console[_0x5e04e3(0x168)](_0x5e04e3(0x16f)+_0xaa1b0b[_0x5e04e3(0x1b2)]['organizationName']),{'token':_0x546127,'method':_0x5aa5ba['ajbSv']};}try{_0x225b5b=await runDeviceAuthFlow();}catch(_0x42dead){throw new Error(_0x5e04e3(0x1bb)+(_0x42dead instanceof Error?_0x42dead[_0x5e04e3(0x198)]:_0x42dead));}const _0x339535=await _0x5aa5ba['QLfXY'](getCurrentUser,_0x225b5b);if(!_0x339535[_0x5e04e3(0x184)])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x339535[_0x5e04e3(0x17f)]);return console['log'](_0x5e04e3(0x176)+_0x339535['user']['organizationName']),{'token':_0x225b5b,'method':_0x5aa5ba[_0x5e04e3(0x1ba)]};}console[_0x5e04e3(0x168)](_0x5e04e3(0x15b));const _0x44da74=await getCurrentUser(_0x225b5b);if(!_0x44da74[_0x5e04e3(0x184)]){if(_0x44da74['status'])throw new Error(_0x5e04e3(0x1bb)+_0x44da74[_0x5e04e3(0x17f)]+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error(_0x5e04e3(0x1a1)+_0x44da74[_0x5e04e3(0x17f)]+_0x5e04e3(0x1b1));}return console['log'](_0x5e04e3(0x176)+_0x44da74[_0x5e04e3(0x1b2)][_0x5e04e3(0x185)]),await _0x5aa5ba[_0x5e04e3(0x19a)](storeToken,_0x225b5b),console['log'](process[_0x5e04e3(0x1af)][_0x5e04e3(0x169)]?_0x5e04e3(0x162):'✓\x20Stored\x20credentials\x20locally'),{'token':_0x225b5b,'method':'provided_token'};}export async function ensureRangerDir(){const _0x26fa27=_0xe9c477,_0x3bc079={'nlsDz':function(_0xf187e3){return _0xf187e3();},'gAvIw':function(_0x5968ec,_0x211b97){return _0x5968ec(_0x211b97);},'mgZTA':function(_0x3eab1a,_0x5c9dfb,_0x65c19){return _0x3eab1a(_0x5c9dfb,_0x65c19);},'MYBjG':'✓\x20Created\x20.ranger/\x20directory'},_0x1180e7=findGitRoot(),_0x154504=_0x1180e7?join(_0x1180e7,'.ranger'):_0x3bc079['nlsDz'](getRangerDir);return!_0x3bc079[_0x26fa27(0x1b3)](existsSync,_0x154504)?(await _0x3bc079[_0x26fa27(0x173)](mkdir,_0x154504,{'recursive':!![]}),console['log'](_0x3bc079['MYBjG']),{'path':_0x154504,'installed':!![]}):(console['log']('✓\x20.ranger/\x20directory\x20already\x20exists'),{'path':_0x154504,'installed':![]});}export async function ensureChromium(){const _0x1c03a1=_0xe9c477,_0x34fcc0={'MdtEJ':function(_0x67baf7,_0x250b8b){return _0x67baf7(_0x250b8b);},'FKukx':_0x1c03a1(0x170),'JRJMs':function(_0x4561de){return _0x4561de();},'gyExr':'confirm','kPGtj':_0x1c03a1(0x181),'XOZNe':_0x1c03a1(0x1b6),'XIHVu':'\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','mzbvx':_0x1c03a1(0x1c4),'bMnso':'You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','uamqW':_0x1c03a1(0x178)};let _0x5f8ae9=![];try{const _0x402991=chromium[_0x1c03a1(0x18f)]();_0x5f8ae9=_0x34fcc0['MdtEJ'](existsSync,_0x402991);}catch{_0x5f8ae9=![];}if(_0x5f8ae9)return console[_0x1c03a1(0x168)](_0x34fcc0[_0x1c03a1(0x182)]),![];const _0x27d4fc=_0x34fcc0['JRJMs'](getPlaywrightVersion),_0x54b572=process[_0x1c03a1(0x167)]['isTTY']&&process[_0x1c03a1(0x171)]['isTTY'];let _0x451493=!![];if(_0x54b572){const {install:_0x56dea7}=await _0x259226[_0x1c03a1(0x18e)]([{'type':_0x34fcc0[_0x1c03a1(0x177)],'name':_0x34fcc0[_0x1c03a1(0x191)],'message':_0x27d4fc?'The\x20required\x20version\x20('+_0x27d4fc+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?':_0x34fcc0[_0x1c03a1(0x195)],'default':!![]}]);_0x451493=_0x56dea7;}else console['log']('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium'+(_0x27d4fc?'\x20'+_0x27d4fc:'')+'...');if(_0x451493){console['log']('\x0aInstalling\x20Chromium\x20browser...\x0a');try{await installChromiumBinary(_0x27d4fc),console[_0x1c03a1(0x168)](_0x34fcc0['XIHVu']);}catch(_0x1f73f9){console['error'](_0x34fcc0[_0x1c03a1(0x186)],_0x1f73f9 instanceof Error?_0x1f73f9[_0x1c03a1(0x198)]:_0x1f73f9),console[_0x1c03a1(0x168)]('You\x20can\x20install\x20it\x20manually\x20by\x20running:'),_0x27d4fc?console[_0x1c03a1(0x168)](_0x1c03a1(0x15f)+_0x27d4fc+'\x20install\x20chromium'):console['log'](_0x1c03a1(0x178));}}else console[_0x1c03a1(0x168)]('\x0a⚠\x20Skipping\x20Chromium\x20installation.'),console['log'](_0x34fcc0[_0x1c03a1(0x1ab)]),_0x27d4fc?console['log'](_0x1c03a1(0x15f)+_0x27d4fc+'\x20install\x20chromium'):console['log'](_0x34fcc0[_0x1c03a1(0x19f)]);return!![];}export async function writeRangerGitignore(_0x5839d1){const _0x5b0de0=_0xe9c477,_0x52c5dd={'ggEVr':function(_0x32b36e,_0x34c7a8,_0xad0eb5){return _0x32b36e(_0x34c7a8,_0xad0eb5);},'yZRvF':function(_0x3436bb,_0x17ee80,_0x5455d6){return _0x3436bb(_0x17ee80,_0x5455d6);}},_0x4e866d=_0x52c5dd[_0x5b0de0(0x1ac)](join,_0x5839d1,'.gitignore'),_0x482078='\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 _0x52c5dd[_0x5b0de0(0x15e)](writeFile,_0x4e866d,_0x482078),console['log']('✓\x20Created\x20.ranger/.gitignore');}function printProfileSetupLaterInstructions(){const _0x3fe4e7=_0xe9c477,_0x208914={'qMeQC':function(_0xc4178e,_0x37cfa8){return _0xc4178e(_0x37cfa8);},'qESYU':_0x3fe4e7(0x1b7),'LnPLO':_0x3fe4e7(0x180)};console[_0x3fe4e7(0x168)]('\x0aIn\x20order\x20for\x20Ranger\x20to\x20verify\x20your\x20work,\x20you\x27ll\x20need\x20to\x20set\x20up\x20a\x20profile\x20later\x20with:'),console['log']('\x20\x20'+_0x208914[_0x3fe4e7(0x1c3)](bold,_0x208914[_0x3fe4e7(0x17a)])),console[_0x3fe4e7(0x168)](_0x208914['LnPLO']);}async function ensureLocalEnv(_0x176e49,_0x10bc6b){const _0x581715=_0xe9c477,_0x1b90d3={'eVOCF':function(_0x53a969){return _0x53a969();},'JrVey':function(_0x101259,_0x5797a9,_0x3e6e61){return _0x101259(_0x5797a9,_0x3e6e61);},'nNftN':'local','DQTvb':'\x0aA\x20profile\x20gives\x20Ranger\x27s\x20browser\x20agent\x20information\x20about\x20how','qbNkG':_0x581715(0x1bc),'MkDqz':'You\x27ll\x20need\x20the\x20app\x20to\x20be\x20running\x20to\x20set\x20up\x20the\x20profile.','GXWXy':'confirm','YYocM':_0x581715(0x199),'LqEWV':function(_0x24a5f){return _0x24a5f();},'bqpNH':function(_0x55ce3d,_0x42c143,_0x31c065,_0x636eec){return _0x55ce3d(_0x42c143,_0x31c065,_0x636eec);},'SkGso':'\x0a❌\x20Profile\x20setup\x20failed:','QvJbG':function(_0x3929a5,_0x4b47ae){return _0x3929a5 instanceof _0x4b47ae;}};if(!_0x1b90d3[_0x581715(0x1c2)](findGitRoot))return console['log']('⚠\x20No\x20git\x20repository\x20found.\x20Run\x20`ranger\x20profile\x20add\x20local`\x20from\x20your\x20project\x20directory.'),{'ready':![],'skipped':!![]};if(_0x1b90d3[_0x581715(0x183)](findExistingEnv,_0x1b90d3['nNftN'],{'locations':[_0x1b90d3[_0x581715(0x159)]]}))return console['log'](_0x581715(0x188)),{'ready':!![],'skipped':![]};const _0x401bca=process['stdin']['isTTY']&&process[_0x581715(0x171)][_0x581715(0x15d)];if(_0x401bca&&!_0x176e49?.[_0x581715(0x1ae)]){console[_0x581715(0x168)](_0x1b90d3['DQTvb']),console['log'](_0x581715(0x1b0)),console[_0x581715(0x168)](_0x581715(0x189)),console['log'](_0x1b90d3[_0x581715(0x1c1)]),console['log'](_0x1b90d3['MkDqz']);const {wantsProfile:_0xf1520a}=await _0x259226['prompt']([{'type':_0x1b90d3['GXWXy'],'name':_0x1b90d3[_0x581715(0x17d)],'message':_0x581715(0x16e),'default':!![]}]);if(!_0xf1520a)return _0x1b90d3[_0x581715(0x156)](printProfileSetupLaterInstructions),{'ready':![],'skipped':!![]};}try{return await _0x1b90d3['bqpNH'](addEnv,_0x1b90d3['nNftN'],{'url':_0x176e49?.['url'],'force':_0x176e49?.[_0x581715(0x197)]},_0x10bc6b),{'ready':!![],'skipped':![]};}catch(_0x19a8fc){return console['error'](_0x1b90d3[_0x581715(0x18d)],_0x1b90d3[_0x581715(0x1c0)](_0x19a8fc,Error)?_0x19a8fc['message']:_0x19a8fc),_0x1b90d3['eVOCF'](printProfileSetupLaterInstructions),{'ready':![],'skipped':![]};}}export async function start(_0x452ad2,_0x3fdb2e,_0x6d7619){const _0x31d34f=_0xe9c477,_0x3b4524={'CpTUy':_0x31d34f(0x15a),'MZcUi':'Non-interactive\x20mode:\x20No\x20--scope\x20provided,\x20defaulting\x20to\x20user.','kNXCX':'git_check','fMqGf':_0x31d34f(0x1b9),'vwQdn':_0x31d34f(0x19e),'mgbbW':function(_0x43ba55,_0x1627fd){return _0x43ba55(_0x1627fd);},'fZxQe':function(_0x322861){return _0x322861();},'Hlafr':_0x31d34f(0x179),'ExbkB':_0x31d34f(0x17b),'sKEKy':function(_0x49b5fc){return _0x49b5fc();},'AJOpk':_0x31d34f(0x190),'xMoqh':function(_0x1b03c7,_0x54e50d){return _0x1b03c7&&_0x54e50d;},'UiRID':_0x31d34f(0x187),'BdpJO':function(_0x39eee2,_0x37f28a,_0x58e17e){return _0x39eee2(_0x37f28a,_0x58e17e);},'rFQah':_0x31d34f(0x1b7),'AUXmT':function(_0x1d523a,_0x103296,_0x241294){return _0x1d523a(_0x103296,_0x241294);},'dXtzX':'profile','IIQUy':_0x31d34f(0x166),'EGFrw':'and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','fPWmJ':'with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'};console['log'](_0x3b4524[_0x31d34f(0x158)]);const _0xf85a9e=process['stdin'][_0x31d34f(0x15d)]&&process['stdout']['isTTY'];!_0xf85a9e&&!_0x3fdb2e?.['scope']&&(console['log'](_0x3b4524[_0x31d34f(0x165)]),_0x3fdb2e={..._0x3fdb2e,'scope':'user'});_0x6d7619?.['trackPhaseStart'](_0x31d34f(0x1c6));if(!findGitRoot()){await _0x6d7619?.['trackPhaseError'](_0x3b4524['kNXCX'],new Error(_0x3b4524[_0x31d34f(0x193)]));throw new Error(_0x3b4524['vwQdn']);}_0x6d7619?.[_0x31d34f(0x1bd)](_0x3b4524['kNXCX']);const _0x3075ba=!_0x3b4524['mgbbW'](existsSync,_0x3b4524[_0x31d34f(0x1a5)](getRangerDir)),{path:_0x2dbe7c}=await _0x3b4524['fZxQe'](ensureRangerDir);_0x6d7619?.['trackPhaseStart'](_0x31d34f(0x179));const _0x10434f=await _0x3b4524[_0x31d34f(0x17c)](authenticate,_0x452ad2);_0x6d7619?.['trackPhaseEnd'](_0x3b4524[_0x31d34f(0x1bf)],{'isFirstRun':_0x3075ba,'method':_0x10434f[_0x31d34f(0x1a9)]}),_0x6d7619?.[_0x31d34f(0x18b)](_0x3b4524[_0x31d34f(0x196)]);_0x3fdb2e?.['skipChromium']?console[_0x31d34f(0x168)]('✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)'):await _0x3b4524[_0x31d34f(0x1b8)](ensureChromium);_0x6d7619?.['trackPhaseEnd']('chromium',{'isFirstRun':_0x3075ba,'skipped':!!_0x3fdb2e?.[_0x31d34f(0x16c)]}),await writeRangerGitignore(_0x2dbe7c),console['log']('\x0a✅\x20Ranger\x20setup\x20complete!\x0a');const _0x86191f=_0x3fdb2e?.['scope'],_0x5337af=_0x3fdb2e?.[_0x31d34f(0x160)]??![];let _0x2974ce=null;_0x5337af?(_0x6d7619?.[_0x31d34f(0x18b)](_0x3b4524[_0x31d34f(0x1ad)]),_0x2974ce=await ensureOpencodePluginConfig(_0x86191f),_0x6d7619?.['trackPhaseEnd']('plugin',{'isFirstRun':_0x3075ba,'opencode':!![]})):(_0x6d7619?.[_0x31d34f(0x18b)](_0x3b4524['AJOpk']),await ensureClaudePlugin(_0x86191f),_0x6d7619?.[_0x31d34f(0x1bd)]('plugin',{'isFirstRun':_0x3075ba}));if(_0x3b4524[_0x31d34f(0x164)](_0x5337af,_0x2974ce)){_0x6d7619?.['trackPhaseStart'](_0x3b4524[_0x31d34f(0x19c)]);try{await _0x3b4524[_0x31d34f(0x16b)](installSkill,_0x31d34f(0x17e),{'level':_0x2974ce['scope'],'cliVersion':getCurrentVersion(),'platform':_0x31d34f(0x160)}),_0x6d7619?.['trackPhaseEnd']('skills',{'isFirstRun':_0x3075ba,'opencode':!![]});}catch(_0x47619f){console[_0x31d34f(0x192)]('\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:',_0x47619f instanceof Error?_0x47619f[_0x31d34f(0x198)]:_0x47619f),_0x6d7619?.[_0x31d34f(0x1bd)]('skills',{'isFirstRun':_0x3075ba,'opencode':!![],'failed':!![]});}}else _0x6d7619?.[_0x31d34f(0x18b)](_0x3b4524['UiRID']),await _0x3b4524[_0x31d34f(0x17c)](ensureClaudeSkills,_0x86191f),_0x6d7619?.[_0x31d34f(0x1bd)]('skills',{'isFirstRun':_0x3075ba});if(!_0xf85a9e&&!_0x3fdb2e?.[_0x31d34f(0x1ae)])console['log'](_0x31d34f(0x19b)),console['log']('\x20\x20'+bold(_0x3b4524['rFQah'])+'\x0a');else{_0x6d7619?.['trackPhaseStart']('profile');const _0xfce09e=await _0x3b4524[_0x31d34f(0x1b4)](ensureLocalEnv,{'url':_0x3fdb2e?.[_0x31d34f(0x1ae)],'force':_0x3fdb2e?.[_0x31d34f(0x197)]},_0x6d7619);_0x6d7619?.['trackPhaseEnd'](_0x3b4524['dXtzX'],{'isFirstRun':_0x3075ba,'profileReady':_0xfce09e['ready'],'userSkipped':_0xfce09e[_0x31d34f(0x1aa)]}),_0xfce09e['ready']&&console[_0x31d34f(0x168)]('\x0a✅\x20You\x27re\x20ready\x20to\x20start\x20using\x20Ranger\x20Feature\x20Review.');}if(_0x5337af)console[_0x31d34f(0x168)](_0x3b4524['IIQUy']),console[_0x31d34f(0x168)](_0x3b4524[_0x31d34f(0x1a4)]),console[_0x31d34f(0x168)](_0x3b4524[_0x31d34f(0x1b5)]),console['log']('verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.');else{const _0xb01b62=bold(_0x31d34f(0x1a0));console['log']('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0xb01b62+'\x20and\x20prompt\x20the\x20coding'+'\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
|
-
(function(_0x34bf06,_0xfa58fa){const _0x53931e=_0x4822,_0x7bc515=_0x34bf06();while(!![]){try{const _0x31bf08=parseInt(_0x53931e(0x12f))/0x1+-parseInt(_0x53931e(0x112))/0x2*(-parseInt(_0x53931e(0x154))/0x3)+-parseInt(_0x53931e(0x104))/0x4+-parseInt(_0x53931e(0x127))/0x5*(-parseInt(_0x53931e(0x113))/0x6)+parseInt(_0x53931e(0x121))/0x7+parseInt(_0x53931e(0x132))/0x8+-parseInt(_0x53931e(0x138))/0x9;if(_0x31bf08===_0xfa58fa)break;else _0x7bc515['push'](_0x7bc515['shift']());}catch(_0x7be1c5){_0x7bc515['push'](_0x7bc515['shift']());}}}(_0x5d9f,0x6e38a));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';function _0x5d9f(){const _0x1d7407=['includes','(not\x20found)','\x20\x20Project-level:','auth.json','data','dnXBZ','isDirectory','lIrOU','enabled','Root:\x20','uoyuN','\x20plugin(s)\x20configured','kkecZ','GPMzA','\x20\x20Not\x20installed','plaintext','some','36PkOCPJ','UKEXF','details','\x20\x20Run:\x20ranger\x20update','oPDhY','configured','fiTgX','none','ZnrBQ','\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','not_installed','status','\x20\x20Run:\x20ranger\x20setup\x20[token]','log','trim','@ranger-testing/opencode-plugin','\x20\x20User-level:','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','\x20\x20Run:\x20ranger\x20setup\x20--opencode','2114216poSazL','settings.json','isActive','UPQaj',':\x20installed\x20(','ECnVd','AmvjS','ignore','encrypted','pipe','YhTOL','YNBSb','pSmLd','No\x20skills\x20installed','137114tTzqOv','78aMspwK','plugin','hasEncryptedAuth','cgjBJ','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','lzPBa','EnnLM','\x20\x20\x20\x20','config','Tagkx','path','KPNeu','\x0a📊\x20Ranger\x20Status\x0a','Version:\x20','6041938tEGMSj','FXVkd','match','ftnFX','API\x20Environment:\x20','gpHuD','290165WYHSDY','\x20\x20Not\x20configured','SKILL.md','DmsPw','aqaFp','settingsPath','project','TZTMO','791353eBPIMf','yUOdC','length','3675752XLmTjN','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','iTdPn','not_configured','organizationName','name','24399441bSMEFD','\x0a---\x20Skills\x20---','grBnr','user','ONkmk','push','oGOMP','success','parse','toString','ranger@trailhead'];_0x5d9f=function(){return _0x1d7407;};return _0x5d9f();}function _0x4822(_0x300a45,_0x3609b5){_0x300a45=_0x300a45-0xf7;const _0x5d9f01=_0x5d9f();let _0x48221d=_0x5d9f01[_0x300a45];return _0x48221d;}const bold=_0xe26369=>'\x1b[1m'+_0xe26369+'\x1b[0m',link=(_0x3eaa93,_0x5d9ce1)=>'\x1b]8;;file://'+_0x3eaa93+'\x07'+(_0x5d9ce1||_0x3eaa93)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x4925e4=_0x4822,_0x5de4c5={'EQVoV':function(_0x54fb49,_0x407d98){return _0x54fb49!==_0x407d98;},'EnnLM':function(_0x5974fc,_0x2403ef){return _0x5974fc(_0x2403ef);},'cgjBJ':function(_0x2050cf,_0x1c7c66){return _0x2050cf>_0x1c7c66;},'kkecZ':function(_0x44a492,_0xb8ceb8){return _0x44a492(_0xb8ceb8);},'fiTgX':'not_configured','wdBPW':'opencode','LHnbh':_0x4925e4(0x10d),'AmvjS':_0x4925e4(0x147),'dUMMm':'close'};return new Promise(_0x24d58b=>{const _0x3d7237=_0x4925e4,_0x21c84a={'gpHuD':function(_0x12aa12,_0x36cfc0){return _0x12aa12!==_0x36cfc0;},'UPQaj':'@ranger-testing/opencode-plugin','DvqwN':'opencode-plugin'},_0x32d7c2=spawn(_0x5de4c5['wdBPW'],['debug',_0x3d7237(0x11b)],{'stdio':[_0x3d7237(0x10b),_0x5de4c5['LHnbh'],_0x3d7237(0x10d)]});let _0x2a5cdb='';_0x32d7c2['stdout']?.['on'](_0x5de4c5[_0x3d7237(0x10a)],_0x2ea911=>{_0x2a5cdb+=_0x2ea911['toString']();}),_0x32d7c2['stderr']?.['on']('data',_0x157ac5=>{const _0x168840=_0x3d7237;_0x2a5cdb+=_0x157ac5[_0x168840(0x141)]();}),_0x32d7c2['on']('error',()=>{const _0x428136=_0x3d7237;_0x24d58b({'status':_0x428136(0xfb)});}),_0x32d7c2['on'](_0x5de4c5['dUMMm'],_0x3dd8cb=>{const _0x88a01=_0x3d7237;if(_0x5de4c5['EQVoV'](_0x3dd8cb,0x0)){_0x5de4c5['EnnLM'](_0x24d58b,{'status':'not_installed'});return;}const _0x3f84e9=_0x2a5cdb[_0x88a01(0xff)]();let _0x32d568=null;if(_0x3f84e9)try{_0x32d568=JSON['parse'](_0x3f84e9);}catch{const _0x4303b3=_0x3f84e9['match'](/\{[\s\S]*\}$/);if(_0x4303b3)try{_0x32d568=JSON[_0x88a01(0x140)](_0x4303b3[0x0]);}catch{_0x32d568=null;}}const _0x45dc43=Array['isArray'](_0x32d568?.[_0x88a01(0x114)])?_0x32d568?.['plugin']:[],_0x31ae29=_0x45dc43[_0x88a01(0x153)](_0x33a188=>{const _0x1118ac=_0x88a01;if(_0x21c84a[_0x1118ac(0x126)](typeof _0x33a188,'string'))return![];return _0x33a188[_0x1118ac(0x143)](_0x21c84a[_0x1118ac(0x107)])||_0x33a188['includes'](_0x21c84a['DvqwN']);});if(_0x31ae29){_0x5de4c5[_0x88a01(0x119)](_0x24d58b,{'status':_0x88a01(0x159),'details':_0x5de4c5[_0x88a01(0x116)](_0x45dc43['length'],0x0)?_0x45dc43[_0x88a01(0x131)]+_0x88a01(0x14e):undefined});return;}if(_0x45dc43['length']>0x0){_0x24d58b({'status':_0x88a01(0x135),'details':_0x45dc43[_0x88a01(0x131)]+'\x20plugin(s)\x20configured'});return;}_0x5de4c5[_0x88a01(0x14f)](_0x24d58b,{'status':_0x5de4c5[_0x88a01(0xf7)]});});});}async function getSkillsFromDir(_0x2db38d,_0x3d5652){const _0x43f5c0=_0x4822,_0x2d15db={'ZnrBQ':function(_0x39153e,_0x2698f7){return _0x39153e(_0x2698f7);}};if(!_0x2d15db[_0x43f5c0(0xf9)](existsSync,_0x2db38d))return[];const _0x285828=[];try{const _0x267c5c=await readdir(_0x2db38d,{'withFileTypes':!![]});for(const _0x3efed2 of _0x267c5c){if(_0x3efed2[_0x43f5c0(0x149)]()){const _0x40d5ee=join(_0x2db38d,_0x3efed2[_0x43f5c0(0x137)],_0x43f5c0(0x129));if(existsSync(_0x40d5ee)){let _0x44e2b1=_0x3efed2[_0x43f5c0(0x137)];try{const _0x4ee5e4=await readFile(_0x40d5ee,'utf-8'),_0x11a51e=_0x4ee5e4[_0x43f5c0(0x123)](/name:\s*(.+)/);_0x11a51e&&(_0x44e2b1=_0x11a51e[0x1][_0x43f5c0(0xff)]());}catch{}_0x285828[_0x43f5c0(0x13d)]({'name':_0x3efed2[_0x43f5c0(0x137)],'displayName':_0x44e2b1,'path':_0x40d5ee,'level':_0x3d5652});}}}}catch{return[];}return _0x285828;}async function getInstalledSkills(){const _0x2acfb0=_0x4822,_0x5ab273={'lzPBa':function(_0x1ff9b6,_0x536de4,_0x254d27){return _0x1ff9b6(_0x536de4,_0x254d27);},'pSmLd':'user'},[_0xfb38bf,_0x3dd441]=await Promise['all']([getSkillsFromDir(getProjectSkillsDir(),_0x2acfb0(0x12d)),_0x5ab273[_0x2acfb0(0x118)](getSkillsFromDir,getUserSkillsDir(),_0x5ab273[_0x2acfb0(0x110)])]);return{'project':_0xfb38bf,'user':_0x3dd441};}async function getEnvironments(){const _0x5441fd={'uoyuN':function(_0x43523b,_0x465886){return _0x43523b(_0x465886);},'yUOdC':function(_0x1e3ebf,_0x14ffdf,_0x5d5a82){return _0x1e3ebf(_0x14ffdf,_0x5d5a82);},'IAqxj':function(_0xb0552b,_0x47ea60,_0x3e3c2f){return _0xb0552b(_0x47ea60,_0x3e3c2f);},'lIrOU':function(_0x46abea,_0x444e08){return _0x46abea===_0x444e08;}},{envNames:_0x53b3e0,activeEnv:_0x2c2548}=await getEnvNames(),_0x3a68a2=getRangerDir();if(!existsSync(_0x3a68a2))return{'envs':[],'activeEnv':null};const _0x375b4e=_0x53b3e0['map'](_0x407d62=>{const _0x4c446a=_0x4822,_0x5dad39=_0x5441fd[_0x4c446a(0x14d)](getEnvDir,_0x407d62),_0x41dd6d=_0x5441fd['yUOdC'](join,_0x5dad39,_0x4c446a(0x105)),_0x2be1ba=_0x5441fd[_0x4c446a(0x130)](join,_0x5dad39,_0x4c446a(0x146)),_0x5564cb=_0x5441fd['IAqxj'](join,_0x5dad39,'auth.json.enc');return{'name':_0x407d62,'settingsPath':existsSync(_0x41dd6d)?_0x41dd6d:_0x4c446a(0x144),'hasPlaintextAuth':_0x5441fd[_0x4c446a(0x14d)](existsSync,_0x2be1ba),'hasEncryptedAuth':existsSync(_0x5564cb),'isActive':_0x5441fd[_0x4c446a(0x14a)](_0x407d62,_0x2c2548)};});return{'envs':_0x375b4e,'activeEnv':_0x2c2548};}export async function status(){const _0x5edada=_0x4822,_0x564f01={'iTdPn':_0x5edada(0x11f),'GPMzA':function(_0x17a877){return _0x17a877();},'Tagkx':function(_0x308aeb,_0x3cfde5){return _0x308aeb(_0x3cfde5);},'UtKqV':function(_0x12aaf8,_0x2a9d8c,_0x47e396){return _0x12aaf8(_0x2a9d8c,_0x47e396);},'YhTOL':function(_0x246b10,_0x5ef924){return _0x246b10!==_0x5ef924;},'KPNeu':function(_0x265612,_0x367c78){return _0x265612(_0x367c78);},'zYqjT':function(_0x499e79){return _0x499e79();},'bnNCv':'\x0a---\x20OpenCode\x20Plugin\x20---','ECnVd':function(_0x400fb0){return _0x400fb0();},'YsiKz':_0x5edada(0x100),'FXVkd':function(_0x522970,_0x55470c){return _0x522970===_0x55470c;},'ggHPT':'not_configured','BClZF':_0x5edada(0x103),'TZTMO':'unknown','DmsPw':_0x5edada(0x14b),'oGOMP':'disabled','UKEXF':_0x5edada(0x142),'EQDUM':_0x5edada(0x151),'ftnFX':_0x5edada(0x111),'bLTTG':_0x5edada(0x145),'grBnr':function(_0x3833c3,_0x487538,_0x12039a){return _0x3833c3(_0x487538,_0x12039a);},'aqaFp':function(_0xf501dd,_0xe35066){return _0xf501dd(_0xe35066);},'oPDhY':function(_0x5e6dd4,_0x4ecbc3){return _0x5e6dd4(_0x4ecbc3);},'dnXBZ':function(_0x27a86f){return _0x27a86f();},'utRar':'No\x20profiles\x20configured','YNBSb':_0x5edada(0x10c),'CegDO':_0x5edada(0x144),'ONkmk':function(_0x161760,_0x48c73f){return _0x161760(_0x48c73f);}};console['log'](_0x564f01[_0x5edada(0x134)]);const _0xe367b3=process['cwd'](),_0x20da9f=_0x564f01['GPMzA'](getRangerDir);if(!_0x564f01[_0x5edada(0x11c)](existsSync,_0x20da9f)){console['log']('Root:\x20'+_0x564f01['UtKqV'](link,_0xe367b3,_0x564f01['Tagkx'](bold,basename(_0xe367b3)))),console[_0x5edada(0xfe)](_0x5edada(0x102)),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console['log'](_0x5edada(0x14c)+link(_0xe367b3,bold(basename(_0xe367b3))));const _0x498154=_0x564f01[_0x5edada(0x150)](getCurrentVersion),_0x255710=getLatestVersion();if(_0x255710&&_0x564f01[_0x5edada(0x10e)](_0x255710,_0x498154))console['log']('Version:\x20'+_0x498154+'\x20(latest:\x20'+_0x255710+')'),console['log'](_0x5edada(0x157));else _0x255710?console[_0x5edada(0xfe)]('Version:\x20'+_0x498154+'\x20(up\x20to\x20date)'):console[_0x5edada(0xfe)](_0x5edada(0x120)+_0x498154);const _0x36f6a5=await getToken();if(_0x36f6a5){const _0x3b450f=await _0x564f01['KPNeu'](getCurrentUser,_0x36f6a5);_0x3b450f[_0x5edada(0x13f)]?console['log']('Organization:\x20'+bold(_0x3b450f[_0x5edada(0x13b)][_0x5edada(0x136)])):(console[_0x5edada(0xfe)]('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console['log'](_0x5edada(0xfd)));}else console['log']('API\x20Token:\x20✗\x20Not\x20found'),console[_0x5edada(0xfe)](_0x5edada(0xfd));process['env']['DEBUG']&&(console['log'](_0x5edada(0x125)+_0x564f01['zYqjT'](getCurrentEnvironment)),console['log']('API\x20URL:\x20'+getApiBaseUrl()));console['log'](_0x564f01['bnNCv']);const _0x18f96f=await _0x564f01[_0x5edada(0x109)](getOpencodePluginStatus);if(_0x18f96f['status']===_0x5edada(0x159))console['log']('\x20\x20'+bold(_0x564f01['YsiKz'])+':\x20configured'),_0x18f96f['details']&&console[_0x5edada(0xfe)]('\x20\x20'+_0x18f96f[_0x5edada(0x156)]);else _0x564f01[_0x5edada(0x122)](_0x18f96f[_0x5edada(0xfc)],_0x564f01['ggHPT'])?(console['log'](_0x5edada(0x128)),_0x18f96f[_0x5edada(0x156)]&&console[_0x5edada(0xfe)]('\x20\x20'+_0x18f96f['details']),console[_0x5edada(0xfe)](_0x564f01['BClZF'])):console['log'](_0x5edada(0xfa));console['log']('\x0a---\x20Claude\x20Code\x20Plugin\x20---');const _0x1dabe6=await _0x564f01[_0x5edada(0x11e)](getPluginInfo,'ranger@trailhead');if(_0x1dabe6){const _0x111f77=_0x1dabe6['scope']||_0x564f01[_0x5edada(0x12e)],_0x46ebc7=_0x1dabe6[_0x5edada(0x14b)]?_0x564f01[_0x5edada(0x12a)]:_0x564f01[_0x5edada(0x13e)];console['log']('\x20\x20'+_0x564f01['Tagkx'](bold,_0x564f01[_0x5edada(0x155)])+_0x5edada(0x108)+_0x111f77+',\x20'+_0x46ebc7+')');}else console[_0x5edada(0xfe)](_0x564f01['EQDUM']),console[_0x5edada(0xfe)](_0x5edada(0x133));console[_0x5edada(0xfe)](_0x5edada(0x139));const {project:_0x173b5b,user:_0x32d2b2}=await _0x564f01['ECnVd'](getInstalledSkills),_0x493a43=_0x173b5b['filter'](_0x5b255e=>RANGER_MANAGED_SKILLS[_0x5edada(0x143)](_0x5b255e['name'])),_0x30fc19=_0x32d2b2['filter'](_0x1dc341=>RANGER_MANAGED_SKILLS[_0x5edada(0x143)](_0x1dc341['name'])),_0x19e1dc=_0x493a43[_0x5edada(0x131)]+_0x30fc19['length'];if(_0x19e1dc===0x0)console[_0x5edada(0xfe)](_0x564f01[_0x5edada(0x124)]),console[_0x5edada(0xfe)]('\x20\x20Run:\x20ranger\x20skillup');else{if(_0x493a43[_0x5edada(0x131)]>0x0){console['log'](_0x564f01['bLTTG']);for(const _0xbeb1d6 of _0x493a43){console[_0x5edada(0xfe)](_0x5edada(0x11a)+bold(_0xbeb1d6['displayName'])+':\x20'+_0x564f01[_0x5edada(0x13a)](link,_0xbeb1d6[_0x5edada(0x11d)],_0x564f01[_0x5edada(0x12b)](basename,_0xbeb1d6['path'])));}}if(_0x30fc19[_0x5edada(0x131)]>0x0){console['log'](_0x5edada(0x101));for(const _0x492756 of _0x30fc19){console['log']('\x20\x20\x20\x20'+bold(_0x492756['displayName'])+':\x20'+link(_0x492756[_0x5edada(0x11d)],_0x564f01[_0x5edada(0x158)](basename,_0x492756['path'])));}}}console['log']('\x0a---\x20Profiles\x20---');const {envs:_0x4440a4,activeEnv:_0x2b04e7}=await _0x564f01[_0x5edada(0x148)](getEnvironments);if(_0x4440a4['length']===0x0)console[_0x5edada(0xfe)](_0x564f01['utRar']),console['log']('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{for(const _0xe2d1a7 of _0x4440a4){const _0x416b60=_0xe2d1a7[_0x5edada(0x106)]?'\x20(active)':'',_0x3f631e=_0xe2d1a7[_0x5edada(0x115)]?_0x564f01[_0x5edada(0x10f)]:_0xe2d1a7['hasPlaintextAuth']?_0x5edada(0x152):_0x5edada(0xf8);console['log']('\x20\x20'+bold(_0xe2d1a7[_0x5edada(0x137)])+_0x416b60),console[_0x5edada(0xfe)]('\x20\x20\x20\x20Auth:\x20'+_0x3f631e),_0xe2d1a7['settingsPath']!==_0x564f01['CegDO']&&console['log']('\x20\x20\x20\x20Settings:\x20'+_0x564f01['grBnr'](link,_0xe2d1a7['settingsPath'],_0x564f01[_0x5edada(0x13c)](basename,_0xe2d1a7[_0x5edada(0x12c)])));}!_0x2b04e7&&(console['log']('\x0a\x20\x20No\x20active\x20profile\x20set'),console['log'](_0x5edada(0x117)+_0x4440a4['map'](_0x3bf52e=>_0x3bf52e['name'])['join'](',\x20')+')'));}console['log']('');}
|
|
1
|
+
const _0x195f95=_0xb971;(function(_0x323aa8,_0x465c04){const _0x2aa33f=_0xb971,_0x4972b4=_0x323aa8();while(!![]){try{const _0x551c34=parseInt(_0x2aa33f(0x7c))/0x1+parseInt(_0x2aa33f(0xc1))/0x2*(parseInt(_0x2aa33f(0xb3))/0x3)+-parseInt(_0x2aa33f(0x7d))/0x4+parseInt(_0x2aa33f(0x7e))/0x5+parseInt(_0x2aa33f(0xb7))/0x6*(parseInt(_0x2aa33f(0x89))/0x7)+-parseInt(_0x2aa33f(0x9a))/0x8+-parseInt(_0x2aa33f(0x9e))/0x9;if(_0x551c34===_0x465c04)break;else _0x4972b4['push'](_0x4972b4['shift']());}catch(_0x2771ec){_0x4972b4['push'](_0x4972b4['shift']());}}}(_0x7597,0x8577b));import{readFile,readdir}from'fs/promises';function _0xb971(_0x5570ec,_0x319baa){_0x5570ec=_0x5570ec-0x6b;const _0x759789=_0x7597();let _0xb97147=_0x759789[_0x5570ec];return _0xb97147;}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=_0x171ede=>_0x195f95(0x92)+_0x171ede+_0x195f95(0xa0),link=(_0x316eb4,_0x3dfb54)=>'\x1b]8;;file://'+_0x316eb4+'\x07'+(_0x3dfb54||_0x316eb4)+_0x195f95(0xa4);async function getOpencodePluginStatus(){const _0x2f915c=_0x195f95,_0x2caa6f={'gzTJo':function(_0xc28fa2,_0x4f94c3){return _0xc28fa2(_0x4f94c3);},'vCtHA':function(_0x39b698,_0x46253e){return _0x39b698!==_0x46253e;},'rKeUu':'opencode-plugin','JYQhm':function(_0x481ee5,_0x1732e9){return _0x481ee5>_0x1732e9;},'aPGcv':function(_0x4eb5e6,_0x2a362e){return _0x4eb5e6(_0x2a362e);},'vIezM':function(_0x4e829d,_0x2065bd){return _0x4e829d(_0x2065bd);},'bgcHi':_0x2f915c(0x84),'CQfxP':'debug','bnrZs':'pipe','dcQyf':_0x2f915c(0x80),'EBOSz':_0x2f915c(0x8b)};return new Promise(_0x5444b5=>{const _0x5450b0=_0x2f915c,_0x425655={'HlHSt':function(_0x99bed2,_0x5ce2d9){return _0x2caa6f['vCtHA'](_0x99bed2,_0x5ce2d9);},'oIiAo':_0x2caa6f[_0x5450b0(0xce)],'Jpkdf':function(_0x14aead,_0x130546){const _0x3e1687=_0x5450b0;return _0x2caa6f[_0x3e1687(0xc6)](_0x14aead,_0x130546);},'qQAcZ':function(_0x53bdbb,_0x462aaf){return _0x2caa6f['aPGcv'](_0x53bdbb,_0x462aaf);},'EaArY':function(_0x47ef7f,_0x1d8604){const _0x3368c8=_0x5450b0;return _0x2caa6f[_0x3368c8(0x7a)](_0x47ef7f,_0x1d8604);}},_0x380bc6=spawn(_0x2caa6f[_0x5450b0(0x8e)],[_0x2caa6f[_0x5450b0(0xa1)],_0x5450b0(0xcb)],{'stdio':[_0x5450b0(0x97),'pipe',_0x2caa6f['bnrZs']]});let _0x53132b='';_0x380bc6[_0x5450b0(0x9f)]?.['on'](_0x2caa6f['dcQyf'],_0x2f5f68=>{const _0x3997ec=_0x5450b0;_0x53132b+=_0x2f5f68[_0x3997ec(0xa2)]();}),_0x380bc6[_0x5450b0(0x9c)]?.['on'](_0x2caa6f['dcQyf'],_0x31eaf8=>{_0x53132b+=_0x31eaf8['toString']();}),_0x380bc6['on']('error',()=>{const _0x257465=_0x5450b0;_0x2caa6f[_0x257465(0xc2)](_0x5444b5,{'status':'not_installed'});}),_0x380bc6['on'](_0x2caa6f['EBOSz'],_0x390b17=>{const _0x1ec7f4=_0x5450b0;if(_0x390b17!==0x0){_0x5444b5({'status':_0x1ec7f4(0x93)});return;}const _0xa4b55=_0x53132b['trim']();let _0x1e8289=null;if(_0xa4b55)try{_0x1e8289=JSON['parse'](_0xa4b55);}catch{const _0x3febe6=_0xa4b55['match'](/\{[\s\S]*\}$/);if(_0x3febe6)try{_0x1e8289=JSON['parse'](_0x3febe6[0x0]);}catch{_0x1e8289=null;}}const _0x5866ce=Array['isArray'](_0x1e8289?.['plugin'])?_0x1e8289?.[_0x1ec7f4(0x83)]:[],_0x2255da=_0x5866ce['some'](_0x1899ed=>{const _0x2ba1a8=_0x1ec7f4;if(_0x425655['HlHSt'](typeof _0x1899ed,_0x2ba1a8(0x96)))return![];return _0x1899ed[_0x2ba1a8(0x78)](_0x2ba1a8(0xb4))||_0x1899ed[_0x2ba1a8(0x78)](_0x425655['oIiAo']);});if(_0x2255da){_0x5444b5({'status':_0x1ec7f4(0xb2),'details':_0x425655[_0x1ec7f4(0xd1)](_0x5866ce['length'],0x0)?_0x5866ce[_0x1ec7f4(0x88)]+'\x20plugin(s)\x20configured':undefined});return;}if(_0x425655[_0x1ec7f4(0xd1)](_0x5866ce[_0x1ec7f4(0x88)],0x0)){_0x425655[_0x1ec7f4(0xc5)](_0x5444b5,{'status':'not_configured','details':_0x5866ce[_0x1ec7f4(0x88)]+_0x1ec7f4(0xc3)});return;}_0x425655['EaArY'](_0x5444b5,{'status':'not_configured'});});});}async function getSkillsFromDir(_0x1f273e,_0x1f150d){const _0x5a9337=_0x195f95,_0x302a6f={'eGrUw':function(_0x48f573,_0x4a4420,_0x39ea43,_0x4c4dc6){return _0x48f573(_0x4a4420,_0x39ea43,_0x4c4dc6);},'KLFXN':function(_0x2cc034,_0xd9ac4f,_0x25ef8d){return _0x2cc034(_0xd9ac4f,_0x25ef8d);}};if(!existsSync(_0x1f273e))return[];const _0x14d9f7=[];try{const _0x4f2f84=await readdir(_0x1f273e,{'withFileTypes':!![]});for(const _0x399f5f of _0x4f2f84){if(_0x399f5f['isDirectory']()){const _0x51418a=_0x302a6f[_0x5a9337(0x94)](join,_0x1f273e,_0x399f5f['name'],_0x5a9337(0xb8));if(existsSync(_0x51418a)){let _0x441fcd=_0x399f5f[_0x5a9337(0xb0)];try{const _0x3112bd=await _0x302a6f[_0x5a9337(0xb6)](readFile,_0x51418a,'utf-8'),_0x3fc2e5=_0x3112bd[_0x5a9337(0xae)](/name:\s*(.+)/);_0x3fc2e5&&(_0x441fcd=_0x3fc2e5[0x1][_0x5a9337(0xa7)]());}catch{}_0x14d9f7['push']({'name':_0x399f5f['name'],'displayName':_0x441fcd,'path':_0x51418a,'level':_0x1f150d});}}}}catch{return[];}return _0x14d9f7;}async function getInstalledSkills(){const _0x35a37c=_0x195f95,_0x2c645e={'cDfiO':function(_0xf7a059,_0xba0fd1,_0xb61c63){return _0xf7a059(_0xba0fd1,_0xb61c63);},'zDpOU':_0x35a37c(0xc9),'ckNed':function(_0x24dc14){return _0x24dc14();}},[_0x2b1d3f,_0x49d639]=await Promise['all']([_0x2c645e[_0x35a37c(0xb5)](getSkillsFromDir,getProjectSkillsDir(),_0x2c645e['zDpOU']),_0x2c645e['cDfiO'](getSkillsFromDir,_0x2c645e['ckNed'](getUserSkillsDir),'user')]);return{'project':_0x2b1d3f,'user':_0x49d639};}async function getEnvironments(){const _0x40246c=_0x195f95,_0x50edf0={'spDBd':function(_0x435d80,_0x80676c){return _0x435d80(_0x80676c);},'pqIby':'settings.json','knONd':function(_0x414f90,_0x51ea6c,_0x4c1d49){return _0x414f90(_0x51ea6c,_0x4c1d49);},'NwTiI':'auth.json','rwVlC':'(not\x20found)','iClKB':function(_0x5ef48b){return _0x5ef48b();}},{envNames:_0x1b840b,activeEnv:_0x54d284}=await _0x50edf0['iClKB'](getEnvNames),_0x411832=getRangerDir();if(!existsSync(_0x411832))return{'envs':[],'activeEnv':null};const _0x56436e=_0x1b840b[_0x40246c(0xba)](_0x33bedf=>{const _0x2cf34f=_0x40246c,_0x215376=_0x50edf0[_0x2cf34f(0x9d)](getEnvDir,_0x33bedf),_0xb62b01=join(_0x215376,_0x50edf0[_0x2cf34f(0x87)]),_0x259da1=_0x50edf0[_0x2cf34f(0x72)](join,_0x215376,_0x50edf0['NwTiI']),_0x10934d=join(_0x215376,'auth.json.enc');return{'name':_0x33bedf,'settingsPath':_0x50edf0['spDBd'](existsSync,_0xb62b01)?_0xb62b01:_0x50edf0['rwVlC'],'hasPlaintextAuth':existsSync(_0x259da1),'hasEncryptedAuth':existsSync(_0x10934d),'isActive':_0x33bedf===_0x54d284};});return{'envs':_0x56436e,'activeEnv':_0x54d284};}function _0x7597(){const _0x570976=['WunsP','No\x20skills\x20installed','Jpkdf','plaintext','\x0a\x20\x20No\x20active\x20profile\x20set','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','enabled','displayName','status','cDJnH','knONd','sbnPM','Version:\x20','\x20\x20Run:\x20ranger\x20setup\x20[token]','log','RGdbO','includes','\x0a📊\x20Ranger\x20Status\x0a','vIezM','Organization:\x20','473327eMEzCS','2071412EtfLUu','1357150tMSjIl','\x20\x20Run:\x20ranger\x20skillup','data','hpupf','RdzFe','plugin','opencode','(not\x20found)','path','pqIby','length','469AqHqYO','FOmhv','close','\x20\x20Run:\x20ranger\x20setup\x20--opencode','\x0a---\x20Skills\x20---','bgcHi','user','\x20\x20User-level:','KLFgs','\x1b[1m','not_installed','eGrUw','No\x20profiles\x20configured','string','ignore','DEBUG','LYsym','4329448QoIDOf','\x20\x20\x20\x20Settings:\x20','stderr','spDBd','3709305LwXkcD','stdout','\x1b[0m','CQfxP','toString','success','\x1b]8;;\x07','scope','filter','trim','details','HLZiT','hasPlaintextAuth','\x20\x20Project-level:','RtLzv','\x0a---\x20Profiles\x20---','match','\x20\x20Not\x20installed','name','\x20\x20Run:\x20ranger\x20update','configured','1934337EtAElS','@ranger-testing/opencode-plugin','cDfiO','KLFXN','56268MOTkvi','SKILL.md','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','map','tKsNK','bjnRD','\x20(active)','\x20\x20Not\x20configured','GwbzL','Root:\x20','2eEvSmN','gzTJo','\x20plugin(s)\x20configured','isActive','qQAcZ','JYQhm',':\x20configured','settingsPath','project','API\x20Environment:\x20','config','hasEncryptedAuth','\x0a---\x20OpenCode\x20Plugin\x20---','rKeUu'];_0x7597=function(){return _0x570976;};return _0x7597();}export async function status(){const _0x318c14=_0x195f95,_0x30e77e={'bjnRD':function(_0x23ad29,_0x104a65){return _0x23ad29(_0x104a65);},'wjgMv':function(_0x4f08e6,_0x4bd9ad,_0x4d5b00){return _0x4f08e6(_0x4bd9ad,_0x4d5b00);},'RGdbO':function(_0x84b3ef,_0x3d7fb9){return _0x84b3ef(_0x3d7fb9);},'ukxEN':function(_0x1aed0f,_0x49ced5){return _0x1aed0f!==_0x49ced5;},'RtLzv':function(_0x18e0e4){return _0x18e0e4();},'WunsP':function(_0x1a0a92,_0x3e9282){return _0x1a0a92===_0x3e9282;},'sbnPM':'configured','iZPBS':'@ranger-testing/opencode-plugin','FOmhv':function(_0x47750a,_0x4fa48d){return _0x47750a===_0x4fa48d;},'RdzFe':'not_configured','LYsym':_0x318c14(0x8c),'HLZiT':'ranger@trailhead','VZIqX':_0x318c14(0x6e),'KLFgs':_0x318c14(0xaf),'tKsNK':_0x318c14(0x8d),'CdFfP':function(_0x5d24c3){return _0x5d24c3();},'RoxkH':function(_0x5bf060,_0x36d53b){return _0x5bf060+_0x36d53b;},'cDJnH':_0x318c14(0xd0),'EqtwZ':function(_0x10ad1d,_0x50adae){return _0x10ad1d>_0x50adae;},'GwbzL':function(_0x38bfa5,_0x398a87,_0x3a75d4){return _0x38bfa5(_0x398a87,_0x3a75d4);},'brglD':function(_0x5cff75,_0x4b0fc5){return _0x5cff75(_0x4b0fc5);},'hpupf':function(_0x3a11e5,_0x191c1a,_0x2f93d5){return _0x3a11e5(_0x191c1a,_0x2f93d5);},'jmTzP':function(_0x5518d7){return _0x5518d7();},'iiFUD':_0x318c14(0x95),'ghQUY':_0x318c14(0x6b),'Tczpi':_0x318c14(0x85)};console['log'](_0x318c14(0x79));const _0x4c8b49=process['cwd'](),_0x7a32a8=getRangerDir();if(!_0x30e77e[_0x318c14(0xbc)](existsSync,_0x7a32a8)){console[_0x318c14(0x76)](_0x318c14(0xc0)+_0x30e77e['wjgMv'](link,_0x4c8b49,bold(basename(_0x4c8b49)))),console[_0x318c14(0x76)]('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console['log'](_0x318c14(0xc0)+link(_0x4c8b49,_0x30e77e[_0x318c14(0xbc)](bold,_0x30e77e[_0x318c14(0x77)](basename,_0x4c8b49))));const _0xa050e4=getCurrentVersion(),_0xde048d=getLatestVersion();if(_0xde048d&&_0x30e77e['ukxEN'](_0xde048d,_0xa050e4))console[_0x318c14(0x76)](_0x318c14(0x74)+_0xa050e4+'\x20(latest:\x20'+_0xde048d+')'),console['log'](_0x318c14(0xb1));else _0xde048d?console['log']('Version:\x20'+_0xa050e4+'\x20(up\x20to\x20date)'):console[_0x318c14(0x76)](_0x318c14(0x74)+_0xa050e4);const _0x3ed4f1=await _0x30e77e[_0x318c14(0xac)](getToken);if(_0x3ed4f1){const _0x49f9d1=await getCurrentUser(_0x3ed4f1);_0x49f9d1[_0x318c14(0xa3)]?console['log'](_0x318c14(0x7b)+bold(_0x49f9d1[_0x318c14(0x8f)]['organizationName'])):(console['log'](_0x318c14(0x6d)),console[_0x318c14(0x76)](_0x318c14(0x75)));}else console['log']('API\x20Token:\x20✗\x20Not\x20found'),console['log'](_0x318c14(0x75));process['env'][_0x318c14(0x98)]&&(console[_0x318c14(0x76)](_0x318c14(0xca)+getCurrentEnvironment()),console[_0x318c14(0x76)]('API\x20URL:\x20'+_0x30e77e['RtLzv'](getApiBaseUrl)));console[_0x318c14(0x76)](_0x318c14(0xcd));const _0x23cb27=await getOpencodePluginStatus();if(_0x30e77e[_0x318c14(0xcf)](_0x23cb27[_0x318c14(0x70)],_0x30e77e[_0x318c14(0x73)]))console['log']('\x20\x20'+_0x30e77e['RGdbO'](bold,_0x30e77e['iZPBS'])+_0x318c14(0xc7)),_0x23cb27['details']&&console['log']('\x20\x20'+_0x23cb27[_0x318c14(0xa8)]);else _0x30e77e[_0x318c14(0x8a)](_0x23cb27[_0x318c14(0x70)],_0x30e77e[_0x318c14(0x82)])?(console['log'](_0x318c14(0xbe)),_0x23cb27['details']&&console['log']('\x20\x20'+_0x23cb27[_0x318c14(0xa8)]),console[_0x318c14(0x76)](_0x30e77e[_0x318c14(0x99)])):console[_0x318c14(0x76)]('\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available');console['log']('\x0a---\x20Claude\x20Code\x20Plugin\x20---');const _0x344f43=await getPluginInfo(_0x30e77e[_0x318c14(0xa9)]);if(_0x344f43){const _0x5342c9=_0x344f43[_0x318c14(0xa5)]||'unknown',_0x264579=_0x344f43['enabled']?_0x30e77e['VZIqX']:'disabled';console[_0x318c14(0x76)]('\x20\x20'+bold('ranger@trailhead')+':\x20installed\x20('+_0x5342c9+',\x20'+_0x264579+')');}else console['log'](_0x30e77e[_0x318c14(0x91)]),console[_0x318c14(0x76)](_0x318c14(0xb9));console['log'](_0x30e77e[_0x318c14(0xbb)]);const {project:_0x5ae53f,user:_0x548968}=await _0x30e77e['CdFfP'](getInstalledSkills),_0x92028e=_0x5ae53f['filter'](_0x1eada6=>RANGER_MANAGED_SKILLS[_0x318c14(0x78)](_0x1eada6['name'])),_0x3bb24=_0x548968[_0x318c14(0xa6)](_0x1c2641=>RANGER_MANAGED_SKILLS['includes'](_0x1c2641['name'])),_0xb94201=_0x30e77e['RoxkH'](_0x92028e[_0x318c14(0x88)],_0x3bb24[_0x318c14(0x88)]);if(_0xb94201===0x0)console['log'](_0x30e77e[_0x318c14(0x71)]),console['log'](_0x318c14(0x7f));else{if(_0x30e77e['EqtwZ'](_0x92028e[_0x318c14(0x88)],0x0)){console['log'](_0x318c14(0xab));for(const _0x5ddbb3 of _0x92028e){console['log']('\x20\x20\x20\x20'+bold(_0x5ddbb3['displayName'])+':\x20'+_0x30e77e[_0x318c14(0xbf)](link,_0x5ddbb3[_0x318c14(0x86)],_0x30e77e['brglD'](basename,_0x5ddbb3[_0x318c14(0x86)])));}}if(_0x3bb24['length']>0x0){console[_0x318c14(0x76)](_0x318c14(0x90));for(const _0x2da03c of _0x3bb24){console['log']('\x20\x20\x20\x20'+bold(_0x2da03c[_0x318c14(0x6f)])+':\x20'+_0x30e77e[_0x318c14(0x81)](link,_0x2da03c[_0x318c14(0x86)],_0x30e77e[_0x318c14(0xbc)](basename,_0x2da03c['path'])));}}}console['log'](_0x318c14(0xad));const {envs:_0x4b049f,activeEnv:_0x358a7a}=await _0x30e77e['jmTzP'](getEnvironments);if(_0x30e77e['FOmhv'](_0x4b049f[_0x318c14(0x88)],0x0))console[_0x318c14(0x76)](_0x30e77e['iiFUD']),console['log']('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{for(const _0x4ed885 of _0x4b049f){const _0x2e959a=_0x4ed885[_0x318c14(0xc4)]?_0x318c14(0xbd):'',_0x256d30=_0x4ed885[_0x318c14(0xcc)]?'encrypted':_0x4ed885[_0x318c14(0xaa)]?_0x30e77e['ghQUY']:'none';console[_0x318c14(0x76)]('\x20\x20'+bold(_0x4ed885['name'])+_0x2e959a),console[_0x318c14(0x76)]('\x20\x20\x20\x20Auth:\x20'+_0x256d30),_0x4ed885[_0x318c14(0xc8)]!==_0x30e77e['Tczpi']&&console['log'](_0x318c14(0x9b)+_0x30e77e['wjgMv'](link,_0x4ed885[_0x318c14(0xc8)],_0x30e77e[_0x318c14(0x77)](basename,_0x4ed885[_0x318c14(0xc8)])));}!_0x358a7a&&(console['log'](_0x318c14(0x6c)),console['log']('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x4b049f['map'](_0xe9afc0=>_0xe9afc0[_0x318c14(0xb0)])['join'](',\x20')+')'));}console[_0x318c14(0x76)]('');}
|
package/build/commands/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x5d63ce,_0x394e7f){const _0x2ddb9c=_0x4513,_0xddfce2=_0x5d63ce();while(!![]){try{const _0x14658f=parseInt(_0x2ddb9c(0x1ad))/0x1*(-parseInt(_0x2ddb9c(0x178))/0x2)+parseInt(_0x2ddb9c(0x1b2))/0x3*(parseInt(_0x2ddb9c(0x1ae))/0x4)+-parseInt(_0x2ddb9c(0x16f))/0x5+-parseInt(_0x2ddb9c(0x1a3))/0x6*(-parseInt(_0x2ddb9c(0x183))/0x7)+-parseInt(_0x2ddb9c(0x188))/0x8+-parseInt(_0x2ddb9c(0x186))/0x9+parseInt(_0x2ddb9c(0x177))/0xa;if(_0x14658f===_0x394e7f)break;else _0xddfce2['push'](_0xddfce2['shift']());}catch(_0x5202a7){_0xddfce2['push'](_0xddfce2['shift']());}}}(_0x10a3,0xe32b2));import{spawn}from'child_process';import{existsSync}from'fs';import{readFile,writeFile}from'fs/promises';import{installSkill,removeSkill,RANGER_MANAGED_SKILLS,DEPRECATED_SKILLS}from'./utils/skills.js';import{PACKAGE_NAME,getCurrentVersion,getLatestVersion,compareVersions}from'./utils/version.js';import{getSkillsDir}from'./utils/claudeConfig.js';import{getOpencodeSkillsDir}from'./utils/opencodeConfig.js';import{join}from'path';import{migrateActiveProfileFile}from'./utils/activeProfile.js';function _0x4513(_0x70687,_0x1c14e8){_0x70687=_0x70687-0x16d;const _0x10a3fd=_0x10a3();let _0x451354=_0x10a3fd[_0x70687];return _0x451354;}import{getRangerDir}from'./utils/rangerRoot.js';import{isMarketplaceAdded,isPluginInstalled}from'./utils/claudePlugin.js';async function runInstall(){const _0x38cc48=_0x4513,_0x3cfa72={'JCCUG':function(_0x32b587,_0x562de1){return _0x32b587(_0x562de1);},'eIMhL':function(_0x3177d8,_0x1b29fb){return _0x3177d8===_0x1b29fb;},'vVnOt':_0x38cc48(0x198),'UhDYd':'inherit','uIZBG':function(_0x37eee8,_0x3e6c43){return _0x37eee8===_0x3e6c43;},'lfCTB':_0x38cc48(0x174),'zheiP':'close','MiEsm':_0x38cc48(0x173)};return new Promise(_0xb8d0b6=>{const _0x10ab32=_0x38cc48,_0x36c9e8={'MANdN':function(_0x5ef3d0,_0x495994){return _0x3cfa72['eIMhL'](_0x5ef3d0,_0x495994);}};console['log'](_0x10ab32(0x17e)+PACKAGE_NAME+'@latest...\x0a');const _0x146671=spawn(_0x3cfa72[_0x10ab32(0x175)],[_0x10ab32(0x199),'-g',PACKAGE_NAME+_0x10ab32(0x1b0)],{'stdio':_0x3cfa72[_0x10ab32(0x17c)],'shell':_0x3cfa72[_0x10ab32(0x1ab)](process[_0x10ab32(0x18e)],_0x3cfa72['lfCTB'])});_0x146671['on'](_0x3cfa72[_0x10ab32(0x18c)],_0x3a9722=>{const _0x26c016=_0x10ab32;_0xb8d0b6(_0x36c9e8[_0x26c016(0x182)](_0x3a9722,0x0));}),_0x146671['on'](_0x3cfa72[_0x10ab32(0x18f)],()=>{const _0x48274c=_0x10ab32;_0x3cfa72[_0x48274c(0x190)](_0xb8d0b6,![]);});});}async function updateClaudeMarketplace(){const _0x171653=_0x4513,_0x1364cb={'PqQGk':function(_0x5c95bc,_0x285e94){return _0x5c95bc(_0x285e94);},'jIIIZ':function(_0x288673,_0x3c41be,_0x457706,_0x3db067){return _0x288673(_0x3c41be,_0x457706,_0x3db067);},'claus':_0x171653(0x19e),'nHvyh':_0x171653(0x1a2),'BCxua':_0x171653(0x1a9),'DbfiX':'update','uJfiz':'pipe'};return new Promise(_0x3f1f2e=>{const _0x5ba7ce=_0x171653,_0xfde426=_0x1364cb[_0x5ba7ce(0x196)](spawn,_0x1364cb['claus'],[_0x1364cb[_0x5ba7ce(0x19f)],_0x1364cb[_0x5ba7ce(0x18b)],_0x1364cb[_0x5ba7ce(0x184)],'trailhead'],{'stdio':_0x1364cb['uJfiz'],'shell':process[_0x5ba7ce(0x18e)]===_0x5ba7ce(0x174)});_0xfde426['on']('close',_0xe4ebc0=>{_0x3f1f2e(_0xe4ebc0===0x0);}),_0xfde426['on']('error',()=>{_0x1364cb['PqQGk'](_0x3f1f2e,![]);});});}async function updateClaudePlugin(_0x4dc09f){const _0x33b176=_0x4513,_0x2f7b76={'IQzCi':function(_0xebe3ce,_0x1a7cae){return _0xebe3ce(_0x1a7cae);},'ljKoL':function(_0x4367b4,_0x554419){return _0x4367b4===_0x554419;},'HjDsc':function(_0x42bdd5,_0x3b8672){return _0x42bdd5(_0x3b8672);},'vxIbO':_0x33b176(0x17a),'BlGkf':'--scope','vIJiZ':function(_0x398227,_0x24057a,_0x555b03,_0x809b66){return _0x398227(_0x24057a,_0x555b03,_0x809b66);},'nqjnV':'pipe','wjfiL':'error'};return new Promise(_0x232bb2=>{const _0x429064=_0x33b176,_0x4a13bb=[_0x429064(0x1a2),'update',_0x2f7b76[_0x429064(0x1af)]];_0x4dc09f&&_0x4a13bb[_0x429064(0x16e)](_0x2f7b76['BlGkf'],_0x4dc09f);const _0xe96417=_0x2f7b76['vIJiZ'](spawn,_0x429064(0x19e),_0x4a13bb,{'stdio':_0x2f7b76['nqjnV'],'shell':process['platform']==='win32'});_0xe96417['on']('close',_0x90bffa=>{const _0x54312d=_0x429064;_0x2f7b76['IQzCi'](_0x232bb2,_0x2f7b76[_0x54312d(0x1a5)](_0x90bffa,0x0));}),_0xe96417['on'](_0x2f7b76[_0x429064(0x17d)],()=>{const _0x5ddafa=_0x429064;_0x2f7b76[_0x5ddafa(0x180)](_0x232bb2,![]);});});}function isSkillInstalled(_0xae196e,_0x3d9387,_0x15ce08){const _0x1b79be=_0x4513,_0x46b39a={'cgnfu':function(_0x5819a7,_0x4f8c25){return _0x5819a7(_0x4f8c25);},'FSScq':function(_0x5522e2,_0xb95448,_0x2f9d05){return _0x5522e2(_0xb95448,_0x2f9d05);}},_0x8ea6d6=_0x15ce08==='opencode'?_0x46b39a[_0x1b79be(0x194)](getOpencodeSkillsDir,_0x3d9387):getSkillsDir(_0x3d9387),_0x2175a7=_0x46b39a['FSScq'](join,_0x8ea6d6,_0xae196e);return existsSync(_0x2175a7);}async function reinstallSkills(_0x335374){const _0x5d716d=_0x4513,_0x129d4a={'PBhRX':function(_0x2192a8,_0xfef216,_0x3552fe,_0x199c3a){return _0x2192a8(_0xfef216,_0x3552fe,_0x199c3a);},'OQULj':_0x5d716d(0x19e),'siKOg':function(_0x24cbbc,_0x25990a,_0x1dc89f,_0x5ad29c){return _0x24cbbc(_0x25990a,_0x1dc89f,_0x5ad29c);},'fgThM':'opencode','cjEhx':function(_0x342ea0,_0xcc9dda,_0x46a1aa){return _0x342ea0(_0xcc9dda,_0x46a1aa);},'jcguH':_0x5d716d(0x19d)},_0x36e427=['project',_0x5d716d(0x18d)],_0x1e4631=[];for(const _0x61c33c of _0x36e427){for(const _0x3e8a88 of RANGER_MANAGED_SKILLS){_0x129d4a[_0x5d716d(0x185)](isSkillInstalled,_0x3e8a88,_0x61c33c,'claude')&&_0x1e4631['push']({'skillName':_0x3e8a88,'level':_0x61c33c,'platform':_0x129d4a['OQULj']}),_0x129d4a[_0x5d716d(0x1b1)](isSkillInstalled,_0x3e8a88,_0x61c33c,'opencode')&&_0x1e4631[_0x5d716d(0x16e)]({'skillName':_0x3e8a88,'level':_0x61c33c,'platform':_0x129d4a['fgThM']});}}for(const _0x456d5d of _0x36e427){for(const _0x2dc9a0 of DEPRECATED_SKILLS){await _0x129d4a['cjEhx'](removeSkill,_0x2dc9a0,_0x456d5d);}}if(_0x1e4631['length']===0x0){console[_0x5d716d(0x191)](_0x129d4a['jcguH']);return;}console['log'](_0x5d716d(0x1ac)+_0x1e4631[_0x5d716d(0x189)]+_0x5d716d(0x1aa));for(const {skillName:_0x3d013d,level:_0x4de627,platform:_0x6a8da2}of _0x1e4631){try{await _0x129d4a['cjEhx'](installSkill,_0x3d013d,{'level':_0x4de627,'cliVersion':_0x335374,'platform':_0x6a8da2});}catch(_0x3a68b3){console['warn'](_0x5d716d(0x1a8)+_0x6a8da2+'\x20'+_0x4de627+_0x5d716d(0x170)+_0x3d013d+':',_0x3a68b3);}}}function _0x10a3(){const _0x10ada5=['15459228Fykpru','\x0aClaude\x20marketplace\x20updated\x20(trailhead).','12710008nmpdfZ','length','\x0aYou\x20are\x20already\x20on\x20the\x20latest\x20version.','BCxua','zheiP','user','platform','MiEsm','JCCUG','log','trim','some','cgnfu','\x0aYour\x20version\x20(','jIIIZ','findIndex','npm','install','QNsWf','.gitignore','UULYE','\x0aNo\x20ranger-managed\x20skills\x20found\x20to\x20reinstall.','claude','nHvyh','gpNpi','spIWI','plugin','282nBDfZg','BJeBn','ljKoL','AiCVQ','join','\x20\x20Failed\x20to\x20reinstall\x20','marketplace','\x20ranger-managed\x20skill(s)...','uIZBG','\x0aReinstalling\x20','1192557WKoekd','3020428KjJkvg','vxIbO','@latest','siKOg','6rFcung','ZHSAL','push','7957150AMZPKA','\x20skill\x20','Failed\x20to\x20check\x20for\x20updates.\x20Please\x20check\x20your\x20network\x20connection.','SrMXW','error','win32','vVnOt','lTOuz','43786560DTznDp','2alTpDt','utf-8','ranger@trailhead','\x0aCurrent\x20version:\x20','UhDYd','wjfiL','\x0aInstalling\x20','active-profile.txt','HjDsc','RWCPx','MANdN','168602onbiDP','DbfiX','PBhRX'];_0x10a3=function(){return _0x10ada5;};return _0x10a3();}async function ensureActiveProfileGitignored(){const _0x2a3638=_0x4513,_0x10d375={'zhJEn':function(_0x14b1f6){return _0x14b1f6();},'qdUNs':function(_0x27bc1c,_0xceeebb){return _0x27bc1c(_0xceeebb);},'gpNpi':function(_0x34f9f2,_0x2f5201,_0x1030e5){return _0x34f9f2(_0x2f5201,_0x1030e5);},'ZHSAL':_0x2a3638(0x179),'SrMXW':function(_0xf2c72a,_0x48ff56){return _0xf2c72a===_0x48ff56;},'BJeBn':'active-profile.txt','AiCVQ':function(_0x351cc3,_0x39aae0,_0x136234,_0x3aac8c){return _0x351cc3(_0x39aae0,_0x136234,_0x3aac8c);}},_0x3ce937=join(_0x10d375['zhJEn'](getRangerDir),_0x2a3638(0x19b));if(!_0x10d375['qdUNs'](existsSync,_0x3ce937))return![];let _0x23d743='';try{_0x23d743=await _0x10d375[_0x2a3638(0x1a0)](readFile,_0x3ce937,_0x10d375[_0x2a3638(0x16d)]);}catch{return![];}const _0x461bf8=_0x23d743['split'](/\r?\n/);if(_0x461bf8[_0x2a3638(0x193)](_0x1abf56=>_0x1abf56['trim']()===_0x2a3638(0x17f)))return![];let _0x4bebe0=_0x461bf8[_0x2a3638(0x197)](_0x18a76e=>_0x18a76e[_0x2a3638(0x192)]()==='active-feature.txt');_0x10d375[_0x2a3638(0x172)](_0x4bebe0,-0x1)&&(_0x4bebe0=_0x461bf8[_0x2a3638(0x189)]);_0x461bf8['splice'](_0x4bebe0,0x0,_0x10d375[_0x2a3638(0x1a4)]);let _0x366cc9=_0x461bf8[_0x2a3638(0x1a7)]('\x0a');!_0x366cc9['endsWith']('\x0a')&&(_0x366cc9+='\x0a');try{await _0x10d375[_0x2a3638(0x1a6)](writeFile,_0x3ce937,_0x366cc9,_0x2a3638(0x179));}catch{return![];}return!![];}export async function update(){const _0x1c6d3f=_0x4513,_0x5e9fbb={'UUtVQ':function(_0x3636a3){return _0x3636a3();},'wofTf':_0x1c6d3f(0x171),'bMaZI':function(_0x14da2a,_0x19e4a8){return _0x14da2a===_0x19e4a8;},'QNsWf':_0x1c6d3f(0x18a),'spIWI':function(_0x558bb7){return _0x558bb7();},'wtISi':function(_0x15fde2,_0xb7b47f){return _0x15fde2(_0xb7b47f);},'UULYE':function(_0x2b2a04,_0x199f87){return _0x2b2a04(_0x199f87);},'kDXCL':'trailhead','RWCPx':'ranger@trailhead','sfjRZ':function(_0x38d41b){return _0x38d41b();},'SFSLT':function(_0x153599){return _0x153599();},'Prwoc':'✓\x20Migrated\x20active\x20profile\x20file','lTOuz':'\x0a✅\x20Update\x20complete!'},_0xdde5bf=_0x5e9fbb['UUtVQ'](getCurrentVersion);console[_0x1c6d3f(0x191)](_0x1c6d3f(0x17b)+_0xdde5bf),console['log']('Checking\x20for\x20updates...');const _0xde6a20=getLatestVersion();if(!_0xde6a20)throw new Error(_0x5e9fbb['wofTf']);console[_0x1c6d3f(0x191)]('Latest\x20version:\x20\x20'+_0xde6a20);const _0x29b102=compareVersions(_0xdde5bf,_0xde6a20);let _0x9cce4e=_0xdde5bf;if(_0x5e9fbb['bMaZI'](_0x29b102,0x0))console['log'](_0x5e9fbb[_0x1c6d3f(0x19a)]);else{if(_0x29b102<0x0)console[_0x1c6d3f(0x191)](_0x1c6d3f(0x195)+_0xdde5bf+')\x20is\x20newer\x20than\x20the\x20published\x20version\x20('+_0xde6a20+').');else{const _0x65ad1=await _0x5e9fbb[_0x1c6d3f(0x1a1)](runInstall);if(_0x65ad1)console[_0x1c6d3f(0x191)]('\x0aSuccessfully\x20updated\x20to\x20version\x20'+_0xde6a20),_0x9cce4e=_0xde6a20;else throw new Error('Update\x20failed.\x20You\x20may\x20need\x20to\x20run\x20with\x20sudo:\x20sudo\x20npm\x20install\x20-g\x20'+PACKAGE_NAME+_0x1c6d3f(0x1b0));}}await _0x5e9fbb['wtISi'](reinstallSkills,_0x9cce4e);const _0x264a6e=await _0x5e9fbb[_0x1c6d3f(0x19c)](isMarketplaceAdded,_0x5e9fbb['kDXCL']),_0x1c0473=await _0x5e9fbb['UULYE'](isPluginInstalled,_0x5e9fbb[_0x1c6d3f(0x181)]);if(_0x264a6e){const _0x4146bd=await updateClaudeMarketplace();_0x4146bd&&console['log'](_0x1c6d3f(0x187));}if(_0x1c0473){const _0x40eecd=await _0x5e9fbb['sfjRZ'](updateClaudePlugin);_0x40eecd&&console[_0x1c6d3f(0x191)]('\x0aClaude\x20plugin\x20updated\x20(user\x20scope).');const _0x4a179e=await updateClaudePlugin('project');_0x4a179e&&console['log']((_0x40eecd?'':'\x0a')+'Claude\x20plugin\x20updated\x20(project\x20scope).');}const _0x2b60cf=await _0x5e9fbb['SFSLT'](migrateActiveProfileFile);_0x2b60cf&&console[_0x1c6d3f(0x191)](_0x5e9fbb['Prwoc']);const _0x51b59f=await ensureActiveProfileGitignored();console[_0x1c6d3f(0x191)](_0x5e9fbb[_0x1c6d3f(0x176)]);}
|
|
1
|
+
(function(_0x438247,_0x3fed15){const _0x515abc=_0x225c,_0x2c76e6=_0x438247();while(!![]){try{const _0x480a1a=-parseInt(_0x515abc(0x16a))/0x1*(parseInt(_0x515abc(0x15a))/0x2)+-parseInt(_0x515abc(0x152))/0x3*(parseInt(_0x515abc(0x159))/0x4)+parseInt(_0x515abc(0x165))/0x5+-parseInt(_0x515abc(0x14a))/0x6*(parseInt(_0x515abc(0x14b))/0x7)+parseInt(_0x515abc(0x157))/0x8+-parseInt(_0x515abc(0x154))/0x9*(parseInt(_0x515abc(0x14d))/0xa)+-parseInt(_0x515abc(0x16d))/0xb*(-parseInt(_0x515abc(0x162))/0xc);if(_0x480a1a===_0x3fed15)break;else _0x2c76e6['push'](_0x2c76e6['shift']());}catch(_0x5799ac){_0x2c76e6['push'](_0x2c76e6['shift']());}}}(_0xeafd,0xe487f));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';function _0xeafd(){const _0x153c58=['ranger@trailhead',')\x20is\x20newer\x20than\x20the\x20published\x20version\x20(','159066lXbdpn','7TAylFt','Latest\x20version:\x20\x20','74090jyjsdD','push','log','close','trim','926910qzmPms','error','1881VrmYxY','\x20\x20Failed\x20to\x20reinstall\x20','Failed\x20to\x20check\x20for\x20updates.\x20Please\x20check\x20your\x20network\x20connection.','5285704xEPkWa','\x0a✅\x20Update\x20complete!','20ogUrVR','178gGkURR','win32','\x0aClaude\x20marketplace\x20updated\x20(trailhead).','pNvlf','NdlTi','fPcTJ','update','--scope','516peHyTo','QDyZK','endsWith','2295535pCQkBq','opencode','.gitignore','\x0aClaude\x20plugin\x20updated\x20(user\x20scope).','inherit','14734JnMjwA','ATzJn','npm','1086547WAXAHQ','claude','NVMPh','active-feature.txt','platform','bKeyM','install','hEFcB','Claude\x20plugin\x20updated\x20(project\x20scope).','\x0aNo\x20ranger-managed\x20skills\x20found\x20to\x20reinstall.','CsSBj','length','plugin','IEbaD','project','split','NAKPk','GQpAz','LoUMr','trailhead','warn','EEBWt','LkKxH','\x0aInstalling\x20','✓\x20Migrated\x20active\x20profile\x20file'];_0xeafd=function(){return _0x153c58;};return _0xeafd();}import{PACKAGE_NAME,getCurrentVersion,getLatestVersion,compareVersions}from'./utils/version.js';function _0x225c(_0x28c1da,_0x10f703){_0x28c1da=_0x28c1da-0x139;const _0xeafd2d=_0xeafd();let _0x225ccc=_0xeafd2d[_0x28c1da];return _0x225ccc;}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{isMarketplaceAdded,isPluginInstalled}from'./utils/claudePlugin.js';async function runInstall(){const _0x4fa571=_0x225c,_0x108b8f={'gvtTx':function(_0x5aa96b,_0x3dbc92){return _0x5aa96b(_0x3dbc92);},'YIqHK':_0x4fa571(0x16c),'rmhWV':_0x4fa571(0x169),'NdlTi':'error'};return new Promise(_0x38ea48=>{const _0x30fe97=_0x4fa571,_0x478238={'bKzuW':function(_0x2b597e,_0x1ab84c){return _0x108b8f['gvtTx'](_0x2b597e,_0x1ab84c);}};console['log'](_0x30fe97(0x146)+PACKAGE_NAME+'@latest...\x0a');const _0x147395=spawn(_0x108b8f['YIqHK'],[_0x30fe97(0x173),'-g',PACKAGE_NAME+'@latest'],{'stdio':_0x108b8f['rmhWV'],'shell':process['platform']===_0x30fe97(0x15b)});_0x147395['on'](_0x30fe97(0x150),_0x34604d=>{_0x38ea48(_0x34604d===0x0);}),_0x147395['on'](_0x108b8f[_0x30fe97(0x15e)],()=>{_0x478238['bKzuW'](_0x38ea48,![]);});});}async function updateClaudeMarketplace(){const _0x1b507f=_0x225c,_0x5cdb2d={'EEBWt':function(_0x3e1d1e,_0x4e042d){return _0x3e1d1e(_0x4e042d);},'NVMPh':'claude','rclJl':_0x1b507f(0x142),'jzSQa':function(_0x4278fe,_0x520834){return _0x4278fe===_0x520834;},'JtVJk':'win32','LUvDb':'error'};return new Promise(_0xcf8fd6=>{const _0x476d29=_0x1b507f,_0x1ab02d={'QDyZK':function(_0xf9d413,_0x40d829){const _0x25b7fd=_0x225c;return _0x5cdb2d[_0x25b7fd(0x144)](_0xf9d413,_0x40d829);}},_0x27f30f=spawn(_0x5cdb2d[_0x476d29(0x16f)],[_0x476d29(0x13b),'marketplace',_0x476d29(0x160),_0x5cdb2d['rclJl']],{'stdio':'pipe','shell':_0x5cdb2d['jzSQa'](process['platform'],_0x5cdb2d['JtVJk'])});_0x27f30f['on']('close',_0x17f0fc=>{const _0x1c29e4=_0x476d29;_0x1ab02d[_0x1c29e4(0x163)](_0xcf8fd6,_0x17f0fc===0x0);}),_0x27f30f['on'](_0x5cdb2d['LUvDb'],()=>{_0xcf8fd6(![]);});});}async function updateClaudePlugin(_0x2ce002){const _0x57801a=_0x225c,_0x368c95={'REevZ':'pipe','TrLKI':function(_0x3370fb,_0x2f985b){return _0x3370fb===_0x2f985b;},'MiBkb':_0x57801a(0x153)};return new Promise(_0x40a3f3=>{const _0x3a7c5e=_0x57801a,_0x1790e0=['plugin',_0x3a7c5e(0x160),_0x3a7c5e(0x148)];_0x2ce002&&_0x1790e0[_0x3a7c5e(0x14e)](_0x3a7c5e(0x161),_0x2ce002);const _0x49779b=spawn(_0x3a7c5e(0x16e),_0x1790e0,{'stdio':_0x368c95['REevZ'],'shell':_0x368c95['TrLKI'](process[_0x3a7c5e(0x171)],_0x3a7c5e(0x15b))});_0x49779b['on'](_0x3a7c5e(0x150),_0x1d1eff=>{_0x40a3f3(_0x1d1eff===0x0);}),_0x49779b['on'](_0x368c95['MiBkb'],()=>{_0x40a3f3(![]);});});}function isSkillInstalled(_0x2c2338,_0xd9db97,_0x448763){const _0x5246bc=_0x225c,_0x10c442={'fPcTJ':function(_0x3869bb,_0x429707){return _0x3869bb===_0x429707;},'CeKZy':_0x5246bc(0x166),'NAKPk':function(_0xefb4a4,_0x337199){return _0xefb4a4(_0x337199);},'fGBfB':function(_0xc27475,_0x549534){return _0xc27475(_0x549534);}},_0x207cc1=_0x10c442[_0x5246bc(0x15f)](_0x448763,_0x10c442['CeKZy'])?getOpencodeSkillsDir(_0xd9db97):_0x10c442[_0x5246bc(0x13f)](getSkillsDir,_0xd9db97),_0x20c6c3=join(_0x207cc1,_0x2c2338);return _0x10c442['fGBfB'](existsSync,_0x20c6c3);}async function reinstallSkills(_0x4eb536){const _0x20cf66=_0x225c,_0x1e4fa1={'IEbaD':_0x20cf66(0x16e),'mwbSG':'opencode','hlTcp':function(_0x30443a,_0x294610,_0x1a4838){return _0x30443a(_0x294610,_0x1a4838);},'GQpAz':_0x20cf66(0x176),'CsSBj':function(_0x5b6bb0,_0x40fe1a,_0x2a3918){return _0x5b6bb0(_0x40fe1a,_0x2a3918);}},_0x4fa88c=[_0x20cf66(0x13d),'user'],_0x39abd1=[];for(const _0x550bd8 of _0x4fa88c){for(const _0x37466b of RANGER_MANAGED_SKILLS){isSkillInstalled(_0x37466b,_0x550bd8,_0x1e4fa1[_0x20cf66(0x13c)])&&_0x39abd1['push']({'skillName':_0x37466b,'level':_0x550bd8,'platform':_0x1e4fa1[_0x20cf66(0x13c)]}),isSkillInstalled(_0x37466b,_0x550bd8,_0x1e4fa1['mwbSG'])&&_0x39abd1['push']({'skillName':_0x37466b,'level':_0x550bd8,'platform':_0x1e4fa1['mwbSG']});}}for(const _0x5ad43e of _0x4fa88c){for(const _0x22ba99 of DEPRECATED_SKILLS){await _0x1e4fa1['hlTcp'](removeSkill,_0x22ba99,_0x5ad43e);}}if(_0x39abd1[_0x20cf66(0x13a)]===0x0){console[_0x20cf66(0x14f)](_0x1e4fa1[_0x20cf66(0x140)]);return;}console['log']('\x0aReinstalling\x20'+_0x39abd1[_0x20cf66(0x13a)]+'\x20ranger-managed\x20skill(s)...');for(const {skillName:_0x307ed5,level:_0x5b99c5,platform:_0x42c251}of _0x39abd1){try{await _0x1e4fa1[_0x20cf66(0x139)](installSkill,_0x307ed5,{'level':_0x5b99c5,'cliVersion':_0x4eb536,'platform':_0x42c251});}catch(_0x3f65d1){console[_0x20cf66(0x143)](_0x20cf66(0x155)+_0x42c251+'\x20'+_0x5b99c5+'\x20skill\x20'+_0x307ed5+':',_0x3f65d1);}}}async function ensureActiveProfileGitignored(){const _0x2d09ec=_0x225c,_0x1cb4f9={'LoUMr':function(_0x4366ea,_0x51be38){return _0x4366ea(_0x51be38);},'mdSwQ':function(_0x5bdc6c,_0x49a87f,_0xea4bbd){return _0x5bdc6c(_0x49a87f,_0xea4bbd);},'bKeyM':'utf-8','NrfGJ':function(_0x53fefb,_0x318f36){return _0x53fefb===_0x318f36;},'ayspM':'active-profile.txt'},_0x24131c=join(getRangerDir(),_0x2d09ec(0x167));if(!_0x1cb4f9[_0x2d09ec(0x141)](existsSync,_0x24131c))return![];let _0x5b21ed='';try{_0x5b21ed=await _0x1cb4f9['mdSwQ'](readFile,_0x24131c,_0x1cb4f9[_0x2d09ec(0x172)]);}catch{return![];}const _0x3a4e27=_0x5b21ed[_0x2d09ec(0x13e)](/\r?\n/);if(_0x3a4e27['some'](_0xafc259=>_0xafc259[_0x2d09ec(0x151)]()==='active-profile.txt'))return![];let _0x256808=_0x3a4e27['findIndex'](_0x3fb59b=>_0x3fb59b[_0x2d09ec(0x151)]()===_0x2d09ec(0x170));_0x1cb4f9['NrfGJ'](_0x256808,-0x1)&&(_0x256808=_0x3a4e27['length']);_0x3a4e27['splice'](_0x256808,0x0,_0x1cb4f9['ayspM']);let _0x24a129=_0x3a4e27['join']('\x0a');!_0x24a129[_0x2d09ec(0x164)]('\x0a')&&(_0x24a129+='\x0a');try{await writeFile(_0x24131c,_0x24a129,_0x1cb4f9[_0x2d09ec(0x172)]);}catch{return![];}return!![];}export async function update(){const _0x494c39=_0x225c,_0x536db6={'ATzJn':'Checking\x20for\x20updates...','pNvlf':function(_0x508ab4){return _0x508ab4();},'vtwuq':function(_0x3fb7c2,_0x4b7ca0,_0x5839a2){return _0x3fb7c2(_0x4b7ca0,_0x5839a2);},'SAYfu':'\x0aYou\x20are\x20already\x20on\x20the\x20latest\x20version.','JuIIQ':function(_0x2728c7,_0x14b36b){return _0x2728c7<_0x14b36b;},'LkKxH':function(_0x4f8799){return _0x4f8799();},'hEFcB':function(_0x14f960,_0xe6a52a){return _0x14f960(_0xe6a52a);},'RIuVn':_0x494c39(0x13d)},_0x46f69c=getCurrentVersion();console[_0x494c39(0x14f)]('\x0aCurrent\x20version:\x20'+_0x46f69c),console['log'](_0x536db6[_0x494c39(0x16b)]);const _0x11806d=_0x536db6['pNvlf'](getLatestVersion);if(!_0x11806d)throw new Error(_0x494c39(0x156));console['log'](_0x494c39(0x14c)+_0x11806d);const _0x5713f4=_0x536db6['vtwuq'](compareVersions,_0x46f69c,_0x11806d);let _0x18ed6f=_0x46f69c;if(_0x5713f4===0x0)console[_0x494c39(0x14f)](_0x536db6['SAYfu']);else{if(_0x536db6['JuIIQ'](_0x5713f4,0x0))console['log']('\x0aYour\x20version\x20('+_0x46f69c+_0x494c39(0x149)+_0x11806d+').');else{const _0x2c3ba9=await _0x536db6[_0x494c39(0x145)](runInstall);if(_0x2c3ba9)console[_0x494c39(0x14f)]('\x0aSuccessfully\x20updated\x20to\x20version\x20'+_0x11806d),_0x18ed6f=_0x11806d;else throw new Error('Update\x20failed.\x20You\x20may\x20need\x20to\x20run\x20with\x20sudo:\x20sudo\x20npm\x20install\x20-g\x20'+PACKAGE_NAME+'@latest');}}await _0x536db6['hEFcB'](reinstallSkills,_0x18ed6f);const _0x8f184c=await isMarketplaceAdded('trailhead'),_0x43e760=await isPluginInstalled(_0x494c39(0x148));if(_0x8f184c){const _0x30b6a7=await updateClaudeMarketplace();_0x30b6a7&&console[_0x494c39(0x14f)](_0x494c39(0x15c));}if(_0x43e760){const _0x2d1e8c=await _0x536db6[_0x494c39(0x15d)](updateClaudePlugin);_0x2d1e8c&&console[_0x494c39(0x14f)](_0x494c39(0x168));const _0x559c43=await _0x536db6[_0x494c39(0x174)](updateClaudePlugin,_0x536db6['RIuVn']);_0x559c43&&console[_0x494c39(0x14f)]((_0x2d1e8c?'':'\x0a')+_0x494c39(0x175));}const _0x8c312=await _0x536db6['pNvlf'](migrateActiveProfileFile);_0x8c312&&console['log'](_0x494c39(0x147));const _0x19d278=await ensureActiveProfileGitignored();console[_0x494c39(0x14f)](_0x494c39(0x158));}
|