@sleep2agi/agent-network 2.2.6-preview.0 → 2.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- function a0_0x2a51(_0x444a45,_0x36f37a){_0x444a45=_0x444a45-0x154;const _0x8e1b71=a0_0x8e1b();let _0x2a5112=_0x8e1b71[_0x444a45];return _0x2a5112;}const a0_0x513285=a0_0x2a51;(function(_0x5a6479,_0x4ccca8){const _0x321baf=a0_0x2a51,_0x204ae7=_0x5a6479();while(!![]){try{const _0x2b1323=parseInt(_0x321baf(0x173))/0x1*(-parseInt(_0x321baf(0x1aa))/0x2)+-parseInt(_0x321baf(0x180))/0x3+-parseInt(_0x321baf(0x1a2))/0x4+parseInt(_0x321baf(0x158))/0x5*(parseInt(_0x321baf(0x188))/0x6)+parseInt(_0x321baf(0x15d))/0x7+-parseInt(_0x321baf(0x172))/0x8+-parseInt(_0x321baf(0x176))/0x9*(-parseInt(_0x321baf(0x19c))/0xa);if(_0x2b1323===_0x4ccca8)break;else _0x204ae7['push'](_0x204ae7['shift']());}catch(_0x5f499a){_0x204ae7['push'](_0x204ae7['shift']());}}}(a0_0x8e1b,0xd9f50));import{EventEmitter as a0_0x4e2992}from'events';import{hostname as a0_0x15fd20}from'os';class T extends a0_0x4e2992{[a0_0x513285(0x1a3)];['alias'];[a0_0x513285(0x175)];[a0_0x513285(0x1a9)];[a0_0x513285(0x182)];[a0_0x513285(0x15f)];[a0_0x513285(0x155)];[a0_0x513285(0x186)];[a0_0x513285(0x166)];[a0_0x513285(0x178)]=!0x1;constructor(_0x17a6aa){const _0x3df388=a0_0x513285;super();if(this[_0x3df388(0x1a3)]=_0x17a6aa[_0x3df388(0x1a3)][_0x3df388(0x195)](/\/$/,''),this['alias']=_0x17a6aa[_0x3df388(0x193)],this[_0x3df388(0x175)]=_0x17a6aa[_0x3df388(0x175)],this[_0x3df388(0x1a9)]=_0x17a6aa[_0x3df388(0x1a9)]||_0x3df388(0x19f),this['resumeId']=_0x3df388(0x17e)+_0x17a6aa['alias']+'-'+Date[_0x3df388(0x17a)]()['toString'](0x24),this[_0x3df388(0x15f)]=_0x17a6aa['heartbeatInterval']??0x2bf20,this[_0x3df388(0x155)]=_0x17a6aa['reconnectDelay']??0xbb8,_0x17a6aa['autoConnect']!==!0x1)this[_0x3df388(0x19d)]();}['log'](_0x281753){const _0x53d9df=a0_0x513285;console['log']('['+new Date()[_0x53d9df(0x16d)]()[_0x53d9df(0x17d)](0x0,0x8)+_0x53d9df(0x18f)+this[_0x53d9df(0x193)]+']\x20'+_0x281753);}async['call'](_0x183f81,_0x272531){const _0x154cfe=a0_0x513285;let _0x5e2d16={'Content-Type':'application/json','Accept':_0x154cfe(0x15a)};if(this[_0x154cfe(0x175)])_0x5e2d16[_0x154cfe(0x19a)]=_0x154cfe(0x174)+this[_0x154cfe(0x175)];let _0x57c7fe=await(await fetch(this['url']+_0x154cfe(0x171),{'method':_0x154cfe(0x199),'headers':_0x5e2d16,'body':JSON[_0x154cfe(0x1a5)]({'jsonrpc':_0x154cfe(0x1a4),'id':Date[_0x154cfe(0x17a)](),'method':'tools/call','params':{'name':_0x183f81,'arguments':_0x272531}})}))[_0x154cfe(0x194)](),_0x20d88e=_0x57c7fe[_0x154cfe(0x183)](/data: (.+)/),_0x400550=_0x20d88e?JSON[_0x154cfe(0x16a)](_0x20d88e[0x1]):JSON[_0x154cfe(0x16a)](_0x57c7fe),_0x4930c3=_0x400550?.[_0x154cfe(0x160)]?.[_0x154cfe(0x18e)]?.[0x0]?.[_0x154cfe(0x194)];return _0x4930c3?JSON[_0x154cfe(0x16a)](_0x4930c3):_0x400550;}async[a0_0x513285(0x19d)](){const _0x3a38d5=a0_0x513285;if(this['running'])return;this['running']=!0x0,await this[_0x3a38d5(0x17f)](_0x3a38d5(0x198)),this[_0x3a38d5(0x16e)]('registered'),this['heartbeatTimer']=setInterval(()=>{const _0x678da6=_0x3a38d5;this[_0x678da6(0x17f)]('idle')['catch'](_0x3b43c4=>this[_0x678da6(0x16e)](_0x678da6(0x16c)+_0x3b43c4[_0x678da6(0x17c)]));},this['heartbeatInterval']),this[_0x3a38d5(0x18c)]();}async[a0_0x513285(0x187)](){const _0x449129=a0_0x513285;if(this[_0x449129(0x178)]=!0x1,this[_0x449129(0x166)]?.[_0x449129(0x184)](),this[_0x449129(0x186)])clearInterval(this['heartbeatTimer']);await this[_0x449129(0x17f)](_0x449129(0x18a))[_0x449129(0x19e)](()=>{}),this[_0x449129(0x16e)](_0x449129(0x196));}async[a0_0x513285(0x1a6)](_0x5c25a7,_0x5ac983,_0x328619=a0_0x513285(0x168)){const _0x1663c6=a0_0x513285;return this[_0x1663c6(0x159)](_0x1663c6(0x162),{'alias':_0x5c25a7,'task':_0x5ac983,'priority':_0x328619,'from_session':this[_0x1663c6(0x193)]});}async[a0_0x513285(0x17c)](_0x3f6aaf,_0x43dcd2){const _0x1d24a2=a0_0x513285;return this[_0x1d24a2(0x159)](_0x1d24a2(0x17b),{'alias':_0x3f6aaf,'message':_0x43dcd2,'from_session':this['alias']});}async[a0_0x513285(0x154)](_0x2cc709,_0x334e50,_0x4552b4=a0_0x513285(0x18b)){const _0x1470e3=a0_0x513285;return this[_0x1470e3(0x159)](_0x1470e3(0x170),{'in_reply_to':_0x2cc709,'text':_0x334e50,'status':_0x4552b4});}async[a0_0x513285(0x17f)](_0x5dc573,_0x3c90c0){const _0x19810c=a0_0x513285;return this['call'](_0x19810c(0x167),{'resume_id':this[_0x19810c(0x182)],'alias':this['alias'],'status':_0x5dc573,'server':a0_0x15fd20(),'hostname':a0_0x15fd20(),'agent':this['agent'],'project_dir':process[_0x19810c(0x163)](),..._0x3c90c0});}async[a0_0x513285(0x191)](){const _0x1678bc=a0_0x513285;return this[_0x1678bc(0x159)]('get_all_status',{});}async['broadcast'](_0x4d17fb,_0x12a67a){const _0x5ca949=a0_0x513285;return this['call'](_0x5ca949(0x19b),{'message':_0x4d17fb,'filter_server':_0x12a67a?.[_0x5ca949(0x1a0)],'filter_status':_0x12a67a?.[_0x5ca949(0x17f)]});}async[a0_0x513285(0x18c)](){const _0x58eb06=a0_0x513285;let _0xedce63=encodeURIComponent(this[_0x58eb06(0x193)]),_0xc6ee44=this['url']+_0x58eb06(0x164)+_0xedce63,_0x1ba87a=this['reconnectDelay'];while(this['running']){try{this[_0x58eb06(0x166)]=new AbortController();let _0x4abf50={'Accept':'text/event-stream'};if(this[_0x58eb06(0x175)])_0x4abf50['Authorization']=_0x58eb06(0x174)+this[_0x58eb06(0x175)];let _0x504d6d=await fetch(_0xc6ee44,{'headers':_0x4abf50,'signal':this[_0x58eb06(0x166)][_0x58eb06(0x15c)]});if(!_0x504d6d['ok']||!_0x504d6d[_0x58eb06(0x190)]){this['log'](_0x58eb06(0x165)+_0x504d6d[_0x58eb06(0x17f)]),await this[_0x58eb06(0x177)](_0x1ba87a),_0x1ba87a=Math['min'](_0x1ba87a*1.5,0xea60);continue;}_0x1ba87a=this['reconnectDelay'];let _0x233e5c=_0x504d6d[_0x58eb06(0x190)][_0x58eb06(0x181)](),_0x4f746=new TextDecoder(),_0x59b88a='';while(this['running']){let {done:_0x445f79,value:_0x12a5d4}=await _0x233e5c['read']();if(_0x445f79)break;_0x59b88a+=_0x4f746[_0x58eb06(0x157)](_0x12a5d4,{'stream':!0x0});let _0x26810a=_0x59b88a['split']('\x0a');_0x59b88a=_0x26810a[_0x58eb06(0x156)]()||'';for(let _0x2a5fea of _0x26810a){if(!_0x2a5fea[_0x58eb06(0x15b)]('data:\x20'))continue;try{let _0x2da2ff=JSON['parse'](_0x2a5fea['slice'](0x6));if(_0x2da2ff[_0x58eb06(0x1a7)]==='connected'){this[_0x58eb06(0x16e)](_0x58eb06(0x192)),this[_0x58eb06(0x169)](_0x58eb06(0x15e));continue;}if(_0x2da2ff[_0x58eb06(0x1a7)]==='new_task'||_0x2da2ff[_0x58eb06(0x1a7)]==='new_message'||_0x2da2ff['type']===_0x58eb06(0x19b))await this['processInbox']();}catch{}}}}catch(_0x37b929){if(_0x37b929[_0x58eb06(0x179)]===_0x58eb06(0x161))break;this['emit']('error',_0x37b929),this[_0x58eb06(0x16e)]('SSE\x20error:\x20'+_0x37b929[_0x58eb06(0x17c)]);}if(this['running'])this[_0x58eb06(0x169)](_0x58eb06(0x196)),this[_0x58eb06(0x16e)](_0x58eb06(0x185)+_0x1ba87a/0x3e8+'s...'),await this[_0x58eb06(0x177)](_0x1ba87a),_0x1ba87a=Math[_0x58eb06(0x16f)](_0x1ba87a*1.5,0xea60);}}async[a0_0x513285(0x18d)](){const _0x57aa78=a0_0x513285;try{let _0x35674f=(await this['call'](_0x57aa78(0x189),{'alias':this[_0x57aa78(0x193)],'limit':0xa}))?.[_0x57aa78(0x1a1)]||[];for(let _0xfc8825 of _0x35674f)await this[_0x57aa78(0x159)](_0x57aa78(0x197),{'alias':this['alias'],'message_id':_0xfc8825['id']}),this[_0x57aa78(0x16e)]('←\x20'+_0xfc8825[_0x57aa78(0x16b)]+':\x20'+_0xfc8825[_0x57aa78(0x18e)][_0x57aa78(0x17d)](0x0,0x3c)),this['emit'](_0x57aa78(0x1a8),_0xfc8825),this['emit'](_0x57aa78(0x17c),_0xfc8825);}catch(_0x34968f){this[_0x57aa78(0x16e)]('inbox\x20error:\x20'+_0x34968f[_0x57aa78(0x17c)]);}}[a0_0x513285(0x177)](_0x5acb07){return new Promise(_0x1d971f=>setTimeout(_0x1d971f,_0x5acb07));}}var $=T;export{$ as default,T as CommHub};function a0_0x8e1b(){const _0x39bd0a=['agent','611596GdjhHG','reply','reconnectDelay','pop','decode','135seDDSG','call','application/json,\x20text/event-stream','startsWith','signal','9992178eMosot','connected','heartbeatInterval','result','AbortError','send_task','cwd','/events/','SSE\x20failed:\x20','sseAbort','report_status','normal','emit','parse','from_session','heartbeat\x20failed:\x20','toTimeString','log','min','send_reply','/mcp','11229904YxwScq','3VvozPU','Bearer\x20','token','9cJicam','sleep','running','name','now','send_message','message','slice','sdk-','status','3341649EWxXCs','getReader','resumeId','match','abort','SSE\x20reconnecting\x20in\x20','heartbeatTimer','disconnect','317484YxjryM','get_inbox','offline','completed','connectSSE','processInbox','content',']\x20[commhub:','body','getAllStatus','SSE\x20connected','alias','text','replace','disconnected','ack_inbox','idle','POST','Authorization','broadcast','30238870GNIIfD','connect','catch','sdk','server','messages','6209008HgiVlP','url','2.0','stringify','send','type','task'];a0_0x8e1b=function(){return _0x39bd0a;};return a0_0x8e1b();}
1
+ const a0_0xbcbb13=a0_0x2448;(function(_0x1f7e02,_0x5d0d96){const _0x4873fa=a0_0x2448,_0x4dd601=_0x1f7e02();while(!![]){try{const _0x166137=parseInt(_0x4873fa(0x1e7))/0x1+-parseInt(_0x4873fa(0x1c7))/0x2+-parseInt(_0x4873fa(0x1f1))/0x3*(parseInt(_0x4873fa(0x1e0))/0x4)+-parseInt(_0x4873fa(0x1d8))/0x5+-parseInt(_0x4873fa(0x1bf))/0x6*(parseInt(_0x4873fa(0x1bb))/0x7)+parseInt(_0x4873fa(0x1ee))/0x8*(-parseInt(_0x4873fa(0x1cc))/0x9)+parseInt(_0x4873fa(0x1db))/0xa;if(_0x166137===_0x5d0d96)break;else _0x4dd601['push'](_0x4dd601['shift']());}catch(_0x3e26dc){_0x4dd601['push'](_0x4dd601['shift']());}}}(a0_0x53cc,0x4ecd6));import{EventEmitter as a0_0x224a15}from'events';import{hostname as a0_0x3a5e7f}from'os';function a0_0x2448(_0x28d0d9,_0xc9bb0e){_0x28d0d9=_0x28d0d9-0x1ac;const _0x53cc7b=a0_0x53cc();let _0x24488c=_0x53cc7b[_0x28d0d9];return _0x24488c;}function a0_0x53cc(){const _0xeea205=['running','name','server','heartbeatTimer','parse','type','disconnect','body','application/json','read','report_status','status','SSE\x20failed:\x20','cwd','now','send_task','connected','getAllStatus','14EuPfnu','Authorization','match','send','1591626WdtjPc','url',']\x20[commhub:','getReader','abort','slice','data:\x20','connect','219436yvTcbc','sleep','SSE\x20reconnecting\x20in\x20','offline','autoConnect','2588364aDLPbi','tools/call','call','Bearer\x20','new_task','get_inbox','reconnectDelay','toString','stringify','from_session','sseAbort','reply','1707390vEcRKO','signal','alias','15967620SECVIy','catch','inbox\x20error:\x20','connectSSE','split','4VOLtQK','SSE\x20error:\x20','/events/','normal','sdk','processInbox','disconnected','487074HUhuAR','heartbeatInterval','messages','result','decode','/mcp','text','16YJzWQs','log','token','612396deDySX','completed','message','content','agent','AbortError','resumeId','min','application/json,\x20text/event-stream','idle','emit'];a0_0x53cc=function(){return _0xeea205;};return a0_0x53cc();}class T extends a0_0x224a15{[a0_0xbcbb13(0x1c0)];['alias'];[a0_0xbcbb13(0x1f0)];['agent'];[a0_0xbcbb13(0x1f7)];[a0_0xbcbb13(0x1e8)];[a0_0xbcbb13(0x1d2)];['heartbeatTimer'];[a0_0xbcbb13(0x1d6)];[a0_0xbcbb13(0x1fc)]=!0x1;constructor(_0x383d7d){const _0x2d6060=a0_0xbcbb13;super();if(this[_0x2d6060(0x1c0)]=_0x383d7d['url']['replace'](/\/$/,''),this[_0x2d6060(0x1da)]=_0x383d7d[_0x2d6060(0x1da)],this['token']=_0x383d7d[_0x2d6060(0x1f0)],this[_0x2d6060(0x1f5)]=_0x383d7d[_0x2d6060(0x1f5)]||_0x2d6060(0x1e4),this[_0x2d6060(0x1f7)]='sdk-'+_0x383d7d[_0x2d6060(0x1da)]+'-'+Date['now']()[_0x2d6060(0x1d3)](0x24),this[_0x2d6060(0x1e8)]=_0x383d7d[_0x2d6060(0x1e8)]??0x2bf20,this[_0x2d6060(0x1d2)]=_0x383d7d[_0x2d6060(0x1d2)]??0xbb8,_0x383d7d[_0x2d6060(0x1cb)]!==!0x1)this[_0x2d6060(0x1c6)]();}[a0_0xbcbb13(0x1ef)](_0x4a9055){const _0x70dd46=a0_0xbcbb13;console[_0x70dd46(0x1ef)]('['+new Date()['toTimeString']()['slice'](0x0,0x8)+_0x70dd46(0x1c1)+this[_0x70dd46(0x1da)]+']\x20'+_0x4a9055);}async[a0_0xbcbb13(0x1ce)](_0x295a06,_0x4ec592){const _0x24f7bf=a0_0xbcbb13;let _0x3db48b={'Content-Type':_0x24f7bf(0x1b1),'Accept':_0x24f7bf(0x1f9)};if(this['token'])_0x3db48b[_0x24f7bf(0x1bc)]=_0x24f7bf(0x1cf)+this[_0x24f7bf(0x1f0)];let _0x1151f4=await(await fetch(this['url']+_0x24f7bf(0x1ec),{'method':'POST','headers':_0x3db48b,'body':JSON[_0x24f7bf(0x1d4)]({'jsonrpc':'2.0','id':Date[_0x24f7bf(0x1b7)](),'method':_0x24f7bf(0x1cd),'params':{'name':_0x295a06,'arguments':_0x4ec592}})}))[_0x24f7bf(0x1ed)](),_0x3b7000=_0x1151f4[_0x24f7bf(0x1bd)](/data: (.+)/),_0x2069ff=_0x3b7000?JSON[_0x24f7bf(0x1ad)](_0x3b7000[0x1]):JSON[_0x24f7bf(0x1ad)](_0x1151f4),_0x4ee033=_0x2069ff?.[_0x24f7bf(0x1ea)]?.[_0x24f7bf(0x1f4)]?.[0x0]?.['text'];return _0x4ee033?JSON[_0x24f7bf(0x1ad)](_0x4ee033):_0x2069ff;}async[a0_0xbcbb13(0x1c6)](){const _0x406b35=a0_0xbcbb13;if(this[_0x406b35(0x1fc)])return;this[_0x406b35(0x1fc)]=!0x0,await this[_0x406b35(0x1b4)](_0x406b35(0x1fa)),this[_0x406b35(0x1ef)]('registered'),this['heartbeatTimer']=setInterval(()=>{const _0x12723f=_0x406b35;this['status'](_0x12723f(0x1fa))[_0x12723f(0x1dc)](_0x18e755=>this[_0x12723f(0x1ef)]('heartbeat\x20failed:\x20'+_0x18e755['message']));},this['heartbeatInterval']),this['connectSSE']();}async[a0_0xbcbb13(0x1af)](){const _0x4775a9=a0_0xbcbb13;if(this['running']=!0x1,this[_0x4775a9(0x1d6)]?.[_0x4775a9(0x1c3)](),this['heartbeatTimer'])clearInterval(this[_0x4775a9(0x1ac)]);await this[_0x4775a9(0x1b4)](_0x4775a9(0x1ca))[_0x4775a9(0x1dc)](()=>{}),this[_0x4775a9(0x1ef)]('disconnected');}async[a0_0xbcbb13(0x1be)](_0x3c2cb5,_0x59e7b5,_0x1b1e27=a0_0xbcbb13(0x1e3)){const _0x2c538d=a0_0xbcbb13;return this['call'](_0x2c538d(0x1b8),{'alias':_0x3c2cb5,'task':_0x59e7b5,'priority':_0x1b1e27,'from_session':this[_0x2c538d(0x1da)]});}async[a0_0xbcbb13(0x1f3)](_0x30a01b,_0x2c24bd){const _0x1b352e=a0_0xbcbb13;return this[_0x1b352e(0x1ce)]('send_message',{'alias':_0x30a01b,'message':_0x2c24bd,'from_session':this[_0x1b352e(0x1da)]});}async[a0_0xbcbb13(0x1d7)](_0x107732,_0x57c9d6,_0x1c36de=a0_0xbcbb13(0x1f2)){const _0x227307=a0_0xbcbb13;return this[_0x227307(0x1ce)]('send_reply',{'in_reply_to':_0x107732,'text':_0x57c9d6,'status':_0x1c36de});}async[a0_0xbcbb13(0x1b4)](_0x3c54dc,_0x4a89cb){const _0x323255=a0_0xbcbb13;return this[_0x323255(0x1ce)](_0x323255(0x1b3),{'resume_id':this['resumeId'],'alias':this['alias'],'status':_0x3c54dc,'server':a0_0x3a5e7f(),'hostname':a0_0x3a5e7f(),'agent':this[_0x323255(0x1f5)],'project_dir':process[_0x323255(0x1b6)](),..._0x4a89cb});}async[a0_0xbcbb13(0x1ba)](){return this['call']('get_all_status',{});}async['broadcast'](_0x4ea40e,_0x2d3138){const _0x486bfa=a0_0xbcbb13;return this[_0x486bfa(0x1ce)]('broadcast',{'message':_0x4ea40e,'filter_server':_0x2d3138?.[_0x486bfa(0x1fe)],'filter_status':_0x2d3138?.['status']});}async[a0_0xbcbb13(0x1de)](){const _0x2322f8=a0_0xbcbb13;let _0x54c562=encodeURIComponent(this['alias']),_0x204413=this['url']+_0x2322f8(0x1e2)+_0x54c562,_0x59888f=this[_0x2322f8(0x1d2)];while(this[_0x2322f8(0x1fc)]){try{this[_0x2322f8(0x1d6)]=new AbortController();let _0x345f20={'Accept':'text/event-stream'};if(this['token'])_0x345f20['Authorization']='Bearer\x20'+this[_0x2322f8(0x1f0)];let _0x618719=await fetch(_0x204413,{'headers':_0x345f20,'signal':this[_0x2322f8(0x1d6)][_0x2322f8(0x1d9)]});if(!_0x618719['ok']||!_0x618719[_0x2322f8(0x1b0)]){this[_0x2322f8(0x1ef)](_0x2322f8(0x1b5)+_0x618719['status']),await this[_0x2322f8(0x1c8)](_0x59888f),_0x59888f=Math['min'](_0x59888f*1.5,0xea60);continue;}_0x59888f=this[_0x2322f8(0x1d2)];let _0x36dd3=_0x618719[_0x2322f8(0x1b0)][_0x2322f8(0x1c2)](),_0xd020af=new TextDecoder(),_0x268a73='';while(this['running']){let {done:_0x46ba03,value:_0x557655}=await _0x36dd3[_0x2322f8(0x1b2)]();if(_0x46ba03)break;_0x268a73+=_0xd020af[_0x2322f8(0x1eb)](_0x557655,{'stream':!0x0});let _0x362978=_0x268a73[_0x2322f8(0x1df)]('\x0a');_0x268a73=_0x362978['pop']()||'';for(let _0x4f6129 of _0x362978){if(!_0x4f6129['startsWith'](_0x2322f8(0x1c5)))continue;try{let _0x3fb876=JSON[_0x2322f8(0x1ad)](_0x4f6129['slice'](0x6));if(_0x3fb876['type']===_0x2322f8(0x1b9)){this[_0x2322f8(0x1ef)]('SSE\x20connected'),this[_0x2322f8(0x1fb)](_0x2322f8(0x1b9));continue;}if(_0x3fb876[_0x2322f8(0x1ae)]===_0x2322f8(0x1d0)||_0x3fb876['type']==='new_message'||_0x3fb876[_0x2322f8(0x1ae)]==='broadcast')await this[_0x2322f8(0x1e5)]();}catch{}}}}catch(_0x2da973){if(_0x2da973[_0x2322f8(0x1fd)]===_0x2322f8(0x1f6))break;this[_0x2322f8(0x1fb)]('error',_0x2da973),this['log'](_0x2322f8(0x1e1)+_0x2da973['message']);}if(this['running'])this[_0x2322f8(0x1fb)](_0x2322f8(0x1e6)),this[_0x2322f8(0x1ef)](_0x2322f8(0x1c9)+_0x59888f/0x3e8+'s...'),await this[_0x2322f8(0x1c8)](_0x59888f),_0x59888f=Math[_0x2322f8(0x1f8)](_0x59888f*1.5,0xea60);}}async['processInbox'](){const _0xaf7886=a0_0xbcbb13;try{let _0x5da7d3=(await this[_0xaf7886(0x1ce)](_0xaf7886(0x1d1),{'alias':this[_0xaf7886(0x1da)],'limit':0xa}))?.[_0xaf7886(0x1e9)]||[];for(let _0x53bff1 of _0x5da7d3)await this[_0xaf7886(0x1ce)]('ack_inbox',{'alias':this[_0xaf7886(0x1da)],'message_id':_0x53bff1['id']}),this['log']('←\x20'+_0x53bff1[_0xaf7886(0x1d5)]+':\x20'+_0x53bff1[_0xaf7886(0x1f4)][_0xaf7886(0x1c4)](0x0,0x3c)),this[_0xaf7886(0x1fb)]('task',_0x53bff1),this[_0xaf7886(0x1fb)]('message',_0x53bff1);}catch(_0x31bdea){this[_0xaf7886(0x1ef)](_0xaf7886(0x1dd)+_0x31bdea['message']);}}[a0_0xbcbb13(0x1c8)](_0x470946){return new Promise(_0x3b6c65=>setTimeout(_0x3b6c65,_0x470946));}}var $=T;export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x2c6966=a0_0x563f;(function(_0x25c594,_0x454268){const _0x3e9165=a0_0x563f,_0x261810=_0x25c594();while(!![]){try{const _0xae0309=parseInt(_0x3e9165(0x20a))/0x1*(parseInt(_0x3e9165(0x1ea))/0x2)+-parseInt(_0x3e9165(0x1da))/0x3*(parseInt(_0x3e9165(0x1d1))/0x4)+parseInt(_0x3e9165(0x204))/0x5+parseInt(_0x3e9165(0x1f8))/0x6*(parseInt(_0x3e9165(0x1e0))/0x7)+parseInt(_0x3e9165(0x203))/0x8*(parseInt(_0x3e9165(0x1dd))/0x9)+-parseInt(_0x3e9165(0x201))/0xa*(-parseInt(_0x3e9165(0x1b0))/0xb)+-parseInt(_0x3e9165(0x206))/0xc;if(_0xae0309===_0x454268)break;else _0x261810['push'](_0x261810['shift']());}catch(_0x526942){_0x261810['push'](_0x261810['shift']());}}}(a0_0x8d7b,0x3eac8));import{readFileSync as a0_0x133108,existsSync as a0_0x2673dd}from'fs';import{randomUUID as a0_0x5898e3}from'crypto';import{join as a0_0x5bb2c9}from'path';import{hostname as a0_0x4a6714}from'os';import{execSync as a0_0x5cd1b9}from'child_process';import{Server as a0_0x24638b}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x41583a}from'@modelcontextprotocol/sdk/server/stdio.js';function a0_0x563f(_0x536c5b,_0x118048){_0x536c5b=_0x536c5b-0x1a3;const _0x8d7bdd=a0_0x8d7b();let _0x563ffc=_0x8d7bdd[_0x536c5b];return _0x563ffc;}import{ListToolsRequestSchema as a0_0x58ba7c,CallToolRequestSchema as a0_0x317fbf}from'@modelcontextprotocol/sdk/types.js';function p(_0x210f51){const _0x8aa3b0=a0_0x563f;if(!a0_0x2673dd(_0x210f51))return;for(let _0x3a3865 of a0_0x133108(_0x210f51,_0x8aa3b0(0x1ef))[_0x8aa3b0(0x1fd)]('\x0a')){let _0x1eac57=_0x3a3865[_0x8aa3b0(0x228)]();if(!_0x1eac57||_0x1eac57[_0x8aa3b0(0x213)]('#'))continue;let _0x1c2e98=_0x1eac57['indexOf']('=');if(_0x1c2e98<0x0)continue;let _0x4a386d=_0x1eac57['slice'](0x0,_0x1c2e98)[_0x8aa3b0(0x228)](),_0x747219=_0x1eac57['slice'](_0x1c2e98+0x1)[_0x8aa3b0(0x228)]()[_0x8aa3b0(0x1ee)](/^["']|["']$/g,'');if(!process.env[_0x4a386d])process.env[_0x4a386d]=_0x747219;}}var C=process.env.HOME||'~',T=a0_0x5bb2c9(C,a0_0x2c6966(0x226));p(a0_0x5bb2c9(T,a0_0x2c6966(0x1ce)));var L=process[a0_0x2c6966(0x1ed)]()[a0_0x2c6966(0x1ee)](/\//g,'-');p(a0_0x5bb2c9(T,L,a0_0x2c6966(0x1ce)));function U(){const _0x3f8fcc=a0_0x2c6966;try{return a0_0x5cd1b9('tmux\x20display-message\x20-p\x20\x27#S\x27',{'encoding':_0x3f8fcc(0x1ef),'timeout':0x7d0})[_0x3f8fcc(0x228)]();}catch{return'';}}function v(){const _0x5e0add=a0_0x2c6966;try{let _0x8d3e19=a0_0x5bb2c9(C,_0x5e0add(0x223),_0x5e0add(0x1d4));if(a0_0x2673dd(_0x8d3e19))return JSON['parse'](a0_0x133108(_0x8d3e19,_0x5e0add(0x1ef)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x2c6966(0x1b6)]||a0_0x2c6966(0x209),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x4a6714(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x5898e3(),X=process.env.COMMHUB_TOKEN||H[a0_0x2c6966(0x1fe)]||'';function Y(_0x3a2e1c){const _0x15e7a7=a0_0x2c6966;let _0x5a650d=new Date()['toTimeString']()['slice'](0x0,0x8);process[_0x15e7a7(0x217)][_0x15e7a7(0x1cf)]('['+_0x5a650d+_0x15e7a7(0x237)+_0x3a2e1c+'\x0a');}function h(_0x2f6495){return new Promise(_0xd2c4b4=>setTimeout(_0xd2c4b4,_0x2f6495));}Y(a0_0x2c6966(0x1df)+f+a0_0x2c6966(0x222)+Z+a0_0x2c6966(0x235)+w[a0_0x2c6966(0x1cb)](0x0,0x8)+a0_0x2c6966(0x214)+(j||a0_0x2c6966(0x1b7))+a0_0x2c6966(0x1d3)+process[a0_0x2c6966(0x1ed)]()+a0_0x2c6966(0x22b)+L);var k=new Map(),K=new a0_0x24638b({'name':'commhub-channel','version':'0.3.0'},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x2c6966(0x1b5),a0_0x2c6966(0x1f2),a0_0x2c6966(0x1b1),'You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.',a0_0x2c6966(0x1f7)+Z]['join']('\x0a')});K[a0_0x2c6966(0x205)](a0_0x58ba7c,async()=>({'tools':[{'name':'commhub_reply','description':a0_0x2c6966(0x1a4),'inputSchema':{'type':'object','properties':{'task_id':{'type':a0_0x2c6966(0x202),'description':a0_0x2c6966(0x20e)},'text':{'type':'string','description':a0_0x2c6966(0x1fc)},'status':{'type':a0_0x2c6966(0x202),'enum':[a0_0x2c6966(0x22d),a0_0x2c6966(0x1e3),'cancelled',a0_0x2c6966(0x20f),a0_0x2c6966(0x1c0),a0_0x2c6966(0x1c5)],'description':a0_0x2c6966(0x1f0)}},'required':[a0_0x2c6966(0x21f)]}},{'name':a0_0x2c6966(0x1c4),'description':a0_0x2c6966(0x22f),'inputSchema':{'type':'object','properties':{'status':{'type':a0_0x2c6966(0x202),'enum':[a0_0x2c6966(0x1ae),a0_0x2c6966(0x1c6),a0_0x2c6966(0x20f),a0_0x2c6966(0x1c0)]},'task':{'type':'string','description':a0_0x2c6966(0x1a7)},'progress':{'type':a0_0x2c6966(0x1e7),'description':a0_0x2c6966(0x1cd)}},'required':[a0_0x2c6966(0x1f4)]}},{'name':a0_0x2c6966(0x21b),'description':'Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','inputSchema':{'type':a0_0x2c6966(0x1f9),'properties':{'alias':{'type':a0_0x2c6966(0x202),'description':a0_0x2c6966(0x1c9)},'task':{'type':a0_0x2c6966(0x202),'description':a0_0x2c6966(0x219)},'priority':{'type':a0_0x2c6966(0x202),'enum':['high',a0_0x2c6966(0x1bd),a0_0x2c6966(0x1c3)],'description':'Priority\x20(default:\x20normal)'}},'required':['alias','task']}},{'name':'commhub_send_message','description':a0_0x2c6966(0x225),'inputSchema':{'type':a0_0x2c6966(0x1f9),'properties':{'alias':{'type':a0_0x2c6966(0x202),'description':'Target\x20session\x20alias'},'message':{'type':a0_0x2c6966(0x202),'description':a0_0x2c6966(0x1db)}},'required':[a0_0x2c6966(0x216),a0_0x2c6966(0x212)]}},{'name':'commhub_get_all_status','description':a0_0x2c6966(0x1ff),'inputSchema':{'type':a0_0x2c6966(0x1f9),'properties':{}}}]}));async function P(_0x41fe26,_0x5ba7fb){const _0x16a44b=a0_0x2c6966;let _0x203174=await fetch(f+_0x16a44b(0x21a),{'method':_0x16a44b(0x238),'headers':{'Content-Type':_0x16a44b(0x236),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x16a44b(0x1c7)+X}:{}},'body':JSON[_0x16a44b(0x1b2)]({'jsonrpc':_0x16a44b(0x229),'id':0x1,'method':'initialize','params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x16a44b(0x1c2),'version':_0x16a44b(0x1aa)}}})});if(!_0x203174['ok']){let _0x4219a3=await _0x203174[_0x16a44b(0x21f)]();return Y(_0x16a44b(0x1f3)+_0x203174[_0x16a44b(0x1f4)]+'\x20'+_0x4219a3[_0x16a44b(0x1cb)](0x0,0x64)),{'ok':!0x1,'error':'init\x20failed:\x20'+_0x203174[_0x16a44b(0x1f4)]};}await _0x203174[_0x16a44b(0x21f)]();let _0x18a401=(await(await fetch(f+_0x16a44b(0x21a),{'method':_0x16a44b(0x238),'headers':{'Content-Type':_0x16a44b(0x236),'Accept':_0x16a44b(0x1a9),...X?{'Authorization':_0x16a44b(0x1c7)+X}:{}},'body':JSON[_0x16a44b(0x1b2)]({'jsonrpc':'2.0','id':0x2,'method':_0x16a44b(0x211),'params':{'name':_0x41fe26,'arguments':_0x5ba7fb}})}))['text']())[_0x16a44b(0x1fd)]('\x0a')[_0x16a44b(0x234)](_0x266b52=>_0x266b52[_0x16a44b(0x213)](_0x16a44b(0x1f1)));if(_0x18a401){let _0x4e2184=JSON[_0x16a44b(0x1bf)](_0x18a401[_0x16a44b(0x1cb)](0x6));return _0x4e2184?.[_0x16a44b(0x1ba)]?.[_0x16a44b(0x1bb)]?.[0x0]?.['text']?JSON[_0x16a44b(0x1bf)](_0x4e2184[_0x16a44b(0x1ba)][_0x16a44b(0x1bb)][0x0]['text']):_0x4e2184;}return{'ok':!0x1,'error':_0x16a44b(0x215)};}K[a0_0x2c6966(0x205)](a0_0x317fbf,async _0x4e92a7=>{const _0x294daa=a0_0x2c6966;let {name:_0x4fa918,arguments:_0x2dad82}=_0x4e92a7[_0x294daa(0x1ca)];if(_0x4fa918===_0x294daa(0x20c)){let {task_id:_0x25be3f,text:_0x55581e,status:_0x5e3d7d}=_0x2dad82;if(_0x5e3d7d===_0x294daa(0x22d)||_0x5e3d7d===_0x294daa(0x1e3)||_0x5e3d7d===_0x294daa(0x1cc)){let _0x3ff322=_0x5e3d7d==='completed'?_0x294daa(0x20b):_0x5e3d7d,_0x1e82d5=_0x25be3f?k['get'](_0x25be3f)||_0x294daa(0x1b6):_0x294daa(0x1b6),_0x25f0ae=await P(_0x294daa(0x1c1),{'alias':_0x1e82d5,'text':_0x55581e,'in_reply_to':_0x25be3f||void 0x0,'status':_0x3ff322,'from_session':Z});if(_0x25be3f)k[_0x294daa(0x1a6)](_0x25be3f);return{'content':[{'type':'text','text':JSON['stringify'](_0x25f0ae)}]};}let _0x58eabf=await P(_0x294daa(0x20d),{'resume_id':w,'alias':Z,'status':_0x5e3d7d==='blocked'?_0x294daa(0x20f):_0x5e3d7d===_0x294daa(0x1c0)?'error':_0x294daa(0x1ae),'task':_0x55581e[_0x294daa(0x1cb)](0x0,0xc8),'output':_0x55581e});return{'content':[{'type':_0x294daa(0x21f),'text':JSON[_0x294daa(0x1b2)](_0x58eabf)}]};}if(_0x4fa918==='commhub_report_status'){let {status:_0x288723,task:_0x34ccd5,progress:_0x5365bf}=_0x2dad82,_0x31342e=await P(_0x294daa(0x20d),{'resume_id':w,'alias':Z,'status':_0x288723,'task':_0x34ccd5,'progress':_0x5365bf});return{'content':[{'type':'text','text':JSON[_0x294daa(0x1b2)](_0x31342e)}]};}if(_0x4fa918===_0x294daa(0x21b)){let {alias:_0x1c4f08,task:_0x450785,priority:_0x2d8bcb}=_0x2dad82,_0x5c1d42=await P('send_task',{'alias':_0x1c4f08,'task':_0x450785,'priority':_0x2d8bcb||_0x294daa(0x1bd),'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x294daa(0x1b2)](_0x5c1d42)}]};}if(_0x4fa918===_0x294daa(0x22a)){let {alias:_0x2967ba,message:_0x32f466}=_0x2dad82,_0x5658cc=await P(_0x294daa(0x1de),{'alias':_0x2967ba,'message':_0x32f466,'from_session':Z});return{'content':[{'type':_0x294daa(0x21f),'text':JSON[_0x294daa(0x1b2)](_0x5658cc)}]};}if(_0x4fa918===_0x294daa(0x1e5)){let _0x2c6015=await P(_0x294daa(0x21c),{});return{'content':[{'type':'text','text':JSON['stringify'](_0x2c6015)}]};}return{'content':[{'type':_0x294daa(0x21f),'text':JSON[_0x294daa(0x1b2)]({'error':_0x294daa(0x1d9)})}]};});function a0_0x8d7b(){const _0x331374=['5NoHJVr','replied','commhub_reply','report_status','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','blocked','MCP\x20stdio\x20connected','tools/call','message','startsWith','...\x20TMUX=','no\x20response','alias','stderr','←\x20message\x20from\x20','Task\x20content','/mcp','commhub_send_task','get_all_status','then','SSE\x20error:\x20','text','stdin','/events/','\x20ALIAS=','.anet','message_id','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','.claude/channels/commhub','connected','trim','2.0','commhub_send_message','\x20PROJECT_ENV=','messages','completed','read','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','length','commhub','from_session','warning:\x20could\x20not\x20register:\x20','find','\x20RESUME_ID=','application/json',']\x20[commhub]\x20','POST','new_message','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.',':\x20inbox_count=','delete','Current\x20task\x20description','priority','application/json,\x20text/event-stream','0.3.0','SSE\x20fatal:\x20','SIGINT','end','working','notifications/claude/channel','575839DarfrE','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','stringify','pop','shutting\x20down,\x20reporting\x20offline...','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','hub','none','connect','starting\x20SSE\x20listener...','result','content','SSE\x20connection\x20error:\x20','normal','catch','parse','error','send_reply','commhub-channel','low','commhub_report_status','in_progress','idle','Bearer\x20','connecting\x20to\x20','Target\x20session\x20alias','params','slice','cancelled','Progress\x200-100','.env','write','type','44aVsPiB','→\x20injected\x20task\x20','\x20CWD=','config.json','ack_inbox','session\x20disconnected','broadcast','new_task','unknown\x20tool','72927BZgnUF','Message\x20content','claude-code','324549jrsntU','send_message','ENV:\x20URL=','850871pbbBCG','ready\x20—\x20waiting\x20for\x20events','\x20from\x20','failed','exit','commhub_get_all_status','get_inbox','number','set','inbox_count','79462IupCNp','from','registered\x20as\x20\x22','cwd','replace','utf-8','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','data:\x20','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','CommHub\x20init\x20failed:\x20','status','\x20priority=','parse\x20error:\x20','Session\x20alias:\x20','6xPJxCM','object','heartbeat\x20failed:\x20','\x22\x20(','Reply\x20text\x20/\x20result\x20summary','split','token','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','decode','30jRGYcw','string','8luRcEK','2001520VvltNZ','setRequestHandler','4674108iizisl','fatal:\x20','notification','http://127.0.0.1:9200'];a0_0x8d7b=function(){return _0x331374;};return a0_0x8d7b();}async function u(){const _0x28dc1c=a0_0x2c6966;let _0x435ebb=f+_0x28dc1c(0x221)+encodeURIComponent(Z),_0x4b1f20={};if(X)_0x4b1f20['Authorization']='Bearer\x20'+X;Y(_0x28dc1c(0x1c8)+_0x435ebb);while(!0x0){try{let _0x38de73=await fetch(_0x435ebb,{'headers':_0x4b1f20});if(!_0x38de73['ok']){Y(_0x28dc1c(0x21e)+_0x38de73[_0x28dc1c(0x1f4)]+'\x20'+_0x38de73['statusText']),await h(0x1388);continue;}let _0x433089=_0x38de73['body']['getReader'](),_0x3505d2=new TextDecoder(),_0x153126='';while(!0x0){let {done:_0x3e8eda,value:_0x5ecb7b}=await _0x433089[_0x28dc1c(0x22e)]();if(_0x3e8eda)break;_0x153126+=_0x3505d2[_0x28dc1c(0x200)](_0x5ecb7b,{'stream':!0x0});let _0x4625eb=_0x153126[_0x28dc1c(0x1fd)]('\x0a\x0a');_0x153126=_0x4625eb[_0x28dc1c(0x1b3)]()||'';for(let _0x34096a of _0x4625eb){let _0x149c21=_0x34096a[_0x28dc1c(0x1fd)]('\x0a')[_0x28dc1c(0x234)](_0x32e816=>_0x32e816[_0x28dc1c(0x213)](_0x28dc1c(0x1f1)));if(!_0x149c21)continue;try{let _0x3db593=JSON['parse'](_0x149c21[_0x28dc1c(0x1cb)](0x6));await S(_0x3db593);}catch(_0x14be83){Y(_0x28dc1c(0x1f6)+_0x14be83);}}}Y('SSE\x20stream\x20ended,\x20reconnecting...');}catch(_0x3885c6){Y(_0x28dc1c(0x1bc)+_0x3885c6);}await h(0xbb8);}}async function S(_0x38f44c){const _0x46c401=a0_0x2c6966;if(_0x38f44c['type']===_0x46c401(0x227)){Y('SSE\x20connected\x20as\x20\x22'+Z+'\x22');return;}if(_0x38f44c[_0x46c401(0x1d0)]===_0x46c401(0x1a3)){if(Y(_0x46c401(0x218)+_0x38f44c[_0x46c401(0x1eb)]+':\x20'+_0x38f44c['message']['slice'](0x0,0x3c)),await K['notification']({'method':_0x46c401(0x1af),'params':{'content':_0x38f44c[_0x46c401(0x212)],'meta':{'sender':_0x38f44c['from']||'hub','sender_id':_0x46c401(0x231),'user':_0x38f44c[_0x46c401(0x1eb)]||_0x46c401(0x1b6),'priority':'normal'}}}),_0x38f44c[_0x46c401(0x224)])await P(_0x46c401(0x1d5),{'alias':Z,'message_id':_0x38f44c[_0x46c401(0x224)]});return;}if(_0x38f44c[_0x46c401(0x1d0)]===_0x46c401(0x1d8)||_0x38f44c['type']===_0x46c401(0x1d7)){Y('←\x20'+_0x38f44c[_0x46c401(0x1d0)]+_0x46c401(0x1a5)+_0x38f44c[_0x46c401(0x1e9)]+_0x46c401(0x1f5)+(_0x38f44c[_0x46c401(0x1a8)]||_0x46c401(0x1bd)));let _0x3c6387=await P(_0x46c401(0x1e6),{'alias':Z,'limit':0x5});if(_0x3c6387?.['ok']&&_0x3c6387[_0x46c401(0x22c)]?.[_0x46c401(0x230)]>0x0)for(let _0x42a0c5 of _0x3c6387[_0x46c401(0x22c)]){let _0x5ef18e={'sender':_0x42a0c5[_0x46c401(0x232)]||_0x46c401(0x1b6),'sender_id':_0x46c401(0x231),'user':_0x42a0c5[_0x46c401(0x232)]||_0x46c401(0x1b6),'task_id':_0x42a0c5['id'],'priority':_0x42a0c5[_0x46c401(0x1a8)]||_0x46c401(0x1bd)};k[_0x46c401(0x1e8)](_0x42a0c5['id'],_0x42a0c5['from_session']||'hub'),await K[_0x46c401(0x208)]({'method':_0x46c401(0x1af),'params':{'content':_0x42a0c5[_0x46c401(0x1bb)],'meta':_0x5ef18e}}),Y(_0x46c401(0x1d2)+_0x42a0c5['id']['slice'](0x0,0x8)+_0x46c401(0x1e2)+_0x42a0c5[_0x46c401(0x232)]+':\x20'+_0x42a0c5[_0x46c401(0x1bb)][_0x46c401(0x1cb)](0x0,0x3c)),await P('ack_inbox',{'alias':Z,'message_id':_0x42a0c5['id']});}}}async function A(){const _0x3e3ed4=a0_0x2c6966;let _0x9bc33f=new a0_0x41583a();await K[_0x3e3ed4(0x1b8)](_0x9bc33f),Y(_0x3e3ed4(0x210)),Y(_0x3e3ed4(0x1b9)),u()[_0x3e3ed4(0x1be)](_0x53487f=>Y(_0x3e3ed4(0x1ab)+_0x53487f)),P('report_status',{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x4a6714(),'hostname':a0_0x4a6714(),'agent':_0x3e3ed4(0x1dc),'project_dir':process[_0x3e3ed4(0x1ed)](),'tmux_name':j||void 0x0})[_0x3e3ed4(0x21d)](()=>Y(_0x3e3ed4(0x1ec)+Z+_0x3e3ed4(0x1fb)+w[_0x3e3ed4(0x1cb)](0x0,0x8)+')'))['catch'](_0x2c5d80=>Y(_0x3e3ed4(0x233)+_0x2c5d80)),setInterval(()=>{const _0x31a41e=_0x3e3ed4;P(_0x31a41e(0x20d),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x4a6714(),'hostname':a0_0x4a6714(),'agent':_0x31a41e(0x1dc),'project_dir':process[_0x31a41e(0x1ed)](),'tmux_name':j||void 0x0})[_0x31a41e(0x1be)](_0x5bad19=>Y(_0x31a41e(0x1fa)+_0x5bad19));},0x2bf20),Y(_0x3e3ed4(0x1e1));}A()[a0_0x2c6966(0x1be)](_0xd3919e=>{const _0x362603=a0_0x2c6966;Y(_0x362603(0x207)+_0xd3919e),process[_0x362603(0x1e4)](0x1);});async function N(){const _0x44ab4d=a0_0x2c6966;Y(_0x44ab4d(0x1b4)),await P(_0x44ab4d(0x20d),{'resume_id':w,'alias':Z,'status':'error','task':_0x44ab4d(0x1d6)})[_0x44ab4d(0x1be)](()=>{}),process[_0x44ab4d(0x1e4)](0x0);}process[a0_0x2c6966(0x220)]['on'](a0_0x2c6966(0x1ad),()=>N()),process['on']('SIGTERM',()=>N()),process['on'](a0_0x2c6966(0x1ac),()=>N());
2
+ const a0_0x4591e0=a0_0x3493;(function(_0x881268,_0x3dd974){const _0x338b9e=a0_0x3493,_0x214f61=_0x881268();while(!![]){try{const _0x1e5920=parseInt(_0x338b9e(0x16c))/0x1+parseInt(_0x338b9e(0xf4))/0x2+parseInt(_0x338b9e(0x113))/0x3+parseInt(_0x338b9e(0x147))/0x4+parseInt(_0x338b9e(0x15a))/0x5*(parseInt(_0x338b9e(0x141))/0x6)+parseInt(_0x338b9e(0x15e))/0x7*(-parseInt(_0x338b9e(0x115))/0x8)+-parseInt(_0x338b9e(0x142))/0x9;if(_0x1e5920===_0x3dd974)break;else _0x214f61['push'](_0x214f61['shift']());}catch(_0x4832b9){_0x214f61['push'](_0x214f61['shift']());}}}(a0_0xa148,0x65731));import{readFileSync as a0_0x5ecde2,existsSync as a0_0x82ca33}from'fs';import{randomUUID as a0_0xb40cef}from'crypto';function a0_0xa148(){const _0x235aee=['Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','status','\x20CWD=','SSE\x20fatal:\x20','tmux\x20display-message\x20-p\x20\x27#S\x27','commhub_send_task','commhub_send_message','commhub','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','find','SSE\x20stream\x20ended,\x20reconnecting...','text','idle','send_task','hub','utf-8','message','then','fatal:\x20','broadcast','send_message','ready\x20—\x20waiting\x20for\x20events','shutting\x20down,\x20reporting\x20offline...','2.0','\x20priority=','config.json','2279724GqhmAt','14914836QoBFwz','content','MCP\x20stdio\x20connected','/events/','split','2504192KLrxUI','task','\x22\x20(','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','send_reply','initialize','replied','from_session',':\x20inbox_count=','SSE\x20error:\x20','\x20from\x20','http://127.0.0.1:9200','message_id','read','working','claude-code','POST','session\x20disconnected','stdin','5OWjraN','Task\x20content','report_status','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','561981wdMKCQ','error','2025-03-26','get','←\x20message\x20from\x20','startsWith','slice','init\x20failed:\x20','from','low','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','inbox_count','none','stderr','723879BqyiEv','heartbeat\x20failed:\x20','/mcp','set','type','catch','data:\x20','SSE\x20connected\x20as\x20\x22','in_progress','Session\x20alias:\x20','getReader','blocked','stringify','replace','registered\x20as\x20\x22','0.3.0','1249606saqPMy','length','starting\x20SSE\x20listener...','messages','notification','Priority\x20(default:\x20normal)','notifications/claude/channel','Current\x20task\x20description','trim','CommHub\x20init\x20failed:\x20','Progress\x200-100','normal','high','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','completed','alias','failed','cwd','connect','unknown\x20tool','result','commhub_get_all_status','end','application/json','commhub-channel','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','toTimeString','new_message','Bearer\x20','commhub_reply','connected','1321812NpWIPu','commhub_report_status','72qsxboh','no\x20response','object','parse','pop','priority','ack_inbox','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','cancelled','statusText','.env','→\x20injected\x20task\x20','token','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','string','setRequestHandler','Target\x20session\x20alias','delete'];a0_0xa148=function(){return _0x235aee;};return a0_0xa148();}import{join as a0_0xdce509}from'path';function a0_0x3493(_0x424867,_0x1d91ca){_0x424867=_0x424867-0xee;const _0xa148c0=a0_0xa148();let _0x3493ae=_0xa148c0[_0x424867];return _0x3493ae;}import{hostname as a0_0x4d297a}from'os';import{execSync as a0_0x13af87}from'child_process';import{Server as a0_0x14e982}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x204c7c}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x2095c0,CallToolRequestSchema as a0_0x53b12e}from'@modelcontextprotocol/sdk/types.js';function p(_0x54ab75){const _0x267a30=a0_0x3493;if(!a0_0x82ca33(_0x54ab75))return;for(let _0x47d731 of a0_0x5ecde2(_0x54ab75,_0x267a30(0x136))[_0x267a30(0x146)]('\x0a')){let _0x4d23a9=_0x47d731[_0x267a30(0xfc)]();if(!_0x4d23a9||_0x4d23a9[_0x267a30(0x163)]('#'))continue;let _0x22010f=_0x4d23a9['indexOf']('=');if(_0x22010f<0x0)continue;let _0x5b18f9=_0x4d23a9['slice'](0x0,_0x22010f)[_0x267a30(0xfc)](),_0x7dac86=_0x4d23a9[_0x267a30(0x164)](_0x22010f+0x1)[_0x267a30(0xfc)]()['replace'](/^["']|["']$/g,'');if(!process.env[_0x5b18f9])process.env[_0x5b18f9]=_0x7dac86;}}var C=process.env.HOME||'~',T=a0_0xdce509(C,'.claude/channels/commhub');p(a0_0xdce509(T,a0_0x4591e0(0x11f)));var L=process[a0_0x4591e0(0x105)]()[a0_0x4591e0(0xf1)](/\//g,'-');p(a0_0xdce509(T,L,a0_0x4591e0(0x11f)));function U(){const _0x2d7f11=a0_0x4591e0;try{return a0_0x13af87(_0x2d7f11(0x12b),{'encoding':'utf-8','timeout':0x7d0})[_0x2d7f11(0xfc)]();}catch{return'';}}function v(){const _0x402950=a0_0x4591e0;try{let _0x276d1d=a0_0xdce509(C,'.anet',_0x402950(0x140));if(a0_0x82ca33(_0x276d1d))return JSON['parse'](a0_0x5ecde2(_0x276d1d,_0x402950(0x136)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x4591e0(0x135)]||a0_0x4591e0(0x152),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x4d297a(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0xb40cef(),X=process.env.COMMHUB_TOKEN||H[a0_0x4591e0(0x121)]||'';function Y(_0x4ab43a){const _0x260d69=a0_0x4591e0;let _0xfd2aa9=new Date()[_0x260d69(0x10e)]()['slice'](0x0,0x8);process[_0x260d69(0x16b)]['write']('['+_0xfd2aa9+']\x20[commhub]\x20'+_0x4ab43a+'\x0a');}function h(_0x2427f6){return new Promise(_0x41533c=>setTimeout(_0x41533c,_0x2427f6));}Y('ENV:\x20URL='+f+'\x20ALIAS='+Z+'\x20RESUME_ID='+w['slice'](0x0,0x8)+'...\x20TMUX='+(j||a0_0x4591e0(0x16a))+a0_0x4591e0(0x129)+process['cwd']()+'\x20PROJECT_ENV='+L);var k=new Map(),K=new a0_0x14e982({'name':a0_0x4591e0(0x10c),'version':a0_0x4591e0(0xf3)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x4591e0(0x10d),a0_0x4591e0(0x15d),a0_0x4591e0(0x101),'You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.',a0_0x4591e0(0x175)+Z]['join']('\x0a')});K['setRequestHandler'](a0_0x2095c0,async()=>({'tools':[{'name':a0_0x4591e0(0x111),'description':a0_0x4591e0(0x122),'inputSchema':{'type':a0_0x4591e0(0x117),'properties':{'task_id':{'type':a0_0x4591e0(0x123),'description':a0_0x4591e0(0x168)},'text':{'type':'string','description':'Reply\x20text\x20/\x20result\x20summary'},'status':{'type':a0_0x4591e0(0x123),'enum':[a0_0x4591e0(0x102),a0_0x4591e0(0x104),'cancelled',a0_0x4591e0(0xef),a0_0x4591e0(0x15f),a0_0x4591e0(0x174)],'description':a0_0x4591e0(0x11c)}},'required':[a0_0x4591e0(0x132)]}},{'name':a0_0x4591e0(0x114),'description':a0_0x4591e0(0x14a),'inputSchema':{'type':a0_0x4591e0(0x117),'properties':{'status':{'type':a0_0x4591e0(0x123),'enum':[a0_0x4591e0(0x155),a0_0x4591e0(0x133),a0_0x4591e0(0xef),a0_0x4591e0(0x15f)]},'task':{'type':a0_0x4591e0(0x123),'description':a0_0x4591e0(0xfb)},'progress':{'type':'number','description':a0_0x4591e0(0xfe)}},'required':['status']}},{'name':a0_0x4591e0(0x12c),'description':a0_0x4591e0(0x12f),'inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x4591e0(0x123),'description':'Target\x20session\x20alias'},'task':{'type':a0_0x4591e0(0x123),'description':a0_0x4591e0(0x15b)},'priority':{'type':'string','enum':[a0_0x4591e0(0x100),a0_0x4591e0(0xff),a0_0x4591e0(0x167)],'description':a0_0x4591e0(0xf9)}},'required':[a0_0x4591e0(0x103),a0_0x4591e0(0x148)]}},{'name':a0_0x4591e0(0x12d),'description':a0_0x4591e0(0x127),'inputSchema':{'type':a0_0x4591e0(0x117),'properties':{'alias':{'type':a0_0x4591e0(0x123),'description':a0_0x4591e0(0x125)},'message':{'type':a0_0x4591e0(0x123),'description':'Message\x20content'}},'required':[a0_0x4591e0(0x103),a0_0x4591e0(0x137)]}},{'name':'commhub_get_all_status','description':'Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','inputSchema':{'type':'object','properties':{}}}]}));async function P(_0xfe3fb5,_0x1d9c3d){const _0x13f62b=a0_0x4591e0;let _0x20b663=await fetch(f+_0x13f62b(0x16e),{'method':'POST','headers':{'Content-Type':_0x13f62b(0x10b),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x13f62b(0x110)+X}:{}},'body':JSON[_0x13f62b(0xf0)]({'jsonrpc':_0x13f62b(0x13e),'id':0x1,'method':_0x13f62b(0x14c),'params':{'protocolVersion':_0x13f62b(0x160),'capabilities':{},'clientInfo':{'name':_0x13f62b(0x10c),'version':_0x13f62b(0xf3)}}})});if(!_0x20b663['ok']){let _0x4be6d2=await _0x20b663['text']();return Y(_0x13f62b(0xfd)+_0x20b663[_0x13f62b(0x128)]+'\x20'+_0x4be6d2[_0x13f62b(0x164)](0x0,0x64)),{'ok':!0x1,'error':_0x13f62b(0x165)+_0x20b663[_0x13f62b(0x128)]};}await _0x20b663[_0x13f62b(0x132)]();let _0x2a7842=(await(await fetch(f+_0x13f62b(0x16e),{'method':_0x13f62b(0x157),'headers':{'Content-Type':_0x13f62b(0x10b),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x13f62b(0x110)+X}:{}},'body':JSON['stringify']({'jsonrpc':'2.0','id':0x2,'method':'tools/call','params':{'name':_0xfe3fb5,'arguments':_0x1d9c3d}})}))['text']())[_0x13f62b(0x146)]('\x0a')[_0x13f62b(0x130)](_0x3471ef=>_0x3471ef[_0x13f62b(0x163)]('data:\x20'));if(_0x2a7842){let _0x312c6e=JSON[_0x13f62b(0x118)](_0x2a7842['slice'](0x6));return _0x312c6e?.[_0x13f62b(0x108)]?.[_0x13f62b(0x143)]?.[0x0]?.[_0x13f62b(0x132)]?JSON[_0x13f62b(0x118)](_0x312c6e[_0x13f62b(0x108)][_0x13f62b(0x143)][0x0][_0x13f62b(0x132)]):_0x312c6e;}return{'ok':!0x1,'error':_0x13f62b(0x116)};}K[a0_0x4591e0(0x124)](a0_0x53b12e,async _0x17c716=>{const _0x2a3b8f=a0_0x4591e0;let {name:_0x2c883b,arguments:_0x198854}=_0x17c716['params'];if(_0x2c883b==='commhub_reply'){let {task_id:_0x5acee3,text:_0x73541d,status:_0x264cdc}=_0x198854;if(_0x264cdc==='completed'||_0x264cdc==='failed'||_0x264cdc===_0x2a3b8f(0x11d)){let _0x2580c0=_0x264cdc===_0x2a3b8f(0x102)?_0x2a3b8f(0x14d):_0x264cdc,_0x4f6cf=_0x5acee3?k[_0x2a3b8f(0x161)](_0x5acee3)||_0x2a3b8f(0x135):_0x2a3b8f(0x135),_0x3e4de9=await P(_0x2a3b8f(0x14b),{'alias':_0x4f6cf,'text':_0x73541d,'in_reply_to':_0x5acee3||void 0x0,'status':_0x2580c0,'from_session':Z});if(_0x5acee3)k[_0x2a3b8f(0x126)](_0x5acee3);return{'content':[{'type':'text','text':JSON[_0x2a3b8f(0xf0)](_0x3e4de9)}]};}let _0x378829=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x264cdc==='blocked'?_0x2a3b8f(0xef):_0x264cdc===_0x2a3b8f(0x15f)?'error':'working','task':_0x73541d[_0x2a3b8f(0x164)](0x0,0xc8),'output':_0x73541d});return{'content':[{'type':_0x2a3b8f(0x132),'text':JSON[_0x2a3b8f(0xf0)](_0x378829)}]};}if(_0x2c883b===_0x2a3b8f(0x114)){let {status:_0x4175e2,task:_0x48a8e3,progress:_0x39f68d}=_0x198854,_0x4724e9=await P(_0x2a3b8f(0x15c),{'resume_id':w,'alias':Z,'status':_0x4175e2,'task':_0x48a8e3,'progress':_0x39f68d});return{'content':[{'type':_0x2a3b8f(0x132),'text':JSON[_0x2a3b8f(0xf0)](_0x4724e9)}]};}if(_0x2c883b==='commhub_send_task'){let {alias:_0x1c8b6e,task:_0x183b12,priority:_0x573c1b}=_0x198854,_0x389ba1=await P(_0x2a3b8f(0x134),{'alias':_0x1c8b6e,'task':_0x183b12,'priority':_0x573c1b||'normal','from_session':Z});return{'content':[{'type':_0x2a3b8f(0x132),'text':JSON['stringify'](_0x389ba1)}]};}if(_0x2c883b===_0x2a3b8f(0x12d)){let {alias:_0x437142,message:_0x255a72}=_0x198854,_0x25e080=await P(_0x2a3b8f(0x13b),{'alias':_0x437142,'message':_0x255a72,'from_session':Z});return{'content':[{'type':_0x2a3b8f(0x132),'text':JSON[_0x2a3b8f(0xf0)](_0x25e080)}]};}if(_0x2c883b===_0x2a3b8f(0x109)){let _0x1fdc1a=await P('get_all_status',{});return{'content':[{'type':_0x2a3b8f(0x132),'text':JSON[_0x2a3b8f(0xf0)](_0x1fdc1a)}]};}return{'content':[{'type':'text','text':JSON[_0x2a3b8f(0xf0)]({'error':_0x2a3b8f(0x107)})}]};});async function u(){const _0x3a4239=a0_0x4591e0;let _0x4ad2ec=f+_0x3a4239(0x145)+encodeURIComponent(Z),_0x19c109={};if(X)_0x19c109['Authorization']=_0x3a4239(0x110)+X;Y('connecting\x20to\x20'+_0x4ad2ec);while(!0x0){try{let _0x58b6c9=await fetch(_0x4ad2ec,{'headers':_0x19c109});if(!_0x58b6c9['ok']){Y(_0x3a4239(0x150)+_0x58b6c9['status']+'\x20'+_0x58b6c9[_0x3a4239(0x11e)]),await h(0x1388);continue;}let _0x28488c=_0x58b6c9['body'][_0x3a4239(0xee)](),_0x2a9049=new TextDecoder(),_0x1c0849='';while(!0x0){let {done:_0x3e6a2e,value:_0x4c612c}=await _0x28488c[_0x3a4239(0x154)]();if(_0x3e6a2e)break;_0x1c0849+=_0x2a9049['decode'](_0x4c612c,{'stream':!0x0});let _0x44a8cf=_0x1c0849['split']('\x0a\x0a');_0x1c0849=_0x44a8cf[_0x3a4239(0x119)]()||'';for(let _0xd55b31 of _0x44a8cf){let _0x1585d3=_0xd55b31[_0x3a4239(0x146)]('\x0a')[_0x3a4239(0x130)](_0x349fc0=>_0x349fc0[_0x3a4239(0x163)](_0x3a4239(0x172)));if(!_0x1585d3)continue;try{let _0x278d45=JSON[_0x3a4239(0x118)](_0x1585d3[_0x3a4239(0x164)](0x6));await S(_0x278d45);}catch(_0x5bc5ff){Y('parse\x20error:\x20'+_0x5bc5ff);}}}Y(_0x3a4239(0x131));}catch(_0xa8918c){Y('SSE\x20connection\x20error:\x20'+_0xa8918c);}await h(0xbb8);}}async function S(_0x3ef172){const _0x5a5ace=a0_0x4591e0;if(_0x3ef172[_0x5a5ace(0x170)]===_0x5a5ace(0x112)){Y(_0x5a5ace(0x173)+Z+'\x22');return;}if(_0x3ef172[_0x5a5ace(0x170)]===_0x5a5ace(0x10f)){if(Y(_0x5a5ace(0x162)+_0x3ef172[_0x5a5ace(0x166)]+':\x20'+_0x3ef172[_0x5a5ace(0x137)][_0x5a5ace(0x164)](0x0,0x3c)),await K[_0x5a5ace(0xf8)]({'method':'notifications/claude/channel','params':{'content':_0x3ef172[_0x5a5ace(0x137)],'meta':{'sender':_0x3ef172[_0x5a5ace(0x166)]||'hub','sender_id':_0x5a5ace(0x12e),'user':_0x3ef172['from']||_0x5a5ace(0x135),'priority':_0x5a5ace(0xff)}}}),_0x3ef172[_0x5a5ace(0x153)])await P(_0x5a5ace(0x11b),{'alias':Z,'message_id':_0x3ef172['message_id']});return;}if(_0x3ef172[_0x5a5ace(0x170)]==='new_task'||_0x3ef172['type']===_0x5a5ace(0x13a)){Y('←\x20'+_0x3ef172[_0x5a5ace(0x170)]+_0x5a5ace(0x14f)+_0x3ef172[_0x5a5ace(0x169)]+_0x5a5ace(0x13f)+(_0x3ef172[_0x5a5ace(0x11a)]||'normal'));let _0x346f5a=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0x346f5a?.['ok']&&_0x346f5a[_0x5a5ace(0xf7)]?.[_0x5a5ace(0xf5)]>0x0)for(let _0x20fa7b of _0x346f5a[_0x5a5ace(0xf7)]){let _0x1b5ae0={'sender':_0x20fa7b['from_session']||_0x5a5ace(0x135),'sender_id':_0x5a5ace(0x12e),'user':_0x20fa7b[_0x5a5ace(0x14e)]||_0x5a5ace(0x135),'task_id':_0x20fa7b['id'],'priority':_0x20fa7b[_0x5a5ace(0x11a)]||_0x5a5ace(0xff)};k[_0x5a5ace(0x16f)](_0x20fa7b['id'],_0x20fa7b[_0x5a5ace(0x14e)]||'hub'),await K[_0x5a5ace(0xf8)]({'method':_0x5a5ace(0xfa),'params':{'content':_0x20fa7b[_0x5a5ace(0x143)],'meta':_0x1b5ae0}}),Y(_0x5a5ace(0x120)+_0x20fa7b['id']['slice'](0x0,0x8)+_0x5a5ace(0x151)+_0x20fa7b[_0x5a5ace(0x14e)]+':\x20'+_0x20fa7b[_0x5a5ace(0x143)]['slice'](0x0,0x3c)),await P(_0x5a5ace(0x11b),{'alias':Z,'message_id':_0x20fa7b['id']});}}}async function A(){const _0x5d603f=a0_0x4591e0;let _0x398224=new a0_0x204c7c();await K[_0x5d603f(0x106)](_0x398224),Y(_0x5d603f(0x144)),Y(_0x5d603f(0xf6)),u()[_0x5d603f(0x171)](_0x50c572=>Y(_0x5d603f(0x12a)+_0x50c572)),P(_0x5d603f(0x15c),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x4d297a(),'hostname':a0_0x4d297a(),'agent':_0x5d603f(0x156),'project_dir':process[_0x5d603f(0x105)](),'tmux_name':j||void 0x0})[_0x5d603f(0x138)](()=>Y(_0x5d603f(0xf2)+Z+_0x5d603f(0x149)+w['slice'](0x0,0x8)+')'))[_0x5d603f(0x171)](_0x5d81a9=>Y('warning:\x20could\x20not\x20register:\x20'+_0x5d81a9)),setInterval(()=>{const _0x2a2505=_0x5d603f;P(_0x2a2505(0x15c),{'resume_id':w,'alias':Z,'status':_0x2a2505(0x133),'server':a0_0x4d297a(),'hostname':a0_0x4d297a(),'agent':'claude-code','project_dir':process[_0x2a2505(0x105)](),'tmux_name':j||void 0x0})[_0x2a2505(0x171)](_0x459243=>Y(_0x2a2505(0x16d)+_0x459243));},0x2bf20),Y(_0x5d603f(0x13c));}A()[a0_0x4591e0(0x171)](_0x25f99b=>{const _0x14e72f=a0_0x4591e0;Y(_0x14e72f(0x139)+_0x25f99b),process['exit'](0x1);});async function N(){const _0x155c56=a0_0x4591e0;Y(_0x155c56(0x13d)),await P(_0x155c56(0x15c),{'resume_id':w,'alias':Z,'status':_0x155c56(0x15f),'task':_0x155c56(0x158)})['catch'](()=>{}),process['exit'](0x0);}process[a0_0x4591e0(0x159)]['on'](a0_0x4591e0(0x10a),()=>N()),process['on']('SIGTERM',()=>N()),process['on']('SIGINT',()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.2.6-preview.0",
3
+ "version": "2.2.6",
4
4
  "description": "AI Agent Network CLI — Create multi-agent networks with user management, network isolation, and 3 AI runtimes (Claude/Codex/MiniMax). 39 commands.",
5
5
  "type": "module",
6
6
  "main": "dist/src/client.js",