@sleep2agi/agent-network 2.0.0-preview.24 → 2.0.0-preview.25

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_0x3d4295=a0_0x4722;(function(_0x86405e,_0xdedf92){const _0x5bef65=a0_0x4722,_0x1decdd=_0x86405e();while(!![]){try{const _0x1230f5=-parseInt(_0x5bef65(0x8b))/0x1*(-parseInt(_0x5bef65(0xac))/0x2)+parseInt(_0x5bef65(0xce))/0x3*(-parseInt(_0x5bef65(0x8f))/0x4)+-parseInt(_0x5bef65(0x94))/0x5+-parseInt(_0x5bef65(0x9b))/0x6*(-parseInt(_0x5bef65(0xa6))/0x7)+-parseInt(_0x5bef65(0x9e))/0x8*(-parseInt(_0x5bef65(0xab))/0x9)+parseInt(_0x5bef65(0x7d))/0xa+parseInt(_0x5bef65(0x98))/0xb*(parseInt(_0x5bef65(0xc6))/0xc);if(_0x1230f5===_0xdedf92)break;else _0x1decdd['push'](_0x1decdd['shift']());}catch(_0x2a8111){_0x1decdd['push'](_0x1decdd['shift']());}}}(a0_0x49f0,0x9ddb1));import{EventEmitter as a0_0x782336}from'events';import{hostname as a0_0x5aec6f}from'os';function a0_0x4722(_0x8065d,_0x57de87){_0x8065d=_0x8065d-0x7b;const _0x49f018=a0_0x49f0();let _0x4722b8=_0x49f018[_0x8065d];return _0x4722b8;}function a0_0x49f0(){const _0x4ee9ad=['reconnectDelay','min','7kJYxFB','AbortError','idle','send_task','SSE\x20reconnecting\x20in\x20','117NHbvsB','1083638UcHEyv','sdk','heartbeatInterval',']\x20[commhub:','agent','data:\x20','sleep','running','read','send','disconnect','cwd','2.0','connected','task','connect','POST','s...','toString','match','text/event-stream','name','reply','signal','now','getAllStatus','2858736JaTocH','/mcp','new_message','text','get_inbox','SSE\x20error:\x20','call','error','3nfdaLX','completed','split','sseAbort','Bearer\x20','application/json','7473030tdJvaA','log','replace','abort','heartbeat\x20failed:\x20','processInbox','catch','heartbeatTimer','connectSSE','get_all_status','parse','type','resumeId','Authorization','1KKFdMt','send_message','offline','content','3682524uIHGqb','from_session','application/json,\x20text/event-stream','slice','url','5594865HRWQRg','emit','alias','normal','11ykkcyY','startsWith','status','4437408NRXqdC','disconnected','decode','258008JxUbXn','body','server','message','inbox\x20error:\x20','token'];a0_0x49f0=function(){return _0x4ee9ad;};return a0_0x49f0();}class T extends a0_0x782336{['url'];[a0_0x3d4295(0x96)];[a0_0x3d4295(0xa3)];[a0_0x3d4295(0xb0)];[a0_0x3d4295(0x89)];[a0_0x3d4295(0xae)];['reconnectDelay'];[a0_0x3d4295(0x84)];[a0_0x3d4295(0xd1)];[a0_0x3d4295(0xb3)]=!0x1;constructor(_0x33e2b2){const _0xd11eaf=a0_0x3d4295;super();if(this['url']=_0x33e2b2[_0xd11eaf(0x93)][_0xd11eaf(0x7f)](/\/$/,''),this[_0xd11eaf(0x96)]=_0x33e2b2[_0xd11eaf(0x96)],this['token']=_0x33e2b2[_0xd11eaf(0xa3)],this[_0xd11eaf(0xb0)]=_0x33e2b2[_0xd11eaf(0xb0)]||_0xd11eaf(0xad),this[_0xd11eaf(0x89)]='sdk-'+_0x33e2b2[_0xd11eaf(0x96)]+'-'+Date[_0xd11eaf(0xc4)]()[_0xd11eaf(0xbe)](0x24),this[_0xd11eaf(0xae)]=_0x33e2b2['heartbeatInterval']??0x2bf20,this[_0xd11eaf(0xa4)]=_0x33e2b2[_0xd11eaf(0xa4)]??0xbb8,_0x33e2b2['autoConnect']!==!0x1)this[_0xd11eaf(0xbb)]();}[a0_0x3d4295(0x7e)](_0x1ee02d){const _0x4a5865=a0_0x3d4295;console[_0x4a5865(0x7e)]('['+new Date()['toTimeString']()['slice'](0x0,0x8)+_0x4a5865(0xaf)+this[_0x4a5865(0x96)]+']\x20'+_0x1ee02d);}async[a0_0x3d4295(0xcc)](_0x411bb9,_0x41b3cc){const _0xf1fd89=a0_0x3d4295;let _0x4ca710={'Content-Type':_0xf1fd89(0x7c),'Accept':_0xf1fd89(0x91)};if(this[_0xf1fd89(0xa3)])_0x4ca710[_0xf1fd89(0x8a)]=_0xf1fd89(0x7b)+this[_0xf1fd89(0xa3)];let _0x2233cb=await(await fetch(this['url']+_0xf1fd89(0xc7),{'method':_0xf1fd89(0xbc),'headers':_0x4ca710,'body':JSON['stringify']({'jsonrpc':_0xf1fd89(0xb8),'id':Date[_0xf1fd89(0xc4)](),'method':'tools/call','params':{'name':_0x411bb9,'arguments':_0x41b3cc}})}))[_0xf1fd89(0xc9)](),_0x305e3c=_0x2233cb[_0xf1fd89(0xbf)](/data: (.+)/),_0x16a575=_0x305e3c?JSON['parse'](_0x305e3c[0x1]):JSON['parse'](_0x2233cb),_0x2d2926=_0x16a575?.['result']?.[_0xf1fd89(0x8e)]?.[0x0]?.[_0xf1fd89(0xc9)];return _0x2d2926?JSON[_0xf1fd89(0x87)](_0x2d2926):_0x16a575;}async['connect'](){const _0x316e05=a0_0x3d4295;if(this[_0x316e05(0xb3)])return;this['running']=!0x0,await this[_0x316e05(0x9a)](_0x316e05(0xa8)),this['log']('registered'),this[_0x316e05(0x84)]=setInterval(()=>{const _0x53de0b=_0x316e05;this[_0x53de0b(0x9a)](_0x53de0b(0xa8))[_0x53de0b(0x83)](_0x3e2b32=>this[_0x53de0b(0x7e)](_0x53de0b(0x81)+_0x3e2b32['message']));},this[_0x316e05(0xae)]),this[_0x316e05(0x85)]();}async[a0_0x3d4295(0xb6)](){const _0x13e44e=a0_0x3d4295;if(this['running']=!0x1,this[_0x13e44e(0xd1)]?.[_0x13e44e(0x80)](),this[_0x13e44e(0x84)])clearInterval(this[_0x13e44e(0x84)]);await this[_0x13e44e(0x9a)](_0x13e44e(0x8d))[_0x13e44e(0x83)](()=>{}),this['log'](_0x13e44e(0x9c));}async[a0_0x3d4295(0xb5)](_0x47ea08,_0x4c0ded,_0x32b82e=a0_0x3d4295(0x97)){const _0x5ddf35=a0_0x3d4295;return this['call'](_0x5ddf35(0xa9),{'alias':_0x47ea08,'task':_0x4c0ded,'priority':_0x32b82e,'from_session':this[_0x5ddf35(0x96)]});}async[a0_0x3d4295(0xa1)](_0x4aff24,_0x4ecfad){const _0x3ceb9e=a0_0x3d4295;return this[_0x3ceb9e(0xcc)](_0x3ceb9e(0x8c),{'alias':_0x4aff24,'message':_0x4ecfad,'from_session':this[_0x3ceb9e(0x96)]});}async['reply'](_0x39b03a,_0x5bb39e,_0x285932=a0_0x3d4295(0xcf)){const _0x5c85b0=a0_0x3d4295;return this[_0x5c85b0(0xcc)](_0x5c85b0(0xc2),{'task_id':_0x39b03a,'text':_0x5bb39e,'status':_0x285932});}async[a0_0x3d4295(0x9a)](_0x3aa0b8,_0x46bb47){const _0x4e2a88=a0_0x3d4295;return this['call']('report_status',{'resume_id':this[_0x4e2a88(0x89)],'alias':this[_0x4e2a88(0x96)],'status':_0x3aa0b8,'server':a0_0x5aec6f(),'hostname':a0_0x5aec6f(),'agent':this['agent'],'project_dir':process[_0x4e2a88(0xb7)](),..._0x46bb47});}async[a0_0x3d4295(0xc5)](){const _0x26d0dc=a0_0x3d4295;return this[_0x26d0dc(0xcc)](_0x26d0dc(0x86),{});}async['broadcast'](_0x4e0469,_0x1722ac){const _0x3cefee=a0_0x3d4295;return this[_0x3cefee(0xcc)]('broadcast',{'message':_0x4e0469,'filter_server':_0x1722ac?.[_0x3cefee(0xa0)],'filter_status':_0x1722ac?.[_0x3cefee(0x9a)]});}async[a0_0x3d4295(0x85)](){const _0x45e75e=a0_0x3d4295;let _0x188ba5=encodeURIComponent(this[_0x45e75e(0x96)]),_0x205128=this['url']+'/events/'+_0x188ba5,_0x25b590=this['reconnectDelay'];while(this['running']){try{this[_0x45e75e(0xd1)]=new AbortController();let _0x79a137={'Accept':_0x45e75e(0xc0)};if(this['token'])_0x79a137[_0x45e75e(0x8a)]=_0x45e75e(0x7b)+this[_0x45e75e(0xa3)];let _0x195d68=await fetch(_0x205128,{'headers':_0x79a137,'signal':this[_0x45e75e(0xd1)][_0x45e75e(0xc3)]});if(!_0x195d68['ok']||!_0x195d68[_0x45e75e(0x9f)]){this['log']('SSE\x20failed:\x20'+_0x195d68[_0x45e75e(0x9a)]),await this[_0x45e75e(0xb2)](_0x25b590),_0x25b590=Math[_0x45e75e(0xa5)](_0x25b590*1.5,0xea60);continue;}_0x25b590=this[_0x45e75e(0xa4)];let _0x52ee33=_0x195d68[_0x45e75e(0x9f)]['getReader'](),_0x4fe34d=new TextDecoder(),_0xc50c6='';while(this[_0x45e75e(0xb3)]){let {done:_0x4eed4b,value:_0x283461}=await _0x52ee33[_0x45e75e(0xb4)]();if(_0x4eed4b)break;_0xc50c6+=_0x4fe34d[_0x45e75e(0x9d)](_0x283461,{'stream':!0x0});let _0x19a6f0=_0xc50c6[_0x45e75e(0xd0)]('\x0a');_0xc50c6=_0x19a6f0['pop']()||'';for(let _0xfdf8a3 of _0x19a6f0){if(!_0xfdf8a3[_0x45e75e(0x99)](_0x45e75e(0xb1)))continue;try{let _0x80d684=JSON[_0x45e75e(0x87)](_0xfdf8a3[_0x45e75e(0x92)](0x6));if(_0x80d684['type']===_0x45e75e(0xb9)){this[_0x45e75e(0x7e)]('SSE\x20connected'),this[_0x45e75e(0x95)](_0x45e75e(0xb9));continue;}if(_0x80d684[_0x45e75e(0x88)]==='new_task'||_0x80d684[_0x45e75e(0x88)]===_0x45e75e(0xc8)||_0x80d684[_0x45e75e(0x88)]==='broadcast')await this[_0x45e75e(0x82)]();}catch{}}}}catch(_0x1ca832){if(_0x1ca832[_0x45e75e(0xc1)]===_0x45e75e(0xa7))break;this[_0x45e75e(0x95)](_0x45e75e(0xcd),_0x1ca832),this[_0x45e75e(0x7e)](_0x45e75e(0xcb)+_0x1ca832[_0x45e75e(0xa1)]);}if(this[_0x45e75e(0xb3)])this[_0x45e75e(0x95)]('disconnected'),this[_0x45e75e(0x7e)](_0x45e75e(0xaa)+_0x25b590/0x3e8+_0x45e75e(0xbd)),await this[_0x45e75e(0xb2)](_0x25b590),_0x25b590=Math[_0x45e75e(0xa5)](_0x25b590*1.5,0xea60);}}async[a0_0x3d4295(0x82)](){const _0x142c4b=a0_0x3d4295;try{let _0x18dc16=(await this[_0x142c4b(0xcc)](_0x142c4b(0xca),{'alias':this['alias'],'limit':0xa}))?.['messages']||[];for(let _0x5352fa of _0x18dc16)await this[_0x142c4b(0xcc)]('ack_inbox',{'alias':this[_0x142c4b(0x96)],'message_id':_0x5352fa['id']}),this[_0x142c4b(0x7e)]('←\x20'+_0x5352fa[_0x142c4b(0x90)]+':\x20'+_0x5352fa[_0x142c4b(0x8e)][_0x142c4b(0x92)](0x0,0x3c)),this[_0x142c4b(0x95)](_0x142c4b(0xba),_0x5352fa),this[_0x142c4b(0x95)](_0x142c4b(0xa1),_0x5352fa);}catch(_0x2b5b6a){this[_0x142c4b(0x7e)](_0x142c4b(0xa2)+_0x2b5b6a['message']);}}[a0_0x3d4295(0xb2)](_0x25dde5){return new Promise(_0x52df1e=>setTimeout(_0x52df1e,_0x25dde5));}}var $=T;export{$ as default,T as CommHub};
1
+ const a0_0x1a26ba=a0_0x5850;(function(_0x4c0c1d,_0x1ec7d6){const _0x5a7f9f=a0_0x5850,_0x1756a3=_0x4c0c1d();while(!![]){try{const _0x77c333=-parseInt(_0x5a7f9f(0x1e0))/0x1*(parseInt(_0x5a7f9f(0x1d1))/0x2)+-parseInt(_0x5a7f9f(0x1d8))/0x3+-parseInt(_0x5a7f9f(0x20b))/0x4+-parseInt(_0x5a7f9f(0x1ef))/0x5+-parseInt(_0x5a7f9f(0x1e8))/0x6+parseInt(_0x5a7f9f(0x21a))/0x7*(-parseInt(_0x5a7f9f(0x1e3))/0x8)+-parseInt(_0x5a7f9f(0x203))/0x9*(-parseInt(_0x5a7f9f(0x1cd))/0xa);if(_0x77c333===_0x1ec7d6)break;else _0x1756a3['push'](_0x1756a3['shift']());}catch(_0x3eeb02){_0x1756a3['push'](_0x1756a3['shift']());}}}(a0_0x1904,0x40b24));import{EventEmitter as a0_0x36b051}from'events';import{hostname as a0_0x1892c4}from'os';class T extends a0_0x36b051{[a0_0x1a26ba(0x1fe)];[a0_0x1a26ba(0x1d6)];[a0_0x1a26ba(0x216)];[a0_0x1a26ba(0x210)];[a0_0x1a26ba(0x1e5)];[a0_0x1a26ba(0x1f8)];[a0_0x1a26ba(0x1d5)];['heartbeatTimer'];[a0_0x1a26ba(0x1ca)];['running']=!0x1;constructor(_0x5f023d){const _0x308d5f=a0_0x1a26ba;super();if(this[_0x308d5f(0x1fe)]=_0x5f023d['url'][_0x308d5f(0x1eb)](/\/$/,''),this['alias']=_0x5f023d['alias'],this[_0x308d5f(0x216)]=_0x5f023d[_0x308d5f(0x216)],this[_0x308d5f(0x210)]=_0x5f023d[_0x308d5f(0x210)]||_0x308d5f(0x1ec),this[_0x308d5f(0x1e5)]=_0x308d5f(0x21e)+_0x5f023d[_0x308d5f(0x1d6)]+'-'+Date[_0x308d5f(0x1fb)]()[_0x308d5f(0x1ff)](0x24),this[_0x308d5f(0x1f8)]=_0x5f023d['heartbeatInterval']??0x2bf20,this[_0x308d5f(0x1d5)]=_0x5f023d[_0x308d5f(0x1d5)]??0xbb8,_0x5f023d[_0x308d5f(0x1d7)]!==!0x1)this[_0x308d5f(0x20e)]();}['log'](_0x24ffe1){const _0x73f2e4=a0_0x1a26ba;console[_0x73f2e4(0x1e4)]('['+new Date()[_0x73f2e4(0x20c)]()[_0x73f2e4(0x1f3)](0x0,0x8)+_0x73f2e4(0x1e2)+this[_0x73f2e4(0x1d6)]+']\x20'+_0x24ffe1);}async[a0_0x1a26ba(0x221)](_0x36c885,_0x37dcba){const _0x269f40=a0_0x1a26ba;let _0x460006={'Content-Type':_0x269f40(0x1e9),'Accept':_0x269f40(0x1f6)};if(this[_0x269f40(0x216)])_0x460006['Authorization']=_0x269f40(0x208)+this[_0x269f40(0x216)];let _0x2acd87=await(await fetch(this[_0x269f40(0x1fe)]+_0x269f40(0x20d),{'method':_0x269f40(0x202),'headers':_0x460006,'body':JSON[_0x269f40(0x1de)]({'jsonrpc':_0x269f40(0x1f9),'id':Date[_0x269f40(0x1fb)](),'method':'tools/call','params':{'name':_0x36c885,'arguments':_0x37dcba}})}))['text'](),_0x1572b4=_0x2acd87['match'](/data: (.+)/),_0x38c197=_0x1572b4?JSON['parse'](_0x1572b4[0x1]):JSON[_0x269f40(0x21d)](_0x2acd87),_0x7d00c8=_0x38c197?.[_0x269f40(0x1fc)]?.[_0x269f40(0x21b)]?.[0x0]?.[_0x269f40(0x213)];return _0x7d00c8?JSON['parse'](_0x7d00c8):_0x38c197;}async[a0_0x1a26ba(0x20e)](){const _0xbfd54e=a0_0x1a26ba;if(this['running'])return;this['running']=!0x0,await this[_0xbfd54e(0x1f5)]('idle'),this[_0xbfd54e(0x1e4)]('registered'),this[_0xbfd54e(0x204)]=setInterval(()=>{const _0x4c32ff=_0xbfd54e;this[_0x4c32ff(0x1f5)](_0x4c32ff(0x201))['catch'](_0x11b68c=>this[_0x4c32ff(0x1e4)](_0x4c32ff(0x209)+_0x11b68c['message']));},this[_0xbfd54e(0x1f8)]),this[_0xbfd54e(0x1dc)]();}async['disconnect'](){const _0x4460e0=a0_0x1a26ba;if(this[_0x4460e0(0x215)]=!0x1,this['sseAbort']?.['abort'](),this[_0x4460e0(0x204)])clearInterval(this[_0x4460e0(0x204)]);await this[_0x4460e0(0x1f5)]('offline')['catch'](()=>{}),this[_0x4460e0(0x1e4)](_0x4460e0(0x1ce));}async[a0_0x1a26ba(0x1f1)](_0x3bdd86,_0x573c34,_0x4dda2a=a0_0x1a26ba(0x1cc)){const _0x47e2e9=a0_0x1a26ba;return this[_0x47e2e9(0x221)](_0x47e2e9(0x219),{'alias':_0x3bdd86,'task':_0x573c34,'priority':_0x4dda2a,'from_session':this[_0x47e2e9(0x1d6)]});}async[a0_0x1a26ba(0x205)](_0x51b94d,_0x5f4704){const _0xae5598=a0_0x1a26ba;return this[_0xae5598(0x221)]('send_message',{'alias':_0x51b94d,'message':_0x5f4704,'from_session':this[_0xae5598(0x1d6)]});}async[a0_0x1a26ba(0x1f7)](_0x5b8101,_0x1f9a1f,_0x571239=a0_0x1a26ba(0x1fa)){const _0x15bd91=a0_0x1a26ba;return this[_0x15bd91(0x221)](_0x15bd91(0x1f7),{'task_id':_0x5b8101,'text':_0x1f9a1f,'status':_0x571239});}async[a0_0x1a26ba(0x1f5)](_0x1d37ca,_0xec921b){const _0x6ee3d6=a0_0x1a26ba;return this[_0x6ee3d6(0x221)](_0x6ee3d6(0x1ea),{'resume_id':this[_0x6ee3d6(0x1e5)],'alias':this[_0x6ee3d6(0x1d6)],'status':_0x1d37ca,'server':a0_0x1892c4(),'hostname':a0_0x1892c4(),'agent':this[_0x6ee3d6(0x210)],'project_dir':process[_0x6ee3d6(0x1f2)](),..._0xec921b});}async[a0_0x1a26ba(0x1db)](){const _0x3a90f5=a0_0x1a26ba;return this[_0x3a90f5(0x221)](_0x3a90f5(0x1d9),{});}async['broadcast'](_0x1f864f,_0x24357e){const _0x4caa12=a0_0x1a26ba;return this[_0x4caa12(0x221)](_0x4caa12(0x1df),{'message':_0x1f864f,'filter_server':_0x24357e?.[_0x4caa12(0x206)],'filter_status':_0x24357e?.[_0x4caa12(0x1f5)]});}async[a0_0x1a26ba(0x1dc)](){const _0x13c4da=a0_0x1a26ba;let _0x169752=encodeURIComponent(this[_0x13c4da(0x1d6)]),_0x596c8c=this['url']+_0x13c4da(0x1f0)+_0x169752,_0x2fd503=this[_0x13c4da(0x1d5)];while(this[_0x13c4da(0x215)]){try{this[_0x13c4da(0x1ca)]=new AbortController();let _0x3c045b={'Accept':_0x13c4da(0x21f)};if(this['token'])_0x3c045b['Authorization']=_0x13c4da(0x208)+this[_0x13c4da(0x216)];let _0x4c4279=await fetch(_0x596c8c,{'headers':_0x3c045b,'signal':this[_0x13c4da(0x1ca)][_0x13c4da(0x214)]});if(!_0x4c4279['ok']||!_0x4c4279['body']){this['log'](_0x13c4da(0x1d4)+_0x4c4279[_0x13c4da(0x1f5)]),await this[_0x13c4da(0x1e6)](_0x2fd503),_0x2fd503=Math[_0x13c4da(0x1dd)](_0x2fd503*1.5,0xea60);continue;}_0x2fd503=this[_0x13c4da(0x1d5)];let _0x1267e8=_0x4c4279[_0x13c4da(0x1ee)]['getReader'](),_0x2d9b50=new TextDecoder(),_0x4a97fb='';while(this['running']){let {done:_0x3571cf,value:_0x41800c}=await _0x1267e8[_0x13c4da(0x1e1)]();if(_0x3571cf)break;_0x4a97fb+=_0x2d9b50[_0x13c4da(0x207)](_0x41800c,{'stream':!0x0});let _0x863401=_0x4a97fb[_0x13c4da(0x212)]('\x0a');_0x4a97fb=_0x863401[_0x13c4da(0x1cf)]()||'';for(let _0x3d2bbf of _0x863401){if(!_0x3d2bbf[_0x13c4da(0x1d2)](_0x13c4da(0x20a)))continue;try{let _0x2dbbe8=JSON[_0x13c4da(0x21d)](_0x3d2bbf[_0x13c4da(0x1f3)](0x6));if(_0x2dbbe8[_0x13c4da(0x1da)]===_0x13c4da(0x200)){this[_0x13c4da(0x1e4)]('SSE\x20connected'),this[_0x13c4da(0x1f4)](_0x13c4da(0x200));continue;}if(_0x2dbbe8[_0x13c4da(0x1da)]===_0x13c4da(0x1e7)||_0x2dbbe8['type']===_0x13c4da(0x217)||_0x2dbbe8['type']===_0x13c4da(0x1df))await this[_0x13c4da(0x1fd)]();}catch{}}}}catch(_0x52faa0){if(_0x52faa0[_0x13c4da(0x21c)]==='AbortError')break;this[_0x13c4da(0x1f4)](_0x13c4da(0x220),_0x52faa0),this['log'](_0x13c4da(0x20f)+_0x52faa0[_0x13c4da(0x205)]);}if(this['running'])this[_0x13c4da(0x1f4)](_0x13c4da(0x1ce)),this[_0x13c4da(0x1e4)](_0x13c4da(0x1cb)+_0x2fd503/0x3e8+_0x13c4da(0x1d0)),await this[_0x13c4da(0x1e6)](_0x2fd503),_0x2fd503=Math[_0x13c4da(0x1dd)](_0x2fd503*1.5,0xea60);}}async[a0_0x1a26ba(0x1fd)](){const _0x38ab64=a0_0x1a26ba;try{let _0x1c4381=(await this['call'](_0x38ab64(0x1d3),{'alias':this[_0x38ab64(0x1d6)],'limit':0xa}))?.[_0x38ab64(0x211)]||[];for(let _0x59d7f9 of _0x1c4381)await this[_0x38ab64(0x221)]('ack_inbox',{'alias':this[_0x38ab64(0x1d6)],'message_id':_0x59d7f9['id']}),this['log']('←\x20'+_0x59d7f9[_0x38ab64(0x218)]+':\x20'+_0x59d7f9[_0x38ab64(0x21b)][_0x38ab64(0x1f3)](0x0,0x3c)),this['emit'](_0x38ab64(0x1ed),_0x59d7f9),this[_0x38ab64(0x1f4)](_0x38ab64(0x205),_0x59d7f9);}catch(_0x5c58d6){this[_0x38ab64(0x1e4)]('inbox\x20error:\x20'+_0x5c58d6[_0x38ab64(0x205)]);}}['sleep'](_0x20ec76){return new Promise(_0x7a9b28=>setTimeout(_0x7a9b28,_0x20ec76));}}function a0_0x5850(_0x1b4e38,_0x27a880){_0x1b4e38=_0x1b4e38-0x1ca;const _0x190428=a0_0x1904();let _0x5850c4=_0x190428[_0x1b4e38];return _0x5850c4;}var $=T;function a0_0x1904(){const _0x50d08e=['signal','running','token','new_message','from_session','send_task','41594emwPOu','content','name','parse','sdk-','text/event-stream','error','call','sseAbort','SSE\x20reconnecting\x20in\x20','normal','10dPxvdh','disconnected','pop','s...','393128XALUeA','startsWith','get_inbox','SSE\x20failed:\x20','reconnectDelay','alias','autoConnect','805194nZghJX','get_all_status','type','getAllStatus','connectSSE','min','stringify','broadcast','1fGtqUn','read',']\x20[commhub:','224NSHPcw','log','resumeId','sleep','new_task','2700180RSOqud','application/json','report_status','replace','sdk','task','body','9055tBhBkX','/events/','send','cwd','slice','emit','status','application/json,\x20text/event-stream','reply','heartbeatInterval','2.0','completed','now','result','processInbox','url','toString','connected','idle','POST','15178518MFOrdu','heartbeatTimer','message','server','decode','Bearer\x20','heartbeat\x20failed:\x20','data:\x20','1353308CqJCAR','toTimeString','/mcp','connect','SSE\x20error:\x20','agent','messages','split','text'];a0_0x1904=function(){return _0x50d08e;};return a0_0x1904();}export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x40110b=a0_0x329f;(function(_0x57be90,_0x378ccb){const _0x26bf78=a0_0x329f,_0x41c418=_0x57be90();while(!![]){try{const _0x7a745d=-parseInt(_0x26bf78(0xe0))/0x1+parseInt(_0x26bf78(0xa5))/0x2+parseInt(_0x26bf78(0x8b))/0x3*(parseInt(_0x26bf78(0x105))/0x4)+parseInt(_0x26bf78(0xbd))/0x5*(-parseInt(_0x26bf78(0xad))/0x6)+parseInt(_0x26bf78(0x90))/0x7*(-parseInt(_0x26bf78(0x10d))/0x8)+-parseInt(_0x26bf78(0x100))/0x9+parseInt(_0x26bf78(0xa0))/0xa*(parseInt(_0x26bf78(0xff))/0xb);if(_0x7a745d===_0x378ccb)break;else _0x41c418['push'](_0x41c418['shift']());}catch(_0x1f5485){_0x41c418['push'](_0x41c418['shift']());}}}(a0_0x169f,0xf4110));import{readFileSync as a0_0x138df9,existsSync as a0_0x2730fe}from'fs';import{join as a0_0x25d793}from'path';import{hostname as a0_0x159f86}from'os';import{execSync as a0_0x21d53c}from'child_process';import{Server as a0_0x55a0cd}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x151235}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0xd0934e,CallToolRequestSchema as a0_0x3ce375}from'@modelcontextprotocol/sdk/types.js';function p(_0x2b12af){const _0x4085d6=a0_0x329f;if(!a0_0x2730fe(_0x2b12af))return;for(let _0x44dcfd of a0_0x138df9(_0x2b12af,'utf-8')['split']('\x0a')){let _0x5e3e09=_0x44dcfd['trim']();if(!_0x5e3e09||_0x5e3e09[_0x4085d6(0x10c)]('#'))continue;let _0x3c3706=_0x5e3e09[_0x4085d6(0xa4)]('=');if(_0x3c3706<0x0)continue;let _0x115dce=_0x5e3e09['slice'](0x0,_0x3c3706)['trim'](),_0x3acbc9=_0x5e3e09[_0x4085d6(0xa9)](_0x3c3706+0x1)[_0x4085d6(0xca)]()[_0x4085d6(0xa3)](/^["']|["']$/g,'');if(!process.env[_0x115dce])process.env[_0x115dce]=_0x3acbc9;}}var C=process.env.HOME||'~',T=a0_0x25d793(C,'.claude/channels/commhub');p(a0_0x25d793(T,'.env'));var L=process['cwd']()['replace'](/\//g,'-');p(a0_0x25d793(T,L,a0_0x40110b(0xee)));function U(){const _0x441461=a0_0x40110b;try{return a0_0x21d53c(_0x441461(0xf2),{'encoding':'utf-8','timeout':0x7d0})[_0x441461(0xca)]();}catch{return'';}}function c(){const _0x3fa979=a0_0x40110b;try{let _0x303d05=a0_0x25d793(C,'.anet',_0x3fa979(0xba));if(a0_0x2730fe(_0x303d05))return JSON[_0x3fa979(0xb7)](a0_0x138df9(_0x303d05,_0x3fa979(0xfd)));}catch{}return{};}var H=c(),D=process.env.COMMHUB_URL||H[a0_0x40110b(0x9c)]||a0_0x40110b(0x116),f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0x159f86(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto[a0_0x40110b(0xbe)](),X=process.env.COMMHUB_TOKEN||H['token']||'';function Y(_0x3634fa){const _0x1663dd=a0_0x40110b;let _0x11f768=new Date()[_0x1663dd(0x115)]()[_0x1663dd(0xa9)](0x0,0x8);process[_0x1663dd(0xd7)]['write']('['+_0x11f768+_0x1663dd(0x9d)+_0x3634fa+'\x0a');}function h(_0x29ab14){return new Promise(_0x53b572=>setTimeout(_0x53b572,_0x29ab14));}Y(a0_0x40110b(0xfb)+D+'\x20ALIAS='+Z+'\x20RESUME_ID='+w[a0_0x40110b(0xa9)](0x0,0x8)+'...\x20TMUX='+(f||a0_0x40110b(0xdd))+a0_0x40110b(0xeb)+process[a0_0x40110b(0x91)]()+a0_0x40110b(0xea)+L);var k=new Map(),K=new a0_0x55a0cd({'name':a0_0x40110b(0xc0),'version':'0.3.0'},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x40110b(0x114),a0_0x40110b(0xe3),a0_0x40110b(0xc2),a0_0x40110b(0xe2),a0_0x40110b(0xce)+Z][a0_0x40110b(0xf3)]('\x0a')});function a0_0x169f(){const _0x98a070=['120qpvkKa','split','commhub_send_message','from_session','ack_inbox','28FBPxvj','cwd','new_task','commhub','Progress\x200-100','/events/','normal','set','tools/call','params','commhub_report_status','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','hub',']\x20[commhub]\x20','→\x20injected\x20task\x20','alias','1017890RQeTUc','SSE\x20error:\x20','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','replace','indexOf','3874376AfwUOt','session\x20disconnected','object','connecting\x20to\x20','slice','idle','failed','then','6cYzlHh','blocked','stringify','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','error','completed','exit','connect','message','setRequestHandler','parse','application/json','inbox_count','config.json','CommHub\x20init\x20failed:\x20','initialize','1415105sHzpef','randomUUID','send_task','commhub-channel','number','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','high','commhub_get_all_status','connected','POST','←\x20message\x20from\x20','message_id','unknown\x20tool','trim','SIGTERM','report_status','get','Session\x20alias:\x20','string','data:\x20','notification','replied','stdin','claude-code','Bearer\x20','status','stderr','delete','text','fatal:\x20','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','Task\x20content','none','length','catch','1736362gJUfEg','content','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','Target\x20session\x20alias','decode','commhub_reply','parse\x20error:\x20','MCP\x20stdio\x20connected','2025-03-26','\x20PROJECT_ENV=','\x20CWD=','getReader','SSE\x20connected\x20as\x20\x22','.env','\x20priority=','starting\x20SSE\x20listener...','new_message','tmux\x20display-message\x20-p\x20\x27#S\x27','join','from','messages',':\x20inbox_count=','2.0','commhub_send_task','statusText','Reply\x20text\x20/\x20result\x20summary','ENV:\x20URL=','working','utf-8','get_all_status','143OqBARp','5467050zwsMhK','SSE\x20connection\x20error:\x20','application/json,\x20text/event-stream','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','broadcast','116128KVKvKF','shutting\x20down,\x20reporting\x20offline...','pop','Current\x20task\x20description','no\x20response','cancelled','notifications/claude/channel','startsWith','1590392SVoezl','priority','find','read','SIGINT','type','warning:\x20could\x20not\x20register:\x20','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','toTimeString','http://127.0.0.1:9200','\x22\x20(','/mcp'];a0_0x169f=function(){return _0x98a070;};return a0_0x169f();}K[a0_0x40110b(0xb6)](a0_0xd0934e,async()=>({'tools':[{'name':a0_0x40110b(0xe6),'description':'Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','inputSchema':{'type':a0_0x40110b(0xa7),'properties':{'task_id':{'type':a0_0x40110b(0xcf),'description':a0_0x40110b(0xa2)},'text':{'type':a0_0x40110b(0xcf),'description':a0_0x40110b(0xfa)},'status':{'type':a0_0x40110b(0xcf),'enum':[a0_0x40110b(0xb2),a0_0x40110b(0xab),a0_0x40110b(0x10a),a0_0x40110b(0xae),a0_0x40110b(0xb1),'in_progress'],'description':a0_0x40110b(0x103)}},'required':[a0_0x40110b(0xd9)]}},{'name':'commhub_report_status','description':a0_0x40110b(0xdb),'inputSchema':{'type':a0_0x40110b(0xa7),'properties':{'status':{'type':'string','enum':['working',a0_0x40110b(0xaa),a0_0x40110b(0xae),a0_0x40110b(0xb1)]},'task':{'type':'string','description':a0_0x40110b(0x108)},'progress':{'type':a0_0x40110b(0xc1),'description':a0_0x40110b(0x94)}},'required':[a0_0x40110b(0xd6)]}},{'name':'commhub_send_task','description':a0_0x40110b(0xb0),'inputSchema':{'type':a0_0x40110b(0xa7),'properties':{'alias':{'type':a0_0x40110b(0xcf),'description':a0_0x40110b(0xe4)},'task':{'type':a0_0x40110b(0xcf),'description':a0_0x40110b(0xdc)},'priority':{'type':a0_0x40110b(0xcf),'enum':[a0_0x40110b(0xc3),a0_0x40110b(0x96),'low'],'description':'Priority\x20(default:\x20normal)'}},'required':[a0_0x40110b(0x9f),'task']}},{'name':a0_0x40110b(0x8d),'description':'Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','inputSchema':{'type':a0_0x40110b(0xa7),'properties':{'alias':{'type':a0_0x40110b(0xcf),'description':a0_0x40110b(0xe4)},'message':{'type':'string','description':'Message\x20content'}},'required':[a0_0x40110b(0x9f),'message']}},{'name':a0_0x40110b(0xc4),'description':a0_0x40110b(0x9b),'inputSchema':{'type':a0_0x40110b(0xa7),'properties':{}}}]}));async function P(_0x5a0747,_0x5e851c){const _0x1f0efa=a0_0x40110b;let _0x5b56d6=await fetch(D+_0x1f0efa(0x8a),{'method':_0x1f0efa(0xc6),'headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x1f0efa(0xd5)+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x1f0efa(0xf7),'id':0x1,'method':_0x1f0efa(0xbc),'params':{'protocolVersion':_0x1f0efa(0xe9),'capabilities':{},'clientInfo':{'name':_0x1f0efa(0xc0),'version':'0.3.0'}}})});if(!_0x5b56d6['ok']){let _0x1e40cd=await _0x5b56d6['text']();return Y(_0x1f0efa(0xbb)+_0x5b56d6[_0x1f0efa(0xd6)]+'\x20'+_0x1e40cd[_0x1f0efa(0xa9)](0x0,0x64)),{'ok':!0x1,'error':'init\x20failed:\x20'+_0x5b56d6[_0x1f0efa(0xd6)]};}await _0x5b56d6[_0x1f0efa(0xd9)]();let _0x152218=(await(await fetch(D+'/mcp',{'method':_0x1f0efa(0xc6),'headers':{'Content-Type':_0x1f0efa(0xb8),'Accept':_0x1f0efa(0x102),...X?{'Authorization':_0x1f0efa(0xd5)+X}:{}},'body':JSON[_0x1f0efa(0xaf)]({'jsonrpc':_0x1f0efa(0xf7),'id':0x2,'method':_0x1f0efa(0x98),'params':{'name':_0x5a0747,'arguments':_0x5e851c}})}))[_0x1f0efa(0xd9)]())[_0x1f0efa(0x8c)]('\x0a')[_0x1f0efa(0x10f)](_0x29df4b=>_0x29df4b['startsWith'](_0x1f0efa(0xd0)));if(_0x152218){let _0x110b01=JSON[_0x1f0efa(0xb7)](_0x152218[_0x1f0efa(0xa9)](0x6));return _0x110b01?.['result']?.[_0x1f0efa(0xe1)]?.[0x0]?.['text']?JSON[_0x1f0efa(0xb7)](_0x110b01['result']['content'][0x0]['text']):_0x110b01;}return{'ok':!0x1,'error':_0x1f0efa(0x109)};}K[a0_0x40110b(0xb6)](a0_0x3ce375,async _0x7c88fd=>{const _0xb6fd8b=a0_0x40110b;let {name:_0x3cc211,arguments:_0x559c05}=_0x7c88fd[_0xb6fd8b(0x99)];if(_0x3cc211===_0xb6fd8b(0xe6)){let {task_id:_0x46f7bc,text:_0x176a61,status:_0x391ce2}=_0x559c05;if(_0x391ce2==='completed'||_0x391ce2===_0xb6fd8b(0xab)||_0x391ce2==='cancelled'){let _0x46fda5=_0x391ce2===_0xb6fd8b(0xb2)?_0xb6fd8b(0xd2):_0x391ce2,_0x477bac=_0x46f7bc?k[_0xb6fd8b(0xcd)](_0x46f7bc)||_0xb6fd8b(0x9c):_0xb6fd8b(0x9c),_0x4cbabc=await P('send_reply',{'alias':_0x477bac,'text':_0x176a61,'in_reply_to':_0x46f7bc||void 0x0,'status':_0x46fda5,'from_session':Z});if(_0x46f7bc)k[_0xb6fd8b(0xd8)](_0x46f7bc);return{'content':[{'type':_0xb6fd8b(0xd9),'text':JSON[_0xb6fd8b(0xaf)](_0x4cbabc)}]};}let _0xbbaf3b=await P(_0xb6fd8b(0xcc),{'resume_id':w,'alias':Z,'status':_0x391ce2===_0xb6fd8b(0xae)?_0xb6fd8b(0xae):_0x391ce2===_0xb6fd8b(0xb1)?_0xb6fd8b(0xb1):_0xb6fd8b(0xfc),'task':_0x176a61[_0xb6fd8b(0xa9)](0x0,0xc8),'output':_0x176a61});return{'content':[{'type':'text','text':JSON[_0xb6fd8b(0xaf)](_0xbbaf3b)}]};}if(_0x3cc211===_0xb6fd8b(0x9a)){let {status:_0x17dac7,task:_0x433d7d,progress:_0x11c783}=_0x559c05,_0x16abde=await P(_0xb6fd8b(0xcc),{'resume_id':w,'alias':Z,'status':_0x17dac7,'task':_0x433d7d,'progress':_0x11c783});return{'content':[{'type':_0xb6fd8b(0xd9),'text':JSON[_0xb6fd8b(0xaf)](_0x16abde)}]};}if(_0x3cc211===_0xb6fd8b(0xf8)){let {alias:_0x123f28,task:_0x1ae5ab,priority:_0x1b8537}=_0x559c05,_0x18086f=await P(_0xb6fd8b(0xbf),{'alias':_0x123f28,'task':_0x1ae5ab,'priority':_0x1b8537||_0xb6fd8b(0x96),'from_session':Z});return{'content':[{'type':'text','text':JSON['stringify'](_0x18086f)}]};}if(_0x3cc211===_0xb6fd8b(0x8d)){let {alias:_0x19c66f,message:_0x5b43a4}=_0x559c05,_0x6bea33=await P('send_message',{'alias':_0x19c66f,'message':_0x5b43a4,'from_session':Z});return{'content':[{'type':_0xb6fd8b(0xd9),'text':JSON['stringify'](_0x6bea33)}]};}if(_0x3cc211==='commhub_get_all_status'){let _0x10c466=await P(_0xb6fd8b(0xfe),{});return{'content':[{'type':'text','text':JSON['stringify'](_0x10c466)}]};}return{'content':[{'type':_0xb6fd8b(0xd9),'text':JSON['stringify']({'error':_0xb6fd8b(0xc9)})}]};});async function v(){const _0x59b925=a0_0x40110b;let _0x5c5d55=D+_0x59b925(0x95)+encodeURIComponent(Z),_0x1c49b={};if(X)_0x1c49b['Authorization']=_0x59b925(0xd5)+X;Y(_0x59b925(0xa8)+_0x5c5d55);while(!0x0){try{let _0x30d49a=await fetch(_0x5c5d55,{'headers':_0x1c49b});if(!_0x30d49a['ok']){Y(_0x59b925(0xa1)+_0x30d49a['status']+'\x20'+_0x30d49a[_0x59b925(0xf9)]),await h(0x1388);continue;}let _0xf9ad4a=_0x30d49a['body'][_0x59b925(0xec)](),_0x1d0877=new TextDecoder(),_0x31a854='';while(!0x0){let {done:_0x488c13,value:_0x3a9283}=await _0xf9ad4a[_0x59b925(0x110)]();if(_0x488c13)break;_0x31a854+=_0x1d0877[_0x59b925(0xe5)](_0x3a9283,{'stream':!0x0});let _0x456a79=_0x31a854[_0x59b925(0x8c)]('\x0a\x0a');_0x31a854=_0x456a79[_0x59b925(0x107)]()||'';for(let _0x5efdcf of _0x456a79){let _0x117e77=_0x5efdcf['split']('\x0a')[_0x59b925(0x10f)](_0x12609c=>_0x12609c[_0x59b925(0x10c)]('data:\x20'));if(!_0x117e77)continue;try{let _0x199dad=JSON[_0x59b925(0xb7)](_0x117e77[_0x59b925(0xa9)](0x6));await u(_0x199dad);}catch(_0x21696){Y(_0x59b925(0xe7)+_0x21696);}}}Y('SSE\x20stream\x20ended,\x20reconnecting...');}catch(_0x4c49ad){Y(_0x59b925(0x101)+_0x4c49ad);}await h(0xbb8);}}async function u(_0x395bbe){const _0x4bb643=a0_0x40110b;if(_0x395bbe[_0x4bb643(0x112)]===_0x4bb643(0xc5)){Y(_0x4bb643(0xed)+Z+'\x22');return;}if(_0x395bbe[_0x4bb643(0x112)]===_0x4bb643(0xf1)){if(Y(_0x4bb643(0xc7)+_0x395bbe[_0x4bb643(0xf4)]+':\x20'+_0x395bbe['message'][_0x4bb643(0xa9)](0x0,0x3c)),await K[_0x4bb643(0xd1)]({'method':_0x4bb643(0x10b),'params':{'content':_0x395bbe[_0x4bb643(0xb5)],'meta':{'sender':_0x395bbe[_0x4bb643(0xf4)]||_0x4bb643(0x9c),'sender_id':_0x4bb643(0x93),'user':_0x395bbe[_0x4bb643(0xf4)]||_0x4bb643(0x9c),'priority':_0x4bb643(0x96)}}}),_0x395bbe[_0x4bb643(0xc8)])await P(_0x4bb643(0x8f),{'alias':Z,'message_id':_0x395bbe[_0x4bb643(0xc8)]});return;}if(_0x395bbe[_0x4bb643(0x112)]===_0x4bb643(0x92)||_0x395bbe['type']===_0x4bb643(0x104)){Y('←\x20'+_0x395bbe[_0x4bb643(0x112)]+_0x4bb643(0xf6)+_0x395bbe[_0x4bb643(0xb9)]+_0x4bb643(0xef)+(_0x395bbe[_0x4bb643(0x10e)]||_0x4bb643(0x96)));let _0x43cb9e=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0x43cb9e?.['ok']&&_0x43cb9e[_0x4bb643(0xf5)]?.[_0x4bb643(0xde)]>0x0)for(let _0x426af7 of _0x43cb9e['messages']){let _0x468090={'sender':_0x426af7[_0x4bb643(0x8e)]||_0x4bb643(0x9c),'sender_id':_0x4bb643(0x93),'user':_0x426af7[_0x4bb643(0x8e)]||_0x4bb643(0x9c),'task_id':_0x426af7['id'],'priority':_0x426af7['priority']||_0x4bb643(0x96)};k[_0x4bb643(0x97)](_0x426af7['id'],_0x426af7[_0x4bb643(0x8e)]||_0x4bb643(0x9c)),await K[_0x4bb643(0xd1)]({'method':_0x4bb643(0x10b),'params':{'content':_0x426af7[_0x4bb643(0xe1)],'meta':_0x468090}}),Y(_0x4bb643(0x9e)+_0x426af7['id'][_0x4bb643(0xa9)](0x0,0x8)+'\x20from\x20'+_0x426af7['from_session']+':\x20'+_0x426af7[_0x4bb643(0xe1)][_0x4bb643(0xa9)](0x0,0x3c)),await P(_0x4bb643(0x8f),{'alias':Z,'message_id':_0x426af7['id']});}}}async function S(){const _0xa6d671=a0_0x40110b;let _0x1cbc4d=new a0_0x151235();await K[_0xa6d671(0xb4)](_0x1cbc4d),Y(_0xa6d671(0xe8)),Y(_0xa6d671(0xf0)),v()[_0xa6d671(0xdf)](_0x3d74a6=>Y('SSE\x20fatal:\x20'+_0x3d74a6)),P(_0xa6d671(0xcc),{'resume_id':w,'alias':Z,'status':_0xa6d671(0xaa),'server':a0_0x159f86(),'hostname':a0_0x159f86(),'agent':'claude-code','project_dir':process['cwd'](),'tmux_name':f||void 0x0})[_0xa6d671(0xac)](()=>Y('registered\x20as\x20\x22'+Z+_0xa6d671(0x89)+w['slice'](0x0,0x8)+')'))[_0xa6d671(0xdf)](_0x20c186=>Y(_0xa6d671(0x113)+_0x20c186)),setInterval(()=>{const _0x1c0484=_0xa6d671;P(_0x1c0484(0xcc),{'resume_id':w,'alias':Z,'status':_0x1c0484(0xaa),'server':a0_0x159f86(),'hostname':a0_0x159f86(),'agent':_0x1c0484(0xd4),'project_dir':process['cwd'](),'tmux_name':f||void 0x0})[_0x1c0484(0xdf)](_0xedc003=>Y('heartbeat\x20failed:\x20'+_0xedc003));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}S()[a0_0x40110b(0xdf)](_0x318c79=>{const _0x479e7b=a0_0x40110b;Y(_0x479e7b(0xda)+_0x318c79),process[_0x479e7b(0xb3)](0x1);});function a0_0x329f(_0x6ea8ae,_0x2ec823){_0x6ea8ae=_0x6ea8ae-0x89;const _0x169f94=a0_0x169f();let _0x329f41=_0x169f94[_0x6ea8ae];return _0x329f41;}async function N(){const _0x122551=a0_0x40110b;Y(_0x122551(0x106)),await P('report_status',{'resume_id':w,'alias':Z,'status':_0x122551(0xb1),'task':_0x122551(0xa6)})['catch'](()=>{}),process[_0x122551(0xb3)](0x0);}process[a0_0x40110b(0xd3)]['on']('end',()=>N()),process['on'](a0_0x40110b(0xcb),()=>N()),process['on'](a0_0x40110b(0x111),()=>N());
2
+ const a0_0xaf1b4d=a0_0x3a1b;(function(_0x36bed5,_0x3be8fd){const _0x22733a=a0_0x3a1b,_0x513acb=_0x36bed5();while(!![]){try{const _0x43933a=parseInt(_0x22733a(0x12b))/0x1*(-parseInt(_0x22733a(0x15c))/0x2)+-parseInt(_0x22733a(0x165))/0x3+-parseInt(_0x22733a(0x13f))/0x4+parseInt(_0x22733a(0x15d))/0x5+-parseInt(_0x22733a(0x163))/0x6+-parseInt(_0x22733a(0x161))/0x7*(-parseInt(_0x22733a(0x172))/0x8)+parseInt(_0x22733a(0x109))/0x9*(parseInt(_0x22733a(0x12c))/0xa);if(_0x43933a===_0x3be8fd)break;else _0x513acb['push'](_0x513acb['shift']());}catch(_0x2e2355){_0x513acb['push'](_0x513acb['shift']());}}}(a0_0x1457,0x3cd75));import{readFileSync as a0_0x2d475e,existsSync as a0_0x284e7f}from'fs';import{join as a0_0x384299}from'path';import{hostname as a0_0x2ae81f}from'os';import{execSync as a0_0x999a1f}from'child_process';import{Server as a0_0x73f1f9}from'@modelcontextprotocol/sdk/server/index.js';function a0_0x3a1b(_0x584722,_0x4cbc8b){_0x584722=_0x584722-0xf1;const _0x1457df=a0_0x1457();let _0x3a1b10=_0x1457df[_0x584722];return _0x3a1b10;}import{StdioServerTransport as a0_0x482d48}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0xd1454e,CallToolRequestSchema as a0_0x462085}from'@modelcontextprotocol/sdk/types.js';function p(_0x47164c){const _0x5a622=a0_0x3a1b;if(!a0_0x284e7f(_0x47164c))return;for(let _0x478d7e of a0_0x2d475e(_0x47164c,_0x5a622(0x114))[_0x5a622(0xf2)]('\x0a')){let _0x5ea864=_0x478d7e['trim']();if(!_0x5ea864||_0x5ea864['startsWith']('#'))continue;let _0x2fbac6=_0x5ea864[_0x5a622(0x164)]('=');if(_0x2fbac6<0x0)continue;let _0x43ab2b=_0x5ea864['slice'](0x0,_0x2fbac6)[_0x5a622(0x116)](),_0x2d8bd0=_0x5ea864[_0x5a622(0xf9)](_0x2fbac6+0x1)[_0x5a622(0x116)]()[_0x5a622(0x103)](/^["']|["']$/g,'');if(!process.env[_0x43ab2b])process.env[_0x43ab2b]=_0x2d8bd0;}}var C=process.env.HOME||'~',T=a0_0x384299(C,a0_0xaf1b4d(0x118));p(a0_0x384299(T,a0_0xaf1b4d(0x16a)));var L=process[a0_0xaf1b4d(0x150)]()[a0_0xaf1b4d(0x103)](/\//g,'-');p(a0_0x384299(T,L,a0_0xaf1b4d(0x16a)));function U(){const _0x4c72e8=a0_0xaf1b4d;try{return a0_0x999a1f('tmux\x20display-message\x20-p\x20\x27#S\x27',{'encoding':_0x4c72e8(0x114),'timeout':0x7d0})[_0x4c72e8(0x116)]();}catch{return'';}}function c(){const _0x56a00d=a0_0xaf1b4d;try{let _0x3a7282=a0_0x384299(C,_0x56a00d(0x147),'config.json');if(a0_0x284e7f(_0x3a7282))return JSON[_0x56a00d(0x10d)](a0_0x2d475e(_0x3a7282,_0x56a00d(0x114)));}catch{}return{};}var H=c(),D=process.env.COMMHUB_URL||H[a0_0xaf1b4d(0x137)]||a0_0xaf1b4d(0x17d),f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0x2ae81f(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto[a0_0xaf1b4d(0x112)](),X=process.env.COMMHUB_TOKEN||H[a0_0xaf1b4d(0x162)]||'';function Y(_0x3d350b){const _0x4a1d03=a0_0xaf1b4d;let _0x203b60=new Date()[_0x4a1d03(0x11e)]()[_0x4a1d03(0xf9)](0x0,0x8);process[_0x4a1d03(0x104)][_0x4a1d03(0xfe)]('['+_0x203b60+_0x4a1d03(0x182)+_0x3d350b+'\x0a');}function h(_0x2f9a60){return new Promise(_0x388be0=>setTimeout(_0x388be0,_0x2f9a60));}function a0_0x1457(){const _0x45e5ca=['type','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','ack_inbox','inbox_count','\x20ALIAS=','parse\x20error:\x20','tools/call','from','set','25975halnGd','32890QvoxZU','then','string','2025-03-26','priority','SSE\x20connection\x20error:\x20','POST','content','application/json','commhub_send_message','SIGINT','hub','Bearer\x20','end','object','/mcp','2.0','\x20PROJECT_ENV=','commhub_get_all_status','1756412EpAQnJ','normal','pop','get','0.3.0','working','\x22\x20(','broadcast','.anet','report_status','idle','SSE\x20fatal:\x20','setRequestHandler','get_inbox','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','failed','statusText','cwd','commhub-channel','alias','warning:\x20could\x20not\x20register:\x20','get_all_status','messages','Session\x20alias:\x20','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','Progress\x200-100','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','number','message','14sUcddx','540485PySDlN','catch','initialize','session\x20disconnected','229859whjnGs','token','2130318ZlrUUE','indexOf','939129kPrjCL','notifications/claude/channel','\x20from\x20','low','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','.env','heartbeat\x20failed:\x20','ENV:\x20URL=','\x20priority=','decode','SSE\x20error:\x20','←\x20message\x20from\x20','unknown\x20tool','88TqVOFK','new_task','starting\x20SSE\x20listener...','params','join','stringify','/events/','connecting\x20to\x20','text','cancelled','none','http://127.0.0.1:9200','shutting\x20down,\x20reporting\x20offline...','no\x20response','registered\x20as\x20\x22','commhub_send_task',']\x20[commhub]\x20','SSE\x20stream\x20ended,\x20reconnecting...','split','data:\x20','claude-code','error','status','length','init\x20failed:\x20','slice','Target\x20session\x20alias','from_session','high','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','write','\x20RESUME_ID=','stdin','exit','application/json,\x20text/event-stream','replace','stderr','completed','blocked','CommHub\x20init\x20failed:\x20','commhub_reply','2925nHNkrm','replied','Reply\x20text\x20/\x20result\x20summary','body','parse','Priority\x20(default:\x20normal)','new_message','commhub','find','randomUUID','Message\x20content','utf-8','send_reply','trim','...\x20TMUX=','.claude/channels/commhub','send_message','notification','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','connected','delete','toTimeString','message_id','in_progress','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.'];a0_0x1457=function(){return _0x45e5ca;};return a0_0x1457();}Y(a0_0xaf1b4d(0x16c)+D+a0_0xaf1b4d(0x126)+Z+a0_0xaf1b4d(0xff)+w[a0_0xaf1b4d(0xf9)](0x0,0x8)+a0_0xaf1b4d(0x117)+(f||a0_0xaf1b4d(0x17c))+'\x20CWD='+process[a0_0xaf1b4d(0x150)]()+a0_0xaf1b4d(0x13d)+L);var k=new Map(),K=new a0_0x73f1f9({'name':'commhub-channel','version':'0.3.0'},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0xaf1b4d(0x11b),a0_0xaf1b4d(0x121),a0_0xaf1b4d(0x123),a0_0xaf1b4d(0x169),a0_0xaf1b4d(0x156)+Z][a0_0xaf1b4d(0x176)]('\x0a')});K[a0_0xaf1b4d(0x14b)](a0_0xd1454e,async()=>({'tools':[{'name':'commhub_reply','description':a0_0xaf1b4d(0xfd),'inputSchema':{'type':'object','properties':{'task_id':{'type':a0_0xaf1b4d(0x12e),'description':a0_0xaf1b4d(0x14d)},'text':{'type':a0_0xaf1b4d(0x12e),'description':a0_0xaf1b4d(0x10b)},'status':{'type':'string','enum':['completed',a0_0xaf1b4d(0x14e),a0_0xaf1b4d(0x17b),'blocked',a0_0xaf1b4d(0xf5),a0_0xaf1b4d(0x120)],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':[a0_0xaf1b4d(0x17a)]}},{'name':'commhub_report_status','description':'Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','inputSchema':{'type':a0_0xaf1b4d(0x13a),'properties':{'status':{'type':'string','enum':[a0_0xaf1b4d(0x144),a0_0xaf1b4d(0x149),a0_0xaf1b4d(0x106),'error']},'task':{'type':a0_0xaf1b4d(0x12e),'description':'Current\x20task\x20description'},'progress':{'type':a0_0xaf1b4d(0x15a),'description':a0_0xaf1b4d(0x158)}},'required':[a0_0xaf1b4d(0xf6)]}},{'name':'commhub_send_task','description':a0_0xaf1b4d(0x157),'inputSchema':{'type':a0_0xaf1b4d(0x13a),'properties':{'alias':{'type':a0_0xaf1b4d(0x12e),'description':a0_0xaf1b4d(0xfa)},'task':{'type':a0_0xaf1b4d(0x12e),'description':'Task\x20content'},'priority':{'type':a0_0xaf1b4d(0x12e),'enum':[a0_0xaf1b4d(0xfc),a0_0xaf1b4d(0x140),a0_0xaf1b4d(0x168)],'description':a0_0xaf1b4d(0x10e)}},'required':[a0_0xaf1b4d(0x152),'task']}},{'name':a0_0xaf1b4d(0x135),'description':a0_0xaf1b4d(0x159),'inputSchema':{'type':a0_0xaf1b4d(0x13a),'properties':{'alias':{'type':'string','description':a0_0xaf1b4d(0xfa)},'message':{'type':a0_0xaf1b4d(0x12e),'description':a0_0xaf1b4d(0x113)}},'required':[a0_0xaf1b4d(0x152),a0_0xaf1b4d(0x15b)]}},{'name':a0_0xaf1b4d(0x13e),'description':'Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','inputSchema':{'type':a0_0xaf1b4d(0x13a),'properties':{}}}]}));async function P(_0x126e46,_0x52411a){const _0x3f13a6=a0_0xaf1b4d;let _0x20ef88=await fetch(D+'/mcp',{'method':_0x3f13a6(0x132),'headers':{'Content-Type':_0x3f13a6(0x134),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x3f13a6(0x138)+X}:{}},'body':JSON[_0x3f13a6(0x177)]({'jsonrpc':_0x3f13a6(0x13c),'id':0x1,'method':_0x3f13a6(0x15f),'params':{'protocolVersion':_0x3f13a6(0x12f),'capabilities':{},'clientInfo':{'name':_0x3f13a6(0x151),'version':_0x3f13a6(0x143)}}})});if(!_0x20ef88['ok']){let _0x402be8=await _0x20ef88['text']();return Y(_0x3f13a6(0x107)+_0x20ef88[_0x3f13a6(0xf6)]+'\x20'+_0x402be8[_0x3f13a6(0xf9)](0x0,0x64)),{'ok':!0x1,'error':_0x3f13a6(0xf8)+_0x20ef88[_0x3f13a6(0xf6)]};}await _0x20ef88[_0x3f13a6(0x17a)]();let _0x3603b0=(await(await fetch(D+_0x3f13a6(0x13b),{'method':_0x3f13a6(0x132),'headers':{'Content-Type':_0x3f13a6(0x134),'Accept':_0x3f13a6(0x102),...X?{'Authorization':_0x3f13a6(0x138)+X}:{}},'body':JSON[_0x3f13a6(0x177)]({'jsonrpc':'2.0','id':0x2,'method':_0x3f13a6(0x128),'params':{'name':_0x126e46,'arguments':_0x52411a}})}))[_0x3f13a6(0x17a)]())[_0x3f13a6(0xf2)]('\x0a')[_0x3f13a6(0x111)](_0xa745=>_0xa745['startsWith'](_0x3f13a6(0xf3)));if(_0x3603b0){let _0x12ea09=JSON[_0x3f13a6(0x10d)](_0x3603b0[_0x3f13a6(0xf9)](0x6));return _0x12ea09?.['result']?.[_0x3f13a6(0x133)]?.[0x0]?.[_0x3f13a6(0x17a)]?JSON[_0x3f13a6(0x10d)](_0x12ea09['result'][_0x3f13a6(0x133)][0x0]['text']):_0x12ea09;}return{'ok':!0x1,'error':_0x3f13a6(0x17f)};}K[a0_0xaf1b4d(0x14b)](a0_0x462085,async _0x372068=>{const _0x2b0b04=a0_0xaf1b4d;let {name:_0x25b500,arguments:_0x492503}=_0x372068[_0x2b0b04(0x175)];if(_0x25b500===_0x2b0b04(0x108)){let {task_id:_0x4bd18d,text:_0x450954,status:_0x52db43}=_0x492503;if(_0x52db43===_0x2b0b04(0x105)||_0x52db43===_0x2b0b04(0x14e)||_0x52db43===_0x2b0b04(0x17b)){let _0xa7167c=_0x52db43===_0x2b0b04(0x105)?_0x2b0b04(0x10a):_0x52db43,_0x125d0f=_0x4bd18d?k[_0x2b0b04(0x142)](_0x4bd18d)||_0x2b0b04(0x137):_0x2b0b04(0x137),_0x4b3f1c=await P(_0x2b0b04(0x115),{'alias':_0x125d0f,'text':_0x450954,'in_reply_to':_0x4bd18d||void 0x0,'status':_0xa7167c,'from_session':Z});if(_0x4bd18d)k[_0x2b0b04(0x11d)](_0x4bd18d);return{'content':[{'type':_0x2b0b04(0x17a),'text':JSON[_0x2b0b04(0x177)](_0x4b3f1c)}]};}let _0x15960b=await P(_0x2b0b04(0x148),{'resume_id':w,'alias':Z,'status':_0x52db43===_0x2b0b04(0x106)?_0x2b0b04(0x106):_0x52db43==='error'?_0x2b0b04(0xf5):_0x2b0b04(0x144),'task':_0x450954[_0x2b0b04(0xf9)](0x0,0xc8),'output':_0x450954});return{'content':[{'type':_0x2b0b04(0x17a),'text':JSON[_0x2b0b04(0x177)](_0x15960b)}]};}if(_0x25b500==='commhub_report_status'){let {status:_0x21c8eb,task:_0x5cd6f9,progress:_0x48345e}=_0x492503,_0x5e23ac=await P(_0x2b0b04(0x148),{'resume_id':w,'alias':Z,'status':_0x21c8eb,'task':_0x5cd6f9,'progress':_0x48345e});return{'content':[{'type':_0x2b0b04(0x17a),'text':JSON[_0x2b0b04(0x177)](_0x5e23ac)}]};}if(_0x25b500===_0x2b0b04(0x181)){let {alias:_0x5a4e80,task:_0x4424d9,priority:_0x420037}=_0x492503,_0x53b325=await P('send_task',{'alias':_0x5a4e80,'task':_0x4424d9,'priority':_0x420037||'normal','from_session':Z});return{'content':[{'type':_0x2b0b04(0x17a),'text':JSON[_0x2b0b04(0x177)](_0x53b325)}]};}if(_0x25b500===_0x2b0b04(0x135)){let {alias:_0x842a4c,message:_0x42455f}=_0x492503,_0x5c0af6=await P(_0x2b0b04(0x119),{'alias':_0x842a4c,'message':_0x42455f,'from_session':Z});return{'content':[{'type':_0x2b0b04(0x17a),'text':JSON[_0x2b0b04(0x177)](_0x5c0af6)}]};}if(_0x25b500===_0x2b0b04(0x13e)){let _0x12e22b=await P(_0x2b0b04(0x154),{});return{'content':[{'type':_0x2b0b04(0x17a),'text':JSON['stringify'](_0x12e22b)}]};}return{'content':[{'type':_0x2b0b04(0x17a),'text':JSON['stringify']({'error':_0x2b0b04(0x171)})}]};});async function v(){const _0x8a1b6e=a0_0xaf1b4d;let _0x475ebb=D+_0x8a1b6e(0x178)+encodeURIComponent(Z),_0x169c98={};if(X)_0x169c98['Authorization']='Bearer\x20'+X;Y(_0x8a1b6e(0x179)+_0x475ebb);while(!0x0){try{let _0x19da1e=await fetch(_0x475ebb,{'headers':_0x169c98});if(!_0x19da1e['ok']){Y(_0x8a1b6e(0x16f)+_0x19da1e['status']+'\x20'+_0x19da1e[_0x8a1b6e(0x14f)]),await h(0x1388);continue;}let _0x3c83c6=_0x19da1e[_0x8a1b6e(0x10c)]['getReader'](),_0x3d6430=new TextDecoder(),_0x5e2bc0='';while(!0x0){let {done:_0x4bed30,value:_0x47aba2}=await _0x3c83c6['read']();if(_0x4bed30)break;_0x5e2bc0+=_0x3d6430[_0x8a1b6e(0x16e)](_0x47aba2,{'stream':!0x0});let _0x90eb5a=_0x5e2bc0[_0x8a1b6e(0xf2)]('\x0a\x0a');_0x5e2bc0=_0x90eb5a[_0x8a1b6e(0x141)]()||'';for(let _0x2d550f of _0x90eb5a){let _0x57645d=_0x2d550f[_0x8a1b6e(0xf2)]('\x0a')[_0x8a1b6e(0x111)](_0x44fade=>_0x44fade['startsWith']('data:\x20'));if(!_0x57645d)continue;try{let _0x362f96=JSON[_0x8a1b6e(0x10d)](_0x57645d[_0x8a1b6e(0xf9)](0x6));await u(_0x362f96);}catch(_0xc6d6c9){Y(_0x8a1b6e(0x127)+_0xc6d6c9);}}}Y(_0x8a1b6e(0xf1));}catch(_0x41bbee){Y(_0x8a1b6e(0x131)+_0x41bbee);}await h(0xbb8);}}async function u(_0x26a5b5){const _0x3ebb50=a0_0xaf1b4d;if(_0x26a5b5[_0x3ebb50(0x122)]===_0x3ebb50(0x11c)){Y('SSE\x20connected\x20as\x20\x22'+Z+'\x22');return;}if(_0x26a5b5[_0x3ebb50(0x122)]===_0x3ebb50(0x10f)){if(Y(_0x3ebb50(0x170)+_0x26a5b5[_0x3ebb50(0x129)]+':\x20'+_0x26a5b5[_0x3ebb50(0x15b)]['slice'](0x0,0x3c)),await K[_0x3ebb50(0x11a)]({'method':'notifications/claude/channel','params':{'content':_0x26a5b5[_0x3ebb50(0x15b)],'meta':{'sender':_0x26a5b5[_0x3ebb50(0x129)]||_0x3ebb50(0x137),'sender_id':_0x3ebb50(0x110),'user':_0x26a5b5['from']||_0x3ebb50(0x137),'priority':_0x3ebb50(0x140)}}}),_0x26a5b5[_0x3ebb50(0x11f)])await P(_0x3ebb50(0x124),{'alias':Z,'message_id':_0x26a5b5[_0x3ebb50(0x11f)]});return;}if(_0x26a5b5['type']===_0x3ebb50(0x173)||_0x26a5b5[_0x3ebb50(0x122)]===_0x3ebb50(0x146)){Y('←\x20'+_0x26a5b5[_0x3ebb50(0x122)]+':\x20inbox_count='+_0x26a5b5[_0x3ebb50(0x125)]+_0x3ebb50(0x16d)+(_0x26a5b5['priority']||'normal'));let _0xa491af=await P(_0x3ebb50(0x14c),{'alias':Z,'limit':0x5});if(_0xa491af?.['ok']&&_0xa491af[_0x3ebb50(0x155)]?.[_0x3ebb50(0xf7)]>0x0)for(let _0xfcc31a of _0xa491af['messages']){let _0x3f70a9={'sender':_0xfcc31a['from_session']||_0x3ebb50(0x137),'sender_id':_0x3ebb50(0x110),'user':_0xfcc31a[_0x3ebb50(0xfb)]||'hub','task_id':_0xfcc31a['id'],'priority':_0xfcc31a[_0x3ebb50(0x130)]||'normal'};k[_0x3ebb50(0x12a)](_0xfcc31a['id'],_0xfcc31a[_0x3ebb50(0xfb)]||_0x3ebb50(0x137)),await K[_0x3ebb50(0x11a)]({'method':_0x3ebb50(0x166),'params':{'content':_0xfcc31a['content'],'meta':_0x3f70a9}}),Y('→\x20injected\x20task\x20'+_0xfcc31a['id'][_0x3ebb50(0xf9)](0x0,0x8)+_0x3ebb50(0x167)+_0xfcc31a['from_session']+':\x20'+_0xfcc31a[_0x3ebb50(0x133)][_0x3ebb50(0xf9)](0x0,0x3c)),await P(_0x3ebb50(0x124),{'alias':Z,'message_id':_0xfcc31a['id']});}}}async function S(){const _0x589905=a0_0xaf1b4d;let _0x3ef90b=new a0_0x482d48();await K['connect'](_0x3ef90b),Y('MCP\x20stdio\x20connected'),Y(_0x589905(0x174)),v()['catch'](_0x1a207d=>Y(_0x589905(0x14a)+_0x1a207d)),P(_0x589905(0x148),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x2ae81f(),'hostname':a0_0x2ae81f(),'agent':_0x589905(0xf4),'project_dir':process[_0x589905(0x150)](),'tmux_name':f||void 0x0})[_0x589905(0x12d)](()=>Y(_0x589905(0x180)+Z+_0x589905(0x145)+w[_0x589905(0xf9)](0x0,0x8)+')'))[_0x589905(0x15e)](_0xaf4576=>Y(_0x589905(0x153)+_0xaf4576)),setInterval(()=>{const _0x4b9326=_0x589905;P(_0x4b9326(0x148),{'resume_id':w,'alias':Z,'status':_0x4b9326(0x149),'server':a0_0x2ae81f(),'hostname':a0_0x2ae81f(),'agent':_0x4b9326(0xf4),'project_dir':process[_0x4b9326(0x150)](),'tmux_name':f||void 0x0})[_0x4b9326(0x15e)](_0xa2995a=>Y(_0x4b9326(0x16b)+_0xa2995a));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}S()[a0_0xaf1b4d(0x15e)](_0x54a689=>{const _0x1006fe=a0_0xaf1b4d;Y('fatal:\x20'+_0x54a689),process[_0x1006fe(0x101)](0x1);});async function N(){const _0x11a380=a0_0xaf1b4d;Y(_0x11a380(0x17e)),await P(_0x11a380(0x148),{'resume_id':w,'alias':Z,'status':_0x11a380(0xf5),'task':_0x11a380(0x160)})[_0x11a380(0x15e)](()=>{}),process[_0x11a380(0x101)](0x0);}process[a0_0xaf1b4d(0x100)]['on'](a0_0xaf1b4d(0x139),()=>N()),process['on']('SIGTERM',()=>N()),process['on'](a0_0xaf1b4d(0x136),()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.0.0-preview.24",
3
+ "version": "2.0.0-preview.25",
4
4
  "description": "AI Agent Network CLI \u2014 Create multi-agent networks with user management, network isolation, and 3 AI runtimes (Claude/Codex/MiniMax). 34 commands.",
5
5
  "type": "module",
6
6
  "main": "dist/src/client.js",