@ranger-testing/ranger-cli 3.0.1-alpha.46ed70b-30 → 3.0.1-alpha.4fcf7f7-33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/build/cli.js +1 -1
  2. package/build/commands/addEnv.js +1 -1
  3. package/build/commands/authEncrypt.js +1 -1
  4. package/build/commands/clean.js +1 -1
  5. package/build/commands/config.js +1 -1
  6. package/build/commands/deleteProfile.js +1 -1
  7. package/build/commands/env.js +1 -1
  8. package/build/commands/feature.js +1 -1
  9. package/build/commands/hook.js +1 -1
  10. package/build/commands/hooks/autoPrompt.js +1 -1
  11. package/build/commands/hooks/disable.js +1 -1
  12. package/build/commands/hooks/enable.js +1 -1
  13. package/build/commands/hooks/exitPlanMode.js +1 -1
  14. package/build/commands/hooks/index.js +1 -1
  15. package/build/commands/hooks/output.js +1 -1
  16. package/build/commands/hooks/planReminder.js +1 -1
  17. package/build/commands/hooks/planStart.js +1 -1
  18. package/build/commands/hooks/postEdit.js +1 -1
  19. package/build/commands/hooks/preCompact.js +1 -1
  20. package/build/commands/hooks/sessionEnd.js +1 -1
  21. package/build/commands/hooks/sessionStart.js +1 -1
  22. package/build/commands/hooks/stopHook.js +1 -1
  23. package/build/commands/index.js +1 -1
  24. package/build/commands/login.js +1 -1
  25. package/build/commands/mcpBootstrap.js +1 -1
  26. package/build/commands/migrateProfile.js +1 -1
  27. package/build/commands/setup/claude.js +1 -1
  28. package/build/commands/setup/opencode.js +1 -1
  29. package/build/commands/setupCi.js +1 -1
  30. package/build/commands/skillup.js +1 -1
  31. package/build/commands/start.js +1 -1
  32. package/build/commands/status.js +1 -1
  33. package/build/commands/update.js +1 -1
  34. package/build/commands/updateEnv.js +1 -1
  35. package/build/commands/useEnv.js +1 -1
  36. package/build/commands/utils/activeProfile.js +1 -1
  37. package/build/commands/utils/agentEnv.js +1 -1
  38. package/build/commands/utils/browserSessionsApi.js +1 -1
  39. package/build/commands/utils/claudeConfig.js +1 -1
  40. package/build/commands/utils/claudeOverrideSettings.js +1 -1
  41. package/build/commands/utils/claudePlugin.js +1 -1
  42. package/build/commands/utils/cloudProfile.js +1 -1
  43. package/build/commands/utils/cloudProfileSession.js +1 -1
  44. package/build/commands/utils/crypto.js +1 -1
  45. package/build/commands/utils/desirePathLog.js +1 -1
  46. package/build/commands/utils/deviceAuth.js +1 -1
  47. package/build/commands/utils/environment.js +1 -1
  48. package/build/commands/utils/featureApi.js +1 -1
  49. package/build/commands/utils/fixWebmDuration.js +1 -1
  50. package/build/commands/utils/gitTracked.js +1 -1
  51. package/build/commands/utils/keychain.js +1 -1
  52. package/build/commands/utils/legacyWarning.js +1 -1
  53. package/build/commands/utils/localAgentInstallationsApi.js +1 -1
  54. package/build/commands/utils/matchAuthEnvironment.js +1 -1
  55. package/build/commands/utils/mcpImageBase64.js +1 -1
  56. package/build/commands/utils/model.js +1 -1
  57. package/build/commands/utils/novaActCli.js +1 -1
  58. package/build/commands/utils/opencodeConfig.js +1 -1
  59. package/build/commands/utils/organizationEnvApi.js +1 -0
  60. package/build/commands/utils/playwrightCli.js +1 -1
  61. package/build/commands/utils/profileMessages.js +1 -1
  62. package/build/commands/utils/profileSetupBanner.js +1 -1
  63. package/build/commands/utils/projectsConfig.js +1 -1
  64. package/build/commands/utils/rangerConfig.js +1 -1
  65. package/build/commands/utils/rangerRoot.js +1 -1
  66. package/build/commands/utils/rangerwrightCli.js +1 -1
  67. package/build/commands/utils/resolveProfileContext.js +1 -1
  68. package/build/commands/utils/resolveProfileUrl.js +1 -1
  69. package/build/commands/utils/retry.js +1 -1
  70. package/build/commands/utils/sessionCache.js +1 -1
  71. package/build/commands/utils/settings.js +1 -1
  72. package/build/commands/utils/skillContent.js +1 -1
  73. package/build/commands/utils/skills.js +1 -1
  74. package/build/commands/utils/stitchWebmFiles.js +1 -1
  75. package/build/commands/utils/telemetry.js +1 -1
  76. package/build/commands/utils/tokenRefresh.js +1 -1
  77. package/build/commands/utils/traceSnapshotMapper.js +1 -1
  78. package/build/commands/utils/userApi.js +1 -1
  79. package/build/commands/utils/version.js +1 -1
  80. package/build/commands/verifyFeature.js +1 -1
  81. package/build/commands/verifyFeatureCli.js +1 -1
  82. package/build/commands/verifyFeatureNovaCli.js +1 -1
  83. package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
  84. package/package.json +1 -1
