@ranger-testing/ranger-cli 2.4.2 → 2.4.4
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/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 -0
- package/build/commands/utils/claudePlugin.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/featureReportGenerator.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/git.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.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/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/reportGenerator.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/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/commands/verifyInBrowser.js +1 -1
- package/package.json +1 -1
package/build/commands/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1b2bec,_0x3a1f30){const _0x1b5f9c=_0x31fa,_0x4d084d=_0x1b2bec();while(!![]){try{const _0x55261a=parseInt(_0x1b5f9c(0x230))/0x1+-parseInt(_0x1b5f9c(0x205))/0x2+-parseInt(_0x1b5f9c(0x227))/0x3+parseInt(_0x1b5f9c(0x229))/0x4*(parseInt(_0x1b5f9c(0x22f))/0x5)+parseInt(_0x1b5f9c(0x220))/0x6+-parseInt(_0x1b5f9c(0x225))/0x7*(parseInt(_0x1b5f9c(0x212))/0x8)+parseInt(_0x1b5f9c(0x204))/0x9;if(_0x55261a===_0x3a1f30)break;else _0x4d084d['push'](_0x4d084d['shift']());}catch(_0x3adabd){_0x4d084d['push'](_0x4d084d['shift']());}}}(_0x2cea,0xccd1d));import{spawn}from'child_process';import{existsSync}from'fs';import{readFile,writeFile}from'fs/promises';import{installSkill,removeSkill,RANGER_MANAGED_SKILLS,DEPRECATED_SKILLS}from'./utils/skills.js';import{PACKAGE_NAME,getCurrentVersion,getLatestVersion,compareVersions}from'./utils/version.js';import{getSkillsDir}from'./utils/claudeConfig.js';import{getOpencodeSkillsDir}from'./utils/opencodeConfig.js';function _0x31fa(_0x2b34e8,_0x218a4f){_0x2b34e8=_0x2b34e8-0x1e9;const _0x2cea22=_0x2cea();let _0x31fa8d=_0x2cea22[_0x2b34e8];return _0x31fa8d;}import{join}from'path';import{migrateActiveProfileFile}from'./utils/activeProfile.js';function _0x2cea(){const _0x37a004=['emBLL','sscCM','\x0aClaude\x20marketplace\x20updated\x20(trailhead).','claude','findIndex','push','jyOIk','ranger@trailhead','jRKfZ','6427840xwbkZN','\x0aCould\x20not\x20check\x20latest\x20version:\x20','plugin','version','split','utf-8','splice','\x0aYour\x20version\x20(','wYJZN','nORwR','lITnP','SiRWi','npm','GOvPa','8737290ZdWQYX','\x0aYou\x20are\x20already\x20on\x20the\x20latest\x20version.','\x0aNo\x20ranger-managed\x20skills\x20found\x20to\x20reinstall.','trim','length','7TlYYPk','Attempting\x20install\x20anyway...','1480707KoQGWw','\x0aReinstalling\x20','3768pmCTqW','platform','wAnYe','error','kGtpX','\x0a✅\x20Update\x20complete!','1805EBnDkB','1104798dRdbzq','gcfps','close','opencode','active-feature.txt','rXhYB','sNCJB','pipe','log','Latest\x20version:\x20\x20','\x0aInstalling\x20','UuVFm','\x20ranger-managed\x20skill(s)...','MfptZ','\x0aClaude\x20plugin\x20updated\x20(user\x20scope).','Update\x20failed:\x20','sdHzD','project','UpCJz','gKFmI','--scope','trailhead','active-profile.txt','Claude\x20plugin\x20updated\x20(project\x20scope).','sfgXP','win32','IuNPl','\x20skill\x20','Checking\x20for\x20updates...','4571127szcplp','2545976GNCIdQ','fJjUQ','update','jHNmr'];_0x2cea=function(){return _0x37a004;};return _0x2cea();}import{getRangerDir}from'./utils/rangerRoot.js';import{isMarketplaceAdded,isPluginInstalled}from'./utils/claudePlugin.js';async function runInstall(){const _0x32e83c=_0x31fa,_0x2caa2d={'sdHzD':function(_0x4e1fbd,_0x16ffa4,_0x4e4bd9,_0xb79bdb){return _0x4e1fbd(_0x16ffa4,_0x4e4bd9,_0xb79bdb);},'wRJzx':_0x32e83c(0x21e),'lITnP':'install','wcqjK':'inherit','emBLL':_0x32e83c(0x1e9)};return new Promise(_0x5d7b2d=>{const _0x2ab963=_0x32e83c,_0x2500f8={'eMdyb':function(_0x42d28f,_0x15f330){return _0x42d28f(_0x15f330);}};console[_0x2ab963(0x1ef)](_0x2ab963(0x1f1)+PACKAGE_NAME+'@latest...\x0a');const _0x490496=_0x2caa2d[_0x2ab963(0x1f7)](spawn,_0x2caa2d['wRJzx'],[_0x2caa2d[_0x2ab963(0x21c)],'-g',PACKAGE_NAME+'@latest'],{'stdio':_0x2caa2d['wcqjK'],'shell':process[_0x2ab963(0x22a)]===_0x2ab963(0x200)});_0x490496['on'](_0x2caa2d[_0x2ab963(0x209)],_0x2daf31=>{_0x2500f8['eMdyb'](_0x5d7b2d,_0x2daf31===0x0);}),_0x490496['on'](_0x2ab963(0x22c),()=>{_0x5d7b2d(![]);});});}async function updateClaudeMarketplace(){const _0x88a605=_0x31fa,_0x4bcbd2={'kGtpX':function(_0x1024a0,_0x222c42){return _0x1024a0(_0x222c42);},'sBglX':_0x88a605(0x214),'tZweb':'marketplace','nORwR':_0x88a605(0x207),'gKFmI':'trailhead','IuNPl':'pipe','wPGHw':function(_0x5b9789,_0x358f00){return _0x5b9789===_0x358f00;},'EZtGl':'error'};return new Promise(_0x12e4a0=>{const _0x5c303e=_0x88a605,_0x41df20=spawn(_0x5c303e(0x20c),[_0x4bcbd2['sBglX'],_0x4bcbd2['tZweb'],_0x4bcbd2[_0x5c303e(0x21b)],_0x4bcbd2[_0x5c303e(0x1fa)]],{'stdio':_0x4bcbd2[_0x5c303e(0x201)],'shell':_0x4bcbd2['wPGHw'](process[_0x5c303e(0x22a)],'win32')});_0x41df20['on'](_0x5c303e(0x1e9),_0x1e42b4=>{const _0x474691=_0x5c303e;_0x4bcbd2[_0x474691(0x22d)](_0x12e4a0,_0x1e42b4===0x0);}),_0x41df20['on'](_0x4bcbd2['EZtGl'],()=>{_0x12e4a0(![]);});});}async function updateClaudePlugin(_0x2a0094){const _0x4e121b=_0x31fa,_0x34cb3e={'lfStP':'plugin','eynsO':'update','UuVFm':'ranger@trailhead','yjIxI':_0x4e121b(0x1fb),'gcfps':function(_0x1b725b,_0x298403,_0x56b164,_0x3678c1){return _0x1b725b(_0x298403,_0x56b164,_0x3678c1);},'sfgXP':_0x4e121b(0x1ee),'jHNmr':'win32'};return new Promise(_0x1ce34a=>{const _0x207ba3=_0x4e121b,_0x18cea8=[_0x34cb3e['lfStP'],_0x34cb3e['eynsO'],_0x34cb3e[_0x207ba3(0x1f2)]];_0x2a0094&&_0x18cea8['push'](_0x34cb3e['yjIxI'],_0x2a0094);const _0x19dfa9=_0x34cb3e[_0x207ba3(0x231)](spawn,_0x207ba3(0x20c),_0x18cea8,{'stdio':_0x34cb3e[_0x207ba3(0x1ff)],'shell':process[_0x207ba3(0x22a)]===_0x34cb3e[_0x207ba3(0x208)]});_0x19dfa9['on'](_0x207ba3(0x1e9),_0x36eb56=>{_0x1ce34a(_0x36eb56===0x0);}),_0x19dfa9['on'](_0x207ba3(0x22c),()=>{_0x1ce34a(![]);});});}function isSkillInstalled(_0x103d8d,_0x3585dc,_0x520bdb){const _0x45f313=_0x31fa,_0x5e9df1={'GOvPa':function(_0x41acc4,_0x25a710){return _0x41acc4(_0x25a710);},'rXhYB':function(_0x19f84f,_0x1d39ee,_0x530a48){return _0x19f84f(_0x1d39ee,_0x530a48);}},_0x3a72f3=_0x520bdb===_0x45f313(0x1ea)?getOpencodeSkillsDir(_0x3585dc):_0x5e9df1[_0x45f313(0x21f)](getSkillsDir,_0x3585dc),_0x31073b=_0x5e9df1[_0x45f313(0x1ec)](join,_0x3a72f3,_0x103d8d);return _0x5e9df1['GOvPa'](existsSync,_0x31073b);}async function reinstallSkills(_0x484376){const _0x8f4ea=_0x31fa,_0x4372b6={'jRKfZ':_0x8f4ea(0x1f8),'SiRWi':'claude','CtiAj':_0x8f4ea(0x1ea),'sNCJB':function(_0xb8f881,_0x243ca2,_0x3f1ec5){return _0xb8f881(_0x243ca2,_0x3f1ec5);},'xLHpl':_0x8f4ea(0x222)},_0x25525d=[_0x4372b6[_0x8f4ea(0x211)],'user'],_0x36b5cd=[];for(const _0x3175a9 of _0x25525d){for(const _0x264013 of RANGER_MANAGED_SKILLS){isSkillInstalled(_0x264013,_0x3175a9,_0x4372b6[_0x8f4ea(0x21d)])&&_0x36b5cd[_0x8f4ea(0x20e)]({'skillName':_0x264013,'level':_0x3175a9,'platform':'claude'}),isSkillInstalled(_0x264013,_0x3175a9,_0x4372b6['CtiAj'])&&_0x36b5cd[_0x8f4ea(0x20e)]({'skillName':_0x264013,'level':_0x3175a9,'platform':'opencode'});}}for(const _0x3b12f3 of _0x25525d){for(const _0x115a92 of DEPRECATED_SKILLS){await _0x4372b6[_0x8f4ea(0x1ed)](removeSkill,_0x115a92,_0x3b12f3);}}if(_0x36b5cd[_0x8f4ea(0x224)]===0x0){console[_0x8f4ea(0x1ef)](_0x4372b6['xLHpl']);return;}console[_0x8f4ea(0x1ef)](_0x8f4ea(0x228)+_0x36b5cd['length']+_0x8f4ea(0x1f3));for(const {skillName:_0x36af10,level:_0x135afa,platform:_0xff5c31}of _0x36b5cd){try{await installSkill(_0x36af10,{'level':_0x135afa,'cliVersion':_0x484376,'platform':_0xff5c31});}catch(_0x4bcb71){console['warn']('\x20\x20Failed\x20to\x20reinstall\x20'+_0xff5c31+'\x20'+_0x135afa+_0x8f4ea(0x202)+_0x36af10+':',_0x4bcb71);}}}async function ensureActiveProfileGitignored(){const _0x3001da=_0x31fa,_0x35a1bf={'wAnYe':function(_0x3da2ed,_0x56defd,_0x5a791e){return _0x3da2ed(_0x56defd,_0x5a791e);},'mYlAA':function(_0x14a7e1,_0x2a3c6c){return _0x14a7e1(_0x2a3c6c);},'wYJZN':_0x3001da(0x217)},_0x3dce1c=_0x35a1bf[_0x3001da(0x22b)](join,getRangerDir(),'.gitignore');if(!_0x35a1bf['mYlAA'](existsSync,_0x3dce1c))return![];let _0xebde7b='';try{_0xebde7b=await readFile(_0x3dce1c,_0x35a1bf[_0x3001da(0x21a)]);}catch{return![];}const _0x3dd2a7=_0xebde7b[_0x3001da(0x216)](/\r?\n/);if(_0x3dd2a7['some'](_0x4978cf=>_0x4978cf['trim']()===_0x3001da(0x1fd)))return![];let _0x4be6d6=_0x3dd2a7[_0x3001da(0x20d)](_0x10ad84=>_0x10ad84[_0x3001da(0x223)]()===_0x3001da(0x1eb));_0x4be6d6===-0x1&&(_0x4be6d6=_0x3dd2a7[_0x3001da(0x224)]);_0x3dd2a7[_0x3001da(0x218)](_0x4be6d6,0x0,'active-profile.txt');let _0xa070fa=_0x3dd2a7['join']('\x0a');!_0xa070fa['endsWith']('\x0a')&&(_0xa070fa+='\x0a');try{await writeFile(_0x3dce1c,_0xa070fa,_0x3001da(0x217));}catch{return![];}return!![];}export async function update(){const _0x2eba0a=_0x31fa,_0x12588f={'NxdQj':_0x2eba0a(0x203),'IRmVc':function(_0x1d612a){return _0x1d612a();},'fJjUQ':_0x2eba0a(0x226),'jyOIk':function(_0x2931af,_0x39b8c2){return _0x2931af<_0x39b8c2;},'sscCM':function(_0x521b35,_0x5cf4c2){return _0x521b35(_0x5cf4c2);},'wmTmF':_0x2eba0a(0x1fc),'MfptZ':function(_0x411775){return _0x411775();},'wFZVN':function(_0x328396,_0x404962){return _0x328396(_0x404962);},'UpCJz':'✓\x20Migrated\x20active\x20profile\x20file'},_0x5644fa=getCurrentVersion();console[_0x2eba0a(0x1ef)]('\x0aCurrent\x20version:\x20'+_0x5644fa),console[_0x2eba0a(0x1ef)](_0x12588f['NxdQj']);const _0x60d929=_0x12588f['IRmVc'](getLatestVersion);let _0x46057b=_0x5644fa;if(!_0x60d929[_0x2eba0a(0x215)]){console['warn'](_0x2eba0a(0x213)+_0x60d929[_0x2eba0a(0x22c)]),console['log'](_0x12588f[_0x2eba0a(0x206)]);const _0x223b40=await _0x12588f['IRmVc'](runInstall);if(_0x223b40)console[_0x2eba0a(0x1ef)]('\x0aSuccessfully\x20installed\x20latest\x20version.'),_0x46057b=_0x12588f['IRmVc'](getCurrentVersion);else throw new Error(_0x2eba0a(0x1f6)+_0x60d929[_0x2eba0a(0x22c)]);}else{const _0x1fe6ce=_0x60d929['version'];console['log'](_0x2eba0a(0x1f0)+_0x1fe6ce);const _0x37cec2=compareVersions(_0x5644fa,_0x1fe6ce);if(_0x37cec2===0x0)console[_0x2eba0a(0x1ef)](_0x2eba0a(0x221));else{if(_0x12588f[_0x2eba0a(0x20f)](_0x37cec2,0x0))console[_0x2eba0a(0x1ef)](_0x2eba0a(0x219)+_0x5644fa+')\x20is\x20newer\x20than\x20the\x20published\x20version\x20('+_0x1fe6ce+').');else{const _0x1b9f29=await runInstall();if(_0x1b9f29)console['log']('\x0aSuccessfully\x20updated\x20to\x20version\x20'+_0x1fe6ce),_0x46057b=_0x1fe6ce;else throw new Error('Update\x20failed.');}}}await _0x12588f[_0x2eba0a(0x20a)](reinstallSkills,_0x46057b);const _0x3a9339=await _0x12588f['sscCM'](isMarketplaceAdded,_0x12588f['wmTmF']),_0x2d11fb=await isPluginInstalled(_0x2eba0a(0x210));if(_0x3a9339){const _0x1271e7=await updateClaudeMarketplace();_0x1271e7&&console[_0x2eba0a(0x1ef)](_0x2eba0a(0x20b));}if(_0x2d11fb){const _0x463dca=await _0x12588f[_0x2eba0a(0x1f4)](updateClaudePlugin);_0x463dca&&console['log'](_0x2eba0a(0x1f5));const _0x3688f5=await _0x12588f['wFZVN'](updateClaudePlugin,'project');_0x3688f5&&console[_0x2eba0a(0x1ef)]((_0x463dca?'':'\x0a')+_0x2eba0a(0x1fe));}const _0x19a0e2=await migrateActiveProfileFile();_0x19a0e2&&console['log'](_0x12588f[_0x2eba0a(0x1f9)]);const _0x220138=await ensureActiveProfileGitignored();console['log'](_0x2eba0a(0x22e));}
|
|
1
|
+
(function(_0x96dd10,_0x7819df){const _0x20191f=_0x54a6,_0x2056a7=_0x96dd10();while(!![]){try{const _0x124e89=parseInt(_0x20191f(0x12d))/0x1*(parseInt(_0x20191f(0x13f))/0x2)+parseInt(_0x20191f(0x12c))/0x3+-parseInt(_0x20191f(0x15a))/0x4+parseInt(_0x20191f(0x131))/0x5+parseInt(_0x20191f(0x11b))/0x6*(-parseInt(_0x20191f(0x146))/0x7)+-parseInt(_0x20191f(0x12e))/0x8*(parseInt(_0x20191f(0x13c))/0x9)+-parseInt(_0x20191f(0x12b))/0xa;if(_0x124e89===_0x7819df)break;else _0x2056a7['push'](_0x2056a7['shift']());}catch(_0xb12f0e){_0x2056a7['push'](_0x2056a7['shift']());}}}(_0x1acd,0x775dd));import{spawn}from'child_process';function _0x54a6(_0x1cb599,_0x5a56ca){_0x1cb599=_0x1cb599-0x118;const _0x1acd77=_0x1acd();let _0x54a6c3=_0x1acd77[_0x1cb599];return _0x54a6c3;}import{existsSync}from'fs';function _0x1acd(){const _0x33fa1e=['BjjpP','\x20ranger-managed\x20skill(s)...','win32','dqFlo','warn','30810owEYty','1346928OHkRlv','35858nlCTJL','8kGHsAo','qDlLF','update','3763170YyHqxr','utf-8','BNBqI','Pbaky','active-profile.txt','cGfgK','sloog','length','push','ROPtr','findIndex','6080805IaviOl','marketplace','ranger@trailhead','8npLZPj','qhpzp','kAHwE','@latest','zRRVQ','Claude\x20plugin\x20updated\x20(project\x20scope).','project','483NRCIwu','close','\x0aSuccessfully\x20updated\x20to\x20version\x20','\x0a✅\x20Update\x20complete!','plugin','qRarp','error','pipe','\x0aReinstalling\x20','opencode','splice','active-feature.txt','cpraf','\x0aNo\x20ranger-managed\x20skills\x20found\x20to\x20reinstall.','log','SmlOo','Clnfg','join','\x0aCurrent\x20version:\x20','ooAKZ','624832cjbwjr','\x20skill\x20','version','trailhead','inherit','gncEW','ScNFi','trim','\x0aInstalling\x20','platform','\x0aCould\x20not\x20check\x20latest\x20version:\x20','--scope','\x0aClaude\x20plugin\x20updated\x20(user\x20scope).','zFzuV','1842mYOiRR','GLFto','kUmkD','QopTf','Update\x20failed:\x20','Update\x20failed.','yziUG','RCsfQ','claude','Nlqyk','user'];_0x1acd=function(){return _0x33fa1e;};return _0x1acd();}import{readFile,writeFile}from'fs/promises';import{installSkill,removeSkill,RANGER_MANAGED_SKILLS,DEPRECATED_SKILLS}from'./utils/skills.js';import{PACKAGE_NAME,getCurrentVersion,getLatestVersion,compareVersions}from'./utils/version.js';import{getSkillsDir}from'./utils/claudeConfig.js';import{getOpencodeSkillsDir}from'./utils/opencodeConfig.js';import{join}from'path';import{migrateActiveProfileFile}from'./utils/activeProfile.js';import{getRangerDir}from'./utils/rangerRoot.js';import{isMarketplaceAdded,isPluginInstalled}from'./utils/claudePlugin.js';async function runInstall(){const _0x41bc27=_0x54a6,_0x5b7ebc={'WAHCF':function(_0x2843e3,_0x3be8c6){return _0x2843e3(_0x3be8c6);},'QopTf':function(_0x5de420,_0x1e63cb){return _0x5de420===_0x1e63cb;},'biCHv':'npm','Clnfg':_0x41bc27(0x15e),'kAHwE':_0x41bc27(0x14c)};return new Promise(_0x57ea5a=>{const _0x1ab88d=_0x41bc27;console['log'](_0x1ab88d(0x162)+PACKAGE_NAME+'@latest...\x0a');const _0x3d9a16=spawn(_0x5b7ebc['biCHv'],['install','-g',PACKAGE_NAME+_0x1ab88d(0x142)],{'stdio':_0x5b7ebc[_0x1ab88d(0x156)],'shell':process[_0x1ab88d(0x163)]===_0x1ab88d(0x128)});_0x3d9a16['on']('close',_0x1e8230=>{const _0x1875cb=_0x1ab88d;_0x5b7ebc['WAHCF'](_0x57ea5a,_0x5b7ebc[_0x1875cb(0x11e)](_0x1e8230,0x0));}),_0x3d9a16['on'](_0x5b7ebc[_0x1ab88d(0x141)],()=>{_0x57ea5a(![]);});});}async function updateClaudeMarketplace(){const _0x12b581=_0x54a6,_0x5e22b4={'qRarp':function(_0x2b6024,_0x1e0a84){return _0x2b6024===_0x1e0a84;},'RCsfQ':function(_0x31bf54,_0x2b4aee){return _0x31bf54(_0x2b4aee);},'SblyB':'plugin','Kfhlt':_0x12b581(0x13d),'zRRVQ':_0x12b581(0x130),'ooAKZ':_0x12b581(0x14d),'qhpzp':_0x12b581(0x128)};return new Promise(_0x1692d4=>{const _0x41de6c=_0x12b581,_0x2c1462={'TEuds':function(_0x575546,_0x48a889){const _0x3bde03=_0x54a6;return _0x5e22b4[_0x3bde03(0x122)](_0x575546,_0x48a889);}},_0x99e604=spawn('claude',[_0x5e22b4['SblyB'],_0x5e22b4['Kfhlt'],_0x5e22b4[_0x41de6c(0x143)],_0x41de6c(0x15d)],{'stdio':_0x5e22b4[_0x41de6c(0x159)],'shell':process['platform']===_0x5e22b4[_0x41de6c(0x140)]});_0x99e604['on'](_0x41de6c(0x147),_0x13342d=>{const _0x4aa2c9=_0x41de6c;_0x1692d4(_0x5e22b4[_0x4aa2c9(0x14b)](_0x13342d,0x0));}),_0x99e604['on'](_0x41de6c(0x14c),()=>{_0x2c1462['TEuds'](_0x1692d4,![]);});});}async function updateClaudePlugin(_0x3a8008){const _0x217d97=_0x54a6,_0x4637e9={'UPTEV':function(_0x388077,_0x34b1f6){return _0x388077===_0x34b1f6;},'hNdTz':_0x217d97(0x13e),'sloog':function(_0x2f1cfd,_0x3390ef,_0x336f89,_0x2c2c15){return _0x2f1cfd(_0x3390ef,_0x336f89,_0x2c2c15);},'ScNFi':'win32'};return new Promise(_0x2498d2=>{const _0x215368=_0x217d97,_0x47208f={'ROPtr':function(_0x27a7cc,_0x1b85a4){return _0x4637e9['UPTEV'](_0x27a7cc,_0x1b85a4);},'BjjpP':function(_0x5cd96d,_0x2a95eb){return _0x5cd96d(_0x2a95eb);}},_0xa8dee5=[_0x215368(0x14a),_0x215368(0x130),_0x4637e9['hNdTz']];_0x3a8008&&_0xa8dee5['push'](_0x215368(0x118),_0x3a8008);const _0x12ddfe=_0x4637e9[_0x215368(0x137)](spawn,'claude',_0xa8dee5,{'stdio':'pipe','shell':process['platform']===_0x4637e9[_0x215368(0x160)]});_0x12ddfe['on'](_0x215368(0x147),_0x58257e=>{const _0x243468=_0x215368;_0x2498d2(_0x47208f[_0x243468(0x13a)](_0x58257e,0x0));}),_0x12ddfe['on']('error',()=>{const _0x511e77=_0x215368;_0x47208f[_0x511e77(0x126)](_0x2498d2,![]);});});}function isSkillInstalled(_0xa919a4,_0x8acc53,_0x545384){const _0x37e0e0=_0x54a6,_0x196a8c={'dqFlo':'opencode','GLFto':function(_0x32dd72,_0x2207f6){return _0x32dd72(_0x2207f6);}},_0x530174=_0x545384===_0x196a8c[_0x37e0e0(0x129)]?getOpencodeSkillsDir(_0x8acc53):_0x196a8c[_0x37e0e0(0x11c)](getSkillsDir,_0x8acc53),_0x27ab42=join(_0x530174,_0xa919a4);return existsSync(_0x27ab42);}async function reinstallSkills(_0xba6ba5){const _0x2d3646=_0x54a6,_0x14bc5b={'tEiVz':_0x2d3646(0x145),'cpraf':_0x2d3646(0x125),'feTIK':function(_0x202821,_0x5adabc,_0x2d0dab,_0x529196){return _0x202821(_0x5adabc,_0x2d0dab,_0x529196);},'yziUG':'claude','kUmkD':_0x2d3646(0x14f),'gncEW':function(_0x14029c,_0x29e2e9,_0x404b5b){return _0x14029c(_0x29e2e9,_0x404b5b);},'SmlOo':function(_0x10d5f1,_0x64997,_0x4b1ce3){return _0x10d5f1(_0x64997,_0x4b1ce3);}},_0x286edc=[_0x14bc5b['tEiVz'],_0x14bc5b[_0x2d3646(0x152)]],_0x271157=[];for(const _0x4f8d13 of _0x286edc){for(const _0x5c3b1c of RANGER_MANAGED_SKILLS){_0x14bc5b['feTIK'](isSkillInstalled,_0x5c3b1c,_0x4f8d13,_0x2d3646(0x123))&&_0x271157['push']({'skillName':_0x5c3b1c,'level':_0x4f8d13,'platform':_0x14bc5b[_0x2d3646(0x121)]}),isSkillInstalled(_0x5c3b1c,_0x4f8d13,'opencode')&&_0x271157[_0x2d3646(0x139)]({'skillName':_0x5c3b1c,'level':_0x4f8d13,'platform':_0x14bc5b[_0x2d3646(0x11d)]});}}for(const _0x11aff6 of _0x286edc){for(const _0x1f6fb6 of DEPRECATED_SKILLS){await _0x14bc5b[_0x2d3646(0x15f)](removeSkill,_0x1f6fb6,_0x11aff6);}}if(_0x271157[_0x2d3646(0x138)]===0x0){console[_0x2d3646(0x154)](_0x2d3646(0x153));return;}console[_0x2d3646(0x154)](_0x2d3646(0x14e)+_0x271157['length']+_0x2d3646(0x127));for(const {skillName:_0x5ca72b,level:_0x212ba0,platform:_0x956704}of _0x271157){try{await _0x14bc5b[_0x2d3646(0x155)](installSkill,_0x5ca72b,{'level':_0x212ba0,'cliVersion':_0xba6ba5,'platform':_0x956704});}catch(_0x1e2c56){console['warn']('\x20\x20Failed\x20to\x20reinstall\x20'+_0x956704+'\x20'+_0x212ba0+_0x2d3646(0x15b)+_0x5ca72b+':',_0x1e2c56);}}}async function ensureActiveProfileGitignored(){const _0x5dcc53=_0x54a6,_0x4b5d79={'Chmuc':function(_0x127aa9){return _0x127aa9();},'qDlLF':'.gitignore','AdjSV':function(_0x113246,_0x14a00b,_0x6ceb54){return _0x113246(_0x14a00b,_0x6ceb54);},'cGfgK':function(_0x4b6176,_0x16624b){return _0x4b6176===_0x16624b;},'xKBCU':_0x5dcc53(0x135),'gkeYV':function(_0xb066a4,_0x59e41e,_0x5d7859,_0x39923d){return _0xb066a4(_0x59e41e,_0x5d7859,_0x39923d);}},_0x4c8daa=join(_0x4b5d79['Chmuc'](getRangerDir),_0x4b5d79[_0x5dcc53(0x12f)]);if(!existsSync(_0x4c8daa))return![];let _0x216235='';try{_0x216235=await _0x4b5d79['AdjSV'](readFile,_0x4c8daa,'utf-8');}catch{return![];}const _0x26b278=_0x216235['split'](/\r?\n/);if(_0x26b278['some'](_0x362fa0=>_0x362fa0['trim']()===_0x5dcc53(0x135)))return![];let _0x73b64c=_0x26b278[_0x5dcc53(0x13b)](_0x572230=>_0x572230[_0x5dcc53(0x161)]()===_0x5dcc53(0x151));_0x4b5d79[_0x5dcc53(0x136)](_0x73b64c,-0x1)&&(_0x73b64c=_0x26b278[_0x5dcc53(0x138)]);_0x26b278[_0x5dcc53(0x150)](_0x73b64c,0x0,_0x4b5d79['xKBCU']);let _0x11415e=_0x26b278[_0x5dcc53(0x157)]('\x0a');!_0x11415e['endsWith']('\x0a')&&(_0x11415e+='\x0a');try{await _0x4b5d79['gkeYV'](writeFile,_0x4c8daa,_0x11415e,_0x5dcc53(0x132));}catch{return![];}return!![];}export async function update(){const _0x137538=_0x54a6,_0x4e8772={'BNBqI':'Checking\x20for\x20updates...','Nlqyk':function(_0x18fbdc,_0x1383ca){return _0x18fbdc===_0x1383ca;},'sJmrS':function(_0x5da6ca,_0x531924){return _0x5da6ca(_0x531924);},'FdCXb':function(_0x3bea55){return _0x3bea55();},'NioWW':function(_0x1ff0ff){return _0x1ff0ff();},'DdyaU':_0x137538(0x119),'Pbaky':function(_0x2c9869,_0x282262){return _0x2c9869(_0x282262);},'SAIor':'project','zFzuV':'✓\x20Migrated\x20active\x20profile\x20file','GbOMH':_0x137538(0x149)},_0x59e64e=getCurrentVersion();console['log'](_0x137538(0x158)+_0x59e64e),console[_0x137538(0x154)](_0x4e8772[_0x137538(0x133)]);const _0x15687b=getLatestVersion();let _0x3cecbd=_0x59e64e;if(!_0x15687b['version']){console[_0x137538(0x12a)](_0x137538(0x164)+_0x15687b[_0x137538(0x14c)]),console[_0x137538(0x154)]('Attempting\x20install\x20anyway...');const _0x1ff6ef=await runInstall();if(_0x1ff6ef)console['log']('\x0aSuccessfully\x20installed\x20latest\x20version.'),_0x3cecbd=getCurrentVersion();else throw new Error(_0x137538(0x11f)+_0x15687b[_0x137538(0x14c)]);}else{const _0x32f28c=_0x15687b[_0x137538(0x15c)];console[_0x137538(0x154)]('Latest\x20version:\x20\x20'+_0x32f28c);const _0x122c52=compareVersions(_0x59e64e,_0x32f28c);if(_0x4e8772[_0x137538(0x124)](_0x122c52,0x0))console['log']('\x0aYou\x20are\x20already\x20on\x20the\x20latest\x20version.');else{if(_0x122c52<0x0)console['log']('\x0aYour\x20version\x20('+_0x59e64e+')\x20is\x20newer\x20than\x20the\x20published\x20version\x20('+_0x32f28c+').');else{const _0x131c33=await runInstall();if(_0x131c33)console['log'](_0x137538(0x148)+_0x32f28c),_0x3cecbd=_0x32f28c;else throw new Error(_0x137538(0x120));}}}await reinstallSkills(_0x3cecbd);const _0x2c3b1f=await isMarketplaceAdded(_0x137538(0x15d)),_0x1deab6=await _0x4e8772['sJmrS'](isPluginInstalled,'ranger@trailhead');if(_0x2c3b1f){const _0x3534b4=await _0x4e8772['FdCXb'](updateClaudeMarketplace);_0x3534b4&&console[_0x137538(0x154)]('\x0aClaude\x20marketplace\x20updated\x20(trailhead).');}if(_0x1deab6){const _0x2654bc=await _0x4e8772['NioWW'](updateClaudePlugin);_0x2654bc&&console[_0x137538(0x154)](_0x4e8772['DdyaU']);const _0x4c3a74=await _0x4e8772[_0x137538(0x134)](updateClaudePlugin,_0x4e8772['SAIor']);_0x4c3a74&&console['log']((_0x2654bc?'':'\x0a')+_0x137538(0x144));}const _0x22e6c2=await migrateActiveProfileFile();_0x22e6c2&&console[_0x137538(0x154)](_0x4e8772[_0x137538(0x11a)]);const _0x176a44=await ensureActiveProfileGitignored();console['log'](_0x4e8772['GbOMH']);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4c8cca,_0xb65037){const _0x51c742=_0x24cb,_0x50e7c1=_0x4c8cca();while(!![]){try{const _0x3cb0a6=parseInt(_0x51c742(0x149))/0x1+parseInt(_0x51c742(0x128))/0x2*(parseInt(_0x51c742(0x137))/0x3)+-parseInt(_0x51c742(0x13f))/0x4+parseInt(_0x51c742(0x12f))/0x5+-parseInt(_0x51c742(0x13a))/0x6*(-parseInt(_0x51c742(0x144))/0x7)+-parseInt(_0x51c742(0x152))/0x8*(parseInt(_0x51c742(0x133))/0x9)+-parseInt(_0x51c742(0x138))/0xa*(parseInt(_0x51c742(0x14d))/0xb);if(_0x3cb0a6===_0xb65037)break;else _0x50e7c1['push'](_0x50e7c1['shift']());}catch(_0x296aa4){_0x50e7c1['push'](_0x50e7c1['shift']());}}}(_0x1560,0x5fd7f));import{writeFile,readFile,unlink}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{chromium}from'playwright';import{encrypt}from'./utils/crypto.js';import{getToken}from'./utils/keychain.js';function _0x1560(){const _0x990d0=['newContext','close','384KGmhlD','contextOptions','extraHTTPHeaders','trackPhaseEnd','39838fynUQd','allowInsecureLocalhost','setupHeaders','error','baseUrl','config_write','\x20\x20Run\x20ranger\x20setup\x20in\x20CI\x20to\x20decrypt\x20at\x20runtime.','1189975UlganP','settings.json','browser','stdout','34560IdfaOE','newPage','trackPhaseStart','CoDJt','36HfTlJJ','120mLhkNM','\x20\x20\x20A\x20browser\x20will\x20open\x20with\x20your\x20existing\x20session\x20(if\x20any).','120mZTqsQ','Non-interactive\x20mode\x20detected.\x0aThe\x20\x22ranger\x20profile\x20update\x22\x20command\x20requires\x20interactive\x20browser\x20authentication\x20and\x20cannot\x20be\x20run\x20in\x20non-TTY\x20environments\x20(CI,\x20scripts,\x20Claude\x20Code).\x0aTo\x20update\x20profile\x20authentication:\x0a\x20\x201.\x20Run\x20\x22ranger\x20profile\x20update\x20<name>\x22\x20in\x20an\x20interactive\x20terminal\x0a\x20\x202.\x20Commit\x20the\x20updated\x20encrypted\x20auth\x20file\x20to\x20git','goto','log','storageState','441328nvzdEk','mxMPp','jmxLh','QyrUu','MphOc','75691qTLekn','eVUNw','Profile\x20\x22','catch','✓\x20Auth\x20state\x20saved\x20to:\x20','714868PGQvRC','\x20\x20Could\x20not\x20encrypt:\x20No\x20API\x20token\x20found.\x20Run:\x20ranger\x20setup\x20[token]','safeMode','✓\x20Updated\x20config:\x20','660847hhjcWc','lHIJF','\x20\x20\x20When\x20you\x20are\x20done,\x20close\x20the\x20browser.\x0a'];_0x1560=function(){return _0x990d0;};return _0x1560();}import{buildBrowserOptionsFromSettings,getEnvDir,isEnvCi,resolveEnvVars}from'./utils/settings.js';import{addProfileSetupBanner}from'./utils/profileSetupBanner.js';function _0x24cb(_0x273bd2,_0x1784af){_0x273bd2=_0x273bd2-0x126;const _0x156083=_0x1560();let _0x24cb3f=_0x156083[_0x273bd2];return _0x24cb3f;}export async function updateEnv(_0x3ae2da,_0xc600a4,_0x13d81c){const _0x5f3dc0=_0x24cb,_0x4b96fe={'QyrUu':'close','dSGFW':function(_0xf2d111,_0x28a33b,_0x1ecc1a){return _0xf2d111(_0x28a33b,_0x1ecc1a);},'jyVWt':'.enc','CoDJt':'utf-8','TJcrE':function(_0x37c09f,_0x3cfd3b){return _0x37c09f(_0x3cfd3b);},'jmxLh':'\x20\x20\x20Update\x20your\x20authentication\x20as\x20needed.','COjSj':function(_0x32f3f6,_0x4e9d29,_0x3dcde4){return _0x32f3f6(_0x4e9d29,_0x3dcde4);},'eVUNw':function(_0x5d3a24,_0xdbce00){return _0x5d3a24||_0xdbce00;},'PmJOS':'\x0aThe\x20browser\x20closed\x20unexpectedly\x20before\x20authentication\x20could\x20be\x20saved.','mxMPp':'This\x20can\x20happen\x20due\x20to\x20a\x20browser\x20compatibility\x20issue\x20on\x20some\x20systems.\x0a','NVUYl':'Browser\x20closed\x20before\x20authentication\x20was\x20saved.','MphOc':function(_0x3a5be2,_0x39ad15,_0x265ece){return _0x3a5be2(_0x39ad15,_0x265ece);},'lHIJF':'\x20\x20You\x20can\x20safely\x20commit\x20this\x20file\x20to\x20git.','ikPIq':'browser_auth','zMLCN':_0x5f3dc0(0x12d)},_0x2f90bf=getEnvDir(_0x3ae2da),_0x13e5a7=_0x4b96fe['dSGFW'](join,_0x2f90bf,_0x5f3dc0(0x130)),_0x4d78cf=join(_0x2f90bf,'auth.json'),_0x350777=_0x4d78cf+_0x4b96fe['jyVWt'],_0x1207d4=process['stdin']['isTTY']&&process[_0x5f3dc0(0x132)]['isTTY'];if(!_0x1207d4)throw new Error(_0x5f3dc0(0x13b));if(!existsSync(_0x2f90bf))throw new Error(_0x5f3dc0(0x146)+_0x3ae2da+'\x22\x20not\x20found.\x20Run\x20first:\x20ranger\x20profile\x20add\x20'+_0x3ae2da);if(!existsSync(_0x13e5a7))throw new Error('Config\x20not\x20found\x20at\x20'+_0x13e5a7+'.\x20Run\x20first:\x20ranger\x20profile\x20add\x20'+_0x3ae2da);const _0x17c3af=await readFile(_0x13e5a7,_0x4b96fe[_0x5f3dc0(0x136)]),_0x22f82c=JSON['parse'](_0x17c3af),_0x4005c9=_0x4b96fe['TJcrE'](resolveEnvVars,_0x22f82c),_0x26c26b=typeof _0x4005c9['baseUrl']==='string'?_0x4005c9[_0x5f3dc0(0x12c)]:undefined,_0x5a9cb2=_0x4b96fe['TJcrE'](existsSync,_0x4d78cf),_0xd4f0f7=isEnvCi(_0x3ae2da);_0xc600a4?.['trackPhaseStart']('browser_auth'),console[_0x5f3dc0(0x13d)]('\x0a📋\x20Authentication\x20Update'),console[_0x5f3dc0(0x13d)](_0x5f3dc0(0x139)),console['log'](_0x4b96fe[_0x5f3dc0(0x141)]),console['log'](_0x5f3dc0(0x14f));const {launchOptions:_0x14cff2,contextOptions:_0x2cabee}=_0x4b96fe['COjSj'](buildBrowserOptionsFromSettings,_0x4005c9,{'headless':![],'storageStatePath':_0x5a9cb2?_0x4d78cf:undefined});_0x4005c9['setupHeaders']&&(_0x2cabee['extraHTTPHeaders']={..._0x2cabee[_0x5f3dc0(0x126)],..._0x4005c9[_0x5f3dc0(0x12a)]});const _0x4242ba=await chromium['launch'](_0x14cff2);let _0x24a5c4=null;try{_0x24a5c4=await _0x4242ba[_0x5f3dc0(0x150)](_0x2cabee),await addProfileSetupBanner(_0x24a5c4);const _0x2b2a47=await _0x24a5c4[_0x5f3dc0(0x134)]();await _0x2b2a47[_0x5f3dc0(0x13c)](_0x4b96fe[_0x5f3dc0(0x145)](_0x26c26b,'about:blank'));let _0x2923ab=![];await new Promise(_0x1a1643=>{const _0x164634=_0x5f3dc0;_0x2b2a47['on'](_0x4b96fe[_0x164634(0x142)],async()=>{const _0x19b8c5=_0x164634;try{console['log']('Saving\x20authentication\x20state...'),await _0x24a5c4?.[_0x19b8c5(0x13e)]({'path':_0x4d78cf}),_0x2923ab=!![];}catch{}_0x1a1643();});});if(!_0x2923ab){console['log'](_0x4b96fe['PmJOS']);!_0x4005c9[_0x5f3dc0(0x14b)]&&(console[_0x5f3dc0(0x13d)](_0x4b96fe[_0x5f3dc0(0x140)]),console[_0x5f3dc0(0x13d)]('Enable\x20safe\x20mode\x20and\x20try\x20again:\x20ranger\x20profile\x20config\x20set\x20'+_0x3ae2da+'\x20safeMode\x20true\x0a'));throw new Error(_0x4b96fe['NVUYl']);}}finally{_0x24a5c4&&await _0x24a5c4[_0x5f3dc0(0x151)]()['catch'](()=>{}),await _0x4242ba[_0x5f3dc0(0x151)]()[_0x5f3dc0(0x147)](()=>{});}if(_0xd4f0f7){const _0x2da2d8=await _0x4b96fe[_0x5f3dc0(0x143)](readFile,_0x4d78cf,'utf-8'),_0x3ac93c=await getToken();if(!_0x3ac93c)console[_0x5f3dc0(0x12b)](_0x5f3dc0(0x14a)),console[_0x5f3dc0(0x13d)](_0x5f3dc0(0x148)+_0x4d78cf);else{const _0x308b7b=encrypt(_0x2da2d8,_0x3ac93c);await writeFile(_0x350777,_0x308b7b),await unlink(_0x4d78cf),console['log']('✓\x20Encrypted\x20auth\x20saved\x20to:\x20'+_0x350777),console['log'](_0x4b96fe[_0x5f3dc0(0x14e)]),console[_0x5f3dc0(0x13d)](_0x5f3dc0(0x12e));}}else console['log']('✓\x20Auth\x20state\x20saved\x20to:\x20'+_0x4d78cf);_0xc600a4?.['trackPhaseEnd'](_0x4b96fe['ikPIq']),_0xc600a4?.[_0x5f3dc0(0x135)](_0x5f3dc0(0x12d)),_0x22f82c['browser']=_0x22f82c[_0x5f3dc0(0x131)]||{},_0x22f82c['browser'][_0x5f3dc0(0x153)]=_0x22f82c[_0x5f3dc0(0x131)]['contextOptions']||{},_0x22f82c[_0x5f3dc0(0x131)][_0x5f3dc0(0x153)]['storageState']=_0x4d78cf,_0x13d81c?.[_0x5f3dc0(0x129)]===!![]&&(_0x22f82c[_0x5f3dc0(0x129)]=!![]),await _0x4b96fe['COjSj'](writeFile,_0x13e5a7,JSON['stringify'](_0x22f82c,null,0x2)),console[_0x5f3dc0(0x13d)](_0x5f3dc0(0x14c)+_0x13e5a7),_0xc600a4?.[_0x5f3dc0(0x127)](_0x4b96fe['zMLCN']),console['log']('\x0a✅\x20Profile\x20\x22'+_0x3ae2da+'\x22\x20authentication\x20updated');}
|
package/build/commands/useEnv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x660a7d,_0x4466c6){const _0x19a0f7=_0x3386,_0x55d018=_0x660a7d();while(!![]){try{const _0xd2a715=parseInt(_0x19a0f7(0x149))/0x1*(parseInt(_0x19a0f7(0x158))/0x2)+parseInt(_0x19a0f7(0x14c))/0x3*(parseInt(_0x19a0f7(0x157))/0x4)+parseInt(_0x19a0f7(0x155))/0x5*(parseInt(_0x19a0f7(0x15a))/0x6)+-parseInt(_0x19a0f7(0x14f))/0x7*(parseInt(_0x19a0f7(0x14a))/0x8)+-parseInt(_0x19a0f7(0x156))/0x9*(-parseInt(_0x19a0f7(0x14d))/0xa)+-parseInt(_0x19a0f7(0x152))/0xb*(parseInt(_0x19a0f7(0x154))/0xc)+parseInt(_0x19a0f7(0x151))/0xd*(-parseInt(_0x19a0f7(0x153))/0xe);if(_0xd2a715===_0x4466c6)break;else _0x55d018['push'](_0x55d018['shift']());}catch(_0x49d56e){_0x55d018['push'](_0x55d018['shift']());}}}(_0x250c,0x5823b));import{join}from'path';import{existsSync}from'fs';function _0x3386(_0x3afa49,_0xf2bf40){_0x3afa49=_0x3afa49-0x149;const _0x250c1e=_0x250c();let _0x33869a=_0x250c1e[_0x3afa49];return _0x33869a;}import{getEnvDir}from'./utils/settings.js';import{writeActiveProfileName}from'./utils/activeProfile.js';export async function useEnv(_0x154f3b){const _0x2cab1f=_0x3386,_0x1dbc61={'khBhE':function(_0x4f2f04,_0x3282aa,_0x2b3fb7){return _0x4f2f04(_0x3282aa,_0x2b3fb7);},'VceZb':_0x2cab1f(0x14e),'EMzan':function(_0x191216,_0x597a86){return _0x191216(_0x597a86);}},_0xec6d12=getEnvDir(_0x154f3b),_0x3500f6=_0x1dbc61['khBhE'](join,_0xec6d12,_0x1dbc61['VceZb']);if(!existsSync(_0xec6d12))throw new Error('Profile\x20\x22'+_0x154f3b+_0x2cab1f(0x159)+_0x154f3b);if(!_0x1dbc61['EMzan'](existsSync,_0x3500f6))throw new Error('Config\x20not\x20found\x20at\x20'+_0x3500f6+'.\x20Run\x20first:\x20ranger\x20profile\x20add\x20'+_0x154f3b);await writeActiveProfileName(_0x154f3b),console[_0x2cab1f(0x14b)](_0x2cab1f(0x150)+_0x154f3b+'\x22');}function _0x250c(){const _0x23e2dc=['13GfwUxc','258577LajyAw','12600182iXgUVj','48EsRCAY','35GHVFxY','21807RYhwAK','228208QGCTGO','2qZPSQm','\x22\x20not\x20found.\x20Run\x20first:\x20ranger\x20profile\x20add\x20','517578HGOXVT','148714EFdXxu','1192DxwttR','log','21Xtbrxa','1160NNwrAM','settings.json','3661BSdgVg','\x0a✓\x20Now\x20using\x20profile\x20\x22'];_0x250c=function(){return _0x23e2dc;};return _0x250c();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1c01fc,_0x2b68ef){const _0x1b6df6=_0x24d3,_0x17902d=_0x1c01fc();while(!![]){try{const _0x16886a=parseInt(_0x1b6df6(0xf2))/0x1*(-parseInt(_0x1b6df6(0xf0))/0x2)+-parseInt(_0x1b6df6(0xfa))/0x3*(-parseInt(_0x1b6df6(0xf7))/0x4)+parseInt(_0x1b6df6(0xee))/0x5+parseInt(_0x1b6df6(0xf6))/0x6*(parseInt(_0x1b6df6(0xf5))/0x7)+parseInt(_0x1b6df6(0xf3))/0x8+-parseInt(_0x1b6df6(0xf4))/0x9*(-parseInt(_0x1b6df6(0xf1))/0xa)+-parseInt(_0x1b6df6(0xf8))/0xb;if(_0x16886a===_0x2b68ef)break;else _0x17902d['push'](_0x17902d['shift']());}catch(_0x305801){_0x17902d['push'](_0x17902d['shift']());}}}(_0x38f5,0xa52ac));import{existsSync}from'fs';import{mkdir,readFile,rename,unlink,writeFile}from'fs/promises';import{join}from'path';import{getRangerDir}from'./rangerRoot.js';const ACTIVE_PROFILE_FILE='active-profile.txt',LEGACY_ACTIVE_ENV_FILE='active-env.txt';function getActiveProfilePath(){const _0x2855e1=_0x24d3,_0x303291={'FHRYs':function(_0x583a1f,_0xfb9de5,_0x27d7e9){return _0x583a1f(_0xfb9de5,_0x27d7e9);},'wEpfU':function(_0x36377b){return _0x36377b();}};return _0x303291['FHRYs'](join,_0x303291[_0x2855e1(0xef)](getRangerDir),ACTIVE_PROFILE_FILE);}function _0x38f5(){const _0xfc0484=['30wpotpS','50yTgatu','9636728oGNiYh','1195182arXviy','4921567THHHKr','6rpOSTA','2611020zKdjZN','21678910pdaffP','ykKaK','6bIWhzF','Efrvl','nKjYk','utf-8','828790gqIzEu','wEpfU','45200FKyYGR'];_0x38f5=function(){return _0xfc0484;};return _0x38f5();}function getLegacyActiveEnvPath(){const _0x23bb49={'aqFFG':function(_0x17d044){return _0x17d044();}};return join(_0x23bb49['aqFFG'](getRangerDir),LEGACY_ACTIVE_ENV_FILE);}async function migrateLegacyActiveEnv(){const _0x4ecca7=_0x24d3,_0x58e360={'iqmsS':function(_0xe7732c){return _0xe7732c();},'zGHbT':function(_0x59f346,_0xbce02a){return _0x59f346(_0xbce02a);},'ykKaK':function(_0x1930bb,_0x3ceeb2,_0x18a20c){return _0x1930bb(_0x3ceeb2,_0x18a20c);},'Efrvl':function(_0x4c6a54){return _0x4c6a54();},'Bkxdp':function(_0x3f1957,_0x461e12){return _0x3f1957(_0x461e12);}},_0x9b3969=_0x58e360['iqmsS'](getLegacyActiveEnvPath);if(!_0x58e360['zGHbT'](existsSync,_0x9b3969))return null;let _0x70597=null;try{_0x70597=(await _0x58e360[_0x4ecca7(0xf9)](readFile,_0x9b3969,_0x4ecca7(0xfd)))['trim']()||null;}catch{_0x70597=null;}if(!_0x70597)return null;const _0x36f71d=_0x58e360[_0x4ecca7(0xfb)](getActiveProfilePath);try{await rename(_0x9b3969,_0x36f71d);}catch{try{const _0x1a5224=getRangerDir();await mkdir(_0x1a5224,{'recursive':!![]}),await writeFile(_0x36f71d,_0x70597,'utf-8'),await _0x58e360['Bkxdp'](unlink,_0x9b3969);}catch{}}return _0x70597;}export async function readActiveProfileName(){const _0x186049=_0x24d3,_0x204d51={'hKobu':function(_0x1ab121){return _0x1ab121();},'TKZBX':_0x186049(0xfd),'DopMO':function(_0x5f2031){return _0x5f2031();}},_0x3bf14e=_0x204d51['hKobu'](getActiveProfilePath);if(existsSync(_0x3bf14e))try{return(await readFile(_0x3bf14e,_0x204d51['TKZBX']))['trim']()||null;}catch{return null;}return await _0x204d51['DopMO'](migrateLegacyActiveEnv);}export async function writeActiveProfileName(_0x2a9753){const _0x121856=_0x24d3,_0x390ca1={'nKjYk':function(_0x412500,_0x487c4c){return _0x412500(_0x487c4c);}},_0x1be9a3=getRangerDir();await mkdir(_0x1be9a3,{'recursive':!![]});const _0x1d30b1=getActiveProfilePath();await writeFile(_0x1d30b1,_0x2a9753,'utf-8');const _0x5157d8=getLegacyActiveEnvPath();if(existsSync(_0x5157d8))try{await _0x390ca1[_0x121856(0xfc)](unlink,_0x5157d8);}catch{}}function _0x24d3(_0x3ea68a,_0x448da6){_0x3ea68a=_0x3ea68a-0xee;const _0x38f523=_0x38f5();let _0x24d3ab=_0x38f523[_0x3ea68a];return _0x24d3ab;}export async function migrateActiveProfileFile(){const _0x48fead=await migrateLegacyActiveEnv();return _0x48fead!==null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x366361=_0x4bda;(function(_0x25fcd7,_0x32980f){const _0x4fa67d=_0x4bda,_0x4bfe70=_0x25fcd7();while(!![]){try{const _0x5d4783=-parseInt(_0x4fa67d(0x1d7))/0x1+-parseInt(_0x4fa67d(0x1d0))/0x2+-parseInt(_0x4fa67d(0x1d2))/0x3+-parseInt(_0x4fa67d(0x1e4))/0x4*(-parseInt(_0x4fa67d(0x1c8))/0x5)+-parseInt(_0x4fa67d(0x1db))/0x6+-parseInt(_0x4fa67d(0x1d4))/0x7+parseInt(_0x4fa67d(0x1c7))/0x8*(parseInt(_0x4fa67d(0x1e3))/0x9);if(_0x5d4783===_0x32980f)break;else _0x4bfe70['push'](_0x4bfe70['shift']());}catch(_0x10be52){_0x4bfe70['push'](_0x4bfe70['shift']());}}}(_0x51a0,0xa863c));function _0x51a0(){const _0x4b057a=['env','1212708qULHdY','TMPDIR','1838001yrSwkv','vCIKN','56777rbndpY','dJkAI','fndxW','353132eQWIKy','npm_config_registry','CHROME_BIN','/bin','1387698idepBe','PATH\x20is\x20missing\x20core\x20system\x20directories\x20like\x20`/usr/bin`\x20and\x20`/bin`.','PATH\x20is\x20empty,\x20so\x20npm\x20and\x20core\x20system\x20tools\x20may\x20be\x20unavailable.','push','string','NPM_CONFIG_PREFIX','XDG_CACHE_HOME','qXnRb','21877065uQPQoX','21688rOmpNt','TMP','/usr/bin','Session\x20token\x20is\x20required\x20when\x20RANGER_BYOK=false','filter','fKknK','LOCALAPPDATA','AWsin','PATH','XDG_CONFIG_HOME','win32','$PATH','8wrUTXF','65QDDkOt','fromEntries','USERPROFILE','NPM_CONFIG_CACHE','includes','npm_config_prefix','NiazP'];_0x51a0=function(){return _0x4b057a;};return _0x51a0();}import{delimiter}from'path';import{getAiProxyUrl}from'./environment.js';const AGENT_ENV_PASSTHROUGH_KEYS=[_0x366361(0x1ec),'HOME',_0x366361(0x1d1),_0x366361(0x1e5),'TEMP',_0x366361(0x1ca),'APPDATA',_0x366361(0x1ea),_0x366361(0x1e1),_0x366361(0x1c4),'PLAYWRIGHT_BROWSERS_PATH','PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD',_0x366361(0x1d9),'CHROMIUM_BIN','npm_config_cache',_0x366361(0x1cb),'npm_config_userconfig','NPM_CONFIG_USERCONFIG',_0x366361(0x1cd),_0x366361(0x1e0),_0x366361(0x1d8),'NPM_CONFIG_REGISTRY'],UNEXPANDED_PATH_TOKEN_PATTERNS=['${PATH}',_0x366361(0x1c6),'%PATH%'];function _0x4bda(_0x3164a0,_0x2c08a0){_0x3164a0=_0x3164a0-0x1c4;const _0x51a0a0=_0x51a0();let _0x4bdaa2=_0x51a0a0[_0x3164a0];return _0x4bdaa2;}export function getAgentPathHealthWarning(_0x2fdf7a,_0x3f3cd3=process['platform']){const _0x3d55de=_0x366361,_0xd26ba8={'qXnRb':function(_0x3cbe10,_0x22ad77){return _0x3cbe10===_0x22ad77;},'NiazP':_0x3d55de(0x1dd),'vCIKN':'PATH\x20contains\x20an\x20unexpanded\x20placeholder\x20like\x20`${PATH}`\x20instead\x20of\x20the\x20expanded\x20current\x20PATH.','YSVnv':_0x3d55de(0x1c5),'fKknK':_0x3d55de(0x1e6),'dJkAI':function(_0x26c12e,_0x2fd221){return _0x26c12e&&_0x2fd221;},'bgmIh':function(_0x11c292,_0xdd6987){return _0x11c292===_0xdd6987;},'fndxW':'Your\x20PATH\x20looks\x20incomplete\x20for\x20browser\x20automation.\x20Ranger\x20will\x20keep\x20going,\x20but\x20browser\x20setup\x20may\x20fail.'},_0xf62198=[],_0x41d29f=(_0x2fdf7a||'')['split'](delimiter)['filter'](Boolean);_0xd26ba8[_0x3d55de(0x1e2)](_0x41d29f['length'],0x0)&&_0xf62198['push'](_0xd26ba8[_0x3d55de(0x1ce)]);UNEXPANDED_PATH_TOKEN_PATTERNS['some'](_0x559cca=>(_0x2fdf7a||'')[_0x3d55de(0x1cc)](_0x559cca))&&_0xf62198['push'](_0xd26ba8[_0x3d55de(0x1d3)]);if(_0x3f3cd3!==_0xd26ba8['YSVnv']){const _0x38e714=_0x41d29f['includes'](_0xd26ba8[_0x3d55de(0x1e9)]),_0x2c67fd=_0x41d29f[_0x3d55de(0x1cc)](_0x3d55de(0x1da));_0xd26ba8[_0x3d55de(0x1d5)](!_0x38e714,!_0x2c67fd)&&_0xf62198[_0x3d55de(0x1de)](_0x3d55de(0x1dc));}if(_0xd26ba8['bgmIh'](_0xf62198['length'],0x0))return null;return{'summary':_0xd26ba8[_0x3d55de(0x1d6)],'issues':_0xf62198};}export function buildAgentEnv(_0xd9d247){const _0x292b94=_0x366361,_0x3ad6e5={'AWsin':function(_0x37b385){return _0x37b385();}};if(_0xd9d247['byokEnabled'])return Object[_0x292b94(0x1c9)](Object['entries'](process[_0x292b94(0x1cf)])[_0x292b94(0x1e8)](_0x5902cb=>typeof _0x5902cb[0x1]===_0x292b94(0x1df)));if(!_0xd9d247['sessionToken'])throw new Error(_0x292b94(0x1e7));const _0x564d47={'ANTHROPIC_API_KEY':_0xd9d247['sessionToken'],'ANTHROPIC_BASE_URL':_0x3ad6e5[_0x292b94(0x1eb)](getAiProxyUrl)};for(const _0x29109a of AGENT_ENV_PASSTHROUGH_KEYS){const _0x5af8dd=process[_0x292b94(0x1cf)][_0x29109a];_0x5af8dd&&(_0x564d47[_0x29109a]=_0x5af8dd);}return _0x564d47;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x599db6,_0x10b115){const _0x2ca1ef=_0x3493,_0x176183=_0x599db6();while(!![]){try{const _0xc1ba6e=-parseInt(_0x2ca1ef(0x1d7))/0x1+parseInt(_0x2ca1ef(0x1de))/0x2+parseInt(_0x2ca1ef(0x1ef))/0x3*(parseInt(_0x2ca1ef(0x1c1))/0x4)+parseInt(_0x2ca1ef(0x19a))/0x5+-parseInt(_0x2ca1ef(0x181))/0x6+parseInt(_0x2ca1ef(0x1a7))/0x7+-parseInt(_0x2ca1ef(0x197))/0x8;if(_0xc1ba6e===_0x10b115)break;else _0x176183['push'](_0x176183['shift']());}catch(_0x13740d){_0x176183['push'](_0x176183['shift']());}}}(_0x4e1f,0xa4dc6));const _0x324e49=(function(){const _0x328ea2={'GOHCL':function(_0x428b96,_0x532991,_0x257e24,_0x258562){return _0x428b96(_0x532991,_0x257e24,_0x258562);},'fPEtO':function(_0x46a5c7,_0x36e9b8){return _0x46a5c7!==_0x36e9b8;}};let _0x4f80dc=!![];return function(_0x369672,_0xce0f8c){const _0x4bb85b=_0x3493,_0x1c1a2f={'HpDnr':function(_0x2a5829,_0x5db2a1,_0x50cb51,_0x140d16){const _0xf6e846=_0x3493;return _0x328ea2[_0xf6e846(0x1da)](_0x2a5829,_0x5db2a1,_0x50cb51,_0x140d16);},'HLbbI':function(_0x238582,_0x309a70){const _0x1bee28=_0x3493;return _0x328ea2[_0x1bee28(0x17f)](_0x238582,_0x309a70);},'bYYPP':_0x4bb85b(0x1c4)},_0x4b48ee=_0x4f80dc?function(){const _0x50c5e4=_0x4bb85b,_0x1f3ce2={'jzpkn':function(_0x2eb3c6,_0x377cc8,_0x2385d4,_0xbeeb44){const _0x405686=_0x3493;return _0x1c1a2f[_0x405686(0x198)](_0x2eb3c6,_0x377cc8,_0x2385d4,_0xbeeb44);}};if(_0xce0f8c){if(_0x1c1a2f[_0x50c5e4(0x1a6)](_0x50c5e4(0x1c4),_0x1c1a2f[_0x50c5e4(0x189)]))return _0x1f3ce2[_0x50c5e4(0x1a2)](_0x599374,_0x8dc381,_0x3cc621,'video/webm');else{const _0xd596bb=_0xce0f8c[_0x50c5e4(0x196)](_0x369672,arguments);return _0xce0f8c=null,_0xd596bb;}}}:function(){};return _0x4f80dc=![],_0x4b48ee;};}()),_0x565415=_0x324e49(this,function(){const _0x51cc7a=_0x3493,_0x315dcb={'UXNvZ':_0x51cc7a(0x1cc)};return _0x565415[_0x51cc7a(0x184)]()[_0x51cc7a(0x1e9)](_0x51cc7a(0x1cc))[_0x51cc7a(0x184)]()['constructor'](_0x565415)['search'](_0x315dcb[_0x51cc7a(0x1cf)]);});_0x565415();import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{createHash}from'crypto';import{withRetry}from'./retry.js';export async function createBrowserSession(_0x3c9065){const _0x171bb1=_0x3493,_0x484582={'IitTX':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','BCSPw':function(_0xc36ce8){return _0xc36ce8();},'HItHb':function(_0x4db466,_0x1f7689,_0x5891e4){return _0x4db466(_0x1f7689,_0x5891e4);},'ENzJz':_0x171bb1(0x1ae),'wciPl':_0x171bb1(0x19c),'wWQOx':function(_0x1cb9bd,_0x343d65){return _0x1cb9bd!==_0x343d65;},'vHCXS':_0x171bb1(0x1d2)},_0x1d980c=await getToken();if(!_0x1d980c)throw new Error(_0x171bb1(0x1c0));const _0xe10ac3=_0x484582[_0x171bb1(0x1ce)](getApiBaseUrl),_0x4d046d=await _0x484582[_0x171bb1(0x1ed)](fetch,_0xe10ac3+'/api/v1/mcp/browser-sessions',{'method':_0x484582[_0x171bb1(0x18f)],'headers':{'Authorization':_0x171bb1(0x1d8)+_0x1d980c,'Content-Type':_0x484582[_0x171bb1(0x1be)]},'body':JSON[_0x171bb1(0x1a5)]({'environmentName':_0x3c9065?.[_0x171bb1(0x1bc)],'settings':_0x3c9065?.[_0x171bb1(0x1ba)],'task':_0x3c9065?.[_0x171bb1(0x192)],'url':_0x3c9065?.[_0x171bb1(0x183)],'featureId':_0x3c9065?.[_0x171bb1(0x1d1)],'checklistItemId':_0x3c9065?.['checklistItemId']})});if(!_0x4d046d['ok']){if(_0x484582[_0x171bb1(0x1b6)](_0x484582['vHCXS'],_0x484582[_0x171bb1(0x1d4)]))throw new _0x4ace76(_0x484582[_0x171bb1(0x18e)]);else{const _0x2d6743=await _0x4d046d[_0x171bb1(0x1ac)]();throw new Error(_0x171bb1(0x1c3)+_0x2d6743);}}return _0x4d046d[_0x171bb1(0x18a)]();}function _0x3493(_0x157c5d,_0x5725a5){_0x157c5d=_0x157c5d-0x178;const _0x2d3182=_0x4e1f();let _0x565415=_0x2d3182[_0x157c5d];if(_0x3493['nZHsnM']===undefined){var _0x324e49=function(_0x488afc){const _0x32f44d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x57720a='',_0x213f9b='',_0x3816ff=_0x57720a+_0x324e49;for(let _0x3fc34d=0x0,_0xf9c585,_0x49ca0f,_0x263245=0x0;_0x49ca0f=_0x488afc['charAt'](_0x263245++);~_0x49ca0f&&(_0xf9c585=_0x3fc34d%0x4?_0xf9c585*0x40+_0x49ca0f:_0x49ca0f,_0x3fc34d++%0x4)?_0x57720a+=_0x3816ff['charCodeAt'](_0x263245+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0xf9c585>>(-0x2*_0x3fc34d&0x6)):_0x3fc34d:0x0){_0x49ca0f=_0x32f44d['indexOf'](_0x49ca0f);}for(let _0x45205d=0x0,_0x203aba=_0x57720a['length'];_0x45205d<_0x203aba;_0x45205d++){_0x213f9b+='%'+('00'+_0x57720a['charCodeAt'](_0x45205d)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x213f9b);};_0x3493['JFQtJe']=_0x324e49,_0x3493['jSqYAf']={},_0x3493['nZHsnM']=!![];}const _0x4e1fbc=_0x2d3182[0x0],_0x349386=_0x157c5d+_0x4e1fbc,_0x2607f6=_0x3493['jSqYAf'][_0x349386];if(!_0x2607f6){const _0x4cde4b=function(_0x3db043){this['TLMQRf']=_0x3db043,this['PtDLnN']=[0x1,0x0,0x0],this['KMTiJR']=function(){return'newState';},this['BudbVe']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['CtvlGz']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x4cde4b['prototype']['brdgzz']=function(){const _0x585c92=new RegExp(this['BudbVe']+this['CtvlGz']),_0x54d73c=_0x585c92['test'](this['KMTiJR']['toString']())?--this['PtDLnN'][0x1]:--this['PtDLnN'][0x0];return this['dedOyA'](_0x54d73c);},_0x4cde4b['prototype']['dedOyA']=function(_0x2da5dc){if(!Boolean(~_0x2da5dc))return _0x2da5dc;return this['ERzJqk'](this['TLMQRf']);},_0x4cde4b['prototype']['ERzJqk']=function(_0x4f4ed4){for(let _0x2b1a0f=0x0,_0x216c55=this['PtDLnN']['length'];_0x2b1a0f<_0x216c55;_0x2b1a0f++){this['PtDLnN']['push'](Math['round'](Math['random']())),_0x216c55=this['PtDLnN']['length'];}return _0x4f4ed4(this['PtDLnN'][0x0]);},new _0x4cde4b(_0x3493)['brdgzz'](),_0x565415=_0x3493['JFQtJe'](_0x565415),_0x3493['jSqYAf'][_0x349386]=_0x565415;}else _0x565415=_0x2607f6;return _0x565415;}export async function updateBrowserSession(_0x30e496,_0x12deab){const _0xe3fd52=_0x3493,_0x38c32b={'gxuXa':_0xe3fd52(0x1c0),'KSvVf':function(_0x4a2ce2,_0x226316){return _0x4a2ce2===_0x226316;},'eZbsp':_0xe3fd52(0x1c9),'NmEBX':function(_0x1e3d36){return _0x1e3d36();},'ZiSqR':'LTVSa','rrgWO':function(_0x418ef4){return _0x418ef4();},'dwwjg':function(_0x5c526e,_0x3c5508,_0x379381){return _0x5c526e(_0x3c5508,_0x379381);},'uXpVQ':'application/json','Qjrgx':_0xe3fd52(0x187)};return withRetry(async()=>{const _0x1881ce=_0xe3fd52,_0x1fb054={'pWjzH':_0x38c32b['gxuXa']};if(_0x38c32b[_0x1881ce(0x1a0)](_0x1881ce(0x1c9),_0x38c32b['eZbsp'])){const _0x38e1d7=await _0x38c32b['NmEBX'](getToken);if(!_0x38e1d7){if(_0x38c32b['ZiSqR']===_0x1881ce(0x1e6))throw new Error(_0x38c32b[_0x1881ce(0x188)]);else throw new _0x3257d6(_0x1fb054[_0x1881ce(0x1d3)]);}const _0x279666=_0x38c32b[_0x1881ce(0x1b9)](getApiBaseUrl),_0x3f2d33=await _0x38c32b[_0x1881ce(0x1bf)](fetch,_0x279666+'/api/v1/mcp/browser-sessions/'+_0x30e496,{'method':_0x1881ce(0x19d),'headers':{'Authorization':_0x1881ce(0x1d8)+_0x38e1d7,'Content-Type':_0x38c32b['uXpVQ']},'body':JSON[_0x1881ce(0x1a5)](_0x12deab)});if(!_0x3f2d33['ok']){const _0x1c4b62=await _0x3f2d33[_0x1881ce(0x1ac)]();throw new Error(_0x1881ce(0x1b1)+_0x1c4b62);}return _0x3f2d33[_0x1881ce(0x18a)]();}else throw new _0x148b90(_0x1fb054['pWjzH']);},{'label':_0x38c32b[_0xe3fd52(0x1e1)]});}export async function getBrowserSession(_0x162c8d){const _0x1e2dd7=_0x3493,_0x3f0583={'VBgVO':function(_0x1eef72){return _0x1eef72();},'pSSYQ':function(_0xe01d2f,_0x3775b9,_0x34f436){return _0xe01d2f(_0x3775b9,_0x34f436);},'aywEl':'GET'},_0x555af2=await _0x3f0583[_0x1e2dd7(0x1b2)](getToken);if(!_0x555af2)throw new Error(_0x1e2dd7(0x1c0));const _0xb1b94=_0x3f0583[_0x1e2dd7(0x1b2)](getApiBaseUrl),_0x14f54c=await _0x3f0583[_0x1e2dd7(0x199)](fetch,_0xb1b94+_0x1e2dd7(0x1ee)+_0x162c8d,{'method':_0x3f0583['aywEl'],'headers':{'Authorization':_0x1e2dd7(0x1d8)+_0x555af2}});if(!_0x14f54c['ok']){const _0x28884b=await _0x14f54c['text']();throw new Error('Failed\x20to\x20get\x20browser\x20session:\x20'+_0x28884b);}return _0x14f54c[_0x1e2dd7(0x18a)]();}export async function getUploadUrls(_0x37b0f6,_0x3c4bf2,_0x1f37df,_0x346153){const _0x3bb16d=_0x3493,_0x48fe1a={'lyQYm':_0x3bb16d(0x1c0),'vCCld':function(_0x4d54d4){return _0x4d54d4();},'XBOkh':function(_0x3ee8ea,_0x399c87,_0xfbe373){return _0x3ee8ea(_0x399c87,_0xfbe373);},'USkzf':_0x3bb16d(0x1ae),'XsHUZ':_0x3bb16d(0x19c),'SVHQo':function(_0x2f95c2,_0x417a46){return _0x2f95c2!==_0x417a46;},'iqGsg':function(_0x65d9f6,_0x1ecb4d){return _0x65d9f6!==_0x1ecb4d;}},_0x9009e3=await getToken();if(!_0x9009e3)throw new Error(_0x48fe1a[_0x3bb16d(0x1e8)]);const _0x450329=_0x48fe1a[_0x3bb16d(0x1ea)](getApiBaseUrl),_0x5bfdd5=await _0x48fe1a[_0x3bb16d(0x1d9)](fetch,_0x450329+_0x3bb16d(0x1ee)+_0x37b0f6+_0x3bb16d(0x178),{'method':_0x48fe1a[_0x3bb16d(0x180)],'headers':{'Authorization':_0x3bb16d(0x1d8)+_0x9009e3,'Content-Type':_0x48fe1a[_0x3bb16d(0x19f)]},'body':JSON['stringify']({'filename':_0x3c4bf2,'filetype':_0x1f37df,..._0x48fe1a[_0x3bb16d(0x1e3)](_0x346153?.[_0x3bb16d(0x1a1)],undefined)&&{'size':_0x346153[_0x3bb16d(0x1a1)]},..._0x48fe1a[_0x3bb16d(0x1e5)](_0x346153?.['checksum'],undefined)&&{'checksum':_0x346153['checksum']},..._0x346153?.['metadata']!==undefined&&{'metadata':_0x346153['metadata']}})});if(!_0x5bfdd5['ok']){const _0x5a3f91=await _0x5bfdd5[_0x3bb16d(0x1ac)]();throw new Error('Failed\x20to\x20get\x20upload\x20URLs:\x20'+_0x5a3f91);}return _0x5bfdd5[_0x3bb16d(0x18a)]();}export async function uploadFile(_0x30a1cd,_0x1fead3,_0x11ad92){const _0x38f476=_0x3493,_0xf2d6b2={'woIkD':function(_0x2caf9d,_0x5ed260,_0xb113cd){return _0x2caf9d(_0x5ed260,_0xb113cd);},'YbDIV':_0x38f476(0x1a3)},_0x2fce18=await _0xf2d6b2[_0x38f476(0x1e0)](fetch,_0x30a1cd,{'method':_0xf2d6b2['YbDIV'],'headers':{'Content-Type':_0x11ad92,'Content-Length':_0x1fead3[_0x38f476(0x1ec)]['toString']()},'body':_0x1fead3});if(!_0x2fce18['ok']){const _0x56b3d6=await _0x2fce18[_0x38f476(0x1ac)]();throw new Error(_0x38f476(0x1af)+_0x56b3d6);}}export async function uploadTrace(_0x1515cb,_0x4ac4c8){const _0x20fddd=_0x3493,_0x57dcfe={'XUeIg':function(_0x531bcb,_0x82614d,_0x4fbcb1,_0x5b90af){return _0x531bcb(_0x82614d,_0x4fbcb1,_0x5b90af);},'lTRCF':_0x20fddd(0x1ca)};return _0x57dcfe['XUeIg'](uploadFile,_0x1515cb,_0x4ac4c8,_0x57dcfe[_0x20fddd(0x1b8)]);}export async function uploadConversation(_0x23e472,_0x43c1ee){const _0x44db1d=_0x3493,_0xc5b6cf={'UgksN':function(_0x1dfffc,_0x4bae0f,_0x377341,_0x1f61f8){return _0x1dfffc(_0x4bae0f,_0x377341,_0x1f61f8);}};return _0xc5b6cf[_0x44db1d(0x1b0)](uploadFile,_0x23e472,_0x43c1ee,_0x44db1d(0x186));}export async function uploadScreenshot(_0x27734f,_0x41e450){const _0x5ed302=_0x3493,_0x3e8494={'qPyWs':function(_0x57669d,_0x8a917f,_0x10681c,_0x35eaf8){return _0x57669d(_0x8a917f,_0x10681c,_0x35eaf8);}};return _0x3e8494[_0x5ed302(0x1b4)](uploadFile,_0x27734f,_0x41e450,_0x5ed302(0x1d0));}export async function uploadVideo(_0x5a3cae,_0x4e6194){const _0x22c049=_0x3493,_0x233288={'fBqJd':function(_0x1b0939,_0x3dc10d,_0x35aeeb,_0x12545a){return _0x1b0939(_0x3dc10d,_0x35aeeb,_0x12545a);},'uvcGK':_0x22c049(0x17b)};return _0x233288[_0x22c049(0x1e7)](uploadFile,_0x5a3cae,_0x4e6194,_0x233288[_0x22c049(0x1dd)]);}export function buildTraceViewerUrl(_0x50b6c5){const _0x468d29=_0x3493,_0x556743={'UkYsi':function(_0xad23c0,_0x268856){return _0xad23c0(_0x268856);}},_0x2e3654=_0x556743['UkYsi'](encodeURIComponent,_0x50b6c5);return _0x468d29(0x19b)+_0x2e3654;}export async function getProxySessionToken(){const _0xe87630=_0x3493,_0x1d0a23={'NjytG':function(_0xb30208){return _0xb30208();},'QuKOD':_0xe87630(0x1c0)},_0x4408a6=await _0x1d0a23[_0xe87630(0x1b7)](getToken);if(!_0x4408a6)throw new Error(_0x1d0a23[_0xe87630(0x182)]);const _0x4b9512=_0x1d0a23['NjytG'](getApiBaseUrl),_0x39058c=await fetch(_0x4b9512+_0xe87630(0x1b3),{'method':_0xe87630(0x1ae),'headers':{'Authorization':_0xe87630(0x1d8)+_0x4408a6}});if(!_0x39058c['ok']){const _0x158188=await _0x39058c[_0xe87630(0x1ac)]();throw new Error(_0xe87630(0x191)+_0x158188);}const _0x5ef817=await _0x39058c[_0xe87630(0x18a)]();return _0x5ef817[_0xe87630(0x1c8)];}export function computeChecksum(_0x59c1b5){const _0x4e8e6c=_0x3493,_0x2eef73={'zmkTt':function(_0x344772,_0x1041aa){return _0x344772(_0x1041aa);},'QDsfI':_0x4e8e6c(0x193),'BEnpp':_0x4e8e6c(0x1bb)};return _0x2eef73['zmkTt'](createHash,_0x2eef73[_0x4e8e6c(0x185)])[_0x4e8e6c(0x1df)](_0x59c1b5)['digest'](_0x2eef73[_0x4e8e6c(0x1ad)]);}export async function createVerificationStep(_0x12428b,_0x3df09f){const _0x5d06ca=_0x3493,_0x49a485={'KomME':_0x5d06ca(0x1c0),'eoewd':function(_0x4815d9){return _0x4815d9();},'NPYSl':_0x5d06ca(0x1ae),'YdmmC':'application/json'},_0x31e0a4=await getToken();if(!_0x31e0a4)throw new Error(_0x49a485[_0x5d06ca(0x1dc)]);const _0x3ce6f2=_0x49a485[_0x5d06ca(0x1d6)](getApiBaseUrl),_0x22d2bc=await fetch(_0x3ce6f2+_0x5d06ca(0x1ee)+_0x12428b+_0x5d06ca(0x17a),{'method':_0x49a485[_0x5d06ca(0x1b5)],'headers':{'Authorization':_0x5d06ca(0x1d8)+_0x31e0a4,'Content-Type':_0x49a485[_0x5d06ca(0x1a9)]},'body':JSON[_0x5d06ca(0x1a5)](_0x3df09f)});if(!_0x22d2bc['ok']){const _0x4e187d=await _0x22d2bc[_0x5d06ca(0x1ac)]();throw new Error(_0x5d06ca(0x1c2)+_0x4e187d);}return _0x22d2bc[_0x5d06ca(0x18a)]();}export async function createStepAsset(_0x24737a,_0x2a02c2,_0xa7fac3){const _0x307a1d=_0x3493,_0x4cd4ce={'Pxywc':function(_0x385c45,_0x780dcd,_0x4ed7c2,_0x153c20){return _0x385c45(_0x780dcd,_0x4ed7c2,_0x153c20);},'PYSqy':'application/jsonl','iThlh':function(_0x1ad36f){return _0x1ad36f();},'VTyHT':function(_0x5e8c96,_0x33f16c){return _0x5e8c96!==_0x33f16c;},'MRLGV':_0x307a1d(0x179),'eyWRl':function(_0x293d1d,_0x56047d,_0x1afdbf){return _0x293d1d(_0x56047d,_0x1afdbf);},'IMKYy':'POST','FAMFr':_0x307a1d(0x19c),'hYWqh':_0x307a1d(0x1c7)},_0x3244de=await _0x4cd4ce[_0x307a1d(0x1ab)](getToken);if(!_0x3244de){if(_0x4cd4ce[_0x307a1d(0x17c)](_0x307a1d(0x179),_0x4cd4ce[_0x307a1d(0x194)]))return _0x4cd4ce[_0x307a1d(0x1c5)](_0x183a75,_0xa766c1,_0x3f155f,_0x4cd4ce[_0x307a1d(0x190)]);else throw new Error(_0x307a1d(0x1c0));}const _0x37dba0=getApiBaseUrl(),_0x489a06=await _0x4cd4ce[_0x307a1d(0x1aa)](fetch,_0x37dba0+_0x307a1d(0x1ee)+_0x24737a+_0x307a1d(0x1bd)+_0x2a02c2+_0x307a1d(0x1cd),{'method':_0x4cd4ce[_0x307a1d(0x1e4)],'headers':{'Authorization':'Bearer\x20'+_0x3244de,'Content-Type':_0x4cd4ce[_0x307a1d(0x195)]},'body':JSON[_0x307a1d(0x1a5)](_0xa7fac3)});if(!_0x489a06['ok']){if(_0x4cd4ce[_0x307a1d(0x1a4)]===_0x4cd4ce[_0x307a1d(0x1a4)]){const _0x4ac40b=await _0x489a06['text']();throw new Error(_0x307a1d(0x17d)+_0x4ac40b);}else throw new _0x2e877f(_0x307a1d(0x1c0));}return _0x489a06[_0x307a1d(0x18a)]();}function _0x4e1f(){const _0x48c7d3=['zhD3AMC','tM8GqvbjihrVA2vUignVBMzPz3vYzwqUifj1BJOGCMfUz2vYihnLDhvWifT0B2TLBL0','mtu2ELPWB0Pc','rMfPBgvKihrVignYzwf0zsb2zxjPzMLJyxrPB24GC3rLCdOG','rMfPBgvKihrVignYzwf0zsbICM93C2vYihnLC3nPB246ia','uw9Zt2S','uhH5D2m','t2TUsLu','EhzzCLK','C2vZC2LVBLrVA2vU','z1vHEM4','yxbWBgLJyxrPB24VEMLW','r0vu','kcGOlISPkYKRksSK','l2fZC2v0CW','qKntuhC','vvHoDLO','Aw1Hz2uVCg5N','zMvHDhvYzuLK','Aw1gzMS','CfDQEKG','DKHdwfm','rMfPBgvKihrVihvWzgf0zsb2zxjPzMLJyxrPB24GC3rLCdOG','zw9LD2q','mJy5otKWsNL2wNHn','qMvHCMvYia','wejpA2G','r09iq0W','DxvpD0e','s29Ttuu','DxzJr0S','mJq1nte2vMD1ELj1','DxbKyxrL','D29jA0q','uwPYz3G','DhnvrNG','u1ziuw8','su1lwxK','AxfhC2C','tfrwu2e','zKjXsMq','BhLrww0','C2vHCMnO','DKndBgq','EhPsB00','BgvUz3rO','seL0sgi','l2fWAs92ms9Ty3aVyNjVD3nLCI1ZzxnZAw9UCY8','ndqYndfjAKjhqK0','l3vWBg9Hzc11CMXZ','AgPRuMm','l3n0zxbZ','DMLKzw8VD2vIBq','vLr5sfq','rMfPBgvKihrVignYzwf0zsbZDgvWigfZC2v0oIa','veneu2u','zLbfDe8','vvnREMy','mJiWmde1oeneA0DJtG','uxvlt0q','DxjS','Dg9tDhjPBMC','uurZzKK','yxbWBgLJyxrPB24VANnVBMW','DxbKyxrLqNjVD3nLCLnLC3nPB24','z3H1wge','yLLzufa','ANnVBG','zwvMyNe','uvLIwKi','quTjtMe','swL0vfG','ru56sNO','ufLtCxK','rMfPBgvKihrVigDLDcbWCM94EsbZzxnZAw9UihrVA2vUoIa','DgfZAW','Bwq1','tvjmr1y','rKfnrNi','yxbWBhK','mJGYmJqWofLsyvz6zG','shbeBNi','Cfntwve','mZy2mtu0meX4Bgfuwa','Ahr0Chm6lY90CMfJzs5WBgf5D3jPz2H0lMrLDI8/DhjHy2u9','yxbWBgLJyxrPB24VANnVBG','uefuq0G','zgLNzxn0','whnivvO','s1n2vMy','C2L6zq','ANPWA24','ufvu','AfLxCwG','C3rYAw5NAwz5','seXIyKK','mty0mtG4nvHewwTgtq','ze9zs20','wwrTBum','zxLxuMW','AvrOBgG','Dgv4Da','qKvUCha','ue9tva','rMfPBgvKihrVihvWBg9HzcbMAwXLoIa','vwDRC04','rMfPBgvKihrVihvWzgf0zsbICM93C2vYihnLC3nPB246ia','vKjNvK8','l2fWAs92ms9Ty3aVChjVEhKTC2vZC2LVBG','Cvb5v3m','tLbzu2W','D1Drt3G','tMP5DeC','Bfrsq0y','CNjNv08','C2v0DgLUz3m','yMfZzty0','zw52AxjVBM1LBNroyw1L','l3n0zxbZlW','D2nPugW'];_0x4e1f=function(){return _0x48c7d3;};return _0x4e1f();}export async function updateVerificationStep(_0x47885c,_0x181f34,_0x3183ea){const _0x4eba6f=_0x3493,_0x4d1b8a={'tsUFx':_0x4eba6f(0x1bb),'xzRoM':function(_0x407e1c){return _0x407e1c();},'CRMRL':_0x4eba6f(0x1c0),'uuOwA':function(_0x2dee79){return _0x2dee79();},'AKINa':_0x4eba6f(0x19d),'OknJU':_0x4eba6f(0x19c),'TCDSe':function(_0x3c3b98,_0xec0911){return _0x3c3b98!==_0xec0911;},'dOYKm':'eefbq'},_0x31448e=await _0x4d1b8a[_0x4eba6f(0x1eb)](getToken);if(!_0x31448e)throw new Error(_0x4d1b8a['CRMRL']);const _0x13576d=_0x4d1b8a[_0x4eba6f(0x1db)](getApiBaseUrl),_0x419b62=await fetch(_0x13576d+_0x4eba6f(0x1ee)+_0x47885c+'/steps/'+_0x181f34,{'method':_0x4d1b8a[_0x4eba6f(0x18d)],'headers':{'Authorization':_0x4eba6f(0x1d8)+_0x31448e,'Content-Type':_0x4d1b8a[_0x4eba6f(0x1c6)]},'body':JSON['stringify'](_0x3183ea)});if(!_0x419b62['ok']){if(_0x4d1b8a[_0x4eba6f(0x17e)](_0x4d1b8a[_0x4eba6f(0x1a8)],_0x4eba6f(0x18b)))return _0x12ce71('md5')[_0x4eba6f(0x1df)](_0x4e4cab)[_0x4eba6f(0x19e)](_0x4d1b8a[_0x4eba6f(0x1e2)]);else{const _0x500f6e=await _0x419b62['text']();throw new Error(_0x4eba6f(0x1d5)+_0x500f6e);}}}export async function getBrowserSessionSteps(_0x14da3c){const _0xa5b41=_0x3493,_0x892542={'xVDCK':function(_0x4e9f77){return _0x4e9f77();},'YzJzO':_0xa5b41(0x1c0),'QYbZB':function(_0x305cf3){return _0x305cf3();},'zKPOV':function(_0x4f8a53,_0x8f5510,_0x2acaee){return _0x4f8a53(_0x8f5510,_0x2acaee);},'ksfPv':_0xa5b41(0x1cb)},_0x2f6c7c=await _0x892542['xVDCK'](getToken);if(!_0x2f6c7c)throw new Error(_0x892542['YzJzO']);const _0x572652=_0x892542[_0xa5b41(0x18c)](getApiBaseUrl),_0x43186c=await _0x892542['zKPOV'](fetch,_0x572652+'/api/v1/mcp/browser-sessions/'+_0x14da3c+'/steps',{'method':_0x892542['ksfPv'],'headers':{'Authorization':_0xa5b41(0x1d8)+_0x2f6c7c}});if(!_0x43186c['ok']){const _0x445a03=await _0x43186c[_0xa5b41(0x1ac)]();throw new Error('Failed\x20to\x20get\x20browser\x20session\x20steps:\x20'+_0x445a03);}return _0x43186c[_0xa5b41(0x18a)]();}
|
|
1
|
+
(function(_0x4a1edf,_0x4b5391){const _0x66e14d=_0x2e72,_0x341897=_0x4a1edf();while(!![]){try{const _0x3f48c3=-parseInt(_0x66e14d(0x163))/0x1*(parseInt(_0x66e14d(0x126))/0x2)+parseInt(_0x66e14d(0x141))/0x3*(parseInt(_0x66e14d(0x128))/0x4)+-parseInt(_0x66e14d(0xfb))/0x5*(-parseInt(_0x66e14d(0x111))/0x6)+parseInt(_0x66e14d(0x11c))/0x7+-parseInt(_0x66e14d(0x149))/0x8+parseInt(_0x66e14d(0x150))/0x9*(parseInt(_0x66e14d(0x120))/0xa)+-parseInt(_0x66e14d(0xf8))/0xb;if(_0x3f48c3===_0x4b5391)break;else _0x341897['push'](_0x341897['shift']());}catch(_0x5ad3be){_0x341897['push'](_0x341897['shift']());}}}(_0x3955,0xca82b));const _0x50021d=(function(){const _0x416f4f=_0x2e72,_0x266e83={'dgWYj':_0x416f4f(0x12f),'TZrnG':function(_0x24449f,_0x137032){return _0x24449f!==_0x137032;},'xXZPd':_0x416f4f(0x118),'zalTR':function(_0x3f5461,_0x1f6e24){return _0x3f5461===_0x1f6e24;},'aqdNI':'OYITf','EtHrE':_0x416f4f(0x14c)};let _0x19a4a4=!![];return function(_0x5c6d7d,_0x2137c2){const _0x514596=_0x416f4f,_0x44e9ee={'SzhQR':_0x266e83[_0x514596(0x119)],'zohPr':function(_0x2c0339,_0x27434b){const _0x48d844=_0x514596;return _0x266e83[_0x48d844(0x12a)](_0x2c0339,_0x27434b);},'UFycD':_0x514596(0x135),'fttit':_0x266e83['xXZPd'],'mjyvI':function(_0x4e7c96,_0x5917ff){return _0x266e83['zalTR'](_0x4e7c96,_0x5917ff);},'RaxJl':_0x266e83['aqdNI'],'rPpiW':_0x266e83[_0x514596(0x11e)]},_0x5ebc07=_0x19a4a4?function(){const _0x3681e7=_0x514596;if(_0x44e9ee[_0x3681e7(0x151)](_0x44e9ee[_0x3681e7(0x16f)],_0x44e9ee[_0x3681e7(0x147)])){if(_0x2137c2){if(_0x44e9ee['mjyvI'](_0x44e9ee['RaxJl'],_0x44e9ee[_0x3681e7(0x10d)])){if(_0x2e0e91){const _0x1e89b6=_0x10bf48[_0x3681e7(0x14a)](_0x1b950a,arguments);return _0x83d374=null,_0x1e89b6;}}else{const _0x5e3261=_0x2137c2[_0x3681e7(0x14a)](_0x5c6d7d,arguments);return _0x2137c2=null,_0x5e3261;}}}else throw new _0x293c8e(_0x44e9ee[_0x3681e7(0x139)]);}:function(){};return _0x19a4a4=![],_0x5ebc07;};}()),_0xfee99a=_0x50021d(this,function(){const _0x15d040=_0x2e72,_0x359044={'MnSzG':'(((.+)+)+)+$'};return _0xfee99a[_0x15d040(0x15f)]()[_0x15d040(0x13a)](_0x359044[_0x15d040(0x161)])[_0x15d040(0x15f)]()[_0x15d040(0x175)](_0xfee99a)[_0x15d040(0x13a)](_0x15d040(0x145));});_0xfee99a();import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';function _0x3955(){const _0x3366e4=['AxzrsuS','l2fWAs92ms9Ty3aVyNjVD3nLCI1ZzxnZAw9UCY8','rMfPBgvKihrVignYzwf0zsbICM93C2vYihnLC3nPB246ia','y2HLy2TZDw0','rMfPBgvKihrVihvWBg9HzcbMAwXLoIa','Bfz3s0W','DLjnEeW','CLbWAvC','C2vZC2LVBLrVA2vU','rMfPBgvKihrVigDLDcbICM93C2vYihnLC3nPB246ia','DgfZAW','nMLur2zxvq','DuPntwm','zvvgv3K','C2v0DgLUz3m','tLPztu4','yxbWBgLJyxrPB24VANnVBG','qvPlrNC','tfbpzwG','zgDxwwO','y2HLy2TSAxn0sxrLBuLK','BKXTBeq','nJmXndK3m2zRwvPTqq','whP4t00','rxriCKu','wg54BeK','mtbrr21IA0K','DxbKyxrL','uefuq0G','qMrlww4','sKLWBe4','rfH4AhK','ndC2yLjrBfvT','r21tsMm','ota4B0LQqK5N','reHbwwm','vfPYBKC','yxbWBgLJyxrPB24VEMLW','EwzZAeO','v0TZEw8','u0f1rfK','tM8GqvbjihrVA2vUignVBMzPz3vYzwqUifj1BJOGCMfUz2vYihnLDhvWifT0B2TLBL0','r253yw8','vKL3ueO','yMfZzty0','CNbzD08','l3vWBg9Hzc11CMXZ','qvfLt3O','CM5jBwK','l2fWAs92ms9Ty3aVyNjVD3nLCI1ZzxnZAw9UCW','tNDezuC','u3POuvi','C2vHCMnO','uhrzwfu','t3jLqwK','sefoq1C','q2jlDLG','qMDXqMm','A3PJtgy','mtKZodLIDhv1wLq','rK1Ts1q','C0rTvfq','DxbKyxrLqNjVD3nLCLnLC3nPB24','kcGOlISPkYKRksSK','C2L6zq','zNr0Axq','Aw1Hz2uVCg5N','ntu2nJi0ohbkDhfrva','yxbWBhK','CNvMENi','uefguuW','l3n0zxbZlW','t096B1a','Bwv0ywrHDge','nJC4mte2n3zSzMjhwq','EM9Ouhi','rMfPBgvKihrVihvWzgf0zsbICM93C2vYihnLC3nPB246ia','tg5VEuC','rvDfrKC','z1DSBha','l2fWAs92ms9Ty3aVChjVEhKTC2vZC2LVBG','s0TpzvC','D0XUBMm','zuTesvy','BgvUz3rO','vML3DvK','u0HwD0y','rMfPBgvKihrVigDLDcbICM93C2vYihnLC3nPB24GC3rLChm6ia','DxjS','Dg9tDhjPBMC','zgLNzxn0','tw5tEKC','rMfPBgvKihrVigDLDcb1CgXVywqGvvjmCZOG','ntKXmNztBLfXvW','uxzwq00','sLfrr3C','DwLuBxe','y2PZsuy','senrD3C','vejjvfG','tKfvshG','u0HmuMi','ywTwA2q','A2PiveS','sNPQsNK','vuz5y0q','Cvryrwq','qMvHCMvYia','vKfzrMe','BfPny2i','AxvZtMS','y29UC3rYDwn0B3i','uK5hyvO','AhL6Eva','C3rYAw5NAwz5','D3HoCLG','zMvHDhvYzuLK','DKvxs2m','BeDRDw0','Bwq1','ywjUruC','uMrjy0q','ue9tva','zxbLrMK','DxzHCgS','zfbVvMO','l3n0zxbZ','CMveANe','ALLzufO','rMfPBgvKihrVigDLDcbWCM94EsbZzxnZAw9UihrVA2vUoIa','svf3tLm','mJqYodaXou52CwXcAq','Dg1wuwW','ANnVBG','mtuXnZmWvhvZCunk','twnhC2u','Dgv4Da','yxbWBgLJyxrPB24VANnVBMW','AKTgCNe','wgn2B1a','D0vQDeK','Dg5VBu8','r0vu','ufvu','y0ves1O'];_0x3955=function(){return _0x3366e4;};return _0x3955();}import{createHash}from'crypto';function _0x2e72(_0x123df1,_0x4e05e7){_0x123df1=_0x123df1-0xea;const _0x3b352d=_0x3955();let _0xfee99a=_0x3b352d[_0x123df1];if(_0x2e72['bTRPcn']===undefined){var _0x50021d=function(_0x2daaf0){const _0x2da5df='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x595565='',_0x1f9bd2='',_0x5a1161=_0x595565+_0x50021d;for(let _0x278a29=0x0,_0x42bf17,_0xc3114b,_0x4cb4ab=0x0;_0xc3114b=_0x2daaf0['charAt'](_0x4cb4ab++);~_0xc3114b&&(_0x42bf17=_0x278a29%0x4?_0x42bf17*0x40+_0xc3114b:_0xc3114b,_0x278a29++%0x4)?_0x595565+=_0x5a1161['charCodeAt'](_0x4cb4ab+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x42bf17>>(-0x2*_0x278a29&0x6)):_0x278a29:0x0){_0xc3114b=_0x2da5df['indexOf'](_0xc3114b);}for(let _0x4fffe8=0x0,_0x4c8579=_0x595565['length'];_0x4fffe8<_0x4c8579;_0x4fffe8++){_0x1f9bd2+='%'+('00'+_0x595565['charCodeAt'](_0x4fffe8)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1f9bd2);};_0x2e72['NDnxdk']=_0x50021d,_0x2e72['aFCMdI']={},_0x2e72['bTRPcn']=!![];}const _0x395520=_0x3b352d[0x0],_0x2e7291=_0x123df1+_0x395520,_0x49e336=_0x2e72['aFCMdI'][_0x2e7291];if(!_0x49e336){const _0x4467f0=function(_0x2b282e){this['yGzCmL']=_0x2b282e,this['rsNShS']=[0x1,0x0,0x0],this['gdeqzv']=function(){return'newState';},this['mYtMdR']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['EaTsAi']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x4467f0['prototype']['hXRInv']=function(){const _0x276dbd=new RegExp(this['mYtMdR']+this['EaTsAi']),_0x1c83e8=_0x276dbd['test'](this['gdeqzv']['toString']())?--this['rsNShS'][0x1]:--this['rsNShS'][0x0];return this['XJthCM'](_0x1c83e8);},_0x4467f0['prototype']['XJthCM']=function(_0x454744){if(!Boolean(~_0x454744))return _0x454744;return this['QwlGgF'](this['yGzCmL']);},_0x4467f0['prototype']['QwlGgF']=function(_0x39545d){for(let _0x34fad4=0x0,_0x530681=this['rsNShS']['length'];_0x34fad4<_0x530681;_0x34fad4++){this['rsNShS']['push'](Math['round'](Math['random']())),_0x530681=this['rsNShS']['length'];}return _0x39545d(this['rsNShS'][0x0]);},new _0x4467f0(_0x2e72)['hXRInv'](),_0xfee99a=_0x2e72['NDnxdk'](_0xfee99a),_0x2e72['aFCMdI'][_0x2e7291]=_0xfee99a;}else _0xfee99a=_0x49e336;return _0xfee99a;}import{withRetry}from'./retry.js';export async function createBrowserSession(_0x507bfb){const _0x35f9ea=_0x2e72,_0x1b4a2f={'PtYXU':_0x35f9ea(0x12f),'wxNrX':function(_0x322210){return _0x322210();},'HqCZF':function(_0x27fe30){return _0x27fe30();},'CbKvX':'application/json','JzjJy':_0x35f9ea(0x14b)},_0xc9a063=await _0x1b4a2f[_0x35f9ea(0x179)](getToken);if(!_0xc9a063)throw new Error(_0x1b4a2f['PtYXU']);const _0xdf0ff4=_0x1b4a2f['HqCZF'](getApiBaseUrl),_0x5a540e=await fetch(_0xdf0ff4+_0x35f9ea(0x137),{'method':'POST','headers':{'Authorization':_0x35f9ea(0x171)+_0xc9a063,'Content-Type':_0x1b4a2f[_0x35f9ea(0x13e)]},'body':JSON['stringify']({'environmentName':_0x507bfb?.['environmentName'],'settings':_0x507bfb?.[_0x35f9ea(0x114)],'task':_0x507bfb?.[_0x35f9ea(0x110)],'url':_0x507bfb?.[_0x35f9ea(0x15e)],'featureId':_0x507bfb?.[_0x35f9ea(0x17a)],'checklistItemId':_0x507bfb?.[_0x35f9ea(0x11a)]})});if(!_0x5a540e['ok']){if(_0x35f9ea(0x14b)===_0x1b4a2f[_0x35f9ea(0x16e)]){const _0x30afad=await _0x5a540e['text']();throw new Error(_0x35f9ea(0x108)+_0x30afad);}else throw new _0x59e6c4(_0x1b4a2f[_0x35f9ea(0x13b)]);}return _0x5a540e[_0x35f9ea(0xfa)]();}export async function updateBrowserSession(_0xa8fc7b,_0xef9fbd){const _0x4b3208=_0x2e72,_0x3040d7={'SAuDY':'md5','lGkum':function(_0xe5cc57){return _0xe5cc57();},'AZKFw':function(_0x39b195,_0x3085a1){return _0x39b195===_0x3085a1;},'SHLRb':_0x4b3208(0x11b),'zjGpZ':_0x4b3208(0x12f),'QvVCM':function(_0x1015df,_0x591d82,_0x22b34c){return _0x1015df(_0x591d82,_0x22b34c);},'eUFWy':_0x4b3208(0x116),'uiTmq':_0x4b3208(0x144)};return _0x3040d7[_0x4b3208(0x164)](withRetry,async()=>{const _0x20d035=_0x4b3208,_0x2b9a84=await _0x3040d7[_0x20d035(0xeb)](getToken);if(!_0x2b9a84){if(_0x3040d7[_0x20d035(0x117)](_0x3040d7[_0x20d035(0x16b)],_0x3040d7[_0x20d035(0x16b)]))throw new Error(_0x3040d7['zjGpZ']);else return _0x5a289a(_0x3040d7[_0x20d035(0x12e)])[_0x20d035(0x121)](_0x5908ed)[_0x20d035(0x160)](_0x20d035(0x132));}const _0x5a40d6=_0x3040d7[_0x20d035(0xeb)](getApiBaseUrl),_0x12a59d=await _0x3040d7[_0x20d035(0x164)](fetch,_0x5a40d6+_0x20d035(0x107)+_0xa8fc7b,{'method':_0x20d035(0x122),'headers':{'Authorization':'Bearer\x20'+_0x2b9a84,'Content-Type':_0x3040d7[_0x20d035(0x113)]},'body':JSON['stringify'](_0xef9fbd)});if(!_0x12a59d['ok']){const _0x3e0e82=await _0x12a59d[_0x20d035(0xfd)]();throw new Error(_0x20d035(0x152)+_0x3e0e82);}return _0x12a59d['json']();},{'label':_0x3040d7[_0x4b3208(0x166)]});}export async function getBrowserSession(_0x10459a){const _0x4db7f3=_0x2e72,_0x24028d={'Gnwao':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','BgqBc':function(_0x1bded4,_0x1c75d9){return _0x1bded4===_0x1c75d9;},'JIplN':_0x4db7f3(0x159),'qTXEd':_0x4db7f3(0xff),'OOzoP':function(_0x53470c,_0x8d4403,_0x153ab9){return _0x53470c(_0x8d4403,_0x153ab9);},'rpYwO':_0x4db7f3(0x103)},_0x1cbee2=await getToken();if(!_0x1cbee2){if(_0x24028d[_0x4db7f3(0x13f)](_0x24028d[_0x4db7f3(0x124)],_0x24028d[_0x4db7f3(0x170)]))throw new _0x373c7c(_0x24028d[_0x4db7f3(0x130)]);else throw new Error(_0x24028d[_0x4db7f3(0x130)]);}const _0x817c5c=getApiBaseUrl(),_0x1df657=await _0x24028d[_0x4db7f3(0x14e)](fetch,_0x817c5c+'/api/v1/mcp/browser-sessions/'+_0x10459a,{'method':_0x24028d[_0x4db7f3(0x133)],'headers':{'Authorization':_0x4db7f3(0x171)+_0x1cbee2}});if(!_0x1df657['ok']){const _0x16df6b=await _0x1df657[_0x4db7f3(0xfd)]();throw new Error(_0x4db7f3(0x10f)+_0x16df6b);}return _0x1df657[_0x4db7f3(0xfa)]();}export async function getUploadUrls(_0x5b77f2,_0x3fda3e,_0x599b9f,_0xc03431){const _0x21e84c=_0x2e72,_0x384b4d={'FMmKT':_0x21e84c(0x12b),'IQwNS':function(_0x13cb85){return _0x13cb85();},'gWllp':function(_0x282082,_0x4ce4dc){return _0x282082===_0x4ce4dc;},'XcvoP':_0x21e84c(0x169),'abnEG':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','dPoVj':function(_0xbc638b){return _0xbc638b();},'akVkd':function(_0x54d0f0,_0x4da9e8,_0x4874c6){return _0x54d0f0(_0x4da9e8,_0x4874c6);},'yfshJ':_0x21e84c(0xef),'RNGaZ':_0x21e84c(0x116),'kjHTK':function(_0x3ae8d9,_0x42c502){return _0x3ae8d9!==_0x42c502;},'pnssl':function(_0x72b4dd,_0x12e64f){return _0x72b4dd!==_0x12e64f;}},_0x220232=await _0x384b4d[_0x21e84c(0xf7)](getToken);if(!_0x220232){if(_0x384b4d[_0x21e84c(0x155)](_0x384b4d[_0x21e84c(0x100)],_0x384b4d['XcvoP']))throw new Error(_0x384b4d[_0x21e84c(0xed)]);else return _0x4a6868(_0x6ceb14,_0x387de4,_0x384b4d[_0x21e84c(0x142)]);}const _0x3630a4=_0x384b4d[_0x21e84c(0xf2)](getApiBaseUrl),_0x45fbc4=await _0x384b4d[_0x21e84c(0x16c)](fetch,_0x3630a4+_0x21e84c(0x107)+_0x5b77f2+_0x21e84c(0x134),{'method':_0x384b4d[_0x21e84c(0x12c)],'headers':{'Authorization':'Bearer\x20'+_0x220232,'Content-Type':_0x384b4d[_0x21e84c(0x176)]},'body':JSON[_0x21e84c(0x178)]({'filename':_0x3fda3e,'filetype':_0x599b9f,..._0x384b4d[_0x21e84c(0x16d)](_0xc03431?.[_0x21e84c(0x146)],undefined)&&{'size':_0xc03431['size']},..._0x384b4d[_0x21e84c(0x16d)](_0xc03431?.['checksum'],undefined)&&{'checksum':_0xc03431[_0x21e84c(0x109)]},..._0x384b4d['pnssl'](_0xc03431?.[_0x21e84c(0x14f)],undefined)&&{'metadata':_0xc03431[_0x21e84c(0x14f)]}})});if(!_0x45fbc4['ok']){const _0xc0ed76=await _0x45fbc4[_0x21e84c(0xfd)]();throw new Error(_0x21e84c(0x162)+_0xc0ed76);}return _0x45fbc4['json']();}export async function uploadFile(_0x4fe657,_0x55ebae,_0x29252f){const _0x166ebc=_0x2e72,_0x60bd92={'MUhSA':function(_0x2b2281,_0x4bbec7,_0x1ea463){return _0x2b2281(_0x4bbec7,_0x1ea463);},'VIwPJ':_0x166ebc(0x104)},_0x361e59=await _0x60bd92['MUhSA'](fetch,_0x4fe657,{'method':_0x60bd92[_0x166ebc(0x131)],'headers':{'Content-Type':_0x29252f,'Content-Length':_0x55ebae[_0x166ebc(0x15a)][_0x166ebc(0x15f)]()},'body':_0x55ebae});if(!_0x361e59['ok']){const _0x341164=await _0x361e59[_0x166ebc(0xfd)]();throw new Error(_0x166ebc(0x10a)+_0x341164);}}export async function uploadTrace(_0x1de5e4,_0x1658bb){const _0x5958fe=_0x2e72,_0x2c4ec7={'epeFi':function(_0x42cc1b,_0x2c63ab,_0x32e183,_0x38b91b){return _0x42cc1b(_0x2c63ab,_0x32e183,_0x38b91b);},'XnxlI':'application/zip'};return _0x2c4ec7[_0x5958fe(0xf0)](uploadFile,_0x1de5e4,_0x1658bb,_0x2c4ec7[_0x5958fe(0x11f)]);}export async function uploadConversation(_0x5374b7,_0x30a11b){const _0x148556=_0x2e72,_0x2e2fcf={'ElAFu':function(_0x3d68df,_0x5cf84d,_0xcef836,_0x10a489){return _0x3d68df(_0x5cf84d,_0xcef836,_0x10a489);},'vRMxL':_0x148556(0xfe)};return _0x2e2fcf['ElAFu'](uploadFile,_0x5374b7,_0x30a11b,_0x2e2fcf[_0x148556(0x10c)]);}export async function uploadScreenshot(_0x18b9c6,_0x6e5082){const _0x588660=_0x2e72,_0x72ae92={'NAUHx':function(_0x4c0c75,_0x45d76c,_0x54b2ec,_0x392fc5){return _0x4c0c75(_0x45d76c,_0x54b2ec,_0x392fc5);},'RdIcD':'image/png'};return _0x72ae92[_0x588660(0x16a)](uploadFile,_0x18b9c6,_0x6e5082,_0x72ae92[_0x588660(0xee)]);}export async function uploadVideo(_0x42ec65,_0x3afb01){const _0x5d5d93=_0x2e72,_0x570604={'kzcLf':function(_0x2d0176,_0x31d817,_0x4895ca,_0x54aa0a){return _0x2d0176(_0x31d817,_0x4895ca,_0x54aa0a);},'hyzyP':'video/webm'};return _0x570604[_0x5d5d93(0x140)](uploadFile,_0x42ec65,_0x3afb01,_0x570604[_0x5d5d93(0x177)]);}export function buildTraceViewerUrl(_0x4171a1){const _0x5aac65=_0x2e72,_0x3f5dca={'cEDKZ':function(_0x416e70,_0x251daa){return _0x416e70(_0x251daa);}},_0x5529cf=_0x3f5dca[_0x5aac65(0x105)](encodeURIComponent,_0x4171a1);return'https://trace.playwright.dev/?trace='+_0x5529cf;}export async function getProxySessionToken(){const _0x2b015a=_0x2e72,_0x23b318={'EWEFG':function(_0x3eef36,_0x4d5119,_0x1e8a80,_0x5dc19c){return _0x3eef36(_0x4d5119,_0x1e8a80,_0x5dc19c);},'rnImi':_0x2b015a(0xfe),'XzxOM':function(_0x1facf1){return _0x1facf1();},'ddpLD':_0x2b015a(0x12f),'ivQIK':function(_0xc422d4){return _0xc422d4();},'ViwuY':function(_0x490d2d,_0x39d70e,_0x216053){return _0x490d2d(_0x39d70e,_0x216053);},'RDJDS':'POST','JQQGw':_0x2b015a(0x153),'CuNTj':_0x2b015a(0x174)},_0x180146=await _0x23b318[_0x2b015a(0x11d)](getToken);if(!_0x180146)throw new Error(_0x23b318['ddpLD']);const _0x1a3783=_0x23b318[_0x2b015a(0x106)](getApiBaseUrl),_0x4c17ea=await _0x23b318[_0x2b015a(0x15b)](fetch,_0x1a3783+_0x2b015a(0x156),{'method':_0x23b318['RDJDS'],'headers':{'Authorization':_0x2b015a(0x171)+_0x180146}});if(!_0x4c17ea['ok']){if(_0x23b318[_0x2b015a(0x165)]===_0x23b318['CuNTj'])return _0x23b318[_0x2b015a(0x154)](_0x5e2e73,_0x5c4e6f,_0x219320,_0x23b318[_0x2b015a(0x136)]);else{const _0x5c61f1=await _0x4c17ea['text']();throw new Error(_0x2b015a(0xf6)+_0x5c61f1);}}const _0x1506da=await _0x4c17ea[_0x2b015a(0xfa)]();return _0x1506da[_0x2b015a(0x10e)];}export function computeChecksum(_0x4f2705){const _0x4393eb=_0x2e72,_0x2edb98={'tmVQl':function(_0x163bfd,_0x121f7c){return _0x163bfd(_0x121f7c);},'sDmTT':_0x4393eb(0xec),'DXxhy':_0x4393eb(0x132)};return _0x2edb98[_0x4393eb(0xf9)](createHash,_0x2edb98[_0x4393eb(0x143)])[_0x4393eb(0x121)](_0x4f2705)[_0x4393eb(0x160)](_0x2edb98[_0x4393eb(0x125)]);}export async function createVerificationStep(_0x542d0f,_0x495b92){const _0xd9eecb=_0x2e72,_0x39491c={'uvapk':_0xd9eecb(0x148),'lVwKL':function(_0x254797){return _0x254797();},'uJMMc':function(_0x320659,_0x338675){return _0x320659!==_0x338675;},'cjsIF':_0xd9eecb(0x168),'jYYPZ':'JMAoZ','wLnnc':function(_0x6831fa){return _0x6831fa();},'NZYMN':function(_0x57911c,_0x529703,_0x57694a){return _0x57911c(_0x529703,_0x57694a);},'wEjtI':_0xd9eecb(0x116)},_0x3f2bc6=await _0x39491c[_0xd9eecb(0x10b)](getToken);if(!_0x3f2bc6){if(_0x39491c[_0xd9eecb(0x112)](_0x39491c[_0xd9eecb(0x167)],_0x39491c[_0xd9eecb(0xf5)]))throw new Error(_0xd9eecb(0x12f));else return _0x1371cc(_0x42d8cb,_0x149437,_0x39491c[_0xd9eecb(0xf1)]);}const _0x16422e=_0x39491c[_0xd9eecb(0x158)](getApiBaseUrl),_0x44efe1=await _0x39491c[_0xd9eecb(0x115)](fetch,_0x16422e+_0xd9eecb(0x107)+_0x542d0f+'/steps',{'method':_0xd9eecb(0xef),'headers':{'Authorization':_0xd9eecb(0x171)+_0x3f2bc6,'Content-Type':_0x39491c[_0xd9eecb(0x101)]},'body':JSON[_0xd9eecb(0x178)](_0x495b92)});if(!_0x44efe1['ok']){const _0x41e0eb=await _0x44efe1[_0xd9eecb(0xfd)]();throw new Error('Failed\x20to\x20create\x20verification\x20step:\x20'+_0x41e0eb);}return _0x44efe1[_0xd9eecb(0xfa)]();}export async function createStepAsset(_0x159e30,_0x10cea4,_0x117127){const _0x2a8075=_0x2e72,_0x211111={'bpMrS':_0x2a8075(0x12f),'tnomO':function(_0x3de40c){return _0x3de40c();},'GmSJc':function(_0x50ceac,_0x11b097,_0xc56ab4){return _0x50ceac(_0x11b097,_0xc56ab4);},'OreAi':_0x2a8075(0xef),'DHAYc':_0x2a8075(0x116)},_0x119c5c=await getToken();if(!_0x119c5c)throw new Error(_0x211111['bpMrS']);const _0x10914f=_0x211111[_0x2a8075(0x102)](getApiBaseUrl),_0x3f643f=await _0x211111[_0x2a8075(0x127)](fetch,_0x10914f+_0x2a8075(0x107)+_0x159e30+_0x2a8075(0x14d)+_0x10cea4+'/assets',{'method':_0x211111[_0x2a8075(0x13c)],'headers':{'Authorization':'Bearer\x20'+_0x119c5c,'Content-Type':_0x211111[_0x2a8075(0x129)]},'body':JSON[_0x2a8075(0x178)](_0x117127)});if(!_0x3f643f['ok']){const _0x2c9021=await _0x3f643f[_0x2a8075(0xfd)]();throw new Error('Failed\x20to\x20create\x20step\x20asset:\x20'+_0x2c9021);}return _0x3f643f[_0x2a8075(0xfa)]();}export async function updateVerificationStep(_0x567029,_0x10fb6d,_0xd35602){const _0x185c51=_0x2e72,_0x5a4a97={'KKOeW':_0x185c51(0x123),'SHVwF':_0x185c51(0x12f),'vEWKc':function(_0x495b65){return _0x495b65();},'reDjq':function(_0xd10be0,_0x57f623,_0x195ee2){return _0xd10be0(_0x57f623,_0x195ee2);},'McGse':_0x185c51(0x122),'HANCW':_0x185c51(0x116)},_0x355197=await getToken();if(!_0x355197){if(_0x5a4a97[_0x185c51(0x157)]!==_0x5a4a97[_0x185c51(0x157)]){const _0x521425=_0x2585c7['apply'](_0xee27ea,arguments);return _0x581755=null,_0x521425;}else throw new Error(_0x5a4a97[_0x185c51(0x15c)]);}const _0x7513db=_0x5a4a97[_0x185c51(0xea)](getApiBaseUrl),_0x23b829=await _0x5a4a97[_0x185c51(0xf4)](fetch,_0x7513db+_0x185c51(0x107)+_0x567029+_0x185c51(0x14d)+_0x10fb6d,{'method':_0x5a4a97[_0x185c51(0xfc)],'headers':{'Authorization':_0x185c51(0x171)+_0x355197,'Content-Type':_0x5a4a97[_0x185c51(0x13d)]},'body':JSON[_0x185c51(0x178)](_0xd35602)});if(!_0x23b829['ok']){const _0x5c22db=await _0x23b829[_0x185c51(0xfd)]();throw new Error('Failed\x20to\x20update\x20verification\x20step:\x20'+_0x5c22db);}}export async function getBrowserSessionSteps(_0x2ac90b){const _0x34f798=_0x2e72,_0x466da8={'NwDeG':function(_0x5bbc31){return _0x5bbc31();},'lZMcb':function(_0x50e78f,_0x17b3c9){return _0x50e78f!==_0x17b3c9;},'VAYFa':_0x34f798(0x12f),'WKsyo':_0x34f798(0x103)},_0x233bb2=await _0x466da8['NwDeG'](getToken);if(!_0x233bb2){if(_0x466da8[_0x34f798(0x173)]('gGYff','gGYff'))throw new _0x24b5bd('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');else throw new Error(_0x466da8[_0x34f798(0x172)]);}const _0x5bad37=_0x466da8[_0x34f798(0x138)](getApiBaseUrl),_0x156e6=await fetch(_0x5bad37+'/api/v1/mcp/browser-sessions/'+_0x2ac90b+_0x34f798(0xf3),{'method':_0x466da8[_0x34f798(0x12d)],'headers':{'Authorization':'Bearer\x20'+_0x233bb2}});if(!_0x156e6['ok']){const _0x111f6c=await _0x156e6[_0x34f798(0xfd)]();throw new Error(_0x34f798(0x15d)+_0x111f6c);}return _0x156e6[_0x34f798(0xfa)]();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xb90ab9,_0x542e6b){const _0xae0d2a=_0x8e5a,_0x4fb3ee=_0xb90ab9();while(!![]){try{const _0x397e40=-parseInt(_0xae0d2a(0x19e))/0x1*(-parseInt(_0xae0d2a(0x18f))/0x2)+-parseInt(_0xae0d2a(0x199))/0x3*(-parseInt(_0xae0d2a(0x192))/0x4)+parseInt(_0xae0d2a(0x1a3))/0x5*(parseInt(_0xae0d2a(0x193))/0x6)+parseInt(_0xae0d2a(0x19b))/0x7+parseInt(_0xae0d2a(0x1a1))/0x8+parseInt(_0xae0d2a(0x1a0))/0x9*(parseInt(_0xae0d2a(0x190))/0xa)+-parseInt(_0xae0d2a(0x197))/0xb;if(_0x397e40===_0x542e6b)break;else _0x4fb3ee['push'](_0x4fb3ee['shift']());}catch(_0x38d75e){_0x4fb3ee['push'](_0x4fb3ee['shift']());}}}(_0x42ef,0x8e7cb));function _0x42ef(){const _0x3f2170=['7793928ozWDur','kpikw','30580UJkOok','SiuZc','WBYFK','47362YoataG','420uHvxor','stringify','203692XmPHIC','618WMBIaS','mizjw','WQpnh','cwd','33951170clKHGp','QUqXp','42dtevDn','cSjgo','1893493fXdgZZ','user','skills','21avreBe','settings.json','125397nnsrCA'];_0x42ef=function(){return _0x3f2170;};return _0x42ef();}import{homedir}from'os';import{join,dirname,parse}from'path';function _0x8e5a(_0x3aa927,_0x15d324){_0x3aa927=_0x3aa927-0x18d;const _0x42eff1=_0x42ef();let _0x8e5acb=_0x42eff1[_0x3aa927];return _0x8e5acb;}import{existsSync}from'fs';import{readFile,writeFile,mkdir}from'fs/promises';export function getClaudeConfigDir(){const _0x5cd091=_0x8e5a,_0xd3110a={'mizjw':function(_0x44745e){return _0x44745e();},'TgvvK':'.claude'};return process['env']['CLAUDE_CONFIG_DIR']||join(_0xd3110a[_0x5cd091(0x194)](homedir),_0xd3110a['TgvvK']);}export function getUserSkillsDir(){const _0x1b006e=_0x8e5a;return join(getClaudeConfigDir(),_0x1b006e(0x19d));}export function getProjectRoot(){const _0x346cd7=_0x8e5a,_0x24dc50={'Hazfo':function(_0x1dd46b,_0x3f3d43){return _0x1dd46b!==_0x3f3d43;},'IDkGa':function(_0x3d421c,_0x2b4293){return _0x3d421c(_0x2b4293);},'SiuZc':function(_0x3b0c59,_0xa2c8,_0x4a1122){return _0x3b0c59(_0xa2c8,_0x4a1122);},'kpikw':'.git'};let _0x91a2a8=process['cwd']();const _0x58e380=parse(_0x91a2a8)['root'];while(_0x24dc50['Hazfo'](_0x91a2a8,_0x58e380)){if(_0x24dc50['IDkGa'](existsSync,_0x24dc50[_0x346cd7(0x18d)](join,_0x91a2a8,'.claude')))return _0x91a2a8;if(_0x24dc50['IDkGa'](existsSync,join(_0x91a2a8,_0x24dc50[_0x346cd7(0x1a2)])))return _0x91a2a8;_0x91a2a8=dirname(_0x91a2a8);}return process[_0x346cd7(0x196)]();}export function getProjectSkillsDir(){const _0xcbb638=_0x8e5a,_0x4805a5={'sYGhl':function(_0x5c1ece,_0x2382b9,_0x5b66a5,_0x3e463c){return _0x5c1ece(_0x2382b9,_0x5b66a5,_0x3e463c);},'WBYFK':function(_0x20a846){return _0x20a846();},'QUqXp':'.claude','vZlTx':_0xcbb638(0x19d)};return _0x4805a5['sYGhl'](join,_0x4805a5[_0xcbb638(0x18e)](getProjectRoot),_0x4805a5[_0xcbb638(0x198)],_0x4805a5['vZlTx']);}export function getSkillsDir(_0x48bba9){const _0xe7a992=_0x8e5a,_0x16466b={'zEUgx':function(_0x1d3439){return _0x1d3439();}};return _0x48bba9===_0xe7a992(0x19c)?getUserSkillsDir():_0x16466b['zEUgx'](getProjectSkillsDir);}export function getSettingsPath(){const _0x5f2f20=_0x8e5a,_0x68690c={'bfHmx':function(_0x1cfd12){return _0x1cfd12();}};return join(_0x68690c['bfHmx'](getClaudeConfigDir),_0x5f2f20(0x19f));}export async function loadClaudeSettings(){const _0x1d4775={'bGwFw':function(_0x59c422,_0x38e622){return _0x59c422(_0x38e622);},'MsqJw':function(_0x42d3c0,_0x4e58a3,_0x46395e){return _0x42d3c0(_0x4e58a3,_0x46395e);}},_0xb5e0f0=getSettingsPath();if(!_0x1d4775['bGwFw'](existsSync,_0xb5e0f0))return{};try{const _0x4976dd=await _0x1d4775['MsqJw'](readFile,_0xb5e0f0,'utf-8');return JSON['parse'](_0x4976dd);}catch{return{};}}export async function saveClaudeSettings(_0x327426){const _0x2af482=_0x8e5a,_0x7d291f={'qNdRn':function(_0x41d465){return _0x41d465();},'cSjgo':function(_0xb4383c){return _0xb4383c();},'SVmRI':function(_0x12c37a,_0x1ef332){return _0x12c37a(_0x1ef332);},'WQpnh':function(_0x239afd,_0x43f446,_0x3f9f04){return _0x239afd(_0x43f446,_0x3f9f04);},'lIjvP':function(_0x4ea9f4,_0x3e8503,_0x161203,_0x39412a){return _0x4ea9f4(_0x3e8503,_0x161203,_0x39412a);},'gMHhH':'utf-8'},_0x21c3fa=_0x7d291f['qNdRn'](getSettingsPath),_0xa816e7=_0x7d291f[_0x2af482(0x19a)](getClaudeConfigDir);!_0x7d291f['SVmRI'](existsSync,_0xa816e7)&&await _0x7d291f[_0x2af482(0x195)](mkdir,_0xa816e7,{'recursive':!![]}),await _0x7d291f['lIjvP'](writeFile,_0x21c3fa,JSON[_0x2af482(0x191)](_0x327426,null,0x2)+'\x0a',_0x7d291f['gMHhH']);}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x36b826,_0x51e9d9){const _0x4e4082=_0x346e,_0x6e887e=_0x36b826();while(!![]){try{const _0xf0100b=-parseInt(_0x4e4082(0x70))/0x1*(parseInt(_0x4e4082(0x73))/0x2)+-parseInt(_0x4e4082(0x72))/0x3*(parseInt(_0x4e4082(0x75))/0x4)+parseInt(_0x4e4082(0x71))/0x5*(parseInt(_0x4e4082(0x6c))/0x6)+parseInt(_0x4e4082(0x6a))/0x7+parseInt(_0x4e4082(0x6e))/0x8+-parseInt(_0x4e4082(0x6b))/0x9*(-parseInt(_0x4e4082(0x74))/0xa)+parseInt(_0x4e4082(0x6f))/0xb;if(_0xf0100b===_0x51e9d9)break;else _0x6e887e['push'](_0x6e887e['shift']());}catch(_0x34548f){_0x6e887e['push'](_0x6e887e['shift']());}}}(_0x5196,0xcea86));import{isByokEnabled}from'./environment.js';function _0x346e(_0x15a114,_0x2c4973){_0x15a114=_0x15a114-0x6a;const _0x5196d4=_0x5196();let _0x346e66=_0x5196d4[_0x15a114];return _0x346e66;}const RANGER_CLAUDE_OVERRIDE_SETTINGS={'env':{'CLAUDE_CODE_USE_BEDROCK':'0'}};function _0x5196(){const _0xf2863c=['8ByrxJV','6017872qBqHzs','396IxOiMC','6ZaOmFA','ZTIQp','2476480npHOdZ','9192986hSgxrz','19753skdMYK','896915AFvpPL','1433622fcUDaZ','142weioEU','231890GDObjV'];_0x5196=function(){return _0xf2863c;};return _0x5196();}export function buildClaudeOverrideExtraArgs(){const _0x63c665=_0x346e,_0x57b3a2={'ZTIQp':function(_0x1518ec){return _0x1518ec();}};if(_0x57b3a2[_0x63c665(0x6d)](isByokEnabled))return{};return{'settings':JSON['stringify'](RANGER_CLAUDE_OVERRIDE_SETTINGS)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5dc2b7,_0x44f686){const _0x15ce12=_0x2bd2,_0x42303e=_0x5dc2b7();while(!![]){try{const _0x5dd67f=-parseInt(_0x15ce12(0xaf))/0x1*(-parseInt(_0x15ce12(0xaa))/0x2)+parseInt(_0x15ce12(0x9b))/0x3+parseInt(_0x15ce12(0xae))/0x4+parseInt(_0x15ce12(0xa1))/0x5*(parseInt(_0x15ce12(0x9c))/0x6)+-parseInt(_0x15ce12(0x97))/0x7+parseInt(_0x15ce12(0xa8))/0x8+-parseInt(_0x15ce12(0x90))/0x9*(parseInt(_0x15ce12(0xa2))/0xa);if(_0x5dd67f===_0x44f686)break;else _0x42303e['push'](_0x42303e['shift']());}catch(_0x3a10dd){_0x42303e['push'](_0x42303e['shift']());}}}(_0x1533,0xe2704));import{spawn}from'child_process';function _0x1533(){const _0x20015e=['1XiCkao','version','list','23751iEQRSl','pipe','message','inherit','claude','enabled','output','10490879DngTUE','plugin','marketplace','nNunk','3743673CHykkf','6oMDtpj','stdout','ufsNZ','TQzOr','data','8665690rGPhnM','8630viSWLp','success','GiWva','[\x5cs\x5cS]*?Scope:\x5cs*(user|project|local)','includes','QiIWH','6542488wrZwSR','match','381460mLxVWy','kwldB','captureOutput','jGxFK','2856304IrlSvf'];_0x1533=function(){return _0x20015e;};return _0x1533();}export function runClaudeCommand(_0x19d2ce,_0xf1b72e){const _0x5f02c3=_0x2bd2,_0x98f6e2={'CtZzg':function(_0x3c33df,_0x32a382){return _0x3c33df(_0x32a382);},'GiWva':_0x5f02c3(0x91),'sOvID':function(_0x2a15db,_0x19a6c4,_0x38ebcf,_0x5208c3){return _0x2a15db(_0x19a6c4,_0x38ebcf,_0x5208c3);},'ufsNZ':_0x5f02c3(0x94),'TQzOr':_0x5f02c3(0xa0),'lHrNA':'close','kwldB':'error'};return new Promise(_0x4dd2f1=>{const _0x92ae72=_0x5f02c3,_0x3d5a8b={'QiIWH':function(_0x15a301,_0xcce5a){return _0x15a301(_0xcce5a);}},_0xe90cea=_0xf1b72e?.[_0x92ae72(0xac)]?_0x98f6e2[_0x92ae72(0xa4)]:_0x92ae72(0x93),_0x7b4f07=_0x98f6e2['sOvID'](spawn,_0x98f6e2[_0x92ae72(0x9e)],_0x19d2ce,{'stdio':_0xe90cea});let _0x18a3b0='';_0xf1b72e?.[_0x92ae72(0xac)]&&_0x7b4f07['stdout']&&_0x7b4f07[_0x92ae72(0x9d)]['on'](_0x98f6e2[_0x92ae72(0x9f)],_0x15c32e=>{_0x18a3b0+=_0x15c32e['toString']();}),_0xf1b72e?.['captureOutput']&&_0x7b4f07['stderr']&&_0x7b4f07['stderr']['on'](_0x92ae72(0xa0),_0x3c4102=>{_0x18a3b0+=_0x3c4102['toString']();}),_0x7b4f07['on'](_0x98f6e2['lHrNA'],_0x50a197=>{const _0x413370=_0x92ae72;_0x50a197===0x0?_0x3d5a8b[_0x413370(0xa7)](_0x4dd2f1,{'success':!![],'output':_0x18a3b0}):_0x4dd2f1({'success':![],'error':'Command\x20exited\x20with\x20code\x20'+_0x50a197,'output':_0x18a3b0});}),_0x7b4f07['on'](_0x98f6e2[_0x92ae72(0xab)],_0x35849e=>{const _0x22b341=_0x92ae72;_0x98f6e2['CtZzg'](_0x4dd2f1,{'success':![],'error':_0x35849e[_0x22b341(0x92)]});});});}export async function isMarketplaceAdded(_0x18ffc0){const _0xb3a83e=_0x2bd2,_0x35da99={'kIZRl':function(_0x227280,_0x3209db,_0x38c176){return _0x227280(_0x3209db,_0x38c176);}},_0x149826=await _0x35da99['kIZRl'](runClaudeCommand,[_0xb3a83e(0x98),_0xb3a83e(0x99),_0xb3a83e(0x8f)],{'captureOutput':!![]});if(!_0x149826['success']||!_0x149826[_0xb3a83e(0x96)])return![];return _0x149826[_0xb3a83e(0x96)]['includes'](_0x18ffc0);}export async function isPluginInstalled(_0x72fbf3){const _0x7f9a57=_0x2bd2,_0xb05261={'nNunk':function(_0x228055,_0x883c2d,_0x20cc29){return _0x228055(_0x883c2d,_0x20cc29);}},_0x8bcf79=await _0xb05261[_0x7f9a57(0x9a)](runClaudeCommand,['plugin','list'],{'captureOutput':!![]});if(!_0x8bcf79['success']||!_0x8bcf79['output'])return![];return _0x8bcf79[_0x7f9a57(0x96)][_0x7f9a57(0xa6)](_0x72fbf3);}function _0x2bd2(_0x2f7187,_0x359597){_0x2f7187=_0x2f7187-0x8e;const _0x1533eb=_0x1533();let _0x2bd2bc=_0x1533eb[_0x2f7187];return _0x2bd2bc;}export async function getPluginInfo(_0x4c51b7){const _0x48637c=_0x2bd2,_0x393e4e={'jGxFK':'plugin','hfRWA':'list'},_0x2ef6ea=await runClaudeCommand([_0x393e4e[_0x48637c(0xad)],_0x393e4e['hfRWA']],{'captureOutput':!![]});if(!_0x2ef6ea[_0x48637c(0xa3)]||!_0x2ef6ea[_0x48637c(0x96)])return null;if(!_0x2ef6ea[_0x48637c(0x96)]['includes'](_0x4c51b7))return null;const _0xb95f88={'name':_0x4c51b7},_0x2d826d=_0x2ef6ea['output'][_0x48637c(0xa9)](new RegExp(_0x4c51b7+_0x48637c(0xa5),'i'));_0x2d826d&&(_0xb95f88['scope']=_0x2d826d[0x1]['toLowerCase']());const _0x3a269f=_0x2ef6ea['output']['match'](new RegExp(_0x4c51b7+'[\x5cs\x5cS]*?Version:\x5cs*([\x5cd.]+)','i'));_0x3a269f&&(_0xb95f88[_0x48637c(0x8e)]=_0x3a269f[0x1]);const _0x3a0450=_0x2ef6ea[_0x48637c(0x96)]['match'](new RegExp(_0x4c51b7+'[\x5cs\x5cS]*?(enabled|disabled)','i'));return _0x3a0450&&(_0xb95f88[_0x48637c(0x95)]=_0x3a0450[0x1]['toLowerCase']()===_0x48637c(0x95)),_0xb95f88;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const _0x441d4c=_0x2681;(function(_0x37b8e7,_0x23880c){const _0x3d2ad1=_0x2681,_0x1e8ded=_0x37b8e7();while(!![]){try{const _0x9f611f=parseInt(_0x3d2ad1(0x194))/0x1*(-parseInt(_0x3d2ad1(0x198))/0x2)+parseInt(_0x3d2ad1(0x18f))/0x3+parseInt(_0x3d2ad1(0x18e))/0x4+parseInt(_0x3d2ad1(0x19d))/0x5+parseInt(_0x3d2ad1(0x19c))/0x6+-parseInt(_0x3d2ad1(0x192))/0x7*(parseInt(_0x3d2ad1(0x18d))/0x8)+-parseInt(_0x3d2ad1(0x193))/0x9*(parseInt(_0x3d2ad1(0x18c))/0xa);if(_0x9f611f===_0x23880c)break;else _0x1e8ded['push'](_0x1e8ded['shift']());}catch(_0x381273){_0x1e8ded['push'](_0x1e8ded['shift']());}}}(_0x14c8,0x5e0ba));import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';function _0x2681(_0x1c9f16,_0x1fc9e2){_0x1c9f16=_0x1c9f16-0x18a;const _0x14c87d=_0x14c8();let _0x2681c7=_0x14c87d[_0x1c9f16];return _0x2681c7;}const ALGORITHM=_0x441d4c(0x190),SALT=_0x441d4c(0x19e),KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;function _0x14c8(){const _0x4c3fc1=['sha256','QgCUG','2EztIum','concat','final','subarray','4340304DfHQTg','873960RkPzKQ','ranger-auth-encryption','uXIhF','getAuthTag','2888770rOBKrR','24qXOQjk','2617536Tohiak','1731429rPzyNK','aes-256-gcm','XJTuJ','684761iFPwee','27ZLXbFN','584393ebrYNZ','setAuthTag'];_0x14c8=function(){return _0x4c3fc1;};return _0x14c8();}export function deriveKey(_0xbf52d2){const _0x579046=_0x441d4c;return pbkdf2Sync(_0xbf52d2,SALT,0x186a0,KEY_LENGTH,_0x579046(0x196));}export function encrypt(_0x39f652,_0x1df023){const _0x3fbb7c=_0x441d4c,_0x28027b={'yhzpq':function(_0x2cb2cc,_0x1e4e63){return _0x2cb2cc(_0x1e4e63);},'QgCUG':function(_0x8ab8ae,_0x22cca4,_0x227862,_0x337408){return _0x8ab8ae(_0x22cca4,_0x227862,_0x337408);},'YWafI':'utf8'},_0x20c791=_0x28027b['yhzpq'](deriveKey,_0x1df023),_0x11ec4a=randomBytes(IV_LENGTH),_0x330883=_0x28027b[_0x3fbb7c(0x197)](createCipheriv,ALGORITHM,_0x20c791,_0x11ec4a),_0x3c398d=Buffer['concat']([_0x330883['update'](_0x39f652,_0x28027b['YWafI']),_0x330883['final']()]),_0x4adf78=_0x330883[_0x3fbb7c(0x18b)]();return Buffer[_0x3fbb7c(0x199)]([_0x11ec4a,_0x4adf78,_0x3c398d]);}export function decrypt(_0x35ccc9,_0x56a7c7){const _0x456393=_0x441d4c,_0x4d37d7={'fpOod':function(_0x2ca731,_0x328d42){return _0x2ca731(_0x328d42);},'uXIhF':function(_0x11e900,_0x4f7cb6){return _0x11e900+_0x4f7cb6;},'XJTuJ':function(_0x154f4a,_0x1bed98,_0x414502,_0x185372){return _0x154f4a(_0x1bed98,_0x414502,_0x185372);},'FawAe':function(_0x5182b9,_0x474723){return _0x5182b9+_0x474723;}},_0x46672d=_0x4d37d7['fpOod'](deriveKey,_0x56a7c7),_0x1651e8=_0x35ccc9['subarray'](0x0,IV_LENGTH),_0x32d78f=_0x35ccc9[_0x456393(0x19b)](IV_LENGTH,IV_LENGTH+TAG_LENGTH),_0x3595c8=_0x35ccc9['subarray'](_0x4d37d7[_0x456393(0x18a)](IV_LENGTH,TAG_LENGTH)),_0x28642c=_0x4d37d7[_0x456393(0x191)](createDecipheriv,ALGORITHM,_0x46672d,_0x1651e8);return _0x28642c[_0x456393(0x195)](_0x32d78f),_0x4d37d7['FawAe'](_0x28642c['update'](_0x3595c8),_0x28642c[_0x456393(0x19a)]('utf8'));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x1cd890=_0x1e0c;(function(_0x730fbb,_0x1510de){const _0x37037f=_0x1e0c,_0xc8d788=_0x730fbb();while(!![]){try{const _0x5ef985=parseInt(_0x37037f(0x1f1))/0x1*(-parseInt(_0x37037f(0x1f6))/0x2)+-parseInt(_0x37037f(0x215))/0x3+-parseInt(_0x37037f(0x1fd))/0x4*(-parseInt(_0x37037f(0x1ff))/0x5)+-parseInt(_0x37037f(0x1f8))/0x6*(-parseInt(_0x37037f(0x205))/0x7)+parseInt(_0x37037f(0x217))/0x8+-parseInt(_0x37037f(0x20d))/0x9+parseInt(_0x37037f(0x203))/0xa*(parseInt(_0x37037f(0x1fa))/0xb);if(_0x5ef985===_0x1510de)break;else _0xc8d788['push'](_0xc8d788['shift']());}catch(_0x6fbaf5){_0xc8d788['push'](_0xc8d788['shift']());}}}(_0x43b9,0xc3eea));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';function _0x1e0c(_0x43dacb,_0x9f3c16){_0x43dacb=_0x43dacb-0x1f0;const _0x43b9a7=_0x43b9();let _0x1e0cd7=_0x43b9a7[_0x43dacb];return _0x1e0cd7;}const SENSITIVE_FLAGS=new Set(['--token','-t','--secret',_0x1cd890(0x222),'--apikey','--key',_0x1cd890(0x20c),'--pass','--auth','--authorization',_0x1cd890(0x211),_0x1cd890(0x202),'--credentials']),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0x43f1ed){const _0x198306=_0x1cd890;return TOKEN_PATTERNS[_0x198306(0x1f2)](_0x5884c7=>_0x5884c7[_0x198306(0x1fe)](_0x43f1ed));}export function sanitizeArgs(_0x262d24){const _0xd54a8=_0x1cd890,_0x26488d={'ltRyb':function(_0x3e9c5c,_0x50e8b9){return _0x3e9c5c<_0x50e8b9;},'EcxzE':'[REDACTED]','uIAtC':function(_0x32b227,_0x3b28eb){return _0x32b227!==_0x3b28eb;},'UjRbX':function(_0x4bea92,_0x3283ae){return _0x4bea92(_0x3283ae);}},_0x1b9572=[];let _0x44009d=![];for(let _0x2449e6=0x0;_0x26488d[_0xd54a8(0x1f9)](_0x2449e6,_0x262d24[_0xd54a8(0x214)]);_0x2449e6++){const _0x2cd0cc=_0x262d24[_0x2449e6];if(_0x44009d){_0x1b9572['push'](_0x26488d['EcxzE']),_0x44009d=![];continue;}if(_0x2cd0cc[_0xd54a8(0x201)]('--')||_0x2cd0cc['startsWith']('-')){const _0x5558ab=_0x2cd0cc[_0xd54a8(0x1f3)]('=');if(_0x26488d[_0xd54a8(0x21d)](_0x5558ab,-0x1)){const _0x1ce500=_0x2cd0cc['slice'](0x0,_0x5558ab)['toLowerCase']();if(SENSITIVE_FLAGS['has'](_0x1ce500)){_0x1b9572[_0xd54a8(0x21c)](_0x2cd0cc[_0xd54a8(0x21e)](0x0,_0x5558ab)+_0xd54a8(0x21f));continue;}}else{const _0x711e9d=_0x2cd0cc[_0xd54a8(0x209)]();SENSITIVE_FLAGS[_0xd54a8(0x20f)](_0x711e9d)&&(_0x44009d=!![]);}_0x1b9572[_0xd54a8(0x21c)](_0x2cd0cc);}else _0x26488d['UjRbX'](looksLikeToken,_0x2cd0cc)?_0x1b9572['push']('[REDACTED]'):_0x1b9572[_0xd54a8(0x21c)](_0x2cd0cc);}return _0x1b9572[_0xd54a8(0x1f4)]('\x20');}function _0x43b9(){const _0x5adbdc=['1256772rPiGQm','test','5eHYurE','has_token','startsWith','--cookie','1206990KFDqYr','errorType','7JNfgbX','[desire-path]\x20Failed\x20to\x20send:\x20','catch','application/json','toLowerCase','GunGS','POST','--password','8085465IdHfaD','unknown_argument','has','yyawr','--header','sessionId','Missing\x20required\x20argument','length','2564811WrGJrQ','/api/v1/mcp/desire-path-logs','2424472GDcEoD','[desire-path]\x20Payload:\x20','stdout','oUbmi','includes','push','uIAtC','slice','=[REDACTED]','unknown_command','Authorization','--api-key','runtime_error','invalid_option_value','Unknown\x20command','BMdIo','21OQdJOp','some','indexOf','join','env','33164FXQVuc','XXjpC','4306458QJRYUV','ltRyb','143oQMHAJ','stringify','tPsdE'];_0x43b9=function(){return _0x5adbdc;};return _0x43b9();}export async function logDesirePath(_0x3d6289){const _0x585ae0=_0x1cd890,_0x4f55ed={'BMdIo':function(_0x576a27){return _0x576a27();},'ezTQc':function(_0x4a7fff){return _0x4a7fff();},'brZAP':'no_token','MlKEm':_0x585ae0(0x20b)};try{const _0x4ee9cb=await _0x4f55ed['BMdIo'](getToken)[_0x585ae0(0x207)](()=>null),_0xaf38ce=_0x4f55ed[_0x585ae0(0x1f0)](getApiBaseUrl),_0x4f2f01=_0x4f55ed['ezTQc'](getCurrentVersion),_0x343c93=_0x4ee9cb?_0x585ae0(0x200):_0x4f55ed['brZAP'],_0x277a62={..._0x3d6289['metadata'],'authStatus':_0x343c93,'isTty':process[_0x585ae0(0x219)]['isTTY']??![]},_0x3971d1={'Content-Type':_0x585ae0(0x208)};_0x4ee9cb&&(_0x3971d1[_0x585ae0(0x221)]='Bearer\x20'+_0x4ee9cb);const _0x46e309={'rawCommand':_0x3d6289['rawCommand'],'errorMessage':_0x3d6289['errorMessage'],'errorType':_0x3d6289[_0x585ae0(0x204)],'featureId':_0x3d6289['featureId'],'sessionId':_0x3d6289[_0x585ae0(0x212)],'metadata':_0x277a62,'cliVersion':_0x4f2f01};process[_0x585ae0(0x1f5)]['DEBUG']&&(console['error']('[desire-path]\x20Sending\x20log\x20to\x20'+_0xaf38ce+'/api/v1/mcp/desire-path-logs'),console['error'](_0x585ae0(0x218)+JSON['stringify'](_0x46e309,null,0x2))),await fetch(_0xaf38ce+_0x585ae0(0x216),{'method':_0x4f55ed['MlKEm'],'headers':_0x3971d1,'body':JSON[_0x585ae0(0x1fb)](_0x46e309)});}catch(_0x1ac61f){process['env']['DEBUG']&&console['error'](_0x585ae0(0x206)+_0x1ac61f);}}export function getErrorType(_0x5ecd9e,_0x3ffef8){const _0x57d7b1=_0x1cd890,_0x196818={'aVCtt':'unknown','oUbmi':_0x57d7b1(0x225),'miazI':'Unknown\x20argument','yyawr':'Not\x20enough\x20non-option\x20arguments','XXjpC':'missing_required_argument','tPsdE':'Invalid\x20values','SOewS':_0x57d7b1(0x224),'GunGS':'missing_option'};if(_0x3ffef8)return _0x57d7b1(0x223);if(!_0x5ecd9e)return _0x196818['aVCtt'];if(_0x5ecd9e['includes'](_0x196818[_0x57d7b1(0x21a)]))return _0x57d7b1(0x220);if(_0x5ecd9e['includes'](_0x196818['miazI']))return _0x57d7b1(0x20e);if(_0x5ecd9e[_0x57d7b1(0x21b)](_0x196818[_0x57d7b1(0x210)]))return _0x196818[_0x57d7b1(0x1f7)];if(_0x5ecd9e['includes'](_0x196818[_0x57d7b1(0x1fc)]))return _0x196818['SOewS'];if(_0x5ecd9e['includes'](_0x57d7b1(0x213)))return _0x196818[_0x57d7b1(0x20a)];return'syntax_error';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x23c67e=_0x583c;(function(_0x48abdd,_0x3fb574){const _0x1a852e=_0x583c,_0xda301c=_0x48abdd();while(!![]){try{const _0x284512=parseInt(_0x1a852e(0x158))/0x1+parseInt(_0x1a852e(0x18e))/0x2*(-parseInt(_0x1a852e(0x17b))/0x3)+parseInt(_0x1a852e(0x194))/0x4+parseInt(_0x1a852e(0x151))/0x5+parseInt(_0x1a852e(0x165))/0x6*(-parseInt(_0x1a852e(0x185))/0x7)+-parseInt(_0x1a852e(0x157))/0x8+-parseInt(_0x1a852e(0x153))/0x9*(parseInt(_0x1a852e(0x170))/0xa);if(_0x284512===_0x3fb574)break;else _0xda301c['push'](_0xda301c['shift']());}catch(_0x5c5051){_0xda301c['push'](_0xda301c['shift']());}}}(_0xb6f5,0xde408));import{exec}from'child_process';import _0x296c1f from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';function _0xb6f5(){const _0x3d5c42=['Failed\x20to\x20provision\x20API\x20key:\x20','20648KxjjIn','697761RrnEAI','TgPCV','workosClientId','KXQVW','VPbEC','NWEay','Authentication\x20failed','status','Using\x20organization:\x20','Setting\x20up\x20your\x20organization...','log','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20','apiKey','44466gKQmpJ','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','error_description','https://api.workos.com/user_management/authenticate','utf-8','apiKeys','application/x-www-form-urlencoded','refresh_token','application/json','user_code','verification_uri_complete','10wHPbUw','authorization_pending','now','text','xdg-open','Failed\x20to\x20request\x20device\x20code:\x20','jEdLm','split','stdout','VySgU','qPTEL','1275789ZFdwWh','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','stringify','name','map','CpzQP','Lrxjd','length','organizationId','expires_in','623nSwZdP','jccjg','write','startsWith','\x27s\x20CLI\x20Key','error','uTMIt','json','https://api.workos.com/user_management/authorize/device','2rIVgGi','rUycE','darwin','isTTY','qHQIS','eXtnD','6105408vtMICh','GET','GNFJG','6348255inPlPI','list','13463973RYOZvG','Select\x20an\x20organization:','access_token'];_0xb6f5=function(){return _0x3d5c42;};return _0xb6f5();}import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL=_0x23c67e(0x18d),WORKOS_TOKEN_URL=_0x23c67e(0x168);export async function requestDeviceCode(_0x75612f){const _0x55cbd4=_0x23c67e,_0x1e245c={'jccjg':'POST','EDDfQ':'application/x-www-form-urlencoded'},_0x25ee02=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x1e245c[_0x55cbd4(0x186)],'headers':{'Content-Type':_0x1e245c['EDDfQ']},'body':new URLSearchParams({'client_id':_0x75612f})});if(!_0x25ee02['ok']){const _0xeeca9c=await _0x25ee02[_0x55cbd4(0x173)]();throw new Error(_0x55cbd4(0x175)+_0x25ee02['status']+'\x20'+_0xeeca9c);}return _0x25ee02['json']();}export async function pollForTokens(_0x518ae6,_0xe12e11,_0x2882ce,_0x299929){const _0x204ffa=_0x23c67e,_0x52b49b={'rUycE':function(_0xe95ab4,_0x35ce93){return _0xe95ab4+_0x35ce93;},'NeSgu':function(_0x286f8f,_0x3cbc66){return _0x286f8f*_0x3cbc66;},'VySgU':function(_0x498703,_0x450d30){return _0x498703<_0x450d30;},'eELwV':function(_0x1a8406,_0x56dace){return _0x1a8406(_0x56dace);},'NGBFq':function(_0xcb333,_0x33402f,_0x1a390d){return _0xcb333(_0x33402f,_0x1a390d);},'qStOM':_0x204ffa(0x16b),'CpzQP':function(_0x138e89,_0x402116){return _0x138e89===_0x402116;},'Lrxjd':_0x204ffa(0x171),'PRiNy':function(_0x28467e,_0x320a2b){return _0x28467e===_0x320a2b;}},_0x416e58=_0x52b49b[_0x204ffa(0x18f)](Date['now'](),_0x52b49b['NeSgu'](_0x299929,0x3e8));let _0x24b3e7=_0x2882ce*0x3e8;while(_0x52b49b[_0x204ffa(0x179)](Date[_0x204ffa(0x172)](),_0x416e58)){await _0x52b49b['eELwV'](sleep,_0x24b3e7);const _0x30ce3b=await _0x52b49b['NGBFq'](fetch,WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':_0x52b49b['qStOM']},'body':new URLSearchParams({'client_id':_0x518ae6,'device_code':_0xe12e11,'grant_type':'urn:ietf:params:oauth:grant-type:device_code'})});if(_0x30ce3b['ok'])return _0x30ce3b['json']();const _0x4fe024=await _0x30ce3b[_0x204ffa(0x18c)]();if(_0x52b49b[_0x204ffa(0x180)](_0x4fe024['error'],_0x52b49b[_0x204ffa(0x181)]))continue;if(_0x52b49b['PRiNy'](_0x4fe024['error'],'slow_down')){_0x24b3e7+=0x3e8;continue;}throw new Error(_0x4fe024[_0x204ffa(0x167)]||_0x4fe024[_0x204ffa(0x18a)]||_0x204ffa(0x15e));}throw new Error('Device\x20authorization\x20timed\x20out');}async function fetchUserProfile(_0x5396f9){const _0x36f1e2=_0x23c67e,_0x46a4e3={'mpQel':_0x36f1e2(0x195)},_0xf1844c=getApiBaseUrl();try{const _0x3b9878=await fetch(_0xf1844c+'/organization/me',{'method':_0x46a4e3['mpQel'],'headers':{'workos-token':_0x5396f9}});if(_0x3b9878['ok'])return _0x3b9878[_0x36f1e2(0x18c)]();}catch{}return null;}function buildKeyName(_0x36cd69,_0x93237c){const _0x45d4a0=_0x23c67e,_0x31d030=_0x93237c['filter'](_0x23a35f=>_0x23a35f['name']===_0x36cd69||_0x23a35f[_0x45d4a0(0x17e)][_0x45d4a0(0x188)](_0x36cd69+'\x20('));if(_0x31d030['length']===0x0)return _0x36cd69;return _0x36cd69+'\x20('+(_0x31d030['length']+0x1)+')';}function _0x583c(_0x57f0f1,_0x65151f){_0x57f0f1=_0x57f0f1-0x150;const _0xb6f505=_0xb6f5();let _0x583c06=_0xb6f505[_0x57f0f1];return _0x583c06;}export async function provisionApiKey(_0x175d7b){const _0x2afbca=_0x23c67e,_0x4dbf79={'NWEay':function(_0xd795b0){return _0xd795b0();},'jhCDi':'CLI\x20Key','TgPCV':function(_0x1e05e1,_0x433617,_0x15066a){return _0x1e05e1(_0x433617,_0x15066a);}},_0x43e1ee=_0x4dbf79[_0x2afbca(0x15d)](getApiBaseUrl),_0x59f732={'Content-Type':'application/json','workos-token':_0x175d7b},_0x478465=await fetchUserProfile(_0x175d7b),_0x4e8979=_0x478465?.['firstName']||_0x478465?.['email']?.[_0x2afbca(0x177)]('@')[0x0],_0x17867e=_0x4e8979?_0x4e8979+_0x2afbca(0x189):_0x4dbf79['jhCDi'];let _0x357b5d=[];try{const _0xf1f13d=await fetch(_0x43e1ee+'/api-keys',{'method':_0x2afbca(0x195),'headers':_0x59f732});if(_0xf1f13d['ok']){const _0x3ac9d0=await _0xf1f13d[_0x2afbca(0x18c)]();_0x357b5d=_0x3ac9d0[_0x2afbca(0x16a)];}}catch{}const _0x3b0846=_0x4dbf79[_0x2afbca(0x159)](buildKeyName,_0x17867e,_0x357b5d),_0x5c4ae3=await _0x4dbf79[_0x2afbca(0x159)](fetch,_0x43e1ee+'/api-keys',{'method':'POST','headers':_0x59f732,'body':JSON[_0x2afbca(0x17d)]({'name':_0x3b0846,'scope':'mcp:write'})});if(!_0x5c4ae3['ok']){const _0x5ef1c1=await _0x5c4ae3['text']();throw new Error(_0x2afbca(0x156)+_0x5c4ae3[_0x2afbca(0x15f)]+'\x20'+_0x5ef1c1);}const _0x22aa97=await _0x5c4ae3['json']();return _0x22aa97[_0x2afbca(0x164)]['token'];}export function openBrowser(_0x16101d){const _0x46caa1=_0x23c67e,_0x4086f7={'MNibE':function(_0x431030,_0x1f5d61){return _0x431030===_0x1f5d61;},'LSHtE':function(_0x3080ba,_0x5e3bfd){return _0x3080ba===_0x5e3bfd;},'gSkTG':'win32','pXsLN':function(_0x3e8370,_0x5ec3e8){return _0x3e8370(_0x5ec3e8);}},_0xc0a6b6=process['platform'],_0x1a8687=_0x4086f7['MNibE'](_0xc0a6b6,_0x46caa1(0x190))?'open':_0x4086f7['LSHtE'](_0xc0a6b6,_0x4086f7['gSkTG'])?'start':_0x46caa1(0x174);_0x4086f7['pXsLN'](exec,_0x1a8687+'\x20'+JSON['stringify'](_0x16101d));}function decodeJwtPayload(_0x19bc31){const _0x350827=_0x23c67e,_0x48c006={'iFjCc':function(_0x5e7a8e,_0x42a467){return _0x5e7a8e!==_0x42a467;},'uTMIt':'Invalid\x20JWT\x20format','eXtnD':_0x350827(0x169)},_0x21c63b=_0x19bc31[_0x350827(0x177)]('.');if(_0x48c006['iFjCc'](_0x21c63b['length'],0x3))throw new Error(_0x48c006[_0x350827(0x18b)]);const _0xd52c30=Buffer['from'](_0x21c63b[0x1],'base64url')['toString'](_0x48c006[_0x350827(0x193)]);return JSON['parse'](_0xd52c30);}async function selfServeSignup(_0x6ab139){const _0x1cd009=_0x23c67e,_0x47e085={'GNFJG':_0x1cd009(0x16d)},_0x3a6f77=getApiBaseUrl(),_0x2bba20=await fetch(_0x3a6f77+'/organization/self-serve-signup',{'method':'POST','headers':{'Content-Type':_0x47e085[_0x1cd009(0x150)],'workos-token':_0x6ab139}});if(!_0x2bba20['ok']){const _0x2965f7=await _0x2bba20['text']();throw new Error('Failed\x20to\x20create\x20organization:\x20'+_0x2bba20['status']+'\x20'+_0x2965f7);}return _0x2bba20[_0x1cd009(0x18c)]();}async function fetchMyMemberships(_0x2e1963){const _0x5ad636=_0x23c67e,_0x5c3267={'qPTEL':'GET'},_0x508cb9=getApiBaseUrl(),_0x205b1a=await fetch(_0x508cb9+'/organization/my-memberships',{'method':_0x5c3267[_0x5ad636(0x17a)],'headers':{'workos-token':_0x2e1963}});if(!_0x205b1a['ok']){const _0x5deb51=await _0x205b1a[_0x5ad636(0x173)]();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0x205b1a[_0x5ad636(0x15f)]+'\x20'+_0x5deb51);}const _0x183a86=await _0x205b1a['json']();return _0x183a86['memberships'];}async function refreshTokenWithOrg(_0x4caea8,_0x4f057b,_0x138e63){const _0x3f2693=_0x23c67e,_0x34d54b=await fetch(WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0x4caea8,'grant_type':'refresh_token','refresh_token':_0x4f057b,'organization_id':_0x138e63})});if(!_0x34d54b['ok']){const _0x112bdc=await _0x34d54b['text']();throw new Error(_0x3f2693(0x163)+_0x34d54b[_0x3f2693(0x15f)]+'\x20'+_0x112bdc);}return _0x34d54b['json']();}export async function runDeviceAuthFlow(){const _0x1508c6=_0x23c67e,_0x43e609={'WIMZY':_0x1508c6(0x166),'oCgML':function(_0x18a74e,_0x3a0d16,_0xaefa1a,_0x15d147,_0x480149){return _0x18a74e(_0x3a0d16,_0xaefa1a,_0x15d147,_0x480149);},'qHQIS':function(_0x4c4980,_0x10de56){return _0x4c4980===_0x10de56;},'jEdLm':function(_0x252706,_0x4ff4df){return _0x252706+_0x4ff4df;},'VPbEC':_0x1508c6(0x17c),'cJeFO':_0x1508c6(0x154),'KXQVW':function(_0x520f98,_0x1d2308,_0x302808,_0x5952e6){return _0x520f98(_0x1d2308,_0x302808,_0x5952e6);},'FrppF':function(_0x18b521,_0xed2f14){return _0x18b521(_0xed2f14);}},_0x2f0773=getCurrentEnvironment(),_0x481b3d=ENVIRONMENT_CONFIGS[_0x2f0773][_0x1508c6(0x15a)],_0x452066=await requestDeviceCode(_0x481b3d);console['log']('\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...'),console[_0x1508c6(0x162)](_0x43e609['WIMZY']),openBrowser(_0x452066[_0x1508c6(0x16f)]),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x452066['verification_uri_complete']),console[_0x1508c6(0x162)]('Code:\x20'+_0x452066[_0x1508c6(0x16e)]+'\x0a'),process[_0x1508c6(0x178)][_0x1508c6(0x187)]('Waiting\x20for\x20authentication...');let _0x5cfd7b=await _0x43e609['oCgML'](pollForTokens,_0x481b3d,_0x452066['device_code'],_0x452066['interval'],_0x452066[_0x1508c6(0x184)]);console['log']('\x20✓');const _0x5aafa7=decodeJwtPayload(_0x5cfd7b['access_token']);if(!_0x5aafa7['org_id']){const _0x1ba5b2=await fetchMyMemberships(_0x5cfd7b[_0x1508c6(0x155)]);let _0x234f27;if(_0x43e609[_0x1508c6(0x192)](_0x1ba5b2['length'],0x0)){process[_0x1508c6(0x178)][_0x1508c6(0x187)](_0x1508c6(0x161));const _0xdc3d7=await selfServeSignup(_0x5cfd7b['access_token']);_0x234f27=_0xdc3d7[_0x1508c6(0x183)],console['log']('\x20✓');}else{if(_0x1ba5b2[_0x1508c6(0x182)]===0x1)_0x234f27=_0x1ba5b2[0x0]['organizationId'],console[_0x1508c6(0x162)](_0x1508c6(0x160)+_0x1ba5b2[0x0][_0x1508c6(0x17e)]);else{const _0x18dde2=process['stdin']['isTTY']&&process[_0x1508c6(0x178)][_0x1508c6(0x191)];if(!_0x18dde2)throw new Error(_0x43e609[_0x1508c6(0x176)](_0x43e609[_0x1508c6(0x15c)],'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.'));const {selected:_0x29b8ba}=await _0x296c1f['prompt']([{'type':_0x1508c6(0x152),'name':'selected','message':_0x43e609['cJeFO'],'choices':_0x1ba5b2[_0x1508c6(0x17f)](_0x4c93b1=>({'name':_0x4c93b1[_0x1508c6(0x17e)],'value':_0x4c93b1[_0x1508c6(0x183)]}))}]);_0x234f27=_0x29b8ba;}}_0x5cfd7b=await _0x43e609[_0x1508c6(0x15b)](refreshTokenWithOrg,_0x481b3d,_0x5cfd7b[_0x1508c6(0x16c)],_0x234f27);}process['stdout'][_0x1508c6(0x187)]('Provisioning\x20API\x20key...');const _0x49e7ca=await provisionApiKey(_0x5cfd7b[_0x1508c6(0x155)]);return console['log']('\x20✓'),await storeToken(_0x49e7ca),_0x5cfd7b[_0x1508c6(0x16c)]&&await _0x43e609['FrppF'](storeRefreshToken,_0x5cfd7b['refresh_token']),_0x49e7ca;}function sleep(_0x167d97){return new Promise(_0x49c714=>setTimeout(_0x49c714,_0x167d97));}
|
|
1
|
+
const _0x100281=_0x276c;(function(_0x34660e,_0x1c0adc){const _0x59a8a1=_0x276c,_0x1929ff=_0x34660e();while(!![]){try{const _0x48c1f0=-parseInt(_0x59a8a1(0xbe))/0x1*(parseInt(_0x59a8a1(0x95))/0x2)+-parseInt(_0x59a8a1(0x9a))/0x3+-parseInt(_0x59a8a1(0xab))/0x4+parseInt(_0x59a8a1(0xa6))/0x5+parseInt(_0x59a8a1(0xa2))/0x6*(-parseInt(_0x59a8a1(0xc4))/0x7)+-parseInt(_0x59a8a1(0x96))/0x8+-parseInt(_0x59a8a1(0xc1))/0x9*(-parseInt(_0x59a8a1(0x99))/0xa);if(_0x48c1f0===_0x1c0adc)break;else _0x1929ff['push'](_0x1929ff['shift']());}catch(_0x4dfa55){_0x1929ff['push'](_0x1929ff['shift']());}}}(_0x8b57,0x2a29c));import{exec}from'child_process';import _0x10f41b from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';function _0x8b57(){const _0x81430e=['CpAiT','UyIkT','HIGWJ','access_token','stringify','HsCbR','ycMHE','split','json','/api-keys','status','name','https://api.workos.com/user_management/authorize/device','ImvaL','startsWith','organizationId','text','DARIF','application/x-www-form-urlencoded','pLdbo','length','refresh_token','Using\x20organization:\x20','cHXvL','stdin','xdg-open','error_description','1796TbbNMV','1361672fifIPy','ALIQX','urn:ietf:params:oauth:grant-type:device_code','550aZbrWu','457122WKnFYY','/organization/me','list','dCytr','stdout','zQSNu','GET','LRCYv','6ghNkPK','CLI\x20Key','firstName','zmpyw','1002200prokkN','parse','base64url','BCSkw','UDnHN','486668ReQhBq','Select\x20an\x20organization:','Failed\x20to\x20fetch\x20memberships:\x20','POST','device_code','SJFGI','IrKaM','write','error','/organization/self-serve-signup','email','xFWeL','fGRBi','Setting\x20up\x20your\x20organization...','log','POsrp','Device\x20authorization\x20timed\x20out','isTTY','now','16xjZSak','slow_down','hwemq','109899EoeKhg','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','open','1685089dsMEJk','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'];_0x8b57=function(){return _0x81430e;};return _0x8b57();}const WORKOS_DEVICE_AUTH_URL=_0x100281(0x86),WORKOS_TOKEN_URL='https://api.workos.com/user_management/authenticate';export async function requestDeviceCode(_0xdf619f){const _0x2d7ba7=_0x100281,_0x39e7ac={'fGRBi':_0x2d7ba7(0xae),'bCqWe':_0x2d7ba7(0x8c)},_0x51bf15=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x39e7ac[_0x2d7ba7(0xb7)],'headers':{'Content-Type':_0x39e7ac['bCqWe']},'body':new URLSearchParams({'client_id':_0xdf619f})});if(!_0x51bf15['ok']){const _0x3c5231=await _0x51bf15[_0x2d7ba7(0x8a)]();throw new Error('Failed\x20to\x20request\x20device\x20code:\x20'+_0x51bf15['status']+'\x20'+_0x3c5231);}return _0x51bf15['json']();}export async function pollForTokens(_0x376da5,_0x31135a,_0x234dd0,_0x146783){const _0x52f3ff=_0x100281,_0x233298={'EcHQX':function(_0x2c88b3,_0x4c38ac){return _0x2c88b3*_0x4c38ac;},'SJFGI':'POST','jJbFo':_0x52f3ff(0x98),'NncES':'authorization_pending','Vjmji':function(_0x433dc5,_0x432d4e){return _0x433dc5===_0x432d4e;},'pLdbo':_0x52f3ff(0xbf),'BCSkw':_0x52f3ff(0xbb)},_0x567462=Date['now']()+_0x233298['EcHQX'](_0x146783,0x3e8);let _0x4f332c=_0x234dd0*0x3e8;while(Date[_0x52f3ff(0xbd)]()<_0x567462){await sleep(_0x4f332c);const _0x2e634b=await fetch(WORKOS_TOKEN_URL,{'method':_0x233298[_0x52f3ff(0xb0)],'headers':{'Content-Type':_0x52f3ff(0x8c)},'body':new URLSearchParams({'client_id':_0x376da5,'device_code':_0x31135a,'grant_type':_0x233298['jJbFo']})});if(_0x2e634b['ok'])return _0x2e634b['json']();const _0x47497e=await _0x2e634b[_0x52f3ff(0x82)]();if(_0x47497e[_0x52f3ff(0xb3)]===_0x233298['NncES'])continue;if(_0x233298['Vjmji'](_0x47497e[_0x52f3ff(0xb3)],_0x233298[_0x52f3ff(0x8d)])){_0x4f332c+=0x3e8;continue;}throw new Error(_0x47497e[_0x52f3ff(0x94)]||_0x47497e['error']||'Authentication\x20failed');}throw new Error(_0x233298[_0x52f3ff(0xa9)]);}async function fetchUserProfile(_0x2c341d){const _0x2a61f5=_0x100281,_0x5f4fef={'EbOuB':function(_0x3cb060,_0x1c4335,_0x29d395){return _0x3cb060(_0x1c4335,_0x29d395);},'XAVKt':'GET'},_0x1e861e=getApiBaseUrl();try{const _0x1c597b=await _0x5f4fef['EbOuB'](fetch,_0x1e861e+_0x2a61f5(0x9b),{'method':_0x5f4fef['XAVKt'],'headers':{'workos-token':_0x2c341d}});if(_0x1c597b['ok'])return _0x1c597b['json']();}catch{}return null;}function _0x276c(_0x2d1b79,_0x53dd0c){_0x2d1b79=_0x2d1b79-0x7f;const _0x8b579d=_0x8b57();let _0x276c41=_0x8b579d[_0x2d1b79];return _0x276c41;}function buildKeyName(_0x1619f0,_0x281752){const _0x21d1a0=_0x100281,_0x50f397=_0x281752['filter'](_0x326ed3=>_0x326ed3['name']===_0x1619f0||_0x326ed3['name'][_0x21d1a0(0x88)](_0x1619f0+'\x20('));if(_0x50f397[_0x21d1a0(0x8e)]===0x0)return _0x1619f0;return _0x1619f0+'\x20('+(_0x50f397['length']+0x1)+')';}export async function provisionApiKey(_0x1cb91d){const _0xe98c42=_0x100281,_0x488a71={'UyIkT':function(_0x4df824){return _0x4df824();},'DARIF':function(_0x3eec3b,_0x570fec,_0x390d74){return _0x3eec3b(_0x570fec,_0x390d74);},'zQSNu':_0xe98c42(0xae)},_0x73d36c=_0x488a71[_0xe98c42(0xc7)](getApiBaseUrl),_0x4fcfc1={'Content-Type':'application/json','workos-token':_0x1cb91d},_0x40076a=await fetchUserProfile(_0x1cb91d),_0x2e566c=_0x40076a?.[_0xe98c42(0xa4)]||_0x40076a?.[_0xe98c42(0xb5)]?.[_0xe98c42(0x81)]('@')[0x0],_0x39ec82=_0x2e566c?_0x2e566c+'\x27s\x20CLI\x20Key':_0xe98c42(0xa3);let _0x55b687=[];try{const _0x2ccb8b=await _0x488a71[_0xe98c42(0x8b)](fetch,_0x73d36c+'/api-keys',{'method':_0xe98c42(0xa0),'headers':_0x4fcfc1});if(_0x2ccb8b['ok']){const _0x700b85=await _0x2ccb8b['json']();_0x55b687=_0x700b85['apiKeys'];}}catch{}const _0xe26b55=buildKeyName(_0x39ec82,_0x55b687),_0x5a101f=await fetch(_0x73d36c+_0xe98c42(0x83),{'method':_0x488a71[_0xe98c42(0x9f)],'headers':_0x4fcfc1,'body':JSON[_0xe98c42(0xca)]({'name':_0xe26b55,'scope':'mcp:write'})});if(!_0x5a101f['ok']){const _0xa25423=await _0x5a101f['text']();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x5a101f[_0xe98c42(0x84)]+'\x20'+_0xa25423);}const _0x16bf1b=await _0x5a101f['json']();return _0x16bf1b['apiKey']['token'];}export function openBrowser(_0x510d33){const _0x4dddce=_0x100281,_0x4b4b72={'dCytr':function(_0x55f229,_0x287c92){return _0x55f229===_0x287c92;},'ycMHE':'darwin','cHXvL':'win32','hwemq':_0x4dddce(0x93)},_0x3db84f=process['platform'],_0x28bc99=_0x4b4b72[_0x4dddce(0x9d)](_0x3db84f,_0x4b4b72[_0x4dddce(0x80)])?_0x4dddce(0xc3):_0x3db84f===_0x4b4b72[_0x4dddce(0x91)]?'start':_0x4b4b72[_0x4dddce(0xc0)];exec(_0x28bc99+'\x20'+JSON[_0x4dddce(0xca)](_0x510d33));}function decodeJwtPayload(_0xae8ee5){const _0x255f6e=_0x100281,_0x3bec9e={'GogWR':function(_0x2f501d,_0xb0c702){return _0x2f501d!==_0xb0c702;},'geGjh':_0x255f6e(0xa8)},_0x408911=_0xae8ee5[_0x255f6e(0x81)]('.');if(_0x3bec9e['GogWR'](_0x408911['length'],0x3))throw new Error('Invalid\x20JWT\x20format');const _0x599487=Buffer['from'](_0x408911[0x1],_0x3bec9e['geGjh'])['toString']('utf-8');return JSON[_0x255f6e(0xa7)](_0x599487);}async function selfServeSignup(_0x5404a0){const _0x22e9f7=_0x100281,_0xb37331={'MgqIz':function(_0x21d41f,_0x1f5543,_0x2a1140){return _0x21d41f(_0x1f5543,_0x2a1140);},'gFEPI':'POST'},_0x2156da=getApiBaseUrl(),_0x51d181=await _0xb37331['MgqIz'](fetch,_0x2156da+_0x22e9f7(0xb4),{'method':_0xb37331['gFEPI'],'headers':{'Content-Type':'application/json','workos-token':_0x5404a0}});if(!_0x51d181['ok']){const _0x200160=await _0x51d181['text']();throw new Error('Failed\x20to\x20create\x20organization:\x20'+_0x51d181['status']+'\x20'+_0x200160);}return _0x51d181['json']();}async function fetchMyMemberships(_0x27edc2){const _0x4d3c80=_0x100281,_0x164094={'UDnHN':function(_0x30a711){return _0x30a711();},'HMtgl':function(_0x422f06,_0x646cb,_0x5645e4){return _0x422f06(_0x646cb,_0x5645e4);},'ImvaL':'GET'},_0x5e4cdd=_0x164094[_0x4d3c80(0xaa)](getApiBaseUrl),_0x40c49f=await _0x164094['HMtgl'](fetch,_0x5e4cdd+'/organization/my-memberships',{'method':_0x164094[_0x4d3c80(0x87)],'headers':{'workos-token':_0x27edc2}});if(!_0x40c49f['ok']){const _0x3e14b5=await _0x40c49f[_0x4d3c80(0x8a)]();throw new Error(_0x4d3c80(0xad)+_0x40c49f['status']+'\x20'+_0x3e14b5);}const _0x2a719e=await _0x40c49f[_0x4d3c80(0x82)]();return _0x2a719e['memberships'];}async function refreshTokenWithOrg(_0x499363,_0x109624,_0x61cee7){const _0x5d7883=_0x100281,_0x27adff={'CpAiT':_0x5d7883(0xae),'POsrp':_0x5d7883(0x8c)},_0x1339ef=await fetch(WORKOS_TOKEN_URL,{'method':_0x27adff[_0x5d7883(0xc6)],'headers':{'Content-Type':_0x27adff[_0x5d7883(0xba)]},'body':new URLSearchParams({'client_id':_0x499363,'grant_type':'refresh_token','refresh_token':_0x109624,'organization_id':_0x61cee7})});if(!_0x1339ef['ok']){const _0x1a2a5c=await _0x1339ef['text']();throw new Error(_0x5d7883(0xc5)+_0x1339ef[_0x5d7883(0x84)]+'\x20'+_0x1a2a5c);}return _0x1339ef['json']();}export async function runDeviceAuthFlow(){const _0x558ca0=_0x100281,_0x5756bc={'LRCYv':function(_0x1fa934,_0x539391){return _0x1fa934(_0x539391);},'RybtB':'Waiting\x20for\x20authentication...','HsCbR':function(_0x155d36,_0x5a3573){return _0x155d36===_0x5a3573;},'xFWeL':_0x558ca0(0xb8),'LIjGY':_0x558ca0(0xc2),'IrKaM':'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','zmpyw':_0x558ca0(0x9c),'TFMbZ':_0x558ca0(0xac),'ALIQX':'Provisioning\x20API\x20key...','HIGWJ':function(_0x45f065,_0x3d8358){return _0x45f065(_0x3d8358);}},_0xf99235=getCurrentEnvironment(),_0x136c46=ENVIRONMENT_CONFIGS[_0xf99235]['workosClientId'],_0x1d3fd4=await requestDeviceCode(_0x136c46);console['log']('\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...'),console['log']('\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a'),_0x5756bc[_0x558ca0(0xa1)](openBrowser,_0x1d3fd4['verification_uri_complete']),console[_0x558ca0(0xb9)]('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x1d3fd4['verification_uri_complete']),console['log']('Code:\x20'+_0x1d3fd4['user_code']+'\x0a'),process['stdout']['write'](_0x5756bc['RybtB']);let _0x516fc8=await pollForTokens(_0x136c46,_0x1d3fd4[_0x558ca0(0xaf)],_0x1d3fd4['interval'],_0x1d3fd4['expires_in']);console[_0x558ca0(0xb9)]('\x20✓');const _0x2223bd=_0x5756bc['LRCYv'](decodeJwtPayload,_0x516fc8['access_token']);if(!_0x2223bd['org_id']){const _0x37ed77=await fetchMyMemberships(_0x516fc8['access_token']);let _0x4948a9;if(_0x5756bc['HsCbR'](_0x37ed77['length'],0x0)){process[_0x558ca0(0x9e)][_0x558ca0(0xb2)](_0x5756bc[_0x558ca0(0xb6)]);const _0x7d0fc9=await selfServeSignup(_0x516fc8[_0x558ca0(0xc9)]);_0x4948a9=_0x7d0fc9['organizationId'],console['log']('\x20✓');}else{if(_0x5756bc[_0x558ca0(0x7f)](_0x37ed77['length'],0x1))_0x4948a9=_0x37ed77[0x0]['organizationId'],console['log'](_0x558ca0(0x90)+_0x37ed77[0x0]['name']);else{const _0x4afab0=process[_0x558ca0(0x92)]['isTTY']&&process['stdout'][_0x558ca0(0xbc)];if(!_0x4afab0)throw new Error(_0x5756bc['LIjGY']+_0x5756bc[_0x558ca0(0xb1)]);const {selected:_0x463d4a}=await _0x10f41b['prompt']([{'type':_0x5756bc[_0x558ca0(0xa5)],'name':'selected','message':_0x5756bc['TFMbZ'],'choices':_0x37ed77['map'](_0x25e8a0=>({'name':_0x25e8a0[_0x558ca0(0x85)],'value':_0x25e8a0[_0x558ca0(0x89)]}))}]);_0x4948a9=_0x463d4a;}}_0x516fc8=await refreshTokenWithOrg(_0x136c46,_0x516fc8['refresh_token'],_0x4948a9);}process['stdout']['write'](_0x5756bc[_0x558ca0(0x97)]);const _0x4e329c=await _0x5756bc['LRCYv'](provisionApiKey,_0x516fc8['access_token']);return console['log']('\x20✓'),await _0x5756bc[_0x558ca0(0xc8)](storeToken,_0x4e329c),_0x516fc8['refresh_token']&&await storeRefreshToken(_0x516fc8[_0x558ca0(0x8f)]),_0x4e329c;}function sleep(_0x1ce779){return new Promise(_0x18e50c=>setTimeout(_0x18e50c,_0x1ce779));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x40aeaa=_0x1001;(function(_0x436e12,_0x22cbae){const _0x130674=_0x1001,_0x551ea6=_0x436e12();while(!![]){try{const _0x29d357=-parseInt(_0x130674(0x17b))/0x1+-parseInt(_0x130674(0x179))/0x2+parseInt(_0x130674(0x188))/0x3*(parseInt(_0x130674(0x185))/0x4)+-parseInt(_0x130674(0x184))/0x5+parseInt(_0x130674(0x17c))/0x6+parseInt(_0x130674(0x17a))/0x7*(parseInt(_0x130674(0x17f))/0x8)+-parseInt(_0x130674(0x187))/0x9*(-parseInt(_0x130674(0x180))/0xa);if(_0x29d357===_0x22cbae)break;else _0x551ea6['push'](_0x551ea6['shift']());}catch(_0xcbd283){_0x551ea6['push'](_0x551ea6['shift']());}}}(_0x4c06,0x50648));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':'https://api.ranger.net','workosClientId':'client_01J9CBYM7M5ZETCF7G6614DXR2','aiProxyUrl':'https://ai-proxy-716115358910.us-central1.run.app'},'staging':{'apiBaseUrl':'https://api.staging.ranger.net','workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':_0x40aeaa(0x189)},'local':{'apiBaseUrl':_0x40aeaa(0x182),'workosClientId':_0x40aeaa(0x181),'aiProxyUrl':'http://localhost:8090'}};function _0x4c06(){const _0x157510=['244395smxGis','502830tQWSIz','RANGER_CLI_ENV','env','128oNwFcF','71770PUYvJY','client_01J9CBYM2DKWV9HM17D95Z540K','http://localhost:8080','mUBLG','2983050KfjZEk','1104yUOkpn','true','1089aTNWIJ','4929KzORWZ','https://ai-proxy-301751771437.us-central1.run.app','local','aiProxyUrl','apiBaseUrl','1003562htxVql','116543XDYgnH'];_0x4c06=function(){return _0x157510;};return _0x4c06();}export const DEFAULT_ENVIRONMENT='prod';export function isValidEnvironment(_0x17f1d4){const _0x11aa7b=_0x40aeaa,_0x4d9d0c={'dpaAU':'prod','mUBLG':'staging'};return _0x17f1d4===_0x4d9d0c['dpaAU']||_0x17f1d4===_0x4d9d0c[_0x11aa7b(0x183)]||_0x17f1d4===_0x11aa7b(0x18a);}export function getCurrentEnvironment(){const _0x26d677=_0x40aeaa,_0x1e6ff2=process[_0x26d677(0x17e)][_0x26d677(0x17d)];if(_0x1e6ff2&&isValidEnvironment(_0x1e6ff2))return _0x1e6ff2;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){const _0x81ebc7=_0x40aeaa;return ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x81ebc7(0x18c)];}function _0x1001(_0x4b1f01,_0x1379e3){_0x4b1f01=_0x4b1f01-0x179;const _0x4c069c=_0x4c06();let _0x10019c=_0x4c069c[_0x4b1f01];return _0x10019c;}export function getAiProxyUrl(){const _0x4328fa=_0x40aeaa,_0x3d4d7d={'slLET':function(_0x181afa){return _0x181afa();}};return ENVIRONMENT_CONFIGS[_0x3d4d7d['slLET'](getCurrentEnvironment)][_0x4328fa(0x18b)];}export function isByokEnabled(){const _0x590a20=_0x40aeaa;return process['env']['RANGER_BYOK']===_0x590a20(0x186);}export function isMcpDisabled(){const _0x3908d2=_0x40aeaa,_0x3bc198={'UMHnV':_0x3908d2(0x186)};return process['env']['RANGER_DISABLE_MCP']===_0x3bc198['UMHnV'];}export function getVerificationTransport(){const _0x37189c={'kmlzA':'playwright-cli'};return isMcpDisabled()?_0x37189c['kmlzA']:'mcp';}
|