@sleep2agi/agent-network 2.1.15-preview.3 → 2.1.15-preview.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- const a0_0x1f9b62=a0_0x50c3;(function(_0x247e8b,_0x424e00){const _0x580d08=a0_0x50c3,_0x2a7053=_0x247e8b();while(!![]){try{const _0xedea8=parseInt(_0x580d08(0x169))/0x1*(parseInt(_0x580d08(0x162))/0x2)+-parseInt(_0x580d08(0x161))/0x3+parseInt(_0x580d08(0x183))/0x4*(parseInt(_0x580d08(0x163))/0x5)+parseInt(_0x580d08(0x156))/0x6+-parseInt(_0x580d08(0x165))/0x7+parseInt(_0x580d08(0x189))/0x8+-parseInt(_0x580d08(0x15a))/0x9;if(_0xedea8===_0x424e00)break;else _0x2a7053['push'](_0x2a7053['shift']());}catch(_0x12fff5){_0x2a7053['push'](_0x2a7053['shift']());}}}(a0_0x3f0e,0xccd98));import{EventEmitter as a0_0x5e539f}from'events';function a0_0x3f0e(){const _0x4fa657=['parse','alias','call','abort',']\x20[commhub:','2.0','SSE\x20reconnecting\x20in\x20','min','application/json,\x20text/event-stream','from_session','now','registered','4tCgLoT','match','disconnected','split','pop','/mcp','1077408NNgxUO','emit','sseAbort','messages','heartbeatTimer','running','SSE\x20failed:\x20','stringify','inbox\x20error:\x20','getReader','normal','autoConnect','reconnectDelay','data:\x20','token','getAllStatus','send_task','url','disconnect','reply','offline','report_status','catch','message','resumeId','heartbeat\x20failed:\x20','connected','replace','get_inbox','heartbeatInterval','ack_inbox','send','processInbox','type','read','idle','content','5638950IjOrwq','slice','agent','Bearer\x20','5654151narrMl','Authorization','name','sleep','result','status','toString','139143GkxbFG','2cRWXNa','1068505UlXKpz','new_message','3576524uZHTGF','new_task','startsWith','/events/','736414sOTgBz','connectSSE','text','broadcast','task','body','log','POST','decode','send_message','signal','SSE\x20connected','SSE\x20error:\x20','send_reply'];a0_0x3f0e=function(){return _0x4fa657;};return a0_0x3f0e();}import{hostname as a0_0x3a9c80}from'os';class T extends a0_0x5e539f{[a0_0x1f9b62(0x142)];['alias'];[a0_0x1f9b62(0x13f)];[a0_0x1f9b62(0x158)];['resumeId'];[a0_0x1f9b62(0x14e)];[a0_0x1f9b62(0x195)];[a0_0x1f9b62(0x18d)];[a0_0x1f9b62(0x18b)];[a0_0x1f9b62(0x18e)]=!0x1;constructor(_0x2d969e){const _0x52695c=a0_0x1f9b62;super();if(this[_0x52695c(0x142)]=_0x2d969e[_0x52695c(0x142)][_0x52695c(0x14c)](/\/$/,''),this[_0x52695c(0x178)]=_0x2d969e[_0x52695c(0x178)],this[_0x52695c(0x13f)]=_0x2d969e[_0x52695c(0x13f)],this[_0x52695c(0x158)]=_0x2d969e[_0x52695c(0x158)]||'sdk',this[_0x52695c(0x149)]='sdk-'+_0x2d969e[_0x52695c(0x178)]+'-'+Date['now']()[_0x52695c(0x160)](0x24),this['heartbeatInterval']=_0x2d969e['heartbeatInterval']??0x2bf20,this[_0x52695c(0x195)]=_0x2d969e[_0x52695c(0x195)]??0xbb8,_0x2d969e[_0x52695c(0x194)]!==!0x1)this['connect']();}[a0_0x1f9b62(0x16f)](_0x4f6aa1){const _0x11bcc3=a0_0x1f9b62;console[_0x11bcc3(0x16f)]('['+new Date()['toTimeString']()['slice'](0x0,0x8)+_0x11bcc3(0x17b)+this['alias']+']\x20'+_0x4f6aa1);}async[a0_0x1f9b62(0x179)](_0x1cbc59,_0x5c89e8){const _0x2f509b=a0_0x1f9b62;let _0x529faa={'Content-Type':'application/json','Accept':_0x2f509b(0x17f)};if(this['token'])_0x529faa[_0x2f509b(0x15b)]=_0x2f509b(0x159)+this[_0x2f509b(0x13f)];let _0x44ce1c=await(await fetch(this[_0x2f509b(0x142)]+_0x2f509b(0x188),{'method':_0x2f509b(0x170),'headers':_0x529faa,'body':JSON[_0x2f509b(0x190)]({'jsonrpc':_0x2f509b(0x17c),'id':Date[_0x2f509b(0x181)](),'method':'tools/call','params':{'name':_0x1cbc59,'arguments':_0x5c89e8}})}))['text'](),_0x415853=_0x44ce1c[_0x2f509b(0x184)](/data: (.+)/),_0x5ab620=_0x415853?JSON['parse'](_0x415853[0x1]):JSON[_0x2f509b(0x177)](_0x44ce1c),_0x21677f=_0x5ab620?.[_0x2f509b(0x15e)]?.[_0x2f509b(0x155)]?.[0x0]?.[_0x2f509b(0x16b)];return _0x21677f?JSON['parse'](_0x21677f):_0x5ab620;}async['connect'](){const _0x1db8b9=a0_0x1f9b62;if(this[_0x1db8b9(0x18e)])return;this[_0x1db8b9(0x18e)]=!0x0,await this['status'](_0x1db8b9(0x154)),this[_0x1db8b9(0x16f)](_0x1db8b9(0x182)),this[_0x1db8b9(0x18d)]=setInterval(()=>{const _0x121bf9=_0x1db8b9;this['status'](_0x121bf9(0x154))['catch'](_0xa86c2a=>this[_0x121bf9(0x16f)](_0x121bf9(0x14a)+_0xa86c2a[_0x121bf9(0x148)]));},this[_0x1db8b9(0x14e)]),this[_0x1db8b9(0x16a)]();}async[a0_0x1f9b62(0x143)](){const _0x58770e=a0_0x1f9b62;if(this[_0x58770e(0x18e)]=!0x1,this[_0x58770e(0x18b)]?.[_0x58770e(0x17a)](),this[_0x58770e(0x18d)])clearInterval(this[_0x58770e(0x18d)]);await this[_0x58770e(0x15f)](_0x58770e(0x145))[_0x58770e(0x147)](()=>{}),this[_0x58770e(0x16f)]('disconnected');}async[a0_0x1f9b62(0x150)](_0x337d1c,_0x46aa67,_0x1613a0=a0_0x1f9b62(0x193)){const _0x4748a8=a0_0x1f9b62;return this[_0x4748a8(0x179)](_0x4748a8(0x141),{'alias':_0x337d1c,'task':_0x46aa67,'priority':_0x1613a0,'from_session':this[_0x4748a8(0x178)]});}async[a0_0x1f9b62(0x148)](_0x55ba13,_0x46e712){const _0x505d06=a0_0x1f9b62;return this[_0x505d06(0x179)](_0x505d06(0x172),{'alias':_0x55ba13,'message':_0x46e712,'from_session':this[_0x505d06(0x178)]});}async[a0_0x1f9b62(0x144)](_0x1fe995,_0x3a18b0,_0x73e3e2='completed'){const _0x1f729a=a0_0x1f9b62;return this[_0x1f729a(0x179)](_0x1f729a(0x176),{'in_reply_to':_0x1fe995,'text':_0x3a18b0,'status':_0x73e3e2});}async[a0_0x1f9b62(0x15f)](_0x51f71a,_0x4cdefb){const _0x1724de=a0_0x1f9b62;return this[_0x1724de(0x179)](_0x1724de(0x146),{'resume_id':this[_0x1724de(0x149)],'alias':this[_0x1724de(0x178)],'status':_0x51f71a,'server':a0_0x3a9c80(),'hostname':a0_0x3a9c80(),'agent':this['agent'],'project_dir':process['cwd'](),..._0x4cdefb});}async[a0_0x1f9b62(0x140)](){const _0xc4ff23=a0_0x1f9b62;return this[_0xc4ff23(0x179)]('get_all_status',{});}async['broadcast'](_0x21eade,_0x4d3bbc){const _0x902c97=a0_0x1f9b62;return this[_0x902c97(0x179)]('broadcast',{'message':_0x21eade,'filter_server':_0x4d3bbc?.['server'],'filter_status':_0x4d3bbc?.[_0x902c97(0x15f)]});}async['connectSSE'](){const _0x2379c7=a0_0x1f9b62;let _0x4af5f5=encodeURIComponent(this[_0x2379c7(0x178)]),_0xbe8937=this['url']+_0x2379c7(0x168)+_0x4af5f5,_0x208af2=this[_0x2379c7(0x195)];while(this[_0x2379c7(0x18e)]){try{this['sseAbort']=new AbortController();let _0x255751={'Accept':'text/event-stream'};if(this[_0x2379c7(0x13f)])_0x255751['Authorization']='Bearer\x20'+this[_0x2379c7(0x13f)];let _0x3f0ed1=await fetch(_0xbe8937,{'headers':_0x255751,'signal':this[_0x2379c7(0x18b)][_0x2379c7(0x173)]});if(!_0x3f0ed1['ok']||!_0x3f0ed1[_0x2379c7(0x16e)]){this[_0x2379c7(0x16f)](_0x2379c7(0x18f)+_0x3f0ed1[_0x2379c7(0x15f)]),await this['sleep'](_0x208af2),_0x208af2=Math[_0x2379c7(0x17e)](_0x208af2*1.5,0xea60);continue;}_0x208af2=this[_0x2379c7(0x195)];let _0x459861=_0x3f0ed1[_0x2379c7(0x16e)][_0x2379c7(0x192)](),_0x354e23=new TextDecoder(),_0x3ff66f='';while(this[_0x2379c7(0x18e)]){let {done:_0xf203ac,value:_0x5b2847}=await _0x459861[_0x2379c7(0x153)]();if(_0xf203ac)break;_0x3ff66f+=_0x354e23[_0x2379c7(0x171)](_0x5b2847,{'stream':!0x0});let _0x13da12=_0x3ff66f[_0x2379c7(0x186)]('\x0a');_0x3ff66f=_0x13da12[_0x2379c7(0x187)]()||'';for(let _0x41b9d5 of _0x13da12){if(!_0x41b9d5[_0x2379c7(0x167)](_0x2379c7(0x13e)))continue;try{let _0x455d9f=JSON[_0x2379c7(0x177)](_0x41b9d5[_0x2379c7(0x157)](0x6));if(_0x455d9f[_0x2379c7(0x152)]===_0x2379c7(0x14b)){this[_0x2379c7(0x16f)](_0x2379c7(0x174)),this[_0x2379c7(0x18a)](_0x2379c7(0x14b));continue;}if(_0x455d9f['type']===_0x2379c7(0x166)||_0x455d9f[_0x2379c7(0x152)]===_0x2379c7(0x164)||_0x455d9f[_0x2379c7(0x152)]===_0x2379c7(0x16c))await this[_0x2379c7(0x151)]();}catch{}}}}catch(_0x3a6be3){if(_0x3a6be3[_0x2379c7(0x15c)]==='AbortError')break;this[_0x2379c7(0x18a)]('error',_0x3a6be3),this[_0x2379c7(0x16f)](_0x2379c7(0x175)+_0x3a6be3[_0x2379c7(0x148)]);}if(this[_0x2379c7(0x18e)])this[_0x2379c7(0x18a)](_0x2379c7(0x185)),this[_0x2379c7(0x16f)](_0x2379c7(0x17d)+_0x208af2/0x3e8+'s...'),await this[_0x2379c7(0x15d)](_0x208af2),_0x208af2=Math['min'](_0x208af2*1.5,0xea60);}}async[a0_0x1f9b62(0x151)](){const _0x4705cb=a0_0x1f9b62;try{let _0x53b4b9=(await this[_0x4705cb(0x179)](_0x4705cb(0x14d),{'alias':this['alias'],'limit':0xa}))?.[_0x4705cb(0x18c)]||[];for(let _0x35fe58 of _0x53b4b9)await this[_0x4705cb(0x179)](_0x4705cb(0x14f),{'alias':this[_0x4705cb(0x178)],'message_id':_0x35fe58['id']}),this[_0x4705cb(0x16f)]('←\x20'+_0x35fe58[_0x4705cb(0x180)]+':\x20'+_0x35fe58['content']['slice'](0x0,0x3c)),this['emit'](_0x4705cb(0x16d),_0x35fe58),this[_0x4705cb(0x18a)](_0x4705cb(0x148),_0x35fe58);}catch(_0x317bb7){this[_0x4705cb(0x16f)](_0x4705cb(0x191)+_0x317bb7[_0x4705cb(0x148)]);}}['sleep'](_0x4fe913){return new Promise(_0x3d5c1d=>setTimeout(_0x3d5c1d,_0x4fe913));}}var $=T;function a0_0x50c3(_0x589c6c,_0x4482c0){_0x589c6c=_0x589c6c-0x13e;const _0x3f0e01=a0_0x3f0e();let _0x50c337=_0x3f0e01[_0x589c6c];return _0x50c337;}export{$ as default,T as CommHub};
1
+ const a0_0x42ceb7=a0_0x22b2;(function(_0x231dc3,_0x20f5c9){const _0x246db5=a0_0x22b2,_0x1f4c36=_0x231dc3();while(!![]){try{const _0x2cf942=-parseInt(_0x246db5(0x185))/0x1*(parseInt(_0x246db5(0x1c5))/0x2)+parseInt(_0x246db5(0x17a))/0x3*(-parseInt(_0x246db5(0x1b1))/0x4)+parseInt(_0x246db5(0x1b6))/0x5*(-parseInt(_0x246db5(0x180))/0x6)+-parseInt(_0x246db5(0x19b))/0x7+parseInt(_0x246db5(0x19e))/0x8+-parseInt(_0x246db5(0x1c0))/0x9+parseInt(_0x246db5(0x1a5))/0xa;if(_0x2cf942===_0x20f5c9)break;else _0x1f4c36['push'](_0x1f4c36['shift']());}catch(_0x3d9e5d){_0x1f4c36['push'](_0x1f4c36['shift']());}}}(a0_0x1da9,0x4d9d1));import{EventEmitter as a0_0x4a3ab9}from'events';function a0_0x1da9(){const _0x45ebd1=['content','35335Ankuey','parse','resumeId','type','disconnected','inbox\x20error:\x20','emit','text','call','sleep','5652891pevvrv','POST','broadcast','replace','/events/','398088iHZBWi','report_status','send_task','get_all_status','SSE\x20connected','sseAbort','split','connect','125889XLGVEv','now','alias','message','cwd','AbortError','18QHOsKT','getAllStatus','match','reconnectDelay','tools/call','1nZhUBN','status','SSE\x20error:\x20','abort','url','toString','idle','new_message','disconnect','reply','toTimeString','autoConnect','Authorization','processInbox','send','stringify','read','catch','error','min','signal','heartbeatInterval','107156bYLSZJ','pop','startsWith','2331136NnERcP','from_session','token','slice','application/json','connected','send_message','10999800ldhmBn','decode','name','Bearer\x20','log','SSE\x20reconnecting\x20in\x20','body','running','/mcp','normal','heartbeatTimer','agent','20tsIEVm','connectSSE','new_task','s...'];a0_0x1da9=function(){return _0x45ebd1;};return a0_0x1da9();}import{hostname as a0_0x3a0736}from'os';function a0_0x22b2(_0x1d1adc,_0x2a3581){_0x1d1adc=_0x1d1adc-0x177;const _0x1da997=a0_0x1da9();let _0x22b261=_0x1da997[_0x1d1adc];return _0x22b261;}class T extends a0_0x4a3ab9{['url'];['alias'];['token'];[a0_0x42ceb7(0x1b0)];[a0_0x42ceb7(0x1b8)];[a0_0x42ceb7(0x19a)];[a0_0x42ceb7(0x183)];['heartbeatTimer'];[a0_0x42ceb7(0x177)];[a0_0x42ceb7(0x1ac)]=!0x1;constructor(_0x320d11){const _0xea2281=a0_0x42ceb7;super();if(this[_0xea2281(0x189)]=_0x320d11[_0xea2281(0x189)][_0xea2281(0x1c3)](/\/$/,''),this[_0xea2281(0x17c)]=_0x320d11[_0xea2281(0x17c)],this[_0xea2281(0x1a0)]=_0x320d11[_0xea2281(0x1a0)],this[_0xea2281(0x1b0)]=_0x320d11[_0xea2281(0x1b0)]||'sdk',this[_0xea2281(0x1b8)]='sdk-'+_0x320d11[_0xea2281(0x17c)]+'-'+Date[_0xea2281(0x17b)]()[_0xea2281(0x18a)](0x24),this[_0xea2281(0x19a)]=_0x320d11['heartbeatInterval']??0x2bf20,this[_0xea2281(0x183)]=_0x320d11[_0xea2281(0x183)]??0xbb8,_0x320d11[_0xea2281(0x190)]!==!0x1)this[_0xea2281(0x179)]();}[a0_0x42ceb7(0x1a9)](_0x7dfda){const _0x105d27=a0_0x42ceb7;console['log']('['+new Date()[_0x105d27(0x18f)]()[_0x105d27(0x1a1)](0x0,0x8)+']\x20[commhub:'+this['alias']+']\x20'+_0x7dfda);}async[a0_0x42ceb7(0x1be)](_0x4bda26,_0x2e2069){const _0x466047=a0_0x42ceb7;let _0x1712fe={'Content-Type':_0x466047(0x1a2),'Accept':'application/json,\x20text/event-stream'};if(this[_0x466047(0x1a0)])_0x1712fe[_0x466047(0x191)]=_0x466047(0x1a8)+this['token'];let _0x1d2de6=await(await fetch(this[_0x466047(0x189)]+_0x466047(0x1ad),{'method':_0x466047(0x1c1),'headers':_0x1712fe,'body':JSON[_0x466047(0x194)]({'jsonrpc':'2.0','id':Date[_0x466047(0x17b)](),'method':_0x466047(0x184),'params':{'name':_0x4bda26,'arguments':_0x2e2069}})}))[_0x466047(0x1bd)](),_0x44a223=_0x1d2de6[_0x466047(0x182)](/data: (.+)/),_0x4600cf=_0x44a223?JSON[_0x466047(0x1b7)](_0x44a223[0x1]):JSON[_0x466047(0x1b7)](_0x1d2de6),_0x388ecd=_0x4600cf?.['result']?.[_0x466047(0x1b5)]?.[0x0]?.['text'];return _0x388ecd?JSON[_0x466047(0x1b7)](_0x388ecd):_0x4600cf;}async['connect'](){const _0x1474a2=a0_0x42ceb7;if(this[_0x1474a2(0x1ac)])return;this[_0x1474a2(0x1ac)]=!0x0,await this[_0x1474a2(0x186)](_0x1474a2(0x18b)),this[_0x1474a2(0x1a9)]('registered'),this['heartbeatTimer']=setInterval(()=>{const _0x226a80=_0x1474a2;this[_0x226a80(0x186)](_0x226a80(0x18b))[_0x226a80(0x196)](_0xc9e1cc=>this[_0x226a80(0x1a9)]('heartbeat\x20failed:\x20'+_0xc9e1cc['message']));},this['heartbeatInterval']),this[_0x1474a2(0x1b2)]();}async[a0_0x42ceb7(0x18d)](){const _0x494e77=a0_0x42ceb7;if(this[_0x494e77(0x1ac)]=!0x1,this[_0x494e77(0x177)]?.[_0x494e77(0x188)](),this[_0x494e77(0x1af)])clearInterval(this[_0x494e77(0x1af)]);await this[_0x494e77(0x186)]('offline')[_0x494e77(0x196)](()=>{}),this[_0x494e77(0x1a9)](_0x494e77(0x1ba));}async[a0_0x42ceb7(0x193)](_0x229d65,_0x4e8bc0,_0x313dd0=a0_0x42ceb7(0x1ae)){const _0x7c51f4=a0_0x42ceb7;return this[_0x7c51f4(0x1be)](_0x7c51f4(0x1c7),{'alias':_0x229d65,'task':_0x4e8bc0,'priority':_0x313dd0,'from_session':this[_0x7c51f4(0x17c)]});}async[a0_0x42ceb7(0x17d)](_0x308504,_0x1c60c3){const _0x5d5f73=a0_0x42ceb7;return this[_0x5d5f73(0x1be)](_0x5d5f73(0x1a4),{'alias':_0x308504,'message':_0x1c60c3,'from_session':this[_0x5d5f73(0x17c)]});}async[a0_0x42ceb7(0x18e)](_0x3ece2f,_0x2e0441,_0x1287ed='completed'){const _0xfbb1f=a0_0x42ceb7;return this[_0xfbb1f(0x1be)]('send_reply',{'in_reply_to':_0x3ece2f,'text':_0x2e0441,'status':_0x1287ed});}async[a0_0x42ceb7(0x186)](_0x8d4bd4,_0x34f741){const _0x5c37ba=a0_0x42ceb7;return this[_0x5c37ba(0x1be)](_0x5c37ba(0x1c6),{'resume_id':this['resumeId'],'alias':this[_0x5c37ba(0x17c)],'status':_0x8d4bd4,'server':a0_0x3a0736(),'hostname':a0_0x3a0736(),'agent':this[_0x5c37ba(0x1b0)],'project_dir':process[_0x5c37ba(0x17e)](),..._0x34f741});}async[a0_0x42ceb7(0x181)](){const _0x1972a5=a0_0x42ceb7;return this['call'](_0x1972a5(0x1c8),{});}async[a0_0x42ceb7(0x1c2)](_0x36d08a,_0x527f10){const _0x53b278=a0_0x42ceb7;return this[_0x53b278(0x1be)](_0x53b278(0x1c2),{'message':_0x36d08a,'filter_server':_0x527f10?.['server'],'filter_status':_0x527f10?.[_0x53b278(0x186)]});}async[a0_0x42ceb7(0x1b2)](){const _0x3c8cf2=a0_0x42ceb7;let _0x5f530e=encodeURIComponent(this[_0x3c8cf2(0x17c)]),_0x39fae8=this['url']+_0x3c8cf2(0x1c4)+_0x5f530e,_0x59a286=this[_0x3c8cf2(0x183)];while(this[_0x3c8cf2(0x1ac)]){try{this[_0x3c8cf2(0x177)]=new AbortController();let _0x3d2122={'Accept':'text/event-stream'};if(this['token'])_0x3d2122[_0x3c8cf2(0x191)]=_0x3c8cf2(0x1a8)+this[_0x3c8cf2(0x1a0)];let _0x25ac9a=await fetch(_0x39fae8,{'headers':_0x3d2122,'signal':this[_0x3c8cf2(0x177)][_0x3c8cf2(0x199)]});if(!_0x25ac9a['ok']||!_0x25ac9a[_0x3c8cf2(0x1ab)]){this[_0x3c8cf2(0x1a9)]('SSE\x20failed:\x20'+_0x25ac9a[_0x3c8cf2(0x186)]),await this[_0x3c8cf2(0x1bf)](_0x59a286),_0x59a286=Math[_0x3c8cf2(0x198)](_0x59a286*1.5,0xea60);continue;}_0x59a286=this[_0x3c8cf2(0x183)];let _0x148c2c=_0x25ac9a[_0x3c8cf2(0x1ab)]['getReader'](),_0x43c84a=new TextDecoder(),_0x1988ac='';while(this[_0x3c8cf2(0x1ac)]){let {done:_0x27e184,value:_0x4d6670}=await _0x148c2c[_0x3c8cf2(0x195)]();if(_0x27e184)break;_0x1988ac+=_0x43c84a[_0x3c8cf2(0x1a6)](_0x4d6670,{'stream':!0x0});let _0x16da07=_0x1988ac[_0x3c8cf2(0x178)]('\x0a');_0x1988ac=_0x16da07[_0x3c8cf2(0x19c)]()||'';for(let _0x20b123 of _0x16da07){if(!_0x20b123[_0x3c8cf2(0x19d)]('data:\x20'))continue;try{let _0x21c658=JSON[_0x3c8cf2(0x1b7)](_0x20b123[_0x3c8cf2(0x1a1)](0x6));if(_0x21c658[_0x3c8cf2(0x1b9)]===_0x3c8cf2(0x1a3)){this[_0x3c8cf2(0x1a9)](_0x3c8cf2(0x1c9)),this[_0x3c8cf2(0x1bc)]('connected');continue;}if(_0x21c658[_0x3c8cf2(0x1b9)]===_0x3c8cf2(0x1b3)||_0x21c658[_0x3c8cf2(0x1b9)]===_0x3c8cf2(0x18c)||_0x21c658[_0x3c8cf2(0x1b9)]===_0x3c8cf2(0x1c2))await this[_0x3c8cf2(0x192)]();}catch{}}}}catch(_0xde81ab){if(_0xde81ab[_0x3c8cf2(0x1a7)]===_0x3c8cf2(0x17f))break;this[_0x3c8cf2(0x1bc)](_0x3c8cf2(0x197),_0xde81ab),this[_0x3c8cf2(0x1a9)](_0x3c8cf2(0x187)+_0xde81ab[_0x3c8cf2(0x17d)]);}if(this[_0x3c8cf2(0x1ac)])this[_0x3c8cf2(0x1bc)](_0x3c8cf2(0x1ba)),this[_0x3c8cf2(0x1a9)](_0x3c8cf2(0x1aa)+_0x59a286/0x3e8+_0x3c8cf2(0x1b4)),await this[_0x3c8cf2(0x1bf)](_0x59a286),_0x59a286=Math[_0x3c8cf2(0x198)](_0x59a286*1.5,0xea60);}}async[a0_0x42ceb7(0x192)](){const _0x3f5073=a0_0x42ceb7;try{let _0x529162=(await this[_0x3f5073(0x1be)]('get_inbox',{'alias':this[_0x3f5073(0x17c)],'limit':0xa}))?.['messages']||[];for(let _0x69d72f of _0x529162)await this[_0x3f5073(0x1be)]('ack_inbox',{'alias':this[_0x3f5073(0x17c)],'message_id':_0x69d72f['id']}),this[_0x3f5073(0x1a9)]('←\x20'+_0x69d72f[_0x3f5073(0x19f)]+':\x20'+_0x69d72f[_0x3f5073(0x1b5)]['slice'](0x0,0x3c)),this['emit']('task',_0x69d72f),this[_0x3f5073(0x1bc)](_0x3f5073(0x17d),_0x69d72f);}catch(_0x62fe58){this[_0x3f5073(0x1a9)](_0x3f5073(0x1bb)+_0x62fe58[_0x3f5073(0x17d)]);}}[a0_0x42ceb7(0x1bf)](_0x2cdfa0){return new Promise(_0x31e1d7=>setTimeout(_0x31e1d7,_0x2cdfa0));}}var $=T;export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x4f791c=a0_0x45ae;(function(_0x197b97,_0x32bb17){const _0x2b53ed=a0_0x45ae,_0x1c8c7b=_0x197b97();while(!![]){try{const _0x1b11fa=-parseInt(_0x2b53ed(0x244))/0x1*(parseInt(_0x2b53ed(0x272))/0x2)+parseInt(_0x2b53ed(0x220))/0x3+-parseInt(_0x2b53ed(0x25c))/0x4*(-parseInt(_0x2b53ed(0x24f))/0x5)+parseInt(_0x2b53ed(0x207))/0x6*(parseInt(_0x2b53ed(0x22a))/0x7)+-parseInt(_0x2b53ed(0x209))/0x8*(-parseInt(_0x2b53ed(0x239))/0x9)+parseInt(_0x2b53ed(0x236))/0xa+parseInt(_0x2b53ed(0x267))/0xb*(-parseInt(_0x2b53ed(0x22f))/0xc);if(_0x1b11fa===_0x32bb17)break;else _0x1c8c7b['push'](_0x1c8c7b['shift']());}catch(_0x20b875){_0x1c8c7b['push'](_0x1c8c7b['shift']());}}}(a0_0x5741,0x3d9e2));import{readFileSync as a0_0x168a55,existsSync as a0_0x3388c3}from'fs';import{randomUUID as a0_0x3cfa37}from'crypto';import{join as a0_0x9d2fc2}from'path';import{hostname as a0_0x3e041f}from'os';import{execSync as a0_0x3dc4eb}from'child_process';import{Server as a0_0x4fcfb0}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x100966}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x5dc3d1,CallToolRequestSchema as a0_0x544a38}from'@modelcontextprotocol/sdk/types.js';function p(_0x4c2e9b){const _0x3474b7=a0_0x45ae;if(!a0_0x3388c3(_0x4c2e9b))return;for(let _0x581673 of a0_0x168a55(_0x4c2e9b,_0x3474b7(0x219))[_0x3474b7(0x1fa)]('\x0a')){let _0x5b4106=_0x581673['trim']();if(!_0x5b4106||_0x5b4106[_0x3474b7(0x1f5)]('#'))continue;let _0x5ce316=_0x5b4106[_0x3474b7(0x217)]('=');if(_0x5ce316<0x0)continue;let _0x7129b6=_0x5b4106[_0x3474b7(0x251)](0x0,_0x5ce316)[_0x3474b7(0x21b)](),_0x2fbd4e=_0x5b4106[_0x3474b7(0x251)](_0x5ce316+0x1)[_0x3474b7(0x21b)]()[_0x3474b7(0x279)](/^["']|["']$/g,'');if(!process.env[_0x7129b6])process.env[_0x7129b6]=_0x2fbd4e;}}var C=process.env.HOME||'~',T=a0_0x9d2fc2(C,a0_0x4f791c(0x26c));p(a0_0x9d2fc2(T,a0_0x4f791c(0x27a)));var L=process[a0_0x4f791c(0x254)]()[a0_0x4f791c(0x279)](/\//g,'-');p(a0_0x9d2fc2(T,L,'.env'));function U(){const _0x480801=a0_0x4f791c;try{return a0_0x3dc4eb(_0x480801(0x21c),{'encoding':_0x480801(0x219),'timeout':0x7d0})[_0x480801(0x21b)]();}catch{return'';}}function a0_0x5741(){const _0x3f8a3c=['SSE\x20stream\x20ended,\x20reconnecting...','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','claude-code','Target\x20session\x20alias','SIGTERM','2.0','get','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','messages','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','116526bihFXf','then','36968kmEjAU','\x20PROJECT_ENV=','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','from_session','Reply\x20text\x20/\x20result\x20summary','hub','notifications/claude/channel','config.json','length','alias','setRequestHandler','send_reply','no\x20response','priority','indexOf','stdin','utf-8','\x22\x20(','trim','tmux\x20display-message\x20-p\x20\x27#S\x27','commhub_report_status','read','commhub-channel','1171245nKiOyb','MCP\x20stdio\x20connected','SSE\x20error:\x20',':\x20inbox_count=','connect','task','catch','new_task','Current\x20task\x20description','result','7rjSwwm','number','write','report_status','blocked','12WgQzLG','completed','commhub','application/json,\x20text/event-stream','\x20from\x20','status','commhub_send_message','2476540HbsYUB','delete','commhub_reply','558pBpGJF','message','string','find','Task\x20content','CommHub\x20init\x20failed:\x20','params','connecting\x20to\x20','SIGINT','content','text','13liDZQf','token','SSE\x20connection\x20error:\x20','warning:\x20could\x20not\x20register:\x20','idle','←\x20message\x20from\x20','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','ack_inbox','Message\x20content','\x20priority=','commhub_get_all_status','619025zPucOY','from','slice','/events/','cancelled','cwd','send_message','data:\x20','set','decode','replied','stringify','SSE\x20fatal:\x20','8YIUCQN','Priority\x20(default:\x20normal)','commhub_send_task','body','error','Bearer\x20','working',']\x20[commhub]\x20','inbox_count','toTimeString','session\x20disconnected','9110299uvQEgL','getReader','unknown\x20tool','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','normal','.claude/channels/commhub','Authorization','0.3.0','notification','broadcast','\x20RESUME_ID=','17078XkKspR','message_id','application/json','ENV:\x20URL=','in_progress','failed','low','replace','.env','get_all_status','registered\x20as\x20\x22','parse','fatal:\x20','new_message','object','type','Progress\x200-100','http://127.0.0.1:9200','POST','none','/mcp','2025-03-26','startsWith','send_task','stderr','...\x20TMUX=','exit','split','starting\x20SSE\x20listener...','→\x20injected\x20task\x20'];a0_0x5741=function(){return _0x3f8a3c;};return a0_0x5741();}function v(){const _0x1d1ba5=a0_0x4f791c;try{let _0x48ffa6=a0_0x9d2fc2(C,'.anet',_0x1d1ba5(0x210));if(a0_0x3388c3(_0x48ffa6))return JSON[_0x1d1ba5(0x27d)](a0_0x168a55(_0x48ffa6,_0x1d1ba5(0x219)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x4f791c(0x20e)]||a0_0x4f791c(0x283),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x3e041f(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x3cfa37(),X=process.env.COMMHUB_TOKEN||H[a0_0x4f791c(0x245)]||'';function Y(_0x26f9cf){const _0x161445=a0_0x4f791c;let _0x3679aa=new Date()[_0x161445(0x265)]()[_0x161445(0x251)](0x0,0x8);process[_0x161445(0x1f7)][_0x161445(0x22c)]('['+_0x3679aa+_0x161445(0x263)+_0x26f9cf+'\x0a');}function h(_0x3ac658){return new Promise(_0x36825a=>setTimeout(_0x36825a,_0x3ac658));}function a0_0x45ae(_0x36e349,_0x3dee81){_0x36e349=_0x36e349-0x1f3;const _0x574101=a0_0x5741();let _0x45ae65=_0x574101[_0x36e349];return _0x45ae65;}Y(a0_0x4f791c(0x275)+f+'\x20ALIAS='+Z+a0_0x4f791c(0x271)+w['slice'](0x0,0x8)+a0_0x4f791c(0x1f8)+(j||a0_0x4f791c(0x285))+'\x20CWD='+process[a0_0x4f791c(0x254)]()+a0_0x4f791c(0x20a)+L);var k=new Map(),K=new a0_0x4fcfb0({'name':a0_0x4f791c(0x21f),'version':'0.3.0'},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':['Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.',a0_0x4f791c(0x1fe),a0_0x4f791c(0x204),'Session\x20alias:\x20'+Z]['join']('\x0a')});K[a0_0x4f791c(0x213)](a0_0x5dc3d1,async()=>({'tools':[{'name':a0_0x4f791c(0x238),'description':'Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','inputSchema':{'type':a0_0x4f791c(0x280),'properties':{'task_id':{'type':a0_0x4f791c(0x23b),'description':a0_0x4f791c(0x26a)},'text':{'type':a0_0x4f791c(0x23b),'description':a0_0x4f791c(0x20d)},'status':{'type':a0_0x4f791c(0x23b),'enum':[a0_0x4f791c(0x230),a0_0x4f791c(0x277),a0_0x4f791c(0x253),a0_0x4f791c(0x22e),a0_0x4f791c(0x260),a0_0x4f791c(0x276)],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':['text']}},{'name':'commhub_report_status','description':'Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','inputSchema':{'type':a0_0x4f791c(0x280),'properties':{'status':{'type':a0_0x4f791c(0x23b),'enum':[a0_0x4f791c(0x262),a0_0x4f791c(0x248),a0_0x4f791c(0x22e),a0_0x4f791c(0x260)]},'task':{'type':a0_0x4f791c(0x23b),'description':a0_0x4f791c(0x228)},'progress':{'type':a0_0x4f791c(0x22b),'description':a0_0x4f791c(0x282)}},'required':[a0_0x4f791c(0x234)]}},{'name':a0_0x4f791c(0x25e),'description':a0_0x4f791c(0x24a),'inputSchema':{'type':a0_0x4f791c(0x280),'properties':{'alias':{'type':'string','description':'Target\x20session\x20alias'},'task':{'type':'string','description':a0_0x4f791c(0x23d)},'priority':{'type':a0_0x4f791c(0x23b),'enum':['high',a0_0x4f791c(0x26b),a0_0x4f791c(0x278)],'description':a0_0x4f791c(0x25d)}},'required':[a0_0x4f791c(0x212),a0_0x4f791c(0x225)]}},{'name':a0_0x4f791c(0x235),'description':a0_0x4f791c(0x206),'inputSchema':{'type':a0_0x4f791c(0x280),'properties':{'alias':{'type':a0_0x4f791c(0x23b),'description':a0_0x4f791c(0x200)},'message':{'type':a0_0x4f791c(0x23b),'description':a0_0x4f791c(0x24c)}},'required':[a0_0x4f791c(0x212),a0_0x4f791c(0x23a)]}},{'name':a0_0x4f791c(0x24e),'description':a0_0x4f791c(0x20b),'inputSchema':{'type':a0_0x4f791c(0x280),'properties':{}}}]}));async function P(_0x1a75aa,_0x33af56){const _0x53173b=a0_0x4f791c;let _0x31934f=await fetch(f+_0x53173b(0x1f3),{'method':_0x53173b(0x284),'headers':{'Content-Type':_0x53173b(0x274),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON[_0x53173b(0x25a)]({'jsonrpc':_0x53173b(0x202),'id':0x1,'method':'initialize','params':{'protocolVersion':_0x53173b(0x1f4),'capabilities':{},'clientInfo':{'name':'commhub-channel','version':_0x53173b(0x26e)}}})});if(!_0x31934f['ok']){let _0x51ba00=await _0x31934f[_0x53173b(0x243)]();return Y(_0x53173b(0x23e)+_0x31934f['status']+'\x20'+_0x51ba00[_0x53173b(0x251)](0x0,0x64)),{'ok':!0x1,'error':'init\x20failed:\x20'+_0x31934f['status']};}await _0x31934f[_0x53173b(0x243)]();let _0xeccea4=(await(await fetch(f+'/mcp',{'method':'POST','headers':{'Content-Type':_0x53173b(0x274),'Accept':_0x53173b(0x232),...X?{'Authorization':_0x53173b(0x261)+X}:{}},'body':JSON[_0x53173b(0x25a)]({'jsonrpc':_0x53173b(0x202),'id':0x2,'method':'tools/call','params':{'name':_0x1a75aa,'arguments':_0x33af56}})}))[_0x53173b(0x243)]())[_0x53173b(0x1fa)]('\x0a')[_0x53173b(0x23c)](_0x4dfae5=>_0x4dfae5[_0x53173b(0x1f5)](_0x53173b(0x256)));if(_0xeccea4){let _0xfaabf2=JSON['parse'](_0xeccea4[_0x53173b(0x251)](0x6));return _0xfaabf2?.[_0x53173b(0x229)]?.[_0x53173b(0x242)]?.[0x0]?.[_0x53173b(0x243)]?JSON[_0x53173b(0x27d)](_0xfaabf2[_0x53173b(0x229)][_0x53173b(0x242)][0x0]['text']):_0xfaabf2;}return{'ok':!0x1,'error':_0x53173b(0x215)};}K[a0_0x4f791c(0x213)](a0_0x544a38,async _0x1f175f=>{const _0x11308e=a0_0x4f791c;let {name:_0x5f30a9,arguments:_0x3ecb37}=_0x1f175f[_0x11308e(0x23f)];if(_0x5f30a9==='commhub_reply'){let {task_id:_0x1fb905,text:_0x201e81,status:_0x17730d}=_0x3ecb37;if(_0x17730d===_0x11308e(0x230)||_0x17730d===_0x11308e(0x277)||_0x17730d===_0x11308e(0x253)){let _0x896552=_0x17730d==='completed'?_0x11308e(0x259):_0x17730d,_0x196801=_0x1fb905?k[_0x11308e(0x203)](_0x1fb905)||_0x11308e(0x20e):_0x11308e(0x20e),_0x4c0e0f=await P(_0x11308e(0x214),{'alias':_0x196801,'text':_0x201e81,'in_reply_to':_0x1fb905||void 0x0,'status':_0x896552,'from_session':Z});if(_0x1fb905)k[_0x11308e(0x237)](_0x1fb905);return{'content':[{'type':'text','text':JSON[_0x11308e(0x25a)](_0x4c0e0f)}]};}let _0x619cd0=await P(_0x11308e(0x22d),{'resume_id':w,'alias':Z,'status':_0x17730d===_0x11308e(0x22e)?'blocked':_0x17730d==='error'?'error':_0x11308e(0x262),'task':_0x201e81[_0x11308e(0x251)](0x0,0xc8),'output':_0x201e81});return{'content':[{'type':_0x11308e(0x243),'text':JSON[_0x11308e(0x25a)](_0x619cd0)}]};}if(_0x5f30a9===_0x11308e(0x21d)){let {status:_0x22ec94,task:_0x3a10cf,progress:_0x577d9b}=_0x3ecb37,_0x1e8598=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x22ec94,'task':_0x3a10cf,'progress':_0x577d9b});return{'content':[{'type':_0x11308e(0x243),'text':JSON[_0x11308e(0x25a)](_0x1e8598)}]};}if(_0x5f30a9===_0x11308e(0x25e)){let {alias:_0x459888,task:_0x2bd731,priority:_0x39a562}=_0x3ecb37,_0x55b792=await P(_0x11308e(0x1f6),{'alias':_0x459888,'task':_0x2bd731,'priority':_0x39a562||'normal','from_session':Z});return{'content':[{'type':_0x11308e(0x243),'text':JSON['stringify'](_0x55b792)}]};}if(_0x5f30a9==='commhub_send_message'){let {alias:_0x4e2c9d,message:_0x298fd4}=_0x3ecb37,_0x33fce9=await P(_0x11308e(0x255),{'alias':_0x4e2c9d,'message':_0x298fd4,'from_session':Z});return{'content':[{'type':_0x11308e(0x243),'text':JSON['stringify'](_0x33fce9)}]};}if(_0x5f30a9===_0x11308e(0x24e)){let _0x44bb63=await P(_0x11308e(0x27b),{});return{'content':[{'type':_0x11308e(0x243),'text':JSON[_0x11308e(0x25a)](_0x44bb63)}]};}return{'content':[{'type':'text','text':JSON['stringify']({'error':_0x11308e(0x269)})}]};});async function u(){const _0x52aedb=a0_0x4f791c;let _0xd8ac99=f+_0x52aedb(0x252)+encodeURIComponent(Z),_0x28b288={};if(X)_0x28b288[_0x52aedb(0x26d)]=_0x52aedb(0x261)+X;Y(_0x52aedb(0x240)+_0xd8ac99);while(!0x0){try{let _0x4930b0=await fetch(_0xd8ac99,{'headers':_0x28b288});if(!_0x4930b0['ok']){Y(_0x52aedb(0x222)+_0x4930b0[_0x52aedb(0x234)]+'\x20'+_0x4930b0['statusText']),await h(0x1388);continue;}let _0x49226e=_0x4930b0[_0x52aedb(0x25f)][_0x52aedb(0x268)](),_0x4b7a1f=new TextDecoder(),_0x4565ad='';while(!0x0){let {done:_0x4bcd92,value:_0x56c144}=await _0x49226e[_0x52aedb(0x21e)]();if(_0x4bcd92)break;_0x4565ad+=_0x4b7a1f[_0x52aedb(0x258)](_0x56c144,{'stream':!0x0});let _0x19971=_0x4565ad[_0x52aedb(0x1fa)]('\x0a\x0a');_0x4565ad=_0x19971['pop']()||'';for(let _0x31e5e3 of _0x19971){let _0x14e221=_0x31e5e3[_0x52aedb(0x1fa)]('\x0a')[_0x52aedb(0x23c)](_0x4f317f=>_0x4f317f['startsWith'](_0x52aedb(0x256)));if(!_0x14e221)continue;try{let _0x12d180=JSON['parse'](_0x14e221[_0x52aedb(0x251)](0x6));await S(_0x12d180);}catch(_0x8e24a5){Y('parse\x20error:\x20'+_0x8e24a5);}}}Y(_0x52aedb(0x1fd));}catch(_0x5ac016){Y(_0x52aedb(0x246)+_0x5ac016);}await h(0xbb8);}}async function S(_0x23c265){const _0x55139e=a0_0x4f791c;if(_0x23c265[_0x55139e(0x281)]==='connected'){Y('SSE\x20connected\x20as\x20\x22'+Z+'\x22');return;}if(_0x23c265[_0x55139e(0x281)]===_0x55139e(0x27f)){if(Y(_0x55139e(0x249)+_0x23c265[_0x55139e(0x250)]+':\x20'+_0x23c265[_0x55139e(0x23a)][_0x55139e(0x251)](0x0,0x3c)),await K[_0x55139e(0x26f)]({'method':_0x55139e(0x20f),'params':{'content':_0x23c265[_0x55139e(0x23a)],'meta':{'sender':_0x23c265[_0x55139e(0x250)]||_0x55139e(0x20e),'sender_id':_0x55139e(0x231),'user':_0x23c265[_0x55139e(0x250)]||_0x55139e(0x20e),'priority':_0x55139e(0x26b)}}}),_0x23c265[_0x55139e(0x273)])await P(_0x55139e(0x24b),{'alias':Z,'message_id':_0x23c265[_0x55139e(0x273)]});return;}if(_0x23c265[_0x55139e(0x281)]===_0x55139e(0x227)||_0x23c265[_0x55139e(0x281)]===_0x55139e(0x270)){Y('←\x20'+_0x23c265[_0x55139e(0x281)]+_0x55139e(0x223)+_0x23c265[_0x55139e(0x264)]+_0x55139e(0x24d)+(_0x23c265['priority']||_0x55139e(0x26b)));let _0x4ea0d8=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0x4ea0d8?.['ok']&&_0x4ea0d8[_0x55139e(0x205)]?.[_0x55139e(0x211)]>0x0)for(let _0x2c9b52 of _0x4ea0d8[_0x55139e(0x205)]){let _0x1775aa={'sender':_0x2c9b52[_0x55139e(0x20c)]||'hub','sender_id':_0x55139e(0x231),'user':_0x2c9b52[_0x55139e(0x20c)]||_0x55139e(0x20e),'task_id':_0x2c9b52['id'],'priority':_0x2c9b52[_0x55139e(0x216)]||_0x55139e(0x26b)};k[_0x55139e(0x257)](_0x2c9b52['id'],_0x2c9b52['from_session']||_0x55139e(0x20e)),await K[_0x55139e(0x26f)]({'method':_0x55139e(0x20f),'params':{'content':_0x2c9b52[_0x55139e(0x242)],'meta':_0x1775aa}}),Y(_0x55139e(0x1fc)+_0x2c9b52['id'][_0x55139e(0x251)](0x0,0x8)+_0x55139e(0x233)+_0x2c9b52[_0x55139e(0x20c)]+':\x20'+_0x2c9b52[_0x55139e(0x242)][_0x55139e(0x251)](0x0,0x3c)),await P(_0x55139e(0x24b),{'alias':Z,'message_id':_0x2c9b52['id']});}}}async function A(){const _0x55b2bf=a0_0x4f791c;let _0x14cd69=new a0_0x100966();await K[_0x55b2bf(0x224)](_0x14cd69),Y(_0x55b2bf(0x221)),Y(_0x55b2bf(0x1fb)),u()[_0x55b2bf(0x226)](_0x5b68ee=>Y(_0x55b2bf(0x25b)+_0x5b68ee)),P(_0x55b2bf(0x22d),{'resume_id':w,'alias':Z,'status':_0x55b2bf(0x248),'server':a0_0x3e041f(),'hostname':a0_0x3e041f(),'agent':_0x55b2bf(0x1ff),'project_dir':process[_0x55b2bf(0x254)](),'tmux_name':j||void 0x0})[_0x55b2bf(0x208)](()=>Y(_0x55b2bf(0x27c)+Z+_0x55b2bf(0x21a)+w[_0x55b2bf(0x251)](0x0,0x8)+')'))[_0x55b2bf(0x226)](_0x507409=>Y(_0x55b2bf(0x247)+_0x507409)),setInterval(()=>{const _0x4b4103=_0x55b2bf;P('report_status',{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x3e041f(),'hostname':a0_0x3e041f(),'agent':_0x4b4103(0x1ff),'project_dir':process[_0x4b4103(0x254)](),'tmux_name':j||void 0x0})['catch'](_0x1c754c=>Y('heartbeat\x20failed:\x20'+_0x1c754c));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}A()['catch'](_0x2bb67f=>{const _0x3d997a=a0_0x4f791c;Y(_0x3d997a(0x27e)+_0x2bb67f),process[_0x3d997a(0x1f9)](0x1);});async function N(){const _0x267ab6=a0_0x4f791c;Y('shutting\x20down,\x20reporting\x20offline...'),await P(_0x267ab6(0x22d),{'resume_id':w,'alias':Z,'status':_0x267ab6(0x260),'task':_0x267ab6(0x266)})[_0x267ab6(0x226)](()=>{}),process['exit'](0x0);}process[a0_0x4f791c(0x218)]['on']('end',()=>N()),process['on'](a0_0x4f791c(0x201),()=>N()),process['on'](a0_0x4f791c(0x241),()=>N());
2
+ const a0_0x169cb0=a0_0x137a;(function(_0x96f306,_0x3c7696){const _0xdd7aa=a0_0x137a,_0x5f411c=_0x96f306();while(!![]){try{const _0x2feeeb=-parseInt(_0xdd7aa(0x142))/0x1*(-parseInt(_0xdd7aa(0x139))/0x2)+-parseInt(_0xdd7aa(0x119))/0x3+-parseInt(_0xdd7aa(0x130))/0x4*(parseInt(_0xdd7aa(0xc3))/0x5)+-parseInt(_0xdd7aa(0x152))/0x6+-parseInt(_0xdd7aa(0x10e))/0x7*(-parseInt(_0xdd7aa(0xe6))/0x8)+parseInt(_0xdd7aa(0xd5))/0x9*(-parseInt(_0xdd7aa(0xf8))/0xa)+-parseInt(_0xdd7aa(0xf3))/0xb*(-parseInt(_0xdd7aa(0xcb))/0xc);if(_0x2feeeb===_0x3c7696)break;else _0x5f411c['push'](_0x5f411c['shift']());}catch(_0x5422a5){_0x5f411c['push'](_0x5f411c['shift']());}}}(a0_0x1782,0x2d858));import{readFileSync as a0_0x499951,existsSync as a0_0x21540e}from'fs';import{randomUUID as a0_0x101bd6}from'crypto';function a0_0x137a(_0x56e56c,_0x112f03){_0x56e56c=_0x56e56c-0xc3;const _0x17825f=a0_0x1782();let _0x137a94=_0x17825f[_0x56e56c];return _0x137a94;}import{join as a0_0x56fbd0}from'path';import{hostname as a0_0x37710d}from'os';import{execSync as a0_0x1dc4cb}from'child_process';import{Server as a0_0x3298e1}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x5c214c}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x668c62,CallToolRequestSchema as a0_0x10e238}from'@modelcontextprotocol/sdk/types.js';function p(_0x3f4d6b){const _0x1e6943=a0_0x137a;if(!a0_0x21540e(_0x3f4d6b))return;for(let _0x17acbf of a0_0x499951(_0x3f4d6b,_0x1e6943(0x11e))[_0x1e6943(0xff)]('\x0a')){let _0x28d5a7=_0x17acbf['trim']();if(!_0x28d5a7||_0x28d5a7[_0x1e6943(0xf9)]('#'))continue;let _0x45b2da=_0x28d5a7['indexOf']('=');if(_0x45b2da<0x0)continue;let _0x11ffb6=_0x28d5a7['slice'](0x0,_0x45b2da)[_0x1e6943(0xc9)](),_0x54527c=_0x28d5a7[_0x1e6943(0xe9)](_0x45b2da+0x1)['trim']()['replace'](/^["']|["']$/g,'');if(!process.env[_0x11ffb6])process.env[_0x11ffb6]=_0x54527c;}}var C=process.env.HOME||'~',T=a0_0x56fbd0(C,a0_0x169cb0(0x146));p(a0_0x56fbd0(T,'.env'));var L=process[a0_0x169cb0(0x13b)]()[a0_0x169cb0(0xda)](/\//g,'-');function a0_0x1782(){const _0x5cb85a=['number','commhub_report_status',':\x20inbox_count=','get','replied','type','find','...\x20TMUX=','idle','notifications/claude/channel','init\x20failed:\x20','\x20RESUME_ID=','7QXWYeU','ack_inbox','result','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','SIGINT','text','priority','commhub_reply','Message\x20content','from_session','commhub_send_message','745497nmvkwS','Task\x20content','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','join','claude-code','utf-8','length','commhub','2025-03-26','set','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','\x20priority=','Progress\x200-100','.env','→\x20injected\x20task\x20','catch','session\x20disconnected','SSE\x20error:\x20','normal','error','toTimeString','shutting\x20down,\x20reporting\x20offline...','alias','132eSRVyM','pop','stdin','initialize','\x22\x20(','hub','Priority\x20(default:\x20normal)','tools/call','completed','2nvzapq','http://127.0.0.1:9200','cwd','high','read','string','parse\x20error:\x20','cancelled','in_progress','264314zVNaDG','message','getReader','commhub_send_task','.claude/channels/commhub','report_status','ready\x20—\x20waiting\x20for\x20events','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','SSE\x20fatal:\x20','SSE\x20connected\x20as\x20\x22','token','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','task','failed','heartbeat\x20failed:\x20','decode','742416KzysAP','exit','7995wExTXU','send_message','/mcp','fatal:\x20','status','none','trim','setRequestHandler','12HcaIXv','params','POST','\x20ALIAS=','Bearer\x20','object','message_id','stringify','application/json','send_reply','342rKHvJN','ENV:\x20URL=','MCP\x20stdio\x20connected','end','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','replace','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','SIGTERM','get_all_status','working','←\x20message\x20from\x20','send_task','no\x20response','2.0','/events/','from','Target\x20session\x20alias','2016184kaaBih','starting\x20SSE\x20listener...','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','slice','write','parse','inbox_count','blocked','application/json,\x20text/event-stream','delete','commhub_get_all_status','Authorization','registered\x20as\x20\x22','3637513bsxSCK','then','content','SSE\x20stream\x20ended,\x20reconnecting...',']\x20[commhub]\x20','61990FmPayp','startsWith','body','data:\x20','messages','\x20PROJECT_ENV=','unknown\x20tool','split','connect','Reply\x20text\x20/\x20result\x20summary'];a0_0x1782=function(){return _0x5cb85a;};return a0_0x1782();}p(a0_0x56fbd0(T,L,a0_0x169cb0(0x126)));function U(){const _0x35a74c=a0_0x169cb0;try{return a0_0x1dc4cb('tmux\x20display-message\x20-p\x20\x27#S\x27',{'encoding':_0x35a74c(0x11e),'timeout':0x7d0})[_0x35a74c(0xc9)]();}catch{return'';}}function v(){const _0x2f6bc1=a0_0x169cb0;try{let _0x21ac9d=a0_0x56fbd0(C,'.anet','config.json');if(a0_0x21540e(_0x21ac9d))return JSON[_0x2f6bc1(0xeb)](a0_0x499951(_0x21ac9d,'utf-8'));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x169cb0(0x135)]||a0_0x169cb0(0x13a),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x37710d(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x101bd6(),X=process.env.COMMHUB_TOKEN||H[a0_0x169cb0(0x14c)]||'';function Y(_0x36b564){const _0x286b68=a0_0x169cb0;let _0x5309f7=new Date()[_0x286b68(0x12d)]()[_0x286b68(0xe9)](0x0,0x8);process['stderr'][_0x286b68(0xea)]('['+_0x5309f7+_0x286b68(0xf7)+_0x36b564+'\x0a');}function h(_0x2bc29f){return new Promise(_0x292462=>setTimeout(_0x292462,_0x2bc29f));}Y(a0_0x169cb0(0xd6)+f+a0_0x169cb0(0xce)+Z+a0_0x169cb0(0x10d)+w[a0_0x169cb0(0xe9)](0x0,0x8)+a0_0x169cb0(0x109)+(j||a0_0x169cb0(0xc8))+'\x20CWD='+process['cwd']()+a0_0x169cb0(0xfd)+L);var k=new Map(),K=new a0_0x3298e1({'name':'commhub-channel','version':'0.3.0'},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x169cb0(0x111),a0_0x169cb0(0xdb),a0_0x169cb0(0x14d),'You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','Session\x20alias:\x20'+Z][a0_0x169cb0(0x11c)]('\x0a')});K[a0_0x169cb0(0xca)](a0_0x668c62,async()=>({'tools':[{'name':a0_0x169cb0(0x115),'description':a0_0x169cb0(0x123),'inputSchema':{'type':a0_0x169cb0(0xd0),'properties':{'task_id':{'type':a0_0x169cb0(0x13e),'description':'The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)'},'text':{'type':a0_0x169cb0(0x13e),'description':a0_0x169cb0(0x101)},'status':{'type':a0_0x169cb0(0x13e),'enum':['completed',a0_0x169cb0(0x14f),a0_0x169cb0(0x140),a0_0x169cb0(0xed),a0_0x169cb0(0x12c),a0_0x169cb0(0x141)],'description':a0_0x169cb0(0xe8)}},'required':['text']}},{'name':a0_0x169cb0(0x103),'description':a0_0x169cb0(0xd9),'inputSchema':{'type':a0_0x169cb0(0xd0),'properties':{'status':{'type':a0_0x169cb0(0x13e),'enum':[a0_0x169cb0(0xde),'idle',a0_0x169cb0(0xed),a0_0x169cb0(0x12c)]},'task':{'type':a0_0x169cb0(0x13e),'description':'Current\x20task\x20description'},'progress':{'type':a0_0x169cb0(0x102),'description':a0_0x169cb0(0x125)}},'required':[a0_0x169cb0(0xc7)]}},{'name':a0_0x169cb0(0x145),'description':'Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','inputSchema':{'type':a0_0x169cb0(0xd0),'properties':{'alias':{'type':a0_0x169cb0(0x13e),'description':a0_0x169cb0(0xe5)},'task':{'type':a0_0x169cb0(0x13e),'description':a0_0x169cb0(0x11a)},'priority':{'type':'string','enum':[a0_0x169cb0(0x13c),a0_0x169cb0(0x12b),'low'],'description':a0_0x169cb0(0x136)}},'required':[a0_0x169cb0(0x12f),a0_0x169cb0(0x14e)]}},{'name':a0_0x169cb0(0x118),'description':a0_0x169cb0(0x11b),'inputSchema':{'type':'object','properties':{'alias':{'type':'string','description':a0_0x169cb0(0xe5)},'message':{'type':a0_0x169cb0(0x13e),'description':a0_0x169cb0(0x116)}},'required':['alias',a0_0x169cb0(0x143)]}},{'name':a0_0x169cb0(0xf0),'description':a0_0x169cb0(0x149),'inputSchema':{'type':a0_0x169cb0(0xd0),'properties':{}}}]}));async function P(_0x5e124d,_0x349ba9){const _0x3ea6ed=a0_0x169cb0;let _0x1b8189=await fetch(f+_0x3ea6ed(0xc5),{'method':_0x3ea6ed(0xcd),'headers':{'Content-Type':'application/json','Accept':_0x3ea6ed(0xee),...X?{'Authorization':_0x3ea6ed(0xcf)+X}:{}},'body':JSON[_0x3ea6ed(0xd2)]({'jsonrpc':_0x3ea6ed(0xe2),'id':0x1,'method':_0x3ea6ed(0x133),'params':{'protocolVersion':_0x3ea6ed(0x121),'capabilities':{},'clientInfo':{'name':'commhub-channel','version':'0.3.0'}}})});if(!_0x1b8189['ok']){let _0x4e4957=await _0x1b8189[_0x3ea6ed(0x113)]();return Y('CommHub\x20init\x20failed:\x20'+_0x1b8189[_0x3ea6ed(0xc7)]+'\x20'+_0x4e4957[_0x3ea6ed(0xe9)](0x0,0x64)),{'ok':!0x1,'error':_0x3ea6ed(0x10c)+_0x1b8189['status']};}await _0x1b8189[_0x3ea6ed(0x113)]();let _0x24f4a9=(await(await fetch(f+_0x3ea6ed(0xc5),{'method':_0x3ea6ed(0xcd),'headers':{'Content-Type':_0x3ea6ed(0xd3),'Accept':_0x3ea6ed(0xee),...X?{'Authorization':_0x3ea6ed(0xcf)+X}:{}},'body':JSON[_0x3ea6ed(0xd2)]({'jsonrpc':_0x3ea6ed(0xe2),'id':0x2,'method':_0x3ea6ed(0x137),'params':{'name':_0x5e124d,'arguments':_0x349ba9}})}))[_0x3ea6ed(0x113)]())[_0x3ea6ed(0xff)]('\x0a')[_0x3ea6ed(0x108)](_0x470090=>_0x470090['startsWith']('data:\x20'));if(_0x24f4a9){let _0x1e3a7c=JSON['parse'](_0x24f4a9[_0x3ea6ed(0xe9)](0x6));return _0x1e3a7c?.[_0x3ea6ed(0x110)]?.[_0x3ea6ed(0xf5)]?.[0x0]?.[_0x3ea6ed(0x113)]?JSON[_0x3ea6ed(0xeb)](_0x1e3a7c[_0x3ea6ed(0x110)]['content'][0x0]['text']):_0x1e3a7c;}return{'ok':!0x1,'error':_0x3ea6ed(0xe1)};}K[a0_0x169cb0(0xca)](a0_0x10e238,async _0x41d4ba=>{const _0x2b3b43=a0_0x169cb0;let {name:_0x2bc664,arguments:_0x42dd71}=_0x41d4ba[_0x2b3b43(0xcc)];if(_0x2bc664===_0x2b3b43(0x115)){let {task_id:_0x42e99f,text:_0x1a3728,status:_0x151e5b}=_0x42dd71;if(_0x151e5b===_0x2b3b43(0x138)||_0x151e5b===_0x2b3b43(0x14f)||_0x151e5b===_0x2b3b43(0x140)){let _0x5a5bf8=_0x151e5b===_0x2b3b43(0x138)?_0x2b3b43(0x106):_0x151e5b,_0xeebe1b=_0x42e99f?k[_0x2b3b43(0x105)](_0x42e99f)||_0x2b3b43(0x135):_0x2b3b43(0x135),_0x21d77c=await P(_0x2b3b43(0xd4),{'alias':_0xeebe1b,'text':_0x1a3728,'in_reply_to':_0x42e99f||void 0x0,'status':_0x5a5bf8,'from_session':Z});if(_0x42e99f)k[_0x2b3b43(0xef)](_0x42e99f);return{'content':[{'type':_0x2b3b43(0x113),'text':JSON[_0x2b3b43(0xd2)](_0x21d77c)}]};}let _0xbb3a3d=await P(_0x2b3b43(0x147),{'resume_id':w,'alias':Z,'status':_0x151e5b===_0x2b3b43(0xed)?_0x2b3b43(0xed):_0x151e5b===_0x2b3b43(0x12c)?_0x2b3b43(0x12c):_0x2b3b43(0xde),'task':_0x1a3728[_0x2b3b43(0xe9)](0x0,0xc8),'output':_0x1a3728});return{'content':[{'type':_0x2b3b43(0x113),'text':JSON[_0x2b3b43(0xd2)](_0xbb3a3d)}]};}if(_0x2bc664===_0x2b3b43(0x103)){let {status:_0x26018a,task:_0x597be7,progress:_0x5353dc}=_0x42dd71,_0x29f851=await P(_0x2b3b43(0x147),{'resume_id':w,'alias':Z,'status':_0x26018a,'task':_0x597be7,'progress':_0x5353dc});return{'content':[{'type':_0x2b3b43(0x113),'text':JSON['stringify'](_0x29f851)}]};}if(_0x2bc664==='commhub_send_task'){let {alias:_0x266fb1,task:_0x32d2a3,priority:_0x17bfad}=_0x42dd71,_0x65bd49=await P(_0x2b3b43(0xe0),{'alias':_0x266fb1,'task':_0x32d2a3,'priority':_0x17bfad||_0x2b3b43(0x12b),'from_session':Z});return{'content':[{'type':_0x2b3b43(0x113),'text':JSON['stringify'](_0x65bd49)}]};}if(_0x2bc664==='commhub_send_message'){let {alias:_0x50452c,message:_0x3537ae}=_0x42dd71,_0x2f869f=await P(_0x2b3b43(0xc4),{'alias':_0x50452c,'message':_0x3537ae,'from_session':Z});return{'content':[{'type':_0x2b3b43(0x113),'text':JSON[_0x2b3b43(0xd2)](_0x2f869f)}]};}if(_0x2bc664===_0x2b3b43(0xf0)){let _0x4967ac=await P(_0x2b3b43(0xdd),{});return{'content':[{'type':'text','text':JSON[_0x2b3b43(0xd2)](_0x4967ac)}]};}return{'content':[{'type':_0x2b3b43(0x113),'text':JSON[_0x2b3b43(0xd2)]({'error':_0x2b3b43(0xfe)})}]};});async function u(){const _0x37d436=a0_0x169cb0;let _0x543bcc=f+_0x37d436(0xe3)+encodeURIComponent(Z),_0x1849b5={};if(X)_0x1849b5[_0x37d436(0xf1)]='Bearer\x20'+X;Y('connecting\x20to\x20'+_0x543bcc);while(!0x0){try{let _0x561cf3=await fetch(_0x543bcc,{'headers':_0x1849b5});if(!_0x561cf3['ok']){Y(_0x37d436(0x12a)+_0x561cf3[_0x37d436(0xc7)]+'\x20'+_0x561cf3['statusText']),await h(0x1388);continue;}let _0x5afd78=_0x561cf3[_0x37d436(0xfa)][_0x37d436(0x144)](),_0x759e2=new TextDecoder(),_0x550701='';while(!0x0){let {done:_0x4360db,value:_0x4548d2}=await _0x5afd78[_0x37d436(0x13d)]();if(_0x4360db)break;_0x550701+=_0x759e2[_0x37d436(0x151)](_0x4548d2,{'stream':!0x0});let _0x5e0b27=_0x550701[_0x37d436(0xff)]('\x0a\x0a');_0x550701=_0x5e0b27[_0x37d436(0x131)]()||'';for(let _0x162520 of _0x5e0b27){let _0x1dc3da=_0x162520[_0x37d436(0xff)]('\x0a')['find'](_0x48cc75=>_0x48cc75['startsWith'](_0x37d436(0xfb)));if(!_0x1dc3da)continue;try{let _0x2eb477=JSON[_0x37d436(0xeb)](_0x1dc3da[_0x37d436(0xe9)](0x6));await S(_0x2eb477);}catch(_0x590c8d){Y(_0x37d436(0x13f)+_0x590c8d);}}}Y(_0x37d436(0xf6));}catch(_0x3f06c6){Y('SSE\x20connection\x20error:\x20'+_0x3f06c6);}await h(0xbb8);}}async function S(_0x4df23e){const _0xc83072=a0_0x169cb0;if(_0x4df23e['type']==='connected'){Y(_0xc83072(0x14b)+Z+'\x22');return;}if(_0x4df23e[_0xc83072(0x107)]==='new_message'){if(Y(_0xc83072(0xdf)+_0x4df23e[_0xc83072(0xe4)]+':\x20'+_0x4df23e['message'][_0xc83072(0xe9)](0x0,0x3c)),await K['notification']({'method':'notifications/claude/channel','params':{'content':_0x4df23e[_0xc83072(0x143)],'meta':{'sender':_0x4df23e['from']||_0xc83072(0x135),'sender_id':_0xc83072(0x120),'user':_0x4df23e[_0xc83072(0xe4)]||_0xc83072(0x135),'priority':'normal'}}}),_0x4df23e[_0xc83072(0xd1)])await P('ack_inbox',{'alias':Z,'message_id':_0x4df23e['message_id']});return;}if(_0x4df23e[_0xc83072(0x107)]==='new_task'||_0x4df23e[_0xc83072(0x107)]==='broadcast'){Y('←\x20'+_0x4df23e[_0xc83072(0x107)]+_0xc83072(0x104)+_0x4df23e[_0xc83072(0xec)]+_0xc83072(0x124)+(_0x4df23e[_0xc83072(0x114)]||_0xc83072(0x12b)));let _0x5b07b1=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0x5b07b1?.['ok']&&_0x5b07b1[_0xc83072(0xfc)]?.[_0xc83072(0x11f)]>0x0)for(let _0x4d443f of _0x5b07b1[_0xc83072(0xfc)]){let _0x293c3b={'sender':_0x4d443f[_0xc83072(0x117)]||_0xc83072(0x135),'sender_id':_0xc83072(0x120),'user':_0x4d443f[_0xc83072(0x117)]||_0xc83072(0x135),'task_id':_0x4d443f['id'],'priority':_0x4d443f[_0xc83072(0x114)]||'normal'};k[_0xc83072(0x122)](_0x4d443f['id'],_0x4d443f[_0xc83072(0x117)]||_0xc83072(0x135)),await K['notification']({'method':_0xc83072(0x10b),'params':{'content':_0x4d443f[_0xc83072(0xf5)],'meta':_0x293c3b}}),Y(_0xc83072(0x127)+_0x4d443f['id'][_0xc83072(0xe9)](0x0,0x8)+'\x20from\x20'+_0x4d443f[_0xc83072(0x117)]+':\x20'+_0x4d443f[_0xc83072(0xf5)][_0xc83072(0xe9)](0x0,0x3c)),await P(_0xc83072(0x10f),{'alias':Z,'message_id':_0x4d443f['id']});}}}async function A(){const _0x21d333=a0_0x169cb0;let _0x18ce1e=new a0_0x5c214c();await K[_0x21d333(0x100)](_0x18ce1e),Y(_0x21d333(0xd7)),Y(_0x21d333(0xe7)),u()[_0x21d333(0x128)](_0x1bfd15=>Y(_0x21d333(0x14a)+_0x1bfd15)),P(_0x21d333(0x147),{'resume_id':w,'alias':Z,'status':_0x21d333(0x10a),'server':a0_0x37710d(),'hostname':a0_0x37710d(),'agent':'claude-code','project_dir':process['cwd'](),'tmux_name':j||void 0x0})[_0x21d333(0xf4)](()=>Y(_0x21d333(0xf2)+Z+_0x21d333(0x134)+w[_0x21d333(0xe9)](0x0,0x8)+')'))[_0x21d333(0x128)](_0xd2fddd=>Y('warning:\x20could\x20not\x20register:\x20'+_0xd2fddd)),setInterval(()=>{const _0x565fe4=_0x21d333;P(_0x565fe4(0x147),{'resume_id':w,'alias':Z,'status':_0x565fe4(0x10a),'server':a0_0x37710d(),'hostname':a0_0x37710d(),'agent':_0x565fe4(0x11d),'project_dir':process[_0x565fe4(0x13b)](),'tmux_name':j||void 0x0})[_0x565fe4(0x128)](_0x40570c=>Y(_0x565fe4(0x150)+_0x40570c));},0x2bf20),Y(_0x21d333(0x148));}A()[a0_0x169cb0(0x128)](_0x3d347e=>{const _0x28d342=a0_0x169cb0;Y(_0x28d342(0xc6)+_0x3d347e),process[_0x28d342(0x153)](0x1);});async function N(){const _0x5c0a54=a0_0x169cb0;Y(_0x5c0a54(0x12e)),await P('report_status',{'resume_id':w,'alias':Z,'status':_0x5c0a54(0x12c),'task':_0x5c0a54(0x129)})[_0x5c0a54(0x128)](()=>{}),process['exit'](0x0);}process[a0_0x169cb0(0x132)]['on'](a0_0x169cb0(0xd8),()=>N()),process['on'](a0_0x169cb0(0xdc),()=>N()),process['on'](a0_0x169cb0(0x112),()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.1.15-preview.3",
3
+ "version": "2.1.15-preview.4",
4
4
  "description": "AI Agent Network CLI — Create multi-agent networks with user management, network isolation, and 3 AI runtimes (Claude/Codex/MiniMax). 39 commands.",
5
5
  "type": "module",
6
6
  "main": "dist/src/client.js",