@sleep2agi/agent-network 2.1.4-preview.2 → 2.1.4-preview.4

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_0x2b465c=a0_0x4a74;function a0_0x4a74(_0x58fab3,_0x4d99f2){_0x58fab3=_0x58fab3-0x18e;const _0x185676=a0_0x1856();let _0x4a746f=_0x185676[_0x58fab3];return _0x4a746f;}(function(_0x152ef6,_0x473474){const _0x3dffd0=a0_0x4a74,_0x211e98=_0x152ef6();while(!![]){try{const _0x18015d=parseInt(_0x3dffd0(0x199))/0x1+parseInt(_0x3dffd0(0x197))/0x2+-parseInt(_0x3dffd0(0x1c5))/0x3+-parseInt(_0x3dffd0(0x19a))/0x4+parseInt(_0x3dffd0(0x1aa))/0x5+parseInt(_0x3dffd0(0x1a2))/0x6*(-parseInt(_0x3dffd0(0x1d3))/0x7)+parseInt(_0x3dffd0(0x1b0))/0x8*(parseInt(_0x3dffd0(0x1da))/0x9);if(_0x18015d===_0x473474)break;else _0x211e98['push'](_0x211e98['shift']());}catch(_0x808999){_0x211e98['push'](_0x211e98['shift']());}}}(a0_0x1856,0xb9919));import{EventEmitter as a0_0x10c763}from'events';import{hostname as a0_0x35b62d}from'os';class T extends a0_0x10c763{[a0_0x2b465c(0x1af)];[a0_0x2b465c(0x1a7)];[a0_0x2b465c(0x1cb)];[a0_0x2b465c(0x1bc)];[a0_0x2b465c(0x1c2)];[a0_0x2b465c(0x1b7)];[a0_0x2b465c(0x1bf)];[a0_0x2b465c(0x1ce)];['sseAbort'];['running']=!0x1;constructor(_0x390a9e){const _0x136740=a0_0x2b465c;super();if(this[_0x136740(0x1af)]=_0x390a9e[_0x136740(0x1af)]['replace'](/\/$/,''),this[_0x136740(0x1a7)]=_0x390a9e[_0x136740(0x1a7)],this[_0x136740(0x1cb)]=_0x390a9e[_0x136740(0x1cb)],this[_0x136740(0x1bc)]=_0x390a9e[_0x136740(0x1bc)]||_0x136740(0x1c7),this[_0x136740(0x1c2)]=_0x136740(0x190)+_0x390a9e[_0x136740(0x1a7)]+'-'+Date[_0x136740(0x1ae)]()[_0x136740(0x18f)](0x24),this[_0x136740(0x1b7)]=_0x390a9e[_0x136740(0x1b7)]??0x2bf20,this[_0x136740(0x1bf)]=_0x390a9e[_0x136740(0x1bf)]??0xbb8,_0x390a9e[_0x136740(0x1b4)]!==!0x1)this[_0x136740(0x1e3)]();}[a0_0x2b465c(0x1d9)](_0x2f9778){const _0x113138=a0_0x2b465c;console[_0x113138(0x1d9)]('['+new Date()[_0x113138(0x1a0)]()['slice'](0x0,0x8)+_0x113138(0x1a4)+this[_0x113138(0x1a7)]+']\x20'+_0x2f9778);}async['call'](_0x1c95de,_0x198086){const _0x124d4c=a0_0x2b465c;let _0x9d4703={'Content-Type':_0x124d4c(0x19b),'Accept':_0x124d4c(0x1b3)};if(this[_0x124d4c(0x1cb)])_0x9d4703[_0x124d4c(0x1b8)]=_0x124d4c(0x1d2)+this[_0x124d4c(0x1cb)];let _0x20fbc3=await(await fetch(this[_0x124d4c(0x1af)]+_0x124d4c(0x1db),{'method':_0x124d4c(0x18e),'headers':_0x9d4703,'body':JSON['stringify']({'jsonrpc':_0x124d4c(0x196),'id':Date[_0x124d4c(0x1ae)](),'method':_0x124d4c(0x1b9),'params':{'name':_0x1c95de,'arguments':_0x198086}})}))['text'](),_0x58101e=_0x20fbc3[_0x124d4c(0x1b2)](/data: (.+)/),_0x317e67=_0x58101e?JSON[_0x124d4c(0x1a8)](_0x58101e[0x1]):JSON[_0x124d4c(0x1a8)](_0x20fbc3),_0x532cf9=_0x317e67?.[_0x124d4c(0x19f)]?.[_0x124d4c(0x195)]?.[0x0]?.[_0x124d4c(0x1cf)];return _0x532cf9?JSON[_0x124d4c(0x1a8)](_0x532cf9):_0x317e67;}async[a0_0x2b465c(0x1e3)](){const _0x3aa34f=a0_0x2b465c;if(this['running'])return;this[_0x3aa34f(0x198)]=!0x0,await this['status'](_0x3aa34f(0x1d4)),this[_0x3aa34f(0x1d9)](_0x3aa34f(0x19c)),this[_0x3aa34f(0x1ce)]=setInterval(()=>{const _0x43b639=_0x3aa34f;this[_0x43b639(0x1a6)](_0x43b639(0x1d4))[_0x43b639(0x1c3)](_0x1ce3c3=>this[_0x43b639(0x1d9)]('heartbeat\x20failed:\x20'+_0x1ce3c3['message']));},this[_0x3aa34f(0x1b7)]),this['connectSSE']();}async[a0_0x2b465c(0x1be)](){const _0x57551f=a0_0x2b465c;if(this[_0x57551f(0x198)]=!0x1,this['sseAbort']?.[_0x57551f(0x191)](),this[_0x57551f(0x1ce)])clearInterval(this['heartbeatTimer']);await this['status']('offline')['catch'](()=>{}),this[_0x57551f(0x1d9)](_0x57551f(0x1d8));}async['send'](_0x4a4cd0,_0x9f50ec,_0x5af57f='normal'){const _0x54a4da=a0_0x2b465c;return this['call'](_0x54a4da(0x1df),{'alias':_0x4a4cd0,'task':_0x9f50ec,'priority':_0x5af57f,'from_session':this[_0x54a4da(0x1a7)]});}async['message'](_0xf22330,_0x35d50d){const _0x29e67e=a0_0x2b465c;return this[_0x29e67e(0x1a1)]('send_message',{'alias':_0xf22330,'message':_0x35d50d,'from_session':this[_0x29e67e(0x1a7)]});}async[a0_0x2b465c(0x1c1)](_0x370f89,_0x4b3ac8,_0x2f8149=a0_0x2b465c(0x1e4)){const _0xb7449e=a0_0x2b465c;return this[_0xb7449e(0x1a1)](_0xb7449e(0x1cd),{'in_reply_to':_0x370f89,'text':_0x4b3ac8,'status':_0x2f8149});}async[a0_0x2b465c(0x1a6)](_0x350a43,_0x3b9d15){const _0x2887a4=a0_0x2b465c;return this[_0x2887a4(0x1a1)](_0x2887a4(0x1cc),{'resume_id':this[_0x2887a4(0x1c2)],'alias':this[_0x2887a4(0x1a7)],'status':_0x350a43,'server':a0_0x35b62d(),'hostname':a0_0x35b62d(),'agent':this[_0x2887a4(0x1bc)],'project_dir':process[_0x2887a4(0x1dc)](),..._0x3b9d15});}async[a0_0x2b465c(0x1e0)](){const _0x1fa181=a0_0x2b465c;return this[_0x1fa181(0x1a1)](_0x1fa181(0x1ab),{});}async[a0_0x2b465c(0x1d5)](_0x165383,_0x33a9fe){const _0x4fc838=a0_0x2b465c;return this[_0x4fc838(0x1a1)]('broadcast',{'message':_0x165383,'filter_server':_0x33a9fe?.['server'],'filter_status':_0x33a9fe?.[_0x4fc838(0x1a6)]});}async[a0_0x2b465c(0x1ac)](){const _0x3be652=a0_0x2b465c;let _0x5a8879=encodeURIComponent(this[_0x3be652(0x1a7)]),_0xc1f1fa=this['url']+'/events/'+_0x5a8879,_0x3c2ac4=this[_0x3be652(0x1bf)];while(this[_0x3be652(0x198)]){try{this[_0x3be652(0x1c0)]=new AbortController();let _0x3e454c={'Accept':_0x3be652(0x1c9)};if(this[_0x3be652(0x1cb)])_0x3e454c[_0x3be652(0x1b8)]=_0x3be652(0x1d2)+this['token'];let _0xed2914=await fetch(_0xc1f1fa,{'headers':_0x3e454c,'signal':this['sseAbort']['signal']});if(!_0xed2914['ok']||!_0xed2914['body']){this[_0x3be652(0x1d9)](_0x3be652(0x19e)+_0xed2914[_0x3be652(0x1a6)]),await this[_0x3be652(0x1d7)](_0x3c2ac4),_0x3c2ac4=Math[_0x3be652(0x1e2)](_0x3c2ac4*1.5,0xea60);continue;}_0x3c2ac4=this[_0x3be652(0x1bf)];let _0x1506bd=_0xed2914[_0x3be652(0x19d)][_0x3be652(0x1a5)](),_0x306c55=new TextDecoder(),_0x2853a3='';while(this[_0x3be652(0x198)]){let {done:_0x1e64e9,value:_0x14f1ad}=await _0x1506bd[_0x3be652(0x1dd)]();if(_0x1e64e9)break;_0x2853a3+=_0x306c55[_0x3be652(0x1a3)](_0x14f1ad,{'stream':!0x0});let _0x16a4c3=_0x2853a3[_0x3be652(0x1d1)]('\x0a');_0x2853a3=_0x16a4c3['pop']()||'';for(let _0xb9e526 of _0x16a4c3){if(!_0xb9e526[_0x3be652(0x1e1)](_0x3be652(0x192)))continue;try{let _0x22947f=JSON[_0x3be652(0x1a8)](_0xb9e526[_0x3be652(0x1c8)](0x6));if(_0x22947f[_0x3be652(0x1d0)]===_0x3be652(0x1c6)){this[_0x3be652(0x1d9)](_0x3be652(0x1de)),this[_0x3be652(0x1d6)]('connected');continue;}if(_0x22947f[_0x3be652(0x1d0)]==='new_task'||_0x22947f[_0x3be652(0x1d0)]===_0x3be652(0x1bd)||_0x22947f[_0x3be652(0x1d0)]==='broadcast')await this[_0x3be652(0x1bb)]();}catch{}}}}catch(_0x4a0bc1){if(_0x4a0bc1[_0x3be652(0x1ca)]===_0x3be652(0x1b1))break;this[_0x3be652(0x1d6)]('error',_0x4a0bc1),this[_0x3be652(0x1d9)]('SSE\x20error:\x20'+_0x4a0bc1['message']);}if(this['running'])this[_0x3be652(0x1d6)]('disconnected'),this[_0x3be652(0x1d9)](_0x3be652(0x1b5)+_0x3c2ac4/0x3e8+'s...'),await this[_0x3be652(0x1d7)](_0x3c2ac4),_0x3c2ac4=Math['min'](_0x3c2ac4*1.5,0xea60);}}async[a0_0x2b465c(0x1bb)](){const _0x583202=a0_0x2b465c;try{let _0x2ee4c4=(await this[_0x583202(0x1a1)](_0x583202(0x1a9),{'alias':this['alias'],'limit':0xa}))?.[_0x583202(0x1ad)]||[];for(let _0x3f54ed of _0x2ee4c4)await this[_0x583202(0x1a1)](_0x583202(0x194),{'alias':this[_0x583202(0x1a7)],'message_id':_0x3f54ed['id']}),this[_0x583202(0x1d9)]('←\x20'+_0x3f54ed[_0x583202(0x1b6)]+':\x20'+_0x3f54ed[_0x583202(0x195)][_0x583202(0x1c8)](0x0,0x3c)),this[_0x583202(0x1d6)](_0x583202(0x1c4),_0x3f54ed),this[_0x583202(0x1d6)](_0x583202(0x1ba),_0x3f54ed);}catch(_0xce3f62){this[_0x583202(0x1d9)](_0x583202(0x193)+_0xce3f62['message']);}}['sleep'](_0x1caa09){return new Promise(_0xc620bf=>setTimeout(_0xc620bf,_0x1caa09));}}var $=T;export{$ as default,T as CommHub};function a0_0x1856(){const _0x4bb51c=['catch','task','1125405CSRkAB','connected','sdk','slice','text/event-stream','name','token','report_status','send_reply','heartbeatTimer','text','type','split','Bearer\x20','2335788sOHgTv','idle','broadcast','emit','sleep','disconnected','log','117EunQJg','/mcp','cwd','read','SSE\x20connected','send_task','getAllStatus','startsWith','min','connect','completed','POST','toString','sdk-','abort','data:\x20','inbox\x20error:\x20','ack_inbox','content','2.0','1537020NOrBwt','running','532141VuPXOa','2528356nqlHWk','application/json','registered','body','SSE\x20failed:\x20','result','toTimeString','call','6oXqqlK','decode',']\x20[commhub:','getReader','status','alias','parse','get_inbox','366280WEakrd','get_all_status','connectSSE','messages','now','url','447440xbsVGc','AbortError','match','application/json,\x20text/event-stream','autoConnect','SSE\x20reconnecting\x20in\x20','from_session','heartbeatInterval','Authorization','tools/call','message','processInbox','agent','new_message','disconnect','reconnectDelay','sseAbort','reply','resumeId'];a0_0x1856=function(){return _0x4bb51c;};return a0_0x1856();}
1
+ const a0_0x48e14d=a0_0x1385;(function(_0x1d4818,_0x2e95ab){const _0x1852d3=a0_0x1385,_0xe6896a=_0x1d4818();while(!![]){try{const _0x31a465=parseInt(_0x1852d3(0x173))/0x1+parseInt(_0x1852d3(0x14f))/0x2+parseInt(_0x1852d3(0x121))/0x3+-parseInt(_0x1852d3(0x11e))/0x4+-parseInt(_0x1852d3(0x11c))/0x5*(parseInt(_0x1852d3(0x16a))/0x6)+-parseInt(_0x1852d3(0x129))/0x7*(parseInt(_0x1852d3(0x142))/0x8)+-parseInt(_0x1852d3(0x134))/0x9*(-parseInt(_0x1852d3(0x155))/0xa);if(_0x31a465===_0x2e95ab)break;else _0xe6896a['push'](_0xe6896a['shift']());}catch(_0x41a323){_0xe6896a['push'](_0xe6896a['shift']());}}}(a0_0x1425,0xf1f99));function a0_0x1385(_0x19cdcb,_0xb5de38){_0x19cdcb=_0x19cdcb-0x11a;const _0x142571=a0_0x1425();let _0x138580=_0x142571[_0x19cdcb];return _0x138580;}import{EventEmitter as a0_0x4b1e6c}from'events';import{hostname as a0_0x511a4e}from'os';class T extends a0_0x4b1e6c{['url'];[a0_0x48e14d(0x172)];[a0_0x48e14d(0x144)];[a0_0x48e14d(0x140)];[a0_0x48e14d(0x13f)];[a0_0x48e14d(0x11a)];[a0_0x48e14d(0x179)];[a0_0x48e14d(0x168)];[a0_0x48e14d(0x16f)];[a0_0x48e14d(0x177)]=!0x1;constructor(_0x38bff5){const _0x517e35=a0_0x48e14d;super();if(this['url']=_0x38bff5[_0x517e35(0x14c)][_0x517e35(0x158)](/\/$/,''),this[_0x517e35(0x172)]=_0x38bff5['alias'],this[_0x517e35(0x144)]=_0x38bff5[_0x517e35(0x144)],this[_0x517e35(0x140)]=_0x38bff5['agent']||_0x517e35(0x11d),this[_0x517e35(0x13f)]='sdk-'+_0x38bff5[_0x517e35(0x172)]+'-'+Date['now']()[_0x517e35(0x174)](0x24),this[_0x517e35(0x11a)]=_0x38bff5['heartbeatInterval']??0x2bf20,this['reconnectDelay']=_0x38bff5[_0x517e35(0x179)]??0xbb8,_0x38bff5[_0x517e35(0x143)]!==!0x1)this[_0x517e35(0x15f)]();}['log'](_0x2d5381){const _0x486449=a0_0x48e14d;console[_0x486449(0x16b)]('['+new Date()[_0x486449(0x157)]()[_0x486449(0x127)](0x0,0x8)+_0x486449(0x170)+this['alias']+']\x20'+_0x2d5381);}async['call'](_0x149945,_0x154742){const _0x41131d=a0_0x48e14d;let _0x51f562={'Content-Type':'application/json','Accept':_0x41131d(0x149)};if(this['token'])_0x51f562[_0x41131d(0x126)]=_0x41131d(0x171)+this[_0x41131d(0x144)];let _0x32db56=await(await fetch(this[_0x41131d(0x14c)]+_0x41131d(0x122),{'method':_0x41131d(0x11f),'headers':_0x51f562,'body':JSON[_0x41131d(0x159)]({'jsonrpc':_0x41131d(0x160),'id':Date['now'](),'method':_0x41131d(0x161),'params':{'name':_0x149945,'arguments':_0x154742}})}))[_0x41131d(0x14b)](),_0x1a4010=_0x32db56[_0x41131d(0x130)](/data: (.+)/),_0x463b2e=_0x1a4010?JSON['parse'](_0x1a4010[0x1]):JSON['parse'](_0x32db56),_0x1506b6=_0x463b2e?.[_0x41131d(0x135)]?.[_0x41131d(0x163)]?.[0x0]?.[_0x41131d(0x14b)];return _0x1506b6?JSON[_0x41131d(0x176)](_0x1506b6):_0x463b2e;}async[a0_0x48e14d(0x15f)](){const _0x213cc6=a0_0x48e14d;if(this[_0x213cc6(0x177)])return;this[_0x213cc6(0x177)]=!0x0,await this[_0x213cc6(0x153)]('idle'),this[_0x213cc6(0x16b)](_0x213cc6(0x137)),this[_0x213cc6(0x168)]=setInterval(()=>{const _0xf6ff9f=_0x213cc6;this[_0xf6ff9f(0x153)](_0xf6ff9f(0x178))[_0xf6ff9f(0x156)](_0x5bde20=>this['log'](_0xf6ff9f(0x131)+_0x5bde20[_0xf6ff9f(0x162)]));},this['heartbeatInterval']),this['connectSSE']();}async[a0_0x48e14d(0x13e)](){const _0x4fdcf8=a0_0x48e14d;if(this[_0x4fdcf8(0x177)]=!0x1,this[_0x4fdcf8(0x16f)]?.[_0x4fdcf8(0x12e)](),this['heartbeatTimer'])clearInterval(this['heartbeatTimer']);await this['status'](_0x4fdcf8(0x12c))[_0x4fdcf8(0x156)](()=>{}),this['log'](_0x4fdcf8(0x146));}async[a0_0x48e14d(0x14d)](_0x5c393a,_0x4fe499,_0x299d31=a0_0x48e14d(0x11b)){const _0x36b5af=a0_0x48e14d;return this[_0x36b5af(0x15a)](_0x36b5af(0x13a),{'alias':_0x5c393a,'task':_0x4fe499,'priority':_0x299d31,'from_session':this[_0x36b5af(0x172)]});}async[a0_0x48e14d(0x162)](_0x92029,_0x39e440){const _0x48ccba=a0_0x48e14d;return this[_0x48ccba(0x15a)](_0x48ccba(0x150),{'alias':_0x92029,'message':_0x39e440,'from_session':this[_0x48ccba(0x172)]});}async[a0_0x48e14d(0x165)](_0x28fb2c,_0x2fce8d,_0x3997f2='completed'){const _0x58fb8a=a0_0x48e14d;return this['call'](_0x58fb8a(0x120),{'in_reply_to':_0x28fb2c,'text':_0x2fce8d,'status':_0x3997f2});}async[a0_0x48e14d(0x153)](_0x3d2647,_0x252973){const _0x145cc0=a0_0x48e14d;return this['call']('report_status',{'resume_id':this[_0x145cc0(0x13f)],'alias':this[_0x145cc0(0x172)],'status':_0x3d2647,'server':a0_0x511a4e(),'hostname':a0_0x511a4e(),'agent':this[_0x145cc0(0x140)],'project_dir':process[_0x145cc0(0x154)](),..._0x252973});}async[a0_0x48e14d(0x145)](){const _0x7c52e7=a0_0x48e14d;return this[_0x7c52e7(0x15a)](_0x7c52e7(0x125),{});}async[a0_0x48e14d(0x141)](_0x43d65e,_0x43958d){const _0x5777a5=a0_0x48e14d;return this['call']('broadcast',{'message':_0x43d65e,'filter_server':_0x43958d?.[_0x5777a5(0x151)],'filter_status':_0x43958d?.[_0x5777a5(0x153)]});}async[a0_0x48e14d(0x175)](){const _0x5d817c=a0_0x48e14d;let _0x406737=encodeURIComponent(this[_0x5d817c(0x172)]),_0x20cc4b=this['url']+_0x5d817c(0x166)+_0x406737,_0x195230=this['reconnectDelay'];while(this[_0x5d817c(0x177)]){try{this[_0x5d817c(0x16f)]=new AbortController();let _0x16c0ed={'Accept':_0x5d817c(0x133)};if(this[_0x5d817c(0x144)])_0x16c0ed[_0x5d817c(0x126)]=_0x5d817c(0x171)+this[_0x5d817c(0x144)];let _0xb47bb0=await fetch(_0x20cc4b,{'headers':_0x16c0ed,'signal':this['sseAbort'][_0x5d817c(0x138)]});if(!_0xb47bb0['ok']||!_0xb47bb0[_0x5d817c(0x16e)]){this[_0x5d817c(0x16b)](_0x5d817c(0x164)+_0xb47bb0['status']),await this[_0x5d817c(0x147)](_0x195230),_0x195230=Math['min'](_0x195230*1.5,0xea60);continue;}_0x195230=this[_0x5d817c(0x179)];let _0x3d9954=_0xb47bb0['body'][_0x5d817c(0x169)](),_0x3e6384=new TextDecoder(),_0x4fe21f='';while(this[_0x5d817c(0x177)]){let {done:_0x29b57a,value:_0x222c3f}=await _0x3d9954[_0x5d817c(0x15e)]();if(_0x29b57a)break;_0x4fe21f+=_0x3e6384['decode'](_0x222c3f,{'stream':!0x0});let _0xb40533=_0x4fe21f[_0x5d817c(0x12d)]('\x0a');_0x4fe21f=_0xb40533[_0x5d817c(0x16d)]()||'';for(let _0x18df9d of _0xb40533){if(!_0x18df9d[_0x5d817c(0x148)](_0x5d817c(0x123)))continue;try{let _0x1c4487=JSON[_0x5d817c(0x176)](_0x18df9d['slice'](0x6));if(_0x1c4487[_0x5d817c(0x12b)]===_0x5d817c(0x13c)){this[_0x5d817c(0x16b)]('SSE\x20connected'),this[_0x5d817c(0x15c)](_0x5d817c(0x13c));continue;}if(_0x1c4487[_0x5d817c(0x12b)]===_0x5d817c(0x152)||_0x1c4487[_0x5d817c(0x12b)]===_0x5d817c(0x139)||_0x1c4487[_0x5d817c(0x12b)]===_0x5d817c(0x141))await this[_0x5d817c(0x15d)]();}catch{}}}}catch(_0xbe8546){if(_0xbe8546[_0x5d817c(0x136)]===_0x5d817c(0x12a))break;this[_0x5d817c(0x15c)](_0x5d817c(0x13b),_0xbe8546),this[_0x5d817c(0x16b)](_0x5d817c(0x14e)+_0xbe8546[_0x5d817c(0x162)]);}if(this[_0x5d817c(0x177)])this['emit'](_0x5d817c(0x146)),this[_0x5d817c(0x16b)](_0x5d817c(0x12f)+_0x195230/0x3e8+_0x5d817c(0x132)),await this[_0x5d817c(0x147)](_0x195230),_0x195230=Math[_0x5d817c(0x128)](_0x195230*1.5,0xea60);}}async[a0_0x48e14d(0x15d)](){const _0x514de0=a0_0x48e14d;try{let _0x5a6352=(await this[_0x514de0(0x15a)](_0x514de0(0x15b),{'alias':this['alias'],'limit':0xa}))?.[_0x514de0(0x167)]||[];for(let _0x53906f of _0x5a6352)await this[_0x514de0(0x15a)](_0x514de0(0x13d),{'alias':this[_0x514de0(0x172)],'message_id':_0x53906f['id']}),this[_0x514de0(0x16b)]('←\x20'+_0x53906f[_0x514de0(0x124)]+':\x20'+_0x53906f[_0x514de0(0x163)]['slice'](0x0,0x3c)),this['emit'](_0x514de0(0x14a),_0x53906f),this[_0x514de0(0x15c)](_0x514de0(0x162),_0x53906f);}catch(_0x4e45e1){this[_0x514de0(0x16b)](_0x514de0(0x16c)+_0x4e45e1[_0x514de0(0x162)]);}}['sleep'](_0x1a4013){return new Promise(_0x30d8f9=>setTimeout(_0x30d8f9,_0x1a4013));}}var $=T;function a0_0x1425(){const _0x292b1b=['/mcp','data:\x20','from_session','get_all_status','Authorization','slice','min','43302HqfRSk','AbortError','type','offline','split','abort','SSE\x20reconnecting\x20in\x20','match','heartbeat\x20failed:\x20','s...','text/event-stream','9hTihdW','result','name','registered','signal','new_message','send_task','error','connected','ack_inbox','disconnect','resumeId','agent','broadcast','512pYsSxL','autoConnect','token','getAllStatus','disconnected','sleep','startsWith','application/json,\x20text/event-stream','task','text','url','send','SSE\x20error:\x20','3345180wUZyNq','send_message','server','new_task','status','cwd','9169660bnpmST','catch','toTimeString','replace','stringify','call','get_inbox','emit','processInbox','read','connect','2.0','tools/call','message','content','SSE\x20failed:\x20','reply','/events/','messages','heartbeatTimer','getReader','10251258asCPKa','log','inbox\x20error:\x20','pop','body','sseAbort',']\x20[commhub:','Bearer\x20','alias','10713aXeXyj','toString','connectSSE','parse','running','idle','reconnectDelay','heartbeatInterval','normal','5FpKivs','sdk','3761056KTUXNK','POST','send_reply','4306713SAZbov'];a0_0x1425=function(){return _0x292b1b;};return a0_0x1425();}export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x42f575=a0_0xaf0d;(function(_0x40b1c0,_0x461840){const _0x1232d4=a0_0xaf0d,_0x432c3a=_0x40b1c0();while(!![]){try{const _0x529da8=-parseInt(_0x1232d4(0x131))/0x1+-parseInt(_0x1232d4(0x153))/0x2*(-parseInt(_0x1232d4(0x111))/0x3)+-parseInt(_0x1232d4(0x12d))/0x4*(parseInt(_0x1232d4(0xe9))/0x5)+parseInt(_0x1232d4(0xea))/0x6+-parseInt(_0x1232d4(0xe0))/0x7+parseInt(_0x1232d4(0x14e))/0x8*(parseInt(_0x1232d4(0x128))/0x9)+parseInt(_0x1232d4(0xd3))/0xa*(parseInt(_0x1232d4(0xe1))/0xb);if(_0x529da8===_0x461840)break;else _0x432c3a['push'](_0x432c3a['shift']());}catch(_0x34eaef){_0x432c3a['push'](_0x432c3a['shift']());}}}(a0_0x4c5c,0x7c9a9));import{readFileSync as a0_0x7d7484,existsSync as a0_0x25af4c}from'fs';import{randomUUID as a0_0x2cb66a}from'crypto';import{join as a0_0x2be507}from'path';import{hostname as a0_0x4c9c8b}from'os';import{execSync as a0_0xbdeffb}from'child_process';import{Server as a0_0x58ab4b}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x48a60f}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x325cc6,CallToolRequestSchema as a0_0x7c9f54}from'@modelcontextprotocol/sdk/types.js';function a0_0x4c5c(){const _0x252ec9=['config.json','\x20PROJECT_ENV=','connecting\x20to\x20','low','80425hJOTUt','5187738BTFmVT','/events/',':\x20inbox_count=','end','set','←\x20message\x20from\x20','tmux\x20display-message\x20-p\x20\x27#S\x27','http://127.0.0.1:9200','write','/mcp','completed','Session\x20alias:\x20','SSE\x20connection\x20error:\x20','ready\x20—\x20waiting\x20for\x20events','read','CommHub\x20init\x20failed:\x20','exit','statusText','notification','no\x20response','commhub-channel','MCP\x20stdio\x20connected','result','Target\x20session\x20alias','message','\x20priority=','commhub_get_all_status','SSE\x20stream\x20ended,\x20reconnecting...','working','stderr','utf-8','from','send_task','Priority\x20(default:\x20normal)','status','commhub','failed','stdin','slice','3vXBSdM','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','length','in_progress','toTimeString','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','Current\x20task\x20description','cancelled','data:\x20','parse','SSE\x20fatal:\x20','Message\x20content','initialize','.env','→\x20injected\x20task\x20','tools/call','send_message','idle','claude-code','POST','\x20RESUME_ID=','inbox_count','then','63dwfIJp','find','0.3.0','messages','replace','4bGsoxf','priority','body','content','273789smFiiN','\x20ALIAS=','connect','hub','object','report_status','commhub_send_message','.anet','application/json','SIGTERM','new_message','cwd','text','task','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','type','normal','decode','catch','setRequestHandler','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','broadcast','Progress\x200-100','new_task','replied','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','91704DdNomc',']\x20[commhub]\x20','stringify','startsWith','message_id','493480jdMNmz','send_reply','split','.claude/channels/commhub','init\x20failed:\x20','Bearer\x20','shutting\x20down,\x20reporting\x20offline...','delete','get_inbox','indexOf','commhub_send_task','join','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','getReader','3113260ZuxklL','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','...\x20TMUX=','high','\x22\x20(','from_session','SSE\x20connected\x20as\x20\x22','blocked','error','unknown\x20tool','\x20from\x20','string','trim','4918753WhpxDh','11evGXTh','notifications/claude/channel','commhub_report_status','ack_inbox'];a0_0x4c5c=function(){return _0x252ec9;};return a0_0x4c5c();}function p(_0x4f9e22){const _0x3bbd6c=a0_0xaf0d;if(!a0_0x25af4c(_0x4f9e22))return;for(let _0x5e28a8 of a0_0x7d7484(_0x4f9e22,'utf-8')[_0x3bbd6c(0x155)]('\x0a')){let _0x17c30d=_0x5e28a8[_0x3bbd6c(0xdf)]();if(!_0x17c30d||_0x17c30d['startsWith']('#'))continue;let _0x211213=_0x17c30d[_0x3bbd6c(0xce)]('=');if(_0x211213<0x0)continue;let _0xf98136=_0x17c30d[_0x3bbd6c(0x110)](0x0,_0x211213)['trim'](),_0x8012a3=_0x17c30d[_0x3bbd6c(0x110)](_0x211213+0x1)[_0x3bbd6c(0xdf)]()[_0x3bbd6c(0x12c)](/^["']|["']$/g,'');if(!process.env[_0xf98136])process.env[_0xf98136]=_0x8012a3;}}var C=process.env.HOME||'~',T=a0_0x2be507(C,a0_0x42f575(0x156));p(a0_0x2be507(T,a0_0x42f575(0x11e)));var L=process[a0_0x42f575(0x13c)]()[a0_0x42f575(0x12c)](/\//g,'-');p(a0_0x2be507(T,L,a0_0x42f575(0x11e)));function U(){const _0x3105ff=a0_0x42f575;try{return a0_0xbdeffb(_0x3105ff(0xf0),{'encoding':_0x3105ff(0x108),'timeout':0x7d0})[_0x3105ff(0xdf)]();}catch{return'';}}function v(){const _0x1610fd=a0_0x42f575;try{let _0x24c9be=a0_0x2be507(C,_0x1610fd(0x138),_0x1610fd(0xe5));if(a0_0x25af4c(_0x24c9be))return JSON[_0x1610fd(0x11a)](a0_0x7d7484(_0x24c9be,_0x1610fd(0x108)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H['hub']||a0_0x42f575(0xf1),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x4c9c8b(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x2cb66a(),X=process.env.COMMHUB_TOKEN||H['token']||'';function Y(_0x4e90ec){const _0x4ccc88=a0_0x42f575;let _0x4340ea=new Date()[_0x4ccc88(0x115)]()[_0x4ccc88(0x110)](0x0,0x8);process[_0x4ccc88(0x107)][_0x4ccc88(0xf2)]('['+_0x4340ea+_0x4ccc88(0x14f)+_0x4e90ec+'\x0a');}function h(_0x18081b){return new Promise(_0x10fdf1=>setTimeout(_0x10fdf1,_0x18081b));}Y('ENV:\x20URL='+f+a0_0x42f575(0x132)+Z+a0_0x42f575(0x125)+w[a0_0x42f575(0x110)](0x0,0x8)+a0_0x42f575(0xd5)+(j||'none')+'\x20CWD='+process[a0_0x42f575(0x13c)]()+a0_0x42f575(0xe6)+L);var k=new Map(),K=new a0_0x58ab4b({'name':a0_0x42f575(0xfe),'version':'0.3.0'},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x42f575(0x14c),a0_0x42f575(0xd1),a0_0x42f575(0x13f),a0_0x42f575(0x14b),a0_0x42f575(0xf5)+Z][a0_0x42f575(0xd0)]('\x0a')});K[a0_0x42f575(0x144)](a0_0x325cc6,async()=>({'tools':[{'name':'commhub_reply','description':a0_0x42f575(0xd4),'inputSchema':{'type':a0_0x42f575(0x135),'properties':{'task_id':{'type':'string','description':a0_0x42f575(0x145)},'text':{'type':a0_0x42f575(0xde),'description':'Reply\x20text\x20/\x20result\x20summary'},'status':{'type':'string','enum':[a0_0x42f575(0xf4),a0_0x42f575(0x10e),a0_0x42f575(0x118),a0_0x42f575(0xda),'error',a0_0x42f575(0x114)],'description':a0_0x42f575(0x112)}},'required':[a0_0x42f575(0x13d)]}},{'name':a0_0x42f575(0xe3),'description':'Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','inputSchema':{'type':a0_0x42f575(0x135),'properties':{'status':{'type':a0_0x42f575(0xde),'enum':[a0_0x42f575(0x106),a0_0x42f575(0x122),a0_0x42f575(0xda),a0_0x42f575(0xdb)]},'task':{'type':a0_0x42f575(0xde),'description':a0_0x42f575(0x117)},'progress':{'type':'number','description':a0_0x42f575(0x148)}},'required':[a0_0x42f575(0x10c)]}},{'name':a0_0x42f575(0xcf),'description':a0_0x42f575(0x146),'inputSchema':{'type':a0_0x42f575(0x135),'properties':{'alias':{'type':a0_0x42f575(0xde),'description':'Target\x20session\x20alias'},'task':{'type':a0_0x42f575(0xde),'description':'Task\x20content'},'priority':{'type':'string','enum':[a0_0x42f575(0xd6),a0_0x42f575(0x141),a0_0x42f575(0xe8)],'description':a0_0x42f575(0x10b)}},'required':['alias',a0_0x42f575(0x13e)]}},{'name':a0_0x42f575(0x137),'description':a0_0x42f575(0x14d),'inputSchema':{'type':a0_0x42f575(0x135),'properties':{'alias':{'type':a0_0x42f575(0xde),'description':a0_0x42f575(0x101)},'message':{'type':a0_0x42f575(0xde),'description':a0_0x42f575(0x11c)}},'required':['alias',a0_0x42f575(0x102)]}},{'name':a0_0x42f575(0x104),'description':a0_0x42f575(0x116),'inputSchema':{'type':'object','properties':{}}}]}));async function P(_0x282c07,_0xd97e7e){const _0x860998=a0_0x42f575;let _0x4cbaa2=await fetch(f+_0x860998(0xf3),{'method':'POST','headers':{'Content-Type':_0x860998(0x139),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x860998(0xca)+X}:{}},'body':JSON[_0x860998(0x150)]({'jsonrpc':'2.0','id':0x1,'method':_0x860998(0x11d),'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':'commhub-channel','version':_0x860998(0x12a)}}})});if(!_0x4cbaa2['ok']){let _0xc8d62e=await _0x4cbaa2[_0x860998(0x13d)]();return Y(_0x860998(0xf9)+_0x4cbaa2[_0x860998(0x10c)]+'\x20'+_0xc8d62e[_0x860998(0x110)](0x0,0x64)),{'ok':!0x1,'error':_0x860998(0xc9)+_0x4cbaa2[_0x860998(0x10c)]};}await _0x4cbaa2[_0x860998(0x13d)]();let _0x2ae15a=(await(await fetch(f+_0x860998(0xf3),{'method':_0x860998(0x124),'headers':{'Content-Type':_0x860998(0x139),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x860998(0xca)+X}:{}},'body':JSON[_0x860998(0x150)]({'jsonrpc':'2.0','id':0x2,'method':_0x860998(0x120),'params':{'name':_0x282c07,'arguments':_0xd97e7e}})}))[_0x860998(0x13d)]())[_0x860998(0x155)]('\x0a')['find'](_0x1fa1bd=>_0x1fa1bd[_0x860998(0x151)](_0x860998(0x119)));if(_0x2ae15a){let _0x54e272=JSON['parse'](_0x2ae15a[_0x860998(0x110)](0x6));return _0x54e272?.['result']?.[_0x860998(0x130)]?.[0x0]?.['text']?JSON[_0x860998(0x11a)](_0x54e272[_0x860998(0x100)][_0x860998(0x130)][0x0][_0x860998(0x13d)]):_0x54e272;}return{'ok':!0x1,'error':_0x860998(0xfd)};}function a0_0xaf0d(_0x53c10f,_0x3d68e8){_0x53c10f=_0x53c10f-0xc9;const _0x4c5cc4=a0_0x4c5c();let _0xaf0de7=_0x4c5cc4[_0x53c10f];return _0xaf0de7;}K['setRequestHandler'](a0_0x7c9f54,async _0x196a37=>{const _0x58197b=a0_0x42f575;let {name:_0xe701a,arguments:_0x11ffbb}=_0x196a37['params'];if(_0xe701a==='commhub_reply'){let {task_id:_0x4af1c4,text:_0x4953ff,status:_0x1345e2}=_0x11ffbb;if(_0x1345e2===_0x58197b(0xf4)||_0x1345e2==='failed'||_0x1345e2===_0x58197b(0x118)){let _0x5cd166=_0x1345e2==='completed'?_0x58197b(0x14a):_0x1345e2,_0x480f84=_0x4af1c4?k['get'](_0x4af1c4)||_0x58197b(0x134):_0x58197b(0x134),_0x5047cf=await P(_0x58197b(0x154),{'alias':_0x480f84,'text':_0x4953ff,'in_reply_to':_0x4af1c4||void 0x0,'status':_0x5cd166,'from_session':Z});if(_0x4af1c4)k[_0x58197b(0xcc)](_0x4af1c4);return{'content':[{'type':_0x58197b(0x13d),'text':JSON[_0x58197b(0x150)](_0x5047cf)}]};}let _0x2b6985=await P(_0x58197b(0x136),{'resume_id':w,'alias':Z,'status':_0x1345e2===_0x58197b(0xda)?_0x58197b(0xda):_0x1345e2===_0x58197b(0xdb)?_0x58197b(0xdb):'working','task':_0x4953ff[_0x58197b(0x110)](0x0,0xc8),'output':_0x4953ff});return{'content':[{'type':'text','text':JSON[_0x58197b(0x150)](_0x2b6985)}]};}if(_0xe701a===_0x58197b(0xe3)){let {status:_0xd9253e,task:_0x318591,progress:_0x51676e}=_0x11ffbb,_0x4291ed=await P('report_status',{'resume_id':w,'alias':Z,'status':_0xd9253e,'task':_0x318591,'progress':_0x51676e});return{'content':[{'type':_0x58197b(0x13d),'text':JSON[_0x58197b(0x150)](_0x4291ed)}]};}if(_0xe701a===_0x58197b(0xcf)){let {alias:_0x19bcf7,task:_0x3a82b1,priority:_0x15655c}=_0x11ffbb,_0x5bf710=await P(_0x58197b(0x10a),{'alias':_0x19bcf7,'task':_0x3a82b1,'priority':_0x15655c||_0x58197b(0x141),'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x58197b(0x150)](_0x5bf710)}]};}if(_0xe701a===_0x58197b(0x137)){let {alias:_0x2740bf,message:_0x3d98e3}=_0x11ffbb,_0x8408bd=await P(_0x58197b(0x121),{'alias':_0x2740bf,'message':_0x3d98e3,'from_session':Z});return{'content':[{'type':_0x58197b(0x13d),'text':JSON['stringify'](_0x8408bd)}]};}if(_0xe701a===_0x58197b(0x104)){let _0x2053a3=await P('get_all_status',{});return{'content':[{'type':'text','text':JSON[_0x58197b(0x150)](_0x2053a3)}]};}return{'content':[{'type':_0x58197b(0x13d),'text':JSON['stringify']({'error':_0x58197b(0xdc)})}]};});async function u(){const _0x4dc8a3=a0_0x42f575;let _0x4d7d95=f+_0x4dc8a3(0xeb)+encodeURIComponent(Z),_0x30b36b={};if(X)_0x30b36b['Authorization']=_0x4dc8a3(0xca)+X;Y(_0x4dc8a3(0xe7)+_0x4d7d95);while(!0x0){try{let _0x5dccb0=await fetch(_0x4d7d95,{'headers':_0x30b36b});if(!_0x5dccb0['ok']){Y('SSE\x20error:\x20'+_0x5dccb0[_0x4dc8a3(0x10c)]+'\x20'+_0x5dccb0[_0x4dc8a3(0xfb)]),await h(0x1388);continue;}let _0x4da426=_0x5dccb0[_0x4dc8a3(0x12f)][_0x4dc8a3(0xd2)](),_0x289af3=new TextDecoder(),_0x3ab748='';while(!0x0){let {done:_0x47c828,value:_0x2522e3}=await _0x4da426[_0x4dc8a3(0xf8)]();if(_0x47c828)break;_0x3ab748+=_0x289af3[_0x4dc8a3(0x142)](_0x2522e3,{'stream':!0x0});let _0x5c20ce=_0x3ab748[_0x4dc8a3(0x155)]('\x0a\x0a');_0x3ab748=_0x5c20ce['pop']()||'';for(let _0xfb32d4 of _0x5c20ce){let _0x155b1e=_0xfb32d4[_0x4dc8a3(0x155)]('\x0a')[_0x4dc8a3(0x129)](_0x1b3174=>_0x1b3174[_0x4dc8a3(0x151)]('data:\x20'));if(!_0x155b1e)continue;try{let _0x190aeb=JSON[_0x4dc8a3(0x11a)](_0x155b1e[_0x4dc8a3(0x110)](0x6));await S(_0x190aeb);}catch(_0x42819e){Y('parse\x20error:\x20'+_0x42819e);}}}Y(_0x4dc8a3(0x105));}catch(_0x384392){Y(_0x4dc8a3(0xf6)+_0x384392);}await h(0xbb8);}}async function S(_0x2c87f8){const _0xf66ded=a0_0x42f575;if(_0x2c87f8[_0xf66ded(0x140)]==='connected'){Y(_0xf66ded(0xd9)+Z+'\x22');return;}if(_0x2c87f8[_0xf66ded(0x140)]===_0xf66ded(0x13b)){if(Y(_0xf66ded(0xef)+_0x2c87f8[_0xf66ded(0x109)]+':\x20'+_0x2c87f8[_0xf66ded(0x102)]['slice'](0x0,0x3c)),await K['notification']({'method':_0xf66ded(0xe2),'params':{'content':_0x2c87f8[_0xf66ded(0x102)],'meta':{'sender':_0x2c87f8[_0xf66ded(0x109)]||'hub','sender_id':'commhub','user':_0x2c87f8['from']||_0xf66ded(0x134),'priority':_0xf66ded(0x141)}}}),_0x2c87f8['message_id'])await P(_0xf66ded(0xe4),{'alias':Z,'message_id':_0x2c87f8[_0xf66ded(0x152)]});return;}if(_0x2c87f8[_0xf66ded(0x140)]===_0xf66ded(0x149)||_0x2c87f8[_0xf66ded(0x140)]===_0xf66ded(0x147)){Y('←\x20'+_0x2c87f8[_0xf66ded(0x140)]+_0xf66ded(0xec)+_0x2c87f8[_0xf66ded(0x126)]+_0xf66ded(0x103)+(_0x2c87f8[_0xf66ded(0x12e)]||_0xf66ded(0x141)));let _0x4c7b03=await P(_0xf66ded(0xcd),{'alias':Z,'limit':0x5});if(_0x4c7b03?.['ok']&&_0x4c7b03[_0xf66ded(0x12b)]?.[_0xf66ded(0x113)]>0x0)for(let _0x2cf144 of _0x4c7b03[_0xf66ded(0x12b)]){let _0x130096={'sender':_0x2cf144[_0xf66ded(0xd8)]||_0xf66ded(0x134),'sender_id':_0xf66ded(0x10d),'user':_0x2cf144[_0xf66ded(0xd8)]||_0xf66ded(0x134),'task_id':_0x2cf144['id'],'priority':_0x2cf144['priority']||_0xf66ded(0x141)};k[_0xf66ded(0xee)](_0x2cf144['id'],_0x2cf144['from_session']||_0xf66ded(0x134)),await K[_0xf66ded(0xfc)]({'method':_0xf66ded(0xe2),'params':{'content':_0x2cf144[_0xf66ded(0x130)],'meta':_0x130096}}),Y(_0xf66ded(0x11f)+_0x2cf144['id'][_0xf66ded(0x110)](0x0,0x8)+_0xf66ded(0xdd)+_0x2cf144[_0xf66ded(0xd8)]+':\x20'+_0x2cf144[_0xf66ded(0x130)][_0xf66ded(0x110)](0x0,0x3c)),await P(_0xf66ded(0xe4),{'alias':Z,'message_id':_0x2cf144['id']});}}}async function A(){const _0x57be94=a0_0x42f575;let _0x5eb160=new a0_0x48a60f();await K[_0x57be94(0x133)](_0x5eb160),Y(_0x57be94(0xff)),Y('starting\x20SSE\x20listener...'),u()[_0x57be94(0x143)](_0x1eafcb=>Y(_0x57be94(0x11b)+_0x1eafcb)),P(_0x57be94(0x136),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x4c9c8b(),'hostname':a0_0x4c9c8b(),'agent':_0x57be94(0x123),'project_dir':process['cwd'](),'tmux_name':j||void 0x0})[_0x57be94(0x127)](()=>Y('registered\x20as\x20\x22'+Z+_0x57be94(0xd7)+w['slice'](0x0,0x8)+')'))[_0x57be94(0x143)](_0x1a3319=>Y('warning:\x20could\x20not\x20register:\x20'+_0x1a3319)),setInterval(()=>{const _0x58dcbd=_0x57be94;P('report_status',{'resume_id':w,'alias':Z,'status':_0x58dcbd(0x122),'server':a0_0x4c9c8b(),'hostname':a0_0x4c9c8b(),'agent':_0x58dcbd(0x123),'project_dir':process[_0x58dcbd(0x13c)](),'tmux_name':j||void 0x0})[_0x58dcbd(0x143)](_0xf48293=>Y('heartbeat\x20failed:\x20'+_0xf48293));},0x2bf20),Y(_0x57be94(0xf7));}A()['catch'](_0x548d6f=>{Y('fatal:\x20'+_0x548d6f),process['exit'](0x1);});async function N(){const _0x23719e=a0_0x42f575;Y(_0x23719e(0xcb)),await P('report_status',{'resume_id':w,'alias':Z,'status':_0x23719e(0xdb),'task':'session\x20disconnected'})[_0x23719e(0x143)](()=>{}),process[_0x23719e(0xfa)](0x0);}process[a0_0x42f575(0x10f)]['on'](a0_0x42f575(0xed),()=>N()),process['on'](a0_0x42f575(0x13a),()=>N()),process['on']('SIGINT',()=>N());
2
+ const a0_0x3703b5=a0_0x2400;(function(_0x579cd8,_0x46f1ed){const _0x186722=a0_0x2400,_0x2461c3=_0x579cd8();while(!![]){try{const _0x2ffd96=-parseInt(_0x186722(0x268))/0x1*(-parseInt(_0x186722(0x209))/0x2)+parseInt(_0x186722(0x23e))/0x3*(-parseInt(_0x186722(0x215))/0x4)+parseInt(_0x186722(0x212))/0x5+parseInt(_0x186722(0x222))/0x6*(-parseInt(_0x186722(0x218))/0x7)+parseInt(_0x186722(0x21b))/0x8+parseInt(_0x186722(0x270))/0x9+parseInt(_0x186722(0x22f))/0xa*(-parseInt(_0x186722(0x208))/0xb);if(_0x2ffd96===_0x46f1ed)break;else _0x2461c3['push'](_0x2461c3['shift']());}catch(_0x492043){_0x2461c3['push'](_0x2461c3['shift']());}}}(a0_0x4551,0x3bf3a));import{readFileSync as a0_0x12b05a,existsSync as a0_0x4b5285}from'fs';import{randomUUID as a0_0x2d880e}from'crypto';import{join as a0_0x44732f}from'path';import{hostname as a0_0x247ef3}from'os';import{execSync as a0_0xa2655}from'child_process';import{Server as a0_0x37d4}from'@modelcontextprotocol/sdk/server/index.js';function a0_0x2400(_0x25ba37,_0x800ab6){_0x25ba37=_0x25ba37-0x1ec;const _0x45515a=a0_0x4551();let _0x24002b=_0x45515a[_0x25ba37];return _0x24002b;}import{StdioServerTransport as a0_0x3a769d}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x3acbc1,CallToolRequestSchema as a0_0x438d4b}from'@modelcontextprotocol/sdk/types.js';function p(_0x519c80){const _0x578987=a0_0x2400;if(!a0_0x4b5285(_0x519c80))return;for(let _0x23d61d of a0_0x12b05a(_0x519c80,'utf-8')[_0x578987(0x25a)]('\x0a')){let _0x13f137=_0x23d61d[_0x578987(0x25e)]();if(!_0x13f137||_0x13f137[_0x578987(0x262)]('#'))continue;let _0x128534=_0x13f137[_0x578987(0x230)]('=');if(_0x128534<0x0)continue;let _0x1cb6fa=_0x13f137['slice'](0x0,_0x128534)[_0x578987(0x25e)](),_0x4e96a6=_0x13f137[_0x578987(0x256)](_0x128534+0x1)[_0x578987(0x25e)]()[_0x578987(0x1ec)](/^["']|["']$/g,'');if(!process.env[_0x1cb6fa])process.env[_0x1cb6fa]=_0x4e96a6;}}var C=process.env.HOME||'~',T=a0_0x44732f(C,'.claude/channels/commhub');p(a0_0x44732f(T,'.env'));function a0_0x4551(){const _0x4db423=['join','send_task','835299qfyhRd','replace','commhub','messages','heartbeat\x20failed:\x20','params','exit','toTimeString','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','\x20CWD=','message','inbox_count','fatal:\x20','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','connect','SSE\x20connected\x20as\x20\x22','tools/call','object','commhub_get_all_status','Authorization','status','commhub_reply','report_status','unknown\x20tool','notification','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','parse','cwd','\x20ALIAS=','2233ukwbSn','19874uMrrgR','statusText','commhub_send_task','setRequestHandler','data:\x20','Target\x20session\x20alias','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','←\x20message\x20from\x20','set','515420VLgLvz','idle','commhub-channel','22348UrJXWc','Session\x20alias:\x20','application/json','862309lVkiQY','from','initialize','557544sJtjWM','number','pop','claude-code','get_inbox',']\x20[commhub]\x20','getReader','12MdJjYP','Priority\x20(default:\x20normal)','stringify','normal','utf-8','\x20PROJECT_ENV=','new_message','content','text','SSE\x20error:\x20','parse\x20error:\x20','Message\x20content','blocked','140hcqPXz','indexOf','Bearer\x20','init\x20failed:\x20','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','priority','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','SSE\x20stream\x20ended,\x20reconnecting...','notifications/claude/channel','alias','.env','then','SSE\x20connection\x20error:\x20','body','find','21bXRKMJ','commhub_report_status',':\x20inbox_count=','from_session','none','2025-03-26','catch','type','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','0.3.0','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','length','high','SIGINT','message_id','Task\x20content','completed','hub','stderr','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','failed','...\x20TMUX=','write','read','slice','Current\x20task\x20description','\x20RESUME_ID=','/mcp','split','working','session\x20disconnected','error','trim','string','ack_inbox','delete','startsWith','result','cancelled','replied','starting\x20SSE\x20listener...','get_all_status','27VqKuwX','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','Progress\x200-100','application/json,\x20text/event-stream','commhub_send_message','registered\x20as\x20\x22'];a0_0x4551=function(){return _0x4db423;};return a0_0x4551();}var L=process[a0_0x3703b5(0x206)]()[a0_0x3703b5(0x1ec)](/\//g,'-');p(a0_0x44732f(T,L,a0_0x3703b5(0x239)));function U(){const _0x5ac496=a0_0x3703b5;try{return a0_0xa2655('tmux\x20display-message\x20-p\x20\x27#S\x27',{'encoding':_0x5ac496(0x226),'timeout':0x7d0})[_0x5ac496(0x25e)]();}catch{return'';}}function v(){const _0x29badb=a0_0x3703b5;try{let _0x4ce8ad=a0_0x44732f(C,'.anet','config.json');if(a0_0x4b5285(_0x4ce8ad))return JSON['parse'](a0_0x12b05a(_0x4ce8ad,_0x29badb(0x226)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H['hub']||'http://127.0.0.1:9200',j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x247ef3(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x2d880e(),X=process.env.COMMHUB_TOKEN||H['token']||'';function Y(_0x4c848b){const _0x3ce0ac=a0_0x3703b5;let _0x428332=new Date()[_0x3ce0ac(0x1f2)]()[_0x3ce0ac(0x256)](0x0,0x8);process[_0x3ce0ac(0x250)][_0x3ce0ac(0x254)]('['+_0x428332+_0x3ce0ac(0x220)+_0x4c848b+'\x0a');}function h(_0x464213){return new Promise(_0xdcdadf=>setTimeout(_0xdcdadf,_0x464213));}Y('ENV:\x20URL='+f+a0_0x3703b5(0x207)+Z+a0_0x3703b5(0x258)+w[a0_0x3703b5(0x256)](0x0,0x8)+a0_0x3703b5(0x253)+(j||a0_0x3703b5(0x242))+a0_0x3703b5(0x1f4)+process[a0_0x3703b5(0x206)]()+a0_0x3703b5(0x227)+L);var k=new Map(),K=new a0_0x37d4({'name':a0_0x3703b5(0x214),'version':a0_0x3703b5(0x247)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x3703b5(0x248),a0_0x3703b5(0x204),'Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.',a0_0x3703b5(0x269),a0_0x3703b5(0x216)+Z][a0_0x3703b5(0x26e)]('\x0a')});K[a0_0x3703b5(0x20c)](a0_0x3acbc1,async()=>({'tools':[{'name':'commhub_reply','description':a0_0x3703b5(0x1f3),'inputSchema':{'type':a0_0x3703b5(0x1fc),'properties':{'task_id':{'type':a0_0x3703b5(0x25f),'description':a0_0x3703b5(0x246)},'text':{'type':a0_0x3703b5(0x25f),'description':'Reply\x20text\x20/\x20result\x20summary'},'status':{'type':a0_0x3703b5(0x25f),'enum':[a0_0x3703b5(0x24e),a0_0x3703b5(0x252),a0_0x3703b5(0x264),'blocked',a0_0x3703b5(0x25d),'in_progress'],'description':a0_0x3703b5(0x233)}},'required':[a0_0x3703b5(0x22a)]}},{'name':a0_0x3703b5(0x23f),'description':a0_0x3703b5(0x251),'inputSchema':{'type':a0_0x3703b5(0x1fc),'properties':{'status':{'type':a0_0x3703b5(0x25f),'enum':[a0_0x3703b5(0x25b),a0_0x3703b5(0x213),a0_0x3703b5(0x22e),a0_0x3703b5(0x25d)]},'task':{'type':a0_0x3703b5(0x25f),'description':a0_0x3703b5(0x257)},'progress':{'type':a0_0x3703b5(0x21c),'description':a0_0x3703b5(0x26a)}},'required':[a0_0x3703b5(0x1ff)]}},{'name':a0_0x3703b5(0x20b),'description':a0_0x3703b5(0x1f8),'inputSchema':{'type':a0_0x3703b5(0x1fc),'properties':{'alias':{'type':a0_0x3703b5(0x25f),'description':a0_0x3703b5(0x20e)},'task':{'type':a0_0x3703b5(0x25f),'description':a0_0x3703b5(0x24d)},'priority':{'type':'string','enum':[a0_0x3703b5(0x24a),a0_0x3703b5(0x225),'low'],'description':a0_0x3703b5(0x223)}},'required':[a0_0x3703b5(0x238),'task']}},{'name':a0_0x3703b5(0x26c),'description':a0_0x3703b5(0x20f),'inputSchema':{'type':a0_0x3703b5(0x1fc),'properties':{'alias':{'type':a0_0x3703b5(0x25f),'description':'Target\x20session\x20alias'},'message':{'type':a0_0x3703b5(0x25f),'description':a0_0x3703b5(0x22d)}},'required':['alias',a0_0x3703b5(0x1f5)]}},{'name':a0_0x3703b5(0x1fd),'description':a0_0x3703b5(0x235),'inputSchema':{'type':'object','properties':{}}}]}));async function P(_0x76d5bb,_0x20d1f){const _0x23f982=a0_0x3703b5;let _0xa708cf=await fetch(f+_0x23f982(0x259),{'method':'POST','headers':{'Content-Type':_0x23f982(0x217),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x23f982(0x231)+X}:{}},'body':JSON['stringify']({'jsonrpc':'2.0','id':0x1,'method':_0x23f982(0x21a),'params':{'protocolVersion':_0x23f982(0x243),'capabilities':{},'clientInfo':{'name':_0x23f982(0x214),'version':_0x23f982(0x247)}}})});if(!_0xa708cf['ok']){let _0x39e16a=await _0xa708cf[_0x23f982(0x22a)]();return Y('CommHub\x20init\x20failed:\x20'+_0xa708cf['status']+'\x20'+_0x39e16a[_0x23f982(0x256)](0x0,0x64)),{'ok':!0x1,'error':_0x23f982(0x232)+_0xa708cf[_0x23f982(0x1ff)]};}await _0xa708cf[_0x23f982(0x22a)]();let _0x46ac42=(await(await fetch(f+'/mcp',{'method':'POST','headers':{'Content-Type':'application/json','Accept':_0x23f982(0x26b),...X?{'Authorization':_0x23f982(0x231)+X}:{}},'body':JSON[_0x23f982(0x224)]({'jsonrpc':'2.0','id':0x2,'method':_0x23f982(0x1fb),'params':{'name':_0x76d5bb,'arguments':_0x20d1f}})}))[_0x23f982(0x22a)]())[_0x23f982(0x25a)]('\x0a')[_0x23f982(0x23d)](_0x4272b6=>_0x4272b6[_0x23f982(0x262)](_0x23f982(0x20d)));if(_0x46ac42){let _0x178cc7=JSON[_0x23f982(0x205)](_0x46ac42[_0x23f982(0x256)](0x6));return _0x178cc7?.[_0x23f982(0x263)]?.['content']?.[0x0]?.[_0x23f982(0x22a)]?JSON[_0x23f982(0x205)](_0x178cc7[_0x23f982(0x263)][_0x23f982(0x229)][0x0][_0x23f982(0x22a)]):_0x178cc7;}return{'ok':!0x1,'error':'no\x20response'};}K[a0_0x3703b5(0x20c)](a0_0x438d4b,async _0x5129c2=>{const _0x5a5863=a0_0x3703b5;let {name:_0xf17957,arguments:_0x2f07ec}=_0x5129c2[_0x5a5863(0x1f0)];if(_0xf17957===_0x5a5863(0x200)){let {task_id:_0xbf727a,text:_0x1cfa25,status:_0x29696e}=_0x2f07ec;if(_0x29696e===_0x5a5863(0x24e)||_0x29696e===_0x5a5863(0x252)||_0x29696e==='cancelled'){let _0x330380=_0x29696e===_0x5a5863(0x24e)?_0x5a5863(0x265):_0x29696e,_0x246fc0=_0xbf727a?k['get'](_0xbf727a)||'hub':_0x5a5863(0x24f),_0x4c2ecc=await P('send_reply',{'alias':_0x246fc0,'text':_0x1cfa25,'in_reply_to':_0xbf727a||void 0x0,'status':_0x330380,'from_session':Z});if(_0xbf727a)k[_0x5a5863(0x261)](_0xbf727a);return{'content':[{'type':_0x5a5863(0x22a),'text':JSON['stringify'](_0x4c2ecc)}]};}let _0x5defb7=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x29696e===_0x5a5863(0x22e)?'blocked':_0x29696e===_0x5a5863(0x25d)?'error':_0x5a5863(0x25b),'task':_0x1cfa25[_0x5a5863(0x256)](0x0,0xc8),'output':_0x1cfa25});return{'content':[{'type':_0x5a5863(0x22a),'text':JSON[_0x5a5863(0x224)](_0x5defb7)}]};}if(_0xf17957===_0x5a5863(0x23f)){let {status:_0x2895cf,task:_0x49339b,progress:_0x2bb960}=_0x2f07ec,_0x895022=await P(_0x5a5863(0x201),{'resume_id':w,'alias':Z,'status':_0x2895cf,'task':_0x49339b,'progress':_0x2bb960});return{'content':[{'type':_0x5a5863(0x22a),'text':JSON[_0x5a5863(0x224)](_0x895022)}]};}if(_0xf17957===_0x5a5863(0x20b)){let {alias:_0x563bdc,task:_0xf50766,priority:_0x5c40f6}=_0x2f07ec,_0xece28b=await P(_0x5a5863(0x26f),{'alias':_0x563bdc,'task':_0xf50766,'priority':_0x5c40f6||'normal','from_session':Z});return{'content':[{'type':_0x5a5863(0x22a),'text':JSON[_0x5a5863(0x224)](_0xece28b)}]};}if(_0xf17957===_0x5a5863(0x26c)){let {alias:_0x4c246a,message:_0x5704b6}=_0x2f07ec,_0x2e33c8=await P('send_message',{'alias':_0x4c246a,'message':_0x5704b6,'from_session':Z});return{'content':[{'type':_0x5a5863(0x22a),'text':JSON[_0x5a5863(0x224)](_0x2e33c8)}]};}if(_0xf17957===_0x5a5863(0x1fd)){let _0x3d2f94=await P(_0x5a5863(0x267),{});return{'content':[{'type':_0x5a5863(0x22a),'text':JSON[_0x5a5863(0x224)](_0x3d2f94)}]};}return{'content':[{'type':'text','text':JSON['stringify']({'error':_0x5a5863(0x202)})}]};});async function u(){const _0x32f0e8=a0_0x3703b5;let _0x5f3af5=f+'/events/'+encodeURIComponent(Z),_0x3c2cf6={};if(X)_0x3c2cf6[_0x32f0e8(0x1fe)]=_0x32f0e8(0x231)+X;Y('connecting\x20to\x20'+_0x5f3af5);while(!0x0){try{let _0x354e75=await fetch(_0x5f3af5,{'headers':_0x3c2cf6});if(!_0x354e75['ok']){Y(_0x32f0e8(0x22b)+_0x354e75[_0x32f0e8(0x1ff)]+'\x20'+_0x354e75[_0x32f0e8(0x20a)]),await h(0x1388);continue;}let _0x4a51d6=_0x354e75[_0x32f0e8(0x23c)][_0x32f0e8(0x221)](),_0x156411=new TextDecoder(),_0x5d6beb='';while(!0x0){let {done:_0x2caf35,value:_0x543a47}=await _0x4a51d6[_0x32f0e8(0x255)]();if(_0x2caf35)break;_0x5d6beb+=_0x156411['decode'](_0x543a47,{'stream':!0x0});let _0x503cce=_0x5d6beb[_0x32f0e8(0x25a)]('\x0a\x0a');_0x5d6beb=_0x503cce[_0x32f0e8(0x21d)]()||'';for(let _0x310977 of _0x503cce){let _0x22d101=_0x310977[_0x32f0e8(0x25a)]('\x0a')['find'](_0x59aede=>_0x59aede['startsWith'](_0x32f0e8(0x20d)));if(!_0x22d101)continue;try{let _0xcf3bb2=JSON[_0x32f0e8(0x205)](_0x22d101[_0x32f0e8(0x256)](0x6));await S(_0xcf3bb2);}catch(_0x547993){Y(_0x32f0e8(0x22c)+_0x547993);}}}Y(_0x32f0e8(0x236));}catch(_0x5478dd){Y(_0x32f0e8(0x23b)+_0x5478dd);}await h(0xbb8);}}async function S(_0x4ab1bb){const _0x6c78e6=a0_0x3703b5;if(_0x4ab1bb[_0x6c78e6(0x245)]==='connected'){Y(_0x6c78e6(0x1fa)+Z+'\x22');return;}if(_0x4ab1bb['type']===_0x6c78e6(0x228)){if(Y(_0x6c78e6(0x210)+_0x4ab1bb[_0x6c78e6(0x219)]+':\x20'+_0x4ab1bb[_0x6c78e6(0x1f5)][_0x6c78e6(0x256)](0x0,0x3c)),await K[_0x6c78e6(0x203)]({'method':_0x6c78e6(0x237),'params':{'content':_0x4ab1bb['message'],'meta':{'sender':_0x4ab1bb[_0x6c78e6(0x219)]||_0x6c78e6(0x24f),'sender_id':_0x6c78e6(0x1ed),'user':_0x4ab1bb[_0x6c78e6(0x219)]||_0x6c78e6(0x24f),'priority':_0x6c78e6(0x225)}}}),_0x4ab1bb['message_id'])await P(_0x6c78e6(0x260),{'alias':Z,'message_id':_0x4ab1bb[_0x6c78e6(0x24c)]});return;}if(_0x4ab1bb['type']==='new_task'||_0x4ab1bb[_0x6c78e6(0x245)]==='broadcast'){Y('←\x20'+_0x4ab1bb['type']+_0x6c78e6(0x240)+_0x4ab1bb[_0x6c78e6(0x1f6)]+'\x20priority='+(_0x4ab1bb[_0x6c78e6(0x234)]||_0x6c78e6(0x225)));let _0x22f0f3=await P(_0x6c78e6(0x21f),{'alias':Z,'limit':0x5});if(_0x22f0f3?.['ok']&&_0x22f0f3[_0x6c78e6(0x1ee)]?.[_0x6c78e6(0x249)]>0x0)for(let _0x1572e4 of _0x22f0f3[_0x6c78e6(0x1ee)]){let _0x51e37e={'sender':_0x1572e4[_0x6c78e6(0x241)]||'hub','sender_id':_0x6c78e6(0x1ed),'user':_0x1572e4['from_session']||_0x6c78e6(0x24f),'task_id':_0x1572e4['id'],'priority':_0x1572e4[_0x6c78e6(0x234)]||_0x6c78e6(0x225)};k[_0x6c78e6(0x211)](_0x1572e4['id'],_0x1572e4[_0x6c78e6(0x241)]||_0x6c78e6(0x24f)),await K[_0x6c78e6(0x203)]({'method':_0x6c78e6(0x237),'params':{'content':_0x1572e4['content'],'meta':_0x51e37e}}),Y('→\x20injected\x20task\x20'+_0x1572e4['id'][_0x6c78e6(0x256)](0x0,0x8)+'\x20from\x20'+_0x1572e4['from_session']+':\x20'+_0x1572e4[_0x6c78e6(0x229)][_0x6c78e6(0x256)](0x0,0x3c)),await P('ack_inbox',{'alias':Z,'message_id':_0x1572e4['id']});}}}async function A(){const _0x3c8bca=a0_0x3703b5;let _0x28a71b=new a0_0x3a769d();await K[_0x3c8bca(0x1f9)](_0x28a71b),Y('MCP\x20stdio\x20connected'),Y(_0x3c8bca(0x266)),u()['catch'](_0x2189a8=>Y('SSE\x20fatal:\x20'+_0x2189a8)),P(_0x3c8bca(0x201),{'resume_id':w,'alias':Z,'status':_0x3c8bca(0x213),'server':a0_0x247ef3(),'hostname':a0_0x247ef3(),'agent':_0x3c8bca(0x21e),'project_dir':process[_0x3c8bca(0x206)](),'tmux_name':j||void 0x0})[_0x3c8bca(0x23a)](()=>Y(_0x3c8bca(0x26d)+Z+'\x22\x20('+w[_0x3c8bca(0x256)](0x0,0x8)+')'))['catch'](_0x3430b1=>Y('warning:\x20could\x20not\x20register:\x20'+_0x3430b1)),setInterval(()=>{const _0x23de49=_0x3c8bca;P(_0x23de49(0x201),{'resume_id':w,'alias':Z,'status':_0x23de49(0x213),'server':a0_0x247ef3(),'hostname':a0_0x247ef3(),'agent':_0x23de49(0x21e),'project_dir':process[_0x23de49(0x206)](),'tmux_name':j||void 0x0})['catch'](_0x1163b4=>Y(_0x23de49(0x1ef)+_0x1163b4));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}A()[a0_0x3703b5(0x244)](_0x313b38=>{const _0x550452=a0_0x3703b5;Y(_0x550452(0x1f7)+_0x313b38),process['exit'](0x1);});async function N(){const _0x1f1e73=a0_0x3703b5;Y('shutting\x20down,\x20reporting\x20offline...'),await P(_0x1f1e73(0x201),{'resume_id':w,'alias':Z,'status':_0x1f1e73(0x25d),'task':_0x1f1e73(0x25c)})['catch'](()=>{}),process[_0x1f1e73(0x1f1)](0x0);}process['stdin']['on']('end',()=>N()),process['on']('SIGTERM',()=>N()),process['on'](a0_0x3703b5(0x24b),()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.1.4-preview.2",
3
+ "version": "2.1.4-preview.4",
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",