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

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_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
+ const a0_0x9487dc=a0_0x5c6f;(function(_0x34fbc7,_0x4d1ace){const _0x557984=a0_0x5c6f,_0x5e07ae=_0x34fbc7();while(!![]){try{const _0x565cdf=parseInt(_0x557984(0xb9))/0x1*(-parseInt(_0x557984(0x8c))/0x2)+-parseInt(_0x557984(0xb6))/0x3+-parseInt(_0x557984(0xb5))/0x4+-parseInt(_0x557984(0x99))/0x5+parseInt(_0x557984(0x98))/0x6+parseInt(_0x557984(0xc5))/0x7+-parseInt(_0x557984(0x9d))/0x8*(-parseInt(_0x557984(0x92))/0x9);if(_0x565cdf===_0x4d1ace)break;else _0x5e07ae['push'](_0x5e07ae['shift']());}catch(_0x3deadf){_0x5e07ae['push'](_0x5e07ae['shift']());}}}(a0_0x1f57,0xdcf41));import{EventEmitter as a0_0x5c27ad}from'events';import{hostname as a0_0x3dcd27}from'os';class T extends a0_0x5c27ad{[a0_0x9487dc(0x8e)];[a0_0x9487dc(0xb0)];[a0_0x9487dc(0x7c)];[a0_0x9487dc(0xa7)];[a0_0x9487dc(0x9f)];[a0_0x9487dc(0xc8)];[a0_0x9487dc(0x9a)];[a0_0x9487dc(0xa6)];[a0_0x9487dc(0x80)];[a0_0x9487dc(0xa5)]=!0x1;constructor(_0x4290d3){const _0x17d288=a0_0x9487dc;super();if(this[_0x17d288(0x8e)]=_0x4290d3['url'][_0x17d288(0xba)](/\/$/,''),this['alias']=_0x4290d3[_0x17d288(0xb0)],this[_0x17d288(0x7c)]=_0x4290d3['token'],this['agent']=_0x4290d3[_0x17d288(0xa7)]||_0x17d288(0x90),this[_0x17d288(0x9f)]=_0x17d288(0x9b)+_0x4290d3[_0x17d288(0xb0)]+'-'+Date[_0x17d288(0xc4)]()[_0x17d288(0x8f)](0x24),this['heartbeatInterval']=_0x4290d3[_0x17d288(0xc8)]??0x2bf20,this[_0x17d288(0x9a)]=_0x4290d3[_0x17d288(0x9a)]??0xbb8,_0x4290d3[_0x17d288(0xa1)]!==!0x1)this['connect']();}[a0_0x9487dc(0xcb)](_0x32aa51){const _0xe564d1=a0_0x9487dc;console[_0xe564d1(0xcb)]('['+new Date()[_0xe564d1(0xac)]()['slice'](0x0,0x8)+_0xe564d1(0xce)+this[_0xe564d1(0xb0)]+']\x20'+_0x32aa51);}async[a0_0x9487dc(0x91)](_0x210558,_0x32db71){const _0x4b3db2=a0_0x9487dc;let _0xe972fa={'Content-Type':'application/json','Accept':_0x4b3db2(0xae)};if(this[_0x4b3db2(0x7c)])_0xe972fa[_0x4b3db2(0x84)]=_0x4b3db2(0xad)+this[_0x4b3db2(0x7c)];let _0x37b729=await(await fetch(this[_0x4b3db2(0x8e)]+'/mcp',{'method':_0x4b3db2(0xab),'headers':_0xe972fa,'body':JSON[_0x4b3db2(0x9e)]({'jsonrpc':'2.0','id':Date['now'](),'method':_0x4b3db2(0xbf),'params':{'name':_0x210558,'arguments':_0x32db71}})}))[_0x4b3db2(0xc6)](),_0x3c8fa5=_0x37b729['match'](/data: (.+)/),_0x4e08cc=_0x3c8fa5?JSON[_0x4b3db2(0xb2)](_0x3c8fa5[0x1]):JSON[_0x4b3db2(0xb2)](_0x37b729),_0x2d2f5f=_0x4e08cc?.[_0x4b3db2(0x86)]?.[_0x4b3db2(0xaf)]?.[0x0]?.[_0x4b3db2(0xc6)];return _0x2d2f5f?JSON[_0x4b3db2(0xb2)](_0x2d2f5f):_0x4e08cc;}async['connect'](){const _0x1c7774=a0_0x9487dc;if(this[_0x1c7774(0xa5)])return;this[_0x1c7774(0xa5)]=!0x0,await this['status'](_0x1c7774(0xa4)),this['log'](_0x1c7774(0xa3)),this[_0x1c7774(0xa6)]=setInterval(()=>{const _0x10637c=_0x1c7774;this[_0x10637c(0xc9)](_0x10637c(0xa4))[_0x10637c(0xa2)](_0x13ee81=>this[_0x10637c(0xcb)](_0x10637c(0xa9)+_0x13ee81['message']));},this['heartbeatInterval']),this[_0x1c7774(0x7f)]();}async[a0_0x9487dc(0xb8)](){const _0xd9aa9e=a0_0x9487dc;if(this[_0xd9aa9e(0xa5)]=!0x1,this[_0xd9aa9e(0x80)]?.[_0xd9aa9e(0xd1)](),this[_0xd9aa9e(0xa6)])clearInterval(this[_0xd9aa9e(0xa6)]);await this[_0xd9aa9e(0xc9)](_0xd9aa9e(0xa0))[_0xd9aa9e(0xa2)](()=>{}),this[_0xd9aa9e(0xcb)](_0xd9aa9e(0xcd));}async[a0_0x9487dc(0x83)](_0x21b7fa,_0x149f3a,_0x82fedc=a0_0x9487dc(0x89)){const _0xcd835c=a0_0x9487dc;return this[_0xcd835c(0x91)](_0xcd835c(0x8d),{'alias':_0x21b7fa,'task':_0x149f3a,'priority':_0x82fedc,'from_session':this[_0xcd835c(0xb0)]});}async[a0_0x9487dc(0x81)](_0x3d826b,_0x2f52f6){const _0x5b44d0=a0_0x9487dc;return this[_0x5b44d0(0x91)](_0x5b44d0(0xbc),{'alias':_0x3d826b,'message':_0x2f52f6,'from_session':this[_0x5b44d0(0xb0)]});}async[a0_0x9487dc(0x8b)](_0x1fea96,_0x37dde0,_0x4d4a0f=a0_0x9487dc(0xcf)){const _0x2aca58=a0_0x9487dc;return this[_0x2aca58(0x91)](_0x2aca58(0x8b),{'task_id':_0x1fea96,'text':_0x37dde0,'status':_0x4d4a0f});}async[a0_0x9487dc(0xc9)](_0x349891,_0x592f61){const _0x4301fa=a0_0x9487dc;return this[_0x4301fa(0x91)](_0x4301fa(0xc0),{'resume_id':this[_0x4301fa(0x9f)],'alias':this[_0x4301fa(0xb0)],'status':_0x349891,'server':a0_0x3dcd27(),'hostname':a0_0x3dcd27(),'agent':this[_0x4301fa(0xa7)],'project_dir':process[_0x4301fa(0x87)](),..._0x592f61});}async[a0_0x9487dc(0xb1)](){const _0x59c593=a0_0x9487dc;return this[_0x59c593(0x91)]('get_all_status',{});}async[a0_0x9487dc(0xd0)](_0x235953,_0x4be855){const _0x22f188=a0_0x9487dc;return this[_0x22f188(0x91)](_0x22f188(0xd0),{'message':_0x235953,'filter_server':_0x4be855?.[_0x22f188(0xa8)],'filter_status':_0x4be855?.[_0x22f188(0xc9)]});}async[a0_0x9487dc(0x7f)](){const _0x135f05=a0_0x9487dc;let _0x2758f0=encodeURIComponent(this[_0x135f05(0xb0)]),_0x5b90e9=this[_0x135f05(0x8e)]+'/events/'+_0x2758f0,_0x4cc08b=this[_0x135f05(0x9a)];while(this[_0x135f05(0xa5)]){try{this[_0x135f05(0x80)]=new AbortController();let _0x42e234={'Accept':'text/event-stream'};if(this[_0x135f05(0x7c)])_0x42e234[_0x135f05(0x84)]=_0x135f05(0xad)+this['token'];let _0x585123=await fetch(_0x5b90e9,{'headers':_0x42e234,'signal':this[_0x135f05(0x80)]['signal']});if(!_0x585123['ok']||!_0x585123[_0x135f05(0xbb)]){this[_0x135f05(0xcb)](_0x135f05(0xc1)+_0x585123['status']),await this[_0x135f05(0xb7)](_0x4cc08b),_0x4cc08b=Math[_0x135f05(0x82)](_0x4cc08b*1.5,0xea60);continue;}_0x4cc08b=this[_0x135f05(0x9a)];let _0x5be6d6=_0x585123[_0x135f05(0xbb)][_0x135f05(0x97)](),_0x47ebe1=new TextDecoder(),_0x2b2f79='';while(this[_0x135f05(0xa5)]){let {done:_0x4205b2,value:_0x20f8a6}=await _0x5be6d6[_0x135f05(0xc3)]();if(_0x4205b2)break;_0x2b2f79+=_0x47ebe1['decode'](_0x20f8a6,{'stream':!0x0});let _0x1f97e=_0x2b2f79[_0x135f05(0x95)]('\x0a');_0x2b2f79=_0x1f97e[_0x135f05(0xaa)]()||'';for(let _0x36fbb0 of _0x1f97e){if(!_0x36fbb0['startsWith'](_0x135f05(0x8a)))continue;try{let _0x560404=JSON[_0x135f05(0xb2)](_0x36fbb0[_0x135f05(0xbe)](0x6));if(_0x560404[_0x135f05(0x93)]==='connected'){this[_0x135f05(0xcb)](_0x135f05(0xb3)),this[_0x135f05(0x88)]('connected');continue;}if(_0x560404['type']===_0x135f05(0x85)||_0x560404[_0x135f05(0x93)]==='new_message'||_0x560404['type']===_0x135f05(0xd0))await this['processInbox']();}catch{}}}}catch(_0x4712e8){if(_0x4712e8[_0x135f05(0xc2)]===_0x135f05(0xca))break;this[_0x135f05(0x88)](_0x135f05(0xc7),_0x4712e8),this[_0x135f05(0xcb)](_0x135f05(0xcc)+_0x4712e8[_0x135f05(0x81)]);}if(this['running'])this[_0x135f05(0x88)](_0x135f05(0xcd)),this[_0x135f05(0xcb)](_0x135f05(0xb4)+_0x4cc08b/0x3e8+_0x135f05(0x7d)),await this[_0x135f05(0xb7)](_0x4cc08b),_0x4cc08b=Math['min'](_0x4cc08b*1.5,0xea60);}}async[a0_0x9487dc(0xbd)](){const _0x2f6724=a0_0x9487dc;try{let _0x272873=(await this[_0x2f6724(0x91)]('get_inbox',{'alias':this[_0x2f6724(0xb0)],'limit':0xa}))?.['messages']||[];for(let _0x37fc31 of _0x272873)await this[_0x2f6724(0x91)](_0x2f6724(0x94),{'alias':this[_0x2f6724(0xb0)],'message_id':_0x37fc31['id']}),this[_0x2f6724(0xcb)]('←\x20'+_0x37fc31[_0x2f6724(0x96)]+':\x20'+_0x37fc31[_0x2f6724(0xaf)][_0x2f6724(0xbe)](0x0,0x3c)),this['emit'](_0x2f6724(0x9c),_0x37fc31),this[_0x2f6724(0x88)](_0x2f6724(0x81),_0x37fc31);}catch(_0xc99ea){this[_0x2f6724(0xcb)](_0x2f6724(0x7e)+_0xc99ea[_0x2f6724(0x81)]);}}[a0_0x9487dc(0xb7)](_0x2e651){return new Promise(_0x2e350c=>setTimeout(_0x2e350c,_0x2e651));}}function a0_0x1f57(){const _0x486cea=['now','5428535gDiaOl','text','error','heartbeatInterval','status','AbortError','log','SSE\x20error:\x20','disconnected',']\x20[commhub:','completed','broadcast','abort','token','s...','inbox\x20error:\x20','connectSSE','sseAbort','message','min','send','Authorization','new_task','result','cwd','emit','normal','data:\x20','reply','722142MLXedw','send_task','url','toString','sdk','call','9xvePys','type','ack_inbox','split','from_session','getReader','5992104rTgeeg','1738130oADiIL','reconnectDelay','sdk-','task','6310320pUTezZ','stringify','resumeId','offline','autoConnect','catch','registered','idle','running','heartbeatTimer','agent','server','heartbeat\x20failed:\x20','pop','POST','toTimeString','Bearer\x20','application/json,\x20text/event-stream','content','alias','getAllStatus','parse','SSE\x20connected','SSE\x20reconnecting\x20in\x20','766212xdTulH','1189899aHIcFn','sleep','disconnect','2ETXnQq','replace','body','send_message','processInbox','slice','tools/call','report_status','SSE\x20failed:\x20','name','read'];a0_0x1f57=function(){return _0x486cea;};return a0_0x1f57();}var $=T;function a0_0x5c6f(_0x5aec37,_0x453812){_0x5aec37=_0x5aec37-0x7c;const _0x1f5762=a0_0x1f57();let _0x5c6fb6=_0x1f5762[_0x5aec37];return _0x5c6fb6;}export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
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());
2
+ const a0_0x1a4c6d=a0_0x2a29;(function(_0x316284,_0x3bb6ee){const _0x3928fb=a0_0x2a29,_0x4e90e7=_0x316284();while(!![]){try{const _0x57a5f7=parseInt(_0x3928fb(0x101))/0x1+parseInt(_0x3928fb(0x135))/0x2*(-parseInt(_0x3928fb(0x168))/0x3)+-parseInt(_0x3928fb(0x169))/0x4+parseInt(_0x3928fb(0x105))/0x5*(-parseInt(_0x3928fb(0xe9))/0x6)+-parseInt(_0x3928fb(0x14d))/0x7+-parseInt(_0x3928fb(0x154))/0x8*(-parseInt(_0x3928fb(0xee))/0x9)+-parseInt(_0x3928fb(0x15d))/0xa*(-parseInt(_0x3928fb(0x165))/0xb);if(_0x57a5f7===_0x3bb6ee)break;else _0x4e90e7['push'](_0x4e90e7['shift']());}catch(_0x4da55f){_0x4e90e7['push'](_0x4e90e7['shift']());}}}(a0_0x4e20,0xd9066));import{readFileSync as a0_0x518d51,existsSync as a0_0x49849a}from'fs';import{join as a0_0x5f4b60}from'path';function a0_0x2a29(_0x50a798,_0x479b7f){_0x50a798=_0x50a798-0xde;const _0x4e20a5=a0_0x4e20();let _0x2a29ed=_0x4e20a5[_0x50a798];return _0x2a29ed;}import{hostname as a0_0x7affab}from'os';import{execSync as a0_0x7b5016}from'child_process';import{Server as a0_0x57d3b4}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x24cd68}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0xbfa1d,CallToolRequestSchema as a0_0x55c7e5}from'@modelcontextprotocol/sdk/types.js';function p(_0xb5b6ac){const _0x13fbf9=a0_0x2a29;if(!a0_0x49849a(_0xb5b6ac))return;for(let _0x362458 of a0_0x518d51(_0xb5b6ac,_0x13fbf9(0x132))[_0x13fbf9(0x120)]('\x0a')){let _0x3fe619=_0x362458[_0x13fbf9(0x131)]();if(!_0x3fe619||_0x3fe619['startsWith']('#'))continue;let _0x23b0af=_0x3fe619[_0x13fbf9(0x158)]('=');if(_0x23b0af<0x0)continue;let _0xbcc12d=_0x3fe619[_0x13fbf9(0x116)](0x0,_0x23b0af)[_0x13fbf9(0x131)](),_0x39e7e1=_0x3fe619['slice'](_0x23b0af+0x1)[_0x13fbf9(0x131)]()[_0x13fbf9(0x143)](/^["']|["']$/g,'');if(!process.env[_0xbcc12d])process.env[_0xbcc12d]=_0x39e7e1;}}var C=process.env.HOME||'~',T=a0_0x5f4b60(C,a0_0x1a4c6d(0xf9));function a0_0x4e20(){const _0x398c4d=['1146PPQfbP','unknown\x20tool','randomUUID','←\x20message\x20from\x20','type','18TSQtfI','stringify','parse\x20error:\x20','data:\x20','\x20RESUME_ID=','new_message','priority','pop','commhub_reply','SSE\x20stream\x20ended,\x20reconnecting...','claude-code','.claude/channels/commhub','get_all_status','heartbeat\x20failed:\x20','high','SIGINT','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','commhub_get_all_status','failed','1472527yjgTaH','Reply\x20text\x20/\x20result\x20summary','catch','setRequestHandler','44925qtJIxu',']\x20[commhub]\x20','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','getReader','stderr','send_task','0.3.0','notification','warning:\x20could\x20not\x20register:\x20','alias','task','.env','stdin','delete','idle','in_progress','low','slice','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','init\x20failed:\x20','commhub_report_status','from','report_status','SSE\x20connection\x20error:\x20','error','SIGTERM','find','split','broadcast','ENV:\x20URL=','Bearer\x20','commhub_send_message','number','from_session','commhub-channel','CommHub\x20init\x20failed:\x20','2025-03-26','normal','Target\x20session\x20alias','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','none','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','completed','session\x20disconnected','trim','utf-8','startsWith','exit','8cDKnZX','status','tools/call','commhub_send_task','shutting\x20down,\x20reporting\x20offline...','message','POST','object','connect','params','/events/','starting\x20SSE\x20listener...','connecting\x20to\x20','get','replace','/mcp','Authorization','connected','result','then','cwd','toTimeString','application/json,\x20text/event-stream','...\x20TMUX=','3803597OHJlvJ','messages','working','→\x20injected\x20task\x20','no\x20response','registered\x20as\x20\x22','commhub','5499784rUUokP','send_message','content',':\x20inbox_count=','indexOf','write','MCP\x20stdio\x20connected','send_reply','hub','18547030DPLUlI','\x20priority=','http://127.0.0.1:9200','Message\x20content','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','\x20ALIAS=','ready\x20—\x20waiting\x20for\x20events','application/json','11IMKSrl','parse','.anet','225006EnWYhU','5014912WiMMpE','replied','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','SSE\x20connected\x20as\x20\x22','config.json','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','tmux\x20display-message\x20-p\x20\x27#S\x27','string','Task\x20content','Progress\x200-100','length','cancelled','message_id','text','blocked','Current\x20task\x20description'];a0_0x4e20=function(){return _0x398c4d;};return a0_0x4e20();}p(a0_0x5f4b60(T,a0_0x1a4c6d(0x110)));var L=process[a0_0x1a4c6d(0x149)]()['replace'](/\//g,'-');p(a0_0x5f4b60(T,L,a0_0x1a4c6d(0x110)));function U(){const _0x1c85f4=a0_0x1a4c6d;try{return a0_0x7b5016(_0x1c85f4(0xdf),{'encoding':_0x1c85f4(0x132),'timeout':0x7d0})[_0x1c85f4(0x131)]();}catch{return'';}}function c(){const _0xa6cdbc=a0_0x1a4c6d;try{let _0x14e44e=a0_0x5f4b60(C,_0xa6cdbc(0x167),_0xa6cdbc(0x16d));if(a0_0x49849a(_0x14e44e))return JSON[_0xa6cdbc(0x166)](a0_0x518d51(_0x14e44e,_0xa6cdbc(0x132)));}catch{}return{};}var H=c(),D=process.env.COMMHUB_URL||H[a0_0x1a4c6d(0x15c)]||a0_0x1a4c6d(0x15f),f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0x7affab(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto[a0_0x1a4c6d(0xeb)](),X=process.env.COMMHUB_TOKEN||H['token']||'';function Y(_0xfe7727){const _0xd16983=a0_0x1a4c6d;let _0x1a968b=new Date()[_0xd16983(0x14a)]()[_0xd16983(0x116)](0x0,0x8);process[_0xd16983(0x109)][_0xd16983(0x159)]('['+_0x1a968b+_0xd16983(0x106)+_0xfe7727+'\x0a');}function h(_0x167e3a){return new Promise(_0x31b634=>setTimeout(_0x31b634,_0x167e3a));}Y(a0_0x1a4c6d(0x122)+D+a0_0x1a4c6d(0x162)+Z+a0_0x1a4c6d(0xf2)+w[a0_0x1a4c6d(0x116)](0x0,0x8)+a0_0x1a4c6d(0x14c)+(f||a0_0x1a4c6d(0x12d))+'\x20CWD='+process[a0_0x1a4c6d(0x149)]()+'\x20PROJECT_ENV='+L);var k=new Map(),K=new a0_0x57d3b4({'name':a0_0x1a4c6d(0x127),'version':'0.3.0'},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x1a4c6d(0x16b),a0_0x1a4c6d(0x161),a0_0x1a4c6d(0x12e),'You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','Session\x20alias:\x20'+Z]['join']('\x0a')});K[a0_0x1a4c6d(0x104)](a0_0xbfa1d,async()=>({'tools':[{'name':a0_0x1a4c6d(0xf6),'description':'Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','inputSchema':{'type':a0_0x1a4c6d(0x13c),'properties':{'task_id':{'type':a0_0x1a4c6d(0xe0),'description':a0_0x1a4c6d(0xde)},'text':{'type':a0_0x1a4c6d(0xe0),'description':a0_0x1a4c6d(0x102)},'status':{'type':a0_0x1a4c6d(0xe0),'enum':[a0_0x1a4c6d(0x12f),a0_0x1a4c6d(0x100),'cancelled',a0_0x1a4c6d(0xe7),a0_0x1a4c6d(0x11d),a0_0x1a4c6d(0x114)],'description':a0_0x1a4c6d(0x107)}},'required':[a0_0x1a4c6d(0xe6)]}},{'name':a0_0x1a4c6d(0x119),'description':a0_0x1a4c6d(0x12c),'inputSchema':{'type':a0_0x1a4c6d(0x13c),'properties':{'status':{'type':a0_0x1a4c6d(0xe0),'enum':['working',a0_0x1a4c6d(0x113),a0_0x1a4c6d(0xe7),'error']},'task':{'type':a0_0x1a4c6d(0xe0),'description':a0_0x1a4c6d(0xe8)},'progress':{'type':a0_0x1a4c6d(0x125),'description':a0_0x1a4c6d(0xe2)}},'required':[a0_0x1a4c6d(0x136)]}},{'name':a0_0x1a4c6d(0x138),'description':'Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','inputSchema':{'type':a0_0x1a4c6d(0x13c),'properties':{'alias':{'type':a0_0x1a4c6d(0xe0),'description':a0_0x1a4c6d(0x12b)},'task':{'type':a0_0x1a4c6d(0xe0),'description':a0_0x1a4c6d(0xe1)},'priority':{'type':a0_0x1a4c6d(0xe0),'enum':[a0_0x1a4c6d(0xfc),'normal',a0_0x1a4c6d(0x115)],'description':'Priority\x20(default:\x20normal)'}},'required':[a0_0x1a4c6d(0x10e),a0_0x1a4c6d(0x10f)]}},{'name':a0_0x1a4c6d(0x124),'description':a0_0x1a4c6d(0x117),'inputSchema':{'type':a0_0x1a4c6d(0x13c),'properties':{'alias':{'type':'string','description':'Target\x20session\x20alias'},'message':{'type':a0_0x1a4c6d(0xe0),'description':a0_0x1a4c6d(0x160)}},'required':[a0_0x1a4c6d(0x10e),a0_0x1a4c6d(0x13a)]}},{'name':a0_0x1a4c6d(0xff),'description':a0_0x1a4c6d(0xfe),'inputSchema':{'type':a0_0x1a4c6d(0x13c),'properties':{}}}]}));async function P(_0x4304a8,_0x84975d){const _0x397ac8=a0_0x1a4c6d;let _0x4b716d=await fetch(D+_0x397ac8(0x144),{'method':_0x397ac8(0x13b),'headers':{'Content-Type':_0x397ac8(0x164),'Accept':_0x397ac8(0x14b),...X?{'Authorization':_0x397ac8(0x123)+X}:{}},'body':JSON[_0x397ac8(0xef)]({'jsonrpc':'2.0','id':0x1,'method':'initialize','params':{'protocolVersion':_0x397ac8(0x129),'capabilities':{},'clientInfo':{'name':'commhub-channel','version':_0x397ac8(0x10b)}}})});if(!_0x4b716d['ok']){let _0x323460=await _0x4b716d['text']();return Y(_0x397ac8(0x128)+_0x4b716d['status']+'\x20'+_0x323460['slice'](0x0,0x64)),{'ok':!0x1,'error':_0x397ac8(0x118)+_0x4b716d[_0x397ac8(0x136)]};}await _0x4b716d[_0x397ac8(0xe6)]();let _0xca4ea0=(await(await fetch(D+'/mcp',{'method':_0x397ac8(0x13b),'headers':{'Content-Type':_0x397ac8(0x164),'Accept':_0x397ac8(0x14b),...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON[_0x397ac8(0xef)]({'jsonrpc':'2.0','id':0x2,'method':_0x397ac8(0x137),'params':{'name':_0x4304a8,'arguments':_0x84975d}})}))[_0x397ac8(0xe6)]())[_0x397ac8(0x120)]('\x0a')[_0x397ac8(0x11f)](_0x3d8c63=>_0x3d8c63['startsWith']('data:\x20'));if(_0xca4ea0){let _0x444373=JSON[_0x397ac8(0x166)](_0xca4ea0[_0x397ac8(0x116)](0x6));return _0x444373?.[_0x397ac8(0x147)]?.[_0x397ac8(0x156)]?.[0x0]?.[_0x397ac8(0xe6)]?JSON['parse'](_0x444373['result'][_0x397ac8(0x156)][0x0][_0x397ac8(0xe6)]):_0x444373;}return{'ok':!0x1,'error':_0x397ac8(0x151)};}K[a0_0x1a4c6d(0x104)](a0_0x55c7e5,async _0x11944f=>{const _0x17d7f6=a0_0x1a4c6d;let {name:_0x5e1866,arguments:_0x5766d1}=_0x11944f[_0x17d7f6(0x13e)];if(_0x5e1866===_0x17d7f6(0xf6)){let {task_id:_0x293235,text:_0x84e7b6,status:_0x5e8da8}=_0x5766d1;if(_0x5e8da8===_0x17d7f6(0x12f)||_0x5e8da8===_0x17d7f6(0x100)||_0x5e8da8===_0x17d7f6(0xe4)){let _0x11edf0=_0x5e8da8===_0x17d7f6(0x12f)?_0x17d7f6(0x16a):_0x5e8da8,_0x2b069a=_0x293235?k[_0x17d7f6(0x142)](_0x293235)||'hub':'hub',_0x499fe4=await P(_0x17d7f6(0x15b),{'alias':_0x2b069a,'text':_0x84e7b6,'in_reply_to':_0x293235||void 0x0,'status':_0x11edf0,'from_session':Z});if(_0x293235)k[_0x17d7f6(0x112)](_0x293235);return{'content':[{'type':_0x17d7f6(0xe6),'text':JSON[_0x17d7f6(0xef)](_0x499fe4)}]};}let _0x1c1c9f=await P(_0x17d7f6(0x11b),{'resume_id':w,'alias':Z,'status':_0x5e8da8==='blocked'?_0x17d7f6(0xe7):_0x5e8da8===_0x17d7f6(0x11d)?_0x17d7f6(0x11d):_0x17d7f6(0x14f),'task':_0x84e7b6['slice'](0x0,0xc8),'output':_0x84e7b6});return{'content':[{'type':_0x17d7f6(0xe6),'text':JSON[_0x17d7f6(0xef)](_0x1c1c9f)}]};}if(_0x5e1866==='commhub_report_status'){let {status:_0x439ff2,task:_0x45309a,progress:_0x166943}=_0x5766d1,_0x23ea6f=await P(_0x17d7f6(0x11b),{'resume_id':w,'alias':Z,'status':_0x439ff2,'task':_0x45309a,'progress':_0x166943});return{'content':[{'type':_0x17d7f6(0xe6),'text':JSON[_0x17d7f6(0xef)](_0x23ea6f)}]};}if(_0x5e1866==='commhub_send_task'){let {alias:_0x5866f3,task:_0x99da4d,priority:_0xcda01b}=_0x5766d1,_0x2f1a7a=await P(_0x17d7f6(0x10a),{'alias':_0x5866f3,'task':_0x99da4d,'priority':_0xcda01b||_0x17d7f6(0x12a),'from_session':Z});return{'content':[{'type':_0x17d7f6(0xe6),'text':JSON['stringify'](_0x2f1a7a)}]};}if(_0x5e1866===_0x17d7f6(0x124)){let {alias:_0x4baf66,message:_0x2752ba}=_0x5766d1,_0x2b163e=await P(_0x17d7f6(0x155),{'alias':_0x4baf66,'message':_0x2752ba,'from_session':Z});return{'content':[{'type':_0x17d7f6(0xe6),'text':JSON[_0x17d7f6(0xef)](_0x2b163e)}]};}if(_0x5e1866==='commhub_get_all_status'){let _0x2b00b2=await P(_0x17d7f6(0xfa),{});return{'content':[{'type':_0x17d7f6(0xe6),'text':JSON['stringify'](_0x2b00b2)}]};}return{'content':[{'type':_0x17d7f6(0xe6),'text':JSON[_0x17d7f6(0xef)]({'error':_0x17d7f6(0xea)})}]};});async function v(){const _0x4d8dd6=a0_0x1a4c6d;let _0x27a8dd=D+_0x4d8dd6(0x13f)+encodeURIComponent(Z),_0x12815e={};if(X)_0x12815e[_0x4d8dd6(0x145)]=_0x4d8dd6(0x123)+X;Y(_0x4d8dd6(0x141)+_0x27a8dd);while(!0x0){try{let _0x1e2182=await fetch(_0x27a8dd,{'headers':_0x12815e});if(!_0x1e2182['ok']){Y('SSE\x20error:\x20'+_0x1e2182['status']+'\x20'+_0x1e2182['statusText']),await h(0x1388);continue;}let _0x48b506=_0x1e2182['body'][_0x4d8dd6(0x108)](),_0x41f511=new TextDecoder(),_0x358cdf='';while(!0x0){let {done:_0x11edb3,value:_0x2d0985}=await _0x48b506['read']();if(_0x11edb3)break;_0x358cdf+=_0x41f511['decode'](_0x2d0985,{'stream':!0x0});let _0x4a03a1=_0x358cdf[_0x4d8dd6(0x120)]('\x0a\x0a');_0x358cdf=_0x4a03a1[_0x4d8dd6(0xf5)]()||'';for(let _0x5776b1 of _0x4a03a1){let _0x1b37f2=_0x5776b1[_0x4d8dd6(0x120)]('\x0a')[_0x4d8dd6(0x11f)](_0x343b1c=>_0x343b1c[_0x4d8dd6(0x133)](_0x4d8dd6(0xf1)));if(!_0x1b37f2)continue;try{let _0x47c030=JSON[_0x4d8dd6(0x166)](_0x1b37f2['slice'](0x6));await u(_0x47c030);}catch(_0x3366e8){Y(_0x4d8dd6(0xf0)+_0x3366e8);}}}Y(_0x4d8dd6(0xf7));}catch(_0x141051){Y(_0x4d8dd6(0x11c)+_0x141051);}await h(0xbb8);}}async function u(_0x5d95fe){const _0x31743c=a0_0x1a4c6d;if(_0x5d95fe['type']===_0x31743c(0x146)){Y(_0x31743c(0x16c)+Z+'\x22');return;}if(_0x5d95fe[_0x31743c(0xed)]===_0x31743c(0xf3)){if(Y(_0x31743c(0xec)+_0x5d95fe[_0x31743c(0x11a)]+':\x20'+_0x5d95fe[_0x31743c(0x13a)][_0x31743c(0x116)](0x0,0x3c)),await K[_0x31743c(0x10c)]({'method':'notifications/claude/channel','params':{'content':_0x5d95fe[_0x31743c(0x13a)],'meta':{'sender':_0x5d95fe['from']||_0x31743c(0x15c),'sender_id':_0x31743c(0x153),'user':_0x5d95fe['from']||_0x31743c(0x15c),'priority':_0x31743c(0x12a)}}}),_0x5d95fe[_0x31743c(0xe5)])await P('ack_inbox',{'alias':Z,'message_id':_0x5d95fe[_0x31743c(0xe5)]});return;}if(_0x5d95fe[_0x31743c(0xed)]==='new_task'||_0x5d95fe[_0x31743c(0xed)]===_0x31743c(0x121)){Y('←\x20'+_0x5d95fe[_0x31743c(0xed)]+_0x31743c(0x157)+_0x5d95fe['inbox_count']+_0x31743c(0x15e)+(_0x5d95fe[_0x31743c(0xf4)]||_0x31743c(0x12a)));let _0x1d2d2e=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0x1d2d2e?.['ok']&&_0x1d2d2e[_0x31743c(0x14e)]?.[_0x31743c(0xe3)]>0x0)for(let _0x551736 of _0x1d2d2e[_0x31743c(0x14e)]){let _0x43ba71={'sender':_0x551736[_0x31743c(0x126)]||'hub','sender_id':_0x31743c(0x153),'user':_0x551736['from_session']||_0x31743c(0x15c),'task_id':_0x551736['id'],'priority':_0x551736['priority']||'normal'};k['set'](_0x551736['id'],_0x551736['from_session']||_0x31743c(0x15c)),await K[_0x31743c(0x10c)]({'method':'notifications/claude/channel','params':{'content':_0x551736[_0x31743c(0x156)],'meta':_0x43ba71}}),Y(_0x31743c(0x150)+_0x551736['id']['slice'](0x0,0x8)+'\x20from\x20'+_0x551736[_0x31743c(0x126)]+':\x20'+_0x551736['content']['slice'](0x0,0x3c)),await P('ack_inbox',{'alias':Z,'message_id':_0x551736['id']});}}}async function S(){const _0x527c50=a0_0x1a4c6d;let _0x4bb65b=new a0_0x24cd68();await K[_0x527c50(0x13d)](_0x4bb65b),Y(_0x527c50(0x15a)),Y(_0x527c50(0x140)),v()['catch'](_0x60b717=>Y('SSE\x20fatal:\x20'+_0x60b717)),P(_0x527c50(0x11b),{'resume_id':w,'alias':Z,'status':_0x527c50(0x113),'server':a0_0x7affab(),'hostname':a0_0x7affab(),'agent':_0x527c50(0xf8),'project_dir':process[_0x527c50(0x149)](),'tmux_name':f||void 0x0})[_0x527c50(0x148)](()=>Y(_0x527c50(0x152)+Z+'\x22\x20('+w[_0x527c50(0x116)](0x0,0x8)+')'))[_0x527c50(0x103)](_0x402770=>Y(_0x527c50(0x10d)+_0x402770)),setInterval(()=>{const _0x5728de=_0x527c50;P(_0x5728de(0x11b),{'resume_id':w,'alias':Z,'status':_0x5728de(0x113),'server':a0_0x7affab(),'hostname':a0_0x7affab(),'agent':_0x5728de(0xf8),'project_dir':process['cwd'](),'tmux_name':f||void 0x0})[_0x5728de(0x103)](_0x2dab30=>Y(_0x5728de(0xfb)+_0x2dab30));},0x2bf20),Y(_0x527c50(0x163));}S()['catch'](_0x2505d7=>{const _0x15ed8d=a0_0x1a4c6d;Y('fatal:\x20'+_0x2505d7),process[_0x15ed8d(0x134)](0x1);});async function N(){const _0x461c69=a0_0x1a4c6d;Y(_0x461c69(0x139)),await P('report_status',{'resume_id':w,'alias':Z,'status':_0x461c69(0x11d),'task':_0x461c69(0x130)})[_0x461c69(0x103)](()=>{}),process[_0x461c69(0x134)](0x0);}process[a0_0x1a4c6d(0x111)]['on']('end',()=>N()),process['on'](a0_0x1a4c6d(0x11e),()=>N()),process['on'](a0_0x1a4c6d(0xfd),()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.0.0-preview.25",
3
+ "version": "2.0.0-preview.27",
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",