@ranger-testing/ranger-cli 3.1.2-alpha.b450a14-41 → 3.1.3-alpha.e1ca941-42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/deleteProfile.js +1 -1
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/migrateProfile.js +1 -1
- package/build/commands/setup/claude.js +1 -1
- package/build/commands/setup/opencode.js +1 -1
- package/build/commands/setupCi.js +1 -1
- package/build/commands/skillup.js +1 -1
- package/build/commands/start.js +1 -1
- package/build/commands/status.js +1 -1
- package/build/commands/update.js +1 -1
- package/build/commands/updateEnv.js +1 -1
- package/build/commands/useEnv.js +1 -1
- package/build/commands/utils/activeProfile.js +1 -1
- package/build/commands/utils/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/cloudProfile.js +1 -1
- package/build/commands/utils/cloudProfileSession.js +1 -1
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/gitTracked.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/legacyWarning.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/matchAuthEnvironment.js +1 -1
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/novaActCli.js +1 -1
- package/build/commands/utils/opencodeConfig.js +1 -1
- package/build/commands/utils/organizationEnvApi.js +1 -1
- package/build/commands/utils/playwrightCli.js +1 -1
- package/build/commands/utils/profileMessages.js +1 -1
- package/build/commands/utils/profileSetupBanner.js +1 -1
- package/build/commands/utils/projectsConfig.js +1 -1
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/rangerwrightCli.js +1 -1
- package/build/commands/utils/resolveProfileContext.js +1 -1
- package/build/commands/utils/resolveProfileUrl.js +1 -1
- package/build/commands/utils/retry.js +1 -1
- package/build/commands/utils/sessionCache.js +1 -1
- package/build/commands/utils/settings.js +1 -1
- package/build/commands/utils/skillContent.js +1 -1
- package/build/commands/utils/skills.js +1 -1
- package/build/commands/utils/stitchWebmFiles.js +1 -1
- package/build/commands/utils/telemetry.js +1 -1
- package/build/commands/utils/tokenRefresh.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -1
- package/build/commands/utils/tunnelClient.js +1 -1
- package/build/commands/utils/userApi.js +1 -1
- package/build/commands/utils/version.js +1 -1
- package/build/commands/verifyFeature.js +1 -1
- package/build/commands/verifyFeatureCli.js +1 -1
- package/build/commands/verifyFeatureNovaCli.js +1 -1
- package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
- package/package.json +1 -1
package/build/commands/login.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2e49b8,_0x593794){const _0x5793ed=_0x2919,_0x27913b=_0x2e49b8();while(!![]){try{const _0x124cd1=parseInt(_0x5793ed(0xc1))/0x1*(parseInt(_0x5793ed(0xb9))/0x2)+parseInt(_0x5793ed(0xbf))/0x3*(parseInt(_0x5793ed(0xbc))/0x4)+parseInt(_0x5793ed(0xc2))/0x5*(parseInt(_0x5793ed(0xb8))/0x6)+-parseInt(_0x5793ed(0xc5))/0x7*(parseInt(_0x5793ed(0xc6))/0x8)+parseInt(_0x5793ed(0xbd))/0x9+parseInt(_0x5793ed(0xba))/0xa+-parseInt(_0x5793ed(0xbb))/0xb;if(_0x124cd1===_0x593794)break;else _0x27913b['push'](_0x27913b['shift']());}catch(_0x311b86){_0x27913b['push'](_0x27913b['shift']());}}}(_0x1f5f,0xcfa2c));function _0x1f5f(){const _0x1b0154=['4SxRcMt','13544973XpXGMv','\x0a✅\x20API\x20key\x20stored\x20successfully','14199hQqiCB','VfHsH','2qjbsOp','5rTzlpL','log','\x0a✅\x20Logged\x20in\x20to\x20','596106UdSfsN','48bnPpog','ANasI','7929498hUHBbP','993272uDbtaO','12752980PDZRlV','41123049gwRVfw'];_0x1f5f=function(){return _0x1b0154;};return _0x1f5f();}import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';function _0x2919(_0x5b41f3,_0x18ae64){_0x5b41f3=_0x5b41f3-0xb8;const _0x1f5ff5=_0x1f5f();let _0x2919b2=_0x1f5ff5[_0x5b41f3];return _0x2919b2;}import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';import{isInteractive}from'./utils/cloudProfileSession.js';export async function login(){const _0x2890ba=_0x2919,_0x3f1386={'qpClf':function(_0x1f64aa){return _0x1f64aa();},'ANasI':'Re-authenticating\x20via\x20MCP\x20bootstrap...','rYaIt':function(_0x234cb3){return _0x234cb3();},'VfHsH':function(_0x1abbf5,_0x40d162){return _0x1abbf5(_0x40d162);},'bEubQ':function(_0x3e08f6,_0x106ede){return _0x3e08f6 instanceof _0x106ede;}},_0x166c86=await _0x3f1386['qpClf'](getMcpAuthOrigin);if(_0x166c86){console['log'](_0x3f1386[_0x2890ba(0xc7)]),await _0x3f1386['rYaIt'](mcpBootstrap);return;}if(!isInteractive())throw new Error('Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.');try{const _0x4320d7=await runDeviceAuthFlow(),_0x47327f=await _0x3f1386[_0x2890ba(0xc0)](getCurrentUser,_0x4320d7);_0x47327f['success']?console['log'](_0x2890ba(0xc4)+_0x47327f['user']['organizationName']):console[_0x2890ba(0xc3)](_0x2890ba(0xbe));}catch(_0xc3e824){throw new Error('Login\x20failed:\x20'+(_0x3f1386['bEubQ'](_0xc3e824,Error)?_0xc3e824['message']:_0xc3e824));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x4fe080=_0x5598;(function(_0x3d7251,_0x9d01dc){const _0xc0be5b=_0x5598,_0x5d42c9=_0x3d7251();while(!![]){try{const _0x11feb6=parseInt(_0xc0be5b(0x13f))/0x1*(-parseInt(_0xc0be5b(0xed))/0x2)+-parseInt(_0xc0be5b(0x144))/0x3*(-parseInt(_0xc0be5b(0x14b))/0x4)+-parseInt(_0xc0be5b(0xe5))/0x5+parseInt(_0xc0be5b(0x127))/0x6+-parseInt(_0xc0be5b(0x110))/0x7+-parseInt(_0xc0be5b(0xd6))/0x8+parseInt(_0xc0be5b(0xe0))/0x9*(parseInt(_0xc0be5b(0xf4))/0xa);if(_0x11feb6===_0x9d01dc)break;else _0x5d42c9['push'](_0x5d42c9['shift']());}catch(_0x390fab){_0x5d42c9['push'](_0x5d42c9['shift']());}}}(_0x5c15,0x831a1));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger',_0x4fe080(0x106)),AUTH_ORIGIN_PATH=join(homedir(),'.ranger',_0x4fe080(0x148));export async function getMcpAuthOrigin(){const _0x3dad5a=_0x4fe080,_0x8f051c={'cwtcg':'utf-8','WSlTn':function(_0x30251a,_0x3f7903){return _0x30251a||_0x3f7903;}};try{const _0x59e8fa=(await readFile(AUTH_ORIGIN_PATH,_0x8f051c[_0x3dad5a(0xcd)]))[_0x3dad5a(0xf9)]();return _0x8f051c[_0x3dad5a(0x136)](_0x59e8fa,null);}catch{return null;}}export async function mcpBootstrap(){const _0x5d6f4f=_0x4fe080,_0x57e091={'RovUt':function(_0x97b936){return _0x97b936();},'CtTmP':function(_0x46f056,_0x1aa651){return _0x46f056(_0x1aa651);},'XssSr':function(_0x5c6c61,_0x21b24a){return _0x5c6c61===_0x21b24a;},'gRUPN':function(_0x30e8ab,_0x491abd){return _0x30e8ab(_0x491abd);}},_0x57587f=_0x57e091['RovUt'](getMcpAuthUrl);currentOrigin=_0x57587f;const _0x356d8c=process['stdout']['isTTY']??![];console['log']('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x57587f+'\x0a');const _0x3ca093=await _0x57e091[_0x5d6f4f(0x140)](tryUnauthenticated,_0x57587f);let _0x36da9f=null;if(_0x57e091['XssSr'](_0x3ca093,'proxied'))_0x36da9f='';else{_0x36da9f=await loadCachedToken();if(!_0x36da9f){if(!_0x356d8c)throw new Error('MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a'+_0x5d6f4f(0xc2));_0x36da9f=await _0x57e091[_0x5d6f4f(0xfc)](oauthFlow,_0x57587f);}}await callGetCliToken(_0x57587f,_0x36da9f);}async function tryUnauthenticated(_0xf8f1d9){const _0xfe7b76=_0x4fe080,_0x4690ba={'mAysf':function(_0x1cfaf9,_0x42177f,_0x565aa2){return _0x1cfaf9(_0x42177f,_0x565aa2);},'FmHef':'application/json,\x20text/event-stream','bFqPL':_0xfe7b76(0xc7),'mhURq':_0xfe7b76(0x10c),'RMTXP':_0xfe7b76(0x14d),'FgKAA':'1.0.0','NyqHu':'proxied','HYIlD':function(_0x16a2d7,_0x56018b){return _0x16a2d7===_0x56018b;}},_0x22faf0=await _0x4690ba[_0xfe7b76(0x11d)](fetch,_0xf8f1d9,{'method':_0xfe7b76(0xe7),'headers':{'Content-Type':_0xfe7b76(0x11a),'Accept':_0x4690ba['FmHef']},'body':JSON['stringify']({'jsonrpc':_0x4690ba[_0xfe7b76(0x112)],'id':0x1,'method':'initialize','params':{'protocolVersion':_0x4690ba['mhURq'],'capabilities':{},'clientInfo':{'name':_0x4690ba['RMTXP'],'version':_0x4690ba['FgKAA']}}})});if(_0x22faf0['ok'])return await _0x22faf0[_0xfe7b76(0xda)](),_0x4690ba['NyqHu'];if(_0x4690ba['HYIlD'](_0x22faf0['status'],0x191))return await _0x22faf0['text'](),_0xfe7b76(0xf1);const _0x574441=await _0x22faf0[_0xfe7b76(0xda)]();throw new Error(_0xfe7b76(0x10f)+_0x22faf0['status']+':\x20'+_0x574441);}function _0x5598(_0x119ce8,_0x26e5e7){_0x119ce8=_0x119ce8-0xc2;const _0x5c1566=_0x5c15();let _0x559895=_0x5c1566[_0x119ce8];return _0x559895;}class OAuthTimeoutError extends Error{constructor(_0x4ad7a9){const _0x56b168=_0x4fe080,_0x27a439={'JLoRL':'OAuthTimeoutError'};super(_0x4ad7a9),this['name']=_0x27a439[_0x56b168(0xdd)];}}async function oauthFlow(_0x4ec4ea){const _0x2e65d2=_0x4fe080,_0x512af6={'jLIrV':function(_0x2416ac,_0x3f8011){return _0x2416ac(_0x3f8011);},'gntAj':_0x2e65d2(0x133)};try{return await _0x512af6['jLIrV'](oauthFlowAttempt,_0x4ec4ea);}catch(_0x25a9df){if(_0x25a9df instanceof OAuthTimeoutError&&await loadCachedClient())return console['log'](_0x512af6[_0x2e65d2(0x149)]),await clearCachedClient(),await oauthFlowAttempt(_0x4ec4ea);throw _0x25a9df;}}async function oauthFlowAttempt(_0x1191ac){const _0x4d2428=_0x4fe080,_0x44e8d8={'btZAt':'Discovering\x20authorization\x20server...','trJwi':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','HCDKn':_0x4d2428(0x12b),'oVKvR':_0x4d2428(0xe7),'MILVe':_0x4d2428(0xc4),'Grxku':_0x4d2428(0xec),'QPXwS':'Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','AXtrq':function(_0x4bb9a7,_0x4e66bd){return _0x4bb9a7(_0x4e66bd);},'JsTJB':'sha256','GqQaa':function(_0x30056a,_0xcaaffd){return _0x30056a(_0xcaaffd);},'MntnH':'hex','OrxSo':_0x4d2428(0xeb),'znGrg':_0x4d2428(0x13a),'WBswi':_0x4d2428(0x122),'LeEaK':'code_challenge_method','kFevX':_0x4d2428(0x111),'DRInj':'resource','cDnIQ':_0x4d2428(0xff),'xigqE':_0x4d2428(0x132),'sslYF':function(_0x5d1483,_0x507c4c,_0x65fea1){return _0x5d1483(_0x507c4c,_0x65fea1);},'OLJrb':_0x4d2428(0xc5)},_0x28522d=_0x1191ac['replace'](/\/mcp$/,'');process['stdout'][_0x4d2428(0xdc)](_0x44e8d8[_0x4d2428(0x138)]);const _0x342f0e=await fetch(_0x28522d+_0x4d2428(0xc6));if(!_0x342f0e['ok'])throw new Error(_0x44e8d8[_0x4d2428(0xc3)]);const _0x39b199=await _0x342f0e['json'](),_0x29ebb6=_0x39b199['authorization_servers']?.[0x0];if(!_0x29ebb6)throw new Error('No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata');console[_0x4d2428(0x14f)]('\x20'+_0x29ebb6);const _0x30d34f=await fetchAuthServerMetadata(_0x29ebb6);let _0x5ee89a,_0x5d7d79;const _0x1c5679=await loadCachedClient();if(_0x1c5679)_0x5ee89a=_0x1c5679[_0x4d2428(0x141)],_0x5d7d79=_0x1c5679[_0x4d2428(0x121)];else{if(_0x30d34f['registration_endpoint']){process['stdout']['write'](_0x44e8d8['HCDKn']);const _0x3d3560=await fetch(_0x30d34f['registration_endpoint'],{'method':_0x44e8d8['oVKvR'],'headers':{'Content-Type':'application/json'},'body':JSON[_0x4d2428(0x12e)]({'client_name':_0x44e8d8['MILVe'],'redirect_uris':['http://localhost:'+CALLBACK_PORT+_0x4d2428(0x12a)],'grant_types':[_0x44e8d8[_0x4d2428(0x13c)],'refresh_token'],'response_types':['code'],'token_endpoint_auth_method':_0x4d2428(0x113)})});if(!_0x3d3560['ok']){const _0x354190=await _0x3d3560['text']();throw new Error('Client\x20registration\x20failed:\x20'+_0x354190);}const _0x190cb0=await _0x3d3560['json']();_0x5ee89a=_0x190cb0[_0x4d2428(0x13a)],_0x5d7d79=_0x190cb0['client_secret'],await saveCachedClient(_0x5ee89a,_0x5d7d79),console['log']('\x20done');}else throw new Error(_0x44e8d8[_0x4d2428(0xca)]);}const _0x46b20c=randomBytes(0x20)[_0x4d2428(0xfa)]('base64url'),_0x166483=_0x44e8d8[_0x4d2428(0xdb)](createHash,_0x44e8d8['JsTJB'])['update'](_0x46b20c)[_0x4d2428(0xf0)]('base64url'),_0x5ce671=_0x44e8d8['GqQaa'](randomBytes,0x10)['toString'](_0x44e8d8[_0x4d2428(0x14a)]),_0x1f6ada=new URL(_0x30d34f['authorization_endpoint']);_0x1f6ada['searchParams']['set'](_0x44e8d8['OrxSo'],'code'),_0x1f6ada[_0x4d2428(0xf8)]['set'](_0x44e8d8['znGrg'],_0x5ee89a),_0x1f6ada['searchParams'][_0x4d2428(0x11f)]('redirect_uri','http://localhost:'+CALLBACK_PORT+_0x4d2428(0x12a)),_0x1f6ada['searchParams'][_0x4d2428(0x11f)](_0x44e8d8[_0x4d2428(0x104)],_0x166483),_0x1f6ada[_0x4d2428(0xf8)]['set'](_0x44e8d8['LeEaK'],_0x4d2428(0xde)),_0x1f6ada[_0x4d2428(0xf8)][_0x4d2428(0x11f)](_0x44e8d8[_0x4d2428(0x137)],_0x5ce671);_0x39b199[_0x4d2428(0x142)]&&_0x1f6ada['searchParams'][_0x4d2428(0x11f)](_0x44e8d8['DRInj'],_0x39b199[_0x4d2428(0x142)]);console[_0x4d2428(0x14f)](_0x44e8d8['cDnIQ']),console[_0x4d2428(0x14f)](_0x4d2428(0x13d)+_0x1f6ada['toString']()+'\x0a'),await openBrowser(_0x1f6ada['toString']());const _0x1aeadf=await waitForCallback(_0x5ce671);process['stdout'][_0x4d2428(0xdc)](_0x44e8d8['xigqE']);const _0x534309=new URLSearchParams({'grant_type':_0x44e8d8[_0x4d2428(0x13c)],'code':_0x1aeadf,'redirect_uri':_0x4d2428(0x124)+CALLBACK_PORT+'/callback','client_id':_0x5ee89a,'code_verifier':_0x46b20c});_0x5d7d79&&_0x534309['set'](_0x4d2428(0x100),_0x5d7d79);_0x39b199[_0x4d2428(0x142)]&&_0x534309[_0x4d2428(0x11f)](_0x4d2428(0x142),_0x39b199['resource']);const _0x128900=await _0x44e8d8[_0x4d2428(0xd2)](fetch,_0x30d34f['token_endpoint'],{'method':_0x4d2428(0xe7),'headers':{'Content-Type':_0x4d2428(0xdf)},'body':_0x534309});if(!_0x128900['ok']){const _0x1debbd=await _0x128900[_0x4d2428(0xda)]();throw new Error(_0x4d2428(0xfd)+_0x1debbd);}const _0x300751=await _0x128900[_0x4d2428(0x102)]();return console[_0x4d2428(0x14f)](_0x44e8d8['OLJrb']),await saveCachedToken(_0x300751[_0x4d2428(0x12d)],_0x300751[_0x4d2428(0x14e)],_0x300751['expires_in']),_0x300751[_0x4d2428(0x12d)];}async function callGetCliToken(_0x750e7f,_0x267d60){const _0x3c57aa=_0x4fe080,_0x59fa05={'jCgNP':function(_0x5b9708,_0x569c68,_0x157556){return _0x5b9708(_0x569c68,_0x157556);},'oxXtR':_0x3c57aa(0xe7),'WgKzj':'application/json','DnfDK':function(_0x2a6975,_0x5e20b7){return _0x2a6975(_0x5e20b7);},'WTbzE':'2025-03-26','fqTQT':'1.0.0','thDIs':_0x3c57aa(0xc5),'oMGyU':_0x3c57aa(0xc7),'vrRBk':_0x3c57aa(0x129),'DQEkc':'tools/call','IdfWn':'get_cli_token','yOZoi':_0x3c57aa(0x12c),'odSRK':function(_0x273d9f){return _0x273d9f();},'kKNNL':_0x3c57aa(0x12f),'wuczA':function(_0x2e3b42,_0xa387f3,_0x182a84,_0x3dfd3a){return _0x2e3b42(_0xa387f3,_0x182a84,_0x3dfd3a);},'okJMk':_0x3c57aa(0xfb)},_0x1c0b6f={'Content-Type':_0x59fa05[_0x3c57aa(0x130)],'Accept':'application/json,\x20text/event-stream'};_0x267d60&&(_0x1c0b6f['Authorization']='Bearer\x20'+_0x267d60);const _0x3e68c3=async _0x1eb8a3=>{const _0x28d5ef=_0x3c57aa,_0x32d098=await _0x59fa05[_0x28d5ef(0xd0)](fetch,_0x750e7f,{'method':_0x59fa05[_0x28d5ef(0xf5)],'headers':_0x1c0b6f,'body':JSON[_0x28d5ef(0x12e)](_0x1eb8a3)});if(!_0x32d098['ok']){const _0x30ec33=await _0x32d098['text']();throw new Error('HTTP\x20'+_0x32d098['status']+':\x20'+_0x30ec33);}return parseResponse(_0x32d098);};process['stdout']['write'](_0x3c57aa(0xf2));const _0x11b597=await _0x59fa05[_0x3c57aa(0x108)](_0x3e68c3,{'jsonrpc':_0x3c57aa(0xc7),'id':0x1,'method':_0x3c57aa(0xe8),'params':{'protocolVersion':_0x59fa05['WTbzE'],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x59fa05['fqTQT']}}});if(_0x11b597['error'])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x11b597['error'][_0x3c57aa(0x143)]??JSON[_0x3c57aa(0x12e)](_0x11b597[_0x3c57aa(0xd3)])));console[_0x3c57aa(0x14f)](_0x59fa05[_0x3c57aa(0xea)]),await fetch(_0x750e7f,{'method':_0x59fa05['oxXtR'],'headers':_0x1c0b6f,'body':JSON[_0x3c57aa(0x12e)]({'jsonrpc':_0x59fa05[_0x3c57aa(0xe4)],'method':_0x3c57aa(0x13e)})})['then'](_0x448c49=>_0x448c49[_0x3c57aa(0xda)]()),process[_0x3c57aa(0xd1)][_0x3c57aa(0xdc)](_0x59fa05[_0x3c57aa(0xcb)]);const _0x227b1a=await _0x59fa05['DnfDK'](_0x3e68c3,{'jsonrpc':_0x59fa05[_0x3c57aa(0xe4)],'id':0x2,'method':_0x59fa05['DQEkc'],'params':{'name':_0x59fa05[_0x3c57aa(0x120)],'arguments':{}}});if(_0x227b1a[_0x3c57aa(0xd3)])throw new Error(_0x3c57aa(0x126)+(_0x227b1a[_0x3c57aa(0xd3)]['message']??JSON['stringify'](_0x227b1a['error'])));console[_0x3c57aa(0x14f)](_0x59fa05['thDIs']);const _0x281195=extractToken(_0x227b1a['result']);if(!_0x281195){console[_0x3c57aa(0xd3)](_0x59fa05[_0x3c57aa(0x135)]),console['error'](JSON['stringify'](_0x227b1a['result'],null,0x2));throw new Error('Could\x20not\x20extract\x20token\x20from\x20MCP\x20response');}const _0x56c17e=join(_0x59fa05['odSRK'](homedir),_0x59fa05['kKNNL']),_0x3573e9=_0x59fa05[_0x3c57aa(0xd0)](join,_0x56c17e,_0x3c57aa(0xce));await _0x59fa05['jCgNP'](mkdir,_0x56c17e,{'recursive':!![]}),await _0x59fa05['wuczA'](writeFile,_0x3573e9,_0x281195,{'mode':0x180}),await writeFile(join(_0x56c17e,'auth-origin.txt'),_0x750e7f,{'mode':0x180}),console[_0x3c57aa(0x14f)]('\x0aToken\x20written\x20to\x20'+_0x3573e9),console[_0x3c57aa(0x14f)](_0x59fa05[_0x3c57aa(0xf7)]);}async function fetchAuthServerMetadata(_0x3ef6ac){const _0x349f21=_0x4fe080,_0x44467c=_0x3ef6ac+'/.well-known/oauth-authorization-server',_0xc14f23=await fetch(_0x44467c);if(!_0xc14f23['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x44467c+':\x20'+_0xc14f23[_0x349f21(0xf6)]);return _0xc14f23[_0x349f21(0x102)]();}function waitForCallback(_0x174615){const _0x46ce69=_0x4fe080,_0x47098e={'UJlFe':function(_0x5c1a46,_0x2ee73b){return _0x5c1a46(_0x2ee73b);},'bjwpD':_0x46ce69(0xc8),'cFljV':function(_0xefd52e){return _0xefd52e();}};return new Promise((_0x5e1036,_0x3b1a22)=>{const _0x46f0d1=_0x46ce69,_0x3326f7={'bHHmf':function(_0x24634a,_0x4ad361){return _0x24634a!==_0x4ad361;},'mgfgh':_0x46f0d1(0x103),'lAVKb':_0x47098e['bjwpD'],'wIPHt':_0x46f0d1(0x131),'RPmnq':_0x46f0d1(0x14c),'wtHsx':function(_0x8cafc7,_0x20f970){return _0x47098e['UJlFe'](_0x8cafc7,_0x20f970);},'gQRWD':function(_0x5db9c5){return _0x47098e['cFljV'](_0x5db9c5);},'Ryxkg':'<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>'},_0x39ed40=()=>{const _0x113d5a=_0x46f0d1;_0x3c0ea5['closeAllConnections'](),_0x3c0ea5[_0x113d5a(0x101)]();},_0x1a3262=setTimeout(()=>{const _0x576eb9=_0x46f0d1;_0x39ed40(),_0x47098e[_0x576eb9(0x11e)](_0x3b1a22,new OAuthTimeoutError('OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes'));},0x1d4c0),_0x3c0ea5=createServer((_0x2fabe3,_0xb64723)=>{const _0x365bda=_0x46f0d1,_0x279342=new URL(_0x2fabe3['url']??'/',_0x365bda(0x124)+CALLBACK_PORT);if(_0x3326f7['bHHmf'](_0x279342['pathname'],'/callback')){_0xb64723[_0x365bda(0x10d)](0x194),_0xb64723[_0x365bda(0x107)](_0x3326f7[_0x365bda(0xd9)]);return;}const _0x4c8c00=_0x279342[_0x365bda(0xf8)][_0x365bda(0xe1)](_0x3326f7[_0x365bda(0x10b)]),_0x5000ae=_0x279342['searchParams']['get'](_0x365bda(0x111)),_0x131cee=_0x279342[_0x365bda(0xf8)][_0x365bda(0xe1)](_0x365bda(0xd3));if(_0x131cee){const _0x540784=_0x279342['searchParams']['get'](_0x3326f7[_0x365bda(0x128)])??_0x131cee;_0xb64723['writeHead'](0xc8,{'Content-Type':_0x3326f7[_0x365bda(0x147)]}),_0xb64723[_0x365bda(0x107)]('<html><body><h2>Authentication\x20failed</h2><p>'+_0x540784+_0x365bda(0x114)),_0x3326f7['wtHsx'](clearTimeout,_0x1a3262),_0x3326f7[_0x365bda(0xcc)](_0x39ed40),_0x3b1a22(new Error('OAuth\x20error:\x20'+_0x540784));return;}if(!_0x4c8c00||_0x3326f7[_0x365bda(0x105)](_0x5000ae,_0x174615)){_0xb64723[_0x365bda(0x10d)](0x190,{'Content-Type':_0x365bda(0x14c)}),_0xb64723['end'](_0x3326f7['Ryxkg']);return;}_0xb64723[_0x365bda(0x10d)](0xc8,{'Content-Type':_0x3326f7[_0x365bda(0x147)]}),_0xb64723[_0x365bda(0x107)]('<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>'),clearTimeout(_0x1a3262),_0x39ed40(),_0x3326f7['wtHsx'](_0x5e1036,_0x4c8c00);});_0x3c0ea5[_0x46f0d1(0x146)](CALLBACK_PORT,'127.0.0.1');});}async function openBrowser(_0x43f865){const _0x460c12=_0x4fe080,_0x2b403e={'dXVky':function(_0x2b5a21,_0x3c662f){return _0x2b5a21===_0x3c662f;},'gxDFT':_0x460c12(0x109),'KUqsF':'win32','vUzye':_0x460c12(0xf3)},_0x158f26=_0x2b403e['dXVky'](process[_0x460c12(0xc9)],_0x2b403e[_0x460c12(0xd7)])?_0x460c12(0x139):process[_0x460c12(0xc9)]===_0x2b403e[_0x460c12(0x11b)]?'start':_0x2b403e[_0x460c12(0xee)];exec(_0x158f26+'\x20\x22'+_0x43f865+'\x22');}function _0x5c15(){const _0x4d7c83=['thDIs','response_type','authorization_code','18nTtpuz','vUzye','origin','digest','needs-oauth','Initializing\x20MCP\x20session...','xdg-open','22579610hevkEL','oxXtR','status','okJMk','searchParams','trim','toString','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','gRUPN','Token\x20exchange\x20failed:\x20','LvIBt','\x0aOpening\x20browser\x20for\x20authentication...','client_secret','close','json','Not\x20found','WBswi','bHHmf','mcp-oauth-tokens.json','end','DnfDK','darwin','gfLug','lAVKb','2025-03-26','writeHead','refreshToken','MCP\x20server\x20returned\x20HTTP\x20','7178668KgUlPF','state','bFqPL','none','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','parse','startsWith','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','headers','oqSWo','application/json','KUqsF','iHcJn','mAysf','UJlFe','set','IdfWn','clientSecret','code_challenge','accessToken','http://localhost:','data:','get_cli_token\x20failed:\x20','520068pdHlDb','wIPHt','Requesting\x20CLI\x20token...','/callback','Registering\x20OAuth\x20client...','\x0aUnexpected\x20response\x20structure:','access_token','stringify','.ranger','WgKzj','error_description','Exchanging\x20authorization\x20code...','\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','string','yOZoi','WSlTn','kFevX','btZAt','open','client_id','zptuA','Grxku','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','notifications/initialized','83221uskVpm','CtTmP','clientId','resource','message','525SDUxpV','zNskR','listen','RPmnq','auth-origin.txt','gntAj','MntnH','10876cVIqPT','text/html','ranger-cli','refresh_token','log','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','trJwi','Ranger\x20CLI','\x20done','/.well-known/oauth-protected-resource','2.0','code','platform','QPXwS','vrRBk','gQRWD','cwtcg','refresh.txt','content','jCgNP','stdout','sslYF','error','token','text/event-stream','3443712KegLnR','gxDFT','now','mgfgh','text','AXtrq','write','JLoRL','S256','application/x-www-form-urlencoded','9uLXqTA','get','utf-8','iauBG','oMGyU','392470EVTtDH','content-type','POST','initialize','slice'];_0x5c15=function(){return _0x4d7c83;};return _0x5c15();}let currentOrigin='';async function loadCachedToken(){const _0x20c477=_0x4fe080,_0x171c1c={'gfLug':function(_0x56fda3,_0x46ab4f,_0x4c4fe0){return _0x56fda3(_0x46ab4f,_0x4c4fe0);},'KJMye':_0x20c477(0xe2)};try{const _0xbf4355=JSON[_0x20c477(0x115)](await _0x171c1c[_0x20c477(0x10a)](readFile,TOKEN_CACHE_PATH,_0x171c1c['KJMye']));if(_0xbf4355['origin']&&_0xbf4355['origin']!==currentOrigin)return null;if(_0xbf4355['expiresAt']&&Date[_0x20c477(0xd8)]()>_0xbf4355['expiresAt'])return null;return _0xbf4355[_0x20c477(0x123)]??null;}catch{return null;}}async function saveCachedToken(_0x4fd9f0,_0x366dad,_0x43cafc){const _0x4c55b3=_0x4fe080,_0x3c3767={'zNskR':function(_0x3526c0,_0x4952c6){return _0x3526c0+_0x4952c6;},'MrovC':function(_0x2f5f76){return _0x2f5f76();},'TQKSU':_0x4c55b3(0x12f)},_0x465964=await loadCachedData(),_0x9dcb34={..._0x465964,'origin':currentOrigin,'accessToken':_0x4fd9f0,'refreshToken':_0x366dad??_0x465964?.[_0x4c55b3(0x10e)],'expiresAt':_0x43cafc?_0x3c3767[_0x4c55b3(0x145)](Date[_0x4c55b3(0xd8)](),_0x43cafc*0x3e8):undefined};await mkdir(join(_0x3c3767['MrovC'](homedir),_0x3c3767['TQKSU']),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x9dcb34),{'mode':0x180});}async function loadCachedClient(){const _0x3133d5=_0x4fe080,_0x1b0eaf=await loadCachedData();if(_0x1b0eaf?.['origin']&&_0x1b0eaf[_0x3133d5(0xef)]!==currentOrigin)return null;return _0x1b0eaf?.['clientId']?{'clientId':_0x1b0eaf[_0x3133d5(0x141)],'clientSecret':_0x1b0eaf[_0x3133d5(0x121)]}:null;}async function clearCachedClient(){const _0x5b5e95=_0x4fe080,_0x3ded10={'iHcJn':function(_0x37498c){return _0x37498c();},'LvIBt':function(_0x503d6e,_0x4fa3b8,_0x340219,_0x47b752){return _0x503d6e(_0x4fa3b8,_0x340219,_0x47b752);}},_0x3f0d4f=await _0x3ded10[_0x5b5e95(0x11c)](loadCachedData);if(!_0x3f0d4f)return;const {clientId:_0x84b607,clientSecret:_0x3ea6bd,..._0x450dab}=_0x3f0d4f;await _0x3ded10[_0x5b5e95(0xfe)](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x450dab),{'mode':0x180});}async function saveCachedClient(_0x119b91,_0x547299){const _0x1a9f3d=_0x4fe080,_0xc7c1d={'zptuA':function(_0x57af86,_0x5d512c,_0x2e73ac){return _0x57af86(_0x5d512c,_0x2e73ac);},'oqSWo':'.ranger'},_0x5104b3=await loadCachedData(),_0x48b2e7={..._0x5104b3,'origin':currentOrigin,'accessToken':_0x5104b3?.['accessToken']??'','clientId':_0x119b91,'clientSecret':_0x547299};await _0xc7c1d[_0x1a9f3d(0x13b)](mkdir,_0xc7c1d['zptuA'](join,homedir(),_0xc7c1d[_0x1a9f3d(0x119)]),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x48b2e7),{'mode':0x180});}async function loadCachedData(){const _0x238809=_0x4fe080;try{return JSON[_0x238809(0x115)](await readFile(TOKEN_CACHE_PATH,_0x238809(0xe2)));}catch{return null;}}async function parseResponse(_0xb9e6e9){const _0x26754f=_0x4fe080,_0x56595d={'wUnTi':_0x26754f(0xd5),'qHfkj':_0x26754f(0x125),'iauBG':_0x26754f(0x117)},_0x505d22=_0xb9e6e9[_0x26754f(0x118)][_0x26754f(0xe1)](_0x26754f(0xe6))??'';if(_0x505d22['includes'](_0x56595d['wUnTi'])){const _0x230b64=await _0xb9e6e9['text']();for(const _0x41e071 of _0x230b64['split']('\x0a')){const _0x2c34d0=_0x41e071[_0x26754f(0xf9)]();if(_0x2c34d0[_0x26754f(0x116)]('data:')){const _0x4491ae=_0x2c34d0[_0x26754f(0xe9)](_0x56595d['qHfkj']['length'])['trim']();if(!_0x4491ae)continue;try{const _0x3abfce=JSON['parse'](_0x4491ae);if(_0x3abfce['id']!==undefined||_0x3abfce[_0x26754f(0xd3)])return _0x3abfce;}catch{}}}throw new Error(_0x56595d[_0x26754f(0xe3)]);}return _0xb9e6e9['json']();}function extractToken(_0xa7175b){const _0x58bf7a=_0x4fe080,_0x366d10={'isugs':_0x58bf7a(0x134)};if(!_0xa7175b)return null;const _0x3cf8e3=_0xa7175b['structuredContent'];if(_0x3cf8e3?.[_0x58bf7a(0xd4)]&&typeof _0x3cf8e3['token']==='string')return _0x3cf8e3['token'];if(_0xa7175b['isError']){const _0x15d703=_0xa7175b['content'];throw new Error('Server\x20returned\x20error:\x20'+(_0x15d703?.[0x0]?.[_0x58bf7a(0xda)]??'Unknown\x20error'));}const _0x1f420d=_0xa7175b[_0x58bf7a(0xcf)];if(_0x1f420d)for(const _0x4523e8 of _0x1f420d){if(_0x4523e8['type']==='text'&&_0x4523e8[_0x58bf7a(0xda)]){try{const _0x1ecf2b=JSON['parse'](_0x4523e8['text']);if(typeof _0x1ecf2b?.['token']===_0x366d10['isugs'])return _0x1ecf2b[_0x58bf7a(0xd4)];}catch{}const _0x4a4e0f=_0x4523e8['text']['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x4a4e0f)return _0x4a4e0f[0x1];}}return null;}
|
|
1
|
+
const _0x3e5f9f=_0x4f7e;(function(_0xf561c7,_0x22e5ef){const _0x589946=_0x4f7e,_0x4bb780=_0xf561c7();while(!![]){try{const _0x2801ff=-parseInt(_0x589946(0x1bd))/0x1+-parseInt(_0x589946(0x1fe))/0x2+parseInt(_0x589946(0x232))/0x3*(parseInt(_0x589946(0x201))/0x4)+-parseInt(_0x589946(0x235))/0x5+-parseInt(_0x589946(0x1ec))/0x6+parseInt(_0x589946(0x20e))/0x7+parseInt(_0x589946(0x222))/0x8;if(_0x2801ff===_0x22e5ef)break;else _0x4bb780['push'](_0x4bb780['shift']());}catch(_0x144566){_0x4bb780['push'](_0x4bb780['shift']());}}}(_0x402d,0x9e9a3));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),_0x3e5f9f(0x228),_0x3e5f9f(0x1eb)),AUTH_ORIGIN_PATH=join(homedir(),'.ranger','auth-origin.txt');function _0x4f7e(_0x51ec39,_0x22c921){_0x51ec39=_0x51ec39-0x1bd;const _0x402d50=_0x402d();let _0x4f7e16=_0x402d50[_0x51ec39];return _0x4f7e16;}export async function getMcpAuthOrigin(){const _0x4e4e7e=_0x3e5f9f,_0x1e0e3c={'eDJDj':function(_0x41982f,_0x51996b){return _0x41982f||_0x51996b;}};try{const _0x936b3d=(await readFile(AUTH_ORIGIN_PATH,_0x4e4e7e(0x20b)))['trim']();return _0x1e0e3c[_0x4e4e7e(0x1e4)](_0x936b3d,null);}catch{return null;}}export async function mcpBootstrap(){const _0x39a96e=_0x3e5f9f,_0x215bbf={'vFRDb':function(_0x27d45c,_0x527963){return _0x27d45c(_0x527963);},'gbouf':function(_0x5a8d12,_0xf63bb7){return _0x5a8d12===_0xf63bb7;},'ROTpf':'proxied','jDXrP':function(_0x2caf10){return _0x2caf10();},'JPsQB':function(_0x81e665,_0x4948b8){return _0x81e665+_0x4948b8;},'iSokj':function(_0x41d137,_0x282668,_0x4e32b3){return _0x41d137(_0x282668,_0x4e32b3);}},_0x1b7c1a=getMcpAuthUrl();currentOrigin=_0x1b7c1a;const _0x5d7bf9=process['stdout'][_0x39a96e(0x213)]??![];console['log'](_0x39a96e(0x207)+_0x1b7c1a+'\x0a');const _0x443832=await _0x215bbf['vFRDb'](tryUnauthenticated,_0x1b7c1a);let _0x41989a=null;if(_0x215bbf[_0x39a96e(0x1dd)](_0x443832,_0x215bbf[_0x39a96e(0x1bf)]))_0x41989a='';else{_0x41989a=await _0x215bbf[_0x39a96e(0x217)](loadCachedToken);if(!_0x41989a){if(!_0x5d7bf9)throw new Error(_0x215bbf[_0x39a96e(0x1f6)]('MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a',_0x39a96e(0x1f1)));_0x41989a=await oauthFlow(_0x1b7c1a);}}await _0x215bbf['iSokj'](callGetCliToken,_0x1b7c1a,_0x41989a);}async function tryUnauthenticated(_0x1b7df4){const _0x4e7808=_0x3e5f9f,_0x49a94d={'mVAFZ':function(_0xcc3ab6,_0x65b67b,_0x26c42c){return _0xcc3ab6(_0x65b67b,_0x26c42c);},'yBafm':'application/json','yGqtn':_0x4e7808(0x1d2),'Bcgth':_0x4e7808(0x215),'NIMBe':'2025-03-26','IqiZk':_0x4e7808(0x239),'pDPPT':function(_0xdecb08,_0x50a975){return _0xdecb08===_0x50a975;},'tyVOk':_0x4e7808(0x1e2)},_0x1cc78f=await _0x49a94d[_0x4e7808(0x21b)](fetch,_0x1b7df4,{'method':_0x4e7808(0x220),'headers':{'Content-Type':_0x49a94d[_0x4e7808(0x230)],'Accept':_0x49a94d[_0x4e7808(0x1c1)]},'body':JSON[_0x4e7808(0x1f7)]({'jsonrpc':_0x49a94d[_0x4e7808(0x1ff)],'id':0x1,'method':'initialize','params':{'protocolVersion':_0x49a94d[_0x4e7808(0x200)],'capabilities':{},'clientInfo':{'name':_0x49a94d[_0x4e7808(0x1fd)],'version':_0x4e7808(0x227)}}})});if(_0x1cc78f['ok'])return await _0x1cc78f['text'](),'proxied';if(_0x49a94d['pDPPT'](_0x1cc78f['status'],0x191))return await _0x1cc78f[_0x4e7808(0x1be)](),_0x49a94d[_0x4e7808(0x22e)];const _0x4b5f10=await _0x1cc78f[_0x4e7808(0x1be)]();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x1cc78f[_0x4e7808(0x22b)]+':\x20'+_0x4b5f10);}function _0x402d(){const _0x3e8913=['EubvA','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','hKHAO','accessToken','open','update','platform','/callback','jkQMZ','rqwHz','Token\x20exchange\x20failed:\x20','startsWith','data:','text/event-stream','get','Client\x20registration\x20failed:\x20','gJLzQ','PxAyN','86471eIGZkd','text','ROTpf','application/json','yGqtn','resource','set','UTPqf','NSInv','string','xdg-open','code','code_challenge_method','XvDer','JWiOC','headers','PRIUu','clientId','end','authorization_code','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','application/json,\x20text/event-stream','JugaR','result','token_endpoint','log','QEyzg','origin','iMLTv','hPVgz','\x20done','toString','gbouf','error','JgQRK','\x0aUnexpected\x20response\x20structure:','sha256','needs-oauth','dKOGi','eDJDj','wGsqa','writeHead','write','client_secret','expires_in','dLUBm','mcp-oauth-tokens.json','739008EtgdCj','closeAllConnections','pathname','initialize','error_description','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','content-type','type','slice','searchParams','JPsQB','stringify','uRmAo','ulOZS','http://localhost:','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','refresh_token','IqiZk','1749024MDIGHh','Bcgth','NIMBe','4SThiqz','stdout','message','content','sWzWl','fMFkq','\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20','client_id','split','YPqTG','utf-8','HTTP\x20','trim','4110519kmcVgE','parse','127.0.0.1','OpyoQ','auth-origin.txt','isTTY','uWYLo','2.0','TGrrV','jDXrP','yKsPu','OAKQH','AwtBc','mVAFZ','OAuthTimeoutError','token','json','QXwPY','POST','<html><body><h2>Authentication\x20failed</h2><p>','4991752jnKebZ','authorization_servers','none','isError','expiresAt','1.0.0','.ranger','listen','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','status','LYAaV','BnAlV','tyVOk','/.well-known/oauth-protected-resource','yBafm','now','3101910AiGnaD','Exchanging\x20authorization\x20code...','text/html','2556850JeRrmn','wXvXn','Registering\x20OAuth\x20client...','application/x-www-form-urlencoded','ranger-cli','get_cli_token\x20failed:\x20','QSNma','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a'];_0x402d=function(){return _0x3e8913;};return _0x402d();}class OAuthTimeoutError extends Error{constructor(_0x2bf774){const _0x182f1d=_0x3e5f9f;super(_0x2bf774),this['name']=_0x182f1d(0x21c);}}async function oauthFlow(_0x3709f8){const _0x26e6fc={'NwYkw':function(_0x3df782){return _0x3df782();}};try{return await oauthFlowAttempt(_0x3709f8);}catch(_0x420bf9){if(_0x420bf9 instanceof OAuthTimeoutError&&await loadCachedClient())return console['log']('\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'),await _0x26e6fc['NwYkw'](clearCachedClient),await oauthFlowAttempt(_0x3709f8);throw _0x420bf9;}}async function oauthFlowAttempt(_0x1f5e9a){const _0x223478=_0x3e5f9f,_0x2a3306={'LYAaV':function(_0x4b54be,_0x51b3fc){return _0x4b54be(_0x51b3fc);},'ulOZS':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','qJUaj':_0x223478(0x23f),'YNrVR':function(_0xc8516b){return _0xc8516b();},'QSNma':_0x223478(0x237),'EubvA':_0x223478(0x1c0),'fMFkq':_0x223478(0x1d0),'zDoWa':'refresh_token','rkLeF':_0x223478(0x224),'uRmAo':function(_0x11f937,_0x19ea59,_0x365864){return _0x11f937(_0x19ea59,_0x365864);},'kxRqt':'base64url','dKOGi':'hex','GDLTN':'code','XvDer':_0x223478(0x208),'lBzml':'S256','tOnre':'state','VuVCV':'\x0aOpening\x20browser\x20for\x20authentication...','byWMl':function(_0x1729cd,_0x5cf745){return _0x1729cd(_0x5cf745);},'RehoI':_0x223478(0x1e8),'vhplv':'\x20done','PRIUu':function(_0x5b80ec,_0x44df6f,_0x19f141,_0x95959f){return _0x5b80ec(_0x44df6f,_0x19f141,_0x95959f);}},_0x3fd1c5=_0x1f5e9a['replace'](/\/mcp$/,'');process[_0x223478(0x202)][_0x223478(0x1e7)]('Discovering\x20authorization\x20server...');const _0x26f210=await _0x2a3306['LYAaV'](fetch,_0x3fd1c5+_0x223478(0x22f));if(!_0x26f210['ok'])throw new Error(_0x2a3306[_0x223478(0x1f9)]);const _0x38968d=await _0x26f210[_0x223478(0x21e)](),_0x26286c=_0x38968d[_0x223478(0x223)]?.[0x0];if(!_0x26286c)throw new Error(_0x2a3306['qJUaj']);console[_0x223478(0x1d6)]('\x20'+_0x26286c);const _0x2138c6=await fetchAuthServerMetadata(_0x26286c);let _0x2a5d03,_0x2abf7a;const _0x30284c=await _0x2a3306['YNrVR'](loadCachedClient);if(_0x30284c)_0x2a5d03=_0x30284c[_0x223478(0x1ce)],_0x2abf7a=_0x30284c['clientSecret'];else{if(_0x2138c6['registration_endpoint']){process[_0x223478(0x202)]['write'](_0x2a3306[_0x223478(0x23b)]);const _0x3e6f88=await fetch(_0x2138c6['registration_endpoint'],{'method':'POST','headers':{'Content-Type':_0x2a3306[_0x223478(0x23e)]},'body':JSON['stringify']({'client_name':'Ranger\x20CLI','redirect_uris':['http://localhost:'+CALLBACK_PORT+'/callback'],'grant_types':[_0x2a3306[_0x223478(0x206)],_0x2a3306['zDoWa']],'response_types':[_0x223478(0x1c8)],'token_endpoint_auth_method':_0x2a3306['rkLeF']})});if(!_0x3e6f88['ok']){const _0x4c8f7e=await _0x3e6f88['text']();throw new Error(_0x223478(0x24e)+_0x4c8f7e);}const _0x4f983d=await _0x3e6f88[_0x223478(0x21e)]();_0x2a5d03=_0x4f983d['client_id'],_0x2abf7a=_0x4f983d['client_secret'],await _0x2a3306[_0x223478(0x1f8)](saveCachedClient,_0x2a5d03,_0x2abf7a),console['log'](_0x223478(0x1db));}else throw new Error(_0x223478(0x22a));}const _0x2b5779=_0x2a3306['LYAaV'](randomBytes,0x20)['toString'](_0x2a3306['kxRqt']),_0xa2e82d=createHash(_0x223478(0x1e1))[_0x223478(0x244)](_0x2b5779)['digest']('base64url'),_0x36ab45=_0x2a3306[_0x223478(0x22c)](randomBytes,0x10)['toString'](_0x2a3306[_0x223478(0x1e3)]),_0x4707ed=new URL(_0x2138c6['authorization_endpoint']);_0x4707ed['searchParams'][_0x223478(0x1c3)]('response_type',_0x2a3306['GDLTN']),_0x4707ed['searchParams']['set'](_0x2a3306[_0x223478(0x1ca)],_0x2a5d03),_0x4707ed[_0x223478(0x1f5)]['set']('redirect_uri','http://localhost:'+CALLBACK_PORT+_0x223478(0x246)),_0x4707ed['searchParams']['set']('code_challenge',_0xa2e82d),_0x4707ed[_0x223478(0x1f5)]['set'](_0x223478(0x1c9),_0x2a3306['lBzml']),_0x4707ed[_0x223478(0x1f5)][_0x223478(0x1c3)](_0x2a3306['tOnre'],_0x36ab45);_0x38968d['resource']&&_0x4707ed['searchParams']['set'](_0x223478(0x1c2),_0x38968d['resource']);console['log'](_0x2a3306['VuVCV']),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x4707ed[_0x223478(0x1dc)]()+'\x0a'),await _0x2a3306['LYAaV'](openBrowser,_0x4707ed['toString']());const _0x9a447=await _0x2a3306['byWMl'](waitForCallback,_0x36ab45);process[_0x223478(0x202)][_0x223478(0x1e7)](_0x223478(0x233));const _0x159652=new URLSearchParams({'grant_type':'authorization_code','code':_0x9a447,'redirect_uri':_0x223478(0x1fa)+CALLBACK_PORT+_0x223478(0x246),'client_id':_0x2a5d03,'code_verifier':_0x2b5779});_0x2abf7a&&_0x159652['set'](_0x2a3306['RehoI'],_0x2abf7a);_0x38968d[_0x223478(0x1c2)]&&_0x159652['set'](_0x223478(0x1c2),_0x38968d[_0x223478(0x1c2)]);const _0x4e497e=await _0x2a3306[_0x223478(0x1f8)](fetch,_0x2138c6[_0x223478(0x1d5)],{'method':'POST','headers':{'Content-Type':_0x223478(0x238)},'body':_0x159652});if(!_0x4e497e['ok']){const _0x16235d=await _0x4e497e[_0x223478(0x1be)]();throw new Error(_0x223478(0x249)+_0x16235d);}const _0x53d62d=await _0x4e497e['json']();return console['log'](_0x2a3306['vhplv']),await _0x2a3306[_0x223478(0x1cd)](saveCachedToken,_0x53d62d['access_token'],_0x53d62d[_0x223478(0x1fc)],_0x53d62d[_0x223478(0x1e9)]),_0x53d62d['access_token'];}async function callGetCliToken(_0x2fe39c,_0x3b79fb){const _0x36d842=_0x3e5f9f,_0x2debb3={'xcImF':function(_0x549d05,_0xe47641,_0xe31372){return _0x549d05(_0xe47641,_0xe31372);},'OpyoQ':_0x36d842(0x1d2),'yZVMB':'Initializing\x20MCP\x20session...','hKHAO':function(_0x2fd93e,_0x1ecffd){return _0x2fd93e(_0x1ecffd);},'CIKyW':_0x36d842(0x1ef),'hPVgz':'POST','JWiOC':_0x36d842(0x215),'zIefW':'notifications/initialized','wDQHS':'Requesting\x20CLI\x20token...','EOnnN':'tools/call','wXvXn':'get_cli_token','iMLTv':_0x36d842(0x1e0),'YPqTG':_0x36d842(0x1d1),'EyEXU':function(_0x1b8eaa,_0x512ab2,_0x348c27){return _0x1b8eaa(_0x512ab2,_0x348c27);},'FARjY':function(_0x357261){return _0x357261();},'KpPwH':'refresh.txt','yKsPu':function(_0x7dff20,_0xb3ce9d,_0x3cf233,_0x1ea9ac){return _0x7dff20(_0xb3ce9d,_0x3cf233,_0x1ea9ac);},'GOBiv':_0x36d842(0x212),'aJiYs':_0x36d842(0x23d)},_0x4f2824={'Content-Type':_0x36d842(0x1c0),'Accept':_0x2debb3[_0x36d842(0x211)]};_0x3b79fb&&(_0x4f2824['Authorization']='Bearer\x20'+_0x3b79fb);const _0x2f90ca=async _0x465948=>{const _0x1fea61=_0x36d842,_0x14e884=await _0x2debb3['xcImF'](fetch,_0x2fe39c,{'method':'POST','headers':_0x4f2824,'body':JSON[_0x1fea61(0x1f7)](_0x465948)});if(!_0x14e884['ok']){const _0xa1680d=await _0x14e884[_0x1fea61(0x1be)]();throw new Error(_0x1fea61(0x20c)+_0x14e884['status']+':\x20'+_0xa1680d);}return parseResponse(_0x14e884);};process[_0x36d842(0x202)][_0x36d842(0x1e7)](_0x2debb3['yZVMB']);const _0x3335eb=await _0x2debb3[_0x36d842(0x241)](_0x2f90ca,{'jsonrpc':_0x36d842(0x215),'id':0x1,'method':_0x2debb3['CIKyW'],'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x36d842(0x239),'version':_0x36d842(0x227)}}});if(_0x3335eb[_0x36d842(0x1de)])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x3335eb[_0x36d842(0x1de)][_0x36d842(0x203)]??JSON[_0x36d842(0x1f7)](_0x3335eb['error'])));console[_0x36d842(0x1d6)]('\x20done'),await fetch(_0x2fe39c,{'method':_0x2debb3[_0x36d842(0x1da)],'headers':_0x4f2824,'body':JSON['stringify']({'jsonrpc':_0x2debb3[_0x36d842(0x1cb)],'method':_0x2debb3['zIefW']})})['then'](_0x2ad55e=>_0x2ad55e['text']()),process[_0x36d842(0x202)][_0x36d842(0x1e7)](_0x2debb3['wDQHS']);const _0x1d424a=await _0x2f90ca({'jsonrpc':_0x2debb3[_0x36d842(0x1cb)],'id':0x2,'method':_0x2debb3['EOnnN'],'params':{'name':_0x2debb3[_0x36d842(0x236)],'arguments':{}}});if(_0x1d424a[_0x36d842(0x1de)])throw new Error(_0x36d842(0x23a)+(_0x1d424a['error'][_0x36d842(0x203)]??JSON['stringify'](_0x1d424a[_0x36d842(0x1de)])));console[_0x36d842(0x1d6)]('\x20done');const _0x57a996=extractToken(_0x1d424a[_0x36d842(0x1d4)]);if(!_0x57a996){console[_0x36d842(0x1de)](_0x2debb3[_0x36d842(0x1d9)]),console['error'](JSON[_0x36d842(0x1f7)](_0x1d424a[_0x36d842(0x1d4)],null,0x2));throw new Error(_0x2debb3[_0x36d842(0x20a)]);}const _0x4c7c9d=_0x2debb3['EyEXU'](join,_0x2debb3['FARjY'](homedir),_0x36d842(0x228)),_0x37dc5a=join(_0x4c7c9d,_0x2debb3['KpPwH']);await _0x2debb3['xcImF'](mkdir,_0x4c7c9d,{'recursive':!![]}),await _0x2debb3['yKsPu'](writeFile,_0x37dc5a,_0x57a996,{'mode':0x180}),await _0x2debb3[_0x36d842(0x218)](writeFile,join(_0x4c7c9d,_0x2debb3['GOBiv']),_0x2fe39c,{'mode':0x180}),console['log']('\x0aToken\x20written\x20to\x20'+_0x37dc5a),console['log'](_0x2debb3['aJiYs']);}async function fetchAuthServerMetadata(_0x15b71d){const _0x21ea15=_0x3e5f9f,_0x1ae214={'QXwPY':function(_0x402032,_0x2c556c){return _0x402032(_0x2c556c);}},_0xe51054=_0x15b71d+'/.well-known/oauth-authorization-server',_0x119f8f=await _0x1ae214[_0x21ea15(0x21f)](fetch,_0xe51054);if(!_0x119f8f['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0xe51054+':\x20'+_0x119f8f['status']);return _0x119f8f['json']();}function waitForCallback(_0x2c5b56){const _0x3818bc=_0x3e5f9f,_0x218cb7={'qxEXD':'/callback','PesBo':'Not\x20found','QEyzg':_0x3818bc(0x1c8),'yzeSR':'state','BnAlV':_0x3818bc(0x1f0),'rqwHz':function(_0x50a52,_0x36fe5a){return _0x50a52!==_0x36fe5a;},'TcDdT':'text/html','rpoWa':function(_0x772bc7){return _0x772bc7();},'rOtGj':function(_0x2d397e,_0x527af5){return _0x2d397e(_0x527af5);},'gWPMi':function(_0xda2b8d,_0x3b38fb,_0x31161d){return _0xda2b8d(_0x3b38fb,_0x31161d);}};return new Promise((_0x59e5e5,_0x3cc775)=>{const _0x92baef=_0x3818bc,_0xee2623=()=>{const _0x51dfb8=_0x4f7e;_0x2391df[_0x51dfb8(0x1ed)](),_0x2391df['close']();},_0x3d8cc1=_0x218cb7['gWPMi'](setTimeout,()=>{const _0x348720=_0x4f7e;_0xee2623(),_0x3cc775(new OAuthTimeoutError(_0x348720(0x240)));},0x1d4c0),_0x2391df=createServer((_0x455151,_0x230b82)=>{const _0x62e9a6=_0x4f7e,_0x291686=new URL(_0x455151['url']??'/','http://localhost:'+CALLBACK_PORT);if(_0x291686[_0x62e9a6(0x1ee)]!==_0x218cb7['qxEXD']){_0x230b82[_0x62e9a6(0x1e6)](0x194),_0x230b82['end'](_0x218cb7['PesBo']);return;}const _0x4f4ac6=_0x291686['searchParams'][_0x62e9a6(0x24d)](_0x218cb7[_0x62e9a6(0x1d7)]),_0x332c9b=_0x291686[_0x62e9a6(0x1f5)][_0x62e9a6(0x24d)](_0x218cb7['yzeSR']),_0x16a4b8=_0x291686[_0x62e9a6(0x1f5)]['get'](_0x62e9a6(0x1de));if(_0x16a4b8){const _0x45699f=_0x291686['searchParams']['get'](_0x218cb7[_0x62e9a6(0x22d)])??_0x16a4b8;_0x230b82['writeHead'](0xc8,{'Content-Type':'text/html'}),_0x230b82[_0x62e9a6(0x1cf)](_0x62e9a6(0x221)+_0x45699f+'</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>'),clearTimeout(_0x3d8cc1),_0xee2623(),_0x3cc775(new Error('OAuth\x20error:\x20'+_0x45699f));return;}if(!_0x4f4ac6||_0x218cb7[_0x62e9a6(0x248)](_0x332c9b,_0x2c5b56)){_0x230b82['writeHead'](0x190,{'Content-Type':_0x218cb7['TcDdT']}),_0x230b82[_0x62e9a6(0x1cf)]('<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>');return;}_0x230b82['writeHead'](0xc8,{'Content-Type':_0x62e9a6(0x234)}),_0x230b82['end'](_0x62e9a6(0x23c)),clearTimeout(_0x3d8cc1),_0x218cb7['rpoWa'](_0xee2623),_0x218cb7['rOtGj'](_0x59e5e5,_0x4f4ac6);});_0x2391df[_0x92baef(0x229)](CALLBACK_PORT,_0x92baef(0x210));});}async function openBrowser(_0x4a9772){const _0x459d75=_0x3e5f9f,_0x2a47d7={'dLUBm':function(_0x4aa6a2,_0x5e7a05){return _0x4aa6a2===_0x5e7a05;},'vQLPF':_0x459d75(0x243),'sWzWl':'start','uWYLo':function(_0x20589f,_0xccf0ff){return _0x20589f(_0xccf0ff);}},_0x383213=_0x2a47d7[_0x459d75(0x1ea)](process[_0x459d75(0x245)],'darwin')?_0x2a47d7['vQLPF']:_0x2a47d7[_0x459d75(0x1ea)](process[_0x459d75(0x245)],'win32')?_0x2a47d7[_0x459d75(0x205)]:_0x459d75(0x1c7);_0x2a47d7[_0x459d75(0x214)](exec,_0x383213+'\x20\x22'+_0x4a9772+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x3c1eb5=_0x3e5f9f,_0x5244b2={'Qwkdl':function(_0x3da622,_0x524de6,_0x2e18b4){return _0x3da622(_0x524de6,_0x2e18b4);},'jkQMZ':function(_0x276965,_0x49686d){return _0x276965!==_0x49686d;},'wGsqa':function(_0x1ffefb,_0x51154f){return _0x1ffefb>_0x51154f;}};try{const _0x2f3729=JSON['parse'](await _0x5244b2['Qwkdl'](readFile,TOKEN_CACHE_PATH,'utf-8'));if(_0x2f3729[_0x3c1eb5(0x1d8)]&&_0x5244b2[_0x3c1eb5(0x247)](_0x2f3729[_0x3c1eb5(0x1d8)],currentOrigin))return null;if(_0x2f3729[_0x3c1eb5(0x226)]&&_0x5244b2[_0x3c1eb5(0x1e5)](Date[_0x3c1eb5(0x231)](),_0x2f3729[_0x3c1eb5(0x226)]))return null;return _0x2f3729['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0x460008,_0x1608ba,_0x138232){const _0x253329=_0x3e5f9f,_0xb8bc15={'TGrrV':function(_0x504e27,_0x17405e){return _0x504e27+_0x17405e;},'rdxQt':function(_0x52b1f7,_0x1f6197){return _0x52b1f7*_0x1f6197;},'FFOFC':function(_0x55fb6c,_0xc82b55,_0x282fd5){return _0x55fb6c(_0xc82b55,_0x282fd5);},'vkSmH':function(_0x4c554a){return _0x4c554a();}},_0x38c937=await loadCachedData(),_0x1cf8d1={..._0x38c937,'origin':currentOrigin,'accessToken':_0x460008,'refreshToken':_0x1608ba??_0x38c937?.['refreshToken'],'expiresAt':_0x138232?_0xb8bc15[_0x253329(0x216)](Date['now'](),_0xb8bc15['rdxQt'](_0x138232,0x3e8)):undefined};await _0xb8bc15['FFOFC'](mkdir,join(_0xb8bc15['vkSmH'](homedir),'.ranger'),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x253329(0x1f7)](_0x1cf8d1),{'mode':0x180});}async function loadCachedClient(){const _0x4c1da7=_0x3e5f9f,_0x2dfd4c={'OAKQH':function(_0x3bca55,_0x4f12e2){return _0x3bca55!==_0x4f12e2;}},_0x55acd1=await loadCachedData();if(_0x55acd1?.['origin']&&_0x2dfd4c[_0x4c1da7(0x219)](_0x55acd1[_0x4c1da7(0x1d8)],currentOrigin))return null;return _0x55acd1?.['clientId']?{'clientId':_0x55acd1[_0x4c1da7(0x1ce)],'clientSecret':_0x55acd1['clientSecret']}:null;}async function clearCachedClient(){const _0x1899d4={'FXkug':function(_0x34fb54,_0x7a4de4,_0x18d01d,_0x4c305d){return _0x34fb54(_0x7a4de4,_0x18d01d,_0x4c305d);}},_0x571ea3=await loadCachedData();if(!_0x571ea3)return;const {clientId:_0x44f127,clientSecret:_0x168def,..._0x18db01}=_0x571ea3;await _0x1899d4['FXkug'](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x18db01),{'mode':0x180});}async function saveCachedClient(_0x5200a4,_0x362611){const _0x519ab8=_0x3e5f9f,_0x331a1e={'EtJkQ':function(_0x476dc9,_0x4d2e3f,_0x2c4aaa){return _0x476dc9(_0x4d2e3f,_0x2c4aaa);},'Zndlg':function(_0x2a555f){return _0x2a555f();},'AwtBc':_0x519ab8(0x228),'FDWsu':function(_0x4a9378,_0x2e965c,_0x504f47,_0x4257f6){return _0x4a9378(_0x2e965c,_0x504f47,_0x4257f6);}},_0x48487d=await loadCachedData(),_0x4e1364={..._0x48487d,'origin':currentOrigin,'accessToken':_0x48487d?.[_0x519ab8(0x242)]??'','clientId':_0x5200a4,'clientSecret':_0x362611};await _0x331a1e['EtJkQ'](mkdir,join(_0x331a1e['Zndlg'](homedir),_0x331a1e[_0x519ab8(0x21a)]),{'recursive':!![]}),await _0x331a1e['FDWsu'](writeFile,TOKEN_CACHE_PATH,JSON[_0x519ab8(0x1f7)](_0x4e1364),{'mode':0x180});}async function loadCachedData(){const _0x282c42=_0x3e5f9f,_0x2e04c1={'UTPqf':'utf-8'};try{return JSON['parse'](await readFile(TOKEN_CACHE_PATH,_0x2e04c1[_0x282c42(0x1c4)]));}catch{return null;}}async function parseResponse(_0x4f2135){const _0x10a6da=_0x3e5f9f,_0x2702e8={'JugaR':_0x10a6da(0x1f2),'bkLNQ':'data:','PxAyN':function(_0x5bbde1,_0x38f9d6){return _0x5bbde1!==_0x38f9d6;},'gJLzQ':_0x10a6da(0x1fb)},_0x394cf5=_0x4f2135[_0x10a6da(0x1cc)]['get'](_0x2702e8[_0x10a6da(0x1d3)])??'';if(_0x394cf5['includes'](_0x10a6da(0x24c))){const _0x1b0f75=await _0x4f2135[_0x10a6da(0x1be)]();for(const _0x53242c of _0x1b0f75[_0x10a6da(0x209)]('\x0a')){const _0x5dee56=_0x53242c[_0x10a6da(0x20d)]();if(_0x5dee56[_0x10a6da(0x24a)](_0x2702e8['bkLNQ'])){const _0x2274b0=_0x5dee56[_0x10a6da(0x1f4)](_0x10a6da(0x24b)['length'])['trim']();if(!_0x2274b0)continue;try{const _0x222c38=JSON[_0x10a6da(0x20f)](_0x2274b0);if(_0x2702e8[_0x10a6da(0x250)](_0x222c38['id'],undefined)||_0x222c38['error'])return _0x222c38;}catch{}}}throw new Error(_0x2702e8[_0x10a6da(0x24f)]);}return _0x4f2135['json']();}function extractToken(_0x26e6b6){const _0x2c4d74=_0x3e5f9f,_0x5926d5={'NSInv':function(_0xf185d5,_0x3c1c8e){return _0xf185d5===_0x3c1c8e;},'fURVx':_0x2c4d74(0x1c6),'JgQRK':'text'};if(!_0x26e6b6)return null;const _0x1f353b=_0x26e6b6['structuredContent'];if(_0x1f353b?.['token']&&_0x5926d5[_0x2c4d74(0x1c5)](typeof _0x1f353b['token'],_0x5926d5['fURVx']))return _0x1f353b[_0x2c4d74(0x21d)];if(_0x26e6b6[_0x2c4d74(0x225)]){const _0x2713cb=_0x26e6b6[_0x2c4d74(0x204)];throw new Error('Server\x20returned\x20error:\x20'+(_0x2713cb?.[0x0]?.['text']??'Unknown\x20error'));}const _0x5195ef=_0x26e6b6[_0x2c4d74(0x204)];if(_0x5195ef)for(const _0x4a4bfb of _0x5195ef){if(_0x4a4bfb[_0x2c4d74(0x1f3)]===_0x5926d5[_0x2c4d74(0x1df)]&&_0x4a4bfb[_0x2c4d74(0x1be)]){try{const _0x131e32=JSON['parse'](_0x4a4bfb[_0x2c4d74(0x1be)]);if(typeof _0x131e32?.['token']===_0x5926d5['fURVx'])return _0x131e32[_0x2c4d74(0x21d)];}catch{}const _0x47a360=_0x4a4bfb[_0x2c4d74(0x1be)]['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x47a360)return _0x47a360[0x1];}}return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x335d86,_0x590dc9){var _0x3d6d64=_0x2476,_0x51dc3d=_0x335d86();while(!![]){try{var _0x2b448c=parseInt(_0x3d6d64(0x151))/0x1*(-parseInt(_0x3d6d64(0x152))/0x2)+-parseInt(_0x3d6d64(0x159))/0x3+parseInt(_0x3d6d64(0x150))/0x4*(parseInt(_0x3d6d64(0x158))/0x5)+-parseInt(_0x3d6d64(0x15a))/0x6+-parseInt(_0x3d6d64(0x15d))/0x7+parseInt(_0x3d6d64(0x15e))/0x8*(parseInt(_0x3d6d64(0x14d))/0x9)+parseInt(_0x3d6d64(0x14e))/0xa;if(_0x2b448c===_0x590dc9)break;else _0x51dc3d['push'](_0x51dc3d['shift']());}catch(_0x45ce4a){_0x51dc3d['push'](_0x51dc3d['shift']());}}}(_0x2ad6,0xd598d));function _0x2476(_0x41d235,_0xdbeb1b){_0x41d235=_0x41d235-0x14d;var _0x2ad6cf=_0x2ad6();var _0x247602=_0x2ad6cf[_0x41d235];return _0x247602;}function _0x2ad6(){var _0x4ad223=['39328680TqyyLq','zXjAl','10624WUxwBz','571981UcIXJi','6gSlHEh','eOlvv','fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.','jkbHI','tiLlU','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','160OtRzQo','1864446OuyKiH','5025594WfnZJG','ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','exit','3052126JVEjFO','1248200AiXBTh','fhakP','\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','27fTQSsw'];_0x2ad6=function(){return _0x4ad223;};return _0x2ad6();}export async function migrateProfile(_0x584358,_0x3f65e1){var _0x3112b1=_0x2476,_0x5a3b2a={'tiLlU':function(_0x556882,_0x2640b5){return _0x556882+_0x2640b5;},'zXjAl':function(_0x125d78,_0x369640){return _0x125d78+_0x369640;},'xrcQx':function(_0x1dd836,_0x5a930b){return _0x1dd836+_0x5a930b;},'eOlvv':_0x3112b1(0x15b),'jkbHI':_0x3112b1(0x161),'voqmL':_0x3112b1(0x160),'myhIU':'Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a','fhakP':_0x3112b1(0x154)};console['error'](_0x5a3b2a[_0x3112b1(0x156)](_0x5a3b2a['tiLlU'](_0x5a3b2a['tiLlU'](_0x5a3b2a['tiLlU'](_0x5a3b2a[_0x3112b1(0x14f)](_0x5a3b2a['xrcQx'](_0x5a3b2a[_0x3112b1(0x153)],'\x0a')+_0x5a3b2a[_0x3112b1(0x155)]+_0x3112b1(0x157),'\x0a'),'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a'),_0x5a3b2a['voqmL']),'\x0a'),_0x5a3b2a['myhIU'])+_0x5a3b2a[_0x3112b1(0x15f)]),process[_0x3112b1(0x15c)](0x1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x48ff19,_0x184a8f){const _0x200f3b=_0x11f4,_0x25dc1f=_0x48ff19();while(!![]){try{const _0x3753d9=parseInt(_0x200f3b(0x178))/0x1+parseInt(_0x200f3b(0x18b))/0x2*(-parseInt(_0x200f3b(0x172))/0x3)+-parseInt(_0x200f3b(0x18c))/0x4*(parseInt(_0x200f3b(0x162))/0x5)+-parseInt(_0x200f3b(0x170))/0x6*(-parseInt(_0x200f3b(0x180))/0x7)+parseInt(_0x200f3b(0x185))/0x8*(-parseInt(_0x200f3b(0x15f))/0x9)+parseInt(_0x200f3b(0x17f))/0xa*(-parseInt(_0x200f3b(0x169))/0xb)+-parseInt(_0x200f3b(0x15e))/0xc*(-parseInt(_0x200f3b(0x168))/0xd);if(_0x3753d9===_0x184a8f)break;else _0x25dc1f['push'](_0x25dc1f['shift']());}catch(_0x2512c2){_0x25dc1f['push'](_0x25dc1f['shift']());}}}(_0x20b0,0x3f9b4));import{join}from'path';function _0x11f4(_0x446ad0,_0xc93053){_0x446ad0=_0x446ad0-0x156;const _0x20b0ad=_0x20b0();let _0x11f4af=_0x20b0ad[_0x446ad0];return _0x11f4af;}import{existsSync}from'fs';import _0x2d4a03 from'inquirer';import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';function _0x20b0(){const _0x215c27=['xRUAp','ranger@trailhead','VfpKS','LBYML','abEPr','prompt','\x0aYou\x20can\x20install\x20manually\x20with:','108XwXdZU','88398AWvlLW','user','lHqLQ','5JEgakI','\x20level)...\x0a','marketplace','oygYz','CauNG','vRAwz','297661YxOjhU','583YpYDCd','success','cvWbz','plugin','pzHZx','ranger-testing/trailhead','ranger','2509116GqgDtn','.claude','76926XWgAVn','install','Project\x20(shared\x20with\x20team\x20via\x20git)','Tdszo','project','Would\x20you\x20like\x20to\x20install\x20skills?','348469IxaJzY','log','fyfJw','wantsSkillup','pluginScope','thSZy','qtpPP','20330PeQquU','7boqkPg','error','❌\x20Failed\x20to\x20add\x20marketplace:','enable','saxJC','136GfCzqu','RpBqn','JJfWo','IZiOB','\x0a📦\x20Claude\x20Code\x20Plugin\x0a','rIhwj','28yfCGUp','313940mHTVxD','Where\x20should\x20the\x20plugin\x20be\x20installed?','✓\x20Ranger\x20skills\x20already\x20installed'];_0x20b0=function(){return _0x215c27;};return _0x20b0();}import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x2db9c6){const _0x4e8baa=_0x11f4,_0xcb1c93={'cvWbz':function(_0x1ec179,_0x5eb8c8){return _0x1ec179(_0x5eb8c8);},'xRUAp':'ranger@trailhead','BxVok':'✓\x20Claude\x20Code\x20plugin\x20already\x20installed','HYNDK':_0x4e8baa(0x189),'rIhwj':'list','abEPr':'pluginScope','oygYz':_0x4e8baa(0x160),'JJfWo':_0x4e8baa(0x174),'pzHZx':'trailhead','zSULV':'plugin','Tdszo':'add','thSZy':'\x0aYou\x20can\x20install\x20manually\x20with:','HfsOL':'\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','qtpPP':_0x4e8baa(0x173),'vHsPa':'--scope','VfpKS':function(_0xe90225,_0x57381b){return _0xe90225===_0x57381b;},'IZiOB':_0x4e8baa(0x176),'vRAwz':function(_0x49b749){return _0x49b749();},'CauNG':function(_0x19dfe2,_0x1d3ca1,_0x3355c8){return _0x19dfe2(_0x1d3ca1,_0x3355c8);},'ngbLX':'already\x20enabled'},_0x2d4294=await _0xcb1c93[_0x4e8baa(0x16b)](isPluginInstalled,_0xcb1c93[_0x4e8baa(0x157)]);if(_0x2d4294)return console['log'](_0xcb1c93['BxVok']),![];const _0x110b8b=existsSync(join(getProjectRoot(),_0x4e8baa(0x171)));let _0x5307c5;if(_0x2db9c6)_0x5307c5=_0x2db9c6;else{if(_0x110b8b)_0x5307c5='project';else{console[_0x4e8baa(0x179)](_0xcb1c93['HYNDK']);const _0x415beb=await _0x2d4a03['prompt']([{'type':_0xcb1c93[_0x4e8baa(0x18a)],'name':_0xcb1c93[_0x4e8baa(0x15b)],'message':_0x4e8baa(0x18d),'choices':[{'name':'User\x20(available\x20in\x20all\x20your\x20projects)','value':_0xcb1c93[_0x4e8baa(0x165)]},{'name':_0xcb1c93[_0x4e8baa(0x187)],'value':_0x4e8baa(0x176)}],'default':_0x4e8baa(0x160)}]);_0x5307c5=_0x415beb[_0x4e8baa(0x17c)];}}console['log']('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x5307c5+_0x4e8baa(0x163));const _0x4f0d08=await isMarketplaceAdded(_0xcb1c93[_0x4e8baa(0x16d)]);let _0x4a3f75=_0x4f0d08;if(_0x4f0d08)console['log']('✓\x20Marketplace\x20already\x20added');else{const _0x5eee93=await runClaudeCommand([_0xcb1c93['zSULV'],_0x4e8baa(0x164),_0xcb1c93[_0x4e8baa(0x175)],_0x4e8baa(0x16e)]);!_0x5eee93['success']?(console['error'](_0x4e8baa(0x182),_0x5eee93['error']),console['log'](_0xcb1c93[_0x4e8baa(0x17d)]),console[_0x4e8baa(0x179)](_0xcb1c93['HfsOL']),console[_0x4e8baa(0x179)]('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x5307c5)):_0x4a3f75=!![];}if(_0x4a3f75){const _0x861108=await runClaudeCommand([_0x4e8baa(0x16c),_0xcb1c93[_0x4e8baa(0x17e)],'ranger@trailhead',_0xcb1c93['vHsPa'],_0x5307c5],{'cwd':_0xcb1c93['VfpKS'](_0x5307c5,_0xcb1c93[_0x4e8baa(0x188)])?_0xcb1c93['vRAwz'](getProjectRoot):undefined});if(!_0x861108['success'])console[_0x4e8baa(0x181)]('❌\x20Failed\x20to\x20install\x20plugin:',_0x861108[_0x4e8baa(0x181)]),console['log'](_0x4e8baa(0x15d)),console['log']('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x5307c5);else{console['log']('✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully');const _0x405878=['plugin',_0x4e8baa(0x183),_0x4e8baa(0x158)];_0xcb1c93['VfpKS'](_0x5307c5,'project')&&_0x405878['push'](_0xcb1c93['vHsPa'],_0xcb1c93['IZiOB']);const _0x2c8570=await _0xcb1c93[_0x4e8baa(0x166)](runClaudeCommand,_0x405878,{'captureOutput':!![],'cwd':_0xcb1c93[_0x4e8baa(0x159)](_0x5307c5,_0xcb1c93[_0x4e8baa(0x188)])?_0xcb1c93[_0x4e8baa(0x167)](getProjectRoot):undefined}),_0x33ca6a=_0x2c8570['output']?.['includes'](_0xcb1c93['ngbLX']);!_0x2c8570[_0x4e8baa(0x16a)]&&!_0x33ca6a?console['error']('⚠\x20Failed\x20to\x20enable\x20plugin:',_0x2c8570[_0x4e8baa(0x181)]):console['log']('✓\x20Claude\x20Code\x20plugin\x20enabled');}}return!![];}export async function ensureClaudeSkills(_0x49025e){const _0xb3afc3=_0x11f4,_0x4087d2={'RpBqn':'ranger','LBYML':'SKILL.md','ZGKSK':function(_0x9b0efc,_0xe63784,_0x2cc6b0,_0x1f7d3f){return _0x9b0efc(_0xe63784,_0x2cc6b0,_0x1f7d3f);},'DNpMB':function(_0x5dd5af,_0xbc9e81){return _0x5dd5af(_0xbc9e81);},'saxJC':_0xb3afc3(0x176),'lHqLQ':function(_0x17ca7a,_0x5c91ae){return _0x17ca7a||_0x5c91ae;},'UPWvu':function(_0x35fbe8){return _0x35fbe8();},'fyfJw':'confirm'},_0x401585=existsSync(join(getSkillsDir(_0xb3afc3(0x160)),_0x4087d2[_0xb3afc3(0x186)],_0x4087d2['LBYML'])),_0x4760bc=existsSync(_0x4087d2['ZGKSK'](join,_0x4087d2['DNpMB'](getSkillsDir,_0x4087d2[_0xb3afc3(0x184)]),_0xb3afc3(0x16f),_0x4087d2[_0xb3afc3(0x15a)]));if(_0x4087d2[_0xb3afc3(0x161)](_0x401585,_0x4760bc))return console[_0xb3afc3(0x179)](_0xb3afc3(0x156)),![];const _0x568a0e=existsSync(join(_0x4087d2['UPWvu'](getProjectRoot),_0xb3afc3(0x171)));let _0x236703=!![];if(_0x49025e)await skillup({'autoInstall':_0x49025e,'suppressUsage':!![]});else{if(_0x568a0e)await skillup({'autoInstall':_0x4087d2[_0xb3afc3(0x184)],'suppressUsage':!![]});else{const _0x278c58=await _0x2d4a03[_0xb3afc3(0x15c)]([{'type':_0x4087d2[_0xb3afc3(0x17a)],'name':_0xb3afc3(0x17b),'message':_0xb3afc3(0x177),'default':!![]}]);_0x236703=_0x278c58['wantsSkillup'],_0x236703&&await skillup({'suppressUsage':!![]});}}return _0x236703;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x480daa,_0x6546b2){const _0x4aa7ce=_0x5194,_0x118ec7=_0x480daa();while(!![]){try{const _0x3c7973=-parseInt(_0x4aa7ce(0x19f))/0x1*(-parseInt(_0x4aa7ce(0x1a2))/0x2)+-parseInt(_0x4aa7ce(0x1a1))/0x3+-parseInt(_0x4aa7ce(0x19e))/0x4*(-parseInt(_0x4aa7ce(0x1a9))/0x5)+parseInt(_0x4aa7ce(0x197))/0x6+parseInt(_0x4aa7ce(0x198))/0x7*(parseInt(_0x4aa7ce(0x1a8))/0x8)+parseInt(_0x4aa7ce(0x195))/0x9*(parseInt(_0x4aa7ce(0x1af))/0xa)+-parseInt(_0x4aa7ce(0x193))/0xb;if(_0x3c7973===_0x6546b2)break;else _0x118ec7['push'](_0x118ec7['shift']());}catch(_0x33ec9f){_0x118ec7['push'](_0x118ec7['shift']());}}}(_0x2f70,0x9a6d8));import{join}from'path';import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';function _0x2f70(){const _0x1b1e86=['4146444ROUXmy','14WxFIDR','error','log','list','GifVP','utf-8','37908Xqyuov','177353WxlrKU','ByJBf','2528319GdKJnQ','2rfyNgy','✓\x20OpenCode\x20plugin\x20configured','OzZmQ','fNeVn','@ranger-testing/opencode-plugin','\x0a📦\x20OpenCode\x20Plugin\x0a','2175704WtVjgD','75hKZuej','zKOPI','parse','plugin','opencode.json','ygKos','310HvRmUs','RmFSe','isArray','10368380TzzJfE','user','250659ryUmvn','⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.'];_0x2f70=function(){return _0x1b1e86;};return _0x2f70();}function _0x5194(_0x494c2b,_0xa91194){_0x494c2b=_0x494c2b-0x193;const _0x2f7003=_0x2f70();let _0x5194b9=_0x2f7003[_0x494c2b];return _0x5194b9;}import _0x45cd75 from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0x44e132){const _0x499e1e=_0x5194,_0x32f2ba={'hScoA':function(_0x4847d1,_0x584d7f){return _0x4847d1(_0x584d7f);},'Lronu':function(_0xc02a5f,_0x20d4cb,_0x2dda5c){return _0xc02a5f(_0x20d4cb,_0x2dda5c);},'GifVP':function(_0x17eeb2,_0x3c7609){return _0x17eeb2(_0x3c7609);},'zKOPI':'project','ygKos':'opencode.json','OzZmQ':_0x499e1e(0x1a7),'RmFSe':_0x499e1e(0x194),'fNeVn':'Project\x20(shared\x20with\x20team\x20via\x20git)','ZNKxm':function(_0x404efd,_0x490ba9){return _0x404efd(_0x490ba9);},'YTkim':_0x499e1e(0x196),'jXFco':'Failed\x20to\x20read\x20opencode.json','ByJBf':function(_0x5977c4,_0x5f63cb,_0x1a94f1){return _0x5977c4(_0x5f63cb,_0x1a94f1);},'rHFww':function(_0x23b56e,_0x16ffd1){return _0x23b56e(_0x16ffd1);}},_0x358a95=_0x32f2ba['hScoA'](existsSync,_0x32f2ba['Lronu'](join,_0x32f2ba[_0x499e1e(0x19c)](getOpencodeConfigDir,_0x32f2ba[_0x499e1e(0x1aa)]),_0x32f2ba[_0x499e1e(0x1ae)]));let _0x2834bd;if(_0x44e132)_0x2834bd=_0x44e132;else{if(_0x358a95)_0x2834bd=_0x32f2ba['zKOPI'];else{console['log'](_0x32f2ba[_0x499e1e(0x1a4)]);const _0x24d6b7=await _0x45cd75['prompt']([{'type':_0x499e1e(0x19b),'name':'pluginScope','message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':'User\x20(available\x20in\x20all\x20your\x20projects)','value':_0x32f2ba['RmFSe']},{'name':_0x32f2ba[_0x499e1e(0x1a5)],'value':_0x32f2ba['zKOPI']}],'default':_0x32f2ba[_0x499e1e(0x1b0)]}]);_0x2834bd=_0x24d6b7['pluginScope'];}}const _0x266e58=join(getOpencodeConfigDir(_0x2834bd),_0x499e1e(0x1ad)),_0x34424f=_0x499e1e(0x1a6),_0x20d7f3='https://opencode.ai/config.json';let _0x380eda={};if(_0x32f2ba['ZNKxm'](existsSync,_0x266e58))try{const _0x4d796d=await readFile(_0x266e58,_0x499e1e(0x19d));_0x380eda=JSON[_0x499e1e(0x1ab)](_0x4d796d);}catch(_0x345fff){return console[_0x499e1e(0x199)](_0x32f2ba['YTkim']),{'configured':![],'scope':_0x2834bd,'error':_0x32f2ba['jXFco'],'details':_0x345fff};}const _0x332f92=Array[_0x499e1e(0x1b1)](_0x380eda[_0x499e1e(0x1ac)])?_0x380eda[_0x499e1e(0x1ac)]:[];if(_0x332f92['includes'](_0x34424f))return console[_0x499e1e(0x19a)]('✓\x20OpenCode\x20plugin\x20already\x20configured'),{'configured':![],'scope':_0x2834bd};return _0x380eda['$schema']=_0x380eda['$schema']||_0x20d7f3,_0x380eda['plugin']=[..._0x332f92,_0x34424f],await _0x32f2ba[_0x499e1e(0x1a0)](mkdir,_0x32f2ba['rHFww'](getOpencodeConfigDir,_0x2834bd),{'recursive':!![]}),await writeFile(_0x266e58,JSON['stringify'](_0x380eda,null,0x2)+'\x0a'),console[_0x499e1e(0x19a)](_0x499e1e(0x1a3)),{'configured':!![],'scope':_0x2834bd};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x29d1(_0x552323,_0x2dbc76){_0x552323=_0x552323-0x153;var _0x396c04=_0x396c();var _0x29d119=_0x396c04[_0x552323];return _0x29d119;}(function(_0x298845,_0x366fb4){var _0x3ee239=_0x29d1,_0xd783ca=_0x298845();while(!![]){try{var _0x42798f=-parseInt(_0x3ee239(0x162))/0x1*(parseInt(_0x3ee239(0x15d))/0x2)+-parseInt(_0x3ee239(0x164))/0x3*(parseInt(_0x3ee239(0x15a))/0x4)+-parseInt(_0x3ee239(0x153))/0x5*(parseInt(_0x3ee239(0x158))/0x6)+parseInt(_0x3ee239(0x15c))/0x7*(parseInt(_0x3ee239(0x156))/0x8)+-parseInt(_0x3ee239(0x15f))/0x9+-parseInt(_0x3ee239(0x15e))/0xa+parseInt(_0x3ee239(0x157))/0xb*(parseInt(_0x3ee239(0x155))/0xc);if(_0x42798f===_0x366fb4)break;else _0xd783ca['push'](_0xd783ca['shift']());}catch(_0x359f64){_0xd783ca['push'](_0xd783ca['shift']());}}}(_0x396c,0x3c60a));export async function setupCi(_0x9a2134,_0x37f36f,_0x1bf4c8){var _0x2e540f=_0x29d1,_0x33fec2={'uxSLT':function(_0x184d13,_0x59f79b){return _0x184d13+_0x59f79b;},'hEwtB':function(_0x5d0609,_0x3fad31){return _0x5d0609+_0x3fad31;},'gqAKZ':_0x2e540f(0x163),'hQCQv':_0x2e540f(0x165)};console['error'](_0x33fec2[_0x2e540f(0x159)](_0x33fec2[_0x2e540f(0x154)](_0x2e540f(0x160),'\x0a')+'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a'+_0x2e540f(0x15b)+'\x0a'+_0x33fec2['gqAKZ'],_0x33fec2['hQCQv'])),process[_0x2e540f(0x161)](0x1);}function _0x396c(){var _0x4ac06b=['1106645NWnAMG','hEwtB','4644jlGotY','272qIZZtW','34837qMxJQn','6tPZYlD','uxSLT','31124OneABP','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','18347NLgDiv','2aDjENE','2071240MxhLgs','2159982cjrmie','ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','exit','297833DprHfG','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','39aghYua','\x20\x20https://docs.ranger.net/main/concepts/profiles'];_0x396c=function(){return _0x4ac06b;};return _0x396c();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5d8dd5,_0x25d40d){const _0x1b6db5=_0x522d,_0x115383=_0x5d8dd5();while(!![]){try{const _0x55f6e0=parseInt(_0x1b6db5(0x131))/0x1*(-parseInt(_0x1b6db5(0x12b))/0x2)+-parseInt(_0x1b6db5(0x146))/0x3*(parseInt(_0x1b6db5(0x147))/0x4)+parseInt(_0x1b6db5(0x144))/0x5*(-parseInt(_0x1b6db5(0x128))/0x6)+-parseInt(_0x1b6db5(0x12d))/0x7+parseInt(_0x1b6db5(0x13d))/0x8*(-parseInt(_0x1b6db5(0x127))/0x9)+parseInt(_0x1b6db5(0x138))/0xa*(-parseInt(_0x1b6db5(0x134))/0xb)+-parseInt(_0x1b6db5(0x136))/0xc*(-parseInt(_0x1b6db5(0x132))/0xd);if(_0x55f6e0===_0x25d40d)break;else _0x115383['push'](_0x115383['shift']());}catch(_0xa19ff6){_0x115383['push'](_0x115383['shift']());}}}(_0x4c7e,0x8e25b));import{basename}from'path';import _0x35e9d4 from'inquirer';import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';function _0x522d(_0x4eefee,_0x477f27){_0x4eefee=_0x4eefee-0x11b;const _0x4c7eec=_0x4c7e();let _0x522d43=_0x4c7eec[_0x4eefee];return _0x522d43;}import{getCurrentVersion}from'./utils/version.js';function _0x4c7e(){const _0xe4a9ab=['BKPnM','6WvYrZa','zcDNO','5458355dUMmpc','tbNhr','MukFr','\x20skill','97729VvdRaO','11295271TeXDmO','Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20(','5709Kypeim','xAUIK','60Qorxwt','user-level','9530pKkzsZ','list','mDYXY','ranger','To\x20use:','9136RkMfLj','warn','user','This\x20project\x20only\x20(','claude','/.opencode/skills/','cjtES','3410cBVyPz','stdout','3430743fvHBvG','4zmDtbt','opencode','log','\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!','\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','message','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','dvuLt','kAVDr','autoInstall','isTTY','\x20\x202.\x20Run:\x20ranger\x20setup','project','\x20--opencode','WoNdI','QUSEw','/skills/','5751TwtRDI','2826bkfafF','\x20successfully!\x0a'];_0x4c7e=function(){return _0xe4a9ab;};return _0x4c7e();}import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x9c3c88={}){const _0x5de067=_0x522d,_0x30e376={'hPVdI':function(_0x170d33){return _0x170d33();},'Wrxod':'To\x20get\x20started:','MukFr':_0x5de067(0x11c),'cjtES':'opencode','tbNhr':_0x5de067(0x123),'WoNdI':function(_0x1e9fa9,_0x1f6731){return _0x1e9fa9(_0x1f6731);},'kAVDr':'user','BKPnM':function(_0x30a2d7,_0x181f5f){return _0x30a2d7===_0x181f5f;},'mDYXY':'Where\x20should\x20skills\x20be\x20installed?','CYwuf':'project','zcDNO':'\x0a📦\x20Installing\x20skills...\x0a','IkGmM':function(_0x117687,_0x182a9a,_0xac1a4d){return _0x117687(_0x182a9a,_0xac1a4d);},'GxuVQ':_0x5de067(0x13b),'dvuLt':function(_0x72b586,_0x4163df){return _0x72b586 instanceof _0x4163df;},'QUSEw':function(_0x2d0efe,_0x188533){return _0x2d0efe>_0x188533;},'srKJt':_0x5de067(0x137),'xAUIK':'\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','BCCXg':_0x5de067(0x14a)};console[_0x5de067(0x149)]('\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a');const _0x3767f1=_0x9c3c88['platform']??_0x5de067(0x141),_0x207a2d=await _0x30e376['hPVdI'](getToken);if(!_0x207a2d){console['log']('❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a'),console['log'](_0x30e376['Wrxod']),console['log'](_0x30e376[_0x5de067(0x12f)]),console[_0x5de067(0x149)](_0x5de067(0x121)+(_0x3767f1===_0x30e376[_0x5de067(0x143)]?_0x30e376[_0x5de067(0x12e)]:'')+'\x20<your-api-token>'),console[_0x5de067(0x149)]('\x20\x203.\x20Run:\x20ranger\x20skillup'+(_0x3767f1===_0x5de067(0x148)?_0x30e376['tbNhr']:'')+'\x0a');return;}console['log']('✓\x20Found\x20API\x20token');const _0x4d0481=getProjectRoot(),_0x1f4e75=_0x30e376[_0x5de067(0x124)](basename,_0x4d0481),_0x121f10=_0x3767f1===_0x30e376['cjtES']?_0x30e376['WoNdI'](getOpencodeConfigDir,_0x30e376[_0x5de067(0x11e)])+_0x5de067(0x126):_0x30e376['hPVdI'](getClaudeConfigDir)+'/skills/',_0x1f78b3=_0x30e376[_0x5de067(0x12a)](_0x3767f1,_0x30e376[_0x5de067(0x143)])?_0x4d0481+_0x5de067(0x142):_0x4d0481+'/.claude/skills/',_0x415cd3=process['stdin'][_0x5de067(0x120)]&&process[_0x5de067(0x145)][_0x5de067(0x120)];let _0xba3d6;if(_0x9c3c88[_0x5de067(0x11f)])_0xba3d6=_0x9c3c88['autoInstall'];else{if(_0x415cd3){const _0x4a4763=await _0x35e9d4['prompt']([{'type':_0x5de067(0x139),'name':'installLevel','message':_0x30e376[_0x5de067(0x13a)],'choices':[{'name':'All\x20projects\x20('+_0x121f10+')','value':_0x5de067(0x13f)},{'name':_0x5de067(0x140)+_0x1f78b3+')','value':_0x30e376['CYwuf']}]}]);_0xba3d6=_0x4a4763['installLevel'];}else _0xba3d6=_0x5de067(0x122),console['log'](_0x5de067(0x133)+_0x1f78b3+')');}let _0x24a5f2=0x0;const _0x135182=getCurrentVersion();console[_0x5de067(0x149)](_0x30e376[_0x5de067(0x12c)]);try{const _0x848774=await _0x30e376['IkGmM'](installSkill,_0x30e376['GxuVQ'],{'cliVersion':_0x135182,'level':_0xba3d6,'platform':_0x3767f1});_0x848774&&_0x24a5f2++;}catch(_0x359cb2){console[_0x5de067(0x13e)](_0x5de067(0x14b),_0x30e376[_0x5de067(0x11d)](_0x359cb2,Error)?_0x359cb2[_0x5de067(0x11b)]:_0x359cb2);}if(_0x30e376[_0x5de067(0x125)](_0x24a5f2,0x0)){const _0x35acfd=_0x30e376['BKPnM'](_0xba3d6,_0x5de067(0x13f))?_0x30e376['srKJt']:'project-level';console[_0x5de067(0x149)]('\x0a✅\x20Installed\x20'+_0x24a5f2+'\x20'+_0x35acfd+_0x5de067(0x130)+(_0x24a5f2>0x1?'s':'')+_0x5de067(0x129)),!_0x9c3c88['suppressUsage']&&(console['log'](_0x5de067(0x13c)),_0x3767f1===_0x30e376['cjtES']?console['log'](_0x30e376[_0x5de067(0x135)]):console['log'](_0x30e376['BCCXg']));}else console['log']('\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a');}
|
package/build/commands/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x43f370,_0xf392d5){const _0x357ed6=_0x426c,_0x41e90e=_0x43f370();while(!![]){try{const _0x295eb0=parseInt(_0x357ed6(0x1cf))/0x1*(-parseInt(_0x357ed6(0x1c2))/0x2)+parseInt(_0x357ed6(0x1b3))/0x3+-parseInt(_0x357ed6(0x223))/0x4+-parseInt(_0x357ed6(0x21f))/0x5+-parseInt(_0x357ed6(0x205))/0x6*(parseInt(_0x357ed6(0x1d6))/0x7)+parseInt(_0x357ed6(0x1b8))/0x8*(-parseInt(_0x357ed6(0x1df))/0x9)+-parseInt(_0x357ed6(0x1fc))/0xa*(-parseInt(_0x357ed6(0x213))/0xb);if(_0x295eb0===_0xf392d5)break;else _0x41e90e['push'](_0x41e90e['shift']());}catch(_0x24360e){_0x41e90e['push'](_0x41e90e['shift']());}}}(_0x2b07,0x4b485));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';function _0x426c(_0x2e38be,_0x3ef5d7){_0x2e38be=_0x2e38be-0x1b2;const _0x2b07b8=_0x2b07();let _0x426c93=_0x2b07b8[_0x2e38be];return _0x426c93;}import{createRequire}from'module';import{spawn}from'child_process';import _0x53a6b0 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);function _0x2b07(){const _0xa4696=['\x20now?','✓\x20Authenticated\x20to\x20','✓\x20Exported\x20credentials\x20for\x20CI','local','method','plugin','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','37JGZldS','REPoX','skipChromium','xsSVx','version','organizationName','Validating\x20API\x20token...','1062502YGGqRa','auXui','ranger','YhgIN','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','\x20is\x20no\x20longer\x20supported.\x20','confirm','9sdrOqx','resolve','\x0a🚀\x20Ranger\x20Setup\x0a','status','ready','url','profile','chromium','ignore','\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','close','tfVZQ','UmrYq','mBjlD','rrNOB','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','trackPhaseEnd','aHNLo','\x20(fallback\x20version)','ZZJLK','success','The\x20required\x20version\x20(','skipAuth','GBGTp','rpiYp','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','1150zKfzQx','bzfNC','platform','scope','✓\x20Already\x20authenticated\x20to\x20','existing_token','pBlFQ','...','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','6SENIle','\x0aInstalling\x20Chromium\x20browser...\x0a','user','geJTy','DnDkR','igzdi','ENWEj','error','OSIwM','playwright/package.json','lHlLC','inherit','win32','isTTY','133265CeKJXZ','trackPhaseStart','warn','GITHUB_ENV','provided_token','/ranger:enable','CMTXz','YYGHh','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','exit','xdPoa','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','328850xWsfPF','\x0a\x20\x20','opencode','skipped','453280pwXGoY','message','ilOHP','--with-deps','coboP','force','✓\x20Created\x20~/.ranger/\x20directory','880017pPAfmJ','log','stdout','cevzZ','\x20and\x20prompt\x20the\x20coding','4616488KKimgi','device_auth','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','wKvSa','skills','DEcgd','lDfoE','JxYJG','25420CBziTO','npx','.gitignore','\x20\x20npx\x20playwright@',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','zHxNt'];_0x2b07=function(){return _0xa4696;};return _0x2b07();}export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.58.2';const bold=_0x888b14=>'\x1b[1m'+_0x888b14+'\x1b[0m';export function getPlaywrightVersion(){const _0x1ae2f0=_0x426c;try{const _0x792ae4=require[_0x1ae2f0(0x1e0)](_0x1ae2f0(0x20e)),_0x140b83=require(_0x792ae4);return _0x140b83[_0x1ae2f0(0x1d3)];}catch{return null;}}export function installChromiumBinary(_0x1e8ad3,_0x2848cb=![]){const _0x138f73=_0x426c,_0x299aed={'otxmL':function(_0x32237d){return _0x32237d();},'lzHgg':_0x138f73(0x226),'ZZJLK':'chromium','NbQwg':function(_0x361c67,_0x5e3cfd,_0x4a41ff,_0x48c468){return _0x361c67(_0x5e3cfd,_0x4a41ff,_0x48c468);},'MNYEz':_0x138f73(0x1e7),'wKvSa':_0x138f73(0x210),'cwCUB':_0x138f73(0x1eb),'igzdi':'error'};return new Promise((_0x2e1aa7,_0x1e3dde)=>{const _0x2ff49d=_0x138f73,_0x58b497={'IXogc':function(_0xc7fe65,_0x58c315){return _0xc7fe65(_0x58c315);}},_0x25eab3=['playwright@'+_0x1e8ad3,'install',..._0x2848cb?[_0x299aed['lzHgg']]:[],_0x299aed[_0x2ff49d(0x1f5)]],_0x352f81=_0x299aed['NbQwg'](spawn,_0x2ff49d(0x1c3),_0x25eab3,{'stdio':[_0x299aed['MNYEz'],_0x299aed[_0x2ff49d(0x1bd)],_0x2ff49d(0x210)],'shell':process[_0x2ff49d(0x1fe)]===_0x2ff49d(0x211)});_0x352f81['on'](_0x299aed['cwCUB'],_0x4116b5=>{_0x4116b5===0x0?_0x299aed['otxmL'](_0x2e1aa7):_0x1e3dde(new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x4116b5));}),_0x352f81['on'](_0x299aed[_0x2ff49d(0x20a)],_0xd15bb3=>{_0x58b497['IXogc'](_0x1e3dde,_0xd15bb3);});});}export async function authenticate(_0x2b554a){const _0x193f9b=_0x426c,_0x50455c={'xsSVx':function(_0xb8c422){return _0xb8c422();},'YhgIN':function(_0x3f3ef4,_0x1596f2){return _0x3f3ef4(_0x1596f2);},'DnDkR':function(_0x33f167,_0x81cafc){return _0x33f167(_0x81cafc);},'xGdhM':_0x193f9b(0x1b9),'SykQX':_0x193f9b(0x1d5)};if(!_0x2b554a){const _0x108d47=await _0x50455c[_0x193f9b(0x1d2)](getToken);if(_0x108d47){const _0xea928b=await _0x50455c['YhgIN'](getCurrentUser,_0x108d47);if(_0xea928b[_0x193f9b(0x1f6)])return console[_0x193f9b(0x1b4)](_0x193f9b(0x200)+_0xea928b[_0x193f9b(0x207)]['organizationName']),{'token':_0x108d47,'method':_0x193f9b(0x201)};}try{_0x2b554a=await _0x50455c[_0x193f9b(0x1d2)](runDeviceAuthFlow);}catch(_0xe0dc74){throw new Error('Authentication\x20failed:\x20'+(_0xe0dc74 instanceof Error?_0xe0dc74[_0x193f9b(0x224)]:_0xe0dc74));}const _0x33bc83=await _0x50455c[_0x193f9b(0x209)](getCurrentUser,_0x2b554a);if(!_0x33bc83['success'])throw new Error(_0x193f9b(0x1bc)+_0x33bc83[_0x193f9b(0x20c)]);return console[_0x193f9b(0x1b4)](_0x193f9b(0x1c9)+_0x33bc83['user']['organizationName']),{'token':_0x2b554a,'method':_0x50455c['xGdhM']};}console[_0x193f9b(0x1b4)](_0x50455c['SykQX']);const _0x3dc51a=await getCurrentUser(_0x2b554a);if(!_0x3dc51a[_0x193f9b(0x1f6)]){if(_0x3dc51a[_0x193f9b(0x1e2)])throw new Error('Authentication\x20failed:\x20'+_0x3dc51a[_0x193f9b(0x20c)]+_0x193f9b(0x1ce));else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x3dc51a['error']+_0x193f9b(0x21b));}return console['log']('✓\x20Authenticated\x20to\x20'+_0x3dc51a['user'][_0x193f9b(0x1d4)]),await _0x50455c[_0x193f9b(0x1d9)](storeToken,_0x2b554a),console['log'](process['env'][_0x193f9b(0x216)]?_0x193f9b(0x1ca):'✓\x20Stored\x20credentials\x20locally'),{'token':_0x2b554a,'method':_0x193f9b(0x217)};}export async function ensureRangerDir(_0x3d3bf3){const _0x3b9616=_0x426c,_0x3126b8={'tfVZQ':function(_0x14db8b,_0x2567b5,_0x546b0b){return _0x14db8b(_0x2567b5,_0x546b0b);},'REPoX':'✓\x20~/.ranger/\x20directory\x20already\x20exists'};void _0x3d3bf3;const _0x3c5597=getRangerHomeDir();return!existsSync(_0x3c5597)?(await _0x3126b8[_0x3b9616(0x1ec)](mkdir,_0x3c5597,{'recursive':!![]}),console[_0x3b9616(0x1b4)](_0x3b9616(0x1b2)),{'path':_0x3c5597,'installed':!![]}):(console[_0x3b9616(0x1b4)](_0x3126b8[_0x3b9616(0x1d0)]),{'path':_0x3c5597,'installed':![]});}export async function ensureChromium(_0x417eef=![]){const _0x19d84a=_0x426c,_0x7f4ae0={'DUSIF':function(_0x4859b5,_0x1702e3){return _0x4859b5(_0x1702e3);},'rpiYp':function(_0xe3c78b){return _0xe3c78b();},'rFvGi':_0x19d84a(0x1de),'cevzZ':'install','JxYJG':function(_0x424526,_0x49d380,_0x873e70){return _0x424526(_0x49d380,_0x873e70);},'NcZlR':'\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','ztbOn':function(_0x34a666,_0x54bbb7){return _0x34a666 instanceof _0x54bbb7;},'eDefO':'You\x20can\x20install\x20it\x20manually\x20by\x20running:','bTtLM':'\x0a⚠\x20Skipping\x20Chromium\x20installation.','ppmVO':_0x19d84a(0x1ea)};let _0x5229ed=![];try{const _0xca96bb=chromium['executablePath']();_0x5229ed=_0x7f4ae0['DUSIF'](existsSync,_0xca96bb);}catch{_0x5229ed=![];}if(_0x5229ed)return console[_0x19d84a(0x1b4)]('✓\x20Playwright\x20Chromium\x20browser\x20found'),![];const _0x216e4c=_0x7f4ae0[_0x19d84a(0x1fa)](getPlaywrightVersion),_0x16fdaf=_0x216e4c??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x10f6b3=!_0x216e4c,_0x4ce33c=process['stdin'][_0x19d84a(0x212)]&&process[_0x19d84a(0x1b5)][_0x19d84a(0x212)];let _0x289bd0=!![];if(_0x4ce33c){const {install:_0xe9797}=await _0x53a6b0['prompt']([{'type':_0x7f4ae0['rFvGi'],'name':_0x7f4ae0[_0x19d84a(0x1b6)],'message':_0x10f6b3?_0x19d84a(0x1f0)+_0x16fdaf+_0x19d84a(0x1c8):_0x19d84a(0x1f7)+_0x16fdaf+_0x19d84a(0x1c6),'default':!![]}]);_0x289bd0=_0xe9797;}else console[_0x19d84a(0x1b4)](_0x19d84a(0x1fb)+_0x16fdaf+(_0x10f6b3?_0x19d84a(0x1f4):'')+_0x19d84a(0x203));if(_0x289bd0){console[_0x19d84a(0x1b4)](_0x19d84a(0x206));try{await _0x7f4ae0[_0x19d84a(0x1c1)](installChromiumBinary,_0x16fdaf,_0x417eef),console[_0x19d84a(0x1b4)](_0x7f4ae0['NcZlR']);}catch(_0x3c6976){console['error']('\x0a❌\x20Failed\x20to\x20install\x20Chromium:',_0x7f4ae0['ztbOn'](_0x3c6976,Error)?_0x3c6976['message']:_0x3c6976),console[_0x19d84a(0x1b4)](_0x7f4ae0['eDefO']),console[_0x19d84a(0x1b4)](_0x19d84a(0x1c5)+_0x16fdaf+'\x20install\x20chromium');}}else console['log'](_0x7f4ae0['bTtLM']),console['log'](_0x7f4ae0['ppmVO']),console[_0x19d84a(0x1b4)]('\x20\x20npx\x20playwright@'+_0x16fdaf+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x4aafd9){const _0x3bcdc5=_0x426c,_0x13389e={'GBGTp':function(_0x217daf,_0x4e1c50,_0x2d8fb9){return _0x217daf(_0x4e1c50,_0x2d8fb9);},'ilOHP':_0x3bcdc5(0x1c4),'vAbnL':function(_0x2e0823,_0x1240fc,_0x511063){return _0x2e0823(_0x1240fc,_0x511063);},'epjvk':'✓\x20Created\x20.ranger/.gitignore'},_0x1955e7=_0x13389e[_0x3bcdc5(0x1f9)](join,_0x4aafd9,_0x13389e[_0x3bcdc5(0x225)]),_0x5fd6ed='\x0a\x0a#\x20Ignore\x20local-only\x20directories\x0alocal/\x0asessions/\x0abug-bashes/\x0areports/\x0afeedback-images/\x0a\x0aactive-profile.txt\x0aactive-feature.txt\x0a.gitignore\x0a\x0a#\x20Ignore\x20plaintext\x20auth\x20files\x20(encrypted\x20.enc\x20files\x20are\x20safe\x20to\x20commit)\x0a**/auth.json\x0a';await _0x13389e['vAbnL'](writeFile,_0x1955e7,_0x5fd6ed),console['log'](_0x13389e['epjvk']);}export async function ensureLocalEnv(_0x468b5f,_0x2e0485){const _0x2712cc=_0x426c,_0x5b53e1={'XAfTa':'⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','rrNOB':_0x2712cc(0x207),'JfQRj':_0x2712cc(0x1cb),'ulXzI':'✓\x20Local\x20profile\x20already\x20exists','bzfNC':function(_0x180e7c,_0x52eff7,_0x3739b7,_0x3bc48e){return _0x180e7c(_0x52eff7,_0x3739b7,_0x3bc48e);},'amhyC':'\x0a❌\x20Profile\x20setup\x20failed:'};if(!findGitRoot()&&_0x468b5f?.[_0x2712cc(0x1ff)]!==_0x2712cc(0x207))return console[_0x2712cc(0x1b4)](_0x5b53e1['XAfTa']),{'ready':![],'skipped':!![]};const _0x139442=_0x468b5f?.['scope']===_0x5b53e1[_0x2712cc(0x1ef)]?getRangerHomeDir():undefined;if(findExistingEnv(_0x5b53e1['JfQRj'],{'locations':['local'],'rangerDir':_0x139442}))return console[_0x2712cc(0x1b4)](_0x5b53e1['ulXzI']),{'ready':!![],'skipped':![]};try{return await _0x5b53e1[_0x2712cc(0x1fd)](addEnv,_0x2712cc(0x1cb),{'url':_0x468b5f?.[_0x2712cc(0x1e4)],'force':_0x468b5f?.[_0x2712cc(0x228)],'allowInsecureLocalhost':_0x468b5f?.['allowInsecureLocalhost'],'scope':_0x468b5f?.[_0x2712cc(0x1ff)]},_0x2e0485),{'ready':!![],'skipped':![]};}catch(_0x494a04){return console[_0x2712cc(0x20c)](_0x5b53e1['amhyC'],_0x494a04 instanceof Error?_0x494a04['message']:_0x494a04),{'ready':![],'skipped':![]};}}export async function start(_0x23dd1d,_0x10a241,_0x17f365){const _0x596c6a=_0x426c,_0x2dfed8={'geJTy':_0x596c6a(0x207),'auXui':function(_0x3adf20,_0x4772bb){return _0x3adf20+_0x4772bb;},'mBjlD':function(_0x17defa,_0x3ab003){return _0x17defa(_0x3ab003);},'lDfoE':'auth','pBlFQ':_0x596c6a(0x1cd),'UmrYq':function(_0x241e7f,_0x3d0e30){return _0x241e7f(_0x3d0e30);},'coboP':function(_0x2145ec){return _0x2145ec();},'ENWEj':_0x596c6a(0x1be),'CMTXz':function(_0x134270,_0x96e414){return _0x134270(_0x96e414);},'xdPoa':function(_0x17c658,_0x348ee8,_0x185db1){return _0x17c658(_0x348ee8,_0x185db1);},'aHNLo':_0x596c6a(0x1e5),'zHxNt':function(_0x3d480c,_0x3af78d){return _0x3d480c+_0x3af78d;},'lHlLC':function(_0x1c44d6,_0x1f7891){return _0x1c44d6(_0x1f7891);},'IGsaJ':'ranger\x20profile\x20add\x20<name>','YYGHh':'\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','KPQMV':'and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','OSIwM':'with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','RUPOS':_0x596c6a(0x1dc),'PKgYI':function(_0x5c1abb,_0x6001c){return _0x5c1abb(_0x6001c);},'tbgvU':_0x596c6a(0x218),'DEcgd':function(_0xafed1d,_0x23b8d8){return _0xafed1d+_0x23b8d8;}};console[_0x596c6a(0x1b4)](_0x596c6a(0x1e1));_0x10a241?.['scope']!==undefined&&_0x10a241[_0x596c6a(0x1ff)]!==_0x2dfed8[_0x596c6a(0x208)]&&(console['error'](_0x2dfed8[_0x596c6a(0x1d7)]('ranger\x20setup\x20--scope='+String(_0x10a241[_0x596c6a(0x1ff)])+_0x596c6a(0x1dd),_0x596c6a(0x1ba))+'project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.'),process[_0x596c6a(0x21c)](0x1));_0x10a241={..._0x10a241,'scope':'user'};const _0x10c7bc=!_0x2dfed8[_0x596c6a(0x1ee)](existsSync,getRangerHomeDir());await _0x2dfed8['mBjlD'](ensureRangerDir,_0x2dfed8[_0x596c6a(0x208)]);if(_0x10a241?.[_0x596c6a(0x1f8)])console[_0x596c6a(0x1b4)]('✓\x20Skipping\x20authentication\x20(--skip-auth)'),_0x17f365?.['trackPhaseEnd'](_0x2dfed8[_0x596c6a(0x1c0)],{'isFirstRun':_0x10c7bc,'method':'skipped'});else{_0x17f365?.['trackPhaseStart']('auth');const _0x2779d8=await authenticate(_0x23dd1d);_0x17f365?.['trackPhaseEnd'](_0x2dfed8[_0x596c6a(0x1c0)],{'isFirstRun':_0x10c7bc,'method':_0x2779d8[_0x596c6a(0x1cc)]});}_0x17f365?.[_0x596c6a(0x214)](_0x596c6a(0x1e6));_0x10a241?.[_0x596c6a(0x1d1)]?console[_0x596c6a(0x1b4)](_0x596c6a(0x21e)):await _0x2dfed8['mBjlD'](ensureChromium,_0x10a241?.['withDeps']);_0x17f365?.[_0x596c6a(0x1f2)](_0x596c6a(0x1e6),{'isFirstRun':_0x10c7bc,'skipped':!!_0x10a241?.[_0x596c6a(0x1d1)]}),console[_0x596c6a(0x1b4)]('\x0a✅\x20Ranger\x20setup\x20complete!\x0a');const _0x10c6fa=_0x10a241?.[_0x596c6a(0x1ff)],_0x5007d6=_0x10a241?.['opencode']??![];let _0x3e23a7=null;_0x5007d6?(_0x17f365?.['trackPhaseStart'](_0x2dfed8[_0x596c6a(0x202)]),_0x3e23a7=await ensureOpencodePluginConfig(_0x10c6fa),_0x17f365?.[_0x596c6a(0x1f2)](_0x2dfed8['pBlFQ'],{'isFirstRun':_0x10c7bc,'opencode':!![]})):(_0x17f365?.[_0x596c6a(0x214)](_0x2dfed8[_0x596c6a(0x202)]),await _0x2dfed8[_0x596c6a(0x1ed)](ensureClaudePlugin,_0x10c6fa),_0x17f365?.[_0x596c6a(0x1f2)]('plugin',{'isFirstRun':_0x10c7bc}));if(_0x5007d6&&_0x3e23a7){_0x17f365?.['trackPhaseStart']('skills');try{await installSkill(_0x596c6a(0x1d8),{'level':_0x3e23a7[_0x596c6a(0x1ff)],'cliVersion':_0x2dfed8[_0x596c6a(0x227)](getCurrentVersion),'platform':_0x596c6a(0x221)}),_0x17f365?.[_0x596c6a(0x1f2)](_0x2dfed8[_0x596c6a(0x20b)],{'isFirstRun':_0x10c7bc,'opencode':!![]});}catch(_0x7d7273){console[_0x596c6a(0x215)]('\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:',_0x7d7273 instanceof Error?_0x7d7273[_0x596c6a(0x224)]:_0x7d7273),_0x17f365?.[_0x596c6a(0x1f2)](_0x2dfed8[_0x596c6a(0x20b)],{'isFirstRun':_0x10c7bc,'opencode':!![],'failed':!![]});}}else _0x17f365?.[_0x596c6a(0x214)](_0x2dfed8[_0x596c6a(0x20b)]),await _0x2dfed8[_0x596c6a(0x219)](ensureClaudeSkills,_0x10c6fa),_0x17f365?.[_0x596c6a(0x1f2)](_0x2dfed8['ENWEj'],{'isFirstRun':_0x10c7bc});if(_0x10a241?.['skipAuth'])console['log'](_0x596c6a(0x204));else{if(_0x10a241?.['url']){_0x17f365?.[_0x596c6a(0x214)]('profile');const _0x54f3f3=await _0x2dfed8[_0x596c6a(0x21d)](ensureLocalEnv,{'url':_0x10a241['url'],'force':_0x10a241?.[_0x596c6a(0x228)],'allowInsecureLocalhost':_0x10a241?.['allowInsecureLocalhost'],'scope':_0x596c6a(0x207)},_0x17f365);_0x17f365?.['trackPhaseEnd'](_0x2dfed8[_0x596c6a(0x1f3)],{'isFirstRun':_0x10c7bc,'profileReady':_0x54f3f3[_0x596c6a(0x1e3)],'userSkipped':_0x54f3f3[_0x596c6a(0x222)]});}else console[_0x596c6a(0x1b4)](_0x2dfed8['auXui'](_0x2dfed8[_0x596c6a(0x1d7)](_0x2dfed8['zHxNt'](_0x596c6a(0x1f1),_0x596c6a(0x220)+_0x2dfed8[_0x596c6a(0x20f)](bold,_0x2dfed8['IGsaJ']))+_0x596c6a(0x1e9),_0x596c6a(0x1e8)),_0x596c6a(0x1da)));}if(_0x5007d6)console['log'](_0x2dfed8[_0x596c6a(0x21a)]),console['log'](_0x2dfed8['KPQMV']),console['log'](_0x2dfed8[_0x596c6a(0x20d)]),console[_0x596c6a(0x1b4)](_0x2dfed8['RUPOS']);else{const _0x297575=_0x2dfed8['PKgYI'](bold,_0x2dfed8['tbgvU']);console['log'](_0x2dfed8[_0x596c6a(0x1c7)](_0x2dfed8['auXui'](_0x2dfed8[_0x596c6a(0x1bf)]('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x297575+_0x596c6a(0x1b7),'\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with'),_0x596c6a(0x1db)),_0x596c6a(0x1bb)));}}
|
|
1
|
+
const _0x47d432=_0x53c2;(function(_0x36f55b,_0x46fd3d){const _0x445d33=_0x53c2,_0x5ccd59=_0x36f55b();while(!![]){try{const _0x513feb=-parseInt(_0x445d33(0xb9))/0x1+-parseInt(_0x445d33(0xcd))/0x2+-parseInt(_0x445d33(0x81))/0x3*(-parseInt(_0x445d33(0x6e))/0x4)+-parseInt(_0x445d33(0xac))/0x5*(-parseInt(_0x445d33(0x6c))/0x6)+parseInt(_0x445d33(0x9e))/0x7*(parseInt(_0x445d33(0xc2))/0x8)+-parseInt(_0x445d33(0xd3))/0x9*(parseInt(_0x445d33(0x8c))/0xa)+parseInt(_0x445d33(0x9b))/0xb;if(_0x513feb===_0x46fd3d)break;else _0x5ccd59['push'](_0x5ccd59['shift']());}catch(_0x43dd0b){_0x5ccd59['push'](_0x5ccd59['shift']());}}}(_0x2a6f,0xc5e0d));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x135c18 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';function _0x53c2(_0x3d9c5f,_0x439f57){_0x3d9c5f=_0x3d9c5f-0x69;const _0x2a6fd4=_0x2a6f();let _0x53c23f=_0x2a6fd4[_0x3d9c5f];return _0x53c23f;}import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION=_0x47d432(0xc0);const bold=_0x46d0af=>_0x47d432(0xbd)+_0x46d0af+_0x47d432(0x6b);export function getPlaywrightVersion(){const _0x53397a=_0x47d432,_0x9e3f16={'ubdkn':_0x53397a(0xd2)};try{const _0x5a6401=require[_0x53397a(0x93)](_0x9e3f16['ubdkn']),_0x5ac325=require(_0x5a6401);return _0x5ac325[_0x53397a(0xa4)];}catch{return null;}}export function installChromiumBinary(_0x7eff41,_0x2884ef=![]){const _0x2d40cb=_0x47d432,_0x3ac0a3={'SGlaH':function(_0x260f5a){return _0x260f5a();},'gfJVP':_0x2d40cb(0xbf),'YSLtx':_0x2d40cb(0xad),'XxYJh':_0x2d40cb(0xa6),'NWerS':_0x2d40cb(0xc6),'XjqgP':function(_0x5f2332,_0x428b12){return _0x5f2332===_0x428b12;},'sCVex':_0x2d40cb(0xa5),'kjtzJ':'error'};return new Promise((_0x4cbd26,_0x2cf00e)=>{const _0x51bcb6=_0x2d40cb,_0x4c9755=['playwright@'+_0x7eff41,'install',..._0x2884ef?[_0x3ac0a3[_0x51bcb6(0x85)]]:[],_0x3ac0a3['YSLtx']],_0x44d26f=spawn(_0x3ac0a3[_0x51bcb6(0x72)],_0x4c9755,{'stdio':[_0x51bcb6(0xd6),_0x3ac0a3[_0x51bcb6(0xcc)],'inherit'],'shell':_0x3ac0a3['XjqgP'](process[_0x51bcb6(0xb5)],_0x51bcb6(0xd5))});_0x44d26f['on'](_0x3ac0a3['sCVex'],_0x5f1cec=>{const _0x3229fe=_0x51bcb6;_0x5f1cec===0x0?_0x3ac0a3[_0x3229fe(0x7d)](_0x4cbd26):_0x2cf00e(new Error(_0x3229fe(0xae)+_0x5f1cec));}),_0x44d26f['on'](_0x3ac0a3[_0x51bcb6(0x7a)],_0x1f357c=>{_0x2cf00e(_0x1f357c);});});}export async function authenticate(_0x5dc591){const _0x17e8b7=_0x47d432,_0x798291={'HNiCn':function(_0x174790,_0x10d7d5){return _0x174790(_0x10d7d5);},'vHrlZ':function(_0xcbe84d,_0x683b7c){return _0xcbe84d instanceof _0x683b7c;},'zuwDq':_0x17e8b7(0x8f),'rPZnG':_0x17e8b7(0xc7),'cXdSu':function(_0x23a86f,_0x5c1853){return _0x23a86f(_0x5c1853);},'BwHss':_0x17e8b7(0x98),'gTmCd':'provided_token'};if(!_0x5dc591){const _0x36189e=await getToken();if(_0x36189e){const _0x160e65=await _0x798291[_0x17e8b7(0x9a)](getCurrentUser,_0x36189e);if(_0x160e65[_0x17e8b7(0x71)])return console[_0x17e8b7(0x9c)]('✓\x20Already\x20authenticated\x20to\x20'+_0x160e65['user'][_0x17e8b7(0x9d)]),{'token':_0x36189e,'method':_0x17e8b7(0x80)};}try{_0x5dc591=await runDeviceAuthFlow();}catch(_0x5c4260){throw new Error('Authentication\x20failed:\x20'+(_0x798291['vHrlZ'](_0x5c4260,Error)?_0x5c4260[_0x17e8b7(0x83)]:_0x5c4260));}const _0x1d6461=await getCurrentUser(_0x5dc591);if(!_0x1d6461[_0x17e8b7(0x71)])throw new Error(_0x17e8b7(0xb8)+_0x1d6461['error']);return console[_0x17e8b7(0x9c)](_0x17e8b7(0xc8)+_0x1d6461['user']['organizationName']),{'token':_0x5dc591,'method':_0x798291[_0x17e8b7(0xaa)]};}console[_0x17e8b7(0x9c)](_0x798291[_0x17e8b7(0x77)]);const _0x54fece=await _0x798291['cXdSu'](getCurrentUser,_0x5dc591);if(!_0x54fece['success']){if(_0x54fece[_0x17e8b7(0x7b)])throw new Error('Authentication\x20failed:\x20'+_0x54fece['error']+_0x17e8b7(0xc5));else throw new Error(_0x17e8b7(0x8b)+_0x54fece['error']+_0x17e8b7(0xa2));}return console[_0x17e8b7(0x9c)](_0x17e8b7(0xc8)+_0x54fece[_0x17e8b7(0x6f)]['organizationName']),await storeToken(_0x5dc591),console[_0x17e8b7(0x9c)](process['env'][_0x17e8b7(0x75)]?_0x17e8b7(0xc1):_0x798291['BwHss']),{'token':_0x5dc591,'method':_0x798291['gTmCd']};}export async function ensureRangerDir(_0x24f3fd){const _0x36ece9=_0x47d432,_0x45ef5e={'wdkKN':function(_0xecc86){return _0xecc86();},'wuESh':function(_0x4e7f65,_0x5912d3){return _0x4e7f65(_0x5912d3);},'kpyPq':function(_0x240d23,_0x47bfd7,_0x5838bf){return _0x240d23(_0x47bfd7,_0x5838bf);},'tbLnl':'✓\x20~/.ranger/\x20directory\x20already\x20exists'};void _0x24f3fd;const _0x6d2cac=_0x45ef5e['wdkKN'](getRangerHomeDir);return!_0x45ef5e[_0x36ece9(0xbc)](existsSync,_0x6d2cac)?(await _0x45ef5e['kpyPq'](mkdir,_0x6d2cac,{'recursive':!![]}),console[_0x36ece9(0x9c)](_0x36ece9(0x86)),{'path':_0x6d2cac,'installed':!![]}):(console[_0x36ece9(0x9c)](_0x45ef5e[_0x36ece9(0x95)]),{'path':_0x6d2cac,'installed':![]});}export async function ensureChromium(_0xef4424=![]){const _0x4f20bc=_0x47d432,_0xfb4fcb={'yUthK':function(_0xd1dbb2,_0x5e7eb4){return _0xd1dbb2(_0x5e7eb4);},'ufmZj':_0x4f20bc(0xb6),'IWArX':'\x0aInstalling\x20Chromium\x20browser...\x0a','zBoOb':'\x0a❌\x20Failed\x20to\x20install\x20Chromium:','ANMlE':function(_0x5ec17d,_0xc49e1d){return _0x5ec17d instanceof _0xc49e1d;},'Qajzh':'You\x20can\x20install\x20it\x20manually\x20by\x20running:','JHLft':'\x0a⚠\x20Skipping\x20Chromium\x20installation.'};let _0x775a83=![];try{const _0x33e9dd=chromium['executablePath']();_0x775a83=_0xfb4fcb[_0x4f20bc(0x6a)](existsSync,_0x33e9dd);}catch{_0x775a83=![];}if(_0x775a83)return console[_0x4f20bc(0x9c)]('✓\x20Playwright\x20Chromium\x20browser\x20found'),![];const _0x2b176f=getPlaywrightVersion(),_0x172643=_0x2b176f??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x30033e=!_0x2b176f,_0x2e6976=process[_0x4f20bc(0xa1)][_0x4f20bc(0xb3)]&&process['stdout'][_0x4f20bc(0xb3)];let _0x5d1641=!![];if(_0x2e6976){const {install:_0x18a306}=await _0x135c18[_0x4f20bc(0x7e)]([{'type':'confirm','name':_0xfb4fcb[_0x4f20bc(0xbe)],'message':_0x30033e?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x172643+_0x4f20bc(0x8d):_0x4f20bc(0xc9)+_0x172643+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x5d1641=_0x18a306;}else console['log']('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x172643+(_0x30033e?'\x20(fallback\x20version)':'')+_0x4f20bc(0xcf));if(_0x5d1641){console[_0x4f20bc(0x9c)](_0xfb4fcb['IWArX']);try{await installChromiumBinary(_0x172643,_0xef4424),console[_0x4f20bc(0x9c)]('\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully');}catch(_0x4e6964){console[_0x4f20bc(0x78)](_0xfb4fcb[_0x4f20bc(0x69)],_0xfb4fcb['ANMlE'](_0x4e6964,Error)?_0x4e6964['message']:_0x4e6964),console[_0x4f20bc(0x9c)](_0xfb4fcb[_0x4f20bc(0x94)]),console[_0x4f20bc(0x9c)]('\x20\x20npx\x20playwright@'+_0x172643+_0x4f20bc(0x84));}}else console[_0x4f20bc(0x9c)](_0xfb4fcb[_0x4f20bc(0x76)]),console[_0x4f20bc(0x9c)](_0x4f20bc(0xa8)),console['log']('\x20\x20npx\x20playwright@'+_0x172643+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x4027a6){const _0x565759=_0x47d432,_0x264426={'OwNgD':_0x565759(0x82)},_0x3dc912=join(_0x4027a6,_0x565759(0x7f)),_0x5946c8='\x0a\x0a#\x20Ignore\x20local-only\x20directories\x0alocal/\x0asessions/\x0abug-bashes/\x0areports/\x0afeedback-images/\x0a\x0aactive-profile.txt\x0aactive-feature.txt\x0a.gitignore\x0a\x0a#\x20Ignore\x20plaintext\x20auth\x20files\x20(encrypted\x20.enc\x20files\x20are\x20safe\x20to\x20commit)\x0a**/auth.json\x0a';await writeFile(_0x3dc912,_0x5946c8),console[_0x565759(0x9c)](_0x264426[_0x565759(0xb2)]);}function _0x2a6f(){const _0x23e728=['fmaWz','TLduW','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','13359880aiFOWd','\x20now?','iKmMV','device_auth','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','\x20is\x20no\x20longer\x20supported.\x20','skills','resolve','Qajzh','tbLnl','trackPhaseStart','yUnnB','✓\x20Stored\x20credentials\x20locally','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','HNiCn','25908234hbNtsD','log','organizationName','441QnTgwl','opencode','UBxqd','stdin','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','allowInsecureLocalhost','version','close','npx','local','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','ranger\x20profile\x20add\x20<name>','zuwDq','vDmky','5xUkasZ','chromium','Installation\x20failed\x20with\x20exit\x20code\x20','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','MfBqf','profile','OwNgD','isTTY','Zgung','platform','install','skipChromium','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','578894jRmNHs','auth','CRqcj','wuESh','\x1b[1m','ufmZj','--with-deps','1.58.2','✓\x20Exported\x20credentials\x20for\x20CI','41488arFjBV','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','scope','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','inherit','Validating\x20API\x20token...','✓\x20Authenticated\x20to\x20','The\x20required\x20version\x20(','skipAuth','GVDNF','NWerS','3130548xWuoRr','\x20and\x20prompt\x20the\x20coding','...','/ranger:enable','RnChv','playwright/package.json','9hPezKK','ranger\x20setup\x20--scope=','win32','ignore','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','ZjOVJ','zBoOb','yUthK','\x1b[0m','230088dOKWZp','UTBPC','2093740uazmMC','user','plugin','success','XxYJh','withDeps','trackPhaseEnd','GITHUB_ENV','JHLft','rPZnG','error','Lfstj','kjtzJ','status','YUxYv','SGlaH','prompt','.gitignore','existing_token','9ycVkFA','✓\x20Created\x20.ranger/.gitignore','message','\x20install\x20chromium','gfJVP','✓\x20Created\x20~/.ranger/\x20directory','mvYbZ','url'];_0x2a6f=function(){return _0x23e728;};return _0x2a6f();}export async function ensureLocalEnv(_0x5d8df1,_0x1a28ca){const _0x362b4f=_0x47d432,_0x52606e={'CkPWw':function(_0x42b29c,_0x218679){return _0x42b29c!==_0x218679;},'TLduW':'⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','gLhnl':function(_0x373982,_0x2af927){return _0x373982===_0x2af927;},'wOpGH':_0x362b4f(0xa7),'YUxYv':'✓\x20Local\x20profile\x20already\x20exists','Lfstj':function(_0x25e38f,_0x1d23e0){return _0x25e38f instanceof _0x1d23e0;}};if(!findGitRoot()&&_0x52606e['CkPWw'](_0x5d8df1?.['scope'],'user'))return console['log'](_0x52606e[_0x362b4f(0x8a)]),{'ready':![],'skipped':!![]};const _0x2f9e08=_0x52606e['gLhnl'](_0x5d8df1?.[_0x362b4f(0xc4)],'user')?getRangerHomeDir():undefined;if(findExistingEnv(_0x52606e['wOpGH'],{'locations':[_0x362b4f(0xa7)],'rangerDir':_0x2f9e08}))return console[_0x362b4f(0x9c)](_0x52606e[_0x362b4f(0x7c)]),{'ready':!![],'skipped':![]};try{return await addEnv(_0x52606e['wOpGH'],{'url':_0x5d8df1?.[_0x362b4f(0x88)],'force':_0x5d8df1?.['force'],'allowInsecureLocalhost':_0x5d8df1?.[_0x362b4f(0xa3)],'scope':_0x5d8df1?.[_0x362b4f(0xc4)]},_0x1a28ca),{'ready':!![],'skipped':![]};}catch(_0x467037){return console[_0x362b4f(0x78)]('\x0a❌\x20Profile\x20setup\x20failed:',_0x52606e[_0x362b4f(0x79)](_0x467037,Error)?_0x467037['message']:_0x467037),{'ready':![],'skipped':![]};}}export async function start(_0x199bf2,_0x5e0473,_0x392d3f){const _0x4d6992=_0x47d432,_0xd1b60f={'vDmky':function(_0x1354e5,_0x590a88){return _0x1354e5!==_0x590a88;},'GHnml':function(_0x4a61a5,_0x511277){return _0x4a61a5!==_0x511277;},'UTBPC':'user','UBxqd':function(_0x5020c0,_0x39c647){return _0x5020c0+_0x39c647;},'MfBqf':'skipped','yUnnB':_0x4d6992(0xba),'ZjOVJ':function(_0x2ab5bc,_0x43744a){return _0x2ab5bc(_0x43744a);},'iKmMV':'✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','CRqcj':'\x0a✅\x20Ranger\x20setup\x20complete!\x0a','RnChv':function(_0x2c3722,_0x19625a){return _0x2c3722(_0x19625a);},'mvYbZ':'skills','DSXoS':'\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','fmaWz':function(_0x44312d,_0x24374b,_0x4f37b7){return _0x44312d(_0x24374b,_0x4f37b7);},'Zgung':_0x4d6992(0xb1),'FnKyf':function(_0x2a6520,_0x20e40f){return _0x2a6520+_0x20e40f;},'GVDNF':function(_0x4e0bac,_0x2d9981){return _0x4e0bac+_0x2d9981;},'vgeaT':_0x4d6992(0xa9),'YRLyL':_0x4d6992(0x99),'ZKFbP':function(_0x1d251e,_0x384873){return _0x1d251e+_0x384873;}};console[_0x4d6992(0x9c)]('\x0a🚀\x20Ranger\x20Setup\x0a');_0xd1b60f[_0x4d6992(0xab)](_0x5e0473?.['scope'],undefined)&&_0xd1b60f['GHnml'](_0x5e0473['scope'],_0xd1b60f[_0x4d6992(0x6d)])&&(console[_0x4d6992(0x78)](_0xd1b60f[_0x4d6992(0xa0)](_0x4d6992(0xd4)+String(_0x5e0473['scope'])+_0x4d6992(0x91)+'Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.')),process['exit'](0x1));_0x5e0473={..._0x5e0473,'scope':'user'};const _0x2d1edf=!existsSync(getRangerHomeDir());await ensureRangerDir(_0x4d6992(0x6f));if(_0x5e0473?.[_0x4d6992(0xca)])console[_0x4d6992(0x9c)]('✓\x20Skipping\x20authentication\x20(--skip-auth)'),_0x392d3f?.[_0x4d6992(0x74)]('auth',{'isFirstRun':_0x2d1edf,'method':_0xd1b60f[_0x4d6992(0xb0)]});else{_0x392d3f?.[_0x4d6992(0x96)](_0xd1b60f[_0x4d6992(0x97)]);const _0x5ad1bf=await _0xd1b60f['ZjOVJ'](authenticate,_0x199bf2);_0x392d3f?.['trackPhaseEnd'](_0xd1b60f['yUnnB'],{'isFirstRun':_0x2d1edf,'method':_0x5ad1bf['method']});}_0x392d3f?.[_0x4d6992(0x96)]('chromium');_0x5e0473?.[_0x4d6992(0xb7)]?console['log'](_0xd1b60f[_0x4d6992(0x8e)]):await _0xd1b60f[_0x4d6992(0xd8)](ensureChromium,_0x5e0473?.[_0x4d6992(0x73)]);_0x392d3f?.[_0x4d6992(0x74)]('chromium',{'isFirstRun':_0x2d1edf,'skipped':!!_0x5e0473?.[_0x4d6992(0xb7)]}),console['log'](_0xd1b60f[_0x4d6992(0xbb)]);const _0x1486dc=_0x5e0473?.[_0x4d6992(0xc4)],_0x40d1be=_0x5e0473?.['opencode']??![];let _0x4dca6b=null;_0x40d1be?(_0x392d3f?.[_0x4d6992(0x96)](_0x4d6992(0x70)),_0x4dca6b=await ensureOpencodePluginConfig(_0x1486dc),_0x392d3f?.['trackPhaseEnd']('plugin',{'isFirstRun':_0x2d1edf,'opencode':!![]})):(_0x392d3f?.[_0x4d6992(0x96)](_0x4d6992(0x70)),await _0xd1b60f[_0x4d6992(0xd1)](ensureClaudePlugin,_0x1486dc),_0x392d3f?.[_0x4d6992(0x74)](_0x4d6992(0x70),{'isFirstRun':_0x2d1edf}));if(_0x40d1be&&_0x4dca6b){_0x392d3f?.['trackPhaseStart'](_0xd1b60f[_0x4d6992(0x87)]);try{await installSkill('ranger',{'level':_0x4dca6b['scope'],'cliVersion':getCurrentVersion(),'platform':_0x4d6992(0x9f)}),_0x392d3f?.[_0x4d6992(0x74)](_0xd1b60f['mvYbZ'],{'isFirstRun':_0x2d1edf,'opencode':!![]});}catch(_0x4f4028){console['warn'](_0xd1b60f['DSXoS'],_0x4f4028 instanceof Error?_0x4f4028[_0x4d6992(0x83)]:_0x4f4028),_0x392d3f?.['trackPhaseEnd'](_0xd1b60f[_0x4d6992(0x87)],{'isFirstRun':_0x2d1edf,'opencode':!![],'failed':!![]});}}else _0x392d3f?.['trackPhaseStart'](_0xd1b60f['mvYbZ']),await ensureClaudeSkills(_0x1486dc),_0x392d3f?.['trackPhaseEnd'](_0x4d6992(0x92),{'isFirstRun':_0x2d1edf});if(_0x5e0473?.[_0x4d6992(0xca)])console[_0x4d6992(0x9c)](_0x4d6992(0xaf));else{if(_0x5e0473?.[_0x4d6992(0x88)]){_0x392d3f?.[_0x4d6992(0x96)](_0x4d6992(0xb1));const _0x453803=await _0xd1b60f[_0x4d6992(0x89)](ensureLocalEnv,{'url':_0x5e0473['url'],'force':_0x5e0473?.['force'],'allowInsecureLocalhost':_0x5e0473?.['allowInsecureLocalhost'],'scope':_0xd1b60f[_0x4d6992(0x6d)]},_0x392d3f);_0x392d3f?.[_0x4d6992(0x74)](_0xd1b60f[_0x4d6992(0xb4)],{'isFirstRun':_0x2d1edf,'profileReady':_0x453803['ready'],'userSkipped':_0x453803['skipped']});}else console[_0x4d6992(0x9c)](_0xd1b60f['FnKyf'](_0xd1b60f[_0x4d6992(0xcb)]('\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:'+('\x0a\x20\x20'+_0xd1b60f[_0x4d6992(0xd1)](bold,_0xd1b60f['vgeaT'])),'\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)')+'\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles'));}if(_0x40d1be)console['log'](_0xd1b60f['YRLyL']),console[_0x4d6992(0x9c)](_0x4d6992(0xd7)),console['log'](_0x4d6992(0xc3)),console[_0x4d6992(0x9c)](_0x4d6992(0x90));else{const _0x596b7e=bold(_0x4d6992(0xd0));console[_0x4d6992(0x9c)](_0xd1b60f['ZKFbP']('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x596b7e+_0x4d6992(0xce)+'\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser')+'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.');}}
|
package/build/commands/status.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x54954e=_0x3c88;(function(_0x3053d3,_0x527049){const _0x4b4cea=_0x3c88,_0x4f14e2=_0x3053d3();while(!![]){try{const _0x3dad6a=parseInt(_0x4b4cea(0x14d))/0x1*(-parseInt(_0x4b4cea(0xfe))/0x2)+parseInt(_0x4b4cea(0xf2))/0x3*(parseInt(_0x4b4cea(0x111))/0x4)+-parseInt(_0x4b4cea(0xea))/0x5*(-parseInt(_0x4b4cea(0x145))/0x6)+-parseInt(_0x4b4cea(0x13a))/0x7*(parseInt(_0x4b4cea(0x123))/0x8)+parseInt(_0x4b4cea(0x143))/0x9+parseInt(_0x4b4cea(0x107))/0xa+-parseInt(_0x4b4cea(0x144))/0xb*(parseInt(_0x4b4cea(0x147))/0xc);if(_0x3dad6a===_0x527049)break;else _0x4f14e2['push'](_0x4f14e2['shift']());}catch(_0x34b089){_0x4f14e2['push'](_0x4f14e2['shift']());}}}(_0x3968,0xc8fc2));import{readFile,readdir}from'fs/promises';function _0x3c88(_0x29798d,_0x3738e4){_0x29798d=_0x29798d-0xe6;const _0x3968e2=_0x3968();let _0x3c88de=_0x3968e2[_0x29798d];return _0x3c88de;}import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{listCloudProfiles}from'./utils/cloudProfile.js';import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x5c773b=>'\x1b[1m'+_0x5c773b+_0x54954e(0x135),link=(_0x29e6a1,_0x33d27c)=>_0x54954e(0x148)+_0x29e6a1+'\x07'+(_0x33d27c||_0x29e6a1)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x317634=_0x54954e,_0x33c722={'KVRnf':_0x317634(0xe8),'wAljD':_0x317634(0xfc),'Yddqr':_0x317634(0x149),'plEDN':'not_configured','fLplX':_0x317634(0x10c),'ALwOb':_0x317634(0x11a),'MiuYD':_0x317634(0x130),'UbdMC':_0x317634(0x137)};return new Promise(_0x177bc7=>{const _0x2400d2=_0x317634,_0x3d8336={'MwESw':_0x33c722[_0x2400d2(0x115)],'wVfqC':_0x33c722[_0x2400d2(0x110)],'cSeDW':_0x33c722[_0x2400d2(0x113)],'MGOSa':function(_0x34ee40,_0x2d4a66){return _0x34ee40(_0x2d4a66);},'HTrWB':_0x33c722['plEDN']},_0x4718c4=spawn('opencode',[_0x33c722['fLplX'],_0x33c722[_0x2400d2(0x14e)]],{'stdio':[_0x33c722['MiuYD'],'pipe','pipe']});let _0x4ffaf5='';_0x4718c4[_0x2400d2(0x11b)]?.['on']('data',_0x403523=>{const _0x5b0027=_0x2400d2;_0x4ffaf5+=_0x403523[_0x5b0027(0xf1)]();}),_0x4718c4['stderr']?.['on'](_0x33c722[_0x2400d2(0x119)],_0x10b89f=>{_0x4ffaf5+=_0x10b89f['toString']();}),_0x4718c4['on'](_0x2400d2(0x109),()=>{_0x177bc7({'status':'not_installed'});}),_0x4718c4['on'](_0x2400d2(0x128),_0x38d9ac=>{const _0x50ac10=_0x2400d2;if(_0x38d9ac!==0x0){_0x177bc7({'status':_0x50ac10(0x14f)});return;}const _0x26387f=_0x4ffaf5['trim']();let _0x1d17fd=null;if(_0x26387f)try{_0x1d17fd=JSON['parse'](_0x26387f);}catch{const _0x3384df=_0x26387f['match'](/\{[\s\S]*\}$/);if(_0x3384df)try{_0x1d17fd=JSON['parse'](_0x3384df[0x0]);}catch{_0x1d17fd=null;}}const _0x1a34ab=Array['isArray'](_0x1d17fd?.['plugin'])?_0x1d17fd?.[_0x50ac10(0xf6)]:[],_0x75775c=_0x1a34ab['some'](_0x406810=>{const _0x295c5b=_0x50ac10;if(typeof _0x406810!==_0x3d8336['MwESw'])return![];return _0x406810['includes'](_0x295c5b(0x14b))||_0x406810[_0x295c5b(0x105)](_0x3d8336[_0x295c5b(0x14a)]);});if(_0x75775c){_0x177bc7({'status':_0x3d8336['cSeDW'],'details':_0x1a34ab[_0x50ac10(0xf8)]>0x0?_0x1a34ab['length']+'\x20plugin(s)\x20configured':undefined});return;}if(_0x1a34ab['length']>0x0){_0x3d8336[_0x50ac10(0xf0)](_0x177bc7,{'status':_0x3d8336['HTrWB'],'details':_0x1a34ab['length']+'\x20plugin(s)\x20configured'});return;}_0x3d8336[_0x50ac10(0xf0)](_0x177bc7,{'status':_0x50ac10(0x11e)});});});}async function getSkillsFromDir(_0x4a1428,_0x1ff255){const _0x4b848c=_0x54954e,_0x4a9667={'nzGvf':function(_0x446dc6,_0x9423a6){return _0x446dc6(_0x9423a6);},'OtxBg':function(_0x4fcb3f,_0x23f049,_0x54c405){return _0x4fcb3f(_0x23f049,_0x54c405);},'pKByD':'SKILL.md','CLnKv':function(_0x55efe6,_0x54da81){return _0x55efe6(_0x54da81);},'udWZs':function(_0x308637,_0x179c59,_0xd09979){return _0x308637(_0x179c59,_0xd09979);}};if(!_0x4a9667[_0x4b848c(0x131)](existsSync,_0x4a1428))return[];const _0x5373d3=[];try{const _0x354ee2=await _0x4a9667[_0x4b848c(0xee)](readdir,_0x4a1428,{'withFileTypes':!![]});for(const _0x2cfeb1 of _0x354ee2){if(_0x2cfeb1[_0x4b848c(0x146)]()){const _0x5f29ad=join(_0x4a1428,_0x2cfeb1[_0x4b848c(0x150)],_0x4a9667['pKByD']);if(_0x4a9667['CLnKv'](existsSync,_0x5f29ad)){let _0x11351d=_0x2cfeb1['name'];try{const _0x253b14=await _0x4a9667[_0x4b848c(0x104)](readFile,_0x5f29ad,_0x4b848c(0x11f)),_0x50cc8a=_0x253b14['match'](/name:\s*(.+)/);_0x50cc8a&&(_0x11351d=_0x50cc8a[0x1]['trim']());}catch{}_0x5373d3[_0x4b848c(0x14c)]({'name':_0x2cfeb1[_0x4b848c(0x150)],'displayName':_0x11351d,'path':_0x5f29ad,'level':_0x1ff255});}}}}catch{return[];}return _0x5373d3;}function _0x3968(){const _0x2641fa=['project','bTqBh','\x0a---\x20Profiles\x20---','\x20\x20\x20\x20Session:\x20','DEBUG','string','VSzFL','615SGMBIE','settingsPath','version','No\x20profiles\x20configured','OtxBg','\x0a---\x20Claude\x20Code\x20Plugin\x20---','MGOSa','toString','9IvaWri','YoAbc','rlUKs','scope','plugin','GIMSD','length','ranger@trailhead','UAGhE','path','opencode-plugin','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','14426jDbZbQ','disabled','all','map','Xsfmt','cwd','udWZs','includes','PWqdF','14702160UgEQTI','organizationName','error','\x0a---\x20OpenCode\x20Plugin\x20---','unknown','debug','\x20\x20\x20\x20','\x20\x20Run:\x20ranger\x20update','\x0a\x20\x20No\x20active\x20profile\x20set','wAljD','1734556QucfWz','hasEncryptedAuth','Yddqr','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','KVRnf','TClPI','\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>','no\x20session','UbdMC','config','stdout','has','\x0a📊\x20Ranger\x20Status\x0a','not_configured','utf-8','\x20(up\x20to\x20date)','KdKdi','Root:\x20','1208edwPIJ','\x20\x20Not\x20installed','\x20\x20\x20\x20Auth:\x20','uqyWQ','success','close','join','isActive','\x20\x20Run:\x20ranger\x20setup\x20--opencode','\x20\x20Project-level:','\x20local','\x20\x20Run:\x20ranger\x20skillup','filter','ignore','nzGvf','enabled','Organization:\x20','details','\x1b[0m','env','data',':\x20installed\x20(','log','5348grwCdt','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','cached\x20(updated\x20','displayName','hasPlaintextAuth','Version:\x20','lKRNJ','QUfWc','\x20\x20\x20\x20Settings:\x20','3658284lcilpt','29330312PSOLur','63774VfLIGy','isDirectory','12BamHwL','\x1b]8;;file://','configured','wVfqC','@ranger-testing/opencode-plugin','push','122kvtOFA','ALwOb','not_installed','name'];_0x3968=function(){return _0x2641fa;};return _0x3968();}async function getInstalledSkills(){const _0x2a73f=_0x54954e,_0x2febdb={'UWoxR':function(_0x215afd,_0x1e35b7,_0x1bc5cc){return _0x215afd(_0x1e35b7,_0x1bc5cc);},'pGrgQ':function(_0x119106){return _0x119106();}},[_0x388bc7,_0x32abe0]=await Promise[_0x2a73f(0x100)]([_0x2febdb['UWoxR'](getSkillsFromDir,_0x2febdb['pGrgQ'](getProjectSkillsDir),_0x2a73f(0x151)),_0x2febdb['UWoxR'](getSkillsFromDir,getUserSkillsDir(),'user')]);return{'project':_0x388bc7,'user':_0x32abe0};}async function getEnvironments(){const _0xc775d5={'Xsfmt':'settings.json','ZvgMF':function(_0x52802b,_0x2dd05e){return _0x52802b(_0x2dd05e);},'ZbDhG':'(not\x20found)'},{envNames:_0x2aadde,activeEnv:_0x2806fb}=await getEnvNames(),_0x4fece1=getRangerDir();if(!existsSync(_0x4fece1))return{'envs':[],'activeEnv':null};const _0x3bb61b=_0x2aadde['map'](_0x1ddcf0=>{const _0x48e338=_0x3c88,_0x18e008=getEnvDir(_0x1ddcf0),_0x3be000=join(_0x18e008,_0xc775d5[_0x48e338(0x102)]),_0x456765=join(_0x18e008,'auth.json'),_0xb72b4=join(_0x18e008,'auth.json.enc');return{'name':_0x1ddcf0,'settingsPath':_0xc775d5['ZvgMF'](existsSync,_0x3be000)?_0x3be000:_0xc775d5['ZbDhG'],'hasPlaintextAuth':existsSync(_0x456765),'hasEncryptedAuth':_0xc775d5['ZvgMF'](existsSync,_0xb72b4),'isActive':_0x1ddcf0===_0x2806fb};});return{'envs':_0x3bb61b,'activeEnv':_0x2806fb};}export async function status(){const _0xd2682f=_0x54954e,_0x31655b={'bTqBh':function(_0x32e7f3,_0x8e5526){return _0x32e7f3(_0x8e5526);},'VSzFL':function(_0xa6e807,_0x36baa9){return _0xa6e807(_0x36baa9);},'gwSoZ':function(_0x577ae2,_0x3ba73e){return _0x577ae2(_0x3ba73e);},'rwpEk':function(_0x3988ce,_0x1793f9){return _0x3988ce(_0x1793f9);},'oJBlY':function(_0x46d14c){return _0x46d14c();},'lKRNJ':function(_0x1942fd){return _0x1942fd();},'CsceK':function(_0x3b5fd5,_0x29e98e){return _0x3b5fd5(_0x29e98e);},'CxOEh':function(_0x1e34c1){return _0x1e34c1();},'hCYYH':function(_0x4fc09b){return _0x4fc09b();},'GIMSD':_0xd2682f(0x10a),'QWSnU':function(_0x16dcc2){return _0x16dcc2();},'CWBqJ':function(_0x4131d1,_0xaeed42){return _0x4131d1===_0xaeed42;},'mansY':_0xd2682f(0x149),'UAGhE':'@ranger-testing/opencode-plugin','KdKdi':function(_0x1e401f,_0x499899){return _0x1e401f===_0x499899;},'rlUKs':'\x20\x20Not\x20configured','JOyjz':_0xd2682f(0x12b),'QUfWc':'\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','uqyWQ':_0xd2682f(0xef),'YxxwV':_0xd2682f(0x10b),'tGHZP':_0xd2682f(0x124),'Sazrl':'\x0a---\x20Skills\x20---','gciEy':function(_0x16c5c8,_0x276414){return _0x16c5c8+_0x276414;},'PWqdF':function(_0x2e1ac9,_0x4c0b24,_0x2fbdd2){return _0x2e1ac9(_0x4c0b24,_0x2fbdd2);},'qoaeg':function(_0x3d95cd,_0x3b2c04){return _0x3d95cd>_0x3b2c04;},'YoAbc':_0xd2682f(0x153),'yqlfC':function(_0x4fef68){return _0x4fef68();},'rZXRg':function(_0x1e30c4,_0x436d85){return _0x1e30c4+_0x436d85;},'RtAAn':function(_0x474727,_0x3cd2eb){return _0x474727>_0x3cd2eb;},'IAtaM':function(_0x2b70f5,_0x351d4a){return _0x2b70f5>_0x351d4a;},'TClPI':'\x20(active)','fgfZI':'(not\x20found)'};console['log'](_0xd2682f(0x11d));const _0x45fea1=process[_0xd2682f(0x103)](),_0x1abbe4=getRangerDir();if(!_0x31655b[_0xd2682f(0x152)](existsSync,_0x1abbe4)){console['log']('Root:\x20'+link(_0x45fea1,_0x31655b[_0xd2682f(0xe9)](bold,_0x31655b['gwSoZ'](basename,_0x45fea1)))),console['log'](_0xd2682f(0x13b)),console[_0xd2682f(0x139)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console[_0xd2682f(0x139)](_0xd2682f(0x122)+link(_0x45fea1,_0x31655b['gwSoZ'](bold,_0x31655b['rwpEk'](basename,_0x45fea1))));const _0x84951d=getCurrentVersion(),_0x23db44=_0x31655b['oJBlY'](getLatestVersion);if(_0x23db44['version']&&_0x23db44[_0xd2682f(0xec)]!==_0x84951d)console[_0xd2682f(0x139)](_0xd2682f(0x13f)+_0x84951d+'\x20(latest:\x20'+_0x23db44[_0xd2682f(0xec)]+')'),console['log'](_0xd2682f(0x10e));else _0x23db44[_0xd2682f(0xec)]?console[_0xd2682f(0x139)]('Version:\x20'+_0x84951d+_0xd2682f(0x120)):console[_0xd2682f(0x139)](_0xd2682f(0x13f)+_0x84951d);const _0x480c38=await _0x31655b[_0xd2682f(0x140)](getToken);if(_0x480c38){const _0x350dcd=await _0x31655b['CsceK'](getCurrentUser,_0x480c38);_0x350dcd[_0xd2682f(0x127)]?console[_0xd2682f(0x139)](_0xd2682f(0x133)+bold(_0x350dcd['user'][_0xd2682f(0x108)])):(console['log']('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console[_0xd2682f(0x139)]('API\x20Token:\x20✗\x20Not\x20found'),console[_0xd2682f(0x139)]('\x20\x20Run:\x20ranger\x20setup\x20[token]');process[_0xd2682f(0x136)][_0xd2682f(0xe7)]&&(console[_0xd2682f(0x139)]('API\x20Environment:\x20'+_0x31655b['CxOEh'](getCurrentEnvironment)),console['log']('API\x20URL:\x20'+_0x31655b['hCYYH'](getApiBaseUrl)));console[_0xd2682f(0x139)](_0x31655b[_0xd2682f(0xf7)]);const _0xe6148=await _0x31655b['QWSnU'](getOpencodePluginStatus);if(_0x31655b['CWBqJ'](_0xe6148['status'],_0x31655b['mansY']))console['log']('\x20\x20'+bold(_0x31655b[_0xd2682f(0xfa)])+':\x20configured'),_0xe6148[_0xd2682f(0x134)]&&console['log']('\x20\x20'+_0xe6148['details']);else _0x31655b[_0xd2682f(0x121)](_0xe6148['status'],'not_configured')?(console[_0xd2682f(0x139)](_0x31655b[_0xd2682f(0xf4)]),_0xe6148[_0xd2682f(0x134)]&&console[_0xd2682f(0x139)]('\x20\x20'+_0xe6148['details']),console['log'](_0x31655b['JOyjz'])):console[_0xd2682f(0x139)](_0x31655b[_0xd2682f(0x141)]);console['log'](_0x31655b[_0xd2682f(0x126)]);const _0x300893=await getPluginInfo(_0xd2682f(0xf9));if(_0x300893){const _0xf8cdc8=_0x300893[_0xd2682f(0xf5)]||_0x31655b['YxxwV'],_0x120ddc=_0x300893[_0xd2682f(0x132)]?_0xd2682f(0x132):_0xd2682f(0xff);console['log']('\x20\x20'+bold(_0xd2682f(0xf9))+_0xd2682f(0x138)+_0xf8cdc8+',\x20'+_0x120ddc+')');}else console['log'](_0x31655b['tGHZP']),console[_0xd2682f(0x139)](_0xd2682f(0x114));console[_0xd2682f(0x139)](_0x31655b['Sazrl']);const {project:_0xb10494,user:_0x229cd8}=await getInstalledSkills(),_0x9cb307=_0xb10494[_0xd2682f(0x12f)](_0x18bcbb=>RANGER_MANAGED_SKILLS[_0xd2682f(0x105)](_0x18bcbb[_0xd2682f(0x150)])),_0x1785de=_0x229cd8[_0xd2682f(0x12f)](_0x50cb7f=>RANGER_MANAGED_SKILLS[_0xd2682f(0x105)](_0x50cb7f[_0xd2682f(0x150)])),_0x1428eb=_0x31655b['gciEy'](_0x9cb307[_0xd2682f(0xf8)],_0x1785de[_0xd2682f(0xf8)]);if(_0x31655b['KdKdi'](_0x1428eb,0x0))console['log']('No\x20skills\x20installed'),console['log'](_0xd2682f(0x12e));else{if(_0x9cb307[_0xd2682f(0xf8)]>0x0){console['log'](_0xd2682f(0x12c));for(const _0x1efea3 of _0x9cb307){console['log'](_0xd2682f(0x10d)+bold(_0x1efea3['displayName'])+':\x20'+_0x31655b[_0xd2682f(0x106)](link,_0x1efea3[_0xd2682f(0xfb)],basename(_0x1efea3[_0xd2682f(0xfb)])));}}if(_0x31655b['qoaeg'](_0x1785de[_0xd2682f(0xf8)],0x0)){console[_0xd2682f(0x139)]('\x20\x20User-level:');for(const _0x422ac5 of _0x1785de){console[_0xd2682f(0x139)]('\x20\x20\x20\x20'+_0x31655b['VSzFL'](bold,_0x422ac5[_0xd2682f(0x13d)])+':\x20'+link(_0x422ac5['path'],basename(_0x422ac5['path'])));}}}console['log'](_0x31655b[_0xd2682f(0xf3)]);const {envs:_0x4d3a2c,activeEnv:_0x1ede43}=await _0x31655b['CxOEh'](getEnvironments);let _0x235c65=[];if(_0x480c38)try{_0x235c65=await _0x31655b['yqlfC'](listCloudProfiles);}catch{}const _0x2dabee=_0x31655b['rZXRg'](_0x4d3a2c[_0xd2682f(0xf8)],_0x235c65[_0xd2682f(0xf8)]);if(_0x31655b['KdKdi'](_0x2dabee,0x0))console[_0xd2682f(0x139)](_0xd2682f(0xed)),console[_0xd2682f(0x139)](_0xd2682f(0x117));else{if(_0x31655b['RtAAn'](_0x2dabee,0x5)){const _0xb77f09=[];_0x235c65['length']>0x0&&_0xb77f09['push'](_0x235c65['length']+'\x20cloud'),_0x31655b['IAtaM'](_0x4d3a2c['length'],0x0)&&_0xb77f09[_0xd2682f(0x14c)](_0x4d3a2c['length']+_0xd2682f(0x12d)),console[_0xd2682f(0x139)](_0x2dabee+'\x20profiles\x20configured\x20('+_0xb77f09[_0xd2682f(0x129)](',\x20')+')'),_0x1ede43&&console['log']('\x20\x20Active:\x20'+bold(_0x1ede43)),console['log']('\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)');}else{for(const _0x227afc of _0x235c65){const _0x60e761=_0x227afc['name']===_0x1ede43?'\x20(active)':'';console[_0xd2682f(0x139)]('\x20\x20'+bold(_0x227afc[_0xd2682f(0x150)])+'\x20[cloud]'+_0x60e761);const _0x5b6b06=_0x227afc['sessionUpdatedAt']?_0xd2682f(0x13c)+_0x227afc['sessionUpdatedAt']+')':_0xd2682f(0x118);console['log'](_0xd2682f(0xe6)+_0x5b6b06);}const _0x7e9a43=new Set(_0x235c65[_0xd2682f(0x101)](_0x44f5dc=>_0x44f5dc[_0xd2682f(0x150)]));for(const _0x25b987 of _0x4d3a2c){if(_0x7e9a43[_0xd2682f(0x11c)](_0x25b987['name']))continue;const _0x48842d=_0x25b987[_0xd2682f(0x12a)]?_0x31655b[_0xd2682f(0x116)]:'',_0x45666d=_0x25b987[_0xd2682f(0x112)]?'encrypted':_0x25b987[_0xd2682f(0x13e)]?'plaintext':'none';console['log']('\x20\x20'+_0x31655b['rwpEk'](bold,_0x25b987[_0xd2682f(0x150)])+'\x20[local]'+_0x48842d),console[_0xd2682f(0x139)](_0xd2682f(0x125)+_0x45666d),_0x25b987[_0xd2682f(0xeb)]!==_0x31655b['fgfZI']&&console['log'](_0xd2682f(0x142)+_0x31655b[_0xd2682f(0x106)](link,_0x25b987['settingsPath'],basename(_0x25b987[_0xd2682f(0xeb)])));}if(!_0x1ede43){console['log'](_0xd2682f(0x10f));const _0x36a968=[..._0x235c65['map'](_0x5c063b=>_0x5c063b[_0xd2682f(0x150)]),..._0x4d3a2c[_0xd2682f(0x12f)](_0xb7e5b6=>!_0x7e9a43[_0xd2682f(0x11c)](_0xb7e5b6['name']))['map'](_0x243a7e=>_0x243a7e[_0xd2682f(0x150)])];console['log'](_0xd2682f(0xfd)+_0x36a968['join'](',\x20')+')');}}}console[_0xd2682f(0x139)]('');}
|
|
1
|
+
const _0x40c3b4=_0x15b1;(function(_0x324b18,_0x1f130c){const _0x39348a=_0x15b1,_0x9aa093=_0x324b18();while(!![]){try{const _0x28291d=parseInt(_0x39348a(0x146))/0x1+-parseInt(_0x39348a(0x10f))/0x2*(parseInt(_0x39348a(0x10c))/0x3)+parseInt(_0x39348a(0x145))/0x4+parseInt(_0x39348a(0x141))/0x5*(parseInt(_0x39348a(0x113))/0x6)+parseInt(_0x39348a(0x10b))/0x7+parseInt(_0x39348a(0x14a))/0x8+-parseInt(_0x39348a(0x13e))/0x9;if(_0x28291d===_0x1f130c)break;else _0x9aa093['push'](_0x9aa093['shift']());}catch(_0x274938){_0x9aa093['push'](_0x9aa093['shift']());}}}(_0x1341,0xebbe1));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';function _0x1341(){const _0x138e15=['tVGPU','status','IWceu','OdvKP','YATMY','\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>','stderr','success','stdout','match','(not\x20found)','KEUcC','isActive','4656610FHvBvO','3591333jfZkik','\x1b]8;;file://','pPkPq','2VSZvzk','Zbhui','\x20plugin(s)\x20configured','auth.json.enc','5220690MNdJuu','zNgOe','version','Version:\x20','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','wTyiC','\x20profiles\x20configured\x20(','BmtoL','some','PpmKr','map','xZDoY','\x20\x20\x20\x20Settings:\x20','\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','sIdhR','xShPk','error','JNcEk','toString','parse','path','includes','FZWtw','\x1b[0m','VkvfW','Organization:\x20','zkkag','\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)','bxHoJ','user','no\x20session','\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a','enabled','\x20\x20Run:\x20ranger\x20setup\x20[token]','plugin','@ranger-testing/opencode-plugin','debug','cwd','trim','push','vNJdl','has','20581533cQHPZP','log','kmzdn','10jFvfgS','\x1b]8;;\x07','tsXbU','emmey','5562992Bgcbat','136656xYAddH','opencode-plugin','API\x20Token:\x20✗\x20Not\x20found','utf-8','4133480WPPiVR','details','iTAvh','name','CzTwJ','length','oFtwn','config','bZRzx','\x0a---\x20Profiles\x20---','ranger@trailhead','\x20\x20\x20\x20Auth:\x20','settingsPath','\x20(up\x20to\x20date)','plaintext','lXifb','\x20(active)','viWKT','project','\x20local','TTBQK','No\x20skills\x20installed','nCTyo','\x0a---\x20Skills\x20---','all','WuWoy','join','Root:\x20','ypeNJ','\x20\x20\x20\x20Session:\x20','not_configured','UAkyx'];_0x1341=function(){return _0x138e15;};return _0x1341();}import{getRangerDir}from'./utils/rangerRoot.js';function _0x15b1(_0x4d22f6,_0xe29617){_0x4d22f6=_0x4d22f6-0xfa;const _0x13415d=_0x1341();let _0x15b102=_0x13415d[_0x4d22f6];return _0x15b102;}import{getEnvDir}from'./utils/settings.js';import{listCloudProfiles}from'./utils/cloudProfile.js';import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x2cf821=>'\x1b[1m'+_0x2cf821+_0x40c3b4(0x12b),link=(_0x43890e,_0x30c7fc)=>_0x40c3b4(0x10d)+_0x43890e+'\x07'+(_0x30c7fc||_0x43890e)+_0x40c3b4(0x142);async function getOpencodePluginStatus(){const _0xd94a5b=_0x40c3b4,_0x930fe0={'QbgPs':'@ranger-testing/opencode-plugin','UJywk':_0xd94a5b(0x147),'qkpRl':function(_0x1ed8cb,_0x16906c){return _0x1ed8cb!==_0x16906c;},'xZDoY':'not_installed','kmzdn':function(_0x437365,_0x5590af){return _0x437365(_0x5590af);},'wTyiC':function(_0x4336a4,_0x1f8e14,_0x419106,_0x3d4311){return _0x4336a4(_0x1f8e14,_0x419106,_0x3d4311);},'WuWoy':_0xd94a5b(0x151),'oFtwn':'ignore','yijtI':'data','HEltq':'close'};return new Promise(_0x3582e5=>{const _0x382eb0=_0xd94a5b,_0x4f8e6a={'emmey':function(_0x1c28f8,_0x136d26){return _0x1c28f8(_0x136d26);},'hzdQr':_0x930fe0['xZDoY']},_0x550a90=_0x930fe0[_0x382eb0(0x118)](spawn,'opencode',[_0x382eb0(0x138),_0x930fe0[_0x382eb0(0x163)]],{'stdio':[_0x930fe0[_0x382eb0(0x150)],'pipe','pipe']});let _0x5550aa='';_0x550a90[_0x382eb0(0x106)]?.['on']('data',_0x3a7875=>{const _0x466092=_0x382eb0;_0x5550aa+=_0x3a7875[_0x466092(0x126)]();}),_0x550a90[_0x382eb0(0x104)]?.['on'](_0x930fe0['yijtI'],_0x583d77=>{_0x5550aa+=_0x583d77['toString']();}),_0x550a90['on'](_0x382eb0(0x124),()=>{const _0x53af54=_0x382eb0;_0x4f8e6a[_0x53af54(0x144)](_0x3582e5,{'status':_0x4f8e6a['hzdQr']});}),_0x550a90['on'](_0x930fe0['HEltq'],_0x4651a6=>{const _0xc0a586=_0x382eb0,_0x1243c2={'QdBQI':_0x930fe0['QbgPs'],'SyrZf':_0x930fe0['UJywk']};if(_0x930fe0['qkpRl'](_0x4651a6,0x0)){_0x3582e5({'status':_0x930fe0[_0xc0a586(0x11e)]});return;}const _0x3cacdf=_0x5550aa[_0xc0a586(0x13a)]();let _0x5bea3d=null;if(_0x3cacdf)try{_0x5bea3d=JSON['parse'](_0x3cacdf);}catch{const _0x1e3918=_0x3cacdf['match'](/\{[\s\S]*\}$/);if(_0x1e3918)try{_0x5bea3d=JSON[_0xc0a586(0x127)](_0x1e3918[0x0]);}catch{_0x5bea3d=null;}}const _0x47d392=Array['isArray'](_0x5bea3d?.[_0xc0a586(0x136)])?_0x5bea3d?.['plugin']:[],_0x5b85be=_0x47d392[_0xc0a586(0x11b)](_0x1ee943=>{const _0x4ec215=_0xc0a586;if(typeof _0x1ee943!=='string')return![];return _0x1ee943[_0x4ec215(0x129)](_0x1243c2['QdBQI'])||_0x1ee943[_0x4ec215(0x129)](_0x1243c2['SyrZf']);});if(_0x5b85be){_0x930fe0[_0xc0a586(0x140)](_0x3582e5,{'status':'configured','details':_0x47d392['length']>0x0?_0x47d392[_0xc0a586(0x14f)]+'\x20plugin(s)\x20configured':undefined});return;}if(_0x47d392['length']>0x0){_0x3582e5({'status':'not_configured','details':_0x47d392[_0xc0a586(0x14f)]+_0xc0a586(0x111)});return;}_0x3582e5({'status':_0xc0a586(0xfc)});});});}async function getSkillsFromDir(_0x589160,_0x5a5cb8){const _0x5044b9=_0x40c3b4,_0x48d391={'QluFc':function(_0x16a233,_0x216f35){return _0x16a233(_0x216f35);},'zNgOe':function(_0x2d5a79,_0x2d453b,_0x3dc67d){return _0x2d5a79(_0x2d453b,_0x3dc67d);},'xFtKC':function(_0x864b9b,_0x3773fd,_0x2214d0,_0x1608a1){return _0x864b9b(_0x3773fd,_0x2214d0,_0x1608a1);},'UAkyx':'SKILL.md','zkkag':_0x5044b9(0x149)};if(!_0x48d391['QluFc'](existsSync,_0x589160))return[];const _0x136898=[];try{const _0x1411a5=await _0x48d391[_0x5044b9(0x114)](readdir,_0x589160,{'withFileTypes':!![]});for(const _0x4f5f96 of _0x1411a5){if(_0x4f5f96['isDirectory']()){const _0x5c98ba=_0x48d391['xFtKC'](join,_0x589160,_0x4f5f96[_0x5044b9(0x14d)],_0x48d391[_0x5044b9(0xfd)]);if(existsSync(_0x5c98ba)){let _0x2484d4=_0x4f5f96['name'];try{const _0x116436=await readFile(_0x5c98ba,_0x48d391[_0x5044b9(0x12e)]),_0x48f8f5=_0x116436[_0x5044b9(0x107)](/name:\s*(.+)/);_0x48f8f5&&(_0x2484d4=_0x48f8f5[0x1]['trim']());}catch{}_0x136898['push']({'name':_0x4f5f96[_0x5044b9(0x14d)],'displayName':_0x2484d4,'path':_0x5c98ba,'level':_0x5a5cb8});}}}}catch{return[];}return _0x136898;}async function getInstalledSkills(){const _0x419305=_0x40c3b4,_0x27705f={'xShPk':function(_0x28c8a4,_0x2a6e4a,_0x3c27a8){return _0x28c8a4(_0x2a6e4a,_0x3c27a8);},'rmkaT':_0x419305(0x15c),'FZWtw':function(_0x1c4c14,_0x3d1fba,_0x2f086b){return _0x1c4c14(_0x3d1fba,_0x2f086b);},'OdvKP':function(_0x456622){return _0x456622();},'ENoQy':_0x419305(0x131)},[_0x2b4356,_0x4b4857]=await Promise[_0x419305(0x162)]([_0x27705f[_0x419305(0x123)](getSkillsFromDir,getProjectSkillsDir(),_0x27705f['rmkaT']),_0x27705f[_0x419305(0x12a)](getSkillsFromDir,_0x27705f[_0x419305(0x101)](getUserSkillsDir),_0x27705f['ENoQy'])]);return{'project':_0x2b4356,'user':_0x4b4857};}async function getEnvironments(){const _0x4b6f32=_0x40c3b4,_0x301c79={'CzTwJ':function(_0xfab195,_0x1afbaa){return _0xfab195(_0x1afbaa);},'vNJdl':function(_0x2a3d5f,_0x1a36d8,_0x4ef521){return _0x2a3d5f(_0x1a36d8,_0x4ef521);},'bvroC':function(_0x3ee6df,_0x507cbe){return _0x3ee6df(_0x507cbe);},'KhECR':_0x4b6f32(0x108),'OvPmd':function(_0x4b8a5a,_0x51da50){return _0x4b8a5a===_0x51da50;}},{envNames:_0x44d83a,activeEnv:_0x5908c2}=await getEnvNames(),_0x16f5eb=getRangerDir();if(!existsSync(_0x16f5eb))return{'envs':[],'activeEnv':null};const _0x28d826=_0x44d83a['map'](_0x74f064=>{const _0x3c46f5=_0x4b6f32,_0x54205b=_0x301c79[_0x3c46f5(0x14e)](getEnvDir,_0x74f064),_0x481dd5=_0x301c79[_0x3c46f5(0x13c)](join,_0x54205b,'settings.json'),_0x25776e=_0x301c79['vNJdl'](join,_0x54205b,'auth.json'),_0x907984=join(_0x54205b,_0x3c46f5(0x112));return{'name':_0x74f064,'settingsPath':_0x301c79['bvroC'](existsSync,_0x481dd5)?_0x481dd5:_0x301c79['KhECR'],'hasPlaintextAuth':existsSync(_0x25776e),'hasEncryptedAuth':_0x301c79[_0x3c46f5(0x14e)](existsSync,_0x907984),'isActive':_0x301c79['OvPmd'](_0x74f064,_0x5908c2)};});return{'envs':_0x28d826,'activeEnv':_0x5908c2};}export async function status(){const _0x476cbe=_0x40c3b4,_0x4e0de8={'pPkPq':function(_0x2671ad,_0x474270){return _0x2671ad(_0x474270);},'vAEka':function(_0x516052,_0x2aecdb){return _0x516052(_0x2aecdb);},'uZUZJ':function(_0x14a1ec,_0x125c97,_0x291e1e){return _0x14a1ec(_0x125c97,_0x291e1e);},'ypeNJ':function(_0x3f3375,_0x2f6a5e){return _0x3f3375(_0x2f6a5e);},'bZRzx':function(_0x2b3990){return _0x2b3990();},'viWKT':function(_0x1acd65,_0xa4693e){return _0x1acd65!==_0xa4693e;},'YATMY':'\x0a---\x20OpenCode\x20Plugin\x20---','nCTyo':function(_0x5a08f1){return _0x5a08f1();},'LWEOk':function(_0x464c27,_0x444450){return _0x464c27===_0x444450;},'sIdhR':function(_0x4d2322,_0x27af17){return _0x4d2322===_0x27af17;},'bxHoJ':_0x476cbe(0xfc),'tsXbU':'\x20\x20Not\x20configured','sqzLX':'\x20\x20Run:\x20ranger\x20setup\x20--opencode','HdLaw':'\x0a---\x20Claude\x20Code\x20Plugin\x20---','iTAvh':_0x476cbe(0x154),'JNcEk':'unknown','PpmKr':_0x476cbe(0x134),'RHctw':'\x20\x20Not\x20installed','bzfrg':_0x476cbe(0x161),'tVGPU':function(_0x26cc49,_0x105ab8){return _0x26cc49+_0x105ab8;},'JPTgc':function(_0x3a017b,_0x58fd5b){return _0x3a017b>_0x58fd5b;},'BmtoL':function(_0x21f4b2,_0xa7f675){return _0x21f4b2(_0xa7f675);},'lXifb':function(_0x8b93b2,_0x3a2345,_0x2999e5){return _0x8b93b2(_0x3a2345,_0x2999e5);},'Zbhui':function(_0x94460d){return _0x94460d();},'VkvfW':function(_0x1fb51f,_0x4730a2){return _0x1fb51f===_0x4730a2;},'KEUcC':function(_0x360add,_0x22f665){return _0x360add>_0x22f665;},'TTBQK':_0x476cbe(0x15a),'IWceu':function(_0x2239da,_0x205cf7){return _0x2239da(_0x205cf7);},'FZons':'(not\x20found)','PklnR':function(_0x6766f6,_0x1d4d94,_0x4f36e5){return _0x6766f6(_0x1d4d94,_0x4f36e5);}};console[_0x476cbe(0x13f)]('\x0a📊\x20Ranger\x20Status\x0a');const _0x589a29=process[_0x476cbe(0x139)](),_0x5ea24c=getRangerDir();if(!_0x4e0de8[_0x476cbe(0x10e)](existsSync,_0x5ea24c)){console[_0x476cbe(0x13f)](_0x476cbe(0x165)+link(_0x589a29,_0x4e0de8['vAEka'](bold,basename(_0x589a29)))),console['log']('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console[_0x476cbe(0x13f)](_0x476cbe(0x133));return;}console[_0x476cbe(0x13f)]('Root:\x20'+_0x4e0de8['uZUZJ'](link,_0x589a29,_0x4e0de8['pPkPq'](bold,_0x4e0de8[_0x476cbe(0xfa)](basename,_0x589a29))));const _0x8d6009=getCurrentVersion(),_0x376a15=_0x4e0de8['bZRzx'](getLatestVersion);if(_0x376a15['version']&&_0x4e0de8[_0x476cbe(0x15b)](_0x376a15['version'],_0x8d6009))console['log'](_0x476cbe(0x116)+_0x8d6009+'\x20(latest:\x20'+_0x376a15[_0x476cbe(0x115)]+')'),console[_0x476cbe(0x13f)]('\x20\x20Run:\x20ranger\x20update');else _0x376a15['version']?console['log']('Version:\x20'+_0x8d6009+_0x476cbe(0x157)):console[_0x476cbe(0x13f)](_0x476cbe(0x116)+_0x8d6009);const _0x5500d8=await getToken();if(_0x5500d8){const _0x249dad=await getCurrentUser(_0x5500d8);_0x249dad[_0x476cbe(0x105)]?console[_0x476cbe(0x13f)](_0x476cbe(0x12d)+bold(_0x249dad[_0x476cbe(0x131)]['organizationName'])):(console[_0x476cbe(0x13f)]('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console[_0x476cbe(0x13f)](_0x476cbe(0x135)));}else console[_0x476cbe(0x13f)](_0x476cbe(0x148)),console[_0x476cbe(0x13f)](_0x476cbe(0x135));process['env']['DEBUG']&&(console[_0x476cbe(0x13f)]('API\x20Environment:\x20'+getCurrentEnvironment()),console[_0x476cbe(0x13f)]('API\x20URL:\x20'+getApiBaseUrl()));console[_0x476cbe(0x13f)](_0x4e0de8[_0x476cbe(0x102)]);const _0x5edb8a=await _0x4e0de8[_0x476cbe(0x160)](getOpencodePluginStatus);if(_0x4e0de8['LWEOk'](_0x5edb8a['status'],'configured'))console[_0x476cbe(0x13f)]('\x20\x20'+_0x4e0de8[_0x476cbe(0xfa)](bold,_0x476cbe(0x137))+':\x20configured'),_0x5edb8a['details']&&console[_0x476cbe(0x13f)]('\x20\x20'+_0x5edb8a[_0x476cbe(0x14b)]);else _0x4e0de8[_0x476cbe(0x122)](_0x5edb8a[_0x476cbe(0xff)],_0x4e0de8[_0x476cbe(0x130)])?(console['log'](_0x4e0de8[_0x476cbe(0x143)]),_0x5edb8a['details']&&console['log']('\x20\x20'+_0x5edb8a[_0x476cbe(0x14b)]),console[_0x476cbe(0x13f)](_0x4e0de8['sqzLX'])):console[_0x476cbe(0x13f)](_0x476cbe(0x120));console[_0x476cbe(0x13f)](_0x4e0de8['HdLaw']);const _0x3f7add=await getPluginInfo(_0x4e0de8['iTAvh']);if(_0x3f7add){const _0xd8447a=_0x3f7add['scope']||_0x4e0de8[_0x476cbe(0x125)],_0x5c7bb6=_0x3f7add[_0x476cbe(0x134)]?_0x4e0de8[_0x476cbe(0x11c)]:'disabled';console['log']('\x20\x20'+bold(_0x4e0de8[_0x476cbe(0x14c)])+':\x20installed\x20('+_0xd8447a+',\x20'+_0x5c7bb6+')');}else console[_0x476cbe(0x13f)](_0x4e0de8['RHctw']),console[_0x476cbe(0x13f)](_0x476cbe(0x117));console[_0x476cbe(0x13f)](_0x4e0de8['bzfrg']);const {project:_0x558aff,user:_0x5e0ccf}=await getInstalledSkills(),_0xb314ce=_0x558aff['filter'](_0x24e4d0=>RANGER_MANAGED_SKILLS[_0x476cbe(0x129)](_0x24e4d0['name'])),_0x2c6c1b=_0x5e0ccf['filter'](_0x4bbafd=>RANGER_MANAGED_SKILLS['includes'](_0x4bbafd[_0x476cbe(0x14d)])),_0x41bc73=_0x4e0de8[_0x476cbe(0xfe)](_0xb314ce[_0x476cbe(0x14f)],_0x2c6c1b[_0x476cbe(0x14f)]);if(_0x41bc73===0x0)console[_0x476cbe(0x13f)](_0x476cbe(0x15f)),console[_0x476cbe(0x13f)]('\x20\x20Run:\x20ranger\x20skillup');else{if(_0x4e0de8['JPTgc'](_0xb314ce['length'],0x0)){console[_0x476cbe(0x13f)]('\x20\x20Project-level:');for(const _0xe37969 of _0xb314ce){console[_0x476cbe(0x13f)]('\x20\x20\x20\x20'+_0x4e0de8[_0x476cbe(0x11a)](bold,_0xe37969['displayName'])+':\x20'+link(_0xe37969[_0x476cbe(0x128)],basename(_0xe37969['path'])));}}if(_0x2c6c1b[_0x476cbe(0x14f)]>0x0){console['log']('\x20\x20User-level:');for(const _0x4eedb1 of _0x2c6c1b){console[_0x476cbe(0x13f)]('\x20\x20\x20\x20'+bold(_0x4eedb1['displayName'])+':\x20'+_0x4e0de8[_0x476cbe(0x159)](link,_0x4eedb1[_0x476cbe(0x128)],basename(_0x4eedb1[_0x476cbe(0x128)])));}}}console[_0x476cbe(0x13f)](_0x476cbe(0x153));const {envs:_0x3b84a0,activeEnv:_0x3a2446}=await _0x4e0de8[_0x476cbe(0x110)](getEnvironments);let _0xc238fd=[];if(_0x5500d8)try{_0xc238fd=await _0x4e0de8[_0x476cbe(0x152)](listCloudProfiles);}catch{}const _0x5ade10=_0x4e0de8[_0x476cbe(0xfe)](_0x3b84a0['length'],_0xc238fd['length']);if(_0x4e0de8[_0x476cbe(0x12c)](_0x5ade10,0x0))console[_0x476cbe(0x13f)]('No\x20profiles\x20configured'),console['log'](_0x476cbe(0x103));else{if(_0x4e0de8[_0x476cbe(0x109)](_0x5ade10,0x5)){const _0x480135=[];_0xc238fd['length']>0x0&&_0x480135['push'](_0xc238fd['length']+'\x20cloud'),_0x3b84a0[_0x476cbe(0x14f)]>0x0&&_0x480135[_0x476cbe(0x13b)](_0x3b84a0['length']+_0x476cbe(0x15d)),console[_0x476cbe(0x13f)](_0x5ade10+_0x476cbe(0x119)+_0x480135[_0x476cbe(0x164)](',\x20')+')'),_0x3a2446&&console['log']('\x20\x20Active:\x20'+_0x4e0de8['ypeNJ'](bold,_0x3a2446)),console[_0x476cbe(0x13f)](_0x476cbe(0x12f));}else{for(const _0x10fcdc of _0xc238fd){const _0x4e27e4=_0x10fcdc[_0x476cbe(0x14d)]===_0x3a2446?_0x4e0de8[_0x476cbe(0x15e)]:'';console['log']('\x20\x20'+_0x4e0de8[_0x476cbe(0x100)](bold,_0x10fcdc['name'])+'\x20[cloud]'+_0x4e27e4);const _0x3b3538=_0x10fcdc['sessionUpdatedAt']?'cached\x20(updated\x20'+_0x10fcdc['sessionUpdatedAt']+')':_0x476cbe(0x132);console[_0x476cbe(0x13f)](_0x476cbe(0xfb)+_0x3b3538);}const _0x17691a=new Set(_0xc238fd[_0x476cbe(0x11d)](_0x13fc57=>_0x13fc57[_0x476cbe(0x14d)]));for(const _0x42b113 of _0x3b84a0){if(_0x17691a[_0x476cbe(0x13d)](_0x42b113['name']))continue;const _0x4b027e=_0x42b113[_0x476cbe(0x10a)]?_0x476cbe(0x15a):'',_0x1db7b5=_0x42b113['hasEncryptedAuth']?'encrypted':_0x42b113['hasPlaintextAuth']?_0x476cbe(0x158):'none';console[_0x476cbe(0x13f)]('\x20\x20'+bold(_0x42b113[_0x476cbe(0x14d)])+'\x20[local]'+_0x4b027e),console[_0x476cbe(0x13f)](_0x476cbe(0x155)+_0x1db7b5),_0x4e0de8[_0x476cbe(0x15b)](_0x42b113[_0x476cbe(0x156)],_0x4e0de8['FZons'])&&console[_0x476cbe(0x13f)](_0x476cbe(0x11f)+_0x4e0de8['PklnR'](link,_0x42b113['settingsPath'],basename(_0x42b113[_0x476cbe(0x156)])));}if(!_0x3a2446){console[_0x476cbe(0x13f)]('\x0a\x20\x20No\x20active\x20profile\x20set');const _0x5233f0=[..._0xc238fd[_0x476cbe(0x11d)](_0x2b8016=>_0x2b8016['name']),..._0x3b84a0['filter'](_0x52c558=>!_0x17691a['has'](_0x52c558[_0x476cbe(0x14d)]))['map'](_0x3498cb=>_0x3498cb['name'])];console['log'](_0x476cbe(0x121)+_0x5233f0['join'](',\x20')+')');}}}console[_0x476cbe(0x13f)]('');}
|