@sleep2agi/agent-network 2.0.0-preview.8 → 2.0.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
- function a0_0x1325(){const _0x1a60b8=['completed','resumeId','SSE\x20connected','disconnect','type','inbox\x20error:\x20','normal','match',']\x20[commhub:','heartbeatTimer','from_session','signal','Authorization','result','emit','/events/','POST','url','processInbox','new_message','stringify','text','disconnected','application/json,\x20text/event-stream','SSE\x20reconnecting\x20in\x20','reply','alias','pop','tools/call','content','call','4125530mnRwUV','get_inbox','connect','44IWBMaF','AbortError','text/event-stream','idle','application/json','read','connectSSE','sleep','token','agent','running','report_status','ack_inbox','data:\x20','catch','40xBpTLf','connected','log','11NOlJkG','83319KcqxLD','cwd','1930424ZzJpcT','parse','registered','offline','/mcp','abort','server','70458qfzFUq','autoConnect','decode','1068561CFOTLI','218748FSmpGu','status','getReader','min','send','send_task','error','broadcast','task','get_all_status','heartbeatInterval','818677saDdgw','reconnectDelay','body','SSE\x20error:\x20','message','messages','now','Bearer\x20','266JmlQmH','2.0','sseAbort','slice'];a0_0x1325=function(){return _0x1a60b8;};return a0_0x1325();}const a0_0x595caf=a0_0x5ddf;(function(_0x2db923,_0x3045f8){const _0x13f157=a0_0x5ddf,_0x3d1e5d=_0x2db923();while(!![]){try{const _0x20e1d2=-parseInt(_0x13f157(0x16e))/0x1+parseInt(_0x13f157(0x19c))/0x2*(parseInt(_0x13f157(0x156))/0x3)+parseInt(_0x13f157(0x163))/0x4*(parseInt(_0x13f157(0x152))/0x5)+parseInt(_0x13f157(0x15f))/0x6*(parseInt(_0x13f157(0x176))/0x7)+-parseInt(_0x13f157(0x158))/0x8+-parseInt(_0x13f157(0x162))/0x9+-parseInt(_0x13f157(0x199))/0xa*(-parseInt(_0x13f157(0x155))/0xb);if(_0x20e1d2===_0x3045f8)break;else _0x3d1e5d['push'](_0x3d1e5d['shift']());}catch(_0x2e4c1b){_0x3d1e5d['push'](_0x3d1e5d['shift']());}}}(a0_0x1325,0xb1e04));import{EventEmitter as a0_0x5cf71b}from'events';import{hostname as a0_0xc15a09}from'os';class T extends a0_0x5cf71b{[a0_0x595caf(0x18b)];['alias'];['token'];['agent'];[a0_0x595caf(0x17b)];[a0_0x595caf(0x16d)];[a0_0x595caf(0x16f)];[a0_0x595caf(0x183)];[a0_0x595caf(0x178)];[a0_0x595caf(0x14d)]=!0x1;constructor(_0x45ade1){const _0x1bdb32=a0_0x595caf;super();if(this[_0x1bdb32(0x18b)]=_0x45ade1[_0x1bdb32(0x18b)]['replace'](/\/$/,''),this[_0x1bdb32(0x194)]=_0x45ade1[_0x1bdb32(0x194)],this[_0x1bdb32(0x14b)]=_0x45ade1['token'],this[_0x1bdb32(0x14c)]=_0x45ade1[_0x1bdb32(0x14c)]||'sdk',this[_0x1bdb32(0x17b)]='sdk-'+_0x45ade1[_0x1bdb32(0x194)]+'-'+Date[_0x1bdb32(0x174)]()['toString'](0x24),this[_0x1bdb32(0x16d)]=_0x45ade1['heartbeatInterval']??0x2bf20,this[_0x1bdb32(0x16f)]=_0x45ade1[_0x1bdb32(0x16f)]??0xbb8,_0x45ade1[_0x1bdb32(0x160)]!==!0x1)this['connect']();}[a0_0x595caf(0x154)](_0x15b479){const _0x1b36ff=a0_0x595caf;console[_0x1b36ff(0x154)]('['+new Date()['toTimeString']()[_0x1b36ff(0x179)](0x0,0x8)+_0x1b36ff(0x182)+this[_0x1b36ff(0x194)]+']\x20'+_0x15b479);}async[a0_0x595caf(0x198)](_0x280711,_0x22a635){const _0x484070=a0_0x595caf;let _0x4e8059={'Content-Type':_0x484070(0x1a0),'Accept':_0x484070(0x191)};if(this[_0x484070(0x14b)])_0x4e8059[_0x484070(0x186)]=_0x484070(0x175)+this[_0x484070(0x14b)];let _0x45cded=await(await fetch(this[_0x484070(0x18b)]+_0x484070(0x15c),{'method':_0x484070(0x18a),'headers':_0x4e8059,'body':JSON[_0x484070(0x18e)]({'jsonrpc':_0x484070(0x177),'id':Date[_0x484070(0x174)](),'method':_0x484070(0x196),'params':{'name':_0x280711,'arguments':_0x22a635}})}))[_0x484070(0x18f)](),_0x384642=_0x45cded[_0x484070(0x181)](/data: (.+)/),_0x23f1cf=_0x384642?JSON['parse'](_0x384642[0x1]):JSON['parse'](_0x45cded),_0x4e6d06=_0x23f1cf?.[_0x484070(0x187)]?.[_0x484070(0x197)]?.[0x0]?.[_0x484070(0x18f)];return _0x4e6d06?JSON[_0x484070(0x159)](_0x4e6d06):_0x23f1cf;}async[a0_0x595caf(0x19b)](){const _0x15a34=a0_0x595caf;if(this[_0x15a34(0x14d)])return;this['running']=!0x0,await this[_0x15a34(0x164)](_0x15a34(0x19f)),this['log'](_0x15a34(0x15a)),this[_0x15a34(0x183)]=setInterval(()=>{const _0x20421e=_0x15a34;this[_0x20421e(0x164)](_0x20421e(0x19f))[_0x20421e(0x151)](_0x5d4be0=>this[_0x20421e(0x154)]('heartbeat\x20failed:\x20'+_0x5d4be0[_0x20421e(0x172)]));},this['heartbeatInterval']),this[_0x15a34(0x149)]();}async[a0_0x595caf(0x17d)](){const _0x2e0a23=a0_0x595caf;if(this[_0x2e0a23(0x14d)]=!0x1,this[_0x2e0a23(0x178)]?.[_0x2e0a23(0x15d)](),this['heartbeatTimer'])clearInterval(this[_0x2e0a23(0x183)]);await this['status'](_0x2e0a23(0x15b))[_0x2e0a23(0x151)](()=>{}),this[_0x2e0a23(0x154)](_0x2e0a23(0x190));}async[a0_0x595caf(0x167)](_0x30e150,_0x13412a,_0x52c831=a0_0x595caf(0x180)){const _0x4c33a3=a0_0x595caf;return this['call'](_0x4c33a3(0x168),{'alias':_0x30e150,'task':_0x13412a,'priority':_0x52c831,'from_session':this[_0x4c33a3(0x194)]});}async[a0_0x595caf(0x172)](_0x484d13,_0x102352){const _0x3dcc32=a0_0x595caf;return this[_0x3dcc32(0x198)]('send_message',{'alias':_0x484d13,'message':_0x102352,'from_session':this[_0x3dcc32(0x194)]});}async['reply'](_0x334a6f,_0x2d3159,_0x195589=a0_0x595caf(0x17a)){const _0x3d206f=a0_0x595caf;return this[_0x3d206f(0x198)](_0x3d206f(0x193),{'task_id':_0x334a6f,'text':_0x2d3159,'status':_0x195589});}async[a0_0x595caf(0x164)](_0x21ebd6,_0x5cf39a){const _0x4a1478=a0_0x595caf;return this[_0x4a1478(0x198)](_0x4a1478(0x14e),{'resume_id':this['resumeId'],'alias':this[_0x4a1478(0x194)],'status':_0x21ebd6,'server':a0_0xc15a09(),'hostname':a0_0xc15a09(),'agent':this[_0x4a1478(0x14c)],'project_dir':process[_0x4a1478(0x157)](),..._0x5cf39a});}async['getAllStatus'](){const _0x45d687=a0_0x595caf;return this['call'](_0x45d687(0x16c),{});}async['broadcast'](_0x12404c,_0x143cf3){const _0x29742b=a0_0x595caf;return this[_0x29742b(0x198)](_0x29742b(0x16a),{'message':_0x12404c,'filter_server':_0x143cf3?.[_0x29742b(0x15e)],'filter_status':_0x143cf3?.['status']});}async[a0_0x595caf(0x149)](){const _0x394438=a0_0x595caf;let _0x13d542=encodeURIComponent(this['alias']),_0x980aa8=this[_0x394438(0x18b)]+_0x394438(0x189)+_0x13d542,_0x553865=this[_0x394438(0x16f)];while(this['running']){try{this['sseAbort']=new AbortController();let _0x52fcc6={'Accept':_0x394438(0x19e)};if(this[_0x394438(0x14b)])_0x52fcc6[_0x394438(0x186)]=_0x394438(0x175)+this['token'];let _0x105e98=await fetch(_0x980aa8,{'headers':_0x52fcc6,'signal':this[_0x394438(0x178)][_0x394438(0x185)]});if(!_0x105e98['ok']||!_0x105e98[_0x394438(0x170)]){this[_0x394438(0x154)]('SSE\x20failed:\x20'+_0x105e98[_0x394438(0x164)]),await this[_0x394438(0x14a)](_0x553865),_0x553865=Math['min'](_0x553865*1.5,0xea60);continue;}_0x553865=this['reconnectDelay'];let _0x307ded=_0x105e98[_0x394438(0x170)][_0x394438(0x165)](),_0x5d84de=new TextDecoder(),_0x7d608='';while(this[_0x394438(0x14d)]){let {done:_0x4a64e2,value:_0x245a67}=await _0x307ded[_0x394438(0x148)]();if(_0x4a64e2)break;_0x7d608+=_0x5d84de[_0x394438(0x161)](_0x245a67,{'stream':!0x0});let _0x3c90c0=_0x7d608['split']('\x0a');_0x7d608=_0x3c90c0[_0x394438(0x195)]()||'';for(let _0x480272 of _0x3c90c0){if(!_0x480272['startsWith'](_0x394438(0x150)))continue;try{let _0x2e4a3f=JSON['parse'](_0x480272[_0x394438(0x179)](0x6));if(_0x2e4a3f[_0x394438(0x17e)]==='connected'){this[_0x394438(0x154)](_0x394438(0x17c)),this['emit'](_0x394438(0x153));continue;}if(_0x2e4a3f[_0x394438(0x17e)]==='new_task'||_0x2e4a3f[_0x394438(0x17e)]===_0x394438(0x18d)||_0x2e4a3f[_0x394438(0x17e)]===_0x394438(0x16a))await this[_0x394438(0x18c)]();}catch{}}}}catch(_0x25fc11){if(_0x25fc11['name']===_0x394438(0x19d))break;this[_0x394438(0x188)](_0x394438(0x169),_0x25fc11),this[_0x394438(0x154)](_0x394438(0x171)+_0x25fc11['message']);}if(this['running'])this['emit'](_0x394438(0x190)),this[_0x394438(0x154)](_0x394438(0x192)+_0x553865/0x3e8+'s...'),await this['sleep'](_0x553865),_0x553865=Math[_0x394438(0x166)](_0x553865*1.5,0xea60);}}async[a0_0x595caf(0x18c)](){const _0x17d599=a0_0x595caf;try{let _0x306b8f=(await this['call'](_0x17d599(0x19a),{'alias':this['alias'],'limit':0xa}))?.[_0x17d599(0x173)]||[];for(let _0x22b25a of _0x306b8f)await this[_0x17d599(0x198)](_0x17d599(0x14f),{'alias':this['alias'],'message_id':_0x22b25a['id']}),this[_0x17d599(0x154)]('←\x20'+_0x22b25a[_0x17d599(0x184)]+':\x20'+_0x22b25a[_0x17d599(0x197)][_0x17d599(0x179)](0x0,0x3c)),this[_0x17d599(0x188)](_0x17d599(0x16b),_0x22b25a),this[_0x17d599(0x188)](_0x17d599(0x172),_0x22b25a);}catch(_0x1b6ae7){this['log'](_0x17d599(0x17f)+_0x1b6ae7['message']);}}[a0_0x595caf(0x14a)](_0xad95b5){return new Promise(_0x2b8c22=>setTimeout(_0x2b8c22,_0xad95b5));}}var $=T;function a0_0x5ddf(_0x2a411a,_0x4dc889){_0x2a411a=_0x2a411a-0x148;const _0x1325e6=a0_0x1325();let _0x5ddf6e=_0x1325e6[_0x2a411a];return _0x5ddf6e;}export{$ as default,T as CommHub};
1
+ const a0_0x4cdf14=a0_0x5a49;(function(_0x404bc7,_0xa80994){const _0x17ca59=a0_0x5a49,_0x4359b3=_0x404bc7();while(!![]){try{const _0x2603f7=-parseInt(_0x17ca59(0xb8))/0x1+-parseInt(_0x17ca59(0x94))/0x2+-parseInt(_0x17ca59(0x92))/0x3*(parseInt(_0x17ca59(0x96))/0x4)+parseInt(_0x17ca59(0xa1))/0x5+-parseInt(_0x17ca59(0x8f))/0x6*(-parseInt(_0x17ca59(0x89))/0x7)+parseInt(_0x17ca59(0xb6))/0x8*(parseInt(_0x17ca59(0xa7))/0x9)+parseInt(_0x17ca59(0x8d))/0xa;if(_0x2603f7===_0xa80994)break;else _0x4359b3['push'](_0x4359b3['shift']());}catch(_0x2fa141){_0x4359b3['push'](_0x4359b3['shift']());}}}(a0_0x4a18,0x4ef28));import{EventEmitter as a0_0x4054c9}from'events';import{hostname as a0_0x1022ed}from'os';function a0_0x5a49(_0x1679ef,_0x58da0b){_0x1679ef=_0x1679ef-0x84;const _0x4a1824=a0_0x4a18();let _0x5a496c=_0x4a1824[_0x1679ef];return _0x5a496c;}class T extends a0_0x4054c9{[a0_0x4cdf14(0xa5)];[a0_0x4cdf14(0xad)];[a0_0x4cdf14(0x85)];[a0_0x4cdf14(0x87)];[a0_0x4cdf14(0xa8)];['heartbeatInterval'];[a0_0x4cdf14(0xaf)];[a0_0x4cdf14(0xce)];['sseAbort'];[a0_0x4cdf14(0x8b)]=!0x1;constructor(_0x597958){const _0x4220da=a0_0x4cdf14;super();if(this['url']=_0x597958[_0x4220da(0xa5)][_0x4220da(0xc2)](/\/$/,''),this[_0x4220da(0xad)]=_0x597958[_0x4220da(0xad)],this[_0x4220da(0x85)]=_0x597958[_0x4220da(0x85)],this[_0x4220da(0x87)]=_0x597958['agent']||_0x4220da(0x8c),this[_0x4220da(0xa8)]=_0x4220da(0x98)+_0x597958[_0x4220da(0xad)]+'-'+Date[_0x4220da(0xc5)]()['toString'](0x24),this[_0x4220da(0xd5)]=_0x597958[_0x4220da(0xd5)]??0x2bf20,this[_0x4220da(0xaf)]=_0x597958[_0x4220da(0xaf)]??0xbb8,_0x597958[_0x4220da(0xb3)]!==!0x1)this[_0x4220da(0xb0)]();}[a0_0x4cdf14(0xac)](_0x20bbd5){const _0x408413=a0_0x4cdf14;console[_0x408413(0xac)]('['+new Date()[_0x408413(0xba)]()['slice'](0x0,0x8)+']\x20[commhub:'+this[_0x408413(0xad)]+']\x20'+_0x20bbd5);}async[a0_0x4cdf14(0xbb)](_0x1e6db2,_0x5ef0f9){const _0x5b0f46=a0_0x4cdf14;let _0x15c380={'Content-Type':_0x5b0f46(0xc0),'Accept':'application/json,\x20text/event-stream'};if(this[_0x5b0f46(0x85)])_0x15c380[_0x5b0f46(0xbf)]=_0x5b0f46(0xa6)+this[_0x5b0f46(0x85)];let _0x512471=await(await fetch(this['url']+_0x5b0f46(0xae),{'method':'POST','headers':_0x15c380,'body':JSON[_0x5b0f46(0x8a)]({'jsonrpc':_0x5b0f46(0x9a),'id':Date[_0x5b0f46(0xc5)](),'method':'tools/call','params':{'name':_0x1e6db2,'arguments':_0x5ef0f9}})}))[_0x5b0f46(0xd4)](),_0x983d1d=_0x512471[_0x5b0f46(0x8e)](/data: (.+)/),_0x22c2ac=_0x983d1d?JSON[_0x5b0f46(0xcc)](_0x983d1d[0x1]):JSON[_0x5b0f46(0xcc)](_0x512471),_0x331c65=_0x22c2ac?.[_0x5b0f46(0xb5)]?.['content']?.[0x0]?.['text'];return _0x331c65?JSON[_0x5b0f46(0xcc)](_0x331c65):_0x22c2ac;}async[a0_0x4cdf14(0xb0)](){const _0x3854da=a0_0x4cdf14;if(this[_0x3854da(0x8b)])return;this['running']=!0x0,await this[_0x3854da(0xb7)](_0x3854da(0xd2)),this[_0x3854da(0xac)](_0x3854da(0xbd)),this['heartbeatTimer']=setInterval(()=>{const _0x43b03=_0x3854da;this[_0x43b03(0xb7)](_0x43b03(0xd2))[_0x43b03(0xca)](_0x3300a4=>this[_0x43b03(0xac)]('heartbeat\x20failed:\x20'+_0x3300a4[_0x43b03(0xcb)]));},this[_0x3854da(0xd5)]),this[_0x3854da(0xa3)]();}async[a0_0x4cdf14(0xc6)](){const _0x3fd43e=a0_0x4cdf14;if(this[_0x3fd43e(0x8b)]=!0x1,this[_0x3fd43e(0xc3)]?.['abort'](),this[_0x3fd43e(0xce)])clearInterval(this[_0x3fd43e(0xce)]);await this['status'](_0x3fd43e(0x86))[_0x3fd43e(0xca)](()=>{}),this[_0x3fd43e(0xac)](_0x3fd43e(0x84));}async['send'](_0x42df91,_0xdaf7fa,_0x182d12=a0_0x4cdf14(0xd0)){const _0x3c8625=a0_0x4cdf14;return this[_0x3c8625(0xbb)](_0x3c8625(0xa4),{'alias':_0x42df91,'task':_0xdaf7fa,'priority':_0x182d12,'from_session':this[_0x3c8625(0xad)]});}async['message'](_0x26fb8,_0x3ab440){const _0x3b2355=a0_0x4cdf14;return this[_0x3b2355(0xbb)](_0x3b2355(0xc4),{'alias':_0x26fb8,'message':_0x3ab440,'from_session':this['alias']});}async[a0_0x4cdf14(0x99)](_0x5864c2,_0xfa5d14,_0xf06ab1=a0_0x4cdf14(0xd3)){return this['call']('reply',{'task_id':_0x5864c2,'text':_0xfa5d14,'status':_0xf06ab1});}async[a0_0x4cdf14(0xb7)](_0x3a0a50,_0x49a5b4){const _0x271d89=a0_0x4cdf14;return this[_0x271d89(0xbb)](_0x271d89(0x9f),{'resume_id':this[_0x271d89(0xa8)],'alias':this['alias'],'status':_0x3a0a50,'server':a0_0x1022ed(),'hostname':a0_0x1022ed(),'agent':this['agent'],'project_dir':process[_0x271d89(0x91)](),..._0x49a5b4});}async['getAllStatus'](){const _0x3e8846=a0_0x4cdf14;return this[_0x3e8846(0xbb)](_0x3e8846(0xab),{});}async[a0_0x4cdf14(0xbe)](_0x2e5031,_0x472d30){const _0x51c961=a0_0x4cdf14;return this[_0x51c961(0xbb)](_0x51c961(0xbe),{'message':_0x2e5031,'filter_server':_0x472d30?.[_0x51c961(0xb9)],'filter_status':_0x472d30?.[_0x51c961(0xb7)]});}async[a0_0x4cdf14(0xa3)](){const _0x2faef1=a0_0x4cdf14;let _0x47edb5=encodeURIComponent(this[_0x2faef1(0xad)]),_0x16a640=this[_0x2faef1(0xa5)]+'/events/'+_0x47edb5,_0x1add11=this[_0x2faef1(0xaf)];while(this['running']){try{this['sseAbort']=new AbortController();let _0x5ae88f={'Accept':_0x2faef1(0x9d)};if(this[_0x2faef1(0x85)])_0x5ae88f[_0x2faef1(0xbf)]='Bearer\x20'+this[_0x2faef1(0x85)];let _0x191249=await fetch(_0x16a640,{'headers':_0x5ae88f,'signal':this[_0x2faef1(0xc3)]['signal']});if(!_0x191249['ok']||!_0x191249['body']){this[_0x2faef1(0xac)](_0x2faef1(0xc1)+_0x191249[_0x2faef1(0xb7)]),await this[_0x2faef1(0x90)](_0x1add11),_0x1add11=Math['min'](_0x1add11*1.5,0xea60);continue;}_0x1add11=this[_0x2faef1(0xaf)];let _0x3f3b3f=_0x191249[_0x2faef1(0xbc)][_0x2faef1(0xcf)](),_0x381112=new TextDecoder(),_0xa5f64d='';while(this['running']){let {done:_0x44f739,value:_0x5b299a}=await _0x3f3b3f[_0x2faef1(0xb2)]();if(_0x44f739)break;_0xa5f64d+=_0x381112['decode'](_0x5b299a,{'stream':!0x0});let _0x455829=_0xa5f64d[_0x2faef1(0xa9)]('\x0a');_0xa5f64d=_0x455829[_0x2faef1(0xc7)]()||'';for(let _0x3de177 of _0x455829){if(!_0x3de177['startsWith'](_0x2faef1(0xb4)))continue;try{let _0x22d0a1=JSON[_0x2faef1(0xcc)](_0x3de177['slice'](0x6));if(_0x22d0a1[_0x2faef1(0xb1)]===_0x2faef1(0x88)){this[_0x2faef1(0xac)](_0x2faef1(0xc8)),this[_0x2faef1(0x9e)]('connected');continue;}if(_0x22d0a1[_0x2faef1(0xb1)]===_0x2faef1(0xc9)||_0x22d0a1[_0x2faef1(0xb1)]==='new_message'||_0x22d0a1[_0x2faef1(0xb1)]==='broadcast')await this[_0x2faef1(0x95)]();}catch{}}}}catch(_0x42981d){if(_0x42981d[_0x2faef1(0x93)]==='AbortError')break;this[_0x2faef1(0x9e)]('error',_0x42981d),this[_0x2faef1(0xac)](_0x2faef1(0xa0)+_0x42981d[_0x2faef1(0xcb)]);}if(this['running'])this['emit'](_0x2faef1(0x84)),this[_0x2faef1(0xac)](_0x2faef1(0x9c)+_0x1add11/0x3e8+_0x2faef1(0xa2)),await this['sleep'](_0x1add11),_0x1add11=Math[_0x2faef1(0x97)](_0x1add11*1.5,0xea60);}}async['processInbox'](){const _0x29680f=a0_0x4cdf14;try{let _0x1b2684=(await this[_0x29680f(0xbb)](_0x29680f(0x9b),{'alias':this[_0x29680f(0xad)],'limit':0xa}))?.['messages']||[];for(let _0x281235 of _0x1b2684)await this[_0x29680f(0xbb)](_0x29680f(0xcd),{'alias':this['alias'],'message_id':_0x281235['id']}),this[_0x29680f(0xac)]('←\x20'+_0x281235['from_session']+':\x20'+_0x281235[_0x29680f(0xd1)]['slice'](0x0,0x3c)),this[_0x29680f(0x9e)]('task',_0x281235),this[_0x29680f(0x9e)](_0x29680f(0xcb),_0x281235);}catch(_0x3ea950){this[_0x29680f(0xac)](_0x29680f(0xaa)+_0x3ea950['message']);}}[a0_0x4cdf14(0x90)](_0x5d3881){return new Promise(_0x54d753=>setTimeout(_0x54d753,_0x5d3881));}}var $=T;export{$ as default,T as CommHub};function a0_0x4a18(){const _0x5efd58=['connected','14yuJFBK','stringify','running','sdk','3551230SbJcPM','match','246426LwJIky','sleep','cwd','39iyVRRI','name','1027584ECyddq','processInbox','3100wTVAro','min','sdk-','reply','2.0','get_inbox','SSE\x20reconnecting\x20in\x20','text/event-stream','emit','report_status','SSE\x20error:\x20','1831050KwQqHA','s...','connectSSE','send_task','url','Bearer\x20','2778507pwIHGS','resumeId','split','inbox\x20error:\x20','get_all_status','log','alias','/mcp','reconnectDelay','connect','type','read','autoConnect','data:\x20','result','8YyIqgv','status','264963fMNguF','server','toTimeString','call','body','registered','broadcast','Authorization','application/json','SSE\x20failed:\x20','replace','sseAbort','send_message','now','disconnect','pop','SSE\x20connected','new_task','catch','message','parse','ack_inbox','heartbeatTimer','getReader','normal','content','idle','completed','text','heartbeatInterval','disconnected','token','offline','agent'];a0_0x4a18=function(){return _0x5efd58;};return a0_0x4a18();}
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x18a035=a0_0x36a0;(function(_0x2e111d,_0x41560a){const _0x34c27c=a0_0x36a0,_0x4f2c76=_0x2e111d();while(!![]){try{const _0x599c0c=-parseInt(_0x34c27c(0x217))/0x1*(-parseInt(_0x34c27c(0x1da))/0x2)+-parseInt(_0x34c27c(0x1db))/0x3*(parseInt(_0x34c27c(0x1b6))/0x4)+parseInt(_0x34c27c(0x1c7))/0x5*(-parseInt(_0x34c27c(0x1f2))/0x6)+-parseInt(_0x34c27c(0x1d5))/0x7*(-parseInt(_0x34c27c(0x224))/0x8)+-parseInt(_0x34c27c(0x1c2))/0x9+parseInt(_0x34c27c(0x203))/0xa+parseInt(_0x34c27c(0x1ea))/0xb;if(_0x599c0c===_0x41560a)break;else _0x4f2c76['push'](_0x4f2c76['shift']());}catch(_0x574f4a){_0x4f2c76['push'](_0x4f2c76['shift']());}}}(a0_0x54db,0xbcb28));import{readFileSync as a0_0x4a776f,existsSync as a0_0x1e3c45}from'fs';import{join as a0_0x27c2ed}from'path';function a0_0x54db(){const _0x221944=['failed','/mcp','get','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','2195Mdpcgn','idle','delete','report_status','0.3.0','trim','slice','notification','\x20ALIAS=','get_inbox','→\x20injected\x20task\x20','2.0','SSE\x20connection\x20error:\x20','message_id','4767595kRpvQN','object','SIGINT','cancelled','exit','2957336EhBFuS','1071951KmGbHN','type','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','stderr','/events/','error','http://127.0.0.1:9200','parse','\x22\x20(','read','from_session','getReader','parse\x20error:\x20','length','messages','7262849Gqkklr','application/json','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','SSE\x20stream\x20ended,\x20reconnecting...','Bearer\x20','status','stringify','\x20priority=','17358YsTkIV','application/json,\x20text/event-stream','completed','toTimeString','startsWith','fatal:\x20','Authorization','MCP\x20stdio\x20connected','ready\x20—\x20waiting\x20for\x20events','find','pop','shutting\x20down,\x20reporting\x20offline...','string','send_reply','cwd','body','ack_inbox','10688580wYpJmP','POST','\x20from\x20','starting\x20SSE\x20listener...','commhub','\x20PROJECT_ENV=','initialize','normal','commhub_reply','notifications/claude/channel','from','data:\x20','utf-8','\x20RESUME_ID=','message',']\x20[commhub]\x20','unknown\x20tool','config.json','split','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','1uMFtQc','hub','setRequestHandler','in_progress','\x20CWD=','commhub_report_status','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','commhub_send_task','alias','claude-code','init\x20failed:\x20','result','params','8zgmJpe','number','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','decode','high','catch','...\x20TMUX=','text','SSE\x20fatal:\x20','.env','Reply\x20text\x20/\x20result\x20summary','ENV:\x20URL=','get_all_status','token','end','blocked','send_message','indexOf','write','replace','Task\x20content','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','task','commhub-channel','12MgYurQ','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','Current\x20task\x20description','commhub_send_message','tmux\x20display-message\x20-p\x20\x27#S\x27','commhub_get_all_status','content','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','connecting\x20to\x20','priority','connected','Target\x20session\x20alias','6965892hGHNMN'];a0_0x54db=function(){return _0x221944;};return a0_0x54db();}import{hostname as a0_0x3a7455}from'os';import{execSync as a0_0x185ef0}from'child_process';import{Server as a0_0x3cd0e6}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0xa58a50}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x1a8297,CallToolRequestSchema as a0_0x19d0b1}from'@modelcontextprotocol/sdk/types.js';function p(_0x1066f6){const _0x5d5aeb=a0_0x36a0;if(!a0_0x1e3c45(_0x1066f6))return;for(let _0x2c89a1 of a0_0x4a776f(_0x1066f6,_0x5d5aeb(0x20f))['split']('\x0a')){let _0x70a9d8=_0x2c89a1['trim']();if(!_0x70a9d8||_0x70a9d8[_0x5d5aeb(0x1f6)]('#'))continue;let _0x3ff821=_0x70a9d8[_0x5d5aeb(0x1af)]('=');if(_0x3ff821<0x0)continue;let _0x4719c4=_0x70a9d8[_0x5d5aeb(0x1cd)](0x0,_0x3ff821)[_0x5d5aeb(0x1cc)](),_0x25a674=_0x70a9d8[_0x5d5aeb(0x1cd)](_0x3ff821+0x1)['trim']()[_0x5d5aeb(0x1b1)](/^["']|["']$/g,'');if(!process.env[_0x4719c4])process.env[_0x4719c4]=_0x25a674;}}var C=process.env.HOME||'~',T=a0_0x27c2ed(C,'.claude/channels/commhub');p(a0_0x27c2ed(T,'.env'));var L=process[a0_0x18a035(0x200)]()[a0_0x18a035(0x1b1)](/\//g,'-');p(a0_0x27c2ed(T,L,a0_0x18a035(0x22d)));function U(){const _0x4b52f4=a0_0x18a035;try{return a0_0x185ef0(_0x4b52f4(0x1ba),{'encoding':_0x4b52f4(0x20f),'timeout':0x7d0})['trim']();}catch{return'';}}function a0_0x36a0(_0x57c965,_0x4e7ba7){_0x57c965=_0x57c965-0x1ab;const _0x54dbac=a0_0x54db();let _0x36a0d3=_0x54dbac[_0x57c965];return _0x36a0d3;}function c(){const _0x25f22a=a0_0x18a035;try{let _0x3dc012=a0_0x27c2ed(C,'.anet',_0x25f22a(0x214));if(a0_0x1e3c45(_0x3dc012))return JSON[_0x25f22a(0x1e2)](a0_0x4a776f(_0x3dc012,_0x25f22a(0x20f)));}catch{}return{};}var H=c(),D=process.env.COMMHUB_URL||H['hub']||a0_0x18a035(0x1e1),f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0x3a7455(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto['randomUUID'](),X=process.env.COMMHUB_TOKEN||H[a0_0x18a035(0x1ab)]||'';function Y(_0x3e95d1){const _0xda851e=a0_0x18a035;let _0x2aec32=new Date()[_0xda851e(0x1f5)]()['slice'](0x0,0x8);process[_0xda851e(0x1de)][_0xda851e(0x1b0)]('['+_0x2aec32+_0xda851e(0x212)+_0x3e95d1+'\x0a');}function h(_0x307788){return new Promise(_0x21c724=>setTimeout(_0x21c724,_0x307788));}Y(a0_0x18a035(0x22f)+D+a0_0x18a035(0x1cf)+Z+a0_0x18a035(0x210)+w[a0_0x18a035(0x1cd)](0x0,0x8)+a0_0x18a035(0x22a)+(f||'none')+a0_0x18a035(0x21b)+process[a0_0x18a035(0x200)]()+a0_0x18a035(0x208)+L);var k=new Map(),K=new a0_0x3cd0e6({'name':a0_0x18a035(0x1b5),'version':a0_0x18a035(0x1cb)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':['Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>',a0_0x18a035(0x1dd),a0_0x18a035(0x1c6),a0_0x18a035(0x21d),'Session\x20alias:\x20'+Z]['join']('\x0a')});K[a0_0x18a035(0x219)](a0_0x1a8297,async()=>({'tools':[{'name':'commhub_reply','description':a0_0x18a035(0x1ec),'inputSchema':{'type':a0_0x18a035(0x1d6),'properties':{'task_id':{'type':a0_0x18a035(0x1fe),'description':a0_0x18a035(0x1b7)},'text':{'type':a0_0x18a035(0x1fe),'description':a0_0x18a035(0x22e)},'status':{'type':a0_0x18a035(0x1fe),'enum':['completed',a0_0x18a035(0x1c3),a0_0x18a035(0x1d8),a0_0x18a035(0x1ad),a0_0x18a035(0x1e0),a0_0x18a035(0x21a)],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':[a0_0x18a035(0x22b)]}},{'name':a0_0x18a035(0x21c),'description':a0_0x18a035(0x1bd),'inputSchema':{'type':a0_0x18a035(0x1d6),'properties':{'status':{'type':a0_0x18a035(0x1fe),'enum':['working',a0_0x18a035(0x1c8),a0_0x18a035(0x1ad),a0_0x18a035(0x1e0)]},'task':{'type':a0_0x18a035(0x1fe),'description':a0_0x18a035(0x1b8)},'progress':{'type':a0_0x18a035(0x225),'description':'Progress\x200-100'}},'required':[a0_0x18a035(0x1ef)]}},{'name':a0_0x18a035(0x21e),'description':a0_0x18a035(0x216),'inputSchema':{'type':a0_0x18a035(0x1d6),'properties':{'alias':{'type':a0_0x18a035(0x1fe),'description':'Target\x20session\x20alias'},'task':{'type':a0_0x18a035(0x1fe),'description':a0_0x18a035(0x1b2)},'priority':{'type':'string','enum':[a0_0x18a035(0x228),a0_0x18a035(0x20a),'low'],'description':'Priority\x20(default:\x20normal)'}},'required':[a0_0x18a035(0x21f),a0_0x18a035(0x1b4)]}},{'name':a0_0x18a035(0x1b9),'description':a0_0x18a035(0x226),'inputSchema':{'type':a0_0x18a035(0x1d6),'properties':{'alias':{'type':a0_0x18a035(0x1fe),'description':a0_0x18a035(0x1c1)},'message':{'type':'string','description':'Message\x20content'}},'required':[a0_0x18a035(0x21f),a0_0x18a035(0x211)]}},{'name':a0_0x18a035(0x1bb),'description':a0_0x18a035(0x1b3),'inputSchema':{'type':'object','properties':{}}}]}));async function P(_0x3a2b17,_0x3bd07b){const _0x4158f0=a0_0x18a035;let _0x5dcdff=await fetch(D+_0x4158f0(0x1c4),{'method':_0x4158f0(0x204),'headers':{'Content-Type':'application/json','Accept':_0x4158f0(0x1f3),...X?{'Authorization':_0x4158f0(0x1ee)+X}:{}},'body':JSON[_0x4158f0(0x1f0)]({'jsonrpc':_0x4158f0(0x1d2),'id':0x1,'method':_0x4158f0(0x209),'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x4158f0(0x1b5),'version':'0.3.0'}}})});if(!_0x5dcdff['ok']){let _0x537939=await _0x5dcdff[_0x4158f0(0x22b)]();return Y('CommHub\x20init\x20failed:\x20'+_0x5dcdff[_0x4158f0(0x1ef)]+'\x20'+_0x537939[_0x4158f0(0x1cd)](0x0,0x64)),{'ok':!0x1,'error':_0x4158f0(0x221)+_0x5dcdff['status']};}await _0x5dcdff[_0x4158f0(0x22b)]();let _0x216c3c=(await(await fetch(D+_0x4158f0(0x1c4),{'method':_0x4158f0(0x204),'headers':{'Content-Type':_0x4158f0(0x1eb),'Accept':_0x4158f0(0x1f3),...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON[_0x4158f0(0x1f0)]({'jsonrpc':_0x4158f0(0x1d2),'id':0x2,'method':'tools/call','params':{'name':_0x3a2b17,'arguments':_0x3bd07b}})}))[_0x4158f0(0x22b)]())['split']('\x0a')[_0x4158f0(0x1fb)](_0x1bd3ee=>_0x1bd3ee[_0x4158f0(0x1f6)](_0x4158f0(0x20e)));if(_0x216c3c){let _0x4eb342=JSON[_0x4158f0(0x1e2)](_0x216c3c[_0x4158f0(0x1cd)](0x6));return _0x4eb342?.[_0x4158f0(0x222)]?.[_0x4158f0(0x1bc)]?.[0x0]?.[_0x4158f0(0x22b)]?JSON[_0x4158f0(0x1e2)](_0x4eb342[_0x4158f0(0x222)][_0x4158f0(0x1bc)][0x0][_0x4158f0(0x22b)]):_0x4eb342;}return{'ok':!0x1,'error':'no\x20response'};}K['setRequestHandler'](a0_0x19d0b1,async _0x51fa76=>{const _0x3d4ffd=a0_0x18a035;let {name:_0x325614,arguments:_0x3ec18c}=_0x51fa76[_0x3d4ffd(0x223)];if(_0x325614===_0x3d4ffd(0x20b)){let {task_id:_0x9f0145,text:_0x517b54,status:_0x255707}=_0x3ec18c;if(_0x255707===_0x3d4ffd(0x1f4)||_0x255707===_0x3d4ffd(0x1c3)||_0x255707==='cancelled'){let _0x35e5b9=_0x255707===_0x3d4ffd(0x1f4)?'replied':_0x255707,_0x1c4143=_0x9f0145?k[_0x3d4ffd(0x1c5)](_0x9f0145)||_0x3d4ffd(0x218):_0x3d4ffd(0x218),_0x2c2652=await P(_0x3d4ffd(0x1ff),{'alias':_0x1c4143,'text':_0x517b54,'in_reply_to':_0x9f0145||void 0x0,'status':_0x35e5b9,'from_session':Z});if(_0x9f0145)k[_0x3d4ffd(0x1c9)](_0x9f0145);return{'content':[{'type':_0x3d4ffd(0x22b),'text':JSON[_0x3d4ffd(0x1f0)](_0x2c2652)}]};}let _0x465006=await P(_0x3d4ffd(0x1ca),{'resume_id':w,'alias':Z,'status':_0x255707===_0x3d4ffd(0x1ad)?_0x3d4ffd(0x1ad):_0x255707===_0x3d4ffd(0x1e0)?'error':'working','task':_0x517b54['slice'](0x0,0xc8),'output':_0x517b54});return{'content':[{'type':'text','text':JSON[_0x3d4ffd(0x1f0)](_0x465006)}]};}if(_0x325614===_0x3d4ffd(0x21c)){let {status:_0x429ad8,task:_0x79c73d,progress:_0xeee2fd}=_0x3ec18c,_0x123478=await P(_0x3d4ffd(0x1ca),{'resume_id':w,'alias':Z,'status':_0x429ad8,'task':_0x79c73d,'progress':_0xeee2fd});return{'content':[{'type':_0x3d4ffd(0x22b),'text':JSON[_0x3d4ffd(0x1f0)](_0x123478)}]};}if(_0x325614===_0x3d4ffd(0x21e)){let {alias:_0x10b5c1,task:_0x165ce8,priority:_0x45aeb3}=_0x3ec18c,_0x1bc630=await P('send_task',{'alias':_0x10b5c1,'task':_0x165ce8,'priority':_0x45aeb3||_0x3d4ffd(0x20a),'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x3d4ffd(0x1f0)](_0x1bc630)}]};}if(_0x325614==='commhub_send_message'){let {alias:_0x381430,message:_0x4528c3}=_0x3ec18c,_0x58e563=await P(_0x3d4ffd(0x1ae),{'alias':_0x381430,'message':_0x4528c3,'from_session':Z});return{'content':[{'type':_0x3d4ffd(0x22b),'text':JSON[_0x3d4ffd(0x1f0)](_0x58e563)}]};}if(_0x325614===_0x3d4ffd(0x1bb)){let _0x2b1975=await P(_0x3d4ffd(0x230),{});return{'content':[{'type':'text','text':JSON['stringify'](_0x2b1975)}]};}return{'content':[{'type':_0x3d4ffd(0x22b),'text':JSON[_0x3d4ffd(0x1f0)]({'error':_0x3d4ffd(0x213)})}]};});async function v(){const _0x5c7a78=a0_0x18a035;let _0x44fc4f=D+_0x5c7a78(0x1df)+encodeURIComponent(Z),_0xe3fb8={};if(X)_0xe3fb8[_0x5c7a78(0x1f8)]=_0x5c7a78(0x1ee)+X;Y(_0x5c7a78(0x1be)+_0x44fc4f);while(!0x0){try{let _0x4e8a11=await fetch(_0x44fc4f,{'headers':_0xe3fb8});if(!_0x4e8a11['ok']){Y('SSE\x20error:\x20'+_0x4e8a11['status']+'\x20'+_0x4e8a11['statusText']),await h(0x1388);continue;}let _0xfbb1b8=_0x4e8a11[_0x5c7a78(0x201)][_0x5c7a78(0x1e6)](),_0x31ea69=new TextDecoder(),_0x155946='';while(!0x0){let {done:_0x2ea5ed,value:_0x53eac0}=await _0xfbb1b8[_0x5c7a78(0x1e4)]();if(_0x2ea5ed)break;_0x155946+=_0x31ea69[_0x5c7a78(0x227)](_0x53eac0,{'stream':!0x0});let _0x10ba2a=_0x155946[_0x5c7a78(0x215)]('\x0a\x0a');_0x155946=_0x10ba2a[_0x5c7a78(0x1fc)]()||'';for(let _0x1871bc of _0x10ba2a){let _0x56c9cc=_0x1871bc[_0x5c7a78(0x215)]('\x0a')[_0x5c7a78(0x1fb)](_0x12457e=>_0x12457e[_0x5c7a78(0x1f6)]('data:\x20'));if(!_0x56c9cc)continue;try{let _0x4c6810=JSON[_0x5c7a78(0x1e2)](_0x56c9cc[_0x5c7a78(0x1cd)](0x6));await u(_0x4c6810);}catch(_0x668828){Y(_0x5c7a78(0x1e7)+_0x668828);}}}Y(_0x5c7a78(0x1ed));}catch(_0x433a42){Y(_0x5c7a78(0x1d3)+_0x433a42);}await h(0xbb8);}}async function u(_0x1d4379){const _0x2bddcd=a0_0x18a035;if(_0x1d4379[_0x2bddcd(0x1dc)]===_0x2bddcd(0x1c0)){Y('SSE\x20connected\x20as\x20\x22'+Z+'\x22');return;}if(_0x1d4379['type']==='new_message'){if(Y('←\x20message\x20from\x20'+_0x1d4379[_0x2bddcd(0x20d)]+':\x20'+_0x1d4379['message']['slice'](0x0,0x3c)),await K[_0x2bddcd(0x1ce)]({'method':_0x2bddcd(0x20c),'params':{'content':_0x1d4379['message'],'meta':{'sender':_0x1d4379[_0x2bddcd(0x20d)]||_0x2bddcd(0x218),'sender_id':_0x2bddcd(0x207),'user':_0x1d4379[_0x2bddcd(0x20d)]||_0x2bddcd(0x218),'priority':_0x2bddcd(0x20a)}}}),_0x1d4379['message_id'])await P(_0x2bddcd(0x202),{'alias':Z,'message_id':_0x1d4379[_0x2bddcd(0x1d4)]});return;}if(_0x1d4379[_0x2bddcd(0x1dc)]==='new_task'||_0x1d4379['type']==='broadcast'){Y('←\x20'+_0x1d4379[_0x2bddcd(0x1dc)]+':\x20inbox_count='+_0x1d4379['inbox_count']+_0x2bddcd(0x1f1)+(_0x1d4379['priority']||_0x2bddcd(0x20a)));let _0x5ab10f=await P(_0x2bddcd(0x1d0),{'alias':Z,'limit':0x5});if(_0x5ab10f?.['ok']&&_0x5ab10f[_0x2bddcd(0x1e9)]?.[_0x2bddcd(0x1e8)]>0x0)for(let _0x1fbb23 of _0x5ab10f[_0x2bddcd(0x1e9)]){let _0x304032={'sender':_0x1fbb23[_0x2bddcd(0x1e5)]||_0x2bddcd(0x218),'sender_id':_0x2bddcd(0x207),'user':_0x1fbb23[_0x2bddcd(0x1e5)]||_0x2bddcd(0x218),'task_id':_0x1fbb23['id'],'priority':_0x1fbb23[_0x2bddcd(0x1bf)]||_0x2bddcd(0x20a)};k['set'](_0x1fbb23['id'],_0x1fbb23[_0x2bddcd(0x1e5)]||'hub'),await K[_0x2bddcd(0x1ce)]({'method':_0x2bddcd(0x20c),'params':{'content':_0x1fbb23[_0x2bddcd(0x1bc)],'meta':_0x304032}}),Y(_0x2bddcd(0x1d1)+_0x1fbb23['id'][_0x2bddcd(0x1cd)](0x0,0x8)+_0x2bddcd(0x205)+_0x1fbb23['from_session']+':\x20'+_0x1fbb23[_0x2bddcd(0x1bc)]['slice'](0x0,0x3c)),await P(_0x2bddcd(0x202),{'alias':Z,'message_id':_0x1fbb23['id']});}}}async function S(){const _0x15e45c=a0_0x18a035;let _0x2afd6e=new a0_0xa58a50();await K['connect'](_0x2afd6e),Y(_0x15e45c(0x1f9)),Y(_0x15e45c(0x206)),v()[_0x15e45c(0x229)](_0x37364c=>Y(_0x15e45c(0x22c)+_0x37364c)),P(_0x15e45c(0x1ca),{'resume_id':w,'alias':Z,'status':_0x15e45c(0x1c8),'server':a0_0x3a7455(),'hostname':a0_0x3a7455(),'agent':'claude-code','project_dir':process[_0x15e45c(0x200)](),'tmux_name':f||void 0x0})['then'](()=>Y('registered\x20as\x20\x22'+Z+_0x15e45c(0x1e3)+w[_0x15e45c(0x1cd)](0x0,0x8)+')'))[_0x15e45c(0x229)](_0x102584=>Y('warning:\x20could\x20not\x20register:\x20'+_0x102584)),setInterval(()=>{const _0x118c13=_0x15e45c;P('report_status',{'resume_id':w,'alias':Z,'status':_0x118c13(0x1c8),'server':a0_0x3a7455(),'hostname':a0_0x3a7455(),'agent':_0x118c13(0x220),'project_dir':process[_0x118c13(0x200)](),'tmux_name':f||void 0x0})['catch'](_0x514764=>Y('heartbeat\x20failed:\x20'+_0x514764));},0x2bf20),Y(_0x15e45c(0x1fa));}S()[a0_0x18a035(0x229)](_0x1d11c4=>{const _0x196f7e=a0_0x18a035;Y(_0x196f7e(0x1f7)+_0x1d11c4),process['exit'](0x1);});async function N(){const _0x23e496=a0_0x18a035;Y(_0x23e496(0x1fd)),await P('report_status',{'resume_id':w,'alias':Z,'status':_0x23e496(0x1e0),'task':'session\x20disconnected'})['catch'](()=>{}),process[_0x23e496(0x1d9)](0x0);}process['stdin']['on'](a0_0x18a035(0x1ac),()=>N()),process['on']('SIGTERM',()=>N()),process['on'](a0_0x18a035(0x1d7),()=>N());
2
+ const a0_0x1bfcde=a0_0x3477;(function(_0x4735e4,_0x56291a){const _0x32fcb0=a0_0x3477,_0x4c7414=_0x4735e4();while(!![]){try{const _0x3cdf36=-parseInt(_0x32fcb0(0x24d))/0x1*(-parseInt(_0x32fcb0(0x215))/0x2)+-parseInt(_0x32fcb0(0x234))/0x3+-parseInt(_0x32fcb0(0x1d8))/0x4*(parseInt(_0x32fcb0(0x1e7))/0x5)+parseInt(_0x32fcb0(0x213))/0x6+parseInt(_0x32fcb0(0x24a))/0x7+-parseInt(_0x32fcb0(0x251))/0x8+-parseInt(_0x32fcb0(0x257))/0x9*(-parseInt(_0x32fcb0(0x1d9))/0xa);if(_0x3cdf36===_0x56291a)break;else _0x4c7414['push'](_0x4c7414['shift']());}catch(_0x29e40a){_0x4c7414['push'](_0x4c7414['shift']());}}}(a0_0x1d41,0x38ddb));import{readFileSync as a0_0x1b88b8,existsSync as a0_0x1e344c}from'fs';import{join as a0_0xf9833a}from'path';import{hostname as a0_0x4dcd02}from'os';import{execSync as a0_0x1b6641}from'child_process';import{Server as a0_0xc1fe57}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x90d41f}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x240108,CallToolRequestSchema as a0_0x3d1ab7}from'@modelcontextprotocol/sdk/types.js';function a0_0x1d41(){const _0x3d4c4b=['idle','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','unknown\x20tool','token','parse\x20error:\x20','commhub','Current\x20task\x20description','Reply\x20text\x20/\x20result\x20summary','commhub_reply','find','0.3.0','setRequestHandler','application/json,\x20text/event-stream','application/json','get','utf-8','Task\x20content','catch','blocked','CommHub\x20init\x20failed:\x20','split','type','string','\x22\x20(','slice','Bearer\x20','tmux\x20display-message\x20-p\x20\x27#S\x27','status','toTimeString','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','\x20RESUME_ID=','priority','239880zENqCB','replace','162jqkUiQ','claude-code','cwd','data:\x20','initialize','normal','stderr','from_session','messages','indexOf','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','failed','...\x20TMUX=','parse','http://127.0.0.1:9200','in_progress','low','hub','Target\x20session\x20alias','ack_inbox','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','length','report_status','commhub_send_message',']\x20[commhub]\x20','no\x20response','exit','.env','←\x20message\x20from\x20','message','commhub_send_task','438933BIFiQb','set','working','warning:\x20could\x20not\x20register:\x20','commhub_get_all_status','alias','replied','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','trim','heartbeat\x20failed:\x20','broadcast','from','commhub-channel','commhub_report_status','get_inbox','registered\x20as\x20\x22','Priority\x20(default:\x20normal)','body','SIGINT','statusText','get_all_status','none','324254xrOEJP','startsWith','connected','4161ftdegg','Message\x20content','send_reply','object','1641104aiQddb','cancelled','SSE\x20connection\x20error:\x20','ENV:\x20URL=','\x20priority=','send_task','20259fKUWFX','\x20PROJECT_ENV=','2.0','inbox_count','end','stringify','72764vYJJik','2170IpBPpY','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','notification','connect','send_message','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','shutting\x20down,\x20reporting\x20offline...','content','message_id','notifications/claude/channel','text','completed','/mcp','number','90YvXUKt','error','tools/call','2025-03-26','\x20from\x20','POST','pop','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','MCP\x20stdio\x20connected','\x20ALIAS=','SIGTERM','SSE\x20stream\x20ended,\x20reconnecting...'];a0_0x1d41=function(){return _0x3d4c4b;};return a0_0x1d41();}function a0_0x3477(_0x4cb252,_0x85363b){_0x4cb252=_0x4cb252-0x1d8;const _0x1d4143=a0_0x1d41();let _0x34779a=_0x1d4143[_0x4cb252];return _0x34779a;}function p(_0x2452fe){const _0x5aa658=a0_0x3477;if(!a0_0x1e344c(_0x2452fe))return;for(let _0x188a2a of a0_0x1b88b8(_0x2452fe,_0x5aa658(0x202))[_0x5aa658(0x207)]('\x0a')){let _0x356b85=_0x188a2a[_0x5aa658(0x23c)]();if(!_0x356b85||_0x356b85[_0x5aa658(0x24b)]('#'))continue;let _0x277f23=_0x356b85[_0x5aa658(0x21e)]('=');if(_0x277f23<0x0)continue;let _0xa61733=_0x356b85['slice'](0x0,_0x277f23)[_0x5aa658(0x23c)](),_0x548b01=_0x356b85['slice'](_0x277f23+0x1)[_0x5aa658(0x23c)]()[_0x5aa658(0x214)](/^["']|["']$/g,'');if(!process.env[_0xa61733])process.env[_0xa61733]=_0x548b01;}}var C=process.env.HOME||'~',T=a0_0xf9833a(C,'.claude/channels/commhub');p(a0_0xf9833a(T,a0_0x1bfcde(0x230)));var L=process[a0_0x1bfcde(0x217)]()['replace'](/\//g,'-');p(a0_0xf9833a(T,L,'.env'));function U(){const _0x30c373=a0_0x1bfcde;try{return a0_0x1b6641(_0x30c373(0x20d),{'encoding':_0x30c373(0x202),'timeout':0x7d0})['trim']();}catch{return'';}}function c(){const _0x141b69=a0_0x1bfcde;try{let _0x1c8451=a0_0xf9833a(C,'.anet','config.json');if(a0_0x1e344c(_0x1c8451))return JSON['parse'](a0_0x1b88b8(_0x1c8451,_0x141b69(0x202)));}catch{}return{};}var H=c(),D=process.env.COMMHUB_URL||H[a0_0x1bfcde(0x226)]||a0_0x1bfcde(0x223),f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0x4dcd02(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto['randomUUID'](),X=process.env.COMMHUB_TOKEN||H[a0_0x1bfcde(0x1f6)]||'';function Y(_0x335d64){const _0x21ca9e=a0_0x1bfcde;let _0xa6cc2f=new Date()[_0x21ca9e(0x20f)]()[_0x21ca9e(0x20b)](0x0,0x8);process[_0x21ca9e(0x21b)]['write']('['+_0xa6cc2f+_0x21ca9e(0x22d)+_0x335d64+'\x0a');}function h(_0x1103f2){return new Promise(_0x51957a=>setTimeout(_0x51957a,_0x1103f2));}Y(a0_0x1bfcde(0x254)+D+a0_0x1bfcde(0x1f0)+Z+a0_0x1bfcde(0x211)+w['slice'](0x0,0x8)+a0_0x1bfcde(0x221)+(f||a0_0x1bfcde(0x249))+'\x20CWD='+process[a0_0x1bfcde(0x217)]()+a0_0x1bfcde(0x258)+L);var k=new Map(),K=new a0_0xc1fe57({'name':'commhub-channel','version':a0_0x1bfcde(0x1fd)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x1bfcde(0x210),a0_0x1bfcde(0x23b),a0_0x1bfcde(0x1de),'You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','Session\x20alias:\x20'+Z]['join']('\x0a')});K[a0_0x1bfcde(0x1fe)](a0_0x240108,async()=>({'tools':[{'name':a0_0x1bfcde(0x1fb),'description':a0_0x1bfcde(0x1ee),'inputSchema':{'type':'object','properties':{'task_id':{'type':a0_0x1bfcde(0x209),'description':'The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)'},'text':{'type':a0_0x1bfcde(0x209),'description':a0_0x1bfcde(0x1fa)},'status':{'type':a0_0x1bfcde(0x209),'enum':['completed',a0_0x1bfcde(0x220),a0_0x1bfcde(0x252),a0_0x1bfcde(0x205),a0_0x1bfcde(0x1e8),a0_0x1bfcde(0x224)],'description':a0_0x1bfcde(0x1f4)}},'required':[a0_0x1bfcde(0x1e3)]}},{'name':'commhub_report_status','description':'Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','inputSchema':{'type':a0_0x1bfcde(0x250),'properties':{'status':{'type':'string','enum':[a0_0x1bfcde(0x236),'idle',a0_0x1bfcde(0x205),a0_0x1bfcde(0x1e8)]},'task':{'type':a0_0x1bfcde(0x209),'description':a0_0x1bfcde(0x1f9)},'progress':{'type':a0_0x1bfcde(0x1e6),'description':'Progress\x200-100'}},'required':[a0_0x1bfcde(0x20e)]}},{'name':a0_0x1bfcde(0x233),'description':a0_0x1bfcde(0x1da),'inputSchema':{'type':a0_0x1bfcde(0x250),'properties':{'alias':{'type':a0_0x1bfcde(0x209),'description':a0_0x1bfcde(0x227)},'task':{'type':a0_0x1bfcde(0x209),'description':a0_0x1bfcde(0x203)},'priority':{'type':a0_0x1bfcde(0x209),'enum':['high',a0_0x1bfcde(0x21a),a0_0x1bfcde(0x225)],'description':a0_0x1bfcde(0x244)}},'required':['alias','task']}},{'name':a0_0x1bfcde(0x22c),'description':a0_0x1bfcde(0x21f),'inputSchema':{'type':a0_0x1bfcde(0x250),'properties':{'alias':{'type':a0_0x1bfcde(0x209),'description':'Target\x20session\x20alias'},'message':{'type':a0_0x1bfcde(0x209),'description':a0_0x1bfcde(0x24e)}},'required':[a0_0x1bfcde(0x239),'message']}},{'name':'commhub_get_all_status','description':a0_0x1bfcde(0x229),'inputSchema':{'type':a0_0x1bfcde(0x250),'properties':{}}}]}));async function P(_0x316971,_0x3948fc){const _0x51b984=a0_0x1bfcde;let _0x2694a2=await fetch(D+_0x51b984(0x1e5),{'method':_0x51b984(0x1ec),'headers':{'Content-Type':_0x51b984(0x200),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x51b984(0x20c)+X}:{}},'body':JSON[_0x51b984(0x25c)]({'jsonrpc':'2.0','id':0x1,'method':_0x51b984(0x219),'params':{'protocolVersion':_0x51b984(0x1ea),'capabilities':{},'clientInfo':{'name':_0x51b984(0x240),'version':_0x51b984(0x1fd)}}})});if(!_0x2694a2['ok']){let _0x8da0c5=await _0x2694a2[_0x51b984(0x1e3)]();return Y(_0x51b984(0x206)+_0x2694a2[_0x51b984(0x20e)]+'\x20'+_0x8da0c5[_0x51b984(0x20b)](0x0,0x64)),{'ok':!0x1,'error':'init\x20failed:\x20'+_0x2694a2[_0x51b984(0x20e)]};}await _0x2694a2[_0x51b984(0x1e3)]();let _0x31123b=(await(await fetch(D+_0x51b984(0x1e5),{'method':_0x51b984(0x1ec),'headers':{'Content-Type':_0x51b984(0x200),'Accept':_0x51b984(0x1ff),...X?{'Authorization':_0x51b984(0x20c)+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x51b984(0x259),'id':0x2,'method':_0x51b984(0x1e9),'params':{'name':_0x316971,'arguments':_0x3948fc}})}))['text']())[_0x51b984(0x207)]('\x0a')['find'](_0xf78749=>_0xf78749[_0x51b984(0x24b)](_0x51b984(0x218)));if(_0x31123b){let _0x10da20=JSON['parse'](_0x31123b[_0x51b984(0x20b)](0x6));return _0x10da20?.['result']?.[_0x51b984(0x1e0)]?.[0x0]?.[_0x51b984(0x1e3)]?JSON['parse'](_0x10da20['result'][_0x51b984(0x1e0)][0x0][_0x51b984(0x1e3)]):_0x10da20;}return{'ok':!0x1,'error':_0x51b984(0x22e)};}K[a0_0x1bfcde(0x1fe)](a0_0x3d1ab7,async _0x5ec644=>{const _0x2ad2c=a0_0x1bfcde;let {name:_0x93baa8,arguments:_0x2c4815}=_0x5ec644['params'];if(_0x93baa8==='commhub_reply'){let {task_id:_0x4671f5,text:_0x22d80e,status:_0x15be96}=_0x2c4815;if(_0x15be96===_0x2ad2c(0x1e4)||_0x15be96===_0x2ad2c(0x220)||_0x15be96===_0x2ad2c(0x252)){let _0x2e5106=_0x15be96===_0x2ad2c(0x1e4)?_0x2ad2c(0x23a):_0x15be96,_0x1142b0=_0x4671f5?k[_0x2ad2c(0x201)](_0x4671f5)||_0x2ad2c(0x226):'hub',_0x1a838a=await P(_0x2ad2c(0x24f),{'alias':_0x1142b0,'text':_0x22d80e,'in_reply_to':_0x4671f5||void 0x0,'status':_0x2e5106,'from_session':Z});if(_0x4671f5)k['delete'](_0x4671f5);return{'content':[{'type':_0x2ad2c(0x1e3),'text':JSON[_0x2ad2c(0x25c)](_0x1a838a)}]};}let _0x1ebe8d=await P(_0x2ad2c(0x22b),{'resume_id':w,'alias':Z,'status':_0x15be96==='blocked'?_0x2ad2c(0x205):_0x15be96==='error'?_0x2ad2c(0x1e8):'working','task':_0x22d80e[_0x2ad2c(0x20b)](0x0,0xc8),'output':_0x22d80e});return{'content':[{'type':_0x2ad2c(0x1e3),'text':JSON[_0x2ad2c(0x25c)](_0x1ebe8d)}]};}if(_0x93baa8===_0x2ad2c(0x241)){let {status:_0x41a26b,task:_0x3ad149,progress:_0x5cfc7e}=_0x2c4815,_0xbb9721=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x41a26b,'task':_0x3ad149,'progress':_0x5cfc7e});return{'content':[{'type':_0x2ad2c(0x1e3),'text':JSON[_0x2ad2c(0x25c)](_0xbb9721)}]};}if(_0x93baa8===_0x2ad2c(0x233)){let {alias:_0x537a0e,task:_0x506210,priority:_0x5131c3}=_0x2c4815,_0x467616=await P(_0x2ad2c(0x256),{'alias':_0x537a0e,'task':_0x506210,'priority':_0x5131c3||_0x2ad2c(0x21a),'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x2ad2c(0x25c)](_0x467616)}]};}if(_0x93baa8===_0x2ad2c(0x22c)){let {alias:_0x15ab1a,message:_0x2cae7d}=_0x2c4815,_0x3a1d68=await P(_0x2ad2c(0x1dd),{'alias':_0x15ab1a,'message':_0x2cae7d,'from_session':Z});return{'content':[{'type':_0x2ad2c(0x1e3),'text':JSON[_0x2ad2c(0x25c)](_0x3a1d68)}]};}if(_0x93baa8===_0x2ad2c(0x238)){let _0x322f88=await P(_0x2ad2c(0x248),{});return{'content':[{'type':_0x2ad2c(0x1e3),'text':JSON[_0x2ad2c(0x25c)](_0x322f88)}]};}return{'content':[{'type':_0x2ad2c(0x1e3),'text':JSON['stringify']({'error':_0x2ad2c(0x1f5)})}]};});async function v(){const _0x2eff2b=a0_0x1bfcde;let _0x21dfdb=D+'/events/'+encodeURIComponent(Z),_0x23d0ff={};if(X)_0x23d0ff['Authorization']=_0x2eff2b(0x20c)+X;Y('connecting\x20to\x20'+_0x21dfdb);while(!0x0){try{let _0x101c64=await fetch(_0x21dfdb,{'headers':_0x23d0ff});if(!_0x101c64['ok']){Y('SSE\x20error:\x20'+_0x101c64[_0x2eff2b(0x20e)]+'\x20'+_0x101c64[_0x2eff2b(0x247)]),await h(0x1388);continue;}let _0x590abd=_0x101c64[_0x2eff2b(0x245)]['getReader'](),_0x592518=new TextDecoder(),_0x556545='';while(!0x0){let {done:_0x25bf4a,value:_0x2106a3}=await _0x590abd['read']();if(_0x25bf4a)break;_0x556545+=_0x592518['decode'](_0x2106a3,{'stream':!0x0});let _0x48b926=_0x556545[_0x2eff2b(0x207)]('\x0a\x0a');_0x556545=_0x48b926[_0x2eff2b(0x1ed)]()||'';for(let _0x2ceefc of _0x48b926){let _0xe3f426=_0x2ceefc[_0x2eff2b(0x207)]('\x0a')[_0x2eff2b(0x1fc)](_0x281105=>_0x281105[_0x2eff2b(0x24b)](_0x2eff2b(0x218)));if(!_0xe3f426)continue;try{let _0x4b59eb=JSON[_0x2eff2b(0x222)](_0xe3f426['slice'](0x6));await u(_0x4b59eb);}catch(_0x1c9c74){Y(_0x2eff2b(0x1f7)+_0x1c9c74);}}}Y(_0x2eff2b(0x1f2));}catch(_0x3d705e){Y(_0x2eff2b(0x253)+_0x3d705e);}await h(0xbb8);}}async function u(_0x18ef59){const _0x13eb17=a0_0x1bfcde;if(_0x18ef59['type']===_0x13eb17(0x24c)){Y('SSE\x20connected\x20as\x20\x22'+Z+'\x22');return;}if(_0x18ef59['type']==='new_message'){if(Y(_0x13eb17(0x231)+_0x18ef59[_0x13eb17(0x23f)]+':\x20'+_0x18ef59['message'][_0x13eb17(0x20b)](0x0,0x3c)),await K[_0x13eb17(0x1db)]({'method':_0x13eb17(0x1e2),'params':{'content':_0x18ef59[_0x13eb17(0x232)],'meta':{'sender':_0x18ef59[_0x13eb17(0x23f)]||_0x13eb17(0x226),'sender_id':_0x13eb17(0x1f8),'user':_0x18ef59[_0x13eb17(0x23f)]||_0x13eb17(0x226),'priority':_0x13eb17(0x21a)}}}),_0x18ef59[_0x13eb17(0x1e1)])await P('ack_inbox',{'alias':Z,'message_id':_0x18ef59[_0x13eb17(0x1e1)]});return;}if(_0x18ef59['type']==='new_task'||_0x18ef59[_0x13eb17(0x208)]===_0x13eb17(0x23e)){Y('←\x20'+_0x18ef59[_0x13eb17(0x208)]+':\x20inbox_count='+_0x18ef59[_0x13eb17(0x25a)]+_0x13eb17(0x255)+(_0x18ef59[_0x13eb17(0x212)]||_0x13eb17(0x21a)));let _0x22d86c=await P(_0x13eb17(0x242),{'alias':Z,'limit':0x5});if(_0x22d86c?.['ok']&&_0x22d86c[_0x13eb17(0x21d)]?.[_0x13eb17(0x22a)]>0x0)for(let _0x183b31 of _0x22d86c['messages']){let _0x32cb18={'sender':_0x183b31[_0x13eb17(0x21c)]||_0x13eb17(0x226),'sender_id':_0x13eb17(0x1f8),'user':_0x183b31['from_session']||'hub','task_id':_0x183b31['id'],'priority':_0x183b31[_0x13eb17(0x212)]||_0x13eb17(0x21a)};k[_0x13eb17(0x235)](_0x183b31['id'],_0x183b31[_0x13eb17(0x21c)]||'hub'),await K['notification']({'method':'notifications/claude/channel','params':{'content':_0x183b31['content'],'meta':_0x32cb18}}),Y('→\x20injected\x20task\x20'+_0x183b31['id'][_0x13eb17(0x20b)](0x0,0x8)+_0x13eb17(0x1eb)+_0x183b31[_0x13eb17(0x21c)]+':\x20'+_0x183b31[_0x13eb17(0x1e0)][_0x13eb17(0x20b)](0x0,0x3c)),await P(_0x13eb17(0x228),{'alias':Z,'message_id':_0x183b31['id']});}}}async function S(){const _0x23dbcc=a0_0x1bfcde;let _0x4a99d9=new a0_0x90d41f();await K[_0x23dbcc(0x1dc)](_0x4a99d9),Y(_0x23dbcc(0x1ef)),Y('starting\x20SSE\x20listener...'),v()[_0x23dbcc(0x204)](_0x1f0f98=>Y('SSE\x20fatal:\x20'+_0x1f0f98)),P(_0x23dbcc(0x22b),{'resume_id':w,'alias':Z,'status':_0x23dbcc(0x1f3),'server':a0_0x4dcd02(),'hostname':a0_0x4dcd02(),'agent':_0x23dbcc(0x216),'project_dir':process['cwd'](),'tmux_name':f||void 0x0})['then'](()=>Y(_0x23dbcc(0x243)+Z+_0x23dbcc(0x20a)+w[_0x23dbcc(0x20b)](0x0,0x8)+')'))[_0x23dbcc(0x204)](_0x292b2e=>Y(_0x23dbcc(0x237)+_0x292b2e)),setInterval(()=>{const _0xb9ba01=_0x23dbcc;P('report_status',{'resume_id':w,'alias':Z,'status':_0xb9ba01(0x1f3),'server':a0_0x4dcd02(),'hostname':a0_0x4dcd02(),'agent':_0xb9ba01(0x216),'project_dir':process['cwd'](),'tmux_name':f||void 0x0})[_0xb9ba01(0x204)](_0x35d54f=>Y(_0xb9ba01(0x23d)+_0x35d54f));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}S()[a0_0x1bfcde(0x204)](_0x76d579=>{const _0x4b8e13=a0_0x1bfcde;Y('fatal:\x20'+_0x76d579),process[_0x4b8e13(0x22f)](0x1);});async function N(){const _0x3c9ff6=a0_0x1bfcde;Y(_0x3c9ff6(0x1df)),await P(_0x3c9ff6(0x22b),{'resume_id':w,'alias':Z,'status':'error','task':'session\x20disconnected'})[_0x3c9ff6(0x204)](()=>{}),process[_0x3c9ff6(0x22f)](0x0);}process['stdin']['on'](a0_0x1bfcde(0x25b),()=>N()),process['on'](a0_0x1bfcde(0x1f1),()=>N()),process['on'](a0_0x1bfcde(0x246),()=>N());
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.0.0-preview.8",
4
- "description": "AI Agent Network Server + Client + Setup in one package. SSE real-time communication for multi-agent orchestration.",
3
+ "version": "2.0.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
+ }