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

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_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
+ const a0_0x31d98e=a0_0x2a65;(function(_0x131f62,_0x24fe3c){const _0x235e25=a0_0x2a65,_0x2c9499=_0x131f62();while(!![]){try{const _0x14936c=-parseInt(_0x235e25(0x8b))/0x1+parseInt(_0x235e25(0x89))/0x2+parseInt(_0x235e25(0x68))/0x3*(-parseInt(_0x235e25(0x9e))/0x4)+-parseInt(_0x235e25(0x7e))/0x5+parseInt(_0x235e25(0x92))/0x6+parseInt(_0x235e25(0xac))/0x7*(-parseInt(_0x235e25(0x85))/0x8)+parseInt(_0x235e25(0x84))/0x9*(parseInt(_0x235e25(0x7a))/0xa);if(_0x14936c===_0x24fe3c)break;else _0x2c9499['push'](_0x2c9499['shift']());}catch(_0x310667){_0x2c9499['push'](_0x2c9499['shift']());}}}(a0_0x1c3f,0xc0967));function a0_0x1c3f(){const _0xa791b6=['connectSSE','9dNKrGI','969152wYAdtP','sseAbort','pop','catch','1760726AolOhv','autoConnect','347967mEYQZp','connected','SSE\x20failed:\x20','alias','send_reply','content','toTimeString','2949984WYlCem','ack_inbox','s...','connect','startsWith','reconnectDelay','/mcp','2.0','body','running','abort','inbox\x20error:\x20','1836028SkxeCZ','report_status','error',']\x20[commhub:','send_task','heartbeatInterval','task','messages','sleep','token','decode','POST','SSE\x20reconnecting\x20in\x20','text','7YxydEq','broadcast','signal','processInbox','parse','cwd','get_all_status','registered','heartbeatTimer','Authorization','resumeId','new_message','now','getAllStatus','disconnected','slice','log','sdk','get_inbox','idle','type','status','sdk-','send','6BRNuPh','getReader','name','from_session','Bearer\x20','tools/call','min','data:\x20','toString','split','url','/events/','match','reply','call','application/json,\x20text/event-stream','SSE\x20connected','message','15234160wjceoZ','offline','agent','normal','3597395ZknwKR','result','emit','server','disconnect'];a0_0x1c3f=function(){return _0xa791b6;};return a0_0x1c3f();}function a0_0x2a65(_0x19a700,_0x532f2b){_0x19a700=_0x19a700-0x67;const _0x1c3fa8=a0_0x1c3f();let _0x2a65ab=_0x1c3fa8[_0x19a700];return _0x2a65ab;}import{EventEmitter as a0_0x3e62c3}from'events';import{hostname as a0_0xa6a4a6}from'os';class T extends a0_0x3e62c3{[a0_0x31d98e(0x72)];[a0_0x31d98e(0x8e)];[a0_0x31d98e(0xa7)];[a0_0x31d98e(0x7c)];['resumeId'];[a0_0x31d98e(0xa3)];['reconnectDelay'];['heartbeatTimer'];[a0_0x31d98e(0x86)];[a0_0x31d98e(0x9b)]=!0x1;constructor(_0x286136){const _0x258250=a0_0x31d98e;super();if(this['url']=_0x286136[_0x258250(0x72)]['replace'](/\/$/,''),this['alias']=_0x286136[_0x258250(0x8e)],this['token']=_0x286136[_0x258250(0xa7)],this[_0x258250(0x7c)]=_0x286136[_0x258250(0x7c)]||_0x258250(0xbd),this['resumeId']=_0x258250(0xc2)+_0x286136[_0x258250(0x8e)]+'-'+Date[_0x258250(0xb8)]()[_0x258250(0x70)](0x24),this['heartbeatInterval']=_0x286136[_0x258250(0xa3)]??0x2bf20,this[_0x258250(0x97)]=_0x286136[_0x258250(0x97)]??0xbb8,_0x286136[_0x258250(0x8a)]!==!0x1)this[_0x258250(0x95)]();}['log'](_0x4ecb0a){const _0x3921e1=a0_0x31d98e;console[_0x3921e1(0xbc)]('['+new Date()[_0x3921e1(0x91)]()[_0x3921e1(0xbb)](0x0,0x8)+_0x3921e1(0xa1)+this['alias']+']\x20'+_0x4ecb0a);}async[a0_0x31d98e(0x76)](_0x448448,_0x2fbd04){const _0x253b61=a0_0x31d98e;let _0x932f35={'Content-Type':'application/json','Accept':_0x253b61(0x77)};if(this['token'])_0x932f35['Authorization']=_0x253b61(0x6c)+this[_0x253b61(0xa7)];let _0x58ff48=await(await fetch(this[_0x253b61(0x72)]+_0x253b61(0x98),{'method':_0x253b61(0xa9),'headers':_0x932f35,'body':JSON['stringify']({'jsonrpc':_0x253b61(0x99),'id':Date['now'](),'method':_0x253b61(0x6d),'params':{'name':_0x448448,'arguments':_0x2fbd04}})}))[_0x253b61(0xab)](),_0x1687be=_0x58ff48[_0x253b61(0x74)](/data: (.+)/),_0xbc247c=_0x1687be?JSON[_0x253b61(0xb0)](_0x1687be[0x1]):JSON[_0x253b61(0xb0)](_0x58ff48),_0x98ba97=_0xbc247c?.[_0x253b61(0x7f)]?.['content']?.[0x0]?.['text'];return _0x98ba97?JSON[_0x253b61(0xb0)](_0x98ba97):_0xbc247c;}async[a0_0x31d98e(0x95)](){const _0x54dd0c=a0_0x31d98e;if(this['running'])return;this[_0x54dd0c(0x9b)]=!0x0,await this[_0x54dd0c(0xc1)](_0x54dd0c(0xbf)),this[_0x54dd0c(0xbc)](_0x54dd0c(0xb3)),this[_0x54dd0c(0xb4)]=setInterval(()=>{const _0x571387=_0x54dd0c;this['status'](_0x571387(0xbf))[_0x571387(0x88)](_0x184d5f=>this[_0x571387(0xbc)]('heartbeat\x20failed:\x20'+_0x184d5f[_0x571387(0x79)]));},this['heartbeatInterval']),this[_0x54dd0c(0x83)]();}async[a0_0x31d98e(0x82)](){const _0x9dd432=a0_0x31d98e;if(this[_0x9dd432(0x9b)]=!0x1,this['sseAbort']?.[_0x9dd432(0x9c)](),this[_0x9dd432(0xb4)])clearInterval(this[_0x9dd432(0xb4)]);await this[_0x9dd432(0xc1)](_0x9dd432(0x7b))[_0x9dd432(0x88)](()=>{}),this[_0x9dd432(0xbc)](_0x9dd432(0xba));}async[a0_0x31d98e(0x67)](_0x6c1ed1,_0x2fe569,_0x53e4ad=a0_0x31d98e(0x7d)){const _0x5b6bb5=a0_0x31d98e;return this[_0x5b6bb5(0x76)](_0x5b6bb5(0xa2),{'alias':_0x6c1ed1,'task':_0x2fe569,'priority':_0x53e4ad,'from_session':this[_0x5b6bb5(0x8e)]});}async['message'](_0x33fb2e,_0x14d359){const _0x47328d=a0_0x31d98e;return this[_0x47328d(0x76)]('send_message',{'alias':_0x33fb2e,'message':_0x14d359,'from_session':this[_0x47328d(0x8e)]});}async[a0_0x31d98e(0x75)](_0x3a3974,_0x182cb6,_0x171bcb='completed'){const _0x120421=a0_0x31d98e;return this[_0x120421(0x76)](_0x120421(0x8f),{'in_reply_to':_0x3a3974,'text':_0x182cb6,'status':_0x171bcb});}async['status'](_0x34e56c,_0x263ba7){const _0x1cdac5=a0_0x31d98e;return this[_0x1cdac5(0x76)](_0x1cdac5(0x9f),{'resume_id':this[_0x1cdac5(0xb6)],'alias':this[_0x1cdac5(0x8e)],'status':_0x34e56c,'server':a0_0xa6a4a6(),'hostname':a0_0xa6a4a6(),'agent':this[_0x1cdac5(0x7c)],'project_dir':process[_0x1cdac5(0xb1)](),..._0x263ba7});}async[a0_0x31d98e(0xb9)](){const _0x520fcb=a0_0x31d98e;return this[_0x520fcb(0x76)](_0x520fcb(0xb2),{});}async[a0_0x31d98e(0xad)](_0x1c41d1,_0x40d3cd){const _0x541c85=a0_0x31d98e;return this[_0x541c85(0x76)](_0x541c85(0xad),{'message':_0x1c41d1,'filter_server':_0x40d3cd?.[_0x541c85(0x81)],'filter_status':_0x40d3cd?.[_0x541c85(0xc1)]});}async['connectSSE'](){const _0x8ed69a=a0_0x31d98e;let _0x35f42c=encodeURIComponent(this[_0x8ed69a(0x8e)]),_0x120986=this['url']+_0x8ed69a(0x73)+_0x35f42c,_0x783da4=this[_0x8ed69a(0x97)];while(this[_0x8ed69a(0x9b)]){try{this[_0x8ed69a(0x86)]=new AbortController();let _0x4a133a={'Accept':'text/event-stream'};if(this[_0x8ed69a(0xa7)])_0x4a133a[_0x8ed69a(0xb5)]=_0x8ed69a(0x6c)+this[_0x8ed69a(0xa7)];let _0x39f323=await fetch(_0x120986,{'headers':_0x4a133a,'signal':this['sseAbort'][_0x8ed69a(0xae)]});if(!_0x39f323['ok']||!_0x39f323['body']){this['log'](_0x8ed69a(0x8d)+_0x39f323['status']),await this[_0x8ed69a(0xa6)](_0x783da4),_0x783da4=Math[_0x8ed69a(0x6e)](_0x783da4*1.5,0xea60);continue;}_0x783da4=this[_0x8ed69a(0x97)];let _0x15fac4=_0x39f323[_0x8ed69a(0x9a)][_0x8ed69a(0x69)](),_0x34e03e=new TextDecoder(),_0x10a34a='';while(this[_0x8ed69a(0x9b)]){let {done:_0x23d294,value:_0x1bf825}=await _0x15fac4['read']();if(_0x23d294)break;_0x10a34a+=_0x34e03e[_0x8ed69a(0xa8)](_0x1bf825,{'stream':!0x0});let _0x727e56=_0x10a34a[_0x8ed69a(0x71)]('\x0a');_0x10a34a=_0x727e56[_0x8ed69a(0x87)]()||'';for(let _0x21fa55 of _0x727e56){if(!_0x21fa55[_0x8ed69a(0x96)](_0x8ed69a(0x6f)))continue;try{let _0x49e68e=JSON[_0x8ed69a(0xb0)](_0x21fa55[_0x8ed69a(0xbb)](0x6));if(_0x49e68e[_0x8ed69a(0xc0)]===_0x8ed69a(0x8c)){this[_0x8ed69a(0xbc)](_0x8ed69a(0x78)),this[_0x8ed69a(0x80)](_0x8ed69a(0x8c));continue;}if(_0x49e68e[_0x8ed69a(0xc0)]==='new_task'||_0x49e68e[_0x8ed69a(0xc0)]===_0x8ed69a(0xb7)||_0x49e68e['type']===_0x8ed69a(0xad))await this[_0x8ed69a(0xaf)]();}catch{}}}}catch(_0x452c31){if(_0x452c31[_0x8ed69a(0x6a)]==='AbortError')break;this[_0x8ed69a(0x80)](_0x8ed69a(0xa0),_0x452c31),this[_0x8ed69a(0xbc)]('SSE\x20error:\x20'+_0x452c31[_0x8ed69a(0x79)]);}if(this[_0x8ed69a(0x9b)])this[_0x8ed69a(0x80)]('disconnected'),this['log'](_0x8ed69a(0xaa)+_0x783da4/0x3e8+_0x8ed69a(0x94)),await this[_0x8ed69a(0xa6)](_0x783da4),_0x783da4=Math[_0x8ed69a(0x6e)](_0x783da4*1.5,0xea60);}}async['processInbox'](){const _0x6ef440=a0_0x31d98e;try{let _0x4c3152=(await this[_0x6ef440(0x76)](_0x6ef440(0xbe),{'alias':this[_0x6ef440(0x8e)],'limit':0xa}))?.[_0x6ef440(0xa5)]||[];for(let _0x3ef627 of _0x4c3152)await this[_0x6ef440(0x76)](_0x6ef440(0x93),{'alias':this['alias'],'message_id':_0x3ef627['id']}),this[_0x6ef440(0xbc)]('←\x20'+_0x3ef627[_0x6ef440(0x6b)]+':\x20'+_0x3ef627[_0x6ef440(0x90)]['slice'](0x0,0x3c)),this['emit'](_0x6ef440(0xa4),_0x3ef627),this[_0x6ef440(0x80)]('message',_0x3ef627);}catch(_0x1a99b2){this[_0x6ef440(0xbc)](_0x6ef440(0x9d)+_0x1a99b2['message']);}}[a0_0x31d98e(0xa6)](_0x1fc5c3){return new Promise(_0x1518bb=>setTimeout(_0x1518bb,_0x1fc5c3));}}var $=T;export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
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());
2
+ const a0_0x99d77c=a0_0x4332;(function(_0xea57f7,_0x8b2ba4){const _0x518bd0=a0_0x4332,_0x42179f=_0xea57f7();while(!![]){try{const _0x583fa6=parseInt(_0x518bd0(0x12c))/0x1*(parseInt(_0x518bd0(0xce))/0x2)+parseInt(_0x518bd0(0xfe))/0x3+parseInt(_0x518bd0(0x136))/0x4+-parseInt(_0x518bd0(0xf2))/0x5+-parseInt(_0x518bd0(0xd3))/0x6+-parseInt(_0x518bd0(0xb6))/0x7+-parseInt(_0x518bd0(0x145))/0x8*(-parseInt(_0x518bd0(0xdf))/0x9);if(_0x583fa6===_0x8b2ba4)break;else _0x42179f['push'](_0x42179f['shift']());}catch(_0x30ab6c){_0x42179f['push'](_0x42179f['shift']());}}}(a0_0x3efd,0xeaaa7));import{readFileSync as a0_0x33e575,existsSync as a0_0x538ae4}from'fs';import{randomUUID as a0_0x15be60}from'crypto';import{join as a0_0x3ebf34}from'path';import{hostname as a0_0x4c81e0}from'os';import{execSync as a0_0x49d0dd}from'child_process';import{Server as a0_0x10b097}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x4efcd7}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x4d5341,CallToolRequestSchema as a0_0x2b8731}from'@modelcontextprotocol/sdk/types.js';function p(_0x470ab7){const _0x4023bd=a0_0x4332;if(!a0_0x538ae4(_0x470ab7))return;for(let _0xe78da7 of a0_0x33e575(_0x470ab7,_0x4023bd(0xd1))[_0x4023bd(0xc2)]('\x0a')){let _0x121cf9=_0xe78da7['trim']();if(!_0x121cf9||_0x121cf9['startsWith']('#'))continue;let _0x3b7750=_0x121cf9[_0x4023bd(0xfb)]('=');if(_0x3b7750<0x0)continue;let _0x1b81ad=_0x121cf9['slice'](0x0,_0x3b7750)['trim'](),_0xce2a=_0x121cf9['slice'](_0x3b7750+0x1)[_0x4023bd(0x103)]()[_0x4023bd(0x126)](/^["']|["']$/g,'');if(!process.env[_0x1b81ad])process.env[_0x1b81ad]=_0xce2a;}}var C=process.env.HOME||'~',T=a0_0x3ebf34(C,a0_0x99d77c(0x11c));p(a0_0x3ebf34(T,a0_0x99d77c(0xe7)));var L=process[a0_0x99d77c(0xb7)]()[a0_0x99d77c(0x126)](/\//g,'-');p(a0_0x3ebf34(T,L,'.env'));function U(){const _0xf6561b=a0_0x99d77c;try{return a0_0x49d0dd(_0xf6561b(0x124),{'encoding':_0xf6561b(0xd1),'timeout':0x7d0})[_0xf6561b(0x103)]();}catch{return'';}}function v(){const _0x2b3df1=a0_0x99d77c;try{let _0xd36043=a0_0x3ebf34(C,_0x2b3df1(0xcd),'config.json');if(a0_0x538ae4(_0xd36043))return JSON['parse'](a0_0x33e575(_0xd36043,_0x2b3df1(0xd1)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x99d77c(0xb4)]||'http://127.0.0.1:9200',j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x4c81e0(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x15be60(),X=process.env.COMMHUB_TOKEN||H[a0_0x99d77c(0xc6)]||'';function Y(_0x3450ca){const _0x96492b=a0_0x99d77c;let _0x515103=new Date()[_0x96492b(0x147)]()[_0x96492b(0xe2)](0x0,0x8);process[_0x96492b(0x109)]['write']('['+_0x515103+']\x20[commhub]\x20'+_0x3450ca+'\x0a');}function h(_0x342879){return new Promise(_0x311e2f=>setTimeout(_0x311e2f,_0x342879));}Y('ENV:\x20URL='+f+a0_0x99d77c(0xc5)+Z+a0_0x99d77c(0xde)+w[a0_0x99d77c(0xe2)](0x0,0x8)+a0_0x99d77c(0x10b)+(j||a0_0x99d77c(0xd8))+a0_0x99d77c(0x12f)+process[a0_0x99d77c(0xb7)]()+a0_0x99d77c(0xc7)+L);var k=new Map(),K=new a0_0x10b097({'name':a0_0x99d77c(0x132),'version':a0_0x99d77c(0x10f)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x99d77c(0x138),a0_0x99d77c(0x131),a0_0x99d77c(0x133),a0_0x99d77c(0x140),a0_0x99d77c(0xe0)+Z][a0_0x99d77c(0xfc)]('\x0a')});K['setRequestHandler'](a0_0x4d5341,async()=>({'tools':[{'name':a0_0x99d77c(0xc4),'description':a0_0x99d77c(0xf9),'inputSchema':{'type':a0_0x99d77c(0x137),'properties':{'task_id':{'type':'string','description':a0_0x99d77c(0xbe)},'text':{'type':a0_0x99d77c(0x10a),'description':a0_0x99d77c(0x130)},'status':{'type':a0_0x99d77c(0x10a),'enum':[a0_0x99d77c(0xd7),'failed',a0_0x99d77c(0xcf),'blocked',a0_0x99d77c(0x100),a0_0x99d77c(0xf0)],'description':a0_0x99d77c(0xc1)}},'required':[a0_0x99d77c(0xbf)]}},{'name':a0_0x99d77c(0x12e),'description':a0_0x99d77c(0x116),'inputSchema':{'type':a0_0x99d77c(0x137),'properties':{'status':{'type':a0_0x99d77c(0x10a),'enum':[a0_0x99d77c(0x146),'idle',a0_0x99d77c(0xda),a0_0x99d77c(0x100)]},'task':{'type':'string','description':'Current\x20task\x20description'},'progress':{'type':a0_0x99d77c(0x114),'description':a0_0x99d77c(0x11b)}},'required':[a0_0x99d77c(0x127)]}},{'name':a0_0x99d77c(0x13a),'description':a0_0x99d77c(0xdc),'inputSchema':{'type':a0_0x99d77c(0x137),'properties':{'alias':{'type':a0_0x99d77c(0x10a),'description':a0_0x99d77c(0x10d)},'task':{'type':'string','description':'Task\x20content'},'priority':{'type':'string','enum':[a0_0x99d77c(0xf1),'normal',a0_0x99d77c(0x118)],'description':a0_0x99d77c(0x112)}},'required':[a0_0x99d77c(0x125),a0_0x99d77c(0x10e)]}},{'name':a0_0x99d77c(0xd5),'description':a0_0x99d77c(0xd0),'inputSchema':{'type':a0_0x99d77c(0x137),'properties':{'alias':{'type':a0_0x99d77c(0x10a),'description':'Target\x20session\x20alias'},'message':{'type':a0_0x99d77c(0x10a),'description':a0_0x99d77c(0xfa)}},'required':['alias',a0_0x99d77c(0x102)]}},{'name':'commhub_get_all_status','description':'Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','inputSchema':{'type':'object','properties':{}}}]}));async function P(_0x126906,_0x206ec6){const _0x3eaacc=a0_0x99d77c;let _0x52d20a=await fetch(f+_0x3eaacc(0x128),{'method':_0x3eaacc(0xf3),'headers':{'Content-Type':_0x3eaacc(0x110),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x3eaacc(0x119),'id':0x1,'method':_0x3eaacc(0x142),'params':{'protocolVersion':_0x3eaacc(0xca),'capabilities':{},'clientInfo':{'name':_0x3eaacc(0x132),'version':_0x3eaacc(0x10f)}}})});if(!_0x52d20a['ok']){let _0xc2b815=await _0x52d20a['text']();return Y('CommHub\x20init\x20failed:\x20'+_0x52d20a[_0x3eaacc(0x127)]+'\x20'+_0xc2b815[_0x3eaacc(0xe2)](0x0,0x64)),{'ok':!0x1,'error':_0x3eaacc(0xef)+_0x52d20a[_0x3eaacc(0x127)]};}await _0x52d20a[_0x3eaacc(0xbf)]();let _0x1adfae=(await(await fetch(f+_0x3eaacc(0x128),{'method':_0x3eaacc(0xf3),'headers':{'Content-Type':_0x3eaacc(0x110),'Accept':_0x3eaacc(0xeb),...X?{'Authorization':_0x3eaacc(0xee)+X}:{}},'body':JSON[_0x3eaacc(0x104)]({'jsonrpc':'2.0','id':0x2,'method':_0x3eaacc(0x11a),'params':{'name':_0x126906,'arguments':_0x206ec6}})}))['text']())[_0x3eaacc(0xc2)]('\x0a')[_0x3eaacc(0x122)](_0x3ee64e=>_0x3ee64e[_0x3eaacc(0xe5)](_0x3eaacc(0xc9)));if(_0x1adfae){let _0x3cf360=JSON['parse'](_0x1adfae[_0x3eaacc(0xe2)](0x6));return _0x3cf360?.['result']?.['content']?.[0x0]?.[_0x3eaacc(0xbf)]?JSON[_0x3eaacc(0xba)](_0x3cf360['result']['content'][0x0][_0x3eaacc(0xbf)]):_0x3cf360;}return{'ok':!0x1,'error':_0x3eaacc(0xb5)};}function a0_0x3efd(){const _0x681fec=['Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','pop','commhub_send_task','set','getReader','get_all_status','SSE\x20connected\x20as\x20\x22','SSE\x20stream\x20ended,\x20reconnecting...','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','message_id','initialize','SIGINT','type','8CQDiFr','working','toTimeString','hub','no\x20response','6004341GMlLMN','cwd','new_message','decode','parse','parse\x20error:\x20','normal','connect','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','text','inbox_count','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','split','failed','commhub_reply','\x20ALIAS=','token','\x20PROJECT_ENV=','report_status','data:\x20','2025-03-26','notifications/claude/channel','send_task','.anet','6ICYPES','cancelled','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','utf-8','ack_inbox','9801930zqblCj','new_task','commhub_send_message','read','completed','none','\x20priority=','blocked','unknown\x20tool','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','claude-code','\x20RESUME_ID=','32340915yjdYrM','Session\x20alias:\x20','priority','slice','connected','setRequestHandler','startsWith','\x22\x20(','.env','from_session','send_message','SSE\x20connection\x20error:\x20','application/json,\x20text/event-stream','get','length','Bearer\x20','init\x20failed:\x20','in_progress','high','7003265XyEryI','POST','catch','stdin','idle','starting\x20SSE\x20listener...','commhub','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','Message\x20content','indexOf','join','broadcast','173766BXjuqc','then','error','/events/','message','trim','stringify','heartbeat\x20failed:\x20','notification','exit','SIGTERM','stderr','string','...\x20TMUX=','body','Target\x20session\x20alias','task','0.3.0','application/json','MCP\x20stdio\x20connected','Priority\x20(default:\x20normal)','\x20from\x20','number','fatal:\x20','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','end','low','2.0','tools/call','Progress\x200-100','.claude/channels/commhub','Authorization','session\x20disconnected','commhub_get_all_status','replied','content','find','params','tmux\x20display-message\x20-p\x20\x27#S\x27','alias','replace','status','/mcp','from','connecting\x20to\x20','registered\x20as\x20\x22','222062pcZkSp','←\x20message\x20from\x20','commhub_report_status','\x20CWD=','Reply\x20text\x20/\x20result\x20summary','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','commhub-channel','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','shutting\x20down,\x20reporting\x20offline...','ready\x20—\x20waiting\x20for\x20events','2142876mZacyr','object'];a0_0x3efd=function(){return _0x681fec;};return a0_0x3efd();}K[a0_0x99d77c(0xe4)](a0_0x2b8731,async _0x27bcfd=>{const _0x4c79d6=a0_0x99d77c;let {name:_0x39905d,arguments:_0x274f22}=_0x27bcfd[_0x4c79d6(0x123)];if(_0x39905d===_0x4c79d6(0xc4)){let {task_id:_0x106c00,text:_0x5531e9,status:_0x5af010}=_0x274f22;if(_0x5af010===_0x4c79d6(0xd7)||_0x5af010===_0x4c79d6(0xc3)||_0x5af010===_0x4c79d6(0xcf)){let _0x2badec=_0x5af010===_0x4c79d6(0xd7)?_0x4c79d6(0x120):_0x5af010,_0x19a326=_0x106c00?k[_0x4c79d6(0xec)](_0x106c00)||'hub':_0x4c79d6(0xb4),_0x36efa9=await P('send_reply',{'alias':_0x19a326,'text':_0x5531e9,'in_reply_to':_0x106c00||void 0x0,'status':_0x2badec,'from_session':Z});if(_0x106c00)k['delete'](_0x106c00);return{'content':[{'type':'text','text':JSON['stringify'](_0x36efa9)}]};}let _0x1e7504=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x5af010===_0x4c79d6(0xda)?_0x4c79d6(0xda):_0x5af010===_0x4c79d6(0x100)?_0x4c79d6(0x100):'working','task':_0x5531e9['slice'](0x0,0xc8),'output':_0x5531e9});return{'content':[{'type':_0x4c79d6(0xbf),'text':JSON['stringify'](_0x1e7504)}]};}if(_0x39905d===_0x4c79d6(0x12e)){let {status:_0x2db757,task:_0x11a957,progress:_0x50d784}=_0x274f22,_0x1ba2b0=await P(_0x4c79d6(0xc8),{'resume_id':w,'alias':Z,'status':_0x2db757,'task':_0x11a957,'progress':_0x50d784});return{'content':[{'type':_0x4c79d6(0xbf),'text':JSON['stringify'](_0x1ba2b0)}]};}if(_0x39905d==='commhub_send_task'){let {alias:_0x191040,task:_0xb23e2,priority:_0xdd5818}=_0x274f22,_0x3999f2=await P(_0x4c79d6(0xcc),{'alias':_0x191040,'task':_0xb23e2,'priority':_0xdd5818||_0x4c79d6(0xbc),'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x4c79d6(0x104)](_0x3999f2)}]};}if(_0x39905d===_0x4c79d6(0xd5)){let {alias:_0x3b4572,message:_0x11e72d}=_0x274f22,_0xfdea5e=await P(_0x4c79d6(0xe9),{'alias':_0x3b4572,'message':_0x11e72d,'from_session':Z});return{'content':[{'type':_0x4c79d6(0xbf),'text':JSON[_0x4c79d6(0x104)](_0xfdea5e)}]};}if(_0x39905d===_0x4c79d6(0x11f)){let _0x543913=await P(_0x4c79d6(0x13d),{});return{'content':[{'type':_0x4c79d6(0xbf),'text':JSON['stringify'](_0x543913)}]};}return{'content':[{'type':_0x4c79d6(0xbf),'text':JSON[_0x4c79d6(0x104)]({'error':_0x4c79d6(0xdb)})}]};});function a0_0x4332(_0x288cec,_0x3a210a){_0x288cec=_0x288cec-0xb4;const _0x3efdca=a0_0x3efd();let _0x4332d4=_0x3efdca[_0x288cec];return _0x4332d4;}async function u(){const _0x5349c5=a0_0x99d77c;let _0xe90fc1=f+_0x5349c5(0x101)+encodeURIComponent(Z),_0x49b56b={};if(X)_0x49b56b[_0x5349c5(0x11d)]=_0x5349c5(0xee)+X;Y(_0x5349c5(0x12a)+_0xe90fc1);while(!0x0){try{let _0x594fcb=await fetch(_0xe90fc1,{'headers':_0x49b56b});if(!_0x594fcb['ok']){Y('SSE\x20error:\x20'+_0x594fcb['status']+'\x20'+_0x594fcb['statusText']),await h(0x1388);continue;}let _0xd7bdfc=_0x594fcb[_0x5349c5(0x10c)][_0x5349c5(0x13c)](),_0x1ce02a=new TextDecoder(),_0x4b571c='';while(!0x0){let {done:_0x2a415a,value:_0x335c4b}=await _0xd7bdfc[_0x5349c5(0xd6)]();if(_0x2a415a)break;_0x4b571c+=_0x1ce02a[_0x5349c5(0xb9)](_0x335c4b,{'stream':!0x0});let _0x4f0e40=_0x4b571c['split']('\x0a\x0a');_0x4b571c=_0x4f0e40[_0x5349c5(0x139)]()||'';for(let _0x3dd167 of _0x4f0e40){let _0x3fc79c=_0x3dd167[_0x5349c5(0xc2)]('\x0a')['find'](_0xcb4f9c=>_0xcb4f9c[_0x5349c5(0xe5)]('data:\x20'));if(!_0x3fc79c)continue;try{let _0x2dd9dd=JSON[_0x5349c5(0xba)](_0x3fc79c[_0x5349c5(0xe2)](0x6));await S(_0x2dd9dd);}catch(_0x218ba2){Y(_0x5349c5(0xbb)+_0x218ba2);}}}Y(_0x5349c5(0x13f));}catch(_0x2cae52){Y(_0x5349c5(0xea)+_0x2cae52);}await h(0xbb8);}}async function S(_0x29cafe){const _0x36ec1b=a0_0x99d77c;if(_0x29cafe['type']===_0x36ec1b(0xe3)){Y(_0x36ec1b(0x13e)+Z+'\x22');return;}if(_0x29cafe['type']===_0x36ec1b(0xb8)){if(Y(_0x36ec1b(0x12d)+_0x29cafe['from']+':\x20'+_0x29cafe['message']['slice'](0x0,0x3c)),await K[_0x36ec1b(0x106)]({'method':_0x36ec1b(0xcb),'params':{'content':_0x29cafe['message'],'meta':{'sender':_0x29cafe[_0x36ec1b(0x129)]||_0x36ec1b(0xb4),'sender_id':_0x36ec1b(0xf8),'user':_0x29cafe[_0x36ec1b(0x129)]||_0x36ec1b(0xb4),'priority':_0x36ec1b(0xbc)}}}),_0x29cafe[_0x36ec1b(0x141)])await P(_0x36ec1b(0xd2),{'alias':Z,'message_id':_0x29cafe[_0x36ec1b(0x141)]});return;}if(_0x29cafe[_0x36ec1b(0x144)]===_0x36ec1b(0xd4)||_0x29cafe[_0x36ec1b(0x144)]===_0x36ec1b(0xfd)){Y('←\x20'+_0x29cafe[_0x36ec1b(0x144)]+':\x20inbox_count='+_0x29cafe[_0x36ec1b(0xc0)]+_0x36ec1b(0xd9)+(_0x29cafe[_0x36ec1b(0xe1)]||'normal'));let _0x5a11c6=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0x5a11c6?.['ok']&&_0x5a11c6['messages']?.[_0x36ec1b(0xed)]>0x0)for(let _0x466cf5 of _0x5a11c6['messages']){let _0x4df314={'sender':_0x466cf5[_0x36ec1b(0xe8)]||_0x36ec1b(0xb4),'sender_id':'commhub','user':_0x466cf5[_0x36ec1b(0xe8)]||_0x36ec1b(0xb4),'task_id':_0x466cf5['id'],'priority':_0x466cf5['priority']||_0x36ec1b(0xbc)};k[_0x36ec1b(0x13b)](_0x466cf5['id'],_0x466cf5[_0x36ec1b(0xe8)]||_0x36ec1b(0xb4)),await K[_0x36ec1b(0x106)]({'method':_0x36ec1b(0xcb),'params':{'content':_0x466cf5['content'],'meta':_0x4df314}}),Y('→\x20injected\x20task\x20'+_0x466cf5['id'][_0x36ec1b(0xe2)](0x0,0x8)+_0x36ec1b(0x113)+_0x466cf5[_0x36ec1b(0xe8)]+':\x20'+_0x466cf5[_0x36ec1b(0x121)][_0x36ec1b(0xe2)](0x0,0x3c)),await P(_0x36ec1b(0xd2),{'alias':Z,'message_id':_0x466cf5['id']});}}}async function A(){const _0x3ef178=a0_0x99d77c;let _0x50edf4=new a0_0x4efcd7();await K[_0x3ef178(0xbd)](_0x50edf4),Y(_0x3ef178(0x111)),Y(_0x3ef178(0xf7)),u()[_0x3ef178(0xf4)](_0x1d43f6=>Y('SSE\x20fatal:\x20'+_0x1d43f6)),P(_0x3ef178(0xc8),{'resume_id':w,'alias':Z,'status':_0x3ef178(0xf6),'server':a0_0x4c81e0(),'hostname':a0_0x4c81e0(),'agent':_0x3ef178(0xdd),'project_dir':process['cwd'](),'tmux_name':j||void 0x0})[_0x3ef178(0xff)](()=>Y(_0x3ef178(0x12b)+Z+_0x3ef178(0xe6)+w[_0x3ef178(0xe2)](0x0,0x8)+')'))[_0x3ef178(0xf4)](_0x2df1f1=>Y('warning:\x20could\x20not\x20register:\x20'+_0x2df1f1)),setInterval(()=>{const _0x486402=_0x3ef178;P(_0x486402(0xc8),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x4c81e0(),'hostname':a0_0x4c81e0(),'agent':_0x486402(0xdd),'project_dir':process[_0x486402(0xb7)](),'tmux_name':j||void 0x0})[_0x486402(0xf4)](_0x17a40a=>Y(_0x486402(0x105)+_0x17a40a));},0x2bf20),Y(_0x3ef178(0x135));}A()[a0_0x99d77c(0xf4)](_0x33887e=>{const _0x1fadeb=a0_0x99d77c;Y(_0x1fadeb(0x115)+_0x33887e),process['exit'](0x1);});async function N(){const _0x850e9b=a0_0x99d77c;Y(_0x850e9b(0x134)),await P(_0x850e9b(0xc8),{'resume_id':w,'alias':Z,'status':_0x850e9b(0x100),'task':_0x850e9b(0x11e)})['catch'](()=>{}),process[_0x850e9b(0x107)](0x0);}process[a0_0x99d77c(0xf5)]['on'](a0_0x99d77c(0x117),()=>N()),process['on'](a0_0x99d77c(0x108),()=>N()),process['on'](a0_0x99d77c(0x143),()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.1.15-preview.4",
3
+ "version": "2.1.15-preview.6",
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",