@sleep2agi/agent-network 2.1.8-preview.5 → 2.1.8-preview.6

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_0x5dc79c=a0_0x4301;(function(_0x10c6fa,_0x59e1a6){const _0x1957e8=a0_0x4301,_0x4b76cf=_0x10c6fa();while(!![]){try{const _0x19d3c0=-parseInt(_0x1957e8(0x163))/0x1*(-parseInt(_0x1957e8(0x147))/0x2)+parseInt(_0x1957e8(0x155))/0x3+parseInt(_0x1957e8(0x165))/0x4*(parseInt(_0x1957e8(0x120))/0x5)+parseInt(_0x1957e8(0x159))/0x6*(parseInt(_0x1957e8(0x14f))/0x7)+-parseInt(_0x1957e8(0x142))/0x8+parseInt(_0x1957e8(0x162))/0x9+-parseInt(_0x1957e8(0x13b))/0xa;if(_0x19d3c0===_0x59e1a6)break;else _0x4b76cf['push'](_0x4b76cf['shift']());}catch(_0x12d939){_0x4b76cf['push'](_0x4b76cf['shift']());}}}(a0_0x5d22,0xebc8d));import{EventEmitter as a0_0x3e8536}from'events';function a0_0x5d22(){const _0x7039fc=['result','tools/call','body','status','min','5tMzjCJ','broadcast','inbox\x20error:\x20','slice','from_session','SSE\x20reconnecting\x20in\x20','match','get_all_status','heartbeatTimer','sdk-','Bearer\x20','now','replace','sseAbort','getReader','send_message','s...','data:\x20','report_status','reconnectDelay','token','resumeId','AbortError','toTimeString','alias','emit','processInbox','36685480ZVYlgD','messages','heartbeat\x20failed:\x20','toString','read','agent','type','4719464rizHUZ','message','autoConnect','sdk','2.0','296156qLjeZz','idle','split','log','startsWith','error','heartbeatInterval','application/json','182UjrURN','send','get_inbox','url','running','stringify','466365oVXIFS','send_reply','name','offline','378006kXRbrk','call','abort','connectSSE','ack_inbox','new_task','sleep','registered','text','16544943niKiOC','8dBeyjA','catch','1631288PoHUCJ','connect','normal','server','/events/','new_message','parse','completed','disconnect','content','reply','connected','disconnected'];a0_0x5d22=function(){return _0x7039fc;};return a0_0x5d22();}import{hostname as a0_0x140ec7}from'os';function a0_0x4301(_0x8bcef,_0x40f219){_0x8bcef=_0x8bcef-0x11d;const _0x5d223d=a0_0x5d22();let _0x4301a0=_0x5d223d[_0x8bcef];return _0x4301a0;}class T extends a0_0x3e8536{[a0_0x5dc79c(0x152)];[a0_0x5dc79c(0x138)];['token'];[a0_0x5dc79c(0x140)];[a0_0x5dc79c(0x135)];[a0_0x5dc79c(0x14d)];[a0_0x5dc79c(0x133)];[a0_0x5dc79c(0x128)];[a0_0x5dc79c(0x12d)];['running']=!0x1;constructor(_0x4f5066){const _0x248b26=a0_0x5dc79c;super();if(this[_0x248b26(0x152)]=_0x4f5066['url'][_0x248b26(0x12c)](/\/$/,''),this[_0x248b26(0x138)]=_0x4f5066[_0x248b26(0x138)],this['token']=_0x4f5066[_0x248b26(0x134)],this['agent']=_0x4f5066[_0x248b26(0x140)]||_0x248b26(0x145),this[_0x248b26(0x135)]=_0x248b26(0x129)+_0x4f5066[_0x248b26(0x138)]+'-'+Date[_0x248b26(0x12b)]()[_0x248b26(0x13e)](0x24),this[_0x248b26(0x14d)]=_0x4f5066[_0x248b26(0x14d)]??0x2bf20,this[_0x248b26(0x133)]=_0x4f5066[_0x248b26(0x133)]??0xbb8,_0x4f5066[_0x248b26(0x144)]!==!0x1)this[_0x248b26(0x166)]();}[a0_0x5dc79c(0x14a)](_0x31778a){const _0x5646dc=a0_0x5dc79c;console[_0x5646dc(0x14a)]('['+new Date()[_0x5646dc(0x137)]()[_0x5646dc(0x123)](0x0,0x8)+']\x20[commhub:'+this[_0x5646dc(0x138)]+']\x20'+_0x31778a);}async[a0_0x5dc79c(0x15a)](_0x1fd20f,_0x4a59d5){const _0x5a5ab4=a0_0x5dc79c;let _0x54abb8={'Content-Type':_0x5a5ab4(0x14e),'Accept':'application/json,\x20text/event-stream'};if(this[_0x5a5ab4(0x134)])_0x54abb8['Authorization']=_0x5a5ab4(0x12a)+this[_0x5a5ab4(0x134)];let _0x2c4ead=await(await fetch(this[_0x5a5ab4(0x152)]+'/mcp',{'method':'POST','headers':_0x54abb8,'body':JSON[_0x5a5ab4(0x154)]({'jsonrpc':_0x5a5ab4(0x146),'id':Date[_0x5a5ab4(0x12b)](),'method':_0x5a5ab4(0x173),'params':{'name':_0x1fd20f,'arguments':_0x4a59d5}})}))[_0x5a5ab4(0x161)](),_0x49b561=_0x2c4ead[_0x5a5ab4(0x126)](/data: (.+)/),_0x2f1d64=_0x49b561?JSON[_0x5a5ab4(0x16b)](_0x49b561[0x1]):JSON[_0x5a5ab4(0x16b)](_0x2c4ead),_0x5b465c=_0x2f1d64?.[_0x5a5ab4(0x172)]?.[_0x5a5ab4(0x16e)]?.[0x0]?.[_0x5a5ab4(0x161)];return _0x5b465c?JSON[_0x5a5ab4(0x16b)](_0x5b465c):_0x2f1d64;}async[a0_0x5dc79c(0x166)](){const _0x9efd87=a0_0x5dc79c;if(this[_0x9efd87(0x153)])return;this[_0x9efd87(0x153)]=!0x0,await this[_0x9efd87(0x11e)](_0x9efd87(0x148)),this['log'](_0x9efd87(0x160)),this[_0x9efd87(0x128)]=setInterval(()=>{const _0x55c887=_0x9efd87;this['status'](_0x55c887(0x148))[_0x55c887(0x164)](_0x3fbc5e=>this['log'](_0x55c887(0x13d)+_0x3fbc5e[_0x55c887(0x143)]));},this['heartbeatInterval']),this[_0x9efd87(0x15c)]();}async[a0_0x5dc79c(0x16d)](){const _0x2bc3fa=a0_0x5dc79c;if(this[_0x2bc3fa(0x153)]=!0x1,this[_0x2bc3fa(0x12d)]?.[_0x2bc3fa(0x15b)](),this[_0x2bc3fa(0x128)])clearInterval(this[_0x2bc3fa(0x128)]);await this[_0x2bc3fa(0x11e)](_0x2bc3fa(0x158))['catch'](()=>{}),this[_0x2bc3fa(0x14a)](_0x2bc3fa(0x171));}async[a0_0x5dc79c(0x150)](_0x4180ea,_0xc140e0,_0x5dcb5b=a0_0x5dc79c(0x167)){const _0x4bfeef=a0_0x5dc79c;return this[_0x4bfeef(0x15a)]('send_task',{'alias':_0x4180ea,'task':_0xc140e0,'priority':_0x5dcb5b,'from_session':this['alias']});}async[a0_0x5dc79c(0x143)](_0x1434e0,_0x3bee5f){const _0x20c1af=a0_0x5dc79c;return this[_0x20c1af(0x15a)](_0x20c1af(0x12f),{'alias':_0x1434e0,'message':_0x3bee5f,'from_session':this[_0x20c1af(0x138)]});}async[a0_0x5dc79c(0x16f)](_0x1d3c0a,_0x1ca814,_0x424199=a0_0x5dc79c(0x16c)){const _0x2771cb=a0_0x5dc79c;return this[_0x2771cb(0x15a)](_0x2771cb(0x156),{'in_reply_to':_0x1d3c0a,'text':_0x1ca814,'status':_0x424199});}async[a0_0x5dc79c(0x11e)](_0x170bc8,_0x43cfe0){const _0x599c4f=a0_0x5dc79c;return this[_0x599c4f(0x15a)](_0x599c4f(0x132),{'resume_id':this[_0x599c4f(0x135)],'alias':this['alias'],'status':_0x170bc8,'server':a0_0x140ec7(),'hostname':a0_0x140ec7(),'agent':this['agent'],'project_dir':process['cwd'](),..._0x43cfe0});}async['getAllStatus'](){const _0x5f30a9=a0_0x5dc79c;return this[_0x5f30a9(0x15a)](_0x5f30a9(0x127),{});}async[a0_0x5dc79c(0x121)](_0x394364,_0x28a1d3){const _0x201c3c=a0_0x5dc79c;return this['call'](_0x201c3c(0x121),{'message':_0x394364,'filter_server':_0x28a1d3?.[_0x201c3c(0x168)],'filter_status':_0x28a1d3?.[_0x201c3c(0x11e)]});}async[a0_0x5dc79c(0x15c)](){const _0x3f0954=a0_0x5dc79c;let _0x400fe9=encodeURIComponent(this[_0x3f0954(0x138)]),_0x5eb832=this[_0x3f0954(0x152)]+_0x3f0954(0x169)+_0x400fe9,_0x3135f1=this[_0x3f0954(0x133)];while(this[_0x3f0954(0x153)]){try{this['sseAbort']=new AbortController();let _0x5bdad2={'Accept':'text/event-stream'};if(this[_0x3f0954(0x134)])_0x5bdad2['Authorization']=_0x3f0954(0x12a)+this[_0x3f0954(0x134)];let _0x57d941=await fetch(_0x5eb832,{'headers':_0x5bdad2,'signal':this['sseAbort']['signal']});if(!_0x57d941['ok']||!_0x57d941[_0x3f0954(0x11d)]){this[_0x3f0954(0x14a)]('SSE\x20failed:\x20'+_0x57d941[_0x3f0954(0x11e)]),await this[_0x3f0954(0x15f)](_0x3135f1),_0x3135f1=Math[_0x3f0954(0x11f)](_0x3135f1*1.5,0xea60);continue;}_0x3135f1=this[_0x3f0954(0x133)];let _0x758e50=_0x57d941[_0x3f0954(0x11d)][_0x3f0954(0x12e)](),_0x452889=new TextDecoder(),_0x52b9ef='';while(this[_0x3f0954(0x153)]){let {done:_0x425792,value:_0x5aaf12}=await _0x758e50[_0x3f0954(0x13f)]();if(_0x425792)break;_0x52b9ef+=_0x452889['decode'](_0x5aaf12,{'stream':!0x0});let _0x54744a=_0x52b9ef[_0x3f0954(0x149)]('\x0a');_0x52b9ef=_0x54744a['pop']()||'';for(let _0x3f4b57 of _0x54744a){if(!_0x3f4b57[_0x3f0954(0x14b)](_0x3f0954(0x131)))continue;try{let _0x54bf9d=JSON[_0x3f0954(0x16b)](_0x3f4b57[_0x3f0954(0x123)](0x6));if(_0x54bf9d[_0x3f0954(0x141)]==='connected'){this[_0x3f0954(0x14a)]('SSE\x20connected'),this[_0x3f0954(0x139)](_0x3f0954(0x170));continue;}if(_0x54bf9d[_0x3f0954(0x141)]===_0x3f0954(0x15e)||_0x54bf9d[_0x3f0954(0x141)]===_0x3f0954(0x16a)||_0x54bf9d[_0x3f0954(0x141)]===_0x3f0954(0x121))await this['processInbox']();}catch{}}}}catch(_0x201d4c){if(_0x201d4c[_0x3f0954(0x157)]===_0x3f0954(0x136))break;this['emit'](_0x3f0954(0x14c),_0x201d4c),this['log']('SSE\x20error:\x20'+_0x201d4c[_0x3f0954(0x143)]);}if(this[_0x3f0954(0x153)])this[_0x3f0954(0x139)](_0x3f0954(0x171)),this['log'](_0x3f0954(0x125)+_0x3135f1/0x3e8+_0x3f0954(0x130)),await this['sleep'](_0x3135f1),_0x3135f1=Math[_0x3f0954(0x11f)](_0x3135f1*1.5,0xea60);}}async[a0_0x5dc79c(0x13a)](){const _0x5827ff=a0_0x5dc79c;try{let _0x5d9967=(await this[_0x5827ff(0x15a)](_0x5827ff(0x151),{'alias':this[_0x5827ff(0x138)],'limit':0xa}))?.[_0x5827ff(0x13c)]||[];for(let _0x4bbcc9 of _0x5d9967)await this[_0x5827ff(0x15a)](_0x5827ff(0x15d),{'alias':this[_0x5827ff(0x138)],'message_id':_0x4bbcc9['id']}),this[_0x5827ff(0x14a)]('←\x20'+_0x4bbcc9[_0x5827ff(0x124)]+':\x20'+_0x4bbcc9[_0x5827ff(0x16e)][_0x5827ff(0x123)](0x0,0x3c)),this[_0x5827ff(0x139)]('task',_0x4bbcc9),this[_0x5827ff(0x139)](_0x5827ff(0x143),_0x4bbcc9);}catch(_0x36a609){this[_0x5827ff(0x14a)](_0x5827ff(0x122)+_0x36a609['message']);}}[a0_0x5dc79c(0x15f)](_0x741319){return new Promise(_0x1968d5=>setTimeout(_0x1968d5,_0x741319));}}var $=T;export{$ as default,T as CommHub};
1
+ const a0_0x48c2d0=a0_0x213e;function a0_0x5111(){const _0x27d8c9=['token','new_task','cwd','toTimeString','POST','send','text','sleep','normal','394345zlipdE','connect','url','name','toString','catch','SSE\x20error:\x20','s...','get_all_status','agent','send_task','disconnect','parse','startsWith','heartbeatTimer','match','stringify','slice','connectSSE',']\x20[commhub:','min','read','2.0','/mcp','reconnectDelay','resumeId','text/event-stream','getAllStatus','status','pop','1631415vkidvH','992133WroLCT','running','server','1046296cFIhTe','42ydfUDN','SSE\x20reconnecting\x20in\x20','Bearer\x20','broadcast','SSE\x20connected','2782472FarLdG','processInbox','SSE\x20failed:\x20','new_message','message','emit','type','send_reply','alias','reply','getReader','application/json,\x20text/event-stream','inbox\x20error:\x20','content','result','signal','registered','heartbeatInterval','32IdLbFL','23990fGinGn','log','Authorization','data:\x20','disconnected','call','send_message','connected','completed','sseAbort','from_session','now','idle','get_inbox','1295610fAiPOD','abort','error','1EabHLA','5357VSPrYx','ack_inbox'];a0_0x5111=function(){return _0x27d8c9;};return a0_0x5111();}(function(_0x2a2d55,_0x2a1a70){const _0x12400e=a0_0x213e,_0x16b404=_0x2a2d55();while(!![]){try{const _0x5378e6=-parseInt(_0x12400e(0xf2))/0x1*(parseInt(_0x12400e(0xef))/0x2)+parseInt(_0x12400e(0xc4))/0x3+parseInt(_0x12400e(0xc8))/0x4+-parseInt(_0x12400e(0xfe))/0x5*(-parseInt(_0x12400e(0xc9))/0x6)+parseInt(_0x12400e(0xce))/0x7+parseInt(_0x12400e(0xe0))/0x8*(parseInt(_0x12400e(0xc5))/0x9)+parseInt(_0x12400e(0xe1))/0xa*(-parseInt(_0x12400e(0xf3))/0xb);if(_0x5378e6===_0x2a1a70)break;else _0x16b404['push'](_0x16b404['shift']());}catch(_0x5a6a21){_0x16b404['push'](_0x16b404['shift']());}}}(a0_0x5111,0x5cb8c));import{EventEmitter as a0_0xb03f49}from'events';import{hostname as a0_0x45c2e0}from'os';function a0_0x213e(_0x32e045,_0x1aefc3){_0x32e045=_0x32e045-0xab;const _0x511159=a0_0x5111();let _0x213ef5=_0x511159[_0x32e045];return _0x213ef5;}class T extends a0_0xb03f49{[a0_0x48c2d0(0x100)];['alias'];[a0_0x48c2d0(0xf5)];[a0_0x48c2d0(0xaf)];['resumeId'];['heartbeatInterval'];['reconnectDelay'];[a0_0x48c2d0(0xb4)];[a0_0x48c2d0(0xea)];[a0_0x48c2d0(0xc6)]=!0x1;constructor(_0x1a76f7){const _0x599e3d=a0_0x48c2d0;super();if(this['url']=_0x1a76f7[_0x599e3d(0x100)]['replace'](/\/$/,''),this[_0x599e3d(0xd6)]=_0x1a76f7[_0x599e3d(0xd6)],this['token']=_0x1a76f7[_0x599e3d(0xf5)],this[_0x599e3d(0xaf)]=_0x1a76f7['agent']||'sdk',this[_0x599e3d(0xbf)]='sdk-'+_0x1a76f7['alias']+'-'+Date[_0x599e3d(0xec)]()[_0x599e3d(0x102)](0x24),this[_0x599e3d(0xdf)]=_0x1a76f7['heartbeatInterval']??0x2bf20,this[_0x599e3d(0xbe)]=_0x1a76f7[_0x599e3d(0xbe)]??0xbb8,_0x1a76f7['autoConnect']!==!0x1)this[_0x599e3d(0xff)]();}['log'](_0x17746f){const _0x42ad49=a0_0x48c2d0;console[_0x42ad49(0xe2)]('['+new Date()[_0x42ad49(0xf8)]()[_0x42ad49(0xb7)](0x0,0x8)+_0x42ad49(0xb9)+this[_0x42ad49(0xd6)]+']\x20'+_0x17746f);}async[a0_0x48c2d0(0xe6)](_0x2e818a,_0x57c7e1){const _0x1a2014=a0_0x48c2d0;let _0x5c0705={'Content-Type':'application/json','Accept':_0x1a2014(0xd9)};if(this['token'])_0x5c0705[_0x1a2014(0xe3)]='Bearer\x20'+this[_0x1a2014(0xf5)];let _0x13e4a2=await(await fetch(this['url']+_0x1a2014(0xbd),{'method':_0x1a2014(0xf9),'headers':_0x5c0705,'body':JSON[_0x1a2014(0xb6)]({'jsonrpc':_0x1a2014(0xbc),'id':Date[_0x1a2014(0xec)](),'method':'tools/call','params':{'name':_0x2e818a,'arguments':_0x57c7e1}})}))[_0x1a2014(0xfb)](),_0x2161ae=_0x13e4a2[_0x1a2014(0xb5)](/data: (.+)/),_0xfc4622=_0x2161ae?JSON[_0x1a2014(0xb2)](_0x2161ae[0x1]):JSON[_0x1a2014(0xb2)](_0x13e4a2),_0x2ab74b=_0xfc4622?.[_0x1a2014(0xdc)]?.[_0x1a2014(0xdb)]?.[0x0]?.[_0x1a2014(0xfb)];return _0x2ab74b?JSON[_0x1a2014(0xb2)](_0x2ab74b):_0xfc4622;}async['connect'](){const _0x4a1a67=a0_0x48c2d0;if(this[_0x4a1a67(0xc6)])return;this['running']=!0x0,await this[_0x4a1a67(0xc2)](_0x4a1a67(0xed)),this['log'](_0x4a1a67(0xde)),this[_0x4a1a67(0xb4)]=setInterval(()=>{const _0x1b2baf=_0x4a1a67;this['status'](_0x1b2baf(0xed))[_0x1b2baf(0xab)](_0x46b5c8=>this[_0x1b2baf(0xe2)]('heartbeat\x20failed:\x20'+_0x46b5c8[_0x1b2baf(0xd2)]));},this[_0x4a1a67(0xdf)]),this[_0x4a1a67(0xb8)]();}async[a0_0x48c2d0(0xb1)](){const _0x4aab88=a0_0x48c2d0;if(this['running']=!0x1,this[_0x4aab88(0xea)]?.[_0x4aab88(0xf0)](),this[_0x4aab88(0xb4)])clearInterval(this[_0x4aab88(0xb4)]);await this[_0x4aab88(0xc2)]('offline')[_0x4aab88(0xab)](()=>{}),this['log'](_0x4aab88(0xe5));}async[a0_0x48c2d0(0xfa)](_0x4ba9aa,_0x48fa7b,_0x152ff4=a0_0x48c2d0(0xfd)){const _0x437e1f=a0_0x48c2d0;return this[_0x437e1f(0xe6)](_0x437e1f(0xb0),{'alias':_0x4ba9aa,'task':_0x48fa7b,'priority':_0x152ff4,'from_session':this[_0x437e1f(0xd6)]});}async['message'](_0x52c66a,_0x23d31f){const _0x2fc25a=a0_0x48c2d0;return this[_0x2fc25a(0xe6)](_0x2fc25a(0xe7),{'alias':_0x52c66a,'message':_0x23d31f,'from_session':this[_0x2fc25a(0xd6)]});}async[a0_0x48c2d0(0xd7)](_0x5a8235,_0x2afdc2,_0x40a4d0=a0_0x48c2d0(0xe9)){const _0x584fb6=a0_0x48c2d0;return this['call'](_0x584fb6(0xd5),{'in_reply_to':_0x5a8235,'text':_0x2afdc2,'status':_0x40a4d0});}async['status'](_0x1d778c,_0x2ad995){const _0x3dd67b=a0_0x48c2d0;return this[_0x3dd67b(0xe6)]('report_status',{'resume_id':this[_0x3dd67b(0xbf)],'alias':this[_0x3dd67b(0xd6)],'status':_0x1d778c,'server':a0_0x45c2e0(),'hostname':a0_0x45c2e0(),'agent':this['agent'],'project_dir':process[_0x3dd67b(0xf7)](),..._0x2ad995});}async[a0_0x48c2d0(0xc1)](){const _0x458b43=a0_0x48c2d0;return this[_0x458b43(0xe6)](_0x458b43(0xae),{});}async[a0_0x48c2d0(0xcc)](_0x562bb8,_0x1dc23d){const _0x25da37=a0_0x48c2d0;return this[_0x25da37(0xe6)](_0x25da37(0xcc),{'message':_0x562bb8,'filter_server':_0x1dc23d?.[_0x25da37(0xc7)],'filter_status':_0x1dc23d?.['status']});}async[a0_0x48c2d0(0xb8)](){const _0x5f0edc=a0_0x48c2d0;let _0x114bbe=encodeURIComponent(this[_0x5f0edc(0xd6)]),_0x56daa4=this[_0x5f0edc(0x100)]+'/events/'+_0x114bbe,_0x3bed04=this[_0x5f0edc(0xbe)];while(this[_0x5f0edc(0xc6)]){try{this[_0x5f0edc(0xea)]=new AbortController();let _0x3554ac={'Accept':_0x5f0edc(0xc0)};if(this[_0x5f0edc(0xf5)])_0x3554ac[_0x5f0edc(0xe3)]=_0x5f0edc(0xcb)+this[_0x5f0edc(0xf5)];let _0x5b738d=await fetch(_0x56daa4,{'headers':_0x3554ac,'signal':this[_0x5f0edc(0xea)][_0x5f0edc(0xdd)]});if(!_0x5b738d['ok']||!_0x5b738d['body']){this[_0x5f0edc(0xe2)](_0x5f0edc(0xd0)+_0x5b738d[_0x5f0edc(0xc2)]),await this[_0x5f0edc(0xfc)](_0x3bed04),_0x3bed04=Math[_0x5f0edc(0xba)](_0x3bed04*1.5,0xea60);continue;}_0x3bed04=this[_0x5f0edc(0xbe)];let _0x5b989a=_0x5b738d['body'][_0x5f0edc(0xd8)](),_0x3ae456=new TextDecoder(),_0x2fee15='';while(this['running']){let {done:_0x44fdb3,value:_0x240217}=await _0x5b989a[_0x5f0edc(0xbb)]();if(_0x44fdb3)break;_0x2fee15+=_0x3ae456['decode'](_0x240217,{'stream':!0x0});let _0x3ada20=_0x2fee15['split']('\x0a');_0x2fee15=_0x3ada20[_0x5f0edc(0xc3)]()||'';for(let _0x416091 of _0x3ada20){if(!_0x416091[_0x5f0edc(0xb3)](_0x5f0edc(0xe4)))continue;try{let _0x31a720=JSON[_0x5f0edc(0xb2)](_0x416091['slice'](0x6));if(_0x31a720[_0x5f0edc(0xd4)]==='connected'){this['log'](_0x5f0edc(0xcd)),this['emit'](_0x5f0edc(0xe8));continue;}if(_0x31a720[_0x5f0edc(0xd4)]===_0x5f0edc(0xf6)||_0x31a720['type']===_0x5f0edc(0xd1)||_0x31a720['type']===_0x5f0edc(0xcc))await this[_0x5f0edc(0xcf)]();}catch{}}}}catch(_0x57efbd){if(_0x57efbd[_0x5f0edc(0x101)]==='AbortError')break;this['emit'](_0x5f0edc(0xf1),_0x57efbd),this['log'](_0x5f0edc(0xac)+_0x57efbd[_0x5f0edc(0xd2)]);}if(this[_0x5f0edc(0xc6)])this[_0x5f0edc(0xd3)](_0x5f0edc(0xe5)),this[_0x5f0edc(0xe2)](_0x5f0edc(0xca)+_0x3bed04/0x3e8+_0x5f0edc(0xad)),await this[_0x5f0edc(0xfc)](_0x3bed04),_0x3bed04=Math[_0x5f0edc(0xba)](_0x3bed04*1.5,0xea60);}}async[a0_0x48c2d0(0xcf)](){const _0x35723c=a0_0x48c2d0;try{let _0x552905=(await this[_0x35723c(0xe6)](_0x35723c(0xee),{'alias':this['alias'],'limit':0xa}))?.['messages']||[];for(let _0x42099d of _0x552905)await this[_0x35723c(0xe6)](_0x35723c(0xf4),{'alias':this[_0x35723c(0xd6)],'message_id':_0x42099d['id']}),this[_0x35723c(0xe2)]('←\x20'+_0x42099d[_0x35723c(0xeb)]+':\x20'+_0x42099d[_0x35723c(0xdb)][_0x35723c(0xb7)](0x0,0x3c)),this[_0x35723c(0xd3)]('task',_0x42099d),this[_0x35723c(0xd3)](_0x35723c(0xd2),_0x42099d);}catch(_0x1ebc93){this['log'](_0x35723c(0xda)+_0x1ebc93[_0x35723c(0xd2)]);}}[a0_0x48c2d0(0xfc)](_0x1981b9){return new Promise(_0x3c16d2=>setTimeout(_0x3c16d2,_0x1981b9));}}var $=T;export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x5afc3c=a0_0x1644;(function(_0x44ff8f,_0x525b4d){const _0x31c6dd=a0_0x1644,_0x3b86ef=_0x44ff8f();while(!![]){try{const _0x314bcb=-parseInt(_0x31c6dd(0x152))/0x1*(parseInt(_0x31c6dd(0x10f))/0x2)+-parseInt(_0x31c6dd(0x158))/0x3*(-parseInt(_0x31c6dd(0x128))/0x4)+-parseInt(_0x31c6dd(0xd4))/0x5*(-parseInt(_0x31c6dd(0xfa))/0x6)+parseInt(_0x31c6dd(0x12c))/0x7*(parseInt(_0x31c6dd(0x110))/0x8)+parseInt(_0x31c6dd(0x144))/0x9+-parseInt(_0x31c6dd(0xeb))/0xa*(parseInt(_0x31c6dd(0x141))/0xb)+parseInt(_0x31c6dd(0x102))/0xc;if(_0x314bcb===_0x525b4d)break;else _0x3b86ef['push'](_0x3b86ef['shift']());}catch(_0x1d3ab){_0x3b86ef['push'](_0x3b86ef['shift']());}}}(a0_0x40eb,0xe3170));import{readFileSync as a0_0x3f9e5e,existsSync as a0_0x758f04}from'fs';import{randomUUID as a0_0x12e77c}from'crypto';import{join as a0_0x18d90a}from'path';import{hostname as a0_0x2a592f}from'os';import{execSync as a0_0x403dc6}from'child_process';import{Server as a0_0x1d6a70}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x58a500}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x43fcca,CallToolRequestSchema as a0_0xa99d8}from'@modelcontextprotocol/sdk/types.js';function p(_0x5a7c89){const _0x393a39=a0_0x1644;if(!a0_0x758f04(_0x5a7c89))return;for(let _0x2d6255 of a0_0x3f9e5e(_0x5a7c89,_0x393a39(0x10a))[_0x393a39(0xe1)]('\x0a')){let _0x503b7d=_0x2d6255[_0x393a39(0x10e)]();if(!_0x503b7d||_0x503b7d['startsWith']('#'))continue;let _0x5aab51=_0x503b7d[_0x393a39(0x11d)]('=');if(_0x5aab51<0x0)continue;let _0x1b38ec=_0x503b7d['slice'](0x0,_0x5aab51)[_0x393a39(0x10e)](),_0x59f78a=_0x503b7d[_0x393a39(0xd5)](_0x5aab51+0x1)['trim']()['replace'](/^["']|["']$/g,'');if(!process.env[_0x1b38ec])process.env[_0x1b38ec]=_0x59f78a;}}var C=process.env.HOME||'~',T=a0_0x18d90a(C,a0_0x5afc3c(0x129));p(a0_0x18d90a(T,a0_0x5afc3c(0xed)));var L=process[a0_0x5afc3c(0xd0)]()[a0_0x5afc3c(0x119)](/\//g,'-');p(a0_0x18d90a(T,L,a0_0x5afc3c(0xed)));function U(){const _0x84a464=a0_0x5afc3c;try{return a0_0x403dc6('tmux\x20display-message\x20-p\x20\x27#S\x27',{'encoding':_0x84a464(0x10a),'timeout':0x7d0})['trim']();}catch{return'';}}function v(){const _0x41f078=a0_0x5afc3c;try{let _0x1b79bc=a0_0x18d90a(C,_0x41f078(0x11f),_0x41f078(0xf5));if(a0_0x758f04(_0x1b79bc))return JSON[_0x41f078(0x143)](a0_0x3f9e5e(_0x1b79bc,_0x41f078(0x10a)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x5afc3c(0xda)]||a0_0x5afc3c(0xd2),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x2a592f(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x12e77c(),X=process.env.COMMHUB_TOKEN||H[a0_0x5afc3c(0xff)]||'';function Y(_0x21ac04){const _0x3083c1=a0_0x5afc3c;let _0x2d1ed1=new Date()[_0x3083c1(0x104)]()[_0x3083c1(0xd5)](0x0,0x8);process['stderr'][_0x3083c1(0xfb)]('['+_0x2d1ed1+_0x3083c1(0xf2)+_0x21ac04+'\x0a');}function h(_0x269553){return new Promise(_0x675e1=>setTimeout(_0x675e1,_0x269553));}Y('ENV:\x20URL='+f+a0_0x5afc3c(0x109)+Z+a0_0x5afc3c(0x114)+w[a0_0x5afc3c(0xd5)](0x0,0x8)+a0_0x5afc3c(0xee)+(j||a0_0x5afc3c(0x15a))+a0_0x5afc3c(0x115)+process['cwd']()+'\x20PROJECT_ENV='+L);var k=new Map(),K=new a0_0x1d6a70({'name':a0_0x5afc3c(0xf6),'version':a0_0x5afc3c(0xe6)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x5afc3c(0x130),a0_0x5afc3c(0x11a),a0_0x5afc3c(0x12b),'You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','Session\x20alias:\x20'+Z][a0_0x5afc3c(0xe2)]('\x0a')});K[a0_0x5afc3c(0x132)](a0_0x43fcca,async()=>({'tools':[{'name':a0_0x5afc3c(0xf8),'description':a0_0x5afc3c(0x10c),'inputSchema':{'type':a0_0x5afc3c(0xf4),'properties':{'task_id':{'type':a0_0x5afc3c(0x145),'description':a0_0x5afc3c(0xe5)},'text':{'type':a0_0x5afc3c(0x145),'description':a0_0x5afc3c(0xfc)},'status':{'type':a0_0x5afc3c(0x145),'enum':['completed',a0_0x5afc3c(0x150),a0_0x5afc3c(0xcc),a0_0x5afc3c(0x121),a0_0x5afc3c(0x134),a0_0x5afc3c(0xe0)],'description':a0_0x5afc3c(0x12e)}},'required':[a0_0x5afc3c(0xea)]}},{'name':a0_0x5afc3c(0xca),'description':'Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','inputSchema':{'type':a0_0x5afc3c(0xf4),'properties':{'status':{'type':a0_0x5afc3c(0x145),'enum':[a0_0x5afc3c(0x124),a0_0x5afc3c(0x118),a0_0x5afc3c(0x121),'error']},'task':{'type':a0_0x5afc3c(0x145),'description':a0_0x5afc3c(0x101)},'progress':{'type':a0_0x5afc3c(0x125),'description':a0_0x5afc3c(0x131)}},'required':[a0_0x5afc3c(0x137)]}},{'name':a0_0x5afc3c(0x153),'description':a0_0x5afc3c(0x103),'inputSchema':{'type':a0_0x5afc3c(0xf4),'properties':{'alias':{'type':a0_0x5afc3c(0x145),'description':a0_0x5afc3c(0xf3)},'task':{'type':a0_0x5afc3c(0x145),'description':'Task\x20content'},'priority':{'type':a0_0x5afc3c(0x145),'enum':[a0_0x5afc3c(0x12d),'normal',a0_0x5afc3c(0xd9)],'description':a0_0x5afc3c(0xce)}},'required':[a0_0x5afc3c(0x117),a0_0x5afc3c(0x108)]}},{'name':a0_0x5afc3c(0x14f),'description':a0_0x5afc3c(0x12a),'inputSchema':{'type':a0_0x5afc3c(0xf4),'properties':{'alias':{'type':'string','description':a0_0x5afc3c(0xf3)},'message':{'type':a0_0x5afc3c(0x145),'description':a0_0x5afc3c(0x155)}},'required':['alias',a0_0x5afc3c(0xe7)]}},{'name':a0_0x5afc3c(0x135),'description':'Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','inputSchema':{'type':a0_0x5afc3c(0xf4),'properties':{}}}]}));async function P(_0x37102f,_0x4edad5){const _0x6e9552=a0_0x5afc3c;let _0x1145b9=await fetch(f+_0x6e9552(0xdc),{'method':_0x6e9552(0x142),'headers':{'Content-Type':_0x6e9552(0x156),'Accept':_0x6e9552(0xec),...X?{'Authorization':_0x6e9552(0x111)+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x6e9552(0xf0),'id':0x1,'method':_0x6e9552(0x122),'params':{'protocolVersion':_0x6e9552(0x105),'capabilities':{},'clientInfo':{'name':_0x6e9552(0xf6),'version':_0x6e9552(0xe6)}}})});if(!_0x1145b9['ok']){let _0x3a2dea=await _0x1145b9[_0x6e9552(0xea)]();return Y(_0x6e9552(0x13a)+_0x1145b9[_0x6e9552(0x137)]+'\x20'+_0x3a2dea[_0x6e9552(0xd5)](0x0,0x64)),{'ok':!0x1,'error':_0x6e9552(0x120)+_0x1145b9[_0x6e9552(0x137)]};}await _0x1145b9[_0x6e9552(0xea)]();let _0x16a824=(await(await fetch(f+_0x6e9552(0xdc),{'method':_0x6e9552(0x142),'headers':{'Content-Type':_0x6e9552(0x156),'Accept':_0x6e9552(0xec),...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON[_0x6e9552(0x13e)]({'jsonrpc':_0x6e9552(0xf0),'id':0x2,'method':_0x6e9552(0x14a),'params':{'name':_0x37102f,'arguments':_0x4edad5}})}))[_0x6e9552(0xea)]())[_0x6e9552(0xe1)]('\x0a')[_0x6e9552(0x154)](_0x54e0b2=>_0x54e0b2['startsWith'](_0x6e9552(0x146)));if(_0x16a824){let _0x14ae60=JSON[_0x6e9552(0x143)](_0x16a824[_0x6e9552(0xd5)](0x6));return _0x14ae60?.[_0x6e9552(0xe8)]?.[_0x6e9552(0x136)]?.[0x0]?.[_0x6e9552(0xea)]?JSON[_0x6e9552(0x143)](_0x14ae60[_0x6e9552(0xe8)]['content'][0x0]['text']):_0x14ae60;}return{'ok':!0x1,'error':_0x6e9552(0x14e)};}function a0_0x1644(_0x28afcc,_0x5655e7){_0x28afcc=_0x28afcc-0xca;const _0x40eb85=a0_0x40eb();let _0x16443f=_0x40eb85[_0x28afcc];return _0x16443f;}K[a0_0x5afc3c(0x132)](a0_0xa99d8,async _0x13d9cc=>{const _0x130b5d=a0_0x5afc3c;let {name:_0x2d2bd,arguments:_0x17f670}=_0x13d9cc['params'];if(_0x2d2bd===_0x130b5d(0xf8)){let {task_id:_0x136cf7,text:_0x32f03d,status:_0x3c68c0}=_0x17f670;if(_0x3c68c0===_0x130b5d(0x13b)||_0x3c68c0==='failed'||_0x3c68c0===_0x130b5d(0xcc)){let _0x52e421=_0x3c68c0===_0x130b5d(0x13b)?'replied':_0x3c68c0,_0x54a186=_0x136cf7?k[_0x130b5d(0xe9)](_0x136cf7)||_0x130b5d(0xda):_0x130b5d(0xda),_0x521301=await P('send_reply',{'alias':_0x54a186,'text':_0x32f03d,'in_reply_to':_0x136cf7||void 0x0,'status':_0x52e421,'from_session':Z});if(_0x136cf7)k[_0x130b5d(0xf7)](_0x136cf7);return{'content':[{'type':_0x130b5d(0xea),'text':JSON[_0x130b5d(0x13e)](_0x521301)}]};}let _0x5cfa77=await P(_0x130b5d(0x113),{'resume_id':w,'alias':Z,'status':_0x3c68c0===_0x130b5d(0x121)?'blocked':_0x3c68c0==='error'?_0x130b5d(0x134):_0x130b5d(0x124),'task':_0x32f03d[_0x130b5d(0xd5)](0x0,0xc8),'output':_0x32f03d});return{'content':[{'type':'text','text':JSON[_0x130b5d(0x13e)](_0x5cfa77)}]};}if(_0x2d2bd===_0x130b5d(0xca)){let {status:_0x20963d,task:_0x28ce40,progress:_0x301bae}=_0x17f670,_0x358c59=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x20963d,'task':_0x28ce40,'progress':_0x301bae});return{'content':[{'type':'text','text':JSON[_0x130b5d(0x13e)](_0x358c59)}]};}if(_0x2d2bd===_0x130b5d(0x153)){let {alias:_0x343202,task:_0x4abb2e,priority:_0x3fce70}=_0x17f670,_0x34a9d5=await P(_0x130b5d(0x157),{'alias':_0x343202,'task':_0x4abb2e,'priority':_0x3fce70||_0x130b5d(0x11b),'from_session':Z});return{'content':[{'type':_0x130b5d(0xea),'text':JSON['stringify'](_0x34a9d5)}]};}if(_0x2d2bd===_0x130b5d(0x14f)){let {alias:_0x283c3a,message:_0x1145db}=_0x17f670,_0xfdee1d=await P(_0x130b5d(0xcb),{'alias':_0x283c3a,'message':_0x1145db,'from_session':Z});return{'content':[{'type':_0x130b5d(0xea),'text':JSON['stringify'](_0xfdee1d)}]};}if(_0x2d2bd==='commhub_get_all_status'){let _0x27efc9=await P(_0x130b5d(0xf1),{});return{'content':[{'type':_0x130b5d(0xea),'text':JSON[_0x130b5d(0x13e)](_0x27efc9)}]};}return{'content':[{'type':_0x130b5d(0xea),'text':JSON[_0x130b5d(0x13e)]({'error':_0x130b5d(0x100)})}]};});async function u(){const _0x1cfa64=a0_0x5afc3c;let _0x246e03=f+_0x1cfa64(0xe3)+encodeURIComponent(Z),_0x573d20={};if(X)_0x573d20[_0x1cfa64(0xfd)]=_0x1cfa64(0x111)+X;Y(_0x1cfa64(0x139)+_0x246e03);while(!0x0){try{let _0x1aba62=await fetch(_0x246e03,{'headers':_0x573d20});if(!_0x1aba62['ok']){Y(_0x1cfa64(0x13c)+_0x1aba62[_0x1cfa64(0x137)]+'\x20'+_0x1aba62[_0x1cfa64(0x133)]),await h(0x1388);continue;}let _0x23b34b=_0x1aba62[_0x1cfa64(0x123)]['getReader'](),_0x5aa8a8=new TextDecoder(),_0x5f2062='';while(!0x0){let {done:_0x3e3d78,value:_0x31e2e6}=await _0x23b34b[_0x1cfa64(0xdb)]();if(_0x3e3d78)break;_0x5f2062+=_0x5aa8a8[_0x1cfa64(0xd8)](_0x31e2e6,{'stream':!0x0});let _0x92465c=_0x5f2062[_0x1cfa64(0xe1)]('\x0a\x0a');_0x5f2062=_0x92465c[_0x1cfa64(0x147)]()||'';for(let _0x40e655 of _0x92465c){let _0x1d9806=_0x40e655[_0x1cfa64(0xe1)]('\x0a')['find'](_0x3d7e78=>_0x3d7e78[_0x1cfa64(0xd7)](_0x1cfa64(0x146)));if(!_0x1d9806)continue;try{let _0x3c669d=JSON[_0x1cfa64(0x143)](_0x1d9806[_0x1cfa64(0xd5)](0x6));await S(_0x3c669d);}catch(_0x5b8761){Y(_0x1cfa64(0x11c)+_0x5b8761);}}}Y(_0x1cfa64(0x126));}catch(_0xd00cda){Y('SSE\x20connection\x20error:\x20'+_0xd00cda);}await h(0xbb8);}}async function S(_0x2803cf){const _0xed37f4=a0_0x5afc3c;if(_0x2803cf[_0xed37f4(0x12f)]===_0xed37f4(0xde)){Y('SSE\x20connected\x20as\x20\x22'+Z+'\x22');return;}if(_0x2803cf['type']==='new_message'){if(Y(_0xed37f4(0x106)+_0x2803cf[_0xed37f4(0xdf)]+':\x20'+_0x2803cf['message'][_0xed37f4(0xd5)](0x0,0x3c)),await K[_0xed37f4(0xef)]({'method':_0xed37f4(0xd6),'params':{'content':_0x2803cf[_0xed37f4(0xe7)],'meta':{'sender':_0x2803cf[_0xed37f4(0xdf)]||_0xed37f4(0xda),'sender_id':_0xed37f4(0x127),'user':_0x2803cf[_0xed37f4(0xdf)]||_0xed37f4(0xda),'priority':_0xed37f4(0x11b)}}}),_0x2803cf[_0xed37f4(0x151)])await P(_0xed37f4(0x159),{'alias':Z,'message_id':_0x2803cf['message_id']});return;}if(_0x2803cf['type']===_0xed37f4(0xdd)||_0x2803cf[_0xed37f4(0x12f)]===_0xed37f4(0x140)){Y('←\x20'+_0x2803cf[_0xed37f4(0x12f)]+_0xed37f4(0x15b)+_0x2803cf[_0xed37f4(0xd1)]+'\x20priority='+(_0x2803cf[_0xed37f4(0xe4)]||_0xed37f4(0x11b)));let _0x223d28=await P(_0xed37f4(0xf9),{'alias':Z,'limit':0x5});if(_0x223d28?.['ok']&&_0x223d28[_0xed37f4(0x14c)]?.[_0xed37f4(0x149)]>0x0)for(let _0x35f1ed of _0x223d28[_0xed37f4(0x14c)]){let _0x477b05={'sender':_0x35f1ed[_0xed37f4(0x14b)]||_0xed37f4(0xda),'sender_id':_0xed37f4(0x127),'user':_0x35f1ed[_0xed37f4(0x14b)]||_0xed37f4(0xda),'task_id':_0x35f1ed['id'],'priority':_0x35f1ed[_0xed37f4(0xe4)]||_0xed37f4(0x11b)};k[_0xed37f4(0xcd)](_0x35f1ed['id'],_0x35f1ed[_0xed37f4(0x14b)]||_0xed37f4(0xda)),await K[_0xed37f4(0xef)]({'method':_0xed37f4(0xd6),'params':{'content':_0x35f1ed['content'],'meta':_0x477b05}}),Y(_0xed37f4(0x138)+_0x35f1ed['id']['slice'](0x0,0x8)+_0xed37f4(0x112)+_0x35f1ed[_0xed37f4(0x14b)]+':\x20'+_0x35f1ed['content'][_0xed37f4(0xd5)](0x0,0x3c)),await P(_0xed37f4(0x159),{'alias':Z,'message_id':_0x35f1ed['id']});}}}function a0_0x40eb(){const _0x4cc1ff=['\x20ALIAS=','utf-8','catch','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','shutting\x20down,\x20reporting\x20offline...','trim','781918ZXJyGZ','450040eanlgX','Bearer\x20','\x20from\x20','report_status','\x20RESUME_ID=','\x20CWD=','exit','alias','idle','replace','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','normal','parse\x20error:\x20','indexOf','end','.anet','init\x20failed:\x20','blocked','initialize','body','working','number','SSE\x20stream\x20ended,\x20reconnecting...','commhub','4RcDZjk','.claude/channels/commhub','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','49ZjoSza','high','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','type','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','Progress\x200-100','setRequestHandler','statusText','error','commhub_get_all_status','content','status','→\x20injected\x20task\x20','connecting\x20to\x20','CommHub\x20init\x20failed:\x20','completed','SSE\x20error:\x20','claude-code','stringify','starting\x20SSE\x20listener...','broadcast','187KPvTlM','POST','parse','8332965wlMjSk','string','data:\x20','pop','SSE\x20fatal:\x20','length','tools/call','from_session','messages','MCP\x20stdio\x20connected','no\x20response','commhub_send_message','failed','message_id','1omOFTw','commhub_send_task','find','Message\x20content','application/json','send_task','1195521EeEYAH','ack_inbox','none',':\x20inbox_count=','commhub_report_status','send_message','cancelled','set','Priority\x20(default:\x20normal)','fatal:\x20','cwd','inbox_count','http://127.0.0.1:9200','SIGTERM','4485145RsEECL','slice','notifications/claude/channel','startsWith','decode','low','hub','read','/mcp','new_task','connected','from','in_progress','split','join','/events/','priority','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','0.3.0','message','result','get','text','983140PCpuSU','application/json,\x20text/event-stream','.env','...\x20TMUX=','notification','2.0','get_all_status',']\x20[commhub]\x20','Target\x20session\x20alias','object','config.json','commhub-channel','delete','commhub_reply','get_inbox','6VNqPAA','write','Reply\x20text\x20/\x20result\x20summary','Authorization','warning:\x20could\x20not\x20register:\x20','token','unknown\x20tool','Current\x20task\x20description','4527012mFCOZT','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','toTimeString','2025-03-26','←\x20message\x20from\x20','stdin','task'];a0_0x40eb=function(){return _0x4cc1ff;};return a0_0x40eb();}async function A(){const _0x4ce632=a0_0x5afc3c;let _0xfd61db=new a0_0x58a500();await K['connect'](_0xfd61db),Y(_0x4ce632(0x14d)),Y(_0x4ce632(0x13f)),u()[_0x4ce632(0x10b)](_0x3899fb=>Y(_0x4ce632(0x148)+_0x3899fb)),P(_0x4ce632(0x113),{'resume_id':w,'alias':Z,'status':_0x4ce632(0x118),'server':a0_0x2a592f(),'hostname':a0_0x2a592f(),'agent':'claude-code','project_dir':process[_0x4ce632(0xd0)](),'tmux_name':j||void 0x0})['then'](()=>Y('registered\x20as\x20\x22'+Z+'\x22\x20('+w[_0x4ce632(0xd5)](0x0,0x8)+')'))[_0x4ce632(0x10b)](_0x2bc13f=>Y(_0x4ce632(0xfe)+_0x2bc13f)),setInterval(()=>{const _0x7cd90c=_0x4ce632;P(_0x7cd90c(0x113),{'resume_id':w,'alias':Z,'status':_0x7cd90c(0x118),'server':a0_0x2a592f(),'hostname':a0_0x2a592f(),'agent':_0x7cd90c(0x13d),'project_dir':process['cwd'](),'tmux_name':j||void 0x0})[_0x7cd90c(0x10b)](_0x4d300c=>Y('heartbeat\x20failed:\x20'+_0x4d300c));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}A()['catch'](_0x43f393=>{const _0x3eb012=a0_0x5afc3c;Y(_0x3eb012(0xcf)+_0x43f393),process[_0x3eb012(0x116)](0x1);});async function N(){const _0x311466=a0_0x5afc3c;Y(_0x311466(0x10d)),await P(_0x311466(0x113),{'resume_id':w,'alias':Z,'status':_0x311466(0x134),'task':'session\x20disconnected'})[_0x311466(0x10b)](()=>{}),process[_0x311466(0x116)](0x0);}process[a0_0x5afc3c(0x107)]['on'](a0_0x5afc3c(0x11e),()=>N()),process['on'](a0_0x5afc3c(0xd3),()=>N()),process['on']('SIGINT',()=>N());
2
+ const a0_0x52c031=a0_0x5243;(function(_0x278a2e,_0xd22497){const _0x5c3727=a0_0x5243,_0x543405=_0x278a2e();while(!![]){try{const _0x27bc4c=-parseInt(_0x5c3727(0x22b))/0x1+parseInt(_0x5c3727(0x226))/0x2*(parseInt(_0x5c3727(0x1ce))/0x3)+-parseInt(_0x5c3727(0x1d6))/0x4+parseInt(_0x5c3727(0x223))/0x5+parseInt(_0x5c3727(0x1e9))/0x6*(-parseInt(_0x5c3727(0x225))/0x7)+-parseInt(_0x5c3727(0x239))/0x8+-parseInt(_0x5c3727(0x1c1))/0x9*(-parseInt(_0x5c3727(0x1e8))/0xa);if(_0x27bc4c===_0xd22497)break;else _0x543405['push'](_0x543405['shift']());}catch(_0x236021){_0x543405['push'](_0x543405['shift']());}}}(a0_0xd53c,0x6a849));import{readFileSync as a0_0x202286,existsSync as a0_0x4dfca6}from'fs';import{randomUUID as a0_0x51bffb}from'crypto';import{join as a0_0x561821}from'path';import{hostname as a0_0x3936f5}from'os';import{execSync as a0_0x4bd3f0}from'child_process';import{Server as a0_0xb06027}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x4c09c9}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x46d2c5,CallToolRequestSchema as a0_0xf797f8}from'@modelcontextprotocol/sdk/types.js';function p(_0x4de18d){const _0x507c3e=a0_0x5243;if(!a0_0x4dfca6(_0x4de18d))return;for(let _0x567297 of a0_0x202286(_0x4de18d,_0x507c3e(0x21e))[_0x507c3e(0x21c)]('\x0a')){let _0x540053=_0x567297['trim']();if(!_0x540053||_0x540053[_0x507c3e(0x212)]('#'))continue;let _0x31ac32=_0x540053[_0x507c3e(0x1e6)]('=');if(_0x31ac32<0x0)continue;let _0x30d404=_0x540053[_0x507c3e(0x1f3)](0x0,_0x31ac32)[_0x507c3e(0x1ca)](),_0x1f6e28=_0x540053[_0x507c3e(0x1f3)](_0x31ac32+0x1)[_0x507c3e(0x1ca)]()[_0x507c3e(0x230)](/^["']|["']$/g,'');if(!process.env[_0x30d404])process.env[_0x30d404]=_0x1f6e28;}}var C=process.env.HOME||'~',T=a0_0x561821(C,a0_0x52c031(0x1b8));p(a0_0x561821(T,a0_0x52c031(0x1cb)));function a0_0x5243(_0x5eaee3,_0x3f8032){_0x5eaee3=_0x5eaee3-0x1b2;const _0xd53cff=a0_0xd53c();let _0x524301=_0xd53cff[_0x5eaee3];return _0x524301;}var L=process[a0_0x52c031(0x1c0)]()[a0_0x52c031(0x230)](/\//g,'-');p(a0_0x561821(T,L,a0_0x52c031(0x1cb)));function U(){const _0x441e33=a0_0x52c031;try{return a0_0x4bd3f0(_0x441e33(0x1da),{'encoding':_0x441e33(0x21e),'timeout':0x7d0})[_0x441e33(0x1ca)]();}catch{return'';}}function v(){const _0x44d6e6=a0_0x52c031;try{let _0x42d684=a0_0x561821(C,'.anet',_0x44d6e6(0x1e2));if(a0_0x4dfca6(_0x42d684))return JSON[_0x44d6e6(0x1f2)](a0_0x202286(_0x42d684,_0x44d6e6(0x21e)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x52c031(0x202)]||'http://127.0.0.1:9200',j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x3936f5(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x51bffb(),X=process.env.COMMHUB_TOKEN||H[a0_0x52c031(0x1fa)]||'';function Y(_0x1a8fc2){const _0x2ceb26=a0_0x52c031;let _0x3be9f3=new Date()[_0x2ceb26(0x237)]()[_0x2ceb26(0x1f3)](0x0,0x8);process[_0x2ceb26(0x235)][_0x2ceb26(0x1e1)]('['+_0x3be9f3+_0x2ceb26(0x200)+_0x1a8fc2+'\x0a');}function h(_0xc820db){return new Promise(_0x742a1=>setTimeout(_0x742a1,_0xc820db));}Y(a0_0x52c031(0x1ed)+f+a0_0x52c031(0x1ff)+Z+a0_0x52c031(0x1bd)+w[a0_0x52c031(0x1f3)](0x0,0x8)+a0_0x52c031(0x1db)+(j||a0_0x52c031(0x1cc))+a0_0x52c031(0x1d4)+process[a0_0x52c031(0x1c0)]()+'\x20PROJECT_ENV='+L);function a0_0xd53c(){const _0x43cd66=['\x20RESUME_ID=','init\x20failed:\x20','stringify','cwd','381429drIBvs','failed','warning:\x20could\x20not\x20register:\x20','SSE\x20connection\x20error:\x20','low','Current\x20task\x20description','normal','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','new_task','trim','.env','none','type','6HOZdGW','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','session\x20disconnected','message','\x20priority=','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','\x20CWD=','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','85508fFNGnP','text','ready\x20—\x20waiting\x20for\x20events','commhub','tmux\x20display-message\x20-p\x20\x27#S\x27','...\x20TMUX=','0.3.0','join','replied','notifications/claude/channel','idle','write','config.json','blocked','cancelled','SSE\x20error:\x20','indexOf','Message\x20content','310UESlWO','106068mWeyVy','high','notification','POST','ENV:\x20URL=','priority','data:\x20','SIGINT','then','parse','slice','number','completed','getReader','application/json,\x20text/event-stream','\x20from\x20','application/json','token','commhub-channel','←\x20message\x20from\x20','send_task','commhub_get_all_status','\x20ALIAS=',']\x20[commhub]\x20','/mcp','hub','Session\x20alias:\x20','report_status','new_message','pop','initialize','decode','messages','result','Priority\x20(default:\x20normal)','from','find','alias','message_id','get_all_status','commhub_report_status','startsWith','commhub_send_message','working','send_message','MCP\x20stdio\x20connected','read','in_progress','Progress\x200-100','error','catch','split','registered\x20as\x20\x22','utf-8','unknown\x20tool','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','2025-03-26','string','3904035fkLOoX','Target\x20session\x20alias','189vbCQyx','258740CpyJiw','broadcast','set','exit',':\x20inbox_count=','629762jIyLfI','delete','Authorization','CommHub\x20init\x20failed:\x20','claude-code','replace','from_session','object','get_inbox','commhub_reply','stderr','ack_inbox','toTimeString','SSE\x20stream\x20ended,\x20reconnecting...','6308928hCaUiL','status','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','2.0','content','Bearer\x20','setRequestHandler','SIGTERM','length','SSE\x20connected\x20as\x20\x22','SSE\x20fatal:\x20','→\x20injected\x20task\x20','.claude/channels/commhub','/events/','commhub_send_task','heartbeat\x20failed:\x20','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.'];a0_0xd53c=function(){return _0x43cd66;};return a0_0xd53c();}var k=new Map(),K=new a0_0xb06027({'name':'commhub-channel','version':a0_0x52c031(0x1dc)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x52c031(0x220),a0_0x52c031(0x1d5),a0_0x52c031(0x1d3),a0_0x52c031(0x1c8),a0_0x52c031(0x203)+Z][a0_0x52c031(0x1dd)]('\x0a')});K['setRequestHandler'](a0_0x46d2c5,async()=>({'tools':[{'name':a0_0x52c031(0x234),'description':a0_0x52c031(0x1bc),'inputSchema':{'type':a0_0x52c031(0x232),'properties':{'task_id':{'type':a0_0x52c031(0x222),'description':a0_0x52c031(0x1cf)},'text':{'type':a0_0x52c031(0x222),'description':'Reply\x20text\x20/\x20result\x20summary'},'status':{'type':a0_0x52c031(0x222),'enum':[a0_0x52c031(0x1f5),a0_0x52c031(0x1c2),a0_0x52c031(0x1e4),'blocked',a0_0x52c031(0x21a),a0_0x52c031(0x218)],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':['text']}},{'name':a0_0x52c031(0x211),'description':'Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','inputSchema':{'type':a0_0x52c031(0x232),'properties':{'status':{'type':a0_0x52c031(0x222),'enum':[a0_0x52c031(0x214),a0_0x52c031(0x1e0),'blocked',a0_0x52c031(0x21a)]},'task':{'type':a0_0x52c031(0x222),'description':a0_0x52c031(0x1c6)},'progress':{'type':a0_0x52c031(0x1f4),'description':a0_0x52c031(0x219)}},'required':[a0_0x52c031(0x23a)]}},{'name':'commhub_send_task','description':a0_0x52c031(0x23b),'inputSchema':{'type':a0_0x52c031(0x232),'properties':{'alias':{'type':a0_0x52c031(0x222),'description':a0_0x52c031(0x224)},'task':{'type':a0_0x52c031(0x222),'description':'Task\x20content'},'priority':{'type':a0_0x52c031(0x222),'enum':[a0_0x52c031(0x1ea),'normal',a0_0x52c031(0x1c5)],'description':a0_0x52c031(0x20b)}},'required':['alias','task']}},{'name':a0_0x52c031(0x213),'description':a0_0x52c031(0x23c),'inputSchema':{'type':a0_0x52c031(0x232),'properties':{'alias':{'type':a0_0x52c031(0x222),'description':a0_0x52c031(0x224)},'message':{'type':a0_0x52c031(0x222),'description':a0_0x52c031(0x1e7)}},'required':[a0_0x52c031(0x20e),a0_0x52c031(0x1d1)]}},{'name':a0_0x52c031(0x1fe),'description':'Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','inputSchema':{'type':a0_0x52c031(0x232),'properties':{}}}]}));async function P(_0x223121,_0x10e9b1){const _0x4addc9=a0_0x52c031;let _0x35fbe9=await fetch(f+_0x4addc9(0x201),{'method':_0x4addc9(0x1ec),'headers':{'Content-Type':_0x4addc9(0x1f9),'Accept':_0x4addc9(0x1f7),...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON[_0x4addc9(0x1bf)]({'jsonrpc':_0x4addc9(0x23d),'id':0x1,'method':_0x4addc9(0x207),'params':{'protocolVersion':_0x4addc9(0x221),'capabilities':{},'clientInfo':{'name':_0x4addc9(0x1fb),'version':'0.3.0'}}})});if(!_0x35fbe9['ok']){let _0x5385c9=await _0x35fbe9[_0x4addc9(0x1d7)]();return Y(_0x4addc9(0x22e)+_0x35fbe9[_0x4addc9(0x23a)]+'\x20'+_0x5385c9[_0x4addc9(0x1f3)](0x0,0x64)),{'ok':!0x1,'error':_0x4addc9(0x1be)+_0x35fbe9['status']};}await _0x35fbe9[_0x4addc9(0x1d7)]();let _0x3c89b1=(await(await fetch(f+_0x4addc9(0x201),{'method':_0x4addc9(0x1ec),'headers':{'Content-Type':_0x4addc9(0x1f9),'Accept':_0x4addc9(0x1f7),...X?{'Authorization':_0x4addc9(0x23f)+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x4addc9(0x23d),'id':0x2,'method':'tools/call','params':{'name':_0x223121,'arguments':_0x10e9b1}})}))['text']())[_0x4addc9(0x21c)]('\x0a')[_0x4addc9(0x20d)](_0x12cbd2=>_0x12cbd2['startsWith'](_0x4addc9(0x1ef)));if(_0x3c89b1){let _0x434264=JSON[_0x4addc9(0x1f2)](_0x3c89b1['slice'](0x6));return _0x434264?.[_0x4addc9(0x20a)]?.[_0x4addc9(0x23e)]?.[0x0]?.[_0x4addc9(0x1d7)]?JSON['parse'](_0x434264[_0x4addc9(0x20a)][_0x4addc9(0x23e)][0x0][_0x4addc9(0x1d7)]):_0x434264;}return{'ok':!0x1,'error':'no\x20response'};}K[a0_0x52c031(0x1b2)](a0_0xf797f8,async _0x45dbd9=>{const _0x5d5d5e=a0_0x52c031;let {name:_0xe67755,arguments:_0x5b0fdd}=_0x45dbd9['params'];if(_0xe67755==='commhub_reply'){let {task_id:_0x2e80b4,text:_0x1fa776,status:_0x257244}=_0x5b0fdd;if(_0x257244===_0x5d5d5e(0x1f5)||_0x257244===_0x5d5d5e(0x1c2)||_0x257244==='cancelled'){let _0x260c95=_0x257244===_0x5d5d5e(0x1f5)?_0x5d5d5e(0x1de):_0x257244,_0x16e5b5=_0x2e80b4?k['get'](_0x2e80b4)||_0x5d5d5e(0x202):_0x5d5d5e(0x202),_0x159d92=await P('send_reply',{'alias':_0x16e5b5,'text':_0x1fa776,'in_reply_to':_0x2e80b4||void 0x0,'status':_0x260c95,'from_session':Z});if(_0x2e80b4)k[_0x5d5d5e(0x22c)](_0x2e80b4);return{'content':[{'type':_0x5d5d5e(0x1d7),'text':JSON['stringify'](_0x159d92)}]};}let _0x4fd128=await P(_0x5d5d5e(0x204),{'resume_id':w,'alias':Z,'status':_0x257244===_0x5d5d5e(0x1e3)?_0x5d5d5e(0x1e3):_0x257244==='error'?_0x5d5d5e(0x21a):_0x5d5d5e(0x214),'task':_0x1fa776[_0x5d5d5e(0x1f3)](0x0,0xc8),'output':_0x1fa776});return{'content':[{'type':'text','text':JSON['stringify'](_0x4fd128)}]};}if(_0xe67755===_0x5d5d5e(0x211)){let {status:_0x410e32,task:_0x6b7f49,progress:_0x3ba91a}=_0x5b0fdd,_0x1ba7fc=await P(_0x5d5d5e(0x204),{'resume_id':w,'alias':Z,'status':_0x410e32,'task':_0x6b7f49,'progress':_0x3ba91a});return{'content':[{'type':_0x5d5d5e(0x1d7),'text':JSON['stringify'](_0x1ba7fc)}]};}if(_0xe67755===_0x5d5d5e(0x1ba)){let {alias:_0x17de36,task:_0x240b66,priority:_0x5adaa4}=_0x5b0fdd,_0x356624=await P(_0x5d5d5e(0x1fd),{'alias':_0x17de36,'task':_0x240b66,'priority':_0x5adaa4||_0x5d5d5e(0x1c7),'from_session':Z});return{'content':[{'type':_0x5d5d5e(0x1d7),'text':JSON[_0x5d5d5e(0x1bf)](_0x356624)}]};}if(_0xe67755==='commhub_send_message'){let {alias:_0x7bc0e4,message:_0x244e7e}=_0x5b0fdd,_0x13ed33=await P(_0x5d5d5e(0x215),{'alias':_0x7bc0e4,'message':_0x244e7e,'from_session':Z});return{'content':[{'type':_0x5d5d5e(0x1d7),'text':JSON['stringify'](_0x13ed33)}]};}if(_0xe67755===_0x5d5d5e(0x1fe)){let _0x4c96c1=await P(_0x5d5d5e(0x210),{});return{'content':[{'type':'text','text':JSON['stringify'](_0x4c96c1)}]};}return{'content':[{'type':_0x5d5d5e(0x1d7),'text':JSON[_0x5d5d5e(0x1bf)]({'error':_0x5d5d5e(0x21f)})}]};});async function u(){const _0x3de458=a0_0x52c031;let _0x5080d1=f+_0x3de458(0x1b9)+encodeURIComponent(Z),_0x36194b={};if(X)_0x36194b[_0x3de458(0x22d)]=_0x3de458(0x23f)+X;Y('connecting\x20to\x20'+_0x5080d1);while(!0x0){try{let _0x12dbb9=await fetch(_0x5080d1,{'headers':_0x36194b});if(!_0x12dbb9['ok']){Y(_0x3de458(0x1e5)+_0x12dbb9[_0x3de458(0x23a)]+'\x20'+_0x12dbb9['statusText']),await h(0x1388);continue;}let _0x5c60f4=_0x12dbb9['body'][_0x3de458(0x1f6)](),_0x506df5=new TextDecoder(),_0x154a56='';while(!0x0){let {done:_0x33e566,value:_0xd2fce9}=await _0x5c60f4[_0x3de458(0x217)]();if(_0x33e566)break;_0x154a56+=_0x506df5[_0x3de458(0x208)](_0xd2fce9,{'stream':!0x0});let _0x3f4629=_0x154a56[_0x3de458(0x21c)]('\x0a\x0a');_0x154a56=_0x3f4629[_0x3de458(0x206)]()||'';for(let _0x35a5af of _0x3f4629){let _0x57c5c7=_0x35a5af['split']('\x0a')[_0x3de458(0x20d)](_0x48236d=>_0x48236d[_0x3de458(0x212)](_0x3de458(0x1ef)));if(!_0x57c5c7)continue;try{let _0x225e66=JSON[_0x3de458(0x1f2)](_0x57c5c7[_0x3de458(0x1f3)](0x6));await S(_0x225e66);}catch(_0x48e7d9){Y('parse\x20error:\x20'+_0x48e7d9);}}}Y(_0x3de458(0x238));}catch(_0x4368f4){Y(_0x3de458(0x1c4)+_0x4368f4);}await h(0xbb8);}}async function S(_0x1966dc){const _0x28a57d=a0_0x52c031;if(_0x1966dc[_0x28a57d(0x1cd)]==='connected'){Y(_0x28a57d(0x1b5)+Z+'\x22');return;}if(_0x1966dc[_0x28a57d(0x1cd)]===_0x28a57d(0x205)){if(Y(_0x28a57d(0x1fc)+_0x1966dc['from']+':\x20'+_0x1966dc[_0x28a57d(0x1d1)][_0x28a57d(0x1f3)](0x0,0x3c)),await K[_0x28a57d(0x1eb)]({'method':'notifications/claude/channel','params':{'content':_0x1966dc[_0x28a57d(0x1d1)],'meta':{'sender':_0x1966dc[_0x28a57d(0x20c)]||_0x28a57d(0x202),'sender_id':_0x28a57d(0x1d9),'user':_0x1966dc['from']||_0x28a57d(0x202),'priority':_0x28a57d(0x1c7)}}}),_0x1966dc[_0x28a57d(0x20f)])await P(_0x28a57d(0x236),{'alias':Z,'message_id':_0x1966dc['message_id']});return;}if(_0x1966dc[_0x28a57d(0x1cd)]===_0x28a57d(0x1c9)||_0x1966dc['type']===_0x28a57d(0x227)){Y('←\x20'+_0x1966dc['type']+_0x28a57d(0x22a)+_0x1966dc['inbox_count']+_0x28a57d(0x1d2)+(_0x1966dc[_0x28a57d(0x1ee)]||_0x28a57d(0x1c7)));let _0x314ef9=await P(_0x28a57d(0x233),{'alias':Z,'limit':0x5});if(_0x314ef9?.['ok']&&_0x314ef9[_0x28a57d(0x209)]?.[_0x28a57d(0x1b4)]>0x0)for(let _0xda1ec9 of _0x314ef9[_0x28a57d(0x209)]){let _0x211612={'sender':_0xda1ec9[_0x28a57d(0x231)]||_0x28a57d(0x202),'sender_id':_0x28a57d(0x1d9),'user':_0xda1ec9[_0x28a57d(0x231)]||'hub','task_id':_0xda1ec9['id'],'priority':_0xda1ec9['priority']||_0x28a57d(0x1c7)};k[_0x28a57d(0x228)](_0xda1ec9['id'],_0xda1ec9[_0x28a57d(0x231)]||_0x28a57d(0x202)),await K[_0x28a57d(0x1eb)]({'method':_0x28a57d(0x1df),'params':{'content':_0xda1ec9[_0x28a57d(0x23e)],'meta':_0x211612}}),Y(_0x28a57d(0x1b7)+_0xda1ec9['id'][_0x28a57d(0x1f3)](0x0,0x8)+_0x28a57d(0x1f8)+_0xda1ec9[_0x28a57d(0x231)]+':\x20'+_0xda1ec9[_0x28a57d(0x23e)][_0x28a57d(0x1f3)](0x0,0x3c)),await P(_0x28a57d(0x236),{'alias':Z,'message_id':_0xda1ec9['id']});}}}async function A(){const _0xefeb04=a0_0x52c031;let _0xde6f50=new a0_0x4c09c9();await K['connect'](_0xde6f50),Y(_0xefeb04(0x216)),Y('starting\x20SSE\x20listener...'),u()[_0xefeb04(0x21b)](_0x3a561c=>Y(_0xefeb04(0x1b6)+_0x3a561c)),P(_0xefeb04(0x204),{'resume_id':w,'alias':Z,'status':_0xefeb04(0x1e0),'server':a0_0x3936f5(),'hostname':a0_0x3936f5(),'agent':_0xefeb04(0x22f),'project_dir':process[_0xefeb04(0x1c0)](),'tmux_name':j||void 0x0})[_0xefeb04(0x1f1)](()=>Y(_0xefeb04(0x21d)+Z+'\x22\x20('+w['slice'](0x0,0x8)+')'))[_0xefeb04(0x21b)](_0x4057af=>Y(_0xefeb04(0x1c3)+_0x4057af)),setInterval(()=>{const _0x1f9537=_0xefeb04;P(_0x1f9537(0x204),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x3936f5(),'hostname':a0_0x3936f5(),'agent':_0x1f9537(0x22f),'project_dir':process[_0x1f9537(0x1c0)](),'tmux_name':j||void 0x0})['catch'](_0x24ff68=>Y(_0x1f9537(0x1bb)+_0x24ff68));},0x2bf20),Y(_0xefeb04(0x1d8));}A()[a0_0x52c031(0x21b)](_0xf4155b=>{const _0x230ee7=a0_0x52c031;Y('fatal:\x20'+_0xf4155b),process[_0x230ee7(0x229)](0x1);});async function N(){const _0xf68062=a0_0x52c031;Y('shutting\x20down,\x20reporting\x20offline...'),await P(_0xf68062(0x204),{'resume_id':w,'alias':Z,'status':_0xf68062(0x21a),'task':_0xf68062(0x1d0)})[_0xf68062(0x21b)](()=>{}),process['exit'](0x0);}process['stdin']['on']('end',()=>N()),process['on'](a0_0x52c031(0x1b3),()=>N()),process['on'](a0_0x52c031(0x1f0),()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.1.8-preview.5",
3
+ "version": "2.1.8-preview.6",
4
4
  "description": "AI Agent Network CLI — Create multi-agent networks with user management, network isolation, and 3 AI runtimes (Claude/Codex/MiniMax). 39 commands.",
5
5
  "type": "module",
6
6
  "main": "dist/src/client.js",