@sleep2agi/agent-network 2.0.0-preview.22 → 2.0.0-preview.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- function a0_0x2e8c(){const _0x3b5732=['match','connectSSE','15QWesWh','type','idle','634528EJOXVU','token','broadcast','heartbeatInterval','getReader','split','body','completed','result','get_inbox','messages','pop','sleep','heartbeat\x20failed:\x20','decode','2063589fbRfGn','send','send_message','url','name','agent','Bearer\x20','new_task','get_all_status','76ySJyRu','application/json,\x20text/event-stream','414476IYlhZg',']\x20[commhub:','s...','emit','processInbox','AbortError','POST','parse','call','server','normal','log','signal','tools/call','catch','30UoSyAK','slice','message','4501989RYRPxe','Authorization','toString','1794GUbhKs','toTimeString','application/json','startsWith','data:\x20','connected','1165kOgzoB','ack_inbox','from_session','reply','replace','disconnected','/events/','2672012HoKBzO','autoConnect','inbox\x20error:\x20','getAllStatus','SSE\x20error:\x20','offline','sdk','now','SSE\x20reconnecting\x20in\x20','status','11544RbSmwR','resumeId','sseAbort','disconnect','reconnectDelay','alias','connect','content','running','heartbeatTimer','report_status','min','text','registered'];a0_0x2e8c=function(){return _0x3b5732;};return a0_0x2e8c();}const a0_0x289e76=a0_0x552f;(function(_0x13b6ba,_0xa07ceb){const _0x53ebea=a0_0x552f,_0x5b4b69=_0x13b6ba();while(!![]){try{const _0x321447=parseInt(_0x53ebea(0x141))/0x1*(-parseInt(_0x53ebea(0x16f))/0x2)+parseInt(_0x53ebea(0x126))/0x3*(parseInt(_0x53ebea(0x143))/0x4)+parseInt(_0x53ebea(0x15e))/0x5*(parseInt(_0x53ebea(0x158))/0x6)+parseInt(_0x53ebea(0x165))/0x7+-parseInt(_0x53ebea(0x129))/0x8+parseInt(_0x53ebea(0x155))/0x9+-parseInt(_0x53ebea(0x152))/0xa*(parseInt(_0x53ebea(0x138))/0xb);if(_0x321447===_0xa07ceb)break;else _0x5b4b69['push'](_0x5b4b69['shift']());}catch(_0x278c5f){_0x5b4b69['push'](_0x5b4b69['shift']());}}}(a0_0x2e8c,0x5ef32));import{EventEmitter as a0_0x4e4118}from'events';import{hostname as a0_0x3c9383}from'os';class T extends a0_0x4e4118{[a0_0x289e76(0x13b)];[a0_0x289e76(0x11b)];[a0_0x289e76(0x12a)];[a0_0x289e76(0x13d)];[a0_0x289e76(0x117)];[a0_0x289e76(0x12c)];[a0_0x289e76(0x11a)];['heartbeatTimer'];['sseAbort'];['running']=!0x1;constructor(_0x1ccebe){const _0x7c7689=a0_0x289e76;super();if(this[_0x7c7689(0x13b)]=_0x1ccebe[_0x7c7689(0x13b)][_0x7c7689(0x162)](/\/$/,''),this[_0x7c7689(0x11b)]=_0x1ccebe['alias'],this[_0x7c7689(0x12a)]=_0x1ccebe[_0x7c7689(0x12a)],this[_0x7c7689(0x13d)]=_0x1ccebe[_0x7c7689(0x13d)]||_0x7c7689(0x16b),this[_0x7c7689(0x117)]='sdk-'+_0x1ccebe[_0x7c7689(0x11b)]+'-'+Date[_0x7c7689(0x16c)]()[_0x7c7689(0x157)](0x24),this[_0x7c7689(0x12c)]=_0x1ccebe[_0x7c7689(0x12c)]??0x2bf20,this['reconnectDelay']=_0x1ccebe['reconnectDelay']??0xbb8,_0x1ccebe[_0x7c7689(0x166)]!==!0x1)this[_0x7c7689(0x11c)]();}[a0_0x289e76(0x14e)](_0x3629b7){const _0x3bbcf7=a0_0x289e76;console[_0x3bbcf7(0x14e)]('['+new Date()[_0x3bbcf7(0x159)]()['slice'](0x0,0x8)+_0x3bbcf7(0x144)+this['alias']+']\x20'+_0x3629b7);}async[a0_0x289e76(0x14b)](_0x1588d9,_0x5a05dd){const _0x1fac50=a0_0x289e76;let _0x2aea5e={'Content-Type':_0x1fac50(0x15a),'Accept':_0x1fac50(0x142)};if(this['token'])_0x2aea5e[_0x1fac50(0x156)]=_0x1fac50(0x13e)+this[_0x1fac50(0x12a)];let _0x596756=await(await fetch(this[_0x1fac50(0x13b)]+'/mcp',{'method':_0x1fac50(0x149),'headers':_0x2aea5e,'body':JSON['stringify']({'jsonrpc':'2.0','id':Date[_0x1fac50(0x16c)](),'method':_0x1fac50(0x150),'params':{'name':_0x1588d9,'arguments':_0x5a05dd}})}))[_0x1fac50(0x122)](),_0x121195=_0x596756[_0x1fac50(0x124)](/data: (.+)/),_0x538ecc=_0x121195?JSON['parse'](_0x121195[0x1]):JSON['parse'](_0x596756),_0x19d3fc=_0x538ecc?.[_0x1fac50(0x131)]?.[_0x1fac50(0x11d)]?.[0x0]?.[_0x1fac50(0x122)];return _0x19d3fc?JSON[_0x1fac50(0x14a)](_0x19d3fc):_0x538ecc;}async['connect'](){const _0x79886a=a0_0x289e76;if(this[_0x79886a(0x11e)])return;this['running']=!0x0,await this[_0x79886a(0x16e)](_0x79886a(0x128)),this[_0x79886a(0x14e)](_0x79886a(0x123)),this[_0x79886a(0x11f)]=setInterval(()=>{const _0x587019=_0x79886a;this[_0x587019(0x16e)](_0x587019(0x128))[_0x587019(0x151)](_0x12c34f=>this[_0x587019(0x14e)](_0x587019(0x136)+_0x12c34f[_0x587019(0x154)]));},this[_0x79886a(0x12c)]),this[_0x79886a(0x125)]();}async[a0_0x289e76(0x119)](){const _0x4dc219=a0_0x289e76;if(this[_0x4dc219(0x11e)]=!0x1,this[_0x4dc219(0x118)]?.['abort'](),this[_0x4dc219(0x11f)])clearInterval(this['heartbeatTimer']);await this[_0x4dc219(0x16e)](_0x4dc219(0x16a))[_0x4dc219(0x151)](()=>{}),this[_0x4dc219(0x14e)](_0x4dc219(0x163));}async[a0_0x289e76(0x139)](_0x5adef5,_0x5883bc,_0x1a5967=a0_0x289e76(0x14d)){const _0x1aa339=a0_0x289e76;return this['call']('send_task',{'alias':_0x5adef5,'task':_0x5883bc,'priority':_0x1a5967,'from_session':this[_0x1aa339(0x11b)]});}async[a0_0x289e76(0x154)](_0xc0082d,_0x40aeb6){const _0x3696d0=a0_0x289e76;return this[_0x3696d0(0x14b)](_0x3696d0(0x13a),{'alias':_0xc0082d,'message':_0x40aeb6,'from_session':this['alias']});}async['reply'](_0x258ba5,_0x4f2faf,_0xfde8a9=a0_0x289e76(0x130)){const _0x225c3f=a0_0x289e76;return this[_0x225c3f(0x14b)](_0x225c3f(0x161),{'task_id':_0x258ba5,'text':_0x4f2faf,'status':_0xfde8a9});}async[a0_0x289e76(0x16e)](_0x1113aa,_0x4b14d9){const _0x36d28a=a0_0x289e76;return this[_0x36d28a(0x14b)](_0x36d28a(0x120),{'resume_id':this[_0x36d28a(0x117)],'alias':this[_0x36d28a(0x11b)],'status':_0x1113aa,'server':a0_0x3c9383(),'hostname':a0_0x3c9383(),'agent':this[_0x36d28a(0x13d)],'project_dir':process['cwd'](),..._0x4b14d9});}async[a0_0x289e76(0x168)](){const _0x4f442d=a0_0x289e76;return this[_0x4f442d(0x14b)](_0x4f442d(0x140),{});}async[a0_0x289e76(0x12b)](_0x5a1d89,_0x3e8e10){const _0x2ff0fa=a0_0x289e76;return this[_0x2ff0fa(0x14b)](_0x2ff0fa(0x12b),{'message':_0x5a1d89,'filter_server':_0x3e8e10?.[_0x2ff0fa(0x14c)],'filter_status':_0x3e8e10?.['status']});}async['connectSSE'](){const _0x4e89f6=a0_0x289e76;let _0x496130=encodeURIComponent(this[_0x4e89f6(0x11b)]),_0x40c1cb=this[_0x4e89f6(0x13b)]+_0x4e89f6(0x164)+_0x496130,_0x5b216a=this['reconnectDelay'];while(this[_0x4e89f6(0x11e)]){try{this[_0x4e89f6(0x118)]=new AbortController();let _0x53a80d={'Accept':'text/event-stream'};if(this[_0x4e89f6(0x12a)])_0x53a80d['Authorization']=_0x4e89f6(0x13e)+this[_0x4e89f6(0x12a)];let _0x2659ba=await fetch(_0x40c1cb,{'headers':_0x53a80d,'signal':this[_0x4e89f6(0x118)][_0x4e89f6(0x14f)]});if(!_0x2659ba['ok']||!_0x2659ba[_0x4e89f6(0x12f)]){this[_0x4e89f6(0x14e)]('SSE\x20failed:\x20'+_0x2659ba[_0x4e89f6(0x16e)]),await this[_0x4e89f6(0x135)](_0x5b216a),_0x5b216a=Math[_0x4e89f6(0x121)](_0x5b216a*1.5,0xea60);continue;}_0x5b216a=this[_0x4e89f6(0x11a)];let _0x5bb7a6=_0x2659ba[_0x4e89f6(0x12f)][_0x4e89f6(0x12d)](),_0x189d00=new TextDecoder(),_0x5c19d9='';while(this[_0x4e89f6(0x11e)]){let {done:_0x23d390,value:_0x2b94d5}=await _0x5bb7a6['read']();if(_0x23d390)break;_0x5c19d9+=_0x189d00[_0x4e89f6(0x137)](_0x2b94d5,{'stream':!0x0});let _0x5bcc4c=_0x5c19d9[_0x4e89f6(0x12e)]('\x0a');_0x5c19d9=_0x5bcc4c[_0x4e89f6(0x134)]()||'';for(let _0x340d51 of _0x5bcc4c){if(!_0x340d51[_0x4e89f6(0x15b)](_0x4e89f6(0x15c)))continue;try{let _0x5483c7=JSON['parse'](_0x340d51['slice'](0x6));if(_0x5483c7['type']===_0x4e89f6(0x15d)){this[_0x4e89f6(0x14e)]('SSE\x20connected'),this[_0x4e89f6(0x146)]('connected');continue;}if(_0x5483c7[_0x4e89f6(0x127)]===_0x4e89f6(0x13f)||_0x5483c7[_0x4e89f6(0x127)]==='new_message'||_0x5483c7['type']==='broadcast')await this['processInbox']();}catch{}}}}catch(_0x41f33a){if(_0x41f33a[_0x4e89f6(0x13c)]===_0x4e89f6(0x148))break;this[_0x4e89f6(0x146)]('error',_0x41f33a),this[_0x4e89f6(0x14e)](_0x4e89f6(0x169)+_0x41f33a[_0x4e89f6(0x154)]);}if(this['running'])this[_0x4e89f6(0x146)]('disconnected'),this[_0x4e89f6(0x14e)](_0x4e89f6(0x16d)+_0x5b216a/0x3e8+_0x4e89f6(0x145)),await this[_0x4e89f6(0x135)](_0x5b216a),_0x5b216a=Math['min'](_0x5b216a*1.5,0xea60);}}async[a0_0x289e76(0x147)](){const _0x17bd06=a0_0x289e76;try{let _0x5bd583=(await this[_0x17bd06(0x14b)](_0x17bd06(0x132),{'alias':this[_0x17bd06(0x11b)],'limit':0xa}))?.[_0x17bd06(0x133)]||[];for(let _0x25dfcc of _0x5bd583)await this['call'](_0x17bd06(0x15f),{'alias':this[_0x17bd06(0x11b)],'message_id':_0x25dfcc['id']}),this[_0x17bd06(0x14e)]('←\x20'+_0x25dfcc[_0x17bd06(0x160)]+':\x20'+_0x25dfcc[_0x17bd06(0x11d)][_0x17bd06(0x153)](0x0,0x3c)),this[_0x17bd06(0x146)]('task',_0x25dfcc),this[_0x17bd06(0x146)](_0x17bd06(0x154),_0x25dfcc);}catch(_0x5c0802){this[_0x17bd06(0x14e)](_0x17bd06(0x167)+_0x5c0802[_0x17bd06(0x154)]);}}['sleep'](_0x1496f6){return new Promise(_0x3e7eff=>setTimeout(_0x3e7eff,_0x1496f6));}}function a0_0x552f(_0x1868a7,_0x1cadf8){_0x1868a7=_0x1868a7-0x117;const _0x2e8c7b=a0_0x2e8c();let _0x552f89=_0x2e8c7b[_0x1868a7];return _0x552f89;}var $=T;export{$ as default,T as CommHub};
1
+ const a0_0x13784e=a0_0x2c3e;(function(_0x17637e,_0x2173a3){const _0x4eeb9c=a0_0x2c3e,_0x41d456=_0x17637e();while(!![]){try{const _0x4e3196=parseInt(_0x4eeb9c(0x76))/0x1+-parseInt(_0x4eeb9c(0x6d))/0x2*(parseInt(_0x4eeb9c(0x6e))/0x3)+-parseInt(_0x4eeb9c(0x7a))/0x4*(-parseInt(_0x4eeb9c(0xa4))/0x5)+parseInt(_0x4eeb9c(0xb7))/0x6*(parseInt(_0x4eeb9c(0x98))/0x7)+-parseInt(_0x4eeb9c(0xaf))/0x8*(parseInt(_0x4eeb9c(0x69))/0x9)+-parseInt(_0x4eeb9c(0xbb))/0xa*(parseInt(_0x4eeb9c(0x73))/0xb)+-parseInt(_0x4eeb9c(0x75))/0xc*(-parseInt(_0x4eeb9c(0x92))/0xd);if(_0x4e3196===_0x2173a3)break;else _0x41d456['push'](_0x41d456['shift']());}catch(_0xb8e417){_0x41d456['push'](_0x41d456['shift']());}}}(a0_0x9842,0x4781c));import{EventEmitter as a0_0x5425a8}from'events';import{hostname as a0_0x3f2829}from'os';class T extends a0_0x5425a8{['url'];['alias'];[a0_0x13784e(0xb6)];[a0_0x13784e(0xa0)];['resumeId'];[a0_0x13784e(0x95)];['reconnectDelay'];[a0_0x13784e(0x72)];[a0_0x13784e(0xb5)];[a0_0x13784e(0xa9)]=!0x1;constructor(_0xea8482){const _0x4f51ed=a0_0x13784e;super();if(this[_0x4f51ed(0x90)]=_0xea8482[_0x4f51ed(0x90)][_0x4f51ed(0x9c)](/\/$/,''),this[_0x4f51ed(0x8e)]=_0xea8482[_0x4f51ed(0x8e)],this['token']=_0xea8482[_0x4f51ed(0xb6)],this[_0x4f51ed(0xa0)]=_0xea8482[_0x4f51ed(0xa0)]||_0x4f51ed(0xb8),this['resumeId']='sdk-'+_0xea8482[_0x4f51ed(0x8e)]+'-'+Date[_0x4f51ed(0x8b)]()['toString'](0x24),this[_0x4f51ed(0x95)]=_0xea8482[_0x4f51ed(0x95)]??0x2bf20,this['reconnectDelay']=_0xea8482[_0x4f51ed(0x8f)]??0xbb8,_0xea8482['autoConnect']!==!0x1)this[_0x4f51ed(0x79)]();}[a0_0x13784e(0x9b)](_0x1b4729){const _0x28fe3a=a0_0x13784e;console[_0x28fe3a(0x9b)]('['+new Date()[_0x28fe3a(0xa1)]()[_0x28fe3a(0x9e)](0x0,0x8)+_0x28fe3a(0xac)+this['alias']+']\x20'+_0x1b4729);}async[a0_0x13784e(0xbe)](_0x3a106b,_0x8e6e65){const _0x3839f4=a0_0x13784e;let _0x402bb5={'Content-Type':'application/json','Accept':_0x3839f4(0x99)};if(this[_0x3839f4(0xb6)])_0x402bb5[_0x3839f4(0xa2)]='Bearer\x20'+this[_0x3839f4(0xb6)];let _0x386938=await(await fetch(this[_0x3839f4(0x90)]+_0x3839f4(0x8a),{'method':_0x3839f4(0x91),'headers':_0x402bb5,'body':JSON['stringify']({'jsonrpc':_0x3839f4(0xbf),'id':Date[_0x3839f4(0x8b)](),'method':_0x3839f4(0x8d),'params':{'name':_0x3a106b,'arguments':_0x8e6e65}})}))[_0x3839f4(0x7b)](),_0x3acf75=_0x386938[_0x3839f4(0x7e)](/data: (.+)/),_0x9f164b=_0x3acf75?JSON[_0x3839f4(0x9f)](_0x3acf75[0x1]):JSON[_0x3839f4(0x9f)](_0x386938),_0xcad792=_0x9f164b?.[_0x3839f4(0x6c)]?.[_0x3839f4(0xb4)]?.[0x0]?.[_0x3839f4(0x7b)];return _0xcad792?JSON[_0x3839f4(0x9f)](_0xcad792):_0x9f164b;}async[a0_0x13784e(0x79)](){const _0x5a0241=a0_0x13784e;if(this[_0x5a0241(0xa9)])return;this[_0x5a0241(0xa9)]=!0x0,await this[_0x5a0241(0x8c)](_0x5a0241(0x86)),this[_0x5a0241(0x9b)]('registered'),this[_0x5a0241(0x72)]=setInterval(()=>{const _0x43af66=_0x5a0241;this['status'](_0x43af66(0x86))[_0x43af66(0x7d)](_0x22a009=>this[_0x43af66(0x9b)](_0x43af66(0xb0)+_0x22a009['message']));},this['heartbeatInterval']),this[_0x5a0241(0x82)]();}async['disconnect'](){const _0x7ea09a=a0_0x13784e;if(this[_0x7ea09a(0xa9)]=!0x1,this['sseAbort']?.[_0x7ea09a(0x96)](),this[_0x7ea09a(0x72)])clearInterval(this['heartbeatTimer']);await this[_0x7ea09a(0x8c)](_0x7ea09a(0x6f))['catch'](()=>{}),this[_0x7ea09a(0x9b)](_0x7ea09a(0xba));}async[a0_0x13784e(0x6b)](_0x42e31e,_0x35ac5c,_0x1adb38='normal'){const _0x5b3e04=a0_0x13784e;return this['call'](_0x5b3e04(0x6a),{'alias':_0x42e31e,'task':_0x35ac5c,'priority':_0x1adb38,'from_session':this[_0x5b3e04(0x8e)]});}async['message'](_0x4e6a10,_0x1708f7){const _0x5eacff=a0_0x13784e;return this[_0x5eacff(0xbe)]('send_message',{'alias':_0x4e6a10,'message':_0x1708f7,'from_session':this['alias']});}async[a0_0x13784e(0x77)](_0x4dd0a1,_0x2f6a22,_0x2ca4ed=a0_0x13784e(0x71)){return this['call']('reply',{'task_id':_0x4dd0a1,'text':_0x2f6a22,'status':_0x2ca4ed});}async[a0_0x13784e(0x8c)](_0x1de57a,_0x464949){const _0x2f6d19=a0_0x13784e;return this[_0x2f6d19(0xbe)](_0x2f6d19(0x7f),{'resume_id':this['resumeId'],'alias':this[_0x2f6d19(0x8e)],'status':_0x1de57a,'server':a0_0x3f2829(),'hostname':a0_0x3f2829(),'agent':this[_0x2f6d19(0xa0)],'project_dir':process['cwd'](),..._0x464949});}async['getAllStatus'](){const _0x15dccd=a0_0x13784e;return this['call'](_0x15dccd(0xb3),{});}async['broadcast'](_0x232b8e,_0x5032c2){const _0x373105=a0_0x13784e;return this[_0x373105(0xbe)](_0x373105(0x89),{'message':_0x232b8e,'filter_server':_0x5032c2?.[_0x373105(0xaa)],'filter_status':_0x5032c2?.[_0x373105(0x8c)]});}async[a0_0x13784e(0x82)](){const _0x5011e1=a0_0x13784e;let _0x368291=encodeURIComponent(this[_0x5011e1(0x8e)]),_0xd27d45=this['url']+_0x5011e1(0xab)+_0x368291,_0xed1624=this[_0x5011e1(0x8f)];while(this[_0x5011e1(0xa9)]){try{this[_0x5011e1(0xb5)]=new AbortController();let _0x1a2a6a={'Accept':_0x5011e1(0x87)};if(this['token'])_0x1a2a6a['Authorization']=_0x5011e1(0x94)+this['token'];let _0x60b117=await fetch(_0xd27d45,{'headers':_0x1a2a6a,'signal':this[_0x5011e1(0xb5)]['signal']});if(!_0x60b117['ok']||!_0x60b117[_0x5011e1(0xa5)]){this[_0x5011e1(0x9b)](_0x5011e1(0xa7)+_0x60b117['status']),await this['sleep'](_0xed1624),_0xed1624=Math[_0x5011e1(0x83)](_0xed1624*1.5,0xea60);continue;}_0xed1624=this[_0x5011e1(0x8f)];let _0x3ea486=_0x60b117[_0x5011e1(0xa5)][_0x5011e1(0xbc)](),_0x54113f=new TextDecoder(),_0x62a2f7='';while(this[_0x5011e1(0xa9)]){let {done:_0x169eea,value:_0x40e7af}=await _0x3ea486[_0x5011e1(0xad)]();if(_0x169eea)break;_0x62a2f7+=_0x54113f['decode'](_0x40e7af,{'stream':!0x0});let _0x3e2526=_0x62a2f7[_0x5011e1(0xc0)]('\x0a');_0x62a2f7=_0x3e2526[_0x5011e1(0x9d)]()||'';for(let _0x59fee3 of _0x3e2526){if(!_0x59fee3[_0x5011e1(0x93)](_0x5011e1(0xa6)))continue;try{let _0x31ec54=JSON[_0x5011e1(0x9f)](_0x59fee3[_0x5011e1(0x9e)](0x6));if(_0x31ec54[_0x5011e1(0x7c)]===_0x5011e1(0xbd)){this[_0x5011e1(0x9b)](_0x5011e1(0x70)),this['emit'](_0x5011e1(0xbd));continue;}if(_0x31ec54[_0x5011e1(0x7c)]==='new_task'||_0x31ec54[_0x5011e1(0x7c)]===_0x5011e1(0xa3)||_0x31ec54[_0x5011e1(0x7c)]===_0x5011e1(0x89))await this[_0x5011e1(0xc1)]();}catch{}}}}catch(_0x25f846){if(_0x25f846[_0x5011e1(0xb1)]==='AbortError')break;this['emit'](_0x5011e1(0x88),_0x25f846),this[_0x5011e1(0x9b)](_0x5011e1(0xb9)+_0x25f846[_0x5011e1(0xa8)]);}if(this[_0x5011e1(0xa9)])this[_0x5011e1(0x78)](_0x5011e1(0xba)),this[_0x5011e1(0x9b)](_0x5011e1(0x85)+_0xed1624/0x3e8+_0x5011e1(0xb2)),await this[_0x5011e1(0x80)](_0xed1624),_0xed1624=Math[_0x5011e1(0x83)](_0xed1624*1.5,0xea60);}}async['processInbox'](){const _0x1da170=a0_0x13784e;try{let _0x5d6b3f=(await this[_0x1da170(0xbe)](_0x1da170(0x74),{'alias':this['alias'],'limit':0xa}))?.[_0x1da170(0x84)]||[];for(let _0x1e48d2 of _0x5d6b3f)await this['call'](_0x1da170(0xae),{'alias':this['alias'],'message_id':_0x1e48d2['id']}),this['log']('←\x20'+_0x1e48d2[_0x1da170(0x97)]+':\x20'+_0x1e48d2['content'][_0x1da170(0x9e)](0x0,0x3c)),this[_0x1da170(0x78)](_0x1da170(0x9a),_0x1e48d2),this[_0x1da170(0x78)](_0x1da170(0xa8),_0x1e48d2);}catch(_0x45bcb1){this[_0x1da170(0x9b)](_0x1da170(0x81)+_0x45bcb1[_0x1da170(0xa8)]);}}[a0_0x13784e(0x80)](_0x1d5454){return new Promise(_0x3898a8=>setTimeout(_0x3898a8,_0x1d5454));}}function a0_0x2c3e(_0x2047c9,_0x13e659){_0x2047c9=_0x2047c9-0x69;const _0x9842dc=a0_0x9842();let _0x2c3e53=_0x9842dc[_0x2047c9];return _0x2c3e53;}var $=T;export{$ as default,T as CommHub};function a0_0x9842(){const _0xaaa601=['5506540WDfdGS','startsWith','Bearer\x20','heartbeatInterval','abort','from_session','7AsLnQu','application/json,\x20text/event-stream','task','log','replace','pop','slice','parse','agent','toTimeString','Authorization','new_message','384840hIXesK','body','data:\x20','SSE\x20failed:\x20','message','running','server','/events/',']\x20[commhub:','read','ack_inbox','11632AlRMxi','heartbeat\x20failed:\x20','name','s...','get_all_status','content','sseAbort','token','38346ooeyFP','sdk','SSE\x20error:\x20','disconnected','1385260NWsfvA','getReader','connected','call','2.0','split','processInbox','1422pOAwSR','send_task','send','result','456892ZsKnFJ','3UuHSFE','offline','SSE\x20connected','completed','heartbeatTimer','22EjxJEd','get_inbox','24hrhSJn','97603iWofeX','reply','emit','connect','4VlqAiy','text','type','catch','match','report_status','sleep','inbox\x20error:\x20','connectSSE','min','messages','SSE\x20reconnecting\x20in\x20','idle','text/event-stream','error','broadcast','/mcp','now','status','tools/call','alias','reconnectDelay','url','POST'];a0_0x9842=function(){return _0xaaa601;};return a0_0x9842();}
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0xd38356=a0_0x5302;function a0_0x49ab(){const _0x45aaa4=['connected','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','replied','starting\x20SSE\x20listener...','→\x20injected\x20task\x20','data:\x20','type','new_task','statusText','SSE\x20fatal:\x20','7715aYjHTQ','\x20PROJECT_ENV=','Priority\x20(default:\x20normal)','new_message','priority','...\x20TMUX=','content','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','Current\x20task\x20description','token','Authorization','exit','write','task','connect','length','notification','fatal:\x20','2025-03-26','join','failed','working','object','report_status','SSE\x20error:\x20','\x20from\x20','1020213kQXwtI','\x22\x20(','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','error','Message\x20content','\x20RESUME_ID=','←\x20message\x20from\x20','Reply\x20text\x20/\x20result\x20summary','body','find','5619524haQXka','shutting\x20down,\x20reporting\x20offline...','SIGINT','commhub-channel','ready\x20—\x20waiting\x20for\x20events','SIGTERM','indexOf','application/json','from','\x20ALIAS=','slice','utf-8','cancelled','commhub_reply','404591brxMTW','text','416weRqQo','trim','connecting\x20to\x20','decode','end','http://127.0.0.1:9200','from_session','parse','Progress\x200-100','1439580Mfelcv','Session\x20alias:\x20','read','commhub','in_progress','commhub_report_status','stderr','\x20priority=','130JdZmZK','2.0','string','Bearer\x20','SSE\x20stream\x20ended,\x20reconnecting...','561657wzjEKn','stringify','commhub_send_message','3258uGOVPe','setRequestHandler','messages','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','message_id','startsWith','split','4193WBSgLS','then','blocked','132oWDtVp','result','unknown\x20tool','heartbeat\x20failed:\x20','notifications/claude/channel','send_message','message','idle','init\x20failed:\x20','catch','.anet','application/json,\x20text/event-stream','6FvODhr','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','cwd','hub','Task\x20content','CommHub\x20init\x20failed:\x20','commhub_get_all_status','initialize','ENV:\x20URL=','tmux\x20display-message\x20-p\x20\x27#S\x27','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','toTimeString','commhub_send_task','completed','status','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>',']\x20[commhub]\x20','SSE\x20connected\x20as\x20\x22','/events/','alias','normal','stdin','0.3.0','delete','/mcp','registered\x20as\x20\x22','params','replace','no\x20response','.env','claude-code','ack_inbox','\x20CWD=',':\x20inbox_count=','.claude/channels/commhub'];a0_0x49ab=function(){return _0x45aaa4;};return a0_0x49ab();}(function(_0x2ba34a,_0x55ba8b){const _0x569052=a0_0x5302,_0x3fde4f=_0x2ba34a();while(!![]){try{const _0x1b4f31=parseInt(_0x569052(0x211))/0x1*(parseInt(_0x569052(0x199))/0x2)+-parseInt(_0x569052(0x204))/0x3+-parseInt(_0x569052(0x1eb))/0x4+-parseInt(_0x569052(0x1c6))/0x5*(parseInt(_0x569052(0x214))/0x6)+parseInt(_0x569052(0x21b))/0x7*(parseInt(_0x569052(0x1fb))/0x8)+parseInt(_0x569052(0x1e0))/0x9*(parseInt(_0x569052(0x20c))/0xa)+-parseInt(_0x569052(0x1f9))/0xb*(-parseInt(_0x569052(0x18d))/0xc);if(_0x1b4f31===_0x55ba8b)break;else _0x3fde4f['push'](_0x3fde4f['shift']());}catch(_0x1eca55){_0x3fde4f['push'](_0x3fde4f['shift']());}}}(a0_0x49ab,0xd4d51));import{readFileSync as a0_0x2e2061,existsSync as a0_0x99a055}from'fs';import{join as a0_0x20b64e}from'path';import{hostname as a0_0x2bd5ce}from'os';import{execSync as a0_0x27164c}from'child_process';import{Server as a0_0x6a2329}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x810e71}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x3c976f,CallToolRequestSchema as a0_0x1a0db0}from'@modelcontextprotocol/sdk/types.js';function p(_0x21d0c1){const _0x3003aa=a0_0x5302;if(!a0_0x99a055(_0x21d0c1))return;for(let _0x1d8491 of a0_0x2e2061(_0x21d0c1,_0x3003aa(0x1f6))[_0x3003aa(0x21a)]('\x0a')){let _0x2536dd=_0x1d8491[_0x3003aa(0x1fc)]();if(!_0x2536dd||_0x2536dd[_0x3003aa(0x219)]('#'))continue;let _0x13dfbd=_0x2536dd[_0x3003aa(0x1f1)]('=');if(_0x13dfbd<0x0)continue;let _0xe01595=_0x2536dd[_0x3003aa(0x1f5)](0x0,_0x13dfbd)[_0x3003aa(0x1fc)](),_0x5a8cb4=_0x2536dd['slice'](_0x13dfbd+0x1)[_0x3003aa(0x1fc)]()[_0x3003aa(0x1b4)](/^["']|["']$/g,'');if(!process.env[_0xe01595])process.env[_0xe01595]=_0x5a8cb4;}}var C=process.env.HOME||'~',T=a0_0x20b64e(C,a0_0xd38356(0x1bb));p(a0_0x20b64e(T,a0_0xd38356(0x1b6)));var L=process['cwd']()[a0_0xd38356(0x1b4)](/\//g,'-');p(a0_0x20b64e(T,L,a0_0xd38356(0x1b6)));function U(){const _0x1028c6=a0_0xd38356;try{return a0_0x27164c(_0x1028c6(0x1a2),{'encoding':'utf-8','timeout':0x7d0})[_0x1028c6(0x1fc)]();}catch{return'';}}function c(){const _0x5c866e=a0_0xd38356;try{let _0x4cd8ed=a0_0x20b64e(C,_0x5c866e(0x197),'config.json');if(a0_0x99a055(_0x4cd8ed))return JSON[_0x5c866e(0x202)](a0_0x2e2061(_0x4cd8ed,_0x5c866e(0x1f6)));}catch{}return{};}function a0_0x5302(_0x3aafe1,_0x5072df){_0x3aafe1=_0x3aafe1-0x18c;const _0x49aba6=a0_0x49ab();let _0x530274=_0x49aba6[_0x3aafe1];return _0x530274;}var H=c(),D=process.env.COMMHUB_URL||H[a0_0xd38356(0x19c)]||a0_0xd38356(0x200),f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0x2bd5ce(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto['randomUUID'](),X=process.env.COMMHUB_TOKEN||H[a0_0xd38356(0x1cf)]||'';function Y(_0x592073){const _0x55662c=a0_0xd38356;let _0x3cb345=new Date()[_0x55662c(0x1a4)]()['slice'](0x0,0x8);process[_0x55662c(0x20a)][_0x55662c(0x1d2)]('['+_0x3cb345+_0x55662c(0x1a9)+_0x592073+'\x0a');}function h(_0x26b2f2){return new Promise(_0x2106d1=>setTimeout(_0x2106d1,_0x26b2f2));}Y(a0_0xd38356(0x1a1)+D+a0_0xd38356(0x1f4)+Z+a0_0xd38356(0x1e6)+w[a0_0xd38356(0x1f5)](0x0,0x8)+a0_0xd38356(0x1cb)+(f||'none')+a0_0xd38356(0x1b9)+process[a0_0xd38356(0x19b)]()+a0_0xd38356(0x1c7)+L);var k=new Map(),K=new a0_0x6a2329({'name':a0_0xd38356(0x1ee),'version':'0.3.0'},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0xd38356(0x1a8),a0_0xd38356(0x1e2),a0_0xd38356(0x1cd),a0_0xd38356(0x1e3),a0_0xd38356(0x205)+Z][a0_0xd38356(0x1d9)]('\x0a')});K[a0_0xd38356(0x215)](a0_0x3c976f,async()=>({'tools':[{'name':'commhub_reply','description':a0_0xd38356(0x217),'inputSchema':{'type':a0_0xd38356(0x1dc),'properties':{'task_id':{'type':a0_0xd38356(0x20e),'description':a0_0xd38356(0x19a)},'text':{'type':a0_0xd38356(0x20e),'description':a0_0xd38356(0x1e8)},'status':{'type':'string','enum':['completed',a0_0xd38356(0x1da),a0_0xd38356(0x1f7),'blocked',a0_0xd38356(0x1e4),a0_0xd38356(0x208)],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':[a0_0xd38356(0x1fa)]}},{'name':a0_0xd38356(0x209),'description':'Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','inputSchema':{'type':a0_0xd38356(0x1dc),'properties':{'status':{'type':a0_0xd38356(0x20e),'enum':['working','idle','blocked',a0_0xd38356(0x1e4)]},'task':{'type':a0_0xd38356(0x20e),'description':a0_0xd38356(0x1ce)},'progress':{'type':'number','description':a0_0xd38356(0x203)}},'required':[a0_0xd38356(0x1a7)]}},{'name':a0_0xd38356(0x1a5),'description':a0_0xd38356(0x1a3),'inputSchema':{'type':'object','properties':{'alias':{'type':a0_0xd38356(0x20e),'description':'Target\x20session\x20alias'},'task':{'type':a0_0xd38356(0x20e),'description':a0_0xd38356(0x19d)},'priority':{'type':'string','enum':['high','normal','low'],'description':a0_0xd38356(0x1c8)}},'required':['alias',a0_0xd38356(0x1d3)]}},{'name':a0_0xd38356(0x213),'description':a0_0xd38356(0x1bd),'inputSchema':{'type':'object','properties':{'alias':{'type':a0_0xd38356(0x20e),'description':'Target\x20session\x20alias'},'message':{'type':'string','description':a0_0xd38356(0x1e5)}},'required':[a0_0xd38356(0x1ac),a0_0xd38356(0x193)]}},{'name':'commhub_get_all_status','description':'Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','inputSchema':{'type':a0_0xd38356(0x1dc),'properties':{}}}]}));async function P(_0x47129e,_0x29dbe0){const _0x18a29f=a0_0xd38356;let _0x58e61c=await fetch(D+'/mcp',{'method':'POST','headers':{'Content-Type':_0x18a29f(0x1f2),'Accept':_0x18a29f(0x198),...X?{'Authorization':_0x18a29f(0x20f)+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x18a29f(0x20d),'id':0x1,'method':_0x18a29f(0x1a0),'params':{'protocolVersion':_0x18a29f(0x1d8),'capabilities':{},'clientInfo':{'name':'commhub-channel','version':_0x18a29f(0x1af)}}})});if(!_0x58e61c['ok']){let _0x5f2879=await _0x58e61c['text']();return Y(_0x18a29f(0x19e)+_0x58e61c[_0x18a29f(0x1a7)]+'\x20'+_0x5f2879[_0x18a29f(0x1f5)](0x0,0x64)),{'ok':!0x1,'error':_0x18a29f(0x195)+_0x58e61c[_0x18a29f(0x1a7)]};}await _0x58e61c[_0x18a29f(0x1fa)]();let _0x51eca1=(await(await fetch(D+_0x18a29f(0x1b1),{'method':'POST','headers':{'Content-Type':_0x18a29f(0x1f2),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x18a29f(0x20f)+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x18a29f(0x20d),'id':0x2,'method':'tools/call','params':{'name':_0x47129e,'arguments':_0x29dbe0}})}))['text']())[_0x18a29f(0x21a)]('\x0a')[_0x18a29f(0x1ea)](_0x276e67=>_0x276e67[_0x18a29f(0x219)]('data:\x20'));if(_0x51eca1){let _0x4cb5be=JSON['parse'](_0x51eca1['slice'](0x6));return _0x4cb5be?.[_0x18a29f(0x18e)]?.[_0x18a29f(0x1cc)]?.[0x0]?.[_0x18a29f(0x1fa)]?JSON[_0x18a29f(0x202)](_0x4cb5be[_0x18a29f(0x18e)]['content'][0x0][_0x18a29f(0x1fa)]):_0x4cb5be;}return{'ok':!0x1,'error':_0x18a29f(0x1b5)};}K[a0_0xd38356(0x215)](a0_0x1a0db0,async _0x3ee977=>{const _0x2ad307=a0_0xd38356;let {name:_0x3cddc9,arguments:_0x332700}=_0x3ee977[_0x2ad307(0x1b3)];if(_0x3cddc9===_0x2ad307(0x1f8)){let {task_id:_0x337c72,text:_0x276008,status:_0x4d7990}=_0x332700;if(_0x4d7990===_0x2ad307(0x1a6)||_0x4d7990==='failed'||_0x4d7990===_0x2ad307(0x1f7)){let _0x3752fc=_0x4d7990===_0x2ad307(0x1a6)?_0x2ad307(0x1be):_0x4d7990,_0x281e5e=_0x337c72?k['get'](_0x337c72)||'hub':_0x2ad307(0x19c),_0x47ef03=await P('send_reply',{'alias':_0x281e5e,'text':_0x276008,'in_reply_to':_0x337c72||void 0x0,'status':_0x3752fc,'from_session':Z});if(_0x337c72)k[_0x2ad307(0x1b0)](_0x337c72);return{'content':[{'type':'text','text':JSON['stringify'](_0x47ef03)}]};}let _0x42ee67=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x4d7990===_0x2ad307(0x18c)?_0x2ad307(0x18c):_0x4d7990==='error'?_0x2ad307(0x1e4):_0x2ad307(0x1db),'task':_0x276008[_0x2ad307(0x1f5)](0x0,0xc8),'output':_0x276008});return{'content':[{'type':_0x2ad307(0x1fa),'text':JSON[_0x2ad307(0x212)](_0x42ee67)}]};}if(_0x3cddc9==='commhub_report_status'){let {status:_0x35e756,task:_0x6d506b,progress:_0x2ade2c}=_0x332700,_0x1f88f7=await P(_0x2ad307(0x1dd),{'resume_id':w,'alias':Z,'status':_0x35e756,'task':_0x6d506b,'progress':_0x2ade2c});return{'content':[{'type':_0x2ad307(0x1fa),'text':JSON[_0x2ad307(0x212)](_0x1f88f7)}]};}if(_0x3cddc9===_0x2ad307(0x1a5)){let {alias:_0x358b50,task:_0xc58a7,priority:_0x58a57e}=_0x332700,_0x35b3c1=await P('send_task',{'alias':_0x358b50,'task':_0xc58a7,'priority':_0x58a57e||_0x2ad307(0x1ad),'from_session':Z});return{'content':[{'type':'text','text':JSON['stringify'](_0x35b3c1)}]};}if(_0x3cddc9===_0x2ad307(0x213)){let {alias:_0x397ccc,message:_0x8f44b5}=_0x332700,_0x5a1a53=await P(_0x2ad307(0x192),{'alias':_0x397ccc,'message':_0x8f44b5,'from_session':Z});return{'content':[{'type':_0x2ad307(0x1fa),'text':JSON[_0x2ad307(0x212)](_0x5a1a53)}]};}if(_0x3cddc9===_0x2ad307(0x19f)){let _0x4fc0ac=await P('get_all_status',{});return{'content':[{'type':'text','text':JSON[_0x2ad307(0x212)](_0x4fc0ac)}]};}return{'content':[{'type':'text','text':JSON[_0x2ad307(0x212)]({'error':_0x2ad307(0x18f)})}]};});async function v(){const _0x328740=a0_0xd38356;let _0x5acb60=D+_0x328740(0x1ab)+encodeURIComponent(Z),_0x31a308={};if(X)_0x31a308[_0x328740(0x1d0)]=_0x328740(0x20f)+X;Y(_0x328740(0x1fd)+_0x5acb60);while(!0x0){try{let _0x1acf1e=await fetch(_0x5acb60,{'headers':_0x31a308});if(!_0x1acf1e['ok']){Y(_0x328740(0x1de)+_0x1acf1e[_0x328740(0x1a7)]+'\x20'+_0x1acf1e[_0x328740(0x1c4)]),await h(0x1388);continue;}let _0x33929c=_0x1acf1e[_0x328740(0x1e9)]['getReader'](),_0x10ccc7=new TextDecoder(),_0x37f4fd='';while(!0x0){let {done:_0x6ac4ed,value:_0xc67f15}=await _0x33929c[_0x328740(0x206)]();if(_0x6ac4ed)break;_0x37f4fd+=_0x10ccc7[_0x328740(0x1fe)](_0xc67f15,{'stream':!0x0});let _0x12fe88=_0x37f4fd[_0x328740(0x21a)]('\x0a\x0a');_0x37f4fd=_0x12fe88['pop']()||'';for(let _0x6ace44 of _0x12fe88){let _0x538267=_0x6ace44[_0x328740(0x21a)]('\x0a')['find'](_0x37022b=>_0x37022b[_0x328740(0x219)](_0x328740(0x1c1)));if(!_0x538267)continue;try{let _0xdfcf78=JSON[_0x328740(0x202)](_0x538267[_0x328740(0x1f5)](0x6));await u(_0xdfcf78);}catch(_0xb59b3c){Y('parse\x20error:\x20'+_0xb59b3c);}}}Y(_0x328740(0x210));}catch(_0x3fa181){Y('SSE\x20connection\x20error:\x20'+_0x3fa181);}await h(0xbb8);}}async function u(_0x403377){const _0x352af6=a0_0xd38356;if(_0x403377[_0x352af6(0x1c2)]===_0x352af6(0x1bc)){Y(_0x352af6(0x1aa)+Z+'\x22');return;}if(_0x403377[_0x352af6(0x1c2)]===_0x352af6(0x1c9)){if(Y(_0x352af6(0x1e7)+_0x403377[_0x352af6(0x1f3)]+':\x20'+_0x403377['message'][_0x352af6(0x1f5)](0x0,0x3c)),await K['notification']({'method':_0x352af6(0x191),'params':{'content':_0x403377[_0x352af6(0x193)],'meta':{'sender':_0x403377[_0x352af6(0x1f3)]||'hub','sender_id':_0x352af6(0x207),'user':_0x403377[_0x352af6(0x1f3)]||_0x352af6(0x19c),'priority':_0x352af6(0x1ad)}}}),_0x403377[_0x352af6(0x218)])await P(_0x352af6(0x1b8),{'alias':Z,'message_id':_0x403377['message_id']});return;}if(_0x403377['type']===_0x352af6(0x1c3)||_0x403377['type']==='broadcast'){Y('←\x20'+_0x403377[_0x352af6(0x1c2)]+_0x352af6(0x1ba)+_0x403377['inbox_count']+_0x352af6(0x20b)+(_0x403377[_0x352af6(0x1ca)]||_0x352af6(0x1ad)));let _0x251a63=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0x251a63?.['ok']&&_0x251a63['messages']?.[_0x352af6(0x1d5)]>0x0)for(let _0x3f6892 of _0x251a63[_0x352af6(0x216)]){let _0x115153={'sender':_0x3f6892[_0x352af6(0x201)]||_0x352af6(0x19c),'sender_id':'commhub','user':_0x3f6892[_0x352af6(0x201)]||_0x352af6(0x19c),'task_id':_0x3f6892['id'],'priority':_0x3f6892[_0x352af6(0x1ca)]||_0x352af6(0x1ad)};k['set'](_0x3f6892['id'],_0x3f6892['from_session']||_0x352af6(0x19c)),await K[_0x352af6(0x1d6)]({'method':_0x352af6(0x191),'params':{'content':_0x3f6892[_0x352af6(0x1cc)],'meta':_0x115153}}),Y(_0x352af6(0x1c0)+_0x3f6892['id'][_0x352af6(0x1f5)](0x0,0x8)+_0x352af6(0x1df)+_0x3f6892[_0x352af6(0x201)]+':\x20'+_0x3f6892[_0x352af6(0x1cc)]['slice'](0x0,0x3c)),await P(_0x352af6(0x1b8),{'alias':Z,'message_id':_0x3f6892['id']});}}}async function S(){const _0x1cdd62=a0_0xd38356;let _0x3263c4=new a0_0x810e71();await K[_0x1cdd62(0x1d4)](_0x3263c4),Y('MCP\x20stdio\x20connected'),Y(_0x1cdd62(0x1bf)),v()[_0x1cdd62(0x196)](_0x5b58de=>Y(_0x1cdd62(0x1c5)+_0x5b58de)),P('report_status',{'resume_id':w,'alias':Z,'status':_0x1cdd62(0x194),'server':a0_0x2bd5ce(),'hostname':a0_0x2bd5ce(),'agent':_0x1cdd62(0x1b7),'project_dir':process[_0x1cdd62(0x19b)](),'tmux_name':f||void 0x0})[_0x1cdd62(0x21c)](()=>Y(_0x1cdd62(0x1b2)+Z+_0x1cdd62(0x1e1)+w[_0x1cdd62(0x1f5)](0x0,0x8)+')'))[_0x1cdd62(0x196)](_0x318539=>Y('warning:\x20could\x20not\x20register:\x20'+_0x318539)),setInterval(()=>{const _0x31eb2d=_0x1cdd62;P('report_status',{'resume_id':w,'alias':Z,'status':_0x31eb2d(0x194),'server':a0_0x2bd5ce(),'hostname':a0_0x2bd5ce(),'agent':_0x31eb2d(0x1b7),'project_dir':process['cwd'](),'tmux_name':f||void 0x0})[_0x31eb2d(0x196)](_0x5378ac=>Y(_0x31eb2d(0x190)+_0x5378ac));},0x2bf20),Y(_0x1cdd62(0x1ef));}S()['catch'](_0x3aa0d9=>{const _0x34cdce=a0_0xd38356;Y(_0x34cdce(0x1d7)+_0x3aa0d9),process[_0x34cdce(0x1d1)](0x1);});async function N(){const _0x5c5438=a0_0xd38356;Y(_0x5c5438(0x1ec)),await P('report_status',{'resume_id':w,'alias':Z,'status':_0x5c5438(0x1e4),'task':'session\x20disconnected'})[_0x5c5438(0x196)](()=>{}),process['exit'](0x0);}process[a0_0xd38356(0x1ae)]['on'](a0_0xd38356(0x1ff),()=>N()),process['on'](a0_0xd38356(0x1f0),()=>N()),process['on'](a0_0xd38356(0x1ed),()=>N());
2
+ const a0_0x1120da=a0_0x4fb9;(function(_0xce1670,_0x3b0c4c){const _0x5123c6=a0_0x4fb9,_0x1346c4=_0xce1670();while(!![]){try{const _0x55be2d=-parseInt(_0x5123c6(0x1d0))/0x1+parseInt(_0x5123c6(0x1cc))/0x2*(parseInt(_0x5123c6(0x179))/0x3)+parseInt(_0x5123c6(0x1dd))/0x4+-parseInt(_0x5123c6(0x17c))/0x5+parseInt(_0x5123c6(0x174))/0x6+parseInt(_0x5123c6(0x167))/0x7+-parseInt(_0x5123c6(0x18d))/0x8;if(_0x55be2d===_0x3b0c4c)break;else _0x1346c4['push'](_0x1346c4['shift']());}catch(_0x1b07d0){_0x1346c4['push'](_0x1346c4['shift']());}}}(a0_0x2f51,0x6ce2c));import{readFileSync as a0_0x459b8d,existsSync as a0_0x36d345}from'fs';import{join as a0_0x5dd898}from'path';import{hostname as a0_0x4c6c2e}from'os';import{execSync as a0_0xe4fb5d}from'child_process';import{Server as a0_0x2570e2}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x59380a}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x3e87b5,CallToolRequestSchema as a0_0x32675a}from'@modelcontextprotocol/sdk/types.js';function p(_0x4dd11b){const _0x56da13=a0_0x4fb9;if(!a0_0x36d345(_0x4dd11b))return;for(let _0x54cbf6 of a0_0x459b8d(_0x4dd11b,_0x56da13(0x199))['split']('\x0a')){let _0x5995af=_0x54cbf6[_0x56da13(0x1a4)]();if(!_0x5995af||_0x5995af[_0x56da13(0x171)]('#'))continue;let _0x445ef1=_0x5995af[_0x56da13(0x1cf)]('=');if(_0x445ef1<0x0)continue;let _0x407f46=_0x5995af[_0x56da13(0x1e3)](0x0,_0x445ef1)[_0x56da13(0x1a4)](),_0x42c16b=_0x5995af[_0x56da13(0x1e3)](_0x445ef1+0x1)[_0x56da13(0x1a4)]()[_0x56da13(0x160)](/^["']|["']$/g,'');if(!process.env[_0x407f46])process.env[_0x407f46]=_0x42c16b;}}var C=process.env.HOME||'~',T=a0_0x5dd898(C,a0_0x1120da(0x16b));p(a0_0x5dd898(T,a0_0x1120da(0x164)));var L=process[a0_0x1120da(0x191)]()['replace'](/\//g,'-');p(a0_0x5dd898(T,L,a0_0x1120da(0x164)));function U(){const _0x9ce96f=a0_0x1120da;try{return a0_0xe4fb5d(_0x9ce96f(0x1b5),{'encoding':_0x9ce96f(0x199),'timeout':0x7d0})[_0x9ce96f(0x1a4)]();}catch{return'';}}function c(){const _0x3e09dc=a0_0x1120da;try{let _0x25272a=a0_0x5dd898(C,_0x3e09dc(0x1b8),_0x3e09dc(0x1bb));if(a0_0x36d345(_0x25272a))return JSON[_0x3e09dc(0x17e)](a0_0x459b8d(_0x25272a,'utf-8'));}catch{}return{};}var H=c(),D=process.env.COMMHUB_URL||H[a0_0x1120da(0x1d7)]||'http://127.0.0.1:9200',f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0x4c6c2e(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto[a0_0x1120da(0x1a1)](),X=process.env.COMMHUB_TOKEN||H[a0_0x1120da(0x163)]||'';function Y(_0x8995fe){const _0x222632=a0_0x1120da;let _0x5baaa8=new Date()['toTimeString']()[_0x222632(0x1e3)](0x0,0x8);process[_0x222632(0x182)][_0x222632(0x166)]('['+_0x5baaa8+_0x222632(0x193)+_0x8995fe+'\x0a');}function h(_0x148d5a){return new Promise(_0x48e33c=>setTimeout(_0x48e33c,_0x148d5a));}Y(a0_0x1120da(0x181)+D+'\x20ALIAS='+Z+'\x20RESUME_ID='+w[a0_0x1120da(0x1e3)](0x0,0x8)+a0_0x1120da(0x165)+(f||a0_0x1120da(0x1b4))+'\x20CWD='+process['cwd']()+'\x20PROJECT_ENV='+L);var k=new Map(),K=new a0_0x2570e2({'name':a0_0x1120da(0x18c),'version':a0_0x1120da(0x1da)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x1120da(0x175),a0_0x1120da(0x1d6),'Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.',a0_0x1120da(0x183),a0_0x1120da(0x19f)+Z][a0_0x1120da(0x1e0)]('\x0a')});K[a0_0x1120da(0x1cd)](a0_0x3e87b5,async()=>({'tools':[{'name':a0_0x1120da(0x1c4),'description':a0_0x1120da(0x195),'inputSchema':{'type':'object','properties':{'task_id':{'type':a0_0x1120da(0x1a8),'description':a0_0x1120da(0x1b2)},'text':{'type':a0_0x1120da(0x1a8),'description':a0_0x1120da(0x15e)},'status':{'type':a0_0x1120da(0x1a8),'enum':[a0_0x1120da(0x19b),a0_0x1120da(0x1ad),a0_0x1120da(0x176),'blocked',a0_0x1120da(0x1e2),a0_0x1120da(0x15b)],'description':a0_0x1120da(0x1a5)}},'required':['text']}},{'name':a0_0x1120da(0x1d8),'description':a0_0x1120da(0x1c3),'inputSchema':{'type':a0_0x1120da(0x187),'properties':{'status':{'type':a0_0x1120da(0x1a8),'enum':[a0_0x1120da(0x1c6),a0_0x1120da(0x170),a0_0x1120da(0x19a),a0_0x1120da(0x1e2)]},'task':{'type':'string','description':a0_0x1120da(0x1bc)},'progress':{'type':a0_0x1120da(0x1db),'description':a0_0x1120da(0x17f)}},'required':[a0_0x1120da(0x1d5)]}},{'name':a0_0x1120da(0x188),'description':'Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','inputSchema':{'type':'object','properties':{'alias':{'type':'string','description':a0_0x1120da(0x1de)},'task':{'type':a0_0x1120da(0x1a8),'description':a0_0x1120da(0x1a9)},'priority':{'type':a0_0x1120da(0x1a8),'enum':[a0_0x1120da(0x1d3),a0_0x1120da(0x1c5),a0_0x1120da(0x16d)],'description':'Priority\x20(default:\x20normal)'}},'required':['alias',a0_0x1120da(0x1b7)]}},{'name':a0_0x1120da(0x16a),'description':'Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x1120da(0x1a8),'description':a0_0x1120da(0x1de)},'message':{'type':a0_0x1120da(0x1a8),'description':a0_0x1120da(0x159)}},'required':['alias',a0_0x1120da(0x190)]}},{'name':a0_0x1120da(0x16c),'description':'Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','inputSchema':{'type':'object','properties':{}}}]}));async function P(_0x5680bc,_0x36004c){const _0x165bb6=a0_0x1120da;let _0x5dccc1=await fetch(D+_0x165bb6(0x162),{'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x165bb6(0x1b0)+X}:{}},'body':JSON[_0x165bb6(0x17b)]({'jsonrpc':'2.0','id':0x1,'method':_0x165bb6(0x1cb),'params':{'protocolVersion':_0x165bb6(0x18b),'capabilities':{},'clientInfo':{'name':_0x165bb6(0x18c),'version':_0x165bb6(0x1da)}}})});if(!_0x5dccc1['ok']){let _0xfb3244=await _0x5dccc1[_0x165bb6(0x19e)]();return Y(_0x165bb6(0x17a)+_0x5dccc1['status']+'\x20'+_0xfb3244['slice'](0x0,0x64)),{'ok':!0x1,'error':_0x165bb6(0x1b9)+_0x5dccc1[_0x165bb6(0x1d5)]};}await _0x5dccc1['text']();let _0x52047c=(await(await fetch(D+_0x165bb6(0x162),{'method':'POST','headers':{'Content-Type':_0x165bb6(0x1ab),'Accept':_0x165bb6(0x1ac),...X?{'Authorization':_0x165bb6(0x1b0)+X}:{}},'body':JSON[_0x165bb6(0x17b)]({'jsonrpc':_0x165bb6(0x173),'id':0x2,'method':_0x165bb6(0x185),'params':{'name':_0x5680bc,'arguments':_0x36004c}})}))[_0x165bb6(0x19e)]())[_0x165bb6(0x180)]('\x0a')[_0x165bb6(0x194)](_0x5b9130=>_0x5b9130[_0x165bb6(0x171)](_0x165bb6(0x17d)));if(_0x52047c){let _0x1aaac0=JSON['parse'](_0x52047c['slice'](0x6));return _0x1aaac0?.['result']?.[_0x165bb6(0x169)]?.[0x0]?.[_0x165bb6(0x19e)]?JSON[_0x165bb6(0x17e)](_0x1aaac0['result'][_0x165bb6(0x169)][0x0][_0x165bb6(0x19e)]):_0x1aaac0;}return{'ok':!0x1,'error':_0x165bb6(0x1c2)};}K[a0_0x1120da(0x1cd)](a0_0x32675a,async _0x39d7ab=>{const _0x58078e=a0_0x1120da;let {name:_0x2cbdcc,arguments:_0x345c03}=_0x39d7ab[_0x58078e(0x177)];if(_0x2cbdcc===_0x58078e(0x1c4)){let {task_id:_0x167ebd,text:_0x538ab5,status:_0x40bc46}=_0x345c03;if(_0x40bc46===_0x58078e(0x19b)||_0x40bc46==='failed'||_0x40bc46==='cancelled'){let _0x19b30c=_0x40bc46==='completed'?_0x58078e(0x1b6):_0x40bc46,_0xff36a9=_0x167ebd?k[_0x58078e(0x1d2)](_0x167ebd)||'hub':_0x58078e(0x1d7),_0xc7fbbc=await P(_0x58078e(0x19c),{'alias':_0xff36a9,'text':_0x538ab5,'in_reply_to':_0x167ebd||void 0x0,'status':_0x19b30c,'from_session':Z});if(_0x167ebd)k['delete'](_0x167ebd);return{'content':[{'type':_0x58078e(0x19e),'text':JSON[_0x58078e(0x17b)](_0xc7fbbc)}]};}let _0x239326=await P(_0x58078e(0x1c9),{'resume_id':w,'alias':Z,'status':_0x40bc46==='blocked'?_0x58078e(0x19a):_0x40bc46===_0x58078e(0x1e2)?_0x58078e(0x1e2):_0x58078e(0x1c6),'task':_0x538ab5[_0x58078e(0x1e3)](0x0,0xc8),'output':_0x538ab5});return{'content':[{'type':_0x58078e(0x19e),'text':JSON[_0x58078e(0x17b)](_0x239326)}]};}if(_0x2cbdcc===_0x58078e(0x1d8)){let {status:_0x54d1fd,task:_0x373be8,progress:_0x3b00b5}=_0x345c03,_0x20afcd=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x54d1fd,'task':_0x373be8,'progress':_0x3b00b5});return{'content':[{'type':_0x58078e(0x19e),'text':JSON[_0x58078e(0x17b)](_0x20afcd)}]};}if(_0x2cbdcc===_0x58078e(0x188)){let {alias:_0x50fb18,task:_0x4c7ff6,priority:_0x382784}=_0x345c03,_0x227683=await P('send_task',{'alias':_0x50fb18,'task':_0x4c7ff6,'priority':_0x382784||_0x58078e(0x1c5),'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x58078e(0x17b)](_0x227683)}]};}if(_0x2cbdcc==='commhub_send_message'){let {alias:_0x28cb72,message:_0x14b4e4}=_0x345c03,_0x1427e6=await P(_0x58078e(0x1aa),{'alias':_0x28cb72,'message':_0x14b4e4,'from_session':Z});return{'content':[{'type':_0x58078e(0x19e),'text':JSON[_0x58078e(0x17b)](_0x1427e6)}]};}if(_0x2cbdcc==='commhub_get_all_status'){let _0x46641c=await P(_0x58078e(0x189),{});return{'content':[{'type':_0x58078e(0x19e),'text':JSON[_0x58078e(0x17b)](_0x46641c)}]};}return{'content':[{'type':'text','text':JSON[_0x58078e(0x17b)]({'error':_0x58078e(0x1c7)})}]};});async function v(){const _0x3dc7bc=a0_0x1120da;let _0x24fc9=D+_0x3dc7bc(0x1b1)+encodeURIComponent(Z),_0x96bc68={};if(X)_0x96bc68['Authorization']=_0x3dc7bc(0x1b0)+X;Y(_0x3dc7bc(0x1be)+_0x24fc9);while(!0x0){try{let _0x34d41e=await fetch(_0x24fc9,{'headers':_0x96bc68});if(!_0x34d41e['ok']){Y(_0x3dc7bc(0x1ae)+_0x34d41e[_0x3dc7bc(0x1d5)]+'\x20'+_0x34d41e[_0x3dc7bc(0x1d9)]),await h(0x1388);continue;}let _0x4cd8c7=_0x34d41e[_0x3dc7bc(0x15c)][_0x3dc7bc(0x1d4)](),_0x53d11a=new TextDecoder(),_0x1fa201='';while(!0x0){let {done:_0x3fa8fa,value:_0x1e5e14}=await _0x4cd8c7[_0x3dc7bc(0x1a7)]();if(_0x3fa8fa)break;_0x1fa201+=_0x53d11a[_0x3dc7bc(0x15a)](_0x1e5e14,{'stream':!0x0});let _0x34e62c=_0x1fa201['split']('\x0a\x0a');_0x1fa201=_0x34e62c[_0x3dc7bc(0x196)]()||'';for(let _0x58359f of _0x34e62c){let _0x40ac1c=_0x58359f[_0x3dc7bc(0x180)]('\x0a')[_0x3dc7bc(0x194)](_0xdd77ff=>_0xdd77ff[_0x3dc7bc(0x171)](_0x3dc7bc(0x17d)));if(!_0x40ac1c)continue;try{let _0x55b40c=JSON['parse'](_0x40ac1c[_0x3dc7bc(0x1e3)](0x6));await u(_0x55b40c);}catch(_0x153902){Y(_0x3dc7bc(0x18e)+_0x153902);}}}Y(_0x3dc7bc(0x1a2));}catch(_0x4e5d4d){Y('SSE\x20connection\x20error:\x20'+_0x4e5d4d);}await h(0xbb8);}}async function u(_0x268164){const _0x52d337=a0_0x1120da;if(_0x268164[_0x52d337(0x1e1)]===_0x52d337(0x1dc)){Y('SSE\x20connected\x20as\x20\x22'+Z+'\x22');return;}if(_0x268164['type']==='new_message'){if(Y(_0x52d337(0x1af)+_0x268164[_0x52d337(0x178)]+':\x20'+_0x268164[_0x52d337(0x190)][_0x52d337(0x1e3)](0x0,0x3c)),await K[_0x52d337(0x1a6)]({'method':_0x52d337(0x1d1),'params':{'content':_0x268164['message'],'meta':{'sender':_0x268164[_0x52d337(0x178)]||'hub','sender_id':_0x52d337(0x1b3),'user':_0x268164[_0x52d337(0x178)]||_0x52d337(0x1d7),'priority':_0x52d337(0x1c5)}}}),_0x268164['message_id'])await P(_0x52d337(0x172),{'alias':Z,'message_id':_0x268164[_0x52d337(0x192)]});return;}if(_0x268164[_0x52d337(0x1e1)]===_0x52d337(0x197)||_0x268164[_0x52d337(0x1e1)]===_0x52d337(0x1c0)){Y('←\x20'+_0x268164[_0x52d337(0x1e1)]+_0x52d337(0x1ba)+_0x268164[_0x52d337(0x15f)]+'\x20priority='+(_0x268164[_0x52d337(0x18f)]||'normal'));let _0xd77c4a=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0xd77c4a?.['ok']&&_0xd77c4a['messages']?.[_0x52d337(0x1e4)]>0x0)for(let _0x49f3af of _0xd77c4a[_0x52d337(0x15d)]){let _0x40361f={'sender':_0x49f3af[_0x52d337(0x19d)]||_0x52d337(0x1d7),'sender_id':_0x52d337(0x1b3),'user':_0x49f3af[_0x52d337(0x19d)]||_0x52d337(0x1d7),'task_id':_0x49f3af['id'],'priority':_0x49f3af['priority']||_0x52d337(0x1c5)};k['set'](_0x49f3af['id'],_0x49f3af[_0x52d337(0x19d)]||_0x52d337(0x1d7)),await K['notification']({'method':_0x52d337(0x1d1),'params':{'content':_0x49f3af[_0x52d337(0x169)],'meta':_0x40361f}}),Y('→\x20injected\x20task\x20'+_0x49f3af['id'][_0x52d337(0x1e3)](0x0,0x8)+_0x52d337(0x186)+_0x49f3af['from_session']+':\x20'+_0x49f3af['content']['slice'](0x0,0x3c)),await P(_0x52d337(0x172),{'alias':Z,'message_id':_0x49f3af['id']});}}}function a0_0x4fb9(_0xb3eec0,_0x13abe8){_0xb3eec0=_0xb3eec0-0x159;const _0x2f51ad=a0_0x2f51();let _0x4fb9a3=_0x2f51ad[_0xb3eec0];return _0x4fb9a3;}async function S(){const _0x3c72ed=a0_0x1120da;let _0x141955=new a0_0x59380a();await K[_0x3c72ed(0x18a)](_0x141955),Y('MCP\x20stdio\x20connected'),Y('starting\x20SSE\x20listener...'),v()['catch'](_0x34f449=>Y(_0x3c72ed(0x16e)+_0x34f449)),P(_0x3c72ed(0x1c9),{'resume_id':w,'alias':Z,'status':_0x3c72ed(0x170),'server':a0_0x4c6c2e(),'hostname':a0_0x4c6c2e(),'agent':'claude-code','project_dir':process['cwd'](),'tmux_name':f||void 0x0})[_0x3c72ed(0x1c1)](()=>Y('registered\x20as\x20\x22'+Z+_0x3c72ed(0x161)+w[_0x3c72ed(0x1e3)](0x0,0x8)+')'))['catch'](_0x2d33a5=>Y(_0x3c72ed(0x1df)+_0x2d33a5)),setInterval(()=>{const _0x28d4d2=_0x3c72ed;P('report_status',{'resume_id':w,'alias':Z,'status':_0x28d4d2(0x170),'server':a0_0x4c6c2e(),'hostname':a0_0x4c6c2e(),'agent':'claude-code','project_dir':process[_0x28d4d2(0x191)](),'tmux_name':f||void 0x0})['catch'](_0x16d6c4=>Y(_0x28d4d2(0x1a0)+_0x16d6c4));},0x2bf20),Y(_0x3c72ed(0x1a3));}function a0_0x2f51(){const _0x8e2e47=['high','getReader','status','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','hub','commhub_report_status','statusText','0.3.0','number','connected','1925344NqNdjp','Target\x20session\x20alias','warning:\x20could\x20not\x20register:\x20','join','type','error','slice','length','Message\x20content','decode','in_progress','body','messages','Reply\x20text\x20/\x20result\x20summary','inbox_count','replace','\x22\x20(','/mcp','token','.env','...\x20TMUX=','write','4467064AhslZr','catch','content','commhub_send_message','.claude/channels/commhub','commhub_get_all_status','low','SSE\x20fatal:\x20','SIGTERM','idle','startsWith','ack_inbox','2.0','4393260IVSTVy','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','cancelled','params','from','9SjkVmp','CommHub\x20init\x20failed:\x20','stringify','4285565Znvoru','data:\x20','parse','Progress\x200-100','split','ENV:\x20URL=','stderr','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','shutting\x20down,\x20reporting\x20offline...','tools/call','\x20from\x20','object','commhub_send_task','get_all_status','connect','2025-03-26','commhub-channel','915160OHGRXR','parse\x20error:\x20','priority','message','cwd','message_id',']\x20[commhub]\x20','find','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','pop','new_task','exit','utf-8','blocked','completed','send_reply','from_session','text','Session\x20alias:\x20','heartbeat\x20failed:\x20','randomUUID','SSE\x20stream\x20ended,\x20reconnecting...','ready\x20—\x20waiting\x20for\x20events','trim','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','notification','read','string','Task\x20content','send_message','application/json','application/json,\x20text/event-stream','failed','SSE\x20error:\x20','←\x20message\x20from\x20','Bearer\x20','/events/','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','commhub','none','tmux\x20display-message\x20-p\x20\x27#S\x27','replied','task','.anet','init\x20failed:\x20',':\x20inbox_count=','config.json','Current\x20task\x20description','end','connecting\x20to\x20','SIGINT','broadcast','then','no\x20response','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','commhub_reply','normal','working','unknown\x20tool','fatal:\x20','report_status','session\x20disconnected','initialize','236124nGjXLD','setRequestHandler','stdin','indexOf','788380rBRfvJ','notifications/claude/channel','get'];a0_0x2f51=function(){return _0x8e2e47;};return a0_0x2f51();}S()[a0_0x1120da(0x168)](_0x58c2ed=>{const _0x5675b0=a0_0x1120da;Y(_0x5675b0(0x1c8)+_0x58c2ed),process[_0x5675b0(0x198)](0x1);});async function N(){const _0x3e6210=a0_0x1120da;Y(_0x3e6210(0x184)),await P(_0x3e6210(0x1c9),{'resume_id':w,'alias':Z,'status':_0x3e6210(0x1e2),'task':_0x3e6210(0x1ca)})['catch'](()=>{}),process[_0x3e6210(0x198)](0x0);}process[a0_0x1120da(0x1ce)]['on'](a0_0x1120da(0x1bd),()=>N()),process['on'](a0_0x1120da(0x16f),()=>N()),process['on'](a0_0x1120da(0x1bf),()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.0.0-preview.22",
3
+ "version": "2.0.0-preview.23",
4
4
  "description": "AI Agent Network — Server + Client + Setup in one package. SSE real-time communication for multi-agent orchestration.",
5
5
  "type": "module",
6
6
  "main": "dist/src/client.js",