@ranger-testing/ranger-cli 2.4.5 → 2.4.6
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 -1
- 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/tokenRefresh.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -1
- package/build/commands/utils/userApi.js +1 -1
- package/build/commands/utils/version.js +1 -1
- package/build/commands/verifyFeature.js +1 -1
- package/build/commands/verifyFeatureCli.js +1 -1
- package/build/commands/verifyInBrowser.js +1 -1
- package/package.json +1 -1
package/build/commands/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x112c53,_0x1d963e){const _0xf89491=_0x49f4,_0x4f7df5=_0x112c53();while(!![]){try{const _0x385fe5=parseInt(_0xf89491(0x107))/0x1*(-parseInt(_0xf89491(0xec))/0x2)+parseInt(_0xf89491(0xf1))/0x3*(parseInt(_0xf89491(0x126))/0x4)+parseInt(_0xf89491(0x100))/0x5*(-parseInt(_0xf89491(0x106))/0x6)+parseInt(_0xf89491(0x11c))/0x7*(parseInt(_0xf89491(0xfe))/0x8)+parseInt(_0xf89491(0xea))/0x9*(parseInt(_0xf89491(0xee))/0xa)+-parseInt(_0xf89491(0x11f))/0xb*(parseInt(_0xf89491(0xff))/0xc)+parseInt(_0xf89491(0x115))/0xd;if(_0x385fe5===_0x1d963e)break;else _0x4f7df5['push'](_0x4f7df5['shift']());}catch(_0x3a818e){_0x4f7df5['push'](_0x4f7df5['shift']());}}}(_0x3f0b,0xf1340));function _0x3f0b(){const _0x68b23d=[')\x20is\x20newer\x20than\x20the\x20published\x20version\x20(','woYbp','1530692wqAZOE','ranger@trailhead','log','qiTUX','pipe','GPrZq','\x0aYou\x20are\x20already\x20on\x20the\x20latest\x20version.','warn','iaXZx','207HkhLkB','\x0aClaude\x20plugin\x20updated\x20(user\x20scope).','120IlBtqf','plugin','374660jVNdFm','gccjE','@latest','9OJiJPX','Xrioh','IlIPA','\x0aCould\x20not\x20check\x20latest\x20version:\x20','project','\x0aClaude\x20marketplace\x20updated\x20(trailhead).','split','marketplace','Update\x20failed.','luVay','\x20skill\x20','platform','SqNeM','6211768CFVBEI','12VuxRPt','138625XMLkxy','error','active-feature.txt','\x20ranger-managed\x20skill(s)...','hPkKm','Munti','36vTlTNr','27249CPfVgT','utf-8','length','gqoPi','zKffT','active-profile.txt','splice','SRmrS','DXUxA','close','isEci','update','RGFtu','\x0aCurrent\x20version:\x20','14106157eAfoUs','--scope','\x0aNo\x20ranger-managed\x20skills\x20found\x20to\x20reinstall.','version','EVhwy','Attempting\x20install\x20anyway...','join','7MutoLn','KQAwF','claude','11902429jrPNTY','push','fESCY','YvrCp','\x20\x20Failed\x20to\x20reinstall\x20'];_0x3f0b=function(){return _0x68b23d;};return _0x3f0b();}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';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 _0xda63cd={'isEci':function(_0xb89ee2,_0x30d0b1){return _0xb89ee2(_0x30d0b1);},'uucAd':function(_0x170beb,_0x1e730e){return _0x170beb===_0x1e730e;},'bKbfx':'npm','zKffT':function(_0xb9da46,_0x5bd84b){return _0xb9da46===_0x5bd84b;},'JvLfA':'win32'};return new Promise(_0x16c085=>{const _0x5e48ea=_0x49f4,_0x58640e={'qiTUX':function(_0x1e7ffb,_0x1ab2fe){return _0x1e7ffb(_0x1ab2fe);}};console['log']('\x0aInstalling\x20'+PACKAGE_NAME+'@latest...\x0a');const _0x1d50f2=spawn(_0xda63cd['bKbfx'],['install','-g',PACKAGE_NAME+_0x5e48ea(0xf0)],{'stdio':'inherit','shell':_0xda63cd[_0x5e48ea(0x10b)](process[_0x5e48ea(0xfc)],_0xda63cd['JvLfA'])});_0x1d50f2['on']('close',_0x43e9c0=>{const _0x3490dd=_0x5e48ea;_0xda63cd[_0x3490dd(0x111)](_0x16c085,_0xda63cd['uucAd'](_0x43e9c0,0x0));}),_0x1d50f2['on'](_0x5e48ea(0x101),()=>{const _0x35cea6=_0x5e48ea;_0x58640e[_0x35cea6(0x129)](_0x16c085,![]);});});}async function updateClaudeMarketplace(){const _0x53778e=_0x49f4,_0x616a11={'iaXZx':function(_0x1e868f,_0x3609fd){return _0x1e868f(_0x3609fd);},'RfhaC':'trailhead','trhCl':function(_0x2a7bfc,_0x3dcaea){return _0x2a7bfc===_0x3dcaea;},'PDayQ':_0x53778e(0x110)};return new Promise(_0x57ce3a=>{const _0x2882eb=_0x53778e,_0x3396ac={'UGhNJ':function(_0x4a5384,_0x3f91e9){return _0x4a5384(_0x3f91e9);},'Munti':function(_0x7b5b6e,_0x428ef2){return _0x7b5b6e===_0x428ef2;}},_0x19a943=spawn('claude',[_0x2882eb(0xed),_0x2882eb(0xf8),_0x2882eb(0x112),_0x616a11['RfhaC']],{'stdio':'pipe','shell':_0x616a11['trhCl'](process['platform'],'win32')});_0x19a943['on'](_0x616a11['PDayQ'],_0x27941a=>{const _0x3edc05=_0x2882eb;_0x3396ac['UGhNJ'](_0x57ce3a,_0x3396ac[_0x3edc05(0x105)](_0x27941a,0x0));}),_0x19a943['on'](_0x2882eb(0x101),()=>{const _0x825bc9=_0x2882eb;_0x616a11[_0x825bc9(0xe9)](_0x57ce3a,![]);});});}async function updateClaudePlugin(_0x177958){const _0x3d83fb=_0x49f4,_0x2f8755={'juAic':_0x3d83fb(0xed),'rMWjt':_0x3d83fb(0x116),'Ushbr':function(_0x51e05a,_0x5acb5e,_0x55be8d,_0x19deb4){return _0x51e05a(_0x5acb5e,_0x55be8d,_0x19deb4);},'luVay':_0x3d83fb(0xe5),'ilere':_0x3d83fb(0x110)};return new Promise(_0x168760=>{const _0x2b4623=_0x3d83fb,_0x575c36={'wfRGV':function(_0x5beb50,_0x56998e){return _0x5beb50(_0x56998e);},'SRmrS':function(_0x3a660d,_0x211cde){return _0x3a660d===_0x211cde;}},_0x24fbe9=[_0x2f8755['juAic'],'update',_0x2b4623(0x127)];_0x177958&&_0x24fbe9['push'](_0x2f8755['rMWjt'],_0x177958);const _0x11f0b6=_0x2f8755['Ushbr'](spawn,_0x2b4623(0x11e),_0x24fbe9,{'stdio':_0x2f8755[_0x2b4623(0xfa)],'shell':process['platform']==='win32'});_0x11f0b6['on'](_0x2f8755['ilere'],_0x4034d6=>{const _0x5249e9=_0x2b4623;_0x575c36['wfRGV'](_0x168760,_0x575c36[_0x5249e9(0x10e)](_0x4034d6,0x0));}),_0x11f0b6['on']('error',()=>{_0x168760(![]);});});}function _0x49f4(_0x349a2a,_0x3a17f4){_0x349a2a=_0x349a2a-0xe5;const _0x3f0baa=_0x3f0b();let _0x49f4e8=_0x3f0baa[_0x349a2a];return _0x49f4e8;}function isSkillInstalled(_0x15be4f,_0x165d4e,_0x52e336){const _0x42fed8=_0x49f4,_0x2e894b={'SqNeM':function(_0x5bf92e,_0x142e68){return _0x5bf92e===_0x142e68;},'dFIWo':'opencode','FPjkl':function(_0x59a089,_0x20c824,_0x1ebd88){return _0x59a089(_0x20c824,_0x1ebd88);}},_0x316bb2=_0x2e894b[_0x42fed8(0xfd)](_0x52e336,_0x2e894b['dFIWo'])?getOpencodeSkillsDir(_0x165d4e):getSkillsDir(_0x165d4e),_0x3b933d=_0x2e894b['FPjkl'](join,_0x316bb2,_0x15be4f);return existsSync(_0x3b933d);}async function reinstallSkills(_0x5bdd30){const _0x33e1ba=_0x49f4,_0x395f0a={'gqoPi':_0x33e1ba(0xf5),'WrMOY':'user','qZZlN':function(_0x4be098,_0x1c92b4,_0x35b689,_0x38388d){return _0x4be098(_0x1c92b4,_0x35b689,_0x38388d);},'CVHPF':'opencode','gWvOz':function(_0x4d7247,_0x5d7012,_0x524ca3){return _0x4d7247(_0x5d7012,_0x524ca3);},'Xrioh':_0x33e1ba(0x117)},_0x480179=[_0x395f0a[_0x33e1ba(0x10a)],_0x395f0a['WrMOY']],_0x210473=[];for(const _0x41c583 of _0x480179){for(const _0x41a97a of RANGER_MANAGED_SKILLS){isSkillInstalled(_0x41a97a,_0x41c583,'claude')&&_0x210473[_0x33e1ba(0x120)]({'skillName':_0x41a97a,'level':_0x41c583,'platform':'claude'}),_0x395f0a['qZZlN'](isSkillInstalled,_0x41a97a,_0x41c583,_0x395f0a['CVHPF'])&&_0x210473[_0x33e1ba(0x120)]({'skillName':_0x41a97a,'level':_0x41c583,'platform':_0x395f0a['CVHPF']});}}for(const _0x333de1 of _0x480179){for(const _0x2b683c of DEPRECATED_SKILLS){await _0x395f0a['gWvOz'](removeSkill,_0x2b683c,_0x333de1);}}if(_0x210473[_0x33e1ba(0x109)]===0x0){console[_0x33e1ba(0x128)](_0x395f0a[_0x33e1ba(0xf2)]);return;}console[_0x33e1ba(0x128)]('\x0aReinstalling\x20'+_0x210473[_0x33e1ba(0x109)]+_0x33e1ba(0x103));for(const {skillName:_0x2d430a,level:_0x3c4461,platform:_0xed6225}of _0x210473){try{await _0x395f0a['gWvOz'](installSkill,_0x2d430a,{'level':_0x3c4461,'cliVersion':_0x5bdd30,'platform':_0xed6225});}catch(_0x1dcf12){console[_0x33e1ba(0xe8)](_0x33e1ba(0x123)+_0xed6225+'\x20'+_0x3c4461+_0x33e1ba(0xfb)+_0x2d430a+':',_0x1dcf12);}}}async function ensureActiveProfileGitignored(){const _0x5f2b13=_0x49f4,_0x144208={'fESCY':function(_0xc98ca2,_0x148028,_0x2c1139){return _0xc98ca2(_0x148028,_0x2c1139);},'hPkKm':function(_0x386527){return _0x386527();},'GPrZq':function(_0x25897e,_0x5b1a0c){return _0x25897e===_0x5b1a0c;},'XRVUI':_0x5f2b13(0x10c)},_0x2a4e4c=_0x144208[_0x5f2b13(0x121)](join,_0x144208[_0x5f2b13(0x104)](getRangerDir),'.gitignore');if(!existsSync(_0x2a4e4c))return![];let _0x7501af='';try{_0x7501af=await readFile(_0x2a4e4c,_0x5f2b13(0x108));}catch{return![];}const _0x1cf62e=_0x7501af[_0x5f2b13(0xf7)](/\r?\n/);if(_0x1cf62e['some'](_0x3c654b=>_0x3c654b['trim']()===_0x5f2b13(0x10c)))return![];let _0x1a2416=_0x1cf62e['findIndex'](_0x4ef4ef=>_0x4ef4ef['trim']()===_0x5f2b13(0x102));_0x144208[_0x5f2b13(0xe6)](_0x1a2416,-0x1)&&(_0x1a2416=_0x1cf62e[_0x5f2b13(0x109)]);_0x1cf62e[_0x5f2b13(0x10d)](_0x1a2416,0x0,_0x144208['XRVUI']);let _0xf45621=_0x1cf62e[_0x5f2b13(0x11b)]('\x0a');!_0xf45621['endsWith']('\x0a')&&(_0xf45621+='\x0a');try{await writeFile(_0x2a4e4c,_0xf45621,_0x5f2b13(0x108));}catch{return![];}return!![];}export async function update(){const _0x339e5e=_0x49f4,_0x2812c6={'MVwMR':function(_0x22f164){return _0x22f164();},'KQAwF':function(_0x3830a5){return _0x3830a5();},'DXUxA':_0x339e5e(0x11a),'lQBDv':function(_0x3e0a4f){return _0x3e0a4f();},'EVhwy':function(_0x203c85,_0x274a8d,_0x4642d3){return _0x203c85(_0x274a8d,_0x4642d3);},'RGFtu':function(_0x2964a5,_0x28a210){return _0x2964a5<_0x28a210;},'pFEFj':function(_0x4f54e5,_0x3ac5f0){return _0x4f54e5(_0x3ac5f0);},'gccjE':function(_0x1de488){return _0x1de488();},'eFJaU':_0x339e5e(0xeb),'YvrCp':_0x339e5e(0xf5),'woYbp':function(_0x291589){return _0x291589();},'IlIPA':'\x0a✅\x20Update\x20complete!'},_0x2199f6=_0x2812c6['MVwMR'](getCurrentVersion);console['log'](_0x339e5e(0x114)+_0x2199f6),console['log']('Checking\x20for\x20updates...');const _0x5b9611=_0x2812c6[_0x339e5e(0x11d)](getLatestVersion);let _0x1d32b9=_0x2199f6;if(!_0x5b9611[_0x339e5e(0x118)]){console[_0x339e5e(0xe8)](_0x339e5e(0xf4)+_0x5b9611['error']),console[_0x339e5e(0x128)](_0x2812c6[_0x339e5e(0x10f)]);const _0x25b367=await runInstall();if(_0x25b367)console[_0x339e5e(0x128)]('\x0aSuccessfully\x20installed\x20latest\x20version.'),_0x1d32b9=_0x2812c6['lQBDv'](getCurrentVersion);else throw new Error('Update\x20failed:\x20'+_0x5b9611[_0x339e5e(0x101)]);}else{const _0xc49d30=_0x5b9611[_0x339e5e(0x118)];console['log']('Latest\x20version:\x20\x20'+_0xc49d30);const _0x2b3d8a=_0x2812c6[_0x339e5e(0x119)](compareVersions,_0x2199f6,_0xc49d30);if(_0x2b3d8a===0x0)console['log'](_0x339e5e(0xe7));else{if(_0x2812c6[_0x339e5e(0x113)](_0x2b3d8a,0x0))console[_0x339e5e(0x128)]('\x0aYour\x20version\x20('+_0x2199f6+_0x339e5e(0x124)+_0xc49d30+').');else{const _0xf6caa=await runInstall();if(_0xf6caa)console[_0x339e5e(0x128)]('\x0aSuccessfully\x20updated\x20to\x20version\x20'+_0xc49d30),_0x1d32b9=_0xc49d30;else throw new Error(_0x339e5e(0xf9));}}}await _0x2812c6['pFEFj'](reinstallSkills,_0x1d32b9);const _0x46a504=await isMarketplaceAdded('trailhead'),_0x1f46de=await isPluginInstalled('ranger@trailhead');if(_0x46a504){const _0x47fc24=await updateClaudeMarketplace();_0x47fc24&&console['log'](_0x339e5e(0xf6));}if(_0x1f46de){const _0x36df5f=await _0x2812c6[_0x339e5e(0xef)](updateClaudePlugin);_0x36df5f&&console[_0x339e5e(0x128)](_0x2812c6['eFJaU']);const _0x521e69=await updateClaudePlugin(_0x2812c6[_0x339e5e(0x122)]);_0x521e69&&console['log']((_0x36df5f?'':'\x0a')+'Claude\x20plugin\x20updated\x20(project\x20scope).');}const _0x12be69=await _0x2812c6[_0x339e5e(0x125)](migrateActiveProfileFile);_0x12be69&&console['log']('✓\x20Migrated\x20active\x20profile\x20file');const _0x3aaaed=await ensureActiveProfileGitignored();console['log'](_0x2812c6[_0x339e5e(0xf3)]);}
|
|
1
|
+
(function(_0x81c05d,_0x42298f){const _0x2164b6=_0x5ee8,_0x4f663e=_0x81c05d();while(!![]){try{const _0x12de27=parseInt(_0x2164b6(0x1dc))/0x1+parseInt(_0x2164b6(0x1fe))/0x2*(parseInt(_0x2164b6(0x203))/0x3)+parseInt(_0x2164b6(0x1e9))/0x4+-parseInt(_0x2164b6(0x1f3))/0x5*(parseInt(_0x2164b6(0x20a))/0x6)+parseInt(_0x2164b6(0x1fb))/0x7+-parseInt(_0x2164b6(0x1da))/0x8*(-parseInt(_0x2164b6(0x204))/0x9)+-parseInt(_0x2164b6(0x1d6))/0xa*(parseInt(_0x2164b6(0x1d1))/0xb);if(_0x12de27===_0x42298f)break;else _0x4f663e['push'](_0x4f663e['shift']());}catch(_0x374017){_0x4f663e['push'](_0x4f663e['shift']());}}}(_0xea9c,0x72c16));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';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 _0xb76d55=_0x5ee8,_0x5c747f={'XOKYj':function(_0x3dc9d2,_0x46a0c4){return _0x3dc9d2===_0x46a0c4;},'oPCWw':_0xb76d55(0x1f1),'WfiYG':_0xb76d55(0x1e2),'ZubDd':_0xb76d55(0x1d3)};return new Promise(_0x2a3980=>{const _0x128980=_0xb76d55,_0x41cc63={'yoaBi':function(_0x3ca4d0,_0x4b9443){return _0x3ca4d0(_0x4b9443);},'wpxMF':function(_0x305ec5,_0x64f326){const _0x11246a=_0x5ee8;return _0x5c747f[_0x11246a(0x1de)](_0x305ec5,_0x64f326);}};console[_0x128980(0x1e5)]('\x0aInstalling\x20'+PACKAGE_NAME+_0x128980(0x1eb));const _0x3e7792=spawn(_0x5c747f[_0x128980(0x1dd)],[_0x128980(0x1f9),'-g',PACKAGE_NAME+_0x128980(0x1e7)],{'stdio':'inherit','shell':process[_0x128980(0x208)]==='win32'});_0x3e7792['on'](_0x5c747f['WfiYG'],_0x567bfe=>{_0x41cc63['yoaBi'](_0x2a3980,_0x41cc63['wpxMF'](_0x567bfe,0x0));}),_0x3e7792['on'](_0x5c747f['ZubDd'],()=>{_0x2a3980(![]);});});}async function updateClaudeMarketplace(){const _0x24ff6f=_0x5ee8,_0x36e79f={'NJpku':function(_0x402eca,_0x11fa0b){return _0x402eca(_0x11fa0b);},'TLuKA':function(_0x28bbab,_0x3e9199){return _0x28bbab===_0x3e9199;},'ZlkVg':function(_0x1e9119,_0x18a486,_0x40f8dc,_0x4d0743){return _0x1e9119(_0x18a486,_0x40f8dc,_0x4d0743);},'lhLom':'plugin','HBtmI':_0x24ff6f(0x1e1),'tLsZh':_0x24ff6f(0x1ff),'vZqwX':'win32','fvOOW':'close'};return new Promise(_0x736175=>{const _0x9b2ac7=_0x24ff6f,_0xbfb273={'QsZDs':function(_0x341818,_0x1688dd){return _0x341818(_0x1688dd);}},_0x4da9ec=_0x36e79f['ZlkVg'](spawn,'claude',[_0x36e79f['lhLom'],_0x36e79f['HBtmI'],_0x9b2ac7(0x1ee),_0x36e79f['tLsZh']],{'stdio':_0x9b2ac7(0x1ec),'shell':process[_0x9b2ac7(0x208)]===_0x36e79f[_0x9b2ac7(0x1d4)]});_0x4da9ec['on'](_0x36e79f['fvOOW'],_0x5418e4=>{const _0x150a85=_0x9b2ac7;_0x36e79f['NJpku'](_0x736175,_0x36e79f[_0x150a85(0x1e6)](_0x5418e4,0x0));}),_0x4da9ec['on']('error',()=>{_0xbfb273['QsZDs'](_0x736175,![]);});});}async function updateClaudePlugin(_0x30bad0){const _0x188486=_0x5ee8,_0x40f9ba={'yREmj':function(_0x434b9d,_0x5be433){return _0x434b9d(_0x5be433);},'tWMBr':function(_0x155a7b,_0x3ba51c){return _0x155a7b===_0x3ba51c;},'oaqDQ':function(_0x2ef2ae,_0x52a91b){return _0x2ef2ae(_0x52a91b);},'lpVme':_0x188486(0x1ee),'GIkvZ':'ranger@trailhead','BTBeG':_0x188486(0x1fa),'iYTFP':'claude','qhTKg':_0x188486(0x1d0),'wAqSI':'close','ulhap':'error'};return new Promise(_0x49fa83=>{const _0x29ba99=_0x188486,_0x122682={'yiPBB':function(_0x1b069c,_0x56b92f){return _0x40f9ba['oaqDQ'](_0x1b069c,_0x56b92f);}},_0x59abc3=['plugin',_0x40f9ba[_0x29ba99(0x1e4)],_0x40f9ba[_0x29ba99(0x1fc)]];_0x30bad0&&_0x59abc3['push'](_0x40f9ba['BTBeG'],_0x30bad0);const _0x4f08e1=spawn(_0x40f9ba['iYTFP'],_0x59abc3,{'stdio':'pipe','shell':_0x40f9ba[_0x29ba99(0x207)](process['platform'],_0x40f9ba['qhTKg'])});_0x4f08e1['on'](_0x40f9ba['wAqSI'],_0x5ee4c8=>{const _0x53a4b6=_0x29ba99;_0x40f9ba[_0x53a4b6(0x205)](_0x49fa83,_0x40f9ba[_0x53a4b6(0x207)](_0x5ee4c8,0x0));}),_0x4f08e1['on'](_0x40f9ba[_0x29ba99(0x1df)],()=>{_0x122682['yiPBB'](_0x49fa83,![]);});});}function _0x5ee8(_0x26b905,_0x4a930a){_0x26b905=_0x26b905-0x1cd;const _0xea9c6e=_0xea9c();let _0x5ee84a=_0xea9c6e[_0x26b905];return _0x5ee84a;}function isSkillInstalled(_0x36f698,_0x51da0a,_0x363104){const _0x18cfd3=_0x5ee8,_0x1e66eb={'vfHgS':function(_0x5dd7a1,_0x4aa2aa){return _0x5dd7a1===_0x4aa2aa;},'UfOYv':function(_0x3bf878,_0x2f44e3){return _0x3bf878(_0x2f44e3);},'xudUz':function(_0x443746,_0x1f9fa7){return _0x443746(_0x1f9fa7);},'UyADQ':function(_0x3e9a12,_0x5ee9bd,_0x4d0166){return _0x3e9a12(_0x5ee9bd,_0x4d0166);}},_0x5a6d4c=_0x1e66eb[_0x18cfd3(0x1f8)](_0x363104,'opencode')?_0x1e66eb[_0x18cfd3(0x201)](getOpencodeSkillsDir,_0x51da0a):_0x1e66eb['xudUz'](getSkillsDir,_0x51da0a),_0x18256b=_0x1e66eb[_0x18cfd3(0x1ed)](join,_0x5a6d4c,_0x36f698);return _0x1e66eb[_0x18cfd3(0x201)](existsSync,_0x18256b);}async function reinstallSkills(_0x5235ea){const _0x59ff0f=_0x5ee8,_0xe712a={'sJYiT':'project','lumft':function(_0x2eb3a2,_0x498464,_0xb16d7,_0x5184b8){return _0x2eb3a2(_0x498464,_0xb16d7,_0x5184b8);},'UMoJr':'claude','UynVv':function(_0x29b526,_0x20ac47,_0x457959,_0xb893ed){return _0x29b526(_0x20ac47,_0x457959,_0xb893ed);},'OBWCE':_0x59ff0f(0x202)},_0x461405=[_0xe712a['sJYiT'],'user'],_0x545bf5=[];for(const _0x34d395 of _0x461405){for(const _0x2733f8 of RANGER_MANAGED_SKILLS){_0xe712a['lumft'](isSkillInstalled,_0x2733f8,_0x34d395,_0xe712a['UMoJr'])&&_0x545bf5['push']({'skillName':_0x2733f8,'level':_0x34d395,'platform':_0x59ff0f(0x206)}),_0xe712a['UynVv'](isSkillInstalled,_0x2733f8,_0x34d395,'opencode')&&_0x545bf5['push']({'skillName':_0x2733f8,'level':_0x34d395,'platform':'opencode'});}}for(const _0x2911b4 of _0x461405){for(const _0x3d383f of DEPRECATED_SKILLS){await removeSkill(_0x3d383f,_0x2911b4);}}if(_0x545bf5['length']===0x0){console[_0x59ff0f(0x1e5)](_0xe712a[_0x59ff0f(0x1cf)]);return;}console['log'](_0x59ff0f(0x1ea)+_0x545bf5[_0x59ff0f(0x1f4)]+_0x59ff0f(0x1d8));for(const {skillName:_0x4e9cb9,level:_0x3b9a49,platform:_0x406f16}of _0x545bf5){try{await installSkill(_0x4e9cb9,{'level':_0x3b9a49,'cliVersion':_0x5235ea,'platform':_0x406f16});}catch(_0x14a713){console['warn'](_0x59ff0f(0x1f2)+_0x406f16+'\x20'+_0x3b9a49+'\x20skill\x20'+_0x4e9cb9+':',_0x14a713);}}}function _0xea9c(){const _0x729d0f=['EBPQM','UfOYv','\x0aNo\x20ranger-managed\x20skills\x20found\x20to\x20reinstall.','7563zsEXDx','920466TITvqH','yREmj','claude','tWMBr','platform','active-profile.txt','570SlnfXO','version','yhfyu','OBWCE','win32','11PwZkET','split','error','vZqwX','queGx','24350660nRrrpN','some','\x20ranger-managed\x20skill(s)...','Update\x20failed.','40VyYGNY','\x0aSuccessfully\x20installed\x20latest\x20version.','871912QVZWaY','oPCWw','XOKYj','ulhap','qWIZC','marketplace','close','\x0a✅\x20Update\x20complete!','lpVme','log','TLuKA','@latest','utf-8','3139036erLBqd','\x0aReinstalling\x20','@latest...\x0a','pipe','UyADQ','update','project','endsWith','npm','\x20\x20Failed\x20to\x20reinstall\x20','19920FzvKet','length','\x0aCould\x20not\x20check\x20latest\x20version:\x20','trim','active-feature.txt','vfHgS','install','--scope','6467629orDsxM','GIkvZ','Checking\x20for\x20updates...','152KINmOM','trailhead'];_0xea9c=function(){return _0x729d0f;};return _0xea9c();}async function ensureActiveProfileGitignored(){const _0x45d423=_0x5ee8,_0x2a138e={'queGx':function(_0x1da482){return _0x1da482();},'yhfyu':function(_0x4b59ac,_0x2bd6a2){return _0x4b59ac(_0x2bd6a2);},'yjOQV':function(_0x1914d0,_0x52d918,_0x5b4521){return _0x1914d0(_0x52d918,_0x5b4521);},'EBPQM':_0x45d423(0x1e8),'YSAvH':function(_0x369fd5,_0x3fa4e8,_0x5fb96,_0x536e0f){return _0x369fd5(_0x3fa4e8,_0x5fb96,_0x536e0f);}},_0x18d882=join(_0x2a138e[_0x45d423(0x1d5)](getRangerDir),'.gitignore');if(!_0x2a138e[_0x45d423(0x1ce)](existsSync,_0x18d882))return![];let _0x2ebb4b='';try{_0x2ebb4b=await _0x2a138e['yjOQV'](readFile,_0x18d882,_0x2a138e[_0x45d423(0x200)]);}catch{return![];}const _0x29eb0b=_0x2ebb4b[_0x45d423(0x1d2)](/\r?\n/);if(_0x29eb0b[_0x45d423(0x1d7)](_0x9222ce=>_0x9222ce[_0x45d423(0x1f6)]()==='active-profile.txt'))return![];let _0x48eabf=_0x29eb0b['findIndex'](_0x1225e8=>_0x1225e8['trim']()===_0x45d423(0x1f7));_0x48eabf===-0x1&&(_0x48eabf=_0x29eb0b['length']);_0x29eb0b['splice'](_0x48eabf,0x0,_0x45d423(0x209));let _0x473840=_0x29eb0b['join']('\x0a');!_0x473840[_0x45d423(0x1f0)]('\x0a')&&(_0x473840+='\x0a');try{await _0x2a138e['YSAvH'](writeFile,_0x18d882,_0x473840,_0x2a138e['EBPQM']);}catch{return![];}return!![];}export async function update(){const _0x1f8358=_0x5ee8,_0x59ed24={'dhanu':function(_0x2351fb){return _0x2351fb();},'rirFS':function(_0x24458b){return _0x24458b();},'sGhPB':_0x1f8358(0x1d9),'MOlVo':function(_0x1447ad,_0x4ac49f){return _0x1447ad(_0x4ac49f);},'mYuBw':'trailhead','Czuqf':'\x0aClaude\x20plugin\x20updated\x20(user\x20scope).','ZJZcg':_0x1f8358(0x1ef),'qWIZC':'✓\x20Migrated\x20active\x20profile\x20file'},_0x55db51=getCurrentVersion();console[_0x1f8358(0x1e5)]('\x0aCurrent\x20version:\x20'+_0x55db51),console[_0x1f8358(0x1e5)](_0x1f8358(0x1fd));const _0x5785f9=_0x59ed24['dhanu'](getLatestVersion);let _0x438f59=_0x55db51;if(!_0x5785f9['version']){console['warn'](_0x1f8358(0x1f5)+_0x5785f9['error']),console[_0x1f8358(0x1e5)]('Attempting\x20install\x20anyway...');const _0x4464c0=await runInstall();if(_0x4464c0)console[_0x1f8358(0x1e5)](_0x1f8358(0x1db)),_0x438f59=_0x59ed24['rirFS'](getCurrentVersion);else throw new Error('Update\x20failed:\x20'+_0x5785f9['error']);}else{const _0x2812b8=_0x5785f9[_0x1f8358(0x1cd)];console[_0x1f8358(0x1e5)]('Latest\x20version:\x20\x20'+_0x2812b8);const _0x35960b=compareVersions(_0x55db51,_0x2812b8);if(_0x35960b===0x0)console[_0x1f8358(0x1e5)]('\x0aYou\x20are\x20already\x20on\x20the\x20latest\x20version.');else{if(_0x35960b<0x0)console['log']('\x0aYour\x20version\x20('+_0x55db51+')\x20is\x20newer\x20than\x20the\x20published\x20version\x20('+_0x2812b8+').');else{const _0x5172c2=await _0x59ed24['rirFS'](runInstall);if(_0x5172c2)console['log']('\x0aSuccessfully\x20updated\x20to\x20version\x20'+_0x2812b8),_0x438f59=_0x2812b8;else throw new Error(_0x59ed24['sGhPB']);}}}await _0x59ed24['MOlVo'](reinstallSkills,_0x438f59);const _0x7f1d67=await isMarketplaceAdded(_0x59ed24['mYuBw']),_0xf24347=await isPluginInstalled('ranger@trailhead');if(_0x7f1d67){const _0x119168=await updateClaudeMarketplace();_0x119168&&console[_0x1f8358(0x1e5)]('\x0aClaude\x20marketplace\x20updated\x20(trailhead).');}if(_0xf24347){const _0x312228=await updateClaudePlugin();_0x312228&&console['log'](_0x59ed24['Czuqf']);const _0x4152f9=await updateClaudePlugin(_0x59ed24['ZJZcg']);_0x4152f9&&console[_0x1f8358(0x1e5)]((_0x312228?'':'\x0a')+'Claude\x20plugin\x20updated\x20(project\x20scope).');}const _0x3cf401=await migrateActiveProfileFile();_0x3cf401&&console['log'](_0x59ed24[_0x1f8358(0x1e0)]);const _0x46bd05=await ensureActiveProfileGitignored();console['log'](_0x1f8358(0x1e3));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x437e41,_0x5da857){const _0x233194=_0xcfe1,_0x212ade=_0x437e41();while(!![]){try{const _0x3dccb8=-parseInt(_0x233194(0x1c1))/0x1+parseInt(_0x233194(0x1be))/0x2+parseInt(_0x233194(0x1b3))/0x3+-parseInt(_0x233194(0x1a5))/0x4+-parseInt(_0x233194(0x1bf))/0x5*(parseInt(_0x233194(0x19c))/0x6)+-parseInt(_0x233194(0x1a1))/0x7*(parseInt(_0x233194(0x1cb))/0x8)+parseInt(_0x233194(0x1c0))/0x9;if(_0x3dccb8===_0x5da857)break;else _0x212ade['push'](_0x212ade['shift']());}catch(_0x43afff){_0x212ade['push'](_0x212ade['shift']());}}}(_0xa7eb,0x6287a));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 _0xcfe1(_0x160699,_0x7d40fb){_0x160699=_0x160699-0x19b;const _0xa7ebb5=_0xa7eb();let _0xcfe1e7=_0xa7ebb5[_0x160699];return _0xcfe1e7;}function _0xa7eb(){const _0x5c8de7=['baseUrl','clHho','isTTY','1314204jVmShe','\x20\x20You\x20can\x20safely\x20commit\x20this\x20file\x20to\x20git.','vINfn','browser_auth','extraHTTPHeaders','18151VPzmrQ','\x20\x20\x20A\x20browser\x20will\x20open\x20with\x20your\x20existing\x20session\x20(if\x20any).','setupHeaders','contextOptions','90152tHDBHZ','\x20\x20Could\x20not\x20encrypt:\x20No\x20API\x20token\x20found.\x20Run:\x20ranger\x20setup\x20[token]','browser','Saving\x20authentication\x20state...','Config\x20not\x20found\x20at\x20','launch','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','DMyDn','allowInsecureLocalhost','Enable\x20safe\x20mode\x20and\x20try\x20again:\x20ranger\x20profile\x20config\x20set\x20','gWdHe','SxiCs','newPage','rMvMR','2332656kxNpQE','stdin','close','error','safeMode','goto','WHSQo','cErjc','yiKHQ','auth.json','.\x20Run\x20first:\x20ranger\x20profile\x20add\x20','595280aNMpac','5htHYYT','1260216UVsysQ','339289TCtPVx','llPwM','settings.json','\x20safeMode\x20true\x0a','trackPhaseEnd','NELnU','storageState','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','ADgct','trackPhaseStart','712uCJjrW','parse','log','catch','\x20\x20\x20Update\x20your\x20authentication\x20as\x20needed.','UWtdK','\x0a📋\x20Authentication\x20Update','✓\x20Auth\x20state\x20saved\x20to:\x20','ZiaDk','config_write'];_0xa7eb=function(){return _0x5c8de7;};return _0xa7eb();}import{buildBrowserOptionsFromSettings,getEnvDir,isEnvCi,resolveEnvVars}from'./utils/settings.js';import{addProfileSetupBanner}from'./utils/profileSetupBanner.js';export async function updateEnv(_0x9c474c,_0x3cd597,_0x231f4f){const _0x26e960=_0xcfe1,_0x286f3d={'llPwM':_0x26e960(0x1a8),'SxiCs':_0x26e960(0x1b5),'UWtdK':function(_0x302ee7,_0x4ee1b4){return _0x302ee7(_0x4ee1b4);},'cErjc':'.enc','WHSQo':function(_0x446836,_0x34e99f){return _0x446836===_0x34e99f;},'Gvfqi':'string','OcAbH':function(_0x81f60d,_0x480587){return _0x81f60d(_0x480587);},'eYGbS':_0x26e960(0x1cf),'NELnU':'\x20\x20\x20When\x20you\x20are\x20done,\x20close\x20the\x20browser.\x0a','yiKHQ':function(_0x1b3d48,_0x6f1fa9,_0x2f1198){return _0x1b3d48(_0x6f1fa9,_0x2f1198);},'rMvMR':'about:blank','clHho':'This\x20can\x20happen\x20due\x20to\x20a\x20browser\x20compatibility\x20issue\x20on\x20some\x20systems.\x0a','PCeiL':function(_0x4a3daa,_0x157d61,_0x1091fc){return _0x4a3daa(_0x157d61,_0x1091fc);},'ADgct':function(_0x266fd5){return _0x266fd5();},'DMyDn':_0x26e960(0x1a6),'gWdHe':function(_0x5a2700,_0x32ff68,_0x23e9df){return _0x5a2700(_0x32ff68,_0x23e9df);},'THPSA':_0x26e960(0x19d),'ZiaDk':_0x26e960(0x19f),'vINfn':_0x26e960(0x1d4),'jkuGg':function(_0x476d14,_0x5d78f0,_0xf9c3e4){return _0x476d14(_0x5d78f0,_0xf9c3e4);}},_0x4f9416=_0x286f3d[_0x26e960(0x1d0)](getEnvDir,_0x9c474c),_0x46712e=join(_0x4f9416,_0x26e960(0x1c3)),_0x32c3ae=join(_0x4f9416,_0x26e960(0x1bc)),_0x1197b8=_0x32c3ae+_0x286f3d[_0x26e960(0x1ba)],_0x171e64=process[_0x26e960(0x1b4)]['isTTY']&&process['stdout'][_0x26e960(0x19b)];if(!_0x171e64)throw new Error(_0x26e960(0x1ab));if(!existsSync(_0x4f9416))throw new Error('Profile\x20\x22'+_0x9c474c+'\x22\x20not\x20found.\x20Run\x20first:\x20ranger\x20profile\x20add\x20'+_0x9c474c);if(!_0x286f3d[_0x26e960(0x1d0)](existsSync,_0x46712e))throw new Error(_0x26e960(0x1a9)+_0x46712e+_0x26e960(0x1bd)+_0x9c474c);const _0x3861bf=await readFile(_0x46712e,'utf-8'),_0xae9e13=JSON[_0x26e960(0x1cc)](_0x3861bf),_0x8e76db=_0x286f3d[_0x26e960(0x1d0)](resolveEnvVars,_0xae9e13),_0x2a6fe7=_0x286f3d[_0x26e960(0x1b9)](typeof _0x8e76db['baseUrl'],_0x286f3d['Gvfqi'])?_0x8e76db[_0x26e960(0x1d5)]:undefined,_0x3018d1=existsSync(_0x32c3ae),_0x4ffa7d=_0x286f3d['OcAbH'](isEnvCi,_0x9c474c);_0x3cd597?.[_0x26e960(0x1ca)]('browser_auth'),console['log'](_0x26e960(0x1d1)),console[_0x26e960(0x1cd)](_0x26e960(0x1a2)),console[_0x26e960(0x1cd)](_0x286f3d['eYGbS']),console[_0x26e960(0x1cd)](_0x286f3d[_0x26e960(0x1c6)]);const {launchOptions:_0x427448,contextOptions:_0x581697}=_0x286f3d[_0x26e960(0x1bb)](buildBrowserOptionsFromSettings,_0x8e76db,{'headless':![],'storageStatePath':_0x3018d1?_0x32c3ae:undefined});_0x8e76db[_0x26e960(0x1a3)]&&(_0x581697['extraHTTPHeaders']={..._0x581697[_0x26e960(0x1a0)],..._0x8e76db[_0x26e960(0x1a3)]});const _0x3bcc79=await chromium[_0x26e960(0x1aa)](_0x427448);let _0x57dc33=null;try{_0x57dc33=await _0x3bcc79['newContext'](_0x581697),await addProfileSetupBanner(_0x57dc33);const _0x55cbdc=await _0x57dc33[_0x26e960(0x1b1)]();await _0x55cbdc[_0x26e960(0x1b8)](_0x2a6fe7||_0x286f3d[_0x26e960(0x1b2)]);let _0x531be3=![];await new Promise(_0x244f71=>{const _0x1eb850=_0x26e960;_0x55cbdc['on'](_0x286f3d[_0x1eb850(0x1b0)],async()=>{const _0x20ac00=_0x1eb850;try{console['log'](_0x286f3d[_0x20ac00(0x1c2)]),await _0x57dc33?.[_0x20ac00(0x1c7)]({'path':_0x32c3ae}),_0x531be3=!![];}catch{}_0x244f71();});});if(!_0x531be3){console['log']('\x0aThe\x20browser\x20closed\x20unexpectedly\x20before\x20authentication\x20could\x20be\x20saved.');!_0x8e76db[_0x26e960(0x1b7)]&&(console['log'](_0x286f3d[_0x26e960(0x1d6)]),console[_0x26e960(0x1cd)](_0x26e960(0x1ae)+_0x9c474c+_0x26e960(0x1c4)));throw new Error(_0x26e960(0x1c8));}}finally{_0x57dc33&&await _0x57dc33[_0x26e960(0x1b5)]()[_0x26e960(0x1ce)](()=>{}),await _0x3bcc79[_0x26e960(0x1b5)]()[_0x26e960(0x1ce)](()=>{});}if(_0x4ffa7d){const _0x2d8b54=await _0x286f3d['PCeiL'](readFile,_0x32c3ae,'utf-8'),_0x2b4dae=await _0x286f3d[_0x26e960(0x1c9)](getToken);if(!_0x2b4dae)console[_0x26e960(0x1b6)](_0x286f3d[_0x26e960(0x1ac)]),console[_0x26e960(0x1cd)]('✓\x20Auth\x20state\x20saved\x20to:\x20'+_0x32c3ae);else{const _0x492cb6=_0x286f3d['PCeiL'](encrypt,_0x2d8b54,_0x2b4dae);await _0x286f3d[_0x26e960(0x1af)](writeFile,_0x1197b8,_0x492cb6),await unlink(_0x32c3ae),console['log']('✓\x20Encrypted\x20auth\x20saved\x20to:\x20'+_0x1197b8),console[_0x26e960(0x1cd)](_0x286f3d['THPSA']),console['log']('\x20\x20Run\x20ranger\x20setup\x20in\x20CI\x20to\x20decrypt\x20at\x20runtime.');}}else console['log'](_0x26e960(0x1d2)+_0x32c3ae);_0x3cd597?.[_0x26e960(0x1c5)](_0x286f3d[_0x26e960(0x1d3)]),_0x3cd597?.[_0x26e960(0x1ca)](_0x286f3d['vINfn']),_0xae9e13['browser']=_0xae9e13[_0x26e960(0x1a7)]||{},_0xae9e13[_0x26e960(0x1a7)][_0x26e960(0x1a4)]=_0xae9e13['browser']['contextOptions']||{},_0xae9e13['browser']['contextOptions'][_0x26e960(0x1c7)]=_0x32c3ae,_0x286f3d['WHSQo'](_0x231f4f?.['allowInsecureLocalhost'],!![])&&(_0xae9e13[_0x26e960(0x1ad)]=!![]),await _0x286f3d['jkuGg'](writeFile,_0x46712e,JSON['stringify'](_0xae9e13,null,0x2)),console[_0x26e960(0x1cd)]('✓\x20Updated\x20config:\x20'+_0x46712e),_0x3cd597?.[_0x26e960(0x1c5)](_0x286f3d[_0x26e960(0x19e)]),console['log']('\x0a✅\x20Profile\x20\x22'+_0x9c474c+'\x22\x20authentication\x20updated');}
|
package/build/commands/useEnv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0xb0b7(_0x3b2ead,_0x42d256){_0x3b2ead=_0x3b2ead-0x137;const _0x12d141=_0x12d1();let _0xb0b7a7=_0x12d141[_0x3b2ead];return _0xb0b7a7;}(function(_0x5c8372,_0xcddb3b){const _0x24e2be=_0xb0b7,_0x170ae9=_0x5c8372();while(!![]){try{const _0x1f8f63=parseInt(_0x24e2be(0x13b))/0x1+parseInt(_0x24e2be(0x139))/0x2*(-parseInt(_0x24e2be(0x140))/0x3)+parseInt(_0x24e2be(0x13d))/0x4+-parseInt(_0x24e2be(0x141))/0x5+parseInt(_0x24e2be(0x143))/0x6*(parseInt(_0x24e2be(0x13a))/0x7)+-parseInt(_0x24e2be(0x142))/0x8*(-parseInt(_0x24e2be(0x13c))/0x9)+parseInt(_0x24e2be(0x137))/0xa;if(_0x1f8f63===_0xcddb3b)break;else _0x170ae9['push'](_0x170ae9['shift']());}catch(_0x307df1){_0x170ae9['push'](_0x170ae9['shift']());}}}(_0x12d1,0x32cae));import{join}from'path';import{existsSync}from'fs';import{getEnvDir}from'./utils/settings.js';import{writeActiveProfileName}from'./utils/activeProfile.js';function _0x12d1(){const _0x49ac4a=['4MJJHfa','7DCcewz','43985pLWPGW','18kkoSCY','918240jVoEoh','\x22\x20not\x20found.\x20Run\x20first:\x20ranger\x20profile\x20add\x20','Profile\x20\x22','249432wRVyfr','380400HZfAgZ','265304trFIgt','411198PcAXCa','.\x20Run\x20first:\x20ranger\x20profile\x20add\x20','420100HgDkMW','ofapw'];_0x12d1=function(){return _0x49ac4a;};return _0x12d1();}export async function useEnv(_0x114130){const _0x14d998=_0xb0b7,_0x32502b={'oOEag':function(_0x528ac1,_0x40672d){return _0x528ac1(_0x40672d);},'ofapw':'settings.json','qQKcQ':function(_0x164d0f,_0x53df64){return _0x164d0f(_0x53df64);},'inwho':function(_0x4fabde,_0x345afc){return _0x4fabde(_0x345afc);},'jcCMT':function(_0x2f4cf9,_0x460f82){return _0x2f4cf9(_0x460f82);}},_0x539fe3=_0x32502b['oOEag'](getEnvDir,_0x114130),_0x57e159=join(_0x539fe3,_0x32502b[_0x14d998(0x138)]);if(!_0x32502b['qQKcQ'](existsSync,_0x539fe3))throw new Error(_0x14d998(0x13f)+_0x114130+_0x14d998(0x13e)+_0x114130);if(!_0x32502b['inwho'](existsSync,_0x57e159))throw new Error('Config\x20not\x20found\x20at\x20'+_0x57e159+_0x14d998(0x144)+_0x114130);await _0x32502b['jcCMT'](writeActiveProfileName,_0x114130),console['log']('\x0a✓\x20Now\x20using\x20profile\x20\x22'+_0x114130+'\x22');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x8f4475=_0x3027;(function(_0x15610f,_0x612503){const _0x4b262b=_0x3027,_0x5bb6c1=_0x15610f();while(!![]){try{const _0x370dd3=-parseInt(_0x4b262b(0x148))/0x1+-parseInt(_0x4b262b(0x13d))/0x2*(parseInt(_0x4b262b(0x147))/0x3)+parseInt(_0x4b262b(0x13a))/0x4*(parseInt(_0x4b262b(0x13f))/0x5)+parseInt(_0x4b262b(0x13b))/0x6+-parseInt(_0x4b262b(0x14c))/0x7*(parseInt(_0x4b262b(0x144))/0x8)+-parseInt(_0x4b262b(0x149))/0x9*(-parseInt(_0x4b262b(0x142))/0xa)+-parseInt(_0x4b262b(0x146))/0xb;if(_0x370dd3===_0x612503)break;else _0x5bb6c1['push'](_0x5bb6c1['shift']());}catch(_0x45e042){_0x5bb6c1['push'](_0x5bb6c1['shift']());}}}(_0x2a15,0xaac81));import{existsSync}from'fs';function _0x2a15(){const _0x26c8d8=['22nISQlJ','active-env.txt','430nmyvLC','vtfOz','utf-8','60PKusZL','QSijx','360NWAGhc','zblna','17597085sYfLOx','52179HprffQ','574158NEZzLe','1696833MLTyCL','trim','Hxsaf','90888bmeBkZ','zvZMZ','LrqVj','59324iVAPDn','7453974sdYVBH','qgTgn'];_0x2a15=function(){return _0x26c8d8;};return _0x2a15();}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=_0x8f4475(0x13e);function getActiveProfilePath(){const _0x1dc540={'iAbHT':function(_0x273d09,_0x402772,_0x11257a){return _0x273d09(_0x402772,_0x11257a);}};return _0x1dc540['iAbHT'](join,getRangerDir(),ACTIVE_PROFILE_FILE);}function _0x3027(_0x444e16,_0x483486){_0x444e16=_0x444e16-0x139;const _0x2a15aa=_0x2a15();let _0x302764=_0x2a15aa[_0x444e16];return _0x302764;}function getLegacyActiveEnvPath(){return join(getRangerDir(),LEGACY_ACTIVE_ENV_FILE);}async function migrateLegacyActiveEnv(){const _0x51e4dc=_0x8f4475,_0x329795={'QSijx':function(_0x638ab9,_0x1a7e04,_0x492d90){return _0x638ab9(_0x1a7e04,_0x492d90);},'lXGCD':'utf-8','zvZMZ':function(_0x525fe2){return _0x525fe2();},'Hxsaf':function(_0x105929,_0x22b605,_0x384cf4){return _0x105929(_0x22b605,_0x384cf4);},'qgTgn':function(_0x4dbe2b,_0x2cc9f3){return _0x4dbe2b(_0x2cc9f3);}},_0x38176d=getLegacyActiveEnvPath();if(!existsSync(_0x38176d))return null;let _0x5578e7=null;try{_0x5578e7=(await _0x329795[_0x51e4dc(0x143)](readFile,_0x38176d,_0x329795['lXGCD']))[_0x51e4dc(0x14a)]()||null;}catch{_0x5578e7=null;}if(!_0x5578e7)return null;const _0x18595e=_0x329795[_0x51e4dc(0x14d)](getActiveProfilePath);try{await rename(_0x38176d,_0x18595e);}catch{try{const _0xa996dc=getRangerDir();await _0x329795[_0x51e4dc(0x14b)](mkdir,_0xa996dc,{'recursive':!![]}),await writeFile(_0x18595e,_0x5578e7,_0x51e4dc(0x141)),await _0x329795[_0x51e4dc(0x13c)](unlink,_0x38176d);}catch{}}return _0x5578e7;}export async function readActiveProfileName(){const _0x4f8670=_0x8f4475,_0x46d06a={'zblna':function(_0x5515bf){return _0x5515bf();}},_0x12ebea=_0x46d06a[_0x4f8670(0x145)](getActiveProfilePath);if(existsSync(_0x12ebea))try{return(await readFile(_0x12ebea,'utf-8'))[_0x4f8670(0x14a)]()||null;}catch{return null;}return await migrateLegacyActiveEnv();}export async function writeActiveProfileName(_0x5df936){const _0x4830b0=_0x8f4475,_0xcf124f={'vtfOz':function(_0x436aad,_0x176d66,_0xf06055,_0x355b4f){return _0x436aad(_0x176d66,_0xf06055,_0x355b4f);},'YoVEj':'utf-8','LrqVj':function(_0xa40a0e){return _0xa40a0e();},'jclxJ':function(_0x1d6f66,_0x2e10b1){return _0x1d6f66(_0x2e10b1);}},_0xdf3899=getRangerDir();await mkdir(_0xdf3899,{'recursive':!![]});const _0x1bfea6=getActiveProfilePath();await _0xcf124f[_0x4830b0(0x140)](writeFile,_0x1bfea6,_0x5df936,_0xcf124f['YoVEj']);const _0x12e3c6=_0xcf124f[_0x4830b0(0x139)](getLegacyActiveEnvPath);if(existsSync(_0x12e3c6))try{await _0xcf124f['jclxJ'](unlink,_0x12e3c6);}catch{}}export async function migrateActiveProfileFile(){const _0x209d1b={'BfvZd':function(_0x456764,_0x263697){return _0x456764!==_0x263697;}},_0x34dfe0=await migrateLegacyActiveEnv();return _0x209d1b['BfvZd'](_0x34dfe0,null);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const _0x192a0a=_0x162b;(function(_0x57acff,_0x20b2cc){const _0x54d106=_0x162b,_0x1dd71f=_0x57acff();while(!![]){try{const _0x52a34e=-parseInt(_0x54d106(0x1dc))/0x1*(parseInt(_0x54d106(0x1e2))/0x2)+-parseInt(_0x54d106(0x1d9))/0x3*(parseInt(_0x54d106(0x1ea))/0x4)+-parseInt(_0x54d106(0x1f2))/0x5+-parseInt(_0x54d106(0x1d4))/0x6*(-parseInt(_0x54d106(0x1e0))/0x7)+parseInt(_0x54d106(0x1ec))/0x8+parseInt(_0x54d106(0x1d0))/0x9+parseInt(_0x54d106(0x1cf))/0xa*(-parseInt(_0x54d106(0x1d5))/0xb);if(_0x52a34e===_0x20b2cc)break;else _0x1dd71f['push'](_0x1dd71f['shift']());}catch(_0x416a19){_0x1dd71f['push'](_0x1dd71f['shift']());}}}(_0x3545,0x1da13));import{delimiter,join}from'path';import{tmpdir}from'os';import{mkdirSync}from'fs';import{getAiProxyUrl}from'./environment.js';const AGENT_ENV_PASSTHROUGH_KEYS=['PATH','HOME',_0x192a0a(0x1f3),_0x192a0a(0x1df),'TEMP',_0x192a0a(0x1de),'APPDATA','LOCALAPPDATA',_0x192a0a(0x1ed),_0x192a0a(0x1da),'PLAYWRIGHT_BROWSERS_PATH',_0x192a0a(0x1e6),'CHROME_BIN','CHROMIUM_BIN','npm_config_cache',_0x192a0a(0x1d6),'npm_config_userconfig',_0x192a0a(0x1f4),_0x192a0a(0x1e5),_0x192a0a(0x1f1),_0x192a0a(0x1cb),'NPM_CONFIG_REGISTRY','DEBUG',_0x192a0a(0x1e4),'RANGER_TEST_SKIP_BROWSER_WAIT','RANGER_DISABLE_MCP'],UNEXPANDED_PATH_TOKEN_PATTERNS=['${PATH}','$PATH',_0x192a0a(0x1ce)];function _0x3545(){const _0x44b8c3=['push','Your\x20PATH\x20looks\x20incomplete\x20for\x20browser\x20automation.\x20Ranger\x20will\x20keep\x20going,\x20but\x20browser\x20setup\x20may\x20fail.','24628vYjegN','srElz','1160336TpvKdd','XDG_CACHE_HOME','TEMP','/usr/bin','string','NPM_CONFIG_PREFIX','101690RurfXE','TMPDIR','NPM_CONFIG_USERCONFIG','iaccG','JbYSn','RKchy','npm_config_registry','fbfHK','sessionToken','%PATH%','2149180BfvfSs','1603881MnzfOe','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.','split','592362TbvSVS','11EyAiPz','NPM_CONFIG_CACHE','env','xirbn','27lohCQR','XDG_CONFIG_HOME','includes','1sgQBFr','length','USERPROFILE','TMP','7cKaMiR','fOGpO','19892YClFcB','oLTvD','NODE_ENV','npm_config_prefix','PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD','filter'];_0x3545=function(){return _0x44b8c3;};return _0x3545();}export function getAgentPathHealthWarning(_0x3fbc08,_0x31d130=process['platform']){const _0x431930=_0x192a0a,_0x257caf={'xirbn':function(_0xb5f5cd,_0x53b5ac){return _0xb5f5cd||_0x53b5ac;},'JbYSn':function(_0x43cf64,_0x1dd31a){return _0x43cf64===_0x1dd31a;},'ttoOf':function(_0x3120d1,_0xc3739d){return _0x3120d1!==_0xc3739d;},'srElz':function(_0x5804a0,_0x12ba0c){return _0x5804a0&&_0x12ba0c;},'iaccG':_0x431930(0x1d1),'AxNIp':function(_0xbf964f,_0x4017da){return _0xbf964f===_0x4017da;}},_0x4eda00=[],_0x43e108=_0x257caf[_0x431930(0x1d8)](_0x3fbc08,'')[_0x431930(0x1d3)](delimiter)[_0x431930(0x1e7)](Boolean);_0x257caf[_0x431930(0x1c9)](_0x43e108[_0x431930(0x1dd)],0x0)&&_0x4eda00['push'](_0x431930(0x1d2));UNEXPANDED_PATH_TOKEN_PATTERNS['some'](_0x37761b=>(_0x3fbc08||'')[_0x431930(0x1db)](_0x37761b))&&_0x4eda00['push']('PATH\x20contains\x20an\x20unexpanded\x20placeholder\x20like\x20`${PATH}`\x20instead\x20of\x20the\x20expanded\x20current\x20PATH.');if(_0x257caf['ttoOf'](_0x31d130,'win32')){const _0x3a9717=_0x43e108['includes'](_0x431930(0x1ef)),_0x356e02=_0x43e108['includes']('/bin');_0x257caf[_0x431930(0x1eb)](!_0x3a9717,!_0x356e02)&&_0x4eda00[_0x431930(0x1e8)](_0x257caf[_0x431930(0x1c8)]);}if(_0x257caf['AxNIp'](_0x4eda00[_0x431930(0x1dd)],0x0))return null;return{'summary':_0x431930(0x1e9),'issues':_0x4eda00};}function _0x162b(_0x7a88da,_0x9c0e50){_0x7a88da=_0x7a88da-0x1c8;const _0x354538=_0x3545();let _0x162bce=_0x354538[_0x7a88da];return _0x162bce;}export function buildAgentEnv(_0x4e9718){const _0x1d61f8=_0x192a0a,_0x8c134b={'RKchy':_0x1d61f8(0x1f3),'fOGpO':_0x1d61f8(0x1df),'oLTvD':function(_0x464972){return _0x464972();},'RiHgX':function(_0x11b69e,_0x5ed863,_0x3f5ab7){return _0x11b69e(_0x5ed863,_0x3f5ab7);},'fbfHK':_0x1d61f8(0x1ee)};if(_0x4e9718['byokEnabled'])return Object['fromEntries'](Object['entries'](process[_0x1d61f8(0x1d7)])[_0x1d61f8(0x1e7)](_0x55a4af=>typeof _0x55a4af[0x1]===_0x1d61f8(0x1f0)));if(!_0x4e9718['sessionToken'])throw new Error('Session\x20token\x20is\x20required\x20when\x20RANGER_BYOK=false');const _0x23e2e0={'ANTHROPIC_API_KEY':_0x4e9718[_0x1d61f8(0x1cd)],'ANTHROPIC_BASE_URL':getAiProxyUrl()};for(const _0x147343 of AGENT_ENV_PASSTHROUGH_KEYS){const _0x3f2078=process['env'][_0x147343];_0x3f2078&&![_0x8c134b[_0x1d61f8(0x1ca)],_0x8c134b[_0x1d61f8(0x1e1)],_0x1d61f8(0x1ee)]['includes'](_0x147343)&&(_0x23e2e0[_0x147343]=_0x3f2078);}const _0x25d47b=join(_0x8c134b[_0x1d61f8(0x1e3)](tmpdir),'ranger-claude-tmp');try{_0x8c134b['RiHgX'](mkdirSync,_0x25d47b,{'recursive':!![]});}catch{}return _0x23e2e0[_0x8c134b['RKchy']]=_0x25d47b,_0x23e2e0['TMP']=_0x25d47b,_0x23e2e0[_0x8c134b[_0x1d61f8(0x1cc)]]=_0x25d47b,_0x23e2e0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x3eae(_0x17490e,_0x41a268){_0x17490e=_0x17490e-0x19b;const _0x223c13=_0x55c9();let _0x5b3423=_0x223c13[_0x17490e];if(_0x3eae['fTvpvJ']===undefined){var _0xcef5f9=function(_0x1b5df1){const _0x3dc493='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xd9d245='',_0x42a3c6='',_0x28f3f6=_0xd9d245+_0xcef5f9;for(let _0x39623c=0x0,_0x4dd9f1,_0x2ee4f7,_0x97cd4d=0x0;_0x2ee4f7=_0x1b5df1['charAt'](_0x97cd4d++);~_0x2ee4f7&&(_0x4dd9f1=_0x39623c%0x4?_0x4dd9f1*0x40+_0x2ee4f7:_0x2ee4f7,_0x39623c++%0x4)?_0xd9d245+=_0x28f3f6['charCodeAt'](_0x97cd4d+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x4dd9f1>>(-0x2*_0x39623c&0x6)):_0x39623c:0x0){_0x2ee4f7=_0x3dc493['indexOf'](_0x2ee4f7);}for(let _0x19ab5f=0x0,_0x49dbe9=_0xd9d245['length'];_0x19ab5f<_0x49dbe9;_0x19ab5f++){_0x42a3c6+='%'+('00'+_0xd9d245['charCodeAt'](_0x19ab5f)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x42a3c6);};_0x3eae['RfSprE']=_0xcef5f9,_0x3eae['gdVopF']={},_0x3eae['fTvpvJ']=!![];}const _0x55c9da=_0x223c13[0x0],_0x3eae89=_0x17490e+_0x55c9da,_0x550a80=_0x3eae['gdVopF'][_0x3eae89];if(!_0x550a80){const _0x1990b6=function(_0x173b3a){this['FGnPGo']=_0x173b3a,this['AsMnWy']=[0x1,0x0,0x0],this['egfLIm']=function(){return'newState';},this['qJzgQv']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['OSAlbO']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x1990b6['prototype']['ZxlKHo']=function(){const _0x83bdae=new RegExp(this['qJzgQv']+this['OSAlbO']),_0x1453f7=_0x83bdae['test'](this['egfLIm']['toString']())?--this['AsMnWy'][0x1]:--this['AsMnWy'][0x0];return this['qZNVvz'](_0x1453f7);},_0x1990b6['prototype']['qZNVvz']=function(_0x325b5b){if(!Boolean(~_0x325b5b))return _0x325b5b;return this['OeqEIk'](this['FGnPGo']);},_0x1990b6['prototype']['OeqEIk']=function(_0x2d4cc1){for(let _0x4e3c25=0x0,_0x5ebdf5=this['AsMnWy']['length'];_0x4e3c25<_0x5ebdf5;_0x4e3c25++){this['AsMnWy']['push'](Math['round'](Math['random']())),_0x5ebdf5=this['AsMnWy']['length'];}return _0x2d4cc1(this['AsMnWy'][0x0]);},new _0x1990b6(_0x3eae)['ZxlKHo'](),_0x5b3423=_0x3eae['RfSprE'](_0x5b3423),_0x3eae['gdVopF'][_0x3eae89]=_0x5b3423;}else _0x5b3423=_0x550a80;return _0x5b3423;}(function(_0x3d36d7,_0x198437){const _0x57d2b0=_0x3eae,_0x3cc0c2=_0x3d36d7();while(!![]){try{const _0x3340ed=-parseInt(_0x57d2b0(0x1a4))/0x1+parseInt(_0x57d2b0(0x1d5))/0x2*(parseInt(_0x57d2b0(0x1dd))/0x3)+-parseInt(_0x57d2b0(0x1da))/0x4*(-parseInt(_0x57d2b0(0x19c))/0x5)+-parseInt(_0x57d2b0(0x1fe))/0x6*(-parseInt(_0x57d2b0(0x1e6))/0x7)+-parseInt(_0x57d2b0(0x1c6))/0x8+-parseInt(_0x57d2b0(0x1f4))/0x9*(-parseInt(_0x57d2b0(0x1fa))/0xa)+-parseInt(_0x57d2b0(0x1d2))/0xb;if(_0x3340ed===_0x198437)break;else _0x3cc0c2['push'](_0x3cc0c2['shift']());}catch(_0x186000){_0x3cc0c2['push'](_0x3cc0c2['shift']());}}}(_0x55c9,0x7b16e));const _0xcef5f9=(function(){const _0x3e19f8=_0x3eae,_0x3bfc29={'xrdhQ':_0x3e19f8(0x1e3),'ChWmi':_0x3e19f8(0x1d8)};let _0x309cc0=!![];return function(_0x5357fb,_0x1fc2b1){const _0x51e42e=_0x3e19f8,_0x12da6d={'DJLeY':_0x3bfc29[_0x51e42e(0x1ab)],'IBkFB':function(_0x182c1d,_0x229b68){return _0x182c1d===_0x229b68;},'ccBMR':_0x3bfc29['ChWmi']},_0x1653d8=_0x309cc0?function(){const _0x2f60c2=_0x51e42e;if(_0x1fc2b1){if(_0x12da6d[_0x2f60c2(0x1ba)](_0x12da6d[_0x2f60c2(0x1ce)],_0x12da6d[_0x2f60c2(0x1ce)])){const _0x173531=_0x1fc2b1['apply'](_0x5357fb,arguments);return _0x1fc2b1=null,_0x173531;}else throw new _0x426083(_0x12da6d[_0x2f60c2(0x1a9)]);}}:function(){};return _0x309cc0=![],_0x1653d8;};}()),_0x5b3423=_0xcef5f9(this,function(){const _0x335b2d=_0x3eae,_0x3e9432={'RXulU':_0x335b2d(0x1f1)};return _0x5b3423['toString']()[_0x335b2d(0x1a5)](_0x335b2d(0x1f1))[_0x335b2d(0x1ad)]()['constructor'](_0x5b3423)[_0x335b2d(0x1a5)](_0x3e9432['RXulU']);});_0x5b3423();import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{createHash}from'crypto';import{withRetry}from'./retry.js';export async function createBrowserSession(_0x21004f){const _0x392834=_0x3eae,_0x432b51={'fdVio':function(_0x400611){return _0x400611();},'BUhUb':function(_0x185b5a,_0x2f7f95,_0x54d5fc){return _0x185b5a(_0x2f7f95,_0x54d5fc);},'ByHaD':_0x392834(0x1be),'nFpSb':_0x392834(0x1d7)},_0x5ee66a=await _0x432b51[_0x392834(0x1f7)](getToken);if(!_0x5ee66a)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x474c03=_0x432b51[_0x392834(0x1f7)](getApiBaseUrl),_0x4e2d2a=await _0x432b51['BUhUb'](fetch,_0x474c03+'/api/v1/mcp/browser-sessions',{'method':_0x432b51[_0x392834(0x1db)],'headers':{'Authorization':_0x392834(0x1d4)+_0x5ee66a,'Content-Type':_0x432b51['nFpSb']},'body':JSON[_0x392834(0x1cf)]({'environmentName':_0x21004f?.[_0x392834(0x1c2)],'settings':_0x21004f?.['settings'],'task':_0x21004f?.[_0x392834(0x1f6)],'url':_0x21004f?.[_0x392834(0x1bc)],'featureId':_0x21004f?.[_0x392834(0x1b1)],'checklistItemId':_0x21004f?.[_0x392834(0x19b)]})});if(!_0x4e2d2a['ok']){const _0x4f8d82=await _0x4e2d2a['text']();throw new Error(_0x392834(0x1c7)+_0x4f8d82);}return _0x4e2d2a[_0x392834(0x1a8)]();}function _0x55c9(){const _0x10f503=['nda0nfjiCgnQyG','Bwq1','l2fWAs92ms9Ty3aVyNjVD3nLCI1ZzxnZAw9UCY8','y2HLy2TSAxn0sxrLBuLK','mZuWmZK1u1f0CxLN','DMfPEwi','yMfZzty0','uefuq0G','txjyEg4','z3vLs0m','wvnKquy','BuLgvMi','mtyXmJi1qxDRD09N','C2vHCMnO','l3n0zxbZ','sK9lvKS','ANnVBG','rePmzvK','wfDsqLm','EhjKAfe','BgvUz3rO','Dg9tDhjPBMC','yxbWBgLJyxrPB24VEMLW','rxHyAwS','rMfPBgvKihrVihvWBg9HzcbMAwXLoIa','zMvHDhvYzuLK','zfbbDfi','DMLKzw8VD2vIBq','sNLXrLa','EwXSD3K','z09msNG','r0vu','B0DJy0i','wfPKweO','sujRrKi','zLnRr1q','DxjS','DNDdD0q','ue9tva','DxbKyxrL','u01os3y','ChHAuNC','zw52AxjVBM1LBNroyw1L','tLPizu0','yxbWBhK','rMfPBgvKihrVignYzwf0zsb2zxjPzMLJyxrPB24GC3rLCdOG','ntCYmtyWv3HHuvHY','rMfPBgvKihrVignYzwf0zsbICM93C2vYihnLC3nPB246ia','yxbWBgLJyxrPB24VANnVBMW','C2L6zq','AhHnCLq','uxPwuvu','sMvXwMC','u2vhyMq','y2nctvi','C3rYAw5NAwz5','Aw1Hz2uVCg5N','D1b6D2i','mJi2mZyXndfHuwHIB1K','AgnHveO','qMvHCMvYia','nda1mZeWsuDur0zn','venfCfG','yxbWBgLJyxrPB24VANnVBG','s2HXu20','rgfOtMm','ntjRvLLgthm','qNLiyuq','revPvKi','m1bfqM9LAG','Dgv4Da','Bwv0ywrHDge','rMfPBgvKihrVigDLDcbICM93C2vYihnLC3nPB246ia','l3vWBg9Hzc11CMXZ','zgLNzxn0','tM8GqvbjihrVA2vUignVBMzPz3vYzwqUifj1BJOGCMfUz2vYihnLDhvWifT0B2TLBL0','DvvczeS','wMjXsui','odq3mfrcvw1qta','yMDjuMS','l2fZC2v0CW','C2vZC2LVBLrVA2vU','y2HLy2TZDw0','rfPXsxi','Du5JB0e','u3zmBvG','C3fzD3K','vg9tuu8','AK1Lyxq','kcGOlISPkYKRksSK','rMfPBgvKihrVigDLDcbWCM94EsbZzxnZAw9UihrVA2vUoIa','rMfPBgvKihrVihvWzgf0zsbICM93C2vYihnLC3nPB246ia','mtHssw9hvK4','BNHgALC','DgfZAW','zMrwAw8','EfPfrhq','rMfPBgvKihrVignYzwf0zsbZDgvWigfZC2v0oIa','ndmYnZy0mgfmy2vMrW','vg5qz1q','r3D3Aw4','l3n0zxbZlW'];_0x55c9=function(){return _0x10f503;};return _0x55c9();}export async function updateBrowserSession(_0x2a57bc,_0x46335d){const _0x4f503e=_0x3eae,_0x417878={'uUBdK':function(_0x3bb692,_0x15bcb8){return _0x3bb692===_0x15bcb8;},'JyqFP':'nxFjW','QzVQU':function(_0x391d10){return _0x391d10();},'QQFQk':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','hxMrT':function(_0x47e49e){return _0x47e49e();},'cLZUX':function(_0x4f02bd,_0x2d3bd8,_0x306aee){return _0x4f02bd(_0x2d3bd8,_0x306aee);},'UCMkp':_0x4f503e(0x19f),'rPxNd':'application/json','ZbqIB':function(_0x4a8f20,_0x4b3174,_0x498799){return _0x4a8f20(_0x4b3174,_0x498799);},'CQvtT':'updateBrowserSession'};return _0x417878[_0x4f503e(0x1e5)](withRetry,async()=>{const _0x4cd767=_0x4f503e;if(_0x417878[_0x4cd767(0x1e4)](_0x417878[_0x4cd767(0x1b4)],_0x4cd767(0x1f5))){const _0x5057fc=await _0x417878[_0x4cd767(0x1cb)](getToken);if(!_0x5057fc)throw new Error(_0x417878['QQFQk']);const _0x8dc726=_0x417878[_0x4cd767(0x1ca)](getApiBaseUrl),_0x2aac51=await _0x417878['cLZUX'](fetch,_0x8dc726+_0x4cd767(0x200)+_0x2a57bc,{'method':_0x417878['UCMkp'],'headers':{'Authorization':_0x4cd767(0x1d4)+_0x5057fc,'Content-Type':_0x417878['rPxNd']},'body':JSON[_0x4cd767(0x1cf)](_0x46335d)});if(!_0x2aac51['ok']){const _0x14ec69=await _0x2aac51[_0x4cd767(0x1de)]();throw new Error(_0x4cd767(0x1f3)+_0x14ec69);}return _0x2aac51[_0x4cd767(0x1a8)]();}else throw new _0x16c1fd('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');},{'label':_0x417878['CQvtT']});}export async function getBrowserSession(_0x591bb6){const _0x33d687=_0x3eae,_0xb6db1a={'cWAkE':function(_0x28a9f2){return _0x28a9f2();},'jMeat':function(_0x4a48aa,_0x4719ba,_0x4cf6bf){return _0x4a48aa(_0x4719ba,_0x4cf6bf);}},_0x5cb501=await getToken();if(!_0x5cb501)throw new Error(_0x33d687(0x1e3));const _0x341143=_0xb6db1a['cWAkE'](getApiBaseUrl),_0x2eeb8e=await _0xb6db1a[_0x33d687(0x1f0)](fetch,_0x341143+_0x33d687(0x200)+_0x591bb6,{'method':_0x33d687(0x1b7),'headers':{'Authorization':_0x33d687(0x1d4)+_0x5cb501}});if(!_0x2eeb8e['ok']){const _0x58604f=await _0x2eeb8e['text']();throw new Error(_0x33d687(0x1e0)+_0x58604f);}return _0x2eeb8e[_0x33d687(0x1a8)]();}export async function getUploadUrls(_0xf1720d,_0x483875,_0x4cff10,_0x4cf1c1){const _0x1a7b66=_0x3eae,_0x40d505={'yrqMh':function(_0x127fe6){return _0x127fe6();},'fSkGT':_0x1a7b66(0x1e3),'SeGbd':function(_0x59254d){return _0x59254d();},'yllwy':function(_0x575a99,_0x231564,_0x5ab582){return _0x575a99(_0x231564,_0x5ab582);},'pDYRt':_0x1a7b66(0x1be),'uNcoA':'application/json','FFNsZ':function(_0x383530,_0xcc794e){return _0x383530!==_0xcc794e;}},_0x12e22c=await _0x40d505['yrqMh'](getToken);if(!_0x12e22c)throw new Error(_0x40d505[_0x1a7b66(0x1bb)]);const _0x337ef4=_0x40d505[_0x1a7b66(0x1cd)](getApiBaseUrl),_0x38283b=await _0x40d505[_0x1a7b66(0x1b5)](fetch,_0x337ef4+_0x1a7b66(0x200)+_0xf1720d+_0x1a7b66(0x1e1),{'method':_0x40d505['pDYRt'],'headers':{'Authorization':'Bearer\x20'+_0x12e22c,'Content-Type':_0x40d505[_0x1a7b66(0x1ec)]},'body':JSON[_0x1a7b66(0x1cf)]({'filename':_0x483875,'filetype':_0x4cff10,..._0x4cf1c1?.['size']!==undefined&&{'size':_0x4cf1c1[_0x1a7b66(0x1c9)]},..._0x4cf1c1?.[_0x1a7b66(0x1ea)]!==undefined&&{'checksum':_0x4cf1c1[_0x1a7b66(0x1ea)]},..._0x40d505['FFNsZ'](_0x4cf1c1?.[_0x1a7b66(0x1df)],undefined)&&{'metadata':_0x4cf1c1[_0x1a7b66(0x1df)]}})});if(!_0x38283b['ok']){const _0x1940cc=await _0x38283b[_0x1a7b66(0x1de)]();throw new Error('Failed\x20to\x20get\x20upload\x20URLs:\x20'+_0x1940cc);}return _0x38283b[_0x1a7b66(0x1a8)]();}export async function uploadFile(_0x316209,_0xc53600,_0x412202){const _0x1875d7=_0x3eae,_0x2273bd={'AEknp':function(_0x188c0f,_0x1a6c80,_0x3547c3){return _0x188c0f(_0x1a6c80,_0x3547c3);},'wPzwb':'PUT'},_0x15c8cd=await _0x2273bd['AEknp'](fetch,_0x316209,{'method':_0x2273bd[_0x1875d7(0x1d1)],'headers':{'Content-Type':_0x412202,'Content-Length':_0xc53600[_0x1875d7(0x1ac)]['toString']()},'body':_0xc53600});if(!_0x15c8cd['ok']){const _0x355b79=await _0x15c8cd[_0x1875d7(0x1de)]();throw new Error(_0x1875d7(0x1b0)+_0x355b79);}}export async function uploadTrace(_0x516bcb,_0x4bff5e){const _0x248d6a=_0x3eae,_0x340c1d={'GGVkP':function(_0x3b8d95,_0x47b66b,_0x47ff38,_0x122f3b){return _0x3b8d95(_0x47b66b,_0x47ff38,_0x122f3b);},'hcaTJ':_0x248d6a(0x1ae)};return _0x340c1d['GGVkP'](uploadFile,_0x516bcb,_0x4bff5e,_0x340c1d[_0x248d6a(0x1d3)]);}export async function uploadConversation(_0x382e50,_0xeff53f){const _0x3529f8=_0x3eae,_0x4202cf={'Cgafh':_0x3529f8(0x1c8)};return uploadFile(_0x382e50,_0xeff53f,_0x4202cf['Cgafh']);}export async function uploadScreenshot(_0xb5f3d8,_0x59fe53){const _0x3ad51e=_0x3eae;return uploadFile(_0xb5f3d8,_0x59fe53,_0x3ad51e(0x1d0));}export async function uploadVideo(_0x4f0986,_0x358c07){const _0x2dafb9=_0x3eae,_0x35d125={'ToSQO':function(_0x5b3ecb,_0x31eadf,_0x4041fc,_0x4f8ebb){return _0x5b3ecb(_0x31eadf,_0x4041fc,_0x4f8ebb);}};return _0x35d125[_0x2dafb9(0x1ef)](uploadFile,_0x4f0986,_0x358c07,_0x2dafb9(0x1b3));}export function buildTraceViewerUrl(_0x24bc7f){const _0x87c880=_0x3eae,_0x45e94b={'DZqIr':function(_0x41f144,_0x769b97){return _0x41f144(_0x769b97);}},_0x5d032b=_0x45e94b[_0x87c880(0x1eb)](encodeURIComponent,_0x24bc7f);return'https://trace.playwright.dev/?trace='+_0x5d032b;}export async function getProxySessionToken(){const _0x4e37c4=_0x3eae,_0x354ff2={'GIGhe':function(_0x12c57e){return _0x12c57e();},'xZEDt':function(_0x2bc670,_0x5ca728,_0x16adda){return _0x2bc670(_0x5ca728,_0x16adda);},'UnqWa':_0x4e37c4(0x1be)},_0x1d4d1e=await getToken();if(!_0x1d4d1e)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x1e0b33=_0x354ff2['GIGhe'](getApiBaseUrl),_0x31fc41=await _0x354ff2[_0x4e37c4(0x1f8)](fetch,_0x1e0b33+'/api/v1/mcp/proxy-session',{'method':_0x354ff2['UnqWa'],'headers':{'Authorization':_0x4e37c4(0x1d4)+_0x1d4d1e}});if(!_0x31fc41['ok']){const _0x22251c=await _0x31fc41[_0x4e37c4(0x1de)]();throw new Error(_0x4e37c4(0x1f2)+_0x22251c);}const _0x58c471=await _0x31fc41[_0x4e37c4(0x1a8)]();return _0x58c471[_0x4e37c4(0x1e9)];}export function computeChecksum(_0x5c2d15){const _0x3610e4=_0x3eae,_0x4fc9cd={'bgIRk':function(_0x556227,_0x15445b){return _0x556227(_0x15445b);},'NHzSj':_0x3610e4(0x19e)};return _0x4fc9cd[_0x3610e4(0x1e7)](createHash,_0x3610e4(0x1ff))[_0x3610e4(0x1bf)](_0x5c2d15)[_0x3610e4(0x1e2)](_0x4fc9cd['NHzSj']);}export async function createVerificationStep(_0x2bd5b7,_0x4d3014){const _0x1644c4=_0x3eae,_0x31a651={'XuqSF':function(_0x2d07f1){return _0x2d07f1();},'TCEpX':function(_0x3ebc8b){return _0x3ebc8b();},'BlvIq':_0x1644c4(0x1be),'dPAtR':'application/json'},_0x4f3682=await _0x31a651['XuqSF'](getToken);if(!_0x4f3682)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x4aec55=_0x31a651[_0x1644c4(0x1d6)](getApiBaseUrl),_0x8ff03=await fetch(_0x4aec55+_0x1644c4(0x200)+_0x2bd5b7+_0x1644c4(0x1a6),{'method':_0x31a651['BlvIq'],'headers':{'Authorization':_0x1644c4(0x1d4)+_0x4f3682,'Content-Type':_0x31a651[_0x1644c4(0x1b2)]},'body':JSON['stringify'](_0x4d3014)});if(!_0x8ff03['ok']){const _0x401b6b=await _0x8ff03['text']();throw new Error(_0x1644c4(0x1c5)+_0x401b6b);}return _0x8ff03[_0x1644c4(0x1a8)]();}export async function createStepAsset(_0x2a7afc,_0x5aa0a6,_0x2952b2){const _0x302830=_0x3eae,_0x1f740f={'MrXxn':_0x302830(0x1e3),'Gwwin':_0x302830(0x19e),'JeqZg':function(_0x486382){return _0x486382();},'XWRBS':_0x302830(0x1d9),'Ksozp':_0x302830(0x1a7),'pxZRw':function(_0x45eb1e,_0x49054b,_0x156b1b){return _0x45eb1e(_0x49054b,_0x156b1b);},'jPUGN':_0x302830(0x1d7),'izBRc':function(_0x2fdb7f,_0x10316e){return _0x2fdb7f!==_0x10316e;},'TnPgT':_0x302830(0x1b9),'VHOBT':_0x302830(0x1ed)},_0x359aa1=await _0x1f740f[_0x302830(0x1cc)](getToken);if(!_0x359aa1){if(_0x1f740f[_0x302830(0x1aa)]!==_0x1f740f['Ksozp'])throw new Error(_0x1f740f[_0x302830(0x1a0)]);else throw new _0x205b76(_0x1f740f[_0x302830(0x1a0)]);}const _0x4e409a=_0x1f740f[_0x302830(0x1cc)](getApiBaseUrl),_0x3ece9c=await _0x1f740f[_0x302830(0x1c1)](fetch,_0x4e409a+'/api/v1/mcp/browser-sessions/'+_0x2a7afc+_0x302830(0x1fd)+_0x5aa0a6+_0x302830(0x1e8),{'method':_0x302830(0x1be),'headers':{'Authorization':'Bearer\x20'+_0x359aa1,'Content-Type':_0x1f740f['jPUGN']},'body':JSON[_0x302830(0x1cf)](_0x2952b2)});if(!_0x3ece9c['ok']){if(_0x1f740f['izBRc'](_0x1f740f[_0x302830(0x1fb)],_0x1f740f['VHOBT'])){const _0x947fda=await _0x3ece9c[_0x302830(0x1de)]();throw new Error(_0x302830(0x1f9)+_0x947fda);}else return _0x26d386('md5')[_0x302830(0x1bf)](_0x56706c)[_0x302830(0x1e2)](_0x1f740f[_0x302830(0x1fc)]);}return _0x3ece9c['json']();}export async function updateVerificationStep(_0x41c609,_0x5e28e9,_0x15dc03){const _0x2c1971=_0x3eae,_0x4c1ee3={'gOLJx':'GMzNQ','DEiVB':_0x2c1971(0x1e3),'gueKC':function(_0x226bbf){return _0x226bbf();},'otEQU':function(_0x3cc874,_0x17d758,_0x93d10e){return _0x3cc874(_0x17d758,_0x93d10e);},'sqYwy':_0x2c1971(0x1d7)},_0x43eac6=await getToken();if(!_0x43eac6){if(_0x4c1ee3[_0x2c1971(0x1b6)]===_0x4c1ee3[_0x2c1971(0x1b6)])throw new Error(_0x4c1ee3[_0x2c1971(0x1dc)]);else{if(_0x144ee3){const _0xe8f5da=_0x1cf8dd[_0x2c1971(0x1c4)](_0x23b2e5,arguments);return _0x355613=null,_0xe8f5da;}}}const _0x2f9bbe=_0x4c1ee3[_0x2c1971(0x1a1)](getApiBaseUrl),_0x33a832=await _0x4c1ee3['otEQU'](fetch,_0x2f9bbe+_0x2c1971(0x200)+_0x41c609+_0x2c1971(0x1fd)+_0x5e28e9,{'method':_0x2c1971(0x19f),'headers':{'Authorization':_0x2c1971(0x1d4)+_0x43eac6,'Content-Type':_0x4c1ee3[_0x2c1971(0x1ee)]},'body':JSON[_0x2c1971(0x1cf)](_0x15dc03)});if(!_0x33a832['ok']){const _0xb2bcab=await _0x33a832[_0x2c1971(0x1de)]();throw new Error('Failed\x20to\x20update\x20verification\x20step:\x20'+_0xb2bcab);}}export async function getBrowserSessionSteps(_0x346993){const _0x5713f0=_0x3eae,_0x546ed2={'vwCwD':_0x5713f0(0x1e3),'AkzHu':function(_0x2a8cae,_0x2cfea7,_0x1d9d6e,_0x3879c1){return _0x2a8cae(_0x2cfea7,_0x1d9d6e,_0x3879c1);},'YSdAF':_0x5713f0(0x1d0),'ExXik':_0x5713f0(0x19d),'NZHeM':function(_0x8e47e0,_0x466860,_0x4eabb3){return _0x8e47e0(_0x466860,_0x4eabb3);},'mIFVb':_0x5713f0(0x1b7),'SMNKv':function(_0x312120,_0x549967){return _0x312120!==_0x549967;},'oGccB':'VqOAy'},_0x502119=await getToken();if(!_0x502119){if(_0x546ed2[_0x5713f0(0x1af)]==='vaiyb')throw new Error(_0x546ed2[_0x5713f0(0x1bd)]);else throw new _0x50bace(_0x546ed2[_0x5713f0(0x1bd)]);}const _0x5ed15d=getApiBaseUrl(),_0x2b318f=await _0x546ed2[_0x5713f0(0x1c3)](fetch,_0x5ed15d+_0x5713f0(0x200)+_0x346993+_0x5713f0(0x1a6),{'method':_0x546ed2[_0x5713f0(0x1a3)],'headers':{'Authorization':_0x5713f0(0x1d4)+_0x502119}});if(!_0x2b318f['ok']){if(_0x546ed2[_0x5713f0(0x1c0)](_0x546ed2[_0x5713f0(0x1b8)],_0x546ed2[_0x5713f0(0x1b8)]))return _0x546ed2['AkzHu'](_0x3b8084,_0x54d637,_0x18a23c,_0x546ed2[_0x5713f0(0x1a2)]);else{const _0xb3cf7c=await _0x2b318f[_0x5713f0(0x1de)]();throw new Error('Failed\x20to\x20get\x20browser\x20session\x20steps:\x20'+_0xb3cf7c);}}return _0x2b318f[_0x5713f0(0x1a8)]();}
|
|
1
|
+
(function(_0x2b4718,_0x3dfe79){const _0x4117f5=_0x59a1,_0x40dbad=_0x2b4718();while(!![]){try{const _0x395d70=-parseInt(_0x4117f5(0x16b))/0x1+-parseInt(_0x4117f5(0x165))/0x2*(parseInt(_0x4117f5(0x126))/0x3)+-parseInt(_0x4117f5(0x14c))/0x4+parseInt(_0x4117f5(0x171))/0x5+-parseInt(_0x4117f5(0x17d))/0x6+parseInt(_0x4117f5(0x15e))/0x7*(-parseInt(_0x4117f5(0x166))/0x8)+parseInt(_0x4117f5(0x160))/0x9;if(_0x395d70===_0x3dfe79)break;else _0x40dbad['push'](_0x40dbad['shift']());}catch(_0x50ee2b){_0x40dbad['push'](_0x40dbad['shift']());}}}(_0x41e7,0x75184));const _0x1e05f4=(function(){const _0x3516f5=_0x59a1,_0x109870={'cgqaU':function(_0x2b7d1e,_0x15c21e,_0x5daffb,_0x574e6f){return _0x2b7d1e(_0x15c21e,_0x5daffb,_0x574e6f);},'JOfER':_0x3516f5(0x157),'qViru':'iGpKn'};let _0x4a515c=!![];return function(_0x2f9d01,_0x184f90){const _0x18c250=_0x3516f5,_0x44795f={'nyyXp':function(_0x44262c,_0x417c4f,_0x382062,_0x54588b){return _0x109870['cgqaU'](_0x44262c,_0x417c4f,_0x382062,_0x54588b);},'LvUVF':_0x109870['JOfER'],'BFUrU':_0x109870[_0x18c250(0x12f)]},_0x459599=_0x4a515c?function(){const _0x5eea06=_0x18c250;if(_0x44795f[_0x5eea06(0x189)]!==_0x44795f[_0x5eea06(0x189)])return _0x44795f[_0x5eea06(0x13d)](_0x4c990f,_0x441032,_0x2639b8,_0x44795f[_0x5eea06(0x17c)]);else{if(_0x184f90){const _0x2ce2fe=_0x184f90[_0x5eea06(0x132)](_0x2f9d01,arguments);return _0x184f90=null,_0x2ce2fe;}}}:function(){};return _0x4a515c=![],_0x459599;};}()),_0x268c5b=_0x1e05f4(this,function(){const _0x36a857=_0x59a1,_0x527892={'bRmKl':_0x36a857(0x154)};return _0x268c5b[_0x36a857(0x172)]()['search'](_0x527892[_0x36a857(0x162)])[_0x36a857(0x172)]()[_0x36a857(0x152)](_0x268c5b)[_0x36a857(0x16a)](_0x36a857(0x154));});_0x268c5b();import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{createHash}from'crypto';import{withRetry}from'./retry.js';export async function createBrowserSession(_0x35ba45){const _0xde4849=_0x59a1,_0x405ec3={'RtzvV':function(_0x12ee04){return _0x12ee04();},'hGedz':function(_0x3a7384,_0x1f288d,_0x2d20a3){return _0x3a7384(_0x1f288d,_0x2d20a3);},'zVmLG':_0xde4849(0x178),'MNhbk':_0xde4849(0x164),'aSWTH':function(_0x5428cc,_0x59897b){return _0x5428cc===_0x59897b;},'zkOEf':_0xde4849(0x190),'LBBVp':'LWXNK'},_0x2cd4e5=await _0x405ec3['RtzvV'](getToken);if(!_0x2cd4e5)throw new Error(_0xde4849(0x163));const _0x292800=getApiBaseUrl(),_0x5675d9=await _0x405ec3['hGedz'](fetch,_0x292800+_0xde4849(0x123),{'method':_0x405ec3[_0xde4849(0x139)],'headers':{'Authorization':'Bearer\x20'+_0x2cd4e5,'Content-Type':_0x405ec3[_0xde4849(0x150)]},'body':JSON[_0xde4849(0x17e)]({'environmentName':_0x35ba45?.['environmentName'],'settings':_0x35ba45?.[_0xde4849(0x134)],'task':_0x35ba45?.[_0xde4849(0x170)],'url':_0x35ba45?.[_0xde4849(0x124)],'featureId':_0x35ba45?.[_0xde4849(0x13f)],'checklistItemId':_0x35ba45?.[_0xde4849(0x155)]})});if(!_0x5675d9['ok']){if(_0x405ec3[_0xde4849(0x182)](_0x405ec3[_0xde4849(0x161)],_0x405ec3['LBBVp'])){const _0x1db774=_0x110266?function(){if(_0x53ebf1){const _0x58676b=_0x42e81c['apply'](_0x219995,arguments);return _0x1fb02f=null,_0x58676b;}}:function(){};return _0x3dd759=![],_0x1db774;}else{const _0x53db89=await _0x5675d9['text']();throw new Error('Failed\x20to\x20create\x20browser\x20session:\x20'+_0x53db89);}}return _0x5675d9[_0xde4849(0x175)]();}export async function updateBrowserSession(_0x284a55,_0x434ce3){const _0x5cce5f=_0x59a1,_0x477412={'BgxBD':function(_0x155348,_0x387145,_0x5e39d1,_0x528576){return _0x155348(_0x387145,_0x5e39d1,_0x528576);},'rOWLc':_0x5cce5f(0x18a),'IavUk':function(_0x4f3c3e){return _0x4f3c3e();},'hnHIO':_0x5cce5f(0x163),'IHJxf':_0x5cce5f(0x151),'OWjuM':'application/json','bFRFS':function(_0x2e2538,_0x2c4b9b){return _0x2e2538!==_0x2c4b9b;},'TLUzS':'YxoOG','QEmYs':_0x5cce5f(0x191),'KpJHg':function(_0x36c74f,_0x1e3e9c,_0x1aaaec){return _0x36c74f(_0x1e3e9c,_0x1aaaec);}};return _0x477412[_0x5cce5f(0x141)](withRetry,async()=>{const _0x4a2a24=_0x5cce5f,_0x814b63=await _0x477412[_0x4a2a24(0x13c)](getToken);if(!_0x814b63)throw new Error(_0x477412[_0x4a2a24(0x13b)]);const _0x1063d4=getApiBaseUrl(),_0x116542=await fetch(_0x1063d4+_0x4a2a24(0x14b)+_0x284a55,{'method':_0x477412[_0x4a2a24(0x18f)],'headers':{'Authorization':_0x4a2a24(0x125)+_0x814b63,'Content-Type':_0x477412['OWjuM']},'body':JSON[_0x4a2a24(0x17e)](_0x434ce3)});if(!_0x116542['ok']){if(_0x477412['bFRFS'](_0x477412[_0x4a2a24(0x16d)],_0x477412[_0x4a2a24(0x135)])){const _0x274f87=await _0x116542[_0x4a2a24(0x159)]();throw new Error(_0x4a2a24(0x13a)+_0x274f87);}else return _0x477412[_0x4a2a24(0x130)](_0x340a93,_0x461109,_0x51f264,_0x477412['rOWLc']);}return _0x116542[_0x4a2a24(0x175)]();},{'label':_0x5cce5f(0x149)});}export async function getBrowserSession(_0x84b270){const _0x4b08db=_0x59a1,_0x391038={'vNEoo':function(_0x2dc2a1){return _0x2dc2a1();},'SMzwx':function(_0x12998f,_0x1c4a25,_0x54cb7f){return _0x12998f(_0x1c4a25,_0x54cb7f);},'wSGtV':'GET'},_0x2ead1b=await getToken();if(!_0x2ead1b)throw new Error(_0x4b08db(0x163));const _0x36b1d1=_0x391038['vNEoo'](getApiBaseUrl),_0x4c19a3=await _0x391038[_0x4b08db(0x153)](fetch,_0x36b1d1+'/api/v1/mcp/browser-sessions/'+_0x84b270,{'method':_0x391038[_0x4b08db(0x138)],'headers':{'Authorization':_0x4b08db(0x125)+_0x2ead1b}});if(!_0x4c19a3['ok']){const _0x264589=await _0x4c19a3['text']();throw new Error(_0x4b08db(0x131)+_0x264589);}return _0x4c19a3['json']();}export async function getUploadUrls(_0x539dec,_0x51c304,_0x2151ed,_0x59f6bd){const _0x62d330=_0x59a1,_0x28ce79={'KVqhm':function(_0x3c72e5){return _0x3c72e5();},'xsskK':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','lfXMV':_0x62d330(0x178),'mZaGg':_0x62d330(0x164),'kEqds':function(_0x5174c0,_0x204a29){return _0x5174c0!==_0x204a29;},'JNWrF':function(_0x5e1286,_0x56fad1){return _0x5e1286!==_0x56fad1;}},_0x13df77=await _0x28ce79[_0x62d330(0x146)](getToken);if(!_0x13df77)throw new Error(_0x28ce79[_0x62d330(0x18e)]);const _0x472ffc=getApiBaseUrl(),_0x56bf1c=await fetch(_0x472ffc+_0x62d330(0x14b)+_0x539dec+_0x62d330(0x17a),{'method':_0x28ce79[_0x62d330(0x15d)],'headers':{'Authorization':'Bearer\x20'+_0x13df77,'Content-Type':_0x28ce79[_0x62d330(0x136)]},'body':JSON[_0x62d330(0x17e)]({'filename':_0x51c304,'filetype':_0x2151ed,..._0x28ce79['kEqds'](_0x59f6bd?.[_0x62d330(0x15b)],undefined)&&{'size':_0x59f6bd[_0x62d330(0x15b)]},..._0x59f6bd?.[_0x62d330(0x18c)]!==undefined&&{'checksum':_0x59f6bd[_0x62d330(0x18c)]},..._0x28ce79['JNWrF'](_0x59f6bd?.[_0x62d330(0x14a)],undefined)&&{'metadata':_0x59f6bd[_0x62d330(0x14a)]}})});if(!_0x56bf1c['ok']){const _0x55a9b2=await _0x56bf1c[_0x62d330(0x159)]();throw new Error(_0x62d330(0x15f)+_0x55a9b2);}return _0x56bf1c[_0x62d330(0x175)]();}export async function uploadFile(_0x1ac187,_0x33d724,_0x159712){const _0x3461c1=_0x59a1,_0x2c6c48={'yePiK':function(_0x2a433e,_0x430832,_0x4558c9){return _0x2a433e(_0x430832,_0x4558c9);}},_0x122b86=await _0x2c6c48[_0x3461c1(0x194)](fetch,_0x1ac187,{'method':_0x3461c1(0x14d),'headers':{'Content-Type':_0x159712,'Content-Length':_0x33d724['length'][_0x3461c1(0x172)]()},'body':_0x33d724});if(!_0x122b86['ok']){const _0x268ebc=await _0x122b86[_0x3461c1(0x159)]();throw new Error('Failed\x20to\x20upload\x20file:\x20'+_0x268ebc);}}export async function uploadTrace(_0x3d0cc0,_0x1e1342){const _0x1f0596=_0x59a1,_0x56f8f8={'UMKtf':function(_0x471566,_0x3a3493,_0x5c78fc,_0x4978c5){return _0x471566(_0x3a3493,_0x5c78fc,_0x4978c5);},'CvquF':_0x1f0596(0x18a)};return _0x56f8f8[_0x1f0596(0x17f)](uploadFile,_0x3d0cc0,_0x1e1342,_0x56f8f8['CvquF']);}export async function uploadConversation(_0x348134,_0x388ac1){const _0x340167=_0x59a1,_0x32ada5={'MAvWi':_0x340167(0x184)};return uploadFile(_0x348134,_0x388ac1,_0x32ada5[_0x340167(0x129)]);}function _0x41e7(){const _0x3ea2e3=['EwvqAuS','l2fWAs92ms9Ty3aVyNjVD3nLCI1ZzxnZAw9UCW','DxjS','qMvHCMvYia','odK4ogffru5RzG','C2vZC2LVBLrVA2vU','qLDqvgS','tuf2v2K','vw5HvNy','l2fWAs92ms9Ty3aVChjVEhKTC2vZC2LVBG','q2rzrvu','wgzcwey','DeHqsee','CvzPCNu','qMD4qKq','rMfPBgvKihrVigDLDcbICM93C2vYihnLC3nPB246ia','yxbWBhK','u1vntwO','C2v0DgLUz3m','uuvTwxm','BvPHr2C','CLLADgO','D1nhDfy','ELzTteC','rMfPBgvKihrVihvWzgf0zsbICM93C2vYihnLC3nPB246ia','Ag5isu8','swf2vwS','BNL5wha','rMfPBgvKihrVignYzwf0zsb2zxjPzMLJyxrPB24GC3rLCdOG','zMvHDhvYzuLK','yujSteO','s3bksgC','EK5dzLq','sfjmD2e','tLrXwhu','vhDcExC','s1zXAg0','r2XVqu0','DK12vhC','DxbKyxrLqNjVD3nLCLnLC3nPB24','Bwv0ywrHDge','l2fWAs92ms9Ty3aVyNjVD3nLCI1ZzxnZAw9UCY8','otaZodm2EvrwwNzg','ufvu','tgjyqvO','DxbKyxrL','tu5OyMS','uefuq0G','y29UC3rYDwn0B3i','u016D3G','kcGOlISPkYKRksSK','y2HLy2TSAxn0sxrLBuLK','q3nhtM4','DMLKzw8VD2vIBq','thbKvNK','Dgv4Da','ug9uExi','C2L6zq','t1vQDxi','Bgzytvy','mte5yLPJqLn0','rMfPBgvKihrVigDLDcb1CgXVywqGvvjmCZOG','mtuXodm0ntbUCeHPvuC','EMTprwy','yLjTs2W','tM8GqvbjihrVA2vUignVBMzPz3vYzwqUifj1BJOGCMfUz2vYihnLDhvWifT0B2TLBL0','yxbWBgLJyxrPB24VANnVBG','mte2B3zZv25M','mZy2mZq0C2XlCLDM','z2P0zxG','twvYtNO','rgHrt2u','C2vHCMnO','ndm5mZa2tgHXwfbj','r0vu','veXvELm','yunWueq','l3n0zxbZ','DgfZAW','mJa1odC0mgjsD3jUDa','Dg9tDhjPBMC','s3HLrKG','Ahr0Chm6lY90CMfJzs5WBgf5D3jPz2H0lMrLDI8/DhjHy2u9','ANnVBG','BLfNBvm','zwDWA20','ue9tva','wfflC00','l3vWBg9Hzc11CMXZ','v01Ts0u','thzvvKy','otK4nhHNsKrZCG','C3rYAw5NAwz5','vu1lDgy','rMfPBgvKihrVihvWzgf0zsb2zxjPzMLJyxrPB24GC3rLCdOG','teHvu1y','yvnxveG','l3n0zxbZlW','yxbWBgLJyxrPB24VANnVBMW','t3PXzKK','u2rbD2K','rMfPBgvKihrVignYzwf0zsbZDgvWigfZC2v0oIa','yMfZzty0','qKzvCLu','yxbWBgLJyxrPB24VEMLW','zgLNzxn0','y2HLy2TZDw0','ruP6suG','EhnZA0S','suHkEgy','DLPUEg4','vwToCeC','EwDuwxa','l2fZC2v0CW'];_0x41e7=function(){return _0x3ea2e3;};return _0x41e7();}export async function uploadScreenshot(_0x200866,_0x2892c0){const _0x214121=_0x59a1,_0x46d4f3={'OUjur':function(_0x49c374,_0x12090f,_0x51eb01,_0x294a0d){return _0x49c374(_0x12090f,_0x51eb01,_0x294a0d);},'fhaKE':'image/png'};return _0x46d4f3[_0x214121(0x15c)](uploadFile,_0x200866,_0x2892c0,_0x46d4f3['fhaKE']);}export async function uploadVideo(_0x337ced,_0x573edd){const _0x390bc2=_0x59a1,_0x2f12fd={'AmVHz':function(_0x1d6209,_0x5c74cf,_0xee3fb5,_0x19fc92){return _0x1d6209(_0x5c74cf,_0xee3fb5,_0x19fc92);},'nQgmS':'video/webm'};return _0x2f12fd['AmVHz'](uploadFile,_0x337ced,_0x573edd,_0x2f12fd[_0x390bc2(0x176)]);}export function buildTraceViewerUrl(_0x4cba28){const _0x1bf185=_0x59a1,_0x567864={'HRLwa':function(_0x3e4d86,_0x2d0114){return _0x3e4d86(_0x2d0114);}},_0x413e52=_0x567864[_0x1bf185(0x143)](encodeURIComponent,_0x4cba28);return _0x1bf185(0x174)+_0x413e52;}function _0x59a1(_0xaebd7e,_0x95fd8e){_0xaebd7e=_0xaebd7e-0x123;const _0x4fbd59=_0x41e7();let _0x268c5b=_0x4fbd59[_0xaebd7e];if(_0x59a1['AFsJLH']===undefined){var _0x1e05f4=function(_0x56c7c4){const _0x31bcde='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x561fab='',_0x41d5ce='',_0x39433f=_0x561fab+_0x1e05f4;for(let _0x2e22d5=0x0,_0x3ff4cb,_0x260ba2,_0x4fcefe=0x0;_0x260ba2=_0x56c7c4['charAt'](_0x4fcefe++);~_0x260ba2&&(_0x3ff4cb=_0x2e22d5%0x4?_0x3ff4cb*0x40+_0x260ba2:_0x260ba2,_0x2e22d5++%0x4)?_0x561fab+=_0x39433f['charCodeAt'](_0x4fcefe+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x3ff4cb>>(-0x2*_0x2e22d5&0x6)):_0x2e22d5:0x0){_0x260ba2=_0x31bcde['indexOf'](_0x260ba2);}for(let _0x3bbebc=0x0,_0x447e2f=_0x561fab['length'];_0x3bbebc<_0x447e2f;_0x3bbebc++){_0x41d5ce+='%'+('00'+_0x561fab['charCodeAt'](_0x3bbebc)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x41d5ce);};_0x59a1['SzVRvY']=_0x1e05f4,_0x59a1['Eroqky']={},_0x59a1['AFsJLH']=!![];}const _0x41e70d=_0x4fbd59[0x0],_0x59a1f1=_0xaebd7e+_0x41e70d,_0x18bb10=_0x59a1['Eroqky'][_0x59a1f1];if(!_0x18bb10){const _0x110266=function(_0x1ae62b){this['mVfexm']=_0x1ae62b,this['LBcpzK']=[0x1,0x0,0x0],this['uTJvgc']=function(){return'newState';},this['GCXade']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['NfZDIh']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x110266['prototype']['uzxENy']=function(){const _0x43d06c=new RegExp(this['GCXade']+this['NfZDIh']),_0x1a1daf=_0x43d06c['test'](this['uTJvgc']['toString']())?--this['LBcpzK'][0x1]:--this['LBcpzK'][0x0];return this['powwex'](_0x1a1daf);},_0x110266['prototype']['powwex']=function(_0x278a46){if(!Boolean(~_0x278a46))return _0x278a46;return this['SGlsVT'](this['mVfexm']);},_0x110266['prototype']['SGlsVT']=function(_0x3dd759){for(let _0x53ebf1=0x0,_0x6152d4=this['LBcpzK']['length'];_0x53ebf1<_0x6152d4;_0x53ebf1++){this['LBcpzK']['push'](Math['round'](Math['random']())),_0x6152d4=this['LBcpzK']['length'];}return _0x3dd759(this['LBcpzK'][0x0]);},new _0x110266(_0x59a1)['uzxENy'](),_0x268c5b=_0x59a1['SzVRvY'](_0x268c5b),_0x59a1['Eroqky'][_0x59a1f1]=_0x268c5b;}else _0x268c5b=_0x18bb10;return _0x268c5b;}export async function getProxySessionToken(){const _0x393190=_0x59a1,_0xeabf40={'egpkm':_0x393190(0x163),'LbXAZ':'zLBLJ','rYZtj':function(_0x4df14f){return _0x4df14f();},'dgXeV':function(_0x2144bc,_0x3d209e,_0x12ca85){return _0x2144bc(_0x3d209e,_0x12ca85);},'mcFKc':_0x393190(0x178)},_0x5c3f23=await getToken();if(!_0x5c3f23){if(_0xeabf40[_0x393190(0x14e)]===_0xeabf40[_0x393190(0x14e)])throw new Error(_0xeabf40[_0x393190(0x177)]);else throw new _0x3e64dd(_0xeabf40[_0x393190(0x177)]);}const _0x501fa2=_0xeabf40[_0x393190(0x137)](getApiBaseUrl),_0x5c580a=await _0xeabf40['dgXeV'](fetch,_0x501fa2+_0x393190(0x12b),{'method':_0xeabf40['mcFKc'],'headers':{'Authorization':_0x393190(0x125)+_0x5c3f23}});if(!_0x5c580a['ok']){const _0x399229=await _0x5c580a[_0x393190(0x159)]();throw new Error('Failed\x20to\x20get\x20proxy\x20session\x20token:\x20'+_0x399229);}const _0x355f2a=await _0x5c580a[_0x393190(0x175)]();return _0x355f2a[_0x393190(0x127)];}export function computeChecksum(_0x9a2ace){const _0xa962e5=_0x59a1,_0x3a9110={'MerNz':'md5'};return createHash(_0x3a9110[_0xa962e5(0x168)])[_0xa962e5(0x14f)](_0x9a2ace)[_0xa962e5(0x18b)](_0xa962e5(0x188));}export async function createVerificationStep(_0x2bce3d,_0x121279){const _0x1516e6=_0x59a1,_0x3bdcdd={'GloAM':_0x1516e6(0x163),'KxeFH':function(_0x13ef37){return _0x13ef37();},'UnaVv':function(_0x190fe0,_0x78c8ef){return _0x190fe0!==_0x78c8ef;},'XQKsM':_0x1516e6(0x167),'PoTyr':function(_0x447fc6){return _0x447fc6();},'tHPHA':_0x1516e6(0x164),'sMujB':'ZfqfT','DhQOe':_0x1516e6(0x158)},_0x3a9b51=await _0x3bdcdd[_0x1516e6(0x173)](getToken);if(!_0x3a9b51){if(_0x3bdcdd[_0x1516e6(0x12a)](_0x1516e6(0x167),_0x3bdcdd[_0x1516e6(0x179)]))throw new _0x4231fe(_0x3bdcdd[_0x1516e6(0x147)]);else throw new Error(_0x3bdcdd[_0x1516e6(0x147)]);}const _0x4ffae7=_0x3bdcdd[_0x1516e6(0x15a)](getApiBaseUrl),_0x48fa33=await fetch(_0x4ffae7+_0x1516e6(0x14b)+_0x2bce3d+_0x1516e6(0x16f),{'method':'POST','headers':{'Authorization':_0x1516e6(0x125)+_0x3a9b51,'Content-Type':_0x3bdcdd[_0x1516e6(0x12e)]},'body':JSON[_0x1516e6(0x17e)](_0x121279)});if(!_0x48fa33['ok']){if(_0x3bdcdd['sMujB']!==_0x3bdcdd[_0x1516e6(0x169)]){const _0x3860ac=await _0x48fa33[_0x1516e6(0x159)]();throw new Error(_0x1516e6(0x13e)+_0x3860ac);}else throw new _0x2c66be(_0x3bdcdd[_0x1516e6(0x147)]);}return _0x48fa33[_0x1516e6(0x175)]();}export async function createStepAsset(_0x52ec2f,_0x3eba2a,_0x4cba90){const _0x218da6=_0x59a1,_0xb7a901={'SdAwi':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','NTqXu':function(_0x25a051){return _0x25a051();},'CsGNn':_0x218da6(0x192),'euLZT':_0x218da6(0x142),'aBlLJ':function(_0x4899ca){return _0x4899ca();},'TwByw':function(_0x42e997,_0x27e27c,_0x5d3026){return _0x42e997(_0x27e27c,_0x5d3026);},'dHnum':_0x218da6(0x178),'vMvTw':_0x218da6(0x164)},_0x479a09=await _0xb7a901[_0x218da6(0x144)](getToken);if(!_0x479a09){if(_0xb7a901[_0x218da6(0x156)]!==_0xb7a901['euLZT'])throw new Error(_0xb7a901[_0x218da6(0x186)]);else throw new _0x36a8d7(_0xb7a901[_0x218da6(0x186)]);}const _0x1d0e49=_0xb7a901[_0x218da6(0x140)](getApiBaseUrl),_0x331dd4=await _0xb7a901[_0x218da6(0x145)](fetch,_0x1d0e49+'/api/v1/mcp/browser-sessions/'+_0x52ec2f+_0x218da6(0x183)+_0x3eba2a+_0x218da6(0x193),{'method':_0xb7a901['dHnum'],'headers':{'Authorization':_0x218da6(0x125)+_0x479a09,'Content-Type':_0xb7a901[_0x218da6(0x148)]},'body':JSON[_0x218da6(0x17e)](_0x4cba90)});if(!_0x331dd4['ok']){const _0x2790cf=await _0x331dd4['text']();throw new Error(_0x218da6(0x187)+_0x2790cf);}return _0x331dd4[_0x218da6(0x175)]();}export async function updateVerificationStep(_0x376d7a,_0x35bd22,_0x517569){const _0x1465f9=_0x59a1,_0x1239e1={'LHUSV':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','pGcdR':function(_0xe40f01){return _0xe40f01();},'UnzZZ':function(_0xccd4dc,_0x304725,_0x4eceb5){return _0xccd4dc(_0x304725,_0x4eceb5);},'iOiVl':'application/json','BWPTk':function(_0x446195,_0x1ff5f6){return _0x446195!==_0x1ff5f6;},'WMmKE':'jaydZ'},_0x4cd35a=await getToken();if(!_0x4cd35a)throw new Error(_0x1239e1[_0x1465f9(0x181)]);const _0x34ce66=_0x1239e1['pGcdR'](getApiBaseUrl),_0x47cc51=await _0x1239e1['UnzZZ'](fetch,_0x34ce66+_0x1465f9(0x14b)+_0x376d7a+_0x1465f9(0x183)+_0x35bd22,{'method':_0x1465f9(0x151),'headers':{'Authorization':'Bearer\x20'+_0x4cd35a,'Content-Type':_0x1239e1['iOiVl']},'body':JSON[_0x1465f9(0x17e)](_0x517569)});if(!_0x47cc51['ok']){if(_0x1239e1[_0x1465f9(0x128)](_0x1465f9(0x12c),_0x1239e1[_0x1465f9(0x17b)])){const _0x168790=await _0x47cc51[_0x1465f9(0x159)]();throw new Error(_0x1465f9(0x180)+_0x168790);}else throw new _0x4af374(_0x1239e1['LHUSV']);}}export async function getBrowserSessionSteps(_0x179c03){const _0x199f19=_0x59a1,_0x230827={'EJzIH':function(_0x595ae9,_0x1d62d5,_0x4913e2,_0x7a3a49){return _0x595ae9(_0x1d62d5,_0x4913e2,_0x7a3a49);},'SUMMj':'application/jsonl','IYdGz':function(_0x4e113c){return _0x4e113c();},'OzqfI':_0x199f19(0x163),'tqZoX':function(_0xdfbbc2){return _0xdfbbc2();},'XfBXF':function(_0x22203d,_0x26e85c){return _0x22203d===_0x26e85c;},'owSpU':'ymorY','aCpPD':'YgDWH'},_0x29ce95=await _0x230827['IYdGz'](getToken);if(!_0x29ce95)throw new Error(_0x230827[_0x199f19(0x185)]);const _0x317545=_0x230827['tqZoX'](getApiBaseUrl),_0x296f8e=await fetch(_0x317545+'/api/v1/mcp/browser-sessions/'+_0x179c03+'/steps',{'method':_0x199f19(0x16c),'headers':{'Authorization':_0x199f19(0x125)+_0x29ce95}});if(!_0x296f8e['ok']){if(_0x230827[_0x199f19(0x12d)](_0x230827['owSpU'],_0x230827[_0x199f19(0x16e)]))return _0x230827[_0x199f19(0x18d)](_0x50d9db,_0x34b29c,_0x445b4f,_0x230827[_0x199f19(0x133)]);else{const _0x56588b=await _0x296f8e[_0x199f19(0x159)]();throw new Error('Failed\x20to\x20get\x20browser\x20session\x20steps:\x20'+_0x56588b);}}return _0x296f8e[_0x199f19(0x175)]();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0xc8b7(_0x2a2d09,_0x4bda38){_0x2a2d09=_0x2a2d09-0x128;const _0x1fb4b7=_0x1fb4();let _0xc8b72a=_0x1fb4b7[_0x2a2d09];return _0xc8b72a;}(function(_0x575ec3,_0x1f0908){const _0x9a855=_0xc8b7,_0x5f3ffb=_0x575ec3();while(!![]){try{const _0x45650f=parseInt(_0x9a855(0x13f))/0x1+parseInt(_0x9a855(0x12f))/0x2+parseInt(_0x9a855(0x134))/0x3*(parseInt(_0x9a855(0x12e))/0x4)+parseInt(_0x9a855(0x136))/0x5*(-parseInt(_0x9a855(0x140))/0x6)+-parseInt(_0x9a855(0x135))/0x7*(-parseInt(_0x9a855(0x13d))/0x8)+parseInt(_0x9a855(0x133))/0x9+-parseInt(_0x9a855(0x132))/0xa;if(_0x45650f===_0x1f0908)break;else _0x5f3ffb['push'](_0x5f3ffb['shift']());}catch(_0x3341bc){_0x5f3ffb['push'](_0x5f3ffb['shift']());}}}(_0x1fb4,0x88e46));import{homedir}from'os';import{join,dirname,parse}from'path';import{existsSync}from'fs';import{readFile,writeFile,mkdir}from'fs/promises';export function getClaudeConfigDir(){const _0x14294d=_0xc8b7,_0x37d2ce={'EbzKn':function(_0x49658e,_0x2c7d31,_0x561074){return _0x49658e(_0x2c7d31,_0x561074);},'SBbzw':function(_0x2a39c5){return _0x2a39c5();}};return process['env']['CLAUDE_CONFIG_DIR']||_0x37d2ce[_0x14294d(0x12d)](join,_0x37d2ce['SBbzw'](homedir),'.claude');}export function getUserSkillsDir(){const _0xb20d5b=_0xc8b7,_0x3bae76={'lQXYf':function(_0xefd7d9,_0x48cd98,_0x38a92b){return _0xefd7d9(_0x48cd98,_0x38a92b);},'KGYKm':function(_0x354486){return _0x354486();}};return _0x3bae76['lQXYf'](join,_0x3bae76[_0xb20d5b(0x129)](getClaudeConfigDir),_0xb20d5b(0x12c));}export function getProjectRoot(){const _0x4c097e=_0xc8b7,_0x2f8f62={'vtxYu':function(_0x529267,_0x467fd0){return _0x529267(_0x467fd0);},'zncjb':function(_0x48d760,_0x248632){return _0x48d760(_0x248632);},'TxZwR':function(_0x28d3e6,_0x1113ef,_0x37fda9){return _0x28d3e6(_0x1113ef,_0x37fda9);},'nmuvD':'.claude','fJGNU':_0x4c097e(0x13a),'lzvUO':function(_0x34bcde,_0x2e8cb3){return _0x34bcde(_0x2e8cb3);}};let _0x39b415=process['cwd']();const _0x1fa92c=_0x2f8f62[_0x4c097e(0x139)](parse,_0x39b415)[_0x4c097e(0x13c)];while(_0x39b415!==_0x1fa92c){if(_0x2f8f62[_0x4c097e(0x128)](existsSync,_0x2f8f62['TxZwR'](join,_0x39b415,_0x2f8f62[_0x4c097e(0x137)])))return _0x39b415;if(_0x2f8f62[_0x4c097e(0x128)](existsSync,_0x2f8f62['TxZwR'](join,_0x39b415,_0x2f8f62[_0x4c097e(0x12a)])))return _0x39b415;_0x39b415=_0x2f8f62[_0x4c097e(0x131)](dirname,_0x39b415);}return process['cwd']();}export function getProjectSkillsDir(){const _0x2c9433=_0xc8b7,_0x19ab87={'TyDma':function(_0x3f61e0,_0x13d57c,_0x39ce21,_0xcf22cb){return _0x3f61e0(_0x13d57c,_0x39ce21,_0xcf22cb);},'mxrmY':_0x2c9433(0x12c)};return _0x19ab87[_0x2c9433(0x130)](join,getProjectRoot(),'.claude',_0x19ab87['mxrmY']);}export function getSkillsDir(_0x2bd64b){const _0xe2144f=_0xc8b7;return _0x2bd64b===_0xe2144f(0x141)?getUserSkillsDir():getProjectSkillsDir();}export function getSettingsPath(){const _0x5b6031=_0xc8b7,_0x5b7f83={'rbruJ':function(_0x2c14f0,_0x342238,_0x2c150b){return _0x2c14f0(_0x342238,_0x2c150b);}};return _0x5b7f83[_0x5b6031(0x142)](join,getClaudeConfigDir(),_0x5b6031(0x12b));}export async function loadClaudeSettings(){const _0x388e92=_0xc8b7,_0x271751={'GixDK':function(_0x30986b,_0x102d05){return _0x30986b(_0x102d05);},'drwhh':function(_0xca41df,_0x383af8,_0x1f76c0){return _0xca41df(_0x383af8,_0x1f76c0);},'rMVsw':'utf-8'},_0x179e20=getSettingsPath();if(!_0x271751[_0x388e92(0x138)](existsSync,_0x179e20))return{};try{const _0xdaaa03=await _0x271751['drwhh'](readFile,_0x179e20,_0x271751['rMVsw']);return JSON['parse'](_0xdaaa03);}catch{return{};}}export async function saveClaudeSettings(_0x114ec1){const _0x5c30e1=_0xc8b7,_0x1b8ffa={'idvxZ':function(_0x4bb431){return _0x4bb431();},'KZXGn':function(_0x38138d,_0x114b81,_0x18e84f){return _0x38138d(_0x114b81,_0x18e84f);},'hsgxN':function(_0xfdec20,_0x5ac018){return _0xfdec20+_0x5ac018;},'ENjSY':'utf-8'},_0x4deca6=_0x1b8ffa[_0x5c30e1(0x13e)](getSettingsPath),_0x680796=_0x1b8ffa[_0x5c30e1(0x13e)](getClaudeConfigDir);!existsSync(_0x680796)&&await _0x1b8ffa['KZXGn'](mkdir,_0x680796,{'recursive':!![]}),await writeFile(_0x4deca6,_0x1b8ffa['hsgxN'](JSON[_0x5c30e1(0x13b)](_0x114ec1,null,0x2),'\x0a'),_0x1b8ffa['ENjSY']);}function _0x1fb4(){const _0x1603c1=['7cDaJwT','2342740pMNduM','nmuvD','GixDK','vtxYu','.git','stringify','root','4871624ZuPqjv','idvxZ','653475sEQIOD','6awoSSf','user','rbruJ','zncjb','KGYKm','fJGNU','settings.json','skills','EbzKn','6268unMptM','2167870srMvsf','TyDma','lzvUO','17269020mlMPuF','458586nYndKo','687vVByWp'];_0x1fb4=function(){return _0x1603c1;};return _0x1fb4();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2dd7c2,_0x4e0fc0){const _0x59e6bd=_0xa7d2,_0x8ba6dd=_0x2dd7c2();while(!![]){try{const _0xd34cf9=parseInt(_0x59e6bd(0x11d))/0x1*(-parseInt(_0x59e6bd(0x11a))/0x2)+parseInt(_0x59e6bd(0x11e))/0x3*(-parseInt(_0x59e6bd(0x120))/0x4)+-parseInt(_0x59e6bd(0x11c))/0x5*(parseInt(_0x59e6bd(0x118))/0x6)+parseInt(_0x59e6bd(0x117))/0x7+-parseInt(_0x59e6bd(0x11b))/0x8+parseInt(_0x59e6bd(0x11f))/0x9+parseInt(_0x59e6bd(0x116))/0xa*(parseInt(_0x59e6bd(0x119))/0xb);if(_0xd34cf9===_0x4e0fc0)break;else _0x8ba6dd['push'](_0x8ba6dd['shift']());}catch(_0x5075c9){_0x8ba6dd['push'](_0x8ba6dd['shift']());}}}(_0x2f47,0x91b1c));function _0xa7d2(_0xd86dee,_0x1f5ce6){_0xd86dee=_0xd86dee-0x116;const _0x2f47e6=_0x2f47();let _0xa7d215=_0x2f47e6[_0xd86dee];return _0xa7d215;}import{isByokEnabled}from'./environment.js';const RANGER_CLAUDE_OVERRIDE_SETTINGS={'env':{'CLAUDE_CODE_USE_BEDROCK':'0'}};export function buildClaudeOverrideExtraArgs(){const _0x3de840={'aDUeQ':function(_0x4ec2ee){return _0x4ec2ee();}};if(_0x3de840['aDUeQ'](isByokEnabled))return{};return{'settings':JSON['stringify'](RANGER_CLAUDE_OVERRIDE_SETTINGS)};}function _0x2f47(){const _0x478dd4=['6pymowu','6271596FLjlne','3236xDYvuX','8715210JzTIwk','6073165AjwBRx','1020qXtHpB','11CrvlJs','441428iyvltc','5295424upyqwT','2120KMZyyl','5fyfylb'];_0x2f47=function(){return _0x478dd4;};return _0x2f47();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x6329d6,_0x2867bf){const _0x189c62=_0x18e9,_0x4bbe90=_0x6329d6();while(!![]){try{const _0x18f425=parseInt(_0x189c62(0x11c))/0x1*(-parseInt(_0x189c62(0x135))/0x2)+-parseInt(_0x189c62(0x133))/0x3*(-parseInt(_0x189c62(0x126))/0x4)+-parseInt(_0x189c62(0x125))/0x5*(parseInt(_0x189c62(0x123))/0x6)+-parseInt(_0x189c62(0x138))/0x7*(parseInt(_0x189c62(0x137))/0x8)+-parseInt(_0x189c62(0x132))/0x9+-parseInt(_0x189c62(0x130))/0xa+-parseInt(_0x189c62(0x13a))/0xb*(-parseInt(_0x189c62(0x139))/0xc);if(_0x18f425===_0x2867bf)break;else _0x4bbe90['push'](_0x4bbe90['shift']());}catch(_0x31cf1b){_0x4bbe90['push'](_0x4bbe90['shift']());}}}(_0x7b8f,0xd9739));import{spawn}from'child_process';function _0x7b8f(){const _0x2fdfa0=['[\x5cs\x5cS]*?Version:\x5cs*([\x5cd.]+)','2miqxCS','stderr','784VEDoyo','114310vwNvox','63290916NIZjpO','11yETMko','pipe','UMVcJ','output','toString','1636563wIEnnp','enabled','KMYKo','list','includes','scope','plugin','1158102jKeyeb','match','15DvmXTE','4KhYIrP','HpkoJ','toLowerCase','[\x5cs\x5cS]*?Scope:\x5cs*(user|project|local)','inherit','llCFd','success','Command\x20exited\x20with\x20code\x20','marketplace','LeXFX','6274250VNrWwu','version','3711321vJPBSW','1416558EADSaR'];_0x7b8f=function(){return _0x2fdfa0;};return _0x7b8f();}export function runClaudeCommand(_0x24cf65,_0x22e76c){const _0x3d3d5a={'ZAcbA':function(_0x22f563,_0x3eee5d){return _0x22f563(_0x3eee5d);},'KMYKo':'claude','llCFd':'error'};return new Promise(_0x1c3467=>{const _0x374f1b=_0x18e9,_0x136c3b=_0x22e76c?.['captureOutput']?_0x374f1b(0x13b):_0x374f1b(0x12a),_0x331e13=spawn(_0x3d3d5a[_0x374f1b(0x11e)],_0x24cf65,{'stdio':_0x136c3b});let _0x32f1e4='';_0x22e76c?.['captureOutput']&&_0x331e13['stdout']&&_0x331e13['stdout']['on']('data',_0x394e3a=>{const _0x57df25=_0x374f1b;_0x32f1e4+=_0x394e3a[_0x57df25(0x11b)]();}),_0x22e76c?.['captureOutput']&&_0x331e13['stderr']&&_0x331e13[_0x374f1b(0x136)]['on']('data',_0x296bf4=>{_0x32f1e4+=_0x296bf4['toString']();}),_0x331e13['on']('close',_0x10d633=>{const _0x55a0be=_0x374f1b;_0x10d633===0x0?_0x1c3467({'success':!![],'output':_0x32f1e4}):_0x1c3467({'success':![],'error':_0x55a0be(0x12d)+_0x10d633,'output':_0x32f1e4});}),_0x331e13['on'](_0x3d3d5a[_0x374f1b(0x12b)],_0x36da95=>{_0x3d3d5a['ZAcbA'](_0x1c3467,{'success':![],'error':_0x36da95['message']});});});}export async function isMarketplaceAdded(_0x3bc9ad){const _0x528dad=_0x18e9,_0x3f66a0={'LeXFX':function(_0xd0e0c0,_0x99d9c4,_0x1f9a56){return _0xd0e0c0(_0x99d9c4,_0x1f9a56);}},_0x714aad=await _0x3f66a0[_0x528dad(0x12f)](runClaudeCommand,[_0x528dad(0x122),_0x528dad(0x12e),'list'],{'captureOutput':!![]});if(!_0x714aad[_0x528dad(0x12c)]||!_0x714aad[_0x528dad(0x13d)])return![];return _0x714aad['output'][_0x528dad(0x120)](_0x3bc9ad);}export async function isPluginInstalled(_0x3f4baa){const _0x2f0be8=_0x18e9,_0x39ff6d={'EtFzv':_0x2f0be8(0x122),'HpkoJ':_0x2f0be8(0x11f)},_0x5e9a4c=await runClaudeCommand([_0x39ff6d['EtFzv'],_0x39ff6d[_0x2f0be8(0x127)]],{'captureOutput':!![]});if(!_0x5e9a4c['success']||!_0x5e9a4c[_0x2f0be8(0x13d)])return![];return _0x5e9a4c[_0x2f0be8(0x13d)]['includes'](_0x3f4baa);}function _0x18e9(_0x4980e8,_0x2d7fa3){_0x4980e8=_0x4980e8-0x11b;const _0x7b8f8d=_0x7b8f();let _0x18e915=_0x7b8f8d[_0x4980e8];return _0x18e915;}export async function getPluginInfo(_0x57ffd7){const _0x315f94=_0x18e9,_0x300bda={'UMVcJ':function(_0x113e91,_0x2d08ad,_0x16faa5){return _0x113e91(_0x2d08ad,_0x16faa5);},'RKVDN':_0x315f94(0x122)},_0x2dcff0=await _0x300bda[_0x315f94(0x13c)](runClaudeCommand,[_0x300bda['RKVDN'],'list'],{'captureOutput':!![]});if(!_0x2dcff0['success']||!_0x2dcff0[_0x315f94(0x13d)])return null;if(!_0x2dcff0['output']['includes'](_0x57ffd7))return null;const _0x2a1b57={'name':_0x57ffd7},_0x5ce57b=_0x2dcff0['output'][_0x315f94(0x124)](new RegExp(_0x57ffd7+_0x315f94(0x129),'i'));_0x5ce57b&&(_0x2a1b57[_0x315f94(0x121)]=_0x5ce57b[0x1][_0x315f94(0x128)]());const _0x5db393=_0x2dcff0[_0x315f94(0x13d)][_0x315f94(0x124)](new RegExp(_0x57ffd7+_0x315f94(0x134),'i'));_0x5db393&&(_0x2a1b57[_0x315f94(0x131)]=_0x5db393[0x1]);const _0x4d387e=_0x2dcff0['output']['match'](new RegExp(_0x57ffd7+'[\x5cs\x5cS]*?(enabled|disabled)','i'));return _0x4d387e&&(_0x2a1b57[_0x315f94(0x11d)]=_0x4d387e[0x1]['toLowerCase']()===_0x315f94(0x11d)),_0x2a1b57;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const _0x1c2db5=_0x44d0;(function(_0x478bc4,_0x2bfaf9){const _0x606c8e=_0x44d0,_0x527679=_0x478bc4();while(!![]){try{const _0xe4e577=parseInt(_0x606c8e(0x1f6))/0x1*(-parseInt(_0x606c8e(0x1f3))/0x2)+-parseInt(_0x606c8e(0x1f4))/0x3*(parseInt(_0x606c8e(0x208))/0x4)+parseInt(_0x606c8e(0x1ff))/0x5+-parseInt(_0x606c8e(0x1f5))/0x6+-parseInt(_0x606c8e(0x200))/0x7+-parseInt(_0x606c8e(0x207))/0x8*(-parseInt(_0x606c8e(0x204))/0x9)+-parseInt(_0x606c8e(0x1f7))/0xa*(-parseInt(_0x606c8e(0x1fb))/0xb);if(_0xe4e577===_0x2bfaf9)break;else _0x527679['push'](_0x527679['shift']());}catch(_0x583003){_0x527679['push'](_0x527679['shift']());}}}(_0x128c,0xb2fdc));function _0x128c(){const _0x594df9=['YGSBZ','utf8','506qzfWZX','sCxmj','final','sha256','3051735KoFLiW','5235517BBLmMw','setAuthTag','update','subarray','113085xXuTUX','jYDiA','sPgPM','392cZdvND','4bpUufu','concat','344VjfGnn','3987417YjPNPl','1295376GSydhg','5701BmUrZf','604490ELCATy','ranger-auth-encryption'];_0x128c=function(){return _0x594df9;};return _0x128c();}function _0x44d0(_0x4a1d52,_0x152978){_0x4a1d52=_0x4a1d52-0x1f3;const _0x128c93=_0x128c();let _0x44d0ae=_0x128c93[_0x4a1d52];return _0x44d0ae;}import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';const ALGORITHM='aes-256-gcm',SALT=_0x1c2db5(0x1f8),KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;export function deriveKey(_0x1be77b){const _0x1b9b6d=_0x1c2db5,_0x198f5d={'LxLNs':_0x1b9b6d(0x1fe)};return pbkdf2Sync(_0x1be77b,SALT,0x186a0,KEY_LENGTH,_0x198f5d['LxLNs']);}export function encrypt(_0x1e650e,_0x5a8047){const _0x4e882e=_0x1c2db5,_0x1e913f={'sPgPM':function(_0x33ed79,_0x58448b,_0x5be92f,_0x1d4790){return _0x33ed79(_0x58448b,_0x5be92f,_0x1d4790);},'sCxmj':_0x4e882e(0x1fa)},_0x47c0af=deriveKey(_0x5a8047),_0x502812=randomBytes(IV_LENGTH),_0x1dc1b0=_0x1e913f[_0x4e882e(0x206)](createCipheriv,ALGORITHM,_0x47c0af,_0x502812),_0x4d1c49=Buffer[_0x4e882e(0x209)]([_0x1dc1b0[_0x4e882e(0x202)](_0x1e650e,_0x1e913f[_0x4e882e(0x1fc)]),_0x1dc1b0[_0x4e882e(0x1fd)]()]),_0x2acee4=_0x1dc1b0['getAuthTag']();return Buffer[_0x4e882e(0x209)]([_0x502812,_0x2acee4,_0x4d1c49]);}export function decrypt(_0xbcad8d,_0x3cabdd){const _0xa7c337=_0x1c2db5,_0x53eafb={'YGSBZ':function(_0x272bd8,_0x233ec9){return _0x272bd8+_0x233ec9;},'jYDiA':function(_0x5eb523,_0x2ec8cd){return _0x5eb523+_0x2ec8cd;},'qsVIX':function(_0x2e9dbf,_0x4dc23a,_0x2b1ca8,_0x9def6){return _0x2e9dbf(_0x4dc23a,_0x2b1ca8,_0x9def6);}},_0x272bf1=deriveKey(_0x3cabdd),_0x221254=_0xbcad8d['subarray'](0x0,IV_LENGTH),_0xcd53a=_0xbcad8d['subarray'](IV_LENGTH,_0x53eafb[_0xa7c337(0x1f9)](IV_LENGTH,TAG_LENGTH)),_0x399413=_0xbcad8d[_0xa7c337(0x203)](_0x53eafb[_0xa7c337(0x205)](IV_LENGTH,TAG_LENGTH)),_0x496127=_0x53eafb['qsVIX'](createDecipheriv,ALGORITHM,_0x272bf1,_0x221254);return _0x496127[_0xa7c337(0x201)](_0xcd53a),_0x496127['update'](_0x399413)+_0x496127[_0xa7c337(0x1fd)]('utf8');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x8c356=_0x47eb;function _0x47eb(_0x3534b0,_0x56c9fe){_0x3534b0=_0x3534b0-0x185;const _0x292a7e=_0x292a();let _0x47ebde=_0x292a7e[_0x3534b0];return _0x47ebde;}(function(_0x3d70c2,_0x18ab8d){const _0x35b72c=_0x47eb,_0x418a8b=_0x3d70c2();while(!![]){try{const _0x4522a1=parseInt(_0x35b72c(0x1b7))/0x1*(-parseInt(_0x35b72c(0x1a7))/0x2)+-parseInt(_0x35b72c(0x187))/0x3+-parseInt(_0x35b72c(0x198))/0x4*(-parseInt(_0x35b72c(0x1a2))/0x5)+-parseInt(_0x35b72c(0x188))/0x6*(-parseInt(_0x35b72c(0x1b2))/0x7)+parseInt(_0x35b72c(0x1b4))/0x8*(parseInt(_0x35b72c(0x1b5))/0x9)+parseInt(_0x35b72c(0x1b6))/0xa+-parseInt(_0x35b72c(0x19a))/0xb;if(_0x4522a1===_0x18ab8d)break;else _0x418a8b['push'](_0x418a8b['shift']());}catch(_0x1f69b6){_0x418a8b['push'](_0x418a8b['shift']());}}}(_0x292a,0x640ce));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set(['--token','-t','--secret','--api-key','--apikey',_0x8c356(0x1b0),_0x8c356(0x197),'--pass',_0x8c356(0x190),'--authorization','--header',_0x8c356(0x1ba),'--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(_0x249d30){const _0x2a4b00=_0x8c356;return TOKEN_PATTERNS['some'](_0x39b053=>_0x39b053[_0x2a4b00(0x191)](_0x249d30));}export function sanitizeArgs(_0x13f0ae){const _0x5974e2=_0x8c356,_0x3348e7={'TvNnw':function(_0x566a40,_0x582dc0){return _0x566a40!==_0x582dc0;},'ILbaA':'[REDACTED]'},_0x568e53=[];let _0x428400=![];for(let _0x56b92a=0x0;_0x56b92a<_0x13f0ae[_0x5974e2(0x1ab)];_0x56b92a++){const _0x1d3e9d=_0x13f0ae[_0x56b92a];if(_0x428400){_0x568e53['push'](_0x5974e2(0x185)),_0x428400=![];continue;}if(_0x1d3e9d['startsWith']('--')||_0x1d3e9d[_0x5974e2(0x186)]('-')){const _0x23da28=_0x1d3e9d['indexOf']('=');if(_0x3348e7[_0x5974e2(0x19f)](_0x23da28,-0x1)){const _0x56b955=_0x1d3e9d['slice'](0x0,_0x23da28)['toLowerCase']();if(SENSITIVE_FLAGS[_0x5974e2(0x1a5)](_0x56b955)){_0x568e53['push'](_0x1d3e9d[_0x5974e2(0x18f)](0x0,_0x23da28)+'=[REDACTED]');continue;}}else{const _0x3f437c=_0x1d3e9d['toLowerCase']();SENSITIVE_FLAGS['has'](_0x3f437c)&&(_0x428400=!![]);}_0x568e53[_0x5974e2(0x19b)](_0x1d3e9d);}else looksLikeToken(_0x1d3e9d)?_0x568e53[_0x5974e2(0x19b)](_0x3348e7[_0x5974e2(0x18d)]):_0x568e53[_0x5974e2(0x19b)](_0x1d3e9d);}return _0x568e53[_0x5974e2(0x199)]('\x20');}function _0x292a(){const _0x531abc=['285810fTgmUa','1vkWSHt','invalid_option_value','xTtVe','--cookie','[REDACTED]','startsWith','1697640VEqFPD','77016nLxrnO','no_token','isTTY','catch','stringify','ILbaA','includes','slice','--auth','test','UsTci','errorMessage','error','IncVQ','unknown_command','--password','359212WZhFXP','join','8631348HylcwU','push','POST','missing_option','Unknown\x20command','TvNnw','dSHxQ','env','25fMCHrF','/api/v1/mcp/desire-path-logs','runtime_error','has','featureId','54242xBLGJV','stdout','[desire-path]\x20Payload:\x20','split','length','syntax_error','ZNUft','application/json','sessionId','--key','QXITm','434CWcjVx','rawCommand','67416lXhBsf','549uYCZDo'];_0x292a=function(){return _0x531abc;};return _0x292a();}export async function logDesirePath(_0x5cf6b3){const _0x3424aa=_0x8c356,_0x4a42cb={'mJSbU':function(_0x3f6e27){return _0x3f6e27();},'TiMqr':function(_0x2acf4f){return _0x2acf4f();},'oZaOP':_0x3424aa(0x189),'MNlfU':_0x3424aa(0x1ae),'rEiJI':'Authorization','aYqyf':_0x3424aa(0x19c)};try{const _0x11e319=await getToken()[_0x3424aa(0x18b)](()=>null),_0x4f0d9f=_0x4a42cb['mJSbU'](getApiBaseUrl),_0xb74bb9=_0x4a42cb['TiMqr'](getCurrentVersion),_0x24264c=_0x11e319?'has_token':_0x4a42cb['oZaOP'],_0x57b1a7={..._0x5cf6b3['metadata'],'authStatus':_0x24264c,'isTty':process[_0x3424aa(0x1a8)][_0x3424aa(0x18a)]??![]},_0x4d1912={'Content-Type':_0x4a42cb['MNlfU']};_0x11e319&&(_0x4d1912[_0x4a42cb['rEiJI']]='Bearer\x20'+_0x11e319);const _0x2d4b48={'rawCommand':_0x5cf6b3[_0x3424aa(0x1b3)],'errorMessage':_0x5cf6b3[_0x3424aa(0x193)],'errorType':_0x5cf6b3['errorType'],'featureId':_0x5cf6b3[_0x3424aa(0x1a6)],'sessionId':_0x5cf6b3[_0x3424aa(0x1af)],'metadata':_0x57b1a7,'cliVersion':_0xb74bb9};process[_0x3424aa(0x1a1)]['DEBUG']&&(console['error']('[desire-path]\x20Sending\x20log\x20to\x20'+_0x4f0d9f+_0x3424aa(0x1a3)),console[_0x3424aa(0x194)](_0x3424aa(0x1a9)+JSON[_0x3424aa(0x18c)](_0x2d4b48,null,0x2))),await fetch(_0x4f0d9f+'/api/v1/mcp/desire-path-logs',{'method':_0x4a42cb['aYqyf'],'headers':_0x4d1912,'body':JSON['stringify'](_0x2d4b48)});}catch(_0x133c43){process['env']['DEBUG']&&console['error']('[desire-path]\x20Failed\x20to\x20send:\x20'+_0x133c43);}}export function getErrorType(_0x539c38,_0x3c7f0){const _0x2188f5=_0x8c356,_0x51f579={'shPEP':_0x2188f5(0x19e),'dSHxQ':'Missing\x20required\x20argument','ZNUft':'unknown','IkQlJ':'Invalid\x20values','UsTci':'unknown_argument','xTtVe':_0x2188f5(0x1ac),'IncVQ':'Not\x20enough\x20non-option\x20arguments','QXITm':'missing_required_argument'},_0x200cbb='2|3|0|5|7|4|1|6'[_0x2188f5(0x1aa)]('|');let _0x398f38=0x0;while(!![]){switch(_0x200cbb[_0x398f38++]){case'0':if(_0x539c38['includes'](_0x51f579['shPEP']))return _0x2188f5(0x196);continue;case'1':if(_0x539c38['includes'](_0x51f579[_0x2188f5(0x1a0)]))return _0x2188f5(0x19d);continue;case'2':if(_0x3c7f0)return _0x2188f5(0x1a4);continue;case'3':if(!_0x539c38)return _0x51f579[_0x2188f5(0x1ad)];continue;case'4':if(_0x539c38[_0x2188f5(0x18e)](_0x51f579['IkQlJ']))return _0x2188f5(0x1b8);continue;case'5':if(_0x539c38['includes']('Unknown\x20argument'))return _0x51f579[_0x2188f5(0x192)];continue;case'6':return _0x51f579[_0x2188f5(0x1b9)];case'7':if(_0x539c38[_0x2188f5(0x18e)](_0x51f579[_0x2188f5(0x195)]))return _0x51f579[_0x2188f5(0x1b1)];continue;}break;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x3a20e4=_0x5bdc;(function(_0x5ec19f,_0x4978bc){const _0x4c051d=_0x5bdc,_0x4ec6fc=_0x5ec19f();while(!![]){try{const _0x43e686=-parseInt(_0x4c051d(0x188))/0x1+-parseInt(_0x4c051d(0x1b1))/0x2+parseInt(_0x4c051d(0x17d))/0x3*(-parseInt(_0x4c051d(0x193))/0x4)+parseInt(_0x4c051d(0x169))/0x5+parseInt(_0x4c051d(0x19d))/0x6*(-parseInt(_0x4c051d(0x174))/0x7)+-parseInt(_0x4c051d(0x19a))/0x8*(parseInt(_0x4c051d(0x16b))/0x9)+parseInt(_0x4c051d(0x196))/0xa;if(_0x43e686===_0x4978bc)break;else _0x4ec6fc['push'](_0x4ec6fc['shift']());}catch(_0x20a98c){_0x4ec6fc['push'](_0x4ec6fc['shift']());}}}(_0x32e8,0x50602));import{exec}from'child_process';import _0x1c5610 from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL=_0x3a20e4(0x171),WORKOS_TOKEN_URL=_0x3a20e4(0x1a3);function _0x32e8(){const _0x43e1ce=['OyDGi','interval','Provisioning\x20CLI\x20token...','https://api.workos.com/user_management/authorize/device','CUFIz','Flhec','91zRhrGw','bQYxC','OWAIW','wUHll','memberships','write','now','RbfnQ','SzmEi','201XIvQZW','organizationId','lKwFV','xdg-open','urn:ietf:params:oauth:grant-type:device_code','stdout','length','prompt','nUBhj','filter','RHbul','113164WKeunP','ETMSZ','oriih','Wkdwo','list','Setting\x20up\x20your\x20organization...','startsWith','QAdUT','from','/cli-auth/token','access_token','18356nHbsnt','base64url','email','14033370SKzShk','name','application/json','application/x-www-form-urlencoded','652760jMCsaI','slow_down','Select\x20an\x20organization:','82986IySKWt','error','POST','NpqGZ','Authentication\x20failed','zflOA','https://api.workos.com/user_management/authenticate','Using\x20organization:\x20','log','Failed\x20to\x20fetch\x20memberships:\x20','CLI\x20Key','device_code','status','/organization/my-memberships','ADntW','open','RWyEf','text','isTTY','toString','656934ZnMPvC','BtjCl','QpMcp','json','Failed\x20to\x20request\x20device\x20code:\x20','fdCJj','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20','1313765PIAGqV','apiKey','45HvKKWp','/api-keys','apiKeys'];_0x32e8=function(){return _0x43e1ce;};return _0x32e8();}export async function requestDeviceCode(_0x5d5b3b){const _0x3a764d=_0x3a20e4,_0x469509=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x3a764d(0x19f),'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0x5d5b3b})});if(!_0x469509['ok']){const _0x27b468=await _0x469509['text']();throw new Error(_0x3a764d(0x166)+_0x469509['status']+'\x20'+_0x27b468);}return _0x469509[_0x3a764d(0x1b4)]();}export async function pollForTokens(_0x4f3e18,_0xa99e55,_0xf6b7e2,_0x5482ba){const _0x25099c=_0x3a20e4,_0xb90672={'Wkdwo':function(_0x354450,_0x35844a){return _0x354450+_0x35844a;},'oriih':function(_0x595b7c,_0x486db4){return _0x595b7c*_0x486db4;},'Flhec':function(_0x3c57ed,_0x56f8c2){return _0x3c57ed(_0x56f8c2);},'wUHll':'POST','RHbul':function(_0x5f3f33,_0x372621){return _0x5f3f33===_0x372621;},'RrJVh':'authorization_pending','RbfnQ':'Device\x20authorization\x20timed\x20out'},_0x1ee78f=_0xb90672[_0x25099c(0x18b)](Date['now'](),_0x5482ba*0x3e8);let _0x359c19=_0xb90672[_0x25099c(0x18a)](_0xf6b7e2,0x3e8);while(Date[_0x25099c(0x17a)]()<_0x1ee78f){await _0xb90672[_0x25099c(0x173)](sleep,_0x359c19);const _0x65aafa=await fetch(WORKOS_TOKEN_URL,{'method':_0xb90672[_0x25099c(0x177)],'headers':{'Content-Type':_0x25099c(0x199)},'body':new URLSearchParams({'client_id':_0x4f3e18,'device_code':_0xa99e55,'grant_type':_0x25099c(0x181)})});if(_0x65aafa['ok'])return _0x65aafa['json']();const _0x19a1bd=await _0x65aafa[_0x25099c(0x1b4)]();if(_0xb90672[_0x25099c(0x187)](_0x19a1bd[_0x25099c(0x19e)],_0xb90672['RrJVh']))continue;if(_0xb90672['RHbul'](_0x19a1bd[_0x25099c(0x19e)],_0x25099c(0x19b))){_0x359c19+=0x3e8;continue;}throw new Error(_0x19a1bd['error_description']||_0x19a1bd['error']||_0x25099c(0x1a1));}throw new Error(_0xb90672[_0x25099c(0x17b)]);}async function fetchUserProfile(_0x256da8){const _0x1f438e=_0x3a20e4,_0x2ccd18={'SzmEi':function(_0x1e2a8e){return _0x1e2a8e();},'bGsOQ':'GET'},_0xdeac4f=_0x2ccd18[_0x1f438e(0x17c)](getApiBaseUrl);try{const _0x399856=await fetch(_0xdeac4f+'/organization/me',{'method':_0x2ccd18['bGsOQ'],'headers':{'workos-token':_0x256da8}});if(_0x399856['ok'])return _0x399856['json']();}catch{}return null;}function buildKeyName(_0x45c224,_0x2bcd47){const _0xa9132a=_0x3a20e4,_0x5ded0b={'QpMcp':function(_0x5bdd74,_0x44d527){return _0x5bdd74+_0x44d527;}},_0x5f2507=_0x2bcd47[_0xa9132a(0x186)](_0x1ad8e9=>_0x1ad8e9[_0xa9132a(0x197)]===_0x45c224||_0x1ad8e9['name'][_0xa9132a(0x18e)](_0x45c224+'\x20('));if(_0x5f2507['length']===0x0)return _0x45c224;return _0x45c224+'\x20('+_0x5ded0b[_0xa9132a(0x1b3)](_0x5f2507['length'],0x1)+')';}export async function provisionApiKey(_0x5acb53){const _0x54e056=_0x3a20e4,_0x206b56={'nUBhj':function(_0x2ed44e,_0xbf355d,_0x4640db){return _0x2ed44e(_0xbf355d,_0x4640db);},'EBKMP':'POST','JUYpP':'mcp:write'},_0xa16aef=getApiBaseUrl(),_0x3afdf7={'Content-Type':'application/json','workos-token':_0x5acb53},_0x4ee426=await fetchUserProfile(_0x5acb53),_0x5d3a96=_0x4ee426?.['firstName']||_0x4ee426?.[_0x54e056(0x195)]?.['split']('@')[0x0],_0x17737a=_0x5d3a96?_0x5d3a96+'\x27s\x20CLI\x20Key':_0x54e056(0x1a7);let _0x5333b8=[];try{const _0x242c5f=await _0x206b56[_0x54e056(0x185)](fetch,_0xa16aef+_0x54e056(0x16c),{'method':'GET','headers':_0x3afdf7});if(_0x242c5f['ok']){const _0x30fbf4=await _0x242c5f['json']();_0x5333b8=_0x30fbf4[_0x54e056(0x16d)];}}catch{}const _0x1463ce=_0x206b56[_0x54e056(0x185)](buildKeyName,_0x17737a,_0x5333b8),_0x55b507=await fetch(_0xa16aef+_0x54e056(0x16c),{'method':_0x206b56['EBKMP'],'headers':_0x3afdf7,'body':JSON['stringify']({'name':_0x1463ce,'scope':_0x206b56['JUYpP']})});if(!_0x55b507['ok']){const _0xcdb608=await _0x55b507['text']();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x55b507[_0x54e056(0x1a9)]+'\x20'+_0xcdb608);}const _0x4f7fd2=await _0x55b507['json']();return _0x4f7fd2[_0x54e056(0x16a)]['token'];}export function openBrowser(_0x5a47f7){const _0x54d6ed=_0x3a20e4,_0x1435aa={'ETMSZ':_0x54d6ed(0x1ac),'NFcgS':function(_0x39d933,_0x1021cc){return _0x39d933===_0x1021cc;},'lWgkD':'start'},_0x371cd9=process['platform'],_0x1770d4=_0x371cd9==='darwin'?_0x1435aa[_0x54d6ed(0x189)]:_0x1435aa['NFcgS'](_0x371cd9,'win32')?_0x1435aa['lWgkD']:_0x54d6ed(0x180);exec(_0x1770d4+'\x20'+JSON['stringify'](_0x5a47f7));}function decodeJwtPayload(_0x13f1b1){const _0x57b962=_0x3a20e4,_0x566f3b={'DryMD':function(_0x3b2714,_0x51c8c0){return _0x3b2714!==_0x51c8c0;},'OyDGi':_0x57b962(0x194),'EyNSh':'utf-8'},_0xe8fb95=_0x13f1b1['split']('.');if(_0x566f3b['DryMD'](_0xe8fb95[_0x57b962(0x183)],0x3))throw new Error('Invalid\x20JWT\x20format');const _0x3c59af=Buffer[_0x57b962(0x190)](_0xe8fb95[0x1],_0x566f3b[_0x57b962(0x16e)])[_0x57b962(0x1b0)](_0x566f3b['EyNSh']);return JSON['parse'](_0x3c59af);}function _0x5bdc(_0x3510b7,_0x2d9bd8){_0x3510b7=_0x3510b7-0x166;const _0x32e889=_0x32e8();let _0x5bdcb2=_0x32e889[_0x3510b7];return _0x5bdcb2;}async function selfServeSignup(_0x46b96c){const _0x222048=_0x3a20e4,_0xc25b42={'RWyEf':function(_0x583635){return _0x583635();},'EtLYv':function(_0x503e99,_0x1959e8,_0x2cbe2a){return _0x503e99(_0x1959e8,_0x2cbe2a);},'CUFIz':_0x222048(0x19f),'jiABK':_0x222048(0x198)},_0x150e63=_0xc25b42[_0x222048(0x1ad)](getApiBaseUrl),_0x55a7c0=await _0xc25b42['EtLYv'](fetch,_0x150e63+'/organization/self-serve-signup',{'method':_0xc25b42[_0x222048(0x172)],'headers':{'Content-Type':_0xc25b42['jiABK'],'workos-token':_0x46b96c}});if(!_0x55a7c0['ok']){const _0x1b7742=await _0x55a7c0['text']();throw new Error('Failed\x20to\x20create\x20organization:\x20'+_0x55a7c0['status']+'\x20'+_0x1b7742);}return _0x55a7c0[_0x222048(0x1b4)]();}async function fetchMyMemberships(_0x5988ad){const _0x3e1c9d=_0x3a20e4,_0x4ff708={'ADntW':function(_0x56143f){return _0x56143f();}},_0x219ea8=_0x4ff708[_0x3e1c9d(0x1ab)](getApiBaseUrl),_0x45d4d0=await fetch(_0x219ea8+_0x3e1c9d(0x1aa),{'method':'GET','headers':{'workos-token':_0x5988ad}});if(!_0x45d4d0['ok']){const _0x12489e=await _0x45d4d0[_0x3e1c9d(0x1ae)]();throw new Error(_0x3e1c9d(0x1a6)+_0x45d4d0['status']+'\x20'+_0x12489e);}const _0x366778=await _0x45d4d0[_0x3e1c9d(0x1b4)]();return _0x366778[_0x3e1c9d(0x178)];}async function refreshTokenWithOrg(_0x1fb21f,_0x125f55,_0x3f9a29){const _0x28ea50=_0x3a20e4,_0x4ca6af={'zMYQh':function(_0x53ab5b,_0x37b7f1,_0x3a088e){return _0x53ab5b(_0x37b7f1,_0x3a088e);},'QAdUT':'application/x-www-form-urlencoded'},_0x554dd8=await _0x4ca6af['zMYQh'](fetch,WORKOS_TOKEN_URL,{'method':_0x28ea50(0x19f),'headers':{'Content-Type':_0x4ca6af[_0x28ea50(0x18f)]},'body':new URLSearchParams({'client_id':_0x1fb21f,'grant_type':'refresh_token','refresh_token':_0x125f55,'organization_id':_0x3f9a29})});if(!_0x554dd8['ok']){const _0x34edde=await _0x554dd8['text']();throw new Error(_0x28ea50(0x168)+_0x554dd8[_0x28ea50(0x1a9)]+'\x20'+_0x34edde);}return _0x554dd8['json']();}async function provisionCliToken(_0x4e8b21){const _0x264c6c=_0x3a20e4,_0x2b0f0d={'OWAIW':function(_0x2d7d33,_0x26ab33,_0x5eff4b){return _0x2d7d33(_0x26ab33,_0x5eff4b);}},_0x5ec490=getApiBaseUrl(),_0x52f6c2=await _0x2b0f0d[_0x264c6c(0x176)](fetch,_0x5ec490+_0x264c6c(0x191),{'method':'POST','headers':{'Content-Type':'application/json','workos-token':_0x4e8b21}});if(!_0x52f6c2['ok']){const _0x2afac2=await _0x52f6c2['text']();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x52f6c2[_0x264c6c(0x1a9)]+'\x20'+_0x2afac2);}return _0x52f6c2[_0x264c6c(0x1b4)]();}export async function runDeviceAuthFlow(){const _0x38d3b9=_0x3a20e4,_0x4a5ce1={'bQYxC':function(_0x421d18,_0x4e7ed3){return _0x421d18(_0x4e7ed3);},'zflOA':'\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','SoLph':function(_0x3a3a5b,_0x28b2e8,_0x412888,_0x54bf46,_0xd069e){return _0x3a3a5b(_0x28b2e8,_0x412888,_0x54bf46,_0xd069e);},'mMAhl':_0x38d3b9(0x18d),'BtjCl':function(_0x466f8d,_0x589a94){return _0x466f8d===_0x589a94;},'lKwFV':function(_0x4c8f76,_0x7bd70a){return _0x4c8f76+_0x7bd70a;},'PNRcp':_0x38d3b9(0x18c),'NpqGZ':_0x38d3b9(0x19c),'bAAJG':_0x38d3b9(0x170),'fdCJj':function(_0x3ba1b5,_0x3b6178){return _0x3ba1b5(_0x3b6178);}},_0x2c63bc=getCurrentEnvironment(),_0xa8ca2d=ENVIRONMENT_CONFIGS[_0x2c63bc]['workosClientId'],_0x5af7db=await _0x4a5ce1[_0x38d3b9(0x175)](requestDeviceCode,_0xa8ca2d);console['log']('\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...'),console[_0x38d3b9(0x1a5)](_0x4a5ce1[_0x38d3b9(0x1a2)]),_0x4a5ce1['bQYxC'](openBrowser,_0x5af7db['verification_uri_complete']),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x5af7db['verification_uri_complete']),console['log']('Code:\x20'+_0x5af7db['user_code']+'\x0a'),process['stdout']['write']('Waiting\x20for\x20authentication...');let _0x93fa2f=await _0x4a5ce1['SoLph'](pollForTokens,_0xa8ca2d,_0x5af7db[_0x38d3b9(0x1a8)],_0x5af7db[_0x38d3b9(0x16f)],_0x5af7db['expires_in']);console['log']('\x20✓');const _0x186407=_0x4a5ce1['bQYxC'](decodeJwtPayload,_0x93fa2f['access_token']);if(!_0x186407['org_id']){const _0x52c4e0=await fetchMyMemberships(_0x93fa2f[_0x38d3b9(0x192)]);let _0x45b6c3;if(_0x52c4e0[_0x38d3b9(0x183)]===0x0){process[_0x38d3b9(0x182)][_0x38d3b9(0x179)](_0x4a5ce1['mMAhl']);const _0xc7fe88=await selfServeSignup(_0x93fa2f[_0x38d3b9(0x192)]);_0x45b6c3=_0xc7fe88[_0x38d3b9(0x17e)],console['log']('\x20✓');}else{if(_0x4a5ce1[_0x38d3b9(0x1b2)](_0x52c4e0[_0x38d3b9(0x183)],0x1))_0x45b6c3=_0x52c4e0[0x0]['organizationId'],console['log'](_0x38d3b9(0x1a4)+_0x52c4e0[0x0][_0x38d3b9(0x197)]);else{const _0x26bcf3=process['stdin']['isTTY']&&process['stdout'][_0x38d3b9(0x1af)];if(!_0x26bcf3)throw new Error(_0x4a5ce1[_0x38d3b9(0x17f)]('Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.'));const {selected:_0x42c743}=await _0x1c5610[_0x38d3b9(0x184)]([{'type':_0x4a5ce1['PNRcp'],'name':'selected','message':_0x4a5ce1[_0x38d3b9(0x1a0)],'choices':_0x52c4e0['map'](_0x217114=>({'name':_0x217114[_0x38d3b9(0x197)],'value':_0x217114['organizationId']}))}]);_0x45b6c3=_0x42c743;}}_0x93fa2f=await refreshTokenWithOrg(_0xa8ca2d,_0x93fa2f['refresh_token'],_0x45b6c3);}process['stdout'][_0x38d3b9(0x179)](_0x4a5ce1['bAAJG']);const _0x746bed=await _0x4a5ce1[_0x38d3b9(0x167)](provisionCliToken,_0x93fa2f['access_token']);return console['log']('\x20✓'),await storeToken(_0x746bed['token']),_0x93fa2f['refresh_token']&&await storeRefreshToken(_0x93fa2f['refresh_token']),_0x746bed['token'];}function sleep(_0x1883c1){return new Promise(_0x1038ed=>setTimeout(_0x1038ed,_0x1883c1));}
|
|
1
|
+
const _0x5973c6=_0x54d8;(function(_0x588849,_0x9b2bf9){const _0x16eef9=_0x54d8,_0x644b69=_0x588849();while(!![]){try{const _0x2f8deb=parseInt(_0x16eef9(0x175))/0x1+-parseInt(_0x16eef9(0x194))/0x2*(-parseInt(_0x16eef9(0x16e))/0x3)+parseInt(_0x16eef9(0x189))/0x4+parseInt(_0x16eef9(0x183))/0x5+parseInt(_0x16eef9(0x174))/0x6+parseInt(_0x16eef9(0x1b6))/0x7+-parseInt(_0x16eef9(0x1ac))/0x8;if(_0x2f8deb===_0x9b2bf9)break;else _0x644b69['push'](_0x644b69['shift']());}catch(_0x590427){_0x644b69['push'](_0x644b69['shift']());}}}(_0x416c,0x20f5f));function _0x54d8(_0x184c02,_0x5e93e6){_0x184c02=_0x184c02-0x169;const _0x416c1=_0x416c();let _0x54d817=_0x416c1[_0x184c02];return _0x54d817;}import{exec}from'child_process';import _0x4b814c from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL=_0x5973c6(0x177),WORKOS_TOKEN_URL='https://api.workos.com/user_management/authenticate';export async function requestDeviceCode(_0xe2cd4d){const _0x55eb70=_0x5973c6,_0x4e02ef=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x55eb70(0x196),'headers':{'Content-Type':_0x55eb70(0x1b8)},'body':new URLSearchParams({'client_id':_0xe2cd4d})});if(!_0x4e02ef['ok']){const _0x435caf=await _0x4e02ef[_0x55eb70(0x1a1)]();throw new Error(_0x55eb70(0x184)+_0x4e02ef[_0x55eb70(0x198)]+'\x20'+_0x435caf);}return _0x4e02ef[_0x55eb70(0x1be)]();}export async function pollForTokens(_0x3636d5,_0x55dde6,_0x2b007b,_0xb9f6d){const _0xaaf9ce=_0x5973c6,_0x56a2fe={'ySoFv':function(_0x4208e4,_0x1e8180){return _0x4208e4*_0x1e8180;},'ndeyO':function(_0x224720,_0x192771,_0x21682c){return _0x224720(_0x192771,_0x21682c);},'efHVW':_0xaaf9ce(0x196),'GDzoF':_0xaaf9ce(0x1b8),'XTIGv':function(_0x368fed,_0x5b5039){return _0x368fed===_0x5b5039;},'JkbUt':'authorization_pending','iOaEg':function(_0x1311da,_0x3b7802){return _0x1311da===_0x3b7802;},'IBpxy':'slow_down','Ktevu':_0xaaf9ce(0x1b4)},_0x42c2c4=Date[_0xaaf9ce(0x1a2)]()+_0x56a2fe[_0xaaf9ce(0x19f)](_0xb9f6d,0x3e8);let _0x39f9d6=_0x2b007b*0x3e8;while(Date['now']()<_0x42c2c4){await sleep(_0x39f9d6);const _0x467936=await _0x56a2fe[_0xaaf9ce(0x181)](fetch,WORKOS_TOKEN_URL,{'method':_0x56a2fe['efHVW'],'headers':{'Content-Type':_0x56a2fe[_0xaaf9ce(0x190)]},'body':new URLSearchParams({'client_id':_0x3636d5,'device_code':_0x55dde6,'grant_type':_0xaaf9ce(0x178)})});if(_0x467936['ok'])return _0x467936[_0xaaf9ce(0x1be)]();const _0xae87f4=await _0x467936['json']();if(_0x56a2fe['XTIGv'](_0xae87f4[_0xaaf9ce(0x18d)],_0x56a2fe['JkbUt']))continue;if(_0x56a2fe[_0xaaf9ce(0x1bc)](_0xae87f4[_0xaaf9ce(0x18d)],_0x56a2fe[_0xaaf9ce(0x1bd)])){_0x39f9d6+=0x3e8;continue;}throw new Error(_0xae87f4['error_description']||_0xae87f4[_0xaaf9ce(0x18d)]||'Authentication\x20failed');}throw new Error(_0x56a2fe[_0xaaf9ce(0x195)]);}async function fetchUserProfile(_0x4840ad){const _0x2a3bd5=_0x5973c6,_0x181714={'OmagS':function(_0x598bcf,_0x5992b8,_0x8eae4f){return _0x598bcf(_0x5992b8,_0x8eae4f);},'hqtmP':'GET'},_0x5a8aed=getApiBaseUrl();try{const _0x4795d5=await _0x181714['OmagS'](fetch,_0x5a8aed+_0x2a3bd5(0x1ba),{'method':_0x181714['hqtmP'],'headers':{'workos-token':_0x4840ad}});if(_0x4795d5['ok'])return _0x4795d5['json']();}catch{}return null;}function buildKeyName(_0x1649f3,_0x5c7e07){const _0x28b909=_0x5973c6,_0x303379={'kGXle':function(_0x33440f,_0x1cb950){return _0x33440f===_0x1cb950;},'mVWmZ':function(_0x5eac51,_0x133f33){return _0x5eac51+_0x133f33;}},_0x27c335=_0x5c7e07['filter'](_0x5af07d=>_0x5af07d[_0x28b909(0x1aa)]===_0x1649f3||_0x5af07d[_0x28b909(0x1aa)]['startsWith'](_0x1649f3+'\x20('));if(_0x303379[_0x28b909(0x187)](_0x27c335[_0x28b909(0x1b7)],0x0))return _0x1649f3;return _0x1649f3+'\x20('+_0x303379['mVWmZ'](_0x27c335[_0x28b909(0x1b7)],0x1)+')';}export async function provisionApiKey(_0xd7d67c){const _0x24a72d=_0x5973c6,_0x35b39e={'UYept':function(_0x2457b6){return _0x2457b6();},'ZZRaa':'application/json','xPkui':function(_0x13c3ed,_0x5c7fd3,_0x2af2d4){return _0x13c3ed(_0x5c7fd3,_0x2af2d4);},'oecEB':_0x24a72d(0x186)},_0x531b68=_0x35b39e[_0x24a72d(0x193)](getApiBaseUrl),_0x2655c7={'Content-Type':_0x35b39e[_0x24a72d(0x17f)],'workos-token':_0xd7d67c},_0x5428e9=await fetchUserProfile(_0xd7d67c),_0xd404ac=_0x5428e9?.['firstName']||_0x5428e9?.[_0x24a72d(0x1b3)]?.[_0x24a72d(0x1a8)]('@')[0x0],_0x1dc476=_0xd404ac?_0xd404ac+_0x24a72d(0x1ad):'CLI\x20Key';let _0x354ea5=[];try{const _0xe94590=await fetch(_0x531b68+'/api-keys',{'method':_0x24a72d(0x192),'headers':_0x2655c7});if(_0xe94590['ok']){const _0x24bd47=await _0xe94590['json']();_0x354ea5=_0x24bd47[_0x24a72d(0x191)];}}catch{}const _0x1b25e9=_0x35b39e[_0x24a72d(0x1a0)](buildKeyName,_0x1dc476,_0x354ea5),_0x33ef2a=await fetch(_0x531b68+_0x24a72d(0x1bf),{'method':'POST','headers':_0x2655c7,'body':JSON['stringify']({'name':_0x1b25e9,'scope':_0x35b39e[_0x24a72d(0x1ab)]})});if(!_0x33ef2a['ok']){const _0x115ebc=await _0x33ef2a[_0x24a72d(0x1a1)]();throw new Error(_0x24a72d(0x17d)+_0x33ef2a['status']+'\x20'+_0x115ebc);}const _0x1caa0b=await _0x33ef2a['json']();return _0x1caa0b['apiKey']['token'];}function _0x416c(){const _0x1519d7=['email','Device\x20authorization\x20timed\x20out','Failed\x20to\x20provision\x20CLI\x20token:\x20','1445787prHKLc','length','application/x-www-form-urlencoded','hNhYw','/organization/me','expires_in','iOaEg','IBpxy','json','/api-keys','from','organizationId','KTsxl','stdout','isTTY','3579kLZFxT','win32','utf-8','user_code','Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','GGovh','1446924YwFdCi','157790roJPYA','Invalid\x20JWT\x20format','https://api.workos.com/user_management/authorize/device','urn:ietf:params:oauth:grant-type:device_code','platform','Qsizt','Failed\x20to\x20create\x20organization:\x20','write','Failed\x20to\x20provision\x20API\x20key:\x20','nNpOX','ZZRaa','UQLRL','ndeyO','device_code','770655sPMjKn','Failed\x20to\x20request\x20device\x20code:\x20','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20','mcp:write','kGXle','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20','440572wqDxCc','dbnUk','CKJhy','access_token','error','toString','selected','GDzoF','apiKeys','GET','UYept','4wLoaOK','Ktevu','POST','workosClientId','status','refresh_token','application/json','CMvGm','map','verification_uri_complete','xdg-open','ySoFv','xPkui','text','now','IKwli','parse','hYuGh','pAVtm','Setting\x20up\x20your\x20organization...','split','log','name','oecEB','5897104NqppzT','\x27s\x20CLI\x20Key','fhMqw','token','ehcmD','QLveC','stdin'];_0x416c=function(){return _0x1519d7;};return _0x416c();}export function openBrowser(_0x2f0c16){const _0x12d91c=_0x5973c6,_0x2f1e1c={'tqtoC':'open','CKJhy':function(_0x504bb8,_0x4b3077){return _0x504bb8===_0x4b3077;},'IKwli':_0x12d91c(0x16f),'ptmvO':_0x12d91c(0x19e)},_0x15a801=process[_0x12d91c(0x179)],_0x58ae1a=_0x15a801==='darwin'?_0x2f1e1c['tqtoC']:_0x2f1e1c[_0x12d91c(0x18b)](_0x15a801,_0x2f1e1c[_0x12d91c(0x1a3)])?'start':_0x2f1e1c['ptmvO'];exec(_0x58ae1a+'\x20'+JSON['stringify'](_0x2f0c16));}function decodeJwtPayload(_0x156620){const _0x215bdd=_0x5973c6,_0x26a261={'hNhYw':_0x215bdd(0x176)},_0x12d318=_0x156620['split']('.');if(_0x12d318['length']!==0x3)throw new Error(_0x26a261[_0x215bdd(0x1b9)]);const _0x3f3959=Buffer[_0x215bdd(0x169)](_0x12d318[0x1],'base64url')[_0x215bdd(0x18e)](_0x215bdd(0x170));return JSON[_0x215bdd(0x1a4)](_0x3f3959);}async function selfServeSignup(_0x47268a){const _0x5c0b70=_0x5973c6,_0x2e78fe={'qQnAg':function(_0x124984,_0x22b9c2,_0x11df53){return _0x124984(_0x22b9c2,_0x11df53);},'CMvGm':'POST','sAKIb':'application/json'},_0x3a3d28=getApiBaseUrl(),_0x4805b1=await _0x2e78fe['qQnAg'](fetch,_0x3a3d28+'/organization/self-serve-signup',{'method':_0x2e78fe[_0x5c0b70(0x19b)],'headers':{'Content-Type':_0x2e78fe['sAKIb'],'workos-token':_0x47268a}});if(!_0x4805b1['ok']){const _0x54f364=await _0x4805b1[_0x5c0b70(0x1a1)]();throw new Error(_0x5c0b70(0x17b)+_0x4805b1['status']+'\x20'+_0x54f364);}return _0x4805b1['json']();}async function fetchMyMemberships(_0x5bcfc8){const _0x459d1b=_0x5973c6,_0x46e2ea={'Mfnew':function(_0x4eee8b){return _0x4eee8b();}},_0x1fec2b=_0x46e2ea['Mfnew'](getApiBaseUrl),_0x41ec63=await fetch(_0x1fec2b+'/organization/my-memberships',{'method':'GET','headers':{'workos-token':_0x5bcfc8}});if(!_0x41ec63['ok']){const _0x4d3283=await _0x41ec63[_0x459d1b(0x1a1)]();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0x41ec63[_0x459d1b(0x198)]+'\x20'+_0x4d3283);}const _0x5a8d18=await _0x41ec63['json']();return _0x5a8d18['memberships'];}async function refreshTokenWithOrg(_0xfe228b,_0x16795d,_0x3bd905){const _0x38accd=_0x5973c6,_0x302e91={'UQLRL':function(_0x331ecc,_0x532c94,_0xb9d75d){return _0x331ecc(_0x532c94,_0xb9d75d);},'Rqjlf':'POST','pAVtm':_0x38accd(0x1b8),'dbnUk':'refresh_token'},_0x4705d4=await _0x302e91[_0x38accd(0x180)](fetch,WORKOS_TOKEN_URL,{'method':_0x302e91['Rqjlf'],'headers':{'Content-Type':_0x302e91[_0x38accd(0x1a6)]},'body':new URLSearchParams({'client_id':_0xfe228b,'grant_type':_0x302e91[_0x38accd(0x18a)],'refresh_token':_0x16795d,'organization_id':_0x3bd905})});if(!_0x4705d4['ok']){const _0x40fc95=await _0x4705d4['text']();throw new Error(_0x38accd(0x185)+_0x4705d4[_0x38accd(0x198)]+'\x20'+_0x40fc95);}return _0x4705d4[_0x38accd(0x1be)]();}async function provisionCliToken(_0x4c50d6){const _0x2ac5f6=_0x5973c6,_0x1154a4={'QLveC':function(_0x489efc,_0x342d29,_0x108009){return _0x489efc(_0x342d29,_0x108009);},'ehcmD':_0x2ac5f6(0x19a)},_0x811dac=getApiBaseUrl(),_0x345c6a=await _0x1154a4[_0x2ac5f6(0x1b1)](fetch,_0x811dac+'/cli-auth/token',{'method':_0x2ac5f6(0x196),'headers':{'Content-Type':_0x1154a4[_0x2ac5f6(0x1b0)],'workos-token':_0x4c50d6}});if(!_0x345c6a['ok']){const _0x570193=await _0x345c6a['text']();throw new Error(_0x2ac5f6(0x1b5)+_0x345c6a['status']+'\x20'+_0x570193);}return _0x345c6a['json']();}export async function runDeviceAuthFlow(){const _0x26b109=_0x5973c6,_0x30dcfb={'GGovh':function(_0x78168d){return _0x78168d();},'nNpOX':'\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','bFCdr':'Waiting\x20for\x20authentication...','hYuGh':function(_0x2f8a8d,_0x807091){return _0x2f8a8d(_0x807091);},'BmFtU':function(_0x1074a1,_0x467ec6){return _0x1074a1===_0x467ec6;},'Qsizt':_0x26b109(0x1a7),'dmnlt':function(_0x291848,_0x2ddfb6){return _0x291848(_0x2ddfb6);},'KTsxl':function(_0x33a7ac,_0x1c85be){return _0x33a7ac+_0x1c85be;},'QETtc':'Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','fhMqw':_0x26b109(0x172),'QyjuI':'list','uvKib':'Select\x20an\x20organization:'},_0xeae432=_0x30dcfb[_0x26b109(0x173)](getCurrentEnvironment),_0x227e92=ENVIRONMENT_CONFIGS[_0xeae432][_0x26b109(0x197)],_0x3bb2df=await requestDeviceCode(_0x227e92);console['log'](_0x30dcfb[_0x26b109(0x17e)]),console[_0x26b109(0x1a9)]('\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a'),openBrowser(_0x3bb2df[_0x26b109(0x19d)]),console['log'](_0x26b109(0x188)+_0x3bb2df['verification_uri_complete']),console['log']('Code:\x20'+_0x3bb2df[_0x26b109(0x171)]+'\x0a'),process[_0x26b109(0x16c)][_0x26b109(0x17c)](_0x30dcfb['bFCdr']);let _0x5641c7=await pollForTokens(_0x227e92,_0x3bb2df[_0x26b109(0x182)],_0x3bb2df['interval'],_0x3bb2df[_0x26b109(0x1bb)]);console['log']('\x20✓');const _0xedbf7f=decodeJwtPayload(_0x5641c7['access_token']);if(!_0xedbf7f['org_id']){const _0x341331=await _0x30dcfb[_0x26b109(0x1a5)](fetchMyMemberships,_0x5641c7['access_token']);let _0x456d84;if(_0x30dcfb['BmFtU'](_0x341331[_0x26b109(0x1b7)],0x0)){process[_0x26b109(0x16c)]['write'](_0x30dcfb[_0x26b109(0x17a)]);const _0x2218b6=await _0x30dcfb['dmnlt'](selfServeSignup,_0x5641c7['access_token']);_0x456d84=_0x2218b6[_0x26b109(0x16a)],console[_0x26b109(0x1a9)]('\x20✓');}else{if(_0x30dcfb['BmFtU'](_0x341331['length'],0x1))_0x456d84=_0x341331[0x0]['organizationId'],console['log']('Using\x20organization:\x20'+_0x341331[0x0][_0x26b109(0x1aa)]);else{const _0x530d3b=process[_0x26b109(0x1b2)][_0x26b109(0x16d)]&&process['stdout'][_0x26b109(0x16d)];if(!_0x530d3b)throw new Error(_0x30dcfb[_0x26b109(0x16b)](_0x30dcfb['QETtc'],_0x30dcfb[_0x26b109(0x1ae)]));const {selected:_0x1cb89c}=await _0x4b814c['prompt']([{'type':_0x30dcfb['QyjuI'],'name':_0x26b109(0x18f),'message':_0x30dcfb['uvKib'],'choices':_0x341331[_0x26b109(0x19c)](_0x398413=>({'name':_0x398413['name'],'value':_0x398413['organizationId']}))}]);_0x456d84=_0x1cb89c;}}_0x5641c7=await refreshTokenWithOrg(_0x227e92,_0x5641c7[_0x26b109(0x199)],_0x456d84);}process[_0x26b109(0x16c)][_0x26b109(0x17c)]('Provisioning\x20CLI\x20token...');const _0x217c4f=await _0x30dcfb['hYuGh'](provisionCliToken,_0x5641c7[_0x26b109(0x18c)]);return console[_0x26b109(0x1a9)]('\x20✓'),await storeToken(_0x217c4f['token']),_0x5641c7['refresh_token']&&await storeRefreshToken(_0x5641c7['refresh_token']),_0x217c4f[_0x26b109(0x1af)];}function sleep(_0x8a22fe){return new Promise(_0x5586ce=>setTimeout(_0x5586ce,_0x8a22fe));}
|