@ranger-testing/ranger-cli 2.5.3 → 2.5.4-alpha.0e8b82c-9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/migrateProfile.js +1 -0
- package/build/commands/setup/claude.js +1 -1
- package/build/commands/setup/opencode.js +1 -1
- package/build/commands/setupCi.js +1 -1
- package/build/commands/skillup.js +1 -1
- package/build/commands/start.js +1 -1
- package/build/commands/status.js +1 -1
- package/build/commands/update.js +1 -1
- package/build/commands/updateEnv.js +1 -1
- package/build/commands/useEnv.js +1 -1
- package/build/commands/utils/activeProfile.js +1 -1
- package/build/commands/utils/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/cloudProfile.js +1 -0
- package/build/commands/utils/cloudProfileSession.js +1 -0
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/gitTracked.js +1 -0
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/matchAuthEnvironment.js +1 -0
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/opencodeConfig.js +1 -1
- package/build/commands/utils/playwrightCli.js +1 -1
- package/build/commands/utils/profileMessages.js +1 -1
- package/build/commands/utils/profileSetupBanner.js +1 -1
- package/build/commands/utils/projectsConfig.js +1 -0
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/resolveProfileContext.js +1 -0
- package/build/commands/utils/resolveProfileUrl.js +1 -0
- package/build/commands/utils/retry.js +1 -1
- package/build/commands/utils/sessionCache.js +1 -1
- package/build/commands/utils/settings.js +1 -1
- package/build/commands/utils/skillContent.js +1 -1
- package/build/commands/utils/skills.js +1 -1
- package/build/commands/utils/stitchWebmFiles.js +1 -1
- package/build/commands/utils/telemetry.js +1 -1
- package/build/commands/utils/tokenRefresh.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -1
- package/build/commands/utils/userApi.js +1 -1
- package/build/commands/utils/version.js +1 -1
- package/build/commands/verifyFeature.js +1 -1
- package/build/commands/verifyFeatureCli.js +1 -1
- package/build/skills/ranger/SKILL.md +18 -4
- package/build/skills/ranger/create.md +6 -0
- package/build/skills/ranger/verify.md +17 -3
- package/package.json +6 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x38dabe,_0x5e600c){const _0xba87ac=_0x15c8,_0xe1af59=_0x38dabe();while(!![]){try{const _0x1b5f51=-parseInt(_0xba87ac(0x178))/0x1+-parseInt(_0xba87ac(0x15b))/0x2+-parseInt(_0xba87ac(0x185))/0x3+parseInt(_0xba87ac(0x172))/0x4*(parseInt(_0xba87ac(0x17f))/0x5)+-parseInt(_0xba87ac(0x13a))/0x6*(-parseInt(_0xba87ac(0x136))/0x7)+parseInt(_0xba87ac(0x158))/0x8+parseInt(_0xba87ac(0x157))/0x9*(parseInt(_0xba87ac(0x132))/0xa);if(_0x1b5f51===_0x5e600c)break;else _0xe1af59['push'](_0xe1af59['shift']());}catch(_0x5bf815){_0xe1af59['push'](_0xe1af59['shift']());}}}(_0x5bb1,0x25eb6));const _0x4a7ec6=(function(){const _0x13182b=_0x15c8,_0x2ff1d2={'fpSqe':_0x13182b(0x162),'AEfTo':_0x13182b(0x143),'LDFkj':_0x13182b(0x13b)};let _0x21cd29=!![];return function(_0x9d48a1,_0x3d5efc){const _0x143528=_0x13182b,_0x510a94={'XMqEK':_0x2ff1d2[_0x143528(0x15e)]};if(_0x2ff1d2[_0x143528(0x16c)]!==_0x2ff1d2[_0x143528(0x138)]){const _0x3a274b=_0x21cd29?function(){if(_0x3d5efc){const _0x257741=_0x3d5efc['apply'](_0x9d48a1,arguments);return _0x3d5efc=null,_0x257741;}}:function(){};return _0x21cd29=![],_0x3a274b;}else throw new _0x3d3f57(_0x510a94[_0x143528(0x14e)]);};}()),_0x3a04db=_0x4a7ec6(this,function(){const _0x518e9a=_0x15c8,_0x2ce931={'EXSqM':_0x518e9a(0x133)};return _0x3a04db[_0x518e9a(0x190)]()[_0x518e9a(0x17a)](_0x2ce931[_0x518e9a(0x187)])[_0x518e9a(0x190)]()['constructor'](_0x3a04db)[_0x518e9a(0x17a)](_0x518e9a(0x133));});_0x3a04db();import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';function _0x5bb1(){const _0x4a4a95=['rMfPBgvKihrVigDLDcbICM93C2vYihnLC3nPB24GC3rLChm6ia','veHRB2G','AhvjywS','BfjSA0i','vevYBMe','Bwq1','ntyXntf4DgLMtMq','ode4nZKYBfjXv3zl','DMLKzw8VD2vIBq','yxbWBhK','ntKXntKYu2j5zvL4','uefuq0G','y2ryrvy','zNbtCwu','EwfqEMi','rMfPBgvKihrVignYzwf0zsbZDgvWigfZC2v0oIa','zMvHDhvYzuLK','tM8GqvbjihrVA2vUignVBMzPz3vYzwqUifj1BJOGCMfUz2vYihnLDhvWifT0B2TLBL0','shn4sK0','DxjS','AMrsDuy','ue9tva','l3vWBg9Hzc11CMXZ','sgn1Dxq','uK93A0C','z3DPBhK','yMfZzty0','quvMvg8','z1b2sxa','ANnVBG','BgvvweC','D05WugC','vLDHtLq','nJiWodm2svj6qLPV','y1PzvMu','l2fZC2v0CW','Aw1Hz2uVCg5N','DgfZAW','AenMEhG','ote3mdvezuDzAfu','EenNwey','C2vHCMnO','s0nxtLG','rMfPBgvKihrVigDLDcbWCM94EsbZzxnZAw9UihrVA2vUoIa','vMX5s1m','wu5MwLu','mtb1BerQsM8','ugXstvm','v0Tbug0','Ehf6BK0','qvjZwhC','C2L6zq','ntaXoti3z0PlrgvN','yuX3rha','rvHtCu0','yxHvDxa','sKDPzhe','rwzpreO','r0vu','l2fWAs92ms9Ty3aVyNjVD3nLCI1ZzxnZAw9UCW','rM5LB1K','l3n0zxbZ','v3fmzKm','Dg9tDhjPBMC','C2zKvgq','wNL2zfy','q1LXC1K','yxbWBgLJyxrPB24VANnVBG','uNrnC20','rvvcAfa','u0XOrMS','sufSD3C','Dgv4Da','qMvHCMvYia','Bwv0ywrHDge','zgLNzxn0','BgvUz3rO','rMfPBgvKihrVihvWBg9HzcbMAwXLoIa','DfDVu0C','rNnkrMi','z05UtLi','uen4DM0','rMfPBgvKihrVignYzwf0zsbICM93C2vYihnLC3nPB246ia','CKzmqNq','CNH2sxu','AMzABe4','y0fMDgq','Ahr0Chm6lY90CMfJzs5WBgf5D3jPz2H0lMrLDI8/DhjHy2u9','sxzxALm','DxbKyxrL','yvfuvxK','C3rYAw5NAwz5','rMfPBgvKihrVihvWzgf0zsbICM93C2vYihnLC3nPB246ia','yK5Hr3y','zg9lDLC','zw52AxjVBM1LBNroyw1L','ntbbBfLSAfa','kcGOlISPkYKRksSK','tfvIExq','reDty1K','mtrJAhDWzhu','ufvu','tergA2O','l2fWAs92ms9Ty3aVyNjVD3nLCI1ZzxnZAw9UCY8','nZK4ndK4A3jWtxHq','rKzbBxm','Ae9Rv1K','yxbWBgLJyxrPB24VEMLW','sMTTEfi','zhfPuvm','y0f2wwC','rMfPBgvKihrVihvWzgf0zsb2zxjPzMLJyxrPB24GC3rLCdOG','yLHSq0e','rMX0r1O','AuT2B24','Be5eCKe','rMfPBgvKihrVignYzwf0zsb2zxjPzMLJyxrPB24GC3rLCdOG','rMfPBgvKihrVigDLDcbICM93C2vYihnLC3nPB246ia','l3n0zxbZlW','rgXhwMy','C2vZC2LVBLrVA2vU','C2v0DgLUz3m','rNHzsLy','DxHnC0W','we1XruS','wwnkAgq','l2fWAs92ms9Ty3aVChjVEhKTC2vZC2LVBG'];_0x5bb1=function(){return _0x4a4a95;};return _0x5bb1();}import{createHash}from'crypto';import{withRetry}from'./retry.js';export async function createBrowserSession(_0x2ad2b6){const _0x2840d8=_0x15c8,_0x2409fe={'SLhFk':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','YcJhd':function(_0x452f40){return _0x452f40();},'puPpY':function(_0x437434,_0x21b03d,_0x30c54b){return _0x437434(_0x21b03d,_0x30c54b);},'ROwkG':_0x2840d8(0x194)},_0xf07aef=await getToken();if(!_0xf07aef)throw new Error(_0x2409fe[_0x2840d8(0x197)]);const _0x567e64=_0x2409fe[_0x2840d8(0x14f)](getApiBaseUrl),_0x3872db=await _0x2409fe['puPpY'](fetch,_0x567e64+_0x2840d8(0x18c),{'method':_0x2840d8(0x166),'headers':{'Authorization':'Bearer\x20'+_0xf07aef,'Content-Type':_0x2409fe[_0x2840d8(0x169)]},'body':JSON[_0x2840d8(0x12d)]({'environmentName':_0x2ad2b6?.[_0x2840d8(0x131)],'settings':_0x2ad2b6?.[_0x2840d8(0x14b)],'task':_0x2ad2b6?.[_0x2840d8(0x176)],'url':_0x2ad2b6?.[_0x2840d8(0x164)],'featureId':_0x2ad2b6?.[_0x2840d8(0x161)],'checklistItemId':_0x2ad2b6?.['checklistItemId']})});if(!_0x3872db['ok']){const _0x26f503=await _0x3872db[_0x2840d8(0x199)]();throw new Error(_0x2840d8(0x124)+_0x26f503);}return _0x3872db[_0x2840d8(0x16e)]();}export async function updateBrowserSession(_0x1dab8c,_0x3ae2cd){const _0x37fc50=_0x15c8,_0x40da26={'WKAPm':_0x37fc50(0x162),'ARsXw':_0x37fc50(0x12a),'EUBhP':function(_0x6c30b3){return _0x6c30b3();},'VlyKS':'ChUqw','JMbLU':function(_0x38e784,_0x4e0c55,_0x45eaea){return _0x38e784(_0x4e0c55,_0x45eaea);},'gwily':_0x37fc50(0x15c),'rFLBt':_0x37fc50(0x194),'JGidq':function(_0x247e57,_0xedc894,_0xdad729){return _0x247e57(_0xedc894,_0xdad729);},'jdRuF':'updateBrowserSession'};return _0x40da26[_0x37fc50(0x189)](withRetry,async()=>{const _0x43ff1e=_0x37fc50;if(_0x43ff1e(0x12a)!==_0x40da26[_0x43ff1e(0x183)])throw new _0x5ba0a6(_0x40da26[_0x43ff1e(0x181)]);else{const _0x680c35=await _0x40da26[_0x43ff1e(0x196)](getToken);if(!_0x680c35){if(_0x43ff1e(0x18d)===_0x40da26[_0x43ff1e(0x17d)])throw new _0x4feb52(_0x43ff1e(0x162));else throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');}const _0x762f0c=_0x40da26[_0x43ff1e(0x196)](getApiBaseUrl),_0x69bc39=await _0x40da26['JMbLU'](fetch,_0x762f0c+'/api/v1/mcp/browser-sessions/'+_0x1dab8c,{'method':_0x40da26[_0x43ff1e(0x16a)],'headers':{'Authorization':_0x43ff1e(0x19a)+_0x680c35,'Content-Type':_0x40da26[_0x43ff1e(0x125)]},'body':JSON[_0x43ff1e(0x12d)](_0x3ae2cd)});if(!_0x69bc39['ok']){const _0x394b33=await _0x69bc39[_0x43ff1e(0x199)]();throw new Error(_0x43ff1e(0x12e)+_0x394b33);}return _0x69bc39['json']();}},{'label':_0x40da26[_0x37fc50(0x165)]});}export async function getBrowserSession(_0x247058){const _0x2e20d2=_0x15c8,_0x53b096={'PlRMS':function(_0x42fd69){return _0x42fd69();},'RtMsm':_0x2e20d2(0x162),'FxYJV':function(_0x29762c,_0x5d9412,_0x309aa4){return _0x29762c(_0x5d9412,_0x309aa4);},'KkqPE':_0x2e20d2(0x18b)},_0x24204b=await _0x53b096[_0x2e20d2(0x180)](getToken);if(!_0x24204b)throw new Error(_0x53b096[_0x2e20d2(0x195)]);const _0x2aa917=_0x53b096[_0x2e20d2(0x180)](getApiBaseUrl),_0x1ff271=await _0x53b096[_0x2e20d2(0x14c)](fetch,_0x2aa917+'/api/v1/mcp/browser-sessions/'+_0x247058,{'method':_0x53b096['KkqPE'],'headers':{'Authorization':_0x2e20d2(0x19a)+_0x24204b}});if(!_0x1ff271['ok']){const _0x267161=await _0x1ff271['text']();throw new Error(_0x2e20d2(0x147)+_0x267161);}return _0x1ff271[_0x2e20d2(0x16e)]();}export async function getUploadUrls(_0x2b8d86,_0x31df51,_0x50a442,_0xdb2c38){const _0x5abc58=_0x15c8,_0x3bde5f={'hOkWY':function(_0x2d472f){return _0x2d472f();},'doKvW':_0x5abc58(0x166),'XlaSn':_0x5abc58(0x194),'axUup':function(_0x1747fb,_0x180d80){return _0x1747fb!==_0x180d80;},'IAlww':function(_0xcbc0e4,_0x427069){return _0xcbc0e4!==_0x427069;}},_0x43b8e=await getToken();if(!_0x43b8e)throw new Error(_0x5abc58(0x162));const _0x11c728=_0x3bde5f[_0x5abc58(0x13c)](getApiBaseUrl),_0x240d21=await fetch(_0x11c728+_0x5abc58(0x139)+_0x2b8d86+_0x5abc58(0x167),{'method':_0x3bde5f[_0x5abc58(0x130)],'headers':{'Authorization':_0x5abc58(0x19a)+_0x43b8e,'Content-Type':_0x3bde5f['XlaSn']},'body':JSON[_0x5abc58(0x12d)]({'filename':_0x31df51,'filetype':_0x50a442,..._0x3bde5f['axUup'](_0xdb2c38?.['size'],undefined)&&{'size':_0xdb2c38[_0x5abc58(0x184)]},..._0x3bde5f[_0x5abc58(0x188)](_0xdb2c38?.['checksum'],undefined)&&{'checksum':_0xdb2c38['checksum']},..._0x3bde5f[_0x5abc58(0x198)](_0xdb2c38?.[_0x5abc58(0x19b)],undefined)&&{'metadata':_0xdb2c38['metadata']}})});if(!_0x240d21['ok']){const _0x35c52e=await _0x240d21['text']();throw new Error('Failed\x20to\x20get\x20upload\x20URLs:\x20'+_0x35c52e);}return _0x240d21[_0x5abc58(0x16e)]();}export async function uploadFile(_0x2eb968,_0x3ee0a7,_0x1a5f22){const _0x38005b=_0x15c8,_0x584fd0={'dqiQS':function(_0x7e0a32,_0xb81127,_0x477a6c){return _0x7e0a32(_0xb81127,_0x477a6c);},'raYZR':_0x38005b(0x137),'bXlCA':function(_0x21b1ac,_0x187134){return _0x21b1ac===_0x187134;},'rxvIu':_0x38005b(0x193)},_0x1c3cb3=await _0x584fd0[_0x38005b(0x13f)](fetch,_0x2eb968,{'method':_0x584fd0['raYZR'],'headers':{'Content-Type':_0x1a5f22,'Content-Length':_0x3ee0a7[_0x38005b(0x19d)][_0x38005b(0x190)]()},'body':_0x3ee0a7});if(!_0x1c3cb3['ok']){if(_0x584fd0[_0x38005b(0x142)](_0x584fd0['rxvIu'],_0x584fd0[_0x38005b(0x126)])){const _0x251656=await _0x1c3cb3[_0x38005b(0x199)]();throw new Error(_0x38005b(0x19e)+_0x251656);}else throw new _0x90e2f2(_0x38005b(0x162));}}export async function uploadTrace(_0x1ef2f3,_0x27ecb8){const _0x16b435=_0x15c8,_0x19f547={'uxMsL':function(_0x120556,_0x44f2e4,_0xe434ee,_0x3f804c){return _0x120556(_0x44f2e4,_0xe434ee,_0x3f804c);},'tWoSG':_0x16b435(0x13d)};return _0x19f547[_0x16b435(0x14d)](uploadFile,_0x1ef2f3,_0x27ecb8,_0x19f547[_0x16b435(0x19f)]);}export async function uploadConversation(_0x5ac855,_0x5b8cfe){const _0x42997c=_0x15c8,_0xe75a7c={'yaPzb':function(_0x1accb8,_0x5cb723,_0x194177,_0x674cae){return _0x1accb8(_0x5cb723,_0x194177,_0x674cae);}};return _0xe75a7c[_0x42997c(0x15f)](uploadFile,_0x5ac855,_0x5b8cfe,'application/jsonl');}export async function uploadScreenshot(_0x1c7809,_0x40e4ec){const _0x5ce535=_0x15c8,_0x4d4910={'Hcuut':_0x5ce535(0x175)};return uploadFile(_0x1c7809,_0x40e4ec,_0x4d4910[_0x5ce535(0x168)]);}export async function uploadVideo(_0x4e40ec,_0x56aa7a){const _0x1aa9f9=_0x15c8,_0x318f7c={'aQTUy':function(_0x3388dc,_0x29432a,_0x357077,_0x4549c4){return _0x3388dc(_0x29432a,_0x357077,_0x4549c4);}};return _0x318f7c[_0x1aa9f9(0x12c)](uploadFile,_0x4e40ec,_0x56aa7a,_0x1aa9f9(0x159));}export function buildTraceViewerUrl(_0x56c144){const _0x1138b1=_0x15c8,_0x5b4db5={'jfZlN':function(_0x5ce317,_0x275394){return _0x5ce317(_0x275394);}},_0x3fbd6a=_0x5b4db5[_0x1138b1(0x127)](encodeURIComponent,_0x56c144);return _0x1138b1(0x129)+_0x3fbd6a;}function _0x15c8(_0x355afa,_0x5b107c){_0x355afa=_0x355afa-0x124;const _0x19733e=_0x5bb1();let _0x3a04db=_0x19733e[_0x355afa];if(_0x15c8['wpMPRS']===undefined){var _0x4a7ec6=function(_0x67fde8){const _0x20fea7='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xcfafa='',_0x3ea04e='',_0x1ad31c=_0xcfafa+_0x4a7ec6;for(let _0x4460ac=0x0,_0xafb50a,_0xa19627,_0x208592=0x0;_0xa19627=_0x67fde8['charAt'](_0x208592++);~_0xa19627&&(_0xafb50a=_0x4460ac%0x4?_0xafb50a*0x40+_0xa19627:_0xa19627,_0x4460ac++%0x4)?_0xcfafa+=_0x1ad31c['charCodeAt'](_0x208592+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0xafb50a>>(-0x2*_0x4460ac&0x6)):_0x4460ac:0x0){_0xa19627=_0x20fea7['indexOf'](_0xa19627);}for(let _0x57fb24=0x0,_0x32f8ac=_0xcfafa['length'];_0x57fb24<_0x32f8ac;_0x57fb24++){_0x3ea04e+='%'+('00'+_0xcfafa['charCodeAt'](_0x57fb24)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3ea04e);};_0x15c8['NWovAB']=_0x4a7ec6,_0x15c8['bSkfLh']={},_0x15c8['wpMPRS']=!![];}const _0x5bb142=_0x19733e[0x0],_0x15c80f=_0x355afa+_0x5bb142,_0x789e00=_0x15c8['bSkfLh'][_0x15c80f];if(!_0x789e00){const _0xbc4271=function(_0x1ea871){this['PvQKcK']=_0x1ea871,this['EgUuXV']=[0x1,0x0,0x0],this['NWhCpE']=function(){return'newState';},this['bbXjvG']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['DYdsaE']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0xbc4271['prototype']['kzDXkv']=function(){const _0x23b9dd=new RegExp(this['bbXjvG']+this['DYdsaE']),_0x1942df=_0x23b9dd['test'](this['NWhCpE']['toString']())?--this['EgUuXV'][0x1]:--this['EgUuXV'][0x0];return this['rkNvfV'](_0x1942df);},_0xbc4271['prototype']['rkNvfV']=function(_0x160290){if(!Boolean(~_0x160290))return _0x160290;return this['GuRpMC'](this['PvQKcK']);},_0xbc4271['prototype']['GuRpMC']=function(_0x47c7a1){for(let _0xf2306c=0x0,_0x5add04=this['EgUuXV']['length'];_0xf2306c<_0x5add04;_0xf2306c++){this['EgUuXV']['push'](Math['round'](Math['random']())),_0x5add04=this['EgUuXV']['length'];}return _0x47c7a1(this['EgUuXV'][0x0]);},new _0xbc4271(_0x15c8)['kzDXkv'](),_0x3a04db=_0x15c8['NWovAB'](_0x3a04db),_0x15c8['bSkfLh'][_0x15c80f]=_0x3a04db;}else _0x3a04db=_0x789e00;return _0x3a04db;}export async function getProxySessionToken(){const _0x2d2256=_0x15c8,_0x49c086={'WqLfC':function(_0x5e021e){return _0x5e021e();},'LUbyt':'truki','VWaNT':_0x2d2256(0x162),'PCxvm':function(_0x114637,_0x48069f,_0x58ada5){return _0x114637(_0x48069f,_0x58ada5);},'iKvon':_0x2d2256(0x166)},_0x14ad15=await _0x49c086[_0x2d2256(0x18f)](getToken);if(!_0x14ad15){if(_0x49c086[_0x2d2256(0x134)]!==_0x49c086[_0x2d2256(0x134)])throw new _0x115796(_0x2d2256(0x162));else throw new Error(_0x49c086[_0x2d2256(0x171)]);}const _0x170018=_0x49c086[_0x2d2256(0x18f)](getApiBaseUrl),_0x134c26=await _0x49c086[_0x2d2256(0x1a2)](fetch,_0x170018+_0x2d2256(0x150),{'method':_0x49c086[_0x2d2256(0x144)],'headers':{'Authorization':_0x2d2256(0x19a)+_0x14ad15}});if(!_0x134c26['ok']){const _0x27a03d=await _0x134c26[_0x2d2256(0x199)]();throw new Error(_0x2d2256(0x17c)+_0x27a03d);}const _0x14cb9a=await _0x134c26[_0x2d2256(0x16e)]();return _0x14cb9a[_0x2d2256(0x14a)];}export function computeChecksum(_0x3bf65b){const _0x458d47=_0x15c8,_0x21f3dc={'Gljgq':function(_0x393be2,_0x3760a4){return _0x393be2(_0x3760a4);},'NYdWg':'md5','ZyvdV':_0x458d47(0x16b)};return _0x21f3dc['Gljgq'](createHash,_0x21f3dc['NYdWg'])[_0x458d47(0x12b)](_0x3bf65b)[_0x458d47(0x19c)](_0x21f3dc[_0x458d47(0x192)]);}export async function createVerificationStep(_0x346fee,_0x3d1928){const _0xdda909=_0x15c8,_0x3d42be={'huIak':function(_0x4b3306){return _0x4b3306();},'cAftd':_0xdda909(0x162),'xqznM':function(_0x25e499,_0x24d160,_0x464815){return _0x25e499(_0x24d160,_0x464815);},'DlGZf':_0xdda909(0x166)},_0x35611e=await _0x3d42be[_0xdda909(0x153)](getToken);if(!_0x35611e)throw new Error(_0x3d42be[_0xdda909(0x128)]);const _0x593cab=getApiBaseUrl(),_0x22a5e0=await _0x3d42be[_0xdda909(0x182)](fetch,_0x593cab+_0xdda909(0x139)+_0x346fee+_0xdda909(0x18e),{'method':_0x3d42be[_0xdda909(0x149)],'headers':{'Authorization':'Bearer\x20'+_0x35611e,'Content-Type':'application/json'},'body':JSON[_0xdda909(0x12d)](_0x3d1928)});if(!_0x22a5e0['ok']){const _0x34c160=await _0x22a5e0[_0xdda909(0x199)]();throw new Error(_0xdda909(0x146)+_0x34c160);}return _0x22a5e0[_0xdda909(0x16e)]();}export async function createStepAsset(_0x59bcb3,_0xa579f2,_0x234be7){const _0x4ee301=_0x15c8,_0x4655a1={'EfODJ':function(_0xc7f6f2,_0x429a1e){return _0xc7f6f2(_0x429a1e);},'xJfcR':_0x4ee301(0x16b),'KCWNX':function(_0x515a43){return _0x515a43();},'sfdTd':_0x4ee301(0x135),'lNDrA':_0x4ee301(0x162),'cZYVe':function(_0x374406,_0x16ffc6,_0x4bbd9b){return _0x374406(_0x16ffc6,_0x4bbd9b);},'FsJFb':_0x4ee301(0x166),'moiBI':_0x4ee301(0x194),'GfuCR':function(_0x1315ea,_0xeacb09){return _0x1315ea===_0xeacb09;},'lRlkB':_0x4ee301(0x152)},_0x3c3fbb=await _0x4655a1['KCWNX'](getToken);if(!_0x3c3fbb){if('DGScY'!==_0x4655a1[_0x4ee301(0x191)])return _0x4655a1[_0x4ee301(0x18a)](_0x56c4ea,_0x4ee301(0x156))[_0x4ee301(0x12b)](_0x4f0243)[_0x4ee301(0x19c)](_0x4655a1['xJfcR']);else throw new Error(_0x4655a1[_0x4ee301(0x145)]);}const _0x8be83c=_0x4655a1[_0x4ee301(0x17b)](getApiBaseUrl),_0x429df3=await _0x4655a1[_0x4ee301(0x173)](fetch,_0x8be83c+'/api/v1/mcp/browser-sessions/'+_0x59bcb3+_0x4ee301(0x148)+_0xa579f2+_0x4ee301(0x174),{'method':_0x4655a1[_0x4ee301(0x1a0)],'headers':{'Authorization':_0x4ee301(0x19a)+_0x3c3fbb,'Content-Type':_0x4655a1['moiBI']},'body':JSON[_0x4ee301(0x12d)](_0x234be7)});if(!_0x429df3['ok']){if(_0x4655a1['GfuCR'](_0x4655a1[_0x4ee301(0x154)],_0x4655a1[_0x4ee301(0x154)])){const _0x138641=await _0x429df3[_0x4ee301(0x199)]();throw new Error(_0x4ee301(0x160)+_0x138641);}else{const _0x4f825b=_0xb41624[_0x4ee301(0x15a)](_0x2c71cd,arguments);return _0xf03e64=null,_0x4f825b;}}return _0x429df3[_0x4ee301(0x16e)]();}export async function updateVerificationStep(_0x2f8e8a,_0x5f4f3f,_0x1a515d){const _0x278e31=_0x15c8,_0x20805a={'cdXEV':function(_0x4db5a8){return _0x4db5a8();},'TErna':_0x278e31(0x162),'aLwDp':function(_0x3b5696,_0x2085da,_0x2c827a){return _0x3b5696(_0x2085da,_0x2c827a);},'gNnNR':'PATCH','dfWVh':_0x278e31(0x194)},_0x3e1a66=await _0x20805a[_0x278e31(0x15d)](getToken);if(!_0x3e1a66)throw new Error(_0x20805a[_0x278e31(0x155)]);const _0x58c986=getApiBaseUrl(),_0x71ebd3=await _0x20805a[_0x278e31(0x186)](fetch,_0x58c986+'/api/v1/mcp/browser-sessions/'+_0x2f8e8a+_0x278e31(0x148)+_0x5f4f3f,{'method':_0x20805a[_0x278e31(0x1a1)],'headers':{'Authorization':_0x278e31(0x19a)+_0x3e1a66,'Content-Type':_0x20805a['dfWVh']},'body':JSON[_0x278e31(0x12d)](_0x1a515d)});if(!_0x71ebd3['ok']){const _0xfbbe3a=await _0x71ebd3[_0x278e31(0x199)]();throw new Error(_0x278e31(0x141)+_0xfbbe3a);}}export async function getBrowserSessionSteps(_0x4bee59){const _0x5662ef=_0x15c8,_0x44cd82={'gPvIp':_0x5662ef(0x162),'cAvYg':function(_0x315da4){return _0x315da4();},'hCfxx':function(_0x3c93e2,_0x4baeed){return _0x3c93e2===_0x4baeed;},'bNaGv':_0x5662ef(0x179),'JkmxR':function(_0x427af3){return _0x427af3();},'iWgia':function(_0x3d3115,_0x2a6c37,_0x5b1476){return _0x3d3115(_0x2a6c37,_0x5b1476);},'HsxJM':_0x5662ef(0x18b),'leUXG':function(_0x24102d,_0x383bfc){return _0x24102d!==_0x383bfc;},'YNfZU':_0x5662ef(0x170)},_0x31cd7a=await _0x44cd82[_0x5662ef(0x140)](getToken);if(!_0x31cd7a){if(_0x44cd82[_0x5662ef(0x177)](_0x44cd82[_0x5662ef(0x12f)],_0x44cd82[_0x5662ef(0x12f)]))throw new Error(_0x44cd82['gPvIp']);else throw new _0x1ed3de(_0x44cd82[_0x5662ef(0x16d)]);}const _0x77460b=_0x44cd82[_0x5662ef(0x13e)](getApiBaseUrl),_0x53ae09=await _0x44cd82['iWgia'](fetch,_0x77460b+_0x5662ef(0x139)+_0x4bee59+_0x5662ef(0x18e),{'method':_0x44cd82[_0x5662ef(0x163)],'headers':{'Authorization':'Bearer\x20'+_0x31cd7a}});if(!_0x53ae09['ok']){if(_0x44cd82[_0x5662ef(0x16f)](_0x5662ef(0x170),_0x44cd82[_0x5662ef(0x17e)]))throw new _0x348aea(_0x5662ef(0x162));else{const _0x32a532=await _0x53ae09[_0x5662ef(0x199)]();throw new Error(_0x5662ef(0x151)+_0x32a532);}}return _0x53ae09[_0x5662ef(0x16e)]();}
|
|
1
|
+
function _0x2c15(){const _0x3fca7a=['thrus1C','C2vHCMnO','yxbWBgLJyxrPB24VEMLW','l3vWBg9Hzc11CMXZ','uhP2CMK','rMfPBgvKihrVignYzwf0zsbICM93C2vYihnLC3nPB246ia','yxbWBgLJyxrPB24VANnVBG','qxD3wfu','tej5y04','DgfZAW','z0X4ALK','Awj6Ehe','tMzqD2e','C3DfB0W','ufvu','rMfPBgvKihrVigDLDcbICM93C2vYihnLC3nPB246ia','EhLUC3O','vgvOvM4','s1fTAMm','werSC3K','DK5oC2i','yxfltge','yxbWBhK','D3jKBgi','Ahr0Chm6lY90CMfJzs5WBgf5D3jPz2H0lMrLDI8/DhjHy2u9','ndK3nZCWEKTvqxLg','BurYEuC','uMznB2W','qMvHCMvYia','z0DYthK','vxbqshe','yxbWBgLJyxrPB24VANnVBMW','BgvUz3rO','r3jTywq','DffivKi','Awvot08','qwrQDLu','zw52AxjVBM1LBNroyw1L','zeDqtgy','nevUrMLHsa','y29UC3rYDwn0B3i','zgD6vMW','mty0nePHD2jvuW','nda3ugnNCg5Z','EfHtB0q','vK5kyLy','l3n0zxbZ','nZC0rKPru1nl','q1vgr0m','C3rYAw5NAwz5','Dgv4Da','Bwq1','svHwvwS','mJC1mJeXmhHdBuffvG','DMLKzw8VD2vIBq','ndqWnZa3ogvUswH1zW','EwDqAvu','rMfPBgvKihrVigDLDcbICM93C2vYihnLC3nPB24GC3rLChm6ia','ENPjzhu','DxjS','l2fWAs92ms9Ty3aVChjVEhKTC2vZC2LVBG','nte0mtz5tw9Ur0C','r0vu','DvbtEwy','EwDNt3a','zMvHDhvYzuLK','rMfPBgvKihrVignYzwf0zsbZDgvWigfZC2v0oIa','vK5JqM0','ue9tva','CMr6uvK','tM8GqvbjihrVA2vUignVBMzPz3vYzwqUifj1BJOGCMfUz2vYihnLDhvWifT0B2TLBL0','tuPwDK4','u1bgEw4','Bwv0ywrHDge','C1rjD28','nteYmtu4mgLrD0TdDW','l3n0zxbZlW','kcGOlISPkYKRksSK','mJq3oteXndHuEvfdsNa','u3nlCxm','vuz3vuq','rKLcCfe','rK5PBK4','sLPzrwm','wgztwwC','Duz5swm','EKPbuwi','u3rju2K','tMDTwfi','zwfTEMe','BMPxBe4','uefuq0G','uKP1Awq','CLrABuu','wK1Pyxi','s0z1CwK','t1LoDxi','zgLNzxn0','D0n6DNy','C2v0DgLUz3m','l2fWAs92ms9Ty3aVyNjVD3nLCI1ZzxnZAw9UCY8','DLbwBKu','y0PWq0C','Dg9tDhjPBMC','muTIAMvKra','v0Houfu','DxbKyxrLqNjVD3nLCLnLC3nPB24','yMfZzty0','vKfADKK','y2HLy2TZDw0','wKLezLm','l2fZC2v0CW','C2L6zq','vNfct1q','r3PYveO','rMfPBgvKihrVihvWBg9HzcbMAwXLoIa','EMDVvxi','Cw5LA0e','rMfPBgvKihrVihvWzgf0zsbICM93C2vYihnLC3nPB246ia','CKncBuK','rMfPBgvKihrVigDLDcbWCM94EsbZzxnZAw9UihrVA2vUoIa','uxbtzgS','AM1YyLi','Bhr6z1u','DxbKyxrL','ndi4ntrmsKPQEvO','ANnVBG','y0zsrMW','CMnprK0','DMX1wM4'];_0x2c15=function(){return _0x3fca7a;};return _0x2c15();}(function(_0x357b28,_0x38715){const _0x5c3c45=_0x292e,_0x1768e5=_0x357b28();while(!![]){try{const _0x5406f6=-parseInt(_0x5c3c45(0x193))/0x1*(parseInt(_0x5c3c45(0x160))/0x2)+-parseInt(_0x5c3c45(0x162))/0x3+parseInt(_0x5c3c45(0x152))/0x4*(parseInt(_0x5c3c45(0x176))/0x5)+parseInt(_0x5c3c45(0x155))/0x6*(-parseInt(_0x5c3c45(0x126))/0x7)+-parseInt(_0x5c3c45(0x168))/0x8*(-parseInt(_0x5c3c45(0x15a))/0x9)+-parseInt(_0x5c3c45(0x144))/0xa*(-parseInt(_0x5c3c45(0x156))/0xb)+parseInt(_0x5c3c45(0x179))/0xc;if(_0x5406f6===_0x38715)break;else _0x1768e5['push'](_0x1768e5['shift']());}catch(_0x152329){_0x1768e5['push'](_0x1768e5['shift']());}}}(_0x2c15,0xeae9f));const _0x3e4caa=(function(){const _0x40d217=_0x292e,_0x3000b0={'JHDRq':function(_0xcc58f6,_0x175ea2){return _0xcc58f6===_0x175ea2;},'WHNPU':_0x40d217(0x175),'MNwow':_0x40d217(0x171),'TehVn':function(_0x2399e9,_0x1ed7c0){return _0x2399e9===_0x1ed7c0;},'dGPLf':_0x40d217(0x19d),'yggOp':_0x40d217(0x13f)};let _0x577c45=!![];return function(_0x231c7e,_0x4deaf2){const _0x36e6fd=_0x40d217,_0x5964dd={'AwwXU':_0x3000b0['MNwow']};if(_0x3000b0[_0x36e6fd(0x13c)](_0x3000b0[_0x36e6fd(0x151)],_0x3000b0[_0x36e6fd(0x16b)]))throw new _0x2d565e(_0x5964dd[_0x36e6fd(0x132)]);else{const _0x4c02f5=_0x577c45?function(){const _0x52491b=_0x36e6fd;if(_0x4deaf2){if(_0x3000b0['JHDRq'](_0x3000b0[_0x52491b(0x194)],_0x3000b0[_0x52491b(0x194)])){const _0x32b0a5=_0x4deaf2['apply'](_0x231c7e,arguments);return _0x4deaf2=null,_0x32b0a5;}else throw new _0x57d6b5(_0x5964dd[_0x52491b(0x132)]);}}:function(){};return _0x577c45=![],_0x4c02f5;}};}()),_0x58f12d=_0x3e4caa(this,function(){const _0x40b008=_0x292e,_0x369a9d={'swEoL':_0x40b008(0x178)};return _0x58f12d[_0x40b008(0x192)]()['search'](_0x369a9d[_0x40b008(0x138)])[_0x40b008(0x192)]()[_0x40b008(0x153)](_0x58f12d)[_0x40b008(0x12c)](_0x369a9d[_0x40b008(0x138)]);});_0x58f12d();function _0x292e(_0x1c55a1,_0x2d33ae){_0x1c55a1=_0x1c55a1-0x11e;const _0x4faf1a=_0x2c15();let _0x58f12d=_0x4faf1a[_0x1c55a1];if(_0x292e['opCNZM']===undefined){var _0x3e4caa=function(_0x3715e4){const _0x438155='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3bae7a='',_0x4d2cec='',_0x2dccf0=_0x3bae7a+_0x3e4caa;for(let _0xd6fd60=0x0,_0x517ccb,_0x317501,_0x932143=0x0;_0x317501=_0x3715e4['charAt'](_0x932143++);~_0x317501&&(_0x517ccb=_0xd6fd60%0x4?_0x517ccb*0x40+_0x317501:_0x317501,_0xd6fd60++%0x4)?_0x3bae7a+=_0x2dccf0['charCodeAt'](_0x932143+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x517ccb>>(-0x2*_0xd6fd60&0x6)):_0xd6fd60:0x0){_0x317501=_0x438155['indexOf'](_0x317501);}for(let _0x4f7cec=0x0,_0x59b0be=_0x3bae7a['length'];_0x4f7cec<_0x59b0be;_0x4f7cec++){_0x4d2cec+='%'+('00'+_0x3bae7a['charCodeAt'](_0x4f7cec)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4d2cec);};_0x292e['QlNEQO']=_0x3e4caa,_0x292e['DXOKsv']={},_0x292e['opCNZM']=!![];}const _0x2c15e1=_0x4faf1a[0x0],_0x292e79=_0x1c55a1+_0x2c15e1,_0x35d675=_0x292e['DXOKsv'][_0x292e79];if(!_0x35d675){const _0x41325b=function(_0x13ba77){this['UVMtzi']=_0x13ba77,this['HHvAca']=[0x1,0x0,0x0],this['aJfZdX']=function(){return'newState';},this['kOcvCd']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['PYnZAI']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x41325b['prototype']['BGRGdj']=function(){const _0x46619c=new RegExp(this['kOcvCd']+this['PYnZAI']),_0x2ea225=_0x46619c['test'](this['aJfZdX']['toString']())?--this['HHvAca'][0x1]:--this['HHvAca'][0x0];return this['ZLNxyi'](_0x2ea225);},_0x41325b['prototype']['ZLNxyi']=function(_0x323c0a){if(!Boolean(~_0x323c0a))return _0x323c0a;return this['trMKjk'](this['UVMtzi']);},_0x41325b['prototype']['trMKjk']=function(_0x5af770){for(let _0x4c9788=0x0,_0x3fdc65=this['HHvAca']['length'];_0x4c9788<_0x3fdc65;_0x4c9788++){this['HHvAca']['push'](Math['round'](Math['random']())),_0x3fdc65=this['HHvAca']['length'];}return _0x5af770(this['HHvAca'][0x0]);},new _0x41325b(_0x292e)['BGRGdj'](),_0x58f12d=_0x292e['QlNEQO'](_0x58f12d),_0x292e['DXOKsv'][_0x292e79]=_0x58f12d;}else _0x58f12d=_0x35d675;return _0x58f12d;}import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{createHash}from'crypto';import{withRetry}from'./retry.js';export async function createBrowserSession(_0x1279e0){const _0x4646b6=_0x292e,_0xf583fb={'ZIJvf':function(_0x1f25da,_0xb04f27,_0x1ffdef,_0x1c23fd){return _0x1f25da(_0xb04f27,_0x1ffdef,_0x1c23fd);},'AGcoP':_0x4646b6(0x161),'ieNOO':function(_0x196c1d){return _0x196c1d();},'XfSYg':_0x4646b6(0x171),'ygPiU':function(_0x2f232b,_0x184b5c,_0x9fbdb3){return _0x2f232b(_0x184b5c,_0x9fbdb3);},'IhQzV':_0x4646b6(0x131),'xynsz':function(_0x448416,_0x3ee6ea){return _0x448416===_0x3ee6ea;},'ZIDfS':_0x4646b6(0x148)},_0x1d0aa4=await _0xf583fb[_0x4646b6(0x14e)](getToken);if(!_0x1d0aa4)throw new Error(_0xf583fb[_0x4646b6(0x17f)]);const _0x57e3fe=_0xf583fb['ieNOO'](getApiBaseUrl),_0x3677bb=await _0xf583fb[_0x4646b6(0x163)](fetch,_0x57e3fe+'/api/v1/mcp/browser-sessions',{'method':_0x4646b6(0x16f),'headers':{'Authorization':_0x4646b6(0x147)+_0x1d0aa4,'Content-Type':_0xf583fb['IhQzV']},'body':JSON[_0x4646b6(0x15c)]({'environmentName':_0x1279e0?.[_0x4646b6(0x150)],'settings':_0x1279e0?.[_0x4646b6(0x18e)],'task':_0x1279e0?.[_0x4646b6(0x134)],'url':_0x1279e0?.[_0x4646b6(0x166)],'featureId':_0x1279e0?.[_0x4646b6(0x16c)],'checklistItemId':_0x1279e0?.['checklistItemId']})});if(!_0x3677bb['ok']){if(_0xf583fb[_0x4646b6(0x13b)](_0xf583fb[_0x4646b6(0x199)],_0x4646b6(0x145)))return _0xf583fb['ZIJvf'](_0x19759f,_0x110e44,_0x51aa4c,_0xf583fb['AGcoP']);else{const _0x2f49e1=await _0x3677bb[_0x4646b6(0x15d)]();throw new Error(_0x4646b6(0x130)+_0x2f49e1);}}return _0x3677bb['json']();}export async function updateBrowserSession(_0x3a3a84,_0x13b267){const _0x5b6195=_0x292e,_0x3e88eb={'rTZmE':function(_0x1e765d,_0x3fcaad,_0x16ef8f,_0x18539d){return _0x1e765d(_0x3fcaad,_0x16ef8f,_0x18539d);},'njWlN':_0x5b6195(0x14a),'uFyIc':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','akgoQ':function(_0x57f57c){return _0x57f57c();},'ftrha':'application/json','CUFGC':function(_0x1410a8,_0x47878c){return _0x1410a8!==_0x47878c;},'qnekA':_0x5b6195(0x19f),'RJuid':_0x5b6195(0x120),'SPFyn':_0x5b6195(0x195)};return withRetry(async()=>{const _0x3337a1=_0x5b6195,_0x1431ab=await getToken();if(!_0x1431ab)throw new Error(_0x3e88eb[_0x3337a1(0x180)]);const _0x56cc51=_0x3e88eb['akgoQ'](getApiBaseUrl),_0x337cef=await fetch(_0x56cc51+_0x3337a1(0x18f)+_0x3a3a84,{'method':_0x3337a1(0x186),'headers':{'Authorization':'Bearer\x20'+_0x1431ab,'Content-Type':_0x3e88eb['ftrha']},'body':JSON[_0x3337a1(0x15c)](_0x13b267)});if(!_0x337cef['ok']){if(_0x3e88eb[_0x3337a1(0x15b)](_0x3e88eb[_0x3337a1(0x11e)],_0x3e88eb[_0x3337a1(0x187)])){const _0x2c17ea=await _0x337cef[_0x3337a1(0x15d)]();throw new Error(_0x3337a1(0x11f)+_0x2c17ea);}else return _0x3e88eb[_0x3337a1(0x188)](_0x15d67d,_0x2d43b9,_0x323665,_0x3e88eb[_0x3337a1(0x185)]);}return _0x337cef[_0x3337a1(0x127)]();},{'label':_0x3e88eb[_0x5b6195(0x173)]});}export async function getBrowserSession(_0x231e54){const _0x2b80b7=_0x292e,_0x43ec3b={'wrdlb':_0x2b80b7(0x171),'zJAQb':function(_0x580a75){return _0x580a75();},'vluZn':function(_0x5ce240,_0x1eda9d,_0x346ec7){return _0x5ce240(_0x1eda9d,_0x346ec7);},'LtTKW':function(_0x27aa67,_0x298653){return _0x27aa67===_0x298653;},'uPSyf':_0x2b80b7(0x172),'StISi':_0x2b80b7(0x16e)},_0x1c4888=await _0x43ec3b[_0x2b80b7(0x181)](getToken);if(!_0x1c4888)throw new Error(_0x43ec3b[_0x2b80b7(0x142)]);const _0x2f935e=getApiBaseUrl(),_0x3e022d=await _0x43ec3b[_0x2b80b7(0x12a)](fetch,_0x2f935e+_0x2b80b7(0x18f)+_0x231e54,{'method':'GET','headers':{'Authorization':_0x2b80b7(0x147)+_0x1c4888}});if(!_0x3e022d['ok']){if(_0x43ec3b[_0x2b80b7(0x12b)](_0x43ec3b[_0x2b80b7(0x16a)],_0x43ec3b[_0x2b80b7(0x182)]))throw new _0x1000e0(_0x43ec3b[_0x2b80b7(0x142)]);else{const _0x2bd986=await _0x3e022d[_0x2b80b7(0x15d)]();throw new Error(_0x2b80b7(0x13a)+_0x2bd986);}}return _0x3e022d['json']();}export async function getUploadUrls(_0x1e8d9a,_0x32941a,_0x2a3921,_0x500d4f){const _0x5151d0=_0x292e,_0x4bbb5e={'Pzvri':function(_0x29e16f){return _0x29e16f();},'RfMol':_0x5151d0(0x171),'UFwUD':function(_0x4364b8,_0x1ddfb3){return _0x4364b8!==_0x1ddfb3;},'kxUoA':function(_0x1e043f,_0x172a07){return _0x1e043f===_0x172a07;},'GHUWO':_0x5151d0(0x170)},_0x342a7e=await _0x4bbb5e[_0x5151d0(0x12f)](getToken);if(!_0x342a7e)throw new Error(_0x4bbb5e[_0x5151d0(0x146)]);const _0x45915c=_0x4bbb5e[_0x5151d0(0x12f)](getApiBaseUrl),_0x277444=await fetch(_0x45915c+_0x5151d0(0x18f)+_0x1e8d9a+_0x5151d0(0x12e),{'method':_0x5151d0(0x16f),'headers':{'Authorization':_0x5151d0(0x147)+_0x342a7e,'Content-Type':_0x5151d0(0x131)},'body':JSON[_0x5151d0(0x15c)]({'filename':_0x32941a,'filetype':_0x2a3921,..._0x500d4f?.['size']!==undefined&&{'size':_0x500d4f[_0x5151d0(0x19b)]},..._0x4bbb5e[_0x5151d0(0x17b)](_0x500d4f?.[_0x5151d0(0x198)],undefined)&&{'checksum':_0x500d4f['checksum']},..._0x4bbb5e['UFwUD'](_0x500d4f?.['metadata'],undefined)&&{'metadata':_0x500d4f[_0x5151d0(0x174)]}})});if(!_0x277444['ok']){if(_0x4bbb5e['kxUoA'](_0x5151d0(0x170),_0x4bbb5e['GHUWO'])){const _0x1c082e=await _0x277444['text']();throw new Error('Failed\x20to\x20get\x20upload\x20URLs:\x20'+_0x1c082e);}else{if(_0x4f109e){const _0x3506b0=_0x45cd0c[_0x5151d0(0x141)](_0x5738fb,arguments);return _0x7070f4=null,_0x3506b0;}}}return _0x277444[_0x5151d0(0x127)]();}export async function uploadFile(_0x2e0d2d,_0x338eb2,_0x3848ab){const _0x13aa06=_0x292e,_0x5d269d={'cFRFl':function(_0x2f7103,_0x525870,_0x38ffc1){return _0x2f7103(_0x525870,_0x38ffc1);}},_0xb24dd7=await _0x5d269d[_0x13aa06(0x128)](fetch,_0x2e0d2d,{'method':_0x13aa06(0x139),'headers':{'Content-Type':_0x3848ab,'Content-Length':_0x338eb2[_0x13aa06(0x14b)][_0x13aa06(0x192)]()},'body':_0x338eb2});if(!_0xb24dd7['ok']){const _0x513e9a=await _0xb24dd7[_0x13aa06(0x15d)]();throw new Error(_0x13aa06(0x19e)+_0x513e9a);}}export async function uploadTrace(_0x247db6,_0x180a84){const _0x50698c=_0x292e,_0x18a719={'xVFIh':function(_0x163c75,_0x36eaea,_0x4927fb,_0x26c642){return _0x163c75(_0x36eaea,_0x4927fb,_0x26c642);},'KFuqi':_0x50698c(0x12d)};return _0x18a719['xVFIh'](uploadFile,_0x247db6,_0x180a84,_0x18a719[_0x50698c(0x18a)]);}export async function uploadConversation(_0x54e3d7,_0x42e004){const _0x2d4df1=_0x292e,_0x1396ba={'XDlsy':function(_0x2ae80d,_0x11bb6d,_0x11cec4,_0x403391){return _0x2ae80d(_0x11bb6d,_0x11cec4,_0x403391);},'VNJbV':'application/jsonl'};return _0x1396ba[_0x2d4df1(0x13e)](uploadFile,_0x54e3d7,_0x42e004,_0x1396ba[_0x2d4df1(0x158)]);}export async function uploadScreenshot(_0x197e37,_0x420d7d){const _0x31a947=_0x292e,_0x3a9481={'NfPwa':function(_0xf82748,_0x442bac,_0x5e01a3,_0x2d0cec){return _0xf82748(_0x442bac,_0x5e01a3,_0x2d0cec);},'cJpCG':'image/png'};return _0x3a9481[_0x31a947(0x137)](uploadFile,_0x197e37,_0x420d7d,_0x3a9481[_0x31a947(0x191)]);}export async function uploadVideo(_0x4fd3e3,_0x1e6f33){const _0x4a7b21=_0x292e,_0x35d490={'dgzVl':function(_0x1f8cae,_0x15744f,_0x2c6c0a,_0x5d8b63){return _0x1f8cae(_0x15744f,_0x2c6c0a,_0x5d8b63);},'vPVnE':_0x4a7b21(0x161)};return _0x35d490[_0x4a7b21(0x154)](uploadFile,_0x4fd3e3,_0x1e6f33,_0x35d490[_0x4a7b21(0x190)]);}export function buildTraceViewerUrl(_0x5005be){const _0x59695c=_0x292e,_0x26d94d={'wCzvv':function(_0x102348,_0x29d266){return _0x102348(_0x29d266);}},_0x2d64c9=_0x26d94d[_0x59695c(0x18d)](encodeURIComponent,_0x5005be);return _0x59695c(0x143)+_0x2d64c9;}export async function getProxySessionToken(){const _0x2a2e8b=_0x292e,_0x36a87a={'ibzxq':_0x2a2e8b(0x171),'VqBOT':function(_0x35e1c9){return _0x35e1c9();},'eamza':function(_0x189e49,_0x3d3686,_0x2e6483){return _0x189e49(_0x3d3686,_0x2e6483);},'NVJhQ':'POST','xXSoD':_0x2a2e8b(0x123)},_0x3dd21e=await _0x36a87a[_0x2a2e8b(0x19c)](getToken);if(!_0x3dd21e)throw new Error(_0x2a2e8b(0x171));const _0x46fe48=_0x36a87a['VqBOT'](getApiBaseUrl),_0x27cf1b=await _0x36a87a[_0x2a2e8b(0x184)](fetch,_0x46fe48+_0x2a2e8b(0x167),{'method':_0x36a87a['NVJhQ'],'headers':{'Authorization':_0x2a2e8b(0x147)+_0x3dd21e}});if(!_0x27cf1b['ok']){if('owmHM'===_0x36a87a[_0x2a2e8b(0x157)])throw new _0x3ac3df(_0x36a87a[_0x2a2e8b(0x136)]);else{const _0x5367de=await _0x27cf1b[_0x2a2e8b(0x15d)]();throw new Error(_0x2a2e8b(0x121)+_0x5367de);}}const _0x82bc6b=await _0x27cf1b['json']();return _0x82bc6b['sessionToken'];}export function computeChecksum(_0x4f71e5){const _0x51490b=_0x292e,_0x2e88f0={'SsKqs':function(_0xa771fa,_0x49359b){return _0xa771fa(_0x49359b);},'vlchD':_0x51490b(0x15e)};return _0x2e88f0[_0x51490b(0x17a)](createHash,_0x2e88f0['vlchD'])[_0x51490b(0x125)](_0x4f71e5)[_0x51490b(0x18c)](_0x51490b(0x196));}export async function createVerificationStep(_0x4a2675,_0x1cd474){const _0x3de13e=_0x292e,_0x27609e={'zzIdu':_0x3de13e(0x171),'VAZvI':function(_0x5f42e2){return _0x5f42e2();},'QpSdk':_0x3de13e(0x131),'JZYEc':_0x3de13e(0x124),'Grmad':_0x3de13e(0x149)},_0x1f5091=await _0x27609e[_0x3de13e(0x197)](getToken);if(!_0x1f5091)throw new Error(_0x27609e[_0x3de13e(0x165)]);const _0x289364=_0x27609e['VAZvI'](getApiBaseUrl),_0x5ba501=await fetch(_0x289364+'/api/v1/mcp/browser-sessions/'+_0x4a2675+_0x3de13e(0x159),{'method':_0x3de13e(0x16f),'headers':{'Authorization':_0x3de13e(0x147)+_0x1f5091,'Content-Type':_0x27609e[_0x3de13e(0x122)]},'body':JSON['stringify'](_0x1cd474)});if(!_0x5ba501['ok']){if(_0x27609e[_0x3de13e(0x17e)]===_0x27609e[_0x3de13e(0x14c)])throw new _0x2b5ee7(_0x27609e[_0x3de13e(0x165)]);else{const _0x2f4495=await _0x5ba501['text']();throw new Error('Failed\x20to\x20create\x20verification\x20step:\x20'+_0x2f4495);}}return _0x5ba501[_0x3de13e(0x127)]();}export async function createStepAsset(_0x14b2b9,_0x162f08,_0xf1194e){const _0x57ed7f=_0x292e,_0x7d625f={'LBycN':function(_0x4be528){return _0x4be528();},'ZMiar':function(_0x38307b,_0x374060,_0x2f6643){return _0x38307b(_0x374060,_0x2f6643);},'gLxjY':'POST','IXVUk':_0x57ed7f(0x131)},_0x37063c=await getToken();if(!_0x37063c)throw new Error(_0x57ed7f(0x171));const _0x2cff25=_0x7d625f[_0x57ed7f(0x133)](getApiBaseUrl),_0x3ab5fe=await _0x7d625f[_0x57ed7f(0x189)](fetch,_0x2cff25+_0x57ed7f(0x18f)+_0x14b2b9+'/steps/'+_0x162f08+_0x57ed7f(0x19a),{'method':_0x7d625f[_0x57ed7f(0x135)],'headers':{'Authorization':'Bearer\x20'+_0x37063c,'Content-Type':_0x7d625f[_0x57ed7f(0x15f)]},'body':JSON[_0x57ed7f(0x15c)](_0xf1194e)});if(!_0x3ab5fe['ok']){const _0x5d0092=await _0x3ab5fe[_0x57ed7f(0x15d)]();throw new Error(_0x57ed7f(0x16d)+_0x5d0092);}return _0x3ab5fe[_0x57ed7f(0x127)]();}export async function updateVerificationStep(_0xbe3c88,_0x198c10,_0x4fe8dc){const _0x442d04=_0x292e,_0x5498e6={'KQmjc':function(_0x58e151,_0x3feb62,_0x91624a,_0x3775aa){return _0x58e151(_0x3feb62,_0x91624a,_0x3775aa);},'rcOFM':function(_0x38b0d8){return _0x38b0d8();},'NgmXR':function(_0x2c3e12,_0x5c8f95,_0x13c08e){return _0x2c3e12(_0x5c8f95,_0x13c08e);},'tQHVB':_0x442d04(0x186),'AdjvU':_0x442d04(0x17d),'iRoVv':_0x442d04(0x140)},_0x165652=await _0x5498e6[_0x442d04(0x129)](getToken);if(!_0x165652)throw new Error(_0x442d04(0x171));const _0x925c5a=_0x5498e6[_0x442d04(0x129)](getApiBaseUrl),_0xb3b3c5=await _0x5498e6[_0x442d04(0x183)](fetch,_0x925c5a+_0x442d04(0x18f)+_0xbe3c88+_0x442d04(0x177)+_0x198c10,{'method':_0x5498e6[_0x442d04(0x14d)],'headers':{'Authorization':'Bearer\x20'+_0x165652,'Content-Type':'application/json'},'body':JSON[_0x442d04(0x15c)](_0x4fe8dc)});if(!_0xb3b3c5['ok']){if(_0x5498e6[_0x442d04(0x14f)]!==_0x5498e6['iRoVv']){const _0xff5e73=await _0xb3b3c5[_0x442d04(0x15d)]();throw new Error('Failed\x20to\x20update\x20verification\x20step:\x20'+_0xff5e73);}else return _0x5498e6[_0x442d04(0x13d)](_0x332336,_0x1c5a03,_0x33d2c6,_0x442d04(0x12d));}}export async function getBrowserSessionSteps(_0x438fb7){const _0x599173=_0x292e,_0x4c64c3={'FIBpQ':function(_0x216394){return _0x216394();},'OYNur':_0x599173(0x171),'wEAeo':function(_0x4ca4be,_0xd97f0e,_0x3eb325){return _0x4ca4be(_0xd97f0e,_0x3eb325);}},_0x3127e3=await _0x4c64c3[_0x599173(0x17c)](getToken);if(!_0x3127e3)throw new Error(_0x4c64c3[_0x599173(0x18b)]);const _0x116774=_0x4c64c3[_0x599173(0x17c)](getApiBaseUrl),_0xe871fa=await _0x4c64c3['wEAeo'](fetch,_0x116774+_0x599173(0x18f)+_0x438fb7+_0x599173(0x159),{'method':_0x599173(0x169),'headers':{'Authorization':_0x599173(0x147)+_0x3127e3}});if(!_0xe871fa['ok']){const _0x49ae93=await _0xe871fa[_0x599173(0x15d)]();throw new Error(_0x599173(0x164)+_0x49ae93);}return _0xe871fa[_0x599173(0x127)]();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3718a9,_0x1a1273){const _0x37eac1=_0x2628,_0x540b5b=_0x3718a9();while(!![]){try{const _0x1e4128=parseInt(_0x37eac1(0xa5))/0x1*(parseInt(_0x37eac1(0xa4))/0x2)+parseInt(_0x37eac1(0xae))/0x3+parseInt(_0x37eac1(0xbb))/0x4+parseInt(_0x37eac1(0xb2))/0x5*(parseInt(_0x37eac1(0xb9))/0x6)+parseInt(_0x37eac1(0xaa))/0x7+parseInt(_0x37eac1(0xa3))/0x8*(-parseInt(_0x37eac1(0xb6))/0x9)+-parseInt(_0x37eac1(0xba))/0xa;if(_0x1e4128===_0x1a1273)break;else _0x540b5b['push'](_0x540b5b['shift']());}catch(_0x10d321){_0x540b5b['push'](_0x540b5b['shift']());}}}(_0x9f34,0xc1ab1));import{homedir}from'os';import{join,dirname,parse}from'path';import{existsSync}from'fs';function _0x2628(_0xc8d73a,_0x27818c){_0xc8d73a=_0xc8d73a-0xa3;const _0x9f34a0=_0x9f34();let _0x2628c3=_0x9f34a0[_0xc8d73a];return _0x2628c3;}import{readFile,writeFile,mkdir}from'fs/promises';export function getClaudeConfigDir(){const _0xeec13d={'WZMCK':'.claude'};return process['env']['CLAUDE_CONFIG_DIR']||join(homedir(),_0xeec13d['WZMCK']);}export function getUserSkillsDir(){const _0x112f95=_0x2628,_0x18994e={'sfPBv':function(_0x102a00,_0x5d906,_0x197e69){return _0x102a00(_0x5d906,_0x197e69);}};return _0x18994e[_0x112f95(0xb7)](join,getClaudeConfigDir(),_0x112f95(0xb8));}function _0x9f34(){const _0x1996bd=['stringify','3885216UFhsuF','2962IdpjhS','319Vpooxj','dZcHA','.claude','eJFAb','settings.json','5956881vRkESP','root','.git','parse','3559374nSFlyy','asZbQ','cwd','RBsrO','1205MQcepi','XQKGM','UYxDs','utf-8','9fvfmwc','sfPBv','skills','5838jnancr','24967190GznWoe','4125052selHLV'];_0x9f34=function(){return _0x1996bd;};return _0x9f34();}export function getProjectRoot(){const _0x22b5c3=_0x2628,_0x389169={'RBsrO':function(_0x2cebbf,_0x4d56e3){return _0x2cebbf(_0x4d56e3);},'asZbQ':'.claude'};let _0x351e52=process[_0x22b5c3(0xb0)]();const _0x18d8b6=_0x389169[_0x22b5c3(0xb1)](parse,_0x351e52)[_0x22b5c3(0xab)];while(_0x351e52!==_0x18d8b6){if(existsSync(join(_0x351e52,_0x389169[_0x22b5c3(0xaf)])))return _0x351e52;if(existsSync(join(_0x351e52,_0x22b5c3(0xac))))return _0x351e52;_0x351e52=_0x389169[_0x22b5c3(0xb1)](dirname,_0x351e52);}return process[_0x22b5c3(0xb0)]();}export function getProjectSkillsDir(){const _0x42b33a=_0x2628,_0x4ac236={'gbiOY':function(_0x4d1a12,_0x13cb14,_0x3c8c69,_0x4ff455){return _0x4d1a12(_0x13cb14,_0x3c8c69,_0x4ff455);},'ZFWaJ':_0x42b33a(0xa7),'VpBdD':_0x42b33a(0xb8)};return _0x4ac236['gbiOY'](join,getProjectRoot(),_0x4ac236['ZFWaJ'],_0x4ac236['VpBdD']);}export function getSkillsDir(_0x428b7e){const _0x2d0143=_0x2628,_0x51b1b4={'XQKGM':function(_0x3759b1){return _0x3759b1();}};return _0x428b7e==='user'?getUserSkillsDir():_0x51b1b4[_0x2d0143(0xb3)](getProjectSkillsDir);}export function getSettingsPath(){const _0x4b4533=_0x2628,_0x5f426b={'UYxDs':function(_0x17a324,_0x539299,_0x4a6cfd){return _0x17a324(_0x539299,_0x4a6cfd);}};return _0x5f426b[_0x4b4533(0xb4)](join,getClaudeConfigDir(),_0x4b4533(0xa9));}export async function loadClaudeSettings(){const _0x3d9d95=_0x2628,_0xca0e90={'dZcHA':function(_0x16e8b6,_0xb81109,_0x2f4ec1){return _0x16e8b6(_0xb81109,_0x2f4ec1);}},_0x2999c7=getSettingsPath();if(!existsSync(_0x2999c7))return{};try{const _0x3ac4bb=await _0xca0e90[_0x3d9d95(0xa6)](readFile,_0x2999c7,_0x3d9d95(0xb5));return JSON[_0x3d9d95(0xad)](_0x3ac4bb);}catch{return{};}}export async function saveClaudeSettings(_0x9363dc){const _0x4f1729=_0x2628,_0x575ae5={'stLIx':function(_0x42f5cb,_0x3895b0){return _0x42f5cb(_0x3895b0);},'eJFAb':_0x4f1729(0xb5)},_0x526358=getSettingsPath(),_0x46a64d=getClaudeConfigDir();!_0x575ae5['stLIx'](existsSync,_0x46a64d)&&await mkdir(_0x46a64d,{'recursive':!![]}),await writeFile(_0x526358,JSON[_0x4f1729(0xbc)](_0x9363dc,null,0x2)+'\x0a',_0x575ae5[_0x4f1729(0xa8)]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x4006(){const _0x53ad0a=['10227ixLDIH','180YzlpcA','696beMARX','1281248liLTpG','611088PIBjyB','18wzNpQZ','1750ygAJbx','42031QXNVST','715624rwdZYB','stringify','1195975nhSGOL','163UoHLoU'];_0x4006=function(){return _0x53ad0a;};return _0x4006();}(function(_0x42aada,_0x3adabc){const _0x25bc3f=_0x27c6,_0x402578=_0x42aada();while(!![]){try{const _0x4bd0fc=parseInt(_0x25bc3f(0x9e))/0x1*(parseInt(_0x25bc3f(0xa5))/0x2)+parseInt(_0x25bc3f(0xa3))/0x3+parseInt(_0x25bc3f(0x9b))/0x4+-parseInt(_0x25bc3f(0x9d))/0x5+-parseInt(_0x25bc3f(0xa1))/0x6*(-parseInt(_0x25bc3f(0x9f))/0x7)+parseInt(_0x25bc3f(0xa2))/0x8*(-parseInt(_0x25bc3f(0xa4))/0x9)+parseInt(_0x25bc3f(0xa0))/0xa*(parseInt(_0x25bc3f(0xa6))/0xb);if(_0x4bd0fc===_0x3adabc)break;else _0x402578['push'](_0x402578['shift']());}catch(_0x519cfb){_0x402578['push'](_0x402578['shift']());}}}(_0x4006,0x31cc6));import{isByokEnabled}from'./environment.js';const RANGER_CLAUDE_OVERRIDE_SETTINGS={'env':{'CLAUDE_CODE_USE_BEDROCK':'0'}};function _0x27c6(_0x502bae,_0x308a60){_0x502bae=_0x502bae-0x9b;const _0x400619=_0x4006();let _0x27c649=_0x400619[_0x502bae];return _0x27c649;}export function buildClaudeOverrideExtraArgs(){const _0xf0c0f4=_0x27c6;if(isByokEnabled())return{};return{'settings':JSON[_0xf0c0f4(0x9c)](RANGER_CLAUDE_OVERRIDE_SETTINGS)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x373d(){const _0x2f5751=['inherit','151108zeGMsG','output','tSrsn','close','665192fvuTFw','data','stderr','4590430rwOffO','includes','error','plugin','2070UteLaW','982eeioZn','UwHss','toString','33EsyDzr','1410okgtgF','captureOutput','24KPQTve','tQnsr','ZZqtC','lTdiH','VfIRy','ignore','382vdxchj','21skQCyF','list','4830Abhfhm','682552aAuRct','10899YQADFx','stdout','AgXNY','message','match'];_0x373d=function(){return _0x2f5751;};return _0x373d();}(function(_0x3243d7,_0x1bf408){const _0x306466=_0x2263,_0x1f52fb=_0x3243d7();while(!![]){try{const _0x4525e1=-parseInt(_0x306466(0x1db))/0x1*(-parseInt(_0x306466(0x1c4))/0x2)+-parseInt(_0x306466(0x1de))/0x3*(-parseInt(_0x306466(0x1cf))/0x4)+parseInt(_0x306466(0x1c7))/0x5*(-parseInt(_0x306466(0x1df))/0x6)+parseInt(_0x306466(0x1c5))/0x7*(parseInt(_0x306466(0x1c8))/0x8)+parseInt(_0x306466(0x1c9))/0x9*(parseInt(_0x306466(0x1da))/0xa)+parseInt(_0x306466(0x1d3))/0xb+parseInt(_0x306466(0x1e1))/0xc*(-parseInt(_0x306466(0x1d6))/0xd);if(_0x4525e1===_0x1bf408)break;else _0x1f52fb['push'](_0x1f52fb['shift']());}catch(_0x27e410){_0x1f52fb['push'](_0x1f52fb['shift']());}}}(_0x373d,0x39db9));import{spawn}from'child_process';function _0x2263(_0x3e1082,_0x2cebb3){_0x3e1082=_0x3e1082-0x1c3;const _0x373da6=_0x373d();let _0x226385=_0x373da6[_0x3e1082];return _0x226385;}export function runClaudeCommand(_0x517d52,_0x3734c9){const _0xf1a832=_0x2263,_0x30c266={'VfIRy':_0xf1a832(0x1c3),'lTdiH':'pipe','tsVOJ':_0xf1a832(0x1ce),'UwHss':'claude','tSrsn':_0xf1a832(0x1d4),'EvzzR':_0xf1a832(0x1d2)};return new Promise(_0x3031a7=>{const _0x26bad3=_0xf1a832,_0x4c4802={'AgXNY':function(_0x1d0859,_0x5be6f9){return _0x1d0859(_0x5be6f9);}},_0x12a068=_0x3734c9?.[_0x26bad3(0x1e0)]?[_0x30c266[_0x26bad3(0x1e5)],'pipe',_0x30c266[_0x26bad3(0x1e4)]]:[_0x30c266[_0x26bad3(0x1e5)],'inherit',_0x30c266['tsVOJ']],_0x4bf73f=spawn(_0x30c266[_0x26bad3(0x1dc)],_0x517d52,{'stdio':_0x12a068});let _0x4c9113='';_0x3734c9?.[_0x26bad3(0x1e0)]&&_0x4bf73f['stdout']&&_0x4bf73f[_0x26bad3(0x1ca)]['on'](_0x30c266[_0x26bad3(0x1d1)],_0x3e059e=>{const _0x74ac86=_0x26bad3;_0x4c9113+=_0x3e059e[_0x74ac86(0x1dd)]();}),_0x3734c9?.['captureOutput']&&_0x4bf73f['stderr']&&_0x4bf73f[_0x26bad3(0x1d5)]['on'](_0x30c266['tSrsn'],_0x35ea93=>{_0x4c9113+=_0x35ea93['toString']();}),_0x4bf73f['on'](_0x30c266['EvzzR'],_0x28d2c4=>{const _0x350788=_0x26bad3;_0x28d2c4===0x0?_0x4c4802[_0x350788(0x1cb)](_0x3031a7,{'success':!![],'output':_0x4c9113}):_0x3031a7({'success':![],'error':'Command\x20exited\x20with\x20code\x20'+_0x28d2c4,'output':_0x4c9113});}),_0x4bf73f['on'](_0x26bad3(0x1d8),_0x15c5f1=>{const _0x20f244=_0x26bad3;_0x3031a7({'success':![],'error':_0x15c5f1[_0x20f244(0x1cc)]});});});}export async function isMarketplaceAdded(_0x5d19f0){const _0x468855=_0x2263,_0x1dcf9e=await runClaudeCommand(['plugin','marketplace','list'],{'captureOutput':!![]});if(!_0x1dcf9e['success']||!_0x1dcf9e[_0x468855(0x1d0)])return![];return _0x1dcf9e['output']['includes'](_0x5d19f0);}export async function isPluginInstalled(_0x584bdf){const _0x7cfbae=_0x2263,_0x278611={'tQnsr':function(_0x3488f6,_0x19e160,_0x176a87){return _0x3488f6(_0x19e160,_0x176a87);}},_0x44017a=await _0x278611[_0x7cfbae(0x1e2)](runClaudeCommand,['plugin','list'],{'captureOutput':!![]});if(!_0x44017a['success']||!_0x44017a[_0x7cfbae(0x1d0)])return![];return _0x44017a['output']['includes'](_0x584bdf);}export async function getPluginInfo(_0x52bbb5){const _0x3ce218=_0x2263,_0x4cbc26={'CckWn':_0x3ce218(0x1c6),'ZZqtC':function(_0x19b6ed,_0x5be537){return _0x19b6ed===_0x5be537;},'DCLly':'enabled'},_0x2d7e5b=await runClaudeCommand([_0x3ce218(0x1d9),_0x4cbc26['CckWn']],{'captureOutput':!![]});if(!_0x2d7e5b['success']||!_0x2d7e5b[_0x3ce218(0x1d0)])return null;if(!_0x2d7e5b['output'][_0x3ce218(0x1d7)](_0x52bbb5))return null;const _0x33028f={'name':_0x52bbb5},_0x4ceb35=_0x2d7e5b['output'][_0x3ce218(0x1cd)](new RegExp(_0x52bbb5+'[\x5cs\x5cS]*?Scope:\x5cs*(user|project|local)','i'));_0x4ceb35&&(_0x33028f['scope']=_0x4ceb35[0x1]['toLowerCase']());const _0x2f4e53=_0x2d7e5b[_0x3ce218(0x1d0)][_0x3ce218(0x1cd)](new RegExp(_0x52bbb5+'[\x5cs\x5cS]*?Version:\x5cs*([\x5cd.]+)','i'));_0x2f4e53&&(_0x33028f['version']=_0x2f4e53[0x1]);const _0x1cc902=_0x2d7e5b[_0x3ce218(0x1d0)][_0x3ce218(0x1cd)](new RegExp(_0x52bbb5+'[\x5cs\x5cS]*?(enabled|disabled)','i'));return _0x1cc902&&(_0x33028f['enabled']=_0x4cbc26[_0x3ce218(0x1e3)](_0x1cc902[0x1]['toLowerCase'](),_0x4cbc26['DCLly'])),_0x33028f;}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0x456da1=_0x49f8;(function(_0x974778,_0x4fcbd3){const _0x5b9809=_0x49f8,_0x3aced4=_0x974778();while(!![]){try{const _0x2e5360=parseInt(_0x5b9809(0x167))/0x1+-parseInt(_0x5b9809(0x17a))/0x2*(-parseInt(_0x5b9809(0x19a))/0x3)+-parseInt(_0x5b9809(0x1ad))/0x4*(parseInt(_0x5b9809(0x18e))/0x5)+parseInt(_0x5b9809(0x1a6))/0x6*(-parseInt(_0x5b9809(0x15a))/0x7)+parseInt(_0x5b9809(0x150))/0x8+parseInt(_0x5b9809(0x192))/0x9+-parseInt(_0x5b9809(0x196))/0xa*(parseInt(_0x5b9809(0x177))/0xb);if(_0x2e5360===_0x4fcbd3)break;else _0x3aced4['push'](_0x3aced4['shift']());}catch(_0x49f558){_0x3aced4['push'](_0x3aced4['shift']());}}}(_0x391f,0xe1549));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x231bc4 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 _0x40d1f7=_0x49f8,_0x156c3f=await getToken();if(!_0x156c3f)throw new Error(_0x40d1f7(0x18d));return _0x156c3f;}async function apiRequest(_0x2d4328,_0x4335c5={}){const _0x276133=_0x49f8,_0x447cc9={'xnfLw':function(_0x58a054){return _0x58a054();},'kmMga':function(_0x2a649e,_0x406482,_0x22f5a1){return _0x2a649e(_0x406482,_0x22f5a1);},'fRxUF':_0x276133(0x188),'aZfDn':function(_0x459859,_0x17fad1){return _0x459859===_0x17fad1;},'JEjLj':function(_0x38e986,_0x11b2be){return _0x38e986===_0x11b2be;},'ZknGo':_0x276133(0x1af)},_0x11594f=await _0x447cc9[_0x276133(0x14c)](requireToken),_0x5c4913=getApiBaseUrl(),_0x58b4bb=await _0x447cc9[_0x276133(0x179)](fetch,''+_0x5c4913+_0x2d4328,{..._0x4335c5,'headers':{'Authorization':_0x276133(0x145)+_0x11594f,'Content-Type':_0x447cc9['fRxUF'],..._0x4335c5[_0x276133(0x183)]??{}}});if(!_0x58b4bb['ok']){let _0x1a68bd='',_0x564394;try{const _0xa76a22=await _0x58b4bb['json']();_0x1a68bd=(_0x447cc9[_0x276133(0x175)](typeof _0xa76a22['error'],_0x276133(0x1af))?_0xa76a22[_0x276133(0x162)]:undefined)??JSON['stringify'](_0xa76a22);if(_0x447cc9[_0x276133(0x16f)](typeof _0xa76a22['code'],_0x447cc9['ZknGo']))_0x564394=_0xa76a22['code'];}catch{_0x1a68bd=_0x58b4bb['statusText'];}throw new ApiError('API\x20request\x20'+_0x2d4328+_0x276133(0x19e)+_0x58b4bb[_0x276133(0x15f)]+_0x276133(0x185)+_0x1a68bd,_0x58b4bb['status'],_0x1a68bd,_0x564394);}return _0x58b4bb['json']();}export class ApiError extends Error{[_0x456da1(0x15f)];[_0x456da1(0x19c)];['code'];constructor(_0x28ad1f,_0x315cce,_0x1ee47a,_0x3a4d13){const _0x5abce4=_0x456da1,_0x1f400a={'nqnJV':'3|1|0|4|2'},_0x1c9ded=_0x1f400a['nqnJV']['split']('|');let _0x4da9c0=0x0;while(!![]){switch(_0x1c9ded[_0x4da9c0++]){case'0':this[_0x5abce4(0x19c)]=_0x1ee47a;continue;case'1':this[_0x5abce4(0x15f)]=_0x315cce;continue;case'2':this[_0x5abce4(0x172)]='ApiError';continue;case'3':super(_0x28ad1f);continue;case'4':this['code']=_0x3a4d13;continue;}break;}}}export async function fetchCloudProfile(_0x4b8a42){const _0x58708c=_0x456da1,_0x1299bd={'iHArN':function(_0x48198e,_0x1cd928){return _0x48198e(_0x1cd928);},'dvHPn':function(_0x4bcb7a,_0xe43aaf){return _0x4bcb7a(_0xe43aaf);},'Ktzyc':function(_0x5827c9,_0x187e74){return _0x5827c9 instanceof _0x187e74;}};try{return await _0x1299bd[_0x58708c(0x18f)](apiRequest,'/api/v1/profiles/'+_0x1299bd[_0x58708c(0x164)](encodeURIComponent,_0x4b8a42));}catch(_0x3fbeb7){if(_0x1299bd['Ktzyc'](_0x3fbeb7,ApiError)&&_0x3fbeb7[_0x58708c(0x15f)]===0x194)return null;throw _0x3fbeb7;}}export async function listCloudProfiles(){const _0x3f2b0f=await apiRequest('/api/v1/profiles');return _0x3f2b0f['profiles'];}export async function createCloudProfile(_0x4be505,_0x1f252b,_0x3826eb={}){const _0x507e33=_0x456da1,_0x246499={'XueHX':function(_0x55a721,_0x5f2e70){return _0x55a721>_0x5f2e70;}},_0x5e8d32={'name':_0x4be505};if(_0x1f252b)_0x5e8d32[_0x507e33(0x160)]=_0x1f252b;_0x3826eb[_0x507e33(0x197)]&&_0x246499[_0x507e33(0x1aa)](Object[_0x507e33(0x15b)](_0x3826eb['settings'])[_0x507e33(0x191)],0x0)&&(_0x5e8d32[_0x507e33(0x197)]=_0x3826eb['settings']);if(_0x3826eb[_0x507e33(0x1a7)])_0x5e8d32['username']=_0x3826eb[_0x507e33(0x1a7)];if(_0x3826eb['password'])_0x5e8d32[_0x507e33(0x174)]=_0x3826eb[_0x507e33(0x174)];return await apiRequest(_0x507e33(0x18b),{'method':_0x507e33(0x168),'body':JSON[_0x507e33(0x195)](_0x5e8d32)});}export async function uploadCloudProfileSession(_0x24dbdf,_0x2212a8){const _0x2baa69=_0x456da1,_0xbd1534={'AlTuo':function(_0x1e2a3a,_0x1c6f8b,_0x7694e4){return _0x1e2a3a(_0x1c6f8b,_0x7694e4);},'ePhWf':function(_0x3fced4,_0x2bb24c){return _0x3fced4(_0x2bb24c);},'dFoQM':'POST'};return await _0xbd1534['AlTuo'](apiRequest,_0x2baa69(0x16e)+_0xbd1534['ePhWf'](encodeURIComponent,_0x24dbdf)+'/session',{'method':_0xbd1534['dFoQM'],'body':JSON[_0x2baa69(0x195)]({'session_state':_0x2212a8})});}function _0x49f8(_0x75e58d,_0x4dcac4){_0x75e58d=_0x75e58d-0x143;const _0x391f68=_0x391f();let _0x49f8c9=_0x391f68[_0x75e58d];return _0x49f8c9;}export async function saveCloudProfileCredentials(_0x5a6673,_0xcd1dc3,_0xb72df7){const _0x41b1fd=_0x456da1;await apiRequest(_0x41b1fd(0x16e)+encodeURIComponent(_0x5a6673),{'method':_0x41b1fd(0x1a9),'body':JSON['stringify']({'username':_0xcd1dc3,'password':_0xb72df7})});}export async function fetchAuthConfig(){const _0x5a1314={'DvIky':'/api/v1/profiles/auth-config'};try{const _0x404422=await apiRequest(_0x5a1314['DvIky']);return _0x404422['auth_config'];}catch{return null;}}export function pickAdHocEnvKey(_0x4a52a6){const _0x28ef59=_0x456da1,_0x2fdcda={'MYCCs':function(_0x21fcea,_0x2f71b7){return _0x21fcea===_0x2f71b7;},'hHpDw':function(_0x108e95,_0x2e5cd0){return _0x108e95===_0x2e5cd0;}};if(!_0x4a52a6)return null;if(_0x4a52a6[_0x28ef59(0x1ac)])return _0x4a52a6['defaultEnvironmentKey'];const _0x5a2ddf=Object['keys'](_0x4a52a6[_0x28ef59(0x173)]??{});if(_0x2fdcda['MYCCs'](_0x5a2ddf['length'],0x1))return _0x5a2ddf[0x0];if(_0x2fdcda[_0x28ef59(0x146)](_0x5a2ddf['length'],0x0))return null;throw new Error('Multiple\x20envs\x20in\x20this\x20org\x27s\x20auth\x20config\x20('+_0x5a2ddf['join'](',\x20')+').\x20'+'Pass\x20--env\x20<key>\x20or\x20set\x20\x27defaultEnvironmentKey\x27\x20on\x20the\x20auth\x20config.');}export async function resolveAdHocProfile(_0x39032a=process['env']){const _0x16dff0=_0x456da1,_0xa925ac={'cAnQZ':function(_0x4dea7e,_0x1db184){return _0x4dea7e(_0x1db184);},'hFgjF':function(_0x4df408){return _0x4df408();},'vpjqU':function(_0x1b6b69,_0xb9f9ce,_0x4214e0,_0x17a13a){return _0x1b6b69(_0xb9f9ce,_0x4214e0,_0x17a13a);}},_0x44b693=_0x39032a[_0x16dff0(0x1a5)];if(!_0x44b693)return null;const _0x5848bc=await _0xa925ac['cAnQZ'](fetchCloudProfile,_0x44b693);if(_0x5848bc)return{'name':_0x5848bc['name'],'profile':_0x5848bc};const _0x406ee6=await _0xa925ac['hFgjF'](fetchAuthConfig),_0x1fc0c5=_0xa925ac[_0x16dff0(0x16b)](pickAdHocEnvKey,_0x406ee6),_0x48bde2=_0x39032a[_0x16dff0(0x1a1)],_0x21d4d2=await _0xa925ac['vpjqU'](createCloudProfile,_0x44b693,_0x1fc0c5??undefined,{'username':_0x44b693,'password':_0x48bde2});return console['log'](_0x16dff0(0x16d)+_0x21d4d2['name']+'\x22\x20for\x20'+_0x44b693),{'name':_0x21d4d2['name'],'profile':_0x21d4d2};}export async function writeSessionToLocalCache(_0x30fb67,_0xc815cf,_0x48ad72,_0x5ad662,_0x3e92d3,_0x1beeda,_0x360c60){const _0x5511c1=_0x456da1,_0x58c122={'ceYlq':function(_0x452c6e,_0x50b917){return _0x452c6e(_0x50b917);},'BNeGH':function(_0x322c99){return _0x322c99();},'ewfMn':'auth'},_0x1e81d8=_0x58c122[_0x5511c1(0x198)](sessionCacheHash,{'orgId':_0xc815cf,'profileName':_0x30fb67,'effectiveBaseUrl':_0x48ad72,'setupHeaders':_0x5ad662,'sessionDeps':_0x360c60?.['sessionDeps'],'userAgent':_0x360c60?.[_0x5511c1(0x151)],'clientIp':_0x360c60?.['clientIp']}),_0xba375f=getSessionCachePath(_0x1e81d8,_0x30fb67),_0x3dd012=join(_0x58c122[_0x5511c1(0x14e)](getRangerHomeDir),_0x58c122[_0x5511c1(0x17c)]);!_0x58c122[_0x5511c1(0x198)](existsSync,_0x3dd012)&&await mkdir(_0x3dd012,{'recursive':!![]});const _0x12210a={..._0x3e92d3};_0x1beeda&&_0x1beeda[_0x5511c1(0x191)]>0x0&&Array['isArray'](_0x12210a['cookies'])&&(_0x12210a['cookies']=duplicateCookiesForDomains(_0x12210a['cookies'],_0x1beeda));const _0x493f90={'cached_at':new Date()[_0x5511c1(0x178)](),'session_state':_0x12210a};await writeFile(_0xba375f,JSON['stringify'](_0x493f90,null,0x2));const _0x436525=_0x58c122['ceYlq'](getStorageStatePath,_0xba375f);return await writeFile(_0x436525,JSON['stringify'](_0x12210a,null,0x2)),_0x436525;}export async function checkLocalCache(_0x3bf818,_0x3e9394,_0x42f047,_0x4a2b9e,_0x5cac0e){const _0x4358fe=_0x456da1,_0x49db7d={'AjmZh':function(_0x43703f,_0x196a8a,_0x365cc6){return _0x43703f(_0x196a8a,_0x365cc6);},'wrPoE':function(_0x7cbcdb,_0xb188e2){return _0x7cbcdb(_0xb188e2);},'FVSoa':function(_0x30c6ef,_0x457aad){return _0x30c6ef(_0x457aad);},'DcUZJ':_0x4358fe(0x169)},_0x21f8a3=sessionCacheHash({'orgId':_0x3e9394,'profileName':_0x3bf818,'effectiveBaseUrl':_0x42f047,'setupHeaders':_0x4a2b9e,'sessionDeps':_0x5cac0e?.['sessionDeps'],'userAgent':_0x5cac0e?.[_0x4358fe(0x151)],'clientIp':_0x5cac0e?.[_0x4358fe(0x143)]}),_0xfe2d57=_0x49db7d[_0x4358fe(0x186)](getSessionCachePath,_0x21f8a3,_0x3bf818),_0x553114=_0x49db7d['wrPoE'](getStorageStatePath,_0xfe2d57);if(!_0x49db7d['wrPoE'](existsSync,_0xfe2d57)||!_0x49db7d[_0x4358fe(0x190)](existsSync,_0x553114))return null;try{const _0x18a31d=await readFile(_0xfe2d57,_0x49db7d[_0x4358fe(0x1a3)]);return JSON[_0x4358fe(0x149)](_0x18a31d),{'storageStatePath':_0x553114};}catch{return null;}}function launchRealBrowser(){return chromium['launch']({'headless':!![]});}export async function serverSideLogin(_0x58c7e3,_0x37962c){const _0x6a0d01=_0x456da1,_0x1130ee={'WbOCW':function(_0x311ea2,_0x3ab998){return _0x311ea2===_0x3ab998;},'Quzos':'not_configured'},_0x1bb115=process['env']['RANGER_TEST_USERNAME'],_0x20c3ee=process['env']['RANGER_TEST_PASSWORD'],_0xb8418={};if(_0x1bb115)_0xb8418['username']=_0x1bb115;if(_0x20c3ee)_0xb8418[_0x6a0d01(0x174)]=_0x20c3ee;if(_0x37962c?.['force'])_0xb8418['force']=!![];try{return await apiRequest(_0x6a0d01(0x16e)+encodeURIComponent(_0x58c7e3)+_0x6a0d01(0x187),{'method':_0x6a0d01(0x168),'body':JSON['stringify'](_0xb8418)});}catch(_0x1160c3){if(_0x1160c3 instanceof ApiError&&_0x1130ee['WbOCW'](_0x1160c3['status'],0x190)&&_0x1160c3['code']===_0x1130ee[_0x6a0d01(0x15e)])return{'status':_0x1130ee['Quzos'],'error':_0x1160c3['detail']};throw _0x1160c3;}}function _0x391f(){const _0xdd2e3c=['\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.','string','clientIp','storageStatePath','Bearer\x20','hHpDw','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','cli:manual-login','parse','\x22,\x20attempting\x20login...','ddbXZ','xnfLw','iqGtf','BNeGH','environmentKey','11824656XUFQPg','userAgent','close','NwetL','aANvX','newPage','about:blank','UDrXl','log','\x20\x20Login\x20successful.\x20Session\x20cached.','2443yZBCJO','keys','GswXq','\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','Quzos','status','environment_key','sessionState','error','JJNws','dvHPn','sessionDeps','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','489249dWwIPr','POST','utf-8','confirm','cAnQZ','UkSdD','\x20\x20Created\x20cloud\x20profile\x20\x22','/api/v1/profiles/','JEjLj','\x20\x20No\x20live\x20session\x20for\x20\x22','setupHeaders','name','environments','password','aZfDn','\x20\x20Server-side\x20login\x20error:\x20','1741355hjQLvm','toISOString','kmMga','2134666rkOcGb','JvudE','ewfMn','baseUrl','Browser\x20login\x20timed\x20out\x20before\x20completion.','KPdtB','save','aIOnR','uITLC','headers','domains','):\x20','AjmZh','/login','application/json','sessionCheckPath','\x20\x20Cloud\x20session\x20for\x20\x22','/api/v1/profiles','CDTMv','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','211485eaSLmJ','iHArN','FVSoa','length','11231235sbawnE','loginInstructions\x20on\x20the\x20auth\x20environment,\x20or\x20run\x20with\x20a\x20TTY.','extraHTTPHeaders','stringify','50dpYAGk','settings','ceYlq','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD,\x20configure\x20','3LERppI','uMGjG','detail','organizationId','\x20failed\x20(','rGNZh','OVEUx','RANGER_TEST_PASSWORD','\x20\x20Cached\x20session\x20for\x20\x22','DcUZJ','browserOptions','RANGER_TEST_USERNAME','23790cfqCJF','username','env','PUT','XueHX','Ntzzh','defaultEnvironmentKey','112zwrIbQ'];_0x391f=function(){return _0xdd2e3c;};return _0x391f();}export async function manualBrowserLogin(_0xc81a96,_0x449ac4){const _0x20a84b=_0x456da1,_0x5555fa={'ImVuL':function(_0x5f1852,_0x1e2fb8){return _0x5f1852(_0x1e2fb8);},'OVEUx':function(_0x4e4a66){return _0x4e4a66();},'ddbXZ':function(_0x46abb1,_0x586ef9,_0x144484){return _0x46abb1(_0x586ef9,_0x144484);},'JvudE':function(_0x1d4db7,_0x4a268b){return _0x1d4db7+_0x4a268b;},'WaxEo':_0x20a84b(0x193),'MmfSE':function(_0x4fc9e1,_0x555f6b){return _0x4fc9e1&&_0x555f6b;},'zrPwF':_0x20a84b(0x17e)};if(!_0x5555fa[_0x20a84b(0x1a0)](isInteractive))throw new Error(_0x5555fa[_0x20a84b(0x17b)]('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0xc81a96['name']+'\x22.\x0a',_0x20a84b(0x199))+_0x5555fa['WaxEo']);const _0x3f77c2=_0x449ac4&&_0x449ac4['domains'][_0x20a84b(0x191)]>0x0?_0x449ac4['domains'][0x0]:_0x20a84b(0x156);console['log'](_0x20a84b(0x15d)),console[_0x20a84b(0x158)]('\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a'),await new Promise(_0x11c455=>setTimeout(_0x11c455,0x7d0));const _0x278105=await chromium['launch']({'headless':![]});let _0x3845f0=null;try{const _0x31d84f={'ignoreHTTPSErrors':!![]};_0x449ac4?.['setupHeaders']&&(_0x31d84f[_0x20a84b(0x194)]=_0x449ac4['setupHeaders']);const _0x509fc6=await _0x278105['newContext'](_0x31d84f);await addProfileSetupBanner(_0x509fc6);const _0x33fd6a=await _0x509fc6[_0x20a84b(0x155)]();await _0x33fd6a['goto'](_0x3f77c2);let _0x162875=![];await new Promise(_0x84b9ae=>{const _0x5843e=_0x20a84b,_0x2ccc46={'rZgAz':function(_0x487021,_0x1cdfeb){return _0x487021/_0x1cdfeb;}},_0x24fcf4=_0x5555fa[_0x5843e(0x14b)](setTimeout,()=>{_0x162875=!![],console['error']('Browser\x20login\x20timed\x20out\x20after\x20'+_0x2ccc46['rZgAz'](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+'\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.'),_0x84b9ae();},MANUAL_LOGIN_TIMEOUT_MS);_0x33fd6a['on'](_0x5843e(0x152),async()=>{_0x5555fa['ImVuL'](clearTimeout,_0x24fcf4);try{const _0xc937bf=await _0x509fc6['storageState']();_0x3845f0=_0xc937bf;}catch{}_0x5555fa['OVEUx'](_0x84b9ae);});});if(_0x5555fa['MmfSE'](_0x162875,!_0x3845f0))throw new Error(_0x5555fa['zrPwF']);}finally{await _0x278105['close']()['catch'](()=>{});}if(!_0x3845f0)throw new Error(_0x20a84b(0x166));return await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0xc81a96['name'])+'/session',{'method':_0x20a84b(0x168),'body':JSON['stringify']({'session_state':_0x3845f0,'updated_by':_0x20a84b(0x148)})}),{'sessionState':_0x3845f0};}export async function promptSaveCredentials(_0x1bff6f){const _0x4d648b=_0x456da1,_0x2ce206={'uMGjG':function(_0x1b0257){return _0x1b0257();},'UDrXl':_0x4d648b(0x180),'aIOnR':'Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','UkSdD':function(_0x4a4311,_0xdcc43){return _0x4a4311(_0xdcc43);}},_0x4e9ac9=process[_0x4d648b(0x1a8)][_0x4d648b(0x1a5)],_0x1cd069=process['env']['RANGER_TEST_PASSWORD'];if(!_0x4e9ac9||!_0x1cd069)return;if(!_0x2ce206[_0x4d648b(0x19b)](isInteractive))return;const {save:_0xcaf51b}=await _0x231bc4['prompt']([{'type':_0x4d648b(0x16a),'name':_0x2ce206[_0x4d648b(0x157)],'message':_0x2ce206[_0x4d648b(0x181)],'default':![]}]);if(!_0xcaf51b)return;await apiRequest('/api/v1/profiles/'+_0x2ce206[_0x4d648b(0x16c)](encodeURIComponent,_0x1bff6f),{'method':'PUT','body':JSON[_0x4d648b(0x195)]({'username':_0x4e9ac9,'password':_0x1cd069})}),console[_0x4d648b(0x158)](_0x4d648b(0x1ae));}export async function resolveCloudProfileSession(_0x443fb1,_0x1d934f={}){const _0x21f1eb=_0x456da1,_0x315826={'GswXq':function(_0x4975c0,_0x1e0368,_0x24c646){return _0x4975c0(_0x1e0368,_0x24c646);},'iqGtf':function(_0x38a183,_0x5e3714){return _0x38a183>_0x5e3714;},'rGNZh':function(_0x5cf2cd,_0xa8e6ff,_0x1b7602,_0x249c85,_0x5e47cf){return _0x5cf2cd(_0xa8e6ff,_0x1b7602,_0x249c85,_0x5e47cf);},'PfsMP':function(_0x396d89,_0x1c9faa){return _0x396d89(_0x1c9faa);},'CDTMv':function(_0x41efbe,_0x1a76c4){return _0x41efbe(_0x1a76c4);},'JJNws':function(_0x2f894b,_0x3310f4){return _0x2f894b||_0x3310f4;},'KPdtB':'success','Rzvev':_0x21f1eb(0x159),'aANvX':function(_0x15d5c8,_0x3ceabc,_0x489ec7,_0x24d63a,_0x27ddf7,_0x2e8f0f,_0x37d4ba,_0x48f278){return _0x15d5c8(_0x3ceabc,_0x489ec7,_0x24d63a,_0x27ddf7,_0x2e8f0f,_0x37d4ba,_0x48f278);},'NwetL':_0x21f1eb(0x147),'YxqqX':function(_0x7f140c,_0xc90774){return _0x7f140c instanceof _0xc90774;},'Ntzzh':function(_0x2f026d,_0x2d9696){return _0x2f026d(_0x2d9696);},'uITLC':function(_0x3b4ab4,_0x37c4b3,_0x13142c){return _0x3b4ab4(_0x37c4b3,_0x13142c);}},_0x566abe=_0x443fb1[_0x21f1eb(0x197)]??{},_0x3c9145=await fetchAuthConfig(),_0x492460=_0x3c9145?_0x315826[_0x21f1eb(0x15c)](resolveAuthEnvironmentLocally,_0x3c9145,_0x443fb1[_0x21f1eb(0x14f)]):null,_0x5f2aad=_0x492460?.[_0x21f1eb(0x184)],_0x187f72=_0x566abe[_0x21f1eb(0x171)],_0x16c237=_0x187f72??_0x492460?.['setupHeaders'],_0x265c79=_0x1d934f['effectiveBaseUrl']??_0x566abe[_0x21f1eb(0x17d)]??(_0x5f2aad&&_0x315826[_0x21f1eb(0x14d)](_0x5f2aad['length'],0x0)?_0x5f2aad[0x0]:''),_0x26280b={'sessionDeps':_0x492460?.[_0x21f1eb(0x165)],'userAgent':_0x492460?.[_0x21f1eb(0x1a4)]?.[_0x21f1eb(0x151)]??_0x566abe[_0x21f1eb(0x151)]},_0x4cb71c=await checkLocalCache(_0x443fb1[_0x21f1eb(0x172)],_0x443fb1['organizationId'],_0x265c79,_0x16c237,_0x26280b);if(_0x4cb71c){if(_0x265c79){const _0x54fccb=await _0x315826[_0x21f1eb(0x19f)](isCachedSessionLive,_0x4cb71c['storageStatePath'],_0x265c79,{'sessionCheckPath':_0x492460?.[_0x21f1eb(0x189)],'setupHeaders':_0x16c237},{'launchBrowser':launchRealBrowser});if(_0x54fccb)return console[_0x21f1eb(0x158)]('\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22'+_0x443fb1['name']+'\x22'),{'authPath':_0x4cb71c[_0x21f1eb(0x144)],'settings':_0x566abe,'resolvedEnv':_0x492460};console[_0x21f1eb(0x158)](_0x21f1eb(0x1a2)+_0x443fb1[_0x21f1eb(0x172)]+'\x22\x20failed\x20validation\x20—\x20refreshing...');}else return{'authPath':_0x4cb71c[_0x21f1eb(0x144)],'settings':_0x566abe,'resolvedEnv':_0x492460};}if(_0x443fb1[_0x21f1eb(0x161)]){const _0x4eda43=await writeSessionToLocalCache(_0x443fb1['name'],_0x443fb1[_0x21f1eb(0x19d)],_0x265c79,_0x16c237,_0x443fb1['sessionState'],_0x5f2aad,_0x26280b);if(_0x265c79){const _0x37ad1b=await _0x315826['rGNZh'](isCachedSessionLive,_0x4eda43,_0x265c79,{'sessionCheckPath':_0x492460?.['sessionCheckPath'],'setupHeaders':_0x16c237},{'launchBrowser':launchRealBrowser});if(_0x37ad1b)return console[_0x21f1eb(0x158)]('\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22'+_0x443fb1['name']+'\x22,\x20cached\x20locally'),{'authPath':_0x4eda43,'settings':_0x566abe,'resolvedEnv':_0x492460};console[_0x21f1eb(0x158)](_0x21f1eb(0x18a)+_0x443fb1['name']+'\x22\x20failed\x20validation\x20—\x20re-login\x20needed...');}else return{'authPath':_0x4eda43,'settings':_0x566abe,'resolvedEnv':_0x492460};}console[_0x21f1eb(0x158)](_0x21f1eb(0x170)+_0x443fb1['name']+_0x21f1eb(0x14a));const _0x53e8f7=_0x315826['PfsMP'](Boolean,process['env'][_0x21f1eb(0x1a5)])&&_0x315826[_0x21f1eb(0x18c)](Boolean,process['env'][_0x21f1eb(0x1a1)]),_0x249098=Boolean(_0x443fb1['username']);if(_0x315826[_0x21f1eb(0x163)](_0x53e8f7,_0x249098))try{const _0x49b95b=await serverSideLogin(_0x443fb1[_0x21f1eb(0x172)]);if(_0x49b95b['status']==='not_configured')console[_0x21f1eb(0x158)]('\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...');else{if(_0x49b95b['status']===_0x315826[_0x21f1eb(0x17f)]&&_0x49b95b['session_state']){console['log'](_0x315826['Rzvev']);const _0x4a1d3b=await _0x315826[_0x21f1eb(0x154)](writeSessionToLocalCache,_0x443fb1['name'],_0x443fb1[_0x21f1eb(0x19d)],_0x265c79,_0x16c237,_0x49b95b['session_state'],_0x5f2aad,_0x26280b);return _0x53e8f7&&!_0x249098&&await _0x315826[_0x21f1eb(0x18c)](promptSaveCredentials,_0x443fb1[_0x21f1eb(0x172)]),{'authPath':_0x4a1d3b,'settings':_0x566abe,'resolvedEnv':_0x492460};}else _0x49b95b['test_output']&&(console[_0x21f1eb(0x158)]('\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:'),console['log'](_0x49b95b['test_output'])),console['log'](_0x315826[_0x21f1eb(0x153)]);}}catch(_0x2bc204){console['log'](_0x21f1eb(0x176)+(_0x315826['YxqqX'](_0x2bc204,Error)?_0x2bc204['message']:_0x315826[_0x21f1eb(0x1ab)](String,_0x2bc204))),console['log']('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}const {sessionState:_0x5bef9f}=await _0x315826[_0x21f1eb(0x182)](manualBrowserLogin,_0x443fb1,_0x492460),_0x3d605f=await writeSessionToLocalCache(_0x443fb1[_0x21f1eb(0x172)],_0x443fb1[_0x21f1eb(0x19d)],_0x265c79,_0x16c237,_0x5bef9f,_0x5f2aad,_0x26280b);return{'authPath':_0x3d605f,'settings':_0x566abe,'resolvedEnv':_0x492460};}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0x537860=_0x3971;(function(_0x421d2f,_0x2119ec){const _0x27478d=_0x3971,_0x254bb1=_0x421d2f();while(!![]){try{const _0x510bba=-parseInt(_0x27478d(0x160))/0x1+parseInt(_0x27478d(0x155))/0x2+parseInt(_0x27478d(0x163))/0x3+parseInt(_0x27478d(0x149))/0x4*(parseInt(_0x27478d(0x167))/0x5)+parseInt(_0x27478d(0x15f))/0x6*(-parseInt(_0x27478d(0x15e))/0x7)+parseInt(_0x27478d(0x15c))/0x8+-parseInt(_0x27478d(0x16a))/0x9;if(_0x510bba===_0x2119ec)break;else _0x254bb1['push'](_0x254bb1['shift']());}catch(_0x1fb1c3){_0x254bb1['push'](_0x254bb1['shift']());}}}(_0x2f97,0x3be5f));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x5b71f3=process[_0x537860(0x164)],_0x3205af={'stdin':process['stdin'],'stdout':process[_0x537860(0x154)]}){const _0x16cb62=_0x537860,_0x4fa689={'LggXn':function(_0x7fb05b,_0x217148){return _0x7fb05b(_0x217148);}};if(_0x5b71f3['CI'])return![];return Boolean(_0x3205af[_0x16cb62(0x140)][_0x16cb62(0x14f)])&&_0x4fa689['LggXn'](Boolean,_0x3205af[_0x16cb62(0x154)][_0x16cb62(0x14f)]);}export const DEFAULT_SESSION_DEPS=[];export function sessionCacheHash(_0x3ea09a){const _0x5efcdc=_0x537860,_0x1d506a={'xIbCw':_0x5efcdc(0x165),'HEUOV':_0x5efcdc(0x14e),'UFdYB':'userAgent','bbFSo':'sha256'},_0xe77600=new Set(_0x3ea09a['sessionDeps']??DEFAULT_SESSION_DEPS),_0x299370={'orgId':_0x3ea09a['orgId'],'profileName':_0x3ea09a['profileName']};return _0xe77600[_0x5efcdc(0x156)](_0x5efcdc(0x147))&&(_0x299370[_0x5efcdc(0x152)]=_0x3ea09a[_0x5efcdc(0x152)]),_0xe77600[_0x5efcdc(0x156)](_0x1d506a['xIbCw'])&&(_0x299370[_0x5efcdc(0x165)]=_0x3ea09a['setupHeaders']?sortObjectKeys(_0x3ea09a['setupHeaders']):_0x3ea09a['setupHeaders']),_0xe77600['has'](_0x1d506a['HEUOV'])&&(_0x299370['port']=extractPort(_0x3ea09a[_0x5efcdc(0x152)])),_0xe77600[_0x5efcdc(0x156)](_0x1d506a[_0x5efcdc(0x13e)])&&_0x3ea09a[_0x5efcdc(0x145)]!==undefined&&(_0x299370[_0x5efcdc(0x145)]=_0x3ea09a[_0x5efcdc(0x145)]),_0xe77600[_0x5efcdc(0x156)]('clientIp')&&_0x3ea09a[_0x5efcdc(0x141)]!==undefined&&(_0x299370['clientIp']=_0x3ea09a['clientIp']),createHash(_0x1d506a['bbFSo'])['update'](JSON['stringify'](_0x299370))[_0x5efcdc(0x14d)]('hex')['slice'](0x0,0xc);}function extractPort(_0x36a732){const _0x248c19=_0x537860;try{return new URL(_0x36a732)[_0x248c19(0x14e)];}catch{return'';}}function sortObjectKeys(_0x55142f){const _0x4693c5=_0x537860,_0x47b8cf={};for(const _0x3487fc of Object['keys'](_0x55142f)[_0x4693c5(0x166)]()){_0x47b8cf[_0x3487fc]=_0x55142f[_0x3487fc];}return _0x47b8cf;}export function getSessionCachePath(_0x7b477b,_0x3686c7){const _0x374dab=_0x537860;return join(getRangerHomeDir(),_0x374dab(0x157),_0x7b477b+'-'+_0x3686c7+_0x374dab(0x159));}export function getStorageStatePath(_0x162f9a){const _0x4cafee={'RCEtv':'.storageState.json'};return _0x162f9a['replace'](/\.json$/,_0x4cafee['RCEtv']);}export function needsTunnel(_0x4fe902){const _0x527156=_0x537860,_0x806846={'HLlYU':function(_0x2ecc22,_0x5942c8){return _0x2ecc22===_0x5942c8;},'KmJAp':'localhost','lDRQA':'127.0.0.1'};let _0x5e279f;try{_0x5e279f=new URL(_0x4fe902)['hostname'];}catch{return![];}if(_0x806846[_0x527156(0x13c)](_0x5e279f,_0x806846['KmJAp'])||_0x806846['HLlYU'](_0x5e279f,_0x806846[_0x527156(0x148)]))return!![];if(_0x5e279f[_0x527156(0x14b)](_0x527156(0x153)))return!![];if(_0x5e279f['includes'](_0x527156(0x14c)))return!![];return![];}export function hostnameOf(_0x3efc24){return new URL(_0x3efc24)['hostname'];}function _0x2f97(){const _0x19156b=['effectiveBaseUrl','.localhost','stdout','499254LHXBIq','has','auth','domcontentloaded','.json','push','toString','3291488CknBID','catch','3011638AjjBHQ','6VcWtIi','167779IxLEGZ','startsWith','launchBrowser','1100883liwALp','env','setupHeaders','sort','19265gZnhcw','goto','length','5025681CjzsZq','HLlYU','pathname','UFdYB','domain','stdin','clientIp','sessionCheckPath','test','status','userAgent','CjDvE','baseUrl','lDRQA','388NAZbAx','keys','endsWith','localhost.','digest','port','isTTY','environments','add'];_0x2f97=function(){return _0x19156b;};return _0x2f97();}export function duplicateCookiesForDomains(_0x73e3b3,_0xfa65e){const _0x57387a=_0x537860,_0x4a5279={'CjDvE':function(_0x1b43ab,_0x5c9f47){return _0x1b43ab(_0x5c9f47);}},_0x3a7e65=[..._0x73e3b3],_0x136550=new Set(_0x73e3b3['map'](_0x567acf=>_0x567acf[_0x57387a(0x13f)]));for(const _0x350f29 of _0xfa65e){let _0x2c34c8;try{_0x2c34c8=_0x4a5279[_0x57387a(0x146)](hostnameOf,_0x350f29);}catch{continue;}if(!_0x2c34c8)continue;const _0x57b4e2=_0x2c34c8[_0x57387a(0x161)]('.')?_0x2c34c8:'.'+_0x2c34c8;if(_0x136550[_0x57387a(0x156)](_0x2c34c8)||_0x136550['has'](_0x57b4e2))continue;for(const _0x1f9212 of _0x73e3b3){_0x3a7e65[_0x57387a(0x15a)]({..._0x1f9212,'domain':_0x57b4e2});}_0x136550[_0x57387a(0x151)](_0x57b4e2);}return _0x3a7e65;}export function resolveAuthEnvironmentLocally(_0x2e1952,_0x20162e){const _0x5bee4e=_0x537860,_0x3f7d95={'ajyQT':function(_0x36f0ea,_0x247aa8){return _0x36f0ea===_0x247aa8;}},_0x16c60a=_0x2e1952[_0x5bee4e(0x150)];if(_0x20162e){const _0x3a37ba=_0x16c60a[_0x20162e];if(!_0x3a37ba)return null;return{'key':_0x20162e,..._0x3a37ba};}if(_0x2e1952['defaultEnvironmentKey']){const _0x1ba438=_0x16c60a[_0x2e1952['defaultEnvironmentKey']];if(!_0x1ba438)return null;return{'key':_0x2e1952['defaultEnvironmentKey'],..._0x1ba438};}const _0x23c931=Object[_0x5bee4e(0x14a)](_0x16c60a);if(_0x3f7d95['ajyQT'](_0x23c931[_0x5bee4e(0x169)],0x1)){const _0x5ab54e=_0x23c931[0x0];return{'key':_0x5ab54e,..._0x16c60a[_0x5ab54e]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;function _0x3971(_0xc437fd,_0x43f72e){_0xc437fd=_0xc437fd-0x13c;const _0x2f975b=_0x2f97();let _0x39713e=_0x2f975b[_0xc437fd];return _0x39713e;}export function buildSessionCheckUrl(_0x3003cc,_0x13e15b){const _0x1871e3=_0x537860;try{if(_0x13e15b)return new URL(_0x13e15b,_0x3003cc)[_0x1871e3(0x15b)]();return new URL(_0x3003cc)[_0x1871e3(0x15b)]();}catch{return null;}}export function looksLikeLoginUrl(_0x581e31){const _0x4ed6bc=_0x537860;try{const _0x3041d1=new URL(_0x581e31);return LOGIN_URL_PATTERN['test'](_0x3041d1[_0x4ed6bc(0x13d)]);}catch{return LOGIN_URL_PATTERN[_0x4ed6bc(0x143)](_0x581e31);}}export async function isCachedSessionLive(_0x281545,_0x1a4a9d,_0x2c53fe={},_0x736dcc={}){const _0x20eefc=_0x537860,_0x1fca3d={'QRLSy':function(_0x5501b9,_0x427ab0){return _0x5501b9(_0x427ab0);}},_0x28d721=buildSessionCheckUrl(_0x1a4a9d,_0x2c53fe[_0x20eefc(0x142)]);if(!_0x28d721)return!![];if(!_0x736dcc['launchBrowser'])return!![];let _0x43f455=null;try{_0x43f455=await _0x736dcc[_0x20eefc(0x162)]();const _0xefa254=await _0x43f455['newContext']({'storageState':_0x281545,'ignoreHTTPSErrors':!![],..._0x2c53fe['setupHeaders']?{'extraHTTPHeaders':_0x2c53fe['setupHeaders']}:{}}),_0x420681=await _0xefa254['newPage'](),_0x5efa31=await _0x420681[_0x20eefc(0x168)](_0x28d721,{'waitUntil':_0x20eefc(0x158),'timeout':0x3a98}),_0x3b76c6=_0x5efa31?.[_0x20eefc(0x144)]();if(_0x3b76c6===0x191||_0x3b76c6===0x193)return![];const _0x42764a=_0x420681['url']();if(_0x1fca3d['QRLSy'](looksLikeLoginUrl,_0x42764a))return![];return!![];}catch{return![];}finally{if(_0x43f455)await _0x43f455['close']()[_0x20eefc(0x15d)](()=>{});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x10f4e5=_0x1096;(function(_0x460ba8,_0x269668){const _0x3c2932=_0x1096,_0x18194c=_0x460ba8();while(!![]){try{const _0x25e2ca=-parseInt(_0x3c2932(0xfd))/0x1*(parseInt(_0x3c2932(0x105))/0x2)+parseInt(_0x3c2932(0x101))/0x3*(parseInt(_0x3c2932(0x102))/0x4)+-parseInt(_0x3c2932(0xfe))/0x5+-parseInt(_0x3c2932(0xff))/0x6*(parseInt(_0x3c2932(0x10d))/0x7)+parseInt(_0x3c2932(0x108))/0x8+-parseInt(_0x3c2932(0x104))/0x9+parseInt(_0x3c2932(0x107))/0xa;if(_0x25e2ca===_0x269668)break;else _0x18194c['push'](_0x18194c['shift']());}catch(_0x279b62){_0x18194c['push'](_0x18194c['shift']());}}}(_0x30d8,0x77325));import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';function _0x30d8(){const _0x42ec5a=['subarray','final','11pwxeAA','2980555JzAnNU','9774PXUvHB','utf8','70461FaPMWo','156GzRLpR','WpYGp','7297578KDqsMh','71522XmwzjN','ranger-auth-encryption','13986580xSkLeh','5434072zUkBFp','getAuthTag','sha256','aes-256-gcm','setAuthTag','3031ekhhhk','update','QJfze','concat'];_0x30d8=function(){return _0x42ec5a;};return _0x30d8();}const ALGORITHM=_0x10f4e5(0x10b),SALT=_0x10f4e5(0x106),KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;export function deriveKey(_0x885c6e){const _0x2e9230=_0x10f4e5,_0x3e64ae={'XSGfk':function(_0x8d0d63,_0x499673,_0x14462b,_0x37aba7,_0x3fb298,_0x4e7213){return _0x8d0d63(_0x499673,_0x14462b,_0x37aba7,_0x3fb298,_0x4e7213);}};return _0x3e64ae['XSGfk'](pbkdf2Sync,_0x885c6e,SALT,0x186a0,KEY_LENGTH,_0x2e9230(0x10a));}function _0x1096(_0xdcb008,_0x26dc11){_0xdcb008=_0xdcb008-0xf9;const _0x30d879=_0x30d8();let _0x109689=_0x30d879[_0xdcb008];return _0x109689;}export function encrypt(_0x3e98d0,_0x4a81d0){const _0x3900ca=_0x10f4e5,_0x59c599=deriveKey(_0x4a81d0),_0x39fa08=randomBytes(IV_LENGTH),_0x3abc08=createCipheriv(ALGORITHM,_0x59c599,_0x39fa08),_0x5302e8=Buffer['concat']([_0x3abc08[_0x3900ca(0x10e)](_0x3e98d0,_0x3900ca(0x100)),_0x3abc08[_0x3900ca(0xfc)]()]),_0x1e53fb=_0x3abc08[_0x3900ca(0x109)]();return Buffer[_0x3900ca(0xfa)]([_0x39fa08,_0x1e53fb,_0x5302e8]);}export function decrypt(_0x3a4837,_0x36005c){const _0x67b74e=_0x10f4e5,_0x4b4ce8={'QJfze':function(_0x571295,_0x4562ca){return _0x571295(_0x4562ca);},'WpYGp':function(_0x5e204f,_0x3e50a2){return _0x5e204f+_0x3e50a2;}},_0x353a9d=_0x4b4ce8[_0x67b74e(0xf9)](deriveKey,_0x36005c),_0x1e6ec7=_0x3a4837['subarray'](0x0,IV_LENGTH),_0x42103f=_0x3a4837[_0x67b74e(0xfb)](IV_LENGTH,IV_LENGTH+TAG_LENGTH),_0x47fac=_0x3a4837['subarray'](_0x4b4ce8[_0x67b74e(0x103)](IV_LENGTH,TAG_LENGTH)),_0x3d594c=createDecipheriv(ALGORITHM,_0x353a9d,_0x1e6ec7);return _0x3d594c[_0x67b74e(0x10c)](_0x42103f),_0x4b4ce8['WpYGp'](_0x3d594c[_0x67b74e(0x10e)](_0x47fac),_0x3d594c['final'](_0x67b74e(0x100)));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x18e525=_0x54f9;(function(_0x36047f,_0xe9bfc8){const _0x88c4a2=_0x54f9,_0x24e77c=_0x36047f();while(!![]){try{const _0x5454ab=parseInt(_0x88c4a2(0xa9))/0x1*(-parseInt(_0x88c4a2(0xd2))/0x2)+-parseInt(_0x88c4a2(0xc6))/0x3*(-parseInt(_0x88c4a2(0xce))/0x4)+-parseInt(_0x88c4a2(0xd7))/0x5*(-parseInt(_0x88c4a2(0xc1))/0x6)+-parseInt(_0x88c4a2(0xd8))/0x7*(parseInt(_0x88c4a2(0xda))/0x8)+-parseInt(_0x88c4a2(0xc7))/0x9*(-parseInt(_0x88c4a2(0xad))/0xa)+-parseInt(_0x88c4a2(0xd0))/0xb+parseInt(_0x88c4a2(0xc3))/0xc;if(_0x5454ab===_0xe9bfc8)break;else _0x24e77c['push'](_0x24e77c['shift']());}catch(_0x1b89d6){_0x24e77c['push'](_0x24e77c['shift']());}}}(_0x1296,0x2fa68));function _0x1296(){const _0x2f2e10=['1KrzpZH','PaIVk','runtime_error','featureId','34520ZHWKJC','slMfg','unknown','--auth','--apikey','unknown_command','--api-key','ApPEv','TmlTr','application/json','--pass','--authorization','error','RizdJ','push','iEXlJ','missing_option','[desire-path]\x20Payload:\x20','jeNFY','includes','42psCfdg','Bearer\x20','6077232infrpq','invalid_option_value','stdout','3TlTgwd','684yTCoEn','FxyLO','--key','isTTY','catch','syntax_error','has_token','97228hGhaWa','no_token','3054634sMUkTB','env','362902wftuNX','startsWith','has','metadata','Not\x20enough\x20non-option\x20arguments','23785LthYan','7lnSrOF','FBnjs','1376584ULlvqq','some','Missing\x20required\x20argument','Unknown\x20command'];_0x1296=function(){return _0x2f2e10;};return _0x1296();}import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set(['--token','-t','--secret',_0x18e525(0xb3),_0x18e525(0xb1),_0x18e525(0xc9),'--password',_0x18e525(0xb7),_0x18e525(0xb0),_0x18e525(0xb8),'--header','--cookie','--credentials']),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0x5bda9b){const _0x3e1f3d=_0x18e525;return TOKEN_PATTERNS[_0x3e1f3d(0xdb)](_0x804291=>_0x804291['test'](_0x5bda9b));}export function sanitizeArgs(_0x368ddf){const _0x13842a=_0x18e525,_0x3a02da={'lgkpE':function(_0x11ef22,_0x132bb9){return _0x11ef22!==_0x132bb9;},'xVfnK':function(_0xa6bc3b,_0xd23087){return _0xa6bc3b(_0xd23087);}},_0x4937c8=[];let _0x560023=![];for(let _0x2b6edb=0x0;_0x2b6edb<_0x368ddf['length'];_0x2b6edb++){const _0x18ea0e=_0x368ddf[_0x2b6edb];if(_0x560023){_0x4937c8['push']('[REDACTED]'),_0x560023=![];continue;}if(_0x18ea0e['startsWith']('--')||_0x18ea0e[_0x13842a(0xd3)]('-')){const _0x328cf8=_0x18ea0e['indexOf']('=');if(_0x3a02da['lgkpE'](_0x328cf8,-0x1)){const _0x8d3af2=_0x18ea0e['slice'](0x0,_0x328cf8)['toLowerCase']();if(SENSITIVE_FLAGS['has'](_0x8d3af2)){_0x4937c8[_0x13842a(0xbb)](_0x18ea0e['slice'](0x0,_0x328cf8)+'=[REDACTED]');continue;}}else{const _0x3c6484=_0x18ea0e['toLowerCase']();SENSITIVE_FLAGS[_0x13842a(0xd4)](_0x3c6484)&&(_0x560023=!![]);}_0x4937c8['push'](_0x18ea0e);}else _0x3a02da['xVfnK'](looksLikeToken,_0x18ea0e)?_0x4937c8[_0x13842a(0xbb)]('[REDACTED]'):_0x4937c8['push'](_0x18ea0e);}return _0x4937c8['join']('\x20');}export async function logDesirePath(_0x47d048){const _0x1ceb3b=_0x18e525,_0x36cde6={'PaIVk':function(_0x378eb4){return _0x378eb4();},'FxyLO':_0x1ceb3b(0xcd),'TdltT':_0x1ceb3b(0xb6),'TPHKE':'Authorization'};try{const _0x37aad7=await getToken()[_0x1ceb3b(0xcb)](()=>null),_0x1168e2=_0x36cde6[_0x1ceb3b(0xaa)](getApiBaseUrl),_0x260016=getCurrentVersion(),_0x5b8783=_0x37aad7?_0x36cde6[_0x1ceb3b(0xc8)]:_0x1ceb3b(0xcf),_0xc6fd81={..._0x47d048[_0x1ceb3b(0xd5)],'authStatus':_0x5b8783,'isTty':process[_0x1ceb3b(0xc5)][_0x1ceb3b(0xca)]??![]},_0x3f16b0={'Content-Type':_0x36cde6['TdltT']};_0x37aad7&&(_0x3f16b0[_0x36cde6['TPHKE']]=_0x1ceb3b(0xc2)+_0x37aad7);const _0x5b4d1b={'rawCommand':_0x47d048['rawCommand'],'errorMessage':_0x47d048['errorMessage'],'errorType':_0x47d048['errorType'],'featureId':_0x47d048[_0x1ceb3b(0xac)],'sessionId':_0x47d048['sessionId'],'metadata':_0xc6fd81,'cliVersion':_0x260016};process['env']['DEBUG']&&(console[_0x1ceb3b(0xb9)]('[desire-path]\x20Sending\x20log\x20to\x20'+_0x1168e2+'/api/v1/mcp/desire-path-logs'),console[_0x1ceb3b(0xb9)](_0x1ceb3b(0xbe)+JSON['stringify'](_0x5b4d1b,null,0x2))),await fetch(_0x1168e2+'/api/v1/mcp/desire-path-logs',{'method':'POST','headers':_0x3f16b0,'body':JSON['stringify'](_0x5b4d1b)});}catch(_0x591e74){process[_0x1ceb3b(0xd1)]['DEBUG']&&console[_0x1ceb3b(0xb9)]('[desire-path]\x20Failed\x20to\x20send:\x20'+_0x591e74);}}function _0x54f9(_0x5cbb1f,_0x1b2b5b){_0x5cbb1f=_0x5cbb1f-0xa8;const _0x12966f=_0x1296();let _0x54f97a=_0x12966f[_0x5cbb1f];return _0x54f97a;}export function getErrorType(_0x3a54e6,_0xf96fbb){const _0x5b65ea=_0x18e525,_0x4940fc={'ApPEv':'6|1|0|3|4|5|2|7','jeNFY':_0x5b65ea(0xa8),'eccEu':_0x5b65ea(0xaf),'iEXlJ':_0x5b65ea(0xbd),'TmlTr':'Unknown\x20argument','sQsLS':'unknown_argument','slMfg':'missing_required_argument','RizdJ':_0x5b65ea(0xc4),'DJtda':_0x5b65ea(0xab),'FBnjs':_0x5b65ea(0xcc)},_0x5b0ec8=_0x4940fc[_0x5b65ea(0xb4)]['split']('|');let _0x5e9c10=0x0;while(!![]){switch(_0x5b0ec8[_0x5e9c10++]){case'0':if(_0x3a54e6['includes'](_0x4940fc[_0x5b65ea(0xbf)]))return _0x5b65ea(0xb2);continue;case'1':if(!_0x3a54e6)return _0x4940fc['eccEu'];continue;case'2':if(_0x3a54e6['includes'](_0x5b65ea(0xdc)))return _0x4940fc[_0x5b65ea(0xbc)];continue;case'3':if(_0x3a54e6[_0x5b65ea(0xc0)](_0x4940fc[_0x5b65ea(0xb5)]))return _0x4940fc['sQsLS'];continue;case'4':if(_0x3a54e6['includes'](_0x5b65ea(0xd6)))return _0x4940fc[_0x5b65ea(0xae)];continue;case'5':if(_0x3a54e6['includes']('Invalid\x20values'))return _0x4940fc[_0x5b65ea(0xba)];continue;case'6':if(_0xf96fbb)return _0x4940fc['DJtda'];continue;case'7':return _0x4940fc[_0x5b65ea(0xd9)];}break;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x79fdac=_0x7928;(function(_0x34aa6e,_0x1e81e6){const _0x10bcd5=_0x7928,_0x45f64a=_0x34aa6e();while(!![]){try{const _0x94e9f2=-parseInt(_0x10bcd5(0xf5))/0x1+-parseInt(_0x10bcd5(0x10f))/0x2*(-parseInt(_0x10bcd5(0xff))/0x3)+-parseInt(_0x10bcd5(0x118))/0x4*(parseInt(_0x10bcd5(0x109))/0x5)+-parseInt(_0x10bcd5(0xf6))/0x6*(-parseInt(_0x10bcd5(0xf7))/0x7)+-parseInt(_0x10bcd5(0xec))/0x8*(parseInt(_0x10bcd5(0x113))/0x9)+parseInt(_0x10bcd5(0x123))/0xa*(-parseInt(_0x10bcd5(0x130))/0xb)+parseInt(_0x10bcd5(0x111))/0xc;if(_0x94e9f2===_0x1e81e6)break;else _0x45f64a['push'](_0x45f64a['shift']());}catch(_0x11dc8b){_0x45f64a['push'](_0x45f64a['shift']());}}}(_0xee26,0x9de46));import{spawn}from'child_process';import _0x168f69 from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL=_0x79fdac(0x12d),WORKOS_TOKEN_URL='https://api.workos.com/user_management/authenticate';export async function requestDeviceCode(_0x5def07){const _0x5e865a=_0x79fdac,_0x49b0cc={'vThdC':function(_0x53d3d4,_0x2cf9ff,_0x5e0a86){return _0x53d3d4(_0x2cf9ff,_0x5e0a86);}},_0x11ad04=await _0x49b0cc['vThdC'](fetch,WORKOS_DEVICE_AUTH_URL,{'method':_0x5e865a(0x127),'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0x5def07})});if(!_0x11ad04['ok']){const _0x4281e3=await _0x11ad04[_0x5e865a(0x110)]();throw new Error('Failed\x20to\x20request\x20device\x20code:\x20'+_0x11ad04[_0x5e865a(0xfb)]+'\x20'+_0x4281e3);}return _0x11ad04['json']();}export async function pollForTokens(_0x154c66,_0xade88c,_0xee3bc9,_0x4a14f8){const _0x22c311=_0x79fdac,_0x21d8b4={'MGeQN':function(_0x202f00,_0x3d2953){return _0x202f00+_0x3d2953;},'rrHww':function(_0x5137c8,_0x228adf){return _0x5137c8*_0x228adf;},'UiUbG':function(_0x3c7d0c,_0xabaff1){return _0x3c7d0c(_0xabaff1);},'bAaXH':function(_0x7a32f1,_0x343b63,_0x527d91){return _0x7a32f1(_0x343b63,_0x527d91);},'dBRzw':_0x22c311(0x106),'nNuFg':_0x22c311(0x132),'rHKAL':function(_0x8eb8f7,_0x23c800){return _0x8eb8f7===_0x23c800;},'oQLjH':'slow_down','ywQeS':_0x22c311(0x128)},_0x20677e=_0x21d8b4['MGeQN'](Date['now'](),_0x21d8b4[_0x22c311(0xeb)](_0x4a14f8,0x3e8));let _0x4e42be=_0x21d8b4['rrHww'](_0xee3bc9,0x3e8);while(Date[_0x22c311(0x136)]()<_0x20677e){await _0x21d8b4[_0x22c311(0xf9)](sleep,_0x4e42be);const _0x4626c0=await _0x21d8b4['bAaXH'](fetch,WORKOS_TOKEN_URL,{'method':_0x22c311(0x127),'headers':{'Content-Type':_0x21d8b4['dBRzw']},'body':new URLSearchParams({'client_id':_0x154c66,'device_code':_0xade88c,'grant_type':_0x21d8b4['nNuFg']})});if(_0x4626c0['ok'])return _0x4626c0[_0x22c311(0x131)]();const _0x1db38d=await _0x4626c0['json']();if(_0x1db38d['error']===_0x22c311(0xf0))continue;if(_0x21d8b4[_0x22c311(0xfe)](_0x1db38d['error'],_0x21d8b4['oQLjH'])){_0x4e42be+=0x3e8;continue;}throw new Error(_0x1db38d[_0x22c311(0x114)]||_0x1db38d[_0x22c311(0x122)]||_0x21d8b4['ywQeS']);}throw new Error(_0x22c311(0x108));}async function fetchUserProfile(_0x3fc8ef){const _0x2bc28c=_0x79fdac,_0x8f6e24={'rqzYf':function(_0x5012ac){return _0x5012ac();}},_0x214204=_0x8f6e24[_0x2bc28c(0x119)](getApiBaseUrl);try{const _0x58e5b5=await fetch(_0x214204+_0x2bc28c(0xf2),{'method':_0x2bc28c(0xef),'headers':{'workos-token':_0x3fc8ef}});if(_0x58e5b5['ok'])return _0x58e5b5[_0x2bc28c(0x131)]();}catch{}return null;}function buildKeyName(_0x4d31b8,_0x81f1d8){const _0x286229=_0x79fdac,_0x4dfaf0={'UrPCR':function(_0x1d8e65,_0x1f8803){return _0x1d8e65===_0x1f8803;}},_0x5b1860=_0x81f1d8[_0x286229(0x11e)](_0x698d11=>_0x698d11['name']===_0x4d31b8||_0x698d11[_0x286229(0x11b)][_0x286229(0x134)](_0x4d31b8+'\x20('));if(_0x4dfaf0['UrPCR'](_0x5b1860[_0x286229(0x12c)],0x0))return _0x4d31b8;return _0x4d31b8+'\x20('+(_0x5b1860[_0x286229(0x12c)]+0x1)+')';}function _0x7928(_0x206cff,_0x1d1ae8){_0x206cff=_0x206cff-0xeb;const _0xee262=_0xee26();let _0x7928fd=_0xee262[_0x206cff];return _0x7928fd;}export async function provisionApiKey(_0x11f049){const _0x398df7=_0x79fdac,_0x306d91={'YCPvX':_0x398df7(0x10e),'vNQZr':function(_0x4ba5a2,_0x759518){return _0x4ba5a2(_0x759518);},'YswLe':function(_0x4975ad,_0x1683f2,_0x8b66d){return _0x4975ad(_0x1683f2,_0x8b66d);},'DcSoV':_0x398df7(0xef),'KqwkL':function(_0x15f244,_0x4c986c,_0x2519ce){return _0x15f244(_0x4c986c,_0x2519ce);}},_0x492395=getApiBaseUrl(),_0x4fdf55={'Content-Type':_0x306d91['YCPvX'],'workos-token':_0x11f049},_0x520770=await _0x306d91[_0x398df7(0x12b)](fetchUserProfile,_0x11f049),_0x5db8eb=_0x520770?.['firstName']||_0x520770?.[_0x398df7(0x105)]?.['split']('@')[0x0],_0x51e88b=_0x5db8eb?_0x5db8eb+'\x27s\x20CLI\x20Key':'CLI\x20Key';let _0x1e7b29=[];try{const _0x322152=await _0x306d91['YswLe'](fetch,_0x492395+_0x398df7(0x121),{'method':_0x306d91[_0x398df7(0x117)],'headers':_0x4fdf55});if(_0x322152['ok']){const _0x11cc44=await _0x322152['json']();_0x1e7b29=_0x11cc44[_0x398df7(0x116)];}}catch{}const _0x26f372=buildKeyName(_0x51e88b,_0x1e7b29),_0x35a0e6=await _0x306d91['KqwkL'](fetch,_0x492395+'/api-keys',{'method':'POST','headers':_0x4fdf55,'body':JSON[_0x398df7(0x133)]({'name':_0x26f372,'scope':_0x398df7(0x10d)})});if(!_0x35a0e6['ok']){const _0x51d1eb=await _0x35a0e6[_0x398df7(0x110)]();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x35a0e6[_0x398df7(0xfb)]+'\x20'+_0x51d1eb);}const _0x3910c0=await _0x35a0e6['json']();return _0x3910c0['apiKey'][_0x398df7(0xfc)];}export function openBrowser(_0x233499){const _0x464d90=_0x79fdac,_0x36f238={'cdBts':_0x464d90(0x100),'Dupxy':function(_0x421e7d,_0x5b4000,_0x57d4aa,_0x42e452){return _0x421e7d(_0x5b4000,_0x57d4aa,_0x42e452);},'qrFsI':_0x464d90(0x120),'MKSXf':_0x464d90(0x10b),'BvlLW':'ignore','vYaTM':function(_0x304bda,_0x1b4f51){return _0x304bda===_0x1b4f51;},'yKYWq':'open','uLQJo':function(_0x229c5e,_0x210904,_0x4b0add,_0x5970bb){return _0x229c5e(_0x210904,_0x4b0add,_0x5970bb);}};try{if(process[_0x464d90(0x135)]===_0x36f238[_0x464d90(0x137)]){const _0x171526=_0x36f238['Dupxy'](spawn,_0x36f238[_0x464d90(0xfa)],['/c',_0x36f238['MKSXf'],'',_0x233499],{'detached':!![],'stdio':_0x36f238['BvlLW'],'windowsHide':!![]});_0x171526[_0x464d90(0x104)]();return;}const _0x5130db=_0x36f238['vYaTM'](process[_0x464d90(0x135)],_0x464d90(0x102))?_0x36f238[_0x464d90(0x138)]:'xdg-open',_0x221071=_0x36f238[_0x464d90(0x12f)](spawn,_0x5130db,[_0x233499],{'detached':!![],'stdio':_0x464d90(0x11a)});_0x221071['unref']();}catch{}}function _0xee26(){const _0x50ba26=['11244924DnKwmP','Invalid\x20JWT\x20format','27ExCCir','error_description','/organization/my-memberships','apiKeys','DcSoV','28jvhFsP','rqzYf','ignore','name','log','/organization/self-serve-signup','filter','toString','cmd','/api-keys','error','1031230xRXamW','access_token','Select\x20an\x20organization:','refresh_token','POST','Authentication\x20failed','iRjdY','Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','vNQZr','length','https://api.workos.com/user_management/authorize/device','Provisioning\x20CLI\x20token...','uLQJo','11oAGWOK','json','urn:ietf:params:oauth:grant-type:device_code','stringify','startsWith','platform','now','cdBts','yKYWq','stdin','rrHww','2576776YAJOHi','XfXEy','verification_uri_complete','GET','authorization_pending','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20','/organization/me','isTTY','Waiting\x20for\x20authentication...','572403UVuGLD','6TNiZyI','8117711aMxRqQ','split','UiUbG','qrFsI','status','token','parse','rHKAL','726411LhIunE','win32','write','darwin','list','unref','email','application/x-www-form-urlencoded','CFtHl','Device\x20authorization\x20timed\x20out','554825MCkQJY','Setting\x20up\x20your\x20organization...','start','uafOo','mcp:write','application/json','8fGrMpZ','text'];_0xee26=function(){return _0x50ba26;};return _0xee26();}function decodeJwtPayload(_0x236d7d){const _0x58ab40=_0x79fdac,_0x1c2adc={'XfXEy':function(_0x5972f0,_0x98ec8b){return _0x5972f0!==_0x98ec8b;},'OfAwA':_0x58ab40(0x112),'CwpuF':'utf-8'},_0x25d5c3=_0x236d7d[_0x58ab40(0xf8)]('.');if(_0x1c2adc[_0x58ab40(0xed)](_0x25d5c3['length'],0x3))throw new Error(_0x1c2adc['OfAwA']);const _0x13e67b=Buffer['from'](_0x25d5c3[0x1],'base64url')[_0x58ab40(0x11f)](_0x1c2adc['CwpuF']);return JSON[_0x58ab40(0xfd)](_0x13e67b);}async function selfServeSignup(_0x26701b){const _0x44b769=_0x79fdac,_0x4f4d2a={'VhSlz':'application/json'},_0x134d63=getApiBaseUrl(),_0x449ccf=await fetch(_0x134d63+_0x44b769(0x11d),{'method':_0x44b769(0x127),'headers':{'Content-Type':_0x4f4d2a['VhSlz'],'workos-token':_0x26701b}});if(!_0x449ccf['ok']){const _0x1b9a2e=await _0x449ccf[_0x44b769(0x110)]();throw new Error('Failed\x20to\x20create\x20organization:\x20'+_0x449ccf['status']+'\x20'+_0x1b9a2e);}return _0x449ccf[_0x44b769(0x131)]();}async function fetchMyMemberships(_0x202fc1){const _0x3f06e3=_0x79fdac,_0x436278={'KMylj':function(_0x4677ea){return _0x4677ea();},'botCV':function(_0x3c3ace,_0x7c8b98,_0x1b0643){return _0x3c3ace(_0x7c8b98,_0x1b0643);}},_0x57302c=_0x436278['KMylj'](getApiBaseUrl),_0x26157d=await _0x436278['botCV'](fetch,_0x57302c+_0x3f06e3(0x115),{'method':'GET','headers':{'workos-token':_0x202fc1}});if(!_0x26157d['ok']){const _0x5024f8=await _0x26157d['text']();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0x26157d['status']+'\x20'+_0x5024f8);}const _0x204a41=await _0x26157d['json']();return _0x204a41['memberships'];}async function refreshTokenWithOrg(_0x18b0c5,_0x1852b3,_0x4f3804){const _0x32d2f7=_0x79fdac,_0x423eb1={'uafOo':function(_0x400bca,_0x15bd3c,_0x126795){return _0x400bca(_0x15bd3c,_0x126795);}},_0x10defb=await _0x423eb1[_0x32d2f7(0x10c)](fetch,WORKOS_TOKEN_URL,{'method':_0x32d2f7(0x127),'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0x18b0c5,'grant_type':'refresh_token','refresh_token':_0x1852b3,'organization_id':_0x4f3804})});if(!_0x10defb['ok']){const _0x3193a1=await _0x10defb['text']();throw new Error('Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'+_0x10defb['status']+'\x20'+_0x3193a1);}return _0x10defb[_0x32d2f7(0x131)]();}async function provisionCliToken(_0x3f0389){const _0x33b28d=_0x79fdac,_0x4b5f16={'CFtHl':function(_0x387157){return _0x387157();},'ZlpqY':function(_0x497d13,_0x34368a,_0x25fa1d){return _0x497d13(_0x34368a,_0x25fa1d);},'IoEhk':_0x33b28d(0x127)},_0x21954a=_0x4b5f16[_0x33b28d(0x107)](getApiBaseUrl),_0x242757=await _0x4b5f16['ZlpqY'](fetch,_0x21954a+'/cli-auth/token',{'method':_0x4b5f16['IoEhk'],'headers':{'Content-Type':_0x33b28d(0x10e),'workos-token':_0x3f0389}});if(!_0x242757['ok']){const _0x10a181=await _0x242757[_0x33b28d(0x110)]();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x242757[_0x33b28d(0xfb)]+'\x20'+_0x10a181);}return _0x242757['json']();}export async function runDeviceAuthFlow(){const _0x31444=_0x79fdac,_0x566490={'wMVyi':function(_0x1a3475){return _0x1a3475();},'lmuRo':function(_0x4eede0,_0x39e184,_0x25d8f0,_0x2c28d3,_0x5d8ba2){return _0x4eede0(_0x39e184,_0x25d8f0,_0x2c28d3,_0x5d8ba2);},'rxigI':function(_0x185077,_0x37e217){return _0x185077===_0x37e217;},'bZlZJ':_0x31444(0x10a),'iRjdY':'Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','CUDgR':_0x31444(0x12a),'IUgKX':'selected','Qnvgw':_0x31444(0x12e)},_0x47b46e=_0x566490['wMVyi'](getCurrentEnvironment),_0x3bab53=ENVIRONMENT_CONFIGS[_0x47b46e]['workosClientId'],_0x18ce2e=await requestDeviceCode(_0x3bab53);console['log']('\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...'),console[_0x31444(0x11c)]('\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a'),openBrowser(_0x18ce2e['verification_uri_complete']),console['log'](_0x31444(0xf1)+_0x18ce2e[_0x31444(0xee)]),console['log']('Code:\x20'+_0x18ce2e['user_code']+'\x0a'),process['stdout']['write'](_0x31444(0xf4));let _0xb30746=await _0x566490['lmuRo'](pollForTokens,_0x3bab53,_0x18ce2e['device_code'],_0x18ce2e['interval'],_0x18ce2e['expires_in']);console['log']('\x20✓');const _0xa6a06d=decodeJwtPayload(_0xb30746['access_token']);if(!_0xa6a06d['org_id']){const _0x4edc9a=await fetchMyMemberships(_0xb30746[_0x31444(0x124)]);let _0x4a5fa3;if(_0x566490['rxigI'](_0x4edc9a['length'],0x0)){process['stdout'][_0x31444(0x101)](_0x566490['bZlZJ']);const _0x1e17f3=await selfServeSignup(_0xb30746[_0x31444(0x124)]);_0x4a5fa3=_0x1e17f3['organizationId'],console[_0x31444(0x11c)]('\x20✓');}else{if(_0x4edc9a['length']===0x1)_0x4a5fa3=_0x4edc9a[0x0]['organizationId'],console[_0x31444(0x11c)]('Using\x20organization:\x20'+_0x4edc9a[0x0][_0x31444(0x11b)]);else{const _0x152ec9=process[_0x31444(0x139)][_0x31444(0xf3)]&&process['stdout']['isTTY'];if(!_0x152ec9)throw new Error(_0x566490[_0x31444(0x129)]+_0x566490['CUDgR']);const {selected:_0x3707c7}=await _0x168f69['prompt']([{'type':_0x31444(0x103),'name':_0x566490['IUgKX'],'message':_0x31444(0x125),'choices':_0x4edc9a['map'](_0x1ec51d=>({'name':_0x1ec51d[_0x31444(0x11b)],'value':_0x1ec51d['organizationId']}))}]);_0x4a5fa3=_0x3707c7;}}_0xb30746=await refreshTokenWithOrg(_0x3bab53,_0xb30746['refresh_token'],_0x4a5fa3);}process['stdout'][_0x31444(0x101)](_0x566490['Qnvgw']);const _0x4503e6=await provisionCliToken(_0xb30746['access_token']);return console['log']('\x20✓'),await storeToken(_0x4503e6['token']),_0xb30746[_0x31444(0x126)]&&await storeRefreshToken(_0xb30746[_0x31444(0x126)]),_0x4503e6['token'];}function sleep(_0x3be59c){return new Promise(_0x4fbcb4=>setTimeout(_0x4fbcb4,_0x3be59c));}
|
|
1
|
+
(function(_0xcd1037,_0x2697ae){const _0x540af2=_0x33dc,_0x4af8a2=_0xcd1037();while(!![]){try{const _0x4ea8d2=-parseInt(_0x540af2(0x1a6))/0x1+-parseInt(_0x540af2(0x18c))/0x2+-parseInt(_0x540af2(0x1a0))/0x3*(-parseInt(_0x540af2(0x1b9))/0x4)+-parseInt(_0x540af2(0x195))/0x5+parseInt(_0x540af2(0x1c0))/0x6+-parseInt(_0x540af2(0x1ba))/0x7+parseInt(_0x540af2(0x190))/0x8*(parseInt(_0x540af2(0x1bf))/0x9);if(_0x4ea8d2===_0x2697ae)break;else _0x4af8a2['push'](_0x4af8a2['shift']());}catch(_0x3a5d4f){_0x4af8a2['push'](_0x4af8a2['shift']());}}}(_0x19ff,0xe285b));import{spawn}from'child_process';import _0x212697 from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL='https://api.workos.com/user_management/authorize/device',WORKOS_TOKEN_URL='https://api.workos.com/user_management/authenticate';export async function requestDeviceCode(_0x45ff83){const _0x551315=_0x33dc,_0x5d978f={'NqQck':function(_0x4f5dc6,_0x40cea8,_0x4d3aa6){return _0x4f5dc6(_0x40cea8,_0x4d3aa6);},'ulkmO':_0x551315(0x192)},_0x1a7cff=await _0x5d978f[_0x551315(0x199)](fetch,WORKOS_DEVICE_AUTH_URL,{'method':'POST','headers':{'Content-Type':_0x5d978f['ulkmO']},'body':new URLSearchParams({'client_id':_0x45ff83})});if(!_0x1a7cff['ok']){const _0x9c2e64=await _0x1a7cff[_0x551315(0x1a2)]();throw new Error('Failed\x20to\x20request\x20device\x20code:\x20'+_0x1a7cff[_0x551315(0x1be)]+'\x20'+_0x9c2e64);}return _0x1a7cff['json']();}export async function pollForTokens(_0x456e8a,_0x48c63e,_0x3548f5,_0x24c350){const _0x3ba62b=_0x33dc,_0x1d5cab={'FbVQW':function(_0x44ad44,_0x5d0613,_0x3fa301){return _0x44ad44(_0x5d0613,_0x3fa301);},'rwcko':'POST','acJkI':_0x3ba62b(0x177),'UyICi':function(_0x27dfa2,_0x1e70f){return _0x27dfa2===_0x1e70f;},'VFLyn':_0x3ba62b(0x1a3),'heHEN':'Device\x20authorization\x20timed\x20out'},_0x34040b=Date[_0x3ba62b(0x1ab)]()+_0x24c350*0x3e8;let _0x75eae7=_0x3548f5*0x3e8;while(Date[_0x3ba62b(0x1ab)]()<_0x34040b){await sleep(_0x75eae7);const _0x40a911=await _0x1d5cab[_0x3ba62b(0x18f)](fetch,WORKOS_TOKEN_URL,{'method':_0x1d5cab['rwcko'],'headers':{'Content-Type':_0x3ba62b(0x192)},'body':new URLSearchParams({'client_id':_0x456e8a,'device_code':_0x48c63e,'grant_type':_0x1d5cab['acJkI']})});if(_0x40a911['ok'])return _0x40a911[_0x3ba62b(0x183)]();const _0x3c4815=await _0x40a911[_0x3ba62b(0x183)]();if(_0x3c4815['error']===_0x3ba62b(0x1bb))continue;if(_0x1d5cab[_0x3ba62b(0x19f)](_0x3c4815['error'],'slow_down')){_0x75eae7+=0x3e8;continue;}throw new Error(_0x3c4815['error_description']||_0x3c4815[_0x3ba62b(0x16d)]||_0x1d5cab[_0x3ba62b(0x17f)]);}throw new Error(_0x1d5cab[_0x3ba62b(0x181)]);}async function fetchUserProfile(_0x55ca0a){const _0x11e546=_0x33dc,_0x134d50={'QVOsI':function(_0x173499){return _0x173499();}},_0x20fb4f=_0x134d50['QVOsI'](getApiBaseUrl);try{const _0x350ad0=await fetch(_0x20fb4f+'/organization/me',{'method':'GET','headers':{'workos-token':_0x55ca0a}});if(_0x350ad0['ok'])return _0x350ad0[_0x11e546(0x183)]();}catch{}return null;}function buildKeyName(_0x8a255d,_0x5cad76){const _0x123ce8=_0x33dc,_0x52562f=_0x5cad76[_0x123ce8(0x178)](_0x589c3a=>_0x589c3a['name']===_0x8a255d||_0x589c3a[_0x123ce8(0x1b7)]['startsWith'](_0x8a255d+'\x20('));if(_0x52562f['length']===0x0)return _0x8a255d;return _0x8a255d+'\x20('+(_0x52562f['length']+0x1)+')';}export async function provisionApiKey(_0x30363d){const _0x215a57=_0x33dc,_0x374b2a={'BwJVy':function(_0x2664fd){return _0x2664fd();},'vraCh':function(_0x5cb428,_0x421233,_0x5ab7c8){return _0x5cb428(_0x421233,_0x5ab7c8);},'IDFjF':'POST','fRkTr':_0x215a57(0x17b)},_0x257da4=_0x374b2a[_0x215a57(0x193)](getApiBaseUrl),_0x2c1b5f={'Content-Type':_0x215a57(0x18a),'workos-token':_0x30363d},_0x1326ee=await fetchUserProfile(_0x30363d),_0x384c72=_0x1326ee?.['firstName']||_0x1326ee?.[_0x215a57(0x1b4)]?.['split']('@')[0x0],_0x22c61b=_0x384c72?_0x384c72+_0x215a57(0x16e):_0x215a57(0x1b3);let _0x8eb1ea=[];try{const _0x495dfc=await fetch(_0x257da4+_0x215a57(0x1b2),{'method':'GET','headers':_0x2c1b5f});if(_0x495dfc['ok']){const _0x55dcda=await _0x495dfc['json']();_0x8eb1ea=_0x55dcda['apiKeys'];}}catch{}const _0x37e6c2=_0x374b2a['vraCh'](buildKeyName,_0x22c61b,_0x8eb1ea),_0xa8cd42=await _0x374b2a['vraCh'](fetch,_0x257da4+'/api-keys',{'method':_0x374b2a[_0x215a57(0x1ae)],'headers':_0x2c1b5f,'body':JSON['stringify']({'name':_0x37e6c2,'scope':_0x374b2a['fRkTr']})});if(!_0xa8cd42['ok']){const _0x11499c=await _0xa8cd42[_0x215a57(0x1a2)]();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0xa8cd42['status']+'\x20'+_0x11499c);}const _0x54f38d=await _0xa8cd42['json']();return _0x54f38d['apiKey']['token'];}export function openBrowser(_0x51e4ef){const _0x584065=_0x33dc,_0x4e59b3={'xOfTj':_0x584065(0x19e),'amhJB':_0x584065(0x1a9),'uLRGO':'xdg-open'};try{if(process['platform']===_0x584065(0x1af)){const _0x546951=spawn('cmd',['/c','start','',_0x51e4ef],{'detached':!![],'stdio':_0x4e59b3[_0x584065(0x175)],'windowsHide':!![]});_0x546951['unref']();return;}const _0x50e295=process[_0x584065(0x1b6)]===_0x4e59b3['amhJB']?'open':_0x4e59b3[_0x584065(0x198)],_0x454fa1=spawn(_0x50e295,[_0x51e4ef],{'detached':!![],'stdio':_0x584065(0x19e)});_0x454fa1[_0x584065(0x185)]();}catch{}}function decodeJwtPayload(_0x34e414){const _0x1b3339=_0x33dc,_0x255cf3={'tMNCM':function(_0x16ebc9,_0x1d7e40){return _0x16ebc9!==_0x1d7e40;},'UCrQb':_0x1b3339(0x172),'Kxmap':_0x1b3339(0x16c)},_0x5cb9f3=_0x34e414[_0x1b3339(0x17e)]('.');if(_0x255cf3[_0x1b3339(0x1b1)](_0x5cb9f3['length'],0x3))throw new Error(_0x255cf3[_0x1b3339(0x176)]);const _0x5e52bb=Buffer[_0x1b3339(0x1ac)](_0x5cb9f3[0x1],'base64url')[_0x1b3339(0x16f)](_0x255cf3[_0x1b3339(0x18b)]);return JSON['parse'](_0x5e52bb);}async function selfServeSignup(_0x3f5290){const _0x5330c0=_0x33dc,_0x4fb101={'FpCsT':function(_0x22553b,_0x116891,_0x30cb40){return _0x22553b(_0x116891,_0x30cb40);},'jCnNN':_0x5330c0(0x18a)},_0x440b22=getApiBaseUrl(),_0x23f34a=await _0x4fb101['FpCsT'](fetch,_0x440b22+'/organization/self-serve-signup',{'method':'POST','headers':{'Content-Type':_0x4fb101[_0x5330c0(0x16b)],'workos-token':_0x3f5290}});if(!_0x23f34a['ok']){const _0xd8dfcd=await _0x23f34a['text']();throw new Error(_0x5330c0(0x19a)+_0x23f34a[_0x5330c0(0x1be)]+'\x20'+_0xd8dfcd);}return _0x23f34a['json']();}async function fetchMyMemberships(_0xedb7f0){const _0x568d88=_0x33dc,_0x1a0b5a={'LkBOV':function(_0x5e6544,_0x204e24,_0x912c3d){return _0x5e6544(_0x204e24,_0x912c3d);},'IpYNe':_0x568d88(0x17d)},_0xe525df=getApiBaseUrl(),_0x3b403e=await _0x1a0b5a['LkBOV'](fetch,_0xe525df+_0x568d88(0x197),{'method':_0x1a0b5a[_0x568d88(0x188)],'headers':{'workos-token':_0xedb7f0}});if(!_0x3b403e['ok']){const _0x4aee6c=await _0x3b403e['text']();throw new Error(_0x568d88(0x19c)+_0x3b403e[_0x568d88(0x1be)]+'\x20'+_0x4aee6c);}const _0x13c06d=await _0x3b403e[_0x568d88(0x183)]();return _0x13c06d[_0x568d88(0x17a)];}function _0x33dc(_0xbe3089,_0x4c442f){_0xbe3089=_0xbe3089-0x16b;const _0x19ff31=_0x19ff();let _0x33dceb=_0x19ff31[_0xbe3089];return _0x33dceb;}async function refreshTokenWithOrg(_0x4620c8,_0xe9711e,_0x57a63c){const _0x5d8804=_0x33dc,_0x2e5367={'nUUmD':function(_0x562a2e,_0x53be33,_0x10823e){return _0x562a2e(_0x53be33,_0x10823e);},'SunyO':_0x5d8804(0x179),'OXvuE':'application/x-www-form-urlencoded'},_0x1ee6bb=await _0x2e5367['nUUmD'](fetch,WORKOS_TOKEN_URL,{'method':_0x2e5367[_0x5d8804(0x171)],'headers':{'Content-Type':_0x2e5367[_0x5d8804(0x17c)]},'body':new URLSearchParams({'client_id':_0x4620c8,'grant_type':'refresh_token','refresh_token':_0xe9711e,'organization_id':_0x57a63c})});if(!_0x1ee6bb['ok']){const _0x3495e2=await _0x1ee6bb[_0x5d8804(0x1a2)]();throw new Error(_0x5d8804(0x18d)+_0x1ee6bb[_0x5d8804(0x1be)]+'\x20'+_0x3495e2);}return _0x1ee6bb[_0x5d8804(0x183)]();}async function provisionCliToken(_0x437c86){const _0x726a=_0x33dc,_0x3bbc7c={'xdimS':function(_0x51cb2a){return _0x51cb2a();},'MhXrt':function(_0x135322,_0x22b1ab,_0x48f3c2){return _0x135322(_0x22b1ab,_0x48f3c2);}},_0x3119fc=_0x3bbc7c[_0x726a(0x191)](getApiBaseUrl),_0x50c8b9=await _0x3bbc7c[_0x726a(0x196)](fetch,_0x3119fc+'/cli-auth/token',{'method':'POST','headers':{'Content-Type':'application/json','workos-token':_0x437c86}});if(!_0x50c8b9['ok']){const _0x3cdb04=await _0x50c8b9[_0x726a(0x1a2)]();throw new Error(_0x726a(0x1ad)+_0x50c8b9[_0x726a(0x1be)]+'\x20'+_0x3cdb04);}return _0x50c8b9[_0x726a(0x183)]();}function _0x19ff(){const _0x5460ae=['mcp:write','OXvuE','GET','split','VFLyn','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','heHEN','BylfG','json','length','unref','refresh_token','access_token','IpYNe','stdout','application/json','Kxmap','647796WLcqLr','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20','JEppE','FbVQW','3975256feLHRR','xdimS','application/x-www-form-urlencoded','BwJVy','log','4565035PYwWyl','MhXrt','/organization/my-memberships','uLRGO','NqQck','Failed\x20to\x20create\x20organization:\x20','Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','Failed\x20to\x20fetch\x20memberships:\x20','stdin','ignore','UyICi','6BwsPvH','workosClientId','text','Authentication\x20failed','list','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20','756535bcldOH','fgLnP','verification_uri_complete','darwin','user_code','now','from','Failed\x20to\x20provision\x20CLI\x20token:\x20','IDFjF','win32','selected','tMNCM','/api-keys','CLI\x20Key','email','organizationId','platform','name','token','3545252GrdzKX','12225129NCjnhx','authorization_pending','device_code','Using\x20organization:\x20','status','27jMQfJf','8426250dCHfkp','jCnNN','utf-8','error','\x27s\x20CLI\x20Key','toString','write','SunyO','Invalid\x20JWT\x20format','FKYmt','expires_in','xOfTj','UCrQb','urn:ietf:params:oauth:grant-type:device_code','filter','POST','memberships'];_0x19ff=function(){return _0x5460ae;};return _0x19ff();}export async function runDeviceAuthFlow(){const _0x23474d=_0x33dc,_0x704aad={'fgLnP':function(_0x51cd96,_0xa91cad){return _0x51cd96(_0xa91cad);},'BylfG':function(_0x25a486,_0x2e205b){return _0x25a486(_0x2e205b);},'uhGEO':function(_0xc703b7,_0x101a56){return _0xc703b7===_0x101a56;},'fPQUL':function(_0x276369,_0x1cdfe1){return _0x276369(_0x1cdfe1);},'JEppE':_0x23474d(0x180),'vUkwn':_0x23474d(0x19b),'OtbNc':_0x23474d(0x1a4),'YkLIS':'Select\x20an\x20organization:','FKYmt':function(_0x17800c,_0x351d82,_0x299174,_0x3a6972){return _0x17800c(_0x351d82,_0x299174,_0x3a6972);},'eSJCc':function(_0x2d6b5f,_0x41f051){return _0x2d6b5f(_0x41f051);}},_0x578064=getCurrentEnvironment(),_0x11427e=ENVIRONMENT_CONFIGS[_0x578064][_0x23474d(0x1a1)],_0x3ee12c=await _0x704aad['fgLnP'](requestDeviceCode,_0x11427e);console[_0x23474d(0x194)]('\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...'),console['log']('\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a'),_0x704aad[_0x23474d(0x1a7)](openBrowser,_0x3ee12c['verification_uri_complete']),console[_0x23474d(0x194)](_0x23474d(0x1a5)+_0x3ee12c[_0x23474d(0x1a8)]),console[_0x23474d(0x194)]('Code:\x20'+_0x3ee12c[_0x23474d(0x1aa)]+'\x0a'),process['stdout'][_0x23474d(0x170)]('Waiting\x20for\x20authentication...');let _0x29719d=await pollForTokens(_0x11427e,_0x3ee12c[_0x23474d(0x1bc)],_0x3ee12c['interval'],_0x3ee12c[_0x23474d(0x174)]);console[_0x23474d(0x194)]('\x20✓');const _0x400759=_0x704aad['BylfG'](decodeJwtPayload,_0x29719d[_0x23474d(0x187)]);if(!_0x400759['org_id']){const _0x3bb94c=await _0x704aad[_0x23474d(0x182)](fetchMyMemberships,_0x29719d[_0x23474d(0x187)]);let _0x3ee13f;if(_0x704aad['uhGEO'](_0x3bb94c[_0x23474d(0x184)],0x0)){process[_0x23474d(0x189)]['write']('Setting\x20up\x20your\x20organization...');const _0x107cd8=await _0x704aad['fPQUL'](selfServeSignup,_0x29719d['access_token']);_0x3ee13f=_0x107cd8[_0x23474d(0x1b5)],console['log']('\x20✓');}else{if(_0x704aad['uhGEO'](_0x3bb94c['length'],0x1))_0x3ee13f=_0x3bb94c[0x0]['organizationId'],console[_0x23474d(0x194)](_0x23474d(0x1bd)+_0x3bb94c[0x0]['name']);else{const _0x27de03=process[_0x23474d(0x19d)]['isTTY']&&process[_0x23474d(0x189)]['isTTY'];if(!_0x27de03)throw new Error(_0x704aad[_0x23474d(0x18e)]+_0x704aad['vUkwn']);const {selected:_0x330dd6}=await _0x212697['prompt']([{'type':_0x704aad['OtbNc'],'name':_0x23474d(0x1b0),'message':_0x704aad['YkLIS'],'choices':_0x3bb94c['map'](_0x2b9678=>({'name':_0x2b9678['name'],'value':_0x2b9678[_0x23474d(0x1b5)]}))}]);_0x3ee13f=_0x330dd6;}}_0x29719d=await _0x704aad[_0x23474d(0x173)](refreshTokenWithOrg,_0x11427e,_0x29719d[_0x23474d(0x186)],_0x3ee13f);}process[_0x23474d(0x189)]['write']('Provisioning\x20CLI\x20token...');const _0x1f40c6=await provisionCliToken(_0x29719d['access_token']);return console['log']('\x20✓'),await storeToken(_0x1f40c6['token']),_0x29719d[_0x23474d(0x186)]&&await _0x704aad['eSJCc'](storeRefreshToken,_0x29719d['refresh_token']),_0x1f40c6[_0x23474d(0x1b8)];}function sleep(_0x5ad8e1){return new Promise(_0x4744b8=>setTimeout(_0x4744b8,_0x5ad8e1));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const _0x5f4368=_0x5307;function _0x47f0(){const _0x1937cc=['mcpAuthUrl','http://localhost:8080','781116rmbAIl','1105832BjAwas','apiBaseUrl','RmyjL','799675zLeGyN','mcp','prod','true','6uFjPGd','246673KsmUuT','client_01J9CBYM7M5ZETCF7G6614DXR2','staging','https://ai-proxy-301751771437.us-central1.run.app','142365dHJedL','aiProxyUrl','2189572FemWON','elQxn','env','ZXkQs','2369552iRDqgY'];_0x47f0=function(){return _0x1937cc;};return _0x47f0();}(function(_0x44d9b3,_0x9d8a92){const _0x5df966=_0x5307,_0x52ee9c=_0x44d9b3();while(!![]){try{const _0x26c4ec=-parseInt(_0x5df966(0x18a))/0x1+parseInt(_0x5df966(0x189))/0x2*(-parseInt(_0x5df966(0x18e))/0x3)+parseInt(_0x5df966(0x198))/0x4+parseInt(_0x5df966(0x19b))/0x5+parseInt(_0x5df966(0x197))/0x6+-parseInt(_0x5df966(0x190))/0x7+parseInt(_0x5df966(0x194))/0x8;if(_0x26c4ec===_0x9d8a92)break;else _0x52ee9c['push'](_0x52ee9c['shift']());}catch(_0x314ca1){_0x52ee9c['push'](_0x52ee9c['shift']());}}}(_0x47f0,0x274ab));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':'https://api.ranger.net','workosClientId':_0x5f4368(0x18b),'aiProxyUrl':'https://ai-proxy-716115358910.us-central1.run.app','mcpAuthUrl':'https://mcp-auth.ranger.net/mcp'},'staging':{'apiBaseUrl':'https://api.staging.ranger.net','workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':_0x5f4368(0x18d),'mcpAuthUrl':'https://mcp-auth.staging.ranger.net/mcp'},'local':{'apiBaseUrl':_0x5f4368(0x196),'workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':'http://localhost:8090','mcpAuthUrl':'http://localhost:8080/mcp'}};export const DEFAULT_ENVIRONMENT=_0x5f4368(0x19d);export function isValidEnvironment(_0x798b20){const _0x2c454a=_0x5f4368,_0x1ff8a2={'RmyjL':function(_0x3d50f9,_0x3ea56c){return _0x3d50f9===_0x3ea56c;},'ZXkQs':_0x2c454a(0x18c)};return _0x1ff8a2[_0x2c454a(0x19a)](_0x798b20,_0x2c454a(0x19d))||_0x1ff8a2['RmyjL'](_0x798b20,_0x1ff8a2[_0x2c454a(0x193)])||_0x798b20==='local';}export function getCurrentEnvironment(){const _0x8a10b4=_0x5f4368,_0x1255cd=process[_0x8a10b4(0x192)]['RANGER_CLI_ENV'];if(_0x1255cd&&isValidEnvironment(_0x1255cd))return _0x1255cd;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){const _0x5b9c8f=_0x5f4368,_0x39ccd7={'elQxn':function(_0x4e0e21){return _0x4e0e21();}};return ENVIRONMENT_CONFIGS[_0x39ccd7[_0x5b9c8f(0x191)](getCurrentEnvironment)][_0x5b9c8f(0x199)];}export function getAiProxyUrl(){const _0x39edee=_0x5f4368;return ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x39edee(0x18f)];}export function getMcpAuthUrl(){const _0x2bfb12=_0x5f4368;return process[_0x2bfb12(0x192)]['RANGER_MCP_AUTH_URL']??ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x2bfb12(0x195)];}export function isByokEnabled(){const _0x10386f=_0x5f4368;return process[_0x10386f(0x192)]['RANGER_BYOK']===_0x10386f(0x19e);}export function isMcpDisabled(){return process['env']['RANGER_DISABLE_MCP']==='true';}function _0x5307(_0x5df09f,_0x3e29e2){_0x5df09f=_0x5df09f-0x189;const _0x47f0c3=_0x47f0();let _0x5307fd=_0x47f0c3[_0x5df09f];return _0x5307fd;}export function getVerificationTransport(){const _0x509e8f=_0x5f4368,_0x2ab8f9={'rhgtu':function(_0x53f21a){return _0x53f21a();},'JmqiE':'playwright-cli'};return _0x2ab8f9['rhgtu'](isMcpDisabled)?_0x2ab8f9['JmqiE']:_0x509e8f(0x19c);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x5d2ea7,_0x35bfe7){const _0x254bf0=_0x5576,_0x47b004=_0x5d2ea7();while(!![]){try{const _0x27d708=parseInt(_0x254bf0(0x144))/0x1+-parseInt(_0x254bf0(0x171))/0x2+parseInt(_0x254bf0(0x165))/0x3+parseInt(_0x254bf0(0x15e))/0x4*(parseInt(_0x254bf0(0x13d))/0x5)+-parseInt(_0x254bf0(0x176))/0x6*(-parseInt(_0x254bf0(0x146))/0x7)+parseInt(_0x254bf0(0x15a))/0x8*(parseInt(_0x254bf0(0x151))/0x9)+-parseInt(_0x254bf0(0x177))/0xa;if(_0x27d708===_0x35bfe7)break;else _0x47b004['push'](_0x47b004['shift']());}catch(_0x15a486){_0x47b004['push'](_0x47b004['shift']());}}}(_0x1266,0x5381a));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';function _0x5576(_0x28a37b,_0x28011a){_0x28a37b=_0x28a37b-0x13d;const _0x1266cb=_0x1266();let _0x55762a=_0x1266cb[_0x28a37b];return _0x55762a;}export async function createFeature(_0x3ebc6c){const _0x448236=_0x5576,_0x581b29={'GRhsd':function(_0x353041){return _0x353041();},'anKxQ':_0x448236(0x15c),'FZeIT':_0x448236(0x157),'scqjd':_0x448236(0x140)},_0x288cc9=await getToken();if(!_0x288cc9)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x3d580c=_0x581b29[_0x448236(0x166)](getApiBaseUrl),_0x436fa6=await fetch(_0x3d580c+'/api/v1/mcp/features',{'method':_0x581b29[_0x448236(0x149)],'headers':{'Authorization':'Bearer\x20'+_0x288cc9,'Content-Type':_0x581b29['FZeIT']},'body':JSON[_0x448236(0x14f)](_0x3ebc6c)});if(!_0x436fa6['ok']){if(_0x436fa6['status']===0x192){const _0x1ccca8=await _0x436fa6['json'](),_0x1cc013=_0x1ccca8['billingUrl']||_0x581b29['scqjd'];throw new Error((_0x1ccca8[_0x448236(0x181)]||'Feature\x20limit\x20exceeded')+'\x0a\x0aUpgrade\x20your\x20plan:\x20'+_0x1cc013);}const _0x36c210=await _0x436fa6['text']();throw new Error('Failed\x20to\x20create\x20feature\x20review:\x20'+_0x36c210);}return _0x436fa6['json']();}export async function listFeatures(_0x22d1a9){const _0x1d2b8d=_0x5576,_0xb428bb={'Gmwyy':function(_0x5e659d){return _0x5e659d();},'ZZaGC':function(_0x187a8f){return _0x187a8f();},'SQEvy':'gitBranch','qOrHN':_0x1d2b8d(0x164),'VzjYe':'offset','xZFyv':_0x1d2b8d(0x16f)},_0x73500a=await _0xb428bb['Gmwyy'](getToken);if(!_0x73500a)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x590c77=_0xb428bb['ZZaGC'](getApiBaseUrl),_0x148ca8=new URLSearchParams();if(_0x22d1a9?.['gitRepoUrl'])_0x148ca8[_0x1d2b8d(0x163)]('gitRepoUrl',_0x22d1a9['gitRepoUrl']);if(_0x22d1a9?.['gitBranch'])_0x148ca8[_0x1d2b8d(0x163)](_0xb428bb[_0x1d2b8d(0x155)],_0x22d1a9['gitBranch']);if(_0x22d1a9?.['limit'])_0x148ca8[_0x1d2b8d(0x163)](_0xb428bb['qOrHN'],_0x22d1a9[_0x1d2b8d(0x164)][_0x1d2b8d(0x174)]());if(_0x22d1a9?.['offset'])_0x148ca8[_0x1d2b8d(0x163)](_0xb428bb[_0x1d2b8d(0x16a)],_0x22d1a9[_0x1d2b8d(0x16d)]['toString']());if(_0x22d1a9?.['includeDeleted'])_0x148ca8[_0x1d2b8d(0x163)](_0xb428bb['xZFyv'],_0x1d2b8d(0x17b));const _0x942445=_0x590c77+_0x1d2b8d(0x154)+(_0x148ca8[_0x1d2b8d(0x174)]()?'?'+_0x148ca8['toString']():''),_0x9406ff=await fetch(_0x942445,{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x73500a}});if(!_0x9406ff['ok']){const _0x1f69d6=await _0x9406ff[_0x1d2b8d(0x17f)]();throw new Error('Failed\x20to\x20list\x20feature\x20reviews:\x20'+_0x1f69d6);}return _0x9406ff['json']();}function _0x1266(){const _0x328987=['application/json','PmGgH','Failed\x20to\x20update\x20feature\x20review:\x20','4700216WAlcbm','GET','POST','WbIBH','7964cIVqQm','ZWkUi','aqfkJ','EtmRw','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','set','limit','1885515tquNOC','GRhsd','swEza','YDHga','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','VzjYe','tukZx','dbrIw','offset','CGhYX','includeDeleted','/report/markdown','277460gSQofa','length','Failed\x20to\x20start\x20session:\x20','toString','/checklist-items/','2151186bAyVJg','12889710CLuXap','yCYzV','Failed\x20to\x20update\x20scenario:\x20','Qulct','true','gngcX','/api/v1/mcp/features/','sessionId','text','KlFYw','message','QDTRw','/report','/feedback','80lAGOeY','uwusL','nEsFZ','https://dashboard.ranger.net/billing','DQCll','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','Bearer\x20','163324FtIXDw','BRXSN','7Pjhpad','json','Failed\x20to\x20conclude\x20session:\x20','anKxQ','lszjc','Failed\x20to\x20get\x20item\x20feedback:\x20','style','itemIds','IlnNh','stringify','Failed\x20to\x20list\x20sessions:\x20','9biiNeL','tGeZk','ItFqE','/api/v1/mcp/features','SQEvy','yqBIr'];_0x1266=function(){return _0x328987;};return _0x1266();}export async function getFeature(_0x254b03){const _0x566b6d=_0x5576,_0x1a62cc={'swEza':_0x566b6d(0x162)},_0x109c3a=await getToken();if(!_0x109c3a)throw new Error(_0x1a62cc[_0x566b6d(0x167)]);const _0x37ec27=getApiBaseUrl(),_0x554697=await fetch(_0x37ec27+_0x566b6d(0x17d)+_0x254b03,{'method':_0x566b6d(0x15b),'headers':{'Authorization':_0x566b6d(0x143)+_0x109c3a}});if(!_0x554697['ok']){const _0x3aca81=await _0x554697['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review:\x20'+_0x3aca81);}return _0x554697[_0x566b6d(0x147)]();}export async function updateFeature(_0x18ae30,_0x247c16){const _0x1ed938=_0x5576,_0x58930e={'KlFYw':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','JOVVw':function(_0xa1377c){return _0xa1377c();},'gngcX':'PATCH','ZWkUi':'application/json'},_0x1ec1a3=await getToken();if(!_0x1ec1a3)throw new Error(_0x58930e[_0x1ed938(0x180)]);const _0x52cb6e=_0x58930e['JOVVw'](getApiBaseUrl),_0x5e4589=await fetch(_0x52cb6e+'/api/v1/mcp/features/'+_0x18ae30,{'method':_0x58930e[_0x1ed938(0x17c)],'headers':{'Authorization':_0x1ed938(0x143)+_0x1ec1a3,'Content-Type':_0x58930e[_0x1ed938(0x15f)]},'body':JSON[_0x1ed938(0x14f)](_0x247c16)});if(!_0x5e4589['ok']){const _0x283f96=await _0x5e4589[_0x1ed938(0x17f)]();throw new Error(_0x1ed938(0x159)+_0x283f96);}return _0x5e4589['json']();}export async function createChecklistItem(_0x192655,_0x2372bb,_0x4a6be8){const _0x50613c=_0x5576,_0x5e213c={'BRXSN':function(_0x3ff4ef){return _0x3ff4ef();},'lszjc':function(_0x3b2743,_0x396ea0,_0x241574){return _0x3b2743(_0x396ea0,_0x241574);},'ItFqE':'POST'},_0x1fac73=await _0x5e213c[_0x50613c(0x145)](getToken);if(!_0x1fac73)throw new Error(_0x50613c(0x162));const _0x5ba24c=_0x5e213c[_0x50613c(0x145)](getApiBaseUrl),_0x4ef79f=await _0x5e213c[_0x50613c(0x14a)](fetch,_0x5ba24c+'/api/v1/mcp/features/'+_0x192655+'/checklist',{'method':_0x5e213c[_0x50613c(0x153)],'headers':{'Authorization':_0x50613c(0x143)+_0x1fac73,'Content-Type':'application/json'},'body':JSON['stringify']({'description':_0x2372bb,'position':_0x4a6be8})});if(!_0x4ef79f['ok']){const _0x1e09be=await _0x4ef79f['text']();throw new Error('Failed\x20to\x20create\x20scenario:\x20'+_0x1e09be);}return _0x4ef79f['json']();}export async function updateChecklistItem(_0x3a92bf,_0x2e14c7,_0x11c021){const _0x5f4076=_0x5576,_0x241150={'yqBIr':'PATCH','EtmRw':_0x5f4076(0x157),'tGeZk':function(_0x3d8450,_0x5f23b1,_0x10d9db){return _0x3d8450(_0x5f23b1,_0x10d9db);}};return _0x241150[_0x5f4076(0x152)](withRetry,async()=>{const _0x27bc49=_0x5f4076,_0x1c0a1b=await getToken();if(!_0x1c0a1b)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x3cbc1c=getApiBaseUrl(),_0xe39ce8=await fetch(_0x3cbc1c+'/api/v1/mcp/features/'+_0x3a92bf+'/checklist/'+_0x2e14c7,{'method':_0x241150[_0x27bc49(0x156)],'headers':{'Authorization':'Bearer\x20'+_0x1c0a1b,'Content-Type':_0x241150[_0x27bc49(0x161)]},'body':JSON['stringify'](_0x11c021)});if(!_0xe39ce8['ok']){const _0x530396=await _0xe39ce8['text']();throw new Error(_0x27bc49(0x179)+_0x530396);}return _0xe39ce8['json']();},{'label':'updateChecklistItem'});}export async function getFeatureReport(_0x21d18c){const _0x493f85=_0x5576,_0x1d9e6d={'WmgDX':function(_0x4eab24){return _0x4eab24();},'IzBrO':function(_0x45c969){return _0x45c969();}},_0x5671c0=await _0x1d9e6d['WmgDX'](getToken);if(!_0x5671c0)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0xcce08f=_0x1d9e6d['IzBrO'](getApiBaseUrl),_0x22adb1=await fetch(_0xcce08f+'/api/v1/mcp/features/'+_0x21d18c+_0x493f85(0x183),{'method':_0x493f85(0x15b),'headers':{'Authorization':'Bearer\x20'+_0x5671c0}});if(!_0x22adb1['ok']){const _0x1b55a7=await _0x22adb1['text']();throw new Error(_0x493f85(0x169)+_0x1b55a7);}return _0x22adb1[_0x493f85(0x147)]();}export async function getFeatureReportMarkdown(_0x5ad797,_0x13832c){const _0xdd208d=_0x5576,_0x5cfcb1={'DrVBw':_0xdd208d(0x17e),'rwAtj':function(_0x3c751d,_0x279127){return _0x3c751d&&_0x279127;},'YDHga':'style'},_0x2fec25=await getToken();if(!_0x2fec25)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x43393d=getApiBaseUrl(),_0x585d9c=new URLSearchParams(),_0x538e46=(_0x13832c?.['itemIds']?.[_0xdd208d(0x172)]??0x0)>0x0,_0xb6823a=Boolean(_0x13832c?.['sessionId']);_0x538e46&&_0x13832c?.[_0xdd208d(0x14d)]&&_0x585d9c[_0xdd208d(0x163)](_0xdd208d(0x14d),_0x13832c['itemIds']['join'](','));_0xb6823a&&_0x13832c?.[_0xdd208d(0x17e)]&&_0x585d9c['set'](_0x5cfcb1['DrVBw'],_0x13832c[_0xdd208d(0x17e)]);_0x5cfcb1['rwAtj'](!_0x538e46,!_0xb6823a)&&_0x13832c?.[_0xdd208d(0x14c)]&&_0x585d9c['set'](_0x5cfcb1[_0xdd208d(0x168)],_0x13832c[_0xdd208d(0x14c)]);const _0x4e91b9=_0x43393d+_0xdd208d(0x17d)+_0x5ad797+_0xdd208d(0x170),_0x216172=''+_0x4e91b9+(_0x585d9c['toString']()?'?'+_0x585d9c['toString']():''),_0x43d334=await fetch(_0x216172,{'method':'GET','headers':{'Authorization':_0xdd208d(0x143)+_0x2fec25}});if(!_0x43d334['ok']){const _0x49ddfd=await _0x43d334[_0xdd208d(0x17f)]();throw new Error(_0xdd208d(0x142)+_0x49ddfd);}return _0x43d334['text']();}export async function listFeatureSessions(_0x2b178f){const _0x3a58d1=_0x5576,_0x55464d={'GkdoK':function(_0x20a296){return _0x20a296();},'Qulct':_0x3a58d1(0x162),'dbrIw':function(_0x189b80){return _0x189b80();}},_0x2c7b68=await _0x55464d['GkdoK'](getToken);if(!_0x2c7b68)throw new Error(_0x55464d[_0x3a58d1(0x17a)]);const _0x33f0ff=_0x55464d[_0x3a58d1(0x16c)](getApiBaseUrl),_0x33d85a=await fetch(_0x33f0ff+'/api/v1/mcp/features/'+_0x2b178f+'/sessions',{'method':_0x3a58d1(0x15b),'headers':{'Authorization':'Bearer\x20'+_0x2c7b68}});if(!_0x33d85a['ok']){const _0x410b7a=await _0x33d85a['text']();throw new Error(_0x3a58d1(0x150)+_0x410b7a);}return _0x33d85a['json']();}export async function startSession(_0x3a2a56,_0x2a614b){const _0x150b5a=_0x5576,_0x4ec3e7={'zbWjt':function(_0x1f007c){return _0x1f007c();},'WbIBH':'POST'},_0x4e4376=await _0x4ec3e7['zbWjt'](getToken);if(!_0x4e4376)throw new Error(_0x150b5a(0x162));const _0x48cf2d=_0x4ec3e7['zbWjt'](getApiBaseUrl),_0x55bad1=await fetch(_0x48cf2d+'/api/v1/mcp/features/'+_0x3a2a56+'/sessions/'+_0x2a614b+'/start',{'method':_0x4ec3e7[_0x150b5a(0x15d)],'headers':{'Authorization':'Bearer\x20'+_0x4e4376}});if(!_0x55bad1['ok']){const _0x42824f=await _0x55bad1[_0x150b5a(0x17f)]();throw new Error(_0x150b5a(0x173)+_0x42824f);}return _0x55bad1[_0x150b5a(0x147)]();}export async function concludeSession(_0x5c4fe4,_0x5a0da6){const _0x22099f=_0x5576,_0x52a913={'nEsFZ':_0x22099f(0x162)},_0x2f4967=await getToken();if(!_0x2f4967)throw new Error(_0x52a913[_0x22099f(0x13f)]);const _0x438188=getApiBaseUrl(),_0x2fd414=await fetch(_0x438188+'/api/v1/mcp/features/'+_0x5c4fe4+'/sessions/'+_0x5a0da6+'/conclude',{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x2f4967}});if(!_0x2fd414['ok']){const _0x511baa=await _0x2fd414['text']();throw new Error(_0x22099f(0x148)+_0x511baa);}return _0x2fd414[_0x22099f(0x147)]();}export async function getActionItems(_0x5c94ac){const _0x3c8d26=_0x5576,_0x11fd45={'tukZx':_0x3c8d26(0x162),'PmGgH':function(_0x17a350){return _0x17a350();},'rhwZD':function(_0xa0f69d,_0x12437e,_0x3ec246){return _0xa0f69d(_0x12437e,_0x3ec246);},'vLTuQ':'GET'},_0x3f3367=await getToken();if(!_0x3f3367)throw new Error(_0x11fd45[_0x3c8d26(0x16b)]);const _0x34c7c6=_0x11fd45[_0x3c8d26(0x158)](getApiBaseUrl),_0x307fb2=await _0x11fd45['rhwZD'](fetch,_0x34c7c6+_0x3c8d26(0x17d)+_0x5c94ac+'/action-items',{'method':_0x11fd45['vLTuQ'],'headers':{'Authorization':_0x3c8d26(0x143)+_0x3f3367}});if(!_0x307fb2['ok']){const _0x3484cf=await _0x307fb2[_0x3c8d26(0x17f)]();throw new Error('Failed\x20to\x20get\x20action\x20items:\x20'+_0x3484cf);}return _0x307fb2['json']();}export async function getItemFeedback(_0x51de4f,_0xc2d74f){const _0xba9ecb=_0x5576,_0x42181f={'uwusL':_0xba9ecb(0x15b)},_0x4d9faf=await getToken();if(!_0x4d9faf)throw new Error(_0xba9ecb(0x162));const _0x5b1c4e=getApiBaseUrl(),_0x5cc248=await fetch(_0x5b1c4e+'/api/v1/mcp/features/'+_0x51de4f+_0xba9ecb(0x175)+_0xc2d74f+_0xba9ecb(0x184),{'method':_0x42181f[_0xba9ecb(0x13e)],'headers':{'Authorization':'Bearer\x20'+_0x4d9faf}});if(!_0x5cc248['ok']){const _0x26a82a=await _0x5cc248['text']();throw new Error(_0xba9ecb(0x14b)+_0x26a82a);}return _0x5cc248['json']();}export async function markCommentsAddressed(_0x5f1ddd,_0x5a285b,_0x38a135){const _0x1806ef=_0x5576,_0xc76211={'yCYzV':function(_0x56b2e4,_0x5e347c,_0x1bd5e0){return _0x56b2e4(_0x5e347c,_0x1bd5e0);},'aqfkJ':'application/json'},_0x1cdb72=await getToken();if(!_0x1cdb72)throw new Error(_0x1806ef(0x162));const _0xe1b598=getApiBaseUrl(),_0x3924b3=await _0xc76211[_0x1806ef(0x178)](fetch,_0xe1b598+'/api/v1/mcp/features/'+_0x5f1ddd+'/comments/address',{'method':'POST','headers':{'Authorization':_0x1806ef(0x143)+_0x1cdb72,'Content-Type':_0xc76211[_0x1806ef(0x160)]},'body':JSON['stringify']({'checklistItemId':_0x5a285b,'commentIds':_0x38a135})});if(!_0x3924b3['ok']){const _0x2f8552=await _0x3924b3[_0x1806ef(0x17f)]();throw new Error('Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20'+_0x2f8552);}}export async function softDeleteFeature(_0x3a77b9){const _0x24d3c=_0x5576,_0x2c73f5={'QDTRw':function(_0x36f334,_0x1b561d,_0xa22d52){return _0x36f334(_0x1b561d,_0xa22d52);}},_0x52cda5=await getToken();if(!_0x52cda5)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x26f333=getApiBaseUrl(),_0x45a6a0=await _0x2c73f5[_0x24d3c(0x182)](fetch,_0x26f333+_0x24d3c(0x17d)+_0x3a77b9,{'method':'DELETE','headers':{'Authorization':_0x24d3c(0x143)+_0x52cda5}});if(!_0x45a6a0['ok']){const _0x175497=await _0x45a6a0[_0x24d3c(0x17f)]();throw new Error('Failed\x20to\x20delete\x20feature\x20review:\x20'+_0x175497);}}export async function restoreFeature(_0x483216){const _0x482502=_0x5576,_0x3ca541={'CGhYX':_0x482502(0x162),'DQCll':function(_0x31ee9e){return _0x31ee9e();},'IlnNh':_0x482502(0x15c)},_0x1d3d7d=await getToken();if(!_0x1d3d7d)throw new Error(_0x3ca541[_0x482502(0x16e)]);const _0xffe915=_0x3ca541[_0x482502(0x141)](getApiBaseUrl),_0x409f49=await fetch(_0xffe915+_0x482502(0x17d)+_0x483216+'/restore',{'method':_0x3ca541[_0x482502(0x14e)],'headers':{'Authorization':'Bearer\x20'+_0x1d3d7d}});if(!_0x409f49['ok']){const _0x365aa2=await _0x409f49[_0x482502(0x17f)]();throw new Error('Failed\x20to\x20restore\x20feature\x20review:\x20'+_0x365aa2);}}
|
|
1
|
+
(function(_0x101e30,_0x521fb7){const _0x5e1142=_0x90f3,_0x32a9f1=_0x101e30();while(!![]){try{const _0x4faa92=-parseInt(_0x5e1142(0x175))/0x1+-parseInt(_0x5e1142(0x137))/0x2*(-parseInt(_0x5e1142(0x15d))/0x3)+parseInt(_0x5e1142(0x143))/0x4*(-parseInt(_0x5e1142(0x16d))/0x5)+-parseInt(_0x5e1142(0x171))/0x6*(parseInt(_0x5e1142(0x166))/0x7)+parseInt(_0x5e1142(0x13a))/0x8*(parseInt(_0x5e1142(0x13c))/0x9)+parseInt(_0x5e1142(0x168))/0xa*(-parseInt(_0x5e1142(0x15a))/0xb)+parseInt(_0x5e1142(0x16b))/0xc;if(_0x4faa92===_0x521fb7)break;else _0x32a9f1['push'](_0x32a9f1['shift']());}catch(_0x22bd40){_0x32a9f1['push'](_0x32a9f1['shift']());}}}(_0x4c15,0xb1085));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x1953df){const _0x1947d0=_0x90f3,_0x4cbf73={'ivKpS':function(_0x66bb5b){return _0x66bb5b();},'GyMWz':_0x1947d0(0x140),'vvRJH':'application/json','wSUBp':function(_0x542f02,_0x316b5c){return _0x542f02===_0x316b5c;},'yJGRb':'https://dashboard.ranger.net/billing','sjzZH':'Feature\x20limit\x20exceeded'},_0x517dd5=await _0x4cbf73['ivKpS'](getToken);if(!_0x517dd5)throw new Error(_0x4cbf73[_0x1947d0(0x169)]);const _0x562725=getApiBaseUrl(),_0x580435=await fetch(_0x562725+'/api/v1/mcp/features',{'method':_0x1947d0(0x167),'headers':{'Authorization':_0x1947d0(0x146)+_0x517dd5,'Content-Type':_0x4cbf73['vvRJH']},'body':JSON['stringify'](_0x1953df)});if(!_0x580435['ok']){if(_0x4cbf73[_0x1947d0(0x132)](_0x580435[_0x1947d0(0x14c)],0x192)){const _0xdbcb08=await _0x580435['json'](),_0x323c82=_0xdbcb08['billingUrl']||_0x4cbf73[_0x1947d0(0x15e)];throw new Error((_0xdbcb08[_0x1947d0(0x158)]||_0x4cbf73[_0x1947d0(0x157)])+'\x0a\x0aUpgrade\x20your\x20plan:\x20'+_0x323c82);}const _0x31467b=await _0x580435['text']();throw new Error(_0x1947d0(0x144)+_0x31467b);}return _0x580435[_0x1947d0(0x141)]();}function _0x90f3(_0x2d9a3d,_0x7e0070){_0x2d9a3d=_0x2d9a3d-0x12a;const _0x4c1579=_0x4c15();let _0x90f39c=_0x4c1579[_0x2d9a3d];return _0x90f39c;}export async function listFeatures(_0x475e18){const _0x5905af=_0x90f3,_0x26d95f={'bWgKs':function(_0x1e9631){return _0x1e9631();},'RCRdQ':'gitRepoUrl','jAWtV':'gitBranch','uOuxh':'limit','hoyLw':'offset','IAgiU':_0x5905af(0x161)},_0x189747=await getToken();if(!_0x189747)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x174fbf=_0x26d95f['bWgKs'](getApiBaseUrl),_0x3294aa=new URLSearchParams();if(_0x475e18?.['gitRepoUrl'])_0x3294aa[_0x5905af(0x135)](_0x26d95f['RCRdQ'],_0x475e18[_0x5905af(0x131)]);if(_0x475e18?.[_0x5905af(0x12a)])_0x3294aa['set'](_0x26d95f['jAWtV'],_0x475e18['gitBranch']);if(_0x475e18?.['limit'])_0x3294aa[_0x5905af(0x135)](_0x26d95f[_0x5905af(0x13f)],_0x475e18[_0x5905af(0x16c)][_0x5905af(0x13b)]());if(_0x475e18?.['offset'])_0x3294aa[_0x5905af(0x135)](_0x26d95f[_0x5905af(0x165)],_0x475e18[_0x5905af(0x13e)][_0x5905af(0x13b)]());if(_0x475e18?.['includeDeleted'])_0x3294aa['set'](_0x26d95f['IAgiU'],_0x5905af(0x174));const _0x322486=_0x174fbf+'/api/v1/mcp/features'+(_0x3294aa[_0x5905af(0x13b)]()?'?'+_0x3294aa[_0x5905af(0x13b)]():''),_0x2f6100=await fetch(_0x322486,{'method':_0x5905af(0x176),'headers':{'Authorization':'Bearer\x20'+_0x189747}});if(!_0x2f6100['ok']){const _0x45bbf0=await _0x2f6100['text']();throw new Error('Failed\x20to\x20list\x20feature\x20reviews:\x20'+_0x45bbf0);}return _0x2f6100['json']();}export async function getFeature(_0x3da5fe){const _0x4b314d=_0x90f3,_0x108e96={'ZHRMP':function(_0x591069){return _0x591069();},'PGYsD':'GET'},_0x54c4be=await _0x108e96['ZHRMP'](getToken);if(!_0x54c4be)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x3e905a=_0x108e96[_0x4b314d(0x12f)](getApiBaseUrl),_0x569550=await fetch(_0x3e905a+'/api/v1/mcp/features/'+_0x3da5fe,{'method':_0x108e96[_0x4b314d(0x16f)],'headers':{'Authorization':_0x4b314d(0x146)+_0x54c4be}});if(!_0x569550['ok']){const _0x5e2892=await _0x569550['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review:\x20'+_0x5e2892);}return _0x569550[_0x4b314d(0x141)]();}export async function updateFeature(_0x3ff10b,_0x481382){const _0x2d286f=_0x90f3,_0x2eb664={'oiNAu':function(_0x470814){return _0x470814();},'zUwvZ':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','Mjgub':function(_0x4911c8){return _0x4911c8();},'AlUFV':_0x2d286f(0x14b),'krRBV':_0x2d286f(0x12c)},_0xb7559e=await _0x2eb664[_0x2d286f(0x170)](getToken);if(!_0xb7559e)throw new Error(_0x2eb664['zUwvZ']);const _0x272e89=_0x2eb664[_0x2d286f(0x14f)](getApiBaseUrl),_0x4f1b33=await fetch(_0x272e89+'/api/v1/mcp/features/'+_0x3ff10b,{'method':_0x2eb664[_0x2d286f(0x173)],'headers':{'Authorization':'Bearer\x20'+_0xb7559e,'Content-Type':_0x2eb664['krRBV']},'body':JSON['stringify'](_0x481382)});if(!_0x4f1b33['ok']){const _0x5c9cfe=await _0x4f1b33['text']();throw new Error('Failed\x20to\x20update\x20feature\x20review:\x20'+_0x5c9cfe);}return _0x4f1b33['json']();}export async function createChecklistItem(_0x3a4627,_0x25e1aa,_0x1dff4c){const _0x4e380d=_0x90f3,_0x4f1a98={'jqeXF':function(_0x45ef21){return _0x45ef21();},'TxfDl':_0x4e380d(0x140),'TAbpk':'POST'},_0x5b94e8=await _0x4f1a98[_0x4e380d(0x142)](getToken);if(!_0x5b94e8)throw new Error(_0x4f1a98[_0x4e380d(0x164)]);const _0x43b3e8=getApiBaseUrl(),_0x419938=await fetch(_0x43b3e8+'/api/v1/mcp/features/'+_0x3a4627+_0x4e380d(0x151),{'method':_0x4f1a98['TAbpk'],'headers':{'Authorization':'Bearer\x20'+_0x5b94e8,'Content-Type':_0x4e380d(0x12c)},'body':JSON[_0x4e380d(0x12b)]({'description':_0x25e1aa,'position':_0x1dff4c})});if(!_0x419938['ok']){const _0x23a265=await _0x419938[_0x4e380d(0x16a)]();throw new Error('Failed\x20to\x20create\x20scenario:\x20'+_0x23a265);}return _0x419938[_0x4e380d(0x141)]();}export async function updateChecklistItem(_0x2932cd,_0x8bed01,_0x3b34bf){const _0x3bf679={'GRIKa':function(_0x9bafa5,_0xab4421,_0x2eb5b5){return _0x9bafa5(_0xab4421,_0x2eb5b5);},'IfKtW':'application/json'};return withRetry(async()=>{const _0x57f7c4=_0x90f3,_0x3dda55=await getToken();if(!_0x3dda55)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x1ffec2=getApiBaseUrl(),_0x5b4b7e=await _0x3bf679['GRIKa'](fetch,_0x1ffec2+'/api/v1/mcp/features/'+_0x2932cd+_0x57f7c4(0x177)+_0x8bed01,{'method':_0x57f7c4(0x14b),'headers':{'Authorization':'Bearer\x20'+_0x3dda55,'Content-Type':_0x3bf679['IfKtW']},'body':JSON['stringify'](_0x3b34bf)});if(!_0x5b4b7e['ok']){const _0x54cac9=await _0x5b4b7e[_0x57f7c4(0x16a)]();throw new Error(_0x57f7c4(0x163)+_0x54cac9);}return _0x5b4b7e['json']();},{'label':'updateChecklistItem'});}export async function getFeatureReport(_0x56726d){const _0xe7d15d=_0x90f3,_0x5945a1={'WYIGP':function(_0x584b8c){return _0x584b8c();},'ZuYOS':function(_0x54b684,_0x14beb1,_0x4ddc74){return _0x54b684(_0x14beb1,_0x4ddc74);},'lPzAM':'GET'},_0x389314=await getToken();if(!_0x389314)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x68b4af=_0x5945a1[_0xe7d15d(0x172)](getApiBaseUrl),_0x27d566=await _0x5945a1['ZuYOS'](fetch,_0x68b4af+_0xe7d15d(0x145)+_0x56726d+_0xe7d15d(0x162),{'method':_0x5945a1['lPzAM'],'headers':{'Authorization':'Bearer\x20'+_0x389314}});if(!_0x27d566['ok']){const _0x57ce92=await _0x27d566['text']();throw new Error(_0xe7d15d(0x149)+_0x57ce92);}return _0x27d566['json']();}export async function getFeatureReportMarkdown(_0x2a0044,_0x2b8ef1){const _0x82dcd2=_0x90f3,_0x56f153={'lkzoY':function(_0x17451b){return _0x17451b();},'erhMp':function(_0x54067b,_0x54e4e8){return _0x54067b(_0x54e4e8);},'ZNlrd':'itemIds','GrHok':'sessionId','NUIdU':function(_0x14952e,_0x4864b3){return _0x14952e&&_0x4864b3;},'epWgV':function(_0x26ae07,_0x4bd559,_0x5e60d3){return _0x26ae07(_0x4bd559,_0x5e60d3);}},_0xee00a=await _0x56f153[_0x82dcd2(0x134)](getToken);if(!_0xee00a)throw new Error(_0x82dcd2(0x140));const _0x20b437=_0x56f153[_0x82dcd2(0x134)](getApiBaseUrl),_0x14d453=new URLSearchParams(),_0x40394d=(_0x2b8ef1?.['itemIds']?.['length']??0x0)>0x0,_0x431416=_0x56f153[_0x82dcd2(0x15b)](Boolean,_0x2b8ef1?.[_0x82dcd2(0x156)]);_0x40394d&&_0x2b8ef1?.['itemIds']&&_0x14d453[_0x82dcd2(0x135)](_0x56f153['ZNlrd'],_0x2b8ef1['itemIds']['join'](','));_0x431416&&_0x2b8ef1?.['sessionId']&&_0x14d453['set'](_0x56f153[_0x82dcd2(0x160)],_0x2b8ef1[_0x82dcd2(0x156)]);_0x56f153['NUIdU'](!_0x40394d,!_0x431416)&&_0x2b8ef1?.['style']&&_0x14d453['set'](_0x82dcd2(0x15f),_0x2b8ef1['style']);const _0x399bc5=_0x20b437+_0x82dcd2(0x145)+_0x2a0044+'/report/markdown',_0x24c04b=''+_0x399bc5+(_0x14d453[_0x82dcd2(0x13b)]()?'?'+_0x14d453['toString']():''),_0xdc575b=await _0x56f153[_0x82dcd2(0x159)](fetch,_0x24c04b,{'method':_0x82dcd2(0x176),'headers':{'Authorization':_0x82dcd2(0x146)+_0xee00a}});if(!_0xdc575b['ok']){const _0x2edc83=await _0xdc575b[_0x82dcd2(0x16a)]();throw new Error(_0x82dcd2(0x153)+_0x2edc83);}return _0xdc575b[_0x82dcd2(0x16a)]();}export async function listFeatureSessions(_0x6c3322){const _0x28500e=_0x90f3,_0x1792f9={'yJkDF':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','WmgrZ':function(_0x2088b4){return _0x2088b4();}},_0x92a24f=await getToken();if(!_0x92a24f)throw new Error(_0x1792f9[_0x28500e(0x13d)]);const _0x151128=_0x1792f9[_0x28500e(0x155)](getApiBaseUrl),_0x6744f3=await fetch(_0x151128+_0x28500e(0x145)+_0x6c3322+_0x28500e(0x154),{'method':'GET','headers':{'Authorization':_0x28500e(0x146)+_0x92a24f}});if(!_0x6744f3['ok']){const _0x3675fc=await _0x6744f3['text']();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x3675fc);}return _0x6744f3[_0x28500e(0x141)]();}export async function startSession(_0x4e65a1,_0x4ee205){const _0x5e0d66=_0x90f3,_0x38e05c={'VYeWL':function(_0x193fb8){return _0x193fb8();},'hqKQB':function(_0xf75759){return _0xf75759();},'nsplA':function(_0x54ef40,_0x5dc9f0,_0x5d8747){return _0x54ef40(_0x5dc9f0,_0x5d8747);},'nndJS':'POST'},_0x4ebe12=await _0x38e05c[_0x5e0d66(0x138)](getToken);if(!_0x4ebe12)throw new Error(_0x5e0d66(0x140));const _0x413447=_0x38e05c['hqKQB'](getApiBaseUrl),_0x3c61fc=await _0x38e05c['nsplA'](fetch,_0x413447+'/api/v1/mcp/features/'+_0x4e65a1+_0x5e0d66(0x12d)+_0x4ee205+'/start',{'method':_0x38e05c['nndJS'],'headers':{'Authorization':'Bearer\x20'+_0x4ebe12}});if(!_0x3c61fc['ok']){const _0x530cd4=await _0x3c61fc[_0x5e0d66(0x16a)]();throw new Error('Failed\x20to\x20start\x20session:\x20'+_0x530cd4);}return _0x3c61fc[_0x5e0d66(0x141)]();}export async function concludeSession(_0x20fa2b,_0x569bc5){const _0x3c5ba7=_0x90f3,_0x316dea={'rkIeY':'POST'},_0x1e7cea=await getToken();if(!_0x1e7cea)throw new Error(_0x3c5ba7(0x140));const _0x592f44=getApiBaseUrl(),_0x2009d9=await fetch(_0x592f44+'/api/v1/mcp/features/'+_0x20fa2b+'/sessions/'+_0x569bc5+'/conclude',{'method':_0x316dea['rkIeY'],'headers':{'Authorization':'Bearer\x20'+_0x1e7cea}});if(!_0x2009d9['ok']){const _0x5924c3=await _0x2009d9['text']();throw new Error('Failed\x20to\x20conclude\x20session:\x20'+_0x5924c3);}return _0x2009d9['json']();}export async function getActionItems(_0x23476){const _0x53ba5f=_0x90f3,_0x4f47b1={'TeRXU':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','hkgNF':function(_0xa17a42){return _0xa17a42();},'WheTM':function(_0x5595f7,_0x4d01b2,_0xf2f79a){return _0x5595f7(_0x4d01b2,_0xf2f79a);},'znvxy':'GET'},_0x2fa61b=await getToken();if(!_0x2fa61b)throw new Error(_0x4f47b1[_0x53ba5f(0x139)]);const _0xfc04cd=_0x4f47b1['hkgNF'](getApiBaseUrl),_0x2d3bb5=await _0x4f47b1[_0x53ba5f(0x12e)](fetch,_0xfc04cd+'/api/v1/mcp/features/'+_0x23476+_0x53ba5f(0x15c),{'method':_0x4f47b1[_0x53ba5f(0x152)],'headers':{'Authorization':_0x53ba5f(0x146)+_0x2fa61b}});if(!_0x2d3bb5['ok']){const _0x202706=await _0x2d3bb5[_0x53ba5f(0x16a)]();throw new Error('Failed\x20to\x20get\x20action\x20items:\x20'+_0x202706);}return _0x2d3bb5['json']();}function _0x4c15(){const _0x1202fb=['style','GrHok','includeDeleted','/report','Failed\x20to\x20update\x20scenario:\x20','TxfDl','hoyLw','1637321tZQTGJ','POST','70DFqOYK','GyMWz','text','26902320IiYoHW','limit','10JxPlKC','/feedback','PGYsD','oiNAu','24dUfIpG','WYIGP','AlUFV','true','159833jdbgDo','GET','/checklist/','gitBranch','stringify','application/json','/sessions/','WheTM','ZHRMP','oCaSw','gitRepoUrl','wSUBp','Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20','lkzoY','set','RxWjr','90aWOXju','VYeWL','TeRXU','8FjWjdz','toString','11820186LCddwl','yJkDF','offset','uOuxh','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','json','jqeXF','2443852CExnwE','Failed\x20to\x20create\x20feature\x20review:\x20','/api/v1/mcp/features/','Bearer\x20','Failed\x20to\x20delete\x20feature\x20review:\x20','cgxtz','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','/checklist-items/','PATCH','status','FPsXk','/restore','Mjgub','xAglA','/checklist','znvxy','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','/sessions','WmgrZ','sessionId','sjzZH','message','epWgV','893739joWwbp','erhMp','/action-items','3735EbwXLr','yJGRb'];_0x4c15=function(){return _0x1202fb;};return _0x4c15();}export async function getItemFeedback(_0x4b53fd,_0x15c928){const _0x5e4f98=_0x90f3,_0x419781={'HqpcG':function(_0x571cb8){return _0x571cb8();},'cgxtz':function(_0x482375){return _0x482375();},'FPsXk':_0x5e4f98(0x176)},_0x247393=await _0x419781['HqpcG'](getToken);if(!_0x247393)throw new Error(_0x5e4f98(0x140));const _0x1ed3f4=_0x419781[_0x5e4f98(0x148)](getApiBaseUrl),_0x476458=await fetch(_0x1ed3f4+_0x5e4f98(0x145)+_0x4b53fd+_0x5e4f98(0x14a)+_0x15c928+_0x5e4f98(0x16e),{'method':_0x419781[_0x5e4f98(0x14d)],'headers':{'Authorization':_0x5e4f98(0x146)+_0x247393}});if(!_0x476458['ok']){const _0xf6c91d=await _0x476458['text']();throw new Error('Failed\x20to\x20get\x20item\x20feedback:\x20'+_0xf6c91d);}return _0x476458['json']();}export async function markCommentsAddressed(_0x1b6352,_0x3cb390,_0x5a53d2){const _0x1203f1=_0x90f3,_0x9da954={'xAglA':_0x1203f1(0x140),'CYltl':function(_0x44e28e,_0xe3d88,_0x31370){return _0x44e28e(_0xe3d88,_0x31370);}},_0x4cbe95=await getToken();if(!_0x4cbe95)throw new Error(_0x9da954[_0x1203f1(0x150)]);const _0x2a193a=getApiBaseUrl(),_0x377256=await _0x9da954['CYltl'](fetch,_0x2a193a+'/api/v1/mcp/features/'+_0x1b6352+'/comments/address',{'method':_0x1203f1(0x167),'headers':{'Authorization':_0x1203f1(0x146)+_0x4cbe95,'Content-Type':_0x1203f1(0x12c)},'body':JSON[_0x1203f1(0x12b)]({'checklistItemId':_0x3cb390,'commentIds':_0x5a53d2})});if(!_0x377256['ok']){const _0x55dbbb=await _0x377256['text']();throw new Error(_0x1203f1(0x133)+_0x55dbbb);}}export async function softDeleteFeature(_0x269bd2){const _0x9dc4ed=_0x90f3,_0x58a169={'oCaSw':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','yhWpg':function(_0x1b7e90,_0x3cfe23,_0x5a69e3){return _0x1b7e90(_0x3cfe23,_0x5a69e3);}},_0x373b18=await getToken();if(!_0x373b18)throw new Error(_0x58a169[_0x9dc4ed(0x130)]);const _0x599dc0=getApiBaseUrl(),_0xcf878e=await _0x58a169['yhWpg'](fetch,_0x599dc0+_0x9dc4ed(0x145)+_0x269bd2,{'method':'DELETE','headers':{'Authorization':_0x9dc4ed(0x146)+_0x373b18}});if(!_0xcf878e['ok']){const _0x6941dc=await _0xcf878e[_0x9dc4ed(0x16a)]();throw new Error(_0x9dc4ed(0x147)+_0x6941dc);}}export async function restoreFeature(_0x198205){const _0x2a7f86=_0x90f3,_0x22c20b={'wfsKG':function(_0x35b8d4){return _0x35b8d4();},'RxWjr':function(_0x2f7869,_0x1a80a6,_0x232a3e){return _0x2f7869(_0x1a80a6,_0x232a3e);},'GIxfj':'POST'},_0x5dc673=await _0x22c20b['wfsKG'](getToken);if(!_0x5dc673)throw new Error(_0x2a7f86(0x140));const _0x4d97b0=getApiBaseUrl(),_0xe10210=await _0x22c20b[_0x2a7f86(0x136)](fetch,_0x4d97b0+'/api/v1/mcp/features/'+_0x198205+_0x2a7f86(0x14e),{'method':_0x22c20b['GIxfj'],'headers':{'Authorization':_0x2a7f86(0x146)+_0x5dc673}});if(!_0xe10210['ok']){const _0x5852f6=await _0xe10210[_0x2a7f86(0x16a)]();throw new Error('Failed\x20to\x20restore\x20feature\x20review:\x20'+_0x5852f6);}}
|