@ranger-testing/ranger-cli 3.1.7-alpha.9ed0a8d-59 → 3.1.7-alpha.9f8e190-62
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/actors.js +1 -0
- 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/scenarioOriginCheck.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(_0x11594f,_0x2bc056){const _0x1b9f5c=_0x1e49,_0x313c5a=_0x11594f();while(!![]){try{const _0x3448c7=parseInt(_0x1b9f5c(0xfd))/0x1+-parseInt(_0x1b9f5c(0x102))/0x2+-parseInt(_0x1b9f5c(0x106))/0x3*(parseInt(_0x1b9f5c(0x101))/0x4)+parseInt(_0x1b9f5c(0xf8))/0x5*(parseInt(_0x1b9f5c(0xf9))/0x6)+parseInt(_0x1b9f5c(0xfe))/0x7*(parseInt(_0x1b9f5c(0x104))/0x8)+-parseInt(_0x1b9f5c(0x105))/0x9+parseInt(_0x1b9f5c(0xfb))/0xa;if(_0x3448c7===_0x2bc056)break;else _0x313c5a['push'](_0x313c5a['shift']());}catch(_0x2bf809){_0x313c5a['push'](_0x313c5a['shift']());}}}(_0x17c2,0x9f910));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';function _0x17c2(){const _0x333a87=['Login\x20failed:\x20','13763820sUJivZ','organizationName','1022335jhAAPE','7816851YUoZnA','log','message','2195132hpxbAB','2427678MBzheX','Mrevx','8DcSMqZ','10411803FFBvtA','3JNVFFr','45kPUijP','38442vanySl'];_0x17c2=function(){return _0x333a87;};return _0x17c2();}function _0x1e49(_0x1323fd,_0x4de74a){_0x1323fd=_0x1323fd-0xf8;const _0x17c233=_0x17c2();let _0x1e4914=_0x17c233[_0x1323fd];return _0x1e4914;}import{isInteractive}from'./utils/cloudProfileSession.js';export async function login(){const _0x6bfd28=_0x1e49,_0x12354e={'Mrevx':function(_0x502208,_0x746762){return _0x502208(_0x746762);}},_0x3b76e7=await getMcpAuthOrigin();if(_0x3b76e7){console[_0x6bfd28(0xff)]('Re-authenticating\x20via\x20MCP\x20bootstrap...'),await 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 _0x573bf7=await runDeviceAuthFlow(),_0x35baef=await _0x12354e[_0x6bfd28(0x103)](getCurrentUser,_0x573bf7);_0x35baef['success']?console['log']('\x0a✅\x20Logged\x20in\x20to\x20'+_0x35baef['user'][_0x6bfd28(0xfc)]):console[_0x6bfd28(0xff)]('\x0a✅\x20API\x20key\x20stored\x20successfully');}catch(_0x23ddc2){throw new Error(_0x6bfd28(0xfa)+(_0x23ddc2 instanceof Error?_0x23ddc2[_0x6bfd28(0x100)]:_0x23ddc2));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x291dcb=_0x4ce7;function _0x4ce7(_0x322dbb,_0x92173){_0x322dbb=_0x322dbb-0x11f;const _0x3dbddf=_0x3dbd();let _0x4ce73e=_0x3dbddf[_0x322dbb];return _0x4ce73e;}(function(_0x5865c5,_0x199a29){const _0x1584ec=_0x4ce7,_0xe1b987=_0x5865c5();while(!![]){try{const _0x5c9efc=-parseInt(_0x1584ec(0x142))/0x1*(-parseInt(_0x1584ec(0x177))/0x2)+-parseInt(_0x1584ec(0x187))/0x3*(parseInt(_0x1584ec(0x17a))/0x4)+-parseInt(_0x1584ec(0x154))/0x5+parseInt(_0x1584ec(0x134))/0x6*(parseInt(_0x1584ec(0x193))/0x7)+-parseInt(_0x1584ec(0x189))/0x8+-parseInt(_0x1584ec(0x12e))/0x9+-parseInt(_0x1584ec(0x19b))/0xa*(-parseInt(_0x1584ec(0x163))/0xb);if(_0x5c9efc===_0x199a29)break;else _0xe1b987['push'](_0xe1b987['shift']());}catch(_0x11f593){_0xe1b987['push'](_0xe1b987['shift']());}}}(_0x3dbd,0x87f74));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';function _0x3dbd(){const _0x27c715=['stringify','76yrbkio','127.0.0.1','Authorization','needs-oauth','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','isTTY','expiresAt','slice','TzFtI','/callback','end','tools/call','origin','95904mHOgsw','sWQnx','7455784GHoJqc','auth-origin.txt','FiVLH','accessToken','Exchanging\x20authorization\x20code...','QKgNf','Registering\x20OAuth\x20client...','code_challenge_method','startsWith','1.0.0','358981cudXBS','qdmlp','.ranger','Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','utf-8','2025-03-26','oRwfC','application/json','17103320pUOFqr','get_cli_token\x20failed:\x20','OZqbU','get','clientSecret','json','MUSqE','update','gVZjg','Ranger\x20CLI','ceOGK','LRwUS','closeAllConnections','fnmaQ','KMdsC','OAuthTimeoutError','yZrnK','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','trim','fOvLL','Oraxl','digest','http://localhost:','then','jPObe','stdout','registration_endpoint','bWrtf','2.0','2129148kMVixx','Token\x20exchange\x20failed:\x20','application/json,\x20text/event-stream','sKeKO','DTXcE','set','42AgggMU','write','lolvk','error_description','code','toString','includes','MxMtc','S256','WywIN','client_id','Not\x20found','platform','status','22eFHanI','POST','log','RatqX','xFZnr','error','initialize','MsBxM','\x0aToken\x20written\x20to\x20','text','parse','sha256','writeHead','client_secret','authorization_servers','clientId','ranger-cli','authorization_code','3996510pIXmuv','base64url','ZRoJB','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','name','MQOkS','length','\x20done','RKFLP','zKYfi','searchParams','url','uVkGk','uoBAK','xdg-open','11oXseLG','nzgdl','FMtgI','resource','result','string','eEtMF','text/html','WxZIj','UPaXc','Server\x20returned\x20error:\x20','headers','DnFGu','application/x-www-form-urlencoded','hex','gxFyW','Initializing\x20MCP\x20session...','start','close','XoPUv','96622cfarnX','hjpmP'];_0x3dbd=function(){return _0x27c715;};return _0x3dbd();}import{randomBytes,createHash}from'crypto';import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger','mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),_0x291dcb(0x195),_0x291dcb(0x18a));export async function getMcpAuthOrigin(){const _0x5c5fe5=_0x291dcb,_0x2f3431={'dqYHv':'utf-8'};try{const _0x826ec4=(await readFile(AUTH_ORIGIN_PATH,_0x2f3431['dqYHv']))[_0x5c5fe5(0x123)]();return _0x826ec4||null;}catch{return null;}}export async function mcpBootstrap(){const _0x1b1aed=_0x291dcb,_0x1adf0a={'wukxt':function(_0x4654a4){return _0x4654a4();},'ceOGK':'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','WLeKC':function(_0x3b11c6,_0x15c204){return _0x3b11c6(_0x15c204);}},_0x478344=getMcpAuthUrl();currentOrigin=_0x478344;const _0x5e74a2=process[_0x1b1aed(0x12a)][_0x1b1aed(0x17f)]??![];console[_0x1b1aed(0x144)]('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x478344+'\x0a');const _0x40943d=await tryUnauthenticated(_0x478344);let _0x54da7f=null;if(_0x40943d==='proxied')_0x54da7f='';else{_0x54da7f=await _0x1adf0a['wukxt'](loadCachedToken);if(!_0x54da7f){if(!_0x5e74a2)throw new Error('MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a'+_0x1adf0a[_0x1b1aed(0x1a5)]);_0x54da7f=await _0x1adf0a['WLeKC'](oauthFlow,_0x478344);}}await callGetCliToken(_0x478344,_0x54da7f);}async function tryUnauthenticated(_0x3bd96b){const _0x47bf2b=_0x291dcb,_0x5689cf={'qdmlp':_0x47bf2b(0x19a),'LRwUS':_0x47bf2b(0x148),'zKYfi':'1.0.0','xTCFj':function(_0x28a5ea,_0x17b7a8){return _0x28a5ea===_0x17b7a8;},'rtHqe':_0x47bf2b(0x17d)},_0x30c17a=await fetch(_0x3bd96b,{'method':_0x47bf2b(0x143),'headers':{'Content-Type':_0x5689cf[_0x47bf2b(0x194)],'Accept':_0x47bf2b(0x130)},'body':JSON[_0x47bf2b(0x179)]({'jsonrpc':'2.0','id':0x1,'method':_0x5689cf[_0x47bf2b(0x1a6)],'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x5689cf[_0x47bf2b(0x15d)]}}})});if(_0x30c17a['ok'])return await _0x30c17a['text'](),'proxied';if(_0x5689cf['xTCFj'](_0x30c17a['status'],0x191))return await _0x30c17a['text'](),_0x5689cf['rtHqe'];const _0x40f414=await _0x30c17a['text']();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x30c17a[_0x47bf2b(0x141)]+':\x20'+_0x40f414);}class OAuthTimeoutError extends Error{constructor(_0x443f19){const _0x4db285=_0x291dcb;super(_0x443f19),this[_0x4db285(0x158)]=_0x4db285(0x120);}}async function oauthFlow(_0x408f12){const _0x5c5468=_0x291dcb,_0x276295={'FiVLH':function(_0x38bea7,_0x271c61){return _0x38bea7 instanceof _0x271c61;},'fnmaQ':'\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'};try{return await oauthFlowAttempt(_0x408f12);}catch(_0x26d8d7){if(_0x276295[_0x5c5468(0x18b)](_0x26d8d7,OAuthTimeoutError)&&await loadCachedClient())return console['log'](_0x276295[_0x5c5468(0x1a8)]),await clearCachedClient(),await oauthFlowAttempt(_0x408f12);throw _0x26d8d7;}}async function oauthFlowAttempt(_0x4345a8){const _0x481d3a=_0x291dcb,_0x3fd08b={'nnWFd':'Discovering\x20authorization\x20server...','HPRRE':_0x481d3a(0x196),'PHHxK':function(_0x5c1f9,_0x502a56){return _0x5c1f9(_0x502a56);},'mExWf':_0x481d3a(0x18f),'hjpmP':_0x481d3a(0x143),'axCnv':_0x481d3a(0x19a),'gdroG':'authorization_code','dXNZv':function(_0x43b0fa,_0x233bd1,_0x10ffd5){return _0x43b0fa(_0x233bd1,_0x10ffd5);},'XoPUv':_0x481d3a(0x155),'MQOkS':function(_0x4d7bf5,_0x5891a7){return _0x4d7bf5(_0x5891a7);},'INfOt':_0x481d3a(0x14d),'mowts':_0x481d3a(0x171),'zJgfH':'response_type','lolvk':'redirect_uri','zqjIz':'code_challenge','nzgdl':'state','opfSF':_0x481d3a(0x166),'OZqbU':function(_0x20e49d,_0x1b011d){return _0x20e49d(_0x1b011d);},'aTwhh':function(_0x290750,_0x132e3f){return _0x290750(_0x132e3f);},'CHBrk':_0x481d3a(0x18d),'TMlef':function(_0x2e25b6,_0x524483,_0x41c5f9){return _0x2e25b6(_0x524483,_0x41c5f9);},'jPObe':function(_0xf8ce19,_0x2db54,_0x50bf06,_0x5a8903){return _0xf8ce19(_0x2db54,_0x50bf06,_0x5a8903);}},_0x134dd7=_0x4345a8['replace'](/\/mcp$/,'');process['stdout']['write'](_0x3fd08b['nnWFd']);const _0x126198=await fetch(_0x134dd7+'/.well-known/oauth-protected-resource');if(!_0x126198['ok'])throw new Error(_0x3fd08b['HPRRE']);const _0x27a294=await _0x126198['json'](),_0x574543=_0x27a294[_0x481d3a(0x150)]?.[0x0];if(!_0x574543)throw new Error('No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata');console['log']('\x20'+_0x574543);const _0x25ec43=await _0x3fd08b['PHHxK'](fetchAuthServerMetadata,_0x574543);let _0x1c671c,_0x2527bd;const _0x53bd89=await loadCachedClient();if(_0x53bd89)_0x1c671c=_0x53bd89[_0x481d3a(0x151)],_0x2527bd=_0x53bd89[_0x481d3a(0x19f)];else{if(_0x25ec43[_0x481d3a(0x12b)]){process[_0x481d3a(0x12a)][_0x481d3a(0x135)](_0x3fd08b['mExWf']);const _0x4f23c9=await fetch(_0x25ec43['registration_endpoint'],{'method':_0x3fd08b[_0x481d3a(0x178)],'headers':{'Content-Type':_0x3fd08b['axCnv']},'body':JSON['stringify']({'client_name':_0x481d3a(0x1a4),'redirect_uris':['http://localhost:'+CALLBACK_PORT+_0x481d3a(0x183)],'grant_types':[_0x3fd08b['gdroG'],'refresh_token'],'response_types':[_0x481d3a(0x138)],'token_endpoint_auth_method':'none'})});if(!_0x4f23c9['ok']){const _0x4b6d5e=await _0x4f23c9['text']();throw new Error('Client\x20registration\x20failed:\x20'+_0x4b6d5e);}const _0x54f5d2=await _0x4f23c9['json']();_0x1c671c=_0x54f5d2[_0x481d3a(0x13e)],_0x2527bd=_0x54f5d2[_0x481d3a(0x14f)],await _0x3fd08b['dXNZv'](saveCachedClient,_0x1c671c,_0x2527bd),console[_0x481d3a(0x144)]('\x20done');}else throw new Error(_0x481d3a(0x17e));}const _0x591149=randomBytes(0x20)['toString'](_0x3fd08b[_0x481d3a(0x176)]),_0x56e33a=_0x3fd08b[_0x481d3a(0x159)](createHash,_0x3fd08b['INfOt'])[_0x481d3a(0x1a2)](_0x591149)[_0x481d3a(0x126)]('base64url'),_0x3ce628=randomBytes(0x10)[_0x481d3a(0x139)](_0x3fd08b['mowts']),_0x3a77f4=new URL(_0x25ec43['authorization_endpoint']);_0x3a77f4['searchParams'][_0x481d3a(0x133)](_0x3fd08b['zJgfH'],'code'),_0x3a77f4['searchParams']['set'](_0x481d3a(0x13e),_0x1c671c),_0x3a77f4[_0x481d3a(0x15e)]['set'](_0x3fd08b[_0x481d3a(0x136)],_0x481d3a(0x127)+CALLBACK_PORT+_0x481d3a(0x183)),_0x3a77f4[_0x481d3a(0x15e)][_0x481d3a(0x133)](_0x3fd08b['zqjIz'],_0x56e33a),_0x3a77f4[_0x481d3a(0x15e)]['set'](_0x481d3a(0x190),_0x481d3a(0x13c)),_0x3a77f4['searchParams']['set'](_0x3fd08b[_0x481d3a(0x164)],_0x3ce628);_0x27a294[_0x481d3a(0x166)]&&_0x3a77f4[_0x481d3a(0x15e)]['set'](_0x3fd08b['opfSF'],_0x27a294[_0x481d3a(0x166)]);console['log']('\x0aOpening\x20browser\x20for\x20authentication...'),console['log'](_0x481d3a(0x122)+_0x3a77f4['toString']()+'\x0a'),await _0x3fd08b[_0x481d3a(0x19d)](openBrowser,_0x3a77f4['toString']());const _0x263d35=await _0x3fd08b['aTwhh'](waitForCallback,_0x3ce628);process[_0x481d3a(0x12a)][_0x481d3a(0x135)](_0x3fd08b['CHBrk']);const _0x28c44e=new URLSearchParams({'grant_type':_0x481d3a(0x153),'code':_0x263d35,'redirect_uri':'http://localhost:'+CALLBACK_PORT+'/callback','client_id':_0x1c671c,'code_verifier':_0x591149});_0x2527bd&&_0x28c44e['set']('client_secret',_0x2527bd);_0x27a294['resource']&&_0x28c44e[_0x481d3a(0x133)](_0x481d3a(0x166),_0x27a294[_0x481d3a(0x166)]);const _0x23a0bc=await _0x3fd08b['TMlef'](fetch,_0x25ec43['token_endpoint'],{'method':_0x481d3a(0x143),'headers':{'Content-Type':_0x481d3a(0x170)},'body':_0x28c44e});if(!_0x23a0bc['ok']){const _0x48880b=await _0x23a0bc['text']();throw new Error(_0x481d3a(0x12f)+_0x48880b);}const _0x4aebaa=await _0x23a0bc['json']();return console[_0x481d3a(0x144)]('\x20done'),await _0x3fd08b[_0x481d3a(0x129)](saveCachedToken,_0x4aebaa['access_token'],_0x4aebaa['refresh_token'],_0x4aebaa['expires_in']),_0x4aebaa['access_token'];}async function callGetCliToken(_0x2c0c64,_0x40842d){const _0xbd9ba2=_0x291dcb,_0x3229c7={'MUSqE':function(_0x44c5cc,_0xe2c8b7,_0x4fe5cb){return _0x44c5cc(_0xe2c8b7,_0x4fe5cb);},'sMDJz':'application/json','KMdsC':'application/json,\x20text/event-stream','qffTv':_0xbd9ba2(0x17c),'gxFyW':_0xbd9ba2(0x173),'FMtgI':_0xbd9ba2(0x12d),'xeYBw':_0xbd9ba2(0x198),'WxZIj':_0xbd9ba2(0x152),'EOnan':_0xbd9ba2(0x192),'sKeKO':_0xbd9ba2(0x15b),'RatqX':_0xbd9ba2(0x143),'FIifs':'Requesting\x20CLI\x20token...','VkDET':_0xbd9ba2(0x185),'DnFGu':'get_cli_token','MxMtc':'\x0aUnexpected\x20response\x20structure:','ABnpe':function(_0x5a7453){return _0x5a7453();},'nyEdQ':function(_0x48c30e,_0x1da854,_0x536c93,_0x1f6beb){return _0x48c30e(_0x1da854,_0x536c93,_0x1f6beb);}},_0x3826e0={'Content-Type':_0x3229c7['sMDJz'],'Accept':_0x3229c7[_0xbd9ba2(0x11f)]};_0x40842d&&(_0x3826e0[_0x3229c7['qffTv']]='Bearer\x20'+_0x40842d);const _0x362b57=async _0x4e4076=>{const _0xfe9960=_0xbd9ba2,_0x1d4758=await _0x3229c7[_0xfe9960(0x1a1)](fetch,_0x2c0c64,{'method':_0xfe9960(0x143),'headers':_0x3826e0,'body':JSON['stringify'](_0x4e4076)});if(!_0x1d4758['ok']){const _0x270414=await _0x1d4758['text']();throw new Error('HTTP\x20'+_0x1d4758['status']+':\x20'+_0x270414);}return parseResponse(_0x1d4758);};process['stdout']['write'](_0x3229c7[_0xbd9ba2(0x172)]);const _0x3138cd=await _0x362b57({'jsonrpc':_0x3229c7[_0xbd9ba2(0x165)],'id':0x1,'method':'initialize','params':{'protocolVersion':_0x3229c7['xeYBw'],'capabilities':{},'clientInfo':{'name':_0x3229c7[_0xbd9ba2(0x16b)],'version':_0x3229c7['EOnan']}}});if(_0x3138cd[_0xbd9ba2(0x147)])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x3138cd['error']['message']??JSON[_0xbd9ba2(0x179)](_0x3138cd['error'])));console[_0xbd9ba2(0x144)](_0x3229c7[_0xbd9ba2(0x131)]),await fetch(_0x2c0c64,{'method':_0x3229c7[_0xbd9ba2(0x145)],'headers':_0x3826e0,'body':JSON['stringify']({'jsonrpc':_0x3229c7[_0xbd9ba2(0x165)],'method':'notifications/initialized'})})[_0xbd9ba2(0x128)](_0x4e95ce=>_0x4e95ce['text']()),process[_0xbd9ba2(0x12a)]['write'](_0x3229c7['FIifs']);const _0x5917a7=await _0x362b57({'jsonrpc':'2.0','id':0x2,'method':_0x3229c7['VkDET'],'params':{'name':_0x3229c7[_0xbd9ba2(0x16f)],'arguments':{}}});if(_0x5917a7[_0xbd9ba2(0x147)])throw new Error(_0xbd9ba2(0x19c)+(_0x5917a7[_0xbd9ba2(0x147)]['message']??JSON[_0xbd9ba2(0x179)](_0x5917a7[_0xbd9ba2(0x147)])));console[_0xbd9ba2(0x144)](_0x3229c7[_0xbd9ba2(0x131)]);const _0x3a3eb6=extractToken(_0x5917a7[_0xbd9ba2(0x167)]);if(!_0x3a3eb6){console[_0xbd9ba2(0x147)](_0x3229c7[_0xbd9ba2(0x13b)]),console[_0xbd9ba2(0x147)](JSON['stringify'](_0x5917a7[_0xbd9ba2(0x167)],null,0x2));throw new Error(_0xbd9ba2(0x157));}const _0x2417ac=_0x3229c7['MUSqE'](join,_0x3229c7['ABnpe'](homedir),'.ranger'),_0x43cd3d=_0x3229c7['MUSqE'](join,_0x2417ac,'refresh.txt');await mkdir(_0x2417ac,{'recursive':!![]}),await writeFile(_0x43cd3d,_0x3a3eb6,{'mode':0x180}),await _0x3229c7['nyEdQ'](writeFile,join(_0x2417ac,_0xbd9ba2(0x18a)),_0x2c0c64,{'mode':0x180}),console[_0xbd9ba2(0x144)](_0xbd9ba2(0x14a)+_0x43cd3d),console['log']('Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a');}async function fetchAuthServerMetadata(_0x32387d){const _0x35dcfd=_0x32387d+'/.well-known/oauth-authorization-server',_0xd1cf3b=await fetch(_0x35dcfd);if(!_0xd1cf3b['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x35dcfd+':\x20'+_0xd1cf3b['status']);return _0xd1cf3b['json']();}function waitForCallback(_0x4294f7){const _0x4b614f=_0x291dcb,_0x5efce5={'QKgNf':function(_0x51c0db,_0xc913a8){return _0x51c0db(_0xc913a8);},'fOvLL':function(_0x4f3900,_0x21b8a0){return _0x4f3900!==_0x21b8a0;},'zzVsB':'/callback','zKVPW':_0x4b614f(0x138),'MWbzE':'error','SoyOh':'<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','cEgAe':function(_0x3c4752,_0x20207c){return _0x3c4752(_0x20207c);},'yZrnK':_0x4b614f(0x17b)};return new Promise((_0x24cbca,_0x5cff50)=>{const _0x20f6b5=_0x4b614f,_0x526c01={'vXtwx':function(_0x55c77e,_0x20d19f){const _0x4a7492=_0x4ce7;return _0x5efce5[_0x4a7492(0x18e)](_0x55c77e,_0x20d19f);},'sWQnx':function(_0x16b046,_0x104c83){const _0x3cff91=_0x4ce7;return _0x5efce5[_0x3cff91(0x124)](_0x16b046,_0x104c83);},'UPaXc':_0x5efce5['zzVsB'],'AVCep':_0x20f6b5(0x13f),'uoBAK':_0x5efce5['zKVPW'],'wxXmQ':'state','MIKrk':_0x5efce5['MWbzE'],'oYiwO':function(_0x4a2732,_0xd4b1de){return _0x4a2732(_0xd4b1de);},'xFZnr':function(_0x2bc8b6){return _0x2bc8b6();},'DTXcE':function(_0x3bea28,_0x571407){return _0x5efce5['QKgNf'](_0x3bea28,_0x571407);},'elHBL':_0x20f6b5(0x16a),'xIpIX':_0x5efce5['SoyOh'],'gVZjg':function(_0x2a4e12,_0x5ef8b7){return _0x2a4e12(_0x5ef8b7);}},_0x478c6b=()=>{const _0x78d5d8=_0x20f6b5;_0x31a7dc[_0x78d5d8(0x1a7)](),_0x31a7dc[_0x78d5d8(0x175)]();},_0x24f57d=setTimeout(()=>{_0x478c6b(),_0x526c01['vXtwx'](_0x5cff50,new OAuthTimeoutError('OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes'));},0x1d4c0),_0x31a7dc=_0x5efce5['cEgAe'](createServer,(_0x1ab361,_0x34a07f)=>{const _0x286bad=_0x20f6b5,_0x3f5aa8=new URL(_0x1ab361[_0x286bad(0x15f)]??'/','http://localhost:'+CALLBACK_PORT);if(_0x526c01[_0x286bad(0x188)](_0x3f5aa8['pathname'],_0x526c01[_0x286bad(0x16c)])){_0x34a07f[_0x286bad(0x14e)](0x194),_0x34a07f[_0x286bad(0x184)](_0x526c01['AVCep']);return;}const _0x41c273=_0x3f5aa8['searchParams'][_0x286bad(0x19e)](_0x526c01[_0x286bad(0x161)]),_0x2482e0=_0x3f5aa8[_0x286bad(0x15e)]['get'](_0x526c01['wxXmQ']),_0x3fb5cf=_0x3f5aa8['searchParams']['get'](_0x526c01['MIKrk']);if(_0x3fb5cf){const _0x3938a1=_0x3f5aa8['searchParams']['get'](_0x286bad(0x137))??_0x3fb5cf;_0x34a07f[_0x286bad(0x14e)](0xc8,{'Content-Type':'text/html'}),_0x34a07f[_0x286bad(0x184)]('<html><body><h2>Authentication\x20failed</h2><p>'+_0x3938a1+'</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>'),_0x526c01['oYiwO'](clearTimeout,_0x24f57d),_0x526c01[_0x286bad(0x146)](_0x478c6b),_0x526c01[_0x286bad(0x132)](_0x5cff50,new Error('OAuth\x20error:\x20'+_0x3938a1));return;}if(!_0x41c273||_0x2482e0!==_0x4294f7){_0x34a07f['writeHead'](0x190,{'Content-Type':_0x526c01['elHBL']}),_0x34a07f['end']('<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>');return;}_0x34a07f['writeHead'](0xc8,{'Content-Type':_0x286bad(0x16a)}),_0x34a07f['end'](_0x526c01['xIpIX']),clearTimeout(_0x24f57d),_0x478c6b(),_0x526c01[_0x286bad(0x1a3)](_0x24cbca,_0x41c273);});_0x31a7dc['listen'](CALLBACK_PORT,_0x5efce5[_0x20f6b5(0x121)]);});}async function openBrowser(_0x180c92){const _0x225947=_0x291dcb,_0x33e35e={'TXnuz':function(_0x3cc321,_0x55b00b){return _0x3cc321===_0x55b00b;},'RKFLP':_0x225947(0x174)},_0x38656f=process['platform']==='darwin'?'open':_0x33e35e['TXnuz'](process[_0x225947(0x140)],'win32')?_0x33e35e[_0x225947(0x15c)]:_0x225947(0x162);exec(_0x38656f+'\x20\x22'+_0x180c92+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x3dfd8b=_0x291dcb,_0x31b315={'bAtgo':function(_0x2120fd,_0x491921,_0x50bd24){return _0x2120fd(_0x491921,_0x50bd24);},'lrJQK':_0x3dfd8b(0x197),'udcrf':function(_0x2b0c82,_0x20ab48){return _0x2b0c82>_0x20ab48;}};try{const _0x994db5=JSON['parse'](await _0x31b315['bAtgo'](readFile,TOKEN_CACHE_PATH,_0x31b315['lrJQK']));if(_0x994db5['origin']&&_0x994db5['origin']!==currentOrigin)return null;if(_0x994db5[_0x3dfd8b(0x180)]&&_0x31b315['udcrf'](Date['now'](),_0x994db5[_0x3dfd8b(0x180)]))return null;return _0x994db5['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0x3fc59f,_0x58a551,_0x194446){const _0x31440d=_0x291dcb,_0x3a2181={'JzVdO':function(_0x28b263){return _0x28b263();},'nhaLs':function(_0x2548e2,_0xe21a54){return _0x2548e2+_0xe21a54;},'pnWGB':function(_0x445fa8,_0x3b51ab){return _0x445fa8*_0x3b51ab;},'TzFtI':function(_0x158c5c,_0x26b7b7,_0x3f60f2){return _0x158c5c(_0x26b7b7,_0x3f60f2);},'ZlxxM':function(_0x94a3b9){return _0x94a3b9();},'ppwQd':'.ranger'},_0x7c533a=await _0x3a2181['JzVdO'](loadCachedData),_0x1dd403={..._0x7c533a,'origin':currentOrigin,'accessToken':_0x3fc59f,'refreshToken':_0x58a551??_0x7c533a?.['refreshToken'],'expiresAt':_0x194446?_0x3a2181['nhaLs'](Date['now'](),_0x3a2181['pnWGB'](_0x194446,0x3e8)):undefined};await mkdir(_0x3a2181[_0x31440d(0x182)](join,_0x3a2181['ZlxxM'](homedir),_0x3a2181['ppwQd']),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x1dd403),{'mode':0x180});}async function loadCachedClient(){const _0x2ba1e2=_0x291dcb,_0x556ea1=await loadCachedData();if(_0x556ea1?.['origin']&&_0x556ea1[_0x2ba1e2(0x186)]!==currentOrigin)return null;return _0x556ea1?.[_0x2ba1e2(0x151)]?{'clientId':_0x556ea1[_0x2ba1e2(0x151)],'clientSecret':_0x556ea1['clientSecret']}:null;}async function clearCachedClient(){const _0x572600={'RIzVe':function(_0x3c8eb2,_0x4d1a77,_0x276a31,_0x22f44e){return _0x3c8eb2(_0x4d1a77,_0x276a31,_0x22f44e);}},_0x42de8f=await loadCachedData();if(!_0x42de8f)return;const {clientId:_0x393c46,clientSecret:_0x29dbd8,..._0x3204b5}=_0x42de8f;await _0x572600['RIzVe'](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x3204b5),{'mode':0x180});}async function saveCachedClient(_0x491340,_0x14f9b6){const _0x2a409f=_0x291dcb,_0x1ab923={'oRwfC':function(_0x41bd80){return _0x41bd80();},'MsBxM':'.ranger','eEtMF':function(_0x4e38fb,_0x8a7d47,_0x4cca5c,_0x451433){return _0x4e38fb(_0x8a7d47,_0x4cca5c,_0x451433);}},_0x367ac2=await loadCachedData(),_0xe78391={..._0x367ac2,'origin':currentOrigin,'accessToken':_0x367ac2?.[_0x2a409f(0x18c)]??'','clientId':_0x491340,'clientSecret':_0x14f9b6};await mkdir(join(_0x1ab923[_0x2a409f(0x199)](homedir),_0x1ab923[_0x2a409f(0x149)]),{'recursive':!![]}),await _0x1ab923[_0x2a409f(0x169)](writeFile,TOKEN_CACHE_PATH,JSON[_0x2a409f(0x179)](_0xe78391),{'mode':0x180});}async function loadCachedData(){const _0x4f5577=_0x291dcb,_0x43de00={'bWrtf':'utf-8'};try{return JSON[_0x4f5577(0x14c)](await readFile(TOKEN_CACHE_PATH,_0x43de00[_0x4f5577(0x12c)]));}catch{return null;}}async function parseResponse(_0xc03f44){const _0x320863=_0x291dcb,_0x3123c2={'qKaVH':'content-type','VnNAF':'text/event-stream','Oraxl':'data:','WywIN':function(_0x5663e0,_0x4b7280){return _0x5663e0!==_0x4b7280;}},_0x4195a2=_0xc03f44[_0x320863(0x16e)][_0x320863(0x19e)](_0x3123c2['qKaVH'])??'';if(_0x4195a2[_0x320863(0x13a)](_0x3123c2['VnNAF'])){const _0x380637=await _0xc03f44['text']();for(const _0x27cad5 of _0x380637['split']('\x0a')){const _0x3069a9=_0x27cad5[_0x320863(0x123)]();if(_0x3069a9[_0x320863(0x191)](_0x3123c2[_0x320863(0x125)])){const _0x47039c=_0x3069a9[_0x320863(0x181)](_0x3123c2['Oraxl'][_0x320863(0x15a)])['trim']();if(!_0x47039c)continue;try{const _0xf73edc=JSON['parse'](_0x47039c);if(_0x3123c2[_0x320863(0x13d)](_0xf73edc['id'],undefined)||_0xf73edc['error'])return _0xf73edc;}catch{}}}throw new Error('No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream');}return _0xc03f44[_0x320863(0x1a0)]();}function extractToken(_0x59fdb4){const _0x10aa9a=_0x291dcb,_0x58ad9c={'uVkGk':_0x10aa9a(0x168),'TtsNg':_0x10aa9a(0x14b),'ZRoJB':function(_0x14c26a,_0x5a8edb){return _0x14c26a===_0x5a8edb;}};if(!_0x59fdb4)return null;const _0x4d0569=_0x59fdb4['structuredContent'];if(_0x4d0569?.['token']&&typeof _0x4d0569['token']===_0x58ad9c[_0x10aa9a(0x160)])return _0x4d0569['token'];if(_0x59fdb4['isError']){const _0x1a6f04=_0x59fdb4['content'];throw new Error(_0x10aa9a(0x16d)+(_0x1a6f04?.[0x0]?.[_0x10aa9a(0x14b)]??'Unknown\x20error'));}const _0x4e216f=_0x59fdb4['content'];if(_0x4e216f)for(const _0xdff3af of _0x4e216f){if(_0xdff3af['type']===_0x58ad9c['TtsNg']&&_0xdff3af['text']){try{const _0x57bdbb=JSON[_0x10aa9a(0x14c)](_0xdff3af['text']);if(_0x58ad9c[_0x10aa9a(0x156)](typeof _0x57bdbb?.['token'],'string'))return _0x57bdbb['token'];}catch{}const _0x395e88=_0xdff3af[_0x10aa9a(0x14b)]['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x395e88)return _0x395e88[0x1];}}return null;}
|
|
1
|
+
const _0x35705b=_0x371d;(function(_0x23f9c6,_0x3959b5){const _0x49ea43=_0x371d,_0x5926e5=_0x23f9c6();while(!![]){try{const _0x19b188=parseInt(_0x49ea43(0xd9))/0x1*(parseInt(_0x49ea43(0x126))/0x2)+-parseInt(_0x49ea43(0xda))/0x3*(parseInt(_0x49ea43(0xfc))/0x4)+-parseInt(_0x49ea43(0x9d))/0x5+parseInt(_0x49ea43(0xf8))/0x6+-parseInt(_0x49ea43(0xb9))/0x7*(parseInt(_0x49ea43(0x12b))/0x8)+parseInt(_0x49ea43(0xb5))/0x9*(-parseInt(_0x49ea43(0xcb))/0xa)+parseInt(_0x49ea43(0x119))/0xb*(parseInt(_0x49ea43(0xf2))/0xc);if(_0x19b188===_0x3959b5)break;else _0x5926e5['push'](_0x5926e5['shift']());}catch(_0x17f3f2){_0x5926e5['push'](_0x5926e5['shift']());}}}(_0x4367,0xbd356));function _0x4367(){const _0x5851ae=['name','451yxJAIb','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','xfYrb','osIVK','stdout','authorization_servers','TyWhh','none','resource','RzgYI','writeHead','end','json','184AEkBYo','expiresAt','oIReP','2025-03-26','error','11178728quoNcl','ZwRjq','/.well-known/oauth-authorization-server','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','HKAsQ','quSFr','base64url','XqJUE','2341460Yiopcn','Salyb','origin','QWYZE','VERKa','code_challenge','initialize','lmtMB','ghIkt','Bearer\x20','Registering\x20OAuth\x20client...','searchParams','HvUhn','client_id','OAuth\x20error:\x20','hex','HJXnD','UKWsj','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','\x20done','text','isError','OpIWx','type','22545VIfcez','UqXwj','ilhjw','clientId','7SgNgxK','get','Client\x20registration\x20failed:\x20','MCP\x20initialize\x20failed:\x20','write','tools/call','get_cli_token','refreshToken','eNOyB','vgRhd','<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','digest','AbXGG','includes','Initializing\x20MCP\x20session...','application/json,\x20text/event-stream','platform','2070ypqhzv','xOhNZ','gDrKM','application/json','S256','parse','MCP\x20server\x20returned\x20HTTP\x20','lAtkX','Server\x20returned\x20error:\x20','ranger-cli','state','lzAdZ','data:','NgvBb','7001JOVUho','131673jMzvJp','NaNhn','EZEsA','open','aHvwF','.ranger','sha256','http://localhost:','pollH','Authorization','refresh.txt','tuPFd','zqjzp','utf-8','POST','isTTY','log','eOqqR','SReaK','registration_endpoint','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','code','\x0aUnexpected\x20response\x20structure:','WNhgU','937428cTfTUo','VRjMj','content-type','update','ISCwG','set','2983512rAsKaZ','/callback','Token\x20exchange\x20failed:\x20','Oodfj','108cgevBK','useSj','listen','HAUEJ','toString','string','2.0','trim','authorization_endpoint','OAuthTimeoutError','proxied','match','XlEHR','Not\x20found','stringify','bFujN','LnrhO','MOTwZ','status','RuUgn','\x0aOpening\x20browser\x20for\x20authentication...','EFRwO','KsUeS','auth-origin.txt','notifications/initialized','token','ZOQfc','accessToken'];_0x4367=function(){return _0x5851ae;};return _0x4367();}import{mkdir,writeFile,readFile}from'fs/promises';function _0x371d(_0x35cd99,_0x2c4181){_0x35cd99=_0x35cd99-0x9d;const _0x4367f7=_0x4367();let _0x371d65=_0x4367f7[_0x35cd99];return _0x371d65;}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(),_0x35705b(0xdf),'mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),_0x35705b(0xdf),_0x35705b(0x113));export async function getMcpAuthOrigin(){const _0x29742f=_0x35705b,_0x4f6f47={'QWYZE':function(_0x585216,_0x485d05,_0x4eebb1){return _0x585216(_0x485d05,_0x4eebb1);},'HMIVA':'utf-8','EZEsA':function(_0x294108,_0x550e14){return _0x294108||_0x550e14;}};try{const _0x5161dc=(await _0x4f6f47[_0x29742f(0xa0)](readFile,AUTH_ORIGIN_PATH,_0x4f6f47['HMIVA']))['trim']();return _0x4f6f47[_0x29742f(0xdc)](_0x5161dc,null);}catch{return null;}}export async function mcpBootstrap(){const _0x2875a2=_0x35705b,_0x4255ef={'HvUhn':function(_0x12e0c8){return _0x12e0c8();},'ipgcc':function(_0x34f779,_0x3eb289){return _0x34f779===_0x3eb289;},'tuPFd':_0x2875a2(0x106),'aHvwF':function(_0x1c9c95){return _0x1c9c95();},'OpIWx':function(_0xbe2607,_0x34c24a){return _0xbe2607+_0x34c24a;},'HvlwT':'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','lAtkX':function(_0x43ea44,_0x1e4fd3){return _0x43ea44(_0x1e4fd3);}},_0x47d09a=_0x4255ef[_0x2875a2(0xa9)](getMcpAuthUrl);currentOrigin=_0x47d09a;const _0x4cf1ce=process['stdout'][_0x2875a2(0xe9)]??![];console['log']('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x47d09a+'\x0a');const _0x253f6c=await tryUnauthenticated(_0x47d09a);let _0x18fe6d=null;if(_0x4255ef['ipgcc'](_0x253f6c,_0x4255ef[_0x2875a2(0xe5)]))_0x18fe6d='';else{_0x18fe6d=await _0x4255ef[_0x2875a2(0xde)](loadCachedToken);if(!_0x18fe6d){if(!_0x4cf1ce)throw new Error(_0x4255ef[_0x2875a2(0xb3)](_0x2875a2(0x12e),_0x4255ef['HvlwT']));_0x18fe6d=await _0x4255ef[_0x2875a2(0xd2)](oauthFlow,_0x47d09a);}}await callGetCliToken(_0x47d09a,_0x18fe6d);}async function tryUnauthenticated(_0xd79a8f){const _0x5a6d84=_0x35705b,_0x5580e4={'LnrhO':function(_0x3e9f5a,_0x26fa50,_0x2e8da0){return _0x3e9f5a(_0x26fa50,_0x2e8da0);},'NgvBb':_0x5a6d84(0xc9),'UqXwj':_0x5a6d84(0x102),'rLGml':_0x5a6d84(0x129),'xfYrb':function(_0x4df62d,_0x1ae447){return _0x4df62d===_0x1ae447;},'Salyb':'needs-oauth'},_0x3898a1=await _0x5580e4[_0x5a6d84(0x10c)](fetch,_0xd79a8f,{'method':_0x5a6d84(0xe8),'headers':{'Content-Type':_0x5a6d84(0xce),'Accept':_0x5580e4[_0x5a6d84(0xd8)]},'body':JSON['stringify']({'jsonrpc':_0x5580e4[_0x5a6d84(0xb6)],'id':0x1,'method':_0x5a6d84(0xa3),'params':{'protocolVersion':_0x5580e4['rLGml'],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':'1.0.0'}}})});if(_0x3898a1['ok'])return await _0x3898a1[_0x5a6d84(0xb1)](),'proxied';if(_0x5580e4[_0x5a6d84(0x11b)](_0x3898a1[_0x5a6d84(0x10e)],0x191))return await _0x3898a1['text'](),_0x5580e4[_0x5a6d84(0x9e)];const _0x5ab2cd=await _0x3898a1['text']();throw new Error(_0x5a6d84(0xd1)+_0x3898a1[_0x5a6d84(0x10e)]+':\x20'+_0x5ab2cd);}class OAuthTimeoutError extends Error{constructor(_0x11c62b){const _0x1b6260=_0x35705b,_0x43ec4c={'eNOyB':_0x1b6260(0x105)};super(_0x11c62b),this[_0x1b6260(0x118)]=_0x43ec4c[_0x1b6260(0xc1)];}}async function oauthFlow(_0x12fa18){const _0x1d6d9b=_0x35705b,_0x32979b={'HKAsQ':function(_0x4f3be8,_0x92ca7e){return _0x4f3be8 instanceof _0x92ca7e;},'WBnqm':function(_0xebc533){return _0xebc533();},'vgRhd':'\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'};try{return await oauthFlowAttempt(_0x12fa18);}catch(_0x538a91){if(_0x32979b[_0x1d6d9b(0x12f)](_0x538a91,OAuthTimeoutError)&&await _0x32979b['WBnqm'](loadCachedClient))return console[_0x1d6d9b(0xea)](_0x32979b[_0x1d6d9b(0xc2)]),await _0x32979b['WBnqm'](clearCachedClient),await oauthFlowAttempt(_0x12fa18);throw _0x538a91;}}async function oauthFlowAttempt(_0x321216){const _0x4c5144=_0x35705b,_0x50a990={'PpWRl':'Discovering\x20authorization\x20server...','UKWsj':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','yVoJo':_0x4c5144(0xee),'xOhNZ':function(_0x7acdb,_0xcc1ad){return _0x7acdb(_0xcc1ad);},'ODbPC':function(_0x55b9e0,_0x82a9b5,_0x4d10a7){return _0x55b9e0(_0x82a9b5,_0x4d10a7);},'AVeJW':'application/json','HJXnD':'refresh_token','QPofW':_0x4c5144(0x120),'XlEHR':_0x4c5144(0xe0),'PibYK':function(_0x1ccc39,_0x120d4c){return _0x1ccc39(_0x120d4c);},'LwdFI':_0x4c5144(0xac),'KsUeS':'redirect_uri','osIVK':_0x4c5144(0xa2),'JtoGK':_0x4c5144(0xcf),'SReaK':'resource','XqJUE':'authorization_code','WRSQu':'client_secret','UVVpj':'POST','AbXGG':function(_0x4faaf2,_0x28dc0a,_0x13c03b,_0x48547d){return _0x4faaf2(_0x28dc0a,_0x13c03b,_0x48547d);}},_0x2fef5d=_0x321216['replace'](/\/mcp$/,'');process['stdout'][_0x4c5144(0xbd)](_0x50a990['PpWRl']);const _0x1d0b2f=await fetch(_0x2fef5d+'/.well-known/oauth-protected-resource');if(!_0x1d0b2f['ok'])throw new Error(_0x50a990[_0x4c5144(0xae)]);const _0x594dfa=await _0x1d0b2f[_0x4c5144(0x125)](),_0x2a89a2=_0x594dfa[_0x4c5144(0x11e)]?.[0x0];if(!_0x2a89a2)throw new Error(_0x50a990['yVoJo']);console[_0x4c5144(0xea)]('\x20'+_0x2a89a2);const _0xea5b85=await _0x50a990[_0x4c5144(0xcc)](fetchAuthServerMetadata,_0x2a89a2);let _0x272a56,_0x36b5f2;const _0x587936=await loadCachedClient();if(_0x587936)_0x272a56=_0x587936[_0x4c5144(0xb8)],_0x36b5f2=_0x587936['clientSecret'];else{if(_0xea5b85['registration_endpoint']){process['stdout'][_0x4c5144(0xbd)](_0x4c5144(0xa7));const _0xf555ba=await _0x50a990['ODbPC'](fetch,_0xea5b85[_0x4c5144(0xed)],{'method':'POST','headers':{'Content-Type':_0x50a990['AVeJW']},'body':JSON['stringify']({'client_name':'Ranger\x20CLI','redirect_uris':['http://localhost:'+CALLBACK_PORT+_0x4c5144(0xf9)],'grant_types':['authorization_code',_0x50a990[_0x4c5144(0xad)]],'response_types':['code'],'token_endpoint_auth_method':_0x50a990['QPofW']})});if(!_0xf555ba['ok']){const _0xabe10e=await _0xf555ba['text']();throw new Error(_0x4c5144(0xbb)+_0xabe10e);}const _0x16e5c9=await _0xf555ba['json']();_0x272a56=_0x16e5c9[_0x4c5144(0xaa)],_0x36b5f2=_0x16e5c9['client_secret'],await saveCachedClient(_0x272a56,_0x36b5f2),console['log'](_0x4c5144(0xb0));}else throw new Error(_0x4c5144(0xaf));}const _0x4a7e37=_0x50a990[_0x4c5144(0xcc)](randomBytes,0x20)[_0x4c5144(0x100)]('base64url'),_0x26ffa7=createHash(_0x50a990[_0x4c5144(0x108)])[_0x4c5144(0xf5)](_0x4a7e37)[_0x4c5144(0xc5)](_0x4c5144(0x131)),_0x3a00d7=_0x50a990['PibYK'](randomBytes,0x10)['toString'](_0x50a990['LwdFI']),_0x5effcf=new URL(_0xea5b85[_0x4c5144(0x104)]);_0x5effcf[_0x4c5144(0xa8)]['set']('response_type',_0x4c5144(0xef)),_0x5effcf['searchParams']['set']('client_id',_0x272a56),_0x5effcf[_0x4c5144(0xa8)][_0x4c5144(0xf7)](_0x50a990[_0x4c5144(0x112)],_0x4c5144(0xe1)+CALLBACK_PORT+_0x4c5144(0xf9)),_0x5effcf[_0x4c5144(0xa8)]['set'](_0x50a990[_0x4c5144(0x11c)],_0x26ffa7),_0x5effcf['searchParams']['set']('code_challenge_method',_0x50a990['JtoGK']),_0x5effcf[_0x4c5144(0xa8)]['set']('state',_0x3a00d7);_0x594dfa['resource']&&_0x5effcf['searchParams']['set'](_0x50a990[_0x4c5144(0xec)],_0x594dfa[_0x4c5144(0x121)]);console['log'](_0x4c5144(0x110)),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x5effcf['toString']()+'\x0a'),await openBrowser(_0x5effcf['toString']());const _0x55bc36=await _0x50a990[_0x4c5144(0xcc)](waitForCallback,_0x3a00d7);process['stdout']['write']('Exchanging\x20authorization\x20code...');const _0x29122a=new URLSearchParams({'grant_type':_0x50a990[_0x4c5144(0x132)],'code':_0x55bc36,'redirect_uri':_0x4c5144(0xe1)+CALLBACK_PORT+_0x4c5144(0xf9),'client_id':_0x272a56,'code_verifier':_0x4a7e37});_0x36b5f2&&_0x29122a['set'](_0x50a990['WRSQu'],_0x36b5f2);_0x594dfa[_0x4c5144(0x121)]&&_0x29122a[_0x4c5144(0xf7)](_0x4c5144(0x121),_0x594dfa['resource']);const _0x18016e=await fetch(_0xea5b85['token_endpoint'],{'method':_0x50a990['UVVpj'],'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x29122a});if(!_0x18016e['ok']){const _0x118de2=await _0x18016e[_0x4c5144(0xb1)]();throw new Error(_0x4c5144(0xfa)+_0x118de2);}const _0x4f5630=await _0x18016e['json']();return console[_0x4c5144(0xea)]('\x20done'),await _0x50a990[_0x4c5144(0xc6)](saveCachedToken,_0x4f5630['access_token'],_0x4f5630['refresh_token'],_0x4f5630['expires_in']),_0x4f5630['access_token'];}async function callGetCliToken(_0x248100,_0x55eb9e){const _0x5cd847=_0x35705b,_0x18e633={'WNhgU':function(_0x17c282,_0x4a37a5){return _0x17c282(_0x4a37a5);},'ilhjw':_0x5cd847(0xc9),'aClCa':_0x5cd847(0xc8),'HAUEJ':'2.0','ktQcP':_0x5cd847(0x129),'cqRdW':'1.0.0','ghIkt':'\x20done','oIReP':_0x5cd847(0xe8),'lmtMB':_0x5cd847(0xbf),'GUCRY':function(_0x3efdc3,_0xb4c272){return _0x3efdc3(_0xb4c272);},'Cdrai':_0x5cd847(0xf0),'eOqqR':function(_0x3d100e,_0x4b751c,_0x3b9ce9){return _0x3d100e(_0x4b751c,_0x3b9ce9);},'useSj':function(_0x475c3a,_0x349efa,_0x1d5a43){return _0x475c3a(_0x349efa,_0x1d5a43);},'quSFr':function(_0x49576e,_0x400cfe,_0x284bad,_0x27ce8d){return _0x49576e(_0x400cfe,_0x284bad,_0x27ce8d);},'ISCwG':_0x5cd847(0xc4)},_0x5771ea={'Content-Type':_0x5cd847(0xce),'Accept':_0x18e633[_0x5cd847(0xb7)]};_0x55eb9e&&(_0x5771ea[_0x5cd847(0xe3)]=_0x5cd847(0xa6)+_0x55eb9e);const _0x43ec22=async _0x1b141d=>{const _0x14385f=_0x5cd847,_0x4f200b=await fetch(_0x248100,{'method':_0x14385f(0xe8),'headers':_0x5771ea,'body':JSON[_0x14385f(0x10a)](_0x1b141d)});if(!_0x4f200b['ok']){const _0x485504=await _0x4f200b[_0x14385f(0xb1)]();throw new Error('HTTP\x20'+_0x4f200b['status']+':\x20'+_0x485504);}return _0x18e633[_0x14385f(0xf1)](parseResponse,_0x4f200b);};process['stdout']['write'](_0x18e633['aClCa']);const _0x43b1e0=await _0x43ec22({'jsonrpc':_0x18e633[_0x5cd847(0xff)],'id':0x1,'method':_0x5cd847(0xa3),'params':{'protocolVersion':_0x18e633['ktQcP'],'capabilities':{},'clientInfo':{'name':_0x5cd847(0xd4),'version':_0x18e633['cqRdW']}}});if(_0x43b1e0[_0x5cd847(0x12a)])throw new Error(_0x5cd847(0xbc)+(_0x43b1e0[_0x5cd847(0x12a)]['message']??JSON[_0x5cd847(0x10a)](_0x43b1e0[_0x5cd847(0x12a)])));console['log'](_0x18e633[_0x5cd847(0xa5)]),await fetch(_0x248100,{'method':_0x18e633[_0x5cd847(0x128)],'headers':_0x5771ea,'body':JSON['stringify']({'jsonrpc':'2.0','method':_0x5cd847(0x114)})})['then'](_0x28da07=>_0x28da07[_0x5cd847(0xb1)]()),process[_0x5cd847(0x11d)][_0x5cd847(0xbd)]('Requesting\x20CLI\x20token...');const _0x48db23=await _0x43ec22({'jsonrpc':_0x5cd847(0x102),'id':0x2,'method':_0x5cd847(0xbe),'params':{'name':_0x18e633[_0x5cd847(0xa4)],'arguments':{}}});if(_0x48db23['error'])throw new Error('get_cli_token\x20failed:\x20'+(_0x48db23[_0x5cd847(0x12a)]['message']??JSON['stringify'](_0x48db23[_0x5cd847(0x12a)])));console['log'](_0x18e633['ghIkt']);const _0x1393e5=_0x18e633['GUCRY'](extractToken,_0x48db23['result']);if(!_0x1393e5){console['error'](_0x18e633['Cdrai']),console[_0x5cd847(0x12a)](JSON['stringify'](_0x48db23['result'],null,0x2));throw new Error('Could\x20not\x20extract\x20token\x20from\x20MCP\x20response');}const _0x1c85dc=join(homedir(),_0x5cd847(0xdf)),_0x11829b=_0x18e633[_0x5cd847(0xeb)](join,_0x1c85dc,_0x5cd847(0xe4));await _0x18e633[_0x5cd847(0xfd)](mkdir,_0x1c85dc,{'recursive':!![]}),await writeFile(_0x11829b,_0x1393e5,{'mode':0x180}),await _0x18e633[_0x5cd847(0x130)](writeFile,join(_0x1c85dc,'auth-origin.txt'),_0x248100,{'mode':0x180}),console['log']('\x0aToken\x20written\x20to\x20'+_0x11829b),console[_0x5cd847(0xea)](_0x18e633[_0x5cd847(0xf6)]);}async function fetchAuthServerMetadata(_0x360bcb){const _0x29fd36=_0x35705b,_0x1778fc=_0x360bcb+_0x29fd36(0x12d),_0x14d504=await fetch(_0x1778fc);if(!_0x14d504['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x1778fc+':\x20'+_0x14d504[_0x29fd36(0x10e)]);return _0x14d504[_0x29fd36(0x125)]();}function waitForCallback(_0x944758){const _0x5e0e0c=_0x35705b,_0x1370d6={'CXPfs':'OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','gDrKM':function(_0x1d12be,_0x49a61f){return _0x1d12be!==_0x49a61f;},'pSpYk':_0x5e0e0c(0x109),'HIThi':'code','xCPvI':function(_0x5e7ba3,_0xb85c9f){return _0x5e7ba3(_0xb85c9f);},'EFRwO':_0x5e0e0c(0xc3),'RzgYI':function(_0x6f6aef,_0x28ed25,_0x40b91c){return _0x6f6aef(_0x28ed25,_0x40b91c);},'lzAdZ':function(_0x3bb0bc,_0xa35f){return _0x3bb0bc(_0xa35f);},'gtsdw':'127.0.0.1'};return new Promise((_0x30e477,_0x4cecbd)=>{const _0x5bcd82=_0x5e0e0c,_0x31cabd={'TdaYT':_0x1370d6['CXPfs'],'IaKNC':function(_0x2ce1b3,_0x105691){const _0x29b359=_0x371d;return _0x1370d6[_0x29b359(0xcd)](_0x2ce1b3,_0x105691);},'MODJQ':_0x1370d6['pSpYk'],'mAUEq':_0x1370d6['HIThi'],'VERKa':'text/html','IdwlY':function(_0x5d277a,_0x2a1019){return _0x1370d6['xCPvI'](_0x5d277a,_0x2a1019);},'OjIuI':'<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','jUNQv':_0x1370d6[_0x5bcd82(0x111)],'bFujN':function(_0x386e00){return _0x386e00();}},_0x3d3dbd=()=>{_0x2d2c94['closeAllConnections'](),_0x2d2c94['close']();},_0x13090b=_0x1370d6[_0x5bcd82(0x122)](setTimeout,()=>{_0x3d3dbd(),_0x4cecbd(new OAuthTimeoutError(_0x31cabd['TdaYT']));},0x1d4c0),_0x2d2c94=_0x1370d6[_0x5bcd82(0xd6)](createServer,(_0x599d55,_0x26102f)=>{const _0x6b062f=_0x5bcd82,_0x51ec68=new URL(_0x599d55['url']??'/','http://localhost:'+CALLBACK_PORT);if(_0x31cabd['IaKNC'](_0x51ec68['pathname'],'/callback')){_0x26102f['writeHead'](0x194),_0x26102f['end'](_0x31cabd['MODJQ']);return;}const _0x36f015=_0x51ec68['searchParams']['get'](_0x31cabd['mAUEq']),_0x2931ef=_0x51ec68['searchParams'][_0x6b062f(0xba)](_0x6b062f(0xd5)),_0x5de9cd=_0x51ec68[_0x6b062f(0xa8)][_0x6b062f(0xba)](_0x6b062f(0x12a));if(_0x5de9cd){const _0x58292a=_0x51ec68[_0x6b062f(0xa8)][_0x6b062f(0xba)]('error_description')??_0x5de9cd;_0x26102f['writeHead'](0xc8,{'Content-Type':_0x31cabd['VERKa']}),_0x26102f[_0x6b062f(0x124)]('<html><body><h2>Authentication\x20failed</h2><p>'+_0x58292a+_0x6b062f(0x11a)),_0x31cabd['IdwlY'](clearTimeout,_0x13090b),_0x3d3dbd(),_0x4cecbd(new Error(_0x6b062f(0xab)+_0x58292a));return;}if(!_0x36f015||_0x2931ef!==_0x944758){_0x26102f[_0x6b062f(0x123)](0x190,{'Content-Type':_0x31cabd['VERKa']}),_0x26102f[_0x6b062f(0x124)](_0x31cabd['OjIuI']);return;}_0x26102f['writeHead'](0xc8,{'Content-Type':_0x31cabd[_0x6b062f(0xa1)]}),_0x26102f[_0x6b062f(0x124)](_0x31cabd['jUNQv']),_0x31cabd['IdwlY'](clearTimeout,_0x13090b),_0x31cabd[_0x6b062f(0x10b)](_0x3d3dbd),_0x30e477(_0x36f015);});_0x2d2c94[_0x5bcd82(0xfe)](CALLBACK_PORT,_0x1370d6['gtsdw']);});}async function openBrowser(_0xd51211){const _0x54a27c=_0x35705b,_0x1e84df={'ZnyVC':'darwin','TyWhh':_0x54a27c(0xdd),'jGpVy':function(_0x3a8d37,_0x3b0ae5){return _0x3a8d37===_0x3b0ae5;},'yXoba':'start','zqjzp':'xdg-open','oFvyu':function(_0x51d3b5,_0x44061e){return _0x51d3b5(_0x44061e);}},_0x575fbf=process['platform']===_0x1e84df['ZnyVC']?_0x1e84df[_0x54a27c(0x11f)]:_0x1e84df['jGpVy'](process[_0x54a27c(0xca)],'win32')?_0x1e84df['yXoba']:_0x1e84df[_0x54a27c(0xe6)];_0x1e84df['oFvyu'](exec,_0x575fbf+'\x20\x22'+_0xd51211+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0xad6ad3=_0x35705b,_0x2579fb={'NaNhn':function(_0x3529ab,_0x5c8916,_0x33d470){return _0x3529ab(_0x5c8916,_0x33d470);},'vDZgK':function(_0x569ac1,_0x27de25){return _0x569ac1!==_0x27de25;}};try{const _0x33eeea=JSON['parse'](await _0x2579fb[_0xad6ad3(0xdb)](readFile,TOKEN_CACHE_PATH,_0xad6ad3(0xe7)));if(_0x33eeea[_0xad6ad3(0x9f)]&&_0x2579fb['vDZgK'](_0x33eeea['origin'],currentOrigin))return null;if(_0x33eeea[_0xad6ad3(0x127)]&&Date['now']()>_0x33eeea['expiresAt'])return null;return _0x33eeea[_0xad6ad3(0x117)]??null;}catch{return null;}}async function saveCachedToken(_0x9fff8e,_0x2ff10a,_0x492ddc){const _0x5a622c=_0x35705b,_0x572b33={'VRjMj':function(_0x27cf2a){return _0x27cf2a();},'ZwRjq':function(_0x35359b,_0x2c7282){return _0x35359b*_0x2c7282;},'qBtNt':function(_0x1e452e,_0x423ba5,_0xcd0b21){return _0x1e452e(_0x423ba5,_0xcd0b21);},'ZOQfc':_0x5a622c(0xdf)},_0x57933d=await _0x572b33[_0x5a622c(0xf3)](loadCachedData),_0x4deb32={..._0x57933d,'origin':currentOrigin,'accessToken':_0x9fff8e,'refreshToken':_0x2ff10a??_0x57933d?.[_0x5a622c(0xc0)],'expiresAt':_0x492ddc?Date['now']()+_0x572b33[_0x5a622c(0x12c)](_0x492ddc,0x3e8):undefined};await _0x572b33['qBtNt'](mkdir,join(homedir(),_0x572b33[_0x5a622c(0x116)]),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x5a622c(0x10a)](_0x4deb32),{'mode':0x180});}async function loadCachedClient(){const _0x22364e=_0x35705b,_0x9c81ed={'hfSXL':function(_0x567ee8,_0x7c51cd){return _0x567ee8!==_0x7c51cd;}},_0x5e44c1=await loadCachedData();if(_0x5e44c1?.['origin']&&_0x9c81ed['hfSXL'](_0x5e44c1[_0x22364e(0x9f)],currentOrigin))return null;return _0x5e44c1?.['clientId']?{'clientId':_0x5e44c1[_0x22364e(0xb8)],'clientSecret':_0x5e44c1['clientSecret']}:null;}async function clearCachedClient(){const _0x4bc611=_0x35705b,_0x4887ea={'ClKUO':function(_0x7d87a8){return _0x7d87a8();}},_0x49dbac=await _0x4887ea['ClKUO'](loadCachedData);if(!_0x49dbac)return;const {clientId:_0x3cc044,clientSecret:_0x50111e,..._0x1e11e7}=_0x49dbac;await writeFile(TOKEN_CACHE_PATH,JSON[_0x4bc611(0x10a)](_0x1e11e7),{'mode':0x180});}async function saveCachedClient(_0x566777,_0x55e301){const _0x14bc0f=_0x35705b,_0x4eb1d0={'DzfuU':function(_0x1eef85){return _0x1eef85();},'MOTwZ':function(_0x3fc418,_0x151e46,_0xa8edc4){return _0x3fc418(_0x151e46,_0xa8edc4);}},_0x8ff2b6=await _0x4eb1d0['DzfuU'](loadCachedData),_0x3cf323={..._0x8ff2b6,'origin':currentOrigin,'accessToken':_0x8ff2b6?.[_0x14bc0f(0x117)]??'','clientId':_0x566777,'clientSecret':_0x55e301};await mkdir(_0x4eb1d0[_0x14bc0f(0x10d)](join,homedir(),'.ranger'),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x14bc0f(0x10a)](_0x3cf323),{'mode':0x180});}async function loadCachedData(){const _0x48ca95=_0x35705b,_0x37f029={'RuUgn':function(_0xd4e660,_0x24a3c3,_0x1ac816){return _0xd4e660(_0x24a3c3,_0x1ac816);},'pollH':_0x48ca95(0xe7)};try{return JSON[_0x48ca95(0xd0)](await _0x37f029[_0x48ca95(0x10f)](readFile,TOKEN_CACHE_PATH,_0x37f029[_0x48ca95(0xe2)]));}catch{return null;}}async function parseResponse(_0x14de18){const _0x155799=_0x35705b,_0x4a1d91={'zmhda':'data:','kNqfw':'No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream'},_0x2e153c=_0x14de18['headers'][_0x155799(0xba)](_0x155799(0xf4))??'';if(_0x2e153c[_0x155799(0xc7)]('text/event-stream')){const _0x139c17=await _0x14de18[_0x155799(0xb1)]();for(const _0x3e43a9 of _0x139c17['split']('\x0a')){const _0x3fdd13=_0x3e43a9[_0x155799(0x103)]();if(_0x3fdd13['startsWith'](_0x4a1d91['zmhda'])){const _0x4caed7=_0x3fdd13['slice'](_0x155799(0xd7)['length'])[_0x155799(0x103)]();if(!_0x4caed7)continue;try{const _0x4355c1=JSON[_0x155799(0xd0)](_0x4caed7);if(_0x4355c1['id']!==undefined||_0x4355c1[_0x155799(0x12a)])return _0x4355c1;}catch{}}}throw new Error(_0x4a1d91['kNqfw']);}return _0x14de18['json']();}function extractToken(_0x456187){const _0x1d25c3=_0x35705b,_0x3c2eae={'CDugg':function(_0x18b20a,_0x453a82){return _0x18b20a===_0x453a82;},'Oodfj':'string'};if(!_0x456187)return null;const _0x36d101=_0x456187['structuredContent'];if(_0x36d101?.['token']&&typeof _0x36d101['token']===_0x1d25c3(0x101))return _0x36d101[_0x1d25c3(0x115)];if(_0x456187[_0x1d25c3(0xb2)]){const _0x353805=_0x456187['content'];throw new Error(_0x1d25c3(0xd3)+(_0x353805?.[0x0]?.['text']??'Unknown\x20error'));}const _0x15adf8=_0x456187['content'];if(_0x15adf8)for(const _0x7a9d53 of _0x15adf8){if(_0x7a9d53[_0x1d25c3(0xb4)]===_0x1d25c3(0xb1)&&_0x7a9d53['text']){try{const _0x33efe8=JSON['parse'](_0x7a9d53['text']);if(_0x3c2eae['CDugg'](typeof _0x33efe8?.['token'],_0x3c2eae[_0x1d25c3(0xfb)]))return _0x33efe8[_0x1d25c3(0x115)];}catch{}const _0x13099b=_0x7a9d53[_0x1d25c3(0xb1)][_0x1d25c3(0x107)](/(rngr_[A-Za-z0-9_-]+)/);if(_0x13099b)return _0x13099b[0x1];}}return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x276634,_0x452e00){var _0x1ca128=_0xdd9c,_0x27f896=_0x276634();while(!![]){try{var _0x49c690=-parseInt(_0x1ca128(0x151))/0x1*(-parseInt(_0x1ca128(0x15c))/0x2)+-parseInt(_0x1ca128(0x156))/0x3+-parseInt(_0x1ca128(0x158))/0x4+-parseInt(_0x1ca128(0x15a))/0x5*(parseInt(_0x1ca128(0x150))/0x6)+parseInt(_0x1ca128(0x159))/0x7+parseInt(_0x1ca128(0x15f))/0x8*(-parseInt(_0x1ca128(0x157))/0x9)+parseInt(_0x1ca128(0x15d))/0xa;if(_0x49c690===_0x452e00)break;else _0x27f896['push'](_0x27f896['shift']());}catch(_0x10c6e7){_0x27f896['push'](_0x27f896['shift']());}}}(_0x1daf,0x297c0));function _0x1daf(){var _0xb122a7=['4840550msbciq','VOikC','88FJVQxu','vAOUx','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','6870nLGbBc','1047ESeqoI','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','VpZhI','UkXEY','IaLNT','19491hfooVm','266391fdrKxZ','394420lqOAlr','2302783ucjELC','955pACpjq','cnKIe','12DhuLNB'];_0x1daf=function(){return _0xb122a7;};return _0x1daf();}function _0xdd9c(_0xd91ac1,_0x3e11f8){_0xd91ac1=_0xd91ac1-0x14e;var _0x1daf79=_0x1daf();var _0xdd9cdf=_0x1daf79[_0xd91ac1];return _0xdd9cdf;}export async function migrateProfile(_0x4ee7c8,_0x38bf0a){var _0x585784=_0xdd9c,_0x4af2d7={'IaLNT':function(_0x4dbcb3,_0x3abb92){return _0x4dbcb3+_0x3abb92;},'cnKIe':function(_0x2bc4ec,_0x17b0b5){return _0x2bc4ec+_0x17b0b5;},'UkXEY':_0x585784(0x14f),'VOikC':_0x585784(0x152),'CNbzg':'\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a','VpZhI':'Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a','vAOUx':'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.'};console['error'](_0x4af2d7[_0x585784(0x155)](_0x4af2d7['IaLNT'](_0x4af2d7[_0x585784(0x15b)](_0x4af2d7[_0x585784(0x155)](_0x4af2d7[_0x585784(0x155)]('ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','\x0a'),'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a')+_0x4af2d7[_0x585784(0x154)]+'\x0a',_0x4af2d7[_0x585784(0x15e)]),_0x4af2d7['CNbzg'])+'\x0a',_0x4af2d7[_0x585784(0x153)])+_0x4af2d7[_0x585784(0x14e)]),process['exit'](0x1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x157a60,_0x29873e){const _0x29561c=_0x2fa0,_0x4632e2=_0x157a60();while(!![]){try{const _0x5c437e=-parseInt(_0x29561c(0x217))/0x1+parseInt(_0x29561c(0x20a))/0x2+-parseInt(_0x29561c(0x1fe))/0x3+-parseInt(_0x29561c(0x1f2))/0x4+parseInt(_0x29561c(0x219))/0x5+parseInt(_0x29561c(0x1ef))/0x6+parseInt(_0x29561c(0x20d))/0x7;if(_0x5c437e===_0x29873e)break;else _0x4632e2['push'](_0x4632e2['shift']());}catch(_0x3aba11){_0x4632e2['push'](_0x4632e2['shift']());}}}(_0x5472,0x6a65e));import{join}from'path';import{existsSync}from'fs';import _0x5892e1 from'inquirer';import{skillup}from'../skillup.js';function _0x2fa0(_0x405ecb,_0x14a83c){_0x405ecb=_0x405ecb-0x1ed;const _0x5472a8=_0x5472();let _0x2fa0d3=_0x5472a8[_0x405ecb];return _0x2fa0d3;}function _0x5472(){const _0x503aa5=['2173716xPELMN','install','log','✓\x20Ranger\x20skills\x20already\x20installed','lwDDo','trailhead','XokOy','sFDnN','.claude','Where\x20should\x20the\x20plugin\x20be\x20installed?','❌\x20Failed\x20to\x20install\x20plugin:','includes','2254599Buqfgz','\x20level)...\x0a','WYLSo','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','EvgTN','cvkgR','push','pluginScope','prompt','eSPDu','add','EVQxM','692656jFGStu','⚠\x20Failed\x20to\x20enable\x20plugin:','tQdPB','3548398TUNIzG','plugin','klySI','bpfyc','wantsSkillup','already\x20enabled','project','Project\x20(shared\x20with\x20team\x20via\x20git)','✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','success','114402MlsdMx','error','699205UnokQr','fmPKU','gBEvX','ranger@trailhead','5112522XsKRmx','\x0aInstalling\x20Claude\x20Code\x20plugin\x20(','NgWJA'];_0x5472=function(){return _0x503aa5;};return _0x5472();}import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x5127f7){const _0x503671=_0x2fa0,_0x2e123f={'swNVU':_0x503671(0x1ee),'EvgTN':function(_0x330266,_0x3108fe){return _0x330266(_0x3108fe);},'wmsJJ':function(_0x2c582a){return _0x2c582a();},'eSPDu':'project','Svkvs':'\x0a📦\x20Claude\x20Code\x20Plugin\x0a','XcHMa':'pluginScope','bmGRh':_0x503671(0x1fb),'ugAdy':'User\x20(available\x20in\x20all\x20your\x20projects)','NgETc':'user','NgWJA':_0x503671(0x20e),'gBEvX':_0x503671(0x208),'swwqB':'ranger-testing/trailhead','zMFOh':'❌\x20Failed\x20to\x20add\x20marketplace:','tpine':function(_0x4dc931,_0x513222,_0x48698a){return _0x4dc931(_0x513222,_0x48698a);},'EKgdM':_0x503671(0x1f3),'cvkgR':'--scope','sFDnN':_0x503671(0x1fc),'gLdsu':_0x503671(0x215),'bpfyc':function(_0x42ac71,_0x5b6ecb,_0x2b6ac7){return _0x42ac71(_0x5b6ecb,_0x2b6ac7);},'CelCU':function(_0x2e41d9,_0x2307a2){return _0x2e41d9===_0x2307a2;},'Merzf':_0x503671(0x212)},_0x166a58=await isPluginInstalled(_0x2e123f['swNVU']);if(_0x166a58)return console[_0x503671(0x1f4)]('✓\x20Claude\x20Code\x20plugin\x20already\x20installed'),![];const _0x56b78d=_0x2e123f[_0x503671(0x202)](existsSync,join(_0x2e123f['wmsJJ'](getProjectRoot),'.claude'));let _0x351c45;if(_0x5127f7)_0x351c45=_0x5127f7;else{if(_0x56b78d)_0x351c45=_0x2e123f[_0x503671(0x207)];else{console['log'](_0x2e123f['Svkvs']);const _0x1c0ce5=await _0x5892e1[_0x503671(0x206)]([{'type':'list','name':_0x2e123f['XcHMa'],'message':_0x2e123f['bmGRh'],'choices':[{'name':_0x2e123f['ugAdy'],'value':_0x2e123f['NgETc']},{'name':_0x503671(0x214),'value':_0x503671(0x213)}],'default':'user'}]);_0x351c45=_0x1c0ce5[_0x503671(0x205)];}}console['log'](_0x503671(0x1f0)+_0x351c45+_0x503671(0x1ff));const _0x436a06=await isMarketplaceAdded(_0x503671(0x1f7));let _0x520549=_0x436a06;if(_0x436a06)console['log']('✓\x20Marketplace\x20already\x20added');else{const _0xfa34a=await _0x2e123f[_0x503671(0x202)](runClaudeCommand,[_0x2e123f[_0x503671(0x1f1)],'marketplace',_0x2e123f[_0x503671(0x1ed)],_0x2e123f['swwqB']]);!_0xfa34a[_0x503671(0x216)]?(console['error'](_0x2e123f['zMFOh'],_0xfa34a[_0x503671(0x218)]),console[_0x503671(0x1f4)]('\x0aYou\x20can\x20install\x20manually\x20with:'),console['log'](_0x503671(0x201)),console[_0x503671(0x1f4)]('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x351c45)):_0x520549=!![];}if(_0x520549){const _0x1a9a98=await _0x2e123f['tpine'](runClaudeCommand,[_0x503671(0x20e),_0x2e123f['EKgdM'],'ranger@trailhead',_0x2e123f[_0x503671(0x203)],_0x351c45],{'cwd':_0x351c45===_0x503671(0x213)?getProjectRoot():undefined});if(!_0x1a9a98[_0x503671(0x216)])console[_0x503671(0x218)](_0x2e123f[_0x503671(0x1f9)],_0x1a9a98[_0x503671(0x218)]),console['log']('\x0aYou\x20can\x20install\x20manually\x20with:'),console[_0x503671(0x1f4)]('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x351c45);else{console[_0x503671(0x1f4)](_0x2e123f['gLdsu']);const _0x30b550=[_0x503671(0x20e),'enable','ranger@trailhead'];_0x351c45==='project'&&_0x30b550[_0x503671(0x204)](_0x2e123f['cvkgR'],_0x2e123f['eSPDu']);const _0x246a7e=await _0x2e123f[_0x503671(0x210)](runClaudeCommand,_0x30b550,{'captureOutput':!![],'cwd':_0x2e123f['CelCU'](_0x351c45,_0x2e123f[_0x503671(0x207)])?getProjectRoot():undefined}),_0x158d1f=_0x246a7e['output']?.[_0x503671(0x1fd)](_0x2e123f['Merzf']);!_0x246a7e['success']&&!_0x158d1f?console['error'](_0x503671(0x20b),_0x246a7e[_0x503671(0x218)]):console[_0x503671(0x1f4)]('✓\x20Claude\x20Code\x20plugin\x20enabled');}}return!![];}export async function ensureClaudeSkills(_0x5912b){const _0x1b2ea9=_0x2fa0,_0x3530fd={'lwDDo':function(_0x520ac8,_0xedceb2){return _0x520ac8(_0xedceb2);},'EVQxM':function(_0x3e35ec,_0x1b71f5,_0x841749,_0x538b2c){return _0x3e35ec(_0x1b71f5,_0x841749,_0x538b2c);},'klySI':'ranger','yqJjd':function(_0x3fd157,_0x39364d,_0x38315e,_0x5d62cc){return _0x3fd157(_0x39364d,_0x38315e,_0x5d62cc);},'XokOy':_0x1b2ea9(0x213),'tQdPB':_0x1b2ea9(0x1f5),'bKEyp':function(_0x1482f8){return _0x1482f8();},'fNAhA':_0x1b2ea9(0x1fa),'WYLSo':function(_0x265d72,_0x64f5db){return _0x265d72(_0x64f5db);},'fmPKU':'confirm'},_0x17afa3=_0x3530fd[_0x1b2ea9(0x1f6)](existsSync,_0x3530fd[_0x1b2ea9(0x209)](join,getSkillsDir('user'),_0x3530fd[_0x1b2ea9(0x20f)],'SKILL.md')),_0xdc4205=existsSync(_0x3530fd['yqJjd'](join,_0x3530fd[_0x1b2ea9(0x1f6)](getSkillsDir,_0x3530fd[_0x1b2ea9(0x1f8)]),_0x3530fd[_0x1b2ea9(0x20f)],'SKILL.md'));if(_0x17afa3||_0xdc4205)return console[_0x1b2ea9(0x1f4)](_0x3530fd[_0x1b2ea9(0x20c)]),![];const _0x13f3a0=_0x3530fd[_0x1b2ea9(0x1f6)](existsSync,join(_0x3530fd['bKEyp'](getProjectRoot),_0x3530fd['fNAhA']));let _0x123292=!![];if(_0x5912b)await _0x3530fd[_0x1b2ea9(0x200)](skillup,{'autoInstall':_0x5912b,'suppressUsage':!![]});else{if(_0x13f3a0)await skillup({'autoInstall':'project','suppressUsage':!![]});else{const _0x8ce849=await _0x5892e1['prompt']([{'type':_0x3530fd[_0x1b2ea9(0x21a)],'name':'wantsSkillup','message':'Would\x20you\x20like\x20to\x20install\x20skills?','default':!![]}]);_0x123292=_0x8ce849[_0x1b2ea9(0x211)],_0x123292&&await _0x3530fd['WYLSo'](skillup,{'suppressUsage':!![]});}}return _0x123292;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x193c89,_0x3cabde){const _0x46567e=_0x1d92,_0x1e64bd=_0x193c89();while(!![]){try{const _0x12c6b6=parseInt(_0x46567e(0x130))/0x1+-parseInt(_0x46567e(0x13b))/0x2*(-parseInt(_0x46567e(0x133))/0x3)+parseInt(_0x46567e(0x12b))/0x4+-parseInt(_0x46567e(0x13a))/0x5+parseInt(_0x46567e(0x132))/0x6+-parseInt(_0x46567e(0x123))/0x7*(parseInt(_0x46567e(0x12f))/0x8)+-parseInt(_0x46567e(0x126))/0x9;if(_0x12c6b6===_0x3cabde)break;else _0x1e64bd['push'](_0x1e64bd['shift']());}catch(_0x1ba7b2){_0x1e64bd['push'](_0x1e64bd['shift']());}}}(_0x3ec9,0x1f6a1));import{join}from'path';import{existsSync}from'fs';function _0x3ec9(){const _0x4b8b71=['998340APvpBN','4bUXaij','parse','Where\x20should\x20the\x20plugin\x20be\x20installed?','AYgcm','$schema','112bJtJSc','adWcr','plugin','1050840DEbaJX','SmrRU','user','includes','opencode.json','632404lgzWxk','pluginScope','project','Project\x20(shared\x20with\x20team\x20via\x20git)','95456afPXND','198949hMFqZA','✓\x20OpenCode\x20plugin\x20configured','531822LKoVTy','285489uDCmnH','isArray','⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','log','list','Failed\x20to\x20read\x20opencode.json','\x0a📦\x20OpenCode\x20Plugin\x0a'];_0x3ec9=function(){return _0x4b8b71;};return _0x3ec9();}import{mkdir,readFile,writeFile}from'fs/promises';import _0xd0e5b4 from'inquirer';function _0x1d92(_0x50ed78,_0x238d7b){_0x50ed78=_0x50ed78-0x122;const _0x3ec947=_0x3ec9();let _0x1d92ba=_0x3ec947[_0x50ed78];return _0x1d92ba;}import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0x4bcd6b){const _0x5b48fc=_0x1d92,_0x512fbb={'SmrRU':'project','kQmiq':_0x5b48fc(0x12a),'oUvpQ':_0x5b48fc(0x13d),'tBeDQ':function(_0x23e78e,_0x22cebc,_0x58f573){return _0x23e78e(_0x22cebc,_0x58f573);},'adWcr':'https://opencode.ai/config.json','AYgcm':_0x5b48fc(0x138),'GMrQl':function(_0x4b2e6,_0x3c30fc,_0x3f2dec){return _0x4b2e6(_0x3c30fc,_0x3f2dec);},'uRpYL':_0x5b48fc(0x131)},_0x32c3d9=existsSync(join(getOpencodeConfigDir(_0x512fbb['SmrRU']),_0x512fbb['kQmiq']));let _0x1d5c85;if(_0x4bcd6b)_0x1d5c85=_0x4bcd6b;else{if(_0x32c3d9)_0x1d5c85=_0x5b48fc(0x12d);else{console['log'](_0x5b48fc(0x139));const _0x4f2a18=await _0xd0e5b4['prompt']([{'type':_0x5b48fc(0x137),'name':'pluginScope','message':_0x512fbb['oUvpQ'],'choices':[{'name':'User\x20(available\x20in\x20all\x20your\x20projects)','value':_0x5b48fc(0x128)},{'name':_0x5b48fc(0x12e),'value':_0x512fbb[_0x5b48fc(0x127)]}],'default':'user'}]);_0x1d5c85=_0x4f2a18[_0x5b48fc(0x12c)];}}const _0x13afe3=_0x512fbb['tBeDQ'](join,getOpencodeConfigDir(_0x1d5c85),_0x512fbb['kQmiq']),_0x554a49='@ranger-testing/opencode-plugin',_0x314f65=_0x512fbb[_0x5b48fc(0x124)];let _0xbee4b8={};if(existsSync(_0x13afe3))try{const _0x673a9e=await readFile(_0x13afe3,'utf-8');_0xbee4b8=JSON[_0x5b48fc(0x13c)](_0x673a9e);}catch(_0x273ede){return console['error'](_0x5b48fc(0x135)),{'configured':![],'scope':_0x1d5c85,'error':_0x512fbb[_0x5b48fc(0x13e)],'details':_0x273ede};}const _0x14e4ba=Array[_0x5b48fc(0x134)](_0xbee4b8[_0x5b48fc(0x125)])?_0xbee4b8['plugin']:[];if(_0x14e4ba[_0x5b48fc(0x129)](_0x554a49))return console[_0x5b48fc(0x136)]('✓\x20OpenCode\x20plugin\x20already\x20configured'),{'configured':![],'scope':_0x1d5c85};return _0xbee4b8[_0x5b48fc(0x122)]=_0xbee4b8['$schema']||_0x314f65,_0xbee4b8[_0x5b48fc(0x125)]=[..._0x14e4ba,_0x554a49],await _0x512fbb['tBeDQ'](mkdir,getOpencodeConfigDir(_0x1d5c85),{'recursive':!![]}),await _0x512fbb['GMrQl'](writeFile,_0x13afe3,JSON['stringify'](_0xbee4b8,null,0x2)+'\x0a'),console[_0x5b48fc(0x136)](_0x512fbb['uRpYL']),{'configured':!![],'scope':_0x1d5c85};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x387006,_0x346114){var _0x2cd9b5=_0x170c,_0x5ac85e=_0x387006();while(!![]){try{var _0x25633b=parseInt(_0x2cd9b5(0x17e))/0x1+parseInt(_0x2cd9b5(0x17a))/0x2+parseInt(_0x2cd9b5(0x17c))/0x3+parseInt(_0x2cd9b5(0x184))/0x4*(-parseInt(_0x2cd9b5(0x182))/0x5)+parseInt(_0x2cd9b5(0x17d))/0x6*(-parseInt(_0x2cd9b5(0x185))/0x7)+parseInt(_0x2cd9b5(0x18a))/0x8+-parseInt(_0x2cd9b5(0x17f))/0x9;if(_0x25633b===_0x346114)break;else _0x5ac85e['push'](_0x5ac85e['shift']());}catch(_0x4393c8){_0x5ac85e['push'](_0x5ac85e['shift']());}}}(_0x25fc,0xa08d5));function _0x25fc(){var _0x57f169=['1099602SQknEb','22378410VCkqTu','ZzapF','BrRfY','775MjmFrl','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','13976BXrDYU','49TlQCAA','rqSeD','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','error','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','10115920YOvJte','592764xDLfWW','AZNUT','3550851TSBJju','135780CyZDLe'];_0x25fc=function(){return _0x57f169;};return _0x25fc();}function _0x170c(_0x940801,_0x1461ad){_0x940801=_0x940801-0x17a;var _0x25fc5c=_0x25fc();var _0x170cbc=_0x25fc5c[_0x940801];return _0x170cbc;}export async function setupCi(_0x701a,_0x31f2ab,_0x4796f7){var _0x388280=_0x170c,_0x3f3bfe={'ZzapF':function(_0x2b8e75,_0x4e8a46){return _0x2b8e75+_0x4e8a46;},'IDcHc':function(_0x471ada,_0x1015e9){return _0x471ada+_0x1015e9;},'rqSeD':function(_0x168343,_0x28898d){return _0x168343+_0x28898d;},'BrRfY':'ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','CgAqS':_0x388280(0x189),'AZNUT':_0x388280(0x187),'vKURg':'\x20\x20https://docs.ranger.net/main/concepts/profiles'};console[_0x388280(0x188)](_0x3f3bfe[_0x388280(0x180)](_0x3f3bfe['ZzapF'](_0x3f3bfe['IDcHc'](_0x3f3bfe[_0x388280(0x186)](_0x3f3bfe[_0x388280(0x181)]+'\x0a',_0x3f3bfe['CgAqS']),_0x388280(0x183))+'\x0a',_0x3f3bfe[_0x388280(0x17b)]),_0x3f3bfe['vKURg'])),process['exit'](0x1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
(function(_0x3ebce2,_0x5c9257){const _0x48ee29=_0x5832,_0x1ca725=_0x3ebce2();while(!![]){try{const _0x1e0d67=-parseInt(_0x48ee29(0x1bc))/0x1+parseInt(_0x48ee29(0x1c6))/0x2+-parseInt(_0x48ee29(0x1b7))/0x3+parseInt(_0x48ee29(0x1d6))/0x4+parseInt(_0x48ee29(0x1c0))/0x5*(-parseInt(_0x48ee29(0x1b0))/0x6)+parseInt(_0x48ee29(0x1d1))/0x7+parseInt(_0x48ee29(0x1b5))/0x8;if(_0x1e0d67===_0x5c9257)break;else _0x1ca725['push'](_0x1ca725['shift']());}catch(_0x2b5d86){_0x1ca725['push'](_0x1ca725['shift']());}}}(_0x383d,0x3c259));import{basename}from'path';import _0x49a11d from'inquirer';import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';function _0x383d(){const _0xd88b64=['Where\x20should\x20skills\x20be\x20installed?','130980sFQwXJ','\x20\x203.\x20Run:\x20ranger\x20skillup','/skills/','user-level','taBUf','suppressUsage','installLevel','gaLLA','sHiru','InQks','\x0a✅\x20Installed\x20','2118354OAPgHo','message','\x20successfully!\x0a','autoInstall','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','164456PYEZHl','/.opencode/skills/','project-level','stdin','opencode','\x20--opencode','184674RuJLay','DHLEf','\x0a📦\x20Installing\x20skills...\x0a','GLvqu','log','3130704jSkeXH','\x20<your-api-token>','1000848IxLAUB','bpbnf','Kkial','isTTY','project','5134OBhuAf','user','orEuQ','FDyCr','35TScQBd','pgbnd','stdout','\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!','IQkHc'];_0x383d=function(){return _0xd88b64;};return _0x383d();}import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';function _0x5832(_0x335222,_0x4253cb){_0x335222=_0x335222-0x1ad;const _0x383d80=_0x383d();let _0x58322b=_0x383d80[_0x335222];return _0x58322b;}export async function skillup(_0x4fcef4={}){const _0x10a816=_0x5832,_0x3427f6={'GLvqu':'\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','nYxGC':'claude','bpbnf':function(_0x351cdb){return _0x351cdb();},'qdxOv':'❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','escah':'To\x20get\x20started:','axqgS':_0x10a816(0x1d5),'InQks':function(_0x43358f,_0x2f31c6){return _0x43358f===_0x2f31c6;},'taBUf':_0x10a816(0x1ae),'IgPwU':_0x10a816(0x1af),'wDGVZ':function(_0x46efe7){return _0x46efe7();},'FDyCr':function(_0x52d1f9,_0x324d1f){return _0x52d1f9(_0x324d1f);},'gaLLA':function(_0xa38edb,_0x1b5aae){return _0xa38edb(_0x1b5aae);},'pgbnd':_0x10a816(0x1c5),'orEuQ':function(_0x3ef1fb){return _0x3ef1fb();},'DHLEf':_0x10a816(0x1b2),'aYoqg':function(_0x4eacce,_0x22706a,_0x245940){return _0x4eacce(_0x22706a,_0x245940);},'wwyrX':'\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','qxZxD':_0x10a816(0x1bd),'otXQR':_0x10a816(0x1c9),'IQkHc':_0x10a816(0x1d8),'txFKd':'To\x20use:','GTNZu':'\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','sHiru':_0x10a816(0x1c3),'Kkial':'\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a'};console[_0x10a816(0x1b4)](_0x3427f6[_0x10a816(0x1b3)]);const _0x37ba91=_0x4fcef4['platform']??_0x3427f6['nYxGC'],_0x16f43d=await _0x3427f6[_0x10a816(0x1b8)](getToken);if(!_0x16f43d){console['log'](_0x3427f6['qdxOv']),console[_0x10a816(0x1b4)](_0x3427f6['escah']),console['log'](_0x3427f6['axqgS']),console[_0x10a816(0x1b4)]('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0x3427f6[_0x10a816(0x1cf)](_0x37ba91,_0x3427f6['taBUf'])?_0x3427f6['IgPwU']:'')+_0x10a816(0x1b6)),console[_0x10a816(0x1b4)](_0x10a816(0x1c7)+(_0x37ba91==='opencode'?_0x3427f6['IgPwU']:'')+'\x0a');return;}console['log']('✓\x20Found\x20API\x20token');const _0x11170c=_0x3427f6['wDGVZ'](getProjectRoot),_0x5b6631=_0x3427f6[_0x10a816(0x1bf)](basename,_0x11170c),_0x30b3f3=_0x3427f6['InQks'](_0x37ba91,_0x3427f6[_0x10a816(0x1ca)])?_0x3427f6[_0x10a816(0x1cd)](getOpencodeConfigDir,_0x10a816(0x1bd))+_0x10a816(0x1c8):getClaudeConfigDir()+_0x10a816(0x1c8),_0x3e2c8d=_0x37ba91===_0x10a816(0x1ae)?_0x11170c+_0x10a816(0x1d7):_0x11170c+'/.claude/skills/',_0x59d419=process[_0x10a816(0x1ad)]['isTTY']&&process[_0x10a816(0x1c2)][_0x10a816(0x1ba)];let _0x511fb2;if(_0x4fcef4[_0x10a816(0x1d4)])_0x511fb2=_0x4fcef4['autoInstall'];else{if(_0x59d419){const _0x4ca1f7=await _0x49a11d['prompt']([{'type':'list','name':'installLevel','message':_0x3427f6[_0x10a816(0x1c1)],'choices':[{'name':'All\x20projects\x20('+_0x30b3f3+')','value':_0x10a816(0x1bd)},{'name':'This\x20project\x20only\x20('+_0x3e2c8d+')','value':'project'}]}]);_0x511fb2=_0x4ca1f7[_0x10a816(0x1cc)];}else _0x511fb2=_0x10a816(0x1bb),console['log']('Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20('+_0x3e2c8d+')');}let _0x51ecb9=0x0;const _0x16b8b6=_0x3427f6[_0x10a816(0x1be)](getCurrentVersion);console[_0x10a816(0x1b4)](_0x3427f6[_0x10a816(0x1b1)]);try{const _0x5ea67e=await _0x3427f6['aYoqg'](installSkill,'ranger',{'cliVersion':_0x16b8b6,'level':_0x511fb2,'platform':_0x37ba91});_0x5ea67e&&_0x51ecb9++;}catch(_0x3b1892){console['warn'](_0x3427f6['wwyrX'],_0x3b1892 instanceof Error?_0x3b1892[_0x10a816(0x1d2)]:_0x3b1892);}if(_0x51ecb9>0x0){const _0x4d702d=_0x511fb2===_0x3427f6['qxZxD']?_0x3427f6['otXQR']:_0x3427f6[_0x10a816(0x1c4)];console['log'](_0x10a816(0x1d0)+_0x51ecb9+'\x20'+_0x4d702d+'\x20skill'+(_0x51ecb9>0x1?'s':'')+_0x10a816(0x1d3)),!_0x4fcef4[_0x10a816(0x1cb)]&&(console[_0x10a816(0x1b4)](_0x3427f6['txFKd']),_0x37ba91===_0x10a816(0x1ae)?console[_0x10a816(0x1b4)](_0x3427f6['GTNZu']):console['log'](_0x3427f6[_0x10a816(0x1ce)]));}else console['log'](_0x3427f6[_0x10a816(0x1b9)]);}
|
package/build/commands/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x410d38=_0xcacf;(function(_0x35bb54,_0x2f6da9){const _0x53d3aa=_0xcacf,_0x1b211c=_0x35bb54();while(!![]){try{const _0x168a7d=-parseInt(_0x53d3aa(0xfc))/0x1*(-parseInt(_0x53d3aa(0xeb))/0x2)+parseInt(_0x53d3aa(0x14b))/0x3+-parseInt(_0x53d3aa(0x12b))/0x4+-parseInt(_0x53d3aa(0x119))/0x5*(parseInt(_0x53d3aa(0x111))/0x6)+-parseInt(_0x53d3aa(0x139))/0x7*(parseInt(_0x53d3aa(0x132))/0x8)+parseInt(_0x53d3aa(0xf7))/0x9*(parseInt(_0x53d3aa(0x113))/0xa)+parseInt(_0x53d3aa(0xfa))/0xb;if(_0x168a7d===_0x2f6da9)break;else _0x1b211c['push'](_0x1b211c['shift']());}catch(_0x3961ea){_0x1b211c['push'](_0x1b211c['shift']());}}}(_0x461b,0x66ad4));import{mkdir,writeFile}from'fs/promises';import{join,dirname}from'path';import{existsSync}from'fs';import{createRequire}from'module';import _0x49691f from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';function _0x461b(){const _0x28189a=['LsDCW','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','execPath','tBmem','QWAhU','platform','WeBgW','wffCB','plugin','\x1b[0m','770662rDtiEI','local','Chromium\x20install\x20timed\x20out\x20after\x20','device_auth','organizationName','AoZbe','Installation\x20failed\x20with\x20exit\x20code\x20','ranger','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','✓\x20Created\x20~/.ranger/\x20directory','message','QJoAL','27xZUxOK','\x0a❌\x20Profile\x20setup\x20failed:','npx','4382136ztfHxG','resolve','1RTmEdR','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.','\x0a⚠\x20Skipping\x20Chromium\x20installation.','✓\x20Created\x20.ranger/.gitignore','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','trackPhaseEnd','aDtFB','✓\x20Already\x20authenticated\x20to\x20','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','--with-deps','FyPxy','executablePath','log','skipped','VMiOb','\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','ready','✓\x20Skipping\x20authentication\x20(--skip-auth)','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','GITHUB_ENV','IJcVl','24yObsiG',');\x20retrying...','2715950gKsxDy','skills','method','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','scope','✓\x20Playwright\x20Chromium\x20browser\x20found','757155RCVZxm','zGDCp','\x20\x20\x20\x20RANGER_CHROMIUM_INSTALL_TIMEOUT_MS=1800000\x20ranger\x20setup\x20deps','HvzrO','error','kill','\x20\x20Chromium\x20install\x20attempt\x20','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','...','1.56.1','inherit','skipChromium','existing_token','force','auth','playwright@','user','profile','2325384udOKaD','reDiq','yFgbY','FkYfS','\x0a\x20\x20Chromium\x20install\x20timed\x20out\x20(limit\x20','install','\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','2224JxAUWk','playwright/package.json','tnene','win32','Validating\x20API\x20token...','KVahn','stdout','5257vdwoXh','EojHI','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','success','allowInsecureLocalhost','\x0aIn\x20Claude\x20Code,\x20run\x20','status','chromium','dQZqn','close','✓\x20Stored\x20credentials\x20locally','pqdKN','MPMxI','You\x20can\x20install\x20it\x20manually\x20by\x20running:','confirm','round','opencode','✓\x20Authenticated\x20to\x20','653760EpiynD','env','yTlIK','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','The\x20required\x20version\x20(','skipAuth','✓\x20Exported\x20credentials\x20for\x20CI','PZqmr','stdin','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','trackPhaseStart','bCJPF','FICKe','ranger\x20profile\x20add\x20<name>','url'];_0x461b=function(){return _0x28189a;};return _0x461b();}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';import{spawn}from'child_process';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION=_0x410d38(0x122);const bold=_0x3d896d=>'\x1b[1m'+_0x3d896d+_0x410d38(0xea);export function getPlaywrightVersion(){const _0xb04e50=_0x410d38,_0xfb25f6={'ySaQy':_0xb04e50(0x133),'AoZbe':function(_0x4d778e,_0x315dca){return _0x4d778e(_0x315dca);}};try{const _0x56842b=require[_0xb04e50(0xfb)](_0xfb25f6['ySaQy']),_0x30dff4=_0xfb25f6[_0xb04e50(0xf0)](require,_0x56842b);return _0x30dff4['version'];}catch{return null;}}function resolveBundledPlaywrightCli(){const _0x315987=_0x410d38,_0x25bb81={'FICKe':function(_0x50590e,_0x5b8d1b){return _0x50590e(_0x5b8d1b);},'FkYfS':'cli.js'};try{const _0x4ab1f2=join(_0x25bb81[_0x315987(0x157)](dirname,require['resolve']('playwright/package.json')),_0x25bb81[_0x315987(0x12e)]);return existsSync(_0x4ab1f2)?_0x4ab1f2:null;}catch{return null;}}const CHROMIUM_INSTALL_TIMEOUT_MS=Number(process[_0x410d38(0x14c)]['RANGER_CHROMIUM_INSTALL_TIMEOUT_MS'])||0x927c0;function _0xcacf(_0x551636,_0x1e823e){_0x551636=_0x551636-0xe0;const _0x461b50=_0x461b();let _0xcacf1b=_0x461b50[_0x551636];return _0xcacf1b;}class ChromiumInstallTimeoutError extends Error{}export async function installChromiumBinary(_0x24127,_0x32720b=![]){const _0x5db707=_0x410d38,_0x592b1c={'WWHKO':'chromium','tnene':function(_0x5ad53c,_0x3899c8){return _0x5ad53c instanceof _0x3899c8;},'VsUrL':function(_0x2f0896,_0x3c77b7){return _0x2f0896/_0x3c77b7;},'iRCqg':function(_0x30e119,_0x40df24){return _0x30e119(_0x40df24);}},_0x3137c4=resolveBundledPlaywrightCli(),_0x1be463=_0x3137c4?process[_0x5db707(0xe3)]:_0x5db707(0xf9),_0x8419c3=[_0x3137c4??_0x5db707(0x128)+_0x24127,_0x5db707(0x130),..._0x32720b?[_0x5db707(0x105)]:[],_0x592b1c['WWHKO']];let _0x4d6442=![];for(let _0x25dc77=0x1;;_0x25dc77++){try{await runChromiumInstall(_0x1be463,_0x8419c3);return;}catch(_0x3ee9bc){_0x592b1c[_0x5db707(0x134)](_0x3ee9bc,ChromiumInstallTimeoutError)&&!_0x4d6442&&(_0x4d6442=!![],console['log'](_0x5db707(0x12f)+Math['round'](_0x592b1c['VsUrL'](CHROMIUM_INSTALL_TIMEOUT_MS,0x3e8))+'s).\x20On\x20a\x20slow\x20or\x20proxied\x20connection,\x20raise\x20the\x20limit\x20and\x20retry,\x20e.g.:\x0a'+_0x5db707(0x11b)));if(_0x25dc77>=0x3)throw _0x3ee9bc;const _0x502efe=_0x3ee9bc instanceof Error?_0x3ee9bc['message']:_0x592b1c['iRCqg'](String,_0x3ee9bc);console[_0x5db707(0x108)](_0x5db707(0x11f)+_0x25dc77+'\x20failed\x20('+_0x502efe+_0x5db707(0x112));}}}function runChromiumInstall(_0x4c3883,_0x413ca6){const _0x5747d2=_0x410d38,_0xc290f3={'ksmCn':function(_0x5aacb0,_0x3ebd5d){return _0x5aacb0(_0x3ebd5d);},'OTCDs':function(_0x49eb43,_0x5541a0){return _0x49eb43===_0x5541a0;},'zGDCp':function(_0x3b328a){return _0x3b328a();},'yTlIK':function(_0x20ef01,_0x25ff93,_0x39b0df,_0x3e96d7){return _0x20ef01(_0x25ff93,_0x39b0df,_0x3e96d7);},'nASSc':'ignore','wffCB':_0x5747d2(0x135),'EojHI':_0x5747d2(0x11d)};return new Promise((_0x4fba01,_0x17c563)=>{const _0x556191=_0x5747d2,_0x3e07df=_0xc290f3[_0x556191(0x14d)](spawn,_0x4c3883,_0x413ca6,{'stdio':[_0xc290f3['nASSc'],'inherit',_0x556191(0x123)],'shell':process[_0x556191(0xe6)]===_0xc290f3[_0x556191(0xe8)]}),_0xff45ea=setTimeout(()=>{const _0x22f839=_0x556191;_0x3e07df[_0x22f839(0x11e)]('SIGKILL'),_0xc290f3['ksmCn'](_0x17c563,new ChromiumInstallTimeoutError(_0x22f839(0xed)+Math[_0x22f839(0x148)](CHROMIUM_INSTALL_TIMEOUT_MS/0x3e8)+'s'));},CHROMIUM_INSTALL_TIMEOUT_MS);_0x3e07df['on'](_0x556191(0x142),_0x43bb27=>{const _0x169f52=_0x556191;_0xc290f3['ksmCn'](clearTimeout,_0xff45ea);if(_0xc290f3['OTCDs'](_0x43bb27,0x0))_0xc290f3[_0x169f52(0x11a)](_0x4fba01);else _0x17c563(new Error(_0x169f52(0xf1)+_0x43bb27));}),_0x3e07df['on'](_0xc290f3[_0x556191(0x13a)],_0x25f94e=>{clearTimeout(_0xff45ea),_0x17c563(_0x25f94e);});});}export async function authenticate(_0x4a0267){const _0x399ed3=_0x410d38,_0x472b5f={'KVahn':function(_0x4abdfe){return _0x4abdfe();},'MPMxI':function(_0x28defb,_0x354f8b){return _0x28defb instanceof _0x354f8b;},'Xkjwk':_0x399ed3(0xee),'ASwzH':_0x399ed3(0x136),'WeBgW':_0x399ed3(0x151),'JxYOi':_0x399ed3(0x143)};if(!_0x4a0267){const _0x2ced03=await _0x472b5f[_0x399ed3(0x137)](getToken);if(_0x2ced03){const _0x51734c=await getCurrentUser(_0x2ced03);if(_0x51734c[_0x399ed3(0x13c)])return console['log'](_0x399ed3(0x103)+_0x51734c[_0x399ed3(0x129)][_0x399ed3(0xef)]),{'token':_0x2ced03,'method':_0x399ed3(0x125)};}try{_0x4a0267=await runDeviceAuthFlow();}catch(_0x2bc3fd){throw new Error('Authentication\x20failed:\x20'+(_0x472b5f[_0x399ed3(0x145)](_0x2bc3fd,Error)?_0x2bc3fd[_0x399ed3(0xf5)]:_0x2bc3fd));}const _0xb03d70=await getCurrentUser(_0x4a0267);if(!_0xb03d70[_0x399ed3(0x13c)])throw new Error(_0x399ed3(0xe2)+_0xb03d70[_0x399ed3(0x11d)]);return console['log'](_0x399ed3(0x14a)+_0xb03d70['user']['organizationName']),{'token':_0x4a0267,'method':_0x472b5f['Xkjwk']};}console[_0x399ed3(0x108)](_0x472b5f['ASwzH']);const _0x5c5d3e=await getCurrentUser(_0x4a0267);if(!_0x5c5d3e[_0x399ed3(0x13c)]){if(_0x5c5d3e[_0x399ed3(0x13f)])throw new Error('Authentication\x20failed:\x20'+_0x5c5d3e['error']+_0x399ed3(0x100));else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x5c5d3e[_0x399ed3(0x11d)]+_0x399ed3(0x154));}return console['log'](_0x399ed3(0x14a)+_0x5c5d3e['user'][_0x399ed3(0xef)]),await storeToken(_0x4a0267),console['log'](process['env'][_0x399ed3(0x10f)]?_0x472b5f[_0x399ed3(0xe7)]:_0x472b5f['JxYOi']),{'token':_0x4a0267,'method':'provided_token'};}export async function ensureRangerDir(_0x5d0a32){const _0x5dbd3c=_0x410d38,_0x1d37f9={'rYuEH':function(_0x234b48){return _0x234b48();},'tBmem':function(_0x28b911,_0x32b080){return _0x28b911(_0x32b080);},'LsDCW':function(_0x1d8b05,_0x2ce28e,_0x214026){return _0x1d8b05(_0x2ce28e,_0x214026);},'aDtFB':_0x5dbd3c(0xf4),'HIFeb':'✓\x20~/.ranger/\x20directory\x20already\x20exists'};void _0x5d0a32;const _0x10f6c8=_0x1d37f9['rYuEH'](getRangerHomeDir);return!_0x1d37f9[_0x5dbd3c(0xe4)](existsSync,_0x10f6c8)?(await _0x1d37f9[_0x5dbd3c(0xe1)](mkdir,_0x10f6c8,{'recursive':!![]}),console[_0x5dbd3c(0x108)](_0x1d37f9[_0x5dbd3c(0x102)]),{'path':_0x10f6c8,'installed':!![]}):(console[_0x5dbd3c(0x108)](_0x1d37f9['HIFeb']),{'path':_0x10f6c8,'installed':![]});}export async function ensureChromium(_0x3f68d1=![]){const _0x1c9045=_0x410d38,_0x23457a={'QJoAL':function(_0x348436,_0x3d755b){return _0x348436(_0x3d755b);},'QWAhU':'install','ZFFyX':function(_0x30b009,_0x2ebe17,_0x29a4ba){return _0x30b009(_0x2ebe17,_0x29a4ba);},'XIecn':function(_0x519b41,_0x13ec5c){return _0x519b41 instanceof _0x13ec5c;}};let _0x584955=![];try{const _0xec8a12=chromium[_0x1c9045(0x107)]();_0x584955=_0x23457a[_0x1c9045(0xf6)](existsSync,_0xec8a12);}catch{_0x584955=![];}if(_0x584955)return console[_0x1c9045(0x108)](_0x1c9045(0x118)),![];const _0x10fbfa=getPlaywrightVersion(),_0x2a2127=_0x10fbfa??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x1cb238=!_0x10fbfa,_0x401994=process[_0x1c9045(0x153)]['isTTY']&&process[_0x1c9045(0x138)]['isTTY'];let _0x465fe2=!![];if(_0x401994){const {install:_0xc4a9b8}=await _0x49691f['prompt']([{'type':_0x1c9045(0x147),'name':_0x23457a[_0x1c9045(0xe5)],'message':_0x1cb238?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x2a2127+'\x20now?':_0x1c9045(0x14f)+_0x2a2127+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x465fe2=_0xc4a9b8;}else console['log']('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x2a2127+(_0x1cb238?'\x20(fallback\x20version)':'')+_0x1c9045(0x121));if(_0x465fe2){console[_0x1c9045(0x108)]('\x0aInstalling\x20Chromium\x20browser...\x0a');try{await _0x23457a['ZFFyX'](installChromiumBinary,_0x2a2127,_0x3f68d1),console[_0x1c9045(0x108)](_0x1c9045(0x104));}catch(_0x22082a){console['error']('\x0a❌\x20Failed\x20to\x20install\x20Chromium:',_0x23457a['XIecn'](_0x22082a,Error)?_0x22082a['message']:_0x22082a),console['log'](_0x1c9045(0x146)),console[_0x1c9045(0x108)]('\x20\x20npx\x20playwright@'+_0x2a2127+'\x20install\x20chromium');}}else console['log'](_0x1c9045(0xfe)),console['log'](_0x1c9045(0x116)),console[_0x1c9045(0x108)]('\x20\x20npx\x20playwright@'+_0x2a2127+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x22bffa){const _0x3b3da6=_0x410d38,_0x24afbc={'ygKww':function(_0x415527,_0x2d1f38,_0x28919f){return _0x415527(_0x2d1f38,_0x28919f);},'HqrJO':'.gitignore','InvSo':function(_0x438a5c,_0x45eeae,_0x276675){return _0x438a5c(_0x45eeae,_0x276675);}},_0x55864e=_0x24afbc['ygKww'](join,_0x22bffa,_0x24afbc['HqrJO']),_0x3db99e='\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 _0x24afbc['InvSo'](writeFile,_0x55864e,_0x3db99e),console[_0x3b3da6(0x108)](_0x3b3da6(0xff));}export async function ensureLocalEnv(_0x1e9c5c,_0x2cf0a0){const _0x1e1de8=_0x410d38,_0x24ccfa={'Cjqul':function(_0x82d138){return _0x82d138();},'HvzrO':'user','dQZqn':'⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','zKBuQ':function(_0x54141b,_0x1f1a67){return _0x54141b===_0x1f1a67;},'WDrov':'✓\x20Local\x20profile\x20already\x20exists','ukxDK':function(_0x57d7f0,_0x40cc2c,_0x52b798,_0x396700){return _0x57d7f0(_0x40cc2c,_0x52b798,_0x396700);},'NqVjF':_0x1e1de8(0xf8)};if(!_0x24ccfa['Cjqul'](findGitRoot)&&_0x1e9c5c?.['scope']!==_0x24ccfa[_0x1e1de8(0x11c)])return console[_0x1e1de8(0x108)](_0x24ccfa[_0x1e1de8(0x141)]),{'ready':![],'skipped':!![]};const _0x1d9172=_0x24ccfa['zKBuQ'](_0x1e9c5c?.[_0x1e1de8(0x117)],'user')?getRangerHomeDir():undefined;if(findExistingEnv('local',{'locations':['local'],'rangerDir':_0x1d9172}))return console['log'](_0x24ccfa['WDrov']),{'ready':!![],'skipped':![]};try{return await _0x24ccfa['ukxDK'](addEnv,_0x1e1de8(0xec),{'url':_0x1e9c5c?.[_0x1e1de8(0xe0)],'force':_0x1e9c5c?.['force'],'allowInsecureLocalhost':_0x1e9c5c?.['allowInsecureLocalhost'],'scope':_0x1e9c5c?.[_0x1e1de8(0x117)]},_0x2cf0a0),{'ready':!![],'skipped':![]};}catch(_0x1b7868){return console['error'](_0x24ccfa['NqVjF'],_0x1b7868 instanceof Error?_0x1b7868['message']:_0x1b7868),{'ready':![],'skipped':![]};}}export async function start(_0x2674bb,_0x2accad,_0x191b88){const _0x1ebc24=_0x410d38,_0x12eea9={'ELvUp':'\x0a🚀\x20Ranger\x20Setup\x0a','zwMQJ':function(_0x585aba,_0xbcb955){return _0x585aba!==_0xbcb955;},'reDiq':_0x1ebc24(0x129),'pqdKN':function(_0x3ab7a6,_0x4a9043){return _0x3ab7a6+_0x4a9043;},'bCJPF':function(_0x4912ad,_0x2a2393){return _0x4912ad(_0x2a2393);},'VMiOb':function(_0x3b02f2,_0x3c1875){return _0x3b02f2(_0x3c1875);},'sbFDh':function(_0x278a73){return _0x278a73();},'yFgbY':function(_0x37437d,_0x51ad9e){return _0x37437d(_0x51ad9e);},'TxovO':_0x1ebc24(0x10d),'xisCq':'auth','xrtcY':function(_0x55e14b,_0x3e5c8c){return _0x55e14b(_0x3e5c8c);},'IJcVl':_0x1ebc24(0x140),'RaKjN':'\x0a✅\x20Ranger\x20setup\x20complete!\x0a','PZqmr':_0x1ebc24(0xe9),'IiUnG':_0x1ebc24(0xf2),'aAvjn':function(_0x35d6b0){return _0x35d6b0();},'FyPxy':_0x1ebc24(0x114),'iKQQR':function(_0x3e1b9e,_0x18d7aa,_0x2b48e2){return _0x3e1b9e(_0x18d7aa,_0x2b48e2);},'PhDsp':_0x1ebc24(0x12a),'eEcto':_0x1ebc24(0x120),'rEphl':'verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','pnkML':'/ranger:enable','TocbV':function(_0x2c8ecb,_0x3935e4){return _0x2c8ecb+_0x3935e4;}};console['log'](_0x12eea9['ELvUp']);_0x2accad?.['scope']!==undefined&&_0x12eea9['zwMQJ'](_0x2accad['scope'],_0x12eea9['reDiq'])&&(console['error'](_0x12eea9['pqdKN'](_0x12eea9['pqdKN']('ranger\x20setup\x20--scope='+_0x12eea9['bCJPF'](String,_0x2accad[_0x1ebc24(0x117)])+'\x20is\x20no\x20longer\x20supported.\x20',_0x1ebc24(0x10e)),_0x1ebc24(0xfd))),process['exit'](0x1));_0x2accad={..._0x2accad,'scope':_0x1ebc24(0x129)};const _0x537bdd=!_0x12eea9[_0x1ebc24(0x10a)](existsSync,_0x12eea9['sbFDh'](getRangerHomeDir));await _0x12eea9[_0x1ebc24(0x12d)](ensureRangerDir,_0x12eea9[_0x1ebc24(0x12c)]);if(_0x2accad?.['skipAuth'])console['log'](_0x12eea9['TxovO']),_0x191b88?.['trackPhaseEnd'](_0x12eea9['xisCq'],{'isFirstRun':_0x537bdd,'method':_0x1ebc24(0x109)});else{_0x191b88?.[_0x1ebc24(0x155)](_0x12eea9['xisCq']);const _0x1f5e71=await _0x12eea9[_0x1ebc24(0x10a)](authenticate,_0x2674bb);_0x191b88?.[_0x1ebc24(0x101)](_0x1ebc24(0x127),{'isFirstRun':_0x537bdd,'method':_0x1f5e71[_0x1ebc24(0x115)]});}_0x191b88?.['trackPhaseStart'](_0x1ebc24(0x140));_0x2accad?.[_0x1ebc24(0x124)]?console[_0x1ebc24(0x108)]('✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)'):await _0x12eea9['xrtcY'](ensureChromium,_0x2accad?.['withDeps']);_0x191b88?.['trackPhaseEnd'](_0x12eea9[_0x1ebc24(0x110)],{'isFirstRun':_0x537bdd,'skipped':!!_0x2accad?.[_0x1ebc24(0x124)]}),console[_0x1ebc24(0x108)](_0x12eea9['RaKjN']);const _0x446c0f=_0x2accad?.[_0x1ebc24(0x117)],_0x2e4cf9=_0x2accad?.['opencode']??![];let _0x1e63c3=null;_0x2e4cf9?(_0x191b88?.[_0x1ebc24(0x155)](_0x12eea9[_0x1ebc24(0x152)]),_0x1e63c3=await ensureOpencodePluginConfig(_0x446c0f),_0x191b88?.['trackPhaseEnd']('plugin',{'isFirstRun':_0x537bdd,'opencode':!![]})):(_0x191b88?.[_0x1ebc24(0x155)](_0x12eea9['PZqmr']),await _0x12eea9[_0x1ebc24(0x10a)](ensureClaudePlugin,_0x446c0f),_0x191b88?.['trackPhaseEnd'](_0x12eea9[_0x1ebc24(0x152)],{'isFirstRun':_0x537bdd}));if(_0x2e4cf9&&_0x1e63c3){_0x191b88?.[_0x1ebc24(0x155)](_0x1ebc24(0x114));try{await installSkill(_0x12eea9['IiUnG'],{'level':_0x1e63c3['scope'],'cliVersion':_0x12eea9['aAvjn'](getCurrentVersion),'platform':_0x1ebc24(0x149)}),_0x191b88?.['trackPhaseEnd'](_0x1ebc24(0x114),{'isFirstRun':_0x537bdd,'opencode':!![]});}catch(_0x55a18f){console['warn']('\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:',_0x55a18f instanceof Error?_0x55a18f['message']:_0x55a18f),_0x191b88?.[_0x1ebc24(0x101)]('skills',{'isFirstRun':_0x537bdd,'opencode':!![],'failed':!![]});}}else _0x191b88?.[_0x1ebc24(0x155)]('skills'),await _0x12eea9[_0x1ebc24(0x156)](ensureClaudeSkills,_0x446c0f),_0x191b88?.[_0x1ebc24(0x101)](_0x12eea9[_0x1ebc24(0x106)],{'isFirstRun':_0x537bdd});if(_0x2accad?.[_0x1ebc24(0x150)])console['log']('\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a');else{if(_0x2accad?.['url']){_0x191b88?.[_0x1ebc24(0x155)](_0x1ebc24(0x12a));const _0x4198c6=await _0x12eea9['iKQQR'](ensureLocalEnv,{'url':_0x2accad[_0x1ebc24(0xe0)],'force':_0x2accad?.[_0x1ebc24(0x126)],'allowInsecureLocalhost':_0x2accad?.[_0x1ebc24(0x13d)],'scope':_0x1ebc24(0x129)},_0x191b88);_0x191b88?.['trackPhaseEnd'](_0x12eea9['PhDsp'],{'isFirstRun':_0x537bdd,'profileReady':_0x4198c6[_0x1ebc24(0x10c)],'userSkipped':_0x4198c6['skipped']});}else console['log'](_0x12eea9[_0x1ebc24(0x144)](_0x12eea9['pqdKN'](_0x1ebc24(0x14e),'\x0a\x20\x20'+bold(_0x1ebc24(0x158)))+_0x1ebc24(0x131)+_0x1ebc24(0x10b),'\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles'));}if(_0x2e4cf9)console[_0x1ebc24(0x108)](_0x1ebc24(0xf3)),console[_0x1ebc24(0x108)]('and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review'),console['log'](_0x12eea9['eEcto']),console[_0x1ebc24(0x108)](_0x12eea9['rEphl']);else{const _0x154d8c=bold(_0x12eea9['pnkML']);console[_0x1ebc24(0x108)](_0x12eea9['TocbV'](_0x1ebc24(0x13e)+_0x154d8c+'\x20and\x20prompt\x20the\x20coding'+_0x1ebc24(0x13b)+'\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.'));}}
|
|
1
|
+
const _0x360521=_0xce8a;(function(_0x311fcb,_0x32a27c){const _0x15a026=_0xce8a,_0x19d406=_0x311fcb();while(!![]){try{const _0x1e2817=parseInt(_0x15a026(0xb0))/0x1*(-parseInt(_0x15a026(0xf4))/0x2)+-parseInt(_0x15a026(0xe2))/0x3*(-parseInt(_0x15a026(0xd8))/0x4)+parseInt(_0x15a026(0xc6))/0x5*(-parseInt(_0x15a026(0xc5))/0x6)+-parseInt(_0x15a026(0xff))/0x7+-parseInt(_0x15a026(0xdf))/0x8*(parseInt(_0x15a026(0xb4))/0x9)+parseInt(_0x15a026(0xa8))/0xa+parseInt(_0x15a026(0xeb))/0xb;if(_0x1e2817===_0x32a27c)break;else _0x19d406['push'](_0x19d406['shift']());}catch(_0x59ce79){_0x19d406['push'](_0x19d406['shift']());}}}(_0x3684,0x8a5fd));import{mkdir,writeFile}from'fs/promises';import{join,dirname}from'path';import{existsSync}from'fs';import{createRequire}from'module';import _0x49d0b6 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';function _0x3684(){const _0x7ac5fb=['You\x20can\x20install\x20it\x20manually\x20by\x20running:','profile','cli.js','chromium','gItCt','auth','lCdKo','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','ICjeI','DYtgG','qKvNy','✓\x20Already\x20authenticated\x20to\x20','version','platform','inherit','\x1b[1m','success','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','stdout','✓\x20~/.ranger/\x20directory\x20already\x20exists','dVoJm','✓\x20Authenticated\x20to\x20','554600pnVUzR','Chromium\x20install\x20timed\x20out\x20after\x20','plugin','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','\x1b[0m','skills','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','close','1UPigob','JYcYC','FTdbk','bjHFH','973602IyNojt','✓\x20Created\x20.ranger/.gitignore','device_auth','SIGKILL','IQDeK','YTwXq','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','wpqXw','exit','IVAhD','Authentication\x20failed:\x20','\x0a\x20\x20','uZAjJ','\x20\x20Chromium\x20install\x20attempt\x20','ranger\x20setup\x20--scope=','skipChromium','31896mToxCx','895lceMUJ','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','skipped','log','The\x20required\x20version\x20(','ignore','ZHeeK','force','withDeps','IFSRK','jbGRW','✓\x20Skipping\x20authentication\x20(--skip-auth)','playwright@','local','\x0a⚠\x20Skipping\x20Chromium\x20installation.','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','ranger\x20profile\x20add\x20<name>','IRoRA','3884380JiQbbw','kill','FZpQQ','KFOUQ','env','eRiCM','prompt','8ISBCrE','FheMp','STZBA','3sPDyIg','✓\x20Playwright\x20Chromium\x20browser\x20found','pQvkX','error','message','\x20\x20\x20\x20RANGER_CHROMIUM_INSTALL_TIMEOUT_MS=1800000\x20ranger\x20setup\x20deps','npx','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','user','15588034fZMbQf','trackPhaseStart','allowInsecureLocalhost','tUIsa','trackPhaseEnd','skipAuth','url','\x0a❌\x20Profile\x20setup\x20failed:','kAvOC','1068142WoTMCP','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','ready','scope','resolve','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','UzNGf','\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','.gitignore','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.','RAHaI','1981385VGuCsi','hCAmF','...','organizationName','existing_token','\x0aIn\x20Claude\x20Code,\x20run\x20','FFVVQ'];_0x3684=function(){return _0x7ac5fb;};return _0x3684();}import{spawn}from'child_process';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.56.1';const bold=_0x35eb75=>_0x360521(0xa1)+_0x35eb75+_0x360521(0xac);export function getPlaywrightVersion(){const _0x4b027e=_0x360521,_0x1d1a4b={'jbGRW':function(_0x3f891a,_0x5c4b55){return _0x3f891a(_0x5c4b55);}};try{const _0x297e24=require['resolve']('playwright/package.json'),_0x174a8e=_0x1d1a4b[_0x4b027e(0xd0)](require,_0x297e24);return _0x174a8e[_0x4b027e(0x112)];}catch{return null;}}function resolveBundledPlaywrightCli(){const _0x1aab37=_0x360521;try{const _0x46c533=join(dirname(require[_0x1aab37(0xf8)]('playwright/package.json')),_0x1aab37(0x108));return existsSync(_0x46c533)?_0x46c533:null;}catch{return null;}}const CHROMIUM_INSTALL_TIMEOUT_MS=Number(process[_0x360521(0xdc)]['RANGER_CHROMIUM_INSTALL_TIMEOUT_MS'])||0x927c0;class ChromiumInstallTimeoutError extends Error{}export async function installChromiumBinary(_0x2c8528,_0x462a8d=![]){const _0x134010=_0x360521,_0x3b074c={'UzNGf':function(_0x501958){return _0x501958();},'hCAmF':'--with-deps','tDVIj':_0x134010(0x109),'gItCt':function(_0x590e32,_0x356dfb){return _0x590e32 instanceof _0x356dfb;},'ZqsWu':function(_0x226710,_0x4b29c5){return _0x226710+_0x4b29c5;},'fWYig':function(_0x63f873,_0x52f6e4){return _0x63f873/_0x52f6e4;},'ICjeI':function(_0x3187e4,_0x3e1fed){return _0x3187e4>=_0x3e1fed;},'IQDeK':function(_0x40613b,_0x384b36){return _0x40613b(_0x384b36);}},_0xa4a930=_0x3b074c[_0x134010(0xfa)](resolveBundledPlaywrightCli),_0x1f49c7=_0xa4a930?process['execPath']:_0x134010(0xe8),_0x1390ae=[_0xa4a930??_0x134010(0xd2)+_0x2c8528,'install',..._0x462a8d?[_0x3b074c[_0x134010(0x100)]]:[],_0x3b074c['tDVIj']];let _0x5a0bb8=![];for(let _0x55a289=0x1;;_0x55a289++){try{await runChromiumInstall(_0x1f49c7,_0x1390ae);return;}catch(_0x1e280c){_0x3b074c[_0x134010(0x10a)](_0x1e280c,ChromiumInstallTimeoutError)&&!_0x5a0bb8&&(_0x5a0bb8=!![],console['log'](_0x3b074c['ZqsWu']('\x0a\x20\x20Chromium\x20install\x20timed\x20out\x20(limit\x20'+Math['round'](_0x3b074c['fWYig'](CHROMIUM_INSTALL_TIMEOUT_MS,0x3e8))+'s).\x20On\x20a\x20slow\x20or\x20proxied\x20connection,\x20raise\x20the\x20limit\x20and\x20retry,\x20e.g.:\x0a',_0x134010(0xe7))));if(_0x3b074c[_0x134010(0x10e)](_0x55a289,0x3))throw _0x1e280c;const _0x1badb5=_0x3b074c[_0x134010(0x10a)](_0x1e280c,Error)?_0x1e280c[_0x134010(0xe6)]:_0x3b074c[_0x134010(0xb8)](String,_0x1e280c);console[_0x134010(0xc9)](_0x134010(0xc2)+_0x55a289+'\x20failed\x20('+_0x1badb5+');\x20retrying...');}}}function runChromiumInstall(_0xb120eb,_0x41e355){const _0x397aac=_0x360521,_0x43df2d={'eRiCM':function(_0xb19d8f,_0x171e0b){return _0xb19d8f(_0x171e0b);},'obDSV':function(_0xce9a1){return _0xce9a1();},'JFanF':function(_0x151421,_0x90d4f1,_0x103b77,_0x44b929){return _0x151421(_0x90d4f1,_0x103b77,_0x44b929);},'uZAjJ':_0x397aac(0x114),'STZBA':function(_0x35c043,_0x1d6e64){return _0x35c043===_0x1d6e64;},'YcTFF':'win32','GfAvx':function(_0x5ae952,_0x18b4af,_0x3eeecf){return _0x5ae952(_0x18b4af,_0x3eeecf);},'BbroL':_0x397aac(0xaf)};return new Promise((_0x5ad7ab,_0x3e8cfa)=>{const _0x2c8a45=_0x397aac,_0x54a257={'zcRAx':function(_0x5b2e6f){return _0x43df2d['obDSV'](_0x5b2e6f);}},_0x194915=_0x43df2d['JFanF'](spawn,_0xb120eb,_0x41e355,{'stdio':[_0x2c8a45(0xcb),_0x43df2d['uZAjJ'],_0x43df2d[_0x2c8a45(0xc1)]],'shell':_0x43df2d[_0x2c8a45(0xe1)](process[_0x2c8a45(0x113)],_0x43df2d['YcTFF'])}),_0x354d6e=_0x43df2d['GfAvx'](setTimeout,()=>{const _0x5e9321=_0x2c8a45;_0x194915[_0x5e9321(0xd9)](_0x5e9321(0xb7)),_0x3e8cfa(new ChromiumInstallTimeoutError(_0x5e9321(0xa9)+Math['round'](CHROMIUM_INSTALL_TIMEOUT_MS/0x3e8)+'s'));},CHROMIUM_INSTALL_TIMEOUT_MS);_0x194915['on'](_0x43df2d['BbroL'],_0x45c69a=>{clearTimeout(_0x354d6e);if(_0x45c69a===0x0)_0x54a257['zcRAx'](_0x5ad7ab);else _0x3e8cfa(new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x45c69a));}),_0x194915['on'](_0x2c8a45(0xe5),_0x4786a0=>{const _0x535695=_0x2c8a45;clearTimeout(_0x354d6e),_0x43df2d[_0x535695(0xdd)](_0x3e8cfa,_0x4786a0);});});}export async function authenticate(_0x5b0496){const _0x278377=_0x360521,_0x1cc48e={'LdjxA':function(_0x3698e7){return _0x3698e7();},'Uicyo':function(_0x5e180f,_0x5dbc8f){return _0x5e180f(_0x5dbc8f);},'lCdKo':_0x278377(0x103),'jKZqo':function(_0x477054,_0x1747cf){return _0x477054(_0x1747cf);},'DSFMD':_0x278377(0xb6),'TpmTw':'Validating\x20API\x20token...','IRoRA':function(_0x5b7f8f,_0x3ec7f2){return _0x5b7f8f(_0x3ec7f2);},'KFOUQ':'✓\x20Stored\x20credentials\x20locally'};if(!_0x5b0496){const _0xcc1f87=await _0x1cc48e['LdjxA'](getToken);if(_0xcc1f87){const _0x5b765a=await _0x1cc48e['Uicyo'](getCurrentUser,_0xcc1f87);if(_0x5b765a[_0x278377(0xa2)])return console['log'](_0x278377(0x111)+_0x5b765a[_0x278377(0xea)][_0x278377(0x102)]),{'token':_0xcc1f87,'method':_0x1cc48e[_0x278377(0x10c)]};}try{_0x5b0496=await _0x1cc48e['LdjxA'](runDeviceAuthFlow);}catch(_0x3e0951){throw new Error(_0x278377(0xbf)+(_0x3e0951 instanceof Error?_0x3e0951['message']:_0x3e0951));}const _0x165015=await _0x1cc48e['jKZqo'](getCurrentUser,_0x5b0496);if(!_0x165015['success'])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x165015[_0x278377(0xe5)]);return console[_0x278377(0xc9)](_0x278377(0xa7)+_0x165015[_0x278377(0xea)][_0x278377(0x102)]),{'token':_0x5b0496,'method':_0x1cc48e['DSFMD']};}console[_0x278377(0xc9)](_0x1cc48e['TpmTw']);const _0x5532c8=await getCurrentUser(_0x5b0496);if(!_0x5532c8[_0x278377(0xa2)]){if(_0x5532c8['status'])throw new Error('Authentication\x20failed:\x20'+_0x5532c8[_0x278377(0xe5)]+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error(_0x278377(0xa3)+_0x5532c8['error']+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console['log'](_0x278377(0xa7)+_0x5532c8[_0x278377(0xea)]['organizationName']),await _0x1cc48e[_0x278377(0xd7)](storeToken,_0x5b0496),console[_0x278377(0xc9)](process[_0x278377(0xdc)]['GITHUB_ENV']?'✓\x20Exported\x20credentials\x20for\x20CI':_0x1cc48e[_0x278377(0xdb)]),{'token':_0x5b0496,'method':'provided_token'};}export async function ensureRangerDir(_0x36e683){const _0x50b2b2=_0x360521,_0x37bb10={'uHLRV':function(_0x3a0419){return _0x3a0419();},'gkEcK':function(_0x5831eb,_0x322226,_0x4a3abe){return _0x5831eb(_0x322226,_0x4a3abe);},'UhiKy':_0x50b2b2(0xa5)};void _0x36e683;const _0x765017=_0x37bb10['uHLRV'](getRangerHomeDir);return!existsSync(_0x765017)?(await _0x37bb10['gkEcK'](mkdir,_0x765017,{'recursive':!![]}),console[_0x50b2b2(0xc9)]('✓\x20Created\x20~/.ranger/\x20directory'),{'path':_0x765017,'installed':!![]}):(console['log'](_0x37bb10['UhiKy']),{'path':_0x765017,'installed':![]});}function _0xce8a(_0x473892,_0x14a87d){_0x473892=_0x473892-0xa1;const _0x3684b8=_0x3684();let _0xce8aaf=_0x3684b8[_0x473892];return _0xce8aaf;}export async function ensureChromium(_0x2a49ec=![]){const _0x225d8b=_0x360521,_0x8edca6={'ryQyB':_0x225d8b(0xe3),'gSJsK':function(_0x7eb17e){return _0x7eb17e();},'lNZGl':function(_0x2fd6e9,_0x2bd5f6){return _0x2fd6e9??_0x2bd5f6;},'IFSRK':'install','pebJy':'\x20(fallback\x20version)','YTwXq':'\x0aInstalling\x20Chromium\x20browser...\x0a','QzkcJ':_0x225d8b(0xd5),'rXQmN':function(_0x412311,_0x2764fb){return _0x412311 instanceof _0x2764fb;},'WghPB':'You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'};let _0xc0caa5=![];try{const _0x1c6c34=chromium['executablePath']();_0xc0caa5=existsSync(_0x1c6c34);}catch{_0xc0caa5=![];}if(_0xc0caa5)return console['log'](_0x8edca6['ryQyB']),![];const _0x51d904=_0x8edca6['gSJsK'](getPlaywrightVersion),_0x9c73bb=_0x8edca6['lNZGl'](_0x51d904,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x59e0b2=!_0x51d904,_0x39dcfb=process['stdin']['isTTY']&&process[_0x225d8b(0xa4)]['isTTY'];let _0x41e0d0=!![];if(_0x39dcfb){const {install:_0x490fda}=await _0x49d0b6[_0x225d8b(0xde)]([{'type':'confirm','name':_0x8edca6[_0x225d8b(0xcf)],'message':_0x59e0b2?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x9c73bb+'\x20now?':_0x225d8b(0xca)+_0x9c73bb+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x41e0d0=_0x490fda;}else console['log']('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x9c73bb+(_0x59e0b2?_0x8edca6['pebJy']:'')+_0x225d8b(0x101));if(_0x41e0d0){console[_0x225d8b(0xc9)](_0x8edca6[_0x225d8b(0xb9)]);try{await installChromiumBinary(_0x9c73bb,_0x2a49ec),console['log'](_0x8edca6['QzkcJ']);}catch(_0x53bd2c){console['error'](_0x225d8b(0xba),_0x8edca6['rXQmN'](_0x53bd2c,Error)?_0x53bd2c['message']:_0x53bd2c),console['log'](_0x225d8b(0x106)),console['log']('\x20\x20npx\x20playwright@'+_0x9c73bb+'\x20install\x20chromium');}}else console['log'](_0x225d8b(0xd4)),console['log'](_0x8edca6['WghPB']),console['log']('\x20\x20npx\x20playwright@'+_0x9c73bb+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x39045b){const _0x246f6b=_0x360521,_0x24302e={'FFVVQ':function(_0x3ab182,_0x546007,_0x2ae8c8){return _0x3ab182(_0x546007,_0x2ae8c8);}},_0x49b82c=join(_0x39045b,_0x246f6b(0xfc)),_0x6a8381='\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 _0x24302e[_0x246f6b(0x105)](writeFile,_0x49b82c,_0x6a8381),console['log'](_0x246f6b(0xb5));}export async function ensureLocalEnv(_0x2f796a,_0x309cf2){const _0x29b3b0=_0x360521,_0x206523={'kAvOC':function(_0x637f34,_0x51adc6){return _0x637f34!==_0x51adc6;},'QIpaI':_0x29b3b0(0x10d),'QpnDY':'user','LnOrM':function(_0x1b4428,_0x4e9984,_0x403d26){return _0x1b4428(_0x4e9984,_0x403d26);},'DYtgG':_0x29b3b0(0xf2)};if(!findGitRoot()&&_0x206523[_0x29b3b0(0xf3)](_0x2f796a?.[_0x29b3b0(0xf7)],_0x29b3b0(0xea)))return console[_0x29b3b0(0xc9)](_0x206523['QIpaI']),{'ready':![],'skipped':!![]};const _0x138ed0=_0x2f796a?.[_0x29b3b0(0xf7)]===_0x206523['QpnDY']?getRangerHomeDir():undefined;if(_0x206523['LnOrM'](findExistingEnv,_0x29b3b0(0xd3),{'locations':['local'],'rangerDir':_0x138ed0}))return console['log']('✓\x20Local\x20profile\x20already\x20exists'),{'ready':!![],'skipped':![]};try{return await addEnv(_0x29b3b0(0xd3),{'url':_0x2f796a?.[_0x29b3b0(0xf1)],'force':_0x2f796a?.['force'],'allowInsecureLocalhost':_0x2f796a?.['allowInsecureLocalhost'],'scope':_0x2f796a?.['scope']},_0x309cf2),{'ready':!![],'skipped':![]};}catch(_0x5c85d6){return console['error'](_0x206523[_0x29b3b0(0x10f)],_0x5c85d6 instanceof Error?_0x5c85d6[_0x29b3b0(0xe6)]:_0x5c85d6),{'ready':![],'skipped':![]};}}export async function start(_0x3213f9,_0x28882c,_0x57378f){const _0x3aae64=_0x360521,_0x20bf78={'RAHaI':function(_0x37b0ff,_0x2dfd50){return _0x37b0ff!==_0x2dfd50;},'dVoJm':function(_0x49e4f4,_0x3a0aa4){return _0x49e4f4+_0x3a0aa4;},'ieIfG':function(_0x3b3fc4,_0x320ade){return _0x3b3fc4+_0x320ade;},'FZpQQ':function(_0x262218,_0x372590){return _0x262218(_0x372590);},'FTdbk':_0x3aae64(0xea),'qKvNy':_0x3aae64(0x10b),'tUIsa':_0x3aae64(0x109),'uUJwk':'✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','NZgob':'\x0a✅\x20Ranger\x20setup\x20complete!\x0a','IVAhD':'plugin','IsoDn':'skills','QlJdQ':'ranger','YAmLR':function(_0x347ac4,_0x4662b2){return _0x347ac4 instanceof _0x4662b2;},'wpqXw':function(_0x45664f,_0x1abba5){return _0x45664f(_0x1abba5);},'FheMp':_0x3aae64(0xf5),'JYcYC':_0x3aae64(0x107),'bjHFH':function(_0x2bfc1d,_0x52e8e7){return _0x2bfc1d+_0x52e8e7;},'tqEAU':_0x3aae64(0xf9),'ZHeeK':_0x3aae64(0xab),'VowkP':'/ranger:enable','pQvkX':function(_0x5a2de8,_0x467963){return _0x5a2de8+_0x467963;}};console['log']('\x0a🚀\x20Ranger\x20Setup\x0a');_0x20bf78[_0x3aae64(0xfe)](_0x28882c?.['scope'],undefined)&&_0x28882c['scope']!==_0x3aae64(0xea)&&(console['error'](_0x20bf78['dVoJm'](_0x20bf78['ieIfG'](_0x3aae64(0xc3)+_0x20bf78[_0x3aae64(0xda)](String,_0x28882c[_0x3aae64(0xf7)])+'\x20is\x20no\x20longer\x20supported.\x20',_0x3aae64(0xe9)),_0x3aae64(0xfd))),process[_0x3aae64(0xbd)](0x1));_0x28882c={..._0x28882c,'scope':_0x20bf78[_0x3aae64(0xb2)]};const _0x3939bd=!_0x20bf78[_0x3aae64(0xda)](existsSync,getRangerHomeDir());await ensureRangerDir(_0x20bf78[_0x3aae64(0xb2)]);if(_0x28882c?.[_0x3aae64(0xf0)])console[_0x3aae64(0xc9)](_0x3aae64(0xd1)),_0x57378f?.['trackPhaseEnd'](_0x3aae64(0x10b),{'isFirstRun':_0x3939bd,'method':_0x3aae64(0xc8)});else{_0x57378f?.['trackPhaseStart'](_0x20bf78[_0x3aae64(0x110)]);const _0x57567d=await _0x20bf78['FZpQQ'](authenticate,_0x3213f9);_0x57378f?.['trackPhaseEnd'](_0x3aae64(0x10b),{'isFirstRun':_0x3939bd,'method':_0x57567d['method']});}_0x57378f?.['trackPhaseStart'](_0x20bf78[_0x3aae64(0xee)]);_0x28882c?.[_0x3aae64(0xc4)]?console['log'](_0x20bf78['uUJwk']):await _0x20bf78[_0x3aae64(0xda)](ensureChromium,_0x28882c?.[_0x3aae64(0xce)]);_0x57378f?.[_0x3aae64(0xef)](_0x3aae64(0x109),{'isFirstRun':_0x3939bd,'skipped':!!_0x28882c?.['skipChromium']}),console[_0x3aae64(0xc9)](_0x20bf78['NZgob']);const _0x227f2b=_0x28882c?.[_0x3aae64(0xf7)],_0x35a60f=_0x28882c?.['opencode']??![];let _0x2d5b62=null;_0x35a60f?(_0x57378f?.[_0x3aae64(0xec)](_0x3aae64(0xaa)),_0x2d5b62=await _0x20bf78[_0x3aae64(0xda)](ensureOpencodePluginConfig,_0x227f2b),_0x57378f?.['trackPhaseEnd'](_0x3aae64(0xaa),{'isFirstRun':_0x3939bd,'opencode':!![]})):(_0x57378f?.[_0x3aae64(0xec)](_0x3aae64(0xaa)),await _0x20bf78['FZpQQ'](ensureClaudePlugin,_0x227f2b),_0x57378f?.[_0x3aae64(0xef)](_0x20bf78[_0x3aae64(0xbe)],{'isFirstRun':_0x3939bd}));if(_0x35a60f&&_0x2d5b62){_0x57378f?.[_0x3aae64(0xec)](_0x20bf78['IsoDn']);try{await installSkill(_0x20bf78['QlJdQ'],{'level':_0x2d5b62[_0x3aae64(0xf7)],'cliVersion':getCurrentVersion(),'platform':'opencode'}),_0x57378f?.['trackPhaseEnd'](_0x3aae64(0xad),{'isFirstRun':_0x3939bd,'opencode':!![]});}catch(_0x5676d1){console['warn']('\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:',_0x20bf78['YAmLR'](_0x5676d1,Error)?_0x5676d1['message']:_0x5676d1),_0x57378f?.['trackPhaseEnd'](_0x3aae64(0xad),{'isFirstRun':_0x3939bd,'opencode':!![],'failed':!![]});}}else _0x57378f?.[_0x3aae64(0xec)](_0x3aae64(0xad)),await _0x20bf78[_0x3aae64(0xbc)](ensureClaudeSkills,_0x227f2b),_0x57378f?.['trackPhaseEnd'](_0x3aae64(0xad),{'isFirstRun':_0x3939bd});if(_0x28882c?.[_0x3aae64(0xf0)])console['log'](_0x20bf78[_0x3aae64(0xe0)]);else{if(_0x28882c?.[_0x3aae64(0xf1)]){_0x57378f?.[_0x3aae64(0xec)](_0x20bf78[_0x3aae64(0xb1)]);const _0x1903be=await ensureLocalEnv({'url':_0x28882c['url'],'force':_0x28882c?.[_0x3aae64(0xcd)],'allowInsecureLocalhost':_0x28882c?.[_0x3aae64(0xed)],'scope':'user'},_0x57378f);_0x57378f?.[_0x3aae64(0xef)](_0x20bf78['JYcYC'],{'isFirstRun':_0x3939bd,'profileReady':_0x1903be[_0x3aae64(0xf6)],'userSkipped':_0x1903be[_0x3aae64(0xc8)]});}else console['log'](_0x20bf78[_0x3aae64(0xa6)](_0x20bf78[_0x3aae64(0xa6)](_0x20bf78[_0x3aae64(0xb3)]('\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:',_0x3aae64(0xc0)+bold(_0x3aae64(0xd6)))+_0x3aae64(0xfb),'\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:'),'\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles'));}if(_0x35a60f)console[_0x3aae64(0xc9)](_0x20bf78['tqEAU']),console['log'](_0x20bf78[_0x3aae64(0xcc)]),console[_0x3aae64(0xc9)](_0x3aae64(0xc7)),console[_0x3aae64(0xc9)](_0x3aae64(0xae));else{const _0x1a70c7=_0x20bf78['wpqXw'](bold,_0x20bf78['VowkP']);console[_0x3aae64(0xc9)](_0x20bf78[_0x3aae64(0xe4)](_0x3aae64(0x104)+_0x1a70c7+'\x20and\x20prompt\x20the\x20coding'+'\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser')+_0x3aae64(0xbb));}}
|
package/build/commands/status.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x149bdb=_0x5c6e;function _0x5c6e(_0x223e49,_0x53dc51){_0x223e49=_0x223e49-0x8f;const _0x21a866=_0x21a8();let _0x5c6e6b=_0x21a866[_0x223e49];return _0x5c6e6b;}(function(_0x3874b8,_0x51a564){const _0x2eb12f=_0x5c6e,_0x195aa8=_0x3874b8();while(!![]){try{const _0x35f555=parseInt(_0x2eb12f(0xaa))/0x1+-parseInt(_0x2eb12f(0xa8))/0x2*(parseInt(_0x2eb12f(0xf3))/0x3)+parseInt(_0x2eb12f(0xe0))/0x4+-parseInt(_0x2eb12f(0xa9))/0x5+-parseInt(_0x2eb12f(0xda))/0x6+-parseInt(_0x2eb12f(0x8f))/0x7+parseInt(_0x2eb12f(0xd4))/0x8;if(_0x35f555===_0x51a564)break;else _0x195aa8['push'](_0x195aa8['shift']());}catch(_0x560a8e){_0x195aa8['push'](_0x195aa8['shift']());}}}(_0x21a8,0x61a62));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';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{listCloudProfiles}from'./utils/cloudProfile.js';import{getPluginInfo}from'./utils/claudePlugin.js';function _0x21a8(){const _0x3ae020=['UNnGI','config','Organization:\x20','No\x20profiles\x20configured','WJhOj','KOxNg','2566375RrELaN','FrIok','user','@ranger-testing/opencode-plugin','details','length','Version:\x20','\x20(up\x20to\x20date)','lOEgq','path','MbtVl','ntpaO','kMtah','CNDwF','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','XBGVk','some','name','NTNrr','BLoMy','\x1b[1m','qraFA','No\x20skills\x20installed','\x20(active)','yEyjM','232346YpcpLN','1464490CWLsmc','707002iQDmxR','auth.json','debug','\x20\x20User-level:','LTvJF','settingsPath','disabled','API\x20Token:\x20✗\x20Not\x20found','has','version','\x20profiles\x20configured\x20(','zWtGH','trim','memCI','auth.json.enc','\x0a---\x20Profiles\x20---','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','includes','utf-8','ycGUE','ranger@trailhead','\x1b[0m','success','\x20local','NvUjP','API\x20Environment:\x20','\x0a---\x20OpenCode\x20Plugin\x20---','VIwpd','\x20plugin(s)\x20configured','\x20\x20Active:\x20','THIKK','\x20\x20Run:\x20ranger\x20setup\x20--opencode','encrypted','baPtl','jBbDx','stderr','Root:\x20','no\x20session','DykmP','YJpbw','\x20[local]','\x20\x20\x20\x20Auth:\x20','6892712bPSYmj','pAbmj','EpXyY','\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','string','cwd','2687922qcLbad','jdZqF','displayName','TXSvw','push','gtmzN','1149632DZGRtd','VjPmg','\x20\x20Not\x20configured','\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a','\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)','BnrEt','aJSTe','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','hasPlaintextAuth','map','toString','\x20cloud','not_installed','kvtBy','log','\x20\x20Run:\x20ranger\x20setup\x20[token]','\x20[cloud]','unknown','quoaQ','9OLbwwZ'];_0x21a8=function(){return _0x3ae020;};return _0x21a8();}import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x564bed=>_0x149bdb(0xa3)+_0x564bed+_0x149bdb(0xbf),link=(_0x290f5a,_0x2a6fab)=>'\x1b]8;;file://'+_0x290f5a+'\x07'+(_0x2a6fab||_0x290f5a)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x1f4e0f=_0x149bdb,_0x21573b={'baPtl':_0x1f4e0f(0xd8),'PwJfB':'not_installed','pAbmj':'configured','lhiZj':function(_0x11645e,_0x157037){return _0x11645e(_0x157037);},'jBbDx':_0x1f4e0f(0xac),'JAEdk':'ignore','CNDwF':'pipe','DykmP':'data'};return new Promise(_0x242595=>{const _0x2706a2=_0x1f4e0f,_0x3251b4={'NYsio':function(_0x30f217,_0x234163){return _0x30f217(_0x234163);},'LTvJF':_0x2706a2(0xec)},_0x27b571=spawn('opencode',[_0x21573b[_0x2706a2(0xcc)],_0x2706a2(0xf5)],{'stdio':[_0x21573b['JAEdk'],_0x21573b[_0x2706a2(0x9c)],'pipe']});let _0x35a1fb='';_0x27b571['stdout']?.['on'](_0x21573b[_0x2706a2(0xd0)],_0x32fdf9=>{_0x35a1fb+=_0x32fdf9['toString']();}),_0x27b571[_0x2706a2(0xcd)]?.['on'](_0x21573b[_0x2706a2(0xd0)],_0x28fc50=>{const _0x413d7a=_0x2706a2;_0x35a1fb+=_0x28fc50[_0x413d7a(0xea)]();}),_0x27b571['on']('error',()=>{const _0x21e64c=_0x2706a2;_0x3251b4['NYsio'](_0x242595,{'status':_0x3251b4[_0x21e64c(0xae)]});}),_0x27b571['on']('close',_0x562e75=>{const _0x4f4016=_0x2706a2,_0x175194={'qraFA':_0x21573b[_0x4f4016(0xcb)],'MHGhF':'opencode-plugin'};if(_0x562e75!==0x0){_0x242595({'status':_0x21573b['PwJfB']});return;}const _0x25afab=_0x35a1fb[_0x4f4016(0xb6)]();let _0x4a8bd4=null;if(_0x25afab)try{_0x4a8bd4=JSON['parse'](_0x25afab);}catch{const _0x2579e3=_0x25afab['match'](/\{[\s\S]*\}$/);if(_0x2579e3)try{_0x4a8bd4=JSON['parse'](_0x2579e3[0x0]);}catch{_0x4a8bd4=null;}}const _0x36a6c8=Array['isArray'](_0x4a8bd4?.['plugin'])?_0x4a8bd4?.['plugin']:[],_0x244100=_0x36a6c8[_0x4f4016(0x9f)](_0x2c5e22=>{const _0x2e7613=_0x4f4016;if(typeof _0x2c5e22!==_0x175194[_0x2e7613(0xa4)])return![];return _0x2c5e22['includes']('@ranger-testing/opencode-plugin')||_0x2c5e22['includes'](_0x175194['MHGhF']);});if(_0x244100){_0x242595({'status':_0x21573b[_0x4f4016(0xd5)],'details':_0x36a6c8[_0x4f4016(0x94)]>0x0?_0x36a6c8[_0x4f4016(0x94)]+_0x4f4016(0xc6):undefined});return;}if(_0x36a6c8[_0x4f4016(0x94)]>0x0){_0x21573b['lhiZj'](_0x242595,{'status':'not_configured','details':_0x36a6c8['length']+_0x4f4016(0xc6)});return;}_0x242595({'status':'not_configured'});});});}async function getSkillsFromDir(_0x2712a3,_0x3575de){const _0x160b80=_0x149bdb,_0x4ae51a={'MbtVl':function(_0x448f70,_0x39d5f7,_0x1d9d04,_0x5d37ee){return _0x448f70(_0x39d5f7,_0x1d9d04,_0x5d37ee);},'BLoMy':'SKILL.md','tSxbO':function(_0x74afd2,_0xd0efdf,_0x53ea15){return _0x74afd2(_0xd0efdf,_0x53ea15);}};if(!existsSync(_0x2712a3))return[];const _0x2b7e6c=[];try{const _0x279100=await readdir(_0x2712a3,{'withFileTypes':!![]});for(const _0x1f92d1 of _0x279100){if(_0x1f92d1['isDirectory']()){const _0x44273b=_0x4ae51a[_0x160b80(0x99)](join,_0x2712a3,_0x1f92d1['name'],_0x4ae51a[_0x160b80(0xa2)]);if(existsSync(_0x44273b)){let _0x26decd=_0x1f92d1['name'];try{const _0x2c3d54=await _0x4ae51a['tSxbO'](readFile,_0x44273b,_0x160b80(0xbc)),_0x448d02=_0x2c3d54['match'](/name:\s*(.+)/);_0x448d02&&(_0x26decd=_0x448d02[0x1][_0x160b80(0xb6)]());}catch{}_0x2b7e6c['push']({'name':_0x1f92d1['name'],'displayName':_0x26decd,'path':_0x44273b,'level':_0x3575de});}}}}catch{return[];}return _0x2b7e6c;}async function getInstalledSkills(){const _0x5d7e20=_0x149bdb,_0x3591fb={'NTNrr':function(_0x50f1ad,_0x4badba,_0xc9d644){return _0x50f1ad(_0x4badba,_0xc9d644);}},[_0x434781,_0x546d56]=await Promise['all']([_0x3591fb[_0x5d7e20(0xa1)](getSkillsFromDir,getProjectSkillsDir(),'project'),getSkillsFromDir(getUserSkillsDir(),_0x5d7e20(0x91))]);return{'project':_0x434781,'user':_0x546d56};}async function getEnvironments(){const _0x36510f=_0x149bdb,_0x26fb06={'UNnGI':function(_0x4b521f,_0x2b8c28){return _0x4b521f(_0x2b8c28);},'jdZqF':function(_0x15a67a,_0x4e9d96,_0x4959af){return _0x15a67a(_0x4e9d96,_0x4959af);},'zqsse':'settings.json','MKbWt':_0x36510f(0xab),'YJpbw':_0x36510f(0xb8),'BnrEt':'(not\x20found)','THIKK':function(_0x411bfe,_0x3f2a3f){return _0x411bfe(_0x3f2a3f);},'ycGUE':function(_0x29c290,_0x36edec){return _0x29c290===_0x36edec;},'qJbjP':function(_0x399805){return _0x399805();},'aJSTe':function(_0x334f9c,_0x81f42b){return _0x334f9c(_0x81f42b);}},{envNames:_0x556373,activeEnv:_0x55332b}=await getEnvNames(),_0x546440=_0x26fb06['qJbjP'](getRangerDir);if(!_0x26fb06[_0x36510f(0xe6)](existsSync,_0x546440))return{'envs':[],'activeEnv':null};const _0x277890=_0x556373[_0x36510f(0xe9)](_0x5bfd3b=>{const _0x14b5dc=_0x36510f,_0x5466be=_0x26fb06[_0x14b5dc(0xf4)](getEnvDir,_0x5bfd3b),_0x4cde61=_0x26fb06[_0x14b5dc(0xdb)](join,_0x5466be,_0x26fb06['zqsse']),_0x43707=_0x26fb06[_0x14b5dc(0xdb)](join,_0x5466be,_0x26fb06['MKbWt']),_0x52d3a5=_0x26fb06[_0x14b5dc(0xdb)](join,_0x5466be,_0x26fb06[_0x14b5dc(0xd1)]);return{'name':_0x5bfd3b,'settingsPath':_0x26fb06['UNnGI'](existsSync,_0x4cde61)?_0x4cde61:_0x26fb06[_0x14b5dc(0xe5)],'hasPlaintextAuth':_0x26fb06[_0x14b5dc(0xf4)](existsSync,_0x43707),'hasEncryptedAuth':_0x26fb06[_0x14b5dc(0xc8)](existsSync,_0x52d3a5),'isActive':_0x26fb06[_0x14b5dc(0xbd)](_0x5bfd3b,_0x55332b)};});return{'envs':_0x277890,'activeEnv':_0x55332b};}export async function status(){const _0x4eebe0=_0x149bdb,_0x594cc8={'zWtGH':function(_0x569086,_0x3d3369,_0x242e0e){return _0x569086(_0x3d3369,_0x242e0e);},'WJhOj':function(_0x23e092,_0x2d16e7){return _0x23e092(_0x2d16e7);},'SEdJK':function(_0x415e8b,_0x4b4748){return _0x415e8b(_0x4b4748);},'NvUjP':function(_0x7bc4ed,_0x5f0b83){return _0x7bc4ed(_0x5f0b83);},'MqzuH':function(_0x5be8cf){return _0x5be8cf();},'VIwpd':_0x4eebe0(0xc4),'gkPsy':function(_0x178a5d,_0x313072){return _0x178a5d===_0x313072;},'UrFNH':_0x4eebe0(0x92),'jLUEb':function(_0x283d9b,_0x144386){return _0x283d9b===_0x144386;},'quoaQ':'not_configured','EpXyY':_0x4eebe0(0xd7),'ntpaO':'\x0a---\x20Claude\x20Code\x20Plugin\x20---','gtmzN':_0x4eebe0(0xbe),'memCI':_0x4eebe0(0xf1),'bpyMG':'\x0a---\x20Skills\x20---','osXkZ':_0x4eebe0(0xa5),'TXSvw':'\x20\x20Project-level:','kMtah':function(_0x286ac6,_0x17757f){return _0x286ac6(_0x17757f);},'QEWxW':_0x4eebe0(0xad),'Sixhn':function(_0x29d1ea){return _0x29d1ea();},'Rqqxi':function(_0x455484,_0x2a8557){return _0x455484+_0x2a8557;},'lOEgq':function(_0xd436fa,_0x12a0b2){return _0xd436fa>_0x12a0b2;},'KOxNg':function(_0x99eeca,_0x5120d6){return _0x99eeca>_0x5120d6;},'kmOyh':function(_0x4ac24f,_0xf9f4b3){return _0x4ac24f(_0xf9f4b3);},'yEyjM':_0x4eebe0(0xcf),'XBGVk':_0x4eebe0(0xca),'icvUO':'plaintext','FrIok':function(_0x37a203,_0x4740ef){return _0x37a203(_0x4740ef);},'kvtBy':'(not\x20found)','VjPmg':function(_0x5a686b,_0x4ff993,_0x28e15b){return _0x5a686b(_0x4ff993,_0x28e15b);}};console['log']('\x0a📊\x20Ranger\x20Status\x0a');const _0x2b4e9d=process[_0x4eebe0(0xd9)](),_0x1e9d96=getRangerDir();if(!existsSync(_0x1e9d96)){console[_0x4eebe0(0xee)](_0x4eebe0(0xce)+_0x594cc8[_0x4eebe0(0xb5)](link,_0x2b4e9d,bold(_0x594cc8[_0x4eebe0(0xf8)](basename,_0x2b4e9d)))),console[_0x4eebe0(0xee)]('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console['log'](_0x4eebe0(0xe3));return;}console['log']('Root:\x20'+link(_0x2b4e9d,bold(_0x594cc8['SEdJK'](basename,_0x2b4e9d))));const _0xfbf9b9=getCurrentVersion(),_0x24eca3=getLatestVersion();if(_0x24eca3['version']&&_0x24eca3['version']!==_0xfbf9b9)console['log']('Version:\x20'+_0xfbf9b9+'\x20(latest:\x20'+_0x24eca3['version']+')'),console[_0x4eebe0(0xee)]('\x20\x20Run:\x20ranger\x20update');else _0x24eca3[_0x4eebe0(0xb3)]?console['log'](_0x4eebe0(0x95)+_0xfbf9b9+_0x4eebe0(0x96)):console[_0x4eebe0(0xee)](_0x4eebe0(0x95)+_0xfbf9b9);const _0x2e56a3=await getToken();if(_0x2e56a3){const _0x1952a8=await getCurrentUser(_0x2e56a3);_0x1952a8[_0x4eebe0(0xc0)]?console[_0x4eebe0(0xee)](_0x4eebe0(0xf6)+_0x594cc8[_0x4eebe0(0xc2)](bold,_0x1952a8[_0x4eebe0(0x91)]['organizationName'])):(console[_0x4eebe0(0xee)](_0x4eebe0(0xe7)),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console[_0x4eebe0(0xee)](_0x4eebe0(0xb1)),console['log'](_0x4eebe0(0xef));process['env']['DEBUG']&&(console['log'](_0x4eebe0(0xc3)+_0x594cc8['MqzuH'](getCurrentEnvironment)),console[_0x4eebe0(0xee)]('API\x20URL:\x20'+_0x594cc8['MqzuH'](getApiBaseUrl)));console[_0x4eebe0(0xee)](_0x594cc8[_0x4eebe0(0xc5)]);const _0x1c7898=await getOpencodePluginStatus();if(_0x594cc8['gkPsy'](_0x1c7898['status'],'configured'))console[_0x4eebe0(0xee)]('\x20\x20'+bold(_0x594cc8['UrFNH'])+':\x20configured'),_0x1c7898['details']&&console[_0x4eebe0(0xee)]('\x20\x20'+_0x1c7898[_0x4eebe0(0x93)]);else _0x594cc8['jLUEb'](_0x1c7898['status'],_0x594cc8[_0x4eebe0(0xf2)])?(console['log'](_0x4eebe0(0xe2)),_0x1c7898[_0x4eebe0(0x93)]&&console[_0x4eebe0(0xee)]('\x20\x20'+_0x1c7898[_0x4eebe0(0x93)]),console[_0x4eebe0(0xee)](_0x4eebe0(0xc9))):console['log'](_0x594cc8[_0x4eebe0(0xd6)]);console[_0x4eebe0(0xee)](_0x594cc8[_0x4eebe0(0x9a)]);const _0x43fa66=await getPluginInfo(_0x594cc8[_0x4eebe0(0xdf)]);if(_0x43fa66){const _0x7d9d1f=_0x43fa66['scope']||_0x594cc8[_0x4eebe0(0xb7)],_0x172243=_0x43fa66['enabled']?'enabled':_0x4eebe0(0xb0);console['log']('\x20\x20'+bold(_0x594cc8['gtmzN'])+':\x20installed\x20('+_0x7d9d1f+',\x20'+_0x172243+')');}else console['log']('\x20\x20Not\x20installed'),console['log'](_0x4eebe0(0xba));console[_0x4eebe0(0xee)](_0x594cc8['bpyMG']);const {project:_0x5ccbeb,user:_0x3064cc}=await _0x594cc8['MqzuH'](getInstalledSkills),_0x127483=_0x5ccbeb['filter'](_0x442ccf=>RANGER_MANAGED_SKILLS['includes'](_0x442ccf[_0x4eebe0(0xa0)])),_0x12cae3=_0x3064cc['filter'](_0x588dea=>RANGER_MANAGED_SKILLS[_0x4eebe0(0xbb)](_0x588dea[_0x4eebe0(0xa0)])),_0x4033e5=_0x127483['length']+_0x12cae3['length'];if(_0x594cc8['gkPsy'](_0x4033e5,0x0))console[_0x4eebe0(0xee)](_0x594cc8['osXkZ']),console['log']('\x20\x20Run:\x20ranger\x20skillup');else{if(_0x127483[_0x4eebe0(0x94)]>0x0){console[_0x4eebe0(0xee)](_0x594cc8[_0x4eebe0(0xdd)]);for(const _0x4624c2 of _0x127483){console['log']('\x20\x20\x20\x20'+bold(_0x4624c2['displayName'])+':\x20'+link(_0x4624c2['path'],_0x594cc8[_0x4eebe0(0x9b)](basename,_0x4624c2[_0x4eebe0(0x98)])));}}if(_0x12cae3[_0x4eebe0(0x94)]>0x0){console['log'](_0x594cc8['QEWxW']);for(const _0x4a4a16 of _0x12cae3){console[_0x4eebe0(0xee)]('\x20\x20\x20\x20'+_0x594cc8[_0x4eebe0(0xc2)](bold,_0x4a4a16[_0x4eebe0(0xdc)])+':\x20'+link(_0x4a4a16['path'],basename(_0x4a4a16[_0x4eebe0(0x98)])));}}}console['log'](_0x4eebe0(0xb9));const {envs:_0x4acac0,activeEnv:_0x576e7f}=await _0x594cc8['Sixhn'](getEnvironments);let _0x5e091a=[];if(_0x2e56a3)try{_0x5e091a=await listCloudProfiles();}catch{}const _0x43ef3b=_0x594cc8['Rqqxi'](_0x4acac0['length'],_0x5e091a['length']);if(_0x43ef3b===0x0)console[_0x4eebe0(0xee)](_0x4eebe0(0xf7)),console['log']('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{if(_0x594cc8['lOEgq'](_0x43ef3b,0x5)){const _0xf0d6f4=[];_0x594cc8[_0x4eebe0(0x97)](_0x5e091a[_0x4eebe0(0x94)],0x0)&&_0xf0d6f4[_0x4eebe0(0xde)](_0x5e091a['length']+_0x4eebe0(0xeb)),_0x594cc8[_0x4eebe0(0xf9)](_0x4acac0['length'],0x0)&&_0xf0d6f4[_0x4eebe0(0xde)](_0x4acac0[_0x4eebe0(0x94)]+_0x4eebe0(0xc1)),console['log'](_0x43ef3b+_0x4eebe0(0xb4)+_0xf0d6f4['join'](',\x20')+')'),_0x576e7f&&console['log'](_0x4eebe0(0xc7)+_0x594cc8['kmOyh'](bold,_0x576e7f)),console[_0x4eebe0(0xee)](_0x4eebe0(0xe4));}else{for(const _0x548deb of _0x5e091a){const _0x289cb5=_0x548deb[_0x4eebe0(0xa0)]===_0x576e7f?_0x4eebe0(0xa6):'';console[_0x4eebe0(0xee)]('\x20\x20'+_0x594cc8['kMtah'](bold,_0x548deb[_0x4eebe0(0xa0)])+_0x4eebe0(0xf0)+_0x289cb5);const _0x44e889=_0x548deb['sessionUpdatedAt']?'cached\x20(updated\x20'+_0x548deb['sessionUpdatedAt']+')':_0x594cc8[_0x4eebe0(0xa7)];console['log']('\x20\x20\x20\x20Session:\x20'+_0x44e889);}const _0x3d284e=new Set(_0x5e091a['map'](_0x57ee8b=>_0x57ee8b[_0x4eebe0(0xa0)]));for(const _0x5c5c93 of _0x4acac0){if(_0x3d284e['has'](_0x5c5c93[_0x4eebe0(0xa0)]))continue;const _0x54dab4=_0x5c5c93['isActive']?'\x20(active)':'',_0x2240a8=_0x5c5c93['hasEncryptedAuth']?_0x594cc8[_0x4eebe0(0x9e)]:_0x5c5c93[_0x4eebe0(0xe8)]?_0x594cc8['icvUO']:'none';console['log']('\x20\x20'+_0x594cc8[_0x4eebe0(0x90)](bold,_0x5c5c93['name'])+_0x4eebe0(0xd2)+_0x54dab4),console['log'](_0x4eebe0(0xd3)+_0x2240a8),_0x5c5c93['settingsPath']!==_0x594cc8[_0x4eebe0(0xed)]&&console['log']('\x20\x20\x20\x20Settings:\x20'+_0x594cc8[_0x4eebe0(0xe1)](link,_0x5c5c93[_0x4eebe0(0xaf)],basename(_0x5c5c93['settingsPath'])));}if(!_0x576e7f){console['log']('\x0a\x20\x20No\x20active\x20profile\x20set');const _0x289d91=[..._0x5e091a[_0x4eebe0(0xe9)](_0x1da9fb=>_0x1da9fb[_0x4eebe0(0xa0)]),..._0x4acac0['filter'](_0x20d640=>!_0x3d284e[_0x4eebe0(0xb2)](_0x20d640['name']))[_0x4eebe0(0xe9)](_0x4d225c=>_0x4d225c[_0x4eebe0(0xa0)])];console['log'](_0x4eebe0(0x9d)+_0x289d91['join'](',\x20')+')');}}}console[_0x4eebe0(0xee)]('');}
|
|
1
|
+
const _0x441778=_0x5a81;(function(_0x33e25b,_0x14716e){const _0x6c97a7=_0x5a81,_0x5d32aa=_0x33e25b();while(!![]){try{const _0x11477d=-parseInt(_0x6c97a7(0xd7))/0x1*(-parseInt(_0x6c97a7(0xed))/0x2)+parseInt(_0x6c97a7(0xe0))/0x3*(parseInt(_0x6c97a7(0xde))/0x4)+-parseInt(_0x6c97a7(0x9f))/0x5+-parseInt(_0x6c97a7(0xc8))/0x6+parseInt(_0x6c97a7(0xcb))/0x7+parseInt(_0x6c97a7(0xd8))/0x8+-parseInt(_0x6c97a7(0xfc))/0x9;if(_0x11477d===_0x14716e)break;else _0x5d32aa['push'](_0x5d32aa['shift']());}catch(_0x367642){_0x5d32aa['push'](_0x5d32aa['shift']());}}}(_0x2d01,0x34791));import{readFile,readdir}from'fs/promises';function _0x5a81(_0x18a1f6,_0x4a5f6a){_0x18a1f6=_0x18a1f6-0x95;const _0x2d0156=_0x2d01();let _0x5a81a7=_0x2d0156[_0x18a1f6];return _0x5a81a7;}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';function _0x2d01(){const _0x5ad449=['1HEzJpb','64312kglKnv','\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','parse','KwvLA','RFKhj','zPESP','1379120bDPqHA','not_configured','3HALwem','path','length','\x20[local]','VorED','log','\x20\x20\x20\x20Settings:\x20','\x1b[1m','displayName','hasPlaintextAuth','KlDgb','\x0a\x20\x20No\x20active\x20profile\x20set','kARfz','416722rMJLCm','opencode-plugin','env','\x1b]8;;file://','\x0a---\x20Skills\x20---','QbDBh','\x20plugin(s)\x20configured','JfnLD','zwicn','encrypted','MsqlM','auth.json.enc','hmCkQ','Version:\x20','error','287190gFPmsK','settingsPath','WxoKr','\x20\x20Run:\x20ranger\x20skillup',':\x20installed\x20(','ignore','DEBUG','gmYop','CFKwS','API\x20Environment:\x20','plugin','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','\x20\x20\x20\x20','auth.json','scope','mXNrk','1084875HWDMdM','plaintext','match','\x20\x20User-level:','\x20\x20Active:\x20','not_installed','string','jdikv','VWZDX','jZRDx','\x20(up\x20to\x20date)','\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a','sessionUpdatedAt','ApFWw','jQXOI','organizationName','\x20[cloud]','buIXW','jehaH','@ranger-testing/opencode-plugin','join','trim','Root:\x20','user','wTdyJ','\x20profiles\x20configured\x20(','filter','utf-8','DMRQf','configured','unknown','details','dYizZ','nxwju','no\x20session','some','name','(not\x20found)','pipe','isArray','ppdtj','1426014oXizod','\x0a---\x20OpenCode\x20Plugin\x20---','Organization:\x20','982121bCnqfw','status','hbGIH','map','\x20\x20Run:\x20ranger\x20setup\x20[token]','stdout','push','fbQFs','bOTkx','\x0a---\x20Profiles\x20---','\x1b]8;;\x07','\x20\x20Not\x20configured'];_0x2d01=function(){return _0x5ad449;};return _0x2d01();}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=_0x432747=>_0x441778(0xe7)+_0x432747+'\x1b[0m',link=(_0x2c6ed9,_0x53e99a)=>_0x441778(0xf0)+_0x2c6ed9+'\x07'+(_0x53e99a||_0x2c6ed9)+_0x441778(0xd5);async function getOpencodePluginStatus(){const _0x86ee7c=_0x441778,_0x10bc50={'CddIJ':_0x86ee7c(0xa5),'gmYop':_0x86ee7c(0xbc),'zwicn':function(_0x19ad17,_0x1623fa){return _0x19ad17>_0x1623fa;},'dQYDJ':'not_configured','tVwTi':function(_0x5c5400,_0x38bb73,_0x3d6d0e,_0x41d7d0){return _0x5c5400(_0x38bb73,_0x3d6d0e,_0x41d7d0);},'XGLBO':'config','CFKwS':_0x86ee7c(0x101),'nxwju':'pipe'};return new Promise(_0x5b7643=>{const _0x29f0d5=_0x86ee7c,_0x300be7={'QbDBh':function(_0x219832,_0x261ed5){return _0x219832(_0x261ed5);},'RyPYz':_0x10bc50['CddIJ'],'hmCkQ':_0x29f0d5(0xee),'vKpxl':function(_0x5c89f5,_0x302f68){return _0x5c89f5!==_0x302f68;},'eKoTZ':_0x10bc50[_0x29f0d5(0x96)],'jZRDx':function(_0x529ff8,_0x5944dc){const _0x147b0a=_0x29f0d5;return _0x10bc50[_0x147b0a(0xf5)](_0x529ff8,_0x5944dc);},'zmNlm':_0x10bc50['dQYDJ']},_0x1957ea=_0x10bc50['tVwTi'](spawn,'opencode',['debug',_0x10bc50['XGLBO']],{'stdio':[_0x10bc50[_0x29f0d5(0x97)],_0x29f0d5(0xc5),_0x10bc50[_0x29f0d5(0xc0)]]});let _0x2f28d3='';_0x1957ea[_0x29f0d5(0xd0)]?.['on']('data',_0x3afc4f=>{_0x2f28d3+=_0x3afc4f['toString']();}),_0x1957ea['stderr']?.['on']('data',_0x484ef2=>{_0x2f28d3+=_0x484ef2['toString']();}),_0x1957ea['on'](_0x29f0d5(0xfb),()=>{const _0x2a2f19=_0x29f0d5;_0x300be7[_0x2a2f19(0xf2)](_0x5b7643,{'status':'not_installed'});}),_0x1957ea['on']('close',_0x3a41f6=>{const _0x496f4d=_0x29f0d5;if(_0x300be7['vKpxl'](_0x3a41f6,0x0)){_0x5b7643({'status':_0x496f4d(0xa4)});return;}const _0x9f2553=_0x2f28d3[_0x496f4d(0xb4)]();let _0x47c3a9=null;if(_0x9f2553)try{_0x47c3a9=JSON[_0x496f4d(0xda)](_0x9f2553);}catch{const _0x1883a1=_0x9f2553[_0x496f4d(0xa1)](/\{[\s\S]*\}$/);if(_0x1883a1)try{_0x47c3a9=JSON['parse'](_0x1883a1[0x0]);}catch{_0x47c3a9=null;}}const _0x59d984=Array[_0x496f4d(0xc6)](_0x47c3a9?.[_0x496f4d(0x99)])?_0x47c3a9?.[_0x496f4d(0x99)]:[],_0x67f58=_0x59d984[_0x496f4d(0xc2)](_0x241067=>{const _0x45c33d=_0x496f4d;if(typeof _0x241067!==_0x300be7['RyPYz'])return![];return _0x241067['includes'](_0x45c33d(0xb2))||_0x241067['includes'](_0x300be7[_0x45c33d(0xf9)]);});if(_0x67f58){_0x5b7643({'status':_0x300be7['eKoTZ'],'details':_0x59d984[_0x496f4d(0xe2)]>0x0?_0x59d984[_0x496f4d(0xe2)]+_0x496f4d(0xf3):undefined});return;}if(_0x300be7[_0x496f4d(0xa8)](_0x59d984[_0x496f4d(0xe2)],0x0)){_0x300be7['QbDBh'](_0x5b7643,{'status':_0x300be7['zmNlm'],'details':_0x59d984[_0x496f4d(0xe2)]+'\x20plugin(s)\x20configured'});return;}_0x300be7['QbDBh'](_0x5b7643,{'status':_0x300be7['zmNlm']});});});}async function getSkillsFromDir(_0x31152b,_0x4be3e1){const _0x57f072=_0x441778,_0x9750dd={'Zalry':function(_0x54fc3a,_0x2c7810){return _0x54fc3a(_0x2c7810);},'hbGIH':function(_0x5ecf73,_0xc5410b,_0x328415){return _0x5ecf73(_0xc5410b,_0x328415);},'KlDgb':'SKILL.md','liKzT':function(_0xe69453,_0x38fad6,_0x6f84da){return _0xe69453(_0x38fad6,_0x6f84da);}};if(!_0x9750dd['Zalry'](existsSync,_0x31152b))return[];const _0x53f075=[];try{const _0x58259f=await _0x9750dd[_0x57f072(0xcd)](readdir,_0x31152b,{'withFileTypes':!![]});for(const _0x4aea4b of _0x58259f){if(_0x4aea4b['isDirectory']()){const _0x3557f9=join(_0x31152b,_0x4aea4b[_0x57f072(0xc3)],_0x9750dd[_0x57f072(0xea)]);if(existsSync(_0x3557f9)){let _0x29b5d3=_0x4aea4b[_0x57f072(0xc3)];try{const _0x491fdd=await _0x9750dd['liKzT'](readFile,_0x3557f9,_0x57f072(0xba)),_0x5a6a0b=_0x491fdd['match'](/name:\s*(.+)/);_0x5a6a0b&&(_0x29b5d3=_0x5a6a0b[0x1][_0x57f072(0xb4)]());}catch{}_0x53f075[_0x57f072(0xd1)]({'name':_0x4aea4b[_0x57f072(0xc3)],'displayName':_0x29b5d3,'path':_0x3557f9,'level':_0x4be3e1});}}}}catch{return[];}return _0x53f075;}async function getInstalledSkills(){const _0x2d0afa=_0x441778,_0x58f1ad={'Esmps':function(_0x570a36,_0x54c0ec,_0x221976){return _0x570a36(_0x54c0ec,_0x221976);},'bOTkx':_0x2d0afa(0xb6)},[_0x1acad0,_0x4c2f59]=await Promise['all']([getSkillsFromDir(getProjectSkillsDir(),'project'),_0x58f1ad['Esmps'](getSkillsFromDir,getUserSkillsDir(),_0x58f1ad[_0x2d0afa(0xd3)])]);return{'project':_0x1acad0,'user':_0x4c2f59};}async function getEnvironments(){const _0xc2a17e=_0x441778,_0x205dde={'fbQFs':'settings.json','hmDrK':function(_0x1f7f84,_0x4f9bb5,_0x21fba6){return _0x1f7f84(_0x4f9bb5,_0x21fba6);},'mXNrk':_0xc2a17e(0x9c),'KArtF':function(_0x5edee8,_0x2ed65,_0x20de80){return _0x5edee8(_0x2ed65,_0x20de80);},'DMRQf':function(_0x2706a2,_0x380bcc){return _0x2706a2(_0x380bcc);},'VWZDX':_0xc2a17e(0xc4),'UBYSI':function(_0x2a63f4,_0x194cc2){return _0x2a63f4===_0x194cc2;},'KukAl':function(_0xfc00b0){return _0xfc00b0();}},{envNames:_0x3bfc6c,activeEnv:_0x404484}=await _0x205dde['KukAl'](getEnvNames),_0x17eb62=_0x205dde['KukAl'](getRangerDir);if(!existsSync(_0x17eb62))return{'envs':[],'activeEnv':null};const _0x58170b=_0x3bfc6c['map'](_0x707927=>{const _0xcd7f40=_0xc2a17e,_0x71cd81=getEnvDir(_0x707927),_0x1fe6b8=join(_0x71cd81,_0x205dde[_0xcd7f40(0xd2)]),_0x38f54c=_0x205dde['hmDrK'](join,_0x71cd81,_0x205dde[_0xcd7f40(0x9e)]),_0x484a6e=_0x205dde['KArtF'](join,_0x71cd81,_0xcd7f40(0xf8));return{'name':_0x707927,'settingsPath':_0x205dde['DMRQf'](existsSync,_0x1fe6b8)?_0x1fe6b8:_0x205dde[_0xcd7f40(0xa7)],'hasPlaintextAuth':_0x205dde[_0xcd7f40(0xbb)](existsSync,_0x38f54c),'hasEncryptedAuth':existsSync(_0x484a6e),'isActive':_0x205dde['UBYSI'](_0x707927,_0x404484)};});return{'envs':_0x58170b,'activeEnv':_0x404484};}export async function status(){const _0x1422cf=_0x441778,_0x580c4f={'VorED':function(_0x4e93d2){return _0x4e93d2();},'jdikv':function(_0x5a3979,_0x3e705a){return _0x5a3979(_0x3e705a);},'JFieX':function(_0x2f6d04,_0x19193b,_0x4cc4ea){return _0x2f6d04(_0x19193b,_0x4cc4ea);},'OvJTX':function(_0x3de39c,_0x33fb6d){return _0x3de39c(_0x33fb6d);},'buIXW':function(_0x37a381,_0xef2583){return _0x37a381(_0xef2583);},'nfQPk':_0x1422cf(0xc9),'RFKhj':function(_0x4822bb,_0x11022e){return _0x4822bb===_0x11022e;},'dYizZ':function(_0x34f9cc,_0x7080fc){return _0x34f9cc(_0x7080fc);},'qjxAi':_0x1422cf(0xdf),'ApFWw':_0x1422cf(0xd6),'szHSv':_0x1422cf(0xd9),'ppdtj':'ranger@trailhead','wTdyJ':_0x1422cf(0xbd),'ChQAm':'enabled','oRdMt':function(_0xd8dcf9,_0x5eff66){return _0xd8dcf9(_0x5eff66);},'zPESP':function(_0xa28206){return _0xa28206();},'WxoKr':function(_0x1188f7,_0x2a572e){return _0x1188f7+_0x2a572e;},'uROhJ':function(_0x4b9b0a,_0x245ac6){return _0x4b9b0a===_0x245ac6;},'jQXOI':function(_0x4a6134,_0x4504c8){return _0x4a6134>_0x4504c8;},'RqaiS':'\x20\x20Project-level:','yHiiT':function(_0x4b50be,_0x1b66a7){return _0x4b50be(_0x1b66a7);},'wJeAS':function(_0x2bf6d9,_0x5235b2,_0x15aa24){return _0x2bf6d9(_0x5235b2,_0x15aa24);},'JfnLD':function(_0x235866,_0x1b4690,_0x2990c2){return _0x235866(_0x1b4690,_0x2990c2);},'KwvLA':function(_0x4b04ab,_0x331912){return _0x4b04ab(_0x331912);},'UeVuW':_0x1422cf(0xd4),'DjsdD':function(_0x4f1297,_0x225780){return _0x4f1297===_0x225780;},'MsqlM':_0x1422cf(0xc1),'jehaH':_0x1422cf(0xa0),'kARfz':_0x1422cf(0xc4)};console[_0x1422cf(0xe5)]('\x0a📊\x20Ranger\x20Status\x0a');const _0x29a6d7=process['cwd'](),_0xe9007e=_0x580c4f[_0x1422cf(0xe4)](getRangerDir);if(!_0x580c4f[_0x1422cf(0xa6)](existsSync,_0xe9007e)){console['log']('Root:\x20'+_0x580c4f['JFieX'](link,_0x29a6d7,bold(basename(_0x29a6d7)))),console['log'](_0x1422cf(0x9a)),console[_0x1422cf(0xe5)](_0x1422cf(0xaa));return;}console['log'](_0x1422cf(0xb5)+link(_0x29a6d7,bold(_0x580c4f['OvJTX'](basename,_0x29a6d7))));const _0x45a046=_0x580c4f['VorED'](getCurrentVersion),_0xd03797=getLatestVersion();if(_0xd03797['version']&&_0xd03797['version']!==_0x45a046)console[_0x1422cf(0xe5)]('Version:\x20'+_0x45a046+'\x20(latest:\x20'+_0xd03797['version']+')'),console['log']('\x20\x20Run:\x20ranger\x20update');else _0xd03797['version']?console[_0x1422cf(0xe5)](_0x1422cf(0xfa)+_0x45a046+_0x1422cf(0xa9)):console[_0x1422cf(0xe5)]('Version:\x20'+_0x45a046);const _0xbc326d=await _0x580c4f[_0x1422cf(0xe4)](getToken);if(_0xbc326d){const _0x29cd96=await _0x580c4f[_0x1422cf(0xb0)](getCurrentUser,_0xbc326d);_0x29cd96['success']?console[_0x1422cf(0xe5)](_0x1422cf(0xca)+bold(_0x29cd96[_0x1422cf(0xb6)][_0x1422cf(0xae)])):(console[_0x1422cf(0xe5)]('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console['log'](_0x1422cf(0xcf)));}else console['log']('API\x20Token:\x20✗\x20Not\x20found'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]');process[_0x1422cf(0xef)][_0x1422cf(0x95)]&&(console[_0x1422cf(0xe5)](_0x1422cf(0x98)+getCurrentEnvironment()),console['log']('API\x20URL:\x20'+_0x580c4f[_0x1422cf(0xe4)](getApiBaseUrl)));console['log'](_0x580c4f['nfQPk']);const _0x5c2830=await getOpencodePluginStatus();if(_0x580c4f[_0x1422cf(0xdc)](_0x5c2830[_0x1422cf(0xcc)],'configured'))console[_0x1422cf(0xe5)]('\x20\x20'+_0x580c4f[_0x1422cf(0xbf)](bold,'@ranger-testing/opencode-plugin')+':\x20configured'),_0x5c2830[_0x1422cf(0xbe)]&&console['log']('\x20\x20'+_0x5c2830['details']);else _0x5c2830['status']===_0x580c4f['qjxAi']?(console['log'](_0x580c4f[_0x1422cf(0xac)]),_0x5c2830['details']&&console[_0x1422cf(0xe5)]('\x20\x20'+_0x5c2830['details']),console['log']('\x20\x20Run:\x20ranger\x20setup\x20--opencode')):console[_0x1422cf(0xe5)](_0x580c4f['szHSv']);console[_0x1422cf(0xe5)]('\x0a---\x20Claude\x20Code\x20Plugin\x20---');const _0x29e434=await _0x580c4f['dYizZ'](getPluginInfo,_0x580c4f[_0x1422cf(0xc7)]);if(_0x29e434){const _0x1dc86a=_0x29e434[_0x1422cf(0x9d)]||_0x580c4f[_0x1422cf(0xb7)],_0x281588=_0x29e434['enabled']?_0x580c4f['ChQAm']:'disabled';console[_0x1422cf(0xe5)]('\x20\x20'+_0x580c4f['oRdMt'](bold,_0x580c4f['ppdtj'])+_0x1422cf(0x100)+_0x1dc86a+',\x20'+_0x281588+')');}else console['log']('\x20\x20Not\x20installed'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)');console[_0x1422cf(0xe5)](_0x1422cf(0xf1));const {project:_0x5c108b,user:_0x5961b9}=await _0x580c4f[_0x1422cf(0xdd)](getInstalledSkills),_0x2c8d52=_0x5c108b[_0x1422cf(0xb9)](_0x4dec12=>RANGER_MANAGED_SKILLS['includes'](_0x4dec12[_0x1422cf(0xc3)])),_0x36c571=_0x5961b9[_0x1422cf(0xb9)](_0x5d6bbd=>RANGER_MANAGED_SKILLS['includes'](_0x5d6bbd['name'])),_0x3d0270=_0x580c4f[_0x1422cf(0xfe)](_0x2c8d52['length'],_0x36c571['length']);if(_0x580c4f['uROhJ'](_0x3d0270,0x0))console[_0x1422cf(0xe5)]('No\x20skills\x20installed'),console['log'](_0x1422cf(0xff));else{if(_0x580c4f[_0x1422cf(0xad)](_0x2c8d52['length'],0x0)){console[_0x1422cf(0xe5)](_0x580c4f['RqaiS']);for(const _0xbbbd13 of _0x2c8d52){console[_0x1422cf(0xe5)](_0x1422cf(0x9b)+_0x580c4f['yHiiT'](bold,_0xbbbd13[_0x1422cf(0xe8)])+':\x20'+_0x580c4f['wJeAS'](link,_0xbbbd13['path'],basename(_0xbbbd13[_0x1422cf(0xe1)])));}}if(_0x36c571['length']>0x0){console['log'](_0x1422cf(0xa2));for(const _0xdbe090 of _0x36c571){console['log'](_0x1422cf(0x9b)+bold(_0xdbe090['displayName'])+':\x20'+_0x580c4f[_0x1422cf(0xf4)](link,_0xdbe090[_0x1422cf(0xe1)],_0x580c4f[_0x1422cf(0xdb)](basename,_0xdbe090['path'])));}}}console['log'](_0x580c4f['UeVuW']);const {envs:_0x775be1,activeEnv:_0x3a38c8}=await getEnvironments();let _0x3c2cc3=[];if(_0xbc326d)try{_0x3c2cc3=await listCloudProfiles();}catch{}const _0x466bb8=_0x775be1['length']+_0x3c2cc3[_0x1422cf(0xe2)];if(_0x580c4f['DjsdD'](_0x466bb8,0x0))console['log']('No\x20profiles\x20configured'),console[_0x1422cf(0xe5)]('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{if(_0x466bb8>0x5){const _0x470464=[];_0x3c2cc3['length']>0x0&&_0x470464[_0x1422cf(0xd1)](_0x3c2cc3['length']+'\x20cloud'),_0x775be1[_0x1422cf(0xe2)]>0x0&&_0x470464['push'](_0x775be1[_0x1422cf(0xe2)]+'\x20local'),console['log'](_0x466bb8+_0x1422cf(0xb8)+_0x470464['join'](',\x20')+')'),_0x3a38c8&&console[_0x1422cf(0xe5)](_0x1422cf(0xa3)+bold(_0x3a38c8)),console['log']('\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)');}else{for(const _0x1a4440 of _0x3c2cc3){const _0x495d06=_0x580c4f['DjsdD'](_0x1a4440[_0x1422cf(0xc3)],_0x3a38c8)?'\x20(active)':'';console[_0x1422cf(0xe5)]('\x20\x20'+bold(_0x1a4440[_0x1422cf(0xc3)])+_0x1422cf(0xaf)+_0x495d06);const _0x294389=_0x1a4440[_0x1422cf(0xab)]?'cached\x20(updated\x20'+_0x1a4440['sessionUpdatedAt']+')':_0x580c4f[_0x1422cf(0xf7)];console[_0x1422cf(0xe5)]('\x20\x20\x20\x20Session:\x20'+_0x294389);}const _0x12b17c=new Set(_0x3c2cc3[_0x1422cf(0xce)](_0x50b6c0=>_0x50b6c0['name']));for(const _0x56afce of _0x775be1){if(_0x12b17c['has'](_0x56afce['name']))continue;const _0x3f640d=_0x56afce['isActive']?'\x20(active)':'',_0xc441a7=_0x56afce['hasEncryptedAuth']?_0x1422cf(0xf6):_0x56afce[_0x1422cf(0xe9)]?_0x580c4f[_0x1422cf(0xb1)]:'none';console[_0x1422cf(0xe5)]('\x20\x20'+bold(_0x56afce['name'])+_0x1422cf(0xe3)+_0x3f640d),console['log']('\x20\x20\x20\x20Auth:\x20'+_0xc441a7),_0x56afce['settingsPath']!==_0x580c4f[_0x1422cf(0xec)]&&console['log'](_0x1422cf(0xe6)+_0x580c4f['JfnLD'](link,_0x56afce[_0x1422cf(0xfd)],basename(_0x56afce[_0x1422cf(0xfd)])));}if(!_0x3a38c8){console[_0x1422cf(0xe5)](_0x1422cf(0xeb));const _0x517954=[..._0x3c2cc3[_0x1422cf(0xce)](_0x12bcae=>_0x12bcae['name']),..._0x775be1['filter'](_0x1f3942=>!_0x12b17c['has'](_0x1f3942[_0x1422cf(0xc3)]))['map'](_0x40a1c0=>_0x40a1c0[_0x1422cf(0xc3)])];console['log']('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x517954[_0x1422cf(0xb3)](',\x20')+')');}}}console[_0x1422cf(0xe5)]('');}
|