@ranger-testing/ranger-cli 2.5.4-alpha.1f7a251-7 → 2.5.4-alpha.36a12ca-10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/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/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/verify.md +6 -12
- package/package.json +1 -1
package/build/commands/login.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x527938,_0x5a70c2){const _0x1ae79f=_0x7fa9,_0xe1f8e=_0x527938();while(!![]){try{const _0x46ced0=parseInt(_0x1ae79f(0x15e))/0x1+parseInt(_0x1ae79f(0x15d))/0x2*(parseInt(_0x1ae79f(0x163))/0x3)+-parseInt(_0x1ae79f(0x15c))/0x4*(parseInt(_0x1ae79f(0x159))/0x5)+parseInt(_0x1ae79f(0x165))/0x6*(parseInt(_0x1ae79f(0x156))/0x7)+parseInt(_0x1ae79f(0x160))/0x8*(parseInt(_0x1ae79f(0x158))/0x9)+parseInt(_0x1ae79f(0x168))/0xa+-parseInt(_0x1ae79f(0x157))/0xb*(parseInt(_0x1ae79f(0x15f))/0xc);if(_0x46ced0===_0x5a70c2)break;else _0xe1f8e['push'](_0xe1f8e['shift']());}catch(_0x7974a6){_0xe1f8e['push'](_0xe1f8e['shift']());}}}(_0x5b0a,0xa0ce9));function _0x5b0a(){const _0x235ee4=['5403432CFLfyF','isTTY','stdin','96GfVPJq','success','6eEifxn','Re-authenticating\x20via\x20MCP\x20bootstrap...','BqMnZ','6327130ViZuIs','stdout','dltfX','4773979AshWXV','44lVqjQW','9MawCNc','25OTOLRL','log','Login\x20failed:\x20','687716pFkCbW','78286kklvAr','1125207esGqTc','8548836oIfiqZ'];_0x5b0a=function(){return _0x235ee4;};return _0x5b0a();}import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';function _0x7fa9(_0x2d6bf0,_0x3cfcf9){_0x2d6bf0=_0x2d6bf0-0x156;const _0x5b0aec=_0x5b0a();let _0x7fa93c=_0x5b0aec[_0x2d6bf0];return _0x7fa93c;}import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';export async function login(){const _0x3f75db=_0x7fa9,_0x19d6da={'BqMnZ':_0x3f75db(0x166),'wzDur':function(_0x247fc3){return _0x247fc3();},'dltfX':'Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','QeMVk':'\x0a✅\x20API\x20key\x20stored\x20successfully'},_0x24b963=await getMcpAuthOrigin();if(_0x24b963){console['log'](_0x19d6da[_0x3f75db(0x167)]),await _0x19d6da['wzDur'](mcpBootstrap);return;}const _0x246a5a=process[_0x3f75db(0x162)][_0x3f75db(0x161)]&&process[_0x3f75db(0x169)]['isTTY'];if(!_0x246a5a)throw new Error(_0x19d6da[_0x3f75db(0x16a)]);try{const _0xbcdb5=await runDeviceAuthFlow(),_0x3b1afb=await getCurrentUser(_0xbcdb5);_0x3b1afb[_0x3f75db(0x164)]?console[_0x3f75db(0x15a)]('\x0a✅\x20Logged\x20in\x20to\x20'+_0x3b1afb['user']['organizationName']):console[_0x3f75db(0x15a)](_0x19d6da['QeMVk']);}catch(_0x1adca0){throw new Error(_0x3f75db(0x15b)+(_0x1adca0 instanceof Error?_0x1adca0['message']:_0x1adca0));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x151ee3=_0x3bf6;(function(_0x38daf5,_0x4ee0b1){const _0x15be12=_0x3bf6,_0x24e3e3=_0x38daf5();while(!![]){try{const _0x48ba97=-parseInt(_0x15be12(0xf4))/0x1+-parseInt(_0x15be12(0xc0))/0x2+parseInt(_0x15be12(0xec))/0x3+parseInt(_0x15be12(0xcc))/0x4*(-parseInt(_0x15be12(0x8a))/0x5)+-parseInt(_0x15be12(0xab))/0x6*(parseInt(_0x15be12(0x81))/0x7)+parseInt(_0x15be12(0xd7))/0x8*(-parseInt(_0x15be12(0x9c))/0x9)+parseInt(_0x15be12(0xad))/0xa*(parseInt(_0x15be12(0x9b))/0xb);if(_0x48ba97===_0x4ee0b1)break;else _0x24e3e3['push'](_0x24e3e3['shift']());}catch(_0x32310b){_0x24e3e3['push'](_0x24e3e3['shift']());}}}(_0x4adb,0x1c96f));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',_0x151ee3(0x90)),AUTH_ORIGIN_PATH=join(homedir(),_0x151ee3(0x8d),_0x151ee3(0xbe));function _0x4adb(){const _0x5759a0=['506121kqGNYr','2025-03-26','CofnD','sha256','platform','application/json','refreshToken','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','165362detdvG','hex','startsWith','YvlSN','refresh_token','oweTe','proxied','token','win32','mgeBr','trim','utf-8','writeHead','message','stdout','text/html','listen','name','Server\x20returned\x20error:\x20','ranger-cli','mSrMe','\x0aToken\x20written\x20to\x20','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','lPcFg','YoXWN','registration_endpoint','searchParams','parse','12215yVXPZd','log','CZvLv','origin','initialize','toString','nOMPc','xdg-open','KCaAC','79865qSDwwr','POST','code_challenge_method','.ranger','/.well-known/oauth-authorization-server','\x20done','mcp-oauth-tokens.json','resource','Ydtiy','application/json,\x20text/event-stream','TLcYb','uiDgy','JeLdn','error','Requesting\x20CLI\x20token...','siMLN','accessToken','22OzzrPY','53910cFoivJ','AdtTZ','http://localhost:','JLnIp','update','uxGcM','MyDXA','get','status','gUUjU','includes','sMyXI','json','type','redirect_uri','366YgkVLt','application/x-www-form-urlencoded','3527290gzFzYp','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','Discovering\x20authorization\x20server...','/callback','NcsVq','close','length','open','UojMN','write','Ranger\x20CLI','end','zDJQh','QgqyV','2.0','isError','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','auth-origin.txt','none','407456mAiYvX','Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20','notifications/initialized','fsHeF','FxGQt','base64url','S256','twnre','EHrVe','vtqTJ','Registering\x20OAuth\x20client...','clientSecret','36agcfyb','split','kPNWX','TtsBe','slice','clientId','expiresAt','client_secret','ZMFwB','headers','\x0aOpening\x20browser\x20for\x20authentication...','184JbbFxD','text','OAuth\x20error:\x20','client_id','string','lXPDa','stringify','YzqaW','Not\x20found','tools/call','expires_in','BneUe','yLYdy','result','fPXcZ','UWpsU','set','zgkGT','cTFmx','code','HDBwT'];_0x4adb=function(){return _0x5759a0;};return _0x4adb();}export async function getMcpAuthOrigin(){const _0x53947a=_0x151ee3,_0x595f4c={'MyDXA':function(_0x56de22,_0x59f88a,_0xf9624a){return _0x56de22(_0x59f88a,_0xf9624a);},'GgDKe':'utf-8','zDJQh':function(_0x519dce,_0x400d56){return _0x519dce||_0x400d56;}};try{const _0x3bc64c=(await _0x595f4c[_0x53947a(0xa2)](readFile,AUTH_ORIGIN_PATH,_0x595f4c['GgDKe']))[_0x53947a(0xfe)]();return _0x595f4c[_0x53947a(0xb9)](_0x3bc64c,null);}catch{return null;}}export async function mcpBootstrap(){const _0x461aed=_0x151ee3,_0x27b469={'fPXcZ':function(_0x4ae61b){return _0x4ae61b();},'mgeBr':function(_0x65c00c,_0x2c357b){return _0x65c00c(_0x2c357b);},'TtwLA':'proxied','goNIH':function(_0x3a68ba,_0x5bac55){return _0x3a68ba+_0x5bac55;}},_0x1d88d2=_0x27b469[_0x461aed(0xe5)](getMcpAuthUrl);currentOrigin=_0x1d88d2;const _0xcefd6e=process[_0x461aed(0x102)]['isTTY']??![];console[_0x461aed(0x82)]('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x1d88d2+'\x0a');const _0x2940d3=await _0x27b469[_0x461aed(0xfd)](tryUnauthenticated,_0x1d88d2);let _0x492559=null;if(_0x2940d3===_0x27b469['TtwLA'])_0x492559='';else{_0x492559=await loadCachedToken();if(!_0x492559){if(!_0xcefd6e)throw new Error(_0x27b469['goNIH'](_0x461aed(0xbd),_0x461aed(0x7b)));_0x492559=await oauthFlow(_0x1d88d2);}}await callGetCliToken(_0x1d88d2,_0x492559);}async function tryUnauthenticated(_0x79fec3){const _0x1d0e7f=_0x151ee3,_0x30383c={'NqJYR':function(_0x2d76dc,_0x34cbeb,_0x18f32f){return _0x2d76dc(_0x34cbeb,_0x18f32f);},'YoXWN':_0x1d0e7f(0xf1),'fsHeF':'1.0.0','KCaAC':_0x1d0e7f(0xfa)},_0x148117=await _0x30383c['NqJYR'](fetch,_0x79fec3,{'method':'POST','headers':{'Content-Type':_0x30383c[_0x1d0e7f(0x7d)],'Accept':_0x1d0e7f(0x93)},'body':JSON['stringify']({'jsonrpc':_0x1d0e7f(0xbb),'id':0x1,'method':'initialize','params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x1d0e7f(0x78),'version':_0x30383c[_0x1d0e7f(0xc3)]}}})});if(_0x148117['ok'])return await _0x148117['text'](),_0x30383c[_0x1d0e7f(0x89)];if(_0x148117['status']===0x191)return await _0x148117['text'](),'needs-oauth';const _0x6f1793=await _0x148117['text']();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x148117[_0x1d0e7f(0xa4)]+':\x20'+_0x6f1793);}class OAuthTimeoutError extends Error{constructor(_0x5c7a33){const _0x5dd301=_0x151ee3;super(_0x5c7a33),this[_0x5dd301(0x105)]='OAuthTimeoutError';}}async function oauthFlow(_0x53f8eb){const _0x15caa8=_0x151ee3,_0x4ad5e5={'ZhUMa':function(_0x5e91f0,_0x5b83b5){return _0x5e91f0(_0x5b83b5);},'rigoT':function(_0x24795e){return _0x24795e();},'CofnD':'\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'};try{return await _0x4ad5e5['ZhUMa'](oauthFlowAttempt,_0x53f8eb);}catch(_0x5b32dd){if(_0x5b32dd instanceof OAuthTimeoutError&&await _0x4ad5e5['rigoT'](loadCachedClient))return console[_0x15caa8(0x82)](_0x4ad5e5[_0x15caa8(0xee)]),await clearCachedClient(),await oauthFlowAttempt(_0x53f8eb);throw _0x5b32dd;}}async function oauthFlowAttempt(_0x4a443a){const _0x44ae60=_0x151ee3,_0x3442fa={'DqfcO':_0x44ae60(0xaf),'lPcFg':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','BneUe':'No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','TtsBe':_0x44ae60(0xca),'EHrVe':'authorization_code','UojMN':_0x44ae60(0xea),'nOMPc':_0x44ae60(0xbf),'BmIjz':_0x44ae60(0x8f),'EyYAh':function(_0x15db22,_0x40943d){return _0x15db22(_0x40943d);},'ifRPE':_0x44ae60(0xf5),'AdtTZ':_0x44ae60(0xda),'ZMFwB':'code_challenge','zgkGT':'state','jiuIw':'resource','gUUjU':_0x44ae60(0xd3),'yLYdy':_0x44ae60(0xac),'yJYaA':function(_0x2ab430,_0x39801a,_0x5dfc0d,_0x3d5387){return _0x2ab430(_0x39801a,_0x5dfc0d,_0x3d5387);}},_0x608054=_0x4a443a['replace'](/\/mcp$/,'');process['stdout']['write'](_0x3442fa['DqfcO']);const _0x1f2119=await fetch(_0x608054+'/.well-known/oauth-protected-resource');if(!_0x1f2119['ok'])throw new Error(_0x3442fa[_0x44ae60(0x7c)]);const _0x512687=await _0x1f2119[_0x44ae60(0xa8)](),_0x574b7e=_0x512687['authorization_servers']?.[0x0];if(!_0x574b7e)throw new Error(_0x3442fa[_0x44ae60(0xe2)]);console['log']('\x20'+_0x574b7e);const _0x551d79=await fetchAuthServerMetadata(_0x574b7e);let _0x12b00a,_0x4d1f91;const _0x5649c6=await loadCachedClient();if(_0x5649c6)_0x12b00a=_0x5649c6[_0x44ae60(0xd1)],_0x4d1f91=_0x5649c6['clientSecret'];else{if(_0x551d79[_0x44ae60(0x7e)]){process['stdout']['write'](_0x3442fa[_0x44ae60(0xcf)]);const _0x1c6355=await fetch(_0x551d79[_0x44ae60(0x7e)],{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify']({'client_name':_0x44ae60(0xb7),'redirect_uris':['http://localhost:'+CALLBACK_PORT+_0x44ae60(0xb0)],'grant_types':[_0x3442fa['EHrVe'],_0x44ae60(0xf8)],'response_types':[_0x3442fa[_0x44ae60(0xb5)]],'token_endpoint_auth_method':_0x3442fa[_0x44ae60(0x87)]})});if(!_0x1c6355['ok']){const _0x33f10d=await _0x1c6355['text']();throw new Error('Client\x20registration\x20failed:\x20'+_0x33f10d);}const _0x31b182=await _0x1c6355[_0x44ae60(0xa8)]();_0x12b00a=_0x31b182['client_id'],_0x4d1f91=_0x31b182[_0x44ae60(0xd3)],await saveCachedClient(_0x12b00a,_0x4d1f91),console['log'](_0x3442fa['BmIjz']);}else throw new Error(_0x44ae60(0xae));}const _0x2b1cff=randomBytes(0x20)['toString'](_0x44ae60(0xc5)),_0x3752a2=_0x3442fa['EyYAh'](createHash,_0x44ae60(0xef))[_0x44ae60(0xa0)](_0x2b1cff)['digest']('base64url'),_0x3aa11d=randomBytes(0x10)[_0x44ae60(0x86)](_0x3442fa['ifRPE']),_0xd6e8bd=new URL(_0x551d79['authorization_endpoint']);_0xd6e8bd['searchParams'][_0x44ae60(0xe7)]('response_type',_0x44ae60(0xea)),_0xd6e8bd['searchParams']['set'](_0x3442fa[_0x44ae60(0x9d)],_0x12b00a),_0xd6e8bd['searchParams'][_0x44ae60(0xe7)](_0x44ae60(0xaa),_0x44ae60(0x9e)+CALLBACK_PORT+'/callback'),_0xd6e8bd[_0x44ae60(0x7f)][_0x44ae60(0xe7)](_0x3442fa[_0x44ae60(0xd4)],_0x3752a2),_0xd6e8bd['searchParams']['set'](_0x44ae60(0x8c),_0x44ae60(0xc6)),_0xd6e8bd[_0x44ae60(0x7f)]['set'](_0x3442fa[_0x44ae60(0xe8)],_0x3aa11d);_0x512687[_0x44ae60(0x91)]&&_0xd6e8bd[_0x44ae60(0x7f)][_0x44ae60(0xe7)](_0x3442fa['jiuIw'],_0x512687['resource']);console['log'](_0x44ae60(0xd6)),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0xd6e8bd[_0x44ae60(0x86)]()+'\x0a'),await openBrowser(_0xd6e8bd[_0x44ae60(0x86)]());const _0x5712a4=await waitForCallback(_0x3aa11d);process['stdout'][_0x44ae60(0xb6)]('Exchanging\x20authorization\x20code...');const _0x230497=new URLSearchParams({'grant_type':_0x3442fa[_0x44ae60(0xc8)],'code':_0x5712a4,'redirect_uri':'http://localhost:'+CALLBACK_PORT+_0x44ae60(0xb0),'client_id':_0x12b00a,'code_verifier':_0x2b1cff});_0x4d1f91&&_0x230497[_0x44ae60(0xe7)](_0x3442fa[_0x44ae60(0xa5)],_0x4d1f91);_0x512687[_0x44ae60(0x91)]&&_0x230497['set']('resource',_0x512687[_0x44ae60(0x91)]);const _0xb9bb36=await fetch(_0x551d79['token_endpoint'],{'method':_0x44ae60(0x8b),'headers':{'Content-Type':_0x3442fa[_0x44ae60(0xe3)]},'body':_0x230497});if(!_0xb9bb36['ok']){const _0x2fbea0=await _0xb9bb36['text']();throw new Error('Token\x20exchange\x20failed:\x20'+_0x2fbea0);}const _0x18eb44=await _0xb9bb36[_0x44ae60(0xa8)]();return console['log'](_0x3442fa['BmIjz']),await _0x3442fa['yJYaA'](saveCachedToken,_0x18eb44['access_token'],_0x18eb44['refresh_token'],_0x18eb44[_0x44ae60(0xe1)]),_0x18eb44['access_token'];}async function callGetCliToken(_0x4f354f,_0xb5bb04){const _0x5db084=_0x151ee3,_0x38079c={'oweTe':function(_0x280698,_0x4ef678){return _0x280698(_0x4ef678);},'BFdcU':'Authorization','XTjKb':function(_0x3fc70e,_0x4bfe5f){return _0x3fc70e(_0x4bfe5f);},'ezgsI':_0x5db084(0x78),'oidOe':'1.0.0','QgqyV':'\x20done','sMyXI':_0x5db084(0xc2),'mSrMe':'2.0','HDBwT':'\x0aUnexpected\x20response\x20structure:','UALvi':'refresh.txt','ocvTu':function(_0x4dc32d,_0xe8e6eb,_0x127517,_0x40964c){return _0x4dc32d(_0xe8e6eb,_0x127517,_0x40964c);},'wzyWa':_0x5db084(0xbe)},_0x4c5ea0={'Content-Type':'application/json','Accept':_0x5db084(0x93)};_0xb5bb04&&(_0x4c5ea0[_0x38079c['BFdcU']]='Bearer\x20'+_0xb5bb04);const _0x56840a=async _0x3659c9=>{const _0x2c930e=_0x5db084,_0x21c759=await fetch(_0x4f354f,{'method':_0x2c930e(0x8b),'headers':_0x4c5ea0,'body':JSON[_0x2c930e(0xdd)](_0x3659c9)});if(!_0x21c759['ok']){const _0x20bf15=await _0x21c759['text']();throw new Error('HTTP\x20'+_0x21c759[_0x2c930e(0xa4)]+':\x20'+_0x20bf15);}return _0x38079c[_0x2c930e(0xf9)](parseResponse,_0x21c759);};process[_0x5db084(0x102)]['write']('Initializing\x20MCP\x20session...');const _0x1bcd71=await _0x38079c['XTjKb'](_0x56840a,{'jsonrpc':_0x5db084(0xbb),'id':0x1,'method':_0x5db084(0x85),'params':{'protocolVersion':_0x5db084(0xed),'capabilities':{},'clientInfo':{'name':_0x38079c['ezgsI'],'version':_0x38079c['oidOe']}}});if(_0x1bcd71['error'])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x1bcd71['error'][_0x5db084(0x101)]??JSON['stringify'](_0x1bcd71['error'])));console['log'](_0x38079c[_0x5db084(0xba)]),await fetch(_0x4f354f,{'method':'POST','headers':_0x4c5ea0,'body':JSON[_0x5db084(0xdd)]({'jsonrpc':_0x5db084(0xbb),'method':_0x38079c[_0x5db084(0xa7)]})})['then'](_0x74ef01=>_0x74ef01[_0x5db084(0xd8)]()),process['stdout'][_0x5db084(0xb6)](_0x5db084(0x98));const _0x5c710c=await _0x56840a({'jsonrpc':_0x38079c[_0x5db084(0x79)],'id':0x2,'method':_0x5db084(0xe0),'params':{'name':'get_cli_token','arguments':{}}});if(_0x5c710c[_0x5db084(0x97)])throw new Error('get_cli_token\x20failed:\x20'+(_0x5c710c['error'][_0x5db084(0x101)]??JSON['stringify'](_0x5c710c['error'])));console['log'](_0x38079c[_0x5db084(0xba)]);const _0x22be99=extractToken(_0x5c710c[_0x5db084(0xe4)]);if(!_0x22be99){console['error'](_0x38079c[_0x5db084(0xeb)]),console['error'](JSON['stringify'](_0x5c710c['result'],null,0x2));throw new Error(_0x5db084(0xf3));}const _0x15e8df=join(homedir(),_0x5db084(0x8d)),_0x11f70b=join(_0x15e8df,_0x38079c['UALvi']);await mkdir(_0x15e8df,{'recursive':!![]}),await _0x38079c['ocvTu'](writeFile,_0x11f70b,_0x22be99,{'mode':0x180}),await _0x38079c['ocvTu'](writeFile,join(_0x15e8df,_0x38079c['wzyWa']),_0x4f354f,{'mode':0x180}),console[_0x5db084(0x82)](_0x5db084(0x7a)+_0x11f70b),console[_0x5db084(0x82)]('Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a');}async function fetchAuthServerMetadata(_0x327f42){const _0xd84757=_0x151ee3,_0x35ac1d={'hhHNz':function(_0x28d136,_0x47f82e){return _0x28d136(_0x47f82e);}},_0x396e5c=_0x327f42+_0xd84757(0x8e),_0x5113d1=await _0x35ac1d['hhHNz'](fetch,_0x396e5c);if(!_0x5113d1['ok'])throw new Error(_0xd84757(0xc1)+_0x396e5c+':\x20'+_0x5113d1['status']);return _0x5113d1['json']();}function waitForCallback(_0x50bfa0){const _0x5506ea=_0x151ee3,_0x50685e={'JeLdn':'OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','oANpd':function(_0x39f14a,_0x3299d5){return _0x39f14a!==_0x3299d5;},'JLnIp':'/callback','TLcYb':_0x5506ea(0xdf),'Ydtiy':function(_0x4b5f2f,_0x5666bd){return _0x4b5f2f(_0x5666bd);},'mIAuz':_0x5506ea(0x103),'NcsVq':'<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','lXPDa':'127.0.0.1'};return new Promise((_0x613eb9,_0x374224)=>{const _0x4f9818=_0x5506ea,_0x30c5f3=setTimeout(()=>{const _0xeca439=_0x3bf6;_0x4fd564[_0xeca439(0xb2)](),_0x374224(new OAuthTimeoutError(_0x50685e[_0xeca439(0x96)]));},0x1d4c0),_0x4fd564=createServer((_0x2ae5ea,_0x4137f7)=>{const _0x383ec8=_0x3bf6,_0x52444b=new URL(_0x2ae5ea['url']??'/',_0x383ec8(0x9e)+CALLBACK_PORT);if(_0x50685e['oANpd'](_0x52444b['pathname'],_0x50685e[_0x383ec8(0x9f)])){_0x4137f7[_0x383ec8(0x100)](0x194),_0x4137f7['end'](_0x50685e[_0x383ec8(0x94)]);return;}const _0x5b9b0d=_0x52444b[_0x383ec8(0x7f)][_0x383ec8(0xa3)](_0x383ec8(0xea)),_0x14c6b0=_0x52444b[_0x383ec8(0x7f)]['get']('state'),_0x379915=_0x52444b[_0x383ec8(0x7f)][_0x383ec8(0xa3)]('error');if(_0x379915){const _0x3f8c9c=_0x52444b['searchParams'][_0x383ec8(0xa3)]('error_description')??_0x379915;_0x4137f7[_0x383ec8(0x100)](0xc8,{'Content-Type':'text/html'}),_0x4137f7[_0x383ec8(0xb8)]('<html><body><h2>Authentication\x20failed</h2><p>'+_0x3f8c9c+'</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>'),_0x50685e[_0x383ec8(0x92)](clearTimeout,_0x30c5f3),_0x4fd564[_0x383ec8(0xb2)](),_0x374224(new Error(_0x383ec8(0xd9)+_0x3f8c9c));return;}if(!_0x5b9b0d||_0x50685e['oANpd'](_0x14c6b0,_0x50bfa0)){_0x4137f7[_0x383ec8(0x100)](0x190,{'Content-Type':_0x50685e['mIAuz']}),_0x4137f7['end']('<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>');return;}_0x4137f7[_0x383ec8(0x100)](0xc8,{'Content-Type':_0x383ec8(0x103)}),_0x4137f7['end'](_0x50685e[_0x383ec8(0xb1)]),clearTimeout(_0x30c5f3),_0x4fd564[_0x383ec8(0xb2)](),_0x613eb9(_0x5b9b0d);});_0x4fd564[_0x4f9818(0x104)](CALLBACK_PORT,_0x50685e[_0x4f9818(0xdc)]);});}async function openBrowser(_0x2e91cd){const _0x5cba34=_0x151ee3,_0x59c71c={'UWpsU':function(_0x2fe806,_0x608205){return _0x2fe806===_0x608205;},'Fqwdd':'darwin','twnre':_0x5cba34(0xb4),'kPNWX':_0x5cba34(0xfc),'AEWDL':'start'},{exec:_0x4e36d3}=await import('child_process'),_0x281cc8=_0x59c71c[_0x5cba34(0xe6)](process['platform'],_0x59c71c['Fqwdd'])?_0x59c71c[_0x5cba34(0xc7)]:process[_0x5cba34(0xf0)]===_0x59c71c[_0x5cba34(0xce)]?_0x59c71c['AEWDL']:_0x5cba34(0x88);_0x4e36d3(_0x281cc8+'\x20\x22'+_0x2e91cd+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x585f29=_0x151ee3,_0x193ab7={'siMLN':function(_0x1f5be5,_0x52ea76){return _0x1f5be5!==_0x52ea76;}};try{const _0x1944f8=JSON[_0x585f29(0x80)](await readFile(TOKEN_CACHE_PATH,'utf-8'));if(_0x1944f8['origin']&&_0x193ab7[_0x585f29(0x99)](_0x1944f8[_0x585f29(0x84)],currentOrigin))return null;if(_0x1944f8[_0x585f29(0xd2)]&&Date['now']()>_0x1944f8['expiresAt'])return null;return _0x1944f8['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0x28af14,_0x194cae,_0x8d406c){const _0x5d07d7=_0x151ee3,_0x5486a6={'CZvLv':function(_0x39d5c2,_0x3b5b00){return _0x39d5c2+_0x3b5b00;},'JUyTv':function(_0x2ccc30,_0x3bbecd){return _0x2ccc30*_0x3bbecd;},'YvlSN':function(_0x4213af,_0x219151,_0x322a85){return _0x4213af(_0x219151,_0x322a85);},'uxGcM':function(_0x584e8b){return _0x584e8b();},'gopLj':function(_0x28076b,_0x10eb39,_0x72d4b0,_0x4dc2a5){return _0x28076b(_0x10eb39,_0x72d4b0,_0x4dc2a5);}},_0x47f8aa=await loadCachedData(),_0x5e982f={..._0x47f8aa,'origin':currentOrigin,'accessToken':_0x28af14,'refreshToken':_0x194cae??_0x47f8aa?.[_0x5d07d7(0xf2)],'expiresAt':_0x8d406c?_0x5486a6[_0x5d07d7(0x83)](Date['now'](),_0x5486a6['JUyTv'](_0x8d406c,0x3e8)):undefined};await mkdir(_0x5486a6[_0x5d07d7(0xf7)](join,_0x5486a6[_0x5d07d7(0xa1)](homedir),_0x5d07d7(0x8d)),{'recursive':!![]}),await _0x5486a6['gopLj'](writeFile,TOKEN_CACHE_PATH,JSON[_0x5d07d7(0xdd)](_0x5e982f),{'mode':0x180});}async function loadCachedClient(){const _0x33acba=_0x151ee3,_0x2dea72=await loadCachedData();if(_0x2dea72?.[_0x33acba(0x84)]&&_0x2dea72[_0x33acba(0x84)]!==currentOrigin)return null;return _0x2dea72?.[_0x33acba(0xd1)]?{'clientId':_0x2dea72['clientId'],'clientSecret':_0x2dea72[_0x33acba(0xcb)]}:null;}async function clearCachedClient(){const _0x55ca1f=await loadCachedData();if(!_0x55ca1f)return;const {clientId:_0x4b374e,clientSecret:_0x4f70c7,..._0x577550}=_0x55ca1f;await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x577550),{'mode':0x180});}function _0x3bf6(_0x2a9ab8,_0x2c0db0){_0x2a9ab8=_0x2a9ab8-0x77;const _0x4adb3a=_0x4adb();let _0x3bf6e2=_0x4adb3a[_0x2a9ab8];return _0x3bf6e2;}async function saveCachedClient(_0x9f4d3a,_0x3a3215){const _0x40d670=_0x151ee3,_0x19a093={'uiDgy':function(_0xef4afe){return _0xef4afe();},'FxGQt':'.ranger'},_0xd23da6=await loadCachedData(),_0x21322b={..._0xd23da6,'origin':currentOrigin,'accessToken':_0xd23da6?.[_0x40d670(0x9a)]??'','clientId':_0x9f4d3a,'clientSecret':_0x3a3215};await mkdir(join(_0x19a093[_0x40d670(0x95)](homedir),_0x19a093[_0x40d670(0xc4)]),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x40d670(0xdd)](_0x21322b),{'mode':0x180});}async function loadCachedData(){const _0x38a6f7=_0x151ee3;try{return JSON[_0x38a6f7(0x80)](await readFile(TOKEN_CACHE_PATH,_0x38a6f7(0xff)));}catch{return null;}}async function parseResponse(_0x2707e7){const _0x31a06c=_0x151ee3,_0x5ea04b={'YzqaW':'text/event-stream','vtqTJ':'data:','MAygU':'No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream'},_0x335587=_0x2707e7[_0x31a06c(0xd5)][_0x31a06c(0xa3)]('content-type')??'';if(_0x335587[_0x31a06c(0xa6)](_0x5ea04b[_0x31a06c(0xde)])){const _0x323687=await _0x2707e7['text']();for(const _0x559cd8 of _0x323687[_0x31a06c(0xcd)]('\x0a')){const _0x3c059e=_0x559cd8[_0x31a06c(0xfe)]();if(_0x3c059e[_0x31a06c(0xf6)](_0x5ea04b['vtqTJ'])){const _0x1669c7=_0x3c059e[_0x31a06c(0xd0)](_0x5ea04b[_0x31a06c(0xc9)][_0x31a06c(0xb3)])[_0x31a06c(0xfe)]();if(!_0x1669c7)continue;try{const _0x2be9a9=JSON['parse'](_0x1669c7);if(_0x2be9a9['id']!==undefined||_0x2be9a9[_0x31a06c(0x97)])return _0x2be9a9;}catch{}}}throw new Error(_0x5ea04b['MAygU']);}return _0x2707e7['json']();}function extractToken(_0x434154){const _0x2a4f95=_0x151ee3,_0x43edb6={'DOgfy':'Unknown\x20error','cTFmx':function(_0x211378,_0x227408){return _0x211378===_0x227408;},'rYYAC':_0x2a4f95(0xd8),'ttAcD':function(_0x56d244,_0x21e406){return _0x56d244===_0x21e406;}};if(!_0x434154)return null;const _0x5eb6ff=_0x434154['structuredContent'];if(_0x5eb6ff?.['token']&&typeof _0x5eb6ff['token']===_0x2a4f95(0xdb))return _0x5eb6ff['token'];if(_0x434154[_0x2a4f95(0xbc)]){const _0x17d6b=_0x434154['content'];throw new Error(_0x2a4f95(0x77)+(_0x17d6b?.[0x0]?.[_0x2a4f95(0xd8)]??_0x43edb6['DOgfy']));}const _0x308b31=_0x434154['content'];if(_0x308b31)for(const _0x402b53 of _0x308b31){if(_0x43edb6[_0x2a4f95(0xe9)](_0x402b53[_0x2a4f95(0xa9)],_0x43edb6['rYYAC'])&&_0x402b53['text']){try{const _0x11e6bb=JSON['parse'](_0x402b53[_0x2a4f95(0xd8)]);if(_0x43edb6['ttAcD'](typeof _0x11e6bb?.[_0x2a4f95(0xfb)],'string'))return _0x11e6bb['token'];}catch{}const _0x41c1da=_0x402b53[_0x2a4f95(0xd8)]['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x41c1da)return _0x41c1da[0x1];}}return null;}
|
|
1
|
+
const _0xc9d8f1=_0x11c1;(function(_0x5af041,_0x406458){const _0x25b4ec=_0x11c1,_0x11cc8b=_0x5af041();while(!![]){try{const _0x42b8bb=-parseInt(_0x25b4ec(0x11f))/0x1+parseInt(_0x25b4ec(0xb8))/0x2+-parseInt(_0x25b4ec(0xc1))/0x3+-parseInt(_0x25b4ec(0xd0))/0x4*(-parseInt(_0x25b4ec(0x111))/0x5)+-parseInt(_0x25b4ec(0xd5))/0x6+parseInt(_0x25b4ec(0x11b))/0x7*(-parseInt(_0x25b4ec(0x9c))/0x8)+parseInt(_0x25b4ec(0xed))/0x9*(parseInt(_0x25b4ec(0xe5))/0xa);if(_0x42b8bb===_0x406458)break;else _0x11cc8b['push'](_0x11cc8b['shift']());}catch(_0x5d6018){_0x11cc8b['push'](_0x11cc8b['shift']());}}}(_0x7598,0x80059));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';function _0x7598(){const _0x19a1c9=['redirect_uri','\x20done','Bearer\x20','registration_endpoint','4197972xsvxSD','\x0aToken\x20written\x20to\x20','client_secret','ksYcO','LWNnb','result','YTtNe','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','darwin','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','sLSwv','origin','refresh.txt','SFEwz','WjTVO','aAaKW','13260470ZOZIyd','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','application/json,\x20text/event-stream','accessToken','FoSJJ','HTTP\x20','jBycq','glVWv','9PQlied','StSCA','then','APZdC','WdNmY','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','nKNSJ','Initializing\x20MCP\x20session...','response_type','code','\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20','string','platform','parse','end','initialize','uyPEg','smkLn','<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','VBnBO','searchParams','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','http://localhost:','2.0','utf-8','Dlwqj','writeHead','write','jVTXA','access_token','Ranger\x20CLI','bBoeE','undqQ','AGuIm','stringify','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','2511285NumkhQ','\x0aOpening\x20browser\x20for\x20authentication...','match','vpJgj','structuredContent','content','SJwNb','authorization_endpoint','expiresAt','status','56FqYSqr','Requesting\x20CLI\x20token...','coPAa','content-type','122177tOUKFO','SpKXs','text/event-stream','start','name','WRYSh','clientId','HXhPj','error','clientSecret','ocPuH','jnpWs','Kxleb','Hyfur','application/json','text','type','tDqZt','split','code_challenge_method','tools/call','client_id','get_cli_token\x20failed:\x20','2025-03-26','stdout','log','601712hoMjuM','pRlxa','Exchanging\x20authorization\x20code...','text/html','cyBDZ','set','authorization_code','base64url','kfTxL','application/x-www-form-urlencoded','token','GVrAe','MCP\x20initialize\x20failed:\x20','JcOgB','authorization_servers','sha256','PiDCw','vaLMP','QyCHY','POST','cpBFA','ItRgP','YgZAB','/.well-known/oauth-protected-resource','slice','rtdWL','aejfY','resource','887166bEWMjO','zdKGH','sqlZK','/callback','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','Authorization','Unknown\x20error','state','get','2478648NSpdBH','json','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','refresh_token','.ranger','zFErV','close','needs-oauth','update','1.0.0','message','/.well-known/oauth-authorization-server','UcDWF','win32','XXTsv','8vxuQoX'];_0x7598=function(){return _0x19a1c9;};return _0x7598();}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(),_0xc9d8f1(0xc5),'auth-origin.txt');export async function getMcpAuthOrigin(){const _0x12cb3b=_0xc9d8f1,_0x5a90ec={'bDago':_0x12cb3b(0x105)};try{const _0x4438f7=(await readFile(AUTH_ORIGIN_PATH,_0x5a90ec['bDago']))['trim']();return _0x4438f7||null;}catch{return null;}}export async function mcpBootstrap(){const _0x2ea947=_0xc9d8f1,_0x42b429={'ZQthr':function(_0x4fee91){return _0x4fee91();},'HXhPj':function(_0x4463fc,_0x2088f0){return _0x4463fc(_0x2088f0);},'JcOgB':_0x2ea947(0xc3),'ocPuH':'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.'},_0x9381b8=_0x42b429['ZQthr'](getMcpAuthUrl);currentOrigin=_0x9381b8;const _0x133e4c=process[_0x2ea947(0x9a)]['isTTY']??![];console['log'](_0x2ea947(0xf7)+_0x9381b8+'\x0a');const _0x1be46d=await _0x42b429[_0x2ea947(0x126)](tryUnauthenticated,_0x9381b8);let _0x12bae2=null;if(_0x1be46d==='proxied')_0x12bae2='';else{_0x12bae2=await loadCachedToken();if(!_0x12bae2){if(!_0x133e4c)throw new Error(_0x42b429[_0x2ea947(0xa9)]+_0x42b429[_0x2ea947(0x129)]);_0x12bae2=await _0x42b429['HXhPj'](oauthFlow,_0x9381b8);}}await callGetCliToken(_0x9381b8,_0x12bae2);}async function tryUnauthenticated(_0x508d6){const _0x293699=_0xc9d8f1,_0x107580={'PtdSe':'application/json,\x20text/event-stream','XXTsv':'2.0','smkLn':_0x293699(0xfc),'vaLMP':_0x293699(0xca)},_0x169896=await fetch(_0x508d6,{'method':_0x293699(0xaf),'headers':{'Content-Type':'application/json','Accept':_0x107580['PtdSe']},'body':JSON[_0x293699(0x10f)]({'jsonrpc':_0x107580[_0x293699(0xcf)],'id':0x1,'method':_0x107580[_0x293699(0xfe)],'params':{'protocolVersion':_0x293699(0x99),'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x107580[_0x293699(0xad)]}}})});if(_0x169896['ok'])return await _0x169896[_0x293699(0x91)](),'proxied';if(_0x169896[_0x293699(0x11a)]===0x191)return await _0x169896['text'](),_0x293699(0xc8);const _0x393a56=await _0x169896[_0x293699(0x91)]();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x169896['status']+':\x20'+_0x393a56);}class OAuthTimeoutError extends Error{constructor(_0x34a9a3){const _0x1ba92a=_0xc9d8f1;super(_0x34a9a3),this[_0x1ba92a(0x123)]='OAuthTimeoutError';}}function _0x11c1(_0x530cef,_0x359032){_0x530cef=_0x530cef-0x8d;const _0x7598d2=_0x7598();let _0x11c128=_0x7598d2[_0x530cef];return _0x11c128;}async function oauthFlow(_0x4e0e0b){const _0x5ec0b1=_0xc9d8f1,_0x352788={'SFEwz':function(_0x19350f,_0x2b0981){return _0x19350f(_0x2b0981);},'PiDCw':function(_0x5ae3b0,_0x56d22e){return _0x5ae3b0 instanceof _0x56d22e;}};try{return await _0x352788[_0x5ec0b1(0xe2)](oauthFlowAttempt,_0x4e0e0b);}catch(_0x3e7088){if(_0x352788[_0x5ec0b1(0xac)](_0x3e7088,OAuthTimeoutError)&&await loadCachedClient())return console['log']('\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'),await clearCachedClient(),await oauthFlowAttempt(_0x4e0e0b);throw _0x3e7088;}}async function oauthFlowAttempt(_0x28ad06){const _0x143047=_0xc9d8f1,_0x351c26={'cpBFA':'Discovering\x20authorization\x20server...','Ezjax':function(_0x481497,_0x5e8d09){return _0x481497(_0x5e8d09);},'yAlZy':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','YeTEF':_0x143047(0xdc),'nsqBp':function(_0x255aa1){return _0x255aa1();},'yasFP':function(_0x4fe51d,_0xdfb0f,_0x450107){return _0x4fe51d(_0xdfb0f,_0x450107);},'LSnmB':_0x143047(0xaf),'WnbvG':_0x143047(0x90),'YgZAB':_0x143047(0x10b),'APZdC':_0x143047(0xa2),'FeCNS':'refresh_token','Dlwqj':'\x20done','rtdWL':'base64url','YTtNe':function(_0x2c79a8,_0x3ecb2b){return _0x2c79a8(_0x3ecb2b);},'FoSJJ':'hex','YniNl':_0x143047(0xf5),'cyBDZ':'code','uyPEg':'S256','sqlZK':'resource'},_0x509923=_0x28ad06['replace'](/\/mcp$/,'');process['stdout']['write'](_0x351c26[_0x143047(0xb0)]);const _0x26b739=await _0x351c26['Ezjax'](fetch,_0x509923+_0x143047(0xb3));if(!_0x26b739['ok'])throw new Error(_0x351c26['yAlZy']);const _0x402cf4=await _0x26b739['json'](),_0x1da09d=_0x402cf4[_0x143047(0xaa)]?.[0x0];if(!_0x1da09d)throw new Error(_0x351c26['YeTEF']);console[_0x143047(0x9b)]('\x20'+_0x1da09d);const _0x3220eb=await fetchAuthServerMetadata(_0x1da09d);let _0x592625,_0x297318;const _0x34f156=await _0x351c26['nsqBp'](loadCachedClient);if(_0x34f156)_0x592625=_0x34f156[_0x143047(0x125)],_0x297318=_0x34f156[_0x143047(0x128)];else{if(_0x3220eb[_0x143047(0xd4)]){process['stdout'][_0x143047(0x108)]('Registering\x20OAuth\x20client...');const _0x564c8e=await _0x351c26['yasFP'](fetch,_0x3220eb[_0x143047(0xd4)],{'method':_0x351c26['LSnmB'],'headers':{'Content-Type':_0x351c26['WnbvG']},'body':JSON['stringify']({'client_name':_0x351c26[_0x143047(0xb2)],'redirect_uris':[_0x143047(0x103)+CALLBACK_PORT+_0x143047(0xbb)],'grant_types':[_0x351c26[_0x143047(0xf0)],_0x351c26['FeCNS']],'response_types':[_0x143047(0xf6)],'token_endpoint_auth_method':'none'})});if(!_0x564c8e['ok']){const _0x26cd60=await _0x564c8e[_0x143047(0x91)]();throw new Error('Client\x20registration\x20failed:\x20'+_0x26cd60);}const _0x25410d=await _0x564c8e[_0x143047(0xc2)]();_0x592625=_0x25410d[_0x143047(0x97)],_0x297318=_0x25410d['client_secret'],await saveCachedClient(_0x592625,_0x297318),console[_0x143047(0x9b)](_0x351c26[_0x143047(0x106)]);}else throw new Error(_0x143047(0xbc));}const _0x5bf08c=randomBytes(0x20)['toString'](_0x143047(0xa3)),_0x22fedb=createHash(_0x143047(0xab))[_0x143047(0xc9)](_0x5bf08c)['digest'](_0x351c26[_0x143047(0xb5)]),_0x42f82e=_0x351c26[_0x143047(0xdb)](randomBytes,0x10)['toString'](_0x351c26[_0x143047(0xe9)]),_0x59d8c0=new URL(_0x3220eb[_0x143047(0x118)]);_0x59d8c0['searchParams'][_0x143047(0xa1)](_0x351c26['YniNl'],_0x351c26[_0x143047(0xa0)]),_0x59d8c0['searchParams']['set'](_0x143047(0x97),_0x592625),_0x59d8c0[_0x143047(0x101)]['set'](_0x143047(0xd1),_0x143047(0x103)+CALLBACK_PORT+_0x143047(0xbb)),_0x59d8c0[_0x143047(0x101)][_0x143047(0xa1)]('code_challenge',_0x22fedb),_0x59d8c0['searchParams'][_0x143047(0xa1)](_0x143047(0x95),_0x351c26[_0x143047(0xfd)]),_0x59d8c0[_0x143047(0x101)]['set'](_0x143047(0xbf),_0x42f82e);_0x402cf4['resource']&&_0x59d8c0['searchParams'][_0x143047(0xa1)](_0x351c26['sqlZK'],_0x402cf4[_0x143047(0xb7)]);console[_0x143047(0x9b)](_0x143047(0x112)),console['log'](_0x143047(0xe6)+_0x59d8c0['toString']()+'\x0a'),await openBrowser(_0x59d8c0['toString']());const _0x120719=await _0x351c26['YTtNe'](waitForCallback,_0x42f82e);process['stdout']['write'](_0x143047(0x9e));const _0x4b2ce6=new URLSearchParams({'grant_type':'authorization_code','code':_0x120719,'redirect_uri':'http://localhost:'+CALLBACK_PORT+'/callback','client_id':_0x592625,'code_verifier':_0x5bf08c});_0x297318&&_0x4b2ce6['set'](_0x143047(0xd7),_0x297318);_0x402cf4[_0x143047(0xb7)]&&_0x4b2ce6['set'](_0x351c26[_0x143047(0xba)],_0x402cf4['resource']);const _0x5ea6f7=await fetch(_0x3220eb['token_endpoint'],{'method':_0x351c26['LSnmB'],'headers':{'Content-Type':_0x143047(0xa5)},'body':_0x4b2ce6});if(!_0x5ea6f7['ok']){const _0xae28ce=await _0x5ea6f7['text']();throw new Error('Token\x20exchange\x20failed:\x20'+_0xae28ce);}const _0x36f069=await _0x5ea6f7['json']();return console[_0x143047(0x9b)](_0x351c26[_0x143047(0x106)]),await saveCachedToken(_0x36f069[_0x143047(0x10a)],_0x36f069[_0x143047(0xc4)],_0x36f069['expires_in']),_0x36f069[_0x143047(0x10a)];}async function callGetCliToken(_0x2ec370,_0x152358){const _0x312aab=_0xc9d8f1,_0x5490ff={'glVWv':'application/json','jBycq':_0x312aab(0xbd),'JSCEW':function(_0x50f1dd,_0x5dfd3c){return _0x50f1dd(_0x5dfd3c);},'Kxleb':_0x312aab(0x104),'dPZRr':'initialize','jnpWs':_0x312aab(0x99),'UfghE':_0x312aab(0xca),'AGuIm':'\x20done','UcDWF':function(_0x53db54,_0x307b40,_0xda3b62){return _0x53db54(_0x307b40,_0xda3b62);},'ksYcO':'POST','sLSwv':_0x312aab(0x11c),'UZUsu':function(_0x48787c,_0x38c7a3){return _0x48787c(_0x38c7a3);},'whbDl':_0x312aab(0x96),'nKNSJ':'get_cli_token','zFErV':'\x0aUnexpected\x20response\x20structure:','WCEXq':function(_0x342f02){return _0x342f02();},'WRYSh':_0x312aab(0xe1),'LRlcO':function(_0x538dc2,_0x9cfce4,_0x4b65ee){return _0x538dc2(_0x9cfce4,_0x4b65ee);},'nQskX':function(_0x1ea759,_0x204f8d,_0x64749,_0x2907c0){return _0x1ea759(_0x204f8d,_0x64749,_0x2907c0);},'SpKXs':'auth-origin.txt'},_0x448b90={'Content-Type':_0x5490ff[_0x312aab(0xec)],'Accept':_0x312aab(0xe7)};_0x152358&&(_0x448b90[_0x5490ff[_0x312aab(0xeb)]]=_0x312aab(0xd3)+_0x152358);const _0x5bbe96=async _0x3acc50=>{const _0x133564=_0x312aab,_0x16bd3d=await fetch(_0x2ec370,{'method':'POST','headers':_0x448b90,'body':JSON['stringify'](_0x3acc50)});if(!_0x16bd3d['ok']){const _0x48f874=await _0x16bd3d[_0x133564(0x91)]();throw new Error(_0x133564(0xea)+_0x16bd3d[_0x133564(0x11a)]+':\x20'+_0x48f874);}return parseResponse(_0x16bd3d);};process['stdout']['write'](_0x312aab(0xf4));const _0x61e397=await _0x5490ff['JSCEW'](_0x5bbe96,{'jsonrpc':_0x5490ff['Kxleb'],'id':0x1,'method':_0x5490ff['dPZRr'],'params':{'protocolVersion':_0x5490ff[_0x312aab(0x8d)],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x5490ff['UfghE']}}});if(_0x61e397[_0x312aab(0x127)])throw new Error(_0x312aab(0xa8)+(_0x61e397[_0x312aab(0x127)][_0x312aab(0xcb)]??JSON[_0x312aab(0x10f)](_0x61e397['error'])));console[_0x312aab(0x9b)](_0x5490ff[_0x312aab(0x10e)]),await _0x5490ff['UcDWF'](fetch,_0x2ec370,{'method':_0x5490ff[_0x312aab(0xd8)],'headers':_0x448b90,'body':JSON[_0x312aab(0x10f)]({'jsonrpc':_0x5490ff[_0x312aab(0x8e)],'method':'notifications/initialized'})})[_0x312aab(0xef)](_0x46a9c6=>_0x46a9c6[_0x312aab(0x91)]()),process['stdout'][_0x312aab(0x108)](_0x5490ff[_0x312aab(0xdf)]);const _0x42476d=await _0x5490ff['UZUsu'](_0x5bbe96,{'jsonrpc':_0x5490ff[_0x312aab(0x8e)],'id':0x2,'method':_0x5490ff['whbDl'],'params':{'name':_0x5490ff[_0x312aab(0xf3)],'arguments':{}}});if(_0x42476d[_0x312aab(0x127)])throw new Error(_0x312aab(0x98)+(_0x42476d[_0x312aab(0x127)]['message']??JSON['stringify'](_0x42476d[_0x312aab(0x127)])));console['log'](_0x312aab(0xd2));const _0x3169ff=extractToken(_0x42476d['result']);if(!_0x3169ff){console[_0x312aab(0x127)](_0x5490ff[_0x312aab(0xc6)]),console[_0x312aab(0x127)](JSON['stringify'](_0x42476d[_0x312aab(0xda)],null,0x2));throw new Error(_0x312aab(0xf2));}const _0x15cdad=_0x5490ff['UcDWF'](join,_0x5490ff['WCEXq'](homedir),'.ranger'),_0x2402e3=_0x5490ff[_0x312aab(0xcd)](join,_0x15cdad,_0x5490ff[_0x312aab(0x124)]);await _0x5490ff['LRlcO'](mkdir,_0x15cdad,{'recursive':!![]}),await _0x5490ff['nQskX'](writeFile,_0x2402e3,_0x3169ff,{'mode':0x180}),await writeFile(join(_0x15cdad,_0x5490ff[_0x312aab(0x120)]),_0x2ec370,{'mode':0x180}),console[_0x312aab(0x9b)](_0x312aab(0xd6)+_0x2402e3),console['log']('Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a');}async function fetchAuthServerMetadata(_0x3743b6){const _0x305863=_0xc9d8f1,_0x4506c4=_0x3743b6+_0x305863(0xcc),_0xe00ffe=await fetch(_0x4506c4);if(!_0xe00ffe['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x4506c4+':\x20'+_0xe00ffe['status']);return _0xe00ffe[_0x305863(0xc2)]();}function waitForCallback(_0x4a310e){const _0x23a6bc=_0xc9d8f1,_0x5ab5d0={'iBiCq':function(_0x1de444,_0x107852){return _0x1de444!==_0x107852;},'aAaKW':_0x23a6bc(0xf6),'coPAa':_0x23a6bc(0xbf),'avGzg':_0x23a6bc(0xff),'WjTVO':'text/html','GBKvs':_0x23a6bc(0xde),'tiNQr':function(_0x525586,_0x1f93af,_0x282352){return _0x525586(_0x1f93af,_0x282352);},'EMmkG':function(_0x3f3d22,_0x2a4703){return _0x3f3d22(_0x2a4703);},'hOJZo':'127.0.0.1'};return new Promise((_0x1c3c82,_0x5208d5)=>{const _0x38d58f=_0x23a6bc,_0x1f97e6={'WJgdb':function(_0xc6b4ff,_0x5048e9){return _0x5ab5d0['iBiCq'](_0xc6b4ff,_0x5048e9);},'UxeqG':_0x5ab5d0[_0x38d58f(0xe4)],'aejfY':_0x5ab5d0[_0x38d58f(0x11d)],'ItRgP':'error','bBoeE':'error_description','pRlxa':_0x5ab5d0['avGzg'],'SJwNb':_0x5ab5d0[_0x38d58f(0xe3)],'StSCA':_0x5ab5d0['GBKvs'],'tDqZt':function(_0x21659e,_0x5c99ba){return _0x21659e(_0x5c99ba);}},_0x5db271=_0x5ab5d0['tiNQr'](setTimeout,()=>{const _0x5e4ba3=_0x38d58f;_0x108eec[_0x5e4ba3(0xc7)](),_0x5208d5(new OAuthTimeoutError('OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes'));},0x1d4c0),_0x108eec=_0x5ab5d0['EMmkG'](createServer,(_0x1e8cdf,_0x1fd188)=>{const _0x209f4a=_0x38d58f,_0x2f96e2=new URL(_0x1e8cdf['url']??'/',_0x209f4a(0x103)+CALLBACK_PORT);if(_0x1f97e6['WJgdb'](_0x2f96e2['pathname'],_0x209f4a(0xbb))){_0x1fd188['writeHead'](0x194),_0x1fd188[_0x209f4a(0xfb)]('Not\x20found');return;}const _0x3a57a3=_0x2f96e2['searchParams'][_0x209f4a(0xc0)](_0x1f97e6['UxeqG']),_0x2cacfa=_0x2f96e2[_0x209f4a(0x101)]['get'](_0x1f97e6[_0x209f4a(0xb6)]),_0x1353d6=_0x2f96e2[_0x209f4a(0x101)]['get'](_0x1f97e6[_0x209f4a(0xb1)]);if(_0x1353d6){const _0x144f07=_0x2f96e2['searchParams']['get'](_0x1f97e6[_0x209f4a(0x10c)])??_0x1353d6;_0x1fd188['writeHead'](0xc8,{'Content-Type':_0x209f4a(0x9f)}),_0x1fd188[_0x209f4a(0xfb)]('<html><body><h2>Authentication\x20failed</h2><p>'+_0x144f07+_0x209f4a(0x110)),clearTimeout(_0x5db271),_0x108eec[_0x209f4a(0xc7)](),_0x5208d5(new Error('OAuth\x20error:\x20'+_0x144f07));return;}if(!_0x3a57a3||_0x2cacfa!==_0x4a310e){_0x1fd188[_0x209f4a(0x107)](0x190,{'Content-Type':_0x209f4a(0x9f)}),_0x1fd188[_0x209f4a(0xfb)](_0x1f97e6[_0x209f4a(0x9d)]);return;}_0x1fd188['writeHead'](0xc8,{'Content-Type':_0x1f97e6[_0x209f4a(0x117)]}),_0x1fd188['end'](_0x1f97e6[_0x209f4a(0xee)]),clearTimeout(_0x5db271),_0x108eec[_0x209f4a(0xc7)](),_0x1f97e6[_0x209f4a(0x93)](_0x1c3c82,_0x3a57a3);});_0x108eec['listen'](CALLBACK_PORT,_0x5ab5d0['hOJZo']);});}async function openBrowser(_0x2bfef4){const _0x34164b=_0xc9d8f1,_0x322a34={'kfTxL':function(_0x449b7c,_0x55f654){return _0x449b7c===_0x55f654;},'VBnBO':_0x34164b(0xce),'ZLOIG':_0x34164b(0x122),'undqQ':function(_0x5e50d7,_0x17900e){return _0x5e50d7(_0x17900e);}},{exec:_0x54b444}=await import('child_process'),_0x5a93f3=process['platform']===_0x34164b(0xdd)?'open':_0x322a34[_0x34164b(0xa4)](process[_0x34164b(0xf9)],_0x322a34[_0x34164b(0x100)])?_0x322a34['ZLOIG']:'xdg-open';_0x322a34[_0x34164b(0x10d)](_0x54b444,_0x5a93f3+'\x20\x22'+_0x2bfef4+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x5c4a2b=_0xc9d8f1,_0x1f6746={'LWNnb':'utf-8','QyCHY':function(_0x345628,_0x162edb){return _0x345628!==_0x162edb;}};try{const _0x4b1566=JSON[_0x5c4a2b(0xfa)](await readFile(TOKEN_CACHE_PATH,_0x1f6746[_0x5c4a2b(0xd9)]));if(_0x4b1566[_0x5c4a2b(0xe0)]&&_0x1f6746[_0x5c4a2b(0xae)](_0x4b1566[_0x5c4a2b(0xe0)],currentOrigin))return null;if(_0x4b1566[_0x5c4a2b(0x119)]&&Date['now']()>_0x4b1566['expiresAt'])return null;return _0x4b1566['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0x24df88,_0x555d49,_0x249ffd){const _0x5a8d03=_0xc9d8f1,_0x4ec214={'JBVlM':function(_0x4dd153,_0x331a60){return _0x4dd153+_0x331a60;},'bVraq':function(_0x372a8b,_0x21b872,_0x4e801d){return _0x372a8b(_0x21b872,_0x4e801d);}},_0x59c617=await loadCachedData(),_0x254ee5={..._0x59c617,'origin':currentOrigin,'accessToken':_0x24df88,'refreshToken':_0x555d49??_0x59c617?.['refreshToken'],'expiresAt':_0x249ffd?_0x4ec214['JBVlM'](Date['now'](),_0x249ffd*0x3e8):undefined};await mkdir(_0x4ec214['bVraq'](join,homedir(),'.ranger'),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x5a8d03(0x10f)](_0x254ee5),{'mode':0x180});}async function loadCachedClient(){const _0x22c714=_0xc9d8f1,_0x481ce0={'csWAu':function(_0x36a6e3){return _0x36a6e3();}},_0x7aef1d=await _0x481ce0['csWAu'](loadCachedData);if(_0x7aef1d?.['origin']&&_0x7aef1d['origin']!==currentOrigin)return null;return _0x7aef1d?.[_0x22c714(0x125)]?{'clientId':_0x7aef1d[_0x22c714(0x125)],'clientSecret':_0x7aef1d['clientSecret']}:null;}async function clearCachedClient(){const _0x3e3a03=_0xc9d8f1,_0x2cc70c={'zdKGH':function(_0x1c986c,_0x5144e2,_0x3b26f7,_0x5bf84f){return _0x1c986c(_0x5144e2,_0x3b26f7,_0x5bf84f);}},_0x8469d6=await loadCachedData();if(!_0x8469d6)return;const {clientId:_0x3e18a9,clientSecret:_0x6b1eb9,..._0x57d19f}=_0x8469d6;await _0x2cc70c[_0x3e3a03(0xb9)](writeFile,TOKEN_CACHE_PATH,JSON[_0x3e3a03(0x10f)](_0x57d19f),{'mode':0x180});}async function saveCachedClient(_0x367d3a,_0x527940){const _0x5346e=_0xc9d8f1,_0x579c39={'GVrAe':function(_0x40b18f){return _0x40b18f();},'rNiEX':function(_0x55a648){return _0x55a648();},'jVTXA':_0x5346e(0xc5),'nLinv':function(_0x440415,_0x40bd68,_0x4c2344,_0x45d07b){return _0x440415(_0x40bd68,_0x4c2344,_0x45d07b);}},_0x1d546f=await _0x579c39[_0x5346e(0xa7)](loadCachedData),_0x4a448a={..._0x1d546f,'origin':currentOrigin,'accessToken':_0x1d546f?.[_0x5346e(0xe8)]??'','clientId':_0x367d3a,'clientSecret':_0x527940};await mkdir(join(_0x579c39['rNiEX'](homedir),_0x579c39[_0x5346e(0x109)]),{'recursive':!![]}),await _0x579c39['nLinv'](writeFile,TOKEN_CACHE_PATH,JSON[_0x5346e(0x10f)](_0x4a448a),{'mode':0x180});}async function loadCachedData(){const _0x1eebf1=_0xc9d8f1;try{return JSON['parse'](await readFile(TOKEN_CACHE_PATH,_0x1eebf1(0x105)));}catch{return null;}}async function parseResponse(_0x4d3ed3){const _0x5f588c=_0xc9d8f1,_0x5b5ea7={'CWMwV':_0x5f588c(0x11e),'Hyfur':'data:','WdNmY':_0x5f588c(0x102)},_0xe6bc4f=_0x4d3ed3['headers']['get'](_0x5b5ea7['CWMwV'])??'';if(_0xe6bc4f['includes'](_0x5f588c(0x121))){const _0x3f1463=await _0x4d3ed3[_0x5f588c(0x91)]();for(const _0x470c0c of _0x3f1463[_0x5f588c(0x94)]('\x0a')){const _0x4e3f77=_0x470c0c['trim']();if(_0x4e3f77['startsWith'](_0x5b5ea7['Hyfur'])){const _0x483ec6=_0x4e3f77[_0x5f588c(0xb4)](_0x5b5ea7[_0x5f588c(0x8f)]['length'])['trim']();if(!_0x483ec6)continue;try{const _0x1a6cdd=JSON['parse'](_0x483ec6);if(_0x1a6cdd['id']!==undefined||_0x1a6cdd[_0x5f588c(0x127)])return _0x1a6cdd;}catch{}}}throw new Error(_0x5b5ea7[_0x5f588c(0xf1)]);}return _0x4d3ed3['json']();}function extractToken(_0x593008){const _0x4b5d91=_0xc9d8f1,_0x5beafe={'mdiHU':function(_0x244016,_0x33da44){return _0x244016===_0x33da44;},'SXUzd':'string','vpJgj':function(_0xa6651c,_0x3c260f){return _0xa6651c===_0x3c260f;}};if(!_0x593008)return null;const _0x40c606=_0x593008[_0x4b5d91(0x115)];if(_0x40c606?.[_0x4b5d91(0xa6)]&&_0x5beafe['mdiHU'](typeof _0x40c606['token'],_0x5beafe['SXUzd']))return _0x40c606['token'];if(_0x593008['isError']){const _0x413b97=_0x593008[_0x4b5d91(0x116)];throw new Error('Server\x20returned\x20error:\x20'+(_0x413b97?.[0x0]?.[_0x4b5d91(0x91)]??_0x4b5d91(0xbe)));}const _0x51b1a3=_0x593008[_0x4b5d91(0x116)];if(_0x51b1a3)for(const _0x4e799f of _0x51b1a3){if(_0x5beafe[_0x4b5d91(0x114)](_0x4e799f[_0x4b5d91(0x92)],_0x4b5d91(0x91))&&_0x4e799f['text']){try{const _0x4cdd77=JSON[_0x4b5d91(0xfa)](_0x4e799f['text']);if(typeof _0x4cdd77?.[_0x4b5d91(0xa6)]===_0x4b5d91(0xf8))return _0x4cdd77['token'];}catch{}const _0x12692e=_0x4e799f['text'][_0x4b5d91(0x113)](/(rngr_[A-Za-z0-9_-]+)/);if(_0x12692e)return _0x12692e[0x1];}}return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1cf727,_0x47f2d5){const _0x47e24f=_0x34fc,_0x47cad3=_0x1cf727();while(!![]){try{const _0x2ff20b=-parseInt(_0x47e24f(0xc5))/0x1+parseInt(_0x47e24f(0xbb))/0x2+-parseInt(_0x47e24f(0x98))/0x3+-parseInt(_0x47e24f(0xc0))/0x4*(-parseInt(_0x47e24f(0x8d))/0x5)+parseInt(_0x47e24f(0x9d))/0x6*(-parseInt(_0x47e24f(0xcc))/0x7)+-parseInt(_0x47e24f(0xa5))/0x8+parseInt(_0x47e24f(0xcd))/0x9;if(_0x2ff20b===_0x47f2d5)break;else _0x47cad3['push'](_0x47cad3['shift']());}catch(_0x342120){_0x47cad3['push'](_0x47cad3['shift']());}}}(_0x4db9,0x6c3bd));import{readFile,rm}from'fs/promises';import{existsSync}from'fs';import{join}from'path';import _0x255b4d from'inquirer';import{getEnvNames}from'./env.js';import{getEnvDir,loadSettings}from'./utils/settings.js';import{getRangerDir}from'./utils/rangerRoot.js';function _0x34fc(_0x6ea894,_0x4d6951){_0x6ea894=_0x6ea894-0x79;const _0x4db993=_0x4db9();let _0x34fc65=_0x4db993[_0x6ea894];return _0x34fc65;}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 formatPlanLine(_0x272882){const _0x119356=_0x34fc;if(_0x272882[_0x119356(0xb6)]===_0x119356(0x9a))return'\x20\x20'+_0x272882[_0x119356(0xa3)]['padEnd'](0x1e)+_0x119356(0x9f)+_0x272882[_0x119356(0xa9)]+')';if(_0x272882['preserveBaseUrl']&&_0x272882['baseUrl'])return'\x20\x20'+_0x272882[_0x119356(0xa3)]['padEnd'](0x1e)+_0x119356(0x83)+_0x272882[_0x119356(0x84)]+_0x119356(0x7a)+_0x272882[_0x119356(0x7e)]+'\x20as\x20project\x20override)';if(_0x272882['baseUrl'])return'\x20\x20'+_0x272882[_0x119356(0xa3)][_0x119356(0xcb)](0x1e)+_0x119356(0x83)+_0x272882['envKey']+_0x119356(0xc9)+_0x272882[_0x119356(0x7e)]+')';return'\x20\x20'+_0x272882['profileName'][_0x119356(0xcb)](0x1e)+_0x119356(0x83)+_0x272882['envKey']+')';}function shouldWarnGitTrackedOnce(_0x5556f9){const _0x14b165=_0x34fc,_0xfe900c=readProjectsConfig(),_0x40e942=_0xfe900c['projects'][_0x5556f9]??={},_0x4b05e1=_0x40e942[_0x14b165(0xb9)]??={},_0x1cb55e=_0x4b05e1[_0x14b165(0x9b)],_0x14d75d=new Date(),_0x5d7371=_0x14d75d['toISOString']()[_0x14b165(0x91)](0x0,0xa);if(_0x1cb55e===_0x5d7371)return![];return _0x4b05e1['gitTrackedRanger']=_0x5d7371,writeProjectsConfig(_0xfe900c),!![];}export async function migrateProfile(_0x160685,_0x1b55d5){const _0x42b746=_0x34fc,_0x4b1f8d={'dcloS':function(_0x4481e6,_0x5a97af){return _0x4481e6===_0x5a97af;},'pyoiy':'No\x20cloud\x20profile\x20auth\x20config\x20found\x20for\x20this\x20org.\x20Migration\x20requires\x20at\x20least\x20one\x20configured\x20auth\x20environment.','YNYWt':function(_0x492d0e,_0x245ce8){return _0x492d0e(_0x245ce8);},'QESCZ':function(_0x26b884,_0x53cd59){return _0x26b884(_0x53cd59);},'JLlwE':'skip','VtfFs':_0x42b746(0xbe),'qwzgP':function(_0xb90923,_0x358342){return _0xb90923(_0x358342);},'gSvXW':_0x42b746(0x89),'vTEiL':function(_0x57e856,_0x396500,_0x4f9fd3){return _0x57e856(_0x396500,_0x4f9fd3);},'QKfrG':'baseUrl','isHfS':_0x42b746(0xc4),'aRvni':function(_0x33f3c6,_0x26cc2d){return _0x33f3c6&&_0x26cc2d;},'iaaRS':'confirm','fwZVP':'Aborted.','dgIXW':function(_0xc8bb73,_0x523a7b){return _0xc8bb73(_0x523a7b);},'ZwxuM':'4|1|3|2|0','KHksW':_0x42b746(0xb8),'iuFiK':function(_0x20aeb2,_0x3f8a58){return _0x20aeb2===_0x3f8a58;},'CzUDg':'name_conflict','ZJgLN':'utf-8','pUeqJ':function(_0x148973,_0x50ed5a,_0x4b7bbe,_0x5a0871,_0x12c97d){return _0x148973(_0x50ed5a,_0x4b7bbe,_0x5a0871,_0x12c97d);},'YsLRV':function(_0x55f910,_0x4eaf0c){return _0x55f910 instanceof _0x4eaf0c;},'aUbZh':function(_0x565ade,_0x5ba4a6){return _0x565ade(_0x5ba4a6);},'hJviC':function(_0x2ab436,_0x202b1e){return _0x2ab436 instanceof _0x202b1e;},'RkekT':function(_0x441b53,_0x3a0252){return _0x441b53(_0x3a0252);},'mkRAS':function(_0x15df4b,_0x382108){return _0x15df4b+_0x382108;}};if(!_0x160685['profileName']&&!_0x160685['all'])throw new Error('Provide\x20a\x20profile\x20name\x20or\x20--all.\x0a\x20\x20Example:\x20ranger\x20profile\x20migrate\x20--all\x20--dry-run');let _0x4dee4c;try{_0x4dee4c=await fetchAuthConfig();}catch(_0x5a379b){throw new Error('Could\x20not\x20fetch\x20auth\x20config\x20('+(_0x5a379b instanceof Error?_0x5a379b['message']:String(_0x5a379b))+').\x20Run:\x20ranger\x20setup');}if(!_0x4dee4c||!_0x4dee4c['environments']||_0x4b1f8d['dcloS'](Object['keys'](_0x4dee4c['environments'])[_0x42b746(0xaa)],0x0))throw new Error(_0x4b1f8d['pyoiy']);const _0x3dadd7=[];if(_0x160685['all']){const {envNames:_0x4b0b71,envTypes:_0x42c790}=await getEnvNames();for(const _0xc055b3 of _0x4b0b71){if(_0x42c790[_0xc055b3]==='ci')continue;_0x3dadd7['push'](_0xc055b3);}}else _0x160685['profileName']&&_0x3dadd7['push'](_0x160685['profileName']);if(_0x3dadd7['length']===0x0){console['log']('No\x20local\x20profiles\x20found\x20to\x20migrate.');return;}const _0x3ac51e=[];for(const _0x364e4a of _0x3dadd7){const _0x1b1163=_0x4b1f8d[_0x42b746(0xb5)](getEnvDir,_0x364e4a);if(!_0x4b1f8d['QESCZ'](existsSync,_0x1b1163)){_0x3ac51e['push']({'kind':_0x4b1f8d['JLlwE'],'profileName':_0x364e4a,'reason':_0x4b1f8d[_0x42b746(0x86)]});continue;}const _0x11b2cd=await _0x4b1f8d[_0x42b746(0x99)](loadSettings,_0x364e4a),_0x4470eb=_0x11b2cd[_0x42b746(0x7e)];if(!_0x4470eb){_0x3ac51e[_0x42b746(0xc3)]({'kind':_0x42b746(0x9a),'profileName':_0x364e4a,'reason':_0x4b1f8d[_0x42b746(0x82)]});continue;}const _0x7354fd=_0x4b1f8d[_0x42b746(0x85)](matchAuthEnvironment,_0x4470eb,_0x4dee4c);if(!_0x7354fd){_0x3ac51e[_0x42b746(0xc3)]({'kind':_0x4b1f8d['JLlwE'],'profileName':_0x364e4a,'reason':_0x42b746(0x79)});continue;}const _0x1d762d=_0x4dee4c[_0x42b746(0xb2)][_0x7354fd],_0x35ad25=_0x1d762d?.['domains']??[],_0x58a3a0=_0x35ad25[_0x42b746(0xca)](_0x1bb3c2=>{const _0x3d9ce1=_0x42b746;try{return new URL(_0x1bb3c2)['origin']===new URL(_0x4470eb)[_0x3d9ce1(0xba)];}catch{return![];}}),_0x596cf6={};for(const [_0x7b17fb,_0x30b85b]of Object[_0x42b746(0xaf)](_0x11b2cd)){if(_0x7b17fb===_0x4b1f8d['QKfrG'])continue;if(_0x30b85b===undefined)continue;_0x596cf6[_0x7b17fb]=_0x30b85b;}!_0x58a3a0&&(_0x596cf6['baseUrl']=_0x4470eb);const _0x336be5=join(_0x1b1163,_0x4b1f8d[_0x42b746(0xbf)]),_0x50d148=existsSync(_0x336be5);_0x3ac51e['push']({'kind':_0x42b746(0xa2),'profileName':_0x364e4a,'envKey':_0x7354fd,'baseUrl':_0x4470eb,'preserveBaseUrl':!_0x58a3a0,'settings':_0x596cf6,'authJsonPath':_0x50d148?_0x336be5:null});}console[_0x42b746(0x8f)](_0x42b746(0xb3));for(const _0x94721e of _0x3ac51e){console['log'](formatPlanLine(_0x94721e));}if(_0x160685[_0x42b746(0x96)]){console[_0x42b746(0x8f)]('Nothing\x20migrated.\x20Run\x20without\x20--dry-run\x20to\x20apply.');return;}const _0x5ad7c4=Boolean(process['stdin'][_0x42b746(0x92)]&&process[_0x42b746(0x7c)][_0x42b746(0x92)]),_0x458187=_0x3ac51e['some'](_0x3802ef=>_0x3802ef[_0x42b746(0xb6)]===_0x42b746(0xa2));if(_0x4b1f8d['aRvni'](_0x458187,_0x5ad7c4)&&!_0x160685[_0x42b746(0x94)]){const {proceed:_0x405935}=await _0x255b4d[_0x42b746(0xb7)]([{'type':_0x4b1f8d[_0x42b746(0x7b)],'name':'proceed','message':_0x42b746(0xab),'default':![]}]);if(!_0x405935){console[_0x42b746(0x8f)](_0x4b1f8d[_0x42b746(0xc2)]);return;}}const _0x2cc13a=getRangerDir();let _0x48c832=![];if(existsSync(_0x2cc13a))try{_0x48c832=await _0x4b1f8d['dgIXW'](isPathGitTracked,_0x2cc13a);}catch{_0x48c832=![];}if(_0x48c832&&_0x4b1f8d['QESCZ'](shouldWarnGitTrackedOnce,process[_0x42b746(0xc8)]())){const _0x5e220a=_0x4b1f8d[_0x42b746(0xc7)][_0x42b746(0x88)]('|');let _0x195a3b=0x0;while(!![]){switch(_0x5e220a[_0x195a3b++]){case'0':console[_0x42b746(0x8f)](_0x42b746(0xc1));continue;case'1':console[_0x42b746(0x8f)](_0x4b1f8d['KHksW']);continue;case'2':console['log'](_0x42b746(0x95));continue;case'3':console['log']('\x20\x20git\x20rm\x20-r\x20--cached\x20.ranger/');continue;case'4':console['log'](_0x42b746(0x90));continue;}break;}}let _0x593869=0x0,_0x47af63=0x0,_0x386fe3=0x0,_0x12cbf1=0x0;for(const _0x1614a8 of _0x3ac51e){if(_0x1614a8['kind']===_0x42b746(0x9a)){_0x12cbf1++,_0x1b55d5?.['trackPhaseEnd'](_0x42b746(0xbc),{'profileName':_0x1614a8['profileName'],'reason':_0x1614a8['reason']});continue;}_0x1b55d5?.['trackPhaseStart']('profile.migrate.started',{'profileName':_0x1614a8[_0x42b746(0xa3)],'envKey':_0x1614a8[_0x42b746(0x84)]});try{try{await createCloudProfile(_0x1614a8['profileName'],_0x1614a8[_0x42b746(0x84)],{'settings':_0x1614a8['settings']});}catch(_0x179d04){if(_0x179d04 instanceof ApiError&&_0x4b1f8d['iuFiK'](_0x179d04['status'],0x199)){console['log']('\x20\x20⚠\x20'+_0x1614a8[_0x42b746(0xa3)]+_0x42b746(0xd1)),_0x12cbf1++,_0x1b55d5?.[_0x42b746(0xb1)](_0x42b746(0xbc),{'profileName':_0x1614a8['profileName'],'reason':_0x4b1f8d[_0x42b746(0xbd)]});continue;}throw _0x179d04;}let _0x2ceeca=![],_0x346702=![];if(_0x1614a8['authJsonPath'])try{const _0x432f23=await readFile(_0x1614a8['authJsonPath'],_0x4b1f8d['ZJgLN']),_0x16cb22=JSON['parse'](_0x432f23);await _0x4b1f8d[_0x42b746(0x85)](uploadCloudProfileSession,_0x1614a8[_0x42b746(0xa3)],_0x16cb22),_0x2ceeca=!![];}catch(_0x46bd54){_0x346702=!![],console[_0x42b746(0x8f)]('\x20\x20⚠\x20'+_0x1614a8['profileName']+_0x42b746(0xa6)+(_0x46bd54 instanceof Error?_0x46bd54[_0x42b746(0x97)]:_0x4b1f8d['YNYWt'](String,_0x46bd54))+').\x20Cloud\x20profile\x20created;\x20local\x20auth.json\x20left\x20in\x20place.');}let _0x387165=![];if(_0x160685[_0x42b746(0x81)]){const _0x595e6d=process[_0x42b746(0xae)]['RANGER_TEST_USERNAME'],_0x34f1b0=process['env'][_0x42b746(0x9c)];if(_0x4b1f8d[_0x42b746(0xad)](_0x595e6d,_0x34f1b0))try{await saveCloudProfileCredentials(_0x1614a8[_0x42b746(0xa3)],_0x595e6d,_0x34f1b0),_0x387165=!![];}catch(_0x2b9b56){console['log']('\x20\x20⚠\x20'+_0x1614a8['profileName']+_0x42b746(0x8b)+(_0x2b9b56 instanceof Error?_0x2b9b56['message']:String(_0x2b9b56))+').');}else console[_0x42b746(0x8f)]('\x20\x20⚠\x20'+_0x1614a8[_0x42b746(0xa3)]+_0x42b746(0xac));}if(_0x1614a8['preserveBaseUrl']&&_0x1614a8['baseUrl'])try{_0x4b1f8d[_0x42b746(0x87)](setProfileOverride,process[_0x42b746(0xc8)](),_0x1614a8['profileName'],_0x42b746(0x7e),_0x1614a8[_0x42b746(0x7e)]);}catch(_0x5c5edc){console[_0x42b746(0x8f)]('\x20\x20⚠\x20'+_0x1614a8[_0x42b746(0xa3)]+_0x42b746(0xcf)+(_0x4b1f8d['YsLRV'](_0x5c5edc,Error)?_0x5c5edc[_0x42b746(0x97)]:_0x4b1f8d['YNYWt'](String,_0x5c5edc))+').');}const _0x3b46ad=_0x4b1f8d[_0x42b746(0x7d)](getEnvDir,_0x1614a8[_0x42b746(0xa3)]);if(!_0x346702&&_0x4b1f8d['aUbZh'](existsSync,_0x3b46ad))try{await rm(_0x3b46ad,{'recursive':!![],'force':!![]}),_0x47af63++;}catch(_0x25c8fc){console[_0x42b746(0x8f)]('\x20\x20⚠\x20'+_0x1614a8['profileName']+_0x42b746(0x8e)+_0x3b46ad+'\x20('+(_0x25c8fc instanceof Error?_0x25c8fc[_0x42b746(0x97)]:String(_0x25c8fc))+').');}_0x593869++,_0x1614a8[_0x42b746(0xce)]&&_0x1614a8['baseUrl']?console[_0x42b746(0x8f)]('\x20\x20✓\x20'+_0x1614a8['profileName']+'\x20migrated\x20to\x20cloud\x20(env:\x20'+_0x1614a8['envKey']+_0x42b746(0xa1)):console[_0x42b746(0x8f)](_0x42b746(0x7f)+_0x1614a8[_0x42b746(0xa3)]+_0x42b746(0x93)+_0x1614a8[_0x42b746(0x84)]+')'),_0x1b55d5?.['trackPhaseEnd']('profile.migrate.succeeded',{'profileName':_0x1614a8[_0x42b746(0xa3)],'envKey':_0x1614a8['envKey'],'wasGitTracked':_0x48c832,'hadSession':_0x2ceeca,'savedCreds':_0x387165});}catch(_0x18e07e){_0x386fe3++,console['log'](_0x42b746(0x8c)+_0x1614a8[_0x42b746(0xa3)]+'\x20failed:\x20'+(_0x4b1f8d[_0x42b746(0xc6)](_0x18e07e,Error)?_0x18e07e[_0x42b746(0x97)]:_0x4b1f8d[_0x42b746(0xa8)](String,_0x18e07e))),_0x1b55d5?.['trackPhaseEnd']('profile.migrate.failed',{'profileName':_0x1614a8['profileName'],'error':_0x4b1f8d['YsLRV'](_0x18e07e,Error)?_0x18e07e['message']:String(_0x18e07e)});}}const _0x1e43b9=[];if(_0x593869>0x0)_0x1e43b9['push'](_0x593869+_0x42b746(0xd0)+(_0x4b1f8d[_0x42b746(0x8a)](_0x593869,0x1)?'':'s')+_0x42b746(0xa4));if(_0x47af63>0x0)_0x1e43b9[_0x42b746(0xc3)](_0x42b746(0x9e)+_0x47af63+_0x42b746(0xa0)+(_0x4b1f8d['dcloS'](_0x47af63,0x1)?'y':'ies'));if(_0x12cbf1>0x0)_0x1e43b9[_0x42b746(0xc3)](_0x12cbf1+_0x42b746(0xb4));if(_0x386fe3>0x0)_0x1e43b9['push'](_0x386fe3+_0x42b746(0x80));if(_0x1e43b9['length']>0x0)console[_0x42b746(0x8f)](_0x4b1f8d[_0x42b746(0xb0)](_0x1e43b9[_0x42b746(0xa7)]('.\x20'),'.'));}function _0x4db9(){const _0x188075=['saveCreds','gSvXW','\x20→\x20cloud\x20(env:\x20','envKey','vTEiL','VtfFs','pUeqJ','split','no\x20baseUrl\x20in\x20settings.json','dcloS',':\x20failed\x20to\x20save\x20credentials\x20(','\x20\x20✗\x20','2249385kiQKEq',':\x20failed\x20to\x20delete\x20local\x20dir\x20','log','Warning:\x20.ranger/\x20is\x20tracked\x20in\x20this\x20git\x20repo.','slice','isTTY','\x20migrated\x20to\x20cloud\x20(env:\x20','yes','\x20\x20echo\x20\x27.ranger/\x27\x20>>\x20.gitignore','dryRun','message','13497RGWFzW','qwzgP','skip','gitTrackedRanger','RANGER_TEST_PASSWORD','30jKRXug','Deleted\x20','\x20→\x20skip\x20(','\x20local\x20director',',\x20baseUrl\x20override\x20→\x20projects.json)','migrate','profileName','\x20migrated','3476040siMhXg',':\x20session\x20upload\x20failed\x20(','join','RkekT','reason','length','Proceed?',':\x20--save-creds\x20requested,\x20but\x20RANGER_TEST_USERNAME/PASSWORD\x20not\x20set\x20in\x20env.','aRvni','env','entries','mkRAS','trackPhaseEnd','environments','Plan:','\x20skipped','YNYWt','kind','prompt','After\x20migration,\x20uncommit\x20it:','_warnings','origin','1379828KxzgZk','profile.migrate.skipped','CzUDg','local\x20profile\x20directory\x20not\x20found','isHfS','4PUUvXB','Continuing\x20with\x20migration...','fwZVP','push','auth.json','759170LTbICb','hJviC','ZwxuM','cwd',',\x20matches\x20','some','padEnd','779261VaNZgD','9524907zKECiN','preserveBaseUrl',':\x20failed\x20to\x20write\x20projects.json\x20override\x20(','\x20profile',':\x20cloud\x20profile\x20with\x20this\x20name\x20already\x20exists.\x20Skipping.','no\x20matching\x20auth\x20env',',\x20preserving\x20baseUrl\x20','iaaRS','stdout','dgIXW','baseUrl','\x20\x20✓\x20','\x20failed'];_0x4db9=function(){return _0x188075;};return _0x4db9();}
|
|
1
|
+
(function(_0x2f429b,_0x134b10){const _0x448cc7=_0x3581,_0x418eab=_0x2f429b();while(!![]){try{const _0x206b72=parseInt(_0x448cc7(0xe7))/0x1+parseInt(_0x448cc7(0xd7))/0x2*(parseInt(_0x448cc7(0x10c))/0x3)+-parseInt(_0x448cc7(0xe9))/0x4*(parseInt(_0x448cc7(0x101))/0x5)+parseInt(_0x448cc7(0xff))/0x6*(-parseInt(_0x448cc7(0xec))/0x7)+-parseInt(_0x448cc7(0xd8))/0x8*(parseInt(_0x448cc7(0xbb))/0x9)+-parseInt(_0x448cc7(0xf3))/0xa*(-parseInt(_0x448cc7(0xde))/0xb)+-parseInt(_0x448cc7(0x105))/0xc;if(_0x206b72===_0x134b10)break;else _0x418eab['push'](_0x418eab['shift']());}catch(_0x35abe3){_0x418eab['push'](_0x418eab['shift']());}}}(_0x1f61,0x225dc));import{readFile,rm}from'fs/promises';import{existsSync}from'fs';import{join}from'path';import _0x2c77f1 from'inquirer';import{getEnvNames}from'./env.js';import{getEnvDir,loadSettings}from'./utils/settings.js';function _0x3581(_0x2cc7e2,_0x4258ec){_0x2cc7e2=_0x2cc7e2-0xbb;const _0x1f61dd=_0x1f61();let _0x3581bc=_0x1f61dd[_0x2cc7e2];return _0x3581bc;}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 formatPlanLine(_0x2ba3a6){const _0x755914=_0x3581;if(_0x2ba3a6[_0x755914(0xcc)]==='skip')return'\x20\x20'+_0x2ba3a6[_0x755914(0xdc)]['padEnd'](0x1e)+'\x20→\x20skip\x20('+_0x2ba3a6[_0x755914(0xf5)]+')';if(_0x2ba3a6[_0x755914(0xcb)]&&_0x2ba3a6['baseUrl'])return'\x20\x20'+_0x2ba3a6['profileName'][_0x755914(0xed)](0x1e)+_0x755914(0xca)+_0x2ba3a6[_0x755914(0xc7)]+_0x755914(0xe1)+_0x2ba3a6[_0x755914(0xdd)]+_0x755914(0xe5);if(_0x2ba3a6['baseUrl'])return'\x20\x20'+_0x2ba3a6[_0x755914(0xdc)]['padEnd'](0x1e)+_0x755914(0xca)+_0x2ba3a6['envKey']+_0x755914(0xd9)+_0x2ba3a6[_0x755914(0xdd)]+')';return'\x20\x20'+_0x2ba3a6['profileName'][_0x755914(0xed)](0x1e)+'\x20→\x20cloud\x20(env:\x20'+_0x2ba3a6['envKey']+')';}function shouldWarnGitTrackedOnce(_0x3656a5){const _0x26e892=_0x3581,_0x24952f={'pgykA':function(_0x29a70b){return _0x29a70b();},'ULPAi':function(_0x3b17ab,_0x434afc){return _0x3b17ab(_0x434afc);}},_0x17da6f=_0x24952f['pgykA'](readProjectsConfig),_0x272982=_0x17da6f[_0x26e892(0xd6)][_0x3656a5]??={},_0x4943c6=_0x272982['_warnings']??={},_0x41886e=_0x4943c6[_0x26e892(0xd3)],_0x1a7eef=new Date(),_0x23e766=_0x1a7eef[_0x26e892(0xc1)]()[_0x26e892(0x107)](0x0,0xa);if(_0x41886e===_0x23e766)return![];return _0x4943c6['gitTrackedRanger']=_0x23e766,_0x24952f['ULPAi'](writeProjectsConfig,_0x17da6f),!![];}export async function migrateProfile(_0x405c37,_0x5f59be){const _0x52650e=_0x3581,_0x31350f={'VTtft':function(_0x4e8b9a,_0x4b6f88){return _0x4e8b9a===_0x4b6f88;},'kMSUo':function(_0x1d09d6){return _0x1d09d6();},'OAPyJ':function(_0x57cdb1,_0x58e4a6){return _0x57cdb1 instanceof _0x58e4a6;},'uPlYZ':function(_0x3f2d9a,_0x106757){return _0x3f2d9a(_0x106757);},'DqJBj':_0x52650e(0xc2),'nVPAL':function(_0x2abb79){return _0x2abb79();},'dOpQF':function(_0x30dd9b,_0x5708e6){return _0x30dd9b(_0x5708e6);},'yWhan':_0x52650e(0xeb),'hAUAn':'skip','fhqSQ':_0x52650e(0xbf),'DVTBz':function(_0x15d769,_0x23fa83,_0x1bf3e6){return _0x15d769(_0x23fa83,_0x1bf3e6);},'xOsol':function(_0x2372ff,_0x20cc17){return _0x2372ff===_0x20cc17;},'svgFq':_0x52650e(0xe6),'AXYoi':function(_0x1b02e1,_0x2e2e08){return _0x1b02e1&&_0x2e2e08;},'KPVzb':'Proceed?','svoAY':'Aborted.','YKyrZ':function(_0x28a7ea){return _0x28a7ea();},'WPtPI':'Warning:\x20.ranger/\x20is\x20tracked\x20in\x20this\x20git\x20repo.','mcQwM':_0x52650e(0x10a),'qYbKj':'Continuing\x20with\x20migration...','WoYVR':_0x52650e(0xf8),'hCvVr':function(_0x2a562e,_0xc8358b,_0x27668d,_0x1cff77){return _0x2a562e(_0xc8358b,_0x27668d,_0x1cff77);},'kBGBh':_0x52650e(0xd4),'gpczO':function(_0x2fce0d,_0x4158eb,_0x430ef4,_0x4f697d,_0x23f84e){return _0x2fce0d(_0x4158eb,_0x430ef4,_0x4f697d,_0x23f84e);},'hPxvL':_0x52650e(0xdd),'azADC':function(_0x1b3223,_0x283403){return _0x1b3223 instanceof _0x283403;},'ItGyZ':function(_0x546f13,_0x17014f){return _0x546f13>_0x17014f;},'QhpPS':function(_0x231885,_0x3182df){return _0x231885>_0x3182df;}};if(!_0x405c37['profileName']&&!_0x405c37[_0x52650e(0x102)])throw new Error(_0x52650e(0xe8));let _0x49b23d;try{_0x49b23d=await _0x31350f['kMSUo'](fetchAuthConfig);}catch(_0x4cfd06){throw new Error('Could\x20not\x20fetch\x20auth\x20config\x20('+(_0x31350f['OAPyJ'](_0x4cfd06,Error)?_0x4cfd06[_0x52650e(0xd0)]:_0x31350f['uPlYZ'](String,_0x4cfd06))+_0x52650e(0xda));}if(!_0x49b23d||!_0x49b23d[_0x52650e(0xf7)]||Object['keys'](_0x49b23d[_0x52650e(0xf7)])['length']===0x0)throw new Error(_0x31350f['DqJBj']);const _0x4e0342=[];if(_0x405c37['all']){const {envNames:_0x5ba593,envTypes:_0x4bf787}=await _0x31350f['nVPAL'](getEnvNames);for(const _0x17b333 of _0x5ba593){if(_0x31350f[_0x52650e(0xe3)](_0x4bf787[_0x17b333],'ci'))continue;_0x4e0342['push'](_0x17b333);}}else _0x405c37['profileName']&&_0x4e0342['push'](_0x405c37[_0x52650e(0xdc)]);if(_0x31350f['VTtft'](_0x4e0342[_0x52650e(0xc9)],0x0)){console['log'](_0x52650e(0xee));return;}const _0x289ddd=[];for(const _0x15b1f5 of _0x4e0342){const _0x390561=_0x31350f['uPlYZ'](getEnvDir,_0x15b1f5);if(!_0x31350f['dOpQF'](existsSync,_0x390561)){_0x289ddd[_0x52650e(0x104)]({'kind':'skip','profileName':_0x15b1f5,'reason':_0x31350f[_0x52650e(0xf0)]});continue;}const _0x4d4d95=await loadSettings(_0x15b1f5),_0x10f344=_0x4d4d95['baseUrl'];if(!_0x10f344){_0x289ddd['push']({'kind':_0x31350f['hAUAn'],'profileName':_0x15b1f5,'reason':_0x31350f['fhqSQ']});continue;}const _0x1b7634=_0x31350f[_0x52650e(0xc4)](matchAuthEnvironment,_0x10f344,_0x49b23d);if(!_0x1b7634){_0x289ddd[_0x52650e(0x104)]({'kind':'skip','profileName':_0x15b1f5,'reason':_0x52650e(0xbe)});continue;}const _0x42df44=_0x49b23d['environments'][_0x1b7634],_0x467d24=_0x42df44?.['domains']??[],_0x584832=_0x467d24[_0x52650e(0x100)](_0x1fb05a=>{const _0x2a8971=_0x52650e;try{return _0x31350f['VTtft'](new URL(_0x1fb05a)[_0x2a8971(0xc8)],new URL(_0x10f344)[_0x2a8971(0xc8)]);}catch{return![];}}),_0x1f6330={};for(const [_0x5b3ddd,_0x5a5686]of Object[_0x52650e(0xc6)](_0x4d4d95)){if(_0x5b3ddd==='baseUrl')continue;if(_0x31350f[_0x52650e(0xfe)](_0x5a5686,undefined))continue;_0x1f6330[_0x5b3ddd]=_0x5a5686;}!_0x584832&&(_0x1f6330[_0x52650e(0xdd)]=_0x10f344);const _0x39af06=join(_0x390561,'auth.json'),_0x2dad2a=existsSync(_0x39af06);_0x289ddd['push']({'kind':_0x52650e(0xf6),'profileName':_0x15b1f5,'envKey':_0x1b7634,'baseUrl':_0x10f344,'preserveBaseUrl':!_0x584832,'settings':_0x1f6330,'authJsonPath':_0x2dad2a?_0x39af06:null});}console[_0x52650e(0xe0)](_0x31350f[_0x52650e(0xf2)]);for(const _0x5a67eb of _0x289ddd){console['log'](_0x31350f[_0x52650e(0xcd)](formatPlanLine,_0x5a67eb));}if(_0x405c37[_0x52650e(0xfa)]){console[_0x52650e(0xe0)]('Nothing\x20migrated.\x20Run\x20without\x20--dry-run\x20to\x20apply.');return;}const _0x5d1aa2=Boolean(process['stdin']['isTTY']&&process['stdout'][_0x52650e(0xbd)]),_0x9e77d3=_0x289ddd[_0x52650e(0x100)](_0x475f8a=>_0x475f8a['kind']==='migrate');if(_0x31350f['AXYoi'](_0x9e77d3,_0x5d1aa2)&&!_0x405c37['yes']){const {proceed:_0x59ea36}=await _0x2c77f1['prompt']([{'type':'confirm','name':'proceed','message':_0x31350f['KPVzb'],'default':![]}]);if(!_0x59ea36){console['log'](_0x31350f[_0x52650e(0xdb)]);return;}}const _0x360280=_0x31350f[_0x52650e(0xd5)](getRangerDir);let _0x524a1f=![];if(existsSync(_0x360280))try{_0x524a1f=await isPathGitTracked(_0x360280);}catch{_0x524a1f=![];}_0x524a1f&&shouldWarnGitTrackedOnce(process[_0x52650e(0xc0)]())&&(console['log'](_0x31350f['WPtPI']),console['log']('After\x20migration,\x20uncommit\x20it:'),console['log'](_0x52650e(0xd2)),console['log'](_0x31350f['mcQwM']),console[_0x52650e(0xe0)](_0x31350f['qYbKj']));let _0x15ca46=0x0,_0x210972=0x0,_0x1b7ff2=0x0,_0x36fd90=0x0;for(const _0x2a91a5 of _0x289ddd){if(_0x31350f[_0x52650e(0xfe)](_0x2a91a5[_0x52650e(0xcc)],_0x52650e(0xfc))){_0x36fd90++,_0x5f59be?.['trackPhaseEnd'](_0x31350f['WoYVR'],{'profileName':_0x2a91a5['profileName'],'reason':_0x2a91a5['reason']});continue;}_0x5f59be?.['trackPhaseStart']('profile.migrate.started',{'profileName':_0x2a91a5['profileName'],'envKey':_0x2a91a5['envKey']});try{try{await _0x31350f['hCvVr'](createCloudProfile,_0x2a91a5[_0x52650e(0xdc)],_0x2a91a5[_0x52650e(0xc7)],{'settings':_0x2a91a5[_0x52650e(0xc3)]});}catch(_0x3a5d6b){if(_0x3a5d6b instanceof ApiError&&_0x31350f['VTtft'](_0x3a5d6b[_0x52650e(0x109)],0x199)){console[_0x52650e(0xe0)]('\x20\x20⚠\x20'+_0x2a91a5['profileName']+_0x52650e(0xce)),_0x36fd90++,_0x5f59be?.['trackPhaseEnd'](_0x31350f['WoYVR'],{'profileName':_0x2a91a5[_0x52650e(0xdc)],'reason':_0x31350f['kBGBh']});continue;}throw _0x3a5d6b;}let _0x600a78=![],_0x426d7f=![];if(_0x2a91a5[_0x52650e(0xf4)])try{const _0x5353e1=await _0x31350f['DVTBz'](readFile,_0x2a91a5['authJsonPath'],_0x52650e(0xdf)),_0x252037=JSON[_0x52650e(0xfd)](_0x5353e1);await uploadCloudProfileSession(_0x2a91a5['profileName'],_0x252037),_0x600a78=!![];}catch(_0x37b07a){_0x426d7f=!![],console['log'](_0x52650e(0x10d)+_0x2a91a5[_0x52650e(0xdc)]+':\x20session\x20upload\x20failed\x20('+(_0x31350f[_0x52650e(0xf1)](_0x37b07a,Error)?_0x37b07a[_0x52650e(0xd0)]:String(_0x37b07a))+').\x20Cloud\x20profile\x20created;\x20local\x20auth.json\x20left\x20in\x20place.');}let _0x2e0b16=![];if(_0x405c37[_0x52650e(0xe2)]){const _0x5326c1=process['env'][_0x52650e(0x103)],_0x3d5ef1=process[_0x52650e(0xf9)]['RANGER_TEST_PASSWORD'];if(_0x5326c1&&_0x3d5ef1)try{await saveCloudProfileCredentials(_0x2a91a5[_0x52650e(0xdc)],_0x5326c1,_0x3d5ef1),_0x2e0b16=!![];}catch(_0x4a855b){console['log'](_0x52650e(0x10d)+_0x2a91a5[_0x52650e(0xdc)]+':\x20failed\x20to\x20save\x20credentials\x20('+(_0x4a855b instanceof Error?_0x4a855b[_0x52650e(0xd0)]:_0x31350f[_0x52650e(0xcd)](String,_0x4a855b))+').');}else console[_0x52650e(0xe0)]('\x20\x20⚠\x20'+_0x2a91a5[_0x52650e(0xdc)]+':\x20--save-creds\x20requested,\x20but\x20RANGER_TEST_USERNAME/PASSWORD\x20not\x20set\x20in\x20env.');}if(_0x2a91a5['preserveBaseUrl']&&_0x2a91a5['baseUrl'])try{_0x31350f['gpczO'](setProfileOverride,process['cwd'](),_0x2a91a5[_0x52650e(0xdc)],_0x31350f[_0x52650e(0x106)],_0x2a91a5[_0x52650e(0xdd)]);}catch(_0x2a6e0a){console['log']('\x20\x20⚠\x20'+_0x2a91a5['profileName']+':\x20failed\x20to\x20write\x20projects.json\x20override\x20('+(_0x31350f['OAPyJ'](_0x2a6e0a,Error)?_0x2a6e0a[_0x52650e(0xd0)]:String(_0x2a6e0a))+').');}const _0x4c29ea=getEnvDir(_0x2a91a5[_0x52650e(0xdc)]);if(!_0x426d7f&&existsSync(_0x4c29ea))try{await _0x31350f['DVTBz'](rm,_0x4c29ea,{'recursive':!![],'force':!![]}),_0x210972++;}catch(_0x22008){console[_0x52650e(0xe0)](_0x52650e(0x10d)+_0x2a91a5[_0x52650e(0xdc)]+':\x20failed\x20to\x20delete\x20local\x20dir\x20'+_0x4c29ea+'\x20('+(_0x22008 instanceof Error?_0x22008[_0x52650e(0xd0)]:String(_0x22008))+').');}_0x15ca46++,_0x2a91a5['preserveBaseUrl']&&_0x2a91a5['baseUrl']?console['log']('\x20\x20✓\x20'+_0x2a91a5[_0x52650e(0xdc)]+_0x52650e(0xc5)+_0x2a91a5['envKey']+',\x20baseUrl\x20override\x20→\x20projects.json)'):console['log'](_0x52650e(0xd1)+_0x2a91a5[_0x52650e(0xdc)]+_0x52650e(0xc5)+_0x2a91a5[_0x52650e(0xc7)]+')'),_0x5f59be?.['trackPhaseEnd'](_0x52650e(0xea),{'profileName':_0x2a91a5['profileName'],'envKey':_0x2a91a5[_0x52650e(0xc7)],'wasGitTracked':_0x524a1f,'hadSession':_0x600a78,'savedCreds':_0x2e0b16});}catch(_0x102e79){_0x1b7ff2++,console[_0x52650e(0xe0)](_0x52650e(0xcf)+_0x2a91a5['profileName']+_0x52650e(0xef)+(_0x102e79 instanceof Error?_0x102e79[_0x52650e(0xd0)]:String(_0x102e79))),_0x5f59be?.['trackPhaseEnd'](_0x52650e(0xfb),{'profileName':_0x2a91a5[_0x52650e(0xdc)],'error':_0x31350f[_0x52650e(0x10b)](_0x102e79,Error)?_0x102e79['message']:_0x31350f[_0x52650e(0xcd)](String,_0x102e79)});}}const _0x410085=[];if(_0x15ca46>0x0)_0x410085['push'](_0x15ca46+'\x20profile'+(_0x15ca46===0x1?'':'s')+'\x20migrated');if(_0x210972>0x0)_0x410085[_0x52650e(0x104)]('Deleted\x20'+_0x210972+_0x52650e(0x108)+(_0x210972===0x1?'y':'ies'));if(_0x31350f[_0x52650e(0xe4)](_0x36fd90,0x0))_0x410085[_0x52650e(0x104)](_0x36fd90+'\x20skipped');if(_0x31350f[_0x52650e(0xe4)](_0x1b7ff2,0x0))_0x410085[_0x52650e(0x104)](_0x1b7ff2+_0x52650e(0xbc));if(_0x31350f['QhpPS'](_0x410085[_0x52650e(0xc9)],0x0))console['log'](_0x410085['join']('.\x20')+'.');}function _0x1f61(){const _0x54a5d6=['\x20\x20✓\x20','\x20\x20git\x20rm\x20-r\x20--cached\x20.ranger/','gitTrackedRanger','name_conflict','YKyrZ','projects','2XCaWUf','8KaUODj',',\x20matches\x20',').\x20Run:\x20ranger\x20setup','svoAY','profileName','baseUrl','2546621xbRpSV','utf-8','log',',\x20preserving\x20baseUrl\x20','saveCreds','VTtft','ItGyZ','\x20as\x20project\x20override)','Plan:','143167BNgOIo','Provide\x20a\x20profile\x20name\x20or\x20--all.\x0a\x20\x20Example:\x20ranger\x20profile\x20migrate\x20--all\x20--dry-run','38284cUSvee','profile.migrate.succeeded','local\x20profile\x20directory\x20not\x20found','102739wumuXs','padEnd','No\x20local\x20profiles\x20found\x20to\x20migrate.','\x20failed:\x20','yWhan','OAPyJ','svgFq','10DExATQ','authJsonPath','reason','migrate','environments','profile.migrate.skipped','env','dryRun','profile.migrate.failed','skip','parse','xOsol','60xRqFPs','some','10ZwMEpb','all','RANGER_TEST_USERNAME','push','2281740mlTHhx','hPxvL','slice','\x20local\x20director','status','\x20\x20echo\x20\x27.ranger/\x27\x20>>\x20.gitignore','azADC','511569HLgewg','\x20\x20⚠\x20','435420kbNXdZ','\x20failed','isTTY','no\x20matching\x20auth\x20env','no\x20baseUrl\x20in\x20settings.json','cwd','toISOString','No\x20cloud\x20profile\x20auth\x20config\x20found\x20for\x20this\x20org.\x20Migration\x20requires\x20at\x20least\x20one\x20configured\x20auth\x20environment.','settings','DVTBz','\x20migrated\x20to\x20cloud\x20(env:\x20','entries','envKey','origin','length','\x20→\x20cloud\x20(env:\x20','preserveBaseUrl','kind','dOpQF',':\x20cloud\x20profile\x20with\x20this\x20name\x20already\x20exists.\x20Skipping.','\x20\x20✗\x20','message'];_0x1f61=function(){return _0x54a5d6;};return _0x1f61();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x47f338,_0xe907a7){const _0x2b4963=_0x5331,_0x523a66=_0x47f338();while(!![]){try{const _0x145c45=-parseInt(_0x2b4963(0x112))/0x1+-parseInt(_0x2b4963(0x110))/0x2*(parseInt(_0x2b4963(0x10a))/0x3)+parseInt(_0x2b4963(0x104))/0x4+parseInt(_0x2b4963(0x118))/0x5+-parseInt(_0x2b4963(0x120))/0x6+parseInt(_0x2b4963(0x106))/0x7+-parseInt(_0x2b4963(0x129))/0x8;if(_0x145c45===_0xe907a7)break;else _0x523a66['push'](_0x523a66['shift']());}catch(_0x5c21bb){_0x523a66['push'](_0x523a66['shift']());}}}(_0x4af0,0x3d139));import{join}from'path';import{existsSync}from'fs';import _0x3d94e9 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(_0x15758c){const _0x1493fb=_0x5331,_0x4e528f={'QrscW':function(_0x2ba49e,_0x40b05a){return _0x2ba49e(_0x40b05a);},'yMdaZ':'ranger@trailhead','bKLWp':_0x1493fb(0x11b),'aXgAB':_0x1493fb(0x128),'TaXOc':'pluginScope','zrKwP':_0x1493fb(0x103),'cWjIu':_0x1493fb(0x100),'WSkuJ':_0x1493fb(0x10e),'xMxOZ':'trailhead','eCMJB':_0x1493fb(0x116),'LkhsR':_0x1493fb(0x108),'tAxRU':'\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','ycYOj':'install','yoGWa':_0x1493fb(0x127),'noHwF':'❌\x20Failed\x20to\x20install\x20plugin:','BfCqB':_0x1493fb(0x114),'ANWsI':'✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','VDgUQ':function(_0x315e44,_0x3b36e5){return _0x315e44===_0x3b36e5;},'HPtHY':_0x1493fb(0x10f)},_0x43e3a8=await _0x4e528f[_0x1493fb(0x12d)](isPluginInstalled,_0x4e528f[_0x1493fb(0x12b)]);if(_0x43e3a8)return console['log'](_0x4e528f[_0x1493fb(0x130)]),![];const _0x37c609=_0x4e528f['QrscW'](existsSync,join(getProjectRoot(),_0x1493fb(0x12a)));let _0x2232ba;if(_0x15758c)_0x2232ba=_0x15758c;else{if(_0x37c609)_0x2232ba=_0x4e528f[_0x1493fb(0x119)];else{console[_0x1493fb(0x126)]('\x0a📦\x20Claude\x20Code\x20Plugin\x0a');const _0xce160f=await _0x3d94e9['prompt']([{'type':_0x1493fb(0x11e),'name':_0x4e528f['TaXOc'],'message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':_0x4e528f['zrKwP'],'value':_0x4e528f['cWjIu']},{'name':_0x4e528f[_0x1493fb(0x101)],'value':_0x1493fb(0x128)}],'default':_0x4e528f[_0x1493fb(0x123)]}]);_0x2232ba=_0xce160f['pluginScope'];}}console['log'](_0x1493fb(0x107)+_0x2232ba+_0x1493fb(0x105));const _0x530473=await isMarketplaceAdded(_0x4e528f[_0x1493fb(0x12c)]);let _0x55b42c=_0x530473;if(_0x530473)console['log']('✓\x20Marketplace\x20already\x20added');else{const _0x462517=await _0x4e528f['QrscW'](runClaudeCommand,[_0x4e528f['eCMJB'],'marketplace','add',_0x1493fb(0x10d)]);!_0x462517[_0x1493fb(0x10b)]?(console['error'](_0x4e528f[_0x1493fb(0x117)],_0x462517['error']),console['log'](_0x1493fb(0x114)),console[_0x1493fb(0x126)](_0x4e528f['tAxRU']),console[_0x1493fb(0x126)]('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x2232ba)):_0x55b42c=!![];}if(_0x55b42c){const _0x8238db=await runClaudeCommand([_0x1493fb(0x116),_0x4e528f['ycYOj'],_0x4e528f[_0x1493fb(0x12b)],_0x4e528f['yoGWa'],_0x2232ba]);if(!_0x8238db['success'])console[_0x1493fb(0x11d)](_0x4e528f['noHwF'],_0x8238db[_0x1493fb(0x11d)]),console[_0x1493fb(0x126)](_0x4e528f[_0x1493fb(0x111)]),console['log'](_0x1493fb(0x11c)+_0x2232ba);else{console['log'](_0x4e528f['ANWsI']);const _0x45fb2f=['plugin',_0x1493fb(0x115),_0x1493fb(0x121)];_0x4e528f['VDgUQ'](_0x2232ba,_0x4e528f[_0x1493fb(0x119)])&&_0x45fb2f[_0x1493fb(0x11f)](_0x1493fb(0x127),_0x4e528f[_0x1493fb(0x119)]);const _0x4cfd1f=await runClaudeCommand(_0x45fb2f,{'captureOutput':!![]}),_0x4be3dd=_0x4cfd1f['output']?.[_0x1493fb(0x113)](_0x1493fb(0x124));!_0x4cfd1f['success']&&!_0x4be3dd?console[_0x1493fb(0x11d)](_0x4e528f['HPtHY'],_0x4cfd1f[_0x1493fb(0x11d)]):console['log'](_0x1493fb(0x10c));}}return!![];}function _0x5331(_0x84c6f3,_0x31a312){_0x84c6f3=_0x84c6f3-0x100;const _0x4af00f=_0x4af0();let _0x5331e8=_0x4af00f[_0x84c6f3];return _0x5331e8;}export async function ensureClaudeSkills(_0x1e4fb6){const _0x9a8b70=_0x5331,_0x2e7084={'fTuDS':function(_0x54140b,_0x4a6812){return _0x54140b(_0x4a6812);},'jXSjz':'project','VKBZU':function(_0x26d279,_0x48a603){return _0x26d279||_0x48a603;},'nCIzL':function(_0x2a3dc7){return _0x2a3dc7();},'KLnkP':'confirm','oADwF':'Would\x20you\x20like\x20to\x20install\x20skills?'},_0xf9a543=existsSync(join(getSkillsDir(_0x9a8b70(0x100)),_0x9a8b70(0x109),_0x9a8b70(0x125))),_0x121349=_0x2e7084[_0x9a8b70(0x122)](existsSync,join(getSkillsDir(_0x2e7084['jXSjz']),'ranger',_0x9a8b70(0x125)));if(_0x2e7084[_0x9a8b70(0x12f)](_0xf9a543,_0x121349))return console[_0x9a8b70(0x126)]('✓\x20Ranger\x20skills\x20already\x20installed'),![];const _0x1c9d3d=existsSync(join(_0x2e7084['nCIzL'](getProjectRoot),_0x9a8b70(0x12a)));let _0x3329c3=!![];if(_0x1e4fb6)await _0x2e7084[_0x9a8b70(0x122)](skillup,{'autoInstall':_0x1e4fb6,'suppressUsage':!![]});else{if(_0x1c9d3d)await skillup({'autoInstall':_0x9a8b70(0x128),'suppressUsage':!![]});else{const _0x2093ff=await _0x3d94e9[_0x9a8b70(0x12e)]([{'type':_0x2e7084['KLnkP'],'name':'wantsSkillup','message':_0x2e7084[_0x9a8b70(0x11a)],'default':!![]}]);_0x3329c3=_0x2093ff[_0x9a8b70(0x102)],_0x3329c3&&await skillup({'suppressUsage':!![]});}}return _0x3329c3;}function _0x4af0(){const _0x24e662=['✓\x20Claude\x20Code\x20plugin\x20enabled','ranger-testing/trailhead','Project\x20(shared\x20with\x20team\x20via\x20git)','⚠\x20Failed\x20to\x20enable\x20plugin:','47704PQtDoO','BfCqB','165787xZdvRC','includes','\x0aYou\x20can\x20install\x20manually\x20with:','enable','plugin','LkhsR','2006120MfiVQi','aXgAB','oADwF','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','error','list','push','892392MPcUIf','ranger@trailhead','fTuDS','cWjIu','already\x20enabled','SKILL.md','log','--scope','project','1560912XWKVao','.claude','yMdaZ','xMxOZ','QrscW','prompt','VKBZU','bKLWp','user','WSkuJ','wantsSkillup','User\x20(available\x20in\x20all\x20your\x20projects)','1783880ecIlqV','\x20level)...\x0a','723968QYYVbE','\x0aInstalling\x20Claude\x20Code\x20plugin\x20(','❌\x20Failed\x20to\x20add\x20marketplace:','ranger','24WQqFSS','success'];_0x4af0=function(){return _0x24e662;};return _0x4af0();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1513cc,_0x5e3763){const _0x454440=_0x3830,_0x27b2b9=_0x1513cc();while(!![]){try{const _0x4f3807=-parseInt(_0x454440(0xb5))/0x1*(parseInt(_0x454440(0xaf))/0x2)+parseInt(_0x454440(0xb2))/0x3+parseInt(_0x454440(0xb3))/0x4+parseInt(_0x454440(0xc5))/0x5*(-parseInt(_0x454440(0xbf))/0x6)+parseInt(_0x454440(0xcb))/0x7+-parseInt(_0x454440(0xcc))/0x8*(-parseInt(_0x454440(0xb4))/0x9)+-parseInt(_0x454440(0xb0))/0xa;if(_0x4f3807===_0x5e3763)break;else _0x27b2b9['push'](_0x27b2b9['shift']());}catch(_0x1ad08b){_0x27b2b9['push'](_0x27b2b9['shift']());}}}(_0x1cd6,0xb34e6));function _0x3830(_0x58778f,_0x50daa4){_0x58778f=_0x58778f-0xaf;const _0x1cd6b7=_0x1cd6();let _0x3830fb=_0x1cd6b7[_0x58778f];return _0x3830fb;}import{join}from'path';import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0x4c7318 from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0x2faca1){const _0x49e9aa=_0x3830,_0x3cf416={'BXaMo':function(_0x3a1032,_0x1eb954){return _0x3a1032(_0x1eb954);},'MIfGX':'project','ohCGn':'opencode.json','qgzZK':'\x0a📦\x20OpenCode\x20Plugin\x0a','vPJsy':_0x49e9aa(0xb8),'WuBlc':'user','MCdBY':function(_0x25c38c,_0x1872ab,_0x385290){return _0x25c38c(_0x1872ab,_0x385290);},'lpaTr':_0x49e9aa(0xb6),'fHSJG':function(_0x2c8f0d,_0x3d8b0a){return _0x2c8f0d(_0x3d8b0a);},'toUFF':function(_0x34f245,_0x428fcd,_0x426a1f){return _0x34f245(_0x428fcd,_0x426a1f);},'SjMAs':function(_0x2bf446,_0x413b7a){return _0x2bf446+_0x413b7a;},'lAksp':'✓\x20OpenCode\x20plugin\x20configured'},_0x12982f=existsSync(join(_0x3cf416[_0x49e9aa(0xca)](getOpencodeConfigDir,_0x3cf416[_0x49e9aa(0xc0)]),_0x3cf416[_0x49e9aa(0xb7)]));let _0x36efae;if(_0x2faca1)_0x36efae=_0x2faca1;else{if(_0x12982f)_0x36efae=_0x49e9aa(0xc6);else{console['log'](_0x3cf416['qgzZK']);const _0x3e7ca4=await _0x4c7318['prompt']([{'type':_0x49e9aa(0xc9),'name':_0x3cf416['vPJsy'],'message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':_0x49e9aa(0xbd),'value':_0x3cf416[_0x49e9aa(0xc2)]},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':_0x3cf416[_0x49e9aa(0xc0)]}],'default':_0x49e9aa(0xc8)}]);_0x36efae=_0x3e7ca4[_0x49e9aa(0xb8)];}}const _0xbc7509=_0x3cf416[_0x49e9aa(0xc3)](join,_0x3cf416[_0x49e9aa(0xca)](getOpencodeConfigDir,_0x36efae),'opencode.json'),_0x249db7='@ranger-testing/opencode-plugin',_0x1d81df=_0x3cf416[_0x49e9aa(0xc7)];let _0x209504={};if(existsSync(_0xbc7509))try{const _0x5e5630=await readFile(_0xbc7509,'utf-8');_0x209504=JSON['parse'](_0x5e5630);}catch(_0x15a32c){return console[_0x49e9aa(0xbb)](_0x49e9aa(0xb1)),{'configured':![],'scope':_0x36efae,'error':_0x49e9aa(0xbc),'details':_0x15a32c};}const _0x3360d2=Array['isArray'](_0x209504[_0x49e9aa(0xba)])?_0x209504['plugin']:[];if(_0x3360d2['includes'](_0x249db7))return console['log']('✓\x20OpenCode\x20plugin\x20already\x20configured'),{'configured':![],'scope':_0x36efae};return _0x209504['$schema']=_0x209504['$schema']||_0x1d81df,_0x209504[_0x49e9aa(0xba)]=[..._0x3360d2,_0x249db7],await _0x3cf416[_0x49e9aa(0xc3)](mkdir,_0x3cf416[_0x49e9aa(0xc4)](getOpencodeConfigDir,_0x36efae),{'recursive':!![]}),await _0x3cf416[_0x49e9aa(0xbe)](writeFile,_0xbc7509,_0x3cf416['SjMAs'](JSON[_0x49e9aa(0xb9)](_0x209504,null,0x2),'\x0a')),console['log'](_0x3cf416[_0x49e9aa(0xc1)]),{'configured':!![],'scope':_0x36efae};}function _0x1cd6(){const _0x254229=['MCdBY','fHSJG','133660XoJyrl','project','lpaTr','user','list','BXaMo','916685ClUlts','8QUeOUh','2IOUtZm','4139050vTwacZ','⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','1520400pwlxsi','3244404NmKXqN','8108622fNRGiT','1094543IAaJXv','https://opencode.ai/config.json','ohCGn','pluginScope','stringify','plugin','error','Failed\x20to\x20read\x20opencode.json','User\x20(available\x20in\x20all\x20your\x20projects)','toUFF','24wrtaSE','MIfGX','lAksp','WuBlc'];_0x1cd6=function(){return _0x254229;};return _0x1cd6();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4f3930,_0x4cf2fc){const _0x2ac060=_0x2556,_0x318519=_0x4f3930();while(!![]){try{const _0xe87542=-parseInt(_0x2ac060(0x180))/0x1+-parseInt(_0x2ac060(0x171))/0x2*(-parseInt(_0x2ac060(0x170))/0x3)+-parseInt(_0x2ac060(0x17e))/0x4*(parseInt(_0x2ac060(0x176))/0x5)+-parseInt(_0x2ac060(0x16f))/0x6*(-parseInt(_0x2ac060(0x18b))/0x7)+-parseInt(_0x2ac060(0x16b))/0x8*(-parseInt(_0x2ac060(0x16e))/0x9)+-parseInt(_0x2ac060(0x197))/0xa+parseInt(_0x2ac060(0x177))/0xb*(parseInt(_0x2ac060(0x198))/0xc);if(_0xe87542===_0x4cf2fc)break;else _0x318519['push'](_0x318519['shift']());}catch(_0x4615fe){_0x318519['push'](_0x318519['shift']());}}}(_0x1a3f,0x53772));import{mkdir,readFile,readdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{authenticate,ensureRangerDir,ensureChromium,writeRangerGitignore}from'./start.js';function _0x2556(_0x4130f9,_0x780fe5){_0x4130f9=_0x4130f9-0x169;const _0x1a3f3d=_0x1a3f();let _0x2556a3=_0x1a3f3d[_0x4130f9];return _0x2556a3;}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';async function findCiProfile(_0x44f81f){const _0xff5623=_0x2556,_0x11de66={'UltrM':function(_0x986e21){return _0x986e21();},'haxBO':function(_0xa458fe,_0x33f40c,_0x454291){return _0xa458fe(_0x33f40c,_0x454291);},'WPhmS':function(_0x4aa0a6,_0x492ad2){return _0x4aa0a6(_0x492ad2);},'ydOZD':_0xff5623(0x186)},_0x2f6e3e=_0x11de66['UltrM'](getRangerDir),_0x3a62cc=join(_0x2f6e3e,'ci');if(_0x44f81f){const _0x486288=_0x11de66['haxBO'](join,_0x3a62cc,_0x44f81f);return{'name':_0x44f81f,'path':_0x486288};}if(!_0x11de66[_0xff5623(0x16a)](existsSync,_0x3a62cc))throw new Error(_0x11de66[_0xff5623(0x19e)]+_0xff5623(0x182));const _0x5875ed=await _0x11de66['haxBO'](readdir,_0x3a62cc,{'withFileTypes':!![]}),_0x5864d3=_0x5875ed[_0xff5623(0x18e)](_0x191091=>_0x191091['isDirectory']())['map'](_0x148cdd=>_0x148cdd[_0xff5623(0x194)]);if(_0x5864d3[_0xff5623(0x169)]===0x0)throw new Error('No\x20CI\x20profiles\x20found\x20in\x20.ranger/ci/.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a'+'Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.');if(_0x5864d3[_0xff5623(0x169)]===0x1){const _0x190e04=_0x5864d3[0x0];return console[_0xff5623(0x185)](_0xff5623(0x16c)+_0x190e04),{'name':_0x190e04,'path':join(_0x3a62cc,_0x190e04)};}throw new Error('Multiple\x20CI\x20profiles\x20found:\x20'+_0x5864d3[_0xff5623(0x17b)](',\x20')+'.\x20Use\x20--profile\x20to\x20specify\x20which\x20one.');}async function installPluginNonInteractive(){const _0x5e9be3=_0x2556,_0x1ac4cb={'EyyCj':function(_0x3cc3f8,_0x235750){return _0x3cc3f8(_0x235750);},'SIfGP':'✓\x20Claude\x20Code\x20plugin\x20already\x20installed','bnAfl':'Installing\x20Claude\x20Code\x20plugin\x20(project\x20level)...','rykMR':_0x5e9be3(0x16d),'fNRDH':'✓\x20Marketplace\x20already\x20added','hcUSA':function(_0x459d11,_0x58784c){return _0x459d11(_0x58784c);},'LRIdB':_0x5e9be3(0x183),'vlELF':'marketplace','oTEUS':'Failed\x20to\x20add\x20marketplace:','AhyWZ':'You\x20can\x20install\x20manually:\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','EvMGp':'install','LBsqT':_0x5e9be3(0x19c),'BoNlr':'Failed\x20to\x20install\x20plugin:','DhfFp':'You\x20can\x20install\x20manually:\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20project'},_0x4e0775=await _0x1ac4cb[_0x5e9be3(0x17c)](isPluginInstalled,'ranger@trailhead');if(_0x4e0775)return console['log'](_0x1ac4cb[_0x5e9be3(0x184)]),![];console['log'](_0x1ac4cb['bnAfl']);const _0x213954=await isMarketplaceAdded(_0x1ac4cb[_0x5e9be3(0x195)]);let _0x1864d9=_0x213954;if(_0x213954)console['log'](_0x1ac4cb['fNRDH']);else{const _0x334696=await _0x1ac4cb[_0x5e9be3(0x181)](runClaudeCommand,[_0x1ac4cb['LRIdB'],_0x1ac4cb['vlELF'],_0x5e9be3(0x191),'ranger-testing/trailhead']);!_0x334696['success']?(console[_0x5e9be3(0x189)](_0x1ac4cb['oTEUS'],_0x334696[_0x5e9be3(0x189)]),console['log'](_0x1ac4cb['AhyWZ'])):_0x1864d9=!![];}if(_0x1864d9){const _0x4a650e=await runClaudeCommand(['plugin',_0x1ac4cb['EvMGp'],_0x1ac4cb['LBsqT'],'--scope',_0x5e9be3(0x19a)]);!_0x4a650e['success']?(console[_0x5e9be3(0x189)](_0x1ac4cb[_0x5e9be3(0x196)],_0x4a650e['error']),console['log'](_0x1ac4cb['DhfFp'])):console['log'](_0x5e9be3(0x175));}return!![];}function _0x1a3f(){const _0x1e203d=['gTcKO','profile','add','auth.json.enc','skipChromium','name','rykMR','BoNlr','4272570IystrA','492lxbBVb','bWfIu','project','sessions','ranger@trailhead','RgyOr','ydOZD','length','WPhmS','2445224vTnRqv','Auto-detected\x20CI\x20profile:\x20','trailhead','9wssMzC','1087278fLBqlP','3howOmr','777638BOdMHL','chromium','trackPhaseEnd','skills','✓\x20Claude\x20Code\x20plugin\x20installed','8885CgiOAq','27313qFxiCt','trackPhaseStart','fqIha','path','join','EyyCj','No\x20API\x20token\x20available\x20for\x20decryption','140tCKfPC','settings.json','146162NWPpGf','hcUSA','Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.','plugin','SIfGP','log','No\x20CI\x20profiles\x20found.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','✓\x20Active\x20profile:\x20','dir_setup','error','LPjXI','7rDJChg','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','QvuWY','filter'];_0x1a3f=function(){return _0x1e203d;};return _0x1a3f();}export async function setupCi(_0xf74878,_0x475293,_0x5910b9){const _0x5e8b08=_0x2556,_0x4948d0={'lGsQp':'\x0a🔧\x20Ranger\x20CI\x20Setup\x0a','fqIha':'auth','LPjXI':function(_0x4b050f,_0xe10c1e){return _0x4b050f(_0xe10c1e);},'nmLkd':function(_0x46ac8f,_0x1ee16d,_0x3ca796){return _0x46ac8f(_0x1ee16d,_0x3ca796);},'gTcKO':function(_0x4f81aa,_0x40c4b2,_0x4222b9){return _0x4f81aa(_0x40c4b2,_0x4222b9);},'MrSmy':'profile_activate','uFvmS':function(_0xf62db5,_0xbb9fec,_0x4d740b){return _0xf62db5(_0xbb9fec,_0x4d740b);},'cPOHu':_0x5e8b08(0x17f),'bWfIu':'auth.json','RgyOr':_0x5e8b08(0x192),'QvuWY':function(_0x1e54ba,_0x54d591){return _0x1e54ba(_0x54d591);},'PsTBT':function(_0x4b33a4,_0x9329fa,_0x1026bb){return _0x4b33a4(_0x9329fa,_0x1026bb);},'zzSng':'✓\x20Auth\x20state\x20found','Ekjzk':_0x5e8b08(0x174),'Tuucc':'\x0a✅\x20Ranger\x20CI\x20setup\x20complete!\x0a'};console[_0x5e8b08(0x185)](_0x4948d0['lGsQp']),_0x5910b9?.[_0x5e8b08(0x178)](_0x4948d0['fqIha']),await authenticate(_0xf74878),_0x5910b9?.['trackPhaseEnd'](_0x4948d0[_0x5e8b08(0x179)]),_0x5910b9?.['trackPhaseStart'](_0x5e8b08(0x188));const {path:_0x320da6,installed:_0x3f8e51}=await ensureRangerDir();await _0x4948d0[_0x5e8b08(0x18a)](writeRangerGitignore,_0x320da6);const _0x203257=_0x4948d0['nmLkd'](join,_0x320da6,_0x5e8b08(0x19b));!existsSync(_0x203257)&&await _0x4948d0[_0x5e8b08(0x18f)](mkdir,_0x203257,{'recursive':!![]});_0x5910b9?.['trackPhaseEnd']('dir_setup',{'installed':_0x3f8e51}),_0x5910b9?.['trackPhaseStart']('chromium');let _0x4f6e31=![];_0x475293?.[_0x5e8b08(0x193)]?console['log'](_0x5e8b08(0x18c)):_0x4f6e31=await ensureChromium();_0x5910b9?.[_0x5e8b08(0x173)](_0x5e8b08(0x172),{'installed':_0x4f6e31,'skipped':!!_0x475293?.['skipChromium']}),_0x5910b9?.['trackPhaseStart'](_0x4948d0['MrSmy']);const _0x56b9af=await _0x4948d0[_0x5e8b08(0x18a)](findCiProfile,_0x475293?.[_0x5e8b08(0x190)]);let _0x5734ef=![];_0x475293?.['baseUrl']&&(await _0x4948d0['uFvmS'](mkdir,_0x56b9af['path'],{'recursive':!![]}),await saveSettings(_0x56b9af[_0x5e8b08(0x194)],{'baseUrl':_0x475293['baseUrl'],'headless':!![]}),console['log']('✓\x20Created\x20profile\x20settings:\x20baseUrl='+_0x475293['baseUrl']),_0x5734ef=!![]);const _0xa58306=join(_0x56b9af[_0x5e8b08(0x17a)],_0x4948d0['cPOHu']);if(!existsSync(_0xa58306)&&!_0x5734ef)throw new Error('CI\x20profile\x20\x22'+_0x56b9af[_0x5e8b08(0x194)]+'\x22\x20has\x20no\x20settings.json.\x20Use\x20--base-url\x20to\x20configure\x20it.');const _0x2fd01f=join(_0x56b9af[_0x5e8b08(0x17a)],_0x4948d0[_0x5e8b08(0x199)]),_0x3a1195=join(_0x56b9af[_0x5e8b08(0x17a)],_0x4948d0[_0x5e8b08(0x19d)]),_0x5a13d6=_0x4948d0[_0x5e8b08(0x18a)](existsSync,_0x2fd01f),_0x2a5dd2=existsSync(_0x3a1195);if(_0x2a5dd2)try{const _0x4662d3=await getToken();if(!_0x4662d3)throw new Error(_0x5e8b08(0x17d));const _0x42271c=await _0x4948d0[_0x5e8b08(0x18d)](readFile,_0x3a1195);_0x4948d0['PsTBT'](decrypt,_0x42271c,_0x4662d3),console['log']('✓\x20Encrypted\x20auth\x20verified\x20(will\x20decrypt\x20at\x20runtime)');}catch(_0x1b187c){const _0x1c0f17=_0x1b187c instanceof Error?_0x1b187c['message']:String(_0x1b187c);throw new Error('Failed\x20to\x20verify\x20encrypted\x20auth\x20for\x20profile\x20\x22'+_0x56b9af['name']+'\x22:\x20'+_0x1c0f17);}else _0x5a13d6?console['log'](_0x4948d0['zzSng']):console['log']('\x20\x20No\x20auth\x20state\x20found\x20(app\x20may\x20not\x20require\x20authentication)');await writeActiveProfileName(_0x56b9af[_0x5e8b08(0x194)]),console[_0x5e8b08(0x185)](_0x5e8b08(0x187)+_0x56b9af[_0x5e8b08(0x194)]),_0x5910b9?.['trackPhaseEnd']('profile_activate',{'profileName':_0x56b9af[_0x5e8b08(0x194)],'hasAuth':_0x5a13d6,'hasEncryptedAuth':_0x2a5dd2,'createdSettings':_0x5734ef}),_0x5910b9?.['trackPhaseStart'](_0x5e8b08(0x183));const _0x25be36=await installPluginNonInteractive();_0x5910b9?.['trackPhaseEnd']('plugin',{'installed':_0x25be36}),_0x5910b9?.['trackPhaseStart'](_0x5e8b08(0x174)),await _0x4948d0[_0x5e8b08(0x18a)](skillup,{'autoInstall':'project'}),_0x5910b9?.[_0x5e8b08(0x173)](_0x4948d0['Ekjzk']),console['log'](_0x4948d0['Tuucc']);}
|
|
1
|
+
(function(_0x4efd13,_0x1333ea){const _0x133552=_0x1c16,_0x3da377=_0x4efd13();while(!![]){try{const _0x55b750=-parseInt(_0x133552(0x12a))/0x1+parseInt(_0x133552(0x118))/0x2+-parseInt(_0x133552(0x12f))/0x3*(parseInt(_0x133552(0x129))/0x4)+parseInt(_0x133552(0x105))/0x5*(parseInt(_0x133552(0x127))/0x6)+parseInt(_0x133552(0x11d))/0x7+-parseInt(_0x133552(0x101))/0x8+-parseInt(_0x133552(0x10f))/0x9;if(_0x55b750===_0x1333ea)break;else _0x3da377['push'](_0x3da377['shift']());}catch(_0x21aa16){_0x3da377['push'](_0x3da377['shift']());}}}(_0x22cc,0xb2596));import{mkdir,readFile,readdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{authenticate,ensureRangerDir,ensureChromium,writeRangerGitignore}from'./start.js';function _0x22cc(){const _0x580a42=['filter','14310vQIlPe','plugin','install','No\x20API\x20token\x20available\x20for\x20decryption','ktmGt','SwnyJ','✓\x20Encrypted\x20auth\x20verified\x20(will\x20decrypt\x20at\x20runtime)','Failed\x20to\x20add\x20marketplace:','BLlOJ','path','4347135CnLhou','Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.','length','\x0a✅\x20Ranger\x20CI\x20setup\x20complete!\x0a','trackPhaseStart','No\x20CI\x20profiles\x20found.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','flCje','No\x20CI\x20profiles\x20found\x20in\x20.ranger/ci/.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','error','1947206tgxxRc','vZZHF','You\x20can\x20install\x20manually:\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20project','oTPUj','\x22\x20has\x20no\x20settings.json.\x20Use\x20--base-url\x20to\x20configure\x20it.','8107078SSbSQG','wlkOL','ZCOTV','\x22:\x20','dir_setup','sessions','log','AiiPP','skipChromium','.\x20Use\x20--profile\x20to\x20specify\x20which\x20one.','2520dxcNgn','GXTxR','643172CBpBRs','125107VkKYuY','ZMkAS','✓\x20Marketplace\x20already\x20added','project','rJIaY','15SGmEhx','join','baseUrl','wilrR','Multiple\x20CI\x20profiles\x20found:\x20','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','add','You\x20can\x20install\x20manually:\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','skills','isDirectory','faORS','trackPhaseEnd','noOtp','name','Failed\x20to\x20verify\x20encrypted\x20auth\x20for\x20profile\x20\x22','fRYSe','Installing\x20Claude\x20Code\x20plugin\x20(project\x20level)...','CI\x20profile\x20\x22','HoFKm','9529536iKYjwV','Auto-detected\x20CI\x20profile:\x20','chromium'];_0x22cc=function(){return _0x580a42;};return _0x22cc();}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';async function findCiProfile(_0x2e7d20){const _0x5a6986=_0x1c16,_0x11a86f={'FGvzz':function(_0x38da0e){return _0x38da0e();},'gJksD':function(_0x1ebd56,_0x176cfb,_0x1be13e){return _0x1ebd56(_0x176cfb,_0x1be13e);},'wilrR':function(_0x26b56b,_0x17001a){return _0x26b56b(_0x17001a);},'noOtp':_0x5a6986(0x114)},_0x369d9b=_0x11a86f['FGvzz'](getRangerDir),_0x4a7aad=_0x11a86f['gJksD'](join,_0x369d9b,'ci');if(_0x2e7d20){const _0x3c8ab2=join(_0x4a7aad,_0x2e7d20);return{'name':_0x2e7d20,'path':_0x3c8ab2};}if(!_0x11a86f[_0x5a6986(0x132)](existsSync,_0x4a7aad))throw new Error(_0x11a86f[_0x5a6986(0xfa)]+'Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.');const _0x4cf075=await readdir(_0x4a7aad,{'withFileTypes':!![]}),_0x1e3930=_0x4cf075[_0x5a6986(0x104)](_0x18d8eb=>_0x18d8eb[_0x5a6986(0xf7)]())['map'](_0x1fc710=>_0x1fc710[_0x5a6986(0xfb)]);if(_0x1e3930[_0x5a6986(0x111)]===0x0)throw new Error(_0x5a6986(0x116)+_0x5a6986(0x110));if(_0x1e3930['length']===0x1){const _0x4b56c4=_0x1e3930[0x0];return console[_0x5a6986(0x123)](_0x5a6986(0x102)+_0x4b56c4),{'name':_0x4b56c4,'path':_0x11a86f['gJksD'](join,_0x4a7aad,_0x4b56c4)};}throw new Error(_0x5a6986(0x133)+_0x1e3930[_0x5a6986(0x130)](',\x20')+_0x5a6986(0x126));}function _0x1c16(_0xbb27f8,_0xc46af7){_0xbb27f8=_0xbb27f8-0xf7;const _0x22cc98=_0x22cc();let _0x1c1665=_0x22cc98[_0xbb27f8];return _0x1c1665;}async function installPluginNonInteractive(){const _0x301713=_0x1c16,_0x3266e4={'GXTxR':function(_0x2c5218,_0x53ff47){return _0x2c5218(_0x53ff47);},'BkAxz':function(_0x143aa6,_0x3403b4){return _0x143aa6(_0x3403b4);},'NGnwt':_0x301713(0x12c),'NIAki':'ranger-testing/trailhead','ZCOTV':_0x301713(0x136),'faORS':_0x301713(0x107),'JhCPD':'--scope','fRYSe':_0x301713(0x12d),'yVwKa':_0x301713(0x11a),'wlkOL':'✓\x20Claude\x20Code\x20plugin\x20installed'},_0x3a56d5=await _0x3266e4['GXTxR'](isPluginInstalled,'ranger@trailhead');if(_0x3a56d5)return console['log'](_0x301713(0x134)),![];console['log'](_0x301713(0xfe));const _0x3b58b0=await _0x3266e4['BkAxz'](isMarketplaceAdded,'trailhead');let _0x54a7f5=_0x3b58b0;if(_0x3b58b0)console['log'](_0x3266e4['NGnwt']);else{const _0x569b5b=await _0x3266e4[_0x301713(0x128)](runClaudeCommand,['plugin','marketplace',_0x301713(0x135),_0x3266e4['NIAki']]);!_0x569b5b['success']?(console['error'](_0x301713(0x10c),_0x569b5b[_0x301713(0x117)]),console['log'](_0x3266e4[_0x301713(0x11f)])):_0x54a7f5=!![];}if(_0x54a7f5){const _0x484f70=await runClaudeCommand(['plugin',_0x3266e4[_0x301713(0xf8)],'ranger@trailhead',_0x3266e4['JhCPD'],_0x3266e4[_0x301713(0xfd)]]);!_0x484f70['success']?(console[_0x301713(0x117)]('Failed\x20to\x20install\x20plugin:',_0x484f70['error']),console['log'](_0x3266e4['yVwKa'])):console[_0x301713(0x123)](_0x3266e4[_0x301713(0x11e)]);}return!![];}export async function setupCi(_0x19fec1,_0x192c71,_0xa795b0){const _0xecb60d=_0x1c16,_0x132717={'flCje':'auth','AiiPP':function(_0x93168d,_0x21d028,_0x258662){return _0x93168d(_0x21d028,_0x258662);},'rJIaY':_0xecb60d(0x122),'LDqxv':function(_0x2f69d4,_0x4af0f7,_0x5621fe){return _0x2f69d4(_0x4af0f7,_0x5621fe);},'ZMkAS':_0xecb60d(0x103),'KeBAn':'✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','biunz':function(_0x17fac9){return _0x17fac9();},'GxHmi':'settings.json','ktmGt':function(_0x5a9886,_0xef7316,_0x4a4ff5){return _0x5a9886(_0xef7316,_0x4a4ff5);},'vxaak':'auth.json','ZKZQi':function(_0x258694,_0x46860f,_0x28f2b9){return _0x258694(_0x46860f,_0x28f2b9);},'SwnyJ':'auth.json.enc','BLlOJ':function(_0x332e40,_0x3ca99b){return _0x332e40(_0x3ca99b);},'HoFKm':function(_0x40b9e5,_0x5484a8){return _0x40b9e5 instanceof _0x5484a8;},'dPjUr':'✓\x20Auth\x20state\x20found','rQJQf':'\x20\x20No\x20auth\x20state\x20found\x20(app\x20may\x20not\x20require\x20authentication)','HnsLn':function(_0x54b669,_0xfc130e){return _0x54b669(_0xfc130e);},'fOfgu':'profile_activate','mVAAQ':_0xecb60d(0x106),'tCFgq':'skills','oTPUj':function(_0x3332eb,_0x3b42f0){return _0x3332eb(_0x3b42f0);},'vZZHF':_0xecb60d(0x12d)};console['log']('\x0a🔧\x20Ranger\x20CI\x20Setup\x0a'),_0xa795b0?.[_0xecb60d(0x113)](_0x132717[_0xecb60d(0x115)]),await authenticate(_0x19fec1),_0xa795b0?.[_0xecb60d(0xf9)]('auth'),_0xa795b0?.[_0xecb60d(0x113)](_0xecb60d(0x121));const {path:_0x4f38b5,installed:_0x4f1479}=await ensureRangerDir();await writeRangerGitignore(_0x4f38b5);const _0x2ba13e=_0x132717['AiiPP'](join,_0x4f38b5,_0x132717[_0xecb60d(0x12e)]);!existsSync(_0x2ba13e)&&await _0x132717['LDqxv'](mkdir,_0x2ba13e,{'recursive':!![]});_0xa795b0?.['trackPhaseEnd']('dir_setup',{'installed':_0x4f1479}),_0xa795b0?.[_0xecb60d(0x113)](_0x132717[_0xecb60d(0x12b)]);let _0x4b3371=![];_0x192c71?.[_0xecb60d(0x125)]?console[_0xecb60d(0x123)](_0x132717['KeBAn']):_0x4b3371=await _0x132717['biunz'](ensureChromium);_0xa795b0?.[_0xecb60d(0xf9)](_0x132717['ZMkAS'],{'installed':_0x4b3371,'skipped':!!_0x192c71?.['skipChromium']}),_0xa795b0?.[_0xecb60d(0x113)]('profile_activate');const _0x335e80=await findCiProfile(_0x192c71?.['profile']);let _0x2327b7=![];_0x192c71?.[_0xecb60d(0x131)]&&(await mkdir(_0x335e80['path'],{'recursive':!![]}),await saveSettings(_0x335e80[_0xecb60d(0xfb)],{'baseUrl':_0x192c71[_0xecb60d(0x131)],'headless':!![]}),console['log']('✓\x20Created\x20profile\x20settings:\x20baseUrl='+_0x192c71[_0xecb60d(0x131)]),_0x2327b7=!![]);const _0x3aa928=_0x132717[_0xecb60d(0x124)](join,_0x335e80[_0xecb60d(0x10e)],_0x132717['GxHmi']);if(!existsSync(_0x3aa928)&&!_0x2327b7)throw new Error(_0xecb60d(0xff)+_0x335e80[_0xecb60d(0xfb)]+_0xecb60d(0x11c));const _0x3ab628=_0x132717[_0xecb60d(0x109)](join,_0x335e80['path'],_0x132717['vxaak']),_0x30b889=_0x132717['ZKZQi'](join,_0x335e80['path'],_0x132717[_0xecb60d(0x10a)]),_0x478539=_0x132717[_0xecb60d(0x10d)](existsSync,_0x3ab628),_0x2f6943=_0x132717[_0xecb60d(0x10d)](existsSync,_0x30b889);if(_0x2f6943)try{const _0x45efa0=await _0x132717['biunz'](getToken);if(!_0x45efa0)throw new Error(_0xecb60d(0x108));const _0xbf55d3=await _0x132717[_0xecb60d(0x10d)](readFile,_0x30b889);decrypt(_0xbf55d3,_0x45efa0),console[_0xecb60d(0x123)](_0xecb60d(0x10b));}catch(_0x1fe2d9){const _0x176918=_0x132717[_0xecb60d(0x100)](_0x1fe2d9,Error)?_0x1fe2d9['message']:_0x132717['BLlOJ'](String,_0x1fe2d9);throw new Error(_0xecb60d(0xfc)+_0x335e80[_0xecb60d(0xfb)]+_0xecb60d(0x120)+_0x176918);}else _0x478539?console['log'](_0x132717['dPjUr']):console['log'](_0x132717['rQJQf']);await _0x132717['HnsLn'](writeActiveProfileName,_0x335e80[_0xecb60d(0xfb)]),console[_0xecb60d(0x123)]('✓\x20Active\x20profile:\x20'+_0x335e80[_0xecb60d(0xfb)]),_0xa795b0?.['trackPhaseEnd'](_0x132717['fOfgu'],{'profileName':_0x335e80[_0xecb60d(0xfb)],'hasAuth':_0x478539,'hasEncryptedAuth':_0x2f6943,'createdSettings':_0x2327b7}),_0xa795b0?.[_0xecb60d(0x113)](_0x132717['mVAAQ']);const _0x58ff06=await _0x132717['biunz'](installPluginNonInteractive);_0xa795b0?.[_0xecb60d(0xf9)]('plugin',{'installed':_0x58ff06}),_0xa795b0?.[_0xecb60d(0x113)](_0x132717['tCFgq']),await _0x132717[_0xecb60d(0x11b)](skillup,{'autoInstall':_0x132717[_0xecb60d(0x119)]}),_0xa795b0?.[_0xecb60d(0xf9)](_0xecb60d(0x137)),console['log'](_0xecb60d(0x112));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4106b6,_0x12779b){const _0x2abbd2=_0x368f,_0x2d0e62=_0x4106b6();while(!![]){try{const _0x2c776c=-parseInt(_0x2abbd2(0x207))/0x1+-parseInt(_0x2abbd2(0x1fb))/0x2+parseInt(_0x2abbd2(0x219))/0x3*(parseInt(_0x2abbd2(0x1fc))/0x4)+-parseInt(_0x2abbd2(0x1f4))/0x5+-parseInt(_0x2abbd2(0x203))/0x6+-parseInt(_0x2abbd2(0x20f))/0x7+parseInt(_0x2abbd2(0x208))/0x8;if(_0x2c776c===_0x12779b)break;else _0x2d0e62['push'](_0x2d0e62['shift']());}catch(_0x1236ae){_0x2d0e62['push'](_0x2d0e62['shift']());}}}(_0x4a56,0xf0bbb));import{basename}from'path';import _0x377e28 from'inquirer';import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';function _0x4a56(){const _0x3e7d21=['2453472fkgPZt','\x20\x202.\x20Run:\x20ranger\x20setup','list','/.opencode/skills/','723923mhufLl','43550240BPNucr','\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a','\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','\x20\x203.\x20Run:\x20ranger\x20skillup','To\x20get\x20started:','project','log','9065035dBnZfY','\x20<your-api-token>','ranger','✓\x20Found\x20API\x20token','project-level','rEesH','installLevel','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','JTHJL','VTsRs','24771zNMidS','HwkAx','GGqXL','\x20skill','This\x20project\x20only\x20(','\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','\x20successfully!\x0a','uAiyY','5|0|2|1|3|4','8177600SNwTBf','KsFRW','/skills/','faeAZ','eFRbY','split','user','805268nocjdE','4CwygZJ','kIpsI','jzURm','\x20--opencode','\x0a✅\x20Installed\x20','claude','opencode'];_0x4a56=function(){return _0x3e7d21;};return _0x4a56();}import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';function _0x368f(_0x1310f5,_0x3e10ce){_0x1310f5=_0x1310f5-0x1f0;const _0x4a5647=_0x4a56();let _0x368fb7=_0x4a5647[_0x1310f5];return _0x368fb7;}export async function skillup(_0x44c8b2={}){const _0x226c46=_0x368f,_0x5eae8f={'dZubF':'\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','eFRbY':function(_0x52047d){return _0x52047d();},'hUjUS':_0x226c46(0x1f3),'WTLia':_0x226c46(0x212),'GGqXL':function(_0x3d4244,_0x59bd28){return _0x3d4244(_0x59bd28);},'Pexcv':function(_0x4c6f36,_0x5cd975){return _0x4c6f36(_0x5cd975);},'DsSdR':_0x226c46(0x1fa),'uAiyY':function(_0x563315){return _0x563315();},'HwkAx':_0x226c46(0x202),'VTsRs':_0x226c46(0x205),'kIpsI':_0x226c46(0x215),'jzURm':'Where\x20should\x20skills\x20be\x20installed?','JTHJL':_0x226c46(0x20d),'qnDQR':function(_0x1608f3){return _0x1608f3();},'KsFRW':'\x0a📦\x20Installing\x20skills...\x0a','faeAZ':function(_0x39b106,_0x501ff4){return _0x39b106===_0x501ff4;},'rEesH':'user-level','cCnWB':_0x226c46(0x213)};console['log'](_0x5eae8f['dZubF']);const _0x52877d=_0x44c8b2['platform']??_0x226c46(0x201),_0x24b43e=await _0x5eae8f['eFRbY'](getToken);if(!_0x24b43e){const _0x5c11f8=_0x5eae8f['hUjUS'][_0x226c46(0x1f9)]('|');let _0x1641c9=0x0;while(!![]){switch(_0x5c11f8[_0x1641c9++]){case'0':console[_0x226c46(0x20e)](_0x226c46(0x20c));continue;case'1':console['log'](_0x226c46(0x204)+(_0x52877d===_0x226c46(0x202)?_0x226c46(0x1ff):'')+_0x226c46(0x210));continue;case'2':console['log']('\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli');continue;case'3':console[_0x226c46(0x20e)](_0x226c46(0x20b)+(_0x52877d==='opencode'?'\x20--opencode':'')+'\x0a');continue;case'4':return;case'5':console[_0x226c46(0x20e)](_0x226c46(0x216));continue;}break;}}console[_0x226c46(0x20e)](_0x5eae8f['WTLia']);const _0x559444=_0x5eae8f[_0x226c46(0x1f8)](getProjectRoot),_0x191192=_0x5eae8f[_0x226c46(0x21b)](basename,_0x559444),_0x2db6f2=_0x52877d===_0x226c46(0x202)?_0x5eae8f['Pexcv'](getOpencodeConfigDir,_0x5eae8f['DsSdR'])+_0x226c46(0x1f6):_0x5eae8f[_0x226c46(0x1f2)](getClaudeConfigDir)+'/skills/',_0x2a03c2=_0x52877d===_0x5eae8f[_0x226c46(0x21a)]?_0x559444+_0x226c46(0x206):_0x559444+'/.claude/skills/',_0x49a11f=process['stdin']['isTTY']&&process['stdout']['isTTY'];let _0xdfe20f;if(_0x44c8b2['autoInstall'])_0xdfe20f=_0x44c8b2['autoInstall'];else{if(_0x49a11f){const _0x52ad97=await _0x377e28['prompt']([{'type':_0x5eae8f[_0x226c46(0x218)],'name':_0x5eae8f[_0x226c46(0x1fd)],'message':_0x5eae8f[_0x226c46(0x1fe)],'choices':[{'name':'All\x20projects\x20('+_0x2db6f2+')','value':_0x226c46(0x1fa)},{'name':_0x226c46(0x21d)+_0x2a03c2+')','value':_0x226c46(0x20d)}]}]);_0xdfe20f=_0x52ad97['installLevel'];}else _0xdfe20f=_0x5eae8f[_0x226c46(0x217)],console[_0x226c46(0x20e)]('Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20('+_0x2a03c2+')');}let _0x2fcf35=0x0;const _0x295783=_0x5eae8f['qnDQR'](getCurrentVersion);console['log'](_0x5eae8f[_0x226c46(0x1f5)]);try{const _0x4f575d=await installSkill(_0x226c46(0x211),{'cliVersion':_0x295783,'level':_0xdfe20f,'platform':_0x52877d});_0x4f575d&&_0x2fcf35++;}catch(_0xb2dce3){console['warn'](_0x226c46(0x20a),_0xb2dce3 instanceof Error?_0xb2dce3['message']:_0xb2dce3);}if(_0x2fcf35>0x0){const _0x54ebd3=_0x5eae8f[_0x226c46(0x1f7)](_0xdfe20f,_0x226c46(0x1fa))?_0x5eae8f[_0x226c46(0x214)]:_0x5eae8f['cCnWB'];console['log'](_0x226c46(0x200)+_0x2fcf35+'\x20'+_0x54ebd3+_0x226c46(0x21c)+(_0x2fcf35>0x1?'s':'')+_0x226c46(0x1f1)),!_0x44c8b2['suppressUsage']&&(console['log']('To\x20use:'),_0x52877d===_0x226c46(0x202)?console[_0x226c46(0x20e)](_0x226c46(0x1f0)):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['log'](_0x226c46(0x209));}
|
package/build/commands/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x640448=_0x2773;(function(_0x4f4ee0,_0x324858){const _0x2aeb35=_0x2773,_0x1d08e4=_0x4f4ee0();while(!![]){try{const _0x14a066=parseInt(_0x2aeb35(0x17f))/0x1+-parseInt(_0x2aeb35(0x190))/0x2*(-parseInt(_0x2aeb35(0x162))/0x3)+-parseInt(_0x2aeb35(0x17c))/0x4+-parseInt(_0x2aeb35(0x19d))/0x5+-parseInt(_0x2aeb35(0x1aa))/0x6+parseInt(_0x2aeb35(0x181))/0x7+parseInt(_0x2aeb35(0x1b2))/0x8*(parseInt(_0x2aeb35(0x189))/0x9);if(_0x14a066===_0x324858)break;else _0x1d08e4['push'](_0x1d08e4['shift']());}catch(_0x3d0b52){_0x1d08e4['push'](_0x1d08e4['shift']());}}}(_0x21db,0x1c06c));import{mkdir,writeFile}from'fs/promises';function _0x2773(_0x395a92,_0x4c9459){_0x395a92=_0x395a92-0x14a;const _0x21db5b=_0x21db();let _0x2773c6=_0x21db5b[_0x395a92];return _0x2773c6;}import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x49e381 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';function _0x21db(){const _0x547098=['vbUyC','XfFYO','\x1b[0m','\x20(fallback\x20version)','XvShz','oASFQ','120CgPxmN','No\x20git\x20repository\x20found\x20for\x20--scope\x20project.\x20Re-run\x20without\x20`--scope\x20project`\x20to\x20install\x20at\x20user\x20scope.','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','message','✓\x20Created\x20','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','DPQUv','\x20and\x20prompt\x20the\x20coding','gHyRn','success','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','allowInsecureLocalhost','✓\x20Exported\x20credentials\x20for\x20CI','auth','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','\x20\x20(or\x20use\x20','skipped','ranger','confirm','error','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','Authentication\x20failed:\x20','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','resolve','qgNvg',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','\x20\x20npx\x20playwright@','close','chromium','platform','log','stdin','profile','84834ndDlxS','withDeps','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','koilT','coePI','/ranger:enable','QEjtB','GITHUB_ENV','DioGy','local','Ykpuc','ranger\x20profile\x20add','prompt','plugin','hlQya','skipChromium','1.58.2','url','organizationName','\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','DlKhs','scope','stdout','OkjSJ','playwright@','trackPhaseError','480324binNjY','trackPhaseEnd','qFPnJ','118897ypIAFq','executablePath','502299bkMhFA','\x1b[1m','skills','ready','Hjdfe','RANGER_TEST_USERNAME','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','DZrhO','81063gpwhkf','skipAuth','diaDD','trackPhaseStart','✓\x20Created\x20.ranger/.gitignore','.ranger/','user','14OtvETL','zbSME','.ranger','install','\x0a🚀\x20Ranger\x20Setup\x0a','LqTYB','Validating\x20API\x20token...','...','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','.gitignore','✓\x20Authenticated\x20to\x20','\x20for\x20explicit\x20profile\x20management).','You\x20can\x20install\x20it\x20manually\x20by\x20running:','364695mDXtzR','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','npx','git_check','PnXGy','FiScT','✓\x20Stored\x20credentials\x20locally','env','device_auth','win32','No\x20git\x20repository\x20found','\x0a⚠\x20Skipping\x20Chromium\x20installation.','nctOm','1295334sUnzUZ','force'];_0x21db=function(){return _0x547098;};return _0x21db();}import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerDir,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=_0x640448(0x172);const bold=_0x53dae0=>_0x640448(0x182)+_0x53dae0+_0x640448(0x1ae);export function getPlaywrightVersion(){const _0x46fd49=_0x640448;try{const _0x36089f=require[_0x46fd49(0x158)]('playwright/package.json'),_0x23df58=require(_0x36089f);return _0x23df58['version'];}catch{return null;}}export function installChromiumBinary(_0x2ed2e5,_0x18ecf3=![]){const _0x36a7ec=_0x640448,_0x1528f9={'UpVOx':function(_0xe38201,_0x314cf0){return _0xe38201(_0x314cf0);},'DEVog':_0x36a7ec(0x193),'tuADn':'ignore','Hjdfe':'inherit','ovWYW':_0x36a7ec(0x15c)};return new Promise((_0x117718,_0x5a452f)=>{const _0x15c92d=_0x36a7ec,_0x2cab9a={'DLgHK':function(_0x55f48e,_0x1a847d){return _0x1528f9['UpVOx'](_0x55f48e,_0x1a847d);}},_0xe24d40=[_0x15c92d(0x17a)+_0x2ed2e5,_0x1528f9['DEVog'],..._0x18ecf3?['--with-deps']:[],_0x15c92d(0x15d)],_0xd3aff8=spawn(_0x15c92d(0x19f),_0xe24d40,{'stdio':[_0x1528f9['tuADn'],_0x1528f9['Hjdfe'],_0x1528f9[_0x15c92d(0x185)]],'shell':process[_0x15c92d(0x15e)]===_0x15c92d(0x1a6)});_0xd3aff8['on'](_0x1528f9['ovWYW'],_0x5afa43=>{_0x5afa43===0x0?_0x117718():_0x2cab9a['DLgHK'](_0x5a452f,new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x5afa43));}),_0xd3aff8['on']('error',_0x3fea65=>{_0x5a452f(_0x3fea65);});});}export async function authenticate(_0x3c7525){const _0x3d60f4=_0x640448,_0x4c3fd7={'XfFYO':function(_0x5cce63){return _0x5cce63();},'qFPnJ':function(_0x31695c){return _0x31695c();},'PnXGy':function(_0x1650e1,_0x144eb6){return _0x1650e1 instanceof _0x144eb6;},'koilT':function(_0x40b6e4,_0x3a6ab7){return _0x40b6e4(_0x3a6ab7);},'XKUdT':_0x3d60f4(0x14c)};if(!_0x3c7525){const _0x112d61=await _0x4c3fd7[_0x3d60f4(0x1ad)](getToken);if(_0x112d61){const _0x5bcf92=await getCurrentUser(_0x112d61);if(_0x5bcf92[_0x3d60f4(0x1bb)])return console[_0x3d60f4(0x15f)]('✓\x20Already\x20authenticated\x20to\x20'+_0x5bcf92['user']['organizationName']),{'token':_0x112d61,'method':'existing_token'};}try{_0x3c7525=await _0x4c3fd7[_0x3d60f4(0x17e)](runDeviceAuthFlow);}catch(_0x176567){throw new Error(_0x3d60f4(0x155)+(_0x4c3fd7[_0x3d60f4(0x1a1)](_0x176567,Error)?_0x176567['message']:_0x176567));}const _0x5910df=await getCurrentUser(_0x3c7525);if(!_0x5910df[_0x3d60f4(0x1bb)])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x5910df[_0x3d60f4(0x153)]);return console[_0x3d60f4(0x15f)]('✓\x20Authenticated\x20to\x20'+_0x5910df['user'][_0x3d60f4(0x174)]),{'token':_0x3c7525,'method':_0x3d60f4(0x1a5)};}console[_0x3d60f4(0x15f)](_0x3d60f4(0x196));const _0x422c39=await getCurrentUser(_0x3c7525);if(!_0x422c39[_0x3d60f4(0x1bb)]){if(_0x422c39['status'])throw new Error(_0x3d60f4(0x155)+_0x422c39[_0x3d60f4(0x153)]+_0x3d60f4(0x187));else throw new Error(_0x3d60f4(0x198)+_0x422c39['error']+_0x3d60f4(0x164));}return console[_0x3d60f4(0x15f)](_0x3d60f4(0x19a)+_0x422c39['user'][_0x3d60f4(0x174)]),await _0x4c3fd7[_0x3d60f4(0x165)](storeToken,_0x3c7525),console['log'](process[_0x3d60f4(0x1a4)][_0x3d60f4(0x169)]?_0x4c3fd7['XKUdT']:_0x3d60f4(0x1a3)),{'token':_0x3c7525,'method':'provided_token'};}export async function ensureRangerDir(_0x29c8c1){const _0x4925e7=_0x640448,_0xbda11b={'WYwLf':function(_0x42df84,_0x5aa695){return _0x42df84===_0x5aa695;},'NSQWh':_0x4925e7(0x18e),'uUXwZ':_0x4925e7(0x18f),'tGyVZ':function(_0x38d654,_0x27e02b,_0x2df94b){return _0x38d654(_0x27e02b,_0x2df94b);}};let _0x44a53c;const _0x32e736=_0xbda11b['WYwLf'](_0x29c8c1,'user')?'~/.ranger/':_0xbda11b['NSQWh'];if(_0x29c8c1===_0xbda11b['uUXwZ'])_0x44a53c=getRangerHomeDir();else{const _0x10afa7=findGitRoot();_0x44a53c=_0x10afa7?_0xbda11b['tGyVZ'](join,_0x10afa7,_0x4925e7(0x192)):getRangerDir();}return!existsSync(_0x44a53c)?(await mkdir(_0x44a53c,{'recursive':!![]}),console['log'](_0x4925e7(0x1b6)+_0x32e736+'\x20directory'),{'path':_0x44a53c,'installed':!![]}):(console['log']('✓\x20'+_0x32e736+'\x20directory\x20already\x20exists'),{'path':_0x44a53c,'installed':![]});}export async function ensureChromium(_0x157e2e=![]){const _0x2a0efc=_0x640448,_0xc9a2b7={'xhSyJ':'✓\x20Playwright\x20Chromium\x20browser\x20found','gHyRn':function(_0x3cd4c6,_0x6d801a){return _0x3cd4c6??_0x6d801a;},'aSbzM':_0x2a0efc(0x1af),'McIxO':function(_0x1524ae,_0x146ee6,_0x51daeb){return _0x1524ae(_0x146ee6,_0x51daeb);}};let _0x489b02=![];try{const _0x5b7e26=chromium[_0x2a0efc(0x180)]();_0x489b02=existsSync(_0x5b7e26);}catch{_0x489b02=![];}if(_0x489b02)return console[_0x2a0efc(0x15f)](_0xc9a2b7['xhSyJ']),![];const _0x3f9f48=getPlaywrightVersion(),_0x525d16=_0xc9a2b7[_0x2a0efc(0x1ba)](_0x3f9f48,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x43e619=!_0x3f9f48,_0x47ef84=process[_0x2a0efc(0x160)]['isTTY']&&process[_0x2a0efc(0x178)]['isTTY'];let _0xd905e8=!![];if(_0x47ef84){const {install:_0x1783bb}=await _0x49e381[_0x2a0efc(0x16e)]([{'type':_0x2a0efc(0x152),'name':'install','message':_0x43e619?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x525d16+'\x20now?':'The\x20required\x20version\x20('+_0x525d16+_0x2a0efc(0x15a),'default':!![]}]);_0xd905e8=_0x1783bb;}else console[_0x2a0efc(0x15f)](_0x2a0efc(0x14e)+_0x525d16+(_0x43e619?_0xc9a2b7['aSbzM']:'')+_0x2a0efc(0x197));if(_0xd905e8){console['log']('\x0aInstalling\x20Chromium\x20browser...\x0a');try{await _0xc9a2b7['McIxO'](installChromiumBinary,_0x525d16,_0x157e2e),console['log']('\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully');}catch(_0x41c6f1){console[_0x2a0efc(0x153)]('\x0a❌\x20Failed\x20to\x20install\x20Chromium:',_0x41c6f1 instanceof Error?_0x41c6f1[_0x2a0efc(0x1b5)]:_0x41c6f1),console[_0x2a0efc(0x15f)](_0x2a0efc(0x19c)),console['log']('\x20\x20npx\x20playwright@'+_0x525d16+'\x20install\x20chromium');}}else console[_0x2a0efc(0x15f)](_0x2a0efc(0x1a8)),console[_0x2a0efc(0x15f)](_0x2a0efc(0x1b7)),console['log'](_0x2a0efc(0x15b)+_0x525d16+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x3853e3){const _0x4af62c=_0x640448,_0x44236e={'QsVwL':function(_0xa704a5,_0x2d08e3,_0x525ca0){return _0xa704a5(_0x2d08e3,_0x525ca0);}},_0x59501c=_0x44236e['QsVwL'](join,_0x3853e3,_0x4af62c(0x199)),_0x2734e9=_0x4af62c(0x175);await writeFile(_0x59501c,_0x2734e9),console['log'](_0x4af62c(0x18d));}export async function ensureLocalEnv(_0x579600,_0x4163f2){const _0x14e5e1=_0x640448,_0x579e2d={'eyzBi':function(_0x356603){return _0x356603();},'qkmur':function(_0x5de62c,_0x367902){return _0x5de62c!==_0x367902;},'QEjtB':'user','XvShz':_0x14e5e1(0x157),'DioGy':function(_0x258576,_0x4ec3d5){return _0x258576===_0x4ec3d5;},'vbUyC':_0x14e5e1(0x16b),'oPnOj':'✓\x20Local\x20profile\x20already\x20exists'};if(!_0x579e2d['eyzBi'](findGitRoot)&&_0x579e2d['qkmur'](_0x579600?.['scope'],_0x579e2d[_0x14e5e1(0x168)]))return console[_0x14e5e1(0x15f)](_0x579e2d[_0x14e5e1(0x1b0)]),{'ready':![],'skipped':!![]};const _0x425c36=_0x579e2d[_0x14e5e1(0x16a)](_0x579600?.['scope'],_0x579e2d['QEjtB'])?getRangerHomeDir():undefined;if(findExistingEnv(_0x579e2d[_0x14e5e1(0x1ac)],{'locations':[_0x579e2d['vbUyC']],'rangerDir':_0x425c36}))return console[_0x14e5e1(0x15f)](_0x579e2d['oPnOj']),{'ready':!![],'skipped':![]};try{return await addEnv('local',{'url':_0x579600?.[_0x14e5e1(0x173)],'force':_0x579600?.[_0x14e5e1(0x1ab)],'allowInsecureLocalhost':_0x579600?.['allowInsecureLocalhost'],'scope':_0x579600?.[_0x14e5e1(0x177)]},_0x4163f2),{'ready':!![],'skipped':![]};}catch(_0x1035cd){return console[_0x14e5e1(0x153)]('\x0a❌\x20Profile\x20setup\x20failed:',_0x1035cd instanceof Error?_0x1035cd['message']:_0x1035cd),{'ready':![],'skipped':![]};}}export async function start(_0x49dca3,_0x139fb9,_0x326e56){const _0x17330e=_0x640448,_0x21353a={'LqTYB':'user','nctOm':function(_0x5f43af){return _0x5f43af();},'qgNvg':_0x17330e(0x1a0),'xKPRC':_0x17330e(0x1a7),'FiScT':_0x17330e(0x1b3),'OkjSJ':function(_0x4f7ebc,_0x39db17){return _0x4f7ebc(_0x39db17);},'DlKhs':'✓\x20Skipping\x20authentication\x20(--skip-auth)','coePI':_0x17330e(0x14d),'oASFQ':'chromium','hlQya':'\x0a✅\x20Ranger\x20setup\x20complete!\x0a','zsXTF':_0x17330e(0x16f),'Ykpuc':_0x17330e(0x183),'HnBUW':function(_0x350f75,_0x5a99ab,_0x4c0482){return _0x350f75(_0x5a99ab,_0x4c0482);},'mjgpk':_0x17330e(0x151),'TOMVt':function(_0x2007b9){return _0x2007b9();},'jzAHS':function(_0x3d1f97,_0x9ba2ed){return _0x3d1f97 instanceof _0x9ba2ed;},'DZrhO':function(_0x2f7ff6,_0x1d6ac9){return _0x2f7ff6(_0x1d6ac9);},'zbSME':_0x17330e(0x186),'DPQUv':_0x17330e(0x1b4),'hWThB':function(_0x4cf20d,_0x3dc3b6){return _0x4cf20d(_0x3dc3b6);},'OFNhj':_0x17330e(0x167),'diaDD':function(_0x1d856c,_0x566fd1){return _0x1d856c+_0x566fd1;}};console['log'](_0x17330e(0x194));const _0x1ba01d=process['stdin']['isTTY']&&process['stdout']['isTTY'];!_0x139fb9?.['scope']&&(_0x139fb9={..._0x139fb9,'scope':_0x21353a[_0x17330e(0x195)]});const _0xa462c4=_0x139fb9?.['scope']==='user';_0x326e56?.['trackPhaseStart']('git_check');if(!_0xa462c4&&!_0x21353a[_0x17330e(0x1a9)](findGitRoot)){await _0x326e56?.[_0x17330e(0x17b)](_0x21353a['qgNvg'],new Error(_0x21353a['xKPRC']));throw new Error(_0x21353a[_0x17330e(0x1a2)]);}_0x326e56?.[_0x17330e(0x17d)](_0x21353a[_0x17330e(0x159)]);const _0x580854=_0xa462c4?!_0x21353a['OkjSJ'](existsSync,getRangerHomeDir()):!_0x21353a[_0x17330e(0x179)](existsSync,_0x21353a['nctOm'](getRangerDir)),{path:_0x21ec29}=await ensureRangerDir(_0xa462c4?_0x21353a[_0x17330e(0x195)]:undefined);if(_0x139fb9?.['skipAuth'])console[_0x17330e(0x15f)](_0x21353a[_0x17330e(0x176)]),_0x326e56?.[_0x17330e(0x17d)](_0x21353a[_0x17330e(0x166)],{'isFirstRun':_0x580854,'method':_0x17330e(0x150)});else{_0x326e56?.[_0x17330e(0x18c)](_0x17330e(0x14d));const _0x459cd9=await authenticate(_0x49dca3);_0x326e56?.[_0x17330e(0x17d)]('auth',{'isFirstRun':_0x580854,'method':_0x459cd9['method']});}_0x326e56?.[_0x17330e(0x18c)](_0x21353a[_0x17330e(0x1b1)]);_0x139fb9?.[_0x17330e(0x171)]?console[_0x17330e(0x15f)]('✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)'):await _0x21353a[_0x17330e(0x179)](ensureChromium,_0x139fb9?.[_0x17330e(0x163)]);_0x326e56?.['trackPhaseEnd'](_0x21353a['oASFQ'],{'isFirstRun':_0x580854,'skipped':!!_0x139fb9?.[_0x17330e(0x171)]});!_0xa462c4&&await writeRangerGitignore(_0x21ec29);console[_0x17330e(0x15f)](_0x21353a[_0x17330e(0x170)]);const _0x4249b2=_0x139fb9?.['scope'],_0x18587b=_0x139fb9?.['opencode']??![];let _0x51cdba=null;_0x18587b?(_0x326e56?.['trackPhaseStart'](_0x21353a['zsXTF']),_0x51cdba=await ensureOpencodePluginConfig(_0x4249b2),_0x326e56?.[_0x17330e(0x17d)]('plugin',{'isFirstRun':_0x580854,'opencode':!![]})):(_0x326e56?.['trackPhaseStart'](_0x17330e(0x16f)),await ensureClaudePlugin(_0x4249b2),_0x326e56?.['trackPhaseEnd'](_0x17330e(0x16f),{'isFirstRun':_0x580854}));if(_0x18587b&&_0x51cdba){_0x326e56?.['trackPhaseStart'](_0x21353a['Ykpuc']);try{await _0x21353a['HnBUW'](installSkill,_0x21353a['mjgpk'],{'level':_0x51cdba[_0x17330e(0x177)],'cliVersion':_0x21353a['TOMVt'](getCurrentVersion),'platform':'opencode'}),_0x326e56?.[_0x17330e(0x17d)](_0x17330e(0x183),{'isFirstRun':_0x580854,'opencode':!![]});}catch(_0x45aac1){console['warn'](_0x17330e(0x156),_0x21353a['jzAHS'](_0x45aac1,Error)?_0x45aac1['message']:_0x45aac1),_0x326e56?.[_0x17330e(0x17d)](_0x17330e(0x183),{'isFirstRun':_0x580854,'opencode':!![],'failed':!![]});}}else _0x326e56?.[_0x17330e(0x18c)](_0x21353a['Ykpuc']),await ensureClaudeSkills(_0x4249b2),_0x326e56?.[_0x17330e(0x17d)](_0x21353a[_0x17330e(0x16c)],{'isFirstRun':_0x580854});if(_0x139fb9?.[_0x17330e(0x18a)])console[_0x17330e(0x15f)](_0x17330e(0x14a));else{if(_0x139fb9?.[_0x17330e(0x173)]){_0x326e56?.[_0x17330e(0x18c)](_0x17330e(0x161));const _0x543a2d=await ensureLocalEnv({'url':_0x139fb9[_0x17330e(0x173)],'force':_0x139fb9?.[_0x17330e(0x1ab)],'allowInsecureLocalhost':_0x139fb9?.[_0x17330e(0x14b)],'scope':_0x139fb9?.['scope']==='user'?_0x21353a['LqTYB']:undefined},_0x326e56);_0x326e56?.['trackPhaseEnd'](_0x17330e(0x161),{'isFirstRun':_0x580854,'profileReady':_0x543a2d[_0x17330e(0x184)],'userSkipped':_0x543a2d['skipped']});}else console[_0x17330e(0x15f)]('\x0aTo\x20verify\x20with\x20a\x20browser:\x20set\x20'+_0x21353a[_0x17330e(0x188)](bold,_0x21353a[_0x17330e(0x191)])+'\x20and\x20'+_0x21353a['OkjSJ'](bold,'RANGER_TEST_PASSWORD')),console[_0x17330e(0x15f)](_0x17330e(0x14f)+_0x21353a['OkjSJ'](bold,_0x17330e(0x16d))+_0x17330e(0x19b));}if(_0x18587b)console['log'](_0x21353a[_0x17330e(0x1b8)]),console[_0x17330e(0x15f)]('and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review'),console['log'](_0x17330e(0x154)),console[_0x17330e(0x15f)](_0x17330e(0x19e));else{const _0x5616ab=_0x21353a['hWThB'](bold,_0x21353a['OFNhj']);console['log'](_0x21353a[_0x17330e(0x18b)](_0x21353a['diaDD']('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x5616ab+_0x17330e(0x1b9)+'\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'),'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.'));}}
|
|
1
|
+
const _0x409d75=_0x3d13;(function(_0x54025f,_0x50d2a0){const _0x4a8a75=_0x3d13,_0x117fb9=_0x54025f();while(!![]){try{const _0x5711f5=-parseInt(_0x4a8a75(0xd1))/0x1*(-parseInt(_0x4a8a75(0x10c))/0x2)+parseInt(_0x4a8a75(0xf5))/0x3+-parseInt(_0x4a8a75(0xa2))/0x4*(parseInt(_0x4a8a75(0xc4))/0x5)+-parseInt(_0x4a8a75(0xc3))/0x6+parseInt(_0x4a8a75(0xc6))/0x7*(-parseInt(_0x4a8a75(0xbe))/0x8)+parseInt(_0x4a8a75(0xde))/0x9+parseInt(_0x4a8a75(0x109))/0xa*(parseInt(_0x4a8a75(0xad))/0xb);if(_0x5711f5===_0x50d2a0)break;else _0x117fb9['push'](_0x117fb9['shift']());}catch(_0x39260a){_0x117fb9['push'](_0x117fb9['shift']());}}}(_0x1009,0xcfb0a));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x469b3a from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);function _0x3d13(_0x159cdc,_0xf88f8d){_0x159cdc=_0x159cdc-0xa2;const _0x1009b9=_0x1009();let _0x3d1398=_0x1009b9[_0x159cdc];return _0x3d1398;}export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.58.2';const bold=_0x1f6574=>_0x409d75(0xf4)+_0x1f6574+_0x409d75(0xf9);function _0x1009(){const _0x496985=['kVUDh','90WqSSvi','force','allowInsecureLocalhost','2154SkAjbP','jZcOB','2698584OPnuCz','\x20now?','✓\x20Skipping\x20authentication\x20(--skip-auth)','✓\x20Authenticated\x20to\x20','vGtpY','TEiJM','\x20may\x20need\x20a\x20one-time\x20headed\x20login\x20instead\x20—',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','✓\x20~/.ranger/\x20directory\x20already\x20exists','✓\x20Exported\x20credentials\x20for\x20CI','mXxkz','339482RDibix','prompt','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','opencode','scope','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','\x20\x20npx\x20playwright@','status','chromium','message','\x0a🚀\x20Ranger\x20Setup\x0a','provided_token','✓\x20Playwright\x20Chromium\x20browser\x20found','You\x20can\x20install\x20it\x20manually\x20by\x20running:','RANGER_TEST_USERNAME','warn','QiCjN','45984uTKJxb','npx','keVTK','AcxqW','wSKSf','8333088NlSHcm','5QalAsH','SUPix','721jlpWuz','user','success','\x0aTo\x20verify\x20with\x20a\x20browser,\x20set\x20','kTWee','The\x20required\x20version\x20(','\x0aInstalling\x20Chromium\x20browser...\x0a','XjhQh','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','trackPhaseStart','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','502WPgcpG','ignore','withDeps','\x0a⚠\x20Skipping\x20Chromium\x20installation.','--with-deps','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','local','/ranger:enable','device_auth','RbxEn','organizationName','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','\x0a\x20\x20your\x20org\x27s\x20auth\x20config\x20drives\x20which\x20flow\x20runs.','11417967tOTRFh','\x20(fallback\x20version)','YHYFx','skipAuth','ZqadV','plugin','\x20install\x20chromium','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','\x20for\x20explicit\x20profile\x20management).','ffcHi','nIayw','trackPhaseEnd','KKvWS','ready','Authentication\x20failed:\x20','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','Yzdsp','platform','isTTY','✓\x20Created\x20.ranger/.gitignore','VAHdj','✓\x20Local\x20profile\x20already\x20exists','\x1b[1m','4257483vmBAod','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','lfeJn','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','\x1b[0m','resolve','skipped','\x20and\x20prompt\x20the\x20coding','QuLXb','XOkID','stdout','error','aVwNL','btJpd','jqfXF','cDUtX','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','existing_token','log'];_0x1009=function(){return _0x496985;};return _0x1009();}export function getPlaywrightVersion(){const _0x4c6cf2=_0x409d75,_0xea7100={'ZqadV':'playwright/package.json'};try{const _0x36c2c7=require[_0x4c6cf2(0xfa)](_0xea7100[_0x4c6cf2(0xe2)]),_0x358051=require(_0x36c2c7);return _0x358051['version'];}catch{return null;}}export function installChromiumBinary(_0x2bed3b,_0x5bc291=![]){const _0x5e00c7=_0x409d75,_0x4571b8={'BjtuK':_0x5e00c7(0xd5),'wSKSf':_0x5e00c7(0xd2),'imAqv':function(_0x34f9ca,_0x3cfa8d){return _0x34f9ca===_0x3cfa8d;},'wUGhM':'error'};return new Promise((_0x15d3cc,_0x11bfb9)=>{const _0x1346da=_0x5e00c7,_0x54d166={'SUPix':function(_0x4c9f27,_0x1564e9){return _0x4c9f27===_0x1564e9;},'fKdlG':function(_0x52546f){return _0x52546f();}},_0x41de42=['playwright@'+_0x2bed3b,'install',..._0x5bc291?[_0x4571b8['BjtuK']]:[],_0x1346da(0xb5)],_0x2effe4=spawn(_0x1346da(0xbf),_0x41de42,{'stdio':[_0x4571b8[_0x1346da(0xc2)],'inherit','inherit'],'shell':_0x4571b8['imAqv'](process[_0x1346da(0xef)],'win32')});_0x2effe4['on']('close',_0x1eb962=>{const _0x221c8b=_0x1346da;_0x54d166[_0x221c8b(0xc5)](_0x1eb962,0x0)?_0x54d166['fKdlG'](_0x15d3cc):_0x11bfb9(new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x1eb962));}),_0x2effe4['on'](_0x4571b8['wUGhM'],_0x39b9a6=>{_0x11bfb9(_0x39b9a6);});});}export async function authenticate(_0x5be8e6){const _0x207b04=_0x409d75,_0x501e58={'jTIVe':_0x207b04(0x106),'YHYFx':function(_0x3d7933,_0x352c69){return _0x3d7933 instanceof _0x352c69;},'KZBXY':function(_0x3194e3,_0x31e27e){return _0x3194e3(_0x31e27e);},'QiCjN':_0x207b04(0xd9),'ffcHi':'Validating\x20API\x20token...','XOkID':'✓\x20Stored\x20credentials\x20locally','QPDoO':_0x207b04(0xb8)};if(!_0x5be8e6){const _0x377b39=await getToken();if(_0x377b39){const _0x1c5d0d=await getCurrentUser(_0x377b39);if(_0x1c5d0d['success'])return console[_0x207b04(0x107)]('✓\x20Already\x20authenticated\x20to\x20'+_0x1c5d0d[_0x207b04(0xc7)]['organizationName']),{'token':_0x377b39,'method':_0x501e58['jTIVe']};}try{_0x5be8e6=await runDeviceAuthFlow();}catch(_0x447182){throw new Error('Authentication\x20failed:\x20'+(_0x501e58[_0x207b04(0xe0)](_0x447182,Error)?_0x447182['message']:_0x447182));}const _0x3fd7e6=await _0x501e58['KZBXY'](getCurrentUser,_0x5be8e6);if(!_0x3fd7e6['success'])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x3fd7e6[_0x207b04(0x100)]);return console['log'](_0x207b04(0xa5)+_0x3fd7e6[_0x207b04(0xc7)][_0x207b04(0xdb)]),{'token':_0x5be8e6,'method':_0x501e58[_0x207b04(0xbd)]};}console['log'](_0x501e58[_0x207b04(0xe7)]);const _0x3dafb0=await _0x501e58['KZBXY'](getCurrentUser,_0x5be8e6);if(!_0x3dafb0[_0x207b04(0xc8)]){if(_0x3dafb0[_0x207b04(0xb4)])throw new Error(_0x207b04(0xec)+_0x3dafb0[_0x207b04(0x100)]+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x3dafb0['error']+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console[_0x207b04(0x107)]('✓\x20Authenticated\x20to\x20'+_0x3dafb0[_0x207b04(0xc7)]['organizationName']),await _0x501e58['KZBXY'](storeToken,_0x5be8e6),console[_0x207b04(0x107)](process['env']['GITHUB_ENV']?_0x207b04(0xab):_0x501e58[_0x207b04(0xfe)]),{'token':_0x5be8e6,'method':_0x501e58['QPDoO']};}export async function ensureRangerDir(_0x2950ba){const _0x1bb19f=_0x409d75,_0x2f2de1={'mlMaV':function(_0xad10b4,_0x2cdce8){return _0xad10b4(_0x2cdce8);},'ebgDY':function(_0x358ac2,_0x510b82,_0x395fc3){return _0x358ac2(_0x510b82,_0x395fc3);},'FPJWY':'✓\x20Created\x20~/.ranger/\x20directory','fcXBx':_0x1bb19f(0xaa)};void _0x2950ba;const _0x2b8ce4=getRangerHomeDir();return!_0x2f2de1['mlMaV'](existsSync,_0x2b8ce4)?(await _0x2f2de1['ebgDY'](mkdir,_0x2b8ce4,{'recursive':!![]}),console['log'](_0x2f2de1['FPJWY']),{'path':_0x2b8ce4,'installed':!![]}):(console['log'](_0x2f2de1['fcXBx']),{'path':_0x2b8ce4,'installed':![]});}export async function ensureChromium(_0x4473c3=![]){const _0x5c8311=_0x409d75,_0x50d87f={'NbLwu':_0x5c8311(0xb9),'jreeH':function(_0x52e464){return _0x52e464();},'lgabD':function(_0x3d19c9,_0x30e09){return _0x3d19c9??_0x30e09;},'GVaER':_0x5c8311(0xdf),'kTWee':_0x5c8311(0xaf)};let _0x1f9f54=![];try{const _0x598370=chromium['executablePath']();_0x1f9f54=existsSync(_0x598370);}catch{_0x1f9f54=![];}if(_0x1f9f54)return console['log'](_0x50d87f['NbLwu']),![];const _0x4ee2e9=_0x50d87f['jreeH'](getPlaywrightVersion),_0x347335=_0x50d87f['lgabD'](_0x4ee2e9,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x434ef6=!_0x4ee2e9,_0x5d00eb=process['stdin'][_0x5c8311(0xf0)]&&process[_0x5c8311(0xff)][_0x5c8311(0xf0)];let _0x8705c6=!![];if(_0x5d00eb){const {install:_0x274337}=await _0x469b3a[_0x5c8311(0xae)]([{'type':'confirm','name':'install','message':_0x434ef6?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x347335+_0x5c8311(0xa3):_0x5c8311(0xcb)+_0x347335+_0x5c8311(0xa9),'default':!![]}]);_0x8705c6=_0x274337;}else console['log'](_0x5c8311(0xd0)+_0x347335+(_0x434ef6?_0x50d87f['GVaER']:'')+'...');if(_0x8705c6){console[_0x5c8311(0x107)](_0x5c8311(0xcc));try{await installChromiumBinary(_0x347335,_0x4473c3),console[_0x5c8311(0x107)]('\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully');}catch(_0x181e52){console[_0x5c8311(0x100)](_0x5c8311(0xf8),_0x181e52 instanceof Error?_0x181e52[_0x5c8311(0xb6)]:_0x181e52),console['log'](_0x5c8311(0xba)),console[_0x5c8311(0x107)](_0x5c8311(0xb3)+_0x347335+'\x20install\x20chromium');}}else console[_0x5c8311(0x107)](_0x5c8311(0xd4)),console['log'](_0x50d87f[_0x5c8311(0xca)]),console[_0x5c8311(0x107)](_0x5c8311(0xb3)+_0x347335+_0x5c8311(0xe4));return!![];}export async function writeRangerGitignore(_0x4872eb){const _0x90f860=_0x409d75,_0x4ff283=join(_0x4872eb,'.gitignore'),_0x108d4f='\x0a\x0a#\x20Ignore\x20local-only\x20directories\x0alocal/\x0asessions/\x0abug-bashes/\x0areports/\x0afeedback-images/\x0a\x0aactive-profile.txt\x0aactive-feature.txt\x0a.gitignore\x0a\x0a#\x20Ignore\x20plaintext\x20auth\x20files\x20(encrypted\x20.enc\x20files\x20are\x20safe\x20to\x20commit)\x0a**/auth.json\x0a';await writeFile(_0x4ff283,_0x108d4f),console[_0x90f860(0x107)](_0x90f860(0xf1));}export async function ensureLocalEnv(_0xadce61,_0x412fa7){const _0xa0f57d=_0x409d75,_0xb88090={'jJZgD':function(_0x43594a){return _0x43594a();},'trYgS':_0xa0f57d(0xc7),'vGtpY':_0xa0f57d(0xd7),'kVUDh':_0xa0f57d(0xf3),'AcxqW':function(_0x3a6a34,_0x4efdcd,_0xe5c6ed,_0x31efbd){return _0x3a6a34(_0x4efdcd,_0xe5c6ed,_0x31efbd);},'btJpd':function(_0xd03324,_0x4a57c3){return _0xd03324 instanceof _0x4a57c3;}};if(!_0xb88090['jJZgD'](findGitRoot)&&_0xadce61?.['scope']!==_0xb88090['trYgS'])return console['log']('⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.'),{'ready':![],'skipped':!![]};const _0x16a579=_0xadce61?.[_0xa0f57d(0xb1)]==='user'?getRangerHomeDir():undefined;if(findExistingEnv(_0xb88090[_0xa0f57d(0xa6)],{'locations':[_0xa0f57d(0xd7)],'rangerDir':_0x16a579}))return console['log'](_0xb88090[_0xa0f57d(0x108)]),{'ready':!![],'skipped':![]};try{return await _0xb88090[_0xa0f57d(0xc1)](addEnv,_0xb88090[_0xa0f57d(0xa6)],{'url':_0xadce61?.['url'],'force':_0xadce61?.['force'],'allowInsecureLocalhost':_0xadce61?.['allowInsecureLocalhost'],'scope':_0xadce61?.[_0xa0f57d(0xb1)]},_0x412fa7),{'ready':!![],'skipped':![]};}catch(_0x4f74ac){return console[_0xa0f57d(0x100)]('\x0a❌\x20Profile\x20setup\x20failed:',_0xb88090[_0xa0f57d(0x102)](_0x4f74ac,Error)?_0x4f74ac['message']:_0x4f74ac),{'ready':![],'skipped':![]};}}export async function start(_0x1fa4bb,_0x5b5b35,_0x1f517d){const _0x409b17=_0x409d75,_0x57ac63={'Yzdsp':'user','lfeJn':function(_0x569300,_0x36d820){return _0x569300(_0x36d820);},'cDUtX':function(_0x51bd65){return _0x51bd65();},'KKvWS':'auth','JRVGM':_0x409b17(0xfb),'KCoOA':function(_0x2210ce,_0x4ad418){return _0x2210ce(_0x4ad418);},'HFkbz':_0x409b17(0xb5),'PkPTi':'plugin','UuXzA':function(_0x2aaa18,_0x34e3b8){return _0x2aaa18&&_0x34e3b8;},'keVTK':'skills','LpElM':function(_0x2ed3c9,_0x49662e,_0x20aeb0){return _0x2ed3c9(_0x49662e,_0x20aeb0);},'XjhQh':_0x409b17(0xf6),'pBnpE':function(_0x18507b,_0x4c5d83){return _0x18507b instanceof _0x4c5d83;},'jqfXF':'profile','egpJn':function(_0x212682,_0x5632fc){return _0x212682+_0x5632fc;},'mmdZK':_0x409b17(0xbb),'TEiJM':'RANGER_TEST_PASSWORD','nIayw':'ranger\x20profile\x20add','VAHdj':_0x409b17(0xb2),'QuLXb':_0x409b17(0xce),'aVwNL':'verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','jZcOB':function(_0x2b009d,_0x205c2d){return _0x2b009d(_0x205c2d);},'qtgZt':_0x409b17(0xd8),'RbxEn':function(_0x5d3ae3,_0x24deff){return _0x5d3ae3+_0x24deff;},'mXxkz':function(_0xb66b81,_0x23d6bd){return _0xb66b81+_0x23d6bd;}};console[_0x409b17(0x107)](_0x409b17(0xb7)),_0x5b5b35={..._0x5b5b35,'scope':_0x57ac63[_0x409b17(0xee)]};const _0x1d578a=!_0x57ac63['lfeJn'](existsSync,_0x57ac63[_0x409b17(0x104)](getRangerHomeDir));await _0x57ac63['lfeJn'](ensureRangerDir,_0x57ac63[_0x409b17(0xee)]);if(_0x5b5b35?.[_0x409b17(0xe1)])console['log'](_0x409b17(0xa4)),_0x1f517d?.['trackPhaseEnd'](_0x57ac63[_0x409b17(0xea)],{'isFirstRun':_0x1d578a,'method':_0x57ac63['JRVGM']});else{_0x1f517d?.['trackPhaseStart'](_0x57ac63[_0x409b17(0xea)]);const _0x3596ce=await _0x57ac63['KCoOA'](authenticate,_0x1fa4bb);_0x1f517d?.['trackPhaseEnd']('auth',{'isFirstRun':_0x1d578a,'method':_0x3596ce['method']});}_0x1f517d?.['trackPhaseStart'](_0x409b17(0xb5));_0x5b5b35?.['skipChromium']?console[_0x409b17(0x107)]('✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)'):await ensureChromium(_0x5b5b35?.[_0x409b17(0xd3)]);_0x1f517d?.[_0x409b17(0xe9)](_0x57ac63['HFkbz'],{'isFirstRun':_0x1d578a,'skipped':!!_0x5b5b35?.['skipChromium']}),console[_0x409b17(0x107)](_0x409b17(0xd6));const _0x85fbb5=_0x5b5b35?.[_0x409b17(0xb1)],_0x2b9c66=_0x5b5b35?.[_0x409b17(0xb0)]??![];let _0x2a6924=null;_0x2b9c66?(_0x1f517d?.[_0x409b17(0xcf)](_0x409b17(0xe3)),_0x2a6924=await ensureOpencodePluginConfig(_0x85fbb5),_0x1f517d?.['trackPhaseEnd'](_0x57ac63['PkPTi'],{'isFirstRun':_0x1d578a,'opencode':!![]})):(_0x1f517d?.['trackPhaseStart'](_0x409b17(0xe3)),await ensureClaudePlugin(_0x85fbb5),_0x1f517d?.[_0x409b17(0xe9)]('plugin',{'isFirstRun':_0x1d578a}));if(_0x57ac63['UuXzA'](_0x2b9c66,_0x2a6924)){_0x1f517d?.[_0x409b17(0xcf)](_0x57ac63[_0x409b17(0xc0)]);try{await _0x57ac63['LpElM'](installSkill,'ranger',{'level':_0x2a6924['scope'],'cliVersion':_0x57ac63[_0x409b17(0x104)](getCurrentVersion),'platform':_0x409b17(0xb0)}),_0x1f517d?.[_0x409b17(0xe9)](_0x57ac63[_0x409b17(0xc0)],{'isFirstRun':_0x1d578a,'opencode':!![]});}catch(_0x1c110d){console[_0x409b17(0xbc)](_0x57ac63[_0x409b17(0xcd)],_0x57ac63['pBnpE'](_0x1c110d,Error)?_0x1c110d['message']:_0x1c110d),_0x1f517d?.[_0x409b17(0xe9)]('skills',{'isFirstRun':_0x1d578a,'opencode':!![],'failed':!![]});}}else _0x1f517d?.[_0x409b17(0xcf)]('skills'),await ensureClaudeSkills(_0x85fbb5),_0x1f517d?.['trackPhaseEnd'](_0x57ac63['keVTK'],{'isFirstRun':_0x1d578a});if(_0x5b5b35?.[_0x409b17(0xe1)])console[_0x409b17(0x107)](_0x409b17(0xed));else{if(_0x5b5b35?.['url']){_0x1f517d?.['trackPhaseStart'](_0x57ac63['jqfXF']);const _0x453232=await ensureLocalEnv({'url':_0x5b5b35['url'],'force':_0x5b5b35?.[_0x409b17(0x10a)],'allowInsecureLocalhost':_0x5b5b35?.[_0x409b17(0x10b)],'scope':'user'},_0x1f517d);_0x1f517d?.[_0x409b17(0xe9)](_0x57ac63[_0x409b17(0x103)],{'isFirstRun':_0x1d578a,'profileReady':_0x453232[_0x409b17(0xeb)],'userSkipped':_0x453232[_0x409b17(0xfb)]});}else console['log'](_0x57ac63['egpJn'](_0x409b17(0xc9)+_0x57ac63['KCoOA'](bold,_0x57ac63['mmdZK'])+'\x20'+('(and\x20'+_0x57ac63['KCoOA'](bold,_0x57ac63[_0x409b17(0xa7)])+'\x20when\x20the\x20org\x27s\x20login')+'\x0a\x20\x20config\x20uses\x20username+password).\x20Orgs\x20on\x20SSO/SAML/OAuth',_0x409b17(0xa8))+_0x409b17(0xdd)),console['log']('\x20\x20(or\x20use\x20'+_0x57ac63[_0x409b17(0xf7)](bold,_0x57ac63[_0x409b17(0xe8)])+_0x409b17(0xe6));}if(_0x2b9c66)console[_0x409b17(0x107)](_0x57ac63[_0x409b17(0xf2)]),console['log'](_0x409b17(0x105)),console[_0x409b17(0x107)](_0x57ac63[_0x409b17(0xfd)]),console['log'](_0x57ac63[_0x409b17(0x101)]);else{const _0x24275b=_0x57ac63[_0x409b17(0x10d)](bold,_0x57ac63['qtgZt']);console['log'](_0x57ac63[_0x409b17(0xda)](_0x57ac63[_0x409b17(0xac)]('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x24275b+_0x409b17(0xfc)+_0x409b17(0xdc),_0x409b17(0xe5)),'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.'));}}
|