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

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_0x4ced14=a0_0x3299;function a0_0x3299(_0x146f96,_0x5c3219){_0x146f96=_0x146f96-0x7b;const _0x2ef8cd=a0_0x2ef8();let _0x3299ef=_0x2ef8cd[_0x146f96];return _0x3299ef;}(function(_0x2c1816,_0x449e4a){const _0x3d5874=a0_0x3299,_0x2d6b8b=_0x2c1816();while(!![]){try{const _0x2bdac5=-parseInt(_0x3d5874(0xca))/0x1+parseInt(_0x3d5874(0xd2))/0x2+parseInt(_0x3d5874(0xad))/0x3+parseInt(_0x3d5874(0xd4))/0x4*(-parseInt(_0x3d5874(0xd1))/0x5)+parseInt(_0x3d5874(0xd6))/0x6+parseInt(_0x3d5874(0xa5))/0x7+parseInt(_0x3d5874(0xd0))/0x8*(-parseInt(_0x3d5874(0x7d))/0x9);if(_0x2bdac5===_0x449e4a)break;else _0x2d6b8b['push'](_0x2d6b8b['shift']());}catch(_0x8ccf10){_0x2d6b8b['push'](_0x2d6b8b['shift']());}}}(a0_0x2ef8,0x2f91d));import{EventEmitter as a0_0x14de88}from'events';function a0_0x2ef8(){const _0x2c6feb=['/events/','connected','cwd','1536WHTOPT','550pYzyaf','159070vdMQpG','sdk','156kHeTbr','running','1771854ytoQpp','data:\x20','signal','24372xcViud','url','type','read','connect','s...','body','offline','from_session','resumeId','inbox\x20error:\x20','error','agent','messages','connectSSE','token','message','completed','SSE\x20reconnecting\x20in\x20','POST','replace','status','get_inbox','abort','Bearer\x20','alias','log','getAllStatus','heartbeatTimer','processInbox','registered','AbortError','server','idle','task','pop','call','sdk-','application/json','min','2366840tJKhyI','getReader','reconnectDelay','catch','heartbeat\x20failed:\x20','decode','send','startsWith','1010346iNoHSv','SSE\x20failed:\x20','broadcast','slice','autoConnect','parse',']\x20[commhub:','content','Authorization','normal','reply','match','get_all_status','toTimeString','emit','send_message','sseAbort','now','SSE\x20error:\x20','heartbeatInterval','application/json,\x20text/event-stream','report_status','SSE\x20connected','text/event-stream','new_message','name','2.0','text','sleep','330675ZZgnnT','new_task','stringify'];a0_0x2ef8=function(){return _0x2c6feb;};return a0_0x2ef8();}import{hostname as a0_0x12598a}from'os';class T extends a0_0x14de88{['url'];[a0_0x4ced14(0x96)];[a0_0x4ced14(0x8c)];[a0_0x4ced14(0x89)];['resumeId'];[a0_0x4ced14(0xc0)];[a0_0x4ced14(0xa7)];['heartbeatTimer'];[a0_0x4ced14(0xbd)];[a0_0x4ced14(0xd5)]=!0x1;constructor(_0x2c6d03){const _0x1d8f92=a0_0x4ced14;super();if(this[_0x1d8f92(0x7e)]=_0x2c6d03['url'][_0x1d8f92(0x91)](/\/$/,''),this[_0x1d8f92(0x96)]=_0x2c6d03['alias'],this[_0x1d8f92(0x8c)]=_0x2c6d03['token'],this[_0x1d8f92(0x89)]=_0x2c6d03[_0x1d8f92(0x89)]||_0x1d8f92(0xd3),this[_0x1d8f92(0x86)]=_0x1d8f92(0xa2)+_0x2c6d03[_0x1d8f92(0x96)]+'-'+Date[_0x1d8f92(0xbe)]()['toString'](0x24),this[_0x1d8f92(0xc0)]=_0x2c6d03[_0x1d8f92(0xc0)]??0x2bf20,this[_0x1d8f92(0xa7)]=_0x2c6d03[_0x1d8f92(0xa7)]??0xbb8,_0x2c6d03[_0x1d8f92(0xb1)]!==!0x1)this['connect']();}[a0_0x4ced14(0x97)](_0x32ea9e){const _0x4609dd=a0_0x4ced14;console[_0x4609dd(0x97)]('['+new Date()[_0x4609dd(0xba)]()[_0x4609dd(0xb0)](0x0,0x8)+_0x4609dd(0xb3)+this[_0x4609dd(0x96)]+']\x20'+_0x32ea9e);}async[a0_0x4ced14(0xa1)](_0x346395,_0x3f96e9){const _0x21362c=a0_0x4ced14;let _0x3f6cfb={'Content-Type':_0x21362c(0xa3),'Accept':_0x21362c(0xc1)};if(this[_0x21362c(0x8c)])_0x3f6cfb[_0x21362c(0xb5)]='Bearer\x20'+this[_0x21362c(0x8c)];let _0x14d6d4=await(await fetch(this[_0x21362c(0x7e)]+'/mcp',{'method':_0x21362c(0x90),'headers':_0x3f6cfb,'body':JSON[_0x21362c(0xcc)]({'jsonrpc':_0x21362c(0xc7),'id':Date['now'](),'method':'tools/call','params':{'name':_0x346395,'arguments':_0x3f96e9}})}))[_0x21362c(0xc8)](),_0x4ed5a1=_0x14d6d4[_0x21362c(0xb8)](/data: (.+)/),_0x1fe01d=_0x4ed5a1?JSON[_0x21362c(0xb2)](_0x4ed5a1[0x1]):JSON['parse'](_0x14d6d4),_0x35ddac=_0x1fe01d?.['result']?.[_0x21362c(0xb4)]?.[0x0]?.['text'];return _0x35ddac?JSON[_0x21362c(0xb2)](_0x35ddac):_0x1fe01d;}async[a0_0x4ced14(0x81)](){const _0x41f6ea=a0_0x4ced14;if(this[_0x41f6ea(0xd5)])return;this[_0x41f6ea(0xd5)]=!0x0,await this[_0x41f6ea(0x92)](_0x41f6ea(0x9e)),this[_0x41f6ea(0x97)](_0x41f6ea(0x9b)),this[_0x41f6ea(0x99)]=setInterval(()=>{const _0x1cd598=_0x41f6ea;this[_0x1cd598(0x92)]('idle')[_0x1cd598(0xa8)](_0x135d62=>this[_0x1cd598(0x97)](_0x1cd598(0xa9)+_0x135d62['message']));},this['heartbeatInterval']),this[_0x41f6ea(0x8b)]();}async['disconnect'](){const _0x1f0ac5=a0_0x4ced14;if(this['running']=!0x1,this[_0x1f0ac5(0xbd)]?.[_0x1f0ac5(0x94)](),this[_0x1f0ac5(0x99)])clearInterval(this[_0x1f0ac5(0x99)]);await this[_0x1f0ac5(0x92)](_0x1f0ac5(0x84))[_0x1f0ac5(0xa8)](()=>{}),this[_0x1f0ac5(0x97)]('disconnected');}async[a0_0x4ced14(0xab)](_0x509c3c,_0x39797b,_0x578e7c=a0_0x4ced14(0xb6)){const _0x3ed279=a0_0x4ced14;return this[_0x3ed279(0xa1)]('send_task',{'alias':_0x509c3c,'task':_0x39797b,'priority':_0x578e7c,'from_session':this[_0x3ed279(0x96)]});}async[a0_0x4ced14(0x8d)](_0x2ce930,_0x527d1c){const _0xdb6ff9=a0_0x4ced14;return this['call'](_0xdb6ff9(0xbc),{'alias':_0x2ce930,'message':_0x527d1c,'from_session':this[_0xdb6ff9(0x96)]});}async[a0_0x4ced14(0xb7)](_0xd42fcb,_0x389a67,_0x35bb45=a0_0x4ced14(0x8e)){return this['call']('reply',{'task_id':_0xd42fcb,'text':_0x389a67,'status':_0x35bb45});}async['status'](_0x4aa296,_0x5b5442){const _0x295d68=a0_0x4ced14;return this[_0x295d68(0xa1)](_0x295d68(0xc2),{'resume_id':this[_0x295d68(0x86)],'alias':this[_0x295d68(0x96)],'status':_0x4aa296,'server':a0_0x12598a(),'hostname':a0_0x12598a(),'agent':this[_0x295d68(0x89)],'project_dir':process[_0x295d68(0xcf)](),..._0x5b5442});}async[a0_0x4ced14(0x98)](){const _0x39baba=a0_0x4ced14;return this[_0x39baba(0xa1)](_0x39baba(0xb9),{});}async['broadcast'](_0x183500,_0x1057fa){const _0x22fb11=a0_0x4ced14;return this[_0x22fb11(0xa1)](_0x22fb11(0xaf),{'message':_0x183500,'filter_server':_0x1057fa?.[_0x22fb11(0x9d)],'filter_status':_0x1057fa?.[_0x22fb11(0x92)]});}async['connectSSE'](){const _0x2772af=a0_0x4ced14;let _0x5ebe76=encodeURIComponent(this[_0x2772af(0x96)]),_0x2e3690=this['url']+_0x2772af(0xcd)+_0x5ebe76,_0x242145=this['reconnectDelay'];while(this[_0x2772af(0xd5)]){try{this['sseAbort']=new AbortController();let _0x3342ee={'Accept':_0x2772af(0xc4)};if(this[_0x2772af(0x8c)])_0x3342ee['Authorization']=_0x2772af(0x95)+this['token'];let _0x2b4959=await fetch(_0x2e3690,{'headers':_0x3342ee,'signal':this[_0x2772af(0xbd)][_0x2772af(0x7c)]});if(!_0x2b4959['ok']||!_0x2b4959[_0x2772af(0x83)]){this[_0x2772af(0x97)](_0x2772af(0xae)+_0x2b4959[_0x2772af(0x92)]),await this[_0x2772af(0xc9)](_0x242145),_0x242145=Math[_0x2772af(0xa4)](_0x242145*1.5,0xea60);continue;}_0x242145=this[_0x2772af(0xa7)];let _0x5dd1fd=_0x2b4959['body'][_0x2772af(0xa6)](),_0x3fba34=new TextDecoder(),_0x54792b='';while(this[_0x2772af(0xd5)]){let {done:_0x289aa6,value:_0x1988f7}=await _0x5dd1fd[_0x2772af(0x80)]();if(_0x289aa6)break;_0x54792b+=_0x3fba34[_0x2772af(0xaa)](_0x1988f7,{'stream':!0x0});let _0x51d098=_0x54792b['split']('\x0a');_0x54792b=_0x51d098[_0x2772af(0xa0)]()||'';for(let _0x355bbb of _0x51d098){if(!_0x355bbb[_0x2772af(0xac)](_0x2772af(0x7b)))continue;try{let _0x16bdd8=JSON[_0x2772af(0xb2)](_0x355bbb['slice'](0x6));if(_0x16bdd8['type']===_0x2772af(0xce)){this['log'](_0x2772af(0xc3)),this[_0x2772af(0xbb)](_0x2772af(0xce));continue;}if(_0x16bdd8[_0x2772af(0x7f)]===_0x2772af(0xcb)||_0x16bdd8[_0x2772af(0x7f)]===_0x2772af(0xc5)||_0x16bdd8['type']==='broadcast')await this[_0x2772af(0x9a)]();}catch{}}}}catch(_0xb4ae13){if(_0xb4ae13[_0x2772af(0xc6)]===_0x2772af(0x9c))break;this['emit'](_0x2772af(0x88),_0xb4ae13),this['log'](_0x2772af(0xbf)+_0xb4ae13[_0x2772af(0x8d)]);}if(this[_0x2772af(0xd5)])this[_0x2772af(0xbb)]('disconnected'),this['log'](_0x2772af(0x8f)+_0x242145/0x3e8+_0x2772af(0x82)),await this[_0x2772af(0xc9)](_0x242145),_0x242145=Math[_0x2772af(0xa4)](_0x242145*1.5,0xea60);}}async[a0_0x4ced14(0x9a)](){const _0x2f9c91=a0_0x4ced14;try{let _0x16c331=(await this[_0x2f9c91(0xa1)](_0x2f9c91(0x93),{'alias':this[_0x2f9c91(0x96)],'limit':0xa}))?.[_0x2f9c91(0x8a)]||[];for(let _0x58697d of _0x16c331)await this[_0x2f9c91(0xa1)]('ack_inbox',{'alias':this[_0x2f9c91(0x96)],'message_id':_0x58697d['id']}),this[_0x2f9c91(0x97)]('←\x20'+_0x58697d[_0x2f9c91(0x85)]+':\x20'+_0x58697d['content']['slice'](0x0,0x3c)),this[_0x2f9c91(0xbb)](_0x2f9c91(0x9f),_0x58697d),this[_0x2f9c91(0xbb)](_0x2f9c91(0x8d),_0x58697d);}catch(_0x40c696){this[_0x2f9c91(0x97)](_0x2f9c91(0x87)+_0x40c696[_0x2f9c91(0x8d)]);}}[a0_0x4ced14(0xc9)](_0x2a0511){return new Promise(_0x2b8fec=>setTimeout(_0x2b8fec,_0x2a0511));}}var $=T;export{$ as default,T as CommHub};
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,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x2f5f5a=a0_0x435d;(function(_0x43b623,_0x12010a){const _0x4259a2=a0_0x435d,_0x285496=_0x43b623();while(!![]){try{const _0x186094=-parseInt(_0x4259a2(0xec))/0x1*(-parseInt(_0x4259a2(0x114))/0x2)+parseInt(_0x4259a2(0x10a))/0x3*(-parseInt(_0x4259a2(0x132))/0x4)+parseInt(_0x4259a2(0x105))/0x5*(parseInt(_0x4259a2(0x161))/0x6)+-parseInt(_0x4259a2(0x158))/0x7+-parseInt(_0x4259a2(0x147))/0x8*(parseInt(_0x4259a2(0xf7))/0x9)+-parseInt(_0x4259a2(0x134))/0xa+-parseInt(_0x4259a2(0x104))/0xb*(-parseInt(_0x4259a2(0x172))/0xc);if(_0x186094===_0x12010a)break;else _0x285496['push'](_0x285496['shift']());}catch(_0x3fc92b){_0x285496['push'](_0x285496['shift']());}}}(a0_0x3ae2,0xcd099));import{readFileSync as a0_0x55e6e4,existsSync as a0_0x48526e}from'fs';import{join as a0_0x1ff871}from'path';import{hostname as a0_0x161551}from'os';import{execSync as a0_0x3ba3a2}from'child_process';import{Server as a0_0x5219ed}from'@modelcontextprotocol/sdk/server/index.js';function a0_0x3ae2(){const _0xc45344=['message_id','ack_inbox','54376pbMYpa','then','SSE\x20connection\x20error:\x20','message','startsWith','application/json,\x20text/event-stream','Current\x20task\x20description','toTimeString','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','normal','initialize','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','split','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','POST','idle','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','9000579YqqeNp','SIGINT','catch','stderr','get_all_status','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','find','Bearer\x20','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','22746ErKdcR','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','←\x20message\x20from\x20','slice','unknown\x20tool','error','\x20RESUME_ID=','send_reply','http://127.0.0.1:9200','blocked','new_task','warning:\x20could\x20not\x20register:\x20','string','0.3.0','read','messages','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','24sOJcmw','Reply\x20text\x20/\x20result\x20summary','2.0','status','connected','1RiDfGU','set','completed','cancelled','get','replied','priority','working','claude-code','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','registered\x20as\x20\x22','1143XAlanI','...\x20TMUX=','session\x20disconnected','Session\x20alias:\x20','result','object','parse','commhub_get_all_status','randomUUID','shutting\x20down,\x20reporting\x20offline...','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','SSE\x20fatal:\x20','SSE\x20connected\x20as\x20\x22','17148505UnkaTf','55TTWkIS','\x22\x20(','new_message','\x20CWD=','hub','361758KPPTsf','trim','data:\x20','report_status','/mcp','write','alias','→\x20injected\x20task\x20','failed','application/json','1486550pgtBbA','stdin','.claude/channels/commhub','pop','SIGTERM','length','replace','end','Priority\x20(default:\x20normal)','content','notification',':\x20inbox_count=','cwd','in_progress','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','.env','/events/','decode','type','\x20ALIAS=','ready\x20—\x20waiting\x20for\x20events','send_message','from','Message\x20content','get_inbox','send_task','init\x20failed:\x20','inbox_count','getReader','\x20PROJECT_ENV=','16EzIzHf','from_session','4316930EzKSZQ','exit','high','commhub_report_status','utf-8','commhub_reply','connecting\x20to\x20','low','notifications/claude/channel','commhub_send_message','text','task','Progress\x200-100','SSE\x20stream\x20ended,\x20reconnecting...','stringify','commhub_send_task','none'];a0_0x3ae2=function(){return _0xc45344;};return a0_0x3ae2();}import{StdioServerTransport as a0_0xcb3d89}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x591d98,CallToolRequestSchema as a0_0x4749f3}from'@modelcontextprotocol/sdk/types.js';function p(_0x564fb9){const _0x46b256=a0_0x435d;if(!a0_0x48526e(_0x564fb9))return;for(let _0x4899de of a0_0x55e6e4(_0x564fb9,'utf-8')[_0x46b256(0x153)]('\x0a')){let _0x4c8f82=_0x4899de[_0x46b256(0x10b)]();if(!_0x4c8f82||_0x4c8f82['startsWith']('#'))continue;let _0x1e2784=_0x4c8f82['indexOf']('=');if(_0x1e2784<0x0)continue;let _0x4e7df6=_0x4c8f82[_0x46b256(0x164)](0x0,_0x1e2784)[_0x46b256(0x10b)](),_0x1c1115=_0x4c8f82['slice'](_0x1e2784+0x1)[_0x46b256(0x10b)]()[_0x46b256(0x11a)](/^["']|["']$/g,'');if(!process.env[_0x4e7df6])process.env[_0x4e7df6]=_0x1c1115;}}function a0_0x435d(_0x29673e,_0x56bbbf){_0x29673e=_0x29673e-0xe9;const _0x3ae2e2=a0_0x3ae2();let _0x435df6=_0x3ae2e2[_0x29673e];return _0x435df6;}var C=process.env.HOME||'~',T=a0_0x1ff871(C,a0_0x2f5f5a(0x116));p(a0_0x1ff871(T,a0_0x2f5f5a(0x123)));var L=process[a0_0x2f5f5a(0x120)]()[a0_0x2f5f5a(0x11a)](/\//g,'-');p(a0_0x1ff871(T,L,a0_0x2f5f5a(0x123)));function U(){const _0x5d7479=a0_0x2f5f5a;try{return a0_0x3ba3a2('tmux\x20display-message\x20-p\x20\x27#S\x27',{'encoding':_0x5d7479(0x138),'timeout':0x7d0})[_0x5d7479(0x10b)]();}catch{return'';}}function c(){const _0x2f610f=a0_0x2f5f5a;try{let _0x2810b2=a0_0x1ff871(C,'.anet','config.json');if(a0_0x48526e(_0x2810b2))return JSON[_0x2f610f(0xfd)](a0_0x55e6e4(_0x2810b2,_0x2f610f(0x138)));}catch{}return{};}var H=c(),D=process.env.COMMHUB_URL||H[a0_0x2f5f5a(0x109)]||a0_0x2f5f5a(0x169),f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0x161551(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto[a0_0x2f5f5a(0xff)](),X=process.env.COMMHUB_TOKEN||H['token']||'';function Y(_0x46f08d){const _0x1c2420=a0_0x2f5f5a;let _0x345970=new Date()[_0x1c2420(0x14e)]()['slice'](0x0,0x8);process[_0x1c2420(0x15b)][_0x1c2420(0x10f)]('['+_0x345970+']\x20[commhub]\x20'+_0x46f08d+'\x0a');}function h(_0x36b350){return new Promise(_0x51a785=>setTimeout(_0x51a785,_0x36b350));}Y('ENV:\x20URL='+D+a0_0x2f5f5a(0x127)+Z+a0_0x2f5f5a(0x167)+w[a0_0x2f5f5a(0x164)](0x0,0x8)+a0_0x2f5f5a(0xf8)+(f||a0_0x2f5f5a(0x144))+a0_0x2f5f5a(0x108)+process[a0_0x2f5f5a(0x120)]()+a0_0x2f5f5a(0x131)+L);var k=new Map(),K=new a0_0x5219ed({'name':'commhub-channel','version':a0_0x2f5f5a(0x16e)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x2f5f5a(0x122),a0_0x2f5f5a(0xf5),a0_0x2f5f5a(0x154),a0_0x2f5f5a(0x152),a0_0x2f5f5a(0xfa)+Z]['join']('\x0a')});K['setRequestHandler'](a0_0x591d98,async()=>({'tools':[{'name':'commhub_reply','description':a0_0x2f5f5a(0x160),'inputSchema':{'type':a0_0x2f5f5a(0xfc),'properties':{'task_id':{'type':a0_0x2f5f5a(0x16d),'description':a0_0x2f5f5a(0x157)},'text':{'type':a0_0x2f5f5a(0x16d),'description':a0_0x2f5f5a(0x173)},'status':{'type':a0_0x2f5f5a(0x16d),'enum':[a0_0x2f5f5a(0xee),a0_0x2f5f5a(0x112),a0_0x2f5f5a(0xef),'blocked','error',a0_0x2f5f5a(0x121)],'description':a0_0x2f5f5a(0x171)}},'required':[a0_0x2f5f5a(0x13e)]}},{'name':'commhub_report_status','description':a0_0x2f5f5a(0x101),'inputSchema':{'type':'object','properties':{'status':{'type':a0_0x2f5f5a(0x16d),'enum':[a0_0x2f5f5a(0xf3),a0_0x2f5f5a(0x156),a0_0x2f5f5a(0x16a),a0_0x2f5f5a(0x166)]},'task':{'type':a0_0x2f5f5a(0x16d),'description':a0_0x2f5f5a(0x14d)},'progress':{'type':'number','description':a0_0x2f5f5a(0x140)}},'required':[a0_0x2f5f5a(0xea)]}},{'name':a0_0x2f5f5a(0x143),'description':a0_0x2f5f5a(0x162),'inputSchema':{'type':a0_0x2f5f5a(0xfc),'properties':{'alias':{'type':a0_0x2f5f5a(0x16d),'description':'Target\x20session\x20alias'},'task':{'type':'string','description':'Task\x20content'},'priority':{'type':a0_0x2f5f5a(0x16d),'enum':[a0_0x2f5f5a(0x136),a0_0x2f5f5a(0x150),a0_0x2f5f5a(0x13b)],'description':a0_0x2f5f5a(0x11c)}},'required':[a0_0x2f5f5a(0x110),a0_0x2f5f5a(0x13f)]}},{'name':a0_0x2f5f5a(0x13d),'description':a0_0x2f5f5a(0x15d),'inputSchema':{'type':a0_0x2f5f5a(0xfc),'properties':{'alias':{'type':a0_0x2f5f5a(0x16d),'description':'Target\x20session\x20alias'},'message':{'type':a0_0x2f5f5a(0x16d),'description':a0_0x2f5f5a(0x12b)}},'required':['alias',a0_0x2f5f5a(0x14a)]}},{'name':a0_0x2f5f5a(0xfe),'description':a0_0x2f5f5a(0x14f),'inputSchema':{'type':a0_0x2f5f5a(0xfc),'properties':{}}}]}));async function P(_0x11eef4,_0x40a439){const _0x4b7160=a0_0x2f5f5a;let _0x28165d=await fetch(D+_0x4b7160(0x10e),{'method':_0x4b7160(0x155),'headers':{'Content-Type':_0x4b7160(0x113),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x4b7160(0xe9),'id':0x1,'method':_0x4b7160(0x151),'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':'commhub-channel','version':_0x4b7160(0x16e)}}})});if(!_0x28165d['ok']){let _0x4c4b9e=await _0x28165d[_0x4b7160(0x13e)]();return Y('CommHub\x20init\x20failed:\x20'+_0x28165d[_0x4b7160(0xea)]+'\x20'+_0x4c4b9e[_0x4b7160(0x164)](0x0,0x64)),{'ok':!0x1,'error':_0x4b7160(0x12e)+_0x28165d[_0x4b7160(0xea)]};}await _0x28165d['text']();let _0x399722=(await(await fetch(D+_0x4b7160(0x10e),{'method':_0x4b7160(0x155),'headers':{'Content-Type':_0x4b7160(0x113),'Accept':_0x4b7160(0x14c),...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON[_0x4b7160(0x142)]({'jsonrpc':_0x4b7160(0xe9),'id':0x2,'method':'tools/call','params':{'name':_0x11eef4,'arguments':_0x40a439}})}))[_0x4b7160(0x13e)]())[_0x4b7160(0x153)]('\x0a')[_0x4b7160(0x15e)](_0x241679=>_0x241679[_0x4b7160(0x14b)](_0x4b7160(0x10c)));if(_0x399722){let _0x4fbb63=JSON[_0x4b7160(0xfd)](_0x399722['slice'](0x6));return _0x4fbb63?.[_0x4b7160(0xfb)]?.[_0x4b7160(0x11d)]?.[0x0]?.['text']?JSON[_0x4b7160(0xfd)](_0x4fbb63['result']['content'][0x0][_0x4b7160(0x13e)]):_0x4fbb63;}return{'ok':!0x1,'error':'no\x20response'};}K['setRequestHandler'](a0_0x4749f3,async _0x27e9d3=>{const _0x28d0e6=a0_0x2f5f5a;let {name:_0x5676ba,arguments:_0x23fe83}=_0x27e9d3['params'];if(_0x5676ba===_0x28d0e6(0x139)){let {task_id:_0x38a0f8,text:_0x3a2f62,status:_0x3dbbe1}=_0x23fe83;if(_0x3dbbe1===_0x28d0e6(0xee)||_0x3dbbe1===_0x28d0e6(0x112)||_0x3dbbe1===_0x28d0e6(0xef)){let _0x23555a=_0x3dbbe1===_0x28d0e6(0xee)?_0x28d0e6(0xf1):_0x3dbbe1,_0x209aef=_0x38a0f8?k[_0x28d0e6(0xf0)](_0x38a0f8)||_0x28d0e6(0x109):'hub',_0x393485=await P(_0x28d0e6(0x168),{'alias':_0x209aef,'text':_0x3a2f62,'in_reply_to':_0x38a0f8||void 0x0,'status':_0x23555a,'from_session':Z});if(_0x38a0f8)k['delete'](_0x38a0f8);return{'content':[{'type':_0x28d0e6(0x13e),'text':JSON[_0x28d0e6(0x142)](_0x393485)}]};}let _0x103db9=await P(_0x28d0e6(0x10d),{'resume_id':w,'alias':Z,'status':_0x3dbbe1===_0x28d0e6(0x16a)?'blocked':_0x3dbbe1===_0x28d0e6(0x166)?_0x28d0e6(0x166):_0x28d0e6(0xf3),'task':_0x3a2f62[_0x28d0e6(0x164)](0x0,0xc8),'output':_0x3a2f62});return{'content':[{'type':_0x28d0e6(0x13e),'text':JSON[_0x28d0e6(0x142)](_0x103db9)}]};}if(_0x5676ba===_0x28d0e6(0x137)){let {status:_0x43e630,task:_0x4e163a,progress:_0x2fc70b}=_0x23fe83,_0x1da0f2=await P(_0x28d0e6(0x10d),{'resume_id':w,'alias':Z,'status':_0x43e630,'task':_0x4e163a,'progress':_0x2fc70b});return{'content':[{'type':_0x28d0e6(0x13e),'text':JSON[_0x28d0e6(0x142)](_0x1da0f2)}]};}if(_0x5676ba==='commhub_send_task'){let {alias:_0x4d02c9,task:_0x344c33,priority:_0x1ad12e}=_0x23fe83,_0x17146f=await P(_0x28d0e6(0x12d),{'alias':_0x4d02c9,'task':_0x344c33,'priority':_0x1ad12e||'normal','from_session':Z});return{'content':[{'type':'text','text':JSON[_0x28d0e6(0x142)](_0x17146f)}]};}if(_0x5676ba==='commhub_send_message'){let {alias:_0x3132a0,message:_0x36cf44}=_0x23fe83,_0xa4056a=await P(_0x28d0e6(0x129),{'alias':_0x3132a0,'message':_0x36cf44,'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x28d0e6(0x142)](_0xa4056a)}]};}if(_0x5676ba===_0x28d0e6(0xfe)){let _0x45ca04=await P(_0x28d0e6(0x15c),{});return{'content':[{'type':_0x28d0e6(0x13e),'text':JSON[_0x28d0e6(0x142)](_0x45ca04)}]};}return{'content':[{'type':_0x28d0e6(0x13e),'text':JSON[_0x28d0e6(0x142)]({'error':_0x28d0e6(0x165)})}]};});async function v(){const _0x45a9a4=a0_0x2f5f5a;let _0xa769d=D+_0x45a9a4(0x124)+encodeURIComponent(Z),_0x291a14={};if(X)_0x291a14['Authorization']=_0x45a9a4(0x15f)+X;Y(_0x45a9a4(0x13a)+_0xa769d);while(!0x0){try{let _0x1c8068=await fetch(_0xa769d,{'headers':_0x291a14});if(!_0x1c8068['ok']){Y('SSE\x20error:\x20'+_0x1c8068['status']+'\x20'+_0x1c8068['statusText']),await h(0x1388);continue;}let _0x584d76=_0x1c8068['body'][_0x45a9a4(0x130)](),_0x3ce61=new TextDecoder(),_0x31576d='';while(!0x0){let {done:_0x5c7ce1,value:_0x1ab236}=await _0x584d76[_0x45a9a4(0x16f)]();if(_0x5c7ce1)break;_0x31576d+=_0x3ce61[_0x45a9a4(0x125)](_0x1ab236,{'stream':!0x0});let _0x492b32=_0x31576d['split']('\x0a\x0a');_0x31576d=_0x492b32[_0x45a9a4(0x117)]()||'';for(let _0x278610 of _0x492b32){let _0x346fd9=_0x278610[_0x45a9a4(0x153)]('\x0a')[_0x45a9a4(0x15e)](_0xe5006a=>_0xe5006a[_0x45a9a4(0x14b)](_0x45a9a4(0x10c)));if(!_0x346fd9)continue;try{let _0xe4611e=JSON[_0x45a9a4(0xfd)](_0x346fd9[_0x45a9a4(0x164)](0x6));await u(_0xe4611e);}catch(_0x2d37ef){Y('parse\x20error:\x20'+_0x2d37ef);}}}Y(_0x45a9a4(0x141));}catch(_0x53e05a){Y(_0x45a9a4(0x149)+_0x53e05a);}await h(0xbb8);}}async function u(_0x182ff2){const _0x28fed7=a0_0x2f5f5a;if(_0x182ff2[_0x28fed7(0x126)]===_0x28fed7(0xeb)){Y(_0x28fed7(0x103)+Z+'\x22');return;}if(_0x182ff2[_0x28fed7(0x126)]===_0x28fed7(0x107)){if(Y(_0x28fed7(0x163)+_0x182ff2[_0x28fed7(0x12a)]+':\x20'+_0x182ff2['message'][_0x28fed7(0x164)](0x0,0x3c)),await K[_0x28fed7(0x11e)]({'method':_0x28fed7(0x13c),'params':{'content':_0x182ff2[_0x28fed7(0x14a)],'meta':{'sender':_0x182ff2[_0x28fed7(0x12a)]||_0x28fed7(0x109),'sender_id':'commhub','user':_0x182ff2[_0x28fed7(0x12a)]||'hub','priority':_0x28fed7(0x150)}}}),_0x182ff2[_0x28fed7(0x145)])await P(_0x28fed7(0x146),{'alias':Z,'message_id':_0x182ff2[_0x28fed7(0x145)]});return;}if(_0x182ff2[_0x28fed7(0x126)]===_0x28fed7(0x16b)||_0x182ff2[_0x28fed7(0x126)]==='broadcast'){Y('←\x20'+_0x182ff2['type']+_0x28fed7(0x11f)+_0x182ff2[_0x28fed7(0x12f)]+'\x20priority='+(_0x182ff2[_0x28fed7(0xf2)]||_0x28fed7(0x150)));let _0xc530cf=await P(_0x28fed7(0x12c),{'alias':Z,'limit':0x5});if(_0xc530cf?.['ok']&&_0xc530cf[_0x28fed7(0x170)]?.[_0x28fed7(0x119)]>0x0)for(let _0x54342c of _0xc530cf[_0x28fed7(0x170)]){let _0x31867e={'sender':_0x54342c['from_session']||_0x28fed7(0x109),'sender_id':'commhub','user':_0x54342c[_0x28fed7(0x133)]||_0x28fed7(0x109),'task_id':_0x54342c['id'],'priority':_0x54342c['priority']||_0x28fed7(0x150)};k[_0x28fed7(0xed)](_0x54342c['id'],_0x54342c[_0x28fed7(0x133)]||_0x28fed7(0x109)),await K[_0x28fed7(0x11e)]({'method':'notifications/claude/channel','params':{'content':_0x54342c[_0x28fed7(0x11d)],'meta':_0x31867e}}),Y(_0x28fed7(0x111)+_0x54342c['id'][_0x28fed7(0x164)](0x0,0x8)+'\x20from\x20'+_0x54342c[_0x28fed7(0x133)]+':\x20'+_0x54342c['content'][_0x28fed7(0x164)](0x0,0x3c)),await P(_0x28fed7(0x146),{'alias':Z,'message_id':_0x54342c['id']});}}}async function S(){const _0x31e9e1=a0_0x2f5f5a;let _0x4c185a=new a0_0xcb3d89();await K['connect'](_0x4c185a),Y('MCP\x20stdio\x20connected'),Y('starting\x20SSE\x20listener...'),v()['catch'](_0x4cea40=>Y(_0x31e9e1(0x102)+_0x4cea40)),P('report_status',{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x161551(),'hostname':a0_0x161551(),'agent':_0x31e9e1(0xf4),'project_dir':process[_0x31e9e1(0x120)](),'tmux_name':f||void 0x0})[_0x31e9e1(0x148)](()=>Y(_0x31e9e1(0xf6)+Z+_0x31e9e1(0x106)+w[_0x31e9e1(0x164)](0x0,0x8)+')'))['catch'](_0x1e1c55=>Y(_0x31e9e1(0x16c)+_0x1e1c55)),setInterval(()=>{const _0x307d27=_0x31e9e1;P(_0x307d27(0x10d),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x161551(),'hostname':a0_0x161551(),'agent':'claude-code','project_dir':process[_0x307d27(0x120)](),'tmux_name':f||void 0x0})[_0x307d27(0x15a)](_0x397eae=>Y('heartbeat\x20failed:\x20'+_0x397eae));},0x2bf20),Y(_0x31e9e1(0x128));}S()['catch'](_0x47063a=>{const _0x2a4064=a0_0x2f5f5a;Y('fatal:\x20'+_0x47063a),process[_0x2a4064(0x135)](0x1);});async function N(){const _0x549ad2=a0_0x2f5f5a;Y(_0x549ad2(0x100)),await P(_0x549ad2(0x10d),{'resume_id':w,'alias':Z,'status':'error','task':_0x549ad2(0xf9)})['catch'](()=>{}),process[_0x549ad2(0x135)](0x0);}process[a0_0x2f5f5a(0x115)]['on'](a0_0x2f5f5a(0x11b),()=>N()),process['on'](a0_0x2f5f5a(0x118),()=>N()),process['on'](a0_0x2f5f5a(0x159),()=>N());
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());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.0.0-preview.20",
3
+ "version": "2.0.0-preview.22",
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",