@ranger-testing/ranger-cli 3.0.1-alpha.bb18058-34 → 3.0.1-alpha.ebe0997-35

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.
Files changed (84) hide show
  1. package/build/cli.js +1 -1
  2. package/build/commands/addEnv.js +1 -1
  3. package/build/commands/authEncrypt.js +1 -1
  4. package/build/commands/clean.js +1 -1
  5. package/build/commands/config.js +1 -1
  6. package/build/commands/deleteProfile.js +1 -1
  7. package/build/commands/env.js +1 -1
  8. package/build/commands/feature.js +1 -1
  9. package/build/commands/hook.js +1 -1
  10. package/build/commands/hooks/autoPrompt.js +1 -1
  11. package/build/commands/hooks/disable.js +1 -1
  12. package/build/commands/hooks/enable.js +1 -1
  13. package/build/commands/hooks/exitPlanMode.js +1 -1
  14. package/build/commands/hooks/index.js +1 -1
  15. package/build/commands/hooks/output.js +1 -1
  16. package/build/commands/hooks/planReminder.js +1 -1
  17. package/build/commands/hooks/planStart.js +1 -1
  18. package/build/commands/hooks/postEdit.js +1 -1
  19. package/build/commands/hooks/preCompact.js +1 -1
  20. package/build/commands/hooks/sessionEnd.js +1 -1
  21. package/build/commands/hooks/sessionStart.js +1 -1
  22. package/build/commands/hooks/stopHook.js +1 -1
  23. package/build/commands/index.js +1 -1
  24. package/build/commands/login.js +1 -1
  25. package/build/commands/mcpBootstrap.js +1 -1
  26. package/build/commands/migrateProfile.js +1 -1
  27. package/build/commands/setup/claude.js +1 -1
  28. package/build/commands/setup/opencode.js +1 -1
  29. package/build/commands/setupCi.js +1 -1
  30. package/build/commands/skillup.js +1 -1
  31. package/build/commands/start.js +1 -1
  32. package/build/commands/status.js +1 -1
  33. package/build/commands/update.js +1 -1
  34. package/build/commands/updateEnv.js +1 -1
  35. package/build/commands/useEnv.js +1 -1
  36. package/build/commands/utils/activeProfile.js +1 -1
  37. package/build/commands/utils/agentEnv.js +1 -1
  38. package/build/commands/utils/browserSessionsApi.js +1 -1
  39. package/build/commands/utils/claudeConfig.js +1 -1
  40. package/build/commands/utils/claudeOverrideSettings.js +1 -1
  41. package/build/commands/utils/claudePlugin.js +1 -1
  42. package/build/commands/utils/cloudProfile.js +1 -1
  43. package/build/commands/utils/cloudProfileSession.js +1 -1
  44. package/build/commands/utils/crypto.js +1 -1
  45. package/build/commands/utils/desirePathLog.js +1 -1
  46. package/build/commands/utils/deviceAuth.js +1 -1
  47. package/build/commands/utils/environment.js +1 -1
  48. package/build/commands/utils/featureApi.js +1 -1
  49. package/build/commands/utils/fixWebmDuration.js +1 -1
  50. package/build/commands/utils/gitTracked.js +1 -1
  51. package/build/commands/utils/keychain.js +1 -1
  52. package/build/commands/utils/legacyWarning.js +1 -1
  53. package/build/commands/utils/localAgentInstallationsApi.js +1 -1
  54. package/build/commands/utils/matchAuthEnvironment.js +1 -1
  55. package/build/commands/utils/mcpImageBase64.js +1 -1
  56. package/build/commands/utils/model.js +1 -1
  57. package/build/commands/utils/novaActCli.js +1 -1
  58. package/build/commands/utils/opencodeConfig.js +1 -1
  59. package/build/commands/utils/organizationEnvApi.js +1 -1
  60. package/build/commands/utils/playwrightCli.js +1 -1
  61. package/build/commands/utils/profileMessages.js +1 -1
  62. package/build/commands/utils/profileSetupBanner.js +1 -1
  63. package/build/commands/utils/projectsConfig.js +1 -1
  64. package/build/commands/utils/rangerConfig.js +1 -1
  65. package/build/commands/utils/rangerRoot.js +1 -1
  66. package/build/commands/utils/rangerwrightCli.js +1 -1
  67. package/build/commands/utils/resolveProfileContext.js +1 -1
  68. package/build/commands/utils/resolveProfileUrl.js +1 -1
  69. package/build/commands/utils/retry.js +1 -1
  70. package/build/commands/utils/sessionCache.js +1 -1
  71. package/build/commands/utils/settings.js +1 -1
  72. package/build/commands/utils/skillContent.js +1 -1
  73. package/build/commands/utils/skills.js +1 -1
  74. package/build/commands/utils/stitchWebmFiles.js +1 -1
  75. package/build/commands/utils/telemetry.js +1 -1
  76. package/build/commands/utils/tokenRefresh.js +1 -1
  77. package/build/commands/utils/traceSnapshotMapper.js +1 -1
  78. package/build/commands/utils/userApi.js +1 -1
  79. package/build/commands/utils/version.js +1 -1
  80. package/build/commands/verifyFeature.js +1 -1
  81. package/build/commands/verifyFeatureCli.js +1 -1
  82. package/build/commands/verifyFeatureNovaCli.js +1 -1
  83. package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
  84. package/package.json +1 -1
