@sleep2agi/agent-network 2.3.0-preview.10 → 2.3.0-preview.13

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_0x9087(_0x3f18eb,_0x38a974){_0x3f18eb=_0x3f18eb-0x1b0;const _0x527323=a0_0x5273();let _0x90874=_0x527323[_0x3f18eb];return _0x90874;}const a0_0x4139e8=a0_0x9087;(function(_0x26215d,_0x2c9eed){const _0x471321=a0_0x9087,_0x39fce5=_0x26215d();while(!![]){try{const _0x239ad1=-parseInt(_0x471321(0x1c8))/0x1*(parseInt(_0x471321(0x1b5))/0x2)+-parseInt(_0x471321(0x1fe))/0x3*(parseInt(_0x471321(0x1c2))/0x4)+-parseInt(_0x471321(0x1d3))/0x5*(parseInt(_0x471321(0x1c5))/0x6)+parseInt(_0x471321(0x200))/0x7+parseInt(_0x471321(0x1c1))/0x8+-parseInt(_0x471321(0x1e4))/0x9*(parseInt(_0x471321(0x1df))/0xa)+parseInt(_0x471321(0x1c9))/0xb;if(_0x239ad1===_0x2c9eed)break;else _0x39fce5['push'](_0x39fce5['shift']());}catch(_0x397d1a){_0x39fce5['push'](_0x39fce5['shift']());}}}(a0_0x5273,0x7bdd8));import{EventEmitter as a0_0x452b00}from'events';import{hostname as a0_0x156699}from'os';class T extends a0_0x452b00{['url'];[a0_0x4139e8(0x1b8)];[a0_0x4139e8(0x1f7)];[a0_0x4139e8(0x1e1)];[a0_0x4139e8(0x1f3)];['heartbeatInterval'];['reconnectDelay'];[a0_0x4139e8(0x1d6)];[a0_0x4139e8(0x1de)];[a0_0x4139e8(0x1be)]=!0x1;constructor(_0x1ec7b6){const _0x2dcdac=a0_0x4139e8;super();if(this[_0x2dcdac(0x1d0)]=_0x1ec7b6[_0x2dcdac(0x1d0)][_0x2dcdac(0x1ec)](/\/$/,''),this[_0x2dcdac(0x1b8)]=_0x1ec7b6[_0x2dcdac(0x1b8)],this[_0x2dcdac(0x1f7)]=_0x1ec7b6['token'],this[_0x2dcdac(0x1e1)]=_0x1ec7b6['agent']||_0x2dcdac(0x1cb),this[_0x2dcdac(0x1f3)]=_0x2dcdac(0x1dc)+_0x1ec7b6['alias']+'-'+Date[_0x2dcdac(0x1e0)]()['toString'](0x24),this[_0x2dcdac(0x201)]=_0x1ec7b6[_0x2dcdac(0x201)]??0x2bf20,this[_0x2dcdac(0x1b1)]=_0x1ec7b6[_0x2dcdac(0x1b1)]??0xbb8,_0x1ec7b6['autoConnect']!==!0x1)this[_0x2dcdac(0x1db)]();}[a0_0x4139e8(0x1ba)](_0xce487a){const _0x4d0746=a0_0x4139e8;console[_0x4d0746(0x1ba)]('['+new Date()[_0x4d0746(0x1d7)]()[_0x4d0746(0x1e6)](0x0,0x8)+_0x4d0746(0x1e2)+this['alias']+']\x20'+_0xce487a);}async['call'](_0x4fc4e6,_0x1bb33c){const _0x36dfd7=a0_0x4139e8;let _0x422b0b={'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream'};if(this[_0x36dfd7(0x1f7)])_0x422b0b[_0x36dfd7(0x1c0)]=_0x36dfd7(0x1d4)+this[_0x36dfd7(0x1f7)];let _0x3e62a7=await(await fetch(this[_0x36dfd7(0x1d0)]+_0x36dfd7(0x1c3),{'method':_0x36dfd7(0x1bf),'headers':_0x422b0b,'body':JSON[_0x36dfd7(0x1ee)]({'jsonrpc':_0x36dfd7(0x1cc),'id':Date['now'](),'method':'tools/call','params':{'name':_0x4fc4e6,'arguments':_0x1bb33c}})}))[_0x36dfd7(0x1b7)](),_0x8e24e9=_0x3e62a7[_0x36dfd7(0x1ff)](/data: (.+)/),_0xe8f3df=_0x8e24e9?JSON['parse'](_0x8e24e9[0x1]):JSON['parse'](_0x3e62a7),_0x11d61f=_0xe8f3df?.['result']?.['content']?.[0x0]?.[_0x36dfd7(0x1b7)];return _0x11d61f?JSON[_0x36dfd7(0x203)](_0x11d61f):_0xe8f3df;}async['connect'](){const _0xf3262e=a0_0x4139e8;if(this[_0xf3262e(0x1be)])return;this['running']=!0x0,await this[_0xf3262e(0x1b0)]('idle'),this[_0xf3262e(0x1ba)]('registered'),this[_0xf3262e(0x1d6)]=setInterval(()=>{const _0x203fef=_0xf3262e;this['status']('idle')[_0x203fef(0x1e5)](_0x595d29=>this[_0x203fef(0x1ba)](_0x203fef(0x1f9)+_0x595d29[_0x203fef(0x1c7)]));},this[_0xf3262e(0x201)]),this[_0xf3262e(0x1b9)]();}async[a0_0x4139e8(0x1eb)](){const _0x23a6fc=a0_0x4139e8;if(this['running']=!0x1,this[_0x23a6fc(0x1de)]?.['abort'](),this[_0x23a6fc(0x1d6)])clearInterval(this[_0x23a6fc(0x1d6)]);await this[_0x23a6fc(0x1b0)](_0x23a6fc(0x1cf))['catch'](()=>{}),this[_0x23a6fc(0x1ba)](_0x23a6fc(0x1da));}async[a0_0x4139e8(0x1d9)](_0xfa460,_0x5397f3,_0x20e1ec=a0_0x4139e8(0x1ca)){const _0x22f39b=a0_0x4139e8;return this['call'](_0x22f39b(0x1f8),{'alias':_0xfa460,'task':_0x5397f3,'priority':_0x20e1ec,'from_session':this[_0x22f39b(0x1b8)]});}async[a0_0x4139e8(0x1c7)](_0xc25c42,_0x2b8571){const _0x41af61=a0_0x4139e8;return this[_0x41af61(0x1ea)]('send_message',{'alias':_0xc25c42,'message':_0x2b8571,'from_session':this['alias']});}async[a0_0x4139e8(0x1f2)](_0x2b5258,_0x514191,_0x4a53d1=a0_0x4139e8(0x1e8)){const _0x830a3c=a0_0x4139e8;return this['call'](_0x830a3c(0x1f1),{'in_reply_to':_0x2b5258,'text':_0x514191,'status':_0x4a53d1});}async['status'](_0x33e015,_0x5df1d9){const _0x1e6150=a0_0x4139e8;return this[_0x1e6150(0x1ea)]('report_status',{'resume_id':this[_0x1e6150(0x1f3)],'alias':this[_0x1e6150(0x1b8)],'status':_0x33e015,'server':a0_0x156699(),'hostname':a0_0x156699(),'agent':this[_0x1e6150(0x1e1)],'project_dir':process[_0x1e6150(0x1c4)](),..._0x5df1d9});}async[a0_0x4139e8(0x1b4)](){const _0x3f230e=a0_0x4139e8;return this[_0x3f230e(0x1ea)]('get_all_status',{});}async[a0_0x4139e8(0x1fc)](_0x4bfac2,_0x13aff5){const _0xf19557=a0_0x4139e8;return this['call'](_0xf19557(0x1fc),{'message':_0x4bfac2,'filter_server':_0x13aff5?.[_0xf19557(0x1bc)],'filter_status':_0x13aff5?.['status']});}async['connectSSE'](){const _0x3c6e5f=a0_0x4139e8;let _0x246124=encodeURIComponent(this[_0x3c6e5f(0x1b8)]),_0x321a3c=this['url']+_0x3c6e5f(0x1bd)+_0x246124,_0x49da31=this[_0x3c6e5f(0x1b1)];while(this[_0x3c6e5f(0x1be)]){try{this[_0x3c6e5f(0x1de)]=new AbortController();let _0x507414={'Accept':'text/event-stream'};if(this['token'])_0x507414['Authorization']=_0x3c6e5f(0x1d4)+this[_0x3c6e5f(0x1f7)];let _0x18bcfc=await fetch(_0x321a3c,{'headers':_0x507414,'signal':this[_0x3c6e5f(0x1de)][_0x3c6e5f(0x1ce)]});if(!_0x18bcfc['ok']||!_0x18bcfc[_0x3c6e5f(0x1fa)]){this[_0x3c6e5f(0x1ba)](_0x3c6e5f(0x1d2)+_0x18bcfc[_0x3c6e5f(0x1b0)]),await this[_0x3c6e5f(0x1d1)](_0x49da31),_0x49da31=Math[_0x3c6e5f(0x1fb)](_0x49da31*1.5,0xea60);continue;}_0x49da31=this[_0x3c6e5f(0x1b1)];let _0x1c0825=_0x18bcfc[_0x3c6e5f(0x1fa)][_0x3c6e5f(0x1d8)](),_0x45bd49=new TextDecoder(),_0x5f245d='';while(this[_0x3c6e5f(0x1be)]){let {done:_0x32689d,value:_0x5ea000}=await _0x1c0825[_0x3c6e5f(0x202)]();if(_0x32689d)break;_0x5f245d+=_0x45bd49[_0x3c6e5f(0x1cd)](_0x5ea000,{'stream':!0x0});let _0x4f5482=_0x5f245d[_0x3c6e5f(0x1e7)]('\x0a');_0x5f245d=_0x4f5482[_0x3c6e5f(0x1ed)]()||'';for(let _0x5f404f of _0x4f5482){if(!_0x5f404f['startsWith'](_0x3c6e5f(0x1c6)))continue;try{let _0x1414a2=JSON['parse'](_0x5f404f[_0x3c6e5f(0x1e6)](0x6));if(_0x1414a2[_0x3c6e5f(0x1f6)]===_0x3c6e5f(0x1bb)){this[_0x3c6e5f(0x1ba)](_0x3c6e5f(0x1fd)),this['emit'](_0x3c6e5f(0x1bb));continue;}if(_0x1414a2[_0x3c6e5f(0x1f6)]==='new_task'||_0x1414a2[_0x3c6e5f(0x1f6)]===_0x3c6e5f(0x1f0)||_0x1414a2['type']===_0x3c6e5f(0x1fc))await this['processInbox']();}catch{}}}}catch(_0x53f1fb){if(_0x53f1fb[_0x3c6e5f(0x1f5)]===_0x3c6e5f(0x1b6))break;this[_0x3c6e5f(0x1e3)]('error',_0x53f1fb),this[_0x3c6e5f(0x1ba)](_0x3c6e5f(0x1b3)+_0x53f1fb['message']);}if(this['running'])this['emit']('disconnected'),this[_0x3c6e5f(0x1ba)]('SSE\x20reconnecting\x20in\x20'+_0x49da31/0x3e8+_0x3c6e5f(0x1ef)),await this[_0x3c6e5f(0x1d1)](_0x49da31),_0x49da31=Math[_0x3c6e5f(0x1fb)](_0x49da31*1.5,0xea60);}}async[a0_0x4139e8(0x1e9)](){const _0x12fd99=a0_0x4139e8;try{let _0x289ab6=(await this[_0x12fd99(0x1ea)]('get_inbox',{'alias':this[_0x12fd99(0x1b8)],'limit':0xa}))?.['messages']||[];for(let _0x182191 of _0x289ab6)await this[_0x12fd99(0x1ea)](_0x12fd99(0x1f4),{'alias':this['alias'],'message_id':_0x182191['id']}),this[_0x12fd99(0x1ba)]('←\x20'+_0x182191['from_session']+':\x20'+_0x182191[_0x12fd99(0x1d5)]['slice'](0x0,0x3c)),this[_0x12fd99(0x1e3)](_0x12fd99(0x1dd),_0x182191),this[_0x12fd99(0x1e3)](_0x12fd99(0x1c7),_0x182191);}catch(_0x230955){this[_0x12fd99(0x1ba)](_0x12fd99(0x1b2)+_0x230955[_0x12fd99(0x1c7)]);}}['sleep'](_0x46b019){return new Promise(_0x4c2373=>setTimeout(_0x4c2373,_0x46b019));}}var $=T;function a0_0x5273(){const _0xb9b414=['resumeId','ack_inbox','name','type','token','send_task','heartbeat\x20failed:\x20','body','min','broadcast','SSE\x20connected','3kklzGc','match','4742297otxDVy','heartbeatInterval','read','parse','status','reconnectDelay','inbox\x20error:\x20','SSE\x20error:\x20','getAllStatus','120182PaDwYY','AbortError','text','alias','connectSSE','log','connected','server','/events/','running','POST','Authorization','1452400lsEPNt','325960iLhYqe','/mcp','cwd','60bWTvwm','data:\x20','message','7NFflPt','5911345IkiVmS','normal','sdk','2.0','decode','signal','offline','url','sleep','SSE\x20failed:\x20','26140bCTUFF','Bearer\x20','content','heartbeatTimer','toTimeString','getReader','send','disconnected','connect','sdk-','task','sseAbort','3346570mWRYOy','now','agent',']\x20[commhub:','emit','9fOYvkA','catch','slice','split','completed','processInbox','call','disconnect','replace','pop','stringify','s...','new_message','send_reply','reply'];a0_0x5273=function(){return _0xb9b414;};return a0_0x5273();}export{$ as default,T as CommHub};
1
+ const a0_0xf1c06c=a0_0x2fb6;(function(_0x24f5d0,_0x46255b){const _0x55a99b=a0_0x2fb6,_0x3a2bc6=_0x24f5d0();while(!![]){try{const _0x44d267=parseInt(_0x55a99b(0x1b3))/0x1+-parseInt(_0x55a99b(0x1da))/0x2*(parseInt(_0x55a99b(0x205))/0x3)+parseInt(_0x55a99b(0x1d8))/0x4*(-parseInt(_0x55a99b(0x1d0))/0x5)+-parseInt(_0x55a99b(0x1e3))/0x6*(-parseInt(_0x55a99b(0x1e6))/0x7)+parseInt(_0x55a99b(0x1f4))/0x8*(-parseInt(_0x55a99b(0x1eb))/0x9)+-parseInt(_0x55a99b(0x203))/0xa*(-parseInt(_0x55a99b(0x1c1))/0xb)+parseInt(_0x55a99b(0x1b6))/0xc*(-parseInt(_0x55a99b(0x1f6))/0xd);if(_0x44d267===_0x46255b)break;else _0x3a2bc6['push'](_0x3a2bc6['shift']());}catch(_0x45778e){_0x3a2bc6['push'](_0x3a2bc6['shift']());}}}(a0_0x10c1,0xee739));import{EventEmitter as a0_0x1aefac}from'events';import{hostname as a0_0x9816c1}from'os';class T extends a0_0x1aefac{[a0_0xf1c06c(0x208)];[a0_0xf1c06c(0x1cd)];[a0_0xf1c06c(0x1f2)];[a0_0xf1c06c(0x1d1)];[a0_0xf1c06c(0x1f1)];[a0_0xf1c06c(0x1c2)];[a0_0xf1c06c(0x1d5)];['heartbeatTimer'];[a0_0xf1c06c(0x1d4)];['running']=!0x1;constructor(_0xa28ffe){const _0x2f4640=a0_0xf1c06c;super();if(this[_0x2f4640(0x208)]=_0xa28ffe[_0x2f4640(0x208)][_0x2f4640(0x1bf)](/\/$/,''),this[_0x2f4640(0x1cd)]=_0xa28ffe[_0x2f4640(0x1cd)],this['token']=_0xa28ffe[_0x2f4640(0x1f2)],this[_0x2f4640(0x1d1)]=_0xa28ffe[_0x2f4640(0x1d1)]||_0x2f4640(0x1ba),this['resumeId']=_0x2f4640(0x1ca)+_0xa28ffe[_0x2f4640(0x1cd)]+'-'+Date['now']()[_0x2f4640(0x1f3)](0x24),this[_0x2f4640(0x1c2)]=_0xa28ffe[_0x2f4640(0x1c2)]??0x2bf20,this[_0x2f4640(0x1d5)]=_0xa28ffe['reconnectDelay']??0xbb8,_0xa28ffe[_0x2f4640(0x1f7)]!==!0x1)this['connect']();}[a0_0xf1c06c(0x1ef)](_0x5514ed){const _0x40161b=a0_0xf1c06c;console['log']('['+new Date()[_0x40161b(0x1de)]()[_0x40161b(0x1fc)](0x0,0x8)+_0x40161b(0x1fa)+this[_0x40161b(0x1cd)]+']\x20'+_0x5514ed);}async['call'](_0x435db5,_0xb0bcfc){const _0x566ce9=a0_0xf1c06c;let _0xa14dce={'Content-Type':_0x566ce9(0x1c0),'Accept':'application/json,\x20text/event-stream'};if(this[_0x566ce9(0x1f2)])_0xa14dce[_0x566ce9(0x1bd)]=_0x566ce9(0x1df)+this['token'];let _0x5f0e8c=await(await fetch(this[_0x566ce9(0x208)]+_0x566ce9(0x1c7),{'method':'POST','headers':_0xa14dce,'body':JSON['stringify']({'jsonrpc':_0x566ce9(0x20c),'id':Date['now'](),'method':_0x566ce9(0x1ce),'params':{'name':_0x435db5,'arguments':_0xb0bcfc}})}))[_0x566ce9(0x1cf)](),_0x1fd6ff=_0x5f0e8c[_0x566ce9(0x1c3)](/data: (.+)/),_0x32c202=_0x1fd6ff?JSON['parse'](_0x1fd6ff[0x1]):JSON[_0x566ce9(0x209)](_0x5f0e8c),_0x1569a9=_0x32c202?.[_0x566ce9(0x1c8)]?.['content']?.[0x0]?.[_0x566ce9(0x1cf)];return _0x1569a9?JSON['parse'](_0x1569a9):_0x32c202;}async['connect'](){const _0x63b9df=a0_0xf1c06c;if(this['running'])return;this[_0x63b9df(0x1bc)]=!0x0,await this[_0x63b9df(0x1dd)]('idle'),this[_0x63b9df(0x1ef)](_0x63b9df(0x1ed)),this[_0x63b9df(0x1b8)]=setInterval(()=>{const _0x4bb546=_0x63b9df;this[_0x4bb546(0x1dd)](_0x4bb546(0x1fe))[_0x4bb546(0x1b7)](_0x3c7c19=>this[_0x4bb546(0x1ef)](_0x4bb546(0x1c6)+_0x3c7c19['message']));},this[_0x63b9df(0x1c2)]),this['connectSSE']();}async[a0_0xf1c06c(0x206)](){const _0xf8a9e9=a0_0xf1c06c;if(this[_0xf8a9e9(0x1bc)]=!0x1,this[_0xf8a9e9(0x1d4)]?.['abort'](),this[_0xf8a9e9(0x1b8)])clearInterval(this[_0xf8a9e9(0x1b8)]);await this[_0xf8a9e9(0x1dd)](_0xf8a9e9(0x201))[_0xf8a9e9(0x1b7)](()=>{}),this[_0xf8a9e9(0x1ef)](_0xf8a9e9(0x1f5));}async['send'](_0x5799b8,_0xb54cb0,_0x24ed41=a0_0xf1c06c(0x207)){const _0x1e3a77=a0_0xf1c06c;return this[_0x1e3a77(0x1f8)]('send_task',{'alias':_0x5799b8,'task':_0xb54cb0,'priority':_0x24ed41,'from_session':this[_0x1e3a77(0x1cd)]});}async[a0_0xf1c06c(0x1cc)](_0x4bdfb4,_0x52ff34){const _0x2b341d=a0_0xf1c06c;return this[_0x2b341d(0x1f8)](_0x2b341d(0x1cb),{'alias':_0x4bdfb4,'message':_0x52ff34,'from_session':this[_0x2b341d(0x1cd)]});}async[a0_0xf1c06c(0x1ff)](_0x3c83d9,_0x5a06ec,_0xc8aa36=a0_0xf1c06c(0x1ec)){const _0x188c2b=a0_0xf1c06c;return this[_0x188c2b(0x1f8)](_0x188c2b(0x1c5),{'in_reply_to':_0x3c83d9,'text':_0x5a06ec,'status':_0xc8aa36});}async['status'](_0x53a109,_0x37edbd){const _0x1091ea=a0_0xf1c06c;return this['call'](_0x1091ea(0x202),{'resume_id':this[_0x1091ea(0x1f1)],'alias':this[_0x1091ea(0x1cd)],'status':_0x53a109,'server':a0_0x9816c1(),'hostname':a0_0x9816c1(),'agent':this[_0x1091ea(0x1d1)],'project_dir':process['cwd'](),..._0x37edbd});}async['getAllStatus'](){const _0x472c60=a0_0xf1c06c;return this[_0x472c60(0x1f8)](_0x472c60(0x1d6),{});}async[a0_0xf1c06c(0x1d3)](_0x59bff9,_0xc555a9){const _0x2bf5d0=a0_0xf1c06c;return this[_0x2bf5d0(0x1f8)]('broadcast',{'message':_0x59bff9,'filter_server':_0xc555a9?.['server'],'filter_status':_0xc555a9?.['status']});}async[a0_0xf1c06c(0x1e2)](){const _0x1c67a8=a0_0xf1c06c;let _0x5c0588=encodeURIComponent(this[_0x1c67a8(0x1cd)]),_0x26c11b=this['url']+_0x1c67a8(0x200)+_0x5c0588,_0x3e5be0=this[_0x1c67a8(0x1d5)];while(this[_0x1c67a8(0x1bc)]){try{this[_0x1c67a8(0x1d4)]=new AbortController();let _0x5dac57={'Accept':_0x1c67a8(0x1e1)};if(this['token'])_0x5dac57[_0x1c67a8(0x1bd)]=_0x1c67a8(0x1df)+this[_0x1c67a8(0x1f2)];let _0x3a096f=await fetch(_0x26c11b,{'headers':_0x5dac57,'signal':this[_0x1c67a8(0x1d4)][_0x1c67a8(0x1ee)]});if(!_0x3a096f['ok']||!_0x3a096f[_0x1c67a8(0x1c4)]){this['log'](_0x1c67a8(0x204)+_0x3a096f[_0x1c67a8(0x1dd)]),await this['sleep'](_0x3e5be0),_0x3e5be0=Math[_0x1c67a8(0x1e5)](_0x3e5be0*1.5,0xea60);continue;}_0x3e5be0=this[_0x1c67a8(0x1d5)];let _0x297609=_0x3a096f[_0x1c67a8(0x1c4)][_0x1c67a8(0x1b9)](),_0x3c4588=new TextDecoder(),_0x371de5='';while(this[_0x1c67a8(0x1bc)]){let {done:_0x38b805,value:_0x23dbec}=await _0x297609[_0x1c67a8(0x1e0)]();if(_0x38b805)break;_0x371de5+=_0x3c4588[_0x1c67a8(0x1f9)](_0x23dbec,{'stream':!0x0});let _0x39d447=_0x371de5[_0x1c67a8(0x1fd)]('\x0a');_0x371de5=_0x39d447['pop']()||'';for(let _0x16a83e of _0x39d447){if(!_0x16a83e['startsWith'](_0x1c67a8(0x1c9)))continue;try{let _0x4ba2c1=JSON[_0x1c67a8(0x209)](_0x16a83e[_0x1c67a8(0x1fc)](0x6));if(_0x4ba2c1[_0x1c67a8(0x1fb)]==='connected'){this['log'](_0x1c67a8(0x1f0)),this[_0x1c67a8(0x20d)](_0x1c67a8(0x1bb));continue;}if(_0x4ba2c1[_0x1c67a8(0x1fb)]===_0x1c67a8(0x1d7)||_0x4ba2c1[_0x1c67a8(0x1fb)]===_0x1c67a8(0x1e9)||_0x4ba2c1[_0x1c67a8(0x1fb)]===_0x1c67a8(0x1d3))await this[_0x1c67a8(0x20a)]();}catch{}}}}catch(_0x40632e){if(_0x40632e['name']===_0x1c67a8(0x1db))break;this['emit'](_0x1c67a8(0x1b4),_0x40632e),this['log'](_0x1c67a8(0x1dc)+_0x40632e[_0x1c67a8(0x1cc)]);}if(this[_0x1c67a8(0x1bc)])this[_0x1c67a8(0x20d)](_0x1c67a8(0x1f5)),this[_0x1c67a8(0x1ef)](_0x1c67a8(0x1d9)+_0x3e5be0/0x3e8+_0x1c67a8(0x1e7)),await this[_0x1c67a8(0x1e4)](_0x3e5be0),_0x3e5be0=Math['min'](_0x3e5be0*1.5,0xea60);}}async[a0_0xf1c06c(0x20a)](){const _0xc52ce6=a0_0xf1c06c;try{let _0x2515a3=(await this['call'](_0xc52ce6(0x20b),{'alias':this[_0xc52ce6(0x1cd)],'limit':0xa}))?.[_0xc52ce6(0x1be)]||[];for(let _0x334a8d of _0x2515a3)await this['call'](_0xc52ce6(0x1d2),{'alias':this[_0xc52ce6(0x1cd)],'message_id':_0x334a8d['id']}),this[_0xc52ce6(0x1ef)]('←\x20'+_0x334a8d[_0xc52ce6(0x1e8)]+':\x20'+_0x334a8d['content']['slice'](0x0,0x3c)),this[_0xc52ce6(0x20d)](_0xc52ce6(0x1b5),_0x334a8d),this['emit'](_0xc52ce6(0x1cc),_0x334a8d);}catch(_0x4aadd2){this['log'](_0xc52ce6(0x1ea)+_0x4aadd2[_0xc52ce6(0x1cc)]);}}[a0_0xf1c06c(0x1e4)](_0x1b31d3){return new Promise(_0x3661e1=>setTimeout(_0x3661e1,_0x1b31d3));}}function a0_0x2fb6(_0x13ed3c,_0x1f9da5){_0x13ed3c=_0x13ed3c-0x1b3;const _0x10c166=a0_0x10c1();let _0x2fb6e8=_0x10c166[_0x13ed3c];return _0x2fb6e8;}function a0_0x10c1(){const _0x509aab=['log','SSE\x20connected','resumeId','token','toString','24856cExImL','disconnected','117EeDmKL','autoConnect','call','decode',']\x20[commhub:','type','slice','split','idle','reply','/events/','offline','report_status','20whfLXo','SSE\x20failed:\x20','104724ZLoDSu','disconnect','normal','url','parse','processInbox','get_inbox','2.0','emit','1830591SdfYRp','error','task','716712GJYvvZ','catch','heartbeatTimer','getReader','sdk','connected','running','Authorization','messages','replace','application/json','3402487xYzowj','heartbeatInterval','match','body','send_reply','heartbeat\x20failed:\x20','/mcp','result','data:\x20','sdk-','send_message','message','alias','tools/call','text','19165TAbOWU','agent','ack_inbox','broadcast','sseAbort','reconnectDelay','get_all_status','new_task','244ZWUyeI','SSE\x20reconnecting\x20in\x20','38savXng','AbortError','SSE\x20error:\x20','status','toTimeString','Bearer\x20','read','text/event-stream','connectSSE','300PBUSRe','sleep','min','80381qpLuBM','s...','from_session','new_message','inbox\x20error:\x20','1773OkknaX','completed','registered','signal'];a0_0x10c1=function(){return _0x509aab;};return a0_0x10c1();}var $=T;export{$ as default,T as CommHub};