@sleep2agi/agent-network 2.0.0-preview.3 → 2.0.0-preview.4

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_0x286395=a0_0x5507;(function(_0x35d7b7,_0x2eee07){const _0x42008=a0_0x5507,_0x18cc2b=_0x35d7b7();while(!![]){try{const _0x3f22f7=-parseInt(_0x42008(0x17c))/0x1+-parseInt(_0x42008(0x196))/0x2*(-parseInt(_0x42008(0x1a1))/0x3)+-parseInt(_0x42008(0x185))/0x4*(-parseInt(_0x42008(0x17b))/0x5)+parseInt(_0x42008(0x186))/0x6+parseInt(_0x42008(0x19f))/0x7*(parseInt(_0x42008(0x188))/0x8)+-parseInt(_0x42008(0x15d))/0x9*(parseInt(_0x42008(0x16b))/0xa)+-parseInt(_0x42008(0x166))/0xb*(parseInt(_0x42008(0x160))/0xc);if(_0x3f22f7===_0x2eee07)break;else _0x18cc2b['push'](_0x18cc2b['shift']());}catch(_0x20239b){_0x18cc2b['push'](_0x18cc2b['shift']());}}}(a0_0x344b,0x83c04));import{EventEmitter as a0_0x5a1e8e}from'events';import{hostname as a0_0x10f18b}from'os';function a0_0x344b(){const _0x355cfe=['reply','heartbeatTimer','running','match','message','22XiQiWm','now','alias','Authorization','disconnected','3590zzGyQz','sdk-','error','messages','AbortError','send','new_task','/events/','get_inbox','result','registered','parse','toTimeString','token','offline','getAllStatus','28395UncLFJ','495136TVJdMg','SSE\x20failed:\x20','split','agent','heartbeat\x20failed:\x20','inbox\x20error:\x20','2.0','cwd','sseAbort','4QvIbVu','2188680piavPc','body','7973960laAhyL','connectSSE','status','min','resumeId','abort','toString','SSE\x20reconnecting\x20in\x20','getReader','SSE\x20connected','catch','signal','idle','autoConnect','308094uplwtU','connected','broadcast','new_message','normal','replace','Bearer\x20','sleep','startsWith','7tuFcpy','content','12hYEUCg','emit','application/json,\x20text/event-stream','get_all_status','type','heartbeatInterval','slice','sdk','pop','reconnectDelay','processInbox','call','ack_inbox','log','decode','send_message','completed','POST','tools/call','server','url','14058HVVOSm','report_status','text','2327076lXzOYy'];a0_0x344b=function(){return _0x355cfe;};return a0_0x344b();}class T extends a0_0x5a1e8e{[a0_0x286395(0x15c)];[a0_0x286395(0x168)];['token'];[a0_0x286395(0x17f)];['resumeId'];['heartbeatInterval'];[a0_0x286395(0x1aa)];['heartbeatTimer'];['sseAbort'];[a0_0x286395(0x163)]=!0x1;constructor(_0x52ac67){const _0x2d3c2a=a0_0x286395;super();if(this[_0x2d3c2a(0x15c)]=_0x52ac67[_0x2d3c2a(0x15c)][_0x2d3c2a(0x19b)](/\/$/,''),this[_0x2d3c2a(0x168)]=_0x52ac67[_0x2d3c2a(0x168)],this[_0x2d3c2a(0x178)]=_0x52ac67['token'],this[_0x2d3c2a(0x17f)]=_0x52ac67[_0x2d3c2a(0x17f)]||_0x2d3c2a(0x1a8),this[_0x2d3c2a(0x18c)]=_0x2d3c2a(0x16c)+_0x52ac67['alias']+'-'+Date[_0x2d3c2a(0x167)]()[_0x2d3c2a(0x18e)](0x24),this[_0x2d3c2a(0x1a6)]=_0x52ac67[_0x2d3c2a(0x1a6)]??0x2bf20,this[_0x2d3c2a(0x1aa)]=_0x52ac67[_0x2d3c2a(0x1aa)]??0xbb8,_0x52ac67[_0x2d3c2a(0x195)]!==!0x1)this['connect']();}[a0_0x286395(0x1ae)](_0x5609f6){const _0x3d75ec=a0_0x286395;console[_0x3d75ec(0x1ae)]('['+new Date()[_0x3d75ec(0x177)]()[_0x3d75ec(0x1a7)](0x0,0x8)+']\x20[commhub:'+this[_0x3d75ec(0x168)]+']\x20'+_0x5609f6);}async[a0_0x286395(0x1ac)](_0x1251b6,_0x33617c){const _0x1dd007=a0_0x286395;let _0x304614={'Content-Type':'application/json','Accept':_0x1dd007(0x1a3)};if(this[_0x1dd007(0x178)])_0x304614[_0x1dd007(0x169)]=_0x1dd007(0x19c)+this[_0x1dd007(0x178)];let _0x2a432d=await(await fetch(this[_0x1dd007(0x15c)]+'/mcp',{'method':_0x1dd007(0x159),'headers':_0x304614,'body':JSON['stringify']({'jsonrpc':_0x1dd007(0x182),'id':Date[_0x1dd007(0x167)](),'method':_0x1dd007(0x15a),'params':{'name':_0x1251b6,'arguments':_0x33617c}})}))[_0x1dd007(0x15f)](),_0x14b311=_0x2a432d[_0x1dd007(0x164)](/data: (.+)/),_0x339ae0=_0x14b311?JSON[_0x1dd007(0x176)](_0x14b311[0x1]):JSON[_0x1dd007(0x176)](_0x2a432d),_0x2b5aed=_0x339ae0?.[_0x1dd007(0x174)]?.[_0x1dd007(0x1a0)]?.[0x0]?.['text'];return _0x2b5aed?JSON[_0x1dd007(0x176)](_0x2b5aed):_0x339ae0;}async['connect'](){const _0x47c887=a0_0x286395;if(this[_0x47c887(0x163)])return;this[_0x47c887(0x163)]=!0x0,await this[_0x47c887(0x18a)](_0x47c887(0x194)),this['log'](_0x47c887(0x175)),this[_0x47c887(0x162)]=setInterval(()=>{const _0x2302d2=_0x47c887;this[_0x2302d2(0x18a)](_0x2302d2(0x194))[_0x2302d2(0x192)](_0x5d6d61=>this[_0x2302d2(0x1ae)](_0x2302d2(0x180)+_0x5d6d61['message']));},this[_0x47c887(0x1a6)]),this['connectSSE']();}async['disconnect'](){const _0x2f7b09=a0_0x286395;if(this[_0x2f7b09(0x163)]=!0x1,this[_0x2f7b09(0x184)]?.[_0x2f7b09(0x18d)](),this[_0x2f7b09(0x162)])clearInterval(this[_0x2f7b09(0x162)]);await this[_0x2f7b09(0x18a)](_0x2f7b09(0x179))['catch'](()=>{}),this[_0x2f7b09(0x1ae)](_0x2f7b09(0x16a));}async[a0_0x286395(0x170)](_0x40b387,_0x42e129,_0x74c929=a0_0x286395(0x19a)){const _0x31921c=a0_0x286395;return this[_0x31921c(0x1ac)]('send_task',{'alias':_0x40b387,'task':_0x42e129,'priority':_0x74c929,'from_session':this[_0x31921c(0x168)]});}async['message'](_0x495312,_0x224d85){const _0x1546e2=a0_0x286395;return this[_0x1546e2(0x1ac)](_0x1546e2(0x157),{'alias':_0x495312,'message':_0x224d85,'from_session':this[_0x1546e2(0x168)]});}async[a0_0x286395(0x161)](_0x35d255,_0x1462e1,_0x1ecf97=a0_0x286395(0x158)){const _0x12eb01=a0_0x286395;return this[_0x12eb01(0x1ac)](_0x12eb01(0x161),{'task_id':_0x35d255,'text':_0x1462e1,'status':_0x1ecf97});}async[a0_0x286395(0x18a)](_0x446d42,_0xdb1ecb){const _0x93bedc=a0_0x286395;return this['call'](_0x93bedc(0x15e),{'resume_id':this[_0x93bedc(0x18c)],'alias':this[_0x93bedc(0x168)],'status':_0x446d42,'server':a0_0x10f18b(),'hostname':a0_0x10f18b(),'agent':this[_0x93bedc(0x17f)],'project_dir':process[_0x93bedc(0x183)](),..._0xdb1ecb});}async[a0_0x286395(0x17a)](){const _0x19e7b6=a0_0x286395;return this[_0x19e7b6(0x1ac)](_0x19e7b6(0x1a4),{});}async[a0_0x286395(0x198)](_0x5d1cc9,_0x2d5bab){const _0x688326=a0_0x286395;return this[_0x688326(0x1ac)](_0x688326(0x198),{'message':_0x5d1cc9,'filter_server':_0x2d5bab?.[_0x688326(0x15b)],'filter_status':_0x2d5bab?.[_0x688326(0x18a)]});}async[a0_0x286395(0x189)](){const _0x43e742=a0_0x286395;let _0x4621e1=encodeURIComponent(this[_0x43e742(0x168)]),_0x2d11b7=this['url']+_0x43e742(0x172)+_0x4621e1,_0x3e4cfe=this[_0x43e742(0x1aa)];while(this['running']){try{this[_0x43e742(0x184)]=new AbortController();let _0x28abf7={'Accept':'text/event-stream'};if(this[_0x43e742(0x178)])_0x28abf7[_0x43e742(0x169)]=_0x43e742(0x19c)+this[_0x43e742(0x178)];let _0x5494bc=await fetch(_0x2d11b7,{'headers':_0x28abf7,'signal':this[_0x43e742(0x184)][_0x43e742(0x193)]});if(!_0x5494bc['ok']||!_0x5494bc[_0x43e742(0x187)]){this[_0x43e742(0x1ae)](_0x43e742(0x17d)+_0x5494bc[_0x43e742(0x18a)]),await this[_0x43e742(0x19d)](_0x3e4cfe),_0x3e4cfe=Math[_0x43e742(0x18b)](_0x3e4cfe*1.5,0xea60);continue;}_0x3e4cfe=this[_0x43e742(0x1aa)];let _0x4844c3=_0x5494bc[_0x43e742(0x187)][_0x43e742(0x190)](),_0x153863=new TextDecoder(),_0x2f49fe='';while(this[_0x43e742(0x163)]){let {done:_0x5e8a62,value:_0x247605}=await _0x4844c3['read']();if(_0x5e8a62)break;_0x2f49fe+=_0x153863[_0x43e742(0x1af)](_0x247605,{'stream':!0x0});let _0x237e27=_0x2f49fe[_0x43e742(0x17e)]('\x0a');_0x2f49fe=_0x237e27[_0x43e742(0x1a9)]()||'';for(let _0x5d78f1 of _0x237e27){if(!_0x5d78f1[_0x43e742(0x19e)]('data:\x20'))continue;try{let _0x2ff822=JSON[_0x43e742(0x176)](_0x5d78f1[_0x43e742(0x1a7)](0x6));if(_0x2ff822[_0x43e742(0x1a5)]===_0x43e742(0x197)){this[_0x43e742(0x1ae)](_0x43e742(0x191)),this[_0x43e742(0x1a2)](_0x43e742(0x197));continue;}if(_0x2ff822[_0x43e742(0x1a5)]===_0x43e742(0x171)||_0x2ff822[_0x43e742(0x1a5)]===_0x43e742(0x199)||_0x2ff822['type']===_0x43e742(0x198))await this[_0x43e742(0x1ab)]();}catch{}}}}catch(_0x32e364){if(_0x32e364['name']===_0x43e742(0x16f))break;this[_0x43e742(0x1a2)](_0x43e742(0x16d),_0x32e364),this[_0x43e742(0x1ae)]('SSE\x20error:\x20'+_0x32e364[_0x43e742(0x165)]);}if(this[_0x43e742(0x163)])this[_0x43e742(0x1a2)](_0x43e742(0x16a)),this[_0x43e742(0x1ae)](_0x43e742(0x18f)+_0x3e4cfe/0x3e8+'s...'),await this[_0x43e742(0x19d)](_0x3e4cfe),_0x3e4cfe=Math[_0x43e742(0x18b)](_0x3e4cfe*1.5,0xea60);}}async[a0_0x286395(0x1ab)](){const _0x51211c=a0_0x286395;try{let _0x4d8337=(await this[_0x51211c(0x1ac)](_0x51211c(0x173),{'alias':this[_0x51211c(0x168)],'limit':0xa}))?.[_0x51211c(0x16e)]||[];for(let _0x552558 of _0x4d8337)await this[_0x51211c(0x1ac)](_0x51211c(0x1ad),{'alias':this['alias'],'message_id':_0x552558['id']}),this[_0x51211c(0x1ae)]('←\x20'+_0x552558['from_session']+':\x20'+_0x552558[_0x51211c(0x1a0)][_0x51211c(0x1a7)](0x0,0x3c)),this['emit']('task',_0x552558),this['emit'](_0x51211c(0x165),_0x552558);}catch(_0x485263){this[_0x51211c(0x1ae)](_0x51211c(0x181)+_0x485263[_0x51211c(0x165)]);}}[a0_0x286395(0x19d)](_0x7913dd){return new Promise(_0x261ae2=>setTimeout(_0x261ae2,_0x7913dd));}}function a0_0x5507(_0x3db737,_0x240981){_0x3db737=_0x3db737-0x157;const _0x344bea=a0_0x344b();let _0x550733=_0x344bea[_0x3db737];return _0x550733;}var $=T;export{$ as default,T as CommHub};
1
+ const a0_0x2630a9=a0_0x18cc;function a0_0x22c5(){const _0xa3afb=['resumeId','body','11OqUdOv','2.0','running','get_all_status','connectSSE','url','send_task','new_message','content','now','read','46501XlsVim','46195CkWGVk','replace','tools/call','disconnect','data:\x20','SSE\x20connected','get_inbox','type','/events/','912bmMXex','normal','SSE\x20failed:\x20','token','result','registered','SSE\x20reconnecting\x20in\x20','call','inbox\x20error:\x20','parse','stringify','cwd','split','message','reconnectDelay','65129eKxhqj','sdk-','1328qZjUrS','text','catch','5520948IOuOdE','alias','connected','log','abort','reply','slice','text/event-stream','getAllStatus','min','s...','status','/mcp','14051244dDGXtz','agent','broadcast','Authorization','server','completed','Bearer\x20','offline','heartbeatTimer','new_task','toTimeString','send','sseAbort','emit','connect','1521831spAmpc','task','9cMQGSN','pop','application/json,\x20text/event-stream','heartbeat\x20failed:\x20','application/json','name','heartbeatInterval','8941870RxjHxN','signal','autoConnect','AbortError','34CyFCpy','POST','SSE\x20error:\x20','toString','getReader','sleep'];a0_0x22c5=function(){return _0xa3afb;};return a0_0x22c5();}(function(_0x154844,_0x343708){const _0x4923ac=a0_0x18cc,_0x78fd45=_0x154844();while(!![]){try{const _0x35cbd5=parseInt(_0x4923ac(0x22f))/0x1*(-parseInt(_0x4923ac(0x203))/0x2)+parseInt(_0x4923ac(0x1f6))/0x3+-parseInt(_0x4923ac(0x234))/0x4+-parseInt(_0x4923ac(0x217))/0x5*(-parseInt(_0x4923ac(0x220))/0x6)+-parseInt(_0x4923ac(0x216))/0x7*(-parseInt(_0x4923ac(0x231))/0x8)+parseInt(_0x4923ac(0x1f8))/0x9*(-parseInt(_0x4923ac(0x1ff))/0xa)+-parseInt(_0x4923ac(0x20b))/0xb*(-parseInt(_0x4923ac(0x241))/0xc);if(_0x35cbd5===_0x343708)break;else _0x78fd45['push'](_0x78fd45['shift']());}catch(_0x40f7c0){_0x78fd45['push'](_0x78fd45['shift']());}}}(a0_0x22c5,0xc434f));import{EventEmitter as a0_0x20a7f4}from'events';function a0_0x18cc(_0x548da2,_0x39305d){_0x548da2=_0x548da2-0x1eb;const _0x22c5b8=a0_0x22c5();let _0x18ccf6=_0x22c5b8[_0x548da2];return _0x18ccf6;}import{hostname as a0_0x1be352}from'os';class T extends a0_0x20a7f4{[a0_0x2630a9(0x210)];[a0_0x2630a9(0x235)];['token'];[a0_0x2630a9(0x242)];[a0_0x2630a9(0x209)];[a0_0x2630a9(0x1fe)];[a0_0x2630a9(0x22e)];['heartbeatTimer'];[a0_0x2630a9(0x1f3)];[a0_0x2630a9(0x20d)]=!0x1;constructor(_0x3d48be){const _0x32a1d2=a0_0x2630a9;super();if(this['url']=_0x3d48be[_0x32a1d2(0x210)][_0x32a1d2(0x218)](/\/$/,''),this[_0x32a1d2(0x235)]=_0x3d48be[_0x32a1d2(0x235)],this['token']=_0x3d48be[_0x32a1d2(0x223)],this[_0x32a1d2(0x242)]=_0x3d48be[_0x32a1d2(0x242)]||'sdk',this['resumeId']=_0x32a1d2(0x230)+_0x3d48be['alias']+'-'+Date[_0x32a1d2(0x214)]()[_0x32a1d2(0x206)](0x24),this[_0x32a1d2(0x1fe)]=_0x3d48be[_0x32a1d2(0x1fe)]??0x2bf20,this[_0x32a1d2(0x22e)]=_0x3d48be[_0x32a1d2(0x22e)]??0xbb8,_0x3d48be[_0x32a1d2(0x201)]!==!0x1)this[_0x32a1d2(0x1f5)]();}[a0_0x2630a9(0x237)](_0x2f90c8){const _0xa32dfe=a0_0x2630a9;console[_0xa32dfe(0x237)]('['+new Date()[_0xa32dfe(0x1f1)]()['slice'](0x0,0x8)+']\x20[commhub:'+this[_0xa32dfe(0x235)]+']\x20'+_0x2f90c8);}async[a0_0x2630a9(0x227)](_0x3d17de,_0x4d591a){const _0x4e3280=a0_0x2630a9;let _0x335cfa={'Content-Type':_0x4e3280(0x1fc),'Accept':_0x4e3280(0x1fa)};if(this['token'])_0x335cfa[_0x4e3280(0x244)]=_0x4e3280(0x1ed)+this[_0x4e3280(0x223)];let _0x2e07ce=await(await fetch(this[_0x4e3280(0x210)]+_0x4e3280(0x240),{'method':_0x4e3280(0x204),'headers':_0x335cfa,'body':JSON[_0x4e3280(0x22a)]({'jsonrpc':_0x4e3280(0x20c),'id':Date['now'](),'method':_0x4e3280(0x219),'params':{'name':_0x3d17de,'arguments':_0x4d591a}})}))[_0x4e3280(0x232)](),_0x2f3507=_0x2e07ce['match'](/data: (.+)/),_0x3266c2=_0x2f3507?JSON[_0x4e3280(0x229)](_0x2f3507[0x1]):JSON[_0x4e3280(0x229)](_0x2e07ce),_0x44d7a9=_0x3266c2?.[_0x4e3280(0x224)]?.['content']?.[0x0]?.[_0x4e3280(0x232)];return _0x44d7a9?JSON[_0x4e3280(0x229)](_0x44d7a9):_0x3266c2;}async[a0_0x2630a9(0x1f5)](){const _0x56b8dd=a0_0x2630a9;if(this[_0x56b8dd(0x20d)])return;this[_0x56b8dd(0x20d)]=!0x0,await this['status']('idle'),this[_0x56b8dd(0x237)](_0x56b8dd(0x225)),this[_0x56b8dd(0x1ef)]=setInterval(()=>{const _0x3cb529=_0x56b8dd;this[_0x3cb529(0x23f)]('idle')[_0x3cb529(0x233)](_0x1529c8=>this[_0x3cb529(0x237)](_0x3cb529(0x1fb)+_0x1529c8[_0x3cb529(0x22d)]));},this[_0x56b8dd(0x1fe)]),this[_0x56b8dd(0x20f)]();}async[a0_0x2630a9(0x21a)](){const _0x509e5b=a0_0x2630a9;if(this[_0x509e5b(0x20d)]=!0x1,this[_0x509e5b(0x1f3)]?.[_0x509e5b(0x238)](),this[_0x509e5b(0x1ef)])clearInterval(this[_0x509e5b(0x1ef)]);await this['status'](_0x509e5b(0x1ee))[_0x509e5b(0x233)](()=>{}),this[_0x509e5b(0x237)]('disconnected');}async[a0_0x2630a9(0x1f2)](_0x5b64d3,_0x598ea7,_0x4a1721=a0_0x2630a9(0x221)){const _0x201a1a=a0_0x2630a9;return this['call'](_0x201a1a(0x211),{'alias':_0x5b64d3,'task':_0x598ea7,'priority':_0x4a1721,'from_session':this['alias']});}async[a0_0x2630a9(0x22d)](_0x11aa12,_0x3b943d){const _0x8b63f1=a0_0x2630a9;return this[_0x8b63f1(0x227)]('send_message',{'alias':_0x11aa12,'message':_0x3b943d,'from_session':this[_0x8b63f1(0x235)]});}async[a0_0x2630a9(0x239)](_0x14afee,_0x52c3c6,_0xdaa83e=a0_0x2630a9(0x1ec)){const _0x37cbfb=a0_0x2630a9;return this[_0x37cbfb(0x227)](_0x37cbfb(0x239),{'task_id':_0x14afee,'text':_0x52c3c6,'status':_0xdaa83e});}async[a0_0x2630a9(0x23f)](_0x4b4f9e,_0x4ec86b){const _0x411cae=a0_0x2630a9;return this[_0x411cae(0x227)]('report_status',{'resume_id':this['resumeId'],'alias':this['alias'],'status':_0x4b4f9e,'server':a0_0x1be352(),'hostname':a0_0x1be352(),'agent':this[_0x411cae(0x242)],'project_dir':process[_0x411cae(0x22b)](),..._0x4ec86b});}async[a0_0x2630a9(0x23c)](){const _0x1969ef=a0_0x2630a9;return this['call'](_0x1969ef(0x20e),{});}async[a0_0x2630a9(0x243)](_0x343e1f,_0x55fd04){const _0x567aaa=a0_0x2630a9;return this['call'](_0x567aaa(0x243),{'message':_0x343e1f,'filter_server':_0x55fd04?.[_0x567aaa(0x1eb)],'filter_status':_0x55fd04?.['status']});}async[a0_0x2630a9(0x20f)](){const _0x2e3890=a0_0x2630a9;let _0x5b332c=encodeURIComponent(this['alias']),_0x529a45=this['url']+_0x2e3890(0x21f)+_0x5b332c,_0x218096=this[_0x2e3890(0x22e)];while(this[_0x2e3890(0x20d)]){try{this[_0x2e3890(0x1f3)]=new AbortController();let _0x1afc2a={'Accept':_0x2e3890(0x23b)};if(this[_0x2e3890(0x223)])_0x1afc2a[_0x2e3890(0x244)]=_0x2e3890(0x1ed)+this[_0x2e3890(0x223)];let _0x46c82f=await fetch(_0x529a45,{'headers':_0x1afc2a,'signal':this['sseAbort'][_0x2e3890(0x200)]});if(!_0x46c82f['ok']||!_0x46c82f[_0x2e3890(0x20a)]){this[_0x2e3890(0x237)](_0x2e3890(0x222)+_0x46c82f['status']),await this['sleep'](_0x218096),_0x218096=Math['min'](_0x218096*1.5,0xea60);continue;}_0x218096=this[_0x2e3890(0x22e)];let _0x407526=_0x46c82f[_0x2e3890(0x20a)][_0x2e3890(0x207)](),_0x41c1fc=new TextDecoder(),_0x2e9126='';while(this[_0x2e3890(0x20d)]){let {done:_0x37447f,value:_0x134061}=await _0x407526[_0x2e3890(0x215)]();if(_0x37447f)break;_0x2e9126+=_0x41c1fc['decode'](_0x134061,{'stream':!0x0});let _0x65da85=_0x2e9126[_0x2e3890(0x22c)]('\x0a');_0x2e9126=_0x65da85[_0x2e3890(0x1f9)]()||'';for(let _0x24ba26 of _0x65da85){if(!_0x24ba26['startsWith'](_0x2e3890(0x21b)))continue;try{let _0x59977a=JSON['parse'](_0x24ba26[_0x2e3890(0x23a)](0x6));if(_0x59977a[_0x2e3890(0x21e)]===_0x2e3890(0x236)){this[_0x2e3890(0x237)](_0x2e3890(0x21c)),this[_0x2e3890(0x1f4)](_0x2e3890(0x236));continue;}if(_0x59977a[_0x2e3890(0x21e)]===_0x2e3890(0x1f0)||_0x59977a['type']===_0x2e3890(0x212)||_0x59977a[_0x2e3890(0x21e)]===_0x2e3890(0x243))await this['processInbox']();}catch{}}}}catch(_0x3fa388){if(_0x3fa388[_0x2e3890(0x1fd)]===_0x2e3890(0x202))break;this[_0x2e3890(0x1f4)]('error',_0x3fa388),this[_0x2e3890(0x237)](_0x2e3890(0x205)+_0x3fa388['message']);}if(this['running'])this[_0x2e3890(0x1f4)]('disconnected'),this[_0x2e3890(0x237)](_0x2e3890(0x226)+_0x218096/0x3e8+_0x2e3890(0x23e)),await this['sleep'](_0x218096),_0x218096=Math[_0x2e3890(0x23d)](_0x218096*1.5,0xea60);}}async['processInbox'](){const _0x1fcf8c=a0_0x2630a9;try{let _0x119414=(await this[_0x1fcf8c(0x227)](_0x1fcf8c(0x21d),{'alias':this[_0x1fcf8c(0x235)],'limit':0xa}))?.['messages']||[];for(let _0x4f881f of _0x119414)await this[_0x1fcf8c(0x227)]('ack_inbox',{'alias':this[_0x1fcf8c(0x235)],'message_id':_0x4f881f['id']}),this[_0x1fcf8c(0x237)]('←\x20'+_0x4f881f['from_session']+':\x20'+_0x4f881f[_0x1fcf8c(0x213)][_0x1fcf8c(0x23a)](0x0,0x3c)),this[_0x1fcf8c(0x1f4)](_0x1fcf8c(0x1f7),_0x4f881f),this[_0x1fcf8c(0x1f4)](_0x1fcf8c(0x22d),_0x4f881f);}catch(_0x1268ea){this[_0x1fcf8c(0x237)](_0x1fcf8c(0x228)+_0x1268ea['message']);}}[a0_0x2630a9(0x208)](_0x208308){return new Promise(_0x43f8a4=>setTimeout(_0x43f8a4,_0x208308));}}var $=T;export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x4957c1=a0_0x36b6;(function(_0x5cfc08,_0x26d444){const _0x544013=a0_0x36b6,_0x4118bd=_0x5cfc08();while(!![]){try{const _0x356a51=-parseInt(_0x544013(0x21b))/0x1+parseInt(_0x544013(0x1d6))/0x2+parseInt(_0x544013(0x1a8))/0x3+parseInt(_0x544013(0x20c))/0x4*(-parseInt(_0x544013(0x1d8))/0x5)+parseInt(_0x544013(0x20a))/0x6+parseInt(_0x544013(0x1fb))/0x7*(parseInt(_0x544013(0x1c1))/0x8)+-parseInt(_0x544013(0x1fd))/0x9*(parseInt(_0x544013(0x1b4))/0xa);if(_0x356a51===_0x26d444)break;else _0x4118bd['push'](_0x4118bd['shift']());}catch(_0x15b9fe){_0x4118bd['push'](_0x4118bd['shift']());}}}(a0_0x34b0,0x67f4b));import{readFileSync as a0_0x28cb05,existsSync as a0_0x3d5593}from'fs';import{join as a0_0x4064a4}from'path';import{hostname as a0_0x4c3551}from'os';import{execSync as a0_0x137dd9}from'child_process';import{Server as a0_0x5255db}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x850b9d}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x42c78f,CallToolRequestSchema as a0_0x5bca13}from'@modelcontextprotocol/sdk/types.js';function p(_0x3aa21d){const _0x1747dc=a0_0x36b6;if(!a0_0x3d5593(_0x3aa21d))return;for(let _0x1f6d9c of a0_0x28cb05(_0x3aa21d,_0x1747dc(0x1c7))['split']('\x0a')){let _0x18b267=_0x1f6d9c[_0x1747dc(0x1c8)]();if(!_0x18b267||_0x18b267[_0x1747dc(0x1e9)]('#'))continue;let _0xf4145b=_0x18b267['indexOf']('=');if(_0xf4145b<0x0)continue;let _0x4a033a=_0x18b267[_0x1747dc(0x221)](0x0,_0xf4145b)[_0x1747dc(0x1c8)](),_0x2df4c3=_0x18b267[_0x1747dc(0x221)](_0xf4145b+0x1)['trim']()[_0x1747dc(0x1a4)](/^["']|["']$/g,'');if(!process.env[_0x4a033a])process.env[_0x4a033a]=_0x2df4c3;}}var C=process.env.HOME||'~',T=a0_0x4064a4(C,a0_0x4957c1(0x1d2));p(a0_0x4064a4(T,'.env'));var L=process[a0_0x4957c1(0x1d0)]()[a0_0x4957c1(0x1a4)](/\//g,'-');p(a0_0x4064a4(T,L,a0_0x4957c1(0x1e1)));function U(){const _0x287058=a0_0x4957c1;try{return a0_0x137dd9(_0x287058(0x207),{'encoding':_0x287058(0x1c7),'timeout':0x7d0})[_0x287058(0x1c8)]();}catch{return'';}}function c(){const _0x347e97=a0_0x4957c1;try{let _0x111b3a=a0_0x4064a4(C,_0x347e97(0x1bf),_0x347e97(0x1b1));if(a0_0x3d5593(_0x111b3a))return JSON['parse'](a0_0x28cb05(_0x111b3a,_0x347e97(0x1c7)));}catch{}return{};}var H=c(),D=process.env.COMMHUB_URL||H['hub']||a0_0x4957c1(0x1c3),f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0x4c3551(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto[a0_0x4957c1(0x206)](),X=process.env.COMMHUB_TOKEN||H[a0_0x4957c1(0x1ac)]||'';function Y(_0x431e37){const _0x318122=a0_0x4957c1;let _0x4a8a2c=new Date()[_0x318122(0x1e0)]()[_0x318122(0x221)](0x0,0x8);process[_0x318122(0x1b0)][_0x318122(0x19f)]('['+_0x4a8a2c+_0x318122(0x216)+_0x431e37+'\x0a');}function a0_0x34b0(){const _0x1aecc0=['statusText','in_progress','startsWith','\x20CWD=','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','none','starting\x20SSE\x20listener...','get','ENV:\x20URL=','connecting\x20to\x20','failed','set','status','alias',':\x20inbox_count=','CommHub\x20init\x20failed:\x20','error','from_session','broadcast','0.3.0','217DneiLb','string','27PmYrGc','high','/mcp','SSE\x20fatal:\x20','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','pop','result','object','tools/call','randomUUID','tmux\x20display-message\x20-p\x20\x27#S\x27','commhub_reply','\x20priority=','4868646cBwaSV','SIGINT','4YNgYhI','SSE\x20error:\x20','Bearer\x20','cancelled','commhub','unknown\x20tool','commhub-channel','task','Progress\x200-100','params',']\x20[commhub]\x20','commhub_send_task','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','Target\x20session\x20alias','setRequestHandler','580858MYYMQr','warning:\x20could\x20not\x20register:\x20','notification','MCP\x20stdio\x20connected','commhub_get_all_status','priority','slice','idle','blocked','content','hub','exit','write','new_message','Authorization','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','application/json,\x20text/event-stream','replace','from','decode','type','1591974IBzcAB','send_message','stringify','\x20from\x20','token','number','catch','Current\x20task\x20description','stderr','config.json','commhub_report_status','ack_inbox','69820GvgDsq','Session\x20alias:\x20','claude-code','parse','\x20ALIAS=','data:\x20','commhub_send_message','replied','Reply\x20text\x20/\x20result\x20summary','←\x20message\x20from\x20','→\x20injected\x20task\x20','.anet','read','21752WWrnTj','report_status','http://127.0.0.1:9200','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','SSE\x20connected\x20as\x20\x22','2.0','utf-8','trim','registered\x20as\x20\x22','connect','working','split','normal','stdin','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','cwd','getReader','.claude/channels/commhub','parse\x20error:\x20','application/json','Message\x20content','77532ALtbrW','Priority\x20(default:\x20normal)','2187735nBTxrP','text','\x22\x20(','completed','message','end','find','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','toTimeString','.env','\x20PROJECT_ENV=','send_reply','...\x20TMUX=','notifications/claude/channel','get_all_status'];a0_0x34b0=function(){return _0x1aecc0;};return a0_0x34b0();}function h(_0x419e0f){return new Promise(_0x524967=>setTimeout(_0x524967,_0x419e0f));}Y(a0_0x4957c1(0x1ef)+D+a0_0x4957c1(0x1b8)+Z+'\x20RESUME_ID='+w[a0_0x4957c1(0x221)](0x0,0x8)+a0_0x4957c1(0x1e4)+(f||a0_0x4957c1(0x1ec))+a0_0x4957c1(0x1ea)+process[a0_0x4957c1(0x1d0)]()+a0_0x4957c1(0x1e2)+L);var k=new Map(),K=new a0_0x5255db({'name':'commhub-channel','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_0x4957c1(0x1cf),a0_0x4957c1(0x201),a0_0x4957c1(0x1b5)+Z]['join']('\x0a')});K[a0_0x4957c1(0x21a)](a0_0x42c78f,async()=>({'tools':[{'name':a0_0x4957c1(0x208),'description':a0_0x4957c1(0x1df),'inputSchema':{'type':a0_0x4957c1(0x204),'properties':{'task_id':{'type':a0_0x4957c1(0x1fc),'description':a0_0x4957c1(0x1c4)},'text':{'type':a0_0x4957c1(0x1fc),'description':a0_0x4957c1(0x1bc)},'status':{'type':a0_0x4957c1(0x1fc),'enum':[a0_0x4957c1(0x1db),a0_0x4957c1(0x1f1),'cancelled','blocked',a0_0x4957c1(0x1f7),a0_0x4957c1(0x1e8)],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':[a0_0x4957c1(0x1d9)]}},{'name':a0_0x4957c1(0x1b2),'description':a0_0x4957c1(0x1eb),'inputSchema':{'type':a0_0x4957c1(0x204),'properties':{'status':{'type':a0_0x4957c1(0x1fc),'enum':[a0_0x4957c1(0x1cb),'idle',a0_0x4957c1(0x223),'error']},'task':{'type':'string','description':a0_0x4957c1(0x1af)},'progress':{'type':a0_0x4957c1(0x1ad),'description':a0_0x4957c1(0x214)}},'required':['status']}},{'name':a0_0x4957c1(0x217),'description':'Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','inputSchema':{'type':a0_0x4957c1(0x204),'properties':{'alias':{'type':a0_0x4957c1(0x1fc),'description':a0_0x4957c1(0x219)},'task':{'type':a0_0x4957c1(0x1fc),'description':'Task\x20content'},'priority':{'type':'string','enum':[a0_0x4957c1(0x1fe),a0_0x4957c1(0x1cd),'low'],'description':a0_0x4957c1(0x1d7)}},'required':[a0_0x4957c1(0x1f4),a0_0x4957c1(0x213)]}},{'name':a0_0x4957c1(0x1ba),'description':a0_0x4957c1(0x1a2),'inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x4957c1(0x1fc),'description':a0_0x4957c1(0x219)},'message':{'type':a0_0x4957c1(0x1fc),'description':a0_0x4957c1(0x1d5)}},'required':[a0_0x4957c1(0x1f4),a0_0x4957c1(0x1dc)]}},{'name':a0_0x4957c1(0x21f),'description':a0_0x4957c1(0x218),'inputSchema':{'type':a0_0x4957c1(0x204),'properties':{}}}]}));async function P(_0x3ef730,_0x3b6c5e){const _0x48c4f5=a0_0x4957c1;let _0x46ae85=await fetch(D+'/mcp',{'method':'POST','headers':{'Content-Type':_0x48c4f5(0x1d4),'Accept':_0x48c4f5(0x1a3),...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x48c4f5(0x1c6),'id':0x1,'method':'initialize','params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x48c4f5(0x212),'version':_0x48c4f5(0x1fa)}}})});if(!_0x46ae85['ok']){let _0x51201d=await _0x46ae85['text']();return Y(_0x48c4f5(0x1f6)+_0x46ae85[_0x48c4f5(0x1f3)]+'\x20'+_0x51201d[_0x48c4f5(0x221)](0x0,0x64)),{'ok':!0x1,'error':'init\x20failed:\x20'+_0x46ae85[_0x48c4f5(0x1f3)]};}await _0x46ae85[_0x48c4f5(0x1d9)]();let _0x5f2f0d=(await(await fetch(D+_0x48c4f5(0x1ff),{'method':'POST','headers':{'Content-Type':_0x48c4f5(0x1d4),'Accept':_0x48c4f5(0x1a3),...X?{'Authorization':_0x48c4f5(0x20e)+X}:{}},'body':JSON[_0x48c4f5(0x1aa)]({'jsonrpc':'2.0','id':0x2,'method':_0x48c4f5(0x205),'params':{'name':_0x3ef730,'arguments':_0x3b6c5e}})}))[_0x48c4f5(0x1d9)]())[_0x48c4f5(0x1cc)]('\x0a')[_0x48c4f5(0x1de)](_0xb529f8=>_0xb529f8[_0x48c4f5(0x1e9)](_0x48c4f5(0x1b9)));if(_0x5f2f0d){let _0x31148d=JSON['parse'](_0x5f2f0d['slice'](0x6));return _0x31148d?.[_0x48c4f5(0x203)]?.[_0x48c4f5(0x19c)]?.[0x0]?.[_0x48c4f5(0x1d9)]?JSON[_0x48c4f5(0x1b7)](_0x31148d['result'][_0x48c4f5(0x19c)][0x0][_0x48c4f5(0x1d9)]):_0x31148d;}return{'ok':!0x1,'error':'no\x20response'};}function a0_0x36b6(_0x2666e8,_0x54aafa){_0x2666e8=_0x2666e8-0x19c;const _0x34b026=a0_0x34b0();let _0x36b6ab=_0x34b026[_0x2666e8];return _0x36b6ab;}K[a0_0x4957c1(0x21a)](a0_0x5bca13,async _0x612858=>{const _0x326213=a0_0x4957c1;let {name:_0x3cdeac,arguments:_0x227cca}=_0x612858[_0x326213(0x215)];if(_0x3cdeac===_0x326213(0x208)){let {task_id:_0xf25d4e,text:_0x2db8a5,status:_0x4660c3}=_0x227cca;if(_0x4660c3==='completed'||_0x4660c3===_0x326213(0x1f1)||_0x4660c3===_0x326213(0x20f)){let _0x16537d=_0x4660c3===_0x326213(0x1db)?_0x326213(0x1bb):_0x4660c3,_0x2842ac=_0xf25d4e?k[_0x326213(0x1ee)](_0xf25d4e)||_0x326213(0x19d):_0x326213(0x19d),_0x4a5dfd=await P(_0x326213(0x1e3),{'alias':_0x2842ac,'text':_0x2db8a5,'in_reply_to':_0xf25d4e||void 0x0,'status':_0x16537d,'from_session':Z});if(_0xf25d4e)k['delete'](_0xf25d4e);return{'content':[{'type':_0x326213(0x1d9),'text':JSON[_0x326213(0x1aa)](_0x4a5dfd)}]};}let _0xc3d2a2=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x4660c3===_0x326213(0x223)?_0x326213(0x223):_0x4660c3==='error'?_0x326213(0x1f7):'working','task':_0x2db8a5[_0x326213(0x221)](0x0,0xc8),'output':_0x2db8a5});return{'content':[{'type':_0x326213(0x1d9),'text':JSON[_0x326213(0x1aa)](_0xc3d2a2)}]};}if(_0x3cdeac==='commhub_report_status'){let {status:_0x33cbbd,task:_0x11c979,progress:_0x2b4ad1}=_0x227cca,_0x36329f=await P(_0x326213(0x1c2),{'resume_id':w,'alias':Z,'status':_0x33cbbd,'task':_0x11c979,'progress':_0x2b4ad1});return{'content':[{'type':_0x326213(0x1d9),'text':JSON['stringify'](_0x36329f)}]};}if(_0x3cdeac==='commhub_send_task'){let {alias:_0xa357dd,task:_0x2545e4,priority:_0x251be8}=_0x227cca,_0x260203=await P('send_task',{'alias':_0xa357dd,'task':_0x2545e4,'priority':_0x251be8||'normal','from_session':Z});return{'content':[{'type':_0x326213(0x1d9),'text':JSON['stringify'](_0x260203)}]};}if(_0x3cdeac==='commhub_send_message'){let {alias:_0xdb2727,message:_0x1f6de4}=_0x227cca,_0x362113=await P(_0x326213(0x1a9),{'alias':_0xdb2727,'message':_0x1f6de4,'from_session':Z});return{'content':[{'type':_0x326213(0x1d9),'text':JSON['stringify'](_0x362113)}]};}if(_0x3cdeac===_0x326213(0x21f)){let _0x2323bc=await P(_0x326213(0x1e6),{});return{'content':[{'type':'text','text':JSON[_0x326213(0x1aa)](_0x2323bc)}]};}return{'content':[{'type':_0x326213(0x1d9),'text':JSON[_0x326213(0x1aa)]({'error':_0x326213(0x211)})}]};});async function v(){const _0x5f1877=a0_0x4957c1;let _0x53679d=D+'/events/'+encodeURIComponent(Z),_0x236bf8={};if(X)_0x236bf8[_0x5f1877(0x1a1)]=_0x5f1877(0x20e)+X;Y(_0x5f1877(0x1f0)+_0x53679d);while(!0x0){try{let _0x4f494e=await fetch(_0x53679d,{'headers':_0x236bf8});if(!_0x4f494e['ok']){Y(_0x5f1877(0x20d)+_0x4f494e[_0x5f1877(0x1f3)]+'\x20'+_0x4f494e[_0x5f1877(0x1e7)]),await h(0x1388);continue;}let _0x451689=_0x4f494e['body'][_0x5f1877(0x1d1)](),_0x1824b6=new TextDecoder(),_0x3271d2='';while(!0x0){let {done:_0x453d70,value:_0x1329a3}=await _0x451689[_0x5f1877(0x1c0)]();if(_0x453d70)break;_0x3271d2+=_0x1824b6[_0x5f1877(0x1a6)](_0x1329a3,{'stream':!0x0});let _0x370482=_0x3271d2['split']('\x0a\x0a');_0x3271d2=_0x370482[_0x5f1877(0x202)]()||'';for(let _0x438c3f of _0x370482){let _0x3e0b83=_0x438c3f[_0x5f1877(0x1cc)]('\x0a')[_0x5f1877(0x1de)](_0x1a9851=>_0x1a9851[_0x5f1877(0x1e9)](_0x5f1877(0x1b9)));if(!_0x3e0b83)continue;try{let _0x5600c6=JSON[_0x5f1877(0x1b7)](_0x3e0b83[_0x5f1877(0x221)](0x6));await u(_0x5600c6);}catch(_0x48fcf3){Y(_0x5f1877(0x1d3)+_0x48fcf3);}}}Y('SSE\x20stream\x20ended,\x20reconnecting...');}catch(_0x4a17ac){Y('SSE\x20connection\x20error:\x20'+_0x4a17ac);}await h(0xbb8);}}async function u(_0x33d2cb){const _0x516fdf=a0_0x4957c1;if(_0x33d2cb[_0x516fdf(0x1a7)]==='connected'){Y(_0x516fdf(0x1c5)+Z+'\x22');return;}if(_0x33d2cb[_0x516fdf(0x1a7)]===_0x516fdf(0x1a0)){if(Y(_0x516fdf(0x1bd)+_0x33d2cb['from']+':\x20'+_0x33d2cb[_0x516fdf(0x1dc)]['slice'](0x0,0x3c)),await K[_0x516fdf(0x21d)]({'method':_0x516fdf(0x1e5),'params':{'content':_0x33d2cb['message'],'meta':{'sender':_0x33d2cb['from']||'hub','sender_id':_0x516fdf(0x210),'user':_0x33d2cb[_0x516fdf(0x1a5)]||_0x516fdf(0x19d),'priority':_0x516fdf(0x1cd)}}}),_0x33d2cb['message_id'])await P(_0x516fdf(0x1b3),{'alias':Z,'message_id':_0x33d2cb['message_id']});return;}if(_0x33d2cb[_0x516fdf(0x1a7)]==='new_task'||_0x33d2cb[_0x516fdf(0x1a7)]===_0x516fdf(0x1f9)){Y('←\x20'+_0x33d2cb[_0x516fdf(0x1a7)]+_0x516fdf(0x1f5)+_0x33d2cb['inbox_count']+_0x516fdf(0x209)+(_0x33d2cb[_0x516fdf(0x220)]||_0x516fdf(0x1cd)));let _0x1cb3e7=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0x1cb3e7?.['ok']&&_0x1cb3e7['messages']?.['length']>0x0)for(let _0x346302 of _0x1cb3e7['messages']){let _0x5d3bee={'sender':_0x346302['from_session']||_0x516fdf(0x19d),'sender_id':'commhub','user':_0x346302[_0x516fdf(0x1f8)]||_0x516fdf(0x19d),'task_id':_0x346302['id'],'priority':_0x346302[_0x516fdf(0x220)]||_0x516fdf(0x1cd)};k[_0x516fdf(0x1f2)](_0x346302['id'],_0x346302[_0x516fdf(0x1f8)]||_0x516fdf(0x19d)),await K[_0x516fdf(0x21d)]({'method':_0x516fdf(0x1e5),'params':{'content':_0x346302[_0x516fdf(0x19c)],'meta':_0x5d3bee}}),Y(_0x516fdf(0x1be)+_0x346302['id'][_0x516fdf(0x221)](0x0,0x8)+_0x516fdf(0x1ab)+_0x346302[_0x516fdf(0x1f8)]+':\x20'+_0x346302[_0x516fdf(0x19c)]['slice'](0x0,0x3c)),await P('ack_inbox',{'alias':Z,'message_id':_0x346302['id']});}}}async function S(){const _0x5c3ce0=a0_0x4957c1;let _0x51b854=new a0_0x850b9d();await K[_0x5c3ce0(0x1ca)](_0x51b854),Y(_0x5c3ce0(0x21e)),Y(_0x5c3ce0(0x1ed)),v()['catch'](_0x2983ee=>Y(_0x5c3ce0(0x200)+_0x2983ee)),P(_0x5c3ce0(0x1c2),{'resume_id':w,'alias':Z,'status':_0x5c3ce0(0x222),'server':a0_0x4c3551(),'hostname':a0_0x4c3551(),'agent':_0x5c3ce0(0x1b6),'project_dir':process['cwd'](),'tmux_name':f||void 0x0})['then'](()=>Y(_0x5c3ce0(0x1c9)+Z+_0x5c3ce0(0x1da)+w[_0x5c3ce0(0x221)](0x0,0x8)+')'))[_0x5c3ce0(0x1ae)](_0x3a969d=>Y(_0x5c3ce0(0x21c)+_0x3a969d)),setInterval(()=>{const _0x18a330=_0x5c3ce0;P(_0x18a330(0x1c2),{'resume_id':w,'alias':Z,'status':_0x18a330(0x222),'server':a0_0x4c3551(),'hostname':a0_0x4c3551(),'agent':'claude-code','project_dir':process[_0x18a330(0x1d0)](),'tmux_name':f||void 0x0})['catch'](_0x1f9088=>Y('heartbeat\x20failed:\x20'+_0x1f9088));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}S()[a0_0x4957c1(0x1ae)](_0x26372f=>{Y('fatal:\x20'+_0x26372f),process['exit'](0x1);});async function N(){const _0x44db85=a0_0x4957c1;Y('shutting\x20down,\x20reporting\x20offline...'),await P('report_status',{'resume_id':w,'alias':Z,'status':_0x44db85(0x1f7),'task':'session\x20disconnected'})[_0x44db85(0x1ae)](()=>{}),process[_0x44db85(0x19e)](0x0);}process[a0_0x4957c1(0x1ce)]['on'](a0_0x4957c1(0x1dd),()=>N()),process['on']('SIGTERM',()=>N()),process['on'](a0_0x4957c1(0x20b),()=>N());
2
+ function a0_0x380a(){const _0x3e75bc=['36MlRZMV','cancelled','message','application/json,\x20text/event-stream','find','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','no\x20response','commhub_send_task','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','pop',':\x20inbox_count=','status','failed','slice','.env','SSE\x20connected\x20as\x20\x22','number','replace','Reply\x20text\x20/\x20result\x20summary','blocked','broadcast','split','←\x20message\x20from\x20','replied','in_progress','send_task','unknown\x20tool','hub','config.json','stringify','session\x20disconnected','indexOf','1537833LIhzQU','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','task','utf-8','type','heartbeat\x20failed:\x20','new_message','send_reply','ack_inbox','send_message','messages','join','fatal:\x20','\x20priority=','catch','working','length','message_id','Target\x20session\x20alias','.anet','MCP\x20stdio\x20connected','string','notification','Bearer\x20','POST','http://127.0.0.1:9200','get','commhub_reply','error','new_task','SSE\x20fatal:\x20','startsWith','result','get_all_status','idle','completed','getReader','/mcp','32ospNpH','data:\x20','stdin','\x20from\x20','commhub_send_message','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','from','claude-code','cwd','shutting\x20down,\x20reporting\x20offline...','report_status','priority','from_session','2.0','initialize','commhub-channel','low','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','text','init\x20failed:\x20','\x22\x20(','/events/','setRequestHandler','5211dIVUBw','high','2025-03-26','end','SSE\x20stream\x20ended,\x20reconnecting...','→\x20injected\x20task\x20','token','ready\x20—\x20waiting\x20for\x20events','\x20CWD=','object','3689735WTsjNS','tools/call','then','get_inbox','connect','1616832KzyIpE','trim','notifications/claude/channel','inbox_count','commhub_get_all_status','registered\x20as\x20\x22','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','Session\x20alias:\x20','Priority\x20(default:\x20normal)','144cXKerl','2233GajMay','SSE\x20error:\x20','6699760xXOrsE','commhub','178qbSVQA','parse','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','starting\x20SSE\x20listener...','Progress\x200-100','body','commhub_report_status','content','normal','9369lTUWbX','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','\x20RESUME_ID=','15294xTPBYE'];a0_0x380a=function(){return _0x3e75bc;};return a0_0x380a();}const a0_0x662eba=a0_0x2ad0;(function(_0x3c8205,_0xb34067){const _0x193798=a0_0x2ad0,_0x377129=_0x3c8205();while(!![]){try{const _0x5e333b=-parseInt(_0x193798(0x23c))/0x1*(-parseInt(_0x193798(0x259))/0x2)+parseInt(_0x193798(0x1db))/0x3*(parseInt(_0x193798(0x1df))/0x4)+parseInt(_0x193798(0x246))/0x5+parseInt(_0x193798(0x1de))/0x6*(parseInt(_0x193798(0x255))/0x7)+-parseInt(_0x193798(0x225))/0x8*(-parseInt(_0x193798(0x24b))/0x9)+-parseInt(_0x193798(0x257))/0xa+parseInt(_0x193798(0x1ff))/0xb*(-parseInt(_0x193798(0x254))/0xc);if(_0x5e333b===_0xb34067)break;else _0x377129['push'](_0x377129['shift']());}catch(_0xa2a0cb){_0x377129['push'](_0x377129['shift']());}}}(a0_0x380a,0x650f8));import{readFileSync as a0_0xbb5b7,existsSync as a0_0x140c4b}from'fs';import{join as a0_0x1516f9}from'path';import{hostname as a0_0x584493}from'os';import{execSync as a0_0x36b5cf}from'child_process';import{Server as a0_0x15d5b7}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x5397f0}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x52eddb,CallToolRequestSchema as a0_0x578a26}from'@modelcontextprotocol/sdk/types.js';function p(_0x467110){const _0x463a79=a0_0x2ad0;if(!a0_0x140c4b(_0x467110))return;for(let _0x50cf14 of a0_0xbb5b7(_0x467110,_0x463a79(0x202))[_0x463a79(0x1f4)]('\x0a')){let _0x3b01db=_0x50cf14[_0x463a79(0x24c)]();if(!_0x3b01db||_0x3b01db['startsWith']('#'))continue;let _0x33c00c=_0x3b01db[_0x463a79(0x1fe)]('=');if(_0x33c00c<0x0)continue;let _0x377d3b=_0x3b01db[_0x463a79(0x1ec)](0x0,_0x33c00c)[_0x463a79(0x24c)](),_0x2048d3=_0x3b01db[_0x463a79(0x1ec)](_0x33c00c+0x1)[_0x463a79(0x24c)]()[_0x463a79(0x1f0)](/^["']|["']$/g,'');if(!process.env[_0x377d3b])process.env[_0x377d3b]=_0x2048d3;}}var C=process.env.HOME||'~',T=a0_0x1516f9(C,'.claude/channels/commhub');p(a0_0x1516f9(T,a0_0x662eba(0x1ed)));function a0_0x2ad0(_0x39a1fb,_0x421fbe){_0x39a1fb=_0x39a1fb-0x1d8;const _0x380aaa=a0_0x380a();let _0x2ad0e8=_0x380aaa[_0x39a1fb];return _0x2ad0e8;}var L=process[a0_0x662eba(0x22d)]()['replace'](/\//g,'-');p(a0_0x1516f9(T,L,a0_0x662eba(0x1ed)));function U(){const _0x4e3db6=a0_0x662eba;try{return a0_0x36b5cf('tmux\x20display-message\x20-p\x20\x27#S\x27',{'encoding':_0x4e3db6(0x202),'timeout':0x7d0})[_0x4e3db6(0x24c)]();}catch{return'';}}function c(){const _0x14bfa1=a0_0x662eba;try{let _0x4c74e4=a0_0x1516f9(C,_0x14bfa1(0x212),_0x14bfa1(0x1fb));if(a0_0x140c4b(_0x4c74e4))return JSON['parse'](a0_0xbb5b7(_0x4c74e4,_0x14bfa1(0x202)));}catch{}return{};}var H=c(),D=process.env.COMMHUB_URL||H[a0_0x662eba(0x1fa)]||a0_0x662eba(0x218),f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0x584493(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto['randomUUID'](),X=process.env.COMMHUB_TOKEN||H[a0_0x662eba(0x242)]||'';function Y(_0x3956e3){const _0x17f0a3=a0_0x662eba;let _0x36b965=new Date()['toTimeString']()[_0x17f0a3(0x1ec)](0x0,0x8);process['stderr']['write']('['+_0x36b965+']\x20[commhub]\x20'+_0x3956e3+'\x0a');}function h(_0x16eb01){return new Promise(_0x1dcd78=>setTimeout(_0x1dcd78,_0x16eb01));}Y('ENV:\x20URL='+D+'\x20ALIAS='+Z+a0_0x662eba(0x1dd)+w[a0_0x662eba(0x1ec)](0x0,0x8)+'...\x20TMUX='+(f||'none')+a0_0x662eba(0x244)+process[a0_0x662eba(0x22d)]()+'\x20PROJECT_ENV='+L);var k=new Map(),K=new a0_0x15d5b7({'name':a0_0x662eba(0x234),'version':'0.3.0'},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x662eba(0x22a),'These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.',a0_0x662eba(0x200),a0_0x662eba(0x25b),a0_0x662eba(0x252)+Z][a0_0x662eba(0x20a)]('\x0a')});K[a0_0x662eba(0x23b)](a0_0x52eddb,async()=>({'tools':[{'name':a0_0x662eba(0x21a),'description':a0_0x662eba(0x1e4),'inputSchema':{'type':'object','properties':{'task_id':{'type':a0_0x662eba(0x214),'description':a0_0x662eba(0x236)},'text':{'type':'string','description':a0_0x662eba(0x1f1)},'status':{'type':'string','enum':[a0_0x662eba(0x222),a0_0x662eba(0x1eb),a0_0x662eba(0x1e0),a0_0x662eba(0x1f2),a0_0x662eba(0x21b),a0_0x662eba(0x1f7)],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':['text']}},{'name':a0_0x662eba(0x1d8),'description':a0_0x662eba(0x251),'inputSchema':{'type':a0_0x662eba(0x245),'properties':{'status':{'type':a0_0x662eba(0x214),'enum':[a0_0x662eba(0x20e),'idle','blocked',a0_0x662eba(0x21b)]},'task':{'type':a0_0x662eba(0x214),'description':'Current\x20task\x20description'},'progress':{'type':a0_0x662eba(0x1ef),'description':a0_0x662eba(0x25d)}},'required':[a0_0x662eba(0x1ea)]}},{'name':a0_0x662eba(0x1e6),'description':'Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x662eba(0x214),'description':'Target\x20session\x20alias'},'task':{'type':a0_0x662eba(0x214),'description':'Task\x20content'},'priority':{'type':'string','enum':[a0_0x662eba(0x23d),a0_0x662eba(0x1da),a0_0x662eba(0x235)],'description':a0_0x662eba(0x253)}},'required':['alias',a0_0x662eba(0x201)]}},{'name':a0_0x662eba(0x229),'description':a0_0x662eba(0x1dc),'inputSchema':{'type':a0_0x662eba(0x245),'properties':{'alias':{'type':a0_0x662eba(0x214),'description':a0_0x662eba(0x211)},'message':{'type':'string','description':'Message\x20content'}},'required':['alias','message']}},{'name':a0_0x662eba(0x24f),'description':a0_0x662eba(0x1e7),'inputSchema':{'type':a0_0x662eba(0x245),'properties':{}}}]}));async function P(_0x33190f,_0x27364f){const _0xad1ffd=a0_0x662eba;let _0xe871f4=await fetch(D+'/mcp',{'method':_0xad1ffd(0x217),'headers':{'Content-Type':'application/json','Accept':_0xad1ffd(0x1e2),...X?{'Authorization':_0xad1ffd(0x216)+X}:{}},'body':JSON[_0xad1ffd(0x1fc)]({'jsonrpc':_0xad1ffd(0x232),'id':0x1,'method':_0xad1ffd(0x233),'params':{'protocolVersion':_0xad1ffd(0x23e),'capabilities':{},'clientInfo':{'name':_0xad1ffd(0x234),'version':'0.3.0'}}})});if(!_0xe871f4['ok']){let _0x248afd=await _0xe871f4[_0xad1ffd(0x237)]();return Y('CommHub\x20init\x20failed:\x20'+_0xe871f4[_0xad1ffd(0x1ea)]+'\x20'+_0x248afd[_0xad1ffd(0x1ec)](0x0,0x64)),{'ok':!0x1,'error':_0xad1ffd(0x238)+_0xe871f4[_0xad1ffd(0x1ea)]};}await _0xe871f4[_0xad1ffd(0x237)]();let _0x4aa628=(await(await fetch(D+_0xad1ffd(0x224),{'method':'POST','headers':{'Content-Type':'application/json','Accept':_0xad1ffd(0x1e2),...X?{'Authorization':_0xad1ffd(0x216)+X}:{}},'body':JSON['stringify']({'jsonrpc':_0xad1ffd(0x232),'id':0x2,'method':_0xad1ffd(0x247),'params':{'name':_0x33190f,'arguments':_0x27364f}})}))[_0xad1ffd(0x237)]())[_0xad1ffd(0x1f4)]('\x0a')['find'](_0xe2eb3d=>_0xe2eb3d[_0xad1ffd(0x21e)]('data:\x20'));if(_0x4aa628){let _0x5d3fc1=JSON[_0xad1ffd(0x25a)](_0x4aa628[_0xad1ffd(0x1ec)](0x6));return _0x5d3fc1?.[_0xad1ffd(0x21f)]?.[_0xad1ffd(0x1d9)]?.[0x0]?.[_0xad1ffd(0x237)]?JSON['parse'](_0x5d3fc1[_0xad1ffd(0x21f)][_0xad1ffd(0x1d9)][0x0]['text']):_0x5d3fc1;}return{'ok':!0x1,'error':_0xad1ffd(0x1e5)};}K[a0_0x662eba(0x23b)](a0_0x578a26,async _0x34b487=>{const _0x8337af=a0_0x662eba;let {name:_0x39cf87,arguments:_0x3fc3d1}=_0x34b487['params'];if(_0x39cf87===_0x8337af(0x21a)){let {task_id:_0x5630e7,text:_0x537946,status:_0x1cb157}=_0x3fc3d1;if(_0x1cb157===_0x8337af(0x222)||_0x1cb157===_0x8337af(0x1eb)||_0x1cb157==='cancelled'){let _0x3dccda=_0x1cb157===_0x8337af(0x222)?_0x8337af(0x1f6):_0x1cb157,_0x260dcf=_0x5630e7?k[_0x8337af(0x219)](_0x5630e7)||'hub':_0x8337af(0x1fa),_0x5e9f62=await P(_0x8337af(0x206),{'alias':_0x260dcf,'text':_0x537946,'in_reply_to':_0x5630e7||void 0x0,'status':_0x3dccda,'from_session':Z});if(_0x5630e7)k['delete'](_0x5630e7);return{'content':[{'type':_0x8337af(0x237),'text':JSON[_0x8337af(0x1fc)](_0x5e9f62)}]};}let _0x4a2012=await P(_0x8337af(0x22f),{'resume_id':w,'alias':Z,'status':_0x1cb157===_0x8337af(0x1f2)?_0x8337af(0x1f2):_0x1cb157===_0x8337af(0x21b)?_0x8337af(0x21b):_0x8337af(0x20e),'task':_0x537946[_0x8337af(0x1ec)](0x0,0xc8),'output':_0x537946});return{'content':[{'type':_0x8337af(0x237),'text':JSON[_0x8337af(0x1fc)](_0x4a2012)}]};}if(_0x39cf87===_0x8337af(0x1d8)){let {status:_0x6b9336,task:_0x4e9f8c,progress:_0x53fdc7}=_0x3fc3d1,_0x4a2b50=await P(_0x8337af(0x22f),{'resume_id':w,'alias':Z,'status':_0x6b9336,'task':_0x4e9f8c,'progress':_0x53fdc7});return{'content':[{'type':'text','text':JSON[_0x8337af(0x1fc)](_0x4a2b50)}]};}if(_0x39cf87===_0x8337af(0x1e6)){let {alias:_0x3a1c21,task:_0x12c82e,priority:_0x14d5ca}=_0x3fc3d1,_0x42b810=await P(_0x8337af(0x1f8),{'alias':_0x3a1c21,'task':_0x12c82e,'priority':_0x14d5ca||_0x8337af(0x1da),'from_session':Z});return{'content':[{'type':_0x8337af(0x237),'text':JSON[_0x8337af(0x1fc)](_0x42b810)}]};}if(_0x39cf87===_0x8337af(0x229)){let {alias:_0x570484,message:_0xd8ba89}=_0x3fc3d1,_0x514402=await P(_0x8337af(0x208),{'alias':_0x570484,'message':_0xd8ba89,'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x8337af(0x1fc)](_0x514402)}]};}if(_0x39cf87===_0x8337af(0x24f)){let _0x1d2d9b=await P(_0x8337af(0x220),{});return{'content':[{'type':_0x8337af(0x237),'text':JSON[_0x8337af(0x1fc)](_0x1d2d9b)}]};}return{'content':[{'type':_0x8337af(0x237),'text':JSON[_0x8337af(0x1fc)]({'error':_0x8337af(0x1f9)})}]};});async function v(){const _0x150379=a0_0x662eba;let _0x2a74c3=D+_0x150379(0x23a)+encodeURIComponent(Z),_0x290f9a={};if(X)_0x290f9a['Authorization']=_0x150379(0x216)+X;Y('connecting\x20to\x20'+_0x2a74c3);while(!0x0){try{let _0x55c17a=await fetch(_0x2a74c3,{'headers':_0x290f9a});if(!_0x55c17a['ok']){Y(_0x150379(0x256)+_0x55c17a[_0x150379(0x1ea)]+'\x20'+_0x55c17a['statusText']),await h(0x1388);continue;}let _0x5b2d37=_0x55c17a[_0x150379(0x25e)][_0x150379(0x223)](),_0x4e13e7=new TextDecoder(),_0x4f9314='';while(!0x0){let {done:_0x56336c,value:_0x57b68e}=await _0x5b2d37['read']();if(_0x56336c)break;_0x4f9314+=_0x4e13e7['decode'](_0x57b68e,{'stream':!0x0});let _0x1ed35f=_0x4f9314[_0x150379(0x1f4)]('\x0a\x0a');_0x4f9314=_0x1ed35f[_0x150379(0x1e8)]()||'';for(let _0x315a92 of _0x1ed35f){let _0x2c0b91=_0x315a92[_0x150379(0x1f4)]('\x0a')[_0x150379(0x1e3)](_0x35aa8e=>_0x35aa8e[_0x150379(0x21e)](_0x150379(0x226)));if(!_0x2c0b91)continue;try{let _0x5d426b=JSON[_0x150379(0x25a)](_0x2c0b91['slice'](0x6));await u(_0x5d426b);}catch(_0x3abcec){Y('parse\x20error:\x20'+_0x3abcec);}}}Y(_0x150379(0x240));}catch(_0x1fdd3f){Y('SSE\x20connection\x20error:\x20'+_0x1fdd3f);}await h(0xbb8);}}async function u(_0x1d4114){const _0x53f948=a0_0x662eba;if(_0x1d4114[_0x53f948(0x203)]==='connected'){Y(_0x53f948(0x1ee)+Z+'\x22');return;}if(_0x1d4114[_0x53f948(0x203)]===_0x53f948(0x205)){if(Y(_0x53f948(0x1f5)+_0x1d4114[_0x53f948(0x22b)]+':\x20'+_0x1d4114[_0x53f948(0x1e1)][_0x53f948(0x1ec)](0x0,0x3c)),await K[_0x53f948(0x215)]({'method':_0x53f948(0x24d),'params':{'content':_0x1d4114[_0x53f948(0x1e1)],'meta':{'sender':_0x1d4114['from']||'hub','sender_id':_0x53f948(0x258),'user':_0x1d4114[_0x53f948(0x22b)]||_0x53f948(0x1fa),'priority':_0x53f948(0x1da)}}}),_0x1d4114[_0x53f948(0x210)])await P(_0x53f948(0x207),{'alias':Z,'message_id':_0x1d4114[_0x53f948(0x210)]});return;}if(_0x1d4114[_0x53f948(0x203)]===_0x53f948(0x21c)||_0x1d4114[_0x53f948(0x203)]===_0x53f948(0x1f3)){Y('←\x20'+_0x1d4114[_0x53f948(0x203)]+_0x53f948(0x1e9)+_0x1d4114[_0x53f948(0x24e)]+_0x53f948(0x20c)+(_0x1d4114[_0x53f948(0x230)]||_0x53f948(0x1da)));let _0x2566a0=await P(_0x53f948(0x249),{'alias':Z,'limit':0x5});if(_0x2566a0?.['ok']&&_0x2566a0[_0x53f948(0x209)]?.[_0x53f948(0x20f)]>0x0)for(let _0x1af7eb of _0x2566a0[_0x53f948(0x209)]){let _0x4011a3={'sender':_0x1af7eb[_0x53f948(0x231)]||'hub','sender_id':_0x53f948(0x258),'user':_0x1af7eb[_0x53f948(0x231)]||_0x53f948(0x1fa),'task_id':_0x1af7eb['id'],'priority':_0x1af7eb[_0x53f948(0x230)]||_0x53f948(0x1da)};k['set'](_0x1af7eb['id'],_0x1af7eb[_0x53f948(0x231)]||_0x53f948(0x1fa)),await K[_0x53f948(0x215)]({'method':_0x53f948(0x24d),'params':{'content':_0x1af7eb[_0x53f948(0x1d9)],'meta':_0x4011a3}}),Y(_0x53f948(0x241)+_0x1af7eb['id'][_0x53f948(0x1ec)](0x0,0x8)+_0x53f948(0x228)+_0x1af7eb[_0x53f948(0x231)]+':\x20'+_0x1af7eb['content'][_0x53f948(0x1ec)](0x0,0x3c)),await P(_0x53f948(0x207),{'alias':Z,'message_id':_0x1af7eb['id']});}}}async function S(){const _0x4636aa=a0_0x662eba;let _0x125e90=new a0_0x5397f0();await K[_0x4636aa(0x24a)](_0x125e90),Y(_0x4636aa(0x213)),Y(_0x4636aa(0x25c)),v()[_0x4636aa(0x20d)](_0x538d0b=>Y(_0x4636aa(0x21d)+_0x538d0b)),P('report_status',{'resume_id':w,'alias':Z,'status':_0x4636aa(0x221),'server':a0_0x584493(),'hostname':a0_0x584493(),'agent':_0x4636aa(0x22c),'project_dir':process[_0x4636aa(0x22d)](),'tmux_name':f||void 0x0})[_0x4636aa(0x248)](()=>Y(_0x4636aa(0x250)+Z+_0x4636aa(0x239)+w['slice'](0x0,0x8)+')'))[_0x4636aa(0x20d)](_0x24ba88=>Y('warning:\x20could\x20not\x20register:\x20'+_0x24ba88)),setInterval(()=>{const _0xafede5=_0x4636aa;P('report_status',{'resume_id':w,'alias':Z,'status':_0xafede5(0x221),'server':a0_0x584493(),'hostname':a0_0x584493(),'agent':_0xafede5(0x22c),'project_dir':process[_0xafede5(0x22d)](),'tmux_name':f||void 0x0})[_0xafede5(0x20d)](_0x4563b8=>Y(_0xafede5(0x204)+_0x4563b8));},0x2bf20),Y(_0x4636aa(0x243));}S()[a0_0x662eba(0x20d)](_0x615934=>{const _0x385190=a0_0x662eba;Y(_0x385190(0x20b)+_0x615934),process['exit'](0x1);});async function N(){const _0x5b295e=a0_0x662eba;Y(_0x5b295e(0x22e)),await P(_0x5b295e(0x22f),{'resume_id':w,'alias':Z,'status':_0x5b295e(0x21b),'task':_0x5b295e(0x1fd)})[_0x5b295e(0x20d)](()=>{}),process['exit'](0x0);}process[a0_0x662eba(0x227)]['on'](a0_0x662eba(0x23f),()=>N()),process['on']('SIGTERM',()=>N()),process['on']('SIGINT',()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.0.0-preview.3",
3
+ "version": "2.0.0-preview.4",
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",