@sleep2agi/agent-network 2.0.0-preview.9 → 2.0.1-preview.0

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_0x43a56d=a0_0x1ad7;(function(_0x14ce48,_0x5505c1){const _0x4cf93d=a0_0x1ad7,_0x6c4936=_0x14ce48();while(!![]){try{const _0x536f10=-parseInt(_0x4cf93d(0x181))/0x1*(-parseInt(_0x4cf93d(0x13b))/0x2)+-parseInt(_0x4cf93d(0x143))/0x3+-parseInt(_0x4cf93d(0x163))/0x4+parseInt(_0x4cf93d(0x16c))/0x5+parseInt(_0x4cf93d(0x175))/0x6+-parseInt(_0x4cf93d(0x156))/0x7*(-parseInt(_0x4cf93d(0x166))/0x8)+-parseInt(_0x4cf93d(0x149))/0x9;if(_0x536f10===_0x5505c1)break;else _0x6c4936['push'](_0x6c4936['shift']());}catch(_0xa7b277){_0x6c4936['push'](_0x6c4936['shift']());}}}(a0_0x1e3b,0xe5e52));import{EventEmitter as a0_0x55480e}from'events';function a0_0x1ad7(_0x59f56c,_0x3cf57d){_0x59f56c=_0x59f56c-0x138;const _0x1e3b01=a0_0x1e3b();let _0x1ad791=_0x1e3b01[_0x59f56c];return _0x1ad791;}import{hostname as a0_0x2bd85f}from'os';function a0_0x1e3b(){const _0x1a8867=['3728730QxnHqZ','getReader','emit','cwd','decode','alias','running','sleep','AbortError','10028364VaRtuP','connect','new_task','Authorization','message','offline','new_message','application/json','2.0','replace','body','application/json,\x20text/event-stream','17CAdSPJ','abort','data:\x20','registered','202318dTffTo','toTimeString','name','type','idle','s...','reply','disconnect','3051834UlACDd','sdk-','heartbeatTimer','server','stringify','resumeId','22674258xyeaFs','Bearer\x20','SSE\x20failed:\x20','slice','/events/','text','call','messages','url','heartbeatInterval','processInbox','POST','reconnectDelay','216881OtgHqU','token','parse','agent','match','normal','status','SSE\x20error:\x20','pop','connected','task','catch','now','5202608ZsqvQg','log','sseAbort','424IoWZfM','send_task','connectSSE','tools/call','SSE\x20reconnecting\x20in\x20','SSE\x20connected'];a0_0x1e3b=function(){return _0x1a8867;};return a0_0x1e3b();}class T extends a0_0x55480e{['url'];[a0_0x43a56d(0x171)];['token'];[a0_0x43a56d(0x159)];[a0_0x43a56d(0x148)];['heartbeatInterval'];[a0_0x43a56d(0x155)];[a0_0x43a56d(0x145)];[a0_0x43a56d(0x165)];['running']=!0x1;constructor(_0x1d9604){const _0x37e094=a0_0x43a56d;super();if(this[_0x37e094(0x151)]=_0x1d9604[_0x37e094(0x151)][_0x37e094(0x17e)](/\/$/,''),this['alias']=_0x1d9604['alias'],this[_0x37e094(0x157)]=_0x1d9604[_0x37e094(0x157)],this[_0x37e094(0x159)]=_0x1d9604[_0x37e094(0x159)]||'sdk',this[_0x37e094(0x148)]=_0x37e094(0x144)+_0x1d9604[_0x37e094(0x171)]+'-'+Date[_0x37e094(0x162)]()['toString'](0x24),this[_0x37e094(0x152)]=_0x1d9604['heartbeatInterval']??0x2bf20,this[_0x37e094(0x155)]=_0x1d9604[_0x37e094(0x155)]??0xbb8,_0x1d9604['autoConnect']!==!0x1)this['connect']();}[a0_0x43a56d(0x164)](_0x673cc1){const _0x52f9a3=a0_0x43a56d;console[_0x52f9a3(0x164)]('['+new Date()[_0x52f9a3(0x13c)]()[_0x52f9a3(0x14c)](0x0,0x8)+']\x20[commhub:'+this[_0x52f9a3(0x171)]+']\x20'+_0x673cc1);}async[a0_0x43a56d(0x14f)](_0x87fa8b,_0x3e8174){const _0x432354=a0_0x43a56d;let _0x3476ed={'Content-Type':_0x432354(0x17c),'Accept':_0x432354(0x180)};if(this[_0x432354(0x157)])_0x3476ed[_0x432354(0x178)]=_0x432354(0x14a)+this[_0x432354(0x157)];let _0x59f47a=await(await fetch(this[_0x432354(0x151)]+'/mcp',{'method':_0x432354(0x154),'headers':_0x3476ed,'body':JSON[_0x432354(0x147)]({'jsonrpc':_0x432354(0x17d),'id':Date[_0x432354(0x162)](),'method':_0x432354(0x169),'params':{'name':_0x87fa8b,'arguments':_0x3e8174}})}))['text'](),_0x1805d7=_0x59f47a[_0x432354(0x15a)](/data: (.+)/),_0x4baf2e=_0x1805d7?JSON[_0x432354(0x158)](_0x1805d7[0x1]):JSON[_0x432354(0x158)](_0x59f47a),_0x264f3c=_0x4baf2e?.['result']?.['content']?.[0x0]?.[_0x432354(0x14e)];return _0x264f3c?JSON['parse'](_0x264f3c):_0x4baf2e;}async[a0_0x43a56d(0x176)](){const _0x10fe40=a0_0x43a56d;if(this[_0x10fe40(0x172)])return;this[_0x10fe40(0x172)]=!0x0,await this[_0x10fe40(0x15c)](_0x10fe40(0x13f)),this[_0x10fe40(0x164)](_0x10fe40(0x13a)),this['heartbeatTimer']=setInterval(()=>{const _0x5eea76=_0x10fe40;this[_0x5eea76(0x15c)]('idle')['catch'](_0x5a1349=>this['log']('heartbeat\x20failed:\x20'+_0x5a1349[_0x5eea76(0x179)]));},this[_0x10fe40(0x152)]),this[_0x10fe40(0x168)]();}async[a0_0x43a56d(0x142)](){const _0x1e23a3=a0_0x43a56d;if(this[_0x1e23a3(0x172)]=!0x1,this['sseAbort']?.[_0x1e23a3(0x138)](),this[_0x1e23a3(0x145)])clearInterval(this[_0x1e23a3(0x145)]);await this[_0x1e23a3(0x15c)](_0x1e23a3(0x17a))[_0x1e23a3(0x161)](()=>{}),this[_0x1e23a3(0x164)]('disconnected');}async['send'](_0x599130,_0x5dcaed,_0x4ebac7=a0_0x43a56d(0x15b)){const _0x26b342=a0_0x43a56d;return this[_0x26b342(0x14f)](_0x26b342(0x167),{'alias':_0x599130,'task':_0x5dcaed,'priority':_0x4ebac7,'from_session':this['alias']});}async[a0_0x43a56d(0x179)](_0x4960ff,_0x21fc76){const _0x1841cb=a0_0x43a56d;return this[_0x1841cb(0x14f)]('send_message',{'alias':_0x4960ff,'message':_0x21fc76,'from_session':this['alias']});}async['reply'](_0x4ba2f8,_0x5155a9,_0x40573e='completed'){const _0x4a7def=a0_0x43a56d;return this['call'](_0x4a7def(0x141),{'task_id':_0x4ba2f8,'text':_0x5155a9,'status':_0x40573e});}async[a0_0x43a56d(0x15c)](_0x217468,_0x31530b){const _0x537d59=a0_0x43a56d;return this[_0x537d59(0x14f)]('report_status',{'resume_id':this['resumeId'],'alias':this[_0x537d59(0x171)],'status':_0x217468,'server':a0_0x2bd85f(),'hostname':a0_0x2bd85f(),'agent':this['agent'],'project_dir':process[_0x537d59(0x16f)](),..._0x31530b});}async['getAllStatus'](){const _0x6df08d=a0_0x43a56d;return this[_0x6df08d(0x14f)]('get_all_status',{});}async['broadcast'](_0x15326a,_0x4505d8){const _0x4cb16f=a0_0x43a56d;return this[_0x4cb16f(0x14f)]('broadcast',{'message':_0x15326a,'filter_server':_0x4505d8?.[_0x4cb16f(0x146)],'filter_status':_0x4505d8?.['status']});}async[a0_0x43a56d(0x168)](){const _0x15e1d7=a0_0x43a56d;let _0x57c697=encodeURIComponent(this[_0x15e1d7(0x171)]),_0x103880=this[_0x15e1d7(0x151)]+_0x15e1d7(0x14d)+_0x57c697,_0x5a342f=this[_0x15e1d7(0x155)];while(this[_0x15e1d7(0x172)]){try{this[_0x15e1d7(0x165)]=new AbortController();let _0x116dc6={'Accept':'text/event-stream'};if(this[_0x15e1d7(0x157)])_0x116dc6['Authorization']=_0x15e1d7(0x14a)+this[_0x15e1d7(0x157)];let _0x1fd56d=await fetch(_0x103880,{'headers':_0x116dc6,'signal':this[_0x15e1d7(0x165)]['signal']});if(!_0x1fd56d['ok']||!_0x1fd56d[_0x15e1d7(0x17f)]){this['log'](_0x15e1d7(0x14b)+_0x1fd56d['status']),await this['sleep'](_0x5a342f),_0x5a342f=Math['min'](_0x5a342f*1.5,0xea60);continue;}_0x5a342f=this[_0x15e1d7(0x155)];let _0x4cb329=_0x1fd56d[_0x15e1d7(0x17f)][_0x15e1d7(0x16d)](),_0x507d9f=new TextDecoder(),_0xa0627b='';while(this['running']){let {done:_0x2d24c7,value:_0x4b493c}=await _0x4cb329['read']();if(_0x2d24c7)break;_0xa0627b+=_0x507d9f[_0x15e1d7(0x170)](_0x4b493c,{'stream':!0x0});let _0x5a65cd=_0xa0627b['split']('\x0a');_0xa0627b=_0x5a65cd[_0x15e1d7(0x15e)]()||'';for(let _0x4a4cd9 of _0x5a65cd){if(!_0x4a4cd9['startsWith'](_0x15e1d7(0x139)))continue;try{let _0x3d56d3=JSON['parse'](_0x4a4cd9['slice'](0x6));if(_0x3d56d3[_0x15e1d7(0x13e)]===_0x15e1d7(0x15f)){this['log'](_0x15e1d7(0x16b)),this['emit'](_0x15e1d7(0x15f));continue;}if(_0x3d56d3['type']===_0x15e1d7(0x177)||_0x3d56d3[_0x15e1d7(0x13e)]===_0x15e1d7(0x17b)||_0x3d56d3['type']==='broadcast')await this[_0x15e1d7(0x153)]();}catch{}}}}catch(_0x4d72a8){if(_0x4d72a8[_0x15e1d7(0x13d)]===_0x15e1d7(0x174))break;this[_0x15e1d7(0x16e)]('error',_0x4d72a8),this[_0x15e1d7(0x164)](_0x15e1d7(0x15d)+_0x4d72a8[_0x15e1d7(0x179)]);}if(this[_0x15e1d7(0x172)])this[_0x15e1d7(0x16e)]('disconnected'),this[_0x15e1d7(0x164)](_0x15e1d7(0x16a)+_0x5a342f/0x3e8+_0x15e1d7(0x140)),await this['sleep'](_0x5a342f),_0x5a342f=Math['min'](_0x5a342f*1.5,0xea60);}}async[a0_0x43a56d(0x153)](){const _0xeae61b=a0_0x43a56d;try{let _0x4a07d0=(await this[_0xeae61b(0x14f)]('get_inbox',{'alias':this[_0xeae61b(0x171)],'limit':0xa}))?.[_0xeae61b(0x150)]||[];for(let _0x549bcc of _0x4a07d0)await this[_0xeae61b(0x14f)]('ack_inbox',{'alias':this[_0xeae61b(0x171)],'message_id':_0x549bcc['id']}),this[_0xeae61b(0x164)]('←\x20'+_0x549bcc['from_session']+':\x20'+_0x549bcc['content'][_0xeae61b(0x14c)](0x0,0x3c)),this[_0xeae61b(0x16e)](_0xeae61b(0x160),_0x549bcc),this[_0xeae61b(0x16e)](_0xeae61b(0x179),_0x549bcc);}catch(_0x2815ad){this['log']('inbox\x20error:\x20'+_0x2815ad[_0xeae61b(0x179)]);}}[a0_0x43a56d(0x173)](_0x19b19d){return new Promise(_0x8fb3aa=>setTimeout(_0x8fb3aa,_0x19b19d));}}var $=T;export{$ as default,T as CommHub};
1
+ function a0_0x223a(){const _0x3c5548=['heartbeatInterval','10xpfVmg','resumeId','offline','application/json','now','registered','new_message','getAllStatus','normal','1710216jkJtgm','parse','task','2.0','message','disconnect','match','result','status','reply','89114cIVese','toString','POST','report_status','from_session','connect','messages','235gSOrki','pop','SSE\x20failed:\x20',']\x20[commhub:','split','heartbeatTimer','sleep','10947607XaoGFm','get_all_status','replace','1928871QvAPMc','log','1792vHgmoj','/mcp','41274BsUoPv','connected','emit','997578dgnEwf','getReader','/events/','tools/call','SSE\x20reconnecting\x20in\x20','agent','call','url','Bearer\x20','inbox\x20error:\x20','min','text','send_message','type','Authorization','SSE\x20connected','sseAbort','AbortError','slice','4JyTWKT','cwd','error','server','alias','get_inbox','connectSSE','15616JLdVoq','idle','heartbeat\x20failed:\x20','decode','body','token','sdk-','broadcast','reconnectDelay','autoConnect','content','disconnected','send','processInbox','running'];a0_0x223a=function(){return _0x3c5548;};return a0_0x223a();}const a0_0xef29a8=a0_0x3363;(function(_0x504ff3,_0x1d0608){const _0x23057c=a0_0x3363,_0xf24c5=_0x504ff3();while(!![]){try{const _0x4ce9d9=parseInt(_0x23057c(0x116))/0x1*(parseInt(_0x23057c(0xec))/0x2)+parseInt(_0x23057c(0x12e))/0x3+parseInt(_0x23057c(0x10c))/0x4+-parseInt(_0x23057c(0x11d))/0x5*(parseInt(_0x23057c(0x12b))/0x6)+-parseInt(_0x23057c(0x129))/0x7*(-parseInt(_0x23057c(0xf3))/0x8)+parseInt(_0x23057c(0x127))/0x9+parseInt(_0x23057c(0x103))/0xa*(-parseInt(_0x23057c(0x124))/0xb);if(_0x4ce9d9===_0x1d0608)break;else _0xf24c5['push'](_0xf24c5['shift']());}catch(_0x1022d6){_0xf24c5['push'](_0xf24c5['shift']());}}}(a0_0x223a,0x517dd));import{EventEmitter as a0_0x2784ee}from'events';import{hostname as a0_0x521ce2}from'os';function a0_0x3363(_0x367f58,_0x4e1291){_0x367f58=_0x367f58-0xe2;const _0x223a8a=a0_0x223a();let _0x336326=_0x223a8a[_0x367f58];return _0x336326;}class T extends a0_0x2784ee{[a0_0xef29a8(0x135)];[a0_0xef29a8(0xf0)];[a0_0xef29a8(0xf8)];['agent'];[a0_0xef29a8(0x104)];[a0_0xef29a8(0x102)];[a0_0xef29a8(0xfb)];[a0_0xef29a8(0x122)];[a0_0xef29a8(0xe9)];[a0_0xef29a8(0x101)]=!0x1;constructor(_0x3f5b6b){const _0x2a9da6=a0_0xef29a8;super();if(this[_0x2a9da6(0x135)]=_0x3f5b6b['url'][_0x2a9da6(0x126)](/\/$/,''),this[_0x2a9da6(0xf0)]=_0x3f5b6b[_0x2a9da6(0xf0)],this[_0x2a9da6(0xf8)]=_0x3f5b6b[_0x2a9da6(0xf8)],this[_0x2a9da6(0x133)]=_0x3f5b6b[_0x2a9da6(0x133)]||'sdk',this['resumeId']=_0x2a9da6(0xf9)+_0x3f5b6b['alias']+'-'+Date[_0x2a9da6(0x107)]()[_0x2a9da6(0x117)](0x24),this[_0x2a9da6(0x102)]=_0x3f5b6b[_0x2a9da6(0x102)]??0x2bf20,this['reconnectDelay']=_0x3f5b6b[_0x2a9da6(0xfb)]??0xbb8,_0x3f5b6b[_0x2a9da6(0xfc)]!==!0x1)this[_0x2a9da6(0x11b)]();}['log'](_0x19fa64){const _0xb41d30=a0_0xef29a8;console[_0xb41d30(0x128)]('['+new Date()['toTimeString']()[_0xb41d30(0xeb)](0x0,0x8)+_0xb41d30(0x120)+this[_0xb41d30(0xf0)]+']\x20'+_0x19fa64);}async['call'](_0x3517a,_0x276ec0){const _0x55ed06=a0_0xef29a8;let _0x13d4d7={'Content-Type':_0x55ed06(0x106),'Accept':'application/json,\x20text/event-stream'};if(this[_0x55ed06(0xf8)])_0x13d4d7[_0x55ed06(0xe7)]=_0x55ed06(0x136)+this[_0x55ed06(0xf8)];let _0x3506fd=await(await fetch(this[_0x55ed06(0x135)]+_0x55ed06(0x12a),{'method':_0x55ed06(0x118),'headers':_0x13d4d7,'body':JSON['stringify']({'jsonrpc':_0x55ed06(0x10f),'id':Date[_0x55ed06(0x107)](),'method':_0x55ed06(0x131),'params':{'name':_0x3517a,'arguments':_0x276ec0}})}))[_0x55ed06(0xe4)](),_0x107c7a=_0x3506fd[_0x55ed06(0x112)](/data: (.+)/),_0x5dd893=_0x107c7a?JSON[_0x55ed06(0x10d)](_0x107c7a[0x1]):JSON['parse'](_0x3506fd),_0x2eb7f9=_0x5dd893?.[_0x55ed06(0x113)]?.[_0x55ed06(0xfd)]?.[0x0]?.[_0x55ed06(0xe4)];return _0x2eb7f9?JSON[_0x55ed06(0x10d)](_0x2eb7f9):_0x5dd893;}async[a0_0xef29a8(0x11b)](){const _0x39ee87=a0_0xef29a8;if(this['running'])return;this['running']=!0x0,await this['status'](_0x39ee87(0xf4)),this[_0x39ee87(0x128)](_0x39ee87(0x108)),this[_0x39ee87(0x122)]=setInterval(()=>{const _0x2bfb19=_0x39ee87;this['status'](_0x2bfb19(0xf4))['catch'](_0x51d8f4=>this[_0x2bfb19(0x128)](_0x2bfb19(0xf5)+_0x51d8f4['message']));},this[_0x39ee87(0x102)]),this[_0x39ee87(0xf2)]();}async[a0_0xef29a8(0x111)](){const _0x1d3812=a0_0xef29a8;if(this[_0x1d3812(0x101)]=!0x1,this[_0x1d3812(0xe9)]?.['abort'](),this[_0x1d3812(0x122)])clearInterval(this[_0x1d3812(0x122)]);await this[_0x1d3812(0x114)](_0x1d3812(0x105))['catch'](()=>{}),this[_0x1d3812(0x128)](_0x1d3812(0xfe));}async[a0_0xef29a8(0xff)](_0x5697ca,_0x565fc4,_0x26e1fc=a0_0xef29a8(0x10b)){const _0x51c28f=a0_0xef29a8;return this[_0x51c28f(0x134)]('send_task',{'alias':_0x5697ca,'task':_0x565fc4,'priority':_0x26e1fc,'from_session':this['alias']});}async[a0_0xef29a8(0x110)](_0x539344,_0x281ee3){const _0x5b702f=a0_0xef29a8;return this['call'](_0x5b702f(0xe5),{'alias':_0x539344,'message':_0x281ee3,'from_session':this[_0x5b702f(0xf0)]});}async[a0_0xef29a8(0x115)](_0x47ae66,_0x609bd7,_0x2eada7='completed'){const _0x20b1eb=a0_0xef29a8;return this['call'](_0x20b1eb(0x115),{'task_id':_0x47ae66,'text':_0x609bd7,'status':_0x2eada7});}async[a0_0xef29a8(0x114)](_0x41758c,_0x338ed9){const _0x298777=a0_0xef29a8;return this['call'](_0x298777(0x119),{'resume_id':this['resumeId'],'alias':this[_0x298777(0xf0)],'status':_0x41758c,'server':a0_0x521ce2(),'hostname':a0_0x521ce2(),'agent':this[_0x298777(0x133)],'project_dir':process[_0x298777(0xed)](),..._0x338ed9});}async[a0_0xef29a8(0x10a)](){const _0x307676=a0_0xef29a8;return this[_0x307676(0x134)](_0x307676(0x125),{});}async['broadcast'](_0x14ef30,_0x353ea3){const _0x4a4e98=a0_0xef29a8;return this[_0x4a4e98(0x134)](_0x4a4e98(0xfa),{'message':_0x14ef30,'filter_server':_0x353ea3?.[_0x4a4e98(0xef)],'filter_status':_0x353ea3?.[_0x4a4e98(0x114)]});}async[a0_0xef29a8(0xf2)](){const _0x2b1574=a0_0xef29a8;let _0x5a8246=encodeURIComponent(this[_0x2b1574(0xf0)]),_0x466b41=this[_0x2b1574(0x135)]+_0x2b1574(0x130)+_0x5a8246,_0x1e55a2=this['reconnectDelay'];while(this[_0x2b1574(0x101)]){try{this[_0x2b1574(0xe9)]=new AbortController();let _0x9e302d={'Accept':'text/event-stream'};if(this['token'])_0x9e302d[_0x2b1574(0xe7)]=_0x2b1574(0x136)+this[_0x2b1574(0xf8)];let _0x16c7cc=await fetch(_0x466b41,{'headers':_0x9e302d,'signal':this[_0x2b1574(0xe9)]['signal']});if(!_0x16c7cc['ok']||!_0x16c7cc[_0x2b1574(0xf7)]){this[_0x2b1574(0x128)](_0x2b1574(0x11f)+_0x16c7cc['status']),await this[_0x2b1574(0x123)](_0x1e55a2),_0x1e55a2=Math[_0x2b1574(0xe3)](_0x1e55a2*1.5,0xea60);continue;}_0x1e55a2=this[_0x2b1574(0xfb)];let _0x152bcb=_0x16c7cc[_0x2b1574(0xf7)][_0x2b1574(0x12f)](),_0x4dd182=new TextDecoder(),_0x388940='';while(this[_0x2b1574(0x101)]){let {done:_0x90e089,value:_0x44ad62}=await _0x152bcb['read']();if(_0x90e089)break;_0x388940+=_0x4dd182[_0x2b1574(0xf6)](_0x44ad62,{'stream':!0x0});let _0x827bb=_0x388940[_0x2b1574(0x121)]('\x0a');_0x388940=_0x827bb[_0x2b1574(0x11e)]()||'';for(let _0x81c7bb of _0x827bb){if(!_0x81c7bb['startsWith']('data:\x20'))continue;try{let _0x8727b0=JSON['parse'](_0x81c7bb[_0x2b1574(0xeb)](0x6));if(_0x8727b0[_0x2b1574(0xe6)]===_0x2b1574(0x12c)){this['log'](_0x2b1574(0xe8)),this['emit'](_0x2b1574(0x12c));continue;}if(_0x8727b0[_0x2b1574(0xe6)]==='new_task'||_0x8727b0[_0x2b1574(0xe6)]===_0x2b1574(0x109)||_0x8727b0['type']===_0x2b1574(0xfa))await this[_0x2b1574(0x100)]();}catch{}}}}catch(_0x956532){if(_0x956532['name']===_0x2b1574(0xea))break;this[_0x2b1574(0x12d)](_0x2b1574(0xee),_0x956532),this[_0x2b1574(0x128)]('SSE\x20error:\x20'+_0x956532[_0x2b1574(0x110)]);}if(this[_0x2b1574(0x101)])this[_0x2b1574(0x12d)]('disconnected'),this[_0x2b1574(0x128)](_0x2b1574(0x132)+_0x1e55a2/0x3e8+'s...'),await this['sleep'](_0x1e55a2),_0x1e55a2=Math[_0x2b1574(0xe3)](_0x1e55a2*1.5,0xea60);}}async['processInbox'](){const _0x311a3e=a0_0xef29a8;try{let _0x351a1f=(await this[_0x311a3e(0x134)](_0x311a3e(0xf1),{'alias':this['alias'],'limit':0xa}))?.[_0x311a3e(0x11c)]||[];for(let _0x1754aa of _0x351a1f)await this[_0x311a3e(0x134)]('ack_inbox',{'alias':this[_0x311a3e(0xf0)],'message_id':_0x1754aa['id']}),this[_0x311a3e(0x128)]('←\x20'+_0x1754aa[_0x311a3e(0x11a)]+':\x20'+_0x1754aa['content'][_0x311a3e(0xeb)](0x0,0x3c)),this['emit'](_0x311a3e(0x10e),_0x1754aa),this[_0x311a3e(0x12d)](_0x311a3e(0x110),_0x1754aa);}catch(_0x454899){this['log'](_0x311a3e(0xe2)+_0x454899[_0x311a3e(0x110)]);}}[a0_0xef29a8(0x123)](_0x3ae096){return new Promise(_0x40fe90=>setTimeout(_0x40fe90,_0x3ae096));}}var $=T;export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x344305=a0_0x57e0;(function(_0x3a5e4a,_0x5d6927){const _0x4065c5=a0_0x57e0,_0x8bad6a=_0x3a5e4a();while(!![]){try{const _0x3a2071=parseInt(_0x4065c5(0x17b))/0x1*(parseInt(_0x4065c5(0x129))/0x2)+parseInt(_0x4065c5(0x12b))/0x3*(-parseInt(_0x4065c5(0x158))/0x4)+parseInt(_0x4065c5(0x15e))/0x5+-parseInt(_0x4065c5(0x184))/0x6*(parseInt(_0x4065c5(0x139))/0x7)+parseInt(_0x4065c5(0x186))/0x8*(parseInt(_0x4065c5(0x16c))/0x9)+parseInt(_0x4065c5(0x173))/0xa*(-parseInt(_0x4065c5(0x183))/0xb)+parseInt(_0x4065c5(0x127))/0xc;if(_0x3a2071===_0x5d6927)break;else _0x8bad6a['push'](_0x8bad6a['shift']());}catch(_0x3234ba){_0x8bad6a['push'](_0x8bad6a['shift']());}}}(a0_0x2ac8,0x33ea3));import{readFileSync as a0_0x50af8b,existsSync as a0_0x31c8b9}from'fs';import{join as a0_0x470b38}from'path';import{hostname as a0_0x4ded6d}from'os';import{execSync as a0_0x102278}from'child_process';import{Server as a0_0x48847b}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x103f7b}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x523fbe,CallToolRequestSchema as a0_0x1975f7}from'@modelcontextprotocol/sdk/types.js';function p(_0x5435e1){const _0x26ef96=a0_0x57e0;if(!a0_0x31c8b9(_0x5435e1))return;for(let _0x294ccd of a0_0x50af8b(_0x5435e1,_0x26ef96(0x193))['split']('\x0a')){let _0x5a3728=_0x294ccd['trim']();if(!_0x5a3728||_0x5a3728[_0x26ef96(0x1a3)]('#'))continue;let _0x127bce=_0x5a3728[_0x26ef96(0x14b)]('=');if(_0x127bce<0x0)continue;let _0x465756=_0x5a3728[_0x26ef96(0x159)](0x0,_0x127bce)[_0x26ef96(0x176)](),_0x54903c=_0x5a3728[_0x26ef96(0x159)](_0x127bce+0x1)[_0x26ef96(0x176)]()[_0x26ef96(0x155)](/^["']|["']$/g,'');if(!process.env[_0x465756])process.env[_0x465756]=_0x54903c;}}var C=process.env.HOME||'~',T=a0_0x470b38(C,a0_0x344305(0x195));p(a0_0x470b38(T,a0_0x344305(0x1a5)));var L=process[a0_0x344305(0x135)]()['replace'](/\//g,'-');p(a0_0x470b38(T,L,'.env'));function U(){const _0x195b68=a0_0x344305;try{return a0_0x102278(_0x195b68(0x172),{'encoding':_0x195b68(0x193),'timeout':0x7d0})['trim']();}catch{return'';}}function c(){const _0x2650a6=a0_0x344305;try{let _0x319fb8=a0_0x470b38(C,_0x2650a6(0x17e),_0x2650a6(0x13c));if(a0_0x31c8b9(_0x319fb8))return JSON[_0x2650a6(0x128)](a0_0x50af8b(_0x319fb8,_0x2650a6(0x193)));}catch{}return{};}var H=c(),D=process.env.COMMHUB_URL||H[a0_0x344305(0x182)]||a0_0x344305(0x19e),f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0x4ded6d(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto[a0_0x344305(0x194)](),X=process.env.COMMHUB_TOKEN||H['token']||'';function Y(_0x2e5899){const _0x2e6d19=a0_0x344305;let _0x32810f=new Date()['toTimeString']()[_0x2e6d19(0x159)](0x0,0x8);process['stderr']['write']('['+_0x32810f+_0x2e6d19(0x177)+_0x2e5899+'\x0a');}function h(_0x12a626){return new Promise(_0x272652=>setTimeout(_0x272652,_0x12a626));}function a0_0x57e0(_0x2e8cdf,_0x3d6fe8){_0x2e8cdf=_0x2e8cdf-0x11f;const _0x2ac8c0=a0_0x2ac8();let _0x57e08c=_0x2ac8c0[_0x2e8cdf];return _0x57e08c;}Y(a0_0x344305(0x198)+D+a0_0x344305(0x138)+Z+a0_0x344305(0x12a)+w['slice'](0x0,0x8)+a0_0x344305(0x192)+(f||'none')+a0_0x344305(0x19c)+process['cwd']()+'\x20PROJECT_ENV='+L);var k=new Map(),K=new a0_0x48847b({'name':a0_0x344305(0x1a4),'version':a0_0x344305(0x160)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x344305(0x14e),a0_0x344305(0x17a),a0_0x344305(0x1ac),'You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','Session\x20alias:\x20'+Z][a0_0x344305(0x161)]('\x0a')});K[a0_0x344305(0x134)](a0_0x523fbe,async()=>({'tools':[{'name':'commhub_reply','description':'Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','inputSchema':{'type':'object','properties':{'task_id':{'type':a0_0x344305(0x140),'description':a0_0x344305(0x14c)},'text':{'type':a0_0x344305(0x140),'description':a0_0x344305(0x199)},'status':{'type':a0_0x344305(0x140),'enum':[a0_0x344305(0x146),'failed',a0_0x344305(0x16d),a0_0x344305(0x151),a0_0x344305(0x1ad),a0_0x344305(0x170)],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':[a0_0x344305(0x174)]}},{'name':a0_0x344305(0x14d),'description':a0_0x344305(0x1a1),'inputSchema':{'type':'object','properties':{'status':{'type':'string','enum':[a0_0x344305(0x143),'idle',a0_0x344305(0x151),'error']},'task':{'type':a0_0x344305(0x140),'description':a0_0x344305(0x1a2)},'progress':{'type':'number','description':a0_0x344305(0x188)}},'required':[a0_0x344305(0x181)]}},{'name':'commhub_send_task','description':a0_0x344305(0x1a8),'inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x344305(0x140),'description':a0_0x344305(0x11f)},'task':{'type':a0_0x344305(0x140),'description':a0_0x344305(0x157)},'priority':{'type':'string','enum':[a0_0x344305(0x15b),a0_0x344305(0x124),a0_0x344305(0x125)],'description':'Priority\x20(default:\x20normal)'}},'required':[a0_0x344305(0x149),a0_0x344305(0x19d)]}},{'name':a0_0x344305(0x122),'description':a0_0x344305(0x15d),'inputSchema':{'type':a0_0x344305(0x163),'properties':{'alias':{'type':a0_0x344305(0x140),'description':a0_0x344305(0x11f)},'message':{'type':'string','description':a0_0x344305(0x14a)}},'required':[a0_0x344305(0x149),'message']}},{'name':a0_0x344305(0x13b),'description':'Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','inputSchema':{'type':a0_0x344305(0x163),'properties':{}}}]}));async function P(_0x500f15,_0x16bd77){const _0xd2758f=a0_0x344305;let _0x5bd512=await fetch(D+_0xd2758f(0x196),{'method':_0xd2758f(0x191),'headers':{'Content-Type':_0xd2758f(0x12f),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0xd2758f(0x137)+X}:{}},'body':JSON['stringify']({'jsonrpc':_0xd2758f(0x130),'id':0x1,'method':_0xd2758f(0x16e),'params':{'protocolVersion':_0xd2758f(0x15a),'capabilities':{},'clientInfo':{'name':_0xd2758f(0x1a4),'version':_0xd2758f(0x160)}}})});if(!_0x5bd512['ok']){let _0x1ef240=await _0x5bd512[_0xd2758f(0x174)]();return Y(_0xd2758f(0x18f)+_0x5bd512[_0xd2758f(0x181)]+'\x20'+_0x1ef240[_0xd2758f(0x159)](0x0,0x64)),{'ok':!0x1,'error':_0xd2758f(0x1a9)+_0x5bd512[_0xd2758f(0x181)]};}await _0x5bd512[_0xd2758f(0x174)]();let _0x4041a5=(await(await fetch(D+_0xd2758f(0x196),{'method':_0xd2758f(0x191),'headers':{'Content-Type':_0xd2758f(0x12f),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON[_0xd2758f(0x13a)]({'jsonrpc':_0xd2758f(0x130),'id':0x2,'method':_0xd2758f(0x190),'params':{'name':_0x500f15,'arguments':_0x16bd77}})}))[_0xd2758f(0x174)]())[_0xd2758f(0x15f)]('\x0a')[_0xd2758f(0x1aa)](_0x1a4ae8=>_0x1a4ae8[_0xd2758f(0x1a3)]('data:\x20'));if(_0x4041a5){let _0x13974e=JSON[_0xd2758f(0x128)](_0x4041a5[_0xd2758f(0x159)](0x6));return _0x13974e?.[_0xd2758f(0x18b)]?.[_0xd2758f(0x142)]?.[0x0]?.[_0xd2758f(0x174)]?JSON[_0xd2758f(0x128)](_0x13974e[_0xd2758f(0x18b)][_0xd2758f(0x142)][0x0][_0xd2758f(0x174)]):_0x13974e;}return{'ok':!0x1,'error':_0xd2758f(0x1a6)};}K[a0_0x344305(0x134)](a0_0x1975f7,async _0x1457f9=>{const _0x45725e=a0_0x344305;let {name:_0x16e683,arguments:_0x344eb4}=_0x1457f9['params'];if(_0x16e683===_0x45725e(0x18e)){let {task_id:_0x3d6518,text:_0x5aa32f,status:_0x27bffa}=_0x344eb4;if(_0x27bffa===_0x45725e(0x146)||_0x27bffa===_0x45725e(0x189)||_0x27bffa==='cancelled'){let _0xfafdac=_0x27bffa==='completed'?_0x45725e(0x156):_0x27bffa,_0x4c5784=_0x3d6518?k[_0x45725e(0x17d)](_0x3d6518)||_0x45725e(0x182):'hub',_0x34d504=await P(_0x45725e(0x147),{'alias':_0x4c5784,'text':_0x5aa32f,'in_reply_to':_0x3d6518||void 0x0,'status':_0xfafdac,'from_session':Z});if(_0x3d6518)k[_0x45725e(0x18c)](_0x3d6518);return{'content':[{'type':'text','text':JSON[_0x45725e(0x13a)](_0x34d504)}]};}let _0x544a7e=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x27bffa===_0x45725e(0x151)?'blocked':_0x27bffa===_0x45725e(0x1ad)?'error':_0x45725e(0x143),'task':_0x5aa32f[_0x45725e(0x159)](0x0,0xc8),'output':_0x5aa32f});return{'content':[{'type':_0x45725e(0x174),'text':JSON[_0x45725e(0x13a)](_0x544a7e)}]};}if(_0x16e683===_0x45725e(0x14d)){let {status:_0x3dd17e,task:_0x49c30e,progress:_0x750c5e}=_0x344eb4,_0x2bb5bd=await P(_0x45725e(0x13f),{'resume_id':w,'alias':Z,'status':_0x3dd17e,'task':_0x49c30e,'progress':_0x750c5e});return{'content':[{'type':'text','text':JSON[_0x45725e(0x13a)](_0x2bb5bd)}]};}if(_0x16e683==='commhub_send_task'){let {alias:_0x13ad6a,task:_0x5c5554,priority:_0x495756}=_0x344eb4,_0x539af7=await P(_0x45725e(0x153),{'alias':_0x13ad6a,'task':_0x5c5554,'priority':_0x495756||'normal','from_session':Z});return{'content':[{'type':_0x45725e(0x174),'text':JSON[_0x45725e(0x13a)](_0x539af7)}]};}if(_0x16e683==='commhub_send_message'){let {alias:_0x560867,message:_0x353bc3}=_0x344eb4,_0xebe8b6=await P('send_message',{'alias':_0x560867,'message':_0x353bc3,'from_session':Z});return{'content':[{'type':_0x45725e(0x174),'text':JSON[_0x45725e(0x13a)](_0xebe8b6)}]};}if(_0x16e683===_0x45725e(0x13b)){let _0x502dda=await P(_0x45725e(0x178),{});return{'content':[{'type':'text','text':JSON[_0x45725e(0x13a)](_0x502dda)}]};}return{'content':[{'type':_0x45725e(0x174),'text':JSON[_0x45725e(0x13a)]({'error':_0x45725e(0x16f)})}]};});async function v(){const _0xc862cf=a0_0x344305;let _0x2985fe=D+'/events/'+encodeURIComponent(Z),_0x520e89={};if(X)_0x520e89['Authorization']=_0xc862cf(0x137)+X;Y(_0xc862cf(0x185)+_0x2985fe);while(!0x0){try{let _0x52a8da=await fetch(_0x2985fe,{'headers':_0x520e89});if(!_0x52a8da['ok']){Y('SSE\x20error:\x20'+_0x52a8da[_0xc862cf(0x181)]+'\x20'+_0x52a8da[_0xc862cf(0x133)]),await h(0x1388);continue;}let _0x3b9816=_0x52a8da[_0xc862cf(0x19a)][_0xc862cf(0x164)](),_0x111078=new TextDecoder(),_0x46f64a='';while(!0x0){let {done:_0x3abbe9,value:_0x53d8c7}=await _0x3b9816[_0xc862cf(0x126)]();if(_0x3abbe9)break;_0x46f64a+=_0x111078[_0xc862cf(0x17c)](_0x53d8c7,{'stream':!0x0});let _0x2ed715=_0x46f64a[_0xc862cf(0x15f)]('\x0a\x0a');_0x46f64a=_0x2ed715[_0xc862cf(0x175)]()||'';for(let _0x27468e of _0x2ed715){let _0x55429d=_0x27468e[_0xc862cf(0x15f)]('\x0a')[_0xc862cf(0x1aa)](_0x1cc534=>_0x1cc534[_0xc862cf(0x1a3)](_0xc862cf(0x12d)));if(!_0x55429d)continue;try{let _0x47ce4e=JSON[_0xc862cf(0x128)](_0x55429d[_0xc862cf(0x159)](0x6));await u(_0x47ce4e);}catch(_0x32504d){Y(_0xc862cf(0x145)+_0x32504d);}}}Y(_0xc862cf(0x148));}catch(_0x368c0b){Y(_0xc862cf(0x132)+_0x368c0b);}await h(0xbb8);}}async function u(_0x53df99){const _0x1258fa=a0_0x344305;if(_0x53df99['type']==='connected'){Y(_0x1258fa(0x166)+Z+'\x22');return;}if(_0x53df99[_0x1258fa(0x1a7)]==='new_message'){if(Y(_0x1258fa(0x150)+_0x53df99[_0x1258fa(0x19b)]+':\x20'+_0x53df99[_0x1258fa(0x16b)][_0x1258fa(0x159)](0x0,0x3c)),await K[_0x1258fa(0x16a)]({'method':'notifications/claude/channel','params':{'content':_0x53df99['message'],'meta':{'sender':_0x53df99[_0x1258fa(0x19b)]||_0x1258fa(0x182),'sender_id':'commhub','user':_0x53df99[_0x1258fa(0x19b)]||_0x1258fa(0x182),'priority':'normal'}}}),_0x53df99[_0x1258fa(0x152)])await P(_0x1258fa(0x123),{'alias':Z,'message_id':_0x53df99[_0x1258fa(0x152)]});return;}if(_0x53df99[_0x1258fa(0x1a7)]===_0x1258fa(0x15c)||_0x53df99[_0x1258fa(0x1a7)]===_0x1258fa(0x131)){Y('←\x20'+_0x53df99[_0x1258fa(0x1a7)]+_0x1258fa(0x13d)+_0x53df99[_0x1258fa(0x12e)]+_0x1258fa(0x169)+(_0x53df99['priority']||_0x1258fa(0x124)));let _0x3ec145=await P(_0x1258fa(0x120),{'alias':Z,'limit':0x5});if(_0x3ec145?.['ok']&&_0x3ec145[_0x1258fa(0x165)]?.[_0x1258fa(0x154)]>0x0)for(let _0x364f63 of _0x3ec145['messages']){let _0x4be15b={'sender':_0x364f63[_0x1258fa(0x168)]||_0x1258fa(0x182),'sender_id':_0x1258fa(0x187),'user':_0x364f63[_0x1258fa(0x168)]||_0x1258fa(0x182),'task_id':_0x364f63['id'],'priority':_0x364f63['priority']||_0x1258fa(0x124)};k[_0x1258fa(0x18d)](_0x364f63['id'],_0x364f63[_0x1258fa(0x168)]||_0x1258fa(0x182)),await K[_0x1258fa(0x16a)]({'method':'notifications/claude/channel','params':{'content':_0x364f63['content'],'meta':_0x4be15b}}),Y(_0x1258fa(0x141)+_0x364f63['id']['slice'](0x0,0x8)+'\x20from\x20'+_0x364f63[_0x1258fa(0x168)]+':\x20'+_0x364f63[_0x1258fa(0x142)][_0x1258fa(0x159)](0x0,0x3c)),await P(_0x1258fa(0x123),{'alias':Z,'message_id':_0x364f63['id']});}}}async function S(){const _0x153fa4=a0_0x344305;let _0x193e7a=new a0_0x103f7b();await K[_0x153fa4(0x14f)](_0x193e7a),Y('MCP\x20stdio\x20connected'),Y(_0x153fa4(0x179)),v()[_0x153fa4(0x180)](_0x34ac6d=>Y(_0x153fa4(0x167)+_0x34ac6d)),P(_0x153fa4(0x13f),{'resume_id':w,'alias':Z,'status':_0x153fa4(0x171),'server':a0_0x4ded6d(),'hostname':a0_0x4ded6d(),'agent':_0x153fa4(0x1a0),'project_dir':process[_0x153fa4(0x135)](),'tmux_name':f||void 0x0})['then'](()=>Y(_0x153fa4(0x12c)+Z+_0x153fa4(0x144)+w[_0x153fa4(0x159)](0x0,0x8)+')'))[_0x153fa4(0x180)](_0x24caba=>Y(_0x153fa4(0x19f)+_0x24caba)),setInterval(()=>{const _0x19617a=_0x153fa4;P('report_status',{'resume_id':w,'alias':Z,'status':_0x19617a(0x171),'server':a0_0x4ded6d(),'hostname':a0_0x4ded6d(),'agent':_0x19617a(0x1a0),'project_dir':process[_0x19617a(0x135)](),'tmux_name':f||void 0x0})[_0x19617a(0x180)](_0x4b8702=>Y(_0x19617a(0x17f)+_0x4b8702));},0x2bf20),Y(_0x153fa4(0x13e));}function a0_0x2ac8(){const _0xc903e0=['setRequestHandler','cwd','SIGINT','Bearer\x20','\x20ALIAS=','2541przLTE','stringify','commhub_get_all_status','config.json',':\x20inbox_count=','ready\x20—\x20waiting\x20for\x20events','report_status','string','→\x20injected\x20task\x20','content','working','\x22\x20(','parse\x20error:\x20','completed','send_reply','SSE\x20stream\x20ended,\x20reconnecting...','alias','Message\x20content','indexOf','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','commhub_report_status','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','connect','←\x20message\x20from\x20','blocked','message_id','send_task','length','replace','replied','Task\x20content','25788MMugxe','slice','2025-03-26','high','new_task','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','1477690RnAXcG','split','0.3.0','join','stdin','object','getReader','messages','SSE\x20connected\x20as\x20\x22','SSE\x20fatal:\x20','from_session','\x20priority=','notification','message','219852iIDZJX','cancelled','initialize','unknown\x20tool','in_progress','idle','tmux\x20display-message\x20-p\x20\x27#S\x27','654170wuXhCl','text','pop','trim',']\x20[commhub]\x20','get_all_status','starting\x20SSE\x20listener...','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','3949uwkQhp','decode','get','.anet','heartbeat\x20failed:\x20','catch','status','hub','11fmIumG','6954CipEom','connecting\x20to\x20','56hUvICF','commhub','Progress\x200-100','failed','shutting\x20down,\x20reporting\x20offline...','result','delete','set','commhub_reply','CommHub\x20init\x20failed:\x20','tools/call','POST','...\x20TMUX=','utf-8','randomUUID','.claude/channels/commhub','/mcp','end','ENV:\x20URL=','Reply\x20text\x20/\x20result\x20summary','body','from','\x20CWD=','task','http://127.0.0.1:9200','warning:\x20could\x20not\x20register:\x20','claude-code','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','Current\x20task\x20description','startsWith','commhub-channel','.env','no\x20response','type','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','init\x20failed:\x20','find','fatal:\x20','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','error','SIGTERM','Target\x20session\x20alias','get_inbox','exit','commhub_send_message','ack_inbox','normal','low','read','3097260aHgSef','parse','62WVFcsX','\x20RESUME_ID=','69KfGmCg','registered\x20as\x20\x22','data:\x20','inbox_count','application/json','2.0','broadcast','SSE\x20connection\x20error:\x20','statusText'];a0_0x2ac8=function(){return _0xc903e0;};return a0_0x2ac8();}S()[a0_0x344305(0x180)](_0x36c71a=>{const _0x511dca=a0_0x344305;Y(_0x511dca(0x1ab)+_0x36c71a),process['exit'](0x1);});async function N(){const _0x46c136=a0_0x344305;Y(_0x46c136(0x18a)),await P(_0x46c136(0x13f),{'resume_id':w,'alias':Z,'status':'error','task':'session\x20disconnected'})[_0x46c136(0x180)](()=>{}),process[_0x46c136(0x121)](0x0);}process[a0_0x344305(0x162)]['on'](a0_0x344305(0x197),()=>N()),process['on'](a0_0x344305(0x1ae),()=>N()),process['on'](a0_0x344305(0x136),()=>N());
2
+ const a0_0x3e6d72=a0_0x17e3;(function(_0x1d3a2b,_0x40421e){const _0x56e7e0=a0_0x17e3,_0xbbec5f=_0x1d3a2b();while(!![]){try{const _0x3023bb=-parseInt(_0x56e7e0(0x22b))/0x1+-parseInt(_0x56e7e0(0x1f1))/0x2*(-parseInt(_0x56e7e0(0x20d))/0x3)+-parseInt(_0x56e7e0(0x233))/0x4*(parseInt(_0x56e7e0(0x215))/0x5)+-parseInt(_0x56e7e0(0x25e))/0x6+-parseInt(_0x56e7e0(0x20e))/0x7*(-parseInt(_0x56e7e0(0x25b))/0x8)+-parseInt(_0x56e7e0(0x211))/0x9*(parseInt(_0x56e7e0(0x236))/0xa)+parseInt(_0x56e7e0(0x254))/0xb;if(_0x3023bb===_0x40421e)break;else _0xbbec5f['push'](_0xbbec5f['shift']());}catch(_0x5d0d4d){_0xbbec5f['push'](_0xbbec5f['shift']());}}}(a0_0x3b9f,0x4b707));import{readFileSync as a0_0x2631e6,existsSync as a0_0x56ee36}from'fs';import{randomUUID as a0_0x1bf8c9}from'crypto';import{join as a0_0x5b5672}from'path';import{hostname as a0_0x342df9}from'os';import{execSync as a0_0x233a98}from'child_process';import{Server as a0_0x198c9f}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x3e4b81}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x4177a8,CallToolRequestSchema as a0_0x443a8f}from'@modelcontextprotocol/sdk/types.js';function p(_0x592312){const _0x34f317=a0_0x17e3;if(!a0_0x56ee36(_0x592312))return;for(let _0x46f4c5 of a0_0x2631e6(_0x592312,_0x34f317(0x210))['split']('\x0a')){let _0x58b316=_0x46f4c5[_0x34f317(0x24c)]();if(!_0x58b316||_0x58b316[_0x34f317(0x231)]('#'))continue;let _0x2a09f4=_0x58b316[_0x34f317(0x266)]('=');if(_0x2a09f4<0x0)continue;let _0x4b3e8e=_0x58b316[_0x34f317(0x208)](0x0,_0x2a09f4)['trim'](),_0x4a79a7=_0x58b316[_0x34f317(0x208)](_0x2a09f4+0x1)['trim']()[_0x34f317(0x27c)](/^["']|["']$/g,'');if(!process.env[_0x4b3e8e])process.env[_0x4b3e8e]=_0x4a79a7;}}var C=process.env.HOME||'~',T=a0_0x5b5672(C,a0_0x3e6d72(0x235));p(a0_0x5b5672(T,'.env'));var L=process[a0_0x3e6d72(0x256)]()[a0_0x3e6d72(0x27c)](/\//g,'-');p(a0_0x5b5672(T,L,a0_0x3e6d72(0x1ff)));function U(){const _0x311930=a0_0x3e6d72;try{return a0_0x233a98(_0x311930(0x227),{'encoding':_0x311930(0x210),'timeout':0x7d0})[_0x311930(0x24c)]();}catch{return'';}}function v(){const _0x3338fd=a0_0x3e6d72;try{let _0x10a3fb=a0_0x5b5672(C,_0x3338fd(0x1f8),'config.json');if(a0_0x56ee36(_0x10a3fb))return JSON[_0x3338fd(0x214)](a0_0x2631e6(_0x10a3fb,_0x3338fd(0x210)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x3e6d72(0x26f)]||'http://127.0.0.1:9200',j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x342df9(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x1bf8c9(),X=process.env.COMMHUB_TOKEN||H[a0_0x3e6d72(0x225)]||'';function Y(_0x2de9c1){const _0xdebd=a0_0x3e6d72;let _0x32128b=new Date()[_0xdebd(0x252)]()['slice'](0x0,0x8);process[_0xdebd(0x22e)][_0xdebd(0x213)]('['+_0x32128b+']\x20[commhub]\x20'+_0x2de9c1+'\x0a');}function h(_0x2175d1){return new Promise(_0x537899=>setTimeout(_0x537899,_0x2175d1));}Y('ENV:\x20URL='+f+'\x20ALIAS='+Z+a0_0x3e6d72(0x203)+w[a0_0x3e6d72(0x208)](0x0,0x8)+'...\x20TMUX='+(j||a0_0x3e6d72(0x24d))+a0_0x3e6d72(0x25c)+process['cwd']()+'\x20PROJECT_ENV='+L);var k=new Map(),K=new a0_0x198c9f({'name':a0_0x3e6d72(0x267),'version':a0_0x3e6d72(0x269)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x3e6d72(0x1fb),a0_0x3e6d72(0x228),a0_0x3e6d72(0x238),a0_0x3e6d72(0x247),a0_0x3e6d72(0x261)+Z][a0_0x3e6d72(0x218)]('\x0a')});function a0_0x17e3(_0x2c139a,_0x4d669c){_0x2c139a=_0x2c139a-0x1f0;const _0x3b9fd9=a0_0x3b9f();let _0x17e30d=_0x3b9fd9[_0x2c139a];return _0x17e30d;}K[a0_0x3e6d72(0x219)](a0_0x4177a8,async()=>({'tools':[{'name':'commhub_reply','description':'Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','inputSchema':{'type':a0_0x3e6d72(0x212),'properties':{'task_id':{'type':a0_0x3e6d72(0x23d),'description':a0_0x3e6d72(0x22a)},'text':{'type':a0_0x3e6d72(0x23d),'description':a0_0x3e6d72(0x20c)},'status':{'type':'string','enum':[a0_0x3e6d72(0x230),a0_0x3e6d72(0x223),a0_0x3e6d72(0x241),a0_0x3e6d72(0x202),a0_0x3e6d72(0x273),a0_0x3e6d72(0x258)],'description':a0_0x3e6d72(0x206)}},'required':[a0_0x3e6d72(0x220)]}},{'name':a0_0x3e6d72(0x207),'description':a0_0x3e6d72(0x279),'inputSchema':{'type':a0_0x3e6d72(0x212),'properties':{'status':{'type':a0_0x3e6d72(0x23d),'enum':['working','idle','blocked',a0_0x3e6d72(0x273)]},'task':{'type':a0_0x3e6d72(0x23d),'description':a0_0x3e6d72(0x24e)},'progress':{'type':a0_0x3e6d72(0x201),'description':'Progress\x200-100'}},'required':[a0_0x3e6d72(0x20b)]}},{'name':'commhub_send_task','description':a0_0x3e6d72(0x217),'inputSchema':{'type':a0_0x3e6d72(0x212),'properties':{'alias':{'type':'string','description':'Target\x20session\x20alias'},'task':{'type':a0_0x3e6d72(0x23d),'description':a0_0x3e6d72(0x23f)},'priority':{'type':'string','enum':[a0_0x3e6d72(0x255),a0_0x3e6d72(0x1f2),a0_0x3e6d72(0x22c)],'description':'Priority\x20(default:\x20normal)'}},'required':['alias',a0_0x3e6d72(0x1fd)]}},{'name':a0_0x3e6d72(0x21b),'description':a0_0x3e6d72(0x243),'inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x3e6d72(0x23d),'description':a0_0x3e6d72(0x23b)},'message':{'type':a0_0x3e6d72(0x23d),'description':a0_0x3e6d72(0x275)}},'required':[a0_0x3e6d72(0x21e),a0_0x3e6d72(0x22f)]}},{'name':a0_0x3e6d72(0x277),'description':a0_0x3e6d72(0x23c),'inputSchema':{'type':'object','properties':{}}}]}));async function P(_0xd486dd,_0x47f3f8){const _0x573490=a0_0x3e6d72;let _0x35c0c1=await fetch(f+_0x573490(0x263),{'method':'POST','headers':{'Content-Type':_0x573490(0x1f7),'Accept':_0x573490(0x257),...X?{'Authorization':_0x573490(0x24f)+X}:{}},'body':JSON[_0x573490(0x20f)]({'jsonrpc':_0x573490(0x249),'id':0x1,'method':_0x573490(0x234),'params':{'protocolVersion':_0x573490(0x270),'capabilities':{},'clientInfo':{'name':_0x573490(0x267),'version':_0x573490(0x269)}}})});if(!_0x35c0c1['ok']){let _0x3e0c3d=await _0x35c0c1[_0x573490(0x220)]();return Y(_0x573490(0x253)+_0x35c0c1[_0x573490(0x20b)]+'\x20'+_0x3e0c3d[_0x573490(0x208)](0x0,0x64)),{'ok':!0x1,'error':_0x573490(0x26d)+_0x35c0c1[_0x573490(0x20b)]};}await _0x35c0c1[_0x573490(0x220)]();let _0x70041d=(await(await fetch(f+'/mcp',{'method':'POST','headers':{'Content-Type':'application/json','Accept':_0x573490(0x257),...X?{'Authorization':_0x573490(0x24f)+X}:{}},'body':JSON['stringify']({'jsonrpc':'2.0','id':0x2,'method':'tools/call','params':{'name':_0xd486dd,'arguments':_0x47f3f8}})}))[_0x573490(0x220)]())['split']('\x0a')[_0x573490(0x232)](_0x46ef7f=>_0x46ef7f[_0x573490(0x231)](_0x573490(0x244)));if(_0x70041d){let _0x5ea2f9=JSON[_0x573490(0x214)](_0x70041d['slice'](0x6));return _0x5ea2f9?.[_0x573490(0x272)]?.[_0x573490(0x237)]?.[0x0]?.[_0x573490(0x220)]?JSON[_0x573490(0x214)](_0x5ea2f9[_0x573490(0x272)][_0x573490(0x237)][0x0][_0x573490(0x220)]):_0x5ea2f9;}return{'ok':!0x1,'error':_0x573490(0x224)};}function a0_0x3b9f(){const _0x2a8db7=['commhub_send_task','\x20from\x20','init\x20failed:\x20','type','hub','2025-03-26','split','result','error','fatal:\x20','Message\x20content','read','commhub_get_all_status','from_session','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.',':\x20inbox_count=','decode','replace','get_all_status','42mKocIe','normal','connecting\x20to\x20','message_id','commhub','get_inbox','application/json','.anet','SIGTERM','connect','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','send_reply','task','idle','.env','SSE\x20stream\x20ended,\x20reconnecting...','number','blocked','\x20RESUME_ID=','warning:\x20could\x20not\x20register:\x20','statusText','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','commhub_report_status','slice','\x20priority=','broadcast','status','Reply\x20text\x20/\x20result\x20summary','10536uWPweg','42bQeUpj','stringify','utf-8','1093914ATnHvJ','object','write','parse','45DHtlho','priority','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','join','setRequestHandler','notifications/claude/channel','commhub_send_message','MCP\x20stdio\x20connected','Authorization','alias','body','text','messages','ready\x20—\x20waiting\x20for\x20events','failed','no\x20response','token','params','tmux\x20display-message\x20-p\x20\x27#S\x27','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','from','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','28174ourXri','low','SSE\x20fatal:\x20','stderr','message','completed','startsWith','find','135816QmglMh','initialize','.claude/channels/commhub','20xwaZqf','content','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','catch','session\x20disconnected','Target\x20session\x20alias','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','string','delete','Task\x20content','commhub_reply','cancelled','send_task','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','data:\x20','stdin','working','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','ack_inbox','2.0','/events/','notification','trim','none','Current\x20task\x20description','Bearer\x20','replied','SIGINT','toTimeString','CommHub\x20init\x20failed:\x20','5255668nOOfRE','high','cwd','application/json,\x20text/event-stream','in_progress','exit','then','711448iMUqqL','\x20CWD=','pop','1195650pDvJbY','report_status','set','Session\x20alias:\x20','end','/mcp','claude-code','send_message','indexOf','commhub-channel','inbox_count','0.3.0','←\x20message\x20from\x20'];a0_0x3b9f=function(){return _0x2a8db7;};return a0_0x3b9f();}K[a0_0x3e6d72(0x219)](a0_0x443a8f,async _0x3eb3ff=>{const _0x170b6d=a0_0x3e6d72;let {name:_0x63a199,arguments:_0x38e36b}=_0x3eb3ff[_0x170b6d(0x226)];if(_0x63a199===_0x170b6d(0x240)){let {task_id:_0x2874ac,text:_0x4d8d97,status:_0x23e766}=_0x38e36b;if(_0x23e766==='completed'||_0x23e766==='failed'||_0x23e766===_0x170b6d(0x241)){let _0x4ec15b=_0x23e766===_0x170b6d(0x230)?_0x170b6d(0x250):_0x23e766,_0xb33690=_0x2874ac?k['get'](_0x2874ac)||_0x170b6d(0x26f):_0x170b6d(0x26f),_0x2e91c2=await P(_0x170b6d(0x1fc),{'alias':_0xb33690,'text':_0x4d8d97,'in_reply_to':_0x2874ac||void 0x0,'status':_0x4ec15b,'from_session':Z});if(_0x2874ac)k[_0x170b6d(0x23e)](_0x2874ac);return{'content':[{'type':_0x170b6d(0x220),'text':JSON['stringify'](_0x2e91c2)}]};}let _0x3242d0=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x23e766===_0x170b6d(0x202)?'blocked':_0x23e766===_0x170b6d(0x273)?_0x170b6d(0x273):_0x170b6d(0x246),'task':_0x4d8d97[_0x170b6d(0x208)](0x0,0xc8),'output':_0x4d8d97});return{'content':[{'type':_0x170b6d(0x220),'text':JSON[_0x170b6d(0x20f)](_0x3242d0)}]};}if(_0x63a199==='commhub_report_status'){let {status:_0x45eeb3,task:_0x3f1c65,progress:_0x3e3dc5}=_0x38e36b,_0x50c84c=await P(_0x170b6d(0x25f),{'resume_id':w,'alias':Z,'status':_0x45eeb3,'task':_0x3f1c65,'progress':_0x3e3dc5});return{'content':[{'type':_0x170b6d(0x220),'text':JSON['stringify'](_0x50c84c)}]};}if(_0x63a199===_0x170b6d(0x26b)){let {alias:_0x31ce6d,task:_0x430e07,priority:_0xa138fa}=_0x38e36b,_0x18362c=await P(_0x170b6d(0x242),{'alias':_0x31ce6d,'task':_0x430e07,'priority':_0xa138fa||_0x170b6d(0x1f2),'from_session':Z});return{'content':[{'type':_0x170b6d(0x220),'text':JSON[_0x170b6d(0x20f)](_0x18362c)}]};}if(_0x63a199===_0x170b6d(0x21b)){let {alias:_0x2c205f,message:_0x5dc537}=_0x38e36b,_0x32a630=await P(_0x170b6d(0x265),{'alias':_0x2c205f,'message':_0x5dc537,'from_session':Z});return{'content':[{'type':_0x170b6d(0x220),'text':JSON[_0x170b6d(0x20f)](_0x32a630)}]};}if(_0x63a199===_0x170b6d(0x277)){let _0x3c9ff7=await P(_0x170b6d(0x1f0),{});return{'content':[{'type':_0x170b6d(0x220),'text':JSON[_0x170b6d(0x20f)](_0x3c9ff7)}]};}return{'content':[{'type':_0x170b6d(0x220),'text':JSON[_0x170b6d(0x20f)]({'error':'unknown\x20tool'})}]};});async function u(){const _0x4bcf30=a0_0x3e6d72;let _0x285c3b=f+_0x4bcf30(0x24a)+encodeURIComponent(Z),_0x490c36={};if(X)_0x490c36[_0x4bcf30(0x21d)]=_0x4bcf30(0x24f)+X;Y(_0x4bcf30(0x1f3)+_0x285c3b);while(!0x0){try{let _0x41f9a7=await fetch(_0x285c3b,{'headers':_0x490c36});if(!_0x41f9a7['ok']){Y('SSE\x20error:\x20'+_0x41f9a7[_0x4bcf30(0x20b)]+'\x20'+_0x41f9a7[_0x4bcf30(0x205)]),await h(0x1388);continue;}let _0x4591a2=_0x41f9a7[_0x4bcf30(0x21f)]['getReader'](),_0x3a5520=new TextDecoder(),_0x2b9692='';while(!0x0){let {done:_0x48ed25,value:_0x4d42cd}=await _0x4591a2[_0x4bcf30(0x276)]();if(_0x48ed25)break;_0x2b9692+=_0x3a5520[_0x4bcf30(0x27b)](_0x4d42cd,{'stream':!0x0});let _0x192dea=_0x2b9692[_0x4bcf30(0x271)]('\x0a\x0a');_0x2b9692=_0x192dea[_0x4bcf30(0x25d)]()||'';for(let _0x435941 of _0x192dea){let _0x7a6b68=_0x435941[_0x4bcf30(0x271)]('\x0a')[_0x4bcf30(0x232)](_0x202540=>_0x202540['startsWith'](_0x4bcf30(0x244)));if(!_0x7a6b68)continue;try{let _0x4cc814=JSON[_0x4bcf30(0x214)](_0x7a6b68[_0x4bcf30(0x208)](0x6));await S(_0x4cc814);}catch(_0xa2dca0){Y('parse\x20error:\x20'+_0xa2dca0);}}}Y(_0x4bcf30(0x200));}catch(_0x6b6443){Y('SSE\x20connection\x20error:\x20'+_0x6b6443);}await h(0xbb8);}}async function S(_0x4e35bb){const _0x49471d=a0_0x3e6d72;if(_0x4e35bb[_0x49471d(0x26e)]==='connected'){Y('SSE\x20connected\x20as\x20\x22'+Z+'\x22');return;}if(_0x4e35bb['type']==='new_message'){if(Y(_0x49471d(0x26a)+_0x4e35bb[_0x49471d(0x229)]+':\x20'+_0x4e35bb[_0x49471d(0x22f)][_0x49471d(0x208)](0x0,0x3c)),await K[_0x49471d(0x24b)]({'method':_0x49471d(0x21a),'params':{'content':_0x4e35bb[_0x49471d(0x22f)],'meta':{'sender':_0x4e35bb['from']||_0x49471d(0x26f),'sender_id':_0x49471d(0x1f5),'user':_0x4e35bb[_0x49471d(0x229)]||_0x49471d(0x26f),'priority':_0x49471d(0x1f2)}}}),_0x4e35bb[_0x49471d(0x1f4)])await P(_0x49471d(0x248),{'alias':Z,'message_id':_0x4e35bb[_0x49471d(0x1f4)]});return;}if(_0x4e35bb[_0x49471d(0x26e)]==='new_task'||_0x4e35bb[_0x49471d(0x26e)]===_0x49471d(0x20a)){Y('←\x20'+_0x4e35bb[_0x49471d(0x26e)]+_0x49471d(0x27a)+_0x4e35bb[_0x49471d(0x268)]+_0x49471d(0x209)+(_0x4e35bb[_0x49471d(0x216)]||_0x49471d(0x1f2)));let _0x4dfb76=await P(_0x49471d(0x1f6),{'alias':Z,'limit':0x5});if(_0x4dfb76?.['ok']&&_0x4dfb76[_0x49471d(0x221)]?.['length']>0x0)for(let _0x2e7391 of _0x4dfb76[_0x49471d(0x221)]){let _0x25a297={'sender':_0x2e7391[_0x49471d(0x278)]||_0x49471d(0x26f),'sender_id':_0x49471d(0x1f5),'user':_0x2e7391[_0x49471d(0x278)]||_0x49471d(0x26f),'task_id':_0x2e7391['id'],'priority':_0x2e7391['priority']||_0x49471d(0x1f2)};k[_0x49471d(0x260)](_0x2e7391['id'],_0x2e7391[_0x49471d(0x278)]||_0x49471d(0x26f)),await K[_0x49471d(0x24b)]({'method':_0x49471d(0x21a),'params':{'content':_0x2e7391['content'],'meta':_0x25a297}}),Y('→\x20injected\x20task\x20'+_0x2e7391['id'][_0x49471d(0x208)](0x0,0x8)+_0x49471d(0x26c)+_0x2e7391[_0x49471d(0x278)]+':\x20'+_0x2e7391[_0x49471d(0x237)]['slice'](0x0,0x3c)),await P(_0x49471d(0x248),{'alias':Z,'message_id':_0x2e7391['id']});}}}async function A(){const _0x26c037=a0_0x3e6d72;let _0x135164=new a0_0x3e4b81();await K[_0x26c037(0x1fa)](_0x135164),Y(_0x26c037(0x21c)),Y('starting\x20SSE\x20listener...'),u()[_0x26c037(0x239)](_0x327f5c=>Y(_0x26c037(0x22d)+_0x327f5c)),P('report_status',{'resume_id':w,'alias':Z,'status':_0x26c037(0x1fe),'server':a0_0x342df9(),'hostname':a0_0x342df9(),'agent':_0x26c037(0x264),'project_dir':process[_0x26c037(0x256)](),'tmux_name':j||void 0x0})[_0x26c037(0x25a)](()=>Y('registered\x20as\x20\x22'+Z+'\x22\x20('+w[_0x26c037(0x208)](0x0,0x8)+')'))[_0x26c037(0x239)](_0x451235=>Y(_0x26c037(0x204)+_0x451235)),setInterval(()=>{const _0x3c4b2b=_0x26c037;P(_0x3c4b2b(0x25f),{'resume_id':w,'alias':Z,'status':_0x3c4b2b(0x1fe),'server':a0_0x342df9(),'hostname':a0_0x342df9(),'agent':_0x3c4b2b(0x264),'project_dir':process[_0x3c4b2b(0x256)](),'tmux_name':j||void 0x0})[_0x3c4b2b(0x239)](_0x158b16=>Y('heartbeat\x20failed:\x20'+_0x158b16));},0x2bf20),Y(_0x26c037(0x222));}A()[a0_0x3e6d72(0x239)](_0x556b0f=>{const _0x9289cd=a0_0x3e6d72;Y(_0x9289cd(0x274)+_0x556b0f),process['exit'](0x1);});async function N(){const _0x4f64bf=a0_0x3e6d72;Y('shutting\x20down,\x20reporting\x20offline...'),await P(_0x4f64bf(0x25f),{'resume_id':w,'alias':Z,'status':_0x4f64bf(0x273),'task':_0x4f64bf(0x23a)})[_0x4f64bf(0x239)](()=>{}),process[_0x4f64bf(0x259)](0x0);}process[a0_0x3e6d72(0x245)]['on'](a0_0x3e6d72(0x262),()=>N()),process['on'](a0_0x3e6d72(0x1f9),()=>N()),process['on'](a0_0x3e6d72(0x251),()=>N());
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.0.0-preview.9",
4
- "description": "AI Agent Network Server + Client + Setup in one package. SSE real-time communication for multi-agent orchestration.",
3
+ "version": "2.0.1-preview.0",
4
+ "description": "AI Agent Network CLI \u2014 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",
7
7
  "types": "dist/client.d.ts",
@@ -21,7 +21,7 @@
21
21
  "dist"
22
22
  ],
23
23
  "scripts": {
24
- "build": "bun build src/client.ts --outdir dist/src --target node --minify && bun build bin/cli.ts --outdir dist/bin --target node --minify --external @sleep2agi/commhub-server --external bun:sqlite --external '../../server/*' && bun build src/node-server.ts --outdir dist/src --target node --minify --external @modelcontextprotocol/sdk && tsc --emitDeclarationOnly --declaration --outDir dist && npx javascript-obfuscator dist/bin/cli.js --output dist/bin/cli.js --compact true --control-flow-flattening true --string-array true --string-array-encoding base64 && npx javascript-obfuscator dist/src/client.js --output dist/src/client.js --compact true --string-array true && npx javascript-obfuscator dist/src/node-server.js --output dist/src/node-server.js --compact true --string-array true",
24
+ "build": "bun build src/client.ts --outdir dist/src --target node --minify && bun build bin/cli.ts --outdir dist/bin --target node --minify --external @sleep2agi/commhub-server --external bun:sqlite --external '../../server/*' && bun build src/node-server.ts --outdir dist/src --target node --minify --external @modelcontextprotocol/sdk && tsc --emitDeclarationOnly --declaration --outDir dist && npx javascript-obfuscator dist/bin/cli.js --output dist/bin/cli.js --compact true --string-array true --string-array-encoding base64 && npx javascript-obfuscator dist/src/client.js --output dist/src/client.js --compact true --string-array true && npx javascript-obfuscator dist/src/node-server.js --output dist/src/node-server.js --compact true --string-array true",
25
25
  "prepublishOnly": "npm run build"
26
26
  },
27
27
  "keywords": [
@@ -31,18 +31,20 @@
31
31
  "mcp",
32
32
  "sse",
33
33
  "claude",
34
+ "codex",
34
35
  "openai",
35
36
  "minimax",
36
37
  "orchestration",
37
- "communication",
38
- "hub",
39
- "multi-agent"
38
+ "multi-agent",
39
+ "cli",
40
+ "anet"
40
41
  ],
41
42
  "author": "sleep2agi",
42
43
  "license": "MIT",
44
+ "homepage": "https://anet.vansin.me",
43
45
  "repository": {
44
46
  "type": "git",
45
- "url": "https://github.com/sleep2agi/agent-comm-hub",
47
+ "url": "https://github.com/sleep2agi/agent-network",
46
48
  "directory": "agent-network"
47
49
  },
48
50
  "engines": {
@@ -57,4 +59,4 @@
57
59
  "node-pty": "^1.1.0",
58
60
  "typescript": "^5.0.0"
59
61
  }
60
- }
62
+ }