@sleep2agi/agent-network 2.2.9-preview.4 → 2.2.10-preview.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- const a0_0x262dab=a0_0x49b8;(function(_0xc876f1,_0x151658){const _0x21a95a=a0_0x49b8,_0x1f47c2=_0xc876f1();while(!![]){try{const _0x2b2138=parseInt(_0x21a95a(0xfa))/0x1*(-parseInt(_0x21a95a(0xc7))/0x2)+parseInt(_0x21a95a(0xe9))/0x3*(parseInt(_0x21a95a(0xf6))/0x4)+-parseInt(_0x21a95a(0xd2))/0x5+-parseInt(_0x21a95a(0xbe))/0x6+-parseInt(_0x21a95a(0x104))/0x7+-parseInt(_0x21a95a(0x103))/0x8+parseInt(_0x21a95a(0x10b))/0x9;if(_0x2b2138===_0x151658)break;else _0x1f47c2['push'](_0x1f47c2['shift']());}catch(_0x3b43bc){_0x1f47c2['push'](_0x1f47c2['shift']());}}}(a0_0x3a2a,0xeaaa6));function a0_0x3a2a(){const _0xedf85a=['SSE\x20failed:\x20','url','status','reply','connectSSE','s...','application/json,\x20text/event-stream','slice','disconnect','sleep','new_task','now','parse','text','stringify','type','processInbox','send_message','sdk-','from_session','sseAbort','disconnected','84927AZbBSn','getReader','get_inbox','error','body','completed','reconnectDelay','running','heartbeatInterval','text/event-stream','getAllStatus','signal','catch','172fjzehm','send_reply','offline','idle','3334mzEPvc','heartbeat\x20failed:\x20','server','autoConnect','inbox\x20error:\x20','Authorization','connect','alias','broadcast','13036232xUBDjH','11948139WkPknH','agent','POST','pop','ack_inbox','2.0','/events/','57420234vfNqFi',']\x20[commhub:','token','call','1305678QtWelk','SSE\x20connected','toTimeString','SSE\x20error:\x20','SSE\x20reconnecting\x20in\x20','sdk','log','message','send','954XDkZNN','min','read','emit','tools/call','cwd','startsWith','content','messages','abort','heartbeatTimer','7458930CRQkob'];a0_0x3a2a=function(){return _0xedf85a;};return a0_0x3a2a();}import{EventEmitter as a0_0x3958bf}from'events';import{hostname as a0_0x44b136}from'os';function a0_0x49b8(_0x2a918f,_0x27f2e0){_0x2a918f=_0x2a918f-0xbe;const _0x3a2a26=a0_0x3a2a();let _0x49b828=_0x3a2a26[_0x2a918f];return _0x49b828;}class T extends a0_0x3958bf{['url'];[a0_0x262dab(0x101)];[a0_0x262dab(0x10d)];['agent'];['resumeId'];[a0_0x262dab(0xf1)];[a0_0x262dab(0xef)];[a0_0x262dab(0xd1)];['sseAbort'];['running']=!0x1;constructor(_0x277976){const _0x2c7e97=a0_0x262dab;super();if(this[_0x2c7e97(0xd4)]=_0x277976[_0x2c7e97(0xd4)]['replace'](/\/$/,''),this[_0x2c7e97(0x101)]=_0x277976[_0x2c7e97(0x101)],this[_0x2c7e97(0x10d)]=_0x277976[_0x2c7e97(0x10d)],this[_0x2c7e97(0x105)]=_0x277976['agent']||_0x2c7e97(0xc3),this['resumeId']=_0x2c7e97(0xe5)+_0x277976[_0x2c7e97(0x101)]+'-'+Date[_0x2c7e97(0xde)]()['toString'](0x24),this[_0x2c7e97(0xf1)]=_0x277976[_0x2c7e97(0xf1)]??0x2bf20,this[_0x2c7e97(0xef)]=_0x277976[_0x2c7e97(0xef)]??0xbb8,_0x277976[_0x2c7e97(0xfd)]!==!0x1)this[_0x2c7e97(0x100)]();}[a0_0x262dab(0xc4)](_0x39ddc1){const _0x2c49a8=a0_0x262dab;console[_0x2c49a8(0xc4)]('['+new Date()[_0x2c49a8(0xc0)]()['slice'](0x0,0x8)+_0x2c49a8(0x10c)+this[_0x2c49a8(0x101)]+']\x20'+_0x39ddc1);}async[a0_0x262dab(0x10e)](_0x51a304,_0x36c8af){const _0x456595=a0_0x262dab;let _0x4719d7={'Content-Type':'application/json','Accept':_0x456595(0xd9)};if(this[_0x456595(0x10d)])_0x4719d7[_0x456595(0xff)]='Bearer\x20'+this[_0x456595(0x10d)];let _0x360a9c=await(await fetch(this[_0x456595(0xd4)]+'/mcp',{'method':_0x456595(0x106),'headers':_0x4719d7,'body':JSON[_0x456595(0xe1)]({'jsonrpc':_0x456595(0x109),'id':Date['now'](),'method':_0x456595(0xcb),'params':{'name':_0x51a304,'arguments':_0x36c8af}})}))[_0x456595(0xe0)](),_0x29e815=_0x360a9c['match'](/data: (.+)/),_0xd1a188=_0x29e815?JSON[_0x456595(0xdf)](_0x29e815[0x1]):JSON[_0x456595(0xdf)](_0x360a9c),_0x17574b=_0xd1a188?.['result']?.[_0x456595(0xce)]?.[0x0]?.[_0x456595(0xe0)];return _0x17574b?JSON['parse'](_0x17574b):_0xd1a188;}async['connect'](){const _0x285cde=a0_0x262dab;if(this[_0x285cde(0xf0)])return;this['running']=!0x0,await this['status']('idle'),this[_0x285cde(0xc4)]('registered'),this[_0x285cde(0xd1)]=setInterval(()=>{const _0x52d10e=_0x285cde;this['status'](_0x52d10e(0xf9))['catch'](_0x3af473=>this[_0x52d10e(0xc4)](_0x52d10e(0xfb)+_0x3af473[_0x52d10e(0xc5)]));},this[_0x285cde(0xf1)]),this[_0x285cde(0xd7)]();}async[a0_0x262dab(0xdb)](){const _0xe1c9e=a0_0x262dab;if(this[_0xe1c9e(0xf0)]=!0x1,this[_0xe1c9e(0xe7)]?.[_0xe1c9e(0xd0)](),this['heartbeatTimer'])clearInterval(this['heartbeatTimer']);await this[_0xe1c9e(0xd5)](_0xe1c9e(0xf8))[_0xe1c9e(0xf5)](()=>{}),this['log'](_0xe1c9e(0xe8));}async[a0_0x262dab(0xc6)](_0x3ee013,_0x1b31a6,_0x21d1c2='normal'){const _0xd20fba=a0_0x262dab;return this[_0xd20fba(0x10e)]('send_task',{'alias':_0x3ee013,'task':_0x1b31a6,'priority':_0x21d1c2,'from_session':this[_0xd20fba(0x101)]});}async[a0_0x262dab(0xc5)](_0x84de4d,_0x1401a9){const _0x45f6ce=a0_0x262dab;return this[_0x45f6ce(0x10e)](_0x45f6ce(0xe4),{'alias':_0x84de4d,'message':_0x1401a9,'from_session':this[_0x45f6ce(0x101)]});}async[a0_0x262dab(0xd6)](_0x6eff38,_0x4a17fd,_0x1f8aa0=a0_0x262dab(0xee)){const _0x2c2d4f=a0_0x262dab;return this[_0x2c2d4f(0x10e)](_0x2c2d4f(0xf7),{'in_reply_to':_0x6eff38,'text':_0x4a17fd,'status':_0x1f8aa0});}async[a0_0x262dab(0xd5)](_0x2026a5,_0x24f3bc){const _0xad3da7=a0_0x262dab;return this[_0xad3da7(0x10e)]('report_status',{'resume_id':this['resumeId'],'alias':this[_0xad3da7(0x101)],'status':_0x2026a5,'server':a0_0x44b136(),'hostname':a0_0x44b136(),'agent':this[_0xad3da7(0x105)],'project_dir':process[_0xad3da7(0xcc)](),..._0x24f3bc});}async[a0_0x262dab(0xf3)](){return this['call']('get_all_status',{});}async[a0_0x262dab(0x102)](_0x3f49f0,_0x19d1d7){const _0xa04c7f=a0_0x262dab;return this[_0xa04c7f(0x10e)](_0xa04c7f(0x102),{'message':_0x3f49f0,'filter_server':_0x19d1d7?.[_0xa04c7f(0xfc)],'filter_status':_0x19d1d7?.[_0xa04c7f(0xd5)]});}async[a0_0x262dab(0xd7)](){const _0x1fec35=a0_0x262dab;let _0x272312=encodeURIComponent(this[_0x1fec35(0x101)]),_0x335adb=this['url']+_0x1fec35(0x10a)+_0x272312,_0x235dd0=this[_0x1fec35(0xef)];while(this[_0x1fec35(0xf0)]){try{this[_0x1fec35(0xe7)]=new AbortController();let _0x4e3769={'Accept':_0x1fec35(0xf2)};if(this[_0x1fec35(0x10d)])_0x4e3769['Authorization']='Bearer\x20'+this[_0x1fec35(0x10d)];let _0x446627=await fetch(_0x335adb,{'headers':_0x4e3769,'signal':this[_0x1fec35(0xe7)][_0x1fec35(0xf4)]});if(!_0x446627['ok']||!_0x446627['body']){this[_0x1fec35(0xc4)](_0x1fec35(0xd3)+_0x446627[_0x1fec35(0xd5)]),await this[_0x1fec35(0xdc)](_0x235dd0),_0x235dd0=Math[_0x1fec35(0xc8)](_0x235dd0*1.5,0xea60);continue;}_0x235dd0=this[_0x1fec35(0xef)];let _0x291410=_0x446627[_0x1fec35(0xed)][_0x1fec35(0xea)](),_0x94a0ad=new TextDecoder(),_0x2d22c5='';while(this['running']){let {done:_0x4f4943,value:_0x4f9ba4}=await _0x291410[_0x1fec35(0xc9)]();if(_0x4f4943)break;_0x2d22c5+=_0x94a0ad['decode'](_0x4f9ba4,{'stream':!0x0});let _0x3a7433=_0x2d22c5['split']('\x0a');_0x2d22c5=_0x3a7433[_0x1fec35(0x107)]()||'';for(let _0x43d04f of _0x3a7433){if(!_0x43d04f[_0x1fec35(0xcd)]('data:\x20'))continue;try{let _0xbd27c2=JSON[_0x1fec35(0xdf)](_0x43d04f['slice'](0x6));if(_0xbd27c2['type']==='connected'){this[_0x1fec35(0xc4)](_0x1fec35(0xbf)),this[_0x1fec35(0xca)]('connected');continue;}if(_0xbd27c2[_0x1fec35(0xe2)]===_0x1fec35(0xdd)||_0xbd27c2['type']==='new_message'||_0xbd27c2[_0x1fec35(0xe2)]===_0x1fec35(0x102))await this['processInbox']();}catch{}}}}catch(_0x31d8dc){if(_0x31d8dc['name']==='AbortError')break;this[_0x1fec35(0xca)](_0x1fec35(0xec),_0x31d8dc),this[_0x1fec35(0xc4)](_0x1fec35(0xc1)+_0x31d8dc[_0x1fec35(0xc5)]);}if(this[_0x1fec35(0xf0)])this[_0x1fec35(0xca)]('disconnected'),this[_0x1fec35(0xc4)](_0x1fec35(0xc2)+_0x235dd0/0x3e8+_0x1fec35(0xd8)),await this[_0x1fec35(0xdc)](_0x235dd0),_0x235dd0=Math[_0x1fec35(0xc8)](_0x235dd0*1.5,0xea60);}}async[a0_0x262dab(0xe3)](){const _0x48297f=a0_0x262dab;try{let _0x326d35=(await this[_0x48297f(0x10e)](_0x48297f(0xeb),{'alias':this[_0x48297f(0x101)],'limit':0xa}))?.[_0x48297f(0xcf)]||[];for(let _0x131ef4 of _0x326d35)await this[_0x48297f(0x10e)](_0x48297f(0x108),{'alias':this['alias'],'message_id':_0x131ef4['id']}),this[_0x48297f(0xc4)]('←\x20'+_0x131ef4[_0x48297f(0xe6)]+':\x20'+_0x131ef4[_0x48297f(0xce)][_0x48297f(0xda)](0x0,0x3c)),this[_0x48297f(0xca)]('task',_0x131ef4),this[_0x48297f(0xca)](_0x48297f(0xc5),_0x131ef4);}catch(_0x15834f){this[_0x48297f(0xc4)](_0x48297f(0xfe)+_0x15834f[_0x48297f(0xc5)]);}}[a0_0x262dab(0xdc)](_0x2a0a78){return new Promise(_0x2aaa76=>setTimeout(_0x2aaa76,_0x2a0a78));}}var $=T;export{$ as default,T as CommHub};
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,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x1a64ff=a0_0x5231;(function(_0x2a67c1,_0xedbfd5){const _0x46b0a1=a0_0x5231,_0x157206=_0x2a67c1();while(!![]){try{const _0x2d8c40=-parseInt(_0x46b0a1(0x19d))/0x1+-parseInt(_0x46b0a1(0x19a))/0x2+parseInt(_0x46b0a1(0x1b1))/0x3+parseInt(_0x46b0a1(0x1af))/0x4+parseInt(_0x46b0a1(0x1fc))/0x5+parseInt(_0x46b0a1(0x1ea))/0x6+parseInt(_0x46b0a1(0x1d7))/0x7*(-parseInt(_0x46b0a1(0x19e))/0x8);if(_0x2d8c40===_0xedbfd5)break;else _0x157206['push'](_0x157206['shift']());}catch(_0x3a364f){_0x157206['push'](_0x157206['shift']());}}}(a0_0x4d38,0x7dbe1));import{readFileSync as a0_0x4e4956,existsSync as a0_0x4bbb9a}from'fs';import{randomUUID as a0_0xd15e7b}from'crypto';import{join as a0_0x2cd69d}from'path';import{hostname as a0_0x3446b7}from'os';import{execSync as a0_0x3f0b49}from'child_process';import{Server as a0_0x49ca55}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x306e9f}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x956618,CallToolRequestSchema as a0_0x7e0aaf}from'@modelcontextprotocol/sdk/types.js';function p(_0x24640c){const _0x5f170d=a0_0x5231;if(!a0_0x4bbb9a(_0x24640c))return;for(let _0x2090d6 of a0_0x4e4956(_0x24640c,'utf-8')[_0x5f170d(0x1d2)]('\x0a')){let _0xb14652=_0x2090d6[_0x5f170d(0x209)]();if(!_0xb14652||_0xb14652[_0x5f170d(0x1ae)]('#'))continue;let _0x8253=_0xb14652[_0x5f170d(0x199)]('=');if(_0x8253<0x0)continue;let _0x1b95a4=_0xb14652[_0x5f170d(0x18b)](0x0,_0x8253)[_0x5f170d(0x209)](),_0x1ec262=_0xb14652[_0x5f170d(0x18b)](_0x8253+0x1)[_0x5f170d(0x209)]()[_0x5f170d(0x202)](/^["']|["']$/g,'');if(!process.env[_0x1b95a4])process.env[_0x1b95a4]=_0x1ec262;}}var C=process.env.HOME||'~',T=a0_0x2cd69d(C,a0_0x1a64ff(0x1b8));function a0_0x5231(_0x57640c,_0x171eec){_0x57640c=_0x57640c-0x18b;const _0x4d382a=a0_0x4d38();let _0x5231f6=_0x4d382a[_0x57640c];return _0x5231f6;}p(a0_0x2cd69d(T,a0_0x1a64ff(0x1e9)));var L=process[a0_0x1a64ff(0x194)]()[a0_0x1a64ff(0x202)](/\//g,'-');p(a0_0x2cd69d(T,L,a0_0x1a64ff(0x1e9)));function U(){const _0x280723=a0_0x1a64ff;try{return a0_0x3f0b49(_0x280723(0x20a),{'encoding':_0x280723(0x1ab),'timeout':0x7d0})['trim']();}catch{return'';}}function v(){const _0x1328e5=a0_0x1a64ff;try{let _0x481ea8=a0_0x2cd69d(C,_0x1328e5(0x1c6),'config.json');if(a0_0x4bbb9a(_0x481ea8))return JSON[_0x1328e5(0x1c8)](a0_0x4e4956(_0x481ea8,'utf-8'));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x1a64ff(0x200)]||a0_0x1a64ff(0x215),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x3446b7(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0xd15e7b(),X=process.env.COMMHUB_TOKEN||H[a0_0x1a64ff(0x1d5)]||'';function Y(_0x4e7568){const _0x121923=a0_0x1a64ff;let _0x5ae3ef=new Date()[_0x121923(0x210)]()[_0x121923(0x18b)](0x0,0x8);process[_0x121923(0x197)]['write']('['+_0x5ae3ef+_0x121923(0x1a8)+_0x4e7568+'\x0a');}function a0_0x4d38(){const _0xea9693=['get_all_status','broadcast','normal','task','trim','tmux\x20display-message\x20-p\x20\x27#S\x27','SSE\x20connection\x20error:\x20','0.3.0','in_progress','pop','...\x20TMUX=','toTimeString','SSE\x20stream\x20ended,\x20reconnecting...','send_message','failed','\x20priority=','http://127.0.0.1:9200','slice','end','\x20from\x20','type','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','offline','error','params','→\x20injected\x20task\x20','cwd','ready\x20—\x20waiting\x20for\x20events','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','stderr','commhub_send_message','indexOf','1639852picJLR','application/json,\x20text/event-stream','working','133162GgttHE','64ENbrUx','get_inbox','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','length','find','Current\x20task\x20description','commhub-channel','fatal:\x20','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','blocked',']\x20[commhub]\x20','SSE\x20connected\x20as\x20\x22','high','utf-8','tools/call','Progress\x200-100','startsWith','1821780ozEuzj','notification','2774289WlPnII','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','data:\x20','statusText','commhub','message_id','←\x20message\x20from\x20','.claude/channels/commhub','new_message','/events/','priority','SSE\x20error:\x20','no\x20response','catch','commhub_report_status','unknown\x20tool','stringify','object','Message\x20content','from','connecting\x20to\x20','.anet','getReader','parse','session\x20disconnected','set','exit','\x20ALIAS=','number','SIGTERM','read','Session\x20alias:\x20','Bearer\x20','split','report_status','message','token','replied','1112608cYPGOn','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','send_reply','content','Target\x20session\x20alias','string','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','idle','connect','POST','init\x20failed:\x20','MCP\x20stdio\x20connected','join','completed','Priority\x20(default:\x20normal)','status','\x20CWD=','alias','.env','4524198sOkMwG','setRequestHandler','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','claude-code','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','CommHub\x20init\x20failed:\x20','commhub_send_task','new_task','2025-03-26','text','commhub_get_all_status','registered\x20as\x20\x22','decode','ENV:\x20URL=','result','warning:\x20could\x20not\x20register:\x20','/mcp','SIGINT','3027200DHIMry','cancelled','\x20PROJECT_ENV=','commhub_reply','hub','from_session','replace','2.0','get'];a0_0x4d38=function(){return _0xea9693;};return a0_0x4d38();}function h(_0x227f93){return new Promise(_0x2d4f74=>setTimeout(_0x2d4f74,_0x227f93));}Y(a0_0x1a64ff(0x1f7)+f+a0_0x1a64ff(0x1cc)+Z+'\x20RESUME_ID='+w[a0_0x1a64ff(0x18b)](0x0,0x8)+a0_0x1a64ff(0x20f)+(j||'none')+a0_0x1a64ff(0x1e7)+process[a0_0x1a64ff(0x194)]()+a0_0x1a64ff(0x1fe)+L);var k=new Map(),K=new a0_0x49ca55({'name':a0_0x1a64ff(0x1a4),'version':'0.3.0'},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x1a64ff(0x1ee),a0_0x1a64ff(0x1a0),a0_0x1a64ff(0x1ec),a0_0x1a64ff(0x1a6),a0_0x1a64ff(0x1d0)+Z][a0_0x1a64ff(0x1e3)]('\x0a')});K[a0_0x1a64ff(0x1eb)](a0_0x956618,async()=>({'tools':[{'name':a0_0x1a64ff(0x1ff),'description':'Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','inputSchema':{'type':a0_0x1a64ff(0x1c2),'properties':{'task_id':{'type':a0_0x1a64ff(0x1dc),'description':a0_0x1a64ff(0x1d8)},'text':{'type':a0_0x1a64ff(0x1dc),'description':'Reply\x20text\x20/\x20result\x20summary'},'status':{'type':'string','enum':[a0_0x1a64ff(0x1e4),a0_0x1a64ff(0x213),a0_0x1a64ff(0x1fd),a0_0x1a64ff(0x1a7),a0_0x1a64ff(0x191),a0_0x1a64ff(0x20d)],'description':a0_0x1a64ff(0x1b2)}},'required':[a0_0x1a64ff(0x1f3)]}},{'name':a0_0x1a64ff(0x1bf),'description':'Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','inputSchema':{'type':a0_0x1a64ff(0x1c2),'properties':{'status':{'type':a0_0x1a64ff(0x1dc),'enum':[a0_0x1a64ff(0x19c),a0_0x1a64ff(0x1de),a0_0x1a64ff(0x1a7),a0_0x1a64ff(0x191)]},'task':{'type':a0_0x1a64ff(0x1dc),'description':a0_0x1a64ff(0x1a3)},'progress':{'type':a0_0x1a64ff(0x1cd),'description':a0_0x1a64ff(0x1ad)}},'required':[a0_0x1a64ff(0x1e6)]}},{'name':'commhub_send_task','description':a0_0x1a64ff(0x18f),'inputSchema':{'type':a0_0x1a64ff(0x1c2),'properties':{'alias':{'type':a0_0x1a64ff(0x1dc),'description':a0_0x1a64ff(0x1db)},'task':{'type':a0_0x1a64ff(0x1dc),'description':'Task\x20content'},'priority':{'type':a0_0x1a64ff(0x1dc),'enum':[a0_0x1a64ff(0x1aa),a0_0x1a64ff(0x207),'low'],'description':a0_0x1a64ff(0x1e5)}},'required':[a0_0x1a64ff(0x1e8),a0_0x1a64ff(0x208)]}},{'name':a0_0x1a64ff(0x198),'description':a0_0x1a64ff(0x196),'inputSchema':{'type':a0_0x1a64ff(0x1c2),'properties':{'alias':{'type':a0_0x1a64ff(0x1dc),'description':'Target\x20session\x20alias'},'message':{'type':a0_0x1a64ff(0x1dc),'description':a0_0x1a64ff(0x1c3)}},'required':[a0_0x1a64ff(0x1e8),a0_0x1a64ff(0x1d4)]}},{'name':'commhub_get_all_status','description':a0_0x1a64ff(0x1dd),'inputSchema':{'type':a0_0x1a64ff(0x1c2),'properties':{}}}]}));async function P(_0x1ee0a4,_0x2ac491){const _0x122f59=a0_0x1a64ff;let _0x17d92b=await fetch(f+_0x122f59(0x1fa),{'method':_0x122f59(0x1e0),'headers':{'Content-Type':'application/json','Accept':_0x122f59(0x19b),...X?{'Authorization':_0x122f59(0x1d1)+X}:{}},'body':JSON[_0x122f59(0x1c1)]({'jsonrpc':_0x122f59(0x203),'id':0x1,'method':'initialize','params':{'protocolVersion':_0x122f59(0x1f2),'capabilities':{},'clientInfo':{'name':'commhub-channel','version':_0x122f59(0x20c)}}})});if(!_0x17d92b['ok']){let _0x248be8=await _0x17d92b['text']();return Y(_0x122f59(0x1ef)+_0x17d92b[_0x122f59(0x1e6)]+'\x20'+_0x248be8[_0x122f59(0x18b)](0x0,0x64)),{'ok':!0x1,'error':_0x122f59(0x1e1)+_0x17d92b[_0x122f59(0x1e6)]};}await _0x17d92b['text']();let _0x475ccd=(await(await fetch(f+_0x122f59(0x1fa),{'method':_0x122f59(0x1e0),'headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream',...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON[_0x122f59(0x1c1)]({'jsonrpc':_0x122f59(0x203),'id':0x2,'method':_0x122f59(0x1ac),'params':{'name':_0x1ee0a4,'arguments':_0x2ac491}})}))[_0x122f59(0x1f3)]())[_0x122f59(0x1d2)]('\x0a')['find'](_0x1a589c=>_0x1a589c[_0x122f59(0x1ae)](_0x122f59(0x1b3)));if(_0x475ccd){let _0x3cce31=JSON[_0x122f59(0x1c8)](_0x475ccd[_0x122f59(0x18b)](0x6));return _0x3cce31?.[_0x122f59(0x1f8)]?.['content']?.[0x0]?.[_0x122f59(0x1f3)]?JSON[_0x122f59(0x1c8)](_0x3cce31[_0x122f59(0x1f8)][_0x122f59(0x1da)][0x0][_0x122f59(0x1f3)]):_0x3cce31;}return{'ok':!0x1,'error':_0x122f59(0x1bd)};}K[a0_0x1a64ff(0x1eb)](a0_0x7e0aaf,async _0x562021=>{const _0x133310=a0_0x1a64ff;let {name:_0x5c4f9c,arguments:_0x3ee465}=_0x562021[_0x133310(0x192)];if(_0x5c4f9c==='commhub_reply'){let {task_id:_0x19ab66,text:_0x7d47bb,status:_0x247e78}=_0x3ee465;if(_0x247e78===_0x133310(0x1e4)||_0x247e78==='failed'||_0x247e78===_0x133310(0x1fd)){let _0x10e80a=_0x247e78===_0x133310(0x1e4)?_0x133310(0x1d6):_0x247e78,_0x37434d=_0x19ab66?k[_0x133310(0x204)](_0x19ab66)||_0x133310(0x200):_0x133310(0x200),_0x408a1d=await P(_0x133310(0x1d9),{'alias':_0x37434d,'text':_0x7d47bb,'in_reply_to':_0x19ab66||void 0x0,'status':_0x10e80a,'from_session':Z});if(_0x19ab66)k['delete'](_0x19ab66);return{'content':[{'type':_0x133310(0x1f3),'text':JSON[_0x133310(0x1c1)](_0x408a1d)}]};}let _0x56d752=await P(_0x133310(0x1d3),{'resume_id':w,'alias':Z,'status':_0x247e78==='blocked'?_0x133310(0x1a7):_0x247e78==='error'?_0x133310(0x191):_0x133310(0x19c),'task':_0x7d47bb['slice'](0x0,0xc8),'output':_0x7d47bb});return{'content':[{'type':_0x133310(0x1f3),'text':JSON[_0x133310(0x1c1)](_0x56d752)}]};}if(_0x5c4f9c===_0x133310(0x1bf)){let {status:_0x3107e4,task:_0x519577,progress:_0x3896e3}=_0x3ee465,_0x81eb0d=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x3107e4,'task':_0x519577,'progress':_0x3896e3});return{'content':[{'type':'text','text':JSON[_0x133310(0x1c1)](_0x81eb0d)}]};}if(_0x5c4f9c===_0x133310(0x1f0)){let {alias:_0x2c475c,task:_0xf43e73,priority:_0x233b23}=_0x3ee465,_0x113d03=await P('send_task',{'alias':_0x2c475c,'task':_0xf43e73,'priority':_0x233b23||'normal','from_session':Z});return{'content':[{'type':'text','text':JSON[_0x133310(0x1c1)](_0x113d03)}]};}if(_0x5c4f9c==='commhub_send_message'){let {alias:_0x31612d,message:_0xa58a3c}=_0x3ee465,_0x3ed96d=await P(_0x133310(0x212),{'alias':_0x31612d,'message':_0xa58a3c,'from_session':Z});return{'content':[{'type':_0x133310(0x1f3),'text':JSON['stringify'](_0x3ed96d)}]};}if(_0x5c4f9c===_0x133310(0x1f4)){let _0x1dc3c8=await P(_0x133310(0x205),{});return{'content':[{'type':_0x133310(0x1f3),'text':JSON['stringify'](_0x1dc3c8)}]};}return{'content':[{'type':_0x133310(0x1f3),'text':JSON[_0x133310(0x1c1)]({'error':_0x133310(0x1c0)})}]};});async function u(){const _0x333c96=a0_0x1a64ff;let _0x5e339b=f+_0x333c96(0x1ba)+encodeURIComponent(Z),_0x46f003={};if(X)_0x46f003['Authorization']=_0x333c96(0x1d1)+X;Y(_0x333c96(0x1c5)+_0x5e339b);while(!0x0){try{let _0x15a558=await fetch(_0x5e339b,{'headers':_0x46f003});if(!_0x15a558['ok']){Y(_0x333c96(0x1bc)+_0x15a558[_0x333c96(0x1e6)]+'\x20'+_0x15a558[_0x333c96(0x1b4)]),await h(0x1388);continue;}let _0x25319c=_0x15a558['body'][_0x333c96(0x1c7)](),_0x24d27e=new TextDecoder(),_0x104fce='';while(!0x0){let {done:_0xde5157,value:_0x57b9d8}=await _0x25319c[_0x333c96(0x1cf)]();if(_0xde5157)break;_0x104fce+=_0x24d27e[_0x333c96(0x1f6)](_0x57b9d8,{'stream':!0x0});let _0x2a2dce=_0x104fce[_0x333c96(0x1d2)]('\x0a\x0a');_0x104fce=_0x2a2dce[_0x333c96(0x20e)]()||'';for(let _0x40ba19 of _0x2a2dce){let _0x33a852=_0x40ba19[_0x333c96(0x1d2)]('\x0a')[_0x333c96(0x1a2)](_0x51de64=>_0x51de64[_0x333c96(0x1ae)](_0x333c96(0x1b3)));if(!_0x33a852)continue;try{let _0x4fda64=JSON['parse'](_0x33a852[_0x333c96(0x18b)](0x6));await S(_0x4fda64);}catch(_0x3755e1){Y('parse\x20error:\x20'+_0x3755e1);}}}Y(_0x333c96(0x211));}catch(_0x189662){Y(_0x333c96(0x20b)+_0x189662);}await h(0xbb8);}}async function S(_0x16e6e1){const _0x79efa0=a0_0x1a64ff;if(_0x16e6e1[_0x79efa0(0x18e)]==='connected'){Y(_0x79efa0(0x1a9)+Z+'\x22');return;}if(_0x16e6e1[_0x79efa0(0x18e)]===_0x79efa0(0x1b9)){if(Y(_0x79efa0(0x1b7)+_0x16e6e1['from']+':\x20'+_0x16e6e1[_0x79efa0(0x1d4)][_0x79efa0(0x18b)](0x0,0x3c)),await K[_0x79efa0(0x1b0)]({'method':'notifications/claude/channel','params':{'content':_0x16e6e1[_0x79efa0(0x1d4)],'meta':{'sender':_0x16e6e1[_0x79efa0(0x1c4)]||'hub','sender_id':'commhub','user':_0x16e6e1[_0x79efa0(0x1c4)]||_0x79efa0(0x200),'priority':'normal'}}}),_0x16e6e1[_0x79efa0(0x1b6)])await P('ack_inbox',{'alias':Z,'message_id':_0x16e6e1['message_id']});return;}if(_0x16e6e1[_0x79efa0(0x18e)]===_0x79efa0(0x1f1)||_0x16e6e1['type']===_0x79efa0(0x206)){Y('←\x20'+_0x16e6e1[_0x79efa0(0x18e)]+':\x20inbox_count='+_0x16e6e1['inbox_count']+_0x79efa0(0x214)+(_0x16e6e1[_0x79efa0(0x1bb)]||_0x79efa0(0x207)));let _0x1ad499=await P(_0x79efa0(0x19f),{'alias':Z,'limit':0x5});if(_0x1ad499?.['ok']&&_0x1ad499['messages']?.[_0x79efa0(0x1a1)]>0x0)for(let _0x564028 of _0x1ad499['messages']){let _0x450ce9={'sender':_0x564028[_0x79efa0(0x201)]||_0x79efa0(0x200),'sender_id':_0x79efa0(0x1b5),'user':_0x564028[_0x79efa0(0x201)]||_0x79efa0(0x200),'task_id':_0x564028['id'],'priority':_0x564028[_0x79efa0(0x1bb)]||_0x79efa0(0x207)};k[_0x79efa0(0x1ca)](_0x564028['id'],_0x564028[_0x79efa0(0x201)]||_0x79efa0(0x200)),await K[_0x79efa0(0x1b0)]({'method':'notifications/claude/channel','params':{'content':_0x564028[_0x79efa0(0x1da)],'meta':_0x450ce9}}),Y(_0x79efa0(0x193)+_0x564028['id'][_0x79efa0(0x18b)](0x0,0x8)+_0x79efa0(0x18d)+_0x564028[_0x79efa0(0x201)]+':\x20'+_0x564028[_0x79efa0(0x1da)][_0x79efa0(0x18b)](0x0,0x3c)),await P('ack_inbox',{'alias':Z,'message_id':_0x564028['id']});}}}async function A(){const _0x413f95=a0_0x1a64ff;let _0x55a432=new a0_0x306e9f();await K[_0x413f95(0x1df)](_0x55a432),Y(_0x413f95(0x1e2)),Y('starting\x20SSE\x20listener...'),u()['catch'](_0x1a3204=>Y('SSE\x20fatal:\x20'+_0x1a3204)),P(_0x413f95(0x1d3),{'resume_id':w,'alias':Z,'status':_0x413f95(0x1de),'server':a0_0x3446b7(),'hostname':a0_0x3446b7(),'agent':'claude-code','project_dir':process[_0x413f95(0x194)](),'tmux_name':j||void 0x0})['then'](()=>Y(_0x413f95(0x1f5)+Z+'\x22\x20('+w['slice'](0x0,0x8)+')'))[_0x413f95(0x1be)](_0x415c60=>Y(_0x413f95(0x1f9)+_0x415c60)),setInterval(()=>{const _0x5e7a12=_0x413f95;P(_0x5e7a12(0x1d3),{'resume_id':w,'alias':Z,'status':_0x5e7a12(0x1de),'server':a0_0x3446b7(),'hostname':a0_0x3446b7(),'agent':_0x5e7a12(0x1ed),'project_dir':process[_0x5e7a12(0x194)](),'tmux_name':j||void 0x0})[_0x5e7a12(0x1be)](_0x2aa8d6=>Y('heartbeat\x20failed:\x20'+_0x2aa8d6));},0x2bf20),Y(_0x413f95(0x195));}A()[a0_0x1a64ff(0x1be)](_0x5b2c4f=>{const _0x54cb0c=a0_0x1a64ff;Y(_0x54cb0c(0x1a5)+_0x5b2c4f),process[_0x54cb0c(0x1cb)](0x1);});async function N(){const _0x51f32c=a0_0x1a64ff;Y('shutting\x20down,\x20reporting\x20offline...'),await P('report_status',{'resume_id':w,'alias':Z,'status':_0x51f32c(0x190),'task':_0x51f32c(0x1c9)})['catch'](()=>{}),process['exit'](0x0);}process['stdin']['on'](a0_0x1a64ff(0x18c),()=>N()),process['on'](a0_0x1a64ff(0x1ce),()=>N()),process['on'](a0_0x1a64ff(0x1fb),()=>N());
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());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.2.9-preview.4",
3
+ "version": "2.2.10-preview.0",
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",