@sleep2agi/agent-network 2.0.0-preview.61 → 2.0.0-preview.63

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_0xd4cb50=a0_0x425e;(function(_0x83cc79,_0x59f1da){const _0x158fbd=a0_0x425e,_0x482fdb=_0x83cc79();while(!![]){try{const _0x2fd7a1=parseInt(_0x158fbd(0x1f6))/0x1+-parseInt(_0x158fbd(0x1f5))/0x2+parseInt(_0x158fbd(0x20e))/0x3*(-parseInt(_0x158fbd(0x1e2))/0x4)+-parseInt(_0x158fbd(0x1f9))/0x5*(parseInt(_0x158fbd(0x20d))/0x6)+parseInt(_0x158fbd(0x1ee))/0x7+parseInt(_0x158fbd(0x1d2))/0x8+parseInt(_0x158fbd(0x21b))/0x9*(-parseInt(_0x158fbd(0x222))/0xa);if(_0x2fd7a1===_0x59f1da)break;else _0x482fdb['push'](_0x482fdb['shift']());}catch(_0x378f38){_0x482fdb['push'](_0x482fdb['shift']());}}}(a0_0x548c,0xcfeb5));import{EventEmitter as a0_0x566b96}from'events';import{hostname as a0_0x5aec2b}from'os';class T extends a0_0x566b96{[a0_0xd4cb50(0x1f8)];['alias'];[a0_0xd4cb50(0x217)];[a0_0xd4cb50(0x20f)];['resumeId'];[a0_0xd4cb50(0x20a)];[a0_0xd4cb50(0x1fa)];[a0_0xd4cb50(0x21e)];[a0_0xd4cb50(0x211)];[a0_0xd4cb50(0x1d1)]=!0x1;constructor(_0x13160c){const _0x1ab1f5=a0_0xd4cb50;super();if(this[_0x1ab1f5(0x1f8)]=_0x13160c['url']['replace'](/\/$/,''),this[_0x1ab1f5(0x203)]=_0x13160c['alias'],this[_0x1ab1f5(0x217)]=_0x13160c['token'],this[_0x1ab1f5(0x20f)]=_0x13160c['agent']||_0x1ab1f5(0x1e0),this['resumeId']=_0x1ab1f5(0x1d7)+_0x13160c[_0x1ab1f5(0x203)]+'-'+Date[_0x1ab1f5(0x214)]()[_0x1ab1f5(0x1dc)](0x24),this[_0x1ab1f5(0x20a)]=_0x13160c['heartbeatInterval']??0x2bf20,this['reconnectDelay']=_0x13160c[_0x1ab1f5(0x1fa)]??0xbb8,_0x13160c[_0x1ab1f5(0x1fc)]!==!0x1)this[_0x1ab1f5(0x226)]();}['log'](_0x4d18f4){const _0x53905a=a0_0xd4cb50;console[_0x53905a(0x209)]('['+new Date()[_0x53905a(0x1d6)]()[_0x53905a(0x216)](0x0,0x8)+']\x20[commhub:'+this[_0x53905a(0x203)]+']\x20'+_0x4d18f4);}async['call'](_0x13af93,_0x55767e){const _0x5f924=a0_0xd4cb50;let _0x4e3c5f={'Content-Type':_0x5f924(0x20b),'Accept':'application/json,\x20text/event-stream'};if(this[_0x5f924(0x217)])_0x4e3c5f[_0x5f924(0x1de)]=_0x5f924(0x201)+this['token'];let _0x2d3445=await(await fetch(this[_0x5f924(0x1f8)]+_0x5f924(0x1e1),{'method':_0x5f924(0x223),'headers':_0x4e3c5f,'body':JSON[_0x5f924(0x218)]({'jsonrpc':'2.0','id':Date[_0x5f924(0x214)](),'method':_0x5f924(0x1e4),'params':{'name':_0x13af93,'arguments':_0x55767e}})}))['text'](),_0x252a83=_0x2d3445[_0x5f924(0x1e8)](/data: (.+)/),_0x2743bf=_0x252a83?JSON[_0x5f924(0x215)](_0x252a83[0x1]):JSON[_0x5f924(0x215)](_0x2d3445),_0x395c65=_0x2743bf?.[_0x5f924(0x206)]?.[_0x5f924(0x1e9)]?.[0x0]?.['text'];return _0x395c65?JSON['parse'](_0x395c65):_0x2743bf;}async[a0_0xd4cb50(0x226)](){const _0x2b5035=a0_0xd4cb50;if(this['running'])return;this[_0x2b5035(0x1d1)]=!0x0,await this[_0x2b5035(0x1e6)](_0x2b5035(0x21f)),this[_0x2b5035(0x209)](_0x2b5035(0x1f7)),this['heartbeatTimer']=setInterval(()=>{const _0x455f78=_0x2b5035;this[_0x455f78(0x1e6)](_0x455f78(0x21f))[_0x455f78(0x1fd)](_0x3f70d2=>this[_0x455f78(0x209)](_0x455f78(0x210)+_0x3f70d2[_0x455f78(0x1d3)]));},this[_0x2b5035(0x20a)]),this['connectSSE']();}async[a0_0xd4cb50(0x204)](){const _0x1054fd=a0_0xd4cb50;if(this[_0x1054fd(0x1d1)]=!0x1,this['sseAbort']?.[_0x1054fd(0x219)](),this[_0x1054fd(0x21e)])clearInterval(this[_0x1054fd(0x21e)]);await this[_0x1054fd(0x1e6)](_0x1054fd(0x1eb))[_0x1054fd(0x1fd)](()=>{}),this[_0x1054fd(0x209)](_0x1054fd(0x202));}async['send'](_0x11b2b9,_0x55c309,_0x15a38d=a0_0xd4cb50(0x1d9)){const _0x480128=a0_0xd4cb50;return this[_0x480128(0x213)](_0x480128(0x1f3),{'alias':_0x11b2b9,'task':_0x55c309,'priority':_0x15a38d,'from_session':this['alias']});}async[a0_0xd4cb50(0x1d3)](_0x1be013,_0x441652){const _0x2ce3ec=a0_0xd4cb50;return this[_0x2ce3ec(0x213)]('send_message',{'alias':_0x1be013,'message':_0x441652,'from_session':this['alias']});}async[a0_0xd4cb50(0x1df)](_0x5c20cb,_0x4e44f0,_0x42613d=a0_0xd4cb50(0x208)){const _0x4f67b=a0_0xd4cb50;return this[_0x4f67b(0x213)](_0x4f67b(0x1df),{'task_id':_0x5c20cb,'text':_0x4e44f0,'status':_0x42613d});}async[a0_0xd4cb50(0x1e6)](_0x2e92f7,_0x2315ca){const _0x565aca=a0_0xd4cb50;return this['call'](_0x565aca(0x1f1),{'resume_id':this['resumeId'],'alias':this[_0x565aca(0x203)],'status':_0x2e92f7,'server':a0_0x5aec2b(),'hostname':a0_0x5aec2b(),'agent':this[_0x565aca(0x20f)],'project_dir':process[_0x565aca(0x200)](),..._0x2315ca});}async[a0_0xd4cb50(0x225)](){const _0x10fecd=a0_0xd4cb50;return this[_0x10fecd(0x213)](_0x10fecd(0x1f0),{});}async[a0_0xd4cb50(0x1e7)](_0x1b4532,_0x36d9e5){const _0x55a80f=a0_0xd4cb50;return this['call']('broadcast',{'message':_0x1b4532,'filter_server':_0x36d9e5?.[_0x55a80f(0x1ff)],'filter_status':_0x36d9e5?.[_0x55a80f(0x1e6)]});}async[a0_0xd4cb50(0x1fb)](){const _0x2d9978=a0_0xd4cb50;let _0x358f70=encodeURIComponent(this[_0x2d9978(0x203)]),_0xce7697=this[_0x2d9978(0x1f8)]+_0x2d9978(0x1da)+_0x358f70,_0x329241=this[_0x2d9978(0x1fa)];while(this[_0x2d9978(0x1d1)]){try{this['sseAbort']=new AbortController();let _0x495af8={'Accept':_0x2d9978(0x1e3)};if(this['token'])_0x495af8['Authorization']=_0x2d9978(0x201)+this[_0x2d9978(0x217)];let _0xa9c61f=await fetch(_0xce7697,{'headers':_0x495af8,'signal':this[_0x2d9978(0x211)][_0x2d9978(0x220)]});if(!_0xa9c61f['ok']||!_0xa9c61f[_0x2d9978(0x1ec)]){this['log'](_0x2d9978(0x1d5)+_0xa9c61f['status']),await this[_0x2d9978(0x205)](_0x329241),_0x329241=Math[_0x2d9978(0x1db)](_0x329241*1.5,0xea60);continue;}_0x329241=this[_0x2d9978(0x1fa)];let _0x276a82=_0xa9c61f[_0x2d9978(0x1ec)][_0x2d9978(0x221)](),_0x6bc08=new TextDecoder(),_0x9cbd87='';while(this[_0x2d9978(0x1d1)]){let {done:_0x5892fa,value:_0xaf67b4}=await _0x276a82[_0x2d9978(0x1fe)]();if(_0x5892fa)break;_0x9cbd87+=_0x6bc08[_0x2d9978(0x224)](_0xaf67b4,{'stream':!0x0});let _0x136edd=_0x9cbd87['split']('\x0a');_0x9cbd87=_0x136edd[_0x2d9978(0x1f4)]()||'';for(let _0x18e2a1 of _0x136edd){if(!_0x18e2a1[_0x2d9978(0x212)](_0x2d9978(0x21a)))continue;try{let _0x223745=JSON[_0x2d9978(0x215)](_0x18e2a1[_0x2d9978(0x216)](0x6));if(_0x223745['type']===_0x2d9978(0x1d8)){this[_0x2d9978(0x209)](_0x2d9978(0x1e5)),this['emit'](_0x2d9978(0x1d8));continue;}if(_0x223745[_0x2d9978(0x1d4)]===_0x2d9978(0x1ed)||_0x223745[_0x2d9978(0x1d4)]==='new_message'||_0x223745[_0x2d9978(0x1d4)]==='broadcast')await this['processInbox']();}catch{}}}}catch(_0x1a46e1){if(_0x1a46e1['name']===_0x2d9978(0x1f2))break;this[_0x2d9978(0x20c)](_0x2d9978(0x227),_0x1a46e1),this[_0x2d9978(0x209)]('SSE\x20error:\x20'+_0x1a46e1[_0x2d9978(0x1d3)]);}if(this['running'])this[_0x2d9978(0x20c)](_0x2d9978(0x202)),this[_0x2d9978(0x209)](_0x2d9978(0x21d)+_0x329241/0x3e8+_0x2d9978(0x1ea)),await this[_0x2d9978(0x205)](_0x329241),_0x329241=Math[_0x2d9978(0x1db)](_0x329241*1.5,0xea60);}}async[a0_0xd4cb50(0x1dd)](){const _0x340f74=a0_0xd4cb50;try{let _0x4244f2=(await this['call'](_0x340f74(0x1ef),{'alias':this[_0x340f74(0x203)],'limit':0xa}))?.[_0x340f74(0x21c)]||[];for(let _0x13ff30 of _0x4244f2)await this[_0x340f74(0x213)](_0x340f74(0x207),{'alias':this['alias'],'message_id':_0x13ff30['id']}),this['log']('←\x20'+_0x13ff30['from_session']+':\x20'+_0x13ff30['content'][_0x340f74(0x216)](0x0,0x3c)),this[_0x340f74(0x20c)]('task',_0x13ff30),this[_0x340f74(0x20c)]('message',_0x13ff30);}catch(_0x564268){this[_0x340f74(0x209)]('inbox\x20error:\x20'+_0x564268['message']);}}[a0_0xd4cb50(0x205)](_0x11a080){return new Promise(_0x3c7bce=>setTimeout(_0x3c7bce,_0x11a080));}}var $=T;function a0_0x425e(_0x5957f5,_0x228439){_0x5957f5=_0x5957f5-0x1d1;const _0x548ccb=a0_0x548c();let _0x425e21=_0x548ccb[_0x5957f5];return _0x425e21;}function a0_0x548c(){const _0x1aad88=['3001641xpEbhW','agent','heartbeat\x20failed:\x20','sseAbort','startsWith','call','now','parse','slice','token','stringify','abort','data:\x20','63GflKdI','messages','SSE\x20reconnecting\x20in\x20','heartbeatTimer','idle','signal','getReader','45570aZrGVV','POST','decode','getAllStatus','connect','error','running','11881192oEEOXf','message','type','SSE\x20failed:\x20','toTimeString','sdk-','connected','normal','/events/','min','toString','processInbox','Authorization','reply','sdk','/mcp','4NxUtrb','text/event-stream','tools/call','SSE\x20connected','status','broadcast','match','content','s...','offline','body','new_task','10351719HkTzNX','get_inbox','get_all_status','report_status','AbortError','send_task','pop','590208dsYaqB','461557TADCIh','registered','url','194740nwVafg','reconnectDelay','connectSSE','autoConnect','catch','read','server','cwd','Bearer\x20','disconnected','alias','disconnect','sleep','result','ack_inbox','completed','log','heartbeatInterval','application/json','emit','192FnJVEm'];a0_0x548c=function(){return _0x1aad88;};return a0_0x548c();}export{$ as default,T as CommHub};
1
+ const a0_0x10bdb3=a0_0x5a11;(function(_0x2d1f4c,_0x36f762){const _0x37e09e=a0_0x5a11,_0x1c013e=_0x2d1f4c();while(!![]){try{const _0x5783e8=-parseInt(_0x37e09e(0x112))/0x1+-parseInt(_0x37e09e(0x10d))/0x2*(parseInt(_0x37e09e(0x11a))/0x3)+parseInt(_0x37e09e(0xcd))/0x4*(-parseInt(_0x37e09e(0xff))/0x5)+-parseInt(_0x37e09e(0x118))/0x6*(parseInt(_0x37e09e(0xed))/0x7)+parseInt(_0x37e09e(0xd3))/0x8*(parseInt(_0x37e09e(0x119))/0x9)+-parseInt(_0x37e09e(0xea))/0xa+-parseInt(_0x37e09e(0xfd))/0xb*(-parseInt(_0x37e09e(0x121))/0xc);if(_0x5783e8===_0x36f762)break;else _0x1c013e['push'](_0x1c013e['shift']());}catch(_0x2653ad){_0x1c013e['push'](_0x1c013e['shift']());}}}(a0_0x42ae,0x2bfa6));function a0_0x42ae(){const _0x39bb1f=['split','application/json,\x20text/event-stream','call','getReader','toString','24TBcWhY','completed','match','send','Authorization','from_session','24PIpdRN','connectSSE','POST','AbortError','processInbox','disconnect','1942024XwKpCQ','Bearer\x20','new_task','messages','alias','registered','agent','token','report_status','heartbeatInterval','log','connected','send_task','emit','text','catch','autoConnect','s...','toTimeString','sleep','now','url','task','2006960aOjmUl','broadcast','message','301azrJlv','signal','sdk','offline','heartbeatTimer','slice','decode','2.0','tools/call','status','reconnectDelay','parse','content','get_all_status','SSE\x20connected','reply','5272971eGFDDJ','getAllStatus','124580xbrEpy','name','type','connect','sseAbort','pop','SSE\x20reconnecting\x20in\x20','send_message','normal','stringify','error','min','body','running','5146GyTUhD','data:\x20','abort','ack_inbox','resumeId','235792JTeZnI','new_message','inbox\x20error:\x20','disconnected','startsWith','get_inbox','22332KlDkjr','9YPsIap','321tIkFhi','/mcp'];a0_0x42ae=function(){return _0x39bb1f;};return a0_0x42ae();}function a0_0x5a11(_0x36450e,_0xd8f647){_0x36450e=_0x36450e-0xcd;const _0x42ae8f=a0_0x42ae();let _0x5a1101=_0x42ae8f[_0x36450e];return _0x5a1101;}import{EventEmitter as a0_0x69ad93}from'events';import{hostname as a0_0x243104}from'os';class T extends a0_0x69ad93{['url'];[a0_0x10bdb3(0xd7)];['token'];[a0_0x10bdb3(0xd9)];[a0_0x10bdb3(0x111)];[a0_0x10bdb3(0xdc)];[a0_0x10bdb3(0xf7)];[a0_0x10bdb3(0xf1)];[a0_0x10bdb3(0x103)];[a0_0x10bdb3(0x10c)]=!0x1;constructor(_0x58ca18){const _0x1a9a01=a0_0x10bdb3;super();if(this[_0x1a9a01(0xe8)]=_0x58ca18['url']['replace'](/\/$/,''),this[_0x1a9a01(0xd7)]=_0x58ca18['alias'],this[_0x1a9a01(0xda)]=_0x58ca18[_0x1a9a01(0xda)],this[_0x1a9a01(0xd9)]=_0x58ca18[_0x1a9a01(0xd9)]||_0x1a9a01(0xef),this[_0x1a9a01(0x111)]='sdk-'+_0x58ca18[_0x1a9a01(0xd7)]+'-'+Date[_0x1a9a01(0xe7)]()[_0x1a9a01(0x120)](0x24),this[_0x1a9a01(0xdc)]=_0x58ca18[_0x1a9a01(0xdc)]??0x2bf20,this[_0x1a9a01(0xf7)]=_0x58ca18[_0x1a9a01(0xf7)]??0xbb8,_0x58ca18[_0x1a9a01(0xe3)]!==!0x1)this['connect']();}[a0_0x10bdb3(0xdd)](_0x5a2164){const _0x4bc641=a0_0x10bdb3;console[_0x4bc641(0xdd)]('['+new Date()[_0x4bc641(0xe5)]()[_0x4bc641(0xf2)](0x0,0x8)+']\x20[commhub:'+this['alias']+']\x20'+_0x5a2164);}async['call'](_0x4f33b8,_0x1799ae){const _0x337d85=a0_0x10bdb3;let _0x28d2bf={'Content-Type':'application/json','Accept':_0x337d85(0x11d)};if(this[_0x337d85(0xda)])_0x28d2bf['Authorization']=_0x337d85(0xd4)+this[_0x337d85(0xda)];let _0x5dbc7d=await(await fetch(this['url']+_0x337d85(0x11b),{'method':_0x337d85(0xcf),'headers':_0x28d2bf,'body':JSON[_0x337d85(0x108)]({'jsonrpc':_0x337d85(0xf4),'id':Date[_0x337d85(0xe7)](),'method':_0x337d85(0xf5),'params':{'name':_0x4f33b8,'arguments':_0x1799ae}})}))[_0x337d85(0xe1)](),_0x3b7426=_0x5dbc7d[_0x337d85(0x123)](/data: (.+)/),_0x5423ea=_0x3b7426?JSON[_0x337d85(0xf8)](_0x3b7426[0x1]):JSON[_0x337d85(0xf8)](_0x5dbc7d),_0x2f4947=_0x5423ea?.['result']?.['content']?.[0x0]?.['text'];return _0x2f4947?JSON[_0x337d85(0xf8)](_0x2f4947):_0x5423ea;}async[a0_0x10bdb3(0x102)](){const _0x1e9ae2=a0_0x10bdb3;if(this[_0x1e9ae2(0x10c)])return;this['running']=!0x0,await this[_0x1e9ae2(0xf6)]('idle'),this[_0x1e9ae2(0xdd)](_0x1e9ae2(0xd8)),this[_0x1e9ae2(0xf1)]=setInterval(()=>{const _0x4471eb=_0x1e9ae2;this[_0x4471eb(0xf6)]('idle')[_0x4471eb(0xe2)](_0x10dde8=>this['log']('heartbeat\x20failed:\x20'+_0x10dde8[_0x4471eb(0xec)]));},this[_0x1e9ae2(0xdc)]),this['connectSSE']();}async[a0_0x10bdb3(0xd2)](){const _0x3c6a35=a0_0x10bdb3;if(this[_0x3c6a35(0x10c)]=!0x1,this['sseAbort']?.[_0x3c6a35(0x10f)](),this[_0x3c6a35(0xf1)])clearInterval(this[_0x3c6a35(0xf1)]);await this[_0x3c6a35(0xf6)](_0x3c6a35(0xf0))[_0x3c6a35(0xe2)](()=>{}),this[_0x3c6a35(0xdd)]('disconnected');}async[a0_0x10bdb3(0x124)](_0x5568f3,_0x4e7f67,_0x1dabcb=a0_0x10bdb3(0x107)){const _0x52eff4=a0_0x10bdb3;return this['call'](_0x52eff4(0xdf),{'alias':_0x5568f3,'task':_0x4e7f67,'priority':_0x1dabcb,'from_session':this[_0x52eff4(0xd7)]});}async['message'](_0xf52396,_0x152aae){const _0x4876d1=a0_0x10bdb3;return this[_0x4876d1(0x11e)](_0x4876d1(0x106),{'alias':_0xf52396,'message':_0x152aae,'from_session':this[_0x4876d1(0xd7)]});}async['reply'](_0x2eddd4,_0x317363,_0xf88781=a0_0x10bdb3(0x122)){const _0x410bee=a0_0x10bdb3;return this[_0x410bee(0x11e)](_0x410bee(0xfc),{'task_id':_0x2eddd4,'text':_0x317363,'status':_0xf88781});}async[a0_0x10bdb3(0xf6)](_0x144f04,_0x4d43e5){const _0x3b0f02=a0_0x10bdb3;return this[_0x3b0f02(0x11e)](_0x3b0f02(0xdb),{'resume_id':this[_0x3b0f02(0x111)],'alias':this['alias'],'status':_0x144f04,'server':a0_0x243104(),'hostname':a0_0x243104(),'agent':this['agent'],'project_dir':process['cwd'](),..._0x4d43e5});}async[a0_0x10bdb3(0xfe)](){const _0x2ae955=a0_0x10bdb3;return this['call'](_0x2ae955(0xfa),{});}async['broadcast'](_0xbf95bc,_0x56bc69){const _0x359586=a0_0x10bdb3;return this[_0x359586(0x11e)](_0x359586(0xeb),{'message':_0xbf95bc,'filter_server':_0x56bc69?.['server'],'filter_status':_0x56bc69?.['status']});}async[a0_0x10bdb3(0xce)](){const _0x43e86a=a0_0x10bdb3;let _0x3f3f41=encodeURIComponent(this['alias']),_0x1e3a05=this['url']+'/events/'+_0x3f3f41,_0x25668d=this[_0x43e86a(0xf7)];while(this[_0x43e86a(0x10c)]){try{this[_0x43e86a(0x103)]=new AbortController();let _0x39e9a7={'Accept':'text/event-stream'};if(this['token'])_0x39e9a7[_0x43e86a(0x125)]=_0x43e86a(0xd4)+this[_0x43e86a(0xda)];let _0x29e65f=await fetch(_0x1e3a05,{'headers':_0x39e9a7,'signal':this[_0x43e86a(0x103)][_0x43e86a(0xee)]});if(!_0x29e65f['ok']||!_0x29e65f[_0x43e86a(0x10b)]){this[_0x43e86a(0xdd)]('SSE\x20failed:\x20'+_0x29e65f['status']),await this[_0x43e86a(0xe6)](_0x25668d),_0x25668d=Math[_0x43e86a(0x10a)](_0x25668d*1.5,0xea60);continue;}_0x25668d=this[_0x43e86a(0xf7)];let _0x144a08=_0x29e65f[_0x43e86a(0x10b)][_0x43e86a(0x11f)](),_0x265b33=new TextDecoder(),_0x429d91='';while(this[_0x43e86a(0x10c)]){let {done:_0x280d2e,value:_0x2bb401}=await _0x144a08['read']();if(_0x280d2e)break;_0x429d91+=_0x265b33[_0x43e86a(0xf3)](_0x2bb401,{'stream':!0x0});let _0x44d41d=_0x429d91[_0x43e86a(0x11c)]('\x0a');_0x429d91=_0x44d41d[_0x43e86a(0x104)]()||'';for(let _0x5452ae of _0x44d41d){if(!_0x5452ae[_0x43e86a(0x116)](_0x43e86a(0x10e)))continue;try{let _0x2da01a=JSON[_0x43e86a(0xf8)](_0x5452ae['slice'](0x6));if(_0x2da01a[_0x43e86a(0x101)]===_0x43e86a(0xde)){this[_0x43e86a(0xdd)](_0x43e86a(0xfb)),this[_0x43e86a(0xe0)](_0x43e86a(0xde));continue;}if(_0x2da01a[_0x43e86a(0x101)]===_0x43e86a(0xd5)||_0x2da01a[_0x43e86a(0x101)]===_0x43e86a(0x113)||_0x2da01a['type']===_0x43e86a(0xeb))await this[_0x43e86a(0xd1)]();}catch{}}}}catch(_0x36d3c9){if(_0x36d3c9[_0x43e86a(0x100)]===_0x43e86a(0xd0))break;this[_0x43e86a(0xe0)](_0x43e86a(0x109),_0x36d3c9),this[_0x43e86a(0xdd)]('SSE\x20error:\x20'+_0x36d3c9['message']);}if(this['running'])this['emit'](_0x43e86a(0x115)),this['log'](_0x43e86a(0x105)+_0x25668d/0x3e8+_0x43e86a(0xe4)),await this[_0x43e86a(0xe6)](_0x25668d),_0x25668d=Math[_0x43e86a(0x10a)](_0x25668d*1.5,0xea60);}}async[a0_0x10bdb3(0xd1)](){const _0x3882eb=a0_0x10bdb3;try{let _0x4deb4e=(await this[_0x3882eb(0x11e)](_0x3882eb(0x117),{'alias':this[_0x3882eb(0xd7)],'limit':0xa}))?.[_0x3882eb(0xd6)]||[];for(let _0x1483e7 of _0x4deb4e)await this['call'](_0x3882eb(0x110),{'alias':this[_0x3882eb(0xd7)],'message_id':_0x1483e7['id']}),this[_0x3882eb(0xdd)]('←\x20'+_0x1483e7[_0x3882eb(0x126)]+':\x20'+_0x1483e7[_0x3882eb(0xf9)]['slice'](0x0,0x3c)),this[_0x3882eb(0xe0)](_0x3882eb(0xe9),_0x1483e7),this['emit'](_0x3882eb(0xec),_0x1483e7);}catch(_0x34d320){this[_0x3882eb(0xdd)](_0x3882eb(0x114)+_0x34d320[_0x3882eb(0xec)]);}}['sleep'](_0x49d4f6){return new Promise(_0x5080f3=>setTimeout(_0x5080f3,_0x49d4f6));}}var $=T;export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- function a0_0x3651(_0x3a1bdf,_0x368734){_0x3a1bdf=_0x3a1bdf-0x1b0;const _0x1b98e1=a0_0x1b98();let _0x3651e6=_0x1b98e1[_0x3a1bdf];return _0x3651e6;}const a0_0x56b24e=a0_0x3651;(function(_0x342e5f,_0x10aa7d){const _0xcb5144=a0_0x3651,_0x580e3f=_0x342e5f();while(!![]){try{const _0x182144=-parseInt(_0xcb5144(0x223))/0x1*(-parseInt(_0xcb5144(0x1eb))/0x2)+-parseInt(_0xcb5144(0x1d8))/0x3*(parseInt(_0xcb5144(0x1ed))/0x4)+-parseInt(_0xcb5144(0x1be))/0x5*(parseInt(_0xcb5144(0x1df))/0x6)+-parseInt(_0xcb5144(0x1b0))/0x7*(parseInt(_0xcb5144(0x1bc))/0x8)+parseInt(_0xcb5144(0x1dd))/0x9+-parseInt(_0xcb5144(0x222))/0xa+-parseInt(_0xcb5144(0x22b))/0xb*(-parseInt(_0xcb5144(0x1b2))/0xc);if(_0x182144===_0x10aa7d)break;else _0x580e3f['push'](_0x580e3f['shift']());}catch(_0x31869e){_0x580e3f['push'](_0x580e3f['shift']());}}}(a0_0x1b98,0x6522c));import{readFileSync as a0_0x98ae40,existsSync as a0_0x3dac8e}from'fs';import{join as a0_0x60292d}from'path';import{hostname as a0_0x1f4fe3}from'os';import{execSync as a0_0x5a409f}from'child_process';import{Server as a0_0xcbe0c1}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x56899a}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x26a4b3,CallToolRequestSchema as a0_0x1266c7}from'@modelcontextprotocol/sdk/types.js';function p(_0x1dba60){const _0x24c417=a0_0x3651;if(!a0_0x3dac8e(_0x1dba60))return;for(let _0x36b18f of a0_0x98ae40(_0x1dba60,'utf-8')[_0x24c417(0x203)]('\x0a')){let _0x353703=_0x36b18f[_0x24c417(0x20b)]();if(!_0x353703||_0x353703['startsWith']('#'))continue;let _0x4fc070=_0x353703[_0x24c417(0x22a)]('=');if(_0x4fc070<0x0)continue;let _0x54d0d4=_0x353703[_0x24c417(0x22d)](0x0,_0x4fc070)[_0x24c417(0x20b)](),_0x34cd5b=_0x353703['slice'](_0x4fc070+0x1)[_0x24c417(0x20b)]()['replace'](/^["']|["']$/g,'');if(!process.env[_0x54d0d4])process.env[_0x54d0d4]=_0x34cd5b;}}var C=process.env.HOME||'~',T=a0_0x60292d(C,a0_0x56b24e(0x21c));function a0_0x1b98(){const _0x3f6bba=['alias','slice','SSE\x20stream\x20ended,\x20reconnecting...','setRequestHandler','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','type','.anet','pop','connected','initialize','\x20PROJECT_ENV=','registered\x20as\x20\x22','/mcp','37541JuBvHh','utf-8','10289856ZmrYql','message','tmux\x20display-message\x20-p\x20\x27#S\x27','status','0.3.0','Bearer\x20','from','claude-code','get','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','1128LSOtGY','from_session','65hRpbCJ','SIGINT','hub','catch','Priority\x20(default:\x20normal)','send_task','2.0','normal','commhub','ready\x20—\x20waiting\x20for\x20events','/events/','commhub_send_task','\x20RESUME_ID=','inbox_count','CommHub\x20init\x20failed:\x20','Target\x20session\x20alias','low','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','startsWith','fatal:\x20','send_message','content','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','shutting\x20down,\x20reporting\x20offline...','Task\x20content','parse','14265CjyllL','send_reply','error','in_progress','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','4506624fzEfwQ','data:\x20','58854uFXOlv','end','cwd','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','result','token','MCP\x20stdio\x20connected','text',']\x20[commhub]\x20','priority','delete','working','114992Xpjbfw','commhub-channel','4fYIjWG','no\x20response','POST','SSE\x20connection\x20error:\x20','message_id','commhub_report_status','string','Reply\x20text\x20/\x20result\x20summary','ENV:\x20URL=','get_all_status','unknown\x20tool','\x20priority=','blocked','commhub_reply','then','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','session\x20disconnected','statusText','connect','messages','commhub_get_all_status','commhub_send_message','split','stringify','failed','replace','getReader','report_status','heartbeat\x20failed:\x20','warning:\x20could\x20not\x20register:\x20','trim','exit','SIGTERM','notifications/claude/channel','\x20CWD=','ack_inbox','toTimeString','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','Session\x20alias:\x20','find','starting\x20SSE\x20listener...','params','cancelled','application/json,\x20text/event-stream','.env','high','object','.claude/channels/commhub','http://127.0.0.1:9200','Authorization','idle','notification','task','5729810TDziKM','9Wmadru','init\x20failed:\x20','completed','config.json','connecting\x20to\x20','parse\x20error:\x20','stdin','indexOf','11ZsbfAB'];a0_0x1b98=function(){return _0x3f6bba;};return a0_0x1b98();}p(a0_0x60292d(T,a0_0x56b24e(0x219)));var L=process[a0_0x56b24e(0x1e1)]()[a0_0x56b24e(0x206)](/\//g,'-');p(a0_0x60292d(T,L,a0_0x56b24e(0x219)));function U(){const _0x4cd7bd=a0_0x56b24e;try{return a0_0x5a409f(_0x4cd7bd(0x1b4),{'encoding':_0x4cd7bd(0x1b1),'timeout':0x7d0})[_0x4cd7bd(0x20b)]();}catch{return'';}}function c(){const _0x3de986=a0_0x56b24e;try{let _0x53b525=a0_0x60292d(C,_0x3de986(0x232),_0x3de986(0x226));if(a0_0x3dac8e(_0x53b525))return JSON[_0x3de986(0x1d7)](a0_0x98ae40(_0x53b525,_0x3de986(0x1b1)));}catch{}return{};}var H=c(),D=process.env.COMMHUB_URL||H[a0_0x56b24e(0x1c0)]||a0_0x56b24e(0x21d),f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0x1f4fe3(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto['randomUUID'](),X=process.env.COMMHUB_TOKEN||H[a0_0x56b24e(0x1e4)]||'';function Y(_0x2795a9){const _0x1fa9f2=a0_0x56b24e;let _0x4faec2=new Date()[_0x1fa9f2(0x211)]()[_0x1fa9f2(0x22d)](0x0,0x8);process['stderr']['write']('['+_0x4faec2+_0x1fa9f2(0x1e7)+_0x2795a9+'\x0a');}function h(_0x5c0791){return new Promise(_0x203611=>setTimeout(_0x203611,_0x5c0791));}Y(a0_0x56b24e(0x1f5)+D+'\x20ALIAS='+Z+a0_0x56b24e(0x1ca)+w[a0_0x56b24e(0x22d)](0x0,0x8)+'...\x20TMUX='+(f||'none')+a0_0x56b24e(0x20f)+process[a0_0x56b24e(0x1e1)]()+a0_0x56b24e(0x236)+L);var k=new Map(),K=new a0_0xcbe0c1({'name':'commhub-channel','version':a0_0x56b24e(0x1b6)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x56b24e(0x1d4),a0_0x56b24e(0x1bb),a0_0x56b24e(0x1e2),a0_0x56b24e(0x1cf),a0_0x56b24e(0x213)+Z]['join']('\x0a')});K[a0_0x56b24e(0x22f)](a0_0x26a4b3,async()=>({'tools':[{'name':a0_0x56b24e(0x1fa),'description':'Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','inputSchema':{'type':a0_0x56b24e(0x21b),'properties':{'task_id':{'type':a0_0x56b24e(0x1f3),'description':a0_0x56b24e(0x1dc)},'text':{'type':'string','description':a0_0x56b24e(0x1f4)},'status':{'type':a0_0x56b24e(0x1f3),'enum':[a0_0x56b24e(0x225),a0_0x56b24e(0x205),a0_0x56b24e(0x217),a0_0x56b24e(0x1f9),'error',a0_0x56b24e(0x1db)],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':[a0_0x56b24e(0x1e6)]}},{'name':a0_0x56b24e(0x1f2),'description':a0_0x56b24e(0x230),'inputSchema':{'type':a0_0x56b24e(0x21b),'properties':{'status':{'type':a0_0x56b24e(0x1f3),'enum':['working',a0_0x56b24e(0x21f),'blocked',a0_0x56b24e(0x1da)]},'task':{'type':a0_0x56b24e(0x1f3),'description':'Current\x20task\x20description'},'progress':{'type':'number','description':'Progress\x200-100'}},'required':[a0_0x56b24e(0x1b5)]}},{'name':a0_0x56b24e(0x1c9),'description':a0_0x56b24e(0x212),'inputSchema':{'type':a0_0x56b24e(0x21b),'properties':{'alias':{'type':'string','description':'Target\x20session\x20alias'},'task':{'type':a0_0x56b24e(0x1f3),'description':a0_0x56b24e(0x1d6)},'priority':{'type':a0_0x56b24e(0x1f3),'enum':[a0_0x56b24e(0x21a),a0_0x56b24e(0x1c5),a0_0x56b24e(0x1ce)],'description':a0_0x56b24e(0x1c2)}},'required':[a0_0x56b24e(0x22c),a0_0x56b24e(0x221)]}},{'name':'commhub_send_message','description':'Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','inputSchema':{'type':a0_0x56b24e(0x21b),'properties':{'alias':{'type':'string','description':a0_0x56b24e(0x1cd)},'message':{'type':a0_0x56b24e(0x1f3),'description':'Message\x20content'}},'required':[a0_0x56b24e(0x22c),'message']}},{'name':'commhub_get_all_status','description':a0_0x56b24e(0x1fc),'inputSchema':{'type':'object','properties':{}}}]}));async function P(_0x2d4a70,_0x31a86b){const _0x579cf9=a0_0x56b24e;let _0x198e28=await fetch(D+'/mcp',{'method':_0x579cf9(0x1ef),'headers':{'Content-Type':'application/json','Accept':_0x579cf9(0x218),...X?{'Authorization':_0x579cf9(0x1b7)+X}:{}},'body':JSON[_0x579cf9(0x204)]({'jsonrpc':_0x579cf9(0x1c4),'id':0x1,'method':_0x579cf9(0x235),'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x579cf9(0x1ec),'version':_0x579cf9(0x1b6)}}})});if(!_0x198e28['ok']){let _0x5d2f77=await _0x198e28[_0x579cf9(0x1e6)]();return Y(_0x579cf9(0x1cc)+_0x198e28[_0x579cf9(0x1b5)]+'\x20'+_0x5d2f77[_0x579cf9(0x22d)](0x0,0x64)),{'ok':!0x1,'error':_0x579cf9(0x224)+_0x198e28[_0x579cf9(0x1b5)]};}await _0x198e28[_0x579cf9(0x1e6)]();let _0x57cb03=(await(await fetch(D+_0x579cf9(0x238),{'method':_0x579cf9(0x1ef),'headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x579cf9(0x1b7)+X}:{}},'body':JSON[_0x579cf9(0x204)]({'jsonrpc':_0x579cf9(0x1c4),'id':0x2,'method':'tools/call','params':{'name':_0x2d4a70,'arguments':_0x31a86b}})}))[_0x579cf9(0x1e6)]())[_0x579cf9(0x203)]('\x0a')[_0x579cf9(0x214)](_0x4bd408=>_0x4bd408[_0x579cf9(0x1d0)](_0x579cf9(0x1de)));if(_0x57cb03){let _0x14a6a2=JSON['parse'](_0x57cb03[_0x579cf9(0x22d)](0x6));return _0x14a6a2?.[_0x579cf9(0x1e3)]?.[_0x579cf9(0x1d3)]?.[0x0]?.[_0x579cf9(0x1e6)]?JSON[_0x579cf9(0x1d7)](_0x14a6a2[_0x579cf9(0x1e3)][_0x579cf9(0x1d3)][0x0][_0x579cf9(0x1e6)]):_0x14a6a2;}return{'ok':!0x1,'error':_0x579cf9(0x1ee)};}K[a0_0x56b24e(0x22f)](a0_0x1266c7,async _0x1a28d8=>{const _0x5033b9=a0_0x56b24e;let {name:_0x1443ba,arguments:_0xcb19b}=_0x1a28d8[_0x5033b9(0x216)];if(_0x1443ba===_0x5033b9(0x1fa)){let {task_id:_0x9f87b0,text:_0x3c7e17,status:_0x29eef9}=_0xcb19b;if(_0x29eef9===_0x5033b9(0x225)||_0x29eef9===_0x5033b9(0x205)||_0x29eef9===_0x5033b9(0x217)){let _0x6b7f44=_0x29eef9===_0x5033b9(0x225)?'replied':_0x29eef9,_0x441c3b=_0x9f87b0?k[_0x5033b9(0x1ba)](_0x9f87b0)||_0x5033b9(0x1c0):'hub',_0x2bd44e=await P(_0x5033b9(0x1d9),{'alias':_0x441c3b,'text':_0x3c7e17,'in_reply_to':_0x9f87b0||void 0x0,'status':_0x6b7f44,'from_session':Z});if(_0x9f87b0)k[_0x5033b9(0x1e9)](_0x9f87b0);return{'content':[{'type':_0x5033b9(0x1e6),'text':JSON[_0x5033b9(0x204)](_0x2bd44e)}]};}let _0x17afc2=await P(_0x5033b9(0x208),{'resume_id':w,'alias':Z,'status':_0x29eef9==='blocked'?_0x5033b9(0x1f9):_0x29eef9===_0x5033b9(0x1da)?_0x5033b9(0x1da):_0x5033b9(0x1ea),'task':_0x3c7e17[_0x5033b9(0x22d)](0x0,0xc8),'output':_0x3c7e17});return{'content':[{'type':'text','text':JSON[_0x5033b9(0x204)](_0x17afc2)}]};}if(_0x1443ba===_0x5033b9(0x1f2)){let {status:_0x591932,task:_0x5f1af2,progress:_0x58e2a3}=_0xcb19b,_0x286c9b=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x591932,'task':_0x5f1af2,'progress':_0x58e2a3});return{'content':[{'type':_0x5033b9(0x1e6),'text':JSON[_0x5033b9(0x204)](_0x286c9b)}]};}if(_0x1443ba===_0x5033b9(0x1c9)){let {alias:_0x454ac3,task:_0x1670f3,priority:_0x1caa51}=_0xcb19b,_0x48aa77=await P(_0x5033b9(0x1c3),{'alias':_0x454ac3,'task':_0x1670f3,'priority':_0x1caa51||_0x5033b9(0x1c5),'from_session':Z});return{'content':[{'type':_0x5033b9(0x1e6),'text':JSON['stringify'](_0x48aa77)}]};}if(_0x1443ba===_0x5033b9(0x202)){let {alias:_0x431d8f,message:_0xc54930}=_0xcb19b,_0x396138=await P(_0x5033b9(0x1d2),{'alias':_0x431d8f,'message':_0xc54930,'from_session':Z});return{'content':[{'type':_0x5033b9(0x1e6),'text':JSON[_0x5033b9(0x204)](_0x396138)}]};}if(_0x1443ba===_0x5033b9(0x201)){let _0x3ccdfc=await P(_0x5033b9(0x1f6),{});return{'content':[{'type':_0x5033b9(0x1e6),'text':JSON[_0x5033b9(0x204)](_0x3ccdfc)}]};}return{'content':[{'type':_0x5033b9(0x1e6),'text':JSON[_0x5033b9(0x204)]({'error':_0x5033b9(0x1f7)})}]};});async function v(){const _0xd4748d=a0_0x56b24e;let _0x1d349f=D+_0xd4748d(0x1c8)+encodeURIComponent(Z),_0x367923={};if(X)_0x367923[_0xd4748d(0x21e)]='Bearer\x20'+X;Y(_0xd4748d(0x227)+_0x1d349f);while(!0x0){try{let _0x5e9572=await fetch(_0x1d349f,{'headers':_0x367923});if(!_0x5e9572['ok']){Y('SSE\x20error:\x20'+_0x5e9572[_0xd4748d(0x1b5)]+'\x20'+_0x5e9572[_0xd4748d(0x1fe)]),await h(0x1388);continue;}let _0x5a398d=_0x5e9572['body'][_0xd4748d(0x207)](),_0x560c0=new TextDecoder(),_0x490dd8='';while(!0x0){let {done:_0xf0073f,value:_0x377689}=await _0x5a398d['read']();if(_0xf0073f)break;_0x490dd8+=_0x560c0['decode'](_0x377689,{'stream':!0x0});let _0x38b945=_0x490dd8[_0xd4748d(0x203)]('\x0a\x0a');_0x490dd8=_0x38b945[_0xd4748d(0x233)]()||'';for(let _0x4c46b0 of _0x38b945){let _0xfaa2b4=_0x4c46b0['split']('\x0a')['find'](_0x1e128e=>_0x1e128e[_0xd4748d(0x1d0)](_0xd4748d(0x1de)));if(!_0xfaa2b4)continue;try{let _0x52c2ed=JSON[_0xd4748d(0x1d7)](_0xfaa2b4[_0xd4748d(0x22d)](0x6));await u(_0x52c2ed);}catch(_0x245f06){Y(_0xd4748d(0x228)+_0x245f06);}}}Y(_0xd4748d(0x22e));}catch(_0x46018a){Y(_0xd4748d(0x1f0)+_0x46018a);}await h(0xbb8);}}async function u(_0x1cdec0){const _0x3e5580=a0_0x56b24e;if(_0x1cdec0[_0x3e5580(0x231)]===_0x3e5580(0x234)){Y('SSE\x20connected\x20as\x20\x22'+Z+'\x22');return;}if(_0x1cdec0[_0x3e5580(0x231)]==='new_message'){if(Y('←\x20message\x20from\x20'+_0x1cdec0['from']+':\x20'+_0x1cdec0[_0x3e5580(0x1b3)]['slice'](0x0,0x3c)),await K[_0x3e5580(0x220)]({'method':_0x3e5580(0x20e),'params':{'content':_0x1cdec0['message'],'meta':{'sender':_0x1cdec0[_0x3e5580(0x1b8)]||_0x3e5580(0x1c0),'sender_id':'commhub','user':_0x1cdec0[_0x3e5580(0x1b8)]||'hub','priority':_0x3e5580(0x1c5)}}}),_0x1cdec0[_0x3e5580(0x1f1)])await P(_0x3e5580(0x210),{'alias':Z,'message_id':_0x1cdec0[_0x3e5580(0x1f1)]});return;}if(_0x1cdec0[_0x3e5580(0x231)]==='new_task'||_0x1cdec0[_0x3e5580(0x231)]==='broadcast'){Y('←\x20'+_0x1cdec0['type']+':\x20inbox_count='+_0x1cdec0[_0x3e5580(0x1cb)]+_0x3e5580(0x1f8)+(_0x1cdec0['priority']||_0x3e5580(0x1c5)));let _0x589846=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0x589846?.['ok']&&_0x589846[_0x3e5580(0x200)]?.['length']>0x0)for(let _0x283c44 of _0x589846[_0x3e5580(0x200)]){let _0x31e8d6={'sender':_0x283c44[_0x3e5580(0x1bd)]||'hub','sender_id':_0x3e5580(0x1c6),'user':_0x283c44[_0x3e5580(0x1bd)]||'hub','task_id':_0x283c44['id'],'priority':_0x283c44[_0x3e5580(0x1e8)]||_0x3e5580(0x1c5)};k['set'](_0x283c44['id'],_0x283c44[_0x3e5580(0x1bd)]||_0x3e5580(0x1c0)),await K['notification']({'method':_0x3e5580(0x20e),'params':{'content':_0x283c44[_0x3e5580(0x1d3)],'meta':_0x31e8d6}}),Y('→\x20injected\x20task\x20'+_0x283c44['id'][_0x3e5580(0x22d)](0x0,0x8)+'\x20from\x20'+_0x283c44['from_session']+':\x20'+_0x283c44[_0x3e5580(0x1d3)][_0x3e5580(0x22d)](0x0,0x3c)),await P(_0x3e5580(0x210),{'alias':Z,'message_id':_0x283c44['id']});}}}async function S(){const _0x397c6b=a0_0x56b24e;let _0x22eab2=new a0_0x56899a();await K[_0x397c6b(0x1ff)](_0x22eab2),Y(_0x397c6b(0x1e5)),Y(_0x397c6b(0x215)),v()['catch'](_0x8c4bf=>Y('SSE\x20fatal:\x20'+_0x8c4bf)),P(_0x397c6b(0x208),{'resume_id':w,'alias':Z,'status':_0x397c6b(0x21f),'server':a0_0x1f4fe3(),'hostname':a0_0x1f4fe3(),'agent':_0x397c6b(0x1b9),'project_dir':process['cwd'](),'tmux_name':f||void 0x0})[_0x397c6b(0x1fb)](()=>Y(_0x397c6b(0x237)+Z+'\x22\x20('+w[_0x397c6b(0x22d)](0x0,0x8)+')'))[_0x397c6b(0x1c1)](_0x1a95f1=>Y(_0x397c6b(0x20a)+_0x1a95f1)),setInterval(()=>{const _0x56b26c=_0x397c6b;P('report_status',{'resume_id':w,'alias':Z,'status':_0x56b26c(0x21f),'server':a0_0x1f4fe3(),'hostname':a0_0x1f4fe3(),'agent':'claude-code','project_dir':process[_0x56b26c(0x1e1)](),'tmux_name':f||void 0x0})[_0x56b26c(0x1c1)](_0x5c060f=>Y(_0x56b26c(0x209)+_0x5c060f));},0x2bf20),Y(_0x397c6b(0x1c7));}S()[a0_0x56b24e(0x1c1)](_0x231524=>{const _0x43c680=a0_0x56b24e;Y(_0x43c680(0x1d1)+_0x231524),process[_0x43c680(0x20c)](0x1);});async function N(){const _0x2782b1=a0_0x56b24e;Y(_0x2782b1(0x1d5)),await P(_0x2782b1(0x208),{'resume_id':w,'alias':Z,'status':_0x2782b1(0x1da),'task':_0x2782b1(0x1fd)})[_0x2782b1(0x1c1)](()=>{}),process[_0x2782b1(0x20c)](0x0);}process[a0_0x56b24e(0x229)]['on'](a0_0x56b24e(0x1e0),()=>N()),process['on'](a0_0x56b24e(0x20d),()=>N()),process['on'](a0_0x56b24e(0x1bf),()=>N());
2
+ const a0_0x54f95f=a0_0x5af3;(function(_0x425861,_0x1ac91b){const _0x2d5160=a0_0x5af3,_0x11631b=_0x425861();while(!![]){try{const _0x5b1d02=-parseInt(_0x2d5160(0x18c))/0x1*(parseInt(_0x2d5160(0x197))/0x2)+-parseInt(_0x2d5160(0x1a2))/0x3+-parseInt(_0x2d5160(0x14b))/0x4*(-parseInt(_0x2d5160(0x151))/0x5)+-parseInt(_0x2d5160(0x115))/0x6+parseInt(_0x2d5160(0x15b))/0x7*(-parseInt(_0x2d5160(0x14f))/0x8)+parseInt(_0x2d5160(0x179))/0x9+parseInt(_0x2d5160(0x18b))/0xa;if(_0x5b1d02===_0x1ac91b)break;else _0x11631b['push'](_0x11631b['shift']());}catch(_0x331a89){_0x11631b['push'](_0x11631b['shift']());}}}(a0_0x271b,0x9163c));function a0_0x271b(){const _0x625567=['priority','3695178hoOOKy','\x20CWD=','from','Message\x20content','Bearer\x20','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','0.3.0','Target\x20session\x20alias','parse\x20error:\x20','stderr','connect','\x20priority=','string','Session\x20alias:\x20','none','startsWith','utf-8','/mcp','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','parse',']\x20[commhub]\x20','hub','\x22\x20(','\x20PROJECT_ENV=','failed','getReader','join','error','cwd','\x20RESUME_ID=','Reply\x20text\x20/\x20result\x20summary','SSE\x20fatal:\x20','stringify','\x20ALIAS=','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','cancelled','messages','alias','low','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','params','commhub-channel','application/json,\x20text/event-stream','idle','starting\x20SSE\x20listener...','exit','stdin','Authorization','tools/call','application/json','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','content','.anet','initialize','8MowhWp','high','randomUUID','registered\x20as\x20\x22','184tuyrTC','CommHub\x20init\x20failed:\x20','779605xJKgUD','pop','ack_inbox','send_reply','result','send_task','split','completed','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','notifications/claude/channel','254667sKHsxX','...\x20TMUX=','commhub_send_message','commhub_report_status','/events/','task','slice','broadcast','status','message','type','unknown\x20tool','.env','set','data:\x20','commhub','2.0','read','tmux\x20display-message\x20-p\x20\x27#S\x27','get_inbox','blocked','Priority\x20(default:\x20normal)','http://127.0.0.1:9200','object','length','delete','working','MCP\x20stdio\x20connected','text','POST','986598qqLdyS','commhub_get_all_status','trim','replied','claude-code','message_id','←\x20message\x20from\x20','end','init\x20failed:\x20','send_message','session\x20disconnected','SIGTERM','Current\x20task\x20description','Task\x20content','connecting\x20to\x20','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','new_message','shutting\x20down,\x20reporting\x20offline...','35473560NrDfch','53637WSWXMM','then','find','config.json','report_status','from_session','notification','no\x20response',':\x20inbox_count=','statusText','2025-03-26','38eJOous','commhub_send_task','catch','get','ready\x20—\x20waiting\x20for\x20events','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','indexOf','replace','get_all_status','normal','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','2704725sisXVE'];a0_0x271b=function(){return _0x625567;};return a0_0x271b();}import{readFileSync as a0_0xe313af,existsSync as a0_0x25cc30}from'fs';import{join as a0_0x367a9a}from'path';import{hostname as a0_0x5709eb}from'os';import{execSync as a0_0x192a50}from'child_process';import{Server as a0_0x4669a4}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x2beaa6}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x399dbc,CallToolRequestSchema as a0_0x48b151}from'@modelcontextprotocol/sdk/types.js';function p(_0x1f5c31){const _0x1dcd1f=a0_0x5af3;if(!a0_0x25cc30(_0x1f5c31))return;for(let _0x56beaa of a0_0xe313af(_0x1f5c31,_0x1dcd1f(0x125))[_0x1dcd1f(0x157)]('\x0a')){let _0x15b0bf=_0x56beaa['trim']();if(!_0x15b0bf||_0x15b0bf['startsWith']('#'))continue;let _0x340e83=_0x15b0bf[_0x1dcd1f(0x19d)]('=');if(_0x340e83<0x0)continue;let _0x489fd8=_0x15b0bf['slice'](0x0,_0x340e83)[_0x1dcd1f(0x17b)](),_0x35e71e=_0x15b0bf[_0x1dcd1f(0x161)](_0x340e83+0x1)[_0x1dcd1f(0x17b)]()[_0x1dcd1f(0x19e)](/^["']|["']$/g,'');if(!process.env[_0x489fd8])process.env[_0x489fd8]=_0x35e71e;}}var C=process.env.HOME||'~',T=a0_0x367a9a(C,'.claude/channels/commhub');p(a0_0x367a9a(T,a0_0x54f95f(0x167)));var L=process[a0_0x54f95f(0x131)]()['replace'](/\//g,'-');p(a0_0x367a9a(T,L,a0_0x54f95f(0x167)));function U(){const _0x236a55=a0_0x54f95f;try{return a0_0x192a50(_0x236a55(0x16d),{'encoding':'utf-8','timeout':0x7d0})[_0x236a55(0x17b)]();}catch{return'';}}function c(){const _0x4ff9ee=a0_0x54f95f;try{let _0x4bd9b3=a0_0x367a9a(C,_0x4ff9ee(0x149),_0x4ff9ee(0x18f));if(a0_0x25cc30(_0x4bd9b3))return JSON[_0x4ff9ee(0x128)](a0_0xe313af(_0x4bd9b3,'utf-8'));}catch{}return{};}var H=c(),D=process.env.COMMHUB_URL||H[a0_0x54f95f(0x12a)]||a0_0x54f95f(0x171),f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0x5709eb(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto[a0_0x54f95f(0x14d)](),X=process.env.COMMHUB_TOKEN||H['token']||'';function Y(_0x2b4e3f){const _0x220ca7=a0_0x54f95f;let _0x1aa7d8=new Date()['toTimeString']()['slice'](0x0,0x8);process[_0x220ca7(0x11e)]['write']('['+_0x1aa7d8+_0x220ca7(0x129)+_0x2b4e3f+'\x0a');}function h(_0x29a988){return new Promise(_0x32952f=>setTimeout(_0x32952f,_0x29a988));}Y('ENV:\x20URL='+D+a0_0x54f95f(0x136)+Z+a0_0x54f95f(0x132)+w[a0_0x54f95f(0x161)](0x0,0x8)+a0_0x54f95f(0x15c)+(f||a0_0x54f95f(0x123))+a0_0x54f95f(0x116)+process[a0_0x54f95f(0x131)]()+a0_0x54f95f(0x12c)+L);var k=new Map(),K=new a0_0x4669a4({'name':a0_0x54f95f(0x13e),'version':a0_0x54f95f(0x11b)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x54f95f(0x11a),'These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.',a0_0x54f95f(0x159),a0_0x54f95f(0x19c),a0_0x54f95f(0x122)+Z][a0_0x54f95f(0x12f)]('\x0a')});K['setRequestHandler'](a0_0x399dbc,async()=>({'tools':[{'name':'commhub_reply','description':'Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','inputSchema':{'type':a0_0x54f95f(0x172),'properties':{'task_id':{'type':'string','description':a0_0x54f95f(0x127)},'text':{'type':a0_0x54f95f(0x121),'description':a0_0x54f95f(0x133)},'status':{'type':a0_0x54f95f(0x121),'enum':[a0_0x54f95f(0x158),'failed',a0_0x54f95f(0x138),'blocked','error','in_progress'],'description':a0_0x54f95f(0x188)}},'required':[a0_0x54f95f(0x177)]}},{'name':'commhub_report_status','description':a0_0x54f95f(0x13c),'inputSchema':{'type':a0_0x54f95f(0x172),'properties':{'status':{'type':a0_0x54f95f(0x121),'enum':['working','idle',a0_0x54f95f(0x16f),'error']},'task':{'type':'string','description':a0_0x54f95f(0x185)},'progress':{'type':'number','description':'Progress\x200-100'}},'required':['status']}},{'name':'commhub_send_task','description':a0_0x54f95f(0x137),'inputSchema':{'type':a0_0x54f95f(0x172),'properties':{'alias':{'type':'string','description':a0_0x54f95f(0x11c)},'task':{'type':a0_0x54f95f(0x121),'description':a0_0x54f95f(0x186)},'priority':{'type':a0_0x54f95f(0x121),'enum':[a0_0x54f95f(0x14c),'normal',a0_0x54f95f(0x13b)],'description':a0_0x54f95f(0x170)}},'required':[a0_0x54f95f(0x13a),a0_0x54f95f(0x160)]}},{'name':'commhub_send_message','description':a0_0x54f95f(0x1a1),'inputSchema':{'type':'object','properties':{'alias':{'type':'string','description':a0_0x54f95f(0x11c)},'message':{'type':'string','description':a0_0x54f95f(0x118)}},'required':[a0_0x54f95f(0x13a),'message']}},{'name':a0_0x54f95f(0x17a),'description':a0_0x54f95f(0x147),'inputSchema':{'type':a0_0x54f95f(0x172),'properties':{}}}]}));async function P(_0x47753d,_0x4e6d2d){const _0x33dabe=a0_0x54f95f;let _0x20a4d6=await fetch(D+_0x33dabe(0x126),{'method':_0x33dabe(0x178),'headers':{'Content-Type':_0x33dabe(0x146),'Accept':_0x33dabe(0x13f),...X?{'Authorization':_0x33dabe(0x119)+X}:{}},'body':JSON[_0x33dabe(0x135)]({'jsonrpc':_0x33dabe(0x16b),'id':0x1,'method':_0x33dabe(0x14a),'params':{'protocolVersion':_0x33dabe(0x196),'capabilities':{},'clientInfo':{'name':_0x33dabe(0x13e),'version':_0x33dabe(0x11b)}}})});if(!_0x20a4d6['ok']){let _0x176c96=await _0x20a4d6[_0x33dabe(0x177)]();return Y(_0x33dabe(0x150)+_0x20a4d6[_0x33dabe(0x163)]+'\x20'+_0x176c96[_0x33dabe(0x161)](0x0,0x64)),{'ok':!0x1,'error':_0x33dabe(0x181)+_0x20a4d6['status']};}await _0x20a4d6['text']();let _0x40c4d3=(await(await fetch(D+_0x33dabe(0x126),{'method':_0x33dabe(0x178),'headers':{'Content-Type':'application/json','Accept':_0x33dabe(0x13f),...X?{'Authorization':_0x33dabe(0x119)+X}:{}},'body':JSON[_0x33dabe(0x135)]({'jsonrpc':_0x33dabe(0x16b),'id':0x2,'method':_0x33dabe(0x145),'params':{'name':_0x47753d,'arguments':_0x4e6d2d}})}))[_0x33dabe(0x177)]())[_0x33dabe(0x157)]('\x0a')['find'](_0x20145a=>_0x20145a[_0x33dabe(0x124)](_0x33dabe(0x169)));if(_0x40c4d3){let _0x1dbbe1=JSON[_0x33dabe(0x128)](_0x40c4d3['slice'](0x6));return _0x1dbbe1?.[_0x33dabe(0x155)]?.[_0x33dabe(0x148)]?.[0x0]?.[_0x33dabe(0x177)]?JSON[_0x33dabe(0x128)](_0x1dbbe1['result'][_0x33dabe(0x148)][0x0][_0x33dabe(0x177)]):_0x1dbbe1;}return{'ok':!0x1,'error':_0x33dabe(0x193)};}K['setRequestHandler'](a0_0x48b151,async _0x58eb4c=>{const _0x568439=a0_0x54f95f;let {name:_0x28fb7d,arguments:_0x40f39b}=_0x58eb4c[_0x568439(0x13d)];if(_0x28fb7d==='commhub_reply'){let {task_id:_0x2d0664,text:_0x2b3eb3,status:_0xbce3a2}=_0x40f39b;if(_0xbce3a2===_0x568439(0x158)||_0xbce3a2===_0x568439(0x12d)||_0xbce3a2==='cancelled'){let _0x3d97a9=_0xbce3a2==='completed'?_0x568439(0x17c):_0xbce3a2,_0x3116f0=_0x2d0664?k[_0x568439(0x19a)](_0x2d0664)||_0x568439(0x12a):_0x568439(0x12a),_0x2ab890=await P(_0x568439(0x154),{'alias':_0x3116f0,'text':_0x2b3eb3,'in_reply_to':_0x2d0664||void 0x0,'status':_0x3d97a9,'from_session':Z});if(_0x2d0664)k[_0x568439(0x174)](_0x2d0664);return{'content':[{'type':_0x568439(0x177),'text':JSON['stringify'](_0x2ab890)}]};}let _0x26961c=await P(_0x568439(0x190),{'resume_id':w,'alias':Z,'status':_0xbce3a2===_0x568439(0x16f)?_0x568439(0x16f):_0xbce3a2===_0x568439(0x130)?_0x568439(0x130):_0x568439(0x175),'task':_0x2b3eb3[_0x568439(0x161)](0x0,0xc8),'output':_0x2b3eb3});return{'content':[{'type':_0x568439(0x177),'text':JSON[_0x568439(0x135)](_0x26961c)}]};}if(_0x28fb7d===_0x568439(0x15e)){let {status:_0x277eae,task:_0x267834,progress:_0x4db7e2}=_0x40f39b,_0x26d756=await P(_0x568439(0x190),{'resume_id':w,'alias':Z,'status':_0x277eae,'task':_0x267834,'progress':_0x4db7e2});return{'content':[{'type':_0x568439(0x177),'text':JSON[_0x568439(0x135)](_0x26d756)}]};}if(_0x28fb7d===_0x568439(0x198)){let {alias:_0x4f4c26,task:_0x1a6fa9,priority:_0x267121}=_0x40f39b,_0x202249=await P(_0x568439(0x156),{'alias':_0x4f4c26,'task':_0x1a6fa9,'priority':_0x267121||'normal','from_session':Z});return{'content':[{'type':_0x568439(0x177),'text':JSON[_0x568439(0x135)](_0x202249)}]};}if(_0x28fb7d===_0x568439(0x15d)){let {alias:_0x397ea8,message:_0x56b5b1}=_0x40f39b,_0x253a3f=await P(_0x568439(0x182),{'alias':_0x397ea8,'message':_0x56b5b1,'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x568439(0x135)](_0x253a3f)}]};}if(_0x28fb7d===_0x568439(0x17a)){let _0x2bf94d=await P(_0x568439(0x19f),{});return{'content':[{'type':'text','text':JSON['stringify'](_0x2bf94d)}]};}return{'content':[{'type':_0x568439(0x177),'text':JSON['stringify']({'error':_0x568439(0x166)})}]};});function a0_0x5af3(_0x200c5f,_0x11040c){_0x200c5f=_0x200c5f-0x115;const _0x271b34=a0_0x271b();let _0x5af3a1=_0x271b34[_0x200c5f];return _0x5af3a1;}async function v(){const _0x1f3f6e=a0_0x54f95f;let _0xd0b38d=D+_0x1f3f6e(0x15f)+encodeURIComponent(Z),_0x3d2a8f={};if(X)_0x3d2a8f[_0x1f3f6e(0x144)]=_0x1f3f6e(0x119)+X;Y(_0x1f3f6e(0x187)+_0xd0b38d);while(!0x0){try{let _0x333af8=await fetch(_0xd0b38d,{'headers':_0x3d2a8f});if(!_0x333af8['ok']){Y('SSE\x20error:\x20'+_0x333af8[_0x1f3f6e(0x163)]+'\x20'+_0x333af8[_0x1f3f6e(0x195)]),await h(0x1388);continue;}let _0x4347a2=_0x333af8['body'][_0x1f3f6e(0x12e)](),_0x5d0da7=new TextDecoder(),_0x10cee2='';while(!0x0){let {done:_0x392c5d,value:_0x26845f}=await _0x4347a2[_0x1f3f6e(0x16c)]();if(_0x392c5d)break;_0x10cee2+=_0x5d0da7['decode'](_0x26845f,{'stream':!0x0});let _0x4badc5=_0x10cee2[_0x1f3f6e(0x157)]('\x0a\x0a');_0x10cee2=_0x4badc5[_0x1f3f6e(0x152)]()||'';for(let _0x149d31 of _0x4badc5){let _0x3b21e4=_0x149d31['split']('\x0a')[_0x1f3f6e(0x18e)](_0x2878d5=>_0x2878d5[_0x1f3f6e(0x124)](_0x1f3f6e(0x169)));if(!_0x3b21e4)continue;try{let _0x5c2dae=JSON['parse'](_0x3b21e4[_0x1f3f6e(0x161)](0x6));await u(_0x5c2dae);}catch(_0x533e0f){Y(_0x1f3f6e(0x11d)+_0x533e0f);}}}Y('SSE\x20stream\x20ended,\x20reconnecting...');}catch(_0x2bc6a6){Y('SSE\x20connection\x20error:\x20'+_0x2bc6a6);}await h(0xbb8);}}async function u(_0x393fbf){const _0xc2091f=a0_0x54f95f;if(_0x393fbf[_0xc2091f(0x165)]==='connected'){Y('SSE\x20connected\x20as\x20\x22'+Z+'\x22');return;}if(_0x393fbf[_0xc2091f(0x165)]===_0xc2091f(0x189)){if(Y(_0xc2091f(0x17f)+_0x393fbf['from']+':\x20'+_0x393fbf[_0xc2091f(0x164)][_0xc2091f(0x161)](0x0,0x3c)),await K[_0xc2091f(0x192)]({'method':_0xc2091f(0x15a),'params':{'content':_0x393fbf[_0xc2091f(0x164)],'meta':{'sender':_0x393fbf[_0xc2091f(0x117)]||_0xc2091f(0x12a),'sender_id':'commhub','user':_0x393fbf[_0xc2091f(0x117)]||_0xc2091f(0x12a),'priority':_0xc2091f(0x1a0)}}}),_0x393fbf[_0xc2091f(0x17e)])await P(_0xc2091f(0x153),{'alias':Z,'message_id':_0x393fbf[_0xc2091f(0x17e)]});return;}if(_0x393fbf[_0xc2091f(0x165)]==='new_task'||_0x393fbf[_0xc2091f(0x165)]===_0xc2091f(0x162)){Y('←\x20'+_0x393fbf['type']+_0xc2091f(0x194)+_0x393fbf['inbox_count']+_0xc2091f(0x120)+(_0x393fbf['priority']||'normal'));let _0x2d3cb1=await P(_0xc2091f(0x16e),{'alias':Z,'limit':0x5});if(_0x2d3cb1?.['ok']&&_0x2d3cb1[_0xc2091f(0x139)]?.[_0xc2091f(0x173)]>0x0)for(let _0x2308f2 of _0x2d3cb1[_0xc2091f(0x139)]){let _0x387626={'sender':_0x2308f2[_0xc2091f(0x191)]||_0xc2091f(0x12a),'sender_id':_0xc2091f(0x16a),'user':_0x2308f2[_0xc2091f(0x191)]||_0xc2091f(0x12a),'task_id':_0x2308f2['id'],'priority':_0x2308f2[_0xc2091f(0x1a3)]||_0xc2091f(0x1a0)};k[_0xc2091f(0x168)](_0x2308f2['id'],_0x2308f2[_0xc2091f(0x191)]||_0xc2091f(0x12a)),await K[_0xc2091f(0x192)]({'method':_0xc2091f(0x15a),'params':{'content':_0x2308f2[_0xc2091f(0x148)],'meta':_0x387626}}),Y('→\x20injected\x20task\x20'+_0x2308f2['id']['slice'](0x0,0x8)+'\x20from\x20'+_0x2308f2[_0xc2091f(0x191)]+':\x20'+_0x2308f2['content'][_0xc2091f(0x161)](0x0,0x3c)),await P(_0xc2091f(0x153),{'alias':Z,'message_id':_0x2308f2['id']});}}}async function S(){const _0x550231=a0_0x54f95f;let _0x58c6bb=new a0_0x2beaa6();await K[_0x550231(0x11f)](_0x58c6bb),Y(_0x550231(0x176)),Y(_0x550231(0x141)),v()[_0x550231(0x199)](_0x34c594=>Y(_0x550231(0x134)+_0x34c594)),P('report_status',{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x5709eb(),'hostname':a0_0x5709eb(),'agent':_0x550231(0x17d),'project_dir':process['cwd'](),'tmux_name':f||void 0x0})[_0x550231(0x18d)](()=>Y(_0x550231(0x14e)+Z+_0x550231(0x12b)+w[_0x550231(0x161)](0x0,0x8)+')'))[_0x550231(0x199)](_0x2eca98=>Y('warning:\x20could\x20not\x20register:\x20'+_0x2eca98)),setInterval(()=>{const _0x1366ca=_0x550231;P('report_status',{'resume_id':w,'alias':Z,'status':_0x1366ca(0x140),'server':a0_0x5709eb(),'hostname':a0_0x5709eb(),'agent':'claude-code','project_dir':process['cwd'](),'tmux_name':f||void 0x0})['catch'](_0x14c5a3=>Y('heartbeat\x20failed:\x20'+_0x14c5a3));},0x2bf20),Y(_0x550231(0x19b));}S()[a0_0x54f95f(0x199)](_0x450ea0=>{const _0x1e74f1=a0_0x54f95f;Y('fatal:\x20'+_0x450ea0),process[_0x1e74f1(0x142)](0x1);});async function N(){const _0x307e52=a0_0x54f95f;Y(_0x307e52(0x18a)),await P(_0x307e52(0x190),{'resume_id':w,'alias':Z,'status':_0x307e52(0x130),'task':_0x307e52(0x183)})[_0x307e52(0x199)](()=>{}),process[_0x307e52(0x142)](0x0);}process[a0_0x54f95f(0x143)]['on'](a0_0x54f95f(0x180),()=>N()),process['on'](a0_0x54f95f(0x184),()=>N()),process['on']('SIGINT',()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.0.0-preview.61",
3
+ "version": "2.0.0-preview.63",
4
4
  "description": "AI Agent Network CLI \u2014 Create multi-agent networks with user management, network isolation, and 3 AI runtimes (Claude/Codex/MiniMax). 39 commands.",
5
5
  "type": "module",
6
6
  "main": "dist/src/client.js",