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

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_0x4ab75a=a0_0xc342;function a0_0x294a(){const _0xd8711f=['reply','1235442QGeHhR','sleep','send_task','inbox\x20error:\x20','running','getReader','content','text','sseAbort','signal','processInbox','665GajqHc','9358500VOeCsO','stringify','cwd','alias','connectSSE','new_message','abort','heartbeatTimer','pop','toString','from_session','data:\x20','sdk-','min','sdk','idle','connected','heartbeatInterval','s...','5kSdIqx','broadcast','now','body','7683yhrGhM','SSE\x20failed:\x20','type','getAllStatus','/events/','agent','connect','server','replace','18136jIuvdn','resumeId','token','parse','2585188xjmiTs','slice','Authorization','8083557bQwzwH','248QSRQLG','application/json,\x20text/event-stream','new_task','2.0','registered','startsWith',']\x20[commhub:','completed','/mcp','normal','call','send','error','task','tools/call','name','SSE\x20reconnecting\x20in\x20','ack_inbox','POST','Bearer\x20','reconnectDelay','split','send_message','status','heartbeat\x20failed:\x20','disconnected','send_reply','96372BwKEQT','offline','log','report_status','emit','disconnect','autoConnect','message','catch','application/json','url'];a0_0x294a=function(){return _0xd8711f;};return a0_0x294a();}(function(_0x5b7b82,_0x2e0f95){const _0x469ad2=a0_0xc342,_0x49851b=_0x5b7b82();while(!![]){try{const _0x342dad=parseInt(_0x469ad2(0x1b4))/0x1*(-parseInt(_0x469ad2(0x1c5))/0x2)+parseInt(_0x469ad2(0x191))/0x3+parseInt(_0x469ad2(0x1c1))/0x4*(-parseInt(_0x469ad2(0x1b0))/0x5)+parseInt(_0x469ad2(0x1e0))/0x6+-parseInt(_0x469ad2(0x19c))/0x7*(-parseInt(_0x469ad2(0x1bd))/0x8)+parseInt(_0x469ad2(0x1c4))/0x9+parseInt(_0x469ad2(0x19d))/0xa;if(_0x342dad===_0x2e0f95)break;else _0x49851b['push'](_0x49851b['shift']());}catch(_0x3a39d5){_0x49851b['push'](_0x49851b['shift']());}}}(a0_0x294a,0xd66c3));import{EventEmitter as a0_0xa77431}from'events';import{hostname as a0_0x2f3822}from'os';class T extends a0_0xa77431{['url'];[a0_0x4ab75a(0x1a0)];[a0_0x4ab75a(0x1bf)];[a0_0x4ab75a(0x1b9)];['resumeId'];[a0_0x4ab75a(0x1ae)];[a0_0x4ab75a(0x1d9)];['heartbeatTimer'];[a0_0x4ab75a(0x199)];[a0_0x4ab75a(0x195)]=!0x1;constructor(_0x14433a){const _0x1a56dd=a0_0x4ab75a;super();if(this['url']=_0x14433a['url'][_0x1a56dd(0x1bc)](/\/$/,''),this[_0x1a56dd(0x1a0)]=_0x14433a[_0x1a56dd(0x1a0)],this[_0x1a56dd(0x1bf)]=_0x14433a[_0x1a56dd(0x1bf)],this[_0x1a56dd(0x1b9)]=_0x14433a['agent']||_0x1a56dd(0x1ab),this[_0x1a56dd(0x1be)]=_0x1a56dd(0x1a9)+_0x14433a[_0x1a56dd(0x1a0)]+'-'+Date[_0x1a56dd(0x1b2)]()[_0x1a56dd(0x1a6)](0x24),this['heartbeatInterval']=_0x14433a['heartbeatInterval']??0x2bf20,this[_0x1a56dd(0x1d9)]=_0x14433a['reconnectDelay']??0xbb8,_0x14433a[_0x1a56dd(0x1e6)]!==!0x1)this['connect']();}['log'](_0x19ac60){const _0x314a79=a0_0x4ab75a;console['log']('['+new Date()['toTimeString']()['slice'](0x0,0x8)+_0x314a79(0x1cb)+this[_0x314a79(0x1a0)]+']\x20'+_0x19ac60);}async[a0_0x4ab75a(0x1cf)](_0x2724c7,_0x5305a1){const _0x5232bf=a0_0x4ab75a;let _0x21e36f={'Content-Type':_0x5232bf(0x1e9),'Accept':_0x5232bf(0x1c6)};if(this[_0x5232bf(0x1bf)])_0x21e36f[_0x5232bf(0x1c3)]=_0x5232bf(0x1d8)+this[_0x5232bf(0x1bf)];let _0x1822dc=await(await fetch(this[_0x5232bf(0x1ea)]+_0x5232bf(0x1cd),{'method':_0x5232bf(0x1d7),'headers':_0x21e36f,'body':JSON[_0x5232bf(0x19e)]({'jsonrpc':_0x5232bf(0x1c8),'id':Date[_0x5232bf(0x1b2)](),'method':_0x5232bf(0x1d3),'params':{'name':_0x2724c7,'arguments':_0x5305a1}})}))[_0x5232bf(0x198)](),_0x2f3359=_0x1822dc['match'](/data: (.+)/),_0x322e26=_0x2f3359?JSON[_0x5232bf(0x1c0)](_0x2f3359[0x1]):JSON[_0x5232bf(0x1c0)](_0x1822dc),_0x1bc30b=_0x322e26?.['result']?.[_0x5232bf(0x197)]?.[0x0]?.[_0x5232bf(0x198)];return _0x1bc30b?JSON[_0x5232bf(0x1c0)](_0x1bc30b):_0x322e26;}async[a0_0x4ab75a(0x1ba)](){const _0x15eb28=a0_0x4ab75a;if(this[_0x15eb28(0x195)])return;this['running']=!0x0,await this[_0x15eb28(0x1dc)](_0x15eb28(0x1ac)),this[_0x15eb28(0x1e2)](_0x15eb28(0x1c9)),this[_0x15eb28(0x1a4)]=setInterval(()=>{const _0x5e016d=_0x15eb28;this[_0x5e016d(0x1dc)](_0x5e016d(0x1ac))[_0x5e016d(0x1e8)](_0x43c615=>this['log'](_0x5e016d(0x1dd)+_0x43c615[_0x5e016d(0x1e7)]));},this[_0x15eb28(0x1ae)]),this[_0x15eb28(0x1a1)]();}async[a0_0x4ab75a(0x1e5)](){const _0x1a1e2a=a0_0x4ab75a;if(this[_0x1a1e2a(0x195)]=!0x1,this['sseAbort']?.[_0x1a1e2a(0x1a3)](),this[_0x1a1e2a(0x1a4)])clearInterval(this['heartbeatTimer']);await this[_0x1a1e2a(0x1dc)](_0x1a1e2a(0x1e1))[_0x1a1e2a(0x1e8)](()=>{}),this['log'](_0x1a1e2a(0x1de));}async[a0_0x4ab75a(0x1d0)](_0x9b8682,_0x55c638,_0x26e171=a0_0x4ab75a(0x1ce)){const _0xbcfb17=a0_0x4ab75a;return this[_0xbcfb17(0x1cf)](_0xbcfb17(0x193),{'alias':_0x9b8682,'task':_0x55c638,'priority':_0x26e171,'from_session':this[_0xbcfb17(0x1a0)]});}async[a0_0x4ab75a(0x1e7)](_0x458904,_0xe0e067){const _0x13ecdb=a0_0x4ab75a;return this[_0x13ecdb(0x1cf)](_0x13ecdb(0x1db),{'alias':_0x458904,'message':_0xe0e067,'from_session':this[_0x13ecdb(0x1a0)]});}async[a0_0x4ab75a(0x1eb)](_0x5f1691,_0xb38367,_0x221693=a0_0x4ab75a(0x1cc)){const _0x4d6d64=a0_0x4ab75a;return this[_0x4d6d64(0x1cf)](_0x4d6d64(0x1df),{'in_reply_to':_0x5f1691,'text':_0xb38367,'status':_0x221693});}async['status'](_0x1f6609,_0x42abf4){const _0x226757=a0_0x4ab75a;return this[_0x226757(0x1cf)](_0x226757(0x1e3),{'resume_id':this[_0x226757(0x1be)],'alias':this[_0x226757(0x1a0)],'status':_0x1f6609,'server':a0_0x2f3822(),'hostname':a0_0x2f3822(),'agent':this[_0x226757(0x1b9)],'project_dir':process[_0x226757(0x19f)](),..._0x42abf4});}async[a0_0x4ab75a(0x1b7)](){const _0x4220b4=a0_0x4ab75a;return this[_0x4220b4(0x1cf)]('get_all_status',{});}async['broadcast'](_0x58b590,_0xbd04d2){const _0x2f094e=a0_0x4ab75a;return this[_0x2f094e(0x1cf)]('broadcast',{'message':_0x58b590,'filter_server':_0xbd04d2?.[_0x2f094e(0x1bb)],'filter_status':_0xbd04d2?.['status']});}async['connectSSE'](){const _0x22af3e=a0_0x4ab75a;let _0x3a400a=encodeURIComponent(this['alias']),_0x8260b8=this[_0x22af3e(0x1ea)]+_0x22af3e(0x1b8)+_0x3a400a,_0x29a049=this['reconnectDelay'];while(this['running']){try{this[_0x22af3e(0x199)]=new AbortController();let _0x4da607={'Accept':'text/event-stream'};if(this[_0x22af3e(0x1bf)])_0x4da607[_0x22af3e(0x1c3)]=_0x22af3e(0x1d8)+this[_0x22af3e(0x1bf)];let _0x25b9ad=await fetch(_0x8260b8,{'headers':_0x4da607,'signal':this[_0x22af3e(0x199)][_0x22af3e(0x19a)]});if(!_0x25b9ad['ok']||!_0x25b9ad[_0x22af3e(0x1b3)]){this[_0x22af3e(0x1e2)](_0x22af3e(0x1b5)+_0x25b9ad['status']),await this['sleep'](_0x29a049),_0x29a049=Math[_0x22af3e(0x1aa)](_0x29a049*1.5,0xea60);continue;}_0x29a049=this[_0x22af3e(0x1d9)];let _0x23a89c=_0x25b9ad[_0x22af3e(0x1b3)][_0x22af3e(0x196)](),_0xcb425b=new TextDecoder(),_0x364e4e='';while(this['running']){let {done:_0x3aac87,value:_0xccfd96}=await _0x23a89c['read']();if(_0x3aac87)break;_0x364e4e+=_0xcb425b['decode'](_0xccfd96,{'stream':!0x0});let _0x38cfac=_0x364e4e[_0x22af3e(0x1da)]('\x0a');_0x364e4e=_0x38cfac[_0x22af3e(0x1a5)]()||'';for(let _0x1737ab of _0x38cfac){if(!_0x1737ab[_0x22af3e(0x1ca)](_0x22af3e(0x1a8)))continue;try{let _0x9fc81b=JSON[_0x22af3e(0x1c0)](_0x1737ab[_0x22af3e(0x1c2)](0x6));if(_0x9fc81b[_0x22af3e(0x1b6)]===_0x22af3e(0x1ad)){this[_0x22af3e(0x1e2)]('SSE\x20connected'),this['emit']('connected');continue;}if(_0x9fc81b[_0x22af3e(0x1b6)]===_0x22af3e(0x1c7)||_0x9fc81b[_0x22af3e(0x1b6)]===_0x22af3e(0x1a2)||_0x9fc81b[_0x22af3e(0x1b6)]===_0x22af3e(0x1b1))await this[_0x22af3e(0x19b)]();}catch{}}}}catch(_0x42d054){if(_0x42d054[_0x22af3e(0x1d4)]==='AbortError')break;this[_0x22af3e(0x1e4)](_0x22af3e(0x1d1),_0x42d054),this[_0x22af3e(0x1e2)]('SSE\x20error:\x20'+_0x42d054['message']);}if(this['running'])this['emit']('disconnected'),this[_0x22af3e(0x1e2)](_0x22af3e(0x1d5)+_0x29a049/0x3e8+_0x22af3e(0x1af)),await this[_0x22af3e(0x192)](_0x29a049),_0x29a049=Math[_0x22af3e(0x1aa)](_0x29a049*1.5,0xea60);}}async[a0_0x4ab75a(0x19b)](){const _0x4f27b4=a0_0x4ab75a;try{let _0x21b5ba=(await this[_0x4f27b4(0x1cf)]('get_inbox',{'alias':this[_0x4f27b4(0x1a0)],'limit':0xa}))?.['messages']||[];for(let _0x3ed30b of _0x21b5ba)await this[_0x4f27b4(0x1cf)](_0x4f27b4(0x1d6),{'alias':this[_0x4f27b4(0x1a0)],'message_id':_0x3ed30b['id']}),this[_0x4f27b4(0x1e2)]('←\x20'+_0x3ed30b[_0x4f27b4(0x1a7)]+':\x20'+_0x3ed30b[_0x4f27b4(0x197)][_0x4f27b4(0x1c2)](0x0,0x3c)),this['emit'](_0x4f27b4(0x1d2),_0x3ed30b),this[_0x4f27b4(0x1e4)](_0x4f27b4(0x1e7),_0x3ed30b);}catch(_0x3c2cb2){this[_0x4f27b4(0x1e2)](_0x4f27b4(0x194)+_0x3c2cb2['message']);}}[a0_0x4ab75a(0x192)](_0x42321b){return new Promise(_0x530979=>setTimeout(_0x530979,_0x42321b));}}function a0_0xc342(_0x490a78,_0x2a90b9){_0x490a78=_0x490a78-0x191;const _0x294a21=a0_0x294a();let _0xc34234=_0x294a21[_0x490a78];return _0xc34234;}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_0x3f4d20=a0_0xd0c1;(function(_0x455955,_0x5ea6f1){const _0x2830ce=a0_0xd0c1,_0x2c7ab3=_0x455955();while(!![]){try{const _0x1aed66=-parseInt(_0x2830ce(0xe3))/0x1+parseInt(_0x2830ce(0x112))/0x2*(-parseInt(_0x2830ce(0xfe))/0x3)+parseInt(_0x2830ce(0xc5))/0x4*(parseInt(_0x2830ce(0x13a))/0x5)+parseInt(_0x2830ce(0xcd))/0x6+parseInt(_0x2830ce(0x116))/0x7+-parseInt(_0x2830ce(0x126))/0x8*(parseInt(_0x2830ce(0x131))/0x9)+parseInt(_0x2830ce(0x11b))/0xa*(-parseInt(_0x2830ce(0x127))/0xb);if(_0x1aed66===_0x5ea6f1)break;else _0x2c7ab3['push'](_0x2c7ab3['shift']());}catch(_0x1b1652){_0x2c7ab3['push'](_0x2c7ab3['shift']());}}}(a0_0x30fe,0x8d2bd));import{readFileSync as a0_0x4fc692,existsSync as a0_0x5118b}from'fs';import{randomUUID as a0_0x1ed902}from'crypto';import{join as a0_0x3f409d}from'path';import{hostname as a0_0x4f7831}from'os';import{execSync as a0_0x4559b2}from'child_process';import{Server as a0_0x4aa06a}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x3843ba}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x54d77c,CallToolRequestSchema as a0_0x56a742}from'@modelcontextprotocol/sdk/types.js';function p(_0x299c5a){const _0x513858=a0_0xd0c1;if(!a0_0x5118b(_0x299c5a))return;for(let _0x2fb769 of a0_0x4fc692(_0x299c5a,_0x513858(0xee))[_0x513858(0xce)]('\x0a')){let _0x52b3e7=_0x2fb769['trim']();if(!_0x52b3e7||_0x52b3e7[_0x513858(0x137)]('#'))continue;let _0x559894=_0x52b3e7['indexOf']('=');if(_0x559894<0x0)continue;let _0x43dc9f=_0x52b3e7[_0x513858(0x123)](0x0,_0x559894)[_0x513858(0xdf)](),_0x58c99c=_0x52b3e7[_0x513858(0x123)](_0x559894+0x1)[_0x513858(0xdf)]()[_0x513858(0x132)](/^["']|["']$/g,'');if(!process.env[_0x43dc9f])process.env[_0x43dc9f]=_0x58c99c;}}var C=process.env.HOME||'~',T=a0_0x3f409d(C,'.claude/channels/commhub');p(a0_0x3f409d(T,a0_0x3f4d20(0x11c)));var L=process[a0_0x3f4d20(0x135)]()[a0_0x3f4d20(0x132)](/\//g,'-');p(a0_0x3f409d(T,L,a0_0x3f4d20(0x11c)));function U(){const _0x4502db=a0_0x3f4d20;try{return a0_0x4559b2(_0x4502db(0x12e),{'encoding':_0x4502db(0xee),'timeout':0x7d0})[_0x4502db(0xdf)]();}catch{return'';}}function v(){const _0x38eb58=a0_0x3f4d20;try{let _0x232fe9=a0_0x3f409d(C,_0x38eb58(0xbc),_0x38eb58(0xc1));if(a0_0x5118b(_0x232fe9))return JSON[_0x38eb58(0xc3)](a0_0x4fc692(_0x232fe9,'utf-8'));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x3f4d20(0xbb)]||'http://127.0.0.1:9200',j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x4f7831(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x1ed902(),X=process.env.COMMHUB_TOKEN||H[a0_0x3f4d20(0x10a)]||'';function Y(_0x38bcc7){const _0x2d931a=a0_0x3f4d20;let _0x45580e=new Date()[_0x2d931a(0xd0)]()['slice'](0x0,0x8);process[_0x2d931a(0xec)][_0x2d931a(0xe2)]('['+_0x45580e+_0x2d931a(0x124)+_0x38bcc7+'\x0a');}function h(_0x3ed784){return new Promise(_0x2c5c67=>setTimeout(_0x2c5c67,_0x3ed784));}Y(a0_0x3f4d20(0x130)+f+'\x20ALIAS='+Z+a0_0x3f4d20(0x141)+w[a0_0x3f4d20(0x123)](0x0,0x8)+a0_0x3f4d20(0x121)+(j||a0_0x3f4d20(0xc0))+a0_0x3f4d20(0x122)+process[a0_0x3f4d20(0x135)]()+'\x20PROJECT_ENV='+L);var k=new Map(),K=new a0_0x4aa06a({'name':a0_0x3f4d20(0x114),'version':a0_0x3f4d20(0xcc)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x3f4d20(0x143),a0_0x3f4d20(0xe1),'Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.',a0_0x3f4d20(0xc6),a0_0x3f4d20(0xc4)+Z][a0_0x3f4d20(0xdb)]('\x0a')});K[a0_0x3f4d20(0x10b)](a0_0x54d77c,async()=>({'tools':[{'name':'commhub_reply','description':a0_0x3f4d20(0x100),'inputSchema':{'type':a0_0x3f4d20(0xdc),'properties':{'task_id':{'type':a0_0x3f4d20(0xf1),'description':a0_0x3f4d20(0x125)},'text':{'type':a0_0x3f4d20(0xf1),'description':'Reply\x20text\x20/\x20result\x20summary'},'status':{'type':'string','enum':[a0_0x3f4d20(0xe5),a0_0x3f4d20(0x13d),a0_0x3f4d20(0x139),a0_0x3f4d20(0xbd),a0_0x3f4d20(0xfa),a0_0x3f4d20(0xfd)],'description':a0_0x3f4d20(0xf9)}},'required':[a0_0x3f4d20(0x134)]}},{'name':a0_0x3f4d20(0x13c),'description':a0_0x3f4d20(0xf8),'inputSchema':{'type':a0_0x3f4d20(0xdc),'properties':{'status':{'type':a0_0x3f4d20(0xf1),'enum':[a0_0x3f4d20(0xea),a0_0x3f4d20(0xb6),a0_0x3f4d20(0xbd),'error']},'task':{'type':'string','description':a0_0x3f4d20(0x119)},'progress':{'type':a0_0x3f4d20(0xc2),'description':a0_0x3f4d20(0xfc)}},'required':[a0_0x3f4d20(0xb9)]}},{'name':a0_0x3f4d20(0x12c),'description':a0_0x3f4d20(0x13b),'inputSchema':{'type':a0_0x3f4d20(0xdc),'properties':{'alias':{'type':a0_0x3f4d20(0xf1),'description':'Target\x20session\x20alias'},'task':{'type':a0_0x3f4d20(0xf1),'description':a0_0x3f4d20(0x11f)},'priority':{'type':a0_0x3f4d20(0xf1),'enum':[a0_0x3f4d20(0xf7),a0_0x3f4d20(0x142),a0_0x3f4d20(0x128)],'description':a0_0x3f4d20(0x13f)}},'required':['alias',a0_0x3f4d20(0x105)]}},{'name':a0_0x3f4d20(0x110),'description':a0_0x3f4d20(0xf4),'inputSchema':{'type':a0_0x3f4d20(0xdc),'properties':{'alias':{'type':a0_0x3f4d20(0xf1),'description':a0_0x3f4d20(0xf6)},'message':{'type':'string','description':a0_0x3f4d20(0x12d)}},'required':[a0_0x3f4d20(0xc8),'message']}},{'name':'commhub_get_all_status','description':'Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','inputSchema':{'type':a0_0x3f4d20(0xdc),'properties':{}}}]}));async function P(_0x1a056b,_0x36353c){const _0x3aecce=a0_0x3f4d20;let _0x7f3c3=await fetch(f+_0x3aecce(0xef),{'method':_0x3aecce(0x101),'headers':{'Content-Type':'application/json','Accept':_0x3aecce(0x111),...X?{'Authorization':_0x3aecce(0xd8)+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x3aecce(0x107),'id':0x1,'method':_0x3aecce(0xd3),'params':{'protocolVersion':_0x3aecce(0x103),'capabilities':{},'clientInfo':{'name':_0x3aecce(0x114),'version':'0.3.0'}}})});if(!_0x7f3c3['ok']){let _0x3b3595=await _0x7f3c3[_0x3aecce(0x134)]();return Y(_0x3aecce(0x10c)+_0x7f3c3[_0x3aecce(0xb9)]+'\x20'+_0x3b3595[_0x3aecce(0x123)](0x0,0x64)),{'ok':!0x1,'error':_0x3aecce(0x115)+_0x7f3c3[_0x3aecce(0xb9)]};}await _0x7f3c3[_0x3aecce(0x134)]();let _0x1878ea=(await(await fetch(f+_0x3aecce(0xef),{'method':_0x3aecce(0x101),'headers':{'Content-Type':_0x3aecce(0xb8),'Accept':_0x3aecce(0x111),...X?{'Authorization':_0x3aecce(0xd8)+X}:{}},'body':JSON[_0x3aecce(0xba)]({'jsonrpc':_0x3aecce(0x107),'id':0x2,'method':_0x3aecce(0xd5),'params':{'name':_0x1a056b,'arguments':_0x36353c}})}))[_0x3aecce(0x134)]())['split']('\x0a')['find'](_0x4790d3=>_0x4790d3[_0x3aecce(0x137)](_0x3aecce(0x108)));if(_0x1878ea){let _0x11fc47=JSON[_0x3aecce(0xc3)](_0x1878ea[_0x3aecce(0x123)](0x6));return _0x11fc47?.[_0x3aecce(0xeb)]?.['content']?.[0x0]?.[_0x3aecce(0x134)]?JSON['parse'](_0x11fc47[_0x3aecce(0xeb)]['content'][0x0][_0x3aecce(0x134)]):_0x11fc47;}return{'ok':!0x1,'error':'no\x20response'};}K[a0_0x3f4d20(0x10b)](a0_0x56a742,async _0x162a13=>{const _0x40628e=a0_0x3f4d20;let {name:_0x4839b2,arguments:_0x3a9677}=_0x162a13[_0x40628e(0xdd)];if(_0x4839b2===_0x40628e(0x140)){let {task_id:_0x3bc418,text:_0x1de0ca,status:_0x263921}=_0x3a9677;if(_0x263921===_0x40628e(0xe5)||_0x263921===_0x40628e(0x13d)||_0x263921==='cancelled'){let _0x38030d=_0x263921===_0x40628e(0xe5)?'replied':_0x263921,_0x149892=_0x3bc418?k['get'](_0x3bc418)||'hub':_0x40628e(0xbb),_0x3afbef=await P(_0x40628e(0x129),{'alias':_0x149892,'text':_0x1de0ca,'in_reply_to':_0x3bc418||void 0x0,'status':_0x38030d,'from_session':Z});if(_0x3bc418)k['delete'](_0x3bc418);return{'content':[{'type':_0x40628e(0x134),'text':JSON[_0x40628e(0xba)](_0x3afbef)}]};}let _0x2b6696=await P(_0x40628e(0x12f),{'resume_id':w,'alias':Z,'status':_0x263921==='blocked'?_0x40628e(0xbd):_0x263921==='error'?_0x40628e(0xfa):_0x40628e(0xea),'task':_0x1de0ca[_0x40628e(0x123)](0x0,0xc8),'output':_0x1de0ca});return{'content':[{'type':_0x40628e(0x134),'text':JSON['stringify'](_0x2b6696)}]};}if(_0x4839b2===_0x40628e(0x13c)){let {status:_0x2b3901,task:_0x4514b5,progress:_0x5b97b0}=_0x3a9677,_0x57dec0=await P(_0x40628e(0x12f),{'resume_id':w,'alias':Z,'status':_0x2b3901,'task':_0x4514b5,'progress':_0x5b97b0});return{'content':[{'type':_0x40628e(0x134),'text':JSON[_0x40628e(0xba)](_0x57dec0)}]};}if(_0x4839b2===_0x40628e(0x12c)){let {alias:_0x3a2648,task:_0x56279b,priority:_0x35babe}=_0x3a9677,_0x4c4d6b=await P(_0x40628e(0xbf),{'alias':_0x3a2648,'task':_0x56279b,'priority':_0x35babe||_0x40628e(0x142),'from_session':Z});return{'content':[{'type':_0x40628e(0x134),'text':JSON[_0x40628e(0xba)](_0x4c4d6b)}]};}if(_0x4839b2==='commhub_send_message'){let {alias:_0x23aa9f,message:_0x25c52f}=_0x3a9677,_0x22d1a1=await P(_0x40628e(0xe6),{'alias':_0x23aa9f,'message':_0x25c52f,'from_session':Z});return{'content':[{'type':_0x40628e(0x134),'text':JSON['stringify'](_0x22d1a1)}]};}if(_0x4839b2===_0x40628e(0x117)){let _0x11fbb6=await P(_0x40628e(0x113),{});return{'content':[{'type':_0x40628e(0x134),'text':JSON[_0x40628e(0xba)](_0x11fbb6)}]};}return{'content':[{'type':'text','text':JSON[_0x40628e(0xba)]({'error':_0x40628e(0xb5)})}]};});async function u(){const _0x456e9d=a0_0x3f4d20;let _0x11ad86=f+_0x456e9d(0xe0)+encodeURIComponent(Z),_0x35e2d3={};if(X)_0x35e2d3[_0x456e9d(0x12a)]=_0x456e9d(0xd8)+X;Y('connecting\x20to\x20'+_0x11ad86);while(!0x0){try{let _0x415672=await fetch(_0x11ad86,{'headers':_0x35e2d3});if(!_0x415672['ok']){Y(_0x456e9d(0x109)+_0x415672['status']+'\x20'+_0x415672[_0x456e9d(0xf2)]),await h(0x1388);continue;}let _0x3fc720=_0x415672['body'][_0x456e9d(0xf5)](),_0x1be529=new TextDecoder(),_0x56c747='';while(!0x0){let {done:_0x4961ac,value:_0x3e1db0}=await _0x3fc720[_0x456e9d(0xd9)]();if(_0x4961ac)break;_0x56c747+=_0x1be529[_0x456e9d(0xca)](_0x3e1db0,{'stream':!0x0});let _0x5ace71=_0x56c747[_0x456e9d(0xce)]('\x0a\x0a');_0x56c747=_0x5ace71['pop']()||'';for(let _0x12f223 of _0x5ace71){let _0x4a412e=_0x12f223[_0x456e9d(0xce)]('\x0a')[_0x456e9d(0x120)](_0xd42959=>_0xd42959['startsWith'](_0x456e9d(0x108)));if(!_0x4a412e)continue;try{let _0x21cbc7=JSON[_0x456e9d(0xc3)](_0x4a412e[_0x456e9d(0x123)](0x6));await S(_0x21cbc7);}catch(_0x3c2515){Y(_0x456e9d(0x136)+_0x3c2515);}}}Y('SSE\x20stream\x20ended,\x20reconnecting...');}catch(_0x4cf8e9){Y(_0x456e9d(0xff)+_0x4cf8e9);}await h(0xbb8);}}async function S(_0xa662b3){const _0x158326=a0_0x3f4d20;if(_0xa662b3[_0x158326(0xe8)]==='connected'){Y('SSE\x20connected\x20as\x20\x22'+Z+'\x22');return;}if(_0xa662b3[_0x158326(0xe8)]===_0x158326(0xf0)){if(Y('←\x20message\x20from\x20'+_0xa662b3[_0x158326(0xc7)]+':\x20'+_0xa662b3['message'][_0x158326(0x123)](0x0,0x3c)),await K['notification']({'method':_0x158326(0xe7),'params':{'content':_0xa662b3['message'],'meta':{'sender':_0xa662b3[_0x158326(0xc7)]||'hub','sender_id':_0x158326(0xf3),'user':_0xa662b3['from']||'hub','priority':_0x158326(0x142)}}}),_0xa662b3[_0x158326(0x133)])await P('ack_inbox',{'alias':Z,'message_id':_0xa662b3[_0x158326(0x133)]});return;}if(_0xa662b3['type']===_0x158326(0x106)||_0xa662b3['type']===_0x158326(0x11e)){Y('←\x20'+_0xa662b3['type']+_0x158326(0xed)+_0xa662b3['inbox_count']+'\x20priority='+(_0xa662b3[_0x158326(0x11a)]||'normal'));let _0x41ecb2=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0x41ecb2?.['ok']&&_0x41ecb2[_0x158326(0x138)]?.[_0x158326(0xcb)]>0x0)for(let _0x262a8b of _0x41ecb2[_0x158326(0x138)]){let _0x453a47={'sender':_0x262a8b[_0x158326(0xcf)]||_0x158326(0xbb),'sender_id':'commhub','user':_0x262a8b[_0x158326(0xcf)]||'hub','task_id':_0x262a8b['id'],'priority':_0x262a8b['priority']||_0x158326(0x142)};k[_0x158326(0xc9)](_0x262a8b['id'],_0x262a8b['from_session']||_0x158326(0xbb)),await K[_0x158326(0x10f)]({'method':'notifications/claude/channel','params':{'content':_0x262a8b[_0x158326(0x104)],'meta':_0x453a47}}),Y(_0x158326(0x12b)+_0x262a8b['id'][_0x158326(0x123)](0x0,0x8)+_0x158326(0xfb)+_0x262a8b[_0x158326(0xcf)]+':\x20'+_0x262a8b[_0x158326(0x104)][_0x158326(0x123)](0x0,0x3c)),await P('ack_inbox',{'alias':Z,'message_id':_0x262a8b['id']});}}}async function A(){const _0x31ee7a=a0_0x3f4d20;let _0x462beb=new a0_0x3843ba();await K[_0x31ee7a(0xda)](_0x462beb),Y(_0x31ee7a(0x11d)),Y(_0x31ee7a(0x13e)),u()[_0x31ee7a(0xb7)](_0x5b44e2=>Y(_0x31ee7a(0xe9)+_0x5b44e2)),P(_0x31ee7a(0x12f),{'resume_id':w,'alias':Z,'status':_0x31ee7a(0xb6),'server':a0_0x4f7831(),'hostname':a0_0x4f7831(),'agent':_0x31ee7a(0x145),'project_dir':process[_0x31ee7a(0x135)](),'tmux_name':j||void 0x0})[_0x31ee7a(0xd4)](()=>Y(_0x31ee7a(0x102)+Z+_0x31ee7a(0xe4)+w['slice'](0x0,0x8)+')'))[_0x31ee7a(0xb7)](_0x51cf8d=>Y(_0x31ee7a(0xbe)+_0x51cf8d)),setInterval(()=>{const _0xa3cd9a=_0x31ee7a;P('report_status',{'resume_id':w,'alias':Z,'status':_0xa3cd9a(0xb6),'server':a0_0x4f7831(),'hostname':a0_0x4f7831(),'agent':'claude-code','project_dir':process[_0xa3cd9a(0x135)](),'tmux_name':j||void 0x0})[_0xa3cd9a(0xb7)](_0x54a917=>Y(_0xa3cd9a(0x144)+_0x54a917));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}A()[a0_0x3f4d20(0xb7)](_0x3f943d=>{const _0x295265=a0_0x3f4d20;Y(_0x295265(0xde)+_0x3f943d),process[_0x295265(0x10e)](0x1);});async function N(){const _0x52ffd5=a0_0x3f4d20;Y(_0x52ffd5(0xd7)),await P(_0x52ffd5(0x12f),{'resume_id':w,'alias':Z,'status':_0x52ffd5(0xfa),'task':_0x52ffd5(0xd6)})['catch'](()=>{}),process['exit'](0x0);}function a0_0xd0c1(_0x1bdc55,_0x27702e){_0x1bdc55=_0x1bdc55-0xb5;const _0x30fe02=a0_0x30fe();let _0xd0c147=_0x30fe02[_0x1bdc55];return _0xd0c147;}process[a0_0x3f4d20(0x118)]['on'](a0_0x3f4d20(0xd2),()=>N()),process['on'](a0_0x3f4d20(0xd1),()=>N()),process['on'](a0_0x3f4d20(0x10d),()=>N());function a0_0x30fe(){const _0x51e76d=['error','\x20from\x20','Progress\x200-100','in_progress','19677aHhZpc','SSE\x20connection\x20error:\x20','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','POST','registered\x20as\x20\x22','2025-03-26','content','task','new_task','2.0','data:\x20','SSE\x20error:\x20','token','setRequestHandler','CommHub\x20init\x20failed:\x20','SIGINT','exit','notification','commhub_send_message','application/json,\x20text/event-stream','42ruNkGn','get_all_status','commhub-channel','init\x20failed:\x20','4373691DcWzmr','commhub_get_all_status','stdin','Current\x20task\x20description','priority','8222080GZxtjt','.env','MCP\x20stdio\x20connected','broadcast','Task\x20content','find','...\x20TMUX=','\x20CWD=','slice',']\x20[commhub]\x20','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','1808pYQVNU','11QKUqFG','low','send_reply','Authorization','→\x20injected\x20task\x20','commhub_send_task','Message\x20content','tmux\x20display-message\x20-p\x20\x27#S\x27','report_status','ENV:\x20URL=','6957DFtOGV','replace','message_id','text','cwd','parse\x20error:\x20','startsWith','messages','cancelled','5045AbTcWW','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','commhub_report_status','failed','starting\x20SSE\x20listener...','Priority\x20(default:\x20normal)','commhub_reply','\x20RESUME_ID=','normal','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','heartbeat\x20failed:\x20','claude-code','unknown\x20tool','idle','catch','application/json','status','stringify','hub','.anet','blocked','warning:\x20could\x20not\x20register:\x20','send_task','none','config.json','number','parse','Session\x20alias:\x20','3308RwccHH','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','from','alias','set','decode','length','0.3.0','1601376GHRQod','split','from_session','toTimeString','SIGTERM','end','initialize','then','tools/call','session\x20disconnected','shutting\x20down,\x20reporting\x20offline...','Bearer\x20','read','connect','join','object','params','fatal:\x20','trim','/events/','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','write','13270YAgpif','\x22\x20(','completed','send_message','notifications/claude/channel','type','SSE\x20fatal:\x20','working','result','stderr',':\x20inbox_count=','utf-8','/mcp','new_message','string','statusText','commhub','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','getReader','Target\x20session\x20alias','high','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'];a0_0x30fe=function(){return _0x51e76d;};return a0_0x30fe();}
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.7-preview.0",
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",