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

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_0x2d6c4c=a0_0x3ae3;(function(_0x4bdbb9,_0x3b4300){const _0xa2b8c=a0_0x3ae3,_0x38735e=_0x4bdbb9();while(!![]){try{const _0x1e0449=-parseInt(_0xa2b8c(0x176))/0x1+-parseInt(_0xa2b8c(0x17e))/0x2*(-parseInt(_0xa2b8c(0x1b1))/0x3)+parseInt(_0xa2b8c(0x1a4))/0x4*(-parseInt(_0xa2b8c(0x19e))/0x5)+parseInt(_0xa2b8c(0x196))/0x6+parseInt(_0xa2b8c(0x168))/0x7+-parseInt(_0xa2b8c(0x17a))/0x8+-parseInt(_0xa2b8c(0x16a))/0x9;if(_0x1e0449===_0x3b4300)break;else _0x38735e['push'](_0x38735e['shift']());}catch(_0x397b32){_0x38735e['push'](_0x38735e['shift']());}}}(a0_0x3be5,0xc14c2));function a0_0x3be5(){const _0x407b18=['from_session','sleep','SSE\x20error:\x20','replace','task','url','autoConnect','connect','ack_inbox','sdk','running','toString','status','8166630SaFgpI','text','match','get_inbox','idle','tools/call','alias','get_all_status','22195ISIOqG','/mcp','getReader','getAllStatus',']\x20[commhub:','resumeId','652EVgtTL','content','call','application/json,\x20text/event-stream','body','s...','name','data:\x20','processInbox','inbox\x20error:\x20','parse','stringify','disconnect','5697lKWyrs','read','offline','messages','startsWith','AbortError','cwd','heartbeatTimer','/events/','report_status','abort','2.0','disconnected','error','broadcast','7102935BhEmpi','signal','6697602QqXyrO','send_task','connectSSE','type','agent','sseAbort','Authorization','min','send_reply','catch','emit','heartbeat\x20failed:\x20','435564oBdAyl','slice','POST','completed','4388864stwtkn','log','normal','now','914iZFjOM','SSE\x20connected','send','new_message','reconnectDelay','decode','heartbeatInterval','message','toTimeString','application/json','token'];a0_0x3be5=function(){return _0x407b18;};return a0_0x3be5();}function a0_0x3ae3(_0x5c1b83,_0x3244ce){_0x5c1b83=_0x5c1b83-0x161;const _0x3be522=a0_0x3be5();let _0x3ae380=_0x3be522[_0x5c1b83];return _0x3ae380;}import{EventEmitter as a0_0xbd7be9}from'events';import{hostname as a0_0x4c4f61}from'os';class T extends a0_0xbd7be9{[a0_0x2d6c4c(0x18e)];[a0_0x2d6c4c(0x19c)];[a0_0x2d6c4c(0x188)];['agent'];[a0_0x2d6c4c(0x1a3)];[a0_0x2d6c4c(0x184)];['reconnectDelay'];[a0_0x2d6c4c(0x1b8)];[a0_0x2d6c4c(0x16f)];[a0_0x2d6c4c(0x193)]=!0x1;constructor(_0x52b63d){const _0x15b260=a0_0x2d6c4c;super();if(this[_0x15b260(0x18e)]=_0x52b63d['url'][_0x15b260(0x18c)](/\/$/,''),this[_0x15b260(0x19c)]=_0x52b63d[_0x15b260(0x19c)],this[_0x15b260(0x188)]=_0x52b63d[_0x15b260(0x188)],this[_0x15b260(0x16e)]=_0x52b63d[_0x15b260(0x16e)]||_0x15b260(0x192),this[_0x15b260(0x1a3)]='sdk-'+_0x52b63d['alias']+'-'+Date['now']()[_0x15b260(0x194)](0x24),this[_0x15b260(0x184)]=_0x52b63d[_0x15b260(0x184)]??0x2bf20,this[_0x15b260(0x182)]=_0x52b63d[_0x15b260(0x182)]??0xbb8,_0x52b63d[_0x15b260(0x18f)]!==!0x1)this[_0x15b260(0x190)]();}[a0_0x2d6c4c(0x17b)](_0x135ab9){const _0x5a1ed3=a0_0x2d6c4c;console['log']('['+new Date()[_0x5a1ed3(0x186)]()['slice'](0x0,0x8)+_0x5a1ed3(0x1a2)+this['alias']+']\x20'+_0x135ab9);}async[a0_0x2d6c4c(0x1a6)](_0x3aad2f,_0x150bbc){const _0x165e81=a0_0x2d6c4c;let _0x16590b={'Content-Type':_0x165e81(0x187),'Accept':_0x165e81(0x1a7)};if(this[_0x165e81(0x188)])_0x16590b['Authorization']='Bearer\x20'+this[_0x165e81(0x188)];let _0x164f2c=await(await fetch(this[_0x165e81(0x18e)]+_0x165e81(0x19f),{'method':_0x165e81(0x178),'headers':_0x16590b,'body':JSON[_0x165e81(0x1af)]({'jsonrpc':_0x165e81(0x164),'id':Date[_0x165e81(0x17d)](),'method':_0x165e81(0x19b),'params':{'name':_0x3aad2f,'arguments':_0x150bbc}})}))[_0x165e81(0x197)](),_0x4a40b4=_0x164f2c[_0x165e81(0x198)](/data: (.+)/),_0x535483=_0x4a40b4?JSON[_0x165e81(0x1ae)](_0x4a40b4[0x1]):JSON[_0x165e81(0x1ae)](_0x164f2c),_0x532c53=_0x535483?.['result']?.[_0x165e81(0x1a5)]?.[0x0]?.[_0x165e81(0x197)];return _0x532c53?JSON[_0x165e81(0x1ae)](_0x532c53):_0x535483;}async[a0_0x2d6c4c(0x190)](){const _0xfa0f4a=a0_0x2d6c4c;if(this[_0xfa0f4a(0x193)])return;this['running']=!0x0,await this[_0xfa0f4a(0x195)](_0xfa0f4a(0x19a)),this[_0xfa0f4a(0x17b)]('registered'),this['heartbeatTimer']=setInterval(()=>{const _0x42dcc5=_0xfa0f4a;this[_0x42dcc5(0x195)](_0x42dcc5(0x19a))[_0x42dcc5(0x173)](_0x2334c4=>this[_0x42dcc5(0x17b)](_0x42dcc5(0x175)+_0x2334c4['message']));},this[_0xfa0f4a(0x184)]),this['connectSSE']();}async[a0_0x2d6c4c(0x1b0)](){const _0x57f7b0=a0_0x2d6c4c;if(this[_0x57f7b0(0x193)]=!0x1,this[_0x57f7b0(0x16f)]?.[_0x57f7b0(0x163)](),this[_0x57f7b0(0x1b8)])clearInterval(this[_0x57f7b0(0x1b8)]);await this[_0x57f7b0(0x195)](_0x57f7b0(0x1b3))[_0x57f7b0(0x173)](()=>{}),this[_0x57f7b0(0x17b)](_0x57f7b0(0x165));}async[a0_0x2d6c4c(0x180)](_0x45359e,_0x2d72a9,_0x1813f1=a0_0x2d6c4c(0x17c)){const _0xfeca7b=a0_0x2d6c4c;return this[_0xfeca7b(0x1a6)](_0xfeca7b(0x16b),{'alias':_0x45359e,'task':_0x2d72a9,'priority':_0x1813f1,'from_session':this[_0xfeca7b(0x19c)]});}async[a0_0x2d6c4c(0x185)](_0x30d2bb,_0x1b9824){const _0x48f948=a0_0x2d6c4c;return this[_0x48f948(0x1a6)]('send_message',{'alias':_0x30d2bb,'message':_0x1b9824,'from_session':this['alias']});}async['reply'](_0x5de2cf,_0x2e662a,_0xb49e84=a0_0x2d6c4c(0x179)){const _0x11bb02=a0_0x2d6c4c;return this[_0x11bb02(0x1a6)](_0x11bb02(0x172),{'in_reply_to':_0x5de2cf,'text':_0x2e662a,'status':_0xb49e84});}async[a0_0x2d6c4c(0x195)](_0x5eedea,_0x27746c){const _0x32782a=a0_0x2d6c4c;return this[_0x32782a(0x1a6)](_0x32782a(0x162),{'resume_id':this[_0x32782a(0x1a3)],'alias':this['alias'],'status':_0x5eedea,'server':a0_0x4c4f61(),'hostname':a0_0x4c4f61(),'agent':this[_0x32782a(0x16e)],'project_dir':process[_0x32782a(0x1b7)](),..._0x27746c});}async[a0_0x2d6c4c(0x1a1)](){const _0x21255e=a0_0x2d6c4c;return this[_0x21255e(0x1a6)](_0x21255e(0x19d),{});}async[a0_0x2d6c4c(0x167)](_0x452257,_0x11abcb){const _0x1fa059=a0_0x2d6c4c;return this[_0x1fa059(0x1a6)]('broadcast',{'message':_0x452257,'filter_server':_0x11abcb?.['server'],'filter_status':_0x11abcb?.[_0x1fa059(0x195)]});}async[a0_0x2d6c4c(0x16c)](){const _0x43b394=a0_0x2d6c4c;let _0xaf21fc=encodeURIComponent(this[_0x43b394(0x19c)]),_0x4855f7=this[_0x43b394(0x18e)]+_0x43b394(0x161)+_0xaf21fc,_0x246bc6=this['reconnectDelay'];while(this[_0x43b394(0x193)]){try{this[_0x43b394(0x16f)]=new AbortController();let _0xff21f6={'Accept':'text/event-stream'};if(this[_0x43b394(0x188)])_0xff21f6[_0x43b394(0x170)]='Bearer\x20'+this[_0x43b394(0x188)];let _0x1d7ce1=await fetch(_0x4855f7,{'headers':_0xff21f6,'signal':this['sseAbort'][_0x43b394(0x169)]});if(!_0x1d7ce1['ok']||!_0x1d7ce1[_0x43b394(0x1a8)]){this[_0x43b394(0x17b)]('SSE\x20failed:\x20'+_0x1d7ce1[_0x43b394(0x195)]),await this[_0x43b394(0x18a)](_0x246bc6),_0x246bc6=Math[_0x43b394(0x171)](_0x246bc6*1.5,0xea60);continue;}_0x246bc6=this[_0x43b394(0x182)];let _0x26ae99=_0x1d7ce1[_0x43b394(0x1a8)][_0x43b394(0x1a0)](),_0x37cc75=new TextDecoder(),_0x361505='';while(this[_0x43b394(0x193)]){let {done:_0x14bc5b,value:_0x2660c3}=await _0x26ae99[_0x43b394(0x1b2)]();if(_0x14bc5b)break;_0x361505+=_0x37cc75[_0x43b394(0x183)](_0x2660c3,{'stream':!0x0});let _0x5d987e=_0x361505['split']('\x0a');_0x361505=_0x5d987e['pop']()||'';for(let _0x196809 of _0x5d987e){if(!_0x196809[_0x43b394(0x1b5)](_0x43b394(0x1ab)))continue;try{let _0x33afa0=JSON['parse'](_0x196809[_0x43b394(0x177)](0x6));if(_0x33afa0[_0x43b394(0x16d)]==='connected'){this[_0x43b394(0x17b)](_0x43b394(0x17f)),this[_0x43b394(0x174)]('connected');continue;}if(_0x33afa0['type']==='new_task'||_0x33afa0[_0x43b394(0x16d)]===_0x43b394(0x181)||_0x33afa0[_0x43b394(0x16d)]===_0x43b394(0x167))await this[_0x43b394(0x1ac)]();}catch{}}}}catch(_0x401db3){if(_0x401db3[_0x43b394(0x1aa)]===_0x43b394(0x1b6))break;this[_0x43b394(0x174)](_0x43b394(0x166),_0x401db3),this[_0x43b394(0x17b)](_0x43b394(0x18b)+_0x401db3[_0x43b394(0x185)]);}if(this[_0x43b394(0x193)])this[_0x43b394(0x174)]('disconnected'),this['log']('SSE\x20reconnecting\x20in\x20'+_0x246bc6/0x3e8+_0x43b394(0x1a9)),await this[_0x43b394(0x18a)](_0x246bc6),_0x246bc6=Math[_0x43b394(0x171)](_0x246bc6*1.5,0xea60);}}async['processInbox'](){const _0x84e01e=a0_0x2d6c4c;try{let _0x2a1bda=(await this[_0x84e01e(0x1a6)](_0x84e01e(0x199),{'alias':this[_0x84e01e(0x19c)],'limit':0xa}))?.[_0x84e01e(0x1b4)]||[];for(let _0xc9084e of _0x2a1bda)await this['call'](_0x84e01e(0x191),{'alias':this[_0x84e01e(0x19c)],'message_id':_0xc9084e['id']}),this[_0x84e01e(0x17b)]('←\x20'+_0xc9084e[_0x84e01e(0x189)]+':\x20'+_0xc9084e['content'][_0x84e01e(0x177)](0x0,0x3c)),this[_0x84e01e(0x174)](_0x84e01e(0x18d),_0xc9084e),this['emit'](_0x84e01e(0x185),_0xc9084e);}catch(_0x58c415){this[_0x84e01e(0x17b)](_0x84e01e(0x1ad)+_0x58c415[_0x84e01e(0x185)]);}}[a0_0x2d6c4c(0x18a)](_0x3a42fe){return new Promise(_0x5782d9=>setTimeout(_0x5782d9,_0x3a42fe));}}var $=T;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_0x13d088=a0_0x22f5;(function(_0x20efdd,_0x51f030){const _0x3d1ba5=a0_0x22f5,_0x3833d1=_0x20efdd();while(!![]){try{const _0xfe93d1=-parseInt(_0x3d1ba5(0xff))/0x1+parseInt(_0x3d1ba5(0x11c))/0x2*(parseInt(_0x3d1ba5(0x147))/0x3)+-parseInt(_0x3d1ba5(0x111))/0x4*(parseInt(_0x3d1ba5(0x10c))/0x5)+-parseInt(_0x3d1ba5(0x157))/0x6*(parseInt(_0x3d1ba5(0x165))/0x7)+parseInt(_0x3d1ba5(0xfd))/0x8*(-parseInt(_0x3d1ba5(0x12e))/0x9)+parseInt(_0x3d1ba5(0x12c))/0xa*(parseInt(_0x3d1ba5(0x14a))/0xb)+parseInt(_0x3d1ba5(0xfc))/0xc*(parseInt(_0x3d1ba5(0x13b))/0xd);if(_0xfe93d1===_0x51f030)break;else _0x3833d1['push'](_0x3833d1['shift']());}catch(_0x314816){_0x3833d1['push'](_0x3833d1['shift']());}}}(a0_0x43de,0x706f1));function a0_0x22f5(_0x10eb0a,_0x546f45){_0x10eb0a=_0x10eb0a-0xfb;const _0x43de2b=a0_0x43de();let _0x22f565=_0x43de2b[_0x10eb0a];return _0x22f565;}import{readFileSync as a0_0x2656ec,existsSync as a0_0xb1d132}from'fs';import{randomUUID as a0_0x631b14}from'crypto';import{join as a0_0x3096ee}from'path';import{hostname as a0_0x3993dc}from'os';import{execSync as a0_0x328062}from'child_process';import{Server as a0_0x18e457}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x1fb6d6}from'@modelcontextprotocol/sdk/server/stdio.js';function a0_0x43de(){const _0x1d85c4=['fatal:\x20','end','commhub-channel','22256lPNngG','hub','set','alias',']\x20[commhub]\x20','cancelled','type','join','\x20priority=','Message\x20content','commhub_reply','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','3sludoJ','notification','config.json','3564737TSvIZE','failed','tools/call','Bearer\x20','notifications/claude/channel','CommHub\x20init\x20failed:\x20','broadcast','from','ack_inbox','Target\x20session\x20alias','MCP\x20stdio\x20connected','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','application/json,\x20text/event-stream','12LiNUKR','tmux\x20display-message\x20-p\x20\x27#S\x27','get_all_status','status','completed','priority','commhub_send_message','data:\x20','in_progress','SSE\x20connection\x20error:\x20','blocked','delete','no\x20response','inbox_count','2350747ZUKRvB','send_message','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','application/json','replace','text','registered\x20as\x20\x22','.env','result','error','commhub_send_task','claude-code','exit','commhub','report_status','content','message_id','slice','Priority\x20(default:\x20normal)','/mcp','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','commhub_report_status','startsWith','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','ready\x20—\x20waiting\x20for\x20events','→\x20injected\x20task\x20','catch','string','Progress\x200-100','from_session','getReader','7284dcgnLZ','233608oZYybD','.anet','323201vZKIeN','unknown\x20tool','body','\x22\x20(','read','new_message','parse','SSE\x20stream\x20ended,\x20reconnecting...','commhub_get_all_status','messages','setRequestHandler','session\x20disconnected','SSE\x20connected\x20as\x20\x22','545Zizfpr','idle','Reply\x20text\x20/\x20result\x20summary','cwd','number','3248IFzSZF','POST','params','init\x20failed:\x20','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','connect','SSE\x20fatal:\x20','none','.claude/channels/commhub','trim','get_inbox','589154VMyHBU','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','normal','then','message','\x20RESUME_ID=','\x20CWD=','connecting\x20to\x20','task','←\x20message\x20from\x20','parse\x20error:\x20','2.0','length','utf-8','stderr','write','20kgyljK','find','135AqqKjo','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','stringify','http://127.0.0.1:9200','Session\x20alias:\x20','split','object','0.3.0','...\x20TMUX=','\x20ALIAS='];a0_0x43de=function(){return _0x1d85c4;};return a0_0x43de();}import{ListToolsRequestSchema as a0_0x1510ef,CallToolRequestSchema as a0_0x356cf4}from'@modelcontextprotocol/sdk/types.js';function p(_0x90a5d1){const _0x47e656=a0_0x22f5;if(!a0_0xb1d132(_0x90a5d1))return;for(let _0x2bc4f9 of a0_0x2656ec(_0x90a5d1,_0x47e656(0x129))[_0x47e656(0x133)]('\x0a')){let _0x59a98b=_0x2bc4f9[_0x47e656(0x11a)]();if(!_0x59a98b||_0x59a98b[_0x47e656(0x17b)]('#'))continue;let _0x2a8d1b=_0x59a98b['indexOf']('=');if(_0x2a8d1b<0x0)continue;let _0x6e5a34=_0x59a98b[_0x47e656(0x176)](0x0,_0x2a8d1b)[_0x47e656(0x11a)](),_0x95b3da=_0x59a98b['slice'](_0x2a8d1b+0x1)[_0x47e656(0x11a)]()['replace'](/^["']|["']$/g,'');if(!process.env[_0x6e5a34])process.env[_0x6e5a34]=_0x95b3da;}}var C=process.env.HOME||'~',T=a0_0x3096ee(C,a0_0x13d088(0x119));p(a0_0x3096ee(T,a0_0x13d088(0x16c)));var L=process[a0_0x13d088(0x10f)]()[a0_0x13d088(0x169)](/\//g,'-');p(a0_0x3096ee(T,L,a0_0x13d088(0x16c)));function U(){const _0x4c3352=a0_0x13d088;try{return a0_0x328062(_0x4c3352(0x158),{'encoding':_0x4c3352(0x129),'timeout':0x7d0})[_0x4c3352(0x11a)]();}catch{return'';}}function v(){const _0x258173=a0_0x13d088;try{let _0x28e704=a0_0x3096ee(C,_0x258173(0xfe),_0x258173(0x149));if(a0_0xb1d132(_0x28e704))return JSON[_0x258173(0x105)](a0_0x2656ec(_0x28e704,'utf-8'));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x13d088(0x13c)]||a0_0x13d088(0x131),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x3993dc(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x631b14(),X=process.env.COMMHUB_TOKEN||H['token']||'';function Y(_0x5b34e2){const _0x3d3b28=a0_0x13d088;let _0x359ddd=new Date()['toTimeString']()[_0x3d3b28(0x176)](0x0,0x8);process[_0x3d3b28(0x12a)][_0x3d3b28(0x12b)]('['+_0x359ddd+_0x3d3b28(0x13f)+_0x5b34e2+'\x0a');}function h(_0x5e4181){return new Promise(_0x2a640b=>setTimeout(_0x2a640b,_0x5e4181));}Y('ENV:\x20URL='+f+a0_0x13d088(0x137)+Z+a0_0x13d088(0x121)+w[a0_0x13d088(0x176)](0x0,0x8)+a0_0x13d088(0x136)+(j||a0_0x13d088(0x118))+a0_0x13d088(0x122)+process['cwd']()+'\x20PROJECT_ENV='+L);var k=new Map(),K=new a0_0x18e457({'name':'commhub-channel','version':a0_0x13d088(0x135)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':['Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>',a0_0x13d088(0x146),a0_0x13d088(0x11d),a0_0x13d088(0x12f),a0_0x13d088(0x132)+Z][a0_0x13d088(0x142)]('\x0a')});K[a0_0x13d088(0x109)](a0_0x1510ef,async()=>({'tools':[{'name':'commhub_reply','description':a0_0x13d088(0x167),'inputSchema':{'type':a0_0x13d088(0x134),'properties':{'task_id':{'type':a0_0x13d088(0x180),'description':a0_0x13d088(0x115)},'text':{'type':'string','description':a0_0x13d088(0x10e)},'status':{'type':'string','enum':[a0_0x13d088(0x15b),'failed',a0_0x13d088(0x140),a0_0x13d088(0x161),a0_0x13d088(0x16e),a0_0x13d088(0x15f)],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':[a0_0x13d088(0x16a)]}},{'name':a0_0x13d088(0x17a),'description':a0_0x13d088(0x17c),'inputSchema':{'type':a0_0x13d088(0x134),'properties':{'status':{'type':a0_0x13d088(0x180),'enum':['working','idle','blocked',a0_0x13d088(0x16e)]},'task':{'type':a0_0x13d088(0x180),'description':'Current\x20task\x20description'},'progress':{'type':a0_0x13d088(0x110),'description':a0_0x13d088(0x181)}},'required':[a0_0x13d088(0x15a)]}},{'name':a0_0x13d088(0x16f),'description':a0_0x13d088(0x155),'inputSchema':{'type':a0_0x13d088(0x134),'properties':{'alias':{'type':a0_0x13d088(0x180),'description':'Target\x20session\x20alias'},'task':{'type':a0_0x13d088(0x180),'description':'Task\x20content'},'priority':{'type':a0_0x13d088(0x180),'enum':['high',a0_0x13d088(0x11e),'low'],'description':a0_0x13d088(0x177)}},'required':[a0_0x13d088(0x13e),a0_0x13d088(0x124)]}},{'name':a0_0x13d088(0x15d),'description':'Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','inputSchema':{'type':a0_0x13d088(0x134),'properties':{'alias':{'type':a0_0x13d088(0x180),'description':a0_0x13d088(0x153)},'message':{'type':a0_0x13d088(0x180),'description':a0_0x13d088(0x144)}},'required':['alias',a0_0x13d088(0x120)]}},{'name':a0_0x13d088(0x107),'description':a0_0x13d088(0x179),'inputSchema':{'type':a0_0x13d088(0x134),'properties':{}}}]}));async function P(_0x15c931,_0x2ebb47){const _0x51c364=a0_0x13d088;let _0x931b8f=await fetch(f+'/mcp',{'method':_0x51c364(0x112),'headers':{'Content-Type':_0x51c364(0x168),'Accept':_0x51c364(0x156),...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON[_0x51c364(0x130)]({'jsonrpc':_0x51c364(0x127),'id':0x1,'method':'initialize','params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x51c364(0x13a),'version':_0x51c364(0x135)}}})});if(!_0x931b8f['ok']){let _0x28d4c3=await _0x931b8f[_0x51c364(0x16a)]();return Y(_0x51c364(0x14f)+_0x931b8f[_0x51c364(0x15a)]+'\x20'+_0x28d4c3['slice'](0x0,0x64)),{'ok':!0x1,'error':_0x51c364(0x114)+_0x931b8f[_0x51c364(0x15a)]};}await _0x931b8f['text']();let _0x52d765=(await(await fetch(f+_0x51c364(0x178),{'method':_0x51c364(0x112),'headers':{'Content-Type':'application/json','Accept':_0x51c364(0x156),...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON[_0x51c364(0x130)]({'jsonrpc':_0x51c364(0x127),'id':0x2,'method':_0x51c364(0x14c),'params':{'name':_0x15c931,'arguments':_0x2ebb47}})}))['text']())[_0x51c364(0x133)]('\x0a')[_0x51c364(0x12d)](_0x30db94=>_0x30db94[_0x51c364(0x17b)]('data:\x20'));if(_0x52d765){let _0x377ec9=JSON[_0x51c364(0x105)](_0x52d765[_0x51c364(0x176)](0x6));return _0x377ec9?.[_0x51c364(0x16d)]?.[_0x51c364(0x174)]?.[0x0]?.[_0x51c364(0x16a)]?JSON[_0x51c364(0x105)](_0x377ec9[_0x51c364(0x16d)]['content'][0x0][_0x51c364(0x16a)]):_0x377ec9;}return{'ok':!0x1,'error':_0x51c364(0x163)};}K[a0_0x13d088(0x109)](a0_0x356cf4,async _0x48aa44=>{const _0x15450f=a0_0x13d088;let {name:_0x434e8d,arguments:_0x47e8cc}=_0x48aa44[_0x15450f(0x113)];if(_0x434e8d===_0x15450f(0x145)){let {task_id:_0x53d0a5,text:_0x185a20,status:_0x35f2fd}=_0x47e8cc;if(_0x35f2fd==='completed'||_0x35f2fd===_0x15450f(0x14b)||_0x35f2fd==='cancelled'){let _0x4495f9=_0x35f2fd===_0x15450f(0x15b)?'replied':_0x35f2fd,_0x57a6b3=_0x53d0a5?k['get'](_0x53d0a5)||_0x15450f(0x13c):'hub',_0x46ab54=await P('send_reply',{'alias':_0x57a6b3,'text':_0x185a20,'in_reply_to':_0x53d0a5||void 0x0,'status':_0x4495f9,'from_session':Z});if(_0x53d0a5)k[_0x15450f(0x162)](_0x53d0a5);return{'content':[{'type':_0x15450f(0x16a),'text':JSON[_0x15450f(0x130)](_0x46ab54)}]};}let _0x40178a=await P(_0x15450f(0x173),{'resume_id':w,'alias':Z,'status':_0x35f2fd===_0x15450f(0x161)?_0x15450f(0x161):_0x35f2fd===_0x15450f(0x16e)?_0x15450f(0x16e):'working','task':_0x185a20[_0x15450f(0x176)](0x0,0xc8),'output':_0x185a20});return{'content':[{'type':'text','text':JSON['stringify'](_0x40178a)}]};}if(_0x434e8d===_0x15450f(0x17a)){let {status:_0x3eebdb,task:_0x5b51a8,progress:_0x5db1c3}=_0x47e8cc,_0x4c2852=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x3eebdb,'task':_0x5b51a8,'progress':_0x5db1c3});return{'content':[{'type':_0x15450f(0x16a),'text':JSON[_0x15450f(0x130)](_0x4c2852)}]};}if(_0x434e8d===_0x15450f(0x16f)){let {alias:_0xa4e1a7,task:_0x519ea3,priority:_0x19e843}=_0x47e8cc,_0xc3cbd8=await P('send_task',{'alias':_0xa4e1a7,'task':_0x519ea3,'priority':_0x19e843||_0x15450f(0x11e),'from_session':Z});return{'content':[{'type':_0x15450f(0x16a),'text':JSON[_0x15450f(0x130)](_0xc3cbd8)}]};}if(_0x434e8d===_0x15450f(0x15d)){let {alias:_0x41c1bf,message:_0x287cb9}=_0x47e8cc,_0xd92124=await P(_0x15450f(0x166),{'alias':_0x41c1bf,'message':_0x287cb9,'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x15450f(0x130)](_0xd92124)}]};}if(_0x434e8d==='commhub_get_all_status'){let _0x3ed235=await P(_0x15450f(0x159),{});return{'content':[{'type':'text','text':JSON[_0x15450f(0x130)](_0x3ed235)}]};}return{'content':[{'type':_0x15450f(0x16a),'text':JSON['stringify']({'error':_0x15450f(0x100)})}]};});async function u(){const _0x395be5=a0_0x13d088;let _0x4c0f46=f+'/events/'+encodeURIComponent(Z),_0x233776={};if(X)_0x233776['Authorization']=_0x395be5(0x14d)+X;Y(_0x395be5(0x123)+_0x4c0f46);while(!0x0){try{let _0x563601=await fetch(_0x4c0f46,{'headers':_0x233776});if(!_0x563601['ok']){Y('SSE\x20error:\x20'+_0x563601[_0x395be5(0x15a)]+'\x20'+_0x563601['statusText']),await h(0x1388);continue;}let _0x5d23f6=_0x563601[_0x395be5(0x101)][_0x395be5(0xfb)](),_0xb908f0=new TextDecoder(),_0x5e85ab='';while(!0x0){let {done:_0x3312ea,value:_0x158316}=await _0x5d23f6[_0x395be5(0x103)]();if(_0x3312ea)break;_0x5e85ab+=_0xb908f0['decode'](_0x158316,{'stream':!0x0});let _0x4ee484=_0x5e85ab[_0x395be5(0x133)]('\x0a\x0a');_0x5e85ab=_0x4ee484['pop']()||'';for(let _0x19998c of _0x4ee484){let _0x303ea9=_0x19998c[_0x395be5(0x133)]('\x0a')['find'](_0x1c86dc=>_0x1c86dc[_0x395be5(0x17b)](_0x395be5(0x15e)));if(!_0x303ea9)continue;try{let _0xe31ef5=JSON['parse'](_0x303ea9[_0x395be5(0x176)](0x6));await S(_0xe31ef5);}catch(_0x3adc49){Y(_0x395be5(0x126)+_0x3adc49);}}}Y(_0x395be5(0x106));}catch(_0x81aaf1){Y(_0x395be5(0x160)+_0x81aaf1);}await h(0xbb8);}}async function S(_0x15354b){const _0x32e992=a0_0x13d088;if(_0x15354b[_0x32e992(0x141)]==='connected'){Y(_0x32e992(0x10b)+Z+'\x22');return;}if(_0x15354b['type']===_0x32e992(0x104)){if(Y(_0x32e992(0x125)+_0x15354b['from']+':\x20'+_0x15354b[_0x32e992(0x120)][_0x32e992(0x176)](0x0,0x3c)),await K[_0x32e992(0x148)]({'method':'notifications/claude/channel','params':{'content':_0x15354b['message'],'meta':{'sender':_0x15354b[_0x32e992(0x151)]||_0x32e992(0x13c),'sender_id':'commhub','user':_0x15354b[_0x32e992(0x151)]||_0x32e992(0x13c),'priority':_0x32e992(0x11e)}}}),_0x15354b[_0x32e992(0x175)])await P(_0x32e992(0x152),{'alias':Z,'message_id':_0x15354b[_0x32e992(0x175)]});return;}if(_0x15354b[_0x32e992(0x141)]==='new_task'||_0x15354b[_0x32e992(0x141)]===_0x32e992(0x150)){Y('←\x20'+_0x15354b['type']+':\x20inbox_count='+_0x15354b[_0x32e992(0x164)]+_0x32e992(0x143)+(_0x15354b[_0x32e992(0x15c)]||_0x32e992(0x11e)));let _0x5561df=await P(_0x32e992(0x11b),{'alias':Z,'limit':0x5});if(_0x5561df?.['ok']&&_0x5561df['messages']?.[_0x32e992(0x128)]>0x0)for(let _0x1be0a4 of _0x5561df[_0x32e992(0x108)]){let _0x2647de={'sender':_0x1be0a4['from_session']||_0x32e992(0x13c),'sender_id':_0x32e992(0x172),'user':_0x1be0a4[_0x32e992(0x182)]||'hub','task_id':_0x1be0a4['id'],'priority':_0x1be0a4[_0x32e992(0x15c)]||_0x32e992(0x11e)};k[_0x32e992(0x13d)](_0x1be0a4['id'],_0x1be0a4[_0x32e992(0x182)]||_0x32e992(0x13c)),await K['notification']({'method':_0x32e992(0x14e),'params':{'content':_0x1be0a4[_0x32e992(0x174)],'meta':_0x2647de}}),Y(_0x32e992(0x17e)+_0x1be0a4['id']['slice'](0x0,0x8)+'\x20from\x20'+_0x1be0a4[_0x32e992(0x182)]+':\x20'+_0x1be0a4['content']['slice'](0x0,0x3c)),await P(_0x32e992(0x152),{'alias':Z,'message_id':_0x1be0a4['id']});}}}async function A(){const _0x32cf70=a0_0x13d088;let _0x566630=new a0_0x1fb6d6();await K[_0x32cf70(0x116)](_0x566630),Y(_0x32cf70(0x154)),Y('starting\x20SSE\x20listener...'),u()[_0x32cf70(0x17f)](_0x434fbe=>Y(_0x32cf70(0x117)+_0x434fbe)),P('report_status',{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x3993dc(),'hostname':a0_0x3993dc(),'agent':_0x32cf70(0x170),'project_dir':process[_0x32cf70(0x10f)](),'tmux_name':j||void 0x0})[_0x32cf70(0x11f)](()=>Y(_0x32cf70(0x16b)+Z+_0x32cf70(0x102)+w[_0x32cf70(0x176)](0x0,0x8)+')'))[_0x32cf70(0x17f)](_0xc32ec=>Y('warning:\x20could\x20not\x20register:\x20'+_0xc32ec)),setInterval(()=>{const _0x655e5c=_0x32cf70;P(_0x655e5c(0x173),{'resume_id':w,'alias':Z,'status':_0x655e5c(0x10d),'server':a0_0x3993dc(),'hostname':a0_0x3993dc(),'agent':_0x655e5c(0x170),'project_dir':process[_0x655e5c(0x10f)](),'tmux_name':j||void 0x0})['catch'](_0x414f2a=>Y('heartbeat\x20failed:\x20'+_0x414f2a));},0x2bf20),Y(_0x32cf70(0x17d));}A()['catch'](_0x1b5642=>{const _0x42bd22=a0_0x13d088;Y(_0x42bd22(0x138)+_0x1b5642),process[_0x42bd22(0x171)](0x1);});async function N(){const _0x2f13cb=a0_0x13d088;Y('shutting\x20down,\x20reporting\x20offline...'),await P(_0x2f13cb(0x173),{'resume_id':w,'alias':Z,'status':'offline','task':_0x2f13cb(0x10a)})[_0x2f13cb(0x17f)](()=>{}),process['exit'](0x0);}process['stdin']['on'](a0_0x13d088(0x139),()=>N()),process['on']('SIGTERM',()=>N()),process['on']('SIGINT',()=>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.9",
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",