@sleep2agi/agent-network 2.2.10-preview.0 → 2.2.10-preview.1

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_0x5b3dd7=a0_0x249e;(function(_0x1157ec,_0x51baa0){const _0x1f4d79=a0_0x249e,_0x5f4104=_0x1157ec();while(!![]){try{const _0x4d73fe=-parseInt(_0x1f4d79(0x13b))/0x1+-parseInt(_0x1f4d79(0x15c))/0x2*(parseInt(_0x1f4d79(0x15a))/0x3)+-parseInt(_0x1f4d79(0x16e))/0x4*(parseInt(_0x1f4d79(0x134))/0x5)+parseInt(_0x1f4d79(0x166))/0x6+parseInt(_0x1f4d79(0x155))/0x7+parseInt(_0x1f4d79(0x154))/0x8+-parseInt(_0x1f4d79(0x11f))/0x9;if(_0x4d73fe===_0x51baa0)break;else _0x5f4104['push'](_0x5f4104['shift']());}catch(_0x10b574){_0x5f4104['push'](_0x5f4104['shift']());}}}(a0_0x9753,0xb81fc));import{EventEmitter as a0_0xbb4376}from'events';import{hostname as a0_0x4524d7}from'os';function a0_0x249e(_0x426a9c,_0x5003c7){_0x426a9c=_0x426a9c-0x11a;const _0x97537e=a0_0x9753();let _0x249eb6=_0x97537e[_0x426a9c];return _0x249eb6;}class T extends a0_0xbb4376{[a0_0x5b3dd7(0x146)];[a0_0x5b3dd7(0x159)];[a0_0x5b3dd7(0x129)];[a0_0x5b3dd7(0x131)];[a0_0x5b3dd7(0x139)];['heartbeatInterval'];[a0_0x5b3dd7(0x13d)];['heartbeatTimer'];[a0_0x5b3dd7(0x133)];[a0_0x5b3dd7(0x125)]=!0x1;constructor(_0x4d8685){const _0x193433=a0_0x5b3dd7;super();if(this['url']=_0x4d8685['url']['replace'](/\/$/,''),this['alias']=_0x4d8685[_0x193433(0x159)],this[_0x193433(0x129)]=_0x4d8685['token'],this[_0x193433(0x131)]=_0x4d8685['agent']||_0x193433(0x122),this[_0x193433(0x139)]='sdk-'+_0x4d8685[_0x193433(0x159)]+'-'+Date['now']()['toString'](0x24),this[_0x193433(0x149)]=_0x4d8685[_0x193433(0x149)]??0x2bf20,this[_0x193433(0x13d)]=_0x4d8685[_0x193433(0x13d)]??0xbb8,_0x4d8685[_0x193433(0x168)]!==!0x1)this[_0x193433(0x12b)]();}[a0_0x5b3dd7(0x16c)](_0x457b1b){const _0x3a4374=a0_0x5b3dd7;console[_0x3a4374(0x16c)]('['+new Date()[_0x3a4374(0x16a)]()[_0x3a4374(0x167)](0x0,0x8)+_0x3a4374(0x135)+this[_0x3a4374(0x159)]+']\x20'+_0x457b1b);}async[a0_0x5b3dd7(0x160)](_0x3c6f22,_0x2c260b){const _0x204862=a0_0x5b3dd7;let _0x4d2147={'Content-Type':_0x204862(0x120),'Accept':_0x204862(0x142)};if(this[_0x204862(0x129)])_0x4d2147[_0x204862(0x16b)]=_0x204862(0x123)+this['token'];let _0x14703a=await(await fetch(this[_0x204862(0x146)]+'/mcp',{'method':_0x204862(0x151),'headers':_0x4d2147,'body':JSON['stringify']({'jsonrpc':_0x204862(0x158),'id':Date['now'](),'method':_0x204862(0x15d),'params':{'name':_0x3c6f22,'arguments':_0x2c260b}})}))['text'](),_0x3d251b=_0x14703a[_0x204862(0x14a)](/data: (.+)/),_0x4e9951=_0x3d251b?JSON[_0x204862(0x164)](_0x3d251b[0x1]):JSON['parse'](_0x14703a),_0x293b66=_0x4e9951?.[_0x204862(0x153)]?.[_0x204862(0x11b)]?.[0x0]?.[_0x204862(0x148)];return _0x293b66?JSON[_0x204862(0x164)](_0x293b66):_0x4e9951;}async[a0_0x5b3dd7(0x12b)](){const _0xf57458=a0_0x5b3dd7;if(this[_0xf57458(0x125)])return;this[_0xf57458(0x125)]=!0x0,await this['status'](_0xf57458(0x152)),this['log'](_0xf57458(0x161)),this[_0xf57458(0x11a)]=setInterval(()=>{const _0x123c78=_0xf57458;this['status']('idle')['catch'](_0x20751b=>this['log'](_0x123c78(0x12f)+_0x20751b['message']));},this['heartbeatInterval']),this['connectSSE']();}async['disconnect'](){const _0x220173=a0_0x5b3dd7;if(this['running']=!0x1,this[_0x220173(0x133)]?.[_0x220173(0x12e)](),this['heartbeatTimer'])clearInterval(this[_0x220173(0x11a)]);await this['status']('offline')[_0x220173(0x141)](()=>{}),this[_0x220173(0x16c)](_0x220173(0x163));}async[a0_0x5b3dd7(0x12c)](_0x598a46,_0x345248,_0x5216bb=a0_0x5b3dd7(0x127)){const _0x23eef1=a0_0x5b3dd7;return this[_0x23eef1(0x160)](_0x23eef1(0x12d),{'alias':_0x598a46,'task':_0x345248,'priority':_0x5216bb,'from_session':this[_0x23eef1(0x159)]});}async[a0_0x5b3dd7(0x128)](_0x1c585c,_0x462f88){const _0x42639a=a0_0x5b3dd7;return this['call']('send_message',{'alias':_0x1c585c,'message':_0x462f88,'from_session':this[_0x42639a(0x159)]});}async[a0_0x5b3dd7(0x130)](_0x2132f5,_0x110d4e,_0x12dedd='completed'){const _0x94d783=a0_0x5b3dd7;return this[_0x94d783(0x160)]('send_reply',{'in_reply_to':_0x2132f5,'text':_0x110d4e,'status':_0x12dedd});}async[a0_0x5b3dd7(0x13f)](_0x5ac4d3,_0x55a57c){const _0x175324=a0_0x5b3dd7;return this[_0x175324(0x160)](_0x175324(0x14d),{'resume_id':this[_0x175324(0x139)],'alias':this[_0x175324(0x159)],'status':_0x5ac4d3,'server':a0_0x4524d7(),'hostname':a0_0x4524d7(),'agent':this['agent'],'project_dir':process[_0x175324(0x11c)](),..._0x55a57c});}async[a0_0x5b3dd7(0x11e)](){const _0x16b459=a0_0x5b3dd7;return this[_0x16b459(0x160)](_0x16b459(0x124),{});}async[a0_0x5b3dd7(0x143)](_0x3b338f,_0x41c6d1){const _0x380458=a0_0x5b3dd7;return this[_0x380458(0x160)](_0x380458(0x143),{'message':_0x3b338f,'filter_server':_0x41c6d1?.['server'],'filter_status':_0x41c6d1?.[_0x380458(0x13f)]});}async[a0_0x5b3dd7(0x15e)](){const _0x2ab305=a0_0x5b3dd7;let _0x1e5cc5=encodeURIComponent(this[_0x2ab305(0x159)]),_0x37c5af=this[_0x2ab305(0x146)]+'/events/'+_0x1e5cc5,_0x4f0e4a=this[_0x2ab305(0x13d)];while(this[_0x2ab305(0x125)]){try{this[_0x2ab305(0x133)]=new AbortController();let _0x4ea25e={'Accept':_0x2ab305(0x12a)};if(this[_0x2ab305(0x129)])_0x4ea25e[_0x2ab305(0x16b)]=_0x2ab305(0x123)+this[_0x2ab305(0x129)];let _0x3a9374=await fetch(_0x37c5af,{'headers':_0x4ea25e,'signal':this[_0x2ab305(0x133)][_0x2ab305(0x136)]});if(!_0x3a9374['ok']||!_0x3a9374['body']){this[_0x2ab305(0x16c)](_0x2ab305(0x121)+_0x3a9374[_0x2ab305(0x13f)]),await this[_0x2ab305(0x169)](_0x4f0e4a),_0x4f0e4a=Math['min'](_0x4f0e4a*1.5,0xea60);continue;}_0x4f0e4a=this[_0x2ab305(0x13d)];let _0x48b330=_0x3a9374[_0x2ab305(0x11d)][_0x2ab305(0x14b)](),_0x354651=new TextDecoder(),_0x32d3db='';while(this['running']){let {done:_0x2a1b2e,value:_0xa5e675}=await _0x48b330[_0x2ab305(0x162)]();if(_0x2a1b2e)break;_0x32d3db+=_0x354651[_0x2ab305(0x13c)](_0xa5e675,{'stream':!0x0});let _0xce65ac=_0x32d3db[_0x2ab305(0x144)]('\x0a');_0x32d3db=_0xce65ac['pop']()||'';for(let _0x13e4a5 of _0xce65ac){if(!_0x13e4a5[_0x2ab305(0x15b)](_0x2ab305(0x13a)))continue;try{let _0x3f31d0=JSON[_0x2ab305(0x164)](_0x13e4a5[_0x2ab305(0x167)](0x6));if(_0x3f31d0[_0x2ab305(0x14c)]==='connected'){this[_0x2ab305(0x16c)](_0x2ab305(0x16d)),this['emit']('connected');continue;}if(_0x3f31d0[_0x2ab305(0x14c)]===_0x2ab305(0x14e)||_0x3f31d0['type']===_0x2ab305(0x147)||_0x3f31d0[_0x2ab305(0x14c)]===_0x2ab305(0x143))await this[_0x2ab305(0x126)]();}catch{}}}}catch(_0x9ad5cf){if(_0x9ad5cf[_0x2ab305(0x14f)]===_0x2ab305(0x145))break;this['emit'](_0x2ab305(0x132),_0x9ad5cf),this[_0x2ab305(0x16c)](_0x2ab305(0x156)+_0x9ad5cf[_0x2ab305(0x128)]);}if(this[_0x2ab305(0x125)])this[_0x2ab305(0x13e)](_0x2ab305(0x163)),this[_0x2ab305(0x16c)](_0x2ab305(0x137)+_0x4f0e4a/0x3e8+_0x2ab305(0x165)),await this[_0x2ab305(0x169)](_0x4f0e4a),_0x4f0e4a=Math[_0x2ab305(0x150)](_0x4f0e4a*1.5,0xea60);}}async[a0_0x5b3dd7(0x126)](){const _0x184820=a0_0x5b3dd7;try{let _0x35769f=(await this[_0x184820(0x160)]('get_inbox',{'alias':this[_0x184820(0x159)],'limit':0xa}))?.[_0x184820(0x138)]||[];for(let _0x5663c8 of _0x35769f)await this[_0x184820(0x160)](_0x184820(0x15f),{'alias':this[_0x184820(0x159)],'message_id':_0x5663c8['id']}),this[_0x184820(0x16c)]('←\x20'+_0x5663c8[_0x184820(0x157)]+':\x20'+_0x5663c8[_0x184820(0x11b)][_0x184820(0x167)](0x0,0x3c)),this[_0x184820(0x13e)](_0x184820(0x140),_0x5663c8),this['emit'](_0x184820(0x128),_0x5663c8);}catch(_0x31d476){this[_0x184820(0x16c)]('inbox\x20error:\x20'+_0x31d476[_0x184820(0x128)]);}}[a0_0x5b3dd7(0x169)](_0xdfdd6a){return new Promise(_0x3bb3b3=>setTimeout(_0x3bb3b3,_0xdfdd6a));}}var $=T;function a0_0x9753(){const _0x32ed08=['SSE\x20error:\x20','from_session','2.0','alias','235380EZqmzU','startsWith','6CqQycP','tools/call','connectSSE','ack_inbox','call','registered','read','disconnected','parse','s...','4362456otTOWA','slice','autoConnect','sleep','toTimeString','Authorization','log','SSE\x20connected','80MmyVjF','heartbeatTimer','content','cwd','body','getAllStatus','2363103HSVozd','application/json','SSE\x20failed:\x20','sdk','Bearer\x20','get_all_status','running','processInbox','normal','message','token','text/event-stream','connect','send','send_task','abort','heartbeat\x20failed:\x20','reply','agent','error','sseAbort','113590ctFboX',']\x20[commhub:','signal','SSE\x20reconnecting\x20in\x20','messages','resumeId','data:\x20','1204245pygTrA','decode','reconnectDelay','emit','status','task','catch','application/json,\x20text/event-stream','broadcast','split','AbortError','url','new_message','text','heartbeatInterval','match','getReader','type','report_status','new_task','name','min','POST','idle','result','8588408uVnnCf','7770679btseCe'];a0_0x9753=function(){return _0x32ed08;};return a0_0x9753();}export{$ as default,T as CommHub};
1
+ const a0_0x14650b=a0_0x2e27;(function(_0x1ed09c,_0x33789e){const _0x52cd90=a0_0x2e27,_0x2adbda=_0x1ed09c();while(!![]){try{const _0x432da2=parseInt(_0x52cd90(0x1cd))/0x1+-parseInt(_0x52cd90(0x1b9))/0x2+-parseInt(_0x52cd90(0x19c))/0x3+-parseInt(_0x52cd90(0x1d5))/0x4+parseInt(_0x52cd90(0x1e3))/0x5*(parseInt(_0x52cd90(0x1d0))/0x6)+parseInt(_0x52cd90(0x1ab))/0x7*(parseInt(_0x52cd90(0x1c3))/0x8)+-parseInt(_0x52cd90(0x1a4))/0x9;if(_0x432da2===_0x33789e)break;else _0x2adbda['push'](_0x2adbda['shift']());}catch(_0x582498){_0x2adbda['push'](_0x2adbda['shift']());}}}(a0_0x56e7,0x1cae5));import{EventEmitter as a0_0x53a30d}from'events';import{hostname as a0_0x50230c}from'os';function a0_0x56e7(){const _0x2a0623=['ack_inbox','175149EzrcGN','task','text','806034lkTCgH','text/event-stream','offline','2.0','min','6932UhEver','heartbeatInterval','heartbeatTimer','replace','slice','SSE\x20connected','Bearer\x20','call','reconnectDelay','decode','alias','message','AbortError','type','5gcyeAG','/mcp','name','now','processInbox','body','application/json','url','autoConnect','Authorization','send_task','261141DtOUis','parse','idle','sdk-','emit','server','connectSSE','getAllStatus','2069496kkQyeF','connected','disconnect','application/json,\x20text/event-stream','from_session','agent','signal','469MrPCvK','startsWith','get_all_status','connect','resumeId','result','catch','error','broadcast','cwd','SSE\x20error:\x20','reply','sseAbort','running','182208wQAbvt','match','/events/','status','disconnected','get_inbox','report_status','registered','tools/call','sleep','26008hSIzfp','log','normal',']\x20[commhub:','content','send_message','POST','pop','token'];a0_0x56e7=function(){return _0x2a0623;};return a0_0x56e7();}function a0_0x2e27(_0x378a3c,_0x205b87){_0x378a3c=_0x378a3c-0x19c;const _0x56e72a=a0_0x56e7();let _0x2e276e=_0x56e72a[_0x378a3c];return _0x2e276e;}class T extends a0_0x53a30d{[a0_0x14650b(0x1ea)];[a0_0x14650b(0x1df)];['token'];['agent'];[a0_0x14650b(0x1af)];[a0_0x14650b(0x1d6)];[a0_0x14650b(0x1dd)];[a0_0x14650b(0x1d7)];[a0_0x14650b(0x1b7)];[a0_0x14650b(0x1b8)]=!0x1;constructor(_0x3ba559){const _0x4fc5d1=a0_0x14650b;super();if(this[_0x4fc5d1(0x1ea)]=_0x3ba559[_0x4fc5d1(0x1ea)][_0x4fc5d1(0x1d8)](/\/$/,''),this['alias']=_0x3ba559[_0x4fc5d1(0x1df)],this[_0x4fc5d1(0x1cb)]=_0x3ba559[_0x4fc5d1(0x1cb)],this[_0x4fc5d1(0x1a9)]=_0x3ba559[_0x4fc5d1(0x1a9)]||'sdk',this['resumeId']=_0x4fc5d1(0x19f)+_0x3ba559[_0x4fc5d1(0x1df)]+'-'+Date[_0x4fc5d1(0x1e6)]()['toString'](0x24),this[_0x4fc5d1(0x1d6)]=_0x3ba559[_0x4fc5d1(0x1d6)]??0x2bf20,this[_0x4fc5d1(0x1dd)]=_0x3ba559[_0x4fc5d1(0x1dd)]??0xbb8,_0x3ba559[_0x4fc5d1(0x1eb)]!==!0x1)this[_0x4fc5d1(0x1ae)]();}[a0_0x14650b(0x1c4)](_0x2501a9){const _0x2217bc=a0_0x14650b;console[_0x2217bc(0x1c4)]('['+new Date()['toTimeString']()[_0x2217bc(0x1d9)](0x0,0x8)+_0x2217bc(0x1c6)+this[_0x2217bc(0x1df)]+']\x20'+_0x2501a9);}async['call'](_0x39c9d7,_0x15756b){const _0x3d61d3=a0_0x14650b;let _0x551591={'Content-Type':_0x3d61d3(0x1e9),'Accept':_0x3d61d3(0x1a7)};if(this[_0x3d61d3(0x1cb)])_0x551591[_0x3d61d3(0x1ec)]=_0x3d61d3(0x1db)+this[_0x3d61d3(0x1cb)];let _0x53c0b9=await(await fetch(this[_0x3d61d3(0x1ea)]+_0x3d61d3(0x1e4),{'method':_0x3d61d3(0x1c9),'headers':_0x551591,'body':JSON['stringify']({'jsonrpc':_0x3d61d3(0x1d3),'id':Date[_0x3d61d3(0x1e6)](),'method':_0x3d61d3(0x1c1),'params':{'name':_0x39c9d7,'arguments':_0x15756b}})}))[_0x3d61d3(0x1cf)](),_0x32e4b1=_0x53c0b9[_0x3d61d3(0x1ba)](/data: (.+)/),_0x1c7ef6=_0x32e4b1?JSON[_0x3d61d3(0x19d)](_0x32e4b1[0x1]):JSON[_0x3d61d3(0x19d)](_0x53c0b9),_0x1d0996=_0x1c7ef6?.[_0x3d61d3(0x1b0)]?.[_0x3d61d3(0x1c7)]?.[0x0]?.[_0x3d61d3(0x1cf)];return _0x1d0996?JSON['parse'](_0x1d0996):_0x1c7ef6;}async[a0_0x14650b(0x1ae)](){const _0x1bf577=a0_0x14650b;if(this['running'])return;this['running']=!0x0,await this[_0x1bf577(0x1bc)]('idle'),this[_0x1bf577(0x1c4)](_0x1bf577(0x1c0)),this[_0x1bf577(0x1d7)]=setInterval(()=>{const _0x49c1a2=_0x1bf577;this[_0x49c1a2(0x1bc)](_0x49c1a2(0x19e))[_0x49c1a2(0x1b1)](_0xf49d0b=>this[_0x49c1a2(0x1c4)]('heartbeat\x20failed:\x20'+_0xf49d0b[_0x49c1a2(0x1e0)]));},this[_0x1bf577(0x1d6)]),this[_0x1bf577(0x1a2)]();}async[a0_0x14650b(0x1a6)](){const _0x2ed5b9=a0_0x14650b;if(this[_0x2ed5b9(0x1b8)]=!0x1,this['sseAbort']?.['abort'](),this[_0x2ed5b9(0x1d7)])clearInterval(this[_0x2ed5b9(0x1d7)]);await this[_0x2ed5b9(0x1bc)](_0x2ed5b9(0x1d2))[_0x2ed5b9(0x1b1)](()=>{}),this[_0x2ed5b9(0x1c4)](_0x2ed5b9(0x1bd));}async['send'](_0x1bfaf4,_0x3beae8,_0x5c40cb=a0_0x14650b(0x1c5)){const _0x1e9331=a0_0x14650b;return this['call'](_0x1e9331(0x1ed),{'alias':_0x1bfaf4,'task':_0x3beae8,'priority':_0x5c40cb,'from_session':this[_0x1e9331(0x1df)]});}async[a0_0x14650b(0x1e0)](_0x224ee2,_0x4f461c){const _0x3e388d=a0_0x14650b;return this[_0x3e388d(0x1dc)](_0x3e388d(0x1c8),{'alias':_0x224ee2,'message':_0x4f461c,'from_session':this[_0x3e388d(0x1df)]});}async[a0_0x14650b(0x1b6)](_0x254aa,_0x4a097f,_0x52c407='completed'){const _0x4980cb=a0_0x14650b;return this[_0x4980cb(0x1dc)]('send_reply',{'in_reply_to':_0x254aa,'text':_0x4a097f,'status':_0x52c407});}async[a0_0x14650b(0x1bc)](_0x32a30a,_0x1d6aff){const _0x23bd3c=a0_0x14650b;return this['call'](_0x23bd3c(0x1bf),{'resume_id':this[_0x23bd3c(0x1af)],'alias':this[_0x23bd3c(0x1df)],'status':_0x32a30a,'server':a0_0x50230c(),'hostname':a0_0x50230c(),'agent':this[_0x23bd3c(0x1a9)],'project_dir':process[_0x23bd3c(0x1b4)](),..._0x1d6aff});}async[a0_0x14650b(0x1a3)](){const _0x4227c0=a0_0x14650b;return this[_0x4227c0(0x1dc)](_0x4227c0(0x1ad),{});}async['broadcast'](_0x1c0388,_0x2bf8e2){const _0x184501=a0_0x14650b;return this[_0x184501(0x1dc)](_0x184501(0x1b3),{'message':_0x1c0388,'filter_server':_0x2bf8e2?.[_0x184501(0x1a1)],'filter_status':_0x2bf8e2?.[_0x184501(0x1bc)]});}async['connectSSE'](){const _0x540e85=a0_0x14650b;let _0x25bdc0=encodeURIComponent(this[_0x540e85(0x1df)]),_0x4b1315=this[_0x540e85(0x1ea)]+_0x540e85(0x1bb)+_0x25bdc0,_0x20a1f0=this[_0x540e85(0x1dd)];while(this[_0x540e85(0x1b8)]){try{this[_0x540e85(0x1b7)]=new AbortController();let _0x831b13={'Accept':_0x540e85(0x1d1)};if(this[_0x540e85(0x1cb)])_0x831b13[_0x540e85(0x1ec)]='Bearer\x20'+this[_0x540e85(0x1cb)];let _0x3eaf9d=await fetch(_0x4b1315,{'headers':_0x831b13,'signal':this['sseAbort'][_0x540e85(0x1aa)]});if(!_0x3eaf9d['ok']||!_0x3eaf9d[_0x540e85(0x1e8)]){this[_0x540e85(0x1c4)]('SSE\x20failed:\x20'+_0x3eaf9d[_0x540e85(0x1bc)]),await this[_0x540e85(0x1c2)](_0x20a1f0),_0x20a1f0=Math[_0x540e85(0x1d4)](_0x20a1f0*1.5,0xea60);continue;}_0x20a1f0=this[_0x540e85(0x1dd)];let _0x3aab98=_0x3eaf9d[_0x540e85(0x1e8)]['getReader'](),_0xd38df2=new TextDecoder(),_0x1a0a58='';while(this[_0x540e85(0x1b8)]){let {done:_0x52a477,value:_0x6f047e}=await _0x3aab98['read']();if(_0x52a477)break;_0x1a0a58+=_0xd38df2[_0x540e85(0x1de)](_0x6f047e,{'stream':!0x0});let _0x104122=_0x1a0a58['split']('\x0a');_0x1a0a58=_0x104122[_0x540e85(0x1ca)]()||'';for(let _0x52d86b of _0x104122){if(!_0x52d86b[_0x540e85(0x1ac)]('data:\x20'))continue;try{let _0xb31fb7=JSON[_0x540e85(0x19d)](_0x52d86b[_0x540e85(0x1d9)](0x6));if(_0xb31fb7[_0x540e85(0x1e2)]===_0x540e85(0x1a5)){this[_0x540e85(0x1c4)](_0x540e85(0x1da)),this[_0x540e85(0x1a0)]('connected');continue;}if(_0xb31fb7['type']==='new_task'||_0xb31fb7[_0x540e85(0x1e2)]==='new_message'||_0xb31fb7['type']===_0x540e85(0x1b3))await this['processInbox']();}catch{}}}}catch(_0x172016){if(_0x172016[_0x540e85(0x1e5)]===_0x540e85(0x1e1))break;this[_0x540e85(0x1a0)](_0x540e85(0x1b2),_0x172016),this['log'](_0x540e85(0x1b5)+_0x172016[_0x540e85(0x1e0)]);}if(this[_0x540e85(0x1b8)])this[_0x540e85(0x1a0)](_0x540e85(0x1bd)),this[_0x540e85(0x1c4)]('SSE\x20reconnecting\x20in\x20'+_0x20a1f0/0x3e8+'s...'),await this[_0x540e85(0x1c2)](_0x20a1f0),_0x20a1f0=Math[_0x540e85(0x1d4)](_0x20a1f0*1.5,0xea60);}}async[a0_0x14650b(0x1e7)](){const _0x183c4b=a0_0x14650b;try{let _0x3757ad=(await this[_0x183c4b(0x1dc)](_0x183c4b(0x1be),{'alias':this[_0x183c4b(0x1df)],'limit':0xa}))?.['messages']||[];for(let _0x41fa0f of _0x3757ad)await this[_0x183c4b(0x1dc)](_0x183c4b(0x1cc),{'alias':this['alias'],'message_id':_0x41fa0f['id']}),this[_0x183c4b(0x1c4)]('←\x20'+_0x41fa0f[_0x183c4b(0x1a8)]+':\x20'+_0x41fa0f[_0x183c4b(0x1c7)]['slice'](0x0,0x3c)),this[_0x183c4b(0x1a0)](_0x183c4b(0x1ce),_0x41fa0f),this[_0x183c4b(0x1a0)]('message',_0x41fa0f);}catch(_0xac2e83){this[_0x183c4b(0x1c4)]('inbox\x20error:\x20'+_0xac2e83[_0x183c4b(0x1e0)]);}}[a0_0x14650b(0x1c2)](_0x25d603){return new Promise(_0xd5fb4c=>setTimeout(_0xd5fb4c,_0x25d603));}}var $=T;export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x48b9d3=a0_0x194b;(function(_0x3bfcd6,_0x209a7f){const _0x540da7=a0_0x194b,_0x554ce9=_0x3bfcd6();while(!![]){try{const _0x3510a3=-parseInt(_0x540da7(0x23a))/0x1+-parseInt(_0x540da7(0x226))/0x2+parseInt(_0x540da7(0x241))/0x3+-parseInt(_0x540da7(0x243))/0x4+parseInt(_0x540da7(0x1dc))/0x5*(parseInt(_0x540da7(0x221))/0x6)+parseInt(_0x540da7(0x1e6))/0x7+parseInt(_0x540da7(0x251))/0x8;if(_0x3510a3===_0x209a7f)break;else _0x554ce9['push'](_0x554ce9['shift']());}catch(_0xa350ff){_0x554ce9['push'](_0x554ce9['shift']());}}}(a0_0x38ef,0x8ed43));import{readFileSync as a0_0x5de7be,existsSync as a0_0x540d33}from'fs';import{randomUUID as a0_0x1b06e1}from'crypto';import{join as a0_0x551c08}from'path';import{hostname as a0_0x9d3687}from'os';import{execSync as a0_0x119dce}from'child_process';import{Server as a0_0x4b1c55}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x1b48fa}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x456e9a,CallToolRequestSchema as a0_0x1e6ad6}from'@modelcontextprotocol/sdk/types.js';function p(_0x5a9704){const _0x56d57d=a0_0x194b;if(!a0_0x540d33(_0x5a9704))return;for(let _0x387268 of a0_0x5de7be(_0x5a9704,_0x56d57d(0x210))[_0x56d57d(0x22e)]('\x0a')){let _0x34a581=_0x387268['trim']();if(!_0x34a581||_0x34a581[_0x56d57d(0x203)]('#'))continue;let _0x255c50=_0x34a581[_0x56d57d(0x1e2)]('=');if(_0x255c50<0x0)continue;let _0x53c75b=_0x34a581[_0x56d57d(0x21f)](0x0,_0x255c50)['trim'](),_0x104260=_0x34a581[_0x56d57d(0x21f)](_0x255c50+0x1)[_0x56d57d(0x23c)]()[_0x56d57d(0x24a)](/^["']|["']$/g,'');if(!process.env[_0x53c75b])process.env[_0x53c75b]=_0x104260;}}var C=process.env.HOME||'~',T=a0_0x551c08(C,a0_0x48b9d3(0x1fb));p(a0_0x551c08(T,a0_0x48b9d3(0x222)));var L=process[a0_0x48b9d3(0x24e)]()[a0_0x48b9d3(0x24a)](/\//g,'-');p(a0_0x551c08(T,L,a0_0x48b9d3(0x222)));function U(){const _0x4d4c2c=a0_0x48b9d3;try{return a0_0x119dce('tmux\x20display-message\x20-p\x20\x27#S\x27',{'encoding':_0x4d4c2c(0x210),'timeout':0x7d0})[_0x4d4c2c(0x23c)]();}catch{return'';}}function v(){const _0x2e48f3=a0_0x48b9d3;try{let _0x388367=a0_0x551c08(C,_0x2e48f3(0x248),_0x2e48f3(0x24c));if(a0_0x540d33(_0x388367))return JSON['parse'](a0_0x5de7be(_0x388367,'utf-8'));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x48b9d3(0x200)]||'http://127.0.0.1:9200',j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x9d3687(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x1b06e1(),X=process.env.COMMHUB_TOKEN||H['token']||'';function Y(_0x3e0c55){const _0x27dc2f=a0_0x48b9d3;let _0x5ef037=new Date()[_0x27dc2f(0x204)]()[_0x27dc2f(0x21f)](0x0,0x8);process['stderr'][_0x27dc2f(0x23b)]('['+_0x5ef037+_0x27dc2f(0x214)+_0x3e0c55+'\x0a');}function h(_0x1253d6){return new Promise(_0x3e647d=>setTimeout(_0x3e647d,_0x1253d6));}Y(a0_0x48b9d3(0x218)+f+a0_0x48b9d3(0x236)+Z+'\x20RESUME_ID='+w[a0_0x48b9d3(0x21f)](0x0,0x8)+a0_0x48b9d3(0x1f5)+(j||a0_0x48b9d3(0x1e1))+a0_0x48b9d3(0x256)+process['cwd']()+a0_0x48b9d3(0x1e0)+L);var k=new Map(),K=new a0_0x4b1c55({'name':a0_0x48b9d3(0x20e),'version':a0_0x48b9d3(0x252)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x48b9d3(0x21b),'These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.',a0_0x48b9d3(0x206),'Session\x20alias:\x20'+Z][a0_0x48b9d3(0x247)]('\x0a')});K[a0_0x48b9d3(0x216)](a0_0x456e9a,async()=>({'tools':[{'name':a0_0x48b9d3(0x1e4),'description':a0_0x48b9d3(0x1e3),'inputSchema':{'type':a0_0x48b9d3(0x225),'properties':{'task_id':{'type':a0_0x48b9d3(0x257),'description':'The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)'},'text':{'type':a0_0x48b9d3(0x257),'description':'Reply\x20text\x20/\x20result\x20summary'},'status':{'type':'string','enum':[a0_0x48b9d3(0x1f2),a0_0x48b9d3(0x21a),a0_0x48b9d3(0x217),'blocked','error','in_progress'],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':[a0_0x48b9d3(0x1ec)]}},{'name':a0_0x48b9d3(0x220),'description':a0_0x48b9d3(0x233),'inputSchema':{'type':a0_0x48b9d3(0x225),'properties':{'status':{'type':a0_0x48b9d3(0x257),'enum':['working',a0_0x48b9d3(0x1d9),'blocked','error']},'task':{'type':a0_0x48b9d3(0x257),'description':a0_0x48b9d3(0x1f9)},'progress':{'type':a0_0x48b9d3(0x1ef),'description':a0_0x48b9d3(0x25d)}},'required':[a0_0x48b9d3(0x22a)]}},{'name':a0_0x48b9d3(0x227),'description':a0_0x48b9d3(0x229),'inputSchema':{'type':a0_0x48b9d3(0x225),'properties':{'alias':{'type':a0_0x48b9d3(0x257),'description':a0_0x48b9d3(0x1ea)},'task':{'type':a0_0x48b9d3(0x257),'description':'Task\x20content'},'priority':{'type':a0_0x48b9d3(0x257),'enum':['high',a0_0x48b9d3(0x23f),a0_0x48b9d3(0x1de)],'description':a0_0x48b9d3(0x230)}},'required':['alias','task']}},{'name':a0_0x48b9d3(0x207),'description':a0_0x48b9d3(0x1f8),'inputSchema':{'type':a0_0x48b9d3(0x225),'properties':{'alias':{'type':'string','description':a0_0x48b9d3(0x1ea)},'message':{'type':'string','description':a0_0x48b9d3(0x208)}},'required':[a0_0x48b9d3(0x20f),a0_0x48b9d3(0x234)]}},{'name':a0_0x48b9d3(0x1f4),'description':a0_0x48b9d3(0x240),'inputSchema':{'type':'object','properties':{}}}]}));async function P(_0x2ca8d4,_0x20d565){const _0x346e6b=a0_0x48b9d3;let _0x57c985=await fetch(f+_0x346e6b(0x223),{'method':_0x346e6b(0x1db),'headers':{'Content-Type':_0x346e6b(0x20d),'Accept':_0x346e6b(0x1eb),...X?{'Authorization':_0x346e6b(0x205)+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x346e6b(0x239),'id':0x1,'method':'initialize','params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x346e6b(0x20e),'version':'0.3.0'}}})});if(!_0x57c985['ok']){let _0x1fd4f1=await _0x57c985[_0x346e6b(0x1ec)]();return Y(_0x346e6b(0x22b)+_0x57c985[_0x346e6b(0x22a)]+'\x20'+_0x1fd4f1['slice'](0x0,0x64)),{'ok':!0x1,'error':_0x346e6b(0x259)+_0x57c985[_0x346e6b(0x22a)]};}await _0x57c985[_0x346e6b(0x1ec)]();let _0x1ba636=(await(await fetch(f+_0x346e6b(0x223),{'method':_0x346e6b(0x1db),'headers':{'Content-Type':'application/json','Accept':_0x346e6b(0x1eb),...X?{'Authorization':_0x346e6b(0x205)+X}:{}},'body':JSON[_0x346e6b(0x25b)]({'jsonrpc':_0x346e6b(0x239),'id':0x2,'method':_0x346e6b(0x1e7),'params':{'name':_0x2ca8d4,'arguments':_0x20d565}})}))[_0x346e6b(0x1ec)]())[_0x346e6b(0x22e)]('\x0a')[_0x346e6b(0x1df)](_0x11e71e=>_0x11e71e[_0x346e6b(0x203)]('data:\x20'));if(_0x1ba636){let _0x44b122=JSON[_0x346e6b(0x22f)](_0x1ba636[_0x346e6b(0x21f)](0x6));return _0x44b122?.['result']?.[_0x346e6b(0x258)]?.[0x0]?.[_0x346e6b(0x1ec)]?JSON[_0x346e6b(0x22f)](_0x44b122[_0x346e6b(0x231)][_0x346e6b(0x258)][0x0]['text']):_0x44b122;}return{'ok':!0x1,'error':_0x346e6b(0x1f0)};}K[a0_0x48b9d3(0x216)](a0_0x1e6ad6,async _0x3c9440=>{const _0x1476bf=a0_0x48b9d3;let {name:_0x36ceec,arguments:_0x4d402e}=_0x3c9440[_0x1476bf(0x20c)];if(_0x36ceec===_0x1476bf(0x1e4)){let {task_id:_0x423cbc,text:_0x12b6f0,status:_0x586175}=_0x4d402e;if(_0x586175===_0x1476bf(0x1f2)||_0x586175===_0x1476bf(0x21a)||_0x586175===_0x1476bf(0x217)){let _0x41fb93=_0x586175===_0x1476bf(0x1f2)?_0x1476bf(0x24f):_0x586175,_0xde1c3a=_0x423cbc?k[_0x1476bf(0x1fe)](_0x423cbc)||_0x1476bf(0x200):'hub',_0x26aa70=await P(_0x1476bf(0x219),{'alias':_0xde1c3a,'text':_0x12b6f0,'in_reply_to':_0x423cbc||void 0x0,'status':_0x41fb93,'from_session':Z});if(_0x423cbc)k[_0x1476bf(0x1f6)](_0x423cbc);return{'content':[{'type':'text','text':JSON['stringify'](_0x26aa70)}]};}let _0x50aecb=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x586175===_0x1476bf(0x202)?_0x1476bf(0x202):_0x586175===_0x1476bf(0x22d)?'error':_0x1476bf(0x21c),'task':_0x12b6f0[_0x1476bf(0x21f)](0x0,0xc8),'output':_0x12b6f0});return{'content':[{'type':_0x1476bf(0x1ec),'text':JSON[_0x1476bf(0x25b)](_0x50aecb)}]};}if(_0x36ceec===_0x1476bf(0x220)){let {status:_0x54c963,task:_0x1c4cdd,progress:_0x34ea44}=_0x4d402e,_0x140fa3=await P(_0x1476bf(0x232),{'resume_id':w,'alias':Z,'status':_0x54c963,'task':_0x1c4cdd,'progress':_0x34ea44});return{'content':[{'type':_0x1476bf(0x1ec),'text':JSON[_0x1476bf(0x25b)](_0x140fa3)}]};}if(_0x36ceec==='commhub_send_task'){let {alias:_0x4ac086,task:_0x3e6e57,priority:_0x34c915}=_0x4d402e,_0x2c0bb0=await P(_0x1476bf(0x1fd),{'alias':_0x4ac086,'task':_0x3e6e57,'priority':_0x34c915||_0x1476bf(0x23f),'from_session':Z});return{'content':[{'type':_0x1476bf(0x1ec),'text':JSON[_0x1476bf(0x25b)](_0x2c0bb0)}]};}if(_0x36ceec==='commhub_send_message'){let {alias:_0x453831,message:_0x28650e}=_0x4d402e,_0x57c1fc=await P('send_message',{'alias':_0x453831,'message':_0x28650e,'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x1476bf(0x25b)](_0x57c1fc)}]};}if(_0x36ceec===_0x1476bf(0x1f4)){let _0x201747=await P('get_all_status',{});return{'content':[{'type':_0x1476bf(0x1ec),'text':JSON[_0x1476bf(0x25b)](_0x201747)}]};}return{'content':[{'type':'text','text':JSON['stringify']({'error':'unknown\x20tool'})}]};});function a0_0x194b(_0x4dbdff,_0x10e22a){_0x4dbdff=_0x4dbdff-0x1d9;const _0x38ef6c=a0_0x38ef();let _0x194ba0=_0x38ef6c[_0x4dbdff];return _0x194ba0;}async function u(){const _0x3a14fd=a0_0x48b9d3;let _0x56c3bd=f+'/events/'+encodeURIComponent(Z),_0x4555b5={};if(X)_0x4555b5[_0x3a14fd(0x211)]='Bearer\x20'+X;Y(_0x3a14fd(0x24b)+_0x56c3bd);while(!0x0){try{let _0x368968=await fetch(_0x56c3bd,{'headers':_0x4555b5});if(!_0x368968['ok']){Y('SSE\x20error:\x20'+_0x368968[_0x3a14fd(0x22a)]+'\x20'+_0x368968[_0x3a14fd(0x209)]),await h(0x1388);continue;}let _0x282255=_0x368968[_0x3a14fd(0x253)]['getReader'](),_0x4eaba5=new TextDecoder(),_0x47e716='';while(!0x0){let {done:_0x5c952a,value:_0x460598}=await _0x282255[_0x3a14fd(0x1fc)]();if(_0x5c952a)break;_0x47e716+=_0x4eaba5['decode'](_0x460598,{'stream':!0x0});let _0x5b79b0=_0x47e716[_0x3a14fd(0x22e)]('\x0a\x0a');_0x47e716=_0x5b79b0[_0x3a14fd(0x235)]()||'';for(let _0x37a414 of _0x5b79b0){let _0x494c11=_0x37a414[_0x3a14fd(0x22e)]('\x0a')[_0x3a14fd(0x1df)](_0x47a8c4=>_0x47a8c4[_0x3a14fd(0x203)](_0x3a14fd(0x1f7)));if(!_0x494c11)continue;try{let _0x4d39fc=JSON[_0x3a14fd(0x22f)](_0x494c11[_0x3a14fd(0x21f)](0x6));await S(_0x4d39fc);}catch(_0x2c121b){Y(_0x3a14fd(0x1f1)+_0x2c121b);}}}Y(_0x3a14fd(0x1ff));}catch(_0x4fd87d){Y('SSE\x20connection\x20error:\x20'+_0x4fd87d);}await h(0xbb8);}}function a0_0x38ef(){const _0x150711=['.anet','notification','replace','connecting\x20to\x20','config.json','fatal:\x20','cwd','replied','heartbeat\x20failed:\x20','5792232BGmWCk','0.3.0','body','end','from','\x20CWD=','string','content','init\x20failed:\x20','claude-code','stringify','SSE\x20fatal:\x20','Progress\x200-100','type','idle','catch','POST','5TbCyPX','exit','low','find','\x20PROJECT_ENV=','none','indexOf','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','commhub_reply','ready\x20—\x20waiting\x20for\x20events','2122484SkFALo','tools/call','inbox_count','set','Target\x20session\x20alias','application/json,\x20text/event-stream','text','messages','broadcast','number','no\x20response','parse\x20error:\x20','completed','message_id','commhub_get_all_status','...\x20TMUX=','delete','data:\x20','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','Current\x20task\x20description','commhub','.claude/channels/commhub','read','send_task','get','SSE\x20stream\x20ended,\x20reconnecting...','hub','session\x20disconnected','blocked','startsWith','toTimeString','Bearer\x20','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','commhub_send_message','Message\x20content','statusText','notifications/claude/channel','connect','params','application/json','commhub-channel','alias','utf-8','Authorization','connected','stdin',']\x20[commhub]\x20','registered\x20as\x20\x22','setRequestHandler','cancelled','ENV:\x20URL=','send_reply','failed','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','working','new_task','\x22\x20(','slice','commhub_report_status','5323062RaUUAh','.env','/mcp','offline','object','332388ooGrck','commhub_send_task','priority','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','status','CommHub\x20init\x20failed:\x20','ack_inbox','error','split','parse','Priority\x20(default:\x20normal)','result','report_status','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','message','pop','\x20ALIAS=','\x20priority=','\x20from\x20','2.0','982074kOCqIi','write','trim','SIGINT',':\x20inbox_count=','normal','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','2745303ZAxrvk','→\x20injected\x20task\x20','4384896dAoalU','MCP\x20stdio\x20connected','SIGTERM','from_session','join'];a0_0x38ef=function(){return _0x150711;};return a0_0x38ef();}async function S(_0x574dce){const _0xbb02a2=a0_0x48b9d3;if(_0x574dce[_0xbb02a2(0x25e)]===_0xbb02a2(0x212)){Y('SSE\x20connected\x20as\x20\x22'+Z+'\x22');return;}if(_0x574dce[_0xbb02a2(0x25e)]==='new_message'){if(Y('←\x20message\x20from\x20'+_0x574dce[_0xbb02a2(0x255)]+':\x20'+_0x574dce['message'][_0xbb02a2(0x21f)](0x0,0x3c)),await K[_0xbb02a2(0x249)]({'method':_0xbb02a2(0x20a),'params':{'content':_0x574dce['message'],'meta':{'sender':_0x574dce[_0xbb02a2(0x255)]||'hub','sender_id':_0xbb02a2(0x1fa),'user':_0x574dce[_0xbb02a2(0x255)]||'hub','priority':_0xbb02a2(0x23f)}}}),_0x574dce[_0xbb02a2(0x1f3)])await P(_0xbb02a2(0x22c),{'alias':Z,'message_id':_0x574dce[_0xbb02a2(0x1f3)]});return;}if(_0x574dce[_0xbb02a2(0x25e)]===_0xbb02a2(0x21d)||_0x574dce[_0xbb02a2(0x25e)]===_0xbb02a2(0x1ee)){Y('←\x20'+_0x574dce[_0xbb02a2(0x25e)]+_0xbb02a2(0x23e)+_0x574dce[_0xbb02a2(0x1e8)]+_0xbb02a2(0x237)+(_0x574dce['priority']||_0xbb02a2(0x23f)));let _0xe61478=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0xe61478?.['ok']&&_0xe61478['messages']?.['length']>0x0)for(let _0x47ef02 of _0xe61478[_0xbb02a2(0x1ed)]){let _0x4e4745={'sender':_0x47ef02[_0xbb02a2(0x246)]||_0xbb02a2(0x200),'sender_id':'commhub','user':_0x47ef02[_0xbb02a2(0x246)]||_0xbb02a2(0x200),'task_id':_0x47ef02['id'],'priority':_0x47ef02[_0xbb02a2(0x228)]||_0xbb02a2(0x23f)};k[_0xbb02a2(0x1e9)](_0x47ef02['id'],_0x47ef02['from_session']||_0xbb02a2(0x200)),await K[_0xbb02a2(0x249)]({'method':_0xbb02a2(0x20a),'params':{'content':_0x47ef02['content'],'meta':_0x4e4745}}),Y(_0xbb02a2(0x242)+_0x47ef02['id'][_0xbb02a2(0x21f)](0x0,0x8)+_0xbb02a2(0x238)+_0x47ef02[_0xbb02a2(0x246)]+':\x20'+_0x47ef02['content'][_0xbb02a2(0x21f)](0x0,0x3c)),await P(_0xbb02a2(0x22c),{'alias':Z,'message_id':_0x47ef02['id']});}}}async function A(){const _0x2992a3=a0_0x48b9d3;let _0x23c592=new a0_0x1b48fa();await K[_0x2992a3(0x20b)](_0x23c592),Y(_0x2992a3(0x244)),Y('starting\x20SSE\x20listener...'),u()[_0x2992a3(0x1da)](_0x31ef47=>Y(_0x2992a3(0x25c)+_0x31ef47)),P('report_status',{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x9d3687(),'hostname':a0_0x9d3687(),'agent':_0x2992a3(0x25a),'project_dir':process[_0x2992a3(0x24e)](),'tmux_name':j||void 0x0})['then'](()=>Y(_0x2992a3(0x215)+Z+_0x2992a3(0x21e)+w[_0x2992a3(0x21f)](0x0,0x8)+')'))[_0x2992a3(0x1da)](_0x5c7152=>Y('warning:\x20could\x20not\x20register:\x20'+_0x5c7152)),setInterval(()=>{const _0x1b6695=_0x2992a3;P(_0x1b6695(0x232),{'resume_id':w,'alias':Z,'status':_0x1b6695(0x1d9),'server':a0_0x9d3687(),'hostname':a0_0x9d3687(),'agent':'claude-code','project_dir':process[_0x1b6695(0x24e)](),'tmux_name':j||void 0x0})[_0x1b6695(0x1da)](_0xce11bc=>Y(_0x1b6695(0x250)+_0xce11bc));},0x2bf20),Y(_0x2992a3(0x1e5));}A()[a0_0x48b9d3(0x1da)](_0x55932a=>{const _0x4e693e=a0_0x48b9d3;Y(_0x4e693e(0x24d)+_0x55932a),process['exit'](0x1);});async function N(){const _0x3c3296=a0_0x48b9d3;Y('shutting\x20down,\x20reporting\x20offline...'),await P(_0x3c3296(0x232),{'resume_id':w,'alias':Z,'status':_0x3c3296(0x224),'task':_0x3c3296(0x201)})[_0x3c3296(0x1da)](()=>{}),process[_0x3c3296(0x1dd)](0x0);}process[a0_0x48b9d3(0x213)]['on'](a0_0x48b9d3(0x254),()=>N()),process['on'](a0_0x48b9d3(0x245),()=>N()),process['on'](a0_0x48b9d3(0x23d),()=>N());
2
+ const a0_0x37cb7e=a0_0x1c7b;(function(_0x2d7b79,_0x118d4e){const _0x10c8fa=a0_0x1c7b,_0x23cc5a=_0x2d7b79();while(!![]){try{const _0x515586=parseInt(_0x10c8fa(0x124))/0x1+parseInt(_0x10c8fa(0x12c))/0x2+parseInt(_0x10c8fa(0xc7))/0x3+-parseInt(_0x10c8fa(0xf8))/0x4*(-parseInt(_0x10c8fa(0xaf))/0x5)+parseInt(_0x10c8fa(0xde))/0x6+-parseInt(_0x10c8fa(0x136))/0x7*(-parseInt(_0x10c8fa(0xca))/0x8)+-parseInt(_0x10c8fa(0xf9))/0x9;if(_0x515586===_0x118d4e)break;else _0x23cc5a['push'](_0x23cc5a['shift']());}catch(_0x52ecda){_0x23cc5a['push'](_0x23cc5a['shift']());}}}(a0_0x19f0,0xb5876));import{readFileSync as a0_0x19be25,existsSync as a0_0x4207c0}from'fs';import{randomUUID as a0_0x257498}from'crypto';import{join as a0_0xeb64c0}from'path';import{hostname as a0_0x3fa119}from'os';import{execSync as a0_0x6471b4}from'child_process';import{Server as a0_0x5455e6}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x443ce5}from'@modelcontextprotocol/sdk/server/stdio.js';function a0_0x1c7b(_0x3e0582,_0x4484d2){_0x3e0582=_0x3e0582-0xaf;const _0x19f071=a0_0x19f0();let _0x1c7b52=_0x19f071[_0x3e0582];return _0x1c7b52;}import{ListToolsRequestSchema as a0_0x5e10e6,CallToolRequestSchema as a0_0x3c43ab}from'@modelcontextprotocol/sdk/types.js';function p(_0x31675b){const _0x332b44=a0_0x1c7b;if(!a0_0x4207c0(_0x31675b))return;for(let _0xd0193e of a0_0x19be25(_0x31675b,_0x332b44(0xf5))['split']('\x0a')){let _0x242b3b=_0xd0193e[_0x332b44(0x133)]();if(!_0x242b3b||_0x242b3b[_0x332b44(0x117)]('#'))continue;let _0xae4739=_0x242b3b['indexOf']('=');if(_0xae4739<0x0)continue;let _0x3915b3=_0x242b3b[_0x332b44(0x126)](0x0,_0xae4739)['trim'](),_0x29f40a=_0x242b3b[_0x332b44(0x126)](_0xae4739+0x1)['trim']()[_0x332b44(0xeb)](/^["']|["']$/g,'');if(!process.env[_0x3915b3])process.env[_0x3915b3]=_0x29f40a;}}var C=process.env.HOME||'~',T=a0_0xeb64c0(C,a0_0x37cb7e(0xb0));p(a0_0xeb64c0(T,a0_0x37cb7e(0xc5)));var L=process[a0_0x37cb7e(0xcf)]()[a0_0x37cb7e(0xeb)](/\//g,'-');p(a0_0xeb64c0(T,L,a0_0x37cb7e(0xc5)));function U(){const _0x1816b9=a0_0x37cb7e;try{return a0_0x6471b4(_0x1816b9(0x128),{'encoding':_0x1816b9(0xf5),'timeout':0x7d0})[_0x1816b9(0x133)]();}catch{return'';}}function a0_0x19f0(){const _0xcfb6d4=['shutting\x20down,\x20reporting\x20offline...','\x22\x20(','/mcp','.env','setRequestHandler','1515045CHJRzC','inbox_count','fatal:\x20','3152MAiuan','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','high','initialize','task','cwd','alias','http://127.0.0.1:9200','\x20from\x20','application/json','commhub_get_all_status','blocked','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','0.3.0','commhub_report_status','ready\x20—\x20waiting\x20for\x20events','messages','ENV:\x20URL=','Priority\x20(default:\x20normal)','notifications/claude/channel','3510870CXoXpx','from','POST','none',':\x20inbox_count=','commhub_reply','set','tools/call','split','SIGINT','ack_inbox','SIGTERM','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','replace','Progress\x200-100','.anet','message','Message\x20content','decode','string','new_task','send_message','cancelled','utf-8','pop','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','188JqFbRn','34329879yEzYWL','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','SSE\x20connected\x20as\x20\x22','send_task','low','claude-code','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','result','toTimeString','catch','type','params','application/json,\x20text/event-stream','report_status','Target\x20session\x20alias','Bearer\x20','warning:\x20could\x20not\x20register:\x20','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','object','stringify','text','message_id','Session\x20alias:\x20','Current\x20task\x20description','Reply\x20text\x20/\x20result\x20summary','\x20ALIAS=','commhub_send_task','delete','broadcast','idle','startsWith','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','find','replied','get','no\x20response','stdin','commhub','in_progress','SSE\x20stream\x20ended,\x20reconnecting...','working','init\x20failed:\x20','\x20RESUME_ID=','953263XnnGPR','\x20PROJECT_ENV=','slice','error','tmux\x20display-message\x20-p\x20\x27#S\x27','status','heartbeat\x20failed:\x20','commhub-channel','1791192WUhgxt','←\x20message\x20from\x20','commhub_send_message','data:\x20','normal','CommHub\x20init\x20failed:\x20','stderr','trim','2.0','SSE\x20fatal:\x20','4676equgbl','SSE\x20error:\x20','get_inbox','hub','MCP\x20stdio\x20connected','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','content','144230aZgZxo','.claude/channels/commhub','body','failed','token','2025-03-26','from_session','\x20CWD=','offline','read','priority','connecting\x20to\x20','unknown\x20tool','join','completed','\x20priority=','exit','parse','SSE\x20connection\x20error:\x20'];a0_0x19f0=function(){return _0xcfb6d4;};return a0_0x19f0();}function v(){const _0x1cb6cf=a0_0x37cb7e;try{let _0xf2f674=a0_0xeb64c0(C,_0x1cb6cf(0xed),'config.json');if(a0_0x4207c0(_0xf2f674))return JSON[_0x1cb6cf(0xc0)](a0_0x19be25(_0xf2f674,_0x1cb6cf(0xf5)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x37cb7e(0x139)]||a0_0x37cb7e(0xd1),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x3fa119(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x257498(),X=process.env.COMMHUB_TOKEN||H[a0_0x37cb7e(0xb3)]||'';function Y(_0x56b31b){const _0xdcbaff=a0_0x37cb7e;let _0x553cbb=new Date()[_0xdcbaff(0x101)]()['slice'](0x0,0x8);process[_0xdcbaff(0x132)]['write']('['+_0x553cbb+']\x20[commhub]\x20'+_0x56b31b+'\x0a');}function h(_0x3d91c5){return new Promise(_0x591fd4=>setTimeout(_0x591fd4,_0x3d91c5));}Y(a0_0x37cb7e(0xdb)+f+a0_0x37cb7e(0x112)+Z+a0_0x37cb7e(0x123)+w[a0_0x37cb7e(0x126)](0x0,0x8)+'...\x20TMUX='+(j||a0_0x37cb7e(0xe1))+a0_0x37cb7e(0xb6)+process[a0_0x37cb7e(0xcf)]()+a0_0x37cb7e(0x125)+L);var k=new Map(),K=new a0_0x5455e6({'name':a0_0x37cb7e(0x12b),'version':'0.3.0'},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x37cb7e(0xea),a0_0x37cb7e(0x10a),a0_0x37cb7e(0xcb),'You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.',a0_0x37cb7e(0x10f)+Z][a0_0x37cb7e(0xbc)]('\x0a')});K[a0_0x37cb7e(0xc6)](a0_0x5e10e6,async()=>({'tools':[{'name':a0_0x37cb7e(0xe3),'description':a0_0x37cb7e(0xff),'inputSchema':{'type':a0_0x37cb7e(0x10b),'properties':{'task_id':{'type':a0_0x37cb7e(0xf1),'description':a0_0x37cb7e(0xfa)},'text':{'type':a0_0x37cb7e(0xf1),'description':a0_0x37cb7e(0x111)},'status':{'type':'string','enum':[a0_0x37cb7e(0xbd),'failed',a0_0x37cb7e(0xf4),'blocked',a0_0x37cb7e(0x127),a0_0x37cb7e(0x11f)],'description':a0_0x37cb7e(0xf7)}},'required':[a0_0x37cb7e(0x10d)]}},{'name':'commhub_report_status','description':a0_0x37cb7e(0xd6),'inputSchema':{'type':a0_0x37cb7e(0x10b),'properties':{'status':{'type':'string','enum':[a0_0x37cb7e(0x121),a0_0x37cb7e(0x116),a0_0x37cb7e(0xd5),'error']},'task':{'type':a0_0x37cb7e(0xf1),'description':a0_0x37cb7e(0x110)},'progress':{'type':'number','description':a0_0x37cb7e(0xec)}},'required':[a0_0x37cb7e(0x129)]}},{'name':'commhub_send_task','description':a0_0x37cb7e(0x13b),'inputSchema':{'type':'object','properties':{'alias':{'type':'string','description':a0_0x37cb7e(0x107)},'task':{'type':a0_0x37cb7e(0xf1),'description':'Task\x20content'},'priority':{'type':'string','enum':[a0_0x37cb7e(0xcc),a0_0x37cb7e(0x130),a0_0x37cb7e(0xfd)],'description':a0_0x37cb7e(0xdc)}},'required':[a0_0x37cb7e(0xd0),a0_0x37cb7e(0xce)]}},{'name':a0_0x37cb7e(0x12e),'description':'Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x37cb7e(0xf1),'description':a0_0x37cb7e(0x107)},'message':{'type':'string','description':a0_0x37cb7e(0xef)}},'required':[a0_0x37cb7e(0xd0),'message']}},{'name':'commhub_get_all_status','description':a0_0x37cb7e(0x118),'inputSchema':{'type':a0_0x37cb7e(0x10b),'properties':{}}}]}));async function P(_0x2bc944,_0x5a7628){const _0x177313=a0_0x37cb7e;let _0x1c3ae0=await fetch(f+_0x177313(0xc4),{'method':_0x177313(0xe0),'headers':{'Content-Type':_0x177313(0xd3),'Accept':_0x177313(0x105),...X?{'Authorization':_0x177313(0x108)+X}:{}},'body':JSON[_0x177313(0x10c)]({'jsonrpc':'2.0','id':0x1,'method':_0x177313(0xcd),'params':{'protocolVersion':_0x177313(0xb4),'capabilities':{},'clientInfo':{'name':_0x177313(0x12b),'version':_0x177313(0xd7)}}})});if(!_0x1c3ae0['ok']){let _0x4b8a13=await _0x1c3ae0[_0x177313(0x10d)]();return Y(_0x177313(0x131)+_0x1c3ae0[_0x177313(0x129)]+'\x20'+_0x4b8a13['slice'](0x0,0x64)),{'ok':!0x1,'error':_0x177313(0x122)+_0x1c3ae0[_0x177313(0x129)]};}await _0x1c3ae0[_0x177313(0x10d)]();let _0x14f795=(await(await fetch(f+_0x177313(0xc4),{'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x177313(0x108)+X}:{}},'body':JSON[_0x177313(0x10c)]({'jsonrpc':_0x177313(0x134),'id':0x2,'method':_0x177313(0xe5),'params':{'name':_0x2bc944,'arguments':_0x5a7628}})}))[_0x177313(0x10d)]())[_0x177313(0xe6)]('\x0a')[_0x177313(0x119)](_0x44efa9=>_0x44efa9['startsWith'](_0x177313(0x12f)));if(_0x14f795){let _0x88c5a8=JSON[_0x177313(0xc0)](_0x14f795[_0x177313(0x126)](0x6));return _0x88c5a8?.['result']?.[_0x177313(0x13c)]?.[0x0]?.[_0x177313(0x10d)]?JSON[_0x177313(0xc0)](_0x88c5a8[_0x177313(0x100)]['content'][0x0][_0x177313(0x10d)]):_0x88c5a8;}return{'ok':!0x1,'error':_0x177313(0x11c)};}K[a0_0x37cb7e(0xc6)](a0_0x3c43ab,async _0x3fc9de=>{const _0x422c73=a0_0x37cb7e;let {name:_0x570750,arguments:_0x32aff6}=_0x3fc9de[_0x422c73(0x104)];if(_0x570750===_0x422c73(0xe3)){let {task_id:_0x5eb973,text:_0x13cd0c,status:_0x3faf63}=_0x32aff6;if(_0x3faf63===_0x422c73(0xbd)||_0x3faf63===_0x422c73(0xb2)||_0x3faf63==='cancelled'){let _0x10380d=_0x3faf63===_0x422c73(0xbd)?_0x422c73(0x11a):_0x3faf63,_0xc3fe3e=_0x5eb973?k[_0x422c73(0x11b)](_0x5eb973)||'hub':_0x422c73(0x139),_0x9dfeda=await P('send_reply',{'alias':_0xc3fe3e,'text':_0x13cd0c,'in_reply_to':_0x5eb973||void 0x0,'status':_0x10380d,'from_session':Z});if(_0x5eb973)k[_0x422c73(0x114)](_0x5eb973);return{'content':[{'type':'text','text':JSON[_0x422c73(0x10c)](_0x9dfeda)}]};}let _0x901b9b=await P(_0x422c73(0x106),{'resume_id':w,'alias':Z,'status':_0x3faf63==='blocked'?'blocked':_0x3faf63===_0x422c73(0x127)?_0x422c73(0x127):_0x422c73(0x121),'task':_0x13cd0c['slice'](0x0,0xc8),'output':_0x13cd0c});return{'content':[{'type':'text','text':JSON[_0x422c73(0x10c)](_0x901b9b)}]};}if(_0x570750===_0x422c73(0xd8)){let {status:_0x28252a,task:_0x554964,progress:_0x4a6eec}=_0x32aff6,_0xade914=await P(_0x422c73(0x106),{'resume_id':w,'alias':Z,'status':_0x28252a,'task':_0x554964,'progress':_0x4a6eec});return{'content':[{'type':_0x422c73(0x10d),'text':JSON[_0x422c73(0x10c)](_0xade914)}]};}if(_0x570750===_0x422c73(0x113)){let {alias:_0x572fbe,task:_0x1aa8a3,priority:_0x4f59a5}=_0x32aff6,_0x2dea79=await P(_0x422c73(0xfc),{'alias':_0x572fbe,'task':_0x1aa8a3,'priority':_0x4f59a5||_0x422c73(0x130),'from_session':Z});return{'content':[{'type':_0x422c73(0x10d),'text':JSON[_0x422c73(0x10c)](_0x2dea79)}]};}if(_0x570750===_0x422c73(0x12e)){let {alias:_0x2ab343,message:_0x38ade4}=_0x32aff6,_0x435fd4=await P(_0x422c73(0xf3),{'alias':_0x2ab343,'message':_0x38ade4,'from_session':Z});return{'content':[{'type':_0x422c73(0x10d),'text':JSON[_0x422c73(0x10c)](_0x435fd4)}]};}if(_0x570750===_0x422c73(0xd4)){let _0x413183=await P('get_all_status',{});return{'content':[{'type':_0x422c73(0x10d),'text':JSON[_0x422c73(0x10c)](_0x413183)}]};}return{'content':[{'type':_0x422c73(0x10d),'text':JSON['stringify']({'error':_0x422c73(0xbb)})}]};});async function u(){const _0x27ae0b=a0_0x37cb7e;let _0x37d7d6=f+'/events/'+encodeURIComponent(Z),_0x2b52b4={};if(X)_0x2b52b4['Authorization']=_0x27ae0b(0x108)+X;Y(_0x27ae0b(0xba)+_0x37d7d6);while(!0x0){try{let _0x2cf27d=await fetch(_0x37d7d6,{'headers':_0x2b52b4});if(!_0x2cf27d['ok']){Y(_0x27ae0b(0x137)+_0x2cf27d[_0x27ae0b(0x129)]+'\x20'+_0x2cf27d['statusText']),await h(0x1388);continue;}let _0x5c2c56=_0x2cf27d[_0x27ae0b(0xb1)]['getReader'](),_0x43af90=new TextDecoder(),_0x4088b3='';while(!0x0){let {done:_0x36c22c,value:_0x448093}=await _0x5c2c56[_0x27ae0b(0xb8)]();if(_0x36c22c)break;_0x4088b3+=_0x43af90[_0x27ae0b(0xf0)](_0x448093,{'stream':!0x0});let _0x5359f8=_0x4088b3[_0x27ae0b(0xe6)]('\x0a\x0a');_0x4088b3=_0x5359f8[_0x27ae0b(0xf6)]()||'';for(let _0x433ca7 of _0x5359f8){let _0x147d88=_0x433ca7['split']('\x0a')[_0x27ae0b(0x119)](_0x52f119=>_0x52f119[_0x27ae0b(0x117)](_0x27ae0b(0x12f)));if(!_0x147d88)continue;try{let _0x4024dc=JSON['parse'](_0x147d88['slice'](0x6));await S(_0x4024dc);}catch(_0x41bae5){Y('parse\x20error:\x20'+_0x41bae5);}}}Y(_0x27ae0b(0x120));}catch(_0x9935ee){Y(_0x27ae0b(0xc1)+_0x9935ee);}await h(0xbb8);}}async function S(_0x1e85d8){const _0x18e385=a0_0x37cb7e;if(_0x1e85d8['type']==='connected'){Y(_0x18e385(0xfb)+Z+'\x22');return;}if(_0x1e85d8['type']==='new_message'){if(Y(_0x18e385(0x12d)+_0x1e85d8[_0x18e385(0xdf)]+':\x20'+_0x1e85d8['message']['slice'](0x0,0x3c)),await K['notification']({'method':'notifications/claude/channel','params':{'content':_0x1e85d8[_0x18e385(0xee)],'meta':{'sender':_0x1e85d8[_0x18e385(0xdf)]||_0x18e385(0x139),'sender_id':_0x18e385(0x11e),'user':_0x1e85d8['from']||_0x18e385(0x139),'priority':'normal'}}}),_0x1e85d8[_0x18e385(0x10e)])await P(_0x18e385(0xe8),{'alias':Z,'message_id':_0x1e85d8[_0x18e385(0x10e)]});return;}if(_0x1e85d8[_0x18e385(0x103)]===_0x18e385(0xf2)||_0x1e85d8[_0x18e385(0x103)]===_0x18e385(0x115)){Y('←\x20'+_0x1e85d8[_0x18e385(0x103)]+_0x18e385(0xe2)+_0x1e85d8[_0x18e385(0xc8)]+_0x18e385(0xbe)+(_0x1e85d8[_0x18e385(0xb9)]||_0x18e385(0x130)));let _0x14c137=await P(_0x18e385(0x138),{'alias':Z,'limit':0x5});if(_0x14c137?.['ok']&&_0x14c137[_0x18e385(0xda)]?.['length']>0x0)for(let _0x5a9685 of _0x14c137[_0x18e385(0xda)]){let _0x265d02={'sender':_0x5a9685['from_session']||'hub','sender_id':_0x18e385(0x11e),'user':_0x5a9685[_0x18e385(0xb5)]||_0x18e385(0x139),'task_id':_0x5a9685['id'],'priority':_0x5a9685[_0x18e385(0xb9)]||_0x18e385(0x130)};k[_0x18e385(0xe4)](_0x5a9685['id'],_0x5a9685[_0x18e385(0xb5)]||_0x18e385(0x139)),await K['notification']({'method':_0x18e385(0xdd),'params':{'content':_0x5a9685['content'],'meta':_0x265d02}}),Y('→\x20injected\x20task\x20'+_0x5a9685['id']['slice'](0x0,0x8)+_0x18e385(0xd2)+_0x5a9685[_0x18e385(0xb5)]+':\x20'+_0x5a9685[_0x18e385(0x13c)][_0x18e385(0x126)](0x0,0x3c)),await P('ack_inbox',{'alias':Z,'message_id':_0x5a9685['id']});}}}async function A(){const _0x186395=a0_0x37cb7e;let _0x55b43a=new a0_0x443ce5();await K['connect'](_0x55b43a),Y(_0x186395(0x13a)),Y('starting\x20SSE\x20listener...'),u()[_0x186395(0x102)](_0x59b151=>Y(_0x186395(0x135)+_0x59b151)),P(_0x186395(0x106),{'resume_id':w,'alias':Z,'status':_0x186395(0x116),'server':a0_0x3fa119(),'hostname':a0_0x3fa119(),'agent':'claude-code','project_dir':process['cwd'](),'tmux_name':j||void 0x0})['then'](()=>Y('registered\x20as\x20\x22'+Z+_0x186395(0xc3)+w[_0x186395(0x126)](0x0,0x8)+')'))['catch'](_0xec6f7d=>Y(_0x186395(0x109)+_0xec6f7d)),setInterval(()=>{const _0x455aa6=_0x186395;P(_0x455aa6(0x106),{'resume_id':w,'alias':Z,'status':_0x455aa6(0x116),'server':a0_0x3fa119(),'hostname':a0_0x3fa119(),'agent':_0x455aa6(0xfe),'project_dir':process[_0x455aa6(0xcf)](),'tmux_name':j||void 0x0})['catch'](_0x1b9a7d=>Y(_0x455aa6(0x12a)+_0x1b9a7d));},0x2bf20),Y(_0x186395(0xd9));}A()['catch'](_0x3692b3=>{const _0x47e034=a0_0x37cb7e;Y(_0x47e034(0xc9)+_0x3692b3),process[_0x47e034(0xbf)](0x1);});async function N(){const _0x359941=a0_0x37cb7e;Y(_0x359941(0xc2)),await P(_0x359941(0x106),{'resume_id':w,'alias':Z,'status':_0x359941(0xb7),'task':'session\x20disconnected'})['catch'](()=>{}),process[_0x359941(0xbf)](0x0);}process[a0_0x37cb7e(0x11d)]['on']('end',()=>N()),process['on'](a0_0x37cb7e(0xe9),()=>N()),process['on'](a0_0x37cb7e(0xe7),()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.2.10-preview.0",
3
+ "version": "2.2.10-preview.1",
4
4
  "description": "AI Agent Network CLI \u2014 Create multi-agent networks with user management, network isolation, and 3 AI runtimes (Claude/Codex/MiniMax). 39 commands.",
5
5
  "type": "module",
6
6
  "main": "dist/src/client.js",