@sleep2agi/agent-network 2.3.0-preview.27 → 2.3.0-preview.28

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_0x39040b=a0_0x83b7;(function(_0x3d9895,_0x1da5f7){const _0x56236a=a0_0x83b7,_0x47d527=_0x3d9895();while(!![]){try{const _0x439c11=-parseInt(_0x56236a(0xcb))/0x1+-parseInt(_0x56236a(0xcd))/0x2*(-parseInt(_0x56236a(0x107))/0x3)+-parseInt(_0x56236a(0x108))/0x4+parseInt(_0x56236a(0xeb))/0x5+parseInt(_0x56236a(0xfa))/0x6+parseInt(_0x56236a(0xed))/0x7*(-parseInt(_0x56236a(0xe5))/0x8)+parseInt(_0x56236a(0xe7))/0x9*(-parseInt(_0x56236a(0xf8))/0xa);if(_0x439c11===_0x1da5f7)break;else _0x47d527['push'](_0x47d527['shift']());}catch(_0x5a9b37){_0x47d527['push'](_0x47d527['shift']());}}}(a0_0x6800,0xb7804));import{EventEmitter as a0_0x72c79f}from'events';import{hostname as a0_0x128a22}from'os';function a0_0x83b7(_0x4099dd,_0x63a88c){_0x4099dd=_0x4099dd-0xb3;const _0x68007=a0_0x6800();let _0x83b7b5=_0x68007[_0x4099dd];return _0x83b7b5;}class T extends a0_0x72c79f{[a0_0x39040b(0xfc)];[a0_0x39040b(0xf4)];['token'];[a0_0x39040b(0xe8)];[a0_0x39040b(0xf6)];[a0_0x39040b(0xc8)];['reconnectDelay'];['heartbeatTimer'];[a0_0x39040b(0xdd)];['running']=!0x1;constructor(_0x28d2a3){const _0x23e39f=a0_0x39040b;super();if(this[_0x23e39f(0xfc)]=_0x28d2a3['url'][_0x23e39f(0xe2)](/\/$/,''),this[_0x23e39f(0xf4)]=_0x28d2a3[_0x23e39f(0xf4)],this[_0x23e39f(0xf9)]=_0x28d2a3[_0x23e39f(0xf9)],this[_0x23e39f(0xe8)]=_0x28d2a3['agent']||_0x23e39f(0xb8),this[_0x23e39f(0xf6)]=_0x23e39f(0xb4)+_0x28d2a3['alias']+'-'+Date[_0x23e39f(0xfd)]()[_0x23e39f(0xc5)](0x24),this[_0x23e39f(0xc8)]=_0x28d2a3[_0x23e39f(0xc8)]??0x2bf20,this[_0x23e39f(0xf5)]=_0x28d2a3[_0x23e39f(0xf5)]??0xbb8,_0x28d2a3[_0x23e39f(0xe6)]!==!0x1)this[_0x23e39f(0xc0)]();}[a0_0x39040b(0xf3)](_0x38416c){const _0x1529e6=a0_0x39040b;console[_0x1529e6(0xf3)]('['+new Date()[_0x1529e6(0xfb)]()[_0x1529e6(0x105)](0x0,0x8)+_0x1529e6(0xc3)+this[_0x1529e6(0xf4)]+']\x20'+_0x38416c);}async[a0_0x39040b(0x109)](_0x503ff9,_0x278668){const _0x482186=a0_0x39040b;let _0x4fe4dd={'Content-Type':_0x482186(0x104),'Accept':'application/json,\x20text/event-stream'};if(this[_0x482186(0xf9)])_0x4fe4dd[_0x482186(0xfe)]=_0x482186(0xe1)+this[_0x482186(0xf9)];let _0x2ad69b=await(await fetch(this[_0x482186(0xfc)]+_0x482186(0xba),{'method':_0x482186(0x106),'headers':_0x4fe4dd,'body':JSON['stringify']({'jsonrpc':_0x482186(0xd3),'id':Date[_0x482186(0xfd)](),'method':_0x482186(0xdf),'params':{'name':_0x503ff9,'arguments':_0x278668}})}))[_0x482186(0xda)](),_0x4c6347=_0x2ad69b['match'](/data: (.+)/),_0x1f3bf9=_0x4c6347?JSON[_0x482186(0xdc)](_0x4c6347[0x1]):JSON[_0x482186(0xdc)](_0x2ad69b),_0x108842=_0x1f3bf9?.[_0x482186(0xff)]?.[_0x482186(0xc4)]?.[0x0]?.[_0x482186(0xda)];return _0x108842?JSON[_0x482186(0xdc)](_0x108842):_0x1f3bf9;}async['connect'](){const _0x507dec=a0_0x39040b;if(this[_0x507dec(0x102)])return;this[_0x507dec(0x102)]=!0x0,await this[_0x507dec(0xd1)](_0x507dec(0xc7)),this['log']('registered'),this[_0x507dec(0xd0)]=setInterval(()=>{const _0x5749fe=_0x507dec;this[_0x5749fe(0xd1)](_0x5749fe(0xc7))['catch'](_0x54f549=>this[_0x5749fe(0xf3)](_0x5749fe(0xd2)+_0x54f549[_0x5749fe(0xb7)]));},this[_0x507dec(0xc8)]),this['connectSSE']();}async['disconnect'](){const _0x2b6c17=a0_0x39040b;if(this[_0x2b6c17(0x102)]=!0x1,this['sseAbort']?.[_0x2b6c17(0xd8)](),this[_0x2b6c17(0xd0)])clearInterval(this[_0x2b6c17(0xd0)]);await this[_0x2b6c17(0xd1)](_0x2b6c17(0xe4))[_0x2b6c17(0xf1)](()=>{}),this[_0x2b6c17(0xf3)]('disconnected');}async['send'](_0x24aed3,_0x192b0f,_0x306d83=a0_0x39040b(0xd4)){const _0x3a92af=a0_0x39040b;return this[_0x3a92af(0x109)](_0x3a92af(0xc2),{'alias':_0x24aed3,'task':_0x192b0f,'priority':_0x306d83,'from_session':this['alias']});}async['message'](_0x2f029e,_0x5dacc3){const _0x3a7b44=a0_0x39040b;return this[_0x3a7b44(0x109)](_0x3a7b44(0xf7),{'alias':_0x2f029e,'message':_0x5dacc3,'from_session':this[_0x3a7b44(0xf4)]});}async[a0_0x39040b(0xc6)](_0x592113,_0x5742a2,_0x2c3bbf=a0_0x39040b(0xea)){const _0x16eccb=a0_0x39040b;return this['call'](_0x16eccb(0xd9),{'in_reply_to':_0x592113,'text':_0x5742a2,'status':_0x2c3bbf});}async['status'](_0x143e91,_0x17b06e){const _0x121db4=a0_0x39040b;return this[_0x121db4(0x109)](_0x121db4(0x101),{'resume_id':this[_0x121db4(0xf6)],'alias':this[_0x121db4(0xf4)],'status':_0x143e91,'server':a0_0x128a22(),'hostname':a0_0x128a22(),'agent':this[_0x121db4(0xe8)],'project_dir':process[_0x121db4(0xcf)](),..._0x17b06e});}async[a0_0x39040b(0xe0)](){const _0x40ba54=a0_0x39040b;return this[_0x40ba54(0x109)]('get_all_status',{});}async[a0_0x39040b(0xc1)](_0x330e12,_0x19fbbf){const _0xd4ee60=a0_0x39040b;return this[_0xd4ee60(0x109)](_0xd4ee60(0xc1),{'message':_0x330e12,'filter_server':_0x19fbbf?.[_0xd4ee60(0xb5)],'filter_status':_0x19fbbf?.[_0xd4ee60(0xd1)]});}async[a0_0x39040b(0xb3)](){const _0x168cba=a0_0x39040b;let _0x2b2e0e=encodeURIComponent(this[_0x168cba(0xf4)]),_0x3e799d=this[_0x168cba(0xfc)]+'/events/'+_0x2b2e0e,_0x38efbc=this[_0x168cba(0xf5)];while(this[_0x168cba(0x102)]){try{this[_0x168cba(0xdd)]=new AbortController();let _0x1003f6={'Accept':_0x168cba(0xf2)};if(this[_0x168cba(0xf9)])_0x1003f6[_0x168cba(0xfe)]=_0x168cba(0xe1)+this[_0x168cba(0xf9)];let _0x451ca2=await fetch(_0x3e799d,{'headers':_0x1003f6,'signal':this[_0x168cba(0xdd)][_0x168cba(0xe9)]});if(!_0x451ca2['ok']||!_0x451ca2[_0x168cba(0xc9)]){this[_0x168cba(0xf3)](_0x168cba(0xee)+_0x451ca2[_0x168cba(0xd1)]),await this['sleep'](_0x38efbc),_0x38efbc=Math['min'](_0x38efbc*1.5,0xea60);continue;}_0x38efbc=this[_0x168cba(0xf5)];let _0x467679=_0x451ca2[_0x168cba(0xc9)]['getReader'](),_0x1fe17d=new TextDecoder(),_0x19ee25='';while(this[_0x168cba(0x102)]){let {done:_0xdc7ac5,value:_0xd8036}=await _0x467679[_0x168cba(0xb6)]();if(_0xdc7ac5)break;_0x19ee25+=_0x1fe17d[_0x168cba(0xef)](_0xd8036,{'stream':!0x0});let _0x4134c1=_0x19ee25[_0x168cba(0xec)]('\x0a');_0x19ee25=_0x4134c1[_0x168cba(0xbe)]()||'';for(let _0x547216 of _0x4134c1){if(!_0x547216[_0x168cba(0xbb)](_0x168cba(0xbd)))continue;try{let _0xd8573d=JSON[_0x168cba(0xdc)](_0x547216[_0x168cba(0x105)](0x6));if(_0xd8573d[_0x168cba(0xb9)]==='connected'){this[_0x168cba(0xf3)]('SSE\x20connected'),this[_0x168cba(0xf0)]('connected');continue;}if(_0xd8573d['type']===_0x168cba(0xd5)||_0xd8573d['type']===_0x168cba(0xbf)||_0xd8573d['type']===_0x168cba(0xc1))await this[_0x168cba(0xd6)]();}catch{}}}}catch(_0x76544a){if(_0x76544a[_0x168cba(0xdb)]===_0x168cba(0xbc))break;this[_0x168cba(0xf0)]('error',_0x76544a),this[_0x168cba(0xf3)](_0x168cba(0xe3)+_0x76544a[_0x168cba(0xb7)]);}if(this[_0x168cba(0x102)])this[_0x168cba(0xf0)](_0x168cba(0xca)),this[_0x168cba(0xf3)]('SSE\x20reconnecting\x20in\x20'+_0x38efbc/0x3e8+'s...'),await this['sleep'](_0x38efbc),_0x38efbc=Math[_0x168cba(0xde)](_0x38efbc*1.5,0xea60);}}async[a0_0x39040b(0xd6)](){const _0x1d0c4c=a0_0x39040b;try{let _0x516bb7=(await this[_0x1d0c4c(0x109)](_0x1d0c4c(0x100),{'alias':this[_0x1d0c4c(0xf4)],'limit':0xa}))?.[_0x1d0c4c(0xd7)]||[];for(let _0x2d7ff2 of _0x516bb7)await this[_0x1d0c4c(0x109)](_0x1d0c4c(0x103),{'alias':this[_0x1d0c4c(0xf4)],'message_id':_0x2d7ff2['id']}),this[_0x1d0c4c(0xf3)]('←\x20'+_0x2d7ff2[_0x1d0c4c(0xcc)]+':\x20'+_0x2d7ff2[_0x1d0c4c(0xc4)][_0x1d0c4c(0x105)](0x0,0x3c)),this[_0x1d0c4c(0xf0)]('task',_0x2d7ff2),this['emit'](_0x1d0c4c(0xb7),_0x2d7ff2);}catch(_0x49cb9c){this[_0x1d0c4c(0xf3)](_0x1d0c4c(0xce)+_0x49cb9c[_0x1d0c4c(0xb7)]);}}['sleep'](_0x32e54e){return new Promise(_0x493b64=>setTimeout(_0x493b64,_0x32e54e));}}function a0_0x6800(){const _0x5745bb=['signal','completed','423660GDjeqU','split','171332ZuXwpb','SSE\x20failed:\x20','decode','emit','catch','text/event-stream','log','alias','reconnectDelay','resumeId','send_message','60pnXDEj','token','5749638dLjXbO','toTimeString','url','now','Authorization','result','get_inbox','report_status','running','ack_inbox','application/json','slice','POST','93723yHyEix','164760amRLki','call','connectSSE','sdk-','server','read','message','sdk','type','/mcp','startsWith','AbortError','data:\x20','pop','new_message','connect','broadcast','send_task',']\x20[commhub:','content','toString','reply','idle','heartbeatInterval','body','disconnected','327932mZSOHZ','from_session','94gvhBQl','inbox\x20error:\x20','cwd','heartbeatTimer','status','heartbeat\x20failed:\x20','2.0','normal','new_task','processInbox','messages','abort','send_reply','text','name','parse','sseAbort','min','tools/call','getAllStatus','Bearer\x20','replace','SSE\x20error:\x20','offline','24LrbntV','autoConnect','1975743NlnNmf','agent'];a0_0x6800=function(){return _0x5745bb;};return a0_0x6800();}var $=T;export{$ as default,T as CommHub};
1
+ const a0_0x594ba2=a0_0x5a88;(function(_0x4b764d,_0x2d1e14){const _0x593750=a0_0x5a88,_0x1d2280=_0x4b764d();while(!![]){try{const _0x2cc4a1=parseInt(_0x593750(0x15c))/0x1*(-parseInt(_0x593750(0x175))/0x2)+parseInt(_0x593750(0x136))/0x3*(-parseInt(_0x593750(0x143))/0x4)+parseInt(_0x593750(0x157))/0x5*(parseInt(_0x593750(0x17c))/0x6)+parseInt(_0x593750(0x15f))/0x7*(-parseInt(_0x593750(0x134))/0x8)+-parseInt(_0x593750(0x186))/0x9*(parseInt(_0x593750(0x160))/0xa)+-parseInt(_0x593750(0x15a))/0xb*(-parseInt(_0x593750(0x13c))/0xc)+parseInt(_0x593750(0x13e))/0xd*(parseInt(_0x593750(0x12f))/0xe);if(_0x2cc4a1===_0x2d1e14)break;else _0x1d2280['push'](_0x1d2280['shift']());}catch(_0x3dfae7){_0x1d2280['push'](_0x1d2280['shift']());}}}(a0_0x57b9,0x72f78));function a0_0x57b9(){const _0x222a26=['/events/','sdk','parse','SSE\x20error:\x20','sseAbort','reply','error','s...','running','2533070XmcIWY','text/event-stream','idle','55SEOicz','autoConnect','1RyZPvI','/mcp','disconnect','9289ZQDcIO','430GjoZlp','heartbeatInterval','SSE\x20reconnecting\x20in\x20','heartbeatTimer','messages','connected','connectSSE','send_message','Authorization','match','text','Bearer\x20','message','content','broadcast','connect','split','now','server','toTimeString','offline','1537994jcLiQT','min','completed','resumeId','get_inbox','data:\x20','tools/call','6aoFAVA','new_task','catch','name','emit','signal','processInbox','send','SSE\x20connected','task','142407pCFBFk','disconnected','1050rPFClq','url','agent','status','SSE\x20failed:\x20','5584nLxqTn','call','621597dNEjnh','inbox\x20error:\x20','POST','AbortError','alias','type','2082648BMfxFY','normal','327002wDJiUg','sleep','2.0','new_message','result','8SLqXMY','token','send_task',']\x20[commhub:','log','stringify','reconnectDelay','cwd','heartbeat\x20failed:\x20','slice','read'];a0_0x57b9=function(){return _0x222a26;};return a0_0x57b9();}import{EventEmitter as a0_0x2e46ec}from'events';import{hostname as a0_0x216e53}from'os';function a0_0x5a88(_0x4e3c6f,_0x2c886c){_0x4e3c6f=_0x4e3c6f-0x12f;const _0x57b909=a0_0x57b9();let _0x5a88be=_0x57b909[_0x4e3c6f];return _0x5a88be;}class T extends a0_0x2e46ec{[a0_0x594ba2(0x130)];[a0_0x594ba2(0x13a)];['token'];[a0_0x594ba2(0x131)];[a0_0x594ba2(0x178)];[a0_0x594ba2(0x161)];['reconnectDelay'];[a0_0x594ba2(0x163)];['sseAbort'];[a0_0x594ba2(0x156)]=!0x1;constructor(_0x52ba96){const _0x2f5b86=a0_0x594ba2;super();if(this[_0x2f5b86(0x130)]=_0x52ba96[_0x2f5b86(0x130)]['replace'](/\/$/,''),this[_0x2f5b86(0x13a)]=_0x52ba96['alias'],this[_0x2f5b86(0x144)]=_0x52ba96[_0x2f5b86(0x144)],this['agent']=_0x52ba96[_0x2f5b86(0x131)]||_0x2f5b86(0x14f),this['resumeId']='sdk-'+_0x52ba96[_0x2f5b86(0x13a)]+'-'+Date[_0x2f5b86(0x171)]()['toString'](0x24),this['heartbeatInterval']=_0x52ba96[_0x2f5b86(0x161)]??0x2bf20,this['reconnectDelay']=_0x52ba96[_0x2f5b86(0x149)]??0xbb8,_0x52ba96[_0x2f5b86(0x15b)]!==!0x1)this[_0x2f5b86(0x16f)]();}[a0_0x594ba2(0x147)](_0x3674ac){const _0x4165c3=a0_0x594ba2;console['log']('['+new Date()[_0x4165c3(0x173)]()[_0x4165c3(0x14c)](0x0,0x8)+_0x4165c3(0x146)+this[_0x4165c3(0x13a)]+']\x20'+_0x3674ac);}async[a0_0x594ba2(0x135)](_0x4a1261,_0x48ee4a){const _0x22cfa1=a0_0x594ba2;let _0x18c233={'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream'};if(this[_0x22cfa1(0x144)])_0x18c233[_0x22cfa1(0x168)]='Bearer\x20'+this[_0x22cfa1(0x144)];let _0x31e4fe=await(await fetch(this[_0x22cfa1(0x130)]+_0x22cfa1(0x15d),{'method':_0x22cfa1(0x138),'headers':_0x18c233,'body':JSON[_0x22cfa1(0x148)]({'jsonrpc':_0x22cfa1(0x140),'id':Date[_0x22cfa1(0x171)](),'method':_0x22cfa1(0x17b),'params':{'name':_0x4a1261,'arguments':_0x48ee4a}})}))[_0x22cfa1(0x16a)](),_0x4d1ab2=_0x31e4fe[_0x22cfa1(0x169)](/data: (.+)/),_0x4ad537=_0x4d1ab2?JSON['parse'](_0x4d1ab2[0x1]):JSON[_0x22cfa1(0x150)](_0x31e4fe),_0x4badcc=_0x4ad537?.[_0x22cfa1(0x142)]?.[_0x22cfa1(0x16d)]?.[0x0]?.[_0x22cfa1(0x16a)];return _0x4badcc?JSON[_0x22cfa1(0x150)](_0x4badcc):_0x4ad537;}async[a0_0x594ba2(0x16f)](){const _0x3d0b35=a0_0x594ba2;if(this[_0x3d0b35(0x156)])return;this[_0x3d0b35(0x156)]=!0x0,await this['status'](_0x3d0b35(0x159)),this[_0x3d0b35(0x147)]('registered'),this['heartbeatTimer']=setInterval(()=>{const _0x5a6dcd=_0x3d0b35;this[_0x5a6dcd(0x132)](_0x5a6dcd(0x159))['catch'](_0x45a269=>this[_0x5a6dcd(0x147)](_0x5a6dcd(0x14b)+_0x45a269[_0x5a6dcd(0x16c)]));},this[_0x3d0b35(0x161)]),this[_0x3d0b35(0x166)]();}async[a0_0x594ba2(0x15e)](){const _0x430266=a0_0x594ba2;if(this[_0x430266(0x156)]=!0x1,this[_0x430266(0x152)]?.['abort'](),this[_0x430266(0x163)])clearInterval(this[_0x430266(0x163)]);await this[_0x430266(0x132)](_0x430266(0x174))[_0x430266(0x17e)](()=>{}),this[_0x430266(0x147)](_0x430266(0x187));}async[a0_0x594ba2(0x183)](_0x568577,_0x5a409d,_0x418b3e=a0_0x594ba2(0x13d)){const _0x3ab2be=a0_0x594ba2;return this['call'](_0x3ab2be(0x145),{'alias':_0x568577,'task':_0x5a409d,'priority':_0x418b3e,'from_session':this['alias']});}async[a0_0x594ba2(0x16c)](_0x32f41a,_0x1ffe74){const _0x43fa69=a0_0x594ba2;return this['call'](_0x43fa69(0x167),{'alias':_0x32f41a,'message':_0x1ffe74,'from_session':this[_0x43fa69(0x13a)]});}async[a0_0x594ba2(0x153)](_0x4ec8ca,_0x4ce4ef,_0x598710=a0_0x594ba2(0x177)){return this['call']('send_reply',{'in_reply_to':_0x4ec8ca,'text':_0x4ce4ef,'status':_0x598710});}async[a0_0x594ba2(0x132)](_0x5ca2cc,_0x590a45){const _0x3eb0d0=a0_0x594ba2;return this[_0x3eb0d0(0x135)]('report_status',{'resume_id':this[_0x3eb0d0(0x178)],'alias':this[_0x3eb0d0(0x13a)],'status':_0x5ca2cc,'server':a0_0x216e53(),'hostname':a0_0x216e53(),'agent':this[_0x3eb0d0(0x131)],'project_dir':process[_0x3eb0d0(0x14a)](),..._0x590a45});}async['getAllStatus'](){const _0x149697=a0_0x594ba2;return this[_0x149697(0x135)]('get_all_status',{});}async[a0_0x594ba2(0x16e)](_0x4b0330,_0x7a19d7){const _0x3598d7=a0_0x594ba2;return this['call'](_0x3598d7(0x16e),{'message':_0x4b0330,'filter_server':_0x7a19d7?.[_0x3598d7(0x172)],'filter_status':_0x7a19d7?.[_0x3598d7(0x132)]});}async[a0_0x594ba2(0x166)](){const _0x5aade6=a0_0x594ba2;let _0xcf14da=encodeURIComponent(this[_0x5aade6(0x13a)]),_0x2f51f2=this[_0x5aade6(0x130)]+_0x5aade6(0x14e)+_0xcf14da,_0x5555f5=this['reconnectDelay'];while(this[_0x5aade6(0x156)]){try{this[_0x5aade6(0x152)]=new AbortController();let _0x33c577={'Accept':_0x5aade6(0x158)};if(this[_0x5aade6(0x144)])_0x33c577[_0x5aade6(0x168)]=_0x5aade6(0x16b)+this[_0x5aade6(0x144)];let _0x150625=await fetch(_0x2f51f2,{'headers':_0x33c577,'signal':this[_0x5aade6(0x152)][_0x5aade6(0x181)]});if(!_0x150625['ok']||!_0x150625['body']){this[_0x5aade6(0x147)](_0x5aade6(0x133)+_0x150625[_0x5aade6(0x132)]),await this[_0x5aade6(0x13f)](_0x5555f5),_0x5555f5=Math[_0x5aade6(0x176)](_0x5555f5*1.5,0xea60);continue;}_0x5555f5=this[_0x5aade6(0x149)];let _0x3dab86=_0x150625['body']['getReader'](),_0x2f49f7=new TextDecoder(),_0x3042e7='';while(this[_0x5aade6(0x156)]){let {done:_0x5990ed,value:_0x486889}=await _0x3dab86[_0x5aade6(0x14d)]();if(_0x5990ed)break;_0x3042e7+=_0x2f49f7['decode'](_0x486889,{'stream':!0x0});let _0x2221b7=_0x3042e7[_0x5aade6(0x170)]('\x0a');_0x3042e7=_0x2221b7['pop']()||'';for(let _0x2d29b6 of _0x2221b7){if(!_0x2d29b6['startsWith'](_0x5aade6(0x17a)))continue;try{let _0x39fff3=JSON[_0x5aade6(0x150)](_0x2d29b6['slice'](0x6));if(_0x39fff3[_0x5aade6(0x13b)]===_0x5aade6(0x165)){this['log'](_0x5aade6(0x184)),this[_0x5aade6(0x180)](_0x5aade6(0x165));continue;}if(_0x39fff3[_0x5aade6(0x13b)]===_0x5aade6(0x17d)||_0x39fff3[_0x5aade6(0x13b)]===_0x5aade6(0x141)||_0x39fff3[_0x5aade6(0x13b)]===_0x5aade6(0x16e))await this[_0x5aade6(0x182)]();}catch{}}}}catch(_0x4b9573){if(_0x4b9573[_0x5aade6(0x17f)]===_0x5aade6(0x139))break;this[_0x5aade6(0x180)](_0x5aade6(0x154),_0x4b9573),this[_0x5aade6(0x147)](_0x5aade6(0x151)+_0x4b9573[_0x5aade6(0x16c)]);}if(this[_0x5aade6(0x156)])this[_0x5aade6(0x180)]('disconnected'),this[_0x5aade6(0x147)](_0x5aade6(0x162)+_0x5555f5/0x3e8+_0x5aade6(0x155)),await this[_0x5aade6(0x13f)](_0x5555f5),_0x5555f5=Math['min'](_0x5555f5*1.5,0xea60);}}async[a0_0x594ba2(0x182)](){const _0x1a2460=a0_0x594ba2;try{let _0x1d16e2=(await this[_0x1a2460(0x135)](_0x1a2460(0x179),{'alias':this['alias'],'limit':0xa}))?.[_0x1a2460(0x164)]||[];for(let _0xcd9da4 of _0x1d16e2)await this[_0x1a2460(0x135)]('ack_inbox',{'alias':this['alias'],'message_id':_0xcd9da4['id']}),this['log']('←\x20'+_0xcd9da4['from_session']+':\x20'+_0xcd9da4['content']['slice'](0x0,0x3c)),this[_0x1a2460(0x180)](_0x1a2460(0x185),_0xcd9da4),this[_0x1a2460(0x180)](_0x1a2460(0x16c),_0xcd9da4);}catch(_0x463c14){this[_0x1a2460(0x147)](_0x1a2460(0x137)+_0x463c14[_0x1a2460(0x16c)]);}}['sleep'](_0x304ab2){return new Promise(_0x283b8d=>setTimeout(_0x283b8d,_0x304ab2));}}var $=T;export{$ as default,T as CommHub};
@@ -0,0 +1,17 @@
1
+ /** Exact RFC-030 release pair validated against the real WebSocket wire. */
2
+ export declare const CODEX_APP_SERVER_CLI_VERSION = "0.144.0";
3
+ export declare const CODEX_APP_SERVER_AGENT_NODE_VERSION = "2.5.0-preview.24";
4
+ export declare const CODEX_APP_SERVER_AGENT_NODE_SPEC = "@sleep2agi/agent-node@2.5.0-preview.24";
5
+ export declare function codexAppServerCliVersion(output: string): string | null;
6
+ export declare function agentNodeHelpSupportsCodexAppServer(help: string): boolean;
7
+ export declare function codexAppServerExactInstallCommand(): string;
8
+ export interface CodexNativeIdentity {
9
+ binary: string;
10
+ packageRoot: string;
11
+ version: string;
12
+ }
13
+ /**
14
+ * Resolve the native executable from an exact global npm package root. The
15
+ * JS/npm shim is never executed with the node token in its environment.
16
+ */
17
+ export declare function resolveCodexNativeIdentity(npmGlobalRoot: string, expectedVersion?: string, platform?: NodeJS.Platform, arch?: NodeJS.Architecture): CodexNativeIdentity;