@sleep2agi/agent-network 2.0.0-preview.41 → 2.0.0-preview.42

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_0x4af8a7=a0_0x12c3;function a0_0x32a7(){const _0x48ef0e=['toTimeString','reply','sseAbort','send_task','60yfZQDB','task','heartbeatTimer','decode','sdk-','disconnect','POST','heartbeatInterval','120bnwiim','registered','toString','body','connect','error','5805lgSCGO','offline','split','Authorization','url','catch','signal','get_all_status','agent','status','26439171ThxwyN','broadcast','290148mAFFmC','connected','slice','now','application/json','AbortError','read','SSE\x20error:\x20','connectSSE','normal','SSE\x20failed:\x20','messages','send','emit','Bearer\x20','idle','token','SSE\x20connected','disconnected','running','content','from_session','application/json,\x20text/event-stream','min','heartbeat\x20failed:\x20','2.0','parse','log','data:\x20','141566KPIdhF','text','new_message','send_message','tools/call','processInbox','getReader','5679625uxAxDn','18680kXUkYu','/mcp','message','/events/','inbox\x20error:\x20','call','alias','reconnectDelay','server','SSE\x20reconnecting\x20in\x20','report_status','4794364kBbPXP','startsWith','stringify','1047954MgdaFJ','cwd','text/event-stream','resumeId','completed','type','10NfgpvN'];a0_0x32a7=function(){return _0x48ef0e;};return a0_0x32a7();}(function(_0x3358ac,_0x107d98){const _0x275c92=a0_0x12c3,_0x1210f3=_0x3358ac();while(!![]){try{const _0x22529e=parseInt(_0x275c92(0x135))/0x1+-parseInt(_0x275c92(0x177))/0x2*(-parseInt(_0x275c92(0x140))/0x3)+parseInt(_0x275c92(0x132))/0x4+parseInt(_0x275c92(0x148))/0x5*(-parseInt(_0x275c92(0x15a))/0x6)+-parseInt(_0x275c92(0x17e))/0x7+parseInt(_0x275c92(0x17f))/0x8*(parseInt(_0x275c92(0x14e))/0x9)+-parseInt(_0x275c92(0x13b))/0xa*(parseInt(_0x275c92(0x158))/0xb);if(_0x22529e===_0x107d98)break;else _0x1210f3['push'](_0x1210f3['shift']());}catch(_0x22040c){_0x1210f3['push'](_0x1210f3['shift']());}}}(a0_0x32a7,0xc18b0));function a0_0x12c3(_0x54ccab,_0x2217fc){_0x54ccab=_0x54ccab-0x12b;const _0x32a714=a0_0x32a7();let _0x12c393=_0x32a714[_0x54ccab];return _0x12c393;}import{EventEmitter as a0_0x4114bf}from'events';import{hostname as a0_0x431c59}from'os';class T extends a0_0x4114bf{[a0_0x4af8a7(0x152)];[a0_0x4af8a7(0x12d)];[a0_0x4af8a7(0x16a)];[a0_0x4af8a7(0x156)];['resumeId'];[a0_0x4af8a7(0x147)];[a0_0x4af8a7(0x12e)];[a0_0x4af8a7(0x142)];[a0_0x4af8a7(0x13e)];[a0_0x4af8a7(0x16d)]=!0x1;constructor(_0x1b407d){const _0x32d240=a0_0x4af8a7;super();if(this[_0x32d240(0x152)]=_0x1b407d['url']['replace'](/\/$/,''),this[_0x32d240(0x12d)]=_0x1b407d[_0x32d240(0x12d)],this[_0x32d240(0x16a)]=_0x1b407d[_0x32d240(0x16a)],this[_0x32d240(0x156)]=_0x1b407d[_0x32d240(0x156)]||'sdk',this[_0x32d240(0x138)]=_0x32d240(0x144)+_0x1b407d[_0x32d240(0x12d)]+'-'+Date[_0x32d240(0x15d)]()[_0x32d240(0x14a)](0x24),this[_0x32d240(0x147)]=_0x1b407d[_0x32d240(0x147)]??0x2bf20,this[_0x32d240(0x12e)]=_0x1b407d['reconnectDelay']??0xbb8,_0x1b407d['autoConnect']!==!0x1)this[_0x32d240(0x14c)]();}[a0_0x4af8a7(0x175)](_0x3b5d58){const _0x4b398c=a0_0x4af8a7;console[_0x4b398c(0x175)]('['+new Date()[_0x4b398c(0x13c)]()['slice'](0x0,0x8)+']\x20[commhub:'+this['alias']+']\x20'+_0x3b5d58);}async['call'](_0x3ddabd,_0x1300e7){const _0x145ca5=a0_0x4af8a7;let _0x3d4fe0={'Content-Type':_0x145ca5(0x15e),'Accept':_0x145ca5(0x170)};if(this[_0x145ca5(0x16a)])_0x3d4fe0[_0x145ca5(0x151)]=_0x145ca5(0x168)+this[_0x145ca5(0x16a)];let _0x28866e=await(await fetch(this[_0x145ca5(0x152)]+_0x145ca5(0x180),{'method':_0x145ca5(0x146),'headers':_0x3d4fe0,'body':JSON[_0x145ca5(0x134)]({'jsonrpc':_0x145ca5(0x173),'id':Date[_0x145ca5(0x15d)](),'method':_0x145ca5(0x17b),'params':{'name':_0x3ddabd,'arguments':_0x1300e7}})}))[_0x145ca5(0x178)](),_0x8b75e5=_0x28866e['match'](/data: (.+)/),_0x105336=_0x8b75e5?JSON['parse'](_0x8b75e5[0x1]):JSON[_0x145ca5(0x174)](_0x28866e),_0x5c5257=_0x105336?.['result']?.[_0x145ca5(0x16e)]?.[0x0]?.[_0x145ca5(0x178)];return _0x5c5257?JSON[_0x145ca5(0x174)](_0x5c5257):_0x105336;}async['connect'](){const _0x420562=a0_0x4af8a7;if(this[_0x420562(0x16d)])return;this[_0x420562(0x16d)]=!0x0,await this['status'](_0x420562(0x169)),this[_0x420562(0x175)](_0x420562(0x149)),this['heartbeatTimer']=setInterval(()=>{const _0x5f3752=_0x420562;this[_0x5f3752(0x157)](_0x5f3752(0x169))[_0x5f3752(0x153)](_0x12d5cf=>this[_0x5f3752(0x175)](_0x5f3752(0x172)+_0x12d5cf[_0x5f3752(0x181)]));},this[_0x420562(0x147)]),this[_0x420562(0x162)]();}async[a0_0x4af8a7(0x145)](){const _0x22ba87=a0_0x4af8a7;if(this[_0x22ba87(0x16d)]=!0x1,this[_0x22ba87(0x13e)]?.['abort'](),this['heartbeatTimer'])clearInterval(this['heartbeatTimer']);await this['status'](_0x22ba87(0x14f))['catch'](()=>{}),this[_0x22ba87(0x175)](_0x22ba87(0x16c));}async[a0_0x4af8a7(0x166)](_0x13dc9c,_0x55e3c5,_0x26b0a4=a0_0x4af8a7(0x163)){const _0x50b26a=a0_0x4af8a7;return this[_0x50b26a(0x12c)](_0x50b26a(0x13f),{'alias':_0x13dc9c,'task':_0x55e3c5,'priority':_0x26b0a4,'from_session':this[_0x50b26a(0x12d)]});}async['message'](_0x403117,_0x4fd5f9){const _0x490dbc=a0_0x4af8a7;return this[_0x490dbc(0x12c)](_0x490dbc(0x17a),{'alias':_0x403117,'message':_0x4fd5f9,'from_session':this[_0x490dbc(0x12d)]});}async[a0_0x4af8a7(0x13d)](_0x3109db,_0x4e9ca0,_0x497edf=a0_0x4af8a7(0x139)){const _0x19cfe8=a0_0x4af8a7;return this['call'](_0x19cfe8(0x13d),{'task_id':_0x3109db,'text':_0x4e9ca0,'status':_0x497edf});}async[a0_0x4af8a7(0x157)](_0x31849e,_0x536837){const _0x333b28=a0_0x4af8a7;return this[_0x333b28(0x12c)](_0x333b28(0x131),{'resume_id':this[_0x333b28(0x138)],'alias':this[_0x333b28(0x12d)],'status':_0x31849e,'server':a0_0x431c59(),'hostname':a0_0x431c59(),'agent':this['agent'],'project_dir':process[_0x333b28(0x136)](),..._0x536837});}async['getAllStatus'](){const _0x2a14be=a0_0x4af8a7;return this[_0x2a14be(0x12c)](_0x2a14be(0x155),{});}async[a0_0x4af8a7(0x159)](_0xdc4ec,_0x4bd205){const _0x253a47=a0_0x4af8a7;return this[_0x253a47(0x12c)](_0x253a47(0x159),{'message':_0xdc4ec,'filter_server':_0x4bd205?.[_0x253a47(0x12f)],'filter_status':_0x4bd205?.['status']});}async[a0_0x4af8a7(0x162)](){const _0x460af8=a0_0x4af8a7;let _0x535d6f=encodeURIComponent(this['alias']),_0x531b79=this['url']+_0x460af8(0x182)+_0x535d6f,_0x5afb7e=this[_0x460af8(0x12e)];while(this[_0x460af8(0x16d)]){try{this['sseAbort']=new AbortController();let _0x57440d={'Accept':_0x460af8(0x137)};if(this['token'])_0x57440d[_0x460af8(0x151)]='Bearer\x20'+this[_0x460af8(0x16a)];let _0x7d3ce5=await fetch(_0x531b79,{'headers':_0x57440d,'signal':this[_0x460af8(0x13e)][_0x460af8(0x154)]});if(!_0x7d3ce5['ok']||!_0x7d3ce5[_0x460af8(0x14b)]){this['log'](_0x460af8(0x164)+_0x7d3ce5[_0x460af8(0x157)]),await this['sleep'](_0x5afb7e),_0x5afb7e=Math[_0x460af8(0x171)](_0x5afb7e*1.5,0xea60);continue;}_0x5afb7e=this[_0x460af8(0x12e)];let _0x3ddea7=_0x7d3ce5[_0x460af8(0x14b)][_0x460af8(0x17d)](),_0x3915e3=new TextDecoder(),_0x20c4e8='';while(this[_0x460af8(0x16d)]){let {done:_0x1818d9,value:_0x3fc862}=await _0x3ddea7[_0x460af8(0x160)]();if(_0x1818d9)break;_0x20c4e8+=_0x3915e3[_0x460af8(0x143)](_0x3fc862,{'stream':!0x0});let _0x24251e=_0x20c4e8[_0x460af8(0x150)]('\x0a');_0x20c4e8=_0x24251e['pop']()||'';for(let _0x30017f of _0x24251e){if(!_0x30017f[_0x460af8(0x133)](_0x460af8(0x176)))continue;try{let _0xb5d7b0=JSON[_0x460af8(0x174)](_0x30017f['slice'](0x6));if(_0xb5d7b0[_0x460af8(0x13a)]===_0x460af8(0x15b)){this[_0x460af8(0x175)](_0x460af8(0x16b)),this[_0x460af8(0x167)]('connected');continue;}if(_0xb5d7b0[_0x460af8(0x13a)]==='new_task'||_0xb5d7b0[_0x460af8(0x13a)]===_0x460af8(0x179)||_0xb5d7b0['type']===_0x460af8(0x159))await this[_0x460af8(0x17c)]();}catch{}}}}catch(_0x570425){if(_0x570425['name']===_0x460af8(0x15f))break;this[_0x460af8(0x167)](_0x460af8(0x14d),_0x570425),this[_0x460af8(0x175)](_0x460af8(0x161)+_0x570425[_0x460af8(0x181)]);}if(this[_0x460af8(0x16d)])this[_0x460af8(0x167)](_0x460af8(0x16c)),this[_0x460af8(0x175)](_0x460af8(0x130)+_0x5afb7e/0x3e8+'s...'),await this['sleep'](_0x5afb7e),_0x5afb7e=Math['min'](_0x5afb7e*1.5,0xea60);}}async[a0_0x4af8a7(0x17c)](){const _0x6bd666=a0_0x4af8a7;try{let _0x40e76d=(await this[_0x6bd666(0x12c)]('get_inbox',{'alias':this[_0x6bd666(0x12d)],'limit':0xa}))?.[_0x6bd666(0x165)]||[];for(let _0x9e9a24 of _0x40e76d)await this[_0x6bd666(0x12c)]('ack_inbox',{'alias':this[_0x6bd666(0x12d)],'message_id':_0x9e9a24['id']}),this[_0x6bd666(0x175)]('←\x20'+_0x9e9a24[_0x6bd666(0x16f)]+':\x20'+_0x9e9a24[_0x6bd666(0x16e)][_0x6bd666(0x15c)](0x0,0x3c)),this[_0x6bd666(0x167)](_0x6bd666(0x141),_0x9e9a24),this[_0x6bd666(0x167)]('message',_0x9e9a24);}catch(_0x932959){this['log'](_0x6bd666(0x12b)+_0x932959[_0x6bd666(0x181)]);}}['sleep'](_0x163cca){return new Promise(_0x26fce7=>setTimeout(_0x26fce7,_0x163cca));}}var $=T;export{$ as default,T as CommHub};
1
+ const a0_0x4815e9=a0_0x1250;function a0_0x1250(_0x23d9d7,_0x562f76){_0x23d9d7=_0x23d9d7-0x1ea;const _0x448ea3=a0_0x448e();let _0x1250fd=_0x448ea3[_0x23d9d7];return _0x1250fd;}(function(_0x19efd5,_0x16aee5){const _0x55e267=a0_0x1250,_0x1f2404=_0x19efd5();while(!![]){try{const _0x18734e=-parseInt(_0x55e267(0x1fc))/0x1+parseInt(_0x55e267(0x22c))/0x2+-parseInt(_0x55e267(0x1f4))/0x3*(-parseInt(_0x55e267(0x223))/0x4)+-parseInt(_0x55e267(0x1f5))/0x5*(parseInt(_0x55e267(0x209))/0x6)+-parseInt(_0x55e267(0x23b))/0x7+parseInt(_0x55e267(0x208))/0x8+-parseInt(_0x55e267(0x210))/0x9;if(_0x18734e===_0x16aee5)break;else _0x1f2404['push'](_0x1f2404['shift']());}catch(_0x579de7){_0x1f2404['push'](_0x1f2404['shift']());}}}(a0_0x448e,0x191af));import{EventEmitter as a0_0x11661a}from'events';function a0_0x448e(){const _0x25a2ad=['SSE\x20failed:\x20','result','heartbeat\x20failed:\x20','text','new_task','resumeId','16304CNitCH','running','heartbeatTimer','text/event-stream','abort','toTimeString','connectSSE','agent','application/json','154254UUNGaI','sleep','registered','get_all_status','log','status',']\x20[commhub:','connected','heartbeatInterval','reconnectDelay','call','messages','content','task','Bearer\x20','74228IMVNtK','Authorization','from_session','slice','pop','min','new_message','sdk-','application/json,\x20text/event-stream','broadcast','/mcp','data:\x20','s...','141XJAGTz','5BCpwTS','report_status','get_inbox','inbox\x20error:\x20','type','2.0','ack_inbox','95294GmZOBL','message','sdk','AbortError','now','processInbox','match','offline','sseAbort','cwd','SSE\x20reconnecting\x20in\x20','getAllStatus','343896xQEeuz','258126pgoIKn','toString','token','normal','parse','split','completed','539424hMWbGP','startsWith','idle','autoConnect','alias','server','connect','url','disconnect','reply','name','send_task','emit'];a0_0x448e=function(){return _0x25a2ad;};return a0_0x448e();}import{hostname as a0_0x43f65e}from'os';class T extends a0_0x11661a{[a0_0x4815e9(0x217)];['alias'];[a0_0x4815e9(0x20b)];[a0_0x4815e9(0x22a)];[a0_0x4815e9(0x222)];['heartbeatInterval'];['reconnectDelay'];[a0_0x4815e9(0x225)];[a0_0x4815e9(0x204)];[a0_0x4815e9(0x224)]=!0x1;constructor(_0x163904){const _0x279455=a0_0x4815e9;super();if(this[_0x279455(0x217)]=_0x163904[_0x279455(0x217)]['replace'](/\/$/,''),this[_0x279455(0x214)]=_0x163904[_0x279455(0x214)],this[_0x279455(0x20b)]=_0x163904[_0x279455(0x20b)],this[_0x279455(0x22a)]=_0x163904[_0x279455(0x22a)]||_0x279455(0x1fe),this['resumeId']=_0x279455(0x1ee)+_0x163904['alias']+'-'+Date[_0x279455(0x200)]()[_0x279455(0x20a)](0x24),this[_0x279455(0x234)]=_0x163904[_0x279455(0x234)]??0x2bf20,this[_0x279455(0x235)]=_0x163904['reconnectDelay']??0xbb8,_0x163904[_0x279455(0x213)]!==!0x1)this[_0x279455(0x216)]();}[a0_0x4815e9(0x230)](_0x2e7282){const _0x17fa33=a0_0x4815e9;console[_0x17fa33(0x230)]('['+new Date()[_0x17fa33(0x228)]()[_0x17fa33(0x1ea)](0x0,0x8)+_0x17fa33(0x232)+this[_0x17fa33(0x214)]+']\x20'+_0x2e7282);}async[a0_0x4815e9(0x236)](_0x461895,_0x393123){const _0x53e11d=a0_0x4815e9;let _0x38b0bb={'Content-Type':_0x53e11d(0x22b),'Accept':_0x53e11d(0x1ef)};if(this[_0x53e11d(0x20b)])_0x38b0bb[_0x53e11d(0x23c)]=_0x53e11d(0x23a)+this[_0x53e11d(0x20b)];let _0x2794dd=await(await fetch(this['url']+_0x53e11d(0x1f1),{'method':'POST','headers':_0x38b0bb,'body':JSON['stringify']({'jsonrpc':_0x53e11d(0x1fa),'id':Date[_0x53e11d(0x200)](),'method':'tools/call','params':{'name':_0x461895,'arguments':_0x393123}})}))[_0x53e11d(0x220)](),_0x7ce1d4=_0x2794dd[_0x53e11d(0x202)](/data: (.+)/),_0x5e6719=_0x7ce1d4?JSON[_0x53e11d(0x20d)](_0x7ce1d4[0x1]):JSON[_0x53e11d(0x20d)](_0x2794dd),_0x223e31=_0x5e6719?.[_0x53e11d(0x21e)]?.[_0x53e11d(0x238)]?.[0x0]?.['text'];return _0x223e31?JSON[_0x53e11d(0x20d)](_0x223e31):_0x5e6719;}async[a0_0x4815e9(0x216)](){const _0x2df418=a0_0x4815e9;if(this[_0x2df418(0x224)])return;this[_0x2df418(0x224)]=!0x0,await this['status']('idle'),this[_0x2df418(0x230)](_0x2df418(0x22e)),this[_0x2df418(0x225)]=setInterval(()=>{const _0x31c216=_0x2df418;this[_0x31c216(0x231)](_0x31c216(0x212))['catch'](_0x32814c=>this[_0x31c216(0x230)](_0x31c216(0x21f)+_0x32814c[_0x31c216(0x1fd)]));},this[_0x2df418(0x234)]),this[_0x2df418(0x229)]();}async[a0_0x4815e9(0x218)](){const _0x284e13=a0_0x4815e9;if(this[_0x284e13(0x224)]=!0x1,this[_0x284e13(0x204)]?.[_0x284e13(0x227)](),this[_0x284e13(0x225)])clearInterval(this[_0x284e13(0x225)]);await this[_0x284e13(0x231)](_0x284e13(0x203))['catch'](()=>{}),this[_0x284e13(0x230)]('disconnected');}async['send'](_0x4a05bb,_0x34ccb2,_0x50c432=a0_0x4815e9(0x20c)){const _0x355de1=a0_0x4815e9;return this[_0x355de1(0x236)](_0x355de1(0x21b),{'alias':_0x4a05bb,'task':_0x34ccb2,'priority':_0x50c432,'from_session':this[_0x355de1(0x214)]});}async[a0_0x4815e9(0x1fd)](_0x18329d,_0x2cef4a){const _0x38fb7a=a0_0x4815e9;return this[_0x38fb7a(0x236)]('send_message',{'alias':_0x18329d,'message':_0x2cef4a,'from_session':this[_0x38fb7a(0x214)]});}async[a0_0x4815e9(0x219)](_0x2dbbca,_0x536706,_0x17145b=a0_0x4815e9(0x20f)){const _0x4343b0=a0_0x4815e9;return this[_0x4343b0(0x236)](_0x4343b0(0x219),{'task_id':_0x2dbbca,'text':_0x536706,'status':_0x17145b});}async['status'](_0x2e2eb,_0x33244c){const _0x417a5b=a0_0x4815e9;return this[_0x417a5b(0x236)](_0x417a5b(0x1f6),{'resume_id':this['resumeId'],'alias':this[_0x417a5b(0x214)],'status':_0x2e2eb,'server':a0_0x43f65e(),'hostname':a0_0x43f65e(),'agent':this['agent'],'project_dir':process[_0x417a5b(0x205)](),..._0x33244c});}async[a0_0x4815e9(0x207)](){const _0x1c03fc=a0_0x4815e9;return this['call'](_0x1c03fc(0x22f),{});}async[a0_0x4815e9(0x1f0)](_0x17f3b4,_0x331186){const _0xe7cf38=a0_0x4815e9;return this[_0xe7cf38(0x236)](_0xe7cf38(0x1f0),{'message':_0x17f3b4,'filter_server':_0x331186?.[_0xe7cf38(0x215)],'filter_status':_0x331186?.[_0xe7cf38(0x231)]});}async['connectSSE'](){const _0xb20ebe=a0_0x4815e9;let _0x57daa2=encodeURIComponent(this[_0xb20ebe(0x214)]),_0x226fd1=this[_0xb20ebe(0x217)]+'/events/'+_0x57daa2,_0x12d3f3=this[_0xb20ebe(0x235)];while(this[_0xb20ebe(0x224)]){try{this[_0xb20ebe(0x204)]=new AbortController();let _0x277240={'Accept':_0xb20ebe(0x226)};if(this[_0xb20ebe(0x20b)])_0x277240['Authorization']=_0xb20ebe(0x23a)+this[_0xb20ebe(0x20b)];let _0x5862a6=await fetch(_0x226fd1,{'headers':_0x277240,'signal':this[_0xb20ebe(0x204)]['signal']});if(!_0x5862a6['ok']||!_0x5862a6['body']){this[_0xb20ebe(0x230)](_0xb20ebe(0x21d)+_0x5862a6[_0xb20ebe(0x231)]),await this['sleep'](_0x12d3f3),_0x12d3f3=Math[_0xb20ebe(0x1ec)](_0x12d3f3*1.5,0xea60);continue;}_0x12d3f3=this[_0xb20ebe(0x235)];let _0x3a109b=_0x5862a6['body']['getReader'](),_0x2f3410=new TextDecoder(),_0x39f139='';while(this['running']){let {done:_0x35a079,value:_0x3f6681}=await _0x3a109b['read']();if(_0x35a079)break;_0x39f139+=_0x2f3410['decode'](_0x3f6681,{'stream':!0x0});let _0x147d53=_0x39f139[_0xb20ebe(0x20e)]('\x0a');_0x39f139=_0x147d53[_0xb20ebe(0x1eb)]()||'';for(let _0x1b0f4b of _0x147d53){if(!_0x1b0f4b[_0xb20ebe(0x211)](_0xb20ebe(0x1f2)))continue;try{let _0x52e8e7=JSON[_0xb20ebe(0x20d)](_0x1b0f4b[_0xb20ebe(0x1ea)](0x6));if(_0x52e8e7[_0xb20ebe(0x1f9)]===_0xb20ebe(0x233)){this[_0xb20ebe(0x230)]('SSE\x20connected'),this['emit'](_0xb20ebe(0x233));continue;}if(_0x52e8e7[_0xb20ebe(0x1f9)]===_0xb20ebe(0x221)||_0x52e8e7['type']===_0xb20ebe(0x1ed)||_0x52e8e7['type']===_0xb20ebe(0x1f0))await this['processInbox']();}catch{}}}}catch(_0x44c825){if(_0x44c825[_0xb20ebe(0x21a)]===_0xb20ebe(0x1ff))break;this[_0xb20ebe(0x21c)]('error',_0x44c825),this[_0xb20ebe(0x230)]('SSE\x20error:\x20'+_0x44c825['message']);}if(this['running'])this['emit']('disconnected'),this[_0xb20ebe(0x230)](_0xb20ebe(0x206)+_0x12d3f3/0x3e8+_0xb20ebe(0x1f3)),await this['sleep'](_0x12d3f3),_0x12d3f3=Math[_0xb20ebe(0x1ec)](_0x12d3f3*1.5,0xea60);}}async[a0_0x4815e9(0x201)](){const _0x35a62d=a0_0x4815e9;try{let _0x41f453=(await this[_0x35a62d(0x236)](_0x35a62d(0x1f7),{'alias':this[_0x35a62d(0x214)],'limit':0xa}))?.[_0x35a62d(0x237)]||[];for(let _0x1257ca of _0x41f453)await this[_0x35a62d(0x236)](_0x35a62d(0x1fb),{'alias':this[_0x35a62d(0x214)],'message_id':_0x1257ca['id']}),this[_0x35a62d(0x230)]('←\x20'+_0x1257ca[_0x35a62d(0x23d)]+':\x20'+_0x1257ca[_0x35a62d(0x238)][_0x35a62d(0x1ea)](0x0,0x3c)),this[_0x35a62d(0x21c)](_0x35a62d(0x239),_0x1257ca),this[_0x35a62d(0x21c)](_0x35a62d(0x1fd),_0x1257ca);}catch(_0x2b691d){this[_0x35a62d(0x230)](_0x35a62d(0x1f8)+_0x2b691d[_0x35a62d(0x1fd)]);}}[a0_0x4815e9(0x22d)](_0x423964){return new Promise(_0x41878a=>setTimeout(_0x41878a,_0x423964));}}var $=T;export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x2c027c=a0_0x348c;(function(_0xb23cb,_0x173d13){const _0x16c195=a0_0x348c,_0x2e7cd1=_0xb23cb();while(!![]){try{const _0x3a04f9=parseInt(_0x16c195(0xce))/0x1+-parseInt(_0x16c195(0x134))/0x2*(parseInt(_0x16c195(0xd2))/0x3)+-parseInt(_0x16c195(0x128))/0x4+parseInt(_0x16c195(0x102))/0x5*(parseInt(_0x16c195(0x132))/0x6)+parseInt(_0x16c195(0x12e))/0x7+-parseInt(_0x16c195(0x103))/0x8+parseInt(_0x16c195(0x13e))/0x9;if(_0x3a04f9===_0x173d13)break;else _0x2e7cd1['push'](_0x2e7cd1['shift']());}catch(_0x11a921){_0x2e7cd1['push'](_0x2e7cd1['shift']());}}}(a0_0x4f35,0xed144));import{readFileSync as a0_0x2c4611,existsSync as a0_0x2c3034}from'fs';import{join as a0_0x51ff7b}from'path';import{hostname as a0_0x5cfa45}from'os';function a0_0x348c(_0x222074,_0x373792){_0x222074=_0x222074-0xb6;const _0x4f3541=a0_0x4f35();let _0x348cd1=_0x4f3541[_0x222074];return _0x348cd1;}import{execSync as a0_0x19311e}from'child_process';import{Server as a0_0x801a2c}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x283180}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x297b20,CallToolRequestSchema as a0_0x26574f}from'@modelcontextprotocol/sdk/types.js';function p(_0x40fb32){const _0x972b36=a0_0x348c;if(!a0_0x2c3034(_0x40fb32))return;for(let _0x3b4f23 of a0_0x2c4611(_0x40fb32,_0x972b36(0xeb))['split']('\x0a')){let _0x3434a=_0x3b4f23[_0x972b36(0xb6)]();if(!_0x3434a||_0x3434a[_0x972b36(0x11f)]('#'))continue;let _0x4f6a33=_0x3434a[_0x972b36(0x147)]('=');if(_0x4f6a33<0x0)continue;let _0x3bfccc=_0x3434a['slice'](0x0,_0x4f6a33)[_0x972b36(0xb6)](),_0x2563d6=_0x3434a[_0x972b36(0x11e)](_0x4f6a33+0x1)[_0x972b36(0xb6)]()[_0x972b36(0x110)](/^["']|["']$/g,'');if(!process.env[_0x3bfccc])process.env[_0x3bfccc]=_0x2563d6;}}var C=process.env.HOME||'~',T=a0_0x51ff7b(C,a0_0x2c027c(0xfd));p(a0_0x51ff7b(T,a0_0x2c027c(0xe9)));var L=process[a0_0x2c027c(0xcc)]()[a0_0x2c027c(0x110)](/\//g,'-');function a0_0x4f35(){const _0x1c9321=['application/json','.env','join','utf-8','2.0','get','commhub-channel','delete','messages','tmux\x20display-message\x20-p\x20\x27#S\x27','commhub_reply','0.3.0','body','object','get_all_status','message_id','split','SSE\x20error:\x20','\x20PROJECT_ENV=','Message\x20content','type','.claude/channels/commhub','commhub_get_all_status','read','new_message','Priority\x20(default:\x20normal)','2332910cjXCaX','6234024OffEUT','none','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','string','new_task','failed','SIGINT','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','exit','blocked','then','heartbeat\x20failed:\x20','hub','replace','2025-03-26','write','status','unknown\x20tool','alias','SSE\x20connection\x20error:\x20','error','SSE\x20fatal:\x20','task','toTimeString','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','notification','parse','slice','startsWith','ack_inbox','normal','stderr','claude-code','broadcast','working','commhub_send_message','stdin','2806948oTaSZI','shutting\x20down,\x20reporting\x20offline...','fatal:\x20','from','setRequestHandler','commhub_send_task','10878364TriUIA','/events/','registered\x20as\x20\x22','notifications/claude/channel','18XBeWLZ','report_status','3052502CnNoVj','get_inbox','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','Session\x20alias:\x20','Reply\x20text\x20/\x20result\x20summary','SSE\x20stream\x20ended,\x20reconnecting...','application/json,\x20text/event-stream','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','\x20from\x20','catch','5058369ruAqZI','Target\x20session\x20alias','find','completed','replied','number','send_task','Bearer\x20','initialize','indexOf','trim','data:\x20','http://127.0.0.1:9200','idle','getReader','from_session','Task\x20content','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','message','/mcp','priority','.anet','set','randomUUID','←\x20message\x20from\x20','\x20CWD=','tools/call','high','POST','ENV:\x20URL=','ready\x20—\x20waiting\x20for\x20events','in_progress','cwd','commhub','462478qWxlfc','text','decode','init\x20failed:\x20','3gBzpNr','result','Authorization','\x22\x20(',':\x20inbox_count=','starting\x20SSE\x20listener...','warning:\x20could\x20not\x20register:\x20','connected','cancelled','session\x20disconnected','MCP\x20stdio\x20connected','no\x20response','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','commhub_report_status','length','content','inbox_count','stringify','connecting\x20to\x20','Progress\x200-100','CommHub\x20init\x20failed:\x20','\x20RESUME_ID='];a0_0x4f35=function(){return _0x1c9321;};return a0_0x4f35();}p(a0_0x51ff7b(T,L,a0_0x2c027c(0xe9)));function U(){const _0x191841=a0_0x2c027c;try{return a0_0x19311e(_0x191841(0xf1),{'encoding':_0x191841(0xeb),'timeout':0x7d0})[_0x191841(0xb6)]();}catch{return'';}}function c(){const _0x16d0bc=a0_0x2c027c;try{let _0x2ee6ae=a0_0x51ff7b(C,_0x16d0bc(0xc1),'config.json');if(a0_0x2c3034(_0x2ee6ae))return JSON['parse'](a0_0x2c4611(_0x2ee6ae,_0x16d0bc(0xeb)));}catch{}return{};}var H=c(),D=process.env.COMMHUB_URL||H[a0_0x2c027c(0x10f)]||a0_0x2c027c(0xb8),f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0x5cfa45(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto[a0_0x2c027c(0xc3)](),X=process.env.COMMHUB_TOKEN||H['token']||'';function Y(_0xa932cb){const _0x219f3e=a0_0x2c027c;let _0x3c0edb=new Date()[_0x219f3e(0x11a)]()[_0x219f3e(0x11e)](0x0,0x8);process[_0x219f3e(0x122)][_0x219f3e(0x112)]('['+_0x3c0edb+']\x20[commhub]\x20'+_0xa932cb+'\x0a');}function h(_0x24999e){return new Promise(_0xc0349c=>setTimeout(_0xc0349c,_0x24999e));}Y(a0_0x2c027c(0xc9)+D+'\x20ALIAS='+Z+a0_0x2c027c(0xe7)+w['slice'](0x0,0x8)+'...\x20TMUX='+(f||a0_0x2c027c(0x104))+a0_0x2c027c(0xc5)+process[a0_0x2c027c(0xcc)]()+a0_0x2c027c(0xfa)+L);var k=new Map(),K=new a0_0x801a2c({'name':a0_0x2c027c(0xee),'version':a0_0x2c027c(0xf3)},{'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_0x2c027c(0x105),'Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.',a0_0x2c027c(0x137)+Z][a0_0x2c027c(0xea)]('\x0a')});K[a0_0x2c027c(0x12c)](a0_0x297b20,async()=>({'tools':[{'name':a0_0x2c027c(0xf2),'description':a0_0x2c027c(0x13b),'inputSchema':{'type':'object','properties':{'task_id':{'type':'string','description':a0_0x2c027c(0x10a)},'text':{'type':a0_0x2c027c(0x106),'description':a0_0x2c027c(0x138)},'status':{'type':a0_0x2c027c(0x106),'enum':['completed',a0_0x2c027c(0x108),a0_0x2c027c(0xda),'blocked',a0_0x2c027c(0x117),a0_0x2c027c(0xcb)],'description':a0_0x2c027c(0x136)}},'required':[a0_0x2c027c(0xcf)]}},{'name':a0_0x2c027c(0xdf),'description':a0_0x2c027c(0xbd),'inputSchema':{'type':a0_0x2c027c(0xf5),'properties':{'status':{'type':a0_0x2c027c(0x106),'enum':[a0_0x2c027c(0x125),a0_0x2c027c(0xb9),a0_0x2c027c(0x10c),a0_0x2c027c(0x117)]},'task':{'type':a0_0x2c027c(0x106),'description':'Current\x20task\x20description'},'progress':{'type':a0_0x2c027c(0x143),'description':a0_0x2c027c(0xe5)}},'required':[a0_0x2c027c(0x113)]}},{'name':a0_0x2c027c(0x12d),'description':a0_0x2c027c(0xde),'inputSchema':{'type':a0_0x2c027c(0xf5),'properties':{'alias':{'type':a0_0x2c027c(0x106),'description':a0_0x2c027c(0x13f)},'task':{'type':a0_0x2c027c(0x106),'description':a0_0x2c027c(0xbc)},'priority':{'type':a0_0x2c027c(0x106),'enum':[a0_0x2c027c(0xc7),'normal','low'],'description':a0_0x2c027c(0x101)}},'required':[a0_0x2c027c(0x115),a0_0x2c027c(0x119)]}},{'name':a0_0x2c027c(0x126),'description':a0_0x2c027c(0x11b),'inputSchema':{'type':a0_0x2c027c(0xf5),'properties':{'alias':{'type':'string','description':a0_0x2c027c(0x13f)},'message':{'type':'string','description':a0_0x2c027c(0xfb)}},'required':[a0_0x2c027c(0x115),'message']}},{'name':a0_0x2c027c(0xfe),'description':'Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','inputSchema':{'type':a0_0x2c027c(0xf5),'properties':{}}}]}));async function P(_0x88e25f,_0x1e6652){const _0x545e4e=a0_0x2c027c;let _0x36eee5=await fetch(D+_0x545e4e(0xbf),{'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x545e4e(0x145)+X}:{}},'body':JSON[_0x545e4e(0xe3)]({'jsonrpc':_0x545e4e(0xec),'id':0x1,'method':_0x545e4e(0x146),'params':{'protocolVersion':_0x545e4e(0x111),'capabilities':{},'clientInfo':{'name':_0x545e4e(0xee),'version':'0.3.0'}}})});if(!_0x36eee5['ok']){let _0x4a9f80=await _0x36eee5['text']();return Y(_0x545e4e(0xe6)+_0x36eee5['status']+'\x20'+_0x4a9f80[_0x545e4e(0x11e)](0x0,0x64)),{'ok':!0x1,'error':_0x545e4e(0xd1)+_0x36eee5[_0x545e4e(0x113)]};}await _0x36eee5[_0x545e4e(0xcf)]();let _0x3bb177=(await(await fetch(D+_0x545e4e(0xbf),{'method':_0x545e4e(0xc8),'headers':{'Content-Type':_0x545e4e(0xe8),'Accept':_0x545e4e(0x13a),...X?{'Authorization':_0x545e4e(0x145)+X}:{}},'body':JSON[_0x545e4e(0xe3)]({'jsonrpc':'2.0','id':0x2,'method':_0x545e4e(0xc6),'params':{'name':_0x88e25f,'arguments':_0x1e6652}})}))['text']())[_0x545e4e(0xf8)]('\x0a')[_0x545e4e(0x140)](_0x5e9310=>_0x5e9310[_0x545e4e(0x11f)]('data:\x20'));if(_0x3bb177){let _0x451660=JSON[_0x545e4e(0x11d)](_0x3bb177['slice'](0x6));return _0x451660?.['result']?.[_0x545e4e(0xe1)]?.[0x0]?.[_0x545e4e(0xcf)]?JSON[_0x545e4e(0x11d)](_0x451660[_0x545e4e(0xd3)][_0x545e4e(0xe1)][0x0][_0x545e4e(0xcf)]):_0x451660;}return{'ok':!0x1,'error':_0x545e4e(0xdd)};}K[a0_0x2c027c(0x12c)](a0_0x26574f,async _0x1b1aad=>{const _0x69641f=a0_0x2c027c;let {name:_0x4134e1,arguments:_0xbd39bb}=_0x1b1aad['params'];if(_0x4134e1==='commhub_reply'){let {task_id:_0x3fb8f2,text:_0x59eef9,status:_0x409bd0}=_0xbd39bb;if(_0x409bd0===_0x69641f(0x141)||_0x409bd0==='failed'||_0x409bd0==='cancelled'){let _0xc04a2c=_0x409bd0==='completed'?_0x69641f(0x142):_0x409bd0,_0x169462=_0x3fb8f2?k[_0x69641f(0xed)](_0x3fb8f2)||'hub':_0x69641f(0x10f),_0x5d4a01=await P('send_reply',{'alias':_0x169462,'text':_0x59eef9,'in_reply_to':_0x3fb8f2||void 0x0,'status':_0xc04a2c,'from_session':Z});if(_0x3fb8f2)k[_0x69641f(0xef)](_0x3fb8f2);return{'content':[{'type':_0x69641f(0xcf),'text':JSON[_0x69641f(0xe3)](_0x5d4a01)}]};}let _0x19aeb7=await P(_0x69641f(0x133),{'resume_id':w,'alias':Z,'status':_0x409bd0===_0x69641f(0x10c)?_0x69641f(0x10c):_0x409bd0===_0x69641f(0x117)?_0x69641f(0x117):_0x69641f(0x125),'task':_0x59eef9['slice'](0x0,0xc8),'output':_0x59eef9});return{'content':[{'type':_0x69641f(0xcf),'text':JSON['stringify'](_0x19aeb7)}]};}if(_0x4134e1===_0x69641f(0xdf)){let {status:_0xd5288a,task:_0x22d27c,progress:_0x5b4dc6}=_0xbd39bb,_0x4186a9=await P(_0x69641f(0x133),{'resume_id':w,'alias':Z,'status':_0xd5288a,'task':_0x22d27c,'progress':_0x5b4dc6});return{'content':[{'type':_0x69641f(0xcf),'text':JSON[_0x69641f(0xe3)](_0x4186a9)}]};}if(_0x4134e1===_0x69641f(0x12d)){let {alias:_0x47f0f5,task:_0xbca806,priority:_0x325587}=_0xbd39bb,_0x12e3c3=await P(_0x69641f(0x144),{'alias':_0x47f0f5,'task':_0xbca806,'priority':_0x325587||'normal','from_session':Z});return{'content':[{'type':_0x69641f(0xcf),'text':JSON[_0x69641f(0xe3)](_0x12e3c3)}]};}if(_0x4134e1===_0x69641f(0x126)){let {alias:_0x5ddc47,message:_0x434e1b}=_0xbd39bb,_0x19496f=await P('send_message',{'alias':_0x5ddc47,'message':_0x434e1b,'from_session':Z});return{'content':[{'type':_0x69641f(0xcf),'text':JSON[_0x69641f(0xe3)](_0x19496f)}]};}if(_0x4134e1===_0x69641f(0xfe)){let _0x4e9ffd=await P(_0x69641f(0xf6),{});return{'content':[{'type':_0x69641f(0xcf),'text':JSON[_0x69641f(0xe3)](_0x4e9ffd)}]};}return{'content':[{'type':_0x69641f(0xcf),'text':JSON[_0x69641f(0xe3)]({'error':_0x69641f(0x114)})}]};});async function v(){const _0x27dcdd=a0_0x2c027c;let _0x26620c=D+_0x27dcdd(0x12f)+encodeURIComponent(Z),_0x384661={};if(X)_0x384661[_0x27dcdd(0xd4)]=_0x27dcdd(0x145)+X;Y(_0x27dcdd(0xe4)+_0x26620c);while(!0x0){try{let _0x35954=await fetch(_0x26620c,{'headers':_0x384661});if(!_0x35954['ok']){Y(_0x27dcdd(0xf9)+_0x35954[_0x27dcdd(0x113)]+'\x20'+_0x35954['statusText']),await h(0x1388);continue;}let _0x23c8ab=_0x35954[_0x27dcdd(0xf4)][_0x27dcdd(0xba)](),_0x5760e3=new TextDecoder(),_0x1ddade='';while(!0x0){let {done:_0x5d1a05,value:_0x5bb714}=await _0x23c8ab[_0x27dcdd(0xff)]();if(_0x5d1a05)break;_0x1ddade+=_0x5760e3[_0x27dcdd(0xd0)](_0x5bb714,{'stream':!0x0});let _0x191c1a=_0x1ddade[_0x27dcdd(0xf8)]('\x0a\x0a');_0x1ddade=_0x191c1a['pop']()||'';for(let _0x123f20 of _0x191c1a){let _0x2da935=_0x123f20[_0x27dcdd(0xf8)]('\x0a')[_0x27dcdd(0x140)](_0x2baf1d=>_0x2baf1d[_0x27dcdd(0x11f)](_0x27dcdd(0xb7)));if(!_0x2da935)continue;try{let _0x4bd2c2=JSON[_0x27dcdd(0x11d)](_0x2da935[_0x27dcdd(0x11e)](0x6));await u(_0x4bd2c2);}catch(_0x3ea619){Y('parse\x20error:\x20'+_0x3ea619);}}}Y(_0x27dcdd(0x139));}catch(_0x1b88a0){Y(_0x27dcdd(0x116)+_0x1b88a0);}await h(0xbb8);}}async function u(_0x4c7779){const _0x3955b1=a0_0x2c027c;if(_0x4c7779['type']===_0x3955b1(0xd9)){Y('SSE\x20connected\x20as\x20\x22'+Z+'\x22');return;}if(_0x4c7779[_0x3955b1(0xfc)]===_0x3955b1(0x100)){if(Y(_0x3955b1(0xc4)+_0x4c7779[_0x3955b1(0x12b)]+':\x20'+_0x4c7779[_0x3955b1(0xbe)]['slice'](0x0,0x3c)),await K[_0x3955b1(0x11c)]({'method':_0x3955b1(0x131),'params':{'content':_0x4c7779[_0x3955b1(0xbe)],'meta':{'sender':_0x4c7779[_0x3955b1(0x12b)]||'hub','sender_id':_0x3955b1(0xcd),'user':_0x4c7779[_0x3955b1(0x12b)]||_0x3955b1(0x10f),'priority':_0x3955b1(0x121)}}}),_0x4c7779[_0x3955b1(0xf7)])await P('ack_inbox',{'alias':Z,'message_id':_0x4c7779[_0x3955b1(0xf7)]});return;}if(_0x4c7779[_0x3955b1(0xfc)]===_0x3955b1(0x107)||_0x4c7779[_0x3955b1(0xfc)]===_0x3955b1(0x124)){Y('←\x20'+_0x4c7779['type']+_0x3955b1(0xd6)+_0x4c7779[_0x3955b1(0xe2)]+'\x20priority='+(_0x4c7779[_0x3955b1(0xc0)]||_0x3955b1(0x121)));let _0xe8e31a=await P(_0x3955b1(0x135),{'alias':Z,'limit':0x5});if(_0xe8e31a?.['ok']&&_0xe8e31a[_0x3955b1(0xf0)]?.[_0x3955b1(0xe0)]>0x0)for(let _0x354409 of _0xe8e31a['messages']){let _0x313746={'sender':_0x354409[_0x3955b1(0xbb)]||_0x3955b1(0x10f),'sender_id':_0x3955b1(0xcd),'user':_0x354409[_0x3955b1(0xbb)]||_0x3955b1(0x10f),'task_id':_0x354409['id'],'priority':_0x354409[_0x3955b1(0xc0)]||'normal'};k[_0x3955b1(0xc2)](_0x354409['id'],_0x354409['from_session']||_0x3955b1(0x10f)),await K[_0x3955b1(0x11c)]({'method':_0x3955b1(0x131),'params':{'content':_0x354409[_0x3955b1(0xe1)],'meta':_0x313746}}),Y('→\x20injected\x20task\x20'+_0x354409['id'][_0x3955b1(0x11e)](0x0,0x8)+_0x3955b1(0x13c)+_0x354409[_0x3955b1(0xbb)]+':\x20'+_0x354409['content'][_0x3955b1(0x11e)](0x0,0x3c)),await P(_0x3955b1(0x120),{'alias':Z,'message_id':_0x354409['id']});}}}async function S(){const _0x3f55d1=a0_0x2c027c;let _0x120135=new a0_0x283180();await K['connect'](_0x120135),Y(_0x3f55d1(0xdc)),Y(_0x3f55d1(0xd7)),v()[_0x3f55d1(0x13d)](_0x5d6608=>Y(_0x3f55d1(0x118)+_0x5d6608)),P(_0x3f55d1(0x133),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x5cfa45(),'hostname':a0_0x5cfa45(),'agent':_0x3f55d1(0x123),'project_dir':process[_0x3f55d1(0xcc)](),'tmux_name':f||void 0x0})[_0x3f55d1(0x10d)](()=>Y(_0x3f55d1(0x130)+Z+_0x3f55d1(0xd5)+w['slice'](0x0,0x8)+')'))[_0x3f55d1(0x13d)](_0x3fc2b4=>Y(_0x3f55d1(0xd8)+_0x3fc2b4)),setInterval(()=>{const _0x49d513=_0x3f55d1;P(_0x49d513(0x133),{'resume_id':w,'alias':Z,'status':_0x49d513(0xb9),'server':a0_0x5cfa45(),'hostname':a0_0x5cfa45(),'agent':_0x49d513(0x123),'project_dir':process[_0x49d513(0xcc)](),'tmux_name':f||void 0x0})['catch'](_0x363d1c=>Y(_0x49d513(0x10e)+_0x363d1c));},0x2bf20),Y(_0x3f55d1(0xca));}S()[a0_0x2c027c(0x13d)](_0x86d667=>{const _0x1b0efc=a0_0x2c027c;Y(_0x1b0efc(0x12a)+_0x86d667),process[_0x1b0efc(0x10b)](0x1);});async function N(){const _0x42e05f=a0_0x2c027c;Y(_0x42e05f(0x129)),await P(_0x42e05f(0x133),{'resume_id':w,'alias':Z,'status':_0x42e05f(0x117),'task':_0x42e05f(0xdb)})[_0x42e05f(0x13d)](()=>{}),process['exit'](0x0);}process[a0_0x2c027c(0x127)]['on']('end',()=>N()),process['on']('SIGTERM',()=>N()),process['on'](a0_0x2c027c(0x109),()=>N());
2
+ const a0_0x3bb0a6=a0_0x30c2;(function(_0x5910ce,_0x1e4ee7){const _0x470be3=a0_0x30c2,_0x2cb204=_0x5910ce();while(!![]){try{const _0xb930b1=parseInt(_0x470be3(0x22a))/0x1*(-parseInt(_0x470be3(0x1c4))/0x2)+parseInt(_0x470be3(0x1f3))/0x3*(-parseInt(_0x470be3(0x205))/0x4)+-parseInt(_0x470be3(0x1db))/0x5+-parseInt(_0x470be3(0x232))/0x6*(-parseInt(_0x470be3(0x1ff))/0x7)+-parseInt(_0x470be3(0x1d4))/0x8*(parseInt(_0x470be3(0x229))/0x9)+parseInt(_0x470be3(0x1e5))/0xa+parseInt(_0x470be3(0x226))/0xb;if(_0xb930b1===_0x1e4ee7)break;else _0x2cb204['push'](_0x2cb204['shift']());}catch(_0x447959){_0x2cb204['push'](_0x2cb204['shift']());}}}(a0_0x14eb,0x522bf));function a0_0x30c2(_0x3197fc,_0x57f170){_0x3197fc=_0x3197fc-0x1b6;const _0x14eba1=a0_0x14eb();let _0x30c2b3=_0x14eba1[_0x3197fc];return _0x30c2b3;}import{readFileSync as a0_0x3a3e3a,existsSync as a0_0xf1e562}from'fs';import{join as a0_0x5004b3}from'path';import{hostname as a0_0x3d6ca3}from'os';import{execSync as a0_0x2c55f9}from'child_process';import{Server as a0_0x655a18}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x1916a5}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0xc57324,CallToolRequestSchema as a0_0x3f7cf4}from'@modelcontextprotocol/sdk/types.js';function p(_0x3bd238){const _0x593b06=a0_0x30c2;if(!a0_0xf1e562(_0x3bd238))return;for(let _0x3bcf72 of a0_0x3a3e3a(_0x3bd238,'utf-8')[_0x593b06(0x1e4)]('\x0a')){let _0x397874=_0x3bcf72[_0x593b06(0x209)]();if(!_0x397874||_0x397874[_0x593b06(0x1e8)]('#'))continue;let _0x217fe0=_0x397874[_0x593b06(0x1b9)]('=');if(_0x217fe0<0x0)continue;let _0xf28717=_0x397874[_0x593b06(0x225)](0x0,_0x217fe0)[_0x593b06(0x209)](),_0x279b4c=_0x397874[_0x593b06(0x225)](_0x217fe0+0x1)[_0x593b06(0x209)]()[_0x593b06(0x1c0)](/^["']|["']$/g,'');if(!process.env[_0xf28717])process.env[_0xf28717]=_0x279b4c;}}var C=process.env.HOME||'~',T=a0_0x5004b3(C,a0_0x3bb0a6(0x219));p(a0_0x5004b3(T,'.env'));var L=process[a0_0x3bb0a6(0x216)]()[a0_0x3bb0a6(0x1c0)](/\//g,'-');p(a0_0x5004b3(T,L,a0_0x3bb0a6(0x236)));function U(){const _0x233616=a0_0x3bb0a6;try{return a0_0x2c55f9('tmux\x20display-message\x20-p\x20\x27#S\x27',{'encoding':_0x233616(0x1cb),'timeout':0x7d0})[_0x233616(0x209)]();}catch{return'';}}function c(){const _0x15123c=a0_0x3bb0a6;try{let _0x3699e2=a0_0x5004b3(C,'.anet',_0x15123c(0x1ea));if(a0_0xf1e562(_0x3699e2))return JSON[_0x15123c(0x234)](a0_0x3a3e3a(_0x3699e2,'utf-8'));}catch{}return{};}var H=c(),D=process.env.COMMHUB_URL||H[a0_0x3bb0a6(0x21d)]||a0_0x3bb0a6(0x20b),f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0x3d6ca3(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto[a0_0x3bb0a6(0x1d9)](),X=process.env.COMMHUB_TOKEN||H[a0_0x3bb0a6(0x1f7)]||'';function Y(_0xf5e4b6){const _0x32a9b3=a0_0x3bb0a6;let _0x18f174=new Date()[_0x32a9b3(0x239)]()['slice'](0x0,0x8);process[_0x32a9b3(0x1ce)]['write']('['+_0x18f174+_0x32a9b3(0x210)+_0xf5e4b6+'\x0a');}function h(_0x337c0c){return new Promise(_0x1cdec0=>setTimeout(_0x1cdec0,_0x337c0c));}Y('ENV:\x20URL='+D+a0_0x3bb0a6(0x1dd)+Z+a0_0x3bb0a6(0x1ba)+w[a0_0x3bb0a6(0x225)](0x0,0x8)+'...\x20TMUX='+(f||a0_0x3bb0a6(0x20a))+a0_0x3bb0a6(0x1cf)+process['cwd']()+a0_0x3bb0a6(0x1fc)+L);var k=new Map(),K=new a0_0x655a18({'name':a0_0x3bb0a6(0x208),'version':a0_0x3bb0a6(0x22b)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x3bb0a6(0x223),a0_0x3bb0a6(0x204),a0_0x3bb0a6(0x1c9),a0_0x3bb0a6(0x1ef),a0_0x3bb0a6(0x23f)+Z]['join']('\x0a')});K[a0_0x3bb0a6(0x1ca)](a0_0xc57324,async()=>({'tools':[{'name':'commhub_reply','description':a0_0x3bb0a6(0x1d1),'inputSchema':{'type':a0_0x3bb0a6(0x1c7),'properties':{'task_id':{'type':a0_0x3bb0a6(0x235),'description':a0_0x3bb0a6(0x213)},'text':{'type':a0_0x3bb0a6(0x235),'description':'Reply\x20text\x20/\x20result\x20summary'},'status':{'type':'string','enum':[a0_0x3bb0a6(0x22d),a0_0x3bb0a6(0x1b7),a0_0x3bb0a6(0x21a),a0_0x3bb0a6(0x1bd),a0_0x3bb0a6(0x21b),a0_0x3bb0a6(0x1f4)],'description':a0_0x3bb0a6(0x1eb)}},'required':['text']}},{'name':a0_0x3bb0a6(0x1e2),'description':a0_0x3bb0a6(0x1ee),'inputSchema':{'type':'object','properties':{'status':{'type':a0_0x3bb0a6(0x235),'enum':[a0_0x3bb0a6(0x202),a0_0x3bb0a6(0x218),a0_0x3bb0a6(0x1bd),a0_0x3bb0a6(0x21b)]},'task':{'type':a0_0x3bb0a6(0x235),'description':a0_0x3bb0a6(0x211)},'progress':{'type':a0_0x3bb0a6(0x1e3),'description':'Progress\x200-100'}},'required':['status']}},{'name':a0_0x3bb0a6(0x21f),'description':'Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','inputSchema':{'type':'object','properties':{'alias':{'type':'string','description':a0_0x3bb0a6(0x1e6)},'task':{'type':a0_0x3bb0a6(0x235),'description':a0_0x3bb0a6(0x1bc)},'priority':{'type':a0_0x3bb0a6(0x235),'enum':[a0_0x3bb0a6(0x22c),a0_0x3bb0a6(0x1ed),'low'],'description':'Priority\x20(default:\x20normal)'}},'required':[a0_0x3bb0a6(0x212),a0_0x3bb0a6(0x1c1)]}},{'name':a0_0x3bb0a6(0x1fb),'description':'Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','inputSchema':{'type':a0_0x3bb0a6(0x1c7),'properties':{'alias':{'type':a0_0x3bb0a6(0x235),'description':a0_0x3bb0a6(0x1e6)},'message':{'type':'string','description':a0_0x3bb0a6(0x1f5)}},'required':[a0_0x3bb0a6(0x212),a0_0x3bb0a6(0x20f)]}},{'name':a0_0x3bb0a6(0x1c5),'description':'Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','inputSchema':{'type':a0_0x3bb0a6(0x1c7),'properties':{}}}]}));async function P(_0x4c952f,_0x1bb482){const _0x48e53b=a0_0x3bb0a6;let _0x3d9700=await fetch(D+_0x48e53b(0x22e),{'method':'POST','headers':{'Content-Type':_0x48e53b(0x203),'Accept':_0x48e53b(0x1ec),...X?{'Authorization':_0x48e53b(0x1d3)+X}:{}},'body':JSON[_0x48e53b(0x1be)]({'jsonrpc':_0x48e53b(0x200),'id':0x1,'method':_0x48e53b(0x1f0),'params':{'protocolVersion':_0x48e53b(0x23d),'capabilities':{},'clientInfo':{'name':'commhub-channel','version':_0x48e53b(0x22b)}}})});if(!_0x3d9700['ok']){let _0x1183ec=await _0x3d9700['text']();return Y(_0x48e53b(0x1e7)+_0x3d9700[_0x48e53b(0x1f6)]+'\x20'+_0x1183ec[_0x48e53b(0x225)](0x0,0x64)),{'ok':!0x1,'error':_0x48e53b(0x1c3)+_0x3d9700[_0x48e53b(0x1f6)]};}await _0x3d9700[_0x48e53b(0x228)]();let _0x181f29=(await(await fetch(D+_0x48e53b(0x22e),{'method':'POST','headers':{'Content-Type':_0x48e53b(0x203),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x48e53b(0x1d3)+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x48e53b(0x200),'id':0x2,'method':'tools/call','params':{'name':_0x4c952f,'arguments':_0x1bb482}})}))[_0x48e53b(0x228)]())[_0x48e53b(0x1e4)]('\x0a')['find'](_0x144d94=>_0x144d94[_0x48e53b(0x1e8)](_0x48e53b(0x1fd)));if(_0x181f29){let _0x1d14e8=JSON[_0x48e53b(0x234)](_0x181f29[_0x48e53b(0x225)](0x6));return _0x1d14e8?.[_0x48e53b(0x20e)]?.['content']?.[0x0]?.[_0x48e53b(0x228)]?JSON[_0x48e53b(0x234)](_0x1d14e8[_0x48e53b(0x20e)][_0x48e53b(0x1fa)][0x0][_0x48e53b(0x228)]):_0x1d14e8;}return{'ok':!0x1,'error':'no\x20response'};}K['setRequestHandler'](a0_0x3f7cf4,async _0x88f8f=>{const _0x4cfa5b=a0_0x3bb0a6;let {name:_0x3e73d4,arguments:_0x5e1130}=_0x88f8f['params'];if(_0x3e73d4===_0x4cfa5b(0x206)){let {task_id:_0x339a07,text:_0x57923a,status:_0x53bf60}=_0x5e1130;if(_0x53bf60===_0x4cfa5b(0x22d)||_0x53bf60===_0x4cfa5b(0x1b7)||_0x53bf60===_0x4cfa5b(0x21a)){let _0x4afab9=_0x53bf60===_0x4cfa5b(0x22d)?'replied':_0x53bf60,_0xcea8c9=_0x339a07?k['get'](_0x339a07)||'hub':_0x4cfa5b(0x21d),_0x423d6f=await P('send_reply',{'alias':_0xcea8c9,'text':_0x57923a,'in_reply_to':_0x339a07||void 0x0,'status':_0x4afab9,'from_session':Z});if(_0x339a07)k[_0x4cfa5b(0x201)](_0x339a07);return{'content':[{'type':_0x4cfa5b(0x228),'text':JSON[_0x4cfa5b(0x1be)](_0x423d6f)}]};}let _0x783874=await P(_0x4cfa5b(0x1bb),{'resume_id':w,'alias':Z,'status':_0x53bf60===_0x4cfa5b(0x1bd)?_0x4cfa5b(0x1bd):_0x53bf60===_0x4cfa5b(0x21b)?_0x4cfa5b(0x21b):_0x4cfa5b(0x202),'task':_0x57923a[_0x4cfa5b(0x225)](0x0,0xc8),'output':_0x57923a});return{'content':[{'type':_0x4cfa5b(0x228),'text':JSON[_0x4cfa5b(0x1be)](_0x783874)}]};}if(_0x3e73d4===_0x4cfa5b(0x1e2)){let {status:_0x23419a,task:_0x330254,progress:_0xdcbb03}=_0x5e1130,_0xfe77bb=await P(_0x4cfa5b(0x1bb),{'resume_id':w,'alias':Z,'status':_0x23419a,'task':_0x330254,'progress':_0xdcbb03});return{'content':[{'type':'text','text':JSON['stringify'](_0xfe77bb)}]};}if(_0x3e73d4===_0x4cfa5b(0x21f)){let {alias:_0x2e250a,task:_0x44f628,priority:_0x2b29d6}=_0x5e1130,_0x5ad76c=await P(_0x4cfa5b(0x1d0),{'alias':_0x2e250a,'task':_0x44f628,'priority':_0x2b29d6||_0x4cfa5b(0x1ed),'from_session':Z});return{'content':[{'type':_0x4cfa5b(0x228),'text':JSON[_0x4cfa5b(0x1be)](_0x5ad76c)}]};}if(_0x3e73d4===_0x4cfa5b(0x1fb)){let {alias:_0x38198a,message:_0xfe1ecb}=_0x5e1130,_0xb9c008=await P('send_message',{'alias':_0x38198a,'message':_0xfe1ecb,'from_session':Z});return{'content':[{'type':_0x4cfa5b(0x228),'text':JSON[_0x4cfa5b(0x1be)](_0xb9c008)}]};}if(_0x3e73d4==='commhub_get_all_status'){let _0x398cc6=await P(_0x4cfa5b(0x1f8),{});return{'content':[{'type':_0x4cfa5b(0x228),'text':JSON['stringify'](_0x398cc6)}]};}return{'content':[{'type':_0x4cfa5b(0x228),'text':JSON[_0x4cfa5b(0x1be)]({'error':_0x4cfa5b(0x1f2)})}]};});async function v(){const _0x889835=a0_0x3bb0a6;let _0x55dc5a=D+_0x889835(0x230)+encodeURIComponent(Z),_0x1183e9={};if(X)_0x1183e9[_0x889835(0x224)]='Bearer\x20'+X;Y(_0x889835(0x1cd)+_0x55dc5a);while(!0x0){try{let _0x538663=await fetch(_0x55dc5a,{'headers':_0x1183e9});if(!_0x538663['ok']){Y(_0x889835(0x238)+_0x538663['status']+'\x20'+_0x538663[_0x889835(0x1d2)]),await h(0x1388);continue;}let _0x380aa6=_0x538663[_0x889835(0x207)]['getReader'](),_0x41520c=new TextDecoder(),_0x1744f0='';while(!0x0){let {done:_0x159310,value:_0x1fa45f}=await _0x380aa6['read']();if(_0x159310)break;_0x1744f0+=_0x41520c[_0x889835(0x1e1)](_0x1fa45f,{'stream':!0x0});let _0x2a143c=_0x1744f0['split']('\x0a\x0a');_0x1744f0=_0x2a143c['pop']()||'';for(let _0xecb791 of _0x2a143c){let _0x434fc8=_0xecb791[_0x889835(0x1e4)]('\x0a')[_0x889835(0x1d8)](_0x21c58d=>_0x21c58d[_0x889835(0x1e8)](_0x889835(0x1fd)));if(!_0x434fc8)continue;try{let _0x31e596=JSON[_0x889835(0x234)](_0x434fc8[_0x889835(0x225)](0x6));await u(_0x31e596);}catch(_0x4a19cb){Y('parse\x20error:\x20'+_0x4a19cb);}}}Y(_0x889835(0x1df));}catch(_0x221620){Y(_0x889835(0x1d7)+_0x221620);}await h(0xbb8);}}async function u(_0x18f038){const _0x236ecd=a0_0x3bb0a6;if(_0x18f038['type']===_0x236ecd(0x23b)){Y(_0x236ecd(0x1b8)+Z+'\x22');return;}if(_0x18f038[_0x236ecd(0x233)]===_0x236ecd(0x1c2)){if(Y(_0x236ecd(0x1d6)+_0x18f038[_0x236ecd(0x1e0)]+':\x20'+_0x18f038[_0x236ecd(0x20f)][_0x236ecd(0x225)](0x0,0x3c)),await K[_0x236ecd(0x1c6)]({'method':_0x236ecd(0x1da),'params':{'content':_0x18f038[_0x236ecd(0x20f)],'meta':{'sender':_0x18f038[_0x236ecd(0x1e0)]||_0x236ecd(0x21d),'sender_id':_0x236ecd(0x1f9),'user':_0x18f038[_0x236ecd(0x1e0)]||_0x236ecd(0x21d),'priority':_0x236ecd(0x1ed)}}}),_0x18f038[_0x236ecd(0x20c)])await P(_0x236ecd(0x1e9),{'alias':Z,'message_id':_0x18f038[_0x236ecd(0x20c)]});return;}if(_0x18f038[_0x236ecd(0x233)]===_0x236ecd(0x1cc)||_0x18f038['type']===_0x236ecd(0x221)){Y('←\x20'+_0x18f038[_0x236ecd(0x233)]+_0x236ecd(0x217)+_0x18f038[_0x236ecd(0x215)]+_0x236ecd(0x1d5)+(_0x18f038[_0x236ecd(0x231)]||_0x236ecd(0x1ed)));let _0x17aa6a=await P(_0x236ecd(0x23c),{'alias':Z,'limit':0x5});if(_0x17aa6a?.['ok']&&_0x17aa6a[_0x236ecd(0x1fe)]?.['length']>0x0)for(let _0x49acb4 of _0x17aa6a['messages']){let _0x5cea19={'sender':_0x49acb4[_0x236ecd(0x1dc)]||'hub','sender_id':_0x236ecd(0x1f9),'user':_0x49acb4['from_session']||_0x236ecd(0x21d),'task_id':_0x49acb4['id'],'priority':_0x49acb4[_0x236ecd(0x231)]||_0x236ecd(0x1ed)};k[_0x236ecd(0x23e)](_0x49acb4['id'],_0x49acb4[_0x236ecd(0x1dc)]||_0x236ecd(0x21d)),await K[_0x236ecd(0x1c6)]({'method':_0x236ecd(0x1da),'params':{'content':_0x49acb4[_0x236ecd(0x1fa)],'meta':_0x5cea19}}),Y('→\x20injected\x20task\x20'+_0x49acb4['id']['slice'](0x0,0x8)+_0x236ecd(0x237)+_0x49acb4[_0x236ecd(0x1dc)]+':\x20'+_0x49acb4[_0x236ecd(0x1fa)][_0x236ecd(0x225)](0x0,0x3c)),await P(_0x236ecd(0x1e9),{'alias':Z,'message_id':_0x49acb4['id']});}}}async function S(){const _0x58d0bc=a0_0x3bb0a6;let _0x4c3d8d=new a0_0x1916a5();await K[_0x58d0bc(0x23a)](_0x4c3d8d),Y('MCP\x20stdio\x20connected'),Y('starting\x20SSE\x20listener...'),v()[_0x58d0bc(0x1de)](_0x1fb07d=>Y('SSE\x20fatal:\x20'+_0x1fb07d)),P('report_status',{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x3d6ca3(),'hostname':a0_0x3d6ca3(),'agent':_0x58d0bc(0x21e),'project_dir':process[_0x58d0bc(0x216)](),'tmux_name':f||void 0x0})['then'](()=>Y(_0x58d0bc(0x1bf)+Z+_0x58d0bc(0x1f1)+w['slice'](0x0,0x8)+')'))[_0x58d0bc(0x1de)](_0x5b24ed=>Y(_0x58d0bc(0x222)+_0x5b24ed)),setInterval(()=>{const _0x76fa5c=_0x58d0bc;P(_0x76fa5c(0x1bb),{'resume_id':w,'alias':Z,'status':_0x76fa5c(0x218),'server':a0_0x3d6ca3(),'hostname':a0_0x3d6ca3(),'agent':_0x76fa5c(0x21e),'project_dir':process[_0x76fa5c(0x216)](),'tmux_name':f||void 0x0})[_0x76fa5c(0x1de)](_0xb4e790=>Y(_0x76fa5c(0x220)+_0xb4e790));},0x2bf20),Y(_0x58d0bc(0x20d));}S()[a0_0x3bb0a6(0x1de)](_0x4a7870=>{const _0x537a08=a0_0x3bb0a6;Y(_0x537a08(0x1b6)+_0x4a7870),process[_0x537a08(0x227)](0x1);});function a0_0x14eb(){const _0x16f226=['44avQiWF','commhub_reply','body','commhub-channel','trim','none','http://127.0.0.1:9200','message_id','ready\x20—\x20waiting\x20for\x20events','result','message',']\x20[commhub]\x20','Current\x20task\x20description','alias','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','session\x20disconnected','inbox_count','cwd',':\x20inbox_count=','idle','.claude/channels/commhub','cancelled','error','stdin','hub','claude-code','commhub_send_task','heartbeat\x20failed:\x20','broadcast','warning:\x20could\x20not\x20register:\x20','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','Authorization','slice','12922910FNDPQQ','exit','text','92007SeVhRE','23paLmdL','0.3.0','high','completed','/mcp','SIGINT','/events/','priority','406446ZiXqOu','type','parse','string','.env','\x20from\x20','SSE\x20error:\x20','toTimeString','connect','connected','get_inbox','2025-03-26','set','Session\x20alias:\x20','fatal:\x20','failed','SSE\x20connected\x20as\x20\x22','indexOf','\x20RESUME_ID=','report_status','Task\x20content','blocked','stringify','registered\x20as\x20\x22','replace','task','new_message','init\x20failed:\x20','2280tCJMyw','commhub_get_all_status','notification','object','end','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','setRequestHandler','utf-8','new_task','connecting\x20to\x20','stderr','\x20CWD=','send_task','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','statusText','Bearer\x20','504ecrmag','\x20priority=','←\x20message\x20from\x20','SSE\x20connection\x20error:\x20','find','randomUUID','notifications/claude/channel','1280860cZMfTU','from_session','\x20ALIAS=','catch','SSE\x20stream\x20ended,\x20reconnecting...','from','decode','commhub_report_status','number','split','3414360fsUNeJ','Target\x20session\x20alias','CommHub\x20init\x20failed:\x20','startsWith','ack_inbox','config.json','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','application/json,\x20text/event-stream','normal','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','initialize','\x22\x20(','unknown\x20tool','142962YpgwHA','in_progress','Message\x20content','status','token','get_all_status','commhub','content','commhub_send_message','\x20PROJECT_ENV=','data:\x20','messages','28vqKxNP','2.0','delete','working','application/json','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.'];a0_0x14eb=function(){return _0x16f226;};return a0_0x14eb();}async function N(){const _0x5b209b=a0_0x3bb0a6;Y('shutting\x20down,\x20reporting\x20offline...'),await P(_0x5b209b(0x1bb),{'resume_id':w,'alias':Z,'status':_0x5b209b(0x21b),'task':_0x5b209b(0x214)})['catch'](()=>{}),process['exit'](0x0);}process[a0_0x3bb0a6(0x21c)]['on'](a0_0x3bb0a6(0x1c8),()=>N()),process['on']('SIGTERM',()=>N()),process['on'](a0_0x3bb0a6(0x22f),()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.0.0-preview.41",
3
+ "version": "2.0.0-preview.42",
4
4
  "description": "AI Agent Network CLI \u2014 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",