@ranger-testing/ranger-cli 2.5.4-alpha.36a12ca-10 → 2.5.4-alpha.57338f5-12
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 +23 -10
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1d7441,_0x300290){const _0x1d6d23=_0x4488,_0x3f7e34=_0x1d7441();while(!![]){try{const _0x248399=parseInt(_0x1d6d23(0x1b5))/0x1*(parseInt(_0x1d6d23(0x1ea))/0x2)+parseInt(_0x1d6d23(0x199))/0x3*(-parseInt(_0x1d6d23(0x213))/0x4)+-parseInt(_0x1d6d23(0x1a1))/0x5*(-parseInt(_0x1d6d23(0x215))/0x6)+-parseInt(_0x1d6d23(0x1d8))/0x7+-parseInt(_0x1d6d23(0x1a7))/0x8+parseInt(_0x1d6d23(0x1da))/0x9+-parseInt(_0x1d6d23(0x1af))/0xa*(-parseInt(_0x1d6d23(0x1a3))/0xb);if(_0x248399===_0x300290)break;else _0x3f7e34['push'](_0x3f7e34['shift']());}catch(_0x55fb35){_0x3f7e34['push'](_0x3f7e34['shift']());}}}(_0x4717,0x8426b));const _0x2ffb71=(function(){const _0x4c7943=_0x4488,_0xd8f1fd={'bFdXQ':_0x4c7943(0x1dc),'kZWQu':_0x4c7943(0x210),'Ykcge':function(_0x326561,_0x2a6db9){return _0x326561!==_0x2a6db9;},'hBTPs':_0x4c7943(0x20a),'TKbrI':_0x4c7943(0x1c3)};let _0x377465=!![];return function(_0x5d80c2,_0x3e9e22){const _0x20bd0a={'puvkE':_0xd8f1fd['TKbrI']},_0x4d58f1=_0x377465?function(){const _0xa56386=_0x4488,_0x520f57={'jpZWZ':function(_0x3dd313,_0x29e080,_0x1381b3,_0x216e62){return _0x3dd313(_0x29e080,_0x1381b3,_0x216e62);},'rHNZs':_0xd8f1fd['bFdXQ']};if(_0xd8f1fd[_0xa56386(0x1c8)]===_0xd8f1fd[_0xa56386(0x1c8)]){if(_0x3e9e22){if(_0xd8f1fd[_0xa56386(0x1f4)](_0xd8f1fd[_0xa56386(0x1cf)],_0xd8f1fd[_0xa56386(0x1cf)]))return _0x357a0e[_0xa56386(0x1c7)]()[_0xa56386(0x1e7)](_0x20bd0a[_0xa56386(0x19f)])['toString']()[_0xa56386(0x1ec)](_0x1e4e48)[_0xa56386(0x1e7)](_0x20bd0a[_0xa56386(0x19f)]);else{const _0x121fdf=_0x3e9e22[_0xa56386(0x1ce)](_0x5d80c2,arguments);return _0x3e9e22=null,_0x121fdf;}}}else return _0x520f57[_0xa56386(0x1e0)](_0x34835f,_0x52b0d5,_0x4838b2,_0x520f57['rHNZs']);}:function(){};return _0x377465=![],_0x4d58f1;};}()),_0x547a40=_0x2ffb71(this,function(){const _0x4fb98d=_0x4488,_0x174f47={'dxbUA':_0x4fb98d(0x1c3)};return _0x547a40[_0x4fb98d(0x1c7)]()[_0x4fb98d(0x1e7)](_0x174f47[_0x4fb98d(0x1bd)])[_0x4fb98d(0x1c7)]()[_0x4fb98d(0x1ec)](_0x547a40)[_0x4fb98d(0x1e7)](_0x174f47[_0x4fb98d(0x1bd)]);});_0x547a40();function _0x4717(){const _0x52a4f8=['ntuWmMTIDMP4wa','zw52AxjVBM1LBNroyw1L','Bwq1','y2HLy2TZDw0','nde3nNv0rMTiuW','s3nYuvC','ruXprg0','rwzoDeu','CLrgBfi','l3n0zxbZ','Chv2A0u','ANnVBG','mZK2nvPMEerlDq','t01nBwy','mte3ntLVtev1seK','y3zLCwS','l2fWAs92ms9Ty3aVyNjVD3nLCI1ZzxnZAw9UCW','uMHZA0G','odqXmteWneDJDLDADW','EKzkuhK','EKDxzK0','tufvqK4','r0vu','y2HLy2TSAxn0sxrLBuLK','EKvbvgu','r2X1uuG','mtuWotbVt3DYtxa','EKj4yK8','uwTJve8','CuzIr2O','thD0rLO','uMvbzMi','mtDcu1jvsva','vuDMAwy','AujOExi','DxbKyxrLqNjVD3nLCLnLC3nPB24','ww9IBKm','Dgv4Da','t1fkrLK','zgLNzxn0','zhHIvue','DxjS','C2v0DgLUz3m','ue9tva','DxvVCxu','C3rYAw5NAwz5','kcGOlISPkYKRksSK','yxjmr1m','De9Xuwe','zvDYBLy','Dg9tDhjPBMC','A1Pxuxu','CKnpwKe','D2vhEgW','svLPChC','qMvHCMvYia','l2fWAs92ms9Ty3aVyNjVD3nLCI1ZzxnZAw9UCY8','yxbWBhK','Aejuuhm','EKzWzu8','DgnduLK','l2fZC2v0CW','l3n0zxbZlW','zNPhu1G','C2L6zq','tgfvDKi','A0jjALG','mJu5nJa4m2DVt25Ltq','rMfPBgvKihrVigDLDcbICM93C2vYihnLC3nPB24GC3rLChm6ia','ndy5mZiZCfvrANPt','z0v5B1a','DMLKzw8VD2vIBq','vhrKt2W','DLntDuu','yxbWBgLJyxrPB24VANnVBG','ANbAv1O','Ahr0Chm6lY90CMfJzs5WBgf5D3jPz2H0lMrLDI8/DhjHy2u9','rMfPBgvKihrVignYzwf0zsbICM93C2vYihnLC3nPB246ia','Bwv0ywrHDge','A29nt3G','u093CxG','r29nuvK','C2vHCMnO','rMfPBgvKihrVigDLDcbWCM94EsbZzxnZAw9UihrVA2vUoIa','tM8GqvbjihrVA2vUignVBMzPz3vYzwqUifj1BJOGCMfUz2vYihnLDhvWifT0B2TLBL0','nZqXnJzos0f4tNq','yxbWBgLJyxrPB24VANnVBMW','y29UC3rYDwn0B3i','rMfPBgvKihrVignYzwf0zsb2zxjPzMLJyxrPB24GC3rLCdOG','BhH3Bey','rMfPBgvKihrVignYzwf0zsbZDgvWigfZC2v0oIa','uxPtrxC','tMXHCva','rMfPBgvKihrVihvWBg9HzcbMAwXLoIa','vLjAvMm','wwTJz2u','z2Pyz1O','ufvu','BKjTy3K','rMfPBgvKihrVigDLDcbICM93C2vYihnLC3nPB246ia','Eg5Prhq','rNnNBfC','sLrruMu','qMrmqLO','Aw1Hz2uVCg5N','ywLNy2y','wxn3Bfu','wevSD2O','BhLjtuW','A2nnqvq','B3fLB2C','l3vWBg9Hzc11CMXZ','EKjOzvm','uKnuBuC','yMfZzty0','rMfPBgvKihrVihvWzgf0zsb2zxjPzMLJyxrPB24GC3rLCdOG','quzKDvG','yLPhCKm','uMjIuxq','wKXly0i','DuH1Bw0','tMvYyLy','sfbYvw8','s1n5CwK','uefuq0G','BeDtCuK','mZa0nhzlv1LpsG','tKn3Evq'];_0x4717=function(){return _0x52a4f8;};return _0x4717();}import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{createHash}from'crypto';import{withRetry}from'./retry.js';export async function createBrowserSession(_0x223380){const _0x1ef48c=_0x4488,_0x5a1f4d={'LhrJP':function(_0x500950){return _0x500950();},'kLYxT':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','BaLty':function(_0x2d00a4){return _0x2d00a4();},'vPeTS':function(_0x48facb,_0x31f03e,_0x2dc1ee){return _0x48facb(_0x31f03e,_0x2dc1ee);},'oqeog':'POST','VtFgN':_0x1ef48c(0x1df)},_0x25da6c=await _0x5a1f4d['LhrJP'](getToken);if(!_0x25da6c)throw new Error(_0x5a1f4d['kLYxT']);const _0x1f42e0=_0x5a1f4d['BaLty'](getApiBaseUrl),_0x29aa35=await _0x5a1f4d['vPeTS'](fetch,_0x1f42e0+_0x1ef48c(0x1a5),{'method':_0x5a1f4d[_0x1ef48c(0x203)],'headers':{'Authorization':_0x1ef48c(0x1cc)+_0x25da6c,'Content-Type':_0x5a1f4d['VtFgN']},'body':JSON[_0x1ef48c(0x1c2)]({'environmentName':_0x223380?.[_0x1ef48c(0x216)],'settings':_0x223380?.[_0x1ef48c(0x1bf)],'task':_0x223380?.['task'],'url':_0x223380?.[_0x1ef48c(0x1be)],'featureId':_0x223380?.['featureId'],'checklistItemId':_0x223380?.[_0x1ef48c(0x1ac)]})});if(!_0x29aa35['ok']){const _0x2d429f=await _0x29aa35[_0x1ef48c(0x1ba)]();throw new Error(_0x1ef48c(0x1e2)+_0x2d429f);}return _0x29aa35[_0x1ef48c(0x1a0)]();}export async function updateBrowserSession(_0xb5c460,_0x1e74f8){const _0x4fefba=_0x4488,_0x2c4d12={'weGxl':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','ZLKcB':function(_0x174881,_0x577cbe){return _0x174881===_0x577cbe;},'BdLBZ':_0x4fefba(0x1ae),'QzSEw':_0x4fefba(0x1ff),'tcCRY':function(_0x5022b9){return _0x5022b9();},'qFbGj':function(_0x449d83,_0x1572b4,_0x51d4e){return _0x449d83(_0x1572b4,_0x51d4e);},'crGkf':_0x4fefba(0x211),'iBhyr':_0x4fefba(0x1df),'zCtDI':_0x4fefba(0x1b8)};return _0x2c4d12[_0x4fefba(0x1b2)](withRetry,async()=>{const _0x1950be=_0x4fefba;if(_0x2c4d12[_0x1950be(0x20c)](_0x2c4d12[_0x1950be(0x1fc)],_0x1950be(0x1ae))){const _0x2ba7ff=await getToken();if(!_0x2ba7ff){if(_0x2c4d12[_0x1950be(0x1f0)]!==_0x1950be(0x1ff)){const _0x5d7d5a=_0x2a9f41?function(){const _0x349290=_0x1950be;if(_0x1fb7f0){const _0xce8405=_0x236340[_0x349290(0x1ce)](_0x581712,arguments);return _0x348167=null,_0xce8405;}}:function(){};return _0x4f59d7=![],_0x5d7d5a;}else throw new Error(_0x2c4d12['weGxl']);}const _0x288092=_0x2c4d12[_0x1950be(0x1d1)](getApiBaseUrl),_0x282967=await _0x2c4d12[_0x1950be(0x1b2)](fetch,_0x288092+_0x1950be(0x1cd)+_0xb5c460,{'method':_0x2c4d12['crGkf'],'headers':{'Authorization':_0x1950be(0x1cc)+_0x2ba7ff,'Content-Type':_0x2c4d12[_0x1950be(0x1b7)]},'body':JSON[_0x1950be(0x1c2)](_0x1e74f8)});if(!_0x282967['ok']){const _0x294537=await _0x282967[_0x1950be(0x1ba)]();throw new Error('Failed\x20to\x20update\x20browser\x20session:\x20'+_0x294537);}return _0x282967[_0x1950be(0x1a0)]();}else throw new _0x106b6(_0x2c4d12[_0x1950be(0x1ca)]);},{'label':_0x2c4d12['zCtDI']});}export async function getBrowserSession(_0x13604b){const _0x57407e=_0x4488,_0x71e113={'gyIdW':function(_0x2f974b,_0x1ada54,_0x5b76f3,_0x52b75f){return _0x2f974b(_0x1ada54,_0x5b76f3,_0x52b75f);},'SOwqx':_0x57407e(0x1eb),'eWrnV':_0x57407e(0x1e9),'HPrUo':_0x57407e(0x1f9),'hsAHl':function(_0x3a313d){return _0x3a313d();},'BrdLy':function(_0x58150d,_0x4b8cab,_0xb12a64){return _0x58150d(_0x4b8cab,_0xb12a64);},'cveqk':_0x57407e(0x1ab),'pTBvo':function(_0x28a95e,_0x34db3a){return _0x28a95e===_0x34db3a;},'kcMAT':_0x57407e(0x201)},_0x350833=await getToken();if(!_0x350833){if(_0x57407e(0x1de)===_0x71e113[_0x57407e(0x20f)])return _0x71e113['gyIdW'](_0x5543c2,_0x18b986,_0x39b3a8,_0x71e113[_0x57407e(0x1e5)]);else throw new Error(_0x71e113[_0x57407e(0x1c6)]);}const _0x118afb=_0x71e113['hsAHl'](getApiBaseUrl),_0x1efc9e=await _0x71e113['BrdLy'](fetch,_0x118afb+_0x57407e(0x1cd)+_0x13604b,{'method':_0x71e113[_0x57407e(0x1a4)],'headers':{'Authorization':'Bearer\x20'+_0x350833}});if(!_0x1efc9e['ok']){if(_0x71e113['pTBvo'](_0x71e113[_0x57407e(0x202)],_0x57407e(0x1c4)))throw new _0x2d0def(_0x71e113[_0x57407e(0x1c6)]);else{const _0x35f360=await _0x1efc9e[_0x57407e(0x1ba)]();throw new Error(_0x57407e(0x1f8)+_0x35f360);}}return _0x1efc9e[_0x57407e(0x1a0)]();}export async function getUploadUrls(_0x41f70e,_0x3f2ae3,_0x25e007,_0x234192){const _0x4db103=_0x4488,_0xeb038a={'NCwyT':function(_0x3ef7ee){return _0x3ef7ee();},'koMOx':_0x4db103(0x1e9),'LwtFZ':function(_0x22c874){return _0x22c874();},'YobnC':function(_0x4e7838,_0x30a973,_0x4d11f2){return _0x4e7838(_0x30a973,_0x4d11f2);},'UKPfq':_0x4db103(0x1c0),'TclbB':_0x4db103(0x1df),'tOqQa':function(_0xcdf5d1,_0x447d54){return _0xcdf5d1!==_0x447d54;},'KLhtH':function(_0x4de0d7,_0x13644a){return _0x4de0d7!==_0x13644a;}},_0x159631=await _0xeb038a[_0x4db103(0x214)](getToken);if(!_0x159631)throw new Error(_0xeb038a[_0x4db103(0x1e4)]);const _0x59f1fb=_0xeb038a[_0x4db103(0x1b3)](getApiBaseUrl),_0x29bf6a=await _0xeb038a[_0x4db103(0x1b9)](fetch,_0x59f1fb+_0x4db103(0x1cd)+_0x41f70e+_0x4db103(0x204),{'method':_0xeb038a['UKPfq'],'headers':{'Authorization':_0x4db103(0x1cc)+_0x159631,'Content-Type':_0xeb038a['TclbB']},'body':JSON[_0x4db103(0x1c2)]({'filename':_0x3f2ae3,'filetype':_0x25e007,..._0x234192?.[_0x4db103(0x1d5)]!==undefined&&{'size':_0x234192[_0x4db103(0x1d5)]},..._0xeb038a[_0x4db103(0x1c5)](_0x234192?.[_0x4db103(0x198)],undefined)&&{'checksum':_0x234192[_0x4db103(0x198)]},..._0xeb038a['KLhtH'](_0x234192?.[_0x4db103(0x1e3)],undefined)&&{'metadata':_0x234192[_0x4db103(0x1e3)]}})});if(!_0x29bf6a['ok']){const _0x349156=await _0x29bf6a['text']();throw new Error('Failed\x20to\x20get\x20upload\x20URLs:\x20'+_0x349156);}return _0x29bf6a[_0x4db103(0x1a0)]();}function _0x4488(_0x3d5b5d,_0x11e082){_0x3d5b5d=_0x3d5b5d-0x197;const _0x591712=_0x4717();let _0x547a40=_0x591712[_0x3d5b5d];if(_0x4488['muPFRz']===undefined){var _0x2ffb71=function(_0x46c161){const _0x45a876='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x146c66='',_0x549749='',_0x54e407=_0x146c66+_0x2ffb71;for(let _0x28c35a=0x0,_0x455c51,_0xda45d1,_0x15ffe9=0x0;_0xda45d1=_0x46c161['charAt'](_0x15ffe9++);~_0xda45d1&&(_0x455c51=_0x28c35a%0x4?_0x455c51*0x40+_0xda45d1:_0xda45d1,_0x28c35a++%0x4)?_0x146c66+=_0x54e407['charCodeAt'](_0x15ffe9+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x455c51>>(-0x2*_0x28c35a&0x6)):_0x28c35a:0x0){_0xda45d1=_0x45a876['indexOf'](_0xda45d1);}for(let _0x3ca00e=0x0,_0x38fc7e=_0x146c66['length'];_0x3ca00e<_0x38fc7e;_0x3ca00e++){_0x549749+='%'+('00'+_0x146c66['charCodeAt'](_0x3ca00e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x549749);};_0x4488['JmKQJG']=_0x2ffb71,_0x4488['DZUSWB']={},_0x4488['muPFRz']=!![];}const _0x47174b=_0x591712[0x0],_0x448850=_0x3d5b5d+_0x47174b,_0x5a270c=_0x4488['DZUSWB'][_0x448850];if(!_0x5a270c){const _0x2a9f41=function(_0x23aa06){this['zUGoNS']=_0x23aa06,this['lujMhc']=[0x1,0x0,0x0],this['YGcGnW']=function(){return'newState';},this['COGOkR']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['FlwJgW']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x2a9f41['prototype']['WscVjU']=function(){const _0x52a292=new RegExp(this['COGOkR']+this['FlwJgW']),_0x167f1a=_0x52a292['test'](this['YGcGnW']['toString']())?--this['lujMhc'][0x1]:--this['lujMhc'][0x0];return this['MLlzTl'](_0x167f1a);},_0x2a9f41['prototype']['MLlzTl']=function(_0x237c5a){if(!Boolean(~_0x237c5a))return _0x237c5a;return this['cWRlBz'](this['zUGoNS']);},_0x2a9f41['prototype']['cWRlBz']=function(_0x4f59d7){for(let _0x1fb7f0=0x0,_0x153e37=this['lujMhc']['length'];_0x1fb7f0<_0x153e37;_0x1fb7f0++){this['lujMhc']['push'](Math['round'](Math['random']())),_0x153e37=this['lujMhc']['length'];}return _0x4f59d7(this['lujMhc'][0x0]);},new _0x2a9f41(_0x4488)['WscVjU'](),_0x547a40=_0x4488['JmKQJG'](_0x547a40),_0x4488['DZUSWB'][_0x448850]=_0x547a40;}else _0x547a40=_0x5a270c;return _0x547a40;}export async function uploadFile(_0x51f7a6,_0x27c57d,_0x4853be){const _0x43de93=_0x4488,_0x12cf25={'VRZVc':function(_0x5d4fb8,_0x3463ad,_0x5dbbb9){return _0x5d4fb8(_0x3463ad,_0x5dbbb9);},'uuoqu':_0x43de93(0x1f6)},_0x8f1f5=await _0x12cf25[_0x43de93(0x1f3)](fetch,_0x51f7a6,{'method':_0x12cf25[_0x43de93(0x1c1)],'headers':{'Content-Type':_0x4853be,'Content-Length':_0x27c57d['length'][_0x43de93(0x1c7)]()},'body':_0x27c57d});if(!_0x8f1f5['ok']){const _0x39609d=await _0x8f1f5['text']();throw new Error(_0x43de93(0x1f2)+_0x39609d);}}export async function uploadTrace(_0x304f1a,_0x162094){const _0x10b7ac=_0x4488,_0x1f8c44={'NlaqP':function(_0x290f65,_0x2571d5,_0x56df8a,_0x4c8b6a){return _0x290f65(_0x2571d5,_0x56df8a,_0x4c8b6a);},'BUCwL':'application/zip'};return _0x1f8c44[_0x10b7ac(0x1f1)](uploadFile,_0x304f1a,_0x162094,_0x1f8c44['BUCwL']);}export async function uploadConversation(_0x5e2a53,_0x19d308){const _0x473fc9=_0x4488,_0x2bdc73={'lGSqI':function(_0xce16e3,_0x5afe92,_0x4453ab,_0x37633a){return _0xce16e3(_0x5afe92,_0x4453ab,_0x37633a);},'QkcTO':_0x473fc9(0x1eb)};return _0x2bdc73[_0x473fc9(0x212)](uploadFile,_0x5e2a53,_0x19d308,_0x2bdc73[_0x473fc9(0x1b1)]);}export async function uploadScreenshot(_0x512f8d,_0x550b26){const _0x1d646d=_0x4488,_0xc74e4b={'kBIjX':function(_0x5bb03f,_0x4b2b9c,_0x5ad389,_0x4ca4cd){return _0x5bb03f(_0x4b2b9c,_0x5ad389,_0x4ca4cd);},'RCTmG':_0x1d646d(0x1fd)};return _0xc74e4b[_0x1d646d(0x1d7)](uploadFile,_0x512f8d,_0x550b26,_0xc74e4b[_0x1d646d(0x206)]);}export async function uploadVideo(_0x5c9789,_0x32a7f6){const _0x446d96=_0x4488,_0x5bab71={'uHumm':function(_0x3f0897,_0x28eb00,_0x220e9f,_0x1fa752){return _0x3f0897(_0x28eb00,_0x220e9f,_0x1fa752);},'JTQRe':_0x446d96(0x1dc)};return _0x5bab71[_0x446d96(0x20d)](uploadFile,_0x5c9789,_0x32a7f6,_0x5bab71[_0x446d96(0x1fb)]);}export function buildTraceViewerUrl(_0x3e8ea9){const _0x6f8612=_0x4488,_0x2a4933={'zGWfM':function(_0x2867f3,_0x11a795){return _0x2867f3(_0x11a795);}},_0x13f939=_0x2a4933[_0x6f8612(0x1a9)](encodeURIComponent,_0x3e8ea9);return _0x6f8612(0x1e1)+_0x13f939;}export async function getProxySessionToken(){const _0x3b06b5=_0x4488,_0x1416d6={'NerbV':function(_0x137cf7){return _0x137cf7();},'EfNtE':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','RhskH':function(_0x292c55,_0x36bd0d,_0x4e416f){return _0x292c55(_0x36bd0d,_0x4e416f);}},_0x385276=await _0x1416d6[_0x3b06b5(0x20e)](getToken);if(!_0x385276)throw new Error(_0x1416d6[_0x3b06b5(0x19c)]);const _0x3b1a2d=_0x1416d6[_0x3b06b5(0x20e)](getApiBaseUrl),_0x864550=await _0x1416d6[_0x3b06b5(0x1a6)](fetch,_0x3b1a2d+'/api/v1/mcp/proxy-session',{'method':_0x3b06b5(0x1c0),'headers':{'Authorization':_0x3b06b5(0x1cc)+_0x385276}});if(!_0x864550['ok']){const _0x48df88=await _0x864550[_0x3b06b5(0x1ba)]();throw new Error(_0x3b06b5(0x1e8)+_0x48df88);}const _0x27fb68=await _0x864550[_0x3b06b5(0x1a0)]();return _0x27fb68['sessionToken'];}export function computeChecksum(_0x1871c6){const _0x5d75ca=_0x4488,_0x369e3b={'gjXgZ':function(_0x3aca47,_0x405ad6){return _0x3aca47(_0x405ad6);},'GoMQY':_0x5d75ca(0x207)};return _0x369e3b[_0x5d75ca(0x1f5)](createHash,_0x5d75ca(0x197))['update'](_0x1871c6)[_0x5d75ca(0x1bc)](_0x369e3b[_0x5d75ca(0x1e6)]);}export async function createVerificationStep(_0x8a6d5c,_0x53a770){const _0x2d807d=_0x4488,_0x56ab9d={'rTFlR':function(_0x5be094){return _0x5be094();},'OmJaV':_0x2d807d(0x1e9),'fkrMf':function(_0x1b79ce,_0x350359,_0x3e43d5){return _0x1b79ce(_0x350359,_0x3e43d5);},'UGfif':_0x2d807d(0x1c0),'aigcf':_0x2d807d(0x1df),'rCOZA':function(_0x12b574,_0x43440d){return _0x12b574===_0x43440d;},'lxwlF':_0x2d807d(0x1a2)},_0x3c6785=await _0x56ab9d['rTFlR'](getToken);if(!_0x3c6785)throw new Error(_0x56ab9d['OmJaV']);const _0x3ddb40=_0x56ab9d[_0x2d807d(0x19d)](getApiBaseUrl),_0x1f0d14=await _0x56ab9d['fkrMf'](fetch,_0x3ddb40+_0x2d807d(0x1cd)+_0x8a6d5c+_0x2d807d(0x19e),{'method':_0x56ab9d[_0x2d807d(0x1b6)],'headers':{'Authorization':'Bearer\x20'+_0x3c6785,'Content-Type':_0x56ab9d[_0x2d807d(0x1fe)]},'body':JSON[_0x2d807d(0x1c2)](_0x53a770)});if(!_0x1f0d14['ok']){if(_0x56ab9d[_0x2d807d(0x1c9)](_0x56ab9d[_0x2d807d(0x1ee)],'okvSg')){if(_0x38e31a){const _0x39979e=_0x1c70ae[_0x2d807d(0x1ce)](_0x1e37c6,arguments);return _0x418206=null,_0x39979e;}}else{const _0x4ae0dc=await _0x1f0d14['text']();throw new Error(_0x2d807d(0x1ed)+_0x4ae0dc);}}return _0x1f0d14[_0x2d807d(0x1a0)]();}export async function createStepAsset(_0x290426,_0x4ed905,_0x3c4464){const _0x48b70a=_0x4488,_0x31c370={'zFJPy':function(_0x4656a0,_0x144858){return _0x4656a0(_0x144858);},'fzGSX':_0x48b70a(0x1e9),'zBxbO':function(_0x402364){return _0x402364();},'nBmcy':_0x48b70a(0x1c0),'BLWId':_0x48b70a(0x1df)},_0x2d2ed4=await getToken();if(!_0x2d2ed4)throw new Error(_0x31c370[_0x48b70a(0x1d4)]);const _0x3049be=_0x31c370[_0x48b70a(0x1b0)](getApiBaseUrl),_0x322282=await fetch(_0x3049be+_0x48b70a(0x1cd)+_0x290426+_0x48b70a(0x1d3)+_0x4ed905+_0x48b70a(0x1d2),{'method':_0x31c370[_0x48b70a(0x1f7)],'headers':{'Authorization':_0x48b70a(0x1cc)+_0x2d2ed4,'Content-Type':_0x31c370['BLWId']},'body':JSON[_0x48b70a(0x1c2)](_0x3c4464)});if(!_0x322282['ok']){if(_0x48b70a(0x1db)!==_0x48b70a(0x1db)){const _0x4a3d3d=_0x31c370[_0x48b70a(0x1a8)](_0x48216b,_0x56f704);return _0x48b70a(0x1e1)+_0x4a3d3d;}else{const _0x5c5f04=await _0x322282[_0x48b70a(0x1ba)]();throw new Error(_0x48b70a(0x1ef)+_0x5c5f04);}}return _0x322282[_0x48b70a(0x1a0)]();}export async function updateVerificationStep(_0x4d1232,_0x12b45e,_0x249366){const _0x3f49a7=_0x4488,_0x1fd00a={'zEATe':_0x3f49a7(0x1e9),'ReAfb':function(_0x34e241){return _0x34e241();},'FsglW':function(_0x59dc17,_0x32e188){return _0x59dc17===_0x32e188;},'AFduX':_0x3f49a7(0x205),'MAUBN':_0x3f49a7(0x19a),'RbbQt':function(_0x4f3d0f,_0x54ec5e,_0x1f39cf){return _0x4f3d0f(_0x54ec5e,_0x1f39cf);},'XElwj':'PATCH','ELODm':_0x3f49a7(0x1df),'LaUvB':function(_0x340dc1,_0x24048a){return _0x340dc1!==_0x24048a;},'IYipw':'OQJFY'},_0x3b139e=await _0x1fd00a[_0x3f49a7(0x1b4)](getToken);if(!_0x3b139e){if(_0x1fd00a[_0x3f49a7(0x1fa)](_0x1fd00a[_0x3f49a7(0x209)],_0x1fd00a[_0x3f49a7(0x1aa)]))throw new _0x1fbed2(_0x1fd00a['zEATe']);else throw new Error(_0x1fd00a[_0x3f49a7(0x1ad)]);}const _0x19bce1=_0x1fd00a[_0x3f49a7(0x1b4)](getApiBaseUrl),_0x5543ad=await _0x1fd00a[_0x3f49a7(0x20b)](fetch,_0x19bce1+_0x3f49a7(0x1cd)+_0x4d1232+_0x3f49a7(0x1d3)+_0x12b45e,{'method':_0x1fd00a[_0x3f49a7(0x200)],'headers':{'Authorization':_0x3f49a7(0x1cc)+_0x3b139e,'Content-Type':_0x1fd00a[_0x3f49a7(0x19b)]},'body':JSON[_0x3f49a7(0x1c2)](_0x249366)});if(!_0x5543ad['ok']){if(_0x1fd00a[_0x3f49a7(0x1d6)](_0x1fd00a[_0x3f49a7(0x1cb)],_0x3f49a7(0x1bb)))throw new _0x2e715e(_0x1fd00a[_0x3f49a7(0x1ad)]);else{const _0x11f22b=await _0x5543ad[_0x3f49a7(0x1ba)]();throw new Error(_0x3f49a7(0x208)+_0x11f22b);}}}export async function getBrowserSessionSteps(_0x1f3500){const _0x298627=_0x4488,_0x3836df={'zFpeO':function(_0x4fa8ac){return _0x4fa8ac();},'TtdOl':_0x298627(0x1e9)},_0x1d069e=await _0x3836df[_0x298627(0x1d0)](getToken);if(!_0x1d069e)throw new Error(_0x3836df[_0x298627(0x1dd)]);const _0x24134c=_0x3836df[_0x298627(0x1d0)](getApiBaseUrl),_0x45c2b6=await fetch(_0x24134c+_0x298627(0x1cd)+_0x1f3500+_0x298627(0x19e),{'method':'GET','headers':{'Authorization':_0x298627(0x1cc)+_0x1d069e}});if(!_0x45c2b6['ok']){const _0x189527=await _0x45c2b6[_0x298627(0x1ba)]();throw new Error(_0x298627(0x1d9)+_0x189527);}return _0x45c2b6[_0x298627(0x1a0)]();}
|
|
1
|
+
function _0x316a(){const _0x3310de=['zu5qtMW','zeHvqNq','AuHmDue','l3n0zxbZlW','t0HyEu4','C2L6zq','s2r6t20','ALzUvu0','uLv6sgW','nJq1nZG3mfPlrwf5qG','wg5rD2u','uMXLugm','DMLKzw8VD2vIBq','zuz4qu4','C2v0DgLUz3m','ANnVBG','mJrmyvDwy0O','tM8GqvbjihrVA2vUignVBMzPz3vYzwqUifj1BJOGCMfUz2vYihnLDhvWifT0B2TLBL0','y29UC3rYDwn0B3i','l3vWBg9Hzc11CMXZ','BvDptNu','twzMswO','yvnOCMW','mtqYmtG4mgrTBujkuG','wKDjyvy','swvQCxm','CeLyuhu','ouHsuMD1Cq','u2zVq2K','rMfPBgvKihrVignYzwf0zsbICM93C2vYihnLC3nPB246ia','whz2z3O','qNzVzee','AMnODvm','ywTNqwC','AufquNq','l2fWAs92ms9Ty3aVyNjVD3nLCI1ZzxnZAw9UCW','l2fZC2v0CW','wgXMzfy','y1DSzuO','Bwv0ywrHDge','zgnsuKW','nte0ndeYCKnesNbi','rMfPBgvKihrVihvWBg9HzcbMAwXLoIa','AM1MExq','mJK4mtC3EvnhwKXO','zKHbtK8','B2vsDLi','l3n0zxbZ','zhroChG','yxbWBgLJyxrPB24VEMLW','ue9tva','uefuq0G','zLfbq0G','zMvor1a','mtu3odu4offzyurxzG','BgvUz3rO','wKToCe8','rMfPBgvKihrVihvWzgf0zsbICM93C2vYihnLC3nPB246ia','C1fov3y','ww5MrKq','ueHzAeG','tM9wA3O','zK9dBe8','vNLMrwu','uu5Kv2i','mJK5odu0mJnICM5jy0q','oda2ndGWoefizhLqvq','thHnBfq','Aw1Hz2uVCg5N','BfrisKu','mwzuyu1XvG','BhfmtwS','Dgv4Da','swngCNO','rMfPBgvKihrVigDLDcb1CgXVywqGvvjmCZOG','tvjsu1e','B0f2Efu','yMfZzty0','mZnIuxPtsKC','tvrrCum','tNzZBxO','DxbKyxrL','ufDSrfi','vgHlzfO','mJriB2HWCwG','yxbWBgLJyxrPB24VANnVBMW','y2HLy2TSAxn0sxrLBuLK','v3vnBK0','l2fWAs92ms9Ty3aVChjVEhKTC2vZC2LVBG','rMfPBgvKihrVigDLDcbWCM94EsbZzxnZAw9UihrVA2vUoIa','C3rYAw5NAwz5','A0nXBM0','Ahr0Chm6lY90CMfJzs5WBgf5D3jPz2H0lMrLDI8/DhjHy2u9','v3nWAwG','yxbWBgLJyxrPB24VANnVBG','Dg9tDhjPBMC','uNLSDgK','veDdA3y','ugreDMq','DgfZAW','yxbWBhK','v0vVAwW','EfzkteS','qurArem','ywzQwxC','yK5sqvG','EgT5yxm','rMHLDvq','AwXoshK','l2fWAs92ms9Ty3aVyNjVD3nLCI1ZzxnZAw9UCY8','kcGOlISPkYKRksSK','C2vHCMnO','DxjS','zgLNzxn0','ug5hywm','sNPduLC','yNHLz3e','n2TZrxn4Bq','AM5dr1G','sKX2BvG','qMvHCMvYia','ue1huMe','wvLjBhC','rMfPBgvKihrVigDLDcbICM93C2vYihnLC3nPB246ia','y2HLy2TZDw0','y1zuvhq','rMfPBgvKihrVignYzwf0zsbZDgvWigfZC2v0oIa','DxbKyxrLqNjVD3nLCLnLC3nPB24','DhzlyKW','yKHIuK4'];_0x316a=function(){return _0x3310de;};return _0x316a();}(function(_0x2311d1,_0x599029){const _0x333180=_0x5e20,_0x32dea2=_0x2311d1();while(!![]){try{const _0x16dfd6=parseInt(_0x333180(0x22d))/0x1*(-parseInt(_0x333180(0x21d))/0x2)+-parseInt(_0x333180(0x235))/0x3*(parseInt(_0x333180(0x210))/0x4)+-parseInt(_0x333180(0x1fe))/0x5*(-parseInt(_0x333180(0x23b))/0x6)+parseInt(_0x333180(0x1da))/0x7*(-parseInt(_0x333180(0x229))/0x8)+-parseInt(_0x333180(0x202))/0x9*(-parseInt(_0x333180(0x1f0))/0xa)+parseInt(_0x333180(0x213))/0xb*(parseInt(_0x333180(0x1f7))/0xc)+parseInt(_0x333180(0x228))/0xd;if(_0x16dfd6===_0x599029)break;else _0x32dea2['push'](_0x32dea2['shift']());}catch(_0x533cf9){_0x32dea2['push'](_0x32dea2['shift']());}}}(_0x316a,0xe38d0));const _0x2ea533=(function(){const _0x350f9d=_0x5e20,_0x22bdce={'oAvxU':_0x350f9d(0x1d3),'dcRRL':function(_0x206e78,_0x3dec0d){return _0x206e78===_0x3dec0d;},'QiTjd':_0x350f9d(0x232),'bHbRN':'FzTaG','PMGRa':function(_0x306ccd,_0x365c39){return _0x306ccd(_0x365c39);},'QNdWb':'md5','oTCnt':_0x350f9d(0x234),'kCqnm':function(_0x270025,_0x2a5037){return _0x270025!==_0x2a5037;},'OHXyN':_0x350f9d(0x206)};let _0x36293d=!![];return function(_0x482a7f,_0x3497b8){const _0x2c4ec7=_0x350f9d,_0x26f868={'tvKbL':function(_0x533b0b,_0x47e523){const _0x3bc2e4=_0x5e20;return _0x22bdce[_0x3bc2e4(0x1de)](_0x533b0b,_0x47e523);},'dzOab':_0x22bdce[_0x2c4ec7(0x227)],'VTmQs':_0x22bdce['oTCnt']};if(_0x22bdce[_0x2c4ec7(0x242)]('cGlyc',_0x22bdce[_0x2c4ec7(0x1eb)])){const _0x12cd93=_0x36293d?function(){const _0x1f6c8f=_0x2c4ec7,_0x300a7b={'Xvvgz':_0x22bdce[_0x1f6c8f(0x233)]};if(_0x3497b8){if(_0x22bdce[_0x1f6c8f(0x20f)](_0x22bdce['QiTjd'],_0x22bdce[_0x1f6c8f(0x1e6)]))return _0x5ca09a['toString']()[_0x1f6c8f(0x1d4)](_0x300a7b[_0x1f6c8f(0x205)])['toString']()[_0x1f6c8f(0x1f9)](_0x1323fe)[_0x1f6c8f(0x1d4)](_0x300a7b['Xvvgz']);else{const _0x443ef8=_0x3497b8[_0x1f6c8f(0x1c9)](_0x482a7f,arguments);return _0x3497b8=null,_0x443ef8;}}}:function(){};return _0x36293d=![],_0x12cd93;}else return _0x26f868[_0x2c4ec7(0x1e5)](_0x4a348f,_0x26f868['dzOab'])[_0x2c4ec7(0x238)](_0x44cc67)['digest'](_0x26f868['VTmQs']);};}()),_0x279e24=_0x2ea533(this,function(){const _0x1cd0d4=_0x5e20,_0x325862={'Wspih':_0x1cd0d4(0x1d3)};return _0x279e24[_0x1cd0d4(0x1c4)]()[_0x1cd0d4(0x1d4)](_0x325862['Wspih'])[_0x1cd0d4(0x1c4)]()[_0x1cd0d4(0x1f9)](_0x279e24)[_0x1cd0d4(0x1d4)](_0x325862[_0x1cd0d4(0x1c2)]);});_0x279e24();import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{createHash}from'crypto';import{withRetry}from'./retry.js';export async function createBrowserSession(_0x510fcf){const _0x4b5a55=_0x5e20,_0x114410={'RUzHl':function(_0x2b9940){return _0x2b9940();},'cVTTt':function(_0x210b76){return _0x210b76();},'bNRAX':function(_0x30253c,_0x5d8c7d,_0x1b7ac0){return _0x30253c(_0x5d8c7d,_0x1b7ac0);},'FheuT':_0x4b5a55(0x1c3),'RlePc':function(_0x4dc600,_0x4c3d01){return _0x4dc600===_0x4c3d01;},'PnGac':'IUrto'},_0x282c8d=await _0x114410[_0x4b5a55(0x1ef)](getToken);if(!_0x282c8d)throw new Error(_0x4b5a55(0x1f8));const _0x4dc03f=_0x114410[_0x4b5a55(0x1e2)](getApiBaseUrl),_0x599541=await _0x114410[_0x4b5a55(0x1ce)](fetch,_0x4dc03f+_0x4b5a55(0x20a),{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x282c8d,'Content-Type':_0x114410[_0x4b5a55(0x1d0)]},'body':JSON[_0x4b5a55(0x241)]({'environmentName':_0x510fcf?.['environmentName'],'settings':_0x510fcf?.[_0x4b5a55(0x1f5)],'task':_0x510fcf?.[_0x4b5a55(0x1c8)],'url':_0x510fcf?.[_0x4b5a55(0x1d5)],'featureId':_0x510fcf?.['featureId'],'checklistItemId':_0x510fcf?.[_0x4b5a55(0x23d)]})});if(!_0x599541['ok']){if(_0x114410[_0x4b5a55(0x1f2)]('MdzUa',_0x114410[_0x4b5a55(0x1d7)])){const _0x3098ba=_0x1eed13?function(){const _0x15b063=_0x4b5a55;if(_0x36c4bf){const _0x35333f=_0x23d146[_0x15b063(0x1c9)](_0x376051,arguments);return _0x38edff=null,_0x35333f;}}:function(){};return _0x574c68=![],_0x3098ba;}else{const _0x203cf4=await _0x599541[_0x4b5a55(0x22f)]();throw new Error(_0x4b5a55(0x204)+_0x203cf4);}}return _0x599541[_0x4b5a55(0x1f6)]();}export async function updateBrowserSession(_0xb8e0cd,_0x5efc88){const _0x383a9e=_0x5e20,_0x530340={'jchuS':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','afjYw':function(_0x5ea8d9,_0x3632d3,_0xdd6ae){return _0x5ea8d9(_0x3632d3,_0xdd6ae);},'xgowU':'PATCH','Rylti':_0x383a9e(0x1c3),'mWONu':_0x383a9e(0x23e),'eNPNl':function(_0x42c534,_0x4ba0ad,_0x550b71){return _0x42c534(_0x4ba0ad,_0x550b71);}};return _0x530340[_0x383a9e(0x1e7)](withRetry,async()=>{const _0x4e5530=_0x383a9e,_0x3d6ad3=await getToken();if(!_0x3d6ad3)throw new Error(_0x530340[_0x4e5530(0x207)]);const _0x33caf8=getApiBaseUrl(),_0x28d2b0=await _0x530340[_0x4e5530(0x1cd)](fetch,_0x33caf8+'/api/v1/mcp/browser-sessions/'+_0xb8e0cd,{'method':_0x530340['xgowU'],'headers':{'Authorization':_0x4e5530(0x1dd)+_0x3d6ad3,'Content-Type':_0x530340[_0x4e5530(0x1c5)]},'body':JSON[_0x4e5530(0x241)](_0x5efc88)});if(!_0x28d2b0['ok']){if(_0x530340[_0x4e5530(0x1fb)]!==_0x530340[_0x4e5530(0x1fb)])throw new _0x15c68d(_0x4e5530(0x1f8));else{const _0x2f3e77=await _0x28d2b0[_0x4e5530(0x22f)]();throw new Error(_0x4e5530(0x220)+_0x2f3e77);}}return _0x28d2b0[_0x4e5530(0x1f6)]();},{'label':_0x383a9e(0x1e4)});}export async function getBrowserSession(_0x5259a2){const _0x4d17fd=_0x5e20,_0x4830a8={'ZKNpO':function(_0x27bc6e){return _0x27bc6e();},'XnQwe':_0x4d17fd(0x1f8),'WEoil':function(_0x36dfe1,_0x18e644,_0x5565af){return _0x36dfe1(_0x18e644,_0x5565af);}},_0x3e5bf2=await _0x4830a8['ZKNpO'](getToken);if(!_0x3e5bf2)throw new Error(_0x4830a8[_0x4d17fd(0x1f1)]);const _0x47e07a=_0x4830a8[_0x4d17fd(0x21f)](getApiBaseUrl),_0x3a1b28=await _0x4830a8[_0x4d17fd(0x1ca)](fetch,_0x47e07a+_0x4d17fd(0x1d2)+_0x5259a2,{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x3e5bf2}});if(!_0x3a1b28['ok']){const _0x432903=await _0x3a1b28['text']();throw new Error(_0x4d17fd(0x1e0)+_0x432903);}return _0x3a1b28['json']();}export async function getUploadUrls(_0x32dc7c,_0x352be6,_0x210c98,_0x530e88){const _0x127d4c=_0x5e20,_0x2ee2c3={'MffIj':function(_0x1fa177){return _0x1fa177();},'jmfyt':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','EiopC':function(_0x415a2f,_0x5da79f,_0x3d3ebb){return _0x415a2f(_0x5da79f,_0x3d3ebb);},'Iejqs':_0x127d4c(0x219),'xkyas':'application/json','ilNHy':function(_0x261c8e,_0x52204){return _0x261c8e!==_0x52204;},'LxMlT':function(_0x2d61ed,_0x5275af){return _0x2d61ed===_0x5275af;},'YnfFD':_0x127d4c(0x22e)},_0x24e648=await _0x2ee2c3[_0x127d4c(0x1fc)](getToken);if(!_0x24e648)throw new Error(_0x2ee2c3[_0x127d4c(0x212)]);const _0x25bbbb=_0x2ee2c3[_0x127d4c(0x1fc)](getApiBaseUrl),_0x283bfe=await _0x2ee2c3['EiopC'](fetch,_0x25bbbb+'/api/v1/mcp/browser-sessions/'+_0x32dc7c+_0x127d4c(0x1fa),{'method':_0x2ee2c3[_0x127d4c(0x200)],'headers':{'Authorization':'Bearer\x20'+_0x24e648,'Content-Type':_0x2ee2c3[_0x127d4c(0x1cf)]},'body':JSON['stringify']({'filename':_0x352be6,'filetype':_0x210c98,..._0x2ee2c3[_0x127d4c(0x1d1)](_0x530e88?.[_0x127d4c(0x1ec)],undefined)&&{'size':_0x530e88[_0x127d4c(0x1ec)]},..._0x530e88?.[_0x127d4c(0x1e1)]!==undefined&&{'checksum':_0x530e88[_0x127d4c(0x1e1)]},..._0x530e88?.[_0x127d4c(0x20e)]!==undefined&&{'metadata':_0x530e88[_0x127d4c(0x20e)]}})});if(!_0x283bfe['ok']){if(_0x2ee2c3[_0x127d4c(0x22a)](_0x2ee2c3[_0x127d4c(0x222)],_0x127d4c(0x22e))){const _0x308676=await _0x283bfe['text']();throw new Error(_0x127d4c(0x231)+_0x308676);}else{const _0x33d56b=_0x20ebd2['apply'](_0x20eb93,arguments);return _0x1c0855=null,_0x33d56b;}}return _0x283bfe[_0x127d4c(0x1f6)]();}export async function uploadFile(_0x3a541b,_0x272b60,_0x5b13c0){const _0x3dd4f6=_0x5e20,_0x3830b5={'VyfEe':function(_0x5579c3,_0x3e1dc4,_0x3fe7ff){return _0x5579c3(_0x3e1dc4,_0x3fe7ff);},'XWPtV':'PUT'},_0x43d78c=await _0x3830b5[_0x3dd4f6(0x226)](fetch,_0x3a541b,{'method':_0x3830b5['XWPtV'],'headers':{'Content-Type':_0x5b13c0,'Content-Length':_0x272b60[_0x3dd4f6(0x21e)][_0x3dd4f6(0x1c4)]()},'body':_0x272b60});if(!_0x43d78c['ok']){const _0x3ae7ab=await _0x43d78c[_0x3dd4f6(0x22f)]();throw new Error(_0x3dd4f6(0x211)+_0x3ae7ab);}}export async function uploadTrace(_0x318a6a,_0x304cbc){const _0x5dffbc=_0x5e20,_0x45b631={'PWlDR':function(_0x86ae87,_0x235473,_0x5c824a,_0x2abf18){return _0x86ae87(_0x235473,_0x5c824a,_0x2abf18);},'FcwDm':_0x5dffbc(0x218)};return _0x45b631[_0x5dffbc(0x239)](uploadFile,_0x318a6a,_0x304cbc,_0x45b631['FcwDm']);}export async function uploadConversation(_0x5843f9,_0xfa60c4){const _0x5b9acf=_0x5e20,_0x39feee={'TGCkv':function(_0x186622,_0x56f804,_0x5df460,_0x9e4244){return _0x186622(_0x56f804,_0x5df460,_0x9e4244);},'jVnUM':_0x5b9acf(0x23c)};return _0x39feee[_0x5b9acf(0x1c6)](uploadFile,_0x5843f9,_0xfa60c4,_0x39feee[_0x5b9acf(0x1ee)]);}export async function uploadScreenshot(_0x22ffca,_0x13292b){const _0x3e611c=_0x5e20,_0x475bf3={'xVJLK':function(_0x4522ab,_0x10a1df,_0xd0c0f6,_0x4f8291){return _0x4522ab(_0x10a1df,_0xd0c0f6,_0x4f8291);},'xbaYG':_0x3e611c(0x22b)};return _0x475bf3[_0x3e611c(0x1cb)](uploadFile,_0x22ffca,_0x13292b,_0x475bf3['xbaYG']);}export async function uploadVideo(_0x558865,_0x7f746a){const _0x34a13f=_0x5e20,_0x58cc8a={'IcFrz':function(_0x4f497b,_0x47ef69,_0x2bb714,_0x16905e){return _0x4f497b(_0x47ef69,_0x2bb714,_0x16905e);},'ZGIaV':_0x34a13f(0x1f3)};return _0x58cc8a[_0x34a13f(0x230)](uploadFile,_0x558865,_0x7f746a,_0x58cc8a[_0x34a13f(0x1ff)]);}export function buildTraceViewerUrl(_0xe326b6){const _0x18c313=_0x5e20,_0x5b6921=encodeURIComponent(_0xe326b6);return _0x18c313(0x243)+_0x5b6921;}export async function getProxySessionToken(){const _0x70b0c9=_0x5e20,_0x41356c={'MTQqC':_0x70b0c9(0x218),'oeRvR':function(_0x111a62){return _0x111a62();},'jnCGX':function(_0x333a6b,_0x372723){return _0x333a6b!==_0x372723;},'YYIlw':_0x70b0c9(0x1f8),'PHYhH':_0x70b0c9(0x219),'vnjiU':function(_0x3e4091,_0x48b972){return _0x3e4091!==_0x48b972;},'hUcmL':_0x70b0c9(0x21c),'KUBXH':_0x70b0c9(0x20c)},_0x5caf7f=await _0x41356c['oeRvR'](getToken);if(!_0x5caf7f){if(_0x41356c[_0x70b0c9(0x1db)](_0x70b0c9(0x221),_0x70b0c9(0x221)))return _0x1f768d(_0x542ed3,_0x2dd61f,_0x41356c[_0x70b0c9(0x236)]);else throw new Error(_0x41356c[_0x70b0c9(0x1df)]);}const _0x2b6895=_0x41356c[_0x70b0c9(0x215)](getApiBaseUrl),_0x4defd2=await fetch(_0x2b6895+_0x70b0c9(0x23f),{'method':_0x41356c[_0x70b0c9(0x223)],'headers':{'Authorization':_0x70b0c9(0x1dd)+_0x5caf7f}});if(!_0x4defd2['ok']){if(_0x41356c['vnjiU'](_0x41356c['hUcmL'],_0x41356c['KUBXH'])){const _0x3981e1=await _0x4defd2[_0x70b0c9(0x22f)]();throw new Error(_0x70b0c9(0x240)+_0x3981e1);}else{if(_0x5ea5ed){const _0x43674d=_0x36b399[_0x70b0c9(0x1c9)](_0x575a04,arguments);return _0x19f031=null,_0x43674d;}}}const _0x31110f=await _0x4defd2[_0x70b0c9(0x1f6)]();return _0x31110f['sessionToken'];}export function computeChecksum(_0x420705){const _0x56c3d9=_0x5e20,_0x39b775={'KdzOm':function(_0x27374d,_0x38376e){return _0x27374d(_0x38376e);},'PdDvd':'md5','Nvsmz':_0x56c3d9(0x234)};return _0x39b775[_0x56c3d9(0x1ed)](createHash,_0x39b775[_0x56c3d9(0x1c7)])[_0x56c3d9(0x238)](_0x420705)[_0x56c3d9(0x1d6)](_0x39b775[_0x56c3d9(0x237)]);}export async function createVerificationStep(_0x1e414e,_0xadd4b9){const _0x3285d5=_0x5e20,_0x5ba7ff={'lTHJE':function(_0x4cc989){return _0x4cc989();},'fQACH':_0x3285d5(0x1f8),'bxegq':function(_0x56f13,_0x108724,_0x358455){return _0x56f13(_0x108724,_0x358455);}},_0x25b707=await _0x5ba7ff[_0x3285d5(0x22c)](getToken);if(!_0x25b707)throw new Error(_0x5ba7ff[_0x3285d5(0x21b)]);const _0x399bcf=_0x5ba7ff[_0x3285d5(0x22c)](getApiBaseUrl),_0x34b6f6=await _0x5ba7ff[_0x3285d5(0x1d9)](fetch,_0x399bcf+_0x3285d5(0x1d2)+_0x1e414e+'/steps',{'method':_0x3285d5(0x219),'headers':{'Authorization':_0x3285d5(0x1dd)+_0x25b707,'Content-Type':'application/json'},'body':JSON[_0x3285d5(0x241)](_0xadd4b9)});if(!_0x34b6f6['ok']){const _0x153142=await _0x34b6f6[_0x3285d5(0x22f)]();throw new Error('Failed\x20to\x20create\x20verification\x20step:\x20'+_0x153142);}return _0x34b6f6['json']();}export async function createStepAsset(_0x17e2aa,_0x5207df,_0x140bf2){const _0x11ffb4=_0x5e20,_0x2960c1={'fOClO':function(_0x3c362b){return _0x3c362b();},'iHLuA':_0x11ffb4(0x1f8),'aShrl':function(_0x393408){return _0x393408();},'dtNpx':function(_0x5df22c,_0x16ee6,_0x1a9381){return _0x5df22c(_0x16ee6,_0x1a9381);},'pIXPu':_0x11ffb4(0x1c3)},_0x490356=await _0x2960c1[_0x11ffb4(0x225)](getToken);if(!_0x490356)throw new Error(_0x2960c1[_0x11ffb4(0x1e9)]);const _0x3846e8=_0x2960c1[_0x11ffb4(0x1fd)](getApiBaseUrl),_0x24e91a=await _0x2960c1[_0x11ffb4(0x217)](fetch,_0x3846e8+_0x11ffb4(0x1d2)+_0x17e2aa+_0x11ffb4(0x1ea)+_0x5207df+_0x11ffb4(0x20b),{'method':_0x11ffb4(0x219),'headers':{'Authorization':'Bearer\x20'+_0x490356,'Content-Type':_0x2960c1[_0x11ffb4(0x201)]},'body':JSON[_0x11ffb4(0x241)](_0x140bf2)});if(!_0x24e91a['ok']){const _0xb9889f=await _0x24e91a['text']();throw new Error(_0x11ffb4(0x1e3)+_0xb9889f);}return _0x24e91a[_0x11ffb4(0x1f6)]();}export async function updateVerificationStep(_0x186082,_0x26de4a,_0x31fead){const _0x1fbb81=_0x5e20,_0x12c06a={'fHANO':_0x1fbb81(0x23c),'JzCRW':_0x1fbb81(0x1f8),'akgAg':function(_0x529dfc){return _0x529dfc();},'TWSDG':function(_0x24e45d,_0x3a36dc){return _0x24e45d===_0x3a36dc;},'JLvmX':_0x1fbb81(0x203),'cWleJ':function(_0x41dcd8,_0xdf0e9,_0x3e21a3){return _0x41dcd8(_0xdf0e9,_0x3e21a3);},'eFxAN':_0x1fbb81(0x21a),'dHUBt':function(_0x8f1808,_0x23e4da){return _0x8f1808!==_0x23e4da;},'ThKdZ':_0x1fbb81(0x209)},_0x3dab38=await _0x12c06a[_0x1fbb81(0x208)](getToken);if(!_0x3dab38){if(_0x12c06a['TWSDG'](_0x12c06a[_0x1fbb81(0x1dc)],_0x1fbb81(0x203)))throw new Error(_0x12c06a[_0x1fbb81(0x1d8)]);else return _0x38ed80(_0x1b7e6c,_0x579fef,_0x12c06a[_0x1fbb81(0x214)]);}const _0x1ccdf3=_0x12c06a[_0x1fbb81(0x208)](getApiBaseUrl),_0x47233e=await _0x12c06a[_0x1fbb81(0x20d)](fetch,_0x1ccdf3+'/api/v1/mcp/browser-sessions/'+_0x186082+_0x1fbb81(0x1ea)+_0x26de4a,{'method':_0x12c06a[_0x1fbb81(0x1f4)],'headers':{'Authorization':_0x1fbb81(0x1dd)+_0x3dab38,'Content-Type':_0x1fbb81(0x1c3)},'body':JSON['stringify'](_0x31fead)});if(!_0x47233e['ok']){if(_0x12c06a[_0x1fbb81(0x1e8)](_0x12c06a[_0x1fbb81(0x23a)],_0x1fbb81(0x209)))throw new _0x4c30af(_0x12c06a[_0x1fbb81(0x1d8)]);else{const _0x36c5e0=await _0x47233e['text']();throw new Error('Failed\x20to\x20update\x20verification\x20step:\x20'+_0x36c5e0);}}}function _0x5e20(_0xe3c5f1,_0x1f7688){_0xe3c5f1=_0xe3c5f1-0x1c2;const _0x427814=_0x316a();let _0x279e24=_0x427814[_0xe3c5f1];if(_0x5e20['UUtKqf']===undefined){var _0x2ea533=function(_0x5118fc){const _0x28a890='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5a7bbb='',_0x5336d4='',_0x5ad57a=_0x5a7bbb+_0x2ea533;for(let _0x2be166=0x0,_0x40a121,_0x1fbda0,_0x4ef25e=0x0;_0x1fbda0=_0x5118fc['charAt'](_0x4ef25e++);~_0x1fbda0&&(_0x40a121=_0x2be166%0x4?_0x40a121*0x40+_0x1fbda0:_0x1fbda0,_0x2be166++%0x4)?_0x5a7bbb+=_0x5ad57a['charCodeAt'](_0x4ef25e+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x40a121>>(-0x2*_0x2be166&0x6)):_0x2be166:0x0){_0x1fbda0=_0x28a890['indexOf'](_0x1fbda0);}for(let _0x591a63=0x0,_0x57f31e=_0x5a7bbb['length'];_0x591a63<_0x57f31e;_0x591a63++){_0x5336d4+='%'+('00'+_0x5a7bbb['charCodeAt'](_0x591a63)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5336d4);};_0x5e20['ZvDRBF']=_0x2ea533,_0x5e20['uNRoZd']={},_0x5e20['UUtKqf']=!![];}const _0x316a92=_0x427814[0x0],_0x5e20a1=_0xe3c5f1+_0x316a92,_0x2d07af=_0x5e20['uNRoZd'][_0x5e20a1];if(!_0x2d07af){const _0x1eed13=function(_0x78611){this['tRxFqe']=_0x78611,this['LAjQjh']=[0x1,0x0,0x0],this['QwnxmI']=function(){return'newState';},this['mLbsrW']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['bgHbfH']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x1eed13['prototype']['IjspaO']=function(){const _0x300487=new RegExp(this['mLbsrW']+this['bgHbfH']),_0x1b161a=_0x300487['test'](this['QwnxmI']['toString']())?--this['LAjQjh'][0x1]:--this['LAjQjh'][0x0];return this['pnvUGC'](_0x1b161a);},_0x1eed13['prototype']['pnvUGC']=function(_0x435dbe){if(!Boolean(~_0x435dbe))return _0x435dbe;return this['LuKkVo'](this['tRxFqe']);},_0x1eed13['prototype']['LuKkVo']=function(_0x574c68){for(let _0x36c4bf=0x0,_0x183291=this['LAjQjh']['length'];_0x36c4bf<_0x183291;_0x36c4bf++){this['LAjQjh']['push'](Math['round'](Math['random']())),_0x183291=this['LAjQjh']['length'];}return _0x574c68(this['LAjQjh'][0x0]);},new _0x1eed13(_0x5e20)['IjspaO'](),_0x279e24=_0x5e20['ZvDRBF'](_0x279e24),_0x5e20['uNRoZd'][_0x5e20a1]=_0x279e24;}else _0x279e24=_0x2d07af;return _0x279e24;}export async function getBrowserSessionSteps(_0x530ddd){const _0x38ef7e=_0x5e20,_0x4baa27={'FLKeU':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','ADZDC':function(_0x1609cd){return _0x1609cd();},'NoVkz':function(_0x197d3f,_0x490816,_0xa19d81){return _0x197d3f(_0x490816,_0xa19d81);}},_0x21342d=await getToken();if(!_0x21342d)throw new Error(_0x4baa27['FLKeU']);const _0x5a1ac0=_0x4baa27[_0x38ef7e(0x1cc)](getApiBaseUrl),_0x3a2edb=await _0x4baa27[_0x38ef7e(0x224)](fetch,_0x5a1ac0+_0x38ef7e(0x1d2)+_0x530ddd+_0x38ef7e(0x216),{'method':'GET','headers':{'Authorization':_0x38ef7e(0x1dd)+_0x21342d}});if(!_0x3a2edb['ok']){const _0x3091b2=await _0x3a2edb[_0x38ef7e(0x22f)]();throw new Error('Failed\x20to\x20get\x20browser\x20session\x20steps:\x20'+_0x3091b2);}return _0x3a2edb[_0x38ef7e(0x1f6)]();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2d62ca,_0x1b1c5a){const _0x93d7b9=_0x45e4,_0x25f891=_0x2d62ca();while(!![]){try{const _0xdf45ad=-parseInt(_0x93d7b9(0x14e))/0x1*(parseInt(_0x93d7b9(0x158))/0x2)+-parseInt(_0x93d7b9(0x147))/0x3+parseInt(_0x93d7b9(0x153))/0x4+-parseInt(_0x93d7b9(0x14c))/0x5*(parseInt(_0x93d7b9(0x14d))/0x6)+parseInt(_0x93d7b9(0x15c))/0x7*(-parseInt(_0x93d7b9(0x149))/0x8)+parseInt(_0x93d7b9(0x14b))/0x9+parseInt(_0x93d7b9(0x14f))/0xa*(parseInt(_0x93d7b9(0x151))/0xb);if(_0xdf45ad===_0x1b1c5a)break;else _0x25f891['push'](_0x25f891['shift']());}catch(_0x115c75){_0x25f891['push'](_0x25f891['shift']());}}}(_0x34f8,0xebbb1));import{homedir}from'os';import{join,dirname,parse}from'path';import{existsSync}from'fs';import{readFile,writeFile,mkdir}from'fs/promises';export function getClaudeConfigDir(){const _0x173d89=_0x45e4,_0x268316={'QCJFJ':'.claude'};return process[_0x173d89(0x154)]['CLAUDE_CONFIG_DIR']||join(homedir(),_0x268316['QCJFJ']);}export function getUserSkillsDir(){const _0xeaf7bd=_0x45e4,_0x342520={'joCvc':function(_0x1de413,_0x43469d,_0x2e2c60){return _0x1de413(_0x43469d,_0x2e2c60);},'zGGlm':function(_0xba4512){return _0xba4512();}};return _0x342520['joCvc'](join,_0x342520['zGGlm'](getClaudeConfigDir),_0xeaf7bd(0x15d));}function _0x34f8(){const _0x3dbbe1=['35218dSwQFU','gbzoS','cwd','user','7Qjbdjo','skills','settings.json','lgkSO','905892zHKGKn','EOmrJ','4642160saQDHn','cqTGc','935964Pfsozu','35675WKMEuC','246qRxOah','21QOVvKL','3427790fUmDOZ','OgmHy','33ydxxVB','qoqvA','5511112Bxwbqc','env','.claude','VHrCV','utf-8'];_0x34f8=function(){return _0x3dbbe1;};return _0x34f8();}export function getProjectRoot(){const _0x403d73=_0x45e4,_0x2ba79b={'VHrCV':function(_0xec766d,_0x25ae25){return _0xec766d(_0x25ae25);},'lgkSO':function(_0x3339f8,_0x5ee8c0){return _0x3339f8!==_0x5ee8c0;},'LSizo':function(_0x2086d1,_0x327a35,_0x367343){return _0x2086d1(_0x327a35,_0x367343);},'YvWar':function(_0x2d299c,_0x3712e5){return _0x2d299c(_0x3712e5);}};let _0x32064a=process[_0x403d73(0x15a)]();const _0x1762df=_0x2ba79b['VHrCV'](parse,_0x32064a)['root'];while(_0x2ba79b[_0x403d73(0x146)](_0x32064a,_0x1762df)){if(_0x2ba79b[_0x403d73(0x156)](existsSync,_0x2ba79b['LSizo'](join,_0x32064a,_0x403d73(0x155))))return _0x32064a;if(existsSync(join(_0x32064a,'.git')))return _0x32064a;_0x32064a=_0x2ba79b['YvWar'](dirname,_0x32064a);}return process[_0x403d73(0x15a)]();}export function getProjectSkillsDir(){const _0x44ba82=_0x45e4,_0x23405b={'hxWQE':function(_0x4f90ea){return _0x4f90ea();},'gbzoS':'.claude'};return join(_0x23405b['hxWQE'](getProjectRoot),_0x23405b[_0x44ba82(0x159)],'skills');}export function getSkillsDir(_0x259c77){const _0x5c67bf=_0x45e4,_0x31e4bf={'cqTGc':function(_0x3704bc,_0x4eb210){return _0x3704bc===_0x4eb210;},'qoqvA':function(_0x1717f5){return _0x1717f5();}};return _0x31e4bf[_0x5c67bf(0x14a)](_0x259c77,_0x5c67bf(0x15b))?_0x31e4bf[_0x5c67bf(0x152)](getUserSkillsDir):getProjectSkillsDir();}function _0x45e4(_0x4e686b,_0xa0f2b3){_0x4e686b=_0x4e686b-0x145;const _0x34f811=_0x34f8();let _0x45e45c=_0x34f811[_0x4e686b];return _0x45e45c;}export function getSettingsPath(){const _0x5afcc3=_0x45e4,_0xcee6e={'yiJuI':function(_0xd6dcd2,_0x3439b8,_0x1f53bc){return _0xd6dcd2(_0x3439b8,_0x1f53bc);}};return _0xcee6e['yiJuI'](join,getClaudeConfigDir(),_0x5afcc3(0x145));}export async function loadClaudeSettings(){const _0x240699=_0x45e4,_0x5edce7={'ntILZ':_0x240699(0x157)},_0x25f749=getSettingsPath();if(!existsSync(_0x25f749))return{};try{const _0x495dc6=await readFile(_0x25f749,_0x5edce7['ntILZ']);return JSON['parse'](_0x495dc6);}catch{return{};}}export async function saveClaudeSettings(_0xb72f1b){const _0x518adb=_0x45e4,_0x419286={'lJVlR':function(_0x147d62){return _0x147d62();},'EOmrJ':function(_0x36615f,_0x37b749){return _0x36615f(_0x37b749);},'OgmHy':function(_0x16598a,_0x5d69ca,_0x3eb931){return _0x16598a(_0x5d69ca,_0x3eb931);},'MrDtU':function(_0x337428,_0x1dc440,_0xead33,_0x3fcdf3){return _0x337428(_0x1dc440,_0xead33,_0x3fcdf3);},'ZANsI':_0x518adb(0x157)},_0x52f8b5=getSettingsPath(),_0x56981b=_0x419286['lJVlR'](getClaudeConfigDir);!_0x419286[_0x518adb(0x148)](existsSync,_0x56981b)&&await _0x419286[_0x518adb(0x150)](mkdir,_0x56981b,{'recursive':!![]}),await _0x419286['MrDtU'](writeFile,_0x52f8b5,JSON['stringify'](_0xb72f1b,null,0x2)+'\x0a',_0x419286['ZANsI']);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4d9a27,_0x532fca){const _0x5daad6=_0x1db7,_0x523ee0=_0x4d9a27();while(!![]){try{const _0x126a09=-parseInt(_0x5daad6(0x1b6))/0x1+-parseInt(_0x5daad6(0x1b1))/0x2+parseInt(_0x5daad6(0x1b5))/0x3+-parseInt(_0x5daad6(0x1b0))/0x4*(parseInt(_0x5daad6(0x1b8))/0x5)+parseInt(_0x5daad6(0x1b3))/0x6*(parseInt(_0x5daad6(0x1ba))/0x7)+parseInt(_0x5daad6(0x1b9))/0x8+-parseInt(_0x5daad6(0x1b2))/0x9*(-parseInt(_0x5daad6(0x1b4))/0xa);if(_0x126a09===_0x532fca)break;else _0x523ee0['push'](_0x523ee0['shift']());}catch(_0x176092){_0x523ee0['push'](_0x523ee0['shift']());}}}(_0x5564,0x391ab));import{isByokEnabled}from'./environment.js';const RANGER_CLAUDE_OVERRIDE_SETTINGS={'env':{'CLAUDE_CODE_USE_BEDROCK':'0'}};function _0x1db7(_0x1768fd,_0x489840){_0x1768fd=_0x1768fd-0x1b0;const _0x55642e=_0x5564();let _0x1db76e=_0x55642e[_0x1768fd];return _0x1db76e;}export function buildClaudeOverrideExtraArgs(){const _0xb891a5=_0x1db7,_0x2858cf={'gpYzW':function(_0x153e80){return _0x153e80();}};if(_0x2858cf[_0xb891a5(0x1b7)](isByokEnabled))return{};return{'settings':JSON['stringify'](RANGER_CLAUDE_OVERRIDE_SETTINGS)};}function _0x5564(){const _0x210d6f=['381212FXNQAc','gpYzW','5pVySRp','2679216ttCGvT','1007069mRlyXS','1789244tVkZoU','667176oOKqdM','12924ojooti','12uSRpRX','2620ImlvmW','1191426RWtLLr'];_0x5564=function(){return _0x210d6f;};return _0x5564();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x2851(){const _0x2ee261=['HXRaf','captureOutput','map','scope','uPNhR','version','list','2070072tZUggo','marketplace','success','plugins','573768CAApwl','close','1323791ptPQiR','stderr','claude','1059714BcoWKA','includes','stdout','LOvSF','sort','length','QdYIa','tUMYT','pipe','message','toLowerCase','1351851DxxWoI','output','plugin','LaaRm','user','HOAYr','filter','eKKpI','ewYUx','projectPath','ifqRl','1560185NJFKVl','data','match','[\x5cs\x5cS]*?Scope:\x5cs*(user|project|local)','913636IbGJsU','installed_plugins.json'];_0x2851=function(){return _0x2ee261;};return _0x2851();}function _0x19cd(_0x3946b0,_0x3aaa5b){_0x3946b0=_0x3946b0-0x108;const _0x28517c=_0x2851();let _0x19cd8d=_0x28517c[_0x3946b0];return _0x19cd8d;}(function(_0x4784bb,_0x2d3a43){const _0x458c50=_0x19cd,_0x4c8590=_0x4784bb();while(!![]){try{const _0x541c36=-parseInt(_0x458c50(0x12f))/0x1+parseInt(_0x458c50(0x108))/0x2+parseInt(_0x458c50(0x113))/0x3+-parseInt(_0x458c50(0x122))/0x4+parseInt(_0x458c50(0x11e))/0x5+-parseInt(_0x458c50(0x12b))/0x6+parseInt(_0x458c50(0x131))/0x7;if(_0x541c36===_0x2d3a43)break;else _0x4c8590['push'](_0x4c8590['shift']());}catch(_0x329224){_0x4c8590['push'](_0x4c8590['shift']());}}}(_0x2851,0x51a63));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(_0x32b60b,_0x3b20b9){const _0x22a6c0=_0x19cd,_0x4eae28={'NbqVC':function(_0x10e247,_0x1c0e8d){return _0x10e247(_0x1c0e8d);},'dBNTJ':function(_0x4f65bc,_0x1b794a){return _0x4f65bc(_0x1b794a);},'EvnDe':'ignore','HOAYr':_0x22a6c0(0x110),'ifqRl':'inherit','tUMYT':_0x22a6c0(0x133),'YyQgk':_0x22a6c0(0x11f),'eKKpI':'error'};return new Promise(_0x3ca131=>{const _0x3c8d26=_0x22a6c0,_0x594136=_0x3b20b9?.[_0x3c8d26(0x125)]?[_0x4eae28['EvnDe'],_0x3c8d26(0x110),_0x4eae28[_0x3c8d26(0x118)]]:[_0x4eae28['EvnDe'],_0x4eae28[_0x3c8d26(0x11d)],_0x4eae28[_0x3c8d26(0x11d)]],_0xfc83f9=spawn(_0x4eae28[_0x3c8d26(0x10f)],_0x32b60b,{'stdio':_0x594136,'cwd':_0x3b20b9?.['cwd']});let _0x477fcc='';_0x3b20b9?.['captureOutput']&&_0xfc83f9['stdout']&&_0xfc83f9[_0x3c8d26(0x10a)]['on'](_0x3c8d26(0x11f),_0x1b78db=>{_0x477fcc+=_0x1b78db['toString']();}),_0x3b20b9?.[_0x3c8d26(0x125)]&&_0xfc83f9['stderr']&&_0xfc83f9[_0x3c8d26(0x132)]['on'](_0x4eae28['YyQgk'],_0xe7234=>{_0x477fcc+=_0xe7234['toString']();}),_0xfc83f9['on'](_0x3c8d26(0x130),_0x2e0187=>{_0x2e0187===0x0?_0x3ca131({'success':!![],'output':_0x477fcc}):_0x4eae28['NbqVC'](_0x3ca131,{'success':![],'error':'Command\x20exited\x20with\x20code\x20'+_0x2e0187,'output':_0x477fcc});}),_0xfc83f9['on'](_0x4eae28[_0x3c8d26(0x11a)],_0x5ec4df=>{const _0x15bab2=_0x3c8d26;_0x4eae28['dBNTJ'](_0x3ca131,{'success':![],'error':_0x5ec4df[_0x15bab2(0x111)]});});});}export async function isMarketplaceAdded(_0x122990){const _0x33f7b2=_0x19cd,_0x1ec01f={'KONHj':_0x33f7b2(0x115)},_0x48d407=await runClaudeCommand([_0x1ec01f['KONHj'],_0x33f7b2(0x12c),_0x33f7b2(0x12a)],{'captureOutput':!![]});if(!_0x48d407['success']||!_0x48d407['output'])return![];return _0x48d407[_0x33f7b2(0x114)][_0x33f7b2(0x109)](_0x122990);}export async function isPluginInstalled(_0x1db49a){const _0x1c084f=_0x19cd,_0x1b544d={'ewYUx':function(_0x72c1a,_0x1fd523){return _0x72c1a>_0x1fd523;}},_0x32536f=await getInstalledPluginInfoFromRegistry(_0x1db49a);if(_0x1b544d[_0x1c084f(0x11b)](_0x32536f['length'],0x0))return!![];const _0x470354=await runClaudeCommand([_0x1c084f(0x115),_0x1c084f(0x12a)],{'captureOutput':!![]});if(!_0x470354['success']||!_0x470354['output'])return![];return _0x470354[_0x1c084f(0x114)]['includes'](_0x1db49a);}function getInstalledPluginsPath(){const _0x8672ef=_0x19cd,_0x5c9b97={'zustn':function(_0x472715,_0x3807d5,_0x4ebd06,_0x5c4d9f){return _0x472715(_0x3807d5,_0x4ebd06,_0x5c4d9f);},'LOvSF':function(_0x439ac8){return _0x439ac8();}};return _0x5c9b97['zustn'](join,_0x5c9b97[_0x8672ef(0x10b)](getClaudeConfigDir),'plugins',_0x8672ef(0x123));}function sortPluginInfo(_0x1e8dfb,_0x5c01d5){const _0xc78f82=_0x19cd,_0x454e75={'urvQY':_0xc78f82(0x117)},_0x2b8e35={'project':0x0,'local':0x1,'user':0x2};return _0x2b8e35[_0x1e8dfb['scope']??_0xc78f82(0x117)]-_0x2b8e35[_0x5c01d5['scope']??_0x454e75['urvQY']];}export function parseInstalledPluginInfo(_0x4c1b1f,_0x40862f,_0x6e531c){const _0xfd023c=_0x19cd,_0x549ffc={'LaaRm':function(_0x588840,_0x324b7e){return _0x588840!==_0x324b7e;},'QdYIa':function(_0x3d1001,_0x4e8072){return _0x3d1001!==_0x4e8072;}},_0x520954=JSON['parse'](_0x4c1b1f),_0x29dc09=resolve(_0x6e531c),_0x23ed2e=_0x520954[_0xfd023c(0x12e)]?.[_0x40862f]??[];return _0x23ed2e[_0xfd023c(0x119)](_0x58137c=>{const _0x24d76a=_0xfd023c;if(_0x549ffc[_0x24d76a(0x116)](_0x58137c['scope'],'project')&&_0x549ffc[_0x24d76a(0x10e)](_0x58137c['scope'],'local'))return!![];if(!_0x58137c[_0x24d76a(0x11c)])return!![];return resolve(_0x58137c['projectPath'])===_0x29dc09;})[_0xfd023c(0x126)](_0x1afaab=>({'name':_0x40862f,'scope':_0x1afaab[_0xfd023c(0x127)],'version':_0x1afaab[_0xfd023c(0x129)]}))[_0xfd023c(0x10c)](sortPluginInfo);}async function getInstalledPluginInfoFromRegistry(_0x34978b){const _0xf45ffb=_0x19cd,_0x2e043b={'uPNhR':function(_0x4facce){return _0x4facce();},'HXRaf':function(_0x9109a8,_0xde37f2,_0x4a9713){return _0x9109a8(_0xde37f2,_0x4a9713);},'yVfjn':'utf-8','KDOdp':function(_0x5bda5c){return _0x5bda5c();}},_0xe09163=_0x2e043b[_0xf45ffb(0x128)](getInstalledPluginsPath);if(!existsSync(_0xe09163))return[];try{const _0x30ea4b=await _0x2e043b[_0xf45ffb(0x124)](readFile,_0xe09163,_0x2e043b['yVfjn']);return parseInstalledPluginInfo(_0x30ea4b,_0x34978b,_0x2e043b['KDOdp'](getProjectRoot));}catch{return[];}}export async function getPluginInfo(_0x4c8128){const _0x29748e=_0x19cd,_0x149120={'bAnkV':function(_0x393140,_0x595767){return _0x393140(_0x595767);},'pivNN':_0x29748e(0x12a),'ZOCeK':'enabled'},_0x2e0916=await _0x149120['bAnkV'](getInstalledPluginInfoFromRegistry,_0x4c8128);if(_0x2e0916[_0x29748e(0x10d)]>0x0)return _0x2e0916[0x0];const _0x20a9aa=await runClaudeCommand(['plugin',_0x149120['pivNN']],{'captureOutput':!![]});if(!_0x20a9aa[_0x29748e(0x12d)]||!_0x20a9aa['output'])return null;if(!_0x20a9aa[_0x29748e(0x114)][_0x29748e(0x109)](_0x4c8128))return null;const _0x582a79={'name':_0x4c8128},_0x2afb6e=_0x20a9aa[_0x29748e(0x114)]['match'](new RegExp(_0x4c8128+_0x29748e(0x121),'i'));_0x2afb6e&&(_0x582a79[_0x29748e(0x127)]=_0x2afb6e[0x1][_0x29748e(0x112)]());const _0x4eea16=_0x20a9aa[_0x29748e(0x114)]['match'](new RegExp(_0x4c8128+'[\x5cs\x5cS]*?Version:\x5cs*([\x5cd.]+)','i'));_0x4eea16&&(_0x582a79['version']=_0x4eea16[0x1]);const _0x537f7e=_0x20a9aa[_0x29748e(0x114)][_0x29748e(0x120)](new RegExp(_0x4c8128+'[\x5cs\x5cS]*?(enabled|disabled)','i'));return _0x537f7e&&(_0x582a79['enabled']=_0x537f7e[0x1]['toLowerCase']()===_0x149120['ZOCeK']),_0x582a79;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x5da5f9=_0x3e63;(function(_0x53e27e,_0x1b9dd0){const _0x2e1cc3=_0x3e63,_0x4a4a78=_0x53e27e();while(!![]){try{const _0x51fa93=-parseInt(_0x2e1cc3(0xe9))/0x1+parseInt(_0x2e1cc3(0xfb))/0x2+-parseInt(_0x2e1cc3(0xf9))/0x3*(-parseInt(_0x2e1cc3(0xef))/0x4)+-parseInt(_0x2e1cc3(0xd9))/0x5*(parseInt(_0x2e1cc3(0x125))/0x6)+-parseInt(_0x2e1cc3(0x10c))/0x7+parseInt(_0x2e1cc3(0x126))/0x8*(parseInt(_0x2e1cc3(0xea))/0x9)+parseInt(_0x2e1cc3(0x137))/0xa;if(_0x51fa93===_0x1b9dd0)break;else _0x4a4a78['push'](_0x4a4a78['shift']());}catch(_0x2e5e2f){_0x4a4a78['push'](_0x4a4a78['shift']());}}}(_0x59c9,0x939eb));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x5a9977 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;async function requireToken(){const _0x136a7b=_0x3e63,_0x3c8508={'brLmX':function(_0x44d399){return _0x44d399();},'udfzu':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x4956c8=await _0x3c8508[_0x136a7b(0x122)](getToken);if(!_0x4956c8)throw new Error(_0x3c8508[_0x136a7b(0xe5)]);return _0x4956c8;}async function apiRequest(_0x576bd3,_0x4c630d={}){const _0x365263=_0x3e63,_0x26fb79={'fRJND':function(_0x4f6406){return _0x4f6406();},'wzAOG':'application/json','AJiCP':function(_0x4d2a85,_0x56483a){return _0x4d2a85===_0x56483a;}},_0x20ae82=await _0x26fb79['fRJND'](requireToken),_0x27bef1=getApiBaseUrl(),_0x13c051=await fetch(''+_0x27bef1+_0x576bd3,{..._0x4c630d,'headers':{'Authorization':_0x365263(0xe4)+_0x20ae82,'Content-Type':_0x26fb79[_0x365263(0xf4)],..._0x4c630d[_0x365263(0x127)]??{}}});if(!_0x13c051['ok']){let _0x2d80ff='',_0x4a60bb;try{const _0xe9004a=await _0x13c051['json']();_0x2d80ff=(typeof _0xe9004a['error']===_0x365263(0xd3)?_0xe9004a[_0x365263(0x110)]:undefined)??JSON['stringify'](_0xe9004a);if(_0x26fb79[_0x365263(0xd7)](typeof _0xe9004a['code'],'string'))_0x4a60bb=_0xe9004a[_0x365263(0x128)];}catch{_0x2d80ff=_0x13c051[_0x365263(0x139)];}throw new ApiError('API\x20request\x20'+_0x576bd3+_0x365263(0x12b)+_0x13c051[_0x365263(0x13a)]+_0x365263(0x10d)+_0x2d80ff,_0x13c051[_0x365263(0x13a)],_0x2d80ff,_0x4a60bb);}return _0x13c051['json']();}export class ApiError extends Error{['status'];[_0x5da5f9(0x105)];[_0x5da5f9(0x128)];constructor(_0x577b00,_0x36d2e4,_0x382207,_0x118e63){const _0x418654=_0x5da5f9,_0xbc4094=_0x418654(0x123)['split']('|');let _0x24799f=0x0;while(!![]){switch(_0xbc4094[_0x24799f++]){case'0':this[_0x418654(0x105)]=_0x382207;continue;case'1':this['name']=_0x418654(0x103);continue;case'2':this['status']=_0x36d2e4;continue;case'3':super(_0x577b00);continue;case'4':this['code']=_0x118e63;continue;}break;}}}export async function fetchCloudProfile(_0x38a0bd){const _0xb72e52=_0x5da5f9,_0x1d7bb1={'zByoE':function(_0x124b74,_0xb838fd){return _0x124b74(_0xb838fd);},'iVllD':function(_0x4e25fe,_0x1f1909){return _0x4e25fe===_0x1f1909;}};try{return await apiRequest(_0xb72e52(0x12f)+_0x1d7bb1['zByoE'](encodeURIComponent,_0x38a0bd));}catch(_0x39a6dd){if(_0x39a6dd instanceof ApiError&&_0x1d7bb1[_0xb72e52(0xda)](_0x39a6dd['status'],0x194))return null;throw _0x39a6dd;}}export async function listCloudProfiles(){const _0x339eae={'ycPwr':'/api/v1/profiles'},_0x4db33b=await apiRequest(_0x339eae['ycPwr']);return _0x4db33b['profiles'];}function _0x59c9(){const _0x2ae0bd=['error','keys','\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','test_output','message','plkrM','wJuyX','dYqym','\x22,\x20attempting\x20login...','\x22\x20for\x20','EpaTP','stringify','Fgmgs','PUT','storageState','utf-8','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','FYyws','brLmX','3|2|0|4|1','environment_key','572910hFBKLG','207968ssHICx','headers','code','organizationId','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','\x20failed\x20(','HjJvd','session_state','browserOptions','/api/v1/profiles/','hzVbp','WEPNc','close','cookies','sessionState','name','prompt','1090310ClRdVU','domains','statusText','status','\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','not_configured','lgLJj','loodZ','DDjvQ','NGPyW','password','\x20\x20Login\x20successful.\x20Session\x20cached.','RANGER_TEST_USERNAME','cDnzA','userAgent','No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22','NHZtZ','launch','sessionDeps','JeJdf','settings','string','iWlih','clientIp','Pass\x20--env\x20<key>\x20or\x20set\x20\x27defaultEnvironmentKey\x27\x20on\x20the\x20auth\x20config.','AJiCP','/login','5WZdjyI','iVllD','environmentKey','goto','Browser\x20login\x20timed\x20out\x20before\x20completion.','ISfZp','zjfCq','VhiaD','BSRjc','save','setupHeaders','Bearer\x20','udfzu','\x22.\x0a','storageStatePath','POST','1198564rfzzpo','180ZCcypK','isArray','newContext','cUyeC','QxBxE','4uvInyl','env','IuSSa','xLXYW','/session','wzAOG','ezzeB','NPGAW','force','log','1761702XKLUZZ','Multiple\x20envs\x20in\x20this\x20org\x27s\x20auth\x20config\x20(','1582398gcobcL','cli:manual-login','cZLDa','loginInstructions\x20on\x20the\x20auth\x20environment,\x20or\x20run\x20with\x20a\x20TTY.','username','newPage','Huciz','qYHka','ApiError','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','detail','\x22,\x20cached\x20locally','catch','defaultEnvironmentKey','XSWzY','auth','length','760788hLmhOm','):\x20','NKZAF','RANGER_TEST_PASSWORD'];_0x59c9=function(){return _0x2ae0bd;};return _0x59c9();}export async function createCloudProfile(_0x10128e,_0x5dfe1c,_0x3400f7={}){const _0x25bbdc=_0x5da5f9,_0x3e63bb={'FYyws':function(_0x5f58bb,_0x3fdf29){return _0x5f58bb>_0x3fdf29;},'Fgmgs':function(_0x3ab604,_0x37ea28,_0x5736b4){return _0x3ab604(_0x37ea28,_0x5736b4);}},_0x1140ca={'name':_0x10128e};if(_0x5dfe1c)_0x1140ca[_0x25bbdc(0x124)]=_0x5dfe1c;_0x3400f7[_0x25bbdc(0xd2)]&&_0x3e63bb[_0x25bbdc(0x121)](Object[_0x25bbdc(0x111)](_0x3400f7[_0x25bbdc(0xd2)])['length'],0x0)&&(_0x1140ca['settings']=_0x3400f7[_0x25bbdc(0xd2)]);if(_0x3400f7['username'])_0x1140ca[_0x25bbdc(0xff)]=_0x3400f7['username'];if(_0x3400f7['password'])_0x1140ca[_0x25bbdc(0x141)]=_0x3400f7[_0x25bbdc(0x141)];return await _0x3e63bb[_0x25bbdc(0x11c)](apiRequest,'/api/v1/profiles',{'method':_0x25bbdc(0xe8),'body':JSON[_0x25bbdc(0x11b)](_0x1140ca)});}export async function uploadCloudProfileSession(_0x6373d7,_0x86f343){const _0x1d0917=_0x5da5f9,_0x297f26={'XFizh':function(_0x3c42fa,_0x559a3a,_0x411b8a){return _0x3c42fa(_0x559a3a,_0x411b8a);},'FNvem':function(_0x8ffa8f,_0x3698ee){return _0x8ffa8f(_0x3698ee);}};return await _0x297f26['XFizh'](apiRequest,_0x1d0917(0x12f)+_0x297f26['FNvem'](encodeURIComponent,_0x6373d7)+'/session',{'method':_0x1d0917(0xe8),'body':JSON[_0x1d0917(0x11b)]({'session_state':_0x86f343})});}export async function saveCloudProfileCredentials(_0x1c295b,_0x365f7a,_0x4b133f){const _0x51d423=_0x5da5f9;await apiRequest(_0x51d423(0x12f)+encodeURIComponent(_0x1c295b),{'method':'PUT','body':JSON['stringify']({'username':_0x365f7a,'password':_0x4b133f})});}export async function fetchAuthConfig(){const _0x2e140f=_0x5da5f9,_0x43417e={'cZLDa':'/api/v1/profiles/auth-config'};try{const _0x5b59aa=await apiRequest(_0x43417e[_0x2e140f(0xfd)]);return _0x5b59aa['auth_config'];}catch{return null;}}function _0x3e63(_0x437b78,_0x5f5d5a){_0x437b78=_0x437b78-0xca;const _0x59c97c=_0x59c9();let _0x3e63f5=_0x59c97c[_0x437b78];return _0x3e63f5;}export function pickAdHocEnvKey(_0x5d5ad3){const _0x431834=_0x5da5f9;if(!_0x5d5ad3)return null;if(_0x5d5ad3[_0x431834(0x108)])return _0x5d5ad3[_0x431834(0x108)];const _0x1bf745=Object[_0x431834(0x111)](_0x5d5ad3['environments']??{});if(_0x1bf745[_0x431834(0x10b)]===0x1)return _0x1bf745[0x0];if(_0x1bf745['length']===0x0)return null;throw new Error(_0x431834(0xfa)+_0x1bf745['join'](',\x20')+').\x20'+_0x431834(0xd6));}export async function resolveAdHocProfile(_0x888468=process[_0x5da5f9(0xf0)]){const _0x36c9e3=_0x5da5f9,_0x320f24={'cUyeC':function(_0x3a9620,_0x3cd16e){return _0x3a9620(_0x3cd16e);},'onwuR':function(_0xd15e25,_0x56f0c0){return _0xd15e25(_0x56f0c0);},'qYHka':function(_0x559b69,_0x53fa2f){return _0x559b69??_0x53fa2f;}},_0x5d7ff0=_0x888468['RANGER_TEST_USERNAME'];if(!_0x5d7ff0)return null;const _0x19efba=await _0x320f24[_0x36c9e3(0xed)](fetchCloudProfile,_0x5d7ff0);if(_0x19efba)return{'name':_0x19efba['name'],'profile':_0x19efba};const _0x3439eb=await fetchAuthConfig(),_0x2abfa0=_0x320f24['onwuR'](pickAdHocEnvKey,_0x3439eb),_0x2d88d0=_0x888468['RANGER_TEST_PASSWORD'],_0x4b811c=await createCloudProfile(_0x5d7ff0,_0x320f24[_0x36c9e3(0x102)](_0x2abfa0,undefined),{'username':_0x5d7ff0,'password':_0x2d88d0});return console[_0x36c9e3(0xf8)]('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x4b811c[_0x36c9e3(0x135)]+_0x36c9e3(0x119)+_0x5d7ff0),{'name':_0x4b811c[_0x36c9e3(0x135)],'profile':_0x4b811c};}export async function writeSessionToLocalCache(_0x3eaee9,_0x3cc23b,_0x1149fc,_0x500bba,_0x22d959,_0x5a5aaf,_0x561649){const _0x50f851=_0x5da5f9,_0x243858={'HjJvd':function(_0x115585,_0x32e61d,_0x1d7369){return _0x115585(_0x32e61d,_0x1d7369);},'IuSSa':function(_0x2d1f27){return _0x2d1f27();},'plkrM':function(_0x5adc7e,_0x5b7cff){return _0x5adc7e>_0x5b7cff;},'DDjvQ':function(_0x236660,_0x22898f,_0x27675a){return _0x236660(_0x22898f,_0x27675a);}},_0x469290=sessionCacheHash({'orgId':_0x3cc23b,'profileName':_0x3eaee9,'effectiveBaseUrl':_0x1149fc,'setupHeaders':_0x500bba,'sessionDeps':_0x561649?.['sessionDeps'],'userAgent':_0x561649?.[_0x50f851(0xcc)],'clientIp':_0x561649?.['clientIp']}),_0x22987e=_0x243858[_0x50f851(0x12c)](getSessionCachePath,_0x469290,_0x3eaee9),_0x4b1ab2=join(_0x243858[_0x50f851(0xf1)](getRangerHomeDir),_0x50f851(0x10a));!existsSync(_0x4b1ab2)&&await mkdir(_0x4b1ab2,{'recursive':!![]});const _0x32b55c={..._0x22d959};_0x5a5aaf&&_0x243858[_0x50f851(0x115)](_0x5a5aaf[_0x50f851(0x10b)],0x0)&&Array[_0x50f851(0xeb)](_0x32b55c[_0x50f851(0x133)])&&(_0x32b55c[_0x50f851(0x133)]=duplicateCookiesForDomains(_0x32b55c['cookies'],_0x5a5aaf));const _0x56a6d0={'cached_at':new Date()['toISOString'](),'session_state':_0x32b55c};await writeFile(_0x22987e,JSON[_0x50f851(0x11b)](_0x56a6d0,null,0x2));const _0x4591b7=getStorageStatePath(_0x22987e);return await _0x243858[_0x50f851(0x13f)](writeFile,_0x4591b7,JSON['stringify'](_0x32b55c,null,0x2)),_0x4591b7;}export async function checkLocalCache(_0x1e43ae,_0x46350f,_0x59f508,_0x4b9245,_0x15adfe){const _0x1f477b=_0x5da5f9,_0x54ddaa={'BSRjc':function(_0x47b3f3,_0x465615,_0x48d6d2){return _0x47b3f3(_0x465615,_0x48d6d2);},'cgBoJ':function(_0x270deb,_0x945e68){return _0x270deb(_0x945e68);},'Huciz':function(_0x8a3130,_0x23da37){return _0x8a3130(_0x23da37);},'qIFxB':_0x1f477b(0x11f)},_0x473d68=sessionCacheHash({'orgId':_0x46350f,'profileName':_0x1e43ae,'effectiveBaseUrl':_0x59f508,'setupHeaders':_0x4b9245,'sessionDeps':_0x15adfe?.['sessionDeps'],'userAgent':_0x15adfe?.['userAgent'],'clientIp':_0x15adfe?.[_0x1f477b(0xd5)]}),_0x1b55ea=_0x54ddaa[_0x1f477b(0xe1)](getSessionCachePath,_0x473d68,_0x1e43ae),_0x3143c6=_0x54ddaa['cgBoJ'](getStorageStatePath,_0x1b55ea);if(!existsSync(_0x1b55ea)||!_0x54ddaa[_0x1f477b(0x101)](existsSync,_0x3143c6))return null;try{const _0x135f2e=await _0x54ddaa[_0x1f477b(0xe1)](readFile,_0x1b55ea,_0x54ddaa['qIFxB']);return JSON['parse'](_0x135f2e),{'storageStatePath':_0x3143c6};}catch{return null;}}function launchRealBrowser(){return chromium['launch']({'headless':!![]});}export async function serverSideLogin(_0x178723,_0x1d280d){const _0x5f3321=_0x5da5f9,_0x494f12={'cDnzA':_0x5f3321(0xe8),'qKIJg':_0x5f3321(0x13c)},_0x33e1cf=process['env'][_0x5f3321(0xca)],_0x291177=process[_0x5f3321(0xf0)]['RANGER_TEST_PASSWORD'],_0x52a9d5={};if(_0x33e1cf)_0x52a9d5[_0x5f3321(0xff)]=_0x33e1cf;if(_0x291177)_0x52a9d5['password']=_0x291177;if(_0x1d280d?.[_0x5f3321(0xf7)])_0x52a9d5[_0x5f3321(0xf7)]=!![];try{return await apiRequest(_0x5f3321(0x12f)+encodeURIComponent(_0x178723)+_0x5f3321(0xd8),{'method':_0x494f12[_0x5f3321(0xcb)],'body':JSON['stringify'](_0x52a9d5)});}catch(_0x585aa0){if(_0x585aa0 instanceof ApiError&&_0x585aa0[_0x5f3321(0x13a)]===0x190&&_0x585aa0[_0x5f3321(0x128)]==='not_configured')return{'status':_0x494f12['qKIJg'],'error':_0x585aa0[_0x5f3321(0x105)]};throw _0x585aa0;}}export async function manualBrowserLogin(_0x4cca10,_0x431f6a){const _0x19e5ea=_0x5da5f9,_0x453cd2={'WEPNc':function(_0x1447ae,_0x581a46){return _0x1447ae/_0x581a46;},'GFwNS':function(_0x579acf){return _0x579acf();},'GeIAn':function(_0x4bc586,_0x2d3c4e){return _0x4bc586(_0x2d3c4e);},'xQQOb':_0x19e5ea(0x132),'OBXAx':function(_0x39ddc4,_0x1031f2){return _0x39ddc4+_0x1031f2;},'dYqym':'\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD,\x20configure\x20','iJZuM':function(_0x108c20,_0x486f44){return _0x108c20>_0x486f44;},'hzVbp':'about:blank','NGPyW':_0x19e5ea(0x112),'XSWzY':'\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','wJuyX':function(_0x2d1282,_0x199a13){return _0x2d1282(_0x199a13);},'NKZAF':function(_0x192622,_0x22544b){return _0x192622&&_0x22544b;},'NPGAW':'Browser\x20closed\x20before\x20authentication\x20was\x20saved.','YsruB':function(_0x341a93,_0x2876e6,_0x42682a){return _0x341a93(_0x2876e6,_0x42682a);},'RBHsG':function(_0x3e5616,_0x5bd0fc){return _0x3e5616(_0x5bd0fc);},'ISfZp':_0x19e5ea(0xfc)};if(!isInteractive())throw new Error(_0x453cd2['OBXAx'](_0x19e5ea(0xcd)+_0x4cca10[_0x19e5ea(0x135)]+_0x19e5ea(0xe6)+_0x453cd2[_0x19e5ea(0x117)],_0x19e5ea(0xfe)));const _0x9f702c=_0x431f6a&&_0x453cd2['iJZuM'](_0x431f6a[_0x19e5ea(0x138)]['length'],0x0)?_0x431f6a[_0x19e5ea(0x138)][0x0]:_0x453cd2[_0x19e5ea(0x130)];console['log'](_0x453cd2[_0x19e5ea(0x140)]),console[_0x19e5ea(0xf8)](_0x453cd2[_0x19e5ea(0x109)]),await new Promise(_0x2e221c=>setTimeout(_0x2e221c,0x7d0));const _0x34a327=await chromium[_0x19e5ea(0xcf)]({'headless':![]});let _0x158eb5=null;try{const _0x58d2a4={'ignoreHTTPSErrors':!![]};_0x431f6a?.['setupHeaders']&&(_0x58d2a4['extraHTTPHeaders']=_0x431f6a[_0x19e5ea(0xe3)]);const _0xbbaed8=await _0x34a327[_0x19e5ea(0xec)](_0x58d2a4);await _0x453cd2[_0x19e5ea(0x116)](addProfileSetupBanner,_0xbbaed8);const _0x524135=await _0xbbaed8[_0x19e5ea(0x100)]();await _0x524135[_0x19e5ea(0xdc)](_0x9f702c);let _0x2a20ca=![];await new Promise(_0x40a944=>{const _0x1046dc={'NHZtZ':function(_0x3863f2,_0x3140d6){const _0x1eb989=_0x3e63;return _0x453cd2[_0x1eb989(0x131)](_0x3863f2,_0x3140d6);},'EpaTP':function(_0x1fed6e){return _0x453cd2['GFwNS'](_0x1fed6e);},'KvcfI':function(_0xbc9ab9,_0x3d36be){return _0x453cd2['GeIAn'](_0xbc9ab9,_0x3d36be);}},_0x1ca08e=setTimeout(()=>{const _0x24c72a=_0x3e63;_0x2a20ca=!![],console[_0x24c72a(0x110)]('Browser\x20login\x20timed\x20out\x20after\x20'+_0x1046dc[_0x24c72a(0xce)](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+_0x24c72a(0x104)),_0x1046dc[_0x24c72a(0x11a)](_0x40a944);},MANUAL_LOGIN_TIMEOUT_MS);_0x524135['on'](_0x453cd2['xQQOb'],async()=>{const _0x46fa10=_0x3e63;_0x1046dc['KvcfI'](clearTimeout,_0x1ca08e);try{const _0x4e2f6e=await _0xbbaed8[_0x46fa10(0x11e)]();_0x158eb5=_0x4e2f6e;}catch{}_0x40a944();});});if(_0x453cd2[_0x19e5ea(0x10e)](_0x2a20ca,!_0x158eb5))throw new Error(_0x19e5ea(0xdd));}finally{await _0x34a327['close']()[_0x19e5ea(0x107)](()=>{});}if(!_0x158eb5)throw new Error(_0x453cd2[_0x19e5ea(0xf6)]);return await _0x453cd2['YsruB'](apiRequest,'/api/v1/profiles/'+_0x453cd2['RBHsG'](encodeURIComponent,_0x4cca10['name'])+_0x19e5ea(0xf3),{'method':_0x19e5ea(0xe8),'body':JSON['stringify']({'session_state':_0x158eb5,'updated_by':_0x453cd2[_0x19e5ea(0xde)]})}),{'sessionState':_0x158eb5};}export async function promptSaveCredentials(_0x505299){const _0x54abfd=_0x5da5f9,_0x4339e2={'zjfCq':'confirm','iWlih':_0x54abfd(0x11d)},_0x19c914=process['env'][_0x54abfd(0xca)],_0x6a6e21=process[_0x54abfd(0xf0)][_0x54abfd(0x10f)];if(!_0x19c914||!_0x6a6e21)return;if(!isInteractive())return;const {save:_0xd52f46}=await _0x5a9977[_0x54abfd(0x136)]([{'type':_0x4339e2[_0x54abfd(0xdf)],'name':_0x54abfd(0xe2),'message':_0x54abfd(0x12a),'default':![]}]);if(!_0xd52f46)return;await apiRequest(_0x54abfd(0x12f)+encodeURIComponent(_0x505299),{'method':_0x4339e2[_0x54abfd(0xd4)],'body':JSON[_0x54abfd(0x11b)]({'username':_0x19c914,'password':_0x6a6e21})}),console['log']('\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.');}export async function resolveCloudProfileSession(_0x34012f,_0x380c37={}){const _0x5e2601=_0x5da5f9,_0x10ab84={'AThjS':function(_0x1e6ebb){return _0x1e6ebb();},'lgLJj':function(_0x906425,_0x53f55f,_0x25dc79,_0x1acafd,_0x4a0ef1,_0x4472a5){return _0x906425(_0x53f55f,_0x25dc79,_0x1acafd,_0x4a0ef1,_0x4472a5);},'JeJdf':function(_0x3fa5b2,_0x197ac5,_0x31adc0,_0x5a4bdd,_0x3d5935){return _0x3fa5b2(_0x197ac5,_0x31adc0,_0x5a4bdd,_0x3d5935);},'QxBxE':function(_0x27c647,_0x23973d){return _0x27c647(_0x23973d);},'VhiaD':function(_0x1adf6a,_0x2d99b2){return _0x1adf6a(_0x2d99b2);},'xLXYW':function(_0x28a572,_0x2d330a){return _0x28a572===_0x2d330a;},'ezzeB':'success','cUMRq':_0x5e2601(0x142),'Qzeqr':function(_0x5f1e86,_0x3daad0,_0x2a5b22,_0x9fe995,_0x3a51e0,_0x2ed763,_0x40b402,_0x86c204){return _0x5f1e86(_0x3daad0,_0x2a5b22,_0x9fe995,_0x3a51e0,_0x2ed763,_0x40b402,_0x86c204);},'ASpdg':_0x5e2601(0x13b),'wiAUz':'\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','loodZ':function(_0x2e0b5e,_0x3d2834,_0x33da07){return _0x2e0b5e(_0x3d2834,_0x33da07);}},_0x83db79=_0x34012f['settings']??{},_0xe4004b=await _0x10ab84['AThjS'](fetchAuthConfig),_0x506b24=_0xe4004b?resolveAuthEnvironmentLocally(_0xe4004b,_0x34012f[_0x5e2601(0xdb)]):null,_0x274be8=_0x506b24?.[_0x5e2601(0x138)],_0x4ad562=_0x83db79['setupHeaders'],_0x19117a=_0x4ad562??_0x506b24?.[_0x5e2601(0xe3)],_0x2400a6=_0x380c37['effectiveBaseUrl']??_0x83db79['baseUrl']??(_0x274be8&&_0x274be8[_0x5e2601(0x10b)]>0x0?_0x274be8[0x0]:''),_0x9af0bf={'sessionDeps':_0x506b24?.[_0x5e2601(0xd0)],'userAgent':_0x506b24?.[_0x5e2601(0x12e)]?.['userAgent']??_0x83db79['userAgent']},_0x56275d=await _0x10ab84[_0x5e2601(0x13d)](checkLocalCache,_0x34012f['name'],_0x34012f[_0x5e2601(0x129)],_0x2400a6,_0x19117a,_0x9af0bf);if(_0x56275d){if(_0x2400a6){const _0x4d8311=await _0x10ab84[_0x5e2601(0xd1)](isCachedSessionLive,_0x56275d['storageStatePath'],_0x2400a6,{'sessionCheckPath':_0x506b24?.['sessionCheckPath'],'setupHeaders':_0x19117a},{'launchBrowser':launchRealBrowser});if(_0x4d8311)return console['log'](_0x5e2601(0x120)+_0x34012f['name']+'\x22'),{'authPath':_0x56275d[_0x5e2601(0xe7)],'settings':_0x83db79,'resolvedEnv':_0x506b24};console['log']('\x20\x20Cached\x20session\x20for\x20\x22'+_0x34012f['name']+'\x22\x20failed\x20validation\x20—\x20refreshing...');}else return{'authPath':_0x56275d[_0x5e2601(0xe7)],'settings':_0x83db79,'resolvedEnv':_0x506b24};}if(_0x34012f[_0x5e2601(0x134)]){const _0x471ea8=await writeSessionToLocalCache(_0x34012f[_0x5e2601(0x135)],_0x34012f[_0x5e2601(0x129)],_0x2400a6,_0x19117a,_0x34012f[_0x5e2601(0x134)],_0x274be8,_0x9af0bf);if(_0x2400a6){const _0x3bbff3=await isCachedSessionLive(_0x471ea8,_0x2400a6,{'sessionCheckPath':_0x506b24?.['sessionCheckPath'],'setupHeaders':_0x19117a},{'launchBrowser':launchRealBrowser});if(_0x3bbff3)return console['log']('\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22'+_0x34012f[_0x5e2601(0x135)]+_0x5e2601(0x106)),{'authPath':_0x471ea8,'settings':_0x83db79,'resolvedEnv':_0x506b24};console[_0x5e2601(0xf8)]('\x20\x20Cloud\x20session\x20for\x20\x22'+_0x34012f[_0x5e2601(0x135)]+'\x22\x20failed\x20validation\x20—\x20re-login\x20needed...');}else return{'authPath':_0x471ea8,'settings':_0x83db79,'resolvedEnv':_0x506b24};}console[_0x5e2601(0xf8)]('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x34012f['name']+_0x5e2601(0x118));const _0x935d8d=Boolean(process[_0x5e2601(0xf0)]['RANGER_TEST_USERNAME'])&&Boolean(process['env']['RANGER_TEST_PASSWORD']),_0x581b10=_0x10ab84[_0x5e2601(0xee)](Boolean,_0x34012f[_0x5e2601(0xff)]);if(_0x935d8d||_0x581b10)try{const _0x53c245=await _0x10ab84[_0x5e2601(0xe0)](serverSideLogin,_0x34012f[_0x5e2601(0x135)]);if(_0x53c245['status']===_0x5e2601(0x13c))console['log']('\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...');else{if(_0x10ab84[_0x5e2601(0xf2)](_0x53c245['status'],_0x10ab84[_0x5e2601(0xf5)])&&_0x53c245['session_state']){console[_0x5e2601(0xf8)](_0x10ab84['cUMRq']);const _0x23ff0d=await _0x10ab84['Qzeqr'](writeSessionToLocalCache,_0x34012f[_0x5e2601(0x135)],_0x34012f['organizationId'],_0x2400a6,_0x19117a,_0x53c245[_0x5e2601(0x12d)],_0x274be8,_0x9af0bf);return _0x935d8d&&!_0x581b10&&await promptSaveCredentials(_0x34012f[_0x5e2601(0x135)]),{'authPath':_0x23ff0d,'settings':_0x83db79,'resolvedEnv':_0x506b24};}else _0x53c245[_0x5e2601(0x113)]&&(console['log'](_0x10ab84['ASpdg']),console['log'](_0x53c245['test_output'])),console[_0x5e2601(0xf8)]('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}}catch(_0x55b917){console[_0x5e2601(0xf8)]('\x20\x20Server-side\x20login\x20error:\x20'+(_0x55b917 instanceof Error?_0x55b917[_0x5e2601(0x114)]:String(_0x55b917))),console[_0x5e2601(0xf8)](_0x10ab84['wiAUz']);}const {sessionState:_0x1b976f}=await _0x10ab84[_0x5e2601(0x13e)](manualBrowserLogin,_0x34012f,_0x506b24),_0x498207=await writeSessionToLocalCache(_0x34012f['name'],_0x34012f['organizationId'],_0x2400a6,_0x19117a,_0x1b976f,_0x274be8,_0x9af0bf);return{'authPath':_0x498207,'settings':_0x83db79,'resolvedEnv':_0x506b24};}
|
|
1
|
+
function _0xb298(_0xcd6926,_0x34904f){_0xcd6926=_0xcd6926-0x185;const _0x1bc0e9=_0x1bc0();let _0xb29886=_0x1bc0e9[_0xcd6926];return _0xb29886;}const _0x3f1027=_0xb298;(function(_0x4afd1d,_0x29068c){const _0x1c2e14=_0xb298,_0x1bfb9a=_0x4afd1d();while(!![]){try{const _0xb3f84=-parseInt(_0x1c2e14(0x1c5))/0x1*(parseInt(_0x1c2e14(0x1fa))/0x2)+-parseInt(_0x1c2e14(0x199))/0x3*(parseInt(_0x1c2e14(0x19e))/0x4)+parseInt(_0x1c2e14(0x1cc))/0x5+parseInt(_0x1c2e14(0x186))/0x6*(-parseInt(_0x1c2e14(0x18b))/0x7)+-parseInt(_0x1c2e14(0x19a))/0x8*(parseInt(_0x1c2e14(0x1ea))/0x9)+parseInt(_0x1c2e14(0x19f))/0xa+parseInt(_0x1c2e14(0x1a3))/0xb;if(_0xb3f84===_0x29068c)break;else _0x1bfb9a['push'](_0x1bfb9a['shift']());}catch(_0x2397a6){_0x1bfb9a['push'](_0x1bfb9a['shift']());}}}(_0x1bc0,0xaf432));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x56722d 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;async function requireToken(){const _0x474551=_0xb298,_0x4e6559={'fhDvM':function(_0xe3d074){return _0xe3d074();},'yBhDj':_0x474551(0x1ab)},_0x41e245=await _0x4e6559['fhDvM'](getToken);if(!_0x41e245)throw new Error(_0x4e6559[_0x474551(0x1eb)]);return _0x41e245;}async function apiRequest(_0x566b7e,_0x2ffce4={}){const _0xcc7df1=_0xb298,_0x133e96={'yKmlb':function(_0xc81e27){return _0xc81e27();},'onISK':function(_0x10588d){return _0x10588d();},'lRWQG':function(_0x4a2a56,_0x5197ba,_0x9ccfa0){return _0x4a2a56(_0x5197ba,_0x9ccfa0);},'TQguz':'application/json','xnetJ':function(_0x5776e4,_0x2b7cce){return _0x5776e4===_0x2b7cce;},'CoIer':'string'},_0x2be767=await _0x133e96[_0xcc7df1(0x190)](requireToken),_0x6922dd=_0x133e96[_0xcc7df1(0x1a1)](getApiBaseUrl),_0x2461af=await _0x133e96['lRWQG'](fetch,''+_0x6922dd+_0x566b7e,{..._0x2ffce4,'headers':{'Authorization':'Bearer\x20'+_0x2be767,'Content-Type':_0x133e96['TQguz'],..._0x2ffce4[_0xcc7df1(0x1e1)]??{}}});if(!_0x2461af['ok']){let _0x40e13d='',_0x8e5664;try{const _0x149a88=await _0x2461af[_0xcc7df1(0x187)]();_0x40e13d=(_0x133e96['xnetJ'](typeof _0x149a88[_0xcc7df1(0x1f5)],_0x133e96['CoIer'])?_0x149a88[_0xcc7df1(0x1f5)]:undefined)??JSON['stringify'](_0x149a88);if(_0x133e96[_0xcc7df1(0x1d6)](typeof _0x149a88['code'],_0x133e96[_0xcc7df1(0x1ca)]))_0x8e5664=_0x149a88[_0xcc7df1(0x1ba)];}catch{_0x40e13d=_0x2461af[_0xcc7df1(0x1bc)];}throw new ApiError('API\x20request\x20'+_0x566b7e+'\x20failed\x20('+_0x2461af[_0xcc7df1(0x18f)]+_0xcc7df1(0x1db)+_0x40e13d,_0x2461af['status'],_0x40e13d,_0x8e5664);}return _0x2461af[_0xcc7df1(0x187)]();}export class ApiError extends Error{['status'];[_0x3f1027(0x1c8)];['code'];constructor(_0x19bb81,_0x41e4be,_0x291090,_0x43aba4){const _0x319945=_0x3f1027,_0x48c2ce={'HxocX':'1|0|4|2|3','szVoZ':'ApiError'},_0xae5e2b=_0x48c2ce[_0x319945(0x1f4)][_0x319945(0x1d7)]('|');let _0x4ecf70=0x0;while(!![]){switch(_0xae5e2b[_0x4ecf70++]){case'0':this['status']=_0x41e4be;continue;case'1':super(_0x19bb81);continue;case'2':this['code']=_0x43aba4;continue;case'3':this[_0x319945(0x1f0)]=_0x48c2ce['szVoZ'];continue;case'4':this[_0x319945(0x1c8)]=_0x291090;continue;}break;}}}export async function fetchCloudProfile(_0x291577){const _0x3e7e7d=_0x3f1027,_0x23182c={'wgffZ':function(_0x2e1b71,_0x383f9f){return _0x2e1b71(_0x383f9f);},'oUlYK':function(_0x183d9f,_0x1bd5d1){return _0x183d9f===_0x1bd5d1;}};try{return await apiRequest('/api/v1/profiles/'+_0x23182c['wgffZ'](encodeURIComponent,_0x291577));}catch(_0x4814e1){if(_0x4814e1 instanceof ApiError&&_0x23182c[_0x3e7e7d(0x1ee)](_0x4814e1[_0x3e7e7d(0x18f)],0x194))return null;throw _0x4814e1;}}export async function listCloudProfiles(){const _0x99996d=_0x3f1027,_0x1efdc2={'qDSNQ':function(_0x11ae28,_0x457c54){return _0x11ae28(_0x457c54);}},_0x180025=await _0x1efdc2[_0x99996d(0x191)](apiRequest,'/api/v1/profiles');return _0x180025['profiles'];}export async function createCloudProfile(_0x1e3465,_0x16cc34,_0x17aa96={}){const _0x4f6387=_0x3f1027,_0x71f1bb={'clLJF':_0x4f6387(0x19d)},_0x59be06={'name':_0x1e3465};if(_0x16cc34)_0x59be06['environment_key']=_0x16cc34;_0x17aa96['settings']&&Object[_0x4f6387(0x19c)](_0x17aa96['settings'])['length']>0x0&&(_0x59be06[_0x4f6387(0x1a0)]=_0x17aa96['settings']);if(_0x17aa96[_0x4f6387(0x1c9)])_0x59be06['username']=_0x17aa96['username'];if(_0x17aa96['password'])_0x59be06[_0x4f6387(0x1bd)]=_0x17aa96['password'];return await apiRequest(_0x71f1bb['clLJF'],{'method':'POST','body':JSON[_0x4f6387(0x1a5)](_0x59be06)});}export async function uploadCloudProfileSession(_0x2abcd3,_0x4eb5f9){const _0x54743f=_0x3f1027,_0x53e815={'Wkdux':'POST'};return await apiRequest(_0x54743f(0x1de)+encodeURIComponent(_0x2abcd3)+'/session',{'method':_0x53e815['Wkdux'],'body':JSON['stringify']({'session_state':_0x4eb5f9})});}export async function saveCloudProfileCredentials(_0x2984fd,_0x1a5346,_0x55a07f){const _0x5544b7=_0x3f1027,_0x19b7ae={'TabPQ':function(_0x11b99a,_0x1d1644,_0x3f1c3b){return _0x11b99a(_0x1d1644,_0x3f1c3b);}};await _0x19b7ae[_0x5544b7(0x1ad)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x2984fd),{'method':_0x5544b7(0x1ef),'body':JSON[_0x5544b7(0x1a5)]({'username':_0x1a5346,'password':_0x55a07f})});}function _0x1bc0(){const _0x4805f6=['environments','JpOAJ','\x22\x20for\x20','status','yKmlb','qDSNQ','\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20','\x20\x20No\x20live\x20session\x20for\x20\x22','gjeCv',').\x20','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','/session','YlkRs','491109OVNeXO','16EdcOGV','IyxFF','keys','/api/v1/profiles','4ehcxWm','2360510kFybCk','settings','onISK','\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22','22745954JTDBtu','session_state','stringify','lAFol','YsFwh','join','VpXqB','\x20\x20Login\x20successful.\x20Session\x20cached.','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','origin','TabPQ','LkypW','url','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','log','toISOString','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','KwJog','you\x27re\x20now\x20at\x20\x22','/login','sessionCheckPath','loginInstructions\x20on\x20the\x20auth\x20environment,\x20or\x20run\x20with\x20a\x20TTY.','goto','code','prompt','statusText','password','eEbfR','invalidateOn','hostname','organizationId','zDIea','length','\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','89TLMHAI','BJFMY','KRUEI','detail','username','CoIer','cookies','4864955lqOYbo','bczEw','protocol','HEmWh','\x22.\x0a','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.','RANGER_TEST_USERNAME','cli:manual-login','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD,\x20configure\x20','rxrQR','xnetJ','split','RANGER_TEST_PASSWORD','vUTFO','odtOL','):\x20','\x22\x20failed\x20validation\x20—\x20refreshing...','TAFwx','/api/v1/profiles/','clientIp','TXIGs','headers','newPage','OmCSQ','env','isArray','jVSww','RwgiV','domains','parse','3837087xvtejm','yBhDj','gEEjJ','POST','oUlYK','PUT','name','auth','QqguS','setupHeaders','HxocX','error','auth_config','QtLag','launch','not_configured','16812qbuCKv','defaultEnvironmentKey','438EmsaDf','json','catch','acYFM','push','76181VpSkMI'];_0x1bc0=function(){return _0x4805f6;};return _0x1bc0();}export async function fetchAuthConfig(){const _0x22368d=_0x3f1027,_0x19574d={'EBCvL':function(_0x2edddc,_0x54ee45){return _0x2edddc(_0x54ee45);}};try{const _0x58c442=await _0x19574d['EBCvL'](apiRequest,'/api/v1/profiles/auth-config');return _0x58c442[_0x22368d(0x1f6)];}catch{return null;}}export function pickAdHocEnvKey(_0xbde37b){const _0x15c50c=_0x3f1027,_0x508b2e={'OmCSQ':function(_0xd5e8c0,_0x44e79e){return _0xd5e8c0===_0x44e79e;}};if(!_0xbde37b)return null;if(_0xbde37b[_0x15c50c(0x185)])return _0xbde37b['defaultEnvironmentKey'];const _0x41bd01=Object['keys'](_0xbde37b[_0x15c50c(0x18c)]??{});if(_0x508b2e[_0x15c50c(0x1e3)](_0x41bd01[_0x15c50c(0x1c3)],0x1))return _0x41bd01[0x0];if(_0x508b2e[_0x15c50c(0x1e3)](_0x41bd01[_0x15c50c(0x1c3)],0x0))return null;throw new Error('Multiple\x20envs\x20in\x20this\x20org\x27s\x20auth\x20config\x20('+_0x41bd01['join'](',\x20')+_0x15c50c(0x195)+'Pass\x20--env\x20<key>\x20or\x20set\x20\x27defaultEnvironmentKey\x27\x20on\x20the\x20auth\x20config.');}export async function resolveAdHocProfile(_0x9efa3=process[_0x3f1027(0x1e4)]){const _0x49879f=_0x3f1027,_0x410da3=_0x9efa3['RANGER_TEST_USERNAME'];if(!_0x410da3)return null;const _0x3648c6=await fetchCloudProfile(_0x410da3);if(_0x3648c6)return{'name':_0x3648c6['name'],'profile':_0x3648c6};const _0x16fcc4=await fetchAuthConfig(),_0x1a7d97=pickAdHocEnvKey(_0x16fcc4),_0x57a683=_0x9efa3[_0x49879f(0x1d8)],_0x583817=await createCloudProfile(_0x410da3,_0x1a7d97??undefined,{'username':_0x410da3,'password':_0x57a683});return console['log']('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x583817[_0x49879f(0x1f0)]+_0x49879f(0x18e)+_0x410da3),{'name':_0x583817[_0x49879f(0x1f0)],'profile':_0x583817};}export async function writeSessionToLocalCache(_0xc1d03,_0x53fde2,_0x3b28be,_0x41218a,_0x2b7e63,_0xa65e9,_0x494373){const _0x182048=_0x3f1027,_0x545967={'ZEDjN':function(_0x306add,_0x5a7b3b){return _0x306add(_0x5a7b3b);},'bENPL':function(_0x322ae4,_0x22861f,_0x21021c){return _0x322ae4(_0x22861f,_0x21021c);},'rFFdh':_0x182048(0x1f1),'wHJWm':function(_0x168262,_0x337b19){return _0x168262(_0x337b19);},'KwJog':function(_0x51cce0,_0x357f1d,_0xe8cf7a){return _0x51cce0(_0x357f1d,_0xe8cf7a);},'MtmSl':function(_0x272c98,_0x4b9a62){return _0x272c98>_0x4b9a62;},'QyQUj':function(_0x3748f9,_0x232009,_0x25ccf4){return _0x3748f9(_0x232009,_0x25ccf4);}},_0x5af0af=_0x545967['ZEDjN'](sessionCacheHash,{'orgId':_0x53fde2,'profileName':_0xc1d03,'effectiveBaseUrl':_0x3b28be,'setupHeaders':_0x41218a,'invalidateOn':_0x494373?.['invalidateOn'],'userAgent':_0x494373?.['userAgent'],'clientIp':_0x494373?.[_0x182048(0x1df)]}),_0x252988=_0x545967['bENPL'](getSessionCachePath,_0x5af0af,_0xc1d03),_0x34451c=join(getRangerHomeDir(),_0x545967['rFFdh']);!_0x545967['wHJWm'](existsSync,_0x34451c)&&await _0x545967[_0x182048(0x1b4)](mkdir,_0x34451c,{'recursive':!![]});const _0x4a5d46={..._0x2b7e63};_0xa65e9&&_0x545967['MtmSl'](_0xa65e9[_0x182048(0x1c3)],0x0)&&Array[_0x182048(0x1e5)](_0x4a5d46['cookies'])&&(_0x4a5d46[_0x182048(0x1cb)]=_0x545967['QyQUj'](duplicateCookiesForDomains,_0x4a5d46['cookies'],_0xa65e9));const _0x30ab98={'cached_at':new Date()[_0x182048(0x1b2)](),'session_state':_0x4a5d46};await writeFile(_0x252988,JSON[_0x182048(0x1a5)](_0x30ab98,null,0x2));const _0x73c0e7=_0x545967['wHJWm'](getStorageStatePath,_0x252988);return await _0x545967['QyQUj'](writeFile,_0x73c0e7,JSON['stringify'](_0x4a5d46,null,0x2)),_0x73c0e7;}export async function checkLocalCache(_0x43ce63,_0x5da08f,_0x5e2c78,_0x2c519b,_0x2c6321){const _0x5e7872=_0x3f1027,_0x4d7c15={'JpOAJ':function(_0xf3e151,_0x4b92fc,_0x478089){return _0xf3e151(_0x4b92fc,_0x478089);},'qbEHx':'utf-8'},_0xfa5c58=sessionCacheHash({'orgId':_0x5da08f,'profileName':_0x43ce63,'effectiveBaseUrl':_0x5e2c78,'setupHeaders':_0x2c519b,'invalidateOn':_0x2c6321?.[_0x5e7872(0x1bf)],'userAgent':_0x2c6321?.['userAgent'],'clientIp':_0x2c6321?.[_0x5e7872(0x1df)]}),_0x30df16=_0x4d7c15[_0x5e7872(0x18d)](getSessionCachePath,_0xfa5c58,_0x43ce63),_0x5784ba=getStorageStatePath(_0x30df16);if(!existsSync(_0x30df16)||!existsSync(_0x5784ba))return null;try{const _0x23bbd9=await readFile(_0x30df16,_0x4d7c15['qbEHx']);return JSON[_0x5e7872(0x1e9)](_0x23bbd9),{'storageStatePath':_0x5784ba};}catch{return null;}}function launchRealBrowser(){const _0x5a414e=_0x3f1027;return chromium[_0x5a414e(0x1f8)]({'headless':!![]});}function emitSessionValidationHint(_0x15aa66,_0x11601d){const _0x1c57fe=_0x3f1027,_0x46b014={'EBZQK':'Your\x20org\x27s\x20auth-config\x20env\x20may\x20need\x20`invalidateOn:\x20[\x27port\x27]`\x20so\x20sessions\x20captured\x20on\x20one\x20port\x20aren\x27t\x20reused\x20on\x20another.','odtOL':_0x1c57fe(0x1d1),'YsFwh':function(_0x36f240,_0x15bac0){return _0x36f240+_0x15bac0;}};if(!_0x11601d||!_0x11601d['domains']?.[_0x1c57fe(0x1c3)])return;let _0x146138;try{_0x146138=new URL(_0x15aa66);}catch{return;}const _0x2095b7=[];for(const _0x1abfb7 of _0x11601d[_0x1c57fe(0x1e8)]){try{_0x2095b7[_0x1c57fe(0x18a)]({'raw':_0x1abfb7,'url':new URL(_0x1abfb7)});}catch{}}if(_0x2095b7['length']===0x0)return;if(_0x2095b7['some'](_0x26bde2=>_0x26bde2[_0x1c57fe(0x1af)]['origin']===_0x146138[_0x1c57fe(0x1ac)]))return;const _0x4da7ca=_0x2095b7['some'](_0x1e4927=>_0x146138['hostname']===_0x1e4927[_0x1c57fe(0x1af)][_0x1c57fe(0x1c0)]&&_0x146138[_0x1c57fe(0x1ce)]===_0x1e4927[_0x1c57fe(0x1af)]['protocol']&&_0x146138['port']!==_0x1e4927[_0x1c57fe(0x1af)]['port']),_0x501907=_0x4da7ca?_0x46b014['EBZQK']:_0x46b014[_0x1c57fe(0x1da)],_0x1ffe23=_0x2095b7['map'](_0x357a91=>'\x22'+_0x357a91['raw']+'\x22')[_0x1c57fe(0x1a8)](',\x20');console[_0x1c57fe(0x1b1)](_0x46b014[_0x1c57fe(0x1a7)]('\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20'+_0x1ffe23+';\x20',_0x1c57fe(0x1b5)+_0x15aa66+_0x1c57fe(0x192)+_0x501907));}export async function serverSideLogin(_0x1c64a6,_0x15e418){const _0x1bdf23=_0x3f1027,_0x516d4a={'acYFM':function(_0x291174,_0x2a67eb,_0x3cb9bf){return _0x291174(_0x2a67eb,_0x3cb9bf);},'QjpcV':function(_0x634fd,_0x2d8f3d){return _0x634fd instanceof _0x2d8f3d;},'rxrQR':function(_0x5dcb8b,_0x14548c){return _0x5dcb8b===_0x14548c;}},_0x4081d8=process['env'][_0x1bdf23(0x1d2)],_0x3ce5ba=process['env'][_0x1bdf23(0x1d8)],_0x3551b3={};if(_0x4081d8)_0x3551b3[_0x1bdf23(0x1c9)]=_0x4081d8;if(_0x3ce5ba)_0x3551b3['password']=_0x3ce5ba;if(_0x15e418?.['force'])_0x3551b3['force']=!![];try{return await _0x516d4a[_0x1bdf23(0x189)](apiRequest,_0x1bdf23(0x1de)+encodeURIComponent(_0x1c64a6)+_0x1bdf23(0x1b6),{'method':_0x1bdf23(0x1ed),'body':JSON['stringify'](_0x3551b3)});}catch(_0x2da240){if(_0x516d4a['QjpcV'](_0x2da240,ApiError)&&_0x2da240[_0x1bdf23(0x18f)]===0x190&&_0x516d4a[_0x1bdf23(0x1d5)](_0x2da240['code'],_0x1bdf23(0x1f9)))return{'status':'not_configured','error':_0x2da240[_0x1bdf23(0x1c8)]};throw _0x2da240;}}export async function manualBrowserLogin(_0xa99169,_0x1a1346){const _0x3d9242=_0x3f1027,_0x2fa719={'jVSww':function(_0x3f003b,_0x3f066a){return _0x3f003b(_0x3f066a);},'vUTFO':function(_0x3bd37f){return _0x3bd37f();},'VpXqB':'close','zDIea':function(_0x233e92,_0x3e7a25){return _0x233e92+_0x3e7a25;},'loKMA':_0x3d9242(0x1d4),'RnEMs':_0x3d9242(0x1b8),'TXIGs':function(_0x3198a4,_0x26c730){return _0x3198a4>_0x26c730;},'vHqFE':'about:blank','gEEjJ':function(_0x3b7587,_0x298495){return _0x3b7587&&_0x298495;},'frvHX':_0x3d9242(0x196),'mXjrf':'POST'};if(!isInteractive())throw new Error(_0x2fa719[_0x3d9242(0x1c2)]('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0xa99169[_0x3d9242(0x1f0)]+_0x3d9242(0x1d0)+_0x2fa719['loKMA'],_0x2fa719['RnEMs']));const _0xe168ce=_0x1a1346&&_0x2fa719[_0x3d9242(0x1e0)](_0x1a1346['domains']['length'],0x0)?_0x1a1346[_0x3d9242(0x1e8)][0x0]:_0x2fa719['vHqFE'];console[_0x3d9242(0x1b1)]('\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.'),console[_0x3d9242(0x1b1)](_0x3d9242(0x1c4)),await new Promise(_0x30d1d0=>setTimeout(_0x30d1d0,0x7d0));const _0x364cf9=await chromium[_0x3d9242(0x1f8)]({'headless':![]});let _0x510126=null;try{const _0x453c3a={'ignoreHTTPSErrors':!![]};_0x1a1346?.['setupHeaders']&&(_0x453c3a['extraHTTPHeaders']=_0x1a1346['setupHeaders']);const _0x1cbd05=await _0x364cf9['newContext'](_0x453c3a);await addProfileSetupBanner(_0x1cbd05);const _0x163068=await _0x1cbd05[_0x3d9242(0x1e2)]();await _0x163068[_0x3d9242(0x1b9)](_0xe168ce);let _0x335077=![];await new Promise(_0x34d06e=>{const _0x5b725e=_0x3d9242,_0x514a81={'LaeyD':function(_0x14be9b,_0x4e9aed){return _0x14be9b/_0x4e9aed;},'YlkRs':function(_0x55ed64,_0x5a07c0){const _0x22835f=_0xb298;return _0x2fa719[_0x22835f(0x1e6)](_0x55ed64,_0x5a07c0);},'gjeCv':function(_0x1c6e08){const _0x2943c5=_0xb298;return _0x2fa719[_0x2943c5(0x1d9)](_0x1c6e08);}},_0x109d7c=setTimeout(()=>{_0x335077=!![],console['error']('Browser\x20login\x20timed\x20out\x20after\x20'+_0x514a81['LaeyD'](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+'\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.'),_0x34d06e();},MANUAL_LOGIN_TIMEOUT_MS);_0x163068['on'](_0x2fa719[_0x5b725e(0x1a9)],async()=>{const _0x492fc7=_0x5b725e;_0x514a81[_0x492fc7(0x198)](clearTimeout,_0x109d7c);try{const _0x293b64=await _0x1cbd05['storageState']();_0x510126=_0x293b64;}catch{}_0x514a81[_0x492fc7(0x194)](_0x34d06e);});});if(_0x2fa719[_0x3d9242(0x1ec)](_0x335077,!_0x510126))throw new Error('Browser\x20login\x20timed\x20out\x20before\x20completion.');}finally{await _0x364cf9['close']()[_0x3d9242(0x188)](()=>{});}if(!_0x510126)throw new Error(_0x2fa719['frvHX']);return await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0xa99169['name'])+_0x3d9242(0x197),{'method':_0x2fa719['mXjrf'],'body':JSON['stringify']({'session_state':_0x510126,'updated_by':_0x3d9242(0x1d3)})}),{'sessionState':_0x510126};}export async function promptSaveCredentials(_0x4a70c9){const _0x22fc92=_0x3f1027,_0x28b255={'BJFMY':function(_0x9f3f0d,_0x87dc3b){return _0x9f3f0d||_0x87dc3b;},'KRUEI':function(_0x51502a){return _0x51502a();},'LKtdS':'confirm','LkypW':function(_0x13a168,_0x2f3481){return _0x13a168(_0x2f3481);}},_0x2ab042=process[_0x22fc92(0x1e4)][_0x22fc92(0x1d2)],_0x816b55=process[_0x22fc92(0x1e4)]['RANGER_TEST_PASSWORD'];if(_0x28b255[_0x22fc92(0x1c6)](!_0x2ab042,!_0x816b55))return;if(!_0x28b255[_0x22fc92(0x1c7)](isInteractive))return;const {save:_0xc1229}=await _0x56722d[_0x22fc92(0x1bb)]([{'type':_0x28b255['LKtdS'],'name':'save','message':_0x22fc92(0x1b0),'default':![]}]);if(!_0xc1229)return;await apiRequest(_0x22fc92(0x1de)+_0x28b255[_0x22fc92(0x1ae)](encodeURIComponent,_0x4a70c9),{'method':_0x22fc92(0x1ef),'body':JSON[_0x22fc92(0x1a5)]({'username':_0x2ab042,'password':_0x816b55})}),console['log']('\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.');}export async function resolveCloudProfileSession(_0x1e7c3e,_0x31775b={}){const _0x5783fc=_0x3f1027,_0x2586f2={'bczEw':function(_0x34e854,_0x2cdee9,_0xd654a9){return _0x34e854(_0x2cdee9,_0xd654a9);},'plRDG':function(_0x4c55c6,_0x5ee9fa){return _0x4c55c6(_0x5ee9fa);},'lAFol':function(_0xb78f44,_0x11e184){return _0xb78f44(_0x11e184);},'eEbfR':function(_0xfd9bb3,_0x298ae6){return _0xfd9bb3||_0x298ae6;},'IyxFF':function(_0xf7a708,_0x4f4f18){return _0xf7a708(_0x4f4f18);},'HEmWh':function(_0x12522f,_0x506dc4){return _0x12522f===_0x506dc4;},'mOcal':'not_configured','RwgiV':'\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','QqguS':_0x5783fc(0x1aa),'OSBhF':function(_0xe8c4bc,_0x3083f1,_0xee5c7b,_0x3f2740,_0x384bd0,_0x2d7352,_0x46307d,_0x5b27e3){return _0xe8c4bc(_0x3083f1,_0xee5c7b,_0x3f2740,_0x384bd0,_0x2d7352,_0x46307d,_0x5b27e3);},'lJoTS':function(_0x599e18,_0x3e79c9){return _0x599e18&&_0x3e79c9;},'zSstH':function(_0x1f40a7,_0x338a89){return _0x1f40a7(_0x338a89);},'TAFwx':'\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','GBriM':function(_0x288760,_0x5d50ea){return _0x288760 instanceof _0x5d50ea;},'QtLag':function(_0x44c6cd,_0x449a72,_0x4e10da){return _0x44c6cd(_0x449a72,_0x4e10da);}},_0x47de05=_0x1e7c3e['settings']??{},_0x16ddc9=await fetchAuthConfig(),_0x4edf50=_0x16ddc9?_0x2586f2[_0x5783fc(0x1cd)](resolveAuthEnvironmentLocally,_0x16ddc9,_0x1e7c3e['environmentKey']):null,_0x2aa718=_0x4edf50?.[_0x5783fc(0x1e8)],_0x299a23=_0x47de05[_0x5783fc(0x1f3)],_0x44ac28=_0x299a23??_0x4edf50?.[_0x5783fc(0x1f3)],_0x200295=_0x31775b['effectiveBaseUrl']??_0x47de05['baseUrl']??(_0x2aa718&&_0x2aa718['length']>0x0?_0x2aa718[0x0]:''),_0x57dbae={'invalidateOn':_0x4edf50?.[_0x5783fc(0x1bf)],'userAgent':_0x4edf50?.['browserOptions']?.['userAgent']??_0x47de05['userAgent']},_0x4fc353=await checkLocalCache(_0x1e7c3e[_0x5783fc(0x1f0)],_0x1e7c3e['organizationId'],_0x200295,_0x44ac28,_0x57dbae);if(_0x4fc353){if(_0x200295){const _0x24e4ca=await isCachedSessionLive(_0x4fc353['storageStatePath'],_0x200295,{'sessionCheckPath':_0x4edf50?.['sessionCheckPath'],'setupHeaders':_0x44ac28},{'launchBrowser':launchRealBrowser});if(_0x24e4ca)return console['log'](_0x5783fc(0x1b3)+_0x1e7c3e['name']+'\x22'),{'authPath':_0x4fc353['storageStatePath'],'settings':_0x47de05,'resolvedEnv':_0x4edf50};console['log']('\x20\x20Cached\x20session\x20for\x20\x22'+_0x1e7c3e[_0x5783fc(0x1f0)]+_0x5783fc(0x1dc)),_0x2586f2[_0x5783fc(0x1cd)](emitSessionValidationHint,_0x200295,_0x4edf50);}else return{'authPath':_0x4fc353['storageStatePath'],'settings':_0x47de05,'resolvedEnv':_0x4edf50};}if(_0x1e7c3e['sessionState']){const _0xc0298a=await writeSessionToLocalCache(_0x1e7c3e[_0x5783fc(0x1f0)],_0x1e7c3e[_0x5783fc(0x1c1)],_0x200295,_0x44ac28,_0x1e7c3e['sessionState'],_0x2aa718,_0x57dbae);if(_0x200295){const _0x9ec4ef=await isCachedSessionLive(_0xc0298a,_0x200295,{'sessionCheckPath':_0x4edf50?.[_0x5783fc(0x1b7)],'setupHeaders':_0x44ac28},{'launchBrowser':launchRealBrowser});if(_0x9ec4ef)return console['log'](_0x5783fc(0x1a2)+_0x1e7c3e['name']+'\x22,\x20cached\x20locally'),{'authPath':_0xc0298a,'settings':_0x47de05,'resolvedEnv':_0x4edf50};console[_0x5783fc(0x1b1)]('\x20\x20Cloud\x20session\x20for\x20\x22'+_0x1e7c3e['name']+'\x22\x20failed\x20validation\x20—\x20re-login\x20needed...'),_0x2586f2['bczEw'](emitSessionValidationHint,_0x200295,_0x4edf50);}else return{'authPath':_0xc0298a,'settings':_0x47de05,'resolvedEnv':_0x4edf50};}console[_0x5783fc(0x1b1)](_0x5783fc(0x193)+_0x1e7c3e[_0x5783fc(0x1f0)]+'\x22,\x20attempting\x20login...');const _0xec4f34=_0x2586f2['plRDG'](Boolean,process[_0x5783fc(0x1e4)][_0x5783fc(0x1d2)])&&_0x2586f2[_0x5783fc(0x1a6)](Boolean,process[_0x5783fc(0x1e4)]['RANGER_TEST_PASSWORD']),_0x2db1de=Boolean(_0x1e7c3e['username']);if(_0x2586f2[_0x5783fc(0x1be)](_0xec4f34,_0x2db1de))try{const _0xcf4dfb=await _0x2586f2[_0x5783fc(0x19b)](serverSideLogin,_0x1e7c3e['name']);if(_0x2586f2[_0x5783fc(0x1cf)](_0xcf4dfb[_0x5783fc(0x18f)],_0x2586f2['mOcal']))console['log'](_0x2586f2[_0x5783fc(0x1e7)]);else{if(_0xcf4dfb[_0x5783fc(0x18f)]==='success'&&_0xcf4dfb['session_state']){console['log'](_0x2586f2[_0x5783fc(0x1f2)]);const _0xa24325=await _0x2586f2['OSBhF'](writeSessionToLocalCache,_0x1e7c3e[_0x5783fc(0x1f0)],_0x1e7c3e[_0x5783fc(0x1c1)],_0x200295,_0x44ac28,_0xcf4dfb[_0x5783fc(0x1a4)],_0x2aa718,_0x57dbae);return _0x2586f2['lJoTS'](_0xec4f34,!_0x2db1de)&&await _0x2586f2['zSstH'](promptSaveCredentials,_0x1e7c3e['name']),{'authPath':_0xa24325,'settings':_0x47de05,'resolvedEnv':_0x4edf50};}else _0xcf4dfb['test_output']&&(console[_0x5783fc(0x1b1)]('\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:'),console['log'](_0xcf4dfb['test_output'])),console['log'](_0x2586f2[_0x5783fc(0x1dd)]);}}catch(_0x3ec8e2){console['log']('\x20\x20Server-side\x20login\x20error:\x20'+(_0x2586f2['GBriM'](_0x3ec8e2,Error)?_0x3ec8e2['message']:String(_0x3ec8e2))),console[_0x5783fc(0x1b1)](_0x2586f2[_0x5783fc(0x1dd)]);}const {sessionState:_0x1dea65}=await _0x2586f2[_0x5783fc(0x1f7)](manualBrowserLogin,_0x1e7c3e,_0x4edf50),_0x7a21ff=await _0x2586f2['OSBhF'](writeSessionToLocalCache,_0x1e7c3e['name'],_0x1e7c3e['organizationId'],_0x200295,_0x44ac28,_0x1dea65,_0x2aa718,_0x57dbae);return{'authPath':_0x7a21ff,'settings':_0x47de05,'resolvedEnv':_0x4edf50};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x1defdc=_0x2f8f;(function(_0x26cbcf,_0x3fbfb1){const _0x4ad455=_0x2f8f,_0x135464=_0x26cbcf();while(!![]){try{const _0x1f48b9=parseInt(_0x4ad455(0x1ae))/0x1*(-parseInt(_0x4ad455(0x1a9))/0x2)+-parseInt(_0x4ad455(0x1b8))/0x3*(-parseInt(_0x4ad455(0x1a6))/0x4)+-parseInt(_0x4ad455(0x19a))/0x5+parseInt(_0x4ad455(0x1ad))/0x6*(-parseInt(_0x4ad455(0x1b1))/0x7)+-parseInt(_0x4ad455(0x1b3))/0x8+parseInt(_0x4ad455(0x195))/0x9*(-parseInt(_0x4ad455(0x197))/0xa)+parseInt(_0x4ad455(0x1bd))/0xb;if(_0x1f48b9===_0x3fbfb1)break;else _0x135464['push'](_0x135464['shift']());}catch(_0x39d9fd){_0x135464['push'](_0x135464['shift']());}}}(_0x21b5,0x3502c));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x15b71f=process['env'],_0x1ad120={'stdin':process['stdin'],'stdout':process[_0x1defdc(0x196)]}){const _0x58731e=_0x1defdc,_0x221c3a={'rUfWk':function(_0x2a4e0a,_0x855714){return _0x2a4e0a(_0x855714);}};if(_0x15b71f['CI'])return![];return _0x221c3a['rUfWk'](Boolean,_0x1ad120['stdin'][_0x58731e(0x1a5)])&&Boolean(_0x1ad120['stdout'][_0x58731e(0x1a5)]);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x48405b){const _0x8751f8=_0x1defdc,_0x30359d={'cIovC':'setupHeaders','WTydd':function(_0x226231,_0x530d7a){return _0x226231(_0x530d7a);},'rFeUB':_0x8751f8(0x1b9),'GTvDA':'clientIp','vWRiT':function(_0x4eb3e3,_0x41bde7){return _0x4eb3e3(_0x41bde7);},'snsuV':_0x8751f8(0x1a4),'gPTDJ':'hex'},_0x204692=new Set(_0x48405b[_0x8751f8(0x19f)]??DEFAULT_INVALIDATE_ON),_0x8a1dab={'orgId':_0x48405b[_0x8751f8(0x1c2)],'profileName':_0x48405b[_0x8751f8(0x19d)]};return _0x204692[_0x8751f8(0x1ba)]('baseUrl')&&(_0x8a1dab['effectiveBaseUrl']=_0x48405b[_0x8751f8(0x198)]),_0x204692[_0x8751f8(0x1ba)](_0x30359d['cIovC'])&&(_0x8a1dab['setupHeaders']=_0x48405b['setupHeaders']?_0x30359d['WTydd'](sortObjectKeys,_0x48405b[_0x8751f8(0x1b7)]):_0x48405b['setupHeaders']),_0x204692[_0x8751f8(0x1ba)](_0x30359d[_0x8751f8(0x1af)])&&(_0x8a1dab['port']=extractPort(_0x48405b[_0x8751f8(0x198)])),_0x204692['has']('userAgent')&&_0x48405b['userAgent']!==undefined&&(_0x8a1dab['userAgent']=_0x48405b['userAgent']),_0x204692[_0x8751f8(0x1ba)](_0x30359d['GTvDA'])&&_0x48405b[_0x8751f8(0x19b)]!==undefined&&(_0x8a1dab['clientIp']=_0x48405b[_0x8751f8(0x19b)]),_0x30359d[_0x8751f8(0x19e)](createHash,_0x30359d['snsuV'])['update'](JSON['stringify'](_0x8a1dab))['digest'](_0x30359d['gPTDJ'])[_0x8751f8(0x1be)](0x0,0xc);}function _0x2f8f(_0x3410d9,_0x3be87b){_0x3410d9=_0x3410d9-0x190;const _0x21b5d5=_0x21b5();let _0x2f8f73=_0x21b5d5[_0x3410d9];return _0x2f8f73;}function extractPort(_0x3afe36){try{return new URL(_0x3afe36)['port'];}catch{return'';}}function sortObjectKeys(_0x4567af){const _0x2c4c77=_0x1defdc,_0xdd361f={};for(const _0x3af315 of Object['keys'](_0x4567af)[_0x2c4c77(0x1a3)]()){_0xdd361f[_0x3af315]=_0x4567af[_0x3af315];}return _0xdd361f;}export function getSessionCachePath(_0x58ba4f,_0x150df0){const _0x4368be=_0x1defdc,_0x2cf684={'rgmAN':_0x4368be(0x199)};return join(getRangerHomeDir(),_0x2cf684['rgmAN'],_0x58ba4f+'-'+_0x150df0+_0x4368be(0x1a8));}export function getStorageStatePath(_0x1dc6a0){const _0x2c03dd=_0x1defdc,_0x87238d={'GXggC':_0x2c03dd(0x1b6)};return _0x1dc6a0[_0x2c03dd(0x1bc)](/\.json$/,_0x87238d['GXggC']);}function _0x21b5(){const _0x410b35=['invalidateOn','domain','status','sessionCheckPath','sort','sha256','isTTY','19464YJbTAg','close','.json','74JxwrSI','includes','environments','goto','604782lSeomS','137auuCkH','rFeUB','endsWith','21VUqEpl','.localhost','2538008lVEYvX','keys','JoXya','.storageState.json','setupHeaders','57dwHyDz','port','has','defaultEnvironmentKey','replace','11136631HHloJC','slice','toString','startsWith','length','orgId','hostname','iEaGv','newContext','pathname','push','add','174915fWzFrS','stdout','30mTkUdf','effectiveBaseUrl','auth','1023635ydMIZG','clientIp','test','profileName','vWRiT'];_0x21b5=function(){return _0x410b35;};return _0x21b5();}export function needsTunnel(_0x4b0e93){const _0x236acb=_0x1defdc,_0x32b797={'iEaGv':function(_0x5d9db6,_0x18e085){return _0x5d9db6===_0x18e085;}};let _0x7ebd67;try{_0x7ebd67=new URL(_0x4b0e93)['hostname'];}catch{return![];}if(_0x7ebd67==='localhost'||_0x32b797[_0x236acb(0x190)](_0x7ebd67,'127.0.0.1'))return!![];if(_0x7ebd67[_0x236acb(0x1b0)](_0x236acb(0x1b2)))return!![];if(_0x7ebd67[_0x236acb(0x1aa)]('localhost.'))return!![];return![];}export function hostnameOf(_0x47ffc9){const _0x5b0351=_0x1defdc;return new URL(_0x47ffc9)[_0x5b0351(0x1c3)];}export function duplicateCookiesForDomains(_0x44f282,_0x5c79d4){const _0x29079d=_0x1defdc,_0x94fd1b={'JoXya':function(_0xf6fac2,_0x19b2a3){return _0xf6fac2(_0x19b2a3);}},_0x5d5821=[..._0x44f282],_0x54e072=new Set(_0x44f282['map'](_0x50fccd=>_0x50fccd[_0x29079d(0x1a0)]));for(const _0x3051f2 of _0x5c79d4){let _0x10e9fc;try{_0x10e9fc=_0x94fd1b[_0x29079d(0x1b5)](hostnameOf,_0x3051f2);}catch{continue;}if(!_0x10e9fc)continue;const _0x2faf61=_0x10e9fc[_0x29079d(0x1c0)]('.')?_0x10e9fc:'.'+_0x10e9fc;if(_0x54e072['has'](_0x10e9fc)||_0x54e072[_0x29079d(0x1ba)](_0x2faf61))continue;for(const _0x486dfc of _0x44f282){_0x5d5821[_0x29079d(0x193)]({..._0x486dfc,'domain':_0x2faf61});}_0x54e072[_0x29079d(0x194)](_0x2faf61);}return _0x5d5821;}export function resolveAuthEnvironmentLocally(_0xbf7912,_0x4a4d4a){const _0x10c10c=_0x1defdc,_0x1fdb2a={'yhptq':function(_0x53040b,_0xbbcb76){return _0x53040b===_0xbbcb76;}},_0x1c69d8=_0xbf7912[_0x10c10c(0x1ab)];if(_0x4a4d4a){const _0x55afc7=_0x1c69d8[_0x4a4d4a];if(!_0x55afc7)return null;return{'key':_0x4a4d4a,..._0x55afc7};}if(_0xbf7912['defaultEnvironmentKey']){const _0x501828=_0x1c69d8[_0xbf7912['defaultEnvironmentKey']];if(!_0x501828)return null;return{'key':_0xbf7912[_0x10c10c(0x1bb)],..._0x501828};}const _0x5868a6=Object[_0x10c10c(0x1b4)](_0x1c69d8);if(_0x1fdb2a['yhptq'](_0x5868a6[_0x10c10c(0x1c1)],0x1)){const _0x15b3f3=_0x5868a6[0x0];return{'key':_0x15b3f3,..._0x1c69d8[_0x15b3f3]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x32c5a7,_0x219094){const _0x14e37d=_0x1defdc;try{if(_0x219094)return new URL(_0x219094,_0x32c5a7)[_0x14e37d(0x1bf)]();return new URL(_0x32c5a7)['toString']();}catch{return null;}}export function looksLikeLoginUrl(_0x480430){const _0x199672=_0x1defdc;try{const _0x1e5e5a=new URL(_0x480430);return LOGIN_URL_PATTERN[_0x199672(0x19c)](_0x1e5e5a[_0x199672(0x192)]);}catch{return LOGIN_URL_PATTERN[_0x199672(0x19c)](_0x480430);}}export async function isCachedSessionLive(_0x4261d3,_0x41925a,_0x1120e1={},_0x23f0ef={}){const _0x1d80fd=_0x1defdc,_0x24a499={'FOZgb':function(_0x341f75,_0xa5ddd3){return _0x341f75===_0xa5ddd3;},'ssyoV':function(_0x2c0f82,_0x129d0d){return _0x2c0f82===_0x129d0d;},'VZAal':function(_0xe8be3d,_0x36913c){return _0xe8be3d(_0x36913c);}},_0x12ef2d=buildSessionCheckUrl(_0x41925a,_0x1120e1[_0x1d80fd(0x1a2)]);if(!_0x12ef2d)return!![];if(!_0x23f0ef['launchBrowser'])return!![];let _0x3f0c44=null;try{_0x3f0c44=await _0x23f0ef['launchBrowser']();const _0x1751d5=await _0x3f0c44[_0x1d80fd(0x191)]({'storageState':_0x4261d3,'ignoreHTTPSErrors':!![],..._0x1120e1[_0x1d80fd(0x1b7)]?{'extraHTTPHeaders':_0x1120e1[_0x1d80fd(0x1b7)]}:{}}),_0x462170=await _0x1751d5['newPage'](),_0x27b271=await _0x462170[_0x1d80fd(0x1ac)](_0x12ef2d,{'waitUntil':'domcontentloaded','timeout':0x3a98}),_0x4cc32d=_0x27b271?.[_0x1d80fd(0x1a1)]();if(_0x24a499['FOZgb'](_0x4cc32d,0x191)||_0x24a499['ssyoV'](_0x4cc32d,0x193))return![];const _0x3e6d8b=_0x462170['url']();if(_0x24a499['VZAal'](looksLikeLoginUrl,_0x3e6d8b))return![];return!![];}catch{return![];}finally{if(_0x3f0c44)await _0x3f0c44[_0x1d80fd(0x1a7)]()['catch'](()=>{});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const _0x1f60f6=_0x34ac;(function(_0x572dd4,_0x598bbb){const _0x3ce15f=_0x34ac,_0x385596=_0x572dd4();while(!![]){try{const _0x37ca5b=-parseInt(_0x3ce15f(0xe4))/0x1+-parseInt(_0x3ce15f(0xec))/0x2+parseInt(_0x3ce15f(0xed))/0x3+parseInt(_0x3ce15f(0xe6))/0x4*(-parseInt(_0x3ce15f(0xe7))/0x5)+parseInt(_0x3ce15f(0xea))/0x6*(-parseInt(_0x3ce15f(0xe3))/0x7)+parseInt(_0x3ce15f(0xf0))/0x8*(parseInt(_0x3ce15f(0xee))/0x9)+parseInt(_0x3ce15f(0xe9))/0xa;if(_0x37ca5b===_0x598bbb)break;else _0x385596['push'](_0x385596['shift']());}catch(_0x41c850){_0x385596['push'](_0x385596['shift']());}}}(_0x16a6,0xc56cd));import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';function _0x16a6(){const _0x280209=['update','ZKrMe','final','KpIFQ','glwQm','utf8','21rjrBMY','119281Sgmotu','aes-256-gcm','16zHxbLB','1338605zbxaDf','getAuthTag','3301430VDdNHZ','221592AOCSgR','concat','795552wZSKEI','2456583bkhwNl','18ackSuG','subarray','5433544xtqfYr'];_0x16a6=function(){return _0x280209;};return _0x16a6();}const ALGORITHM=_0x1f60f6(0xe5),SALT='ranger-auth-encryption',KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;function _0x34ac(_0x23f88a,_0x569cd0){_0x23f88a=_0x23f88a-0xe3;const _0x16a6cc=_0x16a6();let _0x34ac25=_0x16a6cc[_0x23f88a];return _0x34ac25;}export function deriveKey(_0x1d821e){const _0x1128ca=_0x1f60f6,_0x268991={'glwQm':function(_0x240b76,_0x4c5a95,_0x5341c5,_0x408d5b,_0x1e2f10,_0x58c982){return _0x240b76(_0x4c5a95,_0x5341c5,_0x408d5b,_0x1e2f10,_0x58c982);}};return _0x268991[_0x1128ca(0xf5)](pbkdf2Sync,_0x1d821e,SALT,0x186a0,KEY_LENGTH,'sha256');}export function encrypt(_0x5ded5b,_0x237300){const _0x26611d=_0x1f60f6,_0x5037b9={'WfyDt':function(_0xe7bf4e,_0x33b94c){return _0xe7bf4e(_0x33b94c);},'ZKrMe':function(_0x509b2e,_0x3d3a48){return _0x509b2e(_0x3d3a48);},'BBPip':'utf8'},_0xbc706a=_0x5037b9['WfyDt'](deriveKey,_0x237300),_0xc5bfaa=_0x5037b9[_0x26611d(0xf2)](randomBytes,IV_LENGTH),_0x3f92bd=createCipheriv(ALGORITHM,_0xbc706a,_0xc5bfaa),_0x8c505=Buffer[_0x26611d(0xeb)]([_0x3f92bd[_0x26611d(0xf1)](_0x5ded5b,_0x5037b9['BBPip']),_0x3f92bd[_0x26611d(0xf3)]()]),_0x4172d0=_0x3f92bd[_0x26611d(0xe8)]();return Buffer['concat']([_0xc5bfaa,_0x4172d0,_0x8c505]);}export function decrypt(_0x471504,_0x3a0c8f){const _0x474e40=_0x1f60f6,_0x307fe5={'KpIFQ':function(_0x114af3,_0x67afe9,_0x3a561d,_0x3e7a40){return _0x114af3(_0x67afe9,_0x3a561d,_0x3e7a40);}},_0x529342=deriveKey(_0x3a0c8f),_0x1c6b09=_0x471504[_0x474e40(0xef)](0x0,IV_LENGTH),_0x19b958=_0x471504['subarray'](IV_LENGTH,IV_LENGTH+TAG_LENGTH),_0x16c726=_0x471504[_0x474e40(0xef)](IV_LENGTH+TAG_LENGTH),_0x49b012=_0x307fe5[_0x474e40(0xf4)](createDecipheriv,ALGORITHM,_0x529342,_0x1c6b09);return _0x49b012['setAuthTag'](_0x19b958),_0x49b012[_0x474e40(0xf1)](_0x16c726)+_0x49b012['final'](_0x474e40(0xf6));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const _0x64f26a=_0x37b6;(function(_0x5e3857,_0x242818){const _0x406bf3=_0x37b6,_0x50e1dc=_0x5e3857();while(!![]){try{const _0xe7ab48=parseInt(_0x406bf3(0x17c))/0x1*(-parseInt(_0x406bf3(0x16b))/0x2)+-parseInt(_0x406bf3(0x192))/0x3*(parseInt(_0x406bf3(0x171))/0x4)+parseInt(_0x406bf3(0x186))/0x5+-parseInt(_0x406bf3(0x178))/0x6*(-parseInt(_0x406bf3(0x16e))/0x7)+-parseInt(_0x406bf3(0x173))/0x8*(-parseInt(_0x406bf3(0x16f))/0x9)+parseInt(_0x406bf3(0x177))/0xa+parseInt(_0x406bf3(0x176))/0xb*(-parseInt(_0x406bf3(0x17e))/0xc);if(_0xe7ab48===_0x242818)break;else _0x50e1dc['push'](_0x50e1dc['shift']());}catch(_0x592a52){_0x50e1dc['push'](_0x50e1dc['shift']());}}}(_0x28a1,0xaefbf));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';function _0x37b6(_0x4949af,_0x43a43f){_0x4949af=_0x4949af-0x16b;const _0x28a11b=_0x28a1();let _0x37b631=_0x28a11b[_0x4949af];return _0x37b631;}import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set([_0x64f26a(0x17b),'-t',_0x64f26a(0x172),_0x64f26a(0x18e),'--apikey',_0x64f26a(0x196),_0x64f26a(0x19a),_0x64f26a(0x16c),'--auth',_0x64f26a(0x181),_0x64f26a(0x18f),_0x64f26a(0x19c),_0x64f26a(0x179)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0x1b49c1){const _0x5d1ff2=_0x64f26a;return TOKEN_PATTERNS[_0x5d1ff2(0x195)](_0x18b1e1=>_0x18b1e1['test'](_0x1b49c1));}function _0x28a1(){const _0x17af13=['--password','toLowerCase','--cookie','[REDACTED]','no_token','naLTm','368916oFApKH','--pass','has_token','49kufPFp','2390103fAdJDK','has','304336ThBjOB','--secret','24YuvrFA','startsWith','isTTY','22IcRzFd','4477470pGgXBm','1166010BfDrum','--credentials','DEBUG','--token','3AtKvVC','missing_required_argument','11175348Fvtjht','pdsps','application/json','--authorization','bTSzS','split','syntax_error','POST','3019790WyLRmc','featureId','includes','invalid_option_value','push','catch','0|3|5|2|7|6|4|1','[desire-path]\x20Sending\x20log\x20to\x20','--api-key','--header','HrJWU','env','3Wfytxg','gTrjW','EUjRY','some','--key','join','=[REDACTED]','errorMessage'];_0x28a1=function(){return _0x17af13;};return _0x28a1();}export function sanitizeArgs(_0x21343e){const _0x2657b0=_0x64f26a,_0x5e66de={'fPHQW':function(_0x53d524,_0x5ebfab){return _0x53d524<_0x5ebfab;},'jeXcU':_0x2657b0(0x19d),'xRrGG':function(_0x1bafef,_0x1f4614){return _0x1bafef!==_0x1f4614;},'EUjRY':function(_0x5d0ec4,_0x388d80){return _0x5d0ec4(_0x388d80);}},_0x30f672=[];let _0x3138e9=![];for(let _0x5c3cba=0x0;_0x5e66de['fPHQW'](_0x5c3cba,_0x21343e['length']);_0x5c3cba++){const _0x17944d=_0x21343e[_0x5c3cba];if(_0x3138e9){_0x30f672['push'](_0x5e66de['jeXcU']),_0x3138e9=![];continue;}if(_0x17944d[_0x2657b0(0x174)]('--')||_0x17944d[_0x2657b0(0x174)]('-')){const _0x153a74=_0x17944d['indexOf']('=');if(_0x5e66de['xRrGG'](_0x153a74,-0x1)){const _0x492876=_0x17944d['slice'](0x0,_0x153a74)['toLowerCase']();if(SENSITIVE_FLAGS['has'](_0x492876)){_0x30f672[_0x2657b0(0x18a)](_0x17944d['slice'](0x0,_0x153a74)+_0x2657b0(0x198));continue;}}else{const _0x1a93d0=_0x17944d[_0x2657b0(0x19b)]();SENSITIVE_FLAGS[_0x2657b0(0x170)](_0x1a93d0)&&(_0x3138e9=!![]);}_0x30f672[_0x2657b0(0x18a)](_0x17944d);}else _0x5e66de[_0x2657b0(0x194)](looksLikeToken,_0x17944d)?_0x30f672['push'](_0x5e66de['jeXcU']):_0x30f672[_0x2657b0(0x18a)](_0x17944d);}return _0x30f672[_0x2657b0(0x197)]('\x20');}export async function logDesirePath(_0x115781){const _0x1fa8e2=_0x64f26a,_0x42b9b0={'pdsps':function(_0x350a91){return _0x350a91();},'gTrjW':_0x1fa8e2(0x16d),'cUxcp':'Authorization'};try{const _0x17ef75=await _0x42b9b0['pdsps'](getToken)[_0x1fa8e2(0x18b)](()=>null),_0x168a2b=_0x42b9b0['pdsps'](getApiBaseUrl),_0x32c95d=_0x42b9b0[_0x1fa8e2(0x17f)](getCurrentVersion),_0x13adff=_0x17ef75?_0x42b9b0[_0x1fa8e2(0x193)]:_0x1fa8e2(0x19e),_0x5b33a7={..._0x115781['metadata'],'authStatus':_0x13adff,'isTty':process['stdout'][_0x1fa8e2(0x175)]??![]},_0xd11e01={'Content-Type':_0x1fa8e2(0x180)};_0x17ef75&&(_0xd11e01[_0x42b9b0['cUxcp']]='Bearer\x20'+_0x17ef75);const _0x511ba1={'rawCommand':_0x115781['rawCommand'],'errorMessage':_0x115781[_0x1fa8e2(0x199)],'errorType':_0x115781['errorType'],'featureId':_0x115781[_0x1fa8e2(0x187)],'sessionId':_0x115781['sessionId'],'metadata':_0x5b33a7,'cliVersion':_0x32c95d};process[_0x1fa8e2(0x191)][_0x1fa8e2(0x17a)]&&(console['error'](_0x1fa8e2(0x18d)+_0x168a2b+'/api/v1/mcp/desire-path-logs'),console['error']('[desire-path]\x20Payload:\x20'+JSON['stringify'](_0x511ba1,null,0x2))),await fetch(_0x168a2b+'/api/v1/mcp/desire-path-logs',{'method':_0x1fa8e2(0x185),'headers':_0xd11e01,'body':JSON['stringify'](_0x511ba1)});}catch(_0x32d380){process[_0x1fa8e2(0x191)][_0x1fa8e2(0x17a)]&&console['error']('[desire-path]\x20Failed\x20to\x20send:\x20'+_0x32d380);}}export function getErrorType(_0x1ec305,_0x9229c6){const _0x3b895e=_0x64f26a,_0x77996b={'naLTm':'Unknown\x20argument','HrJWU':'unknown_argument','bTSzS':'unknown','fsQfp':'Not\x20enough\x20non-option\x20arguments','XutQf':_0x3b895e(0x17d)},_0x7a5422=_0x3b895e(0x18c)[_0x3b895e(0x183)]('|');let _0x193fcc=0x0;while(!![]){switch(_0x7a5422[_0x193fcc++]){case'0':if(_0x9229c6)return'runtime_error';continue;case'1':return _0x3b895e(0x184);case'2':if(_0x1ec305[_0x3b895e(0x188)](_0x77996b[_0x3b895e(0x19f)]))return _0x77996b[_0x3b895e(0x190)];continue;case'3':if(!_0x1ec305)return _0x77996b[_0x3b895e(0x182)];continue;case'4':if(_0x1ec305['includes']('Missing\x20required\x20argument'))return'missing_option';continue;case'5':if(_0x1ec305['includes']('Unknown\x20command'))return'unknown_command';continue;case'6':if(_0x1ec305[_0x3b895e(0x188)]('Invalid\x20values'))return _0x3b895e(0x189);continue;case'7':if(_0x1ec305['includes'](_0x77996b['fsQfp']))return _0x77996b['XutQf'];continue;}break;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xb64aff,_0x1cf71a){const _0x2d6378=_0x23f7,_0x1704a4=_0xb64aff();while(!![]){try{const _0x25db56=-parseInt(_0x2d6378(0x11e))/0x1+parseInt(_0x2d6378(0xf4))/0x2+parseInt(_0x2d6378(0xe4))/0x3+parseInt(_0x2d6378(0x131))/0x4*(-parseInt(_0x2d6378(0xfe))/0x5)+parseInt(_0x2d6378(0x12a))/0x6*(-parseInt(_0x2d6378(0xec))/0x7)+-parseInt(_0x2d6378(0xef))/0x8+parseInt(_0x2d6378(0x12b))/0x9;if(_0x25db56===_0x1cf71a)break;else _0x1704a4['push'](_0x1704a4['shift']());}catch(_0x1ba57c){_0x1704a4['push'](_0x1704a4['shift']());}}}(_0x51ab,0x4a420));import{spawn}from'child_process';function _0x23f7(_0x53bf9b,_0x29ccab){_0x53bf9b=_0x53bf9b-0xdf;const _0x51ab70=_0x51ab();let _0x23f745=_0x51ab70[_0x53bf9b];return _0x23f745;}import _0xc53e52 from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL='https://api.workos.com/user_management/authorize/device',WORKOS_TOKEN_URL='https://api.workos.com/user_management/authenticate';export async function requestDeviceCode(_0xf2566d){const _0x1fda72=_0x23f7,_0x2bb6e4={'AhQIQ':'POST','cqFos':_0x1fda72(0x102)},_0x1c1b05=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x2bb6e4['AhQIQ'],'headers':{'Content-Type':_0x2bb6e4[_0x1fda72(0x12e)]},'body':new URLSearchParams({'client_id':_0xf2566d})});if(!_0x1c1b05['ok']){const _0x24ced5=await _0x1c1b05['text']();throw new Error('Failed\x20to\x20request\x20device\x20code:\x20'+_0x1c1b05[_0x1fda72(0x100)]+'\x20'+_0x24ced5);}return _0x1c1b05['json']();}export async function pollForTokens(_0x1eb53f,_0x2ac427,_0x310732,_0x41a825){const _0x3d41b8=_0x23f7,_0x40e9c6={'mjUXz':function(_0x371722,_0x21e504){return _0x371722*_0x21e504;},'OoTsh':function(_0x2de37b,_0x2a9073){return _0x2de37b*_0x2a9073;},'wtoVj':function(_0x233135,_0x1ab640){return _0x233135<_0x1ab640;},'aSIQQ':_0x3d41b8(0x102),'MtHkZ':_0x3d41b8(0x115),'oNUaX':function(_0x2731c5,_0x3f4bca){return _0x2731c5===_0x3f4bca;},'TmpJi':_0x3d41b8(0xf5),'IFucC':'Device\x20authorization\x20timed\x20out'},_0x5e9f4c=Date['now']()+_0x40e9c6['mjUXz'](_0x41a825,0x3e8);let _0x51d2ee=_0x40e9c6[_0x3d41b8(0xe6)](_0x310732,0x3e8);while(_0x40e9c6[_0x3d41b8(0xe8)](Date['now'](),_0x5e9f4c)){await sleep(_0x51d2ee);const _0xb1a87b=await fetch(WORKOS_TOKEN_URL,{'method':_0x3d41b8(0x116),'headers':{'Content-Type':_0x40e9c6['aSIQQ']},'body':new URLSearchParams({'client_id':_0x1eb53f,'device_code':_0x2ac427,'grant_type':_0x40e9c6[_0x3d41b8(0xed)]})});if(_0xb1a87b['ok'])return _0xb1a87b['json']();const _0x478c15=await _0xb1a87b[_0x3d41b8(0x10f)]();if(_0x478c15[_0x3d41b8(0x11b)]==='authorization_pending')continue;if(_0x40e9c6['oNUaX'](_0x478c15[_0x3d41b8(0x11b)],_0x3d41b8(0x126))){_0x51d2ee+=0x3e8;continue;}throw new Error(_0x478c15[_0x3d41b8(0x113)]||_0x478c15[_0x3d41b8(0x11b)]||_0x40e9c6['TmpJi']);}throw new Error(_0x40e9c6[_0x3d41b8(0xf8)]);}async function fetchUserProfile(_0x391d06){const _0x137ec5=_0x23f7,_0x402967={'aFrqT':'GET'},_0x4d64ef=getApiBaseUrl();try{const _0x40b32a=await fetch(_0x4d64ef+_0x137ec5(0x11f),{'method':_0x402967[_0x137ec5(0x103)],'headers':{'workos-token':_0x391d06}});if(_0x40b32a['ok'])return _0x40b32a['json']();}catch{}return null;}function buildKeyName(_0x1e3013,_0x25abd4){const _0x4c582d=_0x23f7,_0x1948a4={'aVbjD':function(_0x148e2f,_0x2ed5cc){return _0x148e2f+_0x2ed5cc;}},_0x26b9b6=_0x25abd4['filter'](_0x5664a6=>_0x5664a6[_0x4c582d(0x11a)]===_0x1e3013||_0x5664a6['name'][_0x4c582d(0x124)](_0x1e3013+'\x20('));if(_0x26b9b6[_0x4c582d(0xdf)]===0x0)return _0x1e3013;return _0x1e3013+'\x20('+_0x1948a4[_0x4c582d(0x112)](_0x26b9b6['length'],0x1)+')';}export async function provisionApiKey(_0x323301){const _0xc799c6=_0x23f7,_0x3a8c79={'JRgQa':function(_0x3660b0){return _0x3660b0();},'GsZyR':function(_0x19239b,_0x48ee2a){return _0x19239b(_0x48ee2a);},'kqNwG':_0xc799c6(0x119),'oidPM':'GET','TdBSy':function(_0x46aa2e,_0xb05508,_0xe9bf8e){return _0x46aa2e(_0xb05508,_0xe9bf8e);},'DIbxS':'mcp:write'},_0x1441b8=_0x3a8c79['JRgQa'](getApiBaseUrl),_0x5eab55={'Content-Type':_0xc799c6(0x128),'workos-token':_0x323301},_0x10ff51=await _0x3a8c79[_0xc799c6(0x10a)](fetchUserProfile,_0x323301),_0x55e718=_0x10ff51?.['firstName']||_0x10ff51?.[_0xc799c6(0x101)]?.['split']('@')[0x0],_0x205bd0=_0x55e718?_0x55e718+'\x27s\x20CLI\x20Key':_0x3a8c79['kqNwG'];let _0x429a4f=[];try{const _0x221c1a=await fetch(_0x1441b8+_0xc799c6(0xf7),{'method':_0x3a8c79['oidPM'],'headers':_0x5eab55});if(_0x221c1a['ok']){const _0xcce9b1=await _0x221c1a['json']();_0x429a4f=_0xcce9b1['apiKeys'];}}catch{}const _0x5385f3=_0x3a8c79['TdBSy'](buildKeyName,_0x205bd0,_0x429a4f),_0x1e75f1=await _0x3a8c79[_0xc799c6(0x122)](fetch,_0x1441b8+_0xc799c6(0xf7),{'method':_0xc799c6(0x116),'headers':_0x5eab55,'body':JSON['stringify']({'name':_0x5385f3,'scope':_0x3a8c79['DIbxS']})});if(!_0x1e75f1['ok']){const _0x171ee6=await _0x1e75f1[_0xc799c6(0xf3)]();throw new Error(_0xc799c6(0x125)+_0x1e75f1['status']+'\x20'+_0x171ee6);}const _0xc2c701=await _0x1e75f1[_0xc799c6(0x10f)]();return _0xc2c701['apiKey']['token'];}export function openBrowser(_0x33a17b){const _0x30a7fa=_0x23f7,_0x2ed8d1={'UnGEm':function(_0x53b946,_0x511c6e){return _0x53b946===_0x511c6e;},'mJoGn':_0x30a7fa(0x123),'muNLB':'start','OrieN':'open','qeUtJ':'xdg-open','ycYJG':'ignore'};try{if(_0x2ed8d1[_0x30a7fa(0xfa)](process[_0x30a7fa(0x114)],_0x2ed8d1[_0x30a7fa(0x12f)])){const _0x238dcf=spawn(_0x30a7fa(0x10d),['/c',_0x2ed8d1['muNLB'],'',_0x33a17b],{'detached':!![],'stdio':_0x30a7fa(0xe3),'windowsHide':!![]});_0x238dcf['unref']();return;}const _0x340013=process['platform']===_0x30a7fa(0xff)?_0x2ed8d1[_0x30a7fa(0x105)]:_0x2ed8d1[_0x30a7fa(0xe1)],_0x195cd0=spawn(_0x340013,[_0x33a17b],{'detached':!![],'stdio':_0x2ed8d1['ycYJG']});_0x195cd0['unref']();}catch{}}function _0x51ab(){const _0x5196d4=['organizationId','json','rWfPC','VBasb','aVbjD','error_description','platform','urn:ietf:params:oauth:grant-type:device_code','POST','Provisioning\x20CLI\x20token...','Select\x20an\x20organization:','CLI\x20Key','name','error','mdzLu','CCtEW','332320HWvlyT','/organization/me','refresh_token','\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','TdBSy','win32','startsWith','Failed\x20to\x20provision\x20API\x20key:\x20','slow_down','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20','application/json','write','2406pEbOsl','1284003bHQCbT','/organization/self-serve-signup','kWoyr','cqFos','mJoGn','toString','28004yAMbpn','length','Code:\x20','qeUtJ','access_token','ignore','1260006mLKUnM','workosClientId','OoTsh','Invalid\x20JWT\x20format','wtoVj','QvsUP','DLWuu','gYhyJ','1099dwYxJt','MtHkZ','stdin','1357544FsRcoG','log','/organization/my-memberships','selected','text','906964fuABpa','Authentication\x20failed','parse','/api-keys','IFucC','/cli-auth/token','UnGEm','interval','token','GET','105UvDejO','darwin','status','email','application/x-www-form-urlencoded','aFrqT','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20','OrieN','list','utf-8','Waiting\x20for\x20authentication...','pFyYu','GsZyR','stdout','isTTY','cmd'];_0x51ab=function(){return _0x5196d4;};return _0x51ab();}function decodeJwtPayload(_0x5a9030){const _0x5f3890=_0x23f7,_0x27842a={'CCtEW':_0x5f3890(0xe7),'gYhyJ':'base64url','pFyYu':_0x5f3890(0x107)},_0x1a30b1=_0x5a9030['split']('.');if(_0x1a30b1[_0x5f3890(0xdf)]!==0x3)throw new Error(_0x27842a[_0x5f3890(0x11d)]);const _0x39ef98=Buffer['from'](_0x1a30b1[0x1],_0x27842a[_0x5f3890(0xeb)])[_0x5f3890(0x130)](_0x27842a[_0x5f3890(0x109)]);return JSON[_0x5f3890(0xf6)](_0x39ef98);}async function selfServeSignup(_0x4fc43f){const _0x236d36=_0x23f7,_0x455ecd={'SylCw':function(_0x441c20){return _0x441c20();},'VBasb':function(_0x1e891,_0x1c4f2c,_0x2c7866){return _0x1e891(_0x1c4f2c,_0x2c7866);}},_0x433c2e=_0x455ecd['SylCw'](getApiBaseUrl),_0xee6d0e=await _0x455ecd[_0x236d36(0x111)](fetch,_0x433c2e+_0x236d36(0x12c),{'method':'POST','headers':{'Content-Type':'application/json','workos-token':_0x4fc43f}});if(!_0xee6d0e['ok']){const _0x49f7bd=await _0xee6d0e[_0x236d36(0xf3)]();throw new Error('Failed\x20to\x20create\x20organization:\x20'+_0xee6d0e['status']+'\x20'+_0x49f7bd);}return _0xee6d0e['json']();}async function fetchMyMemberships(_0x46caae){const _0x53d9f3=_0x23f7,_0x2aaa70={'Gfdra':function(_0x5eda53){return _0x5eda53();}},_0x216607=_0x2aaa70['Gfdra'](getApiBaseUrl),_0x62c999=await fetch(_0x216607+_0x53d9f3(0xf1),{'method':_0x53d9f3(0xfd),'headers':{'workos-token':_0x46caae}});if(!_0x62c999['ok']){const _0x354781=await _0x62c999['text']();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0x62c999['status']+'\x20'+_0x354781);}const _0x4094ff=await _0x62c999[_0x53d9f3(0x10f)]();return _0x4094ff['memberships'];}async function refreshTokenWithOrg(_0x3e42b6,_0x1a9d61,_0x28e38a){const _0x4a4f5d=_0x23f7,_0x1d9335={'KFCYe':'refresh_token'},_0x297748=await fetch(WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':_0x4a4f5d(0x102)},'body':new URLSearchParams({'client_id':_0x3e42b6,'grant_type':_0x1d9335['KFCYe'],'refresh_token':_0x1a9d61,'organization_id':_0x28e38a})});if(!_0x297748['ok']){const _0x2a719d=await _0x297748['text']();throw new Error(_0x4a4f5d(0x127)+_0x297748[_0x4a4f5d(0x100)]+'\x20'+_0x2a719d);}return _0x297748[_0x4a4f5d(0x10f)]();}async function provisionCliToken(_0x386786){const _0x2fa11c=_0x23f7,_0x50ec8c={'yXNjD':_0x2fa11c(0x128)},_0x4ef734=getApiBaseUrl(),_0x406d62=await fetch(_0x4ef734+_0x2fa11c(0xf9),{'method':'POST','headers':{'Content-Type':_0x50ec8c['yXNjD'],'workos-token':_0x386786}});if(!_0x406d62['ok']){const _0x32a066=await _0x406d62[_0x2fa11c(0xf3)]();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x406d62[_0x2fa11c(0x100)]+'\x20'+_0x32a066);}return _0x406d62['json']();}export async function runDeviceAuthFlow(){const _0x280aec=_0x23f7,_0x300a75={'Zqdpu':function(_0x282ee8){return _0x282ee8();},'NTBdx':function(_0x204f01,_0x129194){return _0x204f01(_0x129194);},'kWoyr':_0x280aec(0x108),'RARnI':function(_0x585bb5,_0x241761){return _0x585bb5(_0x241761);},'rWfPC':function(_0x444085,_0x32b6f9){return _0x444085===_0x32b6f9;},'gIVIm':function(_0xbc8be7,_0x5c8c4e){return _0xbc8be7(_0x5c8c4e);},'mdzLu':'Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','QvsUP':_0x280aec(0x106),'DLWuu':_0x280aec(0xf2),'CQtHC':function(_0x2b49b3,_0x3abff8){return _0x2b49b3(_0x3abff8);}},_0x319a5c=_0x300a75['Zqdpu'](getCurrentEnvironment),_0x95ff6a=ENVIRONMENT_CONFIGS[_0x319a5c][_0x280aec(0xe5)],_0x350509=await _0x300a75['NTBdx'](requestDeviceCode,_0x95ff6a);console['log'](_0x280aec(0x121)),console[_0x280aec(0xf0)]('\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a'),openBrowser(_0x350509['verification_uri_complete']),console['log'](_0x280aec(0x104)+_0x350509['verification_uri_complete']),console[_0x280aec(0xf0)](_0x280aec(0xe0)+_0x350509['user_code']+'\x0a'),process[_0x280aec(0x10b)]['write'](_0x300a75[_0x280aec(0x12d)]);let _0x50654a=await pollForTokens(_0x95ff6a,_0x350509['device_code'],_0x350509[_0x280aec(0xfb)],_0x350509['expires_in']);console['log']('\x20✓');const _0x49d8a1=_0x300a75['RARnI'](decodeJwtPayload,_0x50654a[_0x280aec(0xe2)]);if(!_0x49d8a1['org_id']){const _0x1f7815=await fetchMyMemberships(_0x50654a[_0x280aec(0xe2)]);let _0x113635;if(_0x300a75[_0x280aec(0x110)](_0x1f7815['length'],0x0)){process['stdout']['write']('Setting\x20up\x20your\x20organization...');const _0x133797=await _0x300a75['gIVIm'](selfServeSignup,_0x50654a[_0x280aec(0xe2)]);_0x113635=_0x133797[_0x280aec(0x10e)],console['log']('\x20✓');}else{if(_0x1f7815['length']===0x1)_0x113635=_0x1f7815[0x0][_0x280aec(0x10e)],console[_0x280aec(0xf0)]('Using\x20organization:\x20'+_0x1f7815[0x0][_0x280aec(0x11a)]);else{const _0x149d5f=process[_0x280aec(0xee)][_0x280aec(0x10c)]&&process['stdout'][_0x280aec(0x10c)];if(!_0x149d5f)throw new Error(_0x300a75[_0x280aec(0x11c)]+'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.');const {selected:_0x5e1e71}=await _0xc53e52['prompt']([{'type':_0x300a75[_0x280aec(0xe9)],'name':_0x300a75[_0x280aec(0xea)],'message':_0x280aec(0x118),'choices':_0x1f7815['map'](_0xc9f1c1=>({'name':_0xc9f1c1['name'],'value':_0xc9f1c1['organizationId']}))}]);_0x113635=_0x5e1e71;}}_0x50654a=await refreshTokenWithOrg(_0x95ff6a,_0x50654a[_0x280aec(0x120)],_0x113635);}process[_0x280aec(0x10b)][_0x280aec(0x129)](_0x280aec(0x117));const _0x5a49a6=await provisionCliToken(_0x50654a['access_token']);return console['log']('\x20✓'),await storeToken(_0x5a49a6['token']),_0x50654a['refresh_token']&&await _0x300a75['CQtHC'](storeRefreshToken,_0x50654a[_0x280aec(0x120)]),_0x5a49a6[_0x280aec(0xfc)];}function sleep(_0x32e535){return new Promise(_0x350a64=>setTimeout(_0x350a64,_0x32e535));}
|
|
1
|
+
const _0x3079c0=_0x6896;(function(_0x275fee,_0x1286a3){const _0xc6a615=_0x6896,_0x51fb3d=_0x275fee();while(!![]){try{const _0x23b49f=-parseInt(_0xc6a615(0x120))/0x1*(-parseInt(_0xc6a615(0x119))/0x2)+parseInt(_0xc6a615(0x121))/0x3+-parseInt(_0xc6a615(0x150))/0x4+parseInt(_0xc6a615(0x13d))/0x5*(-parseInt(_0xc6a615(0x110))/0x6)+parseInt(_0xc6a615(0x111))/0x7*(-parseInt(_0xc6a615(0x10a))/0x8)+-parseInt(_0xc6a615(0x134))/0x9+parseInt(_0xc6a615(0x132))/0xa;if(_0x23b49f===_0x1286a3)break;else _0x51fb3d['push'](_0x51fb3d['shift']());}catch(_0x2b9a76){_0x51fb3d['push'](_0x51fb3d['shift']());}}}(_0x6d35,0x48dc1));import{spawn}from'child_process';import _0x55ccba from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL=_0x3079c0(0x12b),WORKOS_TOKEN_URL='https://api.workos.com/user_management/authenticate';export async function requestDeviceCode(_0xc98650){const _0x62f824=_0x3079c0,_0x495cc0={'VhuvB':function(_0x5772c2,_0x1d3657,_0x1b3c71){return _0x5772c2(_0x1d3657,_0x1b3c71);},'Jseaq':'POST'},_0x1b844c=await _0x495cc0['VhuvB'](fetch,WORKOS_DEVICE_AUTH_URL,{'method':_0x495cc0['Jseaq'],'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0xc98650})});if(!_0x1b844c['ok']){const _0x2dead3=await _0x1b844c['text']();throw new Error('Failed\x20to\x20request\x20device\x20code:\x20'+_0x1b844c[_0x62f824(0x11d)]+'\x20'+_0x2dead3);}return _0x1b844c[_0x62f824(0x156)]();}export async function pollForTokens(_0x3f9c74,_0x181aec,_0x52400e,_0x6ad26b){const _0x3f654f=_0x3079c0,_0x5e0405={'WFQyo':function(_0x5a7119,_0x1f08a7){return _0x5a7119*_0x1f08a7;},'BhHje':function(_0x53d12b,_0xfda20b){return _0x53d12b*_0xfda20b;},'QrqBW':function(_0x506e2c,_0x1b6586){return _0x506e2c(_0x1b6586);},'sGAHM':'application/x-www-form-urlencoded','oaFBX':'urn:ietf:params:oauth:grant-type:device_code','PYNTW':function(_0x486654,_0x954046){return _0x486654===_0x954046;},'OtjWm':'authorization_pending','XYSUM':'slow_down','SwwPL':_0x3f654f(0x142)},_0x4c7462=Date['now']()+_0x5e0405['WFQyo'](_0x6ad26b,0x3e8);let _0x9c43bf=_0x5e0405[_0x3f654f(0x125)](_0x52400e,0x3e8);while(Date[_0x3f654f(0x15d)]()<_0x4c7462){await _0x5e0405[_0x3f654f(0x10c)](sleep,_0x9c43bf);const _0x42cfd5=await fetch(WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':_0x5e0405[_0x3f654f(0x12a)]},'body':new URLSearchParams({'client_id':_0x3f9c74,'device_code':_0x181aec,'grant_type':_0x5e0405['oaFBX']})});if(_0x42cfd5['ok'])return _0x42cfd5[_0x3f654f(0x156)]();const _0x53915e=await _0x42cfd5[_0x3f654f(0x156)]();if(_0x5e0405[_0x3f654f(0x133)](_0x53915e['error'],_0x5e0405[_0x3f654f(0x114)]))continue;if(_0x53915e['error']===_0x5e0405['XYSUM']){_0x9c43bf+=0x3e8;continue;}throw new Error(_0x53915e['error_description']||_0x53915e['error']||_0x5e0405[_0x3f654f(0x14c)]);}throw new Error(_0x3f654f(0x157));}function _0x6d35(){const _0x1ccfde=['xdg-open','tHAJp','POST','SwwPL','email','text','/api-keys','374380OGlVgr','platform','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20','utf-8','Using\x20organization:\x20','user_code','json','Device\x20authorization\x20timed\x20out','split','/organization/me','CKInY','NuIGL','ybCXh','now','stdout','8yAJSSI','workosClientId','QrqBW','mcp:write','Select\x20an\x20organization:','organizationId','296580LFngNt','1531327TLRALl','Failed\x20to\x20provision\x20API\x20key:\x20','toString','OtjWm','name','GET','hPZgp','XfRTQ','2ZukvZp','ignore','token','length','status','unref','OPYOV','129831vLCtEx','64938CsGKRo','device_code','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20','/organization/self-serve-signup','BhHje','cxVEz','CLI\x20Key','uclcS','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','sGAHM','https://api.workos.com/user_management/authorize/device','log','guZYE','Failed\x20to\x20create\x20organization:\x20','refresh_token','application/json','prompt','10225380qqMVhd','PYNTW','620334XTKFIt','WUEnb','VbJKx','stringify','base64url','BUktN','org_id','access_token','Waiting\x20for\x20authentication...','50YYEocA','BPeOI','PvbPO','verification_uri_complete','/cli-auth/token','Authentication\x20failed','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','crqTY','win32','start','Code:\x20','mqeRZ'];_0x6d35=function(){return _0x1ccfde;};return _0x6d35();}async function fetchUserProfile(_0x110f45){const _0x4b7503=_0x3079c0,_0x3151c7={'dmHrR':function(_0x490e31,_0x25daca,_0x4be243){return _0x490e31(_0x25daca,_0x4be243);},'FySVb':_0x4b7503(0x116)},_0x266c4f=getApiBaseUrl();try{const _0x30cc5c=await _0x3151c7['dmHrR'](fetch,_0x266c4f+_0x4b7503(0x159),{'method':_0x3151c7['FySVb'],'headers':{'workos-token':_0x110f45}});if(_0x30cc5c['ok'])return _0x30cc5c[_0x4b7503(0x156)]();}catch{}return null;}function buildKeyName(_0xa0b362,_0x58198c){const _0x43bd6f=_0x3079c0,_0x366f60={'VbJKx':function(_0xe20bdf,_0x26a053){return _0xe20bdf===_0x26a053;}},_0x1e6ef2=_0x58198c['filter'](_0x1d88ce=>_0x1d88ce['name']===_0xa0b362||_0x1d88ce[_0x43bd6f(0x115)]['startsWith'](_0xa0b362+'\x20('));if(_0x366f60[_0x43bd6f(0x136)](_0x1e6ef2['length'],0x0))return _0xa0b362;return _0xa0b362+'\x20('+(_0x1e6ef2['length']+0x1)+')';}export async function provisionApiKey(_0x10aa0a){const _0x10ac2d=_0x3079c0,_0x209978={'hgNbL':function(_0x4ec6d7){return _0x4ec6d7();},'ybCXh':function(_0x35ed33,_0xcb9fd3){return _0x35ed33(_0xcb9fd3);},'JuARX':_0x10ac2d(0x127),'aYzis':_0x10ac2d(0x116),'vVHTz':function(_0x129c06,_0x58dc5a,_0x268cf6){return _0x129c06(_0x58dc5a,_0x268cf6);},'bYzXP':_0x10ac2d(0x10d)},_0x456a60=_0x209978['hgNbL'](getApiBaseUrl),_0x23abec={'Content-Type':'application/json','workos-token':_0x10aa0a},_0x4a1e96=await _0x209978[_0x10ac2d(0x15c)](fetchUserProfile,_0x10aa0a),_0x3a8d40=_0x4a1e96?.['firstName']||_0x4a1e96?.[_0x10ac2d(0x14d)]?.['split']('@')[0x0],_0x1e13ad=_0x3a8d40?_0x3a8d40+'\x27s\x20CLI\x20Key':_0x209978['JuARX'];let _0x1c4a4e=[];try{const _0x51a843=await fetch(_0x456a60+'/api-keys',{'method':_0x209978['aYzis'],'headers':_0x23abec});if(_0x51a843['ok']){const _0x55c0a3=await _0x51a843[_0x10ac2d(0x156)]();_0x1c4a4e=_0x55c0a3['apiKeys'];}}catch{}const _0x11b7d4=_0x209978['vVHTz'](buildKeyName,_0x1e13ad,_0x1c4a4e),_0xdac60e=await fetch(_0x456a60+_0x10ac2d(0x14f),{'method':_0x10ac2d(0x14b),'headers':_0x23abec,'body':JSON[_0x10ac2d(0x137)]({'name':_0x11b7d4,'scope':_0x209978['bYzXP']})});if(!_0xdac60e['ok']){const _0x2de3f0=await _0xdac60e[_0x10ac2d(0x14e)]();throw new Error(_0x10ac2d(0x112)+_0xdac60e[_0x10ac2d(0x11d)]+'\x20'+_0x2de3f0);}const _0x8b91ec=await _0xdac60e[_0x10ac2d(0x156)]();return _0x8b91ec['apiKey'][_0x10ac2d(0x11b)];}export function openBrowser(_0x54790e){const _0x14b68e=_0x3079c0,_0x58b20c={'guZYE':function(_0x36d5eb,_0x431634,_0x501014,_0x54ff4d){return _0x36d5eb(_0x431634,_0x501014,_0x54ff4d);},'uclcS':_0x14b68e(0x146),'OPYOV':function(_0x28c804,_0xe489a2){return _0x28c804===_0xe489a2;},'mqeRZ':'darwin','tHAJp':_0x14b68e(0x149),'BUktN':_0x14b68e(0x11a)};try{if(process['platform']===_0x14b68e(0x145)){const _0x490d86=_0x58b20c[_0x14b68e(0x12d)](spawn,'cmd',['/c',_0x58b20c[_0x14b68e(0x128)],'',_0x54790e],{'detached':!![],'stdio':'ignore','windowsHide':!![]});_0x490d86[_0x14b68e(0x11e)]();return;}const _0x1f3d8c=_0x58b20c[_0x14b68e(0x11f)](process[_0x14b68e(0x151)],_0x58b20c[_0x14b68e(0x148)])?'open':_0x58b20c[_0x14b68e(0x14a)],_0x5815d2=spawn(_0x1f3d8c,[_0x54790e],{'detached':!![],'stdio':_0x58b20c[_0x14b68e(0x139)]});_0x5815d2['unref']();}catch{}}function decodeJwtPayload(_0x545db2){const _0x33c84d=_0x3079c0,_0x33b4c8={'CKInY':_0x33c84d(0x138),'arjyd':_0x33c84d(0x153)},_0x326708=_0x545db2[_0x33c84d(0x158)]('.');if(_0x326708[_0x33c84d(0x11c)]!==0x3)throw new Error('Invalid\x20JWT\x20format');const _0x4ca901=Buffer['from'](_0x326708[0x1],_0x33b4c8[_0x33c84d(0x15a)])[_0x33c84d(0x113)](_0x33b4c8['arjyd']);return JSON['parse'](_0x4ca901);}async function selfServeSignup(_0x1544ad){const _0x5af05d=_0x3079c0,_0x18c5be={'RdxEH':function(_0x5cb775){return _0x5cb775();},'WUEnb':function(_0x36272e,_0x3eaaf7,_0x3a8baa){return _0x36272e(_0x3eaaf7,_0x3a8baa);},'QucnA':_0x5af05d(0x130)},_0x2335aa=_0x18c5be['RdxEH'](getApiBaseUrl),_0x36c4ae=await _0x18c5be[_0x5af05d(0x135)](fetch,_0x2335aa+_0x5af05d(0x124),{'method':'POST','headers':{'Content-Type':_0x18c5be['QucnA'],'workos-token':_0x1544ad}});if(!_0x36c4ae['ok']){const _0x4ee00a=await _0x36c4ae['text']();throw new Error(_0x5af05d(0x12e)+_0x36c4ae['status']+'\x20'+_0x4ee00a);}return _0x36c4ae[_0x5af05d(0x156)]();}async function fetchMyMemberships(_0x41d25f){const _0x3b2321=_0x3079c0,_0x1d8a72=getApiBaseUrl(),_0x5f14e0=await fetch(_0x1d8a72+'/organization/my-memberships',{'method':'GET','headers':{'workos-token':_0x41d25f}});if(!_0x5f14e0['ok']){const _0xb7cb61=await _0x5f14e0[_0x3b2321(0x14e)]();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0x5f14e0[_0x3b2321(0x11d)]+'\x20'+_0xb7cb61);}const _0x5059e0=await _0x5f14e0[_0x3b2321(0x156)]();return _0x5059e0['memberships'];}async function refreshTokenWithOrg(_0x3eba38,_0x310e86,_0x5e01cb){const _0x277dea=_0x3079c0,_0x17120a={'WJpPz':function(_0x1d247d,_0x5d7cf2,_0x511d7a){return _0x1d247d(_0x5d7cf2,_0x511d7a);}},_0x12658a=await _0x17120a['WJpPz'](fetch,WORKOS_TOKEN_URL,{'method':_0x277dea(0x14b),'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0x3eba38,'grant_type':'refresh_token','refresh_token':_0x310e86,'organization_id':_0x5e01cb})});if(!_0x12658a['ok']){const _0x2695c9=await _0x12658a['text']();throw new Error(_0x277dea(0x123)+_0x12658a[_0x277dea(0x11d)]+'\x20'+_0x2695c9);}return _0x12658a['json']();}function _0x6896(_0x5b073e,_0x13c7e2){_0x5b073e=_0x5b073e-0x109;const _0x6d35fe=_0x6d35();let _0x6896c2=_0x6d35fe[_0x5b073e];return _0x6896c2;}async function provisionCliToken(_0x3cc64a){const _0xd71070=_0x3079c0,_0x5bf2c1={'wXwwt':function(_0x204075){return _0x204075();},'BPeOI':function(_0x45f177,_0x3edfe7,_0x37135e){return _0x45f177(_0x3edfe7,_0x37135e);},'PvbPO':_0xd71070(0x14b)},_0x4dc5eb=_0x5bf2c1['wXwwt'](getApiBaseUrl),_0x3bb023=await _0x5bf2c1[_0xd71070(0x13e)](fetch,_0x4dc5eb+_0xd71070(0x141),{'method':_0x5bf2c1[_0xd71070(0x13f)],'headers':{'Content-Type':_0xd71070(0x130),'workos-token':_0x3cc64a}});if(!_0x3bb023['ok']){const _0x49ec35=await _0x3bb023['text']();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x3bb023[_0xd71070(0x11d)]+'\x20'+_0x49ec35);}return _0x3bb023[_0xd71070(0x156)]();}export async function runDeviceAuthFlow(){const _0x1f6a0d=_0x3079c0,_0x553ae7={'fQMZG':function(_0x21ecdf){return _0x21ecdf();},'crqTY':function(_0xca1d1f,_0x1dc121){return _0xca1d1f===_0x1dc121;},'lPYMr':'Setting\x20up\x20your\x20organization...','UPgUL':function(_0x5e3439,_0x2babb2){return _0x5e3439+_0x2babb2;},'hPZgp':_0x1f6a0d(0x129),'XfRTQ':'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','cxVEz':'list','aiXDA':_0x1f6a0d(0x10e),'NuIGL':function(_0x3d83dd,_0x45b2d7,_0x45c2e3,_0x2b229b){return _0x3d83dd(_0x45b2d7,_0x45c2e3,_0x2b229b);},'PYRAc':function(_0x34a4d7,_0x269d09){return _0x34a4d7(_0x269d09);}},_0x1da778=_0x553ae7['fQMZG'](getCurrentEnvironment),_0x3ec6e1=ENVIRONMENT_CONFIGS[_0x1da778][_0x1f6a0d(0x10b)],_0x29aa83=await requestDeviceCode(_0x3ec6e1);console['log']('\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...'),console['log'](_0x1f6a0d(0x143)),openBrowser(_0x29aa83[_0x1f6a0d(0x140)]),console[_0x1f6a0d(0x12c)](_0x1f6a0d(0x152)+_0x29aa83['verification_uri_complete']),console['log'](_0x1f6a0d(0x147)+_0x29aa83[_0x1f6a0d(0x155)]+'\x0a'),process[_0x1f6a0d(0x109)]['write'](_0x1f6a0d(0x13c));let _0x42c634=await pollForTokens(_0x3ec6e1,_0x29aa83[_0x1f6a0d(0x122)],_0x29aa83['interval'],_0x29aa83['expires_in']);console[_0x1f6a0d(0x12c)]('\x20✓');const _0x3e3599=decodeJwtPayload(_0x42c634['access_token']);if(!_0x3e3599[_0x1f6a0d(0x13a)]){const _0x211411=await fetchMyMemberships(_0x42c634['access_token']);let _0x21e6de;if(_0x553ae7[_0x1f6a0d(0x144)](_0x211411[_0x1f6a0d(0x11c)],0x0)){process[_0x1f6a0d(0x109)]['write'](_0x553ae7['lPYMr']);const _0x1cc1ce=await selfServeSignup(_0x42c634[_0x1f6a0d(0x13b)]);_0x21e6de=_0x1cc1ce['organizationId'],console['log']('\x20✓');}else{if(_0x553ae7[_0x1f6a0d(0x144)](_0x211411[_0x1f6a0d(0x11c)],0x1))_0x21e6de=_0x211411[0x0][_0x1f6a0d(0x10f)],console['log'](_0x1f6a0d(0x154)+_0x211411[0x0][_0x1f6a0d(0x115)]);else{const _0x20dc7f=process['stdin']['isTTY']&&process['stdout']['isTTY'];if(!_0x20dc7f)throw new Error(_0x553ae7['UPgUL'](_0x553ae7[_0x1f6a0d(0x117)],_0x553ae7[_0x1f6a0d(0x118)]));const {selected:_0x172061}=await _0x55ccba[_0x1f6a0d(0x131)]([{'type':_0x553ae7[_0x1f6a0d(0x126)],'name':'selected','message':_0x553ae7['aiXDA'],'choices':_0x211411['map'](_0x588761=>({'name':_0x588761['name'],'value':_0x588761['organizationId']}))}]);_0x21e6de=_0x172061;}}_0x42c634=await _0x553ae7[_0x1f6a0d(0x15b)](refreshTokenWithOrg,_0x3ec6e1,_0x42c634['refresh_token'],_0x21e6de);}process[_0x1f6a0d(0x109)]['write']('Provisioning\x20CLI\x20token...');const _0x5824f7=await provisionCliToken(_0x42c634[_0x1f6a0d(0x13b)]);return console[_0x1f6a0d(0x12c)]('\x20✓'),await _0x553ae7['PYRAc'](storeToken,_0x5824f7['token']),_0x42c634['refresh_token']&&await _0x553ae7['PYRAc'](storeRefreshToken,_0x42c634[_0x1f6a0d(0x12f)]),_0x5824f7['token'];}function sleep(_0x1a310a){return new Promise(_0x456cc2=>setTimeout(_0x456cc2,_0x1a310a));}
|