@sleep2agi/agent-network 2.1.15-preview.5 → 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
- function a0_0x2f92(_0x83de4,_0x21682f){_0x83de4=_0x83de4-0xcb;const _0x5ae492=a0_0x5ae4();let _0x2f92d3=_0x5ae492[_0x83de4];return _0x2f92d3;}const a0_0x417a73=a0_0x2f92;(function(_0x3c50cb,_0x2263f0){const _0x5335eb=a0_0x2f92,_0x5386a4=_0x3c50cb();while(!![]){try{const _0x444adc=parseInt(_0x5335eb(0xef))/0x1*(-parseInt(_0x5335eb(0x10d))/0x2)+parseInt(_0x5335eb(0x11f))/0x3+-parseInt(_0x5335eb(0xd1))/0x4*(-parseInt(_0x5335eb(0x118))/0x5)+-parseInt(_0x5335eb(0x105))/0x6*(-parseInt(_0x5335eb(0xf1))/0x7)+-parseInt(_0x5335eb(0xf0))/0x8*(-parseInt(_0x5335eb(0x11b))/0x9)+-parseInt(_0x5335eb(0xd4))/0xa+parseInt(_0x5335eb(0xe1))/0xb*(-parseInt(_0x5335eb(0xf6))/0xc);if(_0x444adc===_0x2263f0)break;else _0x5386a4['push'](_0x5386a4['shift']());}catch(_0x131302){_0x5386a4['push'](_0x5386a4['shift']());}}}(a0_0x5ae4,0x42fe1));import{EventEmitter as a0_0x5baffe}from'events';function a0_0x5ae4(){const _0x507ebf=['AbortError','1092dtWjbB','send_message','error','626470JEIcoU','reply','Bearer\x20','registered','slice','call','read','decode','SSE\x20connected','task','completed','broadcast','running','751531hjirBy','message','emit','now','catch','token','getAllStatus','application/json','heartbeatInterval','offline','signal','send_task','sleep','content','186CnTcIL','2423576yIorIi','26327htUjCf','replace','report_status','s...','server','72noHejh','abort','send',']\x20[commhub:','idle','Authorization','from_session','processInbox','cwd','startsWith','split','resumeId','min','match','normal','408CjYmwP','reconnectDelay','disconnected','data:\x20','new_message','alias','status','sdk-','42JKaIBo','/mcp','send_reply','log','result','connect','connectSSE','connected','SSE\x20reconnecting\x20in\x20','type','parse','3155pOTcWu','text','sseAbort','9rHjdmH','inbox\x20error:\x20','stringify','url','59766lXaZUT','heartbeatTimer','ack_inbox','application/json,\x20text/event-stream','SSE\x20error:\x20','name','agent','text/event-stream'];a0_0x5ae4=function(){return _0x507ebf;};return a0_0x5ae4();}import{hostname as a0_0x3864dd}from'os';class T extends a0_0x5baffe{[a0_0x417a73(0x11e)];[a0_0x417a73(0x10a)];[a0_0x417a73(0xe6)];[a0_0x417a73(0xce)];['resumeId'];[a0_0x417a73(0xe9)];[a0_0x417a73(0x106)];[a0_0x417a73(0x120)];[a0_0x417a73(0x11a)];[a0_0x417a73(0xe0)]=!0x1;constructor(_0x399b6f){const _0x298687=a0_0x417a73;super();if(this[_0x298687(0x11e)]=_0x399b6f[_0x298687(0x11e)][_0x298687(0xf2)](/\/$/,''),this[_0x298687(0x10a)]=_0x399b6f[_0x298687(0x10a)],this[_0x298687(0xe6)]=_0x399b6f[_0x298687(0xe6)],this['agent']=_0x399b6f[_0x298687(0xce)]||'sdk',this[_0x298687(0x101)]=_0x298687(0x10c)+_0x399b6f['alias']+'-'+Date[_0x298687(0xe4)]()['toString'](0x24),this[_0x298687(0xe9)]=_0x399b6f['heartbeatInterval']??0x2bf20,this[_0x298687(0x106)]=_0x399b6f[_0x298687(0x106)]??0xbb8,_0x399b6f['autoConnect']!==!0x1)this['connect']();}[a0_0x417a73(0x110)](_0xa1cce6){const _0x36180a=a0_0x417a73;console['log']('['+new Date()['toTimeString']()[_0x36180a(0xd8)](0x0,0x8)+_0x36180a(0xf9)+this[_0x36180a(0x10a)]+']\x20'+_0xa1cce6);}async['call'](_0x68273c,_0x428fd3){const _0xebd738=a0_0x417a73;let _0x537ea4={'Content-Type':_0xebd738(0xe8),'Accept':_0xebd738(0xcb)};if(this[_0xebd738(0xe6)])_0x537ea4[_0xebd738(0xfb)]='Bearer\x20'+this[_0xebd738(0xe6)];let _0x3f4181=await(await fetch(this[_0xebd738(0x11e)]+_0xebd738(0x10e),{'method':'POST','headers':_0x537ea4,'body':JSON[_0xebd738(0x11d)]({'jsonrpc':'2.0','id':Date['now'](),'method':'tools/call','params':{'name':_0x68273c,'arguments':_0x428fd3}})}))[_0xebd738(0x119)](),_0x3ee1de=_0x3f4181[_0xebd738(0x103)](/data: (.+)/),_0x26a3b5=_0x3ee1de?JSON[_0xebd738(0x117)](_0x3ee1de[0x1]):JSON[_0xebd738(0x117)](_0x3f4181),_0x3671d2=_0x26a3b5?.[_0xebd738(0x111)]?.[_0xebd738(0xee)]?.[0x0]?.['text'];return _0x3671d2?JSON['parse'](_0x3671d2):_0x26a3b5;}async[a0_0x417a73(0x112)](){const _0x168fe3=a0_0x417a73;if(this[_0x168fe3(0xe0)])return;this[_0x168fe3(0xe0)]=!0x0,await this[_0x168fe3(0x10b)]('idle'),this[_0x168fe3(0x110)](_0x168fe3(0xd7)),this[_0x168fe3(0x120)]=setInterval(()=>{const _0x14d3f7=_0x168fe3;this[_0x14d3f7(0x10b)](_0x14d3f7(0xfa))[_0x14d3f7(0xe5)](_0x15a7a6=>this[_0x14d3f7(0x110)]('heartbeat\x20failed:\x20'+_0x15a7a6[_0x14d3f7(0xe2)]));},this[_0x168fe3(0xe9)]),this[_0x168fe3(0x113)]();}async['disconnect'](){const _0x2595db=a0_0x417a73;if(this[_0x2595db(0xe0)]=!0x1,this[_0x2595db(0x11a)]?.[_0x2595db(0xf7)](),this['heartbeatTimer'])clearInterval(this[_0x2595db(0x120)]);await this['status'](_0x2595db(0xea))['catch'](()=>{}),this[_0x2595db(0x110)](_0x2595db(0x107));}async[a0_0x417a73(0xf8)](_0x80f2aa,_0x1ad3de,_0x5755fe=a0_0x417a73(0x104)){const _0x2a570e=a0_0x417a73;return this[_0x2a570e(0xd9)](_0x2a570e(0xec),{'alias':_0x80f2aa,'task':_0x1ad3de,'priority':_0x5755fe,'from_session':this[_0x2a570e(0x10a)]});}async['message'](_0x176689,_0x375fe8){const _0x2736f6=a0_0x417a73;return this[_0x2736f6(0xd9)](_0x2736f6(0xd2),{'alias':_0x176689,'message':_0x375fe8,'from_session':this[_0x2736f6(0x10a)]});}async[a0_0x417a73(0xd5)](_0x4b8377,_0x4e1bb8,_0x236c19=a0_0x417a73(0xde)){const _0x218573=a0_0x417a73;return this[_0x218573(0xd9)](_0x218573(0x10f),{'in_reply_to':_0x4b8377,'text':_0x4e1bb8,'status':_0x236c19});}async['status'](_0x3e78fa,_0xfa3c57){const _0x61c30b=a0_0x417a73;return this[_0x61c30b(0xd9)](_0x61c30b(0xf3),{'resume_id':this[_0x61c30b(0x101)],'alias':this[_0x61c30b(0x10a)],'status':_0x3e78fa,'server':a0_0x3864dd(),'hostname':a0_0x3864dd(),'agent':this['agent'],'project_dir':process[_0x61c30b(0xfe)](),..._0xfa3c57});}async[a0_0x417a73(0xe7)](){const _0xc58e12=a0_0x417a73;return this[_0xc58e12(0xd9)]('get_all_status',{});}async[a0_0x417a73(0xdf)](_0x20146f,_0x451823){const _0x4c3255=a0_0x417a73;return this[_0x4c3255(0xd9)]('broadcast',{'message':_0x20146f,'filter_server':_0x451823?.[_0x4c3255(0xf5)],'filter_status':_0x451823?.[_0x4c3255(0x10b)]});}async[a0_0x417a73(0x113)](){const _0x1dc235=a0_0x417a73;let _0x56458a=encodeURIComponent(this[_0x1dc235(0x10a)]),_0x18be31=this[_0x1dc235(0x11e)]+'/events/'+_0x56458a,_0x3a43b7=this[_0x1dc235(0x106)];while(this['running']){try{this['sseAbort']=new AbortController();let _0x2c3a58={'Accept':_0x1dc235(0xcf)};if(this[_0x1dc235(0xe6)])_0x2c3a58['Authorization']=_0x1dc235(0xd6)+this[_0x1dc235(0xe6)];let _0x5da9f6=await fetch(_0x18be31,{'headers':_0x2c3a58,'signal':this[_0x1dc235(0x11a)][_0x1dc235(0xeb)]});if(!_0x5da9f6['ok']||!_0x5da9f6['body']){this[_0x1dc235(0x110)]('SSE\x20failed:\x20'+_0x5da9f6[_0x1dc235(0x10b)]),await this[_0x1dc235(0xed)](_0x3a43b7),_0x3a43b7=Math[_0x1dc235(0x102)](_0x3a43b7*1.5,0xea60);continue;}_0x3a43b7=this[_0x1dc235(0x106)];let _0x1e79a4=_0x5da9f6['body']['getReader'](),_0x598558=new TextDecoder(),_0x48afd4='';while(this[_0x1dc235(0xe0)]){let {done:_0x526b20,value:_0x3e00d9}=await _0x1e79a4[_0x1dc235(0xda)]();if(_0x526b20)break;_0x48afd4+=_0x598558[_0x1dc235(0xdb)](_0x3e00d9,{'stream':!0x0});let _0x5b0641=_0x48afd4[_0x1dc235(0x100)]('\x0a');_0x48afd4=_0x5b0641['pop']()||'';for(let _0x345308 of _0x5b0641){if(!_0x345308[_0x1dc235(0xff)](_0x1dc235(0x108)))continue;try{let _0xeadcc6=JSON['parse'](_0x345308['slice'](0x6));if(_0xeadcc6[_0x1dc235(0x116)]===_0x1dc235(0x114)){this[_0x1dc235(0x110)](_0x1dc235(0xdc)),this[_0x1dc235(0xe3)]('connected');continue;}if(_0xeadcc6[_0x1dc235(0x116)]==='new_task'||_0xeadcc6[_0x1dc235(0x116)]===_0x1dc235(0x109)||_0xeadcc6[_0x1dc235(0x116)]===_0x1dc235(0xdf))await this[_0x1dc235(0xfd)]();}catch{}}}}catch(_0x599158){if(_0x599158[_0x1dc235(0xcd)]===_0x1dc235(0xd0))break;this[_0x1dc235(0xe3)](_0x1dc235(0xd3),_0x599158),this[_0x1dc235(0x110)](_0x1dc235(0xcc)+_0x599158['message']);}if(this[_0x1dc235(0xe0)])this['emit'](_0x1dc235(0x107)),this[_0x1dc235(0x110)](_0x1dc235(0x115)+_0x3a43b7/0x3e8+_0x1dc235(0xf4)),await this[_0x1dc235(0xed)](_0x3a43b7),_0x3a43b7=Math['min'](_0x3a43b7*1.5,0xea60);}}async[a0_0x417a73(0xfd)](){const _0x5183e5=a0_0x417a73;try{let _0x13c677=(await this[_0x5183e5(0xd9)]('get_inbox',{'alias':this[_0x5183e5(0x10a)],'limit':0xa}))?.['messages']||[];for(let _0x2ccbbb of _0x13c677)await this[_0x5183e5(0xd9)](_0x5183e5(0x121),{'alias':this[_0x5183e5(0x10a)],'message_id':_0x2ccbbb['id']}),this[_0x5183e5(0x110)]('←\x20'+_0x2ccbbb[_0x5183e5(0xfc)]+':\x20'+_0x2ccbbb[_0x5183e5(0xee)][_0x5183e5(0xd8)](0x0,0x3c)),this[_0x5183e5(0xe3)](_0x5183e5(0xdd),_0x2ccbbb),this['emit']('message',_0x2ccbbb);}catch(_0x5ba342){this[_0x5183e5(0x110)](_0x5183e5(0x11c)+_0x5ba342[_0x5183e5(0xe2)]);}}[a0_0x417a73(0xed)](_0x35220e){return new Promise(_0x2ac8ff=>setTimeout(_0x2ac8ff,_0x35220e));}}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_0x334e5a=a0_0x17ab;(function(_0x3742f8,_0x2b7df5){const _0x59b2e5=a0_0x17ab,_0x557dbc=_0x3742f8();while(!![]){try{const _0x1e9c44=parseInt(_0x59b2e5(0x17f))/0x1*(-parseInt(_0x59b2e5(0x1c7))/0x2)+parseInt(_0x59b2e5(0x169))/0x3+parseInt(_0x59b2e5(0x1cc))/0x4+-parseInt(_0x59b2e5(0x1d7))/0x5+-parseInt(_0x59b2e5(0x1ad))/0x6*(-parseInt(_0x59b2e5(0x1dd))/0x7)+parseInt(_0x59b2e5(0x193))/0x8*(parseInt(_0x59b2e5(0x1cd))/0x9)+parseInt(_0x59b2e5(0x1d4))/0xa*(-parseInt(_0x59b2e5(0x192))/0xb);if(_0x1e9c44===_0x2b7df5)break;else _0x557dbc['push'](_0x557dbc['shift']());}catch(_0x659563){_0x557dbc['push'](_0x557dbc['shift']());}}}(a0_0x59f8,0xb9855));import{readFileSync as a0_0x142533,existsSync as a0_0x2c131b}from'fs';import{randomUUID as a0_0x26c0bb}from'crypto';import{join as a0_0x109bdc}from'path';import{hostname as a0_0x370ff1}from'os';import{execSync as a0_0x34928d}from'child_process';import{Server as a0_0x4e07bb}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x8bed26}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x5c3967,CallToolRequestSchema as a0_0x24829c}from'@modelcontextprotocol/sdk/types.js';function p(_0x17ca4e){const _0x5156d9=a0_0x17ab;if(!a0_0x2c131b(_0x17ca4e))return;for(let _0x1e16cb of a0_0x142533(_0x17ca4e,_0x5156d9(0x1cb))[_0x5156d9(0x167)]('\x0a')){let _0xbbc5df=_0x1e16cb[_0x5156d9(0x178)]();if(!_0xbbc5df||_0xbbc5df['startsWith']('#'))continue;let _0x562e84=_0xbbc5df[_0x5156d9(0x1b2)]('=');if(_0x562e84<0x0)continue;let _0x1b95df=_0xbbc5df['slice'](0x0,_0x562e84)[_0x5156d9(0x178)](),_0x4782b0=_0xbbc5df[_0x5156d9(0x1e5)](_0x562e84+0x1)['trim']()[_0x5156d9(0x19f)](/^["']|["']$/g,'');if(!process.env[_0x1b95df])process.env[_0x1b95df]=_0x4782b0;}}var C=process.env.HOME||'~',T=a0_0x109bdc(C,a0_0x334e5a(0x15e));p(a0_0x109bdc(T,a0_0x334e5a(0x1c3)));var L=process[a0_0x334e5a(0x1b8)]()[a0_0x334e5a(0x19f)](/\//g,'-');function a0_0x17ab(_0x51ab6b,_0x5eb41f){_0x51ab6b=_0x51ab6b-0x158;const _0x59f835=a0_0x59f8();let _0x17ab8e=_0x59f835[_0x51ab6b];return _0x17ab8e;}p(a0_0x109bdc(T,L,'.env'));function U(){const _0x4a891a=a0_0x334e5a;try{return a0_0x34928d(_0x4a891a(0x172),{'encoding':_0x4a891a(0x1cb),'timeout':0x7d0})[_0x4a891a(0x178)]();}catch{return'';}}function v(){const _0x20914e=a0_0x334e5a;try{let _0x2ab8a0=a0_0x109bdc(C,_0x20914e(0x1d3),_0x20914e(0x19c));if(a0_0x2c131b(_0x2ab8a0))return JSON['parse'](a0_0x142533(_0x2ab8a0,'utf-8'));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x334e5a(0x16f)]||a0_0x334e5a(0x1d2),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x370ff1(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x26c0bb(),X=process.env.COMMHUB_TOKEN||H[a0_0x334e5a(0x168)]||'';function Y(_0x30d588){const _0x5b9a70=a0_0x334e5a;let _0x124c2d=new Date()[_0x5b9a70(0x1ca)]()['slice'](0x0,0x8);process[_0x5b9a70(0x19b)][_0x5b9a70(0x1c4)]('['+_0x124c2d+_0x5b9a70(0x16c)+_0x30d588+'\x0a');}function h(_0x2dfacd){return new Promise(_0x117f1b=>setTimeout(_0x117f1b,_0x2dfacd));}Y(a0_0x334e5a(0x17d)+f+a0_0x334e5a(0x162)+Z+a0_0x334e5a(0x196)+w['slice'](0x0,0x8)+a0_0x334e5a(0x158)+(j||'none')+a0_0x334e5a(0x184)+process['cwd']()+a0_0x334e5a(0x19a)+L);var k=new Map(),K=new a0_0x4e07bb({'name':a0_0x334e5a(0x15a),'version':a0_0x334e5a(0x1e0)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x334e5a(0x1d9),a0_0x334e5a(0x1dc),a0_0x334e5a(0x1da),a0_0x334e5a(0x1a3),'Session\x20alias:\x20'+Z][a0_0x334e5a(0x190)]('\x0a')});K[a0_0x334e5a(0x1bd)](a0_0x5c3967,async()=>({'tools':[{'name':'commhub_reply','description':a0_0x334e5a(0x181),'inputSchema':{'type':a0_0x334e5a(0x1e7),'properties':{'task_id':{'type':a0_0x334e5a(0x1bc),'description':a0_0x334e5a(0x1c2)},'text':{'type':a0_0x334e5a(0x1bc),'description':a0_0x334e5a(0x1b3)},'status':{'type':a0_0x334e5a(0x1bc),'enum':['completed','failed',a0_0x334e5a(0x185),a0_0x334e5a(0x16b),a0_0x334e5a(0x1c1),'in_progress'],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':[a0_0x334e5a(0x1ba)]}},{'name':a0_0x334e5a(0x1ae),'description':a0_0x334e5a(0x1a4),'inputSchema':{'type':'object','properties':{'status':{'type':'string','enum':[a0_0x334e5a(0x1c9),a0_0x334e5a(0x1c6),a0_0x334e5a(0x16b),'error']},'task':{'type':a0_0x334e5a(0x1bc),'description':'Current\x20task\x20description'},'progress':{'type':a0_0x334e5a(0x182),'description':a0_0x334e5a(0x170)}},'required':[a0_0x334e5a(0x161)]}},{'name':a0_0x334e5a(0x165),'description':'Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','inputSchema':{'type':'object','properties':{'alias':{'type':'string','description':a0_0x334e5a(0x1b9)},'task':{'type':a0_0x334e5a(0x1bc),'description':a0_0x334e5a(0x1a8)},'priority':{'type':'string','enum':[a0_0x334e5a(0x166),a0_0x334e5a(0x198),a0_0x334e5a(0x1b1)],'description':'Priority\x20(default:\x20normal)'}},'required':['alias','task']}},{'name':a0_0x334e5a(0x18a),'description':a0_0x334e5a(0x1e1),'inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x334e5a(0x1bc),'description':a0_0x334e5a(0x1b9)},'message':{'type':a0_0x334e5a(0x1bc),'description':'Message\x20content'}},'required':[a0_0x334e5a(0x1ce),a0_0x334e5a(0x1b0)]}},{'name':a0_0x334e5a(0x18c),'description':a0_0x334e5a(0x177),'inputSchema':{'type':a0_0x334e5a(0x1e7),'properties':{}}}]}));async function P(_0x54cd37,_0x5d1f65){const _0x6bbc52=a0_0x334e5a;let _0x4da96a=await fetch(f+_0x6bbc52(0x19d),{'method':_0x6bbc52(0x163),'headers':{'Content-Type':'application/json','Accept':_0x6bbc52(0x1a7),...X?{'Authorization':_0x6bbc52(0x164)+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x6bbc52(0x159),'id':0x1,'method':'initialize','params':{'protocolVersion':_0x6bbc52(0x171),'capabilities':{},'clientInfo':{'name':_0x6bbc52(0x15a),'version':_0x6bbc52(0x1e0)}}})});if(!_0x4da96a['ok']){let _0x4375f8=await _0x4da96a['text']();return Y('CommHub\x20init\x20failed:\x20'+_0x4da96a[_0x6bbc52(0x161)]+'\x20'+_0x4375f8['slice'](0x0,0x64)),{'ok':!0x1,'error':_0x6bbc52(0x16e)+_0x4da96a[_0x6bbc52(0x161)]};}await _0x4da96a['text']();let _0x44f027=(await(await fetch(f+'/mcp',{'method':_0x6bbc52(0x163),'headers':{'Content-Type':_0x6bbc52(0x1e4),'Accept':_0x6bbc52(0x1a7),...X?{'Authorization':_0x6bbc52(0x164)+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x6bbc52(0x159),'id':0x2,'method':_0x6bbc52(0x175),'params':{'name':_0x54cd37,'arguments':_0x5d1f65}})}))['text']())[_0x6bbc52(0x167)]('\x0a')[_0x6bbc52(0x1d1)](_0x247601=>_0x247601[_0x6bbc52(0x1b5)](_0x6bbc52(0x183)));if(_0x44f027){let _0x240e95=JSON[_0x6bbc52(0x1d8)](_0x44f027[_0x6bbc52(0x1e5)](0x6));return _0x240e95?.['result']?.['content']?.[0x0]?.[_0x6bbc52(0x1ba)]?JSON['parse'](_0x240e95[_0x6bbc52(0x1bf)][_0x6bbc52(0x19e)][0x0][_0x6bbc52(0x1ba)]):_0x240e95;}return{'ok':!0x1,'error':_0x6bbc52(0x1de)};}K[a0_0x334e5a(0x1bd)](a0_0x24829c,async _0x2c9d3e=>{const _0x530bb9=a0_0x334e5a;let {name:_0x26f043,arguments:_0x3b7a49}=_0x2c9d3e[_0x530bb9(0x188)];if(_0x26f043==='commhub_reply'){let {task_id:_0x147aa8,text:_0x5380e5,status:_0x2abc83}=_0x3b7a49;if(_0x2abc83===_0x530bb9(0x17c)||_0x2abc83===_0x530bb9(0x17a)||_0x2abc83===_0x530bb9(0x185)){let _0xae5d41=_0x2abc83===_0x530bb9(0x17c)?_0x530bb9(0x1df):_0x2abc83,_0x1ee864=_0x147aa8?k[_0x530bb9(0x1cf)](_0x147aa8)||_0x530bb9(0x16f):_0x530bb9(0x16f),_0x546105=await P(_0x530bb9(0x1ac),{'alias':_0x1ee864,'text':_0x5380e5,'in_reply_to':_0x147aa8||void 0x0,'status':_0xae5d41,'from_session':Z});if(_0x147aa8)k[_0x530bb9(0x173)](_0x147aa8);return{'content':[{'type':_0x530bb9(0x1ba),'text':JSON[_0x530bb9(0x1db)](_0x546105)}]};}let _0x5958a9=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x2abc83===_0x530bb9(0x16b)?_0x530bb9(0x16b):_0x2abc83===_0x530bb9(0x1c1)?_0x530bb9(0x1c1):_0x530bb9(0x1c9),'task':_0x5380e5['slice'](0x0,0xc8),'output':_0x5380e5});return{'content':[{'type':_0x530bb9(0x1ba),'text':JSON['stringify'](_0x5958a9)}]};}if(_0x26f043===_0x530bb9(0x1ae)){let {status:_0x1415ed,task:_0x4f67ae,progress:_0x29313a}=_0x3b7a49,_0x3cb716=await P(_0x530bb9(0x15f),{'resume_id':w,'alias':Z,'status':_0x1415ed,'task':_0x4f67ae,'progress':_0x29313a});return{'content':[{'type':_0x530bb9(0x1ba),'text':JSON[_0x530bb9(0x1db)](_0x3cb716)}]};}if(_0x26f043===_0x530bb9(0x165)){let {alias:_0x1362e6,task:_0x47cae3,priority:_0x14dfb9}=_0x3b7a49,_0x5c54b2=await P('send_task',{'alias':_0x1362e6,'task':_0x47cae3,'priority':_0x14dfb9||_0x530bb9(0x198),'from_session':Z});return{'content':[{'type':_0x530bb9(0x1ba),'text':JSON[_0x530bb9(0x1db)](_0x5c54b2)}]};}if(_0x26f043===_0x530bb9(0x18a)){let {alias:_0x25ea8a,message:_0x4524d0}=_0x3b7a49,_0xb94234=await P(_0x530bb9(0x1d0),{'alias':_0x25ea8a,'message':_0x4524d0,'from_session':Z});return{'content':[{'type':_0x530bb9(0x1ba),'text':JSON[_0x530bb9(0x1db)](_0xb94234)}]};}if(_0x26f043===_0x530bb9(0x18c)){let _0x4d2839=await P('get_all_status',{});return{'content':[{'type':_0x530bb9(0x1ba),'text':JSON[_0x530bb9(0x1db)](_0x4d2839)}]};}return{'content':[{'type':'text','text':JSON[_0x530bb9(0x1db)]({'error':_0x530bb9(0x18e)})}]};});async function u(){const _0x23dbf7=a0_0x334e5a;let _0x135987=f+_0x23dbf7(0x176)+encodeURIComponent(Z),_0x5549e9={};if(X)_0x5549e9['Authorization']=_0x23dbf7(0x164)+X;Y(_0x23dbf7(0x1a0)+_0x135987);while(!0x0){try{let _0x44aff6=await fetch(_0x135987,{'headers':_0x5549e9});if(!_0x44aff6['ok']){Y('SSE\x20error:\x20'+_0x44aff6['status']+'\x20'+_0x44aff6['statusText']),await h(0x1388);continue;}let _0x151896=_0x44aff6[_0x23dbf7(0x195)][_0x23dbf7(0x180)](),_0x40c640=new TextDecoder(),_0x14d3c5='';while(!0x0){let {done:_0x210796,value:_0x4fcb9e}=await _0x151896[_0x23dbf7(0x1a9)]();if(_0x210796)break;_0x14d3c5+=_0x40c640[_0x23dbf7(0x199)](_0x4fcb9e,{'stream':!0x0});let _0x4e5f81=_0x14d3c5[_0x23dbf7(0x167)]('\x0a\x0a');_0x14d3c5=_0x4e5f81['pop']()||'';for(let _0x3c112e of _0x4e5f81){let _0x16622e=_0x3c112e[_0x23dbf7(0x167)]('\x0a')['find'](_0x215bae=>_0x215bae[_0x23dbf7(0x1b5)](_0x23dbf7(0x183)));if(!_0x16622e)continue;try{let _0x28a54d=JSON[_0x23dbf7(0x1d8)](_0x16622e['slice'](0x6));await S(_0x28a54d);}catch(_0x4b6da0){Y(_0x23dbf7(0x186)+_0x4b6da0);}}}Y('SSE\x20stream\x20ended,\x20reconnecting...');}catch(_0x159c46){Y(_0x23dbf7(0x17e)+_0x159c46);}await h(0xbb8);}}async function S(_0x22002a){const _0xc16c91=a0_0x334e5a;if(_0x22002a[_0xc16c91(0x15c)]===_0xc16c91(0x1e6)){Y(_0xc16c91(0x1d6)+Z+'\x22');return;}if(_0x22002a['type']===_0xc16c91(0x1b7)){if(Y(_0xc16c91(0x191)+_0x22002a['from']+':\x20'+_0x22002a[_0xc16c91(0x1b0)][_0xc16c91(0x1e5)](0x0,0x3c)),await K[_0xc16c91(0x1e8)]({'method':_0xc16c91(0x1e3),'params':{'content':_0x22002a['message'],'meta':{'sender':_0x22002a[_0xc16c91(0x16d)]||_0xc16c91(0x16f),'sender_id':_0xc16c91(0x194),'user':_0x22002a[_0xc16c91(0x16d)]||_0xc16c91(0x16f),'priority':_0xc16c91(0x198)}}}),_0x22002a[_0xc16c91(0x1af)])await P(_0xc16c91(0x1b6),{'alias':Z,'message_id':_0x22002a['message_id']});return;}if(_0x22002a['type']===_0xc16c91(0x18f)||_0x22002a['type']===_0xc16c91(0x16a)){Y('←\x20'+_0x22002a['type']+_0xc16c91(0x1b4)+_0x22002a[_0xc16c91(0x18d)]+_0xc16c91(0x15d)+(_0x22002a['priority']||'normal'));let _0x513cab=await P(_0xc16c91(0x1d5),{'alias':Z,'limit':0x5});if(_0x513cab?.['ok']&&_0x513cab[_0xc16c91(0x179)]?.[_0xc16c91(0x17b)]>0x0)for(let _0x494d32 of _0x513cab[_0xc16c91(0x179)]){let _0x1be4c3={'sender':_0x494d32[_0xc16c91(0x1a2)]||_0xc16c91(0x16f),'sender_id':_0xc16c91(0x194),'user':_0x494d32[_0xc16c91(0x1a2)]||_0xc16c91(0x16f),'task_id':_0x494d32['id'],'priority':_0x494d32[_0xc16c91(0x1a6)]||_0xc16c91(0x198)};k[_0xc16c91(0x1a5)](_0x494d32['id'],_0x494d32[_0xc16c91(0x1a2)]||_0xc16c91(0x16f)),await K[_0xc16c91(0x1e8)]({'method':_0xc16c91(0x1e3),'params':{'content':_0x494d32['content'],'meta':_0x1be4c3}}),Y(_0xc16c91(0x1aa)+_0x494d32['id'][_0xc16c91(0x1e5)](0x0,0x8)+_0xc16c91(0x187)+_0x494d32[_0xc16c91(0x1a2)]+':\x20'+_0x494d32[_0xc16c91(0x19e)][_0xc16c91(0x1e5)](0x0,0x3c)),await P(_0xc16c91(0x1b6),{'alias':Z,'message_id':_0x494d32['id']});}}}async function A(){const _0x55af32=a0_0x334e5a;let _0x5b1bf7=new a0_0x8bed26();await K[_0x55af32(0x1bb)](_0x5b1bf7),Y('MCP\x20stdio\x20connected'),Y(_0x55af32(0x1c8)),u()[_0x55af32(0x189)](_0x25adfc=>Y(_0x55af32(0x1c0)+_0x25adfc)),P(_0x55af32(0x15f),{'resume_id':w,'alias':Z,'status':_0x55af32(0x1c6),'server':a0_0x370ff1(),'hostname':a0_0x370ff1(),'agent':'claude-code','project_dir':process[_0x55af32(0x1b8)](),'tmux_name':j||void 0x0})[_0x55af32(0x1e2)](()=>Y(_0x55af32(0x197)+Z+'\x22\x20('+w[_0x55af32(0x1e5)](0x0,0x8)+')'))[_0x55af32(0x189)](_0x469595=>Y(_0x55af32(0x1ab)+_0x469595)),setInterval(()=>{const _0x2f2872=_0x55af32;P(_0x2f2872(0x15f),{'resume_id':w,'alias':Z,'status':_0x2f2872(0x1c6),'server':a0_0x370ff1(),'hostname':a0_0x370ff1(),'agent':_0x2f2872(0x15b),'project_dir':process[_0x2f2872(0x1b8)](),'tmux_name':j||void 0x0})[_0x2f2872(0x189)](_0x1d4908=>Y(_0x2f2872(0x1be)+_0x1d4908));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}A()[a0_0x334e5a(0x189)](_0x1097d3=>{const _0xbbf1e9=a0_0x334e5a;Y('fatal:\x20'+_0x1097d3),process[_0xbbf1e9(0x174)](0x1);});async function N(){const _0x2d0f0b=a0_0x334e5a;Y('shutting\x20down,\x20reporting\x20offline...'),await P('report_status',{'resume_id':w,'alias':Z,'status':'error','task':_0x2d0f0b(0x1c5)})[_0x2d0f0b(0x189)](()=>{}),process[_0x2d0f0b(0x174)](0x0);}function a0_0x59f8(){const _0xcab314=['text','connect','string','setRequestHandler','heartbeat\x20failed:\x20','result','SSE\x20fatal:\x20','error','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','.env','write','session\x20disconnected','idle','178138JeszEM','starting\x20SSE\x20listener...','working','toTimeString','utf-8','4576480owurRj','252QRdFfY','alias','get','send_message','find','http://127.0.0.1:9200','.anet','1227310vNxpYZ','get_inbox','SSE\x20connected\x20as\x20\x22','563595MaWEBw','parse','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','stringify','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','280csKIoY','no\x20response','replied','0.3.0','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','then','notifications/claude/channel','application/json','slice','connected','object','notification','...\x20TMUX=','2.0','commhub-channel','claude-code','type','\x20priority=','.claude/channels/commhub','report_status','stdin','status','\x20ALIAS=','POST','Bearer\x20','commhub_send_task','high','split','token','957573kbRAdr','broadcast','blocked',']\x20[commhub]\x20','from','init\x20failed:\x20','hub','Progress\x200-100','2025-03-26','tmux\x20display-message\x20-p\x20\x27#S\x27','delete','exit','tools/call','/events/','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','trim','messages','failed','length','completed','ENV:\x20URL=','SSE\x20connection\x20error:\x20','14XfFLxz','getReader','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','number','data:\x20','\x20CWD=','cancelled','parse\x20error:\x20','\x20from\x20','params','catch','commhub_send_message','SIGTERM','commhub_get_all_status','inbox_count','unknown\x20tool','new_task','join','←\x20message\x20from\x20','121ZRgjLv','278888ysIcJk','commhub','body','\x20RESUME_ID=','registered\x20as\x20\x22','normal','decode','\x20PROJECT_ENV=','stderr','config.json','/mcp','content','replace','connecting\x20to\x20','end','from_session','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','set','priority','application/json,\x20text/event-stream','Task\x20content','read','→\x20injected\x20task\x20','warning:\x20could\x20not\x20register:\x20','send_reply','154530nDUwAA','commhub_report_status','message_id','message','low','indexOf','Reply\x20text\x20/\x20result\x20summary',':\x20inbox_count=','startsWith','ack_inbox','new_message','cwd','Target\x20session\x20alias'];a0_0x59f8=function(){return _0xcab314;};return a0_0x59f8();}process[a0_0x334e5a(0x160)]['on'](a0_0x334e5a(0x1a1),()=>N()),process['on'](a0_0x334e5a(0x18b),()=>N()),process['on']('SIGINT',()=>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.5",
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",