@sleep2agi/agent-network 2.1.5 → 2.1.6-preview.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- function a0_0x5dd6(_0x3e14ea,_0x21e236){_0x3e14ea=_0x3e14ea-0x13d;const _0xebe5dd=a0_0xebe5();let _0x5dd6ed=_0xebe5dd[_0x3e14ea];return _0x5dd6ed;}const a0_0x5d35ea=a0_0x5dd6;(function(_0x3fec7f,_0xf9ec92){const _0x1051d1=a0_0x5dd6,_0x424377=_0x3fec7f();while(!![]){try{const _0x61bc8c=-parseInt(_0x1051d1(0x171))/0x1*(-parseInt(_0x1051d1(0x18a))/0x2)+-parseInt(_0x1051d1(0x163))/0x3*(parseInt(_0x1051d1(0x13e))/0x4)+-parseInt(_0x1051d1(0x16d))/0x5*(-parseInt(_0x1051d1(0x14e))/0x6)+-parseInt(_0x1051d1(0x174))/0x7*(-parseInt(_0x1051d1(0x192))/0x8)+parseInt(_0x1051d1(0x16e))/0x9+-parseInt(_0x1051d1(0x165))/0xa+-parseInt(_0x1051d1(0x17f))/0xb*(-parseInt(_0x1051d1(0x190))/0xc);if(_0x61bc8c===_0xf9ec92)break;else _0x424377['push'](_0x424377['shift']());}catch(_0x1e480e){_0x424377['push'](_0x424377['shift']());}}}(a0_0xebe5,0xde99e));function a0_0xebe5(){const _0x318b38=['application/json','10119410nfActB','pop','slice','Bearer\x20','SSE\x20failed:\x20','emit','log','text','2772410makpQb','74889ixfEHo','Authorization','send','44kLnMdz',']\x20[commhub:','messages','10913putQpG','server','cwd','running','reconnectDelay','send_task','application/json,\x20text/event-stream','replace','decode','message','alias','7943034QAUjBI','AbortError','task','connect','ack_inbox','disconnect','agent','report_status','idle','send_message','completed','23246DHRPCq','SSE\x20error:\x20','text/event-stream','result','sdk','type','24HtwzfH','call','1200uyEONi','get_all_status','min','2766040zqrOvy','split','content','tools/call','heartbeatTimer','heartbeat\x20failed:\x20','sdk-','parse','abort','get_inbox','from_session','token','body','disconnected','/events/','read','12plhXSX','heartbeatInterval','resumeId','signal','connected','sleep','url','processInbox','offline','s...','SSE\x20reconnecting\x20in\x20','getAllStatus','status','autoConnect','match','registered','normal','broadcast','connectSSE','now','sseAbort','6pckKzP'];a0_0xebe5=function(){return _0x318b38;};return a0_0xebe5();}import{EventEmitter as a0_0x124cf3}from'events';import{hostname as a0_0x12562a}from'os';class T extends a0_0x124cf3{[a0_0x5d35ea(0x154)];[a0_0x5d35ea(0x17e)];[a0_0x5d35ea(0x149)];[a0_0x5d35ea(0x185)];['resumeId'];[a0_0x5d35ea(0x14f)];[a0_0x5d35ea(0x178)];[a0_0x5d35ea(0x142)];[a0_0x5d35ea(0x162)];[a0_0x5d35ea(0x177)]=!0x1;constructor(_0x296ac1){const _0x809086=a0_0x5d35ea;super();if(this[_0x809086(0x154)]=_0x296ac1[_0x809086(0x154)][_0x809086(0x17b)](/\/$/,''),this[_0x809086(0x17e)]=_0x296ac1['alias'],this[_0x809086(0x149)]=_0x296ac1[_0x809086(0x149)],this[_0x809086(0x185)]=_0x296ac1['agent']||_0x809086(0x18e),this['resumeId']=_0x809086(0x144)+_0x296ac1[_0x809086(0x17e)]+'-'+Date[_0x809086(0x161)]()['toString'](0x24),this[_0x809086(0x14f)]=_0x296ac1[_0x809086(0x14f)]??0x2bf20,this[_0x809086(0x178)]=_0x296ac1[_0x809086(0x178)]??0xbb8,_0x296ac1[_0x809086(0x15b)]!==!0x1)this[_0x809086(0x182)]();}['log'](_0x3f1a06){const _0x405053=a0_0x5d35ea;console[_0x405053(0x16b)]('['+new Date()['toTimeString']()[_0x405053(0x167)](0x0,0x8)+_0x405053(0x172)+this[_0x405053(0x17e)]+']\x20'+_0x3f1a06);}async['call'](_0x34cf84,_0x10c6a7){const _0x1f6a3a=a0_0x5d35ea;let _0x459ba0={'Content-Type':_0x1f6a3a(0x164),'Accept':_0x1f6a3a(0x17a)};if(this['token'])_0x459ba0[_0x1f6a3a(0x16f)]='Bearer\x20'+this[_0x1f6a3a(0x149)];let _0x4c6a0e=await(await fetch(this[_0x1f6a3a(0x154)]+'/mcp',{'method':'POST','headers':_0x459ba0,'body':JSON['stringify']({'jsonrpc':'2.0','id':Date[_0x1f6a3a(0x161)](),'method':_0x1f6a3a(0x141),'params':{'name':_0x34cf84,'arguments':_0x10c6a7}})}))[_0x1f6a3a(0x16c)](),_0x2674d9=_0x4c6a0e[_0x1f6a3a(0x15c)](/data: (.+)/),_0x546e61=_0x2674d9?JSON['parse'](_0x2674d9[0x1]):JSON[_0x1f6a3a(0x145)](_0x4c6a0e),_0x55b7a5=_0x546e61?.[_0x1f6a3a(0x18d)]?.[_0x1f6a3a(0x140)]?.[0x0]?.[_0x1f6a3a(0x16c)];return _0x55b7a5?JSON['parse'](_0x55b7a5):_0x546e61;}async[a0_0x5d35ea(0x182)](){const _0x331270=a0_0x5d35ea;if(this[_0x331270(0x177)])return;this[_0x331270(0x177)]=!0x0,await this['status'](_0x331270(0x187)),this[_0x331270(0x16b)](_0x331270(0x15d)),this[_0x331270(0x142)]=setInterval(()=>{const _0x393179=_0x331270;this['status'](_0x393179(0x187))['catch'](_0x1e7aa6=>this[_0x393179(0x16b)](_0x393179(0x143)+_0x1e7aa6[_0x393179(0x17d)]));},this['heartbeatInterval']),this[_0x331270(0x160)]();}async[a0_0x5d35ea(0x184)](){const _0x501a6b=a0_0x5d35ea;if(this[_0x501a6b(0x177)]=!0x1,this[_0x501a6b(0x162)]?.[_0x501a6b(0x146)](),this[_0x501a6b(0x142)])clearInterval(this['heartbeatTimer']);await this[_0x501a6b(0x15a)](_0x501a6b(0x156))['catch'](()=>{}),this[_0x501a6b(0x16b)](_0x501a6b(0x14b));}async[a0_0x5d35ea(0x170)](_0x251230,_0x1fb5f3,_0x1fb244=a0_0x5d35ea(0x15e)){const _0x1ba133=a0_0x5d35ea;return this[_0x1ba133(0x191)](_0x1ba133(0x179),{'alias':_0x251230,'task':_0x1fb5f3,'priority':_0x1fb244,'from_session':this['alias']});}async[a0_0x5d35ea(0x17d)](_0x8fdfc0,_0x35cdd2){const _0x75ceda=a0_0x5d35ea;return this[_0x75ceda(0x191)](_0x75ceda(0x188),{'alias':_0x8fdfc0,'message':_0x35cdd2,'from_session':this[_0x75ceda(0x17e)]});}async['reply'](_0x5b407a,_0x193ae2,_0x23ebb0=a0_0x5d35ea(0x189)){return this['call']('send_reply',{'in_reply_to':_0x5b407a,'text':_0x193ae2,'status':_0x23ebb0});}async[a0_0x5d35ea(0x15a)](_0x4b6ffa,_0x2447a6){const _0x4bd666=a0_0x5d35ea;return this['call'](_0x4bd666(0x186),{'resume_id':this[_0x4bd666(0x150)],'alias':this[_0x4bd666(0x17e)],'status':_0x4b6ffa,'server':a0_0x12562a(),'hostname':a0_0x12562a(),'agent':this[_0x4bd666(0x185)],'project_dir':process[_0x4bd666(0x176)](),..._0x2447a6});}async[a0_0x5d35ea(0x159)](){const _0x5251db=a0_0x5d35ea;return this[_0x5251db(0x191)](_0x5251db(0x193),{});}async[a0_0x5d35ea(0x15f)](_0x223484,_0x3b99d6){const _0xec9d8a=a0_0x5d35ea;return this['call'](_0xec9d8a(0x15f),{'message':_0x223484,'filter_server':_0x3b99d6?.[_0xec9d8a(0x175)],'filter_status':_0x3b99d6?.[_0xec9d8a(0x15a)]});}async[a0_0x5d35ea(0x160)](){const _0x36dc32=a0_0x5d35ea;let _0x168dac=encodeURIComponent(this[_0x36dc32(0x17e)]),_0x35c9c1=this[_0x36dc32(0x154)]+_0x36dc32(0x14c)+_0x168dac,_0x58fd95=this[_0x36dc32(0x178)];while(this[_0x36dc32(0x177)]){try{this[_0x36dc32(0x162)]=new AbortController();let _0x55296b={'Accept':_0x36dc32(0x18c)};if(this['token'])_0x55296b[_0x36dc32(0x16f)]=_0x36dc32(0x168)+this[_0x36dc32(0x149)];let _0x136a90=await fetch(_0x35c9c1,{'headers':_0x55296b,'signal':this['sseAbort'][_0x36dc32(0x151)]});if(!_0x136a90['ok']||!_0x136a90[_0x36dc32(0x14a)]){this[_0x36dc32(0x16b)](_0x36dc32(0x169)+_0x136a90[_0x36dc32(0x15a)]),await this[_0x36dc32(0x153)](_0x58fd95),_0x58fd95=Math[_0x36dc32(0x13d)](_0x58fd95*1.5,0xea60);continue;}_0x58fd95=this[_0x36dc32(0x178)];let _0x20bfaf=_0x136a90['body']['getReader'](),_0x18ac76=new TextDecoder(),_0xf94b61='';while(this[_0x36dc32(0x177)]){let {done:_0xf617a8,value:_0x591953}=await _0x20bfaf[_0x36dc32(0x14d)]();if(_0xf617a8)break;_0xf94b61+=_0x18ac76[_0x36dc32(0x17c)](_0x591953,{'stream':!0x0});let _0x31f397=_0xf94b61[_0x36dc32(0x13f)]('\x0a');_0xf94b61=_0x31f397[_0x36dc32(0x166)]()||'';for(let _0x89c0de of _0x31f397){if(!_0x89c0de['startsWith']('data:\x20'))continue;try{let _0x15721d=JSON[_0x36dc32(0x145)](_0x89c0de[_0x36dc32(0x167)](0x6));if(_0x15721d[_0x36dc32(0x18f)]===_0x36dc32(0x152)){this['log']('SSE\x20connected'),this[_0x36dc32(0x16a)](_0x36dc32(0x152));continue;}if(_0x15721d[_0x36dc32(0x18f)]==='new_task'||_0x15721d['type']==='new_message'||_0x15721d[_0x36dc32(0x18f)]==='broadcast')await this[_0x36dc32(0x155)]();}catch{}}}}catch(_0x4a4559){if(_0x4a4559['name']===_0x36dc32(0x180))break;this[_0x36dc32(0x16a)]('error',_0x4a4559),this['log'](_0x36dc32(0x18b)+_0x4a4559[_0x36dc32(0x17d)]);}if(this[_0x36dc32(0x177)])this[_0x36dc32(0x16a)](_0x36dc32(0x14b)),this[_0x36dc32(0x16b)](_0x36dc32(0x158)+_0x58fd95/0x3e8+_0x36dc32(0x157)),await this[_0x36dc32(0x153)](_0x58fd95),_0x58fd95=Math[_0x36dc32(0x13d)](_0x58fd95*1.5,0xea60);}}async[a0_0x5d35ea(0x155)](){const _0x463e9f=a0_0x5d35ea;try{let _0x7a63ba=(await this[_0x463e9f(0x191)](_0x463e9f(0x147),{'alias':this[_0x463e9f(0x17e)],'limit':0xa}))?.[_0x463e9f(0x173)]||[];for(let _0x325413 of _0x7a63ba)await this[_0x463e9f(0x191)](_0x463e9f(0x183),{'alias':this[_0x463e9f(0x17e)],'message_id':_0x325413['id']}),this[_0x463e9f(0x16b)]('←\x20'+_0x325413[_0x463e9f(0x148)]+':\x20'+_0x325413['content'][_0x463e9f(0x167)](0x0,0x3c)),this[_0x463e9f(0x16a)](_0x463e9f(0x181),_0x325413),this[_0x463e9f(0x16a)](_0x463e9f(0x17d),_0x325413);}catch(_0x3ae789){this[_0x463e9f(0x16b)]('inbox\x20error:\x20'+_0x3ae789['message']);}}[a0_0x5d35ea(0x153)](_0x1ab373){return new Promise(_0x410f13=>setTimeout(_0x410f13,_0x1ab373));}}var $=T;export{$ as default,T as CommHub};
1
+ const a0_0x43ce91=a0_0x391e;function a0_0x2034(){const _0x325e9e=['result','send_task','text','disconnected','SSE\x20connected','/events/','529705ZVyCRc','sdk-','get_all_status','status','cwd','agent','1575qllBZJ','registered','2902250emYWLo','new_task','159369IQJbaz','processInbox','send_reply','split','sdk','reconnectDelay','2127220TFwxLE','read','call','running','disconnect','catch','token','heartbeatTimer','autoConnect','completed','connected','startsWith','signal','new_message','emit','resumeId','sseAbort','decode','SSE\x20error:\x20','min','error','broadcast','report_status','data:\x20','log','url','body','abort','43060DjwpDA','server','slice','connect','heartbeatInterval','toTimeString','messages','pop','replace','4693328wnTrdo','561090yRemVQ','SSE\x20reconnecting\x20in\x20','connectSSE','alias','48pHoCVo','inbox\x20error:\x20','from_session','heartbeat\x20failed:\x20','name','message','toString','s...','match','content','type','now','task',']\x20[commhub:','parse','sleep','Bearer\x20','3zbGWYu','text/event-stream','Authorization'];a0_0x2034=function(){return _0x325e9e;};return a0_0x2034();}(function(_0x58e4a4,_0x54add2){const _0x18b0a5=a0_0x391e,_0x5de283=_0x58e4a4();while(!![]){try{const _0x486c6e=-parseInt(_0x18b0a5(0x1d4))/0x1+-parseInt(_0x18b0a5(0x1b6))/0x2+parseInt(_0x18b0a5(0x1cb))/0x3*(parseInt(_0x18b0a5(0x1e4))/0x4)+-parseInt(_0x18b0a5(0x1dc))/0x5+-parseInt(_0x18b0a5(0x1ba))/0x6*(parseInt(_0x18b0a5(0x1de))/0x7)+parseInt(_0x18b0a5(0x1b5))/0x8+-parseInt(_0x18b0a5(0x1da))/0x9*(-parseInt(_0x18b0a5(0x200))/0xa);if(_0x486c6e===_0x54add2)break;else _0x5de283['push'](_0x5de283['shift']());}catch(_0x5ec729){_0x5de283['push'](_0x5de283['shift']());}}}(a0_0x2034,0x490b1));import{EventEmitter as a0_0x482d50}from'events';import{hostname as a0_0x32dbe8}from'os';function a0_0x391e(_0x171961,_0x2612a1){_0x171961=_0x171961-0x1ae;const _0x20347a=a0_0x2034();let _0x391e95=_0x20347a[_0x171961];return _0x391e95;}class T extends a0_0x482d50{[a0_0x43ce91(0x1fd)];[a0_0x43ce91(0x1b9)];['token'];[a0_0x43ce91(0x1d9)];[a0_0x43ce91(0x1f3)];[a0_0x43ce91(0x1b0)];[a0_0x43ce91(0x1e3)];[a0_0x43ce91(0x1eb)];['sseAbort'];['running']=!0x1;constructor(_0xd80e1b){const _0x59166b=a0_0x43ce91;super();if(this['url']=_0xd80e1b[_0x59166b(0x1fd)][_0x59166b(0x1b4)](/\/$/,''),this[_0x59166b(0x1b9)]=_0xd80e1b['alias'],this[_0x59166b(0x1ea)]=_0xd80e1b[_0x59166b(0x1ea)],this['agent']=_0xd80e1b[_0x59166b(0x1d9)]||_0x59166b(0x1e2),this[_0x59166b(0x1f3)]=_0x59166b(0x1d5)+_0xd80e1b['alias']+'-'+Date['now']()[_0x59166b(0x1c0)](0x24),this[_0x59166b(0x1b0)]=_0xd80e1b[_0x59166b(0x1b0)]??0x2bf20,this['reconnectDelay']=_0xd80e1b['reconnectDelay']??0xbb8,_0xd80e1b[_0x59166b(0x1ec)]!==!0x1)this[_0x59166b(0x1af)]();}['log'](_0x198e10){const _0x312c68=a0_0x43ce91;console[_0x312c68(0x1fc)]('['+new Date()[_0x312c68(0x1b1)]()[_0x312c68(0x1ae)](0x0,0x8)+_0x312c68(0x1c7)+this[_0x312c68(0x1b9)]+']\x20'+_0x198e10);}async[a0_0x43ce91(0x1e6)](_0x4aacdc,_0x618fc8){const _0x1cb756=a0_0x43ce91;let _0x1c5b76={'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream'};if(this['token'])_0x1c5b76[_0x1cb756(0x1cd)]=_0x1cb756(0x1ca)+this['token'];let _0x92ce69=await(await fetch(this[_0x1cb756(0x1fd)]+'/mcp',{'method':'POST','headers':_0x1c5b76,'body':JSON['stringify']({'jsonrpc':'2.0','id':Date[_0x1cb756(0x1c5)](),'method':'tools/call','params':{'name':_0x4aacdc,'arguments':_0x618fc8}})}))[_0x1cb756(0x1d0)](),_0x4aed3a=_0x92ce69[_0x1cb756(0x1c2)](/data: (.+)/),_0x25027b=_0x4aed3a?JSON[_0x1cb756(0x1c8)](_0x4aed3a[0x1]):JSON[_0x1cb756(0x1c8)](_0x92ce69),_0x13b09f=_0x25027b?.[_0x1cb756(0x1ce)]?.[_0x1cb756(0x1c3)]?.[0x0]?.['text'];return _0x13b09f?JSON[_0x1cb756(0x1c8)](_0x13b09f):_0x25027b;}async[a0_0x43ce91(0x1af)](){const _0x3f2d23=a0_0x43ce91;if(this[_0x3f2d23(0x1e7)])return;this['running']=!0x0,await this['status']('idle'),this[_0x3f2d23(0x1fc)](_0x3f2d23(0x1db)),this[_0x3f2d23(0x1eb)]=setInterval(()=>{const _0x49be39=_0x3f2d23;this[_0x49be39(0x1d7)]('idle')['catch'](_0x357419=>this[_0x49be39(0x1fc)](_0x49be39(0x1bd)+_0x357419['message']));},this[_0x3f2d23(0x1b0)]),this[_0x3f2d23(0x1b8)]();}async[a0_0x43ce91(0x1e8)](){const _0x2194e0=a0_0x43ce91;if(this['running']=!0x1,this[_0x2194e0(0x1f4)]?.[_0x2194e0(0x1ff)](),this[_0x2194e0(0x1eb)])clearInterval(this['heartbeatTimer']);await this[_0x2194e0(0x1d7)]('offline')[_0x2194e0(0x1e9)](()=>{}),this[_0x2194e0(0x1fc)](_0x2194e0(0x1d1));}async['send'](_0x12882d,_0x349417,_0x4a65d4='normal'){const _0x24d2f6=a0_0x43ce91;return this['call'](_0x24d2f6(0x1cf),{'alias':_0x12882d,'task':_0x349417,'priority':_0x4a65d4,'from_session':this['alias']});}async[a0_0x43ce91(0x1bf)](_0x2ee483,_0xbf2f09){const _0x8d2a1e=a0_0x43ce91;return this[_0x8d2a1e(0x1e6)]('send_message',{'alias':_0x2ee483,'message':_0xbf2f09,'from_session':this[_0x8d2a1e(0x1b9)]});}async['reply'](_0x5dc572,_0x21cdf0,_0x201a7d=a0_0x43ce91(0x1ed)){const _0x95094b=a0_0x43ce91;return this[_0x95094b(0x1e6)](_0x95094b(0x1e0),{'in_reply_to':_0x5dc572,'text':_0x21cdf0,'status':_0x201a7d});}async[a0_0x43ce91(0x1d7)](_0x407f9b,_0x58896d){const _0xfc31b0=a0_0x43ce91;return this[_0xfc31b0(0x1e6)](_0xfc31b0(0x1fa),{'resume_id':this[_0xfc31b0(0x1f3)],'alias':this[_0xfc31b0(0x1b9)],'status':_0x407f9b,'server':a0_0x32dbe8(),'hostname':a0_0x32dbe8(),'agent':this[_0xfc31b0(0x1d9)],'project_dir':process[_0xfc31b0(0x1d8)](),..._0x58896d});}async['getAllStatus'](){const _0x39496a=a0_0x43ce91;return this['call'](_0x39496a(0x1d6),{});}async['broadcast'](_0xe5c491,_0x119850){const _0x3f5a25=a0_0x43ce91;return this['call'](_0x3f5a25(0x1f9),{'message':_0xe5c491,'filter_server':_0x119850?.[_0x3f5a25(0x201)],'filter_status':_0x119850?.[_0x3f5a25(0x1d7)]});}async[a0_0x43ce91(0x1b8)](){const _0x55f0de=a0_0x43ce91;let _0x1fb1f4=encodeURIComponent(this[_0x55f0de(0x1b9)]),_0x92b6e6=this['url']+_0x55f0de(0x1d3)+_0x1fb1f4,_0x60158b=this[_0x55f0de(0x1e3)];while(this[_0x55f0de(0x1e7)]){try{this[_0x55f0de(0x1f4)]=new AbortController();let _0x2b2c3f={'Accept':_0x55f0de(0x1cc)};if(this[_0x55f0de(0x1ea)])_0x2b2c3f[_0x55f0de(0x1cd)]=_0x55f0de(0x1ca)+this[_0x55f0de(0x1ea)];let _0xe9d468=await fetch(_0x92b6e6,{'headers':_0x2b2c3f,'signal':this[_0x55f0de(0x1f4)][_0x55f0de(0x1f0)]});if(!_0xe9d468['ok']||!_0xe9d468['body']){this[_0x55f0de(0x1fc)]('SSE\x20failed:\x20'+_0xe9d468[_0x55f0de(0x1d7)]),await this[_0x55f0de(0x1c9)](_0x60158b),_0x60158b=Math[_0x55f0de(0x1f7)](_0x60158b*1.5,0xea60);continue;}_0x60158b=this[_0x55f0de(0x1e3)];let _0x26c097=_0xe9d468[_0x55f0de(0x1fe)]['getReader'](),_0x5a1cb9=new TextDecoder(),_0x5dd59e='';while(this[_0x55f0de(0x1e7)]){let {done:_0x4b7549,value:_0x5ddcc2}=await _0x26c097[_0x55f0de(0x1e5)]();if(_0x4b7549)break;_0x5dd59e+=_0x5a1cb9[_0x55f0de(0x1f5)](_0x5ddcc2,{'stream':!0x0});let _0x6d5bf2=_0x5dd59e[_0x55f0de(0x1e1)]('\x0a');_0x5dd59e=_0x6d5bf2[_0x55f0de(0x1b3)]()||'';for(let _0x4a7d66 of _0x6d5bf2){if(!_0x4a7d66[_0x55f0de(0x1ef)](_0x55f0de(0x1fb)))continue;try{let _0x2bfb12=JSON['parse'](_0x4a7d66[_0x55f0de(0x1ae)](0x6));if(_0x2bfb12[_0x55f0de(0x1c4)]===_0x55f0de(0x1ee)){this[_0x55f0de(0x1fc)](_0x55f0de(0x1d2)),this[_0x55f0de(0x1f2)]('connected');continue;}if(_0x2bfb12[_0x55f0de(0x1c4)]===_0x55f0de(0x1dd)||_0x2bfb12[_0x55f0de(0x1c4)]===_0x55f0de(0x1f1)||_0x2bfb12[_0x55f0de(0x1c4)]===_0x55f0de(0x1f9))await this[_0x55f0de(0x1df)]();}catch{}}}}catch(_0x54e5c2){if(_0x54e5c2[_0x55f0de(0x1be)]==='AbortError')break;this[_0x55f0de(0x1f2)](_0x55f0de(0x1f8),_0x54e5c2),this['log'](_0x55f0de(0x1f6)+_0x54e5c2[_0x55f0de(0x1bf)]);}if(this[_0x55f0de(0x1e7)])this[_0x55f0de(0x1f2)](_0x55f0de(0x1d1)),this[_0x55f0de(0x1fc)](_0x55f0de(0x1b7)+_0x60158b/0x3e8+_0x55f0de(0x1c1)),await this[_0x55f0de(0x1c9)](_0x60158b),_0x60158b=Math['min'](_0x60158b*1.5,0xea60);}}async[a0_0x43ce91(0x1df)](){const _0x5774e5=a0_0x43ce91;try{let _0xaa0b4a=(await this['call']('get_inbox',{'alias':this[_0x5774e5(0x1b9)],'limit':0xa}))?.[_0x5774e5(0x1b2)]||[];for(let _0x380e79 of _0xaa0b4a)await this[_0x5774e5(0x1e6)]('ack_inbox',{'alias':this[_0x5774e5(0x1b9)],'message_id':_0x380e79['id']}),this[_0x5774e5(0x1fc)]('←\x20'+_0x380e79[_0x5774e5(0x1bc)]+':\x20'+_0x380e79[_0x5774e5(0x1c3)][_0x5774e5(0x1ae)](0x0,0x3c)),this[_0x5774e5(0x1f2)](_0x5774e5(0x1c6),_0x380e79),this[_0x5774e5(0x1f2)](_0x5774e5(0x1bf),_0x380e79);}catch(_0x3c67f0){this['log'](_0x5774e5(0x1bb)+_0x3c67f0['message']);}}[a0_0x43ce91(0x1c9)](_0x3d6ef9){return new Promise(_0x24373e=>setTimeout(_0x24373e,_0x3d6ef9));}}var $=T;export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0xfc5b33=a0_0x3830;(function(_0x22e298,_0x4f4b0e){const _0x3116f7=a0_0x3830,_0xbbc1dc=_0x22e298();while(!![]){try{const _0x1903fd=parseInt(_0x3116f7(0x20d))/0x1*(parseInt(_0x3116f7(0x23a))/0x2)+-parseInt(_0x3116f7(0x1d4))/0x3*(-parseInt(_0x3116f7(0x213))/0x4)+parseInt(_0x3116f7(0x21f))/0x5+parseInt(_0x3116f7(0x1e7))/0x6*(-parseInt(_0x3116f7(0x1f0))/0x7)+-parseInt(_0x3116f7(0x214))/0x8+-parseInt(_0x3116f7(0x1e2))/0x9+parseInt(_0x3116f7(0x1d0))/0xa*(parseInt(_0x3116f7(0x1f8))/0xb);if(_0x1903fd===_0x4f4b0e)break;else _0xbbc1dc['push'](_0xbbc1dc['shift']());}catch(_0x546b74){_0xbbc1dc['push'](_0xbbc1dc['shift']());}}}(a0_0x18e5,0xcb094));function a0_0x18e5(){const _0x43c011=['task','catch','result','\x22\x20(','length','ENV:\x20URL=','.env','indexOf','\x20PROJECT_ENV=','starting\x20SSE\x20listener...','then','cwd','.claude/channels/commhub','from','\x20priority=','http://127.0.0.1:9200','type','2025-03-26','error','decode','cancelled','commhub','warning:\x20could\x20not\x20register:\x20','messages','Bearer\x20','exit','tmux\x20display-message\x20-p\x20\x27#S\x27','new_message','trim','heartbeat\x20failed:\x20','10dEJfyN','send_reply','new_task','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','74901JwnbJO','message_id','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','slice','SSE\x20connected\x20as\x20\x22','notification','object','replied','\x20from\x20','commhub_reply','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','.anet','2.0','send_task','4064040LZhNVc','connecting\x20to\x20','stderr','report_status','/events/','5179386zevEdA','params','...\x20TMUX=','stringify','end','/mcp','working','initialize','get_all_status','7ycaiLc','commhub_send_message','token','data:\x20','SIGINT','normal','\x20ALIAS=','notifications/claude/channel','6123799sgJCyM','ready\x20—\x20waiting\x20for\x20events','commhub-channel','commhub_send_task','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','connect','from_session','ack_inbox','set','Task\x20content','low','completed','write','priority','text','blocked','status','find','application/json,\x20text/event-stream','message','88397EMOdsR','read','claude-code','number','content','shutting\x20down,\x20reporting\x20offline...','248sSdxdb','10757768lJytec',':\x20inbox_count=','Authorization','registered\x20as\x20\x22','SSE\x20error:\x20','Current\x20task\x20description','getReader','hub','utf-8','stdin','in_progress','302650vDxOav','body','replace','high','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','\x20CWD=','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','split','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','failed','CommHub\x20init\x20failed:\x20','Reply\x20text\x20/\x20result\x20summary','POST','SSE\x20fatal:\x20','delete','alias','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','get_inbox','application/json','string','commhub_get_all_status','pop','fatal:\x20','init\x20failed:\x20',']\x20[commhub]\x20','none','connected','30WweeBe','MCP\x20stdio\x20connected','SIGTERM','Target\x20session\x20alias','setRequestHandler','Progress\x200-100','idle','parse','startsWith'];a0_0x18e5=function(){return _0x43c011;};return a0_0x18e5();}import{readFileSync as a0_0x396ab7,existsSync as a0_0x24e63d}from'fs';import{randomUUID as a0_0x5a8fed}from'crypto';import{join as a0_0xe37398}from'path';import{hostname as a0_0x2512ed}from'os';import{execSync as a0_0x148943}from'child_process';import{Server as a0_0x51c855}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x4500b5}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x59e01d,CallToolRequestSchema as a0_0x107645}from'@modelcontextprotocol/sdk/types.js';function p(_0x1abd5){const _0x262585=a0_0x3830;if(!a0_0x24e63d(_0x1abd5))return;for(let _0x222f06 of a0_0x396ab7(_0x1abd5,_0x262585(0x21c))[_0x262585(0x226)]('\x0a')){let _0x5264a1=_0x222f06['trim']();if(!_0x5264a1||_0x5264a1['startsWith']('#'))continue;let _0x1bf781=_0x5264a1[_0x262585(0x24a)]('=');if(_0x1bf781<0x0)continue;let _0x334851=_0x5264a1[_0x262585(0x1d7)](0x0,_0x1bf781)[_0x262585(0x1ce)](),_0x16c7da=_0x5264a1[_0x262585(0x1d7)](_0x1bf781+0x1)[_0x262585(0x1ce)]()[_0x262585(0x221)](/^["']|["']$/g,'');if(!process.env[_0x334851])process.env[_0x334851]=_0x16c7da;}}var C=process.env.HOME||'~',T=a0_0xe37398(C,a0_0xfc5b33(0x1be));p(a0_0xe37398(T,a0_0xfc5b33(0x249)));var L=process['cwd']()[a0_0xfc5b33(0x221)](/\//g,'-');p(a0_0xe37398(T,L,a0_0xfc5b33(0x249)));function U(){const _0x52432b=a0_0xfc5b33;try{return a0_0x148943(_0x52432b(0x1cc),{'encoding':'utf-8','timeout':0x7d0})['trim']();}catch{return'';}}function v(){const _0x11cfca=a0_0xfc5b33;try{let _0xe4159c=a0_0xe37398(C,_0x11cfca(0x1df),'config.json');if(a0_0x24e63d(_0xe4159c))return JSON['parse'](a0_0x396ab7(_0xe4159c,_0x11cfca(0x21c)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0xfc5b33(0x21b)]||a0_0xfc5b33(0x1c1),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x2512ed(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x5a8fed(),X=process.env.COMMHUB_TOKEN||H[a0_0xfc5b33(0x1f2)]||'';function Y(_0x19be1c){const _0x435ff9=a0_0xfc5b33;let _0x4ecf01=new Date()['toTimeString']()[_0x435ff9(0x1d7)](0x0,0x8);process[_0x435ff9(0x1e4)][_0x435ff9(0x205)]('['+_0x4ecf01+_0x435ff9(0x237)+_0x19be1c+'\x0a');}function h(_0x2974b6){return new Promise(_0x2b78bb=>setTimeout(_0x2b78bb,_0x2974b6));}Y(a0_0xfc5b33(0x248)+f+a0_0xfc5b33(0x1f6)+Z+'\x20RESUME_ID='+w['slice'](0x0,0x8)+a0_0xfc5b33(0x1e9)+(j||a0_0xfc5b33(0x238))+a0_0xfc5b33(0x224)+process['cwd']()+a0_0xfc5b33(0x1ba)+L);var k=new Map(),K=new a0_0x51c855({'name':a0_0xfc5b33(0x1fa),'version':'0.3.0'},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':['Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>',a0_0xfc5b33(0x1fc),'Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.',a0_0xfc5b33(0x1d3),'Session\x20alias:\x20'+Z]['join']('\x0a')});K[a0_0xfc5b33(0x23e)](a0_0x59e01d,async()=>({'tools':[{'name':a0_0xfc5b33(0x1dd),'description':a0_0xfc5b33(0x223),'inputSchema':{'type':'object','properties':{'task_id':{'type':a0_0xfc5b33(0x232),'description':a0_0xfc5b33(0x227)},'text':{'type':a0_0xfc5b33(0x232),'description':a0_0xfc5b33(0x22a)},'status':{'type':a0_0xfc5b33(0x232),'enum':['completed',a0_0xfc5b33(0x228),a0_0xfc5b33(0x1c6),a0_0xfc5b33(0x208),'error',a0_0xfc5b33(0x21e)],'description':a0_0xfc5b33(0x22f)}},'required':['text']}},{'name':'commhub_report_status','description':a0_0xfc5b33(0x1fd),'inputSchema':{'type':a0_0xfc5b33(0x1da),'properties':{'status':{'type':a0_0xfc5b33(0x232),'enum':['working',a0_0xfc5b33(0x240),'blocked','error']},'task':{'type':'string','description':a0_0xfc5b33(0x219)},'progress':{'type':a0_0xfc5b33(0x210),'description':a0_0xfc5b33(0x23f)}},'required':[a0_0xfc5b33(0x209)]}},{'name':a0_0xfc5b33(0x1fb),'description':a0_0xfc5b33(0x225),'inputSchema':{'type':a0_0xfc5b33(0x1da),'properties':{'alias':{'type':'string','description':a0_0xfc5b33(0x23d)},'task':{'type':'string','description':a0_0xfc5b33(0x202)},'priority':{'type':a0_0xfc5b33(0x232),'enum':[a0_0xfc5b33(0x222),a0_0xfc5b33(0x1f5),a0_0xfc5b33(0x203)],'description':'Priority\x20(default:\x20normal)'}},'required':[a0_0xfc5b33(0x22e),a0_0xfc5b33(0x243)]}},{'name':a0_0xfc5b33(0x1f1),'description':a0_0xfc5b33(0x1d6),'inputSchema':{'type':a0_0xfc5b33(0x1da),'properties':{'alias':{'type':a0_0xfc5b33(0x232),'description':a0_0xfc5b33(0x23d)},'message':{'type':'string','description':'Message\x20content'}},'required':[a0_0xfc5b33(0x22e),a0_0xfc5b33(0x20c)]}},{'name':'commhub_get_all_status','description':a0_0xfc5b33(0x1de),'inputSchema':{'type':a0_0xfc5b33(0x1da),'properties':{}}}]}));async function P(_0xcfdd2f,_0x19acb8){const _0x144421=a0_0xfc5b33;let _0x37e57e=await fetch(f+_0x144421(0x1ec),{'method':_0x144421(0x22b),'headers':{'Content-Type':_0x144421(0x231),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x144421(0x1ca)+X}:{}},'body':JSON[_0x144421(0x1ea)]({'jsonrpc':_0x144421(0x1e0),'id':0x1,'method':_0x144421(0x1ee),'params':{'protocolVersion':_0x144421(0x1c3),'capabilities':{},'clientInfo':{'name':'commhub-channel','version':'0.3.0'}}})});if(!_0x37e57e['ok']){let _0x5dafa4=await _0x37e57e[_0x144421(0x207)]();return Y(_0x144421(0x229)+_0x37e57e['status']+'\x20'+_0x5dafa4[_0x144421(0x1d7)](0x0,0x64)),{'ok':!0x1,'error':_0x144421(0x236)+_0x37e57e['status']};}await _0x37e57e[_0x144421(0x207)]();let _0x1019e9=(await(await fetch(f+_0x144421(0x1ec),{'method':_0x144421(0x22b),'headers':{'Content-Type':_0x144421(0x231),'Accept':_0x144421(0x20b),...X?{'Authorization':_0x144421(0x1ca)+X}:{}},'body':JSON[_0x144421(0x1ea)]({'jsonrpc':_0x144421(0x1e0),'id':0x2,'method':'tools/call','params':{'name':_0xcfdd2f,'arguments':_0x19acb8}})}))['text']())[_0x144421(0x226)]('\x0a')[_0x144421(0x20a)](_0xf0feda=>_0xf0feda[_0x144421(0x242)]('data:\x20'));if(_0x1019e9){let _0x250434=JSON['parse'](_0x1019e9['slice'](0x6));return _0x250434?.[_0x144421(0x245)]?.[_0x144421(0x211)]?.[0x0]?.[_0x144421(0x207)]?JSON[_0x144421(0x241)](_0x250434['result'][_0x144421(0x211)][0x0][_0x144421(0x207)]):_0x250434;}return{'ok':!0x1,'error':'no\x20response'};}function a0_0x3830(_0xc5ce3a,_0xf3a1bb){_0xc5ce3a=_0xc5ce3a-0x1ba;const _0x18e574=a0_0x18e5();let _0x38303a=_0x18e574[_0xc5ce3a];return _0x38303a;}K['setRequestHandler'](a0_0x107645,async _0x5597d0=>{const _0x4381bd=a0_0xfc5b33;let {name:_0x443435,arguments:_0xb51cdd}=_0x5597d0[_0x4381bd(0x1e8)];if(_0x443435===_0x4381bd(0x1dd)){let {task_id:_0xeb2bf8,text:_0x58a608,status:_0x4ac78c}=_0xb51cdd;if(_0x4ac78c===_0x4381bd(0x204)||_0x4ac78c===_0x4381bd(0x228)||_0x4ac78c===_0x4381bd(0x1c6)){let _0x196518=_0x4ac78c===_0x4381bd(0x204)?_0x4381bd(0x1db):_0x4ac78c,_0x42af30=_0xeb2bf8?k['get'](_0xeb2bf8)||'hub':_0x4381bd(0x21b),_0x1931b4=await P(_0x4381bd(0x1d1),{'alias':_0x42af30,'text':_0x58a608,'in_reply_to':_0xeb2bf8||void 0x0,'status':_0x196518,'from_session':Z});if(_0xeb2bf8)k[_0x4381bd(0x22d)](_0xeb2bf8);return{'content':[{'type':'text','text':JSON['stringify'](_0x1931b4)}]};}let _0x179947=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x4ac78c==='blocked'?_0x4381bd(0x208):_0x4ac78c==='error'?'error':_0x4381bd(0x1ed),'task':_0x58a608[_0x4381bd(0x1d7)](0x0,0xc8),'output':_0x58a608});return{'content':[{'type':'text','text':JSON[_0x4381bd(0x1ea)](_0x179947)}]};}if(_0x443435==='commhub_report_status'){let {status:_0x11cb0d,task:_0x1fbae6,progress:_0x99baeb}=_0xb51cdd,_0x3e4de2=await P(_0x4381bd(0x1e5),{'resume_id':w,'alias':Z,'status':_0x11cb0d,'task':_0x1fbae6,'progress':_0x99baeb});return{'content':[{'type':_0x4381bd(0x207),'text':JSON[_0x4381bd(0x1ea)](_0x3e4de2)}]};}if(_0x443435==='commhub_send_task'){let {alias:_0x162857,task:_0x20ec5b,priority:_0x8f7c09}=_0xb51cdd,_0x41827c=await P(_0x4381bd(0x1e1),{'alias':_0x162857,'task':_0x20ec5b,'priority':_0x8f7c09||_0x4381bd(0x1f5),'from_session':Z});return{'content':[{'type':_0x4381bd(0x207),'text':JSON[_0x4381bd(0x1ea)](_0x41827c)}]};}if(_0x443435===_0x4381bd(0x1f1)){let {alias:_0x412300,message:_0x4f1961}=_0xb51cdd,_0x30856b=await P('send_message',{'alias':_0x412300,'message':_0x4f1961,'from_session':Z});return{'content':[{'type':_0x4381bd(0x207),'text':JSON['stringify'](_0x30856b)}]};}if(_0x443435===_0x4381bd(0x233)){let _0x8ffb12=await P(_0x4381bd(0x1ef),{});return{'content':[{'type':_0x4381bd(0x207),'text':JSON['stringify'](_0x8ffb12)}]};}return{'content':[{'type':_0x4381bd(0x207),'text':JSON['stringify']({'error':'unknown\x20tool'})}]};});async function u(){const _0x1dfa89=a0_0xfc5b33;let _0x5926a1=f+_0x1dfa89(0x1e6)+encodeURIComponent(Z),_0xc63ae0={};if(X)_0xc63ae0[_0x1dfa89(0x216)]=_0x1dfa89(0x1ca)+X;Y(_0x1dfa89(0x1e3)+_0x5926a1);while(!0x0){try{let _0x29bb1b=await fetch(_0x5926a1,{'headers':_0xc63ae0});if(!_0x29bb1b['ok']){Y(_0x1dfa89(0x218)+_0x29bb1b[_0x1dfa89(0x209)]+'\x20'+_0x29bb1b['statusText']),await h(0x1388);continue;}let _0x5cb1bc=_0x29bb1b[_0x1dfa89(0x220)][_0x1dfa89(0x21a)](),_0x312b6c=new TextDecoder(),_0x36067b='';while(!0x0){let {done:_0x35cbfa,value:_0x3f8a22}=await _0x5cb1bc[_0x1dfa89(0x20e)]();if(_0x35cbfa)break;_0x36067b+=_0x312b6c[_0x1dfa89(0x1c5)](_0x3f8a22,{'stream':!0x0});let _0x5cbdd5=_0x36067b[_0x1dfa89(0x226)]('\x0a\x0a');_0x36067b=_0x5cbdd5[_0x1dfa89(0x234)]()||'';for(let _0x5b9573 of _0x5cbdd5){let _0x36e6a7=_0x5b9573[_0x1dfa89(0x226)]('\x0a')[_0x1dfa89(0x20a)](_0x4a52e6=>_0x4a52e6[_0x1dfa89(0x242)](_0x1dfa89(0x1f3)));if(!_0x36e6a7)continue;try{let _0x44eb77=JSON['parse'](_0x36e6a7['slice'](0x6));await S(_0x44eb77);}catch(_0x254bd7){Y('parse\x20error:\x20'+_0x254bd7);}}}Y('SSE\x20stream\x20ended,\x20reconnecting...');}catch(_0x45bc72){Y('SSE\x20connection\x20error:\x20'+_0x45bc72);}await h(0xbb8);}}async function S(_0x137c28){const _0x43689c=a0_0xfc5b33;if(_0x137c28[_0x43689c(0x1c2)]===_0x43689c(0x239)){Y(_0x43689c(0x1d8)+Z+'\x22');return;}if(_0x137c28[_0x43689c(0x1c2)]===_0x43689c(0x1cd)){if(Y('←\x20message\x20from\x20'+_0x137c28[_0x43689c(0x1bf)]+':\x20'+_0x137c28[_0x43689c(0x20c)][_0x43689c(0x1d7)](0x0,0x3c)),await K[_0x43689c(0x1d9)]({'method':_0x43689c(0x1f7),'params':{'content':_0x137c28['message'],'meta':{'sender':_0x137c28['from']||'hub','sender_id':_0x43689c(0x1c7),'user':_0x137c28[_0x43689c(0x1bf)]||_0x43689c(0x21b),'priority':_0x43689c(0x1f5)}}}),_0x137c28[_0x43689c(0x1d5)])await P(_0x43689c(0x200),{'alias':Z,'message_id':_0x137c28[_0x43689c(0x1d5)]});return;}if(_0x137c28[_0x43689c(0x1c2)]===_0x43689c(0x1d2)||_0x137c28[_0x43689c(0x1c2)]==='broadcast'){Y('←\x20'+_0x137c28['type']+_0x43689c(0x215)+_0x137c28['inbox_count']+_0x43689c(0x1c0)+(_0x137c28[_0x43689c(0x206)]||_0x43689c(0x1f5)));let _0x5bf6bc=await P(_0x43689c(0x230),{'alias':Z,'limit':0x5});if(_0x5bf6bc?.['ok']&&_0x5bf6bc[_0x43689c(0x1c9)]?.[_0x43689c(0x247)]>0x0)for(let _0x53c7d5 of _0x5bf6bc[_0x43689c(0x1c9)]){let _0x137285={'sender':_0x53c7d5['from_session']||_0x43689c(0x21b),'sender_id':_0x43689c(0x1c7),'user':_0x53c7d5['from_session']||'hub','task_id':_0x53c7d5['id'],'priority':_0x53c7d5[_0x43689c(0x206)]||_0x43689c(0x1f5)};k[_0x43689c(0x201)](_0x53c7d5['id'],_0x53c7d5[_0x43689c(0x1ff)]||_0x43689c(0x21b)),await K[_0x43689c(0x1d9)]({'method':_0x43689c(0x1f7),'params':{'content':_0x53c7d5[_0x43689c(0x211)],'meta':_0x137285}}),Y('→\x20injected\x20task\x20'+_0x53c7d5['id'][_0x43689c(0x1d7)](0x0,0x8)+_0x43689c(0x1dc)+_0x53c7d5[_0x43689c(0x1ff)]+':\x20'+_0x53c7d5[_0x43689c(0x211)][_0x43689c(0x1d7)](0x0,0x3c)),await P(_0x43689c(0x200),{'alias':Z,'message_id':_0x53c7d5['id']});}}}async function A(){const _0x3fc167=a0_0xfc5b33;let _0x1f9c4c=new a0_0x4500b5();await K[_0x3fc167(0x1fe)](_0x1f9c4c),Y(_0x3fc167(0x23b)),Y(_0x3fc167(0x1bb)),u()[_0x3fc167(0x244)](_0x5df341=>Y(_0x3fc167(0x22c)+_0x5df341)),P('report_status',{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x2512ed(),'hostname':a0_0x2512ed(),'agent':_0x3fc167(0x20f),'project_dir':process[_0x3fc167(0x1bd)](),'tmux_name':j||void 0x0})[_0x3fc167(0x1bc)](()=>Y(_0x3fc167(0x217)+Z+_0x3fc167(0x246)+w[_0x3fc167(0x1d7)](0x0,0x8)+')'))[_0x3fc167(0x244)](_0xbc0b21=>Y(_0x3fc167(0x1c8)+_0xbc0b21)),setInterval(()=>{const _0x8cd6f=_0x3fc167;P(_0x8cd6f(0x1e5),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x2512ed(),'hostname':a0_0x2512ed(),'agent':'claude-code','project_dir':process['cwd'](),'tmux_name':j||void 0x0})[_0x8cd6f(0x244)](_0x59ad05=>Y(_0x8cd6f(0x1cf)+_0x59ad05));},0x2bf20),Y(_0x3fc167(0x1f9));}A()[a0_0xfc5b33(0x244)](_0x258f18=>{const _0x18e5e9=a0_0xfc5b33;Y(_0x18e5e9(0x235)+_0x258f18),process[_0x18e5e9(0x1cb)](0x1);});async function N(){const _0x21b051=a0_0xfc5b33;Y(_0x21b051(0x212)),await P(_0x21b051(0x1e5),{'resume_id':w,'alias':Z,'status':_0x21b051(0x1c4),'task':'session\x20disconnected'})[_0x21b051(0x244)](()=>{}),process[_0x21b051(0x1cb)](0x0);}process[a0_0xfc5b33(0x21d)]['on'](a0_0xfc5b33(0x1eb),()=>N()),process['on'](a0_0xfc5b33(0x23c),()=>N()),process['on'](a0_0xfc5b33(0x1f4),()=>N());
2
+ const a0_0x5126d1=a0_0x5c8c;(function(_0x2974b4,_0x3edda7){const _0x565834=a0_0x5c8c,_0x3ebfee=_0x2974b4();while(!![]){try{const _0x4ed6d2=parseInt(_0x565834(0x1b9))/0x1*(-parseInt(_0x565834(0x1dd))/0x2)+-parseInt(_0x565834(0x1c3))/0x3+parseInt(_0x565834(0x1fa))/0x4*(-parseInt(_0x565834(0x22a))/0x5)+parseInt(_0x565834(0x1c0))/0x6+-parseInt(_0x565834(0x1cb))/0x7*(parseInt(_0x565834(0x1a0))/0x8)+parseInt(_0x565834(0x20a))/0x9*(parseInt(_0x565834(0x1c6))/0xa)+parseInt(_0x565834(0x1ef))/0xb*(parseInt(_0x565834(0x1e8))/0xc);if(_0x4ed6d2===_0x3edda7)break;else _0x3ebfee['push'](_0x3ebfee['shift']());}catch(_0x1950a9){_0x3ebfee['push'](_0x3ebfee['shift']());}}}(a0_0x670b,0xb03f4));import{readFileSync as a0_0x17b92a,existsSync as a0_0x39f9c0}from'fs';import{randomUUID as a0_0x4db9dd}from'crypto';function a0_0x5c8c(_0x4aaeba,_0x3cf3a0){_0x4aaeba=_0x4aaeba-0x19e;const _0x670bd7=a0_0x670b();let _0x5c8c3a=_0x670bd7[_0x4aaeba];return _0x5c8c3a;}import{join as a0_0x231bb7}from'path';import{hostname as a0_0x595711}from'os';import{execSync as a0_0x5d3536}from'child_process';import{Server as a0_0x22fb80}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x28ce4f}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x188e3a,CallToolRequestSchema as a0_0xd37ac3}from'@modelcontextprotocol/sdk/types.js';function p(_0x245bce){const _0x1a9262=a0_0x5c8c;if(!a0_0x39f9c0(_0x245bce))return;for(let _0x3caab3 of a0_0x17b92a(_0x245bce,'utf-8')[_0x1a9262(0x1e6)]('\x0a')){let _0xaa8359=_0x3caab3['trim']();if(!_0xaa8359||_0xaa8359[_0x1a9262(0x1e9)]('#'))continue;let _0x2ea5ec=_0xaa8359[_0x1a9262(0x1f4)]('=');if(_0x2ea5ec<0x0)continue;let _0x232952=_0xaa8359[_0x1a9262(0x1d0)](0x0,_0x2ea5ec)[_0x1a9262(0x1d2)](),_0x5b337b=_0xaa8359[_0x1a9262(0x1d0)](_0x2ea5ec+0x1)[_0x1a9262(0x1d2)]()[_0x1a9262(0x1af)](/^["']|["']$/g,'');if(!process.env[_0x232952])process.env[_0x232952]=_0x5b337b;}}var C=process.env.HOME||'~',T=a0_0x231bb7(C,a0_0x5126d1(0x220));p(a0_0x231bb7(T,a0_0x5126d1(0x1b2)));function a0_0x670b(){const _0x4bb5c8=['...\x20TMUX=','Target\x20session\x20alias','ENV:\x20URL=','commhub_report_status','notifications/claude/channel','Progress\x200-100','result','unknown\x20tool','SIGINT','text','Session\x20alias:\x20','inbox_count','hub','.claude/channels/commhub','fatal:\x20','blocked','SSE\x20fatal:\x20','0.3.0','content','\x20ALIAS=','delete','MCP\x20stdio\x20connected','end','266575OajnXM','heartbeat\x20failed:\x20','get','tools/call','stderr','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','commhub','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','toTimeString','priority','56lcbhux','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','2025-03-26','body','ack_inbox','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','report_status','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','parse','message_id','CommHub\x20init\x20failed:\x20','commhub_send_message','cancelled','low','exit','replace','type','params','.env','read','cwd','messages','shutting\x20down,\x20reporting\x20offline...','Bearer\x20',':\x20inbox_count=','22811UKJjGB','initialize','\x20CWD=','POST','init\x20failed:\x20','utf-8','string','4258470eeoCzy','Reply\x20text\x20/\x20result\x20summary','working','301305iLNKPe','commhub-channel','commhub_get_all_status','5204990jhCFWP','pop','commhub_reply','Priority\x20(default:\x20normal)','error','812427DfdQpJ','SSE\x20connection\x20error:\x20','http://127.0.0.1:9200','session\x20disconnected','claude-code','slice','broadcast','trim','then','application/json','completed',']\x20[commhub]\x20','/mcp','message','connecting\x20to\x20','send_message','connect','alias','60GaJxgH','get_all_status','normal','ready\x20—\x20waiting\x20for\x20events','new_message','\x20PROJECT_ENV=','stringify','application/json,\x20text/event-stream','get_inbox','split','\x20RESUME_ID=','4369812EDKfYy','startsWith','registered\x20as\x20\x22','new_task','SIGTERM','SSE\x20stream\x20ended,\x20reconnecting...','from','22aHZmYC','object','2.0','catch','idle','indexOf','from_session','stdin','status','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','send_task','12vowqko','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','length','\x22\x20(','failed','token','setRequestHandler','tmux\x20display-message\x20-p\x20\x27#S\x27','Task\x20content','replied','write','parse\x20error:\x20','Current\x20task\x20description','data:\x20','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','18eesHzn','set','find','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','\x20priority=','\x20from\x20','send_reply','getReader','task'];a0_0x670b=function(){return _0x4bb5c8;};return a0_0x670b();}var L=process[a0_0x5126d1(0x1b4)]()[a0_0x5126d1(0x1af)](/\//g,'-');p(a0_0x231bb7(T,L,'.env'));function U(){const _0x3a8ba9=a0_0x5126d1;try{return a0_0x5d3536(_0x3a8ba9(0x202),{'encoding':'utf-8','timeout':0x7d0})[_0x3a8ba9(0x1d2)]();}catch{return'';}}function v(){const _0x3a1b41=a0_0x5126d1;try{let _0x5c5a4b=a0_0x231bb7(C,'.anet','config.json');if(a0_0x39f9c0(_0x5c5a4b))return JSON[_0x3a1b41(0x1a8)](a0_0x17b92a(_0x5c5a4b,_0x3a1b41(0x1be)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x5126d1(0x21f)]||a0_0x5126d1(0x1cd),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x595711(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x4db9dd(),X=process.env.COMMHUB_TOKEN||H[a0_0x5126d1(0x200)]||'';function Y(_0x403dcf){const _0x146d7b=a0_0x5126d1;let _0x3cbbfc=new Date()[_0x146d7b(0x19e)]()[_0x146d7b(0x1d0)](0x0,0x8);process[_0x146d7b(0x22e)][_0x146d7b(0x205)]('['+_0x3cbbfc+_0x146d7b(0x1d6)+_0x403dcf+'\x0a');}function h(_0xb25c73){return new Promise(_0x3d854d=>setTimeout(_0x3d854d,_0xb25c73));}Y(a0_0x5126d1(0x215)+f+a0_0x5126d1(0x226)+Z+a0_0x5126d1(0x1e7)+w[a0_0x5126d1(0x1d0)](0x0,0x8)+a0_0x5126d1(0x213)+(j||'none')+a0_0x5126d1(0x1bb)+process[a0_0x5126d1(0x1b4)]()+a0_0x5126d1(0x1e2)+L);var k=new Map(),K=new a0_0x22fb80({'name':'commhub-channel','version':a0_0x5126d1(0x224)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x5126d1(0x1fb),a0_0x5126d1(0x209),a0_0x5126d1(0x231),'You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.',a0_0x5126d1(0x21d)+Z]['join']('\x0a')});K[a0_0x5126d1(0x201)](a0_0x188e3a,async()=>({'tools':[{'name':a0_0x5126d1(0x1c8),'description':a0_0x5126d1(0x1fc),'inputSchema':{'type':a0_0x5126d1(0x1f0),'properties':{'task_id':{'type':a0_0x5126d1(0x1bf),'description':a0_0x5126d1(0x1a1)},'text':{'type':a0_0x5126d1(0x1bf),'description':a0_0x5126d1(0x1c1)},'status':{'type':a0_0x5126d1(0x1bf),'enum':[a0_0x5126d1(0x1d5),a0_0x5126d1(0x1ff),a0_0x5126d1(0x1ac),a0_0x5126d1(0x222),'error','in_progress'],'description':a0_0x5126d1(0x1a7)}},'required':[a0_0x5126d1(0x21c)]}},{'name':a0_0x5126d1(0x216),'description':a0_0x5126d1(0x1f8),'inputSchema':{'type':a0_0x5126d1(0x1f0),'properties':{'status':{'type':a0_0x5126d1(0x1bf),'enum':[a0_0x5126d1(0x1c2),a0_0x5126d1(0x1f3),a0_0x5126d1(0x222),'error']},'task':{'type':a0_0x5126d1(0x1bf),'description':a0_0x5126d1(0x207)},'progress':{'type':'number','description':a0_0x5126d1(0x218)}},'required':[a0_0x5126d1(0x1f7)]}},{'name':'commhub_send_task','description':a0_0x5126d1(0x1a5),'inputSchema':{'type':a0_0x5126d1(0x1f0),'properties':{'alias':{'type':a0_0x5126d1(0x1bf),'description':a0_0x5126d1(0x214)},'task':{'type':a0_0x5126d1(0x1bf),'description':a0_0x5126d1(0x203)},'priority':{'type':a0_0x5126d1(0x1bf),'enum':['high',a0_0x5126d1(0x1df),a0_0x5126d1(0x1ad)],'description':a0_0x5126d1(0x1c9)}},'required':[a0_0x5126d1(0x1dc),a0_0x5126d1(0x212)]}},{'name':a0_0x5126d1(0x1ab),'description':a0_0x5126d1(0x22f),'inputSchema':{'type':a0_0x5126d1(0x1f0),'properties':{'alias':{'type':a0_0x5126d1(0x1bf),'description':a0_0x5126d1(0x214)},'message':{'type':a0_0x5126d1(0x1bf),'description':'Message\x20content'}},'required':[a0_0x5126d1(0x1dc),a0_0x5126d1(0x1d8)]}},{'name':a0_0x5126d1(0x1c5),'description':a0_0x5126d1(0x20d),'inputSchema':{'type':a0_0x5126d1(0x1f0),'properties':{}}}]}));async function P(_0x410619,_0x4479e3){const _0x587c3f=a0_0x5126d1;let _0x2c35b9=await fetch(f+_0x587c3f(0x1d7),{'method':_0x587c3f(0x1bc),'headers':{'Content-Type':_0x587c3f(0x1d4),'Accept':_0x587c3f(0x1e4),...X?{'Authorization':_0x587c3f(0x1b7)+X}:{}},'body':JSON[_0x587c3f(0x1e3)]({'jsonrpc':_0x587c3f(0x1f1),'id':0x1,'method':_0x587c3f(0x1ba),'params':{'protocolVersion':_0x587c3f(0x1a2),'capabilities':{},'clientInfo':{'name':_0x587c3f(0x1c4),'version':_0x587c3f(0x224)}}})});if(!_0x2c35b9['ok']){let _0x411cfe=await _0x2c35b9[_0x587c3f(0x21c)]();return Y(_0x587c3f(0x1aa)+_0x2c35b9[_0x587c3f(0x1f7)]+'\x20'+_0x411cfe[_0x587c3f(0x1d0)](0x0,0x64)),{'ok':!0x1,'error':_0x587c3f(0x1bd)+_0x2c35b9['status']};}await _0x2c35b9[_0x587c3f(0x21c)]();let _0x39a469=(await(await fetch(f+_0x587c3f(0x1d7),{'method':_0x587c3f(0x1bc),'headers':{'Content-Type':'application/json','Accept':_0x587c3f(0x1e4),...X?{'Authorization':_0x587c3f(0x1b7)+X}:{}},'body':JSON[_0x587c3f(0x1e3)]({'jsonrpc':_0x587c3f(0x1f1),'id':0x2,'method':_0x587c3f(0x22d),'params':{'name':_0x410619,'arguments':_0x4479e3}})}))[_0x587c3f(0x21c)]())[_0x587c3f(0x1e6)]('\x0a')[_0x587c3f(0x20c)](_0x32d45b=>_0x32d45b[_0x587c3f(0x1e9)](_0x587c3f(0x208)));if(_0x39a469){let _0x1a78d0=JSON[_0x587c3f(0x1a8)](_0x39a469[_0x587c3f(0x1d0)](0x6));return _0x1a78d0?.[_0x587c3f(0x219)]?.['content']?.[0x0]?.['text']?JSON[_0x587c3f(0x1a8)](_0x1a78d0[_0x587c3f(0x219)]['content'][0x0][_0x587c3f(0x21c)]):_0x1a78d0;}return{'ok':!0x1,'error':'no\x20response'};}K[a0_0x5126d1(0x201)](a0_0xd37ac3,async _0x540e0a=>{const _0x29d3e8=a0_0x5126d1;let {name:_0x1ed9f9,arguments:_0x342e38}=_0x540e0a[_0x29d3e8(0x1b1)];if(_0x1ed9f9===_0x29d3e8(0x1c8)){let {task_id:_0xd128f9,text:_0x1580e6,status:_0x4f5454}=_0x342e38;if(_0x4f5454==='completed'||_0x4f5454===_0x29d3e8(0x1ff)||_0x4f5454===_0x29d3e8(0x1ac)){let _0x62a1da=_0x4f5454===_0x29d3e8(0x1d5)?_0x29d3e8(0x204):_0x4f5454,_0x1ce2b0=_0xd128f9?k[_0x29d3e8(0x22c)](_0xd128f9)||'hub':_0x29d3e8(0x21f),_0xddce7=await P(_0x29d3e8(0x210),{'alias':_0x1ce2b0,'text':_0x1580e6,'in_reply_to':_0xd128f9||void 0x0,'status':_0x62a1da,'from_session':Z});if(_0xd128f9)k[_0x29d3e8(0x227)](_0xd128f9);return{'content':[{'type':_0x29d3e8(0x21c),'text':JSON[_0x29d3e8(0x1e3)](_0xddce7)}]};}let _0xd6ae3d=await P(_0x29d3e8(0x1a6),{'resume_id':w,'alias':Z,'status':_0x4f5454===_0x29d3e8(0x222)?_0x29d3e8(0x222):_0x4f5454===_0x29d3e8(0x1ca)?_0x29d3e8(0x1ca):'working','task':_0x1580e6['slice'](0x0,0xc8),'output':_0x1580e6});return{'content':[{'type':'text','text':JSON['stringify'](_0xd6ae3d)}]};}if(_0x1ed9f9===_0x29d3e8(0x216)){let {status:_0x5795a3,task:_0xe075ca,progress:_0x125862}=_0x342e38,_0x4d95b3=await P(_0x29d3e8(0x1a6),{'resume_id':w,'alias':Z,'status':_0x5795a3,'task':_0xe075ca,'progress':_0x125862});return{'content':[{'type':'text','text':JSON[_0x29d3e8(0x1e3)](_0x4d95b3)}]};}if(_0x1ed9f9==='commhub_send_task'){let {alias:_0xf6fe91,task:_0x3a9859,priority:_0x801d02}=_0x342e38,_0x5a143a=await P(_0x29d3e8(0x1f9),{'alias':_0xf6fe91,'task':_0x3a9859,'priority':_0x801d02||'normal','from_session':Z});return{'content':[{'type':'text','text':JSON[_0x29d3e8(0x1e3)](_0x5a143a)}]};}if(_0x1ed9f9===_0x29d3e8(0x1ab)){let {alias:_0x24a57b,message:_0x3b710c}=_0x342e38,_0x1333f0=await P(_0x29d3e8(0x1da),{'alias':_0x24a57b,'message':_0x3b710c,'from_session':Z});return{'content':[{'type':_0x29d3e8(0x21c),'text':JSON[_0x29d3e8(0x1e3)](_0x1333f0)}]};}if(_0x1ed9f9===_0x29d3e8(0x1c5)){let _0x483d8f=await P(_0x29d3e8(0x1de),{});return{'content':[{'type':_0x29d3e8(0x21c),'text':JSON[_0x29d3e8(0x1e3)](_0x483d8f)}]};}return{'content':[{'type':_0x29d3e8(0x21c),'text':JSON[_0x29d3e8(0x1e3)]({'error':_0x29d3e8(0x21a)})}]};});async function u(){const _0x50314b=a0_0x5126d1;let _0x5f257f=f+'/events/'+encodeURIComponent(Z),_0x18fa7f={};if(X)_0x18fa7f['Authorization']=_0x50314b(0x1b7)+X;Y(_0x50314b(0x1d9)+_0x5f257f);while(!0x0){try{let _0x4c404c=await fetch(_0x5f257f,{'headers':_0x18fa7f});if(!_0x4c404c['ok']){Y('SSE\x20error:\x20'+_0x4c404c['status']+'\x20'+_0x4c404c['statusText']),await h(0x1388);continue;}let _0x3bda2e=_0x4c404c[_0x50314b(0x1a3)][_0x50314b(0x211)](),_0x103be7=new TextDecoder(),_0x5511b3='';while(!0x0){let {done:_0x4e1c1a,value:_0x2fa44d}=await _0x3bda2e[_0x50314b(0x1b3)]();if(_0x4e1c1a)break;_0x5511b3+=_0x103be7['decode'](_0x2fa44d,{'stream':!0x0});let _0x4f3353=_0x5511b3['split']('\x0a\x0a');_0x5511b3=_0x4f3353[_0x50314b(0x1c7)]()||'';for(let _0x564258 of _0x4f3353){let _0x5e28e3=_0x564258[_0x50314b(0x1e6)]('\x0a')[_0x50314b(0x20c)](_0x3dc961=>_0x3dc961[_0x50314b(0x1e9)](_0x50314b(0x208)));if(!_0x5e28e3)continue;try{let _0x2087a6=JSON[_0x50314b(0x1a8)](_0x5e28e3['slice'](0x6));await S(_0x2087a6);}catch(_0x35d4d0){Y(_0x50314b(0x206)+_0x35d4d0);}}}Y(_0x50314b(0x1ed));}catch(_0x5efc36){Y(_0x50314b(0x1cc)+_0x5efc36);}await h(0xbb8);}}async function S(_0x2fa765){const _0xdceee1=a0_0x5126d1;if(_0x2fa765[_0xdceee1(0x1b0)]==='connected'){Y('SSE\x20connected\x20as\x20\x22'+Z+'\x22');return;}if(_0x2fa765['type']===_0xdceee1(0x1e1)){if(Y('←\x20message\x20from\x20'+_0x2fa765['from']+':\x20'+_0x2fa765[_0xdceee1(0x1d8)][_0xdceee1(0x1d0)](0x0,0x3c)),await K['notification']({'method':_0xdceee1(0x217),'params':{'content':_0x2fa765['message'],'meta':{'sender':_0x2fa765[_0xdceee1(0x1ee)]||'hub','sender_id':_0xdceee1(0x230),'user':_0x2fa765[_0xdceee1(0x1ee)]||_0xdceee1(0x21f),'priority':_0xdceee1(0x1df)}}}),_0x2fa765[_0xdceee1(0x1a9)])await P(_0xdceee1(0x1a4),{'alias':Z,'message_id':_0x2fa765['message_id']});return;}if(_0x2fa765[_0xdceee1(0x1b0)]===_0xdceee1(0x1eb)||_0x2fa765[_0xdceee1(0x1b0)]===_0xdceee1(0x1d1)){Y('←\x20'+_0x2fa765[_0xdceee1(0x1b0)]+_0xdceee1(0x1b8)+_0x2fa765[_0xdceee1(0x21e)]+_0xdceee1(0x20e)+(_0x2fa765[_0xdceee1(0x19f)]||_0xdceee1(0x1df)));let _0x5b7ba6=await P(_0xdceee1(0x1e5),{'alias':Z,'limit':0x5});if(_0x5b7ba6?.['ok']&&_0x5b7ba6['messages']?.[_0xdceee1(0x1fd)]>0x0)for(let _0xd05125 of _0x5b7ba6[_0xdceee1(0x1b5)]){let _0x444693={'sender':_0xd05125[_0xdceee1(0x1f5)]||'hub','sender_id':_0xdceee1(0x230),'user':_0xd05125[_0xdceee1(0x1f5)]||_0xdceee1(0x21f),'task_id':_0xd05125['id'],'priority':_0xd05125[_0xdceee1(0x19f)]||'normal'};k[_0xdceee1(0x20b)](_0xd05125['id'],_0xd05125[_0xdceee1(0x1f5)]||_0xdceee1(0x21f)),await K['notification']({'method':_0xdceee1(0x217),'params':{'content':_0xd05125['content'],'meta':_0x444693}}),Y('→\x20injected\x20task\x20'+_0xd05125['id'][_0xdceee1(0x1d0)](0x0,0x8)+_0xdceee1(0x20f)+_0xd05125[_0xdceee1(0x1f5)]+':\x20'+_0xd05125[_0xdceee1(0x225)][_0xdceee1(0x1d0)](0x0,0x3c)),await P('ack_inbox',{'alias':Z,'message_id':_0xd05125['id']});}}}async function A(){const _0x3a9c1f=a0_0x5126d1;let _0x64aa7e=new a0_0x28ce4f();await K[_0x3a9c1f(0x1db)](_0x64aa7e),Y(_0x3a9c1f(0x228)),Y('starting\x20SSE\x20listener...'),u()['catch'](_0x12d8b2=>Y(_0x3a9c1f(0x223)+_0x12d8b2)),P(_0x3a9c1f(0x1a6),{'resume_id':w,'alias':Z,'status':_0x3a9c1f(0x1f3),'server':a0_0x595711(),'hostname':a0_0x595711(),'agent':'claude-code','project_dir':process['cwd'](),'tmux_name':j||void 0x0})[_0x3a9c1f(0x1d3)](()=>Y(_0x3a9c1f(0x1ea)+Z+_0x3a9c1f(0x1fe)+w[_0x3a9c1f(0x1d0)](0x0,0x8)+')'))[_0x3a9c1f(0x1f2)](_0x19e45a=>Y('warning:\x20could\x20not\x20register:\x20'+_0x19e45a)),setInterval(()=>{const _0xb7f409=_0x3a9c1f;P(_0xb7f409(0x1a6),{'resume_id':w,'alias':Z,'status':_0xb7f409(0x1f3),'server':a0_0x595711(),'hostname':a0_0x595711(),'agent':_0xb7f409(0x1cf),'project_dir':process[_0xb7f409(0x1b4)](),'tmux_name':j||void 0x0})[_0xb7f409(0x1f2)](_0x22a229=>Y(_0xb7f409(0x22b)+_0x22a229));},0x2bf20),Y(_0x3a9c1f(0x1e0));}A()[a0_0x5126d1(0x1f2)](_0x20d4c7=>{const _0x96f8d9=a0_0x5126d1;Y(_0x96f8d9(0x221)+_0x20d4c7),process[_0x96f8d9(0x1ae)](0x1);});async function N(){const _0x3f9f24=a0_0x5126d1;Y(_0x3f9f24(0x1b6)),await P(_0x3f9f24(0x1a6),{'resume_id':w,'alias':Z,'status':_0x3f9f24(0x1ca),'task':_0x3f9f24(0x1ce)})[_0x3f9f24(0x1f2)](()=>{}),process[_0x3f9f24(0x1ae)](0x0);}process[a0_0x5126d1(0x1f6)]['on'](a0_0x5126d1(0x229),()=>N()),process['on'](a0_0x5126d1(0x1ec),()=>N()),process['on'](a0_0x5126d1(0x21b),()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.1.5",
3
+ "version": "2.1.6-preview.2",
4
4
  "description": "AI Agent Network CLI — Create multi-agent networks with user management, network isolation, and 3 AI runtimes (Claude/Codex/MiniMax). 39 commands.",
5
5
  "type": "module",
6
6
  "main": "dist/src/client.js",