@ranger-testing/ranger-cli 2.5.3 → 2.5.4-alpha.ed286f1-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/setup/claude.js +1 -1
- package/build/commands/setup/opencode.js +1 -1
- package/build/commands/setupCi.js +1 -1
- package/build/commands/skillup.js +1 -1
- package/build/commands/start.js +1 -1
- package/build/commands/status.js +1 -1
- package/build/commands/update.js +1 -1
- package/build/commands/updateEnv.js +1 -1
- package/build/commands/useEnv.js +1 -1
- package/build/commands/utils/activeProfile.js +1 -1
- package/build/commands/utils/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/opencodeConfig.js +1 -1
- package/build/commands/utils/playwrightCli.js +1 -1
- package/build/commands/utils/profileMessages.js +1 -1
- package/build/commands/utils/profileSetupBanner.js +1 -1
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/retry.js +1 -1
- package/build/commands/utils/sessionCache.js +1 -1
- package/build/commands/utils/settings.js +1 -1
- package/build/commands/utils/skillContent.js +1 -1
- package/build/commands/utils/skills.js +1 -1
- package/build/commands/utils/stitchWebmFiles.js +1 -1
- package/build/commands/utils/telemetry.js +1 -1
- package/build/commands/utils/tokenRefresh.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -1
- package/build/commands/utils/userApi.js +1 -1
- package/build/commands/utils/version.js +1 -1
- package/build/commands/verifyFeature.js +1 -1
- package/build/commands/verifyFeatureCli.js +1 -1
- package/package.json +6 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function _0x2c7e(){const _0x1bf04b=['1053jNGVqN','929420jflXhu','63oYMBND','===\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===','1105170IDfsgU','11VJjGPY','56QTUUWR','245TREczk','179120HjNuId','780296yxqwAG','1890fRSyDL','stYaY','81436zkqivD','1302060bPzhTw'];_0x2c7e=function(){return _0x1bf04b;};return _0x2c7e();}function _0x3358(_0x5a9445,_0x21615c){_0x5a9445=_0x5a9445-0xe8;const _0x2c7ee8=_0x2c7e();let _0x335822=_0x2c7ee8[_0x5a9445];return _0x335822;}(function(_0x18611b,_0x3cf06b){const _0x543260=_0x3358,_0x50b685=_0x18611b();while(!![]){try{const _0x2fe682=parseInt(_0x543260(0xea))/0x1+parseInt(_0x543260(0xeb))/0x2*(parseInt(_0x543260(0xef))/0x3)+parseInt(_0x543260(0xed))/0x4*(-parseInt(_0x543260(0xe8))/0x5)+-parseInt(_0x543260(0xf3))/0x6+-parseInt(_0x543260(0xf5))/0x7*(parseInt(_0x543260(0xe9))/0x8)+-parseInt(_0x543260(0xf1))/0x9*(-parseInt(_0x543260(0xf0))/0xa)+parseInt(_0x543260(0xf4))/0xb*(parseInt(_0x543260(0xee))/0xc);if(_0x2fe682===_0x3cf06b)break;else _0x50b685['push'](_0x50b685['shift']());}catch(_0x445463){_0x50b685['push'](_0x50b685['shift']());}}}(_0x2c7e,0x7c8e8));import{printBlock,getEnabledSessionId}from'./output.js';export async function planStart(_0x12e197){const _0x29e851=_0x3358,_0x46b989={'stYaY':function(_0x92d62d,_0x11219b){return _0x92d62d(_0x11219b);}},_0x55df9e=await _0x46b989['stYaY'](getEnabledSessionId,_0x12e197);if(!_0x55df9e)return;_0x46b989[_0x29e851(0xec)](printBlock,_0x29e851(0xf2));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1816ed,_0x16ad2d){const _0x33c830=_0x1b3a,_0x205d66=_0x1816ed();while(!![]){try{const _0x4a8e11=-parseInt(_0x33c830(0x1f2))/0x1*(parseInt(_0x33c830(0x1fe))/0x2)+parseInt(_0x33c830(0x1f5))/0x3*(-parseInt(_0x33c830(0x1fb))/0x4)+-parseInt(_0x33c830(0x1f7))/0x5+-parseInt(_0x33c830(0x1fc))/0x6+parseInt(_0x33c830(0x1fd))/0x7+parseInt(_0x33c830(0x1f3))/0x8*(parseInt(_0x33c830(0x1f9))/0x9)+-parseInt(_0x33c830(0x1f4))/0xa*(-parseInt(_0x33c830(0x1f8))/0xb);if(_0x4a8e11===_0x16ad2d)break;else _0x205d66['push'](_0x205d66['shift']());}catch(_0x1881f7){_0x205d66['push'](_0x205d66['shift']());}}}(_0xe8f6,0x5a0a7));function _0x1b3a(_0x22929e,_0x25d608){_0x22929e=_0x22929e-0x1f2;const _0xe8f673=_0xe8f6();let _0x1b3ae0=_0xe8f673[_0x22929e];return _0x1b3ae0;}import{getSessionEntry,updateBranchTracking}from'../utils/sessionCache.js';function _0xe8f6(){const _0x3f4ede=['249910FtzNog','618ipsWFe','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).','1550365EelZIk','649lohngJ','128691rnBVMv','PostToolUse','4748KmNoZQ','3913836aHlAqX','4265835rKgItD','106CfbHyt','10937pzNRxE','40VpMKNG'];_0xe8f6=function(){return _0x3f4ede;};return _0xe8f6();}import{getToken}from'../utils/keychain.js';import{getEnabledSessionId}from'./output.js';export async function postEdit(_0x24c47f){const _0x3d76b0=_0x1b3a,_0x235429={'KSFwH':_0x3d76b0(0x1fa)},_0x5f5439=await getEnabledSessionId(_0x24c47f);if(!_0x5f5439)return;updateBranchTracking(_0x5f5439);const _0x2e693e=await getToken();if(!_0x2e693e)return;const _0x2f3956=getSessionEntry(_0x5f5439);if(_0x2f3956){const _0x51668d={'hookSpecificOutput':{'hookEventName':_0x3d76b0(0x1fa),'additionalContext':_0x3d76b0(0x1f6)}};console['log'](JSON['stringify'](_0x51668d));return;}const _0x356d27={'hookSpecificOutput':{'hookEventName':_0x235429['KSFwH'],'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['log'](JSON['stringify'](_0x356d27));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5928b2,_0x596371){const _0x54381e=_0x239f,_0x142946=_0x5928b2();while(!![]){try{const _0x3badb5=parseInt(_0x54381e(0x14e))/0x1*(parseInt(_0x54381e(0x149))/0x2)+parseInt(_0x54381e(0x14d))/0x3*(parseInt(_0x54381e(0x14a))/0x4)+parseInt(_0x54381e(0x151))/0x5+-parseInt(_0x54381e(0x14b))/0x6*(-parseInt(_0x54381e(0x154))/0x7)+parseInt(_0x54381e(0x14f))/0x8*(-parseInt(_0x54381e(0x152))/0x9)+parseInt(_0x54381e(0x150))/0xa*(-parseInt(_0x54381e(0x153))/0xb)+-parseInt(_0x54381e(0x14c))/0xc;if(_0x3badb5===_0x596371)break;else _0x142946['push'](_0x142946['shift']());}catch(_0x22f6da){_0x142946['push'](_0x142946['shift']());}}}(_0x35d0,0xb30e0));import{getToken}from'../utils/keychain.js';function _0x35d0(){const _0x26081c=['2453YJVqkD','7WcMpbv','8zhboDU','4fLuFSb','6614220jcGnwZ','6811992LakOxm','185589GuaSXg','322819rowCxm','8CHlcvg','48560xgDBTY','4751055jLtIeN','9195822IdUbGL'];_0x35d0=function(){return _0x26081c;};return _0x35d0();}import{printBlock,getEnabledSessionId}from'./output.js';function _0x239f(_0x397304,_0x31730b){_0x397304=_0x397304-0x149;const _0x35d0f4=_0x35d0();let _0x239f87=_0x35d0f4[_0x397304];return _0x239f87;}export async function preCompact(_0x2a5dd9){const _0x16c781={'gNWLL':function(_0x90ac4d){return _0x90ac4d();}},_0x2d4323=await getEnabledSessionId(_0x2a5dd9);if(!_0x2d4323)return;try{const _0x481f7d=await _0x16c781['gNWLL'](getToken);if(!_0x481f7d)return;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
|
-
|
|
1
|
+
(function(_0x5095ec,_0x2ceb13){const _0x47e5c2=_0x151a,_0x5f21a8=_0x5095ec();while(!![]){try{const _0x453ae7=-parseInt(_0x47e5c2(0x16e))/0x1+-parseInt(_0x47e5c2(0x168))/0x2+-parseInt(_0x47e5c2(0x16c))/0x3+-parseInt(_0x47e5c2(0x167))/0x4+parseInt(_0x47e5c2(0x169))/0x5+parseInt(_0x47e5c2(0x16f))/0x6*(-parseInt(_0x47e5c2(0x164))/0x7)+parseInt(_0x47e5c2(0x166))/0x8*(parseInt(_0x47e5c2(0x16b))/0x9);if(_0x453ae7===_0x2ceb13)break;else _0x5f21a8['push'](_0x5f21a8['shift']());}catch(_0x5280a7){_0x5f21a8['push'](_0x5f21a8['shift']());}}}(_0x89ae,0xe7600));import{isSessionEnabled,recordEnabledSessionCleared}from'../utils/sessionCache.js';import{readHookInput}from'./output.js';function _0x151a(_0x316181,_0x148aab){_0x316181=_0x316181-0x164;const _0x89ae5b=_0x89ae();let _0x151a74=_0x89ae5b[_0x316181];return _0x151a74;}function _0x89ae(){const _0x1bef60=['1029934VIRgBe','7097058oUpnyZ','clear','7wgFASG','sZuVf','5176YwbgdD','449712hngqup','3515072bRZThx','1465930oLsYKv','env','88497JSxIMd','4874052nWsXHt','reason'];_0x89ae=function(){return _0x1bef60;};return _0x89ae();}export async function sessionEnd(_0xb208b5){const _0xdd7332=_0x151a,_0x2098e8={'GskhL':function(_0x924570,_0x15abdc){return _0x924570===_0x15abdc;},'sZuVf':function(_0x486e79,_0x40f402){return _0x486e79(_0x40f402);}},_0x396531=process[_0xdd7332(0x16a)]['CLAUDE_SESSION_ID'];let _0x1c5fdf=_0xb208b5,_0xf1d573;if(!_0xb208b5){if(_0x396531&&!isSessionEnabled(_0x396531))return;const _0x2f041c=await readHookInput();_0x1c5fdf=_0x2f041c?.['session_id']||_0x396531,_0xf1d573=_0x2f041c?.[_0xdd7332(0x16d)];}if(!_0x1c5fdf)return;_0x2098e8['GskhL'](_0xf1d573,_0xdd7332(0x170))&&_0x2098e8[_0xdd7332(0x165)](recordEnabledSessionCleared,_0x1c5fdf);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function _0x18ab(){const _0x33be06=['session_id','3222184GEfgFK','master','\x20(Branch:\x20','445782yPtUbX','SessionStart','1152912tJRNmH','ApZYR','hiYvH','3339486NMhkUJ','2CqntQX','log','42452pCUrzv','hook:session-start','qXGfK','482993OiHbIn','Hquxj','MEDTV','hZomj','1511920DyOJae','20XZxdMX','ZxKUU','stdin','UeCnz','parse','main'];_0x18ab=function(){return _0x33be06;};return _0x18ab();}(function(_0x13bedf,_0x31ae43){const _0x2f9d5f=_0x576e,_0x536c80=_0x13bedf();while(!![]){try{const _0x43b3d0=parseInt(_0x2f9d5f(0xd8))/0x1*(parseInt(_0x2f9d5f(0xd6))/0x2)+-parseInt(_0x2f9d5f(0xd2))/0x3+parseInt(_0x2f9d5f(0xdf))/0x4+parseInt(_0x2f9d5f(0xe0))/0x5*(parseInt(_0x2f9d5f(0xd0))/0x6)+-parseInt(_0x2f9d5f(0xdb))/0x7+-parseInt(_0x2f9d5f(0xcd))/0x8+parseInt(_0x2f9d5f(0xd5))/0x9;if(_0x43b3d0===_0x31ae43)break;else _0x536c80['push'](_0x536c80['shift']());}catch(_0xb97409){_0x536c80['push'](_0x536c80['shift']());}}}(_0x18ab,0x38c96));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';function _0x576e(_0x2be64b,_0x35bed2){_0x2be64b=_0x2be64b-0xc7;const _0x18abdf=_0x18ab();let _0x576ef4=_0x18abdf[_0x2be64b];return _0x576ef4;}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(_0x1a813c){const _0x3196b8=_0x576e,_0x13d04f={'ZxKUU':function(_0xdfe296,_0x55f5ef){return _0xdfe296||_0x55f5ef;},'pGPUw':'source','hGJps':function(_0x1470fa,_0x182ce0){return _0x1470fa&&_0x182ce0;},'UeCnz':function(_0x18d21b,_0x1ee898,_0xfcbcc0){return _0x18d21b(_0x1ee898,_0xfcbcc0);},'haCHO':function(_0x315d56){return _0x315d56();},'enhwM':function(_0x61ae91,_0x2b8904){return _0x61ae91(_0x2b8904);},'MEDTV':function(_0x3d0556,_0x10994a){return _0x3d0556(_0x10994a);},'Hquxj':_0x3196b8(0xd9),'qXGfK':'success','MpiZb':function(_0x2fa0cd){return _0x2fa0cd();},'bEBJo':function(_0x501932,_0x5d296b){return _0x501932!==_0x5d296b;},'hZomj':_0x3196b8(0xcb),'ApZYR':_0x3196b8(0xce),'hiYvH':function(_0x38affd,_0x3d2863){return _0x38affd+_0x3d2863;}};let _0x11134d=_0x13d04f[_0x3196b8(0xc7)](_0x1a813c,''),_0xd03c2c;if(!_0x1a813c){let _0x517dae='';for await(const _0x2a6cf6 of process[_0x3196b8(0xc8)]){_0x517dae+=_0x2a6cf6;}try{const _0x4522b5=JSON[_0x3196b8(0xca)](_0x517dae);_0x11134d=_0x4522b5[_0x3196b8(0xcc)]||'',_0xd03c2c=_0x4522b5[_0x13d04f['pGPUw']];}catch{}const _0x5b9d20=process['env']['CLAUDE_ENV_FILE'];if(_0x13d04f['hGJps'](_0x5b9d20,_0x11134d))try{await _0x13d04f[_0x3196b8(0xc9)](appendFile,_0x5b9d20,'export\x20CLAUDE_SESSION_ID=\x22'+_0x11134d+'\x22\x0a');}catch{}}try{await _0x13d04f['haCHO'](getToken);}catch{}if(_0x11134d){_0x13d04f['enhwM'](shouldAutoEnableAfterClear,_0xd03c2c)&&_0x13d04f[_0x3196b8(0xdd)](autoEnableAfterClear,_0x11134d);initBranchTracking(_0x11134d);const _0x5d8a48=_0x13d04f[_0x3196b8(0xdd)](isSessionEnabled,_0x11134d);try{const _0x1f9d5e=createTelemetryCollector(_0x13d04f[_0x3196b8(0xdc)]);await _0x1f9d5e['trackCommandStart']({'sessionId':_0x11134d,'hooksEnabled':_0x5d8a48}),await _0x1f9d5e['trackCommandEnd'](_0x13d04f[_0x3196b8(0xda)]);}catch{}if(_0x5d8a48){const _0x3a18a8=_0x13d04f['MpiZb'](getCurrentBranch),_0x9cc93d=_0x3a18a8&&_0x13d04f['bEBJo'](_0x3a18a8,_0x13d04f[_0x3196b8(0xde)])&&_0x3a18a8!==_0x13d04f[_0x3196b8(0xd3)]?_0x3196b8(0xcf)+_0x3a18a8+')':'',_0x595928={'hookSpecificOutput':{'hookEventName':_0x3196b8(0xd1),'additionalContext':_0x13d04f[_0x3196b8(0xd4)](RANGER_AUTO_ENABLED_PROMPT,_0x9cc93d)}};console[_0x3196b8(0xd7)](JSON['stringify'](_0x595928));}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2f0e51,_0x2fe5ef){const _0x6aa6b=_0x5b85,_0xd1003c=_0x2f0e51();while(!![]){try{const _0x4c11d1=-parseInt(_0x6aa6b(0x1ba))/0x1+parseInt(_0x6aa6b(0x1cd))/0x2+-parseInt(_0x6aa6b(0x1bd))/0x3+parseInt(_0x6aa6b(0x1c6))/0x4*(-parseInt(_0x6aa6b(0x1b9))/0x5)+-parseInt(_0x6aa6b(0x1b3))/0x6*(-parseInt(_0x6aa6b(0x1b5))/0x7)+parseInt(_0x6aa6b(0x1b8))/0x8*(parseInt(_0x6aa6b(0x1c1))/0x9)+parseInt(_0x6aa6b(0x1b7))/0xa*(parseInt(_0x6aa6b(0x1b4))/0xb);if(_0x4c11d1===_0x2fe5ef)break;else _0xd1003c['push'](_0xd1003c['shift']());}catch(_0xc8660){_0xd1003c['push'](_0xd1003c['shift']());}}}(_0x1e48,0x56299));function _0x1e48(){const _0xfc841e=['123052EEmjKu','sessionId','featureId','1302654bjtyJQ','filter','closed','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','5925564iakogN','some','incomplete','status','stringify','2555428zMrldZ','blocked','log','currentSessionId','success','nwadr','checklistItems','258156Psmsnu','6KwFVXa','2124023wjmIIR','3979367gcEyYh','verified','10nkTwnz','8GbTqJD','5LfEDTq'];_0x1e48=function(){return _0xfc841e;};return _0x1e48();}import{getToken}from'../utils/keychain.js';import{getFeature,concludeSession}from'../utils/featureApi.js';import{getSessionEntry,shouldShowStopReminder}from'../utils/sessionCache.js';import{getEnabledHookContext}from'./output.js';import{createTelemetryCollector}from'../utils/telemetry.js';export async function stopHook(_0x166a56){const _0x4da24e=_0x5b85,_0x1f0c07={'oQNNB':function(_0x3602ff,_0x5debfa,_0x2d74e4,_0x47f30e){return _0x3602ff(_0x5debfa,_0x2d74e4,_0x47f30e);},'VhcsW':function(_0x2315a9,_0x352dec){return _0x2315a9(_0x352dec);},'ivCfr':function(_0x22211c,_0x122f2c,_0x150e1b){return _0x22211c(_0x122f2c,_0x150e1b);}},_0x2eacdb=await getEnabledHookContext(_0x166a56),_0xed4c29=_0x2eacdb?.['sessionId']??null;let _0x5bb9c6=!![];if(!_0xed4c29){await trackStop(_0xed4c29,![],_0x5bb9c6);return;}try{const _0x27eeb8=getSessionEntry(_0xed4c29);if(!_0x27eeb8){await _0x1f0c07['oQNNB'](trackStop,_0xed4c29,!![],_0x5bb9c6);return;}const _0xedf1f=await getToken(),_0x7798d1='https://dashboard.ranger.net/features/'+_0x27eeb8[_0x4da24e(0x1bc)];let _0x4dfac7=null,_0x15da9c=![],_0x4b28c3=![];if(_0xedf1f)try{const _0xb260d1=await _0x1f0c07['VhcsW'](getFeature,_0x27eeb8[_0x4da24e(0x1bc)]);_0x4dfac7=_0xb260d1[_0x4da24e(0x1c9)]??null;const _0x288444=_0xb260d1[_0x4da24e(0x1cc)][_0x4da24e(0x1be)](_0x34a72d=>_0x34a72d[_0x4da24e(0x1bb)]===_0x4dfac7);_0x15da9c=_0x288444[_0x4da24e(0x1c2)](_0x39fc18=>_0x39fc18['status']!==_0x4da24e(0x1b6)&&_0x39fc18['status']!==_0x4da24e(0x1c7)&&_0x39fc18['status']!==_0x4da24e(0x1bf)&&_0x39fc18[_0x4da24e(0x1c4)]!==_0x4da24e(0x1c3)),_0x4b28c3=_0x288444['some'](_0x4bdd87=>_0x4bdd87[_0x4da24e(0x1c4)]==='verification_in_progress');}catch{}if(_0xedf1f&&_0x4dfac7&&_0x15da9c){if(!_0x4b28c3&&shouldShowStopReminder(_0xed4c29)){const _0xb2845={'hookSpecificOutput':{'hookEventName':'Stop','additionalContext':_0x4da24e(0x1c0)+_0x7798d1}};console[_0x4da24e(0x1c8)](JSON[_0x4da24e(0x1c5)](_0xb2845));}}if(_0xedf1f&&_0x4dfac7&&!_0x15da9c)try{await _0x1f0c07['ivCfr'](concludeSession,_0x27eeb8['featureId'],_0x4dfac7);}catch{}await _0x1f0c07['oQNNB'](trackStop,_0xed4c29,!![],_0x5bb9c6);return;}catch{await trackStop(_0xed4c29,!![],_0x5bb9c6);return;}}function _0x5b85(_0x22c4ae,_0x568e14){_0x22c4ae=_0x22c4ae-0x1b3;const _0x1e48f2=_0x1e48();let _0x5b8526=_0x1e48f2[_0x22c4ae];return _0x5b8526;}async function trackStop(_0x762a7e,_0x2cf488,_0x42b5b2){const _0x31815f=_0x5b85,_0x45b75c={'nwadr':function(_0x1c710c,_0x14ee04){return _0x1c710c(_0x14ee04);},'QCLyE':'hook:stop','CoJCN':function(_0x4929a2,_0x1c14fd){return _0x4929a2??_0x1c14fd;}};try{const _0x4824fb=_0x45b75c[_0x31815f(0x1cb)](createTelemetryCollector,_0x45b75c['QCLyE']);await _0x4824fb['trackCommandStart']({'sessionId':_0x45b75c['CoJCN'](_0x762a7e,undefined),'hooksEnabled':_0x2cf488,'stopAllowed':_0x42b5b2}),await _0x4824fb['trackCommandEnd'](_0x31815f(0x1ca));}catch{}}
|
package/build/commands/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x450001,_0x24af0f){var _0x4d34fc=_0x35e9,_0x461fe5=_0x450001();while(!![]){try{var _0x356c69=parseInt(_0x4d34fc(0x13c))/0x1*(parseInt(_0x4d34fc(0x13f))/0x2)+-parseInt(_0x4d34fc(0x141))/0x3+parseInt(_0x4d34fc(0x142))/0x4+parseInt(_0x4d34fc(0x140))/0x5+parseInt(_0x4d34fc(0x144))/0x6*(-parseInt(_0x4d34fc(0x13d))/0x7)+-parseInt(_0x4d34fc(0x143))/0x8*(-parseInt(_0x4d34fc(0x13b))/0x9)+-parseInt(_0x4d34fc(0x13e))/0xa;if(_0x356c69===_0x24af0f)break;else _0x461fe5['push'](_0x461fe5['shift']());}catch(_0x3cf51a){_0x461fe5['push'](_0x461fe5['shift']());}}}(_0x585a,0x89ef7));export{addEnv}from'./addEnv.js';function _0x35e9(_0x2be673,_0x55494e){_0x2be673=_0x2be673-0x13b;var _0x585a1b=_0x585a();var _0x35e956=_0x585a1b[_0x2be673];return _0x35e956;}function _0x585a(){var _0x4b43aa=['2141004zxiRty','88RALoIJ','402GTlONw','810801ZtILcE','339QTIJuT','14532XwfyTs','4759730ZwzwsR','3426KutbMu','704800kjJiKI','3203547NpPGez'];_0x585a=function(){return _0x4b43aa;};return _0x585a();}export{clean}from'./clean.js';export{login}from'./login.js';export{start,ensureLocalEnv,ensureChromium,authenticate}from'./start.js';export{useEnv}from'./useEnv.js';export{updateEnv}from'./updateEnv.js';export{update}from'./update.js';export{skillup}from'./skillup.js';export{envList}from'./env.js';export{hook}from'./hook.js';export{setupCi}from'./setupCi.js';
|
package/build/commands/login.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x78b54f,_0xbe80ba){const _0x2c34a3=_0x2879,_0x50de8b=_0x78b54f();while(!![]){try{const _0x1b3efb=-parseInt(_0x2c34a3(0x16b))/0x1*(parseInt(_0x2c34a3(0x164))/0x2)+-parseInt(_0x2c34a3(0x169))/0x3*(-parseInt(_0x2c34a3(0x160))/0x4)+parseInt(_0x2c34a3(0x167))/0x5*(parseInt(_0x2c34a3(0x16f))/0x6)+parseInt(_0x2c34a3(0x161))/0x7*(-parseInt(_0x2c34a3(0x166))/0x8)+-parseInt(_0x2c34a3(0x16c))/0x9+parseInt(_0x2c34a3(0x165))/0xa+parseInt(_0x2c34a3(0x16e))/0xb;if(_0x1b3efb===_0xbe80ba)break;else _0x50de8b['push'](_0x50de8b['shift']());}catch(_0xad3dcb){_0x50de8b['push'](_0x50de8b['shift']());}}}(_0x2407,0xbb9d4));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';export async function login(){const _0x2f0120=_0x2879,_0x366e58={'EZFrV':function(_0xfaa352){return _0xfaa352();},'aKgwr':'Re-authenticating\x20via\x20MCP\x20bootstrap...','xJsrt':'\x0a✅\x20API\x20key\x20stored\x20successfully'},_0xac3d61=await _0x366e58[_0x2f0120(0x172)](getMcpAuthOrigin);if(_0xac3d61){console['log'](_0x366e58['aKgwr']),await mcpBootstrap();return;}const _0x1c6f7f=process[_0x2f0120(0x168)][_0x2f0120(0x16d)]&&process[_0x2f0120(0x162)][_0x2f0120(0x16d)];if(!_0x1c6f7f)throw new Error(_0x2f0120(0x171));try{const _0x5ded07=await runDeviceAuthFlow(),_0x48898e=await getCurrentUser(_0x5ded07);_0x48898e['success']?console['log']('\x0a✅\x20Logged\x20in\x20to\x20'+_0x48898e['user']['organizationName']):console[_0x2f0120(0x16a)](_0x366e58[_0x2f0120(0x163)]);}catch(_0x164095){throw new Error('Login\x20failed:\x20'+(_0x164095 instanceof Error?_0x164095[_0x2f0120(0x170)]:_0x164095));}}function _0x2879(_0x49b9e2,_0x30adb6){_0x49b9e2=_0x49b9e2-0x160;const _0x2407e0=_0x2407();let _0x287996=_0x2407e0[_0x49b9e2];return _0x287996;}function _0x2407(){const _0x1f4a86=['Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','EZFrV','160eWZXYw','14nRpSwd','stdout','xJsrt','668290vTAOvQ','2166160GGwzAp','5472784ZvGbhs','1060gbJpRS','stdin','65640ZaSNBJ','log','1NNkxfL','3391623eOrZJV','isTTY','16912280RPDeOu','6180iFydKB','message'];_0x2407=function(){return _0x1f4a86;};return _0x2407();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x3fb461=_0x3289;(function(_0x47448d,_0x1f1c3f){const _0xfc5846=_0x3289,_0x500530=_0x47448d();while(!![]){try{const _0x5e06ef=parseInt(_0xfc5846(0x1b3))/0x1*(parseInt(_0xfc5846(0x168))/0x2)+-parseInt(_0xfc5846(0x14c))/0x3+parseInt(_0xfc5846(0x16a))/0x4*(-parseInt(_0xfc5846(0x187))/0x5)+parseInt(_0xfc5846(0x155))/0x6+parseInt(_0xfc5846(0x1a8))/0x7+parseInt(_0xfc5846(0x1ad))/0x8+-parseInt(_0xfc5846(0x165))/0x9;if(_0x5e06ef===_0x1f1c3f)break;else _0x500530['push'](_0x500530['shift']());}catch(_0x38238e){_0x500530['push'](_0x500530['shift']());}}}(_0xd261,0xcde64));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger',_0x3fb461(0x1b8)),AUTH_ORIGIN_PATH=join(homedir(),'.ranger',_0x3fb461(0x172));export async function getMcpAuthOrigin(){const _0x180037=_0x3fb461,_0x4af3f0={'dWtet':function(_0x3d1865,_0x397a95,_0x306d94){return _0x3d1865(_0x397a95,_0x306d94);},'PxuvI':_0x180037(0x169),'CARBB':function(_0x28ca8e,_0x5b8d67){return _0x28ca8e||_0x5b8d67;}};try{const _0x35af29=(await _0x4af3f0['dWtet'](readFile,AUTH_ORIGIN_PATH,_0x4af3f0['PxuvI']))['trim']();return _0x4af3f0[_0x180037(0x184)](_0x35af29,null);}catch{return null;}}export async function mcpBootstrap(){const _0x201e20=_0x3fb461,_0x1cef3f={'etDqC':function(_0x57720f,_0x5b16a1){return _0x57720f===_0x5b16a1;},'whERK':_0x201e20(0x126),'FrPPn':function(_0x336ad4){return _0x336ad4();},'GvvEh':_0x201e20(0x17c),'kZnkx':'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','vLkwF':function(_0x2cc320,_0x1de48f){return _0x2cc320(_0x1de48f);}},_0x1709b5=getMcpAuthUrl();currentOrigin=_0x1709b5;const _0x12516b=process[_0x201e20(0x173)]['isTTY']??![];console[_0x201e20(0x13f)](_0x201e20(0x141)+_0x1709b5+'\x0a');const _0x2166e1=await tryUnauthenticated(_0x1709b5);let _0x1837de=null;if(_0x1cef3f['etDqC'](_0x2166e1,_0x1cef3f['whERK']))_0x1837de='';else{_0x1837de=await _0x1cef3f[_0x201e20(0x129)](loadCachedToken);if(!_0x1837de){if(!_0x12516b)throw new Error(_0x1cef3f['GvvEh']+_0x1cef3f['kZnkx']);_0x1837de=await _0x1cef3f[_0x201e20(0x144)](oauthFlow,_0x1709b5);}}await callGetCliToken(_0x1709b5,_0x1837de);}async function tryUnauthenticated(_0x372326){const _0x5485d1=_0x3fb461,_0x198242={'UoNuv':'application/json,\x20text/event-stream','thrPE':'2.0','dfuQg':_0x5485d1(0x12c),'OJhCJ':function(_0xbc3160,_0x46eac8){return _0xbc3160===_0x46eac8;},'Vgwfv':_0x5485d1(0x134)},_0x5998a8=await fetch(_0x372326,{'method':_0x5485d1(0x18d),'headers':{'Content-Type':'application/json','Accept':_0x198242[_0x5485d1(0x127)]},'body':JSON[_0x5485d1(0x130)]({'jsonrpc':_0x198242['thrPE'],'id':0x1,'method':'initialize','params':{'protocolVersion':_0x198242['dfuQg'],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x5485d1(0x159)}}})});if(_0x5998a8['ok'])return await _0x5998a8[_0x5485d1(0x167)](),_0x5485d1(0x126);if(_0x198242['OJhCJ'](_0x5998a8['status'],0x191))return await _0x5998a8[_0x5485d1(0x167)](),_0x198242['Vgwfv'];const _0x489ef4=await _0x5998a8['text']();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x5998a8[_0x5485d1(0x1b9)]+':\x20'+_0x489ef4);}class OAuthTimeoutError extends Error{constructor(_0x28b024){const _0x136319=_0x3fb461,_0x27ef20={'buMLb':'OAuthTimeoutError'};super(_0x28b024),this[_0x136319(0x1af)]=_0x27ef20['buMLb'];}}function _0x3289(_0x39b231,_0x473a03){_0x39b231=_0x39b231-0x122;const _0xd261e1=_0xd261();let _0x328923=_0xd261e1[_0x39b231];return _0x328923;}async function oauthFlow(_0xf9ef18){const _0x3e05ea=_0x3fb461,_0x4a77ef={'fPOfg':function(_0x48c8c9,_0x402689){return _0x48c8c9 instanceof _0x402689;},'vVFpf':function(_0xd4a76){return _0xd4a76();}};try{return await oauthFlowAttempt(_0xf9ef18);}catch(_0x4839c3){if(_0x4a77ef[_0x3e05ea(0x14e)](_0x4839c3,OAuthTimeoutError)&&await _0x4a77ef[_0x3e05ea(0x145)](loadCachedClient))return console['log'](_0x3e05ea(0x13a)),await _0x4a77ef[_0x3e05ea(0x145)](clearCachedClient),await oauthFlowAttempt(_0xf9ef18);throw _0x4839c3;}}async function oauthFlowAttempt(_0x29dc66){const _0x4b598f=_0x3fb461,_0x460e2b={'qVxLy':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','FuZvq':function(_0x29562b,_0x5bb977,_0x4b3791){return _0x29562b(_0x5bb977,_0x4b3791);},'jsJcl':_0x4b598f(0x162),'EhVhN':'authorization_code','cmupw':_0x4b598f(0x137),'FbkPu':function(_0x53b9c1,_0x292d14){return _0x53b9c1(_0x292d14);},'Meypb':'base64url','DuMWF':'sha256','Tlaqf':'code','kImaM':'client_id','LsNpx':_0x4b598f(0x178),'OSDOz':_0x4b598f(0x1ab),'EyEYi':function(_0x75a3b8,_0x2cdcdf){return _0x75a3b8(_0x2cdcdf);},'XfDah':function(_0x5baecf,_0x2fc392,_0x293053){return _0x5baecf(_0x2fc392,_0x293053);},'oYPcE':_0x4b598f(0x18d),'xENqt':_0x4b598f(0x125),'usDzT':function(_0x2f3b58,_0x1a9a74,_0x5990c0,_0x5a29e8){return _0x2f3b58(_0x1a9a74,_0x5990c0,_0x5a29e8);}},_0x2f4919=_0x29dc66['replace'](/\/mcp$/,'');process[_0x4b598f(0x173)]['write'](_0x4b598f(0x15b));const _0x52fcda=await fetch(_0x2f4919+'/.well-known/oauth-protected-resource');if(!_0x52fcda['ok'])throw new Error(_0x460e2b[_0x4b598f(0x186)]);const _0x2474ea=await _0x52fcda[_0x4b598f(0x149)](),_0x1693e9=_0x2474ea['authorization_servers']?.[0x0];if(!_0x1693e9)throw new Error('No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata');console['log']('\x20'+_0x1693e9);const _0x16536b=await fetchAuthServerMetadata(_0x1693e9);let _0x1d721a,_0x17a7d7;const _0x19c02b=await loadCachedClient();if(_0x19c02b)_0x1d721a=_0x19c02b[_0x4b598f(0x142)],_0x17a7d7=_0x19c02b['clientSecret'];else{if(_0x16536b['registration_endpoint']){process[_0x4b598f(0x173)]['write']('Registering\x20OAuth\x20client...');const _0x2cc4b7=await _0x460e2b['FuZvq'](fetch,_0x16536b[_0x4b598f(0x196)],{'method':_0x4b598f(0x18d),'headers':{'Content-Type':_0x4b598f(0x13c)},'body':JSON[_0x4b598f(0x130)]({'client_name':_0x460e2b[_0x4b598f(0x16d)],'redirect_uris':['http://localhost:'+CALLBACK_PORT+'/callback'],'grant_types':[_0x460e2b['EhVhN'],_0x460e2b['cmupw']],'response_types':[_0x4b598f(0x1a5)],'token_endpoint_auth_method':_0x4b598f(0x136)})});if(!_0x2cc4b7['ok']){const _0x4d1f09=await _0x2cc4b7[_0x4b598f(0x167)]();throw new Error(_0x4b598f(0x1a6)+_0x4d1f09);}const _0x102a60=await _0x2cc4b7[_0x4b598f(0x149)]();_0x1d721a=_0x102a60[_0x4b598f(0x156)],_0x17a7d7=_0x102a60['client_secret'],await saveCachedClient(_0x1d721a,_0x17a7d7),console[_0x4b598f(0x13f)]('\x20done');}else throw new Error(_0x4b598f(0x189));}const _0x5b3e29=_0x460e2b['FbkPu'](randomBytes,0x20)[_0x4b598f(0x158)](_0x460e2b[_0x4b598f(0x171)]),_0x2bbd51=createHash(_0x460e2b[_0x4b598f(0x181)])[_0x4b598f(0x17d)](_0x5b3e29)['digest']('base64url'),_0x1b7f15=randomBytes(0x10)['toString'](_0x4b598f(0x191)),_0x5d8adc=new URL(_0x16536b[_0x4b598f(0x132)]);_0x5d8adc['searchParams']['set'](_0x4b598f(0x17a),_0x460e2b[_0x4b598f(0x1ae)]),_0x5d8adc['searchParams'][_0x4b598f(0x151)](_0x460e2b[_0x4b598f(0x14a)],_0x1d721a),_0x5d8adc[_0x4b598f(0x18a)]['set']('redirect_uri',_0x4b598f(0x150)+CALLBACK_PORT+'/callback'),_0x5d8adc['searchParams'][_0x4b598f(0x151)](_0x4b598f(0x19f),_0x2bbd51),_0x5d8adc[_0x4b598f(0x18a)]['set']('code_challenge_method',_0x460e2b[_0x4b598f(0x193)]),_0x5d8adc['searchParams']['set'](_0x460e2b[_0x4b598f(0x14d)],_0x1b7f15);_0x2474ea['resource']&&_0x5d8adc['searchParams']['set'](_0x4b598f(0x175),_0x2474ea[_0x4b598f(0x175)]);console[_0x4b598f(0x13f)]('\x0aOpening\x20browser\x20for\x20authentication...'),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x5d8adc[_0x4b598f(0x158)]()+'\x0a'),await _0x460e2b['EyEYi'](openBrowser,_0x5d8adc['toString']());const _0x2628d0=await waitForCallback(_0x1b7f15);process['stdout'][_0x4b598f(0x1b6)]('Exchanging\x20authorization\x20code...');const _0x1a703f=new URLSearchParams({'grant_type':_0x4b598f(0x197),'code':_0x2628d0,'redirect_uri':_0x4b598f(0x150)+CALLBACK_PORT+'/callback','client_id':_0x1d721a,'code_verifier':_0x5b3e29});_0x17a7d7&&_0x1a703f[_0x4b598f(0x151)](_0x4b598f(0x177),_0x17a7d7);_0x2474ea['resource']&&_0x1a703f[_0x4b598f(0x151)]('resource',_0x2474ea['resource']);const _0x5d5923=await _0x460e2b[_0x4b598f(0x128)](fetch,_0x16536b[_0x4b598f(0x135)],{'method':_0x460e2b[_0x4b598f(0x190)],'headers':{'Content-Type':_0x460e2b[_0x4b598f(0x13b)]},'body':_0x1a703f});if(!_0x5d5923['ok']){const _0xf1a9bd=await _0x5d5923['text']();throw new Error('Token\x20exchange\x20failed:\x20'+_0xf1a9bd);}const _0xcfd795=await _0x5d5923['json']();return console['log'](_0x4b598f(0x1a7)),await _0x460e2b[_0x4b598f(0x15f)](saveCachedToken,_0xcfd795['access_token'],_0xcfd795['refresh_token'],_0xcfd795[_0x4b598f(0x14b)]),_0xcfd795['access_token'];}async function callGetCliToken(_0x29c8dc,_0x3a999e){const _0x1fab3f=_0x3fb461,_0x333b91={'fcKtj':'POST','JgKiY':function(_0x5a0f08,_0x51acbb){return _0x5a0f08(_0x51acbb);},'PxPeB':_0x1fab3f(0x1b2),'quRNd':_0x1fab3f(0x1b1),'kQpXC':'initialize','yZwLy':_0x1fab3f(0x17f),'WAURb':_0x1fab3f(0x1a7),'VDiZM':function(_0x5d7138,_0xc6a425,_0x2aa77a){return _0x5d7138(_0xc6a425,_0x2aa77a);},'WmlWn':_0x1fab3f(0x139),'jSFuc':'Requesting\x20CLI\x20token...','ESBJm':_0x1fab3f(0x164),'lfcCW':function(_0x599c42,_0x28558d){return _0x599c42(_0x28558d);},'pdgfZ':_0x1fab3f(0x12e),'TGOkP':function(_0x16087c){return _0x16087c();},'WDLSi':function(_0x45a865,_0x570df3,_0x2182d2,_0x1fd519){return _0x45a865(_0x570df3,_0x2182d2,_0x1fd519);},'kEfAR':_0x1fab3f(0x198)},_0x46857c={'Content-Type':_0x1fab3f(0x13c),'Accept':'application/json,\x20text/event-stream'};_0x3a999e&&(_0x46857c[_0x333b91['PxPeB']]='Bearer\x20'+_0x3a999e);const _0x410517=async _0x3fd47d=>{const _0x42e25f=_0x1fab3f,_0x4720c1=await fetch(_0x29c8dc,{'method':_0x333b91[_0x42e25f(0x194)],'headers':_0x46857c,'body':JSON['stringify'](_0x3fd47d)});if(!_0x4720c1['ok']){const _0x4f3d60=await _0x4720c1['text']();throw new Error(_0x42e25f(0x1b0)+_0x4720c1[_0x42e25f(0x1b9)]+':\x20'+_0x4f3d60);}return _0x333b91[_0x42e25f(0x1a0)](parseResponse,_0x4720c1);};process[_0x1fab3f(0x173)]['write'](_0x1fab3f(0x124));const _0x2ea51f=await _0x410517({'jsonrpc':_0x333b91[_0x1fab3f(0x15c)],'id':0x1,'method':_0x333b91['kQpXC'],'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x333b91[_0x1fab3f(0x12d)],'version':'1.0.0'}}});if(_0x2ea51f['error'])throw new Error(_0x1fab3f(0x1aa)+(_0x2ea51f[_0x1fab3f(0x146)][_0x1fab3f(0x199)]??JSON[_0x1fab3f(0x130)](_0x2ea51f['error'])));console['log'](_0x333b91['WAURb']),await _0x333b91['VDiZM'](fetch,_0x29c8dc,{'method':_0x333b91[_0x1fab3f(0x194)],'headers':_0x46857c,'body':JSON[_0x1fab3f(0x130)]({'jsonrpc':'2.0','method':_0x333b91['WmlWn']})})[_0x1fab3f(0x160)](_0x21db07=>_0x21db07[_0x1fab3f(0x167)]()),process['stdout']['write'](_0x333b91[_0x1fab3f(0x16b)]);const _0x2de1e8=await _0x410517({'jsonrpc':_0x333b91['quRNd'],'id':0x2,'method':_0x333b91['ESBJm'],'params':{'name':'get_cli_token','arguments':{}}});if(_0x2de1e8[_0x1fab3f(0x146)])throw new Error(_0x1fab3f(0x18e)+(_0x2de1e8['error'][_0x1fab3f(0x199)]??JSON['stringify'](_0x2de1e8['error'])));console['log'](_0x333b91[_0x1fab3f(0x19c)]);const _0x23450d=_0x333b91[_0x1fab3f(0x17e)](extractToken,_0x2de1e8[_0x1fab3f(0x18f)]);if(!_0x23450d){console['error']('\x0aUnexpected\x20response\x20structure:'),console[_0x1fab3f(0x146)](JSON['stringify'](_0x2de1e8['result'],null,0x2));throw new Error(_0x333b91[_0x1fab3f(0x1b5)]);}const _0x44da97=join(_0x333b91['TGOkP'](homedir),'.ranger'),_0x2392c4=join(_0x44da97,_0x1fab3f(0x1a9));await mkdir(_0x44da97,{'recursive':!![]}),await _0x333b91['WDLSi'](writeFile,_0x2392c4,_0x23450d,{'mode':0x180}),await _0x333b91['WDLSi'](writeFile,join(_0x44da97,_0x1fab3f(0x172)),_0x29c8dc,{'mode':0x180}),console['log'](_0x1fab3f(0x152)+_0x2392c4),console[_0x1fab3f(0x13f)](_0x333b91['kEfAR']);}async function fetchAuthServerMetadata(_0x13b3e0){const _0x270b25=_0x3fb461,_0x49ce2f={'ghTAm':function(_0xe7cc68,_0x1bd11e){return _0xe7cc68(_0x1bd11e);}},_0x183efd=_0x13b3e0+_0x270b25(0x131),_0x33c61e=await _0x49ce2f['ghTAm'](fetch,_0x183efd);if(!_0x33c61e['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x183efd+':\x20'+_0x33c61e[_0x270b25(0x1b9)]);return _0x33c61e['json']();}function waitForCallback(_0x5c5201){const _0x42cbd6=_0x3fb461,_0x151356={'XhDNG':_0x42cbd6(0x176),'ZxuxX':'/callback','EkgMS':'error','ruVbk':_0x42cbd6(0x16e),'mEfCr':function(_0x59f0c8,_0xcffa3f){return _0x59f0c8!==_0xcffa3f;},'vgazY':function(_0x446fc9,_0x4fa742,_0x50c212){return _0x446fc9(_0x4fa742,_0x50c212);}};return new Promise((_0xfb089c,_0x3b27f9)=>{const _0x11c818=_0x42cbd6,_0xec669f={'nJJmE':function(_0x4c7404,_0x482c1f){return _0x4c7404!==_0x482c1f;},'ZWWql':_0x151356['ZxuxX'],'lPPYO':'code','roPHa':_0x151356[_0x11c818(0x19a)],'tdItJ':_0x151356[_0x11c818(0x1a2)],'XFDjn':function(_0x3dce22,_0xf87a78){return _0x3dce22(_0xf87a78);},'BLkBp':function(_0x434da8,_0x54eddf){return _0x151356['mEfCr'](_0x434da8,_0x54eddf);}},_0x59eb55=_0x151356[_0x11c818(0x185)](setTimeout,()=>{const _0x2f415=_0x11c818;_0x5de504[_0x2f415(0x1a3)](),_0x3b27f9(new OAuthTimeoutError(_0x151356[_0x2f415(0x143)]));},0x1d4c0),_0x5de504=createServer((_0x5709e9,_0x17011e)=>{const _0x46e7ab=_0x11c818,_0x31e66a=new URL(_0x5709e9[_0x46e7ab(0x122)]??'/',_0x46e7ab(0x150)+CALLBACK_PORT);if(_0xec669f['nJJmE'](_0x31e66a[_0x46e7ab(0x154)],_0xec669f[_0x46e7ab(0x14f)])){_0x17011e[_0x46e7ab(0x12a)](0x194),_0x17011e['end'](_0x46e7ab(0x1ba));return;}const _0x13a75a=_0x31e66a['searchParams']['get'](_0xec669f[_0x46e7ab(0x182)]),_0x2d94d7=_0x31e66a['searchParams'][_0x46e7ab(0x12f)](_0x46e7ab(0x1ab)),_0x395591=_0x31e66a[_0x46e7ab(0x18a)]['get'](_0xec669f[_0x46e7ab(0x15e)]);if(_0x395591){const _0x5b0a32=_0x31e66a[_0x46e7ab(0x18a)]['get']('error_description')??_0x395591;_0x17011e['writeHead'](0xc8,{'Content-Type':_0xec669f['tdItJ']}),_0x17011e[_0x46e7ab(0x157)](_0x46e7ab(0x133)+_0x5b0a32+_0x46e7ab(0x179)),clearTimeout(_0x59eb55),_0x5de504['close'](),_0xec669f['XFDjn'](_0x3b27f9,new Error(_0x46e7ab(0x19d)+_0x5b0a32));return;}if(!_0x13a75a||_0xec669f[_0x46e7ab(0x147)](_0x2d94d7,_0x5c5201)){_0x17011e[_0x46e7ab(0x12a)](0x190,{'Content-Type':_0xec669f['tdItJ']}),_0x17011e['end']('<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>');return;}_0x17011e['writeHead'](0xc8,{'Content-Type':_0xec669f['tdItJ']}),_0x17011e['end'](_0x46e7ab(0x15a)),clearTimeout(_0x59eb55),_0x5de504['close'](),_0xfb089c(_0x13a75a);});_0x5de504[_0x11c818(0x18b)](CALLBACK_PORT,'127.0.0.1');});}async function openBrowser(_0x477edc){const _0x36a2bf=_0x3fb461,_0x47724a={'lXLzR':_0x36a2bf(0x170),'Iyqnr':function(_0x5acc7b,_0xfe05c0){return _0x5acc7b===_0xfe05c0;},'uPyFO':_0x36a2bf(0x123),'XVNdf':function(_0x343a57,_0x28195a){return _0x343a57(_0x28195a);}},{exec:_0x53501b}=await import('child_process'),_0x410ceb=process['platform']==='darwin'?_0x47724a[_0x36a2bf(0x1ac)]:_0x47724a['Iyqnr'](process[_0x36a2bf(0x153)],_0x36a2bf(0x16f))?'start':_0x47724a['uPyFO'];_0x47724a['XVNdf'](_0x53501b,_0x410ceb+'\x20\x22'+_0x477edc+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x211d0b=_0x3fb461,_0x21d935={'QCKfk':function(_0x33299f,_0x1a2d0f){return _0x33299f>_0x1a2d0f;}};try{const _0x13ba11=JSON[_0x211d0b(0x183)](await readFile(TOKEN_CACHE_PATH,_0x211d0b(0x169)));if(_0x13ba11[_0x211d0b(0x166)]&&_0x13ba11['origin']!==currentOrigin)return null;if(_0x13ba11[_0x211d0b(0x138)]&&_0x21d935[_0x211d0b(0x13d)](Date[_0x211d0b(0x17b)](),_0x13ba11['expiresAt']))return null;return _0x13ba11['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0x338101,_0x213038,_0x1273e5){const _0x350acb=_0x3fb461,_0x2bcda1={'RciIg':function(_0x18195f){return _0x18195f();},'trypL':function(_0x13da75,_0x426b82){return _0x13da75+_0x426b82;},'FBwZE':function(_0x2c575c,_0x373465,_0x16acad){return _0x2c575c(_0x373465,_0x16acad);},'dIdnn':function(_0x8987e3,_0x1711ec,_0x9e2404){return _0x8987e3(_0x1711ec,_0x9e2404);},'ZtAHU':function(_0x28e7cf,_0x226731,_0x21a669,_0x18da74){return _0x28e7cf(_0x226731,_0x21a669,_0x18da74);}},_0x3831cd=await _0x2bcda1['RciIg'](loadCachedData),_0x386e19={..._0x3831cd,'origin':currentOrigin,'accessToken':_0x338101,'refreshToken':_0x213038??_0x3831cd?.[_0x350acb(0x19e)],'expiresAt':_0x1273e5?_0x2bcda1['trypL'](Date[_0x350acb(0x17b)](),_0x1273e5*0x3e8):undefined};await _0x2bcda1['FBwZE'](mkdir,_0x2bcda1[_0x350acb(0x13e)](join,homedir(),'.ranger'),{'recursive':!![]}),await _0x2bcda1['ZtAHU'](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x386e19),{'mode':0x180});}async function loadCachedClient(){const _0x692971=_0x3fb461,_0x330dd9=await loadCachedData();if(_0x330dd9?.[_0x692971(0x166)]&&_0x330dd9['origin']!==currentOrigin)return null;return _0x330dd9?.[_0x692971(0x142)]?{'clientId':_0x330dd9['clientId'],'clientSecret':_0x330dd9['clientSecret']}:null;}async function clearCachedClient(){const _0x5df4bc=_0x3fb461,_0x433e5d={'Vsqmz':function(_0x510885){return _0x510885();}},_0x2292e2=await _0x433e5d['Vsqmz'](loadCachedData);if(!_0x2292e2)return;const {clientId:_0x26b333,clientSecret:_0x4fb919,..._0x934716}=_0x2292e2;await writeFile(TOKEN_CACHE_PATH,JSON[_0x5df4bc(0x130)](_0x934716),{'mode':0x180});}async function saveCachedClient(_0x26d016,_0x15455b){const _0x5b6843=_0x3fb461,_0x387d98={'JPvdc':function(_0x24d9d3){return _0x24d9d3();},'RnXKP':_0x5b6843(0x1b7),'OWfBt':function(_0x39e7fb,_0x498454,_0x3e59af,_0x338a1a){return _0x39e7fb(_0x498454,_0x3e59af,_0x338a1a);}},_0x1295c3=await _0x387d98[_0x5b6843(0x1b4)](loadCachedData),_0x3fe28d={..._0x1295c3,'origin':currentOrigin,'accessToken':_0x1295c3?.['accessToken']??'','clientId':_0x26d016,'clientSecret':_0x15455b};await mkdir(join(homedir(),_0x387d98[_0x5b6843(0x15d)]),{'recursive':!![]}),await _0x387d98[_0x5b6843(0x18c)](writeFile,TOKEN_CACHE_PATH,JSON[_0x5b6843(0x130)](_0x3fe28d),{'mode':0x180});}async function loadCachedData(){const _0x204d9e=_0x3fb461,_0x819bfe={'lrTIU':function(_0x1a9364,_0x5a5b54,_0x33bcec){return _0x1a9364(_0x5a5b54,_0x33bcec);},'iMULp':_0x204d9e(0x169)};try{return JSON['parse'](await _0x819bfe[_0x204d9e(0x16c)](readFile,TOKEN_CACHE_PATH,_0x819bfe[_0x204d9e(0x174)]));}catch{return null;}}async function parseResponse(_0x4074d0){const _0x25c1c1=_0x3fb461,_0x981dea={'fmnhN':'text/event-stream','TUucv':'data:','EdpPf':function(_0x266715,_0x5d78f1){return _0x266715!==_0x5d78f1;}},_0x1e9afb=_0x4074d0['headers'][_0x25c1c1(0x12f)](_0x25c1c1(0x140))??'';if(_0x1e9afb['includes'](_0x981dea[_0x25c1c1(0x180)])){const _0x3b717c=await _0x4074d0[_0x25c1c1(0x167)]();for(const _0x4be3eb of _0x3b717c['split']('\x0a')){const _0x222242=_0x4be3eb['trim']();if(_0x222242[_0x25c1c1(0x1a1)](_0x25c1c1(0x163))){const _0x16216d=_0x222242['slice'](_0x981dea['TUucv']['length'])['trim']();if(!_0x16216d)continue;try{const _0x121176=JSON['parse'](_0x16216d);if(_0x981dea['EdpPf'](_0x121176['id'],undefined)||_0x121176[_0x25c1c1(0x146)])return _0x121176;}catch{}}}throw new Error('No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream');}return _0x4074d0[_0x25c1c1(0x149)]();}function extractToken(_0x99789f){const _0x50b8b9=_0x3fb461,_0xd3baec={'EzHqw':'string','dVlXA':_0x50b8b9(0x12b),'RgQVJ':function(_0x12b6f9,_0x4c7696){return _0x12b6f9===_0x4c7696;},'JQcuR':function(_0x59be27,_0x4ad1b6){return _0x59be27===_0x4ad1b6;}};if(!_0x99789f)return null;const _0xe2e488=_0x99789f[_0x50b8b9(0x192)];if(_0xe2e488?.['token']&&typeof _0xe2e488['token']===_0xd3baec['EzHqw'])return _0xe2e488[_0x50b8b9(0x19b)];if(_0x99789f[_0x50b8b9(0x195)]){const _0x63def9=_0x99789f[_0x50b8b9(0x1a4)];throw new Error('Server\x20returned\x20error:\x20'+(_0x63def9?.[0x0]?.[_0x50b8b9(0x167)]??_0xd3baec[_0x50b8b9(0x188)]));}const _0x5cffb1=_0x99789f['content'];if(_0x5cffb1)for(const _0x4d77b1 of _0x5cffb1){if(_0xd3baec[_0x50b8b9(0x161)](_0x4d77b1['type'],_0x50b8b9(0x167))&&_0x4d77b1['text']){try{const _0x1b9323=JSON[_0x50b8b9(0x183)](_0x4d77b1['text']);if(_0xd3baec['JQcuR'](typeof _0x1b9323?.[_0x50b8b9(0x19b)],_0x50b8b9(0x148)))return _0x1b9323['token'];}catch{}const _0xdfbf76=_0x4d77b1[_0x50b8b9(0x167)]['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0xdfbf76)return _0xdfbf76[0x1];}}return null;}function _0xd261(){const _0x186563=['BLkBp','string','json','kImaM','expires_in','67560YaTokR','OSDOz','fPOfg','ZWWql','http://localhost:','set','\x0aToken\x20written\x20to\x20','platform','pathname','1918278XhSfvu','client_id','end','toString','1.0.0','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','Discovering\x20authorization\x20server...','quRNd','RnXKP','roPHa','usDzT','then','RgQVJ','Ranger\x20CLI','data:','tools/call','4485627ktxQqz','origin','text','1532VTtpLf','utf-8','132004YZSpbv','jSFuc','lrTIU','jsJcl','text/html','win32','open','Meypb','auth-origin.txt','stdout','iMULp','resource','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','client_secret','S256','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','response_type','now','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','update','lfcCW','ranger-cli','fmnhN','DuMWF','lPPYO','parse','CARBB','vgazY','qVxLy','70FSmnhZ','dVlXA','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','searchParams','listen','OWfBt','POST','get_cli_token\x20failed:\x20','result','oYPcE','hex','structuredContent','LsNpx','fcKtj','isError','registration_endpoint','authorization_code','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','message','EkgMS','token','WAURb','OAuth\x20error:\x20','refreshToken','code_challenge','JgKiY','startsWith','ruVbk','close','content','code','Client\x20registration\x20failed:\x20','\x20done','5133282xgOxPV','refresh.txt','MCP\x20initialize\x20failed:\x20','state','lXLzR','5518144VGnapw','Tlaqf','name','HTTP\x20','2.0','Authorization','109fHbiyk','JPvdc','pdgfZ','write','.ranger','mcp-oauth-tokens.json','status','Not\x20found','url','xdg-open','Initializing\x20MCP\x20session...','application/x-www-form-urlencoded','proxied','UoNuv','XfDah','FrPPn','writeHead','Unknown\x20error','2025-03-26','yZwLy','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','get','stringify','/.well-known/oauth-authorization-server','authorization_endpoint','<html><body><h2>Authentication\x20failed</h2><p>','needs-oauth','token_endpoint','none','refresh_token','expiresAt','notifications/initialized','\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','xENqt','application/json','QCKfk','dIdnn','log','content-type','\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20','clientId','XhDNG','vLkwF','vVFpf','error'];_0xd261=function(){return _0x186563;};return _0xd261();}
|
|
1
|
+
const _0x5e7a43=_0xc0bf;(function(_0x283c15,_0x6721df){const _0x56b791=_0xc0bf,_0x1bdfc8=_0x283c15();while(!![]){try{const _0x118aff=-parseInt(_0x56b791(0x163))/0x1+-parseInt(_0x56b791(0x142))/0x2*(parseInt(_0x56b791(0x15f))/0x3)+parseInt(_0x56b791(0x101))/0x4+parseInt(_0x56b791(0xe6))/0x5+parseInt(_0x56b791(0x113))/0x6+-parseInt(_0x56b791(0x103))/0x7*(-parseInt(_0x56b791(0x12b))/0x8)+parseInt(_0x56b791(0xde))/0x9;if(_0x118aff===_0x6721df)break;else _0x1bdfc8['push'](_0x1bdfc8['shift']());}catch(_0x57389a){_0x1bdfc8['push'](_0x1bdfc8['shift']());}}}(_0xa7cd,0x208c2));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger','mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),_0x5e7a43(0x114),_0x5e7a43(0x12f));function _0xa7cd(){const _0x3b5a14=['content-type','JToer','xdgpt','127.0.0.1','POST','sha256','iQORx','refreshToken','child_process','\x0aOpening\x20browser\x20for\x20authentication...','kPxMp','expires_in','isTTY','name','application/json,\x20text/event-stream','proxied','Ranger\x20CLI','write','ranger-cli','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','win32','log','toString','JEmUN','35448IHvYUo','stdout','23107SHWMeJ','sJRQC','KSavH','refresh.txt','Discovering\x20authorization\x20server...','token','get','result','utf-8','KCyhn','HTTP\x20','code','error_description','zztGS','content','rBIeB','218340fzyIUE','.ranger','isError','1.0.0','code_challenge','response_type','Initializing\x20MCP\x20session...','/callback','parse','get_cli_token','application/json','match','text','\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20','clientSecret','authorization_endpoint','PRcaz','CJbSF','mwQOD','digest','resource','status','oHINL','error','416WxkNBR','\x0aToken\x20written\x20to\x20','xrEvg','json','auth-origin.txt','xdg-open','zxjIC','2.0','base64url','accessToken','OAuth\x20error:\x20','string','jdOBA','refresh_token','kjHoC','waUpV','AmWRR','message','close','text/event-stream','stringify','oYbsD','NGatp','1954RAhFHd','OAuthTimeoutError','Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20','includes','http://localhost:','client_id','client_secret','XFSaP','data:','set','SHhTt','replace','/.well-known/oauth-authorization-server','2025-03-26','xIRKE','searchParams','listen','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','TnjII','now','Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','tvUAu','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','ojDqn','clientId','Not\x20found','start','\x20done','none','753fUrykc','authorization_code','access_token','WVlJt','74811QEShHg','<html><body><h2>Authentication\x20failed</h2><p>','writeHead','856233AbYlNK','MCP\x20initialize\x20failed:\x20','QDBUT','end','zcKog','redirect_uri','initialize','text/html','706555enGJaB','kSOvu','notifications/initialized'];_0xa7cd=function(){return _0x3b5a14;};return _0xa7cd();}export async function getMcpAuthOrigin(){const _0x1819bf=_0x5e7a43,_0x4a2c7b={'mwQOD':'utf-8','DJebb':function(_0xd16091,_0x1a5e1e){return _0xd16091||_0x1a5e1e;}};try{const _0x159f43=(await readFile(AUTH_ORIGIN_PATH,_0x4a2c7b[_0x1819bf(0x125)]))['trim']();return _0x4a2c7b['DJebb'](_0x159f43,null);}catch{return null;}}export async function mcpBootstrap(){const _0x2147ee=_0x5e7a43,_0x57dad3={'TnjII':function(_0x34fbc6){return _0x34fbc6();},'lUwin':function(_0x2a3fb5,_0x5f2e2a){return _0x2a3fb5(_0x5f2e2a);},'DqYKL':'proxied','JToer':function(_0x2c66e5,_0x2ba23b){return _0x2c66e5+_0x2ba23b;},'oJJJs':'MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','ccHLO':function(_0x11c778,_0x4ec7c9,_0x101e37){return _0x11c778(_0x4ec7c9,_0x101e37);}},_0x3d340a=_0x57dad3['TnjII'](getMcpAuthUrl);currentOrigin=_0x3d340a;const _0x3cee86=process['stdout'][_0x2147ee(0xf5)]??![];console['log'](_0x2147ee(0x120)+_0x3d340a+'\x0a');const _0x13ff09=await _0x57dad3['lUwin'](tryUnauthenticated,_0x3d340a);let _0x1548fb=null;if(_0x13ff09===_0x57dad3['DqYKL'])_0x1548fb='';else{_0x1548fb=await _0x57dad3[_0x2147ee(0x154)](loadCachedToken);if(!_0x1548fb){if(!_0x3cee86)throw new Error(_0x57dad3[_0x2147ee(0xea)](_0x57dad3['oJJJs'],'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.'));_0x1548fb=await oauthFlow(_0x3d340a);}}await _0x57dad3['ccHLO'](callGetCliToken,_0x3d340a,_0x1548fb);}async function tryUnauthenticated(_0x2184a5){const _0x126e1d=_0x5e7a43,_0x464725={'rBIeB':function(_0x1c1e65,_0x83d7ec,_0x392f16){return _0x1c1e65(_0x83d7ec,_0x392f16);},'MbwGg':_0x126e1d(0x11d),'bxTkl':_0x126e1d(0x14f),'DZcri':function(_0x563e60,_0xff1e3a){return _0x563e60===_0xff1e3a;},'rdjed':'needs-oauth'},_0x2ad9e8=await _0x464725[_0x126e1d(0x112)](fetch,_0x2184a5,{'method':'POST','headers':{'Content-Type':_0x464725['MbwGg'],'Accept':_0x126e1d(0xf7)},'body':JSON[_0x126e1d(0x13f)]({'jsonrpc':'2.0','id':0x1,'method':_0x126e1d(0xe4),'params':{'protocolVersion':_0x464725['bxTkl'],'capabilities':{},'clientInfo':{'name':_0x126e1d(0xfb),'version':'1.0.0'}}})});if(_0x2ad9e8['ok'])return await _0x2ad9e8['text'](),_0x126e1d(0xf8);if(_0x464725['DZcri'](_0x2ad9e8[_0x126e1d(0x128)],0x191))return await _0x2ad9e8[_0x126e1d(0x11f)](),_0x464725['rdjed'];const _0x417348=await _0x2ad9e8['text']();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x2ad9e8[_0x126e1d(0x128)]+':\x20'+_0x417348);}class OAuthTimeoutError extends Error{constructor(_0x2ccf9f){const _0x4ec326=_0x5e7a43,_0x132504={'mAGCs':_0x4ec326(0x143)};super(_0x2ccf9f),this[_0x4ec326(0xf6)]=_0x132504['mAGCs'];}}async function oauthFlow(_0x2a6099){const _0x38ca70=_0x5e7a43,_0x341497={'oYbsD':function(_0x4d0746,_0x4b99a5){return _0x4d0746(_0x4b99a5);},'FgsJk':function(_0x243117,_0x2fc45f){return _0x243117 instanceof _0x2fc45f;},'zxjIC':function(_0x52496a){return _0x52496a();}};try{return await _0x341497[_0x38ca70(0x140)](oauthFlowAttempt,_0x2a6099);}catch(_0x1d10fb){if(_0x341497['FgsJk'](_0x1d10fb,OAuthTimeoutError)&&await _0x341497[_0x38ca70(0x131)](loadCachedClient))return console[_0x38ca70(0xfe)]('\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'),await _0x341497['zxjIC'](clearCachedClient),await oauthFlowAttempt(_0x2a6099);throw _0x1d10fb;}}async function oauthFlowAttempt(_0x3c0e7b){const _0x32bda1=_0x5e7a43,_0x3792b8={'cyVuk':function(_0x44cebe,_0x574672){return _0x44cebe(_0x574672);},'ACXrl':_0x32bda1(0x156),'AKmRR':function(_0x5ac433,_0x253f46,_0x41f6b3){return _0x5ac433(_0x253f46,_0x41f6b3);},'WVlJt':_0x32bda1(0xf9),'Qmfvw':_0x32bda1(0x160),'NYnvm':_0x32bda1(0x10e),'oWflx':_0x32bda1(0x15e),'TjJdg':_0x32bda1(0x158),'afWor':_0x32bda1(0xee),'OKTta':'base64url','ybEzc':'hex','TMUTB':_0x32bda1(0x118),'QVxJz':_0x32bda1(0x147),'qFiHW':_0x32bda1(0xe3),'zXnnj':'state','bfWnE':function(_0x38bdcb,_0x2853bb){return _0x38bdcb(_0x2853bb);},'XqpdM':'Exchanging\x20authorization\x20code...','iQORx':'application/x-www-form-urlencoded','FpDwS':function(_0x14e308,_0x338440,_0x320233,_0x258b61){return _0x14e308(_0x338440,_0x320233,_0x258b61);}},_0x5a8433=_0x3c0e7b[_0x32bda1(0x14d)](/\/mcp$/,'');process['stdout'][_0x32bda1(0xfa)](_0x32bda1(0x107));const _0x2aca00=await _0x3792b8['cyVuk'](fetch,_0x5a8433+'/.well-known/oauth-protected-resource');if(!_0x2aca00['ok'])throw new Error(_0x3792b8['ACXrl']);const _0x450670=await _0x2aca00[_0x32bda1(0x12e)](),_0x52aa64=_0x450670['authorization_servers']?.[0x0];if(!_0x52aa64)throw new Error(_0x32bda1(0x153));console['log']('\x20'+_0x52aa64);const _0x54dd3d=await fetchAuthServerMetadata(_0x52aa64);let _0x5e5a4a,_0x5622c1;const _0x342886=await loadCachedClient();if(_0x342886)_0x5e5a4a=_0x342886[_0x32bda1(0x15a)],_0x5622c1=_0x342886[_0x32bda1(0x121)];else{if(_0x54dd3d['registration_endpoint']){process['stdout'][_0x32bda1(0xfa)]('Registering\x20OAuth\x20client...');const _0x5fb08a=await _0x3792b8['AKmRR'](fetch,_0x54dd3d['registration_endpoint'],{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON[_0x32bda1(0x13f)]({'client_name':_0x3792b8[_0x32bda1(0x162)],'redirect_uris':[_0x32bda1(0x146)+CALLBACK_PORT+'/callback'],'grant_types':[_0x3792b8['Qmfvw'],_0x32bda1(0x138)],'response_types':[_0x3792b8['NYnvm']],'token_endpoint_auth_method':_0x3792b8['oWflx']})});if(!_0x5fb08a['ok']){const _0x52ce19=await _0x5fb08a['text']();throw new Error('Client\x20registration\x20failed:\x20'+_0x52ce19);}const _0x38ec38=await _0x5fb08a['json']();_0x5e5a4a=_0x38ec38['client_id'],_0x5622c1=_0x38ec38[_0x32bda1(0x148)],await saveCachedClient(_0x5e5a4a,_0x5622c1),console['log'](_0x32bda1(0x15d));}else throw new Error(_0x3792b8['TjJdg']);}const _0x115474=randomBytes(0x20)[_0x32bda1(0xff)](_0x32bda1(0x133)),_0x302b5b=createHash(_0x3792b8['afWor'])['update'](_0x115474)[_0x32bda1(0x126)](_0x3792b8['OKTta']),_0x40e824=randomBytes(0x10)['toString'](_0x3792b8['ybEzc']),_0x1b822a=new URL(_0x54dd3d[_0x32bda1(0x122)]);_0x1b822a[_0x32bda1(0x151)]['set'](_0x3792b8['TMUTB'],_0x32bda1(0x10e)),_0x1b822a[_0x32bda1(0x151)]['set'](_0x3792b8['QVxJz'],_0x5e5a4a),_0x1b822a['searchParams'][_0x32bda1(0x14b)](_0x3792b8['qFiHW'],'http://localhost:'+CALLBACK_PORT+'/callback'),_0x1b822a[_0x32bda1(0x151)]['set'](_0x32bda1(0x117),_0x302b5b),_0x1b822a[_0x32bda1(0x151)]['set']('code_challenge_method','S256'),_0x1b822a['searchParams'][_0x32bda1(0x14b)](_0x3792b8['zXnnj'],_0x40e824);_0x450670[_0x32bda1(0x127)]&&_0x1b822a['searchParams']['set']('resource',_0x450670[_0x32bda1(0x127)]);console[_0x32bda1(0xfe)](_0x32bda1(0xf2)),console[_0x32bda1(0xfe)]('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x1b822a['toString']()+'\x0a'),await openBrowser(_0x1b822a[_0x32bda1(0xff)]());const _0x7e4ab=await _0x3792b8['bfWnE'](waitForCallback,_0x40e824);process[_0x32bda1(0x102)]['write'](_0x3792b8['XqpdM']);const _0xdc2d54=new URLSearchParams({'grant_type':_0x32bda1(0x160),'code':_0x7e4ab,'redirect_uri':_0x32bda1(0x146)+CALLBACK_PORT+'/callback','client_id':_0x5e5a4a,'code_verifier':_0x115474});_0x5622c1&&_0xdc2d54['set']('client_secret',_0x5622c1);_0x450670[_0x32bda1(0x127)]&&_0xdc2d54[_0x32bda1(0x14b)](_0x32bda1(0x127),_0x450670[_0x32bda1(0x127)]);const _0x5cb9e2=await fetch(_0x54dd3d['token_endpoint'],{'method':'POST','headers':{'Content-Type':_0x3792b8[_0x32bda1(0xef)]},'body':_0xdc2d54});if(!_0x5cb9e2['ok']){const _0x5c6100=await _0x5cb9e2['text']();throw new Error('Token\x20exchange\x20failed:\x20'+_0x5c6100);}const _0x14c5dc=await _0x5cb9e2[_0x32bda1(0x12e)]();return console['log']('\x20done'),await _0x3792b8['FpDwS'](saveCachedToken,_0x14c5dc[_0x32bda1(0x161)],_0x14c5dc['refresh_token'],_0x14c5dc[_0x32bda1(0xf4)]),_0x14c5dc[_0x32bda1(0x161)];}async function callGetCliToken(_0x4bbe26,_0x112c17){const _0x554d6c=_0x5e7a43,_0x49396={'NSGLU':function(_0x5385fb,_0x57efd3,_0xa98c10){return _0x5385fb(_0x57efd3,_0xa98c10);},'IxqtS':function(_0x34efec,_0x57ec33){return _0x34efec(_0x57ec33);},'sJRQC':_0x554d6c(0x11d),'xrEvg':'Authorization','CJbSF':_0x554d6c(0x119),'kjHoC':_0x554d6c(0x132),'xIRKE':_0x554d6c(0x14f),'uMUiF':_0x554d6c(0x116),'bBPOO':_0x554d6c(0x11c),'xdgpt':_0x554d6c(0x15d),'MrXOS':function(_0x36352e,_0x617461){return _0x36352e(_0x617461);},'jdOBA':function(_0x262df2,_0x4de73a,_0x1659ac){return _0x262df2(_0x4de73a,_0x1659ac);},'PRcaz':_0x554d6c(0x114),'hldST':function(_0x530c98,_0x503ab8,_0x8ad9cd){return _0x530c98(_0x503ab8,_0x8ad9cd);},'KCyhn':_0x554d6c(0x106),'XFSaP':function(_0x5bdd25,_0x20899e,_0x161e0f,_0x5ae3ae){return _0x5bdd25(_0x20899e,_0x161e0f,_0x5ae3ae);},'kPxMp':function(_0x499af9,_0x229ce5,_0x3c93db){return _0x499af9(_0x229ce5,_0x3c93db);},'kzNTN':'Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a'},_0x1532d7={'Content-Type':_0x49396[_0x554d6c(0x104)],'Accept':_0x554d6c(0xf7)};_0x112c17&&(_0x1532d7[_0x49396[_0x554d6c(0x12d)]]='Bearer\x20'+_0x112c17);const _0x2adb5d=async _0xf5e12d=>{const _0x416077=_0x554d6c,_0x24cf0a=await _0x49396['NSGLU'](fetch,_0x4bbe26,{'method':_0x416077(0xed),'headers':_0x1532d7,'body':JSON[_0x416077(0x13f)](_0xf5e12d)});if(!_0x24cf0a['ok']){const _0x190f7f=await _0x24cf0a[_0x416077(0x11f)]();throw new Error(_0x416077(0x10d)+_0x24cf0a[_0x416077(0x128)]+':\x20'+_0x190f7f);}return _0x49396['IxqtS'](parseResponse,_0x24cf0a);};process['stdout'][_0x554d6c(0xfa)](_0x49396[_0x554d6c(0x124)]);const _0x48a02d=await _0x2adb5d({'jsonrpc':_0x49396[_0x554d6c(0x139)],'id':0x1,'method':_0x554d6c(0xe4),'params':{'protocolVersion':_0x49396[_0x554d6c(0x150)],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x49396['uMUiF']}}});if(_0x48a02d[_0x554d6c(0x12a)])throw new Error(_0x554d6c(0xdf)+(_0x48a02d['error'][_0x554d6c(0x13c)]??JSON[_0x554d6c(0x13f)](_0x48a02d['error'])));console['log']('\x20done'),await _0x49396['NSGLU'](fetch,_0x4bbe26,{'method':_0x554d6c(0xed),'headers':_0x1532d7,'body':JSON['stringify']({'jsonrpc':'2.0','method':_0x554d6c(0xe8)})})['then'](_0x3a75fc=>_0x3a75fc[_0x554d6c(0x11f)]()),process['stdout'][_0x554d6c(0xfa)]('Requesting\x20CLI\x20token...');const _0x344a56=await _0x49396['IxqtS'](_0x2adb5d,{'jsonrpc':_0x49396[_0x554d6c(0x139)],'id':0x2,'method':'tools/call','params':{'name':_0x49396['bBPOO'],'arguments':{}}});if(_0x344a56['error'])throw new Error('get_cli_token\x20failed:\x20'+(_0x344a56['error'][_0x554d6c(0x13c)]??JSON['stringify'](_0x344a56[_0x554d6c(0x12a)])));console['log'](_0x49396[_0x554d6c(0xeb)]);const _0x2cde00=_0x49396['MrXOS'](extractToken,_0x344a56[_0x554d6c(0x10a)]);if(!_0x2cde00){console[_0x554d6c(0x12a)]('\x0aUnexpected\x20response\x20structure:'),console[_0x554d6c(0x12a)](JSON[_0x554d6c(0x13f)](_0x344a56['result'],null,0x2));throw new Error('Could\x20not\x20extract\x20token\x20from\x20MCP\x20response');}const _0x645ac6=_0x49396[_0x554d6c(0x137)](join,homedir(),_0x49396[_0x554d6c(0x123)]),_0x1c773e=_0x49396['hldST'](join,_0x645ac6,_0x49396[_0x554d6c(0x10c)]);await mkdir(_0x645ac6,{'recursive':!![]}),await _0x49396[_0x554d6c(0x149)](writeFile,_0x1c773e,_0x2cde00,{'mode':0x180}),await writeFile(_0x49396[_0x554d6c(0xf3)](join,_0x645ac6,'auth-origin.txt'),_0x4bbe26,{'mode':0x180}),console['log'](_0x554d6c(0x12c)+_0x1c773e),console['log'](_0x49396['kzNTN']);}async function fetchAuthServerMetadata(_0x1fa68d){const _0x2a69af=_0x5e7a43,_0x50ea78={'JEmUN':function(_0x4c7f63,_0x1811bc){return _0x4c7f63(_0x1811bc);}},_0x30fa17=_0x1fa68d+_0x2a69af(0x14e),_0x52b4b9=await _0x50ea78[_0x2a69af(0x100)](fetch,_0x30fa17);if(!_0x52b4b9['ok'])throw new Error(_0x2a69af(0x144)+_0x30fa17+':\x20'+_0x52b4b9['status']);return _0x52b4b9[_0x2a69af(0x12e)]();}function waitForCallback(_0x21405f){const _0x475725=_0x5e7a43,_0x3fb2eb={'Btrrg':function(_0xfe9491,_0x480fbb){return _0xfe9491!==_0x480fbb;},'PdCbY':function(_0x6890a9,_0x4ef571){return _0x6890a9(_0x4ef571);},'KSavH':_0x475725(0xec)};return new Promise((_0x1b0f53,_0x4a6e4)=>{const _0x4e0262=_0x475725,_0x481522={'QDBUT':_0x4e0262(0x12a),'WtbFB':_0x4e0262(0x10f),'rZiEF':function(_0x7cc2f8,_0x51878){return _0x3fb2eb['Btrrg'](_0x7cc2f8,_0x51878);}},_0x44a510=setTimeout(()=>{const _0x53ba4e=_0x4e0262;_0x1b2184['close'](),_0x4a6e4(new OAuthTimeoutError(_0x53ba4e(0xfc)));},0x1d4c0),_0x1b2184=_0x3fb2eb['PdCbY'](createServer,(_0x2bd1a6,_0x29ddcd)=>{const _0x471da1=_0x4e0262,_0x593519=new URL(_0x2bd1a6['url']??'/','http://localhost:'+CALLBACK_PORT);if(_0x593519['pathname']!==_0x471da1(0x11a)){_0x29ddcd['writeHead'](0x194),_0x29ddcd['end'](_0x471da1(0x15b));return;}const _0xe137b0=_0x593519[_0x471da1(0x151)][_0x471da1(0x109)]('code'),_0x466ffb=_0x593519['searchParams']['get']('state'),_0x2c428f=_0x593519['searchParams']['get'](_0x481522[_0x471da1(0xe0)]);if(_0x2c428f){const _0xb326fc=_0x593519['searchParams'][_0x471da1(0x109)](_0x481522['WtbFB'])??_0x2c428f;_0x29ddcd['writeHead'](0xc8,{'Content-Type':'text/html'}),_0x29ddcd[_0x471da1(0xe1)](_0x471da1(0x164)+_0xb326fc+'</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>'),clearTimeout(_0x44a510),_0x1b2184['close'](),_0x4a6e4(new Error(_0x471da1(0x135)+_0xb326fc));return;}if(!_0xe137b0||_0x481522['rZiEF'](_0x466ffb,_0x21405f)){_0x29ddcd[_0x471da1(0xdd)](0x190,{'Content-Type':_0x471da1(0xe5)}),_0x29ddcd['end']('<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>');return;}_0x29ddcd[_0x471da1(0xdd)](0xc8,{'Content-Type':_0x471da1(0xe5)}),_0x29ddcd['end']('<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>'),clearTimeout(_0x44a510),_0x1b2184[_0x471da1(0x13d)](),_0x1b0f53(_0xe137b0);});_0x1b2184[_0x4e0262(0x152)](CALLBACK_PORT,_0x3fb2eb[_0x4e0262(0x105)]);});}async function openBrowser(_0x2495ed){const _0x325c3e=_0x5e7a43,_0xe67a25={'mBGNB':function(_0x83858,_0x3b4aa0){return _0x83858===_0x3b4aa0;},'zcKog':'open','VuGwP':_0x325c3e(0x15c),'XNeXs':_0x325c3e(0x130),'fvZWC':function(_0xbb4d6,_0x15f4b0){return _0xbb4d6(_0x15f4b0);}},{exec:_0x306ed9}=await import(_0x325c3e(0xf1)),_0x10d7bb=_0xe67a25['mBGNB'](process['platform'],'darwin')?_0xe67a25[_0x325c3e(0xe2)]:_0xe67a25['mBGNB'](process['platform'],_0x325c3e(0xfd))?_0xe67a25['VuGwP']:_0xe67a25['XNeXs'];_0xe67a25['fvZWC'](_0x306ed9,_0x10d7bb+'\x20\x22'+_0x2495ed+'\x22');}function _0xc0bf(_0x5506ab,_0x95344d){_0x5506ab=_0x5506ab-0xdd;const _0xa7cde=_0xa7cd();let _0xc0bf74=_0xa7cde[_0x5506ab];return _0xc0bf74;}let currentOrigin='';async function loadCachedToken(){const _0x4f8666=_0x5e7a43,_0x2bdc37={'oHINL':'utf-8','SHhTt':function(_0x15d522,_0x58f8bf){return _0x15d522!==_0x58f8bf;},'pbfcJ':function(_0x325312,_0xb7de35){return _0x325312>_0xb7de35;}};try{const _0x38b0b3=JSON['parse'](await readFile(TOKEN_CACHE_PATH,_0x2bdc37[_0x4f8666(0x129)]));if(_0x38b0b3['origin']&&_0x2bdc37[_0x4f8666(0x14c)](_0x38b0b3['origin'],currentOrigin))return null;if(_0x38b0b3['expiresAt']&&_0x2bdc37['pbfcJ'](Date['now'](),_0x38b0b3['expiresAt']))return null;return _0x38b0b3['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0x497675,_0x36f18e,_0x2e7b06){const _0x3c09ae=_0x5e7a43,_0x5ced15={'ojDqn':function(_0x563b5b,_0x51a184){return _0x563b5b*_0x51a184;},'kMmRQ':function(_0x992b6b,_0x1b8652,_0x2dcf41){return _0x992b6b(_0x1b8652,_0x2dcf41);},'zztGS':function(_0x4377ef){return _0x4377ef();},'kSOvu':function(_0x23eaa3,_0x22c761,_0x277595,_0x1557e0){return _0x23eaa3(_0x22c761,_0x277595,_0x1557e0);}},_0x2f46cb=await loadCachedData(),_0x33c89e={..._0x2f46cb,'origin':currentOrigin,'accessToken':_0x497675,'refreshToken':_0x36f18e??_0x2f46cb?.[_0x3c09ae(0xf0)],'expiresAt':_0x2e7b06?Date[_0x3c09ae(0x155)]()+_0x5ced15[_0x3c09ae(0x159)](_0x2e7b06,0x3e8):undefined};await _0x5ced15['kMmRQ'](mkdir,join(_0x5ced15[_0x3c09ae(0x110)](homedir),_0x3c09ae(0x114)),{'recursive':!![]}),await _0x5ced15[_0x3c09ae(0xe7)](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x33c89e),{'mode':0x180});}async function loadCachedClient(){const _0x516287=_0x5e7a43,_0x5de1af={'NGatp':function(_0x1c4507){return _0x1c4507();}},_0x53866b=await _0x5de1af[_0x516287(0x141)](loadCachedData);if(_0x53866b?.['origin']&&_0x53866b['origin']!==currentOrigin)return null;return _0x53866b?.[_0x516287(0x15a)]?{'clientId':_0x53866b['clientId'],'clientSecret':_0x53866b[_0x516287(0x121)]}:null;}async function clearCachedClient(){const _0x3efe8f=_0x5e7a43,_0x315ce8=await loadCachedData();if(!_0x315ce8)return;const {clientId:_0x2726b9,clientSecret:_0x26a138,..._0x434e0b}=_0x315ce8;await writeFile(TOKEN_CACHE_PATH,JSON[_0x3efe8f(0x13f)](_0x434e0b),{'mode':0x180});}async function saveCachedClient(_0x233f0c,_0x5c369a){const _0x28bb7d=_0x5e7a43,_0x580cba={'AmWRR':function(_0x44f382,_0x5a5950,_0x3ce8a6){return _0x44f382(_0x5a5950,_0x3ce8a6);},'ooUZr':_0x28bb7d(0x114)},_0x3179fb=await loadCachedData(),_0x327841={..._0x3179fb,'origin':currentOrigin,'accessToken':_0x3179fb?.[_0x28bb7d(0x134)]??'','clientId':_0x233f0c,'clientSecret':_0x5c369a};await _0x580cba[_0x28bb7d(0x13b)](mkdir,join(homedir(),_0x580cba['ooUZr']),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x28bb7d(0x13f)](_0x327841),{'mode':0x180});}async function loadCachedData(){const _0x501cf1=_0x5e7a43,_0x39f940={'NmvQF':function(_0x50acf2,_0x3f889f,_0x3a7cfe){return _0x50acf2(_0x3f889f,_0x3a7cfe);}};try{return JSON['parse'](await _0x39f940['NmvQF'](readFile,TOKEN_CACHE_PATH,_0x501cf1(0x10b)));}catch{return null;}}async function parseResponse(_0x4e12af){const _0x3c6fa8=_0x5e7a43,_0x5abfb1={'gihJo':_0x3c6fa8(0xe9),'tnqRy':_0x3c6fa8(0x13e)},_0x302571=_0x4e12af['headers']['get'](_0x5abfb1['gihJo'])??'';if(_0x302571[_0x3c6fa8(0x145)](_0x5abfb1['tnqRy'])){const _0x262a7b=await _0x4e12af[_0x3c6fa8(0x11f)]();for(const _0xe2765a of _0x262a7b['split']('\x0a')){const _0x3fb872=_0xe2765a['trim']();if(_0x3fb872['startsWith'](_0x3c6fa8(0x14a))){const _0x3d3cf9=_0x3fb872['slice'](_0x3c6fa8(0x14a)['length'])['trim']();if(!_0x3d3cf9)continue;try{const _0x97293=JSON['parse'](_0x3d3cf9);if(_0x97293['id']!==undefined||_0x97293[_0x3c6fa8(0x12a)])return _0x97293;}catch{}}}throw new Error('No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream');}return _0x4e12af['json']();}function extractToken(_0x40e149){const _0x19946c=_0x5e7a43,_0x485e84={'tvUAu':function(_0x464b01,_0x27ff1f){return _0x464b01===_0x27ff1f;},'iXnlu':_0x19946c(0x136),'NxRoQ':'Unknown\x20error','waUpV':function(_0x3799fe,_0x76545a){return _0x3799fe===_0x76545a;}};if(!_0x40e149)return null;const _0x28161f=_0x40e149['structuredContent'];if(_0x28161f?.['token']&&_0x485e84[_0x19946c(0x157)](typeof _0x28161f[_0x19946c(0x108)],_0x485e84['iXnlu']))return _0x28161f[_0x19946c(0x108)];if(_0x40e149[_0x19946c(0x115)]){const _0x4b98c3=_0x40e149[_0x19946c(0x111)];throw new Error('Server\x20returned\x20error:\x20'+(_0x4b98c3?.[0x0]?.[_0x19946c(0x11f)]??_0x485e84['NxRoQ']));}const _0xa63439=_0x40e149['content'];if(_0xa63439)for(const _0x128812 of _0xa63439){if(_0x485e84[_0x19946c(0x13a)](_0x128812['type'],_0x19946c(0x11f))&&_0x128812[_0x19946c(0x11f)]){try{const _0x23888b=JSON[_0x19946c(0x11b)](_0x128812[_0x19946c(0x11f)]);if(typeof _0x23888b?.[_0x19946c(0x108)]==='string')return _0x23888b[_0x19946c(0x108)];}catch{}const _0x41474b=_0x128812[_0x19946c(0x11f)][_0x19946c(0x11e)](/(rngr_[A-Za-z0-9_-]+)/);if(_0x41474b)return _0x41474b[0x1];}}return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x293ef0,_0x43f41b){const _0x6ee06e=_0x4010,_0x57bf9c=_0x293ef0();while(!![]){try{const _0x4f6810=-parseInt(_0x6ee06e(0x15c))/0x1+-parseInt(_0x6ee06e(0x184))/0x2*(-parseInt(_0x6ee06e(0x169))/0x3)+parseInt(_0x6ee06e(0x17f))/0x4+-parseInt(_0x6ee06e(0x17c))/0x5+-parseInt(_0x6ee06e(0x179))/0x6+parseInt(_0x6ee06e(0x172))/0x7*(parseInt(_0x6ee06e(0x185))/0x8)+parseInt(_0x6ee06e(0x183))/0x9;if(_0x4f6810===_0x43f41b)break;else _0x57bf9c['push'](_0x57bf9c['shift']());}catch(_0x31cc45){_0x57bf9c['push'](_0x57bf9c['shift']());}}}(_0x186b,0xc5236));import{join}from'path';import{existsSync}from'fs';function _0x186b(){const _0x3f4afe=['RdNtS','JoIqr','\x0a📦\x20Claude\x20Code\x20Plugin\x0a','TOPIu','✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','✓\x20Claude\x20Code\x20plugin\x20enabled','success','fzuVB','sVyUn','Would\x20you\x20like\x20to\x20install\x20skills?','error','391727lSiYeO','✓\x20Marketplace\x20already\x20added','nopbd','pluginScope','BMMro','confirm','list','SKILL.md','rQVrV','✓\x20Ranger\x20skills\x20already\x20installed','PmGmr','marketplace','vRRGx','459eDSeIR','KJRkS','enable','❌\x20Failed\x20to\x20install\x20plugin:','user','eIYNY','cJJjh','FOJOP','WIszo','63JMPpMm','nluLq','--scope','bmuZg','ranger','\x20level)...\x0a','output','8598090ILiSGt','log','.claude','6548685nPgqCA','mqRWq','bVIND','2885728VcvMPZ','ranger@trailhead','prompt','⚠\x20Failed\x20to\x20enable\x20plugin:','18353637ACmbpk','5674ZDxqfd','664152IYcsLk','project','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','includes','\x0aInstalling\x20Claude\x20Code\x20plugin\x20(','❌\x20Failed\x20to\x20add\x20marketplace:'];_0x186b=function(){return _0x3f4afe;};return _0x186b();}function _0x4010(_0x527e55,_0x5333a2){_0x527e55=_0x527e55-0x151;const _0x186b59=_0x186b();let _0x4010f8=_0x186b59[_0x527e55];return _0x4010f8;}import _0x26ab74 from'inquirer';import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x4f1db2){const _0x444de2=_0x4010,_0x405f50={'FOJOP':'✓\x20Claude\x20Code\x20plugin\x20already\x20installed','eIYNY':function(_0x30fcc6,_0x47d7e1,_0x36151a){return _0x30fcc6(_0x47d7e1,_0x36151a);},'wDjKR':_0x444de2(0x153),'OXtdX':_0x444de2(0x162),'KJRkS':'Where\x20should\x20the\x20plugin\x20be\x20installed?','WXVUg':'add','EEjpE':_0x444de2(0x18a),'rQVrV':'\x0aYou\x20can\x20install\x20manually\x20with:','JoIqr':_0x444de2(0x174),'fzuVB':_0x444de2(0x155),'vRRGx':'plugin','bmuZg':_0x444de2(0x16b),'nopbd':_0x444de2(0x180),'mqRWq':_0x444de2(0x186),'bVIND':'already\x20enabled','BMMro':_0x444de2(0x182)},_0xc4dd17=await isPluginInstalled(_0x444de2(0x180));if(_0xc4dd17)return console[_0x444de2(0x17a)](_0x405f50[_0x444de2(0x170)]),![];const _0x34a193=existsSync(_0x405f50[_0x444de2(0x16e)](join,getProjectRoot(),_0x444de2(0x17b)));let _0x251631;if(_0x4f1db2)_0x251631=_0x4f1db2;else{if(_0x34a193)_0x251631='project';else{console[_0x444de2(0x17a)](_0x405f50['wDjKR']);const _0x37e198=await _0x26ab74[_0x444de2(0x181)]([{'type':_0x405f50['OXtdX'],'name':'pluginScope','message':_0x405f50[_0x444de2(0x16a)],'choices':[{'name':'User\x20(available\x20in\x20all\x20your\x20projects)','value':'user'},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':_0x444de2(0x186)}],'default':'user'}]);_0x251631=_0x37e198[_0x444de2(0x15f)];}}console['log'](_0x444de2(0x189)+_0x251631+_0x444de2(0x177));const _0x1a01f9=await isMarketplaceAdded('trailhead');let _0x3b8fe0=_0x1a01f9;if(_0x1a01f9)console['log'](_0x444de2(0x15d));else{const _0x40099a=await runClaudeCommand(['plugin',_0x444de2(0x167),_0x405f50['WXVUg'],'ranger-testing/trailhead']);!_0x40099a['success']?(console['error'](_0x405f50['EEjpE'],_0x40099a['error']),console[_0x444de2(0x17a)](_0x405f50[_0x444de2(0x164)]),console[_0x444de2(0x17a)]('\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead'),console[_0x444de2(0x17a)]('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x251631)):_0x3b8fe0=!![];}if(_0x3b8fe0){const _0x564b7f=await runClaudeCommand(['plugin','install',_0x444de2(0x180),_0x405f50[_0x444de2(0x152)],_0x251631]);if(!_0x564b7f['success'])console['error'](_0x444de2(0x16c),_0x564b7f['error']),console['log'](_0x405f50[_0x444de2(0x164)]),console['log'](_0x444de2(0x187)+_0x251631);else{console[_0x444de2(0x17a)](_0x405f50[_0x444de2(0x158)]);const _0x4aa454=[_0x405f50[_0x444de2(0x168)],_0x405f50[_0x444de2(0x175)],_0x405f50[_0x444de2(0x15e)]];_0x251631===_0x405f50['mqRWq']&&_0x4aa454['push'](_0x405f50['JoIqr'],_0x405f50[_0x444de2(0x17d)]);const _0x55a432=await runClaudeCommand(_0x4aa454,{'captureOutput':!![]}),_0x3b715e=_0x55a432[_0x444de2(0x178)]?.[_0x444de2(0x188)](_0x405f50[_0x444de2(0x17e)]);!_0x55a432[_0x444de2(0x157)]&&!_0x3b715e?console[_0x444de2(0x15b)](_0x405f50[_0x444de2(0x160)],_0x55a432['error']):console[_0x444de2(0x17a)](_0x444de2(0x156));}}return!![];}export async function ensureClaudeSkills(_0x341b14){const _0x2c787d=_0x4010,_0x1f3509={'sVyUn':function(_0x4bf1c8,_0x14385c){return _0x4bf1c8(_0x14385c);},'WIszo':function(_0x33aa4f,_0x1b771a,_0xf64c28,_0x14dc5f){return _0x33aa4f(_0x1b771a,_0xf64c28,_0x14dc5f);},'nluLq':_0x2c787d(0x16d),'cJJjh':_0x2c787d(0x163),'PmGmr':function(_0x1baea0,_0x5c7b1c){return _0x1baea0(_0x5c7b1c);},'BwyNK':'ranger','kYbuT':function(_0x215ef4,_0x2d7872){return _0x215ef4||_0x2d7872;},'TOPIu':function(_0x34746a,_0x5b0e2a,_0x4b98e8){return _0x34746a(_0x5b0e2a,_0x4b98e8);},'rUkdb':function(_0x5bbd8b){return _0x5bbd8b();},'NLTrf':_0x2c787d(0x17b),'vyyEh':function(_0x621af4,_0x37ff2a){return _0x621af4(_0x37ff2a);},'ZOzJE':function(_0x33f88e,_0x2a2606){return _0x33f88e(_0x2a2606);},'lTMFH':'wantsSkillup','RdNtS':function(_0x62be57,_0x554fed){return _0x62be57(_0x554fed);}},_0x2d6f35=_0x1f3509[_0x2c787d(0x159)](existsSync,_0x1f3509[_0x2c787d(0x171)](join,getSkillsDir(_0x1f3509[_0x2c787d(0x173)]),_0x2c787d(0x176),_0x1f3509[_0x2c787d(0x16f)])),_0x2e7eef=_0x1f3509['sVyUn'](existsSync,join(_0x1f3509[_0x2c787d(0x166)](getSkillsDir,_0x2c787d(0x186)),_0x1f3509['BwyNK'],_0x1f3509['cJJjh']));if(_0x1f3509['kYbuT'](_0x2d6f35,_0x2e7eef))return console[_0x2c787d(0x17a)](_0x2c787d(0x165)),![];const _0xbf4314=existsSync(_0x1f3509[_0x2c787d(0x154)](join,_0x1f3509['rUkdb'](getProjectRoot),_0x1f3509['NLTrf']));let _0x558038=!![];if(_0x341b14)await _0x1f3509['vyyEh'](skillup,{'autoInstall':_0x341b14,'suppressUsage':!![]});else{if(_0xbf4314)await _0x1f3509['ZOzJE'](skillup,{'autoInstall':_0x2c787d(0x186),'suppressUsage':!![]});else{const _0x106d4a=await _0x26ab74[_0x2c787d(0x181)]([{'type':_0x2c787d(0x161),'name':_0x1f3509['lTMFH'],'message':_0x2c787d(0x15a),'default':!![]}]);_0x558038=_0x106d4a['wantsSkillup'],_0x558038&&await _0x1f3509[_0x2c787d(0x151)](skillup,{'suppressUsage':!![]});}}return _0x558038;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x16f332,_0x73a45f){const _0x3e2541=_0x5c25,_0x56e346=_0x16f332();while(!![]){try{const _0x25ff43=parseInt(_0x3e2541(0xd4))/0x1+parseInt(_0x3e2541(0xe3))/0x2+parseInt(_0x3e2541(0xe2))/0x3*(parseInt(_0x3e2541(0xe4))/0x4)+parseInt(_0x3e2541(0xd9))/0x5*(parseInt(_0x3e2541(0xd2))/0x6)+-parseInt(_0x3e2541(0xd6))/0x7*(parseInt(_0x3e2541(0xe5))/0x8)+parseInt(_0x3e2541(0xe9))/0x9+-parseInt(_0x3e2541(0xdd))/0xa;if(_0x25ff43===_0x73a45f)break;else _0x56e346['push'](_0x56e346['shift']());}catch(_0x400384){_0x56e346['push'](_0x56e346['shift']());}}}(_0x2982,0xa4df1));function _0x5c25(_0x23b97a,_0x565601){_0x23b97a=_0x23b97a-0xcd;const _0x298294=_0x2982();let _0x5c25ab=_0x298294[_0x23b97a];return _0x5c25ab;}import{join}from'path';import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0x472936 from'inquirer';function _0x2982(){const _0x1d9def=['40FDyuPQ','stringify','pluginScope','parse','21144660QtRFUy','Project\x20(shared\x20with\x20team\x20via\x20git)','Where\x20should\x20the\x20plugin\x20be\x20installed?','✓\x20OpenCode\x20plugin\x20already\x20configured','log','3ewpXoJ','2433482nuVjcs','3978772QbhFey','40EteXbw','user','ULFFR','project','1703187EyOSur','OHImF','✓\x20OpenCode\x20plugin\x20configured','@ranger-testing/opencode-plugin','HUABi','zjgpO','\x0a📦\x20OpenCode\x20Plugin\x0a','Failed\x20to\x20read\x20opencode.json','518718RtUnVP','plugin','444053FWWYSa','heBNL','1045205cljvVy','SXysX','includes'];_0x2982=function(){return _0x1d9def;};return _0x2982();}import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0x41e6a9){const _0x5a41ad=_0x5c25,_0x49add6={'ULFFR':function(_0x2b64fa,_0x5c0f56){return _0x2b64fa(_0x5c0f56);},'BetIk':function(_0x585491,_0x3d614b,_0x250a51){return _0x585491(_0x3d614b,_0x250a51);},'gxOum':'project','zjgpO':_0x5a41ad(0xd0),'heBNL':'list','QysXD':'User\x20(available\x20in\x20all\x20your\x20projects)','SXysX':_0x5a41ad(0xde),'qGpgb':function(_0x15d402,_0x49d62c,_0x3c434d){return _0x15d402(_0x49d62c,_0x3c434d);},'HEIfc':'opencode.json','TRWCl':_0x5a41ad(0xcd),'LadKy':'https://opencode.ai/config.json','CwpPv':'utf-8','JJmOh':'⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','VkQmR':_0x5a41ad(0xd1),'OHImF':function(_0x226675,_0x1cdf03){return _0x226675(_0x1cdf03);},'BVZPw':function(_0x3c71f6,_0x5926cc){return _0x3c71f6+_0x5926cc;},'HUABi':_0x5a41ad(0xeb)},_0x13ab9e=_0x49add6[_0x5a41ad(0xe7)](existsSync,_0x49add6['BetIk'](join,getOpencodeConfigDir('project'),'opencode.json'));let _0x311e38;if(_0x41e6a9)_0x311e38=_0x41e6a9;else{if(_0x13ab9e)_0x311e38=_0x49add6['gxOum'];else{console['log'](_0x49add6[_0x5a41ad(0xcf)]);const _0x5b27e3=await _0x472936['prompt']([{'type':_0x49add6[_0x5a41ad(0xd5)],'name':'pluginScope','message':_0x5a41ad(0xdf),'choices':[{'name':_0x49add6['QysXD'],'value':_0x5a41ad(0xe6)},{'name':_0x49add6[_0x5a41ad(0xd7)],'value':_0x5a41ad(0xe8)}],'default':_0x5a41ad(0xe6)}]);_0x311e38=_0x5b27e3[_0x5a41ad(0xdb)];}}const _0x53d2b6=_0x49add6['qGpgb'](join,getOpencodeConfigDir(_0x311e38),_0x49add6['HEIfc']),_0x263f3c=_0x49add6['TRWCl'],_0x585ec4=_0x49add6['LadKy'];let _0x16de1c={};if(existsSync(_0x53d2b6))try{const _0x548f6d=await readFile(_0x53d2b6,_0x49add6['CwpPv']);_0x16de1c=JSON[_0x5a41ad(0xdc)](_0x548f6d);}catch(_0x14bf4b){return console['error'](_0x49add6['JJmOh']),{'configured':![],'scope':_0x311e38,'error':_0x49add6['VkQmR'],'details':_0x14bf4b};}const _0x5f41db=Array['isArray'](_0x16de1c['plugin'])?_0x16de1c[_0x5a41ad(0xd3)]:[];if(_0x5f41db[_0x5a41ad(0xd8)](_0x263f3c))return console[_0x5a41ad(0xe1)](_0x5a41ad(0xe0)),{'configured':![],'scope':_0x311e38};return _0x16de1c['$schema']=_0x16de1c['$schema']||_0x585ec4,_0x16de1c[_0x5a41ad(0xd3)]=[..._0x5f41db,_0x263f3c],await mkdir(_0x49add6[_0x5a41ad(0xea)](getOpencodeConfigDir,_0x311e38),{'recursive':!![]}),await writeFile(_0x53d2b6,_0x49add6['BVZPw'](JSON[_0x5a41ad(0xda)](_0x16de1c,null,0x2),'\x0a')),console['log'](_0x49add6[_0x5a41ad(0xce)]),{'configured':!![],'scope':_0x311e38};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2260e2,_0x131845){const _0x1da4f9=_0x5e01,_0x3c94f9=_0x2260e2();while(!![]){try{const _0x10c6e0=parseInt(_0x1da4f9(0x13c))/0x1+parseInt(_0x1da4f9(0x101))/0x2+parseInt(_0x1da4f9(0x11f))/0x3*(parseInt(_0x1da4f9(0x12f))/0x4)+-parseInt(_0x1da4f9(0x108))/0x5+-parseInt(_0x1da4f9(0x112))/0x6*(-parseInt(_0x1da4f9(0x121))/0x7)+parseInt(_0x1da4f9(0x129))/0x8+-parseInt(_0x1da4f9(0x104))/0x9;if(_0x10c6e0===_0x131845)break;else _0x3c94f9['push'](_0x3c94f9['shift']());}catch(_0x4a9f14){_0x3c94f9['push'](_0x3c94f9['shift']());}}}(_0x3176,0xd1f28));import{mkdir,readFile,readdir}from'fs/promises';function _0x5e01(_0x14afa0,_0x2f7dc4){_0x14afa0=_0x14afa0-0xff;const _0x317652=_0x3176();let _0x5e01f6=_0x317652[_0x14afa0];return _0x5e01f6;}import{join}from'path';import{existsSync}from'fs';import{authenticate,ensureRangerDir,ensureChromium,writeRangerGitignore}from'./start.js';import{skillup}from'./skillup.js';import{getRangerDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{saveSettings}from'./utils/settings.js';import{decrypt}from'./utils/crypto.js';function _0x3176(){const _0x56a6ec=['ECxDm','skvre','skipChromium','baseUrl','8863600NAnrDa','pnkPx','ranger-testing/trailhead','auth.json','No\x20CI\x20profiles\x20found\x20in\x20.ranger/ci/.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','.\x20Use\x20--profile\x20to\x20specify\x20which\x20one.','8jWZkMT','error','CI\x20profile\x20\x22','\x22\x20has\x20no\x20settings.json.\x20Use\x20--base-url\x20to\x20configure\x20it.','ranger@trailhead','add','settings.json','sessions','cGRzi','No\x20CI\x20profiles\x20found.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','kgsHN','hDnYg','trackPhaseStart','684800yuFsEJ','success','install','✓\x20Active\x20profile:\x20','map','dir_setup','sqmpy','UOjCl','704768yUGmNK','uTpeI','\x0a✅\x20Ranger\x20CI\x20setup\x20complete!\x0a','5368023sjamYX','path','Multiple\x20CI\x20profiles\x20found:\x20','plugin','4099790ceXwWB','No\x20API\x20token\x20available\x20for\x20decryption','profile','KjHru','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','name','\x0a🔧\x20Ranger\x20CI\x20Setup\x0a','Auto-detected\x20CI\x20profile:\x20','vUTrB','EqpkW','10722ynFUEa','urnTg','\x20\x20No\x20auth\x20state\x20found\x20(app\x20may\x20not\x20require\x20authentication)','marketplace','log','cRLSC','project','✓\x20Created\x20profile\x20settings:\x20baseUrl=','auth.json.enc','trackPhaseEnd','cDCYN','CYFtS','Failed\x20to\x20verify\x20encrypted\x20auth\x20for\x20profile\x20\x22','6507hARwIm','profile_activate','497qpiEaz','Installing\x20Claude\x20Code\x20plugin\x20(project\x20level)...','You\x20can\x20install\x20manually:\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20project','Failed\x20to\x20install\x20plugin:'];_0x3176=function(){return _0x56a6ec;};return _0x3176();}import{getToken}from'./utils/keychain.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'./utils/claudePlugin.js';async function findCiProfile(_0x4b690f){const _0x10b04e=_0x5e01,_0x29ab85={'wwviv':function(_0x55a986,_0x4710d0,_0xcbbca0){return _0x55a986(_0x4710d0,_0xcbbca0);},'EAOLI':function(_0xf847d0,_0x581589){return _0xf847d0+_0x581589;},'Opqel':_0x10b04e(0x138),'sqmpy':function(_0x5f1f20,_0x22ca18,_0x2f79b0){return _0x5f1f20(_0x22ca18,_0x2f79b0);},'TLhAr':_0x10b04e(0x12d),'uTpeI':'Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.','kNXEE':function(_0x4da7b8,_0x47db18,_0x4d5788){return _0x4da7b8(_0x47db18,_0x4d5788);}},_0x19cdfa=getRangerDir(),_0x4014a6=_0x29ab85['wwviv'](join,_0x19cdfa,'ci');if(_0x4b690f){const _0xccddd1=_0x29ab85['wwviv'](join,_0x4014a6,_0x4b690f);return{'name':_0x4b690f,'path':_0xccddd1};}if(!existsSync(_0x4014a6))throw new Error(_0x29ab85['EAOLI'](_0x29ab85['Opqel'],'Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.'));const _0x333303=await _0x29ab85[_0x10b04e(0xff)](readdir,_0x4014a6,{'withFileTypes':!![]}),_0x2ca3a1=_0x333303['filter'](_0x506578=>_0x506578['isDirectory']())[_0x10b04e(0x140)](_0x1832d1=>_0x1832d1[_0x10b04e(0x10d)]);if(_0x2ca3a1['length']===0x0)throw new Error(_0x29ab85['TLhAr']+_0x29ab85[_0x10b04e(0x102)]);if(_0x2ca3a1['length']===0x1){const _0x1f968b=_0x2ca3a1[0x0];return console['log'](_0x10b04e(0x10f)+_0x1f968b),{'name':_0x1f968b,'path':_0x29ab85['kNXEE'](join,_0x4014a6,_0x1f968b)};}throw new Error(_0x10b04e(0x106)+_0x2ca3a1['join'](',\x20')+_0x10b04e(0x12e));}async function installPluginNonInteractive(){const _0x4a3c00=_0x5e01,_0xceb594={'kgsHN':'ranger@trailhead','uWmRV':_0x4a3c00(0x122),'XgnAc':function(_0x399d29,_0x1c5c3f){return _0x399d29(_0x1c5c3f);},'eSqeS':'✓\x20Marketplace\x20already\x20added','FRJew':_0x4a3c00(0x134),'urnTg':'You\x20can\x20install\x20manually:\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','SnjMe':'plugin','MjGZW':_0x4a3c00(0x118),'wabPA':_0x4a3c00(0x123),'hDnYg':'✓\x20Claude\x20Code\x20plugin\x20installed'},_0x59ee77=await isPluginInstalled(_0xceb594[_0x4a3c00(0x139)]);if(_0x59ee77)return console['log'](_0x4a3c00(0x10c)),![];console[_0x4a3c00(0x116)](_0xceb594['uWmRV']);const _0x3c19a1=await _0xceb594['XgnAc'](isMarketplaceAdded,'trailhead');let _0x516d56=_0x3c19a1;if(_0x3c19a1)console[_0x4a3c00(0x116)](_0xceb594['eSqeS']);else{const _0x427680=await _0xceb594['XgnAc'](runClaudeCommand,[_0x4a3c00(0x107),_0x4a3c00(0x115),_0xceb594['FRJew'],_0x4a3c00(0x12b)]);!_0x427680['success']?(console['error']('Failed\x20to\x20add\x20marketplace:',_0x427680[_0x4a3c00(0x130)]),console['log'](_0xceb594[_0x4a3c00(0x113)])):_0x516d56=!![];}if(_0x516d56){const _0x540a38=await runClaudeCommand([_0xceb594['SnjMe'],_0x4a3c00(0x13e),_0x4a3c00(0x133),'--scope',_0xceb594['MjGZW']]);!_0x540a38[_0x4a3c00(0x13d)]?(console[_0x4a3c00(0x130)](_0x4a3c00(0x124),_0x540a38['error']),console['log'](_0xceb594['wabPA'])):console['log'](_0xceb594[_0x4a3c00(0x13a)]);}return!![];}export async function setupCi(_0x23f782,_0x1736d8,_0x16fcd9){const _0x591a72=_0x5e01,_0x5175f4={'jBNvR':'auth','vuxHK':function(_0x68c85d,_0x6b0c70){return _0x68c85d(_0x6b0c70);},'skvre':function(_0x19f5fc,_0x1a90c5,_0x5bfd62){return _0x19f5fc(_0x1a90c5,_0x5bfd62);},'cRLSC':_0x591a72(0x136),'cGRzi':function(_0x5555d1,_0xcf6418){return _0x5555d1(_0xcf6418);},'UOjCl':'chromium','zxxkG':'✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','WUcKa':function(_0x2b15dd){return _0x2b15dd();},'pnkPx':_0x591a72(0x135),'cDCYN':function(_0x44177d,_0x27e29c,_0xc88e7c){return _0x44177d(_0x27e29c,_0xc88e7c);},'NdmIE':_0x591a72(0x109),'CYFtS':'✓\x20Auth\x20state\x20found','otEiA':_0x591a72(0x114),'EqpkW':function(_0x46437f,_0x45e1f9){return _0x46437f(_0x45e1f9);},'fnEkW':_0x591a72(0x120),'ECxDm':_0x591a72(0x107),'KjHru':'skills','vUTrB':_0x591a72(0x103)};console[_0x591a72(0x116)](_0x591a72(0x10e)),_0x16fcd9?.[_0x591a72(0x13b)]('auth'),await authenticate(_0x23f782),_0x16fcd9?.['trackPhaseEnd'](_0x5175f4['jBNvR']),_0x16fcd9?.['trackPhaseStart']('dir_setup');const {path:_0xcffae2,installed:_0x4302a6}=await ensureRangerDir();await _0x5175f4['vuxHK'](writeRangerGitignore,_0xcffae2);const _0x524da0=_0x5175f4['skvre'](join,_0xcffae2,_0x5175f4[_0x591a72(0x117)]);!_0x5175f4[_0x591a72(0x137)](existsSync,_0x524da0)&&await _0x5175f4['skvre'](mkdir,_0x524da0,{'recursive':!![]});_0x16fcd9?.[_0x591a72(0x11b)](_0x591a72(0x141),{'installed':_0x4302a6}),_0x16fcd9?.[_0x591a72(0x13b)](_0x5175f4[_0x591a72(0x100)]);let _0x24e8dd=![];_0x1736d8?.[_0x591a72(0x127)]?console[_0x591a72(0x116)](_0x5175f4['zxxkG']):_0x24e8dd=await _0x5175f4['WUcKa'](ensureChromium);_0x16fcd9?.[_0x591a72(0x11b)](_0x5175f4[_0x591a72(0x100)],{'installed':_0x24e8dd,'skipped':!!_0x1736d8?.[_0x591a72(0x127)]}),_0x16fcd9?.['trackPhaseStart']('profile_activate');const _0x4c3554=await findCiProfile(_0x1736d8?.[_0x591a72(0x10a)]);let _0x490538=![];_0x1736d8?.[_0x591a72(0x128)]&&(await _0x5175f4[_0x591a72(0x126)](mkdir,_0x4c3554['path'],{'recursive':!![]}),await saveSettings(_0x4c3554['name'],{'baseUrl':_0x1736d8[_0x591a72(0x128)],'headless':!![]}),console['log'](_0x591a72(0x119)+_0x1736d8[_0x591a72(0x128)]),_0x490538=!![]);const _0x73c0ba=join(_0x4c3554[_0x591a72(0x105)],_0x5175f4[_0x591a72(0x12a)]);if(!_0x5175f4[_0x591a72(0x137)](existsSync,_0x73c0ba)&&!_0x490538)throw new Error(_0x591a72(0x131)+_0x4c3554[_0x591a72(0x10d)]+_0x591a72(0x132));const _0x3a5752=join(_0x4c3554['path'],_0x591a72(0x12c)),_0x175afb=_0x5175f4[_0x591a72(0x11c)](join,_0x4c3554[_0x591a72(0x105)],_0x591a72(0x11a)),_0x321237=_0x5175f4['cGRzi'](existsSync,_0x3a5752),_0x57f35a=existsSync(_0x175afb);if(_0x57f35a)try{const _0x4f0435=await getToken();if(!_0x4f0435)throw new Error(_0x5175f4['NdmIE']);const _0x63b557=await readFile(_0x175afb);_0x5175f4[_0x591a72(0x126)](decrypt,_0x63b557,_0x4f0435),console['log']('✓\x20Encrypted\x20auth\x20verified\x20(will\x20decrypt\x20at\x20runtime)');}catch(_0x3d480f){const _0x32ec3a=_0x3d480f instanceof Error?_0x3d480f['message']:String(_0x3d480f);throw new Error(_0x591a72(0x11e)+_0x4c3554[_0x591a72(0x10d)]+'\x22:\x20'+_0x32ec3a);}else _0x321237?console['log'](_0x5175f4[_0x591a72(0x11d)]):console['log'](_0x5175f4['otEiA']);await _0x5175f4[_0x591a72(0x111)](writeActiveProfileName,_0x4c3554[_0x591a72(0x10d)]),console[_0x591a72(0x116)](_0x591a72(0x13f)+_0x4c3554['name']),_0x16fcd9?.['trackPhaseEnd'](_0x5175f4['fnEkW'],{'profileName':_0x4c3554[_0x591a72(0x10d)],'hasAuth':_0x321237,'hasEncryptedAuth':_0x57f35a,'createdSettings':_0x490538}),_0x16fcd9?.[_0x591a72(0x13b)](_0x5175f4['ECxDm']);const _0x54324d=await installPluginNonInteractive();_0x16fcd9?.[_0x591a72(0x11b)](_0x5175f4[_0x591a72(0x125)],{'installed':_0x54324d}),_0x16fcd9?.[_0x591a72(0x13b)](_0x5175f4[_0x591a72(0x10b)]),await skillup({'autoInstall':_0x591a72(0x118)}),_0x16fcd9?.['trackPhaseEnd'](_0x5175f4['KjHru']),console['log'](_0x5175f4[_0x591a72(0x110)]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1e33af,_0x594ffe){const _0x37fe89=_0xa9b4,_0x1f18ce=_0x1e33af();while(!![]){try{const _0x1cbbd7=parseInt(_0x37fe89(0x1a5))/0x1*(-parseInt(_0x37fe89(0x182))/0x2)+-parseInt(_0x37fe89(0x1a1))/0x3*(parseInt(_0x37fe89(0x199))/0x4)+parseInt(_0x37fe89(0x1ab))/0x5*(parseInt(_0x37fe89(0x1a8))/0x6)+parseInt(_0x37fe89(0x186))/0x7*(parseInt(_0x37fe89(0x1a3))/0x8)+-parseInt(_0x37fe89(0x19d))/0x9*(-parseInt(_0x37fe89(0x198))/0xa)+parseInt(_0x37fe89(0x1ac))/0xb*(-parseInt(_0x37fe89(0x18a))/0xc)+parseInt(_0x37fe89(0x19a))/0xd*(parseInt(_0x37fe89(0x181))/0xe);if(_0x1cbbd7===_0x594ffe)break;else _0x1f18ce['push'](_0x1f18ce['shift']());}catch(_0x4fe698){_0x1f18ce['push'](_0x1f18ce['shift']());}}}(_0x432b,0x28f50));import{basename}from'path';import _0x4ec7b7 from'inquirer';import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';function _0xa9b4(_0x4e411c,_0x43c15f){_0x4e411c=_0x4e411c-0x181;const _0x432bd4=_0x432b();let _0xa9b419=_0x432bd4[_0x4e411c];return _0xa9b419;}function _0x432b(){const _0x5eba7e=['vGprM','warn','user','ETaNt','To\x20use:','BpSTd','/skills/','\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a','opencode','\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','gmiGO','VuqzK','130KCtIIX','567532kxrUUK','80977TSLZLr','log','LInxF','32985fvjVbK','✓\x20Found\x20API\x20token','All\x20projects\x20(','platform','6lbFTPZ','\x20skill','1497784lJAdXg','\x20--opencode','165198ivOeYw','\x20successfully!\x0a','installLevel','11604akyDWz','apolD','IVNJf','55lmznmo','21043fhbvPD','1358YmXcOm','4KYrksL','suppressUsage','list','autoInstall','7iGqBRr','Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20(','project','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','492mCHsGV','To\x20get\x20started:'];_0x432b=function(){return _0x5eba7e;};return _0x432b();}export async function skillup(_0x554336={}){const _0x239165=_0xa9b4,_0x7a57fe={'LRNYy':'claude','gmiGO':function(_0x1823bb){return _0x1823bb();},'cUHoZ':_0x239165(0x189),'fEyWB':_0x239165(0x18b),'IVNJf':'\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','ggbOH':function(_0x465104,_0x753366){return _0x465104===_0x753366;},'OhJyd':_0x239165(0x1a4),'ETaNt':function(_0x4e13b1,_0xdbf39f){return _0x4e13b1===_0xdbf39f;},'GAgfQ':_0x239165(0x194),'vGprM':_0x239165(0x19e),'EzMdl':function(_0x2730ba,_0x3770ab){return _0x2730ba(_0x3770ab);},'wwoxx':'user','kcdDK':_0x239165(0x1a7),'LInxF':'Where\x20should\x20skills\x20be\x20installed?','ZqVgX':'project','nUHqA':function(_0x177399,_0x20e46c,_0x38749d){return _0x177399(_0x20e46c,_0x38749d);},'fIbRP':'\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','BpSTd':function(_0x19d3eb,_0x4ea73f){return _0x19d3eb>_0x4ea73f;},'KkPUO':function(_0x4315cf,_0xf4d647){return _0x4315cf===_0xf4d647;},'VuqzK':_0x239165(0x190),'apolD':'\x20\x20-\x20Open\x20Claude\x20Code\x20in\x20plan\x20mode\x20and\x20run\x20/ranger:enable.\x20Plan\x20out\x20a\x20UI\x20feature\x20with\x20Ranger\x20and\x20watch\x20Ranger\x20test\x20it\x20for\x20you!','SCNzZ':_0x239165(0x193)};console['log'](_0x239165(0x195));const _0x260aae=_0x554336[_0x239165(0x1a0)]??_0x7a57fe['LRNYy'],_0x36799d=await _0x7a57fe[_0x239165(0x196)](getToken);if(!_0x36799d){console[_0x239165(0x19b)](_0x7a57fe['cUHoZ']),console[_0x239165(0x19b)](_0x7a57fe['fEyWB']),console['log'](_0x7a57fe[_0x239165(0x1aa)]),console[_0x239165(0x19b)]('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0x7a57fe['ggbOH'](_0x260aae,_0x239165(0x194))?_0x7a57fe['OhJyd']:'')+'\x20<your-api-token>'),console['log']('\x20\x203.\x20Run:\x20ranger\x20skillup'+(_0x7a57fe[_0x239165(0x18f)](_0x260aae,_0x7a57fe['GAgfQ'])?'\x20--opencode':'')+'\x0a');return;}console[_0x239165(0x19b)](_0x7a57fe[_0x239165(0x18c)]);const _0x31ec6e=getProjectRoot(),_0x578daa=basename(_0x31ec6e),_0x18dd1a=_0x260aae==='opencode'?_0x7a57fe['EzMdl'](getOpencodeConfigDir,_0x7a57fe['wwoxx'])+'/skills/':getClaudeConfigDir()+_0x239165(0x192),_0x423786=_0x260aae===_0x7a57fe['GAgfQ']?_0x31ec6e+'/.opencode/skills/':_0x31ec6e+'/.claude/skills/',_0x598d78=process['stdin']['isTTY']&&process['stdout']['isTTY'];let _0x3d295b;if(_0x554336[_0x239165(0x185)])_0x3d295b=_0x554336[_0x239165(0x185)];else{if(_0x598d78){const _0x266bea=await _0x4ec7b7['prompt']([{'type':_0x239165(0x184),'name':_0x7a57fe['kcdDK'],'message':_0x7a57fe[_0x239165(0x19c)],'choices':[{'name':_0x239165(0x19f)+_0x18dd1a+')','value':_0x239165(0x18e)},{'name':'This\x20project\x20only\x20('+_0x423786+')','value':_0x239165(0x188)}]}]);_0x3d295b=_0x266bea['installLevel'];}else _0x3d295b=_0x7a57fe['ZqVgX'],console[_0x239165(0x19b)](_0x239165(0x187)+_0x423786+')');}let _0x52bb2d=0x0;const _0xbf266b=getCurrentVersion();console[_0x239165(0x19b)]('\x0a📦\x20Installing\x20skills...\x0a');try{const _0x2f3bf5=await _0x7a57fe['nUHqA'](installSkill,'ranger',{'cliVersion':_0xbf266b,'level':_0x3d295b,'platform':_0x260aae});_0x2f3bf5&&_0x52bb2d++;}catch(_0x4a49f4){console[_0x239165(0x18d)](_0x7a57fe['fIbRP'],_0x4a49f4 instanceof Error?_0x4a49f4['message']:_0x4a49f4);}if(_0x7a57fe[_0x239165(0x191)](_0x52bb2d,0x0)){const _0x59c9f4=_0x7a57fe['KkPUO'](_0x3d295b,_0x239165(0x18e))?'user-level':'project-level';console['log']('\x0a✅\x20Installed\x20'+_0x52bb2d+'\x20'+_0x59c9f4+_0x239165(0x1a2)+(_0x7a57fe['BpSTd'](_0x52bb2d,0x1)?'s':'')+_0x239165(0x1a6)),!_0x554336[_0x239165(0x183)]&&(console[_0x239165(0x19b)](_0x7a57fe[_0x239165(0x197)]),_0x260aae==='opencode'?console['log']('\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.'):console['log'](_0x7a57fe[_0x239165(0x1a9)]));}else console['log'](_0x7a57fe['SCNzZ']);}
|