@sleep2agi/agent-network 2.1.3-preview.0 → 2.1.3-preview.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- function a0_0x30f6(){const _0x4cd47e=['min','heartbeatInterval','messages','SSE\x20failed:\x20',']\x20[commhub:','sdk','3181JSpPFN','disconnected','status','error','24944bRWGGK','connectSSE','2093436AUGuna','abort','result','heartbeat\x20failed:\x20','POST','new_task','text/event-stream','name','stringify','sleep','reply','call','application/json,\x20text/event-stream','split','2.0','parse','resumeId','replace','AbortError','agent','SSE\x20connected','idle','connected','33EkeYDc','match','5898WGcRwp','5522481WGQFtr','get_all_status','getReader','connect','send','log','autoConnect','slice','cwd','614ALyNRA','read','application/json','broadcast','processInbox','get_inbox','toString','Authorization','reconnectDelay','offline','4088CNsvTi','sdk-','getAllStatus','8ohZJvS','alias','send_message','task','text','heartbeatTimer','disconnect','Bearer\x20','url','report_status','pop','SSE\x20reconnecting\x20in\x20','token','running','219200XWcOCz','content','decode','body','catch','signal','9739320WvIakJ','startsWith','955BbNxNc','normal','emit','type','sseAbort','message'];a0_0x30f6=function(){return _0x4cd47e;};return a0_0x30f6();}const a0_0x4163cf=a0_0x2a5c;function a0_0x2a5c(_0x3f729c,_0x351c37){_0x3f729c=_0x3f729c-0x1a2;const _0x30f609=a0_0x30f6();let _0x2a5cdd=_0x30f609[_0x3f729c];return _0x2a5cdd;}(function(_0x553891,_0x4c3a42){const _0x189280=a0_0x2a5c,_0x355b7e=_0x553891();while(!![]){try{const _0x3cfc42=parseInt(_0x189280(0x1c5))/0x1*(-parseInt(_0x189280(0x1ee))/0x2)+-parseInt(_0x189280(0x1cb))/0x3+parseInt(_0x189280(0x1c9))/0x4*(parseInt(_0x189280(0x1b9))/0x5)+parseInt(_0x189280(0x1e4))/0x6*(-parseInt(_0x189280(0x1f8))/0x7)+-parseInt(_0x189280(0x1a3))/0x8*(parseInt(_0x189280(0x1e5))/0x9)+parseInt(_0x189280(0x1b1))/0xa+-parseInt(_0x189280(0x1e2))/0xb*(-parseInt(_0x189280(0x1b7))/0xc);if(_0x3cfc42===_0x4c3a42)break;else _0x355b7e['push'](_0x355b7e['shift']());}catch(_0x26ff9c){_0x355b7e['push'](_0x355b7e['shift']());}}}(a0_0x30f6,0xbfd66));import{EventEmitter as a0_0x36537b}from'events';import{hostname as a0_0x521de1}from'os';class T extends a0_0x36537b{[a0_0x4163cf(0x1ab)];[a0_0x4163cf(0x1a4)];[a0_0x4163cf(0x1af)];[a0_0x4163cf(0x1de)];[a0_0x4163cf(0x1db)];[a0_0x4163cf(0x1c0)];['reconnectDelay'];[a0_0x4163cf(0x1a8)];[a0_0x4163cf(0x1bd)];[a0_0x4163cf(0x1b0)]=!0x1;constructor(_0x23d577){const _0x43b7fd=a0_0x4163cf;super();if(this[_0x43b7fd(0x1ab)]=_0x23d577[_0x43b7fd(0x1ab)][_0x43b7fd(0x1dc)](/\/$/,''),this[_0x43b7fd(0x1a4)]=_0x23d577[_0x43b7fd(0x1a4)],this[_0x43b7fd(0x1af)]=_0x23d577[_0x43b7fd(0x1af)],this[_0x43b7fd(0x1de)]=_0x23d577[_0x43b7fd(0x1de)]||_0x43b7fd(0x1c4),this['resumeId']=_0x43b7fd(0x1f9)+_0x23d577[_0x43b7fd(0x1a4)]+'-'+Date['now']()[_0x43b7fd(0x1f4)](0x24),this['heartbeatInterval']=_0x23d577[_0x43b7fd(0x1c0)]??0x2bf20,this['reconnectDelay']=_0x23d577[_0x43b7fd(0x1f6)]??0xbb8,_0x23d577[_0x43b7fd(0x1eb)]!==!0x1)this[_0x43b7fd(0x1e8)]();}[a0_0x4163cf(0x1ea)](_0x3e0629){const _0x24380e=a0_0x4163cf;console[_0x24380e(0x1ea)]('['+new Date()['toTimeString']()[_0x24380e(0x1ec)](0x0,0x8)+_0x24380e(0x1c3)+this[_0x24380e(0x1a4)]+']\x20'+_0x3e0629);}async['call'](_0x1b5185,_0x70052e){const _0x38de33=a0_0x4163cf;let _0x5dc29f={'Content-Type':_0x38de33(0x1f0),'Accept':_0x38de33(0x1d7)};if(this['token'])_0x5dc29f['Authorization']=_0x38de33(0x1aa)+this[_0x38de33(0x1af)];let _0x2a3ded=await(await fetch(this['url']+'/mcp',{'method':_0x38de33(0x1cf),'headers':_0x5dc29f,'body':JSON[_0x38de33(0x1d3)]({'jsonrpc':_0x38de33(0x1d9),'id':Date['now'](),'method':'tools/call','params':{'name':_0x1b5185,'arguments':_0x70052e}})}))[_0x38de33(0x1a7)](),_0x5a98cd=_0x2a3ded[_0x38de33(0x1e3)](/data: (.+)/),_0x338d78=_0x5a98cd?JSON[_0x38de33(0x1da)](_0x5a98cd[0x1]):JSON[_0x38de33(0x1da)](_0x2a3ded),_0x556671=_0x338d78?.[_0x38de33(0x1cd)]?.[_0x38de33(0x1b2)]?.[0x0]?.[_0x38de33(0x1a7)];return _0x556671?JSON[_0x38de33(0x1da)](_0x556671):_0x338d78;}async[a0_0x4163cf(0x1e8)](){const _0x13f1eb=a0_0x4163cf;if(this[_0x13f1eb(0x1b0)])return;this[_0x13f1eb(0x1b0)]=!0x0,await this['status'](_0x13f1eb(0x1e0)),this[_0x13f1eb(0x1ea)]('registered'),this[_0x13f1eb(0x1a8)]=setInterval(()=>{const _0x18acf2=_0x13f1eb;this[_0x18acf2(0x1c7)](_0x18acf2(0x1e0))['catch'](_0x17e3d0=>this[_0x18acf2(0x1ea)](_0x18acf2(0x1ce)+_0x17e3d0[_0x18acf2(0x1be)]));},this['heartbeatInterval']),this['connectSSE']();}async[a0_0x4163cf(0x1a9)](){const _0x29507f=a0_0x4163cf;if(this[_0x29507f(0x1b0)]=!0x1,this['sseAbort']?.[_0x29507f(0x1cc)](),this[_0x29507f(0x1a8)])clearInterval(this[_0x29507f(0x1a8)]);await this[_0x29507f(0x1c7)](_0x29507f(0x1f7))[_0x29507f(0x1b5)](()=>{}),this[_0x29507f(0x1ea)](_0x29507f(0x1c6));}async[a0_0x4163cf(0x1e9)](_0xf962ba,_0x514f41,_0x195260=a0_0x4163cf(0x1ba)){return this['call']('send_task',{'alias':_0xf962ba,'task':_0x514f41,'priority':_0x195260,'from_session':this['alias']});}async[a0_0x4163cf(0x1be)](_0x344924,_0x475ec4){const _0x31b885=a0_0x4163cf;return this[_0x31b885(0x1d6)](_0x31b885(0x1a5),{'alias':_0x344924,'message':_0x475ec4,'from_session':this[_0x31b885(0x1a4)]});}async[a0_0x4163cf(0x1d5)](_0x2b74e0,_0x16986b,_0x8955b2='completed'){const _0x2a1223=a0_0x4163cf;return this[_0x2a1223(0x1d6)]('send_reply',{'in_reply_to':_0x2b74e0,'text':_0x16986b,'status':_0x8955b2});}async[a0_0x4163cf(0x1c7)](_0x124e5f,_0x1725e7){const _0xab5a3f=a0_0x4163cf;return this[_0xab5a3f(0x1d6)](_0xab5a3f(0x1ac),{'resume_id':this[_0xab5a3f(0x1db)],'alias':this[_0xab5a3f(0x1a4)],'status':_0x124e5f,'server':a0_0x521de1(),'hostname':a0_0x521de1(),'agent':this[_0xab5a3f(0x1de)],'project_dir':process[_0xab5a3f(0x1ed)](),..._0x1725e7});}async[a0_0x4163cf(0x1a2)](){const _0x4ce709=a0_0x4163cf;return this[_0x4ce709(0x1d6)](_0x4ce709(0x1e6),{});}async[a0_0x4163cf(0x1f1)](_0x523943,_0x3a8964){const _0x352016=a0_0x4163cf;return this['call'](_0x352016(0x1f1),{'message':_0x523943,'filter_server':_0x3a8964?.['server'],'filter_status':_0x3a8964?.[_0x352016(0x1c7)]});}async[a0_0x4163cf(0x1ca)](){const _0x11e6af=a0_0x4163cf;let _0xff5c8d=encodeURIComponent(this[_0x11e6af(0x1a4)]),_0x1baf1e=this[_0x11e6af(0x1ab)]+'/events/'+_0xff5c8d,_0x978e61=this['reconnectDelay'];while(this['running']){try{this[_0x11e6af(0x1bd)]=new AbortController();let _0x2b7647={'Accept':_0x11e6af(0x1d1)};if(this[_0x11e6af(0x1af)])_0x2b7647[_0x11e6af(0x1f5)]=_0x11e6af(0x1aa)+this['token'];let _0x4fb1b8=await fetch(_0x1baf1e,{'headers':_0x2b7647,'signal':this[_0x11e6af(0x1bd)][_0x11e6af(0x1b6)]});if(!_0x4fb1b8['ok']||!_0x4fb1b8[_0x11e6af(0x1b4)]){this['log'](_0x11e6af(0x1c2)+_0x4fb1b8[_0x11e6af(0x1c7)]),await this[_0x11e6af(0x1d4)](_0x978e61),_0x978e61=Math['min'](_0x978e61*1.5,0xea60);continue;}_0x978e61=this[_0x11e6af(0x1f6)];let _0xe1b785=_0x4fb1b8[_0x11e6af(0x1b4)][_0x11e6af(0x1e7)](),_0x40706a=new TextDecoder(),_0x210796='';while(this[_0x11e6af(0x1b0)]){let {done:_0x4bea24,value:_0x4cbf4d}=await _0xe1b785[_0x11e6af(0x1ef)]();if(_0x4bea24)break;_0x210796+=_0x40706a[_0x11e6af(0x1b3)](_0x4cbf4d,{'stream':!0x0});let _0x3a11c8=_0x210796[_0x11e6af(0x1d8)]('\x0a');_0x210796=_0x3a11c8[_0x11e6af(0x1ad)]()||'';for(let _0x176b67 of _0x3a11c8){if(!_0x176b67[_0x11e6af(0x1b8)]('data:\x20'))continue;try{let _0x1f1e87=JSON[_0x11e6af(0x1da)](_0x176b67[_0x11e6af(0x1ec)](0x6));if(_0x1f1e87['type']===_0x11e6af(0x1e1)){this['log'](_0x11e6af(0x1df)),this['emit'](_0x11e6af(0x1e1));continue;}if(_0x1f1e87[_0x11e6af(0x1bc)]===_0x11e6af(0x1d0)||_0x1f1e87[_0x11e6af(0x1bc)]==='new_message'||_0x1f1e87['type']===_0x11e6af(0x1f1))await this[_0x11e6af(0x1f2)]();}catch{}}}}catch(_0x5c9231){if(_0x5c9231[_0x11e6af(0x1d2)]===_0x11e6af(0x1dd))break;this[_0x11e6af(0x1bb)](_0x11e6af(0x1c8),_0x5c9231),this[_0x11e6af(0x1ea)]('SSE\x20error:\x20'+_0x5c9231[_0x11e6af(0x1be)]);}if(this[_0x11e6af(0x1b0)])this[_0x11e6af(0x1bb)](_0x11e6af(0x1c6)),this[_0x11e6af(0x1ea)](_0x11e6af(0x1ae)+_0x978e61/0x3e8+'s...'),await this['sleep'](_0x978e61),_0x978e61=Math[_0x11e6af(0x1bf)](_0x978e61*1.5,0xea60);}}async[a0_0x4163cf(0x1f2)](){const _0x21a174=a0_0x4163cf;try{let _0x3d080c=(await this[_0x21a174(0x1d6)](_0x21a174(0x1f3),{'alias':this[_0x21a174(0x1a4)],'limit':0xa}))?.[_0x21a174(0x1c1)]||[];for(let _0x36aed3 of _0x3d080c)await this[_0x21a174(0x1d6)]('ack_inbox',{'alias':this['alias'],'message_id':_0x36aed3['id']}),this['log']('←\x20'+_0x36aed3['from_session']+':\x20'+_0x36aed3['content']['slice'](0x0,0x3c)),this[_0x21a174(0x1bb)](_0x21a174(0x1a6),_0x36aed3),this[_0x21a174(0x1bb)](_0x21a174(0x1be),_0x36aed3);}catch(_0x3951c6){this[_0x21a174(0x1ea)]('inbox\x20error:\x20'+_0x3951c6[_0x21a174(0x1be)]);}}[a0_0x4163cf(0x1d4)](_0xe9ce34){return new Promise(_0x30c398=>setTimeout(_0x30c398,_0xe9ce34));}}var $=T;export{$ as default,T as CommHub};
1
+ const a0_0x18d3c6=a0_0xf58a;(function(_0x2617bd,_0xf1631e){const _0x2dc98f=a0_0xf58a,_0x106d10=_0x2617bd();while(!![]){try{const _0x198501=parseInt(_0x2dc98f(0x18c))/0x1*(-parseInt(_0x2dc98f(0x1b6))/0x2)+-parseInt(_0x2dc98f(0x1d4))/0x3+-parseInt(_0x2dc98f(0x1c6))/0x4*(-parseInt(_0x2dc98f(0x1ab))/0x5)+-parseInt(_0x2dc98f(0x1a8))/0x6*(parseInt(_0x2dc98f(0x1d2))/0x7)+parseInt(_0x2dc98f(0x1b7))/0x8*(parseInt(_0x2dc98f(0x1a4))/0x9)+parseInt(_0x2dc98f(0x195))/0xa+-parseInt(_0x2dc98f(0x199))/0xb*(-parseInt(_0x2dc98f(0x1ba))/0xc);if(_0x198501===_0xf1631e)break;else _0x106d10['push'](_0x106d10['shift']());}catch(_0x22987f){_0x106d10['push'](_0x106d10['shift']());}}}(a0_0x3510,0x99e56));import{EventEmitter as a0_0x18eb7a}from'events';function a0_0xf58a(_0x8050a2,_0x2231fe){_0x8050a2=_0x8050a2-0x188;const _0x351015=a0_0x3510();let _0xf58ac1=_0x351015[_0x8050a2];return _0xf58ac1;}import{hostname as a0_0x505b29}from'os';function a0_0x3510(){const _0x464676=['alias','emit','message','offline','task','ack_inbox','heartbeatInterval','sleep','45rcfNlB','inbox\x20error:\x20','call','result','1864788uvnwwI','from_session','error','25jQleIr','new_message','text/event-stream','report_status','body','abort','sdk-','token','pop','running','heartbeat\x20failed:\x20','38PFcMNA','1899224DAnctT','completed','SSE\x20failed:\x20','16776QQnuac','/mcp','parse','getAllStatus','registered','resumeId','cwd','url','send','send_reply','get_all_status','content','542460ziCmnH','heartbeatTimer','connected','agent','now','reconnectDelay','decode','status','get_inbox','s...','read','split','28JFrFRx','log','303108KWSvvp','2.0','stringify','autoConnect','match','slice','SSE\x20connected','name','processInbox','application/json','Authorization','SSE\x20error:\x20','50852hFCpRN','disconnected','idle','connectSSE','toTimeString','Bearer\x20','min','messages','sseAbort','7247860PeAJBF','catch','normal','type','2761HPZyqy','broadcast','text'];a0_0x3510=function(){return _0x464676;};return a0_0x3510();}class T extends a0_0x18eb7a{['url'];[a0_0x18d3c6(0x19c)];['token'];[a0_0x18d3c6(0x1c9)];[a0_0x18d3c6(0x1bf)];[a0_0x18d3c6(0x1a2)];[a0_0x18d3c6(0x1cb)];[a0_0x18d3c6(0x1c7)];['sseAbort'];[a0_0x18d3c6(0x1b4)]=!0x1;constructor(_0x276a4a){const _0x188731=a0_0x18d3c6;super();if(this[_0x188731(0x1c1)]=_0x276a4a[_0x188731(0x1c1)]['replace'](/\/$/,''),this['alias']=_0x276a4a[_0x188731(0x19c)],this[_0x188731(0x1b2)]=_0x276a4a[_0x188731(0x1b2)],this[_0x188731(0x1c9)]=_0x276a4a[_0x188731(0x1c9)]||'sdk',this[_0x188731(0x1bf)]=_0x188731(0x1b1)+_0x276a4a['alias']+'-'+Date[_0x188731(0x1ca)]()['toString'](0x24),this[_0x188731(0x1a2)]=_0x276a4a[_0x188731(0x1a2)]??0x2bf20,this[_0x188731(0x1cb)]=_0x276a4a[_0x188731(0x1cb)]??0xbb8,_0x276a4a[_0x188731(0x1d7)]!==!0x1)this['connect']();}[a0_0x18d3c6(0x1d3)](_0x34fa24){const _0x26688c=a0_0x18d3c6;console[_0x26688c(0x1d3)]('['+new Date()[_0x26688c(0x190)]()['slice'](0x0,0x8)+']\x20[commhub:'+this[_0x26688c(0x19c)]+']\x20'+_0x34fa24);}async['call'](_0x4a845a,_0x4ec2eb){const _0x53f200=a0_0x18d3c6;let _0x1850c7={'Content-Type':_0x53f200(0x189),'Accept':'application/json,\x20text/event-stream'};if(this[_0x53f200(0x1b2)])_0x1850c7['Authorization']=_0x53f200(0x191)+this['token'];let _0x22aee6=await(await fetch(this[_0x53f200(0x1c1)]+_0x53f200(0x1bb),{'method':'POST','headers':_0x1850c7,'body':JSON[_0x53f200(0x1d6)]({'jsonrpc':_0x53f200(0x1d5),'id':Date[_0x53f200(0x1ca)](),'method':'tools/call','params':{'name':_0x4a845a,'arguments':_0x4ec2eb}})}))[_0x53f200(0x19b)](),_0x306c5e=_0x22aee6[_0x53f200(0x1d8)](/data: (.+)/),_0x19b88e=_0x306c5e?JSON['parse'](_0x306c5e[0x1]):JSON[_0x53f200(0x1bc)](_0x22aee6),_0x32ccfe=_0x19b88e?.[_0x53f200(0x1a7)]?.[_0x53f200(0x1c5)]?.[0x0]?.[_0x53f200(0x19b)];return _0x32ccfe?JSON[_0x53f200(0x1bc)](_0x32ccfe):_0x19b88e;}async['connect'](){const _0x149ac5=a0_0x18d3c6;if(this[_0x149ac5(0x1b4)])return;this[_0x149ac5(0x1b4)]=!0x0,await this[_0x149ac5(0x1cd)](_0x149ac5(0x18e)),this[_0x149ac5(0x1d3)](_0x149ac5(0x1be)),this[_0x149ac5(0x1c7)]=setInterval(()=>{const _0x4acb28=_0x149ac5;this['status'](_0x4acb28(0x18e))['catch'](_0x4a47b0=>this['log'](_0x4acb28(0x1b5)+_0x4a47b0[_0x4acb28(0x19e)]));},this[_0x149ac5(0x1a2)]),this[_0x149ac5(0x18f)]();}async['disconnect'](){const _0xe86b89=a0_0x18d3c6;if(this[_0xe86b89(0x1b4)]=!0x1,this['sseAbort']?.[_0xe86b89(0x1b0)](),this[_0xe86b89(0x1c7)])clearInterval(this[_0xe86b89(0x1c7)]);await this[_0xe86b89(0x1cd)](_0xe86b89(0x19f))[_0xe86b89(0x196)](()=>{}),this['log']('disconnected');}async[a0_0x18d3c6(0x1c2)](_0x2ff8af,_0x2f4153,_0x545a6f=a0_0x18d3c6(0x197)){const _0x51bb27=a0_0x18d3c6;return this['call']('send_task',{'alias':_0x2ff8af,'task':_0x2f4153,'priority':_0x545a6f,'from_session':this[_0x51bb27(0x19c)]});}async[a0_0x18d3c6(0x19e)](_0x1e5d8a,_0x37410f){const _0x17ac42=a0_0x18d3c6;return this[_0x17ac42(0x1a6)]('send_message',{'alias':_0x1e5d8a,'message':_0x37410f,'from_session':this[_0x17ac42(0x19c)]});}async['reply'](_0x4475d2,_0x6de670,_0x1f5d64=a0_0x18d3c6(0x1b8)){const _0x19a476=a0_0x18d3c6;return this[_0x19a476(0x1a6)](_0x19a476(0x1c3),{'in_reply_to':_0x4475d2,'text':_0x6de670,'status':_0x1f5d64});}async[a0_0x18d3c6(0x1cd)](_0x49f960,_0x2fb909){const _0x28b1b4=a0_0x18d3c6;return this[_0x28b1b4(0x1a6)](_0x28b1b4(0x1ae),{'resume_id':this[_0x28b1b4(0x1bf)],'alias':this[_0x28b1b4(0x19c)],'status':_0x49f960,'server':a0_0x505b29(),'hostname':a0_0x505b29(),'agent':this[_0x28b1b4(0x1c9)],'project_dir':process[_0x28b1b4(0x1c0)](),..._0x2fb909});}async[a0_0x18d3c6(0x1bd)](){const _0x4aa323=a0_0x18d3c6;return this['call'](_0x4aa323(0x1c4),{});}async['broadcast'](_0x230888,_0x32fdd9){const _0x31383d=a0_0x18d3c6;return this[_0x31383d(0x1a6)](_0x31383d(0x19a),{'message':_0x230888,'filter_server':_0x32fdd9?.['server'],'filter_status':_0x32fdd9?.[_0x31383d(0x1cd)]});}async[a0_0x18d3c6(0x18f)](){const _0x3a0e2f=a0_0x18d3c6;let _0x3937b1=encodeURIComponent(this['alias']),_0x24e045=this['url']+'/events/'+_0x3937b1,_0x359f93=this[_0x3a0e2f(0x1cb)];while(this[_0x3a0e2f(0x1b4)]){try{this[_0x3a0e2f(0x194)]=new AbortController();let _0x4cb5d5={'Accept':_0x3a0e2f(0x1ad)};if(this['token'])_0x4cb5d5[_0x3a0e2f(0x18a)]=_0x3a0e2f(0x191)+this[_0x3a0e2f(0x1b2)];let _0x3df7e5=await fetch(_0x24e045,{'headers':_0x4cb5d5,'signal':this[_0x3a0e2f(0x194)]['signal']});if(!_0x3df7e5['ok']||!_0x3df7e5[_0x3a0e2f(0x1af)]){this[_0x3a0e2f(0x1d3)](_0x3a0e2f(0x1b9)+_0x3df7e5['status']),await this[_0x3a0e2f(0x1a3)](_0x359f93),_0x359f93=Math[_0x3a0e2f(0x192)](_0x359f93*1.5,0xea60);continue;}_0x359f93=this['reconnectDelay'];let _0x47bcd1=_0x3df7e5[_0x3a0e2f(0x1af)]['getReader'](),_0x53bf13=new TextDecoder(),_0x50c09e='';while(this['running']){let {done:_0x34820a,value:_0x3a0734}=await _0x47bcd1[_0x3a0e2f(0x1d0)]();if(_0x34820a)break;_0x50c09e+=_0x53bf13[_0x3a0e2f(0x1cc)](_0x3a0734,{'stream':!0x0});let _0x2a3090=_0x50c09e[_0x3a0e2f(0x1d1)]('\x0a');_0x50c09e=_0x2a3090[_0x3a0e2f(0x1b3)]()||'';for(let _0x2c2628 of _0x2a3090){if(!_0x2c2628['startsWith']('data:\x20'))continue;try{let _0x3b304a=JSON['parse'](_0x2c2628[_0x3a0e2f(0x1d9)](0x6));if(_0x3b304a[_0x3a0e2f(0x198)]===_0x3a0e2f(0x1c8)){this['log'](_0x3a0e2f(0x1da)),this[_0x3a0e2f(0x19d)](_0x3a0e2f(0x1c8));continue;}if(_0x3b304a[_0x3a0e2f(0x198)]==='new_task'||_0x3b304a['type']===_0x3a0e2f(0x1ac)||_0x3b304a['type']===_0x3a0e2f(0x19a))await this[_0x3a0e2f(0x188)]();}catch{}}}}catch(_0x213313){if(_0x213313[_0x3a0e2f(0x1db)]==='AbortError')break;this['emit'](_0x3a0e2f(0x1aa),_0x213313),this[_0x3a0e2f(0x1d3)](_0x3a0e2f(0x18b)+_0x213313[_0x3a0e2f(0x19e)]);}if(this[_0x3a0e2f(0x1b4)])this['emit'](_0x3a0e2f(0x18d)),this[_0x3a0e2f(0x1d3)]('SSE\x20reconnecting\x20in\x20'+_0x359f93/0x3e8+_0x3a0e2f(0x1cf)),await this['sleep'](_0x359f93),_0x359f93=Math[_0x3a0e2f(0x192)](_0x359f93*1.5,0xea60);}}async[a0_0x18d3c6(0x188)](){const _0x3ae3a4=a0_0x18d3c6;try{let _0xed1133=(await this[_0x3ae3a4(0x1a6)](_0x3ae3a4(0x1ce),{'alias':this[_0x3ae3a4(0x19c)],'limit':0xa}))?.[_0x3ae3a4(0x193)]||[];for(let _0xb8fc4c of _0xed1133)await this['call'](_0x3ae3a4(0x1a1),{'alias':this[_0x3ae3a4(0x19c)],'message_id':_0xb8fc4c['id']}),this[_0x3ae3a4(0x1d3)]('←\x20'+_0xb8fc4c[_0x3ae3a4(0x1a9)]+':\x20'+_0xb8fc4c[_0x3ae3a4(0x1c5)][_0x3ae3a4(0x1d9)](0x0,0x3c)),this[_0x3ae3a4(0x19d)](_0x3ae3a4(0x1a0),_0xb8fc4c),this[_0x3ae3a4(0x19d)](_0x3ae3a4(0x19e),_0xb8fc4c);}catch(_0x41f4ee){this['log'](_0x3ae3a4(0x1a5)+_0x41f4ee[_0x3ae3a4(0x19e)]);}}[a0_0x18d3c6(0x1a3)](_0x192983){return new Promise(_0x367390=>setTimeout(_0x367390,_0x192983));}}var $=T;export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x590876=a0_0x10f1;(function(_0x97fd6,_0x31eb17){const _0x2ae8df=a0_0x10f1,_0x3f301d=_0x97fd6();while(!![]){try{const _0x4fba51=parseInt(_0x2ae8df(0x13f))/0x1*(parseInt(_0x2ae8df(0xf2))/0x2)+-parseInt(_0x2ae8df(0x168))/0x3+-parseInt(_0x2ae8df(0x13d))/0x4*(-parseInt(_0x2ae8df(0x11e))/0x5)+-parseInt(_0x2ae8df(0x101))/0x6+-parseInt(_0x2ae8df(0x162))/0x7*(parseInt(_0x2ae8df(0x13a))/0x8)+parseInt(_0x2ae8df(0x146))/0x9*(parseInt(_0x2ae8df(0x14d))/0xa)+parseInt(_0x2ae8df(0x152))/0xb;if(_0x4fba51===_0x31eb17)break;else _0x3f301d['push'](_0x3f301d['shift']());}catch(_0x3839cd){_0x3f301d['push'](_0x3f301d['shift']());}}}(a0_0x5afb,0xaeebd));import{readFileSync as a0_0x1863ec,existsSync as a0_0x1a7dd5}from'fs';import{randomUUID as a0_0x501545}from'crypto';import{join as a0_0x2b1168}from'path';import{hostname as a0_0x5df9a6}from'os';import{execSync as a0_0xd26412}from'child_process';import{Server as a0_0x54a809}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x69e475}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x345e7f,CallToolRequestSchema as a0_0x29da7d}from'@modelcontextprotocol/sdk/types.js';function p(_0x3f76a2){const _0x390a37=a0_0x10f1;if(!a0_0x1a7dd5(_0x3f76a2))return;for(let _0x2d5739 of a0_0x1863ec(_0x3f76a2,_0x390a37(0x15e))[_0x390a37(0x11c)]('\x0a')){let _0x39ab27=_0x2d5739['trim']();if(!_0x39ab27||_0x39ab27[_0x390a37(0x147)]('#'))continue;let _0x3c2680=_0x39ab27['indexOf']('=');if(_0x3c2680<0x0)continue;let _0x5b31ba=_0x39ab27['slice'](0x0,_0x3c2680)[_0x390a37(0xee)](),_0xaa983c=_0x39ab27[_0x390a37(0x142)](_0x3c2680+0x1)['trim']()[_0x390a37(0x10b)](/^["']|["']$/g,'');if(!process.env[_0x5b31ba])process.env[_0x5b31ba]=_0xaa983c;}}var C=process.env.HOME||'~',T=a0_0x2b1168(C,a0_0x590876(0x105));p(a0_0x2b1168(T,a0_0x590876(0x130)));function a0_0x5afb(){const _0x4c191c=['none','commhub_send_task','Target\x20session\x20alias','commhub_get_all_status','idle','stringify','then','get','split','\x20priority=','5EDYOdu','SSE\x20error:\x20','text','\x20from\x20','\x20ALIAS=','commhub','CommHub\x20init\x20failed:\x20','config.json','commhub_report_status','replied','Current\x20task\x20description','failed','priority','registered\x20as\x20\x22','POST','string','connecting\x20to\x20','normal','.env','status','object','.anet','\x20CWD=','session\x20disconnected','SSE\x20connected\x20as\x20\x22','unknown\x20tool','Session\x20alias:\x20','pop','16wBfCoQ','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','send_task','2298984oeoTgq','claude-code','12407uaheTX','Reply\x20text\x20/\x20result\x20summary','getReader','slice','SSE\x20fatal:\x20','length','commhub-channel','1053WXNjsH','startsWith','delete','setRequestHandler','new_message','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','tools/call','71350gCKfVA','2.0','exit','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','notifications/claude/channel','8156016wXDnRr','message','token','from','completed','heartbeat\x20failed:\x20','get_all_status','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','message_id','end','Priority\x20(default:\x20normal)','utf-8','Progress\x200-100','stdin','catch','4734723dJipEv','messages','blocked','commhub_reply','hub','commhub_send_message','3156453viJHTK','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','ack_inbox','params','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','read','→\x20injected\x20task\x20','Bearer\x20','/events/','ENV:\x20URL=','send_message','from_session','task','in_progress','connect','/mcp','starting\x20SSE\x20listener...','get_inbox','SIGINT','trim','tmux\x20display-message\x20-p\x20\x27#S\x27','shutting\x20down,\x20reporting\x20offline...',']\x20[commhub]\x20','166wNTIpB','new_task','cwd','0.3.0','cancelled','Authorization','Message\x20content','http://127.0.0.1:9200','MCP\x20stdio\x20connected','send_reply','alias','result','content','find','type','356232lgxDkT','no\x20response','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','\x20RESUME_ID=','.claude/channels/commhub','parse\x20error:\x20','report_status','notification','error','initialize','replace','SSE\x20stream\x20ended,\x20reconnecting...','2025-03-26','...\x20TMUX=','working','application/json','parse','data:\x20',':\x20inbox_count='];a0_0x5afb=function(){return _0x4c191c;};return a0_0x5afb();}var L=process['cwd']()[a0_0x590876(0x10b)](/\//g,'-');function a0_0x10f1(_0x48f889,_0x1d5f4f){_0x48f889=_0x48f889-0xed;const _0x5afb68=a0_0x5afb();let _0x10f19c=_0x5afb68[_0x48f889];return _0x10f19c;}p(a0_0x2b1168(T,L,'.env'));function U(){const _0x296b66=a0_0x590876;try{return a0_0xd26412(_0x296b66(0xef),{'encoding':'utf-8','timeout':0x7d0})['trim']();}catch{return'';}}function v(){const _0x135566=a0_0x590876;try{let _0x1c04b1=a0_0x2b1168(C,_0x135566(0x133),_0x135566(0x125));if(a0_0x1a7dd5(_0x1c04b1))return JSON[_0x135566(0x111)](a0_0x1863ec(_0x1c04b1,_0x135566(0x15e)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x590876(0x166)]||a0_0x590876(0xf9),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x5df9a6(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x501545(),X=process.env.COMMHUB_TOKEN||H[a0_0x590876(0x154)]||'';function Y(_0x2fb427){const _0x55f1a2=a0_0x590876;let _0x27d0f6=new Date()['toTimeString']()[_0x55f1a2(0x142)](0x0,0x8);process['stderr']['write']('['+_0x27d0f6+_0x55f1a2(0xf1)+_0x2fb427+'\x0a');}function h(_0x1f20c6){return new Promise(_0x49bb98=>setTimeout(_0x49bb98,_0x1f20c6));}Y(a0_0x590876(0x171)+f+a0_0x590876(0x122)+Z+a0_0x590876(0x104)+w['slice'](0x0,0x8)+a0_0x590876(0x10e)+(j||a0_0x590876(0x114))+a0_0x590876(0x134)+process['cwd']()+'\x20PROJECT_ENV='+L);var k=new Map(),K=new a0_0x54a809({'name':a0_0x590876(0x145),'version':a0_0x590876(0xf5)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x590876(0x16c),a0_0x590876(0x169),'Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.',a0_0x590876(0x103),a0_0x590876(0x138)+Z]['join']('\x0a')});K[a0_0x590876(0x149)](a0_0x345e7f,async()=>({'tools':[{'name':a0_0x590876(0x165),'description':a0_0x590876(0x15a),'inputSchema':{'type':'object','properties':{'task_id':{'type':a0_0x590876(0x12d),'description':a0_0x590876(0x13b)},'text':{'type':a0_0x590876(0x12d),'description':a0_0x590876(0x140)},'status':{'type':'string','enum':[a0_0x590876(0x156),a0_0x590876(0x129),'cancelled',a0_0x590876(0x164),a0_0x590876(0x109),a0_0x590876(0x175)],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':[a0_0x590876(0x120)]}},{'name':a0_0x590876(0x126),'description':a0_0x590876(0x159),'inputSchema':{'type':a0_0x590876(0x132),'properties':{'status':{'type':'string','enum':[a0_0x590876(0x10f),a0_0x590876(0x118),a0_0x590876(0x164),a0_0x590876(0x109)]},'task':{'type':a0_0x590876(0x12d),'description':a0_0x590876(0x128)},'progress':{'type':'number','description':a0_0x590876(0x15f)}},'required':[a0_0x590876(0x131)]}},{'name':a0_0x590876(0x115),'description':'Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','inputSchema':{'type':a0_0x590876(0x132),'properties':{'alias':{'type':a0_0x590876(0x12d),'description':a0_0x590876(0x116)},'task':{'type':a0_0x590876(0x12d),'description':'Task\x20content'},'priority':{'type':a0_0x590876(0x12d),'enum':['high',a0_0x590876(0x12f),'low'],'description':a0_0x590876(0x15d)}},'required':[a0_0x590876(0xfc),a0_0x590876(0x174)]}},{'name':a0_0x590876(0x167),'description':a0_0x590876(0x150),'inputSchema':{'type':a0_0x590876(0x132),'properties':{'alias':{'type':a0_0x590876(0x12d),'description':a0_0x590876(0x116)},'message':{'type':'string','description':a0_0x590876(0xf8)}},'required':[a0_0x590876(0xfc),'message']}},{'name':a0_0x590876(0x117),'description':a0_0x590876(0x14b),'inputSchema':{'type':a0_0x590876(0x132),'properties':{}}}]}));async function P(_0x59fc4b,_0x308272){const _0x9b492b=a0_0x590876;let _0x11f2ed=await fetch(f+_0x9b492b(0x177),{'method':_0x9b492b(0x12c),'headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x9b492b(0x16f)+X}:{}},'body':JSON[_0x9b492b(0x119)]({'jsonrpc':_0x9b492b(0x14e),'id':0x1,'method':_0x9b492b(0x10a),'params':{'protocolVersion':_0x9b492b(0x10d),'capabilities':{},'clientInfo':{'name':_0x9b492b(0x145),'version':_0x9b492b(0xf5)}}})});if(!_0x11f2ed['ok']){let _0x19f9d7=await _0x11f2ed['text']();return Y(_0x9b492b(0x124)+_0x11f2ed[_0x9b492b(0x131)]+'\x20'+_0x19f9d7['slice'](0x0,0x64)),{'ok':!0x1,'error':'init\x20failed:\x20'+_0x11f2ed['status']};}await _0x11f2ed['text']();let _0x43094c=(await(await fetch(f+_0x9b492b(0x177),{'method':_0x9b492b(0x12c),'headers':{'Content-Type':_0x9b492b(0x110),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x9b492b(0x16f)+X}:{}},'body':JSON['stringify']({'jsonrpc':'2.0','id':0x2,'method':_0x9b492b(0x14c),'params':{'name':_0x59fc4b,'arguments':_0x308272}})}))[_0x9b492b(0x120)]())[_0x9b492b(0x11c)]('\x0a')[_0x9b492b(0xff)](_0x23b081=>_0x23b081[_0x9b492b(0x147)](_0x9b492b(0x112)));if(_0x43094c){let _0x1c09a0=JSON[_0x9b492b(0x111)](_0x43094c[_0x9b492b(0x142)](0x6));return _0x1c09a0?.[_0x9b492b(0xfd)]?.[_0x9b492b(0xfe)]?.[0x0]?.[_0x9b492b(0x120)]?JSON[_0x9b492b(0x111)](_0x1c09a0['result']['content'][0x0][_0x9b492b(0x120)]):_0x1c09a0;}return{'ok':!0x1,'error':_0x9b492b(0x102)};}K[a0_0x590876(0x149)](a0_0x29da7d,async _0x139843=>{const _0x31b35c=a0_0x590876;let {name:_0x5ea47c,arguments:_0x3508c8}=_0x139843[_0x31b35c(0x16b)];if(_0x5ea47c===_0x31b35c(0x165)){let {task_id:_0x487764,text:_0x29a4f3,status:_0x4e7fda}=_0x3508c8;if(_0x4e7fda===_0x31b35c(0x156)||_0x4e7fda==='failed'||_0x4e7fda===_0x31b35c(0xf6)){let _0xc5e0d=_0x4e7fda==='completed'?_0x31b35c(0x127):_0x4e7fda,_0x1bd083=_0x487764?k[_0x31b35c(0x11b)](_0x487764)||_0x31b35c(0x166):_0x31b35c(0x166),_0xd707a7=await P(_0x31b35c(0xfb),{'alias':_0x1bd083,'text':_0x29a4f3,'in_reply_to':_0x487764||void 0x0,'status':_0xc5e0d,'from_session':Z});if(_0x487764)k[_0x31b35c(0x148)](_0x487764);return{'content':[{'type':_0x31b35c(0x120),'text':JSON['stringify'](_0xd707a7)}]};}let _0xb52c74=await P(_0x31b35c(0x107),{'resume_id':w,'alias':Z,'status':_0x4e7fda===_0x31b35c(0x164)?_0x31b35c(0x164):_0x4e7fda===_0x31b35c(0x109)?_0x31b35c(0x109):_0x31b35c(0x10f),'task':_0x29a4f3[_0x31b35c(0x142)](0x0,0xc8),'output':_0x29a4f3});return{'content':[{'type':_0x31b35c(0x120),'text':JSON['stringify'](_0xb52c74)}]};}if(_0x5ea47c==='commhub_report_status'){let {status:_0x3b638a,task:_0x54254d,progress:_0x13e545}=_0x3508c8,_0x52a1ef=await P(_0x31b35c(0x107),{'resume_id':w,'alias':Z,'status':_0x3b638a,'task':_0x54254d,'progress':_0x13e545});return{'content':[{'type':_0x31b35c(0x120),'text':JSON[_0x31b35c(0x119)](_0x52a1ef)}]};}if(_0x5ea47c==='commhub_send_task'){let {alias:_0x34ad58,task:_0x2e10ab,priority:_0x57ae2c}=_0x3508c8,_0xee8df5=await P(_0x31b35c(0x13c),{'alias':_0x34ad58,'task':_0x2e10ab,'priority':_0x57ae2c||_0x31b35c(0x12f),'from_session':Z});return{'content':[{'type':_0x31b35c(0x120),'text':JSON[_0x31b35c(0x119)](_0xee8df5)}]};}if(_0x5ea47c===_0x31b35c(0x167)){let {alias:_0x1e6e60,message:_0x34ce10}=_0x3508c8,_0x4c9253=await P(_0x31b35c(0x172),{'alias':_0x1e6e60,'message':_0x34ce10,'from_session':Z});return{'content':[{'type':_0x31b35c(0x120),'text':JSON['stringify'](_0x4c9253)}]};}if(_0x5ea47c===_0x31b35c(0x117)){let _0x166c3e=await P(_0x31b35c(0x158),{});return{'content':[{'type':_0x31b35c(0x120),'text':JSON[_0x31b35c(0x119)](_0x166c3e)}]};}return{'content':[{'type':_0x31b35c(0x120),'text':JSON[_0x31b35c(0x119)]({'error':_0x31b35c(0x137)})}]};});async function u(){const _0x4ab3c6=a0_0x590876;let _0x567ac2=f+_0x4ab3c6(0x170)+encodeURIComponent(Z),_0x4eee2e={};if(X)_0x4eee2e[_0x4ab3c6(0xf7)]='Bearer\x20'+X;Y(_0x4ab3c6(0x12e)+_0x567ac2);while(!0x0){try{let _0x104e37=await fetch(_0x567ac2,{'headers':_0x4eee2e});if(!_0x104e37['ok']){Y(_0x4ab3c6(0x11f)+_0x104e37[_0x4ab3c6(0x131)]+'\x20'+_0x104e37['statusText']),await h(0x1388);continue;}let _0x14b92b=_0x104e37['body'][_0x4ab3c6(0x141)](),_0x2a6a6c=new TextDecoder(),_0x24fc1a='';while(!0x0){let {done:_0x21faf0,value:_0x2c6d88}=await _0x14b92b[_0x4ab3c6(0x16d)]();if(_0x21faf0)break;_0x24fc1a+=_0x2a6a6c['decode'](_0x2c6d88,{'stream':!0x0});let _0x1f261f=_0x24fc1a[_0x4ab3c6(0x11c)]('\x0a\x0a');_0x24fc1a=_0x1f261f[_0x4ab3c6(0x139)]()||'';for(let _0x1d67e6 of _0x1f261f){let _0xd2b58b=_0x1d67e6[_0x4ab3c6(0x11c)]('\x0a')[_0x4ab3c6(0xff)](_0x2d9348=>_0x2d9348['startsWith'](_0x4ab3c6(0x112)));if(!_0xd2b58b)continue;try{let _0x4edf6b=JSON['parse'](_0xd2b58b[_0x4ab3c6(0x142)](0x6));await S(_0x4edf6b);}catch(_0xdb27e7){Y(_0x4ab3c6(0x106)+_0xdb27e7);}}}Y(_0x4ab3c6(0x10c));}catch(_0x15411f){Y('SSE\x20connection\x20error:\x20'+_0x15411f);}await h(0xbb8);}}async function S(_0x2d74b0){const _0x298d90=a0_0x590876;if(_0x2d74b0[_0x298d90(0x100)]==='connected'){Y(_0x298d90(0x136)+Z+'\x22');return;}if(_0x2d74b0[_0x298d90(0x100)]===_0x298d90(0x14a)){if(Y('←\x20message\x20from\x20'+_0x2d74b0[_0x298d90(0x155)]+':\x20'+_0x2d74b0[_0x298d90(0x153)]['slice'](0x0,0x3c)),await K['notification']({'method':_0x298d90(0x151),'params':{'content':_0x2d74b0[_0x298d90(0x153)],'meta':{'sender':_0x2d74b0[_0x298d90(0x155)]||_0x298d90(0x166),'sender_id':'commhub','user':_0x2d74b0['from']||_0x298d90(0x166),'priority':_0x298d90(0x12f)}}}),_0x2d74b0[_0x298d90(0x15b)])await P(_0x298d90(0x16a),{'alias':Z,'message_id':_0x2d74b0[_0x298d90(0x15b)]});return;}if(_0x2d74b0['type']===_0x298d90(0xf3)||_0x2d74b0[_0x298d90(0x100)]==='broadcast'){Y('←\x20'+_0x2d74b0[_0x298d90(0x100)]+_0x298d90(0x113)+_0x2d74b0['inbox_count']+_0x298d90(0x11d)+(_0x2d74b0[_0x298d90(0x12a)]||_0x298d90(0x12f)));let _0x3453bf=await P(_0x298d90(0x179),{'alias':Z,'limit':0x5});if(_0x3453bf?.['ok']&&_0x3453bf[_0x298d90(0x163)]?.[_0x298d90(0x144)]>0x0)for(let _0x565cf5 of _0x3453bf[_0x298d90(0x163)]){let _0x35b4ab={'sender':_0x565cf5[_0x298d90(0x173)]||_0x298d90(0x166),'sender_id':_0x298d90(0x123),'user':_0x565cf5[_0x298d90(0x173)]||_0x298d90(0x166),'task_id':_0x565cf5['id'],'priority':_0x565cf5['priority']||_0x298d90(0x12f)};k['set'](_0x565cf5['id'],_0x565cf5[_0x298d90(0x173)]||_0x298d90(0x166)),await K[_0x298d90(0x108)]({'method':_0x298d90(0x151),'params':{'content':_0x565cf5['content'],'meta':_0x35b4ab}}),Y(_0x298d90(0x16e)+_0x565cf5['id'][_0x298d90(0x142)](0x0,0x8)+_0x298d90(0x121)+_0x565cf5[_0x298d90(0x173)]+':\x20'+_0x565cf5[_0x298d90(0xfe)][_0x298d90(0x142)](0x0,0x3c)),await P('ack_inbox',{'alias':Z,'message_id':_0x565cf5['id']});}}}async function A(){const _0x1fe7f5=a0_0x590876;let _0x4f2c5a=new a0_0x69e475();await K[_0x1fe7f5(0x176)](_0x4f2c5a),Y(_0x1fe7f5(0xfa)),Y(_0x1fe7f5(0x178)),u()[_0x1fe7f5(0x161)](_0x411b44=>Y(_0x1fe7f5(0x143)+_0x411b44)),P(_0x1fe7f5(0x107),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x5df9a6(),'hostname':a0_0x5df9a6(),'agent':'claude-code','project_dir':process[_0x1fe7f5(0xf4)](),'tmux_name':j||void 0x0})[_0x1fe7f5(0x11a)](()=>Y(_0x1fe7f5(0x12b)+Z+'\x22\x20('+w[_0x1fe7f5(0x142)](0x0,0x8)+')'))['catch'](_0x2793e9=>Y('warning:\x20could\x20not\x20register:\x20'+_0x2793e9)),setInterval(()=>{const _0x26abce=_0x1fe7f5;P(_0x26abce(0x107),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x5df9a6(),'hostname':a0_0x5df9a6(),'agent':_0x26abce(0x13e),'project_dir':process['cwd'](),'tmux_name':j||void 0x0})[_0x26abce(0x161)](_0x3d23f5=>Y(_0x26abce(0x157)+_0x3d23f5));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}A()[a0_0x590876(0x161)](_0x3bc93a=>{const _0x282ce6=a0_0x590876;Y('fatal:\x20'+_0x3bc93a),process[_0x282ce6(0x14f)](0x1);});async function N(){const _0x1cb17f=a0_0x590876;Y(_0x1cb17f(0xf0)),await P('report_status',{'resume_id':w,'alias':Z,'status':_0x1cb17f(0x109),'task':_0x1cb17f(0x135)})[_0x1cb17f(0x161)](()=>{}),process[_0x1cb17f(0x14f)](0x0);}process[a0_0x590876(0x160)]['on'](a0_0x590876(0x15c),()=>N()),process['on']('SIGTERM',()=>N()),process['on'](a0_0x590876(0xed),()=>N());
2
+ const a0_0x470a65=a0_0x3a7f;(function(_0x4eedc8,_0xdcbd9f){const _0x3154ba=a0_0x3a7f,_0xd59e95=_0x4eedc8();while(!![]){try{const _0x4d3a91=parseInt(_0x3154ba(0x1b7))/0x1+parseInt(_0x3154ba(0x170))/0x2*(parseInt(_0x3154ba(0x14e))/0x3)+parseInt(_0x3154ba(0x193))/0x4*(-parseInt(_0x3154ba(0x19a))/0x5)+parseInt(_0x3154ba(0x154))/0x6*(-parseInt(_0x3154ba(0x191))/0x7)+parseInt(_0x3154ba(0x149))/0x8*(parseInt(_0x3154ba(0x155))/0x9)+-parseInt(_0x3154ba(0x152))/0xa+-parseInt(_0x3154ba(0x17e))/0xb;if(_0x4d3a91===_0xdcbd9f)break;else _0xd59e95['push'](_0xd59e95['shift']());}catch(_0x454fe5){_0xd59e95['push'](_0xd59e95['shift']());}}}(a0_0x23bc,0xdd0e9));import{readFileSync as a0_0x5ef2db,existsSync as a0_0xd0bb94}from'fs';import{randomUUID as a0_0x3ffbe7}from'crypto';import{join as a0_0x425e39}from'path';import{hostname as a0_0x5da3ec}from'os';import{execSync as a0_0x594ce7}from'child_process';import{Server as a0_0x1b0657}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x28a4e9}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x5b1f0c,CallToolRequestSchema as a0_0x52a8f2}from'@modelcontextprotocol/sdk/types.js';function p(_0xb14522){const _0x350fc6=a0_0x3a7f;if(!a0_0xd0bb94(_0xb14522))return;for(let _0x3c0257 of a0_0x5ef2db(_0xb14522,'utf-8')[_0x350fc6(0x144)]('\x0a')){let _0x5f29d7=_0x3c0257[_0x350fc6(0x19f)]();if(!_0x5f29d7||_0x5f29d7[_0x350fc6(0x187)]('#'))continue;let _0x1dc9a2=_0x5f29d7[_0x350fc6(0x185)]('=');if(_0x1dc9a2<0x0)continue;let _0x49af4c=_0x5f29d7['slice'](0x0,_0x1dc9a2)[_0x350fc6(0x19f)](),_0x21a5c6=_0x5f29d7[_0x350fc6(0x15e)](_0x1dc9a2+0x1)[_0x350fc6(0x19f)]()[_0x350fc6(0x1c2)](/^["']|["']$/g,'');if(!process.env[_0x49af4c])process.env[_0x49af4c]=_0x21a5c6;}}var C=process.env.HOME||'~',T=a0_0x425e39(C,a0_0x470a65(0x181));p(a0_0x425e39(T,a0_0x470a65(0x167)));var L=process[a0_0x470a65(0x1af)]()[a0_0x470a65(0x1c2)](/\//g,'-');p(a0_0x425e39(T,L,a0_0x470a65(0x167)));function U(){const _0x54ecee=a0_0x470a65;try{return a0_0x594ce7(_0x54ecee(0x13c),{'encoding':_0x54ecee(0x177),'timeout':0x7d0})[_0x54ecee(0x19f)]();}catch{return'';}}function v(){const _0x21c04e=a0_0x470a65;try{let _0x41be40=a0_0x425e39(C,_0x21c04e(0x1b9),'config.json');if(a0_0xd0bb94(_0x41be40))return JSON[_0x21c04e(0x173)](a0_0x5ef2db(_0x41be40,_0x21c04e(0x177)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x470a65(0x172)]||a0_0x470a65(0x145),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x5da3ec(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x3ffbe7(),X=process.env.COMMHUB_TOKEN||H['token']||'';function Y(_0x20cb9a){const _0x5a7964=a0_0x470a65;let _0x3ad092=new Date()[_0x5a7964(0x147)]()[_0x5a7964(0x15e)](0x0,0x8);process[_0x5a7964(0x163)][_0x5a7964(0x192)]('['+_0x3ad092+_0x5a7964(0x1a5)+_0x20cb9a+'\x0a');}function h(_0x325b19){return new Promise(_0x1ec618=>setTimeout(_0x1ec618,_0x325b19));}Y('ENV:\x20URL='+f+a0_0x470a65(0x164)+Z+a0_0x470a65(0x1c6)+w['slice'](0x0,0x8)+a0_0x470a65(0x142)+(j||a0_0x470a65(0x18f))+'\x20CWD='+process[a0_0x470a65(0x1af)]()+a0_0x470a65(0x140)+L);var k=new Map(),K=new a0_0x1b0657({'name':'commhub-channel','version':a0_0x470a65(0x1be)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':['Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>',a0_0x470a65(0x158),'Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.',a0_0x470a65(0x1a4),'Session\x20alias:\x20'+Z]['join']('\x0a')});K['setRequestHandler'](a0_0x5b1f0c,async()=>({'tools':[{'name':a0_0x470a65(0x1b4),'description':a0_0x470a65(0x1a3),'inputSchema':{'type':a0_0x470a65(0x1b1),'properties':{'task_id':{'type':'string','description':a0_0x470a65(0x195)},'text':{'type':a0_0x470a65(0x19e),'description':a0_0x470a65(0x15a)},'status':{'type':'string','enum':[a0_0x470a65(0x179),'failed',a0_0x470a65(0x1b6),a0_0x470a65(0x14d),a0_0x470a65(0x184),a0_0x470a65(0x15c)],'description':a0_0x470a65(0x1c3)}},'required':[a0_0x470a65(0x18c)]}},{'name':'commhub_report_status','description':a0_0x470a65(0x1ad),'inputSchema':{'type':a0_0x470a65(0x1b1),'properties':{'status':{'type':'string','enum':[a0_0x470a65(0x1a7),a0_0x470a65(0x16d),a0_0x470a65(0x14d),a0_0x470a65(0x184)]},'task':{'type':a0_0x470a65(0x19e),'description':a0_0x470a65(0x17a)},'progress':{'type':a0_0x470a65(0x1b5),'description':a0_0x470a65(0x16f)}},'required':['status']}},{'name':a0_0x470a65(0x19b),'description':a0_0x470a65(0x1c4),'inputSchema':{'type':a0_0x470a65(0x1b1),'properties':{'alias':{'type':a0_0x470a65(0x19e),'description':a0_0x470a65(0x159)},'task':{'type':a0_0x470a65(0x19e),'description':a0_0x470a65(0x165)},'priority':{'type':'string','enum':[a0_0x470a65(0x1a9),a0_0x470a65(0x161),a0_0x470a65(0x1bb)],'description':a0_0x470a65(0x1b8)}},'required':['alias','task']}},{'name':a0_0x470a65(0x15b),'description':'Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','inputSchema':{'type':a0_0x470a65(0x1b1),'properties':{'alias':{'type':a0_0x470a65(0x19e),'description':a0_0x470a65(0x159)},'message':{'type':'string','description':a0_0x470a65(0x197)}},'required':['alias','message']}},{'name':a0_0x470a65(0x1b0),'description':a0_0x470a65(0x1bc),'inputSchema':{'type':'object','properties':{}}}]}));async function P(_0x479043,_0x5f03f1){const _0xdf27d2=a0_0x470a65;let _0x2525cd=await fetch(f+'/mcp',{'method':_0xdf27d2(0x1b3),'headers':{'Content-Type':_0xdf27d2(0x157),'Accept':_0xdf27d2(0x17b),...X?{'Authorization':_0xdf27d2(0x183)+X}:{}},'body':JSON[_0xdf27d2(0x13f)]({'jsonrpc':_0xdf27d2(0x143),'id':0x1,'method':_0xdf27d2(0x18e),'params':{'protocolVersion':_0xdf27d2(0x13a),'capabilities':{},'clientInfo':{'name':'commhub-channel','version':_0xdf27d2(0x1be)}}})});if(!_0x2525cd['ok']){let _0x8c3126=await _0x2525cd[_0xdf27d2(0x18c)]();return Y(_0xdf27d2(0x151)+_0x2525cd[_0xdf27d2(0x18d)]+'\x20'+_0x8c3126['slice'](0x0,0x64)),{'ok':!0x1,'error':_0xdf27d2(0x150)+_0x2525cd[_0xdf27d2(0x18d)]};}await _0x2525cd[_0xdf27d2(0x18c)]();let _0x4090cd=(await(await fetch(f+_0xdf27d2(0x175),{'method':_0xdf27d2(0x1b3),'headers':{'Content-Type':'application/json','Accept':_0xdf27d2(0x17b),...X?{'Authorization':_0xdf27d2(0x183)+X}:{}},'body':JSON[_0xdf27d2(0x13f)]({'jsonrpc':_0xdf27d2(0x143),'id':0x2,'method':_0xdf27d2(0x180),'params':{'name':_0x479043,'arguments':_0x5f03f1}})}))['text']())[_0xdf27d2(0x144)]('\x0a')['find'](_0x10c716=>_0x10c716[_0xdf27d2(0x187)](_0xdf27d2(0x18a)));if(_0x4090cd){let _0x4a1ff6=JSON[_0xdf27d2(0x173)](_0x4090cd[_0xdf27d2(0x15e)](0x6));return _0x4a1ff6?.['result']?.[_0xdf27d2(0x189)]?.[0x0]?.[_0xdf27d2(0x18c)]?JSON[_0xdf27d2(0x173)](_0x4a1ff6['result'][_0xdf27d2(0x189)][0x0][_0xdf27d2(0x18c)]):_0x4a1ff6;}return{'ok':!0x1,'error':_0xdf27d2(0x1bd)};}K['setRequestHandler'](a0_0x52a8f2,async _0x102744=>{const _0x365912=a0_0x470a65;let {name:_0x3d7c7a,arguments:_0x4059e6}=_0x102744['params'];if(_0x3d7c7a==='commhub_reply'){let {task_id:_0x29e172,text:_0x3e7b06,status:_0x36317e}=_0x4059e6;if(_0x36317e==='completed'||_0x36317e===_0x365912(0x1ba)||_0x36317e==='cancelled'){let _0x31a5fc=_0x36317e===_0x365912(0x179)?_0x365912(0x1bf):_0x36317e,_0x264304=_0x29e172?k['get'](_0x29e172)||_0x365912(0x172):_0x365912(0x172),_0x451b5f=await P(_0x365912(0x174),{'alias':_0x264304,'text':_0x3e7b06,'in_reply_to':_0x29e172||void 0x0,'status':_0x31a5fc,'from_session':Z});if(_0x29e172)k[_0x365912(0x169)](_0x29e172);return{'content':[{'type':_0x365912(0x18c),'text':JSON[_0x365912(0x13f)](_0x451b5f)}]};}let _0x302a80=await P(_0x365912(0x168),{'resume_id':w,'alias':Z,'status':_0x36317e===_0x365912(0x14d)?_0x365912(0x14d):_0x36317e===_0x365912(0x184)?_0x365912(0x184):_0x365912(0x1a7),'task':_0x3e7b06[_0x365912(0x15e)](0x0,0xc8),'output':_0x3e7b06});return{'content':[{'type':'text','text':JSON['stringify'](_0x302a80)}]};}if(_0x3d7c7a===_0x365912(0x1a2)){let {status:_0x1b9169,task:_0x47e7be,progress:_0x30b4e4}=_0x4059e6,_0x1ac844=await P(_0x365912(0x168),{'resume_id':w,'alias':Z,'status':_0x1b9169,'task':_0x47e7be,'progress':_0x30b4e4});return{'content':[{'type':'text','text':JSON[_0x365912(0x13f)](_0x1ac844)}]};}if(_0x3d7c7a===_0x365912(0x19b)){let {alias:_0x2f9a05,task:_0x15f016,priority:_0x325edb}=_0x4059e6,_0x5d871a=await P('send_task',{'alias':_0x2f9a05,'task':_0x15f016,'priority':_0x325edb||_0x365912(0x161),'from_session':Z});return{'content':[{'type':_0x365912(0x18c),'text':JSON['stringify'](_0x5d871a)}]};}if(_0x3d7c7a==='commhub_send_message'){let {alias:_0x3c4203,message:_0x133192}=_0x4059e6,_0x4b8bc1=await P(_0x365912(0x1ab),{'alias':_0x3c4203,'message':_0x133192,'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x365912(0x13f)](_0x4b8bc1)}]};}if(_0x3d7c7a==='commhub_get_all_status'){let _0x42a8d1=await P(_0x365912(0x14b),{});return{'content':[{'type':_0x365912(0x18c),'text':JSON['stringify'](_0x42a8d1)}]};}return{'content':[{'type':_0x365912(0x18c),'text':JSON['stringify']({'error':_0x365912(0x15f)})}]};});async function u(){const _0x507d33=a0_0x470a65;let _0x1e2887=f+_0x507d33(0x1a1)+encodeURIComponent(Z),_0x3edabf={};if(X)_0x3edabf[_0x507d33(0x1ac)]=_0x507d33(0x183)+X;Y(_0x507d33(0x160)+_0x1e2887);while(!0x0){try{let _0x73ec9d=await fetch(_0x1e2887,{'headers':_0x3edabf});if(!_0x73ec9d['ok']){Y(_0x507d33(0x15d)+_0x73ec9d[_0x507d33(0x18d)]+'\x20'+_0x73ec9d[_0x507d33(0x182)]),await h(0x1388);continue;}let _0x4e80e6=_0x73ec9d[_0x507d33(0x1c1)]['getReader'](),_0x5685db=new TextDecoder(),_0x42d0b1='';while(!0x0){let {done:_0x2aea66,value:_0x548de8}=await _0x4e80e6[_0x507d33(0x1c5)]();if(_0x2aea66)break;_0x42d0b1+=_0x5685db[_0x507d33(0x13d)](_0x548de8,{'stream':!0x0});let _0xd521=_0x42d0b1[_0x507d33(0x144)]('\x0a\x0a');_0x42d0b1=_0xd521['pop']()||'';for(let _0x5dcbfc of _0xd521){let _0x3e65ff=_0x5dcbfc[_0x507d33(0x144)]('\x0a')[_0x507d33(0x13b)](_0x10ff99=>_0x10ff99[_0x507d33(0x187)](_0x507d33(0x18a)));if(!_0x3e65ff)continue;try{let _0x13d2d6=JSON[_0x507d33(0x173)](_0x3e65ff[_0x507d33(0x15e)](0x6));await S(_0x13d2d6);}catch(_0x5463a3){Y(_0x507d33(0x16b)+_0x5463a3);}}}Y(_0x507d33(0x1a0));}catch(_0x1e9e95){Y(_0x507d33(0x198)+_0x1e9e95);}await h(0xbb8);}}function a0_0x23bc(){const _0xe80c3b=['in_progress','SSE\x20error:\x20','slice','unknown\x20tool','connecting\x20to\x20','normal','length','stderr','\x20ALIAS=','Task\x20content','end','.env','report_status','delete','new_message','parse\x20error:\x20','MCP\x20stdio\x20connected','idle','claude-code','Progress\x200-100','2BwiBzM','SIGINT','hub','parse','send_reply','/mcp','\x20priority=','utf-8','←\x20message\x20from\x20','completed','Current\x20task\x20description','application/json,\x20text/event-stream','session\x20disconnected','notification','4430063rfXQuh','from','tools/call','.claude/channels/commhub','statusText','Bearer\x20','error','indexOf','registered\x20as\x20\x22','startsWith','SSE\x20fatal:\x20','content','data:\x20','from_session','text','status','initialize','none','SSE\x20connected\x20as\x20\x22','287IFsQcG','write','4497908pXqEyZ','\x22\x20(','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','notifications/claude/channel','Message\x20content','SSE\x20connection\x20error:\x20','priority','5FAyBhQ','commhub_send_task','connected','message_id','string','trim','SSE\x20stream\x20ended,\x20reconnecting...','/events/','commhub_report_status','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.',']\x20[commhub]\x20','messages','working','exit','high','heartbeat\x20failed:\x20','send_message','Authorization','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','connect','cwd','commhub_get_all_status','object','message','POST','commhub_reply','number','cancelled','1782361lYmYDH','Priority\x20(default:\x20normal)','.anet','failed','low','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','no\x20response','0.3.0','replied','commhub','body','replace','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','read','\x20RESUME_ID=','2025-03-26','find','tmux\x20display-message\x20-p\x20\x27#S\x27','decode','then','stringify','\x20PROJECT_ENV=','set','...\x20TMUX=','2.0','split','http://127.0.0.1:9200',':\x20inbox_count=','toTimeString','get_inbox','3208aWjmPJ','catch','get_all_status','type','blocked','1939629ZukAoX','shutting\x20down,\x20reporting\x20offline...','init\x20failed:\x20','CommHub\x20init\x20failed:\x20','7056750nToFvo','ack_inbox','53862qQFibj','24183RgRdVc','broadcast','application/json','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','Target\x20session\x20alias','Reply\x20text\x20/\x20result\x20summary','commhub_send_message'];a0_0x23bc=function(){return _0xe80c3b;};return a0_0x23bc();}async function S(_0x54f751){const _0x51b4f0=a0_0x470a65;if(_0x54f751[_0x51b4f0(0x14c)]===_0x51b4f0(0x19c)){Y(_0x51b4f0(0x190)+Z+'\x22');return;}if(_0x54f751[_0x51b4f0(0x14c)]===_0x51b4f0(0x16a)){if(Y(_0x51b4f0(0x178)+_0x54f751[_0x51b4f0(0x17f)]+':\x20'+_0x54f751[_0x51b4f0(0x1b2)]['slice'](0x0,0x3c)),await K[_0x51b4f0(0x17d)]({'method':'notifications/claude/channel','params':{'content':_0x54f751[_0x51b4f0(0x1b2)],'meta':{'sender':_0x54f751[_0x51b4f0(0x17f)]||_0x51b4f0(0x172),'sender_id':_0x51b4f0(0x1c0),'user':_0x54f751[_0x51b4f0(0x17f)]||'hub','priority':'normal'}}}),_0x54f751[_0x51b4f0(0x19d)])await P(_0x51b4f0(0x153),{'alias':Z,'message_id':_0x54f751[_0x51b4f0(0x19d)]});return;}if(_0x54f751[_0x51b4f0(0x14c)]==='new_task'||_0x54f751[_0x51b4f0(0x14c)]===_0x51b4f0(0x156)){Y('←\x20'+_0x54f751[_0x51b4f0(0x14c)]+_0x51b4f0(0x146)+_0x54f751['inbox_count']+_0x51b4f0(0x176)+(_0x54f751[_0x51b4f0(0x199)]||_0x51b4f0(0x161)));let _0x5ea9ac=await P(_0x51b4f0(0x148),{'alias':Z,'limit':0x5});if(_0x5ea9ac?.['ok']&&_0x5ea9ac[_0x51b4f0(0x1a6)]?.[_0x51b4f0(0x162)]>0x0)for(let _0x398a83 of _0x5ea9ac[_0x51b4f0(0x1a6)]){let _0x43921b={'sender':_0x398a83[_0x51b4f0(0x18b)]||'hub','sender_id':'commhub','user':_0x398a83['from_session']||_0x51b4f0(0x172),'task_id':_0x398a83['id'],'priority':_0x398a83[_0x51b4f0(0x199)]||_0x51b4f0(0x161)};k[_0x51b4f0(0x141)](_0x398a83['id'],_0x398a83[_0x51b4f0(0x18b)]||_0x51b4f0(0x172)),await K[_0x51b4f0(0x17d)]({'method':_0x51b4f0(0x196),'params':{'content':_0x398a83[_0x51b4f0(0x189)],'meta':_0x43921b}}),Y('→\x20injected\x20task\x20'+_0x398a83['id']['slice'](0x0,0x8)+'\x20from\x20'+_0x398a83[_0x51b4f0(0x18b)]+':\x20'+_0x398a83[_0x51b4f0(0x189)][_0x51b4f0(0x15e)](0x0,0x3c)),await P(_0x51b4f0(0x153),{'alias':Z,'message_id':_0x398a83['id']});}}}async function A(){const _0x1895e4=a0_0x470a65;let _0x5ef04c=new a0_0x28a4e9();await K[_0x1895e4(0x1ae)](_0x5ef04c),Y(_0x1895e4(0x16c)),Y('starting\x20SSE\x20listener...'),u()[_0x1895e4(0x14a)](_0x25321d=>Y(_0x1895e4(0x188)+_0x25321d)),P('report_status',{'resume_id':w,'alias':Z,'status':_0x1895e4(0x16d),'server':a0_0x5da3ec(),'hostname':a0_0x5da3ec(),'agent':_0x1895e4(0x16e),'project_dir':process[_0x1895e4(0x1af)](),'tmux_name':j||void 0x0})[_0x1895e4(0x13e)](()=>Y(_0x1895e4(0x186)+Z+_0x1895e4(0x194)+w[_0x1895e4(0x15e)](0x0,0x8)+')'))[_0x1895e4(0x14a)](_0x270576=>Y('warning:\x20could\x20not\x20register:\x20'+_0x270576)),setInterval(()=>{const _0x341130=_0x1895e4;P(_0x341130(0x168),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x5da3ec(),'hostname':a0_0x5da3ec(),'agent':'claude-code','project_dir':process['cwd'](),'tmux_name':j||void 0x0})[_0x341130(0x14a)](_0x1cce5c=>Y(_0x341130(0x1aa)+_0x1cce5c));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}A()[a0_0x470a65(0x14a)](_0x498678=>{Y('fatal:\x20'+_0x498678),process['exit'](0x1);});function a0_0x3a7f(_0x11189f,_0x479cdf){_0x11189f=_0x11189f-0x13a;const _0x23bc4d=a0_0x23bc();let _0x3a7f71=_0x23bc4d[_0x11189f];return _0x3a7f71;}async function N(){const _0x3c3951=a0_0x470a65;Y(_0x3c3951(0x14f)),await P(_0x3c3951(0x168),{'resume_id':w,'alias':Z,'status':_0x3c3951(0x184),'task':_0x3c3951(0x17c)})[_0x3c3951(0x14a)](()=>{}),process[_0x3c3951(0x1a8)](0x0);}process['stdin']['on'](a0_0x470a65(0x166),()=>N()),process['on']('SIGTERM',()=>N()),process['on'](a0_0x470a65(0x171),()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.1.3-preview.0",
3
+ "version": "2.1.3-preview.2",
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",