@ranger-testing/ranger-cli 2.5.4-alpha.5f9facb-17 → 2.5.4-alpha.816b7e2-24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/deleteProfile.js +1 -0
- 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 +1 -1
- package/package.json +1 -1
package/build/commands/hook.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2c295d,_0x83cd8b){const _0x798ed9=_0x3179,_0x30b24e=_0x2c295d();while(!![]){try{const _0x20ed23=parseInt(_0x798ed9(0x12d))/0x1*(parseInt(_0x798ed9(0x12c))/0x2)+-parseInt(_0x798ed9(0x138))/0x3*(-parseInt(_0x798ed9(0x12e))/0x4)+-parseInt(_0x798ed9(0x129))/0x5+parseInt(_0x798ed9(0x133))/0x6*(-parseInt(_0x798ed9(0x128))/0x7)+parseInt(_0x798ed9(0x12b))/0x8+-parseInt(_0x798ed9(0x132))/0x9+-parseInt(_0x798ed9(0x137))/0xa*(-parseInt(_0x798ed9(0x12f))/0xb);if(_0x20ed23===_0x83cd8b)break;else _0x30b24e['push'](_0x30b24e['shift']());}catch(_0x5be774){_0x30b24e['push'](_0x30b24e['shift']());}}}(_0x4e7b,0x70b65));function _0x3179(_0x1bfed7,_0x293fce){_0x1bfed7=_0x1bfed7-0x128;const _0x4e7b20=_0x4e7b();let _0x317929=_0x4e7b20[_0x1bfed7];return _0x317929;}import{sessionStart,sessionEnd,preCompact,postEdit,planStart,planReminder,exitPlanMode,stopHook,enable,disable,autoPrompt}from'./hooks/index.js';const HOOKS={'session-start':sessionStart,'session-end':sessionEnd,'pre-compact':preCompact,'post-edit':postEdit,'plan-start':planStart,'plan-reminder':planReminder,'exit-plan-mode':exitPlanMode,'stop':stopHook,'enable':enable,'disable':disable,'auto-prompt':autoPrompt};let cancellationHandlersInstalled=![];function installCancellationHandlers(){const _0x52eb96=_0x3179,_0x5eab7d={'nCCKM':'SIGTERM','rcrar':_0x52eb96(0x130)};if(cancellationHandlersInstalled)return;const _0x38e311=()=>{process['exit'](0x0);};process[_0x52eb96(0x135)]('SIGINT',_0x38e311),process['once'](_0x5eab7d[_0x52eb96(0x131)],_0x38e311),process[_0x52eb96(0x135)](_0x5eab7d['rcrar'],_0x38e311),cancellationHandlersInstalled=!![];}function _0x4e7b(){const _0x4df551=['exit','once','Unknown\x20hook:\x20','540igFNli','1317YaPrXU','2532243bVKDFw','4479555lAVMGS','error','6006000vbFMkD','899918SxPaME','1IObfwI','5564YnKoXH','98703wNQHUA','SIGHUP','nCCKM','5189139WJgMXA','6LlnJqv'];_0x4e7b=function(){return _0x4df551;};return _0x4e7b();}export async function hook(_0x21d18a,_0x4c65c1){const _0x166356=_0x3179;installCancellationHandlers();const _0xcaadd1=HOOKS[_0x21d18a];if(!_0xcaadd1){const _0x2666d8=Object['keys'](HOOKS)['join'](',\x20');console[_0x166356(0x12a)](_0x166356(0x136)+_0x21d18a),console[_0x166356(0x12a)]('Valid\x20hooks:\x20'+_0x2666d8),process[_0x166356(0x134)](0x1);}await _0xcaadd1(_0x4c65c1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4043f7,_0x22b1fb){const _0x19fdf4=_0x5081,_0x26df33=_0x4043f7();while(!![]){try{const _0xaa2334=parseInt(_0x19fdf4(0x13c))/0x1*(-parseInt(_0x19fdf4(0x13b))/0x2)+-parseInt(_0x19fdf4(0x140))/0x3+-parseInt(_0x19fdf4(0x145))/0x4+parseInt(_0x19fdf4(0x13a))/0x5*(parseInt(_0x19fdf4(0x144))/0x6)+-parseInt(_0x19fdf4(0x13f))/0x7+-parseInt(_0x19fdf4(0x13e))/0x8+parseInt(_0x19fdf4(0x13d))/0x9*(parseInt(_0x19fdf4(0x141))/0xa);if(_0xaa2334===_0x22b1fb)break;else _0x26df33['push'](_0x26df33['shift']());}catch(_0x3efdbe){_0x26df33['push'](_0x26df33['shift']());}}}(_0x2e9d,0x788c4));import{readHookInput}from'./output.js';import{isSessionEnabled,hasSessionBeenPrompted,markSessionPrompted}from'../utils/sessionCache.js';function _0x5081(_0x1bd09a,_0x48421c){_0x1bd09a=_0x1bd09a-0x13a;const _0x2e9d94=_0x2e9d();let _0x5081ab=_0x2e9d94[_0x1bd09a];return _0x5081ab;}function _0x2e9d(){const _0x1ea674=['4506512TjMjqn','771463QPCZLE','313035LxZabw','2860vPRPMG','session_id','log','1959024pmcHIO','1102512dOrReo','10RlfbVO','74500MGPJRV','1SSrHTu','29313SweFzK'];_0x2e9d=function(){return _0x1ea674;};return _0x2e9d();}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 _0x5ad784=_0x5081,_0x2a6ca0=await readHookInput(),_0x4e6f18=_0x2a6ca0?.[_0x5ad784(0x142)];if(!_0x4e6f18)return;if(isSessionEnabled(_0x4e6f18)||hasSessionBeenPrompted(_0x4e6f18))return;markSessionPrompted(_0x4e6f18),console[_0x5ad784(0x143)](AUTO_PROMPT_TEXT);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x537b82,_0x14c8db){const _0x409028=_0x47da,_0x1cdc6e=_0x537b82();while(!![]){try{const _0x1e116d=-parseInt(_0x409028(0x107))/0x1*(-parseInt(_0x409028(0x10b))/0x2)+parseInt(_0x409028(0x10a))/0x3+parseInt(_0x409028(0x10f))/0x4+parseInt(_0x409028(0x114))/0x5*(parseInt(_0x409028(0x10d))/0x6)+parseInt(_0x409028(0x116))/0x7+parseInt(_0x409028(0x10c))/0x8*(parseInt(_0x409028(0x109))/0x9)+parseInt(_0x409028(0x10e))/0xa*(-parseInt(_0x409028(0x113))/0xb);if(_0x1e116d===_0x14c8db)break;else _0x1cdc6e['push'](_0x1cdc6e['shift']());}catch(_0x3c6f51){_0x1cdc6e['push'](_0x1cdc6e['shift']());}}}(_0x1576,0xb523a));function _0x47da(_0xe15fc4,_0x4ce267){_0xe15fc4=_0xe15fc4-0x105;const _0x1576a7=_0x1576();let _0x47dab7=_0x1576a7[_0xe15fc4];return _0x47dab7;}function _0x1576(){const _0x52937c=['123438yKtReM','20cGmEJB','4159044zueOyL','jxlmA','#\x20RANGER\x20DISABLED\x0a\x0aThe\x20user\x20has\x20expressly\x20disabled\x20Ranger\x20hooks\x20for\x20this\x20session','gYmWK','17913379dyZwou','210hJFZdn','master','8016729yeEjSc','kLfCD','VPhTO','main','DtFDA','169264PITBXa','VmZYJ','468oHZXjA','742434ZmkRZy','4hXXlnl','55976EIvoHH'];_0x1576=function(){return _0x52937c;};return _0x1576();}import{disableSession,disableBranch,getCurrentBranch}from'../utils/sessionCache.js';import{printBlock}from'./output.js';export async function disable(_0x3e9907){const _0x106831=_0x47da,_0x28d4f6={'VmZYJ':function(_0x1516ec,_0x8a47b2){return _0x1516ec(_0x8a47b2);},'DtFDA':function(_0x2b45ee){return _0x2b45ee();},'gYmWK':function(_0x3ed28a,_0x15d220){return _0x3ed28a!==_0x15d220;},'mmllH':_0x106831(0x115),'VPhTO':function(_0x5b2161,_0x3afc03){return _0x5b2161!==_0x3afc03;},'jxlmA':_0x106831(0x105),'kLfCD':function(_0x23675a,_0x223636){return _0x23675a!==_0x223636;}},_0x5236b0=_0x3e9907||process['env']['CLAUDE_SESSION_ID']||'';_0x5236b0&&_0x28d4f6[_0x106831(0x108)](disableSession,_0x5236b0);const _0x4fc06a=_0x28d4f6[_0x106831(0x106)](getCurrentBranch);_0x4fc06a&&_0x28d4f6[_0x106831(0x112)](_0x4fc06a,'main')&&_0x28d4f6['gYmWK'](_0x4fc06a,_0x28d4f6['mmllH'])&&_0x28d4f6['VmZYJ'](disableBranch,_0x4fc06a),printBlock(_0x106831(0x111)+(_0x4fc06a&&_0x28d4f6[_0x106831(0x118)](_0x4fc06a,_0x28d4f6[_0x106831(0x110)])&&_0x28d4f6[_0x106831(0x117)](_0x4fc06a,_0x28d4f6['mmllH'])?'\x20and\x20branch\x20\x27'+_0x4fc06a+'\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(_0x51f901,_0x1d1aec){const _0x481ff8=_0x447e,_0x4515f7=_0x51f901();while(!![]){try{const _0x58f7b1=parseInt(_0x481ff8(0x178))/0x1+parseInt(_0x481ff8(0x17c))/0x2+parseInt(_0x481ff8(0x16c))/0x3+-parseInt(_0x481ff8(0x16a))/0x4*(-parseInt(_0x481ff8(0x179))/0x5)+-parseInt(_0x481ff8(0x16e))/0x6*(parseInt(_0x481ff8(0x17e))/0x7)+parseInt(_0x481ff8(0x175))/0x8*(parseInt(_0x481ff8(0x16b))/0x9)+parseInt(_0x481ff8(0x170))/0xa*(-parseInt(_0x481ff8(0x16f))/0xb);if(_0x58f7b1===_0x1d1aec)break;else _0x4515f7['push'](_0x4515f7['shift']());}catch(_0x5a8b2b){_0x4515f7['push'](_0x4515f7['shift']());}}}(_0x3e44,0xaf6a0));import{enableSession,getCurrentBranch}from'../utils/sessionCache.js';function _0x3e44(){const _0x29d0ed=['8kZlpEM','\x0a\x0a**Branch\x20\x27','ranger\x20setup','351831TjXsBW','130AQMLBN','#\x20RANGER\x20ENABLED','CAOjB','2079138YwdndU','\x27\x20is\x20now\x20enabled**\x20-\x20Ranger\x20will\x20stay\x20active\x20on\x20this\x20branch\x20across\x20sessions.','560588cRLwuf','master','Restart\x20your\x20Claude\x20Code\x20session\x20after\x20setup.','31876pghfTA','7989417bZpnbW','3186066LOyTNY','QoiNO','12ZHovnh','96283ZCGHBR','3050pVHAaP','MVnnS','\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`.','CuxeY','Restart\x20your\x20OpenCode\x20session\x20after\x20setup.'];_0x3e44=function(){return _0x29d0ed;};return _0x3e44();}import{getToken}from'../utils/keychain.js';import{getRangerSkillContent}from'../utils/skillContent.js';function _0x447e(_0x539a60,_0x4d090f){_0x539a60=_0x539a60-0x169;const _0x3e4417=_0x3e44();let _0x447e63=_0x3e4417[_0x539a60];return _0x447e63;}import{printBlock}from'./output.js';import{update}from'../update.js';export async function enable(_0x4c3777){const _0x38261c=_0x447e,_0x1efc3b={'cmmyT':function(_0x30d9a2){return _0x30d9a2();},'MVnnS':'ranger\x20setup\x20--opencode','QoiNO':_0x38261c(0x177),'eXwRW':_0x38261c(0x169),'YJfsU':function(_0x4cf8cc){return _0x4cf8cc();},'rXlIb':function(_0x30c40a){return _0x30c40a();},'ecbvX':function(_0x36b8c6,_0x33833e){return _0x36b8c6!==_0x33833e;},'BGoQz':'main','CuxeY':_0x38261c(0x17f),'djBMy':function(_0x2b2f7c){return _0x2b2f7c();},'CAOjB':function(_0x13f654,_0x97fb8d){return _0x13f654(_0x97fb8d);}},_0x55bdb8=_0x4c3777||process['env']['CLAUDE_SESSION_ID']||'',_0x261ac2=Boolean(_0x4c3777),_0x41ab8c=await _0x1efc3b['cmmyT'](getToken);if(!_0x41ab8c){const _0x1797f2=_0x261ac2?_0x1efc3b[_0x38261c(0x171)]:_0x1efc3b[_0x38261c(0x16d)],_0x5a5214=_0x261ac2?_0x38261c(0x174):_0x1efc3b['eXwRW'];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`'+_0x1797f2+'`\x0a\x0aA\x20browser\x20will\x20open\x20for\x20authentication.\x20A\x20human\x20needs\x20to\x20complete\x20the\x20login.\x0a'+_0x5a5214);return;}try{await _0x1efc3b['YJfsU'](update);}catch{}_0x55bdb8&&enableSession(_0x55bdb8);const _0x2252c8=_0x1efc3b['rXlIb'](getCurrentBranch),_0x37db80=_0x2252c8&&_0x1efc3b['ecbvX'](_0x2252c8,_0x1efc3b['BGoQz'])&&_0x2252c8!==_0x1efc3b[_0x38261c(0x173)]?_0x38261c(0x176)+_0x2252c8+_0x38261c(0x17d):'',_0x415ed4=_0x1efc3b['djBMy'](getRangerSkillContent);_0x1efc3b[_0x38261c(0x17b)](printBlock,_0x38261c(0x17a)+_0x37db80+'\x0a\x0a**For\x20ANY\x20UI\x20work,\x20you\x20MUST\x20use\x20the\x20/ranger\x20skill.**\x0a\x0a'+_0x415ed4+_0x38261c(0x172));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
(function(_0x15e24b,_0x44a9d3){const _0x2e1ad7=_0x1f8a,_0x365d94=_0x15e24b();while(!![]){try{const _0x1538ea=parseInt(_0x2e1ad7(0x87))/0x1*(parseInt(_0x2e1ad7(0x84))/0x2)+-parseInt(_0x2e1ad7(0x89))/0x3+parseInt(_0x2e1ad7(0x85))/0x4+parseInt(_0x2e1ad7(0x86))/0x5*(parseInt(_0x2e1ad7(0x81))/0x6)+parseInt(_0x2e1ad7(0x88))/0x7*(-parseInt(_0x2e1ad7(0x82))/0x8)+-parseInt(_0x2e1ad7(0x83))/0x9+parseInt(_0x2e1ad7(0x80))/0xa;if(_0x1538ea===_0x44a9d3)break;else _0x365d94['push'](_0x365d94['shift']());}catch(_0x5c51b0){_0x365d94['push'](_0x365d94['shift']());}}}(_0x4029,0xa114e));function _0x1f8a(_0x5016ae,_0x270e1a){_0x5016ae=_0x5016ae-0x80;const _0x40294a=_0x4029();let _0x1f8acb=_0x40294a[_0x5016ae];return _0x1f8acb;}import{printBlock,getEnabledSessionId}from'./output.js';function _0x4029(){const _0x523c75=['8092HcOZJp','2851980jgIamI','11806340GFKpoE','6gIaPKH','2544ckAetI','2176533GJeHfg','8042vcDORZ','1235412oaUqoH','294505ZzsNfB','167PahlAM'];_0x4029=function(){return _0x523c75;};return _0x4029();}export async function exitPlanMode(_0x4ab77){const _0x239396={'CXhVW':function(_0x18074a,_0x91f5ba){return _0x18074a(_0x91f5ba);}},_0x27da41=await _0x239396['CXhVW'](getEnabledSessionId,_0x4ab77);if(!_0x27da41)return;_0x239396['CXhVW'](printBlock,'===\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===');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4d3da3,_0x51f339){var _0x2868f0=_0x4748,_0xf12a35=_0x4d3da3();while(!![]){try{var _0x4a778a=parseInt(_0x2868f0(0xa5))/0x1*(-parseInt(_0x2868f0(0xa3))/0x2)+-parseInt(_0x2868f0(0xa6))/0x3+parseInt(_0x2868f0(0xa0))/0x4+parseInt(_0x2868f0(0xa4))/0x5+parseInt(_0x2868f0(0x9f))/0x6*(parseInt(_0x2868f0(0xa2))/0x7)+parseInt(_0x2868f0(0x9e))/0x8+-parseInt(_0x2868f0(0xa1))/0x9;if(_0x4a778a===_0x51f339)break;else _0xf12a35['push'](_0xf12a35['shift']());}catch(_0x3416a0){_0xf12a35['push'](_0xf12a35['shift']());}}}(_0x1ae6,0x4f0f6));export{sessionStart}from'./sessionStart.js';export{sessionEnd}from'./sessionEnd.js';export{preCompact}from'./preCompact.js';export{postEdit}from'./postEdit.js';export{planStart}from'./planStart.js';export{planReminder}from'./planReminder.js';export{exitPlanMode}from'./exitPlanMode.js';export{stopHook}from'./stopHook.js';function _0x1ae6(){var _0xe3d1b6=['4900275zlGAOS','7qwACEE','4QgJmVA','1718975eEcHlG','318265NNbvTX','500769Zbcsvv','4128664dBuFwY','2399604NXQJyz','1647784jKqQrv'];_0x1ae6=function(){return _0xe3d1b6;};return _0x1ae6();}function _0x4748(_0x1426e0,_0xd041f6){_0x1426e0=_0x1426e0-0x9e;var _0x1ae6c4=_0x1ae6();var _0x4748ae=_0x1ae6c4[_0x1426e0];return _0x4748ae;}export{enable}from'./enable.js';export{disable}from'./disable.js';export{autoPrompt}from'./autoPrompt.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xbff642,_0x2d6209){const _0x25d5b3=_0x13ec,_0x15d07f=_0xbff642();while(!![]){try{const _0x5875f0=-parseInt(_0x25d5b3(0x107))/0x1+-parseInt(_0x25d5b3(0x104))/0x2+-parseInt(_0x25d5b3(0x105))/0x3+parseInt(_0x25d5b3(0x101))/0x4+parseInt(_0x25d5b3(0xfb))/0x5*(-parseInt(_0x25d5b3(0x100))/0x6)+-parseInt(_0x25d5b3(0x103))/0x7*(-parseInt(_0x25d5b3(0xfe))/0x8)+parseInt(_0x25d5b3(0x108))/0x9;if(_0x5875f0===_0x2d6209)break;else _0x15d07f['push'](_0x15d07f['shift']());}catch(_0x5f584c){_0x15d07f['push'](_0x15d07f['shift']());}}}(_0x4e61,0x9a9c5));function _0x13ec(_0x4dc878,_0x7b5f13){_0x4dc878=_0x4dc878-0xfb;const _0x4e6103=_0x4e61();let _0x13ec65=_0x4e6103[_0x4dc878];return _0x13ec65;}import{isSessionEnabled}from'../utils/sessionCache.js';export function printBlock(_0x55bf5d){console['log'](_0x55bf5d);}export async function readHookInput(){const _0xff0f8f=_0x13ec;let _0x17b8c5='';try{for await(const _0x239800 of process['stdin']){_0x17b8c5+=_0x239800;}}catch{return null;}if(!_0x17b8c5[_0xff0f8f(0x102)]())return null;try{return JSON[_0xff0f8f(0xfc)](_0x17b8c5);}catch{return null;}}export async function getEnabledSessionId(_0x234e3a){const _0x3788a1=_0x13ec;if(_0x234e3a)return isSessionEnabled(_0x234e3a)?_0x234e3a:null;const _0x3a11fc=await readHookInput(),_0x225a66=_0x3a11fc?.[_0x3788a1(0x106)];if(!_0x225a66||!isSessionEnabled(_0x225a66))return null;return _0x225a66;}export async function getEnabledHookContext(_0x13f9f2){const _0x436b80=_0x13ec,_0x13fef7={'NKucb':function(_0x43c1bc,_0x241b73){return _0x43c1bc(_0x241b73);},'iAJOD':function(_0x27b3bd){return _0x27b3bd();}};if(_0x13f9f2){if(!_0x13fef7[_0x436b80(0xff)](isSessionEnabled,_0x13f9f2))return null;return{'sessionId':_0x13f9f2,'input':{'session_id':_0x13f9f2}};}const _0x5f3be4=await _0x13fef7[_0x436b80(0xfd)](readHookInput),_0x19edc2=_0x5f3be4?.[_0x436b80(0x106)];if(!_0x19edc2||!isSessionEnabled(_0x19edc2))return null;return{'sessionId':_0x19edc2,'input':_0x5f3be4};}function _0x4e61(){const _0x2fdaf7=['iAJOD','11048tbTaSx','NKucb','394080QrPLlR','1194944OPKsMI','trim','3304JWQSKV','706626rPkJNP','1025859cUYlxN','session_id','287181DGqYRV','16035516midgzR','85qoBWjA','parse'];_0x4e61=function(){return _0x2fdaf7;};return _0x4e61();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4b1947,_0x12d0d1){const _0x327a24=_0x58fa,_0xdee00e=_0x4b1947();while(!![]){try{const _0x150e7f=parseInt(_0x327a24(0x6a))/0x1*(parseInt(_0x327a24(0x72))/0x2)+-parseInt(_0x327a24(0x68))/0x3+-parseInt(_0x327a24(0x69))/0x4*(-parseInt(_0x327a24(0x67))/0x5)+parseInt(_0x327a24(0x71))/0x6+parseInt(_0x327a24(0x65))/0x7*(-parseInt(_0x327a24(0x6b))/0x8)+parseInt(_0x327a24(0x66))/0x9*(parseInt(_0x327a24(0x70))/0xa)+parseInt(_0x327a24(0x6f))/0xb*(-parseInt(_0x327a24(0x6e))/0xc);if(_0x150e7f===_0x12d0d1)break;else _0xdee00e['push'](_0xdee00e['shift']());}catch(_0x343ba7){_0xdee00e['push'](_0xdee00e['shift']());}}}(_0x448f,0x6f333));import{printBlock,getEnabledHookContext}from'./output.js';function _0x448f(){const _0x43716f=['1939Szmiyk','333jFubXN','10pbdDnO','1538853DEinEt','192688ClFhuj','2AByWVA','10832ROefXp','ibTNO','input','12suOPyu','3642969foQwGt','91230IrEfJp','5136468WoKXgo','384690cVYqtu','===\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===','plan','sessionId'];_0x448f=function(){return _0x43716f;};return _0x448f();}function _0x58fa(_0x3e0df8,_0x4087ac){_0x3e0df8=_0x3e0df8-0x65;const _0x448fa4=_0x448f();let _0x58fae9=_0x448fa4[_0x3e0df8];return _0x58fae9;}import{shouldShowPlanReminder}from'../utils/sessionCache.js';export async function planReminder(_0x53f1e1){const _0x1fff17=_0x58fa,_0x2e391={'ibTNO':function(_0x3b80cf,_0x15e191){return _0x3b80cf(_0x15e191);}},_0x35fa51=await getEnabledHookContext(_0x53f1e1);if(!_0x35fa51)return;if(_0x35fa51[_0x1fff17(0x6d)]['permission_mode']!==_0x1fff17(0x74))return;if(!_0x2e391[_0x1fff17(0x6c)](shouldShowPlanReminder,_0x35fa51[_0x1fff17(0x75)]))return;printBlock(_0x1fff17(0x73));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x59d5(_0x2d0eda,_0x5ba083){_0x2d0eda=_0x2d0eda-0x95;const _0x25c5e8=_0x25c5();let _0x59d57b=_0x25c5e8[_0x2d0eda];return _0x59d57b;}(function(_0x1f3c76,_0x58302a){const _0x32a222=_0x59d5,_0xd9f1c7=_0x1f3c76();while(!![]){try{const _0x47193d=-parseInt(_0x32a222(0x9c))/0x1*(-parseInt(_0x32a222(0x9f))/0x2)+-parseInt(_0x32a222(0x9e))/0x3*(parseInt(_0x32a222(0x97))/0x4)+parseInt(_0x32a222(0xa0))/0x5*(-parseInt(_0x32a222(0x96))/0x6)+-parseInt(_0x32a222(0x9b))/0x7+-parseInt(_0x32a222(0x99))/0x8*(-parseInt(_0x32a222(0x95))/0x9)+-parseInt(_0x32a222(0x9a))/0xa+-parseInt(_0x32a222(0x9d))/0xb*(-parseInt(_0x32a222(0x98))/0xc);if(_0x47193d===_0x58302a)break;else _0xd9f1c7['push'](_0xd9f1c7['shift']());}catch(_0x438cbe){_0xd9f1c7['push'](_0xd9f1c7['shift']());}}}(_0x25c5,0xbed03));function _0x25c5(){const _0x104b20=['8KLyapu','90372CTuboP','4647208pPBZEW','14550500zRwEgG','759563Nrjpav','79VXPRmK','2981gQmofx','188538PmlseJ','30358CJssvk','5tXIvtx','9NJyeSl','8100726bZZcyh'];_0x25c5=function(){return _0x104b20;};return _0x25c5();}import{printBlock,getEnabledSessionId}from'./output.js';export async function planStart(_0x5d0fd2){const _0x13dc05={'jtdlJ':function(_0x5f08e2,_0x37dc0c){return _0x5f08e2(_0x37dc0c);}},_0x14c5e1=await _0x13dc05['jtdlJ'](getEnabledSessionId,_0x5d0fd2);if(!_0x14c5e1)return;printBlock('===\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===');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x482e4f,_0x40e003){const _0x590a63=_0x1452,_0x1a2e4e=_0x482e4f();while(!![]){try{const _0x5f0f06=parseInt(_0x590a63(0x1f2))/0x1+-parseInt(_0x590a63(0x1eb))/0x2+-parseInt(_0x590a63(0x1f6))/0x3*(parseInt(_0x590a63(0x1f7))/0x4)+-parseInt(_0x590a63(0x1ed))/0x5+-parseInt(_0x590a63(0x1ec))/0x6*(parseInt(_0x590a63(0x1f1))/0x7)+parseInt(_0x590a63(0x1ef))/0x8+parseInt(_0x590a63(0x1ee))/0x9*(parseInt(_0x590a63(0x1f3))/0xa);if(_0x5f0f06===_0x40e003)break;else _0x1a2e4e['push'](_0x1a2e4e['shift']());}catch(_0x44278b){_0x1a2e4e['push'](_0x1a2e4e['shift']());}}}(_0x5028,0x942ee));import{getSessionEntry,updateBranchTracking}from'../utils/sessionCache.js';import{getToken}from'../utils/keychain.js';function _0x1452(_0x4c4504,_0x18f2b3){_0x4c4504=_0x4c4504-0x1ea;const _0x5028a9=_0x5028();let _0x145207=_0x5028a9[_0x4c4504];return _0x145207;}import{getEnabledSessionId}from'./output.js';function _0x5028(){const _0x18b980=['3571460LPRFMU','5816223GdfWUh','8865560Absksi','log','161fiVrRs','1014991GaZgvu','20bTMhVt','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).','VidUu','47982Bnedhl','228zNFxdY','stringify','2336012enmvPp','3852FcDbEz'];_0x5028=function(){return _0x18b980;};return _0x5028();}export async function postEdit(_0x32e681){const _0x58ea4e=_0x1452,_0x24d942={'kWesd':function(_0x163792,_0x9fb03e){return _0x163792(_0x9fb03e);},'VidUu':function(_0x54224b,_0x957fa3){return _0x54224b(_0x957fa3);},'vdCNQ':function(_0x10ca06,_0x2db14f){return _0x10ca06(_0x2db14f);},'FYUSz':'PostToolUse'},_0x238bcd=await _0x24d942['kWesd'](getEnabledSessionId,_0x32e681);if(!_0x238bcd)return;_0x24d942[_0x58ea4e(0x1f5)](updateBranchTracking,_0x238bcd);const _0x345d80=await getToken();if(!_0x345d80)return;const _0x204744=_0x24d942['vdCNQ'](getSessionEntry,_0x238bcd);if(_0x204744){const _0x5117d1={'hookSpecificOutput':{'hookEventName':_0x24d942['FYUSz'],'additionalContext':_0x58ea4e(0x1f4)}};console['log'](JSON['stringify'](_0x5117d1));return;}const _0x160b4b={'hookSpecificOutput':{'hookEventName':'PostToolUse','additionalContext':'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.'}};console[_0x58ea4e(0x1f0)](JSON[_0x58ea4e(0x1ea)](_0x160b4b));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2c6425,_0x342d1c){const _0x26d744=_0x112c,_0x298ed5=_0x2c6425();while(!![]){try{const _0x288534=parseInt(_0x26d744(0x119))/0x1+parseInt(_0x26d744(0x115))/0x2*(-parseInt(_0x26d744(0x118))/0x3)+-parseInt(_0x26d744(0x114))/0x4+parseInt(_0x26d744(0x11c))/0x5+-parseInt(_0x26d744(0x117))/0x6+-parseInt(_0x26d744(0x116))/0x7*(parseInt(_0x26d744(0x11a))/0x8)+parseInt(_0x26d744(0x11b))/0x9;if(_0x288534===_0x342d1c)break;else _0x298ed5['push'](_0x298ed5['shift']());}catch(_0x3f8c3f){_0x298ed5['push'](_0x298ed5['shift']());}}}(_0x367b,0x58d72));import{getToken}from'../utils/keychain.js';function _0x367b(){const _0x3e6e0d=['520060RyyXeZ','16AQGcqd','12544722LFPgit','2424405eWzxJv','2299456jLrwja','58336USdrmD','1863575CtChaD','4340514EFSJFj','21ScTNvW'];_0x367b=function(){return _0x3e6e0d;};return _0x367b();}function _0x112c(_0x16c29c,_0x304e9f){_0x16c29c=_0x16c29c-0x114;const _0x367bfe=_0x367b();let _0x112c78=_0x367bfe[_0x16c29c];return _0x112c78;}import{printBlock,getEnabledSessionId}from'./output.js';export async function preCompact(_0x40a3c5){const _0x5ecbf0={'jYRRr':function(_0x1cd24c,_0x454458){return _0x1cd24c(_0x454458);},'Betdj':function(_0x580e3a,_0x36efdb){return _0x580e3a(_0x36efdb);}},_0x41a785=await _0x5ecbf0['jYRRr'](getEnabledSessionId,_0x40a3c5);if(!_0x41a785)return;try{const _0x23d232=await getToken();if(!_0x23d232)return;_0x5ecbf0['Betdj'](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 _0x5982(){const _0x208c06=['703233piQJuV','1346612NsEYGh','1234302NUlxSk','813838QNzGES','1994232uhgtQG','110499qDTyeA','60XSlCTr','6mFYNTj','2002210GnlYnq','session_id','35cNPMhl'];_0x5982=function(){return _0x208c06;};return _0x5982();}(function(_0x3e0572,_0x3eb8d3){const _0xee72f9=_0x487f,_0x3ff558=_0x3e0572();while(!![]){try{const _0x33ed12=parseInt(_0xee72f9(0x167))/0x1+parseInt(_0xee72f9(0x165))/0x2+-parseInt(_0xee72f9(0x169))/0x3*(-parseInt(_0xee72f9(0x163))/0x4)+parseInt(_0xee72f9(0x16a))/0x5+parseInt(_0xee72f9(0x164))/0x6*(-parseInt(_0xee72f9(0x161))/0x7)+-parseInt(_0xee72f9(0x166))/0x8+-parseInt(_0xee72f9(0x162))/0x9*(-parseInt(_0xee72f9(0x168))/0xa);if(_0x33ed12===_0x3eb8d3)break;else _0x3ff558['push'](_0x3ff558['shift']());}catch(_0x53ab98){_0x3ff558['push'](_0x3ff558['shift']());}}}(_0x5982,0xbef2c));import{isSessionEnabled,recordEnabledSessionCleared}from'../utils/sessionCache.js';import{readHookInput}from'./output.js';function _0x487f(_0x3501bc,_0x301880){_0x3501bc=_0x3501bc-0x161;const _0x598254=_0x5982();let _0x487fa0=_0x598254[_0x3501bc];return _0x487fa0;}export async function sessionEnd(_0x3b9c52){const _0x5f5b5d=_0x487f,_0x3a59b1={'CxuxF':function(_0x862311,_0x150f67){return _0x862311===_0x150f67;},'btCsx':function(_0x51da62,_0x1d9932){return _0x51da62(_0x1d9932);}},_0x4c7102=process['env']['CLAUDE_SESSION_ID'];let _0x482cc7=_0x3b9c52,_0x5f175d;if(!_0x3b9c52){if(_0x4c7102&&!isSessionEnabled(_0x4c7102))return;const _0x4becb2=await readHookInput();_0x482cc7=_0x4becb2?.[_0x5f5b5d(0x16b)]||_0x4c7102,_0x5f175d=_0x4becb2?.['reason'];}if(!_0x482cc7)return;_0x3a59b1['CxuxF'](_0x5f175d,'clear')&&_0x3a59b1['btCsx'](recordEnabledSessionCleared,_0x482cc7);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2aa4d8,_0x7cceb2){const _0x3a14a2=_0x214c,_0x1c0d89=_0x2aa4d8();while(!![]){try{const _0x135e2c=-parseInt(_0x3a14a2(0x14a))/0x1+-parseInt(_0x3a14a2(0x156))/0x2+parseInt(_0x3a14a2(0x149))/0x3+parseInt(_0x3a14a2(0x148))/0x4+-parseInt(_0x3a14a2(0x150))/0x5+parseInt(_0x3a14a2(0x14b))/0x6*(-parseInt(_0x3a14a2(0x14d))/0x7)+parseInt(_0x3a14a2(0x143))/0x8;if(_0x135e2c===_0x7cceb2)break;else _0x1c0d89['push'](_0x1c0d89['shift']());}catch(_0x39bf11){_0x1c0d89['push'](_0x1c0d89['shift']());}}}(_0x1ab8,0xee8fe));function _0x214c(_0x574d82,_0x2499ee){_0x574d82=_0x574d82-0x142;const _0x1ab851=_0x1ab8();let _0x214cdc=_0x1ab851[_0x574d82];return _0x214cdc;}import{appendFile}from'fs/promises';import{initBranchTracking,shouldAutoEnableAfterClear,autoEnableAfterClear,isSessionEnabled,getCurrentBranch}from'../utils/sessionCache.js';import{createTelemetryCollector}from'../utils/telemetry.js';import{getToken}from'../utils/keychain.js';const RANGER_AUTO_ENABLED_PROMPT='=================================================================\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(_0x3ada87){const _0x56c19b=_0x214c,_0x5dc510={'mPNqb':function(_0x43b487,_0x5d425d){return _0x43b487||_0x5d425d;},'JDDRH':_0x56c19b(0x145),'orBYx':function(_0x56e723,_0x105277){return _0x56e723&&_0x105277;},'khTjf':function(_0x4a397b,_0x52a330,_0x15be04){return _0x4a397b(_0x52a330,_0x15be04);},'DLpkv':function(_0x5e3e2f,_0x351a1a){return _0x5e3e2f(_0x351a1a);},'OhRDy':function(_0x217f0e,_0x577738){return _0x217f0e(_0x577738);},'GWdYI':_0x56c19b(0x14c),'dMPiq':'success','ICigm':function(_0x444d77){return _0x444d77();},'QdvpL':function(_0x12fac8,_0xc092c4){return _0x12fac8!==_0xc092c4;},'MkoQA':_0x56c19b(0x151),'IVwdR':function(_0xaff1b8,_0x25fbc2){return _0xaff1b8+_0x25fbc2;}};let _0x16fd55=_0x5dc510[_0x56c19b(0x146)](_0x3ada87,''),_0x3717e1;if(!_0x3ada87){let _0x575cdf='';for await(const _0x389864 of process['stdin']){_0x575cdf+=_0x389864;}try{const _0x3135e8=JSON[_0x56c19b(0x152)](_0x575cdf);_0x16fd55=_0x3135e8[_0x5dc510['JDDRH']]||'',_0x3717e1=_0x3135e8['source'];}catch{}const _0x1b0431=process[_0x56c19b(0x154)]['CLAUDE_ENV_FILE'];if(_0x5dc510['orBYx'](_0x1b0431,_0x16fd55))try{await _0x5dc510['khTjf'](appendFile,_0x1b0431,_0x56c19b(0x142)+_0x16fd55+'\x22\x0a');}catch{}}try{await getToken();}catch{}if(_0x16fd55){shouldAutoEnableAfterClear(_0x3717e1)&&_0x5dc510['DLpkv'](autoEnableAfterClear,_0x16fd55);_0x5dc510['OhRDy'](initBranchTracking,_0x16fd55);const _0x204b76=isSessionEnabled(_0x16fd55);try{const _0x268819=_0x5dc510['DLpkv'](createTelemetryCollector,_0x5dc510['GWdYI']);await _0x268819[_0x56c19b(0x14f)]({'sessionId':_0x16fd55,'hooksEnabled':_0x204b76}),await _0x268819[_0x56c19b(0x14e)](_0x5dc510['dMPiq']);}catch{}if(_0x204b76){const _0x2efa4d=_0x5dc510['ICigm'](getCurrentBranch),_0x33c006=_0x2efa4d&&_0x5dc510[_0x56c19b(0x155)](_0x2efa4d,_0x5dc510[_0x56c19b(0x147)])&&_0x2efa4d!=='master'?_0x56c19b(0x153)+_0x2efa4d+')':'',_0x2d0821={'hookSpecificOutput':{'hookEventName':_0x56c19b(0x144),'additionalContext':_0x5dc510['IVwdR'](RANGER_AUTO_ENABLED_PROMPT,_0x33c006)}};console['log'](JSON['stringify'](_0x2d0821));}}}function _0x1ab8(){const _0x1e275c=['hook:session-start','1151318TDREUg','trackCommandEnd','trackCommandStart','7796215cTyFQB','main','parse','\x20(Branch:\x20','env','QdvpL','1948004kYkXaE','export\x20CLAUDE_SESSION_ID=\x22','36860480QgQLHM','SessionStart','session_id','mPNqb','MkoQA','2959828dacnrJ','683082impwiX','1900342gmwESF','6dbmPjz'];_0x1ab8=function(){return _0x1e275c;};return _0x1ab8();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3d3010,_0x5b86a0){const _0x5e5c87=_0x2db4,_0x3c8bc1=_0x3d3010();while(!![]){try{const _0x3b23b0=-parseInt(_0x5e5c87(0x142))/0x1+-parseInt(_0x5e5c87(0x148))/0x2*(parseInt(_0x5e5c87(0x146))/0x3)+-parseInt(_0x5e5c87(0x158))/0x4*(-parseInt(_0x5e5c87(0x154))/0x5)+-parseInt(_0x5e5c87(0x144))/0x6+parseInt(_0x5e5c87(0x155))/0x7+-parseInt(_0x5e5c87(0x14c))/0x8+parseInt(_0x5e5c87(0x147))/0x9;if(_0x3b23b0===_0x5b86a0)break;else _0x3c8bc1['push'](_0x3c8bc1['shift']());}catch(_0x230dc2){_0x3c8bc1['push'](_0x3c8bc1['shift']());}}}(_0x5cf2,0xc48ee));import{getToken}from'../utils/keychain.js';import{getFeature,concludeSession}from'../utils/featureApi.js';import{getSessionEntry,shouldShowStopReminder}from'../utils/sessionCache.js';function _0x2db4(_0x3c0e5c,_0x2a4256){_0x3c0e5c=_0x3c0e5c-0x141;const _0x5cf250=_0x5cf2();let _0x2db412=_0x5cf250[_0x3c0e5c];return _0x2db412;}function _0x5cf2(){const _0x53f985=['status','3858672Snyqfy','sessionId','Stop','https://dashboard.ranger.net/features/','IVkZb','verification_in_progress','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','mmKBd','981095zTawba','1211903xTHYlC','hook:stop','incomplete','4mgYkbr','wwysL','105007qLlMXA','stringify','8421894JDpSub','trackCommandStart','3gnVVxN','26500833XIikNu','1035586WtTihK','featureId','some'];_0x5cf2=function(){return _0x53f985;};return _0x5cf2();}import{getEnabledHookContext}from'./output.js';import{createTelemetryCollector}from'../utils/telemetry.js';export async function stopHook(_0x43832f){const _0x1837e8=_0x2db4,_0x3526d2={'IVkZb':function(_0x524bc0,_0x20dd70){return _0x524bc0(_0x20dd70);},'wwysL':function(_0x72f1c1,_0x127c02,_0x2ba60a,_0x22b2fe){return _0x72f1c1(_0x127c02,_0x2ba60a,_0x22b2fe);},'wQoCR':function(_0x3562f4,_0xd2aa30){return _0x3562f4(_0xd2aa30);},'BhKHe':_0x1837e8(0x14e),'mmKBd':function(_0x26572b,_0x1c91f7,_0x48767d){return _0x26572b(_0x1c91f7,_0x48767d);}},_0x684073=await _0x3526d2[_0x1837e8(0x150)](getEnabledHookContext,_0x43832f),_0x4bfba6=_0x684073?.[_0x1837e8(0x14d)]??null;let _0x48d681=!![];if(!_0x4bfba6){await _0x3526d2[_0x1837e8(0x141)](trackStop,_0x4bfba6,![],_0x48d681);return;}try{const _0x25de99=getSessionEntry(_0x4bfba6);if(!_0x25de99){await _0x3526d2['wwysL'](trackStop,_0x4bfba6,!![],_0x48d681);return;}const _0x15315b=await getToken(),_0x5f585c=_0x1837e8(0x14f)+_0x25de99[_0x1837e8(0x149)];let _0x565a41=null,_0x41bf47=![],_0x5c5d27=![];if(_0x15315b)try{const _0x2e2e4b=await _0x3526d2['IVkZb'](getFeature,_0x25de99[_0x1837e8(0x149)]);_0x565a41=_0x2e2e4b['currentSessionId']??null;const _0x5a6ed4=_0x2e2e4b['checklistItems']['filter'](_0x559bee=>_0x559bee[_0x1837e8(0x14d)]===_0x565a41);_0x41bf47=_0x5a6ed4['some'](_0x2a2716=>_0x2a2716[_0x1837e8(0x14b)]!=='verified'&&_0x2a2716[_0x1837e8(0x14b)]!=='blocked'&&_0x2a2716[_0x1837e8(0x14b)]!=='closed'&&_0x2a2716[_0x1837e8(0x14b)]!==_0x1837e8(0x157)),_0x5c5d27=_0x5a6ed4[_0x1837e8(0x14a)](_0x3573e2=>_0x3573e2[_0x1837e8(0x14b)]===_0x1837e8(0x151));}catch{}if(_0x15315b&&_0x565a41&&_0x41bf47){if(!_0x5c5d27&&_0x3526d2['wQoCR'](shouldShowStopReminder,_0x4bfba6)){const _0xc9c53c={'hookSpecificOutput':{'hookEventName':_0x3526d2['BhKHe'],'additionalContext':_0x1837e8(0x152)+_0x5f585c}};console['log'](JSON[_0x1837e8(0x143)](_0xc9c53c));}}if(_0x15315b&&_0x565a41&&!_0x41bf47)try{await _0x3526d2[_0x1837e8(0x153)](concludeSession,_0x25de99[_0x1837e8(0x149)],_0x565a41);}catch{}await trackStop(_0x4bfba6,!![],_0x48d681);return;}catch{await trackStop(_0x4bfba6,!![],_0x48d681);return;}}async function trackStop(_0x37f8b4,_0x10bf60,_0xee4685){const _0x1982be=_0x2db4;try{const _0x5c6a21=createTelemetryCollector(_0x1982be(0x156));await _0x5c6a21[_0x1982be(0x145)]({'sessionId':_0x37f8b4??undefined,'hooksEnabled':_0x10bf60,'stopAllowed':_0xee4685}),await _0x5c6a21['trackCommandEnd']('success');}catch{}}
|
package/build/commands/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x111e3b,_0x169281){var _0x200c0d=_0x15d4,_0x177c9a=_0x111e3b();while(!![]){try{var _0x287b94=parseInt(_0x200c0d(0xd2))/0x1+parseInt(_0x200c0d(0xc9))/0x2+parseInt(_0x200c0d(0xcf))/0x3*(parseInt(_0x200c0d(0xcc))/0x4)+-parseInt(_0x200c0d(0xcd))/0x5*(-parseInt(_0x200c0d(0xd3))/0x6)+-parseInt(_0x200c0d(0xcb))/0x7+parseInt(_0x200c0d(0xd0))/0x8*(-parseInt(_0x200c0d(0xd1))/0x9)+parseInt(_0x200c0d(0xca))/0xa*(parseInt(_0x200c0d(0xce))/0xb);if(_0x287b94===_0x169281)break;else _0x177c9a['push'](_0x177c9a['shift']());}catch(_0x340bca){_0x177c9a['push'](_0x177c9a['shift']());}}}(_0x3e37,0x87117));export{addEnv}from'./addEnv.js';export{clean}from'./clean.js';export{login}from'./login.js';export{start,ensureLocalEnv,ensureChromium,authenticate}from'./start.js';export{useEnv}from'./useEnv.js';export{deleteProfile}from'./deleteProfile.js';export{updateEnv}from'./updateEnv.js';export{update}from'./update.js';export{skillup}from'./skillup.js';function _0x15d4(_0x158557,_0x4fc8ec){_0x158557=_0x158557-0xc9;var _0x3e3751=_0x3e37();var _0x15d492=_0x3e3751[_0x158557];return _0x15d492;}export{envList}from'./env.js';export{hook}from'./hook.js';export{setupCi}from'./setupCi.js';export{migrateProfile}from'./migrateProfile.js';function _0x3e37(){var _0xbf038a=['350934PeZYty','456968fwNjmA','3695650bUIKgR','5450165OsgSBi','2062392vDsokY','25UbMPLw','22jmVUFm','3aUjEsK','5513432XqEeos','9UjkNjV','245356vzJvcL'];_0x3e37=function(){return _0xbf038a;};return _0x3e37();}
|
package/build/commands/login.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x26c3e5,_0x506f08){const _0x1c2882=_0x10d1,_0x16ab40=_0x26c3e5();while(!![]){try{const _0x2b2b3e=-parseInt(_0x1c2882(0x159))/0x1*(parseInt(_0x1c2882(0x15a))/0x2)+parseInt(_0x1c2882(0x155))/0x3+parseInt(_0x1c2882(0x151))/0x4+-parseInt(_0x1c2882(0x158))/0x5+parseInt(_0x1c2882(0x14f))/0x6*(parseInt(_0x1c2882(0x157))/0x7)+parseInt(_0x1c2882(0x15e))/0x8+parseInt(_0x1c2882(0x15c))/0x9*(-parseInt(_0x1c2882(0x15f))/0xa);if(_0x2b2b3e===_0x506f08)break;else _0x16ab40['push'](_0x16ab40['shift']());}catch(_0x32bfcd){_0x16ab40['push'](_0x16ab40['shift']());}}}(_0x364c,0x35a80));function _0x10d1(_0x34ceaa,_0x529bb1){_0x34ceaa=_0x34ceaa-0x14f;const _0x364c4f=_0x364c();let _0x10d173=_0x364c4f[_0x34ceaa];return _0x10d173;}import{runDeviceAuthFlow}from'./utils/deviceAuth.js';function _0x364c(){const _0x414526=['1126INxUDk','\x0a✅\x20API\x20key\x20stored\x20successfully','2187EfDwgc','gwzLQ','1711504pDAUui','20830QTBHEQ','6mopZep','HWaBu','1613160qztCDl','success','log','aiBlF','700740ZAMATf','message','1158493ZaJszB','838140dkRigh','218klYneD'];_0x364c=function(){return _0x414526;};return _0x364c();}import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';import{isInteractive}from'./utils/cloudProfileSession.js';export async function login(){const _0x5784f0=_0x10d1,_0x32a1b3={'olCuP':'Re-authenticating\x20via\x20MCP\x20bootstrap...','aiBlF':function(_0x272445){return _0x272445();},'HWaBu':function(_0x235703){return _0x235703();},'GnNEM':'Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','gwzLQ':function(_0xd2064c,_0x480265){return _0xd2064c(_0x480265);},'yaFjr':function(_0x1b2af6,_0x3469f8){return _0x1b2af6 instanceof _0x3469f8;}},_0x59c2d7=await getMcpAuthOrigin();if(_0x59c2d7){console['log'](_0x32a1b3['olCuP']),await _0x32a1b3[_0x5784f0(0x154)](mcpBootstrap);return;}if(!_0x32a1b3[_0x5784f0(0x150)](isInteractive))throw new Error(_0x32a1b3['GnNEM']);try{const _0x5ebbb1=await runDeviceAuthFlow(),_0x966c5d=await _0x32a1b3[_0x5784f0(0x15d)](getCurrentUser,_0x5ebbb1);_0x966c5d[_0x5784f0(0x152)]?console[_0x5784f0(0x153)]('\x0a✅\x20Logged\x20in\x20to\x20'+_0x966c5d['user']['organizationName']):console['log'](_0x5784f0(0x15b));}catch(_0x49b28b){throw new Error('Login\x20failed:\x20'+(_0x32a1b3['yaFjr'](_0x49b28b,Error)?_0x49b28b[_0x5784f0(0x156)]:_0x49b28b));}}
|
|
@@ -1 +1 @@
|
|
|
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
|
+
const _0x13af02=_0x1f05;(function(_0x4b8d9b,_0x53b2d8){const _0x1c72df=_0x1f05,_0x1d71cd=_0x4b8d9b();while(!![]){try{const _0x556310=-parseInt(_0x1c72df(0xed))/0x1*(-parseInt(_0x1c72df(0x9e))/0x2)+-parseInt(_0x1c72df(0xc0))/0x3+parseInt(_0x1c72df(0x100))/0x4*(-parseInt(_0x1c72df(0xd5))/0x5)+-parseInt(_0x1c72df(0x9c))/0x6+parseInt(_0x1c72df(0xbc))/0x7*(-parseInt(_0x1c72df(0xc7))/0x8)+-parseInt(_0x1c72df(0xbe))/0x9+parseInt(_0x1c72df(0xd8))/0xa*(parseInt(_0x1c72df(0x91))/0xb);if(_0x556310===_0x53b2d8)break;else _0x1d71cd['push'](_0x1d71cd['shift']());}catch(_0x3613d6){_0x1d71cd['push'](_0x1d71cd['shift']());}}}(_0x4c64,0xa2a75));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',_0x13af02(0xde)),AUTH_ORIGIN_PATH=join(homedir(),_0x13af02(0xc2),'auth-origin.txt');export async function getMcpAuthOrigin(){const _0x261b0f=_0x13af02;try{const _0x4bd580=(await readFile(AUTH_ORIGIN_PATH,_0x261b0f(0xdc)))[_0x261b0f(0xc4)]();return _0x4bd580||null;}catch{return null;}}export async function mcpBootstrap(){const _0x21541b=_0x13af02,_0x400080={'ArNEB':function(_0x399756,_0x116b08){return _0x399756(_0x116b08);},'SuLFr':function(_0x54779b){return _0x54779b();},'bnDyc':'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.'},_0x5ba36c=getMcpAuthUrl();currentOrigin=_0x5ba36c;const _0x759694=process[_0x21541b(0xb3)]['isTTY']??![];console['log']('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x5ba36c+'\x0a');const _0x57b1ca=await _0x400080['ArNEB'](tryUnauthenticated,_0x5ba36c);let _0x20e304=null;if(_0x57b1ca===_0x21541b(0x103))_0x20e304='';else{_0x20e304=await _0x400080['SuLFr'](loadCachedToken);if(!_0x20e304){if(!_0x759694)throw new Error('MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a'+_0x400080['bnDyc']);_0x20e304=await oauthFlow(_0x5ba36c);}}await callGetCliToken(_0x5ba36c,_0x20e304);}async function tryUnauthenticated(_0x8824b3){const _0x4bd7cf=_0x13af02,_0x2e629f={'TRbRz':function(_0x34d1d4,_0x4023f3,_0x2c08da){return _0x34d1d4(_0x4023f3,_0x2c08da);},'xdfiA':_0x4bd7cf(0xf4),'Bdalg':'application/json,\x20text/event-stream','LCXEF':_0x4bd7cf(0xf0),'eAxAk':'2025-03-26','EkrDU':function(_0x56e2b4,_0x17637b){return _0x56e2b4===_0x17637b;}},_0x2b1433=await _0x2e629f['TRbRz'](fetch,_0x8824b3,{'method':_0x2e629f['xdfiA'],'headers':{'Content-Type':_0x4bd7cf(0xf5),'Accept':_0x2e629f['Bdalg']},'body':JSON['stringify']({'jsonrpc':_0x2e629f[_0x4bd7cf(0xbb)],'id':0x1,'method':_0x4bd7cf(0xa5),'params':{'protocolVersion':_0x2e629f['eAxAk'],'capabilities':{},'clientInfo':{'name':_0x4bd7cf(0x107),'version':'1.0.0'}}})});if(_0x2b1433['ok'])return await _0x2b1433['text'](),'proxied';if(_0x2e629f['EkrDU'](_0x2b1433['status'],0x191))return await _0x2b1433[_0x4bd7cf(0xe5)](),_0x4bd7cf(0xf9);const _0x3e7633=await _0x2b1433['text']();throw new Error(_0x4bd7cf(0xf7)+_0x2b1433[_0x4bd7cf(0x109)]+':\x20'+_0x3e7633);}class OAuthTimeoutError extends Error{constructor(_0x51c20b){const _0x3bda39=_0x13af02;super(_0x51c20b),this['name']=_0x3bda39(0xdd);}}async function oauthFlow(_0x11d5a7){const _0x2c3cbe=_0x13af02;try{return await oauthFlowAttempt(_0x11d5a7);}catch(_0x248208){if(_0x248208 instanceof OAuthTimeoutError&&await loadCachedClient())return console['log'](_0x2c3cbe(0x99)),await clearCachedClient(),await oauthFlowAttempt(_0x11d5a7);throw _0x248208;}}async function oauthFlowAttempt(_0xb9146a){const _0x3bce7e=_0x13af02,_0x3ee65e={'bpJLH':_0x3bce7e(0x10a),'xTYoZ':_0x3bce7e(0xbf),'sBBRL':'Registering\x20OAuth\x20client...','BkpOS':function(_0x2cf38d,_0xb66d51,_0x1467c7){return _0x2cf38d(_0xb66d51,_0x1467c7);},'ChNnN':_0x3bce7e(0xf5),'bPrQR':'none','DdLGD':'\x20done','CKWZH':_0x3bce7e(0xcc),'HSTaq':function(_0x4dadd3,_0x49979e){return _0x4dadd3(_0x49979e);},'JxBlu':'sha256','xIxNA':'redirect_uri','rUYgE':_0x3bce7e(0xe6),'udKzB':'state','VEhBe':_0x3bce7e(0xe0),'LPiWe':_0x3bce7e(0xbd),'wXNfe':function(_0x2876ea,_0x1e9ea9){return _0x2876ea(_0x1e9ea9);},'tJfhP':_0x3bce7e(0xa1),'Mrxyp':'POST','sDIIf':function(_0x10cbc5,_0x5b1254,_0x3d6ba8,_0x46e9a5){return _0x10cbc5(_0x5b1254,_0x3d6ba8,_0x46e9a5);}},_0x19ac5f=_0xb9146a[_0x3bce7e(0x95)](/\/mcp$/,'');process['stdout']['write']('Discovering\x20authorization\x20server...');const _0x56a5bd=await fetch(_0x19ac5f+_0x3bce7e(0xaf));if(!_0x56a5bd['ok'])throw new Error(_0x3ee65e['bpJLH']);const _0x546ddd=await _0x56a5bd['json'](),_0x2a2a09=_0x546ddd['authorization_servers']?.[0x0];if(!_0x2a2a09)throw new Error(_0x3ee65e['xTYoZ']);console['log']('\x20'+_0x2a2a09);const _0x2724ca=await fetchAuthServerMetadata(_0x2a2a09);let _0x52b616,_0x3c51e2;const _0x3c365e=await loadCachedClient();if(_0x3c365e)_0x52b616=_0x3c365e[_0x3bce7e(0xeb)],_0x3c51e2=_0x3c365e['clientSecret'];else{if(_0x2724ca[_0x3bce7e(0x108)]){process[_0x3bce7e(0xb3)][_0x3bce7e(0x10f)](_0x3ee65e[_0x3bce7e(0xa7)]);const _0x19ac00=await _0x3ee65e['BkpOS'](fetch,_0x2724ca['registration_endpoint'],{'method':'POST','headers':{'Content-Type':_0x3ee65e['ChNnN']},'body':JSON['stringify']({'client_name':'Ranger\x20CLI','redirect_uris':['http://localhost:'+CALLBACK_PORT+_0x3bce7e(0xfe)],'grant_types':['authorization_code','refresh_token'],'response_types':['code'],'token_endpoint_auth_method':_0x3ee65e['bPrQR']})});if(!_0x19ac00['ok']){const _0x18c87e=await _0x19ac00['text']();throw new Error('Client\x20registration\x20failed:\x20'+_0x18c87e);}const _0x1b06b8=await _0x19ac00['json']();_0x52b616=_0x1b06b8['client_id'],_0x3c51e2=_0x1b06b8[_0x3bce7e(0x110)],await saveCachedClient(_0x52b616,_0x3c51e2),console[_0x3bce7e(0xe7)](_0x3ee65e[_0x3bce7e(0xff)]);}else throw new Error(_0x3bce7e(0xb6));}const _0x289b3b=randomBytes(0x20)['toString'](_0x3ee65e[_0x3bce7e(0xab)]),_0x271cfc=_0x3ee65e[_0x3bce7e(0xb5)](createHash,_0x3ee65e[_0x3bce7e(0xa6)])['update'](_0x289b3b)['digest'](_0x3bce7e(0xcc)),_0x46bd07=randomBytes(0x10)[_0x3bce7e(0xfd)]('hex'),_0x9721a1=new URL(_0x2724ca['authorization_endpoint']);_0x9721a1['searchParams']['set']('response_type',_0x3bce7e(0xd4)),_0x9721a1['searchParams']['set']('client_id',_0x52b616),_0x9721a1['searchParams']['set'](_0x3ee65e['xIxNA'],_0x3bce7e(0xc1)+CALLBACK_PORT+_0x3bce7e(0xfe)),_0x9721a1['searchParams'][_0x3bce7e(0xfa)](_0x3ee65e['rUYgE'],_0x271cfc),_0x9721a1[_0x3bce7e(0x97)]['set']('code_challenge_method','S256'),_0x9721a1[_0x3bce7e(0x97)]['set'](_0x3ee65e[_0x3bce7e(0xd2)],_0x46bd07);_0x546ddd[_0x3bce7e(0xe0)]&&_0x9721a1[_0x3bce7e(0x97)]['set'](_0x3ee65e['VEhBe'],_0x546ddd[_0x3bce7e(0xe0)]);console[_0x3bce7e(0xe7)](_0x3ee65e['LPiWe']),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x9721a1['toString']()+'\x0a'),await openBrowser(_0x9721a1['toString']());const _0x15a25d=await _0x3ee65e[_0x3bce7e(0xd9)](waitForCallback,_0x46bd07);process[_0x3bce7e(0xb3)][_0x3bce7e(0x10f)](_0x3ee65e['tJfhP']);const _0x2047ae=new URLSearchParams({'grant_type':_0x3bce7e(0x113),'code':_0x15a25d,'redirect_uri':'http://localhost:'+CALLBACK_PORT+'/callback','client_id':_0x52b616,'code_verifier':_0x289b3b});_0x3c51e2&&_0x2047ae[_0x3bce7e(0xfa)](_0x3bce7e(0x110),_0x3c51e2);_0x546ddd['resource']&&_0x2047ae['set'](_0x3ee65e['VEhBe'],_0x546ddd[_0x3bce7e(0xe0)]);const _0x7ebfd0=await fetch(_0x2724ca['token_endpoint'],{'method':_0x3ee65e['Mrxyp'],'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x2047ae});if(!_0x7ebfd0['ok']){const _0x5843ad=await _0x7ebfd0['text']();throw new Error('Token\x20exchange\x20failed:\x20'+_0x5843ad);}const _0x428152=await _0x7ebfd0[_0x3bce7e(0xcb)]();return console[_0x3bce7e(0xe7)](_0x3bce7e(0xf8)),await _0x3ee65e[_0x3bce7e(0x116)](saveCachedToken,_0x428152[_0x3bce7e(0xa8)],_0x428152['refresh_token'],_0x428152[_0x3bce7e(0xb7)]),_0x428152[_0x3bce7e(0xa8)];}function _0x4c64(){const _0x239e24=['nAyAP','replace','GwKvJ','searchParams','TzohQ','\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','get_cli_token\x20failed:\x20','isError','7908732ecdSHv','uGYcg','2tspQIW','wZffJ','JxFBN','Exchanging\x20authorization\x20code...','jzWmP','token','close','initialize','JxBlu','sBBRL','access_token','result','NOSMO','CKWZH','match','Requesting\x20CLI\x20token...','Cbvgi','/.well-known/oauth-protected-resource','IgFHO','fvWAW','now','stdout','<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','HSTaq','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','expires_in','Not\x20found','vDfgQ','GfVqE','LCXEF','189ZfKRrV','\x0aOpening\x20browser\x20for\x20authentication...','1497600mUzHrH','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','1010628CapJpP','http://localhost:','.ranger','content-type','trim','NMKYF','refresh.txt','349032EmAXfs','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','PnYWZ','type','json','base64url','vavTi','structuredContent','content','darwin','iaGHX','udKzB','clientSecret','code','14380GNfqoo','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','get','50ssDJoe','wXNfe','data:','mNCbe','utf-8','OAuthTimeoutError','mcp-oauth-tokens.json','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','resource','writeHead','Unknown\x20error','error','/.well-known/oauth-authorization-server','text','code_challenge','log','lzshS','Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20','application/json,\x20text/event-stream','clientId','get_cli_token','848541IMXQkY','vcmJT','expiresAt','2.0','accessToken','kGPGN','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','POST','application/json','HTTP\x20','MCP\x20server\x20returned\x20HTTP\x20','\x20done','needs-oauth','set','xdg-open','url','toString','/callback','DdLGD','64dNPCeq','AzlKp','state','proxied','notifications/initialized','stringify','split','ranger-cli','registration_endpoint','status','Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','end','qeudU','\x0aToken\x20written\x20to\x20','ikeQd','write','client_secret','KsEnd','gSTQr','authorization_code','headers','tools/call','sDIIf','ylLIg','6298787lYuvOI','string','origin'];_0x4c64=function(){return _0x239e24;};return _0x4c64();}async function callGetCliToken(_0x7d2759,_0x480e0e){const _0x567cba=_0x13af02,_0x2624d7={'GfVqE':function(_0x5d0360,_0x51bc42,_0x59b5f4){return _0x5d0360(_0x51bc42,_0x59b5f4);},'IgFHO':'Authorization','qeudU':'Initializing\x20MCP\x20session...','IPSQD':function(_0x36478e,_0x50b7c9){return _0x36478e(_0x50b7c9);},'mppLi':'2.0','vTnmz':'initialize','mNCbe':'ranger-cli','ikeQd':'1.0.0','bBAqS':_0x567cba(0xf4),'vDfgQ':_0x567cba(0x104),'JEgWR':_0x567cba(0x115),'zhnOX':'\x20done','GVeaV':function(_0x1ab2f7,_0x4edd22){return _0x1ab2f7(_0x4edd22);},'DlHfw':'\x0aUnexpected\x20response\x20structure:','fvWAW':_0x567cba(0xd6),'vavTi':function(_0x499f34){return _0x499f34();},'lzshS':function(_0x44c1e2,_0x17f351,_0x446c4f){return _0x44c1e2(_0x17f351,_0x446c4f);},'nAyAP':function(_0x5da99e,_0x1b4e84,_0x319887,_0x5918cf){return _0x5da99e(_0x1b4e84,_0x319887,_0x5918cf);},'rZYjl':'auth-origin.txt','RxKrz':_0x567cba(0xf3)},_0x39b802={'Content-Type':_0x567cba(0xf5),'Accept':_0x567cba(0xea)};_0x480e0e&&(_0x39b802[_0x2624d7[_0x567cba(0xb0)]]='Bearer\x20'+_0x480e0e);const _0x3a920c=async _0xe74e15=>{const _0x18c454=_0x567cba,_0x26760e=await _0x2624d7[_0x18c454(0xba)](fetch,_0x7d2759,{'method':'POST','headers':_0x39b802,'body':JSON['stringify'](_0xe74e15)});if(!_0x26760e['ok']){const _0x24aeb0=await _0x26760e['text']();throw new Error(_0x18c454(0xf6)+_0x26760e[_0x18c454(0x109)]+':\x20'+_0x24aeb0);}return parseResponse(_0x26760e);};process['stdout'][_0x567cba(0x10f)](_0x2624d7[_0x567cba(0x10c)]);const _0x3bc510=await _0x2624d7['IPSQD'](_0x3a920c,{'jsonrpc':_0x2624d7['mppLi'],'id':0x1,'method':_0x2624d7['vTnmz'],'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x2624d7[_0x567cba(0xdb)],'version':_0x2624d7[_0x567cba(0x10e)]}}});if(_0x3bc510['error'])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x3bc510[_0x567cba(0xe3)]['message']??JSON[_0x567cba(0x105)](_0x3bc510[_0x567cba(0xe3)])));console[_0x567cba(0xe7)](_0x567cba(0xf8)),await fetch(_0x7d2759,{'method':_0x2624d7['bBAqS'],'headers':_0x39b802,'body':JSON['stringify']({'jsonrpc':'2.0','method':_0x2624d7[_0x567cba(0xb9)]})})['then'](_0x3bbe10=>_0x3bbe10[_0x567cba(0xe5)]()),process['stdout'][_0x567cba(0x10f)](_0x567cba(0xad));const _0x2402c9=await _0x3a920c({'jsonrpc':_0x2624d7['mppLi'],'id':0x2,'method':_0x2624d7['JEgWR'],'params':{'name':_0x567cba(0xec),'arguments':{}}});if(_0x2402c9[_0x567cba(0xe3)])throw new Error(_0x567cba(0x9a)+(_0x2402c9[_0x567cba(0xe3)]['message']??JSON[_0x567cba(0x105)](_0x2402c9['error'])));console[_0x567cba(0xe7)](_0x2624d7['zhnOX']);const _0x238a7e=_0x2624d7['GVeaV'](extractToken,_0x2402c9[_0x567cba(0xa9)]);if(!_0x238a7e){console[_0x567cba(0xe3)](_0x2624d7['DlHfw']),console['error'](JSON['stringify'](_0x2402c9['result'],null,0x2));throw new Error(_0x2624d7[_0x567cba(0xb1)]);}const _0x3b0fbc=_0x2624d7[_0x567cba(0xba)](join,_0x2624d7[_0x567cba(0xcd)](homedir),_0x567cba(0xc2)),_0x55f301=_0x2624d7['lzshS'](join,_0x3b0fbc,_0x567cba(0xc6));await _0x2624d7[_0x567cba(0xe8)](mkdir,_0x3b0fbc,{'recursive':!![]}),await writeFile(_0x55f301,_0x238a7e,{'mode':0x180}),await _0x2624d7[_0x567cba(0x94)](writeFile,join(_0x3b0fbc,_0x2624d7['rZYjl']),_0x7d2759,{'mode':0x180}),console['log'](_0x567cba(0x10d)+_0x55f301),console['log'](_0x2624d7['RxKrz']);}async function fetchAuthServerMetadata(_0x3192de){const _0xaa709=_0x13af02,_0x26b2e3={'JxFBN':function(_0x3b1c66,_0x4d83c1){return _0x3b1c66(_0x4d83c1);}},_0x51cd35=_0x3192de+_0xaa709(0xe4),_0x7209eb=await _0x26b2e3[_0xaa709(0xa0)](fetch,_0x51cd35);if(!_0x7209eb['ok'])throw new Error(_0xaa709(0xe9)+_0x51cd35+':\x20'+_0x7209eb['status']);return _0x7209eb['json']();}function waitForCallback(_0x36c76d){const _0x34b752={'GwKvJ':function(_0x35188f,_0x7c30a0){return _0x35188f(_0x7c30a0);},'KsEnd':function(_0x26255,_0x9c52ae){return _0x26255!==_0x9c52ae;},'VhYwZ':'code','gSTQr':'error','GtAKt':'error_description','vRciR':function(_0x5d8a7a){return _0x5d8a7a();},'tabOh':'text/html','ylLIg':function(_0x724970,_0x2536f3,_0x5e3f27){return _0x724970(_0x2536f3,_0x5e3f27);}};return new Promise((_0x48cabb,_0x243043)=>{const _0x56f863=_0x1f05,_0xf88fe6=()=>{const _0x479be3=_0x1f05;_0x495e3f['closeAllConnections'](),_0x495e3f[_0x479be3(0xa4)]();},_0x311da2=_0x34b752[_0x56f863(0x117)](setTimeout,()=>{_0xf88fe6(),_0x34b752['GwKvJ'](_0x243043,new OAuthTimeoutError('OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes'));},0x1d4c0),_0x495e3f=createServer((_0x55ba69,_0x3f2e59)=>{const _0x47e15b=_0x56f863,_0x1712a0=new URL(_0x55ba69[_0x47e15b(0xfc)]??'/',_0x47e15b(0xc1)+CALLBACK_PORT);if(_0x34b752[_0x47e15b(0x111)](_0x1712a0['pathname'],_0x47e15b(0xfe))){_0x3f2e59['writeHead'](0x194),_0x3f2e59['end'](_0x47e15b(0xb8));return;}const _0xd3dad8=_0x1712a0[_0x47e15b(0x97)][_0x47e15b(0xd7)](_0x34b752['VhYwZ']),_0x3dd533=_0x1712a0[_0x47e15b(0x97)][_0x47e15b(0xd7)](_0x47e15b(0x102)),_0x11d8d6=_0x1712a0[_0x47e15b(0x97)]['get'](_0x34b752[_0x47e15b(0x112)]);if(_0x11d8d6){const _0x1075af=_0x1712a0[_0x47e15b(0x97)]['get'](_0x34b752['GtAKt'])??_0x11d8d6;_0x3f2e59[_0x47e15b(0xe1)](0xc8,{'Content-Type':'text/html'}),_0x3f2e59['end']('<html><body><h2>Authentication\x20failed</h2><p>'+_0x1075af+_0x47e15b(0xc8)),clearTimeout(_0x311da2),_0x34b752['vRciR'](_0xf88fe6),_0x243043(new Error('OAuth\x20error:\x20'+_0x1075af));return;}if(!_0xd3dad8||_0x3dd533!==_0x36c76d){_0x3f2e59['writeHead'](0x190,{'Content-Type':'text/html'}),_0x3f2e59[_0x47e15b(0x10b)](_0x47e15b(0xb4));return;}_0x3f2e59[_0x47e15b(0xe1)](0xc8,{'Content-Type':_0x34b752['tabOh']}),_0x3f2e59[_0x47e15b(0x10b)]('<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>'),_0x34b752['GwKvJ'](clearTimeout,_0x311da2),_0xf88fe6(),_0x34b752[_0x47e15b(0x96)](_0x48cabb,_0xd3dad8);});_0x495e3f['listen'](CALLBACK_PORT,'127.0.0.1');});}async function openBrowser(_0x5117c5){const _0x4515e2=_0x13af02,_0x1886c1={'LpPXH':function(_0x37dfd2,_0x581888){return _0x37dfd2===_0x581888;},'TzohQ':'win32','VolPc':_0x4515e2(0xfb),'dtrjS':function(_0x1cd969,_0xd8643e){return _0x1cd969(_0xd8643e);}},_0x5b86ee=_0x1886c1['LpPXH'](process['platform'],_0x4515e2(0xd0))?'open':process['platform']===_0x1886c1[_0x4515e2(0x98)]?'start':_0x1886c1['VolPc'];_0x1886c1['dtrjS'](exec,_0x5b86ee+'\x20\x22'+_0x5117c5+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x2c9407=_0x13af02;try{const _0x5053ff=JSON['parse'](await readFile(TOKEN_CACHE_PATH,'utf-8'));if(_0x5053ff['origin']&&_0x5053ff['origin']!==currentOrigin)return null;if(_0x5053ff[_0x2c9407(0xef)]&&Date[_0x2c9407(0xb2)]()>_0x5053ff[_0x2c9407(0xef)])return null;return _0x5053ff[_0x2c9407(0xf1)]??null;}catch{return null;}}async function saveCachedToken(_0x316cca,_0x46e090,_0x20174b){const _0x4c8c64=_0x13af02,_0x5f1448={'wZffJ':function(_0x530ac8){return _0x530ac8();},'xHOoG':function(_0x14c194,_0x4de13f){return _0x14c194+_0x4de13f;},'NMKYF':function(_0x229f79,_0x2284fe){return _0x229f79*_0x2284fe;},'iiuQj':function(_0x5dfd7b,_0x214811,_0x594938){return _0x5dfd7b(_0x214811,_0x594938);},'AzlKp':_0x4c8c64(0xc2)},_0x1ed7d7=await _0x5f1448[_0x4c8c64(0x9f)](loadCachedData),_0x52a518={..._0x1ed7d7,'origin':currentOrigin,'accessToken':_0x316cca,'refreshToken':_0x46e090??_0x1ed7d7?.['refreshToken'],'expiresAt':_0x20174b?_0x5f1448['xHOoG'](Date['now'](),_0x5f1448[_0x4c8c64(0xc5)](_0x20174b,0x3e8)):undefined};await _0x5f1448['iiuQj'](mkdir,_0x5f1448['iiuQj'](join,_0x5f1448['wZffJ'](homedir),_0x5f1448[_0x4c8c64(0x101)]),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x4c8c64(0x105)](_0x52a518),{'mode':0x180});}function _0x1f05(_0x31a8d2,_0x58b163){_0x31a8d2=_0x31a8d2-0x91;const _0x4c64bd=_0x4c64();let _0x1f0525=_0x4c64bd[_0x31a8d2];return _0x1f0525;}async function loadCachedClient(){const _0x5da9bf=_0x13af02,_0x1a99de={'PnYWZ':function(_0x57f837){return _0x57f837();},'jzWmP':function(_0x5c3fef,_0xd1bf0){return _0x5c3fef!==_0xd1bf0;}},_0x96d832=await _0x1a99de[_0x5da9bf(0xc9)](loadCachedData);if(_0x96d832?.[_0x5da9bf(0x93)]&&_0x1a99de[_0x5da9bf(0xa2)](_0x96d832['origin'],currentOrigin))return null;return _0x96d832?.[_0x5da9bf(0xeb)]?{'clientId':_0x96d832[_0x5da9bf(0xeb)],'clientSecret':_0x96d832[_0x5da9bf(0xd3)]}:null;}async function clearCachedClient(){const _0x4c5952=_0x13af02,_0x5ad2ca={'Cbvgi':function(_0x580864){return _0x580864();}},_0x4af269=await _0x5ad2ca[_0x4c5952(0xae)](loadCachedData);if(!_0x4af269)return;const {clientId:_0x5e8d3c,clientSecret:_0x5de571,..._0x5429d2}=_0x4af269;await writeFile(TOKEN_CACHE_PATH,JSON[_0x4c5952(0x105)](_0x5429d2),{'mode':0x180});}async function saveCachedClient(_0x11f4bc,_0x51cd9f){const _0x3f9c66=_0x13af02,_0x561848={'EMMDq':function(_0x2b0133){return _0x2b0133();},'spSJN':function(_0x74b9de,_0x242dac,_0x364f0d){return _0x74b9de(_0x242dac,_0x364f0d);}},_0x2145ea=await _0x561848['EMMDq'](loadCachedData),_0x1880eb={..._0x2145ea,'origin':currentOrigin,'accessToken':_0x2145ea?.['accessToken']??'','clientId':_0x11f4bc,'clientSecret':_0x51cd9f};await mkdir(_0x561848['spSJN'](join,homedir(),_0x3f9c66(0xc2)),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x1880eb),{'mode':0x180});}async function loadCachedData(){const _0x233f10=_0x13af02,_0x3408d5={'iaGHX':function(_0x529be0,_0x57b9e9,_0x448054){return _0x529be0(_0x57b9e9,_0x448054);},'uGYcg':'utf-8'};try{return JSON['parse'](await _0x3408d5[_0x233f10(0xd1)](readFile,TOKEN_CACHE_PATH,_0x3408d5[_0x233f10(0x9d)]));}catch{return null;}}async function parseResponse(_0x512b05){const _0x44b448=_0x13af02,_0x56eab8={'kGPGN':_0x44b448(0xc3),'cdlUf':'text/event-stream','pdZbV':_0x44b448(0xdf)},_0x4c4402=_0x512b05[_0x44b448(0x114)][_0x44b448(0xd7)](_0x56eab8[_0x44b448(0xf2)])??'';if(_0x4c4402['includes'](_0x56eab8['cdlUf'])){const _0x18593c=await _0x512b05['text']();for(const _0x108b37 of _0x18593c[_0x44b448(0x106)]('\x0a')){const _0x4dcfb8=_0x108b37[_0x44b448(0xc4)]();if(_0x4dcfb8['startsWith'](_0x44b448(0xda))){const _0xa4f554=_0x4dcfb8['slice']('data:'['length'])['trim']();if(!_0xa4f554)continue;try{const _0x475b3e=JSON['parse'](_0xa4f554);if(_0x475b3e['id']!==undefined||_0x475b3e['error'])return _0x475b3e;}catch{}}}throw new Error(_0x56eab8['pdZbV']);}return _0x512b05['json']();}function extractToken(_0x57b094){const _0x1bb6cd=_0x13af02,_0x7a3138={'vcmJT':_0x1bb6cd(0x92),'RiVgc':_0x1bb6cd(0xe2),'NOSMO':function(_0x17aa26,_0x1a1b56){return _0x17aa26===_0x1a1b56;}};if(!_0x57b094)return null;const _0x2e265d=_0x57b094[_0x1bb6cd(0xce)];if(_0x2e265d?.[_0x1bb6cd(0xa3)]&&typeof _0x2e265d['token']===_0x7a3138['vcmJT'])return _0x2e265d[_0x1bb6cd(0xa3)];if(_0x57b094[_0x1bb6cd(0x9b)]){const _0x5a0e35=_0x57b094[_0x1bb6cd(0xcf)];throw new Error('Server\x20returned\x20error:\x20'+(_0x5a0e35?.[0x0]?.[_0x1bb6cd(0xe5)]??_0x7a3138['RiVgc']));}const _0x8f6e9e=_0x57b094[_0x1bb6cd(0xcf)];if(_0x8f6e9e)for(const _0x2346b6 of _0x8f6e9e){if(_0x7a3138[_0x1bb6cd(0xaa)](_0x2346b6[_0x1bb6cd(0xca)],_0x1bb6cd(0xe5))&&_0x2346b6['text']){try{const _0x555ee8=JSON['parse'](_0x2346b6['text']);if(_0x7a3138['NOSMO'](typeof _0x555ee8?.['token'],_0x7a3138[_0x1bb6cd(0xee)]))return _0x555ee8['token'];}catch{}const _0x19dd78=_0x2346b6[_0x1bb6cd(0xe5)][_0x1bb6cd(0xac)](/(rngr_[A-Za-z0-9_-]+)/);if(_0x19dd78)return _0x19dd78[0x1];}}return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x3cdb(){var _0x1c7bad=['1223659PDtTUw','906200KgSrLs','4653942NAzWZx','28YfFBMH','zVRPY','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','2SpfjZM','12RrtiPX','\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a','6417040gbpLTf','45pGxFyS','1989786RSDFaD','FnGZn','5254580SGTmfu','aqgBs','ylYFs','8460045cYWTnK','exit','5AhgBCX'];_0x3cdb=function(){return _0x1c7bad;};return _0x3cdb();}(function(_0x2641b4,_0x259909){var _0xe57aae=_0x388e,_0x3889e0=_0x2641b4();while(!![]){try{var _0x13967e=-parseInt(_0xe57aae(0xb5))/0x1+-parseInt(_0xe57aae(0xbb))/0x2*(-parseInt(_0xe57aae(0xb7))/0x3)+parseInt(_0xe57aae(0xc2))/0x4*(parseInt(_0xe57aae(0xb4))/0x5)+-parseInt(_0xe57aae(0xc0))/0x6*(-parseInt(_0xe57aae(0xb8))/0x7)+-parseInt(_0xe57aae(0xb6))/0x8*(parseInt(_0xe57aae(0xbf))/0x9)+-parseInt(_0xe57aae(0xbe))/0xa+-parseInt(_0xe57aae(0xc5))/0xb*(parseInt(_0xe57aae(0xbc))/0xc);if(_0x13967e===_0x259909)break;else _0x3889e0['push'](_0x3889e0['shift']());}catch(_0x35735f){_0x3889e0['push'](_0x3889e0['shift']());}}}(_0x3cdb,0xf1dba));function _0x388e(_0x46599d,_0x2de697){_0x46599d=_0x46599d-0xb3;var _0x3cdbbf=_0x3cdb();var _0x388eb3=_0x3cdbbf[_0x46599d];return _0x388eb3;}export async function migrateProfile(_0x18e123,_0x100fc1){var _0x3be599=_0x388e,_0x1c517a={'aqgBs':function(_0x3464a5,_0x3a565d){return _0x3464a5+_0x3a565d;},'ylYFs':function(_0x4911a5,_0x649687){return _0x4911a5+_0x649687;},'FnGZn':function(_0x71158b,_0x103fac){return _0x71158b+_0x103fac;},'QSxoV':function(_0x1f1ba0,_0x3ad6da){return _0x1f1ba0+_0x3ad6da;},'epBgW':'ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','RCrBV':_0x3be599(0xba),'esstb':_0x3be599(0xbd),'XxxSa':'Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a','zVRPY':'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.'};console['error'](_0x1c517a[_0x3be599(0xc3)](_0x1c517a[_0x3be599(0xc4)](_0x1c517a['FnGZn'](_0x1c517a['FnGZn'](_0x1c517a['aqgBs'](_0x1c517a[_0x3be599(0xc1)](_0x1c517a['QSxoV'](_0x1c517a['epBgW'],'\x0a'),'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a'),'\x20\x20ranger\x20profile\x20add\x20<name>\x0a')+'\x0a'+_0x1c517a['RCrBV'],_0x1c517a['esstb']),'\x0a'),_0x1c517a['XxxSa']),_0x1c517a[_0x3be599(0xb9)])),process[_0x3be599(0xb3)](0x1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1be451,_0x190b96){const _0x16f1c3=_0x765a,_0x344d58=_0x1be451();while(!![]){try{const _0xcc4f6f=-parseInt(_0x16f1c3(0x82))/0x1*(parseInt(_0x16f1c3(0x91))/0x2)+parseInt(_0x16f1c3(0xa8))/0x3*(-parseInt(_0x16f1c3(0x93))/0x4)+parseInt(_0x16f1c3(0x95))/0x5+-parseInt(_0x16f1c3(0xb8))/0x6+-parseInt(_0x16f1c3(0xa0))/0x7*(-parseInt(_0x16f1c3(0x9d))/0x8)+parseInt(_0x16f1c3(0xb0))/0x9+-parseInt(_0x16f1c3(0xb6))/0xa*(-parseInt(_0x16f1c3(0xa2))/0xb);if(_0xcc4f6f===_0x190b96)break;else _0x344d58['push'](_0x344d58['shift']());}catch(_0x412573){_0x344d58['push'](_0x344d58['shift']());}}}(_0x40d2,0xa0c56));import{join}from'path';import{existsSync}from'fs';import _0x564ba9 from'inquirer';import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';function _0x40d2(){const _0x4cf8af=['✓\x20Ranger\x20skills\x20already\x20installed','suhTv','ENiSl','18425300MWAyCU','Where\x20should\x20the\x20plugin\x20be\x20installed?','2233908ASreZc','SKILL.md','rbfGn','387052bouMwS','qUbTZ','✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','TuFJe','✓\x20Claude\x20Code\x20plugin\x20enabled','confirm','success','MKqIX','list','wFeJO','NEojF','qrzYc','install','⚠\x20Failed\x20to\x20enable\x20plugin:','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','6rHqBna','prompt','5104LjxolW','\x20level)...\x0a','3543350szBoGF','error','EYhfh','ECnzs','vgmxj','✓\x20Marketplace\x20already\x20added','ytoDF','CpQvb','8YAmXGv','ZqVsy','wnFzP','870107zVPSeK','Would\x20you\x20like\x20to\x20install\x20skills?','11GDHBjQ','wantsSkillup','push','\x0aYou\x20can\x20install\x20manually\x20with:','log','RISOm','2967oZnYSF','plugin','project','ranger-testing/trailhead','add','enable','❌\x20Failed\x20to\x20add\x20marketplace:','lJtOv','7006095sNdVdq','xcdRp','sPHiQ'];_0x40d2=function(){return _0x4cf8af;};return _0x40d2();}function _0x765a(_0x577085,_0x4054ce){_0x577085=_0x577085-0x82;const _0x40d227=_0x40d2();let _0x765acd=_0x40d227[_0x577085];return _0x765acd;}import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x3a773c){const _0x5f0a43=_0x765a,_0xb0d6f8={'TuFJe':'ranger@trailhead','GwDRr':function(_0x486d87,_0x183e1d){return _0x486d87(_0x183e1d);},'vgmxj':function(_0x33f4da,_0x2ba51e,_0x4de6da){return _0x33f4da(_0x2ba51e,_0x4de6da);},'wFeJO':function(_0x438a9b){return _0x438a9b();},'CpQvb':'project','MKqIX':'\x0a📦\x20Claude\x20Code\x20Plugin\x0a','ytoDF':'User\x20(available\x20in\x20all\x20your\x20projects)','NFnYE':'user','KNMDH':function(_0x308b4c,_0x4d48d0){return _0x308b4c(_0x4d48d0);},'RISOm':_0x5f0a43(0x9a),'qrzYc':function(_0x238fae,_0x3a1a58){return _0x238fae(_0x3a1a58);},'VmDoE':_0x5f0a43(0xab),'xAmEg':_0x5f0a43(0xae),'wnFzP':_0x5f0a43(0xa5),'xcdRp':'\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','hajIn':_0x5f0a43(0xa9),'ECnzs':function(_0x3bb585,_0x368f71){return _0x3bb585===_0x368f71;},'chviC':_0x5f0a43(0x84),'xDWvO':'--scope','sPHiQ':'already\x20enabled'},_0x4f8878=await isPluginInstalled(_0xb0d6f8[_0x5f0a43(0x85)]);if(_0x4f8878)return console[_0x5f0a43(0xa6)](_0x5f0a43(0x90)),![];const _0xa6e0=_0xb0d6f8['GwDRr'](existsSync,_0xb0d6f8[_0x5f0a43(0x99)](join,_0xb0d6f8['wFeJO'](getProjectRoot),'.claude'));let _0x2767e9;if(_0x3a773c)_0x2767e9=_0x3a773c;else{if(_0xa6e0)_0x2767e9=_0xb0d6f8['CpQvb'];else{console['log'](_0xb0d6f8[_0x5f0a43(0x89)]);const _0x235957=await _0x564ba9['prompt']([{'type':_0x5f0a43(0x8a),'name':'pluginScope','message':_0x5f0a43(0xb7),'choices':[{'name':_0xb0d6f8[_0x5f0a43(0x9b)],'value':'user'},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':_0xb0d6f8[_0x5f0a43(0x9c)]}],'default':_0xb0d6f8['NFnYE']}]);_0x2767e9=_0x235957['pluginScope'];}}console[_0x5f0a43(0xa6)]('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x2767e9+_0x5f0a43(0x94));const _0x115966=await _0xb0d6f8['KNMDH'](isMarketplaceAdded,'trailhead');let _0x5e8327=_0x115966;if(_0x115966)console['log'](_0xb0d6f8[_0x5f0a43(0xa7)]);else{const _0x488dfd=await _0xb0d6f8[_0x5f0a43(0x8d)](runClaudeCommand,[_0x5f0a43(0xa9),'marketplace',_0x5f0a43(0xac),_0xb0d6f8['VmDoE']]);!_0x488dfd['success']?(console[_0x5f0a43(0x96)](_0xb0d6f8['xAmEg'],_0x488dfd[_0x5f0a43(0x96)]),console[_0x5f0a43(0xa6)](_0xb0d6f8[_0x5f0a43(0x9f)]),console[_0x5f0a43(0xa6)](_0xb0d6f8[_0x5f0a43(0xb1)]),console[_0x5f0a43(0xa6)]('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x2767e9)):_0x5e8327=!![];}if(_0x5e8327){const _0x2358fb=await _0xb0d6f8['vgmxj'](runClaudeCommand,[_0xb0d6f8['hajIn'],_0x5f0a43(0x8e),_0xb0d6f8['TuFJe'],'--scope',_0x2767e9],{'cwd':_0xb0d6f8[_0x5f0a43(0x98)](_0x2767e9,'project')?_0xb0d6f8[_0x5f0a43(0x8b)](getProjectRoot):undefined});if(!_0x2358fb[_0x5f0a43(0x88)])console['error']('❌\x20Failed\x20to\x20install\x20plugin:',_0x2358fb[_0x5f0a43(0x96)]),console['log'](_0xb0d6f8['wnFzP']),console[_0x5f0a43(0xa6)]('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x2767e9);else{console[_0x5f0a43(0xa6)](_0xb0d6f8['chviC']);const _0x5db97e=['plugin',_0x5f0a43(0xad),_0xb0d6f8[_0x5f0a43(0x85)]];_0xb0d6f8[_0x5f0a43(0x98)](_0x2767e9,_0xb0d6f8[_0x5f0a43(0x9c)])&&_0x5db97e[_0x5f0a43(0xa4)](_0xb0d6f8['xDWvO'],_0xb0d6f8[_0x5f0a43(0x9c)]);const _0x4fe353=await runClaudeCommand(_0x5db97e,{'captureOutput':!![],'cwd':_0x2767e9===_0x5f0a43(0xaa)?getProjectRoot():undefined}),_0x40b122=_0x4fe353['output']?.['includes'](_0xb0d6f8[_0x5f0a43(0xb2)]);!_0x4fe353[_0x5f0a43(0x88)]&&!_0x40b122?console[_0x5f0a43(0x96)](_0x5f0a43(0x8f),_0x4fe353[_0x5f0a43(0x96)]):console['log'](_0x5f0a43(0x86));}}return!![];}export async function ensureClaudeSkills(_0x2bc77c){const _0x160256=_0x765a,_0x3ed0eb={'ZqVsy':function(_0x2fe6e1,_0x8cdccb){return _0x2fe6e1(_0x8cdccb);},'suhTv':function(_0x3de0a1,_0x8a055d){return _0x3de0a1(_0x8a055d);},'qUbTZ':'ranger','jDhYo':function(_0x85a515,_0x312b6f){return _0x85a515(_0x312b6f);},'IaNPx':_0x160256(0xaa),'rSSQt':'SKILL.md','rbfGn':function(_0x5ca50b,_0x24734a,_0x4b8d99){return _0x5ca50b(_0x24734a,_0x4b8d99);},'ENiSl':'.claude','NEojF':function(_0x309e1b,_0x43e38a){return _0x309e1b(_0x43e38a);},'lJtOv':_0x160256(0x87),'EYhfh':_0x160256(0xa1)},_0x10304e=_0x3ed0eb[_0x160256(0x9e)](existsSync,join(_0x3ed0eb[_0x160256(0xb4)](getSkillsDir,'user'),_0x3ed0eb[_0x160256(0x83)],_0x160256(0xb9))),_0x31ac96=_0x3ed0eb['jDhYo'](existsSync,join(_0x3ed0eb['ZqVsy'](getSkillsDir,_0x3ed0eb['IaNPx']),'ranger',_0x3ed0eb['rSSQt']));if(_0x10304e||_0x31ac96)return console['log'](_0x160256(0xb3)),![];const _0x20fb1e=existsSync(_0x3ed0eb[_0x160256(0xba)](join,getProjectRoot(),_0x3ed0eb[_0x160256(0xb5)]));let _0xa76b3=!![];if(_0x2bc77c)await _0x3ed0eb[_0x160256(0x8c)](skillup,{'autoInstall':_0x2bc77c,'suppressUsage':!![]});else{if(_0x20fb1e)await _0x3ed0eb[_0x160256(0x8c)](skillup,{'autoInstall':_0x3ed0eb['IaNPx'],'suppressUsage':!![]});else{const _0x496a8c=await _0x564ba9[_0x160256(0x92)]([{'type':_0x3ed0eb[_0x160256(0xaf)],'name':_0x160256(0xa3),'message':_0x3ed0eb[_0x160256(0x97)],'default':!![]}]);_0xa76b3=_0x496a8c['wantsSkillup'],_0xa76b3&&await _0x3ed0eb['ZqVsy'](skillup,{'suppressUsage':!![]});}}return _0xa76b3;}
|