@sleep2agi/agent-network 2.0.0-preview.1 → 2.0.0-preview.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- const a0_0x3b58d7=a0_0x339c;(function(_0x33760c,_0x3c9855){const _0x20ecdc=a0_0x339c,_0x5ad7a2=_0x33760c();while(!![]){try{const _0x5d59de=parseInt(_0x20ecdc(0xef))/0x1*(-parseInt(_0x20ecdc(0xda))/0x2)+parseInt(_0x20ecdc(0xe8))/0x3+parseInt(_0x20ecdc(0x104))/0x4+-parseInt(_0x20ecdc(0xf8))/0x5+-parseInt(_0x20ecdc(0x112))/0x6+parseInt(_0x20ecdc(0x102))/0x7*(parseInt(_0x20ecdc(0xd0))/0x8)+-parseInt(_0x20ecdc(0x113))/0x9*(-parseInt(_0x20ecdc(0xf1))/0xa);if(_0x5d59de===_0x3c9855)break;else _0x5ad7a2['push'](_0x5ad7a2['shift']());}catch(_0x4a0222){_0x5ad7a2['push'](_0x5ad7a2['shift']());}}}(a0_0x9af3,0xac47b));function a0_0x339c(_0x4416dc,_0x1e9dfd){_0x4416dc=_0x4416dc-0xc7;const _0x9af3af=a0_0x9af3();let _0x339cb3=_0x9af3af[_0x4416dc];return _0x339cb3;}import{EventEmitter as a0_0x3595b8}from'events';import{hostname as a0_0x47450e}from'os';class T extends a0_0x3595b8{[a0_0x3b58d7(0xfa)];[a0_0x3b58d7(0xd8)];[a0_0x3b58d7(0xd4)];[a0_0x3b58d7(0xd7)];[a0_0x3b58d7(0xfd)];[a0_0x3b58d7(0x10e)];[a0_0x3b58d7(0x10c)];[a0_0x3b58d7(0x116)];[a0_0x3b58d7(0xf6)];[a0_0x3b58d7(0xfb)]=!0x1;constructor(_0x1021af){const _0x83c9c9=a0_0x3b58d7;super();if(this[_0x83c9c9(0xfa)]=_0x1021af[_0x83c9c9(0xfa)][_0x83c9c9(0xf7)](/\/$/,''),this[_0x83c9c9(0xd8)]=_0x1021af['alias'],this[_0x83c9c9(0xd4)]=_0x1021af[_0x83c9c9(0xd4)],this[_0x83c9c9(0xd7)]=_0x1021af[_0x83c9c9(0xd7)]||_0x83c9c9(0xd1),this[_0x83c9c9(0xfd)]=_0x83c9c9(0xe5)+_0x1021af[_0x83c9c9(0xd8)]+'-'+Date[_0x83c9c9(0x119)]()[_0x83c9c9(0xff)](0x24),this[_0x83c9c9(0x10e)]=_0x1021af[_0x83c9c9(0x10e)]??0x2bf20,this['reconnectDelay']=_0x1021af[_0x83c9c9(0x10c)]??0xbb8,_0x1021af[_0x83c9c9(0xcf)]!==!0x1)this[_0x83c9c9(0xf0)]();}[a0_0x3b58d7(0x117)](_0x12281c){const _0x1343a5=a0_0x3b58d7;console[_0x1343a5(0x117)]('['+new Date()[_0x1343a5(0xe9)]()[_0x1343a5(0xf9)](0x0,0x8)+_0x1343a5(0x11b)+this[_0x1343a5(0xd8)]+']\x20'+_0x12281c);}async['call'](_0x27200a,_0x2479c3){const _0x4b099b=a0_0x3b58d7;let _0x5a889a={'Content-Type':_0x4b099b(0x103),'Accept':_0x4b099b(0x118)};if(this[_0x4b099b(0xd4)])_0x5a889a[_0x4b099b(0xd9)]=_0x4b099b(0xd5)+this[_0x4b099b(0xd4)];let _0x3956b1=await(await fetch(this['url']+_0x4b099b(0xe3),{'method':_0x4b099b(0xc7),'headers':_0x5a889a,'body':JSON[_0x4b099b(0xdb)]({'jsonrpc':_0x4b099b(0xf5),'id':Date[_0x4b099b(0x119)](),'method':'tools/call','params':{'name':_0x27200a,'arguments':_0x2479c3}})}))[_0x4b099b(0xce)](),_0x41c54a=_0x3956b1[_0x4b099b(0xe6)](/data: (.+)/),_0x4ea34=_0x41c54a?JSON[_0x4b099b(0xea)](_0x41c54a[0x1]):JSON['parse'](_0x3956b1),_0x21e983=_0x4ea34?.[_0x4b099b(0xcb)]?.['content']?.[0x0]?.[_0x4b099b(0xce)];return _0x21e983?JSON[_0x4b099b(0xea)](_0x21e983):_0x4ea34;}async[a0_0x3b58d7(0xf0)](){const _0x2a531a=a0_0x3b58d7;if(this[_0x2a531a(0xfb)])return;this['running']=!0x0,await this[_0x2a531a(0xeb)](_0x2a531a(0xe7)),this[_0x2a531a(0x117)](_0x2a531a(0xf2)),this['heartbeatTimer']=setInterval(()=>{const _0x33c91f=_0x2a531a;this[_0x33c91f(0xeb)](_0x33c91f(0xe7))[_0x33c91f(0xed)](_0x1bbf90=>this[_0x33c91f(0x117)](_0x33c91f(0x109)+_0x1bbf90[_0x33c91f(0xfe)]));},this['heartbeatInterval']),this[_0x2a531a(0xc8)]();}async[a0_0x3b58d7(0xd6)](){const _0x4c44e9=a0_0x3b58d7;if(this[_0x4c44e9(0xfb)]=!0x1,this[_0x4c44e9(0xf6)]?.['abort'](),this[_0x4c44e9(0x116)])clearInterval(this['heartbeatTimer']);await this[_0x4c44e9(0xeb)](_0x4c44e9(0x11a))[_0x4c44e9(0xed)](()=>{}),this[_0x4c44e9(0x117)](_0x4c44e9(0x107));}async['send'](_0xb5739a,_0x5ec8da,_0x3393e4=a0_0x3b58d7(0xcd)){const _0x271687=a0_0x3b58d7;return this[_0x271687(0xee)]('send_task',{'alias':_0xb5739a,'task':_0x5ec8da,'priority':_0x3393e4,'from_session':this[_0x271687(0xd8)]});}async[a0_0x3b58d7(0xfe)](_0x2c75d0,_0x1698b0){const _0xb4fe24=a0_0x3b58d7;return this[_0xb4fe24(0xee)](_0xb4fe24(0x10a),{'alias':_0x2c75d0,'message':_0x1698b0,'from_session':this['alias']});}async[a0_0x3b58d7(0xf4)](_0x9c3ce6,_0x1839a6,_0x1288b8='completed'){const _0x3a7cb8=a0_0x3b58d7;return this['call'](_0x3a7cb8(0xf4),{'task_id':_0x9c3ce6,'text':_0x1839a6,'status':_0x1288b8});}async[a0_0x3b58d7(0xeb)](_0x14dd7e,_0x1a8893){const _0x265259=a0_0x3b58d7;return this['call'](_0x265259(0xdd),{'resume_id':this[_0x265259(0xfd)],'alias':this[_0x265259(0xd8)],'status':_0x14dd7e,'server':a0_0x47450e(),'hostname':a0_0x47450e(),'agent':this[_0x265259(0xd7)],'project_dir':process[_0x265259(0x106)](),..._0x1a8893});}async[a0_0x3b58d7(0x111)](){const _0x49cd23=a0_0x3b58d7;return this[_0x49cd23(0xee)]('get_all_status',{});}async[a0_0x3b58d7(0xde)](_0x55abdc,_0x4af47e){const _0x88acb7=a0_0x3b58d7;return this[_0x88acb7(0xee)]('broadcast',{'message':_0x55abdc,'filter_server':_0x4af47e?.['server'],'filter_status':_0x4af47e?.['status']});}async['connectSSE'](){const _0x5ac432=a0_0x3b58d7;let _0x12f7af=encodeURIComponent(this[_0x5ac432(0xd8)]),_0x425227=this[_0x5ac432(0xfa)]+'/events/'+_0x12f7af,_0x5d33e2=this['reconnectDelay'];while(this[_0x5ac432(0xfb)]){try{this['sseAbort']=new AbortController();let _0x24c578={'Accept':_0x5ac432(0x10d)};if(this['token'])_0x24c578[_0x5ac432(0xd9)]=_0x5ac432(0xd5)+this[_0x5ac432(0xd4)];let _0x28076a=await fetch(_0x425227,{'headers':_0x24c578,'signal':this[_0x5ac432(0xf6)][_0x5ac432(0xca)]});if(!_0x28076a['ok']||!_0x28076a[_0x5ac432(0xe0)]){this[_0x5ac432(0x117)]('SSE\x20failed:\x20'+_0x28076a[_0x5ac432(0xeb)]),await this[_0x5ac432(0xc9)](_0x5d33e2),_0x5d33e2=Math[_0x5ac432(0x10b)](_0x5d33e2*1.5,0xea60);continue;}_0x5d33e2=this[_0x5ac432(0x10c)];let _0x3c9dc5=_0x28076a[_0x5ac432(0xe0)][_0x5ac432(0xd2)](),_0x5af485=new TextDecoder(),_0x168c28='';while(this[_0x5ac432(0xfb)]){let {done:_0x21967d,value:_0x5e0203}=await _0x3c9dc5[_0x5ac432(0xdc)]();if(_0x21967d)break;_0x168c28+=_0x5af485[_0x5ac432(0x115)](_0x5e0203,{'stream':!0x0});let _0x50093a=_0x168c28[_0x5ac432(0xd3)]('\x0a');_0x168c28=_0x50093a[_0x5ac432(0xe1)]()||'';for(let _0x597fe3 of _0x50093a){if(!_0x597fe3[_0x5ac432(0x110)]('data:\x20'))continue;try{let _0x55da8e=JSON[_0x5ac432(0xea)](_0x597fe3[_0x5ac432(0xf9)](0x6));if(_0x55da8e['type']==='connected'){this[_0x5ac432(0x117)](_0x5ac432(0xe4)),this[_0x5ac432(0x105)]('connected');continue;}if(_0x55da8e[_0x5ac432(0xe2)]===_0x5ac432(0xdf)||_0x55da8e[_0x5ac432(0xe2)]===_0x5ac432(0xfc)||_0x55da8e[_0x5ac432(0xe2)]===_0x5ac432(0xde))await this['processInbox']();}catch{}}}}catch(_0x2c9e76){if(_0x2c9e76[_0x5ac432(0x108)]==='AbortError')break;this[_0x5ac432(0x105)]('error',_0x2c9e76),this[_0x5ac432(0x117)](_0x5ac432(0xcc)+_0x2c9e76[_0x5ac432(0xfe)]);}if(this[_0x5ac432(0xfb)])this['emit']('disconnected'),this[_0x5ac432(0x117)]('SSE\x20reconnecting\x20in\x20'+_0x5d33e2/0x3e8+_0x5ac432(0x101)),await this['sleep'](_0x5d33e2),_0x5d33e2=Math[_0x5ac432(0x10b)](_0x5d33e2*1.5,0xea60);}}async[a0_0x3b58d7(0x10f)](){const _0x5e1159=a0_0x3b58d7;try{let _0x392361=(await this[_0x5e1159(0xee)]('get_inbox',{'alias':this[_0x5e1159(0xd8)],'limit':0xa}))?.[_0x5e1159(0xf3)]||[];for(let _0x386bc9 of _0x392361)await this['call'](_0x5e1159(0x114),{'alias':this[_0x5e1159(0xd8)],'message_id':_0x386bc9['id']}),this['log']('←\x20'+_0x386bc9['from_session']+':\x20'+_0x386bc9[_0x5e1159(0x100)]['slice'](0x0,0x3c)),this[_0x5e1159(0x105)]('task',_0x386bc9),this[_0x5e1159(0x105)](_0x5e1159(0xfe),_0x386bc9);}catch(_0x909004){this[_0x5e1159(0x117)](_0x5e1159(0xec)+_0x909004[_0x5e1159(0xfe)]);}}[a0_0x3b58d7(0xc9)](_0x4cc15a){return new Promise(_0x156384=>setTimeout(_0x156384,_0x4cc15a));}}var $=T;export{$ as default,T as CommHub};function a0_0x9af3(){const _0x142a94=['application/json','248816aPCtQf','emit','cwd','disconnected','name','heartbeat\x20failed:\x20','send_message','min','reconnectDelay','text/event-stream','heartbeatInterval','processInbox','startsWith','getAllStatus','7877298MjAsWz','9LgRKxq','ack_inbox','decode','heartbeatTimer','log','application/json,\x20text/event-stream','now','offline',']\x20[commhub:','POST','connectSSE','sleep','signal','result','SSE\x20error:\x20','normal','text','autoConnect','32Tfzcwk','sdk','getReader','split','token','Bearer\x20','disconnect','agent','alias','Authorization','760deqWbi','stringify','read','report_status','broadcast','new_task','body','pop','type','/mcp','SSE\x20connected','sdk-','match','idle','825396yOkIix','toTimeString','parse','status','inbox\x20error:\x20','catch','call','2129qZHtws','connect','16768190tRsSop','registered','messages','reply','2.0','sseAbort','replace','2522805UivuEI','slice','url','running','new_message','resumeId','message','toString','content','s...','2306444KzSWlr'];a0_0x9af3=function(){return _0x142a94;};return a0_0x9af3();}
1
+ function a0_0x4310(_0x3d525b,_0x440496){_0x3d525b=_0x3d525b-0x101;const _0x322e02=a0_0x322e();let _0x43101b=_0x322e02[_0x3d525b];return _0x43101b;}const a0_0x5da311=a0_0x4310;(function(_0x114b2c,_0x50b412){const _0x49f695=a0_0x4310,_0x222c39=_0x114b2c();while(!![]){try{const _0x3f2893=parseInt(_0x49f695(0x151))/0x1*(-parseInt(_0x49f695(0x14d))/0x2)+-parseInt(_0x49f695(0x10e))/0x3+parseInt(_0x49f695(0x13c))/0x4+-parseInt(_0x49f695(0x129))/0x5*(parseInt(_0x49f695(0x11b))/0x6)+parseInt(_0x49f695(0x115))/0x7+parseInt(_0x49f695(0x13e))/0x8*(-parseInt(_0x49f695(0x149))/0x9)+parseInt(_0x49f695(0x117))/0xa;if(_0x3f2893===_0x50b412)break;else _0x222c39['push'](_0x222c39['shift']());}catch(_0x593210){_0x222c39['push'](_0x222c39['shift']());}}}(a0_0x322e,0x79803));import{EventEmitter as a0_0x27f5be}from'events';function a0_0x322e(){const _0x33c8ac=['content','sleep','59ahDcfh','token','startsWith','sdk','application/json,\x20text/event-stream','Authorization','url','sdk-','log','SSE\x20connected','/mcp','agent','connectSSE','toTimeString','type','name','alias','AbortError','connect','tools/call','running','messages','2198094USUxKI','new_task','replace','min','broadcast','offline','getReader','1408064ARyXXJ','parse','26992440qUeYLD','from_session','idle','pop','5316918MSAome','new_message','get_inbox','body','slice','decode','SSE\x20reconnecting\x20in\x20','SSE\x20failed:\x20','processInbox','s...','Bearer\x20','inbox\x20error:\x20','ack_inbox','disconnected','5KRKaPr','/events/','reconnectDelay','call','send_message','now','connected','read','signal','report_status','autoConnect','heartbeatInterval','SSE\x20error:\x20','disconnect','reply','message','resumeId','send_task','error','379564nqdVPf','emit','38848cNeXvn','text/event-stream','match','heartbeatTimer','status','send','catch','2.0','POST',']\x20[commhub:','text','1044UKnsoc','toString','get_all_status','stringify','10694goowZg','normal'];a0_0x322e=function(){return _0x33c8ac;};return a0_0x322e();}import{hostname as a0_0x1a5023}from'os';class T extends a0_0x27f5be{[a0_0x5da311(0x157)];[a0_0x5da311(0x108)];['token'];[a0_0x5da311(0x103)];[a0_0x5da311(0x139)];['heartbeatInterval'];['reconnectDelay'];[a0_0x5da311(0x141)];['sseAbort'];[a0_0x5da311(0x10c)]=!0x1;constructor(_0x2ca193){const _0x11459f=a0_0x5da311;super();if(this[_0x11459f(0x157)]=_0x2ca193[_0x11459f(0x157)][_0x11459f(0x110)](/\/$/,''),this[_0x11459f(0x108)]=_0x2ca193[_0x11459f(0x108)],this[_0x11459f(0x152)]=_0x2ca193[_0x11459f(0x152)],this['agent']=_0x2ca193[_0x11459f(0x103)]||_0x11459f(0x154),this['resumeId']=_0x11459f(0x158)+_0x2ca193[_0x11459f(0x108)]+'-'+Date['now']()[_0x11459f(0x14a)](0x24),this[_0x11459f(0x134)]=_0x2ca193[_0x11459f(0x134)]??0x2bf20,this['reconnectDelay']=_0x2ca193[_0x11459f(0x12b)]??0xbb8,_0x2ca193[_0x11459f(0x133)]!==!0x1)this[_0x11459f(0x10a)]();}['log'](_0x17e767){const _0x5a5288=a0_0x5da311;console[_0x5a5288(0x159)]('['+new Date()[_0x5a5288(0x105)]()[_0x5a5288(0x11f)](0x0,0x8)+_0x5a5288(0x147)+this[_0x5a5288(0x108)]+']\x20'+_0x17e767);}async['call'](_0x48040,_0x1bc8be){const _0x75d7c5=a0_0x5da311;let _0x1bcdff={'Content-Type':'application/json','Accept':_0x75d7c5(0x155)};if(this[_0x75d7c5(0x152)])_0x1bcdff[_0x75d7c5(0x156)]=_0x75d7c5(0x125)+this[_0x75d7c5(0x152)];let _0xd95da6=await(await fetch(this[_0x75d7c5(0x157)]+_0x75d7c5(0x102),{'method':_0x75d7c5(0x146),'headers':_0x1bcdff,'body':JSON[_0x75d7c5(0x14c)]({'jsonrpc':_0x75d7c5(0x145),'id':Date[_0x75d7c5(0x12e)](),'method':_0x75d7c5(0x10b),'params':{'name':_0x48040,'arguments':_0x1bc8be}})}))[_0x75d7c5(0x148)](),_0x423b6c=_0xd95da6[_0x75d7c5(0x140)](/data: (.+)/),_0x21619f=_0x423b6c?JSON[_0x75d7c5(0x116)](_0x423b6c[0x1]):JSON[_0x75d7c5(0x116)](_0xd95da6),_0x325bf6=_0x21619f?.['result']?.[_0x75d7c5(0x14f)]?.[0x0]?.[_0x75d7c5(0x148)];return _0x325bf6?JSON[_0x75d7c5(0x116)](_0x325bf6):_0x21619f;}async[a0_0x5da311(0x10a)](){const _0x19cb1e=a0_0x5da311;if(this[_0x19cb1e(0x10c)])return;this[_0x19cb1e(0x10c)]=!0x0,await this[_0x19cb1e(0x142)]('idle'),this[_0x19cb1e(0x159)]('registered'),this[_0x19cb1e(0x141)]=setInterval(()=>{const _0x2b7be3=_0x19cb1e;this[_0x2b7be3(0x142)](_0x2b7be3(0x119))[_0x2b7be3(0x144)](_0x4c78c8=>this[_0x2b7be3(0x159)]('heartbeat\x20failed:\x20'+_0x4c78c8[_0x2b7be3(0x138)]));},this[_0x19cb1e(0x134)]),this[_0x19cb1e(0x104)]();}async[a0_0x5da311(0x136)](){const _0x373209=a0_0x5da311;if(this[_0x373209(0x10c)]=!0x1,this['sseAbort']?.['abort'](),this[_0x373209(0x141)])clearInterval(this[_0x373209(0x141)]);await this[_0x373209(0x142)](_0x373209(0x113))['catch'](()=>{}),this['log'](_0x373209(0x128));}async[a0_0x5da311(0x143)](_0x46948f,_0x270179,_0x37486f=a0_0x5da311(0x14e)){const _0x4085db=a0_0x5da311;return this['call'](_0x4085db(0x13a),{'alias':_0x46948f,'task':_0x270179,'priority':_0x37486f,'from_session':this[_0x4085db(0x108)]});}async['message'](_0x4e1baa,_0x5d3e8e){const _0x23c65a=a0_0x5da311;return this[_0x23c65a(0x12c)](_0x23c65a(0x12d),{'alias':_0x4e1baa,'message':_0x5d3e8e,'from_session':this[_0x23c65a(0x108)]});}async['reply'](_0x327094,_0x251ca8,_0x16b555='completed'){const _0x1f46ee=a0_0x5da311;return this[_0x1f46ee(0x12c)](_0x1f46ee(0x137),{'task_id':_0x327094,'text':_0x251ca8,'status':_0x16b555});}async[a0_0x5da311(0x142)](_0x184603,_0x2daf79){const _0x2e0cc1=a0_0x5da311;return this[_0x2e0cc1(0x12c)](_0x2e0cc1(0x132),{'resume_id':this[_0x2e0cc1(0x139)],'alias':this[_0x2e0cc1(0x108)],'status':_0x184603,'server':a0_0x1a5023(),'hostname':a0_0x1a5023(),'agent':this[_0x2e0cc1(0x103)],'project_dir':process['cwd'](),..._0x2daf79});}async['getAllStatus'](){const _0x1445e6=a0_0x5da311;return this['call'](_0x1445e6(0x14b),{});}async[a0_0x5da311(0x112)](_0x56a134,_0x39902d){const _0x5ed53e=a0_0x5da311;return this[_0x5ed53e(0x12c)](_0x5ed53e(0x112),{'message':_0x56a134,'filter_server':_0x39902d?.['server'],'filter_status':_0x39902d?.['status']});}async[a0_0x5da311(0x104)](){const _0x362ea9=a0_0x5da311;let _0xda99b9=encodeURIComponent(this[_0x362ea9(0x108)]),_0x1561cb=this[_0x362ea9(0x157)]+_0x362ea9(0x12a)+_0xda99b9,_0x39a845=this[_0x362ea9(0x12b)];while(this[_0x362ea9(0x10c)]){try{this['sseAbort']=new AbortController();let _0x579f2b={'Accept':_0x362ea9(0x13f)};if(this[_0x362ea9(0x152)])_0x579f2b[_0x362ea9(0x156)]=_0x362ea9(0x125)+this['token'];let _0x152748=await fetch(_0x1561cb,{'headers':_0x579f2b,'signal':this['sseAbort'][_0x362ea9(0x131)]});if(!_0x152748['ok']||!_0x152748['body']){this[_0x362ea9(0x159)](_0x362ea9(0x122)+_0x152748[_0x362ea9(0x142)]),await this[_0x362ea9(0x150)](_0x39a845),_0x39a845=Math[_0x362ea9(0x111)](_0x39a845*1.5,0xea60);continue;}_0x39a845=this[_0x362ea9(0x12b)];let _0x251cb5=_0x152748[_0x362ea9(0x11e)][_0x362ea9(0x114)](),_0x4e0d45=new TextDecoder(),_0x27ad94='';while(this[_0x362ea9(0x10c)]){let {done:_0x13f5e1,value:_0x3b0329}=await _0x251cb5[_0x362ea9(0x130)]();if(_0x13f5e1)break;_0x27ad94+=_0x4e0d45[_0x362ea9(0x120)](_0x3b0329,{'stream':!0x0});let _0x32eaeb=_0x27ad94['split']('\x0a');_0x27ad94=_0x32eaeb[_0x362ea9(0x11a)]()||'';for(let _0x269814 of _0x32eaeb){if(!_0x269814[_0x362ea9(0x153)]('data:\x20'))continue;try{let _0x2987dd=JSON['parse'](_0x269814[_0x362ea9(0x11f)](0x6));if(_0x2987dd['type']===_0x362ea9(0x12f)){this[_0x362ea9(0x159)](_0x362ea9(0x101)),this['emit'](_0x362ea9(0x12f));continue;}if(_0x2987dd['type']===_0x362ea9(0x10f)||_0x2987dd['type']===_0x362ea9(0x11c)||_0x2987dd[_0x362ea9(0x106)]===_0x362ea9(0x112))await this[_0x362ea9(0x123)]();}catch{}}}}catch(_0x397a84){if(_0x397a84[_0x362ea9(0x107)]===_0x362ea9(0x109))break;this[_0x362ea9(0x13d)](_0x362ea9(0x13b),_0x397a84),this[_0x362ea9(0x159)](_0x362ea9(0x135)+_0x397a84[_0x362ea9(0x138)]);}if(this[_0x362ea9(0x10c)])this[_0x362ea9(0x13d)]('disconnected'),this['log'](_0x362ea9(0x121)+_0x39a845/0x3e8+_0x362ea9(0x124)),await this[_0x362ea9(0x150)](_0x39a845),_0x39a845=Math[_0x362ea9(0x111)](_0x39a845*1.5,0xea60);}}async[a0_0x5da311(0x123)](){const _0x2e68f0=a0_0x5da311;try{let _0x5fd235=(await this['call'](_0x2e68f0(0x11d),{'alias':this[_0x2e68f0(0x108)],'limit':0xa}))?.[_0x2e68f0(0x10d)]||[];for(let _0x558117 of _0x5fd235)await this[_0x2e68f0(0x12c)](_0x2e68f0(0x127),{'alias':this[_0x2e68f0(0x108)],'message_id':_0x558117['id']}),this['log']('←\x20'+_0x558117[_0x2e68f0(0x118)]+':\x20'+_0x558117['content'][_0x2e68f0(0x11f)](0x0,0x3c)),this[_0x2e68f0(0x13d)]('task',_0x558117),this['emit'](_0x2e68f0(0x138),_0x558117);}catch(_0x1dd4de){this[_0x2e68f0(0x159)](_0x2e68f0(0x126)+_0x1dd4de[_0x2e68f0(0x138)]);}}[a0_0x5da311(0x150)](_0x57b96f){return new Promise(_0x3fb637=>setTimeout(_0x3fb637,_0x57b96f));}}var $=T;export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x4e5ac0=a0_0x2999;(function(_0x51044d,_0x358a1e){const _0x430d25=a0_0x2999,_0x44c354=_0x51044d();while(!![]){try{const _0x5a91bc=-parseInt(_0x430d25(0x168))/0x1*(-parseInt(_0x430d25(0x142))/0x2)+-parseInt(_0x430d25(0x12f))/0x3+-parseInt(_0x430d25(0x151))/0x4+-parseInt(_0x430d25(0x138))/0x5*(-parseInt(_0x430d25(0x123))/0x6)+-parseInt(_0x430d25(0x149))/0x7*(-parseInt(_0x430d25(0x126))/0x8)+-parseInt(_0x430d25(0x128))/0x9*(-parseInt(_0x430d25(0x12e))/0xa)+-parseInt(_0x430d25(0x158))/0xb;if(_0x5a91bc===_0x358a1e)break;else _0x44c354['push'](_0x44c354['shift']());}catch(_0x5e1d39){_0x44c354['push'](_0x44c354['shift']());}}}(a0_0xc492,0x33364));import{readFileSync as a0_0x5ee94b,existsSync as a0_0x56a5df}from'fs';import{join as a0_0x507a4f}from'path';import{hostname as a0_0x907404}from'os';import{execSync as a0_0x29d0d1}from'child_process';import{Server as a0_0x1d74b7}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x122abe}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x542812,CallToolRequestSchema as a0_0x577e4f}from'@modelcontextprotocol/sdk/types.js';function h(_0x221af1){const _0x298cf0=a0_0x2999;if(!a0_0x56a5df(_0x221af1))return;for(let _0x534b01 of a0_0x5ee94b(_0x221af1,'utf-8')[_0x298cf0(0x10f)]('\x0a')){let _0x1f8f48=_0x534b01[_0x298cf0(0x172)]();if(!_0x1f8f48||_0x1f8f48[_0x298cf0(0x153)]('#'))continue;let _0x149c4b=_0x1f8f48['indexOf']('=');if(_0x149c4b<0x0)continue;let _0x8cde08=_0x1f8f48[_0x298cf0(0x12a)](0x0,_0x149c4b)[_0x298cf0(0x172)](),_0x356af5=_0x1f8f48[_0x298cf0(0x12a)](_0x149c4b+0x1)[_0x298cf0(0x172)]()[_0x298cf0(0x10d)](/^["']|["']$/g,'');if(!process.env[_0x8cde08])process.env[_0x8cde08]=_0x356af5;}}var R=process.env.HOME||'~',p=a0_0x507a4f(R,a0_0x4e5ac0(0x16a));h(a0_0x507a4f(p,'.env'));var C=process[a0_0x4e5ac0(0x194)]()[a0_0x4e5ac0(0x10d)](/\//g,'-');function a0_0x2999(_0x331d08,_0x12a298){_0x331d08=_0x331d08-0x10c;const _0xc49219=a0_0xc492();let _0x299934=_0xc49219[_0x331d08];return _0x299934;}h(a0_0x507a4f(p,C,a0_0x4e5ac0(0x14d)));function _(){const _0x2c85e3=a0_0x4e5ac0;try{return a0_0x29d0d1(_0x2c85e3(0x124),{'encoding':_0x2c85e3(0x17d),'timeout':0x7d0})[_0x2c85e3(0x172)]();}catch{return'';}}function a0_0xc492(){const _0x1c3231=['ack_inbox','0.3.0','report_status','working','2.0','new_task','commhub-channel','join','from','parse\x20error:\x20','number','/events/','/mcp','exit','\x20from\x20','2sADOTo','Priority\x20(default:\x20normal)','.claude/channels/commhub','no\x20response','initialize','connected','commhub_send_message','message','claude-code','getReader','trim','\x22\x20(','messages','text','read',':\x20inbox_count=','commhub','stringify','in_progress','CommHub\x20init\x20failed:\x20','config.json','utf-8','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','report_completion','data:\x20','connect','registered\x20as\x20\x22','blocked','Task\x20status','randomUUID','end','\x20priority=','Target\x20session\x20alias','commhub_send_task','warning:\x20could\x20not\x20register:\x20','shutting\x20down,\x20reporting\x20offline...','pop','high','SSE\x20connection\x20error:\x20','string','init\x20failed:\x20','content','write','priority','cwd','type','hub','decode','message_id','replace','Authorization','split','task','body','then','SSE\x20stream\x20ended,\x20reconnecting...','starting\x20SSE\x20listener...','result','get_all_status','Progress\x200-100','normal','Bearer\x20','statusText','SSE\x20error:\x20','toTimeString','unknown\x20tool','length','none','notifications/claude/channel','commhub_get_all_status','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','6pRxrbh','tmux\x20display-message\x20-p\x20\x27#S\x27','\x20RESUME_ID=','8dLdvUB','SSE\x20fatal:\x20','59391xPBSQS','from_session','slice','stderr','MCP\x20stdio\x20connected','.anet','110mZMQFt','611904RMivfv','Task\x20content',']\x20[commhub]\x20','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','token','completed','POST','error','find','236435QWgTwv','parse','session\x20disconnected','commhub_report_status','ENV:\x20URL=','notification','Reply\x20text\x20/\x20result\x20summary','\x20ALIAS=','object','connecting\x20to\x20','254908rqjdTF','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','status','catch','application/json,\x20text/event-stream','...\x20TMUX=','2766694xKTJfu','broadcast','setRequestHandler','SSE\x20connected\x20as\x20\x22','.env','ready\x20—\x20waiting\x20for\x20events','Session\x20alias:\x20','application/json','1259928tadkcA','send_task','startsWith','low','alias','idle','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','454432xgFuKZ'];a0_0xc492=function(){return _0x1c3231;};return a0_0xc492();}function E(){const _0x4575e8=a0_0x4e5ac0;try{let _0xa9a06a=a0_0x507a4f(R,_0x4575e8(0x12d),_0x4575e8(0x17c));if(a0_0x56a5df(_0xa9a06a))return JSON[_0x4575e8(0x139)](a0_0x5ee94b(_0xa9a06a,_0x4575e8(0x17d)));}catch{}return{};}var T=E(),k=process.env.COMMHUB_URL||T[a0_0x4e5ac0(0x196)]||'http://127.0.0.1:9200',q=process.env.COMMHUB_TMUX||_(),Z=process.env.COMMHUB_ALIAS||q||a0_0x907404(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto[a0_0x4e5ac0(0x185)](),X=process.env.COMMHUB_TOKEN||T[a0_0x4e5ac0(0x133)]||'';function V(_0x2da062){const _0x5aa241=a0_0x4e5ac0;let _0x5212f1=new Date()[_0x5aa241(0x11c)]()[_0x5aa241(0x12a)](0x0,0x8);process[_0x5aa241(0x12b)][_0x5aa241(0x192)]('['+_0x5212f1+_0x5aa241(0x131)+_0x2da062+'\x0a');}function O(_0x5f085b){return new Promise(_0x1c9c5e=>setTimeout(_0x1c9c5e,_0x5f085b));}V(a0_0x4e5ac0(0x13c)+k+a0_0x4e5ac0(0x13f)+Z+a0_0x4e5ac0(0x125)+w[a0_0x4e5ac0(0x12a)](0x0,0x8)+a0_0x4e5ac0(0x148)+(q||a0_0x4e5ac0(0x11f))+'\x20CWD='+process[a0_0x4e5ac0(0x194)]()+'\x20PROJECT_ENV='+C);var K=new a0_0x1d74b7({'name':a0_0x4e5ac0(0x15f),'version':a0_0x4e5ac0(0x15a)},{'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_0x4e5ac0(0x122),'You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.',a0_0x4e5ac0(0x14f)+Z][a0_0x4e5ac0(0x160)]('\x0a')});K[a0_0x4e5ac0(0x14b)](a0_0x542812,async()=>({'tools':[{'name':'commhub_reply','description':a0_0x4e5ac0(0x132),'inputSchema':{'type':'object','properties':{'task_id':{'type':a0_0x4e5ac0(0x18f),'description':a0_0x4e5ac0(0x144)},'text':{'type':'string','description':a0_0x4e5ac0(0x13e)},'status':{'type':a0_0x4e5ac0(0x18f),'enum':[a0_0x4e5ac0(0x134),a0_0x4e5ac0(0x183),a0_0x4e5ac0(0x136),a0_0x4e5ac0(0x17a)],'description':a0_0x4e5ac0(0x184)}},'required':[a0_0x4e5ac0(0x175)]}},{'name':a0_0x4e5ac0(0x13b),'description':a0_0x4e5ac0(0x143),'inputSchema':{'type':a0_0x4e5ac0(0x140),'properties':{'status':{'type':a0_0x4e5ac0(0x18f),'enum':['working',a0_0x4e5ac0(0x156),a0_0x4e5ac0(0x183),a0_0x4e5ac0(0x136)]},'task':{'type':a0_0x4e5ac0(0x18f),'description':'Current\x20task\x20description'},'progress':{'type':a0_0x4e5ac0(0x163),'description':a0_0x4e5ac0(0x117)}},'required':[a0_0x4e5ac0(0x145)]}},{'name':'commhub_send_task','description':'Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','inputSchema':{'type':a0_0x4e5ac0(0x140),'properties':{'alias':{'type':a0_0x4e5ac0(0x18f),'description':'Target\x20session\x20alias'},'task':{'type':a0_0x4e5ac0(0x18f),'description':a0_0x4e5ac0(0x130)},'priority':{'type':'string','enum':[a0_0x4e5ac0(0x18d),a0_0x4e5ac0(0x118),a0_0x4e5ac0(0x154)],'description':a0_0x4e5ac0(0x169)}},'required':[a0_0x4e5ac0(0x155),a0_0x4e5ac0(0x110)]}},{'name':'commhub_send_message','description':a0_0x4e5ac0(0x157),'inputSchema':{'type':a0_0x4e5ac0(0x140),'properties':{'alias':{'type':'string','description':a0_0x4e5ac0(0x188)},'message':{'type':a0_0x4e5ac0(0x18f),'description':'Message\x20content'}},'required':['alias',a0_0x4e5ac0(0x16f)]}},{'name':a0_0x4e5ac0(0x121),'description':a0_0x4e5ac0(0x17e),'inputSchema':{'type':a0_0x4e5ac0(0x140),'properties':{}}}]}));async function P(_0x3c5c02,_0x510361){const _0x28ee07=a0_0x4e5ac0;let _0x562d1c=await fetch(k+_0x28ee07(0x165),{'method':_0x28ee07(0x135),'headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x28ee07(0x119)+X}:{}},'body':JSON[_0x28ee07(0x179)]({'jsonrpc':_0x28ee07(0x15d),'id':0x1,'method':_0x28ee07(0x16c),'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x28ee07(0x15f),'version':_0x28ee07(0x15a)}}})});if(!_0x562d1c['ok']){let _0x5661d9=await _0x562d1c[_0x28ee07(0x175)]();return V(_0x28ee07(0x17b)+_0x562d1c[_0x28ee07(0x145)]+'\x20'+_0x5661d9['slice'](0x0,0x64)),{'ok':!0x1,'error':_0x28ee07(0x190)+_0x562d1c[_0x28ee07(0x145)]};}await _0x562d1c['text']();let _0x4615e3=(await(await fetch(k+'/mcp',{'method':_0x28ee07(0x135),'headers':{'Content-Type':_0x28ee07(0x150),'Accept':_0x28ee07(0x147),...X?{'Authorization':_0x28ee07(0x119)+X}:{}},'body':JSON[_0x28ee07(0x179)]({'jsonrpc':_0x28ee07(0x15d),'id':0x2,'method':'tools/call','params':{'name':_0x3c5c02,'arguments':_0x510361}})}))[_0x28ee07(0x175)]())[_0x28ee07(0x10f)]('\x0a')[_0x28ee07(0x137)](_0x28ee0c=>_0x28ee0c[_0x28ee07(0x153)]('data:\x20'));if(_0x4615e3){let _0x5ee184=JSON['parse'](_0x4615e3[_0x28ee07(0x12a)](0x6));return _0x5ee184?.[_0x28ee07(0x115)]?.[_0x28ee07(0x191)]?.[0x0]?.[_0x28ee07(0x175)]?JSON[_0x28ee07(0x139)](_0x5ee184[_0x28ee07(0x115)][_0x28ee07(0x191)][0x0][_0x28ee07(0x175)]):_0x5ee184;}return{'ok':!0x1,'error':_0x28ee07(0x16b)};}K[a0_0x4e5ac0(0x14b)](a0_0x577e4f,async _0x25a3ad=>{const _0x2c2613=a0_0x4e5ac0;let {name:_0x47fb3f,arguments:_0x5734a6}=_0x25a3ad['params'];if(_0x47fb3f==='commhub_reply'){let {task_id:_0x3cc870,text:_0x5d4149,status:_0x53f98d}=_0x5734a6;if(_0x53f98d==='completed'){let _0xb8212b=await P(_0x2c2613(0x17f),{'alias':Z,'task':_0x3cc870||'task','result':_0x5d4149});return{'content':[{'type':'text','text':JSON[_0x2c2613(0x179)](_0xb8212b)}]};}let _0x57dcae=await P(_0x2c2613(0x15b),{'resume_id':w,'alias':Z,'status':_0x53f98d===_0x2c2613(0x183)?_0x2c2613(0x183):_0x53f98d===_0x2c2613(0x136)?_0x2c2613(0x136):_0x2c2613(0x15c),'task':_0x5d4149[_0x2c2613(0x12a)](0x0,0xc8),'output':_0x5d4149});return{'content':[{'type':_0x2c2613(0x175),'text':JSON[_0x2c2613(0x179)](_0x57dcae)}]};}if(_0x47fb3f===_0x2c2613(0x13b)){let {status:_0xbea76b,task:_0x10c939,progress:_0x521f08}=_0x5734a6,_0x48b90d=await P(_0x2c2613(0x15b),{'resume_id':w,'alias':Z,'status':_0xbea76b,'task':_0x10c939,'progress':_0x521f08});return{'content':[{'type':'text','text':JSON[_0x2c2613(0x179)](_0x48b90d)}]};}if(_0x47fb3f===_0x2c2613(0x189)){let {alias:_0x7f3260,task:_0xeec80e,priority:_0x274af7}=_0x5734a6,_0x53998b=await P(_0x2c2613(0x152),{'alias':_0x7f3260,'task':_0xeec80e,'priority':_0x274af7||_0x2c2613(0x118),'from_session':Z});return{'content':[{'type':_0x2c2613(0x175),'text':JSON[_0x2c2613(0x179)](_0x53998b)}]};}if(_0x47fb3f===_0x2c2613(0x16e)){let {alias:_0x4aedfe,message:_0x2ac6a0}=_0x5734a6,_0x33be49=await P('send_message',{'alias':_0x4aedfe,'message':_0x2ac6a0,'from_session':Z});return{'content':[{'type':_0x2c2613(0x175),'text':JSON[_0x2c2613(0x179)](_0x33be49)}]};}if(_0x47fb3f===_0x2c2613(0x121)){let _0x246f83=await P(_0x2c2613(0x116),{});return{'content':[{'type':'text','text':JSON[_0x2c2613(0x179)](_0x246f83)}]};}return{'content':[{'type':_0x2c2613(0x175),'text':JSON[_0x2c2613(0x179)]({'error':_0x2c2613(0x11d)})}]};});async function c(){const _0x23c6c3=a0_0x4e5ac0;let _0x51165b=k+_0x23c6c3(0x164)+encodeURIComponent(Z),_0x1273b4={};if(X)_0x1273b4[_0x23c6c3(0x10e)]=_0x23c6c3(0x119)+X;V(_0x23c6c3(0x141)+_0x51165b);while(!0x0){try{let _0x3a6110=await fetch(_0x51165b,{'headers':_0x1273b4});if(!_0x3a6110['ok']){V(_0x23c6c3(0x11b)+_0x3a6110[_0x23c6c3(0x145)]+'\x20'+_0x3a6110[_0x23c6c3(0x11a)]),await O(0x1388);continue;}let _0x984e1=_0x3a6110[_0x23c6c3(0x111)][_0x23c6c3(0x171)](),_0x22a978=new TextDecoder(),_0x4a588c='';while(!0x0){let {done:_0x591df8,value:_0x372ea1}=await _0x984e1[_0x23c6c3(0x176)]();if(_0x591df8)break;_0x4a588c+=_0x22a978[_0x23c6c3(0x197)](_0x372ea1,{'stream':!0x0});let _0x5c634f=_0x4a588c[_0x23c6c3(0x10f)]('\x0a\x0a');_0x4a588c=_0x5c634f[_0x23c6c3(0x18c)]()||'';for(let _0x56cbf4 of _0x5c634f){let _0x9c6f15=_0x56cbf4[_0x23c6c3(0x10f)]('\x0a')[_0x23c6c3(0x137)](_0x999dba=>_0x999dba[_0x23c6c3(0x153)](_0x23c6c3(0x180)));if(!_0x9c6f15)continue;try{let _0x2f75ea=JSON[_0x23c6c3(0x139)](_0x9c6f15[_0x23c6c3(0x12a)](0x6));await v(_0x2f75ea);}catch(_0x4cb8d8){V(_0x23c6c3(0x162)+_0x4cb8d8);}}}V(_0x23c6c3(0x113));}catch(_0x2bf44b){V(_0x23c6c3(0x18e)+_0x2bf44b);}await O(0xbb8);}}async function v(_0x159ed9){const _0xd0772d=a0_0x4e5ac0;if(_0x159ed9[_0xd0772d(0x195)]===_0xd0772d(0x16d)){V(_0xd0772d(0x14c)+Z+'\x22');return;}if(_0x159ed9[_0xd0772d(0x195)]==='new_message'){if(V('←\x20message\x20from\x20'+_0x159ed9[_0xd0772d(0x161)]+':\x20'+_0x159ed9[_0xd0772d(0x16f)][_0xd0772d(0x12a)](0x0,0x3c)),await K['notification']({'method':_0xd0772d(0x120),'params':{'content':_0x159ed9['message'],'meta':{'sender':_0x159ed9[_0xd0772d(0x161)]||_0xd0772d(0x196),'sender_id':'commhub','user':_0x159ed9[_0xd0772d(0x161)]||_0xd0772d(0x196),'priority':_0xd0772d(0x118)}}}),_0x159ed9[_0xd0772d(0x10c)])await P('ack_inbox',{'alias':Z,'message_id':_0x159ed9[_0xd0772d(0x10c)]});return;}if(_0x159ed9[_0xd0772d(0x195)]===_0xd0772d(0x15e)||_0x159ed9['type']===_0xd0772d(0x14a)){V('←\x20'+_0x159ed9[_0xd0772d(0x195)]+_0xd0772d(0x177)+_0x159ed9['inbox_count']+_0xd0772d(0x187)+(_0x159ed9[_0xd0772d(0x193)]||_0xd0772d(0x118)));let _0xb2a905=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0xb2a905?.['ok']&&_0xb2a905[_0xd0772d(0x174)]?.[_0xd0772d(0x11e)]>0x0)for(let _0x574053 of _0xb2a905[_0xd0772d(0x174)]){let _0x45631f={'sender':_0x574053[_0xd0772d(0x129)]||_0xd0772d(0x196),'sender_id':_0xd0772d(0x178),'user':_0x574053['from_session']||_0xd0772d(0x196),'task_id':_0x574053['id'],'priority':_0x574053['priority']||'normal'};await K[_0xd0772d(0x13d)]({'method':'notifications/claude/channel','params':{'content':_0x574053[_0xd0772d(0x191)],'meta':_0x45631f}}),V('→\x20injected\x20task\x20'+_0x574053['id'][_0xd0772d(0x12a)](0x0,0x8)+_0xd0772d(0x167)+_0x574053[_0xd0772d(0x129)]+':\x20'+_0x574053[_0xd0772d(0x191)]['slice'](0x0,0x3c)),await P(_0xd0772d(0x159),{'alias':Z,'message_id':_0x574053['id']});}}}async function u(){const _0x45d49f=a0_0x4e5ac0;let _0x5a7b30=new a0_0x122abe();await K[_0x45d49f(0x181)](_0x5a7b30),V(_0x45d49f(0x12c)),V(_0x45d49f(0x114)),c()[_0x45d49f(0x146)](_0x96d63e=>V(_0x45d49f(0x127)+_0x96d63e)),P(_0x45d49f(0x15b),{'resume_id':w,'alias':Z,'status':_0x45d49f(0x156),'server':a0_0x907404(),'hostname':a0_0x907404(),'agent':'claude-code','project_dir':process['cwd'](),'tmux_name':q||void 0x0})[_0x45d49f(0x112)](()=>V(_0x45d49f(0x182)+Z+_0x45d49f(0x173)+w['slice'](0x0,0x8)+')'))[_0x45d49f(0x146)](_0x3ed7c0=>V(_0x45d49f(0x18a)+_0x3ed7c0)),setInterval(()=>{const _0x4a2b69=_0x45d49f;P('report_status',{'resume_id':w,'alias':Z,'status':_0x4a2b69(0x156),'server':a0_0x907404(),'hostname':a0_0x907404(),'agent':_0x4a2b69(0x170),'project_dir':process['cwd'](),'tmux_name':q||void 0x0})['catch'](_0x9dcea2=>V('heartbeat\x20failed:\x20'+_0x9dcea2));},0x2bf20),V(_0x45d49f(0x14e));}u()[a0_0x4e5ac0(0x146)](_0x208507=>{const _0x2b2eed=a0_0x4e5ac0;V('fatal:\x20'+_0x208507),process[_0x2b2eed(0x166)](0x1);});async function f(){const _0x320d34=a0_0x4e5ac0;V(_0x320d34(0x18b)),await P(_0x320d34(0x15b),{'resume_id':w,'alias':Z,'status':_0x320d34(0x136),'task':_0x320d34(0x13a)})[_0x320d34(0x146)](()=>{}),process[_0x320d34(0x166)](0x0);}process['stdin']['on'](a0_0x4e5ac0(0x186),()=>f()),process['on']('SIGTERM',()=>f()),process['on']('SIGINT',()=>f());
2
+ const a0_0x5a24d8=a0_0x2e99;(function(_0x7b9ffb,_0x4221e5){const _0x244280=a0_0x2e99,_0x31017a=_0x7b9ffb();while(!![]){try{const _0x31ff1d=-parseInt(_0x244280(0x104))/0x1+parseInt(_0x244280(0xcc))/0x2+parseInt(_0x244280(0xab))/0x3+-parseInt(_0x244280(0x85))/0x4*(-parseInt(_0x244280(0xf3))/0x5)+parseInt(_0x244280(0xd8))/0x6*(-parseInt(_0x244280(0xfa))/0x7)+parseInt(_0x244280(0xb8))/0x8+parseInt(_0x244280(0xa2))/0x9*(-parseInt(_0x244280(0x112))/0xa);if(_0x31ff1d===_0x4221e5)break;else _0x31017a['push'](_0x31017a['shift']());}catch(_0x3c608f){_0x31017a['push'](_0x31017a['shift']());}}}(a0_0x211f,0x56a5f));import{readFileSync as a0_0x10de7b,existsSync as a0_0x12fbeb}from'fs';import{join as a0_0x2cd78d}from'path';import{hostname as a0_0xe34d17}from'os';function a0_0x2e99(_0x5f5d3d,_0x285bc5){_0x5f5d3d=_0x5f5d3d-0x83;const _0x211f5a=a0_0x211f();let _0x2e99e7=_0x211f5a[_0x5f5d3d];return _0x2e99e7;}import{execSync as a0_0x466c45}from'child_process';import{Server as a0_0x12193a}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0xde335d}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0xdbda12,CallToolRequestSchema as a0_0x447bbb}from'@modelcontextprotocol/sdk/types.js';function p(_0x25e83a){const _0x5e0089=a0_0x2e99;if(!a0_0x12fbeb(_0x25e83a))return;for(let _0x4344d1 of a0_0x10de7b(_0x25e83a,_0x5e0089(0xd6))[_0x5e0089(0xeb)]('\x0a')){let _0x117511=_0x4344d1['trim']();if(!_0x117511||_0x117511[_0x5e0089(0x9b)]('#'))continue;let _0x4622be=_0x117511[_0x5e0089(0x10c)]('=');if(_0x4622be<0x0)continue;let _0x42458c=_0x117511[_0x5e0089(0xbd)](0x0,_0x4622be)[_0x5e0089(0x101)](),_0x466dca=_0x117511['slice'](_0x4622be+0x1)[_0x5e0089(0x101)]()[_0x5e0089(0xd3)](/^["']|["']$/g,'');if(!process.env[_0x42458c])process.env[_0x42458c]=_0x466dca;}}var C=process.env.HOME||'~',T=a0_0x2cd78d(C,'.claude/channels/commhub');p(a0_0x2cd78d(T,a0_0x5a24d8(0x108)));var L=process[a0_0x5a24d8(0x110)]()[a0_0x5a24d8(0xd3)](/\//g,'-');p(a0_0x2cd78d(T,L,'.env'));function U(){const _0x506d41=a0_0x5a24d8;try{return a0_0x466c45('tmux\x20display-message\x20-p\x20\x27#S\x27',{'encoding':_0x506d41(0xd6),'timeout':0x7d0})[_0x506d41(0x101)]();}catch{return'';}}function c(){const _0x21adeb=a0_0x5a24d8;try{let _0x5a0884=a0_0x2cd78d(C,_0x21adeb(0xed),_0x21adeb(0x95));if(a0_0x12fbeb(_0x5a0884))return JSON[_0x21adeb(0xee)](a0_0x10de7b(_0x5a0884,'utf-8'));}catch{}return{};}var H=c(),D=process.env.COMMHUB_URL||H[a0_0x5a24d8(0xe0)]||a0_0x5a24d8(0x10b),f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0xe34d17(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto[a0_0x5a24d8(0xa0)](),X=process.env.COMMHUB_TOKEN||H[a0_0x5a24d8(0xc4)]||'';function Y(_0x4de0ee){const _0x2c813e=a0_0x5a24d8;let _0x4a7a40=new Date()[_0x2c813e(0xe7)]()[_0x2c813e(0xbd)](0x0,0x8);process[_0x2c813e(0xf1)][_0x2c813e(0xdb)]('['+_0x4a7a40+_0x2c813e(0xe9)+_0x4de0ee+'\x0a');}function h(_0x4b7f5f){return new Promise(_0x3869ce=>setTimeout(_0x3869ce,_0x4b7f5f));}Y(a0_0x5a24d8(0x84)+D+'\x20ALIAS='+Z+a0_0x5a24d8(0xac)+w[a0_0x5a24d8(0xbd)](0x0,0x8)+a0_0x5a24d8(0x109)+(f||a0_0x5a24d8(0xc8))+a0_0x5a24d8(0xd0)+process[a0_0x5a24d8(0x110)]()+a0_0x5a24d8(0x107)+L);var k=new Map(),K=new a0_0x12193a({'name':a0_0x5a24d8(0x9e),'version':a0_0x5a24d8(0x8b)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x5a24d8(0xc1),a0_0x5a24d8(0xd2),a0_0x5a24d8(0xe4),a0_0x5a24d8(0xfe),a0_0x5a24d8(0x105)+Z][a0_0x5a24d8(0x8e)]('\x0a')});K[a0_0x5a24d8(0xc9)](a0_0xdbda12,async()=>({'tools':[{'name':a0_0x5a24d8(0xbf),'description':a0_0x5a24d8(0xc6),'inputSchema':{'type':'object','properties':{'task_id':{'type':a0_0x5a24d8(0xdd),'description':a0_0x5a24d8(0x103)},'text':{'type':'string','description':a0_0x5a24d8(0xe6)},'status':{'type':a0_0x5a24d8(0xdd),'enum':[a0_0x5a24d8(0xe2),'failed',a0_0x5a24d8(0x90),a0_0x5a24d8(0xfb),'error',a0_0x5a24d8(0xce)],'description':a0_0x5a24d8(0xae)}},'required':['text']}},{'name':a0_0x5a24d8(0x87),'description':'Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','inputSchema':{'type':a0_0x5a24d8(0x9a),'properties':{'status':{'type':a0_0x5a24d8(0xdd),'enum':[a0_0x5a24d8(0xa8),a0_0x5a24d8(0x91),a0_0x5a24d8(0xfb),'error']},'task':{'type':a0_0x5a24d8(0xdd),'description':a0_0x5a24d8(0xbc)},'progress':{'type':'number','description':a0_0x5a24d8(0xaa)}},'required':['status']}},{'name':a0_0x5a24d8(0xde),'description':a0_0x5a24d8(0xff),'inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x5a24d8(0xdd),'description':'Target\x20session\x20alias'},'task':{'type':a0_0x5a24d8(0xdd),'description':'Task\x20content'},'priority':{'type':a0_0x5a24d8(0xdd),'enum':[a0_0x5a24d8(0x102),a0_0x5a24d8(0xd1),'low'],'description':a0_0x5a24d8(0xd7)}},'required':[a0_0x5a24d8(0xa6),'task']}},{'name':'commhub_send_message','description':'Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','inputSchema':{'type':a0_0x5a24d8(0x9a),'properties':{'alias':{'type':a0_0x5a24d8(0xdd),'description':a0_0x5a24d8(0xa7)},'message':{'type':'string','description':'Message\x20content'}},'required':[a0_0x5a24d8(0xa6),a0_0x5a24d8(0xa4)]}},{'name':a0_0x5a24d8(0x9c),'description':a0_0x5a24d8(0xcb),'inputSchema':{'type':a0_0x5a24d8(0x9a),'properties':{}}}]}));async function P(_0x213908,_0x17fb12){const _0x3f8780=a0_0x5a24d8;let _0x1d8fc1=await fetch(D+_0x3f8780(0x106),{'method':_0x3f8780(0xf6),'headers':{'Content-Type':_0x3f8780(0x94),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x3f8780(0xe8)+X}:{}},'body':JSON[_0x3f8780(0x97)]({'jsonrpc':_0x3f8780(0x10f),'id':0x1,'method':'initialize','params':{'protocolVersion':_0x3f8780(0xd4),'capabilities':{},'clientInfo':{'name':_0x3f8780(0x9e),'version':_0x3f8780(0x8b)}}})});if(!_0x1d8fc1['ok']){let _0x3a19e9=await _0x1d8fc1[_0x3f8780(0x93)]();return Y(_0x3f8780(0x9f)+_0x1d8fc1[_0x3f8780(0x92)]+'\x20'+_0x3a19e9[_0x3f8780(0xbd)](0x0,0x64)),{'ok':!0x1,'error':_0x3f8780(0xf4)+_0x1d8fc1[_0x3f8780(0x92)]};}await _0x1d8fc1[_0x3f8780(0x93)]();let _0x217d35=(await(await fetch(D+'/mcp',{'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x3f8780(0xe8)+X}:{}},'body':JSON['stringify']({'jsonrpc':'2.0','id':0x2,'method':'tools/call','params':{'name':_0x213908,'arguments':_0x17fb12}})}))[_0x3f8780(0x93)]())[_0x3f8780(0xeb)]('\x0a')[_0x3f8780(0xaf)](_0x3b06bc=>_0x3b06bc[_0x3f8780(0x9b)](_0x3f8780(0xa5)));if(_0x217d35){let _0x5d606b=JSON[_0x3f8780(0xee)](_0x217d35[_0x3f8780(0xbd)](0x6));return _0x5d606b?.[_0x3f8780(0x10e)]?.[_0x3f8780(0xd9)]?.[0x0]?.[_0x3f8780(0x93)]?JSON[_0x3f8780(0xee)](_0x5d606b[_0x3f8780(0x10e)][_0x3f8780(0xd9)][0x0][_0x3f8780(0x93)]):_0x5d606b;}return{'ok':!0x1,'error':_0x3f8780(0x88)};}function a0_0x211f(){const _0x4e70b8=['new_task','←\x20message\x20from\x20','12831jqYGMd','blocked','commhub_send_message','length','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','messages','trim','high','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','249985JKJNvm','Session\x20alias:\x20','/mcp','\x20PROJECT_ENV=','.env','...\x20TMUX=','get','http://127.0.0.1:9200','indexOf','ack_inbox','result','2.0','cwd','statusText','40mWAUuy','SSE\x20connection\x20error:\x20','ENV:\x20URL=','68IGLWTM','commhub','commhub_report_status','no\x20response','delete','failed','0.3.0','getReader','send_message','join','warning:\x20could\x20not\x20register:\x20','cancelled','idle','status','text','application/json','config.json','pop','stringify','then','SSE\x20stream\x20ended,\x20reconnecting...','object','startsWith','commhub_get_all_status','inbox_count','commhub-channel','CommHub\x20init\x20failed:\x20','randomUUID','notification','3266577ebIpxg','claude-code','message','data:\x20','alias','Target\x20session\x20alias','working','get_inbox','Progress\x200-100','1989948JyhfpA','\x20RESUME_ID=','error','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','find','from_session','MCP\x20stdio\x20connected','registered\x20as\x20\x22','SSE\x20error:\x20','shutting\x20down,\x20reporting\x20offline...','message_id','→\x20injected\x20task\x20','broadcast','3663336DtZLWS','set','decode','get_all_status','Current\x20task\x20description','slice','params','commhub_reply','catch','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','exit','\x20from\x20','token','heartbeat\x20failed:\x20','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','session\x20disconnected','none','setRequestHandler','SSE\x20connected\x20as\x20\x22','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','1156588zBHFKv','from','in_progress','type','\x20CWD=','normal','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','replace','2025-03-26','connect','utf-8','Priority\x20(default:\x20normal)','1110UlpetR','content','\x20priority=','write','fatal:\x20','string','commhub_send_task','body','hub','ready\x20—\x20waiting\x20for\x20events','completed','/events/','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','SSE\x20fatal:\x20','Reply\x20text\x20/\x20result\x20summary','toTimeString','Bearer\x20',']\x20[commhub]\x20','priority','split','end','.anet','parse','SIGTERM','report_status','stderr',':\x20inbox_count=','204790ZaIFJe','init\x20failed:\x20','SIGINT','POST','unknown\x20tool'];a0_0x211f=function(){return _0x4e70b8;};return a0_0x211f();}K[a0_0x5a24d8(0xc9)](a0_0x447bbb,async _0xcb65a4=>{const _0x4df43a=a0_0x5a24d8;let {name:_0x35272e,arguments:_0xf54534}=_0xcb65a4[_0x4df43a(0xbe)];if(_0x35272e===_0x4df43a(0xbf)){let {task_id:_0x43ce4f,text:_0x225cbe,status:_0x1cafc8}=_0xf54534;if(_0x1cafc8==='completed'||_0x1cafc8===_0x4df43a(0x8a)||_0x1cafc8===_0x4df43a(0x90)){let _0x5c49e3=_0x1cafc8===_0x4df43a(0xe2)?'replied':_0x1cafc8,_0x23bc53=_0x43ce4f?k[_0x4df43a(0x10a)](_0x43ce4f)||_0x4df43a(0xe0):_0x4df43a(0xe0),_0x7630f2=await P('send_reply',{'alias':_0x23bc53,'text':_0x225cbe,'in_reply_to':_0x43ce4f||void 0x0,'status':_0x5c49e3,'from_session':Z});if(_0x43ce4f)k[_0x4df43a(0x89)](_0x43ce4f);return{'content':[{'type':'text','text':JSON[_0x4df43a(0x97)](_0x7630f2)}]};}let _0x2c2beb=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x1cafc8==='blocked'?'blocked':_0x1cafc8===_0x4df43a(0xad)?_0x4df43a(0xad):_0x4df43a(0xa8),'task':_0x225cbe[_0x4df43a(0xbd)](0x0,0xc8),'output':_0x225cbe});return{'content':[{'type':_0x4df43a(0x93),'text':JSON[_0x4df43a(0x97)](_0x2c2beb)}]};}if(_0x35272e===_0x4df43a(0x87)){let {status:_0x2f467a,task:_0x70e0f7,progress:_0x1f9797}=_0xf54534,_0x248b07=await P(_0x4df43a(0xf0),{'resume_id':w,'alias':Z,'status':_0x2f467a,'task':_0x70e0f7,'progress':_0x1f9797});return{'content':[{'type':_0x4df43a(0x93),'text':JSON[_0x4df43a(0x97)](_0x248b07)}]};}if(_0x35272e==='commhub_send_task'){let {alias:_0x3a43f7,task:_0x59c4aa,priority:_0x1e641c}=_0xf54534,_0x3d8ace=await P('send_task',{'alias':_0x3a43f7,'task':_0x59c4aa,'priority':_0x1e641c||_0x4df43a(0xd1),'from_session':Z});return{'content':[{'type':'text','text':JSON['stringify'](_0x3d8ace)}]};}if(_0x35272e===_0x4df43a(0xfc)){let {alias:_0x362a48,message:_0x20423f}=_0xf54534,_0x5c1e0=await P(_0x4df43a(0x8d),{'alias':_0x362a48,'message':_0x20423f,'from_session':Z});return{'content':[{'type':_0x4df43a(0x93),'text':JSON[_0x4df43a(0x97)](_0x5c1e0)}]};}if(_0x35272e==='commhub_get_all_status'){let _0x342e99=await P(_0x4df43a(0xbb),{});return{'content':[{'type':_0x4df43a(0x93),'text':JSON[_0x4df43a(0x97)](_0x342e99)}]};}return{'content':[{'type':'text','text':JSON['stringify']({'error':_0x4df43a(0xf7)})}]};});async function v(){const _0x27a7e6=a0_0x5a24d8;let _0x29babc=D+_0x27a7e6(0xe3)+encodeURIComponent(Z),_0x2a656b={};if(X)_0x2a656b['Authorization']=_0x27a7e6(0xe8)+X;Y('connecting\x20to\x20'+_0x29babc);while(!0x0){try{let _0x40ea2b=await fetch(_0x29babc,{'headers':_0x2a656b});if(!_0x40ea2b['ok']){Y(_0x27a7e6(0xb3)+_0x40ea2b['status']+'\x20'+_0x40ea2b[_0x27a7e6(0x111)]),await h(0x1388);continue;}let _0x478cc0=_0x40ea2b[_0x27a7e6(0xdf)][_0x27a7e6(0x8c)](),_0x5ac4af=new TextDecoder(),_0x4e7c50='';while(!0x0){let {done:_0x5198e0,value:_0xec87cb}=await _0x478cc0['read']();if(_0x5198e0)break;_0x4e7c50+=_0x5ac4af[_0x27a7e6(0xba)](_0xec87cb,{'stream':!0x0});let _0x31fb13=_0x4e7c50[_0x27a7e6(0xeb)]('\x0a\x0a');_0x4e7c50=_0x31fb13[_0x27a7e6(0x96)]()||'';for(let _0x2dc467 of _0x31fb13){let _0x2269f1=_0x2dc467['split']('\x0a')['find'](_0x3aacb5=>_0x3aacb5[_0x27a7e6(0x9b)](_0x27a7e6(0xa5)));if(!_0x2269f1)continue;try{let _0xa739bb=JSON[_0x27a7e6(0xee)](_0x2269f1[_0x27a7e6(0xbd)](0x6));await u(_0xa739bb);}catch(_0x45c568){Y('parse\x20error:\x20'+_0x45c568);}}}Y(_0x27a7e6(0x99));}catch(_0x2af1dd){Y(_0x27a7e6(0x83)+_0x2af1dd);}await h(0xbb8);}}async function u(_0x17b990){const _0x3d71ac=a0_0x5a24d8;if(_0x17b990['type']==='connected'){Y(_0x3d71ac(0xca)+Z+'\x22');return;}if(_0x17b990[_0x3d71ac(0xcf)]==='new_message'){if(Y(_0x3d71ac(0xf9)+_0x17b990[_0x3d71ac(0xcd)]+':\x20'+_0x17b990['message'][_0x3d71ac(0xbd)](0x0,0x3c)),await K[_0x3d71ac(0xa1)]({'method':'notifications/claude/channel','params':{'content':_0x17b990[_0x3d71ac(0xa4)],'meta':{'sender':_0x17b990[_0x3d71ac(0xcd)]||_0x3d71ac(0xe0),'sender_id':_0x3d71ac(0x86),'user':_0x17b990['from']||_0x3d71ac(0xe0),'priority':_0x3d71ac(0xd1)}}}),_0x17b990[_0x3d71ac(0xb5)])await P(_0x3d71ac(0x10d),{'alias':Z,'message_id':_0x17b990['message_id']});return;}if(_0x17b990[_0x3d71ac(0xcf)]===_0x3d71ac(0xf8)||_0x17b990[_0x3d71ac(0xcf)]===_0x3d71ac(0xb7)){Y('←\x20'+_0x17b990[_0x3d71ac(0xcf)]+_0x3d71ac(0xf2)+_0x17b990[_0x3d71ac(0x9d)]+_0x3d71ac(0xda)+(_0x17b990['priority']||_0x3d71ac(0xd1)));let _0x56df99=await P(_0x3d71ac(0xa9),{'alias':Z,'limit':0x5});if(_0x56df99?.['ok']&&_0x56df99[_0x3d71ac(0x100)]?.[_0x3d71ac(0xfd)]>0x0)for(let _0x40f494 of _0x56df99[_0x3d71ac(0x100)]){let _0x4d4b59={'sender':_0x40f494['from_session']||_0x3d71ac(0xe0),'sender_id':_0x3d71ac(0x86),'user':_0x40f494[_0x3d71ac(0xb0)]||_0x3d71ac(0xe0),'task_id':_0x40f494['id'],'priority':_0x40f494[_0x3d71ac(0xea)]||_0x3d71ac(0xd1)};k[_0x3d71ac(0xb9)](_0x40f494['id'],_0x40f494[_0x3d71ac(0xb0)]||_0x3d71ac(0xe0)),await K[_0x3d71ac(0xa1)]({'method':'notifications/claude/channel','params':{'content':_0x40f494[_0x3d71ac(0xd9)],'meta':_0x4d4b59}}),Y(_0x3d71ac(0xb6)+_0x40f494['id'][_0x3d71ac(0xbd)](0x0,0x8)+_0x3d71ac(0xc3)+_0x40f494['from_session']+':\x20'+_0x40f494[_0x3d71ac(0xd9)]['slice'](0x0,0x3c)),await P(_0x3d71ac(0x10d),{'alias':Z,'message_id':_0x40f494['id']});}}}async function S(){const _0x44b360=a0_0x5a24d8;let _0x2f5ce7=new a0_0xde335d();await K[_0x44b360(0xd5)](_0x2f5ce7),Y(_0x44b360(0xb1)),Y('starting\x20SSE\x20listener...'),v()[_0x44b360(0xc0)](_0x504347=>Y(_0x44b360(0xe5)+_0x504347)),P(_0x44b360(0xf0),{'resume_id':w,'alias':Z,'status':_0x44b360(0x91),'server':a0_0xe34d17(),'hostname':a0_0xe34d17(),'agent':'claude-code','project_dir':process[_0x44b360(0x110)](),'tmux_name':f||void 0x0})[_0x44b360(0x98)](()=>Y(_0x44b360(0xb2)+Z+'\x22\x20('+w[_0x44b360(0xbd)](0x0,0x8)+')'))[_0x44b360(0xc0)](_0x4be64d=>Y(_0x44b360(0x8f)+_0x4be64d)),setInterval(()=>{const _0x73249e=_0x44b360;P('report_status',{'resume_id':w,'alias':Z,'status':_0x73249e(0x91),'server':a0_0xe34d17(),'hostname':a0_0xe34d17(),'agent':_0x73249e(0xa3),'project_dir':process[_0x73249e(0x110)](),'tmux_name':f||void 0x0})[_0x73249e(0xc0)](_0x4af61e=>Y(_0x73249e(0xc5)+_0x4af61e));},0x2bf20),Y(_0x44b360(0xe1));}S()[a0_0x5a24d8(0xc0)](_0x5a95be=>{const _0x4754cd=a0_0x5a24d8;Y(_0x4754cd(0xdc)+_0x5a95be),process[_0x4754cd(0xc2)](0x1);});async function N(){const _0x12da06=a0_0x5a24d8;Y(_0x12da06(0xb4)),await P('report_status',{'resume_id':w,'alias':Z,'status':_0x12da06(0xad),'task':_0x12da06(0xc7)})[_0x12da06(0xc0)](()=>{}),process[_0x12da06(0xc2)](0x0);}process['stdin']['on'](a0_0x5a24d8(0xec),()=>N()),process['on'](a0_0x5a24d8(0xef),()=>N()),process['on'](a0_0x5a24d8(0xf5),()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.0.0-preview.1",
3
+ "version": "2.0.0-preview.2",
4
4
  "description": "AI Agent Network — Server + Client + Setup in one package. SSE real-time communication for multi-agent orchestration.",
5
5
  "type": "module",
6
6
  "main": "dist/src/client.js",