@@ -1 +1 @@
1
- function _0x1982(_0x51daaa,_0x5c036a){_0x51daaa=_0x51daaa-0x8c;const _0xf3b93=_0xf3b9();let _0x198212=_0xf3b93[_0x51daaa];return _0x198212;}function _0xf3b9(){const _0x288663=['6oFcyJa','2149088hEjFRw','1971075YqDzms','user','21345312QDSPzf','\x0a✅\x20API\x20key\x20stored\x20successfully','log','639026tneOCu','message','1408653jNzEkE','1863848svlBUA','pwcUW','96888PlvcFN'];_0xf3b9=function(){return _0x288663;};return _0xf3b9();}(function(_0x4b3bcf,_0x5b2993){const _0x29ca01=_0x1982,_0x13f869=_0x4b3bcf();while(!![]){try{const _0x4df9f9=-parseInt(_0x29ca01(0x95))/0x1+-parseInt(_0x29ca01(0x90))/0x2+-parseInt(_0x29ca01(0x92))/0x3+-parseInt(_0x29ca01(0x97))/0x4+parseInt(_0x29ca01(0x98))/0x5*(-parseInt(_0x29ca01(0x96))/0x6)+-parseInt(_0x29ca01(0x93))/0x7+parseInt(_0x29ca01(0x8d))/0x8;if(_0x4df9f9===_0x5b2993)break;else _0x13f869['push'](_0x13f869['shift']());}catch(_0x451b81){_0x13f869['push'](_0x13f869['shift']());}}}(_0xf3b9,0x8eb0d));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';import{isInteractive}from'./utils/cloudProfileSession.js';export async function login(){const _0x13d0df=_0x1982,_0x3a0b55={'pwcUW':'Re-authenticating\x20via\x20MCP\x20bootstrap...','GAtnt':function(_0x3cb7a8){return _0x3cb7a8();},'iAkLs':'Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.'},_0xee6060=await getMcpAuthOrigin();if(_0xee6060){console[_0x13d0df(0x8f)](_0x3a0b55[_0x13d0df(0x94)]),await mcpBootstrap();return;}if(!_0x3a0b55['GAtnt'](isInteractive))throw new Error(_0x3a0b55['iAkLs']);try{const _0xf96c9d=await _0x3a0b55['GAtnt'](runDeviceAuthFlow),_0x1f30db=await getCurrentUser(_0xf96c9d);_0x1f30db['success']?console[_0x13d0df(0x8f)]('\x0a✅\x20Logged\x20in\x20to\x20'+_0x1f30db[_0x13d0df(0x8c)]['organizationName']):console['log'](_0x13d0df(0x8e));}catch(_0xb12935){throw new Error('Login\x20failed:\x20'+(_0xb12935 instanceof Error?_0xb12935[_0x13d0df(0x91)]:_0xb12935));}}
1
+ (function(_0xfb5968,_0x3f712e){const _0x30618a=_0x34d6,_0x2ff989=_0xfb5968();while(!![]){try{const _0x5d5e4f=parseInt(_0x30618a(0xcf))/0x1*(-parseInt(_0x30618a(0xc9))/0x2)+parseInt(_0x30618a(0xd0))/0x3*(-parseInt(_0x30618a(0xc1))/0x4)+parseInt(_0x30618a(0xc2))/0x5+-parseInt(_0x30618a(0xc8))/0x6*(-parseInt(_0x30618a(0xc0))/0x7)+parseInt(_0x30618a(0xc7))/0x8*(-parseInt(_0x30618a(0xc5))/0x9)+parseInt(_0x30618a(0xce))/0xa+parseInt(_0x30618a(0xd1))/0xb*(-parseInt(_0x30618a(0xcb))/0xc);if(_0x5d5e4f===_0x3f712e)break;else _0x2ff989['push'](_0x2ff989['shift']());}catch(_0x578d43){_0x2ff989['push'](_0x2ff989['shift']());}}}(_0x2a1a,0x532cf));function _0x2a1a(){const _0x284f5e=['cgwWA','Re-authenticating\x20via\x20MCP\x20bootstrap...','5054800fPCuls','142942rfWhPA','3RRuaBq','11ocJiFs','log','Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','22687oTYMQE','1357388ZQozfE','3144000YXGqHp','mNzrt','user','333PYHTGT','Login\x20failed:\x20','11576mHhprD','678hjOqXI','8sQFMCR','organizationName','2342064BgTzSS'];_0x2a1a=function(){return _0x284f5e;};return _0x2a1a();}function _0x34d6(_0x1c0586,_0x3694d2){_0x1c0586=_0x1c0586-0xc0;const _0x2a1a35=_0x2a1a();let _0x34d60c=_0x2a1a35[_0x1c0586];return _0x34d60c;}import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';import{isInteractive}from'./utils/cloudProfileSession.js';export async function login(){const _0x4c8c14=_0x34d6,_0x5b7d02={'mNzrt':_0x4c8c14(0xcd),'QWLjC':function(_0x19596f){return _0x19596f();},'cgwWA':_0x4c8c14(0xd3),'mNIUv':function(_0x11e8e9,_0x53685c){return _0x11e8e9(_0x53685c);},'dauyJ':'\x0a✅\x20API\x20key\x20stored\x20successfully'},_0x4c0f91=await getMcpAuthOrigin();if(_0x4c0f91){console['log'](_0x5b7d02[_0x4c8c14(0xc3)]),await _0x5b7d02['QWLjC'](mcpBootstrap);return;}if(!isInteractive())throw new Error(_0x5b7d02[_0x4c8c14(0xcc)]);try{const _0x1df709=await _0x5b7d02['QWLjC'](runDeviceAuthFlow),_0x3254b9=await _0x5b7d02['mNIUv'](getCurrentUser,_0x1df709);_0x3254b9['success']?console[_0x4c8c14(0xd2)]('\x0a✅\x20Logged\x20in\x20to\x20'+_0x3254b9[_0x4c8c14(0xc4)][_0x4c8c14(0xca)]):console['log'](_0x5b7d02['dauyJ']);}catch(_0x387bda){throw new Error(_0x4c8c14(0xc6)+(_0x387bda instanceof Error?_0x387bda['message']:_0x387bda));}}
@@ -1 +1 @@
1
- const _0x5d485c=_0x5d3d;(function(_0x525054,_0x485541){const _0xecf433=_0x5d3d,_0xa6d24c=_0x525054();while(!![]){try{const _0x5e201e=parseInt(_0xecf433(0x163))/0x1*(-parseInt(_0xecf433(0x14d))/0x2)+parseInt(_0xecf433(0x197))/0x3+-parseInt(_0xecf433(0x15d))/0x4*(parseInt(_0xecf433(0x138))/0x5)+parseInt(_0xecf433(0x18f))/0x6+parseInt(_0xecf433(0x116))/0x7*(-parseInt(_0xecf433(0x15b))/0x8)+parseInt(_0xecf433(0x136))/0x9+parseInt(_0xecf433(0x107))/0xa;if(_0x5e201e===_0x485541)break;else _0xa6d24c['push'](_0xa6d24c['shift']());}catch(_0x585bf7){_0xa6d24c['push'](_0xa6d24c['shift']());}}}(_0x1f41,0x55fcd));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger',_0x5d485c(0x159)),AUTH_ORIGIN_PATH=join(homedir(),_0x5d485c(0x135),'auth-origin.txt');function _0x1f41(){const _0x529971=['RDwqk','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','slice','match','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','proxied','ArvRS','42BCyvJL','includes','/callback','platform','darwin','log','hex','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','2025-03-26','replace','pOlge','\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','QhWJD','ywcxe','\x20done','IISDY','fiEOh','clientId','Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20','oJKZx','state','BDWHH','parse','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','application/json','end','searchParams','writeHead','data:','WPkVE','name','.ranger','101088JhfBcq','json','35msTUVj','RryHt','QuvnO','application/x-www-form-urlencoded','access_token','ranger-cli','anaiW','EiAaL','authorization_endpoint','IiJLF','initialize','\x0aToken\x20written\x20to\x20','/.well-known/oauth-protected-resource','utf-8','code_challenge','refresh_token','client_id','content-type','client_secret','QCFeU','token','2674JSRUGQ','content','Server\x20returned\x20error:\x20','Ranger\x20CLI','clientSecret','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','start','accessToken','pVrrV','uZgmf','status','OAuthTimeoutError','mcp-oauth-tokens.json','JImys','698536PemgMJ','toString','310028EHFkOe','POST','base64url','LIISb','HgMZm','error','334bqNcNH','S256','SrqLy','127.0.0.1','digest','startsWith','response_type','<html><body><h2>Authentication\x20failed</h2><p>','expiresAt','registration_endpoint','stringify','jypmp','closeAllConnections','idokG','split','Exchanging\x20authorization\x20code...','text','Not\x20found','resource','get_cli_token','OXvjl','RgLha','<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','1.0.0','now','error_description','get_cli_token\x20failed:\x20','Initializing\x20MCP\x20session...','AYrDx','kheSB','origin','MLslO','jievB','refresh.txt','nkmfg','Bearer\x20','write','2.0','IWAam','hmldo','headers','veTgm','isError','TzBfP','3617160UUupMq','pjbax','stdout','XoBLs','string','code_challenge_method','IDLcT','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','303891SJPhmZ','LMBub','sIaHg','11498250RGfltl','ZXtDb','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','SARpL','get','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','set'];_0x1f41=function(){return _0x529971;};return _0x1f41();}export async function getMcpAuthOrigin(){const _0x37a2a1=_0x5d485c,_0x25c0c9={'WtZnp':function(_0x2ca0f6,_0x4e30ee,_0x52465b){return _0x2ca0f6(_0x4e30ee,_0x52465b);},'ZfPxo':function(_0x5ed6c9,_0x9d64f5){return _0x5ed6c9||_0x9d64f5;}};try{const _0xb1f2c1=(await _0x25c0c9['WtZnp'](readFile,AUTH_ORIGIN_PATH,_0x37a2a1(0x145)))['trim']();return _0x25c0c9['ZfPxo'](_0xb1f2c1,null);}catch{return null;}}export async function mcpBootstrap(){const _0x193191=_0x5d485c,_0x35255e={'LIISb':function(_0x5308e1){return _0x5308e1();},'veTgm':function(_0x48c64e,_0x40def1){return _0x48c64e(_0x40def1);},'UUuxM':'proxied','IusvW':function(_0x155b8e,_0x222c36){return _0x155b8e+_0x222c36;},'WPkVE':_0x193191(0x10a)},_0x8d9080=_0x35255e[_0x193191(0x160)](getMcpAuthUrl);currentOrigin=_0x8d9080;const _0x128f5d=process['stdout']['isTTY']??![];console[_0x193191(0x11b)]('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x8d9080+'\x0a');const _0x11f314=await _0x35255e['veTgm'](tryUnauthenticated,_0x8d9080);let _0x2a0ece=null;if(_0x11f314===_0x35255e['UUuxM'])_0x2a0ece='';else{_0x2a0ece=await loadCachedToken();if(!_0x2a0ece){if(!_0x128f5d)throw new Error(_0x35255e['IusvW'](_0x35255e[_0x193191(0x133)],_0x193191(0x11d)));_0x2a0ece=await _0x35255e[_0x193191(0x18c)](oauthFlow,_0x8d9080);}}await callGetCliToken(_0x8d9080,_0x2a0ece);}async function tryUnauthenticated(_0x1a5101){const _0x2eebf8=_0x5d485c,_0x431c54={'pjbax':'POST','aBavP':_0x2eebf8(0x11e),'pOlge':_0x2eebf8(0x17a),'idokG':function(_0x37a51a,_0x2d8600){return _0x37a51a===_0x2d8600;},'EiAaL':'needs-oauth'},_0x1849a1=await fetch(_0x1a5101,{'method':_0x431c54[_0x2eebf8(0x190)],'headers':{'Content-Type':_0x2eebf8(0x12e),'Accept':'application/json,\x20text/event-stream'},'body':JSON[_0x2eebf8(0x16d)]({'jsonrpc':_0x2eebf8(0x188),'id':0x1,'method':_0x2eebf8(0x142),'params':{'protocolVersion':_0x431c54['aBavP'],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x431c54[_0x2eebf8(0x120)]}}})});if(_0x1849a1['ok'])return await _0x1849a1['text'](),_0x2eebf8(0x114);if(_0x431c54[_0x2eebf8(0x170)](_0x1849a1['status'],0x191))return await _0x1849a1['text'](),_0x431c54[_0x2eebf8(0x13f)];const _0x224a30=await _0x1849a1['text']();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x1849a1[_0x2eebf8(0x157)]+':\x20'+_0x224a30);}class OAuthTimeoutError extends Error{constructor(_0x549cad){const _0x387870=_0x5d485c,_0x5221a7={'zsnqL':_0x387870(0x158)};super(_0x549cad),this[_0x387870(0x134)]=_0x5221a7['zsnqL'];}}async function oauthFlow(_0x3ab406){const _0x4c967e=_0x5d485c,_0x5b1af7={'BDWHH':function(_0x4c1da1,_0x519ed9){return _0x4c1da1(_0x519ed9);},'anaiW':function(_0x5c8d67){return _0x5c8d67();},'zLaWK':_0x4c967e(0x121)};try{return await _0x5b1af7[_0x4c967e(0x12b)](oauthFlowAttempt,_0x3ab406);}catch(_0x571cbb){if(_0x571cbb instanceof OAuthTimeoutError&&await _0x5b1af7[_0x4c967e(0x13e)](loadCachedClient))return console['log'](_0x5b1af7['zLaWK']),await clearCachedClient(),await _0x5b1af7['BDWHH'](oauthFlowAttempt,_0x3ab406);throw _0x571cbb;}}async function oauthFlowAttempt(_0x5c59ec){const _0x2a9638=_0x5d485c,_0x1b542f={'IDLcT':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','IiJLF':function(_0x2455a0){return _0x2455a0();},'SboJY':'Registering\x20OAuth\x20client...','kheSB':'authorization_code','LMBub':'refresh_token','OQcLd':'code','hmldo':'none','RgLha':_0x2a9638(0x124),'nkmfg':function(_0x34efa2,_0x559b13){return _0x34efa2(_0x559b13);},'MsIEX':_0x2a9638(0x15f),'ywcxe':_0x2a9638(0x169),'CQYoB':_0x2a9638(0x148),'OXvjl':'redirect_uri','rsKRM':_0x2a9638(0x146),'AYrDx':_0x2a9638(0x194),'zBdKb':_0x2a9638(0x12a),'UrfhI':'client_secret','fiEOh':_0x2a9638(0x13b),'Webvb':function(_0x1c606a,_0x268983,_0x3bb230,_0x5d3b33){return _0x1c606a(_0x268983,_0x3bb230,_0x5d3b33);}},_0x191895=_0x5c59ec[_0x2a9638(0x11f)](/\/mcp$/,'');process['stdout']['write']('Discovering\x20authorization\x20server...');const _0x5664c7=await fetch(_0x191895+_0x2a9638(0x144));if(!_0x5664c7['ok'])throw new Error(_0x1b542f[_0x2a9638(0x195)]);const _0x179e8f=await _0x5664c7['json'](),_0x476b1b=_0x179e8f['authorization_servers']?.[0x0];if(!_0x476b1b)throw new Error('No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata');console[_0x2a9638(0x11b)]('\x20'+_0x476b1b);const _0x8497a0=await fetchAuthServerMetadata(_0x476b1b);let _0x17b5b5,_0x4213b5;const _0xc38af=await _0x1b542f[_0x2a9638(0x141)](loadCachedClient);if(_0xc38af)_0x17b5b5=_0xc38af[_0x2a9638(0x127)],_0x4213b5=_0xc38af[_0x2a9638(0x151)];else{if(_0x8497a0['registration_endpoint']){process[_0x2a9638(0x191)]['write'](_0x1b542f['SboJY']);const _0x5dd718=await fetch(_0x8497a0[_0x2a9638(0x16c)],{'method':_0x2a9638(0x15e),'headers':{'Content-Type':_0x2a9638(0x12e)},'body':JSON[_0x2a9638(0x16d)]({'client_name':_0x2a9638(0x150),'redirect_uris':['http://localhost:'+CALLBACK_PORT+_0x2a9638(0x118)],'grant_types':[_0x1b542f[_0x2a9638(0x180)],_0x1b542f[_0x2a9638(0x105)]],'response_types':[_0x1b542f['OQcLd']],'token_endpoint_auth_method':_0x1b542f[_0x2a9638(0x18a)]})});if(!_0x5dd718['ok']){const _0x434d79=await _0x5dd718['text']();throw new Error('Client\x20registration\x20failed:\x20'+_0x434d79);}const _0x46e195=await _0x5dd718['json']();_0x17b5b5=_0x46e195['client_id'],_0x4213b5=_0x46e195[_0x2a9638(0x14a)],await saveCachedClient(_0x17b5b5,_0x4213b5),console[_0x2a9638(0x11b)](_0x1b542f[_0x2a9638(0x178)]);}else throw new Error(_0x2a9638(0x196));}const _0x5d06c3=_0x1b542f[_0x2a9638(0x185)](randomBytes,0x20)[_0x2a9638(0x15c)](_0x1b542f['MsIEX']),_0x15d0b4=createHash('sha256')['update'](_0x5d06c3)[_0x2a9638(0x167)](_0x1b542f['MsIEX']),_0x3706e8=randomBytes(0x10)['toString'](_0x2a9638(0x11c)),_0x52a27e=new URL(_0x8497a0[_0x2a9638(0x140)]);_0x52a27e[_0x2a9638(0x130)][_0x2a9638(0x10e)](_0x1b542f[_0x2a9638(0x123)],_0x1b542f['OQcLd']),_0x52a27e['searchParams']['set'](_0x1b542f['CQYoB'],_0x17b5b5),_0x52a27e[_0x2a9638(0x130)][_0x2a9638(0x10e)](_0x1b542f[_0x2a9638(0x177)],'http://localhost:'+CALLBACK_PORT+_0x2a9638(0x118)),_0x52a27e[_0x2a9638(0x130)]['set'](_0x1b542f['rsKRM'],_0x15d0b4),_0x52a27e['searchParams'][_0x2a9638(0x10e)](_0x1b542f[_0x2a9638(0x17f)],_0x2a9638(0x164)),_0x52a27e['searchParams']['set'](_0x1b542f['zBdKb'],_0x3706e8);_0x179e8f['resource']&&_0x52a27e[_0x2a9638(0x130)][_0x2a9638(0x10e)](_0x2a9638(0x175),_0x179e8f[_0x2a9638(0x175)]);console['log']('\x0aOpening\x20browser\x20for\x20authentication...'),console['log'](_0x2a9638(0x109)+_0x52a27e[_0x2a9638(0x15c)]()+'\x0a'),await openBrowser(_0x52a27e['toString']());const _0x5d0d6c=await waitForCallback(_0x3706e8);process['stdout'][_0x2a9638(0x187)](_0x2a9638(0x172));const _0x100d2c=new URLSearchParams({'grant_type':_0x1b542f[_0x2a9638(0x180)],'code':_0x5d0d6c,'redirect_uri':'http://localhost:'+CALLBACK_PORT+_0x2a9638(0x118),'client_id':_0x17b5b5,'code_verifier':_0x5d06c3});_0x4213b5&&_0x100d2c['set'](_0x1b542f['UrfhI'],_0x4213b5);_0x179e8f[_0x2a9638(0x175)]&&_0x100d2c[_0x2a9638(0x10e)]('resource',_0x179e8f['resource']);const _0x120a27=await fetch(_0x8497a0['token_endpoint'],{'method':_0x2a9638(0x15e),'headers':{'Content-Type':_0x1b542f[_0x2a9638(0x126)]},'body':_0x100d2c});if(!_0x120a27['ok']){const _0x2542f3=await _0x120a27['text']();throw new Error('Token\x20exchange\x20failed:\x20'+_0x2542f3);}const _0x22aa40=await _0x120a27[_0x2a9638(0x137)]();return console['log'](_0x1b542f['RgLha']),await _0x1b542f['Webvb'](saveCachedToken,_0x22aa40[_0x2a9638(0x13c)],_0x22aa40[_0x2a9638(0x147)],_0x22aa40['expires_in']),_0x22aa40['access_token'];}async function callGetCliToken(_0x49add4,_0x2afc43){const _0x21f364=_0x5d485c,_0x3f4d46={'PQsLk':function(_0x449286,_0x205f70,_0x20e762){return _0x449286(_0x205f70,_0x20e762);},'vNElj':_0x21f364(0x15e),'krDMh':'application/json','pVrrV':'application/json,\x20text/event-stream','bQCkz':_0x21f364(0x17e),'jypmp':_0x21f364(0x188),'ZXtDb':_0x21f364(0x142),'GIKzF':_0x21f364(0x11e),'RDwqk':'1.0.0','YOqOu':_0x21f364(0x124),'uzctg':'notifications/initialized','GaqXt':'Requesting\x20CLI\x20token...','iNrCO':'tools/call','abace':function(_0x2f168b,_0x2551e8){return _0x2f168b(_0x2551e8);},'XdYOS':'\x0aUnexpected\x20response\x20structure:','SARpL':'Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','oJKZx':function(_0x296893,_0x18e92f,_0x425615){return _0x296893(_0x18e92f,_0x425615);},'CMMin':function(_0x53010d,_0x14aac1,_0x4992df,_0x254a3e){return _0x53010d(_0x14aac1,_0x4992df,_0x254a3e);},'QCFeU':_0x21f364(0x12d)},_0x17aaa0={'Content-Type':_0x3f4d46['krDMh'],'Accept':_0x3f4d46[_0x21f364(0x155)]};_0x2afc43&&(_0x17aaa0['Authorization']=_0x21f364(0x186)+_0x2afc43);const _0x5cd024=async _0x52e90a=>{const _0x3f6205=_0x21f364,_0x1b3c00=await _0x3f4d46['PQsLk'](fetch,_0x49add4,{'method':_0x3f4d46['vNElj'],'headers':_0x17aaa0,'body':JSON['stringify'](_0x52e90a)});if(!_0x1b3c00['ok']){const _0x287de3=await _0x1b3c00['text']();throw new Error('HTTP\x20'+_0x1b3c00[_0x3f6205(0x157)]+':\x20'+_0x287de3);}return parseResponse(_0x1b3c00);};process[_0x21f364(0x191)][_0x21f364(0x187)](_0x3f4d46['bQCkz']);const _0xbefd6a=await _0x5cd024({'jsonrpc':_0x3f4d46['jypmp'],'id':0x1,'method':_0x3f4d46[_0x21f364(0x108)],'params':{'protocolVersion':_0x3f4d46['GIKzF'],'capabilities':{},'clientInfo':{'name':_0x21f364(0x13d),'version':_0x3f4d46[_0x21f364(0x10f)]}}});if(_0xbefd6a[_0x21f364(0x162)])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0xbefd6a['error']['message']??JSON[_0x21f364(0x16d)](_0xbefd6a[_0x21f364(0x162)])));console[_0x21f364(0x11b)](_0x3f4d46['YOqOu']),await _0x3f4d46['PQsLk'](fetch,_0x49add4,{'method':_0x21f364(0x15e),'headers':_0x17aaa0,'body':JSON[_0x21f364(0x16d)]({'jsonrpc':_0x3f4d46[_0x21f364(0x16e)],'method':_0x3f4d46['uzctg']})})['then'](_0x1e9feb=>_0x1e9feb['text']()),process['stdout']['write'](_0x3f4d46['GaqXt']);const _0x29d4d2=await _0x5cd024({'jsonrpc':_0x3f4d46['jypmp'],'id':0x2,'method':_0x3f4d46['iNrCO'],'params':{'name':_0x21f364(0x176),'arguments':{}}});if(_0x29d4d2[_0x21f364(0x162)])throw new Error(_0x21f364(0x17d)+(_0x29d4d2['error']['message']??JSON[_0x21f364(0x16d)](_0x29d4d2['error'])));console['log'](_0x3f4d46['YOqOu']);const _0x571be7=_0x3f4d46['abace'](extractToken,_0x29d4d2['result']);if(!_0x571be7){console['error'](_0x3f4d46['XdYOS']),console['error'](JSON['stringify'](_0x29d4d2['result'],null,0x2));throw new Error(_0x3f4d46[_0x21f364(0x10b)]);}const _0x5308b9=join(homedir(),'.ranger'),_0x5128a4=_0x3f4d46['oJKZx'](join,_0x5308b9,_0x21f364(0x184));await _0x3f4d46[_0x21f364(0x129)](mkdir,_0x5308b9,{'recursive':!![]}),await _0x3f4d46['CMMin'](writeFile,_0x5128a4,_0x571be7,{'mode':0x180}),await writeFile(join(_0x5308b9,'auth-origin.txt'),_0x49add4,{'mode':0x180}),console[_0x21f364(0x11b)](_0x21f364(0x143)+_0x5128a4),console[_0x21f364(0x11b)](_0x3f4d46[_0x21f364(0x14b)]);}async function fetchAuthServerMetadata(_0x19135c){const _0x54e90b=_0x5d485c,_0x55ae95=_0x19135c+'/.well-known/oauth-authorization-server',_0x488750=await fetch(_0x55ae95);if(!_0x488750['ok'])throw new Error(_0x54e90b(0x128)+_0x55ae95+':\x20'+_0x488750[_0x54e90b(0x157)]);return _0x488750[_0x54e90b(0x137)]();}function waitForCallback(_0x3334d3){const _0x2e945c=_0x5d485c,_0x325aee={'ZbfnN':function(_0x53cbf5){return _0x53cbf5();},'WRLyN':_0x2e945c(0x113),'TzBfP':function(_0xc666fd,_0x40420b){return _0xc666fd!==_0x40420b;},'yIFjM':_0x2e945c(0x174),'jievB':'code','MLslO':_0x2e945c(0x162),'sIaHg':'text/html','NPsQt':function(_0x1cc7fa,_0x32e291){return _0x1cc7fa(_0x32e291);},'orXTC':function(_0x32dba5,_0x11bb3b){return _0x32dba5(_0x11bb3b);},'WDmNO':function(_0x49cea7,_0x3b544f){return _0x49cea7!==_0x3b544f;},'XtISs':function(_0x334024,_0x3e01ab,_0x300007){return _0x334024(_0x3e01ab,_0x300007);},'JImys':function(_0x5ca3e,_0x5d8202){return _0x5ca3e(_0x5d8202);}};return new Promise((_0x52f55e,_0x38b514)=>{const _0x5a3463=_0x2e945c,_0xdf9348=()=>{const _0x1ff25f=_0x5d3d;_0x4785c3[_0x1ff25f(0x16f)](),_0x4785c3['close']();},_0x54ecbf=_0x325aee['XtISs'](setTimeout,()=>{_0x325aee['ZbfnN'](_0xdf9348),_0x38b514(new OAuthTimeoutError(_0x325aee['WRLyN']));},0x1d4c0),_0x4785c3=_0x325aee[_0x5a3463(0x15a)](createServer,(_0x20abb5,_0xffeb7d)=>{const _0x50cd33=_0x5a3463,_0x6b91ee=new URL(_0x20abb5['url']??'/','http://localhost:'+CALLBACK_PORT);if(_0x325aee[_0x50cd33(0x18e)](_0x6b91ee['pathname'],'/callback')){_0xffeb7d['writeHead'](0x194),_0xffeb7d['end'](_0x325aee['yIFjM']);return;}const _0x2bee65=_0x6b91ee[_0x50cd33(0x130)]['get'](_0x325aee[_0x50cd33(0x183)]),_0x53bdbd=_0x6b91ee[_0x50cd33(0x130)][_0x50cd33(0x10c)](_0x50cd33(0x12a)),_0x17a231=_0x6b91ee['searchParams']['get'](_0x325aee[_0x50cd33(0x182)]);if(_0x17a231){const _0x36383e=_0x6b91ee[_0x50cd33(0x130)]['get'](_0x50cd33(0x17c))??_0x17a231;_0xffeb7d[_0x50cd33(0x131)](0xc8,{'Content-Type':_0x325aee['sIaHg']}),_0xffeb7d['end'](_0x50cd33(0x16a)+_0x36383e+_0x50cd33(0x110)),_0x325aee['NPsQt'](clearTimeout,_0x54ecbf),_0xdf9348(),_0x325aee['orXTC'](_0x38b514,new Error('OAuth\x20error:\x20'+_0x36383e));return;}if(!_0x2bee65||_0x325aee['WDmNO'](_0x53bdbd,_0x3334d3)){_0xffeb7d['writeHead'](0x190,{'Content-Type':_0x325aee['sIaHg']}),_0xffeb7d[_0x50cd33(0x12f)](_0x50cd33(0x179));return;}_0xffeb7d['writeHead'](0xc8,{'Content-Type':_0x325aee[_0x50cd33(0x106)]}),_0xffeb7d[_0x50cd33(0x12f)](_0x50cd33(0x10d)),clearTimeout(_0x54ecbf),_0x325aee['ZbfnN'](_0xdf9348),_0x52f55e(_0x2bee65);});_0x4785c3['listen'](CALLBACK_PORT,_0x5a3463(0x166));});}async function openBrowser(_0x1b59b3){const _0x290a47=_0x5d485c,_0x75778d={'uZgmf':function(_0x115649,_0xc76f8){return _0x115649===_0xc76f8;},'SrqLy':'win32','eqwHB':function(_0x16c2e5,_0x18a368){return _0x16c2e5(_0x18a368);}},_0x4891d3=process[_0x290a47(0x119)]===_0x290a47(0x11a)?'open':_0x75778d[_0x290a47(0x156)](process[_0x290a47(0x119)],_0x75778d[_0x290a47(0x165)])?_0x290a47(0x153):'xdg-open';_0x75778d['eqwHB'](exec,_0x4891d3+'\x20\x22'+_0x1b59b3+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x24febf=_0x5d485c,_0x581833={'ozxsc':function(_0x1a84cb,_0x4aef65,_0x14bf96){return _0x1a84cb(_0x4aef65,_0x14bf96);},'KPylB':_0x24febf(0x145),'QhWJD':function(_0x203000,_0xeafaa9){return _0x203000>_0xeafaa9;}};try{const _0x12bd9a=JSON['parse'](await _0x581833['ozxsc'](readFile,TOKEN_CACHE_PATH,_0x581833['KPylB']));if(_0x12bd9a['origin']&&_0x12bd9a['origin']!==currentOrigin)return null;if(_0x12bd9a[_0x24febf(0x16b)]&&_0x581833[_0x24febf(0x122)](Date[_0x24febf(0x17b)](),_0x12bd9a['expiresAt']))return null;return _0x12bd9a[_0x24febf(0x154)]??null;}catch{return null;}}async function saveCachedToken(_0x510c46,_0x1da7bd,_0x146453){const _0x3c364e=_0x5d485c,_0x57a746={'MWfdr':function(_0x59fc7e){return _0x59fc7e();},'IISDY':function(_0x13d7ae,_0x344b84,_0x5d228){return _0x13d7ae(_0x344b84,_0x5d228);},'RryHt':function(_0x24d220){return _0x24d220();},'Alzar':function(_0x3cf6b7,_0x34173a,_0x2f6253,_0x1983a1){return _0x3cf6b7(_0x34173a,_0x2f6253,_0x1983a1);}},_0x10b66d=await _0x57a746['MWfdr'](loadCachedData),_0x27e3db={..._0x10b66d,'origin':currentOrigin,'accessToken':_0x510c46,'refreshToken':_0x1da7bd??_0x10b66d?.['refreshToken'],'expiresAt':_0x146453?Date['now']()+_0x146453*0x3e8:undefined};await _0x57a746[_0x3c364e(0x125)](mkdir,join(_0x57a746[_0x3c364e(0x139)](homedir),'.ranger'),{'recursive':!![]}),await _0x57a746['Alzar'](writeFile,TOKEN_CACHE_PATH,JSON[_0x3c364e(0x16d)](_0x27e3db),{'mode':0x180});}function _0x5d3d(_0x20d6d5,_0x3fb80e){_0x20d6d5=_0x20d6d5-0x105;const _0x1f41dd=_0x1f41();let _0x5d3d9e=_0x1f41dd[_0x20d6d5];return _0x5d3d9e;}async function loadCachedClient(){const _0x1d6fd4=_0x5d485c,_0x2c6e3f={'McVSO':function(_0x29b8c7){return _0x29b8c7();},'aqJrP':function(_0x6cda3f,_0x7fb3b3){return _0x6cda3f!==_0x7fb3b3;}},_0x3ae480=await _0x2c6e3f['McVSO'](loadCachedData);if(_0x3ae480?.[_0x1d6fd4(0x181)]&&_0x2c6e3f['aqJrP'](_0x3ae480['origin'],currentOrigin))return null;return _0x3ae480?.[_0x1d6fd4(0x127)]?{'clientId':_0x3ae480[_0x1d6fd4(0x127)],'clientSecret':_0x3ae480[_0x1d6fd4(0x151)]}:null;}async function clearCachedClient(){const _0x9ca094=_0x5d485c,_0x2cf3e2={'QuvnO':function(_0x346a75){return _0x346a75();},'LmBdA':function(_0x592e0a,_0x4948c8,_0x57dfda,_0x4ed37e){return _0x592e0a(_0x4948c8,_0x57dfda,_0x4ed37e);}},_0x3c780c=await _0x2cf3e2[_0x9ca094(0x13a)](loadCachedData);if(!_0x3c780c)return;const {clientId:_0x2888e1,clientSecret:_0x1f3c4b,..._0x18c07e}=_0x3c780c;await _0x2cf3e2['LmBdA'](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x18c07e),{'mode':0x180});}async function saveCachedClient(_0x5179e3,_0x4f58e0){const _0x195bd3=_0x5d485c,_0x6c43e5={'IWAam':function(_0xe2ea8){return _0xe2ea8();}},_0x3dc3b4=await _0x6c43e5['IWAam'](loadCachedData),_0x457c95={..._0x3dc3b4,'origin':currentOrigin,'accessToken':_0x3dc3b4?.['accessToken']??'','clientId':_0x5179e3,'clientSecret':_0x4f58e0};await mkdir(join(_0x6c43e5[_0x195bd3(0x189)](homedir),_0x195bd3(0x135)),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x195bd3(0x16d)](_0x457c95),{'mode':0x180});}async function loadCachedData(){const _0x13ce47=_0x5d485c,_0x2f0160={'YvhQO':function(_0x3ecc5b,_0x440129,_0x35baa3){return _0x3ecc5b(_0x440129,_0x35baa3);}};try{return JSON['parse'](await _0x2f0160['YvhQO'](readFile,TOKEN_CACHE_PATH,_0x13ce47(0x145)));}catch{return null;}}async function parseResponse(_0x221ffa){const _0x6cb6d=_0x5d485c,_0x597daa={'KXwwC':_0x6cb6d(0x149),'ArvRS':'data:','twPGX':_0x6cb6d(0x152)},_0x2932e5=_0x221ffa[_0x6cb6d(0x18b)][_0x6cb6d(0x10c)](_0x597daa['KXwwC'])??'';if(_0x2932e5[_0x6cb6d(0x117)]('text/event-stream')){const _0x3c2baa=await _0x221ffa['text']();for(const _0x277fdd of _0x3c2baa[_0x6cb6d(0x171)]('\x0a')){const _0x2713a5=_0x277fdd['trim']();if(_0x2713a5[_0x6cb6d(0x168)](_0x597daa[_0x6cb6d(0x115)])){const _0x1df05c=_0x2713a5[_0x6cb6d(0x111)](_0x6cb6d(0x132)['length'])['trim']();if(!_0x1df05c)continue;try{const _0x4e01ff=JSON[_0x6cb6d(0x12c)](_0x1df05c);if(_0x4e01ff['id']!==undefined||_0x4e01ff[_0x6cb6d(0x162)])return _0x4e01ff;}catch{}}}throw new Error(_0x597daa['twPGX']);}return _0x221ffa[_0x6cb6d(0x137)]();}function extractToken(_0x35a61d){const _0x1e032f=_0x5d485c,_0x3500f1={'HgMZm':function(_0x199cef,_0x38af6a){return _0x199cef===_0x38af6a;},'nzTvW':'Unknown\x20error','XoBLs':_0x1e032f(0x173),'ncPTw':_0x1e032f(0x193)};if(!_0x35a61d)return null;const _0x291a1a=_0x35a61d['structuredContent'];if(_0x291a1a?.[_0x1e032f(0x14c)]&&_0x3500f1[_0x1e032f(0x161)](typeof _0x291a1a[_0x1e032f(0x14c)],'string'))return _0x291a1a[_0x1e032f(0x14c)];if(_0x35a61d[_0x1e032f(0x18d)]){const _0x3a8136=_0x35a61d[_0x1e032f(0x14e)];throw new Error(_0x1e032f(0x14f)+(_0x3a8136?.[0x0]?.[_0x1e032f(0x173)]??_0x3500f1['nzTvW']));}const _0x4e9991=_0x35a61d[_0x1e032f(0x14e)];if(_0x4e9991)for(const _0xb7764c of _0x4e9991){if(_0xb7764c['type']===_0x3500f1[_0x1e032f(0x192)]&&_0xb7764c['text']){try{const _0x3e3beb=JSON['parse'](_0xb7764c['text']);if(_0x3500f1[_0x1e032f(0x161)](typeof _0x3e3beb?.[_0x1e032f(0x14c)],_0x3500f1['ncPTw']))return _0x3e3beb['token'];}catch{}const _0x3cb23f=_0xb7764c['text'][_0x1e032f(0x112)](/(rngr_[A-Za-z0-9_-]+)/);if(_0x3cb23f)return _0x3cb23f[0x1];}}return null;}
1
+ const _0x3ab8d0=_0x29e4;(function(_0xb16e25,_0x14dd5d){const _0x1058d7=_0x29e4,_0x545d07=_0xb16e25();while(!![]){try{const _0x15884a=parseInt(_0x1058d7(0x266))/0x1+parseInt(_0x1058d7(0x284))/0x2+-parseInt(_0x1058d7(0x217))/0x3+-parseInt(_0x1058d7(0x1ff))/0x4*(-parseInt(_0x1058d7(0x250))/0x5)+-parseInt(_0x1058d7(0x21e))/0x6*(parseInt(_0x1058d7(0x255))/0x7)+parseInt(_0x1058d7(0x23e))/0x8*(-parseInt(_0x1058d7(0x1fd))/0x9)+-parseInt(_0x1058d7(0x1f7))/0xa;if(_0x15884a===_0x14dd5d)break;else _0x545d07['push'](_0x545d07['shift']());}catch(_0x770a9b){_0x545d07['push'](_0x545d07['shift']());}}}(_0x708d,0x35eca));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';function _0x708d(){const _0x48625d=['accessToken','Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20','Server\x20returned\x20error:\x20','auth-origin.txt','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','xdg-open','bKOAy','content-type','Not\x20found','end','set','2365GpZnjf','http://localhost:','MMUUA','YeCUj','mszVR','63rTpoMd','UlKwo','open','2.0','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','IpVEn','write','text/event-stream','error_description','text','expiresAt','expires_in','Discovering\x20authorization\x20server...','log','Wqbsf','mmRpr','token','394466XxJdeF','token_endpoint','Registering\x20OAuth\x20client...','xOuBS','eKqtX','sahKT','now','state','client_secret','registration_endpoint','proxied','pathname','isError','Fdhyi','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','BOPFw','initialize','\x0aOpening\x20browser\x20for\x20authentication...','/.well-known/oauth-protected-resource','Unknown\x20error','data:','/.well-known/oauth-authorization-server','application/x-www-form-urlencoded','searchParams','status','json','MGOdW','update','code_challenge_method','authorization_servers','768220XStbEb','access_token','code_challenge','cTOiH','startsWith','Asbvi','clientId','application/json','YScWh','code','2262890tivqIH','OAuthTimeoutError','WHJEM','VTLcb','/callback','client_id','134910JcfCbr','MLNLp','2316tCxhJM','toString','DtqWZ','Ranger\x20CLI','origin','CIrXM','ranger-cli','QyvgC','GmpGj','win32','lOfEH','isTTY','yzPoI','eOPgC','stdout','result','QIRto','DCarW','EANrm','start','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','mcp-oauth-tokens.json','writeHead','authorization_endpoint','126228AGJUNh','\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','nbokd','CyKMk','NGFlk','ClGdI','platform','245556lHKUky','utf-8','RSryl','psdnS','hex','topVn','glFIr','tools/call','get_cli_token\x20failed:\x20','YonOj','parse','.ranger','application/json,\x20text/event-stream','length','IeXVs','POST','then','ngTbG','<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','\x20done','refresh_token','zOUmM','base64url','get','RmSvd','refreshToken','wjENN','oWKKZ','xzUWC','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','stringify','\x0aUnexpected\x20response\x20structure:','104uzSNgT','resource','type','error','clientSecret','DQXGh','Zbdhi'];_0x708d=function(){return _0x48625d;};return _0x708d();}const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger',_0x3ab8d0(0x214)),AUTH_ORIGIN_PATH=join(homedir(),'.ranger',_0x3ab8d0(0x248));export async function getMcpAuthOrigin(){const _0x43439d=_0x3ab8d0,_0x2decd2={'ngTbG':function(_0x527d53,_0x525ecb,_0x245182){return _0x527d53(_0x525ecb,_0x245182);},'cuIYn':function(_0x613fb3,_0x61fd36){return _0x613fb3||_0x61fd36;}};try{const _0x3204de=(await _0x2decd2[_0x43439d(0x22f)](readFile,AUTH_ORIGIN_PATH,_0x43439d(0x21f)))['trim']();return _0x2decd2['cuIYn'](_0x3204de,null);}catch{return null;}}export async function mcpBootstrap(){const _0x47676f=_0x3ab8d0,_0x414ef8={'YXtWR':_0x47676f(0x270),'BOPFw':function(_0x1c915e){return _0x1c915e();},'MLNLp':function(_0x5819f5,_0x34e34a){return _0x5819f5+_0x34e34a;},'eKqtX':'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','mmRpr':function(_0x471288,_0x1a8567){return _0x471288(_0x1a8567);},'cOqpe':function(_0x16635a,_0x17ddf1,_0x5f473c){return _0x16635a(_0x17ddf1,_0x5f473c);}},_0x44c195=getMcpAuthUrl();currentOrigin=_0x44c195;const _0x5312c2=process[_0x47676f(0x20d)][_0x47676f(0x20a)]??![];console[_0x47676f(0x262)]('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x44c195+'\x0a');const _0x52d046=await tryUnauthenticated(_0x44c195);let _0x1f31d1=null;if(_0x52d046===_0x414ef8['YXtWR'])_0x1f31d1='';else{_0x1f31d1=await _0x414ef8[_0x47676f(0x275)](loadCachedToken);if(!_0x1f31d1){if(!_0x5312c2)throw new Error(_0x414ef8[_0x47676f(0x1fe)]('MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a',_0x414ef8[_0x47676f(0x26a)]));_0x1f31d1=await _0x414ef8[_0x47676f(0x264)](oauthFlow,_0x44c195);}}await _0x414ef8['cOqpe'](callGetCliToken,_0x44c195,_0x1f31d1);}async function tryUnauthenticated(_0x447116){const _0x2aabea=_0x3ab8d0,_0x4a6e4d={'jzrqD':function(_0x316da2,_0x5d6889,_0x4c1067){return _0x316da2(_0x5d6889,_0x4c1067);},'Asbvi':_0x2aabea(0x22d),'oWKKZ':_0x2aabea(0x22a)},_0xa1302=await _0x4a6e4d['jzrqD'](fetch,_0x447116,{'method':_0x4a6e4d[_0x2aabea(0x1f2)],'headers':{'Content-Type':'application/json','Accept':_0x4a6e4d[_0x2aabea(0x239)]},'body':JSON['stringify']({'jsonrpc':_0x2aabea(0x258),'id':0x1,'method':_0x2aabea(0x276),'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x2aabea(0x205),'version':'1.0.0'}}})});if(_0xa1302['ok'])return await _0xa1302[_0x2aabea(0x25e)](),_0x2aabea(0x270);if(_0xa1302[_0x2aabea(0x27e)]===0x191)return await _0xa1302[_0x2aabea(0x25e)](),'needs-oauth';const _0x545231=await _0xa1302[_0x2aabea(0x25e)]();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0xa1302['status']+':\x20'+_0x545231);}class OAuthTimeoutError extends Error{constructor(_0x352dcc){const _0x405d63=_0x3ab8d0;super(_0x352dcc),this['name']=_0x405d63(0x1f8);}}async function oauthFlow(_0x467271){const _0x1dc37a=_0x3ab8d0,_0x200b48={'WHJEM':function(_0x620f74,_0x1b4b3e){return _0x620f74(_0x1b4b3e);},'QIRto':function(_0x438ab8,_0x20c3ac){return _0x438ab8 instanceof _0x20c3ac;},'YjXLj':function(_0x38ec16){return _0x38ec16();}};try{return await _0x200b48[_0x1dc37a(0x1f9)](oauthFlowAttempt,_0x467271);}catch(_0x32af9a){if(_0x200b48[_0x1dc37a(0x20f)](_0x32af9a,OAuthTimeoutError)&&await loadCachedClient())return console['log'](_0x1dc37a(0x218)),await _0x200b48['YjXLj'](clearCachedClient),await _0x200b48[_0x1dc37a(0x1f9)](oauthFlowAttempt,_0x467271);throw _0x32af9a;}}async function oauthFlowAttempt(_0x1901aa){const _0xe72ace=_0x3ab8d0,_0x2dbf86={'ImjSw':function(_0xf5acad,_0x2a52f4){return _0xf5acad(_0x2a52f4);},'uXgFr':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','RmSvd':'No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','GmpGj':function(_0x1ab6a2){return _0x1ab6a2();},'UlKwo':_0xe72ace(0x268),'LPkhB':'POST','CIrXM':'authorization_code','zOUmM':_0xe72ace(0x1f6),'mszVR':'none','xOuBS':_0xe72ace(0x231),'cTOiH':_0xe72ace(0x23b),'YonOj':'base64url','sahKT':'sha256','XOGBL':_0xe72ace(0x282),'YScWh':'S256','CeqWK':_0xe72ace(0x277),'SmufX':function(_0xbfbe69,_0xa87577){return _0xbfbe69(_0xa87577);},'qOfAY':_0xe72ace(0x26e),'HJvGt':function(_0x1e78a3,_0x2b6d28,_0x3eb613){return _0x1e78a3(_0x2b6d28,_0x3eb613);},'TspYJ':_0xe72ace(0x27c)},_0x367ed8=_0x1901aa['replace'](/\/mcp$/,'');process[_0xe72ace(0x20d)]['write'](_0xe72ace(0x261));const _0xacdf31=await _0x2dbf86['ImjSw'](fetch,_0x367ed8+_0xe72ace(0x278));if(!_0xacdf31['ok'])throw new Error(_0x2dbf86['uXgFr']);const _0x561d5f=await _0xacdf31[_0xe72ace(0x27f)](),_0x16fd5c=_0x561d5f[_0xe72ace(0x283)]?.[0x0];if(!_0x16fd5c)throw new Error(_0x2dbf86[_0xe72ace(0x236)]);console['log']('\x20'+_0x16fd5c);const _0x28e546=await fetchAuthServerMetadata(_0x16fd5c);let _0x262491,_0x3a422b;const _0x4c467f=await _0x2dbf86[_0xe72ace(0x207)](loadCachedClient);if(_0x4c467f)_0x262491=_0x4c467f['clientId'],_0x3a422b=_0x4c467f['clientSecret'];else{if(_0x28e546[_0xe72ace(0x26f)]){process[_0xe72ace(0x20d)]['write'](_0x2dbf86[_0xe72ace(0x256)]);const _0x573d4d=await fetch(_0x28e546['registration_endpoint'],{'method':_0x2dbf86['LPkhB'],'headers':{'Content-Type':_0xe72ace(0x1f4)},'body':JSON['stringify']({'client_name':_0xe72ace(0x202),'redirect_uris':[_0xe72ace(0x251)+CALLBACK_PORT+_0xe72ace(0x1fb)],'grant_types':[_0x2dbf86[_0xe72ace(0x204)],'refresh_token'],'response_types':[_0x2dbf86[_0xe72ace(0x233)]],'token_endpoint_auth_method':_0x2dbf86[_0xe72ace(0x254)]})});if(!_0x573d4d['ok']){const _0x49c31b=await _0x573d4d['text']();throw new Error('Client\x20registration\x20failed:\x20'+_0x49c31b);}const _0x485428=await _0x573d4d[_0xe72ace(0x27f)]();_0x262491=_0x485428[_0xe72ace(0x1fc)],_0x3a422b=_0x485428['client_secret'],await saveCachedClient(_0x262491,_0x3a422b),console['log'](_0x2dbf86[_0xe72ace(0x269)]);}else throw new Error(_0x2dbf86[_0xe72ace(0x1f0)]);}const _0x2e001a=randomBytes(0x20)['toString'](_0x2dbf86[_0xe72ace(0x227)]),_0x3e0292=createHash(_0x2dbf86[_0xe72ace(0x26b)])[_0xe72ace(0x281)](_0x2e001a)['digest'](_0xe72ace(0x234)),_0x37fb20=randomBytes(0x10)['toString'](_0xe72ace(0x222)),_0xc55c8d=new URL(_0x28e546[_0xe72ace(0x216)]);_0xc55c8d['searchParams']['set']('response_type','code'),_0xc55c8d[_0xe72ace(0x27d)][_0xe72ace(0x24f)](_0xe72ace(0x1fc),_0x262491),_0xc55c8d[_0xe72ace(0x27d)][_0xe72ace(0x24f)]('redirect_uri','http://localhost:'+CALLBACK_PORT+'/callback'),_0xc55c8d['searchParams'][_0xe72ace(0x24f)](_0xe72ace(0x1ef),_0x3e0292),_0xc55c8d['searchParams']['set'](_0x2dbf86['XOGBL'],_0x2dbf86[_0xe72ace(0x1f5)]),_0xc55c8d[_0xe72ace(0x27d)][_0xe72ace(0x24f)]('state',_0x37fb20);_0x561d5f['resource']&&_0xc55c8d['searchParams'][_0xe72ace(0x24f)]('resource',_0x561d5f[_0xe72ace(0x23f)]);console['log'](_0x2dbf86['CeqWK']),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0xc55c8d[_0xe72ace(0x200)]()+'\x0a'),await _0x2dbf86['ImjSw'](openBrowser,_0xc55c8d[_0xe72ace(0x200)]());const _0x2cfde8=await _0x2dbf86['SmufX'](waitForCallback,_0x37fb20);process['stdout']['write']('Exchanging\x20authorization\x20code...');const _0x4d4e97=new URLSearchParams({'grant_type':_0x2dbf86[_0xe72ace(0x204)],'code':_0x2cfde8,'redirect_uri':'http://localhost:'+CALLBACK_PORT+_0xe72ace(0x1fb),'client_id':_0x262491,'code_verifier':_0x2e001a});_0x3a422b&&_0x4d4e97[_0xe72ace(0x24f)](_0x2dbf86['qOfAY'],_0x3a422b);_0x561d5f[_0xe72ace(0x23f)]&&_0x4d4e97['set'](_0xe72ace(0x23f),_0x561d5f[_0xe72ace(0x23f)]);const _0x365293=await _0x2dbf86['HJvGt'](fetch,_0x28e546[_0xe72ace(0x267)],{'method':_0x2dbf86['LPkhB'],'headers':{'Content-Type':_0x2dbf86['TspYJ']},'body':_0x4d4e97});if(!_0x365293['ok']){const _0x393097=await _0x365293['text']();throw new Error('Token\x20exchange\x20failed:\x20'+_0x393097);}const _0x20ccb8=await _0x365293['json']();return console['log'](_0x2dbf86['xOuBS']),await saveCachedToken(_0x20ccb8[_0xe72ace(0x1ee)],_0x20ccb8[_0xe72ace(0x232)],_0x20ccb8[_0xe72ace(0x260)]),_0x20ccb8[_0xe72ace(0x1ee)];}async function callGetCliToken(_0x64c6a6,_0x433356){const _0x4087af=_0x3ab8d0,_0x28c410={'DCarW':function(_0x178ce8,_0x339aa5,_0x4d1149){return _0x178ce8(_0x339aa5,_0x4d1149);},'WxEwx':'POST','wjENN':function(_0x286d43,_0x24c78e){return _0x286d43(_0x24c78e);},'Wqbsf':'Initializing\x20MCP\x20session...','GfOvR':'2025-03-26','RAUdE':'notifications/initialized','VTLcb':'Requesting\x20CLI\x20token...','ljsid':function(_0x567ff3,_0x5a532d){return _0x567ff3(_0x5a532d);},'OcVZx':'2.0','EANrm':_0x4087af(0x225),'eOPgC':'get_cli_token','sTzaT':'\x20done','NGFlk':_0x4087af(0x23d),'FnBej':_0x4087af(0x213),'yzPoI':'refresh.txt','OOSSv':function(_0x4a5144,_0x3def38,_0x262960){return _0x4a5144(_0x3def38,_0x262960);},'CyKMk':'Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a'},_0x2943f3={'Content-Type':_0x4087af(0x1f4),'Accept':_0x4087af(0x22a)};_0x433356&&(_0x2943f3['Authorization']='Bearer\x20'+_0x433356);const _0x182944=async _0x1e611e=>{const _0x1a1e63=_0x4087af,_0x1cd5b2=await _0x28c410[_0x1a1e63(0x210)](fetch,_0x64c6a6,{'method':_0x28c410['WxEwx'],'headers':_0x2943f3,'body':JSON['stringify'](_0x1e611e)});if(!_0x1cd5b2['ok']){const _0x1d44ad=await _0x1cd5b2['text']();throw new Error('HTTP\x20'+_0x1cd5b2['status']+':\x20'+_0x1d44ad);}return _0x28c410[_0x1a1e63(0x238)](parseResponse,_0x1cd5b2);};process[_0x4087af(0x20d)]['write'](_0x28c410[_0x4087af(0x263)]);const _0x3ea027=await _0x182944({'jsonrpc':_0x4087af(0x258),'id':0x1,'method':'initialize','params':{'protocolVersion':_0x28c410['GfOvR'],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':'1.0.0'}}});if(_0x3ea027[_0x4087af(0x241)])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x3ea027[_0x4087af(0x241)]['message']??JSON[_0x4087af(0x23c)](_0x3ea027['error'])));console['log'](_0x4087af(0x231)),await _0x28c410['DCarW'](fetch,_0x64c6a6,{'method':_0x4087af(0x22d),'headers':_0x2943f3,'body':JSON['stringify']({'jsonrpc':'2.0','method':_0x28c410['RAUdE']})})[_0x4087af(0x22e)](_0x518833=>_0x518833['text']()),process[_0x4087af(0x20d)][_0x4087af(0x25b)](_0x28c410[_0x4087af(0x1fa)]);const _0x23549=await _0x28c410['ljsid'](_0x182944,{'jsonrpc':_0x28c410['OcVZx'],'id':0x2,'method':_0x28c410[_0x4087af(0x211)],'params':{'name':_0x28c410[_0x4087af(0x20c)],'arguments':{}}});if(_0x23549[_0x4087af(0x241)])throw new Error(_0x4087af(0x226)+(_0x23549['error']['message']??JSON['stringify'](_0x23549[_0x4087af(0x241)])));console['log'](_0x28c410['sTzaT']);const _0x4cef8f=_0x28c410['ljsid'](extractToken,_0x23549[_0x4087af(0x20e)]);if(!_0x4cef8f){console['error'](_0x28c410[_0x4087af(0x21b)]),console[_0x4087af(0x241)](JSON[_0x4087af(0x23c)](_0x23549['result'],null,0x2));throw new Error(_0x28c410['FnBej']);}const _0x312692=join(homedir(),'.ranger'),_0x3e0c76=join(_0x312692,_0x28c410[_0x4087af(0x20b)]);await _0x28c410['OOSSv'](mkdir,_0x312692,{'recursive':!![]}),await writeFile(_0x3e0c76,_0x4cef8f,{'mode':0x180}),await writeFile(join(_0x312692,_0x4087af(0x248)),_0x64c6a6,{'mode':0x180}),console[_0x4087af(0x262)]('\x0aToken\x20written\x20to\x20'+_0x3e0c76),console[_0x4087af(0x262)](_0x28c410[_0x4087af(0x21a)]);}async function fetchAuthServerMetadata(_0x3939a5){const _0xadf8b4=_0x3ab8d0,_0x34d141=_0x3939a5+_0xadf8b4(0x27b),_0x171498=await fetch(_0x34d141);if(!_0x171498['ok'])throw new Error(_0xadf8b4(0x246)+_0x34d141+':\x20'+_0x171498['status']);return _0x171498[_0xadf8b4(0x27f)]();}function waitForCallback(_0x261eb5){const _0x488d51=_0x3ab8d0,_0x4c071d={'nFXKj':function(_0x11a44d,_0x546695){return _0x11a44d!==_0x546695;},'Mxnkl':_0x488d51(0x1f6),'wbGVb':_0x488d51(0x26d),'xzUWC':_0x488d51(0x25d),'topVn':'text/html','CLCsq':function(_0x38c1a4,_0x452dfa){return _0x38c1a4(_0x452dfa);},'nbokd':_0x488d51(0x230),'ClGdI':function(_0x2de70e){return _0x2de70e();},'UktJc':function(_0x3f491e,_0x5e84ba,_0x1efcb2){return _0x3f491e(_0x5e84ba,_0x1efcb2);}};return new Promise((_0x342b5e,_0x484be0)=>{const _0x135102={'bKOAy':function(_0x59b0b7){return _0x59b0b7();}},_0x1854e4=()=>{_0x4ca5e5['closeAllConnections'](),_0x4ca5e5['close']();},_0x7d8dc2=_0x4c071d['UktJc'](setTimeout,()=>{const _0x2bdcdf=_0x29e4;_0x135102[_0x2bdcdf(0x24b)](_0x1854e4),_0x484be0(new OAuthTimeoutError('OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes'));},0x1d4c0),_0x4ca5e5=createServer((_0x1972b1,_0x1c96aa)=>{const _0x4ac325=_0x29e4,_0x596847=new URL(_0x1972b1['url']??'/','http://localhost:'+CALLBACK_PORT);if(_0x4c071d['nFXKj'](_0x596847[_0x4ac325(0x271)],'/callback')){_0x1c96aa['writeHead'](0x194),_0x1c96aa['end'](_0x4ac325(0x24d));return;}const _0x4b0887=_0x596847[_0x4ac325(0x27d)]['get'](_0x4c071d['Mxnkl']),_0x1a3960=_0x596847['searchParams'][_0x4ac325(0x235)](_0x4c071d['wbGVb']),_0x21c35a=_0x596847['searchParams']['get'](_0x4ac325(0x241));if(_0x21c35a){const _0x38ee5a=_0x596847[_0x4ac325(0x27d)]['get'](_0x4c071d[_0x4ac325(0x23a)])??_0x21c35a;_0x1c96aa['writeHead'](0xc8,{'Content-Type':_0x4c071d['topVn']}),_0x1c96aa[_0x4ac325(0x24e)]('<html><body><h2>Authentication\x20failed</h2><p>'+_0x38ee5a+_0x4ac325(0x274)),_0x4c071d['CLCsq'](clearTimeout,_0x7d8dc2),_0x1854e4(),_0x484be0(new Error('OAuth\x20error:\x20'+_0x38ee5a));return;}if(!_0x4b0887||_0x4c071d['nFXKj'](_0x1a3960,_0x261eb5)){_0x1c96aa[_0x4ac325(0x215)](0x190,{'Content-Type':_0x4c071d[_0x4ac325(0x223)]}),_0x1c96aa[_0x4ac325(0x24e)](_0x4c071d[_0x4ac325(0x219)]);return;}_0x1c96aa[_0x4ac325(0x215)](0xc8,{'Content-Type':'text/html'}),_0x1c96aa['end'](_0x4ac325(0x249)),clearTimeout(_0x7d8dc2),_0x4c071d[_0x4ac325(0x21c)](_0x1854e4),_0x4c071d['CLCsq'](_0x342b5e,_0x4b0887);});_0x4ca5e5['listen'](CALLBACK_PORT,'127.0.0.1');});}async function openBrowser(_0x173dfc){const _0x2ee351=_0x3ab8d0,_0x5d0571={'RSryl':function(_0x35af0d,_0x274c68){return _0x35af0d===_0x274c68;},'Zbdhi':_0x2ee351(0x208),'IeXVs':_0x2ee351(0x212),'MMUUA':_0x2ee351(0x24a)},_0x555310=_0x5d0571[_0x2ee351(0x220)](process[_0x2ee351(0x21d)],'darwin')?_0x2ee351(0x257):_0x5d0571[_0x2ee351(0x220)](process['platform'],_0x5d0571[_0x2ee351(0x244)])?_0x5d0571[_0x2ee351(0x22c)]:_0x5d0571[_0x2ee351(0x252)];exec(_0x555310+'\x20\x22'+_0x173dfc+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x33c5bc=_0x3ab8d0,_0x4cacb3={'ylnLy':_0x33c5bc(0x21f)};try{const _0x540067=JSON[_0x33c5bc(0x228)](await readFile(TOKEN_CACHE_PATH,_0x4cacb3['ylnLy']));if(_0x540067['origin']&&_0x540067[_0x33c5bc(0x203)]!==currentOrigin)return null;if(_0x540067[_0x33c5bc(0x25f)]&&Date[_0x33c5bc(0x26c)]()>_0x540067[_0x33c5bc(0x25f)])return null;return _0x540067[_0x33c5bc(0x245)]??null;}catch{return null;}}function _0x29e4(_0x5c8017,_0xeaac59){_0x5c8017=_0x5c8017-0x1ee;const _0x708d65=_0x708d();let _0x29e4fb=_0x708d65[_0x5c8017];return _0x29e4fb;}async function saveCachedToken(_0x5c0dc1,_0x18aa9d,_0x416b15){const _0x50c1c2=_0x3ab8d0,_0x3331be={'MGOdW':function(_0x4db5fe){return _0x4db5fe();},'ZdHFR':function(_0x2433b7,_0xe6fb2a){return _0x2433b7*_0xe6fb2a;},'opfpI':function(_0x130fcf,_0x99761,_0x519594){return _0x130fcf(_0x99761,_0x519594);},'VYfJE':_0x50c1c2(0x229),'psdnS':function(_0x5dc94d,_0x53289b,_0x115503,_0x1ef109){return _0x5dc94d(_0x53289b,_0x115503,_0x1ef109);}},_0x6519dc=await _0x3331be[_0x50c1c2(0x280)](loadCachedData),_0x83089f={..._0x6519dc,'origin':currentOrigin,'accessToken':_0x5c0dc1,'refreshToken':_0x18aa9d??_0x6519dc?.[_0x50c1c2(0x237)],'expiresAt':_0x416b15?Date['now']()+_0x3331be['ZdHFR'](_0x416b15,0x3e8):undefined};await mkdir(_0x3331be['opfpI'](join,homedir(),_0x3331be['VYfJE']),{'recursive':!![]}),await _0x3331be[_0x50c1c2(0x221)](writeFile,TOKEN_CACHE_PATH,JSON[_0x50c1c2(0x23c)](_0x83089f),{'mode':0x180});}async function loadCachedClient(){const _0x952117=_0x3ab8d0,_0x5947a2={'iFbQB':function(_0x270df1){return _0x270df1();}},_0xafa5bf=await _0x5947a2['iFbQB'](loadCachedData);if(_0xafa5bf?.['origin']&&_0xafa5bf['origin']!==currentOrigin)return null;return _0xafa5bf?.['clientId']?{'clientId':_0xafa5bf[_0x952117(0x1f3)],'clientSecret':_0xafa5bf[_0x952117(0x242)]}:null;}async function clearCachedClient(){const _0x17ad18=_0x3ab8d0,_0x43f63={'kGGuC':function(_0x524c12){return _0x524c12();},'lOfEH':function(_0x21e8ff,_0x427e46,_0x309d45,_0x109be7){return _0x21e8ff(_0x427e46,_0x309d45,_0x109be7);}},_0x32b69f=await _0x43f63['kGGuC'](loadCachedData);if(!_0x32b69f)return;const {clientId:_0x1dbf1e,clientSecret:_0x1b0122,..._0x1d5dc6}=_0x32b69f;await _0x43f63[_0x17ad18(0x209)](writeFile,TOKEN_CACHE_PATH,JSON[_0x17ad18(0x23c)](_0x1d5dc6),{'mode':0x180});}async function saveCachedClient(_0x48f921,_0x336cd2){const _0x16949f=_0x3ab8d0,_0x527662={'DxHBP':function(_0x50ebef){return _0x50ebef();},'VgWUA':function(_0x4e2f23,_0x128e0e,_0x40e4ef){return _0x4e2f23(_0x128e0e,_0x40e4ef);},'glFIr':function(_0x3800ac){return _0x3800ac();}},_0x3e27b9=await _0x527662['DxHBP'](loadCachedData),_0x53623c={..._0x3e27b9,'origin':currentOrigin,'accessToken':_0x3e27b9?.[_0x16949f(0x245)]??'','clientId':_0x48f921,'clientSecret':_0x336cd2};await mkdir(_0x527662['VgWUA'](join,_0x527662[_0x16949f(0x224)](homedir),_0x16949f(0x229)),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x53623c),{'mode':0x180});}async function loadCachedData(){const _0x4f2fc2=_0x3ab8d0,_0x3b4d20={'IpVEn':function(_0x5ca07e,_0x1987cb,_0x1c5f73){return _0x5ca07e(_0x1987cb,_0x1c5f73);}};try{return JSON[_0x4f2fc2(0x228)](await _0x3b4d20[_0x4f2fc2(0x25a)](readFile,TOKEN_CACHE_PATH,'utf-8'));}catch{return null;}}async function parseResponse(_0x499afa){const _0x1fc149=_0x3ab8d0,_0x1ca8a3={'DtqWZ':_0x1fc149(0x24c),'HzBlD':_0x1fc149(0x25c),'Fdhyi':_0x1fc149(0x27a),'KmXkt':function(_0x863b0f,_0x479e4c){return _0x863b0f!==_0x479e4c;},'DQXGh':_0x1fc149(0x259)},_0x579475=_0x499afa['headers']['get'](_0x1ca8a3[_0x1fc149(0x201)])??'';if(_0x579475['includes'](_0x1ca8a3['HzBlD'])){const _0xa4dc2f=await _0x499afa[_0x1fc149(0x25e)]();for(const _0x578fd8 of _0xa4dc2f['split']('\x0a')){const _0xe11c5c=_0x578fd8['trim']();if(_0xe11c5c[_0x1fc149(0x1f1)](_0x1ca8a3[_0x1fc149(0x273)])){const _0x3c0be1=_0xe11c5c['slice'](_0x1ca8a3[_0x1fc149(0x273)][_0x1fc149(0x22b)])['trim']();if(!_0x3c0be1)continue;try{const _0x3c8582=JSON[_0x1fc149(0x228)](_0x3c0be1);if(_0x1ca8a3['KmXkt'](_0x3c8582['id'],undefined)||_0x3c8582['error'])return _0x3c8582;}catch{}}}throw new Error(_0x1ca8a3[_0x1fc149(0x243)]);}return _0x499afa['json']();}function extractToken(_0x57c24b){const _0x1507fb=_0x3ab8d0,_0x1f941f={'QyvgC':function(_0x35e239,_0x1f8175){return _0x35e239===_0x1f8175;},'YeCUj':'string'};if(!_0x57c24b)return null;const _0xfacb1a=_0x57c24b['structuredContent'];if(_0xfacb1a?.['token']&&_0x1f941f['QyvgC'](typeof _0xfacb1a[_0x1507fb(0x265)],_0x1f941f[_0x1507fb(0x253)]))return _0xfacb1a['token'];if(_0x57c24b[_0x1507fb(0x272)]){const _0x2c7c74=_0x57c24b['content'];throw new Error(_0x1507fb(0x247)+(_0x2c7c74?.[0x0]?.[_0x1507fb(0x25e)]??_0x1507fb(0x279)));}const _0x22a887=_0x57c24b['content'];if(_0x22a887)for(const _0x57b257 of _0x22a887){if(_0x57b257[_0x1507fb(0x240)]==='text'&&_0x57b257[_0x1507fb(0x25e)]){try{const _0x120e32=JSON[_0x1507fb(0x228)](_0x57b257[_0x1507fb(0x25e)]);if(_0x1f941f[_0x1507fb(0x206)](typeof _0x120e32?.[_0x1507fb(0x265)],_0x1f941f[_0x1507fb(0x253)]))return _0x120e32['token'];}catch{}const _0xaafd9e=_0x57b257['text']['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0xaafd9e)return _0xaafd9e[0x1];}}return null;}
@@ -1 +1 @@
1
- function _0x992f(_0x155d59,_0x355bf6){_0x155d59=_0x155d59-0xe0;var _0x27450b=_0x2745();var _0x992fc7=_0x27450b[_0x155d59];return _0x992fc7;}(function(_0x555003,_0x1f9a0e){var _0x578af4=_0x992f,_0x55006d=_0x555003();while(!![]){try{var _0x5cb63f=-parseInt(_0x578af4(0xe6))/0x1+parseInt(_0x578af4(0xf4))/0x2*(-parseInt(_0x578af4(0xf2))/0x3)+-parseInt(_0x578af4(0xe3))/0x4*(-parseInt(_0x578af4(0xe4))/0x5)+parseInt(_0x578af4(0xec))/0x6*(parseInt(_0x578af4(0xf0))/0x7)+-parseInt(_0x578af4(0xeb))/0x8*(parseInt(_0x578af4(0xe8))/0x9)+parseInt(_0x578af4(0xf1))/0xa*(parseInt(_0x578af4(0xee))/0xb)+parseInt(_0x578af4(0xe7))/0xc*(-parseInt(_0x578af4(0xef))/0xd);if(_0x5cb63f===_0x1f9a0e)break;else _0x55006d['push'](_0x55006d['shift']());}catch(_0x2accda){_0x55006d['push'](_0x55006d['shift']());}}}(_0x2745,0x6e20c));export async function migrateProfile(_0x4cead4,_0x67c9f8){var _0x457fa5=_0x992f,_0x57e3cd={'AMCIz':function(_0x456995,_0x3d37ee){return _0x456995+_0x3d37ee;},'yALpn':function(_0x5297ac,_0x4ff286){return _0x5297ac+_0x4ff286;},'miygH':'ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','AiDpS':'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','ytuOY':_0x457fa5(0xe5),'JTFzJ':_0x457fa5(0xf3),'usfSx':'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.'};console['error'](_0x57e3cd['AMCIz'](_0x57e3cd['AMCIz'](_0x57e3cd['AMCIz'](_0x57e3cd[_0x457fa5(0xe2)](_0x57e3cd[_0x457fa5(0xe0)](_0x57e3cd['AMCIz'](_0x57e3cd[_0x457fa5(0xe1)],'\x0a'),_0x57e3cd['AiDpS']),'\x20\x20ranger\x20profile\x20add\x20<name>\x0a')+'\x0a'+'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a',_0x57e3cd['ytuOY']),'\x0a'),_0x57e3cd[_0x457fa5(0xe9)])+_0x57e3cd[_0x457fa5(0xed)]),process[_0x457fa5(0xea)](0x1);}function _0x2745(){var _0x1c60f5=['usfSx','22BFcPkK','78kgHKuz','71890kCINhY','3082050pMVSgq','132wzaxFJ','Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a','28024PeDhia','AMCIz','miygH','yALpn','857436nJxRDc','20mdyXEz','\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a','698117DgoeAE','231708GRSnQG','1413rygrss','JTFzJ','exit','18472fwokmW','450oOSExJ'];_0x2745=function(){return _0x1c60f5;};return _0x2745();}
1
+ (function(_0x444f87,_0x282da0){var _0x4742a2=_0x3660,_0x3c7c12=_0x444f87();while(!![]){try{var _0x4429a2=parseInt(_0x4742a2(0x195))/0x1+parseInt(_0x4742a2(0x19a))/0x2*(parseInt(_0x4742a2(0x192))/0x3)+-parseInt(_0x4742a2(0x187))/0x4*(-parseInt(_0x4742a2(0x193))/0x5)+parseInt(_0x4742a2(0x18b))/0x6*(parseInt(_0x4742a2(0x19b))/0x7)+-parseInt(_0x4742a2(0x18d))/0x8*(-parseInt(_0x4742a2(0x196))/0x9)+parseInt(_0x4742a2(0x199))/0xa+-parseInt(_0x4742a2(0x18c))/0xb;if(_0x4429a2===_0x282da0)break;else _0x3c7c12['push'](_0x3c7c12['shift']());}catch(_0x529407){_0x3c7c12['push'](_0x3c7c12['shift']());}}}(_0x139d,0xd3dba));function _0x3660(_0x4eb097,_0x46418a){_0x4eb097=_0x4eb097-0x187;var _0x139d24=_0x139d();var _0x366033=_0x139d24[_0x4eb097];return _0x366033;}function _0x139d(){var _0x541cf0=['931219RSZFwj','4202424qwKABo','error','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','17317380EoOVSX','38hLCJpl','182MTHCLE','4iNEYtW','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','ArnHN','jsfnQ','152904DrsGwm','46782747YnbzBU','8cmmwoX','YwGAJ','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a','136821dyTLHF','2308685ufMDqC','vKeEn'];_0x139d=function(){return _0x541cf0;};return _0x139d();}export async function migrateProfile(_0x58e311,_0x278900){var _0x4e8f7c=_0x3660,_0x3a3b0c={'ArnHN':function(_0x3d9a10,_0x521189){return _0x3d9a10+_0x521189;},'vKeEn':_0x4e8f7c(0x190),'YwGAJ':'\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a','jsfnQ':'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.'};console[_0x4e8f7c(0x197)](_0x3a3b0c[_0x4e8f7c(0x189)](_0x3a3b0c['ArnHN'](_0x3a3b0c[_0x4e8f7c(0x189)](_0x3a3b0c[_0x4e8f7c(0x194)]+'\x0a',_0x4e8f7c(0x198))+_0x4e8f7c(0x188)+'\x0a'+_0x4e8f7c(0x18f),_0x3a3b0c[_0x4e8f7c(0x18e)])+'\x0a',_0x4e8f7c(0x191))+_0x3a3b0c[_0x4e8f7c(0x18a)]),process['exit'](0x1);}
@@ -1 +1 @@
1
- (function(_0x4974a5,_0x154eb6){const _0x2e4000=_0x5752,_0x2f9747=_0x4974a5();while(!![]){try{const _0x1c192d=-parseInt(_0x2e4000(0x1a7))/0x1+parseInt(_0x2e4000(0x195))/0x2*(parseInt(_0x2e4000(0x19e))/0x3)+-parseInt(_0x2e4000(0x199))/0x4*(-parseInt(_0x2e4000(0x1b7))/0x5)+parseInt(_0x2e4000(0x193))/0x6+-parseInt(_0x2e4000(0x1b6))/0x7+-parseInt(_0x2e4000(0x1a3))/0x8+-parseInt(_0x2e4000(0x1c3))/0x9;if(_0x1c192d===_0x154eb6)break;else _0x2f9747['push'](_0x2f9747['shift']());}catch(_0x579914){_0x2f9747['push'](_0x2f9747['shift']());}}}(_0x14b9,0x997f5));import{join}from'path';import{existsSync}from'fs';import _0x215ede 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(_0x5ecb7){const _0xd33b28=_0x5752,_0x2ddfd4={'CAWCs':function(_0x3fa310,_0x2a7391){return _0x3fa310(_0x2a7391);},'gFpJj':'ranger@trailhead','nIbmJ':_0xd33b28(0x1a0),'tJSga':function(_0x269751,_0x4501f9,_0x4910ef){return _0x269751(_0x4501f9,_0x4910ef);},'xNZzr':function(_0x157000){return _0x157000();},'sLTcI':'Where\x20should\x20the\x20plugin\x20be\x20installed?','itkwq':_0xd33b28(0x1aa),'BHble':'user','oLKrB':function(_0x4ddfdc,_0x324294){return _0x4ddfdc(_0x324294);},'YEJzm':'ranger-testing/trailhead','zuDRK':_0xd33b28(0x1b0),'iJZaq':'\x0aYou\x20can\x20install\x20manually\x20with:','McdMQ':_0xd33b28(0x1b1),'WehJd':_0xd33b28(0x1ab),'hTSuT':function(_0x2cfa10,_0x16152e){return _0x2cfa10===_0x16152e;},'XvkbX':'enable','NgWYH':'--scope','HrAYy':function(_0xf217f,_0x59928d){return _0xf217f===_0x59928d;},'EejBZ':_0xd33b28(0x1b4),'SLTjb':_0xd33b28(0x192)},_0x448e99=await _0x2ddfd4['CAWCs'](isPluginInstalled,_0x2ddfd4[_0xd33b28(0x19c)]);if(_0x448e99)return console['log'](_0x2ddfd4['nIbmJ']),![];const _0x2f8fbe=_0x2ddfd4['CAWCs'](existsSync,_0x2ddfd4[_0xd33b28(0x1bb)](join,_0x2ddfd4['xNZzr'](getProjectRoot),'.claude'));let _0x119652;if(_0x5ecb7)_0x119652=_0x5ecb7;else{if(_0x2f8fbe)_0x119652='project';else{console[_0xd33b28(0x1b9)]('\x0a📦\x20Claude\x20Code\x20Plugin\x0a');const _0x23d5a2=await _0x215ede[_0xd33b28(0x1a1)]([{'type':'list','name':_0xd33b28(0x1af),'message':_0x2ddfd4['sLTcI'],'choices':[{'name':_0xd33b28(0x19a),'value':_0xd33b28(0x1bc)},{'name':_0xd33b28(0x1b3),'value':_0x2ddfd4[_0xd33b28(0x1a4)]}],'default':_0x2ddfd4['BHble']}]);_0x119652=_0x23d5a2['pluginScope'];}}console[_0xd33b28(0x1b9)]('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x119652+'\x20level)...\x0a');const _0x131d29=await isMarketplaceAdded('trailhead');let _0x28309e=_0x131d29;if(_0x131d29)console[_0xd33b28(0x1b9)]('✓\x20Marketplace\x20already\x20added');else{const _0x2fac00=await _0x2ddfd4[_0xd33b28(0x194)](runClaudeCommand,['plugin','marketplace',_0xd33b28(0x19d),_0x2ddfd4['YEJzm']]);!_0x2fac00['success']?(console[_0xd33b28(0x19b)](_0x2ddfd4['zuDRK'],_0x2fac00[_0xd33b28(0x19b)]),console['log'](_0x2ddfd4['iJZaq']),console[_0xd33b28(0x1b9)]('\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead'),console[_0xd33b28(0x1b9)]('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x119652)):_0x28309e=!![];}if(_0x28309e){const _0x1aa01c=await _0x2ddfd4['tJSga'](runClaudeCommand,[_0x2ddfd4[_0xd33b28(0x198)],_0x2ddfd4[_0xd33b28(0x1b5)],'ranger@trailhead','--scope',_0x119652],{'cwd':_0x2ddfd4[_0xd33b28(0x197)](_0x119652,'project')?_0x2ddfd4['xNZzr'](getProjectRoot):undefined});if(!_0x1aa01c[_0xd33b28(0x1ba)])console['error'](_0xd33b28(0x1c0),_0x1aa01c[_0xd33b28(0x19b)]),console['log'](_0x2ddfd4[_0xd33b28(0x1bf)]),console['log']('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x119652);else{console[_0xd33b28(0x1b9)]('✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully');const _0x37425a=[_0xd33b28(0x1b1),_0x2ddfd4[_0xd33b28(0x1be)],_0x2ddfd4[_0xd33b28(0x19c)]];_0x119652===_0x2ddfd4['itkwq']&&_0x37425a['push'](_0x2ddfd4[_0xd33b28(0x196)],'project');const _0x256e67=await runClaudeCommand(_0x37425a,{'captureOutput':!![],'cwd':_0x2ddfd4['HrAYy'](_0x119652,_0xd33b28(0x1aa))?_0x2ddfd4[_0xd33b28(0x1c1)](getProjectRoot):undefined}),_0xafffe1=_0x256e67[_0xd33b28(0x1c2)]?.['includes'](_0x2ddfd4[_0xd33b28(0x1ae)]);!_0x256e67[_0xd33b28(0x1ba)]&&!_0xafffe1?console['error']('⚠\x20Failed\x20to\x20enable\x20plugin:',_0x256e67['error']):console['log'](_0x2ddfd4['SLTjb']);}}return!![];}function _0x5752(_0x2765f2,_0x2225b8){_0x2765f2=_0x2765f2-0x192;const _0x14b969=_0x14b9();let _0x57522e=_0x14b969[_0x2765f2];return _0x57522e;}export async function ensureClaudeSkills(_0x859061){const _0x3a1842=_0x5752,_0xfc8568={'CBXcM':function(_0x48295f,_0x27d220,_0x45fb21,_0x2c7003){return _0x48295f(_0x27d220,_0x45fb21,_0x2c7003);},'HdiXJ':function(_0x14cdcd,_0x4b6cdb){return _0x14cdcd(_0x4b6cdb);},'gknsT':_0x3a1842(0x1bc),'CQPfS':_0x3a1842(0x1ac),'KTeyN':function(_0x2c2b8e,_0x5af3bf,_0x9388c6,_0x67d99){return _0x2c2b8e(_0x5af3bf,_0x9388c6,_0x67d99);},'xpPVq':'SKILL.md','OrMKM':function(_0x16785d,_0x1c153e){return _0x16785d||_0x1c153e;},'NmBIm':function(_0x1cee81){return _0x1cee81();},'sOqOd':_0x3a1842(0x1a2)},_0x16d981=existsSync(_0xfc8568['CBXcM'](join,_0xfc8568[_0x3a1842(0x1b8)](getSkillsDir,_0xfc8568[_0x3a1842(0x1a5)]),_0xfc8568[_0x3a1842(0x1a9)],_0x3a1842(0x1b2))),_0x490eee=existsSync(_0xfc8568['KTeyN'](join,_0xfc8568['HdiXJ'](getSkillsDir,'project'),_0x3a1842(0x1ac),_0xfc8568[_0x3a1842(0x1a6)]));if(_0xfc8568[_0x3a1842(0x19f)](_0x16d981,_0x490eee))return console['log']('✓\x20Ranger\x20skills\x20already\x20installed'),![];const _0x15b7bb=existsSync(join(_0xfc8568[_0x3a1842(0x1a8)](getProjectRoot),'.claude'));let _0x58519f=!![];if(_0x859061)await skillup({'autoInstall':_0x859061,'suppressUsage':!![]});else{if(_0x15b7bb)await _0xfc8568['HdiXJ'](skillup,{'autoInstall':_0x3a1842(0x1aa),'suppressUsage':!![]});else{const _0x5e332f=await _0x215ede[_0x3a1842(0x1a1)]([{'type':_0xfc8568[_0x3a1842(0x1ad)],'name':_0x3a1842(0x1bd),'message':'Would\x20you\x20like\x20to\x20install\x20skills?','default':!![]}]);_0x58519f=_0x5e332f['wantsSkillup'],_0x58519f&&await skillup({'suppressUsage':!![]});}}return _0x58519f;}function _0x14b9(){const _0x3aa000=['success','tJSga','user','wantsSkillup','XvkbX','iJZaq','❌\x20Failed\x20to\x20install\x20plugin:','xNZzr','output','3975021teSNJN','✓\x20Claude\x20Code\x20plugin\x20enabled','7089966MbYeJJ','oLKrB','558IQPzmd','NgWYH','hTSuT','McdMQ','4bWUXQc','User\x20(available\x20in\x20all\x20your\x20projects)','error','gFpJj','add','4548ZnsXDm','OrMKM','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','prompt','confirm','8225864bRLKAX','itkwq','gknsT','xpPVq','122383bosTHk','NmBIm','CQPfS','project','install','ranger','sOqOd','EejBZ','pluginScope','❌\x20Failed\x20to\x20add\x20marketplace:','plugin','SKILL.md','Project\x20(shared\x20with\x20team\x20via\x20git)','already\x20enabled','WehJd','1532398tuZnvZ','4176495ahOuVd','HdiXJ','log'];_0x14b9=function(){return _0x3aa000;};return _0x14b9();}
1
+ (function(_0x2c7d38,_0x2dc693){const _0x37b489=_0x24db,_0x152f5d=_0x2c7d38();while(!![]){try{const _0x456bde=parseInt(_0x37b489(0x1e1))/0x1*(parseInt(_0x37b489(0x1dd))/0x2)+parseInt(_0x37b489(0x1ec))/0x3*(parseInt(_0x37b489(0x1e0))/0x4)+-parseInt(_0x37b489(0x1f4))/0x5*(-parseInt(_0x37b489(0x1ff))/0x6)+parseInt(_0x37b489(0x1f3))/0x7+parseInt(_0x37b489(0x1f6))/0x8+parseInt(_0x37b489(0x1f1))/0x9*(parseInt(_0x37b489(0x1f9))/0xa)+-parseInt(_0x37b489(0x1eb))/0xb;if(_0x456bde===_0x2dc693)break;else _0x152f5d['push'](_0x152f5d['shift']());}catch(_0xc4d3ab){_0x152f5d['push'](_0x152f5d['shift']());}}}(_0x288d,0xacbfc));function _0x288d(){const _0x14756d=['ranger@trailhead','45355706HnTllx','3Kancss','success','ySsbH','trailhead','--scope','9XlwLfp','Uenql','6991880wzcYvX','5UiHEJS','❌\x20Failed\x20to\x20add\x20marketplace:','852816zLNbEC','qWGhQ','nFnYP','13926670Zfumls','enable','FxvyX','\x0aYou\x20can\x20install\x20manually\x20with:','ibMTK','❌\x20Failed\x20to\x20install\x20plugin:','4313322qEFjGl','marketplace','✓\x20Ranger\x20skills\x20already\x20installed','\x0aInstalling\x20Claude\x20Code\x20plugin\x20(','SKILL.md','error','\x0a📦\x20Claude\x20Code\x20Plugin\x0a','.claude','wantsSkillup','WKtip','bvXsM','pluginScope','project','KwxRC','prompt','FUtjq','ranger-testing/trailhead','push','✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','gKJvO','761870kdVvLj','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','already\x20enabled','1884100xIkLQH','3lNWgmF','rWUgU','ezllJ','log','yCsAo','Where\x20should\x20the\x20plugin\x20be\x20installed?','plugin','ranger','user'];_0x288d=function(){return _0x14756d;};return _0x288d();}import{join}from'path';import{existsSync}from'fs';import _0x145c98 from'inquirer';function _0x24db(_0x2d9668,_0x18c088){_0x2d9668=_0x2d9668-0x1d6;const _0x288db8=_0x288d();let _0x24db40=_0x288db8[_0x2d9668];return _0x24db40;}import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0xf683d8){const _0x535f96=_0x24db,_0x5b16a0={'GeMxU':function(_0x4d963d,_0x16f869){return _0x4d963d(_0x16f869);},'ybCqv':function(_0x266bc6,_0x334de7,_0x90f3cd){return _0x266bc6(_0x334de7,_0x90f3cd);},'HpFFs':_0x535f96(0x205),'gAFeY':'list','ezllJ':'Project\x20(shared\x20with\x20team\x20via\x20git)','BZEZN':_0x535f96(0x1e9),'Uenql':_0x535f96(0x200),'KqnoW':'add','yCsAo':'plugin','nFnYP':_0x535f96(0x1f0),'rWUgU':function(_0x6708e5,_0x23dd59){return _0x6708e5===_0x23dd59;},'bTxrB':function(_0x2a6bf9){return _0x2a6bf9();},'ibMTK':_0x535f96(0x1fe),'KwxRC':_0x535f96(0x1db),'CCUGO':function(_0x45dd7e){return _0x45dd7e();},'UKTwd':_0x535f96(0x1df)},_0x532eb7=await isPluginInstalled(_0x535f96(0x1ea));if(_0x532eb7)return console[_0x535f96(0x1e4)]('✓\x20Claude\x20Code\x20plugin\x20already\x20installed'),![];const _0x50d91e=_0x5b16a0['GeMxU'](existsSync,_0x5b16a0['ybCqv'](join,getProjectRoot(),'.claude'));let _0x8b22d9;if(_0xf683d8)_0x8b22d9=_0xf683d8;else{if(_0x50d91e)_0x8b22d9=_0x535f96(0x20b);else{console[_0x535f96(0x1e4)](_0x5b16a0['HpFFs']);const _0x541911=await _0x145c98[_0x535f96(0x1d7)]([{'type':_0x5b16a0['gAFeY'],'name':_0x535f96(0x20a),'message':_0x535f96(0x1e6),'choices':[{'name':'User\x20(available\x20in\x20all\x20your\x20projects)','value':_0x535f96(0x1e9)},{'name':_0x5b16a0[_0x535f96(0x1e3)],'value':'project'}],'default':_0x5b16a0['BZEZN']}]);_0x8b22d9=_0x541911[_0x535f96(0x20a)];}}console['log'](_0x535f96(0x202)+_0x8b22d9+'\x20level)...\x0a');const _0x4d86e8=await isMarketplaceAdded(_0x535f96(0x1ef));let _0x5990c3=_0x4d86e8;if(_0x4d86e8)console[_0x535f96(0x1e4)]('✓\x20Marketplace\x20already\x20added');else{const _0x53c891=await runClaudeCommand(['plugin',_0x5b16a0[_0x535f96(0x1f2)],_0x5b16a0['KqnoW'],_0x535f96(0x1d9)]);!_0x53c891['success']?(console['error'](_0x535f96(0x1f5),_0x53c891['error']),console['log'](_0x535f96(0x1fc)),console[_0x535f96(0x1e4)]('\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead'),console[_0x535f96(0x1e4)](_0x535f96(0x1de)+_0x8b22d9)):_0x5990c3=!![];}if(_0x5990c3){const _0x55bad9=await _0x5b16a0['ybCqv'](runClaudeCommand,[_0x5b16a0[_0x535f96(0x1e5)],'install','ranger@trailhead',_0x5b16a0[_0x535f96(0x1f8)],_0x8b22d9],{'cwd':_0x5b16a0[_0x535f96(0x1e2)](_0x8b22d9,'project')?_0x5b16a0['bTxrB'](getProjectRoot):undefined});if(!_0x55bad9[_0x535f96(0x1ed)])console[_0x535f96(0x204)](_0x5b16a0[_0x535f96(0x1fd)],_0x55bad9[_0x535f96(0x204)]),console[_0x535f96(0x1e4)]('\x0aYou\x20can\x20install\x20manually\x20with:'),console['log'](_0x535f96(0x1de)+_0x8b22d9);else{console[_0x535f96(0x1e4)](_0x5b16a0[_0x535f96(0x1d6)]);const _0x2e4654=[_0x535f96(0x1e7),_0x535f96(0x1fa),'ranger@trailhead'];_0x5b16a0['rWUgU'](_0x8b22d9,'project')&&_0x2e4654[_0x535f96(0x1da)]('--scope',_0x535f96(0x20b));const _0x3723f=await runClaudeCommand(_0x2e4654,{'captureOutput':!![],'cwd':_0x5b16a0['rWUgU'](_0x8b22d9,'project')?_0x5b16a0['CCUGO'](getProjectRoot):undefined}),_0x5bcb1e=_0x3723f['output']?.['includes'](_0x5b16a0['UKTwd']);!_0x3723f['success']&&!_0x5bcb1e?console[_0x535f96(0x204)]('⚠\x20Failed\x20to\x20enable\x20plugin:',_0x3723f['error']):console[_0x535f96(0x1e4)]('✓\x20Claude\x20Code\x20plugin\x20enabled');}}return!![];}export async function ensureClaudeSkills(_0x3e6d6b){const _0x347b13=_0x24db,_0x59353e={'FxvyX':function(_0x5d33f5,_0x3cda23,_0x2362a8,_0x233382){return _0x5d33f5(_0x3cda23,_0x2362a8,_0x233382);},'qWGhQ':'user','ySsbH':'ranger','FUtjq':function(_0xa4d2e6,_0x487e8c){return _0xa4d2e6(_0x487e8c);},'gKJvO':_0x347b13(0x20b),'fEeos':_0x347b13(0x203),'bvXsM':_0x347b13(0x201),'XFwPl':function(_0x32b384,_0x2166be,_0x5469bf){return _0x32b384(_0x2166be,_0x5469bf);},'WKtip':_0x347b13(0x206),'mWBuC':'confirm'},_0xc2a6b9=existsSync(_0x59353e['FxvyX'](join,getSkillsDir(_0x59353e[_0x347b13(0x1f7)]),_0x59353e[_0x347b13(0x1ee)],'SKILL.md')),_0x38b37c=_0x59353e['FUtjq'](existsSync,_0x59353e[_0x347b13(0x1fb)](join,getSkillsDir(_0x59353e['gKJvO']),_0x347b13(0x1e8),_0x59353e['fEeos']));if(_0xc2a6b9||_0x38b37c)return console[_0x347b13(0x1e4)](_0x59353e[_0x347b13(0x209)]),![];const _0x38c1e1=existsSync(_0x59353e['XFwPl'](join,getProjectRoot(),_0x59353e[_0x347b13(0x208)]));let _0x322c11=!![];if(_0x3e6d6b)await _0x59353e[_0x347b13(0x1d8)](skillup,{'autoInstall':_0x3e6d6b,'suppressUsage':!![]});else{if(_0x38c1e1)await skillup({'autoInstall':_0x59353e[_0x347b13(0x1dc)],'suppressUsage':!![]});else{const _0x1dfa8c=await _0x145c98['prompt']([{'type':_0x59353e['mWBuC'],'name':_0x347b13(0x207),'message':'Would\x20you\x20like\x20to\x20install\x20skills?','default':!![]}]);_0x322c11=_0x1dfa8c[_0x347b13(0x207)],_0x322c11&&await _0x59353e[_0x347b13(0x1d8)](skillup,{'suppressUsage':!![]});}}return _0x322c11;}
@@ -1 +1 @@
1
- (function(_0xf75994,_0x37f16c){const _0x2fa233=_0x206b,_0x523b1e=_0xf75994();while(!![]){try{const _0x5ea863=-parseInt(_0x2fa233(0x197))/0x1*(parseInt(_0x2fa233(0x193))/0x2)+-parseInt(_0x2fa233(0x19f))/0x3*(-parseInt(_0x2fa233(0x1b3))/0x4)+parseInt(_0x2fa233(0x1a8))/0x5*(parseInt(_0x2fa233(0x1b0))/0x6)+parseInt(_0x2fa233(0x1a3))/0x7*(-parseInt(_0x2fa233(0x1ab))/0x8)+parseInt(_0x2fa233(0x19b))/0x9*(-parseInt(_0x2fa233(0x1ad))/0xa)+parseInt(_0x2fa233(0x1a2))/0xb+parseInt(_0x2fa233(0x1b1))/0xc;if(_0x5ea863===_0x37f16c)break;else _0x523b1e['push'](_0x523b1e['shift']());}catch(_0x1086b2){_0x523b1e['push'](_0x523b1e['shift']());}}}(_0xe7b9,0xa60b6));import{join}from'path';import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0x2abec6 from'inquirer';function _0xe7b9(){const _0x1d4045=['plugin','$schema','includes','723tmANoE','@ranger-testing/opencode-plugin','prompt','4171156RQnOsP','3996342CnuMIJ','EdWoN','⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','https://opencode.ai/config.json','rASpF','140aIJtjg','isArray','\x0a📦\x20OpenCode\x20Plugin\x0a','16VJqThy','nHZwW','11844650OEscHL','list','user','263796JRZZgA','19058376nQaHGp','log','616skcADl','gnNRM','pluginScope','ZVVam','458322iCJsIp','project','Project\x20(shared\x20with\x20team\x20via\x20git)','✓\x20OpenCode\x20plugin\x20configured','1YfRxMX','TmMqR','yCdMi','✓\x20OpenCode\x20plugin\x20already\x20configured','9wlsoaM'];_0xe7b9=function(){return _0x1d4045;};return _0xe7b9();}import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';function _0x206b(_0x5b0d0c,_0x4297ca){_0x5b0d0c=_0x5b0d0c-0x192;const _0xe7b924=_0xe7b9();let _0x206b71=_0xe7b924[_0x5b0d0c];return _0x206b71;}export async function ensureOpencodePluginConfig(_0x34da69){const _0x479e20=_0x206b,_0x51e3a3={'rASpF':function(_0x1d8706,_0x341eaa){return _0x1d8706(_0x341eaa);},'SBGeA':function(_0x4fa1a4,_0x5e9dcd){return _0x4fa1a4(_0x5e9dcd);},'LnTMJ':_0x479e20(0x194),'fxBUa':'opencode.json','yCdMi':_0x479e20(0x1aa),'gnNRM':_0x479e20(0x1ae),'EdWoN':'User\x20(available\x20in\x20all\x20your\x20projects)','ZVVam':_0x479e20(0x1af),'nHZwW':function(_0x27a769,_0x11d7ef,_0x74b6c9){return _0x27a769(_0x11d7ef,_0x74b6c9);},'AUcmE':_0x479e20(0x1a0),'TmMqR':_0x479e20(0x19a),'qPFRp':_0x479e20(0x196)},_0x4f5913=_0x51e3a3[_0x479e20(0x1a7)](existsSync,join(_0x51e3a3['SBGeA'](getOpencodeConfigDir,_0x51e3a3['LnTMJ']),_0x51e3a3['fxBUa']));let _0x3e37ac;if(_0x34da69)_0x3e37ac=_0x34da69;else{if(_0x4f5913)_0x3e37ac='project';else{console[_0x479e20(0x1b2)](_0x51e3a3[_0x479e20(0x199)]);const _0x11c3ca=await _0x2abec6[_0x479e20(0x1a1)]([{'type':_0x51e3a3[_0x479e20(0x1b4)],'name':_0x479e20(0x1b5),'message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':_0x51e3a3[_0x479e20(0x1a4)],'value':_0x51e3a3[_0x479e20(0x192)]},{'name':_0x479e20(0x195),'value':_0x479e20(0x194)}],'default':_0x51e3a3['ZVVam']}]);_0x3e37ac=_0x11c3ca['pluginScope'];}}const _0xcf0e07=_0x51e3a3[_0x479e20(0x1ac)](join,getOpencodeConfigDir(_0x3e37ac),'opencode.json'),_0x1aeee9=_0x51e3a3['AUcmE'],_0x2dd0db=_0x479e20(0x1a6);let _0x40daf9={};if(existsSync(_0xcf0e07))try{const _0x30a533=await readFile(_0xcf0e07,'utf-8');_0x40daf9=JSON['parse'](_0x30a533);}catch(_0x4a8de2){return console['error'](_0x479e20(0x1a5)),{'configured':![],'scope':_0x3e37ac,'error':'Failed\x20to\x20read\x20opencode.json','details':_0x4a8de2};}const _0x3ba196=Array[_0x479e20(0x1a9)](_0x40daf9[_0x479e20(0x19c)])?_0x40daf9[_0x479e20(0x19c)]:[];if(_0x3ba196[_0x479e20(0x19e)](_0x1aeee9))return console[_0x479e20(0x1b2)](_0x51e3a3[_0x479e20(0x198)]),{'configured':![],'scope':_0x3e37ac};return _0x40daf9[_0x479e20(0x19d)]=_0x40daf9[_0x479e20(0x19d)]||_0x2dd0db,_0x40daf9['plugin']=[..._0x3ba196,_0x1aeee9],await _0x51e3a3['nHZwW'](mkdir,getOpencodeConfigDir(_0x3e37ac),{'recursive':!![]}),await writeFile(_0xcf0e07,JSON['stringify'](_0x40daf9,null,0x2)+'\x0a'),console['log'](_0x51e3a3['qPFRp']),{'configured':!![],'scope':_0x3e37ac};}
1
+ (function(_0x2d85eb,_0x1224af){const _0x3b5bc5=_0x5e60,_0x540985=_0x2d85eb();while(!![]){try{const _0x5d86a1=parseInt(_0x3b5bc5(0x95))/0x1+-parseInt(_0x3b5bc5(0x7e))/0x2*(-parseInt(_0x3b5bc5(0x81))/0x3)+parseInt(_0x3b5bc5(0x7b))/0x4*(-parseInt(_0x3b5bc5(0x8c))/0x5)+-parseInt(_0x3b5bc5(0x92))/0x6+-parseInt(_0x3b5bc5(0x85))/0x7+-parseInt(_0x3b5bc5(0x7f))/0x8+-parseInt(_0x3b5bc5(0x8f))/0x9*(-parseInt(_0x3b5bc5(0x91))/0xa);if(_0x5d86a1===_0x1224af)break;else _0x540985['push'](_0x540985['shift']());}catch(_0x3614ea){_0x540985['push'](_0x540985['shift']());}}}(_0x77e7,0x92b07));function _0x5e60(_0x3bf9a6,_0x375bee){_0x3bf9a6=_0x3bf9a6-0x78;const _0x77e72d=_0x77e7();let _0x5e607d=_0x77e72d[_0x3bf9a6];return _0x5e607d;}import{join}from'path';function _0x77e7(){const _0x11effd=['BszOZ','user','UmMDN','LwVDg','fNxGE','plugin','5TGDatX','⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','XGphg','9pRkVNa','✓\x20OpenCode\x20plugin\x20already\x20configured','11039650LRZwcI','3975234qINHHp','isArray','bQvMT','371260HBwHrf','WnXvh','project','dxSAY','Project\x20(shared\x20with\x20team\x20via\x20git)','dusHE','\x0a📦\x20OpenCode\x20Plugin\x0a','$schema','utf-8','pluginScope','1875980tGVibh','cYxnX','https://opencode.ai/config.json','2176IecqPj','2243072YxVTyw','@ranger-testing/opencode-plugin','2589SlfADG','HaSZQ','QdQLZ','HylvB','2809884wsnGVH'];_0x77e7=function(){return _0x11effd;};return _0x77e7();}import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0x1d35d6 from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0x3e54c9){const _0x590f3a=_0x5e60,_0x610a52={'dusHE':function(_0x3f24d7,_0x331c48){return _0x3f24d7(_0x331c48);},'BszOZ':function(_0x224c8b,_0x5aa191,_0x2c093a){return _0x224c8b(_0x5aa191,_0x2c093a);},'XGphg':'opencode.json','fNxGE':'list','bQvMT':'Where\x20should\x20the\x20plugin\x20be\x20installed?','HaSZQ':'User\x20(available\x20in\x20all\x20your\x20projects)','cYxnX':_0x590f3a(0x97),'QdQLZ':'user','dxSAY':_0x590f3a(0x79),'UmMDN':_0x590f3a(0x8d),'LwVDg':'Failed\x20to\x20read\x20opencode.json','WnXvh':_0x590f3a(0x90),'HylvB':function(_0x103bc8,_0x28f4c8){return _0x103bc8+_0x28f4c8;}},_0x55c355=_0x610a52[_0x590f3a(0x9a)](existsSync,_0x610a52[_0x590f3a(0x86)](join,getOpencodeConfigDir(_0x590f3a(0x97)),_0x610a52[_0x590f3a(0x8e)]));let _0x565a9c;if(_0x3e54c9)_0x565a9c=_0x3e54c9;else{if(_0x55c355)_0x565a9c=_0x590f3a(0x97);else{console['log'](_0x590f3a(0x9b));const _0x4f9904=await _0x1d35d6['prompt']([{'type':_0x610a52[_0x590f3a(0x8a)],'name':_0x590f3a(0x7a),'message':_0x610a52[_0x590f3a(0x94)],'choices':[{'name':_0x610a52[_0x590f3a(0x82)],'value':_0x590f3a(0x87)},{'name':_0x590f3a(0x99),'value':_0x610a52[_0x590f3a(0x7c)]}],'default':_0x610a52[_0x590f3a(0x83)]}]);_0x565a9c=_0x4f9904['pluginScope'];}}const _0x19a94a=join(getOpencodeConfigDir(_0x565a9c),_0x610a52['XGphg']),_0x53e8c8=_0x590f3a(0x80),_0x35f49e=_0x590f3a(0x7d);let _0x3a9856={};if(_0x610a52[_0x590f3a(0x9a)](existsSync,_0x19a94a))try{const _0x48b8e1=await _0x610a52['BszOZ'](readFile,_0x19a94a,_0x610a52[_0x590f3a(0x98)]);_0x3a9856=JSON['parse'](_0x48b8e1);}catch(_0x239770){return console['error'](_0x610a52[_0x590f3a(0x88)]),{'configured':![],'scope':_0x565a9c,'error':_0x610a52[_0x590f3a(0x89)],'details':_0x239770};}const _0x1eae52=Array[_0x590f3a(0x93)](_0x3a9856[_0x590f3a(0x8b)])?_0x3a9856[_0x590f3a(0x8b)]:[];if(_0x1eae52['includes'](_0x53e8c8))return console['log'](_0x610a52[_0x590f3a(0x96)]),{'configured':![],'scope':_0x565a9c};return _0x3a9856['$schema']=_0x3a9856[_0x590f3a(0x78)]||_0x35f49e,_0x3a9856['plugin']=[..._0x1eae52,_0x53e8c8],await mkdir(getOpencodeConfigDir(_0x565a9c),{'recursive':!![]}),await writeFile(_0x19a94a,_0x610a52[_0x590f3a(0x84)](JSON['stringify'](_0x3a9856,null,0x2),'\x0a')),console['log']('✓\x20OpenCode\x20plugin\x20configured'),{'configured':!![],'scope':_0x565a9c};}
@@ -1 +1 @@
1
- (function(_0x49f211,_0x5acd75){var _0x5f02ba=_0x3b95,_0x60537c=_0x49f211();while(!![]){try{var _0x393302=-parseInt(_0x5f02ba(0x1a8))/0x1+-parseInt(_0x5f02ba(0x1ab))/0x2*(parseInt(_0x5f02ba(0x1af))/0x3)+-parseInt(_0x5f02ba(0x1b0))/0x4*(-parseInt(_0x5f02ba(0x1ae))/0x5)+-parseInt(_0x5f02ba(0x1a2))/0x6+parseInt(_0x5f02ba(0x1a5))/0x7+-parseInt(_0x5f02ba(0x1ad))/0x8+parseInt(_0x5f02ba(0x1a6))/0x9;if(_0x393302===_0x5acd75)break;else _0x60537c['push'](_0x60537c['shift']());}catch(_0x3a5672){_0x60537c['push'](_0x60537c['shift']());}}}(_0x5b2d,0x36e8b));export async function setupCi(_0x388292,_0x319974,_0x249a3b){var _0x16bade=_0x3b95,_0xbd6e7e={'yQGXQ':function(_0x394a0b,_0x40ca58){return _0x394a0b+_0x40ca58;},'klncy':function(_0x29add9,_0x59d959){return _0x29add9+_0x59d959;},'sHcfU':function(_0x4515ee,_0x5d57b0){return _0x4515ee+_0x5d57b0;},'zIaMG':_0x16bade(0x1a9),'xcqXy':_0x16bade(0x1b2)};console[_0x16bade(0x1aa)](_0xbd6e7e['yQGXQ'](_0xbd6e7e[_0x16bade(0x1b1)](_0xbd6e7e[_0x16bade(0x1ac)](_0xbd6e7e['zIaMG'],'\x0a')+_0x16bade(0x1a3),'\x20\x20ranger\x20profile\x20add\x20<name>\x0a')+'\x0a',_0x16bade(0x1a4))+_0xbd6e7e[_0x16bade(0x1a7)]),process['exit'](0x1);}function _0x3b95(_0x41e483,_0x438f35){_0x41e483=_0x41e483-0x1a2;var _0x5b2d7=_0x5b2d();var _0x3b9562=_0x5b2d7[_0x41e483];return _0x3b9562;}function _0x5b2d(){var _0x4be227=['119970wMoKJU','sHcfU','2101448rwcKln','72445jhaEDd','3tJdDIy','120ngFnBo','klncy','\x20\x20https://docs.ranger.net/main/concepts/profiles','2589594gwPjpQ','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','2971556wlnQIS','4815270JEFnPJ','xcqXy','415036uVDHVO','ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','error'];_0x5b2d=function(){return _0x4be227;};return _0x5b2d();}
1
+ function _0x4c2c(_0x3606f1,_0x42e0b1){_0x3606f1=_0x3606f1-0x1b5;var _0x95c28d=_0x95c2();var _0x4c2cd9=_0x95c28d[_0x3606f1];return _0x4c2cd9;}(function(_0x13c443,_0x16cf9c){var _0x5ea43f=_0x4c2c,_0x3bdee9=_0x13c443();while(!![]){try{var _0x27caf4=-parseInt(_0x5ea43f(0x1be))/0x1*(-parseInt(_0x5ea43f(0x1bd))/0x2)+parseInt(_0x5ea43f(0x1bc))/0x3+parseInt(_0x5ea43f(0x1b7))/0x4+-parseInt(_0x5ea43f(0x1b8))/0x5+-parseInt(_0x5ea43f(0x1bf))/0x6*(parseInt(_0x5ea43f(0x1b9))/0x7)+parseInt(_0x5ea43f(0x1c3))/0x8+-parseInt(_0x5ea43f(0x1c0))/0x9;if(_0x27caf4===_0x16cf9c)break;else _0x3bdee9['push'](_0x3bdee9['shift']());}catch(_0x4989f8){_0x3bdee9['push'](_0x3bdee9['shift']());}}}(_0x95c2,0xefdb7));export async function setupCi(_0x170483,_0xe345c8,_0x32af0b){var _0x167013=_0x4c2c,_0x515b67={'LujQr':function(_0x28d203,_0x56ef72){return _0x28d203+_0x56ef72;},'kIVIs':_0x167013(0x1bb),'rWMzo':'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','FulrC':_0x167013(0x1b5)};console['error'](_0x515b67['LujQr'](_0x515b67['kIVIs']+'\x0a'+_0x515b67[_0x167013(0x1c1)],'\x20\x20ranger\x20profile\x20add\x20<name>\x0a')+'\x0a'+_0x515b67[_0x167013(0x1b6)]+_0x167013(0x1c2)),process[_0x167013(0x1ba)](0x1);}function _0x95c2(){var _0x34edc1=['exit','ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','4524207hbhcaj','2IJVftv','185789ckAKlR','108AzpPQH','9314307fdJEma','rWMzo','\x20\x20https://docs.ranger.net/main/concepts/profiles','10553944nwIQCv','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','FulrC','1411616tGaYRt','3410525xgxJoE','259203XlhfdB'];_0x95c2=function(){return _0x34edc1;};return _0x95c2();}
@@ -1 +1 @@
1
- (function(_0x190695,_0x33b6de){const _0x47f519=_0x276f,_0x37d42e=_0x190695();while(!![]){try{const _0x58663c=-parseInt(_0x47f519(0x70))/0x1+-parseInt(_0x47f519(0x8f))/0x2+parseInt(_0x47f519(0x8a))/0x3*(parseInt(_0x47f519(0x88))/0x4)+-parseInt(_0x47f519(0x71))/0x5*(-parseInt(_0x47f519(0x7e))/0x6)+parseInt(_0x47f519(0x79))/0x7+-parseInt(_0x47f519(0x9c))/0x8*(parseInt(_0x47f519(0x72))/0x9)+parseInt(_0x47f519(0x84))/0xa*(parseInt(_0x47f519(0x7f))/0xb);if(_0x58663c===_0x33b6de)break;else _0x37d42e['push'](_0x37d42e['shift']());}catch(_0x5e2dd7){_0x37d42e['push'](_0x37d42e['shift']());}}}(_0x1aa7,0x2a467));function _0x1aa7(){const _0x22afc8=['suppressUsage','337864chbGnF','1255RRVIwB','45OUqcnL','/skills/','tRQDp','Where\x20should\x20skills\x20be\x20installed?','claude','user','\x20--opencode','1107176tkeuIY','GRWLQ','HURAB','stdout','qVIyX','1524SnPRaN','216689iuDRsA','\x20\x202.\x20Run:\x20ranger\x20setup','\x20<your-api-token>','project','split','300PsaFKg','isTTY','izkXE','cDuIo','13744bfVbzv','YBOXG','75yHBuzk','\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a','autoInstall','log','jCJEn','264948WlKXDr','stdin','\x0a✅\x20Installed\x20','\x20\x203.\x20Run:\x20ranger\x20skillup','ranger','This\x20project\x20only\x20(','tTlbW','opencode','To\x20use:','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','mNMgZ','gQpsE','ivJKT','408472SpBwHY','installLevel'];_0x1aa7=function(){return _0x22afc8;};return _0x1aa7();}function _0x276f(_0x338ac2,_0x29f893){_0x338ac2=_0x338ac2-0x70;const _0x1aa734=_0x1aa7();let _0x276fa1=_0x1aa734[_0x338ac2];return _0x276fa1;}import{basename}from'path';import _0x235564 from'inquirer';import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0xcbd945={}){const _0x4ed47d=_0x276f,_0x5da2b6={'mNMgZ':function(_0x433bf1){return _0x433bf1();},'LknLf':'❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','FCTxr':function(_0x392e1f,_0x238c87){return _0x392e1f===_0x238c87;},'tTlbW':'\x20--opencode','jCJEn':function(_0x2410f9,_0x50992f){return _0x2410f9===_0x50992f;},'HURAB':function(_0x47f5e4,_0x39547b){return _0x47f5e4(_0x39547b);},'dsZRk':function(_0x5c9078,_0x3e48fe){return _0x5c9078===_0x3e48fe;},'YBOXG':'user','tRQDp':'list','RPykm':'\x0a📦\x20Installing\x20skills...\x0a','izkXE':function(_0x47ecee,_0x48ccc9,_0x57eac9){return _0x47ecee(_0x48ccc9,_0x57eac9);},'gQpsE':_0x4ed47d(0x93),'ivJKT':'\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','CKCoy':function(_0x201adc,_0xfa84ea){return _0x201adc instanceof _0xfa84ea;},'ytNZw':function(_0x57abce,_0x70b0a7){return _0x57abce===_0x70b0a7;},'DFUhB':'user-level','cDuIo':function(_0x5b8381,_0x360c20){return _0x5b8381>_0x360c20;},'qVIyX':'\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','GRWLQ':_0x4ed47d(0x8b)};console['log']('\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a');const _0x2cb4a2=_0xcbd945['platform']??_0x4ed47d(0x76),_0x4f3f78=await _0x5da2b6[_0x4ed47d(0x99)](getToken);if(!_0x4f3f78){const _0x35ef02='2|4|1|5|3|0'[_0x4ed47d(0x83)]('|');let _0xdffb43=0x0;while(!![]){switch(_0x35ef02[_0xdffb43++]){case'0':return;case'1':console['log'](_0x4ed47d(0x98));continue;case'2':console['log'](_0x5da2b6['LknLf']);continue;case'3':console['log'](_0x4ed47d(0x92)+(_0x5da2b6['FCTxr'](_0x2cb4a2,'opencode')?_0x5da2b6[_0x4ed47d(0x95)]:'')+'\x0a');continue;case'4':console['log']('To\x20get\x20started:');continue;case'5':console['log'](_0x4ed47d(0x80)+(_0x5da2b6[_0x4ed47d(0x8e)](_0x2cb4a2,'opencode')?_0x4ed47d(0x78):'')+_0x4ed47d(0x81));continue;}break;}}console['log']('✓\x20Found\x20API\x20token');const _0x46ca1b=_0x5da2b6['mNMgZ'](getProjectRoot),_0x22c51f=_0x5da2b6[_0x4ed47d(0x7b)](basename,_0x46ca1b),_0x4f2aa6=_0x5da2b6['dsZRk'](_0x2cb4a2,_0x4ed47d(0x96))?_0x5da2b6[_0x4ed47d(0x7b)](getOpencodeConfigDir,_0x5da2b6[_0x4ed47d(0x89)])+'/skills/':getClaudeConfigDir()+_0x4ed47d(0x73),_0x492b93=_0x2cb4a2==='opencode'?_0x46ca1b+'/.opencode/skills/':_0x46ca1b+'/.claude/skills/',_0x3965dd=process[_0x4ed47d(0x90)]['isTTY']&&process[_0x4ed47d(0x7c)][_0x4ed47d(0x85)];let _0x15b413;if(_0xcbd945['autoInstall'])_0x15b413=_0xcbd945[_0x4ed47d(0x8c)];else{if(_0x3965dd){const _0x207974=await _0x235564['prompt']([{'type':_0x5da2b6[_0x4ed47d(0x74)],'name':_0x4ed47d(0x9d),'message':_0x4ed47d(0x75),'choices':[{'name':'All\x20projects\x20('+_0x4f2aa6+')','value':'user'},{'name':_0x4ed47d(0x94)+_0x492b93+')','value':_0x4ed47d(0x82)}]}]);_0x15b413=_0x207974[_0x4ed47d(0x9d)];}else _0x15b413=_0x4ed47d(0x82),console[_0x4ed47d(0x8d)]('Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20('+_0x492b93+')');}let _0x42ee7a=0x0;const _0x3f5a14=getCurrentVersion();console['log'](_0x5da2b6['RPykm']);try{const _0x2df7ba=await _0x5da2b6[_0x4ed47d(0x86)](installSkill,_0x5da2b6[_0x4ed47d(0x9a)],{'cliVersion':_0x3f5a14,'level':_0x15b413,'platform':_0x2cb4a2});_0x2df7ba&&_0x42ee7a++;}catch(_0x257f0f){console['warn'](_0x5da2b6[_0x4ed47d(0x9b)],_0x5da2b6['CKCoy'](_0x257f0f,Error)?_0x257f0f['message']:_0x257f0f);}if(_0x42ee7a>0x0){const _0x2065ad=_0x5da2b6['ytNZw'](_0x15b413,_0x4ed47d(0x77))?_0x5da2b6['DFUhB']:'project-level';console['log'](_0x4ed47d(0x91)+_0x42ee7a+'\x20'+_0x2065ad+'\x20skill'+(_0x5da2b6[_0x4ed47d(0x87)](_0x42ee7a,0x1)?'s':'')+'\x20successfully!\x0a'),!_0xcbd945[_0x4ed47d(0x9e)]&&(console[_0x4ed47d(0x8d)](_0x4ed47d(0x97)),_0x5da2b6[_0x4ed47d(0x8e)](_0x2cb4a2,_0x4ed47d(0x96))?console[_0x4ed47d(0x8d)](_0x5da2b6[_0x4ed47d(0x7d)]):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[_0x4ed47d(0x8d)](_0x5da2b6[_0x4ed47d(0x7a)]);}
1
+ (function(_0x548d59,_0xccf1b){const _0x2833f6=_0x9719,_0x35ec3e=_0x548d59();while(!![]){try{const _0x7d075=parseInt(_0x2833f6(0x9e))/0x1+parseInt(_0x2833f6(0x9a))/0x2+parseInt(_0x2833f6(0xa7))/0x3+parseInt(_0x2833f6(0xaf))/0x4+parseInt(_0x2833f6(0x99))/0x5+parseInt(_0x2833f6(0x93))/0x6*(parseInt(_0x2833f6(0xa8))/0x7)+-parseInt(_0x2833f6(0xa0))/0x8;if(_0x7d075===_0xccf1b)break;else _0x35ec3e['push'](_0x35ec3e['shift']());}catch(_0x2f7784){_0x35ec3e['push'](_0x35ec3e['shift']());}}}(_0x18df,0xac42d));import{basename}from'path';import _0x908ad7 from'inquirer';import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';function _0x18df(){const _0x18b886=['jmqtp','1779095xfhQga','1046696BitNAn','autoInstall','message','project-level','713108xXLjiO','/skills/','20727400CoEnFc','log','QZShW','ychoa','list','This\x20project\x20only\x20(','To\x20use:','3297747Mcrahk','50071agLcIx','UyYkk','oumfh','installLevel','uFXtx','\x20\x202.\x20Run:\x20ranger\x20setup','opencode','502924GRIeNU','Where\x20should\x20skills\x20be\x20installed?','All\x20projects\x20(','\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','user-level','isTTY','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','user','\x20\x203.\x20Run:\x20ranger\x20skillup','gQwXd','ranger','prompt','ddYuY','Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20(','cBUXw','✓\x20Found\x20API\x20token','split','warn','402gffwaL','project','\x20successfully!\x0a','ZRvaL','\x0a✅\x20Installed\x20'];_0x18df=function(){return _0x18b886;};return _0x18df();}import{getCurrentVersion}from'./utils/version.js';function _0x9719(_0x3b7fc5,_0x3a8014){_0x3b7fc5=_0x3b7fc5-0x8f;const _0x18df1c=_0x18df();let _0x971960=_0x18df1c[_0x3b7fc5];return _0x971960;}import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x35c7a3={}){const _0x50fac3=_0x9719,_0x59ad9d={'oumfh':'1|2|3|0|5|4','ychoa':'\x20--opencode','xQfFa':_0x50fac3(0xb5),'Pyfpz':'\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','QZShW':'opencode','UyYkk':function(_0x1c3a68){return _0x1c3a68();},'gVqXS':function(_0x3f7b19,_0x106b9d){return _0x3f7b19(_0x106b9d);},'cBUXw':_0x50fac3(0xb6),'jmqtp':function(_0x1efb70,_0x32a029){return _0x1efb70===_0x32a029;},'uFXtx':_0x50fac3(0xa4),'Uxvtb':_0x50fac3(0xab),'GpKoe':_0x50fac3(0x94),'xCvtA':'\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','gQwXd':_0x50fac3(0x9d),'ddYuY':function(_0x2d9475,_0x5281dd){return _0x2d9475>_0x5281dd;},'roiyn':function(_0x9a38ad,_0x43de67){return _0x9a38ad===_0x43de67;},'ZRvaL':_0x50fac3(0xb2),'cBtca':'\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!'};console['log']('\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a');const _0x5df54f=_0x35c7a3['platform']??'claude',_0x433cfd=await getToken();if(!_0x433cfd){const _0xf2ad7d=_0x59ad9d[_0x50fac3(0xaa)][_0x50fac3(0x91)]('|');let _0x1a8c70=0x0;while(!![]){switch(_0xf2ad7d[_0x1a8c70++]){case'0':console[_0x50fac3(0xa1)](_0x50fac3(0xad)+(_0x5df54f===_0x50fac3(0xae)?_0x59ad9d[_0x50fac3(0xa3)]:'')+'\x20<your-api-token>');continue;case'1':console['log'](_0x59ad9d['xQfFa']);continue;case'2':console['log']('To\x20get\x20started:');continue;case'3':console['log'](_0x59ad9d['Pyfpz']);continue;case'4':return;case'5':console['log'](_0x50fac3(0xb7)+(_0x5df54f===_0x59ad9d[_0x50fac3(0xa2)]?_0x59ad9d[_0x50fac3(0xa3)]:'')+'\x0a');continue;}break;}}console[_0x50fac3(0xa1)](_0x50fac3(0x90));const _0x49670d=_0x59ad9d[_0x50fac3(0xa9)](getProjectRoot),_0x22f850=basename(_0x49670d),_0x205897=_0x5df54f===_0x50fac3(0xae)?_0x59ad9d['gVqXS'](getOpencodeConfigDir,_0x59ad9d[_0x50fac3(0x8f)])+'/skills/':getClaudeConfigDir()+_0x50fac3(0x9f),_0x27757e=_0x59ad9d[_0x50fac3(0x98)](_0x5df54f,'opencode')?_0x49670d+'/.opencode/skills/':_0x49670d+'/.claude/skills/',_0x23580f=process['stdin'][_0x50fac3(0xb4)]&&process['stdout']['isTTY'];let _0x4ee1a8;if(_0x35c7a3[_0x50fac3(0x9b)])_0x4ee1a8=_0x35c7a3[_0x50fac3(0x9b)];else{if(_0x23580f){const _0x54ce88=await _0x908ad7[_0x50fac3(0xba)]([{'type':_0x59ad9d[_0x50fac3(0xac)],'name':_0x59ad9d['Uxvtb'],'message':_0x50fac3(0xb0),'choices':[{'name':_0x50fac3(0xb1)+_0x205897+')','value':_0x59ad9d['cBUXw']},{'name':_0x50fac3(0xa5)+_0x27757e+')','value':'project'}]}]);_0x4ee1a8=_0x54ce88[_0x50fac3(0xab)];}else _0x4ee1a8=_0x59ad9d['GpKoe'],console[_0x50fac3(0xa1)](_0x50fac3(0xbc)+_0x27757e+')');}let _0x44bfc1=0x0;const _0x57dc6d=getCurrentVersion();console['log']('\x0a📦\x20Installing\x20skills...\x0a');try{const _0x537ae9=await installSkill(_0x50fac3(0xb9),{'cliVersion':_0x57dc6d,'level':_0x4ee1a8,'platform':_0x5df54f});_0x537ae9&&_0x44bfc1++;}catch(_0x3f3ad8){console[_0x50fac3(0x92)](_0x59ad9d['xCvtA'],_0x3f3ad8 instanceof Error?_0x3f3ad8[_0x50fac3(0x9c)]:_0x3f3ad8);}if(_0x44bfc1>0x0){const _0x51a484=_0x59ad9d['jmqtp'](_0x4ee1a8,_0x50fac3(0xb6))?_0x50fac3(0xb3):_0x59ad9d[_0x50fac3(0xb8)];console[_0x50fac3(0xa1)](_0x50fac3(0x97)+_0x44bfc1+'\x20'+_0x51a484+'\x20skill'+(_0x59ad9d[_0x50fac3(0xbb)](_0x44bfc1,0x1)?'s':'')+_0x50fac3(0x95)),!_0x35c7a3['suppressUsage']&&(console[_0x50fac3(0xa1)](_0x50fac3(0xa6)),_0x59ad9d['roiyn'](_0x5df54f,'opencode')?console['log'](_0x59ad9d[_0x50fac3(0x96)]):console[_0x50fac3(0xa1)](_0x59ad9d['cBtca']));}else console['log']('\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a');}
@@ -1 +1 @@
1
- const _0x9f6b82=_0x262f;(function(_0x49586f,_0x1d6b97){const _0xb60fc0=_0x262f,_0x7b1186=_0x49586f();while(!![]){try{const _0x508c3a=parseInt(_0xb60fc0(0x223))/0x1*(-parseInt(_0xb60fc0(0x22b))/0x2)+-parseInt(_0xb60fc0(0x222))/0x3*(parseInt(_0xb60fc0(0x21e))/0x4)+parseInt(_0xb60fc0(0x21a))/0x5*(-parseInt(_0xb60fc0(0x1dc))/0x6)+parseInt(_0xb60fc0(0x1f3))/0x7*(parseInt(_0xb60fc0(0x1d5))/0x8)+-parseInt(_0xb60fc0(0x1eb))/0x9*(-parseInt(_0xb60fc0(0x1d0))/0xa)+parseInt(_0xb60fc0(0x1d3))/0xb*(-parseInt(_0xb60fc0(0x219))/0xc)+parseInt(_0xb60fc0(0x1db))/0xd;if(_0x508c3a===_0x1d6b97)break;else _0x7b1186['push'](_0x7b1186['shift']());}catch(_0x25d45f){_0x7b1186['push'](_0x7b1186['shift']());}}}(_0x4039,0x2afbd));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x2bf274 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';function _0x262f(_0x168c58,_0x48e0ae){_0x168c58=_0x168c58-0x1cb;const _0x403989=_0x4039();let _0x262f4a=_0x403989[_0x168c58];return _0x262f4a;}import{addEnv}from'./addEnv.js';function _0x4039(){const _0x2cf092=['\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','nfhGh','platform','vUXXa','message','44532tkpJXG','user','ignore','chromium','Installation\x20failed\x20with\x20exit\x20code\x20','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','rfNiG','✓\x20Authenticated\x20to\x20','63eHDIxA','✓\x20Skipping\x20authentication\x20(--skip-auth)','playwright@','log','\x1b[1m','You\x20can\x20install\x20it\x20manually\x20by\x20running:','WtSIr','trackPhaseStart','npx','provided_token','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','LYEcc','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','oKwSt','warn','aMzjz','success','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','...','ready','qMcvO','IPURS','resolve','skipped','skills','✓\x20Already\x20authenticated\x20to\x20','win32','profile','ranger','device_auth','JRrvj','opencode','withDeps','YIXKr','\x20\x20npx\x20playwright@','ranger\x20setup\x20--scope=','\x0a❌\x20Profile\x20setup\x20failed:','exit','1884tLgOoW','15110uVmLBd','trackPhaseEnd','install','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','784AivGkH','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','\x20install\x20chromium','rCwni','1470ChShmf','16CvtusB','uaVCD','cZptG','FykWS','lJljG','isTTY','allowInsecureLocalhost','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','28484kVbDaG','Ejcig','url','stdout','scope','method','\x20is\x20no\x20longer\x20supported.\x20','350IoQKDb','sLykZ','\x0aInstalling\x20Chromium\x20browser...\x0a','1672sbUwuG','\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','228440wlJPSE','The\x20required\x20version\x20(','error','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','bqilY','✓\x20Created\x20.ranger/.gitignore','4046198IaFNPt','432ihWCZw','CQhmz','plugin','auth','organizationName','hJETF','JluAW','local','pSqeX','status'];_0x4039=function(){return _0x2cf092;};return _0x4039();}import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.58.2';const bold=_0x434ffa=>_0x9f6b82(0x1f7)+_0x434ffa+'\x1b[0m';export function getPlaywrightVersion(){const _0x54b208=_0x9f6b82,_0x521d80={'lJljG':'playwright/package.json'};try{const _0x1218fe=require[_0x54b208(0x209)](_0x521d80[_0x54b208(0x227)]),_0x2b32d9=require(_0x1218fe);return _0x2b32d9['version'];}catch{return null;}}export function installChromiumBinary(_0x214dc9,_0x3f4825=![]){const _0x2fa63c=_0x9f6b82,_0x592810={'rfNiG':function(_0x2967ae,_0x1d90db){return _0x2967ae(_0x1d90db);},'XoBpH':function(_0x52b5e1,_0x2e9a18,_0x5b8bfc,_0x5b85a7){return _0x52b5e1(_0x2e9a18,_0x5b8bfc,_0x5b85a7);},'cYZEt':function(_0x26579,_0x51f8eb){return _0x26579===_0x51f8eb;},'cgdqW':_0x2fa63c(0x20d)};return new Promise((_0x29a27f,_0x1d5e65)=>{const _0x135de7=_0x2fa63c,_0x2663f3=[_0x135de7(0x1f5)+_0x214dc9,_0x135de7(0x21c),..._0x3f4825?['--with-deps']:[],'chromium'],_0x1306ec=_0x592810['XoBpH'](spawn,_0x135de7(0x1fb),_0x2663f3,{'stdio':[_0x135de7(0x1ed),'inherit','inherit'],'shell':_0x592810['cYZEt'](process[_0x135de7(0x1e8)],_0x592810['cgdqW'])});_0x1306ec['on']('close',_0x368a2f=>{const _0x23773a=_0x135de7;_0x368a2f===0x0?_0x29a27f():_0x592810[_0x23773a(0x1f1)](_0x1d5e65,new Error(_0x23773a(0x1ef)+_0x368a2f));}),_0x1306ec['on']('error',_0x21a67e=>{_0x1d5e65(_0x21a67e);});});}export async function authenticate(_0x203359){const _0x3948aa=_0x9f6b82,_0x2c04ea={'AAtZU':function(_0x478876){return _0x478876();},'LYEcc':function(_0x279fbc){return _0x279fbc();},'CQhmz':function(_0x53b363,_0x35ef5a){return _0x53b363(_0x35ef5a);},'nfhGh':'✓\x20Exported\x20credentials\x20for\x20CI'};if(!_0x203359){const _0x4f9c2e=await _0x2c04ea['AAtZU'](getToken);if(_0x4f9c2e){const _0x1ff817=await getCurrentUser(_0x4f9c2e);if(_0x1ff817['success'])return console['log'](_0x3948aa(0x20c)+_0x1ff817['user'][_0x3948aa(0x1e0)]),{'token':_0x4f9c2e,'method':'existing_token'};}try{_0x203359=await _0x2c04ea[_0x3948aa(0x1fe)](runDeviceAuthFlow);}catch(_0x5ecb71){throw new Error('Authentication\x20failed:\x20'+(_0x5ecb71 instanceof Error?_0x5ecb71['message']:_0x5ecb71));}const _0x1cc99e=await _0x2c04ea['CQhmz'](getCurrentUser,_0x203359);if(!_0x1cc99e[_0x3948aa(0x203)])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x1cc99e[_0x3948aa(0x1d7)]);return console[_0x3948aa(0x1f6)](_0x3948aa(0x1f2)+_0x1cc99e[_0x3948aa(0x1ec)]['organizationName']),{'token':_0x203359,'method':_0x3948aa(0x210)};}console['log']('Validating\x20API\x20token...');const _0x1b2bce=await getCurrentUser(_0x203359);if(!_0x1b2bce['success']){if(_0x1b2bce[_0x3948aa(0x1e5)])throw new Error('Authentication\x20failed:\x20'+_0x1b2bce[_0x3948aa(0x1d7)]+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error(_0x3948aa(0x21d)+_0x1b2bce['error']+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console[_0x3948aa(0x1f6)]('✓\x20Authenticated\x20to\x20'+_0x1b2bce['user']['organizationName']),await _0x2c04ea[_0x3948aa(0x1dd)](storeToken,_0x203359),console['log'](process['env']['GITHUB_ENV']?_0x2c04ea[_0x3948aa(0x1e7)]:'✓\x20Stored\x20credentials\x20locally'),{'token':_0x203359,'method':_0x3948aa(0x1fc)};}export async function ensureRangerDir(_0x14e3a1){const _0x1a31cf=_0x9f6b82,_0x465163={'JluAW':function(_0x1344e4){return _0x1344e4();},'UfTRc':function(_0x3dbad7,_0x59a277,_0x40a2ed){return _0x3dbad7(_0x59a277,_0x40a2ed);},'qeKFa':'✓\x20~/.ranger/\x20directory\x20already\x20exists'};void _0x14e3a1;const _0x2b0646=_0x465163[_0x1a31cf(0x1e2)](getRangerHomeDir);return!existsSync(_0x2b0646)?(await _0x465163['UfTRc'](mkdir,_0x2b0646,{'recursive':!![]}),console['log']('✓\x20Created\x20~/.ranger/\x20directory'),{'path':_0x2b0646,'installed':!![]}):(console[_0x1a31cf(0x1f6)](_0x465163['qeKFa']),{'path':_0x2b0646,'installed':![]});}export async function ensureChromium(_0x24060d=![]){const _0x21f6b0=_0x9f6b82,_0x3371ac={'jhVzO':function(_0x51ae65,_0x1710fe){return _0x51ae65(_0x1710fe);},'OXVnf':'✓\x20Playwright\x20Chromium\x20browser\x20found','sLykZ':function(_0x3eac7c,_0x40a7d9){return _0x3eac7c??_0x40a7d9;},'qZYwv':'\x20(fallback\x20version)','oKwSt':function(_0x32742d,_0x4e0390){return _0x32742d instanceof _0x4e0390;},'BCJLA':_0x21f6b0(0x1f8)};let _0x327607=![];try{const _0x2d5bdc=chromium['executablePath']();_0x327607=_0x3371ac['jhVzO'](existsSync,_0x2d5bdc);}catch{_0x327607=![];}if(_0x327607)return console['log'](_0x3371ac['OXVnf']),![];const _0x502a55=getPlaywrightVersion(),_0x10c9ca=_0x3371ac[_0x21f6b0(0x1d1)](_0x502a55,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x54815c=!_0x502a55,_0x277549=process['stdin'][_0x21f6b0(0x228)]&&process[_0x21f6b0(0x1cc)][_0x21f6b0(0x228)];let _0x107cfe=!![];if(_0x277549){const {install:_0x4e4d00}=await _0x2bf274['prompt']([{'type':'confirm','name':_0x21f6b0(0x21c),'message':_0x54815c?_0x21f6b0(0x1ff)+_0x10c9ca+'\x20now?':_0x21f6b0(0x1d6)+_0x10c9ca+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x107cfe=_0x4e4d00;}else console[_0x21f6b0(0x1f6)]('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x10c9ca+(_0x54815c?_0x3371ac['qZYwv']:'')+_0x21f6b0(0x205));if(_0x107cfe){console[_0x21f6b0(0x1f6)](_0x21f6b0(0x1d2));try{await installChromiumBinary(_0x10c9ca,_0x24060d),console['log'](_0x21f6b0(0x1e6));}catch(_0x4a5888){console[_0x21f6b0(0x1d7)]('\x0a❌\x20Failed\x20to\x20install\x20Chromium:',_0x3371ac[_0x21f6b0(0x200)](_0x4a5888,Error)?_0x4a5888['message']:_0x4a5888),console[_0x21f6b0(0x1f6)](_0x3371ac['BCJLA']),console[_0x21f6b0(0x1f6)](_0x21f6b0(0x215)+_0x10c9ca+_0x21f6b0(0x220));}}else console['log']('\x0a⚠\x20Skipping\x20Chromium\x20installation.'),console['log']('You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'),console[_0x21f6b0(0x1f6)](_0x21f6b0(0x215)+_0x10c9ca+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x5b8ca0){const _0x465f57=_0x9f6b82,_0xfdb8bd={'iMrDA':'.gitignore','rCwni':function(_0x136dc1,_0x3fad7e,_0x3f7e98){return _0x136dc1(_0x3fad7e,_0x3f7e98);},'vUXXa':_0x465f57(0x1da)},_0x384e0d=join(_0x5b8ca0,_0xfdb8bd['iMrDA']),_0x3540f0=_0x465f57(0x1d4);await _0xfdb8bd[_0x465f57(0x221)](writeFile,_0x384e0d,_0x3540f0),console[_0x465f57(0x1f6)](_0xfdb8bd[_0x465f57(0x1e9)]);}export async function ensureLocalEnv(_0x5ce3cb,_0x10fe03){const _0x3dc7f9=_0x9f6b82,_0xd1849c={'dUizi':function(_0x5c2c78){return _0x5c2c78();},'GAVwi':function(_0x22d553,_0x522de1){return _0x22d553!==_0x522de1;},'lLski':function(_0x2f34c4,_0x4eda1e){return _0x2f34c4===_0x4eda1e;},'VPORU':_0x3dc7f9(0x1ec),'tTODe':function(_0x3448f6){return _0x3448f6();},'bPDdJ':function(_0x3a16f4,_0xbcc842,_0x474499){return _0x3a16f4(_0xbcc842,_0x474499);},'Ejcig':_0x3dc7f9(0x1e3),'TKsJL':'✓\x20Local\x20profile\x20already\x20exists','WtSIr':function(_0x31bde6,_0x34fd6e,_0x5272ef,_0x7a6a80){return _0x31bde6(_0x34fd6e,_0x5272ef,_0x7a6a80);},'IPURS':_0x3dc7f9(0x217),'SRFlV':function(_0x17f329,_0x17ce7e){return _0x17f329 instanceof _0x17ce7e;}};if(!_0xd1849c['dUizi'](findGitRoot)&&_0xd1849c['GAVwi'](_0x5ce3cb?.['scope'],_0x3dc7f9(0x1ec)))return console['log']('⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.'),{'ready':![],'skipped':!![]};const _0x4681c0=_0xd1849c['lLski'](_0x5ce3cb?.[_0x3dc7f9(0x1cd)],_0xd1849c['VPORU'])?_0xd1849c['tTODe'](getRangerHomeDir):undefined;if(_0xd1849c['bPDdJ'](findExistingEnv,_0xd1849c[_0x3dc7f9(0x22c)],{'locations':[_0x3dc7f9(0x1e3)],'rangerDir':_0x4681c0}))return console['log'](_0xd1849c['TKsJL']),{'ready':!![],'skipped':![]};try{return await _0xd1849c[_0x3dc7f9(0x1f9)](addEnv,'local',{'url':_0x5ce3cb?.['url'],'force':_0x5ce3cb?.['force'],'allowInsecureLocalhost':_0x5ce3cb?.[_0x3dc7f9(0x229)],'scope':_0x5ce3cb?.[_0x3dc7f9(0x1cd)]},_0x10fe03),{'ready':!![],'skipped':![]};}catch(_0xa57259){return console[_0x3dc7f9(0x1d7)](_0xd1849c[_0x3dc7f9(0x208)],_0xd1849c['SRFlV'](_0xa57259,Error)?_0xa57259[_0x3dc7f9(0x1ea)]:_0xa57259),{'ready':![],'skipped':![]};}}export async function start(_0x5d085a,_0x47dd86,_0x552cac){const _0x2ba3f1=_0x9f6b82,_0x2cf2b6={'YIXKr':function(_0x3d7a0a,_0x563769){return _0x3d7a0a!==_0x563769;},'sKOGq':_0x2ba3f1(0x1ec),'SqdcA':function(_0x20f884,_0x35a5b2){return _0x20f884+_0x35a5b2;},'qMcvO':function(_0x516647,_0x3e86b2){return _0x516647(_0x3e86b2);},'chrpk':function(_0x554c77,_0x34c395){return _0x554c77(_0x34c395);},'cZptG':_0x2ba3f1(0x1f4),'hJETF':_0x2ba3f1(0x1df),'aMzjz':function(_0xf43a2f,_0x3cd6c1){return _0xf43a2f(_0x3cd6c1);},'tVktJ':'✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','pSqeX':_0x2ba3f1(0x1ee),'bqilY':_0x2ba3f1(0x1de),'uaVCD':function(_0x349210,_0x1a2394){return _0x349210(_0x1a2394);},'koAxF':function(_0x355a6f,_0x11366d){return _0x355a6f&&_0x11366d;},'PLtrx':_0x2ba3f1(0x20b),'oaoci':_0x2ba3f1(0x20f),'aQSRs':function(_0x2cfd5f){return _0x2cfd5f();},'FykWS':'\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','zISiS':function(_0x1254e2,_0x2af144,_0x3d1508){return _0x1254e2(_0x2af144,_0x3d1508);},'QOviO':'ranger\x20profile\x20add\x20<name>','BApGH':'and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','ujFjL':'with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','JTaOO':_0x2ba3f1(0x21f),'FUdku':'/ranger:enable','JRrvj':function(_0x3b1526,_0x15a299){return _0x3b1526+_0x15a299;}};console[_0x2ba3f1(0x1f6)]('\x0a🚀\x20Ranger\x20Setup\x0a');_0x2cf2b6[_0x2ba3f1(0x214)](_0x47dd86?.['scope'],undefined)&&_0x47dd86['scope']!==_0x2cf2b6['sKOGq']&&(console['error'](_0x2cf2b6['SqdcA'](_0x2ba3f1(0x216)+_0x2cf2b6[_0x2ba3f1(0x207)](String,_0x47dd86[_0x2ba3f1(0x1cd)])+_0x2ba3f1(0x1cf)+_0x2ba3f1(0x204),'project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.')),process[_0x2ba3f1(0x218)](0x1));_0x47dd86={..._0x47dd86,'scope':_0x2ba3f1(0x1ec)};const _0x5b4808=!_0x2cf2b6['chrpk'](existsSync,getRangerHomeDir());await _0x2cf2b6[_0x2ba3f1(0x207)](ensureRangerDir,'user');if(_0x47dd86?.['skipAuth'])console[_0x2ba3f1(0x1f6)](_0x2cf2b6[_0x2ba3f1(0x225)]),_0x552cac?.['trackPhaseEnd'](_0x2cf2b6[_0x2ba3f1(0x1e1)],{'isFirstRun':_0x5b4808,'method':_0x2ba3f1(0x20a)});else{_0x552cac?.[_0x2ba3f1(0x1fa)]('auth');const _0x2fcc1e=await _0x2cf2b6[_0x2ba3f1(0x202)](authenticate,_0x5d085a);_0x552cac?.[_0x2ba3f1(0x21b)]('auth',{'isFirstRun':_0x5b4808,'method':_0x2fcc1e[_0x2ba3f1(0x1ce)]});}_0x552cac?.[_0x2ba3f1(0x1fa)](_0x2ba3f1(0x1ee));_0x47dd86?.['skipChromium']?console['log'](_0x2cf2b6['tVktJ']):await ensureChromium(_0x47dd86?.[_0x2ba3f1(0x213)]);_0x552cac?.[_0x2ba3f1(0x21b)](_0x2cf2b6[_0x2ba3f1(0x1e4)],{'isFirstRun':_0x5b4808,'skipped':!!_0x47dd86?.['skipChromium']}),console[_0x2ba3f1(0x1f6)]('\x0a✅\x20Ranger\x20setup\x20complete!\x0a');const _0x21e83f=_0x47dd86?.[_0x2ba3f1(0x1cd)],_0xf0e91=_0x47dd86?.[_0x2ba3f1(0x212)]??![];let _0x23c858=null;_0xf0e91?(_0x552cac?.[_0x2ba3f1(0x1fa)](_0x2cf2b6[_0x2ba3f1(0x1d9)]),_0x23c858=await ensureOpencodePluginConfig(_0x21e83f),_0x552cac?.[_0x2ba3f1(0x21b)](_0x2cf2b6[_0x2ba3f1(0x1d9)],{'isFirstRun':_0x5b4808,'opencode':!![]})):(_0x552cac?.[_0x2ba3f1(0x1fa)](_0x2cf2b6['bqilY']),await _0x2cf2b6[_0x2ba3f1(0x224)](ensureClaudePlugin,_0x21e83f),_0x552cac?.[_0x2ba3f1(0x21b)](_0x2cf2b6[_0x2ba3f1(0x1d9)],{'isFirstRun':_0x5b4808}));if(_0x2cf2b6['koAxF'](_0xf0e91,_0x23c858)){_0x552cac?.['trackPhaseStart'](_0x2cf2b6['PLtrx']);try{await installSkill(_0x2cf2b6['oaoci'],{'level':_0x23c858['scope'],'cliVersion':_0x2cf2b6['aQSRs'](getCurrentVersion),'platform':'opencode'}),_0x552cac?.[_0x2ba3f1(0x21b)](_0x2ba3f1(0x20b),{'isFirstRun':_0x5b4808,'opencode':!![]});}catch(_0x582225){console[_0x2ba3f1(0x201)](_0x2ba3f1(0x22a),_0x582225 instanceof Error?_0x582225[_0x2ba3f1(0x1ea)]:_0x582225),_0x552cac?.['trackPhaseEnd'](_0x2cf2b6['PLtrx'],{'isFirstRun':_0x5b4808,'opencode':!![],'failed':!![]});}}else _0x552cac?.['trackPhaseStart'](_0x2ba3f1(0x20b)),await ensureClaudeSkills(_0x21e83f),_0x552cac?.[_0x2ba3f1(0x21b)]('skills',{'isFirstRun':_0x5b4808});if(_0x47dd86?.['skipAuth'])console[_0x2ba3f1(0x1f6)](_0x2cf2b6[_0x2ba3f1(0x226)]);else{if(_0x47dd86?.[_0x2ba3f1(0x1cb)]){_0x552cac?.[_0x2ba3f1(0x1fa)](_0x2ba3f1(0x20e));const _0x1785ad=await _0x2cf2b6['zISiS'](ensureLocalEnv,{'url':_0x47dd86[_0x2ba3f1(0x1cb)],'force':_0x47dd86?.['force'],'allowInsecureLocalhost':_0x47dd86?.['allowInsecureLocalhost'],'scope':'user'},_0x552cac);_0x552cac?.[_0x2ba3f1(0x21b)](_0x2ba3f1(0x20e),{'isFirstRun':_0x5b4808,'profileReady':_0x1785ad[_0x2ba3f1(0x206)],'userSkipped':_0x1785ad['skipped']});}else console[_0x2ba3f1(0x1f6)](_0x2cf2b6['SqdcA'](_0x2ba3f1(0x1f0),'\x0a\x20\x20'+bold(_0x2cf2b6['QOviO']))+'\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)'+'\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:'+'\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles');}if(_0xf0e91)console['log']('\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)'),console['log'](_0x2cf2b6['BApGH']),console[_0x2ba3f1(0x1f6)](_0x2cf2b6['ujFjL']),console[_0x2ba3f1(0x1f6)](_0x2cf2b6['JTaOO']);else{const _0x1e6642=_0x2cf2b6['uaVCD'](bold,_0x2cf2b6['FUdku']);console['log'](_0x2cf2b6[_0x2ba3f1(0x211)]('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x1e6642+'\x20and\x20prompt\x20the\x20coding'+_0x2ba3f1(0x1fd)+'\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser',_0x2ba3f1(0x1d8)));}}
1
+ const _0x564c27=_0x566d;(function(_0x556348,_0x159c1b){const _0x318d30=_0x566d,_0x49ed0b=_0x556348();while(!![]){try{const _0x1201d8=parseInt(_0x318d30(0x21c))/0x1*(-parseInt(_0x318d30(0x218))/0x2)+parseInt(_0x318d30(0x219))/0x3+-parseInt(_0x318d30(0x226))/0x4*(-parseInt(_0x318d30(0x227))/0x5)+parseInt(_0x318d30(0x21d))/0x6+-parseInt(_0x318d30(0x25b))/0x7*(parseInt(_0x318d30(0x200))/0x8)+-parseInt(_0x318d30(0x21b))/0x9*(parseInt(_0x318d30(0x1fe))/0xa)+-parseInt(_0x318d30(0x22a))/0xb*(-parseInt(_0x318d30(0x217))/0xc);if(_0x1201d8===_0x159c1b)break;else _0x49ed0b['push'](_0x49ed0b['shift']());}catch(_0x442e1a){_0x49ed0b['push'](_0x49ed0b['shift']());}}}(_0x3572,0x8d155));function _0x566d(_0x3dea96,_0x15b5f7){_0x3dea96=_0x3dea96-0x1f4;const _0x3572a7=_0x3572();let _0x566d73=_0x3572a7[_0x3dea96];return _0x566d73;}import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x5dc645 from'inquirer';function _0x3572(){const _0x2278b2=['\x0a⚠\x20Skipping\x20Chromium\x20installation.','\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','GXxpl','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','KMOfM','DmbCt','force','method','\x0aInstalling\x20Chromium\x20browser...\x0a','organizationName','AFIwk','npx','SBXjl','pilhp','chromium','ICZdh',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','exit','\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','TGwvP','OBSwW','✓\x20Skipping\x20authentication\x20(--skip-auth)','\x1b[1m','provided_token','MBYLK','user','\x20\x20npx\x20playwright@','rAvYn','cmcjb','UqMou','scope','✓\x20Local\x20profile\x20already\x20exists','mCvHr','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','NHpnN','Authentication\x20failed:\x20','bEYBs','ranger\x20setup\x20--scope=','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','BkmXR','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','profile','490161EOoATb','You\x20can\x20install\x20it\x20manually\x20by\x20running:','ZdmNP','install','withDeps','✓\x20Playwright\x20Chromium\x20browser\x20found','url','log','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','local','success','130210VcQfUW','IsRtA','120kblBQu','ranger\x20profile\x20add\x20<name>','GttUW','stdout','✓\x20Created\x20~/.ranger/\x20directory','inherit','yUUQE','playwright/package.json','--with-deps','\x20now?','\x1b[0m','error','trackPhaseEnd','ready','uKpZH','prompt','trackPhaseStart','message','ranger','✓\x20Created\x20.ranger/.gitignore','✓\x20Already\x20authenticated\x20to\x20','opencode','skills','24AKhvqT','4YEwnNm','630744oOPWqL','env','486iIbSVx','341203pahYEb','2821416gdIYak','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','\x20install\x20chromium','status','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','xDHob','✓\x20Authenticated\x20to\x20','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','Validating\x20API\x20token...','8316tHGLkJ','830Pthpdx','aODUF','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','10934902YLaIab','auth','yRVOB','ZfXEw'];_0x3572=function(){return _0x2278b2;};return _0x3572();}import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.58.2';const bold=_0x3a0e6b=>_0x564c27(0x246)+_0x3a0e6b+_0x564c27(0x20a);export function getPlaywrightVersion(){const _0x5dc974=_0x564c27,_0x24abf1={'KMOfM':_0x5dc974(0x207)};try{const _0x48c40a=require['resolve'](_0x24abf1[_0x5dc974(0x232)]),_0x3992c8=require(_0x48c40a);return _0x3992c8['version'];}catch{return null;}}export function installChromiumBinary(_0x31ed42,_0x148f73=![]){const _0x5d0a4b=_0x564c27,_0x5c2070={'SIzdq':function(_0x361536,_0x50122d){return _0x361536(_0x50122d);},'UqMou':function(_0x4082a9,_0x4be2fb){return _0x4082a9===_0x4be2fb;},'cmcjb':function(_0x504c8a,_0x43a9a0){return _0x504c8a(_0x43a9a0);},'iuXSy':_0x5d0a4b(0x1f6),'TGwvP':function(_0x5a918b,_0x206a02,_0x281d07,_0x1eacff){return _0x5a918b(_0x206a02,_0x281d07,_0x1eacff);},'SBXjl':'ignore','PEgZx':'inherit'};return new Promise((_0x5ecd40,_0x4dfb8e)=>{const _0x43568c=_0x5d0a4b,_0x29870f={'dzFDp':function(_0x2b07f2,_0x28bf4f){const _0x29cf1d=_0x566d;return _0x5c2070[_0x29cf1d(0x24d)](_0x2b07f2,_0x28bf4f);},'KHZsa':function(_0x5067bb,_0x54e022){const _0x4c26f1=_0x566d;return _0x5c2070[_0x4c26f1(0x24c)](_0x5067bb,_0x54e022);}},_0x5e2333=['playwright@'+_0x31ed42,_0x5c2070['iuXSy'],..._0x148f73?[_0x43568c(0x208)]:[],'chromium'],_0x1f345a=_0x5c2070[_0x43568c(0x243)](spawn,_0x43568c(0x239),_0x5e2333,{'stdio':[_0x5c2070[_0x43568c(0x23a)],_0x5c2070['PEgZx'],_0x43568c(0x205)],'shell':_0x5c2070['UqMou'](process['platform'],'win32')});_0x1f345a['on']('close',_0x172a52=>{_0x29870f['dzFDp'](_0x172a52,0x0)?_0x5ecd40():_0x29870f['KHZsa'](_0x4dfb8e,new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x172a52));}),_0x1f345a['on']('error',_0x408d78=>{_0x5c2070['SIzdq'](_0x4dfb8e,_0x408d78);});});}export async function authenticate(_0x212e9f){const _0x488836=_0x564c27,_0x5251c1={'mCvHr':function(_0x22319b,_0x51c589){return _0x22319b(_0x51c589);},'qCqrU':'existing_token','Fqema':function(_0x526626,_0x31e479){return _0x526626 instanceof _0x31e479;},'xDHob':function(_0xe57363,_0x20f9ff){return _0xe57363(_0x20f9ff);},'DmbCt':'device_auth','leODi':'✓\x20Exported\x20credentials\x20for\x20CI','NHpnN':'✓\x20Stored\x20credentials\x20locally'};if(!_0x212e9f){const _0x325262=await getToken();if(_0x325262){const _0x35fc3b=await _0x5251c1[_0x488836(0x250)](getCurrentUser,_0x325262);if(_0x35fc3b[_0x488836(0x1fd)])return console[_0x488836(0x1fa)](_0x488836(0x214)+_0x35fc3b['user'][_0x488836(0x237)]),{'token':_0x325262,'method':_0x5251c1['qCqrU']};}try{_0x212e9f=await runDeviceAuthFlow();}catch(_0x110784){throw new Error(_0x488836(0x253)+(_0x5251c1['Fqema'](_0x110784,Error)?_0x110784['message']:_0x110784));}const _0x5e6dad=await _0x5251c1[_0x488836(0x222)](getCurrentUser,_0x212e9f);if(!_0x5e6dad[_0x488836(0x1fd)])throw new Error(_0x488836(0x231)+_0x5e6dad['error']);return console[_0x488836(0x1fa)](_0x488836(0x223)+_0x5e6dad['user'][_0x488836(0x237)]),{'token':_0x212e9f,'method':_0x5251c1[_0x488836(0x233)]};}console['log'](_0x488836(0x225));const _0x24c7af=await getCurrentUser(_0x212e9f);if(!_0x24c7af[_0x488836(0x1fd)]){if(_0x24c7af[_0x488836(0x220)])throw new Error('Authentication\x20failed:\x20'+_0x24c7af[_0x488836(0x20b)]+_0x488836(0x258));else throw new Error(_0x488836(0x21e)+_0x24c7af[_0x488836(0x20b)]+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console['log'](_0x488836(0x223)+_0x24c7af[_0x488836(0x249)]['organizationName']),await storeToken(_0x212e9f),console[_0x488836(0x1fa)](process[_0x488836(0x21a)]['GITHUB_ENV']?_0x5251c1['leODi']:_0x5251c1[_0x488836(0x252)]),{'token':_0x212e9f,'method':_0x488836(0x247)};}export async function ensureRangerDir(_0x500514){const _0x48663d=_0x564c27,_0x564e39={'wueFm':function(_0x4183bc){return _0x4183bc();},'vPeoe':_0x48663d(0x204)};void _0x500514;const _0x2e27d5=_0x564e39['wueFm'](getRangerHomeDir);return!existsSync(_0x2e27d5)?(await mkdir(_0x2e27d5,{'recursive':!![]}),console[_0x48663d(0x1fa)](_0x564e39['vPeoe']),{'path':_0x2e27d5,'installed':!![]}):(console[_0x48663d(0x1fa)]('✓\x20~/.ranger/\x20directory\x20already\x20exists'),{'path':_0x2e27d5,'installed':![]});}export async function ensureChromium(_0x3b30e8=![]){const _0x2e53a1=_0x564c27,_0x3c4ab7={'IsRtA':function(_0x19c1b2,_0x25596d){return _0x19c1b2??_0x25596d;},'ZdmNP':'\x20(fallback\x20version)','DnEIc':function(_0x1850f8,_0x41fed3,_0x50c4ac){return _0x1850f8(_0x41fed3,_0x50c4ac);},'LcvdQ':'\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','TQJUw':'\x0a❌\x20Failed\x20to\x20install\x20Chromium:','lMNwa':function(_0x402d5b,_0x136b3f){return _0x402d5b instanceof _0x136b3f;}};let _0x3169d1=![];try{const _0x2375ac=chromium['executablePath']();_0x3169d1=existsSync(_0x2375ac);}catch{_0x3169d1=![];}if(_0x3169d1)return console['log'](_0x2e53a1(0x1f8)),![];const _0x275441=getPlaywrightVersion(),_0x3ec33c=_0x3c4ab7[_0x2e53a1(0x1ff)](_0x275441,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x3468f3=!_0x275441,_0x4fc98b=process['stdin']['isTTY']&&process[_0x2e53a1(0x203)]['isTTY'];let _0x813a6d=!![];if(_0x4fc98b){const {install:_0x3b8247}=await _0x5dc645[_0x2e53a1(0x20f)]([{'type':'confirm','name':'install','message':_0x3468f3?_0x2e53a1(0x224)+_0x3ec33c+_0x2e53a1(0x209):'The\x20required\x20version\x20('+_0x3ec33c+_0x2e53a1(0x23e),'default':!![]}]);_0x813a6d=_0x3b8247;}else console['log'](_0x2e53a1(0x256)+_0x3ec33c+(_0x3468f3?_0x3c4ab7[_0x2e53a1(0x1f5)]:'')+'...');if(_0x813a6d){console['log'](_0x2e53a1(0x236));try{await _0x3c4ab7['DnEIc'](installChromiumBinary,_0x3ec33c,_0x3b30e8),console['log'](_0x3c4ab7['LcvdQ']);}catch(_0x580e67){console[_0x2e53a1(0x20b)](_0x3c4ab7['TQJUw'],_0x3c4ab7['lMNwa'](_0x580e67,Error)?_0x580e67[_0x2e53a1(0x211)]:_0x580e67),console['log'](_0x2e53a1(0x1f4)),console['log']('\x20\x20npx\x20playwright@'+_0x3ec33c+'\x20install\x20chromium');}}else console['log'](_0x2e53a1(0x22e)),console[_0x2e53a1(0x1fa)]('You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'),console[_0x2e53a1(0x1fa)](_0x2e53a1(0x24a)+_0x3ec33c+_0x2e53a1(0x21f));return!![];}export async function writeRangerGitignore(_0x27280d){const _0x45de35=_0x564c27,_0x157bdd={'yUUQE':'.gitignore','ZfXEw':function(_0x13333f,_0x3a1b79,_0xdc12a9){return _0x13333f(_0x3a1b79,_0xdc12a9);}},_0x459c4b=join(_0x27280d,_0x157bdd[_0x45de35(0x206)]),_0x29a083=_0x45de35(0x22f);await _0x157bdd[_0x45de35(0x22d)](writeFile,_0x459c4b,_0x29a083),console[_0x45de35(0x1fa)](_0x45de35(0x213));}export async function ensureLocalEnv(_0x153783,_0x556130){const _0x20e225=_0x564c27,_0x3ad5a6={'VoIBn':function(_0x155586){return _0x155586();},'MBYLK':_0x20e225(0x251),'arDKm':'user','CFSrJ':function(_0x4a32b4){return _0x4a32b4();},'OBSwW':function(_0xba1f83,_0x939a0c,_0x596a85){return _0xba1f83(_0x939a0c,_0x596a85);},'pilhp':_0x20e225(0x1fc),'rAvYn':_0x20e225(0x24f),'bxtPu':function(_0x5938ba,_0x5429e5,_0x65eda8,_0x28eb95){return _0x5938ba(_0x5429e5,_0x65eda8,_0x28eb95);},'kWqKW':'\x0a❌\x20Profile\x20setup\x20failed:','DfOed':function(_0x5f3f7d,_0x9732a2){return _0x5f3f7d instanceof _0x9732a2;}};if(!_0x3ad5a6['VoIBn'](findGitRoot)&&_0x153783?.['scope']!==_0x20e225(0x249))return console[_0x20e225(0x1fa)](_0x3ad5a6[_0x20e225(0x248)]),{'ready':![],'skipped':!![]};const _0x396889=_0x153783?.[_0x20e225(0x24e)]===_0x3ad5a6['arDKm']?_0x3ad5a6['CFSrJ'](getRangerHomeDir):undefined;if(_0x3ad5a6[_0x20e225(0x244)](findExistingEnv,_0x3ad5a6[_0x20e225(0x23b)],{'locations':[_0x3ad5a6[_0x20e225(0x23b)]],'rangerDir':_0x396889}))return console['log'](_0x3ad5a6[_0x20e225(0x24b)]),{'ready':!![],'skipped':![]};try{return await _0x3ad5a6['bxtPu'](addEnv,_0x20e225(0x1fc),{'url':_0x153783?.[_0x20e225(0x1f9)],'force':_0x153783?.['force'],'allowInsecureLocalhost':_0x153783?.['allowInsecureLocalhost'],'scope':_0x153783?.[_0x20e225(0x24e)]},_0x556130),{'ready':!![],'skipped':![]};}catch(_0xdc0c5d){return console[_0x20e225(0x20b)](_0x3ad5a6['kWqKW'],_0x3ad5a6['DfOed'](_0xdc0c5d,Error)?_0xdc0c5d['message']:_0xdc0c5d),{'ready':![],'skipped':![]};}}export async function start(_0x51b4f6,_0x485b0b,_0x68c728){const _0x1f87c1=_0x564c27,_0x19a8c0={'GyDQg':'\x0a🚀\x20Ranger\x20Setup\x0a','uKpZH':function(_0x4afd02,_0x5f58d6){return _0x4afd02!==_0x5f58d6;},'AFIwk':_0x1f87c1(0x249),'aODUF':function(_0xdb7290,_0x188bdb){return _0xdb7290+_0x188bdb;},'XEjJt':function(_0x4abf9d,_0x135871){return _0x4abf9d(_0x135871);},'OLYIk':_0x1f87c1(0x23c),'sfwNz':'\x0a✅\x20Ranger\x20setup\x20complete!\x0a','GttUW':'plugin','GXxpl':function(_0x5271b2,_0x8d47d0,_0x212946){return _0x5271b2(_0x8d47d0,_0x212946);},'jWyFE':'opencode','BkmXR':_0x1f87c1(0x216),'iOJIS':function(_0x119d17,_0x2be06b){return _0x119d17(_0x2be06b);},'ICZdh':_0x1f87c1(0x25a),'MkEmI':function(_0x39c56e,_0x24cb97,_0x4d3a69){return _0x39c56e(_0x24cb97,_0x4d3a69);},'yRVOB':function(_0x4f4b72,_0x10a616){return _0x4f4b72+_0x10a616;},'ruMGp':'and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','bEYBs':'/ranger:enable'};console['log'](_0x19a8c0['GyDQg']);_0x19a8c0[_0x1f87c1(0x20e)](_0x485b0b?.[_0x1f87c1(0x24e)],undefined)&&_0x485b0b['scope']!==_0x19a8c0[_0x1f87c1(0x238)]&&(console[_0x1f87c1(0x20b)](_0x19a8c0[_0x1f87c1(0x228)](_0x19a8c0['aODUF'](_0x1f87c1(0x255)+_0x19a8c0['XEjJt'](String,_0x485b0b[_0x1f87c1(0x24e)])+'\x20is\x20no\x20longer\x20supported.\x20',_0x1f87c1(0x229)),'project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.')),process[_0x1f87c1(0x240)](0x1));_0x485b0b={..._0x485b0b,'scope':_0x19a8c0[_0x1f87c1(0x238)]};const _0x1b8a65=!existsSync(getRangerHomeDir());await _0x19a8c0['XEjJt'](ensureRangerDir,'user');if(_0x485b0b?.['skipAuth'])console['log'](_0x1f87c1(0x245)),_0x68c728?.['trackPhaseEnd'](_0x1f87c1(0x22b),{'isFirstRun':_0x1b8a65,'method':'skipped'});else{_0x68c728?.[_0x1f87c1(0x210)]('auth');const _0x19df89=await authenticate(_0x51b4f6);_0x68c728?.['trackPhaseEnd'](_0x1f87c1(0x22b),{'isFirstRun':_0x1b8a65,'method':_0x19df89[_0x1f87c1(0x235)]});}_0x68c728?.[_0x1f87c1(0x210)](_0x19a8c0['OLYIk']);_0x485b0b?.['skipChromium']?console[_0x1f87c1(0x1fa)](_0x1f87c1(0x259)):await ensureChromium(_0x485b0b?.[_0x1f87c1(0x1f7)]);_0x68c728?.['trackPhaseEnd'](_0x19a8c0['OLYIk'],{'isFirstRun':_0x1b8a65,'skipped':!!_0x485b0b?.['skipChromium']}),console['log'](_0x19a8c0['sfwNz']);const _0x32d79d=_0x485b0b?.[_0x1f87c1(0x24e)],_0xcb5c1b=_0x485b0b?.[_0x1f87c1(0x215)]??![];let _0x1973ed=null;_0xcb5c1b?(_0x68c728?.['trackPhaseStart'](_0x19a8c0['GttUW']),_0x1973ed=await ensureOpencodePluginConfig(_0x32d79d),_0x68c728?.[_0x1f87c1(0x20c)](_0x19a8c0[_0x1f87c1(0x202)],{'isFirstRun':_0x1b8a65,'opencode':!![]})):(_0x68c728?.['trackPhaseStart'](_0x19a8c0[_0x1f87c1(0x202)]),await ensureClaudePlugin(_0x32d79d),_0x68c728?.['trackPhaseEnd'](_0x19a8c0['GttUW'],{'isFirstRun':_0x1b8a65}));if(_0xcb5c1b&&_0x1973ed){_0x68c728?.['trackPhaseStart'](_0x1f87c1(0x216));try{await _0x19a8c0[_0x1f87c1(0x230)](installSkill,_0x1f87c1(0x212),{'level':_0x1973ed[_0x1f87c1(0x24e)],'cliVersion':getCurrentVersion(),'platform':_0x19a8c0['jWyFE']}),_0x68c728?.['trackPhaseEnd'](_0x1f87c1(0x216),{'isFirstRun':_0x1b8a65,'opencode':!![]});}catch(_0x581660){console['warn'](_0x1f87c1(0x242),_0x581660 instanceof Error?_0x581660[_0x1f87c1(0x211)]:_0x581660),_0x68c728?.[_0x1f87c1(0x20c)]('skills',{'isFirstRun':_0x1b8a65,'opencode':!![],'failed':!![]});}}else _0x68c728?.[_0x1f87c1(0x210)](_0x19a8c0[_0x1f87c1(0x257)]),await _0x19a8c0['iOJIS'](ensureClaudeSkills,_0x32d79d),_0x68c728?.['trackPhaseEnd'](_0x19a8c0[_0x1f87c1(0x257)],{'isFirstRun':_0x1b8a65});if(_0x485b0b?.['skipAuth'])console[_0x1f87c1(0x1fa)](_0x1f87c1(0x221));else{if(_0x485b0b?.['url']){_0x68c728?.[_0x1f87c1(0x210)](_0x19a8c0[_0x1f87c1(0x23d)]);const _0x2d8dd5=await _0x19a8c0['MkEmI'](ensureLocalEnv,{'url':_0x485b0b[_0x1f87c1(0x1f9)],'force':_0x485b0b?.[_0x1f87c1(0x234)],'allowInsecureLocalhost':_0x485b0b?.['allowInsecureLocalhost'],'scope':_0x19a8c0['AFIwk']},_0x68c728);_0x68c728?.[_0x1f87c1(0x20c)](_0x19a8c0['ICZdh'],{'isFirstRun':_0x1b8a65,'profileReady':_0x2d8dd5[_0x1f87c1(0x20d)],'userSkipped':_0x2d8dd5['skipped']});}else console[_0x1f87c1(0x1fa)](_0x19a8c0[_0x1f87c1(0x22c)]('\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:'+('\x0a\x20\x20'+bold(_0x1f87c1(0x201))),'\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)')+_0x1f87c1(0x241)+_0x1f87c1(0x23f));}if(_0xcb5c1b)console['log']('\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)'),console['log'](_0x19a8c0['ruMGp']),console['log']('with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'),console['log'](_0x1f87c1(0x1fb));else{const _0x2b52e2=bold(_0x19a8c0[_0x1f87c1(0x254)]);console[_0x1f87c1(0x1fa)]('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x2b52e2+'\x20and\x20prompt\x20the\x20coding'+'\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 +1 @@
1
- const _0x25c6fa=_0x9e42;(function(_0x517c61,_0x4f1997){const _0x458a48=_0x9e42,_0x3de672=_0x517c61();while(!![]){try{const _0x2f083d=parseInt(_0x458a48(0x1de))/0x1+-parseInt(_0x458a48(0x17f))/0x2*(-parseInt(_0x458a48(0x19f))/0x3)+-parseInt(_0x458a48(0x18d))/0x4*(parseInt(_0x458a48(0x1d7))/0x5)+parseInt(_0x458a48(0x1c6))/0x6*(-parseInt(_0x458a48(0x1b6))/0x7)+parseInt(_0x458a48(0x17c))/0x8+-parseInt(_0x458a48(0x1bb))/0x9*(-parseInt(_0x458a48(0x1d3))/0xa)+-parseInt(_0x458a48(0x1d2))/0xb;if(_0x2f083d===_0x4f1997)break;else _0x3de672['push'](_0x3de672['shift']());}catch(_0x238476){_0x3de672['push'](_0x3de672['shift']());}}}(_0x19da,0x9aa3f));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{listCloudProfiles}from'./utils/cloudProfile.js';import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x2b5cc7=>'\x1b[1m'+_0x2b5cc7+_0x25c6fa(0x17d),link=(_0x3738e3,_0x565cb9)=>_0x25c6fa(0x1bc)+_0x3738e3+'\x07'+(_0x565cb9||_0x3738e3)+_0x25c6fa(0x197);async function getOpencodePluginStatus(){const _0x3366c0=_0x25c6fa,_0x2b993e={'XtTuk':function(_0x5d9667,_0x13de9e){return _0x5d9667(_0x13de9e);},'GzvxX':function(_0x30bb6b,_0x41a579){return _0x30bb6b!==_0x41a579;},'fDZcR':'@ranger-testing/opencode-plugin','NIefY':function(_0x2665cc,_0x4e4839){return _0x2665cc>_0x4e4839;},'PmTov':_0x3366c0(0x17a),'MhtUI':function(_0x4525f8,_0x41b773,_0x2070d0,_0x99ba90){return _0x4525f8(_0x41b773,_0x2070d0,_0x99ba90);},'PODpH':'pipe','oHAWO':_0x3366c0(0x1ca),'jSCUU':_0x3366c0(0x19c)};return new Promise(_0x5ba450=>{const _0x1cf8c2=_0x3366c0,_0x23e9f6={'Novhj':function(_0x44a0a1,_0x1db13b){const _0x5f4bfb=_0x9e42;return _0x2b993e[_0x5f4bfb(0x18f)](_0x44a0a1,_0x1db13b);},'JPcqd':function(_0x211688,_0x560a5e){return _0x2b993e['GzvxX'](_0x211688,_0x560a5e);},'geNtG':_0x2b993e['fDZcR'],'sxjvT':'configured','FeaxC':function(_0x1def64,_0x304746){return _0x2b993e['NIefY'](_0x1def64,_0x304746);},'vsBLo':_0x2b993e['PmTov']},_0x5d8021=_0x2b993e[_0x1cf8c2(0x1d5)](spawn,'opencode',['debug',_0x1cf8c2(0x187)],{'stdio':['ignore','pipe',_0x2b993e[_0x1cf8c2(0x1b2)]]});let _0x1e0b30='';_0x5d8021[_0x1cf8c2(0x1c1)]?.['on'](_0x2b993e['oHAWO'],_0x10758a=>{_0x1e0b30+=_0x10758a['toString']();}),_0x5d8021[_0x1cf8c2(0x1a2)]?.['on']('data',_0x414ab9=>{_0x1e0b30+=_0x414ab9['toString']();}),_0x5d8021['on'](_0x1cf8c2(0x1b1),()=>{const _0x28c374=_0x1cf8c2;_0x23e9f6['Novhj'](_0x5ba450,{'status':_0x28c374(0x194)});}),_0x5d8021['on'](_0x2b993e['jSCUU'],_0x67d1b5=>{const _0x212f7b=_0x1cf8c2;if(_0x67d1b5!==0x0){_0x23e9f6[_0x212f7b(0x173)](_0x5ba450,{'status':_0x212f7b(0x194)});return;}const _0x300e27=_0x1e0b30[_0x212f7b(0x176)]();let _0x19031e=null;if(_0x300e27)try{_0x19031e=JSON[_0x212f7b(0x1c5)](_0x300e27);}catch{const _0xee0e1b=_0x300e27['match'](/\{[\s\S]*\}$/);if(_0xee0e1b)try{_0x19031e=JSON[_0x212f7b(0x1c5)](_0xee0e1b[0x0]);}catch{_0x19031e=null;}}const _0x5eb7cc=Array[_0x212f7b(0x1a8)](_0x19031e?.['plugin'])?_0x19031e?.[_0x212f7b(0x1dd)]:[],_0x4f5169=_0x5eb7cc[_0x212f7b(0x177)](_0x5626b6=>{if(_0x23e9f6['JPcqd'](typeof _0x5626b6,'string'))return![];return _0x5626b6['includes'](_0x23e9f6['geNtG'])||_0x5626b6['includes']('opencode-plugin');});if(_0x4f5169){_0x23e9f6[_0x212f7b(0x173)](_0x5ba450,{'status':_0x23e9f6['sxjvT'],'details':_0x23e9f6['FeaxC'](_0x5eb7cc[_0x212f7b(0x170)],0x0)?_0x5eb7cc[_0x212f7b(0x170)]+'\x20plugin(s)\x20configured':undefined});return;}if(_0x5eb7cc[_0x212f7b(0x170)]>0x0){_0x5ba450({'status':_0x23e9f6['vsBLo'],'details':_0x5eb7cc['length']+_0x212f7b(0x195)});return;}_0x5ba450({'status':'not_configured'});});});}function _0x19da(){const _0x52f5db=['displayName','8DlTZOT','\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>','XtTuk','CQfTS','scope','includes','version','not_installed','\x20plugin(s)\x20configured','enabled','\x1b]8;;\x07','isDirectory','@ranger-testing/opencode-plugin','project','filter','close','RrFHy','\x20\x20User-level:','9xTUihS','hasEncryptedAuth','unknown','stderr','sbWap','API\x20Environment:\x20','auth.json','bKGKB','Root:\x20','isArray','\x20\x20Project-level:','push','cwd','(not\x20found)','\x20(active)','NKxhn','\x20\x20Run:\x20ranger\x20setup\x20[token]','details','error','PODpH','\x20\x20Run:\x20ranger\x20setup\x20--opencode','log','isActive','6692791iLLLdh','\x0a---\x20OpenCode\x20Plugin\x20---','ranger@trailhead','aMEBx','match','1665uceaLH','\x1b]8;;file://','all','OeJpR','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','hasPlaintextAuth','stdout','SKILL.md','\x20\x20\x20\x20Session:\x20','name','parse','6VJIwMi','\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)','success','GaApE','data','\x20(latest:\x20','status','RrAfC','path','vltBa','\x20[local]','ipDoE','4618691KKvNBf','24430nudKfM','\x20\x20\x20\x20','MhtUI','sessionUpdatedAt','97400pLWelG','no\x20session','pGhar','xBtgr','auth.json.enc','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','plugin','832746RtCOtr','length','has','join','Novhj','API\x20URL:\x20','env','trim','some','plaintext','\x20\x20Not\x20configured','not_configured','user','1689512DxxhRw','\x1b[0m','cached\x20(updated\x20','368314FvtsUf','No\x20profiles\x20configured','vxEZL','\x0a---\x20Claude\x20Code\x20Plugin\x20---','YAWCI','utf-8','map','Organization:\x20','config','organizationName','\x20[cloud]','No\x20skills\x20installed','sRfNk'];_0x19da=function(){return _0x52f5db;};return _0x19da();}async function getSkillsFromDir(_0x69dccd,_0x473d52){const _0x84afa3=_0x25c6fa,_0x33f711={'JJUmC':function(_0x4d8ace,_0x449827){return _0x4d8ace(_0x449827);},'ipDoE':function(_0x269f05,_0xf9b8c5,_0x42d9ec){return _0x269f05(_0xf9b8c5,_0x42d9ec);},'RrFHy':_0x84afa3(0x1c2),'YAWCI':_0x84afa3(0x184)};if(!_0x33f711['JJUmC'](existsSync,_0x69dccd))return[];const _0x382557=[];try{const _0x2917a4=await _0x33f711[_0x84afa3(0x1d1)](readdir,_0x69dccd,{'withFileTypes':!![]});for(const _0x32202e of _0x2917a4){if(_0x32202e[_0x84afa3(0x198)]()){const _0x3117d3=join(_0x69dccd,_0x32202e[_0x84afa3(0x1c4)],_0x33f711[_0x84afa3(0x19d)]);if(existsSync(_0x3117d3)){let _0x558486=_0x32202e[_0x84afa3(0x1c4)];try{const _0x5bee68=await readFile(_0x3117d3,_0x33f711[_0x84afa3(0x183)]),_0x18ef58=_0x5bee68[_0x84afa3(0x1ba)](/name:\s*(.+)/);_0x18ef58&&(_0x558486=_0x18ef58[0x1]['trim']());}catch{}_0x382557['push']({'name':_0x32202e['name'],'displayName':_0x558486,'path':_0x3117d3,'level':_0x473d52});}}}}catch{return[];}return _0x382557;}async function getInstalledSkills(){const _0x58dd7c=_0x25c6fa,_0x2528a3={'FZizg':function(_0x162284,_0x11df9b,_0xb5a761){return _0x162284(_0x11df9b,_0xb5a761);},'NZTZB':function(_0x4283d5){return _0x4283d5();},'GaApE':_0x58dd7c(0x19a),'OeJpR':'user'},[_0x11e7a,_0x40412e]=await Promise[_0x58dd7c(0x1bd)]([_0x2528a3['FZizg'](getSkillsFromDir,_0x2528a3['NZTZB'](getProjectSkillsDir),_0x2528a3[_0x58dd7c(0x1c9)]),_0x2528a3['FZizg'](getSkillsFromDir,getUserSkillsDir(),_0x2528a3[_0x58dd7c(0x1be)])]);return{'project':_0x11e7a,'user':_0x40412e};}function _0x9e42(_0x2f3ba8,_0x3d7be2){_0x2f3ba8=_0x2f3ba8-0x170;const _0x19da2d=_0x19da();let _0x9e420d=_0x19da2d[_0x2f3ba8];return _0x9e420d;}async function getEnvironments(){const _0x3b5e20=_0x25c6fa,_0x419dda={'GIgDc':function(_0x5a3727,_0x597dad){return _0x5a3727(_0x597dad);},'dcGeY':_0x3b5e20(0x1db),'wejfD':function(_0xf14de0,_0x2eae64){return _0xf14de0(_0x2eae64);},'wDZth':function(_0x4d8876,_0x513b0d){return _0x4d8876===_0x513b0d;}},{envNames:_0x206274,activeEnv:_0x5d6d69}=await getEnvNames(),_0x51b94a=getRangerDir();if(!existsSync(_0x51b94a))return{'envs':[],'activeEnv':null};const _0x8f236e=_0x206274[_0x3b5e20(0x185)](_0x2f84c9=>{const _0x5d525b=_0x3b5e20,_0x51c58f=_0x419dda['GIgDc'](getEnvDir,_0x2f84c9),_0x48f1b3=join(_0x51c58f,'settings.json'),_0x5d5e3e=join(_0x51c58f,_0x5d525b(0x1a5)),_0x375c9c=join(_0x51c58f,_0x419dda['dcGeY']);return{'name':_0x2f84c9,'settingsPath':existsSync(_0x48f1b3)?_0x48f1b3:_0x5d525b(0x1ac),'hasPlaintextAuth':_0x419dda['wejfD'](existsSync,_0x5d5e3e),'hasEncryptedAuth':existsSync(_0x375c9c),'isActive':_0x419dda['wDZth'](_0x2f84c9,_0x5d6d69)};});return{'envs':_0x8f236e,'activeEnv':_0x5d6d69};}export async function status(){const _0x819df4=_0x25c6fa,_0x12c0ab={'sRfNk':function(_0x131815,_0x401805){return _0x131815(_0x401805);},'vltBa':function(_0x5b0d20,_0x1b3558){return _0x5b0d20(_0x1b3558);},'xBtgr':function(_0x4beea8,_0x3e8af4,_0x33f2db){return _0x4beea8(_0x3e8af4,_0x33f2db);},'sbWap':function(_0x1ac194,_0x5a3859){return _0x1ac194(_0x5a3859);},'aMEBx':function(_0x4e05df,_0x4027a5){return _0x4e05df!==_0x4027a5;},'CQfTS':function(_0x5c7e70){return _0x5c7e70();},'pGhar':_0x819df4(0x199),'bKGKB':function(_0x44898f,_0x415414){return _0x44898f===_0x415414;},'vJAjo':_0x819df4(0x1b3),'RrAfC':'disabled','WBdXO':'\x0a---\x20Skills\x20---','TWozb':function(_0x3df83e,_0x53d1c8){return _0x3df83e>_0x53d1c8;},'NKxhn':_0x819df4(0x1a9),'JfdEh':function(_0x577dfc,_0x4e2a4d,_0x2b2106){return _0x577dfc(_0x4e2a4d,_0x2b2106);},'zOdgU':_0x819df4(0x180),'njOpF':_0x819df4(0x1ad),'vjgtr':_0x819df4(0x1d8),'vxEZL':'none','GqSuN':'(not\x20found)'};console[_0x819df4(0x1b4)]('\x0a📊\x20Ranger\x20Status\x0a');const _0x3b51e3=process[_0x819df4(0x1ab)](),_0x2715ca=getRangerDir();if(!_0x12c0ab[_0x819df4(0x18b)](existsSync,_0x2715ca)){console['log'](_0x819df4(0x1a7)+link(_0x3b51e3,bold(_0x12c0ab['vltBa'](basename,_0x3b51e3)))),console[_0x819df4(0x1b4)]('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console['log'](_0x819df4(0x1a7)+_0x12c0ab[_0x819df4(0x1da)](link,_0x3b51e3,bold(_0x12c0ab[_0x819df4(0x1a3)](basename,_0x3b51e3))));const _0x53d5f4=getCurrentVersion(),_0x4eb7ed=getLatestVersion();if(_0x4eb7ed[_0x819df4(0x193)]&&_0x12c0ab[_0x819df4(0x1b9)](_0x4eb7ed[_0x819df4(0x193)],_0x53d5f4))console['log']('Version:\x20'+_0x53d5f4+_0x819df4(0x1cb)+_0x4eb7ed['version']+')'),console[_0x819df4(0x1b4)]('\x20\x20Run:\x20ranger\x20update');else _0x4eb7ed['version']?console['log']('Version:\x20'+_0x53d5f4+'\x20(up\x20to\x20date)'):console[_0x819df4(0x1b4)]('Version:\x20'+_0x53d5f4);const _0x5dfbce=await _0x12c0ab['CQfTS'](getToken);if(_0x5dfbce){const _0x3c7f26=await getCurrentUser(_0x5dfbce);_0x3c7f26[_0x819df4(0x1c8)]?console['log'](_0x819df4(0x186)+bold(_0x3c7f26[_0x819df4(0x17b)][_0x819df4(0x188)])):(console[_0x819df4(0x1b4)](_0x819df4(0x1bf)),console['log'](_0x819df4(0x1af)));}else console[_0x819df4(0x1b4)]('API\x20Token:\x20✗\x20Not\x20found'),console[_0x819df4(0x1b4)](_0x819df4(0x1af));process[_0x819df4(0x175)]['DEBUG']&&(console[_0x819df4(0x1b4)](_0x819df4(0x1a4)+getCurrentEnvironment()),console['log'](_0x819df4(0x174)+_0x12c0ab['CQfTS'](getApiBaseUrl)));console[_0x819df4(0x1b4)](_0x819df4(0x1b7));const _0x5a624b=await getOpencodePluginStatus();if(_0x5a624b[_0x819df4(0x1cc)]==='configured')console[_0x819df4(0x1b4)]('\x20\x20'+bold(_0x12c0ab[_0x819df4(0x1d9)])+':\x20configured'),_0x5a624b['details']&&console['log']('\x20\x20'+_0x5a624b[_0x819df4(0x1b0)]);else _0x12c0ab[_0x819df4(0x1a6)](_0x5a624b['status'],'not_configured')?(console['log'](_0x819df4(0x179)),_0x5a624b[_0x819df4(0x1b0)]&&console[_0x819df4(0x1b4)]('\x20\x20'+_0x5a624b[_0x819df4(0x1b0)]),console[_0x819df4(0x1b4)](_0x12c0ab['vJAjo'])):console[_0x819df4(0x1b4)]('\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available');console[_0x819df4(0x1b4)](_0x819df4(0x182));const _0x52b03d=await getPluginInfo('ranger@trailhead');if(_0x52b03d){const _0x39b0e1=_0x52b03d[_0x819df4(0x191)]||_0x819df4(0x1a1),_0x3a7b5=_0x52b03d[_0x819df4(0x196)]?'enabled':_0x12c0ab[_0x819df4(0x1cd)];console['log']('\x20\x20'+bold(_0x819df4(0x1b8))+':\x20installed\x20('+_0x39b0e1+',\x20'+_0x3a7b5+')');}else console[_0x819df4(0x1b4)]('\x20\x20Not\x20installed'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)');console['log'](_0x12c0ab['WBdXO']);const {project:_0x329db4,user:_0x2d787f}=await getInstalledSkills(),_0x9d50a2=_0x329db4[_0x819df4(0x19b)](_0x53d122=>RANGER_MANAGED_SKILLS['includes'](_0x53d122['name'])),_0x967621=_0x2d787f['filter'](_0x59c6aa=>RANGER_MANAGED_SKILLS[_0x819df4(0x192)](_0x59c6aa[_0x819df4(0x1c4)])),_0x1abd74=_0x9d50a2[_0x819df4(0x170)]+_0x967621[_0x819df4(0x170)];if(_0x1abd74===0x0)console['log'](_0x819df4(0x18a)),console[_0x819df4(0x1b4)]('\x20\x20Run:\x20ranger\x20skillup');else{if(_0x12c0ab['TWozb'](_0x9d50a2[_0x819df4(0x170)],0x0)){console[_0x819df4(0x1b4)](_0x12c0ab[_0x819df4(0x1ae)]);for(const _0x197d89 of _0x9d50a2){console[_0x819df4(0x1b4)](_0x819df4(0x1d4)+bold(_0x197d89[_0x819df4(0x18c)])+':\x20'+link(_0x197d89[_0x819df4(0x1ce)],basename(_0x197d89['path'])));}}if(_0x967621['length']>0x0){console[_0x819df4(0x1b4)](_0x819df4(0x19e));for(const _0x5be26d of _0x967621){console['log']('\x20\x20\x20\x20'+bold(_0x5be26d['displayName'])+':\x20'+_0x12c0ab['JfdEh'](link,_0x5be26d[_0x819df4(0x1ce)],basename(_0x5be26d[_0x819df4(0x1ce)])));}}}console['log']('\x0a---\x20Profiles\x20---');const {envs:_0x2f1ea2,activeEnv:_0x37dc37}=await _0x12c0ab[_0x819df4(0x190)](getEnvironments);let _0x32c2e9=[];if(_0x5dfbce)try{_0x32c2e9=await listCloudProfiles();}catch{}const _0x2ac32c=_0x2f1ea2['length']+_0x32c2e9[_0x819df4(0x170)];if(_0x2ac32c===0x0)console[_0x819df4(0x1b4)](_0x12c0ab['zOdgU']),console['log'](_0x819df4(0x18e));else{if(_0x2ac32c>0x5){const _0x5e5c90=[];_0x12c0ab['TWozb'](_0x32c2e9[_0x819df4(0x170)],0x0)&&_0x5e5c90[_0x819df4(0x1aa)](_0x32c2e9['length']+'\x20cloud'),_0x12c0ab['TWozb'](_0x2f1ea2[_0x819df4(0x170)],0x0)&&_0x5e5c90['push'](_0x2f1ea2[_0x819df4(0x170)]+'\x20local'),console[_0x819df4(0x1b4)](_0x2ac32c+'\x20profiles\x20configured\x20('+_0x5e5c90['join'](',\x20')+')'),_0x37dc37&&console['log']('\x20\x20Active:\x20'+bold(_0x37dc37)),console[_0x819df4(0x1b4)](_0x819df4(0x1c7));}else{for(const _0x695f7e of _0x32c2e9){const _0x39208b=_0x12c0ab['bKGKB'](_0x695f7e[_0x819df4(0x1c4)],_0x37dc37)?_0x12c0ab['njOpF']:'';console['log']('\x20\x20'+bold(_0x695f7e[_0x819df4(0x1c4)])+_0x819df4(0x189)+_0x39208b);const _0x3b1d4a=_0x695f7e['sessionUpdatedAt']?_0x819df4(0x17e)+_0x695f7e[_0x819df4(0x1d6)]+')':_0x12c0ab['vjgtr'];console['log'](_0x819df4(0x1c3)+_0x3b1d4a);}const _0x8b143e=new Set(_0x32c2e9['map'](_0x33be48=>_0x33be48[_0x819df4(0x1c4)]));for(const _0x28601b of _0x2f1ea2){if(_0x8b143e['has'](_0x28601b['name']))continue;const _0x2dce9e=_0x28601b[_0x819df4(0x1b5)]?'\x20(active)':'',_0x5b5b95=_0x28601b[_0x819df4(0x1a0)]?'encrypted':_0x28601b[_0x819df4(0x1c0)]?_0x819df4(0x178):_0x12c0ab[_0x819df4(0x181)];console[_0x819df4(0x1b4)]('\x20\x20'+_0x12c0ab[_0x819df4(0x1cf)](bold,_0x28601b[_0x819df4(0x1c4)])+_0x819df4(0x1d0)+_0x2dce9e),console[_0x819df4(0x1b4)]('\x20\x20\x20\x20Auth:\x20'+_0x5b5b95),_0x28601b['settingsPath']!==_0x12c0ab['GqSuN']&&console['log']('\x20\x20\x20\x20Settings:\x20'+_0x12c0ab[_0x819df4(0x1da)](link,_0x28601b['settingsPath'],basename(_0x28601b['settingsPath'])));}if(!_0x37dc37){console[_0x819df4(0x1b4)]('\x0a\x20\x20No\x20active\x20profile\x20set');const _0x392cf1=[..._0x32c2e9[_0x819df4(0x185)](_0x4ee362=>_0x4ee362['name']),..._0x2f1ea2['filter'](_0x1a357b=>!_0x8b143e[_0x819df4(0x171)](_0x1a357b[_0x819df4(0x1c4)]))[_0x819df4(0x185)](_0x50dca2=>_0x50dca2[_0x819df4(0x1c4)])];console[_0x819df4(0x1b4)](_0x819df4(0x1dc)+_0x392cf1[_0x819df4(0x172)](',\x20')+')');}}}console['log']('');}
1
+ const _0x2515e8=_0x947a;function _0x947a(_0x35d9c4,_0x54883f){_0x35d9c4=_0x35d9c4-0xf8;const _0x12b445=_0x12b4();let _0x947aca=_0x12b445[_0x35d9c4];return _0x947aca;}(function(_0x27cd1d,_0x310a1d){const _0x4de029=_0x947a,_0x59171e=_0x27cd1d();while(!![]){try{const _0xe2f88b=parseInt(_0x4de029(0x102))/0x1+parseInt(_0x4de029(0x132))/0x2*(-parseInt(_0x4de029(0x138))/0x3)+parseInt(_0x4de029(0x152))/0x4*(parseInt(_0x4de029(0x119))/0x5)+-parseInt(_0x4de029(0x108))/0x6+-parseInt(_0x4de029(0x101))/0x7+-parseInt(_0x4de029(0x144))/0x8*(parseInt(_0x4de029(0x155))/0x9)+-parseInt(_0x4de029(0x166))/0xa*(-parseInt(_0x4de029(0x13a))/0xb);if(_0xe2f88b===_0x310a1d)break;else _0x59171e['push'](_0x59171e['shift']());}catch(_0x7d76d7){_0x59171e['push'](_0x59171e['shift']());}}}(_0x12b4,0xc7f6a));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';function _0x12b4(){const _0x50f214=['debug','Organization:\x20','DykTc','\x20profiles\x20configured\x20(','No\x20profiles\x20configured','\x20\x20Not\x20configured','KtoUm','105NNbbID','name','cwd','YsArR','\x1b]8;;file://','TZwMd','pipe','not_installed','isActive','(not\x20found)','\x1b[1m','pjyhC','sDIBy','string','Vruht','disabled','uaNGJ','QqCSD','join','includes','UMBNS','settingsPath','isArray','\x0a---\x20OpenCode\x20Plugin\x20---','API\x20Environment:\x20','556RbSqDN','mxyzi','no\x20session','data','ndMyW','Version:\x20','15837YtWUQk','Root:\x20','77EiTiwN','ignore','vWTtJ','\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>','opencode-plugin','PHBUL','isDirectory','Dsrnw','\x20[cloud]','log','123120aiaRKr','\x20\x20\x20\x20','has','version','dNqVD','weJml','bLpRK','filter','settings.json','\x20\x20\x20\x20Auth:\x20','config','configured','path','\x20[local]','199576BpNlcM','PqPST','XsnvC','162QzgtId','\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)','auth.json','DNrnR','unknown','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','\x20\x20User-level:','push','yVjrN','XTYEb','some','match','\x1b[0m','details','length','cMjIT','organizationName','3711410tAsezh','\x20(active)','toString','\x1b]8;;\x07','error','scope','\x0a---\x20Claude\x20Code\x20Plugin\x20---','jEKYO','\x0a📊\x20Ranger\x20Status\x0a','\x20(up\x20to\x20date)','trim','\x20\x20\x20\x20Session:\x20',':\x20configured','all','IDcTl','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','cached\x20(updated\x20','enabled','8276674yVtJzC','843773okdvQO','hYluv','ranger@trailhead','mzEXo','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','dzYyt','4461120MPrAyk','JeIeb','No\x20skills\x20installed','\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a','MWWWF','noSRL','displayName',':\x20installed\x20(','sessionUpdatedAt','map'];_0x12b4=function(){return _0x50f214;};return _0x12b4();}import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{listCloudProfiles}from'./utils/cloudProfile.js';import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x217c48=>_0x2515e8(0x123)+_0x217c48+_0x2515e8(0x161),link=(_0x1d6d37,_0x525b79)=>_0x2515e8(0x11d)+_0x1d6d37+'\x07'+(_0x525b79||_0x1d6d37)+_0x2515e8(0x169);async function getOpencodePluginStatus(){const _0x107354=_0x2515e8,_0x401089={'gojpO':function(_0x422f1f,_0x31900d){return _0x422f1f(_0x31900d);},'dzYyt':function(_0x187e65,_0x55f8aa){return _0x187e65>_0x55f8aa;},'SqMNd':_0x107354(0x14e),'noSRL':_0x107354(0x11f),'MobRJ':_0x107354(0x135),'OTHzd':'close'};return new Promise(_0xb76385=>{const _0x3ff7ed=_0x107354,_0x46d1ae={'ehBMo':_0x3ff7ed(0x13e),'uaNGJ':function(_0x3fe188,_0x18c4a5){return _0x3fe188!==_0x18c4a5;},'MWWWF':function(_0x711d41,_0x3e2c82){return _0x711d41(_0x3e2c82);},'qMZHm':_0x3ff7ed(0x120),'sDIBy':function(_0x389e3f,_0x4cddf7){const _0x312eb2=_0x3ff7ed;return _0x401089[_0x312eb2(0x107)](_0x389e3f,_0x4cddf7);},'vWTtJ':'not_configured','UMBNS':function(_0x108c52,_0x19e569){return _0x108c52(_0x19e569);}},_0x29507b=spawn('opencode',[_0x3ff7ed(0x112),_0x401089['SqMNd']],{'stdio':[_0x3ff7ed(0x13b),'pipe',_0x401089[_0x3ff7ed(0x10d)]]});let _0x496ada='';_0x29507b['stdout']?.['on'](_0x401089['MobRJ'],_0x20d9cf=>{_0x496ada+=_0x20d9cf['toString']();}),_0x29507b['stderr']?.['on'](_0x401089['MobRJ'],_0x36f7cd=>{const _0x5d8f33=_0x3ff7ed;_0x496ada+=_0x36f7cd[_0x5d8f33(0x168)]();}),_0x29507b['on'](_0x3ff7ed(0x16a),()=>{_0x401089['gojpO'](_0xb76385,{'status':'not_installed'});}),_0x29507b['on'](_0x401089['OTHzd'],_0x53c651=>{const _0x441bd6=_0x3ff7ed,_0x19b360={'ndMyW':_0x46d1ae['ehBMo']};if(_0x46d1ae[_0x441bd6(0x129)](_0x53c651,0x0)){_0x46d1ae['MWWWF'](_0xb76385,{'status':_0x46d1ae['qMZHm']});return;}const _0x20a57d=_0x496ada[_0x441bd6(0xf9)]();let _0x20fab1=null;if(_0x20a57d)try{_0x20fab1=JSON['parse'](_0x20a57d);}catch{const _0x1fb165=_0x20a57d[_0x441bd6(0x160)](/\{[\s\S]*\}$/);if(_0x1fb165)try{_0x20fab1=JSON['parse'](_0x1fb165[0x0]);}catch{_0x20fab1=null;}}const _0x109f64=Array[_0x441bd6(0x12f)](_0x20fab1?.['plugin'])?_0x20fab1?.['plugin']:[],_0x2555f5=_0x109f64[_0x441bd6(0x15f)](_0x472739=>{const _0x3fb7e4=_0x441bd6;if(typeof _0x472739!==_0x3fb7e4(0x126))return![];return _0x472739['includes']('@ranger-testing/opencode-plugin')||_0x472739[_0x3fb7e4(0x12c)](_0x19b360[_0x3fb7e4(0x136)]);});if(_0x2555f5){_0xb76385({'status':_0x441bd6(0x14f),'details':_0x109f64['length']>0x0?_0x109f64['length']+'\x20plugin(s)\x20configured':undefined});return;}if(_0x46d1ae[_0x441bd6(0x125)](_0x109f64['length'],0x0)){_0x46d1ae[_0x441bd6(0x10c)](_0xb76385,{'status':_0x46d1ae[_0x441bd6(0x13c)],'details':_0x109f64['length']+'\x20plugin(s)\x20configured'});return;}_0x46d1ae[_0x441bd6(0x12d)](_0xb76385,{'status':_0x46d1ae['vWTtJ']});});});}async function getSkillsFromDir(_0x5ed5ee,_0x44f454){const _0x255367=_0x2515e8,_0x1a552e={'YsArR':function(_0xf07a84,_0x4dc76b,_0x1935f6,_0x50c899){return _0xf07a84(_0x4dc76b,_0x1935f6,_0x50c899);},'MvFvB':'SKILL.md','VUFFL':function(_0x311133,_0x40f164){return _0x311133(_0x40f164);}};if(!existsSync(_0x5ed5ee))return[];const _0x32e7ec=[];try{const _0x1bfccb=await readdir(_0x5ed5ee,{'withFileTypes':!![]});for(const _0x26360d of _0x1bfccb){if(_0x26360d[_0x255367(0x140)]()){const _0x4da3be=_0x1a552e[_0x255367(0x11c)](join,_0x5ed5ee,_0x26360d['name'],_0x1a552e['MvFvB']);if(_0x1a552e['VUFFL'](existsSync,_0x4da3be)){let _0xe7f74f=_0x26360d['name'];try{const _0x4f9126=await readFile(_0x4da3be,'utf-8'),_0x3fea8f=_0x4f9126['match'](/name:\s*(.+)/);_0x3fea8f&&(_0xe7f74f=_0x3fea8f[0x1][_0x255367(0xf9)]());}catch{}_0x32e7ec[_0x255367(0x15c)]({'name':_0x26360d['name'],'displayName':_0xe7f74f,'path':_0x4da3be,'level':_0x44f454});}}}}catch{return[];}return _0x32e7ec;}async function getInstalledSkills(){const _0x3c6c5e=_0x2515e8,_0x3e7f3d={'PqPST':function(_0x409b4e,_0x259f75,_0x2d0877){return _0x409b4e(_0x259f75,_0x2d0877);},'pjyhC':function(_0x114cc1){return _0x114cc1();},'hYluv':'user'},[_0x8fe5dc,_0x2ce463]=await Promise[_0x3c6c5e(0xfc)]([_0x3e7f3d[_0x3c6c5e(0x153)](getSkillsFromDir,_0x3e7f3d['pjyhC'](getProjectSkillsDir),'project'),_0x3e7f3d[_0x3c6c5e(0x153)](getSkillsFromDir,_0x3e7f3d[_0x3c6c5e(0x124)](getUserSkillsDir),_0x3e7f3d[_0x3c6c5e(0x103)])]);return{'project':_0x8fe5dc,'user':_0x2ce463};}async function getEnvironments(){const _0x22b469=_0x2515e8,_0x3a0c15={'dNqVD':function(_0x8068a9,_0x22a21){return _0x8068a9(_0x22a21);},'jEKYO':_0x22b469(0x14c),'MCzcD':function(_0x2e4c4a,_0x5afbad,_0x5e94c0){return _0x2e4c4a(_0x5afbad,_0x5e94c0);},'CJOpF':_0x22b469(0x157),'yVjrN':'auth.json.enc','Klkef':function(_0x4ba820,_0x175d1d){return _0x4ba820(_0x175d1d);},'mxyzi':function(_0x4a5174,_0x32c66b){return _0x4a5174===_0x32c66b;},'aoXYe':function(_0x46b2d3){return _0x46b2d3();},'TZwMd':function(_0x27d467,_0x4b4867){return _0x27d467(_0x4b4867);}},{envNames:_0x3941cf,activeEnv:_0x585694}=await _0x3a0c15['aoXYe'](getEnvNames),_0xa5e24f=_0x3a0c15['aoXYe'](getRangerDir);if(!_0x3a0c15[_0x22b469(0x11e)](existsSync,_0xa5e24f))return{'envs':[],'activeEnv':null};const _0xe44bb2=_0x3941cf[_0x22b469(0x111)](_0x532284=>{const _0x13256b=_0x22b469,_0x2f7a1a=_0x3a0c15[_0x13256b(0x148)](getEnvDir,_0x532284),_0x29a860=join(_0x2f7a1a,_0x3a0c15[_0x13256b(0x16d)]),_0x53ef7a=_0x3a0c15['MCzcD'](join,_0x2f7a1a,_0x3a0c15['CJOpF']),_0x89a95d=join(_0x2f7a1a,_0x3a0c15[_0x13256b(0x15d)]);return{'name':_0x532284,'settingsPath':_0x3a0c15[_0x13256b(0x148)](existsSync,_0x29a860)?_0x29a860:_0x13256b(0x122),'hasPlaintextAuth':existsSync(_0x53ef7a),'hasEncryptedAuth':_0x3a0c15['Klkef'](existsSync,_0x89a95d),'isActive':_0x3a0c15[_0x13256b(0x133)](_0x532284,_0x585694)};});return{'envs':_0xe44bb2,'activeEnv':_0x585694};}export async function status(){const _0x51e0ce=_0x2515e8,_0x54b378={'Dsrnw':_0x51e0ce(0x16e),'XVqaZ':function(_0x1f671c){return _0x1f671c();},'DNrnR':function(_0x19d7f9,_0x56857b,_0x580ec1){return _0x19d7f9(_0x56857b,_0x580ec1);},'KgXJD':function(_0x26eedb,_0x4db997){return _0x26eedb(_0x4db997);},'mzEXo':function(_0x23ccf3){return _0x23ccf3();},'bLpRK':function(_0x20916e){return _0x20916e();},'weJml':function(_0x2f8544){return _0x2f8544();},'Vruht':function(_0x4d077d,_0x199ac5){return _0x4d077d===_0x199ac5;},'HnzOh':function(_0x1206e9,_0x58dbbc){return _0x1206e9(_0x58dbbc);},'PHBUL':'@ranger-testing/opencode-plugin','DykTc':function(_0x4ac422,_0x5c7126){return _0x4ac422===_0x5c7126;},'rClcD':_0x51e0ce(0x117),'YKMwk':'\x20\x20Run:\x20ranger\x20setup\x20--opencode','QqCSD':_0x51e0ce(0x159),'duLbw':_0x51e0ce(0x100),'UIhXV':_0x51e0ce(0x128),'BBesO':function(_0x4274cf,_0x2da24b){return _0x4274cf(_0x2da24b);},'jVZRh':_0x51e0ce(0x104),'WjnAv':'\x20\x20Not\x20installed','hFXPA':_0x51e0ce(0x106),'XTYEb':'\x0a---\x20Skills\x20---','JeIeb':function(_0x1b552c,_0x41e8f6){return _0x1b552c===_0x41e8f6;},'cMjIT':function(_0x19ac76,_0x50469e){return _0x19ac76>_0x50469e;},'hvpxy':function(_0x50f616,_0x424808){return _0x50f616>_0x424808;},'KtoUm':_0x51e0ce(0x15b),'wmiRf':function(_0x19b5f0,_0x27a40b,_0xac534f){return _0x19b5f0(_0x27a40b,_0xac534f);},'QXEFf':function(_0x1994cb,_0x1af7b8){return _0x1994cb(_0x1af7b8);},'XsnvC':function(_0x5272a7,_0x537b2a){return _0x5272a7+_0x537b2a;},'BXYQr':function(_0xcac71,_0x2a5913){return _0xcac71===_0x2a5913;},'IDcTl':function(_0x490555,_0x3cd2ca){return _0x490555(_0x3cd2ca);},'ZHfDB':'plaintext','mwISV':'none','Qyhta':function(_0x2b936a,_0x5dc87f){return _0x2b936a!==_0x5dc87f;}};console['log'](_0x54b378[_0x51e0ce(0x141)]);const _0x45d4a7=process[_0x51e0ce(0x11b)](),_0x9700c2=_0x54b378['XVqaZ'](getRangerDir);if(!existsSync(_0x9700c2)){console[_0x51e0ce(0x143)](_0x51e0ce(0x139)+_0x54b378[_0x51e0ce(0x158)](link,_0x45d4a7,bold(_0x54b378['KgXJD'](basename,_0x45d4a7)))),console['log'](_0x51e0ce(0x15a)),console[_0x51e0ce(0x143)](_0x51e0ce(0x10b));return;}console['log']('Root:\x20'+link(_0x45d4a7,_0x54b378['KgXJD'](bold,basename(_0x45d4a7))));const _0x149a6f=_0x54b378['XVqaZ'](getCurrentVersion),_0x370485=_0x54b378[_0x51e0ce(0x105)](getLatestVersion);if(_0x370485['version']&&_0x370485[_0x51e0ce(0x147)]!==_0x149a6f)console['log']('Version:\x20'+_0x149a6f+'\x20(latest:\x20'+_0x370485['version']+')'),console[_0x51e0ce(0x143)]('\x20\x20Run:\x20ranger\x20update');else _0x370485[_0x51e0ce(0x147)]?console[_0x51e0ce(0x143)](_0x51e0ce(0x137)+_0x149a6f+_0x51e0ce(0xf8)):console[_0x51e0ce(0x143)](_0x51e0ce(0x137)+_0x149a6f);const _0x16ead5=await _0x54b378[_0x51e0ce(0x14a)](getToken);if(_0x16ead5){const _0x543403=await getCurrentUser(_0x16ead5);_0x543403['success']?console['log'](_0x51e0ce(0x113)+bold(_0x543403['user'][_0x51e0ce(0x165)])):(console[_0x51e0ce(0x143)]('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console[_0x51e0ce(0x143)]('API\x20Token:\x20✗\x20Not\x20found'),console[_0x51e0ce(0x143)]('\x20\x20Run:\x20ranger\x20setup\x20[token]');process['env']['DEBUG']&&(console[_0x51e0ce(0x143)](_0x51e0ce(0x131)+_0x54b378['bLpRK'](getCurrentEnvironment)),console['log']('API\x20URL:\x20'+_0x54b378[_0x51e0ce(0x149)](getApiBaseUrl)));console['log'](_0x51e0ce(0x130));const _0x5c7167=await getOpencodePluginStatus();if(_0x54b378[_0x51e0ce(0x127)](_0x5c7167['status'],_0x51e0ce(0x14f)))console['log']('\x20\x20'+_0x54b378['HnzOh'](bold,_0x54b378[_0x51e0ce(0x13f)])+_0x51e0ce(0xfb)),_0x5c7167[_0x51e0ce(0x162)]&&console[_0x51e0ce(0x143)]('\x20\x20'+_0x5c7167[_0x51e0ce(0x162)]);else _0x54b378[_0x51e0ce(0x114)](_0x5c7167['status'],'not_configured')?(console[_0x51e0ce(0x143)](_0x54b378['rClcD']),_0x5c7167[_0x51e0ce(0x162)]&&console[_0x51e0ce(0x143)]('\x20\x20'+_0x5c7167[_0x51e0ce(0x162)]),console['log'](_0x54b378['YKMwk'])):console[_0x51e0ce(0x143)]('\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available');console[_0x51e0ce(0x143)](_0x51e0ce(0x16c));const _0x243ad8=await _0x54b378['HnzOh'](getPluginInfo,'ranger@trailhead');if(_0x243ad8){const _0x38eb67=_0x243ad8[_0x51e0ce(0x16b)]||_0x54b378[_0x51e0ce(0x12a)],_0x2ad361=_0x243ad8['enabled']?_0x54b378['duLbw']:_0x54b378['UIhXV'];console[_0x51e0ce(0x143)]('\x20\x20'+_0x54b378['BBesO'](bold,_0x54b378['jVZRh'])+_0x51e0ce(0x10f)+_0x38eb67+',\x20'+_0x2ad361+')');}else console['log'](_0x54b378['WjnAv']),console['log'](_0x54b378['hFXPA']);console[_0x51e0ce(0x143)](_0x54b378[_0x51e0ce(0x15e)]);const {project:_0x1b8d3e,user:_0x4f32cc}=await _0x54b378['bLpRK'](getInstalledSkills),_0x445c53=_0x1b8d3e[_0x51e0ce(0x14b)](_0x5a84d2=>RANGER_MANAGED_SKILLS[_0x51e0ce(0x12c)](_0x5a84d2['name'])),_0x114f55=_0x4f32cc['filter'](_0x541acb=>RANGER_MANAGED_SKILLS['includes'](_0x541acb['name'])),_0x5e9d85=_0x445c53[_0x51e0ce(0x163)]+_0x114f55['length'];if(_0x54b378[_0x51e0ce(0x109)](_0x5e9d85,0x0))console['log'](_0x51e0ce(0x10a)),console['log']('\x20\x20Run:\x20ranger\x20skillup');else{if(_0x54b378['cMjIT'](_0x445c53[_0x51e0ce(0x163)],0x0)){console[_0x51e0ce(0x143)]('\x20\x20Project-level:');for(const _0x54c601 of _0x445c53){console[_0x51e0ce(0x143)](_0x51e0ce(0x145)+bold(_0x54c601['displayName'])+':\x20'+link(_0x54c601['path'],basename(_0x54c601[_0x51e0ce(0x150)])));}}if(_0x54b378['hvpxy'](_0x114f55[_0x51e0ce(0x163)],0x0)){console[_0x51e0ce(0x143)](_0x54b378[_0x51e0ce(0x118)]);for(const _0x122559 of _0x114f55){console[_0x51e0ce(0x143)](_0x51e0ce(0x145)+bold(_0x122559[_0x51e0ce(0x10e)])+':\x20'+_0x54b378['wmiRf'](link,_0x122559['path'],_0x54b378['QXEFf'](basename,_0x122559[_0x51e0ce(0x150)])));}}}console[_0x51e0ce(0x143)]('\x0a---\x20Profiles\x20---');const {envs:_0x19a167,activeEnv:_0x491f68}=await _0x54b378['mzEXo'](getEnvironments);let _0x28ed68=[];if(_0x16ead5)try{_0x28ed68=await listCloudProfiles();}catch{}const _0x38eaaf=_0x54b378[_0x51e0ce(0x154)](_0x19a167['length'],_0x28ed68[_0x51e0ce(0x163)]);if(_0x54b378['BXYQr'](_0x38eaaf,0x0))console['log'](_0x51e0ce(0x116)),console['log'](_0x51e0ce(0x13d));else{if(_0x54b378['hvpxy'](_0x38eaaf,0x5)){const _0x3063c8=[];_0x28ed68[_0x51e0ce(0x163)]>0x0&&_0x3063c8[_0x51e0ce(0x15c)](_0x28ed68[_0x51e0ce(0x163)]+'\x20cloud'),_0x54b378[_0x51e0ce(0x164)](_0x19a167[_0x51e0ce(0x163)],0x0)&&_0x3063c8['push'](_0x19a167[_0x51e0ce(0x163)]+'\x20local'),console['log'](_0x38eaaf+_0x51e0ce(0x115)+_0x3063c8['join'](',\x20')+')'),_0x491f68&&console['log']('\x20\x20Active:\x20'+_0x54b378[_0x51e0ce(0xfd)](bold,_0x491f68)),console[_0x51e0ce(0x143)](_0x51e0ce(0x156));}else{for(const _0x511157 of _0x28ed68){const _0x49a603=_0x511157[_0x51e0ce(0x11a)]===_0x491f68?_0x51e0ce(0x167):'';console['log']('\x20\x20'+bold(_0x511157[_0x51e0ce(0x11a)])+_0x51e0ce(0x142)+_0x49a603);const _0x5dc990=_0x511157['sessionUpdatedAt']?_0x51e0ce(0xff)+_0x511157[_0x51e0ce(0x110)]+')':_0x51e0ce(0x134);console['log'](_0x51e0ce(0xfa)+_0x5dc990);}const _0xf356e1=new Set(_0x28ed68[_0x51e0ce(0x111)](_0x1d9e6a=>_0x1d9e6a[_0x51e0ce(0x11a)]));for(const _0x475d73 of _0x19a167){if(_0xf356e1['has'](_0x475d73[_0x51e0ce(0x11a)]))continue;const _0x44406b=_0x475d73[_0x51e0ce(0x121)]?_0x51e0ce(0x167):'',_0x2abcfd=_0x475d73['hasEncryptedAuth']?'encrypted':_0x475d73['hasPlaintextAuth']?_0x54b378['ZHfDB']:_0x54b378['mwISV'];console[_0x51e0ce(0x143)]('\x20\x20'+_0x54b378['BBesO'](bold,_0x475d73[_0x51e0ce(0x11a)])+_0x51e0ce(0x151)+_0x44406b),console[_0x51e0ce(0x143)](_0x51e0ce(0x14d)+_0x2abcfd),_0x54b378['Qyhta'](_0x475d73[_0x51e0ce(0x12e)],_0x51e0ce(0x122))&&console['log']('\x20\x20\x20\x20Settings:\x20'+link(_0x475d73['settingsPath'],basename(_0x475d73[_0x51e0ce(0x12e)])));}if(!_0x491f68){console[_0x51e0ce(0x143)]('\x0a\x20\x20No\x20active\x20profile\x20set');const _0x43ca7b=[..._0x28ed68['map'](_0xa59139=>_0xa59139['name']),..._0x19a167[_0x51e0ce(0x14b)](_0x589f7a=>!_0xf356e1[_0x51e0ce(0x146)](_0x589f7a[_0x51e0ce(0x11a)]))['map'](_0x36d418=>_0x36d418['name'])];console['log'](_0x51e0ce(0xfe)+_0x43ca7b[_0x51e0ce(0x12b)](',\x20')+')');}}}console['log']('');}