@sleep2agi/agent-network 2.3.0-preview.32 → 2.3.0-preview.34

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
- const a0_0x24d132=a0_0x518c;function a0_0x518c(_0x5a7409,_0x34d0d6){_0x5a7409=_0x5a7409-0xeb;const _0x1f19f7=a0_0x1f19();let _0x518cf1=_0x1f19f7[_0x5a7409];return _0x518cf1;}(function(_0xb8d80f,_0x5487d7){const _0x156597=a0_0x518c,_0x531af0=_0xb8d80f();while(!![]){try{const _0x336449=-parseInt(_0x156597(0x10b))/0x1*(-parseInt(_0x156597(0x129))/0x2)+parseInt(_0x156597(0xfe))/0x3*(parseInt(_0x156597(0xfa))/0x4)+parseInt(_0x156597(0x11c))/0x5+-parseInt(_0x156597(0x135))/0x6+-parseInt(_0x156597(0x101))/0x7*(-parseInt(_0x156597(0xfb))/0x8)+-parseInt(_0x156597(0xfc))/0x9+-parseInt(_0x156597(0xf1))/0xa;if(_0x336449===_0x5487d7)break;else _0x531af0['push'](_0x531af0['shift']());}catch(_0x5f1cd8){_0x531af0['push'](_0x531af0['shift']());}}}(a0_0x1f19,0x43b0a));import{EventEmitter as a0_0x3de462}from'events';import{hostname as a0_0x28bce7}from'os';class T extends a0_0x3de462{[a0_0x24d132(0x140)];['alias'];['token'];['agent'];[a0_0x24d132(0x10c)];['heartbeatInterval'];[a0_0x24d132(0x11b)];[a0_0x24d132(0x12a)];[a0_0x24d132(0xf7)];[a0_0x24d132(0x12f)]=!0x1;constructor(_0x2ec6e2){const _0x261a44=a0_0x24d132;super();if(this[_0x261a44(0x140)]=_0x2ec6e2['url'][_0x261a44(0x12c)](/\/$/,''),this[_0x261a44(0x13d)]=_0x2ec6e2[_0x261a44(0x13d)],this['token']=_0x2ec6e2[_0x261a44(0x117)],this[_0x261a44(0x106)]=_0x2ec6e2[_0x261a44(0x106)]||_0x261a44(0x10f),this[_0x261a44(0x10c)]=_0x261a44(0x125)+_0x2ec6e2[_0x261a44(0x13d)]+'-'+Date['now']()[_0x261a44(0x128)](0x24),this[_0x261a44(0x13b)]=_0x2ec6e2[_0x261a44(0x13b)]??0x2bf20,this[_0x261a44(0x11b)]=_0x2ec6e2[_0x261a44(0x11b)]??0xbb8,_0x2ec6e2[_0x261a44(0x11d)]!==!0x1)this[_0x261a44(0x107)]();}[a0_0x24d132(0x132)](_0x5684c2){const _0x6c72be=a0_0x24d132;console['log']('['+new Date()[_0x6c72be(0xec)]()[_0x6c72be(0x109)](0x0,0x8)+_0x6c72be(0xf3)+this['alias']+']\x20'+_0x5684c2);}async[a0_0x24d132(0x133)](_0x474755,_0x37a46a){const _0x474007=a0_0x24d132;let _0x1952e0={'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream'};if(this[_0x474007(0x117)])_0x1952e0[_0x474007(0x12e)]='Bearer\x20'+this[_0x474007(0x117)];let _0xd7a2d1=await(await fetch(this[_0x474007(0x140)]+_0x474007(0x13a),{'method':'POST','headers':_0x1952e0,'body':JSON[_0x474007(0x11f)]({'jsonrpc':'2.0','id':Date[_0x474007(0xf2)](),'method':'tools/call','params':{'name':_0x474755,'arguments':_0x37a46a}})}))[_0x474007(0x13f)](),_0x42c036=_0xd7a2d1[_0x474007(0x143)](/data: (.+)/),_0x4663c5=_0x42c036?JSON[_0x474007(0x141)](_0x42c036[0x1]):JSON['parse'](_0xd7a2d1),_0xdfd9bd=_0x4663c5?.[_0x474007(0x10a)]?.[_0x474007(0xeb)]?.[0x0]?.['text'];return _0xdfd9bd?JSON[_0x474007(0x141)](_0xdfd9bd):_0x4663c5;}async[a0_0x24d132(0x107)](){const _0x1dd6b2=a0_0x24d132;if(this[_0x1dd6b2(0x12f)])return;this[_0x1dd6b2(0x12f)]=!0x0,await this[_0x1dd6b2(0x139)](_0x1dd6b2(0x105)),this['log']('registered'),this['heartbeatTimer']=setInterval(()=>{const _0x4a7b9=_0x1dd6b2;this[_0x4a7b9(0x139)]('idle')[_0x4a7b9(0xed)](_0x5da592=>this['log'](_0x4a7b9(0x12b)+_0x5da592[_0x4a7b9(0xfd)]));},this[_0x1dd6b2(0x13b)]),this[_0x1dd6b2(0xf5)]();}async['disconnect'](){const _0x468fb0=a0_0x24d132;if(this[_0x468fb0(0x12f)]=!0x1,this['sseAbort']?.[_0x468fb0(0x103)](),this[_0x468fb0(0x12a)])clearInterval(this[_0x468fb0(0x12a)]);await this[_0x468fb0(0x139)]('offline')[_0x468fb0(0xed)](()=>{}),this['log']('disconnected');}async['send'](_0x4f85c8,_0xdaad74,_0x1af516='normal'){const _0x862833=a0_0x24d132;return this[_0x862833(0x133)](_0x862833(0x118),{'alias':_0x4f85c8,'task':_0xdaad74,'priority':_0x1af516,'from_session':this[_0x862833(0x13d)]});}async[a0_0x24d132(0xfd)](_0x1b42fc,_0x51121f){const _0x2d45ab=a0_0x24d132;return this[_0x2d45ab(0x133)](_0x2d45ab(0x116),{'alias':_0x1b42fc,'message':_0x51121f,'from_session':this['alias']});}async[a0_0x24d132(0x110)](_0x3eecdc,_0x597b84,_0x29102=a0_0x24d132(0x12d)){const _0x4a1fcd=a0_0x24d132;return this[_0x4a1fcd(0x133)](_0x4a1fcd(0x120),{'in_reply_to':_0x3eecdc,'text':_0x597b84,'status':_0x29102});}async[a0_0x24d132(0x139)](_0x385c4b,_0x10ab68){const _0x53c3cd=a0_0x24d132;return this[_0x53c3cd(0x133)](_0x53c3cd(0x115),{'resume_id':this[_0x53c3cd(0x10c)],'alias':this[_0x53c3cd(0x13d)],'status':_0x385c4b,'server':a0_0x28bce7(),'hostname':a0_0x28bce7(),'agent':this[_0x53c3cd(0x106)],'project_dir':process[_0x53c3cd(0x13e)](),..._0x10ab68});}async[a0_0x24d132(0x100)](){const _0x3918be=a0_0x24d132;return this[_0x3918be(0x133)](_0x3918be(0x111),{});}async[a0_0x24d132(0x122)](_0x3df8f5,_0x52b01a){const _0x39bad7=a0_0x24d132;return this['call'](_0x39bad7(0x122),{'message':_0x3df8f5,'filter_server':_0x52b01a?.[_0x39bad7(0x11e)],'filter_status':_0x52b01a?.[_0x39bad7(0x139)]});}async[a0_0x24d132(0xf5)](){const _0x17c83a=a0_0x24d132;let _0x52d741=encodeURIComponent(this['alias']),_0x3fcc76=this[_0x17c83a(0x140)]+_0x17c83a(0xf6)+_0x52d741,_0x2da2d2=this[_0x17c83a(0x11b)];while(this[_0x17c83a(0x12f)]){try{this[_0x17c83a(0xf7)]=new AbortController();let _0x41bb0f={'Accept':_0x17c83a(0x137)};if(this[_0x17c83a(0x117)])_0x41bb0f[_0x17c83a(0x12e)]=_0x17c83a(0x108)+this['token'];let _0x5d3615=await fetch(_0x3fcc76,{'headers':_0x41bb0f,'signal':this[_0x17c83a(0xf7)]['signal']});if(!_0x5d3615['ok']||!_0x5d3615[_0x17c83a(0xf4)]){this[_0x17c83a(0x132)](_0x17c83a(0x142)+_0x5d3615[_0x17c83a(0x139)]),await this['sleep'](_0x2da2d2),_0x2da2d2=Math[_0x17c83a(0xf8)](_0x2da2d2*1.5,0xea60);continue;}_0x2da2d2=this[_0x17c83a(0x11b)];let _0x27978b=_0x5d3615[_0x17c83a(0xf4)]['getReader'](),_0x5fee5f=new TextDecoder(),_0x2a98a8='';while(this[_0x17c83a(0x12f)]){let {done:_0x3949c9,value:_0xd756da}=await _0x27978b[_0x17c83a(0x138)]();if(_0x3949c9)break;_0x2a98a8+=_0x5fee5f[_0x17c83a(0x124)](_0xd756da,{'stream':!0x0});let _0x40e0f4=_0x2a98a8['split']('\x0a');_0x2a98a8=_0x40e0f4[_0x17c83a(0x114)]()||'';for(let _0x3a729f of _0x40e0f4){if(!_0x3a729f[_0x17c83a(0xee)](_0x17c83a(0x13c)))continue;try{let _0x41d396=JSON[_0x17c83a(0x141)](_0x3a729f['slice'](0x6));if(_0x41d396[_0x17c83a(0x104)]===_0x17c83a(0xf9)){this[_0x17c83a(0x132)](_0x17c83a(0x121)),this[_0x17c83a(0x126)]('connected');continue;}if(_0x41d396['type']===_0x17c83a(0x131)||_0x41d396[_0x17c83a(0x104)]===_0x17c83a(0xf0)||_0x41d396['type']===_0x17c83a(0x122))await this['processInbox']();}catch{}}}}catch(_0x1cfae1){if(_0x1cfae1[_0x17c83a(0x136)]===_0x17c83a(0xef))break;this['emit'](_0x17c83a(0x113),_0x1cfae1),this[_0x17c83a(0x132)](_0x17c83a(0x10d)+_0x1cfae1[_0x17c83a(0xfd)]);}if(this[_0x17c83a(0x12f)])this[_0x17c83a(0x126)](_0x17c83a(0x130)),this[_0x17c83a(0x132)](_0x17c83a(0x119)+_0x2da2d2/0x3e8+_0x17c83a(0x134)),await this[_0x17c83a(0x112)](_0x2da2d2),_0x2da2d2=Math[_0x17c83a(0xf8)](_0x2da2d2*1.5,0xea60);}}async[a0_0x24d132(0x127)](){const _0x34e590=a0_0x24d132;try{let _0xba5fcf=(await this[_0x34e590(0x133)](_0x34e590(0x11a),{'alias':this[_0x34e590(0x13d)],'limit':0xa}))?.['messages']||[];for(let _0x11d91d of _0xba5fcf)await this[_0x34e590(0x133)](_0x34e590(0x123),{'alias':this[_0x34e590(0x13d)],'message_id':_0x11d91d['id']}),this['log']('←\x20'+_0x11d91d[_0x34e590(0x10e)]+':\x20'+_0x11d91d['content'][_0x34e590(0x109)](0x0,0x3c)),this[_0x34e590(0x126)](_0x34e590(0x102),_0x11d91d),this[_0x34e590(0x126)](_0x34e590(0xfd),_0x11d91d);}catch(_0x26d0ea){this[_0x34e590(0x132)](_0x34e590(0xff)+_0x26d0ea[_0x34e590(0xfd)]);}}['sleep'](_0x41228a){return new Promise(_0x30bdbb=>setTimeout(_0x30bdbb,_0x41228a));}}function a0_0x1f19(){const _0x4f2705=['connectSSE','/events/','sseAbort','min','connected','8opeoAV','736ZMIxQh','145557IRhapH','message','31839suTsHj','inbox\x20error:\x20','getAllStatus','22519KlLWwV','task','abort','type','idle','agent','connect','Bearer\x20','slice','result','1792GdYDLr','resumeId','SSE\x20error:\x20','from_session','sdk','reply','get_all_status','sleep','error','pop','report_status','send_message','token','send_task','SSE\x20reconnecting\x20in\x20','get_inbox','reconnectDelay','1395865adKqft','autoConnect','server','stringify','send_reply','SSE\x20connected','broadcast','ack_inbox','decode','sdk-','emit','processInbox','toString','226qNEfMB','heartbeatTimer','heartbeat\x20failed:\x20','replace','completed','Authorization','running','disconnected','new_task','log','call','s...','2596344nUCvZE','name','text/event-stream','read','status','/mcp','heartbeatInterval','data:\x20','alias','cwd','text','url','parse','SSE\x20failed:\x20','match','content','toTimeString','catch','startsWith','AbortError','new_message','727040vfFkuu','now',']\x20[commhub:','body'];a0_0x1f19=function(){return _0x4f2705;};return a0_0x1f19();}var $=T;export{$ as default,T as CommHub};
1
+ function a0_0x9418(){const _0x454798=['sdk-','completed','ack_inbox','processInbox','connect','heartbeatInterval','reconnectDelay','split','token','1102851pkALrK','/mcp','log','send_task','offline','agent','startsWith','call','Bearer\x20','sleep','heartbeat\x20failed:\x20','18GUttkd','POST','send_reply','sseAbort','parse','catch','send','messages','reply','url','tools/call','application/json,\x20text/event-stream','abort','slice','type','task','connected','error','read','getReader','Authorization','resumeId','SSE\x20connected','disconnected','809568YMGlFg','send_message','disconnect','1366000cyTevn','status','emit','2.0',']\x20[commhub:','getAllStatus','content','message','connectSSE','heartbeatTimer','now','5KuWHWF','184404Gpvqqb','body','5157060mOPyCN','application/json','/events/','inbox\x20error:\x20','849175IXKUxY','get_all_status','server','5056992FStvGn','broadcast','running','s...','SSE\x20failed:\x20','text/event-stream','name','SSE\x20error:\x20','alias','idle','35fvCLtW'];a0_0x9418=function(){return _0x454798;};return a0_0x9418();}const a0_0x5a1909=a0_0x4e34;(function(_0x2865f9,_0x3761fc){const _0x5ebf3d=a0_0x4e34,_0x15d8d9=_0x2865f9();while(!![]){try{const _0x3d8dfe=parseInt(_0x5ebf3d(0x106))/0x1*(-parseInt(_0x5ebf3d(0x107))/0x2)+parseInt(_0x5ebf3d(0xd5))/0x3+parseInt(_0x5ebf3d(0xfb))/0x4+-parseInt(_0x5ebf3d(0xbe))/0x5*(parseInt(_0x5ebf3d(0xe0))/0x6)+-parseInt(_0x5ebf3d(0xcb))/0x7*(-parseInt(_0x5ebf3d(0xf8))/0x8)+parseInt(_0x5ebf3d(0xc1))/0x9+-parseInt(_0x5ebf3d(0x109))/0xa;if(_0x3d8dfe===_0x3761fc)break;else _0x15d8d9['push'](_0x15d8d9['shift']());}catch(_0x3b4465){_0x15d8d9['push'](_0x15d8d9['shift']());}}}(a0_0x9418,0x46fcc));function a0_0x4e34(_0x3b0a03,_0x34118d){_0x3b0a03=_0x3b0a03-0xbb;const _0x94180e=a0_0x9418();let _0x4e3437=_0x94180e[_0x3b0a03];return _0x4e3437;}import{EventEmitter as a0_0x536da2}from'events';import{hostname as a0_0x1ffcb0}from'os';class T extends a0_0x536da2{['url'];[a0_0x5a1909(0xc9)];[a0_0x5a1909(0xd4)];[a0_0x5a1909(0xda)];[a0_0x5a1909(0xf5)];[a0_0x5a1909(0xd1)];[a0_0x5a1909(0xd2)];['heartbeatTimer'];[a0_0x5a1909(0xe3)];[a0_0x5a1909(0xc3)]=!0x1;constructor(_0x36c4fe){const _0x1bfaff=a0_0x5a1909;super();if(this['url']=_0x36c4fe[_0x1bfaff(0xe9)]['replace'](/\/$/,''),this[_0x1bfaff(0xc9)]=_0x36c4fe[_0x1bfaff(0xc9)],this[_0x1bfaff(0xd4)]=_0x36c4fe['token'],this[_0x1bfaff(0xda)]=_0x36c4fe[_0x1bfaff(0xda)]||'sdk',this[_0x1bfaff(0xf5)]=_0x1bfaff(0xcc)+_0x36c4fe[_0x1bfaff(0xc9)]+'-'+Date[_0x1bfaff(0x105)]()['toString'](0x24),this[_0x1bfaff(0xd1)]=_0x36c4fe['heartbeatInterval']??0x2bf20,this[_0x1bfaff(0xd2)]=_0x36c4fe[_0x1bfaff(0xd2)]??0xbb8,_0x36c4fe['autoConnect']!==!0x1)this[_0x1bfaff(0xd0)]();}[a0_0x5a1909(0xd7)](_0xac0e7e){const _0x1e7171=a0_0x5a1909;console['log']('['+new Date()['toTimeString']()[_0x1e7171(0xed)](0x0,0x8)+_0x1e7171(0xff)+this[_0x1e7171(0xc9)]+']\x20'+_0xac0e7e);}async[a0_0x5a1909(0xdc)](_0x94ed95,_0x215f21){const _0x5dfb3f=a0_0x5a1909;let _0x3d96f9={'Content-Type':_0x5dfb3f(0xbb),'Accept':_0x5dfb3f(0xeb)};if(this[_0x5dfb3f(0xd4)])_0x3d96f9[_0x5dfb3f(0xf4)]=_0x5dfb3f(0xdd)+this[_0x5dfb3f(0xd4)];let _0x4f4ade=await(await fetch(this[_0x5dfb3f(0xe9)]+_0x5dfb3f(0xd6),{'method':_0x5dfb3f(0xe1),'headers':_0x3d96f9,'body':JSON['stringify']({'jsonrpc':_0x5dfb3f(0xfe),'id':Date['now'](),'method':_0x5dfb3f(0xea),'params':{'name':_0x94ed95,'arguments':_0x215f21}})}))['text'](),_0x57a7a1=_0x4f4ade['match'](/data: (.+)/),_0x284fcf=_0x57a7a1?JSON[_0x5dfb3f(0xe4)](_0x57a7a1[0x1]):JSON[_0x5dfb3f(0xe4)](_0x4f4ade),_0x5b6cc3=_0x284fcf?.['result']?.[_0x5dfb3f(0x101)]?.[0x0]?.['text'];return _0x5b6cc3?JSON[_0x5dfb3f(0xe4)](_0x5b6cc3):_0x284fcf;}async[a0_0x5a1909(0xd0)](){const _0x5d92e4=a0_0x5a1909;if(this['running'])return;this['running']=!0x0,await this[_0x5d92e4(0xfc)](_0x5d92e4(0xca)),this['log']('registered'),this[_0x5d92e4(0x104)]=setInterval(()=>{const _0x13bb35=_0x5d92e4;this[_0x13bb35(0xfc)]('idle')['catch'](_0x43940e=>this[_0x13bb35(0xd7)](_0x13bb35(0xdf)+_0x43940e[_0x13bb35(0x102)]));},this[_0x5d92e4(0xd1)]),this['connectSSE']();}async[a0_0x5a1909(0xfa)](){const _0x5e789a=a0_0x5a1909;if(this[_0x5e789a(0xc3)]=!0x1,this[_0x5e789a(0xe3)]?.[_0x5e789a(0xec)](),this['heartbeatTimer'])clearInterval(this[_0x5e789a(0x104)]);await this[_0x5e789a(0xfc)](_0x5e789a(0xd9))[_0x5e789a(0xe5)](()=>{}),this[_0x5e789a(0xd7)](_0x5e789a(0xf7));}async[a0_0x5a1909(0xe6)](_0x11c606,_0x2ba2d3,_0x2b6299='normal'){const _0x573381=a0_0x5a1909;return this[_0x573381(0xdc)](_0x573381(0xd8),{'alias':_0x11c606,'task':_0x2ba2d3,'priority':_0x2b6299,'from_session':this[_0x573381(0xc9)]});}async['message'](_0x4d2249,_0x5c2fc4){const _0xfaf92f=a0_0x5a1909;return this[_0xfaf92f(0xdc)](_0xfaf92f(0xf9),{'alias':_0x4d2249,'message':_0x5c2fc4,'from_session':this[_0xfaf92f(0xc9)]});}async[a0_0x5a1909(0xe8)](_0x1e4478,_0x3c89bf,_0x403566=a0_0x5a1909(0xcd)){const _0x361e4f=a0_0x5a1909;return this[_0x361e4f(0xdc)](_0x361e4f(0xe2),{'in_reply_to':_0x1e4478,'text':_0x3c89bf,'status':_0x403566});}async[a0_0x5a1909(0xfc)](_0x3bcca2,_0xd343fa){const _0x59c013=a0_0x5a1909;return this[_0x59c013(0xdc)]('report_status',{'resume_id':this[_0x59c013(0xf5)],'alias':this[_0x59c013(0xc9)],'status':_0x3bcca2,'server':a0_0x1ffcb0(),'hostname':a0_0x1ffcb0(),'agent':this[_0x59c013(0xda)],'project_dir':process['cwd'](),..._0xd343fa});}async[a0_0x5a1909(0x100)](){const _0x1ea804=a0_0x5a1909;return this[_0x1ea804(0xdc)](_0x1ea804(0xbf),{});}async['broadcast'](_0x1b15e3,_0x13f9e1){const _0x376bad=a0_0x5a1909;return this[_0x376bad(0xdc)](_0x376bad(0xc2),{'message':_0x1b15e3,'filter_server':_0x13f9e1?.[_0x376bad(0xc0)],'filter_status':_0x13f9e1?.[_0x376bad(0xfc)]});}async[a0_0x5a1909(0x103)](){const _0x30be42=a0_0x5a1909;let _0xd3dc6d=encodeURIComponent(this['alias']),_0x1634ca=this[_0x30be42(0xe9)]+_0x30be42(0xbc)+_0xd3dc6d,_0x10ce93=this['reconnectDelay'];while(this[_0x30be42(0xc3)]){try{this[_0x30be42(0xe3)]=new AbortController();let _0x27184b={'Accept':_0x30be42(0xc6)};if(this[_0x30be42(0xd4)])_0x27184b[_0x30be42(0xf4)]='Bearer\x20'+this[_0x30be42(0xd4)];let _0x66c85b=await fetch(_0x1634ca,{'headers':_0x27184b,'signal':this[_0x30be42(0xe3)]['signal']});if(!_0x66c85b['ok']||!_0x66c85b[_0x30be42(0x108)]){this[_0x30be42(0xd7)](_0x30be42(0xc5)+_0x66c85b[_0x30be42(0xfc)]),await this[_0x30be42(0xde)](_0x10ce93),_0x10ce93=Math['min'](_0x10ce93*1.5,0xea60);continue;}_0x10ce93=this['reconnectDelay'];let _0x2a9a54=_0x66c85b['body'][_0x30be42(0xf3)](),_0x362655=new TextDecoder(),_0xb7259e='';while(this['running']){let {done:_0x589725,value:_0x4dc8ba}=await _0x2a9a54[_0x30be42(0xf2)]();if(_0x589725)break;_0xb7259e+=_0x362655['decode'](_0x4dc8ba,{'stream':!0x0});let _0x2105a0=_0xb7259e[_0x30be42(0xd3)]('\x0a');_0xb7259e=_0x2105a0['pop']()||'';for(let _0x30924a of _0x2105a0){if(!_0x30924a[_0x30be42(0xdb)]('data:\x20'))continue;try{let _0x5ef844=JSON[_0x30be42(0xe4)](_0x30924a[_0x30be42(0xed)](0x6));if(_0x5ef844[_0x30be42(0xee)]===_0x30be42(0xf0)){this['log'](_0x30be42(0xf6)),this['emit'](_0x30be42(0xf0));continue;}if(_0x5ef844['type']==='new_task'||_0x5ef844[_0x30be42(0xee)]==='new_message'||_0x5ef844[_0x30be42(0xee)]===_0x30be42(0xc2))await this[_0x30be42(0xcf)]();}catch{}}}}catch(_0x574727){if(_0x574727[_0x30be42(0xc7)]==='AbortError')break;this[_0x30be42(0xfd)](_0x30be42(0xf1),_0x574727),this['log'](_0x30be42(0xc8)+_0x574727[_0x30be42(0x102)]);}if(this['running'])this[_0x30be42(0xfd)]('disconnected'),this[_0x30be42(0xd7)]('SSE\x20reconnecting\x20in\x20'+_0x10ce93/0x3e8+_0x30be42(0xc4)),await this['sleep'](_0x10ce93),_0x10ce93=Math['min'](_0x10ce93*1.5,0xea60);}}async[a0_0x5a1909(0xcf)](){const _0x8c91ed=a0_0x5a1909;try{let _0x46203c=(await this['call']('get_inbox',{'alias':this[_0x8c91ed(0xc9)],'limit':0xa}))?.[_0x8c91ed(0xe7)]||[];for(let _0x3c15ce of _0x46203c)await this[_0x8c91ed(0xdc)](_0x8c91ed(0xce),{'alias':this['alias'],'message_id':_0x3c15ce['id']}),this[_0x8c91ed(0xd7)]('←\x20'+_0x3c15ce['from_session']+':\x20'+_0x3c15ce[_0x8c91ed(0x101)]['slice'](0x0,0x3c)),this[_0x8c91ed(0xfd)](_0x8c91ed(0xef),_0x3c15ce),this[_0x8c91ed(0xfd)](_0x8c91ed(0x102),_0x3c15ce);}catch(_0x167d4f){this[_0x8c91ed(0xd7)](_0x8c91ed(0xbd)+_0x167d4f[_0x8c91ed(0x102)]);}}[a0_0x5a1909(0xde)](_0x28f9a4){return new Promise(_0x1df5c7=>setTimeout(_0x1df5c7,_0x28f9a4));}}var $=T;export{$ as default,T as CommHub};