@sleep2agi/agent-network 2.1.15-preview.0 → 2.1.15-preview.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- const a0_0x58b63e=a0_0x3967;(function(_0x905819,_0x5c968e){const _0x2c29a0=a0_0x3967,_0x3562e7=_0x905819();while(!![]){try{const _0x35e1f8=parseInt(_0x2c29a0(0x13f))/0x1*(-parseInt(_0x2c29a0(0x12d))/0x2)+parseInt(_0x2c29a0(0x136))/0x3*(parseInt(_0x2c29a0(0x170))/0x4)+parseInt(_0x2c29a0(0x16f))/0x5+parseInt(_0x2c29a0(0x17a))/0x6+-parseInt(_0x2c29a0(0x17b))/0x7+-parseInt(_0x2c29a0(0x154))/0x8*(parseInt(_0x2c29a0(0x13a))/0x9)+parseInt(_0x2c29a0(0x15d))/0xa*(parseInt(_0x2c29a0(0x15c))/0xb);if(_0x35e1f8===_0x5c968e)break;else _0x3562e7['push'](_0x3562e7['shift']());}catch(_0xc3c8c1){_0x3562e7['push'](_0x3562e7['shift']());}}}(a0_0x1ef5,0x73048));import{EventEmitter as a0_0x251b6e}from'events';function a0_0x1ef5(){const _0x17ac45=['replace','server','get_inbox','send','match','heartbeatTimer','toTimeString','2.0','getReader','144JhtXnR','connectSSE','Authorization','min','new_message','SSE\x20failed:\x20','ack_inbox','normal','33GpeSuQ','1521470kvrxbw','abort',']\x20[commhub:','getAllStatus','token','inbox\x20error:\x20','reply','SSE\x20error:\x20','disconnect','now','name','alias','AbortError','disconnected','emit','data:\x20','parse','resumeId','1359020VETqtW','16DDPBkk','reconnectDelay','task','text','content','new_task','offline','message','agent','SSE\x20reconnecting\x20in\x20','4667268GyAiPu','2384781eJYVQQ','sleep','sdk','call','send_task','from_session','result','960YDCCcZ','heartbeatInterval','slice','status','broadcast','idle','connected','autoConnect','cwd','127731lVeUMX','running','heartbeat\x20failed:\x20','SSE\x20connected','260478yvGQBK','report_status','connect','sseAbort','startsWith','716RFFYUZ','type','/events/','send_message','s...','registered','catch','url','get_all_status','log','error','processInbox'];a0_0x1ef5=function(){return _0x17ac45;};return a0_0x1ef5();}import{hostname as a0_0x373a4f}from'os';class T extends a0_0x251b6e{['url'];[a0_0x58b63e(0x168)];[a0_0x58b63e(0x161)];[a0_0x58b63e(0x178)];[a0_0x58b63e(0x16e)];['heartbeatInterval'];[a0_0x58b63e(0x171)];[a0_0x58b63e(0x150)];[a0_0x58b63e(0x13d)];['running']=!0x1;constructor(_0x1a79d8){const _0x516a5=a0_0x58b63e;super();if(this[_0x516a5(0x146)]=_0x1a79d8[_0x516a5(0x146)][_0x516a5(0x14b)](/\/$/,''),this[_0x516a5(0x168)]=_0x1a79d8['alias'],this[_0x516a5(0x161)]=_0x1a79d8[_0x516a5(0x161)],this[_0x516a5(0x178)]=_0x1a79d8[_0x516a5(0x178)]||_0x516a5(0x17d),this[_0x516a5(0x16e)]='sdk-'+_0x1a79d8[_0x516a5(0x168)]+'-'+Date[_0x516a5(0x166)]()['toString'](0x24),this[_0x516a5(0x12e)]=_0x1a79d8[_0x516a5(0x12e)]??0x2bf20,this[_0x516a5(0x171)]=_0x1a79d8['reconnectDelay']??0xbb8,_0x1a79d8[_0x516a5(0x134)]!==!0x1)this[_0x516a5(0x13c)]();}['log'](_0xbf8ae9){const _0x278cf4=a0_0x58b63e;console[_0x278cf4(0x148)]('['+new Date()[_0x278cf4(0x151)]()[_0x278cf4(0x12f)](0x0,0x8)+_0x278cf4(0x15f)+this[_0x278cf4(0x168)]+']\x20'+_0xbf8ae9);}async[a0_0x58b63e(0x17e)](_0xd1d4b5,_0x23b211){const _0x3e5e7c=a0_0x58b63e;let _0x37522b={'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream'};if(this['token'])_0x37522b[_0x3e5e7c(0x156)]='Bearer\x20'+this['token'];let _0x30d847=await(await fetch(this[_0x3e5e7c(0x146)]+'/mcp',{'method':'POST','headers':_0x37522b,'body':JSON['stringify']({'jsonrpc':_0x3e5e7c(0x152),'id':Date['now'](),'method':'tools/call','params':{'name':_0xd1d4b5,'arguments':_0x23b211}})}))[_0x3e5e7c(0x173)](),_0x3859d3=_0x30d847[_0x3e5e7c(0x14f)](/data: (.+)/),_0x25a61b=_0x3859d3?JSON[_0x3e5e7c(0x16d)](_0x3859d3[0x1]):JSON['parse'](_0x30d847),_0x1a5317=_0x25a61b?.[_0x3e5e7c(0x181)]?.['content']?.[0x0]?.[_0x3e5e7c(0x173)];return _0x1a5317?JSON[_0x3e5e7c(0x16d)](_0x1a5317):_0x25a61b;}async['connect'](){const _0x422ca8=a0_0x58b63e;if(this[_0x422ca8(0x137)])return;this[_0x422ca8(0x137)]=!0x0,await this[_0x422ca8(0x130)](_0x422ca8(0x132)),this[_0x422ca8(0x148)](_0x422ca8(0x144)),this['heartbeatTimer']=setInterval(()=>{const _0x4702a8=_0x422ca8;this[_0x4702a8(0x130)](_0x4702a8(0x132))[_0x4702a8(0x145)](_0x31d83a=>this[_0x4702a8(0x148)](_0x4702a8(0x138)+_0x31d83a['message']));},this['heartbeatInterval']),this['connectSSE']();}async[a0_0x58b63e(0x165)](){const _0x50984f=a0_0x58b63e;if(this['running']=!0x1,this['sseAbort']?.[_0x50984f(0x15e)](),this[_0x50984f(0x150)])clearInterval(this['heartbeatTimer']);await this[_0x50984f(0x130)](_0x50984f(0x176))[_0x50984f(0x145)](()=>{}),this[_0x50984f(0x148)](_0x50984f(0x16a));}async[a0_0x58b63e(0x14e)](_0x44bb73,_0x56d09c,_0x550f07=a0_0x58b63e(0x15b)){const _0x2752b2=a0_0x58b63e;return this[_0x2752b2(0x17e)](_0x2752b2(0x17f),{'alias':_0x44bb73,'task':_0x56d09c,'priority':_0x550f07,'from_session':this['alias']});}async[a0_0x58b63e(0x177)](_0x26d21b,_0x2b856b){const _0x5af6aa=a0_0x58b63e;return this[_0x5af6aa(0x17e)](_0x5af6aa(0x142),{'alias':_0x26d21b,'message':_0x2b856b,'from_session':this['alias']});}async[a0_0x58b63e(0x163)](_0x2b61b9,_0x127123,_0x3a34bb='completed'){return this['call']('send_reply',{'in_reply_to':_0x2b61b9,'text':_0x127123,'status':_0x3a34bb});}async[a0_0x58b63e(0x130)](_0x509fa7,_0x38e9ec){const _0x424ccd=a0_0x58b63e;return this[_0x424ccd(0x17e)](_0x424ccd(0x13b),{'resume_id':this['resumeId'],'alias':this[_0x424ccd(0x168)],'status':_0x509fa7,'server':a0_0x373a4f(),'hostname':a0_0x373a4f(),'agent':this[_0x424ccd(0x178)],'project_dir':process[_0x424ccd(0x135)](),..._0x38e9ec});}async[a0_0x58b63e(0x160)](){const _0x17095c=a0_0x58b63e;return this[_0x17095c(0x17e)](_0x17095c(0x147),{});}async[a0_0x58b63e(0x131)](_0x1a1562,_0x39fda0){const _0x8528d9=a0_0x58b63e;return this[_0x8528d9(0x17e)]('broadcast',{'message':_0x1a1562,'filter_server':_0x39fda0?.[_0x8528d9(0x14c)],'filter_status':_0x39fda0?.[_0x8528d9(0x130)]});}async[a0_0x58b63e(0x155)](){const _0x458f66=a0_0x58b63e;let _0x23361a=encodeURIComponent(this[_0x458f66(0x168)]),_0xfa8aab=this['url']+_0x458f66(0x141)+_0x23361a,_0x575eec=this[_0x458f66(0x171)];while(this[_0x458f66(0x137)]){try{this['sseAbort']=new AbortController();let _0x2aff84={'Accept':'text/event-stream'};if(this[_0x458f66(0x161)])_0x2aff84[_0x458f66(0x156)]='Bearer\x20'+this['token'];let _0x1a35a6=await fetch(_0xfa8aab,{'headers':_0x2aff84,'signal':this[_0x458f66(0x13d)]['signal']});if(!_0x1a35a6['ok']||!_0x1a35a6['body']){this[_0x458f66(0x148)](_0x458f66(0x159)+_0x1a35a6['status']),await this[_0x458f66(0x17c)](_0x575eec),_0x575eec=Math[_0x458f66(0x157)](_0x575eec*1.5,0xea60);continue;}_0x575eec=this[_0x458f66(0x171)];let _0x65ef35=_0x1a35a6['body'][_0x458f66(0x153)](),_0x53e2ed=new TextDecoder(),_0x1377bd='';while(this[_0x458f66(0x137)]){let {done:_0x91fe4a,value:_0x274c5e}=await _0x65ef35['read']();if(_0x91fe4a)break;_0x1377bd+=_0x53e2ed['decode'](_0x274c5e,{'stream':!0x0});let _0x354f41=_0x1377bd['split']('\x0a');_0x1377bd=_0x354f41['pop']()||'';for(let _0x391d5b of _0x354f41){if(!_0x391d5b[_0x458f66(0x13e)](_0x458f66(0x16c)))continue;try{let _0xc75cd=JSON[_0x458f66(0x16d)](_0x391d5b['slice'](0x6));if(_0xc75cd[_0x458f66(0x140)]==='connected'){this[_0x458f66(0x148)](_0x458f66(0x139)),this[_0x458f66(0x16b)](_0x458f66(0x133));continue;}if(_0xc75cd[_0x458f66(0x140)]===_0x458f66(0x175)||_0xc75cd[_0x458f66(0x140)]===_0x458f66(0x158)||_0xc75cd['type']===_0x458f66(0x131))await this[_0x458f66(0x14a)]();}catch{}}}}catch(_0x1dd589){if(_0x1dd589[_0x458f66(0x167)]===_0x458f66(0x169))break;this['emit'](_0x458f66(0x149),_0x1dd589),this[_0x458f66(0x148)](_0x458f66(0x164)+_0x1dd589[_0x458f66(0x177)]);}if(this[_0x458f66(0x137)])this[_0x458f66(0x16b)]('disconnected'),this['log'](_0x458f66(0x179)+_0x575eec/0x3e8+_0x458f66(0x143)),await this[_0x458f66(0x17c)](_0x575eec),_0x575eec=Math[_0x458f66(0x157)](_0x575eec*1.5,0xea60);}}async[a0_0x58b63e(0x14a)](){const _0x127912=a0_0x58b63e;try{let _0x23f153=(await this['call'](_0x127912(0x14d),{'alias':this[_0x127912(0x168)],'limit':0xa}))?.['messages']||[];for(let _0x559850 of _0x23f153)await this['call'](_0x127912(0x15a),{'alias':this['alias'],'message_id':_0x559850['id']}),this[_0x127912(0x148)]('←\x20'+_0x559850[_0x127912(0x180)]+':\x20'+_0x559850[_0x127912(0x174)][_0x127912(0x12f)](0x0,0x3c)),this[_0x127912(0x16b)](_0x127912(0x172),_0x559850),this['emit'](_0x127912(0x177),_0x559850);}catch(_0x1e828d){this[_0x127912(0x148)](_0x127912(0x162)+_0x1e828d['message']);}}['sleep'](_0x64b3b5){return new Promise(_0x1ffc8d=>setTimeout(_0x1ffc8d,_0x64b3b5));}}function a0_0x3967(_0x30675b,_0x4512c7){_0x30675b=_0x30675b-0x12d;const _0x1ef53c=a0_0x1ef5();let _0x3967b7=_0x1ef53c[_0x30675b];return _0x3967b7;}var $=T;export{$ as default,T as CommHub};
1
+ const a0_0x1f9b62=a0_0x50c3;(function(_0x247e8b,_0x424e00){const _0x580d08=a0_0x50c3,_0x2a7053=_0x247e8b();while(!![]){try{const _0xedea8=parseInt(_0x580d08(0x169))/0x1*(parseInt(_0x580d08(0x162))/0x2)+-parseInt(_0x580d08(0x161))/0x3+parseInt(_0x580d08(0x183))/0x4*(parseInt(_0x580d08(0x163))/0x5)+parseInt(_0x580d08(0x156))/0x6+-parseInt(_0x580d08(0x165))/0x7+parseInt(_0x580d08(0x189))/0x8+-parseInt(_0x580d08(0x15a))/0x9;if(_0xedea8===_0x424e00)break;else _0x2a7053['push'](_0x2a7053['shift']());}catch(_0x12fff5){_0x2a7053['push'](_0x2a7053['shift']());}}}(a0_0x3f0e,0xccd98));import{EventEmitter as a0_0x5e539f}from'events';function a0_0x3f0e(){const _0x4fa657=['parse','alias','call','abort',']\x20[commhub:','2.0','SSE\x20reconnecting\x20in\x20','min','application/json,\x20text/event-stream','from_session','now','registered','4tCgLoT','match','disconnected','split','pop','/mcp','1077408NNgxUO','emit','sseAbort','messages','heartbeatTimer','running','SSE\x20failed:\x20','stringify','inbox\x20error:\x20','getReader','normal','autoConnect','reconnectDelay','data:\x20','token','getAllStatus','send_task','url','disconnect','reply','offline','report_status','catch','message','resumeId','heartbeat\x20failed:\x20','connected','replace','get_inbox','heartbeatInterval','ack_inbox','send','processInbox','type','read','idle','content','5638950IjOrwq','slice','agent','Bearer\x20','5654151narrMl','Authorization','name','sleep','result','status','toString','139143GkxbFG','2cRWXNa','1068505UlXKpz','new_message','3576524uZHTGF','new_task','startsWith','/events/','736414sOTgBz','connectSSE','text','broadcast','task','body','log','POST','decode','send_message','signal','SSE\x20connected','SSE\x20error:\x20','send_reply'];a0_0x3f0e=function(){return _0x4fa657;};return a0_0x3f0e();}import{hostname as a0_0x3a9c80}from'os';class T extends a0_0x5e539f{[a0_0x1f9b62(0x142)];['alias'];[a0_0x1f9b62(0x13f)];[a0_0x1f9b62(0x158)];['resumeId'];[a0_0x1f9b62(0x14e)];[a0_0x1f9b62(0x195)];[a0_0x1f9b62(0x18d)];[a0_0x1f9b62(0x18b)];[a0_0x1f9b62(0x18e)]=!0x1;constructor(_0x2d969e){const _0x52695c=a0_0x1f9b62;super();if(this[_0x52695c(0x142)]=_0x2d969e[_0x52695c(0x142)][_0x52695c(0x14c)](/\/$/,''),this[_0x52695c(0x178)]=_0x2d969e[_0x52695c(0x178)],this[_0x52695c(0x13f)]=_0x2d969e[_0x52695c(0x13f)],this[_0x52695c(0x158)]=_0x2d969e[_0x52695c(0x158)]||'sdk',this[_0x52695c(0x149)]='sdk-'+_0x2d969e[_0x52695c(0x178)]+'-'+Date['now']()[_0x52695c(0x160)](0x24),this['heartbeatInterval']=_0x2d969e['heartbeatInterval']??0x2bf20,this[_0x52695c(0x195)]=_0x2d969e[_0x52695c(0x195)]??0xbb8,_0x2d969e[_0x52695c(0x194)]!==!0x1)this['connect']();}[a0_0x1f9b62(0x16f)](_0x4f6aa1){const _0x11bcc3=a0_0x1f9b62;console[_0x11bcc3(0x16f)]('['+new Date()['toTimeString']()['slice'](0x0,0x8)+_0x11bcc3(0x17b)+this['alias']+']\x20'+_0x4f6aa1);}async[a0_0x1f9b62(0x179)](_0x1cbc59,_0x5c89e8){const _0x2f509b=a0_0x1f9b62;let _0x529faa={'Content-Type':'application/json','Accept':_0x2f509b(0x17f)};if(this['token'])_0x529faa[_0x2f509b(0x15b)]=_0x2f509b(0x159)+this[_0x2f509b(0x13f)];let _0x44ce1c=await(await fetch(this[_0x2f509b(0x142)]+_0x2f509b(0x188),{'method':_0x2f509b(0x170),'headers':_0x529faa,'body':JSON[_0x2f509b(0x190)]({'jsonrpc':_0x2f509b(0x17c),'id':Date[_0x2f509b(0x181)](),'method':'tools/call','params':{'name':_0x1cbc59,'arguments':_0x5c89e8}})}))['text'](),_0x415853=_0x44ce1c[_0x2f509b(0x184)](/data: (.+)/),_0x5ab620=_0x415853?JSON['parse'](_0x415853[0x1]):JSON[_0x2f509b(0x177)](_0x44ce1c),_0x21677f=_0x5ab620?.[_0x2f509b(0x15e)]?.[_0x2f509b(0x155)]?.[0x0]?.[_0x2f509b(0x16b)];return _0x21677f?JSON['parse'](_0x21677f):_0x5ab620;}async['connect'](){const _0x1db8b9=a0_0x1f9b62;if(this[_0x1db8b9(0x18e)])return;this[_0x1db8b9(0x18e)]=!0x0,await this['status'](_0x1db8b9(0x154)),this[_0x1db8b9(0x16f)](_0x1db8b9(0x182)),this[_0x1db8b9(0x18d)]=setInterval(()=>{const _0x121bf9=_0x1db8b9;this['status'](_0x121bf9(0x154))['catch'](_0xa86c2a=>this[_0x121bf9(0x16f)](_0x121bf9(0x14a)+_0xa86c2a[_0x121bf9(0x148)]));},this[_0x1db8b9(0x14e)]),this[_0x1db8b9(0x16a)]();}async[a0_0x1f9b62(0x143)](){const _0x58770e=a0_0x1f9b62;if(this[_0x58770e(0x18e)]=!0x1,this[_0x58770e(0x18b)]?.[_0x58770e(0x17a)](),this[_0x58770e(0x18d)])clearInterval(this[_0x58770e(0x18d)]);await this[_0x58770e(0x15f)](_0x58770e(0x145))[_0x58770e(0x147)](()=>{}),this[_0x58770e(0x16f)]('disconnected');}async[a0_0x1f9b62(0x150)](_0x337d1c,_0x46aa67,_0x1613a0=a0_0x1f9b62(0x193)){const _0x4748a8=a0_0x1f9b62;return this[_0x4748a8(0x179)](_0x4748a8(0x141),{'alias':_0x337d1c,'task':_0x46aa67,'priority':_0x1613a0,'from_session':this[_0x4748a8(0x178)]});}async[a0_0x1f9b62(0x148)](_0x55ba13,_0x46e712){const _0x505d06=a0_0x1f9b62;return this[_0x505d06(0x179)](_0x505d06(0x172),{'alias':_0x55ba13,'message':_0x46e712,'from_session':this[_0x505d06(0x178)]});}async[a0_0x1f9b62(0x144)](_0x1fe995,_0x3a18b0,_0x73e3e2='completed'){const _0x1f729a=a0_0x1f9b62;return this[_0x1f729a(0x179)](_0x1f729a(0x176),{'in_reply_to':_0x1fe995,'text':_0x3a18b0,'status':_0x73e3e2});}async[a0_0x1f9b62(0x15f)](_0x51f71a,_0x4cdefb){const _0x1724de=a0_0x1f9b62;return this[_0x1724de(0x179)](_0x1724de(0x146),{'resume_id':this[_0x1724de(0x149)],'alias':this[_0x1724de(0x178)],'status':_0x51f71a,'server':a0_0x3a9c80(),'hostname':a0_0x3a9c80(),'agent':this['agent'],'project_dir':process['cwd'](),..._0x4cdefb});}async[a0_0x1f9b62(0x140)](){const _0xc4ff23=a0_0x1f9b62;return this[_0xc4ff23(0x179)]('get_all_status',{});}async['broadcast'](_0x21eade,_0x4d3bbc){const _0x902c97=a0_0x1f9b62;return this[_0x902c97(0x179)]('broadcast',{'message':_0x21eade,'filter_server':_0x4d3bbc?.['server'],'filter_status':_0x4d3bbc?.[_0x902c97(0x15f)]});}async['connectSSE'](){const _0x2379c7=a0_0x1f9b62;let _0x4af5f5=encodeURIComponent(this[_0x2379c7(0x178)]),_0xbe8937=this['url']+_0x2379c7(0x168)+_0x4af5f5,_0x208af2=this[_0x2379c7(0x195)];while(this[_0x2379c7(0x18e)]){try{this['sseAbort']=new AbortController();let _0x255751={'Accept':'text/event-stream'};if(this[_0x2379c7(0x13f)])_0x255751['Authorization']='Bearer\x20'+this[_0x2379c7(0x13f)];let _0x3f0ed1=await fetch(_0xbe8937,{'headers':_0x255751,'signal':this[_0x2379c7(0x18b)][_0x2379c7(0x173)]});if(!_0x3f0ed1['ok']||!_0x3f0ed1[_0x2379c7(0x16e)]){this[_0x2379c7(0x16f)](_0x2379c7(0x18f)+_0x3f0ed1[_0x2379c7(0x15f)]),await this['sleep'](_0x208af2),_0x208af2=Math[_0x2379c7(0x17e)](_0x208af2*1.5,0xea60);continue;}_0x208af2=this[_0x2379c7(0x195)];let _0x459861=_0x3f0ed1[_0x2379c7(0x16e)][_0x2379c7(0x192)](),_0x354e23=new TextDecoder(),_0x3ff66f='';while(this[_0x2379c7(0x18e)]){let {done:_0xf203ac,value:_0x5b2847}=await _0x459861[_0x2379c7(0x153)]();if(_0xf203ac)break;_0x3ff66f+=_0x354e23[_0x2379c7(0x171)](_0x5b2847,{'stream':!0x0});let _0x13da12=_0x3ff66f[_0x2379c7(0x186)]('\x0a');_0x3ff66f=_0x13da12[_0x2379c7(0x187)]()||'';for(let _0x41b9d5 of _0x13da12){if(!_0x41b9d5[_0x2379c7(0x167)](_0x2379c7(0x13e)))continue;try{let _0x455d9f=JSON[_0x2379c7(0x177)](_0x41b9d5[_0x2379c7(0x157)](0x6));if(_0x455d9f[_0x2379c7(0x152)]===_0x2379c7(0x14b)){this[_0x2379c7(0x16f)](_0x2379c7(0x174)),this[_0x2379c7(0x18a)](_0x2379c7(0x14b));continue;}if(_0x455d9f['type']===_0x2379c7(0x166)||_0x455d9f[_0x2379c7(0x152)]===_0x2379c7(0x164)||_0x455d9f[_0x2379c7(0x152)]===_0x2379c7(0x16c))await this[_0x2379c7(0x151)]();}catch{}}}}catch(_0x3a6be3){if(_0x3a6be3[_0x2379c7(0x15c)]==='AbortError')break;this[_0x2379c7(0x18a)]('error',_0x3a6be3),this[_0x2379c7(0x16f)](_0x2379c7(0x175)+_0x3a6be3[_0x2379c7(0x148)]);}if(this[_0x2379c7(0x18e)])this[_0x2379c7(0x18a)](_0x2379c7(0x185)),this[_0x2379c7(0x16f)](_0x2379c7(0x17d)+_0x208af2/0x3e8+'s...'),await this[_0x2379c7(0x15d)](_0x208af2),_0x208af2=Math['min'](_0x208af2*1.5,0xea60);}}async[a0_0x1f9b62(0x151)](){const _0x4705cb=a0_0x1f9b62;try{let _0x53b4b9=(await this[_0x4705cb(0x179)](_0x4705cb(0x14d),{'alias':this['alias'],'limit':0xa}))?.[_0x4705cb(0x18c)]||[];for(let _0x35fe58 of _0x53b4b9)await this[_0x4705cb(0x179)](_0x4705cb(0x14f),{'alias':this[_0x4705cb(0x178)],'message_id':_0x35fe58['id']}),this[_0x4705cb(0x16f)]('←\x20'+_0x35fe58[_0x4705cb(0x180)]+':\x20'+_0x35fe58['content']['slice'](0x0,0x3c)),this['emit'](_0x4705cb(0x16d),_0x35fe58),this[_0x4705cb(0x18a)](_0x4705cb(0x148),_0x35fe58);}catch(_0x317bb7){this[_0x4705cb(0x16f)](_0x4705cb(0x191)+_0x317bb7[_0x4705cb(0x148)]);}}['sleep'](_0x4fe913){return new Promise(_0x3d5c1d=>setTimeout(_0x3d5c1d,_0x4fe913));}}var $=T;function a0_0x50c3(_0x589c6c,_0x4482c0){_0x589c6c=_0x589c6c-0x13e;const _0x3f0e01=a0_0x3f0e();let _0x50c337=_0x3f0e01[_0x589c6c];return _0x50c337;}export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x118688=a0_0x1bf7;(function(_0x30bee8,_0x429ef7){const _0x5a233b=a0_0x1bf7,_0x2d84cc=_0x30bee8();while(!![]){try{const _0x19d93a=parseInt(_0x5a233b(0xc5))/0x1+parseInt(_0x5a233b(0x133))/0x2*(parseInt(_0x5a233b(0x138))/0x3)+-parseInt(_0x5a233b(0x108))/0x4*(-parseInt(_0x5a233b(0xdf))/0x5)+-parseInt(_0x5a233b(0x140))/0x6*(-parseInt(_0x5a233b(0x14d))/0x7)+-parseInt(_0x5a233b(0x12e))/0x8+parseInt(_0x5a233b(0x141))/0x9+-parseInt(_0x5a233b(0xd5))/0xa;if(_0x19d93a===_0x429ef7)break;else _0x2d84cc['push'](_0x2d84cc['shift']());}catch(_0x5977b7){_0x2d84cc['push'](_0x2d84cc['shift']());}}}(a0_0x583e,0xdbb89));import{readFileSync as a0_0x29b1d5,existsSync as a0_0x1095a6}from'fs';import{randomUUID as a0_0x388ba7}from'crypto';import{join as a0_0x3325c0}from'path';import{hostname as a0_0x3a82c8}from'os';import{execSync as a0_0x27156a}from'child_process';import{Server as a0_0x25907a}from'@modelcontextprotocol/sdk/server/index.js';function a0_0x1bf7(_0x2ae061,_0x4826c1){_0x2ae061=_0x2ae061-0xc5;const _0x583e0d=a0_0x583e();let _0x1bf737=_0x583e0d[_0x2ae061];return _0x1bf737;}import{StdioServerTransport as a0_0x2f2e05}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x40b11a,CallToolRequestSchema as a0_0x458d8a}from'@modelcontextprotocol/sdk/types.js';function p(_0x23c37f){const _0x58f162=a0_0x1bf7;if(!a0_0x1095a6(_0x23c37f))return;for(let _0x58396d of a0_0x29b1d5(_0x23c37f,_0x58f162(0xe5))[_0x58f162(0x130)]('\x0a')){let _0x2c6b55=_0x58396d[_0x58f162(0xf3)]();if(!_0x2c6b55||_0x2c6b55[_0x58f162(0x114)]('#'))continue;let _0x445e1e=_0x2c6b55['indexOf']('=');if(_0x445e1e<0x0)continue;let _0x52d4a7=_0x2c6b55[_0x58f162(0xf1)](0x0,_0x445e1e)[_0x58f162(0xf3)](),_0x46b700=_0x2c6b55[_0x58f162(0xf1)](_0x445e1e+0x1)[_0x58f162(0xf3)]()['replace'](/^["']|["']$/g,'');if(!process.env[_0x52d4a7])process.env[_0x52d4a7]=_0x46b700;}}var C=process.env.HOME||'~',T=a0_0x3325c0(C,'.claude/channels/commhub');p(a0_0x3325c0(T,a0_0x118688(0xd0)));var L=process[a0_0x118688(0x127)]()[a0_0x118688(0x122)](/\//g,'-');p(a0_0x3325c0(T,L,a0_0x118688(0xd0)));function U(){const _0x31257f=a0_0x118688;try{return a0_0x27156a(_0x31257f(0xce),{'encoding':'utf-8','timeout':0x7d0})[_0x31257f(0xf3)]();}catch{return'';}}function v(){const _0x5333ad=a0_0x118688;try{let _0x92ace2=a0_0x3325c0(C,_0x5333ad(0x14b),_0x5333ad(0xd4));if(a0_0x1095a6(_0x92ace2))return JSON['parse'](a0_0x29b1d5(_0x92ace2,_0x5333ad(0xe5)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x118688(0x102)]||a0_0x118688(0xeb),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x3a82c8(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x388ba7(),X=process.env.COMMHUB_TOKEN||H['token']||'';function Y(_0x11a874){const _0x46fae2=a0_0x118688;let _0xe9a9f8=new Date()[_0x46fae2(0x14c)]()[_0x46fae2(0xf1)](0x0,0x8);process[_0x46fae2(0xd7)][_0x46fae2(0x121)]('['+_0xe9a9f8+_0x46fae2(0xe2)+_0x11a874+'\x0a');}function h(_0x238767){return new Promise(_0x150459=>setTimeout(_0x150459,_0x238767));}Y(a0_0x118688(0xc9)+f+'\x20ALIAS='+Z+a0_0x118688(0x109)+w['slice'](0x0,0x8)+a0_0x118688(0xd2)+(j||a0_0x118688(0xdb))+'\x20CWD='+process[a0_0x118688(0x127)]()+a0_0x118688(0xe8)+L);function a0_0x583e(){const _0x4561cc=['write','replace','from_session','stringify','parse\x20error:\x20','Priority\x20(default:\x20normal)','cwd','commhub_reply','CommHub\x20init\x20failed:\x20','warning:\x20could\x20not\x20register:\x20','end','catch','Authorization','8625696ZsnCxs','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','split','read','Reply\x20text\x20/\x20result\x20summary','28sJmUud','setRequestHandler','completed','object','get_all_status','68187NLlHbW','init\x20failed:\x20','notifications/claude/channel','application/json,\x20text/event-stream','\x22\x20(','working','commhub_report_status','statusText','7662rmdIOB','1763343hAsbRn','heartbeat\x20failed:\x20','normal','parse','new_message','message_id','commhub_send_task','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','session\x20disconnected','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','.anet','toTimeString','4228usToyi','error','in_progress','getReader','1459196tdQtRW','result','cancelled','\x20priority=','ENV:\x20URL=','alias','SIGTERM','inbox_count','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','tmux\x20display-message\x20-p\x20\x27#S\x27','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','.env','commhub-channel','...\x20TMUX=','/events/','config.json','20148350gqyUFs','string','stderr','pop','notification','commhub_get_all_status','none','broadcast','claude-code','failed','891705wihUBR','ack_inbox','number',']\x20[commhub]\x20','message','content','utf-8','status','then','\x20PROJECT_ENV=','Bearer\x20','report_status','http://127.0.0.1:9200','ready\x20—\x20waiting\x20for\x20events','commhub','params','messages','send_reply','slice','blocked','trim','fatal:\x20','exit','Message\x20content','connected','2025-03-26','get','priority','connecting\x20to\x20','SSE\x20fatal:\x20','decode','0.3.0','/mcp','type','stdin','hub','data:\x20','task','tools/call','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','starting\x20SSE\x20listener...','28zbRNGu','\x20RESUME_ID=','→\x20injected\x20task\x20','\x20from\x20','SSE\x20stream\x20ended,\x20reconnecting...','POST','send_task',':\x20inbox_count=','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','commhub_send_message','set','idle','startsWith','get_inbox','length','application/json','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','Target\x20session\x20alias','MCP\x20stdio\x20connected','SIGINT','text','2.0','find','Progress\x200-100','from'];a0_0x583e=function(){return _0x4561cc;};return a0_0x583e();}var k=new Map(),K=new a0_0x25907a({'name':a0_0x118688(0xd1),'version':a0_0x118688(0xfe)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x118688(0x148),'These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.',a0_0x118688(0x118),a0_0x118688(0xcf),'Session\x20alias:\x20'+Z]['join']('\x0a')});K[a0_0x118688(0x134)](a0_0x40b11a,async()=>({'tools':[{'name':a0_0x118688(0x128),'description':'Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','inputSchema':{'type':a0_0x118688(0x136),'properties':{'task_id':{'type':a0_0x118688(0xd6),'description':a0_0x118688(0x14a)},'text':{'type':a0_0x118688(0xd6),'description':a0_0x118688(0x132)},'status':{'type':a0_0x118688(0xd6),'enum':[a0_0x118688(0x135),'failed',a0_0x118688(0xc7),a0_0x118688(0xf2),'error',a0_0x118688(0x14f)],'description':a0_0x118688(0x106)}},'required':[a0_0x118688(0x11c)]}},{'name':'commhub_report_status','description':a0_0x118688(0x110),'inputSchema':{'type':a0_0x118688(0x136),'properties':{'status':{'type':a0_0x118688(0xd6),'enum':[a0_0x118688(0x13d),a0_0x118688(0x113),'blocked','error']},'task':{'type':a0_0x118688(0xd6),'description':'Current\x20task\x20description'},'progress':{'type':a0_0x118688(0xe1),'description':a0_0x118688(0x11f)}},'required':[a0_0x118688(0xe6)]}},{'name':a0_0x118688(0x147),'description':'Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','inputSchema':{'type':a0_0x118688(0x136),'properties':{'alias':{'type':'string','description':'Target\x20session\x20alias'},'task':{'type':a0_0x118688(0xd6),'description':'Task\x20content'},'priority':{'type':a0_0x118688(0xd6),'enum':['high','normal','low'],'description':a0_0x118688(0x126)}},'required':[a0_0x118688(0xca),a0_0x118688(0x104)]}},{'name':a0_0x118688(0x111),'description':a0_0x118688(0xcd),'inputSchema':{'type':a0_0x118688(0x136),'properties':{'alias':{'type':a0_0x118688(0xd6),'description':a0_0x118688(0x119)},'message':{'type':'string','description':a0_0x118688(0xf6)}},'required':['alias',a0_0x118688(0xe3)]}},{'name':a0_0x118688(0xda),'description':a0_0x118688(0x12f),'inputSchema':{'type':a0_0x118688(0x136),'properties':{}}}]}));async function P(_0x1f92c4,_0x2cae84){const _0x36f5c4=a0_0x118688;let _0x51bdb3=await fetch(f+_0x36f5c4(0xff),{'method':_0x36f5c4(0x10d),'headers':{'Content-Type':_0x36f5c4(0x117),'Accept':_0x36f5c4(0x13b),...X?{'Authorization':_0x36f5c4(0xe9)+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x36f5c4(0x11d),'id':0x1,'method':'initialize','params':{'protocolVersion':_0x36f5c4(0xf8),'capabilities':{},'clientInfo':{'name':_0x36f5c4(0xd1),'version':_0x36f5c4(0xfe)}}})});if(!_0x51bdb3['ok']){let _0x4082be=await _0x51bdb3[_0x36f5c4(0x11c)]();return Y(_0x36f5c4(0x129)+_0x51bdb3[_0x36f5c4(0xe6)]+'\x20'+_0x4082be[_0x36f5c4(0xf1)](0x0,0x64)),{'ok':!0x1,'error':_0x36f5c4(0x139)+_0x51bdb3[_0x36f5c4(0xe6)]};}await _0x51bdb3[_0x36f5c4(0x11c)]();let _0x566be3=(await(await fetch(f+_0x36f5c4(0xff),{'method':_0x36f5c4(0x10d),'headers':{'Content-Type':_0x36f5c4(0x117),'Accept':_0x36f5c4(0x13b),...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON[_0x36f5c4(0x124)]({'jsonrpc':'2.0','id':0x2,'method':_0x36f5c4(0x105),'params':{'name':_0x1f92c4,'arguments':_0x2cae84}})}))[_0x36f5c4(0x11c)]())[_0x36f5c4(0x130)]('\x0a')[_0x36f5c4(0x11e)](_0x122c22=>_0x122c22['startsWith']('data:\x20'));if(_0x566be3){let _0x47af94=JSON[_0x36f5c4(0x144)](_0x566be3[_0x36f5c4(0xf1)](0x6));return _0x47af94?.[_0x36f5c4(0xc6)]?.[_0x36f5c4(0xe4)]?.[0x0]?.['text']?JSON[_0x36f5c4(0x144)](_0x47af94[_0x36f5c4(0xc6)][_0x36f5c4(0xe4)][0x0][_0x36f5c4(0x11c)]):_0x47af94;}return{'ok':!0x1,'error':'no\x20response'};}K[a0_0x118688(0x134)](a0_0x458d8a,async _0x11dc8d=>{const _0x5dba00=a0_0x118688;let {name:_0x368c5c,arguments:_0x47c410}=_0x11dc8d[_0x5dba00(0xee)];if(_0x368c5c===_0x5dba00(0x128)){let {task_id:_0x5c791c,text:_0x2fdefc,status:_0x32ac9c}=_0x47c410;if(_0x32ac9c===_0x5dba00(0x135)||_0x32ac9c===_0x5dba00(0xde)||_0x32ac9c===_0x5dba00(0xc7)){let _0x1c8e5d=_0x32ac9c===_0x5dba00(0x135)?'replied':_0x32ac9c,_0x11b49b=_0x5c791c?k[_0x5dba00(0xf9)](_0x5c791c)||_0x5dba00(0x102):_0x5dba00(0x102),_0x37b4cf=await P(_0x5dba00(0xf0),{'alias':_0x11b49b,'text':_0x2fdefc,'in_reply_to':_0x5c791c||void 0x0,'status':_0x1c8e5d,'from_session':Z});if(_0x5c791c)k['delete'](_0x5c791c);return{'content':[{'type':_0x5dba00(0x11c),'text':JSON[_0x5dba00(0x124)](_0x37b4cf)}]};}let _0x1320bc=await P(_0x5dba00(0xea),{'resume_id':w,'alias':Z,'status':_0x32ac9c==='blocked'?_0x5dba00(0xf2):_0x32ac9c==='error'?_0x5dba00(0x14e):_0x5dba00(0x13d),'task':_0x2fdefc[_0x5dba00(0xf1)](0x0,0xc8),'output':_0x2fdefc});return{'content':[{'type':_0x5dba00(0x11c),'text':JSON[_0x5dba00(0x124)](_0x1320bc)}]};}if(_0x368c5c===_0x5dba00(0x13e)){let {status:_0x121a43,task:_0x2ed419,progress:_0x4f66b3}=_0x47c410,_0x23fe5e=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x121a43,'task':_0x2ed419,'progress':_0x4f66b3});return{'content':[{'type':'text','text':JSON[_0x5dba00(0x124)](_0x23fe5e)}]};}if(_0x368c5c==='commhub_send_task'){let {alias:_0x33ee8f,task:_0x280345,priority:_0xa75e9c}=_0x47c410,_0x47e63=await P(_0x5dba00(0x10e),{'alias':_0x33ee8f,'task':_0x280345,'priority':_0xa75e9c||_0x5dba00(0x143),'from_session':Z});return{'content':[{'type':_0x5dba00(0x11c),'text':JSON[_0x5dba00(0x124)](_0x47e63)}]};}if(_0x368c5c===_0x5dba00(0x111)){let {alias:_0xf70ead,message:_0x44c938}=_0x47c410,_0x10c4b6=await P('send_message',{'alias':_0xf70ead,'message':_0x44c938,'from_session':Z});return{'content':[{'type':_0x5dba00(0x11c),'text':JSON['stringify'](_0x10c4b6)}]};}if(_0x368c5c===_0x5dba00(0xda)){let _0x94eeef=await P(_0x5dba00(0x137),{});return{'content':[{'type':_0x5dba00(0x11c),'text':JSON[_0x5dba00(0x124)](_0x94eeef)}]};}return{'content':[{'type':_0x5dba00(0x11c),'text':JSON['stringify']({'error':'unknown\x20tool'})}]};});async function u(){const _0x4e573b=a0_0x118688;let _0x6cc9d0=f+_0x4e573b(0xd3)+encodeURIComponent(Z),_0x2f3197={};if(X)_0x2f3197[_0x4e573b(0x12d)]='Bearer\x20'+X;Y(_0x4e573b(0xfb)+_0x6cc9d0);while(!0x0){try{let _0x6a79c2=await fetch(_0x6cc9d0,{'headers':_0x2f3197});if(!_0x6a79c2['ok']){Y('SSE\x20error:\x20'+_0x6a79c2[_0x4e573b(0xe6)]+'\x20'+_0x6a79c2[_0x4e573b(0x13f)]),await h(0x1388);continue;}let _0x6f8337=_0x6a79c2['body'][_0x4e573b(0x150)](),_0x534f62=new TextDecoder(),_0x4c06d3='';while(!0x0){let {done:_0x122815,value:_0x69ee8b}=await _0x6f8337[_0x4e573b(0x131)]();if(_0x122815)break;_0x4c06d3+=_0x534f62[_0x4e573b(0xfd)](_0x69ee8b,{'stream':!0x0});let _0x3c354c=_0x4c06d3[_0x4e573b(0x130)]('\x0a\x0a');_0x4c06d3=_0x3c354c[_0x4e573b(0xd8)]()||'';for(let _0x58e6c4 of _0x3c354c){let _0x360975=_0x58e6c4[_0x4e573b(0x130)]('\x0a')[_0x4e573b(0x11e)](_0x5d2b4c=>_0x5d2b4c['startsWith'](_0x4e573b(0x103)));if(!_0x360975)continue;try{let _0x96dae2=JSON[_0x4e573b(0x144)](_0x360975['slice'](0x6));await S(_0x96dae2);}catch(_0x26c980){Y(_0x4e573b(0x125)+_0x26c980);}}}Y(_0x4e573b(0x10c));}catch(_0x37b363){Y('SSE\x20connection\x20error:\x20'+_0x37b363);}await h(0xbb8);}}async function S(_0x3ee0cd){const _0x21a14d=a0_0x118688;if(_0x3ee0cd[_0x21a14d(0x100)]===_0x21a14d(0xf7)){Y('SSE\x20connected\x20as\x20\x22'+Z+'\x22');return;}if(_0x3ee0cd[_0x21a14d(0x100)]===_0x21a14d(0x145)){if(Y('←\x20message\x20from\x20'+_0x3ee0cd[_0x21a14d(0x120)]+':\x20'+_0x3ee0cd[_0x21a14d(0xe3)][_0x21a14d(0xf1)](0x0,0x3c)),await K[_0x21a14d(0xd9)]({'method':_0x21a14d(0x13a),'params':{'content':_0x3ee0cd['message'],'meta':{'sender':_0x3ee0cd[_0x21a14d(0x120)]||'hub','sender_id':_0x21a14d(0xed),'user':_0x3ee0cd['from']||_0x21a14d(0x102),'priority':_0x21a14d(0x143)}}}),_0x3ee0cd[_0x21a14d(0x146)])await P(_0x21a14d(0xe0),{'alias':Z,'message_id':_0x3ee0cd['message_id']});return;}if(_0x3ee0cd[_0x21a14d(0x100)]==='new_task'||_0x3ee0cd[_0x21a14d(0x100)]===_0x21a14d(0xdc)){Y('←\x20'+_0x3ee0cd['type']+_0x21a14d(0x10f)+_0x3ee0cd[_0x21a14d(0xcc)]+_0x21a14d(0xc8)+(_0x3ee0cd[_0x21a14d(0xfa)]||_0x21a14d(0x143)));let _0x48ad6c=await P(_0x21a14d(0x115),{'alias':Z,'limit':0x5});if(_0x48ad6c?.['ok']&&_0x48ad6c[_0x21a14d(0xef)]?.[_0x21a14d(0x116)]>0x0)for(let _0xc1843b of _0x48ad6c['messages']){let _0x3f1786={'sender':_0xc1843b[_0x21a14d(0x123)]||_0x21a14d(0x102),'sender_id':_0x21a14d(0xed),'user':_0xc1843b[_0x21a14d(0x123)]||'hub','task_id':_0xc1843b['id'],'priority':_0xc1843b[_0x21a14d(0xfa)]||_0x21a14d(0x143)};k[_0x21a14d(0x112)](_0xc1843b['id'],_0xc1843b[_0x21a14d(0x123)]||_0x21a14d(0x102)),await K[_0x21a14d(0xd9)]({'method':_0x21a14d(0x13a),'params':{'content':_0xc1843b[_0x21a14d(0xe4)],'meta':_0x3f1786}}),Y(_0x21a14d(0x10a)+_0xc1843b['id'][_0x21a14d(0xf1)](0x0,0x8)+_0x21a14d(0x10b)+_0xc1843b[_0x21a14d(0x123)]+':\x20'+_0xc1843b[_0x21a14d(0xe4)][_0x21a14d(0xf1)](0x0,0x3c)),await P('ack_inbox',{'alias':Z,'message_id':_0xc1843b['id']});}}}async function A(){const _0x40b52d=a0_0x118688;let _0x16b5ec=new a0_0x2f2e05();await K['connect'](_0x16b5ec),Y(_0x40b52d(0x11a)),Y(_0x40b52d(0x107)),u()[_0x40b52d(0x12c)](_0x51c24a=>Y(_0x40b52d(0xfc)+_0x51c24a)),P(_0x40b52d(0xea),{'resume_id':w,'alias':Z,'status':_0x40b52d(0x113),'server':a0_0x3a82c8(),'hostname':a0_0x3a82c8(),'agent':_0x40b52d(0xdd),'project_dir':process[_0x40b52d(0x127)](),'tmux_name':j||void 0x0})[_0x40b52d(0xe7)](()=>Y('registered\x20as\x20\x22'+Z+_0x40b52d(0x13c)+w[_0x40b52d(0xf1)](0x0,0x8)+')'))[_0x40b52d(0x12c)](_0x230944=>Y(_0x40b52d(0x12a)+_0x230944)),setInterval(()=>{const _0x1eb1c0=_0x40b52d;P(_0x1eb1c0(0xea),{'resume_id':w,'alias':Z,'status':_0x1eb1c0(0x113),'server':a0_0x3a82c8(),'hostname':a0_0x3a82c8(),'agent':_0x1eb1c0(0xdd),'project_dir':process['cwd'](),'tmux_name':j||void 0x0})[_0x1eb1c0(0x12c)](_0x4edb0f=>Y(_0x1eb1c0(0x142)+_0x4edb0f));},0x2bf20),Y(_0x40b52d(0xec));}A()[a0_0x118688(0x12c)](_0x5b258c=>{const _0x2439e1=a0_0x118688;Y(_0x2439e1(0xf4)+_0x5b258c),process[_0x2439e1(0xf5)](0x1);});async function N(){const _0x15f6f0=a0_0x118688;Y('shutting\x20down,\x20reporting\x20offline...'),await P(_0x15f6f0(0xea),{'resume_id':w,'alias':Z,'status':_0x15f6f0(0x14e),'task':_0x15f6f0(0x149)})[_0x15f6f0(0x12c)](()=>{}),process[_0x15f6f0(0xf5)](0x0);}process[a0_0x118688(0x101)]['on'](a0_0x118688(0x12b),()=>N()),process['on'](a0_0x118688(0xcb),()=>N()),process['on'](a0_0x118688(0x11b),()=>N());
2
+ const a0_0x4f791c=a0_0x45ae;(function(_0x197b97,_0x32bb17){const _0x2b53ed=a0_0x45ae,_0x1c8c7b=_0x197b97();while(!![]){try{const _0x1b11fa=-parseInt(_0x2b53ed(0x244))/0x1*(parseInt(_0x2b53ed(0x272))/0x2)+parseInt(_0x2b53ed(0x220))/0x3+-parseInt(_0x2b53ed(0x25c))/0x4*(-parseInt(_0x2b53ed(0x24f))/0x5)+parseInt(_0x2b53ed(0x207))/0x6*(parseInt(_0x2b53ed(0x22a))/0x7)+-parseInt(_0x2b53ed(0x209))/0x8*(-parseInt(_0x2b53ed(0x239))/0x9)+parseInt(_0x2b53ed(0x236))/0xa+parseInt(_0x2b53ed(0x267))/0xb*(-parseInt(_0x2b53ed(0x22f))/0xc);if(_0x1b11fa===_0x32bb17)break;else _0x1c8c7b['push'](_0x1c8c7b['shift']());}catch(_0x20b875){_0x1c8c7b['push'](_0x1c8c7b['shift']());}}}(a0_0x5741,0x3d9e2));import{readFileSync as a0_0x168a55,existsSync as a0_0x3388c3}from'fs';import{randomUUID as a0_0x3cfa37}from'crypto';import{join as a0_0x9d2fc2}from'path';import{hostname as a0_0x3e041f}from'os';import{execSync as a0_0x3dc4eb}from'child_process';import{Server as a0_0x4fcfb0}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x100966}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x5dc3d1,CallToolRequestSchema as a0_0x544a38}from'@modelcontextprotocol/sdk/types.js';function p(_0x4c2e9b){const _0x3474b7=a0_0x45ae;if(!a0_0x3388c3(_0x4c2e9b))return;for(let _0x581673 of a0_0x168a55(_0x4c2e9b,_0x3474b7(0x219))[_0x3474b7(0x1fa)]('\x0a')){let _0x5b4106=_0x581673['trim']();if(!_0x5b4106||_0x5b4106[_0x3474b7(0x1f5)]('#'))continue;let _0x5ce316=_0x5b4106[_0x3474b7(0x217)]('=');if(_0x5ce316<0x0)continue;let _0x7129b6=_0x5b4106[_0x3474b7(0x251)](0x0,_0x5ce316)[_0x3474b7(0x21b)](),_0x2fbd4e=_0x5b4106[_0x3474b7(0x251)](_0x5ce316+0x1)[_0x3474b7(0x21b)]()[_0x3474b7(0x279)](/^["']|["']$/g,'');if(!process.env[_0x7129b6])process.env[_0x7129b6]=_0x2fbd4e;}}var C=process.env.HOME||'~',T=a0_0x9d2fc2(C,a0_0x4f791c(0x26c));p(a0_0x9d2fc2(T,a0_0x4f791c(0x27a)));var L=process[a0_0x4f791c(0x254)]()[a0_0x4f791c(0x279)](/\//g,'-');p(a0_0x9d2fc2(T,L,'.env'));function U(){const _0x480801=a0_0x4f791c;try{return a0_0x3dc4eb(_0x480801(0x21c),{'encoding':_0x480801(0x219),'timeout':0x7d0})[_0x480801(0x21b)]();}catch{return'';}}function a0_0x5741(){const _0x3f8a3c=['SSE\x20stream\x20ended,\x20reconnecting...','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','claude-code','Target\x20session\x20alias','SIGTERM','2.0','get','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','messages','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','116526bihFXf','then','36968kmEjAU','\x20PROJECT_ENV=','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','from_session','Reply\x20text\x20/\x20result\x20summary','hub','notifications/claude/channel','config.json','length','alias','setRequestHandler','send_reply','no\x20response','priority','indexOf','stdin','utf-8','\x22\x20(','trim','tmux\x20display-message\x20-p\x20\x27#S\x27','commhub_report_status','read','commhub-channel','1171245nKiOyb','MCP\x20stdio\x20connected','SSE\x20error:\x20',':\x20inbox_count=','connect','task','catch','new_task','Current\x20task\x20description','result','7rjSwwm','number','write','report_status','blocked','12WgQzLG','completed','commhub','application/json,\x20text/event-stream','\x20from\x20','status','commhub_send_message','2476540HbsYUB','delete','commhub_reply','558pBpGJF','message','string','find','Task\x20content','CommHub\x20init\x20failed:\x20','params','connecting\x20to\x20','SIGINT','content','text','13liDZQf','token','SSE\x20connection\x20error:\x20','warning:\x20could\x20not\x20register:\x20','idle','←\x20message\x20from\x20','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','ack_inbox','Message\x20content','\x20priority=','commhub_get_all_status','619025zPucOY','from','slice','/events/','cancelled','cwd','send_message','data:\x20','set','decode','replied','stringify','SSE\x20fatal:\x20','8YIUCQN','Priority\x20(default:\x20normal)','commhub_send_task','body','error','Bearer\x20','working',']\x20[commhub]\x20','inbox_count','toTimeString','session\x20disconnected','9110299uvQEgL','getReader','unknown\x20tool','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','normal','.claude/channels/commhub','Authorization','0.3.0','notification','broadcast','\x20RESUME_ID=','17078XkKspR','message_id','application/json','ENV:\x20URL=','in_progress','failed','low','replace','.env','get_all_status','registered\x20as\x20\x22','parse','fatal:\x20','new_message','object','type','Progress\x200-100','http://127.0.0.1:9200','POST','none','/mcp','2025-03-26','startsWith','send_task','stderr','...\x20TMUX=','exit','split','starting\x20SSE\x20listener...','→\x20injected\x20task\x20'];a0_0x5741=function(){return _0x3f8a3c;};return a0_0x5741();}function v(){const _0x1d1ba5=a0_0x4f791c;try{let _0x48ffa6=a0_0x9d2fc2(C,'.anet',_0x1d1ba5(0x210));if(a0_0x3388c3(_0x48ffa6))return JSON[_0x1d1ba5(0x27d)](a0_0x168a55(_0x48ffa6,_0x1d1ba5(0x219)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x4f791c(0x20e)]||a0_0x4f791c(0x283),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x3e041f(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x3cfa37(),X=process.env.COMMHUB_TOKEN||H[a0_0x4f791c(0x245)]||'';function Y(_0x26f9cf){const _0x161445=a0_0x4f791c;let _0x3679aa=new Date()[_0x161445(0x265)]()[_0x161445(0x251)](0x0,0x8);process[_0x161445(0x1f7)][_0x161445(0x22c)]('['+_0x3679aa+_0x161445(0x263)+_0x26f9cf+'\x0a');}function h(_0x3ac658){return new Promise(_0x36825a=>setTimeout(_0x36825a,_0x3ac658));}function a0_0x45ae(_0x36e349,_0x3dee81){_0x36e349=_0x36e349-0x1f3;const _0x574101=a0_0x5741();let _0x45ae65=_0x574101[_0x36e349];return _0x45ae65;}Y(a0_0x4f791c(0x275)+f+'\x20ALIAS='+Z+a0_0x4f791c(0x271)+w['slice'](0x0,0x8)+a0_0x4f791c(0x1f8)+(j||a0_0x4f791c(0x285))+'\x20CWD='+process[a0_0x4f791c(0x254)]()+a0_0x4f791c(0x20a)+L);var k=new Map(),K=new a0_0x4fcfb0({'name':a0_0x4f791c(0x21f),'version':'0.3.0'},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':['Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.',a0_0x4f791c(0x1fe),a0_0x4f791c(0x204),'Session\x20alias:\x20'+Z]['join']('\x0a')});K[a0_0x4f791c(0x213)](a0_0x5dc3d1,async()=>({'tools':[{'name':a0_0x4f791c(0x238),'description':'Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','inputSchema':{'type':a0_0x4f791c(0x280),'properties':{'task_id':{'type':a0_0x4f791c(0x23b),'description':a0_0x4f791c(0x26a)},'text':{'type':a0_0x4f791c(0x23b),'description':a0_0x4f791c(0x20d)},'status':{'type':a0_0x4f791c(0x23b),'enum':[a0_0x4f791c(0x230),a0_0x4f791c(0x277),a0_0x4f791c(0x253),a0_0x4f791c(0x22e),a0_0x4f791c(0x260),a0_0x4f791c(0x276)],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':['text']}},{'name':'commhub_report_status','description':'Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','inputSchema':{'type':a0_0x4f791c(0x280),'properties':{'status':{'type':a0_0x4f791c(0x23b),'enum':[a0_0x4f791c(0x262),a0_0x4f791c(0x248),a0_0x4f791c(0x22e),a0_0x4f791c(0x260)]},'task':{'type':a0_0x4f791c(0x23b),'description':a0_0x4f791c(0x228)},'progress':{'type':a0_0x4f791c(0x22b),'description':a0_0x4f791c(0x282)}},'required':[a0_0x4f791c(0x234)]}},{'name':a0_0x4f791c(0x25e),'description':a0_0x4f791c(0x24a),'inputSchema':{'type':a0_0x4f791c(0x280),'properties':{'alias':{'type':'string','description':'Target\x20session\x20alias'},'task':{'type':'string','description':a0_0x4f791c(0x23d)},'priority':{'type':a0_0x4f791c(0x23b),'enum':['high',a0_0x4f791c(0x26b),a0_0x4f791c(0x278)],'description':a0_0x4f791c(0x25d)}},'required':[a0_0x4f791c(0x212),a0_0x4f791c(0x225)]}},{'name':a0_0x4f791c(0x235),'description':a0_0x4f791c(0x206),'inputSchema':{'type':a0_0x4f791c(0x280),'properties':{'alias':{'type':a0_0x4f791c(0x23b),'description':a0_0x4f791c(0x200)},'message':{'type':a0_0x4f791c(0x23b),'description':a0_0x4f791c(0x24c)}},'required':[a0_0x4f791c(0x212),a0_0x4f791c(0x23a)]}},{'name':a0_0x4f791c(0x24e),'description':a0_0x4f791c(0x20b),'inputSchema':{'type':a0_0x4f791c(0x280),'properties':{}}}]}));async function P(_0x1a75aa,_0x33af56){const _0x53173b=a0_0x4f791c;let _0x31934f=await fetch(f+_0x53173b(0x1f3),{'method':_0x53173b(0x284),'headers':{'Content-Type':_0x53173b(0x274),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON[_0x53173b(0x25a)]({'jsonrpc':_0x53173b(0x202),'id':0x1,'method':'initialize','params':{'protocolVersion':_0x53173b(0x1f4),'capabilities':{},'clientInfo':{'name':'commhub-channel','version':_0x53173b(0x26e)}}})});if(!_0x31934f['ok']){let _0x51ba00=await _0x31934f[_0x53173b(0x243)]();return Y(_0x53173b(0x23e)+_0x31934f['status']+'\x20'+_0x51ba00[_0x53173b(0x251)](0x0,0x64)),{'ok':!0x1,'error':'init\x20failed:\x20'+_0x31934f['status']};}await _0x31934f[_0x53173b(0x243)]();let _0xeccea4=(await(await fetch(f+'/mcp',{'method':'POST','headers':{'Content-Type':_0x53173b(0x274),'Accept':_0x53173b(0x232),...X?{'Authorization':_0x53173b(0x261)+X}:{}},'body':JSON[_0x53173b(0x25a)]({'jsonrpc':_0x53173b(0x202),'id':0x2,'method':'tools/call','params':{'name':_0x1a75aa,'arguments':_0x33af56}})}))[_0x53173b(0x243)]())[_0x53173b(0x1fa)]('\x0a')[_0x53173b(0x23c)](_0x4dfae5=>_0x4dfae5[_0x53173b(0x1f5)](_0x53173b(0x256)));if(_0xeccea4){let _0xfaabf2=JSON['parse'](_0xeccea4[_0x53173b(0x251)](0x6));return _0xfaabf2?.[_0x53173b(0x229)]?.[_0x53173b(0x242)]?.[0x0]?.[_0x53173b(0x243)]?JSON[_0x53173b(0x27d)](_0xfaabf2[_0x53173b(0x229)][_0x53173b(0x242)][0x0]['text']):_0xfaabf2;}return{'ok':!0x1,'error':_0x53173b(0x215)};}K[a0_0x4f791c(0x213)](a0_0x544a38,async _0x1f175f=>{const _0x11308e=a0_0x4f791c;let {name:_0x5f30a9,arguments:_0x3ecb37}=_0x1f175f[_0x11308e(0x23f)];if(_0x5f30a9==='commhub_reply'){let {task_id:_0x1fb905,text:_0x201e81,status:_0x17730d}=_0x3ecb37;if(_0x17730d===_0x11308e(0x230)||_0x17730d===_0x11308e(0x277)||_0x17730d===_0x11308e(0x253)){let _0x896552=_0x17730d==='completed'?_0x11308e(0x259):_0x17730d,_0x196801=_0x1fb905?k[_0x11308e(0x203)](_0x1fb905)||_0x11308e(0x20e):_0x11308e(0x20e),_0x4c0e0f=await P(_0x11308e(0x214),{'alias':_0x196801,'text':_0x201e81,'in_reply_to':_0x1fb905||void 0x0,'status':_0x896552,'from_session':Z});if(_0x1fb905)k[_0x11308e(0x237)](_0x1fb905);return{'content':[{'type':'text','text':JSON[_0x11308e(0x25a)](_0x4c0e0f)}]};}let _0x619cd0=await P(_0x11308e(0x22d),{'resume_id':w,'alias':Z,'status':_0x17730d===_0x11308e(0x22e)?'blocked':_0x17730d==='error'?'error':_0x11308e(0x262),'task':_0x201e81[_0x11308e(0x251)](0x0,0xc8),'output':_0x201e81});return{'content':[{'type':_0x11308e(0x243),'text':JSON[_0x11308e(0x25a)](_0x619cd0)}]};}if(_0x5f30a9===_0x11308e(0x21d)){let {status:_0x22ec94,task:_0x3a10cf,progress:_0x577d9b}=_0x3ecb37,_0x1e8598=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x22ec94,'task':_0x3a10cf,'progress':_0x577d9b});return{'content':[{'type':_0x11308e(0x243),'text':JSON[_0x11308e(0x25a)](_0x1e8598)}]};}if(_0x5f30a9===_0x11308e(0x25e)){let {alias:_0x459888,task:_0x2bd731,priority:_0x39a562}=_0x3ecb37,_0x55b792=await P(_0x11308e(0x1f6),{'alias':_0x459888,'task':_0x2bd731,'priority':_0x39a562||'normal','from_session':Z});return{'content':[{'type':_0x11308e(0x243),'text':JSON['stringify'](_0x55b792)}]};}if(_0x5f30a9==='commhub_send_message'){let {alias:_0x4e2c9d,message:_0x298fd4}=_0x3ecb37,_0x33fce9=await P(_0x11308e(0x255),{'alias':_0x4e2c9d,'message':_0x298fd4,'from_session':Z});return{'content':[{'type':_0x11308e(0x243),'text':JSON['stringify'](_0x33fce9)}]};}if(_0x5f30a9===_0x11308e(0x24e)){let _0x44bb63=await P(_0x11308e(0x27b),{});return{'content':[{'type':_0x11308e(0x243),'text':JSON[_0x11308e(0x25a)](_0x44bb63)}]};}return{'content':[{'type':'text','text':JSON['stringify']({'error':_0x11308e(0x269)})}]};});async function u(){const _0x52aedb=a0_0x4f791c;let _0xd8ac99=f+_0x52aedb(0x252)+encodeURIComponent(Z),_0x28b288={};if(X)_0x28b288[_0x52aedb(0x26d)]=_0x52aedb(0x261)+X;Y(_0x52aedb(0x240)+_0xd8ac99);while(!0x0){try{let _0x4930b0=await fetch(_0xd8ac99,{'headers':_0x28b288});if(!_0x4930b0['ok']){Y(_0x52aedb(0x222)+_0x4930b0[_0x52aedb(0x234)]+'\x20'+_0x4930b0['statusText']),await h(0x1388);continue;}let _0x49226e=_0x4930b0[_0x52aedb(0x25f)][_0x52aedb(0x268)](),_0x4b7a1f=new TextDecoder(),_0x4565ad='';while(!0x0){let {done:_0x4bcd92,value:_0x56c144}=await _0x49226e[_0x52aedb(0x21e)]();if(_0x4bcd92)break;_0x4565ad+=_0x4b7a1f[_0x52aedb(0x258)](_0x56c144,{'stream':!0x0});let _0x19971=_0x4565ad[_0x52aedb(0x1fa)]('\x0a\x0a');_0x4565ad=_0x19971['pop']()||'';for(let _0x31e5e3 of _0x19971){let _0x14e221=_0x31e5e3[_0x52aedb(0x1fa)]('\x0a')[_0x52aedb(0x23c)](_0x4f317f=>_0x4f317f['startsWith'](_0x52aedb(0x256)));if(!_0x14e221)continue;try{let _0x12d180=JSON['parse'](_0x14e221[_0x52aedb(0x251)](0x6));await S(_0x12d180);}catch(_0x8e24a5){Y('parse\x20error:\x20'+_0x8e24a5);}}}Y(_0x52aedb(0x1fd));}catch(_0x5ac016){Y(_0x52aedb(0x246)+_0x5ac016);}await h(0xbb8);}}async function S(_0x23c265){const _0x55139e=a0_0x4f791c;if(_0x23c265[_0x55139e(0x281)]==='connected'){Y('SSE\x20connected\x20as\x20\x22'+Z+'\x22');return;}if(_0x23c265[_0x55139e(0x281)]===_0x55139e(0x27f)){if(Y(_0x55139e(0x249)+_0x23c265[_0x55139e(0x250)]+':\x20'+_0x23c265[_0x55139e(0x23a)][_0x55139e(0x251)](0x0,0x3c)),await K[_0x55139e(0x26f)]({'method':_0x55139e(0x20f),'params':{'content':_0x23c265[_0x55139e(0x23a)],'meta':{'sender':_0x23c265[_0x55139e(0x250)]||_0x55139e(0x20e),'sender_id':_0x55139e(0x231),'user':_0x23c265[_0x55139e(0x250)]||_0x55139e(0x20e),'priority':_0x55139e(0x26b)}}}),_0x23c265[_0x55139e(0x273)])await P(_0x55139e(0x24b),{'alias':Z,'message_id':_0x23c265[_0x55139e(0x273)]});return;}if(_0x23c265[_0x55139e(0x281)]===_0x55139e(0x227)||_0x23c265[_0x55139e(0x281)]===_0x55139e(0x270)){Y('←\x20'+_0x23c265[_0x55139e(0x281)]+_0x55139e(0x223)+_0x23c265[_0x55139e(0x264)]+_0x55139e(0x24d)+(_0x23c265['priority']||_0x55139e(0x26b)));let _0x4ea0d8=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0x4ea0d8?.['ok']&&_0x4ea0d8[_0x55139e(0x205)]?.[_0x55139e(0x211)]>0x0)for(let _0x2c9b52 of _0x4ea0d8[_0x55139e(0x205)]){let _0x1775aa={'sender':_0x2c9b52[_0x55139e(0x20c)]||'hub','sender_id':_0x55139e(0x231),'user':_0x2c9b52[_0x55139e(0x20c)]||_0x55139e(0x20e),'task_id':_0x2c9b52['id'],'priority':_0x2c9b52[_0x55139e(0x216)]||_0x55139e(0x26b)};k[_0x55139e(0x257)](_0x2c9b52['id'],_0x2c9b52['from_session']||_0x55139e(0x20e)),await K[_0x55139e(0x26f)]({'method':_0x55139e(0x20f),'params':{'content':_0x2c9b52[_0x55139e(0x242)],'meta':_0x1775aa}}),Y(_0x55139e(0x1fc)+_0x2c9b52['id'][_0x55139e(0x251)](0x0,0x8)+_0x55139e(0x233)+_0x2c9b52[_0x55139e(0x20c)]+':\x20'+_0x2c9b52[_0x55139e(0x242)][_0x55139e(0x251)](0x0,0x3c)),await P(_0x55139e(0x24b),{'alias':Z,'message_id':_0x2c9b52['id']});}}}async function A(){const _0x55b2bf=a0_0x4f791c;let _0x14cd69=new a0_0x100966();await K[_0x55b2bf(0x224)](_0x14cd69),Y(_0x55b2bf(0x221)),Y(_0x55b2bf(0x1fb)),u()[_0x55b2bf(0x226)](_0x5b68ee=>Y(_0x55b2bf(0x25b)+_0x5b68ee)),P(_0x55b2bf(0x22d),{'resume_id':w,'alias':Z,'status':_0x55b2bf(0x248),'server':a0_0x3e041f(),'hostname':a0_0x3e041f(),'agent':_0x55b2bf(0x1ff),'project_dir':process[_0x55b2bf(0x254)](),'tmux_name':j||void 0x0})[_0x55b2bf(0x208)](()=>Y(_0x55b2bf(0x27c)+Z+_0x55b2bf(0x21a)+w[_0x55b2bf(0x251)](0x0,0x8)+')'))[_0x55b2bf(0x226)](_0x507409=>Y(_0x55b2bf(0x247)+_0x507409)),setInterval(()=>{const _0x4b4103=_0x55b2bf;P('report_status',{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x3e041f(),'hostname':a0_0x3e041f(),'agent':_0x4b4103(0x1ff),'project_dir':process[_0x4b4103(0x254)](),'tmux_name':j||void 0x0})['catch'](_0x1c754c=>Y('heartbeat\x20failed:\x20'+_0x1c754c));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}A()['catch'](_0x2bb67f=>{const _0x3d997a=a0_0x4f791c;Y(_0x3d997a(0x27e)+_0x2bb67f),process[_0x3d997a(0x1f9)](0x1);});async function N(){const _0x267ab6=a0_0x4f791c;Y('shutting\x20down,\x20reporting\x20offline...'),await P(_0x267ab6(0x22d),{'resume_id':w,'alias':Z,'status':_0x267ab6(0x260),'task':_0x267ab6(0x266)})[_0x267ab6(0x226)](()=>{}),process['exit'](0x0);}process[a0_0x4f791c(0x218)]['on']('end',()=>N()),process['on'](a0_0x4f791c(0x201),()=>N()),process['on'](a0_0x4f791c(0x241),()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.1.15-preview.0",
3
+ "version": "2.1.15-preview.3",
4
4
  "description": "AI Agent Network CLI — Create multi-agent networks with user management, network isolation, and 3 AI runtimes (Claude/Codex/MiniMax). 39 commands.",
5
5
  "type": "module",
6
6
  "main": "dist/src/client.js",