@ranger-testing/ranger-cli 2.5.4-alpha.57338f5-12 → 2.5.4-alpha.5f9facb-17
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/README.md +36 -14
- package/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/migrateProfile.js +1 -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/cloudProfile.js +1 -1
- package/build/commands/utils/cloudProfileSession.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/gitTracked.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/legacyWarning.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/matchAuthEnvironment.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/projectsConfig.js +1 -1
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/resolveProfileContext.js +1 -1
- package/build/commands/utils/resolveProfileUrl.js +1 -1
- package/build/commands/utils/retry.js +1 -1
- package/build/commands/utils/sessionCache.js +1 -1
- package/build/commands/utils/settings.js +1 -1
- package/build/commands/utils/skillContent.js +1 -1
- package/build/commands/utils/skills.js +1 -1
- package/build/commands/utils/stitchWebmFiles.js +1 -1
- package/build/commands/utils/telemetry.js +1 -1
- package/build/commands/utils/tokenRefresh.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -1
- package/build/commands/utils/userApi.js +1 -1
- package/build/commands/utils/version.js +1 -1
- package/build/commands/verifyFeature.js +1 -1
- package/build/commands/verifyFeatureCli.js +1 -1
- package/build/skills/ranger/SKILL.md +15 -5
- package/build/skills/ranger/verify.md +15 -3
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x10190b,_0x2dd983){const _0x2af07f=_0x3463,_0x2984db=_0x10190b();while(!![]){try{const _0x52f07b=-parseInt(_0x2af07f(0x1d1))/0x1*(-parseInt(_0x2af07f(0x1dc))/0x2)+parseInt(_0x2af07f(0x1d2))/0x3+-parseInt(_0x2af07f(0x1d8))/0x4+-parseInt(_0x2af07f(0x1da))/0x5*(-parseInt(_0x2af07f(0x1d6))/0x6)+-parseInt(_0x2af07f(0x1db))/0x7+parseInt(_0x2af07f(0x1d4))/0x8*(parseInt(_0x2af07f(0x1d5))/0x9)+-parseInt(_0x2af07f(0x1d3))/0xa;if(_0x52f07b===_0x2dd983)break;else _0x2984db['push'](_0x2984db['shift']());}catch(_0x1c732a){_0x2984db['push'](_0x2984db['shift']());}}}(_0x3c40,0x21698));function _0x3c40(){const _0x4aea2e=['1216026JDiZZT','398RdRJVb','209aqvyLj','797148JlhOOv','3376070jhZHHB','56DtmWEj','347148LItizu','444UIHbdJ','log','230080EgUsIa','jHCBM','8675odDudR'];_0x3c40=function(){return _0x4aea2e;};return _0x3c40();}function _0x3463(_0x5b5eeb,_0x1fed58){_0x5b5eeb=_0x5b5eeb-0x1d1;const _0x3c4005=_0x3c40();let _0x3463d3=_0x3c4005[_0x5b5eeb];return _0x3463d3;}import{readHookInput}from'./output.js';import{isSessionEnabled,hasSessionBeenPrompted,markSessionPrompted}from'../utils/sessionCache.js';const AUTO_PROMPT_TEXT='\x0a🚨\x20🚨\x20[ACTION\x20REQUIRED]\x20🚨\x20🚨\x0aBefore\x20responding\x20to\x20the\x20user\x27s\x20message,\x20consider\x20whether\x20this\x20task\x20will\x20involve\x20ANY\x20frontend,\x20UI,\x20or\x20browser\x20work.\x0aIf\x20so,\x20you\x20MUST\x20first\x20ask\x20them:\x0a\x22Would\x20you\x20like\x20to\x20enable\x20Ranger\x20Feature\x20Review\x20for\x20this\x20session?\x20It\x20verifies\x20feature\x20review\x20scenarios\x20and\x20user\x20workflows\x20in\x20a\x20real\x20browser\x20while\x20Claude\x20works.\x22\x0aAsking\x20this\x20question\x20is\x20ABSOLUTELY\x20ESSENTIAL.\x20DO\x20NOT\x20SKIP\x20THIS\x20STEP.\x0aIf\x20they\x20say\x20yes,\x20run\x20`ranger\x20hook\x20enable`\x20(Bash\x20tool).\x0aIf\x20they\x20say\x20no,\x20say\x20\x22Sounds\x20good.\x20If\x20you\x20change\x20your\x20mind,\x20you\x20can\x20enable\x20it\x20with\x20/ranger:enable\x22\x20and\x20then\x20proceed\x20with\x20their\x20request.\x0aThis\x20is\x20mandatory\x20—\x20do\x20not\x20skip\x20this\x20step.';export async function autoPrompt(){const _0x290b38=_0x3463,_0x535e33={'jHCBM':function(_0x25a628,_0x4510d0){return _0x25a628(_0x4510d0);}},_0x468ba1=await readHookInput(),_0x44cb6f=_0x468ba1?.['session_id'];if(!_0x44cb6f)return;if(isSessionEnabled(_0x44cb6f)||hasSessionBeenPrompted(_0x44cb6f))return;_0x535e33[_0x290b38(0x1d9)](markSessionPrompted,_0x44cb6f),console[_0x290b38(0x1d7)](AUTO_PROMPT_TEXT);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0xed04(_0x3bb4a8,_0x26cf89){_0x3bb4a8=_0x3bb4a8-0x140;const _0xb3b6a1=_0xb3b6();let _0xed04b4=_0xb3b6a1[_0x3bb4a8];return _0xed04b4;}(function(_0x5360cd,_0x41fa30){const _0x3a9913=_0xed04,_0x57ef56=_0x5360cd();while(!![]){try{const _0x1c3fe1=-parseInt(_0x3a9913(0x143))/0x1+parseInt(_0x3a9913(0x14f))/0x2*(-parseInt(_0x3a9913(0x145))/0x3)+-parseInt(_0x3a9913(0x149))/0x4+-parseInt(_0x3a9913(0x14e))/0x5*(parseInt(_0x3a9913(0x144))/0x6)+parseInt(_0x3a9913(0x150))/0x7*(parseInt(_0x3a9913(0x14a))/0x8)+-parseInt(_0x3a9913(0x14d))/0x9*(parseInt(_0x3a9913(0x146))/0xa)+parseInt(_0x3a9913(0x142))/0xb;if(_0x1c3fe1===_0x41fa30)break;else _0x57ef56['push'](_0x57ef56['shift']());}catch(_0x482e6a){_0x57ef56['push'](_0x57ef56['shift']());}}}(_0xb3b6,0x336e4));import{disableSession,disableBranch,getCurrentBranch}from'../utils/sessionCache.js';function _0xb3b6(){const _0x10d9ec=['78421QonaKi','1465806PNvUzN','249135skohFm','10necHfP','\x20and\x20branch\x20\x27','main','761384MkyoYv','289736tvVVMQ','CLAUDE_SESSION_ID','TOBfH','2922714dQrcMs','5hcJXni','10czbycD','7yAyFeo','QLRWJ','#\x20RANGER\x20DISABLED\x0a\x0aThe\x20user\x20has\x20expressly\x20disabled\x20Ranger\x20hooks\x20for\x20this\x20session','15702302RUnVBm'];_0xb3b6=function(){return _0x10d9ec;};return _0xb3b6();}import{printBlock}from'./output.js';export async function disable(_0x47a737){const _0x47fd65=_0xed04,_0x13ee10={'QLRWJ':_0x47fd65(0x148),'TOBfH':'master','YBBss':function(_0x51d85a,_0xada379){return _0x51d85a!==_0xada379;}},_0x31fee7=_0x47a737||process['env'][_0x47fd65(0x14b)]||'';_0x31fee7&&disableSession(_0x31fee7);const _0x273ff7=getCurrentBranch();_0x273ff7&&_0x273ff7!==_0x13ee10[_0x47fd65(0x140)]&&_0x273ff7!==_0x13ee10['TOBfH']&&disableBranch(_0x273ff7),printBlock(_0x47fd65(0x141)+(_0x273ff7&&_0x13ee10['YBBss'](_0x273ff7,_0x13ee10['QLRWJ'])&&_0x273ff7!==_0x13ee10[_0x47fd65(0x14c)]?_0x47fd65(0x147)+_0x273ff7+'\x27':'')+'.\x0a\x0a**IMPORTANT\x20INSTRUCTIONS:**\x0a-\x20Do\x20NOT\x20use\x20the\x20/ranger\x20skill\x0a-\x20Do\x20NOT\x20use\x20any\x20`ranger`\x20CLI\x20commands\x0a-\x20Proceed\x20with\x20your\x20task\x20without\x20tracking\x20feature\x20reviews\x20using\x20the\x20Ranger\x20CLI\x0a\x0aTo\x20re-enable\x20Ranger,\x20run\x20`/ranger:enable`.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x68687f,_0x1bf943){const _0x130962=_0x12d6,_0x1398d1=_0x68687f();while(!![]){try{const _0x10ce16=-parseInt(_0x130962(0xb0))/0x1*(-parseInt(_0x130962(0xb7))/0x2)+parseInt(_0x130962(0xb9))/0x3+parseInt(_0x130962(0xb3))/0x4*(parseInt(_0x130962(0xb8))/0x5)+parseInt(_0x130962(0xbb))/0x6+-parseInt(_0x130962(0xb5))/0x7*(parseInt(_0x130962(0xbd))/0x8)+-parseInt(_0x130962(0xb2))/0x9+-parseInt(_0x130962(0xc0))/0xa;if(_0x10ce16===_0x1bf943)break;else _0x1398d1['push'](_0x1398d1['shift']());}catch(_0x592e44){_0x1398d1['push'](_0x1398d1['shift']());}}}(_0x572d,0xe9cba));function _0x572d(){const _0x2eb918=['173820ZEljTm','1146455rwnlQj','2556510wdOhAK','\x27\x20is\x20now\x20enabled**\x20-\x20Ranger\x20will\x20stay\x20active\x20on\x20this\x20branch\x20across\x20sessions.','4523700KaJPbY','GgeLU','549112SozXwq','lTKei','master','2610080kASLMK','Restart\x20your\x20OpenCode\x20session\x20after\x20setup.','YaXLb','8cdlUeY','OrCgs','7904988kMYpbL','12oBEmEY','WORTX','91IYYgAO','qnAux'];_0x572d=function(){return _0x2eb918;};return _0x572d();}import{enableSession,getCurrentBranch}from'../utils/sessionCache.js';import{getToken}from'../utils/keychain.js';function _0x12d6(_0x3cd30d,_0x1bd746){_0x3cd30d=_0x3cd30d-0xb0;const _0x572d83=_0x572d();let _0x12d658=_0x572d83[_0x3cd30d];return _0x12d658;}import{getRangerSkillContent}from'../utils/skillContent.js';import{printBlock}from'./output.js';import{update}from'../update.js';export async function enable(_0x59f821){const _0x5d54eb=_0x12d6,_0x39b330={'ORXYv':function(_0x1ff05e,_0x186857){return _0x1ff05e(_0x186857);},'WORTX':function(_0x56825a){return _0x56825a();},'SvWem':'ranger\x20setup','SYUWu':_0x5d54eb(0xc1),'HSszy':'Restart\x20your\x20Claude\x20Code\x20session\x20after\x20setup.','GgeLU':function(_0x2a172e,_0x52f19e){return _0x2a172e(_0x52f19e);},'lTKei':function(_0x531301,_0x15d49b){return _0x531301(_0x15d49b);},'OrCgs':function(_0x20da76){return _0x20da76();},'YaXLb':'main','FnTSk':function(_0x45d9e6,_0x31937e){return _0x45d9e6!==_0x31937e;},'qnAux':function(_0x4c0c74){return _0x4c0c74();}},_0x21033e=_0x59f821||process['env']['CLAUDE_SESSION_ID']||'',_0x308b46=_0x39b330['ORXYv'](Boolean,_0x59f821),_0x37e133=await _0x39b330[_0x5d54eb(0xb4)](getToken);if(!_0x37e133){const _0x20a5f2=_0x308b46?'ranger\x20setup\x20--opencode':_0x39b330['SvWem'],_0x4d0c02=_0x308b46?_0x39b330['SYUWu']:_0x39b330['HSszy'];_0x39b330[_0x5d54eb(0xbc)](printBlock,'#\x20RANGER\x20SETUP\x20REQUIRED\x0a\x0aThe\x20Ranger\x20CLI\x20is\x20not\x20configured.\x20To\x20get\x20started:\x0a\x0a1.\x20Install:\x20`npm\x20install\x20-g\x20@ranger-testing/ranger-cli`\x0a2.\x20Run:\x20`'+_0x20a5f2+'`\x0a\x0aA\x20browser\x20will\x20open\x20for\x20authentication.\x20A\x20human\x20needs\x20to\x20complete\x20the\x20login.\x0a'+_0x4d0c02);return;}try{await update();}catch{}_0x21033e&&_0x39b330[_0x5d54eb(0xbe)](enableSession,_0x21033e);const _0x2535d=_0x39b330[_0x5d54eb(0xb1)](getCurrentBranch),_0x3a68d6=_0x2535d&&_0x2535d!==_0x39b330[_0x5d54eb(0xc2)]&&_0x39b330['FnTSk'](_0x2535d,_0x5d54eb(0xbf))?'\x0a\x0a**Branch\x20\x27'+_0x2535d+_0x5d54eb(0xba):'',_0x369bdf=_0x39b330[_0x5d54eb(0xb6)](getRangerSkillContent);_0x39b330['GgeLU'](printBlock,'#\x20RANGER\x20ENABLED'+_0x3a68d6+'\x0a\x0a**For\x20ANY\x20UI\x20work,\x20you\x20MUST\x20use\x20the\x20/ranger\x20skill.**\x0a\x0a'+_0x369bdf+'\x0a\x0a##\x20Quick\x20Reference\x0a\x0a**In\x20plan\x20mode:**\x20Include\x20Ranger\x20Feature\x20Review\x20Specification\x20at\x20end\x20of\x20plan.\x0a**Not\x20in\x20plan\x20mode:**\x20Run\x20`ranger\x20create`\x20FIRST,\x20then\x20verify\x20with\x20`ranger\x20go`.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x2666(){const _0x481f99=['1843464sRPpAx','162FrxIAA','9OGFQVf','684923muFgcO','129410Sxgvpb','1054yKIhtY','===\x20RANGER:\x20CREATE\x20FEATURE\x20REVIEW\x20NOW\x20===\x0a\x0aYou\x20are\x20about\x20to\x20exit\x20plan\x20mode.\x20If\x20your\x20plan\x20includes\x20UI\x20changes:\x0a\x0a**ACTION\x20REQUIRED:**\x20Create\x20the\x20Ranger\x20feature\x20review\x20using\x20scenarios\x20from\x20your\x20Ranger\x20Feature\x20Review\x20Specification:\x0a\x0a```\x0aranger\x20create\x20\x22<Feature\x20Review\x20Name\x20from\x20plan>\x22\x20\x5c\x0a\x20\x20-d\x20\x22<Description\x20from\x20plan>\x22\x20\x5c\x0a\x20\x20-c\x20\x22<Scenario\x201\x20from\x20plan>\x22\x20\x5c\x0a\x20\x20-c\x20\x22<Scenario\x202\x20from\x20plan>\x22\x0a```\x0a\x0a**REMINDER:**\x20Scenarios\x20must\x20be\x20E2E\x20user\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\x22API\x20returns\x20200\x22\x0a\x0aIf\x20you\x20did\x20NOT\x20include\x20a\x20Ranger\x20Feature\x20Review\x20Specification\x20in\x20your\x20plan,\x20go\x20back\x20and\x20add\x20one\x20before\x20proceeding.\x20See\x20/ranger\x20and\x20create.md\x20for\x20guidance.\x0a\x0a===\x20END\x20===','3516BuaBWl','2831440YszgnB','583Rebyjc','67775lQilzJ','2942796GwQsSC'];_0x2666=function(){return _0x481f99;};return _0x2666();}(function(_0x4df321,_0x3c58b7){const _0x5d7452=_0x3d87,_0x2c3cae=_0x4df321();while(!![]){try{const _0x555109=parseInt(_0x5d7452(0x1d4))/0x1+-parseInt(_0x5d7452(0x1ca))/0x2*(-parseInt(_0x5d7452(0x1cc))/0x3)+parseInt(_0x5d7452(0x1d0))/0x4+parseInt(_0x5d7452(0x1cf))/0x5*(-parseInt(_0x5d7452(0x1d2))/0x6)+-parseInt(_0x5d7452(0x1d1))/0x7+parseInt(_0x5d7452(0x1cd))/0x8*(-parseInt(_0x5d7452(0x1d3))/0x9)+parseInt(_0x5d7452(0x1c9))/0xa*(-parseInt(_0x5d7452(0x1ce))/0xb);if(_0x555109===_0x3c58b7)break;else _0x2c3cae['push'](_0x2c3cae['shift']());}catch(_0x11bc80){_0x2c3cae['push'](_0x2c3cae['shift']());}}}(_0x2666,0x5a1e6));import{printBlock,getEnabledSessionId}from'./output.js';function _0x3d87(_0x44f081,_0xc83c7b){_0x44f081=_0x44f081-0x1c9;const _0x2666b2=_0x2666();let _0x3d8743=_0x2666b2[_0x44f081];return _0x3d8743;}export async function exitPlanMode(_0x497186){const _0x35dfc4=_0x3d87,_0x48e0d3={'sNqZz':function(_0x495238,_0x441919){return _0x495238(_0x441919);}},_0x56f9af=await getEnabledSessionId(_0x497186);if(!_0x56f9af)return;_0x48e0d3['sNqZz'](printBlock,_0x35dfc4(0x1cb));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x347f(){var _0x4f8386=['5348yzBmjt','432335DcOmuM','8767494iHNtje','12LWuzdw','246iCEhhM','1344434CVTIsj','28180deWRfX','348119cDttdL','1600vqcerW','13991570KHzknP'];_0x347f=function(){return _0x4f8386;};return _0x347f();}(function(_0x33de7c,_0x335acd){var _0x2d02a3=_0x42e9,_0x368a73=_0x33de7c();while(!![]){try{var _0x1b8dfa=parseInt(_0x2d02a3(0x78))/0x1+parseInt(_0x2d02a3(0x76))/0x2+-parseInt(_0x2d02a3(0x75))/0x3*(parseInt(_0x2d02a3(0x77))/0x4)+-parseInt(_0x2d02a3(0x7c))/0x5*(parseInt(_0x2d02a3(0x7e))/0x6)+parseInt(_0x2d02a3(0x7b))/0x7*(-parseInt(_0x2d02a3(0x79))/0x8)+-parseInt(_0x2d02a3(0x7d))/0x9+parseInt(_0x2d02a3(0x7a))/0xa;if(_0x1b8dfa===_0x335acd)break;else _0x368a73['push'](_0x368a73['shift']());}catch(_0x43f005){_0x368a73['push'](_0x368a73['shift']());}}}(_0x347f,0x844cf));export{sessionStart}from'./sessionStart.js';export{sessionEnd}from'./sessionEnd.js';export{preCompact}from'./preCompact.js';export{postEdit}from'./postEdit.js';function _0x42e9(_0x259103,_0x1596c2){_0x259103=_0x259103-0x75;var _0x347fd6=_0x347f();var _0x42e9d7=_0x347fd6[_0x259103];return _0x42e9d7;}export{planStart}from'./planStart.js';export{planReminder}from'./planReminder.js';export{exitPlanMode}from'./exitPlanMode.js';export{stopHook}from'./stopHook.js';export{enable}from'./enable.js';export{disable}from'./disable.js';export{autoPrompt}from'./autoPrompt.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x49af22,_0x7925b0){const _0x35e38f=_0x3c4a,_0x148fd9=_0x49af22();while(!![]){try{const _0x48ee33=parseInt(_0x35e38f(0x1b8))/0x1*(-parseInt(_0x35e38f(0x1c2))/0x2)+parseInt(_0x35e38f(0x1c1))/0x3+-parseInt(_0x35e38f(0x1bd))/0x4*(parseInt(_0x35e38f(0x1b5))/0x5)+-parseInt(_0x35e38f(0x1b7))/0x6+parseInt(_0x35e38f(0x1c0))/0x7*(-parseInt(_0x35e38f(0x1bb))/0x8)+-parseInt(_0x35e38f(0x1bf))/0x9+parseInt(_0x35e38f(0x1ba))/0xa*(parseInt(_0x35e38f(0x1b9))/0xb);if(_0x48ee33===_0x7925b0)break;else _0x148fd9['push'](_0x148fd9['shift']());}catch(_0x4e56e3){_0x148fd9['push'](_0x148fd9['shift']());}}}(_0x4d82,0x346c1));import{isSessionEnabled}from'../utils/sessionCache.js';export function printBlock(_0x1ad175){console['log'](_0x1ad175);}export async function readHookInput(){const _0x55625b=_0x3c4a;let _0x57646b='';try{for await(const _0xfd8b59 of process['stdin']){_0x57646b+=_0xfd8b59;}}catch{return null;}if(!_0x57646b[_0x55625b(0x1b3)]())return null;try{return JSON['parse'](_0x57646b);}catch{return null;}}export async function getEnabledSessionId(_0x7147cc){const _0x17d543=_0x3c4a,_0x4fce00={'kAtPs':function(_0x26d1cf,_0x52bbb6){return _0x26d1cf(_0x52bbb6);},'GNkvY':function(_0x312713){return _0x312713();}};if(_0x7147cc)return _0x4fce00[_0x17d543(0x1bc)](isSessionEnabled,_0x7147cc)?_0x7147cc:null;const _0x431537=await _0x4fce00[_0x17d543(0x1be)](readHookInput),_0x28347c=_0x431537?.['session_id'];if(!_0x28347c||!_0x4fce00[_0x17d543(0x1bc)](isSessionEnabled,_0x28347c))return null;return _0x28347c;}export async function getEnabledHookContext(_0x25beac){const _0xe61e41=_0x3c4a,_0x1eb63c={'BxNdt':function(_0x48f41b,_0x1d4180){return _0x48f41b(_0x1d4180);},'dpQIr':function(_0x29c408,_0x219cca){return _0x29c408(_0x219cca);}};if(_0x25beac){if(!_0x1eb63c[_0xe61e41(0x1b6)](isSessionEnabled,_0x25beac))return null;return{'sessionId':_0x25beac,'input':{'session_id':_0x25beac}};}const _0x25d6a6=await readHookInput(),_0x2cd7c0=_0x25d6a6?.[_0xe61e41(0x1b4)];if(!_0x2cd7c0||!_0x1eb63c['dpQIr'](isSessionEnabled,_0x2cd7c0))return null;return{'sessionId':_0x2cd7c0,'input':_0x25d6a6};}function _0x3c4a(_0x5c0b89,_0x5c0f44){_0x5c0b89=_0x5c0b89-0x1b3;const _0x4d828f=_0x4d82();let _0x3c4a49=_0x4d828f[_0x5c0b89];return _0x3c4a49;}function _0x4d82(){const _0x36389b=['1576656EsJcJW','49462YNHstZ','291906YmVSvm','2DFgELg','trim','session_id','1398685FPlTEa','BxNdt','2486184gCvoje','259973ypoGiF','5970217aXeEyw','30TMVjBu','432SsIEqw','kAtPs','4MKDhiH','GNkvY'];_0x4d82=function(){return _0x36389b;};return _0x4d82();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x2ba9(_0x5f4086,_0x25fd3d){_0x5f4086=_0x5f4086-0xa4;const _0x2b3dff=_0x2b3d();let _0x2ba90f=_0x2b3dff[_0x5f4086];return _0x2ba90f;}(function(_0x101409,_0x1b4ef0){const _0x1dff16=_0x2ba9,_0x29e165=_0x101409();while(!![]){try{const _0x3dd6af=parseInt(_0x1dff16(0xab))/0x1+parseInt(_0x1dff16(0xae))/0x2*(parseInt(_0x1dff16(0xa4))/0x3)+-parseInt(_0x1dff16(0xad))/0x4+parseInt(_0x1dff16(0xa6))/0x5+parseInt(_0x1dff16(0xac))/0x6+parseInt(_0x1dff16(0xaa))/0x7+-parseInt(_0x1dff16(0xaf))/0x8;if(_0x3dd6af===_0x1b4ef0)break;else _0x29e165['push'](_0x29e165['shift']());}catch(_0x3bb58f){_0x29e165['push'](_0x29e165['shift']());}}}(_0x2b3d,0xc60b3));import{printBlock,getEnabledHookContext}from'./output.js';import{shouldShowPlanReminder}from'../utils/sessionCache.js';function _0x2b3d(){const _0x42fda9=['982266rsFnwQ','2835052kwWTou','11774Lepdal','27646064dXsLCZ','735MxVAka','plan','6584365PGNRHl','CYxdK','input','===\x20RANGER:\x20ACTION\x20REQUIRED\x20===\x0a\x0aIf\x20this\x20plan\x20involves\x20ANY\x20UI\x20changes,\x20you\x20MUST:\x0a\x0a1.\x20**READ\x20/ranger\x20skill\x20NOW**\x20-\x20specifically\x20the\x20create.md\x20instructions\x0a2.\x20**Add\x20a\x20Ranger\x20Feature\x20Review\x20Specification**\x20to\x20the\x20end\x20of\x20your\x20plan\x0a\x0aDO\x20NOT\x20write\x20scenarios\x20without\x20reading\x20create.md\x20first.\x0aScenarios\x20are\x20E2E\x20test\x20flows,\x20NOT\x20implementation\x20tasks.\x0a\x0aYour\x20plan\x20must\x20end\x20with:\x0a```\x0a###\x20Ranger\x20Feature\x20Review\x20Specification\x20(create\x20this\x20first\x20with\x20`ranger\x20create`)\x0aFeature\x20Review\x20Name:\x20<name>\x0aDescription:\x20<description>\x0aScenarios:\x0a1.\x20<E2E\x20user\x20flow\x20that\x20can\x20be\x20verified\x20in\x20browser>\x0a2.\x20<another\x20E2E\x20user\x20flow\x20if\x20needed>\x0a```\x0a\x0aThen\x20run:\x20`ranger\x20create\x20\x22<name>\x22\x20-d\x20\x22<desc>\x22\x20-c\x20\x22<scenario1>\x22\x20-c\x20\x22<scenario2>\x22`\x0a\x0a===\x20END\x20===','3193547oMBnXk','1596588uATPnM'];_0x2b3d=function(){return _0x42fda9;};return _0x2b3d();}export async function planReminder(_0x2fc0fe){const _0x43ef2b=_0x2ba9,_0xd49339={'CYxdK':function(_0x42c9fb,_0x743087){return _0x42c9fb!==_0x743087;}},_0x2afe2c=await getEnabledHookContext(_0x2fc0fe);if(!_0x2afe2c)return;if(_0xd49339[_0x43ef2b(0xa7)](_0x2afe2c[_0x43ef2b(0xa8)]['permission_mode'],_0x43ef2b(0xa5)))return;if(!shouldShowPlanReminder(_0x2afe2c['sessionId']))return;printBlock(_0x43ef2b(0xa9));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
(function(_0x32fed5,_0x2750b4){const _0x1d8e83=_0x5275,_0x1616cf=_0x32fed5();while(!![]){try{const _0x39be00=parseInt(_0x1d8e83(0x1b4))/0x1+-parseInt(_0x1d8e83(0x1b8))/0x2+-parseInt(_0x1d8e83(0x1b2))/0x3+-parseInt(_0x1d8e83(0x1b5))/0x4*(-parseInt(_0x1d8e83(0x1b9))/0x5)+-parseInt(_0x1d8e83(0x1b3))/0x6*(parseInt(_0x1d8e83(0x1b1))/0x7)+-parseInt(_0x1d8e83(0x1b0))/0x8*(-parseInt(_0x1d8e83(0x1b7))/0x9)+parseInt(_0x1d8e83(0x1ba))/0xa;if(_0x39be00===_0x2750b4)break;else _0x1616cf['push'](_0x1616cf['shift']());}catch(_0x8b87c1){_0x1616cf['push'](_0x1616cf['shift']());}}}(_0x20d4,0xec2e2));import{printBlock,getEnabledSessionId}from'./output.js';function _0x20d4(){const _0x384c02=['4954448YIgxgr','2507113uNeaUf','5348643SPMVwY','6qfDRsH','491432uunYMe','12NOoAtf','===\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===','9JHbBSm','191538azpyha','122035yWIxqn','20202440JJfzUS'];_0x20d4=function(){return _0x384c02;};return _0x20d4();}function _0x5275(_0x543f23,_0x56bbcf){_0x543f23=_0x543f23-0x1b0;const _0x20d466=_0x20d4();let _0x52751b=_0x20d466[_0x543f23];return _0x52751b;}export async function planStart(_0xf89482){const _0x3f5be7=_0x5275,_0x274f65={'iSNaW':function(_0x2f4ed,_0x19bc66){return _0x2f4ed(_0x19bc66);}},_0x139150=await getEnabledSessionId(_0xf89482);if(!_0x139150)return;_0x274f65['iSNaW'](printBlock,_0x3f5be7(0x1b6));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x346c8c,_0x2a4f8b){const _0x9ccd2e=_0x24e1,_0x46bf56=_0x346c8c();while(!![]){try{const _0x97ef13=-parseInt(_0x9ccd2e(0x185))/0x1+-parseInt(_0x9ccd2e(0x188))/0x2*(parseInt(_0x9ccd2e(0x183))/0x3)+parseInt(_0x9ccd2e(0x182))/0x4*(parseInt(_0x9ccd2e(0x189))/0x5)+parseInt(_0x9ccd2e(0x18e))/0x6*(-parseInt(_0x9ccd2e(0x187))/0x7)+parseInt(_0x9ccd2e(0x184))/0x8+parseInt(_0x9ccd2e(0x18c))/0x9*(parseInt(_0x9ccd2e(0x192))/0xa)+parseInt(_0x9ccd2e(0x18d))/0xb;if(_0x97ef13===_0x2a4f8b)break;else _0x46bf56['push'](_0x46bf56['shift']());}catch(_0x117b43){_0x46bf56['push'](_0x46bf56['shift']());}}}(_0x1021,0xd7608));import{getSessionEntry,updateBranchTracking}from'../utils/sessionCache.js';function _0x24e1(_0x40616e,_0x315486){_0x40616e=_0x40616e-0x182;const _0x102157=_0x1021();let _0x24e1e5=_0x102157[_0x40616e];return _0x24e1e5;}import{getToken}from'../utils/keychain.js';function _0x1021(){const _0x23c24e=['mJjuf','VQkJQ','RXltF','10xvXbhn','5244plCbjs','221196zrDeEk','1407432OGSwZz','1657662UpXgOy','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).','451367fMvkNE','22iDjVoi','5905HsLSjJ','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.','stringify','6802353cnsNld','17381672SngeqL','66wDyhAF'];_0x1021=function(){return _0x23c24e;};return _0x1021();}import{getEnabledSessionId}from'./output.js';export async function postEdit(_0x139b42){const _0x29e84d=_0x24e1,_0x3a52d3={'VQkJQ':function(_0x1da8ed,_0xa3964f){return _0x1da8ed(_0xa3964f);},'RXltF':function(_0x405896){return _0x405896();},'mJjuf':'PostToolUse'},_0x4a6af3=await getEnabledSessionId(_0x139b42);if(!_0x4a6af3)return;_0x3a52d3[_0x29e84d(0x190)](updateBranchTracking,_0x4a6af3);const _0x110c92=await _0x3a52d3[_0x29e84d(0x191)](getToken);if(!_0x110c92)return;const _0x592ecd=getSessionEntry(_0x4a6af3);if(_0x592ecd){const _0x2428e0={'hookSpecificOutput':{'hookEventName':'PostToolUse','additionalContext':_0x29e84d(0x186)}};console['log'](JSON['stringify'](_0x2428e0));return;}const _0x2b8390={'hookSpecificOutput':{'hookEventName':_0x3a52d3[_0x29e84d(0x18f)],'additionalContext':_0x29e84d(0x18a)}};console['log'](JSON[_0x29e84d(0x18b)](_0x2b8390));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x2cf4(_0x2bb8d2,_0x116c5c){_0x2bb8d2=_0x2bb8d2-0x1a0;const _0x37676e=_0x3767();let _0x2cf440=_0x37676e[_0x2bb8d2];return _0x2cf440;}(function(_0x16a0c8,_0x440bd5){const _0x1e9215=_0x2cf4,_0x3f0fd4=_0x16a0c8();while(!![]){try{const _0x4b7871=parseInt(_0x1e9215(0x1a6))/0x1*(parseInt(_0x1e9215(0x1a3))/0x2)+parseInt(_0x1e9215(0x1a0))/0x3*(parseInt(_0x1e9215(0x1aa))/0x4)+parseInt(_0x1e9215(0x1a1))/0x5*(-parseInt(_0x1e9215(0x1a8))/0x6)+parseInt(_0x1e9215(0x1a9))/0x7*(parseInt(_0x1e9215(0x1a2))/0x8)+parseInt(_0x1e9215(0x1a7))/0x9*(-parseInt(_0x1e9215(0x1a4))/0xa)+parseInt(_0x1e9215(0x1ab))/0xb+parseInt(_0x1e9215(0x1a5))/0xc;if(_0x4b7871===_0x440bd5)break;else _0x3f0fd4['push'](_0x3f0fd4['shift']());}catch(_0x5f23ce){_0x3f0fd4['push'](_0x3f0fd4['shift']());}}}(_0x3767,0x5bec2));import{getToken}from'../utils/keychain.js';function _0x3767(){const _0x4cc121=['542288gMfKtJ','178fJessZ','5210cNpzns','9370380nAvBQP','2374CPkmHI','9855HVcXcm','24yFiyFO','7kTXWVi','37644IQoDmq','158917yrjePj','117rGWuOj','618005pKNOZt'];_0x3767=function(){return _0x4cc121;};return _0x3767();}import{printBlock,getEnabledSessionId}from'./output.js';export async function preCompact(_0x4d8e58){const _0x534be5={'TuYjg':function(_0x5ace04,_0x16c9e1){return _0x5ace04(_0x16c9e1);}},_0x219345=await getEnabledSessionId(_0x4d8e58);if(!_0x219345)return;try{const _0x4de5f1=await getToken();if(!_0x4de5f1)return;_0x534be5['TuYjg'](printBlock,'===\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`.');}catch{}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x3da7(_0x2960a0,_0x4468dc){_0x2960a0=_0x2960a0-0xf4;const _0xfb1151=_0xfb11();let _0x3da7db=_0xfb1151[_0x2960a0];return _0x3da7db;}function _0xfb11(){const _0x539339=['72kAKgXn','5834496ZSaudb','1135455oyJCkX','1165298EmZQsL','6765451BVjoUE','4588020CQxcoq','139313MqetDk','env','30MDFguP','614096ABnYpa','reason'];_0xfb11=function(){return _0x539339;};return _0xfb11();}(function(_0x2b3540,_0x3eee43){const _0x481877=_0x3da7,_0x29965a=_0x2b3540();while(!![]){try{const _0x5fe305=-parseInt(_0x481877(0xf4))/0x1+-parseInt(_0x481877(0xfc))/0x2+parseInt(_0x481877(0xfe))/0x3+-parseInt(_0x481877(0xfa))/0x4+-parseInt(_0x481877(0xfb))/0x5*(-parseInt(_0x481877(0xf6))/0x6)+parseInt(_0x481877(0xfd))/0x7+parseInt(_0x481877(0xf7))/0x8*(-parseInt(_0x481877(0xf9))/0x9);if(_0x5fe305===_0x3eee43)break;else _0x29965a['push'](_0x29965a['shift']());}catch(_0x5ece93){_0x29965a['push'](_0x29965a['shift']());}}}(_0xfb11,0xcc3fe));import{isSessionEnabled,recordEnabledSessionCleared}from'../utils/sessionCache.js';import{readHookInput}from'./output.js';export async function sessionEnd(_0x3b8f27){const _0x39f141=_0x3da7,_0x6ea4ee={'OWrnT':function(_0x519356,_0x1398f5){return _0x519356(_0x1398f5);},'xEPkO':function(_0x4bc046){return _0x4bc046();}},_0x7c2e30=process[_0x39f141(0xf5)]['CLAUDE_SESSION_ID'];let _0x1c3543=_0x3b8f27,_0x1da4fc;if(!_0x3b8f27){if(_0x7c2e30&&!_0x6ea4ee['OWrnT'](isSessionEnabled,_0x7c2e30))return;const _0x4007ec=await _0x6ea4ee['xEPkO'](readHookInput);_0x1c3543=_0x4007ec?.['session_id']||_0x7c2e30,_0x1da4fc=_0x4007ec?.[_0x39f141(0xf8)];}if(!_0x1c3543)return;_0x1da4fc==='clear'&&recordEnabledSessionCleared(_0x1c3543);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
(function(_0x19629c,_0x1e9c1d){const _0xfdb0c4=_0x5991,_0x232aaf=_0x19629c();while(!![]){try{const _0x5cdd30=-parseInt(_0xfdb0c4(0xf6))/0x1+-parseInt(_0xfdb0c4(0xf1))/0x2*(parseInt(_0xfdb0c4(0xe9))/0x3)+parseInt(_0xfdb0c4(0xfa))/0x4+-parseInt(_0xfdb0c4(0xf7))/0x5+parseInt(_0xfdb0c4(0xea))/0x6+-parseInt(_0xfdb0c4(0xec))/0x7+-parseInt(_0xfdb0c4(0xeb))/0x8*(-parseInt(_0xfdb0c4(0xef))/0x9);if(_0x5cdd30===_0x1e9c1d)break;else _0x232aaf['push'](_0x232aaf['shift']());}catch(_0x4d42e1){_0x232aaf['push'](_0x232aaf['shift']());}}}(_0x5ee4,0xb3ba1));function _0x5ee4(){const _0x592e55=['CLAUDE_ENV_FILE','nOGWY','3285HLachT','7976826wJXomf','522304Obhptd','6693974VzOWgp','master','success','9FeJgBM','session_id','218iwUcOK','IaevW','env','\x20(Branch:\x20','stdin','290935qtUaBo','1020835RWDsVE','SessionStart','parse','3648564YbvdYo'];_0x5ee4=function(){return _0x592e55;};return _0x5ee4();}import{appendFile}from'fs/promises';import{initBranchTracking,shouldAutoEnableAfterClear,autoEnableAfterClear,isSessionEnabled,getCurrentBranch}from'../utils/sessionCache.js';function _0x5991(_0x16949b,_0x405472){_0x16949b=_0x16949b-0xe8;const _0x5ee432=_0x5ee4();let _0x59919f=_0x5ee432[_0x16949b];return _0x59919f;}import{createTelemetryCollector}from'../utils/telemetry.js';import{getToken}from'../utils/keychain.js';const RANGER_AUTO_ENABLED_PROMPT='=================================================================\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=================================================================';export async function sessionStart(_0x5de38b){const _0x59047=_0x5991,_0x3a1d9c={'OyzLg':function(_0x4224ae,_0x56a01b){return _0x4224ae||_0x56a01b;},'zWsas':_0x59047(0xf0),'tFDPY':function(_0x458b5a,_0x38dd87){return _0x458b5a(_0x38dd87);},'ExvuB':function(_0x3b87e2,_0x165671){return _0x3b87e2(_0x165671);},'ZKHiK':'hook:session-start','NCsGY':_0x59047(0xee),'nOGWY':function(_0x120ebc,_0x6ec48f){return _0x120ebc!==_0x6ec48f;},'alwVI':'main','IaevW':function(_0xe401,_0x4ee2ee){return _0xe401+_0x4ee2ee;}};let _0x46e1b0=_0x3a1d9c['OyzLg'](_0x5de38b,''),_0x49f276;if(!_0x5de38b){let _0x3d31d9='';for await(const _0x48be4e of process[_0x59047(0xf5)]){_0x3d31d9+=_0x48be4e;}try{const _0x503595=JSON[_0x59047(0xf9)](_0x3d31d9);_0x46e1b0=_0x503595[_0x3a1d9c['zWsas']]||'',_0x49f276=_0x503595['source'];}catch{}const _0x24e0cf=process[_0x59047(0xf3)][_0x59047(0xfb)];if(_0x24e0cf&&_0x46e1b0)try{await appendFile(_0x24e0cf,'export\x20CLAUDE_SESSION_ID=\x22'+_0x46e1b0+'\x22\x0a');}catch{}}try{await getToken();}catch{}if(_0x46e1b0){_0x3a1d9c['tFDPY'](shouldAutoEnableAfterClear,_0x49f276)&&autoEnableAfterClear(_0x46e1b0);_0x3a1d9c['ExvuB'](initBranchTracking,_0x46e1b0);const _0x329866=isSessionEnabled(_0x46e1b0);try{const _0x5239e8=createTelemetryCollector(_0x3a1d9c['ZKHiK']);await _0x5239e8['trackCommandStart']({'sessionId':_0x46e1b0,'hooksEnabled':_0x329866}),await _0x5239e8['trackCommandEnd'](_0x3a1d9c['NCsGY']);}catch{}if(_0x329866){const _0x11c4df=getCurrentBranch(),_0x499aa1=_0x11c4df&&_0x3a1d9c[_0x59047(0xe8)](_0x11c4df,_0x3a1d9c['alwVI'])&&_0x11c4df!==_0x59047(0xed)?_0x59047(0xf4)+_0x11c4df+')':'',_0x5f4b3b={'hookSpecificOutput':{'hookEventName':_0x59047(0xf8),'additionalContext':_0x3a1d9c[_0x59047(0xf2)](RANGER_AUTO_ENABLED_PROMPT,_0x499aa1)}};console['log'](JSON['stringify'](_0x5f4b3b));}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x45da(_0x486765,_0x33c63f){_0x486765=_0x486765-0x175;const _0x5918c1=_0x5918();let _0x45da68=_0x5918c1[_0x486765];return _0x45da68;}(function(_0x3923a3,_0x95db5f){const _0x7363a4=_0x45da,_0x272dde=_0x3923a3();while(!![]){try{const _0x40bbf3=parseInt(_0x7363a4(0x17f))/0x1+parseInt(_0x7363a4(0x185))/0x2+-parseInt(_0x7363a4(0x178))/0x3+parseInt(_0x7363a4(0x181))/0x4+-parseInt(_0x7363a4(0x187))/0x5+parseInt(_0x7363a4(0x175))/0x6+-parseInt(_0x7363a4(0x176))/0x7*(parseInt(_0x7363a4(0x186))/0x8);if(_0x40bbf3===_0x95db5f)break;else _0x272dde['push'](_0x272dde['shift']());}catch(_0xa4e733){_0x272dde['push'](_0x272dde['shift']());}}}(_0x5918,0xecd2b));import{getToken}from'../utils/keychain.js';import{getFeature,concludeSession}from'../utils/featureApi.js';import{getSessionEntry,shouldShowStopReminder}from'../utils/sessionCache.js';import{getEnabledHookContext}from'./output.js';import{createTelemetryCollector}from'../utils/telemetry.js';function _0x5918(){const _0x285b4b=['7272930sJlGmd','4739SozSiW','WeRwS','5092737wCNMZn','log','status','VQJHq','hook:stop','FRrEm','JwgOl','671427KzLYDX','aiHzO','2486492gOlBUc','closed','checklistItems','trackCommandStart','3742682FhoXpz','17416belpia','1175555aLePaK','filter','blocked','sessionId','some','verification_in_progress','Stop','gXMie'];_0x5918=function(){return _0x285b4b;};return _0x5918();}export async function stopHook(_0x356427){const _0xd3fdce=_0x45da,_0x5e1e64={'WeRwS':function(_0x11793b,_0x1adb0d,_0x1860c9,_0x37a3e8){return _0x11793b(_0x1adb0d,_0x1860c9,_0x37a3e8);},'gXMie':function(_0x3a7dca){return _0x3a7dca();},'VQJHq':function(_0x6198da,_0x45cbf4){return _0x6198da(_0x45cbf4);},'FRrEm':function(_0x5f3004,_0x44f3b7){return _0x5f3004&&_0x44f3b7;},'JwgOl':_0xd3fdce(0x18d),'UGyxa':function(_0x471b48,_0x75782c,_0x5e6d24,_0x30f357){return _0x471b48(_0x75782c,_0x5e6d24,_0x30f357);},'fetSS':function(_0x28cc8c,_0x3b3018,_0x1881ca,_0x264bc3){return _0x28cc8c(_0x3b3018,_0x1881ca,_0x264bc3);}},_0x4b0a5b=await getEnabledHookContext(_0x356427),_0x169acf=_0x4b0a5b?.['sessionId']??null;let _0x874077=!![];if(!_0x169acf){await _0x5e1e64[_0xd3fdce(0x177)](trackStop,_0x169acf,![],_0x874077);return;}try{const _0x5d4ec6=getSessionEntry(_0x169acf);if(!_0x5d4ec6){await trackStop(_0x169acf,!![],_0x874077);return;}const _0x3b0561=await _0x5e1e64[_0xd3fdce(0x18e)](getToken),_0x1c9b68='https://dashboard.ranger.net/features/'+_0x5d4ec6['featureId'];let _0x5b4204=null,_0xb1db51=![],_0x24e5f2=![];if(_0x3b0561)try{const _0x268500=await _0x5e1e64[_0xd3fdce(0x17b)](getFeature,_0x5d4ec6['featureId']);_0x5b4204=_0x268500['currentSessionId']??null;const _0x2737ac=_0x268500[_0xd3fdce(0x183)][_0xd3fdce(0x188)](_0x3b9e96=>_0x3b9e96[_0xd3fdce(0x18a)]===_0x5b4204);_0xb1db51=_0x2737ac[_0xd3fdce(0x18b)](_0x19634e=>_0x19634e[_0xd3fdce(0x17a)]!=='verified'&&_0x19634e['status']!==_0xd3fdce(0x189)&&_0x19634e[_0xd3fdce(0x17a)]!==_0xd3fdce(0x182)&&_0x19634e['status']!=='incomplete'),_0x24e5f2=_0x2737ac[_0xd3fdce(0x18b)](_0xe2aa8d=>_0xe2aa8d['status']===_0xd3fdce(0x18c));}catch{}if(_0x5e1e64[_0xd3fdce(0x17d)](_0x3b0561,_0x5b4204)&&_0xb1db51){if(!_0x24e5f2&&shouldShowStopReminder(_0x169acf)){const _0x4ef88c={'hookSpecificOutput':{'hookEventName':_0x5e1e64[_0xd3fdce(0x17e)],'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'+_0x1c9b68}};console[_0xd3fdce(0x179)](JSON['stringify'](_0x4ef88c));}}if(_0x5e1e64[_0xd3fdce(0x17d)](_0x3b0561,_0x5b4204)&&!_0xb1db51)try{await concludeSession(_0x5d4ec6['featureId'],_0x5b4204);}catch{}await _0x5e1e64['UGyxa'](trackStop,_0x169acf,!![],_0x874077);return;}catch{await _0x5e1e64['fetSS'](trackStop,_0x169acf,!![],_0x874077);return;}}async function trackStop(_0x531a52,_0x4e1300,_0x34f221){const _0x47feb2=_0x45da,_0x14a019={'VbaUB':_0x47feb2(0x17c),'aiHzO':function(_0x16fab0,_0x410fea){return _0x16fab0??_0x410fea;},'FkOpS':'success'};try{const _0x37591c=createTelemetryCollector(_0x14a019['VbaUB']);await _0x37591c[_0x47feb2(0x184)]({'sessionId':_0x14a019[_0x47feb2(0x180)](_0x531a52,undefined),'hooksEnabled':_0x4e1300,'stopAllowed':_0x34f221}),await _0x37591c['trackCommandEnd'](_0x14a019['FkOpS']);}catch{}}
|
package/build/commands/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1c0bc1,_0x53ed32){var _0x43afc2=_0x2de4,_0x984b08=_0x1c0bc1();while(!![]){try{var _0x3be4e2=-parseInt(_0x43afc2(0xe5))/0x1+-parseInt(_0x43afc2(0xe4))/0x2+-parseInt(_0x43afc2(0xdb))/0x3*(parseInt(_0x43afc2(0xe0))/0x4)+-parseInt(_0x43afc2(0xe2))/0x5*(-parseInt(_0x43afc2(0xdf))/0x6)+-parseInt(_0x43afc2(0xe3))/0x7*(parseInt(_0x43afc2(0xdd))/0x8)+parseInt(_0x43afc2(0xdc))/0x9+parseInt(_0x43afc2(0xe1))/0xa*(parseInt(_0x43afc2(0xde))/0xb);if(_0x3be4e2===_0x53ed32)break;else _0x984b08['push'](_0x984b08['shift']());}catch(_0x536adc){_0x984b08['push'](_0x984b08['shift']());}}}(_0x192b,0xd9d90));export{addEnv}from'./addEnv.js';function _0x192b(){var _0x4914e0=['209367ByvFcf','67458bzNEKA','1243422qXYiHZ','426472gTuTGb','1331pMnzIb','2080554stYdKa','40HcIvSY','280570LbXccO','10GQcnia','161HwdRMK','3347870prPVNf'];_0x192b=function(){return _0x4914e0;};return _0x192b();}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';function _0x2de4(_0x4b1a4d,_0x4e0f88){_0x4b1a4d=_0x4b1a4d-0xdb;var _0x192b07=_0x192b();var _0x2de465=_0x192b07[_0x4b1a4d];return _0x2de465;}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';export{migrateProfile}from'./migrateProfile.js';
|
package/build/commands/login.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4b540f,_0x28529b){const _0x5706cc=_0x3cab,_0x5a2f0a=_0x4b540f();while(!![]){try{const _0x3b9357=parseInt(_0x5706cc(0x141))/0x1*(parseInt(_0x5706cc(0x155))/0x2)+parseInt(_0x5706cc(0x154))/0x3*(-parseInt(_0x5706cc(0x143))/0x4)+parseInt(_0x5706cc(0x150))/0x5+parseInt(_0x5706cc(0x14a))/0x6*(parseInt(_0x5706cc(0x153))/0x7)+parseInt(_0x5706cc(0x142))/0x8*(parseInt(_0x5706cc(0x14c))/0x9)+-parseInt(_0x5706cc(0x152))/0xa*(parseInt(_0x5706cc(0x149))/0xb)+parseInt(_0x5706cc(0x14b))/0xc*(-parseInt(_0x5706cc(0x144))/0xd);if(_0x3b9357===_0x28529b)break;else _0x5a2f0a['push'](_0x5a2f0a['shift']());}catch(_0x521f78){_0x5a2f0a['push'](_0x5a2f0a['shift']());}}}(_0x474f,0x7116d));function _0x474f(){const _0x354b0d=['36QLHXUB','18fQAWZB','success','hNlAw','log','3044075pbMBZM','Re-authenticating\x20via\x20MCP\x20bootstrap...','3786250xbgVuD','10759TNkYFz','1212MNljSq','170dtNwnp','2104UjDvFD','3389592lcNfSI','8636dSBOXo','1462526UlesRh','Login\x20failed:\x20','\x0a✅\x20API\x20key\x20stored\x20successfully','organizationName','isTTY','11oeIvJZ','1626YZUjBL'];_0x474f=function(){return _0x354b0d;};return _0x474f();}import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';function _0x3cab(_0x411baf,_0x23f8ee){_0x411baf=_0x411baf-0x141;const _0x474f84=_0x474f();let _0x3cab9c=_0x474f84[_0x411baf];return _0x3cab9c;}export async function login(){const _0x3ccb9d=_0x3cab,_0xf5c425={'hNlAw':function(_0x4a6c40){return _0x4a6c40();},'fPbbl':function(_0x33457f,_0x3d579d){return _0x33457f(_0x3d579d);},'oKazM':function(_0x2494ad,_0x2f6cdb){return _0x2494ad instanceof _0x2f6cdb;}},_0x1a114f=await getMcpAuthOrigin();if(_0x1a114f){console['log'](_0x3ccb9d(0x151)),await _0xf5c425[_0x3ccb9d(0x14e)](mcpBootstrap);return;}const _0x1324ba=process['stdin']['isTTY']&&process['stdout'][_0x3ccb9d(0x148)];if(!_0x1324ba)throw new Error('Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.');try{const _0x1fe778=await runDeviceAuthFlow(),_0x1c6427=await _0xf5c425['fPbbl'](getCurrentUser,_0x1fe778);_0x1c6427[_0x3ccb9d(0x14d)]?console['log']('\x0a✅\x20Logged\x20in\x20to\x20'+_0x1c6427['user'][_0x3ccb9d(0x147)]):console[_0x3ccb9d(0x14f)](_0x3ccb9d(0x146));}catch(_0x31e8c1){throw new Error(_0x3ccb9d(0x145)+(_0xf5c425['oKazM'](_0x31e8c1,Error)?_0x31e8c1['message']:_0x31e8c1));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x2e64c3=_0x4df8;(function(_0x2588d5,_0x375047){const _0x2ed581=_0x4df8,_0x5e870a=_0x2588d5();while(!![]){try{const _0x15825e=parseInt(_0x2ed581(0x100))/0x1*(parseInt(_0x2ed581(0x99))/0x2)+parseInt(_0x2ed581(0xe6))/0x3+-parseInt(_0x2ed581(0xdb))/0x4*(-parseInt(_0x2ed581(0x89))/0x5)+parseInt(_0x2ed581(0x87))/0x6*(parseInt(_0x2ed581(0x98))/0x7)+parseInt(_0x2ed581(0x7f))/0x8*(parseInt(_0x2ed581(0xf9))/0x9)+parseInt(_0x2ed581(0xd0))/0xa+-parseInt(_0x2ed581(0x102))/0xb;if(_0x15825e===_0x375047)break;else _0x5e870a['push'](_0x5e870a['shift']());}catch(_0x1a7463){_0x5e870a['push'](_0x5e870a['shift']());}}}(_0x2ae2,0x2a7ae));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',_0x2e64c3(0xad)),AUTH_ORIGIN_PATH=join(homedir(),'.ranger','auth-origin.txt');export async function getMcpAuthOrigin(){const _0x3e33f2=_0x2e64c3,_0x535556={'aWjIb':function(_0x25406d,_0xfd6c0c,_0x337e4e){return _0x25406d(_0xfd6c0c,_0x337e4e);},'jUBdR':_0x3e33f2(0xbd)};try{const _0x11c533=(await _0x535556['aWjIb'](readFile,AUTH_ORIGIN_PATH,_0x535556[_0x3e33f2(0x101)]))['trim']();return _0x11c533||null;}catch{return null;}}export async function mcpBootstrap(){const _0x30b5a1=_0x2e64c3,_0x4fc85d={'aZHoF':function(_0x2fa5c8,_0x144428){return _0x2fa5c8(_0x144428);},'GbItz':_0x30b5a1(0x9e)},_0xbc3fef=getMcpAuthUrl();currentOrigin=_0xbc3fef;const _0x73d0ad=process['stdout']['isTTY']??![];console['log'](_0x30b5a1(0x93)+_0xbc3fef+'\x0a');const _0x4dc5f1=await _0x4fc85d['aZHoF'](tryUnauthenticated,_0xbc3fef);let _0x44acef=null;if(_0x4dc5f1===_0x4fc85d['GbItz'])_0x44acef='';else{_0x44acef=await loadCachedToken();if(!_0x44acef){if(!_0x73d0ad)throw new Error('MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a'+_0x30b5a1(0xcf));_0x44acef=await oauthFlow(_0xbc3fef);}}await callGetCliToken(_0xbc3fef,_0x44acef);}async function tryUnauthenticated(_0x15c95c){const _0x566e31=_0x2e64c3,_0x4e4742={'LVhRZ':function(_0x444e2f,_0x4d5d58,_0xdf020b){return _0x444e2f(_0x4d5d58,_0xdf020b);},'Imooa':'POST','KOFip':_0x566e31(0xef),'aWNlu':'application/json,\x20text/event-stream','YkFlv':'2.0','iVhSe':'initialize','VjFSl':_0x566e31(0xdc),'ukkAP':function(_0x4e76fe,_0x2afb53){return _0x4e76fe===_0x2afb53;},'hUdNF':'needs-oauth'},_0x1cafa3=await _0x4e4742['LVhRZ'](fetch,_0x15c95c,{'method':_0x4e4742[_0x566e31(0xd2)],'headers':{'Content-Type':_0x4e4742['KOFip'],'Accept':_0x4e4742[_0x566e31(0xbe)]},'body':JSON[_0x566e31(0x106)]({'jsonrpc':_0x4e4742['YkFlv'],'id':0x1,'method':_0x4e4742['iVhSe'],'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x4e4742['VjFSl'],'version':_0x566e31(0xa5)}}})});if(_0x1cafa3['ok'])return await _0x1cafa3[_0x566e31(0xdf)](),_0x566e31(0x9e);if(_0x4e4742[_0x566e31(0xd4)](_0x1cafa3['status'],0x191))return await _0x1cafa3[_0x566e31(0xdf)](),_0x4e4742[_0x566e31(0xae)];const _0x371294=await _0x1cafa3['text']();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x1cafa3['status']+':\x20'+_0x371294);}class OAuthTimeoutError extends Error{constructor(_0x2e2b98){super(_0x2e2b98),this['name']='OAuthTimeoutError';}}async function oauthFlow(_0x5cfb4b){const _0xeeed6b=_0x2e64c3,_0x300336={'QTKYL':function(_0x9a806c,_0x4a2555){return _0x9a806c(_0x4a2555);},'uIvIs':'\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','CgNHv':function(_0x541ea7){return _0x541ea7();}};try{return await _0x300336['QTKYL'](oauthFlowAttempt,_0x5cfb4b);}catch(_0x2b40a9){if(_0x2b40a9 instanceof OAuthTimeoutError&&await loadCachedClient())return console[_0xeeed6b(0xc4)](_0x300336[_0xeeed6b(0xf4)]),await _0x300336['CgNHv'](clearCachedClient),await oauthFlowAttempt(_0x5cfb4b);throw _0x2b40a9;}}async function oauthFlowAttempt(_0x54032a){const _0x479537=_0x2e64c3,_0x27e7b3={'GlxyU':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','rczMB':function(_0x3b8eec){return _0x3b8eec();},'yFVHP':_0x479537(0x107),'VKPdS':'authorization_code','CNSxq':'refresh_token','Fsnou':'code','xjLOn':_0x479537(0x108),'ZNgOh':'\x20done','NIxtg':'Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','DVlib':function(_0x573cbb,_0x70a6a3){return _0x573cbb(_0x70a6a3);},'FqXUK':_0x479537(0xcd),'pxaXQ':_0x479537(0x8d),'TPoNr':'client_id','jqUmy':_0x479537(0xe1),'iEmMY':_0x479537(0xbf),'qhTPs':function(_0x52a7f9,_0x43a566,_0x2934ab,_0x38eaab){return _0x52a7f9(_0x43a566,_0x2934ab,_0x38eaab);}},_0x107241=_0x54032a[_0x479537(0xc3)](/\/mcp$/,'');process[_0x479537(0x94)][_0x479537(0x9a)](_0x479537(0x96));const _0x5123e4=await fetch(_0x107241+_0x479537(0xa4));if(!_0x5123e4['ok'])throw new Error(_0x27e7b3[_0x479537(0xf7)]);const _0x205828=await _0x5123e4[_0x479537(0xb1)](),_0x232a30=_0x205828[_0x479537(0xfd)]?.[0x0];if(!_0x232a30)throw new Error(_0x479537(0xdd));console['log']('\x20'+_0x232a30);const _0x196ac0=await fetchAuthServerMetadata(_0x232a30);let _0x34ba60,_0x826b08;const _0x1e6987=await _0x27e7b3['rczMB'](loadCachedClient);if(_0x1e6987)_0x34ba60=_0x1e6987['clientId'],_0x826b08=_0x1e6987[_0x479537(0x9f)];else{if(_0x196ac0[_0x479537(0xb7)]){process[_0x479537(0x94)]['write'](_0x27e7b3[_0x479537(0xaa)]);const _0x22dc00=await fetch(_0x196ac0['registration_endpoint'],{'method':_0x479537(0xde),'headers':{'Content-Type':'application/json'},'body':JSON[_0x479537(0x106)]({'client_name':_0x479537(0xee),'redirect_uris':['http://localhost:'+CALLBACK_PORT+_0x479537(0x8b)],'grant_types':[_0x27e7b3[_0x479537(0xf3)],_0x27e7b3['CNSxq']],'response_types':[_0x27e7b3['Fsnou']],'token_endpoint_auth_method':_0x27e7b3['xjLOn']})});if(!_0x22dc00['ok']){const _0x1151fd=await _0x22dc00['text']();throw new Error(_0x479537(0x105)+_0x1151fd);}const _0x2261f8=await _0x22dc00['json']();_0x34ba60=_0x2261f8['client_id'],_0x826b08=_0x2261f8['client_secret'],await saveCachedClient(_0x34ba60,_0x826b08),console[_0x479537(0xc4)](_0x27e7b3['ZNgOh']);}else throw new Error(_0x27e7b3[_0x479537(0x92)]);}const _0x197d27=randomBytes(0x20)['toString']('base64url'),_0x50929b=_0x27e7b3[_0x479537(0xb8)](createHash,_0x27e7b3[_0x479537(0xa2)])[_0x479537(0x10a)](_0x197d27)[_0x479537(0xf5)](_0x27e7b3['pxaXQ']),_0xde30af=randomBytes(0x10)['toString'](_0x479537(0x7a)),_0x1da9ca=new URL(_0x196ac0[_0x479537(0xe9)]);_0x1da9ca[_0x479537(0xb0)][_0x479537(0xb5)]('response_type',_0x27e7b3['Fsnou']),_0x1da9ca['searchParams']['set'](_0x27e7b3[_0x479537(0x97)],_0x34ba60),_0x1da9ca['searchParams']['set']('redirect_uri',_0x479537(0xb3)+CALLBACK_PORT+_0x479537(0x8b)),_0x1da9ca[_0x479537(0xb0)]['set'](_0x479537(0xe5),_0x50929b),_0x1da9ca['searchParams'][_0x479537(0xb5)]('code_challenge_method',_0x479537(0x77)),_0x1da9ca[_0x479537(0xb0)]['set'](_0x479537(0x7e),_0xde30af);_0x205828[_0x479537(0xfb)]&&_0x1da9ca[_0x479537(0xb0)]['set']('resource',_0x205828[_0x479537(0xfb)]);console[_0x479537(0xc4)](_0x27e7b3[_0x479537(0x85)]),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x1da9ca['toString']()+'\x0a'),await _0x27e7b3['DVlib'](openBrowser,_0x1da9ca['toString']());const _0x5cad73=await _0x27e7b3['DVlib'](waitForCallback,_0xde30af);process[_0x479537(0x94)]['write']('Exchanging\x20authorization\x20code...');const _0x35bbfc=new URLSearchParams({'grant_type':_0x479537(0xfc),'code':_0x5cad73,'redirect_uri':'http://localhost:'+CALLBACK_PORT+'/callback','client_id':_0x34ba60,'code_verifier':_0x197d27});_0x826b08&&_0x35bbfc[_0x479537(0xb5)]('client_secret',_0x826b08);_0x205828[_0x479537(0xfb)]&&_0x35bbfc['set'](_0x479537(0xfb),_0x205828[_0x479537(0xfb)]);const _0x361087=await fetch(_0x196ac0['token_endpoint'],{'method':_0x479537(0xde),'headers':{'Content-Type':_0x27e7b3['iEmMY']},'body':_0x35bbfc});if(!_0x361087['ok']){const _0x3e06c3=await _0x361087['text']();throw new Error(_0x479537(0x103)+_0x3e06c3);}const _0x53019b=await _0x361087[_0x479537(0xb1)]();return console[_0x479537(0xc4)](_0x27e7b3[_0x479537(0xe3)]),await _0x27e7b3[_0x479537(0xd3)](saveCachedToken,_0x53019b[_0x479537(0x79)],_0x53019b[_0x479537(0x8e)],_0x53019b[_0x479537(0x82)]),_0x53019b[_0x479537(0x79)];}async function callGetCliToken(_0x2fd932,_0x56f745){const _0x7f88ba=_0x2e64c3,_0x4ecce8={'FseJJ':_0x7f88ba(0xde),'etmoM':function(_0x22304b,_0x5d94f6){return _0x22304b(_0x5d94f6);},'BEKaW':_0x7f88ba(0xff),'caUmR':_0x7f88ba(0xd5),'vqARn':'2.0','MJfzp':_0x7f88ba(0x8f),'NzDFE':'ranger-cli','zLGkb':'1.0.0','SGwzF':'\x20done','kdEDJ':function(_0xd5a9b1,_0x5154a3,_0x439121){return _0xd5a9b1(_0x5154a3,_0x439121);},'ejUHA':'Requesting\x20CLI\x20token...','pOcbB':function(_0x447db6,_0xc210e4){return _0x447db6(_0xc210e4);},'BdLnu':_0x7f88ba(0xc7),'PASWb':_0x7f88ba(0x95),'WlqWS':function(_0x2aa78c,_0x1b859b,_0x117d7f){return _0x2aa78c(_0x1b859b,_0x117d7f);},'LrnSJ':function(_0x1d8e56){return _0x1d8e56();},'znAHN':_0x7f88ba(0x104),'ndqSt':function(_0x3e7e6e,_0x2fe0cb,_0x217186){return _0x3e7e6e(_0x2fe0cb,_0x217186);},'RnhKn':function(_0x41f2d0,_0x887653,_0xa6ab16){return _0x41f2d0(_0x887653,_0xa6ab16);}},_0x4ba0ab={'Content-Type':_0x7f88ba(0xef),'Accept':_0x4ecce8[_0x7f88ba(0x91)]};_0x56f745&&(_0x4ba0ab[_0x7f88ba(0xbc)]=_0x7f88ba(0x7d)+_0x56f745);const _0x5327d5=async _0x3ebc0e=>{const _0x56ffe0=_0x7f88ba,_0x4adb9e=await fetch(_0x2fd932,{'method':_0x4ecce8[_0x56ffe0(0x8c)],'headers':_0x4ba0ab,'body':JSON[_0x56ffe0(0x106)](_0x3ebc0e)});if(!_0x4adb9e['ok']){const _0x51366d=await _0x4adb9e['text']();throw new Error('HTTP\x20'+_0x4adb9e[_0x56ffe0(0xbb)]+':\x20'+_0x51366d);}return _0x4ecce8[_0x56ffe0(0xa6)](parseResponse,_0x4adb9e);};process[_0x7f88ba(0x94)][_0x7f88ba(0x9a)](_0x4ecce8['caUmR']);const _0x1b1a7=await _0x5327d5({'jsonrpc':_0x4ecce8[_0x7f88ba(0x9d)],'id':0x1,'method':'initialize','params':{'protocolVersion':_0x4ecce8[_0x7f88ba(0xcb)],'capabilities':{},'clientInfo':{'name':_0x4ecce8['NzDFE'],'version':_0x4ecce8[_0x7f88ba(0x7b)]}}});if(_0x1b1a7[_0x7f88ba(0x83)])throw new Error(_0x7f88ba(0xc2)+(_0x1b1a7[_0x7f88ba(0x83)][_0x7f88ba(0x9c)]??JSON['stringify'](_0x1b1a7[_0x7f88ba(0x83)])));console['log'](_0x4ecce8['SGwzF']),await _0x4ecce8[_0x7f88ba(0xf0)](fetch,_0x2fd932,{'method':_0x4ecce8['FseJJ'],'headers':_0x4ba0ab,'body':JSON['stringify']({'jsonrpc':'2.0','method':'notifications/initialized'})})['then'](_0x1b4314=>_0x1b4314[_0x7f88ba(0xdf)]()),process['stdout']['write'](_0x4ecce8[_0x7f88ba(0xe0)]);const _0x29e47f=await _0x4ecce8[_0x7f88ba(0xaf)](_0x5327d5,{'jsonrpc':_0x4ecce8['vqARn'],'id':0x2,'method':_0x4ecce8[_0x7f88ba(0xa3)],'params':{'name':'get_cli_token','arguments':{}}});if(_0x29e47f['error'])throw new Error('get_cli_token\x20failed:\x20'+(_0x29e47f['error']['message']??JSON[_0x7f88ba(0x106)](_0x29e47f['error'])));console[_0x7f88ba(0xc4)](_0x7f88ba(0xcc));const _0x76471f=extractToken(_0x29e47f[_0x7f88ba(0xb9)]);if(!_0x76471f){console['error']('\x0aUnexpected\x20response\x20structure:'),console['error'](JSON[_0x7f88ba(0x106)](_0x29e47f[_0x7f88ba(0xb9)],null,0x2));throw new Error(_0x4ecce8['PASWb']);}const _0x13070b=_0x4ecce8[_0x7f88ba(0x81)](join,_0x4ecce8['LrnSJ'](homedir),_0x4ecce8['znAHN']),_0x3be5fa=_0x4ecce8['kdEDJ'](join,_0x13070b,'refresh.txt');await _0x4ecce8[_0x7f88ba(0xe7)](mkdir,_0x13070b,{'recursive':!![]}),await writeFile(_0x3be5fa,_0x76471f,{'mode':0x180}),await writeFile(_0x4ecce8['RnhKn'](join,_0x13070b,'auth-origin.txt'),_0x2fd932,{'mode':0x180}),console['log']('\x0aToken\x20written\x20to\x20'+_0x3be5fa),console[_0x7f88ba(0xc4)]('Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a');}async function fetchAuthServerMetadata(_0x2d802a){const _0x211c0f=_0x2e64c3,_0x472962=_0x2d802a+_0x211c0f(0xc1),_0x247bd9=await fetch(_0x472962);if(!_0x247bd9['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x472962+':\x20'+_0x247bd9[_0x211c0f(0xbb)]);return _0x247bd9['json']();}function _0x2ae2(){const _0x36838e=['No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','POST','text','ejUHA','\x0aOpening\x20browser\x20for\x20authentication...','WgJNi','ZNgOh','OAuth\x20error:\x20','code_challenge','456555KMFZvx','ndqSt','origin','authorization_endpoint','zwazU','clientId','structuredContent','ApOSL','Ranger\x20CLI','application/json','kdEDJ','expiresAt','type','VKPdS','uIvIs','digest','FwHXt','GlxyU','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','68634bypxKj','get','resource','authorization_code','authorization_servers','close','application/json,\x20text/event-stream','90407cRFfrw','jUBdR','11760199qQuFYw','Token\x20exchange\x20failed:\x20','.ranger','Client\x20registration\x20failed:\x20','stringify','Registering\x20OAuth\x20client...','none','Server\x20returned\x20error:\x20','update','S256','kBeGZ','access_token','hex','zLGkb','code','Bearer\x20','state','120AAkVnH','Unknown\x20error','WlqWS','expires_in','error','VaHlE','jqUmy','isError','708mYWXdY','trim','834600hDvBfr','text/event-stream','/callback','FseJJ','base64url','refresh_token','2025-03-26','wgAvX','BEKaW','NIxtg','\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20','stdout','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','Discovering\x20authorization\x20server...','TPoNr','14154SPpPOH','6eCIdfu','write','127.0.0.1','message','vqARn','proxied','clientSecret','content-type','error_description','FqXUK','BdLnu','/.well-known/oauth-protected-resource','1.0.0','etmoM','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','darwin','refreshToken','yFVHP','content','qegvR','mcp-oauth-tokens.json','hUdNF','pOcbB','searchParams','json','pathname','http://localhost:','split','set','qmiPo','registration_endpoint','DVlib','result','platform','status','Authorization','utf-8','aWNlu','application/x-www-form-urlencoded','writeHead','/.well-known/oauth-authorization-server','MCP\x20initialize\x20failed:\x20','replace','log','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','start','tools/call','token','hlTQE','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','MJfzp','\x20done','sha256','iEQNY','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','2997950LuhCyW','startsWith','Imooa','qhTPs','ukkAP','Initializing\x20MCP\x20session...','end','accessToken','gvSMq','WJqrW','text/html','4BKrdwk','ranger-cli'];_0x2ae2=function(){return _0x36838e;};return _0x2ae2();}function waitForCallback(_0xee1e25){const _0x176b57=_0x2e64c3,_0x1c8860={'ISQMq':function(_0x190528,_0x46aec9){return _0x190528(_0x46aec9);},'hlTQE':_0x176b57(0x7c),'qmiPo':_0x176b57(0xa1),'NtSvq':'<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','iEQNY':function(_0x22b331,_0x2d6ee0){return _0x22b331(_0x2d6ee0);},'SlydC':_0x176b57(0x9b)};return new Promise((_0x1b0f47,_0x293832)=>{const _0x17cc6f=_0x176b57,_0x1d38db={'kBeGZ':_0x17cc6f(0x8b),'gBBge':_0x1c8860[_0x17cc6f(0xc9)],'FwHXt':_0x17cc6f(0x7e),'WgJNi':_0x17cc6f(0x83),'ApOSL':_0x1c8860[_0x17cc6f(0xb6)],'JNXea':_0x17cc6f(0xda),'VaHlE':function(_0x1dd0f1,_0x66b622){return _0x1dd0f1(_0x66b622);},'EQqhD':_0x1c8860['NtSvq'],'weXay':_0x17cc6f(0xc5),'MHMyC':function(_0x506321,_0x51fc44){return _0x506321(_0x51fc44);}},_0x5a9443=setTimeout(()=>{const _0x2d78f5=_0x17cc6f;_0x35803a[_0x2d78f5(0xfe)](),_0x1c8860['ISQMq'](_0x293832,new OAuthTimeoutError(_0x2d78f5(0xa7)));},0x1d4c0),_0x35803a=_0x1c8860[_0x17cc6f(0xce)](createServer,(_0x529b9e,_0xbf75ab)=>{const _0x2ada2c=_0x17cc6f,_0x3724ad=new URL(_0x529b9e['url']??'/',_0x2ada2c(0xb3)+CALLBACK_PORT);if(_0x3724ad[_0x2ada2c(0xb2)]!==_0x1d38db[_0x2ada2c(0x78)]){_0xbf75ab[_0x2ada2c(0xc0)](0x194),_0xbf75ab[_0x2ada2c(0xd6)]('Not\x20found');return;}const _0x1e166f=_0x3724ad['searchParams']['get'](_0x1d38db['gBBge']),_0x1995e4=_0x3724ad['searchParams']['get'](_0x1d38db[_0x2ada2c(0xf6)]),_0xc6f346=_0x3724ad[_0x2ada2c(0xb0)]['get'](_0x1d38db[_0x2ada2c(0xe2)]);if(_0xc6f346){const _0x3ae0fa=_0x3724ad['searchParams'][_0x2ada2c(0xfa)](_0x1d38db[_0x2ada2c(0xed)])??_0xc6f346;_0xbf75ab[_0x2ada2c(0xc0)](0xc8,{'Content-Type':_0x1d38db['JNXea']}),_0xbf75ab[_0x2ada2c(0xd6)]('<html><body><h2>Authentication\x20failed</h2><p>'+_0x3ae0fa+_0x2ada2c(0xf8)),_0x1d38db['VaHlE'](clearTimeout,_0x5a9443),_0x35803a[_0x2ada2c(0xfe)](),_0x1d38db[_0x2ada2c(0x84)](_0x293832,new Error(_0x2ada2c(0xe4)+_0x3ae0fa));return;}if(!_0x1e166f||_0x1995e4!==_0xee1e25){_0xbf75ab[_0x2ada2c(0xc0)](0x190,{'Content-Type':_0x2ada2c(0xda)}),_0xbf75ab['end'](_0x1d38db['EQqhD']);return;}_0xbf75ab['writeHead'](0xc8,{'Content-Type':'text/html'}),_0xbf75ab[_0x2ada2c(0xd6)](_0x1d38db['weXay']),clearTimeout(_0x5a9443),_0x35803a['close'](),_0x1d38db['MHMyC'](_0x1b0f47,_0x1e166f);});_0x35803a['listen'](CALLBACK_PORT,_0x1c8860['SlydC']);});}async function openBrowser(_0x109baf){const _0x1114de=_0x2e64c3,_0x5f10b8={'zwazU':_0x1114de(0xa8),'slUtw':'open','Avofn':function(_0x1472d3,_0x39af92){return _0x1472d3===_0x39af92;},'kandA':'win32','LqJRG':_0x1114de(0xc6),'NRwpx':'xdg-open'},{exec:_0x23d2b8}=await import('child_process'),_0x272c53=process[_0x1114de(0xba)]===_0x5f10b8[_0x1114de(0xea)]?_0x5f10b8['slUtw']:_0x5f10b8['Avofn'](process['platform'],_0x5f10b8['kandA'])?_0x5f10b8['LqJRG']:_0x5f10b8['NRwpx'];_0x23d2b8(_0x272c53+'\x20\x22'+_0x109baf+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x452ae0=_0x2e64c3,_0xbe0d86={'ICkBn':function(_0x3eb887,_0x2ecd25){return _0x3eb887>_0x2ecd25;}};try{const _0x50e5c5=JSON['parse'](await readFile(TOKEN_CACHE_PATH,'utf-8'));if(_0x50e5c5[_0x452ae0(0xe8)]&&_0x50e5c5[_0x452ae0(0xe8)]!==currentOrigin)return null;if(_0x50e5c5[_0x452ae0(0xf1)]&&_0xbe0d86['ICkBn'](Date['now'](),_0x50e5c5['expiresAt']))return null;return _0x50e5c5[_0x452ae0(0xd7)]??null;}catch{return null;}}async function saveCachedToken(_0x2aef88,_0xfb7f1f,_0x3b008a){const _0x1a8703=_0x2e64c3,_0x28a14d={'WJqrW':function(_0x57363c){return _0x57363c();},'yfKmd':function(_0x2f3ece,_0x210f27){return _0x2f3ece*_0x210f27;},'Fmmje':function(_0x556be4,_0x257061,_0x56bc31){return _0x556be4(_0x257061,_0x56bc31);},'cnjfU':'.ranger'},_0x307745=await _0x28a14d['WJqrW'](loadCachedData),_0x43b5ab={..._0x307745,'origin':currentOrigin,'accessToken':_0x2aef88,'refreshToken':_0xfb7f1f??_0x307745?.[_0x1a8703(0xa9)],'expiresAt':_0x3b008a?Date['now']()+_0x28a14d['yfKmd'](_0x3b008a,0x3e8):undefined};await _0x28a14d['Fmmje'](mkdir,join(_0x28a14d[_0x1a8703(0xd9)](homedir),_0x28a14d['cnjfU']),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x43b5ab),{'mode':0x180});}async function loadCachedClient(){const _0x3d07bc=_0x2e64c3,_0x46d6e3={'JlZRY':function(_0x4f3e49,_0x40ebc1){return _0x4f3e49!==_0x40ebc1;}},_0x44ff6c=await loadCachedData();if(_0x44ff6c?.[_0x3d07bc(0xe8)]&&_0x46d6e3['JlZRY'](_0x44ff6c[_0x3d07bc(0xe8)],currentOrigin))return null;return _0x44ff6c?.['clientId']?{'clientId':_0x44ff6c[_0x3d07bc(0xeb)],'clientSecret':_0x44ff6c[_0x3d07bc(0x9f)]}:null;}async function clearCachedClient(){const _0x48378f=_0x2e64c3,_0x39976a={'ppXIy':function(_0x50d35e,_0x314a18,_0x14c3b9,_0xf3c888){return _0x50d35e(_0x314a18,_0x14c3b9,_0xf3c888);}},_0x415548=await loadCachedData();if(!_0x415548)return;const {clientId:_0xd6dfe8,clientSecret:_0x39decd,..._0x35be4f}=_0x415548;await _0x39976a['ppXIy'](writeFile,TOKEN_CACHE_PATH,JSON[_0x48378f(0x106)](_0x35be4f),{'mode':0x180});}function _0x4df8(_0x1beb30,_0x347706){_0x1beb30=_0x1beb30-0x77;const _0x2ae27b=_0x2ae2();let _0x4df8ee=_0x2ae27b[_0x1beb30];return _0x4df8ee;}async function saveCachedClient(_0x449c50,_0x16afb1){const _0x84b579=_0x2e64c3,_0x1c7a86={'gvSMq':function(_0x4e8799,_0x4646d7,_0x27baba,_0x36f5de){return _0x4e8799(_0x4646d7,_0x27baba,_0x36f5de);}},_0x4b1e9b=await loadCachedData(),_0x2723e6={..._0x4b1e9b,'origin':currentOrigin,'accessToken':_0x4b1e9b?.[_0x84b579(0xd7)]??'','clientId':_0x449c50,'clientSecret':_0x16afb1};await mkdir(join(homedir(),'.ranger'),{'recursive':!![]}),await _0x1c7a86[_0x84b579(0xd8)](writeFile,TOKEN_CACHE_PATH,JSON[_0x84b579(0x106)](_0x2723e6),{'mode':0x180});}async function loadCachedData(){try{return JSON['parse'](await readFile(TOKEN_CACHE_PATH,'utf-8'));}catch{return null;}}async function parseResponse(_0xd9dd10){const _0x1648ef=_0x2e64c3,_0x45b72a={'wgAvX':_0x1648ef(0xa0),'qegvR':'data:','KtMIA':function(_0x55c94,_0x1b734f){return _0x55c94!==_0x1b734f;},'RhzLa':_0x1648ef(0xca)},_0x48ee94=_0xd9dd10['headers'][_0x1648ef(0xfa)](_0x45b72a[_0x1648ef(0x90)])??'';if(_0x48ee94['includes'](_0x1648ef(0x8a))){const _0x5f48d1=await _0xd9dd10['text']();for(const _0x4b431a of _0x5f48d1[_0x1648ef(0xb4)]('\x0a')){const _0x23286f=_0x4b431a['trim']();if(_0x23286f[_0x1648ef(0xd1)]('data:')){const _0x2b8688=_0x23286f['slice'](_0x45b72a[_0x1648ef(0xac)]['length'])[_0x1648ef(0x88)]();if(!_0x2b8688)continue;try{const _0x387c11=JSON['parse'](_0x2b8688);if(_0x45b72a['KtMIA'](_0x387c11['id'],undefined)||_0x387c11['error'])return _0x387c11;}catch{}}}throw new Error(_0x45b72a['RhzLa']);}return _0xd9dd10[_0x1648ef(0xb1)]();}function extractToken(_0x37e37f){const _0x2788f8=_0x2e64c3,_0x33bf00={'ACqfs':_0x2788f8(0x80)};if(!_0x37e37f)return null;const _0x291dcc=_0x37e37f[_0x2788f8(0xec)];if(_0x291dcc?.[_0x2788f8(0xc8)]&&typeof _0x291dcc['token']==='string')return _0x291dcc['token'];if(_0x37e37f[_0x2788f8(0x86)]){const _0x150f64=_0x37e37f[_0x2788f8(0xab)];throw new Error(_0x2788f8(0x109)+(_0x150f64?.[0x0]?.['text']??_0x33bf00['ACqfs']));}const _0x5451e2=_0x37e37f['content'];if(_0x5451e2)for(const _0x32a077 of _0x5451e2){if(_0x32a077[_0x2788f8(0xf2)]==='text'&&_0x32a077[_0x2788f8(0xdf)]){try{const _0x2cde58=JSON['parse'](_0x32a077[_0x2788f8(0xdf)]);if(typeof _0x2cde58?.['token']==='string')return _0x2cde58['token'];}catch{}const _0x17246e=_0x32a077['text']['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x17246e)return _0x17246e[0x1];}}return null;}
|
|
1
|
+
const _0x5af043=_0x1381;(function(_0x4787a8,_0x47f0d8){const _0x1d1671=_0x1381,_0x2475b6=_0x4787a8();while(!![]){try{const _0x3dcd59=parseInt(_0x1d1671(0x1cd))/0x1+-parseInt(_0x1d1671(0x1c6))/0x2*(-parseInt(_0x1d1671(0x20d))/0x3)+-parseInt(_0x1d1671(0x1de))/0x4+-parseInt(_0x1d1671(0x1ee))/0x5+-parseInt(_0x1d1671(0x1f8))/0x6+parseInt(_0x1d1671(0x1fe))/0x7*(parseInt(_0x1d1671(0x1f9))/0x8)+-parseInt(_0x1d1671(0x234))/0x9*(-parseInt(_0x1d1671(0x238))/0xa);if(_0x3dcd59===_0x47f0d8)break;else _0x2475b6['push'](_0x2475b6['shift']());}catch(_0x50ef44){_0x2475b6['push'](_0x2475b6['shift']());}}}(_0x4406,0x80ef2));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{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger','mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),_0x5af043(0x1dd),'auth-origin.txt');export async function getMcpAuthOrigin(){const _0x4c26e6=_0x5af043,_0x52760f={'sJjrY':function(_0x348904,_0x1fa6ea,_0x33e298){return _0x348904(_0x1fa6ea,_0x33e298);},'twWwv':function(_0x5236e9,_0x13ccbb){return _0x5236e9||_0x13ccbb;}};try{const _0x359656=(await _0x52760f['sJjrY'](readFile,AUTH_ORIGIN_PATH,_0x4c26e6(0x1da)))['trim']();return _0x52760f['twWwv'](_0x359656,null);}catch{return null;}}export async function mcpBootstrap(){const _0x35249e=_0x5af043,_0x39c320={'ShqHf':function(_0x5e9dbc,_0xc504a8){return _0x5e9dbc===_0xc504a8;},'TqZzM':_0x35249e(0x1f1),'uusZm':function(_0xaba29c){return _0xaba29c();},'EBMbJ':function(_0x1e72f5,_0x31ff10){return _0x1e72f5+_0x31ff10;},'vgNat':_0x35249e(0x226)},_0x568b40=getMcpAuthUrl();currentOrigin=_0x568b40;const _0x189737=process['stdout']['isTTY']??![];console['log']('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x568b40+'\x0a');const _0x34c12c=await tryUnauthenticated(_0x568b40);let _0x56fbf6=null;if(_0x39c320[_0x35249e(0x1e6)](_0x34c12c,_0x39c320['TqZzM']))_0x56fbf6='';else{_0x56fbf6=await _0x39c320['uusZm'](loadCachedToken);if(!_0x56fbf6){if(!_0x189737)throw new Error(_0x39c320['EBMbJ']('MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a',_0x39c320['vgNat']));_0x56fbf6=await oauthFlow(_0x568b40);}}await callGetCliToken(_0x568b40,_0x56fbf6);}async function tryUnauthenticated(_0x3ef349){const _0x3034c2=_0x5af043,_0x34b046={'AeysS':function(_0x4dd09f,_0x490dbe,_0x1f1dae){return _0x4dd09f(_0x490dbe,_0x1f1dae);},'uFuAF':'initialize','ZaRhE':'1.0.0','eaOzt':'proxied','CKnLm':function(_0x26c62e,_0xb0695d){return _0x26c62e===_0xb0695d;}},_0x10319c=await _0x34b046[_0x3034c2(0x213)](fetch,_0x3ef349,{'method':_0x3034c2(0x1e7),'headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream'},'body':JSON['stringify']({'jsonrpc':'2.0','id':0x1,'method':_0x34b046[_0x3034c2(0x243)],'params':{'protocolVersion':_0x3034c2(0x21f),'capabilities':{},'clientInfo':{'name':_0x3034c2(0x1fb),'version':_0x34b046['ZaRhE']}}})});if(_0x10319c['ok'])return await _0x10319c['text'](),_0x34b046['eaOzt'];if(_0x34b046[_0x3034c2(0x235)](_0x10319c[_0x3034c2(0x21b)],0x191))return await _0x10319c[_0x3034c2(0x1f3)](),_0x3034c2(0x1f4);const _0x1c3778=await _0x10319c[_0x3034c2(0x1f3)]();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x10319c[_0x3034c2(0x21b)]+':\x20'+_0x1c3778);}class OAuthTimeoutError extends Error{constructor(_0x106295){const _0x533783=_0x5af043,_0x165ca8={'YIEQx':'OAuthTimeoutError'};super(_0x106295),this[_0x533783(0x20c)]=_0x165ca8[_0x533783(0x1f2)];}}async function oauthFlow(_0x2dee2e){const _0x350d6c=_0x5af043,_0x44e69={'MVJNW':function(_0x4d9db4,_0x133c8d){return _0x4d9db4(_0x133c8d);},'ZFgsx':function(_0x214c4a,_0x2149f4){return _0x214c4a instanceof _0x2149f4;},'BTFQg':function(_0x4668f4){return _0x4668f4();}};try{return await _0x44e69['MVJNW'](oauthFlowAttempt,_0x2dee2e);}catch(_0x5e9a73){if(_0x44e69[_0x350d6c(0x229)](_0x5e9a73,OAuthTimeoutError)&&await _0x44e69['BTFQg'](loadCachedClient))return console['log']('\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'),await _0x44e69[_0x350d6c(0x1fd)](clearCachedClient),await oauthFlowAttempt(_0x2dee2e);throw _0x5e9a73;}}async function oauthFlowAttempt(_0x5e1110){const _0x253eef=_0x5af043,_0x3ce480={'OhOqk':function(_0x2406d3,_0x3c2b4e){return _0x2406d3(_0x3c2b4e);},'wiKBc':_0x253eef(0x245),'nDmby':function(_0x431641){return _0x431641();},'mQrMY':'Registering\x20OAuth\x20client...','Tlixa':'sha256','KyfEC':_0x253eef(0x206),'BgHRs':'response_type','tkAJh':_0x253eef(0x233),'YJXzr':_0x253eef(0x21c),'mWEYh':'code_challenge_method','oqfbV':_0x253eef(0x1ce),'TmCUp':function(_0x53896f,_0x22d0d1){return _0x53896f(_0x22d0d1);},'lKrJj':'Exchanging\x20authorization\x20code...','lgQwe':_0x253eef(0x23c),'gIRCY':'POST','hOCoM':_0x253eef(0x1f7)},_0x434ad3=_0x5e1110[_0x253eef(0x1ef)](/\/mcp$/,'');process['stdout'][_0x253eef(0x228)]('Discovering\x20authorization\x20server...');const _0x39ab01=await _0x3ce480['OhOqk'](fetch,_0x434ad3+'/.well-known/oauth-protected-resource');if(!_0x39ab01['ok'])throw new Error(_0x3ce480[_0x253eef(0x1e9)]);const _0x2a1715=await _0x39ab01[_0x253eef(0x23f)](),_0x5a12cd=_0x2a1715[_0x253eef(0x1d6)]?.[0x0];if(!_0x5a12cd)throw new Error(_0x253eef(0x217));console['log']('\x20'+_0x5a12cd);const _0x4d6a48=await _0x3ce480[_0x253eef(0x1f5)](fetchAuthServerMetadata,_0x5a12cd);let _0x173c2e,_0x520593;const _0x1a4df5=await _0x3ce480['nDmby'](loadCachedClient);if(_0x1a4df5)_0x173c2e=_0x1a4df5['clientId'],_0x520593=_0x1a4df5[_0x253eef(0x1dc)];else{if(_0x4d6a48['registration_endpoint']){process[_0x253eef(0x224)][_0x253eef(0x228)](_0x3ce480[_0x253eef(0x1ea)]);const _0x258fc1=await fetch(_0x4d6a48['registration_endpoint'],{'method':_0x253eef(0x1e7),'headers':{'Content-Type':_0x253eef(0x22d)},'body':JSON[_0x253eef(0x203)]({'client_name':'Ranger\x20CLI','redirect_uris':[_0x253eef(0x1eb)+CALLBACK_PORT+_0x253eef(0x1be)],'grant_types':['authorization_code',_0x253eef(0x1e4)],'response_types':['code'],'token_endpoint_auth_method':_0x253eef(0x241)})});if(!_0x258fc1['ok']){const _0x5d4275=await _0x258fc1[_0x253eef(0x1f3)]();throw new Error('Client\x20registration\x20failed:\x20'+_0x5d4275);}const _0x446cfa=await _0x258fc1[_0x253eef(0x23f)]();_0x173c2e=_0x446cfa['client_id'],_0x520593=_0x446cfa[_0x253eef(0x23c)],await saveCachedClient(_0x173c2e,_0x520593),console['log']('\x20done');}else throw new Error(_0x253eef(0x1d3));}const _0x1930e7=randomBytes(0x20)[_0x253eef(0x1e8)](_0x253eef(0x206)),_0x93920d=createHash(_0x3ce480[_0x253eef(0x1e1)])[_0x253eef(0x216)](_0x1930e7)[_0x253eef(0x1b9)](_0x3ce480['KyfEC']),_0x370349=_0x3ce480[_0x253eef(0x1f5)](randomBytes,0x10)[_0x253eef(0x1e8)]('hex'),_0x548652=new URL(_0x4d6a48['authorization_endpoint']);_0x548652[_0x253eef(0x1d2)][_0x253eef(0x227)](_0x3ce480[_0x253eef(0x22b)],_0x3ce480[_0x253eef(0x20b)]),_0x548652['searchParams'][_0x253eef(0x227)]('client_id',_0x173c2e),_0x548652[_0x253eef(0x1d2)][_0x253eef(0x227)](_0x3ce480[_0x253eef(0x1bf)],'http://localhost:'+CALLBACK_PORT+_0x253eef(0x1be)),_0x548652['searchParams'][_0x253eef(0x227)]('code_challenge',_0x93920d),_0x548652['searchParams'][_0x253eef(0x227)](_0x3ce480[_0x253eef(0x205)],_0x3ce480[_0x253eef(0x1c0)]),_0x548652['searchParams']['set']('state',_0x370349);_0x2a1715[_0x253eef(0x1ca)]&&_0x548652[_0x253eef(0x1d2)][_0x253eef(0x227)](_0x253eef(0x1ca),_0x2a1715['resource']);console[_0x253eef(0x23d)]('\x0aOpening\x20browser\x20for\x20authentication...'),console[_0x253eef(0x23d)](_0x253eef(0x1cf)+_0x548652[_0x253eef(0x1e8)]()+'\x0a'),await _0x3ce480[_0x253eef(0x1c2)](openBrowser,_0x548652['toString']());const _0x58f3d4=await waitForCallback(_0x370349);process[_0x253eef(0x224)]['write'](_0x3ce480['lKrJj']);const _0x1614a4=new URLSearchParams({'grant_type':'authorization_code','code':_0x58f3d4,'redirect_uri':_0x253eef(0x1eb)+CALLBACK_PORT+'/callback','client_id':_0x173c2e,'code_verifier':_0x1930e7});_0x520593&&_0x1614a4['set'](_0x3ce480['lgQwe'],_0x520593);_0x2a1715[_0x253eef(0x1ca)]&&_0x1614a4['set']('resource',_0x2a1715[_0x253eef(0x1ca)]);const _0x1f3a41=await fetch(_0x4d6a48['token_endpoint'],{'method':_0x3ce480[_0x253eef(0x240)],'headers':{'Content-Type':_0x253eef(0x1ba)},'body':_0x1614a4});if(!_0x1f3a41['ok']){const _0x2c1b77=await _0x1f3a41[_0x253eef(0x1f3)]();throw new Error(_0x253eef(0x1df)+_0x2c1b77);}const _0x3eace8=await _0x1f3a41[_0x253eef(0x23f)]();return console[_0x253eef(0x23d)](_0x3ce480['hOCoM']),await saveCachedToken(_0x3eace8['access_token'],_0x3eace8['refresh_token'],_0x3eace8['expires_in']),_0x3eace8['access_token'];}async function callGetCliToken(_0x43a1fa,_0x8ceea6){const _0x49bed5=_0x5af043,_0x381bef={'pfxFO':_0x49bed5(0x1e7),'KGSuP':'application/json','dyPKP':_0x49bed5(0x1d5),'hApfk':_0x49bed5(0x207),'LKZfR':function(_0x4a57f0,_0x9b79ca){return _0x4a57f0(_0x9b79ca);},'bNmcL':_0x49bed5(0x1f0),'qJaxG':_0x49bed5(0x1c7),'btBII':'ranger-cli','YKvyr':_0x49bed5(0x1cc),'fCRvQ':'notifications/initialized','jeUsn':'get_cli_token','SDfVE':'\x20done','FBNRO':function(_0x4fb8a4,_0x397253){return _0x4fb8a4(_0x397253);},'Prsgz':'Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','xzMsL':'.ranger','waUVy':_0x49bed5(0x1e2),'pavEp':function(_0x40388d,_0x1c906c,_0x28adf2){return _0x40388d(_0x1c906c,_0x28adf2);},'HGbJy':function(_0x245a2c,_0x153089,_0x3a2d22,_0xfbb866){return _0x245a2c(_0x153089,_0x3a2d22,_0xfbb866);},'qtGFt':_0x49bed5(0x22c)},_0x5a8ee7={'Content-Type':_0x381bef[_0x49bed5(0x1d7)],'Accept':'application/json,\x20text/event-stream'};_0x8ceea6&&(_0x5a8ee7[_0x381bef['dyPKP']]=_0x49bed5(0x218)+_0x8ceea6);const _0xef1e36=async _0x8e4eb2=>{const _0x4a086f=_0x49bed5,_0x71fef6=await fetch(_0x43a1fa,{'method':_0x381bef['pfxFO'],'headers':_0x5a8ee7,'body':JSON['stringify'](_0x8e4eb2)});if(!_0x71fef6['ok']){const _0x6a7604=await _0x71fef6[_0x4a086f(0x1f3)]();throw new Error(_0x4a086f(0x1d1)+_0x71fef6[_0x4a086f(0x21b)]+':\x20'+_0x6a7604);}return parseResponse(_0x71fef6);};process['stdout'][_0x49bed5(0x228)](_0x381bef[_0x49bed5(0x208)]);const _0x1a8ac0=await _0x381bef['LKZfR'](_0xef1e36,{'jsonrpc':_0x381bef['bNmcL'],'id':0x1,'method':_0x381bef['qJaxG'],'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x381bef['btBII'],'version':_0x381bef['YKvyr']}}});if(_0x1a8ac0[_0x49bed5(0x201)])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x1a8ac0[_0x49bed5(0x201)]['message']??JSON[_0x49bed5(0x203)](_0x1a8ac0['error'])));console['log']('\x20done'),await fetch(_0x43a1fa,{'method':_0x381bef[_0x49bed5(0x1bc)],'headers':_0x5a8ee7,'body':JSON[_0x49bed5(0x203)]({'jsonrpc':'2.0','method':_0x381bef[_0x49bed5(0x215)]})})[_0x49bed5(0x246)](_0x537b14=>_0x537b14['text']()),process['stdout']['write']('Requesting\x20CLI\x20token...');const _0x446bb4=await _0x381bef[_0x49bed5(0x230)](_0xef1e36,{'jsonrpc':_0x381bef['bNmcL'],'id':0x2,'method':_0x49bed5(0x212),'params':{'name':_0x381bef['jeUsn'],'arguments':{}}});if(_0x446bb4['error'])throw new Error('get_cli_token\x20failed:\x20'+(_0x446bb4[_0x49bed5(0x201)][_0x49bed5(0x1c5)]??JSON['stringify'](_0x446bb4['error'])));console['log'](_0x381bef['SDfVE']);const _0x2e7b58=_0x381bef[_0x49bed5(0x219)](extractToken,_0x446bb4['result']);if(!_0x2e7b58){console['error']('\x0aUnexpected\x20response\x20structure:'),console[_0x49bed5(0x201)](JSON['stringify'](_0x446bb4['result'],null,0x2));throw new Error(_0x381bef['Prsgz']);}const _0x4e403b=join(homedir(),_0x381bef[_0x49bed5(0x23a)]),_0x9572a9=join(_0x4e403b,_0x381bef[_0x49bed5(0x1d0)]);await _0x381bef[_0x49bed5(0x239)](mkdir,_0x4e403b,{'recursive':!![]}),await _0x381bef[_0x49bed5(0x23e)](writeFile,_0x9572a9,_0x2e7b58,{'mode':0x180}),await writeFile(join(_0x4e403b,_0x381bef[_0x49bed5(0x232)]),_0x43a1fa,{'mode':0x180}),console['log'](_0x49bed5(0x242)+_0x9572a9),console[_0x49bed5(0x23d)]('Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a');}function _0x4406(){const _0x4a98c0=['then','trim','digest','application/x-www-form-urlencoded','GHOxr','pfxFO','FVAPL','/callback','YJXzr','oqfbV','end','TmCUp','writeHead','NigEY','message','10etjnHp','initialize','ELmaY','WlReq','resource','kBrTd','1.0.0','82541WfJFsq','S256','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','waUVy','HTTP\x20','searchParams','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','type','Authorization','authorization_servers','KGSuP','parse','VvPMb','utf-8','Not\x20found','clientSecret','.ranger','4074456WTPeFC','Token\x20exchange\x20failed:\x20','txiwS','Tlixa','refresh.txt','JrExy','refresh_token','data:','ShqHf','POST','toString','wiKBc','mQrMY','http://localhost:','win32','slice','4804045ysRQfI','replace','2.0','proxied','YIEQx','text','needs-oauth','OhOqk','pathname','\x20done','4048386APdcJF','312qqJQtm','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','ranger-cli','length','BTFQg','168987aMtjLz','close','<html><body><h2>Authentication\x20failed</h2><p>','error','isError','stringify','text/html','mWEYh','base64url','Initializing\x20MCP\x20session...','hApfk','token','get','tkAJh','name','115719SBBpnV','origin','text/event-stream','now','structuredContent','tools/call','AeysS','yjHla','fCRvQ','update','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','Bearer\x20','FBNRO','tFvBZ','status','redirect_uri','vJonN','platform','2025-03-26','refreshToken','127.0.0.1','expiresAt','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','stdout','string','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','set','write','ZFgsx','LDwRj','BgHRs','auth-origin.txt','application/json','OAuth\x20error:\x20','xBOWV','LKZfR','url','qtGFt','code','17688267ZzAIxC','CKnLm','aDfdV','Hpmzh','10MKohfA','pavEp','xzMsL','MhoIa','client_secret','log','HGbJy','json','gIRCY','none','\x0aToken\x20written\x20to\x20','uFuAF','darwin','Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server'];_0x4406=function(){return _0x4a98c0;};return _0x4406();}async function fetchAuthServerMetadata(_0x576fb7){const _0x3deb7c=_0x5af043,_0x37e43f={'KQiLv':function(_0x11454e,_0x4a7daf){return _0x11454e(_0x4a7daf);}},_0x39a769=_0x576fb7+'/.well-known/oauth-authorization-server',_0x1fa728=await _0x37e43f['KQiLv'](fetch,_0x39a769);if(!_0x1fa728['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x39a769+':\x20'+_0x1fa728['status']);return _0x1fa728[_0x3deb7c(0x23f)]();}function waitForCallback(_0x80e1fd){const _0x13b260=_0x5af043,_0xf096d={'yjHla':function(_0x317014){return _0x317014();},'vJonN':function(_0x2d2d41,_0x2e1b34){return _0x2d2d41(_0x2e1b34);},'OCDDz':'OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','leJbD':'/callback','UIlDz':_0x13b260(0x1db),'GHOxr':'code','MhoIa':'state','SWYzh':_0x13b260(0x201),'ELmaY':'error_description','SHbNH':_0x13b260(0x204),'ljAzV':function(_0x2590dd,_0x448629){return _0x2590dd(_0x448629);},'xBOWV':'<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','NigEY':function(_0x1ab39f){return _0x1ab39f();}};return new Promise((_0x1600c6,_0x1a106a)=>{const _0x51f8c2=_0x13b260,_0x377f53=()=>{const _0x22f437=_0x1381;_0x81098f['closeAllConnections'](),_0x81098f[_0x22f437(0x1ff)]();},_0x603bf2=setTimeout(()=>{const _0x3e6e54=_0x1381;_0xf096d[_0x3e6e54(0x214)](_0x377f53),_0xf096d[_0x3e6e54(0x21d)](_0x1a106a,new OAuthTimeoutError(_0xf096d['OCDDz']));},0x1d4c0),_0x81098f=createServer((_0x189b38,_0x31da76)=>{const _0x20c039=_0x1381,_0x3ee442=new URL(_0x189b38[_0x20c039(0x231)]??'/','http://localhost:'+CALLBACK_PORT);if(_0x3ee442[_0x20c039(0x1f6)]!==_0xf096d['leJbD']){_0x31da76['writeHead'](0x194),_0x31da76[_0x20c039(0x1c1)](_0xf096d['UIlDz']);return;}const _0x55fa62=_0x3ee442['searchParams'][_0x20c039(0x20a)](_0xf096d[_0x20c039(0x1bb)]),_0x3562cb=_0x3ee442[_0x20c039(0x1d2)]['get'](_0xf096d[_0x20c039(0x23b)]),_0x192baa=_0x3ee442['searchParams']['get'](_0xf096d['SWYzh']);if(_0x192baa){const _0x2376ea=_0x3ee442['searchParams'][_0x20c039(0x20a)](_0xf096d[_0x20c039(0x1c8)])??_0x192baa;_0x31da76[_0x20c039(0x1c3)](0xc8,{'Content-Type':_0xf096d['SHbNH']}),_0x31da76[_0x20c039(0x1c1)](_0x20c039(0x200)+_0x2376ea+_0x20c039(0x1fa)),_0xf096d['ljAzV'](clearTimeout,_0x603bf2),_0x377f53(),_0xf096d[_0x20c039(0x21d)](_0x1a106a,new Error(_0x20c039(0x22e)+_0x2376ea));return;}if(!_0x55fa62||_0x3562cb!==_0x80e1fd){_0x31da76['writeHead'](0x190,{'Content-Type':'text/html'}),_0x31da76['end'](_0xf096d[_0x20c039(0x22f)]);return;}_0x31da76['writeHead'](0xc8,{'Content-Type':_0x20c039(0x204)}),_0x31da76['end']('<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>'),clearTimeout(_0x603bf2),_0xf096d[_0x20c039(0x1c4)](_0x377f53),_0xf096d['vJonN'](_0x1600c6,_0x55fa62);});_0x81098f['listen'](CALLBACK_PORT,_0x51f8c2(0x221));});}async function openBrowser(_0x1c247b){const _0x1bcbf4=_0x5af043,_0x50b949={'HUtSp':_0x1bcbf4(0x244),'LDwRj':'open','Hpmzh':function(_0x3ceae8,_0x1f6902){return _0x3ceae8===_0x1f6902;}},_0x4ecce6=process[_0x1bcbf4(0x21e)]===_0x50b949['HUtSp']?_0x50b949[_0x1bcbf4(0x22a)]:_0x50b949[_0x1bcbf4(0x237)](process['platform'],_0x1bcbf4(0x1ec))?'start':'xdg-open';exec(_0x4ecce6+'\x20\x22'+_0x1c247b+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x59eefd=_0x5af043,_0x2f7a0c={'CnOMJ':'utf-8'};try{const _0x659651=JSON['parse'](await readFile(TOKEN_CACHE_PATH,_0x2f7a0c['CnOMJ']));if(_0x659651['origin']&&_0x659651['origin']!==currentOrigin)return null;if(_0x659651[_0x59eefd(0x222)]&&Date[_0x59eefd(0x210)]()>_0x659651['expiresAt'])return null;return _0x659651['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0x2c522d,_0x92db09,_0x23ae5f){const _0x49663a=_0x5af043,_0x8517fd={'aDfdV':function(_0x59e8d2,_0xf288a1){return _0x59e8d2+_0xf288a1;},'JrExy':function(_0x5516dd,_0x25eb7f){return _0x5516dd*_0x25eb7f;},'tFvBZ':function(_0x41629f,_0x4e788b,_0x38a90c){return _0x41629f(_0x4e788b,_0x38a90c);},'ztPSJ':function(_0x3f24a8){return _0x3f24a8();}},_0x1041dd=await loadCachedData(),_0x1a8861={..._0x1041dd,'origin':currentOrigin,'accessToken':_0x2c522d,'refreshToken':_0x92db09??_0x1041dd?.[_0x49663a(0x220)],'expiresAt':_0x23ae5f?_0x8517fd[_0x49663a(0x236)](Date[_0x49663a(0x210)](),_0x8517fd[_0x49663a(0x1e3)](_0x23ae5f,0x3e8)):undefined};await _0x8517fd['tFvBZ'](mkdir,_0x8517fd[_0x49663a(0x21a)](join,_0x8517fd['ztPSJ'](homedir),'.ranger'),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x1a8861),{'mode':0x180});}async function loadCachedClient(){const _0x2660ae=_0x5af043,_0x5aa981={'VvPMb':function(_0x31b2d7,_0x30f8fa){return _0x31b2d7!==_0x30f8fa;}},_0x1773ab=await loadCachedData();if(_0x1773ab?.[_0x2660ae(0x20e)]&&_0x5aa981[_0x2660ae(0x1d9)](_0x1773ab[_0x2660ae(0x20e)],currentOrigin))return null;return _0x1773ab?.['clientId']?{'clientId':_0x1773ab['clientId'],'clientSecret':_0x1773ab[_0x2660ae(0x1dc)]}:null;}async function clearCachedClient(){const _0x5b43a2=_0x5af043,_0x17f912={'WlReq':function(_0x22de82){return _0x22de82();},'kBrTd':function(_0x45e6f3,_0x3787c6,_0x4fd098,_0x14831f){return _0x45e6f3(_0x3787c6,_0x4fd098,_0x14831f);}},_0x22a2ca=await _0x17f912[_0x5b43a2(0x1c9)](loadCachedData);if(!_0x22a2ca)return;const {clientId:_0x29a38c,clientSecret:_0x457c78,..._0x554e75}=_0x22a2ca;await _0x17f912[_0x5b43a2(0x1cb)](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x554e75),{'mode':0x180});}async function saveCachedClient(_0x102b75,_0xcc6f8){const _0x48c4a6=_0x5af043,_0x3ed28a={'UbiCh':function(_0x3d9524,_0x95ba16,_0x395757){return _0x3d9524(_0x95ba16,_0x395757);},'ASZZK':_0x48c4a6(0x1dd),'vTdHp':function(_0xda7b13,_0xcac98b,_0x3102ee,_0x3d0bf9){return _0xda7b13(_0xcac98b,_0x3102ee,_0x3d0bf9);}},_0x762a97=await loadCachedData(),_0xf76122={..._0x762a97,'origin':currentOrigin,'accessToken':_0x762a97?.['accessToken']??'','clientId':_0x102b75,'clientSecret':_0xcc6f8};await mkdir(_0x3ed28a['UbiCh'](join,homedir(),_0x3ed28a['ASZZK']),{'recursive':!![]}),await _0x3ed28a['vTdHp'](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0xf76122),{'mode':0x180});}async function loadCachedData(){const _0x5ef90d=_0x5af043;try{return JSON[_0x5ef90d(0x1d8)](await readFile(TOKEN_CACHE_PATH,_0x5ef90d(0x1da)));}catch{return null;}}async function parseResponse(_0x4e8b16){const _0x295513=_0x5af043,_0x575907={'bYYub':'content-type','txiwS':_0x295513(0x20f),'dQDGr':_0x295513(0x1e5),'aRDFq':function(_0x3814cf,_0x7796af){return _0x3814cf!==_0x7796af;}},_0x49e990=_0x4e8b16['headers'][_0x295513(0x20a)](_0x575907['bYYub'])??'';if(_0x49e990['includes'](_0x575907[_0x295513(0x1e0)])){const _0x9146f7=await _0x4e8b16['text']();for(const _0x2a9f0d of _0x9146f7['split']('\x0a')){const _0x58e82a=_0x2a9f0d['trim']();if(_0x58e82a['startsWith'](_0x575907['dQDGr'])){const _0x2907bc=_0x58e82a[_0x295513(0x1ed)]('data:'[_0x295513(0x1fc)])[_0x295513(0x247)]();if(!_0x2907bc)continue;try{const _0x2af126=JSON[_0x295513(0x1d8)](_0x2907bc);if(_0x575907['aRDFq'](_0x2af126['id'],undefined)||_0x2af126['error'])return _0x2af126;}catch{}}}throw new Error(_0x295513(0x223));}return _0x4e8b16[_0x295513(0x23f)]();}function _0x1381(_0x1d30fe,_0x4393a3){_0x1d30fe=_0x1d30fe-0x1b9;const _0x4406d7=_0x4406();let _0x138138=_0x4406d7[_0x1d30fe];return _0x138138;}function extractToken(_0x11c763){const _0x54295d=_0x5af043,_0x5e78ed={'FVAPL':function(_0x123284,_0x2f4427){return _0x123284===_0x2f4427;},'xAcnr':'Unknown\x20error','prQPU':'text','Bjrsj':'string'};if(!_0x11c763)return null;const _0x53d6b=_0x11c763[_0x54295d(0x211)];if(_0x53d6b?.['token']&&_0x5e78ed[_0x54295d(0x1bd)](typeof _0x53d6b[_0x54295d(0x209)],_0x54295d(0x225)))return _0x53d6b[_0x54295d(0x209)];if(_0x11c763[_0x54295d(0x202)]){const _0x1ae648=_0x11c763['content'];throw new Error('Server\x20returned\x20error:\x20'+(_0x1ae648?.[0x0]?.['text']??_0x5e78ed['xAcnr']));}const _0x5acb7f=_0x11c763['content'];if(_0x5acb7f)for(const _0x4b5183 of _0x5acb7f){if(_0x5e78ed['FVAPL'](_0x4b5183[_0x54295d(0x1d4)],_0x5e78ed['prQPU'])&&_0x4b5183[_0x54295d(0x1f3)]){try{const _0x2dc7c=JSON['parse'](_0x4b5183['text']);if(typeof _0x2dc7c?.[_0x54295d(0x209)]===_0x5e78ed['Bjrsj'])return _0x2dc7c[_0x54295d(0x209)];}catch{}const _0x5b4e63=_0x4b5183[_0x54295d(0x1f3)]['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x5b4e63)return _0x5b4e63[0x1];}}return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x1a8f(){var _0x1b2448=['1216719lQqfQR','ZfxJp','ngfNm','1336132yGAZGa','BvuVC','1301525cOBtyO','exit','657906WCzdto','361789YirRfJ','507048RUFLhX','LotrR','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','612660TuvjWK'];_0x1a8f=function(){return _0x1b2448;};return _0x1a8f();}(function(_0x291bdb,_0x382971){var _0x5da438=_0x1931,_0x5ad8ca=_0x291bdb();while(!![]){try{var _0x54a06a=parseInt(_0x5da438(0x1f6))/0x1+-parseInt(_0x5da438(0x1f5))/0x2+parseInt(_0x5da438(0x1f7))/0x3+parseInt(_0x5da438(0x1f1))/0x4+-parseInt(_0x5da438(0x1f3))/0x5+parseInt(_0x5da438(0x1fa))/0x6+-parseInt(_0x5da438(0x1ee))/0x7;if(_0x54a06a===_0x382971)break;else _0x5ad8ca['push'](_0x5ad8ca['shift']());}catch(_0x325b9a){_0x5ad8ca['push'](_0x5ad8ca['shift']());}}}(_0x1a8f,0x31c61));function _0x1931(_0x2290e8,_0xf63878){_0x2290e8=_0x2290e8-0x1ee;var _0x1a8ffc=_0x1a8f();var _0x19316d=_0x1a8ffc[_0x2290e8];return _0x19316d;}export async function migrateProfile(_0x4e9937,_0x1a60b1){var _0x4313e5=_0x1931,_0x114b93={'XINxq':function(_0x53211e,_0x27c4e5){return _0x53211e+_0x27c4e5;},'ZfxJp':function(_0x37dee1,_0x349d2e){return _0x37dee1+_0x349d2e;},'BJUxg':'ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','BvuVC':_0x4313e5(0x1f9),'ngfNm':'\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a','LotrR':'Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a'};console['error'](_0x114b93['XINxq'](_0x114b93['XINxq'](_0x114b93['XINxq'](_0x114b93['XINxq'](_0x114b93[_0x4313e5(0x1ef)](_0x114b93['BJUxg'],'\x0a')+'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a'+'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','\x0a')+_0x114b93[_0x4313e5(0x1f2)],_0x114b93[_0x4313e5(0x1f0)])+'\x0a',_0x114b93[_0x4313e5(0x1f8)]),'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.')),process[_0x4313e5(0x1f4)](0x1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2fb846,_0x33cf90){const _0x2af5bf=_0x4955,_0x8a3a11=_0x2fb846();while(!![]){try{const _0x3705b3=parseInt(_0x2af5bf(0x1ac))/0x1+parseInt(_0x2af5bf(0x1a3))/0x2+parseInt(_0x2af5bf(0x1a6))/0x3+-parseInt(_0x2af5bf(0x1c3))/0x4+-parseInt(_0x2af5bf(0x1c6))/0x5+-parseInt(_0x2af5bf(0x199))/0x6*(parseInt(_0x2af5bf(0x19b))/0x7)+parseInt(_0x2af5bf(0x1b5))/0x8;if(_0x3705b3===_0x33cf90)break;else _0x8a3a11['push'](_0x8a3a11['shift']());}catch(_0x1390e8){_0x8a3a11['push'](_0x8a3a11['shift']());}}}(_0x4a4f,0x49614));import{join}from'path';import{existsSync}from'fs';import _0x40d215 from'inquirer';function _0x4a4f(){const _0xb9b034=['log','enable','YYjzt','418168thedsO','add','already\x20enabled','2678675NoVQvv','install','prompt','ranger@trailhead','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','kMnni','12vwjQXa','⚠\x20Failed\x20to\x20enable\x20plugin:','1478617jMybMA','project','✓\x20Ranger\x20skills\x20already\x20installed','fyMAr','\x0aYou\x20can\x20install\x20manually\x20with:','makxz','JIzlw','wantsSkillup','877974TtQEjS','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','user','1516527cLZXeA','success','TGEEj','error','SKILL.md','VqJMN','98152qIFNCe','✓\x20Marketplace\x20already\x20added','SSloh','DVJXj','DdIlQ','gLqVb','OGlqz','plugin','dLLwY','2565240joHnaa','ranger-testing/trailhead','Would\x20you\x20like\x20to\x20install\x20skills?','❌\x20Failed\x20to\x20install\x20plugin:','✓\x20Claude\x20Code\x20plugin\x20enabled','zYXJD','✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','bEBKm','AHYIo','--scope','MPvdb'];_0x4a4f=function(){return _0xb9b034;};return _0x4a4f();}import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';function _0x4955(_0x127c98,_0x5d1b15){_0x127c98=_0x127c98-0x197;const _0x4a4fb2=_0x4a4f();let _0x4955aa=_0x4a4fb2[_0x127c98];return _0x4955aa;}import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x450b75){const _0x2302c4=_0x4955,_0x3cbcff={'DdIlQ':_0x2302c4(0x1a4),'DVJXj':function(_0x2602d2,_0x22a050){return _0x2602d2(_0x22a050);},'dLLwY':function(_0x3f3361,_0x322cb7,_0x1a8ba2){return _0x3f3361(_0x322cb7,_0x1a8ba2);},'sIxHp':function(_0x595fad){return _0x595fad();},'kMnni':'.claude','TGEEj':'pluginScope','lJHfm':'Where\x20should\x20the\x20plugin\x20be\x20installed?','fpBLz':'user','fyMAr':_0x2302c4(0x1ad),'makxz':_0x2302c4(0x1c4),'MPvdb':_0x2302c4(0x1b6),'IELEq':'❌\x20Failed\x20to\x20add\x20marketplace:','gLqVb':_0x2302c4(0x19f),'MZaVk':_0x2302c4(0x197),'gsGEn':_0x2302c4(0x1c7),'YYjzt':_0x2302c4(0x1c9),'zYXJD':'--scope','JIzlw':function(_0x53a0c9,_0x274d98){return _0x53a0c9===_0x274d98;},'ePmaP':_0x2302c4(0x19c),'SOYoQ':function(_0x32b74d){return _0x32b74d();},'cNavb':_0x2302c4(0x1b8),'qSIuj':_0x2302c4(0x1b3),'VqJMN':function(_0x5bfa24,_0x4b69e7,_0x4092d3){return _0x5bfa24(_0x4b69e7,_0x4092d3);},'nCDxB':_0x2302c4(0x1c5),'NgONL':_0x2302c4(0x19a),'bEBKm':_0x2302c4(0x1b9)},_0x3d2fd7=await isPluginInstalled(_0x2302c4(0x1c9));if(_0x3d2fd7)return console[_0x2302c4(0x1c0)](_0x3cbcff[_0x2302c4(0x1b0)]),![];const _0x2d57ac=_0x3cbcff[_0x2302c4(0x1af)](existsSync,_0x3cbcff[_0x2302c4(0x1b4)](join,_0x3cbcff['sIxHp'](getProjectRoot),_0x3cbcff[_0x2302c4(0x198)]));let _0x2f16ba;if(_0x450b75)_0x2f16ba=_0x450b75;else{if(_0x2d57ac)_0x2f16ba='project';else{console[_0x2302c4(0x1c0)]('\x0a📦\x20Claude\x20Code\x20Plugin\x0a');const _0x36efc8=await _0x40d215[_0x2302c4(0x1c8)]([{'type':'list','name':_0x3cbcff[_0x2302c4(0x1a8)],'message':_0x3cbcff['lJHfm'],'choices':[{'name':'User\x20(available\x20in\x20all\x20your\x20projects)','value':'user'},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':'project'}],'default':_0x3cbcff['fpBLz']}]);_0x2f16ba=_0x36efc8['pluginScope'];}}console[_0x2302c4(0x1c0)]('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x2f16ba+'\x20level)...\x0a');const _0x3c7d6a=await isMarketplaceAdded('trailhead');let _0x968b39=_0x3c7d6a;if(_0x3c7d6a)console[_0x2302c4(0x1c0)](_0x3cbcff[_0x2302c4(0x19e)]);else{const _0x139905=await runClaudeCommand([_0x2302c4(0x1b3),'marketplace',_0x3cbcff[_0x2302c4(0x1a0)],_0x3cbcff[_0x2302c4(0x1bf)]]);!_0x139905['success']?(console['error'](_0x3cbcff['IELEq'],_0x139905[_0x2302c4(0x1a9)]),console['log'](_0x3cbcff[_0x2302c4(0x1b1)]),console['log'](_0x3cbcff['MZaVk']),console['log']('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x2f16ba)):_0x968b39=!![];}if(_0x968b39){const _0x2cd4bd=await _0x3cbcff[_0x2302c4(0x1b4)](runClaudeCommand,['plugin',_0x3cbcff['gsGEn'],_0x3cbcff[_0x2302c4(0x1c2)],_0x3cbcff[_0x2302c4(0x1ba)],_0x2f16ba],{'cwd':_0x3cbcff['JIzlw'](_0x2f16ba,_0x3cbcff['ePmaP'])?_0x3cbcff['SOYoQ'](getProjectRoot):undefined});if(!_0x2cd4bd['success'])console[_0x2302c4(0x1a9)](_0x3cbcff['cNavb'],_0x2cd4bd['error']),console['log'](_0x3cbcff[_0x2302c4(0x1b1)]),console['log']('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x2f16ba);else{console[_0x2302c4(0x1c0)](_0x2302c4(0x1bb));const _0x1fc756=[_0x3cbcff['qSIuj'],_0x2302c4(0x1c1),'ranger@trailhead'];_0x2f16ba===_0x2302c4(0x19c)&&_0x1fc756['push'](_0x2302c4(0x1be),_0x3cbcff['ePmaP']);const _0x138873=await _0x3cbcff[_0x2302c4(0x1ab)](runClaudeCommand,_0x1fc756,{'captureOutput':!![],'cwd':_0x3cbcff[_0x2302c4(0x1a1)](_0x2f16ba,'project')?getProjectRoot():undefined}),_0x43b7ae=_0x138873['output']?.['includes'](_0x3cbcff['nCDxB']);!_0x138873[_0x2302c4(0x1a7)]&&!_0x43b7ae?console['error'](_0x3cbcff['NgONL'],_0x138873[_0x2302c4(0x1a9)]):console['log'](_0x3cbcff[_0x2302c4(0x1bc)]);}}return!![];}export async function ensureClaudeSkills(_0x4b3580){const _0x519592=_0x4955,_0x59daff={'SSloh':_0x519592(0x1a5),'qDFbw':_0x519592(0x1aa),'AHYIo':function(_0x1d16e6,_0x262ea6,_0x1bc42f,_0x1ca7ce){return _0x1d16e6(_0x262ea6,_0x1bc42f,_0x1ca7ce);},'OGlqz':function(_0x4edcb6,_0x590481){return _0x4edcb6(_0x590481);},'OzUvi':_0x519592(0x19c),'ZriFg':'ranger','BdOHh':function(_0x169815,_0x1e09f4){return _0x169815||_0x1e09f4;},'jRIBY':function(_0x3b1b43,_0x5164f6){return _0x3b1b43(_0x5164f6);}},_0x206c10=existsSync(join(getSkillsDir(_0x59daff[_0x519592(0x1ae)]),'ranger',_0x59daff['qDFbw'])),_0x286a8f=existsSync(_0x59daff[_0x519592(0x1bd)](join,_0x59daff[_0x519592(0x1b2)](getSkillsDir,_0x59daff['OzUvi']),_0x59daff['ZriFg'],_0x519592(0x1aa)));if(_0x59daff['BdOHh'](_0x206c10,_0x286a8f))return console[_0x519592(0x1c0)](_0x519592(0x19d)),![];const _0x36db76=existsSync(join(getProjectRoot(),'.claude'));let _0x2e50a4=!![];if(_0x4b3580)await skillup({'autoInstall':_0x4b3580,'suppressUsage':!![]});else{if(_0x36db76)await skillup({'autoInstall':_0x59daff['OzUvi'],'suppressUsage':!![]});else{const _0x3eecdd=await _0x40d215[_0x519592(0x1c8)]([{'type':'confirm','name':'wantsSkillup','message':_0x519592(0x1b7),'default':!![]}]);_0x2e50a4=_0x3eecdd[_0x519592(0x1a2)],_0x2e50a4&&await _0x59daff['jRIBY'](skillup,{'suppressUsage':!![]});}}return _0x2e50a4;}
|