@sleep2agi/agent-network 2.2.2 → 2.2.3

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_0x3d7897=a0_0x21c1;(function(_0x443b3f,_0x524ecd){const _0x29b635=a0_0x21c1,_0x24711d=_0x443b3f();while(!![]){try{const _0x650ae4=parseInt(_0x29b635(0xf7))/0x1*(parseInt(_0x29b635(0x10f))/0x2)+-parseInt(_0x29b635(0xf5))/0x3*(-parseInt(_0x29b635(0x105))/0x4)+parseInt(_0x29b635(0x10c))/0x5+parseInt(_0x29b635(0xdc))/0x6*(parseInt(_0x29b635(0xfb))/0x7)+parseInt(_0x29b635(0xf1))/0x8*(parseInt(_0x29b635(0xe7))/0x9)+-parseInt(_0x29b635(0xce))/0xa*(-parseInt(_0x29b635(0xdf))/0xb)+-parseInt(_0x29b635(0xfc))/0xc;if(_0x650ae4===_0x524ecd)break;else _0x24711d['push'](_0x24711d['shift']());}catch(_0x1e1821){_0x24711d['push'](_0x24711d['shift']());}}}(a0_0x56a4,0xe6cba));function a0_0x56a4(){const _0x4641ab=['toString','from_session','2NNXyBV','name','min','Authorization','cwd','processInbox','/events/','log','registered','sseAbort','connect','resumeId','status','get_inbox','text','SSE\x20failed:\x20','disconnected','application/json,\x20text/event-stream','tools/call','toTimeString','send_task','227110gXQjSz','normal','completed','content','split','alias','body','message','s...','new_message','reconnectDelay','2.0','heartbeatTimer','broadcast','980436OrjFgQ','task','now','319hkGZXX','SSE\x20error:\x20','text/event-stream','inbox\x20error:\x20','POST','url','stringify','heartbeat\x20failed:\x20','13802931IrpVZi','parse','getAllStatus','heartbeatInterval','startsWith','AbortError','send_reply','error','slice','getReader','8kSGkzb','sdk','call','Bearer\x20','5934ObvukP','read','879059XnczUr','type','reply',']\x20[commhub:','56ttPrFq','59238240yVILio','data:\x20','agent','send_message','emit','sleep','new_task','idle','token','792ndWQCY','running','report_status','decode','abort','match','catch','5558145keajsf'];a0_0x56a4=function(){return _0x4641ab;};return a0_0x56a4();}import{EventEmitter as a0_0x35b3d6}from'events';import{hostname as a0_0x3df197}from'os';class T extends a0_0x35b3d6{[a0_0x3d7897(0xe4)];['alias'];[a0_0x3d7897(0x104)];[a0_0x3d7897(0xfe)];[a0_0x3d7897(0x11a)];['heartbeatInterval'];['reconnectDelay'];[a0_0x3d7897(0xda)];[a0_0x3d7897(0x118)];[a0_0x3d7897(0x106)]=!0x1;constructor(_0x1224f1){const _0x22d927=a0_0x3d7897;super();if(this[_0x22d927(0xe4)]=_0x1224f1[_0x22d927(0xe4)]['replace'](/\/$/,''),this[_0x22d927(0xd3)]=_0x1224f1[_0x22d927(0xd3)],this[_0x22d927(0x104)]=_0x1224f1[_0x22d927(0x104)],this[_0x22d927(0xfe)]=_0x1224f1['agent']||_0x22d927(0xf2),this[_0x22d927(0x11a)]='sdk-'+_0x1224f1['alias']+'-'+Date[_0x22d927(0xde)]()[_0x22d927(0x10d)](0x24),this['heartbeatInterval']=_0x1224f1[_0x22d927(0xea)]??0x2bf20,this[_0x22d927(0xd8)]=_0x1224f1['reconnectDelay']??0xbb8,_0x1224f1['autoConnect']!==!0x1)this[_0x22d927(0x119)]();}[a0_0x3d7897(0x116)](_0x2be55a){const _0x2f269b=a0_0x3d7897;console[_0x2f269b(0x116)]('['+new Date()[_0x2f269b(0xcc)]()[_0x2f269b(0xef)](0x0,0x8)+_0x2f269b(0xfa)+this['alias']+']\x20'+_0x2be55a);}async[a0_0x3d7897(0xf3)](_0x16ec18,_0x128c75){const _0x4dcbe1=a0_0x3d7897;let _0x47765f={'Content-Type':'application/json','Accept':_0x4dcbe1(0xca)};if(this['token'])_0x47765f['Authorization']=_0x4dcbe1(0xf4)+this[_0x4dcbe1(0x104)];let _0x5e00f8=await(await fetch(this[_0x4dcbe1(0xe4)]+'/mcp',{'method':_0x4dcbe1(0xe3),'headers':_0x47765f,'body':JSON[_0x4dcbe1(0xe5)]({'jsonrpc':_0x4dcbe1(0xd9),'id':Date[_0x4dcbe1(0xde)](),'method':_0x4dcbe1(0xcb),'params':{'name':_0x16ec18,'arguments':_0x128c75}})}))[_0x4dcbe1(0x11d)](),_0x261700=_0x5e00f8[_0x4dcbe1(0x10a)](/data: (.+)/),_0x21ad6c=_0x261700?JSON[_0x4dcbe1(0xe8)](_0x261700[0x1]):JSON['parse'](_0x5e00f8),_0x903897=_0x21ad6c?.['result']?.[_0x4dcbe1(0xd1)]?.[0x0]?.['text'];return _0x903897?JSON[_0x4dcbe1(0xe8)](_0x903897):_0x21ad6c;}async['connect'](){const _0x2d0758=a0_0x3d7897;if(this[_0x2d0758(0x106)])return;this[_0x2d0758(0x106)]=!0x0,await this['status'](_0x2d0758(0x103)),this[_0x2d0758(0x116)](_0x2d0758(0x117)),this[_0x2d0758(0xda)]=setInterval(()=>{const _0x507957=_0x2d0758;this[_0x507957(0x11b)]('idle')[_0x507957(0x10b)](_0x3ebf5d=>this[_0x507957(0x116)](_0x507957(0xe6)+_0x3ebf5d['message']));},this[_0x2d0758(0xea)]),this['connectSSE']();}async['disconnect'](){const _0x25ab74=a0_0x3d7897;if(this[_0x25ab74(0x106)]=!0x1,this[_0x25ab74(0x118)]?.[_0x25ab74(0x109)](),this[_0x25ab74(0xda)])clearInterval(this[_0x25ab74(0xda)]);await this[_0x25ab74(0x11b)]('offline')['catch'](()=>{}),this[_0x25ab74(0x116)](_0x25ab74(0x11f));}async['send'](_0x45548c,_0x8e4943,_0x5325a3=a0_0x3d7897(0xcf)){const _0x41268d=a0_0x3d7897;return this[_0x41268d(0xf3)](_0x41268d(0xcd),{'alias':_0x45548c,'task':_0x8e4943,'priority':_0x5325a3,'from_session':this['alias']});}async[a0_0x3d7897(0xd5)](_0x2afd76,_0x1d42c5){const _0xf4f732=a0_0x3d7897;return this[_0xf4f732(0xf3)](_0xf4f732(0xff),{'alias':_0x2afd76,'message':_0x1d42c5,'from_session':this[_0xf4f732(0xd3)]});}async[a0_0x3d7897(0xf9)](_0x2fa7e7,_0x25ad47,_0x34a8ea=a0_0x3d7897(0xd0)){const _0x28644f=a0_0x3d7897;return this[_0x28644f(0xf3)](_0x28644f(0xed),{'in_reply_to':_0x2fa7e7,'text':_0x25ad47,'status':_0x34a8ea});}async['status'](_0x5ace45,_0x586463){const _0x2a4ca6=a0_0x3d7897;return this['call'](_0x2a4ca6(0x107),{'resume_id':this[_0x2a4ca6(0x11a)],'alias':this[_0x2a4ca6(0xd3)],'status':_0x5ace45,'server':a0_0x3df197(),'hostname':a0_0x3df197(),'agent':this[_0x2a4ca6(0xfe)],'project_dir':process[_0x2a4ca6(0x113)](),..._0x586463});}async[a0_0x3d7897(0xe9)](){const _0xc00856=a0_0x3d7897;return this[_0xc00856(0xf3)]('get_all_status',{});}async[a0_0x3d7897(0xdb)](_0x5d009e,_0x460656){const _0x3b38dc=a0_0x3d7897;return this[_0x3b38dc(0xf3)]('broadcast',{'message':_0x5d009e,'filter_server':_0x460656?.['server'],'filter_status':_0x460656?.[_0x3b38dc(0x11b)]});}async['connectSSE'](){const _0x456cc3=a0_0x3d7897;let _0x202c27=encodeURIComponent(this[_0x456cc3(0xd3)]),_0x985c72=this[_0x456cc3(0xe4)]+_0x456cc3(0x115)+_0x202c27,_0xd4c084=this[_0x456cc3(0xd8)];while(this['running']){try{this['sseAbort']=new AbortController();let _0xf53f9c={'Accept':_0x456cc3(0xe1)};if(this[_0x456cc3(0x104)])_0xf53f9c[_0x456cc3(0x112)]=_0x456cc3(0xf4)+this['token'];let _0x1f9b5b=await fetch(_0x985c72,{'headers':_0xf53f9c,'signal':this[_0x456cc3(0x118)]['signal']});if(!_0x1f9b5b['ok']||!_0x1f9b5b[_0x456cc3(0xd4)]){this[_0x456cc3(0x116)](_0x456cc3(0x11e)+_0x1f9b5b[_0x456cc3(0x11b)]),await this[_0x456cc3(0x101)](_0xd4c084),_0xd4c084=Math['min'](_0xd4c084*1.5,0xea60);continue;}_0xd4c084=this[_0x456cc3(0xd8)];let _0x58a7ec=_0x1f9b5b[_0x456cc3(0xd4)][_0x456cc3(0xf0)](),_0x59ea75=new TextDecoder(),_0x5cd595='';while(this[_0x456cc3(0x106)]){let {done:_0x232e1b,value:_0x27e338}=await _0x58a7ec[_0x456cc3(0xf6)]();if(_0x232e1b)break;_0x5cd595+=_0x59ea75[_0x456cc3(0x108)](_0x27e338,{'stream':!0x0});let _0x16b22b=_0x5cd595[_0x456cc3(0xd2)]('\x0a');_0x5cd595=_0x16b22b['pop']()||'';for(let _0x25387a of _0x16b22b){if(!_0x25387a[_0x456cc3(0xeb)](_0x456cc3(0xfd)))continue;try{let _0x446843=JSON[_0x456cc3(0xe8)](_0x25387a[_0x456cc3(0xef)](0x6));if(_0x446843[_0x456cc3(0xf8)]==='connected'){this['log']('SSE\x20connected'),this[_0x456cc3(0x100)]('connected');continue;}if(_0x446843[_0x456cc3(0xf8)]===_0x456cc3(0x102)||_0x446843['type']===_0x456cc3(0xd7)||_0x446843['type']===_0x456cc3(0xdb))await this[_0x456cc3(0x114)]();}catch{}}}}catch(_0x86b503){if(_0x86b503[_0x456cc3(0x110)]===_0x456cc3(0xec))break;this[_0x456cc3(0x100)](_0x456cc3(0xee),_0x86b503),this[_0x456cc3(0x116)](_0x456cc3(0xe0)+_0x86b503[_0x456cc3(0xd5)]);}if(this[_0x456cc3(0x106)])this['emit'](_0x456cc3(0x11f)),this['log']('SSE\x20reconnecting\x20in\x20'+_0xd4c084/0x3e8+_0x456cc3(0xd6)),await this[_0x456cc3(0x101)](_0xd4c084),_0xd4c084=Math[_0x456cc3(0x111)](_0xd4c084*1.5,0xea60);}}async[a0_0x3d7897(0x114)](){const _0x4d276e=a0_0x3d7897;try{let _0x596b66=(await this[_0x4d276e(0xf3)](_0x4d276e(0x11c),{'alias':this[_0x4d276e(0xd3)],'limit':0xa}))?.['messages']||[];for(let _0x3fd757 of _0x596b66)await this[_0x4d276e(0xf3)]('ack_inbox',{'alias':this['alias'],'message_id':_0x3fd757['id']}),this['log']('←\x20'+_0x3fd757[_0x4d276e(0x10e)]+':\x20'+_0x3fd757[_0x4d276e(0xd1)][_0x4d276e(0xef)](0x0,0x3c)),this[_0x4d276e(0x100)](_0x4d276e(0xdd),_0x3fd757),this[_0x4d276e(0x100)](_0x4d276e(0xd5),_0x3fd757);}catch(_0x11b8c2){this[_0x4d276e(0x116)](_0x4d276e(0xe2)+_0x11b8c2['message']);}}[a0_0x3d7897(0x101)](_0x1c2140){return new Promise(_0x516d21=>setTimeout(_0x516d21,_0x1c2140));}}function a0_0x21c1(_0xb7afbb,_0x235bcc){_0xb7afbb=_0xb7afbb-0xca;const _0x56a491=a0_0x56a4();let _0x21c1af=_0x56a491[_0xb7afbb];return _0x21c1af;}var $=T;export{$ as default,T as CommHub};
1
+ const a0_0x50154e=a0_0x4586;(function(_0x3a2167,_0x46eb84){const _0xdcedc2=a0_0x4586,_0x2e9c36=_0x3a2167();while(!![]){try{const _0x5b463c=-parseInt(_0xdcedc2(0x173))/0x1*(-parseInt(_0xdcedc2(0x155))/0x2)+parseInt(_0xdcedc2(0x181))/0x3+-parseInt(_0xdcedc2(0x162))/0x4*(parseInt(_0xdcedc2(0x135))/0x5)+parseInt(_0xdcedc2(0x133))/0x6*(-parseInt(_0xdcedc2(0x17c))/0x7)+parseInt(_0xdcedc2(0x16c))/0x8+parseInt(_0xdcedc2(0x14a))/0x9*(-parseInt(_0xdcedc2(0x152))/0xa)+-parseInt(_0xdcedc2(0x17a))/0xb*(-parseInt(_0xdcedc2(0x13d))/0xc);if(_0x5b463c===_0x46eb84)break;else _0x2e9c36['push'](_0x2e9c36['shift']());}catch(_0x11cc71){_0x2e9c36['push'](_0x2e9c36['shift']());}}}(a0_0x223c,0x790c3));import{EventEmitter as a0_0xe87b5c}from'events';import{hostname as a0_0x536262}from'os';function a0_0x4586(_0x6dbc74,_0x2b1f24){_0x6dbc74=_0x6dbc74-0x12a;const _0x223c88=a0_0x223c();let _0x458623=_0x223c88[_0x6dbc74];return _0x458623;}function a0_0x223c(){const _0x58ead4=['9636WUpnyY','heartbeat\x20failed:\x20','/events/','completed','processInbox','resumeId','getAllStatus','connected','connectSSE','sleep','sdk','new_message','url','788805ILkDJr','ack_inbox','send_reply','Authorization','task','get_all_status','replace','application/json,\x20text/event-stream','20zWZGCl','body','sdk-','124kqKDxV','server','alias','startsWith','pop','now','report_status','agent','application/json','toString','decode','SSE\x20failed:\x20','cwd','16700fgQbsd','match','Bearer\x20','POST','disconnected','log','broadcast','from_session','send_message','text/event-stream','2600456iSRqLx','reconnectDelay','heartbeatInterval','sseAbort','heartbeatTimer','s...','offline','15828KDNDQq','idle','AbortError','call','2.0','reply','send_task','3982byUYQB','token','175joGnSr','data:\x20','abort','/mcp','SSE\x20error:\x20','628791fedTjK','SSE\x20reconnecting\x20in\x20','connect','stringify','content','status','disconnect','running','name','text','inbox\x20error:\x20','emit','result','type','catch','77148XPhyJZ','send','975HBtzeM','slice','message','autoConnect','read','min','parse','normal'];a0_0x223c=function(){return _0x58ead4;};return a0_0x223c();}class T extends a0_0xe87b5c{[a0_0x50154e(0x149)];[a0_0x50154e(0x157)];[a0_0x50154e(0x17b)];['agent'];[a0_0x50154e(0x142)];[a0_0x50154e(0x16e)];[a0_0x50154e(0x16d)];['heartbeatTimer'];['sseAbort'];[a0_0x50154e(0x12b)]=!0x1;constructor(_0xaf6c1e){const _0x1ad006=a0_0x50154e;super();if(this[_0x1ad006(0x149)]=_0xaf6c1e[_0x1ad006(0x149)][_0x1ad006(0x150)](/\/$/,''),this['alias']=_0xaf6c1e[_0x1ad006(0x157)],this[_0x1ad006(0x17b)]=_0xaf6c1e[_0x1ad006(0x17b)],this[_0x1ad006(0x15c)]=_0xaf6c1e[_0x1ad006(0x15c)]||_0x1ad006(0x147),this[_0x1ad006(0x142)]=_0x1ad006(0x154)+_0xaf6c1e[_0x1ad006(0x157)]+'-'+Date[_0x1ad006(0x15a)]()[_0x1ad006(0x15e)](0x24),this[_0x1ad006(0x16e)]=_0xaf6c1e[_0x1ad006(0x16e)]??0x2bf20,this[_0x1ad006(0x16d)]=_0xaf6c1e[_0x1ad006(0x16d)]??0xbb8,_0xaf6c1e[_0x1ad006(0x138)]!==!0x1)this[_0x1ad006(0x183)]();}['log'](_0x1f9276){const _0x4fc15b=a0_0x50154e;console['log']('['+new Date()['toTimeString']()['slice'](0x0,0x8)+']\x20[commhub:'+this[_0x4fc15b(0x157)]+']\x20'+_0x1f9276);}async['call'](_0x43ef04,_0x4d8b3f){const _0x38f8e2=a0_0x50154e;let _0x36abf8={'Content-Type':_0x38f8e2(0x15d),'Accept':_0x38f8e2(0x151)};if(this[_0x38f8e2(0x17b)])_0x36abf8['Authorization']='Bearer\x20'+this[_0x38f8e2(0x17b)];let _0x11c595=await(await fetch(this[_0x38f8e2(0x149)]+_0x38f8e2(0x17f),{'method':_0x38f8e2(0x165),'headers':_0x36abf8,'body':JSON[_0x38f8e2(0x184)]({'jsonrpc':_0x38f8e2(0x177),'id':Date[_0x38f8e2(0x15a)](),'method':'tools/call','params':{'name':_0x43ef04,'arguments':_0x4d8b3f}})}))[_0x38f8e2(0x12d)](),_0x242822=_0x11c595[_0x38f8e2(0x163)](/data: (.+)/),_0x130d9f=_0x242822?JSON['parse'](_0x242822[0x1]):JSON[_0x38f8e2(0x13b)](_0x11c595),_0x23b412=_0x130d9f?.[_0x38f8e2(0x130)]?.['content']?.[0x0]?.['text'];return _0x23b412?JSON[_0x38f8e2(0x13b)](_0x23b412):_0x130d9f;}async[a0_0x50154e(0x183)](){const _0x20670d=a0_0x50154e;if(this[_0x20670d(0x12b)])return;this['running']=!0x0,await this[_0x20670d(0x186)](_0x20670d(0x174)),this[_0x20670d(0x167)]('registered'),this['heartbeatTimer']=setInterval(()=>{const _0x11f6e3=_0x20670d;this['status']('idle')['catch'](_0x165d50=>this[_0x11f6e3(0x167)](_0x11f6e3(0x13e)+_0x165d50[_0x11f6e3(0x137)]));},this[_0x20670d(0x16e)]),this[_0x20670d(0x145)]();}async[a0_0x50154e(0x12a)](){const _0x2b992a=a0_0x50154e;if(this[_0x2b992a(0x12b)]=!0x1,this[_0x2b992a(0x16f)]?.[_0x2b992a(0x17e)](),this[_0x2b992a(0x170)])clearInterval(this['heartbeatTimer']);await this[_0x2b992a(0x186)](_0x2b992a(0x172))[_0x2b992a(0x132)](()=>{}),this['log']('disconnected');}async[a0_0x50154e(0x134)](_0x25e1e1,_0x34d390,_0xaf96a1=a0_0x50154e(0x13c)){const _0x34e27f=a0_0x50154e;return this[_0x34e27f(0x176)](_0x34e27f(0x179),{'alias':_0x25e1e1,'task':_0x34d390,'priority':_0xaf96a1,'from_session':this[_0x34e27f(0x157)]});}async['message'](_0x2ba589,_0x585e79){const _0x2d9796=a0_0x50154e;return this[_0x2d9796(0x176)](_0x2d9796(0x16a),{'alias':_0x2ba589,'message':_0x585e79,'from_session':this[_0x2d9796(0x157)]});}async[a0_0x50154e(0x178)](_0x513d7a,_0x246721,_0x5a6e1f=a0_0x50154e(0x140)){const _0x1bd095=a0_0x50154e;return this[_0x1bd095(0x176)](_0x1bd095(0x14c),{'in_reply_to':_0x513d7a,'text':_0x246721,'status':_0x5a6e1f});}async['status'](_0x543345,_0x314106){const _0x1b21eb=a0_0x50154e;return this['call'](_0x1b21eb(0x15b),{'resume_id':this[_0x1b21eb(0x142)],'alias':this['alias'],'status':_0x543345,'server':a0_0x536262(),'hostname':a0_0x536262(),'agent':this['agent'],'project_dir':process[_0x1b21eb(0x161)](),..._0x314106});}async[a0_0x50154e(0x143)](){const _0x1dddcd=a0_0x50154e;return this['call'](_0x1dddcd(0x14f),{});}async[a0_0x50154e(0x168)](_0xc4917b,_0x2ac84d){const _0x37bc00=a0_0x50154e;return this[_0x37bc00(0x176)](_0x37bc00(0x168),{'message':_0xc4917b,'filter_server':_0x2ac84d?.[_0x37bc00(0x156)],'filter_status':_0x2ac84d?.[_0x37bc00(0x186)]});}async[a0_0x50154e(0x145)](){const _0x47d042=a0_0x50154e;let _0x3ec495=encodeURIComponent(this[_0x47d042(0x157)]),_0x283d4b=this[_0x47d042(0x149)]+_0x47d042(0x13f)+_0x3ec495,_0x50461d=this[_0x47d042(0x16d)];while(this['running']){try{this['sseAbort']=new AbortController();let _0x521e86={'Accept':_0x47d042(0x16b)};if(this[_0x47d042(0x17b)])_0x521e86[_0x47d042(0x14d)]=_0x47d042(0x164)+this[_0x47d042(0x17b)];let _0x378c87=await fetch(_0x283d4b,{'headers':_0x521e86,'signal':this['sseAbort']['signal']});if(!_0x378c87['ok']||!_0x378c87[_0x47d042(0x153)]){this['log'](_0x47d042(0x160)+_0x378c87[_0x47d042(0x186)]),await this[_0x47d042(0x146)](_0x50461d),_0x50461d=Math['min'](_0x50461d*1.5,0xea60);continue;}_0x50461d=this[_0x47d042(0x16d)];let _0x118ced=_0x378c87[_0x47d042(0x153)]['getReader'](),_0x2fbbc9=new TextDecoder(),_0x42436='';while(this[_0x47d042(0x12b)]){let {done:_0x3b6601,value:_0xb54284}=await _0x118ced[_0x47d042(0x139)]();if(_0x3b6601)break;_0x42436+=_0x2fbbc9[_0x47d042(0x15f)](_0xb54284,{'stream':!0x0});let _0x3abdbf=_0x42436['split']('\x0a');_0x42436=_0x3abdbf[_0x47d042(0x159)]()||'';for(let _0x28fc3b of _0x3abdbf){if(!_0x28fc3b[_0x47d042(0x158)](_0x47d042(0x17d)))continue;try{let _0x3c9599=JSON[_0x47d042(0x13b)](_0x28fc3b[_0x47d042(0x136)](0x6));if(_0x3c9599[_0x47d042(0x131)]==='connected'){this['log']('SSE\x20connected'),this[_0x47d042(0x12f)](_0x47d042(0x144));continue;}if(_0x3c9599[_0x47d042(0x131)]==='new_task'||_0x3c9599['type']===_0x47d042(0x148)||_0x3c9599['type']===_0x47d042(0x168))await this['processInbox']();}catch{}}}}catch(_0x4763f1){if(_0x4763f1[_0x47d042(0x12c)]===_0x47d042(0x175))break;this[_0x47d042(0x12f)]('error',_0x4763f1),this['log'](_0x47d042(0x180)+_0x4763f1[_0x47d042(0x137)]);}if(this['running'])this[_0x47d042(0x12f)](_0x47d042(0x166)),this[_0x47d042(0x167)](_0x47d042(0x182)+_0x50461d/0x3e8+_0x47d042(0x171)),await this[_0x47d042(0x146)](_0x50461d),_0x50461d=Math[_0x47d042(0x13a)](_0x50461d*1.5,0xea60);}}async[a0_0x50154e(0x141)](){const _0x52d85e=a0_0x50154e;try{let _0x7deee5=(await this[_0x52d85e(0x176)]('get_inbox',{'alias':this[_0x52d85e(0x157)],'limit':0xa}))?.['messages']||[];for(let _0x11fadd of _0x7deee5)await this[_0x52d85e(0x176)](_0x52d85e(0x14b),{'alias':this[_0x52d85e(0x157)],'message_id':_0x11fadd['id']}),this[_0x52d85e(0x167)]('←\x20'+_0x11fadd[_0x52d85e(0x169)]+':\x20'+_0x11fadd[_0x52d85e(0x185)][_0x52d85e(0x136)](0x0,0x3c)),this[_0x52d85e(0x12f)](_0x52d85e(0x14e),_0x11fadd),this[_0x52d85e(0x12f)]('message',_0x11fadd);}catch(_0x5b60a0){this[_0x52d85e(0x167)](_0x52d85e(0x12e)+_0x5b60a0[_0x52d85e(0x137)]);}}[a0_0x50154e(0x146)](_0x521eb1){return new Promise(_0x3c595a=>setTimeout(_0x3c595a,_0x521eb1));}}var $=T;export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x3b1832=a0_0x5975;(function(_0x4afaa9,_0x17d161){const _0x912061=a0_0x5975,_0xc77a6a=_0x4afaa9();while(!![]){try{const _0x5a7747=-parseInt(_0x912061(0x1b0))/0x1+parseInt(_0x912061(0x216))/0x2+-parseInt(_0x912061(0x21b))/0x3*(-parseInt(_0x912061(0x1b5))/0x4)+-parseInt(_0x912061(0x1db))/0x5+-parseInt(_0x912061(0x197))/0x6*(-parseInt(_0x912061(0x215))/0x7)+parseInt(_0x912061(0x200))/0x8*(-parseInt(_0x912061(0x204))/0x9)+-parseInt(_0x912061(0x18e))/0xa*(-parseInt(_0x912061(0x1bd))/0xb);if(_0x5a7747===_0x17d161)break;else _0xc77a6a['push'](_0xc77a6a['shift']());}catch(_0x1bcf46){_0xc77a6a['push'](_0xc77a6a['shift']());}}}(a0_0x5861,0x83ade));import{readFileSync as a0_0xc3da35,existsSync as a0_0x1f98cb}from'fs';import{randomUUID as a0_0x47835b}from'crypto';import{join as a0_0x1ed1a1}from'path';import{hostname as a0_0x418ff2}from'os';import{execSync as a0_0x23db1e}from'child_process';function a0_0x5861(){const _0x174f6d=['data:\x20','\x22\x20(','777934bBLpKw','ready\x20—\x20waiting\x20for\x20events','join','token','toTimeString','8FBLgKF','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.',']\x20[commhub]\x20','registered\x20as\x20\x22','config.json','initialize','starting\x20SSE\x20listener...','Task\x20content','583piPTgd','connected','commhub_get_all_status','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','startsWith','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','SSE\x20connection\x20error:\x20','tools/call','params','.anet','get_all_status','new_task','string','init\x20failed:\x20','unknown\x20tool','\x20CWD=','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','result','CommHub\x20init\x20failed:\x20','priority','body','normal','warning:\x20could\x20not\x20register:\x20','send_message','delete','Reply\x20text\x20/\x20result\x20summary','catch','.claude/channels/commhub','replace','claude-code','4430650sHwOBC','commhub_send_task','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','hub','slice','working','MCP\x20stdio\x20connected','SIGINT','find','stderr','trim','number','replied','shutting\x20down,\x20reporting\x20offline...','cancelled','notifications/claude/channel','commhub_send_message','getReader','commhub','send_task','alias','stringify','read','object','\x20RESUME_ID=','message_id','Bearer\x20','Priority\x20(default:\x20normal)','no\x20response','statusText','type','SSE\x20stream\x20ended,\x20reconnecting...','low','\x20from\x20','pop','utf-8','/events/','64tlktBn','indexOf','messages','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','1154133iXSoRa','idle','commhub-channel','get_inbox','text','\x20PROJECT_ENV=','setRequestHandler','from_session','message','SSE\x20fatal:\x20','Authorization',':\x20inbox_count=','completed','get','status','in_progress','error','29246cEnluz','1351384IYmgfR','parse\x20error:\x20','ack_inbox','notification','decode','1510641KmfOet','Target\x20session\x20alias','→\x20injected\x20task\x20','/mcp','212180SnWQMg','application/json,\x20text/event-stream','ENV:\x20URL=','...\x20TMUX=','cwd','SSE\x20connected\x20as\x20\x22','SIGTERM','new_message','failed','606DJznJt','blocked','.env','broadcast','report_status','application/json','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','set','2.0','Current\x20task\x20description','commhub_report_status','2025-03-26','content','Progress\x200-100','POST','0.3.0','task','split','parse','send_reply','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','from','\x20ALIAS='];a0_0x5861=function(){return _0x174f6d;};return a0_0x5861();}import{Server as a0_0x1f3d38}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x3d44d8}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x25c473,CallToolRequestSchema as a0_0x5cc9b8}from'@modelcontextprotocol/sdk/types.js';function p(_0x2783ef){const _0x5b465d=a0_0x5975;if(!a0_0x1f98cb(_0x2783ef))return;for(let _0x2db1bd of a0_0xc3da35(_0x2783ef,'utf-8')[_0x5b465d(0x1a8)]('\x0a')){let _0x151259=_0x2db1bd[_0x5b465d(0x1e5)]();if(!_0x151259||_0x151259['startsWith']('#'))continue;let _0x50324f=_0x151259[_0x5b465d(0x201)]('=');if(_0x50324f<0x0)continue;let _0x31759a=_0x151259[_0x5b465d(0x1df)](0x0,_0x50324f)[_0x5b465d(0x1e5)](),_0x1ab181=_0x151259[_0x5b465d(0x1df)](_0x50324f+0x1)[_0x5b465d(0x1e5)]()[_0x5b465d(0x1d9)](/^["']|["']$/g,'');if(!process.env[_0x31759a])process.env[_0x31759a]=_0x1ab181;}}var C=process.env.HOME||'~',T=a0_0x1ed1a1(C,a0_0x3b1832(0x1d8));p(a0_0x1ed1a1(T,a0_0x3b1832(0x199)));var L=process['cwd']()[a0_0x3b1832(0x1d9)](/\//g,'-');p(a0_0x1ed1a1(T,L,a0_0x3b1832(0x199)));function U(){const _0x4fa540=a0_0x3b1832;try{return a0_0x23db1e('tmux\x20display-message\x20-p\x20\x27#S\x27',{'encoding':_0x4fa540(0x1fe),'timeout':0x7d0})['trim']();}catch{return'';}}function v(){const _0x3fef90=a0_0x3b1832;try{let _0x17b864=a0_0x1ed1a1(C,_0x3fef90(0x1c6),_0x3fef90(0x1b9));if(a0_0x1f98cb(_0x17b864))return JSON[_0x3fef90(0x1a9)](a0_0xc3da35(_0x17b864,_0x3fef90(0x1fe)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x3b1832(0x1de)]||'http://127.0.0.1:9200',j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x418ff2(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x47835b(),X=process.env.COMMHUB_TOKEN||H[a0_0x3b1832(0x1b3)]||'';function Y(_0xb48c75){const _0x4d075e=a0_0x3b1832;let _0x2e7ee8=new Date()[_0x4d075e(0x1b4)]()[_0x4d075e(0x1df)](0x0,0x8);process[_0x4d075e(0x1e4)]['write']('['+_0x2e7ee8+_0x4d075e(0x1b7)+_0xb48c75+'\x0a');}function h(_0x4d449e){return new Promise(_0x2fb00f=>setTimeout(_0x2fb00f,_0x4d449e));}Y(a0_0x3b1832(0x190)+f+a0_0x3b1832(0x1ad)+Z+a0_0x3b1832(0x1f3)+w[a0_0x3b1832(0x1df)](0x0,0x8)+a0_0x3b1832(0x191)+(j||'none')+a0_0x3b1832(0x1cc)+process[a0_0x3b1832(0x192)]()+a0_0x3b1832(0x209)+L);var k=new Map(),K=new a0_0x1f3d38({'name':a0_0x3b1832(0x206),'version':'0.3.0'},{'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>','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.',a0_0x3b1832(0x1ab),a0_0x3b1832(0x19d),'Session\x20alias:\x20'+Z][a0_0x3b1832(0x1b2)]('\x0a')});K[a0_0x3b1832(0x20a)](a0_0x25c473,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_0x3b1832(0x1c9),'description':a0_0x3b1832(0x1dd)},'text':{'type':'string','description':a0_0x3b1832(0x1d6)},'status':{'type':'string','enum':[a0_0x3b1832(0x210),a0_0x3b1832(0x196),a0_0x3b1832(0x1e9),'blocked',a0_0x3b1832(0x214),a0_0x3b1832(0x213)],'description':a0_0x3b1832(0x203)}},'required':[a0_0x3b1832(0x208)]}},{'name':a0_0x3b1832(0x1a1),'description':a0_0x3b1832(0x1b6),'inputSchema':{'type':a0_0x3b1832(0x1f2),'properties':{'status':{'type':'string','enum':[a0_0x3b1832(0x1e0),a0_0x3b1832(0x205),a0_0x3b1832(0x198),a0_0x3b1832(0x214)]},'task':{'type':a0_0x3b1832(0x1c9),'description':a0_0x3b1832(0x1a0)},'progress':{'type':a0_0x3b1832(0x1e6),'description':a0_0x3b1832(0x1a4)}},'required':[a0_0x3b1832(0x212)]}},{'name':a0_0x3b1832(0x1dc),'description':a0_0x3b1832(0x1cd),'inputSchema':{'type':'object','properties':{'alias':{'type':'string','description':a0_0x3b1832(0x21c)},'task':{'type':a0_0x3b1832(0x1c9),'description':a0_0x3b1832(0x1bc)},'priority':{'type':a0_0x3b1832(0x1c9),'enum':['high',a0_0x3b1832(0x1d2),a0_0x3b1832(0x1fb)],'description':a0_0x3b1832(0x1f6)}},'required':['alias',a0_0x3b1832(0x1a7)]}},{'name':a0_0x3b1832(0x1eb),'description':a0_0x3b1832(0x1c2),'inputSchema':{'type':a0_0x3b1832(0x1f2),'properties':{'alias':{'type':a0_0x3b1832(0x1c9),'description':a0_0x3b1832(0x21c)},'message':{'type':a0_0x3b1832(0x1c9),'description':'Message\x20content'}},'required':[a0_0x3b1832(0x1ef),a0_0x3b1832(0x20c)]}},{'name':a0_0x3b1832(0x1bf),'description':a0_0x3b1832(0x1c0),'inputSchema':{'type':a0_0x3b1832(0x1f2),'properties':{}}}]}));async function P(_0x3600cf,_0x5473c7){const _0x5e7b0d=a0_0x3b1832;let _0x8cd001=await fetch(f+_0x5e7b0d(0x18d),{'method':_0x5e7b0d(0x1a5),'headers':{'Content-Type':_0x5e7b0d(0x19c),'Accept':_0x5e7b0d(0x18f),...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON[_0x5e7b0d(0x1f0)]({'jsonrpc':_0x5e7b0d(0x19f),'id':0x1,'method':_0x5e7b0d(0x1ba),'params':{'protocolVersion':_0x5e7b0d(0x1a2),'capabilities':{},'clientInfo':{'name':'commhub-channel','version':_0x5e7b0d(0x1a6)}}})});if(!_0x8cd001['ok']){let _0x4e835f=await _0x8cd001[_0x5e7b0d(0x208)]();return Y(_0x5e7b0d(0x1cf)+_0x8cd001[_0x5e7b0d(0x212)]+'\x20'+_0x4e835f[_0x5e7b0d(0x1df)](0x0,0x64)),{'ok':!0x1,'error':_0x5e7b0d(0x1ca)+_0x8cd001['status']};}await _0x8cd001['text']();let _0xb005ba=(await(await fetch(f+_0x5e7b0d(0x18d),{'method':_0x5e7b0d(0x1a5),'headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x5e7b0d(0x1f5)+X}:{}},'body':JSON[_0x5e7b0d(0x1f0)]({'jsonrpc':_0x5e7b0d(0x19f),'id':0x2,'method':_0x5e7b0d(0x1c4),'params':{'name':_0x3600cf,'arguments':_0x5473c7}})}))['text']())['split']('\x0a')[_0x5e7b0d(0x1e3)](_0x5fc4d1=>_0x5fc4d1[_0x5e7b0d(0x1c1)]('data:\x20'));if(_0xb005ba){let _0x41df4f=JSON[_0x5e7b0d(0x1a9)](_0xb005ba[_0x5e7b0d(0x1df)](0x6));return _0x41df4f?.['result']?.[_0x5e7b0d(0x1a3)]?.[0x0]?.['text']?JSON[_0x5e7b0d(0x1a9)](_0x41df4f[_0x5e7b0d(0x1ce)][_0x5e7b0d(0x1a3)][0x0]['text']):_0x41df4f;}return{'ok':!0x1,'error':_0x5e7b0d(0x1f7)};}K['setRequestHandler'](a0_0x5cc9b8,async _0x5ba395=>{const _0xa4534d=a0_0x3b1832;let {name:_0x3d5137,arguments:_0x128bc5}=_0x5ba395[_0xa4534d(0x1c5)];if(_0x3d5137==='commhub_reply'){let {task_id:_0x417b62,text:_0x2ee6f0,status:_0x3d5457}=_0x128bc5;if(_0x3d5457===_0xa4534d(0x210)||_0x3d5457===_0xa4534d(0x196)||_0x3d5457===_0xa4534d(0x1e9)){let _0x187737=_0x3d5457===_0xa4534d(0x210)?_0xa4534d(0x1e7):_0x3d5457,_0x425037=_0x417b62?k[_0xa4534d(0x211)](_0x417b62)||_0xa4534d(0x1de):_0xa4534d(0x1de),_0x16cd9a=await P(_0xa4534d(0x1aa),{'alias':_0x425037,'text':_0x2ee6f0,'in_reply_to':_0x417b62||void 0x0,'status':_0x187737,'from_session':Z});if(_0x417b62)k[_0xa4534d(0x1d5)](_0x417b62);return{'content':[{'type':_0xa4534d(0x208),'text':JSON[_0xa4534d(0x1f0)](_0x16cd9a)}]};}let _0x58b411=await P(_0xa4534d(0x19b),{'resume_id':w,'alias':Z,'status':_0x3d5457==='blocked'?_0xa4534d(0x198):_0x3d5457===_0xa4534d(0x214)?_0xa4534d(0x214):'working','task':_0x2ee6f0[_0xa4534d(0x1df)](0x0,0xc8),'output':_0x2ee6f0});return{'content':[{'type':_0xa4534d(0x208),'text':JSON[_0xa4534d(0x1f0)](_0x58b411)}]};}if(_0x3d5137===_0xa4534d(0x1a1)){let {status:_0x4ab2f5,task:_0x4d0819,progress:_0xea98a8}=_0x128bc5,_0x28783a=await P(_0xa4534d(0x19b),{'resume_id':w,'alias':Z,'status':_0x4ab2f5,'task':_0x4d0819,'progress':_0xea98a8});return{'content':[{'type':'text','text':JSON['stringify'](_0x28783a)}]};}if(_0x3d5137===_0xa4534d(0x1dc)){let {alias:_0x4d8934,task:_0x674fb3,priority:_0x5c9845}=_0x128bc5,_0x219ab2=await P(_0xa4534d(0x1ee),{'alias':_0x4d8934,'task':_0x674fb3,'priority':_0x5c9845||_0xa4534d(0x1d2),'from_session':Z});return{'content':[{'type':_0xa4534d(0x208),'text':JSON[_0xa4534d(0x1f0)](_0x219ab2)}]};}if(_0x3d5137==='commhub_send_message'){let {alias:_0x447f04,message:_0x27d62a}=_0x128bc5,_0x5d564d=await P(_0xa4534d(0x1d4),{'alias':_0x447f04,'message':_0x27d62a,'from_session':Z});return{'content':[{'type':'text','text':JSON[_0xa4534d(0x1f0)](_0x5d564d)}]};}if(_0x3d5137==='commhub_get_all_status'){let _0x11a680=await P(_0xa4534d(0x1c7),{});return{'content':[{'type':_0xa4534d(0x208),'text':JSON[_0xa4534d(0x1f0)](_0x11a680)}]};}return{'content':[{'type':_0xa4534d(0x208),'text':JSON[_0xa4534d(0x1f0)]({'error':_0xa4534d(0x1cb)})}]};});async function u(){const _0x2f2a7d=a0_0x3b1832;let _0x41c2b7=f+_0x2f2a7d(0x1ff)+encodeURIComponent(Z),_0x5015dd={};if(X)_0x5015dd[_0x2f2a7d(0x20e)]='Bearer\x20'+X;Y('connecting\x20to\x20'+_0x41c2b7);while(!0x0){try{let _0x19de01=await fetch(_0x41c2b7,{'headers':_0x5015dd});if(!_0x19de01['ok']){Y('SSE\x20error:\x20'+_0x19de01[_0x2f2a7d(0x212)]+'\x20'+_0x19de01[_0x2f2a7d(0x1f8)]),await h(0x1388);continue;}let _0x2d30de=_0x19de01[_0x2f2a7d(0x1d1)][_0x2f2a7d(0x1ec)](),_0xd1a900=new TextDecoder(),_0x24c099='';while(!0x0){let {done:_0x47a1e6,value:_0x247222}=await _0x2d30de[_0x2f2a7d(0x1f1)]();if(_0x47a1e6)break;_0x24c099+=_0xd1a900[_0x2f2a7d(0x21a)](_0x247222,{'stream':!0x0});let _0x2ddceb=_0x24c099[_0x2f2a7d(0x1a8)]('\x0a\x0a');_0x24c099=_0x2ddceb[_0x2f2a7d(0x1fd)]()||'';for(let _0x2f9413 of _0x2ddceb){let _0x6a7e80=_0x2f9413['split']('\x0a')[_0x2f2a7d(0x1e3)](_0x4a0c87=>_0x4a0c87[_0x2f2a7d(0x1c1)](_0x2f2a7d(0x1ae)));if(!_0x6a7e80)continue;try{let _0xd14098=JSON[_0x2f2a7d(0x1a9)](_0x6a7e80[_0x2f2a7d(0x1df)](0x6));await S(_0xd14098);}catch(_0x5c32c3){Y(_0x2f2a7d(0x217)+_0x5c32c3);}}}Y(_0x2f2a7d(0x1fa));}catch(_0x4cf035){Y(_0x2f2a7d(0x1c3)+_0x4cf035);}await h(0xbb8);}}async function S(_0x237d0c){const _0x85be88=a0_0x3b1832;if(_0x237d0c['type']===_0x85be88(0x1be)){Y(_0x85be88(0x193)+Z+'\x22');return;}if(_0x237d0c['type']===_0x85be88(0x195)){if(Y('←\x20message\x20from\x20'+_0x237d0c[_0x85be88(0x1ac)]+':\x20'+_0x237d0c['message'][_0x85be88(0x1df)](0x0,0x3c)),await K[_0x85be88(0x219)]({'method':_0x85be88(0x1ea),'params':{'content':_0x237d0c[_0x85be88(0x20c)],'meta':{'sender':_0x237d0c[_0x85be88(0x1ac)]||_0x85be88(0x1de),'sender_id':_0x85be88(0x1ed),'user':_0x237d0c[_0x85be88(0x1ac)]||_0x85be88(0x1de),'priority':_0x85be88(0x1d2)}}}),_0x237d0c[_0x85be88(0x1f4)])await P(_0x85be88(0x218),{'alias':Z,'message_id':_0x237d0c[_0x85be88(0x1f4)]});return;}if(_0x237d0c[_0x85be88(0x1f9)]===_0x85be88(0x1c8)||_0x237d0c[_0x85be88(0x1f9)]===_0x85be88(0x19a)){Y('←\x20'+_0x237d0c[_0x85be88(0x1f9)]+_0x85be88(0x20f)+_0x237d0c['inbox_count']+'\x20priority='+(_0x237d0c[_0x85be88(0x1d0)]||_0x85be88(0x1d2)));let _0x45480e=await P(_0x85be88(0x207),{'alias':Z,'limit':0x5});if(_0x45480e?.['ok']&&_0x45480e[_0x85be88(0x202)]?.['length']>0x0)for(let _0x4711d7 of _0x45480e[_0x85be88(0x202)]){let _0x198309={'sender':_0x4711d7[_0x85be88(0x20b)]||_0x85be88(0x1de),'sender_id':_0x85be88(0x1ed),'user':_0x4711d7['from_session']||_0x85be88(0x1de),'task_id':_0x4711d7['id'],'priority':_0x4711d7['priority']||_0x85be88(0x1d2)};k[_0x85be88(0x19e)](_0x4711d7['id'],_0x4711d7[_0x85be88(0x20b)]||'hub'),await K[_0x85be88(0x219)]({'method':_0x85be88(0x1ea),'params':{'content':_0x4711d7['content'],'meta':_0x198309}}),Y(_0x85be88(0x21d)+_0x4711d7['id'][_0x85be88(0x1df)](0x0,0x8)+_0x85be88(0x1fc)+_0x4711d7['from_session']+':\x20'+_0x4711d7[_0x85be88(0x1a3)][_0x85be88(0x1df)](0x0,0x3c)),await P(_0x85be88(0x218),{'alias':Z,'message_id':_0x4711d7['id']});}}}async function A(){const _0x9ed7b9=a0_0x3b1832;let _0x5b66f7=new a0_0x3d44d8();await K['connect'](_0x5b66f7),Y(_0x9ed7b9(0x1e1)),Y(_0x9ed7b9(0x1bb)),u()[_0x9ed7b9(0x1d7)](_0x1067c9=>Y(_0x9ed7b9(0x20d)+_0x1067c9)),P(_0x9ed7b9(0x19b),{'resume_id':w,'alias':Z,'status':_0x9ed7b9(0x205),'server':a0_0x418ff2(),'hostname':a0_0x418ff2(),'agent':_0x9ed7b9(0x1da),'project_dir':process[_0x9ed7b9(0x192)](),'tmux_name':j||void 0x0})['then'](()=>Y(_0x9ed7b9(0x1b8)+Z+_0x9ed7b9(0x1af)+w[_0x9ed7b9(0x1df)](0x0,0x8)+')'))['catch'](_0x58b332=>Y(_0x9ed7b9(0x1d3)+_0x58b332)),setInterval(()=>{const _0x2f2a38=_0x9ed7b9;P(_0x2f2a38(0x19b),{'resume_id':w,'alias':Z,'status':_0x2f2a38(0x205),'server':a0_0x418ff2(),'hostname':a0_0x418ff2(),'agent':_0x2f2a38(0x1da),'project_dir':process[_0x2f2a38(0x192)](),'tmux_name':j||void 0x0})[_0x2f2a38(0x1d7)](_0x520c17=>Y('heartbeat\x20failed:\x20'+_0x520c17));},0x2bf20),Y(_0x9ed7b9(0x1b1));}function a0_0x5975(_0x13f503,_0x4a3557){_0x13f503=_0x13f503-0x18d;const _0x5861b1=a0_0x5861();let _0x597591=_0x5861b1[_0x13f503];return _0x597591;}A()['catch'](_0x4c95da=>{Y('fatal:\x20'+_0x4c95da),process['exit'](0x1);});async function N(){const _0x3db3bd=a0_0x3b1832;Y(_0x3db3bd(0x1e8)),await P(_0x3db3bd(0x19b),{'resume_id':w,'alias':Z,'status':_0x3db3bd(0x214),'task':'session\x20disconnected'})[_0x3db3bd(0x1d7)](()=>{}),process['exit'](0x0);}process['stdin']['on']('end',()=>N()),process['on'](a0_0x3b1832(0x194),()=>N()),process['on'](a0_0x3b1832(0x1e2),()=>N());
2
+ const a0_0x24f757=a0_0x3e52;(function(_0x1ba6c1,_0x5020d3){const _0x2e26fb=a0_0x3e52,_0x3ffe80=_0x1ba6c1();while(!![]){try{const _0x2c82df=parseInt(_0x2e26fb(0xe9))/0x1+-parseInt(_0x2e26fb(0x99))/0x2*(parseInt(_0x2e26fb(0xec))/0x3)+-parseInt(_0x2e26fb(0x79))/0x4*(parseInt(_0x2e26fb(0x95))/0x5)+-parseInt(_0x2e26fb(0x8c))/0x6*(parseInt(_0x2e26fb(0xae))/0x7)+-parseInt(_0x2e26fb(0xa8))/0x8*(-parseInt(_0x2e26fb(0x6b))/0x9)+parseInt(_0x2e26fb(0xbf))/0xa*(parseInt(_0x2e26fb(0xe0))/0xb)+parseInt(_0x2e26fb(0xa0))/0xc;if(_0x2c82df===_0x5020d3)break;else _0x3ffe80['push'](_0x3ffe80['shift']());}catch(_0x2724bc){_0x3ffe80['push'](_0x3ffe80['shift']());}}}(a0_0x2672,0xb80b5));import{readFileSync as a0_0x19e8ad,existsSync as a0_0x225430}from'fs';import{randomUUID as a0_0x122a4e}from'crypto';function a0_0x3e52(_0x548d8b,_0xa73415){_0x548d8b=_0x548d8b-0x65;const _0x2672a1=a0_0x2672();let _0x3e5262=_0x2672a1[_0x548d8b];return _0x3e5262;}import{join as a0_0x35491a}from'path';import{hostname as a0_0x5b5d63}from'os';import{execSync as a0_0x28c1e7}from'child_process';import{Server as a0_0x129ed1}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x1edf4f}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x33cdcc,CallToolRequestSchema as a0_0x3b8955}from'@modelcontextprotocol/sdk/types.js';function p(_0x49da10){const _0x298521=a0_0x3e52;if(!a0_0x225430(_0x49da10))return;for(let _0x3ec536 of a0_0x19e8ad(_0x49da10,_0x298521(0x8b))[_0x298521(0xda)]('\x0a')){let _0x12c2a8=_0x3ec536[_0x298521(0xa6)]();if(!_0x12c2a8||_0x12c2a8[_0x298521(0x74)]('#'))continue;let _0x462504=_0x12c2a8[_0x298521(0x8f)]('=');if(_0x462504<0x0)continue;let _0x5cbf16=_0x12c2a8[_0x298521(0x7b)](0x0,_0x462504)[_0x298521(0xa6)](),_0x20b3e0=_0x12c2a8[_0x298521(0x7b)](_0x462504+0x1)['trim']()[_0x298521(0xe4)](/^["']|["']$/g,'');if(!process.env[_0x5cbf16])process.env[_0x5cbf16]=_0x20b3e0;}}var C=process.env.HOME||'~',T=a0_0x35491a(C,a0_0x24f757(0xe6));p(a0_0x35491a(T,'.env'));var L=process['cwd']()['replace'](/\//g,'-');p(a0_0x35491a(T,L,a0_0x24f757(0xdc)));function U(){const _0x5ab222=a0_0x24f757;try{return a0_0x28c1e7(_0x5ab222(0xa2),{'encoding':_0x5ab222(0x8b),'timeout':0x7d0})[_0x5ab222(0xa6)]();}catch{return'';}}function v(){const _0x3c70f1=a0_0x24f757;try{let _0x5c3f2c=a0_0x35491a(C,_0x3c70f1(0xc8),'config.json');if(a0_0x225430(_0x5c3f2c))return JSON[_0x3c70f1(0xd6)](a0_0x19e8ad(_0x5c3f2c,_0x3c70f1(0x8b)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x24f757(0x84)]||a0_0x24f757(0xbd),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x5b5d63(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x122a4e(),X=process.env.COMMHUB_TOKEN||H[a0_0x24f757(0x77)]||'';function Y(_0x3d1105){const _0x3820ba=a0_0x24f757;let _0x2faaa3=new Date()[_0x3820ba(0xd1)]()[_0x3820ba(0x7b)](0x0,0x8);process[_0x3820ba(0xe1)][_0x3820ba(0x7a)]('['+_0x2faaa3+_0x3820ba(0xd4)+_0x3d1105+'\x0a');}function h(_0x3e0153){return new Promise(_0x377a25=>setTimeout(_0x377a25,_0x3e0153));}Y(a0_0x24f757(0xdb)+f+a0_0x24f757(0x86)+Z+a0_0x24f757(0x71)+w[a0_0x24f757(0x7b)](0x0,0x8)+a0_0x24f757(0x66)+(j||'none')+'\x20CWD='+process['cwd']()+'\x20PROJECT_ENV='+L);var k=new Map(),K=new a0_0x129ed1({'name':a0_0x24f757(0x67),'version':a0_0x24f757(0x8a)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x24f757(0xb7),'These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.',a0_0x24f757(0x65),a0_0x24f757(0xba),a0_0x24f757(0xb1)+Z][a0_0x24f757(0x75)]('\x0a')});K[a0_0x24f757(0x9c)](a0_0x33cdcc,async()=>({'tools':[{'name':a0_0x24f757(0xb8),'description':'Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','inputSchema':{'type':a0_0x24f757(0x6f),'properties':{'task_id':{'type':a0_0x24f757(0xb2),'description':a0_0x24f757(0x8e)},'text':{'type':'string','description':a0_0x24f757(0xa5)},'status':{'type':a0_0x24f757(0xb2),'enum':['completed',a0_0x24f757(0x89),'cancelled',a0_0x24f757(0xe2),a0_0x24f757(0xc2),a0_0x24f757(0xd0)],'description':a0_0x24f757(0x90)}},'required':['text']}},{'name':'commhub_report_status','description':a0_0x24f757(0x9f),'inputSchema':{'type':'object','properties':{'status':{'type':a0_0x24f757(0xb2),'enum':[a0_0x24f757(0xa7),a0_0x24f757(0xab),'blocked',a0_0x24f757(0xc2)]},'task':{'type':a0_0x24f757(0xb2),'description':'Current\x20task\x20description'},'progress':{'type':a0_0x24f757(0xb3),'description':a0_0x24f757(0x6d)}},'required':[a0_0x24f757(0x70)]}},{'name':a0_0x24f757(0xf0),'description':a0_0x24f757(0x6a),'inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x24f757(0xb2),'description':a0_0x24f757(0xa9)},'task':{'type':a0_0x24f757(0xb2),'description':a0_0x24f757(0xbb)},'priority':{'type':a0_0x24f757(0xb2),'enum':[a0_0x24f757(0xeb),a0_0x24f757(0x6e),'low'],'description':a0_0x24f757(0x76)}},'required':[a0_0x24f757(0xad),a0_0x24f757(0x91)]}},{'name':a0_0x24f757(0xe8),'description':a0_0x24f757(0xed),'inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x24f757(0xb2),'description':a0_0x24f757(0xa9)},'message':{'type':a0_0x24f757(0xb2),'description':a0_0x24f757(0xaa)}},'required':[a0_0x24f757(0xad),a0_0x24f757(0x9b)]}},{'name':'commhub_get_all_status','description':'Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','inputSchema':{'type':a0_0x24f757(0x6f),'properties':{}}}]}));function a0_0x2672(){const _0x3e5d06=['Session\x20alias:\x20','string','number','params','session\x20disconnected','connected','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','commhub_reply','read','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','Task\x20content','\x22\x20(','http://127.0.0.1:9200','notification','2260kJfhSs','stringify','end','error','completed','messages','Bearer\x20','ack_inbox','application/json,\x20text/event-stream','.anet','find','SIGTERM','commhub_get_all_status','statusText','/events/','2.0','catch','in_progress','toTimeString','get_all_status','content',']\x20[commhub]\x20','inbox_count','parse','send_task','→\x20injected\x20task\x20','new_message','split','ENV:\x20URL=','.env','SIGINT','cancelled','send_reply','13673lZuMfA','stderr','blocked','commhub','replace','cwd','.claude/channels/commhub','fatal:\x20','commhub_send_message','1170367MHJgvg','SSE\x20connected\x20as\x20\x22','high','90gpdkeg','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','application/json','SSE\x20connection\x20error:\x20','commhub_send_task','heartbeat\x20failed:\x20','get','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','...\x20TMUX=','commhub-channel','notifications/claude/channel','\x20from\x20','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','11295QumebL','init\x20failed:\x20','Progress\x200-100','normal','object','status','\x20RESUME_ID=','from_session','Authorization','startsWith','join','Priority\x20(default:\x20normal)','token','set','196dQVhbC','write','slice','\x20priority=','send_message','←\x20message\x20from\x20','no\x20response','tools/call','data:\x20','text','2025-03-26','hub','result','\x20ALIAS=','starting\x20SSE\x20listener...','type','failed','0.3.0','utf-8','6678qDWigd','report_status','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','indexOf','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','task','/mcp','claude-code','unknown\x20tool','137615QFuNFA','connecting\x20to\x20','initialize','POST','18310cSqtLJ','message_id','message','setRequestHandler','getReader','from','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','22720236sGOmdo','body','tmux\x20display-message\x20-p\x20\x27#S\x27','SSE\x20error:\x20','warning:\x20could\x20not\x20register:\x20','Reply\x20text\x20/\x20result\x20summary','trim','working','1048qdISCZ','Target\x20session\x20alias','Message\x20content','idle',':\x20inbox_count=','alias','7119PmUXDJ','exit','pop'];a0_0x2672=function(){return _0x3e5d06;};return a0_0x2672();}async function P(_0x4810bd,_0x42f6c1){const _0x2fdb39=a0_0x24f757;let _0x369cc7=await fetch(f+'/mcp',{'method':_0x2fdb39(0x98),'headers':{'Content-Type':_0x2fdb39(0xee),'Accept':_0x2fdb39(0xc7),...X?{'Authorization':_0x2fdb39(0xc5)+X}:{}},'body':JSON[_0x2fdb39(0xc0)]({'jsonrpc':_0x2fdb39(0xce),'id':0x1,'method':_0x2fdb39(0x97),'params':{'protocolVersion':_0x2fdb39(0x83),'capabilities':{},'clientInfo':{'name':_0x2fdb39(0x67),'version':'0.3.0'}}})});if(!_0x369cc7['ok']){let _0x33dcb6=await _0x369cc7[_0x2fdb39(0x82)]();return Y('CommHub\x20init\x20failed:\x20'+_0x369cc7[_0x2fdb39(0x70)]+'\x20'+_0x33dcb6[_0x2fdb39(0x7b)](0x0,0x64)),{'ok':!0x1,'error':_0x2fdb39(0x6c)+_0x369cc7['status']};}await _0x369cc7['text']();let _0x1f92e7=(await(await fetch(f+_0x2fdb39(0x92),{'method':'POST','headers':{'Content-Type':_0x2fdb39(0xee),'Accept':_0x2fdb39(0xc7),...X?{'Authorization':_0x2fdb39(0xc5)+X}:{}},'body':JSON[_0x2fdb39(0xc0)]({'jsonrpc':_0x2fdb39(0xce),'id':0x2,'method':_0x2fdb39(0x80),'params':{'name':_0x4810bd,'arguments':_0x42f6c1}})}))[_0x2fdb39(0x82)]())[_0x2fdb39(0xda)]('\x0a')[_0x2fdb39(0xc9)](_0x1ecd89=>_0x1ecd89[_0x2fdb39(0x74)]('data:\x20'));if(_0x1f92e7){let _0x5b3758=JSON[_0x2fdb39(0xd6)](_0x1f92e7[_0x2fdb39(0x7b)](0x6));return _0x5b3758?.['result']?.['content']?.[0x0]?.['text']?JSON[_0x2fdb39(0xd6)](_0x5b3758[_0x2fdb39(0x85)][_0x2fdb39(0xd3)][0x0][_0x2fdb39(0x82)]):_0x5b3758;}return{'ok':!0x1,'error':_0x2fdb39(0x7f)};}K[a0_0x24f757(0x9c)](a0_0x3b8955,async _0x135489=>{const _0x59773d=a0_0x24f757;let {name:_0x13c76b,arguments:_0x42fcee}=_0x135489[_0x59773d(0xb4)];if(_0x13c76b===_0x59773d(0xb8)){let {task_id:_0x473ac8,text:_0xb40690,status:_0xb6f0d7}=_0x42fcee;if(_0xb6f0d7===_0x59773d(0xc3)||_0xb6f0d7===_0x59773d(0x89)||_0xb6f0d7===_0x59773d(0xde)){let _0x480634=_0xb6f0d7===_0x59773d(0xc3)?'replied':_0xb6f0d7,_0xcd85b2=_0x473ac8?k[_0x59773d(0xf2)](_0x473ac8)||_0x59773d(0x84):_0x59773d(0x84),_0x16ba6b=await P(_0x59773d(0xdf),{'alias':_0xcd85b2,'text':_0xb40690,'in_reply_to':_0x473ac8||void 0x0,'status':_0x480634,'from_session':Z});if(_0x473ac8)k['delete'](_0x473ac8);return{'content':[{'type':_0x59773d(0x82),'text':JSON[_0x59773d(0xc0)](_0x16ba6b)}]};}let _0x17a7cd=await P(_0x59773d(0x8d),{'resume_id':w,'alias':Z,'status':_0xb6f0d7===_0x59773d(0xe2)?_0x59773d(0xe2):_0xb6f0d7===_0x59773d(0xc2)?_0x59773d(0xc2):_0x59773d(0xa7),'task':_0xb40690[_0x59773d(0x7b)](0x0,0xc8),'output':_0xb40690});return{'content':[{'type':_0x59773d(0x82),'text':JSON[_0x59773d(0xc0)](_0x17a7cd)}]};}if(_0x13c76b==='commhub_report_status'){let {status:_0x21ebd6,task:_0x191947,progress:_0x328b09}=_0x42fcee,_0x15cfde=await P(_0x59773d(0x8d),{'resume_id':w,'alias':Z,'status':_0x21ebd6,'task':_0x191947,'progress':_0x328b09});return{'content':[{'type':_0x59773d(0x82),'text':JSON[_0x59773d(0xc0)](_0x15cfde)}]};}if(_0x13c76b===_0x59773d(0xf0)){let {alias:_0x23b8eb,task:_0x51eeb6,priority:_0xafaa7a}=_0x42fcee,_0x335f31=await P(_0x59773d(0xd7),{'alias':_0x23b8eb,'task':_0x51eeb6,'priority':_0xafaa7a||_0x59773d(0x6e),'from_session':Z});return{'content':[{'type':_0x59773d(0x82),'text':JSON[_0x59773d(0xc0)](_0x335f31)}]};}if(_0x13c76b===_0x59773d(0xe8)){let {alias:_0x49024c,message:_0xdcaf51}=_0x42fcee,_0x2e15a7=await P(_0x59773d(0x7d),{'alias':_0x49024c,'message':_0xdcaf51,'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x59773d(0xc0)](_0x2e15a7)}]};}if(_0x13c76b===_0x59773d(0xcb)){let _0x63c82=await P(_0x59773d(0xd2),{});return{'content':[{'type':_0x59773d(0x82),'text':JSON[_0x59773d(0xc0)](_0x63c82)}]};}return{'content':[{'type':'text','text':JSON['stringify']({'error':_0x59773d(0x94)})}]};});async function u(){const _0x427bbe=a0_0x24f757;let _0x1bd57d=f+_0x427bbe(0xcd)+encodeURIComponent(Z),_0x19ad22={};if(X)_0x19ad22[_0x427bbe(0x73)]='Bearer\x20'+X;Y(_0x427bbe(0x96)+_0x1bd57d);while(!0x0){try{let _0x5b2d82=await fetch(_0x1bd57d,{'headers':_0x19ad22});if(!_0x5b2d82['ok']){Y(_0x427bbe(0xa3)+_0x5b2d82[_0x427bbe(0x70)]+'\x20'+_0x5b2d82[_0x427bbe(0xcc)]),await h(0x1388);continue;}let _0x4e8c3b=_0x5b2d82[_0x427bbe(0xa1)][_0x427bbe(0x9d)](),_0x43a855=new TextDecoder(),_0x5de36b='';while(!0x0){let {done:_0x44405b,value:_0x135f2c}=await _0x4e8c3b[_0x427bbe(0xb9)]();if(_0x44405b)break;_0x5de36b+=_0x43a855['decode'](_0x135f2c,{'stream':!0x0});let _0x3c3349=_0x5de36b[_0x427bbe(0xda)]('\x0a\x0a');_0x5de36b=_0x3c3349[_0x427bbe(0xb0)]()||'';for(let _0x50acca of _0x3c3349){let _0x1bc57b=_0x50acca[_0x427bbe(0xda)]('\x0a')[_0x427bbe(0xc9)](_0x24f5b3=>_0x24f5b3['startsWith'](_0x427bbe(0x81)));if(!_0x1bc57b)continue;try{let _0x5ce4e7=JSON['parse'](_0x1bc57b[_0x427bbe(0x7b)](0x6));await S(_0x5ce4e7);}catch(_0x4c87a9){Y('parse\x20error:\x20'+_0x4c87a9);}}}Y('SSE\x20stream\x20ended,\x20reconnecting...');}catch(_0x5385df){Y(_0x427bbe(0xef)+_0x5385df);}await h(0xbb8);}}async function S(_0x355e1c){const _0x21c2eb=a0_0x24f757;if(_0x355e1c[_0x21c2eb(0x88)]===_0x21c2eb(0xb6)){Y(_0x21c2eb(0xea)+Z+'\x22');return;}if(_0x355e1c[_0x21c2eb(0x88)]===_0x21c2eb(0xd9)){if(Y(_0x21c2eb(0x7e)+_0x355e1c[_0x21c2eb(0x9e)]+':\x20'+_0x355e1c['message']['slice'](0x0,0x3c)),await K[_0x21c2eb(0xbe)]({'method':_0x21c2eb(0x68),'params':{'content':_0x355e1c['message'],'meta':{'sender':_0x355e1c['from']||_0x21c2eb(0x84),'sender_id':'commhub','user':_0x355e1c[_0x21c2eb(0x9e)]||_0x21c2eb(0x84),'priority':_0x21c2eb(0x6e)}}}),_0x355e1c[_0x21c2eb(0x9a)])await P('ack_inbox',{'alias':Z,'message_id':_0x355e1c[_0x21c2eb(0x9a)]});return;}if(_0x355e1c[_0x21c2eb(0x88)]==='new_task'||_0x355e1c['type']==='broadcast'){Y('←\x20'+_0x355e1c[_0x21c2eb(0x88)]+_0x21c2eb(0xac)+_0x355e1c[_0x21c2eb(0xd5)]+_0x21c2eb(0x7c)+(_0x355e1c['priority']||'normal'));let _0x1be4e2=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0x1be4e2?.['ok']&&_0x1be4e2[_0x21c2eb(0xc4)]?.['length']>0x0)for(let _0x457b99 of _0x1be4e2['messages']){let _0x8a364b={'sender':_0x457b99[_0x21c2eb(0x72)]||'hub','sender_id':_0x21c2eb(0xe3),'user':_0x457b99[_0x21c2eb(0x72)]||_0x21c2eb(0x84),'task_id':_0x457b99['id'],'priority':_0x457b99['priority']||_0x21c2eb(0x6e)};k[_0x21c2eb(0x78)](_0x457b99['id'],_0x457b99[_0x21c2eb(0x72)]||'hub'),await K['notification']({'method':'notifications/claude/channel','params':{'content':_0x457b99['content'],'meta':_0x8a364b}}),Y(_0x21c2eb(0xd8)+_0x457b99['id']['slice'](0x0,0x8)+_0x21c2eb(0x69)+_0x457b99[_0x21c2eb(0x72)]+':\x20'+_0x457b99[_0x21c2eb(0xd3)]['slice'](0x0,0x3c)),await P(_0x21c2eb(0xc6),{'alias':Z,'message_id':_0x457b99['id']});}}}async function A(){const _0x10a5df=a0_0x24f757;let _0x2e096d=new a0_0x1edf4f();await K['connect'](_0x2e096d),Y('MCP\x20stdio\x20connected'),Y(_0x10a5df(0x87)),u()[_0x10a5df(0xcf)](_0x3ad74e=>Y('SSE\x20fatal:\x20'+_0x3ad74e)),P(_0x10a5df(0x8d),{'resume_id':w,'alias':Z,'status':_0x10a5df(0xab),'server':a0_0x5b5d63(),'hostname':a0_0x5b5d63(),'agent':_0x10a5df(0x93),'project_dir':process[_0x10a5df(0xe5)](),'tmux_name':j||void 0x0})['then'](()=>Y('registered\x20as\x20\x22'+Z+_0x10a5df(0xbc)+w[_0x10a5df(0x7b)](0x0,0x8)+')'))[_0x10a5df(0xcf)](_0x5c5257=>Y(_0x10a5df(0xa4)+_0x5c5257)),setInterval(()=>{const _0x45c9d3=_0x10a5df;P(_0x45c9d3(0x8d),{'resume_id':w,'alias':Z,'status':_0x45c9d3(0xab),'server':a0_0x5b5d63(),'hostname':a0_0x5b5d63(),'agent':_0x45c9d3(0x93),'project_dir':process[_0x45c9d3(0xe5)](),'tmux_name':j||void 0x0})[_0x45c9d3(0xcf)](_0x3a20c2=>Y(_0x45c9d3(0xf1)+_0x3a20c2));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}A()[a0_0x24f757(0xcf)](_0x59c275=>{const _0x3086f9=a0_0x24f757;Y(_0x3086f9(0xe7)+_0x59c275),process[_0x3086f9(0xaf)](0x1);});async function N(){const _0xaa1173=a0_0x24f757;Y('shutting\x20down,\x20reporting\x20offline...'),await P(_0xaa1173(0x8d),{'resume_id':w,'alias':Z,'status':_0xaa1173(0xc2),'task':_0xaa1173(0xb5)})[_0xaa1173(0xcf)](()=>{}),process[_0xaa1173(0xaf)](0x0);}process['stdin']['on'](a0_0x24f757(0xc1),()=>N()),process['on'](a0_0x24f757(0xca),()=>N()),process['on'](a0_0x24f757(0xdd),()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "description": "AI Agent Network CLI — Create multi-agent networks with user management, network isolation, and 3 AI runtimes (Claude/Codex/MiniMax). 39 commands.",
5
5
  "type": "module",
6
6
  "main": "dist/src/client.js",