@sleep2agi/agent-network 2.2.5 → 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
- const a0_0x829f8b=a0_0x1d67;(function(_0x1e82a2,_0x2ad6ed){const _0x4ce3ef=a0_0x1d67,_0x4b21de=_0x1e82a2();while(!![]){try{const _0x35c2d5=parseInt(_0x4ce3ef(0x179))/0x1*(parseInt(_0x4ce3ef(0x17b))/0x2)+-parseInt(_0x4ce3ef(0x147))/0x3*(-parseInt(_0x4ce3ef(0x185))/0x4)+parseInt(_0x4ce3ef(0x18a))/0x5+-parseInt(_0x4ce3ef(0x169))/0x6+parseInt(_0x4ce3ef(0x142))/0x7+-parseInt(_0x4ce3ef(0x15f))/0x8*(-parseInt(_0x4ce3ef(0x184))/0x9)+-parseInt(_0x4ce3ef(0x15e))/0xa*(parseInt(_0x4ce3ef(0x144))/0xb);if(_0x35c2d5===_0x2ad6ed)break;else _0x4b21de['push'](_0x4b21de['shift']());}catch(_0x1d5c32){_0x4b21de['push'](_0x4b21de['shift']());}}}(a0_0x62e4,0x34ca2));function a0_0x62e4(){const _0x172395=['36464LSIxvX','reconnectDelay','name','call','/mcp','body','broadcast','slice','SSE\x20failed:\x20','reply','283806JiWAbW','new_message','application/json','catch','alias','emit','getReader','processInbox','connect','Authorization','application/json,\x20text/event-stream','heartbeatInterval','agent','new_task','disconnected','normal','380452XakUkg','token','2CmZPcY','split','message','decode','url','toTimeString','text/event-stream','inbox\x20error:\x20',']\x20[commhub:','270bGpisX','60GDnnSp','startsWith','sleep','status','content','1728630HUxUbH','match','messages','task','min','cwd','completed','offline','send_task','read','parse','data:\x20','pop','connected','3017742KLOXMi','sseAbort','2503292xGALbu','SSE\x20error:\x20','send_message','66987DrNVCz','s...','running','now','from_session','Bearer\x20','get_inbox','error','idle','send_reply','resumeId','replace','log','ack_inbox','POST','result','type','autoConnect','AbortError','heartbeat\x20failed:\x20','text','heartbeatTimer','server','60sFIFFE'];a0_0x62e4=function(){return _0x172395;};return a0_0x62e4();}import{EventEmitter as a0_0x52d6d6}from'events';function a0_0x1d67(_0x22cdcf,_0x295be9){_0x22cdcf=_0x22cdcf-0x137;const _0x62e43f=a0_0x62e4();let _0x1d6796=_0x62e43f[_0x22cdcf];return _0x1d6796;}import{hostname as a0_0x4c70ed}from'os';class T extends a0_0x52d6d6{['url'];['alias'];[a0_0x829f8b(0x17a)];['agent'];['resumeId'];['heartbeatInterval'];[a0_0x829f8b(0x160)];['heartbeatTimer'];['sseAbort'];[a0_0x829f8b(0x149)]=!0x1;constructor(_0x5a3425){const _0x505ff6=a0_0x829f8b;super();if(this[_0x505ff6(0x17f)]=_0x5a3425[_0x505ff6(0x17f)][_0x505ff6(0x152)](/\/$/,''),this['alias']=_0x5a3425[_0x505ff6(0x16d)],this[_0x505ff6(0x17a)]=_0x5a3425[_0x505ff6(0x17a)],this[_0x505ff6(0x175)]=_0x5a3425[_0x505ff6(0x175)]||'sdk',this[_0x505ff6(0x151)]='sdk-'+_0x5a3425[_0x505ff6(0x16d)]+'-'+Date[_0x505ff6(0x14a)]()['toString'](0x24),this[_0x505ff6(0x174)]=_0x5a3425[_0x505ff6(0x174)]??0x2bf20,this[_0x505ff6(0x160)]=_0x5a3425[_0x505ff6(0x160)]??0xbb8,_0x5a3425[_0x505ff6(0x158)]!==!0x1)this['connect']();}[a0_0x829f8b(0x153)](_0x58d1a9){const _0x66f00f=a0_0x829f8b;console[_0x66f00f(0x153)]('['+new Date()[_0x66f00f(0x180)]()[_0x66f00f(0x166)](0x0,0x8)+_0x66f00f(0x183)+this['alias']+']\x20'+_0x58d1a9);}async['call'](_0x55e3d3,_0x933145){const _0x59d44d=a0_0x829f8b;let _0x528b62={'Content-Type':_0x59d44d(0x16b),'Accept':_0x59d44d(0x173)};if(this['token'])_0x528b62[_0x59d44d(0x172)]=_0x59d44d(0x14c)+this[_0x59d44d(0x17a)];let _0x38ac05=await(await fetch(this[_0x59d44d(0x17f)]+_0x59d44d(0x163),{'method':_0x59d44d(0x155),'headers':_0x528b62,'body':JSON['stringify']({'jsonrpc':'2.0','id':Date[_0x59d44d(0x14a)](),'method':'tools/call','params':{'name':_0x55e3d3,'arguments':_0x933145}})}))['text'](),_0x5ae2fa=_0x38ac05[_0x59d44d(0x18b)](/data: (.+)/),_0x1bf5d3=_0x5ae2fa?JSON[_0x59d44d(0x13e)](_0x5ae2fa[0x1]):JSON[_0x59d44d(0x13e)](_0x38ac05),_0x9dfcb5=_0x1bf5d3?.[_0x59d44d(0x156)]?.[_0x59d44d(0x189)]?.[0x0]?.[_0x59d44d(0x15b)];return _0x9dfcb5?JSON['parse'](_0x9dfcb5):_0x1bf5d3;}async[a0_0x829f8b(0x171)](){const _0x209425=a0_0x829f8b;if(this[_0x209425(0x149)])return;this[_0x209425(0x149)]=!0x0,await this[_0x209425(0x188)](_0x209425(0x14f)),this['log']('registered'),this[_0x209425(0x15c)]=setInterval(()=>{const _0x121314=_0x209425;this[_0x121314(0x188)](_0x121314(0x14f))[_0x121314(0x16c)](_0x413340=>this['log'](_0x121314(0x15a)+_0x413340['message']));},this[_0x209425(0x174)]),this['connectSSE']();}async['disconnect'](){const _0x1a5fa2=a0_0x829f8b;if(this[_0x1a5fa2(0x149)]=!0x1,this[_0x1a5fa2(0x143)]?.['abort'](),this[_0x1a5fa2(0x15c)])clearInterval(this[_0x1a5fa2(0x15c)]);await this[_0x1a5fa2(0x188)](_0x1a5fa2(0x13b))[_0x1a5fa2(0x16c)](()=>{}),this['log']('disconnected');}async['send'](_0x1238d7,_0xcd60ae,_0x4a09c2=a0_0x829f8b(0x178)){const _0x5025a8=a0_0x829f8b;return this['call'](_0x5025a8(0x13c),{'alias':_0x1238d7,'task':_0xcd60ae,'priority':_0x4a09c2,'from_session':this[_0x5025a8(0x16d)]});}async[a0_0x829f8b(0x17d)](_0xec61c6,_0x4e0f54){const _0xb2921b=a0_0x829f8b;return this[_0xb2921b(0x162)](_0xb2921b(0x146),{'alias':_0xec61c6,'message':_0x4e0f54,'from_session':this[_0xb2921b(0x16d)]});}async[a0_0x829f8b(0x168)](_0x3580b7,_0x255c5b,_0x471fb1=a0_0x829f8b(0x13a)){const _0x25c302=a0_0x829f8b;return this['call'](_0x25c302(0x150),{'in_reply_to':_0x3580b7,'text':_0x255c5b,'status':_0x471fb1});}async['status'](_0x39b804,_0x1f01ef){const _0x3dd2fa=a0_0x829f8b;return this[_0x3dd2fa(0x162)]('report_status',{'resume_id':this[_0x3dd2fa(0x151)],'alias':this['alias'],'status':_0x39b804,'server':a0_0x4c70ed(),'hostname':a0_0x4c70ed(),'agent':this[_0x3dd2fa(0x175)],'project_dir':process[_0x3dd2fa(0x139)](),..._0x1f01ef});}async['getAllStatus'](){return this['call']('get_all_status',{});}async['broadcast'](_0xd5580c,_0x47c25f){const _0x29e416=a0_0x829f8b;return this[_0x29e416(0x162)](_0x29e416(0x165),{'message':_0xd5580c,'filter_server':_0x47c25f?.[_0x29e416(0x15d)],'filter_status':_0x47c25f?.[_0x29e416(0x188)]});}async['connectSSE'](){const _0x24d5ea=a0_0x829f8b;let _0x122a5c=encodeURIComponent(this['alias']),_0x2a13c6=this[_0x24d5ea(0x17f)]+'/events/'+_0x122a5c,_0x479af5=this['reconnectDelay'];while(this[_0x24d5ea(0x149)]){try{this['sseAbort']=new AbortController();let _0x24f009={'Accept':_0x24d5ea(0x181)};if(this[_0x24d5ea(0x17a)])_0x24f009[_0x24d5ea(0x172)]=_0x24d5ea(0x14c)+this['token'];let _0x25ed5d=await fetch(_0x2a13c6,{'headers':_0x24f009,'signal':this[_0x24d5ea(0x143)]['signal']});if(!_0x25ed5d['ok']||!_0x25ed5d[_0x24d5ea(0x164)]){this[_0x24d5ea(0x153)](_0x24d5ea(0x167)+_0x25ed5d[_0x24d5ea(0x188)]),await this[_0x24d5ea(0x187)](_0x479af5),_0x479af5=Math[_0x24d5ea(0x138)](_0x479af5*1.5,0xea60);continue;}_0x479af5=this[_0x24d5ea(0x160)];let _0x563c10=_0x25ed5d[_0x24d5ea(0x164)][_0x24d5ea(0x16f)](),_0x1e487f=new TextDecoder(),_0x348da5='';while(this[_0x24d5ea(0x149)]){let {done:_0x3e4e12,value:_0x207c29}=await _0x563c10[_0x24d5ea(0x13d)]();if(_0x3e4e12)break;_0x348da5+=_0x1e487f[_0x24d5ea(0x17e)](_0x207c29,{'stream':!0x0});let _0x234d28=_0x348da5[_0x24d5ea(0x17c)]('\x0a');_0x348da5=_0x234d28[_0x24d5ea(0x140)]()||'';for(let _0x3c86e2 of _0x234d28){if(!_0x3c86e2[_0x24d5ea(0x186)](_0x24d5ea(0x13f)))continue;try{let _0x5ef4a6=JSON[_0x24d5ea(0x13e)](_0x3c86e2[_0x24d5ea(0x166)](0x6));if(_0x5ef4a6['type']===_0x24d5ea(0x141)){this[_0x24d5ea(0x153)]('SSE\x20connected'),this[_0x24d5ea(0x16e)](_0x24d5ea(0x141));continue;}if(_0x5ef4a6[_0x24d5ea(0x157)]===_0x24d5ea(0x176)||_0x5ef4a6[_0x24d5ea(0x157)]===_0x24d5ea(0x16a)||_0x5ef4a6['type']===_0x24d5ea(0x165))await this['processInbox']();}catch{}}}}catch(_0x363513){if(_0x363513[_0x24d5ea(0x161)]===_0x24d5ea(0x159))break;this['emit'](_0x24d5ea(0x14e),_0x363513),this[_0x24d5ea(0x153)](_0x24d5ea(0x145)+_0x363513[_0x24d5ea(0x17d)]);}if(this[_0x24d5ea(0x149)])this[_0x24d5ea(0x16e)](_0x24d5ea(0x177)),this[_0x24d5ea(0x153)]('SSE\x20reconnecting\x20in\x20'+_0x479af5/0x3e8+_0x24d5ea(0x148)),await this[_0x24d5ea(0x187)](_0x479af5),_0x479af5=Math[_0x24d5ea(0x138)](_0x479af5*1.5,0xea60);}}async[a0_0x829f8b(0x170)](){const _0x45ac76=a0_0x829f8b;try{let _0x1047cd=(await this[_0x45ac76(0x162)](_0x45ac76(0x14d),{'alias':this[_0x45ac76(0x16d)],'limit':0xa}))?.[_0x45ac76(0x18c)]||[];for(let _0x5cb470 of _0x1047cd)await this['call'](_0x45ac76(0x154),{'alias':this[_0x45ac76(0x16d)],'message_id':_0x5cb470['id']}),this[_0x45ac76(0x153)]('←\x20'+_0x5cb470[_0x45ac76(0x14b)]+':\x20'+_0x5cb470['content']['slice'](0x0,0x3c)),this[_0x45ac76(0x16e)](_0x45ac76(0x137),_0x5cb470),this['emit']('message',_0x5cb470);}catch(_0x2bcfaf){this[_0x45ac76(0x153)](_0x45ac76(0x182)+_0x2bcfaf[_0x45ac76(0x17d)]);}}['sleep'](_0x2d44a6){return new Promise(_0x521470=>setTimeout(_0x521470,_0x2d44a6));}}var $=T;export{$ as default,T as CommHub};
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_0x53a9fb=a0_0x1fd4;(function(_0x31ea6c,_0x2d2ff9){const _0x54a74b=a0_0x1fd4,_0x9e49b9=_0x31ea6c();while(!![]){try{const _0x404f4e=-parseInt(_0x54a74b(0x220))/0x1*(-parseInt(_0x54a74b(0x200))/0x2)+-parseInt(_0x54a74b(0x22c))/0x3+parseInt(_0x54a74b(0x240))/0x4+-parseInt(_0x54a74b(0x236))/0x5+parseInt(_0x54a74b(0x23e))/0x6*(-parseInt(_0x54a74b(0x1f7))/0x7)+parseInt(_0x54a74b(0x254))/0x8+parseInt(_0x54a74b(0x1fc))/0x9;if(_0x404f4e===_0x2d2ff9)break;else _0x9e49b9['push'](_0x9e49b9['shift']());}catch(_0x46797e){_0x9e49b9['push'](_0x9e49b9['shift']());}}}(a0_0x3c9d,0xa8ef4));import{readFileSync as a0_0x144e86,existsSync as a0_0x5484f0}from'fs';import{randomUUID as a0_0x382fc9}from'crypto';import{join as a0_0xf6487}from'path';import{hostname as a0_0x153e36}from'os';import{execSync as a0_0x48a134}from'child_process';import{Server as a0_0x4afe9c}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x86034}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x39805c,CallToolRequestSchema as a0_0x35f265}from'@modelcontextprotocol/sdk/types.js';function p(_0x14ad97){const _0xf2ae0a=a0_0x1fd4;if(!a0_0x5484f0(_0x14ad97))return;for(let _0x4fe77c of a0_0x144e86(_0x14ad97,_0xf2ae0a(0x206))[_0xf2ae0a(0x1e3)]('\x0a')){let _0x548fc8=_0x4fe77c[_0xf2ae0a(0x252)]();if(!_0x548fc8||_0x548fc8['startsWith']('#'))continue;let _0x4eb1b8=_0x548fc8['indexOf']('=');if(_0x4eb1b8<0x0)continue;let _0x314bb=_0x548fc8[_0xf2ae0a(0x216)](0x0,_0x4eb1b8)[_0xf2ae0a(0x252)](),_0x8b075f=_0x548fc8[_0xf2ae0a(0x216)](_0x4eb1b8+0x1)[_0xf2ae0a(0x252)]()[_0xf2ae0a(0x20d)](/^["']|["']$/g,'');if(!process.env[_0x314bb])process.env[_0x314bb]=_0x8b075f;}}var C=process.env.HOME||'~',T=a0_0xf6487(C,a0_0x53a9fb(0x248));p(a0_0xf6487(T,'.env'));var L=process[a0_0x53a9fb(0x247)]()[a0_0x53a9fb(0x20d)](/\//g,'-');p(a0_0xf6487(T,L,a0_0x53a9fb(0x222)));function U(){const _0x5c2c8a=a0_0x53a9fb;try{return a0_0x48a134('tmux\x20display-message\x20-p\x20\x27#S\x27',{'encoding':_0x5c2c8a(0x206),'timeout':0x7d0})[_0x5c2c8a(0x252)]();}catch{return'';}}function a0_0x3c9d(){const _0x11ed88=['inbox_count','from_session','init\x20failed:\x20','read','2289114ooScHH','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','commhub_send_task','send_reply','find','catch','body','commhub_send_message','Message\x20content','Session\x20alias:\x20','6631130RyipLU','Bearer\x20','→\x20injected\x20task\x20','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','...\x20TMUX=','exit','\x20CWD=','2.0','6DMCiQy','type','2366756wsdbPk','from','2025-03-26','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','shutting\x20down,\x20reporting\x20offline...','Reply\x20text\x20/\x20result\x20summary','commhub_report_status','cwd','.claude/channels/commhub','Target\x20session\x20alias','error','\x20RESUME_ID=','connect',']\x20[commhub]\x20','cancelled','get_inbox','ENV:\x20URL=','working','trim','Current\x20task\x20description','9033032iWcECH','http://127.0.0.1:9200','commhub_get_all_status','/mcp','blocked','\x22\x20(','SSE\x20connection\x20error:\x20','ack_inbox','string','completed','object','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','/events/','message','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','split','SSE\x20connected\x20as\x20\x22','no\x20response','ready\x20—\x20waiting\x20for\x20events','\x20from\x20','Priority\x20(default:\x20normal)','result','status','get','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','number','0.3.0','getReader','content','SIGTERM','idle','claude-code','hub','commhub','stderr','7279909pGvnBV','new_message','commhub-channel','end','SSE\x20error:\x20','7865649QHgJRI','toTimeString','alias','priority','2sbEYQv','warning:\x20could\x20not\x20register:\x20','text','parse','messages','stringify','utf-8','set','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','normal','none','Task\x20content','startsWith','replace','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','join','message_id','commhub_reply','connected','token','.anet','MCP\x20stdio\x20connected','slice','application/json,\x20text/event-stream','initialize','tools/call','starting\x20SSE\x20listener...','pop','data:\x20','low','setRequestHandler','params','1226428oVXRsp','failed','.env','in_progress','report_status','application/json','length','notifications/claude/channel'];a0_0x3c9d=function(){return _0x11ed88;};return a0_0x3c9d();}function v(){const _0x2b5034=a0_0x53a9fb;try{let _0x1e785e=a0_0xf6487(C,_0x2b5034(0x214),'config.json');if(a0_0x5484f0(_0x1e785e))return JSON[_0x2b5034(0x203)](a0_0x144e86(_0x1e785e,_0x2b5034(0x206)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x53a9fb(0x1f4)]||a0_0x53a9fb(0x255),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x153e36(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x382fc9(),X=process.env.COMMHUB_TOKEN||H[a0_0x53a9fb(0x213)]||'';function Y(_0x650ee9){const _0x1f9d69=a0_0x53a9fb;let _0x1292ef=new Date()[_0x1f9d69(0x1fd)]()['slice'](0x0,0x8);process[_0x1f9d69(0x1f6)]['write']('['+_0x1292ef+_0x1f9d69(0x24d)+_0x650ee9+'\x0a');}function a0_0x1fd4(_0x5c031b,_0x2f5ec2){_0x5c031b=_0x5c031b-0x1d7;const _0x3c9d0b=a0_0x3c9d();let _0x1fd479=_0x3c9d0b[_0x5c031b];return _0x1fd479;}function h(_0x4031b8){return new Promise(_0x4dfc1d=>setTimeout(_0x4dfc1d,_0x4031b8));}Y(a0_0x53a9fb(0x250)+f+'\x20ALIAS='+Z+a0_0x53a9fb(0x24b)+w[a0_0x53a9fb(0x216)](0x0,0x8)+a0_0x53a9fb(0x23a)+(j||a0_0x53a9fb(0x20a))+a0_0x53a9fb(0x23c)+process[a0_0x53a9fb(0x247)]()+'\x20PROJECT_ENV='+L);var k=new Map(),K=new a0_0x4afe9c({'name':a0_0x53a9fb(0x1f9),'version':'0.3.0'},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x53a9fb(0x1df),'These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.',a0_0x53a9fb(0x239),a0_0x53a9fb(0x243),a0_0x53a9fb(0x235)+Z][a0_0x53a9fb(0x20f)]('\x0a')});K[a0_0x53a9fb(0x21e)](a0_0x39805c,async()=>({'tools':[{'name':a0_0x53a9fb(0x211),'description':a0_0x53a9fb(0x20e),'inputSchema':{'type':a0_0x53a9fb(0x1de),'properties':{'task_id':{'type':a0_0x53a9fb(0x1dc),'description':a0_0x53a9fb(0x22d)},'text':{'type':a0_0x53a9fb(0x1dc),'description':a0_0x53a9fb(0x245)},'status':{'type':a0_0x53a9fb(0x1dc),'enum':[a0_0x53a9fb(0x1dd),a0_0x53a9fb(0x221),a0_0x53a9fb(0x24e),a0_0x53a9fb(0x1d8),'error',a0_0x53a9fb(0x223)],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':[a0_0x53a9fb(0x202)]}},{'name':a0_0x53a9fb(0x246),'description':a0_0x53a9fb(0x1e2),'inputSchema':{'type':a0_0x53a9fb(0x1de),'properties':{'status':{'type':a0_0x53a9fb(0x1dc),'enum':[a0_0x53a9fb(0x251),a0_0x53a9fb(0x1f2),a0_0x53a9fb(0x1d8),a0_0x53a9fb(0x24a)]},'task':{'type':a0_0x53a9fb(0x1dc),'description':a0_0x53a9fb(0x253)},'progress':{'type':a0_0x53a9fb(0x1ed),'description':'Progress\x200-100'}},'required':[a0_0x53a9fb(0x1ea)]}},{'name':a0_0x53a9fb(0x22e),'description':'Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x53a9fb(0x1dc),'description':a0_0x53a9fb(0x249)},'task':{'type':a0_0x53a9fb(0x1dc),'description':a0_0x53a9fb(0x20b)},'priority':{'type':'string','enum':['high','normal',a0_0x53a9fb(0x21d)],'description':a0_0x53a9fb(0x1e8)}},'required':['alias','task']}},{'name':a0_0x53a9fb(0x233),'description':a0_0x53a9fb(0x208),'inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x53a9fb(0x1dc),'description':a0_0x53a9fb(0x249)},'message':{'type':'string','description':a0_0x53a9fb(0x234)}},'required':[a0_0x53a9fb(0x1fe),'message']}},{'name':'commhub_get_all_status','description':a0_0x53a9fb(0x1ec),'inputSchema':{'type':a0_0x53a9fb(0x1de),'properties':{}}}]}));async function P(_0x355608,_0x224c95){const _0x240c79=a0_0x53a9fb;let _0x5f1141=await fetch(f+_0x240c79(0x1d7),{'method':'POST','headers':{'Content-Type':_0x240c79(0x225),'Accept':_0x240c79(0x217),...X?{'Authorization':_0x240c79(0x237)+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x240c79(0x23d),'id':0x1,'method':_0x240c79(0x218),'params':{'protocolVersion':_0x240c79(0x242),'capabilities':{},'clientInfo':{'name':_0x240c79(0x1f9),'version':_0x240c79(0x1ee)}}})});if(!_0x5f1141['ok']){let _0x3acae6=await _0x5f1141[_0x240c79(0x202)]();return Y('CommHub\x20init\x20failed:\x20'+_0x5f1141[_0x240c79(0x1ea)]+'\x20'+_0x3acae6[_0x240c79(0x216)](0x0,0x64)),{'ok':!0x1,'error':_0x240c79(0x22a)+_0x5f1141['status']};}await _0x5f1141[_0x240c79(0x202)]();let _0x4c552d=(await(await fetch(f+_0x240c79(0x1d7),{'method':'POST','headers':{'Content-Type':_0x240c79(0x225),'Accept':_0x240c79(0x217),...X?{'Authorization':_0x240c79(0x237)+X}:{}},'body':JSON['stringify']({'jsonrpc':'2.0','id':0x2,'method':_0x240c79(0x219),'params':{'name':_0x355608,'arguments':_0x224c95}})}))['text']())[_0x240c79(0x1e3)]('\x0a')['find'](_0x217eca=>_0x217eca[_0x240c79(0x20c)](_0x240c79(0x21c)));if(_0x4c552d){let _0x1eea04=JSON['parse'](_0x4c552d[_0x240c79(0x216)](0x6));return _0x1eea04?.['result']?.[_0x240c79(0x1f0)]?.[0x0]?.[_0x240c79(0x202)]?JSON[_0x240c79(0x203)](_0x1eea04[_0x240c79(0x1e9)]['content'][0x0]['text']):_0x1eea04;}return{'ok':!0x1,'error':_0x240c79(0x1e5)};}K[a0_0x53a9fb(0x21e)](a0_0x35f265,async _0x552426=>{const _0xec80cc=a0_0x53a9fb;let {name:_0x347c16,arguments:_0x212d8c}=_0x552426[_0xec80cc(0x21f)];if(_0x347c16==='commhub_reply'){let {task_id:_0x55f365,text:_0x1b7795,status:_0x452d72}=_0x212d8c;if(_0x452d72===_0xec80cc(0x1dd)||_0x452d72===_0xec80cc(0x221)||_0x452d72===_0xec80cc(0x24e)){let _0x61e01c=_0x452d72===_0xec80cc(0x1dd)?'replied':_0x452d72,_0x134549=_0x55f365?k[_0xec80cc(0x1eb)](_0x55f365)||'hub':_0xec80cc(0x1f4),_0x4af78b=await P(_0xec80cc(0x22f),{'alias':_0x134549,'text':_0x1b7795,'in_reply_to':_0x55f365||void 0x0,'status':_0x61e01c,'from_session':Z});if(_0x55f365)k['delete'](_0x55f365);return{'content':[{'type':_0xec80cc(0x202),'text':JSON[_0xec80cc(0x205)](_0x4af78b)}]};}let _0x3bde3b=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x452d72===_0xec80cc(0x1d8)?_0xec80cc(0x1d8):_0x452d72===_0xec80cc(0x24a)?_0xec80cc(0x24a):_0xec80cc(0x251),'task':_0x1b7795['slice'](0x0,0xc8),'output':_0x1b7795});return{'content':[{'type':_0xec80cc(0x202),'text':JSON[_0xec80cc(0x205)](_0x3bde3b)}]};}if(_0x347c16==='commhub_report_status'){let {status:_0x558d20,task:_0x2fcaa6,progress:_0x1a40c4}=_0x212d8c,_0xf3cb93=await P(_0xec80cc(0x224),{'resume_id':w,'alias':Z,'status':_0x558d20,'task':_0x2fcaa6,'progress':_0x1a40c4});return{'content':[{'type':_0xec80cc(0x202),'text':JSON[_0xec80cc(0x205)](_0xf3cb93)}]};}if(_0x347c16===_0xec80cc(0x22e)){let {alias:_0xfed9f5,task:_0x4e7638,priority:_0x40fd26}=_0x212d8c,_0x3b9718=await P('send_task',{'alias':_0xfed9f5,'task':_0x4e7638,'priority':_0x40fd26||_0xec80cc(0x209),'from_session':Z});return{'content':[{'type':_0xec80cc(0x202),'text':JSON[_0xec80cc(0x205)](_0x3b9718)}]};}if(_0x347c16===_0xec80cc(0x233)){let {alias:_0x2defcb,message:_0x5598d7}=_0x212d8c,_0x380b5e=await P('send_message',{'alias':_0x2defcb,'message':_0x5598d7,'from_session':Z});return{'content':[{'type':_0xec80cc(0x202),'text':JSON['stringify'](_0x380b5e)}]};}if(_0x347c16===_0xec80cc(0x256)){let _0x216be2=await P('get_all_status',{});return{'content':[{'type':_0xec80cc(0x202),'text':JSON[_0xec80cc(0x205)](_0x216be2)}]};}return{'content':[{'type':_0xec80cc(0x202),'text':JSON[_0xec80cc(0x205)]({'error':'unknown\x20tool'})}]};});async function u(){const _0x2c6203=a0_0x53a9fb;let _0x4a6324=f+_0x2c6203(0x1e0)+encodeURIComponent(Z),_0x1e7da5={};if(X)_0x1e7da5['Authorization']=_0x2c6203(0x237)+X;Y('connecting\x20to\x20'+_0x4a6324);while(!0x0){try{let _0x2fffbf=await fetch(_0x4a6324,{'headers':_0x1e7da5});if(!_0x2fffbf['ok']){Y(_0x2c6203(0x1fb)+_0x2fffbf[_0x2c6203(0x1ea)]+'\x20'+_0x2fffbf['statusText']),await h(0x1388);continue;}let _0x368c97=_0x2fffbf[_0x2c6203(0x232)][_0x2c6203(0x1ef)](),_0x4694a9=new TextDecoder(),_0x340623='';while(!0x0){let {done:_0x4e07c1,value:_0x55123a}=await _0x368c97[_0x2c6203(0x22b)]();if(_0x4e07c1)break;_0x340623+=_0x4694a9['decode'](_0x55123a,{'stream':!0x0});let _0x1f1b8a=_0x340623[_0x2c6203(0x1e3)]('\x0a\x0a');_0x340623=_0x1f1b8a[_0x2c6203(0x21b)]()||'';for(let _0x3eaa7a of _0x1f1b8a){let _0x3fd8aa=_0x3eaa7a[_0x2c6203(0x1e3)]('\x0a')[_0x2c6203(0x230)](_0x442741=>_0x442741[_0x2c6203(0x20c)](_0x2c6203(0x21c)));if(!_0x3fd8aa)continue;try{let _0x36334f=JSON[_0x2c6203(0x203)](_0x3fd8aa['slice'](0x6));await S(_0x36334f);}catch(_0x2b71dc){Y('parse\x20error:\x20'+_0x2b71dc);}}}Y('SSE\x20stream\x20ended,\x20reconnecting...');}catch(_0x3dd2b7){Y(_0x2c6203(0x1da)+_0x3dd2b7);}await h(0xbb8);}}async function S(_0x5091ff){const _0x3bf2bb=a0_0x53a9fb;if(_0x5091ff['type']===_0x3bf2bb(0x212)){Y(_0x3bf2bb(0x1e4)+Z+'\x22');return;}if(_0x5091ff['type']===_0x3bf2bb(0x1f8)){if(Y('←\x20message\x20from\x20'+_0x5091ff[_0x3bf2bb(0x241)]+':\x20'+_0x5091ff[_0x3bf2bb(0x1e1)][_0x3bf2bb(0x216)](0x0,0x3c)),await K['notification']({'method':_0x3bf2bb(0x227),'params':{'content':_0x5091ff[_0x3bf2bb(0x1e1)],'meta':{'sender':_0x5091ff[_0x3bf2bb(0x241)]||_0x3bf2bb(0x1f4),'sender_id':'commhub','user':_0x5091ff[_0x3bf2bb(0x241)]||'hub','priority':_0x3bf2bb(0x209)}}}),_0x5091ff[_0x3bf2bb(0x210)])await P(_0x3bf2bb(0x1db),{'alias':Z,'message_id':_0x5091ff[_0x3bf2bb(0x210)]});return;}if(_0x5091ff[_0x3bf2bb(0x23f)]==='new_task'||_0x5091ff[_0x3bf2bb(0x23f)]==='broadcast'){Y('←\x20'+_0x5091ff[_0x3bf2bb(0x23f)]+':\x20inbox_count='+_0x5091ff[_0x3bf2bb(0x228)]+'\x20priority='+(_0x5091ff[_0x3bf2bb(0x1ff)]||'normal'));let _0x368d95=await P(_0x3bf2bb(0x24f),{'alias':Z,'limit':0x5});if(_0x368d95?.['ok']&&_0x368d95[_0x3bf2bb(0x204)]?.[_0x3bf2bb(0x226)]>0x0)for(let _0x5baadc of _0x368d95[_0x3bf2bb(0x204)]){let _0x5e003e={'sender':_0x5baadc[_0x3bf2bb(0x229)]||_0x3bf2bb(0x1f4),'sender_id':_0x3bf2bb(0x1f5),'user':_0x5baadc[_0x3bf2bb(0x229)]||_0x3bf2bb(0x1f4),'task_id':_0x5baadc['id'],'priority':_0x5baadc[_0x3bf2bb(0x1ff)]||'normal'};k[_0x3bf2bb(0x207)](_0x5baadc['id'],_0x5baadc['from_session']||'hub'),await K['notification']({'method':_0x3bf2bb(0x227),'params':{'content':_0x5baadc['content'],'meta':_0x5e003e}}),Y(_0x3bf2bb(0x238)+_0x5baadc['id']['slice'](0x0,0x8)+_0x3bf2bb(0x1e7)+_0x5baadc[_0x3bf2bb(0x229)]+':\x20'+_0x5baadc[_0x3bf2bb(0x1f0)][_0x3bf2bb(0x216)](0x0,0x3c)),await P('ack_inbox',{'alias':Z,'message_id':_0x5baadc['id']});}}}async function A(){const _0x8063e5=a0_0x53a9fb;let _0x257769=new a0_0x86034();await K[_0x8063e5(0x24c)](_0x257769),Y(_0x8063e5(0x215)),Y(_0x8063e5(0x21a)),u()[_0x8063e5(0x231)](_0x4ecc0f=>Y('SSE\x20fatal:\x20'+_0x4ecc0f)),P(_0x8063e5(0x224),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x153e36(),'hostname':a0_0x153e36(),'agent':_0x8063e5(0x1f3),'project_dir':process[_0x8063e5(0x247)](),'tmux_name':j||void 0x0})['then'](()=>Y('registered\x20as\x20\x22'+Z+_0x8063e5(0x1d9)+w['slice'](0x0,0x8)+')'))[_0x8063e5(0x231)](_0x4105eb=>Y(_0x8063e5(0x201)+_0x4105eb)),setInterval(()=>{const _0x157073=_0x8063e5;P('report_status',{'resume_id':w,'alias':Z,'status':_0x157073(0x1f2),'server':a0_0x153e36(),'hostname':a0_0x153e36(),'agent':_0x157073(0x1f3),'project_dir':process[_0x157073(0x247)](),'tmux_name':j||void 0x0})['catch'](_0x45e4c9=>Y('heartbeat\x20failed:\x20'+_0x45e4c9));},0x2bf20),Y(_0x8063e5(0x1e6));}A()[a0_0x53a9fb(0x231)](_0xfe7712=>{const _0x2dbb2b=a0_0x53a9fb;Y('fatal:\x20'+_0xfe7712),process[_0x2dbb2b(0x23b)](0x1);});async function N(){const _0x5902a3=a0_0x53a9fb;Y(_0x5902a3(0x244)),await P('report_status',{'resume_id':w,'alias':Z,'status':'error','task':'session\x20disconnected'})[_0x5902a3(0x231)](()=>{}),process['exit'](0x0);}process['stdin']['on'](a0_0x53a9fb(0x1fa),()=>N()),process['on'](a0_0x53a9fb(0x1f1),()=>N()),process['on']('SIGINT',()=>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.5",
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",