@ranger-testing/ranger-cli 2.5.2 → 2.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/setup/claude.js +1 -1
- package/build/commands/setup/opencode.js +1 -1
- package/build/commands/setupCi.js +1 -1
- package/build/commands/skillup.js +1 -1
- package/build/commands/start.js +1 -1
- package/build/commands/status.js +1 -1
- package/build/commands/update.js +1 -1
- package/build/commands/updateEnv.js +1 -1
- package/build/commands/useEnv.js +1 -1
- package/build/commands/utils/activeProfile.js +1 -1
- package/build/commands/utils/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/opencodeConfig.js +1 -1
- package/build/commands/utils/playwrightCli.js +1 -1
- package/build/commands/utils/profileMessages.js +1 -1
- package/build/commands/utils/profileSetupBanner.js +1 -1
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/retry.js +1 -1
- package/build/commands/utils/sessionCache.js +1 -1
- package/build/commands/utils/settings.js +1 -1
- package/build/commands/utils/skillContent.js +1 -1
- package/build/commands/utils/skills.js +1 -1
- package/build/commands/utils/stitchWebmFiles.js +1 -1
- package/build/commands/utils/telemetry.js +1 -1
- package/build/commands/utils/tokenRefresh.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -1
- package/build/commands/utils/userApi.js +1 -1
- package/build/commands/utils/version.js +1 -1
- package/build/commands/verifyFeature.js +1 -1
- package/build/commands/verifyFeatureCli.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
(function(_0x44d4a8,_0xdd9ab6){const _0x5c7f67=_0x54f7,_0x1b2bd0=_0x44d4a8();while(!![]){try{const _0xdaeb93=-parseInt(_0x5c7f67(0xfa))/0x1*(-parseInt(_0x5c7f67(0xfe))/0x2)+-parseInt(_0x5c7f67(0xf9))/0x3*(-parseInt(_0x5c7f67(0x101))/0x4)+parseInt(_0x5c7f67(0xff))/0x5*(parseInt(_0x5c7f67(0xfc))/0x6)+-parseInt(_0x5c7f67(0x100))/0x7*(-parseInt(_0x5c7f67(0xfd))/0x8)+-parseInt(_0x5c7f67(0x103))/0x9*(parseInt(_0x5c7f67(0x105))/0xa)+parseInt(_0x5c7f67(0x106))/0xb+parseInt(_0x5c7f67(0x104))/0xc*(-parseInt(_0x5c7f67(0x102))/0xd);if(_0xdaeb93===_0xdd9ab6)break;else _0x1b2bd0['push'](_0x1b2bd0['shift']());}catch(_0x30cd48){_0x1b2bd0['push'](_0x1b2bd0['shift']());}}}(_0x4fa0,0x23345));function _0x54f7(_0x351a36,_0x5a7a9f){_0x351a36=_0x351a36-0xf9;const _0x4fa0f0=_0x4fa0();let _0x54f750=_0x4fa0f0[_0x351a36];return _0x54f750;}import{printBlock,getEnabledSessionId}from'./output.js';export async function planStart(_0x1ae217){const _0x26d248=_0x54f7,_0xbf9447={'zYCXu':function(_0x4f759e,_0x478a84){return _0x4f759e(_0x478a84);}},_0x3b4d1c=await _0xbf9447['zYCXu'](getEnabledSessionId,_0x1ae217);if(!_0x3b4d1c)return;printBlock(_0x26d248(0xfb));}function _0x4fa0(){const _0x1cb810=['1uBlmeB','===\x20RANGER:\x20ACTION\x20REQUIRED\x20===\x0a\x0aIf\x20this\x20plan\x20involves\x20UI\x20changes,\x20you\x20MUST:\x0a\x0a1.\x20**READ\x20/ranger\x20skill**\x20-\x20specifically\x20create.md\x0a2.\x20**Add\x20a\x20Ranger\x20Feature\x20Review\x20Specification**\x20at\x20the\x20end\x20of\x20your\x20plan\x0a\x0aScenarios\x20are\x20E2E\x20test\x20flows,\x20NOT\x20implementation\x20tasks.\x0a\x0a**Good:**\x20\x22User\x20can\x20log\x20in\x20with\x20valid\x20credentials\x20and\x20see\x20dashboard\x22\x0a**Bad:**\x20\x22Add\x20form\x20validation\x22\x20or\x20\x22Button\x20is\x20visible\x22\x0a\x0aAfter\x20planning,\x20run:\x0a`ranger\x20create\x20\x22<name>\x22\x20-d\x20\x22<desc>\x22\x20-c\x20\x22<E2E\x20flow\x201>\x22\x20-c\x20\x22<E2E\x20flow\x202>\x22`\x0a\x0a===\x20END\x20===','138PMUjOA','191752Ubglup','348546GDaWwE','8965AanTTn','35MAuCVl','4qLFHeR','13KAkvUm','9xFUDJl','4224168KCAExs','2028940uIdEIo','2098030DhaEwC','519054UcPCae'];_0x4fa0=function(){return _0x1cb810;};return _0x4fa0();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x32a9(){const _0x591e7f=['1593972ISfPfZ','RANGER:\x20If\x20this\x20is\x20for\x20a\x20UI\x20feature,\x20you\x20MUST\x20use\x20/ranger\x20to\x20either\x20create\x20a\x20new\x20feature\x20review\x20or\x20resume\x20an\x20existing\x20one.','250404kIABLE','244914AZsZTA','stringify','log','2225562oxGBOB','9rmqWyx','16OPpjpO','75ueoBBM','2543031vCPbKc','yKnyD','30xgihCe','11171215eZoYzr','49746nNwsvm'];_0x32a9=function(){return _0x591e7f;};return _0x32a9();}(function(_0xa3d9d4,_0x5071f7){const _0x998949=_0x5481,_0x4aa946=_0xa3d9d4();while(!![]){try{const _0xff167=parseInt(_0x998949(0x137))/0x1*(-parseInt(_0x998949(0x12f))/0x2)+-parseInt(_0x998949(0x136))/0x3+-parseInt(_0x998949(0x130))/0x4+parseInt(_0x998949(0x12a))/0x5*(-parseInt(_0x998949(0x133))/0x6)+parseInt(_0x998949(0x132))/0x7+-parseInt(_0x998949(0x138))/0x8*(parseInt(_0x998949(0x12b))/0x9)+parseInt(_0x998949(0x12d))/0xa*(parseInt(_0x998949(0x12e))/0xb);if(_0xff167===_0x5071f7)break;else _0x4aa946['push'](_0x4aa946['shift']());}catch(_0x1be57c){_0x4aa946['push'](_0x4aa946['shift']());}}}(_0x32a9,0x840bc));import{getSessionEntry,updateBranchTracking}from'../utils/sessionCache.js';import{getToken}from'../utils/keychain.js';import{getEnabledSessionId}from'./output.js';function _0x5481(_0x4a621d,_0x309132){_0x4a621d=_0x4a621d-0x12a;const _0x32a948=_0x32a9();let _0x54814b=_0x32a948[_0x4a621d];return _0x54814b;}export async function postEdit(_0x51908c){const _0x10ee4a=_0x5481,_0x49155f={'yKnyD':function(_0x49a2dd,_0x3f4de3){return _0x49a2dd(_0x3f4de3);},'LvNwu':'PostToolUse'},_0x27dc9d=await getEnabledSessionId(_0x51908c);if(!_0x27dc9d)return;_0x49155f[_0x10ee4a(0x12c)](updateBranchTracking,_0x27dc9d);const _0x53b22c=await getToken();if(!_0x53b22c)return;const _0x230e97=getSessionEntry(_0x27dc9d);if(_0x230e97){const _0x3d1a9e={'hookSpecificOutput':{'hookEventName':'PostToolUse','additionalContext':'RANGER:\x20If\x20this\x20change\x20expands\x20the\x20scope\x20of\x20the\x20active\x20feature\x20review,\x20you\x20may\x20need\x20to\x20add\x20a\x20scenario.\x20See\x20Workflow\x201\x20in\x20/ranger.\x20If\x20you\x20decide\x20to\x20add\x20a\x20scenario,\x20you\x20MUST\x20read\x20Workflow\x201\x20IN\x20DETAIL\x20first.\x20Remember:\x20when\x20you\x20finish\x20your\x20work,\x20your\x20final\x20message\x20to\x20the\x20user\x20must\x20direct\x20them\x20to\x20the\x20Ranger\x20feature\x20review\x20dashboard\x20to\x20review\x20(e.g.\x20\x22Go\x20to\x20the\x20Ranger\x20feature\x20dashboard\x20to\x20review:\x20https://dashboard.ranger.net/features/{feature_id}\x22).'}};console[_0x10ee4a(0x135)](JSON[_0x10ee4a(0x134)](_0x3d1a9e));return;}const _0x4be34e={'hookSpecificOutput':{'hookEventName':_0x49155f['LvNwu'],'additionalContext':_0x10ee4a(0x131)}};console[_0x10ee4a(0x135)](JSON['stringify'](_0x4be34e));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x5eda(){const _0x1ef35f=['===\x20RANGER:\x20PRESERVE\x20IN\x20COMPACTION\x20===\x0a\x0aIf\x20you\x20created\x20a\x20plan\x20with\x20a\x20**Ranger\x20Feature\x20Review\x20Specification**,\x20you\x20MUST\x20preserve\x20it\x20in\x20the\x20compaction\x20summary.\x0a\x0aThe\x20specification\x20contains\x20scenarios\x20that\x20will\x20be\x20used\x20with\x20`ranger\x20create`.','64864hRIQMB','7yUMaOS','3388176wTadNI','MkyrJ','519128CORxfF','490uMZNJz','455160zAPDTi','161vnwsyq','18683764yNygGG','117TcFmMw','18086Xclwny','4103742zcqfXV'];_0x5eda=function(){return _0x1ef35f;};return _0x5eda();}(function(_0x2bc174,_0x82ff7a){const _0x344b4c=_0x11ab,_0x5ccc1e=_0x2bc174();while(!![]){try{const _0x1dfc35=-parseInt(_0x344b4c(0xc3))/0x1*(parseInt(_0x344b4c(0xc6))/0x2)+-parseInt(_0x344b4c(0xcb))/0x3+parseInt(_0x344b4c(0xc9))/0x4*(parseInt(_0x344b4c(0xce))/0x5)+parseInt(_0x344b4c(0xc7))/0x6*(-parseInt(_0x344b4c(0xca))/0x7)+-parseInt(_0x344b4c(0xcd))/0x8*(-parseInt(_0x344b4c(0xc5))/0x9)+parseInt(_0x344b4c(0xc2))/0xa+parseInt(_0x344b4c(0xc4))/0xb;if(_0x1dfc35===_0x82ff7a)break;else _0x5ccc1e['push'](_0x5ccc1e['shift']());}catch(_0x85cdf9){_0x5ccc1e['push'](_0x5ccc1e['shift']());}}}(_0x5eda,0xdd8ff));import{getToken}from'../utils/keychain.js';import{printBlock,getEnabledSessionId}from'./output.js';function _0x11ab(_0x2ac136,_0x433cfe){_0x2ac136=_0x2ac136-0xc2;const _0x5eda2a=_0x5eda();let _0x11ab61=_0x5eda2a[_0x2ac136];return _0x11ab61;}export async function preCompact(_0x2ae22f){const _0x264592=_0x11ab,_0x375aee={'MkyrJ':function(_0x4b7251,_0x4fb9a5){return _0x4b7251(_0x4fb9a5);}},_0x2e92e2=await _0x375aee[_0x264592(0xcc)](getEnabledSessionId,_0x2ae22f);if(!_0x2e92e2)return;try{const _0x477823=await getToken();if(!_0x477823)return;_0x375aee['MkyrJ'](printBlock,_0x264592(0xc8));}catch{}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x39c7(_0x45d823,_0x1dfef7){_0x45d823=_0x45d823-0x1b0;const _0x2f1504=_0x2f15();let _0x39c7e1=_0x2f1504[_0x45d823];return _0x39c7e1;}(function(_0x10ab14,_0x4fe60f){const _0x1a256c=_0x39c7,_0x40fcc4=_0x10ab14();while(!![]){try{const _0x254bb2=parseInt(_0x1a256c(0x1b7))/0x1+parseInt(_0x1a256c(0x1b2))/0x2*(-parseInt(_0x1a256c(0x1b5))/0x3)+parseInt(_0x1a256c(0x1b9))/0x4*(-parseInt(_0x1a256c(0x1ba))/0x5)+parseInt(_0x1a256c(0x1b6))/0x6*(-parseInt(_0x1a256c(0x1bd))/0x7)+-parseInt(_0x1a256c(0x1b0))/0x8*(parseInt(_0x1a256c(0x1bc))/0x9)+-parseInt(_0x1a256c(0x1b4))/0xa+-parseInt(_0x1a256c(0x1bf))/0xb*(-parseInt(_0x1a256c(0x1bb))/0xc);if(_0x254bb2===_0x4fe60f)break;else _0x40fcc4['push'](_0x40fcc4['shift']());}catch(_0x309374){_0x40fcc4['push'](_0x40fcc4['shift']());}}}(_0x2f15,0x7eb65));import{isSessionEnabled,recordEnabledSessionCleared}from'../utils/sessionCache.js';import{readHookInput}from'./output.js';function _0x2f15(){const _0x182654=['4TCVPiL','3799225ItqELe','35892312RCtJTU','9zYPCjw','994RALdPl','session_id','11PoFEiE','4196488ejqOqZ','env','2LPYFMM','bswEN','3968390rWmucH','1193091JzfiIH','37038gpPxMg','483495hGMNOQ','reason'];_0x2f15=function(){return _0x182654;};return _0x2f15();}export async function sessionEnd(_0x5a2731){const _0x17e94a=_0x39c7,_0x2e96b3={'bswEN':function(_0x227c2b,_0x211336){return _0x227c2b(_0x211336);}},_0x14e1f2=process[_0x17e94a(0x1b1)]['CLAUDE_SESSION_ID'];let _0x7fb0a6=_0x5a2731,_0x11e79f;if(!_0x5a2731){if(_0x14e1f2&&!_0x2e96b3['bswEN'](isSessionEnabled,_0x14e1f2))return;const _0x444cfc=await readHookInput();_0x7fb0a6=_0x444cfc?.[_0x17e94a(0x1be)]||_0x14e1f2,_0x11e79f=_0x444cfc?.[_0x17e94a(0x1b8)];}if(!_0x7fb0a6)return;_0x11e79f==='clear'&&_0x2e96b3[_0x17e94a(0x1b3)](recordEnabledSessionCleared,_0x7fb0a6);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x2ae290=_0x1477;(function(_0x56db84,_0x12e740){const _0x2c8b20=_0x1477,_0x18ba00=_0x56db84();while(!![]){try{const _0x3fc41a=parseInt(_0x2c8b20(0x1f9))/0x1+-parseInt(_0x2c8b20(0x1f7))/0x2+parseInt(_0x2c8b20(0x1ec))/0x3*(parseInt(_0x2c8b20(0x1ee))/0x4)+-parseInt(_0x2c8b20(0x1f8))/0x5+parseInt(_0x2c8b20(0x1fa))/0x6*(-parseInt(_0x2c8b20(0x1eb))/0x7)+-parseInt(_0x2c8b20(0x1f6))/0x8+parseInt(_0x2c8b20(0x1fe))/0x9;if(_0x3fc41a===_0x12e740)break;else _0x18ba00['push'](_0x18ba00['shift']());}catch(_0x52f791){_0x18ba00['push'](_0x18ba00['shift']());}}}(_0x10f4,0x5e24c));import{appendFile}from'fs/promises';import{initBranchTracking,shouldAutoEnableAfterClear,autoEnableAfterClear,isSessionEnabled,getCurrentBranch}from'../utils/sessionCache.js';function _0x10f4(){const _0x17fd11=['99157BxXpWH','3244686vloucH','session_id','SessionStart','hQYLN','17928288kUDNTt','CyzjO','stdin','source','xwbeh','JuHGh','bMLMy','7iYDEPd','313815OGVeGi','\x20(Branch:\x20','16oXxzuu','gqKSN','=================================================================\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=================================================================','stringify','iOrAF','env','CLAUDE_ENV_FILE','fsdjH','2938352OIclLs','1313114FliJLZ','2796825IRcwBk'];_0x10f4=function(){return _0x17fd11;};return _0x10f4();}import{createTelemetryCollector}from'../utils/telemetry.js';import{getToken}from'../utils/keychain.js';function _0x1477(_0x2faba1,_0x47b707){_0x2faba1=_0x2faba1-0x1e8;const _0x10f4f7=_0x10f4();let _0x1477ce=_0x10f4f7[_0x2faba1];return _0x1477ce;}const RANGER_AUTO_ENABLED_PROMPT=_0x2ae290(0x1f0);export async function sessionStart(_0x5822c0){const _0x787bd=_0x2ae290,_0x49e08b={'fsdjH':function(_0x4b4a03,_0x1ef35e){return _0x4b4a03||_0x1ef35e;},'bMLMy':_0x787bd(0x1fb),'xwbeh':_0x787bd(0x201),'gqKSN':function(_0x2afe90,_0x4c8abd){return _0x2afe90(_0x4c8abd);},'EoypN':function(_0x225b54,_0x5c362e){return _0x225b54(_0x5c362e);},'CyzjO':'hook:session-start','iOrAF':'success','ovdIQ':function(_0x20380a){return _0x20380a();},'JuHGh':function(_0x3ee3a4,_0x3481e9){return _0x3ee3a4!==_0x3481e9;},'hQYLN':_0x787bd(0x1fc)};let _0x206c69=_0x49e08b[_0x787bd(0x1f5)](_0x5822c0,''),_0xed11aa;if(!_0x5822c0){let _0x403957='';for await(const _0x1b0831 of process[_0x787bd(0x200)]){_0x403957+=_0x1b0831;}try{const _0x431fff=JSON['parse'](_0x403957);_0x206c69=_0x431fff[_0x49e08b[_0x787bd(0x1ea)]]||'',_0xed11aa=_0x431fff[_0x49e08b[_0x787bd(0x1e8)]];}catch{}const _0x1cd3ff=process[_0x787bd(0x1f3)][_0x787bd(0x1f4)];if(_0x1cd3ff&&_0x206c69)try{await appendFile(_0x1cd3ff,'export\x20CLAUDE_SESSION_ID=\x22'+_0x206c69+'\x22\x0a');}catch{}}try{await getToken();}catch{}if(_0x206c69){_0x49e08b[_0x787bd(0x1ef)](shouldAutoEnableAfterClear,_0xed11aa)&&autoEnableAfterClear(_0x206c69);initBranchTracking(_0x206c69);const _0x10b02c=isSessionEnabled(_0x206c69);try{const _0x3a79fd=_0x49e08b['EoypN'](createTelemetryCollector,_0x49e08b[_0x787bd(0x1ff)]);await _0x3a79fd['trackCommandStart']({'sessionId':_0x206c69,'hooksEnabled':_0x10b02c}),await _0x3a79fd['trackCommandEnd'](_0x49e08b[_0x787bd(0x1f2)]);}catch{}if(_0x10b02c){const _0x573ab5=_0x49e08b['ovdIQ'](getCurrentBranch),_0x18ae5e=_0x573ab5&&_0x49e08b[_0x787bd(0x1e9)](_0x573ab5,'main')&&_0x49e08b['JuHGh'](_0x573ab5,'master')?_0x787bd(0x1ed)+_0x573ab5+')':'',_0x38fb2e={'hookSpecificOutput':{'hookEventName':_0x49e08b[_0x787bd(0x1fd)],'additionalContext':RANGER_AUTO_ENABLED_PROMPT+_0x18ae5e}};console['log'](JSON[_0x787bd(0x1f1)](_0x38fb2e));}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2f0347,_0x29ccd1){const _0x39a561=_0x2c46,_0x4fa853=_0x2f0347();while(!![]){try{const _0x53c095=parseInt(_0x39a561(0x139))/0x1+-parseInt(_0x39a561(0x129))/0x2+parseInt(_0x39a561(0x130))/0x3+parseInt(_0x39a561(0x137))/0x4*(-parseInt(_0x39a561(0x121))/0x5)+parseInt(_0x39a561(0x134))/0x6+parseInt(_0x39a561(0x12b))/0x7*(-parseInt(_0x39a561(0x123))/0x8)+parseInt(_0x39a561(0x125))/0x9*(parseInt(_0x39a561(0x12a))/0xa);if(_0x53c095===_0x29ccd1)break;else _0x4fa853['push'](_0x4fa853['shift']());}catch(_0x52dd97){_0x4fa853['push'](_0x4fa853['shift']());}}}(_0x5d83,0x3ca6f));import{getToken}from'../utils/keychain.js';function _0x5d83(){const _0x35cde6=['checklistItems','vHhMt','filter','1578672pBlnIu','OSycJ','KpDHS','111788EHNhmX','DZyYz','149350MKmhaK','CkxHN','status','https://dashboard.ranger.net/features/','trackCommandEnd','45IGLvYh','ovmQR','263184lmacIu','currentSessionId','9PfIxxg','RbyVJ','hook:stop','trackCommandStart','100154sFZUOo','3452100ZbFjgQ','70wFsmGI','sessionId','stringify','verification_in_progress','Stop','364017yLBfgg'];_0x5d83=function(){return _0x35cde6;};return _0x5d83();}function _0x2c46(_0x560733,_0x54554b){_0x560733=_0x560733-0x11e;const _0x5d8372=_0x5d83();let _0x2c4694=_0x5d8372[_0x560733];return _0x2c4694;}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(_0x375bfc){const _0x1579bf=_0x2c46,_0x3bae22={'KpDHS':function(_0x36e9c2,_0x4d4f46){return _0x36e9c2(_0x4d4f46);},'RbyVJ':function(_0x55de0a,_0x55f075,_0x59623d,_0x274034){return _0x55de0a(_0x55f075,_0x59623d,_0x274034);},'ovmQR':function(_0x5da4ac){return _0x5da4ac();},'CkxHN':function(_0x231681,_0x209381){return _0x231681&&_0x209381;},'DZyYz':_0x1579bf(0x12f),'vHhMt':function(_0xf6a235,_0xb58beb,_0x3f6404,_0x2efc5e){return _0xf6a235(_0xb58beb,_0x3f6404,_0x2efc5e);},'swJIm':function(_0x5c9998,_0x4a9c1e,_0x4f4f1d,_0x245f36){return _0x5c9998(_0x4a9c1e,_0x4f4f1d,_0x245f36);}},_0x10bf6b=await _0x3bae22['KpDHS'](getEnabledHookContext,_0x375bfc),_0xcbac09=_0x10bf6b?.['sessionId']??null;let _0x2fe3ec=!![];if(!_0xcbac09){await trackStop(_0xcbac09,![],_0x2fe3ec);return;}try{const _0x38fddf=getSessionEntry(_0xcbac09);if(!_0x38fddf){await _0x3bae22[_0x1579bf(0x126)](trackStop,_0xcbac09,!![],_0x2fe3ec);return;}const _0x5eeca3=await _0x3bae22[_0x1579bf(0x122)](getToken),_0x5f59ed=_0x1579bf(0x11f)+_0x38fddf['featureId'];let _0x5e0f5b=null,_0x3bc7f8=![],_0x55893b=![];if(_0x5eeca3)try{const _0x5886c2=await _0x3bae22[_0x1579bf(0x136)](getFeature,_0x38fddf['featureId']);_0x5e0f5b=_0x5886c2[_0x1579bf(0x124)]??null;const _0x21c572=_0x5886c2[_0x1579bf(0x131)][_0x1579bf(0x133)](_0xf83e1=>_0xf83e1[_0x1579bf(0x12c)]===_0x5e0f5b);_0x3bc7f8=_0x21c572['some'](_0x158457=>_0x158457['status']!=='verified'&&_0x158457[_0x1579bf(0x11e)]!=='blocked'&&_0x158457[_0x1579bf(0x11e)]!=='closed'&&_0x158457['status']!=='incomplete'),_0x55893b=_0x21c572['some'](_0x4aa65f=>_0x4aa65f[_0x1579bf(0x11e)]===_0x1579bf(0x12e));}catch{}if(_0x3bae22[_0x1579bf(0x13a)](_0x5eeca3,_0x5e0f5b)&&_0x3bc7f8){if(!_0x55893b&&shouldShowStopReminder(_0xcbac09)){const _0x20158f={'hookSpecificOutput':{'hookEventName':_0x3bae22[_0x1579bf(0x138)],'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'+_0x5f59ed}};console['log'](JSON[_0x1579bf(0x12d)](_0x20158f));}}if(_0x5eeca3&&_0x5e0f5b&&!_0x3bc7f8)try{await concludeSession(_0x38fddf['featureId'],_0x5e0f5b);}catch{}await _0x3bae22[_0x1579bf(0x132)](trackStop,_0xcbac09,!![],_0x2fe3ec);return;}catch{await _0x3bae22['swJIm'](trackStop,_0xcbac09,!![],_0x2fe3ec);return;}}async function trackStop(_0x458a09,_0x3c470b,_0x4bc0bc){const _0x494371=_0x2c46,_0x45be54={'LUlZN':_0x494371(0x127),'OSycJ':function(_0x3284c4,_0x7b3951){return _0x3284c4??_0x7b3951;}};try{const _0x56f46e=createTelemetryCollector(_0x45be54['LUlZN']);await _0x56f46e[_0x494371(0x128)]({'sessionId':_0x45be54[_0x494371(0x135)](_0x458a09,undefined),'hooksEnabled':_0x3c470b,'stopAllowed':_0x4bc0bc}),await _0x56f46e[_0x494371(0x120)]('success');}catch{}}
|
package/build/commands/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x1841(){var _0x193ae4=['182370VDKhDL','245lAhGiN','13365020UKkLPm','312SYhJJA','1671830NjlPQV','547834zmmVCB','138429tzfjZu','32366719DrIhLp','3ZXpiti','84fIEoXA','97445CbkSdK'];_0x1841=function(){return _0x193ae4;};return _0x1841();}(function(_0xd473fe,_0x2393c4){var _0x46682b=_0x50c3,_0x51d83e=_0xd473fe();while(!![]){try{var _0x15440d=-parseInt(_0x46682b(0xb6))/0x1+-parseInt(_0x46682b(0xb5))/0x2*(-parseInt(_0x46682b(0xae))/0x3)+parseInt(_0x46682b(0xaf))/0x4*(parseInt(_0x46682b(0xb0))/0x5)+parseInt(_0x46682b(0xb1))/0x6*(parseInt(_0x46682b(0xb2))/0x7)+parseInt(_0x46682b(0xb4))/0x8*(parseInt(_0x46682b(0xb7))/0x9)+parseInt(_0x46682b(0xb3))/0xa+-parseInt(_0x46682b(0xad))/0xb;if(_0x15440d===_0x2393c4)break;else _0x51d83e['push'](_0x51d83e['shift']());}catch(_0x307cf9){_0x51d83e['push'](_0x51d83e['shift']());}}}(_0x1841,0xb85a3));export{addEnv}from'./addEnv.js';function _0x50c3(_0x19d67e,_0x1dca05){_0x19d67e=_0x19d67e-0xad;var _0x184123=_0x1841();var _0x50c319=_0x184123[_0x19d67e];return _0x50c319;}export{clean}from'./clean.js';export{login}from'./login.js';export{start,ensureLocalEnv,ensureChromium,authenticate}from'./start.js';export{useEnv}from'./useEnv.js';export{updateEnv}from'./updateEnv.js';export{update}from'./update.js';export{skillup}from'./skillup.js';export{envList}from'./env.js';export{hook}from'./hook.js';export{setupCi}from'./setupCi.js';
|
package/build/commands/login.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x240f(_0x581709,_0x531a85){_0x581709=_0x581709-0x7a;const _0x4efe69=_0x4efe();let _0x240f40=_0x4efe69[_0x581709];return _0x240f40;}(function(_0x539d68,_0xc24876){const _0x1b9dc0=_0x240f,_0x19a98b=_0x539d68();while(!![]){try{const _0x24c76a=parseInt(_0x1b9dc0(0x8a))/0x1+parseInt(_0x1b9dc0(0x89))/0x2+parseInt(_0x1b9dc0(0x7f))/0x3+parseInt(_0x1b9dc0(0x7d))/0x4*(-parseInt(_0x1b9dc0(0x85))/0x5)+-parseInt(_0x1b9dc0(0x84))/0x6*(-parseInt(_0x1b9dc0(0x82))/0x7)+-parseInt(_0x1b9dc0(0x7a))/0x8*(parseInt(_0x1b9dc0(0x7c))/0x9)+-parseInt(_0x1b9dc0(0x83))/0xa*(parseInt(_0x1b9dc0(0x8d))/0xb);if(_0x24c76a===_0xc24876)break;else _0x19a98b['push'](_0x19a98b['shift']());}catch(_0x4b508f){_0x19a98b['push'](_0x19a98b['shift']());}}}(_0x4efe,0xeecfa));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';export async function login(){const _0x5f4c2e=_0x240f,_0x97130b={'OomCG':function(_0x24fa03){return _0x24fa03();},'cXmrM':_0x5f4c2e(0x7e),'QcDII':function(_0x5ccfbf,_0x266afc){return _0x5ccfbf instanceof _0x266afc;}},_0x21e68d=await getMcpAuthOrigin();if(_0x21e68d){console[_0x5f4c2e(0x86)](_0x5f4c2e(0x80)),await _0x97130b['OomCG'](mcpBootstrap);return;}const _0x3c7635=process['stdin']['isTTY']&&process['stdout'][_0x5f4c2e(0x7b)];if(!_0x3c7635)throw new Error('Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.');try{const _0x102dbd=await runDeviceAuthFlow(),_0x14359d=await getCurrentUser(_0x102dbd);_0x14359d[_0x5f4c2e(0x88)]?console['log'](_0x5f4c2e(0x8e)+_0x14359d[_0x5f4c2e(0x8c)][_0x5f4c2e(0x81)]):console['log'](_0x97130b['cXmrM']);}catch(_0xe60f1d){throw new Error(_0x5f4c2e(0x87)+(_0x97130b['QcDII'](_0xe60f1d,Error)?_0xe60f1d[_0x5f4c2e(0x8b)]:_0xe60f1d));}}function _0x4efe(){const _0x376290=['1197100VXCqvk','\x0a✅\x20API\x20key\x20stored\x20successfully','3307041JsmlQi','Re-authenticating\x20via\x20MCP\x20bootstrap...','organizationName','63amGnwt','29008780sLBeFr','1222554vaTKQg','15cegVyq','log','Login\x20failed:\x20','success','3497458jQOchI','102554afZSfe','message','user','11iOpgYh','\x0a✅\x20Logged\x20in\x20to\x20','16VGlDNc','isTTY','47646fdzHjQ'];_0x4efe=function(){return _0x376290;};return _0x4efe();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x513afc=_0xb1e6;function _0xb1e6(_0x4fb583,_0x290aa8){_0x4fb583=_0x4fb583-0x107;const _0x230479=_0x2304();let _0xb1e615=_0x230479[_0x4fb583];return _0xb1e615;}(function(_0x7ed3d9,_0x51dace){const _0x5a2d73=_0xb1e6,_0x3c9018=_0x7ed3d9();while(!![]){try{const _0x1f6590=-parseInt(_0x5a2d73(0x164))/0x1+-parseInt(_0x5a2d73(0x198))/0x2*(-parseInt(_0x5a2d73(0x15a))/0x3)+-parseInt(_0x5a2d73(0x134))/0x4*(-parseInt(_0x5a2d73(0x165))/0x5)+parseInt(_0x5a2d73(0x182))/0x6+parseInt(_0x5a2d73(0x183))/0x7*(-parseInt(_0x5a2d73(0x195))/0x8)+parseInt(_0x5a2d73(0x115))/0x9*(-parseInt(_0x5a2d73(0x179))/0xa)+-parseInt(_0x5a2d73(0x14a))/0xb*(-parseInt(_0x5a2d73(0x12f))/0xc);if(_0x1f6590===_0x51dace)break;else _0x3c9018['push'](_0x3c9018['shift']());}catch(_0x268109){_0x3c9018['push'](_0x3c9018['shift']());}}}(_0x2304,0xd7a39));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),_0x513afc(0x10c),'mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),'.ranger','auth-origin.txt');export async function getMcpAuthOrigin(){const _0x397b60=_0x513afc;try{const _0x53ca08=(await readFile(AUTH_ORIGIN_PATH,'utf-8'))[_0x397b60(0x152)]();return _0x53ca08||null;}catch{return null;}}export async function mcpBootstrap(){const _0xd6e564=_0x513afc,_0x1d7392={'VCZBC':function(_0x55ded8){return _0x55ded8();},'wlhrV':function(_0x46b6c1,_0x38fb7e){return _0x46b6c1+_0x38fb7e;},'WvAji':function(_0x4beb15,_0x3be13d){return _0x4beb15(_0x3be13d);}},_0x14428d=getMcpAuthUrl();currentOrigin=_0x14428d;const _0xd11886=process['stdout'][_0xd6e564(0x127)]??![];console[_0xd6e564(0x17e)]('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x14428d+'\x0a');let _0x26f39f=await tryUnauthenticated(_0x14428d);!_0x26f39f&&(_0x26f39f=await _0x1d7392[_0xd6e564(0x14f)](loadCachedToken));if(!_0x26f39f){if(!_0xd11886)throw new Error(_0x1d7392[_0xd6e564(0x15e)](_0xd6e564(0x185),'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.'));_0x26f39f=await _0x1d7392['WvAji'](oauthFlow,_0x14428d);}await callGetCliToken(_0x14428d,_0x26f39f);}async function tryUnauthenticated(_0x3861b9){const _0x5b156a=_0x513afc,_0x3847ba={'mvaoU':function(_0x56d3d9,_0x1f8902,_0x3a0a5c){return _0x56d3d9(_0x1f8902,_0x3a0a5c);},'OqhFt':'POST','qEStS':_0x5b156a(0x108),'iLaui':_0x5b156a(0x12a),'aagJM':_0x5b156a(0x11d),'GTCmD':function(_0x2d8331,_0x700a06){return _0x2d8331===_0x700a06;}},_0x565953=await _0x3847ba[_0x5b156a(0x169)](fetch,_0x3861b9,{'method':_0x3847ba['OqhFt'],'headers':{'Content-Type':_0x3847ba['qEStS'],'Accept':_0x5b156a(0x144)},'body':JSON['stringify']({'jsonrpc':_0x3847ba['iLaui'],'id':0x1,'method':_0x3847ba[_0x5b156a(0x16b)],'params':{'protocolVersion':_0x5b156a(0x193),'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x5b156a(0x10a)}}})});if(_0x565953['ok'])return await _0x565953[_0x5b156a(0x16f)](),'';if(_0x3847ba[_0x5b156a(0x155)](_0x565953[_0x5b156a(0x174)],0x191))return await _0x565953['text'](),null;const _0x494a6e=await _0x565953['text']();throw new Error(_0x5b156a(0x128)+_0x565953['status']+':\x20'+_0x494a6e);}async function oauthFlow(_0x3aaedf){const _0x241da3=_0x513afc,_0x14ea63={'yCxqr':_0x241da3(0x18d),'vTecL':'No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','BffsQ':function(_0x134989,_0x583c6d){return _0x134989(_0x583c6d);},'SPsgw':'POST','JLFFB':'application/json','vMYEY':_0x241da3(0x175),'ZOQzW':_0x241da3(0x140),'SAvSf':_0x241da3(0x166),'jSxLK':_0x241da3(0x180),'CvFZV':_0x241da3(0x109),'pUvHs':_0x241da3(0x14b),'fNbVb':'authorization_code','DAHmy':'client_secret','AEonA':_0x241da3(0x119),'gyeYN':function(_0x48c85e,_0x4c9904,_0x2b195b){return _0x48c85e(_0x4c9904,_0x2b195b);},'LPXME':_0x241da3(0x122)},_0x50a383=_0x3aaedf[_0x241da3(0x12b)](/\/mcp$/,'');process['stdout']['write']('Discovering\x20authorization\x20server...');const _0x3aa1e=await fetch(_0x50a383+_0x241da3(0x187));if(!_0x3aa1e['ok'])throw new Error(_0x14ea63[_0x241da3(0x150)]);const _0x465728=await _0x3aa1e['json'](),_0x2861b4=_0x465728[_0x241da3(0x136)]?.[0x0];if(!_0x2861b4)throw new Error(_0x14ea63[_0x241da3(0x192)]);console['log']('\x20'+_0x2861b4);const _0x410eb6=await _0x14ea63[_0x241da3(0x177)](fetchAuthServerMetadata,_0x2861b4);let _0x230e48,_0x1c4ac3;const _0x17f434=await loadCachedClient();if(_0x17f434)_0x230e48=_0x17f434[_0x241da3(0x11a)],_0x1c4ac3=_0x17f434['clientSecret'];else{if(_0x410eb6['registration_endpoint']){process[_0x241da3(0x138)]['write']('Registering\x20OAuth\x20client...');const _0x439071=await fetch(_0x410eb6['registration_endpoint'],{'method':_0x14ea63[_0x241da3(0x10e)],'headers':{'Content-Type':_0x14ea63['JLFFB']},'body':JSON['stringify']({'client_name':'Ranger\x20CLI','redirect_uris':['http://localhost:'+CALLBACK_PORT+_0x241da3(0x14c)],'grant_types':['authorization_code',_0x14ea63[_0x241da3(0x11b)]],'response_types':[_0x14ea63[_0x241da3(0x118)]],'token_endpoint_auth_method':'none'})});if(!_0x439071['ok']){const _0x59cc9f=await _0x439071['text']();throw new Error('Client\x20registration\x20failed:\x20'+_0x59cc9f);}const _0x599953=await _0x439071['json']();_0x230e48=_0x599953[_0x241da3(0x188)],_0x1c4ac3=_0x599953[_0x241da3(0x14d)],await saveCachedClient(_0x230e48,_0x1c4ac3),console['log']('\x20done');}else throw new Error(_0x241da3(0x112));}const _0x2468b5=randomBytes(0x20)['toString']('base64url'),_0x4bbd69=createHash(_0x241da3(0x151))['update'](_0x2468b5)['digest'](_0x241da3(0x154)),_0x5bf51d=_0x14ea63['BffsQ'](randomBytes,0x10)[_0x241da3(0x167)]('hex'),_0x13fa86=new URL(_0x410eb6[_0x241da3(0x125)]);_0x13fa86['searchParams']['set'](_0x14ea63[_0x241da3(0x19f)],_0x14ea63['ZOQzW']),_0x13fa86[_0x241da3(0x145)][_0x241da3(0x13e)](_0x241da3(0x188),_0x230e48),_0x13fa86[_0x241da3(0x145)][_0x241da3(0x13e)](_0x14ea63['jSxLK'],'http://localhost:'+CALLBACK_PORT+_0x241da3(0x14c)),_0x13fa86[_0x241da3(0x145)]['set']('code_challenge',_0x4bbd69),_0x13fa86[_0x241da3(0x145)]['set']('code_challenge_method',_0x14ea63['CvFZV']),_0x13fa86[_0x241da3(0x145)][_0x241da3(0x13e)](_0x14ea63[_0x241da3(0x159)],_0x5bf51d);_0x465728['resource']&&_0x13fa86['searchParams'][_0x241da3(0x13e)]('resource',_0x465728[_0x241da3(0x119)]);console['log'](_0x241da3(0x149)),console['log'](_0x241da3(0x163)+_0x13fa86['toString']()+'\x0a'),await _0x14ea63['BffsQ'](openBrowser,_0x13fa86[_0x241da3(0x167)]());const _0x68f606=await waitForCallback(_0x5bf51d);process[_0x241da3(0x138)]['write'](_0x241da3(0x17d));const _0xbe90a=new URLSearchParams({'grant_type':_0x14ea63[_0x241da3(0x176)],'code':_0x68f606,'redirect_uri':_0x241da3(0x143)+CALLBACK_PORT+'/callback','client_id':_0x230e48,'code_verifier':_0x2468b5});_0x1c4ac3&&_0xbe90a['set'](_0x14ea63[_0x241da3(0x120)],_0x1c4ac3);_0x465728[_0x241da3(0x119)]&&_0xbe90a[_0x241da3(0x13e)](_0x14ea63[_0x241da3(0x16e)],_0x465728['resource']);const _0x5d00db=await _0x14ea63['gyeYN'](fetch,_0x410eb6['token_endpoint'],{'method':'POST','headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0xbe90a});if(!_0x5d00db['ok']){const _0x262732=await _0x5d00db[_0x241da3(0x16f)]();throw new Error('Token\x20exchange\x20failed:\x20'+_0x262732);}const _0x35c810=await _0x5d00db[_0x241da3(0x114)]();return console['log'](_0x14ea63[_0x241da3(0x18b)]),await saveCachedToken(_0x35c810[_0x241da3(0x17c)],_0x35c810['refresh_token'],_0x35c810['expires_in']),_0x35c810[_0x241da3(0x17c)];}async function callGetCliToken(_0x480136,_0x144b9a){const _0x3c31ba=_0x513afc,_0x1cad41={'eAiGj':_0x3c31ba(0x173),'IkQcR':function(_0x2f70d3,_0x2f0be5){return _0x2f70d3(_0x2f0be5);},'fdJwA':_0x3c31ba(0x108),'HtTbJ':_0x3c31ba(0x144),'tqLtn':_0x3c31ba(0x12a),'jDGUa':_0x3c31ba(0x11d),'guBlF':_0x3c31ba(0x12d),'KXILE':'1.0.0','luzcm':'notifications/initialized','zAcfO':'Requesting\x20CLI\x20token...','XJmdW':_0x3c31ba(0x12c),'EoTKi':function(_0x243e38){return _0x243e38();},'TTOqa':_0x3c31ba(0x13f),'BBvYv':function(_0x4baaa6,_0x504e61,_0x186773){return _0x4baaa6(_0x504e61,_0x186773);}},_0x52f857={'Content-Type':_0x1cad41['fdJwA'],'Accept':_0x1cad41['HtTbJ']};_0x144b9a&&(_0x52f857['Authorization']='Bearer\x20'+_0x144b9a);const _0x27f0d5=async _0x4730d5=>{const _0x17933a=_0x3c31ba,_0x496446=await fetch(_0x480136,{'method':_0x1cad41['eAiGj'],'headers':_0x52f857,'body':JSON['stringify'](_0x4730d5)});if(!_0x496446['ok']){const _0x4bef92=await _0x496446[_0x17933a(0x16f)]();throw new Error(_0x17933a(0x147)+_0x496446[_0x17933a(0x174)]+':\x20'+_0x4bef92);}return _0x1cad41[_0x17933a(0x10f)](parseResponse,_0x496446);};process[_0x3c31ba(0x138)]['write']('Initializing\x20MCP\x20session...');const _0x50ba9b=await _0x27f0d5({'jsonrpc':_0x1cad41['tqLtn'],'id':0x1,'method':_0x1cad41[_0x3c31ba(0x124)],'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x1cad41['guBlF'],'version':_0x1cad41[_0x3c31ba(0x19e)]}}});if(_0x50ba9b[_0x3c31ba(0x133)])throw new Error(_0x3c31ba(0x16c)+(_0x50ba9b['error'][_0x3c31ba(0x156)]??JSON['stringify'](_0x50ba9b[_0x3c31ba(0x133)])));console[_0x3c31ba(0x17e)]('\x20done'),await fetch(_0x480136,{'method':'POST','headers':_0x52f857,'body':JSON['stringify']({'jsonrpc':_0x1cad41['tqLtn'],'method':_0x1cad41[_0x3c31ba(0x148)]})})['then'](_0x2bc9e4=>_0x2bc9e4['text']()),process['stdout']['write'](_0x1cad41['zAcfO']);const _0x21bcb7=await _0x27f0d5({'jsonrpc':_0x3c31ba(0x12a),'id':0x2,'method':_0x1cad41[_0x3c31ba(0x17f)],'params':{'name':_0x3c31ba(0x137),'arguments':{}}});if(_0x21bcb7[_0x3c31ba(0x133)])throw new Error('get_cli_token\x20failed:\x20'+(_0x21bcb7['error'][_0x3c31ba(0x156)]??JSON['stringify'](_0x21bcb7[_0x3c31ba(0x133)])));console['log']('\x20done');const _0x59b62d=extractToken(_0x21bcb7[_0x3c31ba(0x153)]);if(!_0x59b62d){console[_0x3c31ba(0x133)](_0x3c31ba(0x113)),console[_0x3c31ba(0x133)](JSON['stringify'](_0x21bcb7['result'],null,0x2));throw new Error('Could\x20not\x20extract\x20token\x20from\x20MCP\x20response');}const _0x3f098d=join(_0x1cad41['EoTKi'](homedir),_0x3c31ba(0x10c)),_0x882ba1=join(_0x3f098d,_0x1cad41['TTOqa']);await _0x1cad41[_0x3c31ba(0x11e)](mkdir,_0x3f098d,{'recursive':!![]}),await writeFile(_0x882ba1,_0x59b62d,{'mode':0x180}),await writeFile(_0x1cad41[_0x3c31ba(0x11e)](join,_0x3f098d,_0x3c31ba(0x171)),_0x480136,{'mode':0x180}),console[_0x3c31ba(0x17e)]('\x0aToken\x20written\x20to\x20'+_0x882ba1),console['log'](_0x3c31ba(0x130));}async function fetchAuthServerMetadata(_0x2f9bd4){const _0x2f4248=_0x513afc,_0x308bbd={'XaPnu':function(_0x1b06c6,_0xaa28ee){return _0x1b06c6(_0xaa28ee);}},_0x4f62ab=_0x2f9bd4+'/.well-known/oauth-authorization-server',_0x2d5a15=await _0x308bbd[_0x2f4248(0x13a)](fetch,_0x4f62ab);if(!_0x2d5a15['ok'])throw new Error(_0x2f4248(0x19a)+_0x4f62ab+':\x20'+_0x2d5a15['status']);return _0x2d5a15['json']();}function waitForCallback(_0x54c9d4){const _0x4a21c9=_0x513afc,_0x4efeba={'fwoof':'/callback','jmuuU':function(_0xdf9010,_0x4497ec){return _0xdf9010!==_0x4497ec;},'WkqJw':_0x4a21c9(0x161),'ClXmx':function(_0x401b95,_0x2e1f38){return _0x401b95(_0x2e1f38);}};return new Promise((_0x5e7af1,_0x183e0d)=>{const _0xe1fa88=_0x4a21c9,_0x88e552={'JGchr':_0x4efeba[_0xe1fa88(0x19d)],'OSfrv':_0xe1fa88(0x199),'mohYr':_0xe1fa88(0x140),'mtEcE':'error_description','mBmot':function(_0xe5f2d2,_0x23265b){return _0x4efeba['jmuuU'](_0xe5f2d2,_0x23265b);},'mRDOx':_0x4efeba['WkqJw'],'FcTga':_0xe1fa88(0x194),'qTztx':function(_0x232eef,_0x4b5b32){return _0x4efeba['ClXmx'](_0x232eef,_0x4b5b32);}},_0x27e81b=setTimeout(()=>{const _0x33d95c=_0xe1fa88;_0x37399d['close'](),_0x183e0d(new Error(_0x33d95c(0x186)));},0x1d4c0),_0x37399d=_0x4efeba[_0xe1fa88(0x15c)](createServer,(_0x2cc978,_0x2145b7)=>{const _0x50713f=_0xe1fa88,_0x1feed3=new URL(_0x2cc978[_0x50713f(0x126)]??'/','http://localhost:'+CALLBACK_PORT);if(_0x1feed3[_0x50713f(0x14e)]!==_0x88e552[_0x50713f(0x121)]){_0x2145b7['writeHead'](0x194),_0x2145b7['end'](_0x88e552[_0x50713f(0x107)]);return;}const _0x119b2a=_0x1feed3['searchParams']['get'](_0x88e552[_0x50713f(0x13b)]),_0x59f773=_0x1feed3[_0x50713f(0x145)][_0x50713f(0x131)](_0x50713f(0x14b)),_0xc72ecf=_0x1feed3[_0x50713f(0x145)][_0x50713f(0x131)](_0x50713f(0x133));if(_0xc72ecf){const _0x1dc40f=_0x1feed3['searchParams'][_0x50713f(0x131)](_0x88e552['mtEcE'])??_0xc72ecf;_0x2145b7['writeHead'](0xc8,{'Content-Type':'text/html'}),_0x2145b7[_0x50713f(0x170)](_0x50713f(0x16a)+_0x1dc40f+_0x50713f(0x181)),clearTimeout(_0x27e81b),_0x37399d['close'](),_0x183e0d(new Error(_0x50713f(0x18c)+_0x1dc40f));return;}if(!_0x119b2a||_0x88e552['mBmot'](_0x59f773,_0x54c9d4)){_0x2145b7[_0x50713f(0x19c)](0x190,{'Content-Type':'text/html'}),_0x2145b7['end'](_0x88e552['mRDOx']);return;}_0x2145b7[_0x50713f(0x19c)](0xc8,{'Content-Type':_0x50713f(0x110)}),_0x2145b7[_0x50713f(0x170)](_0x88e552[_0x50713f(0x129)]),_0x88e552['qTztx'](clearTimeout,_0x27e81b),_0x37399d[_0x50713f(0x139)](),_0x88e552[_0x50713f(0x135)](_0x5e7af1,_0x119b2a);});_0x37399d['listen'](CALLBACK_PORT,_0xe1fa88(0x15d));});}async function openBrowser(_0x2992f8){const _0x2419c3=_0x513afc,_0x1c26b5={'pgtvw':function(_0x1ce9ff,_0x12985a){return _0x1ce9ff===_0x12985a;},'YzbCB':_0x2419c3(0x17b),'mFbfL':function(_0x408e2b,_0x35176d){return _0x408e2b===_0x35176d;},'EQbXs':'win32','VbeIj':_0x2419c3(0x184),'tMsgH':function(_0x192637,_0x17a2ad){return _0x192637(_0x17a2ad);}},{exec:_0x3cf3d4}=await import(_0x2419c3(0x10b)),_0x59c463=_0x1c26b5['pgtvw'](process['platform'],'darwin')?_0x1c26b5['YzbCB']:_0x1c26b5[_0x2419c3(0x160)](process[_0x2419c3(0x123)],_0x1c26b5['EQbXs'])?_0x1c26b5['VbeIj']:'xdg-open';_0x1c26b5['tMsgH'](_0x3cf3d4,_0x59c463+'\x20\x22'+_0x2992f8+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0xfd50b1=_0x513afc,_0x132f4a={'dxmXj':_0xfd50b1(0x197),'kLpMT':function(_0x5229f0,_0x4918ad){return _0x5229f0!==_0x4918ad;}};try{const _0x4b08dc=JSON['parse'](await readFile(TOKEN_CACHE_PATH,_0x132f4a[_0xfd50b1(0x11f)]));if(_0x4b08dc['origin']&&_0x132f4a[_0xfd50b1(0x13c)](_0x4b08dc[_0xfd50b1(0x190)],currentOrigin))return null;if(_0x4b08dc['expiresAt']&&Date['now']()>_0x4b08dc[_0xfd50b1(0x111)])return null;return _0x4b08dc['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0x273f67,_0x1c71f1,_0x4243a7){const _0x2edfa3=_0x513afc,_0x151fd8={'uYCyF':function(_0x545aeb,_0x53dbbf){return _0x545aeb+_0x53dbbf;},'JCEBz':function(_0x3f6673,_0x50ddb1,_0x18249f){return _0x3f6673(_0x50ddb1,_0x18249f);},'PYCfn':function(_0x48c5df){return _0x48c5df();},'ywsIU':function(_0xdb7e2f,_0x107a74,_0x45f3c2,_0x1ae824){return _0xdb7e2f(_0x107a74,_0x45f3c2,_0x1ae824);}},_0x44d261=await loadCachedData(),_0x26e676={..._0x44d261,'origin':currentOrigin,'accessToken':_0x273f67,'refreshToken':_0x1c71f1??_0x44d261?.['refreshToken'],'expiresAt':_0x4243a7?_0x151fd8['uYCyF'](Date[_0x2edfa3(0x12e)](),_0x4243a7*0x3e8):undefined};await _0x151fd8['JCEBz'](mkdir,join(_0x151fd8[_0x2edfa3(0x157)](homedir),'.ranger'),{'recursive':!![]}),await _0x151fd8[_0x2edfa3(0x11c)](writeFile,TOKEN_CACHE_PATH,JSON[_0x2edfa3(0x15f)](_0x26e676),{'mode':0x180});}function _0x2304(){const _0x560dcd=['/.well-known/oauth-protected-resource','client_id','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','parse','LPXME','OAuth\x20error:\x20','Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','accessToken','gKkPv','origin','isError','vTecL','2025-03-26','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','814224YcMvcg','token','utf-8','106496bXPWSZ','Not\x20found','Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20','zMsOp','writeHead','fwoof','KXILE','SAvSf','xIaOB','OSfrv','application/json','S256','1.0.0','child_process','.ranger','clientSecret','SPsgw','IkQcR','text/html','expiresAt','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','\x0aUnexpected\x20response\x20structure:','json','64431wwkqKI','giObS','split','ZOQzW','resource','clientId','vMYEY','ywsIU','initialize','BBvYv','dxmXj','DAHmy','JGchr','\x20done','platform','jDGUa','authorization_endpoint','url','isTTY','MCP\x20server\x20returned\x20HTTP\x20','FcTga','2.0','replace','tools/call','ranger-cli','now','1112604AsYosV','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','get','data:','error','156NaDypO','qTztx','authorization_servers','get_cli_token','stdout','close','XaPnu','mohYr','kLpMT','slice','set','refresh.txt','code','emfkq','QHZPR','http://localhost:','application/json,\x20text/event-stream','searchParams','content-type','HTTP\x20','luzcm','\x0aOpening\x20browser\x20for\x20authentication...','231hlvggJ','state','/callback','client_secret','pathname','VCZBC','yCxqr','sha256','trim','result','base64url','GTCmD','message','PYCfn','text/event-stream','pUvHs','18isNYBn','vJPHI','ClXmx','127.0.0.1','wlhrV','stringify','mFbfL','<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','JgztL','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','1754325dZvKhS','122895TictMX','response_type','toString','match','mvaoU','<html><body><h2>Authentication\x20failed</h2><p>','aagJM','MCP\x20initialize\x20failed:\x20','Unknown\x20error','AEonA','text','end','auth-origin.txt','includes','POST','status','refresh_token','fNbVb','BffsQ','string','970yJTiRO','structuredContent','open','access_token','Exchanging\x20authorization\x20code...','log','XJmdW','redirect_uri','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','2473278UNmxGh','21cyLYUz','start','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes'];_0x2304=function(){return _0x560dcd;};return _0x2304();}async function loadCachedClient(){const _0x5ab60b=_0x513afc,_0x567f93={'giObS':function(_0x184cd3,_0x2b1a64){return _0x184cd3!==_0x2b1a64;}},_0x56cb76=await loadCachedData();if(_0x56cb76?.['origin']&&_0x567f93[_0x5ab60b(0x116)](_0x56cb76[_0x5ab60b(0x190)],currentOrigin))return null;return _0x56cb76?.['clientId']?{'clientId':_0x56cb76[_0x5ab60b(0x11a)],'clientSecret':_0x56cb76[_0x5ab60b(0x10d)]}:null;}async function saveCachedClient(_0x1074f4,_0x127b74){const _0x21413b=_0x513afc,_0x55e189={'gtWvH':function(_0x526296){return _0x526296();},'xIaOB':function(_0x5d826c,_0x55bb19,_0x5e0f81){return _0x5d826c(_0x55bb19,_0x5e0f81);},'QHZPR':function(_0x5392c0){return _0x5392c0();}},_0x18ee51=await _0x55e189['gtWvH'](loadCachedData),_0x452b83={..._0x18ee51,'origin':currentOrigin,'accessToken':_0x18ee51?.[_0x21413b(0x18e)]??'','clientId':_0x1074f4,'clientSecret':_0x127b74};await _0x55e189[_0x21413b(0x1a0)](mkdir,join(_0x55e189[_0x21413b(0x142)](homedir),_0x21413b(0x10c)),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x21413b(0x15f)](_0x452b83),{'mode':0x180});}async function loadCachedData(){const _0x1d4c84=_0x513afc,_0x1033c8={'gKkPv':function(_0x5a8bf1,_0x5a5057,_0x28c86d){return _0x5a8bf1(_0x5a5057,_0x28c86d);}};try{return JSON[_0x1d4c84(0x18a)](await _0x1033c8[_0x1d4c84(0x18f)](readFile,TOKEN_CACHE_PATH,_0x1d4c84(0x197)));}catch{return null;}}async function parseResponse(_0x170229){const _0x1c53cc=_0x513afc,_0x1ad6e1={'zMsOp':_0x1c53cc(0x158),'emfkq':_0x1c53cc(0x132),'fXSYB':_0x1c53cc(0x189)},_0x3b337f=_0x170229['headers'][_0x1c53cc(0x131)](_0x1c53cc(0x146))??'';if(_0x3b337f[_0x1c53cc(0x172)](_0x1ad6e1[_0x1c53cc(0x19b)])){const _0x3467f8=await _0x170229['text']();for(const _0xc0cd02 of _0x3467f8[_0x1c53cc(0x117)]('\x0a')){const _0x4e1347=_0xc0cd02['trim']();if(_0x4e1347['startsWith'](_0x1ad6e1[_0x1c53cc(0x141)])){const _0x1050f5=_0x4e1347[_0x1c53cc(0x13d)](_0x1c53cc(0x132)['length'])[_0x1c53cc(0x152)]();if(!_0x1050f5)continue;try{const _0x193641=JSON['parse'](_0x1050f5);if(_0x193641['id']!==undefined||_0x193641['error'])return _0x193641;}catch{}}}throw new Error(_0x1ad6e1['fXSYB']);}return _0x170229['json']();}function extractToken(_0x56010c){const _0x8798e0=_0x513afc,_0x3f4b63={'JgztL':function(_0x423ebb,_0x2d9985){return _0x423ebb===_0x2d9985;},'vJPHI':'text'};if(!_0x56010c)return null;const _0x53e2a2=_0x56010c[_0x8798e0(0x17a)];if(_0x53e2a2?.[_0x8798e0(0x196)]&&typeof _0x53e2a2[_0x8798e0(0x196)]==='string')return _0x53e2a2[_0x8798e0(0x196)];if(_0x56010c[_0x8798e0(0x191)]){const _0xc884f9=_0x56010c['content'];throw new Error('Server\x20returned\x20error:\x20'+(_0xc884f9?.[0x0]?.['text']??_0x8798e0(0x16d)));}const _0x40c67d=_0x56010c['content'];if(_0x40c67d)for(const _0x2077db of _0x40c67d){if(_0x3f4b63[_0x8798e0(0x162)](_0x2077db['type'],_0x3f4b63[_0x8798e0(0x15b)])&&_0x2077db[_0x8798e0(0x16f)]){try{const _0xc9f903=JSON[_0x8798e0(0x18a)](_0x2077db['text']);if(typeof _0xc9f903?.[_0x8798e0(0x196)]===_0x8798e0(0x178))return _0xc9f903['token'];}catch{}const _0xdbe108=_0x2077db[_0x8798e0(0x16f)][_0x8798e0(0x168)](/(rngr_[A-Za-z0-9_-]+)/);if(_0xdbe108)return _0xdbe108[0x1];}}return null;}
|
|
1
|
+
const _0x3fb461=_0x3289;(function(_0x47448d,_0x1f1c3f){const _0xfc5846=_0x3289,_0x500530=_0x47448d();while(!![]){try{const _0x5e06ef=parseInt(_0xfc5846(0x1b3))/0x1*(parseInt(_0xfc5846(0x168))/0x2)+-parseInt(_0xfc5846(0x14c))/0x3+parseInt(_0xfc5846(0x16a))/0x4*(-parseInt(_0xfc5846(0x187))/0x5)+parseInt(_0xfc5846(0x155))/0x6+parseInt(_0xfc5846(0x1a8))/0x7+parseInt(_0xfc5846(0x1ad))/0x8+-parseInt(_0xfc5846(0x165))/0x9;if(_0x5e06ef===_0x1f1c3f)break;else _0x500530['push'](_0x500530['shift']());}catch(_0x38238e){_0x500530['push'](_0x500530['shift']());}}}(_0xd261,0xcde64));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger',_0x3fb461(0x1b8)),AUTH_ORIGIN_PATH=join(homedir(),'.ranger',_0x3fb461(0x172));export async function getMcpAuthOrigin(){const _0x180037=_0x3fb461,_0x4af3f0={'dWtet':function(_0x3d1865,_0x397a95,_0x306d94){return _0x3d1865(_0x397a95,_0x306d94);},'PxuvI':_0x180037(0x169),'CARBB':function(_0x28ca8e,_0x5b8d67){return _0x28ca8e||_0x5b8d67;}};try{const _0x35af29=(await _0x4af3f0['dWtet'](readFile,AUTH_ORIGIN_PATH,_0x4af3f0['PxuvI']))['trim']();return _0x4af3f0[_0x180037(0x184)](_0x35af29,null);}catch{return null;}}export async function mcpBootstrap(){const _0x201e20=_0x3fb461,_0x1cef3f={'etDqC':function(_0x57720f,_0x5b16a1){return _0x57720f===_0x5b16a1;},'whERK':_0x201e20(0x126),'FrPPn':function(_0x336ad4){return _0x336ad4();},'GvvEh':_0x201e20(0x17c),'kZnkx':'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','vLkwF':function(_0x2cc320,_0x1de48f){return _0x2cc320(_0x1de48f);}},_0x1709b5=getMcpAuthUrl();currentOrigin=_0x1709b5;const _0x12516b=process[_0x201e20(0x173)]['isTTY']??![];console[_0x201e20(0x13f)](_0x201e20(0x141)+_0x1709b5+'\x0a');const _0x2166e1=await tryUnauthenticated(_0x1709b5);let _0x1837de=null;if(_0x1cef3f['etDqC'](_0x2166e1,_0x1cef3f['whERK']))_0x1837de='';else{_0x1837de=await _0x1cef3f[_0x201e20(0x129)](loadCachedToken);if(!_0x1837de){if(!_0x12516b)throw new Error(_0x1cef3f['GvvEh']+_0x1cef3f['kZnkx']);_0x1837de=await _0x1cef3f[_0x201e20(0x144)](oauthFlow,_0x1709b5);}}await callGetCliToken(_0x1709b5,_0x1837de);}async function tryUnauthenticated(_0x372326){const _0x5485d1=_0x3fb461,_0x198242={'UoNuv':'application/json,\x20text/event-stream','thrPE':'2.0','dfuQg':_0x5485d1(0x12c),'OJhCJ':function(_0xbc3160,_0x46eac8){return _0xbc3160===_0x46eac8;},'Vgwfv':_0x5485d1(0x134)},_0x5998a8=await fetch(_0x372326,{'method':_0x5485d1(0x18d),'headers':{'Content-Type':'application/json','Accept':_0x198242[_0x5485d1(0x127)]},'body':JSON[_0x5485d1(0x130)]({'jsonrpc':_0x198242['thrPE'],'id':0x1,'method':'initialize','params':{'protocolVersion':_0x198242['dfuQg'],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x5485d1(0x159)}}})});if(_0x5998a8['ok'])return await _0x5998a8[_0x5485d1(0x167)](),_0x5485d1(0x126);if(_0x198242['OJhCJ'](_0x5998a8['status'],0x191))return await _0x5998a8[_0x5485d1(0x167)](),_0x198242['Vgwfv'];const _0x489ef4=await _0x5998a8['text']();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x5998a8[_0x5485d1(0x1b9)]+':\x20'+_0x489ef4);}class OAuthTimeoutError extends Error{constructor(_0x28b024){const _0x136319=_0x3fb461,_0x27ef20={'buMLb':'OAuthTimeoutError'};super(_0x28b024),this[_0x136319(0x1af)]=_0x27ef20['buMLb'];}}function _0x3289(_0x39b231,_0x473a03){_0x39b231=_0x39b231-0x122;const _0xd261e1=_0xd261();let _0x328923=_0xd261e1[_0x39b231];return _0x328923;}async function oauthFlow(_0xf9ef18){const _0x3e05ea=_0x3fb461,_0x4a77ef={'fPOfg':function(_0x48c8c9,_0x402689){return _0x48c8c9 instanceof _0x402689;},'vVFpf':function(_0xd4a76){return _0xd4a76();}};try{return await oauthFlowAttempt(_0xf9ef18);}catch(_0x4839c3){if(_0x4a77ef[_0x3e05ea(0x14e)](_0x4839c3,OAuthTimeoutError)&&await _0x4a77ef[_0x3e05ea(0x145)](loadCachedClient))return console['log'](_0x3e05ea(0x13a)),await _0x4a77ef[_0x3e05ea(0x145)](clearCachedClient),await oauthFlowAttempt(_0xf9ef18);throw _0x4839c3;}}async function oauthFlowAttempt(_0x29dc66){const _0x4b598f=_0x3fb461,_0x460e2b={'qVxLy':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','FuZvq':function(_0x29562b,_0x5bb977,_0x4b3791){return _0x29562b(_0x5bb977,_0x4b3791);},'jsJcl':_0x4b598f(0x162),'EhVhN':'authorization_code','cmupw':_0x4b598f(0x137),'FbkPu':function(_0x53b9c1,_0x292d14){return _0x53b9c1(_0x292d14);},'Meypb':'base64url','DuMWF':'sha256','Tlaqf':'code','kImaM':'client_id','LsNpx':_0x4b598f(0x178),'OSDOz':_0x4b598f(0x1ab),'EyEYi':function(_0x75a3b8,_0x2cdcdf){return _0x75a3b8(_0x2cdcdf);},'XfDah':function(_0x5baecf,_0x2fc392,_0x293053){return _0x5baecf(_0x2fc392,_0x293053);},'oYPcE':_0x4b598f(0x18d),'xENqt':_0x4b598f(0x125),'usDzT':function(_0x2f3b58,_0x1a9a74,_0x5990c0,_0x5a29e8){return _0x2f3b58(_0x1a9a74,_0x5990c0,_0x5a29e8);}},_0x2f4919=_0x29dc66['replace'](/\/mcp$/,'');process[_0x4b598f(0x173)]['write'](_0x4b598f(0x15b));const _0x52fcda=await fetch(_0x2f4919+'/.well-known/oauth-protected-resource');if(!_0x52fcda['ok'])throw new Error(_0x460e2b[_0x4b598f(0x186)]);const _0x2474ea=await _0x52fcda[_0x4b598f(0x149)](),_0x1693e9=_0x2474ea['authorization_servers']?.[0x0];if(!_0x1693e9)throw new Error('No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata');console['log']('\x20'+_0x1693e9);const _0x16536b=await fetchAuthServerMetadata(_0x1693e9);let _0x1d721a,_0x17a7d7;const _0x19c02b=await loadCachedClient();if(_0x19c02b)_0x1d721a=_0x19c02b[_0x4b598f(0x142)],_0x17a7d7=_0x19c02b['clientSecret'];else{if(_0x16536b['registration_endpoint']){process[_0x4b598f(0x173)]['write']('Registering\x20OAuth\x20client...');const _0x2cc4b7=await _0x460e2b['FuZvq'](fetch,_0x16536b[_0x4b598f(0x196)],{'method':_0x4b598f(0x18d),'headers':{'Content-Type':_0x4b598f(0x13c)},'body':JSON[_0x4b598f(0x130)]({'client_name':_0x460e2b[_0x4b598f(0x16d)],'redirect_uris':['http://localhost:'+CALLBACK_PORT+'/callback'],'grant_types':[_0x460e2b['EhVhN'],_0x460e2b['cmupw']],'response_types':[_0x4b598f(0x1a5)],'token_endpoint_auth_method':_0x4b598f(0x136)})});if(!_0x2cc4b7['ok']){const _0x4d1f09=await _0x2cc4b7[_0x4b598f(0x167)]();throw new Error(_0x4b598f(0x1a6)+_0x4d1f09);}const _0x102a60=await _0x2cc4b7[_0x4b598f(0x149)]();_0x1d721a=_0x102a60[_0x4b598f(0x156)],_0x17a7d7=_0x102a60['client_secret'],await saveCachedClient(_0x1d721a,_0x17a7d7),console[_0x4b598f(0x13f)]('\x20done');}else throw new Error(_0x4b598f(0x189));}const _0x5b3e29=_0x460e2b['FbkPu'](randomBytes,0x20)[_0x4b598f(0x158)](_0x460e2b[_0x4b598f(0x171)]),_0x2bbd51=createHash(_0x460e2b[_0x4b598f(0x181)])[_0x4b598f(0x17d)](_0x5b3e29)['digest']('base64url'),_0x1b7f15=randomBytes(0x10)['toString'](_0x4b598f(0x191)),_0x5d8adc=new URL(_0x16536b[_0x4b598f(0x132)]);_0x5d8adc['searchParams']['set'](_0x4b598f(0x17a),_0x460e2b[_0x4b598f(0x1ae)]),_0x5d8adc['searchParams'][_0x4b598f(0x151)](_0x460e2b[_0x4b598f(0x14a)],_0x1d721a),_0x5d8adc[_0x4b598f(0x18a)]['set']('redirect_uri',_0x4b598f(0x150)+CALLBACK_PORT+'/callback'),_0x5d8adc['searchParams'][_0x4b598f(0x151)](_0x4b598f(0x19f),_0x2bbd51),_0x5d8adc[_0x4b598f(0x18a)]['set']('code_challenge_method',_0x460e2b[_0x4b598f(0x193)]),_0x5d8adc['searchParams']['set'](_0x460e2b[_0x4b598f(0x14d)],_0x1b7f15);_0x2474ea['resource']&&_0x5d8adc['searchParams']['set'](_0x4b598f(0x175),_0x2474ea[_0x4b598f(0x175)]);console[_0x4b598f(0x13f)]('\x0aOpening\x20browser\x20for\x20authentication...'),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x5d8adc[_0x4b598f(0x158)]()+'\x0a'),await _0x460e2b['EyEYi'](openBrowser,_0x5d8adc['toString']());const _0x2628d0=await waitForCallback(_0x1b7f15);process['stdout'][_0x4b598f(0x1b6)]('Exchanging\x20authorization\x20code...');const _0x1a703f=new URLSearchParams({'grant_type':_0x4b598f(0x197),'code':_0x2628d0,'redirect_uri':_0x4b598f(0x150)+CALLBACK_PORT+'/callback','client_id':_0x1d721a,'code_verifier':_0x5b3e29});_0x17a7d7&&_0x1a703f[_0x4b598f(0x151)](_0x4b598f(0x177),_0x17a7d7);_0x2474ea['resource']&&_0x1a703f[_0x4b598f(0x151)]('resource',_0x2474ea['resource']);const _0x5d5923=await _0x460e2b[_0x4b598f(0x128)](fetch,_0x16536b[_0x4b598f(0x135)],{'method':_0x460e2b[_0x4b598f(0x190)],'headers':{'Content-Type':_0x460e2b[_0x4b598f(0x13b)]},'body':_0x1a703f});if(!_0x5d5923['ok']){const _0xf1a9bd=await _0x5d5923['text']();throw new Error('Token\x20exchange\x20failed:\x20'+_0xf1a9bd);}const _0xcfd795=await _0x5d5923['json']();return console['log'](_0x4b598f(0x1a7)),await _0x460e2b[_0x4b598f(0x15f)](saveCachedToken,_0xcfd795['access_token'],_0xcfd795['refresh_token'],_0xcfd795[_0x4b598f(0x14b)]),_0xcfd795['access_token'];}async function callGetCliToken(_0x29c8dc,_0x3a999e){const _0x1fab3f=_0x3fb461,_0x333b91={'fcKtj':'POST','JgKiY':function(_0x5a0f08,_0x51acbb){return _0x5a0f08(_0x51acbb);},'PxPeB':_0x1fab3f(0x1b2),'quRNd':_0x1fab3f(0x1b1),'kQpXC':'initialize','yZwLy':_0x1fab3f(0x17f),'WAURb':_0x1fab3f(0x1a7),'VDiZM':function(_0x5d7138,_0xc6a425,_0x2aa77a){return _0x5d7138(_0xc6a425,_0x2aa77a);},'WmlWn':_0x1fab3f(0x139),'jSFuc':'Requesting\x20CLI\x20token...','ESBJm':_0x1fab3f(0x164),'lfcCW':function(_0x599c42,_0x28558d){return _0x599c42(_0x28558d);},'pdgfZ':_0x1fab3f(0x12e),'TGOkP':function(_0x16087c){return _0x16087c();},'WDLSi':function(_0x45a865,_0x570df3,_0x2182d2,_0x1fd519){return _0x45a865(_0x570df3,_0x2182d2,_0x1fd519);},'kEfAR':_0x1fab3f(0x198)},_0x46857c={'Content-Type':_0x1fab3f(0x13c),'Accept':'application/json,\x20text/event-stream'};_0x3a999e&&(_0x46857c[_0x333b91['PxPeB']]='Bearer\x20'+_0x3a999e);const _0x410517=async _0x3fd47d=>{const _0x42e25f=_0x1fab3f,_0x4720c1=await fetch(_0x29c8dc,{'method':_0x333b91[_0x42e25f(0x194)],'headers':_0x46857c,'body':JSON['stringify'](_0x3fd47d)});if(!_0x4720c1['ok']){const _0x4f3d60=await _0x4720c1['text']();throw new Error(_0x42e25f(0x1b0)+_0x4720c1[_0x42e25f(0x1b9)]+':\x20'+_0x4f3d60);}return _0x333b91[_0x42e25f(0x1a0)](parseResponse,_0x4720c1);};process[_0x1fab3f(0x173)]['write'](_0x1fab3f(0x124));const _0x2ea51f=await _0x410517({'jsonrpc':_0x333b91[_0x1fab3f(0x15c)],'id':0x1,'method':_0x333b91['kQpXC'],'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x333b91[_0x1fab3f(0x12d)],'version':'1.0.0'}}});if(_0x2ea51f['error'])throw new Error(_0x1fab3f(0x1aa)+(_0x2ea51f[_0x1fab3f(0x146)][_0x1fab3f(0x199)]??JSON[_0x1fab3f(0x130)](_0x2ea51f['error'])));console['log'](_0x333b91['WAURb']),await _0x333b91['VDiZM'](fetch,_0x29c8dc,{'method':_0x333b91[_0x1fab3f(0x194)],'headers':_0x46857c,'body':JSON[_0x1fab3f(0x130)]({'jsonrpc':'2.0','method':_0x333b91['WmlWn']})})[_0x1fab3f(0x160)](_0x21db07=>_0x21db07[_0x1fab3f(0x167)]()),process['stdout']['write'](_0x333b91[_0x1fab3f(0x16b)]);const _0x2de1e8=await _0x410517({'jsonrpc':_0x333b91['quRNd'],'id':0x2,'method':_0x333b91['ESBJm'],'params':{'name':'get_cli_token','arguments':{}}});if(_0x2de1e8[_0x1fab3f(0x146)])throw new Error(_0x1fab3f(0x18e)+(_0x2de1e8['error'][_0x1fab3f(0x199)]??JSON['stringify'](_0x2de1e8['error'])));console['log'](_0x333b91[_0x1fab3f(0x19c)]);const _0x23450d=_0x333b91[_0x1fab3f(0x17e)](extractToken,_0x2de1e8[_0x1fab3f(0x18f)]);if(!_0x23450d){console['error']('\x0aUnexpected\x20response\x20structure:'),console[_0x1fab3f(0x146)](JSON['stringify'](_0x2de1e8['result'],null,0x2));throw new Error(_0x333b91[_0x1fab3f(0x1b5)]);}const _0x44da97=join(_0x333b91['TGOkP'](homedir),'.ranger'),_0x2392c4=join(_0x44da97,_0x1fab3f(0x1a9));await mkdir(_0x44da97,{'recursive':!![]}),await _0x333b91['WDLSi'](writeFile,_0x2392c4,_0x23450d,{'mode':0x180}),await _0x333b91['WDLSi'](writeFile,join(_0x44da97,_0x1fab3f(0x172)),_0x29c8dc,{'mode':0x180}),console['log'](_0x1fab3f(0x152)+_0x2392c4),console[_0x1fab3f(0x13f)](_0x333b91['kEfAR']);}async function fetchAuthServerMetadata(_0x13b3e0){const _0x270b25=_0x3fb461,_0x49ce2f={'ghTAm':function(_0xe7cc68,_0x1bd11e){return _0xe7cc68(_0x1bd11e);}},_0x183efd=_0x13b3e0+_0x270b25(0x131),_0x33c61e=await _0x49ce2f['ghTAm'](fetch,_0x183efd);if(!_0x33c61e['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x183efd+':\x20'+_0x33c61e[_0x270b25(0x1b9)]);return _0x33c61e['json']();}function waitForCallback(_0x5c5201){const _0x42cbd6=_0x3fb461,_0x151356={'XhDNG':_0x42cbd6(0x176),'ZxuxX':'/callback','EkgMS':'error','ruVbk':_0x42cbd6(0x16e),'mEfCr':function(_0x59f0c8,_0xcffa3f){return _0x59f0c8!==_0xcffa3f;},'vgazY':function(_0x446fc9,_0x4fa742,_0x50c212){return _0x446fc9(_0x4fa742,_0x50c212);}};return new Promise((_0xfb089c,_0x3b27f9)=>{const _0x11c818=_0x42cbd6,_0xec669f={'nJJmE':function(_0x4c7404,_0x482c1f){return _0x4c7404!==_0x482c1f;},'ZWWql':_0x151356['ZxuxX'],'lPPYO':'code','roPHa':_0x151356[_0x11c818(0x19a)],'tdItJ':_0x151356[_0x11c818(0x1a2)],'XFDjn':function(_0x3dce22,_0xf87a78){return _0x3dce22(_0xf87a78);},'BLkBp':function(_0x434da8,_0x54eddf){return _0x151356['mEfCr'](_0x434da8,_0x54eddf);}},_0x59eb55=_0x151356[_0x11c818(0x185)](setTimeout,()=>{const _0x2f415=_0x11c818;_0x5de504[_0x2f415(0x1a3)](),_0x3b27f9(new OAuthTimeoutError(_0x151356[_0x2f415(0x143)]));},0x1d4c0),_0x5de504=createServer((_0x5709e9,_0x17011e)=>{const _0x46e7ab=_0x11c818,_0x31e66a=new URL(_0x5709e9[_0x46e7ab(0x122)]??'/',_0x46e7ab(0x150)+CALLBACK_PORT);if(_0xec669f['nJJmE'](_0x31e66a[_0x46e7ab(0x154)],_0xec669f[_0x46e7ab(0x14f)])){_0x17011e[_0x46e7ab(0x12a)](0x194),_0x17011e['end'](_0x46e7ab(0x1ba));return;}const _0x13a75a=_0x31e66a['searchParams']['get'](_0xec669f[_0x46e7ab(0x182)]),_0x2d94d7=_0x31e66a['searchParams'][_0x46e7ab(0x12f)](_0x46e7ab(0x1ab)),_0x395591=_0x31e66a[_0x46e7ab(0x18a)]['get'](_0xec669f[_0x46e7ab(0x15e)]);if(_0x395591){const _0x5b0a32=_0x31e66a[_0x46e7ab(0x18a)]['get']('error_description')??_0x395591;_0x17011e['writeHead'](0xc8,{'Content-Type':_0xec669f['tdItJ']}),_0x17011e[_0x46e7ab(0x157)](_0x46e7ab(0x133)+_0x5b0a32+_0x46e7ab(0x179)),clearTimeout(_0x59eb55),_0x5de504['close'](),_0xec669f['XFDjn'](_0x3b27f9,new Error(_0x46e7ab(0x19d)+_0x5b0a32));return;}if(!_0x13a75a||_0xec669f[_0x46e7ab(0x147)](_0x2d94d7,_0x5c5201)){_0x17011e[_0x46e7ab(0x12a)](0x190,{'Content-Type':_0xec669f['tdItJ']}),_0x17011e['end']('<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>');return;}_0x17011e['writeHead'](0xc8,{'Content-Type':_0xec669f['tdItJ']}),_0x17011e['end'](_0x46e7ab(0x15a)),clearTimeout(_0x59eb55),_0x5de504['close'](),_0xfb089c(_0x13a75a);});_0x5de504[_0x11c818(0x18b)](CALLBACK_PORT,'127.0.0.1');});}async function openBrowser(_0x477edc){const _0x36a2bf=_0x3fb461,_0x47724a={'lXLzR':_0x36a2bf(0x170),'Iyqnr':function(_0x5acc7b,_0xfe05c0){return _0x5acc7b===_0xfe05c0;},'uPyFO':_0x36a2bf(0x123),'XVNdf':function(_0x343a57,_0x28195a){return _0x343a57(_0x28195a);}},{exec:_0x53501b}=await import('child_process'),_0x410ceb=process['platform']==='darwin'?_0x47724a[_0x36a2bf(0x1ac)]:_0x47724a['Iyqnr'](process[_0x36a2bf(0x153)],_0x36a2bf(0x16f))?'start':_0x47724a['uPyFO'];_0x47724a['XVNdf'](_0x53501b,_0x410ceb+'\x20\x22'+_0x477edc+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x211d0b=_0x3fb461,_0x21d935={'QCKfk':function(_0x33299f,_0x1a2d0f){return _0x33299f>_0x1a2d0f;}};try{const _0x13ba11=JSON[_0x211d0b(0x183)](await readFile(TOKEN_CACHE_PATH,_0x211d0b(0x169)));if(_0x13ba11[_0x211d0b(0x166)]&&_0x13ba11['origin']!==currentOrigin)return null;if(_0x13ba11[_0x211d0b(0x138)]&&_0x21d935[_0x211d0b(0x13d)](Date[_0x211d0b(0x17b)](),_0x13ba11['expiresAt']))return null;return _0x13ba11['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0x338101,_0x213038,_0x1273e5){const _0x350acb=_0x3fb461,_0x2bcda1={'RciIg':function(_0x18195f){return _0x18195f();},'trypL':function(_0x13da75,_0x426b82){return _0x13da75+_0x426b82;},'FBwZE':function(_0x2c575c,_0x373465,_0x16acad){return _0x2c575c(_0x373465,_0x16acad);},'dIdnn':function(_0x8987e3,_0x1711ec,_0x9e2404){return _0x8987e3(_0x1711ec,_0x9e2404);},'ZtAHU':function(_0x28e7cf,_0x226731,_0x21a669,_0x18da74){return _0x28e7cf(_0x226731,_0x21a669,_0x18da74);}},_0x3831cd=await _0x2bcda1['RciIg'](loadCachedData),_0x386e19={..._0x3831cd,'origin':currentOrigin,'accessToken':_0x338101,'refreshToken':_0x213038??_0x3831cd?.[_0x350acb(0x19e)],'expiresAt':_0x1273e5?_0x2bcda1['trypL'](Date[_0x350acb(0x17b)](),_0x1273e5*0x3e8):undefined};await _0x2bcda1['FBwZE'](mkdir,_0x2bcda1[_0x350acb(0x13e)](join,homedir(),'.ranger'),{'recursive':!![]}),await _0x2bcda1['ZtAHU'](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x386e19),{'mode':0x180});}async function loadCachedClient(){const _0x692971=_0x3fb461,_0x330dd9=await loadCachedData();if(_0x330dd9?.[_0x692971(0x166)]&&_0x330dd9['origin']!==currentOrigin)return null;return _0x330dd9?.[_0x692971(0x142)]?{'clientId':_0x330dd9['clientId'],'clientSecret':_0x330dd9['clientSecret']}:null;}async function clearCachedClient(){const _0x5df4bc=_0x3fb461,_0x433e5d={'Vsqmz':function(_0x510885){return _0x510885();}},_0x2292e2=await _0x433e5d['Vsqmz'](loadCachedData);if(!_0x2292e2)return;const {clientId:_0x26b333,clientSecret:_0x4fb919,..._0x934716}=_0x2292e2;await writeFile(TOKEN_CACHE_PATH,JSON[_0x5df4bc(0x130)](_0x934716),{'mode':0x180});}async function saveCachedClient(_0x26d016,_0x15455b){const _0x5b6843=_0x3fb461,_0x387d98={'JPvdc':function(_0x24d9d3){return _0x24d9d3();},'RnXKP':_0x5b6843(0x1b7),'OWfBt':function(_0x39e7fb,_0x498454,_0x3e59af,_0x338a1a){return _0x39e7fb(_0x498454,_0x3e59af,_0x338a1a);}},_0x1295c3=await _0x387d98[_0x5b6843(0x1b4)](loadCachedData),_0x3fe28d={..._0x1295c3,'origin':currentOrigin,'accessToken':_0x1295c3?.['accessToken']??'','clientId':_0x26d016,'clientSecret':_0x15455b};await mkdir(join(homedir(),_0x387d98[_0x5b6843(0x15d)]),{'recursive':!![]}),await _0x387d98[_0x5b6843(0x18c)](writeFile,TOKEN_CACHE_PATH,JSON[_0x5b6843(0x130)](_0x3fe28d),{'mode':0x180});}async function loadCachedData(){const _0x204d9e=_0x3fb461,_0x819bfe={'lrTIU':function(_0x1a9364,_0x5a5b54,_0x33bcec){return _0x1a9364(_0x5a5b54,_0x33bcec);},'iMULp':_0x204d9e(0x169)};try{return JSON['parse'](await _0x819bfe[_0x204d9e(0x16c)](readFile,TOKEN_CACHE_PATH,_0x819bfe[_0x204d9e(0x174)]));}catch{return null;}}async function parseResponse(_0x4074d0){const _0x25c1c1=_0x3fb461,_0x981dea={'fmnhN':'text/event-stream','TUucv':'data:','EdpPf':function(_0x266715,_0x5d78f1){return _0x266715!==_0x5d78f1;}},_0x1e9afb=_0x4074d0['headers'][_0x25c1c1(0x12f)](_0x25c1c1(0x140))??'';if(_0x1e9afb['includes'](_0x981dea[_0x25c1c1(0x180)])){const _0x3b717c=await _0x4074d0[_0x25c1c1(0x167)]();for(const _0x4be3eb of _0x3b717c['split']('\x0a')){const _0x222242=_0x4be3eb['trim']();if(_0x222242[_0x25c1c1(0x1a1)](_0x25c1c1(0x163))){const _0x16216d=_0x222242['slice'](_0x981dea['TUucv']['length'])['trim']();if(!_0x16216d)continue;try{const _0x121176=JSON['parse'](_0x16216d);if(_0x981dea['EdpPf'](_0x121176['id'],undefined)||_0x121176[_0x25c1c1(0x146)])return _0x121176;}catch{}}}throw new Error('No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream');}return _0x4074d0[_0x25c1c1(0x149)]();}function extractToken(_0x99789f){const _0x50b8b9=_0x3fb461,_0xd3baec={'EzHqw':'string','dVlXA':_0x50b8b9(0x12b),'RgQVJ':function(_0x12b6f9,_0x4c7696){return _0x12b6f9===_0x4c7696;},'JQcuR':function(_0x59be27,_0x4ad1b6){return _0x59be27===_0x4ad1b6;}};if(!_0x99789f)return null;const _0xe2e488=_0x99789f[_0x50b8b9(0x192)];if(_0xe2e488?.['token']&&typeof _0xe2e488['token']===_0xd3baec['EzHqw'])return _0xe2e488[_0x50b8b9(0x19b)];if(_0x99789f[_0x50b8b9(0x195)]){const _0x63def9=_0x99789f[_0x50b8b9(0x1a4)];throw new Error('Server\x20returned\x20error:\x20'+(_0x63def9?.[0x0]?.[_0x50b8b9(0x167)]??_0xd3baec[_0x50b8b9(0x188)]));}const _0x5cffb1=_0x99789f['content'];if(_0x5cffb1)for(const _0x4d77b1 of _0x5cffb1){if(_0xd3baec[_0x50b8b9(0x161)](_0x4d77b1['type'],_0x50b8b9(0x167))&&_0x4d77b1['text']){try{const _0x1b9323=JSON[_0x50b8b9(0x183)](_0x4d77b1['text']);if(_0xd3baec['JQcuR'](typeof _0x1b9323?.[_0x50b8b9(0x19b)],_0x50b8b9(0x148)))return _0x1b9323['token'];}catch{}const _0xdfbf76=_0x4d77b1[_0x50b8b9(0x167)]['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0xdfbf76)return _0xdfbf76[0x1];}}return null;}function _0xd261(){const _0x186563=['BLkBp','string','json','kImaM','expires_in','67560YaTokR','OSDOz','fPOfg','ZWWql','http://localhost:','set','\x0aToken\x20written\x20to\x20','platform','pathname','1918278XhSfvu','client_id','end','toString','1.0.0','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','Discovering\x20authorization\x20server...','quRNd','RnXKP','roPHa','usDzT','then','RgQVJ','Ranger\x20CLI','data:','tools/call','4485627ktxQqz','origin','text','1532VTtpLf','utf-8','132004YZSpbv','jSFuc','lrTIU','jsJcl','text/html','win32','open','Meypb','auth-origin.txt','stdout','iMULp','resource','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','client_secret','S256','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','response_type','now','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','update','lfcCW','ranger-cli','fmnhN','DuMWF','lPPYO','parse','CARBB','vgazY','qVxLy','70FSmnhZ','dVlXA','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','searchParams','listen','OWfBt','POST','get_cli_token\x20failed:\x20','result','oYPcE','hex','structuredContent','LsNpx','fcKtj','isError','registration_endpoint','authorization_code','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','message','EkgMS','token','WAURb','OAuth\x20error:\x20','refreshToken','code_challenge','JgKiY','startsWith','ruVbk','close','content','code','Client\x20registration\x20failed:\x20','\x20done','5133282xgOxPV','refresh.txt','MCP\x20initialize\x20failed:\x20','state','lXLzR','5518144VGnapw','Tlaqf','name','HTTP\x20','2.0','Authorization','109fHbiyk','JPvdc','pdgfZ','write','.ranger','mcp-oauth-tokens.json','status','Not\x20found','url','xdg-open','Initializing\x20MCP\x20session...','application/x-www-form-urlencoded','proxied','UoNuv','XfDah','FrPPn','writeHead','Unknown\x20error','2025-03-26','yZwLy','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','get','stringify','/.well-known/oauth-authorization-server','authorization_endpoint','<html><body><h2>Authentication\x20failed</h2><p>','needs-oauth','token_endpoint','none','refresh_token','expiresAt','notifications/initialized','\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','xENqt','application/json','QCKfk','dIdnn','log','content-type','\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20','clientId','XhDNG','vLkwF','vVFpf','error'];_0xd261=function(){return _0x186563;};return _0xd261();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x864f(_0x545cb4,_0x26abbe){_0x545cb4=_0x545cb4-0x134;const _0x31dba2=_0x31db();let _0x864f36=_0x31dba2[_0x545cb4];return _0x864f36;}(function(_0x4d9fac,_0x490314){const _0x3bc1ed=_0x864f,_0x58d103=_0x4d9fac();while(!![]){try{const _0x1ca972=parseInt(_0x3bc1ed(0x147))/0x1*(parseInt(_0x3bc1ed(0x160))/0x2)+-parseInt(_0x3bc1ed(0x142))/0x3*(parseInt(_0x3bc1ed(0x154))/0x4)+-parseInt(_0x3bc1ed(0x167))/0x5+-parseInt(_0x3bc1ed(0x155))/0x6*(parseInt(_0x3bc1ed(0x152))/0x7)+-parseInt(_0x3bc1ed(0x146))/0x8+-parseInt(_0x3bc1ed(0x150))/0x9+parseInt(_0x3bc1ed(0x162))/0xa;if(_0x1ca972===_0x490314)break;else _0x58d103['push'](_0x58d103['shift']());}catch(_0x733a63){_0x58d103['push'](_0x58d103['shift']());}}}(_0x31db,0x4b616));import{join}from'path';import{existsSync}from'fs';import _0x538797 from'inquirer';import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x554647){const _0x1cd55a=_0x864f,_0x5059e4={'sAEzi':_0x1cd55a(0x137),'zuFxk':_0x1cd55a(0x135),'FFVUZ':function(_0x4026d4,_0x146184){return _0x4026d4(_0x146184);},'dEBss':function(_0x1ecbb8,_0x44adf7,_0x3f43f8){return _0x1ecbb8(_0x44adf7,_0x3f43f8);},'FzYdh':function(_0x1d64c5){return _0x1d64c5();},'kGyFD':'.claude','kbkvf':'list','EXxKm':_0x1cd55a(0x151),'DAaqM':_0x1cd55a(0x145),'jhIJu':function(_0x47cef6,_0x4d0b31){return _0x47cef6(_0x4d0b31);},'toadb':_0x1cd55a(0x140),'oTWrt':_0x1cd55a(0x158),'stxFF':_0x1cd55a(0x13b),'DHFOM':'❌\x20Failed\x20to\x20add\x20marketplace:','hILIw':'\x0aYou\x20can\x20install\x20manually\x20with:','ohlBd':'\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','kuEGD':_0x1cd55a(0x16b),'WkDWT':function(_0x4e47b4,_0x2632f3){return _0x4e47b4===_0x2632f3;},'IfJjf':_0x1cd55a(0x156),'ZEQnm':_0x1cd55a(0x14e),'UWRKE':_0x1cd55a(0x136)},_0x5321aa=await isPluginInstalled(_0x5059e4['sAEzi']);if(_0x5321aa)return console[_0x1cd55a(0x138)](_0x5059e4['zuFxk']),![];const _0x3df8fa=_0x5059e4[_0x1cd55a(0x15c)](existsSync,_0x5059e4[_0x1cd55a(0x14f)](join,_0x5059e4['FzYdh'](getProjectRoot),_0x5059e4[_0x1cd55a(0x13a)]));let _0x3ebe1e;if(_0x554647)_0x3ebe1e=_0x554647;else{if(_0x3df8fa)_0x3ebe1e='project';else{console[_0x1cd55a(0x138)](_0x1cd55a(0x15f));const _0x3cc8de=await _0x538797['prompt']([{'type':_0x5059e4['kbkvf'],'name':_0x5059e4['EXxKm'],'message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':_0x1cd55a(0x161),'value':'user'},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':'project'}],'default':_0x5059e4['DAaqM']}]);_0x3ebe1e=_0x3cc8de[_0x1cd55a(0x151)];}}console[_0x1cd55a(0x138)]('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x3ebe1e+'\x20level)...\x0a');const _0x251df0=await _0x5059e4[_0x1cd55a(0x168)](isMarketplaceAdded,_0x1cd55a(0x13d));let _0x583b6c=_0x251df0;if(_0x251df0)console[_0x1cd55a(0x138)]('✓\x20Marketplace\x20already\x20added');else{const _0x498561=await _0x5059e4['jhIJu'](runClaudeCommand,[_0x5059e4[_0x1cd55a(0x169)],_0x5059e4['oTWrt'],_0x5059e4[_0x1cd55a(0x149)],'ranger-testing/trailhead']);!_0x498561[_0x1cd55a(0x165)]?(console[_0x1cd55a(0x14a)](_0x5059e4['DHFOM'],_0x498561[_0x1cd55a(0x14a)]),console[_0x1cd55a(0x138)](_0x5059e4[_0x1cd55a(0x166)]),console[_0x1cd55a(0x138)](_0x5059e4['ohlBd']),console[_0x1cd55a(0x138)](_0x1cd55a(0x14d)+_0x3ebe1e)):_0x583b6c=!![];}if(_0x583b6c){const _0x12fc82=await _0x5059e4['FFVUZ'](runClaudeCommand,[_0x5059e4['toadb'],'install',_0x5059e4['sAEzi'],'--scope',_0x3ebe1e]);if(!_0x12fc82['success'])console['error']('❌\x20Failed\x20to\x20install\x20plugin:',_0x12fc82['error']),console['log']('\x0aYou\x20can\x20install\x20manually\x20with:'),console[_0x1cd55a(0x138)]('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x3ebe1e);else{console[_0x1cd55a(0x138)](_0x1cd55a(0x15e));const _0x5c92a0=[_0x1cd55a(0x140),_0x5059e4[_0x1cd55a(0x14c)],'ranger@trailhead'];_0x5059e4[_0x1cd55a(0x15b)](_0x3ebe1e,'project')&&_0x5c92a0['push'](_0x5059e4['IfJjf'],_0x5059e4[_0x1cd55a(0x15d)]);const _0xa9d453=await runClaudeCommand(_0x5c92a0,{'captureOutput':!![]}),_0x48b0ff=_0xa9d453[_0x1cd55a(0x143)]?.[_0x1cd55a(0x15a)]('already\x20enabled');!_0xa9d453['success']&&!_0x48b0ff?console['error'](_0x1cd55a(0x13f),_0xa9d453['error']):console['log'](_0x5059e4[_0x1cd55a(0x141)]);}}return!![];}export async function ensureClaudeSkills(_0x49ab59){const _0x483010=_0x864f,_0x259bc8={'zZwAz':function(_0x191463,_0x26ec19){return _0x191463(_0x26ec19);},'AbEmM':function(_0x571588,_0x30ea6b,_0x5834fd,_0x1681f2){return _0x571588(_0x30ea6b,_0x5834fd,_0x1681f2);},'peaRk':function(_0x57602f,_0x96590f){return _0x57602f(_0x96590f);},'rTVEL':_0x483010(0x145),'oqfXh':_0x483010(0x148),'gOylM':_0x483010(0x16a),'EpYJt':'project','CwNnz':_0x483010(0x144),'BPDTA':function(_0x12b1e9,_0x395d0e,_0x3be905){return _0x12b1e9(_0x395d0e,_0x3be905);},'rrFZD':'.claude','BIsEE':_0x483010(0x163),'xxCSO':'Would\x20you\x20like\x20to\x20install\x20skills?'},_0x1775e2=_0x259bc8[_0x483010(0x159)](existsSync,_0x259bc8[_0x483010(0x139)](join,_0x259bc8[_0x483010(0x13e)](getSkillsDir,_0x259bc8['rTVEL']),_0x259bc8[_0x483010(0x153)],_0x259bc8[_0x483010(0x164)])),_0x4bf92c=existsSync(join(getSkillsDir(_0x259bc8['EpYJt']),'ranger','SKILL.md'));if(_0x1775e2||_0x4bf92c)return console['log'](_0x259bc8[_0x483010(0x134)]),![];const _0x154ed3=existsSync(_0x259bc8['BPDTA'](join,getProjectRoot(),_0x259bc8[_0x483010(0x13c)]));let _0x200655=!![];if(_0x49ab59)await skillup({'autoInstall':_0x49ab59,'suppressUsage':!![]});else{if(_0x154ed3)await skillup({'autoInstall':_0x483010(0x14e),'suppressUsage':!![]});else{const _0x5be689=await _0x538797['prompt']([{'type':_0x483010(0x14b),'name':_0x259bc8['BIsEE'],'message':_0x259bc8[_0x483010(0x157)],'default':!![]}]);_0x200655=_0x5be689[_0x483010(0x163)],_0x200655&&await _0x259bc8[_0x483010(0x159)](skillup,{'suppressUsage':!![]});}}return _0x200655;}function _0x31db(){const _0x44d63f=['AbEmM','kGyFD','add','rrFZD','trailhead','peaRk','⚠\x20Failed\x20to\x20enable\x20plugin:','plugin','UWRKE','3kRugMU','output','✓\x20Ranger\x20skills\x20already\x20installed','user','4749872vuQHbo','64qyCioA','ranger','stxFF','error','confirm','kuEGD','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','project','dEBss','1007397FHTWaN','pluginScope','49txaZoD','oqfXh','2102352UqGRlK','474612WjZTQs','--scope','xxCSO','marketplace','zZwAz','includes','WkDWT','FFVUZ','ZEQnm','✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','\x0a📦\x20Claude\x20Code\x20Plugin\x0a','10866fwLxIz','User\x20(available\x20in\x20all\x20your\x20projects)','20842920XVlFeu','wantsSkillup','gOylM','success','hILIw','1691385CDHJYQ','jhIJu','toadb','SKILL.md','enable','CwNnz','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','✓\x20Claude\x20Code\x20plugin\x20enabled','ranger@trailhead','log'];_0x31db=function(){return _0x44d63f;};return _0x31db();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x21d8f1,_0x3eb0ac){const _0x40087f=_0x4dcc,_0x3580a1=_0x21d8f1();while(!![]){try{const _0x594b83=-parseInt(_0x40087f(0x1e0))/0x1+-parseInt(_0x40087f(0x1dd))/0x2*(-parseInt(_0x40087f(0x1de))/0x3)+-parseInt(_0x40087f(0x1e1))/0x4*(-parseInt(_0x40087f(0x1eb))/0x5)+-parseInt(_0x40087f(0x1e5))/0x6*(-parseInt(_0x40087f(0x1ee))/0x7)+parseInt(_0x40087f(0x1f0))/0x8*(parseInt(_0x40087f(0x1e6))/0x9)+parseInt(_0x40087f(0x1ef))/0xa+-parseInt(_0x40087f(0x1f9))/0xb*(parseInt(_0x40087f(0x1f4))/0xc);if(_0x594b83===_0x3eb0ac)break;else _0x3580a1['push'](_0x3580a1['shift']());}catch(_0x299588){_0x3580a1['push'](_0x3580a1['shift']());}}}(_0x4480,0x28791));import{join}from'path';function _0x4480(){const _0x705714=['JoJdG','prompt','list','gVxAp','33YQoEEz','Where\x20should\x20the\x20plugin\x20be\x20installed?','isArray','Failed\x20to\x20read\x20opencode.json','7190OHPihv','57Zcefpu','Project\x20(shared\x20with\x20team\x20via\x20git)','262800IObKXC','185876nHQNJl','GicRb','pluginScope','log','6IsMFbb','153AxKDHH','JNpCU','bTIUD','✓\x20OpenCode\x20plugin\x20configured','aDlZO','35DovQaA','plugin','$schema','2295167wVrSTc','2551220PPCHni','116408nGGrCJ','error','project','CkZSo','3181524wcSKZg'];_0x4480=function(){return _0x705714;};return _0x4480();}import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0x1dd3fb from'inquirer';function _0x4dcc(_0x549037,_0x6b1349){_0x549037=_0x549037-0x1db;const _0x4480f8=_0x4480();let _0x4dcce1=_0x4480f8[_0x549037];return _0x4dcce1;}import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0x3c0dbd){const _0x508c67=_0x4dcc,_0x4c2be3={'JNpCU':function(_0x26ba10,_0x31ee9f){return _0x26ba10(_0x31ee9f);},'JoJdG':_0x508c67(0x1f2),'pzoPa':_0x508c67(0x1f7),'qmwbL':'pluginScope','GicRb':_0x508c67(0x1fa),'ssoag':'User\x20(available\x20in\x20all\x20your\x20projects)','gVxAp':'user','CkZSo':function(_0x703c3,_0x37040d,_0x37001c){return _0x703c3(_0x37040d,_0x37001c);},'DqZoH':'opencode.json','bTIUD':'@ranger-testing/opencode-plugin','aDlZO':'utf-8','oTFRq':_0x508c67(0x1dc)},_0x4de0fc=existsSync(join(_0x4c2be3[_0x508c67(0x1e7)](getOpencodeConfigDir,'project'),'opencode.json'));let _0xa00af2;if(_0x3c0dbd)_0xa00af2=_0x3c0dbd;else{if(_0x4de0fc)_0xa00af2=_0x4c2be3[_0x508c67(0x1f5)];else{console[_0x508c67(0x1e4)]('\x0a📦\x20OpenCode\x20Plugin\x0a');const _0x53c65c=await _0x1dd3fb[_0x508c67(0x1f6)]([{'type':_0x4c2be3['pzoPa'],'name':_0x4c2be3['qmwbL'],'message':_0x4c2be3[_0x508c67(0x1e2)],'choices':[{'name':_0x4c2be3['ssoag'],'value':_0x4c2be3[_0x508c67(0x1f8)]},{'name':_0x508c67(0x1df),'value':_0x508c67(0x1f2)}],'default':_0x4c2be3[_0x508c67(0x1f8)]}]);_0xa00af2=_0x53c65c[_0x508c67(0x1e3)];}}const _0x1742cb=_0x4c2be3[_0x508c67(0x1f3)](join,getOpencodeConfigDir(_0xa00af2),_0x4c2be3['DqZoH']),_0x1e88c8=_0x4c2be3[_0x508c67(0x1e8)],_0x26aeab='https://opencode.ai/config.json';let _0x3e2621={};if(existsSync(_0x1742cb))try{const _0x5d39b7=await _0x4c2be3[_0x508c67(0x1f3)](readFile,_0x1742cb,_0x4c2be3[_0x508c67(0x1ea)]);_0x3e2621=JSON['parse'](_0x5d39b7);}catch(_0x2248d8){return console[_0x508c67(0x1f1)]('⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.'),{'configured':![],'scope':_0xa00af2,'error':_0x4c2be3['oTFRq'],'details':_0x2248d8};}const _0x463823=Array[_0x508c67(0x1db)](_0x3e2621[_0x508c67(0x1ec)])?_0x3e2621[_0x508c67(0x1ec)]:[];if(_0x463823['includes'](_0x1e88c8))return console['log']('✓\x20OpenCode\x20plugin\x20already\x20configured'),{'configured':![],'scope':_0xa00af2};return _0x3e2621[_0x508c67(0x1ed)]=_0x3e2621['$schema']||_0x26aeab,_0x3e2621[_0x508c67(0x1ec)]=[..._0x463823,_0x1e88c8],await _0x4c2be3[_0x508c67(0x1f3)](mkdir,getOpencodeConfigDir(_0xa00af2),{'recursive':!![]}),await writeFile(_0x1742cb,JSON['stringify'](_0x3e2621,null,0x2)+'\x0a'),console[_0x508c67(0x1e4)](_0x508c67(0x1e9)),{'configured':!![],'scope':_0xa00af2};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5e0c3a,_0x2ef327){const _0x20f3ab=_0x3111,_0x206c75=_0x5e0c3a();while(!![]){try{const _0x1c63c4=-parseInt(_0x20f3ab(0x85))/0x1*(-parseInt(_0x20f3ab(0x9f))/0x2)+-parseInt(_0x20f3ab(0x74))/0x3+parseInt(_0x20f3ab(0x8b))/0x4+parseInt(_0x20f3ab(0x98))/0x5+-parseInt(_0x20f3ab(0x8c))/0x6*(parseInt(_0x20f3ab(0x80))/0x7)+-parseInt(_0x20f3ab(0xa3))/0x8*(-parseInt(_0x20f3ab(0xa0))/0x9)+-parseInt(_0x20f3ab(0xb3))/0xa;if(_0x1c63c4===_0x2ef327)break;else _0x206c75['push'](_0x206c75['shift']());}catch(_0x416a9c){_0x206c75['push'](_0x206c75['shift']());}}}(_0x55ce,0x47e4b));function _0x3111(_0x3003f0,_0x553743){_0x3003f0=_0x3003f0-0x74;const _0x55cea9=_0x55ce();let _0x3111f6=_0x55cea9[_0x3003f0];return _0x3111f6;}import{mkdir,readFile,readdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{authenticate,ensureRangerDir,ensureChromium,writeRangerGitignore}from'./start.js';import{skillup}from'./skillup.js';import{getRangerDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{saveSettings}from'./utils/settings.js';import{decrypt}from'./utils/crypto.js';import{getToken}from'./utils/keychain.js';function _0x55ce(){const _0x60212=['RjFMf','153460IdzpAL','12JFlGOK','Installing\x20Claude\x20Code\x20plugin\x20(project\x20level)...','✓\x20Encrypted\x20auth\x20verified\x20(will\x20decrypt\x20at\x20runtime)','EQmQn','bEQtT','name','Failed\x20to\x20add\x20marketplace:','fuWpX','tkRtP','trackPhaseStart','baseUrl','sessions','1321175KPdnyx','givSc','QrpMe','xlTqp','error','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','\x0a🔧\x20Ranger\x20CI\x20Setup\x0a','4538fMfCuG','674901lxRiIe','marketplace','CedGK','16xahxfb','profile_activate','PQlwc','skipChromium','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','auth.json','path','DntfM','DdIfI','Failed\x20to\x20install\x20plugin:','ranger@trailhead','shNMj','chromium','project','No\x20CI\x20profiles\x20found\x20in\x20.ranger/ci/.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','map','2779290hRKMyW','dir_setup','ZUUfY','plugin','452922mQRdnY','log','Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.','pfFae','ZBSoE','add','No\x20API\x20token\x20available\x20for\x20decryption','rcIph','\x22\x20has\x20no\x20settings.json.\x20Use\x20--base-url\x20to\x20configure\x20it.','success','wIpWw','✓\x20Created\x20profile\x20settings:\x20baseUrl=','275191MgnPZp','LOZLd','✓\x20Marketplace\x20already\x20added','\x0a✅\x20Ranger\x20CI\x20setup\x20complete!\x0a','profile','154WLOdRQ','skills','EuxMx','rMYQE','trackPhaseEnd'];_0x55ce=function(){return _0x60212;};return _0x55ce();}import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'./utils/claudePlugin.js';async function findCiProfile(_0x35237b){const _0x55a4dd=_0x3111,_0x5c2f40={'ZUUfY':function(_0x2f35fb,_0x3acd81,_0x219967){return _0x2f35fb(_0x3acd81,_0x219967);},'tkRtP':function(_0x5a7884,_0x425562){return _0x5a7884(_0x425562);},'xlTqp':function(_0x41ac2c,_0x383a16){return _0x41ac2c+_0x383a16;},'ahdQQ':'No\x20CI\x20profiles\x20found.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','XAyPT':_0x55a4dd(0x76),'rhoiE':function(_0x1f570d,_0x132a14){return _0x1f570d===_0x132a14;},'xGUfj':function(_0xa87127,_0x6412b9){return _0xa87127===_0x6412b9;}},_0x3d2c0d=getRangerDir(),_0x47d927=join(_0x3d2c0d,'ci');if(_0x35237b){const _0x2dfd3e=_0x5c2f40['ZUUfY'](join,_0x47d927,_0x35237b);return{'name':_0x35237b,'path':_0x2dfd3e};}if(!_0x5c2f40[_0x55a4dd(0x94)](existsSync,_0x47d927))throw new Error(_0x5c2f40[_0x55a4dd(0x9b)](_0x5c2f40['ahdQQ'],_0x5c2f40['XAyPT']));const _0x4e8a00=await _0x5c2f40[_0x55a4dd(0xb5)](readdir,_0x47d927,{'withFileTypes':!![]}),_0x23e886=_0x4e8a00['filter'](_0x2edba0=>_0x2edba0['isDirectory']())[_0x55a4dd(0xb2)](_0xdb9b14=>_0xdb9b14['name']);if(_0x5c2f40['rhoiE'](_0x23e886['length'],0x0))throw new Error(_0x55a4dd(0xb1)+_0x5c2f40['XAyPT']);if(_0x5c2f40['xGUfj'](_0x23e886['length'],0x1)){const _0x446aea=_0x23e886[0x0];return console[_0x55a4dd(0x75)]('Auto-detected\x20CI\x20profile:\x20'+_0x446aea),{'name':_0x446aea,'path':join(_0x47d927,_0x446aea)};}throw new Error('Multiple\x20CI\x20profiles\x20found:\x20'+_0x23e886['join'](',\x20')+'.\x20Use\x20--profile\x20to\x20specify\x20which\x20one.');}async function installPluginNonInteractive(){const _0x1c63ee=_0x3111,_0x126c45={'RyHHB':function(_0x558fea,_0x582e39){return _0x558fea(_0x582e39);},'lvbTJ':_0x1c63ee(0xad),'shNMj':_0x1c63ee(0x8d),'CedGK':function(_0x47a733,_0xc05d37){return _0x47a733(_0xc05d37);},'IdfIz':function(_0x10dea6,_0x4466ed){return _0x10dea6(_0x4466ed);},'wIpWw':'You\x20can\x20install\x20manually:\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','MLzgi':function(_0x33da68,_0x42a5c8){return _0x33da68(_0x42a5c8);},'FmMSA':'plugin','givSc':'--scope','RjFMf':_0x1c63ee(0xac),'LOZLd':'You\x20can\x20install\x20manually:\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20project'},_0xf557d0=await _0x126c45['RyHHB'](isPluginInstalled,_0x126c45['lvbTJ']);if(_0xf557d0)return console[_0x1c63ee(0x75)](_0x1c63ee(0xa7)),![];console[_0x1c63ee(0x75)](_0x126c45[_0x1c63ee(0xae)]);const _0x2bade1=await _0x126c45[_0x1c63ee(0xa2)](isMarketplaceAdded,'trailhead');let _0x438d23=_0x2bade1;if(_0x2bade1)console[_0x1c63ee(0x75)](_0x1c63ee(0x82));else{const _0x5debf3=await _0x126c45['IdfIz'](runClaudeCommand,['plugin',_0x1c63ee(0xa1),_0x1c63ee(0x79),'ranger-testing/trailhead']);!_0x5debf3[_0x1c63ee(0x7d)]?(console[_0x1c63ee(0x9c)](_0x1c63ee(0x92),_0x5debf3['error']),console[_0x1c63ee(0x75)](_0x126c45[_0x1c63ee(0x7e)])):_0x438d23=!![];}if(_0x438d23){const _0x2f0235=await _0x126c45['MLzgi'](runClaudeCommand,[_0x126c45['FmMSA'],'install',_0x1c63ee(0xad),_0x126c45[_0x1c63ee(0x99)],_0x1c63ee(0xb0)]);!_0x2f0235[_0x1c63ee(0x7d)]?(console[_0x1c63ee(0x9c)](_0x126c45[_0x1c63ee(0x8a)],_0x2f0235[_0x1c63ee(0x9c)]),console[_0x1c63ee(0x75)](_0x126c45[_0x1c63ee(0x81)])):console[_0x1c63ee(0x75)]('✓\x20Claude\x20Code\x20plugin\x20installed');}return!![];}export async function setupCi(_0x4ac1fd,_0x2b09f1,_0x24e2b9){const _0x30d2cd=_0x3111,_0xe62476={'DntfM':_0x30d2cd(0x9e),'QrpMe':'auth','pfFae':function(_0x13bf09,_0x19a405){return _0x13bf09(_0x19a405);},'bEQtT':_0x30d2cd(0xb4),'fuWpX':function(_0x5e51eb,_0x5bf398){return _0x5e51eb(_0x5bf398);},'PQlwc':function(_0xb715cc,_0x24051a,_0x2029e8){return _0xb715cc(_0x24051a,_0x2029e8);},'lwZzM':_0x30d2cd(0xaf),'EuxMx':_0x30d2cd(0xa4),'DdIfI':'settings.json','ceREj':_0x30d2cd(0xa8),'EQmQn':'auth.json.enc','ZBSoE':_0x30d2cd(0x8e),'Jhizy':function(_0x145324,_0x3f6778){return _0x145324 instanceof _0x3f6778;},'rMYQE':function(_0x1b3696,_0x417fc4){return _0x1b3696(_0x417fc4);},'rcIph':function(_0x4553d8){return _0x4553d8();}};console[_0x30d2cd(0x75)](_0xe62476[_0x30d2cd(0xaa)]),_0x24e2b9?.[_0x30d2cd(0x95)](_0xe62476['QrpMe']),await _0xe62476[_0x30d2cd(0x77)](authenticate,_0x4ac1fd),_0x24e2b9?.[_0x30d2cd(0x89)](_0xe62476[_0x30d2cd(0x9a)]),_0x24e2b9?.[_0x30d2cd(0x95)](_0xe62476[_0x30d2cd(0x90)]);const {path:_0xc039e0,installed:_0x5cb3d8}=await ensureRangerDir();await _0xe62476[_0x30d2cd(0x93)](writeRangerGitignore,_0xc039e0);const _0x57ef84=join(_0xc039e0,_0x30d2cd(0x97));!_0xe62476['pfFae'](existsSync,_0x57ef84)&&await _0xe62476[_0x30d2cd(0xa5)](mkdir,_0x57ef84,{'recursive':!![]});_0x24e2b9?.['trackPhaseEnd'](_0x30d2cd(0xb4),{'installed':_0x5cb3d8}),_0x24e2b9?.[_0x30d2cd(0x95)](_0xe62476['lwZzM']);let _0x4e465e=![];_0x2b09f1?.[_0x30d2cd(0xa6)]?console['log'](_0x30d2cd(0x9d)):_0x4e465e=await ensureChromium();_0x24e2b9?.[_0x30d2cd(0x89)](_0x30d2cd(0xaf),{'installed':_0x4e465e,'skipped':!!_0x2b09f1?.[_0x30d2cd(0xa6)]}),_0x24e2b9?.[_0x30d2cd(0x95)](_0xe62476['EuxMx']);const _0x333ebb=await findCiProfile(_0x2b09f1?.[_0x30d2cd(0x84)]);let _0x161ebf=![];_0x2b09f1?.[_0x30d2cd(0x96)]&&(await _0xe62476[_0x30d2cd(0xa5)](mkdir,_0x333ebb[_0x30d2cd(0xa9)],{'recursive':!![]}),await _0xe62476['PQlwc'](saveSettings,_0x333ebb[_0x30d2cd(0x91)],{'baseUrl':_0x2b09f1['baseUrl'],'headless':!![]}),console['log'](_0x30d2cd(0x7f)+_0x2b09f1[_0x30d2cd(0x96)]),_0x161ebf=!![]);const _0x4354eb=join(_0x333ebb[_0x30d2cd(0xa9)],_0xe62476[_0x30d2cd(0xab)]);if(!existsSync(_0x4354eb)&&!_0x161ebf)throw new Error('CI\x20profile\x20\x22'+_0x333ebb['name']+_0x30d2cd(0x7c));const _0x452b60=_0xe62476[_0x30d2cd(0xa5)](join,_0x333ebb['path'],_0xe62476['ceREj']),_0x558e0c=join(_0x333ebb[_0x30d2cd(0xa9)],_0xe62476[_0x30d2cd(0x8f)]),_0x30e699=_0xe62476['pfFae'](existsSync,_0x452b60),_0x50c9dc=_0xe62476['fuWpX'](existsSync,_0x558e0c);if(_0x50c9dc)try{const _0x127370=await getToken();if(!_0x127370)throw new Error(_0x30d2cd(0x7a));const _0x42cfd1=await readFile(_0x558e0c);decrypt(_0x42cfd1,_0x127370),console['log'](_0xe62476[_0x30d2cd(0x78)]);}catch(_0x1618a2){const _0x46234b=_0xe62476['Jhizy'](_0x1618a2,Error)?_0x1618a2['message']:_0xe62476[_0x30d2cd(0x88)](String,_0x1618a2);throw new Error('Failed\x20to\x20verify\x20encrypted\x20auth\x20for\x20profile\x20\x22'+_0x333ebb[_0x30d2cd(0x91)]+'\x22:\x20'+_0x46234b);}else _0x30e699?console['log']('✓\x20Auth\x20state\x20found'):console['log']('\x20\x20No\x20auth\x20state\x20found\x20(app\x20may\x20not\x20require\x20authentication)');await _0xe62476['pfFae'](writeActiveProfileName,_0x333ebb['name']),console[_0x30d2cd(0x75)]('✓\x20Active\x20profile:\x20'+_0x333ebb[_0x30d2cd(0x91)]),_0x24e2b9?.['trackPhaseEnd'](_0xe62476[_0x30d2cd(0x87)],{'profileName':_0x333ebb[_0x30d2cd(0x91)],'hasAuth':_0x30e699,'hasEncryptedAuth':_0x50c9dc,'createdSettings':_0x161ebf}),_0x24e2b9?.[_0x30d2cd(0x95)](_0x30d2cd(0xb6));const _0x22fcc4=await _0xe62476[_0x30d2cd(0x7b)](installPluginNonInteractive);_0x24e2b9?.['trackPhaseEnd']('plugin',{'installed':_0x22fcc4}),_0x24e2b9?.[_0x30d2cd(0x95)]('skills'),await skillup({'autoInstall':_0x30d2cd(0xb0)}),_0x24e2b9?.[_0x30d2cd(0x89)](_0x30d2cd(0x86)),console['log'](_0x30d2cd(0x83));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x29b5d7,_0x5720a9){const _0x2b6675=_0x25fd,_0xbd8189=_0x29b5d7();while(!![]){try{const _0x4f8c68=-parseInt(_0x2b6675(0xf4))/0x1*(parseInt(_0x2b6675(0x11e))/0x2)+-parseInt(_0x2b6675(0x112))/0x3*(-parseInt(_0x2b6675(0x102))/0x4)+parseInt(_0x2b6675(0x10c))/0x5*(-parseInt(_0x2b6675(0x113))/0x6)+-parseInt(_0x2b6675(0xf8))/0x7+-parseInt(_0x2b6675(0x11d))/0x8*(-parseInt(_0x2b6675(0x101))/0x9)+parseInt(_0x2b6675(0x104))/0xa*(-parseInt(_0x2b6675(0xf2))/0xb)+-parseInt(_0x2b6675(0xf3))/0xc*(-parseInt(_0x2b6675(0x11b))/0xd);if(_0x4f8c68===_0x5720a9)break;else _0xbd8189['push'](_0xbd8189['shift']());}catch(_0xa8108d){_0xbd8189['push'](_0xbd8189['shift']());}}}(_0x5248,0xb6b5b));import{basename}from'path';import _0x42f6e8 from'inquirer';function _0x5248(){const _0x4e771f=['platform','message','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','All\x20projects\x20(','VOpQF','oIstZ','bPwLX','6480909HqtrdO','137044TBNqSz','prompt','952940zgyTya','This\x20project\x20only\x20(','KOuwa','Cnhgo','log','ictab','\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','autoInstall','85yDcwQK','opencode','nLHoT','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','\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!','\x20skill','69DPKZaD','69636IbblsP','\x20successfully!\x0a','user','ojjYo','\x0a📦\x20Installing\x20skills...\x0a','suppressUsage','mUodD','project','3016hbdsYk','/skills/','8ypOVyQ','2980342nVqYfL','\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a','121nmtvQe','160488nPKpIz','1inspzD','✓\x20Found\x20API\x20token','isTTY','\x20<your-api-token>','7887502VMWqqp','jjFnR'];_0x5248=function(){return _0x4e771f;};return _0x5248();}import{getToken}from'./utils/keychain.js';function _0x25fd(_0x21dab0,_0x14b025){_0x21dab0=_0x21dab0-0xf2;const _0x524886=_0x5248();let _0x25fdaa=_0x524886[_0x21dab0];return _0x25fdaa;}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(_0x41be95={}){const _0x5d1d1c=_0x25fd,_0x1c4b46={'SfvWf':'claude','VOpQF':function(_0x9c8135){return _0x9c8135();},'jjFnR':'To\x20get\x20started:','aNpPE':function(_0x18dab0,_0x4897a4){return _0x18dab0===_0x4897a4;},'ictab':'opencode','bPwLX':'\x20--opencode','kZwkF':function(_0x493f13,_0x8dfd05){return _0x493f13===_0x8dfd05;},'aeyeb':function(_0x5afda6,_0x3f9be8){return _0x5afda6(_0x3f9be8);},'KOuwa':'list','ojjYo':'Where\x20should\x20skills\x20be\x20installed?','Ggjmv':'user','oIstZ':function(_0x2b2f6d){return _0x2b2f6d();},'mUodD':'ranger','nLHoT':'\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','Cnhgo':'project-level','Rgvac':_0x5d1d1c(0x11f)};console[_0x5d1d1c(0x108)]('\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a');const _0x4a9ee3=_0x41be95[_0x5d1d1c(0xfa)]??_0x1c4b46['SfvWf'],_0x1320d0=await _0x1c4b46[_0x5d1d1c(0xfe)](getToken);if(!_0x1320d0){console[_0x5d1d1c(0x108)](_0x5d1d1c(0x10f)),console['log'](_0x1c4b46[_0x5d1d1c(0xf9)]),console[_0x5d1d1c(0x108)](_0x5d1d1c(0xfc)),console[_0x5d1d1c(0x108)]('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0x1c4b46['aNpPE'](_0x4a9ee3,_0x1c4b46[_0x5d1d1c(0x109)])?'\x20--opencode':'')+_0x5d1d1c(0xf7)),console['log']('\x20\x203.\x20Run:\x20ranger\x20skillup'+(_0x4a9ee3==='opencode'?_0x1c4b46[_0x5d1d1c(0x100)]:'')+'\x0a');return;}console[_0x5d1d1c(0x108)](_0x5d1d1c(0xf5));const _0x1fe116=getProjectRoot(),_0x15155b=basename(_0x1fe116),_0x25c329=_0x1c4b46['kZwkF'](_0x4a9ee3,_0x5d1d1c(0x10d))?_0x1c4b46['aeyeb'](getOpencodeConfigDir,'user')+_0x5d1d1c(0x11c):_0x1c4b46['VOpQF'](getClaudeConfigDir)+_0x5d1d1c(0x11c),_0x4088aa=_0x1c4b46['kZwkF'](_0x4a9ee3,_0x1c4b46['ictab'])?_0x1fe116+'/.opencode/skills/':_0x1fe116+'/.claude/skills/',_0x59d545=process['stdin']['isTTY']&&process['stdout'][_0x5d1d1c(0xf6)];let _0x49d5fa;if(_0x41be95[_0x5d1d1c(0x10b)])_0x49d5fa=_0x41be95[_0x5d1d1c(0x10b)];else{if(_0x59d545){const _0x24c4be=await _0x42f6e8[_0x5d1d1c(0x103)]([{'type':_0x1c4b46[_0x5d1d1c(0x106)],'name':'installLevel','message':_0x1c4b46[_0x5d1d1c(0x116)],'choices':[{'name':_0x5d1d1c(0xfd)+_0x25c329+')','value':_0x1c4b46['Ggjmv']},{'name':_0x5d1d1c(0x105)+_0x4088aa+')','value':_0x5d1d1c(0x11a)}]}]);_0x49d5fa=_0x24c4be['installLevel'];}else _0x49d5fa='project',console['log']('Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20('+_0x4088aa+')');}let _0x5ab7b5=0x0;const _0x2d8e82=_0x1c4b46[_0x5d1d1c(0xff)](getCurrentVersion);console[_0x5d1d1c(0x108)](_0x5d1d1c(0x117));try{const _0x3b48c2=await installSkill(_0x1c4b46[_0x5d1d1c(0x119)],{'cliVersion':_0x2d8e82,'level':_0x49d5fa,'platform':_0x4a9ee3});_0x3b48c2&&_0x5ab7b5++;}catch(_0x1af2f2){console['warn'](_0x1c4b46[_0x5d1d1c(0x10e)],_0x1af2f2 instanceof Error?_0x1af2f2[_0x5d1d1c(0xfb)]:_0x1af2f2);}if(_0x5ab7b5>0x0){const _0x260b3c=_0x49d5fa===_0x5d1d1c(0x115)?'user-level':_0x1c4b46[_0x5d1d1c(0x107)];console[_0x5d1d1c(0x108)]('\x0a✅\x20Installed\x20'+_0x5ab7b5+'\x20'+_0x260b3c+_0x5d1d1c(0x111)+(_0x5ab7b5>0x1?'s':'')+_0x5d1d1c(0x114)),!_0x41be95[_0x5d1d1c(0x118)]&&(console[_0x5d1d1c(0x108)]('To\x20use:'),_0x4a9ee3===_0x1c4b46['ictab']?console[_0x5d1d1c(0x108)](_0x5d1d1c(0x10a)):console['log'](_0x5d1d1c(0x110)));}else console['log'](_0x1c4b46['Rgvac']);}
|