@@ -1 +1 @@
1
- const _0x4bf33e=_0x3abd;(function(_0x2dcc64,_0x2b6e80){const _0x16c5c1=_0x3abd,_0x33bf9d=_0x2dcc64();while(!![]){try{const _0x5e09a0=parseInt(_0x16c5c1(0x131))/0x1*(parseInt(_0x16c5c1(0x12b))/0x2)+-parseInt(_0x16c5c1(0x151))/0x3+-parseInt(_0x16c5c1(0x194))/0x4+parseInt(_0x16c5c1(0x132))/0x5*(-parseInt(_0x16c5c1(0x18f))/0x6)+-parseInt(_0x16c5c1(0x14d))/0x7*(-parseInt(_0x16c5c1(0x12a))/0x8)+parseInt(_0x16c5c1(0x18c))/0x9+parseInt(_0x16c5c1(0x145))/0xa;if(_0x5e09a0===_0x2b6e80)break;else _0x33bf9d['push'](_0x33bf9d['shift']());}catch(_0x391f67){_0x33bf9d['push'](_0x33bf9d['shift']());}}}(_0x298d,0xe50c0));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x447b4f from'inquirer';import{chromium}from'playwright';import{getApiBaseUrl}from'./environment.js';import{getToken}from'./keychain.js';import{getRangerHomeDir}from'./rangerRoot.js';function _0x298d(){const _0x5d56f8=['env','DONqn','pmdxT','domains','push','log','gfpKY','sdqfV','storageStatePath','\x22,\x20cached\x20locally','24uOIuaH','4KrCtDf','XQvnf','test_output','goto','zlgDp','\x22.\x0a','623289bhAJFj','5EfMMWU','wpSoQ','not_configured','auth_config','trim','\x22\x20failed\x20validation\x20—\x20re-login\x20needed...','keys','AWgZq','AQtKa','Cloud\x20profile\x20\x22','environments','application/json','url','\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20','RANGER_TEST_USERNAME','wngTK','baseUrl','Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20(','qeLJB','21591710zJYcBW','BwfHy','\x20\x20Created\x20cloud\x20profile\x20\x22','profiles','name','force','\x20\x20No\x20live\x20session\x20for\x20\x22','OuKgJ','1050189tVczwV','code','\x22,\x20attempting\x20login...','RANGER_TEST_PASSWORD','4430472FmOevC','environment_key','dLhjf','kRqCm','some','utf-8','parse','\x22;\x20proceeding\x20with\x20loginInstructions.','PQAfq','\x20\x20Login\x20successful.\x20Session\x20cached.','UfZHs','organizationId','error','HTJFc','environmentKey','\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','json','detail','MfauC','message','hIevj','\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20','POST','stringify','iUEgU','status','headers','IZumr','length','confirm','fxMue','sessionCheckPath','\x22\x20not\x20found.','bojEy','\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','username','kvYrd','loginInstructions','DELETE','catch','close','HpYoS','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','kQmiD','clientIp','pPnxt','XRbuI','/api/v1/profiles','join','settings','isArray','newPage','/api/v1/profiles/','/api/v1/profiles/auth-config','klaTC','\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22','No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','userAgent','5189373XGqyDH','password','string','953298lIhvEz','cookies','save','prompt','effectiveBaseUrl','7434176nYOBle'];_0x298d=function(){return _0x5d56f8;};return _0x298d();}import{addProfileSetupBanner}from'./profileSetupBanner.js';import{duplicateCookiesForDomains,getSessionCachePath,getStorageStatePath,isCachedSessionLive,isInteractive,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0xafa483=_0x3abd,_0xe0dec2={'AWgZq':function(_0x2b7891){return _0x2b7891();},'ASRfz':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x4cf27b=await _0xe0dec2[_0xafa483(0x139)](getToken);if(!_0x4cf27b)throw new Error(_0xe0dec2['ASRfz']);return _0x4cf27b;}async function apiRequest(_0x181db7,_0x2ca083={}){const _0x60491b=_0x3abd,_0x4f52ce={'haBxv':function(_0x194268){return _0x194268();},'hFJTP':function(_0x11388d,_0x51b368,_0x24b3ab){return _0x11388d(_0x51b368,_0x24b3ab);},'gryZb':function(_0x2fd6cb,_0x233850){return _0x2fd6cb===_0x233850;}},_0x2f4411=await _0x4f52ce['haBxv'](requireToken),_0x4a8e31=_0x4f52ce['haBxv'](getApiBaseUrl),_0x1bb0bd=await _0x4f52ce['hFJTP'](fetch,''+_0x4a8e31+_0x181db7,{..._0x2ca083,'headers':{'Authorization':'Bearer\x20'+_0x2f4411,'Content-Type':_0x60491b(0x13d),..._0x2ca083[_0x60491b(0x16b)]??{}}});if(!_0x1bb0bd['ok']){let _0x122e0a='',_0xee7fc1;try{const _0x3401a6=await _0x1bb0bd['json']();_0x122e0a=(_0x4f52ce['gryZb'](typeof _0x3401a6['error'],_0x60491b(0x18e))?_0x3401a6[_0x60491b(0x15d)]:undefined)??JSON[_0x60491b(0x168)](_0x3401a6);if(typeof _0x3401a6['code']==='string')_0xee7fc1=_0x3401a6[_0x60491b(0x14e)];}catch{_0x122e0a=_0x1bb0bd['statusText'];}throw new ApiError('API\x20request\x20'+_0x181db7+'\x20failed\x20('+_0x1bb0bd[_0x60491b(0x16a)]+'):\x20'+_0x122e0a,_0x1bb0bd['status'],_0x122e0a,_0xee7fc1);}if(_0x1bb0bd['status']===0xcc)return undefined;return _0x1bb0bd[_0x60491b(0x161)]();}export class ApiError extends Error{[_0x4bf33e(0x16a)];[_0x4bf33e(0x162)];['code'];constructor(_0xc7d625,_0x1ab4e2,_0x27b39b,_0x3366d9){const _0x4093fc=_0x4bf33e;super(_0xc7d625),this['status']=_0x1ab4e2,this['detail']=_0x27b39b,this[_0x4093fc(0x14e)]=_0x3366d9,this['name']='ApiError';}}export async function fetchCloudProfile(_0x540753){const _0x5a9340=_0x4bf33e,_0x337c08={'gfpKY':function(_0x44bc91,_0x234b45){return _0x44bc91(_0x234b45);},'klaTC':function(_0x105be7,_0x4636a1){return _0x105be7 instanceof _0x4636a1;}};try{return await apiRequest(_0x5a9340(0x185)+_0x337c08[_0x5a9340(0x126)](encodeURIComponent,_0x540753));}catch(_0x34fd2d){if(_0x337c08[_0x5a9340(0x187)](_0x34fd2d,ApiError)&&_0x34fd2d['status']===0x194)return null;throw _0x34fd2d;}}export async function listCloudProfiles(){const _0x10080f=_0x4bf33e,_0x22380c={'IZumr':function(_0x44c76e,_0x5dae8a){return _0x44c76e(_0x5dae8a);}},_0x543595=await _0x22380c[_0x10080f(0x16c)](apiRequest,_0x10080f(0x180));return _0x543595[_0x10080f(0x148)];}export async function deleteCloudProfile(_0x329f29){const _0x3f2cfe=_0x4bf33e,_0x4af381={'DONqn':function(_0x195d98,_0x1f1726){return _0x195d98(_0x1f1726);},'sdfpE':_0x3f2cfe(0x177),'DXUZi':function(_0x478bb0,_0x5a8149){return _0x478bb0 instanceof _0x5a8149;}};try{await apiRequest(_0x3f2cfe(0x185)+_0x4af381[_0x3f2cfe(0x121)](encodeURIComponent,_0x329f29),{'method':_0x4af381['sdfpE']});}catch(_0x24b1d8){if(_0x4af381['DXUZi'](_0x24b1d8,ApiError)&&_0x24b1d8[_0x3f2cfe(0x16a)]===0x194)throw new Error(_0x3f2cfe(0x13b)+_0x329f29+_0x3f2cfe(0x171));throw _0x24b1d8;}}export async function createCloudProfile(_0x15e631,_0x2b7ce1,_0x4a8bcd={}){const _0x52e6e5=_0x4bf33e,_0x245449={'REZwj':function(_0x5a6451,_0x46e58f){return _0x5a6451>_0x46e58f;},'rEuPo':_0x52e6e5(0x180),'NWzCA':_0x52e6e5(0x167)},_0x43aefe={'name':_0x15e631};if(_0x2b7ce1)_0x43aefe[_0x52e6e5(0x152)]=_0x2b7ce1;_0x4a8bcd['settings']&&_0x245449['REZwj'](Object['keys'](_0x4a8bcd['settings'])[_0x52e6e5(0x16d)],0x0)&&(_0x43aefe[_0x52e6e5(0x182)]=_0x4a8bcd['settings']);if(_0x4a8bcd['username'])_0x43aefe['username']=_0x4a8bcd[_0x52e6e5(0x174)];if(_0x4a8bcd['password'])_0x43aefe['password']=_0x4a8bcd['password'];return await apiRequest(_0x245449['rEuPo'],{'method':_0x245449['NWzCA'],'body':JSON[_0x52e6e5(0x168)](_0x43aefe)});}export async function uploadCloudProfileSession(_0x214e07,_0x58885e){const _0x2243c9=_0x4bf33e,_0x41f381={'AQtKa':function(_0x4605c6,_0x4241f6,_0x372476){return _0x4605c6(_0x4241f6,_0x372476);},'YRUpo':_0x2243c9(0x167)};return await _0x41f381[_0x2243c9(0x13a)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x214e07)+'/session',{'method':_0x41f381['YRUpo'],'body':JSON['stringify']({'session_state':_0x58885e})});}export async function saveCloudProfileCredentials(_0x2364f0,_0x17dd4a,_0x1fe928){const _0x193e74=_0x4bf33e,_0xbc703e={'Tcaov':function(_0x583147,_0xd7da8c){return _0x583147(_0xd7da8c);}};await apiRequest(_0x193e74(0x185)+_0xbc703e['Tcaov'](encodeURIComponent,_0x2364f0),{'method':'PUT','body':JSON['stringify']({'username':_0x17dd4a,'password':_0x1fe928})});}export async function fetchAuthConfig(){const _0x560151=_0x4bf33e,_0x1f37df={'kRqCm':function(_0x1a5cd1,_0xddbda0){return _0x1a5cd1!==_0xddbda0;}};try{const _0x4b8e60=await apiRequest(_0x560151(0x186));return _0x4b8e60[_0x560151(0x135)];}catch(_0x238066){return _0x238066 instanceof ApiError&&_0x1f37df[_0x560151(0x154)](_0x238066['status'],0x194)&&console['error']('\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20'+_0x238066['message']),null;}}export function pickAdHocEnvKey(_0x34f3de){const _0xec656f=_0x4bf33e,_0x3da118={'hIevj':function(_0x51b689,_0x189198){return _0x51b689===_0x189198;},'nQZXq':function(_0x306142,_0x2c1181){return _0x306142===_0x2c1181;},'QTPQS':function(_0x27a7c1,_0x1278ff){return _0x27a7c1+_0x1278ff;}};if(!_0x34f3de)return null;if(_0x34f3de['defaultEnvironmentKey'])return _0x34f3de['defaultEnvironmentKey'];const _0x3c726a=Object[_0xec656f(0x138)](_0x34f3de[_0xec656f(0x13c)]??{});if(_0x3da118[_0xec656f(0x165)](_0x3c726a[_0xec656f(0x16d)],0x1))return _0x3c726a[0x0];if(_0x3da118['nQZXq'](_0x3c726a['length'],0x0))return null;throw new Error(_0x3da118['QTPQS'](_0xec656f(0x143)+_0x3c726a[_0xec656f(0x181)](',\x20')+').\x20','Create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`\x20so\x20Ranger\x20can\x20pick\x20the\x20right\x20one.'));}export async function resolveAdHocProfile(_0x5d96f4=process[_0x4bf33e(0x195)]){const _0x5aa7fe=_0x4bf33e,_0x15e174={'ObNLA':function(_0x59bf32,_0x5f4d05){return _0x59bf32(_0x5f4d05);},'QLQny':function(_0x312dff){return _0x312dff();},'dLhjf':function(_0x530776,_0x41af0c,_0x2c666f,_0x55d5cb){return _0x530776(_0x41af0c,_0x2c666f,_0x55d5cb);},'iOwWf':function(_0x33582e,_0x22ca23){return _0x33582e??_0x22ca23;}},_0x1b55e8=_0x5d96f4['RANGER_TEST_USERNAME'];if(!_0x1b55e8)return null;const _0xa6243f=await _0x15e174['ObNLA'](fetchCloudProfile,_0x1b55e8);if(_0xa6243f)return{'name':_0xa6243f[_0x5aa7fe(0x149)],'profile':_0xa6243f};const _0x2740b7=await _0x15e174['QLQny'](fetchAuthConfig),_0x22055e=pickAdHocEnvKey(_0x2740b7),_0x2defb3=_0x5d96f4[_0x5aa7fe(0x150)],_0x449f3d=await _0x15e174[_0x5aa7fe(0x153)](createCloudProfile,_0x1b55e8,_0x15e174['iOwWf'](_0x22055e,undefined),{'username':_0x1b55e8,'password':_0x2defb3});return console['log'](_0x5aa7fe(0x147)+_0x449f3d[_0x5aa7fe(0x149)]+'\x22\x20for\x20'+_0x1b55e8),{'name':_0x449f3d['name'],'profile':_0x449f3d};}function _0x3abd(_0x4ca5ca,_0x337430){_0x4ca5ca=_0x4ca5ca-0x121;const _0x298d45=_0x298d();let _0x3abd0f=_0x298d45[_0x4ca5ca];return _0x3abd0f;}export async function writeSessionToLocalCache(_0x4e5130,_0x38a968,_0x576626,_0x150f9a,_0x276e04,_0x5e547e,_0x248a7b){const _0x42fea6=_0x4bf33e,_0x48d02f={'sdqfV':function(_0x2db9fa,_0x52901d,_0x5812c6){return _0x2db9fa(_0x52901d,_0x5812c6);},'wngTK':function(_0x44c227,_0x2bb251,_0x2bf3e3){return _0x44c227(_0x2bb251,_0x2bf3e3);},'ewWVg':'auth','qeLJB':function(_0x3b97dc,_0x50372b,_0x291a02){return _0x3b97dc(_0x50372b,_0x291a02);},'edfPE':function(_0x46e3dc,_0x271f2c){return _0x46e3dc(_0x271f2c);}},_0x607b44=sessionCacheHash({'orgId':_0x38a968,'profileName':_0x4e5130,'effectiveBaseUrl':_0x576626,'setupHeaders':_0x150f9a,'invalidateOn':_0x248a7b?.['invalidateOn'],'userAgent':_0x248a7b?.[_0x42fea6(0x18b)],'clientIp':_0x248a7b?.[_0x42fea6(0x17d)]}),_0x1c12b3=_0x48d02f[_0x42fea6(0x127)](getSessionCachePath,_0x607b44,_0x4e5130),_0x763ab7=_0x48d02f['wngTK'](join,getRangerHomeDir(),_0x48d02f['ewWVg']);!existsSync(_0x763ab7)&&await _0x48d02f[_0x42fea6(0x141)](mkdir,_0x763ab7,{'recursive':!![]});const _0x4d2ca7={..._0x276e04};_0x5e547e&&_0x5e547e[_0x42fea6(0x16d)]>0x0&&Array[_0x42fea6(0x183)](_0x4d2ca7[_0x42fea6(0x190)])&&(_0x4d2ca7[_0x42fea6(0x190)]=duplicateCookiesForDomains(_0x4d2ca7[_0x42fea6(0x190)],_0x5e547e));const _0x41ce04={'cached_at':new Date()['toISOString'](),'session_state':_0x4d2ca7};await _0x48d02f[_0x42fea6(0x144)](writeFile,_0x1c12b3,JSON[_0x42fea6(0x168)](_0x41ce04,null,0x2));const _0x1ba419=_0x48d02f['edfPE'](getStorageStatePath,_0x1c12b3);return await _0x48d02f[_0x42fea6(0x141)](writeFile,_0x1ba419,JSON[_0x42fea6(0x168)](_0x4d2ca7,null,0x2)),_0x1ba419;}export async function checkLocalCache(_0x477aff,_0x13b404,_0x54442e,_0x32fcef,_0x189f39){const _0x18e29f=_0x4bf33e,_0x2d1a4f={'bojEy':function(_0x3d8b53,_0x15c27b){return _0x3d8b53(_0x15c27b);},'UfZHs':function(_0xc03467,_0x2221bb,_0x351885){return _0xc03467(_0x2221bb,_0x351885);}},_0x27ce3f=sessionCacheHash({'orgId':_0x13b404,'profileName':_0x477aff,'effectiveBaseUrl':_0x54442e,'setupHeaders':_0x32fcef,'invalidateOn':_0x189f39?.['invalidateOn'],'userAgent':_0x189f39?.[_0x18e29f(0x18b)],'clientIp':_0x189f39?.[_0x18e29f(0x17d)]}),_0xb178a=getSessionCachePath(_0x27ce3f,_0x477aff),_0x27f39c=_0x2d1a4f['bojEy'](getStorageStatePath,_0xb178a);if(!existsSync(_0xb178a)||!_0x2d1a4f[_0x18e29f(0x172)](existsSync,_0x27f39c))return null;try{const _0x49e37b=await _0x2d1a4f[_0x18e29f(0x15b)](readFile,_0xb178a,_0x18e29f(0x156));return JSON[_0x18e29f(0x157)](_0x49e37b),{'storageStatePath':_0x27f39c};}catch{return null;}}function launchRealBrowser(){return chromium['launch']({'headless':!![]});}function emitSessionValidationHint(_0x24df36,_0x205027){const _0x212f9a=_0x4bf33e,_0x2ad342={'KNrWs':function(_0x243370,_0x576fc5){return _0x243370===_0x576fc5;},'XQvnf':function(_0x40c02f,_0x2015bb){return _0x40c02f+_0x2015bb;}};if(!_0x205027||!_0x205027['domains']?.['length'])return;let _0x4e65f9;try{_0x4e65f9=new URL(_0x24df36);}catch{return;}const _0x5aeb2e=[];for(const _0x1b52ad of _0x205027[_0x212f9a(0x123)]){try{_0x5aeb2e[_0x212f9a(0x124)]({'raw':_0x1b52ad,'url':new URL(_0x1b52ad)});}catch{}}if(_0x2ad342['KNrWs'](_0x5aeb2e[_0x212f9a(0x16d)],0x0))return;if(_0x5aeb2e[_0x212f9a(0x155)](_0x48011c=>_0x48011c[_0x212f9a(0x13e)]['origin']===_0x4e65f9['origin']))return;const _0x23291d=_0x5aeb2e['map'](_0x2e4edb=>'\x22'+_0x2e4edb['raw']+'\x22')['join'](',\x20');console['log'](_0x2ad342[_0x212f9a(0x12c)](_0x2ad342[_0x212f9a(0x12c)](_0x212f9a(0x166)+_0x23291d+';\x20','you\x27re\x20now\x20at\x20\x22'+_0x24df36+_0x212f9a(0x13f)),'If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.'));}export async function serverSideLogin(_0x560ad4,_0x46351c){const _0x4fac01=_0x4bf33e,_0x4d3483={'HpYoS':function(_0x2fbe2b,_0x56310b,_0x357508){return _0x2fbe2b(_0x56310b,_0x357508);},'bGDva':function(_0x17b0b2,_0x1736fe){return _0x17b0b2(_0x1736fe);},'fxMue':'POST','pmdxT':function(_0x12bf10,_0x194f95){return _0x12bf10===_0x194f95;},'MfauC':'not_configured'},_0x266c3c=process[_0x4fac01(0x195)]['RANGER_TEST_USERNAME'],_0x4bd31d=process['env'][_0x4fac01(0x150)],_0x5c1e81={};if(_0x266c3c)_0x5c1e81[_0x4fac01(0x174)]=_0x266c3c;if(_0x4bd31d)_0x5c1e81[_0x4fac01(0x18d)]=_0x4bd31d;if(_0x46351c?.[_0x4fac01(0x14a)])_0x5c1e81['force']=!![];try{return await _0x4d3483[_0x4fac01(0x17a)](apiRequest,'/api/v1/profiles/'+_0x4d3483['bGDva'](encodeURIComponent,_0x560ad4)+'/login',{'method':_0x4d3483[_0x4fac01(0x16f)],'body':JSON['stringify'](_0x5c1e81)});}catch(_0x36af22){if(_0x36af22 instanceof ApiError&&_0x36af22[_0x4fac01(0x16a)]===0x190&&_0x4d3483[_0x4fac01(0x122)](_0x36af22[_0x4fac01(0x14e)],_0x4fac01(0x134)))return{'status':_0x4d3483[_0x4fac01(0x163)],'error':_0x36af22['detail']};throw _0x36af22;}}export async function manualBrowserLogin(_0x9d74a2,_0x1efac0){const _0x2a5bc8=_0x4bf33e,_0x3d134a={'DAAEk':function(_0x18199a,_0x38de05){return _0x18199a(_0x38de05);},'vnrjI':function(_0x7ea0fd,_0x55fbd6,_0x24d2c5){return _0x7ea0fd(_0x55fbd6,_0x24d2c5);},'mHrEF':'\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20','kQmiD':'or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.','XRbuI':function(_0x5d38cc,_0x39a62b){return _0x5d38cc(_0x39a62b);},'RTNfg':function(_0x30acbd,_0x533b1c,_0x51ed20){return _0x30acbd(_0x533b1c,_0x51ed20);},'Eihjn':function(_0x57aeb3,_0x2e8089){return _0x57aeb3(_0x2e8089);},'eDmFm':_0x2a5bc8(0x167)};if(!isInteractive())throw new Error(_0x2a5bc8(0x189)+_0x9d74a2[_0x2a5bc8(0x149)]+_0x2a5bc8(0x130)+_0x3d134a['mHrEF']+_0x3d134a[_0x2a5bc8(0x17c)]);const _0x132849=_0x1efac0&&_0x1efac0['domains'][_0x2a5bc8(0x16d)]>0x0?_0x1efac0[_0x2a5bc8(0x123)][0x0]:'about:blank';console[_0x2a5bc8(0x125)](_0x2a5bc8(0x160)),console['log']('\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a'),await new Promise(_0xec0b5b=>setTimeout(_0xec0b5b,0x7d0));const _0x525097=await chromium['launch']({'headless':![]});let _0x2fbd40=null;try{const _0x48e88c={'ignoreHTTPSErrors':!![]};_0x1efac0?.['setupHeaders']&&(_0x48e88c['extraHTTPHeaders']=_0x1efac0['setupHeaders']);const _0x426d29=await _0x525097['newContext'](_0x48e88c);await _0x3d134a[_0x2a5bc8(0x17f)](addProfileSetupBanner,_0x426d29);const _0x2a6a83=await _0x426d29[_0x2a5bc8(0x184)]();await _0x2a6a83[_0x2a5bc8(0x12e)](_0x132849);let _0x1934d1=![];await new Promise(_0x29fbc4=>{const _0x574532={'iUEgU':function(_0x1679dc,_0x3daaba){return _0x3d134a['DAAEk'](_0x1679dc,_0x3daaba);},'RUdaX':function(_0x1d5fa4){return _0x1d5fa4();}},_0x6f3f8a=_0x3d134a['vnrjI'](setTimeout,()=>{_0x1934d1=!![],console['error']('Browser\x20login\x20timed\x20out\x20after\x20'+MANUAL_LOGIN_TIMEOUT_MS/0xea60+'\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.'),_0x29fbc4();},MANUAL_LOGIN_TIMEOUT_MS);_0x2a6a83['on']('close',async()=>{const _0x131ab5=_0x3abd;_0x574532[_0x131ab5(0x169)](clearTimeout,_0x6f3f8a);try{const _0x39de7a=await _0x426d29['storageState']();_0x2fbd40=_0x39de7a;}catch{}_0x574532['RUdaX'](_0x29fbc4);});});if(_0x1934d1&&!_0x2fbd40)throw new Error('Browser\x20login\x20timed\x20out\x20before\x20completion.');}finally{await _0x525097[_0x2a5bc8(0x179)]()[_0x2a5bc8(0x178)](()=>{});}if(!_0x2fbd40)throw new Error('Browser\x20closed\x20before\x20authentication\x20was\x20saved.');return await _0x3d134a['RTNfg'](apiRequest,'/api/v1/profiles/'+_0x3d134a['Eihjn'](encodeURIComponent,_0x9d74a2[_0x2a5bc8(0x149)])+'/session',{'method':_0x3d134a['eDmFm'],'body':JSON['stringify']({'session_state':_0x2fbd40,'updated_by':'cli:manual-login'})}),{'sessionState':_0x2fbd40};}export async function promptSaveCredentials(_0x5a9839){const _0x37e9f8=_0x4bf33e,_0x46afbd={'ukBYJ':function(_0x5c9781){return _0x5c9781();},'WAqJf':_0x37e9f8(0x16e),'jGmjg':function(_0x4a45ae,_0x3856e0){return _0x4a45ae(_0x3856e0);},'pPnxt':'PUT','nlfIt':'\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.'},_0x190be7=process[_0x37e9f8(0x195)][_0x37e9f8(0x140)],_0xb0d686=process[_0x37e9f8(0x195)][_0x37e9f8(0x150)];if(!_0x190be7||!_0xb0d686)return;if(!_0x46afbd['ukBYJ'](isInteractive))return;const {save:_0x10c940}=await _0x447b4f[_0x37e9f8(0x192)]([{'type':_0x46afbd['WAqJf'],'name':_0x37e9f8(0x191),'message':_0x37e9f8(0x17b),'default':![]}]);if(!_0x10c940)return;await apiRequest(_0x37e9f8(0x185)+_0x46afbd['jGmjg'](encodeURIComponent,_0x5a9839),{'method':_0x46afbd[_0x37e9f8(0x17e)],'body':JSON[_0x37e9f8(0x168)]({'username':_0x190be7,'password':_0xb0d686})}),console['log'](_0x46afbd['nlfIt']);}export async function resolveCloudProfileSession(_0x3408a3,_0x5778c7={}){const _0x10c638=_0x4bf33e,_0x46616b={'OuKgJ':function(_0x473a99,_0x37015e){return _0x473a99===_0x37015e;},'HCRqy':_0x10c638(0x18e),'BwfHy':function(_0x4bce00,_0x12544e){return _0x4bce00(_0x12544e);},'wpSoQ':function(_0x19ee87,_0x388baa,_0x1370b9,_0x1a13b3,_0xb8e15c,_0x4b9221){return _0x19ee87(_0x388baa,_0x1370b9,_0x1a13b3,_0xb8e15c,_0x4b9221);},'IEMHj':function(_0x1f8220,_0x3513eb,_0x426ea0){return _0x1f8220(_0x3513eb,_0x426ea0);},'BWkwc':function(_0x486f4a,_0x7fc272,_0x3d60e2,_0x24f9cc,_0x203a08,_0x41bc7f,_0x1de322,_0x139556){return _0x486f4a(_0x7fc272,_0x3d60e2,_0x24f9cc,_0x203a08,_0x41bc7f,_0x1de322,_0x139556);},'HjExZ':function(_0x46cfe8,_0x3659a4,_0x2a3de0,_0x2ef1d1,_0x395612){return _0x46cfe8(_0x3659a4,_0x2a3de0,_0x2ef1d1,_0x395612);},'PQAfq':function(_0x8de48f,_0x408bf3){return _0x8de48f||_0x408bf3;},'HTJFc':'not_configured','zlgDp':'\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','UmrGW':function(_0x4a9266,_0x5b5f97){return _0x4a9266===_0x5b5f97;},'kvYrd':'success','OKVRD':_0x10c638(0x173)},_0x839e51=_0x3408a3[_0x10c638(0x182)]??{},_0xe10295=await fetchAuthConfig(),_0x2ae89a=_0xe10295?resolveAuthEnvironmentLocally(_0xe10295,_0x3408a3[_0x10c638(0x15f)]):null,_0x193008=_0x46616b[_0x10c638(0x14c)](typeof _0x2ae89a?.['loginInstructions'],_0x46616b['HCRqy'])&&_0x2ae89a[_0x10c638(0x176)]['trim']()?_0x2ae89a['loginInstructions']:undefined,_0x5a8bf8=typeof _0x839e51[_0x10c638(0x176)]===_0x10c638(0x18e)&&_0x839e51['loginInstructions'][_0x10c638(0x136)]()?_0x839e51[_0x10c638(0x176)]:undefined,_0x2eaed5=_0x5a8bf8||!_0x193008?_0x839e51:{..._0x839e51,'loginInstructions':_0x193008},_0x11a939=_0x46616b[_0x10c638(0x146)](Boolean,_0x2eaed5[_0x10c638(0x176)]?.[_0x10c638(0x136)]()),_0x39ca88=_0x2ae89a?.[_0x10c638(0x123)],_0x59f58c=_0x839e51['setupHeaders'],_0x1754c0=_0x59f58c??_0x2ae89a?.['setupHeaders'],_0x169115=_0x5778c7[_0x10c638(0x193)]??_0x839e51[_0x10c638(0x142)]??(_0x39ca88&&_0x39ca88['length']>0x0?_0x39ca88[0x0]:''),_0x3f4340={'invalidateOn':_0x2ae89a?.['invalidateOn'],'userAgent':_0x2ae89a?.['browserOptions']?.['userAgent']??_0x839e51['userAgent']},_0x10806f=await _0x46616b[_0x10c638(0x133)](checkLocalCache,_0x3408a3[_0x10c638(0x149)],_0x3408a3['organizationId'],_0x169115,_0x1754c0,_0x3f4340);if(_0x10806f){if(_0x169115){const _0x5b7760=await isCachedSessionLive(_0x10806f[_0x10c638(0x128)],_0x169115,{'sessionCheckPath':_0x2ae89a?.['sessionCheckPath'],'setupHeaders':_0x1754c0},{'launchBrowser':launchRealBrowser});if(_0x5b7760)return console[_0x10c638(0x125)](_0x10c638(0x18a)+_0x3408a3[_0x10c638(0x149)]+'\x22'),{'authPath':_0x10806f['storageStatePath'],'settings':_0x2eaed5,'resolvedEnv':_0x2ae89a};console[_0x10c638(0x125)]('\x20\x20Cached\x20session\x20for\x20\x22'+_0x3408a3[_0x10c638(0x149)]+'\x22\x20failed\x20validation\x20—\x20refreshing...'),_0x46616b['IEMHj'](emitSessionValidationHint,_0x169115,_0x2ae89a);}else return{'authPath':_0x10806f['storageStatePath'],'settings':_0x2eaed5,'resolvedEnv':_0x2ae89a};}if(_0x3408a3['sessionState']){const _0x279ee5=await _0x46616b['BWkwc'](writeSessionToLocalCache,_0x3408a3[_0x10c638(0x149)],_0x3408a3['organizationId'],_0x169115,_0x1754c0,_0x3408a3['sessionState'],_0x39ca88,_0x3f4340);if(_0x169115){const _0x8bc162=await _0x46616b['HjExZ'](isCachedSessionLive,_0x279ee5,_0x169115,{'sessionCheckPath':_0x2ae89a?.[_0x10c638(0x170)],'setupHeaders':_0x1754c0},{'launchBrowser':launchRealBrowser});if(_0x8bc162)return console[_0x10c638(0x125)](_0x10c638(0x188)+_0x3408a3['name']+_0x10c638(0x129)),{'authPath':_0x279ee5,'settings':_0x2eaed5,'resolvedEnv':_0x2ae89a};console['log']('\x20\x20Cloud\x20session\x20for\x20\x22'+_0x3408a3['name']+_0x10c638(0x137)),emitSessionValidationHint(_0x169115,_0x2ae89a);}else return{'authPath':_0x279ee5,'settings':_0x2eaed5,'resolvedEnv':_0x2ae89a};}if(_0x11a939)return console['log'](_0x10c638(0x14b)+_0x3408a3['name']+_0x10c638(0x158)),{'authPath':undefined,'settings':_0x2eaed5,'resolvedEnv':_0x2ae89a};console['log'](_0x10c638(0x14b)+_0x3408a3['name']+_0x10c638(0x14f));const _0x1ea317=_0x46616b['BwfHy'](Boolean,process[_0x10c638(0x195)][_0x10c638(0x140)])&&Boolean(process['env']['RANGER_TEST_PASSWORD']),_0x353325=_0x46616b[_0x10c638(0x146)](Boolean,_0x3408a3[_0x10c638(0x174)]);if(_0x46616b[_0x10c638(0x159)](_0x1ea317,_0x353325))try{const _0x3bf9ec=await serverSideLogin(_0x3408a3['name']);if(_0x3bf9ec['status']===_0x46616b[_0x10c638(0x15e)])console['log'](_0x46616b[_0x10c638(0x12f)]);else{if(_0x46616b['UmrGW'](_0x3bf9ec['status'],_0x46616b[_0x10c638(0x175)])&&_0x3bf9ec['session_state']){console[_0x10c638(0x125)](_0x10c638(0x15a));const _0x35e9ac=await writeSessionToLocalCache(_0x3408a3['name'],_0x3408a3[_0x10c638(0x15c)],_0x169115,_0x1754c0,_0x3bf9ec['session_state'],_0x39ca88,_0x3f4340);return _0x1ea317&&!_0x353325&&await _0x46616b['BwfHy'](promptSaveCredentials,_0x3408a3['name']),{'authPath':_0x35e9ac,'settings':_0x2eaed5,'resolvedEnv':_0x2ae89a};}else _0x3bf9ec['test_output']&&(console['log'](_0x46616b['OKVRD']),console['log'](_0x3bf9ec[_0x10c638(0x12d)])),console[_0x10c638(0x125)]('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}}catch(_0xadd72d){console[_0x10c638(0x125)]('\x20\x20Server-side\x20login\x20error:\x20'+(_0xadd72d instanceof Error?_0xadd72d[_0x10c638(0x164)]:String(_0xadd72d))),console['log']('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}const {sessionState:_0x459863}=await manualBrowserLogin(_0x3408a3,_0x2ae89a),_0x43322f=await writeSessionToLocalCache(_0x3408a3[_0x10c638(0x149)],_0x3408a3['organizationId'],_0x169115,_0x1754c0,_0x459863,_0x39ca88,_0x3f4340);return{'authPath':_0x43322f,'settings':_0x2eaed5,'resolvedEnv':_0x2ae89a};}
1
+ const _0x300b47=_0x4089;(function(_0x537978,_0x31f8cb){const _0x2834fc=_0x4089,_0x317f37=_0x537978();while(!![]){try{const _0x3bd86a=-parseInt(_0x2834fc(0xed))/0x1+parseInt(_0x2834fc(0x127))/0x2+-parseInt(_0x2834fc(0xf9))/0x3+parseInt(_0x2834fc(0x114))/0x4+-parseInt(_0x2834fc(0x10a))/0x5+parseInt(_0x2834fc(0xe0))/0x6+parseInt(_0x2834fc(0x11d))/0x7*(parseInt(_0x2834fc(0x12c))/0x8);if(_0x3bd86a===_0x31f8cb)break;else _0x317f37['push'](_0x317f37['shift']());}catch(_0x18c506){_0x317f37['push'](_0x317f37['shift']());}}}(_0x35c0,0x4b653));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';function _0x4089(_0x49333c,_0x44e172){_0x49333c=_0x49333c-0xc9;const _0x35c053=_0x35c0();let _0x4089d3=_0x35c053[_0x49333c];return _0x4089d3;}import{existsSync}from'fs';import _0x24afee from'inquirer';import{chromium}from'playwright';import{getApiBaseUrl}from'./environment.js';import{getToken}from'./keychain.js';import{getRangerHomeDir}from'./rangerRoot.js';import{addProfileSetupBanner}from'./profileSetupBanner.js';import{duplicateCookiesForDomains,getSessionCachePath,getStorageStatePath,isCachedSessionLive,isInteractive,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0x3d4ac4=_0x4089,_0x537d9d={'KpUla':function(_0x50cb50){return _0x50cb50();},'lbQWm':_0x3d4ac4(0x115)},_0x2986b2=await _0x537d9d[_0x3d4ac4(0x142)](getToken);if(!_0x2986b2)throw new Error(_0x537d9d[_0x3d4ac4(0x11c)]);return _0x2986b2;}async function apiRequest(_0x413420,_0x10df70={}){const _0x43971e=_0x4089,_0x1669af={'XGYVM':function(_0x4cc71f,_0x2a0b40,_0x261f8b){return _0x4cc71f(_0x2a0b40,_0x261f8b);},'bYjHg':function(_0x4dbcab,_0x1e0fcd){return _0x4dbcab===_0x1e0fcd;},'ESHLr':_0x43971e(0xeb),'qCRTm':function(_0x364d9c,_0x44a301){return _0x364d9c===_0x44a301;}},_0x5391f4=await requireToken(),_0x48ddc6=getApiBaseUrl(),_0x23e2bb=await _0x1669af[_0x43971e(0xe5)](fetch,''+_0x48ddc6+_0x413420,{..._0x10df70,'headers':{'Authorization':_0x43971e(0xef)+_0x5391f4,'Content-Type':_0x43971e(0x123),..._0x10df70[_0x43971e(0xfa)]??{}}});if(!_0x23e2bb['ok']){let _0x511171='',_0x27ef52;try{const _0x3182f7=await _0x23e2bb['json']();_0x511171=(_0x1669af[_0x43971e(0xcf)](typeof _0x3182f7['error'],_0x1669af[_0x43971e(0xce)])?_0x3182f7[_0x43971e(0x13a)]:undefined)??JSON[_0x43971e(0xdd)](_0x3182f7);if(_0x1669af[_0x43971e(0x10c)](typeof _0x3182f7['code'],_0x1669af[_0x43971e(0xce)]))_0x27ef52=_0x3182f7['code'];}catch{_0x511171=_0x23e2bb['statusText'];}throw new ApiError(_0x43971e(0xdc)+_0x413420+'\x20failed\x20('+_0x23e2bb[_0x43971e(0x134)]+'):\x20'+_0x511171,_0x23e2bb[_0x43971e(0x134)],_0x511171,_0x27ef52);}if(_0x23e2bb[_0x43971e(0x134)]===0xcc)return undefined;return _0x23e2bb[_0x43971e(0xfb)]();}export class ApiError extends Error{['status'];[_0x300b47(0xd7)];['code'];constructor(_0x530cb4,_0x2d9957,_0x3427b0,_0x3ae315){const _0x1f5e24=_0x300b47,_0x1084bd={'mHLNq':'ApiError'},_0x284e5d='3|1|0|4|2'[_0x1f5e24(0x135)]('|');let _0x2ca53d=0x0;while(!![]){switch(_0x284e5d[_0x2ca53d++]){case'0':this[_0x1f5e24(0xd7)]=_0x3427b0;continue;case'1':this['status']=_0x2d9957;continue;case'2':this['name']=_0x1084bd[_0x1f5e24(0xdb)];continue;case'3':super(_0x530cb4);continue;case'4':this['code']=_0x3ae315;continue;}break;}}}function _0x35c0(){const _0x43e73d=['GxCSD','PUT','470202KYMrCo','HpzIS','password','success','utf-8','XGYVM','join','RANGER_TEST_PASSWORD','KmXVh','sZzzM','username','string','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','135962CayAQn','organizationId','Bearer\x20','not_configured','QKTId','MADlF','baseUrl','\x20\x20No\x20live\x20session\x20for\x20\x22','name','RANGER_TEST_USERNAME','bjAcR','txUwu','1035357qnwCaS','headers','json','UFpBe','storageStatePath','\x22\x20failed\x20validation\x20—\x20refreshing...','raw','/api/v1/profiles/','env','trim','xdFkq','close','XGnNx','psnyH','gewKc','domains','session_state','1593455aRblCX','ISGCs','qCRTm','confirm','RvlaH','\x22\x20for\x20','defaultEnvironmentKey','wePWD','/api/v1/profiles','\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20','949888mmGkzU','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','log','aJQip','Nrhxc','loginInstructions','clientIp','pfaOL','lbQWm','3101JBVult','length','onUxp','setupHeaders','POST','environmentKey','application/json','Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20(','mLYno','launch','689758OnKObD','ZmJxD','Create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`\x20so\x20Ranger\x20can\x20pick\x20the\x20right\x20one.','settings','/api/v1/profiles/auth-config','8088jKmqRb','\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','some','KmrBG','keys','cookies','sessionCheckPath','isArray','status','split','DELETE','JbRds','Cloud\x20profile\x20\x22','VtIcv','error','catch','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20','\x20\x20Server-side\x20login\x20error:\x20','effectiveBaseUrl','toISOString','WzIwA','KpUla','\x22\x20failed\x20validation\x20—\x20re-login\x20needed...','\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20','WvBuY','invalidateOn','wDzwi','goto','auth_config','userAgent','cli:manual-login','ESHLr','bYjHg','Iptee','TqTBk','\x22;\x20proceeding\x20with\x20loginInstructions.','sQmpK','napva','sessionState','YhvQL','detail','url','kNCLK','wpJgV','mHLNq','API\x20request\x20','stringify'];_0x35c0=function(){return _0x43e73d;};return _0x35c0();}export async function fetchCloudProfile(_0x520200){const _0x542da9=_0x300b47,_0x568724={'uJWnW':function(_0x4ac463,_0x30111e){return _0x4ac463(_0x30111e);},'mLYno':function(_0x4f0a46,_0x13186f){return _0x4f0a46 instanceof _0x13186f;}};try{return await apiRequest(_0x542da9(0x100)+_0x568724['uJWnW'](encodeURIComponent,_0x520200));}catch(_0x55d490){if(_0x568724[_0x542da9(0x125)](_0x55d490,ApiError)&&_0x55d490['status']===0x194)return null;throw _0x55d490;}}export async function listCloudProfiles(){const _0x22e9a9=_0x300b47,_0x196b68={'onUxp':function(_0x5b691a,_0x5783e3){return _0x5b691a(_0x5783e3);}},_0x158733=await _0x196b68[_0x22e9a9(0x11f)](apiRequest,_0x22e9a9(0x112));return _0x158733['profiles'];}export async function deleteCloudProfile(_0x3d1d47){const _0x3c2954=_0x300b47,_0x5bea0e={'aJQip':function(_0x2f826a,_0x35317d){return _0x2f826a instanceof _0x35317d;},'tkeiG':function(_0x5d3f3f,_0x150740){return _0x5d3f3f===_0x150740;}};try{await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x3d1d47),{'method':_0x3c2954(0x136)});}catch(_0x177a65){if(_0x5bea0e[_0x3c2954(0x117)](_0x177a65,ApiError)&&_0x5bea0e['tkeiG'](_0x177a65[_0x3c2954(0x134)],0x194))throw new Error(_0x3c2954(0x138)+_0x3d1d47+'\x22\x20not\x20found.');throw _0x177a65;}}export async function createCloudProfile(_0xcda55e,_0x5c7a78,_0x3da9c1={}){const _0x2bad8a=_0x300b47,_0x49a13a={'CiRiz':function(_0xcc99f9,_0x20b1bd,_0x5086f2){return _0xcc99f9(_0x20b1bd,_0x5086f2);},'wpJgV':_0x2bad8a(0x121)},_0x5b1b9f={'name':_0xcda55e};if(_0x5c7a78)_0x5b1b9f['environment_key']=_0x5c7a78;_0x3da9c1[_0x2bad8a(0x12a)]&&Object[_0x2bad8a(0x130)](_0x3da9c1[_0x2bad8a(0x12a)])['length']>0x0&&(_0x5b1b9f['settings']=_0x3da9c1[_0x2bad8a(0x12a)]);if(_0x3da9c1[_0x2bad8a(0xea)])_0x5b1b9f['username']=_0x3da9c1[_0x2bad8a(0xea)];if(_0x3da9c1[_0x2bad8a(0xe2)])_0x5b1b9f[_0x2bad8a(0xe2)]=_0x3da9c1[_0x2bad8a(0xe2)];return await _0x49a13a['CiRiz'](apiRequest,'/api/v1/profiles',{'method':_0x49a13a[_0x2bad8a(0xda)],'body':JSON[_0x2bad8a(0xdd)](_0x5b1b9f)});}export async function uploadCloudProfileSession(_0xe2855a,_0x4bb44f){const _0x2db06f=_0x300b47,_0x5877d3={'txUwu':function(_0x2830b7,_0x1ee251,_0x4b6865){return _0x2830b7(_0x1ee251,_0x4b6865);},'oeEup':function(_0x3512fe,_0x2f52a2){return _0x3512fe(_0x2f52a2);}};return await _0x5877d3[_0x2db06f(0xf8)](apiRequest,'/api/v1/profiles/'+_0x5877d3['oeEup'](encodeURIComponent,_0xe2855a)+'/session',{'method':_0x2db06f(0x121),'body':JSON['stringify']({'session_state':_0x4bb44f})});}export async function saveCloudProfileCredentials(_0x486232,_0x4534a3,_0xcf51f7){const _0x1b4a8e=_0x300b47,_0x47fb38={'YhvQL':function(_0x13d55a,_0x43467d,_0x5d32de){return _0x13d55a(_0x43467d,_0x5d32de);}};await _0x47fb38[_0x1b4a8e(0xd6)](apiRequest,_0x1b4a8e(0x100)+encodeURIComponent(_0x486232),{'method':'PUT','body':JSON['stringify']({'username':_0x4534a3,'password':_0xcf51f7})});}export async function fetchAuthConfig(){const _0x1e924e=_0x300b47;try{const _0x47a4a9=await apiRequest(_0x1e924e(0x12b));return _0x47a4a9[_0x1e924e(0xcb)];}catch(_0x27b2e0){return _0x27b2e0 instanceof ApiError&&_0x27b2e0[_0x1e924e(0x134)]!==0x194&&console[_0x1e924e(0x13a)]('\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20'+_0x27b2e0['message']),null;}}export function pickAdHocEnvKey(_0x36e356){const _0x3b3871=_0x300b47,_0x68a9f3={'WsCPL':function(_0x157ff5,_0x11ff62){return _0x157ff5===_0x11ff62;},'bjAcR':function(_0x26f8a7,_0x3a5fae){return _0x26f8a7+_0x3a5fae;}};if(!_0x36e356)return null;if(_0x36e356['defaultEnvironmentKey'])return _0x36e356[_0x3b3871(0x110)];const _0xcd05c8=Object[_0x3b3871(0x130)](_0x36e356['environments']??{});if(_0x68a9f3['WsCPL'](_0xcd05c8[_0x3b3871(0x11e)],0x1))return _0xcd05c8[0x0];if(_0xcd05c8['length']===0x0)return null;throw new Error(_0x68a9f3[_0x3b3871(0xf7)](_0x3b3871(0x124)+_0xcd05c8[_0x3b3871(0xe6)](',\x20')+').\x20',_0x3b3871(0x129)));}export async function resolveAdHocProfile(_0x4715f7=process[_0x300b47(0x101)]){const _0x2fd318=_0x300b47,_0x2aa6a4={'EdoxX':function(_0x4bba69){return _0x4bba69();},'hORVX':function(_0x128cde,_0x18c581,_0x3d5047,_0x18612e){return _0x128cde(_0x18c581,_0x3d5047,_0x18612e);},'sZzzM':function(_0x148e5b,_0x3c2278){return _0x148e5b??_0x3c2278;}},_0x15015e=_0x4715f7['RANGER_TEST_USERNAME'];if(!_0x15015e)return null;const _0x5d105c=await fetchCloudProfile(_0x15015e);if(_0x5d105c)return{'name':_0x5d105c[_0x2fd318(0xf5)],'profile':_0x5d105c};const _0x359a2c=await _0x2aa6a4['EdoxX'](fetchAuthConfig),_0x1b9ca1=pickAdHocEnvKey(_0x359a2c),_0x237680=_0x4715f7['RANGER_TEST_PASSWORD'],_0x5773fe=await _0x2aa6a4['hORVX'](createCloudProfile,_0x15015e,_0x2aa6a4[_0x2fd318(0xe9)](_0x1b9ca1,undefined),{'username':_0x15015e,'password':_0x237680});return console['log']('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x5773fe['name']+_0x2fd318(0x10f)+_0x15015e),{'name':_0x5773fe[_0x2fd318(0xf5)],'profile':_0x5773fe};}export async function writeSessionToLocalCache(_0x5c7d37,_0x514f17,_0xd92627,_0x1c2db8,_0x1c839c,_0x193260,_0x386de4){const _0x38a295=_0x300b47,_0x7cb08d={'pfaOL':function(_0x9cc3eb,_0x3f61ce){return _0x9cc3eb(_0x3f61ce);},'XGnNx':function(_0x770187,_0x1be8b4,_0x17da00){return _0x770187(_0x1be8b4,_0x17da00);},'HpzIS':'auth'},_0x4205d7=_0x7cb08d[_0x38a295(0x11b)](sessionCacheHash,{'orgId':_0x514f17,'profileName':_0x5c7d37,'effectiveBaseUrl':_0xd92627,'setupHeaders':_0x1c2db8,'invalidateOn':_0x386de4?.[_0x38a295(0x146)],'userAgent':_0x386de4?.[_0x38a295(0xcc)],'clientIp':_0x386de4?.['clientIp']}),_0xfc9a36=getSessionCachePath(_0x4205d7,_0x5c7d37),_0x23e19e=_0x7cb08d[_0x38a295(0x105)](join,getRangerHomeDir(),_0x7cb08d[_0x38a295(0xe1)]);!_0x7cb08d[_0x38a295(0x11b)](existsSync,_0x23e19e)&&await _0x7cb08d['XGnNx'](mkdir,_0x23e19e,{'recursive':!![]});const _0x47a799={..._0x1c839c};_0x193260&&_0x193260[_0x38a295(0x11e)]>0x0&&Array[_0x38a295(0x133)](_0x47a799['cookies'])&&(_0x47a799[_0x38a295(0x131)]=duplicateCookiesForDomains(_0x47a799['cookies'],_0x193260));const _0xb6869b={'cached_at':new Date()[_0x38a295(0x140)](),'session_state':_0x47a799};await writeFile(_0xfc9a36,JSON[_0x38a295(0xdd)](_0xb6869b,null,0x2));const _0x1e0b33=_0x7cb08d[_0x38a295(0x11b)](getStorageStatePath,_0xfc9a36);return await writeFile(_0x1e0b33,JSON[_0x38a295(0xdd)](_0x47a799,null,0x2)),_0x1e0b33;}export async function checkLocalCache(_0xf028bb,_0x20e785,_0x6f6808,_0x202cf5,_0x57e531){const _0x6df139=_0x300b47,_0x297976={'wDzwi':function(_0x530775,_0x40afea){return _0x530775(_0x40afea);},'TqTBk':function(_0x58a7fd,_0x3141c0){return _0x58a7fd(_0x3141c0);},'WzIwA':function(_0x3017d5,_0x180e65,_0x154234){return _0x3017d5(_0x180e65,_0x154234);},'VtIcv':_0x6df139(0xe4)},_0x19378c=_0x297976['wDzwi'](sessionCacheHash,{'orgId':_0x20e785,'profileName':_0xf028bb,'effectiveBaseUrl':_0x6f6808,'setupHeaders':_0x202cf5,'invalidateOn':_0x57e531?.['invalidateOn'],'userAgent':_0x57e531?.['userAgent'],'clientIp':_0x57e531?.[_0x6df139(0x11a)]}),_0xeec8fb=getSessionCachePath(_0x19378c,_0xf028bb),_0x8f221c=_0x297976[_0x6df139(0xc9)](getStorageStatePath,_0xeec8fb);if(!_0x297976[_0x6df139(0xd1)](existsSync,_0xeec8fb)||!_0x297976['TqTBk'](existsSync,_0x8f221c))return null;try{const _0x4bc86d=await _0x297976[_0x6df139(0x141)](readFile,_0xeec8fb,_0x297976[_0x6df139(0x139)]);return JSON['parse'](_0x4bc86d),{'storageStatePath':_0x8f221c};}catch{return null;}}function launchRealBrowser(){const _0xdb1c9e=_0x300b47;return chromium[_0xdb1c9e(0x126)]({'headless':!![]});}function emitSessionValidationHint(_0x50c56b,_0xd28c8d){const _0x5f4f6c=_0x300b47,_0x4aef67={'ZmJxD':function(_0x1084ac,_0x581b4d){return _0x1084ac===_0x581b4d;},'lxvxm':function(_0x2ccd67,_0x5717bd){return _0x2ccd67+_0x5717bd;}};if(!_0xd28c8d||!_0xd28c8d['domains']?.['length'])return;let _0x3bcad8;try{_0x3bcad8=new URL(_0x50c56b);}catch{return;}const _0x1fe619=[];for(const _0x3a63c8 of _0xd28c8d[_0x5f4f6c(0x108)]){try{_0x1fe619['push']({'raw':_0x3a63c8,'url':new URL(_0x3a63c8)});}catch{}}if(_0x4aef67[_0x5f4f6c(0x128)](_0x1fe619['length'],0x0))return;if(_0x1fe619[_0x5f4f6c(0x12e)](_0x39e51d=>_0x39e51d[_0x5f4f6c(0xd8)]['origin']===_0x3bcad8['origin']))return;const _0x289c48=_0x1fe619['map'](_0x8dd4c1=>'\x22'+_0x8dd4c1[_0x5f4f6c(0xff)]+'\x22')[_0x5f4f6c(0xe6)](',\x20');console['log'](_0x4aef67['lxvxm'](_0x5f4f6c(0x113)+_0x289c48+';\x20'+('you\x27re\x20now\x20at\x20\x22'+_0x50c56b+_0x5f4f6c(0x144)),'If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.'));}export async function serverSideLogin(_0x16fd29,_0x4a266f){const _0x142bde=_0x300b47,_0x464d85={'KmXVh':function(_0x18630c,_0x3977b2,_0x5e3369){return _0x18630c(_0x3977b2,_0x5e3369);},'xdFkq':function(_0x414751,_0x117375){return _0x414751(_0x117375);},'CeFpC':_0x142bde(0x121),'WvBuY':function(_0x3c8e00,_0x155657){return _0x3c8e00 instanceof _0x155657;},'RvlaH':function(_0x32ce62,_0x4dd648){return _0x32ce62===_0x4dd648;},'gewKc':function(_0xd3421f,_0x503d9c){return _0xd3421f===_0x503d9c;},'vGItz':'not_configured'},_0x138340=process['env']['RANGER_TEST_USERNAME'],_0xc710e=process['env'][_0x142bde(0xe7)],_0x100879={};if(_0x138340)_0x100879['username']=_0x138340;if(_0xc710e)_0x100879[_0x142bde(0xe2)]=_0xc710e;if(_0x4a266f?.['force'])_0x100879['force']=!![];try{return await _0x464d85[_0x142bde(0xe8)](apiRequest,_0x142bde(0x100)+_0x464d85[_0x142bde(0x103)](encodeURIComponent,_0x16fd29)+'/login',{'method':_0x464d85['CeFpC'],'body':JSON[_0x142bde(0xdd)](_0x100879)});}catch(_0xe39900){if(_0x464d85[_0x142bde(0x145)](_0xe39900,ApiError)&&_0x464d85[_0x142bde(0x10e)](_0xe39900['status'],0x190)&&_0x464d85[_0x142bde(0x107)](_0xe39900['code'],_0x464d85['vGItz']))return{'status':_0x142bde(0xf0),'error':_0xe39900['detail']};throw _0xe39900;}}export async function manualBrowserLogin(_0x38b7a4,_0x19c72f){const _0x23459c=_0x300b47,_0x4ff6dd={'KmrBG':function(_0x81bacf){return _0x81bacf();},'cksXf':function(_0x209fc5){return _0x209fc5();},'mhhcx':_0x23459c(0x104),'psnyH':function(_0x1d935b){return _0x1d935b();},'Iptee':function(_0x1619ea,_0x224e03){return _0x1619ea+_0x224e03;},'kNCLK':_0x23459c(0x13d),'cqOHa':function(_0x31efec,_0x4ff50d){return _0x31efec>_0x4ff50d;},'napva':'about:blank','jZalr':'Browser\x20login\x20timed\x20out\x20before\x20completion.','GxCSD':_0x23459c(0x13c),'NNgla':function(_0x3a0784,_0x17f357,_0x415339){return _0x3a0784(_0x17f357,_0x415339);},'psjyO':function(_0x16f109,_0x103165){return _0x16f109(_0x103165);},'OpBdZ':_0x23459c(0xcd)};if(!_0x4ff6dd[_0x23459c(0x106)](isInteractive))throw new Error(_0x4ff6dd[_0x23459c(0xd0)]('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0x38b7a4[_0x23459c(0xf5)]+'\x22.\x0a',_0x4ff6dd[_0x23459c(0xd9)])+'or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.');const _0x11c1dd=_0x19c72f&&_0x4ff6dd['cqOHa'](_0x19c72f[_0x23459c(0x108)][_0x23459c(0x11e)],0x0)?_0x19c72f['domains'][0x0]:_0x4ff6dd[_0x23459c(0xd4)];console['log']('\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.'),console[_0x23459c(0x116)]('\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a'),await new Promise(_0x48e264=>setTimeout(_0x48e264,0x7d0));const _0x35cc58=await chromium['launch']({'headless':![]});let _0x3d2851=null;try{const _0x27867b={'ignoreHTTPSErrors':!![]};_0x19c72f?.['setupHeaders']&&(_0x27867b['extraHTTPHeaders']=_0x19c72f['setupHeaders']);const _0x11f4a1=await _0x35cc58['newContext'](_0x27867b);await addProfileSetupBanner(_0x11f4a1);const _0x3d3792=await _0x11f4a1['newPage']();await _0x3d3792[_0x23459c(0xca)](_0x11c1dd);let _0x28d0d3=![];await new Promise(_0x26e3bb=>{const _0x56956e=setTimeout(()=>{const _0x151eef=_0x4089;_0x28d0d3=!![],console[_0x151eef(0x13a)]('Browser\x20login\x20timed\x20out\x20after\x20'+MANUAL_LOGIN_TIMEOUT_MS/0xea60+'\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.'),_0x4ff6dd[_0x151eef(0x12f)](_0x26e3bb);},MANUAL_LOGIN_TIMEOUT_MS);_0x3d3792['on'](_0x4ff6dd['mhhcx'],async()=>{clearTimeout(_0x56956e);try{const _0x446ee0=await _0x11f4a1['storageState']();_0x3d2851=_0x446ee0;}catch{}_0x4ff6dd['cksXf'](_0x26e3bb);});});if(_0x28d0d3&&!_0x3d2851)throw new Error(_0x4ff6dd['jZalr']);}finally{await _0x35cc58['close']()[_0x23459c(0x13b)](()=>{});}if(!_0x3d2851)throw new Error(_0x4ff6dd[_0x23459c(0xde)]);return await _0x4ff6dd['NNgla'](apiRequest,_0x23459c(0x100)+_0x4ff6dd['psjyO'](encodeURIComponent,_0x38b7a4['name'])+'/session',{'method':_0x23459c(0x121),'body':JSON[_0x23459c(0xdd)]({'session_state':_0x3d2851,'updated_by':_0x4ff6dd['OpBdZ']})}),{'sessionState':_0x3d2851};}export async function promptSaveCredentials(_0x3f420c){const _0x54644d=_0x300b47,_0xdf82b3={'CHpnf':function(_0x50b0bf){return _0x50b0bf();},'iYpID':'Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','ZqfKt':function(_0xa8ae45,_0x5cfbce){return _0xa8ae45(_0x5cfbce);},'JbRds':_0x54644d(0xdf)},_0xe71de0=process[_0x54644d(0x101)][_0x54644d(0xf6)],_0x558589=process[_0x54644d(0x101)]['RANGER_TEST_PASSWORD'];if(!_0xe71de0||!_0x558589)return;if(!_0xdf82b3['CHpnf'](isInteractive))return;const {save:_0x391012}=await _0x24afee['prompt']([{'type':_0x54644d(0x10d),'name':'save','message':_0xdf82b3['iYpID'],'default':![]}]);if(!_0x391012)return;await apiRequest(_0x54644d(0x100)+_0xdf82b3['ZqfKt'](encodeURIComponent,_0x3f420c),{'method':_0xdf82b3[_0x54644d(0x137)],'body':JSON[_0x54644d(0xdd)]({'username':_0xe71de0,'password':_0x558589})}),console['log']('\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.');}export async function resolveCloudProfileSession(_0xd3f50b,_0x533fba={}){const _0x3e3063=_0x300b47,_0x972978={'TjLUA':function(_0x57df59){return _0x57df59();},'wePWD':_0x3e3063(0xeb),'FLppP':function(_0x26b4d9,_0xd6a86a){return _0x26b4d9===_0xd6a86a;},'eUPOV':function(_0x352c52,_0x1b0e26){return _0x352c52||_0x1b0e26;},'uUjSr':function(_0x6a41b2,_0x4bb856,_0x5a1308){return _0x6a41b2(_0x4bb856,_0x5a1308);},'PoXOP':function(_0x59a2ec,_0x5df97c,_0x8fc908){return _0x59a2ec(_0x5df97c,_0x8fc908);},'UFpBe':function(_0x3b0d13,_0x29bc74){return _0x3b0d13(_0x29bc74);},'ISGCs':function(_0x9014b8,_0x3707e1){return _0x9014b8(_0x3707e1);},'UZjlX':function(_0x36b7ac,_0x5049ef){return _0x36b7ac||_0x5049ef;},'MADlF':'not_configured','xpJPZ':'\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','Nrhxc':'\x20\x20Login\x20successful.\x20Session\x20cached.','YODSF':function(_0x5a626d,_0x2bca68){return _0x5a626d&&_0x2bca68;},'JgxrD':function(_0x52917f,_0x47ca0c){return _0x52917f(_0x47ca0c);},'sQmpK':_0x3e3063(0x12d),'xhJtj':function(_0x4fec6a,_0x6ec827){return _0x4fec6a instanceof _0x6ec827;},'CEPik':_0x3e3063(0xec),'QKTId':function(_0x4a2e1b,_0x1fd716,_0x439b81,_0x19bd3e,_0x272ef7,_0x5cf61c,_0x451a5c,_0x49d767){return _0x4a2e1b(_0x1fd716,_0x439b81,_0x19bd3e,_0x272ef7,_0x5cf61c,_0x451a5c,_0x49d767);}},_0x5bfc8a=_0xd3f50b['settings']??{},_0x3edaad=await _0x972978['TjLUA'](fetchAuthConfig),_0x30f8c4=_0x3edaad?resolveAuthEnvironmentLocally(_0x3edaad,_0xd3f50b[_0x3e3063(0x122)]):null,_0x5754d7=typeof _0x30f8c4?.[_0x3e3063(0x119)]===_0x972978[_0x3e3063(0x111)]&&_0x30f8c4['loginInstructions']['trim']()?_0x30f8c4['loginInstructions']:undefined,_0x508274=_0x972978['FLppP'](typeof _0x5bfc8a[_0x3e3063(0x119)],_0x3e3063(0xeb))&&_0x5bfc8a[_0x3e3063(0x119)][_0x3e3063(0x102)]()?_0x5bfc8a['loginInstructions']:undefined,_0x4a0381=_0x972978['eUPOV'](_0x508274,!_0x5754d7)?_0x5bfc8a:{..._0x5bfc8a,'loginInstructions':_0x5754d7},_0x379f84=Boolean(_0x4a0381['loginInstructions']?.[_0x3e3063(0x102)]()),_0x586ea5=_0x30f8c4?.[_0x3e3063(0x108)],_0x40da25=_0x5bfc8a[_0x3e3063(0x120)],_0x29db8e=_0x40da25??_0x30f8c4?.[_0x3e3063(0x120)],_0x24704a=_0x533fba[_0x3e3063(0x13f)]??_0x5bfc8a[_0x3e3063(0xf3)]??(_0x586ea5&&_0x586ea5[_0x3e3063(0x11e)]>0x0?_0x586ea5[0x0]:''),_0x4b73ad={'invalidateOn':_0x30f8c4?.['invalidateOn'],'userAgent':_0x30f8c4?.['browserOptions']?.['userAgent']??_0x5bfc8a['userAgent']},_0x401e54=await checkLocalCache(_0xd3f50b['name'],_0xd3f50b['organizationId'],_0x24704a,_0x29db8e,_0x4b73ad);if(_0x401e54){if(_0x24704a){const _0x24f8dd=await isCachedSessionLive(_0x401e54['storageStatePath'],_0x24704a,{'sessionCheckPath':_0x30f8c4?.['sessionCheckPath'],'setupHeaders':_0x29db8e},{'launchBrowser':launchRealBrowser});if(_0x24f8dd)return console[_0x3e3063(0x116)]('\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22'+_0xd3f50b[_0x3e3063(0xf5)]+'\x22'),{'authPath':_0x401e54[_0x3e3063(0xfd)],'settings':_0x4a0381,'resolvedEnv':_0x30f8c4};console[_0x3e3063(0x116)]('\x20\x20Cached\x20session\x20for\x20\x22'+_0xd3f50b['name']+_0x3e3063(0xfe)),_0x972978['uUjSr'](emitSessionValidationHint,_0x24704a,_0x30f8c4);}else return{'authPath':_0x401e54['storageStatePath'],'settings':_0x4a0381,'resolvedEnv':_0x30f8c4};}if(_0xd3f50b[_0x3e3063(0xd5)]){const _0xd6da27=await writeSessionToLocalCache(_0xd3f50b['name'],_0xd3f50b['organizationId'],_0x24704a,_0x29db8e,_0xd3f50b[_0x3e3063(0xd5)],_0x586ea5,_0x4b73ad);if(_0x24704a){const _0xd27ed1=await isCachedSessionLive(_0xd6da27,_0x24704a,{'sessionCheckPath':_0x30f8c4?.[_0x3e3063(0x132)],'setupHeaders':_0x29db8e},{'launchBrowser':launchRealBrowser});if(_0xd27ed1)return console[_0x3e3063(0x116)]('\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22'+_0xd3f50b[_0x3e3063(0xf5)]+'\x22,\x20cached\x20locally'),{'authPath':_0xd6da27,'settings':_0x4a0381,'resolvedEnv':_0x30f8c4};console[_0x3e3063(0x116)]('\x20\x20Cloud\x20session\x20for\x20\x22'+_0xd3f50b[_0x3e3063(0xf5)]+_0x3e3063(0x143)),_0x972978['PoXOP'](emitSessionValidationHint,_0x24704a,_0x30f8c4);}else return{'authPath':_0xd6da27,'settings':_0x4a0381,'resolvedEnv':_0x30f8c4};}if(_0x379f84)return console[_0x3e3063(0x116)](_0x3e3063(0xf4)+_0xd3f50b[_0x3e3063(0xf5)]+_0x3e3063(0xd2)),{'authPath':undefined,'settings':_0x4a0381,'resolvedEnv':_0x30f8c4};console[_0x3e3063(0x116)](_0x3e3063(0xf4)+_0xd3f50b[_0x3e3063(0xf5)]+'\x22,\x20attempting\x20login...');const _0x2381e6=Boolean(process[_0x3e3063(0x101)][_0x3e3063(0xf6)])&&_0x972978[_0x3e3063(0xfc)](Boolean,process[_0x3e3063(0x101)]['RANGER_TEST_PASSWORD']),_0x1ce5a1=_0x972978[_0x3e3063(0x10b)](Boolean,_0xd3f50b[_0x3e3063(0xea)]);if(_0x972978['UZjlX'](_0x2381e6,_0x1ce5a1))try{const _0x1848ad=await serverSideLogin(_0xd3f50b[_0x3e3063(0xf5)]);if(_0x1848ad['status']===_0x972978[_0x3e3063(0xf2)])console[_0x3e3063(0x116)](_0x972978['xpJPZ']);else{if(_0x972978['FLppP'](_0x1848ad['status'],_0x3e3063(0xe3))&&_0x1848ad['session_state']){console[_0x3e3063(0x116)](_0x972978[_0x3e3063(0x118)]);const _0x56a34b=await writeSessionToLocalCache(_0xd3f50b[_0x3e3063(0xf5)],_0xd3f50b[_0x3e3063(0xee)],_0x24704a,_0x29db8e,_0x1848ad[_0x3e3063(0x109)],_0x586ea5,_0x4b73ad);return _0x972978['YODSF'](_0x2381e6,!_0x1ce5a1)&&await _0x972978['JgxrD'](promptSaveCredentials,_0xd3f50b[_0x3e3063(0xf5)]),{'authPath':_0x56a34b,'settings':_0x4a0381,'resolvedEnv':_0x30f8c4};}else _0x1848ad['test_output']&&(console['log'](_0x972978[_0x3e3063(0xd3)]),console['log'](_0x1848ad['test_output'])),console[_0x3e3063(0x116)](_0x3e3063(0xec));}}catch(_0x183f75){console['log'](_0x3e3063(0x13e)+(_0x972978['xhJtj'](_0x183f75,Error)?_0x183f75['message']:String(_0x183f75))),console['log'](_0x972978['CEPik']);}const {sessionState:_0x4fd042}=await manualBrowserLogin(_0xd3f50b,_0x30f8c4),_0x51e0a8=await _0x972978[_0x3e3063(0xf1)](writeSessionToLocalCache,_0xd3f50b['name'],_0xd3f50b[_0x3e3063(0xee)],_0x24704a,_0x29db8e,_0x4fd042,_0x586ea5,_0x4b73ad);return{'authPath':_0x51e0a8,'settings':_0x4a0381,'resolvedEnv':_0x30f8c4};}
@@ -1 +1 @@
1
- const _0x3922bb=_0x1602;function _0x2424(){const _0x3078ba=['test','mtsmF','3GOOwDX','url','633455oaxPcJ','clientIp','28MZklIQ','stdout','hex','update','env','stringify','setupHeaders','.json','100968oFuzZt','add','profileName','794268JvDoKG','stdin','VHZgQ','effectiveBaseUrl','userAgent','push','13024764xFGPsD','sojmw','endsWith','launchBrowser','has','1165164TJzblR','DRIGB','fZcSS','newContext','newPage','eervp','sha256','.localhost','hostname','slice','length','domain','goto','114180cBrEXT','phiJV','isTTY','defaultEnvironmentKey','localhost','invalidateOn','includes','map','port','6489480exSJwt'];_0x2424=function(){return _0x3078ba;};return _0x2424();}(function(_0x3e7d90,_0x547972){const _0x32173a=_0x1602,_0x364312=_0x3e7d90();while(!![]){try{const _0x4924b0=-parseInt(_0x32173a(0x167))/0x1+-parseInt(_0x32173a(0x182))/0x2*(parseInt(_0x32173a(0x173))/0x3)+parseInt(_0x32173a(0x177))/0x4*(-parseInt(_0x32173a(0x175))/0x5)+-parseInt(_0x32173a(0x17f))/0x6+-parseInt(_0x32173a(0x15a))/0x7+parseInt(_0x32173a(0x170))/0x8+parseInt(_0x32173a(0x155))/0x9;if(_0x4924b0===_0x547972)break;else _0x364312['push'](_0x364312['shift']());}catch(_0x4752ba){_0x364312['push'](_0x364312['shift']());}}}(_0x2424,0xa5456));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x3a1635=process[_0x3922bb(0x17b)],_0x185cd1={'stdin':process[_0x3922bb(0x183)],'stdout':process['stdout']}){const _0x52ffea=_0x3922bb,_0x558669={'eervp':function(_0x5f28cb,_0xecb76b){return _0x5f28cb(_0xecb76b);},'sojmw':function(_0x1f98e3,_0x37fa8c){return _0x1f98e3(_0x37fa8c);}};if(_0x3a1635['CI'])return![];return _0x558669[_0x52ffea(0x15f)](Boolean,_0x185cd1[_0x52ffea(0x183)][_0x52ffea(0x169)])&&_0x558669[_0x52ffea(0x156)](Boolean,_0x185cd1[_0x52ffea(0x178)]['isTTY']);}function _0x1602(_0x426699,_0x50fabe){_0x426699=_0x426699-0x154;const _0x242402=_0x2424();let _0x16027f=_0x242402[_0x426699];return _0x16027f;}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x2c1ee7){const _0x19b726=_0x3922bb,_0x576a9c={'mAVla':'setupHeaders','phiJV':function(_0x46f77b,_0x52abd3){return _0x46f77b!==_0x52abd3;},'isrlT':_0x19b726(0x160),'DRIGB':_0x19b726(0x179)},_0x35d649=new Set(_0x2c1ee7[_0x19b726(0x16c)]??DEFAULT_INVALIDATE_ON),_0xdab614={'orgId':_0x2c1ee7['orgId'],'profileName':_0x2c1ee7[_0x19b726(0x181)]};return _0x35d649[_0x19b726(0x159)]('baseUrl')&&(_0xdab614[_0x19b726(0x185)]=_0x2c1ee7[_0x19b726(0x185)]),_0x35d649['has'](_0x576a9c['mAVla'])&&(_0xdab614[_0x19b726(0x17d)]=_0x2c1ee7['setupHeaders']?sortObjectKeys(_0x2c1ee7[_0x19b726(0x17d)]):_0x2c1ee7[_0x19b726(0x17d)]),_0x35d649[_0x19b726(0x159)](_0x19b726(0x16f))&&(_0xdab614['port']=extractPort(_0x2c1ee7[_0x19b726(0x185)])),_0x35d649[_0x19b726(0x159)](_0x19b726(0x186))&&_0x576a9c[_0x19b726(0x168)](_0x2c1ee7['userAgent'],undefined)&&(_0xdab614[_0x19b726(0x186)]=_0x2c1ee7[_0x19b726(0x186)]),_0x35d649[_0x19b726(0x159)]('clientIp')&&_0x2c1ee7[_0x19b726(0x176)]!==undefined&&(_0xdab614[_0x19b726(0x176)]=_0x2c1ee7['clientIp']),createHash(_0x576a9c['isrlT'])[_0x19b726(0x17a)](JSON[_0x19b726(0x17c)](_0xdab614))['digest'](_0x576a9c[_0x19b726(0x15b)])[_0x19b726(0x163)](0x0,0xc);}function extractPort(_0x5da090){const _0x2318d4=_0x3922bb;try{return new URL(_0x5da090)[_0x2318d4(0x16f)];}catch{return'';}}function sortObjectKeys(_0x1f1469){const _0x27b2fc={};for(const _0x49787c of Object['keys'](_0x1f1469)['sort']()){_0x27b2fc[_0x49787c]=_0x1f1469[_0x49787c];}return _0x27b2fc;}export function getSessionCachePath(_0x4f050d,_0x76c77){const _0x352084=_0x3922bb,_0x8c88f5={'TZhca':function(_0x4f04e1,_0x3b88a4,_0x463626,_0x10ac82){return _0x4f04e1(_0x3b88a4,_0x463626,_0x10ac82);},'mtsmF':'auth'};return _0x8c88f5['TZhca'](join,getRangerHomeDir(),_0x8c88f5[_0x352084(0x172)],_0x4f050d+'-'+_0x76c77+_0x352084(0x17e));}export function getStorageStatePath(_0x3e05e4){return _0x3e05e4['replace'](/\.json$/,'.storageState.json');}export function needsTunnel(_0x423863){const _0x1e3565=_0x3922bb,_0x4fa416={'wtCWZ':function(_0x40632e,_0x51a86d){return _0x40632e===_0x51a86d;},'VXLyS':'127.0.0.1','fZcSS':_0x1e3565(0x161)};let _0x123311;try{_0x123311=new URL(_0x423863)['hostname'];}catch{return![];}if(_0x123311===_0x1e3565(0x16b)||_0x4fa416['wtCWZ'](_0x123311,_0x4fa416['VXLyS']))return!![];if(_0x123311[_0x1e3565(0x157)](_0x4fa416[_0x1e3565(0x15c)]))return!![];if(_0x123311[_0x1e3565(0x16d)]('localhost.'))return!![];return![];}export function hostnameOf(_0x46ff7f){const _0x7d4205=_0x3922bb;return new URL(_0x46ff7f)[_0x7d4205(0x162)];}export function duplicateCookiesForDomains(_0x30fd4e,_0x5340c7){const _0x1e1cd8=_0x3922bb,_0x4287f0=[..._0x30fd4e],_0x589550=new Set(_0x30fd4e[_0x1e1cd8(0x16e)](_0x1df7df=>_0x1df7df[_0x1e1cd8(0x165)]));for(const _0x5bde61 of _0x5340c7){let _0x417aaa;try{_0x417aaa=hostnameOf(_0x5bde61);}catch{continue;}if(!_0x417aaa)continue;const _0x249001=_0x417aaa['startsWith']('.')?_0x417aaa:'.'+_0x417aaa;if(_0x589550['has'](_0x417aaa)||_0x589550['has'](_0x249001))continue;for(const _0x1582c5 of _0x30fd4e){_0x4287f0[_0x1e1cd8(0x154)]({..._0x1582c5,'domain':_0x249001});}_0x589550[_0x1e1cd8(0x180)](_0x249001);}return _0x4287f0;}export function resolveAuthEnvironmentLocally(_0x206985,_0x3c6894){const _0x2c304c=_0x3922bb,_0x176756={'VHZgQ':function(_0x3065c3,_0x1f8d1c){return _0x3065c3===_0x1f8d1c;}},_0x307f82=_0x206985['environments'];if(_0x3c6894){const _0x1be13e=_0x307f82[_0x3c6894];if(!_0x1be13e)return null;return{'key':_0x3c6894,..._0x1be13e};}if(_0x206985[_0x2c304c(0x16a)]){const _0x2e8c7e=_0x307f82[_0x206985['defaultEnvironmentKey']];if(!_0x2e8c7e)return null;return{'key':_0x206985['defaultEnvironmentKey'],..._0x2e8c7e};}const _0x3f2136=Object['keys'](_0x307f82);if(_0x176756[_0x2c304c(0x184)](_0x3f2136[_0x2c304c(0x164)],0x1)){const _0x22e3a9=_0x3f2136[0x0];return{'key':_0x22e3a9,..._0x307f82[_0x22e3a9]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x447eab,_0x1bcbef){try{if(_0x1bcbef)return new URL(_0x1bcbef,_0x447eab)['toString']();return new URL(_0x447eab)['toString']();}catch{return null;}}export function looksLikeLoginUrl(_0x4c2447){const _0x2a08ff=_0x3922bb;try{const _0x56f2bc=new URL(_0x4c2447);return LOGIN_URL_PATTERN[_0x2a08ff(0x171)](_0x56f2bc['pathname']);}catch{return LOGIN_URL_PATTERN['test'](_0x4c2447);}}export async function isCachedSessionLive(_0x1ad0c9,_0xf093a5,_0x513577={},_0x113dc7={}){const _0x56de20=_0x3922bb,_0x1e718b={'CYdQY':function(_0xf79361,_0x463618){return _0xf79361===_0x463618;}},_0x51c230=buildSessionCheckUrl(_0xf093a5,_0x513577['sessionCheckPath']);if(!_0x51c230)return!![];if(!_0x113dc7[_0x56de20(0x158)])return!![];let _0x5517e8=null;try{_0x5517e8=await _0x113dc7[_0x56de20(0x158)]();const _0x2b7f1f=await _0x5517e8[_0x56de20(0x15d)]({'storageState':_0x1ad0c9,'ignoreHTTPSErrors':!![],..._0x513577[_0x56de20(0x17d)]?{'extraHTTPHeaders':_0x513577[_0x56de20(0x17d)]}:{}}),_0x463c4c=await _0x2b7f1f[_0x56de20(0x15e)](),_0x2546ce=await _0x463c4c[_0x56de20(0x166)](_0x51c230,{'waitUntil':'domcontentloaded','timeout':0x3a98}),_0x4c22f9=_0x2546ce?.['status']();if(_0x4c22f9===0x191||_0x1e718b['CYdQY'](_0x4c22f9,0x193))return![];const _0x27f875=_0x463c4c[_0x56de20(0x174)]();if(looksLikeLoginUrl(_0x27f875))return![];return!![];}catch{return![];}finally{if(_0x5517e8)await _0x5517e8['close']()['catch'](()=>{});}}
1
+ const _0x3d6d4f=_0x1b0b;function _0x1b0b(_0x28d0ee,_0x4d2f68){_0x28d0ee=_0x28d0ee-0x173;const _0x17ff86=_0x17ff();let _0x1b0be3=_0x17ff86[_0x28d0ee];return _0x1b0be3;}(function(_0x13c239,_0x1d11be){const _0x2d1d63=_0x1b0b,_0x2c484c=_0x13c239();while(!![]){try{const _0x370876=-parseInt(_0x2d1d63(0x1a4))/0x1*(parseInt(_0x2d1d63(0x1ab))/0x2)+-parseInt(_0x2d1d63(0x197))/0x3*(parseInt(_0x2d1d63(0x18c))/0x4)+parseInt(_0x2d1d63(0x193))/0x5*(-parseInt(_0x2d1d63(0x17c))/0x6)+parseInt(_0x2d1d63(0x1a8))/0x7*(-parseInt(_0x2d1d63(0x185))/0x8)+-parseInt(_0x2d1d63(0x191))/0x9*(parseInt(_0x2d1d63(0x174))/0xa)+-parseInt(_0x2d1d63(0x188))/0xb+-parseInt(_0x2d1d63(0x19a))/0xc*(-parseInt(_0x2d1d63(0x19d))/0xd);if(_0x370876===_0x1d11be)break;else _0x2c484c['push'](_0x2c484c['shift']());}catch(_0x4d3887){_0x2c484c['push'](_0x2c484c['shift']());}}}(_0x17ff,0x8c151));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x4b492c=process[_0x3d6d4f(0x18f)],_0x221d23={'stdin':process['stdin'],'stdout':process['stdout']}){const _0x2da0db=_0x3d6d4f,_0x48485c={'IqFjg':function(_0x366944,_0x49971b){return _0x366944(_0x49971b);}};if(_0x4b492c['CI'])return![];return Boolean(_0x221d23[_0x2da0db(0x178)][_0x2da0db(0x18e)])&&_0x48485c[_0x2da0db(0x181)](Boolean,_0x221d23['stdout']['isTTY']);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x1e34dd){const _0x4edd9b=_0x3d6d4f,_0xf433b5={'ylLSE':_0x4edd9b(0x179),'Imupk':'setupHeaders','WeyHq':function(_0x5c5346,_0x35f468){return _0x5c5346(_0x35f468);},'YuJrC':_0x4edd9b(0x19f),'nPOla':function(_0x49ea9d,_0x3de7f7){return _0x49ea9d(_0x3de7f7);},'bRxfZ':function(_0x3759da,_0x3ea68e){return _0x3759da!==_0x3ea68e;},'VGXYj':function(_0x1a5594,_0x1b6262){return _0x1a5594(_0x1b6262);}},_0x420191=new Set(_0x1e34dd['invalidateOn']??DEFAULT_INVALIDATE_ON),_0x45432a={'orgId':_0x1e34dd[_0x4edd9b(0x175)],'profileName':_0x1e34dd[_0x4edd9b(0x1a2)]};return _0x420191['has'](_0xf433b5['ylLSE'])&&(_0x45432a[_0x4edd9b(0x1a9)]=_0x1e34dd['effectiveBaseUrl']),_0x420191['has'](_0xf433b5['Imupk'])&&(_0x45432a[_0x4edd9b(0x18d)]=_0x1e34dd['setupHeaders']?_0xf433b5['WeyHq'](sortObjectKeys,_0x1e34dd['setupHeaders']):_0x1e34dd[_0x4edd9b(0x18d)]),_0x420191[_0x4edd9b(0x1a6)](_0xf433b5['YuJrC'])&&(_0x45432a['port']=_0xf433b5[_0x4edd9b(0x190)](extractPort,_0x1e34dd['effectiveBaseUrl'])),_0x420191['has']('userAgent')&&_0x1e34dd[_0x4edd9b(0x176)]!==undefined&&(_0x45432a[_0x4edd9b(0x176)]=_0x1e34dd[_0x4edd9b(0x176)]),_0x420191['has']('clientIp')&&_0xf433b5['bRxfZ'](_0x1e34dd[_0x4edd9b(0x180)],undefined)&&(_0x45432a['clientIp']=_0x1e34dd['clientIp']),_0xf433b5[_0x4edd9b(0x173)](createHash,_0x4edd9b(0x17e))[_0x4edd9b(0x18a)](JSON['stringify'](_0x45432a))[_0x4edd9b(0x194)]('hex')['slice'](0x0,0xc);}function extractPort(_0x563c74){try{return new URL(_0x563c74)['port'];}catch{return'';}}function _0x17ff(){const _0x3542c5=['RtNeK','has','toString','255017VPYUaR','effectiveBaseUrl','launchBrowser','698SCkOsu','VGXYj','530LEOdhP','orgId','userAgent','vBNwj','stdin','baseUrl','close','endsWith','18uoSPpU','NjLWQ','sha256','push','clientIp','IqFjg','pathname','catch','localhost','208Jzeiol','test','fFhoP','10975767AVjEVq','add','update','keys','208sycOEs','setupHeaders','isTTY','env','nPOla','77778EdCrtY','goto','1310345lEChEX','digest','mYQqD','defaultEnvironmentKey','20499hGAjoi','status','includes','108PPZXbJ','auth','PWpde','7516483DWpyAC','sort','port','PybNU','map','profileName','environments','3110gBFAXd'];_0x17ff=function(){return _0x3542c5;};return _0x17ff();}function sortObjectKeys(_0x4fd9a4){const _0x530e8f=_0x3d6d4f,_0x49bcce={};for(const _0x48cd41 of Object['keys'](_0x4fd9a4)[_0x530e8f(0x19e)]()){_0x49bcce[_0x48cd41]=_0x4fd9a4[_0x48cd41];}return _0x49bcce;}export function getSessionCachePath(_0x1de8e8,_0x53fae4){const _0x1af566=_0x3d6d4f,_0x1ebb7a={'fFhoP':function(_0x5ecc9a){return _0x5ecc9a();},'mYQqD':_0x1af566(0x19b)};return join(_0x1ebb7a[_0x1af566(0x187)](getRangerHomeDir),_0x1ebb7a[_0x1af566(0x195)],_0x1de8e8+'-'+_0x53fae4+'.json');}export function getStorageStatePath(_0x15c4b8){const _0x44572b=_0x3d6d4f,_0x273d05={'RtNeK':'.storageState.json'};return _0x15c4b8['replace'](/\.json$/,_0x273d05[_0x44572b(0x1a5)]);}export function needsTunnel(_0x5d9f3c){const _0x2d8289=_0x3d6d4f,_0x5890e2={'NjLWQ':'.localhost','PybNU':'localhost.'};let _0x32ab3c;try{_0x32ab3c=new URL(_0x5d9f3c)['hostname'];}catch{return![];}if(_0x32ab3c===_0x2d8289(0x184)||_0x32ab3c==='127.0.0.1')return!![];if(_0x32ab3c[_0x2d8289(0x17b)](_0x5890e2[_0x2d8289(0x17d)]))return!![];if(_0x32ab3c[_0x2d8289(0x199)](_0x5890e2[_0x2d8289(0x1a0)]))return!![];return![];}export function hostnameOf(_0x25e5b7){return new URL(_0x25e5b7)['hostname'];}export function duplicateCookiesForDomains(_0x3ea2eb,_0x4ffe07){const _0x348828=_0x3d6d4f,_0x49a1e1=[..._0x3ea2eb],_0x1eea27=new Set(_0x3ea2eb[_0x348828(0x1a1)](_0x40f54d=>_0x40f54d['domain']));for(const _0x2c6428 of _0x4ffe07){let _0x4bd0a1;try{_0x4bd0a1=hostnameOf(_0x2c6428);}catch{continue;}if(!_0x4bd0a1)continue;const _0x104780=_0x4bd0a1['startsWith']('.')?_0x4bd0a1:'.'+_0x4bd0a1;if(_0x1eea27['has'](_0x4bd0a1)||_0x1eea27[_0x348828(0x1a6)](_0x104780))continue;for(const _0x288f22 of _0x3ea2eb){_0x49a1e1[_0x348828(0x17f)]({..._0x288f22,'domain':_0x104780});}_0x1eea27[_0x348828(0x189)](_0x104780);}return _0x49a1e1;}export function resolveAuthEnvironmentLocally(_0x129760,_0x2f4650){const _0x55d908=_0x3d6d4f,_0x4a140d=_0x129760[_0x55d908(0x1a3)];if(_0x2f4650){const _0x526bb0=_0x4a140d[_0x2f4650];if(!_0x526bb0)return null;return{'key':_0x2f4650,..._0x526bb0};}if(_0x129760[_0x55d908(0x196)]){const _0x4f4953=_0x4a140d[_0x129760[_0x55d908(0x196)]];if(!_0x4f4953)return null;return{'key':_0x129760[_0x55d908(0x196)],..._0x4f4953};}const _0x1a3fb2=Object[_0x55d908(0x18b)](_0x4a140d);if(_0x1a3fb2['length']===0x1){const _0x1af4b2=_0x1a3fb2[0x0];return{'key':_0x1af4b2,..._0x4a140d[_0x1af4b2]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x133364,_0x3aa013){const _0x242501=_0x3d6d4f;try{if(_0x3aa013)return new URL(_0x3aa013,_0x133364)[_0x242501(0x1a7)]();return new URL(_0x133364)[_0x242501(0x1a7)]();}catch{return null;}}export function looksLikeLoginUrl(_0x34d5fb){const _0x181796=_0x3d6d4f;try{const _0x676b89=new URL(_0x34d5fb);return LOGIN_URL_PATTERN['test'](_0x676b89[_0x181796(0x182)]);}catch{return LOGIN_URL_PATTERN[_0x181796(0x186)](_0x34d5fb);}}export async function isCachedSessionLive(_0x149a28,_0x547c82,_0x541a97={},_0xb7a851={}){const _0x52764e=_0x3d6d4f,_0x10c54f={'PWpde':function(_0xac8723,_0x21f37b,_0xb2dc05){return _0xac8723(_0x21f37b,_0xb2dc05);},'vBNwj':'domcontentloaded','QIuID':function(_0x65dc91,_0x474454){return _0x65dc91===_0x474454;}},_0xc1fbbc=_0x10c54f[_0x52764e(0x19c)](buildSessionCheckUrl,_0x547c82,_0x541a97['sessionCheckPath']);if(!_0xc1fbbc)return!![];if(!_0xb7a851['launchBrowser'])return!![];let _0x5e7002=null;try{_0x5e7002=await _0xb7a851[_0x52764e(0x1aa)]();const _0x28b571=await _0x5e7002['newContext']({'storageState':_0x149a28,'ignoreHTTPSErrors':!![],..._0x541a97[_0x52764e(0x18d)]?{'extraHTTPHeaders':_0x541a97['setupHeaders']}:{}}),_0x2bc35a=await _0x28b571['newPage'](),_0x56e9d0=await _0x2bc35a[_0x52764e(0x192)](_0xc1fbbc,{'waitUntil':_0x10c54f[_0x52764e(0x177)],'timeout':0x3a98}),_0x244e7d=_0x56e9d0?.[_0x52764e(0x198)]();if(_0x10c54f['QIuID'](_0x244e7d,0x191)||_0x10c54f['QIuID'](_0x244e7d,0x193))return![];const _0x103ec7=_0x2bc35a['url']();if(looksLikeLoginUrl(_0x103ec7))return![];return!![];}catch{return![];}finally{if(_0x5e7002)await _0x5e7002[_0x52764e(0x17a)]()[_0x52764e(0x183)](()=>{});}}
@@ -1 +1 @@
1
- function _0x43b5(){const _0x19b97e=['892OUBchp','final','11gDKNXL','update','setAuthTag','48igJVgZ','30nXknVI','2748662FWEbUn','heWVN','2843864xAppEx','6179388mnursL','529EkUURw','concat','9602930WvAIbJ','13xYQKdp','utf8','41136vFmnlq','9GsDnSz','sha256','574872oSJrBN'];_0x43b5=function(){return _0x19b97e;};return _0x43b5();}(function(_0x4f3df7,_0xb84a63){const _0x353c95=_0x4b1d,_0x358321=_0x4f3df7();while(!![]){try{const _0x71c3a7=-parseInt(_0x353c95(0x16a))/0x1*(-parseInt(_0x353c95(0x15f))/0x2)+parseInt(_0x353c95(0x16f))/0x3*(parseInt(_0x353c95(0x164))/0x4)+-parseInt(_0x353c95(0x165))/0x5*(-parseInt(_0x353c95(0x172))/0x6)+parseInt(_0x353c95(0x166))/0x7+-parseInt(_0x353c95(0x168))/0x8*(parseInt(_0x353c95(0x170))/0x9)+-parseInt(_0x353c95(0x16c))/0xa*(parseInt(_0x353c95(0x161))/0xb)+-parseInt(_0x353c95(0x169))/0xc*(-parseInt(_0x353c95(0x16d))/0xd);if(_0x71c3a7===_0xb84a63)break;else _0x358321['push'](_0x358321['shift']());}catch(_0x2bc27f){_0x358321['push'](_0x358321['shift']());}}}(_0x43b5,0x8a795));import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';const ALGORITHM='aes-256-gcm',SALT='ranger-auth-encryption',KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;export function deriveKey(_0x4fc89a){const _0x43456d=_0x4b1d,_0x5af91d={'RIwQO':_0x43456d(0x171)};return pbkdf2Sync(_0x4fc89a,SALT,0x186a0,KEY_LENGTH,_0x5af91d['RIwQO']);}export function encrypt(_0x4fdba4,_0x46e12f){const _0x4ce1eb=_0x4b1d,_0x3546d2={'heWVN':function(_0x1cfd9a,_0x3c8937){return _0x1cfd9a(_0x3c8937);},'jQtVq':function(_0x238c93,_0x112e89,_0x1318fe,_0xfb9d3b){return _0x238c93(_0x112e89,_0x1318fe,_0xfb9d3b);}},_0x51a6d7=_0x3546d2[_0x4ce1eb(0x167)](deriveKey,_0x46e12f),_0x315279=_0x3546d2[_0x4ce1eb(0x167)](randomBytes,IV_LENGTH),_0xba5a80=_0x3546d2['jQtVq'](createCipheriv,ALGORITHM,_0x51a6d7,_0x315279),_0x31e499=Buffer[_0x4ce1eb(0x16b)]([_0xba5a80['update'](_0x4fdba4,_0x4ce1eb(0x16e)),_0xba5a80['final']()]),_0x3702c9=_0xba5a80['getAuthTag']();return Buffer['concat']([_0x315279,_0x3702c9,_0x31e499]);}function _0x4b1d(_0x2dbd3d,_0x44c40f){_0x2dbd3d=_0x2dbd3d-0x15f;const _0x43b524=_0x43b5();let _0x4b1d20=_0x43b524[_0x2dbd3d];return _0x4b1d20;}export function decrypt(_0x1cd3c8,_0x3a3846){const _0x4ebef1=_0x4b1d,_0x5486bc={'OGPyT':function(_0x24adfd,_0x579ae8){return _0x24adfd(_0x579ae8);},'AeYaQ':function(_0x3657c7,_0x117e08){return _0x3657c7+_0x117e08;}},_0x4fe4df=_0x5486bc['OGPyT'](deriveKey,_0x3a3846),_0x26e6fc=_0x1cd3c8['subarray'](0x0,IV_LENGTH),_0x159f36=_0x1cd3c8['subarray'](IV_LENGTH,IV_LENGTH+TAG_LENGTH),_0x2d498d=_0x1cd3c8['subarray'](_0x5486bc['AeYaQ'](IV_LENGTH,TAG_LENGTH)),_0x5f0f12=createDecipheriv(ALGORITHM,_0x4fe4df,_0x26e6fc);return _0x5f0f12[_0x4ebef1(0x163)](_0x159f36),_0x5f0f12[_0x4ebef1(0x162)](_0x2d498d)+_0x5f0f12[_0x4ebef1(0x160)](_0x4ebef1(0x16e));}
1
+ const _0x3ef4e=_0x4a47;(function(_0x4e7d6c,_0x59c0ad){const _0xeedff9=_0x4a47,_0x4f762f=_0x4e7d6c();while(!![]){try{const _0x5873bf=-parseInt(_0xeedff9(0x12c))/0x1+-parseInt(_0xeedff9(0x134))/0x2*(-parseInt(_0xeedff9(0x126))/0x3)+-parseInt(_0xeedff9(0x12d))/0x4+parseInt(_0xeedff9(0x12e))/0x5+parseInt(_0xeedff9(0x130))/0x6+parseInt(_0xeedff9(0x128))/0x7+-parseInt(_0xeedff9(0x132))/0x8;if(_0x5873bf===_0x59c0ad)break;else _0x4f762f['push'](_0x4f762f['shift']());}catch(_0x56f0a8){_0x4f762f['push'](_0x4f762f['shift']());}}}(_0x255d,0xd91af));import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';const ALGORITHM=_0x3ef4e(0x12f),SALT=_0x3ef4e(0x125),KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;function _0x4a47(_0x2c461d,_0x28bca3){_0x2c461d=_0x2c461d-0x124;const _0x255ddd=_0x255d();let _0x4a47eb=_0x255ddd[_0x2c461d];return _0x4a47eb;}export function deriveKey(_0x6147c1){const _0x5b3504=_0x3ef4e,_0x54b2fc={'kmcnX':function(_0x1858f6,_0x16221a,_0x4c5e65,_0x3a5d9b,_0x5e809c,_0x533959){return _0x1858f6(_0x16221a,_0x4c5e65,_0x3a5d9b,_0x5e809c,_0x533959);}};return _0x54b2fc[_0x5b3504(0x124)](pbkdf2Sync,_0x6147c1,SALT,0x186a0,KEY_LENGTH,'sha256');}function _0x255d(){const _0x1aab5f=['setAuthTag','72WsQcyq','subarray','kmcnX','ranger-auth-encryption','66591ZVmfKS','xRDQq','105833nEffWt','final','concat','NUXsz','334863ucuIzw','271112QnfvvX','7365635MZusdT','aes-256-gcm','10091892SPhSol','PBdqE','21419328zXCvwI'];_0x255d=function(){return _0x1aab5f;};return _0x255d();}export function encrypt(_0x7d84e6,_0x51ce4f){const _0x3b3bee=_0x3ef4e,_0x5ed980={'HMfde':function(_0x447428,_0x2bcc3a){return _0x447428(_0x2bcc3a);},'PBdqE':function(_0x337584,_0x176388){return _0x337584(_0x176388);},'NUXsz':function(_0x142606,_0x5cd5e0,_0x52e2e9,_0xfe3b73){return _0x142606(_0x5cd5e0,_0x52e2e9,_0xfe3b73);}},_0x54e237=_0x5ed980['HMfde'](deriveKey,_0x51ce4f),_0xad06cd=_0x5ed980[_0x3b3bee(0x131)](randomBytes,IV_LENGTH),_0x369a6a=_0x5ed980[_0x3b3bee(0x12b)](createCipheriv,ALGORITHM,_0x54e237,_0xad06cd),_0x2b9e66=Buffer[_0x3b3bee(0x12a)]([_0x369a6a['update'](_0x7d84e6,'utf8'),_0x369a6a['final']()]),_0x257a3b=_0x369a6a['getAuthTag']();return Buffer['concat']([_0xad06cd,_0x257a3b,_0x2b9e66]);}export function decrypt(_0x301fc0,_0x2ec5e9){const _0x5a62eb=_0x3ef4e,_0x50d898={'oFYGN':function(_0x582256,_0x4f88c1){return _0x582256(_0x4f88c1);},'xRDQq':function(_0x968f77,_0x37a4a0){return _0x968f77+_0x37a4a0;}},_0x4592db=_0x50d898['oFYGN'](deriveKey,_0x2ec5e9),_0x4217c6=_0x301fc0['subarray'](0x0,IV_LENGTH),_0x4f4ea5=_0x301fc0[_0x5a62eb(0x135)](IV_LENGTH,IV_LENGTH+TAG_LENGTH),_0x4730a4=_0x301fc0['subarray'](IV_LENGTH+TAG_LENGTH),_0x4418ad=createDecipheriv(ALGORITHM,_0x4592db,_0x4217c6);return _0x4418ad[_0x5a62eb(0x133)](_0x4f4ea5),_0x50d898[_0x5a62eb(0x127)](_0x4418ad['update'](_0x4730a4),_0x4418ad[_0x5a62eb(0x129)]('utf8'));}
@@ -1 +1 @@
1
- const _0x51b558=_0x1f85;(function(_0x21f32a,_0x50780f){const _0x3b8102=_0x1f85,_0x1266ac=_0x21f32a();while(!![]){try{const _0x34d57c=parseInt(_0x3b8102(0x115))/0x1*(-parseInt(_0x3b8102(0x136))/0x2)+parseInt(_0x3b8102(0x113))/0x3+parseInt(_0x3b8102(0x137))/0x4*(-parseInt(_0x3b8102(0x142))/0x5)+-parseInt(_0x3b8102(0x141))/0x6+parseInt(_0x3b8102(0x10e))/0x7*(parseInt(_0x3b8102(0x118))/0x8)+-parseInt(_0x3b8102(0x12a))/0x9+parseInt(_0x3b8102(0x10c))/0xa*(parseInt(_0x3b8102(0x124))/0xb);if(_0x34d57c===_0x50780f)break;else _0x1266ac['push'](_0x1266ac['shift']());}catch(_0x22515e){_0x1266ac['push'](_0x1266ac['shift']());}}}(_0x47d3,0xab568));import{getToken}from'./keychain.js';function _0x1f85(_0x1b2edd,_0x499882){_0x1b2edd=_0x1b2edd-0x10c;const _0x47d33b=_0x47d3();let _0x1f851b=_0x47d33b[_0x1b2edd];return _0x1f851b;}function _0x47d3(){const _0x1f87fe=['--api-key','unknown','indexOf','EsgJQ','--pass','has','errorType','Unknown\x20argument','XCRNl','--password','DEBUG','187HKRNwn','stringify','6|1|0|7|2|3|4|5','--key','icxCo','--header','7567470QNWsTn','test','Unknown\x20command','OEAkz','SjunI','[desire-path]\x20Sending\x20log\x20to\x20','split','AmYbn','[REDACTED]','includes','Authorization','/api/v1/mcp/desire-path-logs','2IMOKMD','898316MsTWur','--credentials','xGUWx','toLowerCase','rawCommand','application/json','ZOqGY','unknown_argument','errorMessage','error','7193028IhVMKs','15FGqhaC','SIAwM','1682030VfGzpm','[desire-path]\x20Failed\x20to\x20send:\x20','8847510sxPPHa','length','Bearer\x20','POST','missing_required_argument','722259CwUiNq','syntax_error','948929LruWKt','QYzzF','push','8hCSMHq'];_0x47d3=function(){return _0x1f87fe;};return _0x47d3();}import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set(['--token','-t','--secret',_0x51b558(0x119),'--apikey',_0x51b558(0x127),_0x51b558(0x122),_0x51b558(0x11d),'--auth','--authorization',_0x51b558(0x129),'--cookie',_0x51b558(0x138)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0x5e831c){const _0x2c5312=_0x51b558;return TOKEN_PATTERNS['some'](_0x3d01bb=>_0x3d01bb[_0x2c5312(0x12b)](_0x5e831c));}export function sanitizeArgs(_0x55b77e){const _0x414f74=_0x51b558,_0x376440={'EsgJQ':function(_0x88be00,_0x562e1e){return _0x88be00<_0x562e1e;},'AmYbn':_0x414f74(0x132),'SIAwM':function(_0x558d35,_0x53a4ab){return _0x558d35!==_0x53a4ab;}},_0x2bb340=[];let _0x54106d=![];for(let _0x342482=0x0;_0x376440[_0x414f74(0x11c)](_0x342482,_0x55b77e[_0x414f74(0x10f)]);_0x342482++){const _0x1d7872=_0x55b77e[_0x342482];if(_0x54106d){_0x2bb340['push'](_0x376440['AmYbn']),_0x54106d=![];continue;}if(_0x1d7872['startsWith']('--')||_0x1d7872['startsWith']('-')){const _0x30948f=_0x1d7872[_0x414f74(0x11b)]('=');if(_0x376440[_0x414f74(0x143)](_0x30948f,-0x1)){const _0x395b64=_0x1d7872['slice'](0x0,_0x30948f)['toLowerCase']();if(SENSITIVE_FLAGS[_0x414f74(0x11e)](_0x395b64)){_0x2bb340['push'](_0x1d7872['slice'](0x0,_0x30948f)+'=[REDACTED]');continue;}}else{const _0x4826f9=_0x1d7872[_0x414f74(0x13a)]();SENSITIVE_FLAGS['has'](_0x4826f9)&&(_0x54106d=!![]);}_0x2bb340[_0x414f74(0x117)](_0x1d7872);}else looksLikeToken(_0x1d7872)?_0x2bb340[_0x414f74(0x117)](_0x376440[_0x414f74(0x131)]):_0x2bb340[_0x414f74(0x117)](_0x1d7872);}return _0x2bb340['join']('\x20');}export async function logDesirePath(_0x1c911e){const _0x5d6672=_0x51b558,_0x1f0a47={'YrEGp':function(_0x458cca){return _0x458cca();},'QYzzF':function(_0x4d3540){return _0x4d3540();},'ZOqGY':_0x5d6672(0x134),'SjunI':_0x5d6672(0x111)};try{const _0x258a8f=await _0x1f0a47['YrEGp'](getToken)['catch'](()=>null),_0x24f8d0=_0x1f0a47[_0x5d6672(0x116)](getApiBaseUrl),_0x3f6645=getCurrentVersion(),_0x327f2c=_0x258a8f?'has_token':'no_token',_0x378f85={..._0x1c911e['metadata'],'authStatus':_0x327f2c,'isTty':process['stdout']['isTTY']??![]},_0x3ed609={'Content-Type':_0x5d6672(0x13c)};_0x258a8f&&(_0x3ed609[_0x1f0a47[_0x5d6672(0x13d)]]=_0x5d6672(0x110)+_0x258a8f);const _0x3524fa={'rawCommand':_0x1c911e[_0x5d6672(0x13b)],'errorMessage':_0x1c911e[_0x5d6672(0x13f)],'errorType':_0x1c911e[_0x5d6672(0x11f)],'featureId':_0x1c911e['featureId'],'sessionId':_0x1c911e['sessionId'],'metadata':_0x378f85,'cliVersion':_0x3f6645};process['env'][_0x5d6672(0x123)]&&(console[_0x5d6672(0x140)](_0x5d6672(0x12f)+_0x24f8d0+'/api/v1/mcp/desire-path-logs'),console[_0x5d6672(0x140)]('[desire-path]\x20Payload:\x20'+JSON[_0x5d6672(0x125)](_0x3524fa,null,0x2))),await fetch(_0x24f8d0+_0x5d6672(0x135),{'method':_0x1f0a47[_0x5d6672(0x12e)],'headers':_0x3ed609,'body':JSON['stringify'](_0x3524fa)});}catch(_0x120566){process['env']['DEBUG']&&console['error'](_0x5d6672(0x10d)+_0x120566);}}export function getErrorType(_0x18ea3d,_0x4391c6){const _0x363f0a=_0x51b558,_0x89499={'OEAkz':_0x363f0a(0x126),'bTLno':'Not\x20enough\x20non-option\x20arguments','faxKn':_0x363f0a(0x112),'zVxoZ':'Invalid\x20values','TcdgU':'invalid_option_value','XCRNl':'missing_option','AbGzD':_0x363f0a(0x114),'icxCo':'runtime_error','xGUWx':_0x363f0a(0x120)},_0x4e7ed0=_0x89499[_0x363f0a(0x12d)][_0x363f0a(0x130)]('|');let _0x2534c7=0x0;while(!![]){switch(_0x4e7ed0[_0x2534c7++]){case'0':if(_0x18ea3d['includes'](_0x363f0a(0x12c)))return'unknown_command';continue;case'1':if(!_0x18ea3d)return _0x363f0a(0x11a);continue;case'2':if(_0x18ea3d[_0x363f0a(0x133)](_0x89499['bTLno']))return _0x89499['faxKn'];continue;case'3':if(_0x18ea3d['includes'](_0x89499['zVxoZ']))return _0x89499['TcdgU'];continue;case'4':if(_0x18ea3d[_0x363f0a(0x133)]('Missing\x20required\x20argument'))return _0x89499[_0x363f0a(0x121)];continue;case'5':return _0x89499['AbGzD'];case'6':if(_0x4391c6)return _0x89499[_0x363f0a(0x128)];continue;case'7':if(_0x18ea3d['includes'](_0x89499[_0x363f0a(0x139)]))return _0x363f0a(0x13e);continue;}break;}}
1
+ const _0x54b5b5=_0x38d2;(function(_0x5b2862,_0x56fefb){const _0x41ceb7=_0x38d2,_0x1bef5b=_0x5b2862();while(!![]){try{const _0x1d0284=-parseInt(_0x41ceb7(0x1a1))/0x1*(parseInt(_0x41ceb7(0x1ab))/0x2)+parseInt(_0x41ceb7(0x18c))/0x3*(-parseInt(_0x41ceb7(0x1b2))/0x4)+-parseInt(_0x41ceb7(0x183))/0x5+parseInt(_0x41ceb7(0x198))/0x6+-parseInt(_0x41ceb7(0x199))/0x7+-parseInt(_0x41ceb7(0x194))/0x8*(parseInt(_0x41ceb7(0x190))/0x9)+-parseInt(_0x41ceb7(0x17e))/0xa*(-parseInt(_0x41ceb7(0x17b))/0xb);if(_0x1d0284===_0x56fefb)break;else _0x1bef5b['push'](_0x1bef5b['shift']());}catch(_0x1da7a6){_0x1bef5b['push'](_0x1bef5b['shift']());}}}(_0x1037,0x3ff97));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set(['--token','-t','--secret',_0x54b5b5(0x19c),'--apikey',_0x54b5b5(0x1aa),_0x54b5b5(0x1af),'--pass','--auth','--authorization','--header',_0x54b5b5(0x19a),_0x54b5b5(0x1a4)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function _0x38d2(_0x33ff63,_0x127afd){_0x33ff63=_0x33ff63-0x17a;const _0x10372b=_0x1037();let _0x38d2d7=_0x10372b[_0x33ff63];return _0x38d2d7;}function looksLikeToken(_0x2157cb){const _0x460075=_0x54b5b5;return TOKEN_PATTERNS['some'](_0x253edd=>_0x253edd[_0x460075(0x17f)](_0x2157cb));}export function sanitizeArgs(_0x596187){const _0x1d3824=_0x54b5b5,_0x32fbd9={'egusX':function(_0x434197,_0x2b2092){return _0x434197<_0x2b2092;},'TyKaf':'[REDACTED]','nwhku':function(_0x494bb7,_0x48224f){return _0x494bb7!==_0x48224f;}},_0x13444a=[];let _0x4cb76f=![];for(let _0x599a2c=0x0;_0x32fbd9['egusX'](_0x599a2c,_0x596187[_0x1d3824(0x184)]);_0x599a2c++){const _0x421180=_0x596187[_0x599a2c];if(_0x4cb76f){_0x13444a['push'](_0x32fbd9[_0x1d3824(0x18f)]),_0x4cb76f=![];continue;}if(_0x421180[_0x1d3824(0x17a)]('--')||_0x421180['startsWith']('-')){const _0x340bef=_0x421180['indexOf']('=');if(_0x32fbd9['nwhku'](_0x340bef,-0x1)){const _0x320a09=_0x421180['slice'](0x0,_0x340bef)[_0x1d3824(0x191)]();if(SENSITIVE_FLAGS['has'](_0x320a09)){_0x13444a['push'](_0x421180[_0x1d3824(0x1b7)](0x0,_0x340bef)+'=[REDACTED]');continue;}}else{const _0x205e78=_0x421180['toLowerCase']();SENSITIVE_FLAGS[_0x1d3824(0x197)](_0x205e78)&&(_0x4cb76f=!![]);}_0x13444a['push'](_0x421180);}else looksLikeToken(_0x421180)?_0x13444a[_0x1d3824(0x1b6)](_0x32fbd9['TyKaf']):_0x13444a['push'](_0x421180);}return _0x13444a['join']('\x20');}export async function logDesirePath(_0x25cb2f){const _0x407aaa=_0x54b5b5,_0x4b4210={'LvFNs':function(_0x36ae18){return _0x36ae18();},'jqFXw':function(_0x11cf44){return _0x11cf44();},'ALIES':_0x407aaa(0x195),'OifRB':_0x407aaa(0x19b),'DfrkJ':function(_0x9ca0e,_0x4be778,_0x2a93ad){return _0x9ca0e(_0x4be778,_0x2a93ad);},'DXRHU':'POST'};try{const _0x17f068=await getToken()[_0x407aaa(0x192)](()=>null),_0x348351=_0x4b4210[_0x407aaa(0x186)](getApiBaseUrl),_0x1a5f3c=_0x4b4210['jqFXw'](getCurrentVersion),_0x4eaf33=_0x17f068?_0x4b4210[_0x407aaa(0x1a5)]:_0x4b4210[_0x407aaa(0x19d)],_0x13cfeb={..._0x25cb2f[_0x407aaa(0x188)],'authStatus':_0x4eaf33,'isTty':process[_0x407aaa(0x17d)]['isTTY']??![]},_0x2c6199={'Content-Type':_0x407aaa(0x189)};_0x17f068&&(_0x2c6199[_0x407aaa(0x1ac)]=_0x407aaa(0x182)+_0x17f068);const _0x1386aa={'rawCommand':_0x25cb2f[_0x407aaa(0x1b3)],'errorMessage':_0x25cb2f['errorMessage'],'errorType':_0x25cb2f[_0x407aaa(0x18d)],'featureId':_0x25cb2f[_0x407aaa(0x1b1)],'sessionId':_0x25cb2f['sessionId'],'metadata':_0x13cfeb,'cliVersion':_0x1a5f3c};process['env']['DEBUG']&&(console['error'](_0x407aaa(0x19e)+_0x348351+'/api/v1/mcp/desire-path-logs'),console['error']('[desire-path]\x20Payload:\x20'+JSON[_0x407aaa(0x181)](_0x1386aa,null,0x2))),await _0x4b4210[_0x407aaa(0x196)](fetch,_0x348351+_0x407aaa(0x1a2),{'method':_0x4b4210[_0x407aaa(0x187)],'headers':_0x2c6199,'body':JSON[_0x407aaa(0x181)](_0x1386aa)});}catch(_0x39677e){process[_0x407aaa(0x1ad)][_0x407aaa(0x1ae)]&&console['error'](_0x407aaa(0x18a)+_0x39677e);}}function _0x1037(){const _0xa57b8d=['missing_required_argument','ouBXw','7ZyEpiF','/api/v1/mcp/desire-path-logs','unknown','--credentials','ALIES','unknown_argument','7|3|1|2|6|4|0|5','Missing\x20required\x20argument','syntax_error','--key','67862DRgCqi','Authorization','env','DEBUG','--password','Unknown\x20command','featureId','68TjpVOm','rawCommand','Invalid\x20values','Unknown\x20argument','push','slice','startsWith','3036781nmKuDU','split','stdout','50NRVDxY','test','mPgPF','stringify','Bearer\x20','1468325XBoZhT','length','runtime_error','LvFNs','DXRHU','metadata','application/json','[desire-path]\x20Failed\x20to\x20send:\x20','unknown_command','82014nhIljV','errorType','rhfeQ','TyKaf','9uYQJIl','toLowerCase','catch','Not\x20enough\x20non-option\x20arguments','576584hOHpou','has_token','DfrkJ','has','1506546LAaICl','2109842gCvpGe','--cookie','no_token','--api-key','OifRB','[desire-path]\x20Sending\x20log\x20to\x20'];_0x1037=function(){return _0xa57b8d;};return _0x1037();}export function getErrorType(_0x38fa81,_0x43a94d){const _0x471a6f=_0x54b5b5,_0x43d35e={'rhfeQ':_0x471a6f(0x1a7),'KBvdT':'missing_option','ouBXw':_0x471a6f(0x1b5),'EkvGk':_0x471a6f(0x1a3),'mPgPF':_0x471a6f(0x1a9)},_0x34b080=_0x43d35e[_0x471a6f(0x18e)][_0x471a6f(0x17c)]('|');let _0x122bf8=0x0;while(!![]){switch(_0x34b080[_0x122bf8++]){case'0':if(_0x38fa81['includes'](_0x471a6f(0x1a8)))return _0x43d35e['KBvdT'];continue;case'1':if(_0x38fa81['includes'](_0x471a6f(0x1b0)))return _0x471a6f(0x18b);continue;case'2':if(_0x38fa81['includes'](_0x43d35e[_0x471a6f(0x1a0)]))return _0x471a6f(0x1a6);continue;case'3':if(!_0x38fa81)return _0x43d35e['EkvGk'];continue;case'4':if(_0x38fa81['includes'](_0x471a6f(0x1b4)))return'invalid_option_value';continue;case'5':return _0x43d35e[_0x471a6f(0x180)];case'6':if(_0x38fa81['includes'](_0x471a6f(0x193)))return _0x471a6f(0x19f);continue;case'7':if(_0x43a94d)return _0x471a6f(0x185);continue;}break;}}
@@ -1 +1 @@
1
- const _0x35f5fa=_0x1326;(function(_0x55fafb,_0x2eee82){const _0x270b2f=_0x1326,_0x4bceae=_0x55fafb();while(!![]){try{const _0x56d632=-parseInt(_0x270b2f(0xe4))/0x1+-parseInt(_0x270b2f(0xd2))/0x2+parseInt(_0x270b2f(0xaa))/0x3+parseInt(_0x270b2f(0xb4))/0x4*(parseInt(_0x270b2f(0xbb))/0x5)+-parseInt(_0x270b2f(0xdf))/0x6+-parseInt(_0x270b2f(0xaf))/0x7*(parseInt(_0x270b2f(0x99))/0x8)+parseInt(_0x270b2f(0xde))/0x9;if(_0x56d632===_0x2eee82)break;else _0x4bceae['push'](_0x4bceae['shift']());}catch(_0x58c395){_0x4bceae['push'](_0x4bceae['shift']());}}}(_0x27f8,0x4a083));import{spawn}from'child_process';import _0x49d03c from'inquirer';function _0x27f8(){const _0x1e9b65=['JAXSa','Authentication\x20failed','cIGWX','CXtvy','prompt','darwin','json','application/x-www-form-urlencoded','xdg-open','Code:\x20','Provisioning\x20CLI\x20token...','NtYqt','start','urn:ietf:params:oauth:grant-type:device_code','MRXFh','614470hlUZrc','https://api.workos.com/user_management/authorize/device','Failed\x20to\x20provision\x20CLI\x20token:\x20','error_description','startsWith','email','now','Device\x20authorization\x20timed\x20out','oeDxf','Select\x20an\x20organization:','QOYxP','EioSP','7021620XkwYEc','1820946ZuQJAH','https://api.workos.com/user_management/authenticate','mcp:write','list','application/json','45394SqVKYD','jvHCq','39128CGXJyD','\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','access_token','PevOe','ZrYoB','/organization/my-memberships','platform','Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','split','Setting\x20up\x20your\x20organization...','name','/organization/me','lPtrE','isTTY','unref','refresh_token','oOJSQ','1662183jUENAV','/cli-auth/token','apiKeys','status','log','679rEaLKD','Failed\x20to\x20provision\x20API\x20key:\x20','Waiting\x20for\x20authentication...','write','stdout','4PMFMrT','efHHa','stdin','from','firstName','error','CLI\x20Key','497705qgQdPM','text','GET','length','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20','POST','StbQo','MbMOr'];_0x27f8=function(){return _0x1e9b65;};return _0x27f8();}import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL=_0x35f5fa(0xd3),WORKOS_TOKEN_URL=_0x35f5fa(0xe0);export async function requestDeviceCode(_0x4899fc){const _0x468711=_0x35f5fa,_0x5964c9={'ZrYoB':'POST'},_0x5302af=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x5964c9[_0x468711(0x9d)],'headers':{'Content-Type':_0x468711(0xca)},'body':new URLSearchParams({'client_id':_0x4899fc})});if(!_0x5302af['ok']){const _0x4aa853=await _0x5302af[_0x468711(0xbc)]();throw new Error('Failed\x20to\x20request\x20device\x20code:\x20'+_0x5302af[_0x468711(0xad)]+'\x20'+_0x4aa853);}return _0x5302af[_0x468711(0xc9)]();}export async function pollForTokens(_0x5a42c3,_0x56b2a1,_0x43e13b,_0x2cbb3d){const _0x2eb372=_0x35f5fa,_0x5535b9={'lqtlh':function(_0x25fc7d,_0x22ec2f){return _0x25fc7d<_0x22ec2f;},'XajrR':function(_0x2e1117,_0x3fadd7){return _0x2e1117(_0x3fadd7);},'NTmjY':'POST','fOasf':_0x2eb372(0xc4)},_0xcf0f30=Date[_0x2eb372(0xd8)]()+_0x2cbb3d*0x3e8;let _0x5be519=_0x43e13b*0x3e8;while(_0x5535b9['lqtlh'](Date['now'](),_0xcf0f30)){await _0x5535b9['XajrR'](sleep,_0x5be519);const _0x4d25e8=await fetch(WORKOS_TOKEN_URL,{'method':_0x5535b9['NTmjY'],'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0x5a42c3,'device_code':_0x56b2a1,'grant_type':_0x2eb372(0xd0)})});if(_0x4d25e8['ok'])return _0x4d25e8['json']();const _0x50fb74=await _0x4d25e8[_0x2eb372(0xc9)]();if(_0x50fb74[_0x2eb372(0xb9)]==='authorization_pending')continue;if(_0x50fb74['error']==='slow_down'){_0x5be519+=0x3e8;continue;}throw new Error(_0x50fb74[_0x2eb372(0xd5)]||_0x50fb74['error']||_0x5535b9['fOasf']);}throw new Error(_0x2eb372(0xd9));}async function fetchUserProfile(_0x4bb9e2){const _0x56462e=_0x35f5fa,_0x1e3705={'GlqEf':_0x56462e(0xbd)},_0x53e46a=getApiBaseUrl();try{const _0x5d9572=await fetch(_0x53e46a+_0x56462e(0xa4),{'method':_0x1e3705['GlqEf'],'headers':{'workos-token':_0x4bb9e2}});if(_0x5d9572['ok'])return _0x5d9572['json']();}catch{}return null;}function buildKeyName(_0x39fe65,_0x4340a7){const _0x1eec94=_0x35f5fa,_0x4f09db=_0x4340a7['filter'](_0x2eefee=>_0x2eefee['name']===_0x39fe65||_0x2eefee['name'][_0x1eec94(0xd6)](_0x39fe65+'\x20('));if(_0x4f09db[_0x1eec94(0xbe)]===0x0)return _0x39fe65;return _0x39fe65+'\x20('+(_0x4f09db[_0x1eec94(0xbe)]+0x1)+')';}export async function provisionApiKey(_0x3332a4){const _0x38ba7e=_0x35f5fa,_0x55807f={'MRXFh':'application/json','EioSP':_0x38ba7e(0xba),'oeDxf':function(_0x8eb1f1,_0x2a2caf,_0x47eb45){return _0x8eb1f1(_0x2a2caf,_0x47eb45);}},_0x3bcfc8=getApiBaseUrl(),_0xe84d27={'Content-Type':_0x55807f[_0x38ba7e(0xd1)],'workos-token':_0x3332a4},_0xf396f3=await fetchUserProfile(_0x3332a4),_0x1fac8e=_0xf396f3?.[_0x38ba7e(0xb8)]||_0xf396f3?.[_0x38ba7e(0xd7)]?.['split']('@')[0x0],_0x478b58=_0x1fac8e?_0x1fac8e+'\x27s\x20CLI\x20Key':_0x55807f[_0x38ba7e(0xdd)];let _0x19c7aa=[];try{const _0x58b341=await _0x55807f[_0x38ba7e(0xda)](fetch,_0x3bcfc8+'/api-keys',{'method':'GET','headers':_0xe84d27});if(_0x58b341['ok']){const _0x14ada1=await _0x58b341[_0x38ba7e(0xc9)]();_0x19c7aa=_0x14ada1[_0x38ba7e(0xac)];}}catch{}const _0x310eb9=buildKeyName(_0x478b58,_0x19c7aa),_0xd5516c=await fetch(_0x3bcfc8+'/api-keys',{'method':'POST','headers':_0xe84d27,'body':JSON['stringify']({'name':_0x310eb9,'scope':_0x38ba7e(0xe1)})});if(!_0xd5516c['ok']){const _0x384001=await _0xd5516c[_0x38ba7e(0xbc)]();throw new Error(_0x38ba7e(0xb0)+_0xd5516c[_0x38ba7e(0xad)]+'\x20'+_0x384001);}const _0x1c5459=await _0xd5516c[_0x38ba7e(0xc9)]();return _0x1c5459['apiKey']['token'];}export function openBrowser(_0x3580ac){const _0x42b8ac=_0x35f5fa,_0x27af92={'jvHCq':function(_0x2afbe8,_0x2681bb){return _0x2afbe8===_0x2681bb;},'CXtvy':'win32'};try{if(_0x27af92[_0x42b8ac(0xe5)](process[_0x42b8ac(0x9f)],_0x27af92[_0x42b8ac(0xc6)])){const _0x1f0cd4=spawn('cmd',['/c',_0x42b8ac(0xcf),'',_0x3580ac],{'detached':!![],'stdio':'ignore','windowsHide':!![]});_0x1f0cd4[_0x42b8ac(0xa7)]();return;}const _0x8931ee=process[_0x42b8ac(0x9f)]===_0x42b8ac(0xc8)?'open':_0x42b8ac(0xcb),_0x5841e0=spawn(_0x8931ee,[_0x3580ac],{'detached':!![],'stdio':'ignore'});_0x5841e0[_0x42b8ac(0xa7)]();}catch{}}function decodeJwtPayload(_0x270049){const _0x1a75c7=_0x35f5fa,_0xf5c673={'VrmKD':'Invalid\x20JWT\x20format','efHHa':'base64url'},_0x4b9a5b=_0x270049[_0x1a75c7(0xa1)]('.');if(_0x4b9a5b[_0x1a75c7(0xbe)]!==0x3)throw new Error(_0xf5c673['VrmKD']);const _0x2382b0=Buffer[_0x1a75c7(0xb7)](_0x4b9a5b[0x1],_0xf5c673[_0x1a75c7(0xb5)])['toString']('utf-8');return JSON['parse'](_0x2382b0);}async function selfServeSignup(_0xb71e23){const _0x45eaac=_0x35f5fa,_0x2d78fe={'dIwAk':function(_0x31ec5a){return _0x31ec5a();},'QOYxP':function(_0x33d899,_0x4c8dec,_0x3c8c62){return _0x33d899(_0x4c8dec,_0x3c8c62);},'NtYqt':_0x45eaac(0xe3)},_0x4631f3=_0x2d78fe['dIwAk'](getApiBaseUrl),_0x2835ca=await _0x2d78fe[_0x45eaac(0xdc)](fetch,_0x4631f3+'/organization/self-serve-signup',{'method':_0x45eaac(0xc0),'headers':{'Content-Type':_0x2d78fe[_0x45eaac(0xce)],'workos-token':_0xb71e23}});if(!_0x2835ca['ok']){const _0x1b800c=await _0x2835ca['text']();throw new Error('Failed\x20to\x20create\x20organization:\x20'+_0x2835ca[_0x45eaac(0xad)]+'\x20'+_0x1b800c);}return _0x2835ca[_0x45eaac(0xc9)]();}async function fetchMyMemberships(_0x110317){const _0x4e36f6=_0x35f5fa,_0x22629d={'edVfH':function(_0x34cb5f,_0x1e0bb0,_0x296f29){return _0x34cb5f(_0x1e0bb0,_0x296f29);},'ooVpS':_0x4e36f6(0xbd)},_0x36fbef=getApiBaseUrl(),_0x58e5d7=await _0x22629d['edVfH'](fetch,_0x36fbef+_0x4e36f6(0x9e),{'method':_0x22629d['ooVpS'],'headers':{'workos-token':_0x110317}});if(!_0x58e5d7['ok']){const _0x4f3691=await _0x58e5d7[_0x4e36f6(0xbc)]();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0x58e5d7['status']+'\x20'+_0x4f3691);}const _0x104307=await _0x58e5d7[_0x4e36f6(0xc9)]();return _0x104307['memberships'];}async function refreshTokenWithOrg(_0x1baf9f,_0x486c2e,_0x1d5415){const _0x1a48e5=_0x35f5fa,_0x49b20b={'OWnxG':'application/x-www-form-urlencoded'},_0x2b8527=await fetch(WORKOS_TOKEN_URL,{'method':_0x1a48e5(0xc0),'headers':{'Content-Type':_0x49b20b['OWnxG']},'body':new URLSearchParams({'client_id':_0x1baf9f,'grant_type':_0x1a48e5(0xa8),'refresh_token':_0x486c2e,'organization_id':_0x1d5415})});if(!_0x2b8527['ok']){const _0x5ef18e=await _0x2b8527[_0x1a48e5(0xbc)]();throw new Error(_0x1a48e5(0xbf)+_0x2b8527['status']+'\x20'+_0x5ef18e);}return _0x2b8527['json']();}async function provisionCliToken(_0x859233){const _0xed9a46=_0x35f5fa,_0x49a7c3={'MbMOr':function(_0x5d5e5f,_0x3227f8,_0x3ddf8a){return _0x5d5e5f(_0x3227f8,_0x3ddf8a);},'jZGSC':'application/json'},_0x4a4b03=getApiBaseUrl(),_0x252cd9=await _0x49a7c3[_0xed9a46(0xc2)](fetch,_0x4a4b03+_0xed9a46(0xab),{'method':'POST','headers':{'Content-Type':_0x49a7c3['jZGSC'],'workos-token':_0x859233}});if(!_0x252cd9['ok']){const _0x26e7b5=await _0x252cd9[_0xed9a46(0xbc)]();throw new Error(_0xed9a46(0xd4)+_0x252cd9[_0xed9a46(0xad)]+'\x20'+_0x26e7b5);}return _0x252cd9[_0xed9a46(0xc9)]();}function _0x1326(_0x2ae7f7,_0x1741c1){_0x2ae7f7=_0x2ae7f7-0x99;const _0x27f8a6=_0x27f8();let _0x132622=_0x27f8a6[_0x2ae7f7];return _0x132622;}export async function runDeviceAuthFlow(){const _0x55ebc1=_0x35f5fa,_0x490665={'StbQo':function(_0x98c237,_0x25e8f7){return _0x98c237(_0x25e8f7);},'lPtrE':_0x55ebc1(0x9a),'qttAG':function(_0x33e5a8,_0x146744,_0x516790,_0x3cc21f,_0x3063c9){return _0x33e5a8(_0x146744,_0x516790,_0x3cc21f,_0x3063c9);},'JAXSa':function(_0xfe5a10,_0x2c4713){return _0xfe5a10===_0x2c4713;},'cIGWX':_0x55ebc1(0xa2),'PevOe':_0x55ebc1(0xa0),'CIGWj':_0x55ebc1(0xe2),'oOJSQ':_0x55ebc1(0xdb),'fnuhu':function(_0x36de9f,_0x5847df,_0xa828,_0x4cb67b){return _0x36de9f(_0x5847df,_0xa828,_0x4cb67b);},'DyyFV':_0x55ebc1(0xcd),'qAwLH':function(_0xcac18d,_0x58cbfe){return _0xcac18d(_0x58cbfe);}},_0x4e3937=getCurrentEnvironment(),_0x469068=ENVIRONMENT_CONFIGS[_0x4e3937]['workosClientId'],_0x3004dd=await _0x490665[_0x55ebc1(0xc1)](requestDeviceCode,_0x469068);console['log'](_0x490665[_0x55ebc1(0xa5)]),console['log']('\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a'),openBrowser(_0x3004dd['verification_uri_complete']),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x3004dd['verification_uri_complete']),console['log'](_0x55ebc1(0xcc)+_0x3004dd['user_code']+'\x0a'),process['stdout']['write'](_0x55ebc1(0xb1));let _0x4afa3a=await _0x490665['qttAG'](pollForTokens,_0x469068,_0x3004dd['device_code'],_0x3004dd['interval'],_0x3004dd['expires_in']);console['log']('\x20✓');const _0x2ba264=decodeJwtPayload(_0x4afa3a[_0x55ebc1(0x9b)]);if(!_0x2ba264['org_id']){const _0x3d6a31=await fetchMyMemberships(_0x4afa3a[_0x55ebc1(0x9b)]);let _0x57cdf3;if(_0x490665[_0x55ebc1(0xc3)](_0x3d6a31['length'],0x0)){process[_0x55ebc1(0xb3)][_0x55ebc1(0xb2)](_0x490665[_0x55ebc1(0xc5)]);const _0x4e9671=await selfServeSignup(_0x4afa3a[_0x55ebc1(0x9b)]);_0x57cdf3=_0x4e9671['organizationId'],console[_0x55ebc1(0xae)]('\x20✓');}else{if(_0x3d6a31[_0x55ebc1(0xbe)]===0x1)_0x57cdf3=_0x3d6a31[0x0]['organizationId'],console['log']('Using\x20organization:\x20'+_0x3d6a31[0x0][_0x55ebc1(0xa3)]);else{const _0x389444=process[_0x55ebc1(0xb6)]['isTTY']&&process['stdout'][_0x55ebc1(0xa6)];if(!_0x389444)throw new Error('Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a'+_0x490665[_0x55ebc1(0x9c)]);const {selected:_0x4ce02a}=await _0x49d03c[_0x55ebc1(0xc7)]([{'type':_0x490665['CIGWj'],'name':'selected','message':_0x490665[_0x55ebc1(0xa9)],'choices':_0x3d6a31['map'](_0x2bd0e4=>({'name':_0x2bd0e4[_0x55ebc1(0xa3)],'value':_0x2bd0e4['organizationId']}))}]);_0x57cdf3=_0x4ce02a;}}_0x4afa3a=await _0x490665['fnuhu'](refreshTokenWithOrg,_0x469068,_0x4afa3a[_0x55ebc1(0xa8)],_0x57cdf3);}process[_0x55ebc1(0xb3)][_0x55ebc1(0xb2)](_0x490665['DyyFV']);const _0xac7ea7=await provisionCliToken(_0x4afa3a['access_token']);return console[_0x55ebc1(0xae)]('\x20✓'),await _0x490665['StbQo'](storeToken,_0xac7ea7['token']),_0x4afa3a['refresh_token']&&await _0x490665['qAwLH'](storeRefreshToken,_0x4afa3a['refresh_token']),_0xac7ea7['token'];}function sleep(_0x4557b2){return new Promise(_0x412674=>setTimeout(_0x412674,_0x4557b2));}
1
+ function _0x1d73(_0x365b6b,_0x1ef2d5){_0x365b6b=_0x365b6b-0x1ee;const _0x5934fd=_0x5934();let _0x1d7394=_0x5934fd[_0x365b6b];return _0x1d7394;}(function(_0x540e00,_0x3c6e79){const _0x42db97=_0x1d73,_0xce2be=_0x540e00();while(!![]){try{const _0x33497e=parseInt(_0x42db97(0x21a))/0x1+-parseInt(_0x42db97(0x23c))/0x2+-parseInt(_0x42db97(0x242))/0x3*(parseInt(_0x42db97(0x240))/0x4)+-parseInt(_0x42db97(0x227))/0x5*(-parseInt(_0x42db97(0x1f4))/0x6)+-parseInt(_0x42db97(0x1f1))/0x7*(-parseInt(_0x42db97(0x1f5))/0x8)+parseInt(_0x42db97(0x211))/0x9+parseInt(_0x42db97(0x228))/0xa;if(_0x33497e===_0x3c6e79)break;else _0xce2be['push'](_0xce2be['shift']());}catch(_0x5635e2){_0xce2be['push'](_0xce2be['shift']());}}}(_0x5934,0xcc950));import{spawn}from'child_process';import _0x4895df from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';function _0x5934(){const _0x3d7203=['length','cHnuH','UZPre','token','unref','platform','device_code','slow_down','cummx','text','darwin','status','2246148UoJLnk','win32','LMGWM','urn:ietf:params:oauth:grant-type:device_code','firstName','EnFwi','Failed\x20to\x20provision\x20CLI\x20token:\x20','/cli-auth/token','\x27s\x20CLI\x20Key','422547HofiWw','DnowL','QHmPW','Failed\x20to\x20fetch\x20memberships:\x20','/organization/my-memberships','log','org_id','refresh_token','authorization_pending','xdg-open','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','/organization/me','POST','6296810UAcNPV','13547790uNRXAJ','apiKeys','base64url','oTUwi','NowHo','split','GET','list','cXIuV','Provisioning\x20CLI\x20token...','isTTY','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20','error','start','application/x-www-form-urlencoded','vOrVg','BStAH','startsWith','stdout','FwflA','2895906ToRbzI','Invalid\x20JWT\x20format','mcp:write','FtuIa','6352bjUgMQ','json','3102WZedaL','prompt','write','open','FzjRP','organizationId','7YCTBzT','interval','filter','6pPXotN','5133224YSWXJJ','name','Select\x20an\x20organization:','vONmt','application/json','beVke','utf-8','AcbpO','yAUds','apiKey','from','KYaQC','QkUbz','now','WXMMj','email'];_0x5934=function(){return _0x3d7203;};return _0x5934();}const WORKOS_DEVICE_AUTH_URL='https://api.workos.com/user_management/authorize/device',WORKOS_TOKEN_URL='https://api.workos.com/user_management/authenticate';export async function requestDeviceCode(_0x14edcb){const _0x24c7bf=_0x1d73,_0x244acb={'yAUds':_0x24c7bf(0x236)},_0x25f713=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':'POST','headers':{'Content-Type':_0x244acb[_0x24c7bf(0x1fd)]},'body':new URLSearchParams({'client_id':_0x14edcb})});if(!_0x25f713['ok']){const _0x255f35=await _0x25f713['text']();throw new Error('Failed\x20to\x20request\x20device\x20code:\x20'+_0x25f713['status']+'\x20'+_0x255f35);}return _0x25f713[_0x24c7bf(0x241)]();}export async function pollForTokens(_0x15bb67,_0x1d8591,_0x33e5f4,_0x767679){const _0x8a4e3=_0x1d73,_0x39abd5={'VXHFJ':function(_0x1c323f,_0x2bc28f){return _0x1c323f+_0x2bc28f;},'cXIuV':function(_0x2eb45b,_0x442403){return _0x2eb45b*_0x442403;},'UZPre':function(_0x2a8a40,_0x3432be){return _0x2a8a40(_0x3432be);},'YVkkb':function(_0x41c640,_0x5e2fa6,_0x31589c){return _0x41c640(_0x5e2fa6,_0x31589c);},'quqUR':_0x8a4e3(0x236),'FzjRP':_0x8a4e3(0x222),'pyuaS':_0x8a4e3(0x20c)},_0xcccd9=_0x39abd5['VXHFJ'](Date[_0x8a4e3(0x202)](),_0x39abd5[_0x8a4e3(0x230)](_0x767679,0x3e8));let _0x1fc5d9=_0x33e5f4*0x3e8;while(Date['now']()<_0xcccd9){await _0x39abd5[_0x8a4e3(0x207)](sleep,_0x1fc5d9);const _0x7da2c9=await _0x39abd5['YVkkb'](fetch,WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':_0x39abd5['quqUR']},'body':new URLSearchParams({'client_id':_0x15bb67,'device_code':_0x1d8591,'grant_type':_0x8a4e3(0x214)})});if(_0x7da2c9['ok'])return _0x7da2c9['json']();const _0x2ba47d=await _0x7da2c9[_0x8a4e3(0x241)]();if(_0x2ba47d['error']===_0x39abd5[_0x8a4e3(0x1ef)])continue;if(_0x2ba47d[_0x8a4e3(0x234)]===_0x39abd5['pyuaS']){_0x1fc5d9+=0x3e8;continue;}throw new Error(_0x2ba47d['error_description']||_0x2ba47d['error']||'Authentication\x20failed');}throw new Error('Device\x20authorization\x20timed\x20out');}async function fetchUserProfile(_0x89c1ce){const _0x36fb22=_0x1d73,_0x287586=getApiBaseUrl();try{const _0x5d30eb=await fetch(_0x287586+_0x36fb22(0x225),{'method':_0x36fb22(0x22e),'headers':{'workos-token':_0x89c1ce}});if(_0x5d30eb['ok'])return _0x5d30eb['json']();}catch{}return null;}function buildKeyName(_0x532cd7,_0x5a5f02){const _0x55f849=_0x1d73,_0x252b77={'NowHo':function(_0x3dd030,_0x4cc665){return _0x3dd030===_0x4cc665;},'WXMMj':function(_0x1b7540,_0x32ee7f){return _0x1b7540+_0x32ee7f;}},_0x12bd47=_0x5a5f02[_0x55f849(0x1f3)](_0x57c840=>_0x57c840['name']===_0x532cd7||_0x57c840['name'][_0x55f849(0x239)](_0x532cd7+'\x20('));if(_0x252b77[_0x55f849(0x22c)](_0x12bd47['length'],0x0))return _0x532cd7;return _0x532cd7+'\x20('+_0x252b77[_0x55f849(0x203)](_0x12bd47[_0x55f849(0x205)],0x1)+')';}export async function provisionApiKey(_0x1ba5a6){const _0x29db06=_0x1d73,_0x29dbde={'LMGWM':'application/json','FwflA':function(_0x46fedf,_0x34f0d2,_0x435812){return _0x46fedf(_0x34f0d2,_0x435812);},'cummx':'GET','beVke':function(_0x36a2ef,_0x2a0087,_0x5f1d11){return _0x36a2ef(_0x2a0087,_0x5f1d11);}},_0x31bc11=getApiBaseUrl(),_0x26f18a={'Content-Type':_0x29dbde[_0x29db06(0x213)],'workos-token':_0x1ba5a6},_0x1c2dff=await fetchUserProfile(_0x1ba5a6),_0x24ae2b=_0x1c2dff?.[_0x29db06(0x215)]||_0x1c2dff?.[_0x29db06(0x204)]?.[_0x29db06(0x22d)]('@')[0x0],_0x4d11bc=_0x24ae2b?_0x24ae2b+_0x29db06(0x219):'CLI\x20Key';let _0x2f05c2=[];try{const _0x21eb20=await _0x29dbde[_0x29db06(0x23b)](fetch,_0x31bc11+'/api-keys',{'method':_0x29dbde[_0x29db06(0x20d)],'headers':_0x26f18a});if(_0x21eb20['ok']){const _0x118857=await _0x21eb20[_0x29db06(0x241)]();_0x2f05c2=_0x118857[_0x29db06(0x229)];}}catch{}const _0x5de16e=_0x29dbde[_0x29db06(0x1fa)](buildKeyName,_0x4d11bc,_0x2f05c2),_0x1bf04f=await fetch(_0x31bc11+'/api-keys',{'method':'POST','headers':_0x26f18a,'body':JSON['stringify']({'name':_0x5de16e,'scope':_0x29db06(0x23e)})});if(!_0x1bf04f['ok']){const _0x1ad732=await _0x1bf04f[_0x29db06(0x20e)]();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x1bf04f['status']+'\x20'+_0x1ad732);}const _0x4344d9=await _0x1bf04f['json']();return _0x4344d9[_0x29db06(0x1fe)]['token'];}export function openBrowser(_0x16431e){const _0x261ab5=_0x1d73,_0x16c2a8={'QHmPW':function(_0xcd0828,_0x4b0913){return _0xcd0828===_0x4b0913;},'JJoSv':_0x261ab5(0x212),'vONmt':function(_0x3aeed5,_0x11c5be,_0x4fba5c,_0x596e4f){return _0x3aeed5(_0x11c5be,_0x4fba5c,_0x596e4f);},'KYaQC':'cmd','jbXMF':_0x261ab5(0x223),'QkUbz':'ignore'};try{if(_0x16c2a8[_0x261ab5(0x21c)](process['platform'],_0x16c2a8['JJoSv'])){const _0x3360b9=_0x16c2a8[_0x261ab5(0x1f8)](spawn,_0x16c2a8[_0x261ab5(0x200)],['/c',_0x261ab5(0x235),'',_0x16431e],{'detached':!![],'stdio':'ignore','windowsHide':!![]});_0x3360b9[_0x261ab5(0x209)]();return;}const _0x2f0414=process[_0x261ab5(0x20a)]===_0x261ab5(0x20f)?_0x261ab5(0x1ee):_0x16c2a8['jbXMF'],_0x44e4f1=spawn(_0x2f0414,[_0x16431e],{'detached':!![],'stdio':_0x16c2a8[_0x261ab5(0x201)]});_0x44e4f1[_0x261ab5(0x209)]();}catch{}}function decodeJwtPayload(_0x231fc9){const _0x1e4343=_0x1d73,_0x52d25b={'JiAAd':_0x1e4343(0x23d),'lbHFm':_0x1e4343(0x22a)},_0x2d0b09=_0x231fc9[_0x1e4343(0x22d)]('.');if(_0x2d0b09[_0x1e4343(0x205)]!==0x3)throw new Error(_0x52d25b['JiAAd']);const _0x266b82=Buffer[_0x1e4343(0x1ff)](_0x2d0b09[0x1],_0x52d25b['lbHFm'])['toString'](_0x1e4343(0x1fb));return JSON['parse'](_0x266b82);}async function selfServeSignup(_0x1764d3){const _0x44ae04=_0x1d73,_0xb82f73=getApiBaseUrl(),_0x668c1c=await fetch(_0xb82f73+'/organization/self-serve-signup',{'method':_0x44ae04(0x226),'headers':{'Content-Type':_0x44ae04(0x1f9),'workos-token':_0x1764d3}});if(!_0x668c1c['ok']){const _0xb3c54c=await _0x668c1c['text']();throw new Error('Failed\x20to\x20create\x20organization:\x20'+_0x668c1c[_0x44ae04(0x210)]+'\x20'+_0xb3c54c);}return _0x668c1c[_0x44ae04(0x241)]();}async function fetchMyMemberships(_0x2999da){const _0x157fa6=_0x1d73,_0x10e5a3={'eiFEM':function(_0x18f93b,_0x303322,_0x4144dc){return _0x18f93b(_0x303322,_0x4144dc);}},_0x3eff83=getApiBaseUrl(),_0x5d93b5=await _0x10e5a3['eiFEM'](fetch,_0x3eff83+_0x157fa6(0x21e),{'method':_0x157fa6(0x22e),'headers':{'workos-token':_0x2999da}});if(!_0x5d93b5['ok']){const _0x536b11=await _0x5d93b5[_0x157fa6(0x20e)]();throw new Error(_0x157fa6(0x21d)+_0x5d93b5['status']+'\x20'+_0x536b11);}const _0x1dfa6b=await _0x5d93b5['json']();return _0x1dfa6b['memberships'];}async function refreshTokenWithOrg(_0x3b200b,_0x30bdc6,_0x51a2bb){const _0x2344f3=_0x1d73,_0x3bb8ac={'BStAH':'POST','EnFwi':'application/x-www-form-urlencoded','oqbwi':'refresh_token'},_0x39e4f3=await fetch(WORKOS_TOKEN_URL,{'method':_0x3bb8ac[_0x2344f3(0x238)],'headers':{'Content-Type':_0x3bb8ac[_0x2344f3(0x216)]},'body':new URLSearchParams({'client_id':_0x3b200b,'grant_type':_0x3bb8ac['oqbwi'],'refresh_token':_0x30bdc6,'organization_id':_0x51a2bb})});if(!_0x39e4f3['ok']){const _0x5ccc24=await _0x39e4f3[_0x2344f3(0x20e)]();throw new Error('Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'+_0x39e4f3[_0x2344f3(0x210)]+'\x20'+_0x5ccc24);}return _0x39e4f3[_0x2344f3(0x241)]();}async function provisionCliToken(_0x4638d4){const _0x111bb0=_0x1d73,_0x1e5743={'cHnuH':function(_0x35e789){return _0x35e789();},'POWSQ':_0x111bb0(0x1f9)},_0x2809be=_0x1e5743[_0x111bb0(0x206)](getApiBaseUrl),_0x4f1d64=await fetch(_0x2809be+_0x111bb0(0x218),{'method':'POST','headers':{'Content-Type':_0x1e5743['POWSQ'],'workos-token':_0x4638d4}});if(!_0x4f1d64['ok']){const _0xa6793b=await _0x4f1d64[_0x111bb0(0x20e)]();throw new Error(_0x111bb0(0x217)+_0x4f1d64[_0x111bb0(0x210)]+'\x20'+_0xa6793b);}return _0x4f1d64[_0x111bb0(0x241)]();}export async function runDeviceAuthFlow(){const _0x5e4994=_0x1d73,_0x2fe3a4={'AcbpO':function(_0x392b4e){return _0x392b4e();},'KjfSs':'\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','FtuIa':function(_0x5353c1,_0x15c04f){return _0x5353c1(_0x15c04f);},'oTUwi':'Setting\x20up\x20your\x20organization...','Jhmgo':function(_0x2c8f0a,_0x1ac654){return _0x2c8f0a+_0x1ac654;},'vOrVg':_0x5e4994(0x224),'uZKIB':'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','DnowL':_0x5e4994(0x22f)},_0x1f6611=_0x2fe3a4[_0x5e4994(0x1fc)](getCurrentEnvironment),_0x2e9efe=ENVIRONMENT_CONFIGS[_0x1f6611]['workosClientId'],_0x2cb6e1=await requestDeviceCode(_0x2e9efe);console['log']('\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...'),console[_0x5e4994(0x21f)](_0x2fe3a4['KjfSs']),_0x2fe3a4[_0x5e4994(0x23f)](openBrowser,_0x2cb6e1['verification_uri_complete']),console['log'](_0x5e4994(0x233)+_0x2cb6e1['verification_uri_complete']),console['log']('Code:\x20'+_0x2cb6e1['user_code']+'\x0a'),process['stdout'][_0x5e4994(0x244)]('Waiting\x20for\x20authentication...');let _0x4ef5b3=await pollForTokens(_0x2e9efe,_0x2cb6e1[_0x5e4994(0x20b)],_0x2cb6e1[_0x5e4994(0x1f2)],_0x2cb6e1['expires_in']);console['log']('\x20✓');const _0x2396d7=decodeJwtPayload(_0x4ef5b3['access_token']);if(!_0x2396d7[_0x5e4994(0x220)]){const _0x50068a=await _0x2fe3a4['FtuIa'](fetchMyMemberships,_0x4ef5b3['access_token']);let _0x2380ff;if(_0x50068a['length']===0x0){process[_0x5e4994(0x23a)]['write'](_0x2fe3a4[_0x5e4994(0x22b)]);const _0x27e655=await selfServeSignup(_0x4ef5b3['access_token']);_0x2380ff=_0x27e655['organizationId'],console[_0x5e4994(0x21f)]('\x20✓');}else{if(_0x50068a[_0x5e4994(0x205)]===0x1)_0x2380ff=_0x50068a[0x0]['organizationId'],console[_0x5e4994(0x21f)]('Using\x20organization:\x20'+_0x50068a[0x0][_0x5e4994(0x1f6)]);else{const _0x4b7a22=process['stdin'][_0x5e4994(0x232)]&&process['stdout']['isTTY'];if(!_0x4b7a22)throw new Error(_0x2fe3a4['Jhmgo'](_0x2fe3a4[_0x5e4994(0x237)],_0x2fe3a4['uZKIB']));const {selected:_0x2c13d6}=await _0x4895df[_0x5e4994(0x243)]([{'type':_0x2fe3a4[_0x5e4994(0x21b)],'name':'selected','message':_0x5e4994(0x1f7),'choices':_0x50068a['map'](_0x1bbd9f=>({'name':_0x1bbd9f[_0x5e4994(0x1f6)],'value':_0x1bbd9f[_0x5e4994(0x1f0)]}))}]);_0x2380ff=_0x2c13d6;}}_0x4ef5b3=await refreshTokenWithOrg(_0x2e9efe,_0x4ef5b3[_0x5e4994(0x221)],_0x2380ff);}process[_0x5e4994(0x23a)][_0x5e4994(0x244)](_0x5e4994(0x231));const _0x9c39a5=await _0x2fe3a4['FtuIa'](provisionCliToken,_0x4ef5b3['access_token']);return console['log']('\x20✓'),await _0x2fe3a4[_0x5e4994(0x23f)](storeToken,_0x9c39a5[_0x5e4994(0x208)]),_0x4ef5b3[_0x5e4994(0x221)]&&await storeRefreshToken(_0x4ef5b3['refresh_token']),_0x9c39a5['token'];}function sleep(_0xef1807){return new Promise(_0x4fc59f=>setTimeout(_0x4fc59f,_0xef1807));}
@@ -1 +1 @@
1
- const _0x55bad3=_0x4b21;(function(_0x252840,_0x132466){const _0x59d7eb=_0x4b21,_0x3fdac5=_0x252840();while(!![]){try{const _0x1450b2=parseInt(_0x59d7eb(0x166))/0x1*(-parseInt(_0x59d7eb(0x155))/0x2)+-parseInt(_0x59d7eb(0x147))/0x3*(-parseInt(_0x59d7eb(0x151))/0x4)+parseInt(_0x59d7eb(0x146))/0x5+parseInt(_0x59d7eb(0x14f))/0x6*(parseInt(_0x59d7eb(0x14e))/0x7)+parseInt(_0x59d7eb(0x163))/0x8*(-parseInt(_0x59d7eb(0x156))/0x9)+-parseInt(_0x59d7eb(0x15e))/0xa+parseInt(_0x59d7eb(0x164))/0xb;if(_0x1450b2===_0x132466)break;else _0x3fdac5['push'](_0x3fdac5['shift']());}catch(_0x556863){_0x3fdac5['push'](_0x3fdac5['shift']());}}}(_0x23a0,0x579f8));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':_0x55bad3(0x15d),'workosClientId':'client_01J9CBYM7M5ZETCF7G6614DXR2','aiProxyUrl':'https://ai-proxy-716115358910.us-central1.run.app','mcpAuthUrl':'https://mcp-auth.ranger.net/mcp'},'staging':{'apiBaseUrl':_0x55bad3(0x160),'workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':_0x55bad3(0x165),'mcpAuthUrl':'https://mcp-auth.staging.ranger.net/mcp'},'local':{'apiBaseUrl':'http://localhost:8080','workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':_0x55bad3(0x15a),'mcpAuthUrl':_0x55bad3(0x15c)}};export const DEFAULT_ENVIRONMENT='prod';export function isValidEnvironment(_0x5ac59a){const _0x41824f=_0x55bad3,_0x51ab5b={'cEzOb':function(_0x2f6af8,_0xde99ea){return _0x2f6af8===_0xde99ea;},'ppKjz':function(_0x316e6f,_0x376378){return _0x316e6f===_0x376378;},'AapBT':_0x41824f(0x148)};return _0x51ab5b[_0x41824f(0x14c)](_0x5ac59a,_0x41824f(0x14a))||_0x51ab5b['ppKjz'](_0x5ac59a,_0x51ab5b[_0x41824f(0x149)])||_0x51ab5b[_0x41824f(0x14c)](_0x5ac59a,'local');}function _0x4b21(_0x2f51b3,_0x5be14a){_0x2f51b3=_0x2f51b3-0x146;const _0x23a061=_0x23a0();let _0x4b2178=_0x23a061[_0x2f51b3];return _0x4b2178;}export function getCurrentEnvironment(){const _0x5492ba=process['env']['RANGER_CLI_ENV'];if(_0x5492ba&&isValidEnvironment(_0x5492ba))return _0x5492ba;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){const _0x449805=_0x55bad3;return ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x449805(0x158)];}export function getAiProxyUrl(){const _0x5e9107=_0x55bad3,_0x50658a={'zsWLZ':function(_0xc1bdc2){return _0xc1bdc2();}};return ENVIRONMENT_CONFIGS[_0x50658a[_0x5e9107(0x161)](getCurrentEnvironment)][_0x5e9107(0x14d)];}export function getMcpAuthUrl(){const _0x2fba44=_0x55bad3;return process[_0x2fba44(0x15f)][_0x2fba44(0x159)]??ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x2fba44(0x152)];}export function isByokEnabled(){const _0x15dab8=_0x55bad3,_0x21035d={'JyFlt':function(_0x1a9bc9,_0x2c7b30){return _0x1a9bc9===_0x2c7b30;},'WbAhA':_0x15dab8(0x153)};return _0x21035d['JyFlt'](process['env']['RANGER_BYOK'],_0x21035d['WbAhA']);}function isVerificationTransport(_0x2539f2){const _0x7a01a0=_0x55bad3,_0x50d207={'oJgBh':function(_0x343e5d,_0x445b7f){return _0x343e5d===_0x445b7f;},'IwXUI':'mcp','zpeiL':'playwright-cli','HNHxQ':function(_0x528010,_0x575557){return _0x528010===_0x575557;},'UcOsl':'nova-act-cli'};return _0x50d207['oJgBh'](_0x2539f2,_0x50d207['IwXUI'])||_0x50d207[_0x7a01a0(0x150)](_0x2539f2,_0x50d207['zpeiL'])||_0x50d207[_0x7a01a0(0x157)](_0x2539f2,_0x50d207['UcOsl'])||_0x50d207['oJgBh'](_0x2539f2,'rangerwright-cli');}function _0x23a0(){const _0x396264=['true','YxIpp','544682vLqHRh','9LjNGbZ','HNHxQ','apiBaseUrl','RANGER_MCP_AUTH_URL','http://localhost:8090','RANGER_USE_NOVA_ACT','http://localhost:8080/mcp','https://api.ranger.net','5071620djZEYF','env','https://api.staging.ranger.net','zsWLZ','RANGER_TRANSPORT','5576328mgezCw','12343155eABnrl','https://ai-proxy-301751771437.us-central1.run.app','2twHdxx','1784265cOLSyD','473079eGVYpj','staging','AapBT','prod','RANGER_DISABLE_MCP','cEzOb','aiProxyUrl','1302FRgmkN','15198qMEWCn','oJgBh','4JSDzRy','mcpAuthUrl'];_0x23a0=function(){return _0x396264;};return _0x23a0();}const LEGACY_TRANSPORT_ENV_VARS=[_0x55bad3(0x15b),_0x55bad3(0x14b)];export function getVerificationTransport(){const _0x13b87d=_0x55bad3,_0x57b373={'YxIpp':function(_0x58b833,_0xb87e7a){return _0x58b833(_0xb87e7a);}},_0x27f25f=process['env'][_0x13b87d(0x162)]?.['trim']();if(_0x27f25f){if(_0x57b373[_0x13b87d(0x154)](isVerificationTransport,_0x27f25f))return _0x27f25f;throw new Error('Invalid\x20RANGER_TRANSPORT=\x22'+_0x27f25f+'\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli,\x20rangerwright-cli.');}const _0x42cc55=LEGACY_TRANSPORT_ENV_VARS['find'](_0xdcf3ba=>process['env'][_0xdcf3ba]);if(_0x42cc55)throw new Error(_0x42cc55+'\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20RANGER_TRANSPORT=nova-act-cli,\x20or\x20RANGER_TRANSPORT=rangerwright-cli.');return'mcp';}
1
+ const _0x4399e4=_0x49bb;(function(_0x4fc339,_0x1bb21d){const _0x24bf5a=_0x49bb,_0x2c7c87=_0x4fc339();while(!![]){try{const _0x300827=-parseInt(_0x24bf5a(0xea))/0x1+parseInt(_0x24bf5a(0xe6))/0x2+parseInt(_0x24bf5a(0xf3))/0x3+-parseInt(_0x24bf5a(0xd9))/0x4+-parseInt(_0x24bf5a(0xdf))/0x5+parseInt(_0x24bf5a(0xe0))/0x6+parseInt(_0x24bf5a(0xe9))/0x7*(parseInt(_0x24bf5a(0xe3))/0x8);if(_0x300827===_0x1bb21d)break;else _0x2c7c87['push'](_0x2c7c87['shift']());}catch(_0xcd3e6a){_0x2c7c87['push'](_0x2c7c87['shift']());}}}(_0x5875,0xba32c));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':'https://api.ranger.net','workosClientId':_0x4399e4(0xee),'aiProxyUrl':'https://ai-proxy-716115358910.us-central1.run.app','mcpAuthUrl':_0x4399e4(0xde)},'staging':{'apiBaseUrl':_0x4399e4(0xf0),'workosClientId':_0x4399e4(0xd0),'aiProxyUrl':_0x4399e4(0xeb),'mcpAuthUrl':_0x4399e4(0xed)},'local':{'apiBaseUrl':_0x4399e4(0xce),'workosClientId':_0x4399e4(0xd0),'aiProxyUrl':'http://localhost:8090','mcpAuthUrl':_0x4399e4(0xd4)}};function _0x49bb(_0x40e084,_0x2994af){_0x40e084=_0x40e084-0xcc;const _0x5875ed=_0x5875();let _0x49bbf7=_0x5875ed[_0x40e084];return _0x49bbf7;}export const DEFAULT_ENVIRONMENT='prod';export function isValidEnvironment(_0x9143dc){const _0x57a771=_0x4399e4,_0x63820={'xBXgA':function(_0x5c7c16,_0x45864a){return _0x5c7c16===_0x45864a;},'OKRIz':_0x57a771(0xf1),'vLZJL':function(_0xd00a1d,_0x50bc00){return _0xd00a1d===_0x50bc00;},'ASJCF':'staging'};return _0x63820[_0x57a771(0xdd)](_0x9143dc,_0x63820['OKRIz'])||_0x63820['vLZJL'](_0x9143dc,_0x63820[_0x57a771(0xdb)])||_0x9143dc===_0x57a771(0xe2);}export function getCurrentEnvironment(){const _0x1ff551=_0x4399e4,_0x4af9d3=process[_0x1ff551(0xda)]['RANGER_CLI_ENV'];if(_0x4af9d3&&isValidEnvironment(_0x4af9d3))return _0x4af9d3;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){const _0x32097f=_0x4399e4;return ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x32097f(0xd2)];}export function getAiProxyUrl(){const _0x534aee=_0x4399e4;return ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x534aee(0xd5)];}export function getMcpAuthUrl(){const _0x2f842f=_0x4399e4;return process['env'][_0x2f842f(0xd3)]??ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x2f842f(0xdc)];}export function isByokEnabled(){const _0x1de584=_0x4399e4,_0x33b1d6={'ABaLD':function(_0xd126ad,_0x16535b){return _0xd126ad===_0x16535b;}};return _0x33b1d6[_0x1de584(0xcc)](process['env']['RANGER_BYOK'],_0x1de584(0xd8));}function isVerificationTransport(_0x259edc){const _0x2b724d=_0x4399e4,_0xf0a32e={'cfeAp':'mcp','JwTwZ':function(_0x20a043,_0x1170cb){return _0x20a043===_0x1170cb;},'LuIhx':_0x2b724d(0xcd)};return _0x259edc===_0xf0a32e['cfeAp']||_0xf0a32e[_0x2b724d(0xef)](_0x259edc,_0xf0a32e['LuIhx'])||_0x259edc==='nova-act-cli'||_0x259edc===_0x2b724d(0xe4);}const LEGACY_TRANSPORT_ENV_VARS=[_0x4399e4(0xec),_0x4399e4(0xd6)];export function getVerificationTransport(){const _0x2b9961=_0x4399e4,_0x3540c9={'blWdB':_0x2b9961(0xcf)},_0x5cdeb5=process['env']['RANGER_TRANSPORT']?.['trim']();if(_0x5cdeb5){if(isVerificationTransport(_0x5cdeb5))return _0x5cdeb5;throw new Error('Invalid\x20RANGER_TRANSPORT=\x22'+_0x5cdeb5+_0x2b9961(0xe8));}const _0x10b71f=LEGACY_TRANSPORT_ENV_VARS['find'](_0xbddebc=>process['env'][_0xbddebc]);if(_0x10b71f)throw new Error(_0x10b71f+'\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20RANGER_TRANSPORT=nova-act-cli,\x20or\x20RANGER_TRANSPORT=rangerwright-cli.');return _0x3540c9['blWdB'];}function _0x5875(){const _0x15473d=['local','6472UMZtRf','rangerwright-cli','auto','101418bEjcSV','trim','\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli,\x20rangerwright-cli.','20237lcKBnJ','1342673mojGCi','https://ai-proxy-301751771437.us-central1.run.app','RANGER_USE_NOVA_ACT','https://mcp-auth.staging.ranger.net/mcp','client_01J9CBYM7M5ZETCF7G6614DXR2','JwTwZ','https://api.staging.ranger.net','prod','toLowerCase','2840133mBKMHB','ABaLD','playwright-cli','http://localhost:8080','mcp','client_01J9CBYM2DKWV9HM17D95Z540K','off','apiBaseUrl','RANGER_MCP_AUTH_URL','http://localhost:8080/mcp','aiProxyUrl','RANGER_DISABLE_MCP','\x22.\x20','true','5696016zpmltO','env','ASJCF','mcpAuthUrl','xBXgA','https://mcp-auth.ranger.net/mcp','5428845QabxAp','7673250DfbXNU','RANGER_HOOKS'];_0x5875=function(){return _0x15473d;};return _0x5875();}export function resolveHookMode(_0x33b69a=process[_0x4399e4(0xda)]){const _0x343bd9=_0x4399e4,_0xa8445d={'IWrEF':function(_0x126624,_0x4a49e6){return _0x126624===_0x4a49e6;}},_0x169f9e=_0x33b69a[_0x343bd9(0xe1)]?.[_0x343bd9(0xe7)]()[_0x343bd9(0xf2)]();if(!_0x169f9e)return'auto';if(_0xa8445d['IWrEF'](_0x169f9e,_0x343bd9(0xd1))||_0xa8445d['IWrEF'](_0x169f9e,'on')||_0x169f9e===_0x343bd9(0xe5))return _0x169f9e;return console['error']('[ranger]\x20Ignoring\x20invalid\x20RANGER_HOOKS=\x22'+_0x33b69a['RANGER_HOOKS']+_0x343bd9(0xd7)+'Expected\x20one\x20of:\x20off,\x20on,\x20auto.\x20Defaulting\x20to\x20auto.'),_0x343bd9(0xe5);}
@@ -1 +1 @@
1
- (function(_0x3b6c30,_0x27ef96){const _0x1b303f=_0x3133,_0x492dbe=_0x3b6c30();while(!![]){try{const _0x18a97f=-parseInt(_0x1b303f(0x131))/0x1+-parseInt(_0x1b303f(0x15b))/0x2*(-parseInt(_0x1b303f(0x144))/0x3)+-parseInt(_0x1b303f(0x126))/0x4*(parseInt(_0x1b303f(0x11e))/0x5)+parseInt(_0x1b303f(0x12d))/0x6+parseInt(_0x1b303f(0x151))/0x7*(-parseInt(_0x1b303f(0x140))/0x8)+parseInt(_0x1b303f(0x15d))/0x9+parseInt(_0x1b303f(0x157))/0xa;if(_0x18a97f===_0x27ef96)break;else _0x492dbe['push'](_0x492dbe['shift']());}catch(_0x18b79b){_0x492dbe['push'](_0x492dbe['shift']());}}}(_0x1403,0x3a37c));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x2f26b9){const _0x2cb17c=_0x3133,_0x552aec={'Iocsn':function(_0x44b6ef){return _0x44b6ef();},'zYMRy':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','kbcsj':function(_0x89b847,_0x18bffc,_0x4a5d3a){return _0x89b847(_0x18bffc,_0x4a5d3a);},'rDXpZ':_0x2cb17c(0x13c),'SMeme':'application/json','qONBo':function(_0x48738c,_0x37ce48){return _0x48738c===_0x37ce48;},'Etblv':'https://dashboard.ranger.net/billing','NogdN':'Feature\x20limit\x20exceeded'},_0x41c44b=await _0x552aec[_0x2cb17c(0x122)](getToken);if(!_0x41c44b)throw new Error(_0x552aec['zYMRy']);const _0xb7e422=getApiBaseUrl(),_0xa14533=await _0x552aec[_0x2cb17c(0x15a)](fetch,_0xb7e422+'/api/v1/mcp/features',{'method':_0x552aec['rDXpZ'],'headers':{'Authorization':'Bearer\x20'+_0x41c44b,'Content-Type':_0x552aec['SMeme']},'body':JSON['stringify'](_0x2f26b9)});if(!_0xa14533['ok']){if(_0x552aec['qONBo'](_0xa14533['status'],0x192)){const _0x3f38c2=await _0xa14533[_0x2cb17c(0x129)](),_0x5222d7=_0x3f38c2[_0x2cb17c(0x152)]||_0x552aec['Etblv'];throw new Error((_0x3f38c2[_0x2cb17c(0x134)]||_0x552aec['NogdN'])+_0x2cb17c(0x133)+_0x5222d7);}const _0x49d3e1=await _0xa14533['text']();throw new Error(_0x2cb17c(0x146)+_0x49d3e1);}return _0xa14533[_0x2cb17c(0x129)]();}export async function listFeatures(_0x2c3da5){const _0x5a5a69=_0x3133,_0x331e0c={'TODWe':function(_0x143cfc){return _0x143cfc();},'cgMon':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','LrQvN':function(_0x45f530){return _0x45f530();},'wIfTs':_0x5a5a69(0x16b),'lnQgT':'limit'},_0x5a43e8=await _0x331e0c['TODWe'](getToken);if(!_0x5a43e8)throw new Error(_0x331e0c[_0x5a5a69(0x153)]);const _0x2de405=_0x331e0c[_0x5a5a69(0x165)](getApiBaseUrl),_0x413aa8=new URLSearchParams();if(_0x2c3da5?.['gitRepoUrl'])_0x413aa8['set'](_0x5a5a69(0x12e),_0x2c3da5[_0x5a5a69(0x12e)]);if(_0x2c3da5?.['gitBranch'])_0x413aa8[_0x5a5a69(0x142)](_0x331e0c[_0x5a5a69(0x163)],_0x2c3da5[_0x5a5a69(0x16b)]);if(_0x2c3da5?.['limit'])_0x413aa8[_0x5a5a69(0x142)](_0x331e0c['lnQgT'],_0x2c3da5['limit']['toString']());if(_0x2c3da5?.[_0x5a5a69(0x135)])_0x413aa8['set'](_0x5a5a69(0x135),_0x2c3da5[_0x5a5a69(0x135)]['toString']());if(_0x2c3da5?.[_0x5a5a69(0x168)])_0x413aa8[_0x5a5a69(0x142)](_0x5a5a69(0x168),_0x5a5a69(0x13a));const _0x1c0f1b=_0x2de405+_0x5a5a69(0x139)+(_0x413aa8[_0x5a5a69(0x11f)]()?'?'+_0x413aa8[_0x5a5a69(0x11f)]():''),_0x1707a6=await fetch(_0x1c0f1b,{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x5a43e8}});if(!_0x1707a6['ok']){const _0x41f1dd=await _0x1707a6[_0x5a5a69(0x164)]();throw new Error(_0x5a5a69(0x13e)+_0x41f1dd);}return _0x1707a6['json']();}export async function getFeature(_0x2c28f5){const _0x4dba24=_0x3133,_0x658d39={'cQtBQ':function(_0x571e4f){return _0x571e4f();},'GLnGL':_0x4dba24(0x169)},_0x5f0ecf=await _0x658d39[_0x4dba24(0x137)](getToken);if(!_0x5f0ecf)throw new Error(_0x658d39[_0x4dba24(0x143)]);const _0x10dd3a=getApiBaseUrl(),_0x262e7a=await fetch(_0x10dd3a+_0x4dba24(0x161)+_0x2c28f5,{'method':_0x4dba24(0x155),'headers':{'Authorization':'Bearer\x20'+_0x5f0ecf}});if(!_0x262e7a['ok']){const _0x34f06b=await _0x262e7a[_0x4dba24(0x164)]();throw new Error(_0x4dba24(0x123)+_0x34f06b);}return _0x262e7a[_0x4dba24(0x129)]();}export async function updateFeature(_0x167d92,_0x44c0aa){const _0x353bcc=_0x3133,_0x57047d={'ntwGJ':function(_0x4cb612){return _0x4cb612();},'TOxDd':_0x353bcc(0x169)},_0x137d4c=await _0x57047d[_0x353bcc(0x159)](getToken);if(!_0x137d4c)throw new Error(_0x57047d['TOxDd']);const _0x5b7f31=_0x57047d['ntwGJ'](getApiBaseUrl),_0x43e9c3=await fetch(_0x5b7f31+'/api/v1/mcp/features/'+_0x167d92,{'method':'PATCH','headers':{'Authorization':_0x353bcc(0x121)+_0x137d4c,'Content-Type':'application/json'},'body':JSON[_0x353bcc(0x11c)](_0x44c0aa)});if(!_0x43e9c3['ok']){const _0x24cf2e=await _0x43e9c3[_0x353bcc(0x164)]();throw new Error('Failed\x20to\x20update\x20feature\x20review:\x20'+_0x24cf2e);}return _0x43e9c3[_0x353bcc(0x129)]();}export async function createChecklistItem(_0x1e7579,_0x32ad56,_0x22291e){const _0x4df28d=_0x3133,_0x4c51f3={'zxabu':function(_0x99969d){return _0x99969d();},'iQoEd':function(_0x25dfbe){return _0x25dfbe();},'bbiDe':function(_0x1d7c25,_0x419ab8,_0x5e0b60){return _0x1d7c25(_0x419ab8,_0x5e0b60);},'WjKcR':_0x4df28d(0x13c),'cfLyC':'application/json'},_0x2a325c=await _0x4c51f3[_0x4df28d(0x15e)](getToken);if(!_0x2a325c)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0xdaee55=_0x4c51f3[_0x4df28d(0x124)](getApiBaseUrl),_0x5c93e0=await _0x4c51f3[_0x4df28d(0x13b)](fetch,_0xdaee55+'/api/v1/mcp/features/'+_0x1e7579+'/checklist',{'method':_0x4c51f3[_0x4df28d(0x14b)],'headers':{'Authorization':'Bearer\x20'+_0x2a325c,'Content-Type':_0x4c51f3[_0x4df28d(0x132)]},'body':JSON['stringify']({'description':_0x32ad56,'position':_0x22291e})});if(!_0x5c93e0['ok']){const _0x47a3e7=await _0x5c93e0['text']();throw new Error('Failed\x20to\x20create\x20scenario:\x20'+_0x47a3e7);}return _0x5c93e0['json']();}export async function updateChecklistItem(_0x471a71,_0x467134,_0x31ba32){const _0x428865=_0x3133,_0x24d44b={'hbmJt':_0x428865(0x169),'YlxZq':function(_0x44d758,_0x49f026,_0x51b2cb){return _0x44d758(_0x49f026,_0x51b2cb);},'tNRoe':'application/json','dJYNj':function(_0x3037a0,_0x16fcb3,_0x5a706b){return _0x3037a0(_0x16fcb3,_0x5a706b);},'Rzhgz':_0x428865(0x162)};return _0x24d44b['dJYNj'](withRetry,async()=>{const _0x5b18ab=_0x428865,_0x22fe17=await getToken();if(!_0x22fe17)throw new Error(_0x24d44b['hbmJt']);const _0xe433c2=getApiBaseUrl(),_0x43983c=await _0x24d44b['YlxZq'](fetch,_0xe433c2+'/api/v1/mcp/features/'+_0x471a71+_0x5b18ab(0x148)+_0x467134,{'method':_0x5b18ab(0x147),'headers':{'Authorization':_0x5b18ab(0x121)+_0x22fe17,'Content-Type':_0x24d44b['tNRoe']},'body':JSON[_0x5b18ab(0x11c)](_0x31ba32)});if(!_0x43983c['ok']){const _0x1a6aaf=await _0x43983c['text']();throw new Error(_0x5b18ab(0x150)+_0x1a6aaf);}return _0x43983c['json']();},{'label':_0x24d44b[_0x428865(0x154)]});}function _0x3133(_0x18fa09,_0x453367){_0x18fa09=_0x18fa09-0x11a;const _0x140314=_0x1403();let _0x313392=_0x140314[_0x18fa09];return _0x313392;}export async function getFeatureReport(_0x4fb558){const _0x2f41d8=_0x3133,_0x3e9375={'zsuBd':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','ydgyJ':function(_0x35b051){return _0x35b051();},'DiRdl':function(_0x53fa76,_0x73ce3a,_0x22401a){return _0x53fa76(_0x73ce3a,_0x22401a);}},_0x5b62d2=await getToken();if(!_0x5b62d2)throw new Error(_0x3e9375[_0x2f41d8(0x15f)]);const _0x3f7727=_0x3e9375['ydgyJ'](getApiBaseUrl),_0x2c703c=await _0x3e9375[_0x2f41d8(0x12f)](fetch,_0x3f7727+'/api/v1/mcp/features/'+_0x4fb558+_0x2f41d8(0x14d),{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x5b62d2}});if(!_0x2c703c['ok']){const _0x576b96=await _0x2c703c['text']();throw new Error(_0x2f41d8(0x127)+_0x576b96);}return _0x2c703c[_0x2f41d8(0x129)]();}export async function getFeatureReportMarkdown(_0x2195bf,_0x3e3d49){const _0x5b1611=_0x3133,_0xc3ccb4={'nZEAK':function(_0x2d5c22){return _0x2d5c22();},'emjUl':function(_0x22259b,_0x24ea16){return _0x22259b>_0x24ea16;},'rquLG':_0x5b1611(0x160),'SqIbs':function(_0x109709,_0x2163b3){return _0x109709&&_0x2163b3;},'qPPds':function(_0x5c7542,_0x41ace6,_0x28a5ba){return _0x5c7542(_0x41ace6,_0x28a5ba);}},_0x2aa9fd=await getToken();if(!_0x2aa9fd)throw new Error(_0x5b1611(0x169));const _0x35a401=_0xc3ccb4[_0x5b1611(0x14f)](getApiBaseUrl),_0x28f66a=new URLSearchParams(),_0x218aec=_0xc3ccb4['emjUl'](_0x3e3d49?.['itemIds']?.['length']??0x0,0x0),_0x3d14b7=Boolean(_0x3e3d49?.['sessionId']);_0x218aec&&_0x3e3d49?.['itemIds']&&_0x28f66a[_0x5b1611(0x142)](_0xc3ccb4['rquLG'],_0x3e3d49['itemIds'][_0x5b1611(0x12b)](','));_0x3d14b7&&_0x3e3d49?.[_0x5b1611(0x167)]&&_0x28f66a['set'](_0x5b1611(0x167),_0x3e3d49[_0x5b1611(0x167)]);_0xc3ccb4[_0x5b1611(0x14a)](!_0x218aec,!_0x3d14b7)&&_0x3e3d49?.['style']&&_0x28f66a[_0x5b1611(0x142)]('style',_0x3e3d49[_0x5b1611(0x11d)]);const _0x5992c3=_0x35a401+_0x5b1611(0x161)+_0x2195bf+_0x5b1611(0x11b),_0x314da3=''+_0x5992c3+(_0x28f66a[_0x5b1611(0x11f)]()?'?'+_0x28f66a[_0x5b1611(0x11f)]():''),_0xbe4cc6=await _0xc3ccb4[_0x5b1611(0x128)](fetch,_0x314da3,{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x2aa9fd}});if(!_0xbe4cc6['ok']){const _0x3d5a1b=await _0xbe4cc6['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20'+_0x3d5a1b);}return _0xbe4cc6['text']();}export async function listFeatureSessions(_0x69763c){const _0xedb928=_0x3133,_0x3c026e={'DuirJ':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x860c5f=await getToken();if(!_0x860c5f)throw new Error(_0x3c026e['DuirJ']);const _0x142f6d=getApiBaseUrl(),_0xaf54aa=await fetch(_0x142f6d+'/api/v1/mcp/features/'+_0x69763c+'/sessions',{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x860c5f}});if(!_0xaf54aa['ok']){const _0x4e789a=await _0xaf54aa['text']();throw new Error(_0xedb928(0x14e)+_0x4e789a);}return _0xaf54aa[_0xedb928(0x129)]();}export async function startSession(_0x37d0ab,_0xda6418){const _0x1f50d1=_0x3133,_0x5e235b={'xHvAw':function(_0x5a92ec){return _0x5a92ec();}},_0x1afe07=await getToken();if(!_0x1afe07)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x544d19=_0x5e235b['xHvAw'](getApiBaseUrl),_0x4a3a0b=await fetch(_0x544d19+_0x1f50d1(0x161)+_0x37d0ab+'/sessions/'+_0xda6418+_0x1f50d1(0x136),{'method':_0x1f50d1(0x13c),'headers':{'Authorization':_0x1f50d1(0x121)+_0x1afe07}});if(!_0x4a3a0b['ok']){const _0x4cd814=await _0x4a3a0b['text']();throw new Error('Failed\x20to\x20start\x20session:\x20'+_0x4cd814);}return _0x4a3a0b[_0x1f50d1(0x129)]();}export async function concludeSession(_0x191d72,_0x52c414){const _0xe2f50e=_0x3133,_0x51568f={'mQUJS':function(_0x616742){return _0x616742();},'kGCoK':function(_0x4b98d1,_0xcd571d,_0x34c5e3){return _0x4b98d1(_0xcd571d,_0x34c5e3);},'tiamE':'POST'},_0xce9ae6=await getToken();if(!_0xce9ae6)throw new Error(_0xe2f50e(0x169));const _0x3e9cb3=_0x51568f['mQUJS'](getApiBaseUrl),_0x5acdbb=await _0x51568f[_0xe2f50e(0x14c)](fetch,_0x3e9cb3+_0xe2f50e(0x161)+_0x191d72+'/sessions/'+_0x52c414+'/conclude',{'method':_0x51568f['tiamE'],'headers':{'Authorization':_0xe2f50e(0x121)+_0xce9ae6}});if(!_0x5acdbb['ok']){const _0x13b982=await _0x5acdbb['text']();throw new Error(_0xe2f50e(0x141)+_0x13b982);}return _0x5acdbb[_0xe2f50e(0x129)]();}function _0x1403(){const _0x3f0b09=['style','1267315nwqNjJ','toString','CpKty','Bearer\x20','Iocsn','Failed\x20to\x20get\x20feature\x20review:\x20','iQoEd','hUOcM','4toAzDE','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','qPPds','json','bnffo','join','uTyKM','144780lgehTv','gitRepoUrl','DiRdl','application/json','420689cUguCH','cfLyC','\x0a\x0aUpgrade\x20your\x20plan:\x20','message','offset','/start','cQtBQ','sHXwj','/api/v1/mcp/features','true','bbiDe','POST','Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20','Failed\x20to\x20list\x20feature\x20reviews:\x20','CgjYf','2074232GUKWtF','Failed\x20to\x20conclude\x20session:\x20','set','GLnGL','3jJZBKl','Failed\x20to\x20restore\x20feature\x20review:\x20','Failed\x20to\x20create\x20feature\x20review:\x20','PATCH','/checklist/','/feedback','SqIbs','WjKcR','kGCoK','/report','Failed\x20to\x20list\x20sessions:\x20','nZEAK','Failed\x20to\x20update\x20scenario:\x20','7UQsbmB','billingUrl','cgMon','Rzhgz','GET','DELETE','7946190flrtAm','/restore','ntwGJ','kbcsj','279886tvTKNP','kzZJO','1918791CFWWgc','zxabu','zsuBd','itemIds','/api/v1/mcp/features/','updateChecklistItem','wIfTs','text','LrQvN','/comments/address','sessionId','includeDeleted','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','tGKhB','gitBranch','WptXN','/report/markdown','stringify'];_0x1403=function(){return _0x3f0b09;};return _0x1403();}export async function getActionItems(_0x190c99){const _0x34bbec=_0x3133,_0x5c6094={'BmeIY':_0x34bbec(0x169),'sHXwj':function(_0x13b345){return _0x13b345();}},_0x4ca1fb=await getToken();if(!_0x4ca1fb)throw new Error(_0x5c6094['BmeIY']);const _0x33be3c=_0x5c6094[_0x34bbec(0x138)](getApiBaseUrl),_0x35b89a=await fetch(_0x33be3c+'/api/v1/mcp/features/'+_0x190c99+'/action-items',{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x4ca1fb}});if(!_0x35b89a['ok']){const _0xaa1c52=await _0x35b89a['text']();throw new Error('Failed\x20to\x20get\x20action\x20items:\x20'+_0xaa1c52);}return _0x35b89a[_0x34bbec(0x129)]();}export async function getItemFeedback(_0xac2d6b,_0x5f5652){const _0x4c1b0b=_0x3133,_0x53875a={'uTyKM':function(_0x2aef4d){return _0x2aef4d();},'tGKhB':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','WptXN':function(_0x13409f){return _0x13409f();},'CpKty':function(_0x4b6af8,_0x3fa156,_0xf8af28){return _0x4b6af8(_0x3fa156,_0xf8af28);},'bnffo':_0x4c1b0b(0x155)},_0x352c7b=await _0x53875a[_0x4c1b0b(0x12c)](getToken);if(!_0x352c7b)throw new Error(_0x53875a[_0x4c1b0b(0x16a)]);const _0x3dcbf2=_0x53875a[_0x4c1b0b(0x11a)](getApiBaseUrl),_0x14d091=await _0x53875a[_0x4c1b0b(0x120)](fetch,_0x3dcbf2+'/api/v1/mcp/features/'+_0xac2d6b+'/checklist-items/'+_0x5f5652+_0x4c1b0b(0x149),{'method':_0x53875a[_0x4c1b0b(0x12a)],'headers':{'Authorization':'Bearer\x20'+_0x352c7b}});if(!_0x14d091['ok']){const _0x403bc7=await _0x14d091['text']();throw new Error('Failed\x20to\x20get\x20item\x20feedback:\x20'+_0x403bc7);}return _0x14d091[_0x4c1b0b(0x129)]();}export async function markCommentsAddressed(_0x3a94e2,_0x14748a,_0x187e38){const _0x5360ab=_0x3133,_0x28cba0={'XAeAl':function(_0x490674){return _0x490674();},'hUOcM':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x458bd4=await _0x28cba0['XAeAl'](getToken);if(!_0x458bd4)throw new Error(_0x28cba0[_0x5360ab(0x125)]);const _0x119d1a=getApiBaseUrl(),_0x272f30=await fetch(_0x119d1a+'/api/v1/mcp/features/'+_0x3a94e2+_0x5360ab(0x166),{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x458bd4,'Content-Type':_0x5360ab(0x130)},'body':JSON[_0x5360ab(0x11c)]({'checklistItemId':_0x14748a,'commentIds':_0x187e38})});if(!_0x272f30['ok']){const _0x4afe30=await _0x272f30['text']();throw new Error(_0x5360ab(0x13d)+_0x4afe30);}}export async function softDeleteFeature(_0x130803){const _0x3c8164=_0x3133,_0x4b9684={'CgjYf':function(_0x4b5cb6){return _0x4b5cb6();},'KEenj':function(_0x3a3fa9,_0xc3cf4d,_0x2263a1){return _0x3a3fa9(_0xc3cf4d,_0x2263a1);}},_0x56f71d=await _0x4b9684[_0x3c8164(0x13f)](getToken);if(!_0x56f71d)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x2d0773=_0x4b9684['CgjYf'](getApiBaseUrl),_0x503bf1=await _0x4b9684['KEenj'](fetch,_0x2d0773+'/api/v1/mcp/features/'+_0x130803,{'method':_0x3c8164(0x156),'headers':{'Authorization':_0x3c8164(0x121)+_0x56f71d}});if(!_0x503bf1['ok']){const _0x19c640=await _0x503bf1[_0x3c8164(0x164)]();throw new Error('Failed\x20to\x20delete\x20feature\x20review:\x20'+_0x19c640);}}export async function restoreFeature(_0x56284e){const _0x3e5ceb=_0x3133,_0x3a40bc={'rOLhe':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','kzZJO':function(_0x427c1c){return _0x427c1c();},'mbTeV':'POST'},_0x2b1919=await getToken();if(!_0x2b1919)throw new Error(_0x3a40bc['rOLhe']);const _0x4bd6cc=_0x3a40bc[_0x3e5ceb(0x15c)](getApiBaseUrl),_0x43a943=await fetch(_0x4bd6cc+'/api/v1/mcp/features/'+_0x56284e+_0x3e5ceb(0x158),{'method':_0x3a40bc['mbTeV'],'headers':{'Authorization':'Bearer\x20'+_0x2b1919}});if(!_0x43a943['ok']){const _0x4a7165=await _0x43a943['text']();throw new Error(_0x3e5ceb(0x145)+_0x4a7165);}}
1
+ (function(_0x123942,_0x117ad5){const _0x189d1c=_0x18b9,_0x28d3b6=_0x123942();while(!![]){try{const _0x145b2c=-parseInt(_0x189d1c(0xc3))/0x1*(parseInt(_0x189d1c(0xc1))/0x2)+parseInt(_0x189d1c(0xa8))/0x3+parseInt(_0x189d1c(0xeb))/0x4+parseInt(_0x189d1c(0xd1))/0x5*(parseInt(_0x189d1c(0xcb))/0x6)+-parseInt(_0x189d1c(0xa4))/0x7*(-parseInt(_0x189d1c(0xa5))/0x8)+-parseInt(_0x189d1c(0xe4))/0x9*(-parseInt(_0x189d1c(0xe2))/0xa)+-parseInt(_0x189d1c(0xb2))/0xb;if(_0x145b2c===_0x117ad5)break;else _0x28d3b6['push'](_0x28d3b6['shift']());}catch(_0x4d4a17){_0x28d3b6['push'](_0x28d3b6['shift']());}}}(_0x787d,0xddf69));import{getToken}from'./keychain.js';function _0x787d(){const _0x4fb474=['/report/markdown','limit','Failed\x20to\x20start\x20session:\x20','tJGCu','join','53106KNBVsX','Failed\x20to\x20get\x20action\x20items:\x20','GET','BwxBU','includeDeleted','xLncc','295emEdTd','zRXmo','jptHy','Feature\x20limit\x20exceeded','Failed\x20to\x20update\x20scenario:\x20','XajHb','Zfaie','RbkCV','gitBranch','billingUrl','Failed\x20to\x20delete\x20feature\x20review:\x20','Failed\x20to\x20create\x20scenario:\x20','YvHLR','Bearer\x20','set','mPPJx','TmUXi','90CBBybt','BiQKh','35010pBEXND','Failed\x20to\x20update\x20feature\x20review:\x20','text','pfgIk','QpCer','message','vFvoR','2299796CReLJO','HXveV','XEHnc','/comments/address','https://dashboard.ranger.net/billing','PATCH','sessionId','Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20','true','application/json','Failed\x20to\x20get\x20feature\x20review:\x20','SNbJL','status','7NhSrjZ','8595368OrSoCE','json','/api/v1/mcp/features/','5056275gDUwiP','Failed\x20to\x20restore\x20feature\x20review:\x20','hWMDb','NRoNX','WYTGB','XFqyf','gitRepoUrl','HGMHc','/conclude','/sessions','28377866LxJfxT','offset','style','CQSNF','stringify','/checklist','pomkd','POST','/report','RjgNV','PRKEi','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','length','NIwWC','/api/v1/mcp/features','4714VBkwPz','toString','171OOuBcy','bHHMT','\x0a\x0aUpgrade\x20your\x20plan:\x20'];_0x787d=function(){return _0x4fb474;};return _0x787d();}import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x464bf6){const _0x5e1505=_0x18b9,_0x203c22={'vFvoR':function(_0x30b8e1){return _0x30b8e1();},'ghJjV':'application/json','MmIAg':_0x5e1505(0x9b)},_0x31d605=await getToken();if(!_0x31d605)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x478930=_0x203c22[_0x5e1505(0xea)](getApiBaseUrl),_0x500567=await fetch(_0x478930+_0x5e1505(0xc0),{'method':_0x5e1505(0xb9),'headers':{'Authorization':'Bearer\x20'+_0x31d605,'Content-Type':_0x203c22['ghJjV']},'body':JSON[_0x5e1505(0xb6)](_0x464bf6)});if(!_0x500567['ok']){if(_0x500567[_0x5e1505(0xa3)]===0x192){const _0x8a2972=await _0x500567['json'](),_0x176dc9=_0x8a2972[_0x5e1505(0xda)]||_0x203c22['MmIAg'];throw new Error((_0x8a2972[_0x5e1505(0xe9)]||_0x5e1505(0xd4))+_0x5e1505(0xc5)+_0x176dc9);}const _0x4bf27e=await _0x500567['text']();throw new Error('Failed\x20to\x20create\x20feature\x20review:\x20'+_0x4bf27e);}return _0x500567[_0x5e1505(0xa6)]();}export async function listFeatures(_0x54c99d){const _0x35effe=_0x18b9,_0x413114={'SNbJL':function(_0x20caaf){return _0x20caaf();},'RbkCV':_0x35effe(0xae),'YvHLR':_0x35effe(0xc7),'UDvcT':_0x35effe(0xb3),'dmygG':function(_0x37a068,_0x3f2192,_0x279564){return _0x37a068(_0x3f2192,_0x279564);}},_0x390bfd=await _0x413114[_0x35effe(0xa2)](getToken);if(!_0x390bfd)throw new Error(_0x35effe(0xbd));const _0xf901fb=getApiBaseUrl(),_0x353311=new URLSearchParams();if(_0x54c99d?.[_0x35effe(0xae)])_0x353311[_0x35effe(0xdf)](_0x413114[_0x35effe(0xd8)],_0x54c99d['gitRepoUrl']);if(_0x54c99d?.['gitBranch'])_0x353311[_0x35effe(0xdf)]('gitBranch',_0x54c99d[_0x35effe(0xd9)]);if(_0x54c99d?.['limit'])_0x353311[_0x35effe(0xdf)](_0x413114[_0x35effe(0xdd)],_0x54c99d[_0x35effe(0xc7)][_0x35effe(0xc2)]());if(_0x54c99d?.[_0x35effe(0xb3)])_0x353311['set'](_0x413114['UDvcT'],_0x54c99d[_0x35effe(0xb3)][_0x35effe(0xc2)]());if(_0x54c99d?.[_0x35effe(0xcf)])_0x353311['set'](_0x35effe(0xcf),_0x35effe(0x9f));const _0x2b4dc6=_0xf901fb+_0x35effe(0xc0)+(_0x353311[_0x35effe(0xc2)]()?'?'+_0x353311[_0x35effe(0xc2)]():''),_0x2b52ad=await _0x413114['dmygG'](fetch,_0x2b4dc6,{'method':_0x35effe(0xcd),'headers':{'Authorization':_0x35effe(0xde)+_0x390bfd}});if(!_0x2b52ad['ok']){const _0x3aabcf=await _0x2b52ad[_0x35effe(0xe6)]();throw new Error('Failed\x20to\x20list\x20feature\x20reviews:\x20'+_0x3aabcf);}return _0x2b52ad[_0x35effe(0xa6)]();}export async function getFeature(_0x58b522){const _0x581020=_0x18b9,_0x15ad5e={'HGMHc':function(_0x5ad536){return _0x5ad536();},'mPPJx':_0x581020(0xbd)},_0x5eb1d6=await _0x15ad5e[_0x581020(0xaf)](getToken);if(!_0x5eb1d6)throw new Error(_0x15ad5e[_0x581020(0xe0)]);const _0x54cdda=getApiBaseUrl(),_0xc00a9f=await fetch(_0x54cdda+'/api/v1/mcp/features/'+_0x58b522,{'method':_0x581020(0xcd),'headers':{'Authorization':'Bearer\x20'+_0x5eb1d6}});if(!_0xc00a9f['ok']){const _0x2b36a5=await _0xc00a9f[_0x581020(0xe6)]();throw new Error(_0x581020(0xa1)+_0x2b36a5);}return _0xc00a9f[_0x581020(0xa6)]();}export async function updateFeature(_0x52ecdc,_0x4aaa0a){const _0x2e2edf=_0x18b9,_0x3f0fbb={'QpCer':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','HXveV':function(_0x2fa05b){return _0x2fa05b();},'WIqQC':'PATCH'},_0x3a11fa=await getToken();if(!_0x3a11fa)throw new Error(_0x3f0fbb[_0x2e2edf(0xe8)]);const _0x13e0e3=_0x3f0fbb[_0x2e2edf(0xec)](getApiBaseUrl),_0x33d661=await fetch(_0x13e0e3+_0x2e2edf(0xa7)+_0x52ecdc,{'method':_0x3f0fbb['WIqQC'],'headers':{'Authorization':'Bearer\x20'+_0x3a11fa,'Content-Type':_0x2e2edf(0xa0)},'body':JSON[_0x2e2edf(0xb6)](_0x4aaa0a)});if(!_0x33d661['ok']){const _0x1fa419=await _0x33d661[_0x2e2edf(0xe6)]();throw new Error(_0x2e2edf(0xe5)+_0x1fa419);}return _0x33d661['json']();}export async function createChecklistItem(_0x52db29,_0xd7620e,_0x4a2fb1){const _0x56bdf7=_0x18b9,_0x1974f5={'FTUHY':function(_0x3f0f04){return _0x3f0f04();},'ixEyZ':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','XajHb':function(_0x399bcc){return _0x399bcc();}},_0xe814d2=await _0x1974f5['FTUHY'](getToken);if(!_0xe814d2)throw new Error(_0x1974f5['ixEyZ']);const _0x3720ac=_0x1974f5[_0x56bdf7(0xd6)](getApiBaseUrl),_0x4a3898=await fetch(_0x3720ac+'/api/v1/mcp/features/'+_0x52db29+_0x56bdf7(0xb7),{'method':'POST','headers':{'Authorization':_0x56bdf7(0xde)+_0xe814d2,'Content-Type':'application/json'},'body':JSON[_0x56bdf7(0xb6)]({'description':_0xd7620e,'position':_0x4a2fb1})});if(!_0x4a3898['ok']){const _0xeeae69=await _0x4a3898[_0x56bdf7(0xe6)]();throw new Error(_0x56bdf7(0xdc)+_0xeeae69);}return _0x4a3898['json']();}export async function updateChecklistItem(_0x59a29f,_0x15210e,_0xc46d7a){const _0x25cbf8=_0x18b9,_0x31a89a={'Zfaie':function(_0x500cda){return _0x500cda();},'PKPXz':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','CQSNF':_0x25cbf8(0x9c),'hWMDb':function(_0x260ec0,_0x2ebb71,_0x1e15f4){return _0x260ec0(_0x2ebb71,_0x1e15f4);},'XrdiI':'updateChecklistItem'};return _0x31a89a[_0x25cbf8(0xaa)](withRetry,async()=>{const _0xa0d5f5=_0x25cbf8,_0x191049=await _0x31a89a[_0xa0d5f5(0xd7)](getToken);if(!_0x191049)throw new Error(_0x31a89a['PKPXz']);const _0x435f05=_0x31a89a[_0xa0d5f5(0xd7)](getApiBaseUrl),_0x3fa1fb=await fetch(_0x435f05+'/api/v1/mcp/features/'+_0x59a29f+'/checklist/'+_0x15210e,{'method':_0x31a89a[_0xa0d5f5(0xb5)],'headers':{'Authorization':_0xa0d5f5(0xde)+_0x191049,'Content-Type':'application/json'},'body':JSON[_0xa0d5f5(0xb6)](_0xc46d7a)});if(!_0x3fa1fb['ok']){const _0x3a074a=await _0x3fa1fb[_0xa0d5f5(0xe6)]();throw new Error(_0xa0d5f5(0xd5)+_0x3a074a);}return _0x3fa1fb['json']();},{'label':_0x31a89a['XrdiI']});}export async function getFeatureReport(_0x3af270){const _0xbe206d=_0x18b9,_0x5dbe51={'qCTWC':_0xbe206d(0xbd)},_0x3ce551=await getToken();if(!_0x3ce551)throw new Error(_0x5dbe51['qCTWC']);const _0x37b0db=getApiBaseUrl(),_0x1c8f69=await fetch(_0x37b0db+'/api/v1/mcp/features/'+_0x3af270+_0xbe206d(0xba),{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x3ce551}});if(!_0x1c8f69['ok']){const _0x5ea344=await _0x1c8f69[_0xbe206d(0xe6)]();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report:\x20'+_0x5ea344);}return _0x1c8f69['json']();}export async function getFeatureReportMarkdown(_0x33590f,_0x18168c){const _0x56956f=_0x18b9,_0x1e0b89={'bHHMT':_0x56956f(0xbd),'TmUXi':'itemIds','BwxBU':_0x56956f(0x9d),'NRoNX':function(_0x1e6217,_0x20faf9){return _0x1e6217&&_0x20faf9;},'jptHy':_0x56956f(0xb4),'VwfQs':'GET'},_0x168f09=await getToken();if(!_0x168f09)throw new Error(_0x1e0b89[_0x56956f(0xc4)]);const _0x31529a=getApiBaseUrl(),_0x3db79a=new URLSearchParams(),_0x2b88eb=(_0x18168c?.['itemIds']?.[_0x56956f(0xbe)]??0x0)>0x0,_0x5c4187=Boolean(_0x18168c?.[_0x56956f(0x9d)]);_0x2b88eb&&_0x18168c?.['itemIds']&&_0x3db79a[_0x56956f(0xdf)](_0x1e0b89[_0x56956f(0xe1)],_0x18168c['itemIds'][_0x56956f(0xca)](','));_0x5c4187&&_0x18168c?.['sessionId']&&_0x3db79a['set'](_0x1e0b89[_0x56956f(0xce)],_0x18168c['sessionId']);_0x1e0b89[_0x56956f(0xab)](!_0x2b88eb,!_0x5c4187)&&_0x18168c?.['style']&&_0x3db79a['set'](_0x1e0b89[_0x56956f(0xd3)],_0x18168c[_0x56956f(0xb4)]);const _0x321483=_0x31529a+_0x56956f(0xa7)+_0x33590f+_0x56956f(0xc6),_0x30b4a3=''+_0x321483+(_0x3db79a[_0x56956f(0xc2)]()?'?'+_0x3db79a['toString']():''),_0x2ef7b=await fetch(_0x30b4a3,{'method':_0x1e0b89['VwfQs'],'headers':{'Authorization':_0x56956f(0xde)+_0x168f09}});if(!_0x2ef7b['ok']){const _0x589aeb=await _0x2ef7b['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20'+_0x589aeb);}return _0x2ef7b[_0x56956f(0xe6)]();}export async function listFeatureSessions(_0xb1b8ce){const _0x5974fe=_0x18b9,_0x36743e={'pfgIk':_0x5974fe(0xbd),'xLncc':function(_0x387897){return _0x387897();}},_0x407364=await getToken();if(!_0x407364)throw new Error(_0x36743e[_0x5974fe(0xe7)]);const _0x286e89=_0x36743e[_0x5974fe(0xd0)](getApiBaseUrl),_0x26c18c=await fetch(_0x286e89+'/api/v1/mcp/features/'+_0xb1b8ce+_0x5974fe(0xb1),{'method':_0x5974fe(0xcd),'headers':{'Authorization':_0x5974fe(0xde)+_0x407364}});if(!_0x26c18c['ok']){const _0x258ea0=await _0x26c18c[_0x5974fe(0xe6)]();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x258ea0);}return _0x26c18c['json']();}export async function startSession(_0xd1258b,_0x101f14){const _0x2eafe0=_0x18b9,_0x1f9483={'RjgNV':function(_0x4ad339){return _0x4ad339();},'AcKYi':function(_0x5cd7cb,_0xa16692,_0x2437ad){return _0x5cd7cb(_0xa16692,_0x2437ad);},'okotw':'POST'},_0x3a9e66=await _0x1f9483[_0x2eafe0(0xbb)](getToken);if(!_0x3a9e66)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x16c66b=_0x1f9483[_0x2eafe0(0xbb)](getApiBaseUrl),_0x20f75e=await _0x1f9483['AcKYi'](fetch,_0x16c66b+'/api/v1/mcp/features/'+_0xd1258b+'/sessions/'+_0x101f14+'/start',{'method':_0x1f9483['okotw'],'headers':{'Authorization':_0x2eafe0(0xde)+_0x3a9e66}});if(!_0x20f75e['ok']){const _0x37ac62=await _0x20f75e[_0x2eafe0(0xe6)]();throw new Error(_0x2eafe0(0xc8)+_0x37ac62);}return _0x20f75e[_0x2eafe0(0xa6)]();}export async function concludeSession(_0x2439cb,_0x5069ee){const _0x4c1ed1=_0x18b9,_0x4298c8={'pomkd':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x460107=await getToken();if(!_0x460107)throw new Error(_0x4298c8[_0x4c1ed1(0xb8)]);const _0x2426cd=getApiBaseUrl(),_0x2512bf=await fetch(_0x2426cd+'/api/v1/mcp/features/'+_0x2439cb+'/sessions/'+_0x5069ee+_0x4c1ed1(0xb0),{'method':_0x4c1ed1(0xb9),'headers':{'Authorization':_0x4c1ed1(0xde)+_0x460107}});if(!_0x2512bf['ok']){const _0x5cadfa=await _0x2512bf[_0x4c1ed1(0xe6)]();throw new Error('Failed\x20to\x20conclude\x20session:\x20'+_0x5cadfa);}return _0x2512bf[_0x4c1ed1(0xa6)]();}function _0x18b9(_0x2a32c1,_0x471954){_0x2a32c1=_0x2a32c1-0x9b;const _0x787dec=_0x787d();let _0x18b9af=_0x787dec[_0x2a32c1];return _0x18b9af;}export async function getActionItems(_0x70cd35){const _0x34d220=_0x18b9,_0xc541ce={'HKFwU':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','zRXmo':function(_0x320fd7){return _0x320fd7();},'XFqyf':function(_0x2b2514,_0x5125f2,_0x2e5924){return _0x2b2514(_0x5125f2,_0x2e5924);}},_0xf34b49=await getToken();if(!_0xf34b49)throw new Error(_0xc541ce['HKFwU']);const _0x2fd52c=_0xc541ce[_0x34d220(0xd2)](getApiBaseUrl),_0x51b447=await _0xc541ce[_0x34d220(0xad)](fetch,_0x2fd52c+_0x34d220(0xa7)+_0x70cd35+'/action-items',{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0xf34b49}});if(!_0x51b447['ok']){const _0x49e547=await _0x51b447['text']();throw new Error(_0x34d220(0xcc)+_0x49e547);}return _0x51b447[_0x34d220(0xa6)]();}export async function getItemFeedback(_0x42e8a8,_0x1a7312){const _0x42d7a5=_0x18b9,_0x1b40a2={'NIwWC':function(_0x3e13bc){return _0x3e13bc();},'HHSKv':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x66d5f9=await _0x1b40a2[_0x42d7a5(0xbf)](getToken);if(!_0x66d5f9)throw new Error(_0x1b40a2['HHSKv']);const _0x502614=getApiBaseUrl(),_0x1c85ae=await fetch(_0x502614+'/api/v1/mcp/features/'+_0x42e8a8+'/checklist-items/'+_0x1a7312+'/feedback',{'method':'GET','headers':{'Authorization':_0x42d7a5(0xde)+_0x66d5f9}});if(!_0x1c85ae['ok']){const _0x5ac9aa=await _0x1c85ae[_0x42d7a5(0xe6)]();throw new Error('Failed\x20to\x20get\x20item\x20feedback:\x20'+_0x5ac9aa);}return _0x1c85ae['json']();}export async function markCommentsAddressed(_0x1ac6ee,_0x5c2bd5,_0x1b8205){const _0x17560a=_0x18b9,_0x3ccbfd={'tJGCu':function(_0x390fa0){return _0x390fa0();},'isQRu':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','Szbmw':function(_0x32e0e7){return _0x32e0e7();},'XEHnc':_0x17560a(0xa0)},_0x308ac6=await _0x3ccbfd[_0x17560a(0xc9)](getToken);if(!_0x308ac6)throw new Error(_0x3ccbfd['isQRu']);const _0x107cd6=_0x3ccbfd['Szbmw'](getApiBaseUrl),_0x4e5056=await fetch(_0x107cd6+'/api/v1/mcp/features/'+_0x1ac6ee+_0x17560a(0xee),{'method':_0x17560a(0xb9),'headers':{'Authorization':_0x17560a(0xde)+_0x308ac6,'Content-Type':_0x3ccbfd[_0x17560a(0xed)]},'body':JSON['stringify']({'checklistItemId':_0x5c2bd5,'commentIds':_0x1b8205})});if(!_0x4e5056['ok']){const _0x72e898=await _0x4e5056[_0x17560a(0xe6)]();throw new Error(_0x17560a(0x9e)+_0x72e898);}}export async function softDeleteFeature(_0x3c9feb){const _0x3c1862=_0x18b9,_0x29e67d={'PRKEi':function(_0x52be85){return _0x52be85();},'zcPJp':_0x3c1862(0xbd),'BiQKh':'DELETE'},_0x586bd3=await _0x29e67d[_0x3c1862(0xbc)](getToken);if(!_0x586bd3)throw new Error(_0x29e67d['zcPJp']);const _0x59c14f=_0x29e67d[_0x3c1862(0xbc)](getApiBaseUrl),_0x145f15=await fetch(_0x59c14f+'/api/v1/mcp/features/'+_0x3c9feb,{'method':_0x29e67d[_0x3c1862(0xe3)],'headers':{'Authorization':'Bearer\x20'+_0x586bd3}});if(!_0x145f15['ok']){const _0x50ac27=await _0x145f15[_0x3c1862(0xe6)]();throw new Error(_0x3c1862(0xdb)+_0x50ac27);}}export async function restoreFeature(_0xe1e74b){const _0xed63d9=_0x18b9,_0x4d3a6b={'QQrtb':function(_0x4fee4c){return _0x4fee4c();},'WYTGB':function(_0x27b555){return _0x27b555();}},_0x36f73f=await _0x4d3a6b['QQrtb'](getToken);if(!_0x36f73f)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x1db517=_0x4d3a6b[_0xed63d9(0xac)](getApiBaseUrl),_0x3f21b0=await fetch(_0x1db517+_0xed63d9(0xa7)+_0xe1e74b+'/restore',{'method':_0xed63d9(0xb9),'headers':{'Authorization':'Bearer\x20'+_0x36f73f}});if(!_0x3f21b0['ok']){const _0x4c6421=await _0x3f21b0['text']();throw new Error(_0xed63d9(0xa9)+_0x4c6421);}}