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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- const a0_0xd33414=a0_0x2b63;function a0_0x1567(){const _0x4e167e=['name','158512GzPhKb','parse','min','catch','log','561sfHEMy','match','connectSSE','send','send_task','connect','SSE\x20failed:\x20','type','data:\x20','result','2612fPJVWu','report_status','heartbeatInterval','abort','slice','now','messages',']\x20[commhub:','53002smHMOX','sdk-','251294pYOBLD','broadcast','pop','from_session','body','6DjuObk','new_message','send_message','Authorization','emit','alias','SSE\x20reconnecting\x20in\x20','url','getReader','running','idle','inbox\x20error:\x20','317245aCRSOL','application/json,\x20text/event-stream','call','get_all_status','error','registered','2.0','task','agent','sleep','POST','tools/call','get_inbox','Bearer\x20','content','disconnected','completed','1913177cVdaYW','reply','heartbeatTimer','stringify','/mcp','message','processInbox','connected','server','token','status','SSE\x20error:\x20','signal','9lldYNg','getAllStatus','1156620tzaCoW','resumeId','s...','reconnectDelay','startsWith','normal','AbortError','sseAbort','text'];a0_0x1567=function(){return _0x4e167e;};return a0_0x1567();}function a0_0x2b63(_0x3ecd17,_0x2cb4f3){_0x3ecd17=_0x3ecd17-0x1b6;const _0x1567e9=a0_0x1567();let _0x2b638a=_0x1567e9[_0x3ecd17];return _0x2b638a;}(function(_0x5abb3e,_0x168a9b){const _0x19de62=a0_0x2b63,_0x392a99=_0x5abb3e();while(!![]){try{const _0x3c2a79=-parseInt(_0x19de62(0x1fb))/0x1+-parseInt(_0x19de62(0x1fd))/0x2+parseInt(_0x19de62(0x1e9))/0x3*(parseInt(_0x19de62(0x1f3))/0x4)+parseInt(_0x19de62(0x1ba))/0x5+-parseInt(_0x19de62(0x202))/0x6*(-parseInt(_0x19de62(0x1cb))/0x7)+-parseInt(_0x19de62(0x1e4))/0x8*(parseInt(_0x19de62(0x1d8))/0x9)+-parseInt(_0x19de62(0x1da))/0xa;if(_0x3c2a79===_0x168a9b)break;else _0x392a99['push'](_0x392a99['shift']());}catch(_0x91a45c){_0x392a99['push'](_0x392a99['shift']());}}}(a0_0x1567,0x2356a));import{EventEmitter as a0_0x3344c4}from'events';import{hostname as a0_0x28ad05}from'os';class T extends a0_0x3344c4{[a0_0xd33414(0x209)];['alias'];['token'];[a0_0xd33414(0x1c2)];[a0_0xd33414(0x1db)];[a0_0xd33414(0x1f5)];[a0_0xd33414(0x1dd)];[a0_0xd33414(0x1cd)];['sseAbort'];['running']=!0x1;constructor(_0x51acda){const _0x261699=a0_0xd33414;super();if(this[_0x261699(0x209)]=_0x51acda[_0x261699(0x209)]['replace'](/\/$/,''),this[_0x261699(0x207)]=_0x51acda[_0x261699(0x207)],this[_0x261699(0x1d4)]=_0x51acda[_0x261699(0x1d4)],this[_0x261699(0x1c2)]=_0x51acda[_0x261699(0x1c2)]||'sdk',this[_0x261699(0x1db)]=_0x261699(0x1fc)+_0x51acda[_0x261699(0x207)]+'-'+Date['now']()['toString'](0x24),this[_0x261699(0x1f5)]=_0x51acda[_0x261699(0x1f5)]??0x2bf20,this['reconnectDelay']=_0x51acda[_0x261699(0x1dd)]??0xbb8,_0x51acda['autoConnect']!==!0x1)this[_0x261699(0x1ee)]();}[a0_0xd33414(0x1e8)](_0x82c64f){const _0x317c4f=a0_0xd33414;console[_0x317c4f(0x1e8)]('['+new Date()['toTimeString']()[_0x317c4f(0x1f7)](0x0,0x8)+_0x317c4f(0x1fa)+this[_0x317c4f(0x207)]+']\x20'+_0x82c64f);}async[a0_0xd33414(0x1bc)](_0x55a363,_0x206acd){const _0x3e97dc=a0_0xd33414;let _0x4854a7={'Content-Type':'application/json','Accept':_0x3e97dc(0x1bb)};if(this[_0x3e97dc(0x1d4)])_0x4854a7[_0x3e97dc(0x205)]=_0x3e97dc(0x1c7)+this['token'];let _0x42d729=await(await fetch(this[_0x3e97dc(0x209)]+_0x3e97dc(0x1cf),{'method':_0x3e97dc(0x1c4),'headers':_0x4854a7,'body':JSON[_0x3e97dc(0x1ce)]({'jsonrpc':_0x3e97dc(0x1c0),'id':Date[_0x3e97dc(0x1f8)](),'method':_0x3e97dc(0x1c5),'params':{'name':_0x55a363,'arguments':_0x206acd}})}))[_0x3e97dc(0x1e2)](),_0x104e59=_0x42d729[_0x3e97dc(0x1ea)](/data: (.+)/),_0x232a80=_0x104e59?JSON[_0x3e97dc(0x1e5)](_0x104e59[0x1]):JSON[_0x3e97dc(0x1e5)](_0x42d729),_0x4b7f50=_0x232a80?.[_0x3e97dc(0x1f2)]?.[_0x3e97dc(0x1c8)]?.[0x0]?.[_0x3e97dc(0x1e2)];return _0x4b7f50?JSON[_0x3e97dc(0x1e5)](_0x4b7f50):_0x232a80;}async[a0_0xd33414(0x1ee)](){const _0x320ee9=a0_0xd33414;if(this['running'])return;this[_0x320ee9(0x1b7)]=!0x0,await this['status'](_0x320ee9(0x1b8)),this[_0x320ee9(0x1e8)](_0x320ee9(0x1bf)),this['heartbeatTimer']=setInterval(()=>{const _0xa5947c=_0x320ee9;this[_0xa5947c(0x1d5)](_0xa5947c(0x1b8))[_0xa5947c(0x1e7)](_0x30125f=>this[_0xa5947c(0x1e8)]('heartbeat\x20failed:\x20'+_0x30125f[_0xa5947c(0x1d0)]));},this[_0x320ee9(0x1f5)]),this[_0x320ee9(0x1eb)]();}async['disconnect'](){const _0x4a8a49=a0_0xd33414;if(this[_0x4a8a49(0x1b7)]=!0x1,this['sseAbort']?.[_0x4a8a49(0x1f6)](),this[_0x4a8a49(0x1cd)])clearInterval(this['heartbeatTimer']);await this[_0x4a8a49(0x1d5)]('offline')['catch'](()=>{}),this[_0x4a8a49(0x1e8)](_0x4a8a49(0x1c9));}async[a0_0xd33414(0x1ec)](_0x304632,_0x478c30,_0x1eb182=a0_0xd33414(0x1df)){const _0x377d52=a0_0xd33414;return this[_0x377d52(0x1bc)](_0x377d52(0x1ed),{'alias':_0x304632,'task':_0x478c30,'priority':_0x1eb182,'from_session':this[_0x377d52(0x207)]});}async[a0_0xd33414(0x1d0)](_0xd7e340,_0x291561){const _0x4b194b=a0_0xd33414;return this[_0x4b194b(0x1bc)](_0x4b194b(0x204),{'alias':_0xd7e340,'message':_0x291561,'from_session':this[_0x4b194b(0x207)]});}async[a0_0xd33414(0x1cc)](_0x145aac,_0x4edb8a,_0x35e5b5=a0_0xd33414(0x1ca)){const _0x3334fd=a0_0xd33414;return this[_0x3334fd(0x1bc)]('reply',{'task_id':_0x145aac,'text':_0x4edb8a,'status':_0x35e5b5});}async['status'](_0x10117a,_0x35c483){const _0x2ae8df=a0_0xd33414;return this[_0x2ae8df(0x1bc)](_0x2ae8df(0x1f4),{'resume_id':this['resumeId'],'alias':this[_0x2ae8df(0x207)],'status':_0x10117a,'server':a0_0x28ad05(),'hostname':a0_0x28ad05(),'agent':this['agent'],'project_dir':process['cwd'](),..._0x35c483});}async[a0_0xd33414(0x1d9)](){const _0x454f2d=a0_0xd33414;return this[_0x454f2d(0x1bc)](_0x454f2d(0x1bd),{});}async[a0_0xd33414(0x1fe)](_0x4ddfb8,_0xf413d2){const _0x4b581d=a0_0xd33414;return this[_0x4b581d(0x1bc)](_0x4b581d(0x1fe),{'message':_0x4ddfb8,'filter_server':_0xf413d2?.[_0x4b581d(0x1d3)],'filter_status':_0xf413d2?.[_0x4b581d(0x1d5)]});}async[a0_0xd33414(0x1eb)](){const _0x54879a=a0_0xd33414;let _0x3f5b9b=encodeURIComponent(this[_0x54879a(0x207)]),_0x10ba4b=this[_0x54879a(0x209)]+'/events/'+_0x3f5b9b,_0x170705=this['reconnectDelay'];while(this[_0x54879a(0x1b7)]){try{this[_0x54879a(0x1e1)]=new AbortController();let _0x27719f={'Accept':'text/event-stream'};if(this[_0x54879a(0x1d4)])_0x27719f[_0x54879a(0x205)]='Bearer\x20'+this[_0x54879a(0x1d4)];let _0x502ff4=await fetch(_0x10ba4b,{'headers':_0x27719f,'signal':this['sseAbort'][_0x54879a(0x1d7)]});if(!_0x502ff4['ok']||!_0x502ff4[_0x54879a(0x201)]){this['log'](_0x54879a(0x1ef)+_0x502ff4[_0x54879a(0x1d5)]),await this[_0x54879a(0x1c3)](_0x170705),_0x170705=Math[_0x54879a(0x1e6)](_0x170705*1.5,0xea60);continue;}_0x170705=this[_0x54879a(0x1dd)];let _0x2f3c12=_0x502ff4[_0x54879a(0x201)][_0x54879a(0x1b6)](),_0x5ea15e=new TextDecoder(),_0x581bdd='';while(this[_0x54879a(0x1b7)]){let {done:_0x73e2c2,value:_0x470aaf}=await _0x2f3c12['read']();if(_0x73e2c2)break;_0x581bdd+=_0x5ea15e['decode'](_0x470aaf,{'stream':!0x0});let _0x5d3c40=_0x581bdd['split']('\x0a');_0x581bdd=_0x5d3c40[_0x54879a(0x1ff)]()||'';for(let _0x57dbf8 of _0x5d3c40){if(!_0x57dbf8[_0x54879a(0x1de)](_0x54879a(0x1f1)))continue;try{let _0x59166f=JSON[_0x54879a(0x1e5)](_0x57dbf8[_0x54879a(0x1f7)](0x6));if(_0x59166f[_0x54879a(0x1f0)]===_0x54879a(0x1d2)){this[_0x54879a(0x1e8)]('SSE\x20connected'),this[_0x54879a(0x206)]('connected');continue;}if(_0x59166f[_0x54879a(0x1f0)]==='new_task'||_0x59166f[_0x54879a(0x1f0)]===_0x54879a(0x203)||_0x59166f[_0x54879a(0x1f0)]===_0x54879a(0x1fe))await this[_0x54879a(0x1d1)]();}catch{}}}}catch(_0x3f0b8e){if(_0x3f0b8e[_0x54879a(0x1e3)]===_0x54879a(0x1e0))break;this[_0x54879a(0x206)](_0x54879a(0x1be),_0x3f0b8e),this[_0x54879a(0x1e8)](_0x54879a(0x1d6)+_0x3f0b8e[_0x54879a(0x1d0)]);}if(this[_0x54879a(0x1b7)])this[_0x54879a(0x206)](_0x54879a(0x1c9)),this['log'](_0x54879a(0x208)+_0x170705/0x3e8+_0x54879a(0x1dc)),await this[_0x54879a(0x1c3)](_0x170705),_0x170705=Math[_0x54879a(0x1e6)](_0x170705*1.5,0xea60);}}async['processInbox'](){const _0x566dc3=a0_0xd33414;try{let _0x33700e=(await this[_0x566dc3(0x1bc)](_0x566dc3(0x1c6),{'alias':this[_0x566dc3(0x207)],'limit':0xa}))?.[_0x566dc3(0x1f9)]||[];for(let _0x26e3cc of _0x33700e)await this['call']('ack_inbox',{'alias':this[_0x566dc3(0x207)],'message_id':_0x26e3cc['id']}),this['log']('←\x20'+_0x26e3cc[_0x566dc3(0x200)]+':\x20'+_0x26e3cc[_0x566dc3(0x1c8)][_0x566dc3(0x1f7)](0x0,0x3c)),this['emit'](_0x566dc3(0x1c1),_0x26e3cc),this[_0x566dc3(0x206)](_0x566dc3(0x1d0),_0x26e3cc);}catch(_0x528bc2){this[_0x566dc3(0x1e8)](_0x566dc3(0x1b9)+_0x528bc2['message']);}}['sleep'](_0x239934){return new Promise(_0x4b73ba=>setTimeout(_0x4b73ba,_0x239934));}}var $=T;export{$ as default,T as CommHub};
1
+ const a0_0x5397dd=a0_0x1fb5;(function(_0x4eb088,_0x4f5590){const _0x4b5a64=a0_0x1fb5,_0x56c890=_0x4eb088();while(!![]){try{const _0x2919ce=parseInt(_0x4b5a64(0x1c1))/0x1*(parseInt(_0x4b5a64(0x20f))/0x2)+-parseInt(_0x4b5a64(0x1f2))/0x3+-parseInt(_0x4b5a64(0x1cc))/0x4+parseInt(_0x4b5a64(0x1ed))/0x5+parseInt(_0x4b5a64(0x1e7))/0x6*(parseInt(_0x4b5a64(0x1f3))/0x7)+parseInt(_0x4b5a64(0x20d))/0x8*(parseInt(_0x4b5a64(0x1f0))/0x9)+-parseInt(_0x4b5a64(0x1cf))/0xa*(-parseInt(_0x4b5a64(0x1c8))/0xb);if(_0x2919ce===_0x4f5590)break;else _0x56c890['push'](_0x56c890['shift']());}catch(_0x5112bf){_0x56c890['push'](_0x56c890['shift']());}}}(a0_0x8f09,0xa8b94));function a0_0x1fb5(_0x30d3c6,_0x412d4e){_0x30d3c6=_0x30d3c6-0x1bf;const _0x8f0996=a0_0x8f09();let _0x1fb598=_0x8f0996[_0x30d3c6];return _0x1fb598;}function a0_0x8f09(){const _0x3f162b=['POST','alias','7XCtbqZ','heartbeatTimer','task','s...','agent','content','server','3953246saYZNh','toTimeString','disconnected','registered','4253688lsLiGI','catch','running','50fGoeYE','offline','sdk','result','slice','log','startsWith','send_message','text/event-stream','heartbeatInterval','connected','signal','completed','inbox\x20error:\x20','send','getAllStatus','Authorization','send_task','application/json','body','message','replace','processInbox','get_all_status','42HgPlny','error','emit','new_message','token','autoConnect','67955OsOTdL','match','disconnect','252ayXzOe','messages','3206217dzjHUH','251755kkBsAD','new_task','min','parse','connect','type','abort','now','idle','call','broadcast','resumeId','ack_inbox','SSE\x20reconnecting\x20in\x20','connectSSE','getReader','status','SSE\x20connected','text','reconnectDelay','Bearer\x20','name','2.0','AbortError','url','reply','208904FKrBVb','SSE\x20error:\x20','8518ZLeQnf','sseAbort'];a0_0x8f09=function(){return _0x3f162b;};return a0_0x8f09();}import{EventEmitter as a0_0x16a52e}from'events';import{hostname as a0_0x557a67}from'os';class T extends a0_0x16a52e{['url'];[a0_0x5397dd(0x1c0)];['token'];[a0_0x5397dd(0x1c5)];[a0_0x5397dd(0x1fe)];['heartbeatInterval'];[a0_0x5397dd(0x206)];['heartbeatTimer'];['sseAbort'];['running']=!0x1;constructor(_0x21f13d){const _0x108230=a0_0x5397dd;super();if(this[_0x108230(0x20b)]=_0x21f13d[_0x108230(0x20b)][_0x108230(0x1e4)](/\/$/,''),this[_0x108230(0x1c0)]=_0x21f13d['alias'],this[_0x108230(0x1eb)]=_0x21f13d[_0x108230(0x1eb)],this[_0x108230(0x1c5)]=_0x21f13d[_0x108230(0x1c5)]||_0x108230(0x1d1),this[_0x108230(0x1fe)]='sdk-'+_0x21f13d[_0x108230(0x1c0)]+'-'+Date[_0x108230(0x1fa)]()['toString'](0x24),this['heartbeatInterval']=_0x21f13d[_0x108230(0x1d8)]??0x2bf20,this[_0x108230(0x206)]=_0x21f13d[_0x108230(0x206)]??0xbb8,_0x21f13d[_0x108230(0x1ec)]!==!0x1)this[_0x108230(0x1f7)]();}['log'](_0x11c08e){const _0x2bc151=a0_0x5397dd;console[_0x2bc151(0x1d4)]('['+new Date()[_0x2bc151(0x1c9)]()['slice'](0x0,0x8)+']\x20[commhub:'+this[_0x2bc151(0x1c0)]+']\x20'+_0x11c08e);}async[a0_0x5397dd(0x1fc)](_0x190a96,_0x5dd421){const _0x1503ed=a0_0x5397dd;let _0x43fbf1={'Content-Type':_0x1503ed(0x1e1),'Accept':'application/json,\x20text/event-stream'};if(this[_0x1503ed(0x1eb)])_0x43fbf1[_0x1503ed(0x1df)]=_0x1503ed(0x207)+this['token'];let _0x59f9c9=await(await fetch(this[_0x1503ed(0x20b)]+'/mcp',{'method':_0x1503ed(0x1bf),'headers':_0x43fbf1,'body':JSON['stringify']({'jsonrpc':_0x1503ed(0x209),'id':Date[_0x1503ed(0x1fa)](),'method':'tools/call','params':{'name':_0x190a96,'arguments':_0x5dd421}})}))[_0x1503ed(0x205)](),_0x4bce2f=_0x59f9c9[_0x1503ed(0x1ee)](/data: (.+)/),_0x188bd1=_0x4bce2f?JSON[_0x1503ed(0x1f6)](_0x4bce2f[0x1]):JSON['parse'](_0x59f9c9),_0x125f72=_0x188bd1?.[_0x1503ed(0x1d2)]?.[_0x1503ed(0x1c6)]?.[0x0]?.[_0x1503ed(0x205)];return _0x125f72?JSON[_0x1503ed(0x1f6)](_0x125f72):_0x188bd1;}async[a0_0x5397dd(0x1f7)](){const _0x10a639=a0_0x5397dd;if(this[_0x10a639(0x1ce)])return;this[_0x10a639(0x1ce)]=!0x0,await this[_0x10a639(0x203)]('idle'),this['log'](_0x10a639(0x1cb)),this[_0x10a639(0x1c2)]=setInterval(()=>{const _0x7ec0f7=_0x10a639;this[_0x7ec0f7(0x203)](_0x7ec0f7(0x1fb))['catch'](_0x16efed=>this[_0x7ec0f7(0x1d4)]('heartbeat\x20failed:\x20'+_0x16efed['message']));},this[_0x10a639(0x1d8)]),this[_0x10a639(0x201)]();}async[a0_0x5397dd(0x1ef)](){const _0x3adad5=a0_0x5397dd;if(this[_0x3adad5(0x1ce)]=!0x1,this[_0x3adad5(0x210)]?.[_0x3adad5(0x1f9)](),this[_0x3adad5(0x1c2)])clearInterval(this[_0x3adad5(0x1c2)]);await this['status'](_0x3adad5(0x1d0))[_0x3adad5(0x1cd)](()=>{}),this[_0x3adad5(0x1d4)]('disconnected');}async[a0_0x5397dd(0x1dd)](_0x4390e5,_0x2623df,_0x29ae46='normal'){const _0x375aab=a0_0x5397dd;return this[_0x375aab(0x1fc)](_0x375aab(0x1e0),{'alias':_0x4390e5,'task':_0x2623df,'priority':_0x29ae46,'from_session':this[_0x375aab(0x1c0)]});}async[a0_0x5397dd(0x1e3)](_0x264a39,_0xeefae3){const _0x282ff5=a0_0x5397dd;return this[_0x282ff5(0x1fc)](_0x282ff5(0x1d6),{'alias':_0x264a39,'message':_0xeefae3,'from_session':this['alias']});}async[a0_0x5397dd(0x20c)](_0x258174,_0x5bfbba,_0x442e9c=a0_0x5397dd(0x1db)){const _0x23dbab=a0_0x5397dd;return this[_0x23dbab(0x1fc)](_0x23dbab(0x20c),{'task_id':_0x258174,'text':_0x5bfbba,'status':_0x442e9c});}async[a0_0x5397dd(0x203)](_0x280085,_0x349d64){const _0x4f285e=a0_0x5397dd;return this['call']('report_status',{'resume_id':this[_0x4f285e(0x1fe)],'alias':this['alias'],'status':_0x280085,'server':a0_0x557a67(),'hostname':a0_0x557a67(),'agent':this['agent'],'project_dir':process['cwd'](),..._0x349d64});}async[a0_0x5397dd(0x1de)](){const _0xd929ab=a0_0x5397dd;return this[_0xd929ab(0x1fc)](_0xd929ab(0x1e6),{});}async[a0_0x5397dd(0x1fd)](_0x551046,_0x544e01){const _0x409b3b=a0_0x5397dd;return this['call'](_0x409b3b(0x1fd),{'message':_0x551046,'filter_server':_0x544e01?.[_0x409b3b(0x1c7)],'filter_status':_0x544e01?.[_0x409b3b(0x203)]});}async[a0_0x5397dd(0x201)](){const _0xd7e01f=a0_0x5397dd;let _0x28a65c=encodeURIComponent(this[_0xd7e01f(0x1c0)]),_0x1c6dcf=this['url']+'/events/'+_0x28a65c,_0x1e08bf=this[_0xd7e01f(0x206)];while(this['running']){try{this['sseAbort']=new AbortController();let _0x3d1826={'Accept':_0xd7e01f(0x1d7)};if(this['token'])_0x3d1826['Authorization']=_0xd7e01f(0x207)+this['token'];let _0x57bef8=await fetch(_0x1c6dcf,{'headers':_0x3d1826,'signal':this[_0xd7e01f(0x210)][_0xd7e01f(0x1da)]});if(!_0x57bef8['ok']||!_0x57bef8[_0xd7e01f(0x1e2)]){this[_0xd7e01f(0x1d4)]('SSE\x20failed:\x20'+_0x57bef8[_0xd7e01f(0x203)]),await this['sleep'](_0x1e08bf),_0x1e08bf=Math[_0xd7e01f(0x1f5)](_0x1e08bf*1.5,0xea60);continue;}_0x1e08bf=this['reconnectDelay'];let _0x582446=_0x57bef8[_0xd7e01f(0x1e2)][_0xd7e01f(0x202)](),_0x38635f=new TextDecoder(),_0xc5535b='';while(this[_0xd7e01f(0x1ce)]){let {done:_0x589e87,value:_0x35ddfb}=await _0x582446['read']();if(_0x589e87)break;_0xc5535b+=_0x38635f['decode'](_0x35ddfb,{'stream':!0x0});let _0x25d511=_0xc5535b['split']('\x0a');_0xc5535b=_0x25d511['pop']()||'';for(let _0x1a6df4 of _0x25d511){if(!_0x1a6df4[_0xd7e01f(0x1d5)]('data:\x20'))continue;try{let _0x568d1b=JSON['parse'](_0x1a6df4[_0xd7e01f(0x1d3)](0x6));if(_0x568d1b[_0xd7e01f(0x1f8)]===_0xd7e01f(0x1d9)){this['log'](_0xd7e01f(0x204)),this['emit'](_0xd7e01f(0x1d9));continue;}if(_0x568d1b[_0xd7e01f(0x1f8)]===_0xd7e01f(0x1f4)||_0x568d1b[_0xd7e01f(0x1f8)]===_0xd7e01f(0x1ea)||_0x568d1b[_0xd7e01f(0x1f8)]===_0xd7e01f(0x1fd))await this[_0xd7e01f(0x1e5)]();}catch{}}}}catch(_0x5b7091){if(_0x5b7091[_0xd7e01f(0x208)]===_0xd7e01f(0x20a))break;this[_0xd7e01f(0x1e9)](_0xd7e01f(0x1e8),_0x5b7091),this['log'](_0xd7e01f(0x20e)+_0x5b7091[_0xd7e01f(0x1e3)]);}if(this[_0xd7e01f(0x1ce)])this[_0xd7e01f(0x1e9)](_0xd7e01f(0x1ca)),this[_0xd7e01f(0x1d4)](_0xd7e01f(0x200)+_0x1e08bf/0x3e8+_0xd7e01f(0x1c4)),await this['sleep'](_0x1e08bf),_0x1e08bf=Math['min'](_0x1e08bf*1.5,0xea60);}}async['processInbox'](){const _0x177a52=a0_0x5397dd;try{let _0x4b0bca=(await this[_0x177a52(0x1fc)]('get_inbox',{'alias':this['alias'],'limit':0xa}))?.[_0x177a52(0x1f1)]||[];for(let _0x280d8f of _0x4b0bca)await this[_0x177a52(0x1fc)](_0x177a52(0x1ff),{'alias':this[_0x177a52(0x1c0)],'message_id':_0x280d8f['id']}),this[_0x177a52(0x1d4)]('←\x20'+_0x280d8f['from_session']+':\x20'+_0x280d8f[_0x177a52(0x1c6)][_0x177a52(0x1d3)](0x0,0x3c)),this[_0x177a52(0x1e9)](_0x177a52(0x1c3),_0x280d8f),this[_0x177a52(0x1e9)](_0x177a52(0x1e3),_0x280d8f);}catch(_0x4bd0fb){this[_0x177a52(0x1d4)](_0x177a52(0x1dc)+_0x4bd0fb['message']);}}['sleep'](_0x5798f4){return new Promise(_0x6507ad=>setTimeout(_0x6507ad,_0x5798f4));}}var $=T;export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x51d63f=a0_0x1553;(function(_0x246343,_0xf37cd0){const _0x43ee9d=a0_0x1553,_0xdd07d=_0x246343();while(!![]){try{const _0xa4a345=parseInt(_0x43ee9d(0x1d5))/0x1+-parseInt(_0x43ee9d(0x177))/0x2*(-parseInt(_0x43ee9d(0x1a5))/0x3)+parseInt(_0x43ee9d(0x173))/0x4*(parseInt(_0x43ee9d(0x18c))/0x5)+parseInt(_0x43ee9d(0x17a))/0x6+-parseInt(_0x43ee9d(0x184))/0x7*(parseInt(_0x43ee9d(0x1da))/0x8)+-parseInt(_0x43ee9d(0x1ec))/0x9*(-parseInt(_0x43ee9d(0x1ae))/0xa)+-parseInt(_0x43ee9d(0x1c9))/0xb*(parseInt(_0x43ee9d(0x1bb))/0xc);if(_0xa4a345===_0xf37cd0)break;else _0xdd07d['push'](_0xdd07d['shift']());}catch(_0x3bf01d){_0xdd07d['push'](_0xdd07d['shift']());}}}(a0_0x892a,0x3641b));import{readFileSync as a0_0x189bc7,existsSync as a0_0x339850}from'fs';import{randomUUID as a0_0x5bd3a9}from'crypto';function a0_0x1553(_0x2f7437,_0x2e552e){_0x2f7437=_0x2f7437-0x15c;const _0x892a83=a0_0x892a();let _0x1553aa=_0x892a83[_0x2f7437];return _0x1553aa;}import{join as a0_0x50650a}from'path';import{hostname as a0_0x29d6ec}from'os';function a0_0x892a(){const _0x63b7ae=['heartbeat\x20failed:\x20','9594hhxWCm','statusText','setRequestHandler',':\x20inbox_count=','broadcast','MCP\x20stdio\x20connected','message','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','connected','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','slice','exit','ack_inbox','\x20CWD=','messages','write','claude-code','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','\x22\x20(','set','body','string','unknown\x20tool','new_task','488564XyZHLn',']\x20[commhub]\x20','content','status','691830xlDLIJ','toTimeString','http://127.0.0.1:9200','42246uQCJKo','parse\x20error:\x20','initialize','Message\x20content','low','commhub_report_status','inbox_count','/mcp','init\x20failed:\x20','type','147546VOVRIf','from','SIGINT','SSE\x20connected\x20as\x20\x22','Session\x20alias:\x20','.env','normal','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','10OKSJBN','Reply\x20text\x20/\x20result\x20summary','read','commhub_get_all_status','hub','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','length','SIGTERM','decode','catch','from_session','→\x20injected\x20task\x20','end','...\x20TMUX=','\x20from\x20','alias','Authorization','get','in_progress','split','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','POST','cwd','result','delete','3ewLifF','params','trim','shutting\x20down,\x20reporting\x20offline...','text','no\x20response','send_task','replace','token','50VPEgIH','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','startsWith','error','commhub_send_task','join','\x20priority=','high','utf-8','stdin','\x20PROJECT_ENV=','fatal:\x20','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','12IjMhmT','ENV:\x20URL=','Task\x20content','stringify','.anet','2025-03-26','task','commhub_reply','.claude/channels/commhub','\x20ALIAS=','application/json,\x20text/event-stream','blocked','parse','working','2519781dTgbvd','message_id','report_status','2.0','idle','0.3.0','notification','priority','session\x20disconnected','application/json','object','SSE\x20connection\x20error:\x20','80596GigsSt','commhub-channel','completed','commhub','Target\x20session\x20alias','88gBYhor','failed','CommHub\x20init\x20failed:\x20','warning:\x20could\x20not\x20register:\x20','none','Bearer\x20','commhub_send_message','find','/events/','ready\x20—\x20waiting\x20for\x20events','registered\x20as\x20\x22','notifications/claude/channel','data:\x20','Current\x20task\x20description','cancelled','←\x20message\x20from\x20','tools/call'];a0_0x892a=function(){return _0x63b7ae;};return a0_0x892a();}import{execSync as a0_0x91fe92}from'child_process';import{Server as a0_0x3392c5}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0xef4093}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x1dbfd2,CallToolRequestSchema as a0_0x79331d}from'@modelcontextprotocol/sdk/types.js';function p(_0x26271e){const _0x2daa02=a0_0x1553;if(!a0_0x339850(_0x26271e))return;for(let _0x1a770f of a0_0x189bc7(_0x26271e,_0x2daa02(0x1b6))[_0x2daa02(0x19f)]('\x0a')){let _0x5a047b=_0x1a770f[_0x2daa02(0x1a7)]();if(!_0x5a047b||_0x5a047b[_0x2daa02(0x1b0)]('#'))continue;let _0x3602cb=_0x5a047b['indexOf']('=');if(_0x3602cb<0x0)continue;let _0x3e3480=_0x5a047b[_0x2daa02(0x165)](0x0,_0x3602cb)[_0x2daa02(0x1a7)](),_0x1ba47f=_0x5a047b[_0x2daa02(0x165)](_0x3602cb+0x1)[_0x2daa02(0x1a7)]()[_0x2daa02(0x1ac)](/^["']|["']$/g,'');if(!process.env[_0x3e3480])process.env[_0x3e3480]=_0x1ba47f;}}var C=process.env.HOME||'~',T=a0_0x50650a(C,a0_0x51d63f(0x1c3));p(a0_0x50650a(T,'.env'));var L=process[a0_0x51d63f(0x1a2)]()['replace'](/\//g,'-');p(a0_0x50650a(T,L,a0_0x51d63f(0x189)));function U(){const _0x41fb69=a0_0x51d63f;try{return a0_0x91fe92('tmux\x20display-message\x20-p\x20\x27#S\x27',{'encoding':_0x41fb69(0x1b6),'timeout':0x7d0})[_0x41fb69(0x1a7)]();}catch{return'';}}function v(){const _0x4a376d=a0_0x51d63f;try{let _0x9fb395=a0_0x50650a(C,_0x4a376d(0x1bf),'config.json');if(a0_0x339850(_0x9fb395))return JSON[_0x4a376d(0x1c7)](a0_0x189bc7(_0x9fb395,_0x4a376d(0x1b6)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x51d63f(0x190)]||a0_0x51d63f(0x179),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x29d6ec(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x5bd3a9(),X=process.env.COMMHUB_TOKEN||H[a0_0x51d63f(0x1ad)]||'';function Y(_0x2c9c3a){const _0x351a87=a0_0x51d63f;let _0x39deae=new Date()[_0x351a87(0x178)]()['slice'](0x0,0x8);process['stderr'][_0x351a87(0x16a)]('['+_0x39deae+_0x351a87(0x174)+_0x2c9c3a+'\x0a');}function h(_0x1cd24e){return new Promise(_0x21528b=>setTimeout(_0x21528b,_0x1cd24e));}Y(a0_0x51d63f(0x1bc)+f+a0_0x51d63f(0x1c4)+Z+'\x20RESUME_ID='+w[a0_0x51d63f(0x165)](0x0,0x8)+a0_0x51d63f(0x199)+(j||a0_0x51d63f(0x1de))+a0_0x51d63f(0x168)+process[a0_0x51d63f(0x1a2)]()+a0_0x51d63f(0x1b8)+L);var k=new Map(),K=new a0_0x3392c5({'name':a0_0x51d63f(0x1d6),'version':a0_0x51d63f(0x1ce)},{'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_0x51d63f(0x1af),a0_0x51d63f(0x16c),a0_0x51d63f(0x1a0),a0_0x51d63f(0x188)+Z][a0_0x51d63f(0x1b3)]('\x0a')});K['setRequestHandler'](a0_0x1dbfd2,async()=>({'tools':[{'name':a0_0x51d63f(0x1c2),'description':a0_0x51d63f(0x162),'inputSchema':{'type':a0_0x51d63f(0x1d3),'properties':{'task_id':{'type':'string','description':a0_0x51d63f(0x191)},'text':{'type':a0_0x51d63f(0x170),'description':a0_0x51d63f(0x18d)},'status':{'type':a0_0x51d63f(0x170),'enum':[a0_0x51d63f(0x1d7),a0_0x51d63f(0x1db),'cancelled','blocked','error',a0_0x51d63f(0x19e)],'description':a0_0x51d63f(0x18b)}},'required':['text']}},{'name':'commhub_report_status','description':a0_0x51d63f(0x164),'inputSchema':{'type':a0_0x51d63f(0x1d3),'properties':{'status':{'type':a0_0x51d63f(0x170),'enum':[a0_0x51d63f(0x1c8),a0_0x51d63f(0x1cd),a0_0x51d63f(0x1c6),'error']},'task':{'type':a0_0x51d63f(0x170),'description':a0_0x51d63f(0x1e7)},'progress':{'type':'number','description':'Progress\x200-100'}},'required':[a0_0x51d63f(0x176)]}},{'name':a0_0x51d63f(0x1b2),'description':'Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','inputSchema':{'type':a0_0x51d63f(0x1d3),'properties':{'alias':{'type':a0_0x51d63f(0x170),'description':'Target\x20session\x20alias'},'task':{'type':a0_0x51d63f(0x170),'description':a0_0x51d63f(0x1bd)},'priority':{'type':a0_0x51d63f(0x170),'enum':[a0_0x51d63f(0x1b5),a0_0x51d63f(0x18a),a0_0x51d63f(0x17e)],'description':'Priority\x20(default:\x20normal)'}},'required':[a0_0x51d63f(0x19b),a0_0x51d63f(0x1c1)]}},{'name':a0_0x51d63f(0x1e0),'description':a0_0x51d63f(0x1ba),'inputSchema':{'type':a0_0x51d63f(0x1d3),'properties':{'alias':{'type':'string','description':a0_0x51d63f(0x1d9)},'message':{'type':a0_0x51d63f(0x170),'description':a0_0x51d63f(0x17d)}},'required':['alias','message']}},{'name':a0_0x51d63f(0x18f),'description':'Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','inputSchema':{'type':a0_0x51d63f(0x1d3),'properties':{}}}]}));async function P(_0x4ded7a,_0x15263b){const _0x9c1116=a0_0x51d63f;let _0x125299=await fetch(f+'/mcp',{'method':_0x9c1116(0x1a1),'headers':{'Content-Type':_0x9c1116(0x1d2),'Accept':_0x9c1116(0x1c5),...X?{'Authorization':_0x9c1116(0x1df)+X}:{}},'body':JSON[_0x9c1116(0x1be)]({'jsonrpc':_0x9c1116(0x1cc),'id':0x1,'method':_0x9c1116(0x17c),'params':{'protocolVersion':_0x9c1116(0x1c0),'capabilities':{},'clientInfo':{'name':_0x9c1116(0x1d6),'version':_0x9c1116(0x1ce)}}})});if(!_0x125299['ok']){let _0x3bcf8c=await _0x125299[_0x9c1116(0x1a9)]();return Y(_0x9c1116(0x1dc)+_0x125299[_0x9c1116(0x176)]+'\x20'+_0x3bcf8c[_0x9c1116(0x165)](0x0,0x64)),{'ok':!0x1,'error':_0x9c1116(0x182)+_0x125299['status']};}await _0x125299[_0x9c1116(0x1a9)]();let _0xd24996=(await(await fetch(f+_0x9c1116(0x181),{'method':_0x9c1116(0x1a1),'headers':{'Content-Type':_0x9c1116(0x1d2),'Accept':_0x9c1116(0x1c5),...X?{'Authorization':_0x9c1116(0x1df)+X}:{}},'body':JSON[_0x9c1116(0x1be)]({'jsonrpc':'2.0','id':0x2,'method':_0x9c1116(0x1ea),'params':{'name':_0x4ded7a,'arguments':_0x15263b}})}))[_0x9c1116(0x1a9)]())[_0x9c1116(0x19f)]('\x0a')[_0x9c1116(0x1e1)](_0xefcaa6=>_0xefcaa6['startsWith']('data:\x20'));if(_0xd24996){let _0x3e967f=JSON[_0x9c1116(0x1c7)](_0xd24996['slice'](0x6));return _0x3e967f?.[_0x9c1116(0x1a3)]?.[_0x9c1116(0x175)]?.[0x0]?.['text']?JSON[_0x9c1116(0x1c7)](_0x3e967f[_0x9c1116(0x1a3)]['content'][0x0][_0x9c1116(0x1a9)]):_0x3e967f;}return{'ok':!0x1,'error':_0x9c1116(0x1aa)};}K[a0_0x51d63f(0x15d)](a0_0x79331d,async _0x14d2c1=>{const _0x487a88=a0_0x51d63f;let {name:_0x293598,arguments:_0x7570e9}=_0x14d2c1[_0x487a88(0x1a6)];if(_0x293598===_0x487a88(0x1c2)){let {task_id:_0x33247f,text:_0x3601a7,status:_0x2e2ef2}=_0x7570e9;if(_0x2e2ef2===_0x487a88(0x1d7)||_0x2e2ef2==='failed'||_0x2e2ef2===_0x487a88(0x1e8)){let _0x1c4f42=_0x2e2ef2==='completed'?'replied':_0x2e2ef2,_0x138fc3=_0x33247f?k[_0x487a88(0x19d)](_0x33247f)||_0x487a88(0x190):_0x487a88(0x190),_0x1008cb=await P('send_reply',{'alias':_0x138fc3,'text':_0x3601a7,'in_reply_to':_0x33247f||void 0x0,'status':_0x1c4f42,'from_session':Z});if(_0x33247f)k[_0x487a88(0x1a4)](_0x33247f);return{'content':[{'type':_0x487a88(0x1a9),'text':JSON[_0x487a88(0x1be)](_0x1008cb)}]};}let _0x4fc7ec=await P(_0x487a88(0x1cb),{'resume_id':w,'alias':Z,'status':_0x2e2ef2===_0x487a88(0x1c6)?'blocked':_0x2e2ef2==='error'?_0x487a88(0x1b1):_0x487a88(0x1c8),'task':_0x3601a7['slice'](0x0,0xc8),'output':_0x3601a7});return{'content':[{'type':_0x487a88(0x1a9),'text':JSON['stringify'](_0x4fc7ec)}]};}if(_0x293598===_0x487a88(0x17f)){let {status:_0x356971,task:_0x3bef7a,progress:_0x988567}=_0x7570e9,_0x21daac=await P(_0x487a88(0x1cb),{'resume_id':w,'alias':Z,'status':_0x356971,'task':_0x3bef7a,'progress':_0x988567});return{'content':[{'type':_0x487a88(0x1a9),'text':JSON[_0x487a88(0x1be)](_0x21daac)}]};}if(_0x293598==='commhub_send_task'){let {alias:_0x58ffe7,task:_0x380ae8,priority:_0x47ff69}=_0x7570e9,_0x3d1492=await P(_0x487a88(0x1ab),{'alias':_0x58ffe7,'task':_0x380ae8,'priority':_0x47ff69||_0x487a88(0x18a),'from_session':Z});return{'content':[{'type':_0x487a88(0x1a9),'text':JSON['stringify'](_0x3d1492)}]};}if(_0x293598===_0x487a88(0x1e0)){let {alias:_0x5334e3,message:_0x540662}=_0x7570e9,_0x3c733c=await P('send_message',{'alias':_0x5334e3,'message':_0x540662,'from_session':Z});return{'content':[{'type':_0x487a88(0x1a9),'text':JSON[_0x487a88(0x1be)](_0x3c733c)}]};}if(_0x293598==='commhub_get_all_status'){let _0x177c90=await P('get_all_status',{});return{'content':[{'type':_0x487a88(0x1a9),'text':JSON['stringify'](_0x177c90)}]};}return{'content':[{'type':_0x487a88(0x1a9),'text':JSON[_0x487a88(0x1be)]({'error':_0x487a88(0x171)})}]};});async function u(){const _0x3ee9fc=a0_0x51d63f;let _0x109fab=f+_0x3ee9fc(0x1e2)+encodeURIComponent(Z),_0x5236f0={};if(X)_0x5236f0[_0x3ee9fc(0x19c)]=_0x3ee9fc(0x1df)+X;Y('connecting\x20to\x20'+_0x109fab);while(!0x0){try{let _0x8e24b5=await fetch(_0x109fab,{'headers':_0x5236f0});if(!_0x8e24b5['ok']){Y('SSE\x20error:\x20'+_0x8e24b5['status']+'\x20'+_0x8e24b5[_0x3ee9fc(0x15c)]),await h(0x1388);continue;}let _0x4c720f=_0x8e24b5[_0x3ee9fc(0x16f)]['getReader'](),_0x1e7099=new TextDecoder(),_0x240b40='';while(!0x0){let {done:_0x119cc4,value:_0x11c7cf}=await _0x4c720f[_0x3ee9fc(0x18e)]();if(_0x119cc4)break;_0x240b40+=_0x1e7099[_0x3ee9fc(0x194)](_0x11c7cf,{'stream':!0x0});let _0x2b324f=_0x240b40[_0x3ee9fc(0x19f)]('\x0a\x0a');_0x240b40=_0x2b324f['pop']()||'';for(let _0x229957 of _0x2b324f){let _0x8ed258=_0x229957['split']('\x0a')[_0x3ee9fc(0x1e1)](_0xc2f680=>_0xc2f680[_0x3ee9fc(0x1b0)](_0x3ee9fc(0x1e6)));if(!_0x8ed258)continue;try{let _0x5f4cd0=JSON[_0x3ee9fc(0x1c7)](_0x8ed258[_0x3ee9fc(0x165)](0x6));await S(_0x5f4cd0);}catch(_0x58f1e5){Y(_0x3ee9fc(0x17b)+_0x58f1e5);}}}Y('SSE\x20stream\x20ended,\x20reconnecting...');}catch(_0x67a721){Y(_0x3ee9fc(0x1d4)+_0x67a721);}await h(0xbb8);}}async function S(_0x2ff1a8){const _0x8aedc6=a0_0x51d63f;if(_0x2ff1a8[_0x8aedc6(0x183)]===_0x8aedc6(0x163)){Y(_0x8aedc6(0x187)+Z+'\x22');return;}if(_0x2ff1a8[_0x8aedc6(0x183)]==='new_message'){if(Y(_0x8aedc6(0x1e9)+_0x2ff1a8[_0x8aedc6(0x185)]+':\x20'+_0x2ff1a8[_0x8aedc6(0x161)][_0x8aedc6(0x165)](0x0,0x3c)),await K[_0x8aedc6(0x1cf)]({'method':'notifications/claude/channel','params':{'content':_0x2ff1a8[_0x8aedc6(0x161)],'meta':{'sender':_0x2ff1a8[_0x8aedc6(0x185)]||_0x8aedc6(0x190),'sender_id':_0x8aedc6(0x1d8),'user':_0x2ff1a8[_0x8aedc6(0x185)]||_0x8aedc6(0x190),'priority':_0x8aedc6(0x18a)}}}),_0x2ff1a8[_0x8aedc6(0x1ca)])await P(_0x8aedc6(0x167),{'alias':Z,'message_id':_0x2ff1a8[_0x8aedc6(0x1ca)]});return;}if(_0x2ff1a8[_0x8aedc6(0x183)]===_0x8aedc6(0x172)||_0x2ff1a8[_0x8aedc6(0x183)]===_0x8aedc6(0x15f)){Y('←\x20'+_0x2ff1a8['type']+_0x8aedc6(0x15e)+_0x2ff1a8[_0x8aedc6(0x180)]+_0x8aedc6(0x1b4)+(_0x2ff1a8[_0x8aedc6(0x1d0)]||_0x8aedc6(0x18a)));let _0x4ee615=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0x4ee615?.['ok']&&_0x4ee615[_0x8aedc6(0x169)]?.[_0x8aedc6(0x192)]>0x0)for(let _0x188044 of _0x4ee615['messages']){let _0x2a1c1c={'sender':_0x188044[_0x8aedc6(0x196)]||_0x8aedc6(0x190),'sender_id':'commhub','user':_0x188044[_0x8aedc6(0x196)]||'hub','task_id':_0x188044['id'],'priority':_0x188044[_0x8aedc6(0x1d0)]||'normal'};k[_0x8aedc6(0x16e)](_0x188044['id'],_0x188044[_0x8aedc6(0x196)]||_0x8aedc6(0x190)),await K['notification']({'method':_0x8aedc6(0x1e5),'params':{'content':_0x188044['content'],'meta':_0x2a1c1c}}),Y(_0x8aedc6(0x197)+_0x188044['id']['slice'](0x0,0x8)+_0x8aedc6(0x19a)+_0x188044['from_session']+':\x20'+_0x188044[_0x8aedc6(0x175)][_0x8aedc6(0x165)](0x0,0x3c)),await P('ack_inbox',{'alias':Z,'message_id':_0x188044['id']});}}}async function A(){const _0x5940b6=a0_0x51d63f;let _0x44525f=new a0_0xef4093();await K['connect'](_0x44525f),Y(_0x5940b6(0x160)),Y('starting\x20SSE\x20listener...'),u()[_0x5940b6(0x195)](_0x5abf77=>Y('SSE\x20fatal:\x20'+_0x5abf77)),P(_0x5940b6(0x1cb),{'resume_id':w,'alias':Z,'status':_0x5940b6(0x1cd),'server':a0_0x29d6ec(),'hostname':a0_0x29d6ec(),'agent':_0x5940b6(0x16b),'project_dir':process['cwd'](),'tmux_name':j||void 0x0})['then'](()=>Y(_0x5940b6(0x1e4)+Z+_0x5940b6(0x16d)+w[_0x5940b6(0x165)](0x0,0x8)+')'))['catch'](_0x1f94af=>Y(_0x5940b6(0x1dd)+_0x1f94af)),setInterval(()=>{const _0x55fa6a=_0x5940b6;P('report_status',{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x29d6ec(),'hostname':a0_0x29d6ec(),'agent':_0x55fa6a(0x16b),'project_dir':process[_0x55fa6a(0x1a2)](),'tmux_name':j||void 0x0})['catch'](_0x46a733=>Y(_0x55fa6a(0x1eb)+_0x46a733));},0x2bf20),Y(_0x5940b6(0x1e3));}A()[a0_0x51d63f(0x195)](_0x1588ab=>{const _0x58c150=a0_0x51d63f;Y(_0x58c150(0x1b9)+_0x1588ab),process[_0x58c150(0x166)](0x1);});async function N(){const _0x4da88b=a0_0x51d63f;Y(_0x4da88b(0x1a8)),await P('report_status',{'resume_id':w,'alias':Z,'status':_0x4da88b(0x1b1),'task':_0x4da88b(0x1d1)})[_0x4da88b(0x195)](()=>{}),process[_0x4da88b(0x166)](0x0);}process[a0_0x51d63f(0x1b7)]['on'](a0_0x51d63f(0x198),()=>N()),process['on'](a0_0x51d63f(0x193),()=>N()),process['on'](a0_0x51d63f(0x186),()=>N());
2
+ const a0_0x57451d=a0_0x1972;(function(_0x869728,_0x3927b6){const _0x16fa22=a0_0x1972,_0x2b7234=_0x869728();while(!![]){try{const _0x4d23f1=parseInt(_0x16fa22(0x18a))/0x1+parseInt(_0x16fa22(0x190))/0x2+-parseInt(_0x16fa22(0x164))/0x3*(parseInt(_0x16fa22(0x146))/0x4)+-parseInt(_0x16fa22(0x193))/0x5+-parseInt(_0x16fa22(0x152))/0x6*(-parseInt(_0x16fa22(0x182))/0x7)+-parseInt(_0x16fa22(0x12a))/0x8*(parseInt(_0x16fa22(0x178))/0x9)+-parseInt(_0x16fa22(0x16c))/0xa;if(_0x4d23f1===_0x3927b6)break;else _0x2b7234['push'](_0x2b7234['shift']());}catch(_0x389271){_0x2b7234['push'](_0x2b7234['shift']());}}}(a0_0xe8eb,0x9d35d));import{readFileSync as a0_0x206220,existsSync as a0_0x5d7603}from'fs';import{randomUUID as a0_0x566a92}from'crypto';import{join as a0_0x1c8f56}from'path';import{hostname as a0_0x3d09fc}from'os';import{execSync as a0_0x260441}from'child_process';import{Server as a0_0x3077b1}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0xd6bf8b}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x2bda6e,CallToolRequestSchema as a0_0x1db444}from'@modelcontextprotocol/sdk/types.js';function a0_0xe8eb(){const _0x799b91=['ack_inbox','ENV:\x20URL=','\x20PROJECT_ENV=','read','from','replace','report_status','notification','blocked','stringify','2.0','body','content','from_session','message','completed','warning:\x20could\x20not\x20register:\x20','1518891LPrZuZ','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','in_progress','send_task','SSE\x20error:\x20','startsWith','\x20ALIAS=','Priority\x20(default:\x20normal)','4981860TXFlHW','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','result','get_all_status','tools/call','Target\x20session\x20alias','statusText','new_message',':\x20inbox_count=','get_inbox','commhub-channel','params','1359eZRuQm','task','idle','Reply\x20text\x20/\x20result\x20summary','SIGINT','hub','\x20from\x20','connect','commhub_send_message','inbox_count','7475692UlJBUI','commhub_send_task','commhub_get_all_status','SSE\x20connected\x20as\x20\x22','\x20CWD=','alias','decode','http://127.0.0.1:9200','1035834RZjuzV','Task\x20content','SSE\x20stream\x20ended,\x20reconnecting...','low','length','set','395770mAcTlz','heartbeat\x20failed:\x20','split','1396160NHuKXC','catch','claude-code','end','cwd','→\x20injected\x20task\x20','setRequestHandler','replied','get','.anet','object','write','shutting\x20down,\x20reporting\x20offline...','indexOf','.env','error','SSE\x20connection\x20error:\x20','connected','application/json','Session\x20alias:\x20','tmux\x20display-message\x20-p\x20\x27#S\x27','utf-8','2025-03-26','normal','initialize','MCP\x20stdio\x20connected','parse','Bearer\x20','send_message','starting\x20SSE\x20listener...','commhub_reply','message_id','token','19816WdepkA',']\x20[commhub]\x20','/mcp','notifications/claude/channel','text','cancelled','commhub','CommHub\x20init\x20failed:\x20','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','POST','priority','parse\x20error:\x20','application/json,\x20text/event-stream','0.3.0','type','messages','string','working','none','status','/events/','data:\x20','pop','exit','then','number','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','broadcast','4YTsSaY','failed','SSE\x20fatal:\x20','trim','←\x20message\x20from\x20','\x22\x20(','slice','high','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','no\x20response','find','Authorization','6SerCeG'];a0_0xe8eb=function(){return _0x799b91;};return a0_0xe8eb();}function p(_0x38aae0){const _0x1022b0=a0_0x1972;if(!a0_0x5d7603(_0x38aae0))return;for(let _0x5e08c3 of a0_0x206220(_0x38aae0,_0x1022b0(0x1a8))[_0x1022b0(0x192)]('\x0a')){let _0x1bea49=_0x5e08c3['trim']();if(!_0x1bea49||_0x1bea49[_0x1022b0(0x169)]('#'))continue;let _0x282c24=_0x1bea49[_0x1022b0(0x1a0)]('=');if(_0x282c24<0x0)continue;let _0x24eace=_0x1bea49[_0x1022b0(0x14c)](0x0,_0x282c24)[_0x1022b0(0x149)](),_0x3c51c4=_0x1bea49[_0x1022b0(0x14c)](_0x282c24+0x1)[_0x1022b0(0x149)]()[_0x1022b0(0x158)](/^["']|["']$/g,'');if(!process.env[_0x24eace])process.env[_0x24eace]=_0x3c51c4;}}var C=process.env.HOME||'~',T=a0_0x1c8f56(C,'.claude/channels/commhub');p(a0_0x1c8f56(T,a0_0x57451d(0x1a1)));var L=process[a0_0x57451d(0x197)]()[a0_0x57451d(0x158)](/\//g,'-');p(a0_0x1c8f56(T,L,a0_0x57451d(0x1a1)));function U(){const _0x39e9d4=a0_0x57451d;try{return a0_0x260441(_0x39e9d4(0x1a7),{'encoding':_0x39e9d4(0x1a8),'timeout':0x7d0})[_0x39e9d4(0x149)]();}catch{return'';}}function v(){const _0x44fde6=a0_0x57451d;try{let _0x14b6bc=a0_0x1c8f56(C,_0x44fde6(0x19c),'config.json');if(a0_0x5d7603(_0x14b6bc))return JSON[_0x44fde6(0x1ad)](a0_0x206220(_0x14b6bc,_0x44fde6(0x1a8)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x57451d(0x17d)]||a0_0x57451d(0x189),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x3d09fc(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x566a92(),X=process.env.COMMHUB_TOKEN||H[a0_0x57451d(0x129)]||'';function Y(_0x2a9dd9){const _0x136e58=a0_0x57451d;let _0x2d3a8d=new Date()['toTimeString']()[_0x136e58(0x14c)](0x0,0x8);process['stderr'][_0x136e58(0x19e)]('['+_0x2d3a8d+_0x136e58(0x12b)+_0x2a9dd9+'\x0a');}function a0_0x1972(_0x4f6694,_0x3acfe8){_0x4f6694=_0x4f6694-0x129;const _0xe8eb59=a0_0xe8eb();let _0x1972b5=_0xe8eb59[_0x4f6694];return _0x1972b5;}function h(_0x25e91a){return new Promise(_0x64f7ed=>setTimeout(_0x64f7ed,_0x25e91a));}Y(a0_0x57451d(0x154)+f+a0_0x57451d(0x16a)+Z+'\x20RESUME_ID='+w[a0_0x57451d(0x14c)](0x0,0x8)+'...\x20TMUX='+(j||a0_0x57451d(0x13c))+a0_0x57451d(0x186)+process[a0_0x57451d(0x197)]()+a0_0x57451d(0x155)+L);var k=new Map(),K=new a0_0x3077b1({'name':a0_0x57451d(0x176),'version':a0_0x57451d(0x137)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x57451d(0x14e),a0_0x57451d(0x165),'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_0x57451d(0x1a6)+Z]['join']('\x0a')});K[a0_0x57451d(0x199)](a0_0x2bda6e,async()=>({'tools':[{'name':a0_0x57451d(0x1b1),'description':'Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','inputSchema':{'type':a0_0x57451d(0x19d),'properties':{'task_id':{'type':'string','description':a0_0x57451d(0x16d)},'text':{'type':a0_0x57451d(0x13a),'description':a0_0x57451d(0x17b)},'status':{'type':a0_0x57451d(0x13a),'enum':[a0_0x57451d(0x162),a0_0x57451d(0x147),a0_0x57451d(0x12f),'blocked',a0_0x57451d(0x1a2),a0_0x57451d(0x166)],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':[a0_0x57451d(0x12e)]}},{'name':'commhub_report_status','description':a0_0x57451d(0x144),'inputSchema':{'type':a0_0x57451d(0x19d),'properties':{'status':{'type':'string','enum':['working',a0_0x57451d(0x17a),a0_0x57451d(0x15b),a0_0x57451d(0x1a2)]},'task':{'type':a0_0x57451d(0x13a),'description':'Current\x20task\x20description'},'progress':{'type':a0_0x57451d(0x143),'description':'Progress\x200-100'}},'required':['status']}},{'name':a0_0x57451d(0x183),'description':'Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x57451d(0x13a),'description':'Target\x20session\x20alias'},'task':{'type':'string','description':a0_0x57451d(0x18b)},'priority':{'type':'string','enum':[a0_0x57451d(0x14d),a0_0x57451d(0x1aa),a0_0x57451d(0x18d)],'description':a0_0x57451d(0x16b)}},'required':[a0_0x57451d(0x187),a0_0x57451d(0x179)]}},{'name':a0_0x57451d(0x180),'description':'Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','inputSchema':{'type':a0_0x57451d(0x19d),'properties':{'alias':{'type':'string','description':a0_0x57451d(0x171)},'message':{'type':a0_0x57451d(0x13a),'description':'Message\x20content'}},'required':[a0_0x57451d(0x187),'message']}},{'name':a0_0x57451d(0x184),'description':a0_0x57451d(0x132),'inputSchema':{'type':a0_0x57451d(0x19d),'properties':{}}}]}));async function P(_0x2845b1,_0x22c879){const _0x2e3a04=a0_0x57451d;let _0x514eaa=await fetch(f+_0x2e3a04(0x12c),{'method':_0x2e3a04(0x133),'headers':{'Content-Type':_0x2e3a04(0x1a5),'Accept':_0x2e3a04(0x136),...X?{'Authorization':_0x2e3a04(0x1ae)+X}:{}},'body':JSON[_0x2e3a04(0x15c)]({'jsonrpc':_0x2e3a04(0x15d),'id':0x1,'method':_0x2e3a04(0x1ab),'params':{'protocolVersion':_0x2e3a04(0x1a9),'capabilities':{},'clientInfo':{'name':_0x2e3a04(0x176),'version':_0x2e3a04(0x137)}}})});if(!_0x514eaa['ok']){let _0x57bf48=await _0x514eaa['text']();return Y(_0x2e3a04(0x131)+_0x514eaa['status']+'\x20'+_0x57bf48[_0x2e3a04(0x14c)](0x0,0x64)),{'ok':!0x1,'error':'init\x20failed:\x20'+_0x514eaa[_0x2e3a04(0x13d)]};}await _0x514eaa[_0x2e3a04(0x12e)]();let _0xa9de1d=(await(await fetch(f+_0x2e3a04(0x12c),{'method':_0x2e3a04(0x133),'headers':{'Content-Type':_0x2e3a04(0x1a5),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x2e3a04(0x1ae)+X}:{}},'body':JSON[_0x2e3a04(0x15c)]({'jsonrpc':_0x2e3a04(0x15d),'id':0x2,'method':_0x2e3a04(0x170),'params':{'name':_0x2845b1,'arguments':_0x22c879}})}))[_0x2e3a04(0x12e)]())[_0x2e3a04(0x192)]('\x0a')[_0x2e3a04(0x150)](_0x50080f=>_0x50080f[_0x2e3a04(0x169)]('data:\x20'));if(_0xa9de1d){let _0x3145dd=JSON[_0x2e3a04(0x1ad)](_0xa9de1d['slice'](0x6));return _0x3145dd?.[_0x2e3a04(0x16e)]?.[_0x2e3a04(0x15f)]?.[0x0]?.[_0x2e3a04(0x12e)]?JSON[_0x2e3a04(0x1ad)](_0x3145dd['result']['content'][0x0][_0x2e3a04(0x12e)]):_0x3145dd;}return{'ok':!0x1,'error':_0x2e3a04(0x14f)};}K[a0_0x57451d(0x199)](a0_0x1db444,async _0x4b27e9=>{const _0x539a04=a0_0x57451d;let {name:_0x571a32,arguments:_0x1e9aa2}=_0x4b27e9[_0x539a04(0x177)];if(_0x571a32===_0x539a04(0x1b1)){let {task_id:_0x2f2a98,text:_0x47e89d,status:_0x525687}=_0x1e9aa2;if(_0x525687===_0x539a04(0x162)||_0x525687===_0x539a04(0x147)||_0x525687==='cancelled'){let _0x3f3b03=_0x525687===_0x539a04(0x162)?_0x539a04(0x19a):_0x525687,_0x17f97c=_0x2f2a98?k[_0x539a04(0x19b)](_0x2f2a98)||_0x539a04(0x17d):'hub',_0x18842f=await P('send_reply',{'alias':_0x17f97c,'text':_0x47e89d,'in_reply_to':_0x2f2a98||void 0x0,'status':_0x3f3b03,'from_session':Z});if(_0x2f2a98)k['delete'](_0x2f2a98);return{'content':[{'type':_0x539a04(0x12e),'text':JSON[_0x539a04(0x15c)](_0x18842f)}]};}let _0x3a5fc2=await P(_0x539a04(0x159),{'resume_id':w,'alias':Z,'status':_0x525687===_0x539a04(0x15b)?_0x539a04(0x15b):_0x525687==='error'?_0x539a04(0x1a2):_0x539a04(0x13b),'task':_0x47e89d['slice'](0x0,0xc8),'output':_0x47e89d});return{'content':[{'type':_0x539a04(0x12e),'text':JSON[_0x539a04(0x15c)](_0x3a5fc2)}]};}if(_0x571a32==='commhub_report_status'){let {status:_0x2bfb3e,task:_0x1a3251,progress:_0x140d57}=_0x1e9aa2,_0x6c0806=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x2bfb3e,'task':_0x1a3251,'progress':_0x140d57});return{'content':[{'type':_0x539a04(0x12e),'text':JSON[_0x539a04(0x15c)](_0x6c0806)}]};}if(_0x571a32===_0x539a04(0x183)){let {alias:_0xd8063b,task:_0x25cc1f,priority:_0x406eda}=_0x1e9aa2,_0x2ed575=await P(_0x539a04(0x167),{'alias':_0xd8063b,'task':_0x25cc1f,'priority':_0x406eda||'normal','from_session':Z});return{'content':[{'type':_0x539a04(0x12e),'text':JSON['stringify'](_0x2ed575)}]};}if(_0x571a32===_0x539a04(0x180)){let {alias:_0x378624,message:_0x309315}=_0x1e9aa2,_0x1d41c0=await P(_0x539a04(0x1af),{'alias':_0x378624,'message':_0x309315,'from_session':Z});return{'content':[{'type':_0x539a04(0x12e),'text':JSON[_0x539a04(0x15c)](_0x1d41c0)}]};}if(_0x571a32===_0x539a04(0x184)){let _0x389e8b=await P(_0x539a04(0x16f),{});return{'content':[{'type':_0x539a04(0x12e),'text':JSON['stringify'](_0x389e8b)}]};}return{'content':[{'type':'text','text':JSON[_0x539a04(0x15c)]({'error':'unknown\x20tool'})}]};});async function u(){const _0x5ae65d=a0_0x57451d;let _0x200cc4=f+_0x5ae65d(0x13e)+encodeURIComponent(Z),_0x27f590={};if(X)_0x27f590[_0x5ae65d(0x151)]='Bearer\x20'+X;Y('connecting\x20to\x20'+_0x200cc4);while(!0x0){try{let _0x1e9a63=await fetch(_0x200cc4,{'headers':_0x27f590});if(!_0x1e9a63['ok']){Y(_0x5ae65d(0x168)+_0x1e9a63[_0x5ae65d(0x13d)]+'\x20'+_0x1e9a63[_0x5ae65d(0x172)]),await h(0x1388);continue;}let _0x361c18=_0x1e9a63[_0x5ae65d(0x15e)]['getReader'](),_0x3de34c=new TextDecoder(),_0x5cd995='';while(!0x0){let {done:_0x161b96,value:_0x26d293}=await _0x361c18[_0x5ae65d(0x156)]();if(_0x161b96)break;_0x5cd995+=_0x3de34c[_0x5ae65d(0x188)](_0x26d293,{'stream':!0x0});let _0x36d243=_0x5cd995[_0x5ae65d(0x192)]('\x0a\x0a');_0x5cd995=_0x36d243[_0x5ae65d(0x140)]()||'';for(let _0x1c81af of _0x36d243){let _0x5b99e8=_0x1c81af[_0x5ae65d(0x192)]('\x0a')[_0x5ae65d(0x150)](_0xde1d70=>_0xde1d70[_0x5ae65d(0x169)](_0x5ae65d(0x13f)));if(!_0x5b99e8)continue;try{let _0x136a5e=JSON['parse'](_0x5b99e8[_0x5ae65d(0x14c)](0x6));await S(_0x136a5e);}catch(_0x256ede){Y(_0x5ae65d(0x135)+_0x256ede);}}}Y(_0x5ae65d(0x18c));}catch(_0x452738){Y(_0x5ae65d(0x1a3)+_0x452738);}await h(0xbb8);}}async function S(_0x3bf5f4){const _0x30289a=a0_0x57451d;if(_0x3bf5f4[_0x30289a(0x138)]===_0x30289a(0x1a4)){Y(_0x30289a(0x185)+Z+'\x22');return;}if(_0x3bf5f4[_0x30289a(0x138)]===_0x30289a(0x173)){if(Y(_0x30289a(0x14a)+_0x3bf5f4[_0x30289a(0x157)]+':\x20'+_0x3bf5f4[_0x30289a(0x161)][_0x30289a(0x14c)](0x0,0x3c)),await K['notification']({'method':_0x30289a(0x12d),'params':{'content':_0x3bf5f4[_0x30289a(0x161)],'meta':{'sender':_0x3bf5f4['from']||_0x30289a(0x17d),'sender_id':_0x30289a(0x130),'user':_0x3bf5f4[_0x30289a(0x157)]||_0x30289a(0x17d),'priority':'normal'}}}),_0x3bf5f4[_0x30289a(0x1b2)])await P('ack_inbox',{'alias':Z,'message_id':_0x3bf5f4[_0x30289a(0x1b2)]});return;}if(_0x3bf5f4['type']==='new_task'||_0x3bf5f4[_0x30289a(0x138)]===_0x30289a(0x145)){Y('←\x20'+_0x3bf5f4[_0x30289a(0x138)]+_0x30289a(0x174)+_0x3bf5f4[_0x30289a(0x181)]+'\x20priority='+(_0x3bf5f4['priority']||_0x30289a(0x1aa)));let _0x52d662=await P(_0x30289a(0x175),{'alias':Z,'limit':0x5});if(_0x52d662?.['ok']&&_0x52d662[_0x30289a(0x139)]?.[_0x30289a(0x18e)]>0x0)for(let _0x48baa1 of _0x52d662['messages']){let _0x34d275={'sender':_0x48baa1[_0x30289a(0x160)]||_0x30289a(0x17d),'sender_id':'commhub','user':_0x48baa1[_0x30289a(0x160)]||'hub','task_id':_0x48baa1['id'],'priority':_0x48baa1[_0x30289a(0x134)]||'normal'};k[_0x30289a(0x18f)](_0x48baa1['id'],_0x48baa1[_0x30289a(0x160)]||_0x30289a(0x17d)),await K[_0x30289a(0x15a)]({'method':_0x30289a(0x12d),'params':{'content':_0x48baa1[_0x30289a(0x15f)],'meta':_0x34d275}}),Y(_0x30289a(0x198)+_0x48baa1['id']['slice'](0x0,0x8)+_0x30289a(0x17e)+_0x48baa1['from_session']+':\x20'+_0x48baa1[_0x30289a(0x15f)][_0x30289a(0x14c)](0x0,0x3c)),await P(_0x30289a(0x153),{'alias':Z,'message_id':_0x48baa1['id']});}}}async function A(){const _0x121a19=a0_0x57451d;let _0x492bac=new a0_0xd6bf8b();await K[_0x121a19(0x17f)](_0x492bac),Y(_0x121a19(0x1ac)),Y(_0x121a19(0x1b0)),u()[_0x121a19(0x194)](_0xc0109c=>Y(_0x121a19(0x148)+_0xc0109c)),P(_0x121a19(0x159),{'resume_id':w,'alias':Z,'status':_0x121a19(0x17a),'server':a0_0x3d09fc(),'hostname':a0_0x3d09fc(),'agent':_0x121a19(0x195),'project_dir':process[_0x121a19(0x197)](),'tmux_name':j||void 0x0})[_0x121a19(0x142)](()=>Y('registered\x20as\x20\x22'+Z+_0x121a19(0x14b)+w['slice'](0x0,0x8)+')'))[_0x121a19(0x194)](_0x208ccd=>Y(_0x121a19(0x163)+_0x208ccd)),setInterval(()=>{const _0xe095c6=_0x121a19;P(_0xe095c6(0x159),{'resume_id':w,'alias':Z,'status':_0xe095c6(0x17a),'server':a0_0x3d09fc(),'hostname':a0_0x3d09fc(),'agent':'claude-code','project_dir':process[_0xe095c6(0x197)](),'tmux_name':j||void 0x0})[_0xe095c6(0x194)](_0x52854a=>Y(_0xe095c6(0x191)+_0x52854a));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}A()[a0_0x57451d(0x194)](_0x50be7f=>{const _0x44c69f=a0_0x57451d;Y('fatal:\x20'+_0x50be7f),process[_0x44c69f(0x141)](0x1);});async function N(){const _0x34ee4c=a0_0x57451d;Y(_0x34ee4c(0x19f)),await P(_0x34ee4c(0x159),{'resume_id':w,'alias':Z,'status':_0x34ee4c(0x1a2),'task':'session\x20disconnected'})[_0x34ee4c(0x194)](()=>{}),process[_0x34ee4c(0x141)](0x0);}process['stdin']['on'](a0_0x57451d(0x196),()=>N()),process['on']('SIGTERM',()=>N()),process['on'](a0_0x57451d(0x17c),()=>N());
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.0.3-preview.0",
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.",
3
+ "version": "2.0.3-preview.2",
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",
7
7
  "types": "dist/client.d.ts",
@@ -59,4 +59,4 @@
59
59
  "node-pty": "^1.1.0",
60
60
  "typescript": "^5.0.0"
61
61
  }
62
- }
62
+ }