@sleep2agi/agent-network 2.0.0-preview.20 → 2.0.0-preview.21

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_0x4ced14=a0_0x3299;function a0_0x3299(_0x146f96,_0x5c3219){_0x146f96=_0x146f96-0x7b;const _0x2ef8cd=a0_0x2ef8();let _0x3299ef=_0x2ef8cd[_0x146f96];return _0x3299ef;}(function(_0x2c1816,_0x449e4a){const _0x3d5874=a0_0x3299,_0x2d6b8b=_0x2c1816();while(!![]){try{const _0x2bdac5=-parseInt(_0x3d5874(0xca))/0x1+parseInt(_0x3d5874(0xd2))/0x2+parseInt(_0x3d5874(0xad))/0x3+parseInt(_0x3d5874(0xd4))/0x4*(-parseInt(_0x3d5874(0xd1))/0x5)+parseInt(_0x3d5874(0xd6))/0x6+parseInt(_0x3d5874(0xa5))/0x7+parseInt(_0x3d5874(0xd0))/0x8*(-parseInt(_0x3d5874(0x7d))/0x9);if(_0x2bdac5===_0x449e4a)break;else _0x2d6b8b['push'](_0x2d6b8b['shift']());}catch(_0x8ccf10){_0x2d6b8b['push'](_0x2d6b8b['shift']());}}}(a0_0x2ef8,0x2f91d));import{EventEmitter as a0_0x14de88}from'events';function a0_0x2ef8(){const _0x2c6feb=['/events/','connected','cwd','1536WHTOPT','550pYzyaf','159070vdMQpG','sdk','156kHeTbr','running','1771854ytoQpp','data:\x20','signal','24372xcViud','url','type','read','connect','s...','body','offline','from_session','resumeId','inbox\x20error:\x20','error','agent','messages','connectSSE','token','message','completed','SSE\x20reconnecting\x20in\x20','POST','replace','status','get_inbox','abort','Bearer\x20','alias','log','getAllStatus','heartbeatTimer','processInbox','registered','AbortError','server','idle','task','pop','call','sdk-','application/json','min','2366840tJKhyI','getReader','reconnectDelay','catch','heartbeat\x20failed:\x20','decode','send','startsWith','1010346iNoHSv','SSE\x20failed:\x20','broadcast','slice','autoConnect','parse',']\x20[commhub:','content','Authorization','normal','reply','match','get_all_status','toTimeString','emit','send_message','sseAbort','now','SSE\x20error:\x20','heartbeatInterval','application/json,\x20text/event-stream','report_status','SSE\x20connected','text/event-stream','new_message','name','2.0','text','sleep','330675ZZgnnT','new_task','stringify'];a0_0x2ef8=function(){return _0x2c6feb;};return a0_0x2ef8();}import{hostname as a0_0x12598a}from'os';class T extends a0_0x14de88{['url'];[a0_0x4ced14(0x96)];[a0_0x4ced14(0x8c)];[a0_0x4ced14(0x89)];['resumeId'];[a0_0x4ced14(0xc0)];[a0_0x4ced14(0xa7)];['heartbeatTimer'];[a0_0x4ced14(0xbd)];[a0_0x4ced14(0xd5)]=!0x1;constructor(_0x2c6d03){const _0x1d8f92=a0_0x4ced14;super();if(this[_0x1d8f92(0x7e)]=_0x2c6d03['url'][_0x1d8f92(0x91)](/\/$/,''),this[_0x1d8f92(0x96)]=_0x2c6d03['alias'],this[_0x1d8f92(0x8c)]=_0x2c6d03['token'],this[_0x1d8f92(0x89)]=_0x2c6d03[_0x1d8f92(0x89)]||_0x1d8f92(0xd3),this[_0x1d8f92(0x86)]=_0x1d8f92(0xa2)+_0x2c6d03[_0x1d8f92(0x96)]+'-'+Date[_0x1d8f92(0xbe)]()['toString'](0x24),this[_0x1d8f92(0xc0)]=_0x2c6d03[_0x1d8f92(0xc0)]??0x2bf20,this[_0x1d8f92(0xa7)]=_0x2c6d03[_0x1d8f92(0xa7)]??0xbb8,_0x2c6d03[_0x1d8f92(0xb1)]!==!0x1)this['connect']();}[a0_0x4ced14(0x97)](_0x32ea9e){const _0x4609dd=a0_0x4ced14;console[_0x4609dd(0x97)]('['+new Date()[_0x4609dd(0xba)]()[_0x4609dd(0xb0)](0x0,0x8)+_0x4609dd(0xb3)+this[_0x4609dd(0x96)]+']\x20'+_0x32ea9e);}async[a0_0x4ced14(0xa1)](_0x346395,_0x3f96e9){const _0x21362c=a0_0x4ced14;let _0x3f6cfb={'Content-Type':_0x21362c(0xa3),'Accept':_0x21362c(0xc1)};if(this[_0x21362c(0x8c)])_0x3f6cfb[_0x21362c(0xb5)]='Bearer\x20'+this[_0x21362c(0x8c)];let _0x14d6d4=await(await fetch(this[_0x21362c(0x7e)]+'/mcp',{'method':_0x21362c(0x90),'headers':_0x3f6cfb,'body':JSON[_0x21362c(0xcc)]({'jsonrpc':_0x21362c(0xc7),'id':Date['now'](),'method':'tools/call','params':{'name':_0x346395,'arguments':_0x3f96e9}})}))[_0x21362c(0xc8)](),_0x4ed5a1=_0x14d6d4[_0x21362c(0xb8)](/data: (.+)/),_0x1fe01d=_0x4ed5a1?JSON[_0x21362c(0xb2)](_0x4ed5a1[0x1]):JSON['parse'](_0x14d6d4),_0x35ddac=_0x1fe01d?.['result']?.[_0x21362c(0xb4)]?.[0x0]?.['text'];return _0x35ddac?JSON[_0x21362c(0xb2)](_0x35ddac):_0x1fe01d;}async[a0_0x4ced14(0x81)](){const _0x41f6ea=a0_0x4ced14;if(this[_0x41f6ea(0xd5)])return;this[_0x41f6ea(0xd5)]=!0x0,await this[_0x41f6ea(0x92)](_0x41f6ea(0x9e)),this[_0x41f6ea(0x97)](_0x41f6ea(0x9b)),this[_0x41f6ea(0x99)]=setInterval(()=>{const _0x1cd598=_0x41f6ea;this[_0x1cd598(0x92)]('idle')[_0x1cd598(0xa8)](_0x135d62=>this[_0x1cd598(0x97)](_0x1cd598(0xa9)+_0x135d62['message']));},this['heartbeatInterval']),this[_0x41f6ea(0x8b)]();}async['disconnect'](){const _0x1f0ac5=a0_0x4ced14;if(this['running']=!0x1,this[_0x1f0ac5(0xbd)]?.[_0x1f0ac5(0x94)](),this[_0x1f0ac5(0x99)])clearInterval(this[_0x1f0ac5(0x99)]);await this[_0x1f0ac5(0x92)](_0x1f0ac5(0x84))[_0x1f0ac5(0xa8)](()=>{}),this[_0x1f0ac5(0x97)]('disconnected');}async[a0_0x4ced14(0xab)](_0x509c3c,_0x39797b,_0x578e7c=a0_0x4ced14(0xb6)){const _0x3ed279=a0_0x4ced14;return this[_0x3ed279(0xa1)]('send_task',{'alias':_0x509c3c,'task':_0x39797b,'priority':_0x578e7c,'from_session':this[_0x3ed279(0x96)]});}async[a0_0x4ced14(0x8d)](_0x2ce930,_0x527d1c){const _0xdb6ff9=a0_0x4ced14;return this['call'](_0xdb6ff9(0xbc),{'alias':_0x2ce930,'message':_0x527d1c,'from_session':this[_0xdb6ff9(0x96)]});}async[a0_0x4ced14(0xb7)](_0xd42fcb,_0x389a67,_0x35bb45=a0_0x4ced14(0x8e)){return this['call']('reply',{'task_id':_0xd42fcb,'text':_0x389a67,'status':_0x35bb45});}async['status'](_0x4aa296,_0x5b5442){const _0x295d68=a0_0x4ced14;return this[_0x295d68(0xa1)](_0x295d68(0xc2),{'resume_id':this[_0x295d68(0x86)],'alias':this[_0x295d68(0x96)],'status':_0x4aa296,'server':a0_0x12598a(),'hostname':a0_0x12598a(),'agent':this[_0x295d68(0x89)],'project_dir':process[_0x295d68(0xcf)](),..._0x5b5442});}async[a0_0x4ced14(0x98)](){const _0x39baba=a0_0x4ced14;return this[_0x39baba(0xa1)](_0x39baba(0xb9),{});}async['broadcast'](_0x183500,_0x1057fa){const _0x22fb11=a0_0x4ced14;return this[_0x22fb11(0xa1)](_0x22fb11(0xaf),{'message':_0x183500,'filter_server':_0x1057fa?.[_0x22fb11(0x9d)],'filter_status':_0x1057fa?.[_0x22fb11(0x92)]});}async['connectSSE'](){const _0x2772af=a0_0x4ced14;let _0x5ebe76=encodeURIComponent(this[_0x2772af(0x96)]),_0x2e3690=this['url']+_0x2772af(0xcd)+_0x5ebe76,_0x242145=this['reconnectDelay'];while(this[_0x2772af(0xd5)]){try{this['sseAbort']=new AbortController();let _0x3342ee={'Accept':_0x2772af(0xc4)};if(this[_0x2772af(0x8c)])_0x3342ee['Authorization']=_0x2772af(0x95)+this['token'];let _0x2b4959=await fetch(_0x2e3690,{'headers':_0x3342ee,'signal':this[_0x2772af(0xbd)][_0x2772af(0x7c)]});if(!_0x2b4959['ok']||!_0x2b4959[_0x2772af(0x83)]){this[_0x2772af(0x97)](_0x2772af(0xae)+_0x2b4959[_0x2772af(0x92)]),await this[_0x2772af(0xc9)](_0x242145),_0x242145=Math[_0x2772af(0xa4)](_0x242145*1.5,0xea60);continue;}_0x242145=this[_0x2772af(0xa7)];let _0x5dd1fd=_0x2b4959['body'][_0x2772af(0xa6)](),_0x3fba34=new TextDecoder(),_0x54792b='';while(this[_0x2772af(0xd5)]){let {done:_0x289aa6,value:_0x1988f7}=await _0x5dd1fd[_0x2772af(0x80)]();if(_0x289aa6)break;_0x54792b+=_0x3fba34[_0x2772af(0xaa)](_0x1988f7,{'stream':!0x0});let _0x51d098=_0x54792b['split']('\x0a');_0x54792b=_0x51d098[_0x2772af(0xa0)]()||'';for(let _0x355bbb of _0x51d098){if(!_0x355bbb[_0x2772af(0xac)](_0x2772af(0x7b)))continue;try{let _0x16bdd8=JSON[_0x2772af(0xb2)](_0x355bbb['slice'](0x6));if(_0x16bdd8['type']===_0x2772af(0xce)){this['log'](_0x2772af(0xc3)),this[_0x2772af(0xbb)](_0x2772af(0xce));continue;}if(_0x16bdd8[_0x2772af(0x7f)]===_0x2772af(0xcb)||_0x16bdd8[_0x2772af(0x7f)]===_0x2772af(0xc5)||_0x16bdd8['type']==='broadcast')await this[_0x2772af(0x9a)]();}catch{}}}}catch(_0xb4ae13){if(_0xb4ae13[_0x2772af(0xc6)]===_0x2772af(0x9c))break;this['emit'](_0x2772af(0x88),_0xb4ae13),this['log'](_0x2772af(0xbf)+_0xb4ae13[_0x2772af(0x8d)]);}if(this[_0x2772af(0xd5)])this[_0x2772af(0xbb)]('disconnected'),this['log'](_0x2772af(0x8f)+_0x242145/0x3e8+_0x2772af(0x82)),await this[_0x2772af(0xc9)](_0x242145),_0x242145=Math[_0x2772af(0xa4)](_0x242145*1.5,0xea60);}}async[a0_0x4ced14(0x9a)](){const _0x2f9c91=a0_0x4ced14;try{let _0x16c331=(await this[_0x2f9c91(0xa1)](_0x2f9c91(0x93),{'alias':this[_0x2f9c91(0x96)],'limit':0xa}))?.[_0x2f9c91(0x8a)]||[];for(let _0x58697d of _0x16c331)await this[_0x2f9c91(0xa1)]('ack_inbox',{'alias':this[_0x2f9c91(0x96)],'message_id':_0x58697d['id']}),this[_0x2f9c91(0x97)]('←\x20'+_0x58697d[_0x2f9c91(0x85)]+':\x20'+_0x58697d['content']['slice'](0x0,0x3c)),this[_0x2f9c91(0xbb)](_0x2f9c91(0x9f),_0x58697d),this[_0x2f9c91(0xbb)](_0x2f9c91(0x8d),_0x58697d);}catch(_0x40c696){this[_0x2f9c91(0x97)](_0x2f9c91(0x87)+_0x40c696[_0x2f9c91(0x8d)]);}}[a0_0x4ced14(0xc9)](_0x2a0511){return new Promise(_0x2b8fec=>setTimeout(_0x2b8fec,_0x2a0511));}}var $=T;export{$ as default,T as CommHub};
1
+ function a0_0x2392(_0x8840fb,_0x4e55b3){_0x8840fb=_0x8840fb-0x75;const _0x202208=a0_0x2022();let _0x239206=_0x202208[_0x8840fb];return _0x239206;}const a0_0x170e14=a0_0x2392;function a0_0x2022(){const _0x31ee7b=['disconnected','match','Authorization','text/event-stream','now','1851344GIepXT','cwd','reply','send_message',']\x20[commhub:','s...','getReader','body','AbortError','split','1602632oPxIUU','url','inbox\x20error:\x20','91285xGCpgV','offline','heartbeatInterval','report_status','running','messages','autoConnect','decode','stringify','signal','agent','emit','SSE\x20failed:\x20','tools/call','SSE\x20connected','heartbeatTimer','token','72QVyvMg','content','new_message','sdk-','log','Bearer\x20','from_session','application/json','sleep','parse','error','/events/','message','data:\x20','call','reconnectDelay','broadcast','text','1tnSRYC','status','slice','resumeId','type','send_task','9moPJxu','connectSSE','get_inbox','toTimeString','task','read','heartbeat\x20failed:\x20','284918VTYEyY','pop','send','666988jtUhwH','25860MDZuOO','processInbox','min','42FPbqmT','idle','catch','sseAbort','connect','alias','name','1654220kgdyzW','registered','/mcp','normal'];a0_0x2022=function(){return _0x31ee7b;};return a0_0x2022();}(function(_0x33772d,_0x11a3e0){const _0x429103=a0_0x2392,_0x620f62=_0x33772d();while(!![]){try{const _0x1d9194=parseInt(_0x429103(0x7d))/0x1*(parseInt(_0x429103(0x8a))/0x2)+-parseInt(_0x429103(0xbf))/0x3*(-parseInt(_0x429103(0x8e))/0x4)+parseInt(_0x429103(0xae))/0x5*(-parseInt(_0x429103(0x91))/0x6)+parseInt(_0x429103(0x8d))/0x7+parseInt(_0x429103(0xab))/0x8*(parseInt(_0x429103(0x83))/0x9)+-parseInt(_0x429103(0x98))/0xa+-parseInt(_0x429103(0xa1))/0xb;if(_0x1d9194===_0x11a3e0)break;else _0x620f62['push'](_0x620f62['shift']());}catch(_0x5c329c){_0x620f62['push'](_0x620f62['shift']());}}}(a0_0x2022,0x2027b));import{EventEmitter as a0_0x2b37e1}from'events';import{hostname as a0_0x56cda4}from'os';class T extends a0_0x2b37e1{[a0_0x170e14(0xac)];['alias'];[a0_0x170e14(0xbe)];[a0_0x170e14(0xb8)];[a0_0x170e14(0x80)];[a0_0x170e14(0xb0)];[a0_0x170e14(0x7a)];[a0_0x170e14(0xbd)];[a0_0x170e14(0x94)];['running']=!0x1;constructor(_0x520eb2){const _0x1e6715=a0_0x170e14;super();if(this[_0x1e6715(0xac)]=_0x520eb2[_0x1e6715(0xac)]['replace'](/\/$/,''),this['alias']=_0x520eb2['alias'],this[_0x1e6715(0xbe)]=_0x520eb2[_0x1e6715(0xbe)],this[_0x1e6715(0xb8)]=_0x520eb2[_0x1e6715(0xb8)]||'sdk',this['resumeId']=_0x1e6715(0xc2)+_0x520eb2[_0x1e6715(0x96)]+'-'+Date[_0x1e6715(0xa0)]()['toString'](0x24),this[_0x1e6715(0xb0)]=_0x520eb2[_0x1e6715(0xb0)]??0x2bf20,this[_0x1e6715(0x7a)]=_0x520eb2[_0x1e6715(0x7a)]??0xbb8,_0x520eb2[_0x1e6715(0xb4)]!==!0x1)this[_0x1e6715(0x95)]();}[a0_0x170e14(0xc3)](_0x5d66e4){const _0xb55926=a0_0x170e14;console[_0xb55926(0xc3)]('['+new Date()[_0xb55926(0x86)]()[_0xb55926(0x7f)](0x0,0x8)+_0xb55926(0xa5)+this[_0xb55926(0x96)]+']\x20'+_0x5d66e4);}async['call'](_0x3f72a4,_0x1840c7){const _0xa32484=a0_0x170e14;let _0x4a0049={'Content-Type':_0xa32484(0xc6),'Accept':'application/json,\x20text/event-stream'};if(this[_0xa32484(0xbe)])_0x4a0049[_0xa32484(0x9e)]=_0xa32484(0xc4)+this['token'];let _0x125245=await(await fetch(this[_0xa32484(0xac)]+_0xa32484(0x9a),{'method':'POST','headers':_0x4a0049,'body':JSON[_0xa32484(0xb6)]({'jsonrpc':'2.0','id':Date[_0xa32484(0xa0)](),'method':_0xa32484(0xbb),'params':{'name':_0x3f72a4,'arguments':_0x1840c7}})}))[_0xa32484(0x7c)](),_0x51efb3=_0x125245[_0xa32484(0x9d)](/data: (.+)/),_0x32a627=_0x51efb3?JSON['parse'](_0x51efb3[0x1]):JSON[_0xa32484(0xc8)](_0x125245),_0x18cb07=_0x32a627?.['result']?.[_0xa32484(0xc0)]?.[0x0]?.[_0xa32484(0x7c)];return _0x18cb07?JSON[_0xa32484(0xc8)](_0x18cb07):_0x32a627;}async[a0_0x170e14(0x95)](){const _0x829d2=a0_0x170e14;if(this[_0x829d2(0xb2)])return;this[_0x829d2(0xb2)]=!0x0,await this[_0x829d2(0x7e)](_0x829d2(0x92)),this[_0x829d2(0xc3)](_0x829d2(0x99)),this[_0x829d2(0xbd)]=setInterval(()=>{const _0x25226f=_0x829d2;this['status'](_0x25226f(0x92))[_0x25226f(0x93)](_0x47325a=>this['log'](_0x25226f(0x89)+_0x47325a[_0x25226f(0x77)]));},this['heartbeatInterval']),this[_0x829d2(0x84)]();}async['disconnect'](){const _0x1b72df=a0_0x170e14;if(this['running']=!0x1,this[_0x1b72df(0x94)]?.['abort'](),this[_0x1b72df(0xbd)])clearInterval(this[_0x1b72df(0xbd)]);await this[_0x1b72df(0x7e)](_0x1b72df(0xaf))[_0x1b72df(0x93)](()=>{}),this['log'](_0x1b72df(0x9c));}async[a0_0x170e14(0x8c)](_0x32ea11,_0x58591e,_0x202132=a0_0x170e14(0x9b)){const _0x427edf=a0_0x170e14;return this[_0x427edf(0x79)](_0x427edf(0x82),{'alias':_0x32ea11,'task':_0x58591e,'priority':_0x202132,'from_session':this['alias']});}async[a0_0x170e14(0x77)](_0x57d180,_0x8717b7){const _0x11db33=a0_0x170e14;return this[_0x11db33(0x79)](_0x11db33(0xa4),{'alias':_0x57d180,'message':_0x8717b7,'from_session':this[_0x11db33(0x96)]});}async[a0_0x170e14(0xa3)](_0x3e183c,_0x2433fb,_0x203a24='completed'){const _0x3ab21d=a0_0x170e14;return this['call'](_0x3ab21d(0xa3),{'task_id':_0x3e183c,'text':_0x2433fb,'status':_0x203a24});}async[a0_0x170e14(0x7e)](_0x19e2bc,_0x24fcf1){const _0x4e38a2=a0_0x170e14;return this[_0x4e38a2(0x79)](_0x4e38a2(0xb1),{'resume_id':this[_0x4e38a2(0x80)],'alias':this[_0x4e38a2(0x96)],'status':_0x19e2bc,'server':a0_0x56cda4(),'hostname':a0_0x56cda4(),'agent':this[_0x4e38a2(0xb8)],'project_dir':process[_0x4e38a2(0xa2)](),..._0x24fcf1});}async['getAllStatus'](){const _0x354ba7=a0_0x170e14;return this[_0x354ba7(0x79)]('get_all_status',{});}async[a0_0x170e14(0x7b)](_0xf75f1a,_0x4d7340){const _0x53fac9=a0_0x170e14;return this['call'](_0x53fac9(0x7b),{'message':_0xf75f1a,'filter_server':_0x4d7340?.['server'],'filter_status':_0x4d7340?.[_0x53fac9(0x7e)]});}async['connectSSE'](){const _0x4ec15c=a0_0x170e14;let _0x58bdc7=encodeURIComponent(this[_0x4ec15c(0x96)]),_0x2b16bd=this['url']+_0x4ec15c(0x76)+_0x58bdc7,_0x29d088=this[_0x4ec15c(0x7a)];while(this[_0x4ec15c(0xb2)]){try{this[_0x4ec15c(0x94)]=new AbortController();let _0x3ce61b={'Accept':_0x4ec15c(0x9f)};if(this[_0x4ec15c(0xbe)])_0x3ce61b[_0x4ec15c(0x9e)]=_0x4ec15c(0xc4)+this[_0x4ec15c(0xbe)];let _0x994a1d=await fetch(_0x2b16bd,{'headers':_0x3ce61b,'signal':this[_0x4ec15c(0x94)][_0x4ec15c(0xb7)]});if(!_0x994a1d['ok']||!_0x994a1d[_0x4ec15c(0xa8)]){this['log'](_0x4ec15c(0xba)+_0x994a1d[_0x4ec15c(0x7e)]),await this[_0x4ec15c(0xc7)](_0x29d088),_0x29d088=Math[_0x4ec15c(0x90)](_0x29d088*1.5,0xea60);continue;}_0x29d088=this[_0x4ec15c(0x7a)];let _0x1f2124=_0x994a1d[_0x4ec15c(0xa8)][_0x4ec15c(0xa7)](),_0x36cac8=new TextDecoder(),_0x4a6da1='';while(this[_0x4ec15c(0xb2)]){let {done:_0x3642aa,value:_0xb61ea9}=await _0x1f2124[_0x4ec15c(0x88)]();if(_0x3642aa)break;_0x4a6da1+=_0x36cac8[_0x4ec15c(0xb5)](_0xb61ea9,{'stream':!0x0});let _0x425080=_0x4a6da1[_0x4ec15c(0xaa)]('\x0a');_0x4a6da1=_0x425080[_0x4ec15c(0x8b)]()||'';for(let _0x45d1d3 of _0x425080){if(!_0x45d1d3['startsWith'](_0x4ec15c(0x78)))continue;try{let _0x110489=JSON[_0x4ec15c(0xc8)](_0x45d1d3[_0x4ec15c(0x7f)](0x6));if(_0x110489[_0x4ec15c(0x81)]==='connected'){this[_0x4ec15c(0xc3)](_0x4ec15c(0xbc)),this[_0x4ec15c(0xb9)]('connected');continue;}if(_0x110489[_0x4ec15c(0x81)]==='new_task'||_0x110489[_0x4ec15c(0x81)]===_0x4ec15c(0xc1)||_0x110489[_0x4ec15c(0x81)]===_0x4ec15c(0x7b))await this['processInbox']();}catch{}}}}catch(_0x32d560){if(_0x32d560[_0x4ec15c(0x97)]===_0x4ec15c(0xa9))break;this[_0x4ec15c(0xb9)](_0x4ec15c(0x75),_0x32d560),this[_0x4ec15c(0xc3)]('SSE\x20error:\x20'+_0x32d560['message']);}if(this[_0x4ec15c(0xb2)])this[_0x4ec15c(0xb9)]('disconnected'),this[_0x4ec15c(0xc3)]('SSE\x20reconnecting\x20in\x20'+_0x29d088/0x3e8+_0x4ec15c(0xa6)),await this[_0x4ec15c(0xc7)](_0x29d088),_0x29d088=Math[_0x4ec15c(0x90)](_0x29d088*1.5,0xea60);}}async[a0_0x170e14(0x8f)](){const _0x2ab14d=a0_0x170e14;try{let _0x217587=(await this[_0x2ab14d(0x79)](_0x2ab14d(0x85),{'alias':this[_0x2ab14d(0x96)],'limit':0xa}))?.[_0x2ab14d(0xb3)]||[];for(let _0x1f03a7 of _0x217587)await this['call']('ack_inbox',{'alias':this[_0x2ab14d(0x96)],'message_id':_0x1f03a7['id']}),this[_0x2ab14d(0xc3)]('←\x20'+_0x1f03a7[_0x2ab14d(0xc5)]+':\x20'+_0x1f03a7[_0x2ab14d(0xc0)]['slice'](0x0,0x3c)),this[_0x2ab14d(0xb9)](_0x2ab14d(0x87),_0x1f03a7),this[_0x2ab14d(0xb9)]('message',_0x1f03a7);}catch(_0x6e9075){this['log'](_0x2ab14d(0xad)+_0x6e9075[_0x2ab14d(0x77)]);}}['sleep'](_0x52bc46){return new Promise(_0x22b9d6=>setTimeout(_0x22b9d6,_0x52bc46));}}var $=T;export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x2f5f5a=a0_0x435d;(function(_0x43b623,_0x12010a){const _0x4259a2=a0_0x435d,_0x285496=_0x43b623();while(!![]){try{const _0x186094=-parseInt(_0x4259a2(0xec))/0x1*(-parseInt(_0x4259a2(0x114))/0x2)+parseInt(_0x4259a2(0x10a))/0x3*(-parseInt(_0x4259a2(0x132))/0x4)+parseInt(_0x4259a2(0x105))/0x5*(parseInt(_0x4259a2(0x161))/0x6)+-parseInt(_0x4259a2(0x158))/0x7+-parseInt(_0x4259a2(0x147))/0x8*(parseInt(_0x4259a2(0xf7))/0x9)+-parseInt(_0x4259a2(0x134))/0xa+-parseInt(_0x4259a2(0x104))/0xb*(-parseInt(_0x4259a2(0x172))/0xc);if(_0x186094===_0x12010a)break;else _0x285496['push'](_0x285496['shift']());}catch(_0x3fc92b){_0x285496['push'](_0x285496['shift']());}}}(a0_0x3ae2,0xcd099));import{readFileSync as a0_0x55e6e4,existsSync as a0_0x48526e}from'fs';import{join as a0_0x1ff871}from'path';import{hostname as a0_0x161551}from'os';import{execSync as a0_0x3ba3a2}from'child_process';import{Server as a0_0x5219ed}from'@modelcontextprotocol/sdk/server/index.js';function a0_0x3ae2(){const _0xc45344=['message_id','ack_inbox','54376pbMYpa','then','SSE\x20connection\x20error:\x20','message','startsWith','application/json,\x20text/event-stream','Current\x20task\x20description','toTimeString','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','normal','initialize','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','split','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','POST','idle','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','9000579YqqeNp','SIGINT','catch','stderr','get_all_status','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','find','Bearer\x20','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','22746ErKdcR','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','←\x20message\x20from\x20','slice','unknown\x20tool','error','\x20RESUME_ID=','send_reply','http://127.0.0.1:9200','blocked','new_task','warning:\x20could\x20not\x20register:\x20','string','0.3.0','read','messages','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','24sOJcmw','Reply\x20text\x20/\x20result\x20summary','2.0','status','connected','1RiDfGU','set','completed','cancelled','get','replied','priority','working','claude-code','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','registered\x20as\x20\x22','1143XAlanI','...\x20TMUX=','session\x20disconnected','Session\x20alias:\x20','result','object','parse','commhub_get_all_status','randomUUID','shutting\x20down,\x20reporting\x20offline...','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','SSE\x20fatal:\x20','SSE\x20connected\x20as\x20\x22','17148505UnkaTf','55TTWkIS','\x22\x20(','new_message','\x20CWD=','hub','361758KPPTsf','trim','data:\x20','report_status','/mcp','write','alias','→\x20injected\x20task\x20','failed','application/json','1486550pgtBbA','stdin','.claude/channels/commhub','pop','SIGTERM','length','replace','end','Priority\x20(default:\x20normal)','content','notification',':\x20inbox_count=','cwd','in_progress','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','.env','/events/','decode','type','\x20ALIAS=','ready\x20—\x20waiting\x20for\x20events','send_message','from','Message\x20content','get_inbox','send_task','init\x20failed:\x20','inbox_count','getReader','\x20PROJECT_ENV=','16EzIzHf','from_session','4316930EzKSZQ','exit','high','commhub_report_status','utf-8','commhub_reply','connecting\x20to\x20','low','notifications/claude/channel','commhub_send_message','text','task','Progress\x200-100','SSE\x20stream\x20ended,\x20reconnecting...','stringify','commhub_send_task','none'];a0_0x3ae2=function(){return _0xc45344;};return a0_0x3ae2();}import{StdioServerTransport as a0_0xcb3d89}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x591d98,CallToolRequestSchema as a0_0x4749f3}from'@modelcontextprotocol/sdk/types.js';function p(_0x564fb9){const _0x46b256=a0_0x435d;if(!a0_0x48526e(_0x564fb9))return;for(let _0x4899de of a0_0x55e6e4(_0x564fb9,'utf-8')[_0x46b256(0x153)]('\x0a')){let _0x4c8f82=_0x4899de[_0x46b256(0x10b)]();if(!_0x4c8f82||_0x4c8f82['startsWith']('#'))continue;let _0x1e2784=_0x4c8f82['indexOf']('=');if(_0x1e2784<0x0)continue;let _0x4e7df6=_0x4c8f82[_0x46b256(0x164)](0x0,_0x1e2784)[_0x46b256(0x10b)](),_0x1c1115=_0x4c8f82['slice'](_0x1e2784+0x1)[_0x46b256(0x10b)]()[_0x46b256(0x11a)](/^["']|["']$/g,'');if(!process.env[_0x4e7df6])process.env[_0x4e7df6]=_0x1c1115;}}function a0_0x435d(_0x29673e,_0x56bbbf){_0x29673e=_0x29673e-0xe9;const _0x3ae2e2=a0_0x3ae2();let _0x435df6=_0x3ae2e2[_0x29673e];return _0x435df6;}var C=process.env.HOME||'~',T=a0_0x1ff871(C,a0_0x2f5f5a(0x116));p(a0_0x1ff871(T,a0_0x2f5f5a(0x123)));var L=process[a0_0x2f5f5a(0x120)]()[a0_0x2f5f5a(0x11a)](/\//g,'-');p(a0_0x1ff871(T,L,a0_0x2f5f5a(0x123)));function U(){const _0x5d7479=a0_0x2f5f5a;try{return a0_0x3ba3a2('tmux\x20display-message\x20-p\x20\x27#S\x27',{'encoding':_0x5d7479(0x138),'timeout':0x7d0})[_0x5d7479(0x10b)]();}catch{return'';}}function c(){const _0x2f610f=a0_0x2f5f5a;try{let _0x2810b2=a0_0x1ff871(C,'.anet','config.json');if(a0_0x48526e(_0x2810b2))return JSON[_0x2f610f(0xfd)](a0_0x55e6e4(_0x2810b2,_0x2f610f(0x138)));}catch{}return{};}var H=c(),D=process.env.COMMHUB_URL||H[a0_0x2f5f5a(0x109)]||a0_0x2f5f5a(0x169),f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0x161551(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto[a0_0x2f5f5a(0xff)](),X=process.env.COMMHUB_TOKEN||H['token']||'';function Y(_0x46f08d){const _0x1c2420=a0_0x2f5f5a;let _0x345970=new Date()[_0x1c2420(0x14e)]()['slice'](0x0,0x8);process[_0x1c2420(0x15b)][_0x1c2420(0x10f)]('['+_0x345970+']\x20[commhub]\x20'+_0x46f08d+'\x0a');}function h(_0x36b350){return new Promise(_0x51a785=>setTimeout(_0x51a785,_0x36b350));}Y('ENV:\x20URL='+D+a0_0x2f5f5a(0x127)+Z+a0_0x2f5f5a(0x167)+w[a0_0x2f5f5a(0x164)](0x0,0x8)+a0_0x2f5f5a(0xf8)+(f||a0_0x2f5f5a(0x144))+a0_0x2f5f5a(0x108)+process[a0_0x2f5f5a(0x120)]()+a0_0x2f5f5a(0x131)+L);var k=new Map(),K=new a0_0x5219ed({'name':'commhub-channel','version':a0_0x2f5f5a(0x16e)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x2f5f5a(0x122),a0_0x2f5f5a(0xf5),a0_0x2f5f5a(0x154),a0_0x2f5f5a(0x152),a0_0x2f5f5a(0xfa)+Z]['join']('\x0a')});K['setRequestHandler'](a0_0x591d98,async()=>({'tools':[{'name':'commhub_reply','description':a0_0x2f5f5a(0x160),'inputSchema':{'type':a0_0x2f5f5a(0xfc),'properties':{'task_id':{'type':a0_0x2f5f5a(0x16d),'description':a0_0x2f5f5a(0x157)},'text':{'type':a0_0x2f5f5a(0x16d),'description':a0_0x2f5f5a(0x173)},'status':{'type':a0_0x2f5f5a(0x16d),'enum':[a0_0x2f5f5a(0xee),a0_0x2f5f5a(0x112),a0_0x2f5f5a(0xef),'blocked','error',a0_0x2f5f5a(0x121)],'description':a0_0x2f5f5a(0x171)}},'required':[a0_0x2f5f5a(0x13e)]}},{'name':'commhub_report_status','description':a0_0x2f5f5a(0x101),'inputSchema':{'type':'object','properties':{'status':{'type':a0_0x2f5f5a(0x16d),'enum':[a0_0x2f5f5a(0xf3),a0_0x2f5f5a(0x156),a0_0x2f5f5a(0x16a),a0_0x2f5f5a(0x166)]},'task':{'type':a0_0x2f5f5a(0x16d),'description':a0_0x2f5f5a(0x14d)},'progress':{'type':'number','description':a0_0x2f5f5a(0x140)}},'required':[a0_0x2f5f5a(0xea)]}},{'name':a0_0x2f5f5a(0x143),'description':a0_0x2f5f5a(0x162),'inputSchema':{'type':a0_0x2f5f5a(0xfc),'properties':{'alias':{'type':a0_0x2f5f5a(0x16d),'description':'Target\x20session\x20alias'},'task':{'type':'string','description':'Task\x20content'},'priority':{'type':a0_0x2f5f5a(0x16d),'enum':[a0_0x2f5f5a(0x136),a0_0x2f5f5a(0x150),a0_0x2f5f5a(0x13b)],'description':a0_0x2f5f5a(0x11c)}},'required':[a0_0x2f5f5a(0x110),a0_0x2f5f5a(0x13f)]}},{'name':a0_0x2f5f5a(0x13d),'description':a0_0x2f5f5a(0x15d),'inputSchema':{'type':a0_0x2f5f5a(0xfc),'properties':{'alias':{'type':a0_0x2f5f5a(0x16d),'description':'Target\x20session\x20alias'},'message':{'type':a0_0x2f5f5a(0x16d),'description':a0_0x2f5f5a(0x12b)}},'required':['alias',a0_0x2f5f5a(0x14a)]}},{'name':a0_0x2f5f5a(0xfe),'description':a0_0x2f5f5a(0x14f),'inputSchema':{'type':a0_0x2f5f5a(0xfc),'properties':{}}}]}));async function P(_0x11eef4,_0x40a439){const _0x4b7160=a0_0x2f5f5a;let _0x28165d=await fetch(D+_0x4b7160(0x10e),{'method':_0x4b7160(0x155),'headers':{'Content-Type':_0x4b7160(0x113),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x4b7160(0xe9),'id':0x1,'method':_0x4b7160(0x151),'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':'commhub-channel','version':_0x4b7160(0x16e)}}})});if(!_0x28165d['ok']){let _0x4c4b9e=await _0x28165d[_0x4b7160(0x13e)]();return Y('CommHub\x20init\x20failed:\x20'+_0x28165d[_0x4b7160(0xea)]+'\x20'+_0x4c4b9e[_0x4b7160(0x164)](0x0,0x64)),{'ok':!0x1,'error':_0x4b7160(0x12e)+_0x28165d[_0x4b7160(0xea)]};}await _0x28165d['text']();let _0x399722=(await(await fetch(D+_0x4b7160(0x10e),{'method':_0x4b7160(0x155),'headers':{'Content-Type':_0x4b7160(0x113),'Accept':_0x4b7160(0x14c),...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON[_0x4b7160(0x142)]({'jsonrpc':_0x4b7160(0xe9),'id':0x2,'method':'tools/call','params':{'name':_0x11eef4,'arguments':_0x40a439}})}))[_0x4b7160(0x13e)]())[_0x4b7160(0x153)]('\x0a')[_0x4b7160(0x15e)](_0x241679=>_0x241679[_0x4b7160(0x14b)](_0x4b7160(0x10c)));if(_0x399722){let _0x4fbb63=JSON[_0x4b7160(0xfd)](_0x399722['slice'](0x6));return _0x4fbb63?.[_0x4b7160(0xfb)]?.[_0x4b7160(0x11d)]?.[0x0]?.['text']?JSON[_0x4b7160(0xfd)](_0x4fbb63['result']['content'][0x0][_0x4b7160(0x13e)]):_0x4fbb63;}return{'ok':!0x1,'error':'no\x20response'};}K['setRequestHandler'](a0_0x4749f3,async _0x27e9d3=>{const _0x28d0e6=a0_0x2f5f5a;let {name:_0x5676ba,arguments:_0x23fe83}=_0x27e9d3['params'];if(_0x5676ba===_0x28d0e6(0x139)){let {task_id:_0x38a0f8,text:_0x3a2f62,status:_0x3dbbe1}=_0x23fe83;if(_0x3dbbe1===_0x28d0e6(0xee)||_0x3dbbe1===_0x28d0e6(0x112)||_0x3dbbe1===_0x28d0e6(0xef)){let _0x23555a=_0x3dbbe1===_0x28d0e6(0xee)?_0x28d0e6(0xf1):_0x3dbbe1,_0x209aef=_0x38a0f8?k[_0x28d0e6(0xf0)](_0x38a0f8)||_0x28d0e6(0x109):'hub',_0x393485=await P(_0x28d0e6(0x168),{'alias':_0x209aef,'text':_0x3a2f62,'in_reply_to':_0x38a0f8||void 0x0,'status':_0x23555a,'from_session':Z});if(_0x38a0f8)k['delete'](_0x38a0f8);return{'content':[{'type':_0x28d0e6(0x13e),'text':JSON[_0x28d0e6(0x142)](_0x393485)}]};}let _0x103db9=await P(_0x28d0e6(0x10d),{'resume_id':w,'alias':Z,'status':_0x3dbbe1===_0x28d0e6(0x16a)?'blocked':_0x3dbbe1===_0x28d0e6(0x166)?_0x28d0e6(0x166):_0x28d0e6(0xf3),'task':_0x3a2f62[_0x28d0e6(0x164)](0x0,0xc8),'output':_0x3a2f62});return{'content':[{'type':_0x28d0e6(0x13e),'text':JSON[_0x28d0e6(0x142)](_0x103db9)}]};}if(_0x5676ba===_0x28d0e6(0x137)){let {status:_0x43e630,task:_0x4e163a,progress:_0x2fc70b}=_0x23fe83,_0x1da0f2=await P(_0x28d0e6(0x10d),{'resume_id':w,'alias':Z,'status':_0x43e630,'task':_0x4e163a,'progress':_0x2fc70b});return{'content':[{'type':_0x28d0e6(0x13e),'text':JSON[_0x28d0e6(0x142)](_0x1da0f2)}]};}if(_0x5676ba==='commhub_send_task'){let {alias:_0x4d02c9,task:_0x344c33,priority:_0x1ad12e}=_0x23fe83,_0x17146f=await P(_0x28d0e6(0x12d),{'alias':_0x4d02c9,'task':_0x344c33,'priority':_0x1ad12e||'normal','from_session':Z});return{'content':[{'type':'text','text':JSON[_0x28d0e6(0x142)](_0x17146f)}]};}if(_0x5676ba==='commhub_send_message'){let {alias:_0x3132a0,message:_0x36cf44}=_0x23fe83,_0xa4056a=await P(_0x28d0e6(0x129),{'alias':_0x3132a0,'message':_0x36cf44,'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x28d0e6(0x142)](_0xa4056a)}]};}if(_0x5676ba===_0x28d0e6(0xfe)){let _0x45ca04=await P(_0x28d0e6(0x15c),{});return{'content':[{'type':_0x28d0e6(0x13e),'text':JSON[_0x28d0e6(0x142)](_0x45ca04)}]};}return{'content':[{'type':_0x28d0e6(0x13e),'text':JSON[_0x28d0e6(0x142)]({'error':_0x28d0e6(0x165)})}]};});async function v(){const _0x45a9a4=a0_0x2f5f5a;let _0xa769d=D+_0x45a9a4(0x124)+encodeURIComponent(Z),_0x291a14={};if(X)_0x291a14['Authorization']=_0x45a9a4(0x15f)+X;Y(_0x45a9a4(0x13a)+_0xa769d);while(!0x0){try{let _0x1c8068=await fetch(_0xa769d,{'headers':_0x291a14});if(!_0x1c8068['ok']){Y('SSE\x20error:\x20'+_0x1c8068['status']+'\x20'+_0x1c8068['statusText']),await h(0x1388);continue;}let _0x584d76=_0x1c8068['body'][_0x45a9a4(0x130)](),_0x3ce61=new TextDecoder(),_0x31576d='';while(!0x0){let {done:_0x5c7ce1,value:_0x1ab236}=await _0x584d76[_0x45a9a4(0x16f)]();if(_0x5c7ce1)break;_0x31576d+=_0x3ce61[_0x45a9a4(0x125)](_0x1ab236,{'stream':!0x0});let _0x492b32=_0x31576d['split']('\x0a\x0a');_0x31576d=_0x492b32[_0x45a9a4(0x117)]()||'';for(let _0x278610 of _0x492b32){let _0x346fd9=_0x278610[_0x45a9a4(0x153)]('\x0a')[_0x45a9a4(0x15e)](_0xe5006a=>_0xe5006a[_0x45a9a4(0x14b)](_0x45a9a4(0x10c)));if(!_0x346fd9)continue;try{let _0xe4611e=JSON[_0x45a9a4(0xfd)](_0x346fd9[_0x45a9a4(0x164)](0x6));await u(_0xe4611e);}catch(_0x2d37ef){Y('parse\x20error:\x20'+_0x2d37ef);}}}Y(_0x45a9a4(0x141));}catch(_0x53e05a){Y(_0x45a9a4(0x149)+_0x53e05a);}await h(0xbb8);}}async function u(_0x182ff2){const _0x28fed7=a0_0x2f5f5a;if(_0x182ff2[_0x28fed7(0x126)]===_0x28fed7(0xeb)){Y(_0x28fed7(0x103)+Z+'\x22');return;}if(_0x182ff2[_0x28fed7(0x126)]===_0x28fed7(0x107)){if(Y(_0x28fed7(0x163)+_0x182ff2[_0x28fed7(0x12a)]+':\x20'+_0x182ff2['message'][_0x28fed7(0x164)](0x0,0x3c)),await K[_0x28fed7(0x11e)]({'method':_0x28fed7(0x13c),'params':{'content':_0x182ff2[_0x28fed7(0x14a)],'meta':{'sender':_0x182ff2[_0x28fed7(0x12a)]||_0x28fed7(0x109),'sender_id':'commhub','user':_0x182ff2[_0x28fed7(0x12a)]||'hub','priority':_0x28fed7(0x150)}}}),_0x182ff2[_0x28fed7(0x145)])await P(_0x28fed7(0x146),{'alias':Z,'message_id':_0x182ff2[_0x28fed7(0x145)]});return;}if(_0x182ff2[_0x28fed7(0x126)]===_0x28fed7(0x16b)||_0x182ff2[_0x28fed7(0x126)]==='broadcast'){Y('←\x20'+_0x182ff2['type']+_0x28fed7(0x11f)+_0x182ff2[_0x28fed7(0x12f)]+'\x20priority='+(_0x182ff2[_0x28fed7(0xf2)]||_0x28fed7(0x150)));let _0xc530cf=await P(_0x28fed7(0x12c),{'alias':Z,'limit':0x5});if(_0xc530cf?.['ok']&&_0xc530cf[_0x28fed7(0x170)]?.[_0x28fed7(0x119)]>0x0)for(let _0x54342c of _0xc530cf[_0x28fed7(0x170)]){let _0x31867e={'sender':_0x54342c['from_session']||_0x28fed7(0x109),'sender_id':'commhub','user':_0x54342c[_0x28fed7(0x133)]||_0x28fed7(0x109),'task_id':_0x54342c['id'],'priority':_0x54342c['priority']||_0x28fed7(0x150)};k[_0x28fed7(0xed)](_0x54342c['id'],_0x54342c[_0x28fed7(0x133)]||_0x28fed7(0x109)),await K[_0x28fed7(0x11e)]({'method':'notifications/claude/channel','params':{'content':_0x54342c[_0x28fed7(0x11d)],'meta':_0x31867e}}),Y(_0x28fed7(0x111)+_0x54342c['id'][_0x28fed7(0x164)](0x0,0x8)+'\x20from\x20'+_0x54342c[_0x28fed7(0x133)]+':\x20'+_0x54342c['content'][_0x28fed7(0x164)](0x0,0x3c)),await P(_0x28fed7(0x146),{'alias':Z,'message_id':_0x54342c['id']});}}}async function S(){const _0x31e9e1=a0_0x2f5f5a;let _0x4c185a=new a0_0xcb3d89();await K['connect'](_0x4c185a),Y('MCP\x20stdio\x20connected'),Y('starting\x20SSE\x20listener...'),v()['catch'](_0x4cea40=>Y(_0x31e9e1(0x102)+_0x4cea40)),P('report_status',{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x161551(),'hostname':a0_0x161551(),'agent':_0x31e9e1(0xf4),'project_dir':process[_0x31e9e1(0x120)](),'tmux_name':f||void 0x0})[_0x31e9e1(0x148)](()=>Y(_0x31e9e1(0xf6)+Z+_0x31e9e1(0x106)+w[_0x31e9e1(0x164)](0x0,0x8)+')'))['catch'](_0x1e1c55=>Y(_0x31e9e1(0x16c)+_0x1e1c55)),setInterval(()=>{const _0x307d27=_0x31e9e1;P(_0x307d27(0x10d),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x161551(),'hostname':a0_0x161551(),'agent':'claude-code','project_dir':process[_0x307d27(0x120)](),'tmux_name':f||void 0x0})[_0x307d27(0x15a)](_0x397eae=>Y('heartbeat\x20failed:\x20'+_0x397eae));},0x2bf20),Y(_0x31e9e1(0x128));}S()['catch'](_0x47063a=>{const _0x2a4064=a0_0x2f5f5a;Y('fatal:\x20'+_0x47063a),process[_0x2a4064(0x135)](0x1);});async function N(){const _0x549ad2=a0_0x2f5f5a;Y(_0x549ad2(0x100)),await P(_0x549ad2(0x10d),{'resume_id':w,'alias':Z,'status':'error','task':_0x549ad2(0xf9)})['catch'](()=>{}),process[_0x549ad2(0x135)](0x0);}process[a0_0x2f5f5a(0x115)]['on'](a0_0x2f5f5a(0x11b),()=>N()),process['on'](a0_0x2f5f5a(0x118),()=>N()),process['on'](a0_0x2f5f5a(0x159),()=>N());
2
+ const a0_0x166c63=a0_0x4e8d;(function(_0x47b128,_0x1648f7){const _0x57601f=a0_0x4e8d,_0x5148e6=_0x47b128();while(!![]){try{const _0x471eaf=-parseInt(_0x57601f(0x114))/0x1+parseInt(_0x57601f(0x163))/0x2+parseInt(_0x57601f(0x16d))/0x3*(parseInt(_0x57601f(0x17f))/0x4)+parseInt(_0x57601f(0x111))/0x5+-parseInt(_0x57601f(0x143))/0x6+parseInt(_0x57601f(0x109))/0x7*(parseInt(_0x57601f(0x165))/0x8)+parseInt(_0x57601f(0x148))/0x9*(-parseInt(_0x57601f(0x10f))/0xa);if(_0x471eaf===_0x1648f7)break;else _0x5148e6['push'](_0x5148e6['shift']());}catch(_0x30fd46){_0x5148e6['push'](_0x5148e6['shift']());}}}(a0_0x4c5f,0x83789));import{readFileSync as a0_0x16d322,existsSync as a0_0x3e4c2f}from'fs';import{join as a0_0x561902}from'path';import{hostname as a0_0xff062f}from'os';import{execSync as a0_0x22d6f2}from'child_process';import{Server as a0_0x1fea57}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x51a623}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x46a81c,CallToolRequestSchema as a0_0x5e2cc1}from'@modelcontextprotocol/sdk/types.js';function p(_0x3add60){const _0x1843ea=a0_0x4e8d;if(!a0_0x3e4c2f(_0x3add60))return;for(let _0x1aa49f of a0_0x16d322(_0x3add60,_0x1843ea(0x133))[_0x1843ea(0x142)]('\x0a')){let _0x413c4d=_0x1aa49f[_0x1843ea(0x129)]();if(!_0x413c4d||_0x413c4d[_0x1843ea(0x18b)]('#'))continue;let _0x148d4d=_0x413c4d[_0x1843ea(0x13f)]('=');if(_0x148d4d<0x0)continue;let _0x133762=_0x413c4d[_0x1843ea(0x18e)](0x0,_0x148d4d)[_0x1843ea(0x129)](),_0x32a5d0=_0x413c4d['slice'](_0x148d4d+0x1)[_0x1843ea(0x129)]()[_0x1843ea(0x177)](/^["']|["']$/g,'');if(!process.env[_0x133762])process.env[_0x133762]=_0x32a5d0;}}var C=process.env.HOME||'~',T=a0_0x561902(C,a0_0x166c63(0x131));p(a0_0x561902(T,'.env'));var L=process['cwd']()['replace'](/\//g,'-');p(a0_0x561902(T,L,a0_0x166c63(0x156)));function U(){const _0x8213b2=a0_0x166c63;try{return a0_0x22d6f2(_0x8213b2(0x176),{'encoding':_0x8213b2(0x133),'timeout':0x7d0})['trim']();}catch{return'';}}function c(){const _0x57eefb=a0_0x166c63;try{let _0x19f0ce=a0_0x561902(C,_0x57eefb(0x11a),_0x57eefb(0x121));if(a0_0x3e4c2f(_0x19f0ce))return JSON[_0x57eefb(0x107)](a0_0x16d322(_0x19f0ce,_0x57eefb(0x133)));}catch{}return{};}var H=c(),D=process.env.COMMHUB_URL||H['hub']||a0_0x166c63(0x15d),f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0xff062f(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto[a0_0x166c63(0x184)](),X=process.env.COMMHUB_TOKEN||H[a0_0x166c63(0x12b)]||'';function Y(_0x53f1ce){const _0x9b1301=a0_0x166c63;let _0x1bbd05=new Date()[_0x9b1301(0x164)]()[_0x9b1301(0x18e)](0x0,0x8);process[_0x9b1301(0x17e)][_0x9b1301(0x122)]('['+_0x1bbd05+']\x20[commhub]\x20'+_0x53f1ce+'\x0a');}function h(_0x4bcd41){return new Promise(_0x3c26dd=>setTimeout(_0x3c26dd,_0x4bcd41));}Y(a0_0x166c63(0x149)+D+a0_0x166c63(0x12d)+Z+'\x20RESUME_ID='+w[a0_0x166c63(0x18e)](0x0,0x8)+'...\x20TMUX='+(f||a0_0x166c63(0x171))+a0_0x166c63(0x108)+process[a0_0x166c63(0x154)]()+a0_0x166c63(0x172)+L);var k=new Map(),K=new a0_0x1fea57({'name':a0_0x166c63(0x174),'version':'0.3.0'},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x166c63(0x147),a0_0x166c63(0x110),a0_0x166c63(0x139),a0_0x166c63(0x125),a0_0x166c63(0x157)+Z][a0_0x166c63(0x160)]('\x0a')});K['setRequestHandler'](a0_0x46a81c,async()=>({'tools':[{'name':a0_0x166c63(0x106),'description':'Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','inputSchema':{'type':a0_0x166c63(0x181),'properties':{'task_id':{'type':a0_0x166c63(0x16c),'description':a0_0x166c63(0x175)},'text':{'type':'string','description':a0_0x166c63(0x16f)},'status':{'type':a0_0x166c63(0x16c),'enum':['completed',a0_0x166c63(0x128),a0_0x166c63(0x161),a0_0x166c63(0x14d),a0_0x166c63(0x126),'in_progress'],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':[a0_0x166c63(0x14b)]}},{'name':a0_0x166c63(0x12f),'description':a0_0x166c63(0x189),'inputSchema':{'type':a0_0x166c63(0x181),'properties':{'status':{'type':a0_0x166c63(0x16c),'enum':[a0_0x166c63(0x14a),a0_0x166c63(0x118),a0_0x166c63(0x14d),a0_0x166c63(0x126)]},'task':{'type':a0_0x166c63(0x16c),'description':a0_0x166c63(0x11d)},'progress':{'type':a0_0x166c63(0x14e),'description':'Progress\x200-100'}},'required':[a0_0x166c63(0x145)]}},{'name':a0_0x166c63(0x135),'description':a0_0x166c63(0x150),'inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x166c63(0x16c),'description':a0_0x166c63(0x123)},'task':{'type':a0_0x166c63(0x16c),'description':'Task\x20content'},'priority':{'type':a0_0x166c63(0x16c),'enum':['high',a0_0x166c63(0x17a),a0_0x166c63(0x117)],'description':'Priority\x20(default:\x20normal)'}},'required':[a0_0x166c63(0x17c),a0_0x166c63(0x162)]}},{'name':'commhub_send_message','description':a0_0x166c63(0x170),'inputSchema':{'type':a0_0x166c63(0x181),'properties':{'alias':{'type':a0_0x166c63(0x16c),'description':'Target\x20session\x20alias'},'message':{'type':a0_0x166c63(0x16c),'description':a0_0x166c63(0x10c)}},'required':[a0_0x166c63(0x17c),a0_0x166c63(0x15a)]}},{'name':a0_0x166c63(0x188),'description':'Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','inputSchema':{'type':a0_0x166c63(0x181),'properties':{}}}]}));async function P(_0xb63a4e,_0x3a72bd){const _0x19b08b=a0_0x166c63;let _0xc47b6a=await fetch(D+_0x19b08b(0x16a),{'method':_0x19b08b(0x169),'headers':{'Content-Type':_0x19b08b(0x183),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x19b08b(0x15e)+X}:{}},'body':JSON[_0x19b08b(0x17b)]({'jsonrpc':_0x19b08b(0x18a),'id':0x1,'method':_0x19b08b(0x11e),'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x19b08b(0x174),'version':'0.3.0'}}})});if(!_0xc47b6a['ok']){let _0x4b8166=await _0xc47b6a[_0x19b08b(0x14b)]();return Y(_0x19b08b(0x10e)+_0xc47b6a[_0x19b08b(0x145)]+'\x20'+_0x4b8166['slice'](0x0,0x64)),{'ok':!0x1,'error':'init\x20failed:\x20'+_0xc47b6a[_0x19b08b(0x145)]};}await _0xc47b6a[_0x19b08b(0x14b)]();let _0x4a877e=(await(await fetch(D+'/mcp',{'method':_0x19b08b(0x169),'headers':{'Content-Type':_0x19b08b(0x183),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x19b08b(0x15e)+X}:{}},'body':JSON[_0x19b08b(0x17b)]({'jsonrpc':_0x19b08b(0x18a),'id':0x2,'method':_0x19b08b(0x11c),'params':{'name':_0xb63a4e,'arguments':_0x3a72bd}})}))[_0x19b08b(0x14b)]())['split']('\x0a')[_0x19b08b(0x17d)](_0x5395fe=>_0x5395fe[_0x19b08b(0x18b)](_0x19b08b(0x15c)));if(_0x4a877e){let _0x336d51=JSON[_0x19b08b(0x107)](_0x4a877e[_0x19b08b(0x18e)](0x6));return _0x336d51?.[_0x19b08b(0x144)]?.[_0x19b08b(0x146)]?.[0x0]?.[_0x19b08b(0x14b)]?JSON[_0x19b08b(0x107)](_0x336d51[_0x19b08b(0x144)][_0x19b08b(0x146)][0x0][_0x19b08b(0x14b)]):_0x336d51;}return{'ok':!0x1,'error':_0x19b08b(0x12c)};}K[a0_0x166c63(0x187)](a0_0x5e2cc1,async _0x235f12=>{const _0x4b0cc0=a0_0x166c63;let {name:_0x5cd8fe,arguments:_0x38470d}=_0x235f12[_0x4b0cc0(0x10b)];if(_0x5cd8fe===_0x4b0cc0(0x106)){let {task_id:_0x159e00,text:_0x121102,status:_0x4e750f}=_0x38470d;if(_0x4e750f===_0x4b0cc0(0x15b)||_0x4e750f==='failed'||_0x4e750f===_0x4b0cc0(0x161)){let _0x16de5e=_0x4e750f===_0x4b0cc0(0x15b)?_0x4b0cc0(0x12a):_0x4e750f,_0x173c52=_0x159e00?k[_0x4b0cc0(0x173)](_0x159e00)||_0x4b0cc0(0x124):_0x4b0cc0(0x124),_0x2c8688=await P(_0x4b0cc0(0x167),{'alias':_0x173c52,'text':_0x121102,'in_reply_to':_0x159e00||void 0x0,'status':_0x16de5e,'from_session':Z});if(_0x159e00)k[_0x4b0cc0(0x190)](_0x159e00);return{'content':[{'type':_0x4b0cc0(0x14b),'text':JSON[_0x4b0cc0(0x17b)](_0x2c8688)}]};}let _0x557578=await P(_0x4b0cc0(0x112),{'resume_id':w,'alias':Z,'status':_0x4e750f===_0x4b0cc0(0x14d)?'blocked':_0x4e750f===_0x4b0cc0(0x126)?_0x4b0cc0(0x126):_0x4b0cc0(0x14a),'task':_0x121102[_0x4b0cc0(0x18e)](0x0,0xc8),'output':_0x121102});return{'content':[{'type':_0x4b0cc0(0x14b),'text':JSON[_0x4b0cc0(0x17b)](_0x557578)}]};}if(_0x5cd8fe==='commhub_report_status'){let {status:_0x1a2ffd,task:_0x289142,progress:_0xe4ed75}=_0x38470d,_0x4a17e2=await P(_0x4b0cc0(0x112),{'resume_id':w,'alias':Z,'status':_0x1a2ffd,'task':_0x289142,'progress':_0xe4ed75});return{'content':[{'type':'text','text':JSON[_0x4b0cc0(0x17b)](_0x4a17e2)}]};}if(_0x5cd8fe===_0x4b0cc0(0x135)){let {alias:_0x3652c0,task:_0x293eb7,priority:_0x5aff1a}=_0x38470d,_0x3c85e1=await P(_0x4b0cc0(0x138),{'alias':_0x3652c0,'task':_0x293eb7,'priority':_0x5aff1a||'normal','from_session':Z});return{'content':[{'type':_0x4b0cc0(0x14b),'text':JSON[_0x4b0cc0(0x17b)](_0x3c85e1)}]};}if(_0x5cd8fe===_0x4b0cc0(0x16b)){let {alias:_0x106551,message:_0x14df40}=_0x38470d,_0x37fe72=await P(_0x4b0cc0(0x151),{'alias':_0x106551,'message':_0x14df40,'from_session':Z});return{'content':[{'type':_0x4b0cc0(0x14b),'text':JSON[_0x4b0cc0(0x17b)](_0x37fe72)}]};}if(_0x5cd8fe===_0x4b0cc0(0x188)){let _0x105979=await P('get_all_status',{});return{'content':[{'type':'text','text':JSON[_0x4b0cc0(0x17b)](_0x105979)}]};}return{'content':[{'type':'text','text':JSON[_0x4b0cc0(0x17b)]({'error':_0x4b0cc0(0x18f)})}]};});async function v(){const _0x220cbe=a0_0x166c63;let _0x18ecd6=D+'/events/'+encodeURIComponent(Z),_0x41532e={};if(X)_0x41532e[_0x220cbe(0x130)]=_0x220cbe(0x15e)+X;Y('connecting\x20to\x20'+_0x18ecd6);while(!0x0){try{let _0x85d26=await fetch(_0x18ecd6,{'headers':_0x41532e});if(!_0x85d26['ok']){Y('SSE\x20error:\x20'+_0x85d26[_0x220cbe(0x145)]+'\x20'+_0x85d26[_0x220cbe(0x140)]),await h(0x1388);continue;}let _0x116ad6=_0x85d26[_0x220cbe(0x153)][_0x220cbe(0x141)](),_0x5175ad=new TextDecoder(),_0xf647c7='';while(!0x0){let {done:_0x5e9445,value:_0x1fe1a8}=await _0x116ad6['read']();if(_0x5e9445)break;_0xf647c7+=_0x5175ad[_0x220cbe(0x136)](_0x1fe1a8,{'stream':!0x0});let _0x399cb6=_0xf647c7[_0x220cbe(0x142)]('\x0a\x0a');_0xf647c7=_0x399cb6[_0x220cbe(0x178)]()||'';for(let _0x552dcf of _0x399cb6){let _0x265dc7=_0x552dcf[_0x220cbe(0x142)]('\x0a')[_0x220cbe(0x17d)](_0x3af799=>_0x3af799[_0x220cbe(0x18b)]('data:\x20'));if(!_0x265dc7)continue;try{let _0x3463c5=JSON[_0x220cbe(0x107)](_0x265dc7[_0x220cbe(0x18e)](0x6));await u(_0x3463c5);}catch(_0x1ceb91){Y(_0x220cbe(0x159)+_0x1ceb91);}}}Y(_0x220cbe(0x186));}catch(_0x5932cc){Y('SSE\x20connection\x20error:\x20'+_0x5932cc);}await h(0xbb8);}}async function u(_0x27b567){const _0x1c1cae=a0_0x166c63;if(_0x27b567[_0x1c1cae(0x12e)]===_0x1c1cae(0x13b)){Y(_0x1c1cae(0x13c)+Z+'\x22');return;}if(_0x27b567[_0x1c1cae(0x12e)]===_0x1c1cae(0x132)){if(Y(_0x1c1cae(0x10a)+_0x27b567[_0x1c1cae(0x158)]+':\x20'+_0x27b567['message'][_0x1c1cae(0x18e)](0x0,0x3c)),await K[_0x1c1cae(0x13a)]({'method':_0x1c1cae(0x185),'params':{'content':_0x27b567[_0x1c1cae(0x15a)],'meta':{'sender':_0x27b567[_0x1c1cae(0x158)]||_0x1c1cae(0x124),'sender_id':'commhub','user':_0x27b567[_0x1c1cae(0x158)]||_0x1c1cae(0x124),'priority':'normal'}}}),_0x27b567[_0x1c1cae(0x18d)])await P(_0x1c1cae(0x155),{'alias':Z,'message_id':_0x27b567['message_id']});return;}if(_0x27b567['type']==='new_task'||_0x27b567[_0x1c1cae(0x12e)]==='broadcast'){Y('←\x20'+_0x27b567[_0x1c1cae(0x12e)]+':\x20inbox_count='+_0x27b567[_0x1c1cae(0x10d)]+_0x1c1cae(0x13e)+(_0x27b567[_0x1c1cae(0x179)]||'normal'));let _0xe63214=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0xe63214?.['ok']&&_0xe63214[_0x1c1cae(0x18c)]?.[_0x1c1cae(0x116)]>0x0)for(let _0x4449e6 of _0xe63214[_0x1c1cae(0x18c)]){let _0x1e7395={'sender':_0x4449e6['from_session']||_0x1c1cae(0x124),'sender_id':_0x1c1cae(0x168),'user':_0x4449e6['from_session']||_0x1c1cae(0x124),'task_id':_0x4449e6['id'],'priority':_0x4449e6[_0x1c1cae(0x179)]||'normal'};k[_0x1c1cae(0x11f)](_0x4449e6['id'],_0x4449e6['from_session']||'hub'),await K[_0x1c1cae(0x13a)]({'method':'notifications/claude/channel','params':{'content':_0x4449e6['content'],'meta':_0x1e7395}}),Y(_0x1c1cae(0x152)+_0x4449e6['id'][_0x1c1cae(0x18e)](0x0,0x8)+'\x20from\x20'+_0x4449e6[_0x1c1cae(0x113)]+':\x20'+_0x4449e6[_0x1c1cae(0x146)]['slice'](0x0,0x3c)),await P(_0x1c1cae(0x155),{'alias':Z,'message_id':_0x4449e6['id']});}}}async function S(){const _0x370854=a0_0x166c63;let _0x7b224d=new a0_0x51a623();await K[_0x370854(0x119)](_0x7b224d),Y(_0x370854(0x137)),Y(_0x370854(0x11b)),v()[_0x370854(0x14c)](_0x178547=>Y(_0x370854(0x127)+_0x178547)),P(_0x370854(0x112),{'resume_id':w,'alias':Z,'status':_0x370854(0x118),'server':a0_0xff062f(),'hostname':a0_0xff062f(),'agent':_0x370854(0x14f),'project_dir':process[_0x370854(0x154)](),'tmux_name':f||void 0x0})[_0x370854(0x120)](()=>Y('registered\x20as\x20\x22'+Z+_0x370854(0x182)+w[_0x370854(0x18e)](0x0,0x8)+')'))[_0x370854(0x14c)](_0x53db2a=>Y(_0x370854(0x180)+_0x53db2a)),setInterval(()=>{const _0xa4d7f2=_0x370854;P(_0xa4d7f2(0x112),{'resume_id':w,'alias':Z,'status':_0xa4d7f2(0x118),'server':a0_0xff062f(),'hostname':a0_0xff062f(),'agent':_0xa4d7f2(0x14f),'project_dir':process[_0xa4d7f2(0x154)](),'tmux_name':f||void 0x0})[_0xa4d7f2(0x14c)](_0x2fe446=>Y(_0xa4d7f2(0x115)+_0x2fe446));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}S()[a0_0x166c63(0x14c)](_0x3fba67=>{Y('fatal:\x20'+_0x3fba67),process['exit'](0x1);});function a0_0x4e8d(_0x2b4ab3,_0x102c1a){_0x2b4ab3=_0x2b4ab3-0x106;const _0x4c5f8e=a0_0x4c5f();let _0x4e8d5c=_0x4c5f8e[_0x2b4ab3];return _0x4e8d5c;}async function N(){const _0xacbbe9=a0_0x166c63;Y(_0xacbbe9(0x13d)),await P(_0xacbbe9(0x112),{'resume_id':w,'alias':Z,'status':_0xacbbe9(0x126),'task':_0xacbbe9(0x134)})[_0xacbbe9(0x14c)](()=>{}),process['exit'](0x0);}process[a0_0x166c63(0x16e)]['on'](a0_0x166c63(0x166),()=>N()),process['on']('SIGTERM',()=>N()),process['on'](a0_0x166c63(0x15f),()=>N());function a0_0x4c5f(){const _0x2dff90=['config.json','write','Target\x20session\x20alias','hub','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','error','SSE\x20fatal:\x20','failed','trim','replied','token','no\x20response','\x20ALIAS=','type','commhub_report_status','Authorization','.claude/channels/commhub','new_message','utf-8','session\x20disconnected','commhub_send_task','decode','MCP\x20stdio\x20connected','send_task','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','notification','connected','SSE\x20connected\x20as\x20\x22','shutting\x20down,\x20reporting\x20offline...','\x20priority=','indexOf','statusText','getReader','split','3965916FVSXCQ','result','status','content','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','33597FNpJtj','ENV:\x20URL=','working','text','catch','blocked','number','claude-code','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','send_message','→\x20injected\x20task\x20','body','cwd','ack_inbox','.env','Session\x20alias:\x20','from','parse\x20error:\x20','message','completed','data:\x20','http://127.0.0.1:9200','Bearer\x20','SIGINT','join','cancelled','task','1684618efNfyG','toTimeString','8dRkupf','end','send_reply','commhub','POST','/mcp','commhub_send_message','string','1492329FHWfLF','stdin','Reply\x20text\x20/\x20result\x20summary','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','none','\x20PROJECT_ENV=','get','commhub-channel','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','tmux\x20display-message\x20-p\x20\x27#S\x27','replace','pop','priority','normal','stringify','alias','find','stderr','8pLqVTj','warning:\x20could\x20not\x20register:\x20','object','\x22\x20(','application/json','randomUUID','notifications/claude/channel','SSE\x20stream\x20ended,\x20reconnecting...','setRequestHandler','commhub_get_all_status','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','2.0','startsWith','messages','message_id','slice','unknown\x20tool','delete','commhub_reply','parse','\x20CWD=','6805547shAtxA','←\x20message\x20from\x20','params','Message\x20content','inbox_count','CommHub\x20init\x20failed:\x20','3530nrKrwL','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','959920PdsWku','report_status','from_session','484160ejYzdv','heartbeat\x20failed:\x20','length','low','idle','connect','.anet','starting\x20SSE\x20listener...','tools/call','Current\x20task\x20description','initialize','set','then'];a0_0x4c5f=function(){return _0x2dff90;};return a0_0x4c5f();}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.0.0-preview.20",
3
+ "version": "2.0.0-preview.21",
4
4
  "description": "AI Agent Network — Server + Client + Setup in one package. SSE real-time communication for multi-agent orchestration.",
5
5
  "type": "module",
6
6
  "main": "dist/src/client.js",