@ranger-testing/ranger-cli 2.5.4-alpha.a98f848-6 → 2.5.4-alpha.b28d3b1-14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/migrateProfile.js +1 -1
- package/build/commands/setup/claude.js +1 -1
- package/build/commands/setup/opencode.js +1 -1
- package/build/commands/setupCi.js +1 -1
- package/build/commands/skillup.js +1 -1
- package/build/commands/start.js +1 -1
- package/build/commands/status.js +1 -1
- package/build/commands/update.js +1 -1
- package/build/commands/updateEnv.js +1 -1
- package/build/commands/useEnv.js +1 -1
- package/build/commands/utils/activeProfile.js +1 -1
- package/build/commands/utils/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/cloudProfile.js +1 -1
- package/build/commands/utils/cloudProfileSession.js +1 -1
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/gitTracked.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/legacyWarning.js +1 -0
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/matchAuthEnvironment.js +1 -1
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/opencodeConfig.js +1 -1
- package/build/commands/utils/playwrightCli.js +1 -1
- package/build/commands/utils/profileMessages.js +1 -1
- package/build/commands/utils/profileSetupBanner.js +1 -1
- package/build/commands/utils/projectsConfig.js +1 -1
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/resolveProfileContext.js +1 -1
- package/build/commands/utils/resolveProfileUrl.js +1 -1
- package/build/commands/utils/retry.js +1 -1
- package/build/commands/utils/sessionCache.js +1 -1
- package/build/commands/utils/settings.js +1 -1
- package/build/commands/utils/skillContent.js +1 -1
- package/build/commands/utils/skills.js +1 -1
- package/build/commands/utils/stitchWebmFiles.js +1 -1
- package/build/commands/utils/telemetry.js +1 -1
- package/build/commands/utils/tokenRefresh.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -1
- package/build/commands/utils/userApi.js +1 -1
- package/build/commands/utils/version.js +1 -1
- package/build/commands/verifyFeature.js +1 -1
- package/build/commands/verifyFeatureCli.js +1 -1
- package/build/skills/ranger/SKILL.md +13 -7
- package/build/skills/ranger/create.md +16 -3
- package/build/skills/ranger/verify.md +25 -18
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x5216(_0x5a5996,_0x6ad4ef){_0x5a5996=_0x5a5996-0x1b7;const _0x5d2fd2=_0x5d2f();let _0x5216da=_0x5d2fd2[_0x5a5996];return _0x5216da;}const _0x1b7aea=_0x5216;(function(_0x13082e,_0x337f20){const _0x5aa144=_0x5216,_0x5a4468=_0x13082e();while(!![]){try{const _0x419d29=-parseInt(_0x5aa144(0x1d8))/0x1*(parseInt(_0x5aa144(0x1ec))/0x2)+parseInt(_0x5aa144(0x1e8))/0x3*(parseInt(_0x5aa144(0x1de))/0x4)+-parseInt(_0x5aa144(0x1e0))/0x5*(-parseInt(_0x5aa144(0x1ca))/0x6)+-parseInt(_0x5aa144(0x1dc))/0x7+-parseInt(_0x5aa144(0x1bd))/0x8+-parseInt(_0x5aa144(0x1bb))/0x9+parseInt(_0x5aa144(0x1cf))/0xa*(-parseInt(_0x5aa144(0x1d1))/0xb);if(_0x419d29===_0x337f20)break;else _0x5a4468['push'](_0x5a4468['shift']());}catch(_0x5241da){_0x5a4468['push'](_0x5a4468['shift']());}}}(_0x5d2f,0xd8939));import{delimiter,join}from'path';import{tmpdir}from'os';import{mkdirSync}from'fs';import{getAiProxyUrl}from'./environment.js';const AI_PROXY_METADATA_HEADERS_ENV_VAR='ANTHROPIC_CUSTOM_HEADERS',AGENT_ENV_PASSTHROUGH_KEYS=['PATH',_0x1b7aea(0x1cc),_0x1b7aea(0x1c1),_0x1b7aea(0x1d0),'TEMP','USERPROFILE',_0x1b7aea(0x1e4),_0x1b7aea(0x1b9),'XDG_CACHE_HOME','XDG_CONFIG_HOME',_0x1b7aea(0x1eb),'PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD','CHROME_BIN','CHROMIUM_BIN',_0x1b7aea(0x1df),_0x1b7aea(0x1e5),_0x1b7aea(0x1c2),_0x1b7aea(0x1c7),_0x1b7aea(0x1d6),'NPM_CONFIG_PREFIX',_0x1b7aea(0x1c8),'NPM_CONFIG_REGISTRY',_0x1b7aea(0x1d5),'NODE_ENV','RANGER_TEST_SKIP_BROWSER_WAIT','RANGER_DISABLE_MCP',AI_PROXY_METADATA_HEADERS_ENV_VAR],UNEXPANDED_PATH_TOKEN_PATTERNS=['${PATH}','$PATH',_0x1b7aea(0x1ce)];function parseCustomHeaders(_0x3f7e0d){const _0x3de071=_0x1b7aea,_0x19307e={'LDStd':function(_0x68b51,_0x2e4723){return _0x68b51+_0x2e4723;}};if(!_0x3f7e0d)return[];return _0x3f7e0d[_0x3de071(0x1c9)](/\r?\n/)['map'](_0x56b16c=>_0x56b16c['trim']())[_0x3de071(0x1e6)](Boolean)['map'](_0x35ad29=>{const _0x5db267=_0x3de071,_0x422ab4=_0x35ad29['indexOf'](':');if(_0x422ab4===-0x1)return null;const _0x20c9ab=_0x35ad29[_0x5db267(0x1d2)](0x0,_0x422ab4)[_0x5db267(0x1ea)](),_0x3209de=_0x35ad29[_0x5db267(0x1d2)](_0x19307e[_0x5db267(0x1e1)](_0x422ab4,0x1))['trim']();if(!_0x20c9ab)return null;return[_0x20c9ab,_0x3209de];})[_0x3de071(0x1e6)](_0x5f59a7=>_0x5f59a7!==null);}export function getAgentPathHealthWarning(_0x4ce221,_0xf01718=process[_0x1b7aea(0x1d9)]){const _0x136c28=_0x1b7aea,_0x1c8a6d={'AuyUm':function(_0x5cd1b2,_0x95b2d6){return _0x5cd1b2||_0x95b2d6;},'UGbGp':_0x136c28(0x1d3),'FYaOJ':function(_0x2e0047,_0xe560be){return _0x2e0047!==_0xe560be;},'KPQXt':_0x136c28(0x1e3),'XflaY':'/bin','bdEZl':function(_0x27ba3a,_0x9c096c){return _0x27ba3a&&_0x9c096c;},'YWxxV':_0x136c28(0x1bf),'jxxLz':'Your\x20PATH\x20looks\x20incomplete\x20for\x20browser\x20automation.\x20Ranger\x20will\x20keep\x20going,\x20but\x20browser\x20setup\x20may\x20fail.'},_0x1a8b8b=[],_0x2e2d06=_0x1c8a6d[_0x136c28(0x1e7)](_0x4ce221,'')['split'](delimiter)[_0x136c28(0x1e6)](Boolean);_0x2e2d06['length']===0x0&&_0x1a8b8b['push'](_0x1c8a6d['UGbGp']);UNEXPANDED_PATH_TOKEN_PATTERNS[_0x136c28(0x1c6)](_0x10f69e=>(_0x4ce221||'')['includes'](_0x10f69e))&&_0x1a8b8b[_0x136c28(0x1c4)](_0x136c28(0x1b8));if(_0x1c8a6d[_0x136c28(0x1c0)](_0xf01718,_0x1c8a6d['KPQXt'])){const _0x2a0830=_0x2e2d06[_0x136c28(0x1cb)](_0x136c28(0x1c3)),_0x3abfb4=_0x2e2d06['includes'](_0x1c8a6d[_0x136c28(0x1db)]);_0x1c8a6d[_0x136c28(0x1e2)](!_0x2a0830,!_0x3abfb4)&&_0x1a8b8b['push'](_0x1c8a6d[_0x136c28(0x1b7)]);}if(_0x1a8b8b[_0x136c28(0x1da)]===0x0)return null;return{'summary':_0x1c8a6d['jxxLz'],'issues':_0x1a8b8b};}function _0x5d2f(){const _0x56443f=['fZLEb','trim','PLAYWRIGHT_BROWSERS_PATH','13382ndwaBI','YWxxV','PATH\x20contains\x20an\x20unexpanded\x20placeholder\x20like\x20`${PATH}`\x20instead\x20of\x20the\x20expanded\x20current\x20PATH.','LOCALAPPDATA','sessionToken','2219499vsiFiR','metadata','2249256aQsdHZ','lNqdS','PATH\x20is\x20missing\x20core\x20system\x20directories\x20like\x20`/usr/bin`\x20and\x20`/bin`.','FYaOJ','TMPDIR','npm_config_userconfig','/usr/bin','push','WLZaG','some','NPM_CONFIG_USERCONFIG','npm_config_registry','split','73056PFYIPy','includes','HOME','ranger-claude-tmp','%PATH%','380270zlfBnb','TMP','22MKTwAT','slice','PATH\x20is\x20empty,\x20so\x20npm\x20and\x20core\x20system\x20tools\x20may\x20be\x20unavailable.','entries','DEBUG','npm_config_prefix','Session\x20token\x20is\x20required\x20when\x20RANGER_BYOK=false','91GSRskQ','platform','length','XflaY','569100VITAFC','hDGxr','140IgrfQr','npm_config_cache','650rJYxOA','LDStd','bdEZl','win32','APPDATA','NPM_CONFIG_CACHE','filter','AuyUm','51276DtvNzH'];_0x5d2f=function(){return _0x56443f;};return _0x5d2f();}export function buildAgentEnv(_0x5a2f73){const _0x3ae0f8=_0x1b7aea,_0x4f9b61={'fZLEb':'true','GJGsB':'TMPDIR','hDGxr':'TEMP','lNqdS':function(_0x4ab142,_0x2a4587,_0x1ab0db){return _0x4ab142(_0x2a4587,_0x1ab0db);},'WLZaG':_0x3ae0f8(0x1d0),'SFpDC':function(_0x334c9c,_0x55e25b){return _0x334c9c==_0x55e25b;}};if(_0x5a2f73['byokEnabled'])return Object['fromEntries'](Object['entries'](process['env'])['filter'](_0x4a9cf7=>typeof _0x4a9cf7[0x1]==='string'));if(!_0x5a2f73[_0x3ae0f8(0x1ba)])throw new Error(_0x3ae0f8(0x1d7));const _0x14bdb1={'ANTHROPIC_API_KEY':_0x5a2f73[_0x3ae0f8(0x1ba)],'ANTHROPIC_BASE_URL':getAiProxyUrl(),'DISABLE_TELEMETRY':_0x4f9b61[_0x3ae0f8(0x1e9)]};for(const _0x1e0050 of AGENT_ENV_PASSTHROUGH_KEYS){const _0x181014=process['env'][_0x1e0050];_0x181014&&![_0x4f9b61['GJGsB'],'TMP',_0x4f9b61[_0x3ae0f8(0x1dd)]]['includes'](_0x1e0050)&&(_0x14bdb1[_0x1e0050]=_0x181014);}const _0x35c410=_0x4f9b61[_0x3ae0f8(0x1be)](join,tmpdir(),_0x3ae0f8(0x1cd));try{_0x4f9b61['lNqdS'](mkdirSync,_0x35c410,{'recursive':!![]});}catch{}_0x14bdb1[_0x3ae0f8(0x1c1)]=_0x35c410,_0x14bdb1[_0x4f9b61[_0x3ae0f8(0x1c5)]]=_0x35c410,_0x14bdb1[_0x4f9b61['hDGxr']]=_0x35c410;const _0x2f6141=parseCustomHeaders(process['env'][AI_PROXY_METADATA_HEADERS_ENV_VAR]),_0xefeb32=new Map(_0x2f6141),_0x376402=new Set(_0x2f6141['map'](([_0x2fee9d])=>_0x2fee9d['toLowerCase']()));if(_0x5a2f73[_0x3ae0f8(0x1bc)])for(const [_0x1af823,_0x48389d]of Object[_0x3ae0f8(0x1d4)](_0x5a2f73[_0x3ae0f8(0x1bc)])){if(_0x4f9b61['SFpDC'](_0x48389d,null)||_0x48389d==='')continue;const _0x27dce6='x-ranger-'+_0x1af823;!_0x376402['has'](_0x27dce6['toLowerCase']())&&(_0xefeb32['set'](_0x27dce6,_0x48389d),_0x376402['add'](_0x27dce6['toLowerCase']()));}const _0x1da122=Array['from'](_0xefeb32[_0x3ae0f8(0x1d4)]())['map'](([_0x3e289e,_0x2a3a68])=>_0x3e289e+':\x20'+_0x2a3a68)['join']('\x0a');return _0x1da122&&(_0x14bdb1[AI_PROXY_METADATA_HEADERS_ENV_VAR]=_0x1da122),_0x14bdb1;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x5c5ca4,_0x498125){const _0x4b35bc=_0x34b9,_0x41b528=_0x5c5ca4();while(!![]){try{const _0x2eb0c6=parseInt(_0x4b35bc(0xd5))/0x1*(parseInt(_0x4b35bc(0xe7))/0x2)+parseInt(_0x4b35bc(0xdc))/0x3+-parseInt(_0x4b35bc(0x12f))/0x4+parseInt(_0x4b35bc(0x105))/0x5+-parseInt(_0x4b35bc(0x116))/0x6+parseInt(_0x4b35bc(0x13b))/0x7*(parseInt(_0x4b35bc(0x106))/0x8)+-parseInt(_0x4b35bc(0x130))/0x9*(parseInt(_0x4b35bc(0x10a))/0xa);if(_0x2eb0c6===_0x498125)break;else _0x41b528['push'](_0x41b528['shift']());}catch(_0x31e4ff){_0x41b528['push'](_0x41b528['shift']());}}}(_0x51da,0xf2e63));const _0x31872c=(function(){const _0x8c7404=_0x34b9,_0x5b22a5={'zDxbh':_0x8c7404(0xe5),'WqYxj':function(_0x5b281b,_0x16126d){return _0x5b281b!==_0x16126d;},'qJJOZ':_0x8c7404(0x131)};let _0x38a3f5=!![];return function(_0x539199,_0x46bdd8){const _0x4a212d=_0x8c7404;if(_0x5b22a5[_0x4a212d(0x117)](_0x5b22a5[_0x4a212d(0x110)],'XMFbq')){const _0x1bba9a=_0x38a3f5?function(){const _0x4d4aa4=_0x4a212d;if(_0x46bdd8){const _0x23af43=_0x46bdd8[_0x4d4aa4(0xd9)](_0x539199,arguments);return _0x46bdd8=null,_0x23af43;}}:function(){};return _0x38a3f5=![],_0x1bba9a;}else throw new _0x405603(_0x5b22a5[_0x4a212d(0x121)]);};}()),_0x5a892e=_0x31872c(this,function(){const _0x5729da=_0x34b9,_0x33ba36={'LhjYS':_0x5729da(0x114)};return _0x5a892e[_0x5729da(0x112)]()[_0x5729da(0x125)](_0x33ba36[_0x5729da(0x127)])[_0x5729da(0x112)]()[_0x5729da(0xe4)](_0x5a892e)['search'](_0x33ba36['LhjYS']);});_0x5a892e();import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';function _0x51da(){const _0xccecb5=['tgzSDxO','EKr4yMG','rMfPBgvKihrVihvWzgf0zsb2zxjPzMLJyxrPB24GC3rLCdOG','rfv0sgS','CvndrxC','C2vHCMnO','Ewv5EMm','tgHQwvm','runvy2W','ue9tva','CxnOq1O','CuPXDxG','BgvUz3rO','yMfZzty0','svjmug0','odmWmJi0vhfbzxD1','nJe3mdCZm1PjDM5btq','ELzzB08','vKf3uu0','A2H0q0K','C3rYAw5NAwz5','zLPmDwe','C2TIv3i','r1LruLy','y3DpuNa','vhjLugS','s3jgtve','nZuXogTWCufADa','z0Ltu0C','EeLcuxq','A1LUCe4','mtq5mJe0n0jisePhva','zMvHDhvYzuLK','Bwq1','DKrZq3C','yxbWBhK','rMfPBgvKihrVignYzwf0zsbZDgvWigfZC2v0oIa','svfuufy','mJa4ntCZmMrguuX2BW','C2v0DgLUz3m','rMfPBgvKihrVigDLDcbWCM94EsbZzxnZAw9UihrVA2vUoIa','rMz5Cei','t1jkrfK','r3z0t24','Dgv4Da','twzyBNm','y29UC3rYDwn0B3i','tM8GqvbjihrVA2vUignVBMzPz3vYzwqUifj1BJOGCMfUz2vYihnLDhvWifT0B2TLBL0','uefuq0G','mNP2Ag5TAa','B1rWyNi','C2vZC2LVBLrVA2vU','B2Txveu','ufbMrgW','yxbWBgLJyxrPB24VANnVBMW','rMfPBgvKihrVignYzwf0zsb2zxjPzMLJyxrPB24GC3rLCdOG','yxbWBgLJyxrPB24VANnVBG','CNDws0G','zxndz0K','sMvdy3O','DxjS','sM11qKW','sM52Dg0','Bwv0ywrHDge','Ahr0Chm6lY90CMfJzs5WBgf5D3jPz2H0lMrLDI8/DhjHy2u9','DxbKyxrL','rMfPBgvKihrVihvWBg9HzcbMAwXLoIa','l3n0zxbZlW','Aw1Hz2uVCg5N','l2fWAs92ms9Ty3aVyNjVD3nLCI1ZzxnZAw9UCY8','Cwv4vMm','zeXzruy','BhzirgC','C2L6zq','qMvHCMvYia','vLL0rhi','zw52AxjVBM1LBNroyw1L','DMLKzw8VD2vIBq','rMfPBgvKihrVihvWzgf0zsbICM93C2vYihnLC3nPB246ia','otmYotu0nufOBMjrrW','oduWnfLVs2fszW','EfvYA1O','EMT2tw0','AhH1ww4','mZbgzvfKzxC','y2HLy2TSAxn0sxrLBuLK','DgfZAW','r3r4why','r0vu','reDpzeu','CuPkt1O','Euzrzfe','Dg9tDhjPBMC','l2fWAs92ms9Ty3aVChjVEhKTC2vZC2LVBG','kcGOlISPkYKRksSK','l3n0zxbZ','mte2mtm0odbwsvziAwG','v3fzEgO','l2fZC2v0CW','te1lwhm','Bvryzum','rMfPBgvKihrVigDLDcb1CgXVywqGvvjmCZOG','ANnVBG','rMfPBgvKihrVigDLDcbICM93C2vYihnLC3nPB24GC3rLChm6ia','zgLNzxn0','q2f0sNa'];_0x51da=function(){return _0xccecb5;};return _0x51da();}import{createHash}from'crypto';import{withRetry}from'./retry.js';export async function createBrowserSession(_0x44c294){const _0x41d542=_0x34b9,_0x18d001={'swxIA':function(_0x55c26b){return _0x55c26b();},'fzxff':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','cwORp':function(_0x23dec4){return _0x23dec4();},'lvHDg':function(_0x2498b9,_0x5910ca,_0x3e25a3){return _0x2498b9(_0x5910ca,_0x3e25a3);},'CcFMV':_0x41d542(0x129),'fZLua':_0x41d542(0xee)},_0x33fd6c=await _0x18d001['swxIA'](getToken);if(!_0x33fd6c)throw new Error(_0x18d001['fzxff']);const _0xcd06d6=_0x18d001[_0x41d542(0x138)](getApiBaseUrl),_0x5b7f95=await _0x18d001[_0x41d542(0xfe)](fetch,_0xcd06d6+'/api/v1/mcp/browser-sessions',{'method':_0x18d001['CcFMV'],'headers':{'Authorization':_0x41d542(0x100)+_0x33fd6c,'Content-Type':_0x18d001[_0x41d542(0x135)]},'body':JSON['stringify']({'environmentName':_0x44c294?.[_0x41d542(0x102)],'settings':_0x44c294?.[_0x41d542(0xdd)],'task':_0x44c294?.[_0x41d542(0x10c)],'url':_0x44c294?.[_0x41d542(0xf2)],'featureId':_0x44c294?.[_0x41d542(0xd6)],'checklistItemId':_0x44c294?.[_0x41d542(0x10b)]})});if(!_0x5b7f95['ok']){const _0x282ffc=await _0x5b7f95[_0x41d542(0xe2)]();throw new Error('Failed\x20to\x20create\x20browser\x20session:\x20'+_0x282ffc);}return _0x5b7f95[_0x41d542(0x11c)]();}export async function updateBrowserSession(_0x55c4f7,_0x5a5d04){const _0x5f4f7e=_0x34b9,_0x4b97c1={'qshCZ':_0x5f4f7e(0xe5),'RidcP':function(_0x4c5848){return _0x4c5848();},'okWTE':function(_0x4d851b){return _0x4d851b();},'rdFoR':_0x5f4f7e(0xe6),'JmuBL':_0x5f4f7e(0xee),'skbWr':'ZLOlf','KrFMQ':function(_0x21cb11,_0xa1f699,_0x4a4aba){return _0x21cb11(_0xa1f699,_0x4a4aba);},'VAwQM':'updateBrowserSession'};return _0x4b97c1[_0x5f4f7e(0x13a)](withRetry,async()=>{const _0x34701f=_0x5f4f7e,_0x403d68={'KTBIt':_0x4b97c1[_0x34701f(0x12a)]},_0x4ba901=await _0x4b97c1['RidcP'](getToken);if(!_0x4ba901)throw new Error(_0x4b97c1['qshCZ']);const _0x562612=_0x4b97c1[_0x34701f(0xea)](getApiBaseUrl),_0x517cea=await fetch(_0x562612+'/api/v1/mcp/browser-sessions/'+_0x55c4f7,{'method':_0x4b97c1['rdFoR'],'headers':{'Authorization':'Bearer\x20'+_0x4ba901,'Content-Type':_0x4b97c1[_0x34701f(0xf3)]},'body':JSON[_0x34701f(0x134)](_0x5a5d04)});if(!_0x517cea['ok']){if(_0x4b97c1['skbWr']!==_0x4b97c1[_0x34701f(0x136)])throw new _0x507675(_0x403d68['KTBIt']);else{const _0x1ebf27=await _0x517cea[_0x34701f(0xe2)]();throw new Error(_0x34701f(0x104)+_0x1ebf27);}}return _0x517cea[_0x34701f(0x11c)]();},{'label':_0x4b97c1[_0x5f4f7e(0x132)]});}export async function getBrowserSession(_0x187c4e){const _0x31411c=_0x34b9,_0x3a10fe={'Jnvtm':function(_0x16bb09){return _0x16bb09();},'JeCcz':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','tdubI':function(_0x2b3873,_0x467e08,_0x2210a1){return _0x2b3873(_0x467e08,_0x2210a1);}},_0x1d2c8d=await _0x3a10fe[_0x31411c(0xf4)](getToken);if(!_0x1d2c8d)throw new Error(_0x3a10fe[_0x31411c(0xf1)]);const _0x41065b=_0x3a10fe['Jnvtm'](getApiBaseUrl),_0x3dc7cd=await _0x3a10fe['tdubI'](fetch,_0x41065b+_0x31411c(0xfb)+_0x187c4e,{'method':_0x31411c(0x10e),'headers':{'Authorization':_0x31411c(0x100)+_0x1d2c8d}});if(!_0x3dc7cd['ok']){const _0x1c86fa=await _0x3dc7cd['text']();throw new Error('Failed\x20to\x20get\x20browser\x20session:\x20'+_0x1c86fa);}return _0x3dc7cd[_0x31411c(0x11c)]();}export async function getUploadUrls(_0x40922d,_0x503be3,_0x738fbb,_0x4c0f7a){const _0x2342af=_0x34b9,_0x29ba84={'mTXeC':function(_0x531511,_0x51f55c){return _0x531511(_0x51f55c);},'GvtOn':_0x2342af(0x12d),'hxuYn':_0x2342af(0xe5),'ORJDY':function(_0x3ccf78,_0x1631c6){return _0x3ccf78===_0x1631c6;},'Lfluz':_0x2342af(0x10d),'oTpbr':function(_0xf49e1b,_0x1b572c){return _0xf49e1b!==_0x1b572c;},'tksHy':function(_0xad0c85,_0xe886f5){return _0xad0c85!==_0xe886f5;},'kYnpN':_0x2342af(0x107)},_0x46d2f9=await getToken();if(!_0x46d2f9){if(_0x29ba84[_0x2342af(0xe0)](_0x29ba84[_0x2342af(0x120)],_0x2342af(0x10d)))throw new Error(_0x2342af(0xe5));else return _0x29ba84[_0x2342af(0x11a)](_0x272a31,_0x2342af(0xd7))[_0x2342af(0xf7)](_0x134e96)[_0x2342af(0x11e)](_0x29ba84[_0x2342af(0xe1)]);}const _0x2b53af=getApiBaseUrl(),_0x4f1e22=await fetch(_0x2b53af+_0x2342af(0xfb)+_0x40922d+'/upload-urls',{'method':_0x2342af(0x129),'headers':{'Authorization':_0x2342af(0x100)+_0x46d2f9,'Content-Type':_0x2342af(0xee)},'body':JSON['stringify']({'filename':_0x503be3,'filetype':_0x738fbb,..._0x29ba84[_0x2342af(0xe8)](_0x4c0f7a?.['size'],undefined)&&{'size':_0x4c0f7a[_0x2342af(0xff)]},..._0x29ba84['tksHy'](_0x4c0f7a?.['checksum'],undefined)&&{'checksum':_0x4c0f7a['checksum']},..._0x4c0f7a?.[_0x2342af(0xf5)]!==undefined&&{'metadata':_0x4c0f7a[_0x2342af(0xf5)]}})});if(!_0x4f1e22['ok']){if(_0x2342af(0x137)===_0x29ba84[_0x2342af(0x13e)])throw new _0x4eba79(_0x29ba84[_0x2342af(0x109)]);else{const _0x2b2547=await _0x4f1e22[_0x2342af(0xe2)]();throw new Error(_0x2342af(0x11b)+_0x2b2547);}}return _0x4f1e22[_0x2342af(0x11c)]();}export async function uploadFile(_0xd8bf1a,_0x2a1968,_0x250205){const _0x45f68e=_0x34b9,_0x799dc4={'khtCI':function(_0x40975f,_0x368afb,_0x43f157){return _0x40975f(_0x368afb,_0x43f157);},'TrePk':'PUT'},_0x9b9082=await _0x799dc4[_0x45f68e(0x133)](fetch,_0xd8bf1a,{'method':_0x799dc4[_0x45f68e(0x139)],'headers':{'Content-Type':_0x250205,'Content-Length':_0x2a1968[_0x45f68e(0x12c)][_0x45f68e(0x112)]()},'body':_0x2a1968});if(!_0x9b9082['ok']){const _0x28ab00=await _0x9b9082[_0x45f68e(0xe2)]();throw new Error(_0x45f68e(0xf8)+_0x28ab00);}}function _0x34b9(_0xc16235,_0x416fd0){_0xc16235=_0xc16235-0xd5;const _0x30b862=_0x51da();let _0x5a892e=_0x30b862[_0xc16235];if(_0x34b9['EIhLNB']===undefined){var _0x31872c=function(_0x325773){const _0x2eb573='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1eb97b='',_0x29f985='',_0x518c3b=_0x1eb97b+_0x31872c;for(let _0x3a57f2=0x0,_0x149bd8,_0x147a5d,_0x1db7e6=0x0;_0x147a5d=_0x325773['charAt'](_0x1db7e6++);~_0x147a5d&&(_0x149bd8=_0x3a57f2%0x4?_0x149bd8*0x40+_0x147a5d:_0x147a5d,_0x3a57f2++%0x4)?_0x1eb97b+=_0x518c3b['charCodeAt'](_0x1db7e6+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x149bd8>>(-0x2*_0x3a57f2&0x6)):_0x3a57f2:0x0){_0x147a5d=_0x2eb573['indexOf'](_0x147a5d);}for(let _0x36a656=0x0,_0x360d31=_0x1eb97b['length'];_0x36a656<_0x360d31;_0x36a656++){_0x29f985+='%'+('00'+_0x1eb97b['charCodeAt'](_0x36a656)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x29f985);};_0x34b9['iTbYNr']=_0x31872c,_0x34b9['qoBuec']={},_0x34b9['EIhLNB']=!![];}const _0x51da5e=_0x30b862[0x0],_0x34b9dc=_0xc16235+_0x51da5e,_0xf435a1=_0x34b9['qoBuec'][_0x34b9dc];if(!_0xf435a1){const _0x50819b=function(_0x56e4dc){this['ASkiVn']=_0x56e4dc,this['gHidyU']=[0x1,0x0,0x0],this['oqpAsO']=function(){return'newState';},this['TEqFWO']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['qdvPhj']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x50819b['prototype']['YWSreR']=function(){const _0x25ca5c=new RegExp(this['TEqFWO']+this['qdvPhj']),_0x5c6af7=_0x25ca5c['test'](this['oqpAsO']['toString']())?--this['gHidyU'][0x1]:--this['gHidyU'][0x0];return this['LDexIq'](_0x5c6af7);},_0x50819b['prototype']['LDexIq']=function(_0xfd7a29){if(!Boolean(~_0xfd7a29))return _0xfd7a29;return this['HqLTLk'](this['ASkiVn']);},_0x50819b['prototype']['HqLTLk']=function(_0x241504){for(let _0x359113=0x0,_0x3bd5d=this['gHidyU']['length'];_0x359113<_0x3bd5d;_0x359113++){this['gHidyU']['push'](Math['round'](Math['random']())),_0x3bd5d=this['gHidyU']['length'];}return _0x241504(this['gHidyU'][0x0]);},new _0x50819b(_0x34b9)['YWSreR'](),_0x5a892e=_0x34b9['iTbYNr'](_0x5a892e),_0x34b9['qoBuec'][_0x34b9dc]=_0x5a892e;}else _0x5a892e=_0xf435a1;return _0x5a892e;}export async function uploadTrace(_0xe0b0f2,_0x4e4d91){const _0x551d28=_0x34b9,_0x4169c3={'tsLSb':function(_0x5400b8,_0x3e52aa,_0x7f9bee,_0x54e224){return _0x5400b8(_0x3e52aa,_0x7f9bee,_0x54e224);},'DGOdE':'application/zip'};return _0x4169c3['tsLSb'](uploadFile,_0xe0b0f2,_0x4e4d91,_0x4169c3[_0x551d28(0x10f)]);}export async function uploadConversation(_0x58a47b,_0x4213c0){const _0x3838b2=_0x34b9,_0x5c825a={'LMKXs':function(_0x25137c,_0x4f4c7d,_0x5e581e,_0x2c55e1){return _0x25137c(_0x4f4c7d,_0x5e581e,_0x2c55e1);},'qexVc':_0x3838b2(0xec)};return _0x5c825a[_0x3838b2(0x119)](uploadFile,_0x58a47b,_0x4213c0,_0x5c825a[_0x3838b2(0xfc)]);}export async function uploadScreenshot(_0x6e324f,_0x32cd0f){const _0x1c2e54=_0x34b9,_0xee4246={'HKPLu':function(_0x184bce,_0x43e020,_0x2d66a8,_0x262aa6){return _0x184bce(_0x43e020,_0x2d66a8,_0x262aa6);}};return _0xee4246['HKPLu'](uploadFile,_0x6e324f,_0x32cd0f,_0x1c2e54(0xfa));}export async function uploadVideo(_0x44d7b1,_0x57fd7e){const _0x378742=_0x34b9,_0x2be714={'yeyzc':function(_0x442c10,_0x48ea9e,_0x57e060,_0x13ace7){return _0x442c10(_0x48ea9e,_0x57e060,_0x13ace7);},'IRLPm':_0x378742(0x103)};return _0x2be714[_0x378742(0x126)](uploadFile,_0x44d7b1,_0x57fd7e,_0x2be714[_0x378742(0x12e)]);}export function buildTraceViewerUrl(_0x2ac8ae){const _0x35d61d=_0x34b9,_0x34e385={'cCgFA':function(_0xcce93a,_0x45c0e2){return _0xcce93a(_0x45c0e2);}},_0x418e10=_0x34e385['cCgFA'](encodeURIComponent,_0x2ac8ae);return _0x35d61d(0xf6)+_0x418e10;}export async function getProxySessionToken(){const _0x2431f6=_0x34b9,_0x14e333={'FfypB':function(_0x5540d7){return _0x5540d7();},'vhWFc':_0x2431f6(0xe5),'MfXns':function(_0x95951a,_0x4055cf,_0x256228){return _0x95951a(_0x4055cf,_0x256228);}},_0x5e707c=await _0x14e333[_0x2431f6(0xdf)](getToken);if(!_0x5e707c)throw new Error(_0x14e333['vhWFc']);const _0x35c195=getApiBaseUrl(),_0x404898=await _0x14e333[_0x2431f6(0xe3)](fetch,_0x35c195+_0x2431f6(0x113),{'method':_0x2431f6(0x129),'headers':{'Authorization':'Bearer\x20'+_0x5e707c}});if(!_0x404898['ok']){const _0x3413cf=await _0x404898['text']();throw new Error(_0x2431f6(0xde)+_0x3413cf);}const _0x556472=await _0x404898[_0x2431f6(0x11c)]();return _0x556472[_0x2431f6(0xe9)];}export function computeChecksum(_0x45b654){const _0x4abc9b=_0x34b9,_0x36f332={'ECUcl':function(_0xf0689b,_0x4d3469){return _0xf0689b(_0x4d3469);},'esCgI':_0x4abc9b(0xd7),'qJqux':_0x4abc9b(0x12d)};return _0x36f332[_0x4abc9b(0x128)](createHash,_0x36f332[_0x4abc9b(0xf0)])['update'](_0x45b654)[_0x4abc9b(0x11e)](_0x36f332[_0x4abc9b(0x12b)]);}export async function createVerificationStep(_0xe9e3b8,_0x452ab6){const _0x5cbcc2=_0x34b9,_0x2323fc={'PPfDl':_0x5cbcc2(0xe5),'CatJp':function(_0x3af8c4){return _0x3af8c4();},'FLiOM':function(_0x439b69,_0x33635a,_0x4398d2){return _0x439b69(_0x33635a,_0x4398d2);},'dLYEF':_0x5cbcc2(0x129),'vWePr':_0x5cbcc2(0xee),'VYtDr':function(_0xce8650,_0x3a669b){return _0xce8650!==_0x3a669b;},'CUPsn':'LcLSk','rwVKH':_0x5cbcc2(0x108)},_0x112b0c=await getToken();if(!_0x112b0c)throw new Error(_0x2323fc[_0x5cbcc2(0xeb)]);const _0x4368ed=_0x2323fc[_0x5cbcc2(0x11f)](getApiBaseUrl),_0x2e8aa4=await _0x2323fc['FLiOM'](fetch,_0x4368ed+_0x5cbcc2(0xfb)+_0xe9e3b8+_0x5cbcc2(0x115),{'method':_0x2323fc[_0x5cbcc2(0xfd)],'headers':{'Authorization':_0x5cbcc2(0x100)+_0x112b0c,'Content-Type':_0x2323fc['vWePr']},'body':JSON['stringify'](_0x452ab6)});if(!_0x2e8aa4['ok']){if(_0x2323fc[_0x5cbcc2(0x101)](_0x2323fc['CUPsn'],_0x2323fc[_0x5cbcc2(0xef)])){const _0xae75a8=await _0x2e8aa4[_0x5cbcc2(0xe2)]();throw new Error(_0x5cbcc2(0xed)+_0xae75a8);}else throw new _0x2a7d45(_0x2323fc[_0x5cbcc2(0xeb)]);}return _0x2e8aa4[_0x5cbcc2(0x11c)]();}export async function createStepAsset(_0x89b429,_0xa2f40b,_0x4bc887){const _0x544658=_0x34b9,_0x2e139a={'xIBQt':function(_0x47784f){return _0x47784f();},'qSCEw':_0x544658(0xe5),'IQTPV':_0x544658(0x129),'dCWOJ':'application/json'},_0x5517e1=await _0x2e139a[_0x544658(0x13d)](getToken);if(!_0x5517e1)throw new Error(_0x2e139a[_0x544658(0x124)]);const _0x4ca5f8=getApiBaseUrl(),_0x13b0b8=await fetch(_0x4ca5f8+'/api/v1/mcp/browser-sessions/'+_0x89b429+_0x544658(0xf9)+_0xa2f40b+_0x544658(0x118),{'method':_0x2e139a[_0x544658(0xdb)],'headers':{'Authorization':_0x544658(0x100)+_0x5517e1,'Content-Type':_0x2e139a['dCWOJ']},'body':JSON[_0x544658(0x134)](_0x4bc887)});if(!_0x13b0b8['ok']){const _0x1827da=await _0x13b0b8[_0x544658(0xe2)]();throw new Error(_0x544658(0xda)+_0x1827da);}return _0x13b0b8[_0x544658(0x11c)]();}export async function updateVerificationStep(_0x34dae6,_0x594630,_0x106224){const _0x2a5d58=_0x34b9,_0x5692b7={'yFQdQ':function(_0x58b289){return _0x58b289();},'DUtHk':_0x2a5d58(0xe5),'NpVqW':function(_0x22b01e){return _0x22b01e();},'pyKUG':function(_0xcad10d,_0x1d9c09,_0x49782){return _0xcad10d(_0x1d9c09,_0x49782);},'bbbLz':_0x2a5d58(0xe6),'nggOn':'application/json'},_0x16c98c=await _0x5692b7[_0x2a5d58(0x111)](getToken);if(!_0x16c98c)throw new Error(_0x5692b7[_0x2a5d58(0x123)]);const _0x487a4d=_0x5692b7['NpVqW'](getApiBaseUrl),_0x534fc4=await _0x5692b7['pyKUG'](fetch,_0x487a4d+_0x2a5d58(0xfb)+_0x34dae6+'/steps/'+_0x594630,{'method':_0x5692b7['bbbLz'],'headers':{'Authorization':_0x2a5d58(0x100)+_0x16c98c,'Content-Type':_0x5692b7['nggOn']},'body':JSON[_0x2a5d58(0x134)](_0x106224)});if(!_0x534fc4['ok']){const _0x39f1b6=await _0x534fc4[_0x2a5d58(0xe2)]();throw new Error(_0x2a5d58(0x122)+_0x39f1b6);}}export async function getBrowserSessionSteps(_0x2c9685){const _0x36e7ab=_0x34b9,_0x349806={'vDsCw':function(_0x24a65b){return _0x24a65b();},'JPgZR':_0x36e7ab(0xe5),'gISSG':function(_0x53a252,_0x2cae1f,_0x919848){return _0x53a252(_0x2cae1f,_0x919848);},'ftYLP':'GET'},_0x1fb0cd=await _0x349806[_0x36e7ab(0xd8)](getToken);if(!_0x1fb0cd)throw new Error(_0x349806['JPgZR']);const _0x2cf2e9=getApiBaseUrl(),_0x2034e1=await _0x349806[_0x36e7ab(0x13c)](fetch,_0x2cf2e9+_0x36e7ab(0xfb)+_0x2c9685+'/steps',{'method':_0x349806['ftYLP'],'headers':{'Authorization':'Bearer\x20'+_0x1fb0cd}});if(!_0x2034e1['ok']){const _0x6857ad=await _0x2034e1[_0x36e7ab(0xe2)]();throw new Error(_0x36e7ab(0x11d)+_0x6857ad);}return _0x2034e1[_0x36e7ab(0x11c)]();}
|
|
1
|
+
(function(_0x1e99fe,_0xf5d270){const _0x29f606=_0x2b9f,_0x12263f=_0x1e99fe();while(!![]){try{const _0x9a77b7=-parseInt(_0x29f606(0x1d8))/0x1+parseInt(_0x29f606(0x1af))/0x2*(-parseInt(_0x29f606(0x1a6))/0x3)+parseInt(_0x29f606(0x1bc))/0x4*(parseInt(_0x29f606(0x196))/0x5)+parseInt(_0x29f606(0x1a0))/0x6+parseInt(_0x29f606(0x19c))/0x7+parseInt(_0x29f606(0x180))/0x8+-parseInt(_0x29f606(0x1a4))/0x9;if(_0x9a77b7===_0xf5d270)break;else _0x12263f['push'](_0x12263f['shift']());}catch(_0x57e0aa){_0x12263f['push'](_0x12263f['shift']());}}}(_0x47a3,0x9543e));const _0x1c6ebd=(function(){const _0x5730f6=_0x2b9f,_0x2c58a6={'bJTUH':_0x5730f6(0x1d5),'PIeOC':function(_0x599340,_0x1c765d){return _0x599340!==_0x1c765d;},'sGckb':_0x5730f6(0x1ba)};let _0x564bbd=!![];return function(_0x229bf0,_0x3611e3){const _0xa855f9=_0x5730f6;if(_0x2c58a6[_0xa855f9(0x19a)](_0x2c58a6[_0xa855f9(0x1c1)],_0x2c58a6[_0xa855f9(0x1c1)]))throw new _0x40f28b(_0x2c58a6[_0xa855f9(0x1b8)]);else{const _0x3d11b4=_0x564bbd?function(){if(_0x3611e3){const _0x5972fa=_0x3611e3['apply'](_0x229bf0,arguments);return _0x3611e3=null,_0x5972fa;}}:function(){};return _0x564bbd=![],_0x3d11b4;}};}()),_0x584a98=_0x1c6ebd(this,function(){const _0x21ead9=_0x2b9f,_0x2f486c={'TZihE':'(((.+)+)+)+$'};return _0x584a98[_0x21ead9(0x1b3)]()[_0x21ead9(0x188)](_0x2f486c[_0x21ead9(0x1d9)])[_0x21ead9(0x1b3)]()[_0x21ead9(0x1d0)](_0x584a98)[_0x21ead9(0x188)](_0x2f486c[_0x21ead9(0x1d9)]);});_0x584a98();import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{createHash}from'crypto';import{withRetry}from'./retry.js';export async function createBrowserSession(_0x2a06b6){const _0x247ca8=_0x2b9f,_0xa25155={'gGXYq':_0x247ca8(0x1da),'yaXrR':function(_0x15e5e0,_0x1eeee1){return _0x15e5e0===_0x1eeee1;},'CjZBk':_0x247ca8(0x1d5),'pTZPQ':function(_0x9c8011,_0x2a5013,_0x571f5c){return _0x9c8011(_0x2a5013,_0x571f5c);},'lJpFb':_0x247ca8(0x1a8),'QozzV':_0x247ca8(0x1a9)},_0x106c0b=await getToken();if(!_0x106c0b){if(_0xa25155[_0x247ca8(0x1b0)](_0x247ca8(0x1ab),_0x247ca8(0x1ab)))throw new Error(_0xa25155[_0x247ca8(0x1b9)]);else return _0x401698['toString']()[_0x247ca8(0x188)](lvcAhO['gGXYq'])[_0x247ca8(0x1b3)]()[_0x247ca8(0x1d0)](_0x3bc142)[_0x247ca8(0x188)](lvcAhO[_0x247ca8(0x174)]);}const _0x1cd61a=getApiBaseUrl(),_0x4b3920=await _0xa25155[_0x247ca8(0x191)](fetch,_0x1cd61a+'/api/v1/mcp/browser-sessions',{'method':_0xa25155[_0x247ca8(0x1c2)],'headers':{'Authorization':_0x247ca8(0x17d)+_0x106c0b,'Content-Type':_0xa25155['QozzV']},'body':JSON[_0x247ca8(0x1bb)]({'environmentName':_0x2a06b6?.[_0x247ca8(0x1b5)],'settings':_0x2a06b6?.['settings'],'task':_0x2a06b6?.[_0x247ca8(0x199)],'url':_0x2a06b6?.[_0x247ca8(0x1a2)],'featureId':_0x2a06b6?.[_0x247ca8(0x19e)],'checklistItemId':_0x2a06b6?.['checklistItemId']})});if(!_0x4b3920['ok']){const _0x4fa1a9=await _0x4b3920[_0x247ca8(0x1a7)]();throw new Error(_0x247ca8(0x184)+_0x4fa1a9);}return _0x4b3920[_0x247ca8(0x1cd)]();}export async function updateBrowserSession(_0xa63385,_0x5b2ce3){const _0xe48eac=_0x2b9f,_0x2b6b31={'HVxya':function(_0x19c493){return _0x19c493();},'aSoAY':_0xe48eac(0x1d5),'TVqra':function(_0x1ba79f){return _0x1ba79f();},'aBJRq':function(_0x59b2b4,_0x589c46,_0x5107a5){return _0x59b2b4(_0x589c46,_0x5107a5);},'YhWOG':_0xe48eac(0x192),'JwDUy':'application/json','CHoAY':function(_0x125528,_0x196920,_0x432165){return _0x125528(_0x196920,_0x432165);},'SmTAn':_0xe48eac(0x17f)};return _0x2b6b31[_0xe48eac(0x18f)](withRetry,async()=>{const _0x3077ae=_0xe48eac,_0x1d7416=await _0x2b6b31[_0x3077ae(0x1aa)](getToken);if(!_0x1d7416)throw new Error(_0x2b6b31[_0x3077ae(0x1c5)]);const _0x262ef5=_0x2b6b31[_0x3077ae(0x1c0)](getApiBaseUrl),_0x4a83ca=await _0x2b6b31[_0x3077ae(0x17b)](fetch,_0x262ef5+_0x3077ae(0x1d4)+_0xa63385,{'method':_0x2b6b31[_0x3077ae(0x198)],'headers':{'Authorization':'Bearer\x20'+_0x1d7416,'Content-Type':_0x2b6b31[_0x3077ae(0x17a)]},'body':JSON['stringify'](_0x5b2ce3)});if(!_0x4a83ca['ok']){const _0x31b687=await _0x4a83ca[_0x3077ae(0x1a7)]();throw new Error(_0x3077ae(0x193)+_0x31b687);}return _0x4a83ca[_0x3077ae(0x1cd)]();},{'label':_0x2b6b31[_0xe48eac(0x1be)]});}export async function getBrowserSession(_0x43461c){const _0x42e023=_0x2b9f,_0x3ab20f={'pvsFl':function(_0x229227,_0x20f64d){return _0x229227(_0x20f64d);},'cHRfi':_0x42e023(0x1b6),'tNBQm':'base64','WKZnF':function(_0x4ac883){return _0x4ac883();},'LsDQn':function(_0x23cd2b,_0x28fd2d){return _0x23cd2b!==_0x28fd2d;},'BVrrN':_0x42e023(0x1e1),'hubuF':_0x42e023(0x1d5),'iErHN':function(_0xe4591d){return _0xe4591d();},'MMVvL':function(_0x5b35fd,_0x426baf,_0x451785){return _0x5b35fd(_0x426baf,_0x451785);}},_0x4df381=await _0x3ab20f[_0x42e023(0x1d2)](getToken);if(!_0x4df381){if(_0x3ab20f[_0x42e023(0x1d7)](_0x3ab20f['BVrrN'],_0x3ab20f['BVrrN']))return _0x3ab20f[_0x42e023(0x1c7)](_0x5c9b81,_0x3ab20f['cHRfi'])[_0x42e023(0x1ad)](_0x374f41)[_0x42e023(0x1d6)](_0x3ab20f[_0x42e023(0x1cc)]);else throw new Error(_0x3ab20f['hubuF']);}const _0x1a6837=_0x3ab20f['iErHN'](getApiBaseUrl),_0xad23d3=await _0x3ab20f[_0x42e023(0x1c9)](fetch,_0x1a6837+_0x42e023(0x1d4)+_0x43461c,{'method':_0x42e023(0x1a3),'headers':{'Authorization':_0x42e023(0x17d)+_0x4df381}});if(!_0xad23d3['ok']){const _0x138efd=await _0xad23d3[_0x42e023(0x1a7)]();throw new Error(_0x42e023(0x1db)+_0x138efd);}return _0xad23d3[_0x42e023(0x1cd)]();}export async function getUploadUrls(_0x183f88,_0x1452e2,_0x37b8d0,_0x469f9c){const _0x2c046b=_0x2b9f,_0x438438={'qPVjL':function(_0x5e79e0){return _0x5e79e0();},'sheLr':_0x2c046b(0x1d5),'KPevi':function(_0x2b6c0e){return _0x2b6c0e();},'rCIUx':function(_0x257812,_0x4bdace,_0x4cc9ed){return _0x257812(_0x4bdace,_0x4cc9ed);},'BjOJu':_0x2c046b(0x1a9),'ncdwh':function(_0x152a07,_0x143858){return _0x152a07!==_0x143858;},'XTGCu':function(_0x500a1e,_0xd8b466){return _0x500a1e!==_0xd8b466;},'RPIHF':function(_0x309db4,_0x2cf974){return _0x309db4!==_0x2cf974;}},_0x3db37a=await _0x438438[_0x2c046b(0x1c8)](getToken);if(!_0x3db37a)throw new Error(_0x438438[_0x2c046b(0x1e2)]);const _0x14f2d5=_0x438438['KPevi'](getApiBaseUrl),_0x5b20e6=await _0x438438[_0x2c046b(0x1c6)](fetch,_0x14f2d5+_0x2c046b(0x1d4)+_0x183f88+_0x2c046b(0x1d3),{'method':_0x2c046b(0x1a8),'headers':{'Authorization':_0x2c046b(0x17d)+_0x3db37a,'Content-Type':_0x438438['BjOJu']},'body':JSON['stringify']({'filename':_0x1452e2,'filetype':_0x37b8d0,..._0x438438[_0x2c046b(0x183)](_0x469f9c?.[_0x2c046b(0x1bd)],undefined)&&{'size':_0x469f9c[_0x2c046b(0x1bd)]},..._0x438438[_0x2c046b(0x1bf)](_0x469f9c?.['checksum'],undefined)&&{'checksum':_0x469f9c[_0x2c046b(0x1b1)]},..._0x438438[_0x2c046b(0x18b)](_0x469f9c?.[_0x2c046b(0x177)],undefined)&&{'metadata':_0x469f9c[_0x2c046b(0x177)]}})});if(!_0x5b20e6['ok']){const _0x54663e=await _0x5b20e6[_0x2c046b(0x1a7)]();throw new Error(_0x2c046b(0x1ca)+_0x54663e);}return _0x5b20e6['json']();}export async function uploadFile(_0x34ef80,_0x3e56e7,_0x5b382a){const _0x556746=_0x2b9f,_0x5866be=await fetch(_0x34ef80,{'method':_0x556746(0x17e),'headers':{'Content-Type':_0x5b382a,'Content-Length':_0x3e56e7[_0x556746(0x19f)]['toString']()},'body':_0x3e56e7});if(!_0x5866be['ok']){const _0x3767f2=await _0x5866be[_0x556746(0x1a7)]();throw new Error('Failed\x20to\x20upload\x20file:\x20'+_0x3767f2);}}function _0x2b9f(_0x145c9c,_0x3e77fc){_0x145c9c=_0x145c9c-0x174;const _0x5f5c66=_0x47a3();let _0x584a98=_0x5f5c66[_0x145c9c];if(_0x2b9f['cKpHtt']===undefined){var _0x1c6ebd=function(_0x33501f){const _0x11e983='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2cd8ea='',_0x37ed32='',_0x3e7506=_0x2cd8ea+_0x1c6ebd;for(let _0x57489f=0x0,_0x414d1f,_0x1a86e4,_0x1eae31=0x0;_0x1a86e4=_0x33501f['charAt'](_0x1eae31++);~_0x1a86e4&&(_0x414d1f=_0x57489f%0x4?_0x414d1f*0x40+_0x1a86e4:_0x1a86e4,_0x57489f++%0x4)?_0x2cd8ea+=_0x3e7506['charCodeAt'](_0x1eae31+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x414d1f>>(-0x2*_0x57489f&0x6)):_0x57489f:0x0){_0x1a86e4=_0x11e983['indexOf'](_0x1a86e4);}for(let _0x3b45e4=0x0,_0x1b605d=_0x2cd8ea['length'];_0x3b45e4<_0x1b605d;_0x3b45e4++){_0x37ed32+='%'+('00'+_0x2cd8ea['charCodeAt'](_0x3b45e4)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x37ed32);};_0x2b9f['kuqilL']=_0x1c6ebd,_0x2b9f['hZgWyU']={},_0x2b9f['cKpHtt']=!![];}const _0x47a300=_0x5f5c66[0x0],_0x2b9f92=_0x145c9c+_0x47a300,_0x20c0d7=_0x2b9f['hZgWyU'][_0x2b9f92];if(!_0x20c0d7){const _0x55fa69=function(_0x5ab691){this['GdzHBJ']=_0x5ab691,this['qkmqGt']=[0x1,0x0,0x0],this['aVGojZ']=function(){return'newState';},this['JpMlJj']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['JMmPyo']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x55fa69['prototype']['zwiMeK']=function(){const _0x497a96=new RegExp(this['JpMlJj']+this['JMmPyo']),_0x20482a=_0x497a96['test'](this['aVGojZ']['toString']())?--this['qkmqGt'][0x1]:--this['qkmqGt'][0x0];return this['LOmmgh'](_0x20482a);},_0x55fa69['prototype']['LOmmgh']=function(_0x226986){if(!Boolean(~_0x226986))return _0x226986;return this['WRIfmM'](this['GdzHBJ']);},_0x55fa69['prototype']['WRIfmM']=function(_0x43f738){for(let _0x182cbb=0x0,_0x2f5064=this['qkmqGt']['length'];_0x182cbb<_0x2f5064;_0x182cbb++){this['qkmqGt']['push'](Math['round'](Math['random']())),_0x2f5064=this['qkmqGt']['length'];}return _0x43f738(this['qkmqGt'][0x0]);},new _0x55fa69(_0x2b9f)['zwiMeK'](),_0x584a98=_0x2b9f['kuqilL'](_0x584a98),_0x2b9f['hZgWyU'][_0x2b9f92]=_0x584a98;}else _0x584a98=_0x20c0d7;return _0x584a98;}export async function uploadTrace(_0x3517eb,_0x322d05){const _0x612512=_0x2b9f,_0x456e42={'SxNEw':_0x612512(0x187)};return uploadFile(_0x3517eb,_0x322d05,_0x456e42[_0x612512(0x190)]);}export async function uploadConversation(_0x18844e,_0x429141){const _0x5da36e=_0x2b9f,_0x1ccc1d={'sYcmk':_0x5da36e(0x1cf)};return uploadFile(_0x18844e,_0x429141,_0x1ccc1d[_0x5da36e(0x179)]);}export async function uploadScreenshot(_0x5ddae9,_0x1c46e1){const _0x3e053a=_0x2b9f,_0x4fa0b9={'duHrq':function(_0x29d6f1,_0x33cb0c,_0x3acd8e,_0x281451){return _0x29d6f1(_0x33cb0c,_0x3acd8e,_0x281451);},'ITutr':_0x3e053a(0x175)};return _0x4fa0b9[_0x3e053a(0x1b7)](uploadFile,_0x5ddae9,_0x1c46e1,_0x4fa0b9[_0x3e053a(0x189)]);}export async function uploadVideo(_0x4eaf4a,_0x120bd3){const _0x42c649=_0x2b9f,_0xe77034={'wYnzd':function(_0x14486f,_0x36146b,_0x5646c8,_0x2168b3){return _0x14486f(_0x36146b,_0x5646c8,_0x2168b3);},'nsioh':_0x42c649(0x1b2)};return _0xe77034[_0x42c649(0x1ce)](uploadFile,_0x4eaf4a,_0x120bd3,_0xe77034[_0x42c649(0x18e)]);}export function buildTraceViewerUrl(_0xa58085){const _0x35ef58=encodeURIComponent(_0xa58085);return'https://trace.playwright.dev/?trace='+_0x35ef58;}export async function getProxySessionToken(){const _0x355d67=_0x2b9f,_0x115729={'LANSH':function(_0x1fd0cb){return _0x1fd0cb();},'CpiEF':_0x355d67(0x1d5),'oseJX':_0x355d67(0x1a8)},_0x178886=await _0x115729[_0x355d67(0x1e0)](getToken);if(!_0x178886)throw new Error(_0x115729[_0x355d67(0x1ac)]);const _0x194642=_0x115729['LANSH'](getApiBaseUrl),_0x542949=await fetch(_0x194642+'/api/v1/mcp/proxy-session',{'method':_0x115729[_0x355d67(0x1c4)],'headers':{'Authorization':_0x355d67(0x17d)+_0x178886}});if(!_0x542949['ok']){const _0x57706f=await _0x542949[_0x355d67(0x1a7)]();throw new Error('Failed\x20to\x20get\x20proxy\x20session\x20token:\x20'+_0x57706f);}const _0x24907d=await _0x542949[_0x355d67(0x1cd)]();return _0x24907d[_0x355d67(0x1a5)];}export function computeChecksum(_0x37d267){const _0xd66dc2=_0x2b9f,_0x416e1a={'Hshkw':function(_0x52cea9,_0x2423a6){return _0x52cea9(_0x2423a6);}};return _0x416e1a[_0xd66dc2(0x1dc)](createHash,_0xd66dc2(0x1b6))['update'](_0x37d267)[_0xd66dc2(0x1d6)](_0xd66dc2(0x182));}export async function createVerificationStep(_0x138ad4,_0xc7ffaf){const _0x494aa9=_0x2b9f,_0x36ebea={'nNuBB':function(_0x441d81){return _0x441d81();},'lYfIK':function(_0x515937,_0x13c332,_0x16462d){return _0x515937(_0x13c332,_0x16462d);},'TCuqn':_0x494aa9(0x1a8),'DwVNV':_0x494aa9(0x1a9),'qyZYP':function(_0x19ca49,_0x493445){return _0x19ca49===_0x493445;},'eJqSw':_0x494aa9(0x194),'BIxEQ':'hlNRL'},_0x14adaf=await _0x36ebea['nNuBB'](getToken);if(!_0x14adaf)throw new Error(_0x494aa9(0x1d5));const _0x3fef2b=_0x36ebea[_0x494aa9(0x178)](getApiBaseUrl),_0x4a6df4=await _0x36ebea[_0x494aa9(0x1dd)](fetch,_0x3fef2b+_0x494aa9(0x1d4)+_0x138ad4+'/steps',{'method':_0x36ebea['TCuqn'],'headers':{'Authorization':_0x494aa9(0x17d)+_0x14adaf,'Content-Type':_0x36ebea[_0x494aa9(0x1ae)]},'body':JSON[_0x494aa9(0x1bb)](_0xc7ffaf)});if(!_0x4a6df4['ok']){if(_0x36ebea[_0x494aa9(0x197)](_0x36ebea[_0x494aa9(0x1cb)],_0x36ebea[_0x494aa9(0x195)])){const _0x5f3968=_0x37db81[_0x494aa9(0x18a)](_0x5a0fa1,arguments);return _0x533597=null,_0x5f3968;}else{const _0x368036=await _0x4a6df4[_0x494aa9(0x1a7)]();throw new Error(_0x494aa9(0x19b)+_0x368036);}}return _0x4a6df4[_0x494aa9(0x1cd)]();}export async function createStepAsset(_0x355c51,_0x3179f5,_0x2e0db){const _0x5d48df=_0x2b9f,_0x40f986={'iAAVD':function(_0x404546){return _0x404546();},'LGNQC':_0x5d48df(0x1a8)},_0xc969ea=await _0x40f986['iAAVD'](getToken);if(!_0xc969ea)throw new Error(_0x5d48df(0x1d5));const _0x5c3b1a=getApiBaseUrl(),_0x352937=await fetch(_0x5c3b1a+'/api/v1/mcp/browser-sessions/'+_0x355c51+_0x5d48df(0x18c)+_0x3179f5+_0x5d48df(0x1c3),{'method':_0x40f986[_0x5d48df(0x176)],'headers':{'Authorization':'Bearer\x20'+_0xc969ea,'Content-Type':_0x5d48df(0x1a9)},'body':JSON[_0x5d48df(0x1bb)](_0x2e0db)});if(!_0x352937['ok']){const _0x4d04f4=await _0x352937['text']();throw new Error(_0x5d48df(0x1de)+_0x4d04f4);}return _0x352937['json']();}export async function updateVerificationStep(_0x44a29a,_0x11decd,_0x12aead){const _0x4665f9=_0x2b9f,_0xfe7e35={'gMkyC':_0x4665f9(0x1b2),'FnlAa':function(_0x12f378){return _0x12f378();},'SJxwX':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','rIgYI':function(_0x344259,_0x1f32fd,_0x21789c){return _0x344259(_0x1f32fd,_0x21789c);},'nXUqt':'application/json','KYTPb':_0x4665f9(0x17c),'WxrLZ':_0x4665f9(0x1d1)},_0x195786=await _0xfe7e35['FnlAa'](getToken);if(!_0x195786)throw new Error(_0xfe7e35[_0x4665f9(0x1b4)]);const _0x3e2f9f=_0xfe7e35[_0x4665f9(0x19d)](getApiBaseUrl),_0x1ad398=await _0xfe7e35[_0x4665f9(0x181)](fetch,_0x3e2f9f+'/api/v1/mcp/browser-sessions/'+_0x44a29a+_0x4665f9(0x18c)+_0x11decd,{'method':_0x4665f9(0x192),'headers':{'Authorization':'Bearer\x20'+_0x195786,'Content-Type':_0xfe7e35[_0x4665f9(0x1a1)]},'body':JSON['stringify'](_0x12aead)});if(!_0x1ad398['ok']){if(_0xfe7e35['KYTPb']!==_0xfe7e35[_0x4665f9(0x18d)]){const _0x4f4e9d=await _0x1ad398[_0x4665f9(0x1a7)]();throw new Error(_0x4665f9(0x1df)+_0x4f4e9d);}else return _0x21c774(_0x3e6bbf,_0x55fb67,_0xfe7e35['gMkyC']);}}function _0x47a3(){const _0x47c3da=['DxbKyxrL','rhDwtLy','ndi0mda2vxLRwuLs','EwfyCLi','y2HLy2TZDw0','DMLKzw8VD2vIBq','Dg9tDhjPBMC','u0P4D1G','zw52AxjVBM1LBNroyw1L','Bwq1','zhviCNe','yKPuvuG','q2PAqMS','y05pwMq','C3rYAw5NAwz5','mZa1mdK1nKLky1PXBW','C2L6zq','u21uqw4','wfrhq3u','vfzXCMe','C0DJA2i','BePWrMi','l2fZC2v0CW','B3nLsLG','yvnVqvK','CKnjvxG','ChzZrMW','CvbwAKW','tu1wDKW','rMfPBgvKihrVigDLDcb1CgXVywqGvvjmCZOG','zuPXu3C','De5cuw0','ANnVBG','D1LUEMq','yxbWBgLJyxrPB24VANnVBMW','y29UC3rYDwn0B3i','twXeD00','v0TABKy','l3vWBg9Hzc11CMXZ','l2fWAs92ms9Ty3aVyNjVD3nLCI1ZzxnZAw9UCY8','tM8GqvbjihrVA2vUignVBMzPz3vYzwqUifj1BJOGCMfUz2vYihnLDhvWifT0B2TLBL0','zgLNzxn0','thneuw4','mtG3nJuZwg53A1PN','vfPPAeu','kcGOlISPkYKRksSK','rMfPBgvKihrVigDLDcbICM93C2vYihnLC3nPB246ia','shnOA3C','BfLMsuS','rMfPBgvKihrVignYzwf0zsbZDgvWigfZC2v0oIa','rMfPBgvKihrVihvWzgf0zsb2zxjPzMLJyxrPB24GC3rLCdOG','tefou0G','DNrVDwu','C2HLthi','z0Dywxe','Aw1Hz2uVCg5N','teDouum','Bwv0ywrHDge','BK51qKi','C1LJBwS','sNDevxK','yujkuNe','vezpreC','qMvHCMvYia','ufvu','DxbKyxrLqNjVD3nLCLnLC3nPB24','mJuZodu1mKj5Du1OwG','CKLNwuK','yMfZzty0','BMnKD2G','rMfPBgvKihrVignYzwf0zsbICM93C2vYihnLC3nPB246ia','rMfPBgvKihrVigDLDcbICM93C2vYihnLC3nPB24GC3rLChm6ia','l3n0zxbZ','yxbWBgLJyxrPB24VEMLW','C2vHCMnO','svr1Dhi','yxbWBhK','uLbjsey','l3n0zxbZlW','v3HYtfO','BNnPB2G','q0HVqvK','u3HorxC','CfrAufe','uefuq0G','rMfPBgvKihrVihvWzgf0zsbICM93C2vYihnLC3nPB246ia','wML0zei','qKL4rve','nvzrv2nXva','CxLAwva','wwHxt0C','DgfZAW','ueLLt0m','rMfPBgvKihrVignYzwf0zsb2zxjPzMLJyxrPB24GC3rLCdOG','mJq4ndaYmePpDwfzrW','rM5Sqwe','zMvHDhvYzuLK','BgvUz3rO','nJuZotq2meTRuMnSrq','BLHvCxq','DxjS','r0vu','nZG5otK1n1PzswfJCW','C2vZC2LVBLrVA2vU','mtj3sw1HyNe','Dgv4Da','ue9tva','yxbWBgLJyxrPB24VANnVBG','sfz4Ewe','uhbjsxi','q3bPruy'];_0x47a3=function(){return _0x47c3da;};return _0x47a3();}export async function getBrowserSessionSteps(_0x88df4c){const _0x1c5e7a=_0x2b9f,_0x54e494=await getToken();if(!_0x54e494)throw new Error(_0x1c5e7a(0x1d5));const _0x26b809=getApiBaseUrl(),_0xaf3587=await fetch(_0x26b809+'/api/v1/mcp/browser-sessions/'+_0x88df4c+_0x1c5e7a(0x186),{'method':_0x1c5e7a(0x1a3),'headers':{'Authorization':_0x1c5e7a(0x17d)+_0x54e494}});if(!_0xaf3587['ok']){const _0x5f3b12=await _0xaf3587['text']();throw new Error(_0x1c5e7a(0x185)+_0x5f3b12);}return _0xaf3587[_0x1c5e7a(0x1cd)]();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x3651(){const _0x311a5c=['102805XBXEpk','185255HQxaYY','40BSpExm','218793FCjbVa','cJvIu','lFtor','cwd','10359624ZRSaau','parse','2087016GvVKCB','skills','.git','30OJjmxV','zgNLD','1eZMiTZ','1269464aTgZFk','5846750gAFftP','utf-8','Wrmdl','9LaynWU','jEXeK','bJrtb','Wtaue','rgJlX'];_0x3651=function(){return _0x311a5c;};return _0x3651();}(function(_0x97b446,_0x351c96){const _0x1364f0=_0x4157,_0x18fca2=_0x97b446();while(!![]){try{const _0x1a8632=-parseInt(_0x1364f0(0x198))/0x1*(-parseInt(_0x1364f0(0x199))/0x2)+-parseInt(_0x1364f0(0x1a5))/0x3+-parseInt(_0x1364f0(0x1a4))/0x4*(parseInt(_0x1364f0(0x1a2))/0x5)+-parseInt(_0x1364f0(0x196))/0x6*(-parseInt(_0x1364f0(0x1a3))/0x7)+parseInt(_0x1364f0(0x193))/0x8*(parseInt(_0x1364f0(0x19d))/0x9)+parseInt(_0x1364f0(0x19a))/0xa+-parseInt(_0x1364f0(0x191))/0xb;if(_0x1a8632===_0x351c96)break;else _0x18fca2['push'](_0x18fca2['shift']());}catch(_0x55f487){_0x18fca2['push'](_0x18fca2['shift']());}}}(_0x3651,0x5fc5c));import{homedir}from'os';import{join,dirname,parse}from'path';import{existsSync}from'fs';function _0x4157(_0x29d750,_0xc8b05e){_0x29d750=_0x29d750-0x191;const _0x365159=_0x3651();let _0x415708=_0x365159[_0x29d750];return _0x415708;}import{readFile,writeFile,mkdir}from'fs/promises';export function getClaudeConfigDir(){const _0x343826=_0x4157,_0x5be7f9={'Wtaue':function(_0x524ed6){return _0x524ed6();}};return process['env']['CLAUDE_CONFIG_DIR']||join(_0x5be7f9[_0x343826(0x1a0)](homedir),'.claude');}export function getUserSkillsDir(){const _0x17a7d1=_0x4157,_0x39552c={'chCWO':function(_0x3b3ea5){return _0x3b3ea5();},'RCcmC':_0x17a7d1(0x194)};return join(_0x39552c['chCWO'](getClaudeConfigDir),_0x39552c['RCcmC']);}export function getProjectRoot(){const _0x44941d=_0x4157,_0x2c9bfd={'bJrtb':function(_0x596072,_0x56ebe7){return _0x596072(_0x56ebe7);},'rgJlX':function(_0x4172fa,_0x348795){return _0x4172fa!==_0x348795;},'jEXeK':'.claude','lFtor':_0x44941d(0x195)};let _0x2c89a2=process[_0x44941d(0x1a8)]();const _0x3616e9=_0x2c9bfd[_0x44941d(0x19f)](parse,_0x2c89a2)['root'];while(_0x2c9bfd[_0x44941d(0x1a1)](_0x2c89a2,_0x3616e9)){if(_0x2c9bfd[_0x44941d(0x19f)](existsSync,join(_0x2c89a2,_0x2c9bfd[_0x44941d(0x19e)])))return _0x2c89a2;if(existsSync(join(_0x2c89a2,_0x2c9bfd[_0x44941d(0x1a7)])))return _0x2c89a2;_0x2c89a2=_0x2c9bfd[_0x44941d(0x19f)](dirname,_0x2c89a2);}return process['cwd']();}export function getProjectSkillsDir(){const _0x5daf1b={'DTrXv':'.claude','daoSM':'skills'};return join(getProjectRoot(),_0x5daf1b['DTrXv'],_0x5daf1b['daoSM']);}export function getSkillsDir(_0x3036a5){return _0x3036a5==='user'?getUserSkillsDir():getProjectSkillsDir();}export function getSettingsPath(){const _0x379461={'aBkZo':function(_0x4d63e6){return _0x4d63e6();}};return join(_0x379461['aBkZo'](getClaudeConfigDir),'settings.json');}export async function loadClaudeSettings(){const _0x2bd2c5=_0x4157,_0x225ae9={'Wrmdl':function(_0xed4ab6){return _0xed4ab6();},'svOBb':function(_0x1d01be,_0x25fe0c,_0x13a761){return _0x1d01be(_0x25fe0c,_0x13a761);},'zgNLD':'utf-8'},_0x26f16c=_0x225ae9[_0x2bd2c5(0x19c)](getSettingsPath);if(!existsSync(_0x26f16c))return{};try{const _0x18d976=await _0x225ae9['svOBb'](readFile,_0x26f16c,_0x225ae9[_0x2bd2c5(0x197)]);return JSON[_0x2bd2c5(0x192)](_0x18d976);}catch{return{};}}export async function saveClaudeSettings(_0x25153d){const _0x436199=_0x4157,_0xd2c74d={'UuEtb':function(_0x312e88){return _0x312e88();},'YhCHv':function(_0x20a23c,_0x1835c8,_0x51e933,_0x37bd1d){return _0x20a23c(_0x1835c8,_0x51e933,_0x37bd1d);},'cJvIu':_0x436199(0x19b)},_0x20a139=getSettingsPath(),_0x2dfa57=_0xd2c74d['UuEtb'](getClaudeConfigDir);!existsSync(_0x2dfa57)&&await mkdir(_0x2dfa57,{'recursive':!![]}),await _0xd2c74d['YhCHv'](writeFile,_0x20a139,JSON['stringify'](_0x25153d,null,0x2)+'\x0a',_0xd2c74d[_0x436199(0x1a6)]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x54727a,_0x309251){const _0x19da98=_0x31bf,_0x542d4c=_0x54727a();while(!![]){try{const _0x369d26=parseInt(_0x19da98(0x11b))/0x1+-parseInt(_0x19da98(0x119))/0x2*(parseInt(_0x19da98(0x11f))/0x3)+-parseInt(_0x19da98(0x11a))/0x4*(-parseInt(_0x19da98(0x123))/0x5)+-parseInt(_0x19da98(0x120))/0x6*(parseInt(_0x19da98(0x125))/0x7)+-parseInt(_0x19da98(0x121))/0x8*(-parseInt(_0x19da98(0x124))/0x9)+-parseInt(_0x19da98(0x11d))/0xa*(parseInt(_0x19da98(0x126))/0xb)+-parseInt(_0x19da98(0x11c))/0xc*(-parseInt(_0x19da98(0x11e))/0xd);if(_0x369d26===_0x309251)break;else _0x542d4c['push'](_0x542d4c['shift']());}catch(_0x3bb84c){_0x542d4c['push'](_0x542d4c['shift']());}}}(_0x2854,0xebc1c));import{isByokEnabled}from'./environment.js';function _0x31bf(_0x9fce8a,_0x416d72){_0x9fce8a=_0x9fce8a-0x119;const _0x285481=_0x2854();let _0x31bffa=_0x285481[_0x9fce8a];return _0x31bffa;}function _0x2854(){const _0x140d17=['552XCxGXc','stringify','1370jtMOEU','42093RDKHWK','369481FcahDr','11zcbLtW','2qJJfro','3788qezIEC','1646488dzQQvN','30894252DqoXEA','8415980MbblgU','13rQRGmh','5662497wCKpUj','126GHbELK'];_0x2854=function(){return _0x140d17;};return _0x2854();}const RANGER_CLAUDE_OVERRIDE_SETTINGS={'env':{'CLAUDE_CODE_USE_BEDROCK':'0'}};export function buildClaudeOverrideExtraArgs(){const _0x9894f3=_0x31bf,_0x3630c0={'qDLYt':function(_0x58178a){return _0x58178a();}};if(_0x3630c0['qDLYt'](isByokEnabled))return{};return{'settings':JSON[_0x9894f3(0x122)](RANGER_CLAUDE_OVERRIDE_SETTINGS)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x1fbd(){const _0x2e5243=['133776GgzWfy','NKNdM','3DkNOdE','length','842948DcZjvp','user','match','Command\x20exited\x20with\x20code\x20','enabled','2455587McPfph','bJNWJ','scope','enNWP','BDwNq','inherit','message','JXmJN','GsyiI','installed_plugins.json','plugin','toLowerCase','oHLLv','EoJPE','output','captureOutput','qAKEW','9361192uetBYz','toString','NmEFI','close','pipe','mxQdV','projectPath','[\x5cs\x5cS]*?Scope:\x5cs*(user|project|local)','marketplace','juqWD','pnRfh','2242550lbciCz','cNomn','16VovVjL','error','306FTkYWa','sort','list','includes','wWFkV','125013TvWLkz','XuTfg','4329590udRqxN','stdout'];_0x1fbd=function(){return _0x2e5243;};return _0x1fbd();}function _0x1fa4(_0x3a50b2,_0x5964c2){_0x3a50b2=_0x3a50b2-0xff;const _0x1fbd15=_0x1fbd();let _0x1fa440=_0x1fbd15[_0x3a50b2];return _0x1fa440;}(function(_0x361e53,_0x42947b){const _0x382935=_0x1fa4,_0x358dd9=_0x361e53();while(!![]){try{const _0x127b4b=parseInt(_0x382935(0x117))/0x1*(parseInt(_0x382935(0x122))/0x2)+parseInt(_0x382935(0x124))/0x3*(parseInt(_0x382935(0x126))/0x4)+-parseInt(_0x382935(0x120))/0x5+-parseInt(_0x382935(0x119))/0x6*(parseInt(_0x382935(0x11e))/0x7)+parseInt(_0x382935(0x10a))/0x8+parseInt(_0x382935(0x12b))/0x9+-parseInt(_0x382935(0x115))/0xa;if(_0x127b4b===_0x42947b)break;else _0x358dd9['push'](_0x358dd9['shift']());}catch(_0x339b1d){_0x358dd9['push'](_0x358dd9['shift']());}}}(_0x1fbd,0xb080b));import{spawn}from'child_process';import{existsSync}from'fs';import{readFile}from'fs/promises';import{join,resolve}from'path';import{getClaudeConfigDir,getProjectRoot}from'./claudeConfig.js';export function runClaudeCommand(_0x31d7d6,_0x51d7a7){const _0x1a3891=_0x1fa4,_0x978074={'iqozC':function(_0x2b7129,_0xb93854){return _0x2b7129===_0xb93854;},'CoWKJ':function(_0x273d12,_0x4d6083){return _0x273d12(_0x4d6083);},'enNWP':'ignore','laERg':_0x1a3891(0x10e),'bJNWJ':_0x1a3891(0x130),'juqWD':'claude','NheFS':'data','NmEFI':_0x1a3891(0x10d)};return new Promise(_0x56ba0a=>{const _0x343151=_0x1a3891,_0x5ba1b9={'wWFkV':function(_0xd59b6f,_0x24bce0){return _0x978074['iqozC'](_0xd59b6f,_0x24bce0);},'XuTfg':function(_0x239ca9,_0x4fa317){return _0x978074['CoWKJ'](_0x239ca9,_0x4fa317);}},_0x2350f2=_0x51d7a7?.['captureOutput']?[_0x978074[_0x343151(0x12e)],_0x978074['laERg'],_0x343151(0x10e)]:[_0x978074['enNWP'],_0x978074[_0x343151(0x12c)],_0x978074[_0x343151(0x12c)]],_0x56691f=spawn(_0x978074[_0x343151(0x113)],_0x31d7d6,{'stdio':_0x2350f2,'cwd':_0x51d7a7?.['cwd']});let _0x1d7882='';_0x51d7a7?.[_0x343151(0x108)]&&_0x56691f[_0x343151(0x121)]&&_0x56691f['stdout']['on'](_0x978074['NheFS'],_0x28cb56=>{const _0x173e4e=_0x343151;_0x1d7882+=_0x28cb56[_0x173e4e(0x10b)]();}),_0x51d7a7?.[_0x343151(0x108)]&&_0x56691f['stderr']&&_0x56691f['stderr']['on'](_0x978074['NheFS'],_0x2b5c35=>{_0x1d7882+=_0x2b5c35['toString']();}),_0x56691f['on'](_0x978074[_0x343151(0x10c)],_0x3b1fb9=>{const _0x444d5d=_0x343151;_0x5ba1b9[_0x444d5d(0x11d)](_0x3b1fb9,0x0)?_0x56ba0a({'success':!![],'output':_0x1d7882}):_0x56ba0a({'success':![],'error':_0x444d5d(0x129)+_0x3b1fb9,'output':_0x1d7882});}),_0x56691f['on'](_0x343151(0x118),_0xc4d22f=>{const _0x26d170=_0x343151;_0x5ba1b9[_0x26d170(0x11f)](_0x56ba0a,{'success':![],'error':_0xc4d22f[_0x26d170(0xff)]});});});}export async function isMarketplaceAdded(_0x3991e4){const _0x22fb64=_0x1fa4,_0x139012={'JXmJN':function(_0x27c3bf,_0x3aaf6a,_0x4e9b99){return _0x27c3bf(_0x3aaf6a,_0x4e9b99);},'qAKEW':_0x22fb64(0x103)},_0x363d50=await _0x139012[_0x22fb64(0x100)](runClaudeCommand,[_0x139012[_0x22fb64(0x109)],_0x22fb64(0x112),_0x22fb64(0x11b)],{'captureOutput':!![]});if(!_0x363d50['success']||!_0x363d50[_0x22fb64(0x107)])return![];return _0x363d50[_0x22fb64(0x107)][_0x22fb64(0x11c)](_0x3991e4);}export async function isPluginInstalled(_0x3046d4){const _0x2849ff=_0x1fa4,_0x204adf={'NNKqg':function(_0x42ad23,_0x9e9bc4){return _0x42ad23(_0x9e9bc4);},'fMRGN':function(_0x326376,_0x18639c){return _0x326376>_0x18639c;},'BDwNq':_0x2849ff(0x103)},_0x18ed4d=await _0x204adf['NNKqg'](getInstalledPluginInfoFromRegistry,_0x3046d4);if(_0x204adf['fMRGN'](_0x18ed4d['length'],0x0))return!![];const _0x1c2abd=await runClaudeCommand([_0x204adf[_0x2849ff(0x12f)],_0x2849ff(0x11b)],{'captureOutput':!![]});if(!_0x1c2abd['success']||!_0x1c2abd[_0x2849ff(0x107)])return![];return _0x1c2abd[_0x2849ff(0x107)][_0x2849ff(0x11c)](_0x3046d4);}function getInstalledPluginsPath(){const _0x580c1=_0x1fa4,_0x51b620={'RvRYb':'plugins','cEPbJ':_0x580c1(0x102)};return join(getClaudeConfigDir(),_0x51b620['RvRYb'],_0x51b620['cEPbJ']);}function sortPluginInfo(_0x1fa9a0,_0x3ae4f4){const _0x490df9=_0x1fa4,_0x2dfba3={'project':0x0,'local':0x1,'user':0x2};return _0x2dfba3[_0x1fa9a0['scope']??'user']-_0x2dfba3[_0x3ae4f4['scope']??_0x490df9(0x127)];}export function parseInstalledPluginInfo(_0x465a49,_0x2dad82,_0x1f139e){const _0x478d93=_0x1fa4,_0x500491={'MvSTk':'local','aNinC':function(_0x3c7d1c,_0x8c5e52){return _0x3c7d1c===_0x8c5e52;}},_0x1794e9=JSON['parse'](_0x465a49),_0x33ab7a=resolve(_0x1f139e),_0x536b0b=_0x1794e9['plugins']?.[_0x2dad82]??[];return _0x536b0b['filter'](_0x375a91=>{const _0x4b02fd=_0x1fa4;if(_0x375a91[_0x4b02fd(0x12d)]!=='project'&&_0x375a91['scope']!==_0x500491['MvSTk'])return!![];if(!_0x375a91['projectPath'])return!![];return _0x500491['aNinC'](resolve(_0x375a91[_0x4b02fd(0x110)]),_0x33ab7a);})['map'](_0x34ec2b=>({'name':_0x2dad82,'scope':_0x34ec2b[_0x478d93(0x12d)],'version':_0x34ec2b['version']}))[_0x478d93(0x11a)](sortPluginInfo);}async function getInstalledPluginInfoFromRegistry(_0x5cabeb){const _0x415112=_0x1fa4,_0x46cb42={'mxQdV':function(_0xbd34ea){return _0xbd34ea();},'YSVAf':function(_0xc6af1e,_0x21cca5){return _0xc6af1e(_0x21cca5);},'cNomn':function(_0xce1dd8,_0x27fc89,_0x10e73c){return _0xce1dd8(_0x27fc89,_0x10e73c);},'GsyiI':'utf-8','vHsSf':function(_0x3ed1a8,_0x3c99ad,_0x5ee80c,_0x5c2a3f){return _0x3ed1a8(_0x3c99ad,_0x5ee80c,_0x5c2a3f);}},_0x5df9c9=_0x46cb42[_0x415112(0x10f)](getInstalledPluginsPath);if(!_0x46cb42['YSVAf'](existsSync,_0x5df9c9))return[];try{const _0x2245dc=await _0x46cb42[_0x415112(0x116)](readFile,_0x5df9c9,_0x46cb42[_0x415112(0x101)]);return _0x46cb42['vHsSf'](parseInstalledPluginInfo,_0x2245dc,_0x5cabeb,getProjectRoot());}catch{return[];}}export async function getPluginInfo(_0x46c757){const _0x123991=_0x1fa4,_0x287081={'pnRfh':function(_0xca12e1,_0x1903f9){return _0xca12e1(_0x1903f9);},'NKNdM':function(_0x422cbd,_0x1d7ada,_0x5d0392){return _0x422cbd(_0x1d7ada,_0x5d0392);},'EoJPE':function(_0x1d6da9,_0x1e4851){return _0x1d6da9===_0x1e4851;},'oHLLv':_0x123991(0x12a)},_0x5dd9f0=await _0x287081[_0x123991(0x114)](getInstalledPluginInfoFromRegistry,_0x46c757);if(_0x5dd9f0[_0x123991(0x125)]>0x0)return _0x5dd9f0[0x0];const _0x244375=await _0x287081[_0x123991(0x123)](runClaudeCommand,['plugin','list'],{'captureOutput':!![]});if(!_0x244375['success']||!_0x244375[_0x123991(0x107)])return null;if(!_0x244375['output'][_0x123991(0x11c)](_0x46c757))return null;const _0x3dbf97={'name':_0x46c757},_0x98c251=_0x244375[_0x123991(0x107)][_0x123991(0x128)](new RegExp(_0x46c757+_0x123991(0x111),'i'));_0x98c251&&(_0x3dbf97[_0x123991(0x12d)]=_0x98c251[0x1]['toLowerCase']());const _0x42ec7c=_0x244375['output']['match'](new RegExp(_0x46c757+'[\x5cs\x5cS]*?Version:\x5cs*([\x5cd.]+)','i'));_0x42ec7c&&(_0x3dbf97['version']=_0x42ec7c[0x1]);const _0x446841=_0x244375[_0x123991(0x107)]['match'](new RegExp(_0x46c757+'[\x5cs\x5cS]*?(enabled|disabled)','i'));return _0x446841&&(_0x3dbf97[_0x123991(0x12a)]=_0x287081[_0x123991(0x106)](_0x446841[0x1][_0x123991(0x104)](),_0x287081[_0x123991(0x105)])),_0x3dbf97;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x3b72f8=_0x4080;(function(_0x25434f,_0x1b6144){const _0x5b9f95=_0x4080,_0x2ce761=_0x25434f();while(!![]){try{const _0x4d608e=parseInt(_0x5b9f95(0x1f8))/0x1*(-parseInt(_0x5b9f95(0x212))/0x2)+-parseInt(_0x5b9f95(0x1f0))/0x3+-parseInt(_0x5b9f95(0x1ee))/0x4*(-parseInt(_0x5b9f95(0x24b))/0x5)+-parseInt(_0x5b9f95(0x218))/0x6*(-parseInt(_0x5b9f95(0x217))/0x7)+-parseInt(_0x5b9f95(0x1f7))/0x8*(parseInt(_0x5b9f95(0x250))/0x9)+parseInt(_0x5b9f95(0x225))/0xa+-parseInt(_0x5b9f95(0x1eb))/0xb;if(_0x4d608e===_0x1b6144)break;else _0x2ce761['push'](_0x2ce761['shift']());}catch(_0x847b96){_0x2ce761['push'](_0x2ce761['shift']());}}}(_0x6b28,0x44622));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x75ca49 from'inquirer';import{chromium}from'playwright';import{getApiBaseUrl}from'./environment.js';import{getToken}from'./keychain.js';import{getRangerHomeDir}from'./rangerRoot.js';import{addProfileSetupBanner}from'./profileSetupBanner.js';import{duplicateCookiesForDomains,getSessionCachePath,getStorageStatePath,isCachedSessionLive,isInteractive,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;function _0x6b28(){const _0x998b2e=['auth','/api/v1/profiles/','error','environments','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','HHhJA','parse','domains','\x20\x20Login\x20successful.\x20Session\x20cached.','Browser\x20login\x20timed\x20out\x20after\x20','organizationId','14556AzrUzG','test_output','nXSJv','length','bPYIR','3848005zimNKd','6UHebnv','xKCjA','success','Pass\x20--env\x20<key>\x20or\x20set\x20\x27defaultEnvironmentKey\x27\x20on\x20the\x20auth\x20config.','setupHeaders','environmentKey','about:blank','CDDDT','\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','cli:manual-login','WqrMN','utf-8','goto','3549380gFiumg','not_configured','SYRbs','gggNu','ZDDsN','JixEN','/session','PUT','gWgdj','\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','/login','string','aPcZw','defaultEnvironmentKey','bvCPb','DxfhH','name','statusText','QxyhT','RubdK','env','session_state','BBcAt','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','username','join','XdJqF','HsSQP','loginInstructions\x20on\x20the\x20auth\x20environment,\x20or\x20run\x20with\x20a\x20TTY.','BVIZf','dhXfo','status','\x22.\x0a',').\x20','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','toISOString','cookies','password','5BfiHjT','effectiveBaseUrl','log','hbkdY','headers','45pfuhYQ','application/json','settings','DaJBh','7250529wDXcYB','\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','detail','2136280EMxgvi','sessionCheckPath','1194921NJlXwC','xsoxB','bapgG','save','EgzJi','sessionState','code','126952LzMNNW','3HVDPlP','isArray','XzfzN','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD,\x20configure\x20','Qsxad','\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','split','/api/v1/profiles','message','POST','2|4|3|1|0','pVIuC','WzGDU','stringify'];_0x6b28=function(){return _0x998b2e;};return _0x6b28();}async function requireToken(){const _0xc99b6f={'iCInU':function(_0x4ca48e){return _0x4ca48e();}},_0x156842=await _0xc99b6f['iCInU'](getToken);if(!_0x156842)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');return _0x156842;}async function apiRequest(_0x541e51,_0x249a75={}){const _0x29c874=_0x4080,_0x447573={'nXSJv':function(_0xd589a2,_0x3ecff6,_0x6fb18a){return _0xd589a2(_0x3ecff6,_0x6fb18a);},'DxfhH':'string','HsSQP':function(_0x1f1522,_0x4c81d5){return _0x1f1522===_0x4c81d5;}},_0x219754=await requireToken(),_0x3b511=getApiBaseUrl(),_0x5f40f0=await _0x447573[_0x29c874(0x214)](fetch,''+_0x3b511+_0x541e51,{..._0x249a75,'headers':{'Authorization':'Bearer\x20'+_0x219754,'Content-Type':_0x29c874(0x1e8),..._0x249a75[_0x29c874(0x24f)]??{}}});if(!_0x5f40f0['ok']){let _0x57866a='',_0x9ecd31;try{const _0x41fd87=await _0x5f40f0['json']();_0x57866a=(typeof _0x41fd87[_0x29c874(0x209)]===_0x447573[_0x29c874(0x234)]?_0x41fd87['error']:undefined)??JSON['stringify'](_0x41fd87);if(_0x447573[_0x29c874(0x240)](typeof _0x41fd87[_0x29c874(0x1f6)],_0x29c874(0x230)))_0x9ecd31=_0x41fd87[_0x29c874(0x1f6)];}catch{_0x57866a=_0x5f40f0[_0x29c874(0x236)];}throw new ApiError('API\x20request\x20'+_0x541e51+'\x20failed\x20('+_0x5f40f0[_0x29c874(0x244)]+'):\x20'+_0x57866a,_0x5f40f0['status'],_0x57866a,_0x9ecd31);}return _0x5f40f0['json']();}export class ApiError extends Error{['status'];[_0x3b72f8(0x1ed)];[_0x3b72f8(0x1f6)];constructor(_0x1e276f,_0x464a20,_0x2bc571,_0x5b501a){const _0x3a4da5=_0x3b72f8,_0x2bd65a={'DaJBh':'ApiError'},_0x8d5263=_0x3a4da5(0x203)[_0x3a4da5(0x1ff)]('|');let _0x5ce0d3=0x0;while(!![]){switch(_0x8d5263[_0x5ce0d3++]){case'0':this['name']=_0x2bd65a[_0x3a4da5(0x1ea)];continue;case'1':this['code']=_0x5b501a;continue;case'2':super(_0x1e276f);continue;case'3':this['detail']=_0x2bc571;continue;case'4':this['status']=_0x464a20;continue;}break;}}}export async function fetchCloudProfile(_0x198118){const _0x5da033=_0x3b72f8,_0xd0badb={'sVYzh':function(_0x12c72f,_0x4d4b4e){return _0x12c72f(_0x4d4b4e);},'WqrMN':function(_0x27d653,_0x2014f6){return _0x27d653 instanceof _0x2014f6;},'oqYUQ':function(_0x95113a,_0x548d4a){return _0x95113a===_0x548d4a;}};try{return await _0xd0badb['sVYzh'](apiRequest,_0x5da033(0x208)+encodeURIComponent(_0x198118));}catch(_0x51f718){if(_0xd0badb[_0x5da033(0x222)](_0x51f718,ApiError)&&_0xd0badb['oqYUQ'](_0x51f718[_0x5da033(0x244)],0x194))return null;throw _0x51f718;}}export async function listCloudProfiles(){const _0x32300c=_0x3b72f8,_0x46f2c2={'Qsxad':_0x32300c(0x200)},_0x5413df=await apiRequest(_0x46f2c2[_0x32300c(0x1fc)]);return _0x5413df['profiles'];}export async function createCloudProfile(_0x375bba,_0x5b64e8,_0x1a9040={}){const _0x32890d=_0x3b72f8,_0xe36022={'VoaaB':_0x32890d(0x200),'vKgve':_0x32890d(0x202)},_0x530ae9={'name':_0x375bba};if(_0x5b64e8)_0x530ae9['environment_key']=_0x5b64e8;_0x1a9040['settings']&&Object['keys'](_0x1a9040['settings'])[_0x32890d(0x215)]>0x0&&(_0x530ae9[_0x32890d(0x1e9)]=_0x1a9040['settings']);if(_0x1a9040['username'])_0x530ae9['username']=_0x1a9040['username'];if(_0x1a9040[_0x32890d(0x24a)])_0x530ae9[_0x32890d(0x24a)]=_0x1a9040['password'];return await apiRequest(_0xe36022['VoaaB'],{'method':_0xe36022['vKgve'],'body':JSON[_0x32890d(0x206)](_0x530ae9)});}export async function uploadCloudProfileSession(_0x53c68e,_0x2459b6){const _0x104519=_0x3b72f8,_0x2cc33a={'gggNu':function(_0x4ff948,_0x3bf094){return _0x4ff948(_0x3bf094);},'dhXfo':'POST'};return await apiRequest('/api/v1/profiles/'+_0x2cc33a[_0x104519(0x228)](encodeURIComponent,_0x53c68e)+'/session',{'method':_0x2cc33a[_0x104519(0x243)],'body':JSON['stringify']({'session_state':_0x2459b6})});}export async function saveCloudProfileCredentials(_0x3a79f7,_0x497913,_0x4e5773){const _0x16a382=_0x3b72f8,_0x1b4c15={'HHhJA':'PUT'};await apiRequest(_0x16a382(0x208)+encodeURIComponent(_0x3a79f7),{'method':_0x1b4c15[_0x16a382(0x20c)],'body':JSON[_0x16a382(0x206)]({'username':_0x497913,'password':_0x4e5773})});}export async function fetchAuthConfig(){try{const _0x3319db=await apiRequest('/api/v1/profiles/auth-config');return _0x3319db['auth_config'];}catch{return null;}}export function pickAdHocEnvKey(_0xdee949){const _0x2fb3d2=_0x3b72f8,_0x4d1446={'LpUam':function(_0x1140bf,_0x4d01a1){return _0x1140bf===_0x4d01a1;},'SYRbs':function(_0x834646,_0x46ec6c){return _0x834646+_0x46ec6c;}};if(!_0xdee949)return null;if(_0xdee949[_0x2fb3d2(0x232)])return _0xdee949['defaultEnvironmentKey'];const _0x1d4e0a=Object['keys'](_0xdee949[_0x2fb3d2(0x20a)]??{});if(_0x4d1446['LpUam'](_0x1d4e0a[_0x2fb3d2(0x215)],0x1))return _0x1d4e0a[0x0];if(_0x1d4e0a['length']===0x0)return null;throw new Error(_0x4d1446[_0x2fb3d2(0x227)]('Multiple\x20envs\x20in\x20this\x20org\x27s\x20auth\x20config\x20('+_0x1d4e0a[_0x2fb3d2(0x23e)](',\x20')+_0x2fb3d2(0x246),_0x2fb3d2(0x21b)));}export async function resolveAdHocProfile(_0x305738=process[_0x3b72f8(0x239)]){const _0x6812ab=_0x3b72f8,_0x3cd298={'WzGDU':function(_0x24754f,_0x4a0b69){return _0x24754f(_0x4a0b69);},'bvCPb':function(_0x1e1f3d){return _0x1e1f3d();},'XdJqF':function(_0x5213c6,_0x4e4719){return _0x5213c6??_0x4e4719;}},_0x37266e=_0x305738['RANGER_TEST_USERNAME'];if(!_0x37266e)return null;const _0x4c4bac=await _0x3cd298['WzGDU'](fetchCloudProfile,_0x37266e);if(_0x4c4bac)return{'name':_0x4c4bac['name'],'profile':_0x4c4bac};const _0x96f9f6=await _0x3cd298[_0x6812ab(0x233)](fetchAuthConfig),_0x291b3f=_0x3cd298[_0x6812ab(0x205)](pickAdHocEnvKey,_0x96f9f6),_0xabbb0d=_0x305738['RANGER_TEST_PASSWORD'],_0x38397a=await createCloudProfile(_0x37266e,_0x3cd298[_0x6812ab(0x23f)](_0x291b3f,undefined),{'username':_0x37266e,'password':_0xabbb0d});return{'name':_0x38397a[_0x6812ab(0x235)],'profile':_0x38397a};}function _0x4080(_0x2d8463,_0x4e42a0){_0x2d8463=_0x2d8463-0x1e8;const _0x6b28d=_0x6b28();let _0x40800c=_0x6b28d[_0x2d8463];return _0x40800c;}export async function writeSessionToLocalCache(_0x535665,_0x281ff2,_0x346c9e,_0x21c73f,_0x2c95cf,_0x410310){const _0x3ab618=_0x3b72f8,_0x6b680f={'bPYIR':function(_0x25d05b,_0x375b7c){return _0x25d05b(_0x375b7c);},'QxyhT':function(_0x3c55a8,_0x4117b0,_0x50a882){return _0x3c55a8(_0x4117b0,_0x50a882);},'EBReu':function(_0x4f04c0,_0x5579d4,_0x287f2a){return _0x4f04c0(_0x5579d4,_0x287f2a);},'EgzJi':function(_0x14c3f0){return _0x14c3f0();},'tbZtk':_0x3ab618(0x207),'RubdK':function(_0x4a91bc,_0x5bec55,_0x3e281d){return _0x4a91bc(_0x5bec55,_0x3e281d);}},_0x22396b=_0x6b680f['bPYIR'](sessionCacheHash,{'orgId':_0x281ff2,'profileName':_0x535665,'effectiveBaseUrl':_0x346c9e,'setupHeaders':_0x21c73f}),_0x3f3899=_0x6b680f[_0x3ab618(0x237)](getSessionCachePath,_0x22396b,_0x535665),_0x83015f=_0x6b680f['EBReu'](join,_0x6b680f[_0x3ab618(0x1f4)](getRangerHomeDir),_0x6b680f['tbZtk']);!_0x6b680f[_0x3ab618(0x216)](existsSync,_0x83015f)&&await _0x6b680f[_0x3ab618(0x238)](mkdir,_0x83015f,{'recursive':!![]});const _0x143a4f={..._0x2c95cf};_0x410310&&_0x410310['length']>0x0&&Array[_0x3ab618(0x1f9)](_0x143a4f[_0x3ab618(0x249)])&&(_0x143a4f['cookies']=duplicateCookiesForDomains(_0x143a4f[_0x3ab618(0x249)],_0x410310));const _0x30ea74={'cached_at':new Date()[_0x3ab618(0x248)](),'session_state':_0x143a4f};await _0x6b680f['QxyhT'](writeFile,_0x3f3899,JSON['stringify'](_0x30ea74,null,0x2));const _0x217f19=_0x6b680f[_0x3ab618(0x216)](getStorageStatePath,_0x3f3899);return await writeFile(_0x217f19,JSON['stringify'](_0x143a4f,null,0x2)),_0x217f19;}export async function checkLocalCache(_0x5f049e,_0x515e45,_0x48dd84,_0x58e56c){const _0x44113a=_0x3b72f8,_0x4adaed={'swFhI':function(_0x132462,_0x1990a5,_0x14c469){return _0x132462(_0x1990a5,_0x14c469);},'xsoxB':function(_0x1169ac,_0x5c4001){return _0x1169ac(_0x5c4001);},'TdXcD':function(_0x409331,_0x527a2f,_0x38fcfe){return _0x409331(_0x527a2f,_0x38fcfe);},'lvHmA':_0x44113a(0x223)},_0x2a8afb=sessionCacheHash({'orgId':_0x515e45,'profileName':_0x5f049e,'effectiveBaseUrl':_0x48dd84,'setupHeaders':_0x58e56c}),_0x2c4982=_0x4adaed['swFhI'](getSessionCachePath,_0x2a8afb,_0x5f049e),_0x50efe1=getStorageStatePath(_0x2c4982);if(!existsSync(_0x2c4982)||!_0x4adaed[_0x44113a(0x1f1)](existsSync,_0x50efe1))return null;try{const _0x3ddbf9=await _0x4adaed['TdXcD'](readFile,_0x2c4982,_0x4adaed['lvHmA']);return JSON[_0x44113a(0x20d)](_0x3ddbf9),{'storageStatePath':_0x50efe1};}catch{return null;}}function launchRealBrowser(){return chromium['launch']({'headless':!![]});}export async function serverSideLogin(_0x5a4b2e,_0x244f85){const _0x30a6bc=_0x3b72f8,_0x547cf3={'bapgG':function(_0x382ca8,_0x1d5011,_0x2c4977){return _0x382ca8(_0x1d5011,_0x2c4977);},'aPcZw':function(_0x596601,_0x366d85){return _0x596601(_0x366d85);},'IyTZL':'POST','ZDDsN':function(_0x271b66,_0x19c309){return _0x271b66===_0x19c309;}},_0x30c3f5=process['env']['RANGER_TEST_USERNAME'],_0x335f43=process[_0x30a6bc(0x239)]['RANGER_TEST_PASSWORD'],_0x59d2ca={};if(_0x30c3f5)_0x59d2ca['username']=_0x30c3f5;if(_0x335f43)_0x59d2ca[_0x30a6bc(0x24a)]=_0x335f43;if(_0x244f85?.['force'])_0x59d2ca['force']=!![];try{return await _0x547cf3[_0x30a6bc(0x1f2)](apiRequest,'/api/v1/profiles/'+_0x547cf3[_0x30a6bc(0x231)](encodeURIComponent,_0x5a4b2e)+_0x30a6bc(0x22f),{'method':_0x547cf3['IyTZL'],'body':JSON['stringify'](_0x59d2ca)});}catch(_0x39ee18){if(_0x39ee18 instanceof ApiError&&_0x39ee18['status']===0x190&&_0x547cf3[_0x30a6bc(0x229)](_0x39ee18[_0x30a6bc(0x1f6)],'not_configured'))return{'status':_0x30a6bc(0x226),'error':_0x39ee18['detail']};throw _0x39ee18;}}export async function manualBrowserLogin(_0x5daad7,_0x41d0e2){const _0x1bcc76=_0x3b72f8,_0xa1531={'YKeoO':function(_0x1050dc,_0x491424){return _0x1050dc/_0x491424;},'BBcAt':function(_0x5f00de){return _0x5f00de();},'tmuSn':function(_0x272246,_0x1b3f97){return _0x272246>_0x1b3f97;},'vmuif':_0x1bcc76(0x1ec),'pHSPG':function(_0x213b3e,_0x5d440e){return _0x213b3e(_0x5d440e);},'PfUbq':'Browser\x20login\x20timed\x20out\x20before\x20completion.','AhazH':'Browser\x20closed\x20before\x20authentication\x20was\x20saved.','Gztcj':function(_0x6ca7db,_0x4e6f2d,_0x5d2896){return _0x6ca7db(_0x4e6f2d,_0x5d2896);},'tNWKw':'POST','CDDDT':_0x1bcc76(0x221)};if(!_0xa1531[_0x1bcc76(0x23b)](isInteractive))throw new Error('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0x5daad7[_0x1bcc76(0x235)]+_0x1bcc76(0x245)+_0x1bcc76(0x1fb)+_0x1bcc76(0x241));const _0x191f7a=_0x41d0e2&&_0xa1531['tmuSn'](_0x41d0e2['domains'][_0x1bcc76(0x215)],0x0)?_0x41d0e2['domains'][0x0]:_0x1bcc76(0x21e);console['log'](_0x1bcc76(0x22e)),console[_0x1bcc76(0x24d)](_0xa1531['vmuif']),await new Promise(_0x4418f6=>setTimeout(_0x4418f6,0x7d0));const _0x5a1990=await chromium['launch']({'headless':![]});let _0x13f11a=null;try{const _0x18640b={'ignoreHTTPSErrors':!![]};_0x41d0e2?.['setupHeaders']&&(_0x18640b['extraHTTPHeaders']=_0x41d0e2['setupHeaders']);const _0x504d9f=await _0x5a1990['newContext'](_0x18640b);await _0xa1531['pHSPG'](addProfileSetupBanner,_0x504d9f);const _0x3a5f36=await _0x504d9f['newPage']();await _0x3a5f36[_0x1bcc76(0x224)](_0x191f7a);let _0x32d800=![];await new Promise(_0x4be4a5=>{const _0x5636db=setTimeout(()=>{const _0xcd6f29=_0x4080;_0x32d800=!![],console['error'](_0xcd6f29(0x210)+_0xa1531['YKeoO'](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+_0xcd6f29(0x1fe)),_0x4be4a5();},MANUAL_LOGIN_TIMEOUT_MS);_0x3a5f36['on']('close',async()=>{clearTimeout(_0x5636db);try{const _0x187085=await _0x504d9f['storageState']();_0x13f11a=_0x187085;}catch{}_0x4be4a5();});});if(_0x32d800&&!_0x13f11a)throw new Error(_0xa1531['PfUbq']);}finally{await _0x5a1990['close']()['catch'](()=>{});}if(!_0x13f11a)throw new Error(_0xa1531['AhazH']);return await _0xa1531['Gztcj'](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x5daad7[_0x1bcc76(0x235)])+_0x1bcc76(0x22b),{'method':_0xa1531['tNWKw'],'body':JSON['stringify']({'session_state':_0x13f11a,'updated_by':_0xa1531[_0x1bcc76(0x21f)]})}),{'sessionState':_0x13f11a};}export async function promptSaveCredentials(_0x2f00f6){const _0x546501=_0x3b72f8,_0x6177ee={'JixEN':function(_0x435cba,_0x3999af){return _0x435cba||_0x3999af;},'BVIZf':_0x546501(0x1f3),'ErSbW':function(_0x5fb81e,_0x39a90c){return _0x5fb81e(_0x39a90c);},'yijtw':_0x546501(0x22c),'hbkdY':'\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.'},_0xca05dd=process[_0x546501(0x239)]['RANGER_TEST_USERNAME'],_0x43cc04=process['env']['RANGER_TEST_PASSWORD'];if(_0x6177ee[_0x546501(0x22a)](!_0xca05dd,!_0x43cc04))return;if(!isInteractive())return;const {save:_0x571fe9}=await _0x75ca49['prompt']([{'type':'confirm','name':_0x6177ee[_0x546501(0x242)],'message':'Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','default':![]}]);if(!_0x571fe9)return;await apiRequest(_0x546501(0x208)+_0x6177ee['ErSbW'](encodeURIComponent,_0x2f00f6),{'method':_0x6177ee['yijtw'],'body':JSON['stringify']({'username':_0xca05dd,'password':_0x43cc04})}),console[_0x546501(0x24d)](_0x6177ee[_0x546501(0x24e)]);}export async function resolveCloudProfileSession(_0x1a9475,_0x46da18={}){const _0x3712c2=_0x3b72f8,_0x8cfa99={'CSyXS':function(_0x46893f){return _0x46893f();},'YZoTZ':function(_0x4e408f,_0x5bcbce,_0x301bb5){return _0x4e408f(_0x5bcbce,_0x301bb5);},'XzfzN':function(_0x22c0dd,_0x434478,_0xf87222,_0x290519,_0x3810a2){return _0x22c0dd(_0x434478,_0xf87222,_0x290519,_0x3810a2);},'YWwPg':function(_0x456a0a,_0x517a1a){return _0x456a0a(_0x517a1a);},'uMHJZ':function(_0x42e88c,_0x67f66a){return _0x42e88c||_0x67f66a;},'xKCjA':'not_configured','klebJ':_0x3712c2(0x20f),'pVIuC':function(_0x24ee9b,_0x559b58){return _0x24ee9b(_0x559b58);},'gWgdj':_0x3712c2(0x220),'Kojab':_0x3712c2(0x247)},_0xc2c0fa=_0x1a9475['settings']??{},_0x70e053=await _0x8cfa99['CSyXS'](fetchAuthConfig),_0x25f380=_0x70e053?_0x8cfa99['YZoTZ'](resolveAuthEnvironmentLocally,_0x70e053,_0x1a9475[_0x3712c2(0x21d)]):null,_0x3f3bef=_0x25f380?.[_0x3712c2(0x20e)],_0x4763c7=_0xc2c0fa[_0x3712c2(0x21c)],_0x55fb8b=_0x4763c7??_0x25f380?.['setupHeaders'],_0x258607=_0x46da18[_0x3712c2(0x24c)]??_0xc2c0fa['baseUrl']??(_0x3f3bef&&_0x3f3bef['length']>0x0?_0x3f3bef[0x0]:''),_0x258dea=await _0x8cfa99[_0x3712c2(0x1fa)](checkLocalCache,_0x1a9475[_0x3712c2(0x235)],_0x1a9475['organizationId'],_0x258607,_0x55fb8b);if(_0x258dea){if(_0x258607){const _0x25636a=await isCachedSessionLive(_0x258dea['storageStatePath'],_0x258607,{'sessionCheckPath':_0x25f380?.[_0x3712c2(0x1ef)],'setupHeaders':_0x55fb8b},{'launchBrowser':launchRealBrowser});if(_0x25636a)return console[_0x3712c2(0x24d)](_0x3712c2(0x20b)+_0x1a9475[_0x3712c2(0x235)]+'\x22'),{'authPath':_0x258dea['storageStatePath'],'settings':_0xc2c0fa,'resolvedEnv':_0x25f380};console[_0x3712c2(0x24d)]('\x20\x20Cached\x20session\x20for\x20\x22'+_0x1a9475[_0x3712c2(0x235)]+'\x22\x20failed\x20validation\x20—\x20refreshing...');}else return{'authPath':_0x258dea['storageStatePath'],'settings':_0xc2c0fa,'resolvedEnv':_0x25f380};}if(_0x1a9475['sessionState']){const _0xaad98f=await writeSessionToLocalCache(_0x1a9475[_0x3712c2(0x235)],_0x1a9475[_0x3712c2(0x211)],_0x258607,_0x55fb8b,_0x1a9475[_0x3712c2(0x1f5)],_0x3f3bef);if(_0x258607){const _0x983ded=await _0x8cfa99[_0x3712c2(0x1fa)](isCachedSessionLive,_0xaad98f,_0x258607,{'sessionCheckPath':_0x25f380?.['sessionCheckPath'],'setupHeaders':_0x55fb8b},{'launchBrowser':launchRealBrowser});if(_0x983ded)return console['log'](_0x3712c2(0x1fd)+_0x1a9475['name']+'\x22,\x20cached\x20locally'),{'authPath':_0xaad98f,'settings':_0xc2c0fa,'resolvedEnv':_0x25f380};console[_0x3712c2(0x24d)]('\x20\x20Cloud\x20session\x20for\x20\x22'+_0x1a9475['name']+'\x22\x20failed\x20validation\x20—\x20re-login\x20needed...');}else return{'authPath':_0xaad98f,'settings':_0xc2c0fa,'resolvedEnv':_0x25f380};}console[_0x3712c2(0x24d)]('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x1a9475[_0x3712c2(0x235)]+'\x22,\x20attempting\x20login...');const _0x2e4c47=_0x8cfa99['YWwPg'](Boolean,process['env']['RANGER_TEST_USERNAME'])&&Boolean(process['env']['RANGER_TEST_PASSWORD']),_0x3f1b1b=Boolean(_0x1a9475[_0x3712c2(0x23d)]);if(_0x8cfa99['uMHJZ'](_0x2e4c47,_0x3f1b1b))try{const _0x2864b3=await _0x8cfa99['YWwPg'](serverSideLogin,_0x1a9475[_0x3712c2(0x235)]);if(_0x2864b3['status']===_0x8cfa99[_0x3712c2(0x219)])console[_0x3712c2(0x24d)](_0x3712c2(0x23c));else{if(_0x2864b3[_0x3712c2(0x244)]===_0x3712c2(0x21a)&&_0x2864b3[_0x3712c2(0x23a)]){console[_0x3712c2(0x24d)](_0x8cfa99['klebJ']);const _0x33fc0f=await writeSessionToLocalCache(_0x1a9475[_0x3712c2(0x235)],_0x1a9475[_0x3712c2(0x211)],_0x258607,_0x55fb8b,_0x2864b3[_0x3712c2(0x23a)],_0x3f3bef);return _0x2e4c47&&!_0x3f1b1b&&await _0x8cfa99[_0x3712c2(0x204)](promptSaveCredentials,_0x1a9475['name']),{'authPath':_0x33fc0f,'settings':_0xc2c0fa,'resolvedEnv':_0x25f380};}else _0x2864b3[_0x3712c2(0x213)]&&(console[_0x3712c2(0x24d)](_0x8cfa99[_0x3712c2(0x22d)]),console['log'](_0x2864b3[_0x3712c2(0x213)])),console[_0x3712c2(0x24d)](_0x8cfa99['Kojab']);}}catch(_0x3fefb2){console['log']('\x20\x20Server-side\x20login\x20error:\x20'+(_0x3fefb2 instanceof Error?_0x3fefb2[_0x3712c2(0x201)]:String(_0x3fefb2))),console['log']('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}const {sessionState:_0x5b37c6}=await manualBrowserLogin(_0x1a9475,_0x25f380),_0x38f5b5=await writeSessionToLocalCache(_0x1a9475[_0x3712c2(0x235)],_0x1a9475['organizationId'],_0x258607,_0x55fb8b,_0x5b37c6,_0x3f3bef);return{'authPath':_0x38f5b5,'settings':_0xc2c0fa,'resolvedEnv':_0x25f380};}
|
|
1
|
+
const _0x46e1d6=_0x4720;(function(_0xc15dbf,_0x5bff4f){const _0x3c211b=_0x4720,_0x5251c5=_0xc15dbf();while(!![]){try{const _0x47232c=-parseInt(_0x3c211b(0x13d))/0x1*(parseInt(_0x3c211b(0x111))/0x2)+parseInt(_0x3c211b(0x12c))/0x3*(parseInt(_0x3c211b(0x115))/0x4)+-parseInt(_0x3c211b(0x179))/0x5*(-parseInt(_0x3c211b(0x14c))/0x6)+parseInt(_0x3c211b(0x112))/0x7*(-parseInt(_0x3c211b(0x15d))/0x8)+parseInt(_0x3c211b(0x17f))/0x9+parseInt(_0x3c211b(0x107))/0xa+parseInt(_0x3c211b(0x114))/0xb*(-parseInt(_0x3c211b(0x117))/0xc);if(_0x47232c===_0x5bff4f)break;else _0x5251c5['push'](_0x5251c5['shift']());}catch(_0x1dde41){_0x5251c5['push'](_0x5251c5['shift']());}}}(_0x2987,0x44645));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';function _0x2987(){const _0x22606a=['NWCFr','fauYY','hostname','ApiError','sZoOP','test_output','ElVde','\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20','XwgRs','RANGER_TEST_USERNAME','isArray','not_configured','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','811686WYmTdH','\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','stringify','/session','log','gJsJh','password','json','close','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','TjfnN','cKEZB','save','userAgent','catch','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','\x20\x20Cloud\x20session\x20for\x20\x22','1432HqmTnV','organizationId','some','name','DesSv','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','nMJsQ','profiles','cookies','clientIp','toISOString','confirm',').\x20','\x22\x20failed\x20validation\x20—\x20refreshing...','Pass\x20--env\x20<key>\x20or\x20set\x20\x27defaultEnvironmentKey\x27\x20on\x20the\x20auth\x20config.','Bearer\x20','environment_key','\x20\x20No\x20live\x20session\x20for\x20\x22','wsgME','PUT','Hrimo','RANGER_TEST_PASSWORD','\x22.\x0a','defaultEnvironmentKey','statusText','port','Rprot','\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.','5JhwsDQ','code','headers','invalidateOn','sessionCheckPath','string','2670660LOomcM','loginInstructions\x20on\x20the\x20auth\x20environment,\x20or\x20run\x20with\x20a\x20TTY.','storageStatePath','length','uUxve','POST','4430350PlOGYE','settings','setupHeaders','VwFDT','env','error','domains','launch','extraHTTPHeaders','pVLXI','19582CMchYk','12509YWOjEh','/api/v1/profiles/','2024737FHrZdE','28108oEpMbz','about:blank','24LyTXhC','CnKwx','raw','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD,\x20configure\x20','auth','Your\x20org\x27s\x20auth-config\x20env\x20may\x20need\x20`invalidateOn:\x20[\x27port\x27]`\x20so\x20sessions\x20captured\x20on\x20one\x20port\x20aren\x27t\x20reused\x20on\x20another.','GAPyB','newPage','\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','origin','FjsjV','wwqYv','url','\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','ahxdG','Browser\x20login\x20timed\x20out\x20before\x20completion.','prompt','detail','username','If\x20logins\x20keep\x20failing,\x20declare\x20`invalidateOn:\x20[\x27baseUrl\x27]`\x20on\x20your\x20org\x27s\x20auth-config\x20env\x20so\x20port/domain\x20changes\x20force\x20a\x20fresh\x20login.','69oYNHgZ','OrLlp','KFxgf','protocol','\x22\x20for\x20','session_state','vWOBY','force','\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20','status','map','QFNUz','GTRJb','uTRTA','push','zAeeP','SXaGC','7spfThw','message'];_0x2987=function(){return _0x22606a;};return _0x2987();}import{existsSync}from'fs';import _0x4aaa9f from'inquirer';function _0x4720(_0x45771b,_0x2c0506){_0x45771b=_0x45771b-0x105;const _0x2987fb=_0x2987();let _0x472038=_0x2987fb[_0x45771b];return _0x472038;}import{chromium}from'playwright';import{getApiBaseUrl}from'./environment.js';import{getToken}from'./keychain.js';import{getRangerHomeDir}from'./rangerRoot.js';import{addProfileSetupBanner}from'./profileSetupBanner.js';import{duplicateCookiesForDomains,getSessionCachePath,getStorageStatePath,isCachedSessionLive,isInteractive,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0x56b08e=_0x4720,_0x16f0fe={'yeUpd':function(_0x23ce3f){return _0x23ce3f();},'ZOYTQ':_0x56b08e(0x155)},_0xba3ce3=await _0x16f0fe['yeUpd'](getToken);if(!_0xba3ce3)throw new Error(_0x16f0fe['ZOYTQ']);return _0xba3ce3;}async function apiRequest(_0x4ce5c4,_0x2ee256={}){const _0x1c2f99=_0x4720,_0x2e45d5={'QFNUz':function(_0x51ccd8,_0x396168,_0xb06e31){return _0x51ccd8(_0x396168,_0xb06e31);},'hffPD':'application/json','zAeeP':function(_0x12236f,_0xd347d6){return _0x12236f===_0xd347d6;}},_0x3eb6e0=await requireToken(),_0x5caeb2=getApiBaseUrl(),_0x3089d9=await _0x2e45d5[_0x1c2f99(0x137)](fetch,''+_0x5caeb2+_0x4ce5c4,{..._0x2ee256,'headers':{'Authorization':_0x1c2f99(0x16c)+_0x3eb6e0,'Content-Type':_0x2e45d5['hffPD'],..._0x2ee256[_0x1c2f99(0x17b)]??{}}});if(!_0x3089d9['ok']){let _0xe8ef8f='',_0x4f13be;try{const _0x2cacc5=await _0x3089d9[_0x1c2f99(0x153)]();_0xe8ef8f=(_0x2e45d5['zAeeP'](typeof _0x2cacc5[_0x1c2f99(0x10c)],_0x1c2f99(0x17e))?_0x2cacc5['error']:undefined)??JSON[_0x1c2f99(0x14e)](_0x2cacc5);if(_0x2e45d5[_0x1c2f99(0x13b)](typeof _0x2cacc5[_0x1c2f99(0x17a)],_0x1c2f99(0x17e)))_0x4f13be=_0x2cacc5[_0x1c2f99(0x17a)];}catch{_0xe8ef8f=_0x3089d9[_0x1c2f99(0x175)];}throw new ApiError('API\x20request\x20'+_0x4ce5c4+'\x20failed\x20('+_0x3089d9['status']+'):\x20'+_0xe8ef8f,_0x3089d9['status'],_0xe8ef8f,_0x4f13be);}return _0x3089d9[_0x1c2f99(0x153)]();}export class ApiError extends Error{[_0x46e1d6(0x135)];['detail'];['code'];constructor(_0x2aba2c,_0xbd6516,_0x2c447e,_0x21c5e9){const _0x4ce169=_0x46e1d6;super(_0x2aba2c),this['status']=_0xbd6516,this[_0x4ce169(0x129)]=_0x2c447e,this[_0x4ce169(0x17a)]=_0x21c5e9,this['name']=_0x4ce169(0x142);}}export async function fetchCloudProfile(_0x51eed7){const _0x4adfe8=_0x46e1d6,_0x2f2ace={'VwFDT':function(_0x4f4827,_0x44808a){return _0x4f4827(_0x44808a);},'FjsjV':function(_0x71c172,_0x467e12){return _0x71c172(_0x467e12);},'sBOKT':function(_0x4498f3,_0x47ed56){return _0x4498f3 instanceof _0x47ed56;},'qKHlb':function(_0x4237c5,_0x522de6){return _0x4237c5===_0x522de6;}};try{return await _0x2f2ace[_0x4adfe8(0x10a)](apiRequest,'/api/v1/profiles/'+_0x2f2ace[_0x4adfe8(0x121)](encodeURIComponent,_0x51eed7));}catch(_0x3e6fc7){if(_0x2f2ace['sBOKT'](_0x3e6fc7,ApiError)&&_0x2f2ace['qKHlb'](_0x3e6fc7[_0x4adfe8(0x135)],0x194))return null;throw _0x3e6fc7;}}export async function listCloudProfiles(){const _0x5a947c=_0x46e1d6,_0x5297ac=await apiRequest('/api/v1/profiles');return _0x5297ac[_0x5a947c(0x164)];}export async function createCloudProfile(_0x33cb05,_0x43a07a,_0x2e687b={}){const _0x571c19=_0x46e1d6,_0x3b2e9d={'DesSv':function(_0x39c1a3,_0x45d3de){return _0x39c1a3>_0x45d3de;},'GAPyB':function(_0x866a76,_0x9b9d7,_0x58201b){return _0x866a76(_0x9b9d7,_0x58201b);}},_0x259e08={'name':_0x33cb05};if(_0x43a07a)_0x259e08[_0x571c19(0x16d)]=_0x43a07a;_0x2e687b['settings']&&_0x3b2e9d[_0x571c19(0x161)](Object['keys'](_0x2e687b[_0x571c19(0x108)])['length'],0x0)&&(_0x259e08[_0x571c19(0x108)]=_0x2e687b[_0x571c19(0x108)]);if(_0x2e687b[_0x571c19(0x12a)])_0x259e08[_0x571c19(0x12a)]=_0x2e687b['username'];if(_0x2e687b[_0x571c19(0x152)])_0x259e08['password']=_0x2e687b[_0x571c19(0x152)];return await _0x3b2e9d[_0x571c19(0x11d)](apiRequest,'/api/v1/profiles',{'method':'POST','body':JSON['stringify'](_0x259e08)});}export async function uploadCloudProfileSession(_0x343e11,_0x5d5cf8){const _0xd72c4e=_0x46e1d6;return await apiRequest(_0xd72c4e(0x113)+encodeURIComponent(_0x343e11)+_0xd72c4e(0x14f),{'method':_0xd72c4e(0x106),'body':JSON[_0xd72c4e(0x14e)]({'session_state':_0x5d5cf8})});}export async function saveCloudProfileCredentials(_0x2341d7,_0x291365,_0x42ad9b){const _0x2a6514=_0x46e1d6,_0x2f2285={'SXaGC':function(_0x4e91b0,_0x2f82af,_0x135757){return _0x4e91b0(_0x2f82af,_0x135757);}};await _0x2f2285[_0x2a6514(0x13c)](apiRequest,_0x2a6514(0x113)+encodeURIComponent(_0x2341d7),{'method':'PUT','body':JSON['stringify']({'username':_0x291365,'password':_0x42ad9b})});}export async function fetchAuthConfig(){const _0x5d52e1={'grDmr':'/api/v1/profiles/auth-config'};try{const _0x4a8239=await apiRequest(_0x5d52e1['grDmr']);return _0x4a8239['auth_config'];}catch{return null;}}export function pickAdHocEnvKey(_0xb23423){const _0x38152c=_0x46e1d6,_0x603f40={'vWOBY':function(_0x337310,_0x52bb7c){return _0x337310===_0x52bb7c;},'DTnGw':function(_0x5632ff,_0x122e96){return _0x5632ff+_0x122e96;}};if(!_0xb23423)return null;if(_0xb23423[_0x38152c(0x174)])return _0xb23423[_0x38152c(0x174)];const _0x20038b=Object['keys'](_0xb23423['environments']??{});if(_0x603f40[_0x38152c(0x132)](_0x20038b[_0x38152c(0x182)],0x1))return _0x20038b[0x0];if(_0x20038b['length']===0x0)return null;throw new Error(_0x603f40['DTnGw']('Multiple\x20envs\x20in\x20this\x20org\x27s\x20auth\x20config\x20('+_0x20038b['join'](',\x20')+_0x38152c(0x169),_0x38152c(0x16b)));}export async function resolveAdHocProfile(_0x2f7764=process['env']){const _0x3af17b=_0x46e1d6,_0x14c899={'zqVaM':function(_0x57b0bb,_0x294b4d){return _0x57b0bb(_0x294b4d);},'CnKwx':function(_0x207350){return _0x207350();},'uVzAI':function(_0x46eb79,_0x204263){return _0x46eb79??_0x204263;}},_0x283e2c=_0x2f7764[_0x3af17b(0x148)];if(!_0x283e2c)return null;const _0x4e813b=await _0x14c899['zqVaM'](fetchCloudProfile,_0x283e2c);if(_0x4e813b)return{'name':_0x4e813b['name'],'profile':_0x4e813b};const _0x45506f=await _0x14c899[_0x3af17b(0x118)](fetchAuthConfig),_0xa4460=pickAdHocEnvKey(_0x45506f),_0x457fae=_0x2f7764['RANGER_TEST_PASSWORD'],_0x4f6f40=await createCloudProfile(_0x283e2c,_0x14c899['uVzAI'](_0xa4460,undefined),{'username':_0x283e2c,'password':_0x457fae});return console['log']('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x4f6f40[_0x3af17b(0x160)]+_0x3af17b(0x130)+_0x283e2c),{'name':_0x4f6f40['name'],'profile':_0x4f6f40};}export async function writeSessionToLocalCache(_0x495d77,_0x498c04,_0x59946f,_0x2df284,_0x1db29a,_0x496de0,_0x302f35){const _0xb5bd13=_0x46e1d6,_0x2633bf={'ahxdG':_0xb5bd13(0x11b),'rCNUF':function(_0x150d7a,_0x1bf12f){return _0x150d7a>_0x1bf12f;},'TXLSN':function(_0x427a98,_0xb177fe,_0x32a5ea){return _0x427a98(_0xb177fe,_0x32a5ea);},'uTRTA':function(_0x382134,_0x46a11f){return _0x382134(_0x46a11f);}},_0x41dcb8=sessionCacheHash({'orgId':_0x498c04,'profileName':_0x495d77,'effectiveBaseUrl':_0x59946f,'setupHeaders':_0x2df284,'invalidateOn':_0x302f35?.[_0xb5bd13(0x17c)],'userAgent':_0x302f35?.[_0xb5bd13(0x159)],'clientIp':_0x302f35?.[_0xb5bd13(0x166)]}),_0x4e3393=getSessionCachePath(_0x41dcb8,_0x495d77),_0x4d01a9=join(getRangerHomeDir(),_0x2633bf[_0xb5bd13(0x126)]);!existsSync(_0x4d01a9)&&await mkdir(_0x4d01a9,{'recursive':!![]});const _0x24dbed={..._0x1db29a};_0x496de0&&_0x2633bf['rCNUF'](_0x496de0['length'],0x0)&&Array[_0xb5bd13(0x149)](_0x24dbed['cookies'])&&(_0x24dbed[_0xb5bd13(0x165)]=duplicateCookiesForDomains(_0x24dbed[_0xb5bd13(0x165)],_0x496de0));const _0x3d6ea0={'cached_at':new Date()[_0xb5bd13(0x167)](),'session_state':_0x24dbed};await _0x2633bf['TXLSN'](writeFile,_0x4e3393,JSON['stringify'](_0x3d6ea0,null,0x2));const _0x22d612=_0x2633bf[_0xb5bd13(0x139)](getStorageStatePath,_0x4e3393);return await writeFile(_0x22d612,JSON['stringify'](_0x24dbed,null,0x2)),_0x22d612;}export async function checkLocalCache(_0x3b965e,_0x1dcf45,_0x47903f,_0x4d6969,_0x51ec0a){const _0x51080a=_0x46e1d6,_0x249767={'XwgRs':function(_0x23d324,_0x25072a,_0x48edbe){return _0x23d324(_0x25072a,_0x48edbe);},'Hrimo':'utf-8'},_0x3486bb=sessionCacheHash({'orgId':_0x1dcf45,'profileName':_0x3b965e,'effectiveBaseUrl':_0x47903f,'setupHeaders':_0x4d6969,'invalidateOn':_0x51ec0a?.[_0x51080a(0x17c)],'userAgent':_0x51ec0a?.[_0x51080a(0x159)],'clientIp':_0x51ec0a?.['clientIp']}),_0x5dae22=getSessionCachePath(_0x3486bb,_0x3b965e),_0x7bf180=getStorageStatePath(_0x5dae22);if(!existsSync(_0x5dae22)||!existsSync(_0x7bf180))return null;try{const _0x59ef40=await _0x249767[_0x51080a(0x147)](readFile,_0x5dae22,_0x249767[_0x51080a(0x171)]);return JSON['parse'](_0x59ef40),{'storageStatePath':_0x7bf180};}catch{return null;}}function launchRealBrowser(){return chromium['launch']({'headless':!![]});}function emitSessionValidationHint(_0x2e6496,_0x4eb7a2){const _0x133947=_0x46e1d6,_0x4513f8={'YruqN':_0x133947(0x11c)};if(!_0x4eb7a2||!_0x4eb7a2[_0x133947(0x10d)]?.[_0x133947(0x182)])return;let _0x42711b;try{_0x42711b=new URL(_0x2e6496);}catch{return;}const _0x167b94=[];for(const _0x12afa3 of _0x4eb7a2['domains']){try{_0x167b94[_0x133947(0x13a)]({'raw':_0x12afa3,'url':new URL(_0x12afa3)});}catch{}}if(_0x167b94[_0x133947(0x182)]===0x0)return;if(_0x167b94['some'](_0x5acb54=>_0x5acb54[_0x133947(0x123)][_0x133947(0x120)]===_0x42711b['origin']))return;const _0x1d01ff=_0x167b94[_0x133947(0x15f)](_0x88450e=>_0x42711b[_0x133947(0x141)]===_0x88450e[_0x133947(0x123)][_0x133947(0x141)]&&_0x42711b[_0x133947(0x12f)]===_0x88450e['url'][_0x133947(0x12f)]&&_0x42711b[_0x133947(0x176)]!==_0x88450e['url'][_0x133947(0x176)]),_0xf0982c=_0x1d01ff?_0x4513f8['YruqN']:_0x133947(0x12b),_0xb34a60=_0x167b94[_0x133947(0x136)](_0x10549f=>'\x22'+_0x10549f[_0x133947(0x119)]+'\x22')['join'](',\x20');console[_0x133947(0x150)](_0x133947(0x146)+_0xb34a60+';\x20'+('you\x27re\x20now\x20at\x20\x22'+_0x2e6496+_0x133947(0x134)+_0xf0982c));}export async function serverSideLogin(_0x5751b9,_0x309740){const _0xc7587=_0x46e1d6,_0x3f17ce={'cKCdk':function(_0x42edef,_0x131a11,_0x4b80e4){return _0x42edef(_0x131a11,_0x4b80e4);},'zfpkk':function(_0x459e65,_0xf02bb9){return _0x459e65(_0xf02bb9);},'cKEZB':_0xc7587(0x106),'TjfnN':function(_0x573b92,_0x29a6eb){return _0x573b92===_0x29a6eb;},'sZoOP':'not_configured'},_0x25c73e=process[_0xc7587(0x10b)]['RANGER_TEST_USERNAME'],_0x19231b=process['env']['RANGER_TEST_PASSWORD'],_0x27d1a6={};if(_0x25c73e)_0x27d1a6['username']=_0x25c73e;if(_0x19231b)_0x27d1a6[_0xc7587(0x152)]=_0x19231b;if(_0x309740?.['force'])_0x27d1a6[_0xc7587(0x133)]=!![];try{return await _0x3f17ce['cKCdk'](apiRequest,_0xc7587(0x113)+_0x3f17ce['zfpkk'](encodeURIComponent,_0x5751b9)+'/login',{'method':_0x3f17ce[_0xc7587(0x157)],'body':JSON[_0xc7587(0x14e)](_0x27d1a6)});}catch(_0x12254d){if(_0x12254d instanceof ApiError&&_0x3f17ce[_0xc7587(0x156)](_0x12254d['status'],0x190)&&_0x12254d['code']===_0x3f17ce[_0xc7587(0x143)])return{'status':_0x3f17ce['sZoOP'],'error':_0x12254d['detail']};throw _0x12254d;}}export async function manualBrowserLogin(_0x2bfd1d,_0x14cb96){const _0x409c6e=_0x46e1d6,_0x2267ee={'nMJsQ':function(_0x580257){return _0x580257();},'pwoBn':function(_0x45dd1a){return _0x45dd1a();},'GTRJb':_0x409c6e(0x11a),'euDOA':_0x409c6e(0x116),'jAZxV':function(_0x1a063d,_0x56c3fe){return _0x1a063d(_0x56c3fe);},'NWCFr':function(_0x546cac,_0x315d89){return _0x546cac&&_0x315d89;},'wwqYv':_0x409c6e(0x127),'wsgME':function(_0x2143d6,_0x82eee4,_0x20612b){return _0x2143d6(_0x82eee4,_0x20612b);},'czpof':function(_0x5e19f9,_0x2b6840){return _0x5e19f9(_0x2b6840);},'TsVnz':'POST'};if(!_0x2267ee['pwoBn'](isInteractive))throw new Error('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0x2bfd1d['name']+_0x409c6e(0x173)+_0x2267ee[_0x409c6e(0x138)]+_0x409c6e(0x180));const _0x31869e=_0x14cb96&&_0x14cb96['domains']['length']>0x0?_0x14cb96['domains'][0x0]:_0x2267ee['euDOA'];console[_0x409c6e(0x150)](_0x409c6e(0x14d)),console['log'](_0x409c6e(0x124)),await new Promise(_0x17bf6d=>setTimeout(_0x17bf6d,0x7d0));const _0x879a3c=await chromium[_0x409c6e(0x10e)]({'headless':![]});let _0x310249=null;try{const _0x52724a={'ignoreHTTPSErrors':!![]};_0x14cb96?.['setupHeaders']&&(_0x52724a[_0x409c6e(0x10f)]=_0x14cb96[_0x409c6e(0x109)]);const _0x28241b=await _0x879a3c['newContext'](_0x52724a);await _0x2267ee['jAZxV'](addProfileSetupBanner,_0x28241b);const _0x57d040=await _0x28241b[_0x409c6e(0x11e)]();await _0x57d040['goto'](_0x31869e);let _0x269d7c=![];await new Promise(_0x2faa80=>{const _0x451a27=_0x409c6e,_0xb37147={'KFxgf':function(_0xbe031){return _0x2267ee['pwoBn'](_0xbe031);}},_0x1ca004=setTimeout(()=>{const _0x64b988=_0x4720;_0x269d7c=!![],console['error']('Browser\x20login\x20timed\x20out\x20after\x20'+MANUAL_LOGIN_TIMEOUT_MS/0xea60+_0x64b988(0x125)),_0x2267ee[_0x64b988(0x163)](_0x2faa80);},MANUAL_LOGIN_TIMEOUT_MS);_0x57d040['on'](_0x451a27(0x154),async()=>{const _0xdb7d36=_0x451a27;clearTimeout(_0x1ca004);try{const _0x432b15=await _0x28241b['storageState']();_0x310249=_0x432b15;}catch{}_0xb37147[_0xdb7d36(0x12e)](_0x2faa80);});});if(_0x2267ee[_0x409c6e(0x13f)](_0x269d7c,!_0x310249))throw new Error(_0x2267ee[_0x409c6e(0x122)]);}finally{await _0x879a3c[_0x409c6e(0x154)]()[_0x409c6e(0x15a)](()=>{});}if(!_0x310249)throw new Error('Browser\x20closed\x20before\x20authentication\x20was\x20saved.');return await _0x2267ee[_0x409c6e(0x16f)](apiRequest,_0x409c6e(0x113)+_0x2267ee['czpof'](encodeURIComponent,_0x2bfd1d[_0x409c6e(0x160)])+'/session',{'method':_0x2267ee['TsVnz'],'body':JSON[_0x409c6e(0x14e)]({'session_state':_0x310249,'updated_by':'cli:manual-login'})}),{'sessionState':_0x310249};}export async function promptSaveCredentials(_0x454351){const _0x5ca620=_0x46e1d6,_0x1bb7b7={'Cpext':function(_0x3fe92e,_0x1109ca){return _0x3fe92e||_0x1109ca;},'ZBqOu':_0x5ca620(0x158),'FHRny':function(_0x1cee96,_0x36ed38,_0x256501){return _0x1cee96(_0x36ed38,_0x256501);},'uUxve':function(_0x5e45a8,_0x5e55b4){return _0x5e45a8(_0x5e55b4);},'wedBO':_0x5ca620(0x170),'pVLXI':_0x5ca620(0x178)},_0x2a90d0=process['env']['RANGER_TEST_USERNAME'],_0x2024e8=process['env'][_0x5ca620(0x172)];if(_0x1bb7b7['Cpext'](!_0x2a90d0,!_0x2024e8))return;if(!isInteractive())return;const {save:_0x5bdcb8}=await _0x4aaa9f[_0x5ca620(0x128)]([{'type':_0x5ca620(0x168),'name':_0x1bb7b7['ZBqOu'],'message':_0x5ca620(0x15b),'default':![]}]);if(!_0x5bdcb8)return;await _0x1bb7b7['FHRny'](apiRequest,_0x5ca620(0x113)+_0x1bb7b7[_0x5ca620(0x105)](encodeURIComponent,_0x454351),{'method':_0x1bb7b7['wedBO'],'body':JSON['stringify']({'username':_0x2a90d0,'password':_0x2024e8})}),console['log'](_0x1bb7b7[_0x5ca620(0x110)]);}export async function resolveCloudProfileSession(_0xc2b472,_0xb38b2e={}){const _0x1ceab3=_0x46e1d6,_0x202545={'OrLlp':function(_0x17d811){return _0x17d811();},'fauYY':function(_0x30c089,_0x442e02,_0xaccb0c){return _0x30c089(_0x442e02,_0xaccb0c);},'TZDiV':function(_0x3268fa,_0x51f55e,_0x353e54,_0x410949,_0x5750aa,_0x555e83){return _0x3268fa(_0x51f55e,_0x353e54,_0x410949,_0x5750aa,_0x555e83);},'GLnYG':function(_0x4c7a12,_0x490b06){return _0x4c7a12(_0x490b06);},'AXOWI':function(_0x2f9ed5,_0x2483f8){return _0x2f9ed5(_0x2483f8);},'tnMzJ':function(_0x9262d2,_0x1b379b){return _0x9262d2||_0x1b379b;},'qtmnM':function(_0x3160b6,_0x429e6d){return _0x3160b6(_0x429e6d);},'gJsJh':function(_0x39ccda,_0x1dbf7d){return _0x39ccda===_0x1dbf7d;},'cjFwQ':'success','fsYtw':function(_0x518875,_0xd27923,_0x433b41,_0xe2040e,_0x190891,_0x40c147,_0x37b743,_0x46cc04){return _0x518875(_0xd27923,_0x433b41,_0xe2040e,_0x190891,_0x40c147,_0x37b743,_0x46cc04);},'Rprot':_0x1ceab3(0x11f),'oixog':function(_0x16ab4f,_0x5b5ffe){return _0x16ab4f instanceof _0x5b5ffe;},'ElVde':function(_0x1672aa,_0x35a142,_0x3ecbfd){return _0x1672aa(_0x35a142,_0x3ecbfd);}},_0x27580b=_0xc2b472[_0x1ceab3(0x108)]??{},_0x45eb44=await _0x202545[_0x1ceab3(0x12d)](fetchAuthConfig),_0x59f649=_0x45eb44?_0x202545['fauYY'](resolveAuthEnvironmentLocally,_0x45eb44,_0xc2b472['environmentKey']):null,_0x90ba96=_0x59f649?.[_0x1ceab3(0x10d)],_0x5e9b41=_0x27580b[_0x1ceab3(0x109)],_0x4f2c01=_0x5e9b41??_0x59f649?.[_0x1ceab3(0x109)],_0x3eb909=_0xb38b2e['effectiveBaseUrl']??_0x27580b['baseUrl']??(_0x90ba96&&_0x90ba96['length']>0x0?_0x90ba96[0x0]:''),_0x3128c7={'invalidateOn':_0x59f649?.[_0x1ceab3(0x17c)],'userAgent':_0x59f649?.['browserOptions']?.['userAgent']??_0x27580b['userAgent']},_0x55c075=await _0x202545['TZDiV'](checkLocalCache,_0xc2b472['name'],_0xc2b472['organizationId'],_0x3eb909,_0x4f2c01,_0x3128c7);if(_0x55c075){if(_0x3eb909){const _0x153918=await isCachedSessionLive(_0x55c075[_0x1ceab3(0x181)],_0x3eb909,{'sessionCheckPath':_0x59f649?.[_0x1ceab3(0x17d)],'setupHeaders':_0x4f2c01},{'launchBrowser':launchRealBrowser});if(_0x153918)return console['log'](_0x1ceab3(0x162)+_0xc2b472['name']+'\x22'),{'authPath':_0x55c075[_0x1ceab3(0x181)],'settings':_0x27580b,'resolvedEnv':_0x59f649};console[_0x1ceab3(0x150)]('\x20\x20Cached\x20session\x20for\x20\x22'+_0xc2b472[_0x1ceab3(0x160)]+_0x1ceab3(0x16a)),_0x202545[_0x1ceab3(0x140)](emitSessionValidationHint,_0x3eb909,_0x59f649);}else return{'authPath':_0x55c075[_0x1ceab3(0x181)],'settings':_0x27580b,'resolvedEnv':_0x59f649};}if(_0xc2b472['sessionState']){const _0x2126a2=await writeSessionToLocalCache(_0xc2b472['name'],_0xc2b472[_0x1ceab3(0x15e)],_0x3eb909,_0x4f2c01,_0xc2b472['sessionState'],_0x90ba96,_0x3128c7);if(_0x3eb909){const _0xf04064=await isCachedSessionLive(_0x2126a2,_0x3eb909,{'sessionCheckPath':_0x59f649?.[_0x1ceab3(0x17d)],'setupHeaders':_0x4f2c01},{'launchBrowser':launchRealBrowser});if(_0xf04064)return console[_0x1ceab3(0x150)]('\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22'+_0xc2b472['name']+'\x22,\x20cached\x20locally'),{'authPath':_0x2126a2,'settings':_0x27580b,'resolvedEnv':_0x59f649};console[_0x1ceab3(0x150)](_0x1ceab3(0x15c)+_0xc2b472['name']+'\x22\x20failed\x20validation\x20—\x20re-login\x20needed...'),emitSessionValidationHint(_0x3eb909,_0x59f649);}else return{'authPath':_0x2126a2,'settings':_0x27580b,'resolvedEnv':_0x59f649};}console[_0x1ceab3(0x150)](_0x1ceab3(0x16e)+_0xc2b472['name']+'\x22,\x20attempting\x20login...');const _0x20fae2=_0x202545['GLnYG'](Boolean,process['env']['RANGER_TEST_USERNAME'])&&_0x202545['AXOWI'](Boolean,process['env'][_0x1ceab3(0x172)]),_0x58eb47=Boolean(_0xc2b472[_0x1ceab3(0x12a)]);if(_0x202545['tnMzJ'](_0x20fae2,_0x58eb47))try{const _0x48cedd=await _0x202545['qtmnM'](serverSideLogin,_0xc2b472['name']);if(_0x202545[_0x1ceab3(0x151)](_0x48cedd['status'],_0x1ceab3(0x14a)))console['log']('\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...');else{if(_0x48cedd[_0x1ceab3(0x135)]===_0x202545['cjFwQ']&&_0x48cedd['session_state']){console[_0x1ceab3(0x150)]('\x20\x20Login\x20successful.\x20Session\x20cached.');const _0x4580c2=await _0x202545['fsYtw'](writeSessionToLocalCache,_0xc2b472['name'],_0xc2b472[_0x1ceab3(0x15e)],_0x3eb909,_0x4f2c01,_0x48cedd[_0x1ceab3(0x131)],_0x90ba96,_0x3128c7);return _0x20fae2&&!_0x58eb47&&await promptSaveCredentials(_0xc2b472['name']),{'authPath':_0x4580c2,'settings':_0x27580b,'resolvedEnv':_0x59f649};}else _0x48cedd[_0x1ceab3(0x144)]&&(console[_0x1ceab3(0x150)](_0x202545[_0x1ceab3(0x177)]),console['log'](_0x48cedd['test_output'])),console['log']('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}}catch(_0x3ed50e){console[_0x1ceab3(0x150)]('\x20\x20Server-side\x20login\x20error:\x20'+(_0x202545['oixog'](_0x3ed50e,Error)?_0x3ed50e[_0x1ceab3(0x13e)]:String(_0x3ed50e))),console[_0x1ceab3(0x150)](_0x1ceab3(0x14b));}const {sessionState:_0x1c0211}=await _0x202545[_0x1ceab3(0x145)](manualBrowserLogin,_0xc2b472,_0x59f649),_0x132634=await _0x202545['fsYtw'](writeSessionToLocalCache,_0xc2b472[_0x1ceab3(0x160)],_0xc2b472[_0x1ceab3(0x15e)],_0x3eb909,_0x4f2c01,_0x1c0211,_0x90ba96,_0x3128c7);return{'authPath':_0x132634,'settings':_0x27580b,'resolvedEnv':_0x59f649};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x158c53=_0x1a4a;(function(_0x9a3500,_0x548041){const _0x826f78=_0x1a4a,_0x220b1c=_0x9a3500();while(!![]){try{const _0x7d1053=parseInt(_0x826f78(0xa1))/0x1*(-parseInt(_0x826f78(0x97))/0x2)+-parseInt(_0x826f78(0xac))/0x3*(-parseInt(_0x826f78(0x8b))/0x4)+parseInt(_0x826f78(0x9d))/0x5+-parseInt(_0x826f78(0x96))/0x6+parseInt(_0x826f78(0x93))/0x7+parseInt(_0x826f78(0xb0))/0x8*(-parseInt(_0x826f78(0xaa))/0x9)+parseInt(_0x826f78(0xa9))/0xa*(parseInt(_0x826f78(0x91))/0xb);if(_0x7d1053===_0x548041)break;else _0x220b1c['push'](_0x220b1c['shift']());}catch(_0x4b1c01){_0x220b1c['push'](_0x220b1c['shift']());}}}(_0x3a7a,0x5cc02));import{createHash}from'crypto';import{join}from'path';function _0x3a7a(){const _0x172a57=['ddgUc','newPage','8aZXLNk','invalidateOn','add','port','domcontentloaded','url','keys','digest','has','env','pathname','10828GExoEj','userAgent','127.0.0.1','localhost','length','eAwlw','44902CGNVcj','setupHeaders','709940PfNCaN','environments','slice','4511892DAPogE','2KySgpF','sort','orgId','map','nemhQ','isTTY','2065780JTQhHh','RtNwd','test','stdout','129431gQiElX','newContext','ggRId','toString','push','clientIp','hostname','launchBrowser','1130kptxVp','451719XiWaGi','stdin','372HRkiND','UFNcI'];_0x3a7a=function(){return _0x172a57;};return _0x3a7a();}import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x38e096=process[_0x158c53(0x89)],_0x4fdd60={'stdin':process['stdin'],'stdout':process[_0x158c53(0xa0)]}){const _0x5669a4=_0x158c53,_0x4e9184={'wnxQp':function(_0x5a222f,_0x11fb23){return _0x5a222f(_0x11fb23);}};if(_0x38e096['CI'])return![];return _0x4e9184['wnxQp'](Boolean,_0x4fdd60[_0x5669a4(0xab)]['isTTY'])&&_0x4e9184['wnxQp'](Boolean,_0x4fdd60[_0x5669a4(0xa0)][_0x5669a4(0x9c)]);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x2bf7c6){const _0x51a379=_0x158c53,_0x6d5c48={'WoeOz':'clientIp','GRjRt':'sha256','Bjbys':'hex'},_0x5778b6=new Set(_0x2bf7c6[_0x51a379(0xb1)]??DEFAULT_INVALIDATE_ON),_0x410720={'orgId':_0x2bf7c6[_0x51a379(0x99)],'profileName':_0x2bf7c6['profileName']};return _0x5778b6[_0x51a379(0x88)]('baseUrl')&&(_0x410720['effectiveBaseUrl']=_0x2bf7c6['effectiveBaseUrl']),_0x5778b6['has']('setupHeaders')&&(_0x410720[_0x51a379(0x92)]=_0x2bf7c6[_0x51a379(0x92)]?sortObjectKeys(_0x2bf7c6['setupHeaders']):_0x2bf7c6[_0x51a379(0x92)]),_0x5778b6['has']('port')&&(_0x410720[_0x51a379(0xb3)]=extractPort(_0x2bf7c6['effectiveBaseUrl'])),_0x5778b6['has'](_0x51a379(0x8c))&&_0x2bf7c6[_0x51a379(0x8c)]!==undefined&&(_0x410720['userAgent']=_0x2bf7c6[_0x51a379(0x8c)]),_0x5778b6['has'](_0x6d5c48['WoeOz'])&&_0x2bf7c6[_0x51a379(0xa6)]!==undefined&&(_0x410720['clientIp']=_0x2bf7c6['clientIp']),createHash(_0x6d5c48['GRjRt'])['update'](JSON['stringify'](_0x410720))[_0x51a379(0x87)](_0x6d5c48['Bjbys'])[_0x51a379(0x95)](0x0,0xc);}function extractPort(_0x25e790){try{return new URL(_0x25e790)['port'];}catch{return'';}}function _0x1a4a(_0x262c05,_0x20fe34){_0x262c05=_0x262c05-0x84;const _0x3a7ab3=_0x3a7a();let _0x1a4ae9=_0x3a7ab3[_0x262c05];return _0x1a4ae9;}function sortObjectKeys(_0x246df1){const _0x255569=_0x158c53,_0x4e3bc4={};for(const _0x2b5ea2 of Object[_0x255569(0x86)](_0x246df1)[_0x255569(0x98)]()){_0x4e3bc4[_0x2b5ea2]=_0x246df1[_0x2b5ea2];}return _0x4e3bc4;}export function getSessionCachePath(_0x3cbf42,_0x231b1f){const _0x585278=_0x158c53,_0x401449={'eAwlw':function(_0x50f08d){return _0x50f08d();},'ggRId':'auth'};return join(_0x401449[_0x585278(0x90)](getRangerHomeDir),_0x401449[_0x585278(0xa3)],_0x3cbf42+'-'+_0x231b1f+'.json');}export function getStorageStatePath(_0x31c58b){const _0x2173e7=_0x158c53,_0x2ac904={'ddgUc':'.storageState.json'};return _0x31c58b['replace'](/\.json$/,_0x2ac904[_0x2173e7(0xae)]);}export function needsTunnel(_0x546668){const _0x30d28f=_0x158c53,_0x470478={'RtNwd':_0x30d28f(0x8e),'RHZUD':'.localhost','UFNcI':'localhost.'};let _0x19122d;try{_0x19122d=new URL(_0x546668)[_0x30d28f(0xa7)];}catch{return![];}if(_0x19122d===_0x470478[_0x30d28f(0x9e)]||_0x19122d===_0x30d28f(0x8d))return!![];if(_0x19122d['endsWith'](_0x470478['RHZUD']))return!![];if(_0x19122d['includes'](_0x470478[_0x30d28f(0xad)]))return!![];return![];}export function hostnameOf(_0x52a11e){return new URL(_0x52a11e)['hostname'];}export function duplicateCookiesForDomains(_0x32ce79,_0xdd78d5){const _0x32d50b=_0x158c53,_0x5a38ba=[..._0x32ce79],_0x5afe83=new Set(_0x32ce79[_0x32d50b(0x9a)](_0x4a26f7=>_0x4a26f7['domain']));for(const _0x44183f of _0xdd78d5){let _0x21924d;try{_0x21924d=hostnameOf(_0x44183f);}catch{continue;}if(!_0x21924d)continue;const _0x23be74=_0x21924d['startsWith']('.')?_0x21924d:'.'+_0x21924d;if(_0x5afe83[_0x32d50b(0x88)](_0x21924d)||_0x5afe83['has'](_0x23be74))continue;for(const _0x5b99f5 of _0x32ce79){_0x5a38ba[_0x32d50b(0xa5)]({..._0x5b99f5,'domain':_0x23be74});}_0x5afe83[_0x32d50b(0xb2)](_0x23be74);}return _0x5a38ba;}export function resolveAuthEnvironmentLocally(_0x200159,_0x18a658){const _0x52b15a=_0x158c53,_0xefcaef=_0x200159[_0x52b15a(0x94)];if(_0x18a658){const _0x498af1=_0xefcaef[_0x18a658];if(!_0x498af1)return null;return{'key':_0x18a658,..._0x498af1};}if(_0x200159['defaultEnvironmentKey']){const _0x53e6e1=_0xefcaef[_0x200159['defaultEnvironmentKey']];if(!_0x53e6e1)return null;return{'key':_0x200159['defaultEnvironmentKey'],..._0x53e6e1};}const _0x1e1ce6=Object['keys'](_0xefcaef);if(_0x1e1ce6[_0x52b15a(0x8f)]===0x1){const _0x211dec=_0x1e1ce6[0x0];return{'key':_0x211dec,..._0xefcaef[_0x211dec]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x5baff6,_0x419fc4){const _0x38b78b=_0x158c53;try{if(_0x419fc4)return new URL(_0x419fc4,_0x5baff6)[_0x38b78b(0xa4)]();return new URL(_0x5baff6)[_0x38b78b(0xa4)]();}catch{return null;}}export function looksLikeLoginUrl(_0x5929dc){const _0x4daa3f=_0x158c53;try{const _0x20c760=new URL(_0x5929dc);return LOGIN_URL_PATTERN['test'](_0x20c760[_0x4daa3f(0x8a)]);}catch{return LOGIN_URL_PATTERN[_0x4daa3f(0x9f)](_0x5929dc);}}export async function isCachedSessionLive(_0x211925,_0x18034f,_0x367f66={},_0x58ac18={}){const _0x11771c=_0x158c53,_0x328c42={'CaLHy':function(_0x415b1f,_0x128f73,_0x2db906){return _0x415b1f(_0x128f73,_0x2db906);},'nemhQ':_0x11771c(0x84)},_0x25e2f6=_0x328c42['CaLHy'](buildSessionCheckUrl,_0x18034f,_0x367f66['sessionCheckPath']);if(!_0x25e2f6)return!![];if(!_0x58ac18['launchBrowser'])return!![];let _0xcfd29a=null;try{_0xcfd29a=await _0x58ac18[_0x11771c(0xa8)]();const _0x37114d=await _0xcfd29a[_0x11771c(0xa2)]({'storageState':_0x211925,'ignoreHTTPSErrors':!![],..._0x367f66[_0x11771c(0x92)]?{'extraHTTPHeaders':_0x367f66[_0x11771c(0x92)]}:{}}),_0x18a520=await _0x37114d[_0x11771c(0xaf)](),_0x9cb3fe=await _0x18a520['goto'](_0x25e2f6,{'waitUntil':_0x328c42[_0x11771c(0x9b)],'timeout':0x3a98}),_0x40f7b7=_0x9cb3fe?.['status']();if(_0x40f7b7===0x191||_0x40f7b7===0x193)return![];const _0x2f5133=_0x18a520[_0x11771c(0x85)]();if(looksLikeLoginUrl(_0x2f5133))return![];return!![];}catch{return![];}finally{if(_0xcfd29a)await _0xcfd29a['close']()['catch'](()=>{});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x2c21e4=_0x2cf3;(function(_0x485849,_0x4f2d67){const _0x1e8526=_0x2cf3,_0x57d5cc=_0x485849();while(!![]){try{const _0x36e825=parseInt(_0x1e8526(0xed))/0x1+-parseInt(_0x1e8526(0xee))/0x2+parseInt(_0x1e8526(0xef))/0x3+parseInt(_0x1e8526(0xea))/0x4+-parseInt(_0x1e8526(0xec))/0x5+-parseInt(_0x1e8526(0xe9))/0x6+parseInt(_0x1e8526(0xe3))/0x7*(parseInt(_0x1e8526(0xeb))/0x8);if(_0x36e825===_0x4f2d67)break;else _0x57d5cc['push'](_0x57d5cc['shift']());}catch(_0x4e7384){_0x57d5cc['push'](_0x57d5cc['shift']());}}}(_0x21e3,0x81d8d));import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';function _0x2cf3(_0x39662c,_0x1b5b76){_0x39662c=_0x39662c-0xe1;const _0x21e383=_0x21e3();let _0x2cf301=_0x21e383[_0x39662c];return _0x2cf301;}const ALGORITHM=_0x2c21e4(0xe2),SALT='ranger-auth-encryption',KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;function _0x21e3(){const _0x8c5958=['935762MxTLTJ','1764129PmoaIV','getAuthTag','aes-256-gcm','1053815MJcUfV','xQuvy','update','FQlnJ','subarray','concat','4391130wSpOeZ','1518320nDQCfz','56vqoZsX','2079425CYsmRk','126036zgwXhh'];_0x21e3=function(){return _0x8c5958;};return _0x21e3();}export function deriveKey(_0x244edb){return pbkdf2Sync(_0x244edb,SALT,0x186a0,KEY_LENGTH,'sha256');}export function encrypt(_0x54097f,_0x115706){const _0x11c547=_0x2c21e4,_0x502718={'uBytu':function(_0x55094c,_0x565b05,_0x362b6e,_0x3229ad){return _0x55094c(_0x565b05,_0x362b6e,_0x3229ad);}},_0x1b4fb4=deriveKey(_0x115706),_0x32ae22=randomBytes(IV_LENGTH),_0x1ec476=_0x502718['uBytu'](createCipheriv,ALGORITHM,_0x1b4fb4,_0x32ae22),_0x1fda81=Buffer['concat']([_0x1ec476[_0x11c547(0xe5)](_0x54097f,'utf8'),_0x1ec476['final']()]),_0x54eda2=_0x1ec476[_0x11c547(0xe1)]();return Buffer[_0x11c547(0xe8)]([_0x32ae22,_0x54eda2,_0x1fda81]);}export function decrypt(_0x2ad758,_0x24154e){const _0x1892e9=_0x2c21e4,_0x2c8f01={'FQlnJ':function(_0x11693c,_0x431580){return _0x11693c(_0x431580);},'xQuvy':function(_0x9d307b,_0x4a44de){return _0x9d307b+_0x4a44de;},'bnrTZ':function(_0x36d745,_0x28580d,_0x3a7449,_0x588a1e){return _0x36d745(_0x28580d,_0x3a7449,_0x588a1e);}},_0xf3a1ae=_0x2c8f01[_0x1892e9(0xe6)](deriveKey,_0x24154e),_0x343fdf=_0x2ad758[_0x1892e9(0xe7)](0x0,IV_LENGTH),_0x86db25=_0x2ad758['subarray'](IV_LENGTH,IV_LENGTH+TAG_LENGTH),_0x36079e=_0x2ad758[_0x1892e9(0xe7)](_0x2c8f01['xQuvy'](IV_LENGTH,TAG_LENGTH)),_0x503a8f=_0x2c8f01['bnrTZ'](createDecipheriv,ALGORITHM,_0xf3a1ae,_0x343fdf);return _0x503a8f['setAuthTag'](_0x86db25),_0x2c8f01[_0x1892e9(0xe4)](_0x503a8f['update'](_0x36079e),_0x503a8f['final']('utf8'));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x20e164=_0x340e;(function(_0x30fd85,_0x3acf73){const _0x26c554=_0x340e,_0x44dfa5=_0x30fd85();while(!![]){try{const _0x40d384=-parseInt(_0x26c554(0x187))/0x1*(-parseInt(_0x26c554(0x1a2))/0x2)+-parseInt(_0x26c554(0x18d))/0x3*(-parseInt(_0x26c554(0x194))/0x4)+-parseInt(_0x26c554(0x1a4))/0x5*(-parseInt(_0x26c554(0x1a0))/0x6)+parseInt(_0x26c554(0x197))/0x7*(parseInt(_0x26c554(0x182))/0x8)+-parseInt(_0x26c554(0x188))/0x9+parseInt(_0x26c554(0x1b0))/0xa*(parseInt(_0x26c554(0x198))/0xb)+-parseInt(_0x26c554(0x18a))/0xc*(parseInt(_0x26c554(0x18c))/0xd);if(_0x40d384===_0x3acf73)break;else _0x44dfa5['push'](_0x44dfa5['shift']());}catch(_0x4d830e){_0x44dfa5['push'](_0x44dfa5['shift']());}}}(_0x7864,0x1fde6));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';function _0x340e(_0x1417aa,_0x685f05){_0x1417aa=_0x1417aa-0x180;const _0x78648a=_0x7864();let _0x340e86=_0x78648a[_0x1417aa];return _0x340e86;}function _0x7864(){const _0x170935=['unknown_argument','141875GxeDUQ','metadata','rawCommand','tCKuX','glNaj','Ihown','push','[desire-path]\x20Failed\x20to\x20send:\x20','unknown','error','test','[desire-path]\x20Payload:\x20','110reASgH','Afglf','slice','--credentials','has','YxVpj','--apikey','errorType','RnJvX','Not\x20enough\x20non-option\x20arguments','14624Acdtmp','includes','Unknown\x20argument','has_token','startsWith','1axRQtb','565398ivUuLz','isTTY','24xWSxpE','GlMZh','3807817thIbqA','446535caItTb','--key','3|1|0|2|6|5|7|4','Missing\x20required\x20argument','--secret','POST','stringify','4IBrxmA','--cookie','/api/v1/mcp/desire-path-logs','581pniIjQ','58531ZOyyLP','GQSGX','toLowerCase','unknown_command','--token','runtime_error','env','join','42tOffgY','Bearer\x20','442898ZkKzrH'];_0x7864=function(){return _0x170935;};return _0x7864();}const SENSITIVE_FLAGS=new Set([_0x20e164(0x19c),'-t',_0x20e164(0x191),'--api-key',_0x20e164(0x1b6),_0x20e164(0x18e),'--password','--pass','--auth','--authorization','--header',_0x20e164(0x195),_0x20e164(0x1b3)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0x2868e7){const _0x3c098a=_0x20e164;return TOKEN_PATTERNS['some'](_0x47cce9=>_0x47cce9[_0x3c098a(0x1ae)](_0x2868e7));}export function sanitizeArgs(_0x10ec28){const _0x4eb026=_0x20e164,_0x3fa378={'Afglf':'[REDACTED]','glNaj':function(_0xf4d90e,_0x46dfb2){return _0xf4d90e!==_0x46dfb2;},'aSbti':function(_0x3025c1,_0x5dbaff){return _0x3025c1(_0x5dbaff);}},_0x156c03=[];let _0x110d78=![];for(let _0x29e973=0x0;_0x29e973<_0x10ec28['length'];_0x29e973++){const _0x531dd3=_0x10ec28[_0x29e973];if(_0x110d78){_0x156c03['push'](_0x3fa378['Afglf']),_0x110d78=![];continue;}if(_0x531dd3['startsWith']('--')||_0x531dd3[_0x4eb026(0x186)]('-')){const _0x2a33c0=_0x531dd3['indexOf']('=');if(_0x3fa378[_0x4eb026(0x1a8)](_0x2a33c0,-0x1)){const _0xa8c6=_0x531dd3['slice'](0x0,_0x2a33c0)['toLowerCase']();if(SENSITIVE_FLAGS['has'](_0xa8c6)){_0x156c03[_0x4eb026(0x1aa)](_0x531dd3[_0x4eb026(0x1b2)](0x0,_0x2a33c0)+'=[REDACTED]');continue;}}else{const _0x2e19a3=_0x531dd3[_0x4eb026(0x19a)]();SENSITIVE_FLAGS[_0x4eb026(0x1b4)](_0x2e19a3)&&(_0x110d78=!![]);}_0x156c03[_0x4eb026(0x1aa)](_0x531dd3);}else _0x3fa378['aSbti'](looksLikeToken,_0x531dd3)?_0x156c03[_0x4eb026(0x1aa)](_0x3fa378[_0x4eb026(0x1b1)]):_0x156c03['push'](_0x531dd3);}return _0x156c03[_0x4eb026(0x19f)]('\x20');}export async function logDesirePath(_0x5cfb58){const _0x4f5848=_0x20e164,_0x3a2eef={'lpdBs':function(_0x2dd1a0){return _0x2dd1a0();},'Ihown':function(_0x3f991e){return _0x3f991e();},'LPhKe':'no_token','UKOpF':function(_0x568347,_0x54f45c,_0x3928b4){return _0x568347(_0x54f45c,_0x3928b4);}};try{const _0x3c7b5b=await _0x3a2eef['lpdBs'](getToken)['catch'](()=>null),_0x2cc8ac=_0x3a2eef[_0x4f5848(0x1a9)](getApiBaseUrl),_0x3d8541=getCurrentVersion(),_0x18932b=_0x3c7b5b?_0x4f5848(0x185):_0x3a2eef['LPhKe'],_0x28de0c={..._0x5cfb58[_0x4f5848(0x1a5)],'authStatus':_0x18932b,'isTty':process['stdout'][_0x4f5848(0x189)]??![]},_0x3104c5={'Content-Type':'application/json'};_0x3c7b5b&&(_0x3104c5['Authorization']=_0x4f5848(0x1a1)+_0x3c7b5b);const _0x1bd7f4={'rawCommand':_0x5cfb58[_0x4f5848(0x1a6)],'errorMessage':_0x5cfb58['errorMessage'],'errorType':_0x5cfb58[_0x4f5848(0x1b7)],'featureId':_0x5cfb58['featureId'],'sessionId':_0x5cfb58['sessionId'],'metadata':_0x28de0c,'cliVersion':_0x3d8541};process['env']['DEBUG']&&(console['error']('[desire-path]\x20Sending\x20log\x20to\x20'+_0x2cc8ac+'/api/v1/mcp/desire-path-logs'),console[_0x4f5848(0x1ad)](_0x4f5848(0x1af)+JSON['stringify'](_0x1bd7f4,null,0x2))),await _0x3a2eef['UKOpF'](fetch,_0x2cc8ac+_0x4f5848(0x196),{'method':_0x4f5848(0x192),'headers':_0x3104c5,'body':JSON[_0x4f5848(0x193)](_0x1bd7f4)});}catch(_0x323a23){process[_0x4f5848(0x19e)]['DEBUG']&&console['error'](_0x4f5848(0x1ab)+_0x323a23);}}export function getErrorType(_0x406720,_0x3c0531){const _0x4566ac=_0x20e164,_0x4d8b8d={'RnJvX':_0x4566ac(0x18f),'tCKuX':_0x4566ac(0x19b),'GQSGX':_0x4566ac(0x1ac),'XzLDx':_0x4566ac(0x184),'EPuBG':_0x4566ac(0x1a3),'YxVpj':'Invalid\x20values','GlMZh':'missing_required_argument'},_0x202965=_0x4d8b8d[_0x4566ac(0x180)]['split']('|');let _0x23c353=0x0;while(!![]){switch(_0x202965[_0x23c353++]){case'0':if(_0x406720['includes']('Unknown\x20command'))return _0x4d8b8d[_0x4566ac(0x1a7)];continue;case'1':if(!_0x406720)return _0x4d8b8d[_0x4566ac(0x199)];continue;case'2':if(_0x406720[_0x4566ac(0x183)](_0x4d8b8d['XzLDx']))return _0x4d8b8d['EPuBG'];continue;case'3':if(_0x3c0531)return _0x4566ac(0x19d);continue;case'4':return'syntax_error';case'5':if(_0x406720[_0x4566ac(0x183)](_0x4d8b8d[_0x4566ac(0x1b5)]))return'invalid_option_value';continue;case'6':if(_0x406720['includes'](_0x4566ac(0x181)))return _0x4d8b8d[_0x4566ac(0x18b)];continue;case'7':if(_0x406720['includes'](_0x4566ac(0x190)))return'missing_option';continue;}break;}}
|