@ranger-testing/ranger-cli 2.5.4-alpha.0e8b82c-9 → 2.5.4-alpha.1d983c3-19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -14
- package/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/migrateProfile.js +1 -1
- package/build/commands/setup/claude.js +1 -1
- package/build/commands/setup/opencode.js +1 -1
- package/build/commands/setupCi.js +1 -1
- package/build/commands/skillup.js +1 -1
- package/build/commands/start.js +1 -1
- package/build/commands/status.js +1 -1
- package/build/commands/update.js +1 -1
- package/build/commands/updateEnv.js +1 -1
- package/build/commands/useEnv.js +1 -1
- package/build/commands/utils/activeProfile.js +1 -1
- package/build/commands/utils/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/cloudProfile.js +1 -1
- package/build/commands/utils/cloudProfileSession.js +1 -1
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/gitTracked.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/legacyWarning.js +1 -0
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/matchAuthEnvironment.js +1 -1
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/opencodeConfig.js +1 -1
- package/build/commands/utils/playwrightCli.js +1 -1
- package/build/commands/utils/profileMessages.js +1 -1
- package/build/commands/utils/profileSetupBanner.js +1 -1
- package/build/commands/utils/projectsConfig.js +1 -1
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/resolveProfileContext.js +1 -1
- package/build/commands/utils/resolveProfileUrl.js +1 -1
- package/build/commands/utils/retry.js +1 -1
- package/build/commands/utils/sessionCache.js +1 -1
- package/build/commands/utils/settings.js +1 -1
- package/build/commands/utils/skillContent.js +1 -1
- package/build/commands/utils/skills.js +1 -1
- package/build/commands/utils/stitchWebmFiles.js +1 -1
- package/build/commands/utils/telemetry.js +1 -1
- package/build/commands/utils/tokenRefresh.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -1
- package/build/commands/utils/userApi.js +1 -1
- package/build/commands/utils/version.js +1 -1
- package/build/commands/verifyFeature.js +1 -1
- package/build/commands/verifyFeatureCli.js +1 -1
- package/build/skills/ranger/SKILL.md +24 -8
- package/build/skills/ranger/create.md +16 -3
- package/build/skills/ranger/verify.md +35 -10
- package/package.json +3 -2
package/build/commands/login.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x467961,_0x75e23e){const _0xb95bee=_0x3b5d,_0x31ec9b=_0x467961();while(!![]){try{const _0x1114c2=parseInt(_0xb95bee(0x139))/0x1*(-parseInt(_0xb95bee(0x13e))/0x2)+parseInt(_0xb95bee(0x133))/0x3+parseInt(_0xb95bee(0x135))/0x4+parseInt(_0xb95bee(0x140))/0x5+-parseInt(_0xb95bee(0x136))/0x6*(parseInt(_0xb95bee(0x13a))/0x7)+-parseInt(_0xb95bee(0x130))/0x8+-parseInt(_0xb95bee(0x13f))/0x9;if(_0x1114c2===_0x75e23e)break;else _0x31ec9b['push'](_0x31ec9b['shift']());}catch(_0x5d448c){_0x31ec9b['push'](_0x31ec9b['shift']());}}}(_0x48f0,0x5270d));function _0x48f0(){const _0x2d37f5=['isTTY','1560312KOLbaj','\x0a✅\x20API\x20key\x20stored\x20successfully','2047292RLZElX','12198fNVKqe','wxGLf','\x0a✅\x20Logged\x20in\x20to\x20','3ZvRJcQ','161vbpWfF','UXRaD','success','log','7246xdzLbI','4295664PlxwcV','1912550FxBity','Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','4334688mBcZCJ','stdout'];_0x48f0=function(){return _0x2d37f5;};return _0x48f0();}function _0x3b5d(_0x8f58ee,_0x45dd39){_0x8f58ee=_0x8f58ee-0x130;const _0x48f035=_0x48f0();let _0x3b5dbf=_0x48f035[_0x8f58ee];return _0x3b5dbf;}import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';export async function login(){const _0x3114d0=_0x3b5d,_0x558f74={'wxGLf':function(_0x519a49){return _0x519a49();},'UXRaD':function(_0x50a6f8,_0x52aa92){return _0x50a6f8(_0x52aa92);},'bKQtV':_0x3114d0(0x134)},_0x37203e=await getMcpAuthOrigin();if(_0x37203e){console[_0x3114d0(0x13d)]('Re-authenticating\x20via\x20MCP\x20bootstrap...'),await mcpBootstrap();return;}const _0x2f31cf=process['stdin']['isTTY']&&process[_0x3114d0(0x131)][_0x3114d0(0x132)];if(!_0x2f31cf)throw new Error(_0x3114d0(0x141));try{const _0x57d465=await _0x558f74[_0x3114d0(0x137)](runDeviceAuthFlow),_0x193336=await _0x558f74[_0x3114d0(0x13b)](getCurrentUser,_0x57d465);_0x193336[_0x3114d0(0x13c)]?console['log'](_0x3114d0(0x138)+_0x193336['user']['organizationName']):console['log'](_0x558f74['bKQtV']);}catch(_0x2de72d){throw new Error('Login\x20failed:\x20'+(_0x2de72d instanceof Error?_0x2de72d['message']:_0x2de72d));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x84d7(_0x4d3b1f,_0x36044c){_0x4d3b1f=_0x4d3b1f-0x1cf;const _0x7a23d5=_0x7a23();let _0x84d7e3=_0x7a23d5[_0x4d3b1f];return _0x84d7e3;}const _0x30785e=_0x84d7;function _0x7a23(){const _0x3a8f42=['Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','ovZgQ','\x20done','OxaVY','CbBfA','.ranger','MapMx','HTTP\x20','XBFYk','Initializing\x20MCP\x20session...','OtCIc','aQMPl','initialize','refresh_token','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','client_secret','log','mhUdm','iAMND','child_process','toString','NfXwq','ranger-cli','LohGH','isError','\x0aUnexpected\x20response\x20structure:','NQATg','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','error_description','get_cli_token','text/event-stream','now','MCP\x20initialize\x20failed:\x20','ssLKR','tKerN','2.0','144392wtvKTE','expires_in','win32','2025-03-26','6751107lJDcFn','Not\x20found','error','VCbrs','writeHead','NEaap','eEZPy','dXXlI','Token\x20exchange\x20failed:\x20','auth-origin.txt','kIiUB','iTEAe','application/json','/callback','\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','\x0aToken\x20written\x20to\x20','1660NuLRYH','stdout','swyPI','Discovering\x20authorization\x20server...','resource','authorization_endpoint','platform','dYJtR','redirect_uri','Authorization','type','refreshToken','get','code','QHNxI','NcbcX','KOTFi','evfUi','Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20','text/html','XpGtg','then','status','1.0.0','trim','access_token','text','aAEeF','tkEma','update','url','IKGKX','BBIru','utf-8','proxied','wAiay','includes','jrpGC','nizey','9155tmlVPK','/.well-known/oauth-authorization-server','nNAoe','stringify','start','authorization_code','GIFId','pAOWh','1439310CLiEVs','write','faEqM','replace','base64url','http://localhost:','Nxamk','origin','pathname','vwbWa','client_id','response_type','authorization_servers','listen','ZqUtA','fxZoi','application/x-www-form-urlencoded','POST','token','clientId','message','clientSecret','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','aNHbp','token_endpoint','searchParams','data:','469lsIchr','25980410LnEZMv','state','TVRTf','accessToken','Ranger\x20CLI','754452ByJMnh','json','lHKBO','expiresAt','62BFEhpD','Irlsl','lBwqw','length','close','application/json,\x20text/event-stream','dZlps','oxUQL','HmhLx','slice','registration_endpoint','GzwGj','Client\x20registration\x20failed:\x20','20521VHtgJQ','set'];_0x7a23=function(){return _0x3a8f42;};return _0x7a23();}(function(_0x2dc62d,_0x540877){const _0x1df598=_0x84d7,_0x32223f=_0x2dc62d();while(!![]){try{const _0x33a55d=-parseInt(_0x1df598(0x1e1))/0x1*(-parseInt(_0x1df598(0x1d4))/0x2)+parseInt(_0x1df598(0x1d0))/0x3+-parseInt(_0x1df598(0x21b))/0x4*(-parseInt(_0x1df598(0x242))/0x5)+-parseInt(_0x1df598(0x24a))/0x6+-parseInt(_0x1df598(0x265))/0x7*(-parseInt(_0x1df598(0x207))/0x8)+parseInt(_0x1df598(0x20b))/0x9+-parseInt(_0x1df598(0x266))/0xa;if(_0x33a55d===_0x540877)break;else _0x32223f['push'](_0x32223f['shift']());}catch(_0x1efc75){_0x32223f['push'](_0x32223f['shift']());}}}(_0x7a23,0xbbbd4));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger','mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),'.ranger',_0x30785e(0x214));export async function getMcpAuthOrigin(){const _0x1b68a9=_0x30785e,_0x38cdbd={'YJUQu':function(_0x17b9cf,_0x21c812,_0x54d592){return _0x17b9cf(_0x21c812,_0x54d592);}};try{const _0x20ac34=(await _0x38cdbd['YJUQu'](readFile,AUTH_ORIGIN_PATH,_0x1b68a9(0x23c)))['trim']();return _0x20ac34||null;}catch{return null;}}export async function mcpBootstrap(){const _0x5a3e14=_0x30785e,_0x2db4fb={'XXtMZ':function(_0xd7f66c){return _0xd7f66c();},'aQMPl':function(_0x574b36,_0x436020){return _0x574b36===_0x436020;}},_0x3fd8b8=_0x2db4fb['XXtMZ'](getMcpAuthUrl);currentOrigin=_0x3fd8b8;const _0x222b24=process[_0x5a3e14(0x21c)]['isTTY']??![];console[_0x5a3e14(0x1f3)]('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x3fd8b8+'\x0a');const _0x51202c=await tryUnauthenticated(_0x3fd8b8);let _0x497106=null;if(_0x2db4fb[_0x5a3e14(0x1ee)](_0x51202c,_0x5a3e14(0x23d)))_0x497106='';else{_0x497106=await _0x2db4fb['XXtMZ'](loadCachedToken);if(!_0x497106){if(!_0x222b24)throw new Error('MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a'+_0x5a3e14(0x1f1));_0x497106=await oauthFlow(_0x3fd8b8);}}await callGetCliToken(_0x3fd8b8,_0x497106);}async function tryUnauthenticated(_0x3aa063){const _0x29a213=_0x30785e,_0x113aca={'EdBFQ':'POST','sBLnL':'application/json','QHNxI':_0x29a213(0x1d9),'OxaVY':_0x29a213(0x20a),'OtCIc':_0x29a213(0x1f9),'vwbWa':'proxied','SniDd':function(_0x139e25,_0x278abb){return _0x139e25===_0x278abb;},'wxRYQ':'needs-oauth'},_0x2a19de=await fetch(_0x3aa063,{'method':_0x113aca['EdBFQ'],'headers':{'Content-Type':_0x113aca['sBLnL'],'Accept':_0x113aca[_0x29a213(0x229)]},'body':JSON['stringify']({'jsonrpc':'2.0','id':0x1,'method':'initialize','params':{'protocolVersion':_0x113aca[_0x29a213(0x1e6)],'capabilities':{},'clientInfo':{'name':_0x113aca[_0x29a213(0x1ed)],'version':_0x29a213(0x232)}}})});if(_0x2a19de['ok'])return await _0x2a19de[_0x29a213(0x235)](),_0x113aca[_0x29a213(0x253)];if(_0x113aca['SniDd'](_0x2a19de['status'],0x191))return await _0x2a19de[_0x29a213(0x235)](),_0x113aca['wxRYQ'];const _0xa8a275=await _0x2a19de['text']();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x2a19de[_0x29a213(0x231)]+':\x20'+_0xa8a275);}class OAuthTimeoutError extends Error{constructor(_0x429cde){super(_0x429cde),this['name']='OAuthTimeoutError';}}async function oauthFlow(_0x33c5bb){const _0x204abe=_0x30785e,_0x16211f={'JcKbr':function(_0x99fd2c,_0xae2ac4){return _0x99fd2c(_0xae2ac4);},'KOTFi':function(_0x2e9d9c){return _0x2e9d9c();},'lHKBO':function(_0x3fb054,_0x28fafe){return _0x3fb054(_0x28fafe);}};try{return await _0x16211f['JcKbr'](oauthFlowAttempt,_0x33c5bb);}catch(_0x4770f9){if(_0x4770f9 instanceof OAuthTimeoutError&&await _0x16211f[_0x204abe(0x22b)](loadCachedClient))return console['log'](_0x204abe(0x219)),await clearCachedClient(),await _0x16211f[_0x204abe(0x1d2)](oauthFlowAttempt,_0x33c5bb);throw _0x4770f9;}}async function oauthFlowAttempt(_0x33772e){const _0x12d0cc=_0x30785e,_0x38ee59={'mhUdm':_0x12d0cc(0x21e),'aAEeF':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','UZzAa':'No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','FClVm':'Registering\x20OAuth\x20client...','uuEON':'POST','BqnkU':_0x12d0cc(0x217),'GIFId':_0x12d0cc(0x247),'aNHbp':'none','etsgo':_0x12d0cc(0x24e),'vPquK':'sha256','MapMx':function(_0x2c0bef,_0x7aac45){return _0x2c0bef(_0x7aac45);},'XCOWE':'hex','NQATg':_0x12d0cc(0x228),'UuODv':'code_challenge','IKGKX':'code_challenge_method','tKerN':function(_0x2bdb39,_0x3a0e48){return _0x2bdb39(_0x3a0e48);},'eEZPy':'Exchanging\x20authorization\x20code...','fxZoi':'resource','XpGtg':_0x12d0cc(0x1e5)},_0x4a8adf=_0x33772e[_0x12d0cc(0x24d)](/\/mcp$/,'');process['stdout']['write'](_0x38ee59[_0x12d0cc(0x1f4)]);const _0x233584=await fetch(_0x4a8adf+'/.well-known/oauth-protected-resource');if(!_0x233584['ok'])throw new Error(_0x38ee59[_0x12d0cc(0x236)]);const _0x221436=await _0x233584['json'](),_0x5bdcb0=_0x221436[_0x12d0cc(0x256)]?.[0x0];if(!_0x5bdcb0)throw new Error(_0x38ee59['UZzAa']);console[_0x12d0cc(0x1f3)]('\x20'+_0x5bdcb0);const _0x4084eb=await fetchAuthServerMetadata(_0x5bdcb0);let _0x2ae56b,_0x1684f5;const _0x5cd95a=await loadCachedClient();if(_0x5cd95a)_0x2ae56b=_0x5cd95a['clientId'],_0x1684f5=_0x5cd95a['clientSecret'];else{if(_0x4084eb[_0x12d0cc(0x1de)]){process[_0x12d0cc(0x21c)][_0x12d0cc(0x24b)](_0x38ee59['FClVm']);const _0x33b810=await fetch(_0x4084eb['registration_endpoint'],{'method':_0x38ee59['uuEON'],'headers':{'Content-Type':_0x38ee59['BqnkU']},'body':JSON['stringify']({'client_name':_0x12d0cc(0x1cf),'redirect_uris':['http://localhost:'+CALLBACK_PORT+_0x12d0cc(0x218)],'grant_types':[_0x38ee59['GIFId'],_0x12d0cc(0x1f0)],'response_types':['code'],'token_endpoint_auth_method':_0x38ee59[_0x12d0cc(0x261)]})});if(!_0x33b810['ok']){const _0x545b28=await _0x33b810[_0x12d0cc(0x235)]();throw new Error(_0x12d0cc(0x1e0)+_0x545b28);}const _0x343ad1=await _0x33b810[_0x12d0cc(0x1d1)]();_0x2ae56b=_0x343ad1[_0x12d0cc(0x254)],_0x1684f5=_0x343ad1[_0x12d0cc(0x1f2)],await saveCachedClient(_0x2ae56b,_0x1684f5),console[_0x12d0cc(0x1f3)]('\x20done');}else throw new Error(_0x12d0cc(0x1e3));}const _0x43cf99=randomBytes(0x20)[_0x12d0cc(0x1f7)](_0x38ee59['etsgo']),_0x39da41=createHash(_0x38ee59['vPquK'])[_0x12d0cc(0x238)](_0x43cf99)['digest'](_0x12d0cc(0x24e)),_0x373f5c=_0x38ee59[_0x12d0cc(0x1e9)](randomBytes,0x10)[_0x12d0cc(0x1f7)](_0x38ee59['XCOWE']),_0xd25062=new URL(_0x4084eb[_0x12d0cc(0x220)]);_0xd25062[_0x12d0cc(0x263)][_0x12d0cc(0x1e2)](_0x12d0cc(0x255),_0x38ee59[_0x12d0cc(0x1fd)]),_0xd25062['searchParams'][_0x12d0cc(0x1e2)]('client_id',_0x2ae56b),_0xd25062[_0x12d0cc(0x263)][_0x12d0cc(0x1e2)](_0x12d0cc(0x223),'http://localhost:'+CALLBACK_PORT+_0x12d0cc(0x218)),_0xd25062[_0x12d0cc(0x263)]['set'](_0x38ee59['UuODv'],_0x39da41),_0xd25062['searchParams'][_0x12d0cc(0x1e2)](_0x38ee59[_0x12d0cc(0x23a)],'S256'),_0xd25062['searchParams'][_0x12d0cc(0x1e2)]('state',_0x373f5c);_0x221436[_0x12d0cc(0x21f)]&&_0xd25062['searchParams']['set'](_0x12d0cc(0x21f),_0x221436['resource']);console[_0x12d0cc(0x1f3)]('\x0aOpening\x20browser\x20for\x20authentication...'),console['log'](_0x12d0cc(0x1fe)+_0xd25062[_0x12d0cc(0x1f7)]()+'\x0a'),await _0x38ee59[_0x12d0cc(0x1e9)](openBrowser,_0xd25062[_0x12d0cc(0x1f7)]());const _0x8c6da1=await _0x38ee59[_0x12d0cc(0x205)](waitForCallback,_0x373f5c);process['stdout'][_0x12d0cc(0x24b)](_0x38ee59[_0x12d0cc(0x211)]);const _0x4ebc9a=new URLSearchParams({'grant_type':_0x38ee59[_0x12d0cc(0x248)],'code':_0x8c6da1,'redirect_uri':'http://localhost:'+CALLBACK_PORT+_0x12d0cc(0x218),'client_id':_0x2ae56b,'code_verifier':_0x43cf99});_0x1684f5&&_0x4ebc9a[_0x12d0cc(0x1e2)](_0x12d0cc(0x1f2),_0x1684f5);_0x221436[_0x12d0cc(0x21f)]&&_0x4ebc9a['set'](_0x38ee59[_0x12d0cc(0x259)],_0x221436['resource']);const _0x21844e=await fetch(_0x4084eb[_0x12d0cc(0x262)],{'method':'POST','headers':{'Content-Type':_0x12d0cc(0x25a)},'body':_0x4ebc9a});if(!_0x21844e['ok']){const _0x3d6b5b=await _0x21844e[_0x12d0cc(0x235)]();throw new Error(_0x12d0cc(0x213)+_0x3d6b5b);}const _0x5159a1=await _0x21844e[_0x12d0cc(0x1d1)]();return console[_0x12d0cc(0x1f3)](_0x38ee59[_0x12d0cc(0x22f)]),await saveCachedToken(_0x5159a1[_0x12d0cc(0x234)],_0x5159a1['refresh_token'],_0x5159a1[_0x12d0cc(0x208)]),_0x5159a1[_0x12d0cc(0x234)];}async function callGetCliToken(_0x273307,_0x23fd3d){const _0x2a787c=_0x30785e,_0x4e2886={'Nxamk':function(_0x21e879,_0x220f83,_0x1ac2d1){return _0x21e879(_0x220f83,_0x1ac2d1);},'jXoOr':function(_0x5d8952,_0x4959c5){return _0x5d8952(_0x4959c5);},'HmhLx':'application/json','pAOWh':_0x2a787c(0x1ec),'nizey':_0x2a787c(0x206),'NfXwq':'2025-03-26','ZqUtA':'ranger-cli','LMlQE':_0x2a787c(0x232),'aRJvu':'\x20done','tkEma':_0x2a787c(0x25b),'aKIIG':'notifications/initialized','WRlFV':'tools/call','kIiUB':_0x2a787c(0x200),'ssLKR':'Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','Yazvr':function(_0x1a60a9){return _0x1a60a9();},'nNAoe':function(_0x9b473e,_0xedf57c,_0x4a0ea4){return _0x9b473e(_0xedf57c,_0x4a0ea4);},'Irlsl':function(_0x441492,_0x2d376b,_0x49fd06,_0x5f0e2b){return _0x441492(_0x2d376b,_0x49fd06,_0x5f0e2b);}},_0x48e661={'Content-Type':_0x4e2886[_0x2a787c(0x1dc)],'Accept':_0x2a787c(0x1d9)};_0x23fd3d&&(_0x48e661[_0x2a787c(0x224)]='Bearer\x20'+_0x23fd3d);const _0x295464=async _0x190870=>{const _0x209060=_0x2a787c,_0xc8678a=await _0x4e2886[_0x209060(0x250)](fetch,_0x273307,{'method':_0x209060(0x25b),'headers':_0x48e661,'body':JSON['stringify'](_0x190870)});if(!_0xc8678a['ok']){const _0x206594=await _0xc8678a['text']();throw new Error(_0x209060(0x1ea)+_0xc8678a['status']+':\x20'+_0x206594);}return _0x4e2886['jXoOr'](parseResponse,_0xc8678a);};process[_0x2a787c(0x21c)]['write'](_0x4e2886[_0x2a787c(0x249)]);const _0x197afb=await _0x4e2886['jXoOr'](_0x295464,{'jsonrpc':_0x4e2886[_0x2a787c(0x241)],'id':0x1,'method':_0x2a787c(0x1ef),'params':{'protocolVersion':_0x4e2886[_0x2a787c(0x1f8)],'capabilities':{},'clientInfo':{'name':_0x4e2886[_0x2a787c(0x258)],'version':_0x4e2886['LMlQE']}}});if(_0x197afb[_0x2a787c(0x20d)])throw new Error(_0x2a787c(0x203)+(_0x197afb[_0x2a787c(0x20d)]['message']??JSON['stringify'](_0x197afb[_0x2a787c(0x20d)])));console[_0x2a787c(0x1f3)](_0x4e2886['aRJvu']),await _0x4e2886['Nxamk'](fetch,_0x273307,{'method':_0x4e2886[_0x2a787c(0x237)],'headers':_0x48e661,'body':JSON[_0x2a787c(0x245)]({'jsonrpc':_0x4e2886[_0x2a787c(0x241)],'method':_0x4e2886['aKIIG']})})[_0x2a787c(0x230)](_0x4a623e=>_0x4a623e[_0x2a787c(0x235)]()),process['stdout'][_0x2a787c(0x24b)]('Requesting\x20CLI\x20token...');const _0x12d14f=await _0x295464({'jsonrpc':_0x4e2886['nizey'],'id':0x2,'method':_0x4e2886['WRlFV'],'params':{'name':_0x4e2886[_0x2a787c(0x215)],'arguments':{}}});if(_0x12d14f[_0x2a787c(0x20d)])throw new Error('get_cli_token\x20failed:\x20'+(_0x12d14f[_0x2a787c(0x20d)][_0x2a787c(0x25e)]??JSON['stringify'](_0x12d14f[_0x2a787c(0x20d)])));console['log']('\x20done');const _0x1b6fa1=extractToken(_0x12d14f['result']);if(!_0x1b6fa1){console[_0x2a787c(0x20d)](_0x2a787c(0x1fc)),console[_0x2a787c(0x20d)](JSON['stringify'](_0x12d14f['result'],null,0x2));throw new Error(_0x4e2886[_0x2a787c(0x204)]);}const _0x47f64b=join(_0x4e2886['Yazvr'](homedir),'.ranger'),_0x32b6b4=_0x4e2886[_0x2a787c(0x244)](join,_0x47f64b,'refresh.txt');await mkdir(_0x47f64b,{'recursive':!![]}),await _0x4e2886[_0x2a787c(0x1d5)](writeFile,_0x32b6b4,_0x1b6fa1,{'mode':0x180}),await writeFile(_0x4e2886[_0x2a787c(0x244)](join,_0x47f64b,_0x2a787c(0x214)),_0x273307,{'mode':0x180}),console[_0x2a787c(0x1f3)](_0x2a787c(0x21a)+_0x32b6b4),console[_0x2a787c(0x1f3)]('Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a');}async function fetchAuthServerMetadata(_0x2c3ed2){const _0x1b285f=_0x30785e,_0x5da648=_0x2c3ed2+_0x1b285f(0x243),_0x1d1b5c=await fetch(_0x5da648);if(!_0x1d1b5c['ok'])throw new Error(_0x1b285f(0x22d)+_0x5da648+':\x20'+_0x1d1b5c['status']);return _0x1d1b5c[_0x1b285f(0x1d1)]();}function waitForCallback(_0x4a1dc6){const _0x3f1a32=_0x30785e,_0x55a031={'RKXAJ':'OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','oxUQL':function(_0x4e2dd3,_0x16c358){return _0x4e2dd3!==_0x16c358;},'hMYVv':_0x3f1a32(0x20c),'iAMND':_0x3f1a32(0x1ff),'PNYLw':_0x3f1a32(0x22e),'kVFbP':function(_0x537b2a,_0x3cacbd){return _0x537b2a(_0x3cacbd);},'jFdHQ':'<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','tXIri':function(_0x319b2d,_0x48e3dc,_0x2ea0c3){return _0x319b2d(_0x48e3dc,_0x2ea0c3);}};return new Promise((_0x5b5076,_0x2303af)=>{const _0x350c8a=_0x3f1a32,_0x491d71={'iTEAe':function(_0x14e5a1,_0x1dec66){return _0x14e5a1(_0x1dec66);},'AuUlE':_0x55a031['RKXAJ'],'GKQHY':function(_0xe1ab32,_0x4e30d2){const _0x25b9ea=_0x84d7;return _0x55a031[_0x25b9ea(0x1db)](_0xe1ab32,_0x4e30d2);},'YuvRF':_0x55a031['hMYVv'],'dYJtR':_0x350c8a(0x228),'kBRtZ':_0x350c8a(0x267),'WMNsN':_0x55a031[_0x350c8a(0x1f5)],'TVRTf':_0x55a031['PNYLw'],'NEaap':function(_0x2da7c2,_0x32d069){return _0x55a031['kVFbP'](_0x2da7c2,_0x32d069);},'ahbLm':function(_0xeaf045,_0x59730b){return _0xeaf045!==_0x59730b;},'lyHVO':_0x55a031['jFdHQ'],'CbBfA':'<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','BBIru':function(_0x3b270f,_0xd72f95){return _0x3b270f(_0xd72f95);}},_0x2bac98=_0x55a031['tXIri'](setTimeout,()=>{const _0xde0d6f=_0x350c8a;_0x1d8133[_0xde0d6f(0x1d8)](),_0x491d71[_0xde0d6f(0x216)](_0x2303af,new OAuthTimeoutError(_0x491d71['AuUlE']));},0x1d4c0),_0x1d8133=createServer((_0x615bb2,_0x591ef1)=>{const _0x433f92=_0x350c8a,_0x5c7770=new URL(_0x615bb2[_0x433f92(0x239)]??'/',_0x433f92(0x24f)+CALLBACK_PORT);if(_0x491d71['GKQHY'](_0x5c7770[_0x433f92(0x252)],'/callback')){_0x591ef1[_0x433f92(0x20f)](0x194),_0x591ef1['end'](_0x491d71['YuvRF']);return;}const _0x1a8f8d=_0x5c7770['searchParams'][_0x433f92(0x227)](_0x491d71[_0x433f92(0x222)]),_0x5bdd4f=_0x5c7770[_0x433f92(0x263)]['get'](_0x491d71['kBRtZ']),_0x3dd75f=_0x5c7770[_0x433f92(0x263)]['get'](_0x433f92(0x20d));if(_0x3dd75f){const _0x3fd270=_0x5c7770[_0x433f92(0x263)]['get'](_0x491d71['WMNsN'])??_0x3dd75f;_0x591ef1[_0x433f92(0x20f)](0xc8,{'Content-Type':_0x491d71[_0x433f92(0x268)]}),_0x591ef1['end']('<html><body><h2>Authentication\x20failed</h2><p>'+_0x3fd270+_0x433f92(0x260)),_0x491d71[_0x433f92(0x210)](clearTimeout,_0x2bac98),_0x1d8133['close'](),_0x491d71['iTEAe'](_0x2303af,new Error('OAuth\x20error:\x20'+_0x3fd270));return;}if(!_0x1a8f8d||_0x491d71['ahbLm'](_0x5bdd4f,_0x4a1dc6)){_0x591ef1[_0x433f92(0x20f)](0x190,{'Content-Type':_0x433f92(0x22e)}),_0x591ef1['end'](_0x491d71['lyHVO']);return;}_0x591ef1[_0x433f92(0x20f)](0xc8,{'Content-Type':_0x433f92(0x22e)}),_0x591ef1['end'](_0x491d71[_0x433f92(0x1e7)]),clearTimeout(_0x2bac98),_0x1d8133['close'](),_0x491d71[_0x433f92(0x23b)](_0x5b5076,_0x1a8f8d);});_0x1d8133[_0x350c8a(0x257)](CALLBACK_PORT,'127.0.0.1');});}async function openBrowser(_0xdca1d7){const _0x4fe33d=_0x30785e,_0x5edb61={'wAiay':function(_0x6c7013,_0x2728f2){return _0x6c7013===_0x2728f2;},'LohGH':'darwin','ovZgQ':'xdg-open','faEqM':function(_0x4e0c12,_0x13c08e){return _0x4e0c12(_0x13c08e);}},{exec:_0x21b2f8}=await import(_0x4fe33d(0x1f6)),_0x2440c2=_0x5edb61[_0x4fe33d(0x23e)](process[_0x4fe33d(0x221)],_0x5edb61[_0x4fe33d(0x1fa)])?'open':process[_0x4fe33d(0x221)]===_0x4fe33d(0x209)?_0x4fe33d(0x246):_0x5edb61[_0x4fe33d(0x1e4)];_0x5edb61[_0x4fe33d(0x24c)](_0x21b2f8,_0x2440c2+'\x20\x22'+_0xdca1d7+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x3e0f74=_0x30785e,_0x161781={'lgcIY':_0x3e0f74(0x23c),'evfUi':function(_0x193681,_0x5e9294){return _0x193681!==_0x5e9294;},'VCbrs':function(_0x1165aa,_0x56e11a){return _0x1165aa>_0x56e11a;}};try{const _0x284e23=JSON['parse'](await readFile(TOKEN_CACHE_PATH,_0x161781['lgcIY']));if(_0x284e23['origin']&&_0x161781[_0x3e0f74(0x22c)](_0x284e23['origin'],currentOrigin))return null;if(_0x284e23['expiresAt']&&_0x161781[_0x3e0f74(0x20e)](Date[_0x3e0f74(0x202)](),_0x284e23[_0x3e0f74(0x1d3)]))return null;return _0x284e23[_0x3e0f74(0x269)]??null;}catch{return null;}}async function saveCachedToken(_0x45e2d0,_0x4c8394,_0x44078d){const _0x48bb23=_0x30785e,_0x117bfe={'JTAME':function(_0x463ae0){return _0x463ae0();},'swyPI':function(_0x482419,_0x40097d,_0x206127){return _0x482419(_0x40097d,_0x206127);},'GzwGj':function(_0x5f3dde){return _0x5f3dde();}},_0x2a222d=await _0x117bfe['JTAME'](loadCachedData),_0x2ca542={..._0x2a222d,'origin':currentOrigin,'accessToken':_0x45e2d0,'refreshToken':_0x4c8394??_0x2a222d?.[_0x48bb23(0x226)],'expiresAt':_0x44078d?Date['now']()+_0x44078d*0x3e8:undefined};await _0x117bfe[_0x48bb23(0x21d)](mkdir,_0x117bfe[_0x48bb23(0x21d)](join,_0x117bfe[_0x48bb23(0x1df)](homedir),'.ranger'),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x2ca542),{'mode':0x180});}async function loadCachedClient(){const _0x2dbe99=_0x30785e,_0xbc85d9={'dXXlI':function(_0x1ca918){return _0x1ca918();}},_0x420d73=await _0xbc85d9[_0x2dbe99(0x212)](loadCachedData);if(_0x420d73?.[_0x2dbe99(0x251)]&&_0x420d73['origin']!==currentOrigin)return null;return _0x420d73?.[_0x2dbe99(0x25d)]?{'clientId':_0x420d73[_0x2dbe99(0x25d)],'clientSecret':_0x420d73[_0x2dbe99(0x25f)]}:null;}async function clearCachedClient(){const _0x2b5fe0=_0x30785e,_0x4b8700={'NcbcX':function(_0x584200,_0x2a5ec9,_0x5cb219,_0x28bff4){return _0x584200(_0x2a5ec9,_0x5cb219,_0x28bff4);}},_0x2f2fc5=await loadCachedData();if(!_0x2f2fc5)return;const {clientId:_0x3239a0,clientSecret:_0x2f1a05,..._0x548400}=_0x2f2fc5;await _0x4b8700[_0x2b5fe0(0x22a)](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x548400),{'mode':0x180});}async function saveCachedClient(_0x18988f,_0x426f05){const _0x1daaaf=_0x30785e,_0x73cf0d={'lBwqw':function(_0x2cc09){return _0x2cc09();},'ZmJuL':function(_0x33b2c9,_0x4a88ea,_0x6337ba){return _0x33b2c9(_0x4a88ea,_0x6337ba);}},_0x55b3ba=await _0x73cf0d[_0x1daaaf(0x1d6)](loadCachedData),_0x199712={..._0x55b3ba,'origin':currentOrigin,'accessToken':_0x55b3ba?.[_0x1daaaf(0x269)]??'','clientId':_0x18988f,'clientSecret':_0x426f05};await _0x73cf0d['ZmJuL'](mkdir,join(_0x73cf0d['lBwqw'](homedir),_0x1daaaf(0x1e8)),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x199712),{'mode':0x180});}async function loadCachedData(){const _0x3f37bd=_0x30785e,_0x44bbfc={'jrpGC':function(_0x313060,_0x29828e,_0x15692c){return _0x313060(_0x29828e,_0x15692c);},'dZlps':_0x3f37bd(0x23c)};try{return JSON['parse'](await _0x44bbfc[_0x3f37bd(0x240)](readFile,TOKEN_CACHE_PATH,_0x44bbfc[_0x3f37bd(0x1da)]));}catch{return null;}}async function parseResponse(_0x5ac972){const _0x287613=_0x30785e,_0x306fcf={'Xkrnp':'data:'},_0x2022ee=_0x5ac972['headers'][_0x287613(0x227)]('content-type')??'';if(_0x2022ee[_0x287613(0x23f)](_0x287613(0x201))){const _0x3c228f=await _0x5ac972['text']();for(const _0x17f059 of _0x3c228f['split']('\x0a')){const _0x2e0164=_0x17f059[_0x287613(0x233)]();if(_0x2e0164['startsWith'](_0x287613(0x264))){const _0x1054aa=_0x2e0164[_0x287613(0x1dd)](_0x306fcf['Xkrnp'][_0x287613(0x1d7)])['trim']();if(!_0x1054aa)continue;try{const _0x1d447d=JSON['parse'](_0x1054aa);if(_0x1d447d['id']!==undefined||_0x1d447d[_0x287613(0x20d)])return _0x1d447d;}catch{}}}throw new Error('No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream');}return _0x5ac972[_0x287613(0x1d1)]();}function extractToken(_0x85f594){const _0x1036d2=_0x30785e,_0x5258ed={'XBFYk':'string','QaxaO':_0x1036d2(0x235)};if(!_0x85f594)return null;const _0x24e9ee=_0x85f594['structuredContent'];if(_0x24e9ee?.[_0x1036d2(0x25c)]&&typeof _0x24e9ee[_0x1036d2(0x25c)]===_0x5258ed[_0x1036d2(0x1eb)])return _0x24e9ee['token'];if(_0x85f594[_0x1036d2(0x1fb)]){const _0x553312=_0x85f594['content'];throw new Error('Server\x20returned\x20error:\x20'+(_0x553312?.[0x0]?.['text']??'Unknown\x20error'));}const _0x1f9964=_0x85f594['content'];if(_0x1f9964)for(const _0x4ca356 of _0x1f9964){if(_0x4ca356[_0x1036d2(0x225)]===_0x5258ed['QaxaO']&&_0x4ca356[_0x1036d2(0x235)]){try{const _0x5889bd=JSON['parse'](_0x4ca356['text']);if(typeof _0x5889bd?.['token']==='string')return _0x5889bd[_0x1036d2(0x25c)];}catch{}const _0x49f48d=_0x4ca356['text']['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x49f48d)return _0x49f48d[0x1];}}return null;}
|
|
1
|
+
const _0x54219d=_0x271e;(function(_0x141586,_0x4423a9){const _0x474ecd=_0x271e,_0xc53347=_0x141586();while(!![]){try{const _0x2c5178=parseInt(_0x474ecd(0x1e6))/0x1*(-parseInt(_0x474ecd(0x1e4))/0x2)+-parseInt(_0x474ecd(0x1be))/0x3*(parseInt(_0x474ecd(0x1b8))/0x4)+-parseInt(_0x474ecd(0x1cc))/0x5*(-parseInt(_0x474ecd(0x1d6))/0x6)+-parseInt(_0x474ecd(0x1e8))/0x7+-parseInt(_0x474ecd(0x196))/0x8*(parseInt(_0x474ecd(0x197))/0x9)+-parseInt(_0x474ecd(0x1c5))/0xa*(-parseInt(_0x474ecd(0x1bd))/0xb)+parseInt(_0x474ecd(0x1b4))/0xc;if(_0x2c5178===_0x4423a9)break;else _0xc53347['push'](_0xc53347['shift']());}catch(_0x28afba){_0xc53347['push'](_0xc53347['shift']());}}}(_0x6583,0x22d76));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';function _0x271e(_0xa01bc8,_0x1125cc){_0xa01bc8=_0xa01bc8-0x171;const _0x658342=_0x6583();let _0x271e87=_0x658342[_0xa01bc8];return _0x271e87;}import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),_0x54219d(0x1e3),'mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),_0x54219d(0x1e3),'auth-origin.txt');function _0x6583(){const _0x5ea95e=['klllU','GmDhe','registration_endpoint','json','then','TigjI','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','platform','/callback','Authorization','kNYTE','parse','NTMCH','notifications/initialized','IrePE','code','NfbvR','S256','4231908pEXcTR','LbhOm','Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20','status','8WYfraO','TjHlz','YOGzC','string','end','594YUGhRB','333120tcGDoH','Pkrsq','pathname','writeHead','POST','redirect_uri','stdout','24740mVcijx','ranger-cli','content-type','message','refresh_token','searchParams','vNxgQ','5bhVger','sLcRV','type','token','tools/call','set','log','needs-oauth','EyOdR','VNTnX','1508796KuLqrP','Token\x20exchange\x20failed:\x20','access_token','text','Registering\x20OAuth\x20client...','Initializing\x20MCP\x20session...','AmnbR','YQzTK','MCP\x20initialize\x20failed:\x20','MCP\x20server\x20returned\x20HTTP\x20','pIvLa','NxdjE','auth-origin.txt','.ranger','2wOwJlb','initialize','179271mWXaIx','expiresAt','1346198CLFWpr','Exchanging\x20authorization\x20code...','Vqvvu','hex','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','write','RompN','bynsN','DrOtD','headers','get','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','slice','application/json','client_id','resource','refreshToken','Ranger\x20CLI','code_challenge','isTTY','error','length','application/json,\x20text/event-stream','<html><body><h2>Authentication\x20failed</h2><p>','/.well-known/oauth-protected-resource','refresh.txt','wFXSd','authorization_code','iOvZd','HTTP\x20','HNLVH','DWvEu','now','open','sDIhG','win32','LxHMc','client_secret','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','clientId','/.well-known/oauth-authorization-server','YWYtC','data:','authorization_endpoint','qrcMb','state','THNVo','2025-03-26','trim','16VURBzS','6057opzBYN','result','2.0','origin','pOGVr','token_endpoint','utf-8','CJWKw','http://localhost:','stringify','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found'];_0x6583=function(){return _0x5ea95e;};return _0x6583();}export async function getMcpAuthOrigin(){const _0x15c911=_0x54219d,_0x26ffb0={'DrOtD':'utf-8','IrePE':function(_0x27509b,_0x1b9d33){return _0x27509b||_0x1b9d33;}};try{const _0x3b5ad6=(await readFile(AUTH_ORIGIN_PATH,_0x26ffb0[_0x15c911(0x1f0)]))[_0x15c911(0x195)]();return _0x26ffb0[_0x15c911(0x1b0)](_0x3b5ad6,null);}catch{return null;}}export async function mcpBootstrap(){const _0x127b2b=_0x54219d,_0x12e823={'fTWWW':function(_0x148d43){return _0x148d43();},'TemZD':'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.'},_0x6b6724=_0x12e823['fTWWW'](getMcpAuthUrl);currentOrigin=_0x6b6724;const _0x2eba60=process[_0x127b2b(0x1c4)][_0x127b2b(0x178)]??![];console[_0x127b2b(0x1d2)]('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x6b6724+'\x0a');const _0x3270de=await tryUnauthenticated(_0x6b6724);let _0x2cbbea=null;if(_0x3270de==='proxied')_0x2cbbea='';else{_0x2cbbea=await loadCachedToken();if(!_0x2cbbea){if(!_0x2eba60)throw new Error('MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a'+_0x12e823['TemZD']);_0x2cbbea=await oauthFlow(_0x6b6724);}}await callGetCliToken(_0x6b6724,_0x2cbbea);}async function tryUnauthenticated(_0x4e44ea){const _0x9f00f2=_0x54219d,_0xdfda73={'Pkrsq':'application/json','YQzTK':_0x9f00f2(0x199),'KkfuI':'initialize','vNxgQ':_0x9f00f2(0x194),'BcTNj':'proxied'},_0x2712d4=await fetch(_0x4e44ea,{'method':_0x9f00f2(0x1c2),'headers':{'Content-Type':_0xdfda73[_0x9f00f2(0x1bf)],'Accept':_0x9f00f2(0x17b)},'body':JSON['stringify']({'jsonrpc':_0xdfda73[_0x9f00f2(0x1dd)],'id':0x1,'method':_0xdfda73['KkfuI'],'params':{'protocolVersion':_0xdfda73[_0x9f00f2(0x1cb)],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':'1.0.0'}}})});if(_0x2712d4['ok'])return await _0x2712d4[_0x9f00f2(0x1d9)](),_0xdfda73['BcTNj'];if(_0x2712d4[_0x9f00f2(0x1b7)]===0x191)return await _0x2712d4[_0x9f00f2(0x1d9)](),_0x9f00f2(0x1d3);const _0x41fcb1=await _0x2712d4['text']();throw new Error(_0x9f00f2(0x1df)+_0x2712d4['status']+':\x20'+_0x41fcb1);}class OAuthTimeoutError extends Error{constructor(_0xdbe14d){const _0x486264={'RVLZG':'OAuthTimeoutError'};super(_0xdbe14d),this['name']=_0x486264['RVLZG'];}}async function oauthFlow(_0x3dfb2e){const _0x4e8d81=_0x54219d,_0x35f69a={'kNYTE':function(_0x50db41,_0x532c0d){return _0x50db41(_0x532c0d);}};try{return await oauthFlowAttempt(_0x3dfb2e);}catch(_0x5d1ebc){if(_0x5d1ebc instanceof OAuthTimeoutError&&await loadCachedClient())return console['log']('\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'),await clearCachedClient(),await _0x35f69a[_0x4e8d81(0x1ac)](oauthFlowAttempt,_0x3dfb2e);throw _0x5d1ebc;}}async function oauthFlowAttempt(_0xe7d8e4){const _0x3ffb56=_0x54219d,_0x8edd52={'tgaRe':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','qrcMb':'No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','klllU':function(_0x402bb7,_0x4e369a){return _0x402bb7(_0x4e369a);},'sDIhG':'application/json','THNVo':_0x3ffb56(0x1c9),'YWYtC':'code','Itxjw':'\x20done','RompN':'base64url','QMOse':_0x3ffb56(0x1eb),'YOGzC':'response_type','TjHlz':_0x3ffb56(0x173),'GmDhe':_0x3ffb56(0x1c3),'AmnbR':_0x3ffb56(0x177),'CJWKw':'code_challenge_method','xQszi':_0x3ffb56(0x1b3),'HGCbw':_0x3ffb56(0x192),'pOGVr':function(_0x136ab1,_0x3f0472,_0x57754b){return _0x136ab1(_0x3f0472,_0x57754b);},'RoKxB':'application/x-www-form-urlencoded'},_0x271af0=_0xe7d8e4['replace'](/\/mcp$/,'');process['stdout']['write']('Discovering\x20authorization\x20server...');const _0x463653=await fetch(_0x271af0+_0x3ffb56(0x17d));if(!_0x463653['ok'])throw new Error(_0x8edd52['tgaRe']);const _0x523532=await _0x463653[_0x3ffb56(0x1a5)](),_0x186527=_0x523532['authorization_servers']?.[0x0];if(!_0x186527)throw new Error(_0x8edd52[_0x3ffb56(0x191)]);console['log']('\x20'+_0x186527);const _0x310980=await _0x8edd52['klllU'](fetchAuthServerMetadata,_0x186527);let _0x2b85c6,_0x1b0d81;const _0x1bfab8=await loadCachedClient();if(_0x1bfab8)_0x2b85c6=_0x1bfab8[_0x3ffb56(0x18c)],_0x1b0d81=_0x1bfab8['clientSecret'];else{if(_0x310980[_0x3ffb56(0x1a4)]){process[_0x3ffb56(0x1c4)][_0x3ffb56(0x1ed)](_0x3ffb56(0x1da));const _0x300db9=await fetch(_0x310980[_0x3ffb56(0x1a4)],{'method':_0x3ffb56(0x1c2),'headers':{'Content-Type':_0x8edd52[_0x3ffb56(0x187)]},'body':JSON[_0x3ffb56(0x1a0)]({'client_name':_0x3ffb56(0x176),'redirect_uris':[_0x3ffb56(0x19f)+CALLBACK_PORT+_0x3ffb56(0x1aa)],'grant_types':[_0x3ffb56(0x180),_0x8edd52[_0x3ffb56(0x193)]],'response_types':[_0x8edd52[_0x3ffb56(0x18e)]],'token_endpoint_auth_method':'none'})});if(!_0x300db9['ok']){const _0x570400=await _0x300db9['text']();throw new Error('Client\x20registration\x20failed:\x20'+_0x570400);}const _0x2ac8f8=await _0x300db9['json']();_0x2b85c6=_0x2ac8f8[_0x3ffb56(0x173)],_0x1b0d81=_0x2ac8f8[_0x3ffb56(0x18a)],await saveCachedClient(_0x2b85c6,_0x1b0d81),console[_0x3ffb56(0x1d2)](_0x8edd52['Itxjw']);}else throw new Error(_0x3ffb56(0x1a1));}const _0xf922b5=randomBytes(0x20)['toString'](_0x8edd52[_0x3ffb56(0x1ee)]),_0x4f615d=_0x8edd52['klllU'](createHash,'sha256')['update'](_0xf922b5)['digest'](_0x8edd52[_0x3ffb56(0x1ee)]),_0x475634=_0x8edd52[_0x3ffb56(0x1a2)](randomBytes,0x10)['toString'](_0x8edd52['QMOse']),_0x381506=new URL(_0x310980[_0x3ffb56(0x190)]);_0x381506['searchParams']['set'](_0x8edd52[_0x3ffb56(0x1ba)],_0x3ffb56(0x1b1)),_0x381506[_0x3ffb56(0x1ca)][_0x3ffb56(0x1d1)](_0x8edd52[_0x3ffb56(0x1b9)],_0x2b85c6),_0x381506['searchParams'][_0x3ffb56(0x1d1)](_0x8edd52[_0x3ffb56(0x1a3)],_0x3ffb56(0x19f)+CALLBACK_PORT+_0x3ffb56(0x1aa)),_0x381506['searchParams'][_0x3ffb56(0x1d1)](_0x8edd52[_0x3ffb56(0x1dc)],_0x4f615d),_0x381506[_0x3ffb56(0x1ca)][_0x3ffb56(0x1d1)](_0x8edd52[_0x3ffb56(0x19e)],_0x8edd52['xQszi']),_0x381506[_0x3ffb56(0x1ca)]['set'](_0x8edd52['HGCbw'],_0x475634);_0x523532[_0x3ffb56(0x174)]&&_0x381506[_0x3ffb56(0x1ca)]['set'](_0x3ffb56(0x174),_0x523532['resource']);console[_0x3ffb56(0x1d2)]('\x0aOpening\x20browser\x20for\x20authentication...'),console[_0x3ffb56(0x1d2)]('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x381506['toString']()+'\x0a'),await openBrowser(_0x381506['toString']());const _0x5e14e3=await _0x8edd52['klllU'](waitForCallback,_0x475634);process['stdout'][_0x3ffb56(0x1ed)](_0x3ffb56(0x1e9));const _0x4b8764=new URLSearchParams({'grant_type':_0x3ffb56(0x180),'code':_0x5e14e3,'redirect_uri':_0x3ffb56(0x19f)+CALLBACK_PORT+_0x3ffb56(0x1aa),'client_id':_0x2b85c6,'code_verifier':_0xf922b5});_0x1b0d81&&_0x4b8764['set'](_0x3ffb56(0x18a),_0x1b0d81);_0x523532[_0x3ffb56(0x174)]&&_0x4b8764[_0x3ffb56(0x1d1)]('resource',_0x523532['resource']);const _0x1c3675=await _0x8edd52[_0x3ffb56(0x19b)](fetch,_0x310980[_0x3ffb56(0x19c)],{'method':'POST','headers':{'Content-Type':_0x8edd52['RoKxB']},'body':_0x4b8764});if(!_0x1c3675['ok']){const _0x20024f=await _0x1c3675[_0x3ffb56(0x1d9)]();throw new Error(_0x3ffb56(0x1d7)+_0x20024f);}const _0x513071=await _0x1c3675[_0x3ffb56(0x1a5)]();return console['log'](_0x8edd52['Itxjw']),await saveCachedToken(_0x513071[_0x3ffb56(0x1d8)],_0x513071['refresh_token'],_0x513071['expires_in']),_0x513071[_0x3ffb56(0x1d8)];}async function callGetCliToken(_0x200190,_0x3a4046){const _0x42d539=_0x54219d,_0x108d0d={'HNLVH':function(_0x61b07c,_0x35ffda,_0x113153){return _0x61b07c(_0x35ffda,_0x113153);},'rRKrz':_0x42d539(0x1c2),'wFXSd':function(_0x2ad5f1,_0x3f53ce){return _0x2ad5f1(_0x3f53ce);},'mkSVi':'application/json,\x20text/event-stream','UBrJy':_0x42d539(0x1ab),'NTMCH':_0x42d539(0x1db),'WfEWZ':_0x42d539(0x199),'NfbvR':'\x20done','Vqvvu':_0x42d539(0x1af),'LxHMc':'Requesting\x20CLI\x20token...','aYzli':'get_cli_token','UAKYe':'.ranger','THRHD':_0x42d539(0x17e),'hjIDg':function(_0x32e2e2,_0x463e44,_0x11eb46,_0x1c91cc){return _0x32e2e2(_0x463e44,_0x11eb46,_0x1c91cc);},'ZgUMq':_0x42d539(0x1f3)},_0x593d83={'Content-Type':_0x42d539(0x172),'Accept':_0x108d0d['mkSVi']};_0x3a4046&&(_0x593d83[_0x108d0d['UBrJy']]='Bearer\x20'+_0x3a4046);const _0x3e75dd=async _0x110dcf=>{const _0x24c514=_0x42d539,_0x225a08=await _0x108d0d[_0x24c514(0x183)](fetch,_0x200190,{'method':_0x108d0d['rRKrz'],'headers':_0x593d83,'body':JSON[_0x24c514(0x1a0)](_0x110dcf)});if(!_0x225a08['ok']){const _0x12621d=await _0x225a08['text']();throw new Error(_0x24c514(0x182)+_0x225a08[_0x24c514(0x1b7)]+':\x20'+_0x12621d);}return _0x108d0d['wFXSd'](parseResponse,_0x225a08);};process[_0x42d539(0x1c4)][_0x42d539(0x1ed)](_0x108d0d[_0x42d539(0x1ae)]);const _0x1f6ef2=await _0x3e75dd({'jsonrpc':_0x108d0d['WfEWZ'],'id':0x1,'method':_0x42d539(0x1e5),'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x42d539(0x1c6),'version':'1.0.0'}}});if(_0x1f6ef2[_0x42d539(0x179)])throw new Error(_0x42d539(0x1de)+(_0x1f6ef2[_0x42d539(0x179)]['message']??JSON[_0x42d539(0x1a0)](_0x1f6ef2['error'])));console[_0x42d539(0x1d2)](_0x108d0d[_0x42d539(0x1b2)]),await fetch(_0x200190,{'method':_0x108d0d['rRKrz'],'headers':_0x593d83,'body':JSON[_0x42d539(0x1a0)]({'jsonrpc':_0x108d0d['WfEWZ'],'method':_0x108d0d[_0x42d539(0x1ea)]})})[_0x42d539(0x1a6)](_0x539708=>_0x539708[_0x42d539(0x1d9)]()),process['stdout'][_0x42d539(0x1ed)](_0x108d0d[_0x42d539(0x189)]);const _0x2802af=await _0x108d0d[_0x42d539(0x17f)](_0x3e75dd,{'jsonrpc':'2.0','id':0x2,'method':_0x42d539(0x1d0),'params':{'name':_0x108d0d['aYzli'],'arguments':{}}});if(_0x2802af['error'])throw new Error('get_cli_token\x20failed:\x20'+(_0x2802af['error'][_0x42d539(0x1c8)]??JSON[_0x42d539(0x1a0)](_0x2802af['error'])));console[_0x42d539(0x1d2)](_0x108d0d['NfbvR']);const _0xcc89c2=extractToken(_0x2802af[_0x42d539(0x198)]);if(!_0xcc89c2){console['error']('\x0aUnexpected\x20response\x20structure:'),console['error'](JSON['stringify'](_0x2802af['result'],null,0x2));throw new Error(_0x42d539(0x1a8));}const _0x5d405c=join(homedir(),_0x108d0d['UAKYe']),_0x78f84=_0x108d0d['HNLVH'](join,_0x5d405c,_0x108d0d['THRHD']);await mkdir(_0x5d405c,{'recursive':!![]}),await writeFile(_0x78f84,_0xcc89c2,{'mode':0x180}),await _0x108d0d['hjIDg'](writeFile,join(_0x5d405c,_0x42d539(0x1e2)),_0x200190,{'mode':0x180}),console[_0x42d539(0x1d2)]('\x0aToken\x20written\x20to\x20'+_0x78f84),console[_0x42d539(0x1d2)](_0x108d0d['ZgUMq']);}async function fetchAuthServerMetadata(_0x4bbd3b){const _0x1cbd57=_0x54219d,_0x439eb1={'VvyEA':function(_0x402dcc,_0x5dab9f){return _0x402dcc(_0x5dab9f);}},_0x14dae3=_0x4bbd3b+_0x1cbd57(0x18d),_0x4cbcfd=await _0x439eb1['VvyEA'](fetch,_0x14dae3);if(!_0x4cbcfd['ok'])throw new Error(_0x1cbd57(0x1b6)+_0x14dae3+':\x20'+_0x4cbcfd[_0x1cbd57(0x1b7)]);return _0x4cbcfd[_0x1cbd57(0x1a5)]();}function waitForCallback(_0x57a1cf){const _0x459563=_0x54219d,_0x262802={'sLcRV':function(_0x1d6374){return _0x1d6374();},'TyLoS':function(_0x58a45f,_0x2f081a){return _0x58a45f(_0x2f081a);},'DWvEu':_0x459563(0x1aa),'keqtr':function(_0x42f69e,_0x2ad26f){return _0x42f69e!==_0x2ad26f;},'OAuTN':'<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','pavyC':'text/html','IjhnM':'<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','ecGES':function(_0x4a80ef,_0x30cfef){return _0x4a80ef(_0x30cfef);},'orLyj':'127.0.0.1'};return new Promise((_0x292810,_0x5e99a7)=>{const _0x5e8352=()=>{_0x1dac88['closeAllConnections'](),_0x1dac88['close']();},_0x28ca81=setTimeout(()=>{const _0x379c6a=_0x271e;_0x262802[_0x379c6a(0x1cd)](_0x5e8352),_0x262802['TyLoS'](_0x5e99a7,new OAuthTimeoutError(_0x379c6a(0x18b)));},0x1d4c0),_0x1dac88=createServer((_0x2e1788,_0x58b837)=>{const _0x12c596=_0x271e,_0x256c7f=new URL(_0x2e1788['url']??'/',_0x12c596(0x19f)+CALLBACK_PORT);if(_0x256c7f[_0x12c596(0x1c0)]!==_0x262802[_0x12c596(0x184)]){_0x58b837['writeHead'](0x194),_0x58b837['end']('Not\x20found');return;}const _0x3abd6b=_0x256c7f['searchParams'][_0x12c596(0x1f2)](_0x12c596(0x1b1)),_0xb1fa41=_0x256c7f['searchParams']['get'](_0x12c596(0x192)),_0xb3261d=_0x256c7f['searchParams']['get']('error');if(_0xb3261d){const _0x22d684=_0x256c7f['searchParams']['get']('error_description')??_0xb3261d;_0x58b837['writeHead'](0xc8,{'Content-Type':'text/html'}),_0x58b837[_0x12c596(0x1bc)](_0x12c596(0x17c)+_0x22d684+_0x12c596(0x1ec)),_0x262802['TyLoS'](clearTimeout,_0x28ca81),_0x262802['sLcRV'](_0x5e8352),_0x5e99a7(new Error('OAuth\x20error:\x20'+_0x22d684));return;}if(!_0x3abd6b||_0x262802['keqtr'](_0xb1fa41,_0x57a1cf)){_0x58b837['writeHead'](0x190,{'Content-Type':'text/html'}),_0x58b837[_0x12c596(0x1bc)](_0x262802['OAuTN']);return;}_0x58b837[_0x12c596(0x1c1)](0xc8,{'Content-Type':_0x262802['pavyC']}),_0x58b837[_0x12c596(0x1bc)](_0x262802['IjhnM']),_0x262802['ecGES'](clearTimeout,_0x28ca81),_0x5e8352(),_0x292810(_0x3abd6b);});_0x1dac88['listen'](CALLBACK_PORT,_0x262802['orLyj']);});}async function openBrowser(_0x19c535){const _0x2bf3af=_0x54219d,_0x1d9b43={'TigjI':function(_0x798b7d,_0x3f42a1){return _0x798b7d===_0x3f42a1;}},_0x1a869d=_0x1d9b43[_0x2bf3af(0x1a7)](process[_0x2bf3af(0x1a9)],'darwin')?_0x2bf3af(0x186):process['platform']===_0x2bf3af(0x188)?'start':'xdg-open';exec(_0x1a869d+'\x20\x22'+_0x19c535+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x2c3636=_0x54219d,_0x5b1a8f={'NUBUK':function(_0x2d09c1,_0x1be992,_0x331942){return _0x2d09c1(_0x1be992,_0x331942);},'FyYdh':'utf-8','UWPyS':function(_0x58ac00,_0x3e7f6d){return _0x58ac00!==_0x3e7f6d;},'UZihq':function(_0x3ce59e,_0x2ddb4a){return _0x3ce59e>_0x2ddb4a;}};try{const _0x59b7c6=JSON[_0x2c3636(0x1ad)](await _0x5b1a8f['NUBUK'](readFile,TOKEN_CACHE_PATH,_0x5b1a8f['FyYdh']));if(_0x59b7c6['origin']&&_0x5b1a8f['UWPyS'](_0x59b7c6[_0x2c3636(0x19a)],currentOrigin))return null;if(_0x59b7c6[_0x2c3636(0x1e7)]&&_0x5b1a8f['UZihq'](Date['now'](),_0x59b7c6['expiresAt']))return null;return _0x59b7c6['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0x40ab7d,_0x48a7d1,_0x147a92){const _0x28aa7b=_0x54219d,_0x50f220={'NxdjE':function(_0x48a3be){return _0x48a3be();},'ppLLw':function(_0x4723ce,_0xf48863,_0x44eeb4){return _0x4723ce(_0xf48863,_0x44eeb4);}},_0x53b97c=await _0x50f220[_0x28aa7b(0x1e1)](loadCachedData),_0x500f48={..._0x53b97c,'origin':currentOrigin,'accessToken':_0x40ab7d,'refreshToken':_0x48a7d1??_0x53b97c?.[_0x28aa7b(0x175)],'expiresAt':_0x147a92?Date[_0x28aa7b(0x185)]()+_0x147a92*0x3e8:undefined};await _0x50f220['ppLLw'](mkdir,join(_0x50f220['NxdjE'](homedir),'.ranger'),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x28aa7b(0x1a0)](_0x500f48),{'mode':0x180});}async function loadCachedClient(){const _0x326765=_0x54219d,_0x101d10=await loadCachedData();if(_0x101d10?.[_0x326765(0x19a)]&&_0x101d10['origin']!==currentOrigin)return null;return _0x101d10?.['clientId']?{'clientId':_0x101d10[_0x326765(0x18c)],'clientSecret':_0x101d10['clientSecret']}:null;}async function clearCachedClient(){const _0xf098d={'LELZS':function(_0x54eb2a,_0x50dd49,_0x55fddc,_0x3b988b){return _0x54eb2a(_0x50dd49,_0x55fddc,_0x3b988b);}},_0x3b2dd6=await loadCachedData();if(!_0x3b2dd6)return;const {clientId:_0x4a9ecd,clientSecret:_0x336c4b,..._0x2d551c}=_0x3b2dd6;await _0xf098d['LELZS'](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x2d551c),{'mode':0x180});}async function saveCachedClient(_0x2c47dc,_0x1ff42e){const _0xe5c91d=_0x54219d,_0x567ad8={'VNTnX':function(_0x10137d){return _0x10137d();},'KmiTV':function(_0x16856c,_0x1c4c8d,_0x18c3b4){return _0x16856c(_0x1c4c8d,_0x18c3b4);},'bynsN':_0xe5c91d(0x1e3),'HNMwl':function(_0x321e30,_0x5c80cf,_0x41e8a9,_0xcf4184){return _0x321e30(_0x5c80cf,_0x41e8a9,_0xcf4184);}},_0x494443=await _0x567ad8[_0xe5c91d(0x1d5)](loadCachedData),_0x410779={..._0x494443,'origin':currentOrigin,'accessToken':_0x494443?.['accessToken']??'','clientId':_0x2c47dc,'clientSecret':_0x1ff42e};await mkdir(_0x567ad8['KmiTV'](join,_0x567ad8[_0xe5c91d(0x1d5)](homedir),_0x567ad8[_0xe5c91d(0x1ef)]),{'recursive':!![]}),await _0x567ad8['HNMwl'](writeFile,TOKEN_CACHE_PATH,JSON[_0xe5c91d(0x1a0)](_0x410779),{'mode':0x180});}async function loadCachedData(){const _0x11fa94=_0x54219d;try{return JSON['parse'](await readFile(TOKEN_CACHE_PATH,_0x11fa94(0x19d)));}catch{return null;}}async function parseResponse(_0x2e7326){const _0x516e4c=_0x54219d,_0x4b2f43={'wlmWl':_0x516e4c(0x1c7),'LbhOm':'text/event-stream','feZUw':'No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream'},_0x2de971=_0x2e7326[_0x516e4c(0x1f1)][_0x516e4c(0x1f2)](_0x4b2f43['wlmWl'])??'';if(_0x2de971['includes'](_0x4b2f43[_0x516e4c(0x1b5)])){const _0x1488b2=await _0x2e7326[_0x516e4c(0x1d9)]();for(const _0x47f0ed of _0x1488b2['split']('\x0a')){const _0x4595e6=_0x47f0ed['trim']();if(_0x4595e6['startsWith'](_0x516e4c(0x18f))){const _0x57a797=_0x4595e6[_0x516e4c(0x171)]('data:'[_0x516e4c(0x17a)])[_0x516e4c(0x195)]();if(!_0x57a797)continue;try{const _0x1cefeb=JSON['parse'](_0x57a797);if(_0x1cefeb['id']!==undefined||_0x1cefeb['error'])return _0x1cefeb;}catch{}}}throw new Error(_0x4b2f43['feZUw']);}return _0x2e7326['json']();}function extractToken(_0x1c1cc3){const _0x20366a=_0x54219d,_0x2d5a95={'iOvZd':function(_0x576723,_0x2ae561){return _0x576723===_0x2ae561;},'EyOdR':'Unknown\x20error','dCcdu':_0x20366a(0x1d9),'pIvLa':'string'};if(!_0x1c1cc3)return null;const _0x301cf9=_0x1c1cc3['structuredContent'];if(_0x301cf9?.['token']&&_0x2d5a95[_0x20366a(0x181)](typeof _0x301cf9[_0x20366a(0x1cf)],_0x20366a(0x1bb)))return _0x301cf9['token'];if(_0x1c1cc3['isError']){const _0x26674c=_0x1c1cc3['content'];throw new Error('Server\x20returned\x20error:\x20'+(_0x26674c?.[0x0]?.[_0x20366a(0x1d9)]??_0x2d5a95[_0x20366a(0x1d4)]));}const _0x821ed3=_0x1c1cc3['content'];if(_0x821ed3)for(const _0x434d16 of _0x821ed3){if(_0x434d16[_0x20366a(0x1ce)]===_0x2d5a95['dCcdu']&&_0x434d16['text']){try{const _0x37e8a3=JSON[_0x20366a(0x1ad)](_0x434d16[_0x20366a(0x1d9)]);if(_0x2d5a95['iOvZd'](typeof _0x37e8a3?.[_0x20366a(0x1cf)],_0x2d5a95[_0x20366a(0x1e0)]))return _0x37e8a3['token'];}catch{}const _0x127bc4=_0x434d16[_0x20366a(0x1d9)]['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x127bc4)return _0x127bc4[0x1];}}return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x20ee61,_0x5d2ac6){const _0x2820e5=_0x3267,_0x49c71a=_0x20ee61();while(!![]){try{const _0x2ae43e=-parseInt(_0x2820e5(0x21f))/0x1*(-parseInt(_0x2820e5(0x1fa))/0x2)+-parseInt(_0x2820e5(0x21a))/0x3*(-parseInt(_0x2820e5(0x1f5))/0x4)+-parseInt(_0x2820e5(0x232))/0x5*(parseInt(_0x2820e5(0x20e))/0x6)+-parseInt(_0x2820e5(0x231))/0x7*(-parseInt(_0x2820e5(0x215))/0x8)+parseInt(_0x2820e5(0x22a))/0x9+-parseInt(_0x2820e5(0x23e))/0xa*(parseInt(_0x2820e5(0x212))/0xb)+-parseInt(_0x2820e5(0x219))/0xc*(parseInt(_0x2820e5(0x227))/0xd);if(_0x2ae43e===_0x5d2ac6)break;else _0x49c71a['push'](_0x49c71a['shift']());}catch(_0x14f7b7){_0x49c71a['push'](_0x49c71a['shift']());}}}(_0x1e06,0x4e565));import{readFile,rm}from'fs/promises';import{existsSync}from'fs';import{join}from'path';function _0x1e06(){const _0x2357f2=['185861djRPwZ','\x20\x20⚠\x20','tEDyP',',\x20baseUrl\x20override\x20→\x20projects.json)','RANGER_TEST_PASSWORD','length','ZvAuQ','env','3586791weyFoV',':\x20failed\x20to\x20delete\x20local\x20dir\x20','fKGBp','3728691RCTmLr','ovLkf','Aborted.','migrate','zsdcd','authJsonPath','profile.migrate.started','119pUYEvC','22965geaBCk','SvdEk','trackPhaseStart','AXaUu','HDJJo','BFAJD','trackPhaseEnd','kind','AfmiI','environments','log','preserveBaseUrl','50KdynuK','\x20migrated\x20to\x20cloud\x20(env:\x20','idJpj','yHTvY','KQZXT','some','sdbxO','profile.migrate.succeeded','saveCreds','profileName',':\x20--save-creds\x20requested,\x20but\x20RANGER_TEST_USERNAME/PASSWORD\x20not\x20set\x20in\x20env.','OmPkg','\x20profile','htXCk','yTQvX','name_conflict','\x20\x20✓\x20',',\x20matches\x20','25436dhjVqj','rsGAu','No\x20cloud\x20profile\x20auth\x20config\x20found\x20for\x20this\x20org.\x20Migration\x20requires\x20at\x20least\x20one\x20configured\x20auth\x20environment.','settings','join','4jwvJBN','ZXgot','reason','AsRiS','baseUrl','\x20migrated','NCtyF','skip','keys','\x20skipped','message','no\x20baseUrl\x20in\x20settings.json','RNFyP','After\x20migration,\x20uncommit\x20it:','dryRun','\x20→\x20skip\x20(',':\x20session\x20upload\x20failed\x20(','Continuing\x20with\x20migration...','push','cwd','708cVLACf','Warning:\x20.ranger/\x20is\x20tracked\x20in\x20this\x20git\x20repo.','\x20\x20✗\x20','envKey','1262547HGexuM','padEnd','lCphO','145784YxHsax','yWrXR','\x20→\x20cloud\x20(env:\x20','Nhfdb','12AVIrrx','291MEsBPj','ies','entries','isTTY','ZReUW'];_0x1e06=function(){return _0x2357f2;};return _0x1e06();}import _0x28ea0f from'inquirer';import{getEnvNames}from'./env.js';import{getEnvDir,loadSettings}from'./utils/settings.js';import{getRangerDir}from'./utils/rangerRoot.js';import{ApiError,createCloudProfile,fetchAuthConfig,saveCloudProfileCredentials,uploadCloudProfileSession}from'./utils/cloudProfile.js';import{matchAuthEnvironment}from'./utils/matchAuthEnvironment.js';import{readProjectsConfig,setProfileOverride,writeProjectsConfig}from'./utils/projectsConfig.js';import{isPathGitTracked}from'./utils/gitTracked.js';function _0x3267(_0x2ad2e1,_0x24a2ee){_0x2ad2e1=_0x2ad2e1-0x1f3;const _0x1e0617=_0x1e06();let _0x3267fb=_0x1e0617[_0x2ad2e1];return _0x3267fb;}function formatPlanLine(_0x232c34){const _0x5f31fd=_0x3267;if(_0x232c34[_0x5f31fd(0x239)]===_0x5f31fd(0x201))return'\x20\x20'+_0x232c34[_0x5f31fd(0x247)][_0x5f31fd(0x213)](0x1e)+_0x5f31fd(0x209)+_0x232c34[_0x5f31fd(0x1fc)]+')';if(_0x232c34[_0x5f31fd(0x23d)]&&_0x232c34['baseUrl'])return'\x20\x20'+_0x232c34['profileName']['padEnd'](0x1e)+'\x20→\x20cloud\x20(env:\x20'+_0x232c34[_0x5f31fd(0x211)]+',\x20preserving\x20baseUrl\x20'+_0x232c34[_0x5f31fd(0x1fe)]+'\x20as\x20project\x20override)';if(_0x232c34[_0x5f31fd(0x1fe)])return'\x20\x20'+_0x232c34['profileName'][_0x5f31fd(0x213)](0x1e)+'\x20→\x20cloud\x20(env:\x20'+_0x232c34[_0x5f31fd(0x211)]+_0x5f31fd(0x1f4)+_0x232c34['baseUrl']+')';return'\x20\x20'+_0x232c34['profileName']['padEnd'](0x1e)+_0x5f31fd(0x217)+_0x232c34[_0x5f31fd(0x211)]+')';}function shouldWarnGitTrackedOnce(_0xf229ec){const _0x210606=_0x3267,_0x339b04={'sdbxO':function(_0x287e57){return _0x287e57();},'htXCk':function(_0x207b50,_0x9a9943){return _0x207b50===_0x9a9943;},'dDsDH':function(_0x46092e,_0x26cfee){return _0x46092e(_0x26cfee);}},_0x2d2506=_0x339b04[_0x210606(0x244)](readProjectsConfig),_0x5d9ae5=_0x2d2506['projects'][_0xf229ec]??={},_0x58ee0f=_0x5d9ae5['_warnings']??={},_0x535ba7=_0x58ee0f['gitTrackedRanger'],_0x20f248=new Date(),_0xb5f363=_0x20f248['toISOString']()['slice'](0x0,0xa);if(_0x339b04[_0x210606(0x24b)](_0x535ba7,_0xb5f363))return![];return _0x58ee0f['gitTrackedRanger']=_0xb5f363,_0x339b04['dDsDH'](writeProjectsConfig,_0x2d2506),!![];}export async function migrateProfile(_0x3d3ab7,_0x125ba3){const _0x4dfbe8=_0x3267,_0x48b329={'AzkeC':function(_0x816468,_0x27afaa){return _0x816468===_0x27afaa;},'tRkqi':'Provide\x20a\x20profile\x20name\x20or\x20--all.\x0a\x20\x20Example:\x20ranger\x20profile\x20migrate\x20--all\x20--dry-run','ZXgot':function(_0x23f58a,_0xcf7471){return _0x23f58a===_0xcf7471;},'HXjSd':'No\x20local\x20profiles\x20found\x20to\x20migrate.','OmPkg':function(_0x4add4e,_0x2515fd){return _0x4add4e(_0x2515fd);},'BFAJD':'local\x20profile\x20directory\x20not\x20found','yHTvY':function(_0x325de9,_0x333362){return _0x325de9(_0x333362);},'idJpj':'skip','nyVGa':'no\x20matching\x20auth\x20env','Huvsq':function(_0x57dda5,_0x3fbc07){return _0x57dda5===_0x3fbc07;},'uXWnU':function(_0x32c45d,_0x2f3ae8){return _0x32c45d===_0x2f3ae8;},'fKGBp':function(_0x43a26d,_0x5d9670,_0x51cb12){return _0x43a26d(_0x5d9670,_0x51cb12);},'SvdEk':'auth.json','RNFyP':_0x4dfbe8(0x22d),'qMGCd':'Nothing\x20migrated.\x20Run\x20without\x20--dry-run\x20to\x20apply.','AfmiI':function(_0x226503,_0x29bf23){return _0x226503&&_0x29bf23;},'OqFzC':'confirm','rsGAu':'proceed','lCphO':function(_0x25186b){return _0x25186b();},'AsRiS':function(_0x65954c,_0x312de0){return _0x65954c(_0x312de0);},'tEDyP':'\x20\x20git\x20rm\x20-r\x20--cached\x20.ranger/','zsdcd':'\x20\x20echo\x20\x27.ranger/\x27\x20>>\x20.gitignore','QqUBy':_0x4dfbe8(0x20b),'AXaUu':'profile.migrate.skipped','ovLkf':function(_0x4eda77,_0x26d53d,_0x683d9,_0x38e80b){return _0x4eda77(_0x26d53d,_0x683d9,_0x38e80b);},'ZvAuQ':function(_0x3f2fec,_0x252082){return _0x3f2fec instanceof _0x252082;},'NCtyF':_0x4dfbe8(0x24d),'KQZXT':'utf-8','KXstR':function(_0x3fe4a7,_0x488e2d,_0x4bda1c){return _0x3fe4a7(_0x488e2d,_0x4bda1c);},'yTQvX':function(_0x4863a8,_0x3d1258){return _0x4863a8 instanceof _0x3d1258;},'yWrXR':function(_0x1a82b3,_0x985ecc,_0x3d6f7a){return _0x1a82b3(_0x985ecc,_0x3d6f7a);},'ZReUW':function(_0x177779,_0x369712){return _0x177779(_0x369712);},'Nhfdb':function(_0xbae068,_0x44f8b6){return _0xbae068>_0x44f8b6;},'oeNyv':function(_0x1d782c,_0x818984){return _0x1d782c===_0x818984;},'HDJJo':_0x4dfbe8(0x21b)};if(!_0x3d3ab7[_0x4dfbe8(0x247)]&&!_0x3d3ab7['all'])throw new Error(_0x48b329['tRkqi']);let _0x4ef71e;try{_0x4ef71e=await fetchAuthConfig();}catch(_0x40c63a){throw new Error('Could\x20not\x20fetch\x20auth\x20config\x20('+(_0x40c63a instanceof Error?_0x40c63a[_0x4dfbe8(0x204)]:String(_0x40c63a))+').\x20Run:\x20ranger\x20setup');}if(!_0x4ef71e||!_0x4ef71e['environments']||_0x48b329['ZXgot'](Object[_0x4dfbe8(0x202)](_0x4ef71e[_0x4dfbe8(0x23b)])['length'],0x0))throw new Error(_0x4dfbe8(0x1f7));const _0x1f6e91=[];if(_0x3d3ab7['all']){const {envNames:_0x36326e,envTypes:_0x5614b7}=await getEnvNames();for(const _0x2c4565 of _0x36326e){if(_0x5614b7[_0x2c4565]==='ci')continue;_0x1f6e91['push'](_0x2c4565);}}else _0x3d3ab7[_0x4dfbe8(0x247)]&&_0x1f6e91[_0x4dfbe8(0x20c)](_0x3d3ab7[_0x4dfbe8(0x247)]);if(_0x1f6e91[_0x4dfbe8(0x224)]===0x0){console['log'](_0x48b329['HXjSd']);return;}const _0x322ad0=[];for(const _0x3e13dd of _0x1f6e91){const _0x406eac=_0x48b329[_0x4dfbe8(0x249)](getEnvDir,_0x3e13dd);if(!_0x48b329['OmPkg'](existsSync,_0x406eac)){_0x322ad0['push']({'kind':_0x4dfbe8(0x201),'profileName':_0x3e13dd,'reason':_0x48b329[_0x4dfbe8(0x237)]});continue;}const _0x5ea7f6=await _0x48b329[_0x4dfbe8(0x241)](loadSettings,_0x3e13dd),_0x50c42f=_0x5ea7f6[_0x4dfbe8(0x1fe)];if(!_0x50c42f){_0x322ad0[_0x4dfbe8(0x20c)]({'kind':_0x48b329['idJpj'],'profileName':_0x3e13dd,'reason':_0x4dfbe8(0x205)});continue;}const _0x3c9643=matchAuthEnvironment(_0x50c42f,_0x4ef71e);if(!_0x3c9643){_0x322ad0['push']({'kind':_0x48b329[_0x4dfbe8(0x240)],'profileName':_0x3e13dd,'reason':_0x48b329['nyVGa']});continue;}const _0x104fa6=_0x4ef71e['environments'][_0x3c9643],_0x389341=_0x104fa6?.['domains']??[],_0x10a992=_0x389341[_0x4dfbe8(0x243)](_0x53782a=>{try{return _0x48b329['AzkeC'](new URL(_0x53782a)['origin'],new URL(_0x50c42f)['origin']);}catch{return![];}}),_0x346954={};for(const [_0x185a89,_0x224af9]of Object[_0x4dfbe8(0x21c)](_0x5ea7f6)){if(_0x48b329['Huvsq'](_0x185a89,'baseUrl'))continue;if(_0x48b329['uXWnU'](_0x224af9,undefined))continue;_0x346954[_0x185a89]=_0x224af9;}!_0x10a992&&(_0x346954[_0x4dfbe8(0x1fe)]=_0x50c42f);const _0x294acc=_0x48b329[_0x4dfbe8(0x229)](join,_0x406eac,_0x48b329[_0x4dfbe8(0x233)]),_0x4c8a1f=existsSync(_0x294acc);_0x322ad0[_0x4dfbe8(0x20c)]({'kind':_0x48b329[_0x4dfbe8(0x206)],'profileName':_0x3e13dd,'envKey':_0x3c9643,'baseUrl':_0x50c42f,'preserveBaseUrl':!_0x10a992,'settings':_0x346954,'authJsonPath':_0x4c8a1f?_0x294acc:null});}console[_0x4dfbe8(0x23c)]('Plan:');for(const _0x1dce6a of _0x322ad0){console['log'](formatPlanLine(_0x1dce6a));}if(_0x3d3ab7[_0x4dfbe8(0x208)]){console[_0x4dfbe8(0x23c)](_0x48b329['qMGCd']);return;}const _0x310cfc=Boolean(process['stdin']['isTTY']&&process['stdout'][_0x4dfbe8(0x21d)]),_0x3bb00a=_0x322ad0['some'](_0x4565d4=>_0x4565d4[_0x4dfbe8(0x239)]===_0x4dfbe8(0x22d));if(_0x48b329[_0x4dfbe8(0x23a)](_0x3bb00a,_0x310cfc)&&!_0x3d3ab7['yes']){const {proceed:_0x3f0a7b}=await _0x28ea0f['prompt']([{'type':_0x48b329['OqFzC'],'name':_0x48b329[_0x4dfbe8(0x1f6)],'message':'Proceed?','default':![]}]);if(!_0x3f0a7b){console['log'](_0x4dfbe8(0x22c));return;}}const _0x10b475=_0x48b329[_0x4dfbe8(0x214)](getRangerDir);let _0x895d3a=![];if(existsSync(_0x10b475))try{_0x895d3a=await isPathGitTracked(_0x10b475);}catch{_0x895d3a=![];}_0x895d3a&&_0x48b329[_0x4dfbe8(0x1fd)](shouldWarnGitTrackedOnce,process[_0x4dfbe8(0x20d)]())&&(console[_0x4dfbe8(0x23c)](_0x4dfbe8(0x20f)),console['log'](_0x4dfbe8(0x207)),console['log'](_0x48b329[_0x4dfbe8(0x221)]),console[_0x4dfbe8(0x23c)](_0x48b329[_0x4dfbe8(0x22e)]),console[_0x4dfbe8(0x23c)](_0x48b329['QqUBy']));let _0x232834=0x0,_0x56ff4e=0x0,_0x386083=0x0,_0x4bb560=0x0;for(const _0x8e7e97 of _0x322ad0){if(_0x48b329[_0x4dfbe8(0x1fb)](_0x8e7e97[_0x4dfbe8(0x239)],_0x48b329[_0x4dfbe8(0x240)])){_0x4bb560++,_0x125ba3?.[_0x4dfbe8(0x238)](_0x48b329['AXaUu'],{'profileName':_0x8e7e97['profileName'],'reason':_0x8e7e97['reason']});continue;}_0x125ba3?.[_0x4dfbe8(0x234)](_0x4dfbe8(0x230),{'profileName':_0x8e7e97[_0x4dfbe8(0x247)],'envKey':_0x8e7e97[_0x4dfbe8(0x211)]});try{try{await _0x48b329[_0x4dfbe8(0x22b)](createCloudProfile,_0x8e7e97[_0x4dfbe8(0x247)],_0x8e7e97['envKey'],{'settings':_0x8e7e97[_0x4dfbe8(0x1f8)]});}catch(_0x82bd29){if(_0x48b329[_0x4dfbe8(0x225)](_0x82bd29,ApiError)&&_0x82bd29['status']===0x199){console[_0x4dfbe8(0x23c)](_0x4dfbe8(0x220)+_0x8e7e97['profileName']+':\x20cloud\x20profile\x20with\x20this\x20name\x20already\x20exists.\x20Skipping.'),_0x4bb560++,_0x125ba3?.['trackPhaseEnd'](_0x48b329[_0x4dfbe8(0x235)],{'profileName':_0x8e7e97['profileName'],'reason':_0x48b329[_0x4dfbe8(0x200)]});continue;}throw _0x82bd29;}let _0x2ed994=![],_0x22d741=![];if(_0x8e7e97['authJsonPath'])try{const _0x697bbd=await readFile(_0x8e7e97[_0x4dfbe8(0x22f)],_0x48b329[_0x4dfbe8(0x242)]),_0x3a95a=JSON['parse'](_0x697bbd);await _0x48b329['KXstR'](uploadCloudProfileSession,_0x8e7e97[_0x4dfbe8(0x247)],_0x3a95a),_0x2ed994=!![];}catch(_0x1c58a4){_0x22d741=!![],console['log'](_0x4dfbe8(0x220)+_0x8e7e97['profileName']+_0x4dfbe8(0x20a)+(_0x48b329['yTQvX'](_0x1c58a4,Error)?_0x1c58a4['message']:String(_0x1c58a4))+').\x20Cloud\x20profile\x20created;\x20local\x20auth.json\x20left\x20in\x20place.');}let _0x452ca1=![];if(_0x3d3ab7[_0x4dfbe8(0x246)]){const _0x32ae64=process[_0x4dfbe8(0x226)]['RANGER_TEST_USERNAME'],_0x488de6=process[_0x4dfbe8(0x226)][_0x4dfbe8(0x223)];if(_0x32ae64&&_0x488de6)try{await _0x48b329[_0x4dfbe8(0x22b)](saveCloudProfileCredentials,_0x8e7e97['profileName'],_0x32ae64,_0x488de6),_0x452ca1=!![];}catch(_0x28563f){console[_0x4dfbe8(0x23c)]('\x20\x20⚠\x20'+_0x8e7e97[_0x4dfbe8(0x247)]+':\x20failed\x20to\x20save\x20credentials\x20('+(_0x28563f instanceof Error?_0x28563f['message']:String(_0x28563f))+').');}else console[_0x4dfbe8(0x23c)]('\x20\x20⚠\x20'+_0x8e7e97[_0x4dfbe8(0x247)]+_0x4dfbe8(0x248));}if(_0x8e7e97[_0x4dfbe8(0x23d)]&&_0x8e7e97[_0x4dfbe8(0x1fe)])try{setProfileOverride(process['cwd'](),_0x8e7e97['profileName'],_0x4dfbe8(0x1fe),_0x8e7e97[_0x4dfbe8(0x1fe)]);}catch(_0x5c1621){console[_0x4dfbe8(0x23c)]('\x20\x20⚠\x20'+_0x8e7e97[_0x4dfbe8(0x247)]+':\x20failed\x20to\x20write\x20projects.json\x20override\x20('+(_0x48b329[_0x4dfbe8(0x24c)](_0x5c1621,Error)?_0x5c1621[_0x4dfbe8(0x204)]:_0x48b329['OmPkg'](String,_0x5c1621))+').');}const _0x16933c=getEnvDir(_0x8e7e97['profileName']);if(!_0x22d741&&existsSync(_0x16933c))try{await _0x48b329[_0x4dfbe8(0x216)](rm,_0x16933c,{'recursive':!![],'force':!![]}),_0x56ff4e++;}catch(_0xda0d99){console['log'](_0x4dfbe8(0x220)+_0x8e7e97[_0x4dfbe8(0x247)]+_0x4dfbe8(0x228)+_0x16933c+'\x20('+(_0x48b329[_0x4dfbe8(0x225)](_0xda0d99,Error)?_0xda0d99[_0x4dfbe8(0x204)]:String(_0xda0d99))+').');}_0x232834++,_0x8e7e97[_0x4dfbe8(0x23d)]&&_0x8e7e97[_0x4dfbe8(0x1fe)]?console[_0x4dfbe8(0x23c)]('\x20\x20✓\x20'+_0x8e7e97[_0x4dfbe8(0x247)]+_0x4dfbe8(0x23f)+_0x8e7e97[_0x4dfbe8(0x211)]+_0x4dfbe8(0x222)):console['log'](_0x4dfbe8(0x1f3)+_0x8e7e97[_0x4dfbe8(0x247)]+_0x4dfbe8(0x23f)+_0x8e7e97['envKey']+')'),_0x125ba3?.['trackPhaseEnd'](_0x4dfbe8(0x245),{'profileName':_0x8e7e97[_0x4dfbe8(0x247)],'envKey':_0x8e7e97['envKey'],'wasGitTracked':_0x895d3a,'hadSession':_0x2ed994,'savedCreds':_0x452ca1});}catch(_0x195ff2){_0x386083++,console['log'](_0x4dfbe8(0x210)+_0x8e7e97[_0x4dfbe8(0x247)]+'\x20failed:\x20'+(_0x48b329['yTQvX'](_0x195ff2,Error)?_0x195ff2['message']:String(_0x195ff2))),_0x125ba3?.['trackPhaseEnd']('profile.migrate.failed',{'profileName':_0x8e7e97['profileName'],'error':_0x195ff2 instanceof Error?_0x195ff2['message']:_0x48b329[_0x4dfbe8(0x21e)](String,_0x195ff2)});}}const _0x3706a7=[];if(_0x48b329[_0x4dfbe8(0x218)](_0x232834,0x0))_0x3706a7['push'](_0x232834+_0x4dfbe8(0x24a)+(_0x48b329['oeNyv'](_0x232834,0x1)?'':'s')+_0x4dfbe8(0x1ff));if(_0x48b329['Nhfdb'](_0x56ff4e,0x0))_0x3706a7[_0x4dfbe8(0x20c)]('Deleted\x20'+_0x56ff4e+'\x20local\x20director'+(_0x56ff4e===0x1?'y':_0x48b329[_0x4dfbe8(0x236)]));if(_0x4bb560>0x0)_0x3706a7[_0x4dfbe8(0x20c)](_0x4bb560+_0x4dfbe8(0x203));if(_0x48b329['Nhfdb'](_0x386083,0x0))_0x3706a7[_0x4dfbe8(0x20c)](_0x386083+'\x20failed');if(_0x3706a7['length']>0x0)console[_0x4dfbe8(0x23c)](_0x3706a7[_0x4dfbe8(0x1f9)]('.\x20')+'.');}
|
|
1
|
+
function _0x58f6(_0x3a241f,_0x251a9d){_0x3a241f=_0x3a241f-0x6d;var _0x2330c5=_0x2330();var _0x58f6ec=_0x2330c5[_0x3a241f];return _0x58f6ec;}(function(_0x38dc69,_0x5109ca){var _0xeb102=_0x58f6,_0x3c023d=_0x38dc69();while(!![]){try{var _0x4a3e48=-parseInt(_0xeb102(0x6d))/0x1+-parseInt(_0xeb102(0x72))/0x2*(-parseInt(_0xeb102(0x78))/0x3)+parseInt(_0xeb102(0x7c))/0x4+parseInt(_0xeb102(0x70))/0x5+-parseInt(_0xeb102(0x79))/0x6*(parseInt(_0xeb102(0x7d))/0x7)+parseInt(_0xeb102(0x74))/0x8*(parseInt(_0xeb102(0x77))/0x9)+parseInt(_0xeb102(0x7b))/0xa;if(_0x4a3e48===_0x5109ca)break;else _0x3c023d['push'](_0x3c023d['shift']());}catch(_0xe3ac25){_0x3c023d['push'](_0x3c023d['shift']());}}}(_0x2330,0x9efba));function _0x2330(){var _0x25080d=['To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','258372KxTWqN','2826Bbfiwh','6oszEpW','error','18655810nkCxbJ','1241288xPtoZh','8213639wicVro','exit','892103HHaoMl','pAVEM','Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a','790735kVrRIx','bHArb','20pVnUTR','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','104irYjsZ','zvfxO'];_0x2330=function(){return _0x25080d;};return _0x2330();}export async function migrateProfile(_0x27727b,_0x203107){var _0x1ec714=_0x58f6,_0x187af7={'bHArb':function(_0x556977,_0x5438c5){return _0x556977+_0x5438c5;},'hnyjD':function(_0x254d92,_0x5c31c4){return _0x254d92+_0x5c31c4;},'FOBjy':'ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','EwsNR':_0x1ec714(0x76),'pAVEM':'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','rKLpx':_0x1ec714(0x73),'zvfxO':'\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a'};console[_0x1ec714(0x7a)](_0x187af7['bHArb'](_0x187af7['hnyjD'](_0x187af7[_0x1ec714(0x71)](_0x187af7['hnyjD'](_0x187af7['FOBjy'],'\x0a'),_0x187af7['EwsNR']),_0x187af7[_0x1ec714(0x6e)])+'\x0a'+_0x187af7['rKLpx']+_0x187af7[_0x1ec714(0x75)]+'\x0a',_0x1ec714(0x6f))+'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.'),process[_0x1ec714(0x7e)](0x1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x2501(_0x47b9fa,_0x42ba67){_0x47b9fa=_0x47b9fa-0x1e0;const _0x59d1f3=_0x59d1();let _0x2501a1=_0x59d1f3[_0x47b9fa];return _0x2501a1;}(function(_0x5235bb,_0x136019){const _0x5a0618=_0x2501,_0x414075=_0x5235bb();while(!![]){try{const _0x21bdb4=parseInt(_0x5a0618(0x1e2))/0x1*(-parseInt(_0x5a0618(0x20f))/0x2)+parseInt(_0x5a0618(0x1f6))/0x3*(parseInt(_0x5a0618(0x1e3))/0x4)+-parseInt(_0x5a0618(0x211))/0x5+-parseInt(_0x5a0618(0x203))/0x6+parseInt(_0x5a0618(0x1f9))/0x7*(-parseInt(_0x5a0618(0x1fd))/0x8)+parseInt(_0x5a0618(0x201))/0x9*(parseInt(_0x5a0618(0x209))/0xa)+parseInt(_0x5a0618(0x1ee))/0xb*(parseInt(_0x5a0618(0x1fa))/0xc);if(_0x21bdb4===_0x136019)break;else _0x414075['push'](_0x414075['shift']());}catch(_0x29d3a5){_0x414075['push'](_0x414075['shift']());}}}(_0x59d1,0xabca7));import{join}from'path';import{existsSync}from'fs';function _0x59d1(){const _0x387215=['prompt','iJyXC','Would\x20you\x20like\x20to\x20install\x20skills?','bhfWA','wdpTY','415482vxJakH','yQqCd','⚠\x20Failed\x20to\x20enable\x20plugin:','3059XfvTID','4188hTgzZh','zqiBK','XOvmM','2792qoGgfL','wmPUC','\x0aYou\x20can\x20install\x20manually\x20with:','kDvqV','162tpyDcJ','SKILL.md','316122rmFDJy','log','enable','wantsSkillup','--scope','project','474630WOMvLg','tTioM','success','SCoEu','Where\x20should\x20the\x20plugin\x20be\x20installed?','slglg','7556aQsknX','pluginScope','3663165BKAVbU','user','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','✓\x20Ranger\x20skills\x20already\x20installed','already\x20enabled','ranger@trailhead','284hYJvNw','28eXEOlJ','✓\x20Claude\x20Code\x20plugin\x20enabled','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','marketplace','CNRnd','ijFCI','trailhead','.claude','AbbYr','confirm','includes','28072qBzalh','Project\x20(shared\x20with\x20team\x20via\x20git)','error'];_0x59d1=function(){return _0x387215;};return _0x59d1();}import _0x2a16ba from'inquirer';import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x5ef4da){const _0x4b96a5=_0x2501,_0x4de801={'yQqCd':'ranger@trailhead','wmPUC':function(_0x4c50bf,_0x5e4a5a){return _0x4c50bf(_0x5e4a5a);},'YsGld':function(_0x246d41,_0x302840,_0x4a673a){return _0x246d41(_0x302840,_0x4a673a);},'tTioM':'\x0a📦\x20Claude\x20Code\x20Plugin\x0a','SyHYB':'list','glfRC':_0x4b96a5(0x210),'DsSBc':_0x4b96a5(0x20d),'iMLAG':_0x4b96a5(0x212),'aqzgu':_0x4b96a5(0x1ef),'XOvmM':'plugin','QuGgf':_0x4b96a5(0x1e6),'slglg':'add','ODOeW':'\x0aYou\x20can\x20install\x20manually\x20with:','kDvqV':_0x4b96a5(0x207),'SCoEu':_0x4b96a5(0x208),'CNRnd':'❌\x20Failed\x20to\x20install\x20plugin:','HbXRd':'✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','ZfayD':_0x4b96a5(0x205),'bhfWA':function(_0x56e3d4){return _0x56e3d4();},'aXSUw':_0x4b96a5(0x1e0),'zdiPw':_0x4b96a5(0x1e4)},_0x246a9b=await isPluginInstalled(_0x4de801[_0x4b96a5(0x1f7)]);if(_0x246a9b)return console[_0x4b96a5(0x204)](_0x4b96a5(0x213)),![];const _0x4cca06=_0x4de801[_0x4b96a5(0x1fe)](existsSync,_0x4de801['YsGld'](join,getProjectRoot(),_0x4b96a5(0x1ea)));let _0x31ada5;if(_0x5ef4da)_0x31ada5=_0x5ef4da;else{if(_0x4cca06)_0x31ada5=_0x4b96a5(0x208);else{console[_0x4b96a5(0x204)](_0x4de801[_0x4b96a5(0x20a)]);const _0x24c041=await _0x2a16ba[_0x4b96a5(0x1f1)]([{'type':_0x4de801['SyHYB'],'name':_0x4de801['glfRC'],'message':_0x4de801['DsSBc'],'choices':[{'name':'User\x20(available\x20in\x20all\x20your\x20projects)','value':_0x4de801['iMLAG']},{'name':_0x4de801['aqzgu'],'value':'project'}],'default':_0x4de801['iMLAG']}]);_0x31ada5=_0x24c041[_0x4b96a5(0x210)];}}console[_0x4b96a5(0x204)]('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x31ada5+'\x20level)...\x0a');const _0x76ee07=await isMarketplaceAdded(_0x4b96a5(0x1e9));let _0x579a1e=_0x76ee07;if(_0x76ee07)console[_0x4b96a5(0x204)]('✓\x20Marketplace\x20already\x20added');else{const _0x4e7e99=await runClaudeCommand([_0x4de801[_0x4b96a5(0x1fc)],_0x4de801['QuGgf'],_0x4de801[_0x4b96a5(0x20e)],'ranger-testing/trailhead']);!_0x4e7e99[_0x4b96a5(0x20b)]?(console[_0x4b96a5(0x1f0)]('❌\x20Failed\x20to\x20add\x20marketplace:',_0x4e7e99['error']),console['log'](_0x4de801['ODOeW']),console[_0x4b96a5(0x204)]('\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead'),console[_0x4b96a5(0x204)](_0x4b96a5(0x1e5)+_0x31ada5)):_0x579a1e=!![];}if(_0x579a1e){const _0x263bd7=await runClaudeCommand([_0x4de801['XOvmM'],'install',_0x4b96a5(0x1e1),_0x4de801[_0x4b96a5(0x200)],_0x31ada5],{'cwd':_0x31ada5===_0x4de801[_0x4b96a5(0x20c)]?getProjectRoot():undefined});if(!_0x263bd7[_0x4b96a5(0x20b)])console['error'](_0x4de801[_0x4b96a5(0x1e7)],_0x263bd7[_0x4b96a5(0x1f0)]),console['log'](_0x4b96a5(0x1ff)),console[_0x4b96a5(0x204)](_0x4b96a5(0x1e5)+_0x31ada5);else{console[_0x4b96a5(0x204)](_0x4de801['HbXRd']);const _0x52fa31=['plugin',_0x4de801['ZfayD'],_0x4de801['yQqCd']];_0x31ada5===_0x4b96a5(0x208)&&_0x52fa31['push']('--scope','project');const _0x5c8c50=await runClaudeCommand(_0x52fa31,{'captureOutput':!![],'cwd':_0x31ada5===_0x4de801[_0x4b96a5(0x20c)]?_0x4de801[_0x4b96a5(0x1f4)](getProjectRoot):undefined}),_0xf791ca=_0x5c8c50['output']?.[_0x4b96a5(0x1ed)](_0x4de801['aXSUw']);!_0x5c8c50['success']&&!_0xf791ca?console['error'](_0x4b96a5(0x1f8),_0x5c8c50[_0x4b96a5(0x1f0)]):console[_0x4b96a5(0x204)](_0x4de801['zdiPw']);}}return!![];}export async function ensureClaudeSkills(_0x132a84){const _0x317e42=_0x2501,_0x5f28f7={'AbbYr':function(_0x4f9fa8,_0x254ec3,_0x3ae2ee,_0x5a4461){return _0x4f9fa8(_0x254ec3,_0x3ae2ee,_0x5a4461);},'ijFCI':function(_0x53328c,_0x3c461f){return _0x53328c(_0x3c461f);},'wdpTY':_0x317e42(0x212),'iJyXC':'ranger','GXlXG':_0x317e42(0x214),'CIEsB':_0x317e42(0x1ea),'zqiBK':_0x317e42(0x1f3)},_0x12c597=existsSync(_0x5f28f7[_0x317e42(0x1eb)](join,_0x5f28f7[_0x317e42(0x1e8)](getSkillsDir,_0x5f28f7[_0x317e42(0x1f5)]),_0x5f28f7[_0x317e42(0x1f2)],'SKILL.md')),_0x362d19=existsSync(join(getSkillsDir('project'),_0x5f28f7['iJyXC'],_0x317e42(0x202)));if(_0x12c597||_0x362d19)return console[_0x317e42(0x204)](_0x5f28f7['GXlXG']),![];const _0x35951c=existsSync(join(getProjectRoot(),_0x5f28f7['CIEsB']));let _0x183895=!![];if(_0x132a84)await _0x5f28f7['ijFCI'](skillup,{'autoInstall':_0x132a84,'suppressUsage':!![]});else{if(_0x35951c)await _0x5f28f7['ijFCI'](skillup,{'autoInstall':'project','suppressUsage':!![]});else{const _0x59ba52=await _0x2a16ba['prompt']([{'type':_0x317e42(0x1ec),'name':_0x317e42(0x206),'message':_0x5f28f7[_0x317e42(0x1fb)],'default':!![]}]);_0x183895=_0x59ba52[_0x317e42(0x206)],_0x183895&&await skillup({'suppressUsage':!![]});}}return _0x183895;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x7af2a8,_0x57da3c){const _0x30529f=_0x11c5,_0x50c721=_0x7af2a8();while(!![]){try{const _0x1a106f=parseInt(_0x30529f(0xa3))/0x1*(parseInt(_0x30529f(0x87))/0x2)+-parseInt(_0x30529f(0x97))/0x3+parseInt(_0x30529f(0xa0))/0x4*(-parseInt(_0x30529f(0x8b))/0x5)+parseInt(_0x30529f(0x89))/0x6*(parseInt(_0x30529f(0x95))/0x7)+-parseInt(_0x30529f(0x96))/0x8*(parseInt(_0x30529f(0x88))/0x9)+parseInt(_0x30529f(0xa2))/0xa*(-parseInt(_0x30529f(0x99))/0xb)+parseInt(_0x30529f(0x8d))/0xc;if(_0x1a106f===_0x57da3c)break;else _0x50c721['push'](_0x50c721['shift']());}catch(_0x47c911){_0x50c721['push'](_0x50c721['shift']());}}}(_0x3d0c,0xbf299));import{join}from'path';function _0x3d0c(){const _0x5c2dab=['opencode.json','@ranger-testing/opencode-plugin','19822wsOlZg','459ODKMuW','540pvOHkv','jpObw','629635GFirzq','viqTw','52524132uqNFFG','OopIx','uXnEj','project','yeVQo','eKCsE','BAgHo','LqZNB','12649SQdked','167512UilVmw','609207CqdWeg','eqNRx','2950783zJPrKS','includes','prompt','log','qDETz','isArray','utf-8','48ktnYrr','plugin','50MZgOKC','37HpzyWe','✓\x20OpenCode\x20plugin\x20configured','stringify'];_0x3d0c=function(){return _0x5c2dab;};return _0x3d0c();}import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0x20ee5c from'inquirer';function _0x11c5(_0x360d6c,_0xeff569){_0x360d6c=_0x360d6c-0x86;const _0x3d0cde=_0x3d0c();let _0x11c5f8=_0x3d0cde[_0x360d6c];return _0x11c5f8;}import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0x313d35){const _0x42e61b=_0x11c5,_0x335423={'LqZNB':function(_0x3f7478,_0x2f6bad,_0x218ad4){return _0x3f7478(_0x2f6bad,_0x218ad4);},'OopIx':function(_0xaec46e,_0x2e2938){return _0xaec46e(_0x2e2938);},'yeVQo':_0x42e61b(0xa6),'qDETz':'project','PdgZM':'\x0a📦\x20OpenCode\x20Plugin\x0a','jpObw':'pluginScope','TBvcu':'Where\x20should\x20the\x20plugin\x20be\x20installed?','uxkAg':'Project\x20(shared\x20with\x20team\x20via\x20git)','BAgHo':_0x42e61b(0x86),'hRAVW':'https://opencode.ai/config.json','viqTw':function(_0x4ecbf1,_0x2e93a5,_0x71000c){return _0x4ecbf1(_0x2e93a5,_0x71000c);},'uXnEj':_0x42e61b(0x9f),'eqNRx':function(_0xc5188f,_0x22c39d,_0x3f8036){return _0xc5188f(_0x22c39d,_0x3f8036);},'eKCsE':function(_0x5c91e1,_0x139c53){return _0x5c91e1+_0x139c53;}},_0xdae6f9=existsSync(_0x335423[_0x42e61b(0x94)](join,_0x335423[_0x42e61b(0x8e)](getOpencodeConfigDir,_0x42e61b(0x90)),_0x335423['yeVQo']));let _0x2cda11;if(_0x313d35)_0x2cda11=_0x313d35;else{if(_0xdae6f9)_0x2cda11=_0x335423[_0x42e61b(0x9d)];else{console['log'](_0x335423['PdgZM']);const _0x1555ed=await _0x20ee5c[_0x42e61b(0x9b)]([{'type':'list','name':_0x335423[_0x42e61b(0x8a)],'message':_0x335423['TBvcu'],'choices':[{'name':'User\x20(available\x20in\x20all\x20your\x20projects)','value':'user'},{'name':_0x335423['uxkAg'],'value':_0x335423['qDETz']}],'default':'user'}]);_0x2cda11=_0x1555ed['pluginScope'];}}const _0x2f66ac=_0x335423['LqZNB'](join,getOpencodeConfigDir(_0x2cda11),_0x335423[_0x42e61b(0x91)]),_0x5ca733=_0x335423[_0x42e61b(0x93)],_0xddddaa=_0x335423['hRAVW'];let _0x3562f3={};if(existsSync(_0x2f66ac))try{const _0x654826=await _0x335423[_0x42e61b(0x8c)](readFile,_0x2f66ac,_0x335423[_0x42e61b(0x8f)]);_0x3562f3=JSON['parse'](_0x654826);}catch(_0x447a1c){return console['error']('⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.'),{'configured':![],'scope':_0x2cda11,'error':'Failed\x20to\x20read\x20opencode.json','details':_0x447a1c};}const _0x176e3c=Array[_0x42e61b(0x9e)](_0x3562f3[_0x42e61b(0xa1)])?_0x3562f3[_0x42e61b(0xa1)]:[];if(_0x176e3c[_0x42e61b(0x9a)](_0x5ca733))return console[_0x42e61b(0x9c)]('✓\x20OpenCode\x20plugin\x20already\x20configured'),{'configured':![],'scope':_0x2cda11};return _0x3562f3['$schema']=_0x3562f3['$schema']||_0xddddaa,_0x3562f3['plugin']=[..._0x176e3c,_0x5ca733],await _0x335423[_0x42e61b(0x98)](mkdir,getOpencodeConfigDir(_0x2cda11),{'recursive':!![]}),await writeFile(_0x2f66ac,_0x335423[_0x42e61b(0x92)](JSON[_0x42e61b(0xa5)](_0x3562f3,null,0x2),'\x0a')),console[_0x42e61b(0x9c)](_0x42e61b(0xa4)),{'configured':!![],'scope':_0x2cda11};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x140f0a,_0xd7ff77){const _0x2a4083=_0x290b,_0x122af1=_0x140f0a();while(!![]){try{const _0x58abc7=-parseInt(_0x2a4083(0x227))/0x1*(parseInt(_0x2a4083(0x1f5))/0x2)+-parseInt(_0x2a4083(0x214))/0x3*(-parseInt(_0x2a4083(0x202))/0x4)+-parseInt(_0x2a4083(0x224))/0x5+-parseInt(_0x2a4083(0x1fa))/0x6*(-parseInt(_0x2a4083(0x22e))/0x7)+parseInt(_0x2a4083(0x20e))/0x8+parseInt(_0x2a4083(0x221))/0x9+parseInt(_0x2a4083(0x21b))/0xa;if(_0x58abc7===_0xd7ff77)break;else _0x122af1['push'](_0x122af1['shift']());}catch(_0x3ca121){_0x122af1['push'](_0x122af1['shift']());}}}(_0x1eee,0xcffab));import{mkdir,readFile,readdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';function _0x1eee(){const _0x3e4556=['bGFVH','4543820htHfVj','Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.','LIuzH','marketplace','nBLVw','OVkbV','1551960LvDbiQ','\x22\x20has\x20no\x20settings.json.\x20Use\x20--base-url\x20to\x20configure\x20it.','log','6181975TvIkbx','message','ranger@trailhead','9754qJwmEZ','profile','HnQJM','Uldkg','RwnrP','WXQVa','plugin','1981fahXMk','vTWxu','map','cRImN','SVowi','dir_setup','EaTji','filter','profile_activate','16bqjAjo','skipChromium','✓\x20Active\x20profile:\x20','trailhead','auth.json.enc','2982odlqEx','MyoRj','trackPhaseStart','NSfta','isDirectory','keYNb','FZojo','CI\x20profile\x20\x22','12eGItVt','error','ffqCM','success','USepq','trackPhaseEnd','lMxsh','sessions','baseUrl','xMqhU','ToCOd','\x20\x20No\x20auth\x20state\x20found\x20(app\x20may\x20not\x20require\x20authentication)','5835072QPKham','RDmEk','length','path','tpapH','name','669453nFWJqC','add','eJPgp','ranger-testing/trailhead','No\x20API\x20token\x20available\x20for\x20decryption','No\x20CI\x20profiles\x20found\x20in\x20.ranger/ci/.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a'];_0x1eee=function(){return _0x3e4556;};return _0x1eee();}import{authenticate,ensureRangerDir,ensureChromium,writeRangerGitignore}from'./start.js';import{skillup}from'./skillup.js';import{getRangerDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{saveSettings}from'./utils/settings.js';import{decrypt}from'./utils/crypto.js';import{getToken}from'./utils/keychain.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'./utils/claudePlugin.js';function _0x290b(_0xf4a8d0,_0x494036){_0xf4a8d0=_0xf4a8d0-0x1f4;const _0x1eee07=_0x1eee();let _0x290b30=_0x1eee07[_0xf4a8d0];return _0x290b30;}async function findCiProfile(_0x598683){const _0x57c937=_0x290b,_0x551121={'wjMfb':function(_0x56c2aa,_0x150a15,_0x2c7554){return _0x56c2aa(_0x150a15,_0x2c7554);},'WCnnM':function(_0x1d96f4,_0x189fb7,_0x7fd202){return _0x1d96f4(_0x189fb7,_0x7fd202);},'jLZwr':function(_0x3f8cf5,_0x147d29){return _0x3f8cf5(_0x147d29);},'dyiTZ':'No\x20CI\x20profiles\x20found.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','ToCOd':_0x57c937(0x21c),'RwnrP':function(_0x98a612,_0x367597,_0x5040d2){return _0x98a612(_0x367597,_0x5040d2);},'USepq':function(_0x5496d1,_0x40e702){return _0x5496d1===_0x40e702;},'orwbt':function(_0x4356fd,_0xc6055){return _0x4356fd===_0xc6055;}},_0x485e63=getRangerDir(),_0x1e1ae5=_0x551121['wjMfb'](join,_0x485e63,'ci');if(_0x598683){const _0x3cb93c=_0x551121['WCnnM'](join,_0x1e1ae5,_0x598683);return{'name':_0x598683,'path':_0x3cb93c};}if(!_0x551121['jLZwr'](existsSync,_0x1e1ae5))throw new Error(_0x551121['dyiTZ']+_0x551121[_0x57c937(0x20c)]);const _0x28e913=await _0x551121[_0x57c937(0x22b)](readdir,_0x1e1ae5,{'withFileTypes':!![]}),_0x307f4=_0x28e913[_0x57c937(0x235)](_0x2e24df=>_0x2e24df[_0x57c937(0x1fe)]())[_0x57c937(0x230)](_0x23666d=>_0x23666d[_0x57c937(0x213)]);if(_0x551121[_0x57c937(0x206)](_0x307f4[_0x57c937(0x210)],0x0))throw new Error(_0x57c937(0x219)+_0x551121['ToCOd']);if(_0x551121['orwbt'](_0x307f4[_0x57c937(0x210)],0x1)){const _0x128438=_0x307f4[0x0];return console['log']('Auto-detected\x20CI\x20profile:\x20'+_0x128438),{'name':_0x128438,'path':join(_0x1e1ae5,_0x128438)};}throw new Error('Multiple\x20CI\x20profiles\x20found:\x20'+_0x307f4['join'](',\x20')+'.\x20Use\x20--profile\x20to\x20specify\x20which\x20one.');}async function installPluginNonInteractive(){const _0x4e54e2=_0x290b,_0x66ce29={'cRImN':function(_0x28bdba,_0x36b26e){return _0x28bdba(_0x36b26e);},'MyoRj':_0x4e54e2(0x1f8),'kfUzD':_0x4e54e2(0x217),'FZojo':'Failed\x20to\x20add\x20marketplace:','LIuzH':_0x4e54e2(0x226),'ffqCM':'--scope','keYNb':'project','zoNcC':'✓\x20Claude\x20Code\x20plugin\x20installed'},_0x26b7d4=await isPluginInstalled('ranger@trailhead');if(_0x26b7d4)return console[_0x4e54e2(0x223)]('✓\x20Claude\x20Code\x20plugin\x20already\x20installed'),![];console[_0x4e54e2(0x223)]('Installing\x20Claude\x20Code\x20plugin\x20(project\x20level)...');const _0x122382=await _0x66ce29[_0x4e54e2(0x231)](isMarketplaceAdded,_0x66ce29[_0x4e54e2(0x1fb)]);let _0x1fba21=_0x122382;if(_0x122382)console[_0x4e54e2(0x223)]('✓\x20Marketplace\x20already\x20added');else{const _0x1c8bed=await runClaudeCommand(['plugin',_0x4e54e2(0x21e),_0x4e54e2(0x215),_0x66ce29['kfUzD']]);!_0x1c8bed[_0x4e54e2(0x205)]?(console['error'](_0x66ce29[_0x4e54e2(0x200)],_0x1c8bed['error']),console[_0x4e54e2(0x223)]('You\x20can\x20install\x20manually:\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead')):_0x1fba21=!![];}if(_0x1fba21){const _0x112d3d=await runClaudeCommand(['plugin','install',_0x66ce29[_0x4e54e2(0x21d)],_0x66ce29[_0x4e54e2(0x204)],_0x66ce29[_0x4e54e2(0x1ff)]]);!_0x112d3d[_0x4e54e2(0x205)]?(console['error']('Failed\x20to\x20install\x20plugin:',_0x112d3d[_0x4e54e2(0x203)]),console[_0x4e54e2(0x223)]('You\x20can\x20install\x20manually:\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20project')):console[_0x4e54e2(0x223)](_0x66ce29['zoNcC']);}return!![];}export async function setupCi(_0x166bc3,_0x3f4cde,_0x12facc){const _0x232e07=_0x290b,_0x1d97f8={'HnQJM':'\x0a🔧\x20Ranger\x20CI\x20Setup\x0a','RDmEk':'auth','jPdHh':_0x232e07(0x233),'NSfta':function(_0x50b903,_0x3f3f42){return _0x50b903(_0x3f3f42);},'SVowi':function(_0x2c1dd5,_0x2deced,_0x27a6ad){return _0x2c1dd5(_0x2deced,_0x27a6ad);},'WDScY':_0x232e07(0x209),'EaTji':function(_0x15ad09,_0xa2643a){return _0x15ad09(_0xa2643a);},'yLAVH':function(_0x41dd61,_0x268d6c,_0x412b13){return _0x41dd61(_0x268d6c,_0x412b13);},'vTWxu':'✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','WXQVa':function(_0x215145){return _0x215145();},'eJPgp':'chromium','tpapH':function(_0x3b4993,_0x13cae0,_0x222b99){return _0x3b4993(_0x13cae0,_0x222b99);},'xMqhU':'auth.json','axGuP':_0x232e07(0x1f9),'Uldkg':function(_0x193565,_0x1da69b){return _0x193565(_0x1da69b);},'bGFVH':function(_0xccbd33,_0x8175d5){return _0xccbd33(_0x8175d5);},'lMxsh':function(_0x1f1f81,_0x77aef3,_0x268135){return _0x1f1f81(_0x77aef3,_0x268135);},'ZNcRD':'✓\x20Auth\x20state\x20found','OVkbV':_0x232e07(0x20d),'rFMzF':'skills','nBLVw':'project'};console['log'](_0x1d97f8[_0x232e07(0x229)]),_0x12facc?.[_0x232e07(0x1fc)](_0x1d97f8[_0x232e07(0x20f)]),await authenticate(_0x166bc3),_0x12facc?.[_0x232e07(0x207)](_0x1d97f8['RDmEk']),_0x12facc?.[_0x232e07(0x1fc)](_0x1d97f8['jPdHh']);const {path:_0xfafbd3,installed:_0x45aaa0}=await ensureRangerDir();await _0x1d97f8[_0x232e07(0x1fd)](writeRangerGitignore,_0xfafbd3);const _0x55ade6=_0x1d97f8[_0x232e07(0x232)](join,_0xfafbd3,_0x1d97f8['WDScY']);!_0x1d97f8[_0x232e07(0x234)](existsSync,_0x55ade6)&&await _0x1d97f8['yLAVH'](mkdir,_0x55ade6,{'recursive':!![]});_0x12facc?.[_0x232e07(0x207)](_0x232e07(0x233),{'installed':_0x45aaa0}),_0x12facc?.[_0x232e07(0x1fc)]('chromium');let _0x404216=![];_0x3f4cde?.[_0x232e07(0x1f6)]?console['log'](_0x1d97f8[_0x232e07(0x22f)]):_0x404216=await _0x1d97f8[_0x232e07(0x22c)](ensureChromium);_0x12facc?.['trackPhaseEnd'](_0x1d97f8[_0x232e07(0x216)],{'installed':_0x404216,'skipped':!!_0x3f4cde?.[_0x232e07(0x1f6)]}),_0x12facc?.['trackPhaseStart']('profile_activate');const _0x51cb85=await _0x1d97f8[_0x232e07(0x1fd)](findCiProfile,_0x3f4cde?.[_0x232e07(0x228)]);let _0x1c8f32=![];_0x3f4cde?.['baseUrl']&&(await mkdir(_0x51cb85[_0x232e07(0x211)],{'recursive':!![]}),await _0x1d97f8[_0x232e07(0x212)](saveSettings,_0x51cb85[_0x232e07(0x213)],{'baseUrl':_0x3f4cde[_0x232e07(0x20a)],'headless':!![]}),console['log']('✓\x20Created\x20profile\x20settings:\x20baseUrl='+_0x3f4cde[_0x232e07(0x20a)]),_0x1c8f32=!![]);const _0x26333d=_0x1d97f8[_0x232e07(0x212)](join,_0x51cb85['path'],'settings.json');if(!existsSync(_0x26333d)&&!_0x1c8f32)throw new Error(_0x232e07(0x201)+_0x51cb85['name']+_0x232e07(0x222));const _0x15e2d7=join(_0x51cb85[_0x232e07(0x211)],_0x1d97f8[_0x232e07(0x20b)]),_0x19c5af=_0x1d97f8['SVowi'](join,_0x51cb85['path'],_0x1d97f8['axGuP']),_0x2bedc4=_0x1d97f8[_0x232e07(0x22a)](existsSync,_0x15e2d7),_0x4b9a61=_0x1d97f8[_0x232e07(0x21a)](existsSync,_0x19c5af);if(_0x4b9a61)try{const _0x18aebb=await getToken();if(!_0x18aebb)throw new Error(_0x232e07(0x218));const _0x101d47=await readFile(_0x19c5af);_0x1d97f8[_0x232e07(0x208)](decrypt,_0x101d47,_0x18aebb),console[_0x232e07(0x223)]('✓\x20Encrypted\x20auth\x20verified\x20(will\x20decrypt\x20at\x20runtime)');}catch(_0x14b041){const _0x26d92d=_0x14b041 instanceof Error?_0x14b041[_0x232e07(0x225)]:String(_0x14b041);throw new Error('Failed\x20to\x20verify\x20encrypted\x20auth\x20for\x20profile\x20\x22'+_0x51cb85['name']+'\x22:\x20'+_0x26d92d);}else _0x2bedc4?console['log'](_0x1d97f8['ZNcRD']):console['log'](_0x1d97f8[_0x232e07(0x220)]);await writeActiveProfileName(_0x51cb85['name']),console[_0x232e07(0x223)](_0x232e07(0x1f7)+_0x51cb85[_0x232e07(0x213)]),_0x12facc?.[_0x232e07(0x207)](_0x232e07(0x1f4),{'profileName':_0x51cb85[_0x232e07(0x213)],'hasAuth':_0x2bedc4,'hasEncryptedAuth':_0x4b9a61,'createdSettings':_0x1c8f32}),_0x12facc?.['trackPhaseStart'](_0x232e07(0x22d));const _0x29fc77=await installPluginNonInteractive();_0x12facc?.['trackPhaseEnd'](_0x232e07(0x22d),{'installed':_0x29fc77}),_0x12facc?.[_0x232e07(0x1fc)](_0x1d97f8['rFMzF']),await skillup({'autoInstall':_0x1d97f8[_0x232e07(0x21f)]}),_0x12facc?.[_0x232e07(0x207)]('skills'),console['log']('\x0a✅\x20Ranger\x20CI\x20setup\x20complete!\x0a');}
|
|
1
|
+
function _0x3db3(){var _0x4c02fd=['111kywcTW','4435408WDEtDh','ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','onfFN','8835750icKZIa','680KygXFw','4696MrlAZU','64550YfFTxa','811996YTOACS','3798195tnMnxA','121545Kpanvy','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','error','14903WlKoxz','LbdDQ','\x20\x20https://docs.ranger.net/main/concepts/profiles'];_0x3db3=function(){return _0x4c02fd;};return _0x3db3();}function _0x41fa(_0x2fa12a,_0x47320f){_0x2fa12a=_0x2fa12a-0x16e;var _0x3db314=_0x3db3();var _0x41fa34=_0x3db314[_0x2fa12a];return _0x41fa34;}(function(_0x62ebf9,_0x2bcbb8){var _0x4912ff=_0x41fa,_0xf36398=_0x62ebf9();while(!![]){try{var _0x195701=parseInt(_0x4912ff(0x172))/0x1+parseInt(_0x4912ff(0x171))/0x2*(-parseInt(_0x4912ff(0x17b))/0x3)+parseInt(_0x4912ff(0x17c))/0x4+parseInt(_0x4912ff(0x173))/0x5+parseInt(_0x4912ff(0x16e))/0x6+parseInt(_0x4912ff(0x178))/0x7*(-parseInt(_0x4912ff(0x170))/0x8)+-parseInt(_0x4912ff(0x174))/0x9*(parseInt(_0x4912ff(0x16f))/0xa);if(_0x195701===_0x2bcbb8)break;else _0xf36398['push'](_0xf36398['shift']());}catch(_0x963c28){_0xf36398['push'](_0xf36398['shift']());}}}(_0x3db3,0xc115a));export async function setupCi(_0x3f5e4f,_0x393669,_0x2b2736){var _0x9723f9=_0x41fa,_0x230908={'onfFN':function(_0x5936f7,_0x288df7){return _0x5936f7+_0x288df7;},'LbdDQ':'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a'};console[_0x9723f9(0x177)](_0x230908[_0x9723f9(0x17e)](_0x230908[_0x9723f9(0x17e)](_0x9723f9(0x17d)+'\x0a'+_0x9723f9(0x176),_0x9723f9(0x175))+'\x0a',_0x230908[_0x9723f9(0x179)])+_0x9723f9(0x17a)),process['exit'](0x1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x19afd1,_0x24a29e){const _0x1a4ddd=_0x4c3d,_0x218ef2=_0x19afd1();while(!![]){try{const _0x29a26b=-parseInt(_0x1a4ddd(0xcd))/0x1+parseInt(_0x1a4ddd(0xc6))/0x2+parseInt(_0x1a4ddd(0xcc))/0x3*(parseInt(_0x1a4ddd(0xca))/0x4)+parseInt(_0x1a4ddd(0xb3))/0x5*(-parseInt(_0x1a4ddd(0xcf))/0x6)+parseInt(_0x1a4ddd(0xaf))/0x7+-parseInt(_0x1a4ddd(0xcb))/0x8+parseInt(_0x1a4ddd(0xc7))/0x9;if(_0x29a26b===_0x24a29e)break;else _0x218ef2['push'](_0x218ef2['shift']());}catch(_0x236127){_0x218ef2['push'](_0x218ef2['shift']());}}}(_0x54e6,0x2d159));import{basename}from'path';import _0x5bee72 from'inquirer';import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';function _0x4c3d(_0x4c9c8b,_0x1156bc){_0x4c9c8b=_0x4c9c8b-0xaa;const _0x54e658=_0x54e6();let _0x4c3d53=_0x54e658[_0x4c9c8b];return _0x4c3d53;}export async function skillup(_0x293953={}){const _0x1bf5c4=_0x4c3d,_0xe40e70={'yWPPW':'\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','XUWmQ':'\x20--opencode','sIbll':function(_0x5e4838,_0x484546){return _0x5e4838===_0x484546;},'YiDdS':'opencode','qqZVf':function(_0x305e7c){return _0x305e7c();},'PBBHY':function(_0x55733b,_0x41dcb3){return _0x55733b===_0x41dcb3;},'uGxJx':_0x1bf5c4(0xbb),'kngmP':function(_0x26c9d6,_0xdd4209){return _0x26c9d6===_0xdd4209;},'DHdtA':_0x1bf5c4(0xaa),'SBJFH':'project','cWlce':function(_0x58ff1e){return _0x58ff1e();},'ZlqZB':'\x0a📦\x20Installing\x20skills...\x0a','aEQcW':'ranger','jYeDS':function(_0x19744b,_0x18717f){return _0x19744b>_0x18717f;},'AzJLi':function(_0x361130,_0x58dd48){return _0x361130===_0x58dd48;},'ZGXbo':'user-level'};console[_0x1bf5c4(0xb0)](_0x1bf5c4(0xc3));const _0x35140e=_0x293953[_0x1bf5c4(0xc8)]??_0x1bf5c4(0xbe),_0x4083fa=await getToken();if(!_0x4083fa){console[_0x1bf5c4(0xb0)]('❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a'),console['log']('To\x20get\x20started:'),console['log'](_0xe40e70[_0x1bf5c4(0xb6)]),console['log']('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0x35140e===_0x1bf5c4(0xac)?_0xe40e70['XUWmQ']:'')+'\x20<your-api-token>'),console['log']('\x20\x203.\x20Run:\x20ranger\x20skillup'+(_0xe40e70[_0x1bf5c4(0xce)](_0x35140e,_0xe40e70[_0x1bf5c4(0xae)])?_0xe40e70['XUWmQ']:'')+'\x0a');return;}console[_0x1bf5c4(0xb0)]('✓\x20Found\x20API\x20token');const _0x17e135=_0xe40e70['qqZVf'](getProjectRoot),_0x4b8977=basename(_0x17e135),_0xc87183=_0xe40e70['PBBHY'](_0x35140e,_0xe40e70[_0x1bf5c4(0xae)])?getOpencodeConfigDir(_0xe40e70['uGxJx'])+_0x1bf5c4(0xc0):getClaudeConfigDir()+_0x1bf5c4(0xc0),_0x419eb1=_0xe40e70['kngmP'](_0x35140e,_0xe40e70['YiDdS'])?_0x17e135+_0x1bf5c4(0xbd):_0x17e135+_0x1bf5c4(0xb5),_0x37b91f=process['stdin']['isTTY']&&process['stdout']['isTTY'];let _0x48eb0c;if(_0x293953[_0x1bf5c4(0xb7)])_0x48eb0c=_0x293953['autoInstall'];else{if(_0x37b91f){const _0x210dfd=await _0x5bee72['prompt']([{'type':_0xe40e70['DHdtA'],'name':_0x1bf5c4(0xb2),'message':'Where\x20should\x20skills\x20be\x20installed?','choices':[{'name':'All\x20projects\x20('+_0xc87183+')','value':_0xe40e70['uGxJx']},{'name':_0x1bf5c4(0xab)+_0x419eb1+')','value':_0xe40e70['SBJFH']}]}]);_0x48eb0c=_0x210dfd[_0x1bf5c4(0xb2)];}else _0x48eb0c=_0x1bf5c4(0xc9),console['log']('Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20('+_0x419eb1+')');}let _0x20eefe=0x0;const _0x32699d=_0xe40e70[_0x1bf5c4(0xc2)](getCurrentVersion);console[_0x1bf5c4(0xb0)](_0xe40e70['ZlqZB']);try{const _0x5938d5=await installSkill(_0xe40e70[_0x1bf5c4(0xad)],{'cliVersion':_0x32699d,'level':_0x48eb0c,'platform':_0x35140e});_0x5938d5&&_0x20eefe++;}catch(_0x838b86){console[_0x1bf5c4(0xb8)](_0x1bf5c4(0xc4),_0x838b86 instanceof Error?_0x838b86['message']:_0x838b86);}if(_0xe40e70[_0x1bf5c4(0xb4)](_0x20eefe,0x0)){const _0x3e12db=_0xe40e70[_0x1bf5c4(0xc5)](_0x48eb0c,_0x1bf5c4(0xbb))?_0xe40e70['ZGXbo']:_0x1bf5c4(0xba);console[_0x1bf5c4(0xb0)](_0x1bf5c4(0xb1)+_0x20eefe+'\x20'+_0x3e12db+'\x20skill'+(_0x20eefe>0x1?'s':'')+'\x20successfully!\x0a'),!_0x293953[_0x1bf5c4(0xbf)]&&(console['log'](_0x1bf5c4(0xc1)),_0x35140e===_0xe40e70[_0x1bf5c4(0xae)]?console['log'](_0x1bf5c4(0xb9)):console['log']('\x20\x20-\x20Open\x20Claude\x20Code\x20in\x20plan\x20mode\x20and\x20run\x20/ranger:enable.\x20Plan\x20out\x20a\x20UI\x20feature\x20with\x20Ranger\x20and\x20watch\x20Ranger\x20test\x20it\x20for\x20you!'));}else console[_0x1bf5c4(0xb0)](_0x1bf5c4(0xbc));}function _0x54e6(){const _0x203f0d=['YiDdS','1182272Zrfnjl','log','\x0a✅\x20Installed\x20','installLevel','10xeAJPO','jYeDS','/.claude/skills/','yWPPW','autoInstall','warn','\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','project-level','user','\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a','/.opencode/skills/','claude','suppressUsage','/skills/','To\x20use:','cWlce','\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','AzJLi','353262WisdEP','3601593LaQPue','platform','project','28716YmmURR','2373224Zodddc','27LUIVeT','106657MitytL','sIbll','667020eVLudx','list','This\x20project\x20only\x20(','opencode','aEQcW'];_0x54e6=function(){return _0x203f0d;};return _0x54e6();}
|
package/build/commands/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x3ea4f4=_0x3261;(function(_0x157bb2,_0x149e1d){const _0x3a0ef0=_0x3261,_0x234101=_0x157bb2();while(!![]){try{const _0x5d9459=-parseInt(_0x3a0ef0(0x156))/0x1*(parseInt(_0x3a0ef0(0x145))/0x2)+parseInt(_0x3a0ef0(0x101))/0x3*(-parseInt(_0x3a0ef0(0x14f))/0x4)+-parseInt(_0x3a0ef0(0xf7))/0x5+parseInt(_0x3a0ef0(0x116))/0x6*(-parseInt(_0x3a0ef0(0x143))/0x7)+parseInt(_0x3a0ef0(0x155))/0x8*(-parseInt(_0x3a0ef0(0x13d))/0x9)+parseInt(_0x3a0ef0(0xee))/0xa*(parseInt(_0x3a0ef0(0x147))/0xb)+parseInt(_0x3a0ef0(0xef))/0xc*(parseInt(_0x3a0ef0(0x130))/0xd);if(_0x5d9459===_0x149e1d)break;else _0x234101['push'](_0x234101['shift']());}catch(_0x5dbe12){_0x234101['push'](_0x234101['shift']());}}}(_0x4ff5,0x21f83));import{mkdir,writeFile}from'fs/promises';function _0x4ff5(){const _0x310c9d=['3434mZLyHL','scope','2620222Vmxblr','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','✓\x20Skipping\x20authentication\x20(--skip-auth)','skipped','UszOj','Validating\x20API\x20token...','\x0aTo\x20verify\x20with\x20a\x20browser,\x20set\x20','iAySA','8ZMiAxR','success','\x20for\x20explicit\x20profile\x20management).','skipChromium','install','...','8DVsEYP','157dDSZGf','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','allowInsecureLocalhost','ignore','skipAuth','TZeIH','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','gjYHz','\x20when\x20the\x20org\x27s\x20login','skills','IHcSx','BsZIG','OXvJa','bCYOw','10idQGEP','2835132cURzGR','executablePath','env','edSIh','DCADY','\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','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','✓\x20Authenticated\x20to\x20','1157785oKoNvM','stdout','zWhdO','\x20(fallback\x20version)','(and\x20','dSHDG','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','lqDNM','message','--with-deps','130671RNwOcA','XPQrt','/ranger:enable','mxgxC','npx','existing_token','version','plugin','local','DMPGc','win32','✓\x20Created\x20.ranger/.gitignore','status','OYYxY','prompt','\x0aIn\x20Claude\x20Code,\x20run\x20','\x0a\x20\x20config\x20uses\x20username+password).\x20Orgs\x20on\x20SSO/SAML/OAuth','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','playwright/package.json','✓\x20Exported\x20credentials\x20for\x20CI','RANGER_TEST_USERNAME','78RXolYP','\x0a❌\x20Profile\x20setup\x20failed:','log','inherit','PuUqc','rSlbU','error','✓\x20Playwright\x20Chromium\x20browser\x20found','user','✓\x20Created\x20~/.ranger/\x20directory','zGajF','\x0aInstalling\x20Chromium\x20browser...\x0a','method','close','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','uzsYz','ranger\x20profile\x20add','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','fKaXQ','warn','trackPhaseStart','resolve','Authentication\x20failed:\x20','bwayW','ranger','platform','39JuqIyC',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','haYUj','uOkPp','opencode','auth','trackPhaseEnd','chromium','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','playwright@','You\x20can\x20install\x20it\x20manually\x20by\x20running:','url','\x20\x20npx\x20playwright@','1187874PbnTkg','BncsG','\x1b[0m','provided_token','GoFbM','nyiXl','47180wYuxAB','oYtHj'];_0x4ff5=function(){return _0x310c9d;};return _0x4ff5();}import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x3e7fb1 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';function _0x3261(_0x486c45,_0xb20c4c){_0x486c45=_0x486c45-0xe2;const _0x4ff577=_0x4ff5();let _0x32613b=_0x4ff577[_0x486c45];return _0x32613b;}import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.58.2';const bold=_0x3c92ca=>'\x1b[1m'+_0x3c92ca+_0x3ea4f4(0x13f);export function getPlaywrightVersion(){const _0x550fd6=_0x3ea4f4;try{const _0x23e827=require[_0x550fd6(0x12b)](_0x550fd6(0x113)),_0x3ef905=require(_0x23e827);return _0x3ef905[_0x550fd6(0x107)];}catch{return null;}}export function installChromiumBinary(_0x2d3bd1,_0x827917=![]){const _0x41fe4f=_0x3ea4f4,_0x423535={'shAUi':_0x41fe4f(0x153),'tXdFX':'chromium','iAySA':_0x41fe4f(0x119),'KwMDV':_0x41fe4f(0x11c)};return new Promise((_0x4b9c83,_0xc7e75f)=>{const _0x183de=_0x41fe4f,_0x34e5de={'UszOj':function(_0x2c9934){return _0x2c9934();},'bUeLo':function(_0x550016,_0xe33811){return _0x550016(_0xe33811);}},_0x5609b9=[_0x183de(0x139)+_0x2d3bd1,_0x423535['shAUi'],..._0x827917?[_0x183de(0x100)]:[],_0x423535['tXdFX']],_0x512311=spawn(_0x183de(0x105),_0x5609b9,{'stdio':[_0x183de(0xe3),_0x423535[_0x183de(0x14e)],_0x423535[_0x183de(0x14e)]],'shell':process[_0x183de(0x12f)]===_0x183de(0x10b)});_0x512311['on'](_0x183de(0x123),_0x13a5b6=>{const _0x5d4d7c=_0x183de;_0x13a5b6===0x0?_0x34e5de[_0x5d4d7c(0x14b)](_0x4b9c83):_0xc7e75f(new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x13a5b6));}),_0x512311['on'](_0x423535['KwMDV'],_0x556891=>{_0x34e5de['bUeLo'](_0xc7e75f,_0x556891);});});}export async function authenticate(_0x7e552e){const _0x41ab4b=_0x3ea4f4,_0x40c2ba={'BsZIG':_0x41ab4b(0x106),'jLHpm':function(_0x3c3703){return _0x3c3703();},'IHcSx':function(_0x2c95d4,_0x128245){return _0x2c95d4 instanceof _0x128245;}};if(!_0x7e552e){const _0x2cd25e=await getToken();if(_0x2cd25e){const _0x374812=await getCurrentUser(_0x2cd25e);if(_0x374812[_0x41ab4b(0x150)])return console[_0x41ab4b(0x118)]('✓\x20Already\x20authenticated\x20to\x20'+_0x374812[_0x41ab4b(0x11e)]['organizationName']),{'token':_0x2cd25e,'method':_0x40c2ba[_0x41ab4b(0xeb)]};}try{_0x7e552e=await _0x40c2ba['jLHpm'](runDeviceAuthFlow);}catch(_0x2f4149){throw new Error(_0x41ab4b(0x12c)+(_0x40c2ba[_0x41ab4b(0xea)](_0x2f4149,Error)?_0x2f4149['message']:_0x2f4149));}const _0x423fbf=await getCurrentUser(_0x7e552e);if(!_0x423fbf['success'])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x423fbf['error']);return console['log'](_0x41ab4b(0xf6)+_0x423fbf['user']['organizationName']),{'token':_0x7e552e,'method':'device_auth'};}console['log'](_0x41ab4b(0x14c));const _0x46a98a=await getCurrentUser(_0x7e552e);if(!_0x46a98a[_0x41ab4b(0x150)]){if(_0x46a98a[_0x41ab4b(0x10d)])throw new Error('Authentication\x20failed:\x20'+_0x46a98a['error']+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error(_0x41ab4b(0x157)+_0x46a98a[_0x41ab4b(0x11c)]+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console['log'](_0x41ab4b(0xf6)+_0x46a98a['user']['organizationName']),await storeToken(_0x7e552e),console[_0x41ab4b(0x118)](process[_0x41ab4b(0xf1)]['GITHUB_ENV']?_0x41ab4b(0x114):'✓\x20Stored\x20credentials\x20locally'),{'token':_0x7e552e,'method':_0x41ab4b(0x140)};}export async function ensureRangerDir(_0x37c4a6){const _0x26a46c=_0x3ea4f4,_0x4d5a6f={'YxdAQ':'✓\x20~/.ranger/\x20directory\x20already\x20exists'};void _0x37c4a6;const _0x39bde5=getRangerHomeDir();return!existsSync(_0x39bde5)?(await mkdir(_0x39bde5,{'recursive':!![]}),console[_0x26a46c(0x118)](_0x26a46c(0x11f)),{'path':_0x39bde5,'installed':!![]}):(console['log'](_0x4d5a6f['YxdAQ']),{'path':_0x39bde5,'installed':![]});}export async function ensureChromium(_0x5bbbfd=![]){const _0x3a5843=_0x3ea4f4,_0x3339bb={'OXvJa':function(_0x2f4ce3,_0xd20ad6){return _0x2f4ce3(_0xd20ad6);},'gjYHz':function(_0x27b2a5,_0x5c3cf7){return _0x27b2a5??_0x5c3cf7;},'mxgxC':'confirm','zGajF':_0x3a5843(0xfa),'NVpRL':function(_0xe3e093,_0x6b4345,_0x169591){return _0xe3e093(_0x6b4345,_0x169591);},'TZeIH':_0x3a5843(0x158),'GoFbM':function(_0x3500e9,_0x51457c){return _0x3500e9 instanceof _0x51457c;},'fKaXQ':'\x0a⚠\x20Skipping\x20Chromium\x20installation.'};let _0x3e04e8=![];try{const _0x13f3f1=chromium[_0x3a5843(0xf0)]();_0x3e04e8=_0x3339bb[_0x3a5843(0xec)](existsSync,_0x13f3f1);}catch{_0x3e04e8=![];}if(_0x3e04e8)return console['log'](_0x3a5843(0x11d)),![];const _0x50bc93=getPlaywrightVersion(),_0xbfe409=_0x3339bb[_0x3a5843(0xe7)](_0x50bc93,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x3b0959=!_0x50bc93,_0x1fb20f=process['stdin']['isTTY']&&process[_0x3a5843(0xf8)]['isTTY'];let _0x12280e=!![];if(_0x1fb20f){const {install:_0x29c75e}=await _0x3e7fb1[_0x3a5843(0x10f)]([{'type':_0x3339bb[_0x3a5843(0x104)],'name':_0x3a5843(0x153),'message':_0x3b0959?_0x3a5843(0xfd)+_0xbfe409+'\x20now?':'The\x20required\x20version\x20('+_0xbfe409+_0x3a5843(0x131),'default':!![]}]);_0x12280e=_0x29c75e;}else console['log'](_0x3a5843(0xf5)+_0xbfe409+(_0x3b0959?_0x3339bb[_0x3a5843(0x120)]:'')+_0x3a5843(0x154));if(_0x12280e){console['log'](_0x3a5843(0x121));try{await _0x3339bb['NVpRL'](installChromiumBinary,_0xbfe409,_0x5bbbfd),console[_0x3a5843(0x118)](_0x3339bb[_0x3a5843(0xe5)]);}catch(_0x5393e3){console['error']('\x0a❌\x20Failed\x20to\x20install\x20Chromium:',_0x3339bb[_0x3a5843(0x141)](_0x5393e3,Error)?_0x5393e3['message']:_0x5393e3),console[_0x3a5843(0x118)](_0x3a5843(0x13a)),console[_0x3a5843(0x118)](_0x3a5843(0x13c)+_0xbfe409+'\x20install\x20chromium');}}else console[_0x3a5843(0x118)](_0x3339bb[_0x3a5843(0x128)]),console['log'](_0x3a5843(0xe6)),console['log'](_0x3a5843(0x13c)+_0xbfe409+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x35a461){const _0x3d282c=_0x3ea4f4,_0xae0e81={'avOEe':function(_0x2cfc7c,_0x74b70,_0x58dcd0){return _0x2cfc7c(_0x74b70,_0x58dcd0);},'sNEju':'.gitignore','hYjbu':_0x3d282c(0x10c)},_0x51bf0a=_0xae0e81['avOEe'](join,_0x35a461,_0xae0e81['sNEju']),_0x471c10=_0x3d282c(0xf4);await _0xae0e81['avOEe'](writeFile,_0x51bf0a,_0x471c10),console[_0x3d282c(0x118)](_0xae0e81['hYjbu']);}export async function ensureLocalEnv(_0xdd1910,_0x3a456e){const _0x526833=_0x3ea4f4,_0x33c352={'xpfNa':function(_0x21d520){return _0x21d520();},'DKQiX':function(_0x24d837,_0x4151f3){return _0x24d837!==_0x4151f3;},'DCADY':_0x526833(0x11e),'dSHDG':_0x526833(0x124),'zWhdO':_0x526833(0x109),'ThakB':function(_0x235eff,_0x3006c0,_0x2767b,_0x20d170){return _0x235eff(_0x3006c0,_0x2767b,_0x20d170);},'pQBfS':function(_0x24535a,_0x53c314){return _0x24535a instanceof _0x53c314;}};if(!_0x33c352['xpfNa'](findGitRoot)&&_0x33c352['DKQiX'](_0xdd1910?.[_0x526833(0x146)],_0x33c352['DCADY']))return console['log'](_0x33c352[_0x526833(0xfc)]),{'ready':![],'skipped':!![]};const _0x4e3bde=_0xdd1910?.[_0x526833(0x146)]===_0x33c352[_0x526833(0xf3)]?_0x33c352['xpfNa'](getRangerHomeDir):undefined;if(findExistingEnv(_0x33c352[_0x526833(0xf9)],{'locations':[_0x526833(0x109)],'rangerDir':_0x4e3bde}))return console['log']('✓\x20Local\x20profile\x20already\x20exists'),{'ready':!![],'skipped':![]};try{return await _0x33c352['ThakB'](addEnv,_0x526833(0x109),{'url':_0xdd1910?.[_0x526833(0x13b)],'force':_0xdd1910?.['force'],'allowInsecureLocalhost':_0xdd1910?.[_0x526833(0xe2)],'scope':_0xdd1910?.[_0x526833(0x146)]},_0x3a456e),{'ready':!![],'skipped':![]};}catch(_0x311ef9){return console[_0x526833(0x11c)](_0x526833(0x117),_0x33c352['pQBfS'](_0x311ef9,Error)?_0x311ef9[_0x526833(0xff)]:_0x311ef9),{'ready':![],'skipped':![]};}}export async function start(_0x3d2892,_0x302cac,_0x76c357){const _0x420f30=_0x3ea4f4,_0x4180b1={'XPQrt':'\x0a🚀\x20Ranger\x20Setup\x0a','BncsG':function(_0x1f286e){return _0x1f286e();},'uzsYz':'user','irOXO':_0x420f30(0x149),'bwayW':'auth','DMPGc':function(_0x43912e,_0x39b33a){return _0x43912e(_0x39b33a);},'UwIwK':'chromium','mEoqU':'\x0a✅\x20Ranger\x20setup\x20complete!\x0a','lqDNM':'plugin','haYUj':_0x420f30(0xe9),'nyiXl':_0x420f30(0x134),'bCYOw':'\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','uOkPp':'profile','PuUqc':function(_0x2ecc6e,_0x395c86){return _0x2ecc6e+_0x395c86;},'rSlbU':function(_0x5323d2,_0x2b877d){return _0x5323d2+_0x2b877d;},'EikKO':_0x420f30(0x115),'OYYxY':function(_0x56c179,_0x501e5c){return _0x56c179(_0x501e5c);},'oYtHj':'\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','GHesk':_0x420f30(0x148),'edSIh':_0x420f30(0x103),'buXJb':function(_0x1cc4ae,_0x4e8691){return _0x1cc4ae+_0x4e8691;}};console['log'](_0x4180b1[_0x420f30(0x102)]),_0x302cac={..._0x302cac,'scope':'user'};const _0x26cc49=!existsSync(_0x4180b1['BncsG'](getRangerHomeDir));await ensureRangerDir(_0x4180b1[_0x420f30(0x125)]);if(_0x302cac?.[_0x420f30(0xe4)])console['log'](_0x4180b1['irOXO']),_0x76c357?.['trackPhaseEnd'](_0x4180b1[_0x420f30(0x12d)],{'isFirstRun':_0x26cc49,'method':_0x420f30(0x14a)});else{_0x76c357?.[_0x420f30(0x12a)](_0x420f30(0x135));const _0x577e8a=await _0x4180b1[_0x420f30(0x10a)](authenticate,_0x3d2892);_0x76c357?.['trackPhaseEnd'](_0x4180b1['bwayW'],{'isFirstRun':_0x26cc49,'method':_0x577e8a[_0x420f30(0x122)]});}_0x76c357?.[_0x420f30(0x12a)](_0x420f30(0x137));_0x302cac?.[_0x420f30(0x152)]?console[_0x420f30(0x118)]('✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)'):await _0x4180b1[_0x420f30(0x10a)](ensureChromium,_0x302cac?.['withDeps']);_0x76c357?.['trackPhaseEnd'](_0x4180b1['UwIwK'],{'isFirstRun':_0x26cc49,'skipped':!!_0x302cac?.['skipChromium']}),console['log'](_0x4180b1['mEoqU']);const _0x28317c=_0x302cac?.[_0x420f30(0x146)],_0x3b8785=_0x302cac?.[_0x420f30(0x134)]??![];let _0x592658=null;_0x3b8785?(_0x76c357?.['trackPhaseStart'](_0x420f30(0x108)),_0x592658=await _0x4180b1['DMPGc'](ensureOpencodePluginConfig,_0x28317c),_0x76c357?.[_0x420f30(0x136)](_0x4180b1[_0x420f30(0xfe)],{'isFirstRun':_0x26cc49,'opencode':!![]})):(_0x76c357?.[_0x420f30(0x12a)](_0x4180b1[_0x420f30(0xfe)]),await _0x4180b1['DMPGc'](ensureClaudePlugin,_0x28317c),_0x76c357?.[_0x420f30(0x136)](_0x4180b1[_0x420f30(0xfe)],{'isFirstRun':_0x26cc49}));if(_0x3b8785&&_0x592658){_0x76c357?.['trackPhaseStart'](_0x4180b1[_0x420f30(0x132)]);try{await installSkill(_0x420f30(0x12e),{'level':_0x592658['scope'],'cliVersion':_0x4180b1[_0x420f30(0x13e)](getCurrentVersion),'platform':_0x4180b1[_0x420f30(0x142)]}),_0x76c357?.['trackPhaseEnd']('skills',{'isFirstRun':_0x26cc49,'opencode':!![]});}catch(_0x3e07e3){console[_0x420f30(0x129)]('\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:',_0x3e07e3 instanceof Error?_0x3e07e3['message']:_0x3e07e3),_0x76c357?.[_0x420f30(0x136)](_0x4180b1[_0x420f30(0x132)],{'isFirstRun':_0x26cc49,'opencode':!![],'failed':!![]});}}else _0x76c357?.[_0x420f30(0x12a)]('skills'),await ensureClaudeSkills(_0x28317c),_0x76c357?.[_0x420f30(0x136)]('skills',{'isFirstRun':_0x26cc49});if(_0x302cac?.[_0x420f30(0xe4)])console[_0x420f30(0x118)](_0x4180b1[_0x420f30(0xed)]);else{if(_0x302cac?.[_0x420f30(0x13b)]){_0x76c357?.[_0x420f30(0x12a)](_0x4180b1[_0x420f30(0x133)]);const _0x3505d0=await ensureLocalEnv({'url':_0x302cac['url'],'force':_0x302cac?.['force'],'allowInsecureLocalhost':_0x302cac?.[_0x420f30(0xe2)],'scope':_0x4180b1['uzsYz']},_0x76c357);_0x76c357?.['trackPhaseEnd'](_0x4180b1[_0x420f30(0x133)],{'isFirstRun':_0x26cc49,'profileReady':_0x3505d0['ready'],'userSkipped':_0x3505d0['skipped']});}else console['log'](_0x4180b1[_0x420f30(0x11a)](_0x4180b1[_0x420f30(0x11b)](_0x420f30(0x14d)+_0x4180b1['DMPGc'](bold,_0x4180b1['EikKO'])+'\x20',_0x420f30(0xfb)+_0x4180b1[_0x420f30(0x10e)](bold,'RANGER_TEST_PASSWORD')+_0x420f30(0xe8))+_0x420f30(0x111),'\x20may\x20need\x20a\x20one-time\x20headed\x20login\x20instead\x20—')+'\x0a\x20\x20your\x20org\x27s\x20auth\x20config\x20drives\x20which\x20flow\x20runs.'),console[_0x420f30(0x118)]('\x20\x20(or\x20use\x20'+bold(_0x420f30(0x126))+_0x420f30(0x151));}if(_0x3b8785)console['log'](_0x4180b1[_0x420f30(0x144)]),console[_0x420f30(0x118)]('and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review'),console['log'](_0x4180b1['GHesk']),console[_0x420f30(0x118)](_0x420f30(0x138));else{const _0x3f1e9f=_0x4180b1[_0x420f30(0x10e)](bold,_0x4180b1[_0x420f30(0xf2)]);console[_0x420f30(0x118)](_0x4180b1['buXJb'](_0x420f30(0x110)+_0x3f1e9f+'\x20and\x20prompt\x20the\x20coding',_0x420f30(0x112))+'\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'+_0x420f30(0x127));}}
|
|
1
|
+
const _0x362f4a=_0x255a;(function(_0x187122,_0x4a7f8a){const _0x221343=_0x255a,_0x4b5a9a=_0x187122();while(!![]){try{const _0x11cafc=parseInt(_0x221343(0x18f))/0x1*(-parseInt(_0x221343(0x157))/0x2)+-parseInt(_0x221343(0x19c))/0x3+parseInt(_0x221343(0x1a3))/0x4+parseInt(_0x221343(0x15b))/0x5*(-parseInt(_0x221343(0x13a))/0x6)+parseInt(_0x221343(0x196))/0x7*(parseInt(_0x221343(0x138))/0x8)+parseInt(_0x221343(0x160))/0x9+parseInt(_0x221343(0x19a))/0xa;if(_0x11cafc===_0x4a7f8a)break;else _0x4b5a9a['push'](_0x4b5a9a['shift']());}catch(_0x22471e){_0x4b5a9a['push'](_0x4b5a9a['shift']());}}}(_0x30fd,0x706e1));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';function _0x255a(_0x30b8fd,_0x284415){_0x30b8fd=_0x30b8fd-0x137;const _0x30fdd5=_0x30fd();let _0x255a09=_0x30fdd5[_0x30b8fd];return _0x255a09;}import _0x8ebeba from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.58.2';const bold=_0x2bdc7e=>_0x362f4a(0x139)+_0x2bdc7e+'\x1b[0m';export function getPlaywrightVersion(){const _0x47fd2f=_0x362f4a,_0x35c064={'TZtVc':_0x47fd2f(0x17a)};try{const _0x454ee5=require[_0x47fd2f(0x1a7)](_0x35c064['TZtVc']),_0x38a1e1=require(_0x454ee5);return _0x38a1e1['version'];}catch{return null;}}function _0x30fd(){const _0x16b842=['isTTY','executablePath','34peGpXK','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','UFRIS','23675ZqqHQF','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','JJZVc','trackPhaseEnd','✓\x20Created\x20.ranger/.gitignore','2849175IVcwTf','SEgcT','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','NgsOo','ncOVr','allowInsecureLocalhost','trackPhaseStart','install','\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','YaMxq','playwright@','\x20install\x20chromium','.gitignore','sZdBr','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','url','local','organizationName','confirm','✓\x20Local\x20profile\x20already\x20exists','HKWvR','log','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','success','wYQrO','KsNzK','playwright/package.json','skills','skipChromium','...','ranger\x20profile\x20add\x20<name>','HeEwu','MOkno','RMKvz','TxsHg','✓\x20Stored\x20credentials\x20locally','\x20(fallback\x20version)','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','close','✓\x20Exported\x20credentials\x20for\x20CI','mMJFF','✓\x20~/.ranger/\x20directory\x20already\x20exists','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','\x20\x20npx\x20playwright@','opencode','wmPPt','user','21687HxuuSi','\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','env','✓\x20Playwright\x20Chromium\x20browser\x20found','existing_token','\x0a⚠\x20Skipping\x20Chromium\x20installation.','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','10878lTkHSo','✓\x20Authenticated\x20to\x20','platform','error','660430JfXSfB','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','458253TMZqvy','XhDgZ','\x0aInstalling\x20Chromium\x20browser...\x0a','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','message','\x0a🚀\x20Ranger\x20Setup\x0a','rMcKS','3366368daGPJx','ePepz','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','resolve',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','inherit','profile','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','NiJmk','776ZSyFTp','\x1b[1m','498vudHVx','ouqMk','skipped','GYTxM','aOLPe','cNKoY','hCVSB','force','win32','\x0a\x20\x20','tWfOV','plugin','method','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','ToEmU','ozkms','xZxop','tqQbG','pFeIl','ready','SaTIz','The\x20required\x20version\x20(','ncxUr','chromium','nBMLb','irXlO','scope'];_0x30fd=function(){return _0x16b842;};return _0x30fd();}export function installChromiumBinary(_0x3e65a8,_0xdf90e0=![]){const _0x967e79=_0x362f4a,_0x59b52a={'XOxLs':_0x967e79(0x167),'RMKvz':function(_0x297c2c,_0x2597d4,_0x4c5c8a,_0x55e97c){return _0x297c2c(_0x2597d4,_0x4c5c8a,_0x55e97c);},'XhDgZ':'npx','ZSPkS':_0x967e79(0x1a9),'lfRzT':function(_0x369e30,_0x27dbf2){return _0x369e30===_0x27dbf2;},'IayCZ':_0x967e79(0x199)};return new Promise((_0x5c0f80,_0x161556)=>{const _0x56777e=_0x967e79,_0x1b09fc=[_0x56777e(0x16a)+_0x3e65a8,_0x59b52a['XOxLs'],..._0xdf90e0?['--with-deps']:[],'chromium'],_0x181635=_0x59b52a[_0x56777e(0x181)](spawn,_0x59b52a[_0x56777e(0x19d)],_0x1b09fc,{'stdio':['ignore',_0x56777e(0x1a9),_0x59b52a['ZSPkS']],'shell':_0x59b52a['lfRzT'](process[_0x56777e(0x198)],_0x56777e(0x142))});_0x181635['on'](_0x56777e(0x186),_0x2fe11a=>{_0x2fe11a===0x0?_0x5c0f80():_0x161556(new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x2fe11a));}),_0x181635['on'](_0x59b52a['IayCZ'],_0x364a75=>{_0x161556(_0x364a75);});});}export async function authenticate(_0x1b7f96){const _0x4070f5=_0x362f4a,_0xb5ea5e={'ePepz':function(_0x206088,_0x40bdce){return _0x206088(_0x40bdce);},'rARMH':function(_0x56f360){return _0x56f360();},'tqQbG':function(_0x1eb254,_0x5ba6c6){return _0x1eb254(_0x5ba6c6);},'GYTxM':_0x4070f5(0x187),'UFRIS':_0x4070f5(0x183)};if(!_0x1b7f96){const _0xfc228d=await getToken();if(_0xfc228d){const _0x57595d=await _0xb5ea5e[_0x4070f5(0x1a4)](getCurrentUser,_0xfc228d);if(_0x57595d[_0x4070f5(0x177)])return console['log']('✓\x20Already\x20authenticated\x20to\x20'+_0x57595d['user'][_0x4070f5(0x171)]),{'token':_0xfc228d,'method':_0x4070f5(0x193)};}try{_0x1b7f96=await _0xb5ea5e['rARMH'](runDeviceAuthFlow);}catch(_0x2ff002){throw new Error('Authentication\x20failed:\x20'+(_0x2ff002 instanceof Error?_0x2ff002['message']:_0x2ff002));}const _0x551870=await _0xb5ea5e[_0x4070f5(0x1a4)](getCurrentUser,_0x1b7f96);if(!_0x551870[_0x4070f5(0x177)])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x551870['error']);return console['log'](_0x4070f5(0x197)+_0x551870[_0x4070f5(0x18e)][_0x4070f5(0x171)]),{'token':_0x1b7f96,'method':'device_auth'};}console['log']('Validating\x20API\x20token...');const _0xf740d5=await getCurrentUser(_0x1b7f96);if(!_0xf740d5[_0x4070f5(0x177)]){if(_0xf740d5['status'])throw new Error('Authentication\x20failed:\x20'+_0xf740d5[_0x4070f5(0x199)]+_0x4070f5(0x176));else throw new Error(_0x4070f5(0x162)+_0xf740d5[_0x4070f5(0x199)]+_0x4070f5(0x159));}return console[_0x4070f5(0x175)](_0x4070f5(0x197)+_0xf740d5['user']['organizationName']),await _0xb5ea5e[_0x4070f5(0x14b)](storeToken,_0x1b7f96),console[_0x4070f5(0x175)](process[_0x4070f5(0x191)]['GITHUB_ENV']?_0xb5ea5e[_0x4070f5(0x13d)]:_0xb5ea5e[_0x4070f5(0x15a)]),{'token':_0x1b7f96,'method':'provided_token'};}export async function ensureRangerDir(_0x26da54){const _0x543f59=_0x362f4a,_0x55a9f4={'SEgcT':function(_0x2b49a0,_0x313221){return _0x2b49a0(_0x313221);},'xZxop':function(_0x1728eb,_0x1b104e,_0x5b8b81){return _0x1728eb(_0x1b104e,_0x5b8b81);},'mMJFF':'✓\x20Created\x20~/.ranger/\x20directory','ncxUr':_0x543f59(0x189)};void _0x26da54;const _0x1ff589=getRangerHomeDir();return!_0x55a9f4[_0x543f59(0x161)](existsSync,_0x1ff589)?(await _0x55a9f4[_0x543f59(0x14a)](mkdir,_0x1ff589,{'recursive':!![]}),console['log'](_0x55a9f4[_0x543f59(0x188)]),{'path':_0x1ff589,'installed':!![]}):(console[_0x543f59(0x175)](_0x55a9f4[_0x543f59(0x150)]),{'path':_0x1ff589,'installed':![]});}export async function ensureChromium(_0x3e7b08=![]){const _0xbd6958=_0x362f4a,_0x583d1e={'HeEwu':function(_0x278dda,_0x11d6f0){return _0x278dda(_0x11d6f0);},'ufiZn':function(_0x12d129){return _0x12d129();},'cNKoY':function(_0x590425,_0x3bfac5){return _0x590425??_0x3bfac5;},'nbtzY':_0xbd6958(0x172),'nOoAL':_0xbd6958(0x167),'YvTeT':_0xbd6958(0x184),'UrnvL':_0xbd6958(0x19e),'QUPPW':function(_0x134bb5,_0x2f4031,_0x43c719){return _0x134bb5(_0x2f4031,_0x43c719);},'DyetX':'\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','TxsHg':_0xbd6958(0x194)};let _0x3ab0f7=![];try{const _0x122475=chromium[_0xbd6958(0x156)]();_0x3ab0f7=_0x583d1e[_0xbd6958(0x17f)](existsSync,_0x122475);}catch{_0x3ab0f7=![];}if(_0x3ab0f7)return console[_0xbd6958(0x175)](_0xbd6958(0x192)),![];const _0x125b00=_0x583d1e['ufiZn'](getPlaywrightVersion),_0x216322=_0x583d1e[_0xbd6958(0x13f)](_0x125b00,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x4ead79=!_0x125b00,_0x2f1ceb=process['stdin'][_0xbd6958(0x155)]&&process['stdout'][_0xbd6958(0x155)];let _0x5d2a17=!![];if(_0x2f1ceb){const {install:_0x4dd187}=await _0x8ebeba['prompt']([{'type':_0x583d1e['nbtzY'],'name':_0x583d1e['nOoAL'],'message':_0x4ead79?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x216322+'\x20now?':_0xbd6958(0x14f)+_0x216322+_0xbd6958(0x1a8),'default':!![]}]);_0x5d2a17=_0x4dd187;}else console[_0xbd6958(0x175)](_0xbd6958(0x195)+_0x216322+(_0x4ead79?_0x583d1e['YvTeT']:'')+_0xbd6958(0x17d));if(_0x5d2a17){console[_0xbd6958(0x175)](_0x583d1e['UrnvL']);try{await _0x583d1e['QUPPW'](installChromiumBinary,_0x216322,_0x3e7b08),console['log'](_0x583d1e['DyetX']);}catch(_0x8f9d3a){console[_0xbd6958(0x199)](_0xbd6958(0x18a),_0x8f9d3a instanceof Error?_0x8f9d3a['message']:_0x8f9d3a),console[_0xbd6958(0x175)]('You\x20can\x20install\x20it\x20manually\x20by\x20running:'),console[_0xbd6958(0x175)](_0xbd6958(0x18b)+_0x216322+'\x20install\x20chromium');}}else console[_0xbd6958(0x175)](_0x583d1e[_0xbd6958(0x182)]),console['log']('You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'),console['log'](_0xbd6958(0x18b)+_0x216322+_0xbd6958(0x16b));return!![];}export async function writeRangerGitignore(_0x24835a){const _0x5a61eb=_0x362f4a,_0x452c9f={'bawkX':_0x5a61eb(0x16c),'NgsOo':function(_0x5b7b9c,_0x1063f9,_0x21c509){return _0x5b7b9c(_0x1063f9,_0x21c509);},'XJKYj':_0x5a61eb(0x15f)},_0x2d2476=join(_0x24835a,_0x452c9f['bawkX']),_0x39a6d5=_0x5a61eb(0x168);await _0x452c9f[_0x5a61eb(0x163)](writeFile,_0x2d2476,_0x39a6d5),console[_0x5a61eb(0x175)](_0x452c9f['XJKYj']);}export async function ensureLocalEnv(_0xa0ac5f,_0xffe200){const _0x5459ea=_0x362f4a,_0x8305ae={'SWlrA':function(_0x2cad9b){return _0x2cad9b();},'urNoe':function(_0x7a0f58,_0x4f0d46){return _0x7a0f58!==_0x4f0d46;},'gbqFp':function(_0x109210,_0x56ad23){return _0x109210===_0x56ad23;},'ozkms':function(_0x20bd1a,_0x473b7b,_0x1e12e7){return _0x20bd1a(_0x473b7b,_0x1e12e7);},'oFoNz':_0x5459ea(0x170),'YaMxq':_0x5459ea(0x173)};if(!_0x8305ae['SWlrA'](findGitRoot)&&_0x8305ae['urNoe'](_0xa0ac5f?.[_0x5459ea(0x154)],_0x5459ea(0x18e)))return console['log']('⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.'),{'ready':![],'skipped':!![]};const _0x11d244=_0x8305ae['gbqFp'](_0xa0ac5f?.[_0x5459ea(0x154)],'user')?getRangerHomeDir():undefined;if(_0x8305ae[_0x5459ea(0x149)](findExistingEnv,'local',{'locations':[_0x8305ae['oFoNz']],'rangerDir':_0x11d244}))return console['log'](_0x8305ae[_0x5459ea(0x169)]),{'ready':!![],'skipped':![]};try{return await addEnv(_0x5459ea(0x170),{'url':_0xa0ac5f?.['url'],'force':_0xa0ac5f?.[_0x5459ea(0x141)],'allowInsecureLocalhost':_0xa0ac5f?.['allowInsecureLocalhost'],'scope':_0xa0ac5f?.['scope']},_0xffe200),{'ready':!![],'skipped':![]};}catch(_0x12bed2){return console['error']('\x0a❌\x20Profile\x20setup\x20failed:',_0x12bed2 instanceof Error?_0x12bed2['message']:_0x12bed2),{'ready':![],'skipped':![]};}}export async function start(_0x3b7634,_0x796122,_0x2a35aa){const _0x3da4e3=_0x362f4a,_0x4af574={'ouqMk':function(_0x3fe0c4,_0x459a03){return _0x3fe0c4!==_0x459a03;},'ncOVr':function(_0x48e824,_0x20b1b0){return _0x48e824+_0x20b1b0;},'rMcKS':function(_0x4e994c,_0x4ee65f){return _0x4e994c(_0x4ee65f);},'wmPPt':'user','tWfOV':function(_0x19ca2c,_0xac3775){return _0x19ca2c(_0xac3775);},'odhNs':function(_0x35d948){return _0x35d948();},'KsNzK':'✓\x20Skipping\x20authentication\x20(--skip-auth)','YjbVy':'auth','HKWvR':_0x3da4e3(0x13c),'sZdBr':function(_0xdaa07c,_0xd722a7){return _0xdaa07c(_0xd722a7);},'pFeIl':_0x3da4e3(0x151),'uuwGB':_0x3da4e3(0x1a6),'JJZVc':'plugin','MOkno':_0x3da4e3(0x17b),'NiJmk':function(_0x2455a1,_0x4e91f7,_0x2d8ac2){return _0x2455a1(_0x4e91f7,_0x2d8ac2);},'Nctyx':'ranger','SaTIz':function(_0x2a6415,_0xd7ef36){return _0x2a6415 instanceof _0xd7ef36;},'ZIoqG':_0x3da4e3(0x1a5),'ToEmU':function(_0x1c5ad8,_0x5a5d70,_0x2cb9be){return _0x1c5ad8(_0x5a5d70,_0x2cb9be);},'BLxyy':'profile','aOLPe':function(_0x464774,_0x1da712){return _0x464774+_0x1da712;},'wYQrO':function(_0x35315a,_0x39d7f7){return _0x35315a(_0x39d7f7);},'yCcvB':_0x3da4e3(0x147),'irXlO':'with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','hCVSB':'verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','nBMLb':'/ranger:enable'};console['log'](_0x3da4e3(0x1a1));_0x4af574[_0x3da4e3(0x13b)](_0x796122?.['scope'],undefined)&&_0x796122[_0x3da4e3(0x154)]!=='user'&&(console['error'](_0x4af574[_0x3da4e3(0x164)]('ranger\x20setup\x20--scope='+_0x4af574['rMcKS'](String,_0x796122[_0x3da4e3(0x154)])+'\x20is\x20no\x20longer\x20supported.\x20'+_0x3da4e3(0x158),'project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.')),process['exit'](0x1));_0x796122={..._0x796122,'scope':_0x4af574[_0x3da4e3(0x18d)]};const _0x4550d0=!_0x4af574['tWfOV'](existsSync,_0x4af574['odhNs'](getRangerHomeDir));await ensureRangerDir(_0x4af574[_0x3da4e3(0x18d)]);if(_0x796122?.['skipAuth'])console[_0x3da4e3(0x175)](_0x4af574[_0x3da4e3(0x179)]),_0x2a35aa?.[_0x3da4e3(0x15e)](_0x4af574['YjbVy'],{'isFirstRun':_0x4550d0,'method':_0x4af574[_0x3da4e3(0x174)]});else{_0x2a35aa?.[_0x3da4e3(0x166)]('auth');const _0x5922a9=await _0x4af574[_0x3da4e3(0x16d)](authenticate,_0x3b7634);_0x2a35aa?.[_0x3da4e3(0x15e)]('auth',{'isFirstRun':_0x4550d0,'method':_0x5922a9[_0x3da4e3(0x146)]});}_0x2a35aa?.[_0x3da4e3(0x166)]('chromium');_0x796122?.[_0x3da4e3(0x17c)]?console[_0x3da4e3(0x175)](_0x3da4e3(0x16e)):await ensureChromium(_0x796122?.['withDeps']);_0x2a35aa?.[_0x3da4e3(0x15e)](_0x4af574[_0x3da4e3(0x14c)],{'isFirstRun':_0x4550d0,'skipped':!!_0x796122?.[_0x3da4e3(0x17c)]}),console['log'](_0x4af574['uuwGB']);const _0x4a190d=_0x796122?.['scope'],_0xe1dfc2=_0x796122?.['opencode']??![];let _0x3522ed=null;_0xe1dfc2?(_0x2a35aa?.['trackPhaseStart'](_0x4af574[_0x3da4e3(0x15d)]),_0x3522ed=await _0x4af574[_0x3da4e3(0x1a2)](ensureOpencodePluginConfig,_0x4a190d),_0x2a35aa?.[_0x3da4e3(0x15e)](_0x3da4e3(0x145),{'isFirstRun':_0x4550d0,'opencode':!![]})):(_0x2a35aa?.['trackPhaseStart']('plugin'),await ensureClaudePlugin(_0x4a190d),_0x2a35aa?.[_0x3da4e3(0x15e)](_0x4af574['JJZVc'],{'isFirstRun':_0x4550d0}));if(_0xe1dfc2&&_0x3522ed){_0x2a35aa?.[_0x3da4e3(0x166)](_0x4af574[_0x3da4e3(0x180)]);try{await _0x4af574[_0x3da4e3(0x137)](installSkill,_0x4af574['Nctyx'],{'level':_0x3522ed['scope'],'cliVersion':getCurrentVersion(),'platform':_0x3da4e3(0x18c)}),_0x2a35aa?.[_0x3da4e3(0x15e)](_0x3da4e3(0x17b),{'isFirstRun':_0x4550d0,'opencode':!![]});}catch(_0x51b245){console['warn'](_0x3da4e3(0x1ab),_0x4af574[_0x3da4e3(0x14e)](_0x51b245,Error)?_0x51b245[_0x3da4e3(0x1a0)]:_0x51b245),_0x2a35aa?.[_0x3da4e3(0x15e)]('skills',{'isFirstRun':_0x4550d0,'opencode':!![],'failed':!![]});}}else _0x2a35aa?.[_0x3da4e3(0x166)](_0x4af574['MOkno']),await _0x4af574[_0x3da4e3(0x144)](ensureClaudeSkills,_0x4a190d),_0x2a35aa?.['trackPhaseEnd'](_0x4af574[_0x3da4e3(0x180)],{'isFirstRun':_0x4550d0});if(_0x796122?.['skipAuth'])console['log'](_0x4af574['ZIoqG']);else{if(_0x796122?.['url']){_0x2a35aa?.[_0x3da4e3(0x166)](_0x3da4e3(0x1aa));const _0xceec18=await _0x4af574[_0x3da4e3(0x148)](ensureLocalEnv,{'url':_0x796122[_0x3da4e3(0x16f)],'force':_0x796122?.['force'],'allowInsecureLocalhost':_0x796122?.[_0x3da4e3(0x165)],'scope':'user'},_0x2a35aa);_0x2a35aa?.['trackPhaseEnd'](_0x4af574['BLxyy'],{'isFirstRun':_0x4550d0,'profileReady':_0xceec18[_0x3da4e3(0x14d)],'userSkipped':_0xceec18[_0x3da4e3(0x13c)]});}else console[_0x3da4e3(0x175)](_0x4af574[_0x3da4e3(0x164)](_0x4af574['aOLPe'](_0x3da4e3(0x19f)+(_0x3da4e3(0x143)+_0x4af574[_0x3da4e3(0x178)](bold,_0x3da4e3(0x17e))),'\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)')+_0x3da4e3(0x190),_0x3da4e3(0x15c)));}if(_0xe1dfc2)console[_0x3da4e3(0x175)](_0x4af574['yCcvB']),console['log'](_0x3da4e3(0x185)),console['log'](_0x4af574[_0x3da4e3(0x153)]),console[_0x3da4e3(0x175)](_0x4af574[_0x3da4e3(0x140)]);else{const _0x1323c7=_0x4af574[_0x3da4e3(0x16d)](bold,_0x4af574[_0x3da4e3(0x152)]);console[_0x3da4e3(0x175)](_0x4af574[_0x3da4e3(0x13e)]('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x1323c7+'\x20and\x20prompt\x20the\x20coding','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with')+'\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'+_0x3da4e3(0x19b));}}
|
package/build/commands/status.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x3021aa=_0x44be;(function(_0x20c21b,_0x4b8698){const _0x2cc1dc=_0x44be,_0x17709f=_0x20c21b();while(!![]){try{const _0x151515=parseInt(_0x2cc1dc(0x1a9))/0x1+parseInt(_0x2cc1dc(0x1c0))/0x2+parseInt(_0x2cc1dc(0x1c7))/0x3*(parseInt(_0x2cc1dc(0x1e7))/0x4)+-parseInt(_0x2cc1dc(0x1a6))/0x5*(parseInt(_0x2cc1dc(0x1d5))/0x6)+parseInt(_0x2cc1dc(0x1b2))/0x7+parseInt(_0x2cc1dc(0x1bd))/0x8+-parseInt(_0x2cc1dc(0x1b6))/0x9;if(_0x151515===_0x4b8698)break;else _0x17709f['push'](_0x17709f['shift']());}catch(_0x13aa4d){_0x17709f['push'](_0x17709f['shift']());}}}(_0x38bc,0xa0f74));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';function _0x44be(_0x1f3d08,_0xee701e){_0x1f3d08=_0x1f3d08-0x199;const _0x38bcaf=_0x38bc();let _0x44be6d=_0x38bcaf[_0x1f3d08];return _0x44be6d;}import{getCurrentVersion,getLatestVersion}from'./utils/version.js';function _0x38bc(){const _0x33f9fe=['dFvrZ','FxpxL','cKvqn','665166jVxEpS','\x20(up\x20to\x20date)','displayName','all','ranger@trailhead','\x20\x20Not\x20configured','kvbfh','project','HyFqT','No\x20profiles\x20configured','DEBUG','bjync','utf-8','QgJKA','431388eLhitA','not_configured','HpxNd','Msyyf','success','name','details','\x1b]8;;file://','xdUYs','\x20\x20\x20\x20','map','WAWwS','\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>','zDbPG','\x1b[1m','BcnUj','Root:\x20','GoFHq','12dcsiMI','\x20\x20Run:\x20ranger\x20setup\x20[token]','settingsPath','log','No\x20skills\x20installed','@ranger-testing/opencode-plugin','parse','\x20\x20\x20\x20Settings:\x20','wYXce','unknown','Version:\x20','opencode','includes','version','plaintext','toString',':\x20configured','debug','DKEDh','length','15eLoLfx','data','Organization:\x20','566406fxLiBS','trim','MyaFz','cwd','GOuWs','RgFyv','stderr','MVWfj','\x20\x20\x20\x20Auth:\x20','4893448BIhlcF','API\x20URL:\x20','\x0a\x20\x20No\x20active\x20profile\x20set','disabled','21028590JJbZbD','path','Zybrc','vxTBk','join','jJLFe','status','2889744VAfdWH','close','\x20\x20User-level:','1839332LztFTy','string','VfEYR','IdElQ'];_0x38bc=function(){return _0x33f9fe;};return _0x38bc();}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{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x1555b3=>_0x3021aa(0x1e3)+_0x1555b3+'\x1b[0m',link=(_0x5eaf8f,_0x5b342b)=>_0x3021aa(0x1dc)+_0x5eaf8f+'\x07'+(_0x5b342b||_0x5eaf8f)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x524fcc=_0x3021aa,_0x1cfe10={'PrdSa':_0x524fcc(0x1c1),'HpxNd':function(_0x76c640,_0x4d3d08){return _0x76c640(_0x4d3d08);},'tGBCt':'configured','Msyyf':'not_configured','DDVsL':function(_0x3eef10,_0x440d2f){return _0x3eef10(_0x440d2f);},'RgFyv':function(_0x384ce3,_0x3d9a81,_0x10a0cb,_0x57e1b3){return _0x384ce3(_0x3d9a81,_0x10a0cb,_0x57e1b3);},'QFoHq':_0x524fcc(0x19d),'IdElQ':_0x524fcc(0x1a3),'zDasH':'config','kvbfh':'pipe','yRpum':_0x524fcc(0x1a7)};return new Promise(_0x5e82eb=>{const _0x29c92a=_0x524fcc,_0x16aef0={'vxTBk':function(_0x18aa03,_0x350ce9){return _0x18aa03(_0x350ce9);}},_0x40d945=_0x1cfe10[_0x29c92a(0x1ae)](spawn,_0x1cfe10['QFoHq'],[_0x1cfe10[_0x29c92a(0x1c3)],_0x1cfe10['zDasH']],{'stdio':['ignore',_0x1cfe10['kvbfh'],_0x1cfe10[_0x29c92a(0x1cd)]]});let _0x1fe32c='';_0x40d945['stdout']?.['on']('data',_0x592004=>{const _0x115386=_0x29c92a;_0x1fe32c+=_0x592004[_0x115386(0x1a1)]();}),_0x40d945[_0x29c92a(0x1af)]?.['on'](_0x1cfe10['yRpum'],_0x5b7770=>{const _0x2b7519=_0x29c92a;_0x1fe32c+=_0x5b7770[_0x2b7519(0x1a1)]();}),_0x40d945['on']('error',()=>{const _0x3a5868=_0x29c92a;_0x16aef0[_0x3a5868(0x1b9)](_0x5e82eb,{'status':'not_installed'});}),_0x40d945['on'](_0x29c92a(0x1be),_0x5ed908=>{const _0x3f155a=_0x29c92a,_0x238769={'MyaFz':function(_0x23f336,_0x442c29){return _0x23f336!==_0x442c29;},'HKqZL':_0x1cfe10['PrdSa'],'BcnUj':'opencode-plugin'};if(_0x5ed908!==0x0){_0x1cfe10[_0x3f155a(0x1d7)](_0x5e82eb,{'status':'not_installed'});return;}const _0x1f59b=_0x1fe32c['trim']();let _0x47a09c=null;if(_0x1f59b)try{_0x47a09c=JSON[_0x3f155a(0x1ed)](_0x1f59b);}catch{const _0x52cbd8=_0x1f59b['match'](/\{[\s\S]*\}$/);if(_0x52cbd8)try{_0x47a09c=JSON[_0x3f155a(0x1ed)](_0x52cbd8[0x0]);}catch{_0x47a09c=null;}}const _0x49321e=Array['isArray'](_0x47a09c?.['plugin'])?_0x47a09c?.['plugin']:[],_0x1cfa30=_0x49321e['some'](_0x3f1b60=>{const _0x472859=_0x3f155a;if(_0x238769[_0x472859(0x1ab)](typeof _0x3f1b60,_0x238769['HKqZL']))return![];return _0x3f1b60[_0x472859(0x19e)](_0x472859(0x1ec))||_0x3f1b60[_0x472859(0x19e)](_0x238769[_0x472859(0x1e4)]);});if(_0x1cfa30){_0x1cfe10['HpxNd'](_0x5e82eb,{'status':_0x1cfe10['tGBCt'],'details':_0x49321e[_0x3f155a(0x1a5)]>0x0?_0x49321e['length']+'\x20plugin(s)\x20configured':undefined});return;}if(_0x49321e[_0x3f155a(0x1a5)]>0x0){_0x5e82eb({'status':_0x1cfe10[_0x3f155a(0x1d8)],'details':_0x49321e[_0x3f155a(0x1a5)]+'\x20plugin(s)\x20configured'});return;}_0x1cfe10['DDVsL'](_0x5e82eb,{'status':_0x3f155a(0x1d6)});});});}async function getSkillsFromDir(_0x42451c,_0x4675d6){const _0x4ba88a=_0x3021aa,_0x2dfc0c={'uHSsy':function(_0xbfc886,_0x5bc5fd){return _0xbfc886(_0x5bc5fd);},'ADhLd':function(_0x4cb176,_0x4721d5,_0x2314cb){return _0x4cb176(_0x4721d5,_0x2314cb);},'WAWwS':function(_0x2bbf11,_0x465048,_0x378811,_0xe66ff6){return _0x2bbf11(_0x465048,_0x378811,_0xe66ff6);},'jJLFe':'SKILL.md','dYuyq':function(_0x264233,_0x14c160,_0x2f9d20){return _0x264233(_0x14c160,_0x2f9d20);}};if(!_0x2dfc0c['uHSsy'](existsSync,_0x42451c))return[];const _0x154946=[];try{const _0x2823fe=await _0x2dfc0c['ADhLd'](readdir,_0x42451c,{'withFileTypes':!![]});for(const _0x15df44 of _0x2823fe){if(_0x15df44['isDirectory']()){const _0x37844e=_0x2dfc0c[_0x4ba88a(0x1e0)](join,_0x42451c,_0x15df44['name'],_0x2dfc0c[_0x4ba88a(0x1bb)]);if(existsSync(_0x37844e)){let _0x5c0056=_0x15df44[_0x4ba88a(0x1da)];try{const _0x3fbc03=await _0x2dfc0c['dYuyq'](readFile,_0x37844e,_0x4ba88a(0x1d3)),_0xd73e42=_0x3fbc03['match'](/name:\s*(.+)/);_0xd73e42&&(_0x5c0056=_0xd73e42[0x1][_0x4ba88a(0x1aa)]());}catch{}_0x154946['push']({'name':_0x15df44['name'],'displayName':_0x5c0056,'path':_0x37844e,'level':_0x4675d6});}}}}catch{return[];}return _0x154946;}async function getInstalledSkills(){const _0x5414c6=_0x3021aa,_0x419e66={'kEXAX':function(_0x403515){return _0x403515();},'ohoeq':_0x5414c6(0x1ce)},[_0x4d147d,_0x48b622]=await Promise[_0x5414c6(0x1ca)]([getSkillsFromDir(_0x419e66['kEXAX'](getProjectSkillsDir),_0x419e66['ohoeq']),getSkillsFromDir(_0x419e66['kEXAX'](getUserSkillsDir),'user')]);return{'project':_0x4d147d,'user':_0x48b622};}async function getEnvironments(){const _0x24e3ed={'Cebla':'settings.json','QhdBq':function(_0x126fde,_0x10af95,_0x828419){return _0x126fde(_0x10af95,_0x828419);},'IrSHU':function(_0x5a2f0b,_0x25546f,_0x373384){return _0x5a2f0b(_0x25546f,_0x373384);},'GOuWs':'auth.json.enc','ucCwX':function(_0x2ca94d,_0x28a55b){return _0x2ca94d(_0x28a55b);},'tYOsm':function(_0x4785ea){return _0x4785ea();}},{envNames:_0x39ad7c,activeEnv:_0x15c1b9}=await _0x24e3ed['tYOsm'](getEnvNames),_0x57508c=getRangerDir();if(!existsSync(_0x57508c))return{'envs':[],'activeEnv':null};const _0x3da93f=_0x39ad7c['map'](_0x1f1c77=>{const _0x5c445b=_0x44be,_0x4dbf6c=getEnvDir(_0x1f1c77),_0x1a1c7c=join(_0x4dbf6c,_0x24e3ed['Cebla']),_0x25e4e0=_0x24e3ed['QhdBq'](join,_0x4dbf6c,'auth.json'),_0x1707e9=_0x24e3ed['IrSHU'](join,_0x4dbf6c,_0x24e3ed[_0x5c445b(0x1ad)]);return{'name':_0x1f1c77,'settingsPath':_0x24e3ed['ucCwX'](existsSync,_0x1a1c7c)?_0x1a1c7c:'(not\x20found)','hasPlaintextAuth':existsSync(_0x25e4e0),'hasEncryptedAuth':existsSync(_0x1707e9),'isActive':_0x1f1c77===_0x15c1b9};});return{'envs':_0x3da93f,'activeEnv':_0x15c1b9};}export async function status(){const _0x6831e3=_0x3021aa,_0x2953c5={'zDbPG':function(_0x266608){return _0x266608();},'xdUYs':function(_0x55ee21,_0x11ff78,_0x5aada3){return _0x55ee21(_0x11ff78,_0x5aada3);},'uZxaV':function(_0x21a4b6,_0x5b86f1){return _0x21a4b6(_0x5b86f1);},'dFvrZ':function(_0x1139bd,_0x4cb70d){return _0x1139bd(_0x4cb70d);},'QgJKA':function(_0x30d202,_0x31725c){return _0x30d202!==_0x31725c;},'RcIRK':function(_0x41db13,_0x267292){return _0x41db13(_0x267292);},'DKEDh':function(_0x386036){return _0x386036();},'Zybrc':function(_0xb7db6){return _0xb7db6();},'ZlXXB':function(_0x1d42bb,_0x3f0020){return _0x1d42bb===_0x3f0020;},'XOGJI':'configured','HyFqT':_0x6831e3(0x1ec),'FxpxL':_0x6831e3(0x1d6),'ieRBI':_0x6831e3(0x1cb),'hJCJi':'enabled','cKvqn':'\x20\x20Not\x20installed','VfEYR':'\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','GoFHq':'\x0a---\x20Skills\x20---','mahDu':function(_0x151ce2){return _0x151ce2();},'VyExP':_0x6831e3(0x1eb),'Ydmpa':function(_0x296228,_0x2c503f){return _0x296228(_0x2c503f);},'VDCNW':function(_0x579e38,_0x1e89ef){return _0x579e38>_0x1e89ef;},'MZkxC':_0x6831e3(0x1bf),'vROmj':function(_0x3baced){return _0x3baced();},'bjync':_0x6831e3(0x1d0),'wYXce':'\x20(active)','aoCNI':'encrypted','MVWfj':function(_0x553f2b,_0x3cce0b){return _0x553f2b!==_0x3cce0b;},'vlFCc':'(not\x20found)'};console[_0x6831e3(0x1ea)]('\x0a📊\x20Ranger\x20Status\x0a');const _0x479413=process[_0x6831e3(0x1ac)](),_0x3040e9=_0x2953c5[_0x6831e3(0x1e2)](getRangerDir);if(!existsSync(_0x3040e9)){console['log']('Root:\x20'+_0x2953c5[_0x6831e3(0x1dd)](link,_0x479413,bold(_0x2953c5['uZxaV'](basename,_0x479413)))),console['log']('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console[_0x6831e3(0x1ea)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console[_0x6831e3(0x1ea)](_0x6831e3(0x1e5)+_0x2953c5[_0x6831e3(0x1dd)](link,_0x479413,_0x2953c5[_0x6831e3(0x1c4)](bold,basename(_0x479413))));const _0x38f7e5=getCurrentVersion(),_0xf1814c=getLatestVersion();if(_0xf1814c[_0x6831e3(0x19f)]&&_0x2953c5[_0x6831e3(0x1d4)](_0xf1814c[_0x6831e3(0x19f)],_0x38f7e5))console[_0x6831e3(0x1ea)](_0x6831e3(0x19c)+_0x38f7e5+'\x20(latest:\x20'+_0xf1814c['version']+')'),console[_0x6831e3(0x1ea)]('\x20\x20Run:\x20ranger\x20update');else _0xf1814c['version']?console[_0x6831e3(0x1ea)](_0x6831e3(0x19c)+_0x38f7e5+_0x6831e3(0x1c8)):console[_0x6831e3(0x1ea)]('Version:\x20'+_0x38f7e5);const _0x3e69ea=await _0x2953c5['zDbPG'](getToken);if(_0x3e69ea){const _0xa76103=await getCurrentUser(_0x3e69ea);_0xa76103[_0x6831e3(0x1d9)]?console['log'](_0x6831e3(0x1a8)+_0x2953c5['RcIRK'](bold,_0xa76103['user']['organizationName'])):(console['log']('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console['log'](_0x6831e3(0x1e8)));}else console['log']('API\x20Token:\x20✗\x20Not\x20found'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]');process['env'][_0x6831e3(0x1d1)]&&(console['log']('API\x20Environment:\x20'+getCurrentEnvironment()),console['log'](_0x6831e3(0x1b3)+_0x2953c5[_0x6831e3(0x1a4)](getApiBaseUrl)));console['log']('\x0a---\x20OpenCode\x20Plugin\x20---');const _0x5beb77=await _0x2953c5[_0x6831e3(0x1b8)](getOpencodePluginStatus);if(_0x2953c5['ZlXXB'](_0x5beb77[_0x6831e3(0x1bc)],_0x2953c5['XOGJI']))console[_0x6831e3(0x1ea)]('\x20\x20'+bold(_0x2953c5[_0x6831e3(0x1cf)])+_0x6831e3(0x1a2)),_0x5beb77[_0x6831e3(0x1db)]&&console[_0x6831e3(0x1ea)]('\x20\x20'+_0x5beb77[_0x6831e3(0x1db)]);else _0x2953c5['ZlXXB'](_0x5beb77['status'],_0x2953c5[_0x6831e3(0x1c5)])?(console['log'](_0x6831e3(0x1cc)),_0x5beb77[_0x6831e3(0x1db)]&&console['log']('\x20\x20'+_0x5beb77[_0x6831e3(0x1db)]),console[_0x6831e3(0x1ea)]('\x20\x20Run:\x20ranger\x20setup\x20--opencode')):console['log']('\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available');console[_0x6831e3(0x1ea)]('\x0a---\x20Claude\x20Code\x20Plugin\x20---');const _0x1b1d74=await getPluginInfo(_0x2953c5['ieRBI']);if(_0x1b1d74){const _0x33d0b8=_0x1b1d74['scope']||_0x6831e3(0x19b),_0x46a6c5=_0x1b1d74['enabled']?_0x2953c5['hJCJi']:_0x6831e3(0x1b5);console['log']('\x20\x20'+bold('ranger@trailhead')+':\x20installed\x20('+_0x33d0b8+',\x20'+_0x46a6c5+')');}else console['log'](_0x2953c5[_0x6831e3(0x1c6)]),console[_0x6831e3(0x1ea)](_0x2953c5[_0x6831e3(0x1c2)]);console['log'](_0x2953c5[_0x6831e3(0x1e6)]);const {project:_0x22a5f1,user:_0x48de94}=await _0x2953c5['mahDu'](getInstalledSkills),_0x55fdc3=_0x22a5f1['filter'](_0x2cc690=>RANGER_MANAGED_SKILLS['includes'](_0x2cc690[_0x6831e3(0x1da)])),_0x2a6762=_0x48de94['filter'](_0x4c62b4=>RANGER_MANAGED_SKILLS['includes'](_0x4c62b4[_0x6831e3(0x1da)])),_0x43a244=_0x55fdc3['length']+_0x2a6762[_0x6831e3(0x1a5)];if(_0x43a244===0x0)console['log'](_0x2953c5['VyExP']),console['log']('\x20\x20Run:\x20ranger\x20skillup');else{if(_0x55fdc3['length']>0x0){console[_0x6831e3(0x1ea)]('\x20\x20Project-level:');for(const _0x43b5ee of _0x55fdc3){console[_0x6831e3(0x1ea)](_0x6831e3(0x1de)+_0x2953c5[_0x6831e3(0x1c4)](bold,_0x43b5ee['displayName'])+':\x20'+link(_0x43b5ee[_0x6831e3(0x1b7)],_0x2953c5['Ydmpa'](basename,_0x43b5ee[_0x6831e3(0x1b7)])));}}if(_0x2953c5['VDCNW'](_0x2a6762[_0x6831e3(0x1a5)],0x0)){console[_0x6831e3(0x1ea)](_0x2953c5['MZkxC']);for(const _0x1d6af3 of _0x2a6762){console[_0x6831e3(0x1ea)]('\x20\x20\x20\x20'+_0x2953c5[_0x6831e3(0x1c4)](bold,_0x1d6af3[_0x6831e3(0x1c9)])+':\x20'+link(_0x1d6af3[_0x6831e3(0x1b7)],basename(_0x1d6af3[_0x6831e3(0x1b7)])));}}}console[_0x6831e3(0x1ea)]('\x0a---\x20Profiles\x20---');const {envs:_0x19562a,activeEnv:_0x37fa55}=await _0x2953c5['vROmj'](getEnvironments);if(_0x2953c5['ZlXXB'](_0x19562a[_0x6831e3(0x1a5)],0x0))console[_0x6831e3(0x1ea)](_0x2953c5[_0x6831e3(0x1d2)]),console[_0x6831e3(0x1ea)](_0x6831e3(0x1e1));else{for(const _0x3b61c1 of _0x19562a){const _0x1bcbd5=_0x3b61c1['isActive']?_0x2953c5[_0x6831e3(0x19a)]:'',_0x1a6004=_0x3b61c1['hasEncryptedAuth']?_0x2953c5['aoCNI']:_0x3b61c1['hasPlaintextAuth']?_0x6831e3(0x1a0):'none';console['log']('\x20\x20'+bold(_0x3b61c1[_0x6831e3(0x1da)])+_0x1bcbd5),console['log'](_0x6831e3(0x1b1)+_0x1a6004),_0x2953c5[_0x6831e3(0x1b0)](_0x3b61c1[_0x6831e3(0x1e9)],_0x2953c5['vlFCc'])&&console[_0x6831e3(0x1ea)](_0x6831e3(0x199)+link(_0x3b61c1[_0x6831e3(0x1e9)],basename(_0x3b61c1[_0x6831e3(0x1e9)])));}!_0x37fa55&&(console['log'](_0x6831e3(0x1b4)),console['log']('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x19562a[_0x6831e3(0x1df)](_0x3d5e6b=>_0x3d5e6b[_0x6831e3(0x1da)])[_0x6831e3(0x1ba)](',\x20')+')'));}console[_0x6831e3(0x1ea)]('');}
|
|
1
|
+
const _0x20f506=_0x243f;(function(_0x3de954,_0x2d4333){const _0xae7b41=_0x243f,_0x53b498=_0x3de954();while(!![]){try{const _0x3791fb=-parseInt(_0xae7b41(0x1db))/0x1+parseInt(_0xae7b41(0x1e5))/0x2*(-parseInt(_0xae7b41(0x222))/0x3)+parseInt(_0xae7b41(0x200))/0x4+-parseInt(_0xae7b41(0x215))/0x5+-parseInt(_0xae7b41(0x1ed))/0x6*(parseInt(_0xae7b41(0x1ee))/0x7)+-parseInt(_0xae7b41(0x1cd))/0x8+-parseInt(_0xae7b41(0x220))/0x9*(-parseInt(_0xae7b41(0x22b))/0xa);if(_0x3791fb===_0x2d4333)break;else _0x53b498['push'](_0x53b498['shift']());}catch(_0x576fd8){_0x53b498['push'](_0x53b498['shift']());}}}(_0x92c9,0xd680e));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';function _0x92c9(){const _0x523b1f=['lrdEK','name','\x0a---\x20Profiles\x20---','details','FJTUQ','log','OoHUE','path','disabled','qTpVJ','putkK','\x20\x20Run:\x20ranger\x20setup\x20[token]','\x20\x20\x20\x20','No\x20skills\x20installed','string','length','plugin','DpEON','match','data','4499075ycbbkV','env','(not\x20found)','BKqqI','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','hasEncryptedAuth','oeuuq','Xhzft','SJgrr','\x0a\x20\x20No\x20active\x20profile\x20set','\x20plugin(s)\x20configured','38817FITFCO','\x20(up\x20to\x20date)','132tQknvU','version','scope','\x0a📊\x20Ranger\x20Status\x0a','opencode-plugin','\x20\x20\x20\x20Settings:\x20','JpnYj','Organization:\x20','DEBUG','13730JJduUW','configured','some','8592192EQadAG','displayName','config','API\x20Token:\x20✗\x20Not\x20found','includes','trim','LiBND','IfEgm','\x20(active)','AlUoU','@ranger-testing/opencode-plugin','\x20\x20Not\x20installed','parse','\x20\x20Not\x20configured','602960gvXvht','user','Root:\x20','nTtdb','\x0a---\x20OpenCode\x20Plugin\x20---','gBXHb','stderr','settingsPath',':\x20configured','opencode','53282lZqzky','Version:\x20','FCmyP','none','not_configured','status','isDirectory','API\x20URL:\x20','12WCOwPF','4867163KgkjFG','\x1b]8;;file://','ZwUhu','jKKue','toString','pipe','PIcsr','encrypted','\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>','ranger@trailhead','oVFzE','push','SvWTE','enabled','plaintext','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','\x1b]8;;\x07','cwd','385912AeZzQz'];_0x92c9=function(){return _0x523b1f;};return _0x92c9();}import{getEnvDir}from'./utils/settings.js';import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';function _0x243f(_0x559f26,_0x219bd1){_0x559f26=_0x559f26-0x1cc;const _0x92c9a3=_0x92c9();let _0x243f84=_0x92c9a3[_0x559f26];return _0x243f84;}const bold=_0x543e6c=>'\x1b[1m'+_0x543e6c+'\x1b[0m',link=(_0x451ddf,_0x183f08)=>_0x20f506(0x1ef)+_0x451ddf+'\x07'+(_0x183f08||_0x451ddf)+_0x20f506(0x1fe);async function getOpencodePluginStatus(){const _0xbce8e8=_0x20f506,_0x471dc6={'CqyTZ':_0xbce8e8(0x226),'QsAxR':function(_0x7f04d7,_0x2b9afa){return _0x7f04d7>_0x2b9afa;},'sdXOc':'debug','PIcsr':_0xbce8e8(0x214)};return new Promise(_0x2151c9=>{const _0x2dd75a=_0xbce8e8,_0x4971f7={'ZwUhu':_0x2dd75a(0x20f),'LiBND':_0x471dc6['CqyTZ'],'sNibO':function(_0x163402,_0x41d8d7){return _0x471dc6['QsAxR'](_0x163402,_0x41d8d7);}},_0x92e6e0=spawn(_0x2dd75a(0x1e4),[_0x471dc6['sdXOc'],_0x2dd75a(0x1cf)],{'stdio':['ignore',_0x2dd75a(0x1f3),'pipe']});let _0x3c5e63='';_0x92e6e0['stdout']?.['on'](_0x471dc6[_0x2dd75a(0x1f4)],_0x4506fb=>{_0x3c5e63+=_0x4506fb['toString']();}),_0x92e6e0[_0x2dd75a(0x1e1)]?.['on'](_0x471dc6['PIcsr'],_0x116057=>{const _0x40e2ad=_0x2dd75a;_0x3c5e63+=_0x116057[_0x40e2ad(0x1f2)]();}),_0x92e6e0['on']('error',()=>{_0x2151c9({'status':'not_installed'});}),_0x92e6e0['on']('close',_0x35192f=>{const _0x2b933f=_0x2dd75a;if(_0x35192f!==0x0){_0x2151c9({'status':'not_installed'});return;}const _0x985bc3=_0x3c5e63['trim']();let _0x200df5=null;if(_0x985bc3)try{_0x200df5=JSON[_0x2b933f(0x1d9)](_0x985bc3);}catch{const _0x2a2f3b=_0x985bc3[_0x2b933f(0x213)](/\{[\s\S]*\}$/);if(_0x2a2f3b)try{_0x200df5=JSON['parse'](_0x2a2f3b[0x0]);}catch{_0x200df5=null;}}const _0x4650a0=Array['isArray'](_0x200df5?.['plugin'])?_0x200df5?.[_0x2b933f(0x211)]:[],_0x564252=_0x4650a0[_0x2b933f(0x1cc)](_0x1217fe=>{const _0x1de103=_0x2b933f;if(typeof _0x1217fe!==_0x4971f7[_0x1de103(0x1f0)])return![];return _0x1217fe[_0x1de103(0x1d1)](_0x1de103(0x1d7))||_0x1217fe[_0x1de103(0x1d1)](_0x4971f7[_0x1de103(0x1d3)]);});if(_0x564252){_0x2151c9({'status':'configured','details':_0x4650a0['length']>0x0?_0x4650a0[_0x2b933f(0x210)]+'\x20plugin(s)\x20configured':undefined});return;}if(_0x4971f7['sNibO'](_0x4650a0['length'],0x0)){_0x2151c9({'status':_0x2b933f(0x1e9),'details':_0x4650a0[_0x2b933f(0x210)]+_0x2b933f(0x21f)});return;}_0x2151c9({'status':'not_configured'});});});}async function getSkillsFromDir(_0x391727,_0x523dd4){const _0x142d63=_0x20f506,_0x562dfe={'nTtdb':function(_0x3d0753,_0x96a4c0){return _0x3d0753(_0x96a4c0);},'ACmOa':'SKILL.md','AlUoU':function(_0x14826c,_0x436be8,_0x518031){return _0x14826c(_0x436be8,_0x518031);},'IfEgm':'utf-8'};if(!_0x562dfe[_0x142d63(0x1de)](existsSync,_0x391727))return[];const _0x132f37=[];try{const _0x188b5d=await readdir(_0x391727,{'withFileTypes':!![]});for(const _0x134d67 of _0x188b5d){if(_0x134d67[_0x142d63(0x1eb)]()){const _0x485090=join(_0x391727,_0x134d67['name'],_0x562dfe['ACmOa']);if(existsSync(_0x485090)){let _0x64c8c7=_0x134d67['name'];try{const _0x31c7bd=await _0x562dfe[_0x142d63(0x1d6)](readFile,_0x485090,_0x562dfe[_0x142d63(0x1d4)]),_0x49d80b=_0x31c7bd[_0x142d63(0x213)](/name:\s*(.+)/);_0x49d80b&&(_0x64c8c7=_0x49d80b[0x1][_0x142d63(0x1d2)]());}catch{}_0x132f37[_0x142d63(0x1f9)]({'name':_0x134d67['name'],'displayName':_0x64c8c7,'path':_0x485090,'level':_0x523dd4});}}}}catch{return[];}return _0x132f37;}async function getInstalledSkills(){const [_0x5a17ed,_0x45a629]=await Promise['all']([getSkillsFromDir(getProjectSkillsDir(),'project'),getSkillsFromDir(getUserSkillsDir(),'user')]);return{'project':_0x5a17ed,'user':_0x45a629};}async function getEnvironments(){const _0x221ac1=_0x20f506,_0x418eb4={'BKqqI':function(_0x248bde,_0x4a6749){return _0x248bde(_0x4a6749);},'DnSdB':function(_0x46f68e,_0x221e89,_0x29d749){return _0x46f68e(_0x221e89,_0x29d749);},'oeuuq':'auth.json','JpnYj':function(_0x310e68,_0x263aef,_0x287046){return _0x310e68(_0x263aef,_0x287046);},'SJgrr':'(not\x20found)','gBXHb':function(_0x51c603,_0x2d2317){return _0x51c603(_0x2d2317);},'Xhzft':function(_0x4e032b,_0x4ced0f){return _0x4e032b===_0x4ced0f;}},{envNames:_0x3413fa,activeEnv:_0x53bd72}=await getEnvNames(),_0x1f8be9=getRangerDir();if(!_0x418eb4[_0x221ac1(0x218)](existsSync,_0x1f8be9))return{'envs':[],'activeEnv':null};const _0xc00d16=_0x3413fa['map'](_0xf3cb53=>{const _0x24e547=_0x221ac1,_0x4825ba=_0x418eb4[_0x24e547(0x218)](getEnvDir,_0xf3cb53),_0x56f0e0=_0x418eb4['DnSdB'](join,_0x4825ba,'settings.json'),_0x23194f=join(_0x4825ba,_0x418eb4[_0x24e547(0x21b)]),_0x3682fa=_0x418eb4[_0x24e547(0x228)](join,_0x4825ba,'auth.json.enc');return{'name':_0xf3cb53,'settingsPath':existsSync(_0x56f0e0)?_0x56f0e0:_0x418eb4[_0x24e547(0x21d)],'hasPlaintextAuth':_0x418eb4[_0x24e547(0x1e0)](existsSync,_0x23194f),'hasEncryptedAuth':_0x418eb4['BKqqI'](existsSync,_0x3682fa),'isActive':_0x418eb4[_0x24e547(0x21c)](_0xf3cb53,_0x53bd72)};});return{'envs':_0xc00d16,'activeEnv':_0x53bd72};}export async function status(){const _0xc6c7f9=_0x20f506,_0x3ef07f={'MgMBF':function(_0x56143c){return _0x56143c();},'FCmyP':function(_0x2aee5e,_0x2d5c67){return _0x2aee5e(_0x2d5c67);},'jKKue':function(_0x175dfe,_0x12e0fb){return _0x175dfe(_0x12e0fb);},'fesZd':function(_0x101139){return _0x101139();},'dYDpw':function(_0x5452fd,_0x53a633){return _0x5452fd!==_0x53a633;},'TEykG':function(_0x16550d){return _0x16550d();},'feglv':_0xc6c7f9(0x22c),'OoHUE':_0xc6c7f9(0x1da),'oVFzE':'\x20\x20Run:\x20ranger\x20setup\x20--opencode','lrdEK':'\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','bwENK':function(_0xaba7d,_0x5dbeda){return _0xaba7d(_0x5dbeda);},'SvWTE':'unknown','qTpVJ':'enabled','FJTUQ':'\x0a---\x20Skills\x20---','Pwxou':'\x20\x20Project-level:','Plxso':function(_0x430bb6,_0x187d44){return _0x430bb6>_0x187d44;},'dIBtY':'\x20\x20User-level:','PNJdf':function(_0x3186d2){return _0x3186d2();},'fNhHW':function(_0x5eb3a6,_0x367978){return _0x5eb3a6===_0x367978;},'putkK':'No\x20profiles\x20configured','DpEON':_0xc6c7f9(0x1d5),'HgSmp':function(_0x5e7cb4,_0x391bc8,_0x502afa){return _0x5e7cb4(_0x391bc8,_0x502afa);}};console['log'](_0xc6c7f9(0x225));const _0x23caa8=process[_0xc6c7f9(0x1ff)](),_0x269c04=_0x3ef07f['MgMBF'](getRangerDir);if(!existsSync(_0x269c04)){console['log'](_0xc6c7f9(0x1dd)+link(_0x23caa8,_0x3ef07f[_0xc6c7f9(0x1e7)](bold,_0x3ef07f['FCmyP'](basename,_0x23caa8)))),console[_0xc6c7f9(0x206)]('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console['log']('Root:\x20'+link(_0x23caa8,bold(_0x3ef07f[_0xc6c7f9(0x1f1)](basename,_0x23caa8))));const _0x4ab9d7=_0x3ef07f['fesZd'](getCurrentVersion),_0x517c74=_0x3ef07f['fesZd'](getLatestVersion);if(_0x517c74['version']&&_0x3ef07f['dYDpw'](_0x517c74[_0xc6c7f9(0x223)],_0x4ab9d7))console[_0xc6c7f9(0x206)](_0xc6c7f9(0x1e6)+_0x4ab9d7+'\x20(latest:\x20'+_0x517c74['version']+')'),console['log']('\x20\x20Run:\x20ranger\x20update');else _0x517c74[_0xc6c7f9(0x223)]?console['log']('Version:\x20'+_0x4ab9d7+_0xc6c7f9(0x221)):console[_0xc6c7f9(0x206)]('Version:\x20'+_0x4ab9d7);const _0xe9d349=await getToken();if(_0xe9d349){const _0x4e724c=await getCurrentUser(_0xe9d349);_0x4e724c['success']?console['log'](_0xc6c7f9(0x229)+bold(_0x4e724c[_0xc6c7f9(0x1dc)]['organizationName'])):(console['log'](_0xc6c7f9(0x1fd)),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console[_0xc6c7f9(0x206)](_0xc6c7f9(0x1d0)),console['log'](_0xc6c7f9(0x20c));process[_0xc6c7f9(0x216)][_0xc6c7f9(0x22a)]&&(console[_0xc6c7f9(0x206)]('API\x20Environment:\x20'+_0x3ef07f['TEykG'](getCurrentEnvironment)),console['log'](_0xc6c7f9(0x1ec)+getApiBaseUrl()));console['log'](_0xc6c7f9(0x1df));const _0x9d722c=await getOpencodePluginStatus();if(_0x9d722c[_0xc6c7f9(0x1ea)]===_0x3ef07f['feglv'])console['log']('\x20\x20'+_0x3ef07f['jKKue'](bold,_0xc6c7f9(0x1d7))+_0xc6c7f9(0x1e3)),_0x9d722c['details']&&console['log']('\x20\x20'+_0x9d722c[_0xc6c7f9(0x204)]);else _0x9d722c['status']==='not_configured'?(console['log'](_0x3ef07f[_0xc6c7f9(0x207)]),_0x9d722c[_0xc6c7f9(0x204)]&&console[_0xc6c7f9(0x206)]('\x20\x20'+_0x9d722c[_0xc6c7f9(0x204)]),console['log'](_0x3ef07f[_0xc6c7f9(0x1f8)])):console['log'](_0x3ef07f[_0xc6c7f9(0x201)]);console['log']('\x0a---\x20Claude\x20Code\x20Plugin\x20---');const _0xebbdaf=await _0x3ef07f['bwENK'](getPluginInfo,_0xc6c7f9(0x1f7));if(_0xebbdaf){const _0x49f7e2=_0xebbdaf[_0xc6c7f9(0x224)]||_0x3ef07f[_0xc6c7f9(0x1fa)],_0x1eaccf=_0xebbdaf[_0xc6c7f9(0x1fb)]?_0x3ef07f[_0xc6c7f9(0x20a)]:_0xc6c7f9(0x209);console[_0xc6c7f9(0x206)]('\x20\x20'+bold(_0xc6c7f9(0x1f7))+':\x20installed\x20('+_0x49f7e2+',\x20'+_0x1eaccf+')');}else console[_0xc6c7f9(0x206)](_0xc6c7f9(0x1d8)),console[_0xc6c7f9(0x206)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)');console['log'](_0x3ef07f[_0xc6c7f9(0x205)]);const {project:_0x2ca7ad,user:_0x1cb9f8}=await getInstalledSkills(),_0x1abecc=_0x2ca7ad['filter'](_0x5aa7c9=>RANGER_MANAGED_SKILLS['includes'](_0x5aa7c9['name'])),_0x2c0ae1=_0x1cb9f8['filter'](_0x994357=>RANGER_MANAGED_SKILLS[_0xc6c7f9(0x1d1)](_0x994357['name'])),_0x3a8729=_0x1abecc[_0xc6c7f9(0x210)]+_0x2c0ae1[_0xc6c7f9(0x210)];if(_0x3a8729===0x0)console[_0xc6c7f9(0x206)](_0xc6c7f9(0x20e)),console['log']('\x20\x20Run:\x20ranger\x20skillup');else{if(_0x1abecc['length']>0x0){console[_0xc6c7f9(0x206)](_0x3ef07f['Pwxou']);for(const _0x2dd6f0 of _0x1abecc){console['log'](_0xc6c7f9(0x20d)+bold(_0x2dd6f0[_0xc6c7f9(0x1ce)])+':\x20'+link(_0x2dd6f0['path'],basename(_0x2dd6f0[_0xc6c7f9(0x208)])));}}if(_0x3ef07f['Plxso'](_0x2c0ae1[_0xc6c7f9(0x210)],0x0)){console[_0xc6c7f9(0x206)](_0x3ef07f['dIBtY']);for(const _0x216f49 of _0x2c0ae1){console[_0xc6c7f9(0x206)]('\x20\x20\x20\x20'+bold(_0x216f49['displayName'])+':\x20'+link(_0x216f49['path'],_0x3ef07f['FCmyP'](basename,_0x216f49[_0xc6c7f9(0x208)])));}}}console['log'](_0xc6c7f9(0x203));const {envs:_0x49e765,activeEnv:_0x58697a}=await _0x3ef07f['PNJdf'](getEnvironments);if(_0x3ef07f['fNhHW'](_0x49e765[_0xc6c7f9(0x210)],0x0))console[_0xc6c7f9(0x206)](_0x3ef07f[_0xc6c7f9(0x20b)]),console['log'](_0xc6c7f9(0x1f6));else{for(const _0x5b9ffc of _0x49e765){const _0x376ce7=_0x5b9ffc['isActive']?_0x3ef07f[_0xc6c7f9(0x212)]:'',_0x12e619=_0x5b9ffc[_0xc6c7f9(0x21a)]?_0xc6c7f9(0x1f5):_0x5b9ffc['hasPlaintextAuth']?_0xc6c7f9(0x1fc):_0xc6c7f9(0x1e8);console['log']('\x20\x20'+bold(_0x5b9ffc['name'])+_0x376ce7),console[_0xc6c7f9(0x206)]('\x20\x20\x20\x20Auth:\x20'+_0x12e619),_0x5b9ffc['settingsPath']!==_0xc6c7f9(0x217)&&console[_0xc6c7f9(0x206)](_0xc6c7f9(0x227)+_0x3ef07f['HgSmp'](link,_0x5b9ffc[_0xc6c7f9(0x1e2)],_0x3ef07f['bwENK'](basename,_0x5b9ffc['settingsPath'])));}!_0x58697a&&(console[_0xc6c7f9(0x206)](_0xc6c7f9(0x21e)),console[_0xc6c7f9(0x206)](_0xc6c7f9(0x219)+_0x49e765['map'](_0x3c7d10=>_0x3c7d10[_0xc6c7f9(0x202)])['join'](',\x20')+')'));}console['log']('');}
|