@sleep2agi/agent-network 2.1.6-preview.0 → 2.1.6-preview.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- const a0_0xbb3ad0=a0_0x2b84;(function(_0x3fdca0,_0x281207){const _0x23392c=a0_0x2b84,_0x2c7000=_0x3fdca0();while(!![]){try{const _0x50ef12=-parseInt(_0x23392c(0x216))/0x1*(parseInt(_0x23392c(0x243))/0x2)+-parseInt(_0x23392c(0x201))/0x3*(-parseInt(_0x23392c(0x1f9))/0x4)+parseInt(_0x23392c(0x206))/0x5+parseInt(_0x23392c(0x1fb))/0x6*(parseInt(_0x23392c(0x1f4))/0x7)+-parseInt(_0x23392c(0x22d))/0x8+-parseInt(_0x23392c(0x230))/0x9+-parseInt(_0x23392c(0x1f0))/0xa*(-parseInt(_0x23392c(0x23a))/0xb);if(_0x50ef12===_0x281207)break;else _0x2c7000['push'](_0x2c7000['shift']());}catch(_0x140919){_0x2c7000['push'](_0x2c7000['shift']());}}}(a0_0x12fa,0xdbb4f));function a0_0x2b84(_0x33ed28,_0x48985d){_0x33ed28=_0x33ed28-0x1ea;const _0x12fad9=a0_0x12fa();let _0x2b847c=_0x12fad9[_0x33ed28];return _0x2b847c;}import{EventEmitter as a0_0x5c1b56}from'events';import{hostname as a0_0x15b471}from'os';class T extends a0_0x5c1b56{['url'];[a0_0xbb3ad0(0x20e)];['token'];['agent'];[a0_0xbb3ad0(0x217)];[a0_0xbb3ad0(0x23f)];[a0_0xbb3ad0(0x204)];[a0_0xbb3ad0(0x1ee)];[a0_0xbb3ad0(0x1f8)];[a0_0xbb3ad0(0x1eb)]=!0x1;constructor(_0x594ad6){const _0x2a6c1a=a0_0xbb3ad0;super();if(this['url']=_0x594ad6[_0x2a6c1a(0x209)][_0x2a6c1a(0x22e)](/\/$/,''),this[_0x2a6c1a(0x20e)]=_0x594ad6[_0x2a6c1a(0x20e)],this[_0x2a6c1a(0x233)]=_0x594ad6[_0x2a6c1a(0x233)],this[_0x2a6c1a(0x225)]=_0x594ad6[_0x2a6c1a(0x225)]||_0x2a6c1a(0x23c),this[_0x2a6c1a(0x217)]='sdk-'+_0x594ad6[_0x2a6c1a(0x20e)]+'-'+Date[_0x2a6c1a(0x1f6)]()[_0x2a6c1a(0x229)](0x24),this['heartbeatInterval']=_0x594ad6['heartbeatInterval']??0x2bf20,this[_0x2a6c1a(0x204)]=_0x594ad6[_0x2a6c1a(0x204)]??0xbb8,_0x594ad6['autoConnect']!==!0x1)this[_0x2a6c1a(0x236)]();}[a0_0xbb3ad0(0x237)](_0x2745af){const _0xa1e4f2=a0_0xbb3ad0;console[_0xa1e4f2(0x237)]('['+new Date()[_0xa1e4f2(0x234)]()['slice'](0x0,0x8)+']\x20[commhub:'+this[_0xa1e4f2(0x20e)]+']\x20'+_0x2745af);}async[a0_0xbb3ad0(0x1ff)](_0x92169,_0x5ab50c){const _0x541f3b=a0_0xbb3ad0;let _0x118634={'Content-Type':_0x541f3b(0x1fe),'Accept':_0x541f3b(0x22a)};if(this['token'])_0x118634[_0x541f3b(0x238)]=_0x541f3b(0x21d)+this[_0x541f3b(0x233)];let _0x4c0f9a=await(await fetch(this[_0x541f3b(0x209)]+_0x541f3b(0x202),{'method':_0x541f3b(0x240),'headers':_0x118634,'body':JSON[_0x541f3b(0x22b)]({'jsonrpc':_0x541f3b(0x200),'id':Date[_0x541f3b(0x1f6)](),'method':_0x541f3b(0x1f7),'params':{'name':_0x92169,'arguments':_0x5ab50c}})}))[_0x541f3b(0x1f3)](),_0x1500e1=_0x4c0f9a[_0x541f3b(0x1f5)](/data: (.+)/),_0x4675d9=_0x1500e1?JSON[_0x541f3b(0x231)](_0x1500e1[0x1]):JSON[_0x541f3b(0x231)](_0x4c0f9a),_0xf7aebb=_0x4675d9?.['result']?.[_0x541f3b(0x22c)]?.[0x0]?.['text'];return _0xf7aebb?JSON[_0x541f3b(0x231)](_0xf7aebb):_0x4675d9;}async['connect'](){const _0x1b81de=a0_0xbb3ad0;if(this[_0x1b81de(0x1eb)])return;this[_0x1b81de(0x1eb)]=!0x0,await this[_0x1b81de(0x224)]('idle'),this['log'](_0x1b81de(0x23b)),this['heartbeatTimer']=setInterval(()=>{const _0x365781=_0x1b81de;this[_0x365781(0x224)](_0x365781(0x219))[_0x365781(0x20c)](_0x17c9b6=>this[_0x365781(0x237)](_0x365781(0x210)+_0x17c9b6[_0x365781(0x1fc)]));},this[_0x1b81de(0x23f)]),this[_0x1b81de(0x239)]();}async[a0_0xbb3ad0(0x20d)](){const _0x1d6e28=a0_0xbb3ad0;if(this[_0x1d6e28(0x1eb)]=!0x1,this[_0x1d6e28(0x1f8)]?.[_0x1d6e28(0x1fd)](),this['heartbeatTimer'])clearInterval(this[_0x1d6e28(0x1ee)]);await this[_0x1d6e28(0x224)](_0x1d6e28(0x22f))[_0x1d6e28(0x20c)](()=>{}),this[_0x1d6e28(0x237)](_0x1d6e28(0x20b));}async[a0_0xbb3ad0(0x207)](_0x409cc0,_0x5b2812,_0x32fae4='normal'){const _0xe18499=a0_0xbb3ad0;return this[_0xe18499(0x1ff)](_0xe18499(0x205),{'alias':_0x409cc0,'task':_0x5b2812,'priority':_0x32fae4,'from_session':this[_0xe18499(0x20e)]});}async[a0_0xbb3ad0(0x1fc)](_0x559e47,_0x5910b1){const _0x91177d=a0_0xbb3ad0;return this[_0x91177d(0x1ff)](_0x91177d(0x213),{'alias':_0x559e47,'message':_0x5910b1,'from_session':this[_0x91177d(0x20e)]});}async[a0_0xbb3ad0(0x235)](_0x285fd5,_0x28dabf,_0x25e067=a0_0xbb3ad0(0x226)){const _0x42700b=a0_0xbb3ad0;return this[_0x42700b(0x1ff)](_0x42700b(0x208),{'in_reply_to':_0x285fd5,'text':_0x28dabf,'status':_0x25e067});}async['status'](_0x29912f,_0x143b75){const _0x1db764=a0_0xbb3ad0;return this[_0x1db764(0x1ff)](_0x1db764(0x23e),{'resume_id':this[_0x1db764(0x217)],'alias':this['alias'],'status':_0x29912f,'server':a0_0x15b471(),'hostname':a0_0x15b471(),'agent':this[_0x1db764(0x225)],'project_dir':process['cwd'](),..._0x143b75});}async[a0_0xbb3ad0(0x221)](){const _0x27be2c=a0_0xbb3ad0;return this[_0x27be2c(0x1ff)]('get_all_status',{});}async[a0_0xbb3ad0(0x218)](_0x31253a,_0x37f807){const _0x5cf538=a0_0xbb3ad0;return this[_0x5cf538(0x1ff)]('broadcast',{'message':_0x31253a,'filter_server':_0x37f807?.[_0x5cf538(0x21e)],'filter_status':_0x37f807?.[_0x5cf538(0x224)]});}async[a0_0xbb3ad0(0x239)](){const _0x523ef3=a0_0xbb3ad0;let _0x5ed391=encodeURIComponent(this['alias']),_0x53f311=this[_0x523ef3(0x209)]+'/events/'+_0x5ed391,_0x2fea82=this[_0x523ef3(0x204)];while(this[_0x523ef3(0x1eb)]){try{this[_0x523ef3(0x1f8)]=new AbortController();let _0x3653fe={'Accept':_0x523ef3(0x21c)};if(this['token'])_0x3653fe[_0x523ef3(0x238)]=_0x523ef3(0x21d)+this[_0x523ef3(0x233)];let _0x44bd9a=await fetch(_0x53f311,{'headers':_0x3653fe,'signal':this[_0x523ef3(0x1f8)][_0x523ef3(0x228)]});if(!_0x44bd9a['ok']||!_0x44bd9a[_0x523ef3(0x1ea)]){this['log'](_0x523ef3(0x227)+_0x44bd9a[_0x523ef3(0x224)]),await this[_0x523ef3(0x21a)](_0x2fea82),_0x2fea82=Math[_0x523ef3(0x20a)](_0x2fea82*1.5,0xea60);continue;}_0x2fea82=this[_0x523ef3(0x204)];let _0x3f5d9c=_0x44bd9a['body'][_0x523ef3(0x1ec)](),_0x2ff00f=new TextDecoder(),_0x50bd42='';while(this[_0x523ef3(0x1eb)]){let {done:_0x55c729,value:_0x2578a7}=await _0x3f5d9c[_0x523ef3(0x21b)]();if(_0x55c729)break;_0x50bd42+=_0x2ff00f[_0x523ef3(0x241)](_0x2578a7,{'stream':!0x0});let _0xa11feb=_0x50bd42[_0x523ef3(0x21f)]('\x0a');_0x50bd42=_0xa11feb[_0x523ef3(0x20f)]()||'';for(let _0x35fd31 of _0xa11feb){if(!_0x35fd31[_0x523ef3(0x1f1)](_0x523ef3(0x1f2)))continue;try{let _0x132c94=JSON['parse'](_0x35fd31[_0x523ef3(0x23d)](0x6));if(_0x132c94[_0x523ef3(0x203)]==='connected'){this[_0x523ef3(0x237)]('SSE\x20connected'),this['emit'](_0x523ef3(0x1fa));continue;}if(_0x132c94['type']===_0x523ef3(0x214)||_0x132c94[_0x523ef3(0x203)]===_0x523ef3(0x232)||_0x132c94['type']===_0x523ef3(0x218))await this[_0x523ef3(0x1ed)]();}catch{}}}}catch(_0x1b52c9){if(_0x1b52c9[_0x523ef3(0x244)]===_0x523ef3(0x212))break;this[_0x523ef3(0x211)]('error',_0x1b52c9),this[_0x523ef3(0x237)](_0x523ef3(0x1ef)+_0x1b52c9[_0x523ef3(0x1fc)]);}if(this[_0x523ef3(0x1eb)])this[_0x523ef3(0x211)](_0x523ef3(0x20b)),this['log']('SSE\x20reconnecting\x20in\x20'+_0x2fea82/0x3e8+_0x523ef3(0x215)),await this[_0x523ef3(0x21a)](_0x2fea82),_0x2fea82=Math[_0x523ef3(0x20a)](_0x2fea82*1.5,0xea60);}}async[a0_0xbb3ad0(0x1ed)](){const _0x301b23=a0_0xbb3ad0;try{let _0x14c6a7=(await this[_0x301b23(0x1ff)]('get_inbox',{'alias':this[_0x301b23(0x20e)],'limit':0xa}))?.[_0x301b23(0x222)]||[];for(let _0x2be002 of _0x14c6a7)await this[_0x301b23(0x1ff)](_0x301b23(0x223),{'alias':this[_0x301b23(0x20e)],'message_id':_0x2be002['id']}),this[_0x301b23(0x237)]('←\x20'+_0x2be002[_0x301b23(0x220)]+':\x20'+_0x2be002[_0x301b23(0x22c)][_0x301b23(0x23d)](0x0,0x3c)),this[_0x301b23(0x211)]('task',_0x2be002),this['emit'](_0x301b23(0x1fc),_0x2be002);}catch(_0x18eb05){this[_0x301b23(0x237)](_0x301b23(0x242)+_0x18eb05[_0x301b23(0x1fc)]);}}[a0_0xbb3ad0(0x21a)](_0x431e25){return new Promise(_0x3a1a32=>setTimeout(_0x3a1a32,_0x431e25));}}var $=T;export{$ as default,T as CommHub};function a0_0x12fa(){const _0x3e0c1d=['startsWith','data:\x20','text','14259hwPLXY','match','now','tools/call','sseAbort','4tbUlDE','connected','1662qNGqDV','message','abort','application/json','call','2.0','4083015JnRNAQ','/mcp','type','reconnectDelay','send_task','5546405cqfjWq','send','send_reply','url','min','disconnected','catch','disconnect','alias','pop','heartbeat\x20failed:\x20','emit','AbortError','send_message','new_task','s...','43RtEPVs','resumeId','broadcast','idle','sleep','read','text/event-stream','Bearer\x20','server','split','from_session','getAllStatus','messages','ack_inbox','status','agent','completed','SSE\x20failed:\x20','signal','toString','application/json,\x20text/event-stream','stringify','content','324376Tnxxmm','replace','offline','10602243auYtMb','parse','new_message','token','toTimeString','reply','connect','log','Authorization','connectSSE','1537833zUkVyM','registered','sdk','slice','report_status','heartbeatInterval','POST','decode','inbox\x20error:\x20','62114pkkbCL','name','body','running','getReader','processInbox','heartbeatTimer','SSE\x20error:\x20','30enNgBT'];a0_0x12fa=function(){return _0x3e0c1d;};return a0_0x12fa();}
1
+ const a0_0x43ce91=a0_0x391e;function a0_0x2034(){const _0x325e9e=['result','send_task','text','disconnected','SSE\x20connected','/events/','529705ZVyCRc','sdk-','get_all_status','status','cwd','agent','1575qllBZJ','registered','2902250emYWLo','new_task','159369IQJbaz','processInbox','send_reply','split','sdk','reconnectDelay','2127220TFwxLE','read','call','running','disconnect','catch','token','heartbeatTimer','autoConnect','completed','connected','startsWith','signal','new_message','emit','resumeId','sseAbort','decode','SSE\x20error:\x20','min','error','broadcast','report_status','data:\x20','log','url','body','abort','43060DjwpDA','server','slice','connect','heartbeatInterval','toTimeString','messages','pop','replace','4693328wnTrdo','561090yRemVQ','SSE\x20reconnecting\x20in\x20','connectSSE','alias','48pHoCVo','inbox\x20error:\x20','from_session','heartbeat\x20failed:\x20','name','message','toString','s...','match','content','type','now','task',']\x20[commhub:','parse','sleep','Bearer\x20','3zbGWYu','text/event-stream','Authorization'];a0_0x2034=function(){return _0x325e9e;};return a0_0x2034();}(function(_0x58e4a4,_0x54add2){const _0x18b0a5=a0_0x391e,_0x5de283=_0x58e4a4();while(!![]){try{const _0x486c6e=-parseInt(_0x18b0a5(0x1d4))/0x1+-parseInt(_0x18b0a5(0x1b6))/0x2+parseInt(_0x18b0a5(0x1cb))/0x3*(parseInt(_0x18b0a5(0x1e4))/0x4)+-parseInt(_0x18b0a5(0x1dc))/0x5+-parseInt(_0x18b0a5(0x1ba))/0x6*(parseInt(_0x18b0a5(0x1de))/0x7)+parseInt(_0x18b0a5(0x1b5))/0x8+-parseInt(_0x18b0a5(0x1da))/0x9*(-parseInt(_0x18b0a5(0x200))/0xa);if(_0x486c6e===_0x54add2)break;else _0x5de283['push'](_0x5de283['shift']());}catch(_0x5ec729){_0x5de283['push'](_0x5de283['shift']());}}}(a0_0x2034,0x490b1));import{EventEmitter as a0_0x482d50}from'events';import{hostname as a0_0x32dbe8}from'os';function a0_0x391e(_0x171961,_0x2612a1){_0x171961=_0x171961-0x1ae;const _0x20347a=a0_0x2034();let _0x391e95=_0x20347a[_0x171961];return _0x391e95;}class T extends a0_0x482d50{[a0_0x43ce91(0x1fd)];[a0_0x43ce91(0x1b9)];['token'];[a0_0x43ce91(0x1d9)];[a0_0x43ce91(0x1f3)];[a0_0x43ce91(0x1b0)];[a0_0x43ce91(0x1e3)];[a0_0x43ce91(0x1eb)];['sseAbort'];['running']=!0x1;constructor(_0xd80e1b){const _0x59166b=a0_0x43ce91;super();if(this['url']=_0xd80e1b[_0x59166b(0x1fd)][_0x59166b(0x1b4)](/\/$/,''),this[_0x59166b(0x1b9)]=_0xd80e1b['alias'],this[_0x59166b(0x1ea)]=_0xd80e1b[_0x59166b(0x1ea)],this['agent']=_0xd80e1b[_0x59166b(0x1d9)]||_0x59166b(0x1e2),this[_0x59166b(0x1f3)]=_0x59166b(0x1d5)+_0xd80e1b['alias']+'-'+Date['now']()[_0x59166b(0x1c0)](0x24),this[_0x59166b(0x1b0)]=_0xd80e1b[_0x59166b(0x1b0)]??0x2bf20,this['reconnectDelay']=_0xd80e1b['reconnectDelay']??0xbb8,_0xd80e1b[_0x59166b(0x1ec)]!==!0x1)this[_0x59166b(0x1af)]();}['log'](_0x198e10){const _0x312c68=a0_0x43ce91;console[_0x312c68(0x1fc)]('['+new Date()[_0x312c68(0x1b1)]()[_0x312c68(0x1ae)](0x0,0x8)+_0x312c68(0x1c7)+this[_0x312c68(0x1b9)]+']\x20'+_0x198e10);}async[a0_0x43ce91(0x1e6)](_0x4aacdc,_0x618fc8){const _0x1cb756=a0_0x43ce91;let _0x1c5b76={'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream'};if(this['token'])_0x1c5b76[_0x1cb756(0x1cd)]=_0x1cb756(0x1ca)+this['token'];let _0x92ce69=await(await fetch(this[_0x1cb756(0x1fd)]+'/mcp',{'method':'POST','headers':_0x1c5b76,'body':JSON['stringify']({'jsonrpc':'2.0','id':Date[_0x1cb756(0x1c5)](),'method':'tools/call','params':{'name':_0x4aacdc,'arguments':_0x618fc8}})}))[_0x1cb756(0x1d0)](),_0x4aed3a=_0x92ce69[_0x1cb756(0x1c2)](/data: (.+)/),_0x25027b=_0x4aed3a?JSON[_0x1cb756(0x1c8)](_0x4aed3a[0x1]):JSON[_0x1cb756(0x1c8)](_0x92ce69),_0x13b09f=_0x25027b?.[_0x1cb756(0x1ce)]?.[_0x1cb756(0x1c3)]?.[0x0]?.['text'];return _0x13b09f?JSON[_0x1cb756(0x1c8)](_0x13b09f):_0x25027b;}async[a0_0x43ce91(0x1af)](){const _0x3f2d23=a0_0x43ce91;if(this[_0x3f2d23(0x1e7)])return;this['running']=!0x0,await this['status']('idle'),this[_0x3f2d23(0x1fc)](_0x3f2d23(0x1db)),this[_0x3f2d23(0x1eb)]=setInterval(()=>{const _0x49be39=_0x3f2d23;this[_0x49be39(0x1d7)]('idle')['catch'](_0x357419=>this[_0x49be39(0x1fc)](_0x49be39(0x1bd)+_0x357419['message']));},this[_0x3f2d23(0x1b0)]),this[_0x3f2d23(0x1b8)]();}async[a0_0x43ce91(0x1e8)](){const _0x2194e0=a0_0x43ce91;if(this['running']=!0x1,this[_0x2194e0(0x1f4)]?.[_0x2194e0(0x1ff)](),this[_0x2194e0(0x1eb)])clearInterval(this['heartbeatTimer']);await this[_0x2194e0(0x1d7)]('offline')[_0x2194e0(0x1e9)](()=>{}),this[_0x2194e0(0x1fc)](_0x2194e0(0x1d1));}async['send'](_0x12882d,_0x349417,_0x4a65d4='normal'){const _0x24d2f6=a0_0x43ce91;return this['call'](_0x24d2f6(0x1cf),{'alias':_0x12882d,'task':_0x349417,'priority':_0x4a65d4,'from_session':this['alias']});}async[a0_0x43ce91(0x1bf)](_0x2ee483,_0xbf2f09){const _0x8d2a1e=a0_0x43ce91;return this[_0x8d2a1e(0x1e6)]('send_message',{'alias':_0x2ee483,'message':_0xbf2f09,'from_session':this[_0x8d2a1e(0x1b9)]});}async['reply'](_0x5dc572,_0x21cdf0,_0x201a7d=a0_0x43ce91(0x1ed)){const _0x95094b=a0_0x43ce91;return this[_0x95094b(0x1e6)](_0x95094b(0x1e0),{'in_reply_to':_0x5dc572,'text':_0x21cdf0,'status':_0x201a7d});}async[a0_0x43ce91(0x1d7)](_0x407f9b,_0x58896d){const _0xfc31b0=a0_0x43ce91;return this[_0xfc31b0(0x1e6)](_0xfc31b0(0x1fa),{'resume_id':this[_0xfc31b0(0x1f3)],'alias':this[_0xfc31b0(0x1b9)],'status':_0x407f9b,'server':a0_0x32dbe8(),'hostname':a0_0x32dbe8(),'agent':this[_0xfc31b0(0x1d9)],'project_dir':process[_0xfc31b0(0x1d8)](),..._0x58896d});}async['getAllStatus'](){const _0x39496a=a0_0x43ce91;return this['call'](_0x39496a(0x1d6),{});}async['broadcast'](_0xe5c491,_0x119850){const _0x3f5a25=a0_0x43ce91;return this['call'](_0x3f5a25(0x1f9),{'message':_0xe5c491,'filter_server':_0x119850?.[_0x3f5a25(0x201)],'filter_status':_0x119850?.[_0x3f5a25(0x1d7)]});}async[a0_0x43ce91(0x1b8)](){const _0x55f0de=a0_0x43ce91;let _0x1fb1f4=encodeURIComponent(this[_0x55f0de(0x1b9)]),_0x92b6e6=this['url']+_0x55f0de(0x1d3)+_0x1fb1f4,_0x60158b=this[_0x55f0de(0x1e3)];while(this[_0x55f0de(0x1e7)]){try{this[_0x55f0de(0x1f4)]=new AbortController();let _0x2b2c3f={'Accept':_0x55f0de(0x1cc)};if(this[_0x55f0de(0x1ea)])_0x2b2c3f[_0x55f0de(0x1cd)]=_0x55f0de(0x1ca)+this[_0x55f0de(0x1ea)];let _0xe9d468=await fetch(_0x92b6e6,{'headers':_0x2b2c3f,'signal':this[_0x55f0de(0x1f4)][_0x55f0de(0x1f0)]});if(!_0xe9d468['ok']||!_0xe9d468['body']){this[_0x55f0de(0x1fc)]('SSE\x20failed:\x20'+_0xe9d468[_0x55f0de(0x1d7)]),await this[_0x55f0de(0x1c9)](_0x60158b),_0x60158b=Math[_0x55f0de(0x1f7)](_0x60158b*1.5,0xea60);continue;}_0x60158b=this[_0x55f0de(0x1e3)];let _0x26c097=_0xe9d468[_0x55f0de(0x1fe)]['getReader'](),_0x5a1cb9=new TextDecoder(),_0x5dd59e='';while(this[_0x55f0de(0x1e7)]){let {done:_0x4b7549,value:_0x5ddcc2}=await _0x26c097[_0x55f0de(0x1e5)]();if(_0x4b7549)break;_0x5dd59e+=_0x5a1cb9[_0x55f0de(0x1f5)](_0x5ddcc2,{'stream':!0x0});let _0x6d5bf2=_0x5dd59e[_0x55f0de(0x1e1)]('\x0a');_0x5dd59e=_0x6d5bf2[_0x55f0de(0x1b3)]()||'';for(let _0x4a7d66 of _0x6d5bf2){if(!_0x4a7d66[_0x55f0de(0x1ef)](_0x55f0de(0x1fb)))continue;try{let _0x2bfb12=JSON['parse'](_0x4a7d66[_0x55f0de(0x1ae)](0x6));if(_0x2bfb12[_0x55f0de(0x1c4)]===_0x55f0de(0x1ee)){this[_0x55f0de(0x1fc)](_0x55f0de(0x1d2)),this[_0x55f0de(0x1f2)]('connected');continue;}if(_0x2bfb12[_0x55f0de(0x1c4)]===_0x55f0de(0x1dd)||_0x2bfb12[_0x55f0de(0x1c4)]===_0x55f0de(0x1f1)||_0x2bfb12[_0x55f0de(0x1c4)]===_0x55f0de(0x1f9))await this[_0x55f0de(0x1df)]();}catch{}}}}catch(_0x54e5c2){if(_0x54e5c2[_0x55f0de(0x1be)]==='AbortError')break;this[_0x55f0de(0x1f2)](_0x55f0de(0x1f8),_0x54e5c2),this['log'](_0x55f0de(0x1f6)+_0x54e5c2[_0x55f0de(0x1bf)]);}if(this[_0x55f0de(0x1e7)])this[_0x55f0de(0x1f2)](_0x55f0de(0x1d1)),this[_0x55f0de(0x1fc)](_0x55f0de(0x1b7)+_0x60158b/0x3e8+_0x55f0de(0x1c1)),await this[_0x55f0de(0x1c9)](_0x60158b),_0x60158b=Math['min'](_0x60158b*1.5,0xea60);}}async[a0_0x43ce91(0x1df)](){const _0x5774e5=a0_0x43ce91;try{let _0xaa0b4a=(await this['call']('get_inbox',{'alias':this[_0x5774e5(0x1b9)],'limit':0xa}))?.[_0x5774e5(0x1b2)]||[];for(let _0x380e79 of _0xaa0b4a)await this[_0x5774e5(0x1e6)]('ack_inbox',{'alias':this[_0x5774e5(0x1b9)],'message_id':_0x380e79['id']}),this[_0x5774e5(0x1fc)]('←\x20'+_0x380e79[_0x5774e5(0x1bc)]+':\x20'+_0x380e79[_0x5774e5(0x1c3)][_0x5774e5(0x1ae)](0x0,0x3c)),this[_0x5774e5(0x1f2)](_0x5774e5(0x1c6),_0x380e79),this[_0x5774e5(0x1f2)](_0x5774e5(0x1bf),_0x380e79);}catch(_0x3c67f0){this['log'](_0x5774e5(0x1bb)+_0x3c67f0['message']);}}[a0_0x43ce91(0x1c9)](_0x3d6ef9){return new Promise(_0x24373e=>setTimeout(_0x24373e,_0x3d6ef9));}}var $=T;export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x351f11=a0_0x49ca;(function(_0x22ed0a,_0x1bd563){const _0x3f377c=a0_0x49ca,_0x3d5a83=_0x22ed0a();while(!![]){try{const _0x2ecdec=parseInt(_0x3f377c(0xbc))/0x1+-parseInt(_0x3f377c(0x12d))/0x2*(-parseInt(_0x3f377c(0xaf))/0x3)+parseInt(_0x3f377c(0x100))/0x4+-parseInt(_0x3f377c(0xf1))/0x5*(-parseInt(_0x3f377c(0xd6))/0x6)+-parseInt(_0x3f377c(0x102))/0x7*(parseInt(_0x3f377c(0xd3))/0x8)+-parseInt(_0x3f377c(0xe3))/0x9+-parseInt(_0x3f377c(0xd2))/0xa;if(_0x2ecdec===_0x1bd563)break;else _0x3d5a83['push'](_0x3d5a83['shift']());}catch(_0x73e046){_0x3d5a83['push'](_0x3d5a83['shift']());}}}(a0_0xb269,0xbb915));import{readFileSync as a0_0x1a76b2,existsSync as a0_0x1cd2ad}from'fs';import{randomUUID as a0_0x23172e}from'crypto';import{join as a0_0x43c506}from'path';import{hostname as a0_0x348e80}from'os';import{execSync as a0_0x312f12}from'child_process';import{Server as a0_0x19231d}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x19f304}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x1a0704,CallToolRequestSchema as a0_0x44b358}from'@modelcontextprotocol/sdk/types.js';function p(_0x22fea8){const _0x4bddb9=a0_0x49ca;if(!a0_0x1cd2ad(_0x22fea8))return;for(let _0x127d34 of a0_0x1a76b2(_0x22fea8,'utf-8')[_0x4bddb9(0xbb)]('\x0a')){let _0x57581b=_0x127d34['trim']();if(!_0x57581b||_0x57581b['startsWith']('#'))continue;let _0x1f218c=_0x57581b[_0x4bddb9(0xd9)]('=');if(_0x1f218c<0x0)continue;let _0x4576ad=_0x57581b['slice'](0x0,_0x1f218c)[_0x4bddb9(0x104)](),_0x39af5f=_0x57581b[_0x4bddb9(0xa6)](_0x1f218c+0x1)[_0x4bddb9(0x104)]()[_0x4bddb9(0x10f)](/^["']|["']$/g,'');if(!process.env[_0x4576ad])process.env[_0x4576ad]=_0x39af5f;}}var C=process.env.HOME||'~',T=a0_0x43c506(C,a0_0x351f11(0xd8));p(a0_0x43c506(T,a0_0x351f11(0x124)));var L=process['cwd']()[a0_0x351f11(0x10f)](/\//g,'-');p(a0_0x43c506(T,L,a0_0x351f11(0x124)));function U(){const _0x524df8=a0_0x351f11;try{return a0_0x312f12(_0x524df8(0xdb),{'encoding':_0x524df8(0xf7),'timeout':0x7d0})[_0x524df8(0x104)]();}catch{return'';}}function v(){const _0x15f509=a0_0x351f11;try{let _0x14c83d=a0_0x43c506(C,_0x15f509(0xd7),'config.json');if(a0_0x1cd2ad(_0x14c83d))return JSON[_0x15f509(0x103)](a0_0x1a76b2(_0x14c83d,'utf-8'));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x351f11(0xb5)]||a0_0x351f11(0xce),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x348e80(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x23172e(),X=process.env.COMMHUB_TOKEN||H[a0_0x351f11(0xfa)]||'';function Y(_0x2a9f17){const _0x92d34a=a0_0x351f11;let _0x5ac4b4=new Date()[_0x92d34a(0xf0)]()[_0x92d34a(0xa6)](0x0,0x8);process[_0x92d34a(0xcf)][_0x92d34a(0xc9)]('['+_0x5ac4b4+']\x20[commhub]\x20'+_0x2a9f17+'\x0a');}function a0_0x49ca(_0x4fd8b2,_0x400116){_0x4fd8b2=_0x4fd8b2-0xa6;const _0xb269b=a0_0xb269();let _0x49ca74=_0xb269b[_0x4fd8b2];return _0x49ca74;}function h(_0x58d150){return new Promise(_0x181db2=>setTimeout(_0x181db2,_0x58d150));}function a0_0xb269(){const _0x5c540a=['shutting\x20down,\x20reporting\x20offline...','tmux\x20display-message\x20-p\x20\x27#S\x27','connecting\x20to\x20','Progress\x200-100','type','stdin','claude-code','exit','ENV:\x20URL=','3256551adwKoc','catch','application/json,\x20text/event-stream','MCP\x20stdio\x20connected','SSE\x20error:\x20','fatal:\x20','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','→\x20injected\x20task\x20','Session\x20alias:\x20','working','status','starting\x20SSE\x20listener...','number','toTimeString','108370EjVcDX','unknown\x20tool','Current\x20task\x20description','join','message_id','send_reply','utf-8','report_status','connect','token','params','Bearer\x20','replied','cwd','\x20RESUME_ID=','1726440YiQvRr','2.0','10171EwtAWV','parse','trim','0.3.0','broadcast','getReader','get','session\x20disconnected','commhub','notification','task','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','ack_inbox','replace','←\x20message\x20from\x20','low','startsWith','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','messages','commhub_reply','delete','heartbeat\x20failed:\x20','application/json','stringify','Message\x20content','commhub_send_task','commhub_get_all_status','parse\x20error:\x20','in_progress','string','commhub_report_status','from','result','ready\x20—\x20waiting\x20for\x20events','.env','failed','setRequestHandler','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','blocked','Authorization','Reply\x20text\x20/\x20result\x20summary','find','SSE\x20connected\x20as\x20\x22','6MPtdxz','/events/','set','send_task','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','content','commhub-channel','Target\x20session\x20alias','read','idle','slice','...\x20TMUX=','then','registered\x20as\x20\x22','pop','object','completed','CommHub\x20init\x20failed:\x20','Task\x20content','239313cMEXWy','text','statusText','priority','cancelled','SIGTERM','hub','\x20from\x20','alias','decode','\x22\x20(','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','split','242673HMbfuj','body','message','Priority\x20(default:\x20normal)','from_session','\x20CWD=','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','send_message','high','none','notifications/claude/channel','length','SIGINT','write','\x20priority=','error','connected','initialize','http://127.0.0.1:9200','stderr','normal','POST','3306610kylMva','4744tuxwTc','no\x20response','new_message','390AbUQEO','.anet','.claude/channels/commhub','indexOf'];a0_0xb269=function(){return _0x5c540a;};return a0_0xb269();}Y(a0_0x351f11(0xe2)+f+'\x20ALIAS='+Z+a0_0x351f11(0xff)+w['slice'](0x0,0x8)+a0_0x351f11(0xa7)+(j||a0_0x351f11(0xc5))+a0_0x351f11(0xc1)+process['cwd']()+'\x20PROJECT_ENV='+L);var k=new Map(),K=new a0_0x19231d({'name':a0_0x351f11(0x133),'version':a0_0x351f11(0x105)},{'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_0x351f11(0x127),a0_0x351f11(0xba),a0_0x351f11(0x113),a0_0x351f11(0xeb)+Z][a0_0x351f11(0xf4)]('\x0a')});K[a0_0x351f11(0x126)](a0_0x1a0704,async()=>({'tools':[{'name':a0_0x351f11(0x115),'description':'Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','inputSchema':{'type':a0_0x351f11(0xab),'properties':{'task_id':{'type':a0_0x351f11(0x11f),'description':'The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)'},'text':{'type':'string','description':a0_0x351f11(0x12a)},'status':{'type':'string','enum':[a0_0x351f11(0xac),a0_0x351f11(0x125),a0_0x351f11(0xb3),a0_0x351f11(0x128),'error',a0_0x351f11(0x11e)],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':[a0_0x351f11(0xb0)]}},{'name':a0_0x351f11(0x120),'description':a0_0x351f11(0xc2),'inputSchema':{'type':a0_0x351f11(0xab),'properties':{'status':{'type':a0_0x351f11(0x11f),'enum':[a0_0x351f11(0xec),a0_0x351f11(0x136),'blocked',a0_0x351f11(0xcb)]},'task':{'type':a0_0x351f11(0x11f),'description':a0_0x351f11(0xf3)},'progress':{'type':a0_0x351f11(0xef),'description':a0_0x351f11(0xdd)}},'required':[a0_0x351f11(0xed)]}},{'name':a0_0x351f11(0x11b),'description':a0_0x351f11(0xe9),'inputSchema':{'type':a0_0x351f11(0xab),'properties':{'alias':{'type':'string','description':a0_0x351f11(0x134)},'task':{'type':a0_0x351f11(0x11f),'description':a0_0x351f11(0xae)},'priority':{'type':a0_0x351f11(0x11f),'enum':[a0_0x351f11(0xc4),a0_0x351f11(0xd0),a0_0x351f11(0x111)],'description':a0_0x351f11(0xbf)}},'required':['alias',a0_0x351f11(0x10c)]}},{'name':'commhub_send_message','description':a0_0x351f11(0x10d),'inputSchema':{'type':a0_0x351f11(0xab),'properties':{'alias':{'type':a0_0x351f11(0x11f),'description':a0_0x351f11(0x134)},'message':{'type':a0_0x351f11(0x11f),'description':a0_0x351f11(0x11a)}},'required':[a0_0x351f11(0xb7),a0_0x351f11(0xbe)]}},{'name':a0_0x351f11(0x11c),'description':a0_0x351f11(0x131),'inputSchema':{'type':a0_0x351f11(0xab),'properties':{}}}]}));async function P(_0x257743,_0x41046d){const _0x42026e=a0_0x351f11;let _0x13f529=await fetch(f+'/mcp',{'method':_0x42026e(0xd1),'headers':{'Content-Type':_0x42026e(0x118),'Accept':_0x42026e(0xe5),...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON[_0x42026e(0x119)]({'jsonrpc':_0x42026e(0x101),'id':0x1,'method':_0x42026e(0xcd),'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':'commhub-channel','version':_0x42026e(0x105)}}})});if(!_0x13f529['ok']){let _0x59867e=await _0x13f529['text']();return Y(_0x42026e(0xad)+_0x13f529['status']+'\x20'+_0x59867e['slice'](0x0,0x64)),{'ok':!0x1,'error':'init\x20failed:\x20'+_0x13f529['status']};}await _0x13f529[_0x42026e(0xb0)]();let _0x2ef0a6=(await(await fetch(f+'/mcp',{'method':_0x42026e(0xd1),'headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x42026e(0xfc)+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x42026e(0x101),'id':0x2,'method':'tools/call','params':{'name':_0x257743,'arguments':_0x41046d}})}))[_0x42026e(0xb0)]())['split']('\x0a')['find'](_0x4788cb=>_0x4788cb[_0x42026e(0x112)]('data:\x20'));if(_0x2ef0a6){let _0x58285e=JSON[_0x42026e(0x103)](_0x2ef0a6['slice'](0x6));return _0x58285e?.[_0x42026e(0x122)]?.[_0x42026e(0x132)]?.[0x0]?.[_0x42026e(0xb0)]?JSON[_0x42026e(0x103)](_0x58285e[_0x42026e(0x122)][_0x42026e(0x132)][0x0][_0x42026e(0xb0)]):_0x58285e;}return{'ok':!0x1,'error':_0x42026e(0xd4)};}K[a0_0x351f11(0x126)](a0_0x44b358,async _0x340c26=>{const _0x524d00=a0_0x351f11;let {name:_0x39f733,arguments:_0x3cdede}=_0x340c26[_0x524d00(0xfb)];if(_0x39f733==='commhub_reply'){let {task_id:_0x485cdd,text:_0xb5ff97,status:_0x2e6b0b}=_0x3cdede;if(_0x2e6b0b===_0x524d00(0xac)||_0x2e6b0b===_0x524d00(0x125)||_0x2e6b0b===_0x524d00(0xb3)){let _0x1a85e3=_0x2e6b0b===_0x524d00(0xac)?_0x524d00(0xfd):_0x2e6b0b,_0x3a58be=_0x485cdd?k[_0x524d00(0x108)](_0x485cdd)||_0x524d00(0xb5):_0x524d00(0xb5),_0x4c97ac=await P(_0x524d00(0xf6),{'alias':_0x3a58be,'text':_0xb5ff97,'in_reply_to':_0x485cdd||void 0x0,'status':_0x1a85e3,'from_session':Z});if(_0x485cdd)k[_0x524d00(0x116)](_0x485cdd);return{'content':[{'type':_0x524d00(0xb0),'text':JSON['stringify'](_0x4c97ac)}]};}let _0x3eff8d=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x2e6b0b==='blocked'?'blocked':_0x2e6b0b===_0x524d00(0xcb)?_0x524d00(0xcb):'working','task':_0xb5ff97[_0x524d00(0xa6)](0x0,0xc8),'output':_0xb5ff97});return{'content':[{'type':'text','text':JSON[_0x524d00(0x119)](_0x3eff8d)}]};}if(_0x39f733===_0x524d00(0x120)){let {status:_0x11b92c,task:_0x4d25f0,progress:_0x477b41}=_0x3cdede,_0x1ec9a2=await P(_0x524d00(0xf8),{'resume_id':w,'alias':Z,'status':_0x11b92c,'task':_0x4d25f0,'progress':_0x477b41});return{'content':[{'type':_0x524d00(0xb0),'text':JSON['stringify'](_0x1ec9a2)}]};}if(_0x39f733===_0x524d00(0x11b)){let {alias:_0x362109,task:_0x27c14d,priority:_0x4892a2}=_0x3cdede,_0x492b04=await P(_0x524d00(0x130),{'alias':_0x362109,'task':_0x27c14d,'priority':_0x4892a2||_0x524d00(0xd0),'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x524d00(0x119)](_0x492b04)}]};}if(_0x39f733==='commhub_send_message'){let {alias:_0x58d0fc,message:_0x2bb205}=_0x3cdede,_0x46b454=await P(_0x524d00(0xc3),{'alias':_0x58d0fc,'message':_0x2bb205,'from_session':Z});return{'content':[{'type':_0x524d00(0xb0),'text':JSON['stringify'](_0x46b454)}]};}if(_0x39f733==='commhub_get_all_status'){let _0x4439aa=await P('get_all_status',{});return{'content':[{'type':_0x524d00(0xb0),'text':JSON[_0x524d00(0x119)](_0x4439aa)}]};}return{'content':[{'type':'text','text':JSON[_0x524d00(0x119)]({'error':_0x524d00(0xf2)})}]};});async function u(){const _0x597428=a0_0x351f11;let _0x12d3a2=f+_0x597428(0x12e)+encodeURIComponent(Z),_0x58e07a={};if(X)_0x58e07a[_0x597428(0x129)]='Bearer\x20'+X;Y(_0x597428(0xdc)+_0x12d3a2);while(!0x0){try{let _0x2916be=await fetch(_0x12d3a2,{'headers':_0x58e07a});if(!_0x2916be['ok']){Y(_0x597428(0xe7)+_0x2916be[_0x597428(0xed)]+'\x20'+_0x2916be[_0x597428(0xb1)]),await h(0x1388);continue;}let _0x3ec6f1=_0x2916be[_0x597428(0xbd)][_0x597428(0x107)](),_0x58e6f5=new TextDecoder(),_0x11275d='';while(!0x0){let {done:_0x41a197,value:_0x29682e}=await _0x3ec6f1[_0x597428(0x135)]();if(_0x41a197)break;_0x11275d+=_0x58e6f5[_0x597428(0xb8)](_0x29682e,{'stream':!0x0});let _0x114ed6=_0x11275d['split']('\x0a\x0a');_0x11275d=_0x114ed6[_0x597428(0xaa)]()||'';for(let _0x170ae8 of _0x114ed6){let _0x32132e=_0x170ae8[_0x597428(0xbb)]('\x0a')[_0x597428(0x12b)](_0x30227c=>_0x30227c[_0x597428(0x112)]('data:\x20'));if(!_0x32132e)continue;try{let _0x52f729=JSON[_0x597428(0x103)](_0x32132e[_0x597428(0xa6)](0x6));await S(_0x52f729);}catch(_0xd0bbb8){Y(_0x597428(0x11d)+_0xd0bbb8);}}}Y('SSE\x20stream\x20ended,\x20reconnecting...');}catch(_0x3d3278){Y('SSE\x20connection\x20error:\x20'+_0x3d3278);}await h(0xbb8);}}async function S(_0xedc6cb){const _0x137dd9=a0_0x351f11;if(_0xedc6cb['type']===_0x137dd9(0xcc)){Y(_0x137dd9(0x12c)+Z+'\x22');return;}if(_0xedc6cb[_0x137dd9(0xde)]===_0x137dd9(0xd5)){if(Y(_0x137dd9(0x110)+_0xedc6cb[_0x137dd9(0x121)]+':\x20'+_0xedc6cb[_0x137dd9(0xbe)][_0x137dd9(0xa6)](0x0,0x3c)),await K[_0x137dd9(0x10b)]({'method':'notifications/claude/channel','params':{'content':_0xedc6cb[_0x137dd9(0xbe)],'meta':{'sender':_0xedc6cb[_0x137dd9(0x121)]||_0x137dd9(0xb5),'sender_id':_0x137dd9(0x10a),'user':_0xedc6cb[_0x137dd9(0x121)]||'hub','priority':_0x137dd9(0xd0)}}}),_0xedc6cb[_0x137dd9(0xf5)])await P(_0x137dd9(0x10e),{'alias':Z,'message_id':_0xedc6cb['message_id']});return;}if(_0xedc6cb['type']==='new_task'||_0xedc6cb[_0x137dd9(0xde)]===_0x137dd9(0x106)){Y('←\x20'+_0xedc6cb[_0x137dd9(0xde)]+':\x20inbox_count='+_0xedc6cb['inbox_count']+_0x137dd9(0xca)+(_0xedc6cb[_0x137dd9(0xb2)]||_0x137dd9(0xd0)));let _0xdde97c=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0xdde97c?.['ok']&&_0xdde97c[_0x137dd9(0x114)]?.[_0x137dd9(0xc7)]>0x0)for(let _0x1fd642 of _0xdde97c[_0x137dd9(0x114)]){let _0x11c27f={'sender':_0x1fd642[_0x137dd9(0xc0)]||_0x137dd9(0xb5),'sender_id':'commhub','user':_0x1fd642['from_session']||_0x137dd9(0xb5),'task_id':_0x1fd642['id'],'priority':_0x1fd642['priority']||_0x137dd9(0xd0)};k[_0x137dd9(0x12f)](_0x1fd642['id'],_0x1fd642[_0x137dd9(0xc0)]||'hub'),await K[_0x137dd9(0x10b)]({'method':_0x137dd9(0xc6),'params':{'content':_0x1fd642[_0x137dd9(0x132)],'meta':_0x11c27f}}),Y(_0x137dd9(0xea)+_0x1fd642['id'][_0x137dd9(0xa6)](0x0,0x8)+_0x137dd9(0xb6)+_0x1fd642[_0x137dd9(0xc0)]+':\x20'+_0x1fd642[_0x137dd9(0x132)][_0x137dd9(0xa6)](0x0,0x3c)),await P(_0x137dd9(0x10e),{'alias':Z,'message_id':_0x1fd642['id']});}}}async function A(){const _0x331ca0=a0_0x351f11;let _0xee9870=new a0_0x19f304();await K[_0x331ca0(0xf9)](_0xee9870),Y(_0x331ca0(0xe6)),Y(_0x331ca0(0xee)),u()['catch'](_0x45a825=>Y('SSE\x20fatal:\x20'+_0x45a825)),P('report_status',{'resume_id':w,'alias':Z,'status':_0x331ca0(0x136),'server':a0_0x348e80(),'hostname':a0_0x348e80(),'agent':_0x331ca0(0xe0),'project_dir':process[_0x331ca0(0xfe)](),'tmux_name':j||void 0x0})[_0x331ca0(0xa8)](()=>Y(_0x331ca0(0xa9)+Z+_0x331ca0(0xb9)+w['slice'](0x0,0x8)+')'))[_0x331ca0(0xe4)](_0x5c8306=>Y('warning:\x20could\x20not\x20register:\x20'+_0x5c8306)),setInterval(()=>{const _0x23b2e5=_0x331ca0;P(_0x23b2e5(0xf8),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x348e80(),'hostname':a0_0x348e80(),'agent':_0x23b2e5(0xe0),'project_dir':process[_0x23b2e5(0xfe)](),'tmux_name':j||void 0x0})['catch'](_0x221d85=>Y(_0x23b2e5(0x117)+_0x221d85));},0x2bf20),Y(_0x331ca0(0x123));}A()[a0_0x351f11(0xe4)](_0x4d94cb=>{const _0x56435f=a0_0x351f11;Y(_0x56435f(0xe8)+_0x4d94cb),process['exit'](0x1);});async function N(){const _0x8fe95=a0_0x351f11;Y(_0x8fe95(0xda)),await P('report_status',{'resume_id':w,'alias':Z,'status':_0x8fe95(0xcb),'task':_0x8fe95(0x109)})['catch'](()=>{}),process[_0x8fe95(0xe1)](0x0);}process[a0_0x351f11(0xdf)]['on']('end',()=>N()),process['on'](a0_0x351f11(0xb4),()=>N()),process['on'](a0_0x351f11(0xc8),()=>N());
2
+ const a0_0x5126d1=a0_0x5c8c;(function(_0x2974b4,_0x3edda7){const _0x565834=a0_0x5c8c,_0x3ebfee=_0x2974b4();while(!![]){try{const _0x4ed6d2=parseInt(_0x565834(0x1b9))/0x1*(-parseInt(_0x565834(0x1dd))/0x2)+-parseInt(_0x565834(0x1c3))/0x3+parseInt(_0x565834(0x1fa))/0x4*(-parseInt(_0x565834(0x22a))/0x5)+parseInt(_0x565834(0x1c0))/0x6+-parseInt(_0x565834(0x1cb))/0x7*(parseInt(_0x565834(0x1a0))/0x8)+parseInt(_0x565834(0x20a))/0x9*(parseInt(_0x565834(0x1c6))/0xa)+parseInt(_0x565834(0x1ef))/0xb*(parseInt(_0x565834(0x1e8))/0xc);if(_0x4ed6d2===_0x3edda7)break;else _0x3ebfee['push'](_0x3ebfee['shift']());}catch(_0x1950a9){_0x3ebfee['push'](_0x3ebfee['shift']());}}}(a0_0x670b,0xb03f4));import{readFileSync as a0_0x17b92a,existsSync as a0_0x39f9c0}from'fs';import{randomUUID as a0_0x4db9dd}from'crypto';function a0_0x5c8c(_0x4aaeba,_0x3cf3a0){_0x4aaeba=_0x4aaeba-0x19e;const _0x670bd7=a0_0x670b();let _0x5c8c3a=_0x670bd7[_0x4aaeba];return _0x5c8c3a;}import{join as a0_0x231bb7}from'path';import{hostname as a0_0x595711}from'os';import{execSync as a0_0x5d3536}from'child_process';import{Server as a0_0x22fb80}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x28ce4f}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x188e3a,CallToolRequestSchema as a0_0xd37ac3}from'@modelcontextprotocol/sdk/types.js';function p(_0x245bce){const _0x1a9262=a0_0x5c8c;if(!a0_0x39f9c0(_0x245bce))return;for(let _0x3caab3 of a0_0x17b92a(_0x245bce,'utf-8')[_0x1a9262(0x1e6)]('\x0a')){let _0xaa8359=_0x3caab3['trim']();if(!_0xaa8359||_0xaa8359[_0x1a9262(0x1e9)]('#'))continue;let _0x2ea5ec=_0xaa8359[_0x1a9262(0x1f4)]('=');if(_0x2ea5ec<0x0)continue;let _0x232952=_0xaa8359[_0x1a9262(0x1d0)](0x0,_0x2ea5ec)[_0x1a9262(0x1d2)](),_0x5b337b=_0xaa8359[_0x1a9262(0x1d0)](_0x2ea5ec+0x1)[_0x1a9262(0x1d2)]()[_0x1a9262(0x1af)](/^["']|["']$/g,'');if(!process.env[_0x232952])process.env[_0x232952]=_0x5b337b;}}var C=process.env.HOME||'~',T=a0_0x231bb7(C,a0_0x5126d1(0x220));p(a0_0x231bb7(T,a0_0x5126d1(0x1b2)));function a0_0x670b(){const _0x4bb5c8=['...\x20TMUX=','Target\x20session\x20alias','ENV:\x20URL=','commhub_report_status','notifications/claude/channel','Progress\x200-100','result','unknown\x20tool','SIGINT','text','Session\x20alias:\x20','inbox_count','hub','.claude/channels/commhub','fatal:\x20','blocked','SSE\x20fatal:\x20','0.3.0','content','\x20ALIAS=','delete','MCP\x20stdio\x20connected','end','266575OajnXM','heartbeat\x20failed:\x20','get','tools/call','stderr','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','commhub','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','toTimeString','priority','56lcbhux','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','2025-03-26','body','ack_inbox','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','report_status','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','parse','message_id','CommHub\x20init\x20failed:\x20','commhub_send_message','cancelled','low','exit','replace','type','params','.env','read','cwd','messages','shutting\x20down,\x20reporting\x20offline...','Bearer\x20',':\x20inbox_count=','22811UKJjGB','initialize','\x20CWD=','POST','init\x20failed:\x20','utf-8','string','4258470eeoCzy','Reply\x20text\x20/\x20result\x20summary','working','301305iLNKPe','commhub-channel','commhub_get_all_status','5204990jhCFWP','pop','commhub_reply','Priority\x20(default:\x20normal)','error','812427DfdQpJ','SSE\x20connection\x20error:\x20','http://127.0.0.1:9200','session\x20disconnected','claude-code','slice','broadcast','trim','then','application/json','completed',']\x20[commhub]\x20','/mcp','message','connecting\x20to\x20','send_message','connect','alias','60GaJxgH','get_all_status','normal','ready\x20—\x20waiting\x20for\x20events','new_message','\x20PROJECT_ENV=','stringify','application/json,\x20text/event-stream','get_inbox','split','\x20RESUME_ID=','4369812EDKfYy','startsWith','registered\x20as\x20\x22','new_task','SIGTERM','SSE\x20stream\x20ended,\x20reconnecting...','from','22aHZmYC','object','2.0','catch','idle','indexOf','from_session','stdin','status','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','send_task','12vowqko','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','length','\x22\x20(','failed','token','setRequestHandler','tmux\x20display-message\x20-p\x20\x27#S\x27','Task\x20content','replied','write','parse\x20error:\x20','Current\x20task\x20description','data:\x20','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','18eesHzn','set','find','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','\x20priority=','\x20from\x20','send_reply','getReader','task'];a0_0x670b=function(){return _0x4bb5c8;};return a0_0x670b();}var L=process[a0_0x5126d1(0x1b4)]()[a0_0x5126d1(0x1af)](/\//g,'-');p(a0_0x231bb7(T,L,'.env'));function U(){const _0x3a8ba9=a0_0x5126d1;try{return a0_0x5d3536(_0x3a8ba9(0x202),{'encoding':'utf-8','timeout':0x7d0})[_0x3a8ba9(0x1d2)]();}catch{return'';}}function v(){const _0x3a1b41=a0_0x5126d1;try{let _0x5c5a4b=a0_0x231bb7(C,'.anet','config.json');if(a0_0x39f9c0(_0x5c5a4b))return JSON[_0x3a1b41(0x1a8)](a0_0x17b92a(_0x5c5a4b,_0x3a1b41(0x1be)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x5126d1(0x21f)]||a0_0x5126d1(0x1cd),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x595711(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x4db9dd(),X=process.env.COMMHUB_TOKEN||H[a0_0x5126d1(0x200)]||'';function Y(_0x403dcf){const _0x146d7b=a0_0x5126d1;let _0x3cbbfc=new Date()[_0x146d7b(0x19e)]()[_0x146d7b(0x1d0)](0x0,0x8);process[_0x146d7b(0x22e)][_0x146d7b(0x205)]('['+_0x3cbbfc+_0x146d7b(0x1d6)+_0x403dcf+'\x0a');}function h(_0xb25c73){return new Promise(_0x3d854d=>setTimeout(_0x3d854d,_0xb25c73));}Y(a0_0x5126d1(0x215)+f+a0_0x5126d1(0x226)+Z+a0_0x5126d1(0x1e7)+w[a0_0x5126d1(0x1d0)](0x0,0x8)+a0_0x5126d1(0x213)+(j||'none')+a0_0x5126d1(0x1bb)+process[a0_0x5126d1(0x1b4)]()+a0_0x5126d1(0x1e2)+L);var k=new Map(),K=new a0_0x22fb80({'name':'commhub-channel','version':a0_0x5126d1(0x224)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x5126d1(0x1fb),a0_0x5126d1(0x209),a0_0x5126d1(0x231),'You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.',a0_0x5126d1(0x21d)+Z]['join']('\x0a')});K[a0_0x5126d1(0x201)](a0_0x188e3a,async()=>({'tools':[{'name':a0_0x5126d1(0x1c8),'description':a0_0x5126d1(0x1fc),'inputSchema':{'type':a0_0x5126d1(0x1f0),'properties':{'task_id':{'type':a0_0x5126d1(0x1bf),'description':a0_0x5126d1(0x1a1)},'text':{'type':a0_0x5126d1(0x1bf),'description':a0_0x5126d1(0x1c1)},'status':{'type':a0_0x5126d1(0x1bf),'enum':[a0_0x5126d1(0x1d5),a0_0x5126d1(0x1ff),a0_0x5126d1(0x1ac),a0_0x5126d1(0x222),'error','in_progress'],'description':a0_0x5126d1(0x1a7)}},'required':[a0_0x5126d1(0x21c)]}},{'name':a0_0x5126d1(0x216),'description':a0_0x5126d1(0x1f8),'inputSchema':{'type':a0_0x5126d1(0x1f0),'properties':{'status':{'type':a0_0x5126d1(0x1bf),'enum':[a0_0x5126d1(0x1c2),a0_0x5126d1(0x1f3),a0_0x5126d1(0x222),'error']},'task':{'type':a0_0x5126d1(0x1bf),'description':a0_0x5126d1(0x207)},'progress':{'type':'number','description':a0_0x5126d1(0x218)}},'required':[a0_0x5126d1(0x1f7)]}},{'name':'commhub_send_task','description':a0_0x5126d1(0x1a5),'inputSchema':{'type':a0_0x5126d1(0x1f0),'properties':{'alias':{'type':a0_0x5126d1(0x1bf),'description':a0_0x5126d1(0x214)},'task':{'type':a0_0x5126d1(0x1bf),'description':a0_0x5126d1(0x203)},'priority':{'type':a0_0x5126d1(0x1bf),'enum':['high',a0_0x5126d1(0x1df),a0_0x5126d1(0x1ad)],'description':a0_0x5126d1(0x1c9)}},'required':[a0_0x5126d1(0x1dc),a0_0x5126d1(0x212)]}},{'name':a0_0x5126d1(0x1ab),'description':a0_0x5126d1(0x22f),'inputSchema':{'type':a0_0x5126d1(0x1f0),'properties':{'alias':{'type':a0_0x5126d1(0x1bf),'description':a0_0x5126d1(0x214)},'message':{'type':a0_0x5126d1(0x1bf),'description':'Message\x20content'}},'required':[a0_0x5126d1(0x1dc),a0_0x5126d1(0x1d8)]}},{'name':a0_0x5126d1(0x1c5),'description':a0_0x5126d1(0x20d),'inputSchema':{'type':a0_0x5126d1(0x1f0),'properties':{}}}]}));async function P(_0x410619,_0x4479e3){const _0x587c3f=a0_0x5126d1;let _0x2c35b9=await fetch(f+_0x587c3f(0x1d7),{'method':_0x587c3f(0x1bc),'headers':{'Content-Type':_0x587c3f(0x1d4),'Accept':_0x587c3f(0x1e4),...X?{'Authorization':_0x587c3f(0x1b7)+X}:{}},'body':JSON[_0x587c3f(0x1e3)]({'jsonrpc':_0x587c3f(0x1f1),'id':0x1,'method':_0x587c3f(0x1ba),'params':{'protocolVersion':_0x587c3f(0x1a2),'capabilities':{},'clientInfo':{'name':_0x587c3f(0x1c4),'version':_0x587c3f(0x224)}}})});if(!_0x2c35b9['ok']){let _0x411cfe=await _0x2c35b9[_0x587c3f(0x21c)]();return Y(_0x587c3f(0x1aa)+_0x2c35b9[_0x587c3f(0x1f7)]+'\x20'+_0x411cfe[_0x587c3f(0x1d0)](0x0,0x64)),{'ok':!0x1,'error':_0x587c3f(0x1bd)+_0x2c35b9['status']};}await _0x2c35b9[_0x587c3f(0x21c)]();let _0x39a469=(await(await fetch(f+_0x587c3f(0x1d7),{'method':_0x587c3f(0x1bc),'headers':{'Content-Type':'application/json','Accept':_0x587c3f(0x1e4),...X?{'Authorization':_0x587c3f(0x1b7)+X}:{}},'body':JSON[_0x587c3f(0x1e3)]({'jsonrpc':_0x587c3f(0x1f1),'id':0x2,'method':_0x587c3f(0x22d),'params':{'name':_0x410619,'arguments':_0x4479e3}})}))[_0x587c3f(0x21c)]())[_0x587c3f(0x1e6)]('\x0a')[_0x587c3f(0x20c)](_0x32d45b=>_0x32d45b[_0x587c3f(0x1e9)](_0x587c3f(0x208)));if(_0x39a469){let _0x1a78d0=JSON[_0x587c3f(0x1a8)](_0x39a469[_0x587c3f(0x1d0)](0x6));return _0x1a78d0?.[_0x587c3f(0x219)]?.['content']?.[0x0]?.['text']?JSON[_0x587c3f(0x1a8)](_0x1a78d0[_0x587c3f(0x219)]['content'][0x0][_0x587c3f(0x21c)]):_0x1a78d0;}return{'ok':!0x1,'error':'no\x20response'};}K[a0_0x5126d1(0x201)](a0_0xd37ac3,async _0x540e0a=>{const _0x29d3e8=a0_0x5126d1;let {name:_0x1ed9f9,arguments:_0x342e38}=_0x540e0a[_0x29d3e8(0x1b1)];if(_0x1ed9f9===_0x29d3e8(0x1c8)){let {task_id:_0xd128f9,text:_0x1580e6,status:_0x4f5454}=_0x342e38;if(_0x4f5454==='completed'||_0x4f5454===_0x29d3e8(0x1ff)||_0x4f5454===_0x29d3e8(0x1ac)){let _0x62a1da=_0x4f5454===_0x29d3e8(0x1d5)?_0x29d3e8(0x204):_0x4f5454,_0x1ce2b0=_0xd128f9?k[_0x29d3e8(0x22c)](_0xd128f9)||'hub':_0x29d3e8(0x21f),_0xddce7=await P(_0x29d3e8(0x210),{'alias':_0x1ce2b0,'text':_0x1580e6,'in_reply_to':_0xd128f9||void 0x0,'status':_0x62a1da,'from_session':Z});if(_0xd128f9)k[_0x29d3e8(0x227)](_0xd128f9);return{'content':[{'type':_0x29d3e8(0x21c),'text':JSON[_0x29d3e8(0x1e3)](_0xddce7)}]};}let _0xd6ae3d=await P(_0x29d3e8(0x1a6),{'resume_id':w,'alias':Z,'status':_0x4f5454===_0x29d3e8(0x222)?_0x29d3e8(0x222):_0x4f5454===_0x29d3e8(0x1ca)?_0x29d3e8(0x1ca):'working','task':_0x1580e6['slice'](0x0,0xc8),'output':_0x1580e6});return{'content':[{'type':'text','text':JSON['stringify'](_0xd6ae3d)}]};}if(_0x1ed9f9===_0x29d3e8(0x216)){let {status:_0x5795a3,task:_0xe075ca,progress:_0x125862}=_0x342e38,_0x4d95b3=await P(_0x29d3e8(0x1a6),{'resume_id':w,'alias':Z,'status':_0x5795a3,'task':_0xe075ca,'progress':_0x125862});return{'content':[{'type':'text','text':JSON[_0x29d3e8(0x1e3)](_0x4d95b3)}]};}if(_0x1ed9f9==='commhub_send_task'){let {alias:_0xf6fe91,task:_0x3a9859,priority:_0x801d02}=_0x342e38,_0x5a143a=await P(_0x29d3e8(0x1f9),{'alias':_0xf6fe91,'task':_0x3a9859,'priority':_0x801d02||'normal','from_session':Z});return{'content':[{'type':'text','text':JSON[_0x29d3e8(0x1e3)](_0x5a143a)}]};}if(_0x1ed9f9===_0x29d3e8(0x1ab)){let {alias:_0x24a57b,message:_0x3b710c}=_0x342e38,_0x1333f0=await P(_0x29d3e8(0x1da),{'alias':_0x24a57b,'message':_0x3b710c,'from_session':Z});return{'content':[{'type':_0x29d3e8(0x21c),'text':JSON[_0x29d3e8(0x1e3)](_0x1333f0)}]};}if(_0x1ed9f9===_0x29d3e8(0x1c5)){let _0x483d8f=await P(_0x29d3e8(0x1de),{});return{'content':[{'type':_0x29d3e8(0x21c),'text':JSON[_0x29d3e8(0x1e3)](_0x483d8f)}]};}return{'content':[{'type':_0x29d3e8(0x21c),'text':JSON[_0x29d3e8(0x1e3)]({'error':_0x29d3e8(0x21a)})}]};});async function u(){const _0x50314b=a0_0x5126d1;let _0x5f257f=f+'/events/'+encodeURIComponent(Z),_0x18fa7f={};if(X)_0x18fa7f['Authorization']=_0x50314b(0x1b7)+X;Y(_0x50314b(0x1d9)+_0x5f257f);while(!0x0){try{let _0x4c404c=await fetch(_0x5f257f,{'headers':_0x18fa7f});if(!_0x4c404c['ok']){Y('SSE\x20error:\x20'+_0x4c404c['status']+'\x20'+_0x4c404c['statusText']),await h(0x1388);continue;}let _0x3bda2e=_0x4c404c[_0x50314b(0x1a3)][_0x50314b(0x211)](),_0x103be7=new TextDecoder(),_0x5511b3='';while(!0x0){let {done:_0x4e1c1a,value:_0x2fa44d}=await _0x3bda2e[_0x50314b(0x1b3)]();if(_0x4e1c1a)break;_0x5511b3+=_0x103be7['decode'](_0x2fa44d,{'stream':!0x0});let _0x4f3353=_0x5511b3['split']('\x0a\x0a');_0x5511b3=_0x4f3353[_0x50314b(0x1c7)]()||'';for(let _0x564258 of _0x4f3353){let _0x5e28e3=_0x564258[_0x50314b(0x1e6)]('\x0a')[_0x50314b(0x20c)](_0x3dc961=>_0x3dc961[_0x50314b(0x1e9)](_0x50314b(0x208)));if(!_0x5e28e3)continue;try{let _0x2087a6=JSON[_0x50314b(0x1a8)](_0x5e28e3['slice'](0x6));await S(_0x2087a6);}catch(_0x35d4d0){Y(_0x50314b(0x206)+_0x35d4d0);}}}Y(_0x50314b(0x1ed));}catch(_0x5efc36){Y(_0x50314b(0x1cc)+_0x5efc36);}await h(0xbb8);}}async function S(_0x2fa765){const _0xdceee1=a0_0x5126d1;if(_0x2fa765[_0xdceee1(0x1b0)]==='connected'){Y('SSE\x20connected\x20as\x20\x22'+Z+'\x22');return;}if(_0x2fa765['type']===_0xdceee1(0x1e1)){if(Y('←\x20message\x20from\x20'+_0x2fa765['from']+':\x20'+_0x2fa765[_0xdceee1(0x1d8)][_0xdceee1(0x1d0)](0x0,0x3c)),await K['notification']({'method':_0xdceee1(0x217),'params':{'content':_0x2fa765['message'],'meta':{'sender':_0x2fa765[_0xdceee1(0x1ee)]||'hub','sender_id':_0xdceee1(0x230),'user':_0x2fa765[_0xdceee1(0x1ee)]||_0xdceee1(0x21f),'priority':_0xdceee1(0x1df)}}}),_0x2fa765[_0xdceee1(0x1a9)])await P(_0xdceee1(0x1a4),{'alias':Z,'message_id':_0x2fa765['message_id']});return;}if(_0x2fa765[_0xdceee1(0x1b0)]===_0xdceee1(0x1eb)||_0x2fa765[_0xdceee1(0x1b0)]===_0xdceee1(0x1d1)){Y('←\x20'+_0x2fa765[_0xdceee1(0x1b0)]+_0xdceee1(0x1b8)+_0x2fa765[_0xdceee1(0x21e)]+_0xdceee1(0x20e)+(_0x2fa765[_0xdceee1(0x19f)]||_0xdceee1(0x1df)));let _0x5b7ba6=await P(_0xdceee1(0x1e5),{'alias':Z,'limit':0x5});if(_0x5b7ba6?.['ok']&&_0x5b7ba6['messages']?.[_0xdceee1(0x1fd)]>0x0)for(let _0xd05125 of _0x5b7ba6[_0xdceee1(0x1b5)]){let _0x444693={'sender':_0xd05125[_0xdceee1(0x1f5)]||'hub','sender_id':_0xdceee1(0x230),'user':_0xd05125[_0xdceee1(0x1f5)]||_0xdceee1(0x21f),'task_id':_0xd05125['id'],'priority':_0xd05125[_0xdceee1(0x19f)]||'normal'};k[_0xdceee1(0x20b)](_0xd05125['id'],_0xd05125[_0xdceee1(0x1f5)]||_0xdceee1(0x21f)),await K['notification']({'method':_0xdceee1(0x217),'params':{'content':_0xd05125['content'],'meta':_0x444693}}),Y('→\x20injected\x20task\x20'+_0xd05125['id'][_0xdceee1(0x1d0)](0x0,0x8)+_0xdceee1(0x20f)+_0xd05125[_0xdceee1(0x1f5)]+':\x20'+_0xd05125[_0xdceee1(0x225)][_0xdceee1(0x1d0)](0x0,0x3c)),await P('ack_inbox',{'alias':Z,'message_id':_0xd05125['id']});}}}async function A(){const _0x3a9c1f=a0_0x5126d1;let _0x64aa7e=new a0_0x28ce4f();await K[_0x3a9c1f(0x1db)](_0x64aa7e),Y(_0x3a9c1f(0x228)),Y('starting\x20SSE\x20listener...'),u()['catch'](_0x12d8b2=>Y(_0x3a9c1f(0x223)+_0x12d8b2)),P(_0x3a9c1f(0x1a6),{'resume_id':w,'alias':Z,'status':_0x3a9c1f(0x1f3),'server':a0_0x595711(),'hostname':a0_0x595711(),'agent':'claude-code','project_dir':process['cwd'](),'tmux_name':j||void 0x0})[_0x3a9c1f(0x1d3)](()=>Y(_0x3a9c1f(0x1ea)+Z+_0x3a9c1f(0x1fe)+w[_0x3a9c1f(0x1d0)](0x0,0x8)+')'))[_0x3a9c1f(0x1f2)](_0x19e45a=>Y('warning:\x20could\x20not\x20register:\x20'+_0x19e45a)),setInterval(()=>{const _0xb7f409=_0x3a9c1f;P(_0xb7f409(0x1a6),{'resume_id':w,'alias':Z,'status':_0xb7f409(0x1f3),'server':a0_0x595711(),'hostname':a0_0x595711(),'agent':_0xb7f409(0x1cf),'project_dir':process[_0xb7f409(0x1b4)](),'tmux_name':j||void 0x0})[_0xb7f409(0x1f2)](_0x22a229=>Y(_0xb7f409(0x22b)+_0x22a229));},0x2bf20),Y(_0x3a9c1f(0x1e0));}A()[a0_0x5126d1(0x1f2)](_0x20d4c7=>{const _0x96f8d9=a0_0x5126d1;Y(_0x96f8d9(0x221)+_0x20d4c7),process[_0x96f8d9(0x1ae)](0x1);});async function N(){const _0x3f9f24=a0_0x5126d1;Y(_0x3f9f24(0x1b6)),await P(_0x3f9f24(0x1a6),{'resume_id':w,'alias':Z,'status':_0x3f9f24(0x1ca),'task':_0x3f9f24(0x1ce)})[_0x3f9f24(0x1f2)](()=>{}),process[_0x3f9f24(0x1ae)](0x0);}process[a0_0x5126d1(0x1f6)]['on'](a0_0x5126d1(0x229),()=>N()),process['on'](a0_0x5126d1(0x1ec),()=>N()),process['on'](a0_0x5126d1(0x21b),()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.1.6-preview.0",
3
+ "version": "2.1.6-preview.2",
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",