@sleep2agi/agent-network 2.0.0-preview.4 → 2.0.0-preview.40

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_0x2630a9=a0_0x18cc;function a0_0x22c5(){const _0xa3afb=['resumeId','body','11OqUdOv','2.0','running','get_all_status','connectSSE','url','send_task','new_message','content','now','read','46501XlsVim','46195CkWGVk','replace','tools/call','disconnect','data:\x20','SSE\x20connected','get_inbox','type','/events/','912bmMXex','normal','SSE\x20failed:\x20','token','result','registered','SSE\x20reconnecting\x20in\x20','call','inbox\x20error:\x20','parse','stringify','cwd','split','message','reconnectDelay','65129eKxhqj','sdk-','1328qZjUrS','text','catch','5520948IOuOdE','alias','connected','log','abort','reply','slice','text/event-stream','getAllStatus','min','s...','status','/mcp','14051244dDGXtz','agent','broadcast','Authorization','server','completed','Bearer\x20','offline','heartbeatTimer','new_task','toTimeString','send','sseAbort','emit','connect','1521831spAmpc','task','9cMQGSN','pop','application/json,\x20text/event-stream','heartbeat\x20failed:\x20','application/json','name','heartbeatInterval','8941870RxjHxN','signal','autoConnect','AbortError','34CyFCpy','POST','SSE\x20error:\x20','toString','getReader','sleep'];a0_0x22c5=function(){return _0xa3afb;};return a0_0x22c5();}(function(_0x154844,_0x343708){const _0x4923ac=a0_0x18cc,_0x78fd45=_0x154844();while(!![]){try{const _0x35cbd5=parseInt(_0x4923ac(0x22f))/0x1*(-parseInt(_0x4923ac(0x203))/0x2)+parseInt(_0x4923ac(0x1f6))/0x3+-parseInt(_0x4923ac(0x234))/0x4+-parseInt(_0x4923ac(0x217))/0x5*(-parseInt(_0x4923ac(0x220))/0x6)+-parseInt(_0x4923ac(0x216))/0x7*(-parseInt(_0x4923ac(0x231))/0x8)+parseInt(_0x4923ac(0x1f8))/0x9*(-parseInt(_0x4923ac(0x1ff))/0xa)+-parseInt(_0x4923ac(0x20b))/0xb*(-parseInt(_0x4923ac(0x241))/0xc);if(_0x35cbd5===_0x343708)break;else _0x78fd45['push'](_0x78fd45['shift']());}catch(_0x40f7c0){_0x78fd45['push'](_0x78fd45['shift']());}}}(a0_0x22c5,0xc434f));import{EventEmitter as a0_0x20a7f4}from'events';function a0_0x18cc(_0x548da2,_0x39305d){_0x548da2=_0x548da2-0x1eb;const _0x22c5b8=a0_0x22c5();let _0x18ccf6=_0x22c5b8[_0x548da2];return _0x18ccf6;}import{hostname as a0_0x1be352}from'os';class T extends a0_0x20a7f4{[a0_0x2630a9(0x210)];[a0_0x2630a9(0x235)];['token'];[a0_0x2630a9(0x242)];[a0_0x2630a9(0x209)];[a0_0x2630a9(0x1fe)];[a0_0x2630a9(0x22e)];['heartbeatTimer'];[a0_0x2630a9(0x1f3)];[a0_0x2630a9(0x20d)]=!0x1;constructor(_0x3d48be){const _0x32a1d2=a0_0x2630a9;super();if(this['url']=_0x3d48be[_0x32a1d2(0x210)][_0x32a1d2(0x218)](/\/$/,''),this[_0x32a1d2(0x235)]=_0x3d48be[_0x32a1d2(0x235)],this['token']=_0x3d48be[_0x32a1d2(0x223)],this[_0x32a1d2(0x242)]=_0x3d48be[_0x32a1d2(0x242)]||'sdk',this['resumeId']=_0x32a1d2(0x230)+_0x3d48be['alias']+'-'+Date[_0x32a1d2(0x214)]()[_0x32a1d2(0x206)](0x24),this[_0x32a1d2(0x1fe)]=_0x3d48be[_0x32a1d2(0x1fe)]??0x2bf20,this[_0x32a1d2(0x22e)]=_0x3d48be[_0x32a1d2(0x22e)]??0xbb8,_0x3d48be[_0x32a1d2(0x201)]!==!0x1)this[_0x32a1d2(0x1f5)]();}[a0_0x2630a9(0x237)](_0x2f90c8){const _0xa32dfe=a0_0x2630a9;console[_0xa32dfe(0x237)]('['+new Date()[_0xa32dfe(0x1f1)]()['slice'](0x0,0x8)+']\x20[commhub:'+this[_0xa32dfe(0x235)]+']\x20'+_0x2f90c8);}async[a0_0x2630a9(0x227)](_0x3d17de,_0x4d591a){const _0x4e3280=a0_0x2630a9;let _0x335cfa={'Content-Type':_0x4e3280(0x1fc),'Accept':_0x4e3280(0x1fa)};if(this['token'])_0x335cfa[_0x4e3280(0x244)]=_0x4e3280(0x1ed)+this[_0x4e3280(0x223)];let _0x2e07ce=await(await fetch(this[_0x4e3280(0x210)]+_0x4e3280(0x240),{'method':_0x4e3280(0x204),'headers':_0x335cfa,'body':JSON[_0x4e3280(0x22a)]({'jsonrpc':_0x4e3280(0x20c),'id':Date['now'](),'method':_0x4e3280(0x219),'params':{'name':_0x3d17de,'arguments':_0x4d591a}})}))[_0x4e3280(0x232)](),_0x2f3507=_0x2e07ce['match'](/data: (.+)/),_0x3266c2=_0x2f3507?JSON[_0x4e3280(0x229)](_0x2f3507[0x1]):JSON[_0x4e3280(0x229)](_0x2e07ce),_0x44d7a9=_0x3266c2?.[_0x4e3280(0x224)]?.['content']?.[0x0]?.[_0x4e3280(0x232)];return _0x44d7a9?JSON[_0x4e3280(0x229)](_0x44d7a9):_0x3266c2;}async[a0_0x2630a9(0x1f5)](){const _0x56b8dd=a0_0x2630a9;if(this[_0x56b8dd(0x20d)])return;this[_0x56b8dd(0x20d)]=!0x0,await this['status']('idle'),this[_0x56b8dd(0x237)](_0x56b8dd(0x225)),this[_0x56b8dd(0x1ef)]=setInterval(()=>{const _0x3cb529=_0x56b8dd;this[_0x3cb529(0x23f)]('idle')[_0x3cb529(0x233)](_0x1529c8=>this[_0x3cb529(0x237)](_0x3cb529(0x1fb)+_0x1529c8[_0x3cb529(0x22d)]));},this[_0x56b8dd(0x1fe)]),this[_0x56b8dd(0x20f)]();}async[a0_0x2630a9(0x21a)](){const _0x509e5b=a0_0x2630a9;if(this[_0x509e5b(0x20d)]=!0x1,this[_0x509e5b(0x1f3)]?.[_0x509e5b(0x238)](),this[_0x509e5b(0x1ef)])clearInterval(this[_0x509e5b(0x1ef)]);await this['status'](_0x509e5b(0x1ee))[_0x509e5b(0x233)](()=>{}),this[_0x509e5b(0x237)]('disconnected');}async[a0_0x2630a9(0x1f2)](_0x5b64d3,_0x598ea7,_0x4a1721=a0_0x2630a9(0x221)){const _0x201a1a=a0_0x2630a9;return this['call'](_0x201a1a(0x211),{'alias':_0x5b64d3,'task':_0x598ea7,'priority':_0x4a1721,'from_session':this['alias']});}async[a0_0x2630a9(0x22d)](_0x11aa12,_0x3b943d){const _0x8b63f1=a0_0x2630a9;return this[_0x8b63f1(0x227)]('send_message',{'alias':_0x11aa12,'message':_0x3b943d,'from_session':this[_0x8b63f1(0x235)]});}async[a0_0x2630a9(0x239)](_0x14afee,_0x52c3c6,_0xdaa83e=a0_0x2630a9(0x1ec)){const _0x37cbfb=a0_0x2630a9;return this[_0x37cbfb(0x227)](_0x37cbfb(0x239),{'task_id':_0x14afee,'text':_0x52c3c6,'status':_0xdaa83e});}async[a0_0x2630a9(0x23f)](_0x4b4f9e,_0x4ec86b){const _0x411cae=a0_0x2630a9;return this[_0x411cae(0x227)]('report_status',{'resume_id':this['resumeId'],'alias':this['alias'],'status':_0x4b4f9e,'server':a0_0x1be352(),'hostname':a0_0x1be352(),'agent':this[_0x411cae(0x242)],'project_dir':process[_0x411cae(0x22b)](),..._0x4ec86b});}async[a0_0x2630a9(0x23c)](){const _0x1969ef=a0_0x2630a9;return this['call'](_0x1969ef(0x20e),{});}async[a0_0x2630a9(0x243)](_0x343e1f,_0x55fd04){const _0x567aaa=a0_0x2630a9;return this['call'](_0x567aaa(0x243),{'message':_0x343e1f,'filter_server':_0x55fd04?.[_0x567aaa(0x1eb)],'filter_status':_0x55fd04?.['status']});}async[a0_0x2630a9(0x20f)](){const _0x2e3890=a0_0x2630a9;let _0x5b332c=encodeURIComponent(this['alias']),_0x529a45=this['url']+_0x2e3890(0x21f)+_0x5b332c,_0x218096=this[_0x2e3890(0x22e)];while(this[_0x2e3890(0x20d)]){try{this[_0x2e3890(0x1f3)]=new AbortController();let _0x1afc2a={'Accept':_0x2e3890(0x23b)};if(this[_0x2e3890(0x223)])_0x1afc2a[_0x2e3890(0x244)]=_0x2e3890(0x1ed)+this[_0x2e3890(0x223)];let _0x46c82f=await fetch(_0x529a45,{'headers':_0x1afc2a,'signal':this['sseAbort'][_0x2e3890(0x200)]});if(!_0x46c82f['ok']||!_0x46c82f[_0x2e3890(0x20a)]){this[_0x2e3890(0x237)](_0x2e3890(0x222)+_0x46c82f['status']),await this['sleep'](_0x218096),_0x218096=Math['min'](_0x218096*1.5,0xea60);continue;}_0x218096=this[_0x2e3890(0x22e)];let _0x407526=_0x46c82f[_0x2e3890(0x20a)][_0x2e3890(0x207)](),_0x41c1fc=new TextDecoder(),_0x2e9126='';while(this[_0x2e3890(0x20d)]){let {done:_0x37447f,value:_0x134061}=await _0x407526[_0x2e3890(0x215)]();if(_0x37447f)break;_0x2e9126+=_0x41c1fc['decode'](_0x134061,{'stream':!0x0});let _0x65da85=_0x2e9126[_0x2e3890(0x22c)]('\x0a');_0x2e9126=_0x65da85[_0x2e3890(0x1f9)]()||'';for(let _0x24ba26 of _0x65da85){if(!_0x24ba26['startsWith'](_0x2e3890(0x21b)))continue;try{let _0x59977a=JSON['parse'](_0x24ba26[_0x2e3890(0x23a)](0x6));if(_0x59977a[_0x2e3890(0x21e)]===_0x2e3890(0x236)){this[_0x2e3890(0x237)](_0x2e3890(0x21c)),this[_0x2e3890(0x1f4)](_0x2e3890(0x236));continue;}if(_0x59977a[_0x2e3890(0x21e)]===_0x2e3890(0x1f0)||_0x59977a['type']===_0x2e3890(0x212)||_0x59977a[_0x2e3890(0x21e)]===_0x2e3890(0x243))await this['processInbox']();}catch{}}}}catch(_0x3fa388){if(_0x3fa388[_0x2e3890(0x1fd)]===_0x2e3890(0x202))break;this[_0x2e3890(0x1f4)]('error',_0x3fa388),this[_0x2e3890(0x237)](_0x2e3890(0x205)+_0x3fa388['message']);}if(this['running'])this[_0x2e3890(0x1f4)]('disconnected'),this[_0x2e3890(0x237)](_0x2e3890(0x226)+_0x218096/0x3e8+_0x2e3890(0x23e)),await this['sleep'](_0x218096),_0x218096=Math[_0x2e3890(0x23d)](_0x218096*1.5,0xea60);}}async['processInbox'](){const _0x1fcf8c=a0_0x2630a9;try{let _0x119414=(await this[_0x1fcf8c(0x227)](_0x1fcf8c(0x21d),{'alias':this[_0x1fcf8c(0x235)],'limit':0xa}))?.['messages']||[];for(let _0x4f881f of _0x119414)await this[_0x1fcf8c(0x227)]('ack_inbox',{'alias':this[_0x1fcf8c(0x235)],'message_id':_0x4f881f['id']}),this[_0x1fcf8c(0x237)]('←\x20'+_0x4f881f['from_session']+':\x20'+_0x4f881f[_0x1fcf8c(0x213)][_0x1fcf8c(0x23a)](0x0,0x3c)),this[_0x1fcf8c(0x1f4)](_0x1fcf8c(0x1f7),_0x4f881f),this[_0x1fcf8c(0x1f4)](_0x1fcf8c(0x22d),_0x4f881f);}catch(_0x1268ea){this[_0x1fcf8c(0x237)](_0x1fcf8c(0x228)+_0x1268ea['message']);}}[a0_0x2630a9(0x208)](_0x208308){return new Promise(_0x43f8a4=>setTimeout(_0x43f8a4,_0x208308));}}var $=T;export{$ as default,T as CommHub};
1
+ const a0_0x298038=a0_0x844e;(function(_0x47e18e,_0x321f08){const _0x541743=a0_0x844e,_0x3928a8=_0x47e18e();while(!![]){try{const _0x474772=-parseInt(_0x541743(0x217))/0x1*(parseInt(_0x541743(0x1c8))/0x2)+parseInt(_0x541743(0x1fc))/0x3*(-parseInt(_0x541743(0x1d3))/0x4)+parseInt(_0x541743(0x202))/0x5*(-parseInt(_0x541743(0x1ce))/0x6)+-parseInt(_0x541743(0x20b))/0x7+-parseInt(_0x541743(0x221))/0x8+parseInt(_0x541743(0x207))/0x9*(parseInt(_0x541743(0x1ea))/0xa)+parseInt(_0x541743(0x1cd))/0xb;if(_0x474772===_0x321f08)break;else _0x3928a8['push'](_0x3928a8['shift']());}catch(_0x4841f5){_0x3928a8['push'](_0x3928a8['shift']());}}}(a0_0x689f,0xa2a6c));import{EventEmitter as a0_0xbd7976}from'events';import{hostname as a0_0x5c5f04}from'os';class T extends a0_0xbd7976{[a0_0x298038(0x1de)];[a0_0x298038(0x1f3)];['token'];[a0_0x298038(0x1cc)];['resumeId'];['heartbeatInterval'];[a0_0x298038(0x208)];['heartbeatTimer'];['sseAbort'];[a0_0x298038(0x20f)]=!0x1;constructor(_0x249385){const _0x1ac48e=a0_0x298038;super();if(this['url']=_0x249385[_0x1ac48e(0x1de)][_0x1ac48e(0x21c)](/\/$/,''),this[_0x1ac48e(0x1f3)]=_0x249385[_0x1ac48e(0x1f3)],this[_0x1ac48e(0x1dc)]=_0x249385[_0x1ac48e(0x1dc)],this[_0x1ac48e(0x1cc)]=_0x249385[_0x1ac48e(0x1cc)]||_0x1ac48e(0x1ef),this['resumeId']=_0x1ac48e(0x20a)+_0x249385[_0x1ac48e(0x1f3)]+'-'+Date['now']()[_0x1ac48e(0x1e5)](0x24),this[_0x1ac48e(0x1d2)]=_0x249385['heartbeatInterval']??0x2bf20,this['reconnectDelay']=_0x249385[_0x1ac48e(0x208)]??0xbb8,_0x249385['autoConnect']!==!0x1)this[_0x1ac48e(0x1e8)]();}['log'](_0x343226){const _0x1f43e3=a0_0x298038;console[_0x1f43e3(0x216)]('['+new Date()[_0x1f43e3(0x200)]()[_0x1f43e3(0x1c7)](0x0,0x8)+_0x1f43e3(0x1f0)+this[_0x1f43e3(0x1f3)]+']\x20'+_0x343226);}async[a0_0x298038(0x1f7)](_0x2ee2e4,_0x295580){const _0x4d2257=a0_0x298038;let _0xeb18ba={'Content-Type':_0x4d2257(0x203),'Accept':_0x4d2257(0x21a)};if(this['token'])_0xeb18ba[_0x4d2257(0x21f)]=_0x4d2257(0x1d6)+this[_0x4d2257(0x1dc)];let _0x15dca2=await(await fetch(this[_0x4d2257(0x1de)]+_0x4d2257(0x210),{'method':_0x4d2257(0x1e7),'headers':_0xeb18ba,'body':JSON['stringify']({'jsonrpc':_0x4d2257(0x1f2),'id':Date[_0x4d2257(0x21b)](),'method':_0x4d2257(0x20c),'params':{'name':_0x2ee2e4,'arguments':_0x295580}})}))[_0x4d2257(0x1db)](),_0x46a0da=_0x15dca2[_0x4d2257(0x1fd)](/data: (.+)/),_0x1c0f53=_0x46a0da?JSON[_0x4d2257(0x209)](_0x46a0da[0x1]):JSON[_0x4d2257(0x209)](_0x15dca2),_0x22a5d6=_0x1c0f53?.[_0x4d2257(0x1c6)]?.[_0x4d2257(0x1da)]?.[0x0]?.[_0x4d2257(0x1db)];return _0x22a5d6?JSON[_0x4d2257(0x209)](_0x22a5d6):_0x1c0f53;}async['connect'](){const _0x156bac=a0_0x298038;if(this[_0x156bac(0x20f)])return;this[_0x156bac(0x20f)]=!0x0,await this[_0x156bac(0x1d0)](_0x156bac(0x215)),this[_0x156bac(0x216)](_0x156bac(0x1e9)),this[_0x156bac(0x1e2)]=setInterval(()=>{const _0x114324=_0x156bac;this[_0x114324(0x1d0)](_0x114324(0x215))[_0x114324(0x1f1)](_0x4bbaf0=>this[_0x114324(0x216)]('heartbeat\x20failed:\x20'+_0x4bbaf0[_0x114324(0x213)]));},this[_0x156bac(0x1d2)]),this[_0x156bac(0x206)]();}async[a0_0x298038(0x1fb)](){const _0x164c59=a0_0x298038;if(this[_0x164c59(0x20f)]=!0x1,this['sseAbort']?.[_0x164c59(0x1d4)](),this['heartbeatTimer'])clearInterval(this[_0x164c59(0x1e2)]);await this[_0x164c59(0x1d0)](_0x164c59(0x1f6))[_0x164c59(0x1f1)](()=>{}),this[_0x164c59(0x216)](_0x164c59(0x201));}async[a0_0x298038(0x1d8)](_0x3e5e7e,_0xbed985,_0x30aa73=a0_0x298038(0x1df)){const _0x1566dc=a0_0x298038;return this['call'](_0x1566dc(0x1e3),{'alias':_0x3e5e7e,'task':_0xbed985,'priority':_0x30aa73,'from_session':this['alias']});}async[a0_0x298038(0x213)](_0xad7019,_0x4150c1){const _0x345318=a0_0x298038;return this[_0x345318(0x1f7)](_0x345318(0x1d7),{'alias':_0xad7019,'message':_0x4150c1,'from_session':this[_0x345318(0x1f3)]});}async[a0_0x298038(0x1c9)](_0x153c2c,_0x39f37c,_0xecb8bd=a0_0x298038(0x204)){const _0x53f3e2=a0_0x298038;return this[_0x53f3e2(0x1f7)](_0x53f3e2(0x1c9),{'task_id':_0x153c2c,'text':_0x39f37c,'status':_0xecb8bd});}async['status'](_0x997aaa,_0x2f31da){const _0x2fa857=a0_0x298038;return this[_0x2fa857(0x1f7)](_0x2fa857(0x219),{'resume_id':this['resumeId'],'alias':this[_0x2fa857(0x1f3)],'status':_0x997aaa,'server':a0_0x5c5f04(),'hostname':a0_0x5c5f04(),'agent':this[_0x2fa857(0x1cc)],'project_dir':process[_0x2fa857(0x220)](),..._0x2f31da});}async[a0_0x298038(0x1d5)](){const _0x20ab33=a0_0x298038;return this[_0x20ab33(0x1f7)](_0x20ab33(0x1e4),{});}async[a0_0x298038(0x1eb)](_0x7a51f9,_0x862717){const _0x49d5db=a0_0x298038;return this['call'](_0x49d5db(0x1eb),{'message':_0x7a51f9,'filter_server':_0x862717?.[_0x49d5db(0x1c5)],'filter_status':_0x862717?.['status']});}async['connectSSE'](){const _0x17a1e7=a0_0x298038;let _0x16da5a=encodeURIComponent(this[_0x17a1e7(0x1f3)]),_0x3a04c9=this[_0x17a1e7(0x1de)]+'/events/'+_0x16da5a,_0x39b13b=this[_0x17a1e7(0x208)];while(this[_0x17a1e7(0x20f)]){try{this[_0x17a1e7(0x211)]=new AbortController();let _0x1d1e81={'Accept':_0x17a1e7(0x21d)};if(this['token'])_0x1d1e81[_0x17a1e7(0x21f)]=_0x17a1e7(0x1d6)+this['token'];let _0x3b2a62=await fetch(_0x3a04c9,{'headers':_0x1d1e81,'signal':this[_0x17a1e7(0x211)][_0x17a1e7(0x212)]});if(!_0x3b2a62['ok']||!_0x3b2a62[_0x17a1e7(0x1ee)]){this[_0x17a1e7(0x216)](_0x17a1e7(0x1ed)+_0x3b2a62[_0x17a1e7(0x1d0)]),await this[_0x17a1e7(0x1ca)](_0x39b13b),_0x39b13b=Math[_0x17a1e7(0x1fe)](_0x39b13b*1.5,0xea60);continue;}_0x39b13b=this[_0x17a1e7(0x208)];let _0x2b9740=_0x3b2a62[_0x17a1e7(0x1ee)][_0x17a1e7(0x1ff)](),_0x136b35=new TextDecoder(),_0x4555b8='';while(this[_0x17a1e7(0x20f)]){let {done:_0x4b4495,value:_0x2d9118}=await _0x2b9740[_0x17a1e7(0x1f9)]();if(_0x4b4495)break;_0x4555b8+=_0x136b35[_0x17a1e7(0x1cf)](_0x2d9118,{'stream':!0x0});let _0x3dc7e4=_0x4555b8['split']('\x0a');_0x4555b8=_0x3dc7e4[_0x17a1e7(0x1d9)]()||'';for(let _0x308ad0 of _0x3dc7e4){if(!_0x308ad0[_0x17a1e7(0x1ec)](_0x17a1e7(0x1d1)))continue;try{let _0x4beab9=JSON[_0x17a1e7(0x209)](_0x308ad0[_0x17a1e7(0x1c7)](0x6));if(_0x4beab9[_0x17a1e7(0x1cb)]===_0x17a1e7(0x1f8)){this[_0x17a1e7(0x216)](_0x17a1e7(0x1f5)),this[_0x17a1e7(0x205)](_0x17a1e7(0x1f8));continue;}if(_0x4beab9[_0x17a1e7(0x1cb)]==='new_task'||_0x4beab9[_0x17a1e7(0x1cb)]==='new_message'||_0x4beab9[_0x17a1e7(0x1cb)]===_0x17a1e7(0x1eb))await this['processInbox']();}catch{}}}}catch(_0x5e4d30){if(_0x5e4d30[_0x17a1e7(0x1e6)]===_0x17a1e7(0x218))break;this['emit'](_0x17a1e7(0x1dd),_0x5e4d30),this[_0x17a1e7(0x216)](_0x17a1e7(0x20e)+_0x5e4d30[_0x17a1e7(0x213)]);}if(this[_0x17a1e7(0x20f)])this['emit'](_0x17a1e7(0x201)),this[_0x17a1e7(0x216)]('SSE\x20reconnecting\x20in\x20'+_0x39b13b/0x3e8+_0x17a1e7(0x214)),await this['sleep'](_0x39b13b),_0x39b13b=Math[_0x17a1e7(0x1fe)](_0x39b13b*1.5,0xea60);}}async[a0_0x298038(0x20d)](){const _0x2723ba=a0_0x298038;try{let _0x64f9f3=(await this[_0x2723ba(0x1f7)](_0x2723ba(0x1e0),{'alias':this['alias'],'limit':0xa}))?.['messages']||[];for(let _0x3534c4 of _0x64f9f3)await this[_0x2723ba(0x1f7)](_0x2723ba(0x1f4),{'alias':this[_0x2723ba(0x1f3)],'message_id':_0x3534c4['id']}),this[_0x2723ba(0x216)]('←\x20'+_0x3534c4[_0x2723ba(0x1fa)]+':\x20'+_0x3534c4[_0x2723ba(0x1da)][_0x2723ba(0x1c7)](0x0,0x3c)),this[_0x2723ba(0x205)](_0x2723ba(0x21e),_0x3534c4),this[_0x2723ba(0x205)](_0x2723ba(0x213),_0x3534c4);}catch(_0x5e05fa){this[_0x2723ba(0x216)](_0x2723ba(0x1e1)+_0x5e05fa[_0x2723ba(0x213)]);}}[a0_0x298038(0x1ca)](_0xb9bdfb){return new Promise(_0x8ab1ec=>setTimeout(_0x8ab1ec,_0xb9bdfb));}}function a0_0x844e(_0xe5c5c3,_0x2ba97a){_0xe5c5c3=_0xe5c5c3-0x1c5;const _0x689f97=a0_0x689f();let _0x844e9c=_0x689f97[_0xe5c5c3];return _0x844e9c;}function a0_0x689f(){const _0x548a9f=['broadcast','startsWith','SSE\x20failed:\x20','body','sdk',']\x20[commhub:','catch','2.0','alias','ack_inbox','SSE\x20connected','offline','call','connected','read','from_session','disconnect','3iqYjaG','match','min','getReader','toTimeString','disconnected','147145bNaArm','application/json','completed','emit','connectSSE','10139517SGNPRc','reconnectDelay','parse','sdk-','2019465OhJulc','tools/call','processInbox','SSE\x20error:\x20','running','/mcp','sseAbort','signal','message','s...','idle','log','95689DGlqft','AbortError','report_status','application/json,\x20text/event-stream','now','replace','text/event-stream','task','Authorization','cwd','5343216VpQBga','server','result','slice','2jQXPDZ','reply','sleep','type','agent','17982459oSYKhL','138vZUsfr','decode','status','data:\x20','heartbeatInterval','1464836FZzJHn','abort','getAllStatus','Bearer\x20','send_message','send','pop','content','text','token','error','url','normal','get_inbox','inbox\x20error:\x20','heartbeatTimer','send_task','get_all_status','toString','name','POST','connect','registered','10AbKlWH'];a0_0x689f=function(){return _0x548a9f;};return a0_0x689f();}var $=T;export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- function a0_0x380a(){const _0x3e75bc=['36MlRZMV','cancelled','message','application/json,\x20text/event-stream','find','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','no\x20response','commhub_send_task','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','pop',':\x20inbox_count=','status','failed','slice','.env','SSE\x20connected\x20as\x20\x22','number','replace','Reply\x20text\x20/\x20result\x20summary','blocked','broadcast','split','←\x20message\x20from\x20','replied','in_progress','send_task','unknown\x20tool','hub','config.json','stringify','session\x20disconnected','indexOf','1537833LIhzQU','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','task','utf-8','type','heartbeat\x20failed:\x20','new_message','send_reply','ack_inbox','send_message','messages','join','fatal:\x20','\x20priority=','catch','working','length','message_id','Target\x20session\x20alias','.anet','MCP\x20stdio\x20connected','string','notification','Bearer\x20','POST','http://127.0.0.1:9200','get','commhub_reply','error','new_task','SSE\x20fatal:\x20','startsWith','result','get_all_status','idle','completed','getReader','/mcp','32ospNpH','data:\x20','stdin','\x20from\x20','commhub_send_message','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','from','claude-code','cwd','shutting\x20down,\x20reporting\x20offline...','report_status','priority','from_session','2.0','initialize','commhub-channel','low','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','text','init\x20failed:\x20','\x22\x20(','/events/','setRequestHandler','5211dIVUBw','high','2025-03-26','end','SSE\x20stream\x20ended,\x20reconnecting...','→\x20injected\x20task\x20','token','ready\x20—\x20waiting\x20for\x20events','\x20CWD=','object','3689735WTsjNS','tools/call','then','get_inbox','connect','1616832KzyIpE','trim','notifications/claude/channel','inbox_count','commhub_get_all_status','registered\x20as\x20\x22','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','Session\x20alias:\x20','Priority\x20(default:\x20normal)','144cXKerl','2233GajMay','SSE\x20error:\x20','6699760xXOrsE','commhub','178qbSVQA','parse','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','starting\x20SSE\x20listener...','Progress\x200-100','body','commhub_report_status','content','normal','9369lTUWbX','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','\x20RESUME_ID=','15294xTPBYE'];a0_0x380a=function(){return _0x3e75bc;};return a0_0x380a();}const a0_0x662eba=a0_0x2ad0;(function(_0x3c8205,_0xb34067){const _0x193798=a0_0x2ad0,_0x377129=_0x3c8205();while(!![]){try{const _0x5e333b=-parseInt(_0x193798(0x23c))/0x1*(-parseInt(_0x193798(0x259))/0x2)+parseInt(_0x193798(0x1db))/0x3*(parseInt(_0x193798(0x1df))/0x4)+parseInt(_0x193798(0x246))/0x5+parseInt(_0x193798(0x1de))/0x6*(parseInt(_0x193798(0x255))/0x7)+-parseInt(_0x193798(0x225))/0x8*(-parseInt(_0x193798(0x24b))/0x9)+-parseInt(_0x193798(0x257))/0xa+parseInt(_0x193798(0x1ff))/0xb*(-parseInt(_0x193798(0x254))/0xc);if(_0x5e333b===_0xb34067)break;else _0x377129['push'](_0x377129['shift']());}catch(_0xa2a0cb){_0x377129['push'](_0x377129['shift']());}}}(a0_0x380a,0x650f8));import{readFileSync as a0_0xbb5b7,existsSync as a0_0x140c4b}from'fs';import{join as a0_0x1516f9}from'path';import{hostname as a0_0x584493}from'os';import{execSync as a0_0x36b5cf}from'child_process';import{Server as a0_0x15d5b7}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x5397f0}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x52eddb,CallToolRequestSchema as a0_0x578a26}from'@modelcontextprotocol/sdk/types.js';function p(_0x467110){const _0x463a79=a0_0x2ad0;if(!a0_0x140c4b(_0x467110))return;for(let _0x50cf14 of a0_0xbb5b7(_0x467110,_0x463a79(0x202))[_0x463a79(0x1f4)]('\x0a')){let _0x3b01db=_0x50cf14[_0x463a79(0x24c)]();if(!_0x3b01db||_0x3b01db['startsWith']('#'))continue;let _0x33c00c=_0x3b01db[_0x463a79(0x1fe)]('=');if(_0x33c00c<0x0)continue;let _0x377d3b=_0x3b01db[_0x463a79(0x1ec)](0x0,_0x33c00c)[_0x463a79(0x24c)](),_0x2048d3=_0x3b01db[_0x463a79(0x1ec)](_0x33c00c+0x1)[_0x463a79(0x24c)]()[_0x463a79(0x1f0)](/^["']|["']$/g,'');if(!process.env[_0x377d3b])process.env[_0x377d3b]=_0x2048d3;}}var C=process.env.HOME||'~',T=a0_0x1516f9(C,'.claude/channels/commhub');p(a0_0x1516f9(T,a0_0x662eba(0x1ed)));function a0_0x2ad0(_0x39a1fb,_0x421fbe){_0x39a1fb=_0x39a1fb-0x1d8;const _0x380aaa=a0_0x380a();let _0x2ad0e8=_0x380aaa[_0x39a1fb];return _0x2ad0e8;}var L=process[a0_0x662eba(0x22d)]()['replace'](/\//g,'-');p(a0_0x1516f9(T,L,a0_0x662eba(0x1ed)));function U(){const _0x4e3db6=a0_0x662eba;try{return a0_0x36b5cf('tmux\x20display-message\x20-p\x20\x27#S\x27',{'encoding':_0x4e3db6(0x202),'timeout':0x7d0})[_0x4e3db6(0x24c)]();}catch{return'';}}function c(){const _0x14bfa1=a0_0x662eba;try{let _0x4c74e4=a0_0x1516f9(C,_0x14bfa1(0x212),_0x14bfa1(0x1fb));if(a0_0x140c4b(_0x4c74e4))return JSON['parse'](a0_0xbb5b7(_0x4c74e4,_0x14bfa1(0x202)));}catch{}return{};}var H=c(),D=process.env.COMMHUB_URL||H[a0_0x662eba(0x1fa)]||a0_0x662eba(0x218),f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0x584493(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto['randomUUID'](),X=process.env.COMMHUB_TOKEN||H[a0_0x662eba(0x242)]||'';function Y(_0x3956e3){const _0x17f0a3=a0_0x662eba;let _0x36b965=new Date()['toTimeString']()[_0x17f0a3(0x1ec)](0x0,0x8);process['stderr']['write']('['+_0x36b965+']\x20[commhub]\x20'+_0x3956e3+'\x0a');}function h(_0x16eb01){return new Promise(_0x1dcd78=>setTimeout(_0x1dcd78,_0x16eb01));}Y('ENV:\x20URL='+D+'\x20ALIAS='+Z+a0_0x662eba(0x1dd)+w[a0_0x662eba(0x1ec)](0x0,0x8)+'...\x20TMUX='+(f||'none')+a0_0x662eba(0x244)+process[a0_0x662eba(0x22d)]()+'\x20PROJECT_ENV='+L);var k=new Map(),K=new a0_0x15d5b7({'name':a0_0x662eba(0x234),'version':'0.3.0'},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x662eba(0x22a),'These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.',a0_0x662eba(0x200),a0_0x662eba(0x25b),a0_0x662eba(0x252)+Z][a0_0x662eba(0x20a)]('\x0a')});K[a0_0x662eba(0x23b)](a0_0x52eddb,async()=>({'tools':[{'name':a0_0x662eba(0x21a),'description':a0_0x662eba(0x1e4),'inputSchema':{'type':'object','properties':{'task_id':{'type':a0_0x662eba(0x214),'description':a0_0x662eba(0x236)},'text':{'type':'string','description':a0_0x662eba(0x1f1)},'status':{'type':'string','enum':[a0_0x662eba(0x222),a0_0x662eba(0x1eb),a0_0x662eba(0x1e0),a0_0x662eba(0x1f2),a0_0x662eba(0x21b),a0_0x662eba(0x1f7)],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':['text']}},{'name':a0_0x662eba(0x1d8),'description':a0_0x662eba(0x251),'inputSchema':{'type':a0_0x662eba(0x245),'properties':{'status':{'type':a0_0x662eba(0x214),'enum':[a0_0x662eba(0x20e),'idle','blocked',a0_0x662eba(0x21b)]},'task':{'type':a0_0x662eba(0x214),'description':'Current\x20task\x20description'},'progress':{'type':a0_0x662eba(0x1ef),'description':a0_0x662eba(0x25d)}},'required':[a0_0x662eba(0x1ea)]}},{'name':a0_0x662eba(0x1e6),'description':'Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x662eba(0x214),'description':'Target\x20session\x20alias'},'task':{'type':a0_0x662eba(0x214),'description':'Task\x20content'},'priority':{'type':'string','enum':[a0_0x662eba(0x23d),a0_0x662eba(0x1da),a0_0x662eba(0x235)],'description':a0_0x662eba(0x253)}},'required':['alias',a0_0x662eba(0x201)]}},{'name':a0_0x662eba(0x229),'description':a0_0x662eba(0x1dc),'inputSchema':{'type':a0_0x662eba(0x245),'properties':{'alias':{'type':a0_0x662eba(0x214),'description':a0_0x662eba(0x211)},'message':{'type':'string','description':'Message\x20content'}},'required':['alias','message']}},{'name':a0_0x662eba(0x24f),'description':a0_0x662eba(0x1e7),'inputSchema':{'type':a0_0x662eba(0x245),'properties':{}}}]}));async function P(_0x33190f,_0x27364f){const _0xad1ffd=a0_0x662eba;let _0xe871f4=await fetch(D+'/mcp',{'method':_0xad1ffd(0x217),'headers':{'Content-Type':'application/json','Accept':_0xad1ffd(0x1e2),...X?{'Authorization':_0xad1ffd(0x216)+X}:{}},'body':JSON[_0xad1ffd(0x1fc)]({'jsonrpc':_0xad1ffd(0x232),'id':0x1,'method':_0xad1ffd(0x233),'params':{'protocolVersion':_0xad1ffd(0x23e),'capabilities':{},'clientInfo':{'name':_0xad1ffd(0x234),'version':'0.3.0'}}})});if(!_0xe871f4['ok']){let _0x248afd=await _0xe871f4[_0xad1ffd(0x237)]();return Y('CommHub\x20init\x20failed:\x20'+_0xe871f4[_0xad1ffd(0x1ea)]+'\x20'+_0x248afd[_0xad1ffd(0x1ec)](0x0,0x64)),{'ok':!0x1,'error':_0xad1ffd(0x238)+_0xe871f4[_0xad1ffd(0x1ea)]};}await _0xe871f4[_0xad1ffd(0x237)]();let _0x4aa628=(await(await fetch(D+_0xad1ffd(0x224),{'method':'POST','headers':{'Content-Type':'application/json','Accept':_0xad1ffd(0x1e2),...X?{'Authorization':_0xad1ffd(0x216)+X}:{}},'body':JSON['stringify']({'jsonrpc':_0xad1ffd(0x232),'id':0x2,'method':_0xad1ffd(0x247),'params':{'name':_0x33190f,'arguments':_0x27364f}})}))[_0xad1ffd(0x237)]())[_0xad1ffd(0x1f4)]('\x0a')['find'](_0xe2eb3d=>_0xe2eb3d[_0xad1ffd(0x21e)]('data:\x20'));if(_0x4aa628){let _0x5d3fc1=JSON[_0xad1ffd(0x25a)](_0x4aa628[_0xad1ffd(0x1ec)](0x6));return _0x5d3fc1?.[_0xad1ffd(0x21f)]?.[_0xad1ffd(0x1d9)]?.[0x0]?.[_0xad1ffd(0x237)]?JSON['parse'](_0x5d3fc1[_0xad1ffd(0x21f)][_0xad1ffd(0x1d9)][0x0]['text']):_0x5d3fc1;}return{'ok':!0x1,'error':_0xad1ffd(0x1e5)};}K[a0_0x662eba(0x23b)](a0_0x578a26,async _0x34b487=>{const _0x8337af=a0_0x662eba;let {name:_0x39cf87,arguments:_0x3fc3d1}=_0x34b487['params'];if(_0x39cf87===_0x8337af(0x21a)){let {task_id:_0x5630e7,text:_0x537946,status:_0x1cb157}=_0x3fc3d1;if(_0x1cb157===_0x8337af(0x222)||_0x1cb157===_0x8337af(0x1eb)||_0x1cb157==='cancelled'){let _0x3dccda=_0x1cb157===_0x8337af(0x222)?_0x8337af(0x1f6):_0x1cb157,_0x260dcf=_0x5630e7?k[_0x8337af(0x219)](_0x5630e7)||'hub':_0x8337af(0x1fa),_0x5e9f62=await P(_0x8337af(0x206),{'alias':_0x260dcf,'text':_0x537946,'in_reply_to':_0x5630e7||void 0x0,'status':_0x3dccda,'from_session':Z});if(_0x5630e7)k['delete'](_0x5630e7);return{'content':[{'type':_0x8337af(0x237),'text':JSON[_0x8337af(0x1fc)](_0x5e9f62)}]};}let _0x4a2012=await P(_0x8337af(0x22f),{'resume_id':w,'alias':Z,'status':_0x1cb157===_0x8337af(0x1f2)?_0x8337af(0x1f2):_0x1cb157===_0x8337af(0x21b)?_0x8337af(0x21b):_0x8337af(0x20e),'task':_0x537946[_0x8337af(0x1ec)](0x0,0xc8),'output':_0x537946});return{'content':[{'type':_0x8337af(0x237),'text':JSON[_0x8337af(0x1fc)](_0x4a2012)}]};}if(_0x39cf87===_0x8337af(0x1d8)){let {status:_0x6b9336,task:_0x4e9f8c,progress:_0x53fdc7}=_0x3fc3d1,_0x4a2b50=await P(_0x8337af(0x22f),{'resume_id':w,'alias':Z,'status':_0x6b9336,'task':_0x4e9f8c,'progress':_0x53fdc7});return{'content':[{'type':'text','text':JSON[_0x8337af(0x1fc)](_0x4a2b50)}]};}if(_0x39cf87===_0x8337af(0x1e6)){let {alias:_0x3a1c21,task:_0x12c82e,priority:_0x14d5ca}=_0x3fc3d1,_0x42b810=await P(_0x8337af(0x1f8),{'alias':_0x3a1c21,'task':_0x12c82e,'priority':_0x14d5ca||_0x8337af(0x1da),'from_session':Z});return{'content':[{'type':_0x8337af(0x237),'text':JSON[_0x8337af(0x1fc)](_0x42b810)}]};}if(_0x39cf87===_0x8337af(0x229)){let {alias:_0x570484,message:_0xd8ba89}=_0x3fc3d1,_0x514402=await P(_0x8337af(0x208),{'alias':_0x570484,'message':_0xd8ba89,'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x8337af(0x1fc)](_0x514402)}]};}if(_0x39cf87===_0x8337af(0x24f)){let _0x1d2d9b=await P(_0x8337af(0x220),{});return{'content':[{'type':_0x8337af(0x237),'text':JSON[_0x8337af(0x1fc)](_0x1d2d9b)}]};}return{'content':[{'type':_0x8337af(0x237),'text':JSON[_0x8337af(0x1fc)]({'error':_0x8337af(0x1f9)})}]};});async function v(){const _0x150379=a0_0x662eba;let _0x2a74c3=D+_0x150379(0x23a)+encodeURIComponent(Z),_0x290f9a={};if(X)_0x290f9a['Authorization']=_0x150379(0x216)+X;Y('connecting\x20to\x20'+_0x2a74c3);while(!0x0){try{let _0x55c17a=await fetch(_0x2a74c3,{'headers':_0x290f9a});if(!_0x55c17a['ok']){Y(_0x150379(0x256)+_0x55c17a[_0x150379(0x1ea)]+'\x20'+_0x55c17a['statusText']),await h(0x1388);continue;}let _0x5b2d37=_0x55c17a[_0x150379(0x25e)][_0x150379(0x223)](),_0x4e13e7=new TextDecoder(),_0x4f9314='';while(!0x0){let {done:_0x56336c,value:_0x57b68e}=await _0x5b2d37['read']();if(_0x56336c)break;_0x4f9314+=_0x4e13e7['decode'](_0x57b68e,{'stream':!0x0});let _0x1ed35f=_0x4f9314[_0x150379(0x1f4)]('\x0a\x0a');_0x4f9314=_0x1ed35f[_0x150379(0x1e8)]()||'';for(let _0x315a92 of _0x1ed35f){let _0x2c0b91=_0x315a92[_0x150379(0x1f4)]('\x0a')[_0x150379(0x1e3)](_0x35aa8e=>_0x35aa8e[_0x150379(0x21e)](_0x150379(0x226)));if(!_0x2c0b91)continue;try{let _0x5d426b=JSON[_0x150379(0x25a)](_0x2c0b91['slice'](0x6));await u(_0x5d426b);}catch(_0x3abcec){Y('parse\x20error:\x20'+_0x3abcec);}}}Y(_0x150379(0x240));}catch(_0x1fdd3f){Y('SSE\x20connection\x20error:\x20'+_0x1fdd3f);}await h(0xbb8);}}async function u(_0x1d4114){const _0x53f948=a0_0x662eba;if(_0x1d4114[_0x53f948(0x203)]==='connected'){Y(_0x53f948(0x1ee)+Z+'\x22');return;}if(_0x1d4114[_0x53f948(0x203)]===_0x53f948(0x205)){if(Y(_0x53f948(0x1f5)+_0x1d4114[_0x53f948(0x22b)]+':\x20'+_0x1d4114[_0x53f948(0x1e1)][_0x53f948(0x1ec)](0x0,0x3c)),await K[_0x53f948(0x215)]({'method':_0x53f948(0x24d),'params':{'content':_0x1d4114[_0x53f948(0x1e1)],'meta':{'sender':_0x1d4114['from']||'hub','sender_id':_0x53f948(0x258),'user':_0x1d4114[_0x53f948(0x22b)]||_0x53f948(0x1fa),'priority':_0x53f948(0x1da)}}}),_0x1d4114[_0x53f948(0x210)])await P(_0x53f948(0x207),{'alias':Z,'message_id':_0x1d4114[_0x53f948(0x210)]});return;}if(_0x1d4114[_0x53f948(0x203)]===_0x53f948(0x21c)||_0x1d4114[_0x53f948(0x203)]===_0x53f948(0x1f3)){Y('←\x20'+_0x1d4114[_0x53f948(0x203)]+_0x53f948(0x1e9)+_0x1d4114[_0x53f948(0x24e)]+_0x53f948(0x20c)+(_0x1d4114[_0x53f948(0x230)]||_0x53f948(0x1da)));let _0x2566a0=await P(_0x53f948(0x249),{'alias':Z,'limit':0x5});if(_0x2566a0?.['ok']&&_0x2566a0[_0x53f948(0x209)]?.[_0x53f948(0x20f)]>0x0)for(let _0x1af7eb of _0x2566a0[_0x53f948(0x209)]){let _0x4011a3={'sender':_0x1af7eb[_0x53f948(0x231)]||'hub','sender_id':_0x53f948(0x258),'user':_0x1af7eb[_0x53f948(0x231)]||_0x53f948(0x1fa),'task_id':_0x1af7eb['id'],'priority':_0x1af7eb[_0x53f948(0x230)]||_0x53f948(0x1da)};k['set'](_0x1af7eb['id'],_0x1af7eb[_0x53f948(0x231)]||_0x53f948(0x1fa)),await K[_0x53f948(0x215)]({'method':_0x53f948(0x24d),'params':{'content':_0x1af7eb[_0x53f948(0x1d9)],'meta':_0x4011a3}}),Y(_0x53f948(0x241)+_0x1af7eb['id'][_0x53f948(0x1ec)](0x0,0x8)+_0x53f948(0x228)+_0x1af7eb[_0x53f948(0x231)]+':\x20'+_0x1af7eb['content'][_0x53f948(0x1ec)](0x0,0x3c)),await P(_0x53f948(0x207),{'alias':Z,'message_id':_0x1af7eb['id']});}}}async function S(){const _0x4636aa=a0_0x662eba;let _0x125e90=new a0_0x5397f0();await K[_0x4636aa(0x24a)](_0x125e90),Y(_0x4636aa(0x213)),Y(_0x4636aa(0x25c)),v()[_0x4636aa(0x20d)](_0x538d0b=>Y(_0x4636aa(0x21d)+_0x538d0b)),P('report_status',{'resume_id':w,'alias':Z,'status':_0x4636aa(0x221),'server':a0_0x584493(),'hostname':a0_0x584493(),'agent':_0x4636aa(0x22c),'project_dir':process[_0x4636aa(0x22d)](),'tmux_name':f||void 0x0})[_0x4636aa(0x248)](()=>Y(_0x4636aa(0x250)+Z+_0x4636aa(0x239)+w['slice'](0x0,0x8)+')'))[_0x4636aa(0x20d)](_0x24ba88=>Y('warning:\x20could\x20not\x20register:\x20'+_0x24ba88)),setInterval(()=>{const _0xafede5=_0x4636aa;P('report_status',{'resume_id':w,'alias':Z,'status':_0xafede5(0x221),'server':a0_0x584493(),'hostname':a0_0x584493(),'agent':_0xafede5(0x22c),'project_dir':process[_0xafede5(0x22d)](),'tmux_name':f||void 0x0})[_0xafede5(0x20d)](_0x4563b8=>Y(_0xafede5(0x204)+_0x4563b8));},0x2bf20),Y(_0x4636aa(0x243));}S()[a0_0x662eba(0x20d)](_0x615934=>{const _0x385190=a0_0x662eba;Y(_0x385190(0x20b)+_0x615934),process['exit'](0x1);});async function N(){const _0x5b295e=a0_0x662eba;Y(_0x5b295e(0x22e)),await P(_0x5b295e(0x22f),{'resume_id':w,'alias':Z,'status':_0x5b295e(0x21b),'task':_0x5b295e(0x1fd)})[_0x5b295e(0x20d)](()=>{}),process['exit'](0x0);}process[a0_0x662eba(0x227)]['on'](a0_0x662eba(0x23f),()=>N()),process['on']('SIGTERM',()=>N()),process['on']('SIGINT',()=>N());
2
+ const a0_0x34d769=a0_0x1f0b;(function(_0xf8f245,_0x5ebf0d){const _0x532602=a0_0x1f0b,_0x363032=_0xf8f245();while(!![]){try{const _0x3b9433=-parseInt(_0x532602(0x1bf))/0x1*(-parseInt(_0x532602(0x215))/0x2)+-parseInt(_0x532602(0x203))/0x3*(parseInt(_0x532602(0x1ac))/0x4)+parseInt(_0x532602(0x1da))/0x5+parseInt(_0x532602(0x209))/0x6+-parseInt(_0x532602(0x211))/0x7+-parseInt(_0x532602(0x217))/0x8*(parseInt(_0x532602(0x212))/0x9)+-parseInt(_0x532602(0x219))/0xa*(-parseInt(_0x532602(0x1d0))/0xb);if(_0x3b9433===_0x5ebf0d)break;else _0x363032['push'](_0x363032['shift']());}catch(_0x47a3ec){_0x363032['push'](_0x363032['shift']());}}}(a0_0x4538,0xbb9e0));import{readFileSync as a0_0x328278,existsSync as a0_0x2cdd97}from'fs';import{join as a0_0x9262fe}from'path';import{hostname as a0_0x1a6d38}from'os';import{execSync as a0_0x1473df}from'child_process';import{Server as a0_0x394894}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x59f5e4}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x2da5b7,CallToolRequestSchema as a0_0x1ab12c}from'@modelcontextprotocol/sdk/types.js';function p(_0x22885f){const _0x371b02=a0_0x1f0b;if(!a0_0x2cdd97(_0x22885f))return;for(let _0x4e571c of a0_0x328278(_0x22885f,'utf-8')[_0x371b02(0x1ee)]('\x0a')){let _0xc79506=_0x4e571c[_0x371b02(0x1ba)]();if(!_0xc79506||_0xc79506['startsWith']('#'))continue;let _0xa800f6=_0xc79506[_0x371b02(0x20e)]('=');if(_0xa800f6<0x0)continue;let _0x2f8e45=_0xc79506[_0x371b02(0x1c1)](0x0,_0xa800f6)[_0x371b02(0x1ba)](),_0x3275f2=_0xc79506['slice'](_0xa800f6+0x1)['trim']()[_0x371b02(0x1fc)](/^["']|["']$/g,'');if(!process.env[_0x2f8e45])process.env[_0x2f8e45]=_0x3275f2;}}var C=process.env.HOME||'~',T=a0_0x9262fe(C,'.claude/channels/commhub');p(a0_0x9262fe(T,'.env'));var L=process[a0_0x34d769(0x223)]()[a0_0x34d769(0x1fc)](/\//g,'-');p(a0_0x9262fe(T,L,a0_0x34d769(0x1ef)));function U(){const _0x43890d=a0_0x34d769;try{return a0_0x1473df('tmux\x20display-message\x20-p\x20\x27#S\x27',{'encoding':_0x43890d(0x1a2),'timeout':0x7d0})[_0x43890d(0x1ba)]();}catch{return'';}}function c(){const _0x267d48=a0_0x34d769;try{let _0x4cd981=a0_0x9262fe(C,_0x267d48(0x1b8),_0x267d48(0x20b));if(a0_0x2cdd97(_0x4cd981))return JSON[_0x267d48(0x1e0)](a0_0x328278(_0x4cd981,_0x267d48(0x1a2)));}catch{}return{};}var H=c(),D=process.env.COMMHUB_URL||H['hub']||a0_0x34d769(0x1ed),f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0x1a6d38(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto[a0_0x34d769(0x1a7)](),X=process.env.COMMHUB_TOKEN||H[a0_0x34d769(0x1d3)]||'';function Y(_0xfcc136){const _0x40cd9a=a0_0x34d769;let _0x35b011=new Date()['toTimeString']()[_0x40cd9a(0x1c1)](0x0,0x8);process[_0x40cd9a(0x1ca)][_0x40cd9a(0x1f4)]('['+_0x35b011+_0x40cd9a(0x1b0)+_0xfcc136+'\x0a');}function h(_0x468080){return new Promise(_0x299891=>setTimeout(_0x299891,_0x468080));}Y('ENV:\x20URL='+D+'\x20ALIAS='+Z+a0_0x34d769(0x1b4)+w[a0_0x34d769(0x1c1)](0x0,0x8)+a0_0x34d769(0x1fa)+(f||'none')+a0_0x34d769(0x1bb)+process[a0_0x34d769(0x223)]()+a0_0x34d769(0x1c2)+L);var k=new Map(),K=new a0_0x394894({'name':a0_0x34d769(0x1c9),'version':a0_0x34d769(0x1fe)},{'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>','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.',a0_0x34d769(0x1b7),'You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.',a0_0x34d769(0x1c8)+Z][a0_0x34d769(0x222)]('\x0a')});K[a0_0x34d769(0x1a4)](a0_0x2da5b7,async()=>({'tools':[{'name':a0_0x34d769(0x1c5),'description':a0_0x34d769(0x218),'inputSchema':{'type':'object','properties':{'task_id':{'type':'string','description':a0_0x34d769(0x1c0)},'text':{'type':a0_0x34d769(0x1ea),'description':a0_0x34d769(0x1cd)},'status':{'type':a0_0x34d769(0x1ea),'enum':[a0_0x34d769(0x1cf),a0_0x34d769(0x1d6),a0_0x34d769(0x1af),a0_0x34d769(0x1ad),a0_0x34d769(0x213),a0_0x34d769(0x1c4)],'description':a0_0x34d769(0x1eb)}},'required':['text']}},{'name':a0_0x34d769(0x1df),'description':a0_0x34d769(0x208),'inputSchema':{'type':'object','properties':{'status':{'type':a0_0x34d769(0x1ea),'enum':[a0_0x34d769(0x1f8),'idle','blocked',a0_0x34d769(0x213)]},'task':{'type':'string','description':a0_0x34d769(0x1f1)},'progress':{'type':'number','description':a0_0x34d769(0x1e2)}},'required':[a0_0x34d769(0x1b5)]}},{'name':'commhub_send_task','description':a0_0x34d769(0x1f6),'inputSchema':{'type':a0_0x34d769(0x1f7),'properties':{'alias':{'type':a0_0x34d769(0x1ea),'description':a0_0x34d769(0x205)},'task':{'type':a0_0x34d769(0x1ea),'description':a0_0x34d769(0x21d)},'priority':{'type':a0_0x34d769(0x1ea),'enum':[a0_0x34d769(0x201),'normal',a0_0x34d769(0x21b)],'description':a0_0x34d769(0x207)}},'required':['alias',a0_0x34d769(0x1cc)]}},{'name':a0_0x34d769(0x1d4),'description':a0_0x34d769(0x1e5),'inputSchema':{'type':a0_0x34d769(0x1f7),'properties':{'alias':{'type':a0_0x34d769(0x1ea),'description':'Target\x20session\x20alias'},'message':{'type':a0_0x34d769(0x1ea),'description':a0_0x34d769(0x1a9)}},'required':[a0_0x34d769(0x221),a0_0x34d769(0x1a8)]}},{'name':a0_0x34d769(0x1a6),'description':'Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','inputSchema':{'type':a0_0x34d769(0x1f7),'properties':{}}}]}));async function P(_0x5d729c,_0x412563){const _0x26f285=a0_0x34d769;let _0x2eb785=await fetch(D+_0x26f285(0x1d7),{'method':_0x26f285(0x1ae),'headers':{'Content-Type':_0x26f285(0x1d1),'Accept':_0x26f285(0x1b1),...X?{'Authorization':_0x26f285(0x1de)+X}:{}},'body':JSON[_0x26f285(0x1b6)]({'jsonrpc':_0x26f285(0x20f),'id':0x1,'method':_0x26f285(0x1e8),'params':{'protocolVersion':_0x26f285(0x1e6),'capabilities':{},'clientInfo':{'name':'commhub-channel','version':_0x26f285(0x1fe)}}})});if(!_0x2eb785['ok']){let _0x1fcb18=await _0x2eb785[_0x26f285(0x1c6)]();return Y(_0x26f285(0x1b9)+_0x2eb785['status']+'\x20'+_0x1fcb18['slice'](0x0,0x64)),{'ok':!0x1,'error':_0x26f285(0x1f3)+_0x2eb785[_0x26f285(0x1b5)]};}await _0x2eb785[_0x26f285(0x1c6)]();let _0x1d4972=(await(await fetch(D+_0x26f285(0x1d7),{'method':'POST','headers':{'Content-Type':_0x26f285(0x1d1),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x26f285(0x1de)+X}:{}},'body':JSON[_0x26f285(0x1b6)]({'jsonrpc':_0x26f285(0x20f),'id':0x2,'method':_0x26f285(0x1d2),'params':{'name':_0x5d729c,'arguments':_0x412563}})}))['text']())[_0x26f285(0x1ee)]('\x0a')[_0x26f285(0x1d8)](_0x2297bb=>_0x2297bb['startsWith']('data:\x20'));if(_0x1d4972){let _0x5570b7=JSON['parse'](_0x1d4972[_0x26f285(0x1c1)](0x6));return _0x5570b7?.['result']?.[_0x26f285(0x1ec)]?.[0x0]?.[_0x26f285(0x1c6)]?JSON[_0x26f285(0x1e0)](_0x5570b7['result']['content'][0x0]['text']):_0x5570b7;}return{'ok':!0x1,'error':_0x26f285(0x1e7)};}function a0_0x4538(){const _0x324e51=['Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','object','working','get_all_status','...\x20TMUX=','SIGINT','replace','notification','0.3.0','\x20from\x20','messages','high','inbox_count','6180VOXRxk',':\x20inbox_count=','Target\x20session\x20alias','catch','Priority\x20(default:\x20normal)','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','4480926ASjDuy','hub','config.json','data:\x20','exit','indexOf','2.0','get_inbox','9583511odAOEC','27KHhGcF','error','unknown\x20tool','1825594XtUJHg','startsWith','2711192kOOphH','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','20OTjjQc','stdin','low','send_reply','Task\x20content','params','priority','read','alias','join','cwd','Authorization','end','connected','from','SSE\x20stream\x20ended,\x20reconnecting...','utf-8','idle','setRequestHandler','from_session','commhub_get_all_status','randomUUID','message','Message\x20content','\x22\x20(','parse\x20error:\x20','388Pqhbyh','blocked','POST','cancelled',']\x20[commhub]\x20','application/json,\x20text/event-stream','SSE\x20connection\x20error:\x20','normal','\x20RESUME_ID=','status','stringify','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','.anet','CommHub\x20init\x20failed:\x20','trim','\x20CWD=','body','new_task','/events/','1WZCErX','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','slice','\x20PROJECT_ENV=','message_id','in_progress','commhub_reply','text','claude-code','Session\x20alias:\x20','commhub-channel','stderr','ack_inbox','task','Reply\x20text\x20/\x20result\x20summary','SIGTERM','completed','2745699qfjZUY','application/json','tools/call','token','commhub_send_message','send_message','failed','/mcp','find','replied','5976170QmpgDZ','report_status','length','type','Bearer\x20','commhub_report_status','parse','send_task','Progress\x200-100','registered\x20as\x20\x22','connect','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','2025-03-26','no\x20response','initialize','→\x20injected\x20task\x20','string','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','content','http://127.0.0.1:9200','split','.env','notifications/claude/channel','Current\x20task\x20description','MCP\x20stdio\x20connected','init\x20failed:\x20','write','heartbeat\x20failed:\x20'];a0_0x4538=function(){return _0x324e51;};return a0_0x4538();}K[a0_0x34d769(0x1a4)](a0_0x1ab12c,async _0x442803=>{const _0x5afd8c=a0_0x34d769;let {name:_0x260845,arguments:_0x139aa0}=_0x442803[_0x5afd8c(0x21e)];if(_0x260845==='commhub_reply'){let {task_id:_0x3fb309,text:_0xef50d,status:_0x3a71c5}=_0x139aa0;if(_0x3a71c5===_0x5afd8c(0x1cf)||_0x3a71c5==='failed'||_0x3a71c5===_0x5afd8c(0x1af)){let _0x73c9c=_0x3a71c5==='completed'?_0x5afd8c(0x1d9):_0x3a71c5,_0x1a8391=_0x3fb309?k['get'](_0x3fb309)||_0x5afd8c(0x20a):_0x5afd8c(0x20a),_0x3ba98a=await P(_0x5afd8c(0x21c),{'alias':_0x1a8391,'text':_0xef50d,'in_reply_to':_0x3fb309||void 0x0,'status':_0x73c9c,'from_session':Z});if(_0x3fb309)k['delete'](_0x3fb309);return{'content':[{'type':_0x5afd8c(0x1c6),'text':JSON[_0x5afd8c(0x1b6)](_0x3ba98a)}]};}let _0x19cbcc=await P(_0x5afd8c(0x1db),{'resume_id':w,'alias':Z,'status':_0x3a71c5==='blocked'?'blocked':_0x3a71c5===_0x5afd8c(0x213)?'error':_0x5afd8c(0x1f8),'task':_0xef50d['slice'](0x0,0xc8),'output':_0xef50d});return{'content':[{'type':_0x5afd8c(0x1c6),'text':JSON[_0x5afd8c(0x1b6)](_0x19cbcc)}]};}if(_0x260845==='commhub_report_status'){let {status:_0x5e2d41,task:_0x171911,progress:_0x1dc0bd}=_0x139aa0,_0x8c2d38=await P(_0x5afd8c(0x1db),{'resume_id':w,'alias':Z,'status':_0x5e2d41,'task':_0x171911,'progress':_0x1dc0bd});return{'content':[{'type':_0x5afd8c(0x1c6),'text':JSON[_0x5afd8c(0x1b6)](_0x8c2d38)}]};}if(_0x260845==='commhub_send_task'){let {alias:_0x2f57a8,task:_0x29f9ce,priority:_0x364a9e}=_0x139aa0,_0x179167=await P(_0x5afd8c(0x1e1),{'alias':_0x2f57a8,'task':_0x29f9ce,'priority':_0x364a9e||_0x5afd8c(0x1b3),'from_session':Z});return{'content':[{'type':_0x5afd8c(0x1c6),'text':JSON['stringify'](_0x179167)}]};}if(_0x260845===_0x5afd8c(0x1d4)){let {alias:_0x5c8199,message:_0x407f15}=_0x139aa0,_0x27e8c6=await P(_0x5afd8c(0x1d5),{'alias':_0x5c8199,'message':_0x407f15,'from_session':Z});return{'content':[{'type':_0x5afd8c(0x1c6),'text':JSON['stringify'](_0x27e8c6)}]};}if(_0x260845===_0x5afd8c(0x1a6)){let _0x52292b=await P(_0x5afd8c(0x1f9),{});return{'content':[{'type':_0x5afd8c(0x1c6),'text':JSON[_0x5afd8c(0x1b6)](_0x52292b)}]};}return{'content':[{'type':_0x5afd8c(0x1c6),'text':JSON['stringify']({'error':_0x5afd8c(0x214)})}]};});async function v(){const _0x497b0c=a0_0x34d769;let _0x2a2bbc=D+_0x497b0c(0x1be)+encodeURIComponent(Z),_0x31a10e={};if(X)_0x31a10e[_0x497b0c(0x224)]=_0x497b0c(0x1de)+X;Y('connecting\x20to\x20'+_0x2a2bbc);while(!0x0){try{let _0x661213=await fetch(_0x2a2bbc,{'headers':_0x31a10e});if(!_0x661213['ok']){Y('SSE\x20error:\x20'+_0x661213['status']+'\x20'+_0x661213['statusText']),await h(0x1388);continue;}let _0x4fa63e=_0x661213[_0x497b0c(0x1bc)]['getReader'](),_0xe90485=new TextDecoder(),_0x4fe007='';while(!0x0){let {done:_0x33471f,value:_0x2d3f4e}=await _0x4fa63e[_0x497b0c(0x220)]();if(_0x33471f)break;_0x4fe007+=_0xe90485['decode'](_0x2d3f4e,{'stream':!0x0});let _0x3b86ac=_0x4fe007[_0x497b0c(0x1ee)]('\x0a\x0a');_0x4fe007=_0x3b86ac['pop']()||'';for(let _0x191d8b of _0x3b86ac){let _0x2a21d4=_0x191d8b[_0x497b0c(0x1ee)]('\x0a')[_0x497b0c(0x1d8)](_0x3793e1=>_0x3793e1[_0x497b0c(0x216)](_0x497b0c(0x20c)));if(!_0x2a21d4)continue;try{let _0x4a5a4a=JSON[_0x497b0c(0x1e0)](_0x2a21d4[_0x497b0c(0x1c1)](0x6));await u(_0x4a5a4a);}catch(_0xf9b613){Y(_0x497b0c(0x1ab)+_0xf9b613);}}}Y(_0x497b0c(0x1a1));}catch(_0x432ecb){Y(_0x497b0c(0x1b2)+_0x432ecb);}await h(0xbb8);}}async function u(_0xbe600f){const _0x17d7ee=a0_0x34d769;if(_0xbe600f[_0x17d7ee(0x1dd)]===_0x17d7ee(0x19f)){Y('SSE\x20connected\x20as\x20\x22'+Z+'\x22');return;}if(_0xbe600f[_0x17d7ee(0x1dd)]==='new_message'){if(Y('←\x20message\x20from\x20'+_0xbe600f[_0x17d7ee(0x1a0)]+':\x20'+_0xbe600f['message'][_0x17d7ee(0x1c1)](0x0,0x3c)),await K[_0x17d7ee(0x1fd)]({'method':_0x17d7ee(0x1f0),'params':{'content':_0xbe600f[_0x17d7ee(0x1a8)],'meta':{'sender':_0xbe600f['from']||_0x17d7ee(0x20a),'sender_id':'commhub','user':_0xbe600f[_0x17d7ee(0x1a0)]||_0x17d7ee(0x20a),'priority':'normal'}}}),_0xbe600f[_0x17d7ee(0x1c3)])await P(_0x17d7ee(0x1cb),{'alias':Z,'message_id':_0xbe600f['message_id']});return;}if(_0xbe600f[_0x17d7ee(0x1dd)]===_0x17d7ee(0x1bd)||_0xbe600f['type']==='broadcast'){Y('←\x20'+_0xbe600f[_0x17d7ee(0x1dd)]+_0x17d7ee(0x204)+_0xbe600f[_0x17d7ee(0x202)]+'\x20priority='+(_0xbe600f[_0x17d7ee(0x21f)]||'normal'));let _0x459977=await P(_0x17d7ee(0x210),{'alias':Z,'limit':0x5});if(_0x459977?.['ok']&&_0x459977['messages']?.[_0x17d7ee(0x1dc)]>0x0)for(let _0xedffc9 of _0x459977[_0x17d7ee(0x200)]){let _0xa8c7b9={'sender':_0xedffc9[_0x17d7ee(0x1a5)]||'hub','sender_id':'commhub','user':_0xedffc9[_0x17d7ee(0x1a5)]||_0x17d7ee(0x20a),'task_id':_0xedffc9['id'],'priority':_0xedffc9[_0x17d7ee(0x21f)]||_0x17d7ee(0x1b3)};k['set'](_0xedffc9['id'],_0xedffc9[_0x17d7ee(0x1a5)]||_0x17d7ee(0x20a)),await K['notification']({'method':_0x17d7ee(0x1f0),'params':{'content':_0xedffc9[_0x17d7ee(0x1ec)],'meta':_0xa8c7b9}}),Y(_0x17d7ee(0x1e9)+_0xedffc9['id'][_0x17d7ee(0x1c1)](0x0,0x8)+_0x17d7ee(0x1ff)+_0xedffc9[_0x17d7ee(0x1a5)]+':\x20'+_0xedffc9[_0x17d7ee(0x1ec)][_0x17d7ee(0x1c1)](0x0,0x3c)),await P(_0x17d7ee(0x1cb),{'alias':Z,'message_id':_0xedffc9['id']});}}}function a0_0x1f0b(_0x35cc0c,_0x3ac786){_0x35cc0c=_0x35cc0c-0x19f;const _0x4538c8=a0_0x4538();let _0x1f0b21=_0x4538c8[_0x35cc0c];return _0x1f0b21;}async function S(){const _0x374888=a0_0x34d769;let _0x3a187c=new a0_0x59f5e4();await K[_0x374888(0x1e4)](_0x3a187c),Y(_0x374888(0x1f2)),Y('starting\x20SSE\x20listener...'),v()[_0x374888(0x206)](_0x27bfdf=>Y('SSE\x20fatal:\x20'+_0x27bfdf)),P('report_status',{'resume_id':w,'alias':Z,'status':_0x374888(0x1a3),'server':a0_0x1a6d38(),'hostname':a0_0x1a6d38(),'agent':'claude-code','project_dir':process[_0x374888(0x223)](),'tmux_name':f||void 0x0})['then'](()=>Y(_0x374888(0x1e3)+Z+_0x374888(0x1aa)+w['slice'](0x0,0x8)+')'))[_0x374888(0x206)](_0x2bc7dd=>Y('warning:\x20could\x20not\x20register:\x20'+_0x2bc7dd)),setInterval(()=>{const _0x24b371=_0x374888;P('report_status',{'resume_id':w,'alias':Z,'status':_0x24b371(0x1a3),'server':a0_0x1a6d38(),'hostname':a0_0x1a6d38(),'agent':_0x24b371(0x1c7),'project_dir':process[_0x24b371(0x223)](),'tmux_name':f||void 0x0})[_0x24b371(0x206)](_0x139030=>Y(_0x24b371(0x1f5)+_0x139030));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}S()[a0_0x34d769(0x206)](_0x563c52=>{const _0x3f8965=a0_0x34d769;Y('fatal:\x20'+_0x563c52),process[_0x3f8965(0x20d)](0x1);});async function N(){const _0x4d9f92=a0_0x34d769;Y('shutting\x20down,\x20reporting\x20offline...'),await P(_0x4d9f92(0x1db),{'resume_id':w,'alias':Z,'status':_0x4d9f92(0x213),'task':'session\x20disconnected'})['catch'](()=>{}),process['exit'](0x0);}process[a0_0x34d769(0x21a)]['on'](a0_0x34d769(0x225),()=>N()),process['on'](a0_0x34d769(0x1ce),()=>N()),process['on'](a0_0x34d769(0x1fb),()=>N());
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.0.0-preview.4",
4
- "description": "AI Agent Network Server + Client + Setup in one package. SSE real-time communication for multi-agent orchestration.",
3
+ "version": "2.0.0-preview.40",
4
+ "description": "AI Agent Network CLI \u2014 Create multi-agent networks with user management, network isolation, and 3 AI runtimes (Claude/Codex/MiniMax). 39 commands.",
5
5
  "type": "module",
6
6
  "main": "dist/src/client.js",
7
7
  "types": "dist/client.d.ts",
@@ -31,18 +31,20 @@
31
31
  "mcp",
32
32
  "sse",
33
33
  "claude",
34
+ "codex",
34
35
  "openai",
35
36
  "minimax",
36
37
  "orchestration",
37
- "communication",
38
- "hub",
39
- "multi-agent"
38
+ "multi-agent",
39
+ "cli",
40
+ "anet"
40
41
  ],
41
42
  "author": "sleep2agi",
42
43
  "license": "MIT",
44
+ "homepage": "https://anet.vansin.me",
43
45
  "repository": {
44
46
  "type": "git",
45
- "url": "https://github.com/sleep2agi/agent-comm-hub",
47
+ "url": "https://github.com/sleep2agi/agent-network",
46
48
  "directory": "agent-network"
47
49
  },
48
50
  "engines": {
@@ -57,4 +59,4 @@
57
59
  "node-pty": "^1.1.0",
58
60
  "typescript": "^5.0.0"
59
61
  }
60
- }
62
+ }