@ranger-testing/ranger-cli 2.4.7 → 2.5.0
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/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/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/playwrightCli.js +1 -1
- package/build/commands/utils/profileMessages.js +1 -1
- package/build/commands/utils/profileSetupBanner.js +1 -1
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/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/stitchWebmFiles.js +1 -1
- package/build/commands/utils/telemetry.js +1 -1
- package/build/commands/utils/tokenRefresh.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -1
- package/build/commands/utils/userApi.js +1 -1
- package/build/commands/utils/version.js +1 -1
- package/build/commands/verifyFeature.js +1 -1
- package/build/commands/verifyFeatureCli.js +1 -1
- package/build/commands/verifyInBrowser.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const _0x2d86c5=_0x2d43;function _0x430d(){const _0x1ef991=['2723vMGRaC','aeAnG','7437822XiuAVZ','706857GuXuVa','16872cwbXAJ','HNEEI','success','AgeGE','parse','11307366edpyOd','GWUte','main','75823VReqth','TMxBV','session_id','2653180yLJUTo','LWmZH','TCWwK','1stIufU','stringify','=================================================================\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20🚨\x20RANGER\x20IS\x20ACTIVE\x20🚨\x0a=================================================================\x0a\x0aThis\x20session\x20has\x20Ranger\x20ENABLED.\x20Before\x20doing\x20ANYTHING\x20else:\x0a\x0a1.\x20**READ\x20the\x20/ranger\x20skill\x20FIRST**\x20-\x20Run\x20the\x20skill\x20to\x20understand\x20the\x20required\x20workflow\x20for\x20UI\x20features\x0a\x0a2.\x20**Check\x20for\x20existing\x20feature\x20reviews**\x20-\x20Run\x20`ranger\x20list`\x20to\x20see\x20if\x20there\x27s\x20an\x20in-progress\x20feature\x20review\x20to\x20resume\x0a\x0a3.\x20**For\x20ANY\x20UI\x20work**:\x20You\x20MUST\x20either:\x0a\x20\x20\x20-\x20Resume\x20an\x20existing\x20feature\x20review:\x20`ranger\x20resume\x20<id>`\x0a\x20\x20\x20-\x20Create\x20a\x20new\x20feature\x20review:\x20`ranger\x20create\x20\x22<name>\x22\x20-d\x20\x22<desc>\x22\x20-c\x20\x22<scenario>\x22`\x0a\x0a4.\x20**If\x20resuming\x20a\x20feature\x20review\x20with\x20reviewer\x20comments**:\x20Run\x20`ranger\x20get-review`\x20to\x20see\x20what\x20reviewers\x20want\x20fixed\x20before\x20making\x20code\x20changes\x0a\x0a=================================================================','vGoxi','38965LpbjoX','trackCommandEnd','1490gIcGHO','264QYAUjt'];_0x430d=function(){return _0x1ef991;};return _0x430d();}function _0x2d43(_0x33e0e2,_0xaf0909){_0x33e0e2=_0x33e0e2-0xae;const _0x430da2=_0x430d();let _0x2d43e4=_0x430da2[_0x33e0e2];return _0x2d43e4;}(function(_0x231b40,_0xd7c4a7){const _0x133d2f=_0x2d43,_0x178afc=_0x231b40();while(!![]){try{const _0x42e6c9=-parseInt(_0x133d2f(0xba))/0x1*(parseInt(_0x133d2f(0xb7))/0x2)+parseInt(_0x133d2f(0xc5))/0x3+-parseInt(_0x133d2f(0xc1))/0x4*(parseInt(_0x133d2f(0xbe))/0x5)+parseInt(_0x133d2f(0xc4))/0x6+parseInt(_0x133d2f(0xc2))/0x7*(parseInt(_0x133d2f(0xc6))/0x8)+parseInt(_0x133d2f(0xb1))/0x9+parseInt(_0x133d2f(0xc0))/0xa*(-parseInt(_0x133d2f(0xb4))/0xb);if(_0x42e6c9===_0xd7c4a7)break;else _0x178afc['push'](_0x178afc['shift']());}catch(_0x18f44d){_0x178afc['push'](_0x178afc['shift']());}}}(_0x430d,0xa700e));import{appendFile}from'fs/promises';import{initBranchTracking,shouldAutoEnableAfterClear,autoEnableAfterClear,isSessionEnabled,getCurrentBranch}from'../utils/sessionCache.js';import{createTelemetryCollector}from'../utils/telemetry.js';import{getToken}from'../utils/keychain.js';const RANGER_AUTO_ENABLED_PROMPT=_0x2d86c5(0xbc);export async function sessionStart(_0x4b613e){const _0x19ba05=_0x2d86c5,_0x1083ec={'TMxBV':function(_0x1d2d96,_0x872aa0){return _0x1d2d96||_0x872aa0;},'vGoxi':'source','LWmZH':function(_0x5b5986,_0x366e01){return _0x5b5986(_0x366e01);},'sKjJa':function(_0xa60908,_0x607be7){return _0xa60908(_0x607be7);},'AgeGE':_0x19ba05(0xae),'GWUte':function(_0x286e2c){return _0x286e2c();},'aeAnG':function(_0x35b854,_0xfcc68b){return _0x35b854!==_0xfcc68b;},'rwaUc':function(_0x56ac88,_0x550a12){return _0x56ac88!==_0x550a12;},'HNEEI':'SessionStart','TCWwK':function(_0x53777d,_0xe560df){return _0x53777d+_0xe560df;}};let _0x2732d3=_0x1083ec[_0x19ba05(0xb5)](_0x4b613e,''),_0x34e3e7;if(!_0x4b613e){let _0x5b7ab2='';for await(const _0x55d3b0 of process['stdin']){_0x5b7ab2+=_0x55d3b0;}try{const _0x585cef=JSON[_0x19ba05(0xb0)](_0x5b7ab2);_0x2732d3=_0x585cef[_0x19ba05(0xb6)]||'',_0x34e3e7=_0x585cef[_0x1083ec[_0x19ba05(0xbd)]];}catch{}const _0x3ad021=process['env']['CLAUDE_ENV_FILE'];if(_0x3ad021&&_0x2732d3)try{await appendFile(_0x3ad021,'export\x20CLAUDE_SESSION_ID=\x22'+_0x2732d3+'\x22\x0a');}catch{}}try{await getToken();}catch{}if(_0x2732d3){shouldAutoEnableAfterClear(_0x34e3e7)&&_0x1083ec[_0x19ba05(0xb8)](autoEnableAfterClear,_0x2732d3);_0x1083ec['sKjJa'](initBranchTracking,_0x2732d3);const _0x38f917=isSessionEnabled(_0x2732d3);try{const _0x63af2a=createTelemetryCollector('hook:session-start');await _0x63af2a['trackCommandStart']({'sessionId':_0x2732d3,'hooksEnabled':_0x38f917}),await _0x63af2a[_0x19ba05(0xbf)](_0x1083ec[_0x19ba05(0xaf)]);}catch{}if(_0x38f917){const _0x12a2fe=_0x1083ec[_0x19ba05(0xb2)](getCurrentBranch),_0x3a039f=_0x12a2fe&&_0x1083ec[_0x19ba05(0xc3)](_0x12a2fe,_0x19ba05(0xb3))&&_0x1083ec['rwaUc'](_0x12a2fe,'master')?'\x20(Branch:\x20'+_0x12a2fe+')':'',_0x574aee={'hookSpecificOutput':{'hookEventName':_0x1083ec[_0x19ba05(0xc7)],'additionalContext':_0x1083ec[_0x19ba05(0xb9)](RANGER_AUTO_ENABLED_PROMPT,_0x3a039f)}};console['log'](JSON[_0x19ba05(0xbb)](_0x574aee));}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x5ac7(){const _0x2f8b29=['hook:stop','8HWezuw','882259ShmEnF','1URhKKE','verification_in_progress','2310NUjJfg','4165056jKmHsk','checklistItems','verified','6905rTQpgF','137008jdwxlN','Stop','433279QHzKwv','featureId','closed','OZIsi','6093uDkADT','some','5776GbLVVa','success','status','228IuCVaH','510ztkLqX'];_0x5ac7=function(){return _0x2f8b29;};return _0x5ac7();}(function(_0x157bf0,_0x5b1e93){const _0x5eb224=_0x5f52,_0x14dfba=_0x157bf0();while(!![]){try{const _0x3b7f7d=-parseInt(_0x5eb224(0xb7))/0x1*(-parseInt(_0x5eb224(0xa7))/0x2)+-parseInt(_0x5eb224(0xb2))/0x3*(parseInt(_0x5eb224(0xaf))/0x4)+-parseInt(_0x5eb224(0xa6))/0x5*(-parseInt(_0x5eb224(0xb3))/0x6)+parseInt(_0x5eb224(0xb6))/0x7*(-parseInt(_0x5eb224(0xb5))/0x8)+-parseInt(_0x5eb224(0xad))/0x9*(parseInt(_0x5eb224(0xb9))/0xa)+-parseInt(_0x5eb224(0xa9))/0xb+parseInt(_0x5eb224(0xa3))/0xc;if(_0x3b7f7d===_0x5b1e93)break;else _0x14dfba['push'](_0x14dfba['shift']());}catch(_0x579469){_0x14dfba['push'](_0x14dfba['shift']());}}}(_0x5ac7,0x18c2c));function _0x5f52(_0x4f7d07,_0x571354){_0x4f7d07=_0x4f7d07-0xa3;const _0x5ac7e2=_0x5ac7();let _0x5f5273=_0x5ac7e2[_0x4f7d07];return _0x5f5273;}import{getToken}from'../utils/keychain.js';import{getFeature,concludeSession}from'../utils/featureApi.js';import{getSessionEntry,shouldShowStopReminder}from'../utils/sessionCache.js';import{getEnabledHookContext}from'./output.js';import{createTelemetryCollector}from'../utils/telemetry.js';export async function stopHook(_0x494ed8){const _0x2ec2f6=_0x5f52,_0x2ca191={'OZIsi':function(_0x4dd2c6,_0x349f46,_0x4b693a,_0x374764){return _0x4dd2c6(_0x349f46,_0x4b693a,_0x374764);},'xtLtQ':function(_0x3e6252,_0x1259ad){return _0x3e6252&&_0x1259ad;},'AATij':_0x2ec2f6(0xa8)},_0x21ca40=await getEnabledHookContext(_0x494ed8),_0x13cba1=_0x21ca40?.['sessionId']??null;let _0x3e6092=!![];if(!_0x13cba1){await trackStop(_0x13cba1,![],_0x3e6092);return;}try{const _0x3e137b=getSessionEntry(_0x13cba1);if(!_0x3e137b){await _0x2ca191[_0x2ec2f6(0xac)](trackStop,_0x13cba1,!![],_0x3e6092);return;}const _0x5c98c2=await getToken(),_0x1445c1='https://dashboard.ranger.net/features/'+_0x3e137b['featureId'];let _0x1ae6fe=null,_0x553cad=![],_0x2abde2=![];if(_0x5c98c2)try{const _0x3f4e39=await getFeature(_0x3e137b['featureId']);_0x1ae6fe=_0x3f4e39['currentSessionId']??null;const _0x367616=_0x3f4e39[_0x2ec2f6(0xa4)]['filter'](_0x5ed228=>_0x5ed228['sessionId']===_0x1ae6fe);_0x553cad=_0x367616['some'](_0x10b7b2=>_0x10b7b2[_0x2ec2f6(0xb1)]!==_0x2ec2f6(0xa5)&&_0x10b7b2['status']!=='blocked'&&_0x10b7b2['status']!==_0x2ec2f6(0xab)&&_0x10b7b2['status']!=='incomplete'),_0x2abde2=_0x367616[_0x2ec2f6(0xae)](_0x49b38b=>_0x49b38b[_0x2ec2f6(0xb1)]===_0x2ec2f6(0xb8));}catch{}if(_0x2ca191['xtLtQ'](_0x5c98c2,_0x1ae6fe)&&_0x553cad){if(!_0x2abde2&&shouldShowStopReminder(_0x13cba1)){const _0x18067d={'hookSpecificOutput':{'hookEventName':_0x2ca191['AATij'],'additionalContext':'RANGER:\x20The\x20active\x20feature\x20review\x20still\x20has\x20unfinished\x20checklist\x20items.\x20Before\x20responding\x20to\x20the\x20user,\x20if\x20this\x20UI\x20work\x20is\x20ready,\x20run\x20`ranger\x20show`\x20and\x20then\x20`ranger\x20go`\x20for\x20the\x20relevant\x20scenario(s).\x20If\x20it\x20is\x20not\x20ready\x20for\x20browser\x20verification\x20yet,\x20continue\x20implementing.\x20Dashboard:\x20'+_0x1445c1}};console['log'](JSON['stringify'](_0x18067d));}}if(_0x5c98c2&&_0x1ae6fe&&!_0x553cad)try{await concludeSession(_0x3e137b[_0x2ec2f6(0xaa)],_0x1ae6fe);}catch{}await trackStop(_0x13cba1,!![],_0x3e6092);return;}catch{await trackStop(_0x13cba1,!![],_0x3e6092);return;}}async function trackStop(_0x4f55d7,_0x523995,_0x11819c){const _0x4f020d=_0x5f52,_0x3ca43e={'nALdH':function(_0x48a45e,_0x25ec2e){return _0x48a45e(_0x25ec2e);},'tsJZP':_0x4f020d(0xb4)};try{const _0x142054=_0x3ca43e['nALdH'](createTelemetryCollector,_0x3ca43e['tsJZP']);await _0x142054['trackCommandStart']({'sessionId':_0x4f55d7??undefined,'hooksEnabled':_0x523995,'stopAllowed':_0x11819c}),await _0x142054['trackCommandEnd'](_0x4f020d(0xb0));}catch{}}
|
package/build/commands/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2f8e96,_0x2bb5ad){var _0x57b3d2=_0x111c,_0x5b22e9=_0x2f8e96();while(!![]){try{var _0x517124=-parseInt(_0x57b3d2(0x9f))/0x1*(parseInt(_0x57b3d2(0x9d))/0x2)+parseInt(_0x57b3d2(0x9c))/0x3+-parseInt(_0x57b3d2(0xa5))/0x4+parseInt(_0x57b3d2(0x9e))/0x5*(parseInt(_0x57b3d2(0x9b))/0x6)+parseInt(_0x57b3d2(0xa2))/0x7+-parseInt(_0x57b3d2(0xa4))/0x8*(parseInt(_0x57b3d2(0xa3))/0x9)+-parseInt(_0x57b3d2(0xa0))/0xa*(-parseInt(_0x57b3d2(0xa1))/0xb);if(_0x517124===_0x2bb5ad)break;else _0x5b22e9['push'](_0x5b22e9['shift']());}catch(_0x10c6b3){_0x5b22e9['push'](_0x5b22e9['shift']());}}}(_0x2f7f,0x78777));export{addEnv}from'./addEnv.js';export{clean}from'./clean.js';export{login}from'./login.js';function _0x111c(_0x240afb,_0x224cca){_0x240afb=_0x240afb-0x9b;var _0x2f7f15=_0x2f7f();var _0x111c5f=_0x2f7f15[_0x240afb];return _0x111c5f;}export{start}from'./start.js';export{useEnv}from'./useEnv.js';export{updateEnv}from'./updateEnv.js';export{update}from'./update.js';export{skillup}from'./skillup.js';function _0x2f7f(){var _0x4057cb=['6sHeHEU','2520228dnxYlS','259262OeYVQB','3798180gnbXrK','7vZZtqO','200KIiXaz','195701OhoDwU','1282491VWQtYh','27ttFotd','451912qqtQTo','2273720dvUSRG'];_0x2f7f=function(){return _0x4057cb;};return _0x2f7f();}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 _0x5f12(_0x4cc75c,_0x5c127b){_0x4cc75c=_0x4cc75c-0xe7;const _0x1c5ee4=_0x1c5e();let _0x5f12b1=_0x1c5ee4[_0x4cc75c];return _0x5f12b1;}(function(_0xeed18e,_0xacc34e){const _0x115301=_0x5f12,_0x4aa755=_0xeed18e();while(!![]){try{const _0x2063f3=parseInt(_0x115301(0xf3))/0x1+parseInt(_0x115301(0xe9))/0x2+-parseInt(_0x115301(0xf5))/0x3+-parseInt(_0x115301(0xf7))/0x4*(parseInt(_0x115301(0xf1))/0x5)+parseInt(_0x115301(0xea))/0x6+parseInt(_0x115301(0xf8))/0x7+-parseInt(_0x115301(0xec))/0x8*(parseInt(_0x115301(0xf6))/0x9);if(_0x2063f3===_0xacc34e)break;else _0x4aa755['push'](_0x4aa755['shift']());}catch(_0x241ef6){_0x4aa755['push'](_0x4aa755['shift']());}}}(_0x1c5e,0x2610a));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';function _0x1c5e(){const _0x2a3b3f=['stdin','245282kwtpVb','success','580674JaBdis','14778NaNgdk','561812SyxYJh','700154GVODDV','organizationName','message','user','BoAeP','370488aOdTiE','731610mvCaxY','\x0a✅\x20API\x20key\x20stored\x20successfully','792VqProE','isTTY','CRxOo','Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','stdout','5EQIqZs'];_0x1c5e=function(){return _0x2a3b3f;};return _0x1c5e();}export async function login(){const _0x4e55a8=_0x5f12,_0xd37be8={'BoAeP':_0x4e55a8(0xef),'CRxOo':_0x4e55a8(0xeb),'ijNjr':function(_0x40f835,_0x9cac8f){return _0x40f835 instanceof _0x9cac8f;}},_0x47fba2=process[_0x4e55a8(0xf2)]['isTTY']&&process[_0x4e55a8(0xf0)][_0x4e55a8(0xed)];if(!_0x47fba2)throw new Error(_0xd37be8[_0x4e55a8(0xe8)]);try{const _0x21a891=await runDeviceAuthFlow(),_0x2bedbc=await getCurrentUser(_0x21a891);_0x2bedbc[_0x4e55a8(0xf4)]?console['log']('\x0a✅\x20Logged\x20in\x20to\x20'+_0x2bedbc[_0x4e55a8(0xe7)][_0x4e55a8(0xf9)]):console['log'](_0xd37be8[_0x4e55a8(0xee)]);}catch(_0x1497e0){throw new Error('Login\x20failed:\x20'+(_0xd37be8['ijNjr'](_0x1497e0,Error)?_0x1497e0[_0x4e55a8(0xfa)]:_0x1497e0));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x409cd5,_0x4fd250){const _0x3dd172=_0x8d21,_0x4cc33c=_0x409cd5();while(!![]){try{const _0x33138f=-parseInt(_0x3dd172(0xe9))/0x1+-parseInt(_0x3dd172(0xf8))/0x2*(parseInt(_0x3dd172(0xc5))/0x3)+parseInt(_0x3dd172(0xea))/0x4+-parseInt(_0x3dd172(0xd7))/0x5*(-parseInt(_0x3dd172(0xe3))/0x6)+parseInt(_0x3dd172(0xda))/0x7*(parseInt(_0x3dd172(0xbc))/0x8)+-parseInt(_0x3dd172(0xd1))/0x9+-parseInt(_0x3dd172(0xbe))/0xa*(-parseInt(_0x3dd172(0xe5))/0xb);if(_0x33138f===_0x4fd250)break;else _0x4cc33c['push'](_0x4cc33c['shift']());}catch(_0x567fd4){_0x4cc33c['push'](_0x4cc33c['shift']());}}}(_0x2cb1,0x5000c));import{join}from'path';function _0x2cb1(){const _0x21e5ee=['10niClPB','JYUfu','tHvgB','error','add','⚠\x20Failed\x20to\x20enable\x20plugin:','HveVF','32817gXuVVU','\x20level)...\x0a','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','VMLdG','log','push','list','bFfth','XOEEf','jNUvI','✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','ranger@trailhead','1550133WjJGDu','Ugyni','XQnOR','SNTDC','enable','✓\x20Ranger\x20skills\x20already\x20installed','5NBVCAR','ZfFlg','wantsSkillup','15365wtXHyd','success','sMSyN','Would\x20you\x20like\x20to\x20install\x20skills?','\x0a📦\x20Claude\x20Code\x20Plugin\x0a','qKegZ','\x0aYou\x20can\x20install\x20manually\x20with:','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','ranger','1743432AVWmEM','marketplace','9235281XEFSBG','rJdlI','liDqO','pMzkU','631017jLFvKM','1026296kvyuFs','Where\x20should\x20the\x20plugin\x20be\x20installed?','project','fjjxn','confirm','BDHuY','Project\x20(shared\x20with\x20team\x20via\x20git)','wOwOA','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','output','.claude','BHpWp','pluginScope','QfmEq','58uWGnhH','BnOJo','224yzgFHQ','plugin'];_0x2cb1=function(){return _0x21e5ee;};return _0x2cb1();}import{existsSync}from'fs';import _0x2219a2 from'inquirer';function _0x8d21(_0x23a71a,_0x3b08b1){_0x23a71a=_0x23a71a-0xbb;const _0x2cb1f9=_0x2cb1();let _0x8d2151=_0x2cb1f9[_0x23a71a];return _0x8d2151;}import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x37e3c8){const _0x3b000d=_0x8d21,_0x4787af={'fDMvr':function(_0x2a0b28,_0x2a652f){return _0x2a0b28(_0x2a652f);},'VMLdG':_0x3b000d(0xe1),'fjjxn':function(_0x309591,_0x488fbb){return _0x309591(_0x488fbb);},'pMzkU':function(_0x4932d6,_0x54c406,_0x127577){return _0x4932d6(_0x54c406,_0x127577);},'oTHoG':_0x3b000d(0xf4),'Ugyni':'project','jNUvI':_0x3b000d(0xcb),'qKegZ':'pluginScope','kGUnB':'User\x20(available\x20in\x20all\x20your\x20projects)','sMSyN':'user','XQnOR':function(_0x3457c2,_0x27b9c2){return _0x3457c2(_0x27b9c2);},'rJdlI':'trailhead','BbSuh':_0x3b000d(0xe4),'qwLNP':'ranger-testing/trailhead','liDqO':'❌\x20Failed\x20to\x20add\x20marketplace:','BnrTS':_0x3b000d(0xf2),'ylpQc':_0x3b000d(0xd0),'tHvgB':'--scope','ZYkWE':'❌\x20Failed\x20to\x20install\x20plugin:','XOEEf':'\x0aYou\x20can\x20install\x20manually\x20with:','BHpWp':_0x3b000d(0xbd),'QfmEq':_0x3b000d(0xd5),'tzKGC':'already\x20enabled'},_0x247014=await _0x4787af['fDMvr'](isPluginInstalled,'ranger@trailhead');if(_0x247014)return console['log'](_0x4787af[_0x3b000d(0xc8)]),![];const _0x5b5d0b=_0x4787af[_0x3b000d(0xed)](existsSync,_0x4787af['pMzkU'](join,getProjectRoot(),_0x4787af['oTHoG']));let _0x11915f;if(_0x37e3c8)_0x11915f=_0x37e3c8;else{if(_0x5b5d0b)_0x11915f=_0x4787af[_0x3b000d(0xd2)];else{console['log'](_0x3b000d(0xde));const _0x1c5992=await _0x2219a2['prompt']([{'type':_0x4787af[_0x3b000d(0xce)],'name':_0x4787af[_0x3b000d(0xdf)],'message':_0x3b000d(0xeb),'choices':[{'name':_0x4787af['kGUnB'],'value':_0x4787af['sMSyN']},{'name':_0x3b000d(0xf0),'value':_0x3b000d(0xec)}],'default':_0x4787af[_0x3b000d(0xdc)]}]);_0x11915f=_0x1c5992[_0x3b000d(0xf6)];}}console[_0x3b000d(0xc9)]('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x11915f+_0x3b000d(0xc6));const _0x48131d=await _0x4787af['XQnOR'](isMarketplaceAdded,_0x4787af[_0x3b000d(0xe6)]);let _0x4e2900=_0x48131d;if(_0x48131d)console['log']('✓\x20Marketplace\x20already\x20added');else{const _0x187cc5=await _0x4787af[_0x3b000d(0xd3)](runClaudeCommand,[_0x3b000d(0xbd),_0x4787af['BbSuh'],_0x3b000d(0xc2),_0x4787af['qwLNP']]);!_0x187cc5[_0x3b000d(0xdb)]?(console['error'](_0x4787af[_0x3b000d(0xe7)],_0x187cc5[_0x3b000d(0xc1)]),console['log'](_0x3b000d(0xe0)),console[_0x3b000d(0xc9)](_0x4787af['BnrTS']),console['log'](_0x3b000d(0xc7)+_0x11915f)):_0x4e2900=!![];}if(_0x4e2900){const _0x18b789=await _0x4787af['fjjxn'](runClaudeCommand,[_0x3b000d(0xbd),'install',_0x4787af['ylpQc'],_0x4787af['tHvgB'],_0x11915f]);if(!_0x18b789[_0x3b000d(0xdb)])console['error'](_0x4787af['ZYkWE'],_0x18b789[_0x3b000d(0xc1)]),console['log'](_0x4787af[_0x3b000d(0xcd)]),console['log'](_0x3b000d(0xc7)+_0x11915f);else{console[_0x3b000d(0xc9)](_0x3b000d(0xcf));const _0x22d397=[_0x4787af[_0x3b000d(0xf5)],_0x4787af[_0x3b000d(0xf7)],_0x3b000d(0xd0)];_0x11915f===_0x3b000d(0xec)&&_0x22d397[_0x3b000d(0xca)](_0x4787af[_0x3b000d(0xc0)],_0x4787af[_0x3b000d(0xd2)]);const _0x5307c1=await _0x4787af[_0x3b000d(0xe8)](runClaudeCommand,_0x22d397,{'captureOutput':!![]}),_0x35e292=_0x5307c1[_0x3b000d(0xf3)]?.['includes'](_0x4787af['tzKGC']);!_0x5307c1[_0x3b000d(0xdb)]&&!_0x35e292?console[_0x3b000d(0xc1)](_0x3b000d(0xc3),_0x5307c1['error']):console['log']('✓\x20Claude\x20Code\x20plugin\x20enabled');}}return!![];}export async function ensureClaudeSkills(_0x319f75){const _0x40309d=_0x8d21,_0x410981={'JYUfu':function(_0xf5f118,_0x476915,_0x488d29,_0x24d081){return _0xf5f118(_0x476915,_0x488d29,_0x24d081);},'BDHuY':'ranger','wOwOA':function(_0x1fd812,_0xda66e7){return _0x1fd812||_0xda66e7;},'jzKWs':_0x40309d(0xd6),'HveVF':function(_0x45f0cd,_0x687aa4){return _0x45f0cd(_0x687aa4);},'bFfth':function(_0x1c001d,_0x42bb32,_0x4d4abd){return _0x1c001d(_0x42bb32,_0x4d4abd);},'SNTDC':function(_0x4ff015){return _0x4ff015();},'eByRw':'.claude','RyEfZ':function(_0x3e6af1,_0x51783f){return _0x3e6af1(_0x51783f);},'ZfFlg':'project','fMMkr':_0x40309d(0xee),'BnOJo':_0x40309d(0xd9)},_0x5ee0b6=existsSync(join(getSkillsDir('user'),_0x40309d(0xe2),'SKILL.md')),_0x1b937d=existsSync(_0x410981[_0x40309d(0xbf)](join,getSkillsDir('project'),_0x410981[_0x40309d(0xef)],'SKILL.md'));if(_0x410981[_0x40309d(0xf1)](_0x5ee0b6,_0x1b937d))return console[_0x40309d(0xc9)](_0x410981['jzKWs']),![];const _0x383b81=_0x410981[_0x40309d(0xc4)](existsSync,_0x410981[_0x40309d(0xcc)](join,_0x410981[_0x40309d(0xd4)](getProjectRoot),_0x410981['eByRw']));let _0x62b9d4=!![];if(_0x319f75)await skillup({'autoInstall':_0x319f75,'suppressUsage':!![]});else{if(_0x383b81)await _0x410981['RyEfZ'](skillup,{'autoInstall':_0x410981[_0x40309d(0xd8)],'suppressUsage':!![]});else{const _0x598f04=await _0x2219a2['prompt']([{'type':_0x410981['fMMkr'],'name':_0x410981[_0x40309d(0xbb)],'message':_0x40309d(0xdd),'default':!![]}]);_0x62b9d4=_0x598f04['wantsSkillup'],_0x62b9d4&&await skillup({'suppressUsage':!![]});}}return _0x62b9d4;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x33c4(_0x4dd291,_0x32b781){_0x4dd291=_0x4dd291-0x18c;const _0x11ba14=_0x11ba();let _0x33c4f6=_0x11ba14[_0x4dd291];return _0x33c4f6;}(function(_0x4cd5ae,_0x30f1ec){const _0x285551=_0x33c4,_0x213d0a=_0x4cd5ae();while(!![]){try{const _0x2c8afa=parseInt(_0x285551(0x1aa))/0x1*(parseInt(_0x285551(0x192))/0x2)+parseInt(_0x285551(0x190))/0x3+-parseInt(_0x285551(0x1a0))/0x4+-parseInt(_0x285551(0x18e))/0x5*(-parseInt(_0x285551(0x1a4))/0x6)+-parseInt(_0x285551(0x1a2))/0x7*(parseInt(_0x285551(0x1a5))/0x8)+parseInt(_0x285551(0x18c))/0x9+parseInt(_0x285551(0x1a3))/0xa;if(_0x2c8afa===_0x30f1ec)break;else _0x213d0a['push'](_0x213d0a['shift']());}catch(_0xf9dcd6){_0x213d0a['push'](_0x213d0a['shift']());}}}(_0x11ba,0x53402));function _0x11ba(){const _0x4a8fed=['7TMbUvd','5621130QxOBwZ','180102EQSAth','4125608Uugabu','usSrW','FTTVP','isArray','NwQXF','287624TVFvtU','4882923YCNjCl','pluginScope','5CsWTer','taLnS','183360FQluOl','Project\x20(shared\x20with\x20team\x20via\x20git)','2zcivtE','zuCbS','Failed\x20to\x20read\x20opencode.json','project','✓\x20OpenCode\x20plugin\x20configured','list','user','QpVqI','opencode.json','OSgZy','plugin','utf-8','@ranger-testing/opencode-plugin','tkpEH','2506904CQZyhD','$schema'];_0x11ba=function(){return _0x4a8fed;};return _0x11ba();}import{join}from'path';import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0x5353e1 from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0x5dcb7a){const _0x49bd5e=_0x33c4,_0x384cf6={'taLnS':function(_0x348247,_0x2eee4a){return _0x348247(_0x2eee4a);},'zuCbS':'\x0a📦\x20OpenCode\x20Plugin\x0a','FTTVP':_0x49bd5e(0x197),'QpVqI':'user','tpUMK':'project','ANUJO':function(_0x41aee0,_0x1ab199){return _0x41aee0(_0x1ab199);},'OSgZy':_0x49bd5e(0x19e),'tkpEH':function(_0x35fb8f,_0x13e173,_0x4acf82){return _0x35fb8f(_0x13e173,_0x4acf82);},'KpMIQ':_0x49bd5e(0x19d),'NwQXF':'⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','pBuYh':'✓\x20OpenCode\x20plugin\x20already\x20configured','usSrW':function(_0x3be08a,_0xc09969,_0x287a5e){return _0x3be08a(_0xc09969,_0x287a5e);}},_0x393c9a=existsSync(join(_0x384cf6[_0x49bd5e(0x18f)](getOpencodeConfigDir,_0x49bd5e(0x195)),'opencode.json'));let _0x1e9951;if(_0x5dcb7a)_0x1e9951=_0x5dcb7a;else{if(_0x393c9a)_0x1e9951='project';else{console['log'](_0x384cf6[_0x49bd5e(0x193)]);const _0x244cc6=await _0x5353e1['prompt']([{'type':_0x384cf6[_0x49bd5e(0x1a7)],'name':'pluginScope','message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':'User\x20(available\x20in\x20all\x20your\x20projects)','value':_0x384cf6[_0x49bd5e(0x199)]},{'name':_0x49bd5e(0x191),'value':_0x384cf6['tpUMK']}],'default':_0x49bd5e(0x198)}]);_0x1e9951=_0x244cc6[_0x49bd5e(0x18d)];}}const _0x296034=join(_0x384cf6['ANUJO'](getOpencodeConfigDir,_0x1e9951),_0x49bd5e(0x19a)),_0x43f801=_0x384cf6[_0x49bd5e(0x19b)],_0x5140ba='https://opencode.ai/config.json';let _0x1751e9={};if(existsSync(_0x296034))try{const _0x11a603=await _0x384cf6[_0x49bd5e(0x19f)](readFile,_0x296034,_0x384cf6['KpMIQ']);_0x1751e9=JSON['parse'](_0x11a603);}catch(_0xd480e7){return console['error'](_0x384cf6[_0x49bd5e(0x1a9)]),{'configured':![],'scope':_0x1e9951,'error':_0x49bd5e(0x194),'details':_0xd480e7};}const _0x3df835=Array[_0x49bd5e(0x1a8)](_0x1751e9['plugin'])?_0x1751e9['plugin']:[];if(_0x3df835['includes'](_0x43f801))return console['log'](_0x384cf6['pBuYh']),{'configured':![],'scope':_0x1e9951};return _0x1751e9[_0x49bd5e(0x1a1)]=_0x1751e9[_0x49bd5e(0x1a1)]||_0x5140ba,_0x1751e9[_0x49bd5e(0x19c)]=[..._0x3df835,_0x43f801],await mkdir(_0x384cf6[_0x49bd5e(0x18f)](getOpencodeConfigDir,_0x1e9951),{'recursive':!![]}),await _0x384cf6[_0x49bd5e(0x1a6)](writeFile,_0x296034,JSON['stringify'](_0x1751e9,null,0x2)+'\x0a'),console['log'](_0x49bd5e(0x196)),{'configured':!![],'scope':_0x1e9951};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4e7088,_0x53c0ad){const _0x59b882=_0x22c6,_0x2e83bd=_0x4e7088();while(!![]){try{const _0x3d5de2=-parseInt(_0x59b882(0x168))/0x1*(parseInt(_0x59b882(0x131))/0x2)+parseInt(_0x59b882(0x13d))/0x3*(parseInt(_0x59b882(0x132))/0x4)+parseInt(_0x59b882(0x126))/0x5*(-parseInt(_0x59b882(0x160))/0x6)+-parseInt(_0x59b882(0x136))/0x7+parseInt(_0x59b882(0x142))/0x8*(parseInt(_0x59b882(0x139))/0x9)+parseInt(_0x59b882(0x169))/0xa*(-parseInt(_0x59b882(0x140))/0xb)+parseInt(_0x59b882(0x129))/0xc*(parseInt(_0x59b882(0x155))/0xd);if(_0x3d5de2===_0x53c0ad)break;else _0x2e83bd['push'](_0x2e83bd['shift']());}catch(_0x848330){_0x2e83bd['push'](_0x2e83bd['shift']());}}}(_0x56ac,0xab338));function _0x22c6(_0x25bb4d,_0x38e1ea){_0x25bb4d=_0x25bb4d-0x124;const _0x56ac49=_0x56ac();let _0x22c672=_0x56ac49[_0x25bb4d];return _0x22c672;}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';function _0x56ac(){const _0x333fbd=['xPzYV','Installing\x20Claude\x20Code\x20plugin\x20(project\x20level)...','RRWcK','7481740gFPeRA','Failed\x20to\x20verify\x20encrypted\x20auth\x20for\x20profile\x20\x22','ialzD','3231OPmVaD','settings.json','add','FSuKh','71313zhYRmh','Multiple\x20CI\x20profiles\x20found:\x20','plugin','14223ypqXwD','lGrbu','29576tICMwh','error','hkpQg','marketplace','--scope','CSHWT','OLehj','success','tbBrx','path','Apwhp','skipChromium','log','length','Failed\x20to\x20install\x20plugin:','project','auth','map','profile','18102227rgwmRa','dBLra','ranger@trailhead','ranger-testing/trailhead','trackPhaseStart','✓\x20Auth\x20state\x20found','auth.json.enc','dir_setup','tszTv','Failed\x20to\x20add\x20marketplace:','message','108JbPvjl','skills','.\x20Use\x20--profile\x20to\x20specify\x20which\x20one.','profile_activate','TsFWe','Auto-detected\x20CI\x20profile:\x20','✓\x20Marketplace\x20already\x20added','hEfbz','245ryCGLV','10100BYdpAJ','trailhead','No\x20API\x20token\x20available\x20for\x20decryption','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','279085pCmnix','\x0a✅\x20Ranger\x20CI\x20setup\x20complete!\x0a','name','24whubKJ','XkBdS','baseUrl','TCdED','Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.','trackPhaseEnd','SGtal','KJwtE','4138bvtiOG','80vQrZap'];_0x56ac=function(){return _0x333fbd;};return _0x56ac();}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(_0x114cfe){const _0x4851ca=_0x22c6,_0x4f4ba7={'TsFWe':function(_0x3764f4,_0x5e6c47){return _0x3764f4+_0x5e6c47;},'edFMD':function(_0x44e81d,_0x24893b,_0x5d240c){return _0x44e81d(_0x24893b,_0x5d240c);},'cafXM':function(_0x1c47b4,_0x13984a){return _0x1c47b4+_0x13984a;},'LlLlf':'Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.'},_0x2709a8=getRangerDir(),_0x53111e=join(_0x2709a8,'ci');if(_0x114cfe){const _0x170c61=join(_0x53111e,_0x114cfe);return{'name':_0x114cfe,'path':_0x170c61};}if(!existsSync(_0x53111e))throw new Error(_0x4f4ba7[_0x4851ca(0x164)]('No\x20CI\x20profiles\x20found.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a',_0x4851ca(0x12d)));const _0x3e6fea=await _0x4f4ba7['edFMD'](readdir,_0x53111e,{'withFileTypes':!![]}),_0xd3cb7e=_0x3e6fea['filter'](_0x551154=>_0x551154['isDirectory']())[_0x4851ca(0x153)](_0x7ecc9f=>_0x7ecc9f['name']);if(_0xd3cb7e[_0x4851ca(0x14f)]===0x0)throw new Error(_0x4f4ba7['cafXM']('No\x20CI\x20profiles\x20found\x20in\x20.ranger/ci/.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a',_0x4f4ba7['LlLlf']));if(_0xd3cb7e['length']===0x1){const _0x832de4=_0xd3cb7e[0x0];return console['log'](_0x4851ca(0x165)+_0x832de4),{'name':_0x832de4,'path':join(_0x53111e,_0x832de4)};}throw new Error(_0x4851ca(0x13e)+_0xd3cb7e['join'](',\x20')+_0x4851ca(0x162));}async function installPluginNonInteractive(){const _0xb28b96=_0x22c6,_0x4b141a={'DVCiz':function(_0x4af6f0,_0x182e90){return _0x4af6f0(_0x182e90);},'uoNul':_0xb28b96(0x157),'SGtal':_0xb28b96(0x125),'qhlLa':function(_0x1f7c55,_0x5ddc3b){return _0x1f7c55(_0x5ddc3b);},'lGrbu':_0xb28b96(0x16a),'ialzD':function(_0x5ae941,_0x289719){return _0x5ae941(_0x289719);},'SfBBA':_0xb28b96(0x145),'zIDeW':_0xb28b96(0x158),'KJwtE':'You\x20can\x20install\x20manually:\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','XkBdS':function(_0x44aeef,_0x2f7075){return _0x44aeef(_0x2f7075);},'cstTI':'project'},_0xf9e195=await _0x4b141a['DVCiz'](isPluginInstalled,_0x4b141a['uoNul']);if(_0xf9e195)return console['log'](_0x4b141a[_0xb28b96(0x12f)]),![];console[_0xb28b96(0x14e)](_0xb28b96(0x134));const _0x122d75=await _0x4b141a['qhlLa'](isMarketplaceAdded,_0x4b141a[_0xb28b96(0x141)]);let _0x4cca79=_0x122d75;if(_0x122d75)console['log'](_0xb28b96(0x166));else{const _0x5e4aec=await _0x4b141a[_0xb28b96(0x138)](runClaudeCommand,['plugin',_0x4b141a['SfBBA'],_0xb28b96(0x13b),_0x4b141a['zIDeW']]);!_0x5e4aec[_0xb28b96(0x149)]?(console[_0xb28b96(0x143)](_0xb28b96(0x15e),_0x5e4aec['error']),console[_0xb28b96(0x14e)](_0x4b141a[_0xb28b96(0x130)])):_0x4cca79=!![];}if(_0x4cca79){const _0x60027e=await _0x4b141a[_0xb28b96(0x12a)](runClaudeCommand,[_0xb28b96(0x13f),'install',_0x4b141a['uoNul'],_0xb28b96(0x146),_0x4b141a['cstTI']]);!_0x60027e[_0xb28b96(0x149)]?(console[_0xb28b96(0x143)](_0xb28b96(0x150),_0x60027e['error']),console[_0xb28b96(0x14e)]('You\x20can\x20install\x20manually:\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20project')):console[_0xb28b96(0x14e)]('✓\x20Claude\x20Code\x20plugin\x20installed');}return!![];}export async function setupCi(_0x503170,_0x55b71f,_0x174467){const _0x2185cf=_0x22c6,_0x17025f={'nRxqd':'\x0a🔧\x20Ranger\x20CI\x20Setup\x0a','VdNLV':_0x2185cf(0x152),'mbzym':'dir_setup','tbBrx':function(_0x43ef0f){return _0x43ef0f();},'OLehj':function(_0x4c9e41,_0x16d90a){return _0x4c9e41(_0x16d90a);},'FSuKh':function(_0x52543d,_0x13ac8b,_0x39c102){return _0x52543d(_0x13ac8b,_0x39c102);},'tszTv':function(_0x205538,_0x52e7a0,_0x4842ec){return _0x205538(_0x52e7a0,_0x4842ec);},'hkpQg':'✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','bLnLr':'chromium','bOTgY':_0x2185cf(0x13a),'YhOXq':function(_0x195477,_0x449cd6,_0x1f5665){return _0x195477(_0x449cd6,_0x1f5665);},'xPzYV':'auth.json','TCdED':_0x2185cf(0x15b),'CaFqz':function(_0x347d6a){return _0x347d6a();},'oIXSg':_0x2185cf(0x124),'GfNPs':function(_0x59d688,_0x17300c){return _0x59d688 instanceof _0x17300c;},'hEfbz':_0x2185cf(0x15a),'ZsxmN':'\x20\x20No\x20auth\x20state\x20found\x20(app\x20may\x20not\x20require\x20authentication)','RRWcK':function(_0x2b3f1,_0x47f706){return _0x2b3f1(_0x47f706);},'Apwhp':'profile_activate','rYcIz':'plugin','dBLra':_0x2185cf(0x151),'CSHWT':_0x2185cf(0x161)};console['log'](_0x17025f['nRxqd']),_0x174467?.['trackPhaseStart'](_0x17025f['VdNLV']),await authenticate(_0x503170),_0x174467?.['trackPhaseEnd'](_0x17025f['VdNLV']),_0x174467?.['trackPhaseStart'](_0x17025f['mbzym']);const {path:_0x74c907,installed:_0x278d9c}=await _0x17025f[_0x2185cf(0x14a)](ensureRangerDir);await _0x17025f['OLehj'](writeRangerGitignore,_0x74c907);const _0x1b0665=_0x17025f[_0x2185cf(0x13c)](join,_0x74c907,'sessions');!_0x17025f[_0x2185cf(0x148)](existsSync,_0x1b0665)&&await _0x17025f[_0x2185cf(0x15d)](mkdir,_0x1b0665,{'recursive':!![]});_0x174467?.['trackPhaseEnd'](_0x2185cf(0x15c),{'installed':_0x278d9c}),_0x174467?.['trackPhaseStart']('chromium');let _0x2efd1e=![];_0x55b71f?.[_0x2185cf(0x14d)]?console['log'](_0x17025f[_0x2185cf(0x144)]):_0x2efd1e=await ensureChromium();_0x174467?.[_0x2185cf(0x12e)](_0x17025f['bLnLr'],{'installed':_0x2efd1e,'skipped':!!_0x55b71f?.[_0x2185cf(0x14d)]}),_0x174467?.[_0x2185cf(0x159)](_0x2185cf(0x163));const _0x1591c4=await _0x17025f['OLehj'](findCiProfile,_0x55b71f?.[_0x2185cf(0x154)]);let _0x1c9880=![];_0x55b71f?.[_0x2185cf(0x12b)]&&(await mkdir(_0x1591c4[_0x2185cf(0x14b)],{'recursive':!![]}),await _0x17025f['tszTv'](saveSettings,_0x1591c4[_0x2185cf(0x128)],{'baseUrl':_0x55b71f['baseUrl'],'headless':!![]}),console['log']('✓\x20Created\x20profile\x20settings:\x20baseUrl='+_0x55b71f['baseUrl']),_0x1c9880=!![]);const _0x52471c=_0x17025f[_0x2185cf(0x15d)](join,_0x1591c4[_0x2185cf(0x14b)],_0x17025f['bOTgY']);if(!existsSync(_0x52471c)&&!_0x1c9880)throw new Error('CI\x20profile\x20\x22'+_0x1591c4['name']+'\x22\x20has\x20no\x20settings.json.\x20Use\x20--base-url\x20to\x20configure\x20it.');const _0x2edfc1=_0x17025f['YhOXq'](join,_0x1591c4['path'],_0x17025f[_0x2185cf(0x133)]),_0x5eabda=join(_0x1591c4['path'],_0x17025f[_0x2185cf(0x12c)]),_0x40d7dc=_0x17025f['OLehj'](existsSync,_0x2edfc1),_0xde7015=_0x17025f[_0x2185cf(0x148)](existsSync,_0x5eabda);if(_0xde7015)try{const _0xce0f9f=await _0x17025f['CaFqz'](getToken);if(!_0xce0f9f)throw new Error(_0x17025f['oIXSg']);const _0x5189a8=await readFile(_0x5eabda);decrypt(_0x5189a8,_0xce0f9f),console[_0x2185cf(0x14e)]('✓\x20Encrypted\x20auth\x20verified\x20(will\x20decrypt\x20at\x20runtime)');}catch(_0x240ac4){const _0x320b28=_0x17025f['GfNPs'](_0x240ac4,Error)?_0x240ac4[_0x2185cf(0x15f)]:String(_0x240ac4);throw new Error(_0x2185cf(0x137)+_0x1591c4['name']+'\x22:\x20'+_0x320b28);}else _0x40d7dc?console['log'](_0x17025f[_0x2185cf(0x167)]):console['log'](_0x17025f['ZsxmN']);await _0x17025f[_0x2185cf(0x135)](writeActiveProfileName,_0x1591c4['name']),console[_0x2185cf(0x14e)]('✓\x20Active\x20profile:\x20'+_0x1591c4[_0x2185cf(0x128)]),_0x174467?.[_0x2185cf(0x12e)](_0x17025f[_0x2185cf(0x14c)],{'profileName':_0x1591c4[_0x2185cf(0x128)],'hasAuth':_0x40d7dc,'hasEncryptedAuth':_0xde7015,'createdSettings':_0x1c9880}),_0x174467?.['trackPhaseStart']('plugin');const _0x7b9aef=await installPluginNonInteractive();_0x174467?.['trackPhaseEnd'](_0x17025f['rYcIz'],{'installed':_0x7b9aef}),_0x174467?.[_0x2185cf(0x159)]('skills'),await skillup({'autoInstall':_0x17025f[_0x2185cf(0x156)]}),_0x174467?.['trackPhaseEnd'](_0x17025f[_0x2185cf(0x147)]),console['log'](_0x2185cf(0x127));}
|
|
1
|
+
(function(_0x1006f1,_0x4ff5de){const _0x3d20f5=_0x6e72,_0x27602d=_0x1006f1();while(!![]){try{const _0x4e4cbc=parseInt(_0x3d20f5(0x140))/0x1+parseInt(_0x3d20f5(0x10e))/0x2*(-parseInt(_0x3d20f5(0x11f))/0x3)+parseInt(_0x3d20f5(0x11d))/0x4+-parseInt(_0x3d20f5(0x12a))/0x5+parseInt(_0x3d20f5(0x120))/0x6*(parseInt(_0x3d20f5(0x118))/0x7)+-parseInt(_0x3d20f5(0x136))/0x8+parseInt(_0x3d20f5(0x12d))/0x9;if(_0x4e4cbc===_0x4ff5de)break;else _0x27602d['push'](_0x27602d['shift']());}catch(_0x48ba51){_0x27602d['push'](_0x27602d['shift']());}}}(_0x1ca5,0xb6137));import{mkdir,readFile,readdir}from'fs/promises';function _0x6e72(_0x4257d6,_0x4c68fc){_0x4257d6=_0x4257d6-0x10e;const _0x1ca599=_0x1ca5();let _0x6e7287=_0x1ca599[_0x4257d6];return _0x6e7287;}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(_0x16fefa){const _0x4033d4=_0x6e72,_0x496624={'mIzQc':function(_0x5736c7,_0x5e5a57){return _0x5736c7(_0x5e5a57);},'vnOux':function(_0x2fb173,_0x1a24ad){return _0x2fb173+_0x1a24ad;},'BOEfr':_0x4033d4(0x126),'wgTCu':function(_0xaa95f1,_0x412457,_0x4114cd){return _0xaa95f1(_0x412457,_0x4114cd);},'uiksL':function(_0x2da090,_0x344865){return _0x2da090+_0x344865;},'jzXbZ':'No\x20CI\x20profiles\x20found\x20in\x20.ranger/ci/.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','iukJe':function(_0xd0ffcd,_0x48fad7){return _0xd0ffcd===_0x48fad7;},'JlwQN':function(_0x3e6a7c,_0x264562,_0x11b341){return _0x3e6a7c(_0x264562,_0x11b341);}},_0x576798=getRangerDir(),_0x813a3c=join(_0x576798,'ci');if(_0x16fefa){const _0x4d7325=join(_0x813a3c,_0x16fefa);return{'name':_0x16fefa,'path':_0x4d7325};}if(!_0x496624[_0x4033d4(0x148)](existsSync,_0x813a3c))throw new Error(_0x496624[_0x4033d4(0x13c)](_0x4033d4(0x14d),_0x496624['BOEfr']));const _0x4cb059=await _0x496624[_0x4033d4(0x11e)](readdir,_0x813a3c,{'withFileTypes':!![]}),_0x3b1c54=_0x4cb059['filter'](_0x1557b9=>_0x1557b9['isDirectory']())['map'](_0x1dae15=>_0x1dae15['name']);if(_0x3b1c54[_0x4033d4(0x117)]===0x0)throw new Error(_0x496624[_0x4033d4(0x12b)](_0x496624['jzXbZ'],_0x496624['BOEfr']));if(_0x496624[_0x4033d4(0x12c)](_0x3b1c54[_0x4033d4(0x117)],0x1)){const _0x1e5a74=_0x3b1c54[0x0];return console[_0x4033d4(0x14f)](_0x4033d4(0x10f)+_0x1e5a74),{'name':_0x1e5a74,'path':_0x496624[_0x4033d4(0x127)](join,_0x813a3c,_0x1e5a74)};}throw new Error(_0x4033d4(0x13d)+_0x3b1c54['join'](',\x20')+_0x4033d4(0x144));}function _0x1ca5(){const _0x314e8c=['iukJe','1121580loPKLy','settings.json','name','error','plugin','auth','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','AsXSC','✓\x20Claude\x20Code\x20plugin\x20installed','6035992idrKNX','ranger@trailhead','EQXoe','✓\x20Encrypted\x20auth\x20verified\x20(will\x20decrypt\x20at\x20runtime)','XBzCk','idACb','vnOux','Multiple\x20CI\x20profiles\x20found:\x20','Deort','zplaI','21426DtmzJX','✓\x20Marketplace\x20already\x20added','ThZWF','mqgYx','.\x20Use\x20--profile\x20to\x20specify\x20which\x20one.','CHKeL','ranger-testing/trailhead','WXmxC','mIzQc','OjiFB','chromium','\x0a🔧\x20Ranger\x20CI\x20Setup\x0a','trailhead','No\x20CI\x20profiles\x20found.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','EbTiH','log','htBjO','trackPhaseStart','baseUrl','path','277748XRXvco','Auto-detected\x20CI\x20profile:\x20','success','\x0a✅\x20Ranger\x20CI\x20setup\x20complete!\x0a','skills','install','Cdykl','YSNri','profile','length','7990549xVCKGo','✓\x20Active\x20profile:\x20','auth.json','Failed\x20to\x20install\x20plugin:','dir_setup','3625920AvYHUo','wgTCu','3YASPtr','6LYchFJ','KdEeN','mNFfZ','CI\x20profile\x20\x22','No\x20API\x20token\x20available\x20for\x20decryption','trackPhaseEnd','Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.','JlwQN','profile_activate','project','2774385pRDtIE','uiksL'];_0x1ca5=function(){return _0x314e8c;};return _0x1ca5();}async function installPluginNonInteractive(){const _0x5e1ba7=_0x6e72,_0x594d81={'mqgYx':_0x5e1ba7(0x137),'AsXSC':function(_0xc2d994,_0x42b609){return _0xc2d994(_0x42b609);},'vpgGY':_0x5e1ba7(0x131),'UMkZx':_0x5e1ba7(0x146),'Deort':'Failed\x20to\x20add\x20marketplace:','WCvgK':'You\x20can\x20install\x20manually:\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','htBjO':_0x5e1ba7(0x113),'ZFuMp':'--scope','idACb':'You\x20can\x20install\x20manually:\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20project','ThZWF':_0x5e1ba7(0x135)},_0x1a026e=await isPluginInstalled(_0x594d81[_0x5e1ba7(0x143)]);if(_0x1a026e)return console[_0x5e1ba7(0x14f)]('✓\x20Claude\x20Code\x20plugin\x20already\x20installed'),![];console['log']('Installing\x20Claude\x20Code\x20plugin\x20(project\x20level)...');const _0x435a8c=await _0x594d81['AsXSC'](isMarketplaceAdded,_0x5e1ba7(0x14c));let _0x2c4de5=_0x435a8c;if(_0x435a8c)console['log'](_0x5e1ba7(0x141));else{const _0x5e0dce=await _0x594d81[_0x5e1ba7(0x134)](runClaudeCommand,[_0x594d81['vpgGY'],'marketplace','add',_0x594d81['UMkZx']]);!_0x5e0dce['success']?(console['error'](_0x594d81[_0x5e1ba7(0x13e)],_0x5e0dce[_0x5e1ba7(0x130)]),console[_0x5e1ba7(0x14f)](_0x594d81['WCvgK'])):_0x2c4de5=!![];}if(_0x2c4de5){const _0x4b0ad5=await runClaudeCommand([_0x594d81['vpgGY'],_0x594d81[_0x5e1ba7(0x150)],_0x5e1ba7(0x137),_0x594d81['ZFuMp'],_0x5e1ba7(0x129)]);!_0x4b0ad5[_0x5e1ba7(0x110)]?(console['error'](_0x5e1ba7(0x11b),_0x4b0ad5['error']),console['log'](_0x594d81[_0x5e1ba7(0x13b)])):console[_0x5e1ba7(0x14f)](_0x594d81[_0x5e1ba7(0x142)]);}return!![];}export async function setupCi(_0x47d956,_0x387465,_0xf5c5d7){const _0x80ff4d=_0x6e72,_0x4d3622={'eATOF':_0x80ff4d(0x14b),'amMNp':'auth','OjiFB':function(_0x1bcd14,_0x89b14a,_0x3cac8e){return _0x1bcd14(_0x89b14a,_0x3cac8e);},'KdEeN':'dir_setup','zplaI':_0x80ff4d(0x14a),'Cdykl':_0x80ff4d(0x128),'WXmxC':function(_0x15c602,_0x76e2ff){return _0x15c602(_0x76e2ff);},'YSNri':_0x80ff4d(0x12e),'CHKeL':function(_0x52d26d,_0x419bed){return _0x52d26d(_0x419bed);},'crzSA':function(_0x166f38,_0x1c13b5){return _0x166f38(_0x1c13b5);},'UzSLY':_0x80ff4d(0x124),'EQXoe':function(_0x3cbfb3,_0x2f4baa){return _0x3cbfb3 instanceof _0x2f4baa;},'mNFfZ':'✓\x20Auth\x20state\x20found','JfzTc':'\x20\x20No\x20auth\x20state\x20found\x20(app\x20may\x20not\x20require\x20authentication)','VBqQq':'plugin','wnqNf':_0x80ff4d(0x112),'XBzCk':function(_0x2901ff,_0x1bda4e){return _0x2901ff(_0x1bda4e);},'EbTiH':_0x80ff4d(0x111)};console['log'](_0x4d3622['eATOF']),_0xf5c5d7?.[_0x80ff4d(0x151)](_0x4d3622['amMNp']),await authenticate(_0x47d956),_0xf5c5d7?.['trackPhaseEnd'](_0x80ff4d(0x132)),_0xf5c5d7?.['trackPhaseStart'](_0x80ff4d(0x11c));const {path:_0x592a09,installed:_0x25c1e8}=await ensureRangerDir();await writeRangerGitignore(_0x592a09);const _0xc838a5=_0x4d3622['OjiFB'](join,_0x592a09,'sessions');!existsSync(_0xc838a5)&&await _0x4d3622['OjiFB'](mkdir,_0xc838a5,{'recursive':!![]});_0xf5c5d7?.['trackPhaseEnd'](_0x4d3622[_0x80ff4d(0x121)],{'installed':_0x25c1e8}),_0xf5c5d7?.['trackPhaseStart'](_0x4d3622[_0x80ff4d(0x13f)]);let _0x5707c7=![];_0x387465?.['skipChromium']?console[_0x80ff4d(0x14f)](_0x80ff4d(0x133)):_0x5707c7=await ensureChromium();_0xf5c5d7?.['trackPhaseEnd'](_0x4d3622['zplaI'],{'installed':_0x5707c7,'skipped':!!_0x387465?.['skipChromium']}),_0xf5c5d7?.[_0x80ff4d(0x151)](_0x4d3622[_0x80ff4d(0x114)]);const _0x3583b2=await _0x4d3622[_0x80ff4d(0x147)](findCiProfile,_0x387465?.[_0x80ff4d(0x116)]);let _0x6cb25e=![];_0x387465?.[_0x80ff4d(0x152)]&&(await mkdir(_0x3583b2[_0x80ff4d(0x153)],{'recursive':!![]}),await _0x4d3622[_0x80ff4d(0x149)](saveSettings,_0x3583b2[_0x80ff4d(0x12f)],{'baseUrl':_0x387465[_0x80ff4d(0x152)],'headless':!![]}),console[_0x80ff4d(0x14f)]('✓\x20Created\x20profile\x20settings:\x20baseUrl='+_0x387465[_0x80ff4d(0x152)]),_0x6cb25e=!![]);const _0xf58de1=join(_0x3583b2[_0x80ff4d(0x153)],_0x4d3622[_0x80ff4d(0x115)]);if(!_0x4d3622[_0x80ff4d(0x145)](existsSync,_0xf58de1)&&!_0x6cb25e)throw new Error(_0x80ff4d(0x123)+_0x3583b2['name']+'\x22\x20has\x20no\x20settings.json.\x20Use\x20--base-url\x20to\x20configure\x20it.');const _0x4a3d83=_0x4d3622['OjiFB'](join,_0x3583b2[_0x80ff4d(0x153)],_0x80ff4d(0x11a)),_0x27d2b5=join(_0x3583b2['path'],'auth.json.enc'),_0x5a5bfa=existsSync(_0x4a3d83),_0x752902=_0x4d3622['crzSA'](existsSync,_0x27d2b5);if(_0x752902)try{const _0x245154=await getToken();if(!_0x245154)throw new Error(_0x4d3622['UzSLY']);const _0x404c6c=await readFile(_0x27d2b5);_0x4d3622['OjiFB'](decrypt,_0x404c6c,_0x245154),console[_0x80ff4d(0x14f)](_0x80ff4d(0x139));}catch(_0x2b4f9b){const _0x29745f=_0x4d3622[_0x80ff4d(0x138)](_0x2b4f9b,Error)?_0x2b4f9b['message']:String(_0x2b4f9b);throw new Error('Failed\x20to\x20verify\x20encrypted\x20auth\x20for\x20profile\x20\x22'+_0x3583b2['name']+'\x22:\x20'+_0x29745f);}else _0x5a5bfa?console['log'](_0x4d3622[_0x80ff4d(0x122)]):console['log'](_0x4d3622['JfzTc']);await writeActiveProfileName(_0x3583b2[_0x80ff4d(0x12f)]),console[_0x80ff4d(0x14f)](_0x80ff4d(0x119)+_0x3583b2['name']),_0xf5c5d7?.['trackPhaseEnd'](_0x80ff4d(0x128),{'profileName':_0x3583b2['name'],'hasAuth':_0x5a5bfa,'hasEncryptedAuth':_0x752902,'createdSettings':_0x6cb25e}),_0xf5c5d7?.[_0x80ff4d(0x151)](_0x4d3622['VBqQq']);const _0x3afe6e=await installPluginNonInteractive();_0xf5c5d7?.['trackPhaseEnd'](_0x80ff4d(0x131),{'installed':_0x3afe6e}),_0xf5c5d7?.['trackPhaseStart'](_0x4d3622['wnqNf']),await _0x4d3622[_0x80ff4d(0x13a)](skillup,{'autoInstall':_0x80ff4d(0x129)}),_0xf5c5d7?.[_0x80ff4d(0x125)](_0x80ff4d(0x112)),console['log'](_0x4d3622[_0x80ff4d(0x14e)]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x3a74(_0x47e5c4,_0x20162e){_0x47e5c4=_0x47e5c4-0x93;const _0x34e56f=_0x34e5();let _0x3a747a=_0x34e56f[_0x47e5c4];return _0x3a747a;}(function(_0x3d83b5,_0x1eaa94){const _0x1fb314=_0x3a74,_0x3ed0ec=_0x3d83b5();while(!![]){try{const _0x160cf8=-parseInt(_0x1fb314(0x97))/0x1*(parseInt(_0x1fb314(0xb6))/0x2)+parseInt(_0x1fb314(0x9e))/0x3*(-parseInt(_0x1fb314(0xa7))/0x4)+parseInt(_0x1fb314(0x94))/0x5*(parseInt(_0x1fb314(0xb4))/0x6)+parseInt(_0x1fb314(0xc1))/0x7+parseInt(_0x1fb314(0xa1))/0x8+parseInt(_0x1fb314(0xb8))/0x9+-parseInt(_0x1fb314(0xa8))/0xa*(parseInt(_0x1fb314(0xa6))/0xb);if(_0x160cf8===_0x1eaa94)break;else _0x3ed0ec['push'](_0x3ed0ec['shift']());}catch(_0x5ce0fc){_0x3ed0ec['push'](_0x3ed0ec['shift']());}}}(_0x34e5,0xd3045));function _0x34e5(){const _0x3e4afe=['prompt','2053144ynQyHz','claude','user','peXdn','autoInstall','11TCFdpx','144TOMHef','5127790rDJuRQ','\x20<your-api-token>','\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!','\x20successfully!\x0a','project','vdzxR','\x20--opencode','suppressUsage','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','installLevel','MUjua','\x20\x203.\x20Run:\x20ranger\x20skillup','1862436yOlXby','ExpBs','7772jIUDPV','platform','5976288hzxuiU','\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a','log','GAtJK','orUPX','PSmwv','/.claude/skills/','project-level','isTTY','6637561kRbmhA','\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','10xHCFub','ranger','stdin','95VGmDdc','All\x20projects\x20(','Wmglt','list','split','opencode','\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','61953rqtPnB','5|1|2|4|0|3'];_0x34e5=function(){return _0x3e4afe;};return _0x34e5();}import{basename}from'path';import _0x50a920 from'inquirer';import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x5edfe7={}){const _0x413b7a=_0x3a74,_0x537e4f={'orUPX':_0x413b7a(0xae),'UnIID':'To\x20get\x20started:','MUjua':'\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','VRyQl':'opencode','peXdn':function(_0x19036c){return _0x19036c();},'vdzxR':function(_0x186723,_0x259a61){return _0x186723===_0x259a61;},'wuelv':_0x413b7a(0x9a),'gxAaq':function(_0x3d229d){return _0x3d229d();},'FBbwm':function(_0x2b9251,_0x70181){return _0x2b9251 instanceof _0x70181;},'oyXLM':_0x413b7a(0xa3),'ExpBs':'user-level','Wmglt':_0x413b7a(0xbf),'PSmwv':function(_0x482d9b,_0x145731){return _0x482d9b>_0x145731;},'GAtJK':'To\x20use:','ZJJBS':_0x413b7a(0x9d),'yJXyB':_0x413b7a(0xb9)};console['log']('\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a');const _0x281c43=_0x5edfe7[_0x413b7a(0xb7)]??_0x413b7a(0xa2),_0x286abe=await getToken();if(!_0x286abe){const _0x36db2e=_0x413b7a(0x9f)[_0x413b7a(0x9b)]('|');let _0x35ee82=0x0;while(!![]){switch(_0x36db2e[_0x35ee82++]){case'0':console['log'](_0x413b7a(0xb3)+(_0x281c43==='opencode'?_0x537e4f[_0x413b7a(0xbc)]:'')+'\x0a');continue;case'1':console[_0x413b7a(0xba)](_0x537e4f['UnIID']);continue;case'2':console[_0x413b7a(0xba)](_0x537e4f[_0x413b7a(0xb2)]);continue;case'3':return;case'4':console['log']('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0x281c43===_0x537e4f['VRyQl']?_0x537e4f[_0x413b7a(0xbc)]:'')+_0x413b7a(0xa9));continue;case'5':console['log'](_0x413b7a(0xb0));continue;}break;}}console['log']('✓\x20Found\x20API\x20token');const _0x8c61fa=_0x537e4f[_0x413b7a(0xa4)](getProjectRoot),_0x57b727=basename(_0x8c61fa),_0x5d62db=_0x281c43===_0x537e4f['VRyQl']?getOpencodeConfigDir('user')+'/skills/':getClaudeConfigDir()+'/skills/',_0x45af4d=_0x537e4f['vdzxR'](_0x281c43,'opencode')?_0x8c61fa+'/.opencode/skills/':_0x8c61fa+_0x413b7a(0xbe),_0x530203=process[_0x413b7a(0x96)][_0x413b7a(0xc0)]&&process['stdout'][_0x413b7a(0xc0)];let _0x2162d8;if(_0x5edfe7['autoInstall'])_0x2162d8=_0x5edfe7[_0x413b7a(0xa5)];else{if(_0x530203){const _0x14d55c=await _0x50a920[_0x413b7a(0xa0)]([{'type':_0x537e4f['wuelv'],'name':_0x413b7a(0xb1),'message':'Where\x20should\x20skills\x20be\x20installed?','choices':[{'name':_0x413b7a(0x98)+_0x5d62db+')','value':_0x413b7a(0xa3)},{'name':'This\x20project\x20only\x20('+_0x45af4d+')','value':_0x413b7a(0xac)}]}]);_0x2162d8=_0x14d55c[_0x413b7a(0xb1)];}else _0x2162d8='project',console['log']('Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20('+_0x45af4d+')');}let _0x4280be=0x0;const _0x2b221d=_0x537e4f['gxAaq'](getCurrentVersion);console[_0x413b7a(0xba)]('\x0a📦\x20Installing\x20skills...\x0a');try{const _0x47043c=await installSkill(_0x413b7a(0x95),{'cliVersion':_0x2b221d,'level':_0x2162d8,'platform':_0x281c43});_0x47043c&&_0x4280be++;}catch(_0x4c41a8){console['warn'](_0x413b7a(0x93),_0x537e4f['FBbwm'](_0x4c41a8,Error)?_0x4c41a8['message']:_0x4c41a8);}if(_0x4280be>0x0){const _0x363b21=_0x537e4f['vdzxR'](_0x2162d8,_0x537e4f['oyXLM'])?_0x537e4f[_0x413b7a(0xb5)]:_0x537e4f[_0x413b7a(0x99)];console[_0x413b7a(0xba)]('\x0a✅\x20Installed\x20'+_0x4280be+'\x20'+_0x363b21+'\x20skill'+(_0x537e4f[_0x413b7a(0xbd)](_0x4280be,0x1)?'s':'')+_0x413b7a(0xab)),!_0x5edfe7[_0x413b7a(0xaf)]&&(console[_0x413b7a(0xba)](_0x537e4f[_0x413b7a(0xbb)]),_0x537e4f[_0x413b7a(0xad)](_0x281c43,_0x413b7a(0x9c))?console['log'](_0x537e4f['ZJJBS']):console['log'](_0x413b7a(0xaa)));}else console['log'](_0x537e4f['yJXyB']);}
|
package/build/commands/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x5941bc=_0x8386;(function(_0x883480,_0x28dfe1){const _0x2359bd=_0x8386,_0x21b95d=_0x883480();while(!![]){try{const _0x1737ab=parseInt(_0x2359bd(0x15a))/0x1+parseInt(_0x2359bd(0x153))/0x2+-parseInt(_0x2359bd(0x140))/0x3+-parseInt(_0x2359bd(0x157))/0x4*(-parseInt(_0x2359bd(0x14d))/0x5)+parseInt(_0x2359bd(0x12f))/0x6+-parseInt(_0x2359bd(0x16d))/0x7*(parseInt(_0x2359bd(0x145))/0x8)+-parseInt(_0x2359bd(0x121))/0x9;if(_0x1737ab===_0x28dfe1)break;else _0x21b95d['push'](_0x21b95d['shift']());}catch(_0x1ec036){_0x21b95d['push'](_0x21b95d['shift']());}}}(_0x1cd0,0x88336));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';function _0x8386(_0x3ea0b9,_0x4c8ba7){_0x3ea0b9=_0x3ea0b9-0x11a;const _0x1cd0f8=_0x1cd0();let _0x83860b=_0x1cd0f8[_0x3ea0b9];return _0x83860b;}import _0x1be0a5 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';function _0x1cd0(){const _0x724e94=['profile','jHTIF','Authentication\x20failed:\x20','XDiUh','inherit','plugin','stdout','local','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','ViNLL','opencode','ranger\x20profile\x20add\x20local','ugwId','SCLOZ','\x20(fallback\x20version)','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','3117585srWCfY','organizationName','success','isTTY','hIgKf','400HEDykG','ready','version','You\x20can\x20install\x20it\x20manually\x20by\x20running:','\x20now?','iIBjC','WYPVO','.gitignore','216635yHAzey','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','FBgiC','allowInsecureLocalhost','geRNu','\x0a⚠\x20Skipping\x20Chromium\x20installation.','1002428fWQoaX','chromium','close','\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','60ZBQgWi','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','warn','1051715MjZZqU','CujwL','log','skills','Validating\x20API\x20token...','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','oeNKQ','GVSaG','\x0a🚀\x20Ranger\x20Setup\x0a','install','skipChromium','Vfawd','message','EhvNd','user','✓\x20Created\x20.ranger/.gitignore','resolve','error','HCIgs','35644AENuIG','CEGKx','HAbYz','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','skipped','auth','git_check','YchSe','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','✓\x20Local\x20profile\x20already\x20exists','You\x27ll\x20need\x20the\x20app\x20to\x20be\x20running\x20to\x20set\x20up\x20the\x20profile.','No\x20git\x20repository\x20found.\x20Please\x20run\x20`ranger\x20setup`\x20from\x20inside\x20your\x20project\x20directory.','VFGYX','cWFJq','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','playwright@','url','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','dZCSM','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','FixYa','cXcCY','executablePath','kKqBq','scope','Make\x20sure\x20your\x20app\x20is\x20running\x20before\x20you\x20start.\x0a','confirm','DIXQA','\x1b[0m','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','\x20\x20npx\x20playwright@','\x0a✅\x20You\x27re\x20ready\x20to\x20start\x20using\x20Ranger\x20Feature\x20Review.','wuHOk','ihmgV','prompt','trackPhaseEnd','✓\x20Authenticated\x20to\x20','bOHih','GUYnT','4491639uQCFUQ','⚠\x20No\x20git\x20repository\x20found.\x20Run\x20`ranger\x20profile\x20add\x20local`\x20from\x20your\x20project\x20directory.','trackPhaseStart','AOCyk','ayAkT','\x20install\x20chromium','gvnMd','EmIin','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','method','✓\x20Stored\x20credentials\x20locally','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','ynHsy','Wrccb','887460lAYMkq'];_0x1cd0=function(){return _0x724e94;};return _0x1cd0();}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),PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.58.2',bold=_0x61de39=>'\x1b[1m'+_0x61de39+_0x5941bc(0x189);function getPlaywrightVersion(){const _0x5176b8=_0x5941bc,_0x2bb234={'DIXQA':'playwright/package.json'};try{const _0x5683d3=require[_0x5176b8(0x16a)](_0x2bb234[_0x5176b8(0x188)]),_0x367741=require(_0x5683d3);return _0x367741[_0x5176b8(0x147)];}catch{return null;}}function installChromiumBinary(_0x416795){const _0x54adde=_0x5941bc,_0xda22a5={'ynHsy':function(_0x521f3b,_0x29f181){return _0x521f3b(_0x29f181);},'pebgK':'install','oeNKQ':'chromium','ZGZlk':'npx','kzjJL':function(_0x20046f,_0x29b4b4){return _0x20046f===_0x29b4b4;},'YCGRc':_0x54adde(0x155),'qLSwq':'error'};return new Promise((_0x2649dd,_0x1ab4b3)=>{const _0xd7259a=_0x54adde,_0x3235ab={'GUYnT':function(_0x4dad66,_0x25d76b){const _0x2ee8e7=_0x8386;return _0xda22a5[_0x2ee8e7(0x12d)](_0x4dad66,_0x25d76b);}},_0x49633d=[_0xd7259a(0x17c)+_0x416795,_0xda22a5['pebgK'],_0xda22a5[_0xd7259a(0x160)]],_0xd00246=spawn(_0xda22a5['ZGZlk'],_0x49633d,{'stdio':['ignore',_0xd7259a(0x134),_0xd7259a(0x134)],'shell':_0xda22a5['kzjJL'](process['platform'],'win32')});_0xd00246['on'](_0xda22a5['YCGRc'],_0x425c2c=>{const _0x5e06dc=_0xd7259a;_0x425c2c===0x0?_0x2649dd():_0x3235ab[_0x5e06dc(0x120)](_0x1ab4b3,new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x425c2c));}),_0xd00246['on'](_0xda22a5['qLSwq'],_0x59787a=>{_0x3235ab['GUYnT'](_0x1ab4b3,_0x59787a);});});}export async function authenticate(_0x27b3a1){const _0x5f1354=_0x5941bc,_0x571e6a={'XDiUh':function(_0x47ad77){return _0x47ad77();},'SCLOZ':'existing_token','VMhzU':_0x5f1354(0x15e),'EhvNd':'provided_token'};if(!_0x27b3a1){const _0x2baa36=await _0x571e6a[_0x5f1354(0x133)](getToken);if(_0x2baa36){const _0x480958=await getCurrentUser(_0x2baa36);if(_0x480958[_0x5f1354(0x142)])return console[_0x5f1354(0x15c)]('✓\x20Already\x20authenticated\x20to\x20'+_0x480958['user'][_0x5f1354(0x141)]),{'token':_0x2baa36,'method':_0x571e6a[_0x5f1354(0x13d)]};}try{_0x27b3a1=await runDeviceAuthFlow();}catch(_0x3d7134){throw new Error(_0x5f1354(0x132)+(_0x3d7134 instanceof Error?_0x3d7134[_0x5f1354(0x166)]:_0x3d7134));}const _0x488e3d=await getCurrentUser(_0x27b3a1);if(!_0x488e3d[_0x5f1354(0x142)])throw new Error(_0x5f1354(0x175)+_0x488e3d['error']);return console['log'](_0x5f1354(0x11e)+_0x488e3d['user']['organizationName']),{'token':_0x27b3a1,'method':'device_auth'};}console['log'](_0x571e6a['VMhzU']);const _0x47b9fb=await getCurrentUser(_0x27b3a1);if(!_0x47b9fb[_0x5f1354(0x142)]){if(_0x47b9fb['status'])throw new Error('Authentication\x20failed:\x20'+_0x47b9fb[_0x5f1354(0x16b)]+_0x5f1354(0x14e));else throw new Error(_0x5f1354(0x170)+_0x47b9fb['error']+_0x5f1354(0x13f));}return console[_0x5f1354(0x15c)](_0x5f1354(0x11e)+_0x47b9fb[_0x5f1354(0x168)][_0x5f1354(0x141)]),await storeToken(_0x27b3a1),console['log'](process['env']['GITHUB_ENV']?'✓\x20Exported\x20credentials\x20for\x20CI':_0x5f1354(0x12b)),{'token':_0x27b3a1,'method':_0x571e6a[_0x5f1354(0x167)]};}export async function ensureRangerDir(){const _0x34e56b=_0x5941bc,_0xe0105c={'HAbYz':function(_0x1a0f92){return _0x1a0f92();},'CEGKx':function(_0x2e2dec,_0x183882,_0x1edace){return _0x2e2dec(_0x183882,_0x1edace);},'geRNu':'.ranger'},_0x3e31d4=_0xe0105c[_0x34e56b(0x16f)](findGitRoot),_0x1dff0c=_0x3e31d4?_0xe0105c['CEGKx'](join,_0x3e31d4,_0xe0105c[_0x34e56b(0x151)]):_0xe0105c[_0x34e56b(0x16f)](getRangerDir);return!existsSync(_0x1dff0c)?(await _0xe0105c[_0x34e56b(0x16e)](mkdir,_0x1dff0c,{'recursive':!![]}),console[_0x34e56b(0x15c)]('✓\x20Created\x20.ranger/\x20directory'),{'path':_0x1dff0c,'installed':!![]}):(console[_0x34e56b(0x15c)]('✓\x20.ranger/\x20directory\x20already\x20exists'),{'path':_0x1dff0c,'installed':![]});}export async function ensureChromium(){const _0x7f803f=_0x5941bc,_0x57855a={'Vfawd':function(_0x45b1cd,_0x1c8278){return _0x45b1cd(_0x1c8278);},'IAmfJ':'✓\x20Playwright\x20Chromium\x20browser\x20found','bOHih':function(_0x4e730d,_0x3d8530){return _0x4e730d??_0x3d8530;},'gvnMd':'confirm','otwGG':_0x7f803f(0x163),'kYjvx':function(_0xd74672,_0x294492){return _0xd74672(_0x294492);},'ihmgV':_0x7f803f(0x15f),'cWFJq':_0x7f803f(0x18a),'YZQvi':_0x7f803f(0x152),'CujwL':_0x7f803f(0x17b)};let _0x9cded4=![];try{const _0x132ff4=chromium[_0x7f803f(0x183)]();_0x9cded4=_0x57855a[_0x7f803f(0x165)](existsSync,_0x132ff4);}catch{_0x9cded4=![];}if(_0x9cded4)return console['log'](_0x57855a['IAmfJ']),![];const _0xe6547c=getPlaywrightVersion(),_0x12da67=_0x57855a[_0x7f803f(0x11f)](_0xe6547c,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x429ace=!_0xe6547c,_0x2ca446=process['stdin'][_0x7f803f(0x143)]&&process[_0x7f803f(0x136)]['isTTY'];let _0x3e26c2=!![];if(_0x2ca446){const {install:_0x51f78d}=await _0x1be0a5[_0x7f803f(0x11c)]([{'type':_0x57855a[_0x7f803f(0x127)],'name':_0x57855a['otwGG'],'message':_0x429ace?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x12da67+_0x7f803f(0x149):'The\x20required\x20version\x20('+_0x12da67+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x3e26c2=_0x51f78d;}else console[_0x7f803f(0x15c)](_0x7f803f(0x180)+_0x12da67+(_0x429ace?_0x7f803f(0x13e):'')+'...');if(_0x3e26c2){console['log']('\x0aInstalling\x20Chromium\x20browser...\x0a');try{await _0x57855a['kYjvx'](installChromiumBinary,_0x12da67),console[_0x7f803f(0x15c)](_0x57855a[_0x7f803f(0x11b)]);}catch(_0x50b40b){console['error'](_0x57855a[_0x7f803f(0x17a)],_0x50b40b instanceof Error?_0x50b40b['message']:_0x50b40b),console[_0x7f803f(0x15c)](_0x7f803f(0x148)),console[_0x7f803f(0x15c)](_0x7f803f(0x18c)+_0x12da67+_0x7f803f(0x126));}}else console[_0x7f803f(0x15c)](_0x57855a['YZQvi']),console['log'](_0x57855a[_0x7f803f(0x15b)]),console['log'](_0x7f803f(0x18c)+_0x12da67+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x3a6d09){const _0x5c6044=_0x5941bc,_0x231c98={'ULTjO':_0x5c6044(0x169)},_0x550d11=join(_0x3a6d09,_0x5c6044(0x14c)),_0x7e5253=_0x5c6044(0x156);await writeFile(_0x550d11,_0x7e5253),console[_0x5c6044(0x15c)](_0x231c98['ULTjO']);}function printProfileSetupLaterInstructions(){const _0x4102fb=_0x5941bc,_0x2991bf={'FBgiC':function(_0xb95655,_0x478c36){return _0xb95655(_0x478c36);},'ayAkT':'ranger\x20profile\x20add\x20local','EpFnz':_0x4102fb(0x186)};console['log']('\x0aIn\x20order\x20for\x20Ranger\x20to\x20verify\x20your\x20work,\x20you\x27ll\x20need\x20to\x20set\x20up\x20a\x20profile\x20later\x20with:'),console[_0x4102fb(0x15c)]('\x20\x20'+_0x2991bf[_0x4102fb(0x14f)](bold,_0x2991bf[_0x4102fb(0x125)])),console[_0x4102fb(0x15c)](_0x2991bf['EpFnz']);}async function ensureLocalEnv(_0xb90b8e,_0x483afa){const _0x315928=_0x5941bc,_0x12d917={'jVRqx':_0x315928(0x137),'jHTIF':'\x0aA\x20profile\x20gives\x20Ranger\x27s\x20browser\x20agent\x20information\x20about\x20how','YchSe':'to\x20access\x20your\x20app.\x20If\x20the\x20part\x20of\x20your\x20app\x20you\x20want\x20to\x20test\x20is\x20behind','cXcCY':'use\x20until\x20the\x20session\x20expires.\x0a','nQrMM':_0x315928(0x177),'AOCyk':_0x315928(0x187),'UDvii':'wantsProfile','EhkYB':'Would\x20you\x20like\x20to\x20set\x20up\x20the\x20profile\x20now?','kKqBq':function(_0x3f468e){return _0x3f468e();},'XdZlA':function(_0x546d40,_0x220957){return _0x546d40 instanceof _0x220957;}};if(!findGitRoot())return console[_0x315928(0x15c)](_0x315928(0x122)),{'ready':![],'skipped':!![]};if(findExistingEnv(_0x12d917['jVRqx'],{'locations':[_0x315928(0x137)]}))return console[_0x315928(0x15c)](_0x315928(0x176)),{'ready':!![],'skipped':![]};const _0x193239=process['stdin']['isTTY']&&process[_0x315928(0x136)]['isTTY'];if(_0x193239&&!_0xb90b8e?.['url']){console[_0x315928(0x15c)](_0x12d917[_0x315928(0x131)]),console[_0x315928(0x15c)](_0x12d917[_0x315928(0x174)]),console['log']('auth,\x20you\x20can\x20log\x20in\x20and\x20we\x27ll\x20save\x20the\x20session\x20state\x20for\x20Ranger\x20to'),console[_0x315928(0x15c)](_0x12d917[_0x315928(0x182)]),console['log'](_0x12d917['nQrMM']);const {wantsProfile:_0x19e178}=await _0x1be0a5[_0x315928(0x11c)]([{'type':_0x12d917[_0x315928(0x124)],'name':_0x12d917['UDvii'],'message':_0x12d917['EhkYB'],'default':!![]}]);if(!_0x19e178)return _0x12d917[_0x315928(0x184)](printProfileSetupLaterInstructions),{'ready':![],'skipped':!![]};}try{return await addEnv(_0x12d917['jVRqx'],{'url':_0xb90b8e?.['url'],'force':_0xb90b8e?.['force'],'allowInsecureLocalhost':_0xb90b8e?.[_0x315928(0x150)]},_0x483afa),{'ready':!![],'skipped':![]};}catch(_0x416179){return console['error']('\x0a❌\x20Profile\x20setup\x20failed:',_0x12d917['XdZlA'](_0x416179,Error)?_0x416179[_0x315928(0x166)]:_0x416179),_0x12d917['kKqBq'](printProfileSetupLaterInstructions),{'ready':![],'skipped':![]};}}export async function start(_0x2f50dc,_0x12bfc1,_0x535b18){const _0x4e9117=_0x5941bc,_0x5b9a82={'VFGYX':function(_0x1f04ff){return _0x1f04ff();},'wuHOk':'No\x20git\x20repository\x20found','OAsYL':_0x4e9117(0x178),'iIBjC':_0x4e9117(0x173),'Snceu':function(_0x26a50f){return _0x26a50f();},'hIgKf':_0x4e9117(0x172),'Wrccb':_0x4e9117(0x154),'HCIgs':function(_0x29ee9,_0x415526){return _0x29ee9(_0x415526);},'fitdq':'\x0a✅\x20Ranger\x20setup\x20complete!\x0a','WYPVO':_0x4e9117(0x135),'GVSaG':function(_0x5e99f5,_0x5e3220){return _0x5e99f5(_0x5e3220);},'yKCPj':'ranger','ILVTM':_0x4e9117(0x13a),'ugwId':_0x4e9117(0x158),'HzUbQ':function(_0x41ad92,_0x211b1b){return _0x41ad92 instanceof _0x211b1b;},'ViNLL':_0x4e9117(0x15d),'fvDup':function(_0x5410b4,_0x5dd21e,_0x1045b4){return _0x5410b4(_0x5dd21e,_0x1045b4);},'LfYmC':'\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','dZCSM':_0x4e9117(0x12c),'EmIin':'/ranger:enable','FixYa':function(_0x18d841,_0x42e2f7){return _0x18d841+_0x42e2f7;}};console['log'](_0x4e9117(0x162));const _0x434d59=process['stdin'][_0x4e9117(0x143)]&&process[_0x4e9117(0x136)][_0x4e9117(0x143)];!_0x434d59&&!_0x12bfc1?.[_0x4e9117(0x185)]&&(console['log']('Non-interactive\x20mode:\x20No\x20--scope\x20provided,\x20defaulting\x20to\x20user.'),_0x12bfc1={..._0x12bfc1,'scope':'user'});_0x535b18?.[_0x4e9117(0x123)]('git_check');if(!_0x5b9a82[_0x4e9117(0x179)](findGitRoot)){await _0x535b18?.['trackPhaseError'](_0x4e9117(0x173),new Error(_0x5b9a82[_0x4e9117(0x11a)]));throw new Error(_0x5b9a82['OAsYL']);}_0x535b18?.[_0x4e9117(0x11d)](_0x5b9a82[_0x4e9117(0x14a)]);const _0x54872b=!existsSync(_0x5b9a82['Snceu'](getRangerDir)),{path:_0x1d9695}=await _0x5b9a82['VFGYX'](ensureRangerDir);_0x535b18?.[_0x4e9117(0x123)](_0x5b9a82[_0x4e9117(0x144)]);const _0x287fe5=await authenticate(_0x2f50dc);_0x535b18?.[_0x4e9117(0x11d)](_0x5b9a82[_0x4e9117(0x144)],{'isFirstRun':_0x54872b,'method':_0x287fe5[_0x4e9117(0x12a)]}),_0x535b18?.[_0x4e9117(0x123)](_0x5b9a82[_0x4e9117(0x12e)]);_0x12bfc1?.[_0x4e9117(0x164)]?console[_0x4e9117(0x15c)](_0x4e9117(0x129)):await _0x5b9a82['Snceu'](ensureChromium);_0x535b18?.['trackPhaseEnd'](_0x5b9a82[_0x4e9117(0x12e)],{'isFirstRun':_0x54872b,'skipped':!!_0x12bfc1?.[_0x4e9117(0x164)]}),await _0x5b9a82[_0x4e9117(0x16c)](writeRangerGitignore,_0x1d9695),console[_0x4e9117(0x15c)](_0x5b9a82['fitdq']);const _0x7d5d6b=_0x12bfc1?.['scope'],_0x25bff7=_0x12bfc1?.['opencode']??![];let _0xd7927b=null;_0x25bff7?(_0x535b18?.['trackPhaseStart']('plugin'),_0xd7927b=await ensureOpencodePluginConfig(_0x7d5d6b),_0x535b18?.['trackPhaseEnd'](_0x5b9a82['WYPVO'],{'isFirstRun':_0x54872b,'opencode':!![]})):(_0x535b18?.['trackPhaseStart']('plugin'),await _0x5b9a82[_0x4e9117(0x161)](ensureClaudePlugin,_0x7d5d6b),_0x535b18?.['trackPhaseEnd'](_0x5b9a82[_0x4e9117(0x14b)],{'isFirstRun':_0x54872b}));if(_0x25bff7&&_0xd7927b){_0x535b18?.['trackPhaseStart'](_0x4e9117(0x15d));try{await installSkill(_0x5b9a82['yKCPj'],{'level':_0xd7927b[_0x4e9117(0x185)],'cliVersion':getCurrentVersion(),'platform':_0x5b9a82['ILVTM']}),_0x535b18?.[_0x4e9117(0x11d)](_0x4e9117(0x15d),{'isFirstRun':_0x54872b,'opencode':!![]});}catch(_0x3bcea9){console[_0x4e9117(0x159)](_0x5b9a82[_0x4e9117(0x13c)],_0x5b9a82['HzUbQ'](_0x3bcea9,Error)?_0x3bcea9['message']:_0x3bcea9),_0x535b18?.['trackPhaseEnd'](_0x5b9a82['ViNLL'],{'isFirstRun':_0x54872b,'opencode':!![],'failed':!![]});}}else _0x535b18?.[_0x4e9117(0x123)]('skills'),await ensureClaudeSkills(_0x7d5d6b),_0x535b18?.['trackPhaseEnd'](_0x5b9a82[_0x4e9117(0x139)],{'isFirstRun':_0x54872b});if(!_0x434d59&&!_0x12bfc1?.[_0x4e9117(0x17d)])console[_0x4e9117(0x15c)]('Non-interactive\x20mode:\x20Skipping\x20profile\x20setup.\x20To\x20set\x20up\x20a\x20profile,\x20pass\x20--url\x20or\x20run\x20later:'),console[_0x4e9117(0x15c)]('\x20\x20'+_0x5b9a82['GVSaG'](bold,_0x4e9117(0x13b))+'\x0a');else{_0x535b18?.['trackPhaseStart'](_0x4e9117(0x130));const _0x226402=await _0x5b9a82['fvDup'](ensureLocalEnv,{'url':_0x12bfc1?.[_0x4e9117(0x17d)],'force':_0x12bfc1?.['force'],'allowInsecureLocalhost':_0x12bfc1?.['allowInsecureLocalhost']},_0x535b18);_0x535b18?.['trackPhaseEnd']('profile',{'isFirstRun':_0x54872b,'profileReady':_0x226402[_0x4e9117(0x146)],'userSkipped':_0x226402[_0x4e9117(0x171)]}),_0x226402[_0x4e9117(0x146)]&&console['log'](_0x4e9117(0x18d));}if(_0x25bff7)console[_0x4e9117(0x15c)](_0x5b9a82['LfYmC']),console[_0x4e9117(0x15c)](_0x5b9a82[_0x4e9117(0x17f)]),console[_0x4e9117(0x15c)]('with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'),console[_0x4e9117(0x15c)](_0x4e9117(0x17e));else{const _0x470631=_0x5b9a82[_0x4e9117(0x161)](bold,_0x5b9a82[_0x4e9117(0x128)]);console['log'](_0x5b9a82[_0x4e9117(0x181)]('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x470631+'\x20and\x20prompt\x20the\x20coding'+_0x4e9117(0x138),'\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser')+_0x4e9117(0x18b));}}
|
|
1
|
+
const _0x10aece=_0x24ee;(function(_0xf7b8b5,_0x3205cb){const _0x395f66=_0x24ee,_0xfd850c=_0xf7b8b5();while(!![]){try{const _0x4f7bd3=parseInt(_0x395f66(0xd4))/0x1*(-parseInt(_0x395f66(0xc1))/0x2)+parseInt(_0x395f66(0x80))/0x3*(parseInt(_0x395f66(0xd6))/0x4)+-parseInt(_0x395f66(0xd0))/0x5+parseInt(_0x395f66(0xa7))/0x6+-parseInt(_0x395f66(0xa1))/0x7+parseInt(_0x395f66(0x84))/0x8+parseInt(_0x395f66(0x91))/0x9*(parseInt(_0x395f66(0x9a))/0xa);if(_0x4f7bd3===_0x3205cb)break;else _0xfd850c['push'](_0xfd850c['shift']());}catch(_0xcd1340){_0xfd850c['push'](_0xfd850c['shift']());}}}(_0x5341,0x7f2c0));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x38a749 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerDir,getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';function _0x5341(){const _0xa87ff5=['cJVXz','ranger','\x0aInstalling\x20Chromium\x20browser...\x0a','6879992WBdWpp','profile','trackPhaseStart','\x0a⚠\x20Skipping\x20Chromium\x20installation.','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','hYSCv','✓\x20.ranger/\x20directory\x20already\x20exists','playwright@','Installation\x20failed\x20with\x20exit\x20code\x20','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','provided_token','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','27UUuFWQ','Authentication\x20failed:\x20','Non-interactive\x20mode:\x20No\x20--scope\x20provided,\x20defaulting\x20to\x20user.','HWFIq','isTTY','\x20and\x20prompt\x20the\x20coding','bntdg','GITHUB_ENV','existing_token','934930apMfuD','log','hPMWj','No\x20git\x20repository\x20found.\x20Please\x20run\x20`ranger\x20setup`\x20from\x20inside\x20your\x20project\x20directory.','skipChromium','RbVtf','message','2049019mSPxQP','\x0a❌\x20Profile\x20setup\x20failed:','executablePath','auth','url','brwtk','1896114bUmvUR','win32','close','chromium','✓\x20Already\x20authenticated\x20to\x20','method','\x0aA\x20profile\x20gives\x20Ranger\x27s\x20browser\x20agent\x20information\x20about\x20how','playwright/package.json','inherit','allowInsecureLocalhost','JZYgZ','No\x20git\x20repository\x20found','ignore','.ranger','ready','OyuJO','success','error','cmXms','trackPhaseEnd','YEZrC','user','skills','NVqUU','confirm','ljLCE','1012iVNKcC','stdout','SzAfI','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','djEJP','xOKRW','\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','CHAiz','✓\x20Created\x20.ranger/.gitignore','ZdWcY','version','use\x20until\x20the\x20session\x20expires.\x0a','✓\x20Stored\x20credentials\x20locally','ELelV','\x0a🚀\x20Ranger\x20Setup\x0a','1419865bikRON','plugin','cOCBK','You\x20can\x20install\x20it\x20manually\x20by\x20running:','947uxmpvY','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','4FWgXwe','\x20\x20npx\x20playwright@','\x0aIn\x20order\x20for\x20Ranger\x20to\x20verify\x20your\x20work,\x20you\x27ll\x20need\x20to\x20set\x20up\x20a\x20profile\x20later\x20with:','eyWUg','status','Make\x20sure\x20your\x20app\x20is\x20running\x20before\x20you\x20start.\x0a','UUGBt','oUQov','pEUQr','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','✓\x20Local\x20profile\x20already\x20exists','zCWLc','zCyDf','warn','install','gSXEi','jMfgP','The\x20required\x20version\x20(','ZzfIQ','local','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','oMeEQ','TLVLe','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','You\x27ll\x20need\x20the\x20app\x20to\x20be\x20running\x20to\x20set\x20up\x20the\x20profile.','LgiJc','EITag','skipped','hykrS','ezKnX','WeTbF','git_check','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','1.58.2','Would\x20you\x20like\x20to\x20set\x20up\x20the\x20profile\x20now?','scope','stdin','JGoVF','KqVcb','wantsProfile','\x1b[0m','360813gAxahG'];_0x5341=function(){return _0xa87ff5;};return _0x5341();}import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';function _0x24ee(_0x355b7d,_0x4cfc65){_0x355b7d=_0x355b7d-0x71;const _0x534162=_0x5341();let _0x24eeb2=_0x534162[_0x355b7d];return _0x24eeb2;}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),PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION=_0x10aece(0x78),bold=_0x47820c=>'\x1b[1m'+_0x47820c+_0x10aece(0x7f);function getPlaywrightVersion(){const _0x4434c3=_0x10aece,_0xfed89={'yZdZH':function(_0x2c6a86,_0x2c4a74){return _0x2c6a86(_0x2c4a74);}};try{const _0x21e43a=require['resolve'](_0x4434c3(0xae)),_0x56a04c=_0xfed89['yZdZH'](require,_0x21e43a);return _0x56a04c[_0x4434c3(0xcb)];}catch{return null;}}function installChromiumBinary(_0xaaf711){const _0x5d482f=_0x10aece,_0x5f1cb9={'wsmNo':_0x5d482f(0xe4),'tXShJ':_0x5d482f(0xb3),'BXugH':'inherit','zCWLc':function(_0x2ccfd3,_0xb8b850){return _0x2ccfd3===_0xb8b850;},'cmXms':_0x5d482f(0xa8),'KGypv':_0x5d482f(0xa9)};return new Promise((_0x46b3f3,_0x2ff9db)=>{const _0x5ae6ba=_0x5d482f,_0x420d28={'rEjHj':function(_0x47cc5d,_0x46f370){return _0x47cc5d===_0x46f370;}},_0x541149=[_0x5ae6ba(0x8c)+_0xaaf711,_0x5f1cb9['wsmNo'],_0x5ae6ba(0xaa)],_0x597219=spawn('npx',_0x541149,{'stdio':[_0x5f1cb9['tXShJ'],_0x5ae6ba(0xaf),_0x5f1cb9['BXugH']],'shell':_0x5f1cb9[_0x5ae6ba(0xe1)](process['platform'],_0x5f1cb9[_0x5ae6ba(0xb9)])});_0x597219['on'](_0x5f1cb9['KGypv'],_0x52fb09=>{const _0x4d02f0=_0x5ae6ba;_0x420d28['rEjHj'](_0x52fb09,0x0)?_0x46b3f3():_0x2ff9db(new Error(_0x4d02f0(0x8d)+_0x52fb09));}),_0x597219['on'](_0x5ae6ba(0xb8),_0xca4ed3=>{_0x2ff9db(_0xca4ed3);});});}export async function authenticate(_0x1dc7b4){const _0x2526f2=_0x10aece,_0x2c9069={'jMfgP':function(_0x5ab3aa){return _0x5ab3aa();},'YEZrC':_0x2526f2(0x99),'anmmg':'device_auth','VTYMp':'Validating\x20API\x20token...','ljLCE':function(_0x45fe3c,_0x2bccd0){return _0x45fe3c(_0x2bccd0);},'JGoVF':_0x2526f2(0xcd)};if(!_0x1dc7b4){const _0x2cf56d=await _0x2c9069['jMfgP'](getToken);if(_0x2cf56d){const _0x4fa7e6=await getCurrentUser(_0x2cf56d);if(_0x4fa7e6[_0x2526f2(0xb7)])return console['log'](_0x2526f2(0xab)+_0x4fa7e6[_0x2526f2(0xbc)]['organizationName']),{'token':_0x2cf56d,'method':_0x2c9069[_0x2526f2(0xbb)]};}try{_0x1dc7b4=await _0x2c9069[_0x2526f2(0xe6)](runDeviceAuthFlow);}catch(_0x235d06){throw new Error(_0x2526f2(0x92)+(_0x235d06 instanceof Error?_0x235d06['message']:_0x235d06));}const _0x23ae6a=await getCurrentUser(_0x1dc7b4);if(!_0x23ae6a['success'])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x23ae6a['error']);return console[_0x2526f2(0x9b)]('✓\x20Authenticated\x20to\x20'+_0x23ae6a['user']['organizationName']),{'token':_0x1dc7b4,'method':_0x2c9069['anmmg']};}console['log'](_0x2c9069['VTYMp']);const _0x413646=await _0x2c9069[_0x2526f2(0xc0)](getCurrentUser,_0x1dc7b4);if(!_0x413646['success']){if(_0x413646[_0x2526f2(0xda)])throw new Error(_0x2526f2(0x92)+_0x413646[_0x2526f2(0xb8)]+_0x2526f2(0x77));else throw new Error(_0x2526f2(0x8e)+_0x413646[_0x2526f2(0xb8)]+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console[_0x2526f2(0x9b)]('✓\x20Authenticated\x20to\x20'+_0x413646[_0x2526f2(0xbc)]['organizationName']),await storeToken(_0x1dc7b4),console['log'](process['env'][_0x2526f2(0x98)]?'✓\x20Exported\x20credentials\x20for\x20CI':_0x2c9069[_0x2526f2(0x7c)]),{'token':_0x1dc7b4,'method':_0x2526f2(0x8f)};}export async function ensureRangerDir(_0x4413ec){const _0x3dcd1c=_0x10aece,_0x1ce536={'hykrS':function(_0x1a2890){return _0x1a2890();},'HSUkV':function(_0x558909,_0x27420a,_0x356886){return _0x558909(_0x27420a,_0x356886);},'UUGBt':_0x3dcd1c(0xb4),'NVqUU':function(_0x2a31df){return _0x2a31df();},'npRRA':function(_0x96691e,_0x5d3dec){return _0x96691e(_0x5d3dec);},'spaJE':'✓\x20Created\x20.ranger/\x20directory'};let _0x35904f;if(_0x4413ec==='user')_0x35904f=_0x1ce536[_0x3dcd1c(0x73)](getRangerHomeDir);else{const _0x1e0c60=findGitRoot();_0x35904f=_0x1e0c60?_0x1ce536['HSUkV'](join,_0x1e0c60,_0x1ce536[_0x3dcd1c(0xdc)]):_0x1ce536[_0x3dcd1c(0xbe)](getRangerDir);}return!_0x1ce536['npRRA'](existsSync,_0x35904f)?(await _0x1ce536['HSUkV'](mkdir,_0x35904f,{'recursive':!![]}),console['log'](_0x1ce536['spaJE']),{'path':_0x35904f,'installed':!![]}):(console[_0x3dcd1c(0x9b)](_0x3dcd1c(0x8b)),{'path':_0x35904f,'installed':![]});}export async function ensureChromium(){const _0x459e46=_0x10aece,_0x34530c={'HWFIq':function(_0x468a36,_0x1fa6cb){return _0x468a36(_0x1fa6cb);},'djEJP':'✓\x20Playwright\x20Chromium\x20browser\x20found','hYSCv':function(_0x3077f6){return _0x3077f6();},'pEUQr':function(_0x5d0fb0,_0x42a941){return _0x5d0fb0??_0x42a941;},'eyWUg':_0x459e46(0xbf),'hPMWj':'\x20(fallback\x20version)','dUrJf':'\x0a❌\x20Failed\x20to\x20install\x20Chromium:','SzAfI':_0x459e46(0x87)};let _0x3197ea=![];try{const _0x3176e4=chromium[_0x459e46(0xa3)]();_0x3197ea=_0x34530c[_0x459e46(0x94)](existsSync,_0x3176e4);}catch{_0x3197ea=![];}if(_0x3197ea)return console['log'](_0x34530c[_0x459e46(0xc5)]),![];const _0xff5cdc=_0x34530c[_0x459e46(0x8a)](getPlaywrightVersion),_0x3ae817=_0x34530c[_0x459e46(0xde)](_0xff5cdc,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x579a50=!_0xff5cdc,_0x413309=process['stdin'][_0x459e46(0x95)]&&process[_0x459e46(0xc2)][_0x459e46(0x95)];let _0x419625=!![];if(_0x413309){const {install:_0x351685}=await _0x38a749['prompt']([{'type':_0x34530c[_0x459e46(0xd9)],'name':'install','message':_0x579a50?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x3ae817+'\x20now?':_0x459e46(0xe7)+_0x3ae817+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x419625=_0x351685;}else console[_0x459e46(0x9b)]('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x3ae817+(_0x579a50?_0x34530c[_0x459e46(0x9c)]:'')+'...');if(_0x419625){console[_0x459e46(0x9b)](_0x459e46(0x83));try{await _0x34530c[_0x459e46(0x94)](installChromiumBinary,_0x3ae817),console['log'](_0x459e46(0xd5));}catch(_0x188406){console[_0x459e46(0xb8)](_0x34530c['dUrJf'],_0x188406 instanceof Error?_0x188406['message']:_0x188406),console['log'](_0x459e46(0xd3)),console['log'](_0x459e46(0xd7)+_0x3ae817+'\x20install\x20chromium');}}else console[_0x459e46(0x9b)](_0x34530c[_0x459e46(0xc3)]),console[_0x459e46(0x9b)](_0x459e46(0x88)),console[_0x459e46(0x9b)](_0x459e46(0xd7)+_0x3ae817+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x45cde7){const _0x4e1ead=_0x10aece,_0x471d0b={'zCyDf':function(_0x4f9814,_0x32fcc4,_0x2d972b){return _0x4f9814(_0x32fcc4,_0x2d972b);},'EITag':'.gitignore','KivUq':_0x4e1ead(0xc9)},_0x2caed9=_0x471d0b['zCyDf'](join,_0x45cde7,_0x471d0b[_0x4e1ead(0x71)]),_0x463a9b=_0x4e1ead(0xc7);await _0x471d0b[_0x4e1ead(0xe2)](writeFile,_0x2caed9,_0x463a9b),console[_0x4e1ead(0x9b)](_0x471d0b['KivUq']);}function printProfileSetupLaterInstructions(){const _0x48b368=_0x10aece;console[_0x48b368(0x9b)](_0x48b368(0xd8)),console[_0x48b368(0x9b)]('\x20\x20'+bold('ranger\x20profile\x20add\x20local')),console[_0x48b368(0x9b)](_0x48b368(0xdb));}async function ensureLocalEnv(_0x30e164,_0x164d0e){const _0x5e9609=_0x10aece,_0x2cb33c={'mgOwH':function(_0x1cbd0c){return _0x1cbd0c();},'qBmPf':'⚠\x20No\x20git\x20repository\x20found.\x20Run\x20`ranger\x20profile\x20add\x20local`\x20from\x20your\x20project\x20directory.','bntdg':function(_0x785e70,_0x23aa17){return _0x785e70===_0x23aa17;},'LgiJc':'user','ZzfIQ':function(_0x4df759){return _0x4df759();},'RbVtf':function(_0x430a9c,_0x539f6e,_0x85d169){return _0x430a9c(_0x539f6e,_0x85d169);},'sEqNm':_0x5e9609(0xe0),'ZdWcY':_0x5e9609(0xad),'Xtvpb':_0x5e9609(0x7e),'OyuJO':_0x5e9609(0x79),'brQrg':function(_0x3df096,_0x3eb53f){return _0x3df096 instanceof _0x3eb53f;}};if(!_0x2cb33c['mgOwH'](findGitRoot))return console['log'](_0x2cb33c['qBmPf']),{'ready':![],'skipped':!![]};const _0x579c5c=_0x2cb33c[_0x5e9609(0x97)](_0x30e164?.[_0x5e9609(0x7a)],_0x2cb33c[_0x5e9609(0xef)])?_0x2cb33c[_0x5e9609(0xe8)](getRangerHomeDir):undefined;if(_0x2cb33c[_0x5e9609(0x9f)](findExistingEnv,_0x5e9609(0xe9),{'locations':['local'],'rangerDir':_0x579c5c}))return console[_0x5e9609(0x9b)](_0x2cb33c['sEqNm']),{'ready':!![],'skipped':![]};const _0x3e5c97=process['stdin']['isTTY']&&process[_0x5e9609(0xc2)]['isTTY'];if(_0x3e5c97&&!_0x30e164?.['url']){console['log'](_0x2cb33c[_0x5e9609(0xca)]),console[_0x5e9609(0x9b)]('to\x20access\x20your\x20app.\x20If\x20the\x20part\x20of\x20your\x20app\x20you\x20want\x20to\x20test\x20is\x20behind'),console['log']('auth,\x20you\x20can\x20log\x20in\x20and\x20we\x27ll\x20save\x20the\x20session\x20state\x20for\x20Ranger\x20to'),console['log'](_0x5e9609(0xcc)),console['log'](_0x5e9609(0xee));const {wantsProfile:_0x2a628d}=await _0x38a749['prompt']([{'type':'confirm','name':_0x2cb33c['Xtvpb'],'message':_0x2cb33c[_0x5e9609(0xb6)],'default':!![]}]);if(!_0x2a628d)return printProfileSetupLaterInstructions(),{'ready':![],'skipped':!![]};}try{return await addEnv('local',{'url':_0x30e164?.['url'],'force':_0x30e164?.['force'],'allowInsecureLocalhost':_0x30e164?.[_0x5e9609(0xb0)],'scope':_0x30e164?.[_0x5e9609(0x7a)]},_0x164d0e),{'ready':!![],'skipped':![]};}catch(_0x3e5644){return console['error'](_0x5e9609(0xa2),_0x2cb33c['brQrg'](_0x3e5644,Error)?_0x3e5644[_0x5e9609(0xa0)]:_0x3e5644),printProfileSetupLaterInstructions(),{'ready':![],'skipped':![]};}}export async function start(_0x5add1f,_0x46745e,_0x23dcf9){const _0x47ae1a=_0x10aece,_0x51d52a={'oUQov':_0x47ae1a(0x93),'nMRnp':_0x47ae1a(0xb2),'ncbCm':_0x47ae1a(0x76),'gSXEi':function(_0x1e421c,_0x2ac2cd){return _0x1e421c(_0x2ac2cd);},'cJVXz':function(_0x38c34f){return _0x38c34f();},'ELelV':_0x47ae1a(0xbc),'cOCBK':function(_0x5e044b,_0x98d905){return _0x5e044b(_0x98d905);},'JZYgZ':_0x47ae1a(0xa4),'oMeEQ':'chromium','ezKnX':'\x0a✅\x20Ranger\x20setup\x20complete!\x0a','RyqUL':_0x47ae1a(0xd1),'KqVcb':function(_0x729d42,_0x9974a9){return _0x729d42(_0x9974a9);},'WeTbF':_0x47ae1a(0x82),'IdXPo':function(_0x32fb14,_0x24cad8){return _0x32fb14 instanceof _0x24cad8;},'xOKRW':_0x47ae1a(0xbd),'TLVLe':function(_0x4d1639,_0x588add){return _0x4d1639(_0x588add);},'CHAiz':_0x47ae1a(0x85),'txUET':'and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','RSIRf':'/ranger:enable','brwtk':function(_0x5cf6e4,_0x4ed882){return _0x5cf6e4+_0x4ed882;}};console[_0x47ae1a(0x9b)](_0x47ae1a(0xcf));const _0x5d477b=process[_0x47ae1a(0x7b)][_0x47ae1a(0x95)]&&process['stdout']['isTTY'];!_0x5d477b&&!_0x46745e?.['scope']&&(console[_0x47ae1a(0x9b)](_0x51d52a[_0x47ae1a(0xdd)]),_0x46745e={..._0x46745e,'scope':'user'});_0x23dcf9?.[_0x47ae1a(0x86)]('git_check');if(!findGitRoot()){await _0x23dcf9?.['trackPhaseError']('git_check',new Error(_0x51d52a['nMRnp']));throw new Error(_0x47ae1a(0x9d));}_0x23dcf9?.['trackPhaseEnd'](_0x51d52a['ncbCm']);const _0x47bf48=!_0x51d52a[_0x47ae1a(0xe5)](existsSync,_0x51d52a[_0x47ae1a(0x81)](getRangerDir)),_0x5bab0a=_0x46745e?.['scope']===_0x51d52a[_0x47ae1a(0xce)],{path:_0x352fdc}=await _0x51d52a[_0x47ae1a(0xd2)](ensureRangerDir,_0x5bab0a?_0x51d52a[_0x47ae1a(0xce)]:undefined);_0x23dcf9?.[_0x47ae1a(0x86)](_0x51d52a['JZYgZ']);const _0x224e16=await _0x51d52a['gSXEi'](authenticate,_0x5add1f);_0x23dcf9?.[_0x47ae1a(0xba)](_0x51d52a[_0x47ae1a(0xb1)],{'isFirstRun':_0x47bf48,'method':_0x224e16[_0x47ae1a(0xac)]}),_0x23dcf9?.[_0x47ae1a(0x86)](_0x51d52a['oMeEQ']);_0x46745e?.[_0x47ae1a(0x9e)]?console['log'](_0x47ae1a(0xc4)):await ensureChromium();_0x23dcf9?.['trackPhaseEnd'](_0x51d52a[_0x47ae1a(0xeb)],{'isFirstRun':_0x47bf48,'skipped':!!_0x46745e?.[_0x47ae1a(0x9e)]});!_0x5bab0a&&await writeRangerGitignore(_0x352fdc);console[_0x47ae1a(0x9b)](_0x51d52a[_0x47ae1a(0x74)]);const _0x4d6f3e=_0x46745e?.[_0x47ae1a(0x7a)],_0x14b4d0=_0x46745e?.['opencode']??![];let _0x380539=null;_0x14b4d0?(_0x23dcf9?.['trackPhaseStart'](_0x51d52a['RyqUL']),_0x380539=await ensureOpencodePluginConfig(_0x4d6f3e),_0x23dcf9?.['trackPhaseEnd'](_0x51d52a['RyqUL'],{'isFirstRun':_0x47bf48,'opencode':!![]})):(_0x23dcf9?.[_0x47ae1a(0x86)](_0x51d52a['RyqUL']),await _0x51d52a[_0x47ae1a(0x7d)](ensureClaudePlugin,_0x4d6f3e),_0x23dcf9?.['trackPhaseEnd']('plugin',{'isFirstRun':_0x47bf48}));if(_0x14b4d0&&_0x380539){_0x23dcf9?.['trackPhaseStart']('skills');try{await installSkill(_0x51d52a[_0x47ae1a(0x75)],{'level':_0x380539[_0x47ae1a(0x7a)],'cliVersion':getCurrentVersion(),'platform':'opencode'}),_0x23dcf9?.[_0x47ae1a(0xba)](_0x47ae1a(0xbd),{'isFirstRun':_0x47bf48,'opencode':!![]});}catch(_0x47cd76){console[_0x47ae1a(0xe3)]('\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:',_0x51d52a['IdXPo'](_0x47cd76,Error)?_0x47cd76['message']:_0x47cd76),_0x23dcf9?.[_0x47ae1a(0xba)](_0x51d52a['xOKRW'],{'isFirstRun':_0x47bf48,'opencode':!![],'failed':!![]});}}else _0x23dcf9?.['trackPhaseStart'](_0x51d52a[_0x47ae1a(0xc6)]),await ensureClaudeSkills(_0x4d6f3e),_0x23dcf9?.[_0x47ae1a(0xba)](_0x47ae1a(0xbd),{'isFirstRun':_0x47bf48});if(!_0x5d477b&&!_0x46745e?.[_0x47ae1a(0xa5)])console['log']('Non-interactive\x20mode:\x20Skipping\x20profile\x20setup.\x20To\x20set\x20up\x20a\x20profile,\x20pass\x20--url\x20or\x20run\x20later:'),console[_0x47ae1a(0x9b)]('\x20\x20'+_0x51d52a[_0x47ae1a(0xec)](bold,'ranger\x20profile\x20add\x20local')+'\x0a');else{_0x23dcf9?.[_0x47ae1a(0x86)](_0x51d52a['CHAiz']);const _0x2ea0f9=await ensureLocalEnv({'url':_0x46745e?.['url'],'force':_0x46745e?.['force'],'allowInsecureLocalhost':_0x46745e?.['allowInsecureLocalhost'],'scope':_0x46745e?.['scope']===_0x47ae1a(0xbc)?_0x51d52a['ELelV']:undefined},_0x23dcf9);_0x23dcf9?.[_0x47ae1a(0xba)](_0x51d52a[_0x47ae1a(0xc8)],{'isFirstRun':_0x47bf48,'profileReady':_0x2ea0f9['ready'],'userSkipped':_0x2ea0f9[_0x47ae1a(0x72)]}),_0x2ea0f9[_0x47ae1a(0xb5)]&&console[_0x47ae1a(0x9b)]('\x0a✅\x20You\x27re\x20ready\x20to\x20start\x20using\x20Ranger\x20Feature\x20Review.');}if(_0x14b4d0)console[_0x47ae1a(0x9b)](_0x47ae1a(0xed)),console['log'](_0x51d52a['txUET']),console['log'](_0x47ae1a(0x90)),console['log'](_0x47ae1a(0xdf));else{const _0x3d22bc=bold(_0x51d52a['RSIRf']);console['log'](_0x51d52a[_0x47ae1a(0xa6)]('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x3d22bc+_0x47ae1a(0x96)+'\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with'+_0x47ae1a(0x89),_0x47ae1a(0xea)));}}
|
package/build/commands/status.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x5eef4b=_0x3101;(function(_0x24baf2,_0x204792){const _0x2ce747=_0x3101,_0x58ec68=_0x24baf2();while(!![]){try{const _0x5bed65=parseInt(_0x2ce747(0x163))/0x1*(-parseInt(_0x2ce747(0x187))/0x2)+-parseInt(_0x2ce747(0x17b))/0x3*(parseInt(_0x2ce747(0x122))/0x4)+-parseInt(_0x2ce747(0x14e))/0x5+parseInt(_0x2ce747(0x13c))/0x6*(parseInt(_0x2ce747(0x12d))/0x7)+parseInt(_0x2ce747(0x12f))/0x8*(parseInt(_0x2ce747(0x159))/0x9)+-parseInt(_0x2ce747(0x137))/0xa+parseInt(_0x2ce747(0x189))/0xb;if(_0x5bed65===_0x204792)break;else _0x58ec68['push'](_0x58ec68['shift']());}catch(_0x59cd7c){_0x58ec68['push'](_0x58ec68['shift']());}}}(_0x1850,0x9045e));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';function _0x3101(_0x7a9c84,_0x193c0b){_0x7a9c84=_0x7a9c84-0x11f;const _0x1850c1=_0x1850();let _0x310137=_0x1850c1[_0x7a9c84];return _0x310137;}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=_0x107318=>'\x1b[1m'+_0x107318+'\x1b[0m',link=(_0x240a21,_0x546115)=>_0x5eef4b(0x12e)+_0x240a21+'\x07'+(_0x546115||_0x240a21)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x4fbd07=_0x5eef4b,_0x5bd6ef={'wkiyS':function(_0x53c51f,_0x37ca55){return _0x53c51f(_0x37ca55);},'YNIYI':_0x4fbd07(0x152),'KeuHq':_0x4fbd07(0x15c),'YCMPA':_0x4fbd07(0x175),'rAIRK':_0x4fbd07(0x135),'ewuEM':function(_0x121962,_0x55a26d){return _0x121962!==_0x55a26d;},'kJleK':function(_0x387923,_0x1153df){return _0x387923>_0x1153df;},'HszAe':'debug','ovBcP':_0x4fbd07(0x14b),'qPGoF':_0x4fbd07(0x18a)};return new Promise(_0x1528b9=>{const _0x55d277=_0x4fbd07,_0x35fdd3={'FnfIj':_0x5bd6ef[_0x55d277(0x162)],'drpsP':_0x5bd6ef[_0x55d277(0x181)],'BLnVZ':_0x5bd6ef[_0x55d277(0x15b)],'OYmub':function(_0x436abc,_0x2e5cf5){return _0x5bd6ef['ewuEM'](_0x436abc,_0x2e5cf5);},'WunVn':function(_0x34971a,_0x2e5e1d){const _0x1e0ee4=_0x55d277;return _0x5bd6ef[_0x1e0ee4(0x121)](_0x34971a,_0x2e5e1d);},'ZAAiS':_0x5bd6ef[_0x55d277(0x156)],'eQvgl':'configured','oIKag':function(_0x3bf152,_0x14e208){return _0x5bd6ef['kJleK'](_0x3bf152,_0x14e208);}},_0xf2264f=spawn('opencode',[_0x5bd6ef['HszAe'],_0x55d277(0x149)],{'stdio':['ignore',_0x5bd6ef['ovBcP'],_0x5bd6ef['ovBcP']]});let _0x7400c8='';_0xf2264f['stdout']?.['on']('data',_0x49d9c9=>{_0x7400c8+=_0x49d9c9['toString']();}),_0xf2264f['stderr']?.['on']('data',_0x26df5c=>{_0x7400c8+=_0x26df5c['toString']();}),_0xf2264f['on'](_0x5bd6ef[_0x55d277(0x178)],()=>{const _0x3d24be=_0x55d277;_0x5bd6ef['wkiyS'](_0x1528b9,{'status':_0x5bd6ef[_0x3d24be(0x156)]});}),_0xf2264f['on'](_0x55d277(0x165),_0xac5c83=>{const _0x496e74=_0x55d277;if(_0x35fdd3[_0x496e74(0x173)](_0xac5c83,0x0)){_0x35fdd3[_0x496e74(0x123)](_0x1528b9,{'status':_0x35fdd3['ZAAiS']});return;}const _0x589bef=_0x7400c8[_0x496e74(0x132)]();let _0x29f196=null;if(_0x589bef)try{_0x29f196=JSON[_0x496e74(0x17a)](_0x589bef);}catch{const _0x4c7417=_0x589bef[_0x496e74(0x16e)](/\{[\s\S]*\}$/);if(_0x4c7417)try{_0x29f196=JSON[_0x496e74(0x17a)](_0x4c7417[0x0]);}catch{_0x29f196=null;}}const _0x49d9d8=Array[_0x496e74(0x161)](_0x29f196?.[_0x496e74(0x172)])?_0x29f196?.['plugin']:[],_0x2899c8=_0x49d9d8['some'](_0x58a455=>{const _0x4f9c32=_0x496e74;if(typeof _0x58a455!==_0x35fdd3[_0x4f9c32(0x176)])return![];return _0x58a455['includes'](_0x35fdd3['drpsP'])||_0x58a455['includes'](_0x35fdd3[_0x4f9c32(0x184)]);});if(_0x2899c8){_0x1528b9({'status':_0x35fdd3[_0x496e74(0x171)],'details':_0x35fdd3['oIKag'](_0x49d9d8[_0x496e74(0x16f)],0x0)?_0x49d9d8['length']+'\x20plugin(s)\x20configured':undefined});return;}if(_0x49d9d8[_0x496e74(0x16f)]>0x0){_0x35fdd3[_0x496e74(0x123)](_0x1528b9,{'status':_0x496e74(0x126),'details':_0x49d9d8[_0x496e74(0x16f)]+'\x20plugin(s)\x20configured'});return;}_0x1528b9({'status':_0x496e74(0x126)});});});}async function getSkillsFromDir(_0x377a05,_0x6d69ad){const _0x3892c3=_0x5eef4b,_0x190f1b={'eVPAu':function(_0x3f7665,_0x2b3913){return _0x3f7665(_0x2b3913);},'hynnU':function(_0x165731,_0x3e30cc,_0x3c5310){return _0x165731(_0x3e30cc,_0x3c5310);},'QTtIu':_0x3892c3(0x13d),'JHWRb':_0x3892c3(0x177)};if(!_0x190f1b[_0x3892c3(0x13a)](existsSync,_0x377a05))return[];const _0x3a6e96=[];try{const _0x1d0c71=await _0x190f1b['hynnU'](readdir,_0x377a05,{'withFileTypes':!![]});for(const _0x2dc6cc of _0x1d0c71){if(_0x2dc6cc[_0x3892c3(0x17d)]()){const _0x236a5b=join(_0x377a05,_0x2dc6cc[_0x3892c3(0x142)],_0x190f1b[_0x3892c3(0x154)]);if(existsSync(_0x236a5b)){let _0x3ffbd0=_0x2dc6cc['name'];try{const _0x310beb=await _0x190f1b[_0x3892c3(0x168)](readFile,_0x236a5b,_0x190f1b[_0x3892c3(0x140)]),_0x22eb60=_0x310beb['match'](/name:\s*(.+)/);_0x22eb60&&(_0x3ffbd0=_0x22eb60[0x1]['trim']());}catch{}_0x3a6e96[_0x3892c3(0x130)]({'name':_0x2dc6cc['name'],'displayName':_0x3ffbd0,'path':_0x236a5b,'level':_0x6d69ad});}}}}catch{return[];}return _0x3a6e96;}async function getInstalledSkills(){const _0x2a1de4=_0x5eef4b,_0x5bf531={'xbYrk':_0x2a1de4(0x182)},[_0x415ac7,_0x4e056d]=await Promise[_0x2a1de4(0x16d)]([getSkillsFromDir(getProjectSkillsDir(),'project'),getSkillsFromDir(getUserSkillsDir(),_0x5bf531['xbYrk'])]);return{'project':_0x415ac7,'user':_0x4e056d};}async function getEnvironments(){const _0x570eb7=_0x5eef4b,_0x35cad2={'lAakz':function(_0x22c288,_0x662ca){return _0x22c288(_0x662ca);},'Vyudz':function(_0x267176,_0x39737e,_0x2e6bfc){return _0x267176(_0x39737e,_0x2e6bfc);},'AwArY':_0x570eb7(0x153),'hTXdd':function(_0x21acd8,_0x274000){return _0x21acd8(_0x274000);},'dPZjw':function(_0x622acc){return _0x622acc();}},{envNames:_0x43c791,activeEnv:_0x459a9f}=await _0x35cad2['dPZjw'](getEnvNames),_0x3a4bfa=getRangerDir();if(!_0x35cad2['lAakz'](existsSync,_0x3a4bfa))return{'envs':[],'activeEnv':null};const _0x43875e=_0x43c791[_0x570eb7(0x17c)](_0x3496bf=>{const _0x4d0b78=_0x570eb7,_0xb611bd=_0x35cad2[_0x4d0b78(0x13e)](getEnvDir,_0x3496bf),_0xfb67ad=join(_0xb611bd,_0x4d0b78(0x15f)),_0x38f0ce=_0x35cad2[_0x4d0b78(0x164)](join,_0xb611bd,'auth.json'),_0x361c02=_0x35cad2[_0x4d0b78(0x164)](join,_0xb611bd,_0x4d0b78(0x180));return{'name':_0x3496bf,'settingsPath':_0x35cad2[_0x4d0b78(0x13e)](existsSync,_0xfb67ad)?_0xfb67ad:_0x35cad2[_0x4d0b78(0x133)],'hasPlaintextAuth':_0x35cad2['hTXdd'](existsSync,_0x38f0ce),'hasEncryptedAuth':_0x35cad2[_0x4d0b78(0x124)](existsSync,_0x361c02),'isActive':_0x3496bf===_0x459a9f};});return{'envs':_0x43875e,'activeEnv':_0x459a9f};}export async function status(){const _0x5dfe1e=_0x5eef4b,_0x58fe11={'DeSuc':function(_0xfbe25c){return _0xfbe25c();},'nLZvG':function(_0x398474,_0x1ee32b){return _0x398474(_0x1ee32b);},'lwbxh':function(_0x4fae58,_0xe67908,_0x576e81){return _0x4fae58(_0xe67908,_0x576e81);},'gpBmJ':function(_0x94a550){return _0x94a550();},'LGmmW':function(_0x1e0859){return _0x1e0859();},'jzomp':function(_0x42d440,_0x309f38){return _0x42d440===_0x309f38;},'MXyzx':'\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','jvJYj':_0x5dfe1e(0x14f),'Dcxti':'unknown','snniz':_0x5dfe1e(0x174),'RxPSc':'\x0a---\x20Skills\x20---','llBrv':function(_0x13b1c1,_0x1dc261){return _0x13b1c1+_0x1dc261;},'RENHH':_0x5dfe1e(0x15d),'VoiJO':_0x5dfe1e(0x188),'fWAdk':function(_0x3f27e6,_0x56caed){return _0x3f27e6(_0x56caed);},'kItyt':function(_0x220b35,_0x202363){return _0x220b35>_0x202363;},'SeKLf':_0x5dfe1e(0x160),'vyRyY':function(_0x4c7878,_0xd36b38){return _0x4c7878===_0xd36b38;},'WSZUB':'\x20(active)','sCWLv':_0x5dfe1e(0x13b),'mQiEx':_0x5dfe1e(0x12b),'OqvWe':'(not\x20found)','Lglww':function(_0x554b4e,_0x576ecd,_0x1b43c9){return _0x554b4e(_0x576ecd,_0x1b43c9);}};console['log'](_0x5dfe1e(0x12c));const _0x4e39c9=process['cwd'](),_0x49a16a=_0x58fe11['DeSuc'](getRangerDir);if(!_0x58fe11[_0x5dfe1e(0x128)](existsSync,_0x49a16a)){console['log']('Root:\x20'+link(_0x4e39c9,bold(basename(_0x4e39c9)))),console['log'](_0x5dfe1e(0x170)),console[_0x5dfe1e(0x185)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console[_0x5dfe1e(0x185)]('Root:\x20'+_0x58fe11['lwbxh'](link,_0x4e39c9,bold(_0x58fe11[_0x5dfe1e(0x128)](basename,_0x4e39c9))));const _0x26c718=getCurrentVersion(),_0x26ce0b=_0x58fe11['gpBmJ'](getLatestVersion);if(_0x26ce0b[_0x5dfe1e(0x169)]&&_0x26ce0b['version']!==_0x26c718)console[_0x5dfe1e(0x185)]('Version:\x20'+_0x26c718+'\x20(latest:\x20'+_0x26ce0b['version']+')'),console[_0x5dfe1e(0x185)](_0x5dfe1e(0x146));else _0x26ce0b[_0x5dfe1e(0x169)]?console['log']('Version:\x20'+_0x26c718+_0x5dfe1e(0x183)):console[_0x5dfe1e(0x185)]('Version:\x20'+_0x26c718);const _0x1f2d55=await getToken();if(_0x1f2d55){const _0x34df9c=await getCurrentUser(_0x1f2d55);_0x34df9c[_0x5dfe1e(0x186)]?console[_0x5dfe1e(0x185)](_0x5dfe1e(0x144)+_0x58fe11['nLZvG'](bold,_0x34df9c['user']['organizationName'])):(console['log'](_0x5dfe1e(0x147)),console['log'](_0x5dfe1e(0x139)));}else console['log']('API\x20Token:\x20✗\x20Not\x20found'),console['log'](_0x5dfe1e(0x139));process['env']['DEBUG']&&(console['log'](_0x5dfe1e(0x179)+getCurrentEnvironment()),console[_0x5dfe1e(0x185)](_0x5dfe1e(0x158)+_0x58fe11[_0x5dfe1e(0x138)](getApiBaseUrl)));console[_0x5dfe1e(0x185)]('\x0a---\x20OpenCode\x20Plugin\x20---');const _0x3992fe=await getOpencodePluginStatus();if(_0x58fe11['jzomp'](_0x3992fe['status'],_0x5dfe1e(0x157)))console['log']('\x20\x20'+_0x58fe11[_0x5dfe1e(0x128)](bold,'@ranger-testing/opencode-plugin')+':\x20configured'),_0x3992fe[_0x5dfe1e(0x148)]&&console[_0x5dfe1e(0x185)]('\x20\x20'+_0x3992fe[_0x5dfe1e(0x148)]);else _0x58fe11['jzomp'](_0x3992fe['status'],_0x5dfe1e(0x126))?(console['log'](_0x5dfe1e(0x14d)),_0x3992fe['details']&&console['log']('\x20\x20'+_0x3992fe[_0x5dfe1e(0x148)]),console['log']('\x20\x20Run:\x20ranger\x20setup\x20--opencode')):console[_0x5dfe1e(0x185)](_0x58fe11[_0x5dfe1e(0x17e)]);console[_0x5dfe1e(0x185)]('\x0a---\x20Claude\x20Code\x20Plugin\x20---');const _0x5da060=await getPluginInfo(_0x58fe11['jvJYj']);if(_0x5da060){const _0x2612ac=_0x5da060['scope']||_0x58fe11['Dcxti'],_0x12ab94=_0x5da060['enabled']?'enabled':'disabled';console['log']('\x20\x20'+bold(_0x5dfe1e(0x14f))+_0x5dfe1e(0x150)+_0x2612ac+',\x20'+_0x12ab94+')');}else console['log'](_0x58fe11[_0x5dfe1e(0x17f)]),console['log'](_0x5dfe1e(0x129));console['log'](_0x58fe11['RxPSc']);const {project:_0x58a040,user:_0x10c90f}=await getInstalledSkills(),_0x4c207c=_0x58a040['filter'](_0x51815c=>RANGER_MANAGED_SKILLS[_0x5dfe1e(0x15a)](_0x51815c[_0x5dfe1e(0x142)])),_0x353454=_0x10c90f[_0x5dfe1e(0x141)](_0x15213e=>RANGER_MANAGED_SKILLS['includes'](_0x15213e[_0x5dfe1e(0x142)])),_0x5f3972=_0x58fe11['llBrv'](_0x4c207c['length'],_0x353454[_0x5dfe1e(0x16f)]);if(_0x5f3972===0x0)console[_0x5dfe1e(0x185)](_0x58fe11['RENHH']),console[_0x5dfe1e(0x185)](_0x5dfe1e(0x166));else{if(_0x4c207c['length']>0x0){console[_0x5dfe1e(0x185)](_0x58fe11[_0x5dfe1e(0x134)]);for(const _0x3ccfff of _0x4c207c){console[_0x5dfe1e(0x185)]('\x20\x20\x20\x20'+_0x58fe11['fWAdk'](bold,_0x3ccfff[_0x5dfe1e(0x120)])+':\x20'+_0x58fe11['lwbxh'](link,_0x3ccfff['path'],_0x58fe11[_0x5dfe1e(0x12a)](basename,_0x3ccfff[_0x5dfe1e(0x14c)])));}}if(_0x58fe11[_0x5dfe1e(0x16a)](_0x353454['length'],0x0)){console['log'](_0x5dfe1e(0x15e));for(const _0x43ce3f of _0x353454){console[_0x5dfe1e(0x185)](_0x5dfe1e(0x131)+bold(_0x43ce3f[_0x5dfe1e(0x120)])+':\x20'+link(_0x43ce3f[_0x5dfe1e(0x14c)],_0x58fe11['fWAdk'](basename,_0x43ce3f[_0x5dfe1e(0x14c)])));}}}console[_0x5dfe1e(0x185)](_0x58fe11[_0x5dfe1e(0x136)]);const {envs:_0x153e4f,activeEnv:_0x42204a}=await getEnvironments();if(_0x58fe11[_0x5dfe1e(0x13f)](_0x153e4f[_0x5dfe1e(0x16f)],0x0))console['log'](_0x5dfe1e(0x151)),console['log'](_0x5dfe1e(0x143));else{for(const _0x506a01 of _0x153e4f){const _0x3f9016=_0x506a01['isActive']?_0x58fe11[_0x5dfe1e(0x167)]:'',_0x3305f6=_0x506a01[_0x5dfe1e(0x14a)]?_0x58fe11[_0x5dfe1e(0x127)]:_0x506a01['hasPlaintextAuth']?_0x58fe11['mQiEx']:'none';console['log']('\x20\x20'+bold(_0x506a01[_0x5dfe1e(0x142)])+_0x3f9016),console[_0x5dfe1e(0x185)](_0x5dfe1e(0x16c)+_0x3305f6),_0x506a01[_0x5dfe1e(0x16b)]!==_0x58fe11[_0x5dfe1e(0x125)]&&console['log']('\x20\x20\x20\x20Settings:\x20'+_0x58fe11[_0x5dfe1e(0x155)](link,_0x506a01['settingsPath'],basename(_0x506a01['settingsPath'])));}!_0x42204a&&(console['log']('\x0a\x20\x20No\x20active\x20profile\x20set'),console['log'](_0x5dfe1e(0x11f)+_0x153e4f['map'](_0x825ce6=>_0x825ce6[_0x5dfe1e(0x142)])[_0x5dfe1e(0x145)](',\x20')+')'));}console['log']('');}function _0x1850(){const _0x25e872=['API\x20Environment:\x20','parse','3UqtHDS','map','isDirectory','MXyzx','snniz','auth.json.enc','YCMPA','user','\x20(up\x20to\x20date)','BLnVZ','log','success','1714946jLekAL','\x20\x20Project-level:','18650841MTRUpN','error','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','displayName','wkiyS','1405176vGQiZC','WunVn','hTXdd','OqvWe','not_configured','sCWLv','nLZvG','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','fWAdk','plaintext','\x0a📊\x20Ranger\x20Status\x0a','91cAgfof','\x1b]8;;file://','8AnHORo','push','\x20\x20\x20\x20','trim','AwArY','VoiJO','opencode-plugin','SeKLf','8717910buttDn','LGmmW','\x20\x20Run:\x20ranger\x20setup\x20[token]','eVPAu','encrypted','494346GlwhjF','SKILL.md','lAakz','vyRyY','JHWRb','filter','name','\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>','Organization:\x20','join','\x20\x20Run:\x20ranger\x20update','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','details','config','hasEncryptedAuth','pipe','path','\x20\x20Not\x20configured','5105185GYGHKX','ranger@trailhead',':\x20installed\x20(','No\x20profiles\x20configured','not_installed','(not\x20found)','QTtIu','Lglww','YNIYI','configured','API\x20URL:\x20','8333307WLYpIO','includes','rAIRK','string','No\x20skills\x20installed','\x20\x20User-level:','settings.json','\x0a---\x20Profiles\x20---','isArray','KeuHq','1MjbULN','Vyudz','close','\x20\x20Run:\x20ranger\x20skillup','WSZUB','hynnU','version','kItyt','settingsPath','\x20\x20\x20\x20Auth:\x20','all','match','length','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','eQvgl','plugin','OYmub','\x20\x20Not\x20installed','@ranger-testing/opencode-plugin','FnfIj','utf-8','qPGoF'];_0x1850=function(){return _0x25e872;};return _0x1850();}
|
|
1
|
+
const _0x3f97d0=_0x2071;(function(_0x4dc498,_0x5ce20f){const _0x55b94e=_0x2071,_0x47197f=_0x4dc498();while(!![]){try{const _0x7fa71c=parseInt(_0x55b94e(0xbf))/0x1+parseInt(_0x55b94e(0xe8))/0x2+-parseInt(_0x55b94e(0xc9))/0x3*(parseInt(_0x55b94e(0xc2))/0x4)+parseInt(_0x55b94e(0xe4))/0x5*(parseInt(_0x55b94e(0x9f))/0x6)+parseInt(_0x55b94e(0xb6))/0x7*(parseInt(_0x55b94e(0x91))/0x8)+parseInt(_0x55b94e(0xee))/0x9+-parseInt(_0x55b94e(0xae))/0xa;if(_0x7fa71c===_0x5ce20f)break;else _0x47197f['push'](_0x47197f['shift']());}catch(_0x583040){_0x47197f['push'](_0x47197f['shift']());}}}(_0x4540,0x8222f));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{getPluginInfo}from'./utils/claudePlugin.js';function _0x4540(){const _0x2a397e=['pNOJn','trim','tyjlw','\x20\x20\x20\x20','Organization:\x20','oBQEB','aPNXj','parse','all','KHmIm','MoiRZ','settings.json','MIWHr','503495jhExxS','LTIKb','string','isActive','1903650djTMGl','\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>','API\x20Token:\x20✗\x20Not\x20found','organizationName','\x20\x20Not\x20configured','map','3061782adcxyP','aCZTG','AIrJp','version','rCvzH','bikEI','826304umosQU','data','\x20(latest:\x20','\x0a---\x20Claude\x20Code\x20Plugin\x20---','uprpz','match','Root:\x20','stderr','jVzlW','stdout','BsnVu','configured','Version:\x20','settingsPath','6UuJQeL','SrRUO','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','QlWXs','kJsKc','debug','length','KhdQN','cwd','mfLSb','tUEmd','not_configured','pipe','xAGSA','\x20\x20Run:\x20ranger\x20update','6290630KjOLzN','UNynb','displayName','VwKuh','TQnLm','log','close','@ranger-testing/opencode-plugin','28KbBSNv','SAEVQ','(not\x20found)','\x0a---\x20Skills\x20---','gVgFB','encrypted','name','path',':\x20installed\x20(','208895qbziBl','not_installed','details','21724yCzUSi','No\x20profiles\x20configured','API\x20URL:\x20','LstaY','hasPlaintextAuth',':\x20configured','ZkOGd','471xnZXwy','project','\x0a---\x20Profiles\x20---','enabled','\x0a---\x20OpenCode\x20Plugin\x20---','opencode-plugin','\x1b]8;;file://','NjpIg','unknown','toString','FgxbW','\x20\x20User-level:','error','DeorM'];_0x4540=function(){return _0x2a397e;};return _0x4540();}import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x648a08=>'\x1b[1m'+_0x648a08+'\x1b[0m',link=(_0x584f49,_0x1ca09b)=>_0x3f97d0(0xcf)+_0x584f49+'\x07'+(_0x1ca09b||_0x584f49)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x40e12c=_0x3f97d0,_0x313e30={'rCvzH':function(_0x5bcdf4,_0x2ef4c7){return _0x5bcdf4!==_0x2ef4c7;},'aPNXj':_0x40e12c(0xc0),'gVgFB':function(_0x3dfe47,_0x36fa74){return _0x3dfe47(_0x36fa74);},'bikEI':function(_0x3529e3,_0x31eb00,_0x4896c4,_0x2cc238){return _0x3529e3(_0x31eb00,_0x4896c4,_0x2cc238);},'GTnzi':_0x40e12c(0xa4),'MoiRZ':'ignore','ITzBO':_0x40e12c(0xab),'AoXVa':_0x40e12c(0x92),'tyjlw':_0x40e12c(0xd5),'VwKuh':_0x40e12c(0xb4)};return new Promise(_0x55ebb3=>{const _0x5ae84d=_0x40e12c,_0x1eafd0={'KfLnH':function(_0x384725,_0x56f927){return _0x384725(_0x56f927);},'uprpz':function(_0x3feb0a,_0x58123a){return _0x3feb0a!==_0x58123a;},'NjpIg':_0x5ae84d(0xe6),'yuXDt':function(_0x152174,_0x379cb3){const _0x13a6f7=_0x5ae84d;return _0x313e30[_0x13a6f7(0xf2)](_0x152174,_0x379cb3);},'BvwZJ':_0x313e30[_0x5ae84d(0xdd)],'kJsKc':function(_0x28b262,_0x568ba6){return _0x28b262>_0x568ba6;},'QlWXs':_0x5ae84d(0xaa),'drcUu':function(_0x43d65b,_0x50af64){const _0xc3c11d=_0x5ae84d;return _0x313e30[_0xc3c11d(0xba)](_0x43d65b,_0x50af64);}},_0x5db0b4=_0x313e30[_0x5ae84d(0x90)](spawn,'opencode',[_0x313e30['GTnzi'],'config'],{'stdio':[_0x313e30[_0x5ae84d(0xe1)],_0x313e30['ITzBO'],'pipe']});let _0x2c4783='';_0x5db0b4[_0x5ae84d(0x9a)]?.['on'](_0x313e30['AoXVa'],_0x337364=>{const _0x41e1a4=_0x5ae84d;_0x2c4783+=_0x337364[_0x41e1a4(0xd2)]();}),_0x5db0b4[_0x5ae84d(0x98)]?.['on']('data',_0x401123=>{const _0x5d7052=_0x5ae84d;_0x2c4783+=_0x401123[_0x5d7052(0xd2)]();}),_0x5db0b4['on'](_0x313e30[_0x5ae84d(0xd9)],()=>{const _0x5c31d9=_0x5ae84d;_0x1eafd0['KfLnH'](_0x55ebb3,{'status':_0x5c31d9(0xc0)});}),_0x5db0b4['on'](_0x313e30[_0x5ae84d(0xb1)],_0x5e1ebe=>{const _0x335e70=_0x5ae84d;if(_0x1eafd0['yuXDt'](_0x5e1ebe,0x0)){_0x55ebb3({'status':_0x1eafd0['BvwZJ']});return;}const _0x2c62e5=_0x2c4783[_0x335e70(0xd8)]();let _0x28bd76=null;if(_0x2c62e5)try{_0x28bd76=JSON['parse'](_0x2c62e5);}catch{const _0x238a45=_0x2c62e5[_0x335e70(0x96)](/\{[\s\S]*\}$/);if(_0x238a45)try{_0x28bd76=JSON[_0x335e70(0xde)](_0x238a45[0x0]);}catch{_0x28bd76=null;}}const _0x54c7af=Array['isArray'](_0x28bd76?.['plugin'])?_0x28bd76?.['plugin']:[],_0xc54020=_0x54c7af['some'](_0x4c1c55=>{const _0x9afe9a=_0x335e70;if(_0x1eafd0[_0x9afe9a(0x95)](typeof _0x4c1c55,_0x1eafd0[_0x9afe9a(0xd0)]))return![];return _0x4c1c55['includes'](_0x9afe9a(0xb5))||_0x4c1c55['includes'](_0x9afe9a(0xce));});if(_0xc54020){_0x55ebb3({'status':'configured','details':_0x1eafd0[_0x335e70(0xa3)](_0x54c7af[_0x335e70(0xa5)],0x0)?_0x54c7af[_0x335e70(0xa5)]+'\x20plugin(s)\x20configured':undefined});return;}if(_0x54c7af[_0x335e70(0xa5)]>0x0){_0x55ebb3({'status':_0x1eafd0[_0x335e70(0xa2)],'details':_0x54c7af[_0x335e70(0xa5)]+'\x20plugin(s)\x20configured'});return;}_0x1eafd0['drcUu'](_0x55ebb3,{'status':_0x1eafd0['QlWXs']});});});}async function getSkillsFromDir(_0x53f8d2,_0x1665d8){const _0x11bf18=_0x3f97d0,_0x45d68b={'JYcML':'SKILL.md','mfLSb':function(_0x54c656,_0x47d1b1){return _0x54c656(_0x47d1b1);},'KhdQN':function(_0x3d4883,_0x518afc,_0x1434e4){return _0x3d4883(_0x518afc,_0x1434e4);},'SrRUO':'utf-8'};if(!existsSync(_0x53f8d2))return[];const _0x2add79=[];try{const _0x3c0229=await readdir(_0x53f8d2,{'withFileTypes':!![]});for(const _0x54be57 of _0x3c0229){if(_0x54be57['isDirectory']()){const _0x2981c6=join(_0x53f8d2,_0x54be57[_0x11bf18(0xbc)],_0x45d68b['JYcML']);if(_0x45d68b[_0x11bf18(0xa8)](existsSync,_0x2981c6)){let _0xf8123c=_0x54be57['name'];try{const _0x185f83=await _0x45d68b[_0x11bf18(0xa6)](readFile,_0x2981c6,_0x45d68b[_0x11bf18(0xa0)]),_0x812d28=_0x185f83['match'](/name:\s*(.+)/);_0x812d28&&(_0xf8123c=_0x812d28[0x1][_0x11bf18(0xd8)]());}catch{}_0x2add79['push']({'name':_0x54be57['name'],'displayName':_0xf8123c,'path':_0x2981c6,'level':_0x1665d8});}}}}catch{return[];}return _0x2add79;}async function getInstalledSkills(){const _0x5e335f=_0x3f97d0,_0x3afc20={'sroeL':function(_0xb2c45f,_0x1a4f6c,_0xcc640c){return _0xb2c45f(_0x1a4f6c,_0xcc640c);},'bObJt':_0x5e335f(0xca)},[_0x604d1b,_0x46a9fe]=await Promise[_0x5e335f(0xdf)]([_0x3afc20['sroeL'](getSkillsFromDir,getProjectSkillsDir(),_0x3afc20['bObJt']),getSkillsFromDir(getUserSkillsDir(),'user')]);return{'project':_0x604d1b,'user':_0x46a9fe};}async function getEnvironments(){const _0x56cc34=_0x3f97d0,_0x38a429={'tgoVY':function(_0x30b0ea,_0x5404ef,_0x28de66){return _0x30b0ea(_0x5404ef,_0x28de66);},'oBQEB':_0x56cc34(0xe2),'KHmIm':function(_0x34c016,_0x243162){return _0x34c016(_0x243162);},'RWneY':function(_0x35756e){return _0x35756e();},'DeorM':function(_0x2de2c8,_0x5e66e4){return _0x2de2c8(_0x5e66e4);}},{envNames:_0x431bc7,activeEnv:_0x50471c}=await _0x38a429['RWneY'](getEnvNames),_0x3d8303=getRangerDir();if(!_0x38a429[_0x56cc34(0xd6)](existsSync,_0x3d8303))return{'envs':[],'activeEnv':null};const _0x407a2b=_0x431bc7['map'](_0x321cf9=>{const _0x3f72f6=_0x56cc34,_0x94111f=getEnvDir(_0x321cf9),_0x54b4cb=_0x38a429['tgoVY'](join,_0x94111f,_0x38a429[_0x3f72f6(0xdc)]),_0x2b3cce=join(_0x94111f,'auth.json'),_0x2e7201=join(_0x94111f,'auth.json.enc');return{'name':_0x321cf9,'settingsPath':existsSync(_0x54b4cb)?_0x54b4cb:_0x3f72f6(0xb8),'hasPlaintextAuth':existsSync(_0x2b3cce),'hasEncryptedAuth':_0x38a429[_0x3f72f6(0xe0)](existsSync,_0x2e7201),'isActive':_0x321cf9===_0x50471c};});return{'envs':_0x407a2b,'activeEnv':_0x50471c};}function _0x2071(_0x2d704d,_0xb05d23){_0x2d704d=_0x2d704d-0x90;const _0x4540bf=_0x4540();let _0x2071ce=_0x4540bf[_0x2d704d];return _0x2071ce;}export async function status(){const _0x4e006e=_0x3f97d0,_0x56acc0={'LTIKb':'\x0a📊\x20Ranger\x20Status\x0a','Fmdso':function(_0x44c999){return _0x44c999();},'FgxbW':function(_0x4c6ad4,_0x458cf3,_0x43c2c5){return _0x4c6ad4(_0x458cf3,_0x43c2c5);},'TQnLm':function(_0x3f8c03,_0x1c1251){return _0x3f8c03(_0x1c1251);},'UNynb':function(_0x246e62){return _0x246e62();},'hLlbE':function(_0x3cec6,_0x454572){return _0x3cec6!==_0x454572;},'YSTFn':function(_0x588109,_0x25a0c3){return _0x588109(_0x25a0c3);},'SAEVQ':function(_0x372ab4){return _0x372ab4();},'MIWHr':function(_0x4d0641,_0x276c){return _0x4d0641===_0x276c;},'BsnVu':_0x4e006e(0x9c),'tUEmd':function(_0x11d685,_0x314cd4){return _0x11d685===_0x314cd4;},'ukRqz':_0x4e006e(0xaa),'UKZGt':'\x20\x20Run:\x20ranger\x20setup\x20--opencode','JVCGj':'\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','DijFU':function(_0x4ca430,_0x111f81){return _0x4ca430(_0x111f81);},'jVzlW':'ranger@trailhead','LjZCS':_0x4e006e(0xcc),'pNOJn':'\x20\x20Not\x20installed','MuYpr':_0x4e006e(0xb9),'AIrJp':function(_0x630ec1,_0x5e2c43){return _0x630ec1+_0x5e2c43;},'xAGSA':function(_0x220b51,_0x431603){return _0x220b51>_0x431603;},'ZkOGd':'\x20\x20Project-level:','VKjjp':function(_0x2f0d18,_0x34dd9d,_0x3395d9){return _0x2f0d18(_0x34dd9d,_0x3395d9);},'aCZTG':function(_0x199f4a,_0x16069f){return _0x199f4a(_0x16069f);},'LstaY':'plaintext','EAMtu':'none'};console[_0x4e006e(0xb3)](_0x56acc0[_0x4e006e(0xe5)]);const _0x477f78=process[_0x4e006e(0xa7)](),_0x23a2c8=_0x56acc0['Fmdso'](getRangerDir);if(!existsSync(_0x23a2c8)){console[_0x4e006e(0xb3)](_0x4e006e(0x97)+_0x56acc0[_0x4e006e(0xd3)](link,_0x477f78,bold(_0x56acc0[_0x4e006e(0xb2)](basename,_0x477f78)))),console[_0x4e006e(0xb3)]('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console[_0x4e006e(0xb3)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console[_0x4e006e(0xb3)](_0x4e006e(0x97)+link(_0x477f78,bold(basename(_0x477f78))));const _0x2a599d=getCurrentVersion(),_0x36ba92=_0x56acc0[_0x4e006e(0xaf)](getLatestVersion);if(_0x36ba92['version']&&_0x56acc0['hLlbE'](_0x36ba92[_0x4e006e(0xf1)],_0x2a599d))console['log'](_0x4e006e(0x9d)+_0x2a599d+_0x4e006e(0x93)+_0x36ba92[_0x4e006e(0xf1)]+')'),console[_0x4e006e(0xb3)](_0x4e006e(0xad));else _0x36ba92[_0x4e006e(0xf1)]?console['log']('Version:\x20'+_0x2a599d+'\x20(up\x20to\x20date)'):console[_0x4e006e(0xb3)]('Version:\x20'+_0x2a599d);const _0x388bcc=await getToken();if(_0x388bcc){const _0x18ac78=await _0x56acc0['YSTFn'](getCurrentUser,_0x388bcc);_0x18ac78['success']?console[_0x4e006e(0xb3)](_0x4e006e(0xdb)+bold(_0x18ac78['user'][_0x4e006e(0xeb)])):(console['log']('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console[_0x4e006e(0xb3)]('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console['log'](_0x4e006e(0xea)),console[_0x4e006e(0xb3)]('\x20\x20Run:\x20ranger\x20setup\x20[token]');process['env']['DEBUG']&&(console[_0x4e006e(0xb3)]('API\x20Environment:\x20'+_0x56acc0['UNynb'](getCurrentEnvironment)),console['log'](_0x4e006e(0xc4)+getApiBaseUrl()));console['log'](_0x4e006e(0xcd));const _0x415b15=await _0x56acc0[_0x4e006e(0xb7)](getOpencodePluginStatus);if(_0x56acc0[_0x4e006e(0xe3)](_0x415b15['status'],_0x56acc0[_0x4e006e(0x9b)]))console[_0x4e006e(0xb3)]('\x20\x20'+bold('@ranger-testing/opencode-plugin')+_0x4e006e(0xc7)),_0x415b15[_0x4e006e(0xc1)]&&console['log']('\x20\x20'+_0x415b15[_0x4e006e(0xc1)]);else _0x56acc0[_0x4e006e(0xa9)](_0x415b15['status'],_0x56acc0['ukRqz'])?(console['log'](_0x4e006e(0xec)),_0x415b15['details']&&console[_0x4e006e(0xb3)]('\x20\x20'+_0x415b15[_0x4e006e(0xc1)]),console['log'](_0x56acc0['UKZGt'])):console[_0x4e006e(0xb3)](_0x56acc0['JVCGj']);console['log'](_0x4e006e(0x94));const _0x4af3c0=await _0x56acc0['DijFU'](getPluginInfo,_0x56acc0[_0x4e006e(0x99)]);if(_0x4af3c0){const _0xf666ad=_0x4af3c0['scope']||_0x4e006e(0xd1),_0x278f6b=_0x4af3c0[_0x4e006e(0xcc)]?_0x56acc0['LjZCS']:'disabled';console[_0x4e006e(0xb3)]('\x20\x20'+bold(_0x56acc0[_0x4e006e(0x99)])+_0x4e006e(0xbe)+_0xf666ad+',\x20'+_0x278f6b+')');}else console[_0x4e006e(0xb3)](_0x56acc0[_0x4e006e(0xd7)]),console[_0x4e006e(0xb3)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)');console['log'](_0x56acc0['MuYpr']);const {project:_0xa63413,user:_0x25a9f5}=await _0x56acc0[_0x4e006e(0xaf)](getInstalledSkills),_0x13529f=_0xa63413['filter'](_0x53b533=>RANGER_MANAGED_SKILLS['includes'](_0x53b533['name'])),_0x7805bb=_0x25a9f5['filter'](_0x2b6ae0=>RANGER_MANAGED_SKILLS['includes'](_0x2b6ae0[_0x4e006e(0xbc)])),_0x495e8c=_0x56acc0[_0x4e006e(0xf0)](_0x13529f[_0x4e006e(0xa5)],_0x7805bb['length']);if(_0x495e8c===0x0)console[_0x4e006e(0xb3)]('No\x20skills\x20installed'),console['log']('\x20\x20Run:\x20ranger\x20skillup');else{if(_0x56acc0['xAGSA'](_0x13529f['length'],0x0)){console['log'](_0x56acc0[_0x4e006e(0xc8)]);for(const _0x13fbdf of _0x13529f){console['log']('\x20\x20\x20\x20'+bold(_0x13fbdf['displayName'])+':\x20'+_0x56acc0['VKjjp'](link,_0x13fbdf['path'],_0x56acc0[_0x4e006e(0xb2)](basename,_0x13fbdf[_0x4e006e(0xbd)])));}}if(_0x56acc0[_0x4e006e(0xac)](_0x7805bb[_0x4e006e(0xa5)],0x0)){console[_0x4e006e(0xb3)](_0x4e006e(0xd4));for(const _0x184e68 of _0x7805bb){console['log'](_0x4e006e(0xda)+_0x56acc0[_0x4e006e(0xef)](bold,_0x184e68[_0x4e006e(0xb0)])+':\x20'+link(_0x184e68['path'],basename(_0x184e68[_0x4e006e(0xbd)])));}}}console['log'](_0x4e006e(0xcb));const {envs:_0x1182c9,activeEnv:_0x10b812}=await getEnvironments();if(_0x1182c9['length']===0x0)console[_0x4e006e(0xb3)](_0x4e006e(0xc3)),console['log'](_0x4e006e(0xe9));else{for(const _0x2c4a8f of _0x1182c9){const _0x4dbe9c=_0x2c4a8f[_0x4e006e(0xe7)]?'\x20(active)':'',_0x1401b8=_0x2c4a8f['hasEncryptedAuth']?_0x4e006e(0xbb):_0x2c4a8f[_0x4e006e(0xc6)]?_0x56acc0[_0x4e006e(0xc5)]:_0x56acc0['EAMtu'];console['log']('\x20\x20'+_0x56acc0['TQnLm'](bold,_0x2c4a8f['name'])+_0x4dbe9c),console[_0x4e006e(0xb3)]('\x20\x20\x20\x20Auth:\x20'+_0x1401b8),_0x2c4a8f['settingsPath']!==_0x4e006e(0xb8)&&console['log']('\x20\x20\x20\x20Settings:\x20'+link(_0x2c4a8f[_0x4e006e(0x9e)],basename(_0x2c4a8f[_0x4e006e(0x9e)])));}!_0x10b812&&(console[_0x4e006e(0xb3)]('\x0a\x20\x20No\x20active\x20profile\x20set'),console['log'](_0x4e006e(0xa1)+_0x1182c9[_0x4e006e(0xed)](_0x3701f0=>_0x3701f0[_0x4e006e(0xbc)])['join'](',\x20')+')'));}console['log']('');}
|
package/build/commands/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1fd0e8,_0x55e825){const _0x3b7b01=_0x50d1,_0x507540=_0x1fd0e8();while(!![]){try{const _0x50b6bf=parseInt(_0x3b7b01(0xfd))/0x1*(parseInt(_0x3b7b01(0x101))/0x2)+-parseInt(_0x3b7b01(0x11c))/0x3+-parseInt(_0x3b7b01(0xfb))/0x4*(-parseInt(_0x3b7b01(0x117))/0x5)+parseInt(_0x3b7b01(0xf9))/0x6+-parseInt(_0x3b7b01(0xde))/0x7+-parseInt(_0x3b7b01(0xd3))/0x8*(-parseInt(_0x3b7b01(0xce))/0x9)+-parseInt(_0x3b7b01(0x10e))/0xa;if(_0x50b6bf===_0x55e825)break;else _0x507540['push'](_0x507540['shift']());}catch(_0x45d672){_0x507540['push'](_0x507540['shift']());}}}(_0x4366,0x66e08));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';function _0x50d1(_0x397c84,_0x15f4af){_0x397c84=_0x397c84-0xcc;const _0x43660b=_0x4366();let _0x50d1ce=_0x43660b[_0x397c84];return _0x50d1ce;}import{migrateActiveProfileFile}from'./utils/activeProfile.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getPluginInfo,isMarketplaceAdded,isPluginInstalled}from'./utils/claudePlugin.js';const CLAUDE_COMMAND_TIMEOUT_MS=0x1d4c0;async function runCommand(_0x53157b,_0x5ab7ea,_0x1e00fe){const _0x4e6800=_0x50d1,_0x34917f={'YtVXu':function(_0xf35fa9,_0x485bcd){return _0xf35fa9(_0x485bcd);},'DuotK':function(_0x53e77c,_0x1de110,_0x53e435,_0x4ff3fa){return _0x53e77c(_0x1de110,_0x53e435,_0x4ff3fa);},'mZKpr':function(_0x334818,_0xb2a188){return _0x334818===_0xb2a188;},'SOxdC':_0x4e6800(0xe7)};return new Promise(_0x134e99=>{const _0x267470=_0x4e6800,_0x370d90={'QKopv':function(_0x5251ac,_0x5a1326){return _0x5251ac(_0x5a1326);},'siKKg':function(_0x14ff30,_0x41a497){const _0x784235=_0x50d1;return _0x34917f[_0x784235(0x110)](_0x14ff30,_0x41a497);}};let _0x1da3e7=![],_0x2583b9;const _0x28d7f0=_0x187292=>{if(_0x1da3e7)return;_0x1da3e7=!![],_0x2583b9&&_0x370d90['QKopv'](clearTimeout,_0x2583b9),_0x134e99(_0x187292);},_0x3ad3c6=_0x34917f['DuotK'](spawn,_0x53157b,_0x5ab7ea,{'stdio':['ignore',_0x1e00fe?.['stdio']??_0x267470(0xee),_0x1e00fe?.[_0x267470(0x11a)]??_0x267470(0xee)],'shell':_0x34917f[_0x267470(0xda)](process[_0x267470(0xe3)],_0x267470(0xeb))});_0x2583b9=_0x1e00fe?.['timeoutMs']?setTimeout(()=>{const _0x1f335a=_0x267470;_0x3ad3c6['kill'](),_0x3ad3c6[_0x1f335a(0xcf)](),_0x370d90[_0x1f335a(0xf1)](_0x28d7f0,![]);},_0x1e00fe[_0x267470(0x11b)]):undefined,_0x3ad3c6['on']('close',_0x2468f8=>{_0x28d7f0(_0x2468f8===0x0);}),_0x3ad3c6['on'](_0x34917f['SOxdC'],()=>{_0x370d90['siKKg'](_0x28d7f0,![]);});});}function _0x4366(){const _0x201741=['\x20scope\x20(timed\x20out,\x20failed\x20to\x20start,\x20or\x20exited\x20with\x20a\x20non-zero\x20status).','trim','24oOXbcG','nPVDe','ceLcn','marketplace','split','wskVf','opencode','mZKpr','npm','\x0aCurrent\x20version:\x20','user','674359YFfWaZ','Attempting\x20install\x20anyway...','OclIX','fugzy','Claude\x20marketplace\x20update\x20command\x20failed\x20(timed\x20out,\x20failed\x20to\x20start,\x20or\x20exited\x20with\x20a\x20non-zero\x20status).','platform','ONugC','dqNXJ','UrrAY','error','wdtzh','jzGYg','bCKmn','win32','sEzsM','log','inherit','LtSpT','yldCE','QKopv','RvlvV','XPspI','trailhead','ranger@trailhead','project','\x20skill\x20','findIndex','4387752nXCsfL','claude','865736pzjQOQ','Naldc','107aRuPnJ','Update\x20failed.','.gitignore','Update\x20failed:\x20','11022wypNrH','\x0aReinstalling\x20','utf-8','dLeAq','active-profile.txt','Claude\x20plugin\x20update\x20failed\x20for\x20','\x0aClaude\x20plugin\x20updated\x20(user\x20scope).','YcErp','PVoEN','\x0aClaude\x20marketplace\x20updated\x20(trailhead).','some','qRCpV','PYhQP','6498810FQHFsC','push','YtVXu','deNlQ','update','--scope','@latest...\x0a','version','qMDMH','10uzkPZR','FaGuX','@latest','stdio','timeoutMs','1989402fAfbjj','\x20\x20Failed\x20to\x20reinstall\x20',')\x20is\x20newer\x20than\x20the\x20published\x20version\x20(','230697RAzZBG','unref','splice'];_0x4366=function(){return _0x201741;};return _0x4366();}async function runInstall(){const _0x8096f1=_0x50d1,_0xcdbb8={'ONugC':function(_0x168d49,_0x367fc2){return _0x168d49===_0x367fc2;},'deNlQ':function(_0x188ab1,_0x458557,_0x14f0a5,_0x3d789f){return _0x188ab1(_0x458557,_0x14f0a5,_0x3d789f);},'OclIX':_0x8096f1(0xdb),'xgPAh':'install','VzKGX':'ignore','RvlvV':'inherit'};return new Promise(_0x14f299=>{const _0x2771d3=_0x8096f1,_0x85aaf0={'VekYO':function(_0x4772f5,_0x1487a1){return _0xcdbb8['ONugC'](_0x4772f5,_0x1487a1);}};console[_0x2771d3(0xed)]('\x0aInstalling\x20'+PACKAGE_NAME+_0x2771d3(0x114));const _0x4aff16=_0xcdbb8[_0x2771d3(0x111)](spawn,_0xcdbb8[_0x2771d3(0xe0)],[_0xcdbb8['xgPAh'],'-g',PACKAGE_NAME+_0x2771d3(0x119)],{'stdio':[_0xcdbb8['VzKGX'],'inherit',_0xcdbb8[_0x2771d3(0xf2)]],'shell':_0xcdbb8[_0x2771d3(0xe4)](process[_0x2771d3(0xe3)],'win32')});_0x4aff16['on']('close',_0x14093e=>{_0x14f299(_0x85aaf0['VekYO'](_0x14093e,0x0));}),_0x4aff16['on'](_0x2771d3(0xe7),()=>{_0x14f299(![]);});});}async function updateClaudeMarketplace(){const _0xec5d43=_0x50d1,_0x18ef90={'qMDMH':'plugin','fugzy':_0xec5d43(0x112)},_0xe28253=await runCommand('claude',[_0x18ef90[_0xec5d43(0x116)],_0xec5d43(0xd6),_0x18ef90[_0xec5d43(0xe1)],_0xec5d43(0xf4)],{'timeoutMs':CLAUDE_COMMAND_TIMEOUT_MS});if(!_0xe28253)throw new Error(_0xec5d43(0xe2));}async function updateClaudePlugin(_0x1ac9af){const _0x5a3171=_0x50d1,_0x3f1ec7={'PVoEN':'plugin','PYhQP':'ranger@trailhead','FymCy':function(_0x337840,_0x891e30){return _0x337840??_0x891e30;},'wskVf':_0x5a3171(0xdd)},_0x5cde31=[_0x3f1ec7[_0x5a3171(0x109)],_0x5a3171(0x112),_0x3f1ec7[_0x5a3171(0x10d)]];_0x1ac9af&&_0x5cde31[_0x5a3171(0x10f)](_0x5a3171(0x113),_0x1ac9af);const _0x2bcc8e=await runCommand('claude',_0x5cde31,{'timeoutMs':CLAUDE_COMMAND_TIMEOUT_MS});if(!_0x2bcc8e){const _0x44553c=_0x3f1ec7['FymCy'](_0x1ac9af,_0x3f1ec7[_0x5a3171(0xd8)]);throw new Error(_0x5a3171(0x106)+_0x44553c+_0x5a3171(0xd1));}}function isSkillInstalled(_0x1b6065,_0x4ad8b9,_0x401ede){const _0x1901d7=_0x50d1,_0x1b1c13={'bCKmn':function(_0x505bc1,_0x1b3f08){return _0x505bc1(_0x1b3f08);},'ceLcn':function(_0x58b245,_0x544997,_0x3e719b){return _0x58b245(_0x544997,_0x3e719b);}},_0x3c5e41=_0x401ede===_0x1901d7(0xd9)?getOpencodeSkillsDir(_0x4ad8b9):_0x1b1c13[_0x1901d7(0xea)](getSkillsDir,_0x4ad8b9),_0x49ec12=_0x1b1c13[_0x1901d7(0xd5)](join,_0x3c5e41,_0x1b6065);return existsSync(_0x49ec12);}async function reinstallSkills(_0x2055a7){const _0x554bda=_0x50d1,_0x212638={'FeEFP':_0x554bda(0xdd),'LtSpT':function(_0x3e1d48,_0x1f9c6f,_0x2991f5,_0x331ba6){return _0x3e1d48(_0x1f9c6f,_0x2991f5,_0x331ba6);},'FaGuX':_0x554bda(0xfa),'dqNXJ':'opencode','zXZXt':function(_0x31ef25,_0x4a19b4,_0x1bfdd3){return _0x31ef25(_0x4a19b4,_0x1bfdd3);}},_0x103318=['project',_0x212638['FeEFP']],_0x1e28cf=[];for(const _0x2a4759 of _0x103318){for(const _0x1e41b9 of RANGER_MANAGED_SKILLS){_0x212638[_0x554bda(0xef)](isSkillInstalled,_0x1e41b9,_0x2a4759,_0x212638[_0x554bda(0x118)])&&_0x1e28cf[_0x554bda(0x10f)]({'skillName':_0x1e41b9,'level':_0x2a4759,'platform':_0x212638['FaGuX']}),_0x212638['LtSpT'](isSkillInstalled,_0x1e41b9,_0x2a4759,_0x212638['dqNXJ'])&&_0x1e28cf[_0x554bda(0x10f)]({'skillName':_0x1e41b9,'level':_0x2a4759,'platform':_0x212638[_0x554bda(0xe5)]});}}for(const _0x11d6d6 of _0x103318){for(const _0x4617ef of DEPRECATED_SKILLS){await _0x212638['zXZXt'](removeSkill,_0x4617ef,_0x11d6d6);}}if(_0x1e28cf['length']===0x0){console[_0x554bda(0xed)]('\x0aNo\x20ranger-managed\x20skills\x20found\x20to\x20reinstall.');return;}console['log'](_0x554bda(0x102)+_0x1e28cf['length']+'\x20ranger-managed\x20skill(s)...');for(const {skillName:_0x55f4e6,level:_0x58e548,platform:_0x4edbf9}of _0x1e28cf){try{await installSkill(_0x55f4e6,{'level':_0x58e548,'cliVersion':_0x2055a7,'platform':_0x4edbf9});}catch(_0x315141){console['warn'](_0x554bda(0xcc)+_0x4edbf9+'\x20'+_0x58e548+_0x554bda(0xf7)+_0x55f4e6+':',_0x315141);}}}async function ensureActiveProfileGitignored(){const _0x233403=_0x50d1,_0x2a479b={'hDnDB':function(_0x361d72){return _0x361d72();},'jgeRz':_0x233403(0xff),'dLeAq':function(_0x5cecae,_0x5a0f90){return _0x5cecae(_0x5a0f90);},'Naldc':function(_0x20065c,_0x5c7d10,_0x3ba0fd){return _0x20065c(_0x5c7d10,_0x3ba0fd);},'qxhvZ':_0x233403(0x103),'NHqjB':function(_0x5c39fa,_0x28c0ee){return _0x5c39fa===_0x28c0ee;},'Ubfea':function(_0x52e5ae,_0x5a4700,_0x44f633,_0x409525){return _0x52e5ae(_0x5a4700,_0x44f633,_0x409525);}},_0x1fd183=join(_0x2a479b['hDnDB'](getRangerDir),_0x2a479b['jgeRz']);if(!_0x2a479b[_0x233403(0x104)](existsSync,_0x1fd183))return![];let _0x1c08ea='';try{_0x1c08ea=await _0x2a479b[_0x233403(0xfc)](readFile,_0x1fd183,_0x2a479b['qxhvZ']);}catch{return![];}const _0x5d1959=_0x1c08ea[_0x233403(0xd7)](/\r?\n/);if(_0x5d1959[_0x233403(0x10b)](_0x16e968=>_0x16e968['trim']()===_0x233403(0x105)))return![];let _0x2ba6bb=_0x5d1959[_0x233403(0xf8)](_0x5370a9=>_0x5370a9[_0x233403(0xd2)]()==='active-feature.txt');_0x2a479b['NHqjB'](_0x2ba6bb,-0x1)&&(_0x2ba6bb=_0x5d1959['length']);_0x5d1959[_0x233403(0xd0)](_0x2ba6bb,0x0,'active-profile.txt');let _0x20294b=_0x5d1959['join']('\x0a');!_0x20294b['endsWith']('\x0a')&&(_0x20294b+='\x0a');try{await _0x2a479b['Ubfea'](writeFile,_0x1fd183,_0x20294b,'utf-8');}catch{return![];}return!![];}export async function update(){const _0xdaccdf=_0x50d1,_0x37746a={'YDvrS':function(_0x5eaef7){return _0x5eaef7();},'YcErp':function(_0x368d82){return _0x368d82();},'qRCpV':'\x0aSuccessfully\x20installed\x20latest\x20version.','UfsXx':function(_0x4baf0f,_0x17089e,_0x306704){return _0x4baf0f(_0x17089e,_0x306704);},'hBLtU':function(_0x23f3ce,_0x3f2734){return _0x23f3ce===_0x3f2734;},'trpji':'\x0aYou\x20are\x20already\x20on\x20the\x20latest\x20version.','wdtzh':function(_0x3c4a5b){return _0x3c4a5b();},'UrrAY':_0xdaccdf(0xfe),'XPspI':function(_0x165420,_0x5bff88){return _0x165420(_0x5bff88);},'yldCE':'trailhead','nPVDe':_0xdaccdf(0x10a),'sEzsM':function(_0x56fd81,_0x405861){return _0x56fd81(_0x405861);},'jzGYg':function(_0x4d5d2e,_0x542099){return _0x4d5d2e(_0x542099);}},_0x32c39f=getCurrentVersion();console['log'](_0xdaccdf(0xdc)+_0x32c39f),console['log']('Checking\x20for\x20updates...');const _0x1bff84=_0x37746a['YDvrS'](getLatestVersion);let _0x14703b=_0x32c39f;if(!_0x1bff84[_0xdaccdf(0x115)]){console['warn']('\x0aCould\x20not\x20check\x20latest\x20version:\x20'+_0x1bff84['error']),console[_0xdaccdf(0xed)](_0xdaccdf(0xdf));const _0x1a2e1b=await _0x37746a[_0xdaccdf(0x108)](runInstall);if(_0x1a2e1b)console['log'](_0x37746a[_0xdaccdf(0x10c)]),_0x14703b=getCurrentVersion();else throw new Error(_0xdaccdf(0x100)+_0x1bff84[_0xdaccdf(0xe7)]);}else{const _0x1395ad=_0x1bff84['version'];console[_0xdaccdf(0xed)]('Latest\x20version:\x20\x20'+_0x1395ad);const _0x21a3b3=_0x37746a['UfsXx'](compareVersions,_0x32c39f,_0x1395ad);if(_0x37746a['hBLtU'](_0x21a3b3,0x0))console[_0xdaccdf(0xed)](_0x37746a['trpji']);else{if(_0x21a3b3<0x0)console['log']('\x0aYour\x20version\x20('+_0x32c39f+_0xdaccdf(0xcd)+_0x1395ad+').');else{const _0x5e7677=await _0x37746a[_0xdaccdf(0xe8)](runInstall);if(_0x5e7677)console[_0xdaccdf(0xed)]('\x0aSuccessfully\x20updated\x20to\x20version\x20'+_0x1395ad),_0x14703b=_0x1395ad;else throw new Error(_0x37746a[_0xdaccdf(0xe6)]);}}}await _0x37746a[_0xdaccdf(0xf3)](reinstallSkills,_0x14703b);const _0x537ac3=await isMarketplaceAdded(_0x37746a[_0xdaccdf(0xf0)]),_0x4a9842=await _0x37746a['XPspI'](isPluginInstalled,'ranger@trailhead');_0x537ac3&&(await updateClaudeMarketplace(),console['log'](_0x37746a[_0xdaccdf(0xd4)]));if(_0x4a9842){const _0x782081=await _0x37746a[_0xdaccdf(0xec)](getPluginInfo,_0xdaccdf(0xf5));_0x37746a['hBLtU'](_0x782081?.['scope'],'project')?(await _0x37746a[_0xdaccdf(0xe9)](updateClaudePlugin,_0xdaccdf(0xf6)),console['log']('\x0aClaude\x20plugin\x20updated\x20(project\x20scope).')):(await _0x37746a[_0xdaccdf(0x108)](updateClaudePlugin),console['log'](_0xdaccdf(0x107)));}const _0x13f675=await _0x37746a['YDvrS'](migrateActiveProfileFile);_0x13f675&&console[_0xdaccdf(0xed)]('✓\x20Migrated\x20active\x20profile\x20file');const _0x4d9f91=await _0x37746a['YcErp'](ensureActiveProfileGitignored);console[_0xdaccdf(0xed)]('\x0a✅\x20Update\x20complete!');}
|
|
1
|
+
(function(_0x408da2,_0x5ee673){const _0x3aec71=_0x9df0,_0x2cb1b1=_0x408da2();while(!![]){try{const _0x42ac3b=-parseInt(_0x3aec71(0xc6))/0x1+-parseInt(_0x3aec71(0xc3))/0x2+-parseInt(_0x3aec71(0x95))/0x3+parseInt(_0x3aec71(0xc0))/0x4*(-parseInt(_0x3aec71(0xa2))/0x5)+parseInt(_0x3aec71(0xbe))/0x6*(-parseInt(_0x3aec71(0xaa))/0x7)+-parseInt(_0x3aec71(0x9c))/0x8+parseInt(_0x3aec71(0xad))/0x9;if(_0x42ac3b===_0x5ee673)break;else _0x2cb1b1['push'](_0x2cb1b1['shift']());}catch(_0x51b91d){_0x2cb1b1['push'](_0x2cb1b1['shift']());}}}(_0x120a,0x41272));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 _0x9df0(_0x3ab143,_0x140ec6){_0x3ab143=_0x3ab143-0x91;const _0x120a86=_0x120a();let _0x9df062=_0x120a86[_0x3ab143];return _0x9df062;}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';function _0x120a(){const _0x2f68df=['inherit','yYNOY','MGvki','Update\x20failed:\x20','trailhead','SeGiR','ZLyzE','wnNFd','push','update','zRLrU','\x0aClaude\x20plugin\x20updated\x20(project\x20scope).','splice','RzFYl','2406oRUgiK','\x0aClaude\x20marketplace\x20updated\x20(trailhead).','631508WaeIBn','ZQBrx','scope','591520koPgyw','JIfrD','tWfYk','142520VdGuxA','nTKkG','platform','project','error','Dvndd','oLLaU','timeoutMs','ebPBY','\x0aSuccessfully\x20updated\x20to\x20version\x20','DRdvR','GCqmi','RTbFB','\x20\x20Failed\x20to\x20reinstall\x20','\x20skill\x20','warn','1285311oeAIex','ZKIEf','@latest','plugin','fAjDz','ignore','stdio','356976AiqHqm','log','\x0aCould\x20not\x20check\x20latest\x20version:\x20','trim','claude','npm','5pXIpOA','XESlv','cJHOP','VQlYB','OLNLx','INmHy','--scope','\x20scope\x20(timed\x20out,\x20failed\x20to\x20start,\x20or\x20exited\x20with\x20a\x20non-zero\x20status).','287xcLhik','close',')\x20is\x20newer\x20than\x20the\x20published\x20version\x20(','12172707qmPYvO','IobEW','kill'];_0x120a=function(){return _0x2f68df;};return _0x120a();}import{migrateActiveProfileFile}from'./utils/activeProfile.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getPluginInfo,isMarketplaceAdded,isPluginInstalled}from'./utils/claudePlugin.js';const CLAUDE_COMMAND_TIMEOUT_MS=0x1d4c0;async function runCommand(_0x1e711c,_0x1568c3,_0x5bcbfb){const _0x2ebeed=_0x9df0,_0x168565={'XOIJa':function(_0xf3a837,_0x5ed38a){return _0xf3a837(_0x5ed38a);},'NGOgk':function(_0x59ba43,_0xd05a6d){return _0x59ba43(_0xd05a6d);},'ebPBY':function(_0xff8614,_0x217ea1){return _0xff8614===_0x217ea1;},'DRdvR':function(_0x3408ed,_0x41a551,_0x3d5f6f,_0x510b9d){return _0x3408ed(_0x41a551,_0x3d5f6f,_0x510b9d);},'tWRIM':_0x2ebeed(0xb0),'MGvki':function(_0x10b54a,_0x3d181a){return _0x10b54a===_0x3d181a;},'QmYUA':function(_0x33ae1c,_0x3ec17a,_0x4548a9){return _0x33ae1c(_0x3ec17a,_0x4548a9);},'LYEnV':_0x2ebeed(0xab),'ZQBrx':_0x2ebeed(0xca)};return new Promise(_0x2f8090=>{const _0x3f9471=_0x2ebeed;let _0x48cb2b=![],_0x559b51;const _0x4a27bf=_0x20acbf=>{if(_0x48cb2b)return;_0x48cb2b=!![],_0x559b51&&clearTimeout(_0x559b51),_0x168565['XOIJa'](_0x2f8090,_0x20acbf);},_0x25a128=_0x168565[_0x3f9471(0xd0)](spawn,_0x1e711c,_0x1568c3,{'stdio':[_0x3f9471(0x9a),_0x5bcbfb?.['stdio']??_0x3f9471(0xb0),_0x5bcbfb?.[_0x3f9471(0x9b)]??_0x168565['tWRIM']],'shell':_0x168565[_0x3f9471(0xb2)](process[_0x3f9471(0xc8)],'win32')});_0x559b51=_0x5bcbfb?.[_0x3f9471(0xcd)]?_0x168565['QmYUA'](setTimeout,()=>{const _0x3be474=_0x3f9471;_0x25a128[_0x3be474(0xaf)](),_0x25a128['unref'](),_0x4a27bf(![]);},_0x5bcbfb['timeoutMs']):undefined,_0x25a128['on'](_0x168565['LYEnV'],_0x5db815=>{const _0x32f780=_0x3f9471;_0x168565['NGOgk'](_0x4a27bf,_0x168565[_0x32f780(0xce)](_0x5db815,0x0));}),_0x25a128['on'](_0x168565[_0x3f9471(0xc1)],()=>{_0x4a27bf(![]);});});}async function runInstall(){const _0x18f7b4=_0x9df0,_0x393ee3={'czupc':_0x18f7b4(0xa1),'cJHOP':'install','RzFYl':_0x18f7b4(0xb0),'tWfYk':function(_0x2acaab,_0x5a7250){return _0x2acaab===_0x5a7250;},'yQajj':'win32','INmHy':'close'};return new Promise(_0x19827c=>{const _0x2a410a=_0x18f7b4,_0x2ffc19={'sRMIc':function(_0x53ab04,_0x4093ec){return _0x53ab04(_0x4093ec);}};console[_0x2a410a(0x9d)]('\x0aInstalling\x20'+PACKAGE_NAME+'@latest...\x0a');const _0x13d156=spawn(_0x393ee3['czupc'],[_0x393ee3[_0x2a410a(0xa4)],'-g',PACKAGE_NAME+_0x2a410a(0x97)],{'stdio':[_0x2a410a(0x9a),_0x393ee3[_0x2a410a(0xbd)],_0x2a410a(0xb0)],'shell':_0x393ee3[_0x2a410a(0xc5)](process['platform'],_0x393ee3['yQajj'])});_0x13d156['on'](_0x393ee3[_0x2a410a(0xa7)],_0x2f63a1=>{_0x19827c(_0x2f63a1===0x0);}),_0x13d156['on'](_0x2a410a(0xca),()=>{_0x2ffc19['sRMIc'](_0x19827c,![]);});});}async function updateClaudeMarketplace(){const _0x3ff419=_0x9df0,_0x327edf={'JIfrD':_0x3ff419(0xa0),'GMDMF':'marketplace','XqsMf':_0x3ff419(0xb9)},_0x68ab18=await runCommand(_0x327edf[_0x3ff419(0xc4)],[_0x3ff419(0x98),_0x327edf['GMDMF'],_0x327edf['XqsMf'],'trailhead'],{'timeoutMs':CLAUDE_COMMAND_TIMEOUT_MS});if(!_0x68ab18)throw new Error('Claude\x20marketplace\x20update\x20command\x20failed\x20(timed\x20out,\x20failed\x20to\x20start,\x20or\x20exited\x20with\x20a\x20non-zero\x20status).');}async function updateClaudePlugin(_0x33f2e2){const _0x33129c=_0x9df0,_0x439629={'QHXaQ':'ranger@trailhead','OLNLx':function(_0x3c61e6,_0x4ddb5d,_0x285579,_0x631c41){return _0x3c61e6(_0x4ddb5d,_0x285579,_0x631c41);},'NnkeV':function(_0x4d9270,_0x72e557){return _0x4d9270??_0x72e557;}},_0x16642d=['plugin',_0x33129c(0xb9),_0x439629['QHXaQ']];_0x33f2e2&&_0x16642d['push'](_0x33129c(0xa8),_0x33f2e2);const _0x23f82b=await _0x439629[_0x33129c(0xa6)](runCommand,'claude',_0x16642d,{'timeoutMs':CLAUDE_COMMAND_TIMEOUT_MS});if(!_0x23f82b){const _0x50392e=_0x439629['NnkeV'](_0x33f2e2,'user');throw new Error('Claude\x20plugin\x20update\x20failed\x20for\x20'+_0x50392e+_0x33129c(0xa9));}}function isSkillInstalled(_0x4e8c44,_0x3d0bce,_0x4dfc6c){const _0x30bfa9=_0x9df0,_0x2056ea={'ZLyzE':'opencode','IobEW':function(_0x2ae739,_0x367125){return _0x2ae739(_0x367125);}},_0x2e882f=_0x4dfc6c===_0x2056ea[_0x30bfa9(0xb6)]?getOpencodeSkillsDir(_0x3d0bce):_0x2056ea[_0x30bfa9(0xae)](getSkillsDir,_0x3d0bce),_0x49faff=join(_0x2e882f,_0x4e8c44);return existsSync(_0x49faff);}async function reinstallSkills(_0x6d3dfb){const _0x49a325=_0x9df0,_0x2e3205={'lbJZe':_0x49a325(0xc9),'SeGiR':function(_0x31c5f8,_0x4e0aeb,_0x1f3a6a,_0x19b6b1){return _0x31c5f8(_0x4e0aeb,_0x1f3a6a,_0x19b6b1);},'yYNOY':_0x49a325(0xa0),'NhbJV':'opencode','XESlv':function(_0x14fa3b,_0x53e5f4,_0x1978b4){return _0x14fa3b(_0x53e5f4,_0x1978b4);},'jjbVt':function(_0x213667,_0x4a69e3){return _0x213667===_0x4a69e3;}},_0x1173fb=[_0x2e3205['lbJZe'],'user'],_0x56f5f8=[];for(const _0x29200b of _0x1173fb){for(const _0x587c57 of RANGER_MANAGED_SKILLS){_0x2e3205[_0x49a325(0xb5)](isSkillInstalled,_0x587c57,_0x29200b,_0x2e3205['yYNOY'])&&_0x56f5f8[_0x49a325(0xb8)]({'skillName':_0x587c57,'level':_0x29200b,'platform':_0x2e3205[_0x49a325(0xb1)]}),isSkillInstalled(_0x587c57,_0x29200b,_0x2e3205['NhbJV'])&&_0x56f5f8['push']({'skillName':_0x587c57,'level':_0x29200b,'platform':_0x2e3205['NhbJV']});}}for(const _0xc456ad of _0x1173fb){for(const _0x2a9767 of DEPRECATED_SKILLS){await _0x2e3205[_0x49a325(0xa3)](removeSkill,_0x2a9767,_0xc456ad);}}if(_0x2e3205['jjbVt'](_0x56f5f8['length'],0x0)){console['log']('\x0aNo\x20ranger-managed\x20skills\x20found\x20to\x20reinstall.');return;}console['log']('\x0aReinstalling\x20'+_0x56f5f8['length']+'\x20ranger-managed\x20skill(s)...');for(const {skillName:_0x43c96f,level:_0x20f703,platform:_0x42bb4a}of _0x56f5f8){try{await _0x2e3205[_0x49a325(0xa3)](installSkill,_0x43c96f,{'level':_0x20f703,'cliVersion':_0x6d3dfb,'platform':_0x42bb4a});}catch(_0x157721){console[_0x49a325(0x94)](_0x49a325(0x92)+_0x42bb4a+'\x20'+_0x20f703+_0x49a325(0x93)+_0x43c96f+':',_0x157721);}}}async function ensureActiveProfileGitignored(){const _0x3aa3f3=_0x9df0,_0x3d9db2={'ABoSS':function(_0x5245fe,_0x547e0e,_0x4d54c2){return _0x5245fe(_0x547e0e,_0x4d54c2);},'RQsbn':function(_0x16052c,_0xc0ebcc){return _0x16052c(_0xc0ebcc);},'VQlYB':function(_0x5ef802,_0x33c01b,_0x41947d){return _0x5ef802(_0x33c01b,_0x41947d);},'uGLao':'utf-8'},_0x52036c=_0x3d9db2['ABoSS'](join,getRangerDir(),'.gitignore');if(!_0x3d9db2['RQsbn'](existsSync,_0x52036c))return![];let _0x423ab4='';try{_0x423ab4=await _0x3d9db2[_0x3aa3f3(0xa5)](readFile,_0x52036c,_0x3d9db2['uGLao']);}catch{return![];}const _0x30527f=_0x423ab4['split'](/\r?\n/);if(_0x30527f['some'](_0x18437f=>_0x18437f['trim']()==='active-profile.txt'))return![];let _0x55c45e=_0x30527f['findIndex'](_0x138a01=>_0x138a01[_0x3aa3f3(0x9f)]()==='active-feature.txt');_0x55c45e===-0x1&&(_0x55c45e=_0x30527f['length']);_0x30527f[_0x3aa3f3(0xbc)](_0x55c45e,0x0,'active-profile.txt');let _0x4fe2ce=_0x30527f['join']('\x0a');!_0x4fe2ce['endsWith']('\x0a')&&(_0x4fe2ce+='\x0a');try{await writeFile(_0x52036c,_0x4fe2ce,'utf-8');}catch{return![];}return!![];}export async function update(){const _0x51c6c5=_0x9df0,_0x398259={'ZKIEf':function(_0x3816ff){return _0x3816ff();},'AteEG':'Checking\x20for\x20updates...','Dvndd':'Attempting\x20install\x20anyway...','zRLrU':function(_0x40ca7f){return _0x40ca7f();},'cpPHz':function(_0x911eca,_0x177ee1){return _0x911eca===_0x177ee1;},'nTKkG':'Update\x20failed.','oZBlG':function(_0x4af8a8,_0x1aa09a){return _0x4af8a8(_0x1aa09a);},'wnNFd':function(_0x1750b5,_0x22b710){return _0x1750b5(_0x22b710);},'RTbFB':_0x51c6c5(0xb4),'oLLaU':_0x51c6c5(0xbf),'GCqmi':'ranger@trailhead','fAjDz':_0x51c6c5(0xc9),'xLEsW':function(_0x518ee9,_0x465565){return _0x518ee9(_0x465565);}},_0x283b27=_0x398259['ZKIEf'](getCurrentVersion);console['log']('\x0aCurrent\x20version:\x20'+_0x283b27),console['log'](_0x398259['AteEG']);const _0x38e062=getLatestVersion();let _0x389136=_0x283b27;if(!_0x38e062['version']){console[_0x51c6c5(0x94)](_0x51c6c5(0x9e)+_0x38e062[_0x51c6c5(0xca)]),console[_0x51c6c5(0x9d)](_0x398259[_0x51c6c5(0xcb)]);const _0x533a8a=await _0x398259[_0x51c6c5(0x96)](runInstall);if(_0x533a8a)console['log']('\x0aSuccessfully\x20installed\x20latest\x20version.'),_0x389136=_0x398259[_0x51c6c5(0xba)](getCurrentVersion);else throw new Error(_0x51c6c5(0xb3)+_0x38e062[_0x51c6c5(0xca)]);}else{const _0x480dea=_0x38e062['version'];console['log']('Latest\x20version:\x20\x20'+_0x480dea);const _0x599f48=compareVersions(_0x283b27,_0x480dea);if(_0x398259['cpPHz'](_0x599f48,0x0))console['log']('\x0aYou\x20are\x20already\x20on\x20the\x20latest\x20version.');else{if(_0x599f48<0x0)console['log']('\x0aYour\x20version\x20('+_0x283b27+_0x51c6c5(0xac)+_0x480dea+').');else{const _0x121d4c=await _0x398259[_0x51c6c5(0xba)](runInstall);if(_0x121d4c)console[_0x51c6c5(0x9d)](_0x51c6c5(0xcf)+_0x480dea),_0x389136=_0x480dea;else throw new Error(_0x398259[_0x51c6c5(0xc7)]);}}}await _0x398259['oZBlG'](reinstallSkills,_0x389136);const _0x81679a=await _0x398259['wnNFd'](isMarketplaceAdded,_0x398259[_0x51c6c5(0x91)]),_0x64922b=await isPluginInstalled('ranger@trailhead');_0x81679a&&(await updateClaudeMarketplace(),console['log'](_0x398259[_0x51c6c5(0xcc)]));if(_0x64922b){const _0xb10cb1=await _0x398259[_0x51c6c5(0xb7)](getPluginInfo,_0x398259[_0x51c6c5(0xd1)]);_0xb10cb1?.[_0x51c6c5(0xc2)]===_0x398259[_0x51c6c5(0x99)]?(await _0x398259['xLEsW'](updateClaudePlugin,_0x398259['fAjDz']),console['log'](_0x51c6c5(0xbb))):(await _0x398259['ZKIEf'](updateClaudePlugin),console[_0x51c6c5(0x9d)]('\x0aClaude\x20plugin\x20updated\x20(user\x20scope).'));}const _0xed4550=await migrateActiveProfileFile();_0xed4550&&console[_0x51c6c5(0x9d)]('✓\x20Migrated\x20active\x20profile\x20file');const _0x53d7dd=await ensureActiveProfileGitignored();console['log']('\x0a✅\x20Update\x20complete!');}
|