@sleep2agi/agent-network 2.2.1 → 2.2.2

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_0x4f7e39=a0_0x2f0b;(function(_0x4bdea3,_0x43250a){const _0x20a73b=a0_0x2f0b,_0x54a75c=_0x4bdea3();while(!![]){try{const _0x5d9a9a=-parseInt(_0x20a73b(0xf2))/0x1*(parseInt(_0x20a73b(0x113))/0x2)+parseInt(_0x20a73b(0x114))/0x3*(-parseInt(_0x20a73b(0x103))/0x4)+parseInt(_0x20a73b(0xe6))/0x5+-parseInt(_0x20a73b(0x11a))/0x6+parseInt(_0x20a73b(0x11e))/0x7+-parseInt(_0x20a73b(0xf8))/0x8+parseInt(_0x20a73b(0x119))/0x9*(parseInt(_0x20a73b(0x11b))/0xa);if(_0x5d9a9a===_0x43250a)break;else _0x54a75c['push'](_0x54a75c['shift']());}catch(_0x2083d6){_0x54a75c['push'](_0x54a75c['shift']());}}}(a0_0x15cd,0x9f07c));function a0_0x15cd(){const _0x3abead=['send_reply','replace','token','send','6786NWWAaS','1467510AWPwiU','34340HObjRb','resumeId','completed','3966830vwSCrR','result','content','sdk-','signal','log','broadcast','call','report_status','data:\x20','text','read','text/event-stream','agent','connect','SSE\x20error:\x20','heartbeatTimer','heartbeatInterval','min','task','alias','send_message','getAllStatus','autoConnect','messages','toString','processInbox','split','Authorization','name','catch','2.0','404595bQdPSO','disconnected','get_inbox','inbox\x20error:\x20','s...','status','get_all_status','Bearer\x20','url','registered','stringify','from_session','4475CDhkFn','type','new_message','pop','message','SSE\x20connected','3691664ESggTv','emit','ack_inbox','new_task','sseAbort','SSE\x20reconnecting\x20in\x20','offline','application/json,\x20text/event-stream','server','application/json','sleep','4upiYBO','parse','getReader','body','running','abort','disconnect','idle','/events/','now','slice','reconnectDelay','reply','error','toTimeString','connected','422rOcfNO','2805567CvUjhO'];a0_0x15cd=function(){return _0x3abead;};return a0_0x15cd();}import{EventEmitter as a0_0x33bc0c}from'events';import{hostname as a0_0x43c30d}from'os';function a0_0x2f0b(_0x5731b2,_0x4ed3d2){_0x5731b2=_0x5731b2-0xce;const _0x15cd11=a0_0x15cd();let _0x2f0b7e=_0x15cd11[_0x5731b2];return _0x2f0b7e;}class T extends a0_0x33bc0c{['url'];[a0_0x4f7e39(0xda)];['token'];[a0_0x4f7e39(0xd3)];[a0_0x4f7e39(0x11c)];[a0_0x4f7e39(0xd7)];[a0_0x4f7e39(0x10e)];[a0_0x4f7e39(0xd6)];['sseAbort'];[a0_0x4f7e39(0x107)]=!0x1;constructor(_0x598088){const _0x3dd261=a0_0x4f7e39;super();if(this[_0x3dd261(0xee)]=_0x598088['url'][_0x3dd261(0x116)](/\/$/,''),this['alias']=_0x598088[_0x3dd261(0xda)],this[_0x3dd261(0x117)]=_0x598088['token'],this[_0x3dd261(0xd3)]=_0x598088[_0x3dd261(0xd3)]||'sdk',this[_0x3dd261(0x11c)]=_0x3dd261(0x121)+_0x598088['alias']+'-'+Date[_0x3dd261(0x10c)]()[_0x3dd261(0xdf)](0x24),this[_0x3dd261(0xd7)]=_0x598088[_0x3dd261(0xd7)]??0x2bf20,this[_0x3dd261(0x10e)]=_0x598088[_0x3dd261(0x10e)]??0xbb8,_0x598088[_0x3dd261(0xdd)]!==!0x1)this[_0x3dd261(0xd4)]();}['log'](_0x1fe499){const _0x46ab86=a0_0x4f7e39;console['log']('['+new Date()[_0x46ab86(0x111)]()[_0x46ab86(0x10d)](0x0,0x8)+']\x20[commhub:'+this['alias']+']\x20'+_0x1fe499);}async[a0_0x4f7e39(0x125)](_0x1ceb68,_0x180dca){const _0x186c10=a0_0x4f7e39;let _0x1df370={'Content-Type':_0x186c10(0x101),'Accept':_0x186c10(0xff)};if(this['token'])_0x1df370[_0x186c10(0xe2)]=_0x186c10(0xed)+this[_0x186c10(0x117)];let _0x520c76=await(await fetch(this['url']+'/mcp',{'method':'POST','headers':_0x1df370,'body':JSON[_0x186c10(0xf0)]({'jsonrpc':_0x186c10(0xe5),'id':Date[_0x186c10(0x10c)](),'method':'tools/call','params':{'name':_0x1ceb68,'arguments':_0x180dca}})}))[_0x186c10(0xd0)](),_0x2448f9=_0x520c76['match'](/data: (.+)/),_0x4dda86=_0x2448f9?JSON[_0x186c10(0x104)](_0x2448f9[0x1]):JSON[_0x186c10(0x104)](_0x520c76),_0x46000e=_0x4dda86?.[_0x186c10(0x11f)]?.['content']?.[0x0]?.['text'];return _0x46000e?JSON['parse'](_0x46000e):_0x4dda86;}async[a0_0x4f7e39(0xd4)](){const _0x160fdd=a0_0x4f7e39;if(this[_0x160fdd(0x107)])return;this[_0x160fdd(0x107)]=!0x0,await this[_0x160fdd(0xeb)](_0x160fdd(0x10a)),this[_0x160fdd(0x123)](_0x160fdd(0xef)),this[_0x160fdd(0xd6)]=setInterval(()=>{const _0x18dbb4=_0x160fdd;this['status'](_0x18dbb4(0x10a))[_0x18dbb4(0xe4)](_0x233bbe=>this['log']('heartbeat\x20failed:\x20'+_0x233bbe[_0x18dbb4(0xf6)]));},this[_0x160fdd(0xd7)]),this['connectSSE']();}async[a0_0x4f7e39(0x109)](){const _0x1fd899=a0_0x4f7e39;if(this['running']=!0x1,this[_0x1fd899(0xfc)]?.[_0x1fd899(0x108)](),this[_0x1fd899(0xd6)])clearInterval(this[_0x1fd899(0xd6)]);await this[_0x1fd899(0xeb)](_0x1fd899(0xfe))['catch'](()=>{}),this[_0x1fd899(0x123)]('disconnected');}async[a0_0x4f7e39(0x118)](_0x2894f4,_0x3471a3,_0x2a01cb='normal'){const _0x38533c=a0_0x4f7e39;return this[_0x38533c(0x125)]('send_task',{'alias':_0x2894f4,'task':_0x3471a3,'priority':_0x2a01cb,'from_session':this['alias']});}async[a0_0x4f7e39(0xf6)](_0x5b9d25,_0x5719e0){const _0x34309a=a0_0x4f7e39;return this['call'](_0x34309a(0xdb),{'alias':_0x5b9d25,'message':_0x5719e0,'from_session':this['alias']});}async[a0_0x4f7e39(0x10f)](_0x3ef385,_0x4412de,_0x436d90=a0_0x4f7e39(0x11d)){const _0x5b9607=a0_0x4f7e39;return this[_0x5b9607(0x125)](_0x5b9607(0x115),{'in_reply_to':_0x3ef385,'text':_0x4412de,'status':_0x436d90});}async[a0_0x4f7e39(0xeb)](_0x167533,_0x1459c9){const _0x2bfc46=a0_0x4f7e39;return this[_0x2bfc46(0x125)](_0x2bfc46(0xce),{'resume_id':this['resumeId'],'alias':this[_0x2bfc46(0xda)],'status':_0x167533,'server':a0_0x43c30d(),'hostname':a0_0x43c30d(),'agent':this[_0x2bfc46(0xd3)],'project_dir':process['cwd'](),..._0x1459c9});}async[a0_0x4f7e39(0xdc)](){const _0x18b7e6=a0_0x4f7e39;return this[_0x18b7e6(0x125)](_0x18b7e6(0xec),{});}async[a0_0x4f7e39(0x124)](_0x413cb4,_0x34af7c){const _0x298238=a0_0x4f7e39;return this[_0x298238(0x125)](_0x298238(0x124),{'message':_0x413cb4,'filter_server':_0x34af7c?.[_0x298238(0x100)],'filter_status':_0x34af7c?.['status']});}async['connectSSE'](){const _0x4ae24f=a0_0x4f7e39;let _0x596e19=encodeURIComponent(this[_0x4ae24f(0xda)]),_0x1f761d=this[_0x4ae24f(0xee)]+_0x4ae24f(0x10b)+_0x596e19,_0x3d104e=this[_0x4ae24f(0x10e)];while(this[_0x4ae24f(0x107)]){try{this['sseAbort']=new AbortController();let _0x2e2b67={'Accept':_0x4ae24f(0xd2)};if(this[_0x4ae24f(0x117)])_0x2e2b67[_0x4ae24f(0xe2)]=_0x4ae24f(0xed)+this[_0x4ae24f(0x117)];let _0x254992=await fetch(_0x1f761d,{'headers':_0x2e2b67,'signal':this[_0x4ae24f(0xfc)][_0x4ae24f(0x122)]});if(!_0x254992['ok']||!_0x254992[_0x4ae24f(0x106)]){this[_0x4ae24f(0x123)]('SSE\x20failed:\x20'+_0x254992['status']),await this['sleep'](_0x3d104e),_0x3d104e=Math[_0x4ae24f(0xd8)](_0x3d104e*1.5,0xea60);continue;}_0x3d104e=this['reconnectDelay'];let _0xc8cf71=_0x254992[_0x4ae24f(0x106)][_0x4ae24f(0x105)](),_0x114396=new TextDecoder(),_0xd245ab='';while(this[_0x4ae24f(0x107)]){let {done:_0x58a004,value:_0xb3cd3a}=await _0xc8cf71[_0x4ae24f(0xd1)]();if(_0x58a004)break;_0xd245ab+=_0x114396['decode'](_0xb3cd3a,{'stream':!0x0});let _0x3ef83f=_0xd245ab[_0x4ae24f(0xe1)]('\x0a');_0xd245ab=_0x3ef83f[_0x4ae24f(0xf5)]()||'';for(let _0x24bcb7 of _0x3ef83f){if(!_0x24bcb7['startsWith'](_0x4ae24f(0xcf)))continue;try{let _0x532b66=JSON[_0x4ae24f(0x104)](_0x24bcb7[_0x4ae24f(0x10d)](0x6));if(_0x532b66[_0x4ae24f(0xf3)]===_0x4ae24f(0x112)){this[_0x4ae24f(0x123)](_0x4ae24f(0xf7)),this[_0x4ae24f(0xf9)]('connected');continue;}if(_0x532b66['type']===_0x4ae24f(0xfb)||_0x532b66[_0x4ae24f(0xf3)]===_0x4ae24f(0xf4)||_0x532b66['type']===_0x4ae24f(0x124))await this[_0x4ae24f(0xe0)]();}catch{}}}}catch(_0x565ab7){if(_0x565ab7[_0x4ae24f(0xe3)]==='AbortError')break;this[_0x4ae24f(0xf9)](_0x4ae24f(0x110),_0x565ab7),this[_0x4ae24f(0x123)](_0x4ae24f(0xd5)+_0x565ab7[_0x4ae24f(0xf6)]);}if(this[_0x4ae24f(0x107)])this['emit'](_0x4ae24f(0xe7)),this[_0x4ae24f(0x123)](_0x4ae24f(0xfd)+_0x3d104e/0x3e8+_0x4ae24f(0xea)),await this[_0x4ae24f(0x102)](_0x3d104e),_0x3d104e=Math[_0x4ae24f(0xd8)](_0x3d104e*1.5,0xea60);}}async[a0_0x4f7e39(0xe0)](){const _0xa9831d=a0_0x4f7e39;try{let _0x118afa=(await this[_0xa9831d(0x125)](_0xa9831d(0xe8),{'alias':this[_0xa9831d(0xda)],'limit':0xa}))?.[_0xa9831d(0xde)]||[];for(let _0x5dea71 of _0x118afa)await this[_0xa9831d(0x125)](_0xa9831d(0xfa),{'alias':this[_0xa9831d(0xda)],'message_id':_0x5dea71['id']}),this['log']('←\x20'+_0x5dea71[_0xa9831d(0xf1)]+':\x20'+_0x5dea71[_0xa9831d(0x120)][_0xa9831d(0x10d)](0x0,0x3c)),this[_0xa9831d(0xf9)](_0xa9831d(0xd9),_0x5dea71),this[_0xa9831d(0xf9)]('message',_0x5dea71);}catch(_0x4ba1e2){this[_0xa9831d(0x123)](_0xa9831d(0xe9)+_0x4ba1e2[_0xa9831d(0xf6)]);}}[a0_0x4f7e39(0x102)](_0x521d9c){return new Promise(_0x4335e3=>setTimeout(_0x4335e3,_0x521d9c));}}var $=T;export{$ as default,T as CommHub};
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,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x333af0=a0_0x39e1;(function(_0x125d95,_0x5868ee){const _0x555af8=a0_0x39e1,_0xf1d24b=_0x125d95();while(!![]){try{const _0x47b001=-parseInt(_0x555af8(0x1db))/0x1*(-parseInt(_0x555af8(0x1ec))/0x2)+parseInt(_0x555af8(0x1e3))/0x3*(-parseInt(_0x555af8(0x1a3))/0x4)+-parseInt(_0x555af8(0x1de))/0x5+parseInt(_0x555af8(0x169))/0x6*(-parseInt(_0x555af8(0x1d0))/0x7)+parseInt(_0x555af8(0x1ad))/0x8+-parseInt(_0x555af8(0x1cb))/0x9*(parseInt(_0x555af8(0x1e1))/0xa)+-parseInt(_0x555af8(0x187))/0xb*(-parseInt(_0x555af8(0x1ea))/0xc);if(_0x47b001===_0x5868ee)break;else _0xf1d24b['push'](_0xf1d24b['shift']());}catch(_0x1795a5){_0xf1d24b['push'](_0xf1d24b['shift']());}}}(a0_0x532e,0xa8ce5));import{readFileSync as a0_0x1bf441,existsSync as a0_0x551167}from'fs';import{randomUUID as a0_0x1031a6}from'crypto';import{join as a0_0x2a2ba6}from'path';import{hostname as a0_0x3fafea}from'os';import{execSync as a0_0x1e275e}from'child_process';import{Server as a0_0x11f3b2}from'@modelcontextprotocol/sdk/server/index.js';function a0_0x532e(){const _0x404c80=['inbox_count','MCP\x20stdio\x20connected','→\x20injected\x20task\x20','...\x20TMUX=','warning:\x20could\x20not\x20register:\x20','replace','indexOf','commhub_reply','89023ZAfaHP','write','get_all_status','set','slice','utf-8','error','Authorization','high','trim','send_message','alias','\x20ALIAS=','messages','commhub_send_message','toTimeString','connected','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','type','starting\x20SSE\x20listener...','commhub_report_status','status','\x20RESUME_ID=','string','shutting\x20down,\x20reporting\x20offline...','setRequestHandler','idle','exit','4426692PDWxit','\x20CWD=','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','send_task','stdin','result','find','ready\x20—\x20waiting\x20for\x20events','working','new_message','203112CaYpvE','failed','parse','/mcp','task','.anet','SSE\x20error:\x20','2.0','SSE\x20connected\x20as\x20\x22','ack_inbox','2025-03-26','catch','connect','cwd','SIGTERM','config.json','CommHub\x20init\x20failed:\x20','priority','unknown\x20tool','claude-code','connecting\x20to\x20','then','commhub_send_task','getReader','Progress\x200-100','Reply\x20text\x20/\x20result\x20summary','text',':\x20inbox_count=','stderr','params','9uJWoFq','startsWith','parse\x20error:\x20','commhub_get_all_status','SSE\x20fatal:\x20','42hXKBZi','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','no\x20response','end','ENV:\x20URL=','initialize','.claude/channels/commhub',']\x20[commhub]\x20','notification','\x20PROJECT_ENV=','low','463143UYpJET','normal','Bearer\x20','1206665fwSvwP','commhub','Target\x20session\x20alias','2760790IBWPSR','SIGINT','3ytldqp','SSE\x20connection\x20error:\x20','application/json','length','message_id','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','3312kjactT','split','2EhRoly','init\x20failed:\x20','cancelled','hub','fatal:\x20','notifications/claude/channel','registered\x20as\x20\x22','send_reply','\x20from\x20','406686mnkJss','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','http://127.0.0.1:9200','data:\x20','heartbeat\x20failed:\x20','blocked','POST','object','0.3.0','stringify','in_progress','from','from_session','completed','report_status','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','content','.env','body','Message\x20content','message','get'];a0_0x532e=function(){return _0x404c80;};return a0_0x532e();}import{StdioServerTransport as a0_0x434a88}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x990d89,CallToolRequestSchema as a0_0x3b53f1}from'@modelcontextprotocol/sdk/types.js';function p(_0x1fb848){const _0x3b2513=a0_0x39e1;if(!a0_0x551167(_0x1fb848))return;for(let _0x5d9391 of a0_0x1bf441(_0x1fb848,_0x3b2513(0x18c))[_0x3b2513(0x1eb)]('\x0a')){let _0x17e10d=_0x5d9391[_0x3b2513(0x190)]();if(!_0x17e10d||_0x17e10d[_0x3b2513(0x1cc)]('#'))continue;let _0x162693=_0x17e10d[_0x3b2513(0x185)]('=');if(_0x162693<0x0)continue;let _0x5161df=_0x17e10d['slice'](0x0,_0x162693)[_0x3b2513(0x190)](),_0x259dfc=_0x17e10d['slice'](_0x162693+0x1)[_0x3b2513(0x190)]()[_0x3b2513(0x184)](/^["']|["']$/g,'');if(!process.env[_0x5161df])process.env[_0x5161df]=_0x259dfc;}}var C=process.env.HOME||'~',T=a0_0x2a2ba6(C,a0_0x333af0(0x1d6));p(a0_0x2a2ba6(T,'.env'));var L=process[a0_0x333af0(0x1ba)]()['replace'](/\//g,'-');p(a0_0x2a2ba6(T,L,a0_0x333af0(0x17a)));function U(){const _0x32f7d9=a0_0x333af0;try{return a0_0x1e275e('tmux\x20display-message\x20-p\x20\x27#S\x27',{'encoding':_0x32f7d9(0x18c),'timeout':0x7d0})[_0x32f7d9(0x190)]();}catch{return'';}}function v(){const _0x17fdd9=a0_0x333af0;try{let _0x4c2189=a0_0x2a2ba6(C,_0x17fdd9(0x1b2),_0x17fdd9(0x1bc));if(a0_0x551167(_0x4c2189))return JSON['parse'](a0_0x1bf441(_0x4c2189,_0x17fdd9(0x18c)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x333af0(0x1ef)]||a0_0x333af0(0x16b),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x3fafea(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x1031a6(),X=process.env.COMMHUB_TOKEN||H['token']||'';function Y(_0x3660ed){const _0x1aaedd=a0_0x333af0;let _0x568ca8=new Date()[_0x1aaedd(0x196)]()[_0x1aaedd(0x18b)](0x0,0x8);process[_0x1aaedd(0x1c9)][_0x1aaedd(0x188)]('['+_0x568ca8+_0x1aaedd(0x1d7)+_0x3660ed+'\x0a');}function h(_0x5bba53){return new Promise(_0x149dbe=>setTimeout(_0x149dbe,_0x5bba53));}Y(a0_0x333af0(0x1d4)+f+a0_0x333af0(0x193)+Z+a0_0x333af0(0x19d)+w[a0_0x333af0(0x18b)](0x0,0x8)+a0_0x333af0(0x182)+(j||'none')+a0_0x333af0(0x1a4)+process[a0_0x333af0(0x1ba)]()+a0_0x333af0(0x1d9)+L);var k=new Map(),K=new a0_0x11f3b2({'name':'commhub-channel','version':a0_0x333af0(0x171)},{'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_0x333af0(0x16a),a0_0x333af0(0x1e9),'Session\x20alias:\x20'+Z]['join']('\x0a')});K[a0_0x333af0(0x1a0)](a0_0x990d89,async()=>({'tools':[{'name':a0_0x333af0(0x186),'description':a0_0x333af0(0x1e8),'inputSchema':{'type':a0_0x333af0(0x170),'properties':{'task_id':{'type':a0_0x333af0(0x19e),'description':a0_0x333af0(0x1a5)},'text':{'type':'string','description':a0_0x333af0(0x1c6)},'status':{'type':'string','enum':[a0_0x333af0(0x176),a0_0x333af0(0x1ae),a0_0x333af0(0x1ee),a0_0x333af0(0x16e),'error',a0_0x333af0(0x173)],'description':a0_0x333af0(0x178)}},'required':[a0_0x333af0(0x1c7)]}},{'name':a0_0x333af0(0x19b),'description':'Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','inputSchema':{'type':'object','properties':{'status':{'type':a0_0x333af0(0x19e),'enum':['working',a0_0x333af0(0x1a1),a0_0x333af0(0x16e),'error']},'task':{'type':a0_0x333af0(0x19e),'description':'Current\x20task\x20description'},'progress':{'type':'number','description':a0_0x333af0(0x1c5)}},'required':[a0_0x333af0(0x19c)]}},{'name':a0_0x333af0(0x1c3),'description':a0_0x333af0(0x1d1),'inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x333af0(0x19e),'description':a0_0x333af0(0x1e0)},'task':{'type':a0_0x333af0(0x19e),'description':'Task\x20content'},'priority':{'type':a0_0x333af0(0x19e),'enum':[a0_0x333af0(0x18f),a0_0x333af0(0x1dc),a0_0x333af0(0x1da)],'description':'Priority\x20(default:\x20normal)'}},'required':[a0_0x333af0(0x192),a0_0x333af0(0x1b1)]}},{'name':'commhub_send_message','description':a0_0x333af0(0x198),'inputSchema':{'type':a0_0x333af0(0x170),'properties':{'alias':{'type':'string','description':a0_0x333af0(0x1e0)},'message':{'type':a0_0x333af0(0x19e),'description':a0_0x333af0(0x17c)}},'required':[a0_0x333af0(0x192),'message']}},{'name':a0_0x333af0(0x1ce),'description':'Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','inputSchema':{'type':a0_0x333af0(0x170),'properties':{}}}]}));async function P(_0xabaab7,_0xf1ce2f){const _0x60b326=a0_0x333af0;let _0x10851a=await fetch(f+_0x60b326(0x1b0),{'method':_0x60b326(0x16f),'headers':{'Content-Type':_0x60b326(0x1e5),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x60b326(0x1dd)+X}:{}},'body':JSON[_0x60b326(0x172)]({'jsonrpc':_0x60b326(0x1b4),'id':0x1,'method':_0x60b326(0x1d5),'params':{'protocolVersion':_0x60b326(0x1b7),'capabilities':{},'clientInfo':{'name':'commhub-channel','version':_0x60b326(0x171)}}})});if(!_0x10851a['ok']){let _0x437385=await _0x10851a[_0x60b326(0x1c7)]();return Y(_0x60b326(0x1bd)+_0x10851a['status']+'\x20'+_0x437385[_0x60b326(0x18b)](0x0,0x64)),{'ok':!0x1,'error':_0x60b326(0x1ed)+_0x10851a[_0x60b326(0x19c)]};}await _0x10851a[_0x60b326(0x1c7)]();let _0x168713=(await(await fetch(f+_0x60b326(0x1b0),{'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream',...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON[_0x60b326(0x172)]({'jsonrpc':_0x60b326(0x1b4),'id':0x2,'method':'tools/call','params':{'name':_0xabaab7,'arguments':_0xf1ce2f}})}))[_0x60b326(0x1c7)]())[_0x60b326(0x1eb)]('\x0a')[_0x60b326(0x1a9)](_0x2d396a=>_0x2d396a[_0x60b326(0x1cc)](_0x60b326(0x16c)));if(_0x168713){let _0x4b13b7=JSON[_0x60b326(0x1af)](_0x168713[_0x60b326(0x18b)](0x6));return _0x4b13b7?.[_0x60b326(0x1a8)]?.['content']?.[0x0]?.[_0x60b326(0x1c7)]?JSON[_0x60b326(0x1af)](_0x4b13b7[_0x60b326(0x1a8)][_0x60b326(0x179)][0x0]['text']):_0x4b13b7;}return{'ok':!0x1,'error':_0x60b326(0x1d2)};}K[a0_0x333af0(0x1a0)](a0_0x3b53f1,async _0x3975b1=>{const _0x1b317d=a0_0x333af0;let {name:_0x33374c,arguments:_0x1811a0}=_0x3975b1[_0x1b317d(0x1ca)];if(_0x33374c===_0x1b317d(0x186)){let {task_id:_0x4be889,text:_0x2d1d37,status:_0xe50634}=_0x1811a0;if(_0xe50634==='completed'||_0xe50634===_0x1b317d(0x1ae)||_0xe50634===_0x1b317d(0x1ee)){let _0x3dbd23=_0xe50634===_0x1b317d(0x176)?'replied':_0xe50634,_0x34c4bd=_0x4be889?k[_0x1b317d(0x17e)](_0x4be889)||_0x1b317d(0x1ef):_0x1b317d(0x1ef),_0x2648eb=await P(_0x1b317d(0x167),{'alias':_0x34c4bd,'text':_0x2d1d37,'in_reply_to':_0x4be889||void 0x0,'status':_0x3dbd23,'from_session':Z});if(_0x4be889)k['delete'](_0x4be889);return{'content':[{'type':_0x1b317d(0x1c7),'text':JSON[_0x1b317d(0x172)](_0x2648eb)}]};}let _0x15180f=await P(_0x1b317d(0x177),{'resume_id':w,'alias':Z,'status':_0xe50634===_0x1b317d(0x16e)?'blocked':_0xe50634==='error'?_0x1b317d(0x18d):_0x1b317d(0x1ab),'task':_0x2d1d37[_0x1b317d(0x18b)](0x0,0xc8),'output':_0x2d1d37});return{'content':[{'type':_0x1b317d(0x1c7),'text':JSON[_0x1b317d(0x172)](_0x15180f)}]};}if(_0x33374c===_0x1b317d(0x19b)){let {status:_0x45fef1,task:_0x278173,progress:_0x4a7d54}=_0x1811a0,_0x51a54e=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x45fef1,'task':_0x278173,'progress':_0x4a7d54});return{'content':[{'type':_0x1b317d(0x1c7),'text':JSON['stringify'](_0x51a54e)}]};}if(_0x33374c==='commhub_send_task'){let {alias:_0x5e9ada,task:_0x169fdd,priority:_0x6fefa1}=_0x1811a0,_0x3d5d63=await P(_0x1b317d(0x1a6),{'alias':_0x5e9ada,'task':_0x169fdd,'priority':_0x6fefa1||_0x1b317d(0x1dc),'from_session':Z});return{'content':[{'type':_0x1b317d(0x1c7),'text':JSON[_0x1b317d(0x172)](_0x3d5d63)}]};}if(_0x33374c===_0x1b317d(0x195)){let {alias:_0x2ab4b4,message:_0x41c2bb}=_0x1811a0,_0x2e995b=await P(_0x1b317d(0x191),{'alias':_0x2ab4b4,'message':_0x41c2bb,'from_session':Z});return{'content':[{'type':_0x1b317d(0x1c7),'text':JSON[_0x1b317d(0x172)](_0x2e995b)}]};}if(_0x33374c===_0x1b317d(0x1ce)){let _0x479ada=await P(_0x1b317d(0x189),{});return{'content':[{'type':_0x1b317d(0x1c7),'text':JSON[_0x1b317d(0x172)](_0x479ada)}]};}return{'content':[{'type':_0x1b317d(0x1c7),'text':JSON[_0x1b317d(0x172)]({'error':_0x1b317d(0x1bf)})}]};});async function u(){const _0x21f58d=a0_0x333af0;let _0x5d6e86=f+'/events/'+encodeURIComponent(Z),_0x22be39={};if(X)_0x22be39[_0x21f58d(0x18e)]=_0x21f58d(0x1dd)+X;Y(_0x21f58d(0x1c1)+_0x5d6e86);while(!0x0){try{let _0x276d7e=await fetch(_0x5d6e86,{'headers':_0x22be39});if(!_0x276d7e['ok']){Y(_0x21f58d(0x1b3)+_0x276d7e['status']+'\x20'+_0x276d7e['statusText']),await h(0x1388);continue;}let _0x22872f=_0x276d7e[_0x21f58d(0x17b)][_0x21f58d(0x1c4)](),_0x3c7ab9=new TextDecoder(),_0xd5d1a6='';while(!0x0){let {done:_0x42f917,value:_0x278163}=await _0x22872f['read']();if(_0x42f917)break;_0xd5d1a6+=_0x3c7ab9['decode'](_0x278163,{'stream':!0x0});let _0x3379fd=_0xd5d1a6[_0x21f58d(0x1eb)]('\x0a\x0a');_0xd5d1a6=_0x3379fd['pop']()||'';for(let _0x1b30fb of _0x3379fd){let _0x41781a=_0x1b30fb['split']('\x0a')[_0x21f58d(0x1a9)](_0x5d2d14=>_0x5d2d14['startsWith'](_0x21f58d(0x16c)));if(!_0x41781a)continue;try{let _0x16f222=JSON[_0x21f58d(0x1af)](_0x41781a[_0x21f58d(0x18b)](0x6));await S(_0x16f222);}catch(_0x479304){Y(_0x21f58d(0x1cd)+_0x479304);}}}Y('SSE\x20stream\x20ended,\x20reconnecting...');}catch(_0x582c18){Y(_0x21f58d(0x1e4)+_0x582c18);}await h(0xbb8);}}async function S(_0x3f2fa2){const _0x30dbf2=a0_0x333af0;if(_0x3f2fa2[_0x30dbf2(0x199)]===_0x30dbf2(0x197)){Y(_0x30dbf2(0x1b5)+Z+'\x22');return;}if(_0x3f2fa2[_0x30dbf2(0x199)]===_0x30dbf2(0x1ac)){if(Y('←\x20message\x20from\x20'+_0x3f2fa2['from']+':\x20'+_0x3f2fa2[_0x30dbf2(0x17d)][_0x30dbf2(0x18b)](0x0,0x3c)),await K[_0x30dbf2(0x1d8)]({'method':_0x30dbf2(0x165),'params':{'content':_0x3f2fa2['message'],'meta':{'sender':_0x3f2fa2[_0x30dbf2(0x174)]||_0x30dbf2(0x1ef),'sender_id':'commhub','user':_0x3f2fa2['from']||_0x30dbf2(0x1ef),'priority':_0x30dbf2(0x1dc)}}}),_0x3f2fa2['message_id'])await P(_0x30dbf2(0x1b6),{'alias':Z,'message_id':_0x3f2fa2[_0x30dbf2(0x1e7)]});return;}if(_0x3f2fa2[_0x30dbf2(0x199)]==='new_task'||_0x3f2fa2[_0x30dbf2(0x199)]==='broadcast'){Y('←\x20'+_0x3f2fa2[_0x30dbf2(0x199)]+_0x30dbf2(0x1c8)+_0x3f2fa2[_0x30dbf2(0x17f)]+'\x20priority='+(_0x3f2fa2[_0x30dbf2(0x1be)]||_0x30dbf2(0x1dc)));let _0x5722e2=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0x5722e2?.['ok']&&_0x5722e2[_0x30dbf2(0x194)]?.[_0x30dbf2(0x1e6)]>0x0)for(let _0x3d474d of _0x5722e2[_0x30dbf2(0x194)]){let _0x1b0419={'sender':_0x3d474d[_0x30dbf2(0x175)]||_0x30dbf2(0x1ef),'sender_id':_0x30dbf2(0x1df),'user':_0x3d474d[_0x30dbf2(0x175)]||'hub','task_id':_0x3d474d['id'],'priority':_0x3d474d[_0x30dbf2(0x1be)]||_0x30dbf2(0x1dc)};k[_0x30dbf2(0x18a)](_0x3d474d['id'],_0x3d474d[_0x30dbf2(0x175)]||_0x30dbf2(0x1ef)),await K[_0x30dbf2(0x1d8)]({'method':_0x30dbf2(0x165),'params':{'content':_0x3d474d[_0x30dbf2(0x179)],'meta':_0x1b0419}}),Y(_0x30dbf2(0x181)+_0x3d474d['id'][_0x30dbf2(0x18b)](0x0,0x8)+_0x30dbf2(0x168)+_0x3d474d[_0x30dbf2(0x175)]+':\x20'+_0x3d474d[_0x30dbf2(0x179)][_0x30dbf2(0x18b)](0x0,0x3c)),await P(_0x30dbf2(0x1b6),{'alias':Z,'message_id':_0x3d474d['id']});}}}async function A(){const _0x4271d7=a0_0x333af0;let _0xcb56b2=new a0_0x434a88();await K[_0x4271d7(0x1b9)](_0xcb56b2),Y(_0x4271d7(0x180)),Y(_0x4271d7(0x19a)),u()[_0x4271d7(0x1b8)](_0x488161=>Y(_0x4271d7(0x1cf)+_0x488161)),P('report_status',{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x3fafea(),'hostname':a0_0x3fafea(),'agent':_0x4271d7(0x1c0),'project_dir':process[_0x4271d7(0x1ba)](),'tmux_name':j||void 0x0})[_0x4271d7(0x1c2)](()=>Y(_0x4271d7(0x166)+Z+'\x22\x20('+w[_0x4271d7(0x18b)](0x0,0x8)+')'))[_0x4271d7(0x1b8)](_0x1e9462=>Y(_0x4271d7(0x183)+_0x1e9462)),setInterval(()=>{const _0x2543a8=_0x4271d7;P(_0x2543a8(0x177),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x3fafea(),'hostname':a0_0x3fafea(),'agent':_0x2543a8(0x1c0),'project_dir':process[_0x2543a8(0x1ba)](),'tmux_name':j||void 0x0})['catch'](_0x45ac9c=>Y(_0x2543a8(0x16d)+_0x45ac9c));},0x2bf20),Y(_0x4271d7(0x1aa));}function a0_0x39e1(_0x5e2e95,_0x196cb9){_0x5e2e95=_0x5e2e95-0x164;const _0x532e42=a0_0x532e();let _0x39e1b2=_0x532e42[_0x5e2e95];return _0x39e1b2;}A()['catch'](_0x2df79c=>{const _0x2cdf55=a0_0x333af0;Y(_0x2cdf55(0x164)+_0x2df79c),process[_0x2cdf55(0x1a2)](0x1);});async function N(){const _0x290ded=a0_0x333af0;Y(_0x290ded(0x19f)),await P('report_status',{'resume_id':w,'alias':Z,'status':_0x290ded(0x18d),'task':'session\x20disconnected'})['catch'](()=>{}),process[_0x290ded(0x1a2)](0x0);}process[a0_0x333af0(0x1a7)]['on'](a0_0x333af0(0x1d3),()=>N()),process['on'](a0_0x333af0(0x1bb),()=>N()),process['on'](a0_0x333af0(0x1e2),()=>N());
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());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
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",