@sleep2agi/agent-network 2.3.0-preview.37 → 2.3.0-preview.38

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.
@@ -1 +1 @@
1
- function a0_0x6de1(_0x4e3e59,_0x1b9c4f){_0x4e3e59=_0x4e3e59-0xea;const _0x40fe82=a0_0x40fe();let _0x6de1e1=_0x40fe82[_0x4e3e59];return _0x6de1e1;}const a0_0x230d08=a0_0x6de1;function a0_0x40fe(){const _0x14968a=['url','slice','parse','new_task','sseAbort','text/event-stream','report_status','replace','emit','type','4091458iZWsQm','toTimeString','144765bkuQHm','/events/','catch','heartbeatInterval','getAllStatus','24726GPhIpb','token','connectSSE','520RwIKTP','running','10BPzsZx','signal','reconnectDelay','15568289UrBTPk','SSE\x20failed:\x20','new_message','disconnect','startsWith','text','5490CuQXkh','error','decode','Bearer\x20','get_inbox','s...','695eQhJwC','stringify','content','log','connected',']\x20[commhub:','now','task','sdk','normal','processInbox','sdk-','cwd','Authorization','min','agent','heartbeat\x20failed:\x20','message','get_all_status','status','pop','inbox\x20error:\x20','autoConnect','2.0','application/json,\x20text/event-stream','SSE\x20connected','connect','514lHxAnX','send_message','resumeId','call','disconnected','3430986Elwrzi','5313740UULazF','/mcp','send','getReader','reply','tools/call','alias','body','messages','ack_inbox','name','data:\x20','heartbeatTimer','read','broadcast','server','sleep','send_reply'];a0_0x40fe=function(){return _0x14968a;};return a0_0x40fe();}(function(_0x6bcbe2,_0x394dd0){const _0x28270e=a0_0x6de1,_0x11eb5c=_0x6bcbe2();while(!![]){try{const _0x3862fd=parseInt(_0x28270e(0x131))/0x1*(-parseInt(_0x28270e(0xfa))/0x2)+parseInt(_0x28270e(0xff))/0x3+-parseInt(_0x28270e(0x100))/0x4+parseInt(_0x28270e(0x137))/0x5*(-parseInt(_0x28270e(0x123))/0x6)+parseInt(_0x28270e(0x11c))/0x7+-parseInt(_0x28270e(0x126))/0x8*(-parseInt(_0x28270e(0x11e))/0x9)+parseInt(_0x28270e(0x128))/0xa*(parseInt(_0x28270e(0x12b))/0xb);if(_0x3862fd===_0x394dd0)break;else _0x11eb5c['push'](_0x11eb5c['shift']());}catch(_0x2fac3a){_0x11eb5c['push'](_0x11eb5c['shift']());}}}(a0_0x40fe,0xd60fc));import{EventEmitter as a0_0x5ce8b4}from'events';import{hostname as a0_0x37fdd8}from'os';class T extends a0_0x5ce8b4{[a0_0x230d08(0x112)];[a0_0x230d08(0x106)];[a0_0x230d08(0x124)];[a0_0x230d08(0xee)];['resumeId'];[a0_0x230d08(0x121)];[a0_0x230d08(0x12a)];[a0_0x230d08(0x10c)];['sseAbort'];[a0_0x230d08(0x127)]=!0x1;constructor(_0x5bc09d){const _0x5c0a7b=a0_0x230d08;super();if(this[_0x5c0a7b(0x112)]=_0x5bc09d[_0x5c0a7b(0x112)][_0x5c0a7b(0x119)](/\/$/,''),this[_0x5c0a7b(0x106)]=_0x5bc09d[_0x5c0a7b(0x106)],this[_0x5c0a7b(0x124)]=_0x5bc09d['token'],this[_0x5c0a7b(0xee)]=_0x5bc09d['agent']||_0x5c0a7b(0x13f),this[_0x5c0a7b(0xfc)]=_0x5c0a7b(0xea)+_0x5bc09d[_0x5c0a7b(0x106)]+'-'+Date[_0x5c0a7b(0x13d)]()['toString'](0x24),this[_0x5c0a7b(0x121)]=_0x5bc09d[_0x5c0a7b(0x121)]??0x2bf20,this[_0x5c0a7b(0x12a)]=_0x5bc09d[_0x5c0a7b(0x12a)]??0xbb8,_0x5bc09d[_0x5c0a7b(0xf5)]!==!0x1)this[_0x5c0a7b(0xf9)]();}[a0_0x230d08(0x13a)](_0x1f9b0e){const _0x275549=a0_0x230d08;console[_0x275549(0x13a)]('['+new Date()[_0x275549(0x11d)]()[_0x275549(0x113)](0x0,0x8)+_0x275549(0x13c)+this['alias']+']\x20'+_0x1f9b0e);}async['call'](_0x29f9c4,_0x201e70){const _0x411ac6=a0_0x230d08;let _0x220afa={'Content-Type':'application/json','Accept':_0x411ac6(0xf7)};if(this['token'])_0x220afa[_0x411ac6(0xec)]='Bearer\x20'+this['token'];let _0x4b27f6=await(await fetch(this[_0x411ac6(0x112)]+_0x411ac6(0x101),{'method':'POST','headers':_0x220afa,'body':JSON[_0x411ac6(0x138)]({'jsonrpc':_0x411ac6(0xf6),'id':Date[_0x411ac6(0x13d)](),'method':_0x411ac6(0x105),'params':{'name':_0x29f9c4,'arguments':_0x201e70}})}))[_0x411ac6(0x130)](),_0x5acd89=_0x4b27f6['match'](/data: (.+)/),_0x372246=_0x5acd89?JSON[_0x411ac6(0x114)](_0x5acd89[0x1]):JSON[_0x411ac6(0x114)](_0x4b27f6),_0x92053b=_0x372246?.['result']?.[_0x411ac6(0x139)]?.[0x0]?.['text'];return _0x92053b?JSON[_0x411ac6(0x114)](_0x92053b):_0x372246;}async[a0_0x230d08(0xf9)](){const _0x2ebdc6=a0_0x230d08;if(this[_0x2ebdc6(0x127)])return;this[_0x2ebdc6(0x127)]=!0x0,await this['status']('idle'),this[_0x2ebdc6(0x13a)]('registered'),this['heartbeatTimer']=setInterval(()=>{const _0x2f5259=_0x2ebdc6;this[_0x2f5259(0xf2)]('idle')[_0x2f5259(0x120)](_0x57cd61=>this[_0x2f5259(0x13a)](_0x2f5259(0xef)+_0x57cd61[_0x2f5259(0xf0)]));},this['heartbeatInterval']),this[_0x2ebdc6(0x125)]();}async[a0_0x230d08(0x12e)](){const _0x183f5f=a0_0x230d08;if(this[_0x183f5f(0x127)]=!0x1,this[_0x183f5f(0x116)]?.['abort'](),this[_0x183f5f(0x10c)])clearInterval(this['heartbeatTimer']);await this['status']('offline')[_0x183f5f(0x120)](()=>{}),this['log'](_0x183f5f(0xfe));}async[a0_0x230d08(0x102)](_0x3a7d95,_0x47a952,_0x36398e=a0_0x230d08(0x140)){const _0x2a160d=a0_0x230d08;return this[_0x2a160d(0xfd)]('send_task',{'alias':_0x3a7d95,'task':_0x47a952,'priority':_0x36398e,'from_session':this[_0x2a160d(0x106)]});}async[a0_0x230d08(0xf0)](_0x484042,_0xf535cf){const _0x24802d=a0_0x230d08;return this[_0x24802d(0xfd)](_0x24802d(0xfb),{'alias':_0x484042,'message':_0xf535cf,'from_session':this[_0x24802d(0x106)]});}async[a0_0x230d08(0x104)](_0x394ec4,_0x1abafa,_0x1408f2='completed'){const _0x144317=a0_0x230d08;return this[_0x144317(0xfd)](_0x144317(0x111),{'in_reply_to':_0x394ec4,'text':_0x1abafa,'status':_0x1408f2});}async[a0_0x230d08(0xf2)](_0x56e212,_0x2c4ef9){const _0x226ed9=a0_0x230d08;return this['call'](_0x226ed9(0x118),{'resume_id':this['resumeId'],'alias':this[_0x226ed9(0x106)],'status':_0x56e212,'server':a0_0x37fdd8(),'hostname':a0_0x37fdd8(),'agent':this[_0x226ed9(0xee)],'project_dir':process[_0x226ed9(0xeb)](),..._0x2c4ef9});}async[a0_0x230d08(0x122)](){const _0x4103bf=a0_0x230d08;return this[_0x4103bf(0xfd)](_0x4103bf(0xf1),{});}async[a0_0x230d08(0x10e)](_0x94aed9,_0x54955a){const _0x343276=a0_0x230d08;return this[_0x343276(0xfd)](_0x343276(0x10e),{'message':_0x94aed9,'filter_server':_0x54955a?.[_0x343276(0x10f)],'filter_status':_0x54955a?.['status']});}async[a0_0x230d08(0x125)](){const _0x3a741a=a0_0x230d08;let _0x38bfda=encodeURIComponent(this[_0x3a741a(0x106)]),_0x62700f=this[_0x3a741a(0x112)]+_0x3a741a(0x11f)+_0x38bfda,_0x18d07f=this[_0x3a741a(0x12a)];while(this[_0x3a741a(0x127)]){try{this['sseAbort']=new AbortController();let _0x386080={'Accept':_0x3a741a(0x117)};if(this['token'])_0x386080[_0x3a741a(0xec)]=_0x3a741a(0x134)+this['token'];let _0x25c195=await fetch(_0x62700f,{'headers':_0x386080,'signal':this[_0x3a741a(0x116)][_0x3a741a(0x129)]});if(!_0x25c195['ok']||!_0x25c195[_0x3a741a(0x107)]){this[_0x3a741a(0x13a)](_0x3a741a(0x12c)+_0x25c195[_0x3a741a(0xf2)]),await this['sleep'](_0x18d07f),_0x18d07f=Math[_0x3a741a(0xed)](_0x18d07f*1.5,0xea60);continue;}_0x18d07f=this['reconnectDelay'];let _0x223947=_0x25c195[_0x3a741a(0x107)][_0x3a741a(0x103)](),_0x47e6d3=new TextDecoder(),_0x291c17='';while(this[_0x3a741a(0x127)]){let {done:_0x7a321d,value:_0x5719eb}=await _0x223947[_0x3a741a(0x10d)]();if(_0x7a321d)break;_0x291c17+=_0x47e6d3[_0x3a741a(0x133)](_0x5719eb,{'stream':!0x0});let _0x544ff5=_0x291c17['split']('\x0a');_0x291c17=_0x544ff5[_0x3a741a(0xf3)]()||'';for(let _0xa90ef6 of _0x544ff5){if(!_0xa90ef6[_0x3a741a(0x12f)](_0x3a741a(0x10b)))continue;try{let _0x4003a3=JSON[_0x3a741a(0x114)](_0xa90ef6[_0x3a741a(0x113)](0x6));if(_0x4003a3[_0x3a741a(0x11b)]===_0x3a741a(0x13b)){this[_0x3a741a(0x13a)](_0x3a741a(0xf8)),this[_0x3a741a(0x11a)](_0x3a741a(0x13b));continue;}if(_0x4003a3['type']===_0x3a741a(0x115)||_0x4003a3['type']===_0x3a741a(0x12d)||_0x4003a3[_0x3a741a(0x11b)]===_0x3a741a(0x10e))await this[_0x3a741a(0x141)]();}catch{}}}}catch(_0x56ecd7){if(_0x56ecd7[_0x3a741a(0x10a)]==='AbortError')break;this[_0x3a741a(0x11a)](_0x3a741a(0x132),_0x56ecd7),this[_0x3a741a(0x13a)]('SSE\x20error:\x20'+_0x56ecd7['message']);}if(this[_0x3a741a(0x127)])this[_0x3a741a(0x11a)](_0x3a741a(0xfe)),this[_0x3a741a(0x13a)]('SSE\x20reconnecting\x20in\x20'+_0x18d07f/0x3e8+_0x3a741a(0x136)),await this['sleep'](_0x18d07f),_0x18d07f=Math[_0x3a741a(0xed)](_0x18d07f*1.5,0xea60);}}async[a0_0x230d08(0x141)](){const _0x549c3d=a0_0x230d08;try{let _0x4348a1=(await this[_0x549c3d(0xfd)](_0x549c3d(0x135),{'alias':this[_0x549c3d(0x106)],'limit':0xa}))?.[_0x549c3d(0x108)]||[];for(let _0x212c2b of _0x4348a1)await this[_0x549c3d(0xfd)](_0x549c3d(0x109),{'alias':this[_0x549c3d(0x106)],'message_id':_0x212c2b['id']}),this[_0x549c3d(0x13a)]('←\x20'+_0x212c2b['from_session']+':\x20'+_0x212c2b[_0x549c3d(0x139)][_0x549c3d(0x113)](0x0,0x3c)),this['emit'](_0x549c3d(0x13e),_0x212c2b),this[_0x549c3d(0x11a)](_0x549c3d(0xf0),_0x212c2b);}catch(_0x39cfba){this[_0x549c3d(0x13a)](_0x549c3d(0xf4)+_0x39cfba['message']);}}[a0_0x230d08(0x110)](_0x3aad9b){return new Promise(_0x44066d=>setTimeout(_0x44066d,_0x3aad9b));}}var $=T;export{$ as default,T as CommHub};
1
+ function a0_0x3f2d(_0x5166b3,_0x2933d7){_0x5166b3=_0x5166b3-0x73;const _0x2ee473=a0_0x2ee4();let _0x3f2d0e=_0x2ee473[_0x5166b3];return _0x3f2d0e;}const a0_0x45e18f=a0_0x3f2d;(function(_0xa38e8b,_0x25c71c){const _0x2fa4f2=a0_0x3f2d,_0x982051=_0xa38e8b();while(!![]){try{const _0x2bf2ab=parseInt(_0x2fa4f2(0xc7))/0x1+parseInt(_0x2fa4f2(0x77))/0x2+-parseInt(_0x2fa4f2(0xc4))/0x3*(-parseInt(_0x2fa4f2(0x8c))/0x4)+parseInt(_0x2fa4f2(0x9a))/0x5+-parseInt(_0x2fa4f2(0x73))/0x6+-parseInt(_0x2fa4f2(0x98))/0x7+parseInt(_0x2fa4f2(0xb5))/0x8*(-parseInt(_0x2fa4f2(0x80))/0x9);if(_0x2bf2ab===_0x25c71c)break;else _0x982051['push'](_0x982051['shift']());}catch(_0xf5a547){_0x982051['push'](_0x982051['shift']());}}}(a0_0x2ee4,0xb3a8a));import{EventEmitter as a0_0x25f304}from'events';import{hostname as a0_0x5428de}from'os';function a0_0x2ee4(){const _0x5cfce2=['send_reply','ack_inbox','name','parse','alias','/mcp','stringify','connectSSE','/events/','signal','status','application/json','Authorization','offline','text/event-stream','getReader','get_inbox','toTimeString','32248EeVffP','disconnect','call','cwd','reconnectDelay','running','decode','tools/call','url','catch','from_session','startsWith','slice','sseAbort','body','3RdHreq','heartbeatInterval','server','1267704zXbDzd','connect','connected','get_all_status','error','5161206ZaiPGG','resumeId','processInbox','SSE\x20error:\x20','1988066RIoYNf','text','type','content','reply','idle','agent','send_message','heartbeatTimer','1683BJSkHI','log','split','disconnected','message','Bearer\x20','sdk-','replace','application/json,\x20text/event-stream','sleep','broadcast','read','2003152zDZChC','result','report_status','toString','inbox\x20error:\x20',']\x20[commhub:','getAllStatus','POST','registered','token','min','new_message','9566235KUkLZE','AbortError','4769800ufTvDv','task','new_task','data:\x20','2.0','heartbeat\x20failed:\x20','emit','completed','abort'];a0_0x2ee4=function(){return _0x5cfce2;};return a0_0x2ee4();}class T extends a0_0x25f304{[a0_0x45e18f(0xbd)];[a0_0x45e18f(0xa7)];[a0_0x45e18f(0x95)];['agent'];[a0_0x45e18f(0x74)];[a0_0x45e18f(0xc5)];['reconnectDelay'];['heartbeatTimer'];['sseAbort'];[a0_0x45e18f(0xba)]=!0x1;constructor(_0x533731){const _0x670586=a0_0x45e18f;super();if(this[_0x670586(0xbd)]=_0x533731[_0x670586(0xbd)][_0x670586(0x87)](/\/$/,''),this['alias']=_0x533731[_0x670586(0xa7)],this['token']=_0x533731[_0x670586(0x95)],this[_0x670586(0x7d)]=_0x533731[_0x670586(0x7d)]||'sdk',this[_0x670586(0x74)]=_0x670586(0x86)+_0x533731[_0x670586(0xa7)]+'-'+Date['now']()[_0x670586(0x8f)](0x24),this[_0x670586(0xc5)]=_0x533731[_0x670586(0xc5)]??0x2bf20,this[_0x670586(0xb9)]=_0x533731['reconnectDelay']??0xbb8,_0x533731['autoConnect']!==!0x1)this[_0x670586(0xc8)]();}[a0_0x45e18f(0x81)](_0x9b4630){const _0x5ef196=a0_0x45e18f;console[_0x5ef196(0x81)]('['+new Date()[_0x5ef196(0xb4)]()[_0x5ef196(0xc1)](0x0,0x8)+_0x5ef196(0x91)+this[_0x5ef196(0xa7)]+']\x20'+_0x9b4630);}async[a0_0x45e18f(0xb7)](_0x38dbd2,_0xc314ba){const _0x57b565=a0_0x45e18f;let _0x3371cd={'Content-Type':_0x57b565(0xae),'Accept':_0x57b565(0x88)};if(this['token'])_0x3371cd['Authorization']=_0x57b565(0x85)+this[_0x57b565(0x95)];let _0x446bd9=await(await fetch(this[_0x57b565(0xbd)]+_0x57b565(0xa8),{'method':_0x57b565(0x93),'headers':_0x3371cd,'body':JSON[_0x57b565(0xa9)]({'jsonrpc':_0x57b565(0x9e),'id':Date['now'](),'method':_0x57b565(0xbc),'params':{'name':_0x38dbd2,'arguments':_0xc314ba}})}))[_0x57b565(0x78)](),_0x318be0=_0x446bd9['match'](/data: (.+)/),_0x5b1d5b=_0x318be0?JSON[_0x57b565(0xa6)](_0x318be0[0x1]):JSON[_0x57b565(0xa6)](_0x446bd9),_0x216bde=_0x5b1d5b?.[_0x57b565(0x8d)]?.['content']?.[0x0]?.['text'];return _0x216bde?JSON['parse'](_0x216bde):_0x5b1d5b;}async[a0_0x45e18f(0xc8)](){const _0x1aac34=a0_0x45e18f;if(this[_0x1aac34(0xba)])return;this[_0x1aac34(0xba)]=!0x0,await this[_0x1aac34(0xad)](_0x1aac34(0x7c)),this[_0x1aac34(0x81)](_0x1aac34(0x94)),this[_0x1aac34(0x7f)]=setInterval(()=>{const _0x1041ce=_0x1aac34;this[_0x1041ce(0xad)](_0x1041ce(0x7c))[_0x1041ce(0xbe)](_0x13e6e5=>this[_0x1041ce(0x81)](_0x1041ce(0x9f)+_0x13e6e5[_0x1041ce(0x84)]));},this[_0x1aac34(0xc5)]),this[_0x1aac34(0xaa)]();}async[a0_0x45e18f(0xb6)](){const _0x1716d8=a0_0x45e18f;if(this[_0x1716d8(0xba)]=!0x1,this[_0x1716d8(0xc2)]?.[_0x1716d8(0xa2)](),this[_0x1716d8(0x7f)])clearInterval(this[_0x1716d8(0x7f)]);await this['status'](_0x1716d8(0xb0))[_0x1716d8(0xbe)](()=>{}),this[_0x1716d8(0x81)](_0x1716d8(0x83));}async['send'](_0x323fc5,_0x16746f,_0x3501fc='normal'){const _0x4686dd=a0_0x45e18f;return this['call']('send_task',{'alias':_0x323fc5,'task':_0x16746f,'priority':_0x3501fc,'from_session':this[_0x4686dd(0xa7)]});}async['message'](_0x17f294,_0x32628d){const _0x3ef443=a0_0x45e18f;return this[_0x3ef443(0xb7)](_0x3ef443(0x7e),{'alias':_0x17f294,'message':_0x32628d,'from_session':this['alias']});}async[a0_0x45e18f(0x7b)](_0x512627,_0x1f52e6,_0x48e7b5=a0_0x45e18f(0xa1)){const _0x50ba14=a0_0x45e18f;return this[_0x50ba14(0xb7)](_0x50ba14(0xa3),{'in_reply_to':_0x512627,'text':_0x1f52e6,'status':_0x48e7b5});}async[a0_0x45e18f(0xad)](_0x45b20f,_0x3d03af){const _0x22bc7a=a0_0x45e18f;return this['call'](_0x22bc7a(0x8e),{'resume_id':this[_0x22bc7a(0x74)],'alias':this[_0x22bc7a(0xa7)],'status':_0x45b20f,'server':a0_0x5428de(),'hostname':a0_0x5428de(),'agent':this[_0x22bc7a(0x7d)],'project_dir':process[_0x22bc7a(0xb8)](),..._0x3d03af});}async[a0_0x45e18f(0x92)](){const _0x7683c3=a0_0x45e18f;return this[_0x7683c3(0xb7)](_0x7683c3(0xca),{});}async[a0_0x45e18f(0x8a)](_0x54043e,_0xcb885a){const _0x282a50=a0_0x45e18f;return this[_0x282a50(0xb7)](_0x282a50(0x8a),{'message':_0x54043e,'filter_server':_0xcb885a?.[_0x282a50(0xc6)],'filter_status':_0xcb885a?.[_0x282a50(0xad)]});}async[a0_0x45e18f(0xaa)](){const _0x5dc4e9=a0_0x45e18f;let _0x25f14d=encodeURIComponent(this[_0x5dc4e9(0xa7)]),_0x5b9e0c=this[_0x5dc4e9(0xbd)]+_0x5dc4e9(0xab)+_0x25f14d,_0x1e07e3=this['reconnectDelay'];while(this[_0x5dc4e9(0xba)]){try{this[_0x5dc4e9(0xc2)]=new AbortController();let _0xd0c9ba={'Accept':_0x5dc4e9(0xb1)};if(this[_0x5dc4e9(0x95)])_0xd0c9ba[_0x5dc4e9(0xaf)]=_0x5dc4e9(0x85)+this[_0x5dc4e9(0x95)];let _0x1cceba=await fetch(_0x5b9e0c,{'headers':_0xd0c9ba,'signal':this[_0x5dc4e9(0xc2)][_0x5dc4e9(0xac)]});if(!_0x1cceba['ok']||!_0x1cceba[_0x5dc4e9(0xc3)]){this['log']('SSE\x20failed:\x20'+_0x1cceba[_0x5dc4e9(0xad)]),await this[_0x5dc4e9(0x89)](_0x1e07e3),_0x1e07e3=Math[_0x5dc4e9(0x96)](_0x1e07e3*1.5,0xea60);continue;}_0x1e07e3=this[_0x5dc4e9(0xb9)];let _0x221e15=_0x1cceba[_0x5dc4e9(0xc3)][_0x5dc4e9(0xb2)](),_0x24ddc1=new TextDecoder(),_0x1f34e2='';while(this['running']){let {done:_0xcba5b6,value:_0x4d50b0}=await _0x221e15[_0x5dc4e9(0x8b)]();if(_0xcba5b6)break;_0x1f34e2+=_0x24ddc1[_0x5dc4e9(0xbb)](_0x4d50b0,{'stream':!0x0});let _0x42c5ee=_0x1f34e2[_0x5dc4e9(0x82)]('\x0a');_0x1f34e2=_0x42c5ee['pop']()||'';for(let _0x230cb5 of _0x42c5ee){if(!_0x230cb5[_0x5dc4e9(0xc0)](_0x5dc4e9(0x9d)))continue;try{let _0x224f8a=JSON[_0x5dc4e9(0xa6)](_0x230cb5[_0x5dc4e9(0xc1)](0x6));if(_0x224f8a['type']===_0x5dc4e9(0xc9)){this[_0x5dc4e9(0x81)]('SSE\x20connected'),this[_0x5dc4e9(0xa0)](_0x5dc4e9(0xc9));continue;}if(_0x224f8a['type']===_0x5dc4e9(0x9c)||_0x224f8a[_0x5dc4e9(0x79)]===_0x5dc4e9(0x97)||_0x224f8a['type']==='broadcast')await this['processInbox']();}catch{}}}}catch(_0x55617a){if(_0x55617a[_0x5dc4e9(0xa5)]===_0x5dc4e9(0x99))break;this[_0x5dc4e9(0xa0)](_0x5dc4e9(0xcb),_0x55617a),this[_0x5dc4e9(0x81)](_0x5dc4e9(0x76)+_0x55617a[_0x5dc4e9(0x84)]);}if(this['running'])this['emit'](_0x5dc4e9(0x83)),this[_0x5dc4e9(0x81)]('SSE\x20reconnecting\x20in\x20'+_0x1e07e3/0x3e8+'s...'),await this[_0x5dc4e9(0x89)](_0x1e07e3),_0x1e07e3=Math['min'](_0x1e07e3*1.5,0xea60);}}async[a0_0x45e18f(0x75)](){const _0x519082=a0_0x45e18f;try{let _0xc47e99=(await this[_0x519082(0xb7)](_0x519082(0xb3),{'alias':this[_0x519082(0xa7)],'limit':0xa}))?.['messages']||[];for(let _0x1c52ee of _0xc47e99)await this['call'](_0x519082(0xa4),{'alias':this['alias'],'message_id':_0x1c52ee['id']}),this[_0x519082(0x81)]('←\x20'+_0x1c52ee[_0x519082(0xbf)]+':\x20'+_0x1c52ee[_0x519082(0x7a)]['slice'](0x0,0x3c)),this['emit'](_0x519082(0x9b),_0x1c52ee),this[_0x519082(0xa0)](_0x519082(0x84),_0x1c52ee);}catch(_0xd9e87b){this[_0x519082(0x81)](_0x519082(0x90)+_0xd9e87b[_0x519082(0x84)]);}}[a0_0x45e18f(0x89)](_0x3d8c4d){return new Promise(_0x1ccd5d=>setTimeout(_0x1ccd5d,_0x3d8c4d));}}var $=T;export{$ as default,T as CommHub};