@sleep2agi/agent-network 2.3.0-preview.36 → 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_0x855f(_0x39248a,_0x4f8b92){_0x39248a=_0x39248a-0x17e;const _0x1fdedc=a0_0x1fde();let _0x855f3a=_0x1fdedc[_0x39248a];return _0x855f3a;}const a0_0x4d231b=a0_0x855f;function a0_0x1fde(){const _0x6156d4=['1284230tDpjGQ','send','4054gZjmun','new_message','token','12sHOfGT','replace','application/json,\x20text/event-stream','name','content','510fdmlNL','completed','signal','startsWith','send_task','sdk-','url','decode','connected','alias','cwd','idle','SSE\x20failed:\x20','SSE\x20error:\x20','reconnectDelay','tools/call','report_status','203291GZjLqV','1420065tZtERR','body','POST','s...','292812gmjImy','sseAbort','emit','connect',']\x20[commhub:','Bearer\x20','180AKOQIx','Authorization','parse','normal','error','327072wpmrft','reply','sleep','status','text','toString','text/event-stream','heartbeatTimer','min','ack_inbox','/events/','387qyGICo','autoConnect','log','message','read','send_message','disconnect','pop','broadcast','agent','catch','abort','running','18GuMYSJ','type','connectSSE','getReader','data:\x20','server','get_inbox','registered','offline','slice','new_task','455xtKROn','call','disconnected','heartbeatInterval','split','messages','sdk','task','match','resumeId','processInbox','1860873HDbrtt','/mcp'];a0_0x1fde=function(){return _0x6156d4;};return a0_0x1fde();}(function(_0x69f157,_0x34d6a8){const _0x16a939=a0_0x855f,_0x43f872=_0x69f157();while(!![]){try{const _0x163c93=parseInt(_0x16a939(0x18e))/0x1*(parseInt(_0x16a939(0x1b5))/0x2)+parseInt(_0x16a939(0x1cf))/0x3+parseInt(_0x16a939(0x1b8))/0x4*(parseInt(_0x16a939(0x1b3))/0x5)+-parseInt(_0x16a939(0x19b))/0x6*(parseInt(_0x16a939(0x1b1))/0x7)+parseInt(_0x16a939(0x183))/0x8*(-parseInt(_0x16a939(0x17e))/0x9)+parseInt(_0x16a939(0x1bd))/0xa*(parseInt(_0x16a939(0x1ce))/0xb)+-parseInt(_0x16a939(0x1d3))/0xc*(parseInt(_0x16a939(0x1a6))/0xd);if(_0x163c93===_0x34d6a8)break;else _0x43f872['push'](_0x43f872['shift']());}catch(_0xff4c24){_0x43f872['push'](_0x43f872['shift']());}}}(a0_0x1fde,0x7a789));import{EventEmitter as a0_0x124210}from'events';import{hostname as a0_0x4fa072}from'os';class T extends a0_0x124210{[a0_0x4d231b(0x1c3)];[a0_0x4d231b(0x1c6)];[a0_0x4d231b(0x1b7)];[a0_0x4d231b(0x197)];[a0_0x4d231b(0x1af)];[a0_0x4d231b(0x1a9)];[a0_0x4d231b(0x1cb)];[a0_0x4d231b(0x18a)];[a0_0x4d231b(0x1d4)];[a0_0x4d231b(0x19a)]=!0x1;constructor(_0x378de7){const _0x3e0180=a0_0x4d231b;super();if(this[_0x3e0180(0x1c3)]=_0x378de7[_0x3e0180(0x1c3)][_0x3e0180(0x1b9)](/\/$/,''),this[_0x3e0180(0x1c6)]=_0x378de7[_0x3e0180(0x1c6)],this[_0x3e0180(0x1b7)]=_0x378de7[_0x3e0180(0x1b7)],this['agent']=_0x378de7[_0x3e0180(0x197)]||_0x3e0180(0x1ac),this[_0x3e0180(0x1af)]=_0x3e0180(0x1c2)+_0x378de7[_0x3e0180(0x1c6)]+'-'+Date['now']()[_0x3e0180(0x188)](0x24),this[_0x3e0180(0x1a9)]=_0x378de7[_0x3e0180(0x1a9)]??0x2bf20,this[_0x3e0180(0x1cb)]=_0x378de7['reconnectDelay']??0xbb8,_0x378de7[_0x3e0180(0x18f)]!==!0x1)this[_0x3e0180(0x1d6)]();}[a0_0x4d231b(0x190)](_0x1bcd5e){const _0x1c84f5=a0_0x4d231b;console['log']('['+new Date()['toTimeString']()[_0x1c84f5(0x1a4)](0x0,0x8)+_0x1c84f5(0x1d7)+this['alias']+']\x20'+_0x1bcd5e);}async['call'](_0x2c471f,_0x1d8c39){const _0x3f9e56=a0_0x4d231b;let _0x11ef76={'Content-Type':'application/json','Accept':_0x3f9e56(0x1ba)};if(this['token'])_0x11ef76[_0x3f9e56(0x17f)]=_0x3f9e56(0x1d8)+this[_0x3f9e56(0x1b7)];let _0x32392e=await(await fetch(this[_0x3f9e56(0x1c3)]+_0x3f9e56(0x1b2),{'method':_0x3f9e56(0x1d1),'headers':_0x11ef76,'body':JSON['stringify']({'jsonrpc':'2.0','id':Date['now'](),'method':_0x3f9e56(0x1cc),'params':{'name':_0x2c471f,'arguments':_0x1d8c39}})}))['text'](),_0x4a9b2d=_0x32392e[_0x3f9e56(0x1ae)](/data: (.+)/),_0x29381a=_0x4a9b2d?JSON['parse'](_0x4a9b2d[0x1]):JSON[_0x3f9e56(0x180)](_0x32392e),_0x40fe30=_0x29381a?.['result']?.['content']?.[0x0]?.[_0x3f9e56(0x187)];return _0x40fe30?JSON[_0x3f9e56(0x180)](_0x40fe30):_0x29381a;}async[a0_0x4d231b(0x1d6)](){const _0x490e88=a0_0x4d231b;if(this[_0x490e88(0x19a)])return;this[_0x490e88(0x19a)]=!0x0,await this[_0x490e88(0x186)](_0x490e88(0x1c8)),this[_0x490e88(0x190)](_0x490e88(0x1a2)),this['heartbeatTimer']=setInterval(()=>{const _0x323a3d=_0x490e88;this[_0x323a3d(0x186)](_0x323a3d(0x1c8))[_0x323a3d(0x198)](_0x2688bf=>this['log']('heartbeat\x20failed:\x20'+_0x2688bf[_0x323a3d(0x191)]));},this[_0x490e88(0x1a9)]),this[_0x490e88(0x19d)]();}async[a0_0x4d231b(0x194)](){const _0x48dfe2=a0_0x4d231b;if(this[_0x48dfe2(0x19a)]=!0x1,this['sseAbort']?.[_0x48dfe2(0x199)](),this['heartbeatTimer'])clearInterval(this[_0x48dfe2(0x18a)]);await this['status'](_0x48dfe2(0x1a3))['catch'](()=>{}),this[_0x48dfe2(0x190)](_0x48dfe2(0x1a8));}async[a0_0x4d231b(0x1b4)](_0x3e0fac,_0x58ed5e,_0x2a11e7=a0_0x4d231b(0x181)){const _0x32dbcc=a0_0x4d231b;return this[_0x32dbcc(0x1a7)](_0x32dbcc(0x1c1),{'alias':_0x3e0fac,'task':_0x58ed5e,'priority':_0x2a11e7,'from_session':this['alias']});}async[a0_0x4d231b(0x191)](_0x78ee4d,_0x4cd5f2){const _0x42f76f=a0_0x4d231b;return this[_0x42f76f(0x1a7)](_0x42f76f(0x193),{'alias':_0x78ee4d,'message':_0x4cd5f2,'from_session':this[_0x42f76f(0x1c6)]});}async[a0_0x4d231b(0x184)](_0x4ac7fd,_0x4eaf65,_0x4d2158=a0_0x4d231b(0x1be)){const _0x9807bc=a0_0x4d231b;return this[_0x9807bc(0x1a7)]('send_reply',{'in_reply_to':_0x4ac7fd,'text':_0x4eaf65,'status':_0x4d2158});}async[a0_0x4d231b(0x186)](_0x2a2d4a,_0x33278e){const _0x9d60a7=a0_0x4d231b;return this[_0x9d60a7(0x1a7)](_0x9d60a7(0x1cd),{'resume_id':this[_0x9d60a7(0x1af)],'alias':this[_0x9d60a7(0x1c6)],'status':_0x2a2d4a,'server':a0_0x4fa072(),'hostname':a0_0x4fa072(),'agent':this[_0x9d60a7(0x197)],'project_dir':process[_0x9d60a7(0x1c7)](),..._0x33278e});}async['getAllStatus'](){const _0x4a2eae=a0_0x4d231b;return this[_0x4a2eae(0x1a7)]('get_all_status',{});}async[a0_0x4d231b(0x196)](_0x2c4132,_0x1b73f1){const _0x1d63a4=a0_0x4d231b;return this['call'](_0x1d63a4(0x196),{'message':_0x2c4132,'filter_server':_0x1b73f1?.[_0x1d63a4(0x1a0)],'filter_status':_0x1b73f1?.[_0x1d63a4(0x186)]});}async['connectSSE'](){const _0x1cc7a5=a0_0x4d231b;let _0x4667ef=encodeURIComponent(this[_0x1cc7a5(0x1c6)]),_0x493abb=this['url']+_0x1cc7a5(0x18d)+_0x4667ef,_0xcdf218=this[_0x1cc7a5(0x1cb)];while(this[_0x1cc7a5(0x19a)]){try{this[_0x1cc7a5(0x1d4)]=new AbortController();let _0x11a55a={'Accept':_0x1cc7a5(0x189)};if(this[_0x1cc7a5(0x1b7)])_0x11a55a['Authorization']=_0x1cc7a5(0x1d8)+this['token'];let _0x21e48a=await fetch(_0x493abb,{'headers':_0x11a55a,'signal':this['sseAbort'][_0x1cc7a5(0x1bf)]});if(!_0x21e48a['ok']||!_0x21e48a['body']){this[_0x1cc7a5(0x190)](_0x1cc7a5(0x1c9)+_0x21e48a['status']),await this[_0x1cc7a5(0x185)](_0xcdf218),_0xcdf218=Math[_0x1cc7a5(0x18b)](_0xcdf218*1.5,0xea60);continue;}_0xcdf218=this['reconnectDelay'];let _0x1aa8d2=_0x21e48a[_0x1cc7a5(0x1d0)][_0x1cc7a5(0x19e)](),_0x5c90d3=new TextDecoder(),_0x3ad1a8='';while(this[_0x1cc7a5(0x19a)]){let {done:_0x21a8a7,value:_0x2f9942}=await _0x1aa8d2[_0x1cc7a5(0x192)]();if(_0x21a8a7)break;_0x3ad1a8+=_0x5c90d3[_0x1cc7a5(0x1c4)](_0x2f9942,{'stream':!0x0});let _0x564e1a=_0x3ad1a8[_0x1cc7a5(0x1aa)]('\x0a');_0x3ad1a8=_0x564e1a[_0x1cc7a5(0x195)]()||'';for(let _0x527343 of _0x564e1a){if(!_0x527343[_0x1cc7a5(0x1c0)](_0x1cc7a5(0x19f)))continue;try{let _0x15a837=JSON['parse'](_0x527343[_0x1cc7a5(0x1a4)](0x6));if(_0x15a837['type']===_0x1cc7a5(0x1c5)){this['log']('SSE\x20connected'),this[_0x1cc7a5(0x1d5)]('connected');continue;}if(_0x15a837[_0x1cc7a5(0x19c)]===_0x1cc7a5(0x1a5)||_0x15a837[_0x1cc7a5(0x19c)]===_0x1cc7a5(0x1b6)||_0x15a837[_0x1cc7a5(0x19c)]===_0x1cc7a5(0x196))await this['processInbox']();}catch{}}}}catch(_0x511634){if(_0x511634[_0x1cc7a5(0x1bb)]==='AbortError')break;this[_0x1cc7a5(0x1d5)](_0x1cc7a5(0x182),_0x511634),this['log'](_0x1cc7a5(0x1ca)+_0x511634['message']);}if(this[_0x1cc7a5(0x19a)])this[_0x1cc7a5(0x1d5)]('disconnected'),this['log']('SSE\x20reconnecting\x20in\x20'+_0xcdf218/0x3e8+_0x1cc7a5(0x1d2)),await this[_0x1cc7a5(0x185)](_0xcdf218),_0xcdf218=Math[_0x1cc7a5(0x18b)](_0xcdf218*1.5,0xea60);}}async[a0_0x4d231b(0x1b0)](){const _0x3f29f2=a0_0x4d231b;try{let _0x203ada=(await this[_0x3f29f2(0x1a7)](_0x3f29f2(0x1a1),{'alias':this[_0x3f29f2(0x1c6)],'limit':0xa}))?.[_0x3f29f2(0x1ab)]||[];for(let _0x12737f of _0x203ada)await this['call'](_0x3f29f2(0x18c),{'alias':this[_0x3f29f2(0x1c6)],'message_id':_0x12737f['id']}),this['log']('←\x20'+_0x12737f['from_session']+':\x20'+_0x12737f[_0x3f29f2(0x1bc)]['slice'](0x0,0x3c)),this['emit'](_0x3f29f2(0x1ad),_0x12737f),this[_0x3f29f2(0x1d5)](_0x3f29f2(0x191),_0x12737f);}catch(_0x2e2065){this[_0x3f29f2(0x190)]('inbox\x20error:\x20'+_0x2e2065['message']);}}[a0_0x4d231b(0x185)](_0x1b81ae){return new Promise(_0x12eb0d=>setTimeout(_0x12eb0d,_0x1b81ae));}}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};