@sleep2agi/agent-network 2.1.15-preview.5 → 2.1.15-preview.7

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
- function a0_0x2f92(_0x83de4,_0x21682f){_0x83de4=_0x83de4-0xcb;const _0x5ae492=a0_0x5ae4();let _0x2f92d3=_0x5ae492[_0x83de4];return _0x2f92d3;}const a0_0x417a73=a0_0x2f92;(function(_0x3c50cb,_0x2263f0){const _0x5335eb=a0_0x2f92,_0x5386a4=_0x3c50cb();while(!![]){try{const _0x444adc=parseInt(_0x5335eb(0xef))/0x1*(-parseInt(_0x5335eb(0x10d))/0x2)+parseInt(_0x5335eb(0x11f))/0x3+-parseInt(_0x5335eb(0xd1))/0x4*(-parseInt(_0x5335eb(0x118))/0x5)+-parseInt(_0x5335eb(0x105))/0x6*(-parseInt(_0x5335eb(0xf1))/0x7)+-parseInt(_0x5335eb(0xf0))/0x8*(-parseInt(_0x5335eb(0x11b))/0x9)+-parseInt(_0x5335eb(0xd4))/0xa+parseInt(_0x5335eb(0xe1))/0xb*(-parseInt(_0x5335eb(0xf6))/0xc);if(_0x444adc===_0x2263f0)break;else _0x5386a4['push'](_0x5386a4['shift']());}catch(_0x131302){_0x5386a4['push'](_0x5386a4['shift']());}}}(a0_0x5ae4,0x42fe1));import{EventEmitter as a0_0x5baffe}from'events';function a0_0x5ae4(){const _0x507ebf=['AbortError','1092dtWjbB','send_message','error','626470JEIcoU','reply','Bearer\x20','registered','slice','call','read','decode','SSE\x20connected','task','completed','broadcast','running','751531hjirBy','message','emit','now','catch','token','getAllStatus','application/json','heartbeatInterval','offline','signal','send_task','sleep','content','186CnTcIL','2423576yIorIi','26327htUjCf','replace','report_status','s...','server','72noHejh','abort','send',']\x20[commhub:','idle','Authorization','from_session','processInbox','cwd','startsWith','split','resumeId','min','match','normal','408CjYmwP','reconnectDelay','disconnected','data:\x20','new_message','alias','status','sdk-','42JKaIBo','/mcp','send_reply','log','result','connect','connectSSE','connected','SSE\x20reconnecting\x20in\x20','type','parse','3155pOTcWu','text','sseAbort','9rHjdmH','inbox\x20error:\x20','stringify','url','59766lXaZUT','heartbeatTimer','ack_inbox','application/json,\x20text/event-stream','SSE\x20error:\x20','name','agent','text/event-stream'];a0_0x5ae4=function(){return _0x507ebf;};return a0_0x5ae4();}import{hostname as a0_0x3864dd}from'os';class T extends a0_0x5baffe{[a0_0x417a73(0x11e)];[a0_0x417a73(0x10a)];[a0_0x417a73(0xe6)];[a0_0x417a73(0xce)];['resumeId'];[a0_0x417a73(0xe9)];[a0_0x417a73(0x106)];[a0_0x417a73(0x120)];[a0_0x417a73(0x11a)];[a0_0x417a73(0xe0)]=!0x1;constructor(_0x399b6f){const _0x298687=a0_0x417a73;super();if(this[_0x298687(0x11e)]=_0x399b6f[_0x298687(0x11e)][_0x298687(0xf2)](/\/$/,''),this[_0x298687(0x10a)]=_0x399b6f[_0x298687(0x10a)],this[_0x298687(0xe6)]=_0x399b6f[_0x298687(0xe6)],this['agent']=_0x399b6f[_0x298687(0xce)]||'sdk',this[_0x298687(0x101)]=_0x298687(0x10c)+_0x399b6f['alias']+'-'+Date[_0x298687(0xe4)]()['toString'](0x24),this[_0x298687(0xe9)]=_0x399b6f['heartbeatInterval']??0x2bf20,this[_0x298687(0x106)]=_0x399b6f[_0x298687(0x106)]??0xbb8,_0x399b6f['autoConnect']!==!0x1)this['connect']();}[a0_0x417a73(0x110)](_0xa1cce6){const _0x36180a=a0_0x417a73;console['log']('['+new Date()['toTimeString']()[_0x36180a(0xd8)](0x0,0x8)+_0x36180a(0xf9)+this[_0x36180a(0x10a)]+']\x20'+_0xa1cce6);}async['call'](_0x68273c,_0x428fd3){const _0xebd738=a0_0x417a73;let _0x537ea4={'Content-Type':_0xebd738(0xe8),'Accept':_0xebd738(0xcb)};if(this[_0xebd738(0xe6)])_0x537ea4[_0xebd738(0xfb)]='Bearer\x20'+this[_0xebd738(0xe6)];let _0x3f4181=await(await fetch(this[_0xebd738(0x11e)]+_0xebd738(0x10e),{'method':'POST','headers':_0x537ea4,'body':JSON[_0xebd738(0x11d)]({'jsonrpc':'2.0','id':Date['now'](),'method':'tools/call','params':{'name':_0x68273c,'arguments':_0x428fd3}})}))[_0xebd738(0x119)](),_0x3ee1de=_0x3f4181[_0xebd738(0x103)](/data: (.+)/),_0x26a3b5=_0x3ee1de?JSON[_0xebd738(0x117)](_0x3ee1de[0x1]):JSON[_0xebd738(0x117)](_0x3f4181),_0x3671d2=_0x26a3b5?.[_0xebd738(0x111)]?.[_0xebd738(0xee)]?.[0x0]?.['text'];return _0x3671d2?JSON['parse'](_0x3671d2):_0x26a3b5;}async[a0_0x417a73(0x112)](){const _0x168fe3=a0_0x417a73;if(this[_0x168fe3(0xe0)])return;this[_0x168fe3(0xe0)]=!0x0,await this[_0x168fe3(0x10b)]('idle'),this[_0x168fe3(0x110)](_0x168fe3(0xd7)),this[_0x168fe3(0x120)]=setInterval(()=>{const _0x14d3f7=_0x168fe3;this[_0x14d3f7(0x10b)](_0x14d3f7(0xfa))[_0x14d3f7(0xe5)](_0x15a7a6=>this[_0x14d3f7(0x110)]('heartbeat\x20failed:\x20'+_0x15a7a6[_0x14d3f7(0xe2)]));},this[_0x168fe3(0xe9)]),this[_0x168fe3(0x113)]();}async['disconnect'](){const _0x2595db=a0_0x417a73;if(this[_0x2595db(0xe0)]=!0x1,this[_0x2595db(0x11a)]?.[_0x2595db(0xf7)](),this['heartbeatTimer'])clearInterval(this[_0x2595db(0x120)]);await this['status'](_0x2595db(0xea))['catch'](()=>{}),this[_0x2595db(0x110)](_0x2595db(0x107));}async[a0_0x417a73(0xf8)](_0x80f2aa,_0x1ad3de,_0x5755fe=a0_0x417a73(0x104)){const _0x2a570e=a0_0x417a73;return this[_0x2a570e(0xd9)](_0x2a570e(0xec),{'alias':_0x80f2aa,'task':_0x1ad3de,'priority':_0x5755fe,'from_session':this[_0x2a570e(0x10a)]});}async['message'](_0x176689,_0x375fe8){const _0x2736f6=a0_0x417a73;return this[_0x2736f6(0xd9)](_0x2736f6(0xd2),{'alias':_0x176689,'message':_0x375fe8,'from_session':this[_0x2736f6(0x10a)]});}async[a0_0x417a73(0xd5)](_0x4b8377,_0x4e1bb8,_0x236c19=a0_0x417a73(0xde)){const _0x218573=a0_0x417a73;return this[_0x218573(0xd9)](_0x218573(0x10f),{'in_reply_to':_0x4b8377,'text':_0x4e1bb8,'status':_0x236c19});}async['status'](_0x3e78fa,_0xfa3c57){const _0x61c30b=a0_0x417a73;return this[_0x61c30b(0xd9)](_0x61c30b(0xf3),{'resume_id':this[_0x61c30b(0x101)],'alias':this[_0x61c30b(0x10a)],'status':_0x3e78fa,'server':a0_0x3864dd(),'hostname':a0_0x3864dd(),'agent':this['agent'],'project_dir':process[_0x61c30b(0xfe)](),..._0xfa3c57});}async[a0_0x417a73(0xe7)](){const _0xc58e12=a0_0x417a73;return this[_0xc58e12(0xd9)]('get_all_status',{});}async[a0_0x417a73(0xdf)](_0x20146f,_0x451823){const _0x4c3255=a0_0x417a73;return this[_0x4c3255(0xd9)]('broadcast',{'message':_0x20146f,'filter_server':_0x451823?.[_0x4c3255(0xf5)],'filter_status':_0x451823?.[_0x4c3255(0x10b)]});}async[a0_0x417a73(0x113)](){const _0x1dc235=a0_0x417a73;let _0x56458a=encodeURIComponent(this[_0x1dc235(0x10a)]),_0x18be31=this[_0x1dc235(0x11e)]+'/events/'+_0x56458a,_0x3a43b7=this[_0x1dc235(0x106)];while(this['running']){try{this['sseAbort']=new AbortController();let _0x2c3a58={'Accept':_0x1dc235(0xcf)};if(this[_0x1dc235(0xe6)])_0x2c3a58['Authorization']=_0x1dc235(0xd6)+this[_0x1dc235(0xe6)];let _0x5da9f6=await fetch(_0x18be31,{'headers':_0x2c3a58,'signal':this[_0x1dc235(0x11a)][_0x1dc235(0xeb)]});if(!_0x5da9f6['ok']||!_0x5da9f6['body']){this[_0x1dc235(0x110)]('SSE\x20failed:\x20'+_0x5da9f6[_0x1dc235(0x10b)]),await this[_0x1dc235(0xed)](_0x3a43b7),_0x3a43b7=Math[_0x1dc235(0x102)](_0x3a43b7*1.5,0xea60);continue;}_0x3a43b7=this[_0x1dc235(0x106)];let _0x1e79a4=_0x5da9f6['body']['getReader'](),_0x598558=new TextDecoder(),_0x48afd4='';while(this[_0x1dc235(0xe0)]){let {done:_0x526b20,value:_0x3e00d9}=await _0x1e79a4[_0x1dc235(0xda)]();if(_0x526b20)break;_0x48afd4+=_0x598558[_0x1dc235(0xdb)](_0x3e00d9,{'stream':!0x0});let _0x5b0641=_0x48afd4[_0x1dc235(0x100)]('\x0a');_0x48afd4=_0x5b0641['pop']()||'';for(let _0x345308 of _0x5b0641){if(!_0x345308[_0x1dc235(0xff)](_0x1dc235(0x108)))continue;try{let _0xeadcc6=JSON['parse'](_0x345308['slice'](0x6));if(_0xeadcc6[_0x1dc235(0x116)]===_0x1dc235(0x114)){this[_0x1dc235(0x110)](_0x1dc235(0xdc)),this[_0x1dc235(0xe3)]('connected');continue;}if(_0xeadcc6[_0x1dc235(0x116)]==='new_task'||_0xeadcc6[_0x1dc235(0x116)]===_0x1dc235(0x109)||_0xeadcc6[_0x1dc235(0x116)]===_0x1dc235(0xdf))await this[_0x1dc235(0xfd)]();}catch{}}}}catch(_0x599158){if(_0x599158[_0x1dc235(0xcd)]===_0x1dc235(0xd0))break;this[_0x1dc235(0xe3)](_0x1dc235(0xd3),_0x599158),this[_0x1dc235(0x110)](_0x1dc235(0xcc)+_0x599158['message']);}if(this[_0x1dc235(0xe0)])this['emit'](_0x1dc235(0x107)),this[_0x1dc235(0x110)](_0x1dc235(0x115)+_0x3a43b7/0x3e8+_0x1dc235(0xf4)),await this[_0x1dc235(0xed)](_0x3a43b7),_0x3a43b7=Math['min'](_0x3a43b7*1.5,0xea60);}}async[a0_0x417a73(0xfd)](){const _0x5183e5=a0_0x417a73;try{let _0x13c677=(await this[_0x5183e5(0xd9)]('get_inbox',{'alias':this[_0x5183e5(0x10a)],'limit':0xa}))?.['messages']||[];for(let _0x2ccbbb of _0x13c677)await this[_0x5183e5(0xd9)](_0x5183e5(0x121),{'alias':this[_0x5183e5(0x10a)],'message_id':_0x2ccbbb['id']}),this[_0x5183e5(0x110)]('←\x20'+_0x2ccbbb[_0x5183e5(0xfc)]+':\x20'+_0x2ccbbb[_0x5183e5(0xee)][_0x5183e5(0xd8)](0x0,0x3c)),this[_0x5183e5(0xe3)](_0x5183e5(0xdd),_0x2ccbbb),this['emit']('message',_0x2ccbbb);}catch(_0x5ba342){this[_0x5183e5(0x110)](_0x5183e5(0x11c)+_0x5ba342[_0x5183e5(0xe2)]);}}[a0_0x417a73(0xed)](_0x35220e){return new Promise(_0x2ac8ff=>setTimeout(_0x2ac8ff,_0x35220e));}}var $=T;export{$ as default,T as CommHub};
1
+ const a0_0x1f46d0=a0_0x1538;(function(_0x35379c,_0x5a414a){const _0x4b4509=a0_0x1538,_0xf5a1b0=_0x35379c();while(!![]){try{const _0x215cfa=-parseInt(_0x4b4509(0xf3))/0x1+parseInt(_0x4b4509(0x134))/0x2*(-parseInt(_0x4b4509(0x101))/0x3)+-parseInt(_0x4b4509(0x138))/0x4*(parseInt(_0x4b4509(0x144))/0x5)+-parseInt(_0x4b4509(0x122))/0x6+-parseInt(_0x4b4509(0xf7))/0x7+-parseInt(_0x4b4509(0x10c))/0x8*(-parseInt(_0x4b4509(0x137))/0x9)+parseInt(_0x4b4509(0x12c))/0xa*(parseInt(_0x4b4509(0xfd))/0xb);if(_0x215cfa===_0x5a414a)break;else _0xf5a1b0['push'](_0xf5a1b0['shift']());}catch(_0x20a79d){_0xf5a1b0['push'](_0xf5a1b0['shift']());}}}(a0_0x135f,0x3368f));import{EventEmitter as a0_0x254c47}from'events';import{hostname as a0_0x5475be}from'os';class T extends a0_0x254c47{[a0_0x1f46d0(0x133)];['alias'];['token'];[a0_0x1f46d0(0x11e)];[a0_0x1f46d0(0x111)];[a0_0x1f46d0(0x108)];[a0_0x1f46d0(0x119)];[a0_0x1f46d0(0x11d)];[a0_0x1f46d0(0x13b)];[a0_0x1f46d0(0xf8)]=!0x1;constructor(_0x1e26e1){const _0x24a3df=a0_0x1f46d0;super();if(this[_0x24a3df(0x133)]=_0x1e26e1[_0x24a3df(0x133)][_0x24a3df(0x13c)](/\/$/,''),this[_0x24a3df(0xf6)]=_0x1e26e1[_0x24a3df(0xf6)],this['token']=_0x1e26e1['token'],this[_0x24a3df(0x11e)]=_0x1e26e1[_0x24a3df(0x11e)]||'sdk',this[_0x24a3df(0x111)]=_0x24a3df(0x13e)+_0x1e26e1[_0x24a3df(0xf6)]+'-'+Date['now']()[_0x24a3df(0x145)](0x24),this[_0x24a3df(0x108)]=_0x1e26e1[_0x24a3df(0x108)]??0x2bf20,this[_0x24a3df(0x119)]=_0x1e26e1[_0x24a3df(0x119)]??0xbb8,_0x1e26e1[_0x24a3df(0x131)]!==!0x1)this[_0x24a3df(0xfb)]();}[a0_0x1f46d0(0x130)](_0x5200c9){const _0x43b4a5=a0_0x1f46d0;console[_0x43b4a5(0x130)]('['+new Date()[_0x43b4a5(0x118)]()[_0x43b4a5(0x11f)](0x0,0x8)+_0x43b4a5(0x104)+this[_0x43b4a5(0xf6)]+']\x20'+_0x5200c9);}async['call'](_0x58d3ea,_0x220eb6){const _0x2bedce=a0_0x1f46d0;let _0x33a76a={'Content-Type':_0x2bedce(0x127),'Accept':_0x2bedce(0x13a)};if(this[_0x2bedce(0x13f)])_0x33a76a[_0x2bedce(0x123)]='Bearer\x20'+this[_0x2bedce(0x13f)];let _0x2f6200=await(await fetch(this[_0x2bedce(0x133)]+_0x2bedce(0x110),{'method':_0x2bedce(0x114),'headers':_0x33a76a,'body':JSON[_0x2bedce(0x136)]({'jsonrpc':_0x2bedce(0x120),'id':Date['now'](),'method':'tools/call','params':{'name':_0x58d3ea,'arguments':_0x220eb6}})}))['text'](),_0x5779f4=_0x2f6200[_0x2bedce(0x12b)](/data: (.+)/),_0x38bb4d=_0x5779f4?JSON[_0x2bedce(0x12f)](_0x5779f4[0x1]):JSON[_0x2bedce(0x12f)](_0x2f6200),_0x3a3a27=_0x38bb4d?.[_0x2bedce(0x10f)]?.[_0x2bedce(0x103)]?.[0x0]?.['text'];return _0x3a3a27?JSON[_0x2bedce(0x12f)](_0x3a3a27):_0x38bb4d;}async[a0_0x1f46d0(0xfb)](){const _0x4cd0a2=a0_0x1f46d0;if(this[_0x4cd0a2(0xf8)])return;this[_0x4cd0a2(0xf8)]=!0x0,await this[_0x4cd0a2(0x135)](_0x4cd0a2(0x112)),this[_0x4cd0a2(0x130)]('registered'),this['heartbeatTimer']=setInterval(()=>{const _0x402a3d=_0x4cd0a2;this['status'](_0x402a3d(0x112))[_0x402a3d(0x126)](_0x19fe6e=>this[_0x402a3d(0x130)](_0x402a3d(0x11b)+_0x19fe6e[_0x402a3d(0x143)]));},this[_0x4cd0a2(0x108)]),this['connectSSE']();}async[a0_0x1f46d0(0x140)](){const _0x1618a1=a0_0x1f46d0;if(this[_0x1618a1(0xf8)]=!0x1,this['sseAbort']?.[_0x1618a1(0x139)](),this[_0x1618a1(0x11d)])clearInterval(this[_0x1618a1(0x11d)]);await this[_0x1618a1(0x135)](_0x1618a1(0x141))[_0x1618a1(0x126)](()=>{}),this[_0x1618a1(0x130)](_0x1618a1(0x107));}async[a0_0x1f46d0(0xf2)](_0x40ba32,_0x233e73,_0x47278a=a0_0x1f46d0(0xfe)){return this['call']('send_task',{'alias':_0x40ba32,'task':_0x233e73,'priority':_0x47278a,'from_session':this['alias']});}async[a0_0x1f46d0(0x143)](_0x12c845,_0x4e28dc){const _0x543892=a0_0x1f46d0;return this[_0x543892(0x125)](_0x543892(0x113),{'alias':_0x12c845,'message':_0x4e28dc,'from_session':this[_0x543892(0xf6)]});}async[a0_0x1f46d0(0x106)](_0x3055e6,_0x52a9af,_0x46d11c='completed'){const _0x40ffd3=a0_0x1f46d0;return this['call'](_0x40ffd3(0xf4),{'in_reply_to':_0x3055e6,'text':_0x52a9af,'status':_0x46d11c});}async[a0_0x1f46d0(0x135)](_0x246ece,_0x5494f7){const _0x1aebec=a0_0x1f46d0;return this['call'](_0x1aebec(0xfa),{'resume_id':this[_0x1aebec(0x111)],'alias':this[_0x1aebec(0xf6)],'status':_0x246ece,'server':a0_0x5475be(),'hostname':a0_0x5475be(),'agent':this['agent'],'project_dir':process['cwd'](),..._0x5494f7});}async[a0_0x1f46d0(0x100)](){const _0x26660b=a0_0x1f46d0;return this[_0x26660b(0x125)]('get_all_status',{});}async[a0_0x1f46d0(0x10b)](_0x682de2,_0x230fff){const _0x48f7af=a0_0x1f46d0;return this[_0x48f7af(0x125)]('broadcast',{'message':_0x682de2,'filter_server':_0x230fff?.[_0x48f7af(0x124)],'filter_status':_0x230fff?.[_0x48f7af(0x135)]});}async[a0_0x1f46d0(0xf9)](){const _0x36194e=a0_0x1f46d0;let _0x311ce3=encodeURIComponent(this[_0x36194e(0xf6)]),_0x1b13a0=this['url']+'/events/'+_0x311ce3,_0x3c026c=this[_0x36194e(0x119)];while(this[_0x36194e(0xf8)]){try{this[_0x36194e(0x13b)]=new AbortController();let _0x2f80c5={'Accept':_0x36194e(0x11c)};if(this['token'])_0x2f80c5['Authorization']=_0x36194e(0xf1)+this[_0x36194e(0x13f)];let _0x2d1e29=await fetch(_0x1b13a0,{'headers':_0x2f80c5,'signal':this[_0x36194e(0x13b)][_0x36194e(0x129)]});if(!_0x2d1e29['ok']||!_0x2d1e29[_0x36194e(0x105)]){this[_0x36194e(0x130)](_0x36194e(0x12e)+_0x2d1e29[_0x36194e(0x135)]),await this['sleep'](_0x3c026c),_0x3c026c=Math[_0x36194e(0xfc)](_0x3c026c*1.5,0xea60);continue;}_0x3c026c=this['reconnectDelay'];let _0x40058f=_0x2d1e29[_0x36194e(0x105)][_0x36194e(0x132)](),_0x390397=new TextDecoder(),_0x5e6c3e='';while(this[_0x36194e(0xf8)]){let {done:_0x45f810,value:_0x224c52}=await _0x40058f['read']();if(_0x45f810)break;_0x5e6c3e+=_0x390397[_0x36194e(0x109)](_0x224c52,{'stream':!0x0});let _0x4782a0=_0x5e6c3e['split']('\x0a');_0x5e6c3e=_0x4782a0['pop']()||'';for(let _0xbbca5f of _0x4782a0){if(!_0xbbca5f[_0x36194e(0x142)](_0x36194e(0x115)))continue;try{let _0x41266e=JSON[_0x36194e(0x12f)](_0xbbca5f[_0x36194e(0x11f)](0x6));if(_0x41266e[_0x36194e(0xff)]==='connected'){this[_0x36194e(0x130)]('SSE\x20connected'),this[_0x36194e(0x12a)](_0x36194e(0x117));continue;}if(_0x41266e[_0x36194e(0xff)]===_0x36194e(0x12d)||_0x41266e['type']===_0x36194e(0x121)||_0x41266e[_0x36194e(0xff)]===_0x36194e(0x10b))await this[_0x36194e(0x11a)]();}catch{}}}}catch(_0x26f4d4){if(_0x26f4d4[_0x36194e(0x10d)]===_0x36194e(0xf0))break;this[_0x36194e(0x12a)]('error',_0x26f4d4),this[_0x36194e(0x130)](_0x36194e(0x116)+_0x26f4d4[_0x36194e(0x143)]);}if(this['running'])this[_0x36194e(0x12a)](_0x36194e(0x107)),this['log']('SSE\x20reconnecting\x20in\x20'+_0x3c026c/0x3e8+_0x36194e(0x13d)),await this['sleep'](_0x3c026c),_0x3c026c=Math[_0x36194e(0xfc)](_0x3c026c*1.5,0xea60);}}async[a0_0x1f46d0(0x11a)](){const _0xc40fc5=a0_0x1f46d0;try{let _0x2095fe=(await this[_0xc40fc5(0x125)]('get_inbox',{'alias':this[_0xc40fc5(0xf6)],'limit':0xa}))?.[_0xc40fc5(0x102)]||[];for(let _0x495699 of _0x2095fe)await this[_0xc40fc5(0x125)](_0xc40fc5(0x10a),{'alias':this['alias'],'message_id':_0x495699['id']}),this[_0xc40fc5(0x130)]('←\x20'+_0x495699[_0xc40fc5(0x10e)]+':\x20'+_0x495699['content'][_0xc40fc5(0x11f)](0x0,0x3c)),this[_0xc40fc5(0x12a)](_0xc40fc5(0xf5),_0x495699),this[_0xc40fc5(0x12a)]('message',_0x495699);}catch(_0x13a6be){this[_0xc40fc5(0x130)](_0xc40fc5(0x128)+_0x13a6be[_0xc40fc5(0x143)]);}}['sleep'](_0x152c66){return new Promise(_0xc28ba4=>setTimeout(_0xc28ba4,_0x152c66));}}var $=T;function a0_0x1538(_0x5bf864,_0x3d20ca){_0x5bf864=_0x5bf864-0xf0;const _0x135fe5=a0_0x135f();let _0x153851=_0x135fe5[_0x5bf864];return _0x153851;}function a0_0x135f(){const _0x388e8e=['2jpPQoi','status','stringify','117MnQBlp','908paXsAF','abort','application/json,\x20text/event-stream','sseAbort','replace','s...','sdk-','token','disconnect','offline','startsWith','message','1805aAwrSV','toString','AbortError','Bearer\x20','send','405116GChScx','send_reply','task','alias','2859997mQAarp','running','connectSSE','report_status','connect','min','11OXWZsT','normal','type','getAllStatus','675399oUZmCW','messages','content',']\x20[commhub:','body','reply','disconnected','heartbeatInterval','decode','ack_inbox','broadcast','180520WsqywZ','name','from_session','result','/mcp','resumeId','idle','send_message','POST','data:\x20','SSE\x20error:\x20','connected','toTimeString','reconnectDelay','processInbox','heartbeat\x20failed:\x20','text/event-stream','heartbeatTimer','agent','slice','2.0','new_message','1843326zGdFkp','Authorization','server','call','catch','application/json','inbox\x20error:\x20','signal','emit','match','13452180NFQWjy','new_task','SSE\x20failed:\x20','parse','log','autoConnect','getReader','url'];a0_0x135f=function(){return _0x388e8e;};return a0_0x135f();}export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x334e5a=a0_0x17ab;(function(_0x3742f8,_0x2b7df5){const _0x59b2e5=a0_0x17ab,_0x557dbc=_0x3742f8();while(!![]){try{const _0x1e9c44=parseInt(_0x59b2e5(0x17f))/0x1*(-parseInt(_0x59b2e5(0x1c7))/0x2)+parseInt(_0x59b2e5(0x169))/0x3+parseInt(_0x59b2e5(0x1cc))/0x4+-parseInt(_0x59b2e5(0x1d7))/0x5+-parseInt(_0x59b2e5(0x1ad))/0x6*(-parseInt(_0x59b2e5(0x1dd))/0x7)+parseInt(_0x59b2e5(0x193))/0x8*(parseInt(_0x59b2e5(0x1cd))/0x9)+parseInt(_0x59b2e5(0x1d4))/0xa*(-parseInt(_0x59b2e5(0x192))/0xb);if(_0x1e9c44===_0x2b7df5)break;else _0x557dbc['push'](_0x557dbc['shift']());}catch(_0x659563){_0x557dbc['push'](_0x557dbc['shift']());}}}(a0_0x59f8,0xb9855));import{readFileSync as a0_0x142533,existsSync as a0_0x2c131b}from'fs';import{randomUUID as a0_0x26c0bb}from'crypto';import{join as a0_0x109bdc}from'path';import{hostname as a0_0x370ff1}from'os';import{execSync as a0_0x34928d}from'child_process';import{Server as a0_0x4e07bb}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x8bed26}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x5c3967,CallToolRequestSchema as a0_0x24829c}from'@modelcontextprotocol/sdk/types.js';function p(_0x17ca4e){const _0x5156d9=a0_0x17ab;if(!a0_0x2c131b(_0x17ca4e))return;for(let _0x1e16cb of a0_0x142533(_0x17ca4e,_0x5156d9(0x1cb))[_0x5156d9(0x167)]('\x0a')){let _0xbbc5df=_0x1e16cb[_0x5156d9(0x178)]();if(!_0xbbc5df||_0xbbc5df['startsWith']('#'))continue;let _0x562e84=_0xbbc5df[_0x5156d9(0x1b2)]('=');if(_0x562e84<0x0)continue;let _0x1b95df=_0xbbc5df['slice'](0x0,_0x562e84)[_0x5156d9(0x178)](),_0x4782b0=_0xbbc5df[_0x5156d9(0x1e5)](_0x562e84+0x1)['trim']()[_0x5156d9(0x19f)](/^["']|["']$/g,'');if(!process.env[_0x1b95df])process.env[_0x1b95df]=_0x4782b0;}}var C=process.env.HOME||'~',T=a0_0x109bdc(C,a0_0x334e5a(0x15e));p(a0_0x109bdc(T,a0_0x334e5a(0x1c3)));var L=process[a0_0x334e5a(0x1b8)]()[a0_0x334e5a(0x19f)](/\//g,'-');function a0_0x17ab(_0x51ab6b,_0x5eb41f){_0x51ab6b=_0x51ab6b-0x158;const _0x59f835=a0_0x59f8();let _0x17ab8e=_0x59f835[_0x51ab6b];return _0x17ab8e;}p(a0_0x109bdc(T,L,'.env'));function U(){const _0x4a891a=a0_0x334e5a;try{return a0_0x34928d(_0x4a891a(0x172),{'encoding':_0x4a891a(0x1cb),'timeout':0x7d0})[_0x4a891a(0x178)]();}catch{return'';}}function v(){const _0x20914e=a0_0x334e5a;try{let _0x2ab8a0=a0_0x109bdc(C,_0x20914e(0x1d3),_0x20914e(0x19c));if(a0_0x2c131b(_0x2ab8a0))return JSON['parse'](a0_0x142533(_0x2ab8a0,'utf-8'));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x334e5a(0x16f)]||a0_0x334e5a(0x1d2),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x370ff1(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x26c0bb(),X=process.env.COMMHUB_TOKEN||H[a0_0x334e5a(0x168)]||'';function Y(_0x30d588){const _0x5b9a70=a0_0x334e5a;let _0x124c2d=new Date()[_0x5b9a70(0x1ca)]()['slice'](0x0,0x8);process[_0x5b9a70(0x19b)][_0x5b9a70(0x1c4)]('['+_0x124c2d+_0x5b9a70(0x16c)+_0x30d588+'\x0a');}function h(_0x2dfacd){return new Promise(_0x117f1b=>setTimeout(_0x117f1b,_0x2dfacd));}Y(a0_0x334e5a(0x17d)+f+a0_0x334e5a(0x162)+Z+a0_0x334e5a(0x196)+w['slice'](0x0,0x8)+a0_0x334e5a(0x158)+(j||'none')+a0_0x334e5a(0x184)+process['cwd']()+a0_0x334e5a(0x19a)+L);var k=new Map(),K=new a0_0x4e07bb({'name':a0_0x334e5a(0x15a),'version':a0_0x334e5a(0x1e0)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x334e5a(0x1d9),a0_0x334e5a(0x1dc),a0_0x334e5a(0x1da),a0_0x334e5a(0x1a3),'Session\x20alias:\x20'+Z][a0_0x334e5a(0x190)]('\x0a')});K[a0_0x334e5a(0x1bd)](a0_0x5c3967,async()=>({'tools':[{'name':'commhub_reply','description':a0_0x334e5a(0x181),'inputSchema':{'type':a0_0x334e5a(0x1e7),'properties':{'task_id':{'type':a0_0x334e5a(0x1bc),'description':a0_0x334e5a(0x1c2)},'text':{'type':a0_0x334e5a(0x1bc),'description':a0_0x334e5a(0x1b3)},'status':{'type':a0_0x334e5a(0x1bc),'enum':['completed','failed',a0_0x334e5a(0x185),a0_0x334e5a(0x16b),a0_0x334e5a(0x1c1),'in_progress'],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':[a0_0x334e5a(0x1ba)]}},{'name':a0_0x334e5a(0x1ae),'description':a0_0x334e5a(0x1a4),'inputSchema':{'type':'object','properties':{'status':{'type':'string','enum':[a0_0x334e5a(0x1c9),a0_0x334e5a(0x1c6),a0_0x334e5a(0x16b),'error']},'task':{'type':a0_0x334e5a(0x1bc),'description':'Current\x20task\x20description'},'progress':{'type':a0_0x334e5a(0x182),'description':a0_0x334e5a(0x170)}},'required':[a0_0x334e5a(0x161)]}},{'name':a0_0x334e5a(0x165),'description':'Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','inputSchema':{'type':'object','properties':{'alias':{'type':'string','description':a0_0x334e5a(0x1b9)},'task':{'type':a0_0x334e5a(0x1bc),'description':a0_0x334e5a(0x1a8)},'priority':{'type':'string','enum':[a0_0x334e5a(0x166),a0_0x334e5a(0x198),a0_0x334e5a(0x1b1)],'description':'Priority\x20(default:\x20normal)'}},'required':['alias','task']}},{'name':a0_0x334e5a(0x18a),'description':a0_0x334e5a(0x1e1),'inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x334e5a(0x1bc),'description':a0_0x334e5a(0x1b9)},'message':{'type':a0_0x334e5a(0x1bc),'description':'Message\x20content'}},'required':[a0_0x334e5a(0x1ce),a0_0x334e5a(0x1b0)]}},{'name':a0_0x334e5a(0x18c),'description':a0_0x334e5a(0x177),'inputSchema':{'type':a0_0x334e5a(0x1e7),'properties':{}}}]}));async function P(_0x54cd37,_0x5d1f65){const _0x6bbc52=a0_0x334e5a;let _0x4da96a=await fetch(f+_0x6bbc52(0x19d),{'method':_0x6bbc52(0x163),'headers':{'Content-Type':'application/json','Accept':_0x6bbc52(0x1a7),...X?{'Authorization':_0x6bbc52(0x164)+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x6bbc52(0x159),'id':0x1,'method':'initialize','params':{'protocolVersion':_0x6bbc52(0x171),'capabilities':{},'clientInfo':{'name':_0x6bbc52(0x15a),'version':_0x6bbc52(0x1e0)}}})});if(!_0x4da96a['ok']){let _0x4375f8=await _0x4da96a['text']();return Y('CommHub\x20init\x20failed:\x20'+_0x4da96a[_0x6bbc52(0x161)]+'\x20'+_0x4375f8['slice'](0x0,0x64)),{'ok':!0x1,'error':_0x6bbc52(0x16e)+_0x4da96a[_0x6bbc52(0x161)]};}await _0x4da96a['text']();let _0x44f027=(await(await fetch(f+'/mcp',{'method':_0x6bbc52(0x163),'headers':{'Content-Type':_0x6bbc52(0x1e4),'Accept':_0x6bbc52(0x1a7),...X?{'Authorization':_0x6bbc52(0x164)+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x6bbc52(0x159),'id':0x2,'method':_0x6bbc52(0x175),'params':{'name':_0x54cd37,'arguments':_0x5d1f65}})}))['text']())[_0x6bbc52(0x167)]('\x0a')[_0x6bbc52(0x1d1)](_0x247601=>_0x247601[_0x6bbc52(0x1b5)](_0x6bbc52(0x183)));if(_0x44f027){let _0x240e95=JSON[_0x6bbc52(0x1d8)](_0x44f027[_0x6bbc52(0x1e5)](0x6));return _0x240e95?.['result']?.['content']?.[0x0]?.[_0x6bbc52(0x1ba)]?JSON['parse'](_0x240e95[_0x6bbc52(0x1bf)][_0x6bbc52(0x19e)][0x0][_0x6bbc52(0x1ba)]):_0x240e95;}return{'ok':!0x1,'error':_0x6bbc52(0x1de)};}K[a0_0x334e5a(0x1bd)](a0_0x24829c,async _0x2c9d3e=>{const _0x530bb9=a0_0x334e5a;let {name:_0x26f043,arguments:_0x3b7a49}=_0x2c9d3e[_0x530bb9(0x188)];if(_0x26f043==='commhub_reply'){let {task_id:_0x147aa8,text:_0x5380e5,status:_0x2abc83}=_0x3b7a49;if(_0x2abc83===_0x530bb9(0x17c)||_0x2abc83===_0x530bb9(0x17a)||_0x2abc83===_0x530bb9(0x185)){let _0xae5d41=_0x2abc83===_0x530bb9(0x17c)?_0x530bb9(0x1df):_0x2abc83,_0x1ee864=_0x147aa8?k[_0x530bb9(0x1cf)](_0x147aa8)||_0x530bb9(0x16f):_0x530bb9(0x16f),_0x546105=await P(_0x530bb9(0x1ac),{'alias':_0x1ee864,'text':_0x5380e5,'in_reply_to':_0x147aa8||void 0x0,'status':_0xae5d41,'from_session':Z});if(_0x147aa8)k[_0x530bb9(0x173)](_0x147aa8);return{'content':[{'type':_0x530bb9(0x1ba),'text':JSON[_0x530bb9(0x1db)](_0x546105)}]};}let _0x5958a9=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x2abc83===_0x530bb9(0x16b)?_0x530bb9(0x16b):_0x2abc83===_0x530bb9(0x1c1)?_0x530bb9(0x1c1):_0x530bb9(0x1c9),'task':_0x5380e5['slice'](0x0,0xc8),'output':_0x5380e5});return{'content':[{'type':_0x530bb9(0x1ba),'text':JSON['stringify'](_0x5958a9)}]};}if(_0x26f043===_0x530bb9(0x1ae)){let {status:_0x1415ed,task:_0x4f67ae,progress:_0x29313a}=_0x3b7a49,_0x3cb716=await P(_0x530bb9(0x15f),{'resume_id':w,'alias':Z,'status':_0x1415ed,'task':_0x4f67ae,'progress':_0x29313a});return{'content':[{'type':_0x530bb9(0x1ba),'text':JSON[_0x530bb9(0x1db)](_0x3cb716)}]};}if(_0x26f043===_0x530bb9(0x165)){let {alias:_0x1362e6,task:_0x47cae3,priority:_0x14dfb9}=_0x3b7a49,_0x5c54b2=await P('send_task',{'alias':_0x1362e6,'task':_0x47cae3,'priority':_0x14dfb9||_0x530bb9(0x198),'from_session':Z});return{'content':[{'type':_0x530bb9(0x1ba),'text':JSON[_0x530bb9(0x1db)](_0x5c54b2)}]};}if(_0x26f043===_0x530bb9(0x18a)){let {alias:_0x25ea8a,message:_0x4524d0}=_0x3b7a49,_0xb94234=await P(_0x530bb9(0x1d0),{'alias':_0x25ea8a,'message':_0x4524d0,'from_session':Z});return{'content':[{'type':_0x530bb9(0x1ba),'text':JSON[_0x530bb9(0x1db)](_0xb94234)}]};}if(_0x26f043===_0x530bb9(0x18c)){let _0x4d2839=await P('get_all_status',{});return{'content':[{'type':_0x530bb9(0x1ba),'text':JSON[_0x530bb9(0x1db)](_0x4d2839)}]};}return{'content':[{'type':'text','text':JSON[_0x530bb9(0x1db)]({'error':_0x530bb9(0x18e)})}]};});async function u(){const _0x23dbf7=a0_0x334e5a;let _0x135987=f+_0x23dbf7(0x176)+encodeURIComponent(Z),_0x5549e9={};if(X)_0x5549e9['Authorization']=_0x23dbf7(0x164)+X;Y(_0x23dbf7(0x1a0)+_0x135987);while(!0x0){try{let _0x44aff6=await fetch(_0x135987,{'headers':_0x5549e9});if(!_0x44aff6['ok']){Y('SSE\x20error:\x20'+_0x44aff6['status']+'\x20'+_0x44aff6['statusText']),await h(0x1388);continue;}let _0x151896=_0x44aff6[_0x23dbf7(0x195)][_0x23dbf7(0x180)](),_0x40c640=new TextDecoder(),_0x14d3c5='';while(!0x0){let {done:_0x210796,value:_0x4fcb9e}=await _0x151896[_0x23dbf7(0x1a9)]();if(_0x210796)break;_0x14d3c5+=_0x40c640[_0x23dbf7(0x199)](_0x4fcb9e,{'stream':!0x0});let _0x4e5f81=_0x14d3c5[_0x23dbf7(0x167)]('\x0a\x0a');_0x14d3c5=_0x4e5f81['pop']()||'';for(let _0x3c112e of _0x4e5f81){let _0x16622e=_0x3c112e[_0x23dbf7(0x167)]('\x0a')['find'](_0x215bae=>_0x215bae[_0x23dbf7(0x1b5)](_0x23dbf7(0x183)));if(!_0x16622e)continue;try{let _0x28a54d=JSON[_0x23dbf7(0x1d8)](_0x16622e['slice'](0x6));await S(_0x28a54d);}catch(_0x4b6da0){Y(_0x23dbf7(0x186)+_0x4b6da0);}}}Y('SSE\x20stream\x20ended,\x20reconnecting...');}catch(_0x159c46){Y(_0x23dbf7(0x17e)+_0x159c46);}await h(0xbb8);}}async function S(_0x22002a){const _0xc16c91=a0_0x334e5a;if(_0x22002a[_0xc16c91(0x15c)]===_0xc16c91(0x1e6)){Y(_0xc16c91(0x1d6)+Z+'\x22');return;}if(_0x22002a['type']===_0xc16c91(0x1b7)){if(Y(_0xc16c91(0x191)+_0x22002a['from']+':\x20'+_0x22002a[_0xc16c91(0x1b0)][_0xc16c91(0x1e5)](0x0,0x3c)),await K[_0xc16c91(0x1e8)]({'method':_0xc16c91(0x1e3),'params':{'content':_0x22002a['message'],'meta':{'sender':_0x22002a[_0xc16c91(0x16d)]||_0xc16c91(0x16f),'sender_id':_0xc16c91(0x194),'user':_0x22002a[_0xc16c91(0x16d)]||_0xc16c91(0x16f),'priority':_0xc16c91(0x198)}}}),_0x22002a[_0xc16c91(0x1af)])await P(_0xc16c91(0x1b6),{'alias':Z,'message_id':_0x22002a['message_id']});return;}if(_0x22002a['type']===_0xc16c91(0x18f)||_0x22002a['type']===_0xc16c91(0x16a)){Y('←\x20'+_0x22002a['type']+_0xc16c91(0x1b4)+_0x22002a[_0xc16c91(0x18d)]+_0xc16c91(0x15d)+(_0x22002a['priority']||'normal'));let _0x513cab=await P(_0xc16c91(0x1d5),{'alias':Z,'limit':0x5});if(_0x513cab?.['ok']&&_0x513cab[_0xc16c91(0x179)]?.[_0xc16c91(0x17b)]>0x0)for(let _0x494d32 of _0x513cab[_0xc16c91(0x179)]){let _0x1be4c3={'sender':_0x494d32[_0xc16c91(0x1a2)]||_0xc16c91(0x16f),'sender_id':_0xc16c91(0x194),'user':_0x494d32[_0xc16c91(0x1a2)]||_0xc16c91(0x16f),'task_id':_0x494d32['id'],'priority':_0x494d32[_0xc16c91(0x1a6)]||_0xc16c91(0x198)};k[_0xc16c91(0x1a5)](_0x494d32['id'],_0x494d32[_0xc16c91(0x1a2)]||_0xc16c91(0x16f)),await K[_0xc16c91(0x1e8)]({'method':_0xc16c91(0x1e3),'params':{'content':_0x494d32['content'],'meta':_0x1be4c3}}),Y(_0xc16c91(0x1aa)+_0x494d32['id'][_0xc16c91(0x1e5)](0x0,0x8)+_0xc16c91(0x187)+_0x494d32[_0xc16c91(0x1a2)]+':\x20'+_0x494d32[_0xc16c91(0x19e)][_0xc16c91(0x1e5)](0x0,0x3c)),await P(_0xc16c91(0x1b6),{'alias':Z,'message_id':_0x494d32['id']});}}}async function A(){const _0x55af32=a0_0x334e5a;let _0x5b1bf7=new a0_0x8bed26();await K[_0x55af32(0x1bb)](_0x5b1bf7),Y('MCP\x20stdio\x20connected'),Y(_0x55af32(0x1c8)),u()[_0x55af32(0x189)](_0x25adfc=>Y(_0x55af32(0x1c0)+_0x25adfc)),P(_0x55af32(0x15f),{'resume_id':w,'alias':Z,'status':_0x55af32(0x1c6),'server':a0_0x370ff1(),'hostname':a0_0x370ff1(),'agent':'claude-code','project_dir':process[_0x55af32(0x1b8)](),'tmux_name':j||void 0x0})[_0x55af32(0x1e2)](()=>Y(_0x55af32(0x197)+Z+'\x22\x20('+w[_0x55af32(0x1e5)](0x0,0x8)+')'))[_0x55af32(0x189)](_0x469595=>Y(_0x55af32(0x1ab)+_0x469595)),setInterval(()=>{const _0x2f2872=_0x55af32;P(_0x2f2872(0x15f),{'resume_id':w,'alias':Z,'status':_0x2f2872(0x1c6),'server':a0_0x370ff1(),'hostname':a0_0x370ff1(),'agent':_0x2f2872(0x15b),'project_dir':process[_0x2f2872(0x1b8)](),'tmux_name':j||void 0x0})[_0x2f2872(0x189)](_0x1d4908=>Y(_0x2f2872(0x1be)+_0x1d4908));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}A()[a0_0x334e5a(0x189)](_0x1097d3=>{const _0xbbf1e9=a0_0x334e5a;Y('fatal:\x20'+_0x1097d3),process[_0xbbf1e9(0x174)](0x1);});async function N(){const _0x2d0f0b=a0_0x334e5a;Y('shutting\x20down,\x20reporting\x20offline...'),await P('report_status',{'resume_id':w,'alias':Z,'status':'error','task':_0x2d0f0b(0x1c5)})[_0x2d0f0b(0x189)](()=>{}),process[_0x2d0f0b(0x174)](0x0);}function a0_0x59f8(){const _0xcab314=['text','connect','string','setRequestHandler','heartbeat\x20failed:\x20','result','SSE\x20fatal:\x20','error','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','.env','write','session\x20disconnected','idle','178138JeszEM','starting\x20SSE\x20listener...','working','toTimeString','utf-8','4576480owurRj','252QRdFfY','alias','get','send_message','find','http://127.0.0.1:9200','.anet','1227310vNxpYZ','get_inbox','SSE\x20connected\x20as\x20\x22','563595MaWEBw','parse','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','stringify','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','280csKIoY','no\x20response','replied','0.3.0','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','then','notifications/claude/channel','application/json','slice','connected','object','notification','...\x20TMUX=','2.0','commhub-channel','claude-code','type','\x20priority=','.claude/channels/commhub','report_status','stdin','status','\x20ALIAS=','POST','Bearer\x20','commhub_send_task','high','split','token','957573kbRAdr','broadcast','blocked',']\x20[commhub]\x20','from','init\x20failed:\x20','hub','Progress\x200-100','2025-03-26','tmux\x20display-message\x20-p\x20\x27#S\x27','delete','exit','tools/call','/events/','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','trim','messages','failed','length','completed','ENV:\x20URL=','SSE\x20connection\x20error:\x20','14XfFLxz','getReader','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','number','data:\x20','\x20CWD=','cancelled','parse\x20error:\x20','\x20from\x20','params','catch','commhub_send_message','SIGTERM','commhub_get_all_status','inbox_count','unknown\x20tool','new_task','join','←\x20message\x20from\x20','121ZRgjLv','278888ysIcJk','commhub','body','\x20RESUME_ID=','registered\x20as\x20\x22','normal','decode','\x20PROJECT_ENV=','stderr','config.json','/mcp','content','replace','connecting\x20to\x20','end','from_session','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','set','priority','application/json,\x20text/event-stream','Task\x20content','read','→\x20injected\x20task\x20','warning:\x20could\x20not\x20register:\x20','send_reply','154530nDUwAA','commhub_report_status','message_id','message','low','indexOf','Reply\x20text\x20/\x20result\x20summary',':\x20inbox_count=','startsWith','ack_inbox','new_message','cwd','Target\x20session\x20alias'];a0_0x59f8=function(){return _0xcab314;};return a0_0x59f8();}process[a0_0x334e5a(0x160)]['on'](a0_0x334e5a(0x1a1),()=>N()),process['on'](a0_0x334e5a(0x18b),()=>N()),process['on']('SIGINT',()=>N());
2
+ const a0_0x4f01e3=a0_0x1620;(function(_0x5340b5,_0x3ab777){const _0x3b1a0f=a0_0x1620,_0x3bc1b2=_0x5340b5();while(!![]){try{const _0x989d91=parseInt(_0x3b1a0f(0x227))/0x1*(-parseInt(_0x3b1a0f(0x19d))/0x2)+-parseInt(_0x3b1a0f(0x1ac))/0x3+parseInt(_0x3b1a0f(0x217))/0x4*(parseInt(_0x3b1a0f(0x1b8))/0x5)+parseInt(_0x3b1a0f(0x1f7))/0x6*(-parseInt(_0x3b1a0f(0x1e9))/0x7)+-parseInt(_0x3b1a0f(0x1fd))/0x8*(-parseInt(_0x3b1a0f(0x1e2))/0x9)+-parseInt(_0x3b1a0f(0x1b7))/0xa*(-parseInt(_0x3b1a0f(0x1d7))/0xb)+-parseInt(_0x3b1a0f(0x22c))/0xc*(parseInt(_0x3b1a0f(0x1ca))/0xd);if(_0x989d91===_0x3ab777)break;else _0x3bc1b2['push'](_0x3bc1b2['shift']());}catch(_0x481782){_0x3bc1b2['push'](_0x3bc1b2['shift']());}}}(a0_0x54f5,0x41d01));import{readFileSync as a0_0x4d2ed0,existsSync as a0_0x1c88a1}from'fs';import{randomUUID as a0_0xd7d290}from'crypto';import{join as a0_0x120042}from'path';import{hostname as a0_0x41ff07}from'os';import{execSync as a0_0x560cce}from'child_process';function a0_0x1620(_0x5a20fb,_0x532109){_0x5a20fb=_0x5a20fb-0x198;const _0x54f5a4=a0_0x54f5();let _0x16204a=_0x54f5a4[_0x5a20fb];return _0x16204a;}import{Server as a0_0xdbb2a8}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x597807}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x4afe06,CallToolRequestSchema as a0_0x23d09e}from'@modelcontextprotocol/sdk/types.js';function p(_0x14ea91){const _0x372487=a0_0x1620;if(!a0_0x1c88a1(_0x14ea91))return;for(let _0x2cbff7 of a0_0x4d2ed0(_0x14ea91,_0x372487(0x1c1))[_0x372487(0x1e4)]('\x0a')){let _0x53c71d=_0x2cbff7[_0x372487(0x1e0)]();if(!_0x53c71d||_0x53c71d[_0x372487(0x20b)]('#'))continue;let _0x5e1d54=_0x53c71d[_0x372487(0x1fb)]('=');if(_0x5e1d54<0x0)continue;let _0x393f4b=_0x53c71d['slice'](0x0,_0x5e1d54)[_0x372487(0x1e0)](),_0x6c1dd0=_0x53c71d[_0x372487(0x215)](_0x5e1d54+0x1)[_0x372487(0x1e0)]()[_0x372487(0x201)](/^["']|["']$/g,'');if(!process.env[_0x393f4b])process.env[_0x393f4b]=_0x6c1dd0;}}var C=process.env.HOME||'~',T=a0_0x120042(C,'.claude/channels/commhub');p(a0_0x120042(T,a0_0x4f01e3(0x1e3)));var L=process[a0_0x4f01e3(0x229)]()[a0_0x4f01e3(0x201)](/\//g,'-');p(a0_0x120042(T,L,'.env'));function U(){const _0x5d66c8=a0_0x4f01e3;try{return a0_0x560cce(_0x5d66c8(0x1f2),{'encoding':'utf-8','timeout':0x7d0})[_0x5d66c8(0x1e0)]();}catch{return'';}}function a0_0x54f5(){const _0x16589f=['Session\x20alias:\x20','.anet','http://127.0.0.1:9200','result','alias','0.3.0','38ATksKR','stdin','cwd','2025-03-26','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','168LpmckF','from','ack_inbox','Task\x20content','error','exit','connected','find','16696tqytUR','\x20CWD=','message_id','blocked','length','cancelled','new_task','connect','no\x20response','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.',':\x20inbox_count=','get','read','Bearer\x20','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','257436tdvRvZ','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','heartbeat\x20failed:\x20','decode','completed','new_message','normal','toTimeString','initialize','then','high','4835010enufIg','498545rZurei','tools/call','inbox_count','task','unknown\x20tool','getReader','commhub-channel','fatal:\x20','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','utf-8','\x20RESUME_ID=','shutting\x20down,\x20reporting\x20offline...','from_session','stderr','body','Progress\x200-100','Target\x20session\x20alias','catch','191074xQQMhM','join','Reply\x20text\x20/\x20result\x20summary','commhub_send_task','data:\x20','working','report_status','parse','stringify','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','2.0','status','idle','11ngWUJw','SIGTERM','get_all_status','content','commhub_report_status','object','application/json,\x20text/event-stream','write','replied','trim','SSE\x20connection\x20error:\x20','1753425zJMFUN','.env','split','init\x20failed:\x20','SSE\x20stream\x20ended,\x20reconnecting...','parse\x20error:\x20','Message\x20content','329HqqRHg','POST','setRequestHandler','text','/events/',']\x20[commhub]\x20','/mcp','Current\x20task\x20description','connecting\x20to\x20','tmux\x20display-message\x20-p\x20\x27#S\x27','priority','Priority\x20(default:\x20normal)','commhub_get_all_status','→\x20injected\x20task\x20','12648LzeXtG','notifications/claude/channel','SIGINT','type','indexOf','MCP\x20stdio\x20connected','8DCHPoY','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','none','\x22\x20(','replace','pop','params','low','\x20PROJECT_ENV=','messages','SSE\x20error:\x20','starting\x20SSE\x20listener...','failed','statusText','startsWith','string','SSE\x20connected\x20as\x20\x22','commhub_reply','\x20priority=','application/json','commhub_send_message','commhub','config.json','send_message','slice','notification','12FVlPSU','hub','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','in_progress','message','CommHub\x20init\x20failed:\x20','claude-code','←\x20message\x20from\x20','broadcast','number'];a0_0x54f5=function(){return _0x16589f;};return a0_0x54f5();}function v(){const _0x5d1637=a0_0x4f01e3;try{let _0x587f3f=a0_0x120042(C,_0x5d1637(0x222),_0x5d1637(0x213));if(a0_0x1c88a1(_0x587f3f))return JSON[_0x5d1637(0x1d1)](a0_0x4d2ed0(_0x587f3f,_0x5d1637(0x1c1)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H['hub']||a0_0x4f01e3(0x223),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x41ff07(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0xd7d290(),X=process.env.COMMHUB_TOKEN||H['token']||'';function Y(_0x1f509e){const _0x16ec2f=a0_0x4f01e3;let _0x489938=new Date()[_0x16ec2f(0x1b3)]()[_0x16ec2f(0x215)](0x0,0x8);process[_0x16ec2f(0x1c5)][_0x16ec2f(0x1de)]('['+_0x489938+_0x16ec2f(0x1ee)+_0x1f509e+'\x0a');}function h(_0x3a3fc6){return new Promise(_0x172f2=>setTimeout(_0x172f2,_0x3a3fc6));}Y('ENV:\x20URL='+f+'\x20ALIAS='+Z+a0_0x4f01e3(0x1c2)+w['slice'](0x0,0x8)+'...\x20TMUX='+(j||a0_0x4f01e3(0x1ff))+a0_0x4f01e3(0x19e)+process[a0_0x4f01e3(0x229)]()+a0_0x4f01e3(0x205)+L);var k=new Map(),K=new a0_0xdbb2a8({'name':a0_0x4f01e3(0x1be),'version':a0_0x4f01e3(0x226)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x4f01e3(0x1ab),a0_0x4f01e3(0x1d3),a0_0x4f01e3(0x219),a0_0x4f01e3(0x22b),a0_0x4f01e3(0x221)+Z][a0_0x4f01e3(0x1cb)]('\x0a')});K[a0_0x4f01e3(0x1eb)](a0_0x4afe06,async()=>({'tools':[{'name':a0_0x4f01e3(0x20e),'description':'Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','inputSchema':{'type':a0_0x4f01e3(0x1dc),'properties':{'task_id':{'type':a0_0x4f01e3(0x20c),'description':a0_0x4f01e3(0x1c0)},'text':{'type':a0_0x4f01e3(0x20c),'description':a0_0x4f01e3(0x1cc)},'status':{'type':a0_0x4f01e3(0x20c),'enum':[a0_0x4f01e3(0x1b0),a0_0x4f01e3(0x209),a0_0x4f01e3(0x1a2),a0_0x4f01e3(0x1a0),a0_0x4f01e3(0x199),a0_0x4f01e3(0x21a)],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':[a0_0x4f01e3(0x1ec)]}},{'name':a0_0x4f01e3(0x1db),'description':a0_0x4f01e3(0x1a6),'inputSchema':{'type':a0_0x4f01e3(0x1dc),'properties':{'status':{'type':a0_0x4f01e3(0x20c),'enum':['working','idle',a0_0x4f01e3(0x1a0),a0_0x4f01e3(0x199)]},'task':{'type':a0_0x4f01e3(0x20c),'description':a0_0x4f01e3(0x1f0)},'progress':{'type':a0_0x4f01e3(0x220),'description':a0_0x4f01e3(0x1c7)}},'required':[a0_0x4f01e3(0x1d5)]}},{'name':a0_0x4f01e3(0x1cd),'description':'Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','inputSchema':{'type':a0_0x4f01e3(0x1dc),'properties':{'alias':{'type':a0_0x4f01e3(0x20c),'description':a0_0x4f01e3(0x1c8)},'task':{'type':a0_0x4f01e3(0x20c),'description':a0_0x4f01e3(0x198)},'priority':{'type':a0_0x4f01e3(0x20c),'enum':[a0_0x4f01e3(0x1b6),a0_0x4f01e3(0x1b2),a0_0x4f01e3(0x204)],'description':a0_0x4f01e3(0x1f4)}},'required':[a0_0x4f01e3(0x225),a0_0x4f01e3(0x1bb)]}},{'name':a0_0x4f01e3(0x211),'description':a0_0x4f01e3(0x1fe),'inputSchema':{'type':a0_0x4f01e3(0x1dc),'properties':{'alias':{'type':a0_0x4f01e3(0x20c),'description':'Target\x20session\x20alias'},'message':{'type':a0_0x4f01e3(0x20c),'description':a0_0x4f01e3(0x1e8)}},'required':[a0_0x4f01e3(0x225),'message']}},{'name':a0_0x4f01e3(0x1f5),'description':a0_0x4f01e3(0x1ad),'inputSchema':{'type':a0_0x4f01e3(0x1dc),'properties':{}}}]}));async function P(_0xb93545,_0x101ab1){const _0x8e2e8c=a0_0x4f01e3;let _0x4ebcb3=await fetch(f+_0x8e2e8c(0x1ef),{'method':'POST','headers':{'Content-Type':_0x8e2e8c(0x210),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x8e2e8c(0x1aa)+X}:{}},'body':JSON[_0x8e2e8c(0x1d2)]({'jsonrpc':_0x8e2e8c(0x1d4),'id':0x1,'method':_0x8e2e8c(0x1b4),'params':{'protocolVersion':_0x8e2e8c(0x22a),'capabilities':{},'clientInfo':{'name':_0x8e2e8c(0x1be),'version':_0x8e2e8c(0x226)}}})});if(!_0x4ebcb3['ok']){let _0x1b9992=await _0x4ebcb3[_0x8e2e8c(0x1ec)]();return Y(_0x8e2e8c(0x21c)+_0x4ebcb3[_0x8e2e8c(0x1d5)]+'\x20'+_0x1b9992['slice'](0x0,0x64)),{'ok':!0x1,'error':_0x8e2e8c(0x1e5)+_0x4ebcb3[_0x8e2e8c(0x1d5)]};}await _0x4ebcb3[_0x8e2e8c(0x1ec)]();let _0x37ac47=(await(await fetch(f+_0x8e2e8c(0x1ef),{'method':_0x8e2e8c(0x1ea),'headers':{'Content-Type':_0x8e2e8c(0x210),'Accept':_0x8e2e8c(0x1dd),...X?{'Authorization':_0x8e2e8c(0x1aa)+X}:{}},'body':JSON[_0x8e2e8c(0x1d2)]({'jsonrpc':_0x8e2e8c(0x1d4),'id':0x2,'method':_0x8e2e8c(0x1b9),'params':{'name':_0xb93545,'arguments':_0x101ab1}})}))['text']())[_0x8e2e8c(0x1e4)]('\x0a')[_0x8e2e8c(0x19c)](_0x3552b7=>_0x3552b7[_0x8e2e8c(0x20b)]('data:\x20'));if(_0x37ac47){let _0x208b23=JSON[_0x8e2e8c(0x1d1)](_0x37ac47[_0x8e2e8c(0x215)](0x6));return _0x208b23?.[_0x8e2e8c(0x224)]?.[_0x8e2e8c(0x1da)]?.[0x0]?.['text']?JSON[_0x8e2e8c(0x1d1)](_0x208b23[_0x8e2e8c(0x224)][_0x8e2e8c(0x1da)][0x0][_0x8e2e8c(0x1ec)]):_0x208b23;}return{'ok':!0x1,'error':_0x8e2e8c(0x1a5)};}K[a0_0x4f01e3(0x1eb)](a0_0x23d09e,async _0x401501=>{const _0x4ba7ad=a0_0x4f01e3;let {name:_0x352b2c,arguments:_0x2c4a46}=_0x401501[_0x4ba7ad(0x203)];if(_0x352b2c==='commhub_reply'){let {task_id:_0x15c1a5,text:_0x15e09f,status:_0x52e123}=_0x2c4a46;if(_0x52e123===_0x4ba7ad(0x1b0)||_0x52e123===_0x4ba7ad(0x209)||_0x52e123===_0x4ba7ad(0x1a2)){let _0x3e1c95=_0x52e123==='completed'?_0x4ba7ad(0x1df):_0x52e123,_0xcfe4fd=_0x15c1a5?k[_0x4ba7ad(0x1a8)](_0x15c1a5)||'hub':_0x4ba7ad(0x218),_0xc7e95a=await P('send_reply',{'alias':_0xcfe4fd,'text':_0x15e09f,'in_reply_to':_0x15c1a5||void 0x0,'status':_0x3e1c95,'from_session':Z});if(_0x15c1a5)k['delete'](_0x15c1a5);return{'content':[{'type':_0x4ba7ad(0x1ec),'text':JSON[_0x4ba7ad(0x1d2)](_0xc7e95a)}]};}let _0x558318=await P(_0x4ba7ad(0x1d0),{'resume_id':w,'alias':Z,'status':_0x52e123===_0x4ba7ad(0x1a0)?_0x4ba7ad(0x1a0):_0x52e123===_0x4ba7ad(0x199)?'error':_0x4ba7ad(0x1cf),'task':_0x15e09f[_0x4ba7ad(0x215)](0x0,0xc8),'output':_0x15e09f});return{'content':[{'type':_0x4ba7ad(0x1ec),'text':JSON[_0x4ba7ad(0x1d2)](_0x558318)}]};}if(_0x352b2c==='commhub_report_status'){let {status:_0x416947,task:_0x16a54e,progress:_0x2243aa}=_0x2c4a46,_0x77d180=await P(_0x4ba7ad(0x1d0),{'resume_id':w,'alias':Z,'status':_0x416947,'task':_0x16a54e,'progress':_0x2243aa});return{'content':[{'type':_0x4ba7ad(0x1ec),'text':JSON[_0x4ba7ad(0x1d2)](_0x77d180)}]};}if(_0x352b2c==='commhub_send_task'){let {alias:_0x22b757,task:_0x4b8cb3,priority:_0xd16464}=_0x2c4a46,_0xf5a553=await P('send_task',{'alias':_0x22b757,'task':_0x4b8cb3,'priority':_0xd16464||_0x4ba7ad(0x1b2),'from_session':Z});return{'content':[{'type':_0x4ba7ad(0x1ec),'text':JSON[_0x4ba7ad(0x1d2)](_0xf5a553)}]};}if(_0x352b2c===_0x4ba7ad(0x211)){let {alias:_0x36d9cc,message:_0x521374}=_0x2c4a46,_0xccc32d=await P(_0x4ba7ad(0x214),{'alias':_0x36d9cc,'message':_0x521374,'from_session':Z});return{'content':[{'type':_0x4ba7ad(0x1ec),'text':JSON[_0x4ba7ad(0x1d2)](_0xccc32d)}]};}if(_0x352b2c===_0x4ba7ad(0x1f5)){let _0x1e460c=await P(_0x4ba7ad(0x1d9),{});return{'content':[{'type':_0x4ba7ad(0x1ec),'text':JSON[_0x4ba7ad(0x1d2)](_0x1e460c)}]};}return{'content':[{'type':_0x4ba7ad(0x1ec),'text':JSON[_0x4ba7ad(0x1d2)]({'error':_0x4ba7ad(0x1bc)})}]};});async function u(){const _0x3dcdec=a0_0x4f01e3;let _0xbbaf5=f+_0x3dcdec(0x1ed)+encodeURIComponent(Z),_0x375da9={};if(X)_0x375da9['Authorization']=_0x3dcdec(0x1aa)+X;Y(_0x3dcdec(0x1f1)+_0xbbaf5);while(!0x0){try{let _0x5bb19c=await fetch(_0xbbaf5,{'headers':_0x375da9});if(!_0x5bb19c['ok']){Y(_0x3dcdec(0x207)+_0x5bb19c['status']+'\x20'+_0x5bb19c[_0x3dcdec(0x20a)]),await h(0x1388);continue;}let _0x1b667f=_0x5bb19c[_0x3dcdec(0x1c6)][_0x3dcdec(0x1bd)](),_0x54908d=new TextDecoder(),_0x186184='';while(!0x0){let {done:_0x463d0c,value:_0x422ccc}=await _0x1b667f[_0x3dcdec(0x1a9)]();if(_0x463d0c)break;_0x186184+=_0x54908d[_0x3dcdec(0x1af)](_0x422ccc,{'stream':!0x0});let _0xfe3089=_0x186184[_0x3dcdec(0x1e4)]('\x0a\x0a');_0x186184=_0xfe3089[_0x3dcdec(0x202)]()||'';for(let _0x527437 of _0xfe3089){let _0x3f3a50=_0x527437[_0x3dcdec(0x1e4)]('\x0a')[_0x3dcdec(0x19c)](_0x162e1f=>_0x162e1f[_0x3dcdec(0x20b)](_0x3dcdec(0x1ce)));if(!_0x3f3a50)continue;try{let _0x55766e=JSON[_0x3dcdec(0x1d1)](_0x3f3a50[_0x3dcdec(0x215)](0x6));await S(_0x55766e);}catch(_0x19cec3){Y(_0x3dcdec(0x1e7)+_0x19cec3);}}}Y(_0x3dcdec(0x1e6));}catch(_0x39f7b0){Y(_0x3dcdec(0x1e1)+_0x39f7b0);}await h(0xbb8);}}async function S(_0x20e414){const _0x319cf9=a0_0x4f01e3;if(_0x20e414[_0x319cf9(0x1fa)]===_0x319cf9(0x19b)){Y(_0x319cf9(0x20d)+Z+'\x22');return;}if(_0x20e414[_0x319cf9(0x1fa)]===_0x319cf9(0x1b1)){if(Y(_0x319cf9(0x21e)+_0x20e414['from']+':\x20'+_0x20e414[_0x319cf9(0x21b)][_0x319cf9(0x215)](0x0,0x3c)),await K[_0x319cf9(0x216)]({'method':'notifications/claude/channel','params':{'content':_0x20e414[_0x319cf9(0x21b)],'meta':{'sender':_0x20e414['from']||_0x319cf9(0x218),'sender_id':_0x319cf9(0x212),'user':_0x20e414[_0x319cf9(0x22d)]||'hub','priority':_0x319cf9(0x1b2)}}}),_0x20e414[_0x319cf9(0x19f)])await P(_0x319cf9(0x22e),{'alias':Z,'message_id':_0x20e414[_0x319cf9(0x19f)]});return;}if(_0x20e414[_0x319cf9(0x1fa)]===_0x319cf9(0x1a3)||_0x20e414[_0x319cf9(0x1fa)]===_0x319cf9(0x21f)){Y('←\x20'+_0x20e414[_0x319cf9(0x1fa)]+_0x319cf9(0x1a7)+_0x20e414[_0x319cf9(0x1ba)]+_0x319cf9(0x20f)+(_0x20e414['priority']||_0x319cf9(0x1b2)));let _0x4fd2a1=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0x4fd2a1?.['ok']&&_0x4fd2a1[_0x319cf9(0x206)]?.[_0x319cf9(0x1a1)]>0x0)for(let _0x2c1330 of _0x4fd2a1['messages']){let _0x5206d7={'sender':_0x2c1330[_0x319cf9(0x1c4)]||_0x319cf9(0x218),'sender_id':_0x319cf9(0x212),'user':_0x2c1330[_0x319cf9(0x1c4)]||_0x319cf9(0x218),'task_id':_0x2c1330['id'],'priority':_0x2c1330[_0x319cf9(0x1f3)]||_0x319cf9(0x1b2)};k['set'](_0x2c1330['id'],_0x2c1330[_0x319cf9(0x1c4)]||_0x319cf9(0x218)),await K[_0x319cf9(0x216)]({'method':_0x319cf9(0x1f8),'params':{'content':_0x2c1330[_0x319cf9(0x1da)],'meta':_0x5206d7}}),Y(_0x319cf9(0x1f6)+_0x2c1330['id'][_0x319cf9(0x215)](0x0,0x8)+'\x20from\x20'+_0x2c1330[_0x319cf9(0x1c4)]+':\x20'+_0x2c1330[_0x319cf9(0x1da)][_0x319cf9(0x215)](0x0,0x3c)),await P(_0x319cf9(0x22e),{'alias':Z,'message_id':_0x2c1330['id']});}}}async function A(){const _0x2c9d04=a0_0x4f01e3;let _0x41c5a5=new a0_0x597807();await K[_0x2c9d04(0x1a4)](_0x41c5a5),Y(_0x2c9d04(0x1fc)),Y(_0x2c9d04(0x208)),u()[_0x2c9d04(0x1c9)](_0x120a3a=>Y('SSE\x20fatal:\x20'+_0x120a3a)),P('report_status',{'resume_id':w,'alias':Z,'status':_0x2c9d04(0x1d6),'server':a0_0x41ff07(),'hostname':a0_0x41ff07(),'agent':_0x2c9d04(0x21d),'project_dir':process[_0x2c9d04(0x229)](),'tmux_name':j||void 0x0})[_0x2c9d04(0x1b5)](()=>Y('registered\x20as\x20\x22'+Z+_0x2c9d04(0x200)+w[_0x2c9d04(0x215)](0x0,0x8)+')'))['catch'](_0x3d4c0b=>Y('warning:\x20could\x20not\x20register:\x20'+_0x3d4c0b)),setInterval(()=>{const _0x327bb2=_0x2c9d04;P(_0x327bb2(0x1d0),{'resume_id':w,'alias':Z,'status':_0x327bb2(0x1d6),'server':a0_0x41ff07(),'hostname':a0_0x41ff07(),'agent':_0x327bb2(0x21d),'project_dir':process['cwd'](),'tmux_name':j||void 0x0})[_0x327bb2(0x1c9)](_0x5b8f07=>Y(_0x327bb2(0x1ae)+_0x5b8f07));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}A()['catch'](_0x5f137a=>{const _0x1f54b0=a0_0x4f01e3;Y(_0x1f54b0(0x1bf)+_0x5f137a),process[_0x1f54b0(0x19a)](0x1);});async function N(){const _0x4cf2a7=a0_0x4f01e3;Y(_0x4cf2a7(0x1c3)),await P(_0x4cf2a7(0x1d0),{'resume_id':w,'alias':Z,'status':_0x4cf2a7(0x199),'task':'session\x20disconnected'})['catch'](()=>{}),process[_0x4cf2a7(0x19a)](0x0);}process[a0_0x4f01e3(0x228)]['on']('end',()=>N()),process['on'](a0_0x4f01e3(0x1d8),()=>N()),process['on'](a0_0x4f01e3(0x1f9),()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.1.15-preview.5",
3
+ "version": "2.1.15-preview.7",
4
4
  "description": "AI Agent Network CLI — Create multi-agent networks with user management, network isolation, and 3 AI runtimes (Claude/Codex/MiniMax). 39 commands.",
5
5
  "type": "module",
6
6
  "main": "dist/src/client.js",