@sleep2agi/agent-network 2.2.5-preview.0 → 2.2.5

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_0x512cac=a0_0x3432;function a0_0x47e5(){const _0x703142=['SSE\x20failed:\x20','get_inbox','content','reply','sdk','s...','data:\x20','catch','alias','getAllStatus','registered','processInbox','SSE\x20error:\x20','Authorization','toString','decode','connect','4710cMVhUI','send','sseAbort','emit','2334QrcplR','339117kttfcJ','tools/call','SSE\x20reconnecting\x20in\x20','577676gPxqnJ','heartbeatTimer','application/json','disconnected','ack_inbox','broadcast','pop','url','status','autoConnect','sleep','normal','offline','send_task','stringify','slice','messages','3168298GRMQcz','type','call','now','reconnectDelay','heartbeat\x20failed:\x20','288pbpWpG','report_status','connected','server','signal','completed','match','2916198tosdPm','agent','split','new_message','3084irGtFi','cwd','idle','body','SSE\x20connected','result','2.0','message','abort','heartbeatInterval','connectSSE','token','running','Bearer\x20','get_all_status','POST','from_session','log','130tnDRIW','read','task','toTimeString','resumeId','1140020yNzYhb','/mcp','min','parse','16fCaMtx'];a0_0x47e5=function(){return _0x703142;};return a0_0x47e5();}function a0_0x3432(_0x46cec0,_0x418e9e){_0x46cec0=_0x46cec0-0xfe;const _0x47e56c=a0_0x47e5();let _0x343229=_0x47e56c[_0x46cec0];return _0x343229;}(function(_0x4ae312,_0x21674d){const _0xe32c64=a0_0x3432,_0x580801=_0x4ae312();while(!![]){try{const _0x14430c=parseInt(_0xe32c64(0x151))/0x1*(parseInt(_0xe32c64(0x136))/0x2)+parseInt(_0xe32c64(0x137))/0x3+parseInt(_0xe32c64(0x11c))/0x4+parseInt(_0xe32c64(0x132))/0x5*(parseInt(_0xe32c64(0x105))/0x6)+parseInt(_0xe32c64(0x14b))/0x7+parseInt(_0xe32c64(0x120))/0x8*(-parseInt(_0xe32c64(0x101))/0x9)+parseInt(_0xe32c64(0x117))/0xa*(-parseInt(_0xe32c64(0x13a))/0xb);if(_0x14430c===_0x21674d)break;else _0x580801['push'](_0x580801['shift']());}catch(_0x4a9d4c){_0x580801['push'](_0x580801['shift']());}}}(a0_0x47e5,0x530de));import{EventEmitter as a0_0x2f7384}from'events';import{hostname as a0_0x552253}from'os';class T extends a0_0x2f7384{['url'];[a0_0x512cac(0x129)];[a0_0x512cac(0x110)];[a0_0x512cac(0x102)];[a0_0x512cac(0x11b)];[a0_0x512cac(0x10e)];['reconnectDelay'];[a0_0x512cac(0x13b)];[a0_0x512cac(0x134)];['running']=!0x1;constructor(_0x11674f){const _0x435271=a0_0x512cac;super();if(this[_0x435271(0x141)]=_0x11674f[_0x435271(0x141)]['replace'](/\/$/,''),this[_0x435271(0x129)]=_0x11674f[_0x435271(0x129)],this[_0x435271(0x110)]=_0x11674f[_0x435271(0x110)],this[_0x435271(0x102)]=_0x11674f['agent']||_0x435271(0x125),this['resumeId']='sdk-'+_0x11674f['alias']+'-'+Date[_0x435271(0x14e)]()[_0x435271(0x12f)](0x24),this[_0x435271(0x10e)]=_0x11674f[_0x435271(0x10e)]??0x2bf20,this[_0x435271(0x14f)]=_0x11674f[_0x435271(0x14f)]??0xbb8,_0x11674f[_0x435271(0x143)]!==!0x1)this[_0x435271(0x131)]();}[a0_0x512cac(0x116)](_0x1fa4c0){const _0x5921c5=a0_0x512cac;console[_0x5921c5(0x116)]('['+new Date()[_0x5921c5(0x11a)]()[_0x5921c5(0x149)](0x0,0x8)+']\x20[commhub:'+this[_0x5921c5(0x129)]+']\x20'+_0x1fa4c0);}async['call'](_0x363239,_0x2f6e64){const _0x5ba836=a0_0x512cac;let _0x2e4a9d={'Content-Type':_0x5ba836(0x13c),'Accept':'application/json,\x20text/event-stream'};if(this[_0x5ba836(0x110)])_0x2e4a9d['Authorization']=_0x5ba836(0x112)+this[_0x5ba836(0x110)];let _0x1cb3d7=await(await fetch(this[_0x5ba836(0x141)]+_0x5ba836(0x11d),{'method':_0x5ba836(0x114),'headers':_0x2e4a9d,'body':JSON[_0x5ba836(0x148)]({'jsonrpc':_0x5ba836(0x10b),'id':Date['now'](),'method':_0x5ba836(0x138),'params':{'name':_0x363239,'arguments':_0x2f6e64}})}))['text'](),_0x4b0c32=_0x1cb3d7[_0x5ba836(0x100)](/data: (.+)/),_0x54fd68=_0x4b0c32?JSON['parse'](_0x4b0c32[0x1]):JSON[_0x5ba836(0x11f)](_0x1cb3d7),_0x580b45=_0x54fd68?.[_0x5ba836(0x10a)]?.[_0x5ba836(0x123)]?.[0x0]?.['text'];return _0x580b45?JSON[_0x5ba836(0x11f)](_0x580b45):_0x54fd68;}async[a0_0x512cac(0x131)](){const _0x1e0def=a0_0x512cac;if(this[_0x1e0def(0x111)])return;this[_0x1e0def(0x111)]=!0x0,await this[_0x1e0def(0x142)](_0x1e0def(0x107)),this[_0x1e0def(0x116)](_0x1e0def(0x12b)),this[_0x1e0def(0x13b)]=setInterval(()=>{const _0x5eb062=_0x1e0def;this[_0x5eb062(0x142)](_0x5eb062(0x107))[_0x5eb062(0x128)](_0x580252=>this[_0x5eb062(0x116)](_0x5eb062(0x150)+_0x580252['message']));},this[_0x1e0def(0x10e)]),this[_0x1e0def(0x10f)]();}async['disconnect'](){const _0x1ebc46=a0_0x512cac;if(this['running']=!0x1,this[_0x1ebc46(0x134)]?.[_0x1ebc46(0x10d)](),this[_0x1ebc46(0x13b)])clearInterval(this[_0x1ebc46(0x13b)]);await this['status'](_0x1ebc46(0x146))[_0x1ebc46(0x128)](()=>{}),this[_0x1ebc46(0x116)](_0x1ebc46(0x13d));}async[a0_0x512cac(0x133)](_0x45316a,_0x37d653,_0x2361e0=a0_0x512cac(0x145)){const _0x3438ef=a0_0x512cac;return this[_0x3438ef(0x14d)](_0x3438ef(0x147),{'alias':_0x45316a,'task':_0x37d653,'priority':_0x2361e0,'from_session':this['alias']});}async[a0_0x512cac(0x10c)](_0x3db985,_0x8a3e58){const _0xebdd01=a0_0x512cac;return this['call']('send_message',{'alias':_0x3db985,'message':_0x8a3e58,'from_session':this[_0xebdd01(0x129)]});}async[a0_0x512cac(0x124)](_0x42e207,_0x380f70,_0x264bfb=a0_0x512cac(0xff)){return this['call']('send_reply',{'in_reply_to':_0x42e207,'text':_0x380f70,'status':_0x264bfb});}async[a0_0x512cac(0x142)](_0x2bdac8,_0x5c273a){const _0x45e76b=a0_0x512cac;return this[_0x45e76b(0x14d)](_0x45e76b(0x152),{'resume_id':this[_0x45e76b(0x11b)],'alias':this[_0x45e76b(0x129)],'status':_0x2bdac8,'server':a0_0x552253(),'hostname':a0_0x552253(),'agent':this[_0x45e76b(0x102)],'project_dir':process[_0x45e76b(0x106)](),..._0x5c273a});}async[a0_0x512cac(0x12a)](){const _0x4977c4=a0_0x512cac;return this['call'](_0x4977c4(0x113),{});}async[a0_0x512cac(0x13f)](_0x5d121d,_0x99885){const _0x45203e=a0_0x512cac;return this[_0x45203e(0x14d)]('broadcast',{'message':_0x5d121d,'filter_server':_0x99885?.[_0x45203e(0x154)],'filter_status':_0x99885?.['status']});}async[a0_0x512cac(0x10f)](){const _0xa7bee5=a0_0x512cac;let _0x378a75=encodeURIComponent(this[_0xa7bee5(0x129)]),_0x5e1a2e=this[_0xa7bee5(0x141)]+'/events/'+_0x378a75,_0x29390f=this[_0xa7bee5(0x14f)];while(this[_0xa7bee5(0x111)]){try{this[_0xa7bee5(0x134)]=new AbortController();let _0x13a9ce={'Accept':'text/event-stream'};if(this[_0xa7bee5(0x110)])_0x13a9ce[_0xa7bee5(0x12e)]=_0xa7bee5(0x112)+this[_0xa7bee5(0x110)];let _0x2a2785=await fetch(_0x5e1a2e,{'headers':_0x13a9ce,'signal':this[_0xa7bee5(0x134)][_0xa7bee5(0xfe)]});if(!_0x2a2785['ok']||!_0x2a2785['body']){this[_0xa7bee5(0x116)](_0xa7bee5(0x121)+_0x2a2785['status']),await this['sleep'](_0x29390f),_0x29390f=Math[_0xa7bee5(0x11e)](_0x29390f*1.5,0xea60);continue;}_0x29390f=this['reconnectDelay'];let _0x376040=_0x2a2785[_0xa7bee5(0x108)]['getReader'](),_0x42de76=new TextDecoder(),_0x4baaad='';while(this[_0xa7bee5(0x111)]){let {done:_0x27cc9e,value:_0x5e9690}=await _0x376040[_0xa7bee5(0x118)]();if(_0x27cc9e)break;_0x4baaad+=_0x42de76[_0xa7bee5(0x130)](_0x5e9690,{'stream':!0x0});let _0x50e78e=_0x4baaad[_0xa7bee5(0x103)]('\x0a');_0x4baaad=_0x50e78e[_0xa7bee5(0x140)]()||'';for(let _0x66a25 of _0x50e78e){if(!_0x66a25['startsWith'](_0xa7bee5(0x127)))continue;try{let _0x215a46=JSON[_0xa7bee5(0x11f)](_0x66a25[_0xa7bee5(0x149)](0x6));if(_0x215a46[_0xa7bee5(0x14c)]===_0xa7bee5(0x153)){this[_0xa7bee5(0x116)](_0xa7bee5(0x109)),this[_0xa7bee5(0x135)](_0xa7bee5(0x153));continue;}if(_0x215a46[_0xa7bee5(0x14c)]==='new_task'||_0x215a46['type']===_0xa7bee5(0x104)||_0x215a46[_0xa7bee5(0x14c)]===_0xa7bee5(0x13f))await this[_0xa7bee5(0x12c)]();}catch{}}}}catch(_0x523573){if(_0x523573['name']==='AbortError')break;this[_0xa7bee5(0x135)]('error',_0x523573),this[_0xa7bee5(0x116)](_0xa7bee5(0x12d)+_0x523573[_0xa7bee5(0x10c)]);}if(this['running'])this[_0xa7bee5(0x135)](_0xa7bee5(0x13d)),this[_0xa7bee5(0x116)](_0xa7bee5(0x139)+_0x29390f/0x3e8+_0xa7bee5(0x126)),await this[_0xa7bee5(0x144)](_0x29390f),_0x29390f=Math[_0xa7bee5(0x11e)](_0x29390f*1.5,0xea60);}}async[a0_0x512cac(0x12c)](){const _0x2e6f6b=a0_0x512cac;try{let _0x1fab77=(await this[_0x2e6f6b(0x14d)](_0x2e6f6b(0x122),{'alias':this[_0x2e6f6b(0x129)],'limit':0xa}))?.[_0x2e6f6b(0x14a)]||[];for(let _0x1c1efc of _0x1fab77)await this['call'](_0x2e6f6b(0x13e),{'alias':this[_0x2e6f6b(0x129)],'message_id':_0x1c1efc['id']}),this[_0x2e6f6b(0x116)]('←\x20'+_0x1c1efc[_0x2e6f6b(0x115)]+':\x20'+_0x1c1efc[_0x2e6f6b(0x123)][_0x2e6f6b(0x149)](0x0,0x3c)),this[_0x2e6f6b(0x135)](_0x2e6f6b(0x119),_0x1c1efc),this[_0x2e6f6b(0x135)](_0x2e6f6b(0x10c),_0x1c1efc);}catch(_0x3f6f0d){this[_0x2e6f6b(0x116)]('inbox\x20error:\x20'+_0x3f6f0d['message']);}}[a0_0x512cac(0x144)](_0x47af18){return new Promise(_0x94c2db=>setTimeout(_0x94c2db,_0x47af18));}}var $=T;export{$ as default,T as CommHub};
1
+ const a0_0x829f8b=a0_0x1d67;(function(_0x1e82a2,_0x2ad6ed){const _0x4ce3ef=a0_0x1d67,_0x4b21de=_0x1e82a2();while(!![]){try{const _0x35c2d5=parseInt(_0x4ce3ef(0x179))/0x1*(parseInt(_0x4ce3ef(0x17b))/0x2)+-parseInt(_0x4ce3ef(0x147))/0x3*(-parseInt(_0x4ce3ef(0x185))/0x4)+parseInt(_0x4ce3ef(0x18a))/0x5+-parseInt(_0x4ce3ef(0x169))/0x6+parseInt(_0x4ce3ef(0x142))/0x7+-parseInt(_0x4ce3ef(0x15f))/0x8*(-parseInt(_0x4ce3ef(0x184))/0x9)+-parseInt(_0x4ce3ef(0x15e))/0xa*(parseInt(_0x4ce3ef(0x144))/0xb);if(_0x35c2d5===_0x2ad6ed)break;else _0x4b21de['push'](_0x4b21de['shift']());}catch(_0x1d5c32){_0x4b21de['push'](_0x4b21de['shift']());}}}(a0_0x62e4,0x34ca2));function a0_0x62e4(){const _0x172395=['36464LSIxvX','reconnectDelay','name','call','/mcp','body','broadcast','slice','SSE\x20failed:\x20','reply','283806JiWAbW','new_message','application/json','catch','alias','emit','getReader','processInbox','connect','Authorization','application/json,\x20text/event-stream','heartbeatInterval','agent','new_task','disconnected','normal','380452XakUkg','token','2CmZPcY','split','message','decode','url','toTimeString','text/event-stream','inbox\x20error:\x20',']\x20[commhub:','270bGpisX','60GDnnSp','startsWith','sleep','status','content','1728630HUxUbH','match','messages','task','min','cwd','completed','offline','send_task','read','parse','data:\x20','pop','connected','3017742KLOXMi','sseAbort','2503292xGALbu','SSE\x20error:\x20','send_message','66987DrNVCz','s...','running','now','from_session','Bearer\x20','get_inbox','error','idle','send_reply','resumeId','replace','log','ack_inbox','POST','result','type','autoConnect','AbortError','heartbeat\x20failed:\x20','text','heartbeatTimer','server','60sFIFFE'];a0_0x62e4=function(){return _0x172395;};return a0_0x62e4();}import{EventEmitter as a0_0x52d6d6}from'events';function a0_0x1d67(_0x22cdcf,_0x295be9){_0x22cdcf=_0x22cdcf-0x137;const _0x62e43f=a0_0x62e4();let _0x1d6796=_0x62e43f[_0x22cdcf];return _0x1d6796;}import{hostname as a0_0x4c70ed}from'os';class T extends a0_0x52d6d6{['url'];['alias'];[a0_0x829f8b(0x17a)];['agent'];['resumeId'];['heartbeatInterval'];[a0_0x829f8b(0x160)];['heartbeatTimer'];['sseAbort'];[a0_0x829f8b(0x149)]=!0x1;constructor(_0x5a3425){const _0x505ff6=a0_0x829f8b;super();if(this[_0x505ff6(0x17f)]=_0x5a3425[_0x505ff6(0x17f)][_0x505ff6(0x152)](/\/$/,''),this['alias']=_0x5a3425[_0x505ff6(0x16d)],this[_0x505ff6(0x17a)]=_0x5a3425[_0x505ff6(0x17a)],this[_0x505ff6(0x175)]=_0x5a3425[_0x505ff6(0x175)]||'sdk',this[_0x505ff6(0x151)]='sdk-'+_0x5a3425[_0x505ff6(0x16d)]+'-'+Date[_0x505ff6(0x14a)]()['toString'](0x24),this[_0x505ff6(0x174)]=_0x5a3425[_0x505ff6(0x174)]??0x2bf20,this[_0x505ff6(0x160)]=_0x5a3425[_0x505ff6(0x160)]??0xbb8,_0x5a3425[_0x505ff6(0x158)]!==!0x1)this['connect']();}[a0_0x829f8b(0x153)](_0x58d1a9){const _0x66f00f=a0_0x829f8b;console[_0x66f00f(0x153)]('['+new Date()[_0x66f00f(0x180)]()[_0x66f00f(0x166)](0x0,0x8)+_0x66f00f(0x183)+this['alias']+']\x20'+_0x58d1a9);}async['call'](_0x55e3d3,_0x933145){const _0x59d44d=a0_0x829f8b;let _0x528b62={'Content-Type':_0x59d44d(0x16b),'Accept':_0x59d44d(0x173)};if(this['token'])_0x528b62[_0x59d44d(0x172)]=_0x59d44d(0x14c)+this[_0x59d44d(0x17a)];let _0x38ac05=await(await fetch(this[_0x59d44d(0x17f)]+_0x59d44d(0x163),{'method':_0x59d44d(0x155),'headers':_0x528b62,'body':JSON['stringify']({'jsonrpc':'2.0','id':Date[_0x59d44d(0x14a)](),'method':'tools/call','params':{'name':_0x55e3d3,'arguments':_0x933145}})}))['text'](),_0x5ae2fa=_0x38ac05[_0x59d44d(0x18b)](/data: (.+)/),_0x1bf5d3=_0x5ae2fa?JSON[_0x59d44d(0x13e)](_0x5ae2fa[0x1]):JSON[_0x59d44d(0x13e)](_0x38ac05),_0x9dfcb5=_0x1bf5d3?.[_0x59d44d(0x156)]?.[_0x59d44d(0x189)]?.[0x0]?.[_0x59d44d(0x15b)];return _0x9dfcb5?JSON['parse'](_0x9dfcb5):_0x1bf5d3;}async[a0_0x829f8b(0x171)](){const _0x209425=a0_0x829f8b;if(this[_0x209425(0x149)])return;this[_0x209425(0x149)]=!0x0,await this[_0x209425(0x188)](_0x209425(0x14f)),this['log']('registered'),this[_0x209425(0x15c)]=setInterval(()=>{const _0x121314=_0x209425;this[_0x121314(0x188)](_0x121314(0x14f))[_0x121314(0x16c)](_0x413340=>this['log'](_0x121314(0x15a)+_0x413340['message']));},this[_0x209425(0x174)]),this['connectSSE']();}async['disconnect'](){const _0x1a5fa2=a0_0x829f8b;if(this[_0x1a5fa2(0x149)]=!0x1,this[_0x1a5fa2(0x143)]?.['abort'](),this[_0x1a5fa2(0x15c)])clearInterval(this[_0x1a5fa2(0x15c)]);await this[_0x1a5fa2(0x188)](_0x1a5fa2(0x13b))[_0x1a5fa2(0x16c)](()=>{}),this['log']('disconnected');}async['send'](_0x1238d7,_0xcd60ae,_0x4a09c2=a0_0x829f8b(0x178)){const _0x5025a8=a0_0x829f8b;return this['call'](_0x5025a8(0x13c),{'alias':_0x1238d7,'task':_0xcd60ae,'priority':_0x4a09c2,'from_session':this[_0x5025a8(0x16d)]});}async[a0_0x829f8b(0x17d)](_0xec61c6,_0x4e0f54){const _0xb2921b=a0_0x829f8b;return this[_0xb2921b(0x162)](_0xb2921b(0x146),{'alias':_0xec61c6,'message':_0x4e0f54,'from_session':this[_0xb2921b(0x16d)]});}async[a0_0x829f8b(0x168)](_0x3580b7,_0x255c5b,_0x471fb1=a0_0x829f8b(0x13a)){const _0x25c302=a0_0x829f8b;return this['call'](_0x25c302(0x150),{'in_reply_to':_0x3580b7,'text':_0x255c5b,'status':_0x471fb1});}async['status'](_0x39b804,_0x1f01ef){const _0x3dd2fa=a0_0x829f8b;return this[_0x3dd2fa(0x162)]('report_status',{'resume_id':this[_0x3dd2fa(0x151)],'alias':this['alias'],'status':_0x39b804,'server':a0_0x4c70ed(),'hostname':a0_0x4c70ed(),'agent':this[_0x3dd2fa(0x175)],'project_dir':process[_0x3dd2fa(0x139)](),..._0x1f01ef});}async['getAllStatus'](){return this['call']('get_all_status',{});}async['broadcast'](_0xd5580c,_0x47c25f){const _0x29e416=a0_0x829f8b;return this[_0x29e416(0x162)](_0x29e416(0x165),{'message':_0xd5580c,'filter_server':_0x47c25f?.[_0x29e416(0x15d)],'filter_status':_0x47c25f?.[_0x29e416(0x188)]});}async['connectSSE'](){const _0x24d5ea=a0_0x829f8b;let _0x122a5c=encodeURIComponent(this['alias']),_0x2a13c6=this[_0x24d5ea(0x17f)]+'/events/'+_0x122a5c,_0x479af5=this['reconnectDelay'];while(this[_0x24d5ea(0x149)]){try{this['sseAbort']=new AbortController();let _0x24f009={'Accept':_0x24d5ea(0x181)};if(this[_0x24d5ea(0x17a)])_0x24f009[_0x24d5ea(0x172)]=_0x24d5ea(0x14c)+this['token'];let _0x25ed5d=await fetch(_0x2a13c6,{'headers':_0x24f009,'signal':this[_0x24d5ea(0x143)]['signal']});if(!_0x25ed5d['ok']||!_0x25ed5d[_0x24d5ea(0x164)]){this[_0x24d5ea(0x153)](_0x24d5ea(0x167)+_0x25ed5d[_0x24d5ea(0x188)]),await this[_0x24d5ea(0x187)](_0x479af5),_0x479af5=Math[_0x24d5ea(0x138)](_0x479af5*1.5,0xea60);continue;}_0x479af5=this[_0x24d5ea(0x160)];let _0x563c10=_0x25ed5d[_0x24d5ea(0x164)][_0x24d5ea(0x16f)](),_0x1e487f=new TextDecoder(),_0x348da5='';while(this[_0x24d5ea(0x149)]){let {done:_0x3e4e12,value:_0x207c29}=await _0x563c10[_0x24d5ea(0x13d)]();if(_0x3e4e12)break;_0x348da5+=_0x1e487f[_0x24d5ea(0x17e)](_0x207c29,{'stream':!0x0});let _0x234d28=_0x348da5[_0x24d5ea(0x17c)]('\x0a');_0x348da5=_0x234d28[_0x24d5ea(0x140)]()||'';for(let _0x3c86e2 of _0x234d28){if(!_0x3c86e2[_0x24d5ea(0x186)](_0x24d5ea(0x13f)))continue;try{let _0x5ef4a6=JSON[_0x24d5ea(0x13e)](_0x3c86e2[_0x24d5ea(0x166)](0x6));if(_0x5ef4a6['type']===_0x24d5ea(0x141)){this[_0x24d5ea(0x153)]('SSE\x20connected'),this[_0x24d5ea(0x16e)](_0x24d5ea(0x141));continue;}if(_0x5ef4a6[_0x24d5ea(0x157)]===_0x24d5ea(0x176)||_0x5ef4a6[_0x24d5ea(0x157)]===_0x24d5ea(0x16a)||_0x5ef4a6['type']===_0x24d5ea(0x165))await this['processInbox']();}catch{}}}}catch(_0x363513){if(_0x363513[_0x24d5ea(0x161)]===_0x24d5ea(0x159))break;this['emit'](_0x24d5ea(0x14e),_0x363513),this[_0x24d5ea(0x153)](_0x24d5ea(0x145)+_0x363513[_0x24d5ea(0x17d)]);}if(this[_0x24d5ea(0x149)])this[_0x24d5ea(0x16e)](_0x24d5ea(0x177)),this[_0x24d5ea(0x153)]('SSE\x20reconnecting\x20in\x20'+_0x479af5/0x3e8+_0x24d5ea(0x148)),await this[_0x24d5ea(0x187)](_0x479af5),_0x479af5=Math[_0x24d5ea(0x138)](_0x479af5*1.5,0xea60);}}async[a0_0x829f8b(0x170)](){const _0x45ac76=a0_0x829f8b;try{let _0x1047cd=(await this[_0x45ac76(0x162)](_0x45ac76(0x14d),{'alias':this[_0x45ac76(0x16d)],'limit':0xa}))?.[_0x45ac76(0x18c)]||[];for(let _0x5cb470 of _0x1047cd)await this['call'](_0x45ac76(0x154),{'alias':this[_0x45ac76(0x16d)],'message_id':_0x5cb470['id']}),this[_0x45ac76(0x153)]('←\x20'+_0x5cb470[_0x45ac76(0x14b)]+':\x20'+_0x5cb470['content']['slice'](0x0,0x3c)),this[_0x45ac76(0x16e)](_0x45ac76(0x137),_0x5cb470),this['emit']('message',_0x5cb470);}catch(_0x2bcfaf){this[_0x45ac76(0x153)](_0x45ac76(0x182)+_0x2bcfaf[_0x45ac76(0x17d)]);}}['sleep'](_0x2d44a6){return new Promise(_0x521470=>setTimeout(_0x521470,_0x2d44a6));}}var $=T;export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x3afe7d=a0_0x577d;(function(_0x8bbd0a,_0x1f9543){const _0x440a3b=a0_0x577d,_0x2fee8f=_0x8bbd0a();while(!![]){try{const _0x440a2f=-parseInt(_0x440a3b(0xd9))/0x1*(parseInt(_0x440a3b(0x104))/0x2)+parseInt(_0x440a3b(0x87))/0x3+-parseInt(_0x440a3b(0x100))/0x4*(parseInt(_0x440a3b(0x98))/0x5)+-parseInt(_0x440a3b(0xd3))/0x6*(-parseInt(_0x440a3b(0xe5))/0x7)+parseInt(_0x440a3b(0xeb))/0x8*(parseInt(_0x440a3b(0x89))/0x9)+-parseInt(_0x440a3b(0xcf))/0xa*(parseInt(_0x440a3b(0xb1))/0xb)+-parseInt(_0x440a3b(0xb9))/0xc*(-parseInt(_0x440a3b(0x80))/0xd);if(_0x440a2f===_0x1f9543)break;else _0x2fee8f['push'](_0x2fee8f['shift']());}catch(_0x37ac78){_0x2fee8f['push'](_0x2fee8f['shift']());}}}(a0_0xb91d,0x63ef6));import{readFileSync as a0_0x104020,existsSync as a0_0x7ef25}from'fs';import{randomUUID as a0_0x3c518b}from'crypto';import{join as a0_0x888d9f}from'path';import{hostname as a0_0x3f600d}from'os';import{execSync as a0_0xeef046}from'child_process';import{Server as a0_0x1371ca}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x14dab8}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x1f5cb4,CallToolRequestSchema as a0_0x463c23}from'@modelcontextprotocol/sdk/types.js';function p(_0x2a58ec){const _0x122b36=a0_0x577d;if(!a0_0x7ef25(_0x2a58ec))return;for(let _0x5e2c1e of a0_0x104020(_0x2a58ec,_0x122b36(0xa2))[_0x122b36(0xc2)]('\x0a')){let _0x1dc624=_0x5e2c1e['trim']();if(!_0x1dc624||_0x1dc624['startsWith']('#'))continue;let _0x1d540a=_0x1dc624['indexOf']('=');if(_0x1d540a<0x0)continue;let _0x47d6b3=_0x1dc624[_0x122b36(0xb3)](0x0,_0x1d540a)['trim'](),_0x34cfa5=_0x1dc624[_0x122b36(0xb3)](_0x1d540a+0x1)[_0x122b36(0xb2)]()['replace'](/^["']|["']$/g,'');if(!process.env[_0x47d6b3])process.env[_0x47d6b3]=_0x34cfa5;}}var C=process.env.HOME||'~',T=a0_0x888d9f(C,a0_0x3afe7d(0x8e));function a0_0x577d(_0x139664,_0x207055){_0x139664=_0x139664-0x79;const _0xb91d6f=a0_0xb91d();let _0x577dfa=_0xb91d6f[_0x139664];return _0x577dfa;}p(a0_0x888d9f(T,'.env'));var L=process[a0_0x3afe7d(0xbd)]()[a0_0x3afe7d(0xcd)](/\//g,'-');p(a0_0x888d9f(T,L,'.env'));function U(){const _0x55e0bb=a0_0x3afe7d;try{return a0_0xeef046(_0x55e0bb(0xb0),{'encoding':_0x55e0bb(0xa2),'timeout':0x7d0})[_0x55e0bb(0xb2)]();}catch{return'';}}function v(){const _0x4ce238=a0_0x3afe7d;try{let _0x3302b9=a0_0x888d9f(C,_0x4ce238(0x9e),_0x4ce238(0xcb));if(a0_0x7ef25(_0x3302b9))return JSON[_0x4ce238(0x103)](a0_0x104020(_0x3302b9,_0x4ce238(0xa2)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x3afe7d(0x8a)]||a0_0x3afe7d(0xd5),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x3f600d(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x3c518b(),X=process.env.COMMHUB_TOKEN||H[a0_0x3afe7d(0x86)]||'';function Y(_0x325e53){const _0x18b1c7=a0_0x3afe7d;let _0x46f6e0=new Date()[_0x18b1c7(0xed)]()[_0x18b1c7(0xb3)](0x0,0x8);process[_0x18b1c7(0xf0)]['write']('['+_0x46f6e0+_0x18b1c7(0xd6)+_0x325e53+'\x0a');}function a0_0xb91d(){const _0x3c0976=['Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','.anet','from_session','params','stringify','utf-8','priority','SSE\x20fatal:\x20','completed','/mcp','SSE\x20stream\x20ended,\x20reconnecting...','cancelled','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','normal','Reply\x20text\x20/\x20result\x20summary','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','report_status','\x20PROJECT_ENV=','POST','tmux\x20display-message\x20-p\x20\x27#S\x27','314149VDGOih','trim','slice','broadcast','ready\x20—\x20waiting\x20for\x20events','find','exit','fatal:\x20','249048CTyRKk','idle','init\x20failed:\x20','new_message','cwd','send_message','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','application/json','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','split','←\x20message\x20from\x20','SIGTERM','join','Current\x20task\x20description','setRequestHandler','commhub_send_message','Priority\x20(default:\x20normal)','catch','config.json','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','replace','2025-03-26','20vuwTBJ','end','application/json,\x20text/event-stream','SSE\x20connected\x20as\x20\x22','318162ITYoxl','startsWith','http://127.0.0.1:9200',']\x20[commhub]\x20','in_progress','new_task','181513zNMbPX','commhub_report_status','\x20priority=','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','delete','body','object','0.3.0','text','Session\x20alias:\x20','Message\x20content','2.0','42kHCZco','string','connecting\x20to\x20','message_id','commhub','Progress\x200-100','746248rzmaNb','\x20RESUME_ID=','toTimeString','data:\x20','connected','stderr','MCP\x20stdio\x20connected','Bearer\x20','send_task','then','\x20from\x20','from','\x22\x20(','messages','error','notifications/claude/channel','working','inbox_count','\x20ALIAS=','claude-code','→\x20injected\x20task\x20','208KppgTi','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','send_reply','parse','2ZMIOVE','...\x20TMUX=','commhub-channel','length','tools/call','/events/','pop','decode','read','alias','result','13VAWWZy','session\x20disconnected','get_all_status','set','connect','unknown\x20tool','token','670299PxhxZE','blocked','36vkUPXy','hub','low','heartbeat\x20failed:\x20','content','.claude/channels/commhub','none','message','Authorization','Target\x20session\x20alias','CommHub\x20init\x20failed:\x20','ack_inbox','type','status','ENV:\x20URL=','27645rxJDlB','getReader','failed','commhub_get_all_status','commhub_send_task'];a0_0xb91d=function(){return _0x3c0976;};return a0_0xb91d();}function h(_0x169c87){return new Promise(_0x1f4cd3=>setTimeout(_0x1f4cd3,_0x169c87));}Y(a0_0x3afe7d(0x97)+f+a0_0x3afe7d(0xfd)+Z+a0_0x3afe7d(0xec)+w[a0_0x3afe7d(0xb3)](0x0,0x8)+a0_0x3afe7d(0x105)+(j||a0_0x3afe7d(0x8f))+'\x20CWD='+process[a0_0x3afe7d(0xbd)]()+a0_0x3afe7d(0xae)+L);var k=new Map(),K=new a0_0x1371ca({'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>',a0_0x3afe7d(0x101),a0_0x3afe7d(0xa9),a0_0x3afe7d(0xac),a0_0x3afe7d(0xe2)+Z][a0_0x3afe7d(0xc5)]('\x0a')});K[a0_0x3afe7d(0xc7)](a0_0x1f5cb4,async()=>({'tools':[{'name':'commhub_reply','description':'Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','inputSchema':{'type':a0_0x3afe7d(0xdf),'properties':{'task_id':{'type':a0_0x3afe7d(0xe6),'description':'The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)'},'text':{'type':a0_0x3afe7d(0xe6),'description':a0_0x3afe7d(0xab)},'status':{'type':a0_0x3afe7d(0xe6),'enum':['completed',a0_0x3afe7d(0x9a),a0_0x3afe7d(0xa8),a0_0x3afe7d(0x88),a0_0x3afe7d(0xf9),a0_0x3afe7d(0xd7)],'description':a0_0x3afe7d(0xbf)}},'required':[a0_0x3afe7d(0xe1)]}},{'name':a0_0x3afe7d(0xda),'description':a0_0x3afe7d(0xdc),'inputSchema':{'type':'object','properties':{'status':{'type':'string','enum':[a0_0x3afe7d(0xfb),a0_0x3afe7d(0xba),'blocked',a0_0x3afe7d(0xf9)]},'task':{'type':a0_0x3afe7d(0xe6),'description':a0_0x3afe7d(0xc6)},'progress':{'type':'number','description':a0_0x3afe7d(0xea)}},'required':[a0_0x3afe7d(0x96)]}},{'name':a0_0x3afe7d(0x9c),'description':a0_0x3afe7d(0xcc),'inputSchema':{'type':a0_0x3afe7d(0xdf),'properties':{'alias':{'type':a0_0x3afe7d(0xe6),'description':'Target\x20session\x20alias'},'task':{'type':a0_0x3afe7d(0xe6),'description':'Task\x20content'},'priority':{'type':'string','enum':['high','normal',a0_0x3afe7d(0x8b)],'description':a0_0x3afe7d(0xc9)}},'required':['alias','task']}},{'name':'commhub_send_message','description':a0_0x3afe7d(0x9d),'inputSchema':{'type':a0_0x3afe7d(0xdf),'properties':{'alias':{'type':a0_0x3afe7d(0xe6),'description':a0_0x3afe7d(0x92)},'message':{'type':a0_0x3afe7d(0xe6),'description':a0_0x3afe7d(0xe3)}},'required':[a0_0x3afe7d(0x7e),a0_0x3afe7d(0x90)]}},{'name':a0_0x3afe7d(0x9b),'description':a0_0x3afe7d(0xc1),'inputSchema':{'type':a0_0x3afe7d(0xdf),'properties':{}}}]}));async function P(_0x573c1d,_0x508daf){const _0x521c1b=a0_0x3afe7d;let _0x18eccc=await fetch(f+_0x521c1b(0xa6),{'method':_0x521c1b(0xaf),'headers':{'Content-Type':_0x521c1b(0xc0),'Accept':_0x521c1b(0xd1),...X?{'Authorization':_0x521c1b(0xf2)+X}:{}},'body':JSON[_0x521c1b(0xa1)]({'jsonrpc':_0x521c1b(0xe4),'id':0x1,'method':'initialize','params':{'protocolVersion':_0x521c1b(0xce),'capabilities':{},'clientInfo':{'name':_0x521c1b(0x106),'version':_0x521c1b(0xe0)}}})});if(!_0x18eccc['ok']){let _0x11c6b4=await _0x18eccc[_0x521c1b(0xe1)]();return Y(_0x521c1b(0x93)+_0x18eccc['status']+'\x20'+_0x11c6b4[_0x521c1b(0xb3)](0x0,0x64)),{'ok':!0x1,'error':_0x521c1b(0xbb)+_0x18eccc[_0x521c1b(0x96)]};}await _0x18eccc[_0x521c1b(0xe1)]();let _0x39ffe1=(await(await fetch(f+_0x521c1b(0xa6),{'method':_0x521c1b(0xaf),'headers':{'Content-Type':_0x521c1b(0xc0),'Accept':_0x521c1b(0xd1),...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON['stringify']({'jsonrpc':'2.0','id':0x2,'method':_0x521c1b(0x79),'params':{'name':_0x573c1d,'arguments':_0x508daf}})}))['text']())['split']('\x0a')[_0x521c1b(0xb6)](_0xf66c73=>_0xf66c73[_0x521c1b(0xd4)](_0x521c1b(0xee)));if(_0x39ffe1){let _0xd97ede=JSON[_0x521c1b(0x103)](_0x39ffe1['slice'](0x6));return _0xd97ede?.['result']?.[_0x521c1b(0x8d)]?.[0x0]?.['text']?JSON['parse'](_0xd97ede[_0x521c1b(0x7f)][_0x521c1b(0x8d)][0x0][_0x521c1b(0xe1)]):_0xd97ede;}return{'ok':!0x1,'error':'no\x20response'};}K['setRequestHandler'](a0_0x463c23,async _0x549980=>{const _0x3bfc27=a0_0x3afe7d;let {name:_0x1162b1,arguments:_0x21004e}=_0x549980[_0x3bfc27(0xa0)];if(_0x1162b1==='commhub_reply'){let {task_id:_0x79a8f3,text:_0x4cf1b7,status:_0x25a782}=_0x21004e;if(_0x25a782===_0x3bfc27(0xa5)||_0x25a782===_0x3bfc27(0x9a)||_0x25a782==='cancelled'){let _0x3f7d52=_0x25a782===_0x3bfc27(0xa5)?'replied':_0x25a782,_0x316df5=_0x79a8f3?k['get'](_0x79a8f3)||_0x3bfc27(0x8a):'hub',_0x1d48d9=await P(_0x3bfc27(0x102),{'alias':_0x316df5,'text':_0x4cf1b7,'in_reply_to':_0x79a8f3||void 0x0,'status':_0x3f7d52,'from_session':Z});if(_0x79a8f3)k[_0x3bfc27(0xdd)](_0x79a8f3);return{'content':[{'type':_0x3bfc27(0xe1),'text':JSON[_0x3bfc27(0xa1)](_0x1d48d9)}]};}let _0x166714=await P(_0x3bfc27(0xad),{'resume_id':w,'alias':Z,'status':_0x25a782===_0x3bfc27(0x88)?_0x3bfc27(0x88):_0x25a782===_0x3bfc27(0xf9)?'error':_0x3bfc27(0xfb),'task':_0x4cf1b7['slice'](0x0,0xc8),'output':_0x4cf1b7});return{'content':[{'type':_0x3bfc27(0xe1),'text':JSON[_0x3bfc27(0xa1)](_0x166714)}]};}if(_0x1162b1===_0x3bfc27(0xda)){let {status:_0x1439d6,task:_0x313ece,progress:_0x20f197}=_0x21004e,_0x179f87=await P(_0x3bfc27(0xad),{'resume_id':w,'alias':Z,'status':_0x1439d6,'task':_0x313ece,'progress':_0x20f197});return{'content':[{'type':_0x3bfc27(0xe1),'text':JSON[_0x3bfc27(0xa1)](_0x179f87)}]};}if(_0x1162b1===_0x3bfc27(0x9c)){let {alias:_0x102bab,task:_0x2ad131,priority:_0x46f41b}=_0x21004e,_0x31ceda=await P(_0x3bfc27(0xf3),{'alias':_0x102bab,'task':_0x2ad131,'priority':_0x46f41b||_0x3bfc27(0xaa),'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x3bfc27(0xa1)](_0x31ceda)}]};}if(_0x1162b1===_0x3bfc27(0xc8)){let {alias:_0x472150,message:_0x4e323c}=_0x21004e,_0x29fe0c=await P(_0x3bfc27(0xbe),{'alias':_0x472150,'message':_0x4e323c,'from_session':Z});return{'content':[{'type':_0x3bfc27(0xe1),'text':JSON[_0x3bfc27(0xa1)](_0x29fe0c)}]};}if(_0x1162b1==='commhub_get_all_status'){let _0x295260=await P(_0x3bfc27(0x82),{});return{'content':[{'type':_0x3bfc27(0xe1),'text':JSON['stringify'](_0x295260)}]};}return{'content':[{'type':_0x3bfc27(0xe1),'text':JSON[_0x3bfc27(0xa1)]({'error':_0x3bfc27(0x85)})}]};});async function u(){const _0x6061c2=a0_0x3afe7d;let _0x2b42ac=f+_0x6061c2(0x7a)+encodeURIComponent(Z),_0x4f53d4={};if(X)_0x4f53d4[_0x6061c2(0x91)]=_0x6061c2(0xf2)+X;Y(_0x6061c2(0xe7)+_0x2b42ac);while(!0x0){try{let _0x58ed65=await fetch(_0x2b42ac,{'headers':_0x4f53d4});if(!_0x58ed65['ok']){Y('SSE\x20error:\x20'+_0x58ed65['status']+'\x20'+_0x58ed65['statusText']),await h(0x1388);continue;}let _0x475c7c=_0x58ed65[_0x6061c2(0xde)][_0x6061c2(0x99)](),_0x50e6ee=new TextDecoder(),_0x179320='';while(!0x0){let {done:_0x554d2b,value:_0x383fc7}=await _0x475c7c[_0x6061c2(0x7d)]();if(_0x554d2b)break;_0x179320+=_0x50e6ee[_0x6061c2(0x7c)](_0x383fc7,{'stream':!0x0});let _0x40417e=_0x179320['split']('\x0a\x0a');_0x179320=_0x40417e[_0x6061c2(0x7b)]()||'';for(let _0x49804a of _0x40417e){let _0x1beb0a=_0x49804a[_0x6061c2(0xc2)]('\x0a')[_0x6061c2(0xb6)](_0x215833=>_0x215833[_0x6061c2(0xd4)](_0x6061c2(0xee)));if(!_0x1beb0a)continue;try{let _0x5a69b4=JSON[_0x6061c2(0x103)](_0x1beb0a[_0x6061c2(0xb3)](0x6));await S(_0x5a69b4);}catch(_0x12cd3a){Y('parse\x20error:\x20'+_0x12cd3a);}}}Y(_0x6061c2(0xa7));}catch(_0x4147f9){Y('SSE\x20connection\x20error:\x20'+_0x4147f9);}await h(0xbb8);}}async function S(_0x210422){const _0x332037=a0_0x3afe7d;if(_0x210422[_0x332037(0x95)]===_0x332037(0xef)){Y(_0x332037(0xd2)+Z+'\x22');return;}if(_0x210422[_0x332037(0x95)]===_0x332037(0xbc)){if(Y(_0x332037(0xc3)+_0x210422[_0x332037(0xf6)]+':\x20'+_0x210422[_0x332037(0x90)][_0x332037(0xb3)](0x0,0x3c)),await K['notification']({'method':_0x332037(0xfa),'params':{'content':_0x210422[_0x332037(0x90)],'meta':{'sender':_0x210422[_0x332037(0xf6)]||_0x332037(0x8a),'sender_id':_0x332037(0xe9),'user':_0x210422['from']||_0x332037(0x8a),'priority':_0x332037(0xaa)}}}),_0x210422[_0x332037(0xe8)])await P(_0x332037(0x94),{'alias':Z,'message_id':_0x210422['message_id']});return;}if(_0x210422[_0x332037(0x95)]===_0x332037(0xd8)||_0x210422[_0x332037(0x95)]===_0x332037(0xb4)){Y('←\x20'+_0x210422[_0x332037(0x95)]+':\x20inbox_count='+_0x210422[_0x332037(0xfc)]+_0x332037(0xdb)+(_0x210422[_0x332037(0xa3)]||'normal'));let _0x228e7f=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0x228e7f?.['ok']&&_0x228e7f[_0x332037(0xf8)]?.[_0x332037(0x107)]>0x0)for(let _0x25252d of _0x228e7f[_0x332037(0xf8)]){let _0x3c0811={'sender':_0x25252d['from_session']||_0x332037(0x8a),'sender_id':_0x332037(0xe9),'user':_0x25252d[_0x332037(0x9f)]||_0x332037(0x8a),'task_id':_0x25252d['id'],'priority':_0x25252d['priority']||'normal'};k[_0x332037(0x83)](_0x25252d['id'],_0x25252d[_0x332037(0x9f)]||'hub'),await K['notification']({'method':_0x332037(0xfa),'params':{'content':_0x25252d[_0x332037(0x8d)],'meta':_0x3c0811}}),Y(_0x332037(0xff)+_0x25252d['id']['slice'](0x0,0x8)+_0x332037(0xf5)+_0x25252d[_0x332037(0x9f)]+':\x20'+_0x25252d[_0x332037(0x8d)][_0x332037(0xb3)](0x0,0x3c)),await P(_0x332037(0x94),{'alias':Z,'message_id':_0x25252d['id']});}}}async function A(){const _0xbfcacc=a0_0x3afe7d;let _0x4abada=new a0_0x14dab8();await K[_0xbfcacc(0x84)](_0x4abada),Y(_0xbfcacc(0xf1)),Y('starting\x20SSE\x20listener...'),u()[_0xbfcacc(0xca)](_0x11346b=>Y(_0xbfcacc(0xa4)+_0x11346b)),P('report_status',{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x3f600d(),'hostname':a0_0x3f600d(),'agent':'claude-code','project_dir':process[_0xbfcacc(0xbd)](),'tmux_name':j||void 0x0})[_0xbfcacc(0xf4)](()=>Y('registered\x20as\x20\x22'+Z+_0xbfcacc(0xf7)+w[_0xbfcacc(0xb3)](0x0,0x8)+')'))[_0xbfcacc(0xca)](_0x2e5a1b=>Y('warning:\x20could\x20not\x20register:\x20'+_0x2e5a1b)),setInterval(()=>{const _0x3e1183=_0xbfcacc;P('report_status',{'resume_id':w,'alias':Z,'status':_0x3e1183(0xba),'server':a0_0x3f600d(),'hostname':a0_0x3f600d(),'agent':_0x3e1183(0xfe),'project_dir':process[_0x3e1183(0xbd)](),'tmux_name':j||void 0x0})[_0x3e1183(0xca)](_0x354694=>Y(_0x3e1183(0x8c)+_0x354694));},0x2bf20),Y(_0xbfcacc(0xb5));}A()[a0_0x3afe7d(0xca)](_0x120571=>{const _0x292652=a0_0x3afe7d;Y(_0x292652(0xb8)+_0x120571),process[_0x292652(0xb7)](0x1);});async function N(){const _0x17fa6b=a0_0x3afe7d;Y('shutting\x20down,\x20reporting\x20offline...'),await P(_0x17fa6b(0xad),{'resume_id':w,'alias':Z,'status':'error','task':_0x17fa6b(0x81)})[_0x17fa6b(0xca)](()=>{}),process[_0x17fa6b(0xb7)](0x0);}process['stdin']['on'](a0_0x3afe7d(0xd0),()=>N()),process['on'](a0_0x3afe7d(0xc4),()=>N()),process['on']('SIGINT',()=>N());
2
+ const a0_0x53a9fb=a0_0x1fd4;(function(_0x31ea6c,_0x2d2ff9){const _0x54a74b=a0_0x1fd4,_0x9e49b9=_0x31ea6c();while(!![]){try{const _0x404f4e=-parseInt(_0x54a74b(0x220))/0x1*(-parseInt(_0x54a74b(0x200))/0x2)+-parseInt(_0x54a74b(0x22c))/0x3+parseInt(_0x54a74b(0x240))/0x4+-parseInt(_0x54a74b(0x236))/0x5+parseInt(_0x54a74b(0x23e))/0x6*(-parseInt(_0x54a74b(0x1f7))/0x7)+parseInt(_0x54a74b(0x254))/0x8+parseInt(_0x54a74b(0x1fc))/0x9;if(_0x404f4e===_0x2d2ff9)break;else _0x9e49b9['push'](_0x9e49b9['shift']());}catch(_0x46797e){_0x9e49b9['push'](_0x9e49b9['shift']());}}}(a0_0x3c9d,0xa8ef4));import{readFileSync as a0_0x144e86,existsSync as a0_0x5484f0}from'fs';import{randomUUID as a0_0x382fc9}from'crypto';import{join as a0_0xf6487}from'path';import{hostname as a0_0x153e36}from'os';import{execSync as a0_0x48a134}from'child_process';import{Server as a0_0x4afe9c}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x86034}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x39805c,CallToolRequestSchema as a0_0x35f265}from'@modelcontextprotocol/sdk/types.js';function p(_0x14ad97){const _0xf2ae0a=a0_0x1fd4;if(!a0_0x5484f0(_0x14ad97))return;for(let _0x4fe77c of a0_0x144e86(_0x14ad97,_0xf2ae0a(0x206))[_0xf2ae0a(0x1e3)]('\x0a')){let _0x548fc8=_0x4fe77c[_0xf2ae0a(0x252)]();if(!_0x548fc8||_0x548fc8['startsWith']('#'))continue;let _0x4eb1b8=_0x548fc8['indexOf']('=');if(_0x4eb1b8<0x0)continue;let _0x314bb=_0x548fc8[_0xf2ae0a(0x216)](0x0,_0x4eb1b8)[_0xf2ae0a(0x252)](),_0x8b075f=_0x548fc8[_0xf2ae0a(0x216)](_0x4eb1b8+0x1)[_0xf2ae0a(0x252)]()[_0xf2ae0a(0x20d)](/^["']|["']$/g,'');if(!process.env[_0x314bb])process.env[_0x314bb]=_0x8b075f;}}var C=process.env.HOME||'~',T=a0_0xf6487(C,a0_0x53a9fb(0x248));p(a0_0xf6487(T,'.env'));var L=process[a0_0x53a9fb(0x247)]()[a0_0x53a9fb(0x20d)](/\//g,'-');p(a0_0xf6487(T,L,a0_0x53a9fb(0x222)));function U(){const _0x5c2c8a=a0_0x53a9fb;try{return a0_0x48a134('tmux\x20display-message\x20-p\x20\x27#S\x27',{'encoding':_0x5c2c8a(0x206),'timeout':0x7d0})[_0x5c2c8a(0x252)]();}catch{return'';}}function a0_0x3c9d(){const _0x11ed88=['inbox_count','from_session','init\x20failed:\x20','read','2289114ooScHH','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','commhub_send_task','send_reply','find','catch','body','commhub_send_message','Message\x20content','Session\x20alias:\x20','6631130RyipLU','Bearer\x20','→\x20injected\x20task\x20','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','...\x20TMUX=','exit','\x20CWD=','2.0','6DMCiQy','type','2366756wsdbPk','from','2025-03-26','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','shutting\x20down,\x20reporting\x20offline...','Reply\x20text\x20/\x20result\x20summary','commhub_report_status','cwd','.claude/channels/commhub','Target\x20session\x20alias','error','\x20RESUME_ID=','connect',']\x20[commhub]\x20','cancelled','get_inbox','ENV:\x20URL=','working','trim','Current\x20task\x20description','9033032iWcECH','http://127.0.0.1:9200','commhub_get_all_status','/mcp','blocked','\x22\x20(','SSE\x20connection\x20error:\x20','ack_inbox','string','completed','object','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','/events/','message','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','split','SSE\x20connected\x20as\x20\x22','no\x20response','ready\x20—\x20waiting\x20for\x20events','\x20from\x20','Priority\x20(default:\x20normal)','result','status','get','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','number','0.3.0','getReader','content','SIGTERM','idle','claude-code','hub','commhub','stderr','7279909pGvnBV','new_message','commhub-channel','end','SSE\x20error:\x20','7865649QHgJRI','toTimeString','alias','priority','2sbEYQv','warning:\x20could\x20not\x20register:\x20','text','parse','messages','stringify','utf-8','set','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','normal','none','Task\x20content','startsWith','replace','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','join','message_id','commhub_reply','connected','token','.anet','MCP\x20stdio\x20connected','slice','application/json,\x20text/event-stream','initialize','tools/call','starting\x20SSE\x20listener...','pop','data:\x20','low','setRequestHandler','params','1226428oVXRsp','failed','.env','in_progress','report_status','application/json','length','notifications/claude/channel'];a0_0x3c9d=function(){return _0x11ed88;};return a0_0x3c9d();}function v(){const _0x2b5034=a0_0x53a9fb;try{let _0x1e785e=a0_0xf6487(C,_0x2b5034(0x214),'config.json');if(a0_0x5484f0(_0x1e785e))return JSON[_0x2b5034(0x203)](a0_0x144e86(_0x1e785e,_0x2b5034(0x206)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x53a9fb(0x1f4)]||a0_0x53a9fb(0x255),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x153e36(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x382fc9(),X=process.env.COMMHUB_TOKEN||H[a0_0x53a9fb(0x213)]||'';function Y(_0x650ee9){const _0x1f9d69=a0_0x53a9fb;let _0x1292ef=new Date()[_0x1f9d69(0x1fd)]()['slice'](0x0,0x8);process[_0x1f9d69(0x1f6)]['write']('['+_0x1292ef+_0x1f9d69(0x24d)+_0x650ee9+'\x0a');}function a0_0x1fd4(_0x5c031b,_0x2f5ec2){_0x5c031b=_0x5c031b-0x1d7;const _0x3c9d0b=a0_0x3c9d();let _0x1fd479=_0x3c9d0b[_0x5c031b];return _0x1fd479;}function h(_0x4031b8){return new Promise(_0x4dfc1d=>setTimeout(_0x4dfc1d,_0x4031b8));}Y(a0_0x53a9fb(0x250)+f+'\x20ALIAS='+Z+a0_0x53a9fb(0x24b)+w[a0_0x53a9fb(0x216)](0x0,0x8)+a0_0x53a9fb(0x23a)+(j||a0_0x53a9fb(0x20a))+a0_0x53a9fb(0x23c)+process[a0_0x53a9fb(0x247)]()+'\x20PROJECT_ENV='+L);var k=new Map(),K=new a0_0x4afe9c({'name':a0_0x53a9fb(0x1f9),'version':'0.3.0'},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x53a9fb(0x1df),'These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.',a0_0x53a9fb(0x239),a0_0x53a9fb(0x243),a0_0x53a9fb(0x235)+Z][a0_0x53a9fb(0x20f)]('\x0a')});K[a0_0x53a9fb(0x21e)](a0_0x39805c,async()=>({'tools':[{'name':a0_0x53a9fb(0x211),'description':a0_0x53a9fb(0x20e),'inputSchema':{'type':a0_0x53a9fb(0x1de),'properties':{'task_id':{'type':a0_0x53a9fb(0x1dc),'description':a0_0x53a9fb(0x22d)},'text':{'type':a0_0x53a9fb(0x1dc),'description':a0_0x53a9fb(0x245)},'status':{'type':a0_0x53a9fb(0x1dc),'enum':[a0_0x53a9fb(0x1dd),a0_0x53a9fb(0x221),a0_0x53a9fb(0x24e),a0_0x53a9fb(0x1d8),'error',a0_0x53a9fb(0x223)],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':[a0_0x53a9fb(0x202)]}},{'name':a0_0x53a9fb(0x246),'description':a0_0x53a9fb(0x1e2),'inputSchema':{'type':a0_0x53a9fb(0x1de),'properties':{'status':{'type':a0_0x53a9fb(0x1dc),'enum':[a0_0x53a9fb(0x251),a0_0x53a9fb(0x1f2),a0_0x53a9fb(0x1d8),a0_0x53a9fb(0x24a)]},'task':{'type':a0_0x53a9fb(0x1dc),'description':a0_0x53a9fb(0x253)},'progress':{'type':a0_0x53a9fb(0x1ed),'description':'Progress\x200-100'}},'required':[a0_0x53a9fb(0x1ea)]}},{'name':a0_0x53a9fb(0x22e),'description':'Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x53a9fb(0x1dc),'description':a0_0x53a9fb(0x249)},'task':{'type':a0_0x53a9fb(0x1dc),'description':a0_0x53a9fb(0x20b)},'priority':{'type':'string','enum':['high','normal',a0_0x53a9fb(0x21d)],'description':a0_0x53a9fb(0x1e8)}},'required':['alias','task']}},{'name':a0_0x53a9fb(0x233),'description':a0_0x53a9fb(0x208),'inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x53a9fb(0x1dc),'description':a0_0x53a9fb(0x249)},'message':{'type':'string','description':a0_0x53a9fb(0x234)}},'required':[a0_0x53a9fb(0x1fe),'message']}},{'name':'commhub_get_all_status','description':a0_0x53a9fb(0x1ec),'inputSchema':{'type':a0_0x53a9fb(0x1de),'properties':{}}}]}));async function P(_0x355608,_0x224c95){const _0x240c79=a0_0x53a9fb;let _0x5f1141=await fetch(f+_0x240c79(0x1d7),{'method':'POST','headers':{'Content-Type':_0x240c79(0x225),'Accept':_0x240c79(0x217),...X?{'Authorization':_0x240c79(0x237)+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x240c79(0x23d),'id':0x1,'method':_0x240c79(0x218),'params':{'protocolVersion':_0x240c79(0x242),'capabilities':{},'clientInfo':{'name':_0x240c79(0x1f9),'version':_0x240c79(0x1ee)}}})});if(!_0x5f1141['ok']){let _0x3acae6=await _0x5f1141[_0x240c79(0x202)]();return Y('CommHub\x20init\x20failed:\x20'+_0x5f1141[_0x240c79(0x1ea)]+'\x20'+_0x3acae6[_0x240c79(0x216)](0x0,0x64)),{'ok':!0x1,'error':_0x240c79(0x22a)+_0x5f1141['status']};}await _0x5f1141[_0x240c79(0x202)]();let _0x4c552d=(await(await fetch(f+_0x240c79(0x1d7),{'method':'POST','headers':{'Content-Type':_0x240c79(0x225),'Accept':_0x240c79(0x217),...X?{'Authorization':_0x240c79(0x237)+X}:{}},'body':JSON['stringify']({'jsonrpc':'2.0','id':0x2,'method':_0x240c79(0x219),'params':{'name':_0x355608,'arguments':_0x224c95}})}))['text']())[_0x240c79(0x1e3)]('\x0a')['find'](_0x217eca=>_0x217eca[_0x240c79(0x20c)](_0x240c79(0x21c)));if(_0x4c552d){let _0x1eea04=JSON['parse'](_0x4c552d[_0x240c79(0x216)](0x6));return _0x1eea04?.['result']?.[_0x240c79(0x1f0)]?.[0x0]?.[_0x240c79(0x202)]?JSON[_0x240c79(0x203)](_0x1eea04[_0x240c79(0x1e9)]['content'][0x0]['text']):_0x1eea04;}return{'ok':!0x1,'error':_0x240c79(0x1e5)};}K[a0_0x53a9fb(0x21e)](a0_0x35f265,async _0x552426=>{const _0xec80cc=a0_0x53a9fb;let {name:_0x347c16,arguments:_0x212d8c}=_0x552426[_0xec80cc(0x21f)];if(_0x347c16==='commhub_reply'){let {task_id:_0x55f365,text:_0x1b7795,status:_0x452d72}=_0x212d8c;if(_0x452d72===_0xec80cc(0x1dd)||_0x452d72===_0xec80cc(0x221)||_0x452d72===_0xec80cc(0x24e)){let _0x61e01c=_0x452d72===_0xec80cc(0x1dd)?'replied':_0x452d72,_0x134549=_0x55f365?k[_0xec80cc(0x1eb)](_0x55f365)||'hub':_0xec80cc(0x1f4),_0x4af78b=await P(_0xec80cc(0x22f),{'alias':_0x134549,'text':_0x1b7795,'in_reply_to':_0x55f365||void 0x0,'status':_0x61e01c,'from_session':Z});if(_0x55f365)k['delete'](_0x55f365);return{'content':[{'type':_0xec80cc(0x202),'text':JSON[_0xec80cc(0x205)](_0x4af78b)}]};}let _0x3bde3b=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x452d72===_0xec80cc(0x1d8)?_0xec80cc(0x1d8):_0x452d72===_0xec80cc(0x24a)?_0xec80cc(0x24a):_0xec80cc(0x251),'task':_0x1b7795['slice'](0x0,0xc8),'output':_0x1b7795});return{'content':[{'type':_0xec80cc(0x202),'text':JSON[_0xec80cc(0x205)](_0x3bde3b)}]};}if(_0x347c16==='commhub_report_status'){let {status:_0x558d20,task:_0x2fcaa6,progress:_0x1a40c4}=_0x212d8c,_0xf3cb93=await P(_0xec80cc(0x224),{'resume_id':w,'alias':Z,'status':_0x558d20,'task':_0x2fcaa6,'progress':_0x1a40c4});return{'content':[{'type':_0xec80cc(0x202),'text':JSON[_0xec80cc(0x205)](_0xf3cb93)}]};}if(_0x347c16===_0xec80cc(0x22e)){let {alias:_0xfed9f5,task:_0x4e7638,priority:_0x40fd26}=_0x212d8c,_0x3b9718=await P('send_task',{'alias':_0xfed9f5,'task':_0x4e7638,'priority':_0x40fd26||_0xec80cc(0x209),'from_session':Z});return{'content':[{'type':_0xec80cc(0x202),'text':JSON[_0xec80cc(0x205)](_0x3b9718)}]};}if(_0x347c16===_0xec80cc(0x233)){let {alias:_0x2defcb,message:_0x5598d7}=_0x212d8c,_0x380b5e=await P('send_message',{'alias':_0x2defcb,'message':_0x5598d7,'from_session':Z});return{'content':[{'type':_0xec80cc(0x202),'text':JSON['stringify'](_0x380b5e)}]};}if(_0x347c16===_0xec80cc(0x256)){let _0x216be2=await P('get_all_status',{});return{'content':[{'type':_0xec80cc(0x202),'text':JSON[_0xec80cc(0x205)](_0x216be2)}]};}return{'content':[{'type':_0xec80cc(0x202),'text':JSON[_0xec80cc(0x205)]({'error':'unknown\x20tool'})}]};});async function u(){const _0x2c6203=a0_0x53a9fb;let _0x4a6324=f+_0x2c6203(0x1e0)+encodeURIComponent(Z),_0x1e7da5={};if(X)_0x1e7da5['Authorization']=_0x2c6203(0x237)+X;Y('connecting\x20to\x20'+_0x4a6324);while(!0x0){try{let _0x2fffbf=await fetch(_0x4a6324,{'headers':_0x1e7da5});if(!_0x2fffbf['ok']){Y(_0x2c6203(0x1fb)+_0x2fffbf[_0x2c6203(0x1ea)]+'\x20'+_0x2fffbf['statusText']),await h(0x1388);continue;}let _0x368c97=_0x2fffbf[_0x2c6203(0x232)][_0x2c6203(0x1ef)](),_0x4694a9=new TextDecoder(),_0x340623='';while(!0x0){let {done:_0x4e07c1,value:_0x55123a}=await _0x368c97[_0x2c6203(0x22b)]();if(_0x4e07c1)break;_0x340623+=_0x4694a9['decode'](_0x55123a,{'stream':!0x0});let _0x1f1b8a=_0x340623[_0x2c6203(0x1e3)]('\x0a\x0a');_0x340623=_0x1f1b8a[_0x2c6203(0x21b)]()||'';for(let _0x3eaa7a of _0x1f1b8a){let _0x3fd8aa=_0x3eaa7a[_0x2c6203(0x1e3)]('\x0a')[_0x2c6203(0x230)](_0x442741=>_0x442741[_0x2c6203(0x20c)](_0x2c6203(0x21c)));if(!_0x3fd8aa)continue;try{let _0x36334f=JSON[_0x2c6203(0x203)](_0x3fd8aa['slice'](0x6));await S(_0x36334f);}catch(_0x2b71dc){Y('parse\x20error:\x20'+_0x2b71dc);}}}Y('SSE\x20stream\x20ended,\x20reconnecting...');}catch(_0x3dd2b7){Y(_0x2c6203(0x1da)+_0x3dd2b7);}await h(0xbb8);}}async function S(_0x5091ff){const _0x3bf2bb=a0_0x53a9fb;if(_0x5091ff['type']===_0x3bf2bb(0x212)){Y(_0x3bf2bb(0x1e4)+Z+'\x22');return;}if(_0x5091ff['type']===_0x3bf2bb(0x1f8)){if(Y('←\x20message\x20from\x20'+_0x5091ff[_0x3bf2bb(0x241)]+':\x20'+_0x5091ff[_0x3bf2bb(0x1e1)][_0x3bf2bb(0x216)](0x0,0x3c)),await K['notification']({'method':_0x3bf2bb(0x227),'params':{'content':_0x5091ff[_0x3bf2bb(0x1e1)],'meta':{'sender':_0x5091ff[_0x3bf2bb(0x241)]||_0x3bf2bb(0x1f4),'sender_id':'commhub','user':_0x5091ff[_0x3bf2bb(0x241)]||'hub','priority':_0x3bf2bb(0x209)}}}),_0x5091ff[_0x3bf2bb(0x210)])await P(_0x3bf2bb(0x1db),{'alias':Z,'message_id':_0x5091ff[_0x3bf2bb(0x210)]});return;}if(_0x5091ff[_0x3bf2bb(0x23f)]==='new_task'||_0x5091ff[_0x3bf2bb(0x23f)]==='broadcast'){Y('←\x20'+_0x5091ff[_0x3bf2bb(0x23f)]+':\x20inbox_count='+_0x5091ff[_0x3bf2bb(0x228)]+'\x20priority='+(_0x5091ff[_0x3bf2bb(0x1ff)]||'normal'));let _0x368d95=await P(_0x3bf2bb(0x24f),{'alias':Z,'limit':0x5});if(_0x368d95?.['ok']&&_0x368d95[_0x3bf2bb(0x204)]?.[_0x3bf2bb(0x226)]>0x0)for(let _0x5baadc of _0x368d95[_0x3bf2bb(0x204)]){let _0x5e003e={'sender':_0x5baadc[_0x3bf2bb(0x229)]||_0x3bf2bb(0x1f4),'sender_id':_0x3bf2bb(0x1f5),'user':_0x5baadc[_0x3bf2bb(0x229)]||_0x3bf2bb(0x1f4),'task_id':_0x5baadc['id'],'priority':_0x5baadc[_0x3bf2bb(0x1ff)]||'normal'};k[_0x3bf2bb(0x207)](_0x5baadc['id'],_0x5baadc['from_session']||'hub'),await K['notification']({'method':_0x3bf2bb(0x227),'params':{'content':_0x5baadc['content'],'meta':_0x5e003e}}),Y(_0x3bf2bb(0x238)+_0x5baadc['id']['slice'](0x0,0x8)+_0x3bf2bb(0x1e7)+_0x5baadc[_0x3bf2bb(0x229)]+':\x20'+_0x5baadc[_0x3bf2bb(0x1f0)][_0x3bf2bb(0x216)](0x0,0x3c)),await P('ack_inbox',{'alias':Z,'message_id':_0x5baadc['id']});}}}async function A(){const _0x8063e5=a0_0x53a9fb;let _0x257769=new a0_0x86034();await K[_0x8063e5(0x24c)](_0x257769),Y(_0x8063e5(0x215)),Y(_0x8063e5(0x21a)),u()[_0x8063e5(0x231)](_0x4ecc0f=>Y('SSE\x20fatal:\x20'+_0x4ecc0f)),P(_0x8063e5(0x224),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x153e36(),'hostname':a0_0x153e36(),'agent':_0x8063e5(0x1f3),'project_dir':process[_0x8063e5(0x247)](),'tmux_name':j||void 0x0})['then'](()=>Y('registered\x20as\x20\x22'+Z+_0x8063e5(0x1d9)+w['slice'](0x0,0x8)+')'))[_0x8063e5(0x231)](_0x4105eb=>Y(_0x8063e5(0x201)+_0x4105eb)),setInterval(()=>{const _0x157073=_0x8063e5;P('report_status',{'resume_id':w,'alias':Z,'status':_0x157073(0x1f2),'server':a0_0x153e36(),'hostname':a0_0x153e36(),'agent':_0x157073(0x1f3),'project_dir':process[_0x157073(0x247)](),'tmux_name':j||void 0x0})['catch'](_0x45e4c9=>Y('heartbeat\x20failed:\x20'+_0x45e4c9));},0x2bf20),Y(_0x8063e5(0x1e6));}A()[a0_0x53a9fb(0x231)](_0xfe7712=>{const _0x2dbb2b=a0_0x53a9fb;Y('fatal:\x20'+_0xfe7712),process[_0x2dbb2b(0x23b)](0x1);});async function N(){const _0x5902a3=a0_0x53a9fb;Y(_0x5902a3(0x244)),await P('report_status',{'resume_id':w,'alias':Z,'status':'error','task':'session\x20disconnected'})[_0x5902a3(0x231)](()=>{}),process['exit'](0x0);}process['stdin']['on'](a0_0x53a9fb(0x1fa),()=>N()),process['on'](a0_0x53a9fb(0x1f1),()=>N()),process['on']('SIGINT',()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.2.5-preview.0",
3
+ "version": "2.2.5",
4
4
  "description": "AI Agent Network CLI — Create multi-agent networks with user management, network isolation, and 3 AI runtimes (Claude/Codex/MiniMax). 39 commands.",
5
5
  "type": "module",
6
6
  "main": "dist/src/client.js",