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

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_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
+ function a0_0x4679(_0x83ce98,_0x3210af){_0x83ce98=_0x83ce98-0x145;const _0x71a67f=a0_0x71a6();let _0x467904=_0x71a67f[_0x83ce98];return _0x467904;}const a0_0x150c53=a0_0x4679;(function(_0x262c61,_0x427bd2){const _0x188dd1=a0_0x4679,_0x4314a8=_0x262c61();while(!![]){try{const _0x39ed72=parseInt(_0x188dd1(0x194))/0x1*(-parseInt(_0x188dd1(0x16c))/0x2)+-parseInt(_0x188dd1(0x18d))/0x3*(-parseInt(_0x188dd1(0x170))/0x4)+-parseInt(_0x188dd1(0x149))/0x5*(parseInt(_0x188dd1(0x16f))/0x6)+-parseInt(_0x188dd1(0x168))/0x7*(-parseInt(_0x188dd1(0x15c))/0x8)+parseInt(_0x188dd1(0x16a))/0x9*(parseInt(_0x188dd1(0x18c))/0xa)+-parseInt(_0x188dd1(0x165))/0xb+parseInt(_0x188dd1(0x195))/0xc;if(_0x39ed72===_0x427bd2)break;else _0x4314a8['push'](_0x4314a8['shift']());}catch(_0x236474){_0x4314a8['push'](_0x4314a8['shift']());}}}(a0_0x71a6,0x62d9c));import{EventEmitter as a0_0x46ae47}from'events';import{hostname as a0_0x344c57}from'os';class T extends a0_0x46ae47{[a0_0x150c53(0x148)];[a0_0x150c53(0x162)];[a0_0x150c53(0x172)];[a0_0x150c53(0x14d)];[a0_0x150c53(0x174)];['heartbeatInterval'];[a0_0x150c53(0x184)];[a0_0x150c53(0x198)];[a0_0x150c53(0x181)];[a0_0x150c53(0x167)]=!0x1;constructor(_0x29b13e){const _0x3574f8=a0_0x150c53;super();if(this[_0x3574f8(0x148)]=_0x29b13e[_0x3574f8(0x148)]['replace'](/\/$/,''),this[_0x3574f8(0x162)]=_0x29b13e['alias'],this[_0x3574f8(0x172)]=_0x29b13e[_0x3574f8(0x172)],this[_0x3574f8(0x14d)]=_0x29b13e[_0x3574f8(0x14d)]||'sdk',this[_0x3574f8(0x174)]=_0x3574f8(0x188)+_0x29b13e[_0x3574f8(0x162)]+'-'+Date[_0x3574f8(0x14c)]()['toString'](0x24),this[_0x3574f8(0x176)]=_0x29b13e[_0x3574f8(0x176)]??0x2bf20,this[_0x3574f8(0x184)]=_0x29b13e[_0x3574f8(0x184)]??0xbb8,_0x29b13e['autoConnect']!==!0x1)this['connect']();}[a0_0x150c53(0x160)](_0x515aee){const _0x540d9a=a0_0x150c53;console[_0x540d9a(0x160)]('['+new Date()[_0x540d9a(0x155)]()[_0x540d9a(0x15a)](0x0,0x8)+_0x540d9a(0x185)+this[_0x540d9a(0x162)]+']\x20'+_0x515aee);}async['call'](_0x5b19f5,_0x2a97ad){const _0x24090d=a0_0x150c53;let _0x4c53d0={'Content-Type':_0x24090d(0x197),'Accept':_0x24090d(0x14a)};if(this[_0x24090d(0x172)])_0x4c53d0['Authorization']=_0x24090d(0x191)+this[_0x24090d(0x172)];let _0x42596f=await(await fetch(this['url']+'/mcp',{'method':_0x24090d(0x175),'headers':_0x4c53d0,'body':JSON[_0x24090d(0x164)]({'jsonrpc':_0x24090d(0x193),'id':Date['now'](),'method':_0x24090d(0x177),'params':{'name':_0x5b19f5,'arguments':_0x2a97ad}})}))['text'](),_0x2d7df4=_0x42596f[_0x24090d(0x189)](/data: (.+)/),_0x4671f8=_0x2d7df4?JSON[_0x24090d(0x161)](_0x2d7df4[0x1]):JSON[_0x24090d(0x161)](_0x42596f),_0x3cdba7=_0x4671f8?.['result']?.[_0x24090d(0x145)]?.[0x0]?.['text'];return _0x3cdba7?JSON[_0x24090d(0x161)](_0x3cdba7):_0x4671f8;}async[a0_0x150c53(0x19b)](){const _0x1c1a6a=a0_0x150c53;if(this[_0x1c1a6a(0x167)])return;this[_0x1c1a6a(0x167)]=!0x0,await this[_0x1c1a6a(0x180)]('idle'),this['log'](_0x1c1a6a(0x178)),this[_0x1c1a6a(0x198)]=setInterval(()=>{const _0x3903de=_0x1c1a6a;this[_0x3903de(0x180)](_0x3903de(0x17f))[_0x3903de(0x190)](_0x5a0d5b=>this['log']('heartbeat\x20failed:\x20'+_0x5a0d5b['message']));},this[_0x1c1a6a(0x176)]),this['connectSSE']();}async[a0_0x150c53(0x159)](){const _0x21f02f=a0_0x150c53;if(this[_0x21f02f(0x167)]=!0x1,this[_0x21f02f(0x181)]?.['abort'](),this['heartbeatTimer'])clearInterval(this['heartbeatTimer']);await this[_0x21f02f(0x180)](_0x21f02f(0x151))[_0x21f02f(0x190)](()=>{}),this[_0x21f02f(0x160)](_0x21f02f(0x15f));}async[a0_0x150c53(0x18f)](_0x5eef67,_0x566948,_0x1a25e5=a0_0x150c53(0x169)){const _0x2fbf52=a0_0x150c53;return this[_0x2fbf52(0x17b)](_0x2fbf52(0x199),{'alias':_0x5eef67,'task':_0x566948,'priority':_0x1a25e5,'from_session':this[_0x2fbf52(0x162)]});}async['message'](_0x6e3a7a,_0x84a4bb){const _0x3b738c=a0_0x150c53;return this['call'](_0x3b738c(0x18e),{'alias':_0x6e3a7a,'message':_0x84a4bb,'from_session':this[_0x3b738c(0x162)]});}async[a0_0x150c53(0x158)](_0x152483,_0x59740b,_0x2f6b34=a0_0x150c53(0x15e)){const _0x41832b=a0_0x150c53;return this['call'](_0x41832b(0x158),{'task_id':_0x152483,'text':_0x59740b,'status':_0x2f6b34});}async['status'](_0x563ade,_0x3a653b){const _0x2488f2=a0_0x150c53;return this[_0x2488f2(0x17b)](_0x2488f2(0x150),{'resume_id':this['resumeId'],'alias':this[_0x2488f2(0x162)],'status':_0x563ade,'server':a0_0x344c57(),'hostname':a0_0x344c57(),'agent':this[_0x2488f2(0x14d)],'project_dir':process['cwd'](),..._0x3a653b});}async[a0_0x150c53(0x15b)](){const _0x402281=a0_0x150c53;return this[_0x402281(0x17b)](_0x402281(0x146),{});}async[a0_0x150c53(0x147)](_0x2249cd,_0x897106){const _0x282539=a0_0x150c53;return this[_0x282539(0x17b)](_0x282539(0x147),{'message':_0x2249cd,'filter_server':_0x897106?.[_0x282539(0x16e)],'filter_status':_0x897106?.[_0x282539(0x180)]});}async[a0_0x150c53(0x19a)](){const _0x8bd868=a0_0x150c53;let _0x19d8a6=encodeURIComponent(this[_0x8bd868(0x162)]),_0x4cd47a=this['url']+'/events/'+_0x19d8a6,_0x148093=this['reconnectDelay'];while(this['running']){try{this['sseAbort']=new AbortController();let _0x4c327f={'Accept':'text/event-stream'};if(this[_0x8bd868(0x172)])_0x4c327f[_0x8bd868(0x153)]=_0x8bd868(0x191)+this['token'];let _0x8dbcae=await fetch(_0x4cd47a,{'headers':_0x4c327f,'signal':this[_0x8bd868(0x181)][_0x8bd868(0x14e)]});if(!_0x8dbcae['ok']||!_0x8dbcae['body']){this['log'](_0x8bd868(0x18b)+_0x8dbcae[_0x8bd868(0x180)]),await this[_0x8bd868(0x196)](_0x148093),_0x148093=Math['min'](_0x148093*1.5,0xea60);continue;}_0x148093=this[_0x8bd868(0x184)];let _0x410788=_0x8dbcae[_0x8bd868(0x17c)][_0x8bd868(0x186)](),_0x1ff591=new TextDecoder(),_0x527fb8='';while(this[_0x8bd868(0x167)]){let {done:_0x56eff6,value:_0x15acf3}=await _0x410788[_0x8bd868(0x16d)]();if(_0x56eff6)break;_0x527fb8+=_0x1ff591[_0x8bd868(0x17d)](_0x15acf3,{'stream':!0x0});let _0x1cb3d7=_0x527fb8[_0x8bd868(0x154)]('\x0a');_0x527fb8=_0x1cb3d7[_0x8bd868(0x17a)]()||'';for(let _0x5b3879 of _0x1cb3d7){if(!_0x5b3879[_0x8bd868(0x173)]('data:\x20'))continue;try{let _0x3b2450=JSON[_0x8bd868(0x161)](_0x5b3879[_0x8bd868(0x15a)](0x6));if(_0x3b2450[_0x8bd868(0x183)]===_0x8bd868(0x182)){this['log'](_0x8bd868(0x187)),this[_0x8bd868(0x192)](_0x8bd868(0x182));continue;}if(_0x3b2450[_0x8bd868(0x183)]===_0x8bd868(0x18a)||_0x3b2450[_0x8bd868(0x183)]==='new_message'||_0x3b2450[_0x8bd868(0x183)]===_0x8bd868(0x147))await this[_0x8bd868(0x163)]();}catch{}}}}catch(_0x37473c){if(_0x37473c[_0x8bd868(0x14f)]==='AbortError')break;this[_0x8bd868(0x192)](_0x8bd868(0x166),_0x37473c),this[_0x8bd868(0x160)](_0x8bd868(0x156)+_0x37473c['message']);}if(this[_0x8bd868(0x167)])this[_0x8bd868(0x192)](_0x8bd868(0x15f)),this[_0x8bd868(0x160)](_0x8bd868(0x16b)+_0x148093/0x3e8+_0x8bd868(0x171)),await this[_0x8bd868(0x196)](_0x148093),_0x148093=Math[_0x8bd868(0x152)](_0x148093*1.5,0xea60);}}async[a0_0x150c53(0x163)](){const _0x1a5688=a0_0x150c53;try{let _0x54a80d=(await this['call'](_0x1a5688(0x14b),{'alias':this[_0x1a5688(0x162)],'limit':0xa}))?.['messages']||[];for(let _0x167dbf of _0x54a80d)await this['call'](_0x1a5688(0x179),{'alias':this['alias'],'message_id':_0x167dbf['id']}),this[_0x1a5688(0x160)]('←\x20'+_0x167dbf['from_session']+':\x20'+_0x167dbf[_0x1a5688(0x145)][_0x1a5688(0x15a)](0x0,0x3c)),this[_0x1a5688(0x192)](_0x1a5688(0x15d),_0x167dbf),this[_0x1a5688(0x192)](_0x1a5688(0x17e),_0x167dbf);}catch(_0x15d666){this['log'](_0x1a5688(0x157)+_0x15d666[_0x1a5688(0x17e)]);}}['sleep'](_0x2169e3){return new Promise(_0x3cc1fa=>setTimeout(_0x3cc1fa,_0x2169e3));}}var $=T;function a0_0x71a6(){const _0x39b89b=['catch','Bearer\x20','emit','2.0','185vaOdeL','7132584kKJnDj','sleep','application/json','heartbeatTimer','send_task','connectSSE','connect','content','get_all_status','broadcast','url','2214835RnNXyk','application/json,\x20text/event-stream','get_inbox','now','agent','signal','name','report_status','offline','min','Authorization','split','toTimeString','SSE\x20error:\x20','inbox\x20error:\x20','reply','disconnect','slice','getAllStatus','180568ptHgRR','task','completed','disconnected','log','parse','alias','processInbox','stringify','4098479PsORSp','error','running','154YrwTzM','normal','2116728UNzzgT','SSE\x20reconnecting\x20in\x20','6100EJRlsk','read','server','6LYLSrt','1834248xQARsI','s...','token','startsWith','resumeId','POST','heartbeatInterval','tools/call','registered','ack_inbox','pop','call','body','decode','message','idle','status','sseAbort','connected','type','reconnectDelay',']\x20[commhub:','getReader','SSE\x20connected','sdk-','match','new_task','SSE\x20failed:\x20','10FjdMYU','3YWgCLB','send_message','send'];a0_0x71a6=function(){return _0x39b89b;};return a0_0x71a6();}export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
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());
2
+ const a0_0x1e2e5f=a0_0xd333;(function(_0x3b0f3b,_0x50bdca){const _0x3caef2=a0_0xd333,_0x459700=_0x3b0f3b();while(!![]){try{const _0x40be20=-parseInt(_0x3caef2(0x1d8))/0x1+-parseInt(_0x3caef2(0x1a2))/0x2*(parseInt(_0x3caef2(0x1d4))/0x3)+parseInt(_0x3caef2(0x1d2))/0x4+parseInt(_0x3caef2(0x1cf))/0x5*(parseInt(_0x3caef2(0x18d))/0x6)+parseInt(_0x3caef2(0x1b5))/0x7*(-parseInt(_0x3caef2(0x1a6))/0x8)+-parseInt(_0x3caef2(0x1a4))/0x9*(parseInt(_0x3caef2(0x1e2))/0xa)+parseInt(_0x3caef2(0x16e))/0xb;if(_0x40be20===_0x50bdca)break;else _0x459700['push'](_0x459700['shift']());}catch(_0x111a38){_0x459700['push'](_0x459700['shift']());}}}(a0_0x212e,0x6c384));import{readFileSync as a0_0x3206a9,existsSync as a0_0x387e71}from'fs';import{join as a0_0x4badf2}from'path';import{hostname as a0_0x7e3c23}from'os';function a0_0xd333(_0x1b9965,_0x299623){_0x1b9965=_0x1b9965-0x159;const _0x212e96=a0_0x212e();let _0xd333e3=_0x212e96[_0x1b9965];return _0xd333e3;}import{execSync as a0_0x1cc2d9}from'child_process';import{Server as a0_0x5cf3c9}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x426f4f}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x1d5a09,CallToolRequestSchema as a0_0x1452b1}from'@modelcontextprotocol/sdk/types.js';function p(_0x4ccbda){const _0x159a09=a0_0xd333;if(!a0_0x387e71(_0x4ccbda))return;for(let _0x29b933 of a0_0x3206a9(_0x4ccbda,_0x159a09(0x15e))[_0x159a09(0x171)]('\x0a')){let _0x3de21d=_0x29b933[_0x159a09(0x184)]();if(!_0x3de21d||_0x3de21d[_0x159a09(0x162)]('#'))continue;let _0x4b3ee3=_0x3de21d[_0x159a09(0x19c)]('=');if(_0x4b3ee3<0x0)continue;let _0x35b5c8=_0x3de21d[_0x159a09(0x199)](0x0,_0x4b3ee3)[_0x159a09(0x184)](),_0x45dd0b=_0x3de21d[_0x159a09(0x199)](_0x4b3ee3+0x1)[_0x159a09(0x184)]()[_0x159a09(0x17e)](/^["']|["']$/g,'');if(!process.env[_0x35b5c8])process.env[_0x35b5c8]=_0x45dd0b;}}var C=process.env.HOME||'~',T=a0_0x4badf2(C,'.claude/channels/commhub');p(a0_0x4badf2(T,a0_0x1e2e5f(0x1bb)));var L=process[a0_0x1e2e5f(0x1cb)]()[a0_0x1e2e5f(0x17e)](/\//g,'-');p(a0_0x4badf2(T,L,a0_0x1e2e5f(0x1bb)));function U(){const _0x4142c9=a0_0x1e2e5f;try{return a0_0x1cc2d9(_0x4142c9(0x18e),{'encoding':_0x4142c9(0x15e),'timeout':0x7d0})['trim']();}catch{return'';}}function c(){const _0x5376f4=a0_0x1e2e5f;try{let _0x724154=a0_0x4badf2(C,_0x5376f4(0x1bf),_0x5376f4(0x197));if(a0_0x387e71(_0x724154))return JSON[_0x5376f4(0x16b)](a0_0x3206a9(_0x724154,'utf-8'));}catch{}return{};}var H=c(),D=process.env.COMMHUB_URL||H['hub']||a0_0x1e2e5f(0x15c),f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0x7e3c23(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto[a0_0x1e2e5f(0x17a)](),X=process.env.COMMHUB_TOKEN||H['token']||'';function Y(_0xc923aa){const _0xcab0f7=a0_0x1e2e5f;let _0x39db87=new Date()['toTimeString']()[_0xcab0f7(0x199)](0x0,0x8);process[_0xcab0f7(0x177)][_0xcab0f7(0x15d)]('['+_0x39db87+_0xcab0f7(0x16d)+_0xc923aa+'\x0a');}function h(_0x333812){return new Promise(_0x2eb7da=>setTimeout(_0x2eb7da,_0x333812));}Y('ENV:\x20URL='+D+'\x20ALIAS='+Z+'\x20RESUME_ID='+w[a0_0x1e2e5f(0x199)](0x0,0x8)+a0_0x1e2e5f(0x1e6)+(f||a0_0x1e2e5f(0x1be))+a0_0x1e2e5f(0x1d6)+process[a0_0x1e2e5f(0x1cb)]()+'\x20PROJECT_ENV='+L);var k=new Map(),K=new a0_0x5cf3c9({'name':a0_0x1e2e5f(0x1b0),'version':a0_0x1e2e5f(0x187)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x1e2e5f(0x172),a0_0x1e2e5f(0x161),'Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.',a0_0x1e2e5f(0x1c1)+Z][a0_0x1e2e5f(0x18c)]('\x0a')});K[a0_0x1e2e5f(0x1db)](a0_0x1d5a09,async()=>({'tools':[{'name':a0_0x1e2e5f(0x1d7),'description':a0_0x1e2e5f(0x1a1),'inputSchema':{'type':a0_0x1e2e5f(0x1c4),'properties':{'task_id':{'type':a0_0x1e2e5f(0x19f),'description':a0_0x1e2e5f(0x164)},'text':{'type':a0_0x1e2e5f(0x19f),'description':a0_0x1e2e5f(0x1a5)},'status':{'type':'string','enum':[a0_0x1e2e5f(0x1bd),a0_0x1e2e5f(0x190),a0_0x1e2e5f(0x17f),a0_0x1e2e5f(0x1b6),a0_0x1e2e5f(0x1ad),a0_0x1e2e5f(0x1c9)],'description':a0_0x1e2e5f(0x178)}},'required':[a0_0x1e2e5f(0x1d0)]}},{'name':a0_0x1e2e5f(0x173),'description':a0_0x1e2e5f(0x1c8),'inputSchema':{'type':a0_0x1e2e5f(0x1c4),'properties':{'status':{'type':a0_0x1e2e5f(0x19f),'enum':[a0_0x1e2e5f(0x1e1),a0_0x1e2e5f(0x179),a0_0x1e2e5f(0x1b6),a0_0x1e2e5f(0x1ad)]},'task':{'type':a0_0x1e2e5f(0x19f),'description':a0_0x1e2e5f(0x1a9)},'progress':{'type':a0_0x1e2e5f(0x1ac),'description':a0_0x1e2e5f(0x1af)}},'required':[a0_0x1e2e5f(0x1cc)]}},{'name':a0_0x1e2e5f(0x160),'description':'Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x1e2e5f(0x19f),'description':'Target\x20session\x20alias'},'task':{'type':a0_0x1e2e5f(0x19f),'description':a0_0x1e2e5f(0x1e4)},'priority':{'type':a0_0x1e2e5f(0x19f),'enum':[a0_0x1e2e5f(0x1e0),a0_0x1e2e5f(0x1b7),a0_0x1e2e5f(0x182)],'description':'Priority\x20(default:\x20normal)'}},'required':['alias',a0_0x1e2e5f(0x18a)]}},{'name':a0_0x1e2e5f(0x1d3),'description':a0_0x1e2e5f(0x167),'inputSchema':{'type':a0_0x1e2e5f(0x1c4),'properties':{'alias':{'type':'string','description':a0_0x1e2e5f(0x1cd)},'message':{'type':'string','description':a0_0x1e2e5f(0x18f)}},'required':[a0_0x1e2e5f(0x1d9),'message']}},{'name':a0_0x1e2e5f(0x186),'description':a0_0x1e2e5f(0x1b8),'inputSchema':{'type':a0_0x1e2e5f(0x1c4),'properties':{}}}]}));async function P(_0xc87ff6,_0x95e84a){const _0x3ed9b9=a0_0x1e2e5f;let _0x56c484=await fetch(D+_0x3ed9b9(0x1a0),{'method':'POST','headers':{'Content-Type':'application/json','Accept':_0x3ed9b9(0x1c2),...X?{'Authorization':_0x3ed9b9(0x15a)+X}:{}},'body':JSON[_0x3ed9b9(0x193)]({'jsonrpc':'2.0','id':0x1,'method':_0x3ed9b9(0x198),'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x3ed9b9(0x1b0),'version':_0x3ed9b9(0x187)}}})});if(!_0x56c484['ok']){let _0x285193=await _0x56c484[_0x3ed9b9(0x1d0)]();return Y('CommHub\x20init\x20failed:\x20'+_0x56c484[_0x3ed9b9(0x1cc)]+'\x20'+_0x285193['slice'](0x0,0x64)),{'ok':!0x1,'error':_0x3ed9b9(0x159)+_0x56c484[_0x3ed9b9(0x1cc)]};}await _0x56c484['text']();let _0x53455b=(await(await fetch(D+'/mcp',{'method':_0x3ed9b9(0x1c3),'headers':{'Content-Type':'application/json','Accept':_0x3ed9b9(0x1c2),...X?{'Authorization':_0x3ed9b9(0x15a)+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x3ed9b9(0x15b),'id':0x2,'method':_0x3ed9b9(0x1e3),'params':{'name':_0xc87ff6,'arguments':_0x95e84a}})}))[_0x3ed9b9(0x1d0)]())[_0x3ed9b9(0x171)]('\x0a')['find'](_0x4da582=>_0x4da582[_0x3ed9b9(0x162)](_0x3ed9b9(0x1e7)));if(_0x53455b){let _0x471399=JSON[_0x3ed9b9(0x16b)](_0x53455b['slice'](0x6));return _0x471399?.['result']?.[_0x3ed9b9(0x1a8)]?.[0x0]?.[_0x3ed9b9(0x1d0)]?JSON[_0x3ed9b9(0x16b)](_0x471399[_0x3ed9b9(0x17c)][_0x3ed9b9(0x1a8)][0x0][_0x3ed9b9(0x1d0)]):_0x471399;}return{'ok':!0x1,'error':_0x3ed9b9(0x1de)};}K[a0_0x1e2e5f(0x1db)](a0_0x1452b1,async _0xe73a65=>{const _0x5ef04a=a0_0x1e2e5f;let {name:_0x5ce1be,arguments:_0x975673}=_0xe73a65[_0x5ef04a(0x1c6)];if(_0x5ce1be===_0x5ef04a(0x1d7)){let {task_id:_0x21b4a8,text:_0x580613,status:_0x29521d}=_0x975673;if(_0x29521d===_0x5ef04a(0x1bd)||_0x29521d==='failed'||_0x29521d==='cancelled'){let _0x28136c=_0x29521d===_0x5ef04a(0x1bd)?_0x5ef04a(0x166):_0x29521d,_0x865901=_0x21b4a8?k[_0x5ef04a(0x19a)](_0x21b4a8)||'hub':'hub',_0x291fc3=await P(_0x5ef04a(0x1ab),{'alias':_0x865901,'text':_0x580613,'in_reply_to':_0x21b4a8||void 0x0,'status':_0x28136c,'from_session':Z});if(_0x21b4a8)k[_0x5ef04a(0x1dc)](_0x21b4a8);return{'content':[{'type':_0x5ef04a(0x1d0),'text':JSON[_0x5ef04a(0x193)](_0x291fc3)}]};}let _0x44db2e=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x29521d===_0x5ef04a(0x1b6)?_0x5ef04a(0x1b6):_0x29521d===_0x5ef04a(0x1ad)?_0x5ef04a(0x1ad):'working','task':_0x580613[_0x5ef04a(0x199)](0x0,0xc8),'output':_0x580613});return{'content':[{'type':_0x5ef04a(0x1d0),'text':JSON[_0x5ef04a(0x193)](_0x44db2e)}]};}if(_0x5ce1be===_0x5ef04a(0x173)){let {status:_0x3109b8,task:_0x55c364,progress:_0x244c57}=_0x975673,_0x2b5a9a=await P(_0x5ef04a(0x1c5),{'resume_id':w,'alias':Z,'status':_0x3109b8,'task':_0x55c364,'progress':_0x244c57});return{'content':[{'type':_0x5ef04a(0x1d0),'text':JSON['stringify'](_0x2b5a9a)}]};}if(_0x5ce1be===_0x5ef04a(0x160)){let {alias:_0x35b07a,task:_0x5e2f0f,priority:_0x4ea223}=_0x975673,_0x58d816=await P(_0x5ef04a(0x16c),{'alias':_0x35b07a,'task':_0x5e2f0f,'priority':_0x4ea223||_0x5ef04a(0x1b7),'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x5ef04a(0x193)](_0x58d816)}]};}if(_0x5ce1be===_0x5ef04a(0x1d3)){let {alias:_0x21a652,message:_0x1dbe46}=_0x975673,_0x2bf1d0=await P(_0x5ef04a(0x181),{'alias':_0x21a652,'message':_0x1dbe46,'from_session':Z});return{'content':[{'type':_0x5ef04a(0x1d0),'text':JSON[_0x5ef04a(0x193)](_0x2bf1d0)}]};}if(_0x5ce1be===_0x5ef04a(0x186)){let _0x2fc55b=await P(_0x5ef04a(0x1d1),{});return{'content':[{'type':_0x5ef04a(0x1d0),'text':JSON[_0x5ef04a(0x193)](_0x2fc55b)}]};}return{'content':[{'type':_0x5ef04a(0x1d0),'text':JSON[_0x5ef04a(0x193)]({'error':_0x5ef04a(0x194)})}]};});async function v(){const _0x19a5a4=a0_0x1e2e5f;let _0x10d7cb=D+'/events/'+encodeURIComponent(Z),_0x4b7c94={};if(X)_0x4b7c94[_0x19a5a4(0x1df)]='Bearer\x20'+X;Y(_0x19a5a4(0x19e)+_0x10d7cb);while(!0x0){try{let _0x4d7e01=await fetch(_0x10d7cb,{'headers':_0x4b7c94});if(!_0x4d7e01['ok']){Y(_0x19a5a4(0x1ca)+_0x4d7e01['status']+'\x20'+_0x4d7e01['statusText']),await h(0x1388);continue;}let _0x513829=_0x4d7e01[_0x19a5a4(0x196)][_0x19a5a4(0x1da)](),_0x3cd8c0=new TextDecoder(),_0x38376a='';while(!0x0){let {done:_0x48ac11,value:_0x450b8d}=await _0x513829['read']();if(_0x48ac11)break;_0x38376a+=_0x3cd8c0[_0x19a5a4(0x1a3)](_0x450b8d,{'stream':!0x0});let _0x8b560b=_0x38376a[_0x19a5a4(0x171)]('\x0a\x0a');_0x38376a=_0x8b560b[_0x19a5a4(0x180)]()||'';for(let _0x5ee69e of _0x8b560b){let _0x5bad64=_0x5ee69e[_0x19a5a4(0x171)]('\x0a')[_0x19a5a4(0x17b)](_0x5d807d=>_0x5d807d[_0x19a5a4(0x162)]('data:\x20'));if(!_0x5bad64)continue;try{let _0x728e0e=JSON['parse'](_0x5bad64[_0x19a5a4(0x199)](0x6));await u(_0x728e0e);}catch(_0x14d16e){Y(_0x19a5a4(0x16a)+_0x14d16e);}}}Y(_0x19a5a4(0x163));}catch(_0x36cc35){Y(_0x19a5a4(0x1bc)+_0x36cc35);}await h(0xbb8);}}async function u(_0x3bde97){const _0x47a6df=a0_0x1e2e5f;if(_0x3bde97[_0x47a6df(0x1ae)]===_0x47a6df(0x18b)){Y(_0x47a6df(0x188)+Z+'\x22');return;}if(_0x3bde97[_0x47a6df(0x1ae)]===_0x47a6df(0x1c7)){if(Y(_0x47a6df(0x16f)+_0x3bde97['from']+':\x20'+_0x3bde97['message'][_0x47a6df(0x199)](0x0,0x3c)),await K[_0x47a6df(0x192)]({'method':'notifications/claude/channel','params':{'content':_0x3bde97[_0x47a6df(0x1b9)],'meta':{'sender':_0x3bde97[_0x47a6df(0x183)]||'hub','sender_id':_0x47a6df(0x1b3),'user':_0x3bde97['from']||_0x47a6df(0x174),'priority':_0x47a6df(0x1b7)}}}),_0x3bde97[_0x47a6df(0x15f)])await P(_0x47a6df(0x17d),{'alias':Z,'message_id':_0x3bde97[_0x47a6df(0x15f)]});return;}if(_0x3bde97[_0x47a6df(0x1ae)]===_0x47a6df(0x1ce)||_0x3bde97[_0x47a6df(0x1ae)]==='broadcast'){Y('←\x20'+_0x3bde97['type']+_0x47a6df(0x189)+_0x3bde97[_0x47a6df(0x195)]+_0x47a6df(0x169)+(_0x3bde97[_0x47a6df(0x1b4)]||_0x47a6df(0x1b7)));let _0x3c3b0e=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0x3c3b0e?.['ok']&&_0x3c3b0e['messages']?.[_0x47a6df(0x19b)]>0x0)for(let _0x482902 of _0x3c3b0e[_0x47a6df(0x1e9)]){let _0x3a95ec={'sender':_0x482902[_0x47a6df(0x175)]||_0x47a6df(0x174),'sender_id':_0x47a6df(0x1b3),'user':_0x482902['from_session']||'hub','task_id':_0x482902['id'],'priority':_0x482902[_0x47a6df(0x1b4)]||_0x47a6df(0x1b7)};k[_0x47a6df(0x191)](_0x482902['id'],_0x482902[_0x47a6df(0x175)]||_0x47a6df(0x174)),await K[_0x47a6df(0x192)]({'method':_0x47a6df(0x170),'params':{'content':_0x482902[_0x47a6df(0x1a8)],'meta':_0x3a95ec}}),Y('→\x20injected\x20task\x20'+_0x482902['id']['slice'](0x0,0x8)+_0x47a6df(0x185)+_0x482902[_0x47a6df(0x175)]+':\x20'+_0x482902[_0x47a6df(0x1a8)][_0x47a6df(0x199)](0x0,0x3c)),await P(_0x47a6df(0x17d),{'alias':Z,'message_id':_0x482902['id']});}}}async function S(){const _0x16fd0c=a0_0x1e2e5f;let _0x281313=new a0_0x426f4f();await K[_0x16fd0c(0x1dd)](_0x281313),Y(_0x16fd0c(0x1b1)),Y(_0x16fd0c(0x1d5)),v()['catch'](_0x2edded=>Y(_0x16fd0c(0x1c0)+_0x2edded)),P(_0x16fd0c(0x1c5),{'resume_id':w,'alias':Z,'status':_0x16fd0c(0x179),'server':a0_0x7e3c23(),'hostname':a0_0x7e3c23(),'agent':_0x16fd0c(0x1a7),'project_dir':process[_0x16fd0c(0x1cb)](),'tmux_name':f||void 0x0})[_0x16fd0c(0x1e8)](()=>Y(_0x16fd0c(0x176)+Z+'\x22\x20('+w['slice'](0x0,0x8)+')'))[_0x16fd0c(0x168)](_0x5e18f2=>Y(_0x16fd0c(0x1aa)+_0x5e18f2)),setInterval(()=>{const _0x470a24=_0x16fd0c;P(_0x470a24(0x1c5),{'resume_id':w,'alias':Z,'status':_0x470a24(0x179),'server':a0_0x7e3c23(),'hostname':a0_0x7e3c23(),'agent':'claude-code','project_dir':process['cwd'](),'tmux_name':f||void 0x0})[_0x470a24(0x168)](_0x3fc09d=>Y(_0x470a24(0x165)+_0x3fc09d));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}S()[a0_0x1e2e5f(0x168)](_0x14b013=>{const _0x80e3a9=a0_0x1e2e5f;Y(_0x80e3a9(0x1b2)+_0x14b013),process['exit'](0x1);});async function N(){const _0x4f551e=a0_0x1e2e5f;Y('shutting\x20down,\x20reporting\x20offline...'),await P(_0x4f551e(0x1c5),{'resume_id':w,'alias':Z,'status':_0x4f551e(0x1ad),'task':_0x4f551e(0x1ba)})['catch'](()=>{}),process['exit'](0x0);}process[a0_0x1e2e5f(0x19d)]['on']('end',()=>N()),process['on']('SIGTERM',()=>N()),process['on'](a0_0x1e2e5f(0x1e5),()=>N());function a0_0x212e(){const _0x434849=['send_message','low','from','trim','\x20from\x20','commhub_get_all_status','0.3.0','SSE\x20connected\x20as\x20\x22',':\x20inbox_count=','task','connected','join','72sTsZug','tmux\x20display-message\x20-p\x20\x27#S\x27','Message\x20content','failed','set','notification','stringify','unknown\x20tool','inbox_count','body','config.json','initialize','slice','get','length','indexOf','stdin','connecting\x20to\x20','string','/mcp','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','408oCwpwq','decode','5652594ckFdnQ','Reply\x20text\x20/\x20result\x20summary','16lWszxQ','claude-code','content','Current\x20task\x20description','warning:\x20could\x20not\x20register:\x20','send_reply','number','error','type','Progress\x200-100','commhub-channel','MCP\x20stdio\x20connected','fatal:\x20','commhub','priority','1478099cHjsqa','blocked','normal','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','message','session\x20disconnected','.env','SSE\x20connection\x20error:\x20','completed','none','.anet','SSE\x20fatal:\x20','Session\x20alias:\x20','application/json,\x20text/event-stream','POST','object','report_status','params','new_message','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','in_progress','SSE\x20error:\x20','cwd','status','Target\x20session\x20alias','new_task','118285cTKymt','text','get_all_status','2775440sannzN','commhub_send_message','7992DRWKMP','starting\x20SSE\x20listener...','\x20CWD=','commhub_reply','613029DAiLFe','alias','getReader','setRequestHandler','delete','connect','no\x20response','Authorization','high','working','10rJbABy','tools/call','Task\x20content','SIGINT','...\x20TMUX=','data:\x20','then','messages','init\x20failed:\x20','Bearer\x20','2.0','http://127.0.0.1:9200','write','utf-8','message_id','commhub_send_task','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','startsWith','SSE\x20stream\x20ended,\x20reconnecting...','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','heartbeat\x20failed:\x20','replied','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','catch','\x20priority=','parse\x20error:\x20','parse','send_task',']\x20[commhub]\x20','18396279vPGBNc','←\x20message\x20from\x20','notifications/claude/channel','split','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','commhub_report_status','hub','from_session','registered\x20as\x20\x22','stderr','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','idle','randomUUID','find','result','ack_inbox','replace','cancelled','pop'];a0_0x212e=function(){return _0x434849;};return a0_0x212e();}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.0.0-preview.63",
3
+ "version": "2.0.0-preview.65",
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",
@@ -21,7 +21,7 @@
21
21
  "dist"
22
22
  ],
23
23
  "scripts": {
24
- "build": "bun build src/client.ts --outdir dist/src --target node --minify && bun build bin/cli.ts --outdir dist/bin --target node --minify --external @sleep2agi/commhub-server --external bun:sqlite --external '../../server/*' && bun build src/node-server.ts --outdir dist/src --target node --minify --external @modelcontextprotocol/sdk && tsc --emitDeclarationOnly --declaration --outDir dist && npx javascript-obfuscator dist/bin/cli.js --output dist/bin/cli.js --compact true --control-flow-flattening true --string-array true --string-array-encoding base64 && npx javascript-obfuscator dist/src/client.js --output dist/src/client.js --compact true --string-array true && npx javascript-obfuscator dist/src/node-server.js --output dist/src/node-server.js --compact true --string-array true",
24
+ "build": "bun build src/client.ts --outdir dist/src --target node --minify && bun build bin/cli.ts --outdir dist/bin --target node --minify --external @sleep2agi/commhub-server --external bun:sqlite --external '../../server/*' && bun build src/node-server.ts --outdir dist/src --target node --minify --external @modelcontextprotocol/sdk && tsc --emitDeclarationOnly --declaration --outDir dist && npx javascript-obfuscator dist/bin/cli.js --output dist/bin/cli.js --compact true --string-array true --string-array-encoding base64 && npx javascript-obfuscator dist/src/client.js --output dist/src/client.js --compact true --string-array true && npx javascript-obfuscator dist/src/node-server.js --output dist/src/node-server.js --compact true --string-array true",
25
25
  "prepublishOnly": "npm run build"
26
26
  },
27
27
  "keywords": [