@sleep2agi/agent-network 2.1.10-preview.0 → 2.1.11-preview.0

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_0x22272=a0_0x19d2;function a0_0x19d2(_0x44cde8,_0x3fe16c){_0x44cde8=_0x44cde8-0x1d6;const _0x449792=a0_0x4497();let _0x19d2dc=_0x449792[_0x44cde8];return _0x19d2dc;}(function(_0xd9066a,_0x5cb6a2){const _0x50def6=a0_0x19d2,_0x3f26b4=_0xd9066a();while(!![]){try{const _0x2f6917=-parseInt(_0x50def6(0x1d8))/0x1+parseInt(_0x50def6(0x1e6))/0x2+parseInt(_0x50def6(0x21b))/0x3*(parseInt(_0x50def6(0x22d))/0x4)+-parseInt(_0x50def6(0x1f2))/0x5*(parseInt(_0x50def6(0x22b))/0x6)+-parseInt(_0x50def6(0x227))/0x7+parseInt(_0x50def6(0x209))/0x8+parseInt(_0x50def6(0x1f5))/0x9*(parseInt(_0x50def6(0x1f4))/0xa);if(_0x2f6917===_0x5cb6a2)break;else _0x3f26b4['push'](_0x3f26b4['shift']());}catch(_0x317861){_0x3f26b4['push'](_0x3f26b4['shift']());}}}(a0_0x4497,0x403a1));import{EventEmitter as a0_0x649004}from'events';import{hostname as a0_0x46c1d1}from'os';class T extends a0_0x649004{[a0_0x22272(0x1e4)];[a0_0x22272(0x1ff)];[a0_0x22272(0x208)];['agent'];['resumeId'];['heartbeatInterval'];[a0_0x22272(0x22c)];[a0_0x22272(0x1ea)];['sseAbort'];['running']=!0x1;constructor(_0x5b3aa5){const _0x423b11=a0_0x22272;super();if(this[_0x423b11(0x1e4)]=_0x5b3aa5['url'][_0x423b11(0x211)](/\/$/,''),this[_0x423b11(0x1ff)]=_0x5b3aa5[_0x423b11(0x1ff)],this[_0x423b11(0x208)]=_0x5b3aa5[_0x423b11(0x208)],this['agent']=_0x5b3aa5[_0x423b11(0x1e9)]||_0x423b11(0x231),this[_0x423b11(0x1f6)]=_0x423b11(0x213)+_0x5b3aa5[_0x423b11(0x1ff)]+'-'+Date[_0x423b11(0x229)]()[_0x423b11(0x203)](0x24),this[_0x423b11(0x1dc)]=_0x5b3aa5[_0x423b11(0x1dc)]??0x2bf20,this[_0x423b11(0x22c)]=_0x5b3aa5['reconnectDelay']??0xbb8,_0x5b3aa5[_0x423b11(0x232)]!==!0x1)this['connect']();}['log'](_0x4d0dcf){const _0x13d3ae=a0_0x22272;console[_0x13d3ae(0x21f)]('['+new Date()[_0x13d3ae(0x223)]()[_0x13d3ae(0x1e7)](0x0,0x8)+']\x20[commhub:'+this[_0x13d3ae(0x1ff)]+']\x20'+_0x4d0dcf);}async['call'](_0x37c6dc,_0x21543d){const _0x38077c=a0_0x22272;let _0x32f7d1={'Content-Type':_0x38077c(0x22f),'Accept':_0x38077c(0x220)};if(this[_0x38077c(0x208)])_0x32f7d1['Authorization']=_0x38077c(0x226)+this['token'];let _0x162daf=await(await fetch(this['url']+'/mcp',{'method':_0x38077c(0x200),'headers':_0x32f7d1,'body':JSON[_0x38077c(0x1e0)]({'jsonrpc':_0x38077c(0x1f8),'id':Date[_0x38077c(0x229)](),'method':_0x38077c(0x205),'params':{'name':_0x37c6dc,'arguments':_0x21543d}})}))['text'](),_0xb80e61=_0x162daf[_0x38077c(0x233)](/data: (.+)/),_0x326c58=_0xb80e61?JSON[_0x38077c(0x1fe)](_0xb80e61[0x1]):JSON[_0x38077c(0x1fe)](_0x162daf),_0x1da9d9=_0x326c58?.[_0x38077c(0x1ec)]?.[_0x38077c(0x1f0)]?.[0x0]?.[_0x38077c(0x1ed)];return _0x1da9d9?JSON[_0x38077c(0x1fe)](_0x1da9d9):_0x326c58;}async['connect'](){const _0x4f1c3f=a0_0x22272;if(this[_0x4f1c3f(0x218)])return;this['running']=!0x0,await this['status'](_0x4f1c3f(0x20b)),this[_0x4f1c3f(0x21f)](_0x4f1c3f(0x214)),this[_0x4f1c3f(0x1ea)]=setInterval(()=>{const _0x202e8f=_0x4f1c3f;this[_0x202e8f(0x1fd)](_0x202e8f(0x20b))[_0x202e8f(0x225)](_0x535872=>this[_0x202e8f(0x21f)](_0x202e8f(0x230)+_0x535872['message']));},this[_0x4f1c3f(0x1dc)]),this[_0x4f1c3f(0x22e)]();}async[a0_0x22272(0x210)](){const _0x23c974=a0_0x22272;if(this[_0x23c974(0x218)]=!0x1,this['sseAbort']?.[_0x23c974(0x1df)](),this[_0x23c974(0x1ea)])clearInterval(this['heartbeatTimer']);await this[_0x23c974(0x1fd)](_0x23c974(0x228))['catch'](()=>{}),this[_0x23c974(0x21f)](_0x23c974(0x1fc));}async[a0_0x22272(0x1fb)](_0xfec47e,_0x4b7b3a,_0x2033bd=a0_0x22272(0x20f)){const _0x4bb089=a0_0x22272;return this[_0x4bb089(0x1e3)](_0x4bb089(0x221),{'alias':_0xfec47e,'task':_0x4b7b3a,'priority':_0x2033bd,'from_session':this[_0x4bb089(0x1ff)]});}async[a0_0x22272(0x201)](_0x3867f1,_0x2528d9){const _0x48da1d=a0_0x22272;return this[_0x48da1d(0x1e3)](_0x48da1d(0x21c),{'alias':_0x3867f1,'message':_0x2528d9,'from_session':this[_0x48da1d(0x1ff)]});}async[a0_0x22272(0x222)](_0x3a7e6a,_0x3a83f2,_0x2bd182=a0_0x22272(0x1f7)){const _0x334243=a0_0x22272;return this['call'](_0x334243(0x1d6),{'in_reply_to':_0x3a7e6a,'text':_0x3a83f2,'status':_0x2bd182});}async[a0_0x22272(0x1fd)](_0x3e3e99,_0x4d4474){const _0x116b70=a0_0x22272;return this[_0x116b70(0x1e3)](_0x116b70(0x21e),{'resume_id':this['resumeId'],'alias':this[_0x116b70(0x1ff)],'status':_0x3e3e99,'server':a0_0x46c1d1(),'hostname':a0_0x46c1d1(),'agent':this['agent'],'project_dir':process[_0x116b70(0x1f9)](),..._0x4d4474});}async[a0_0x22272(0x207)](){const _0x541197=a0_0x22272;return this[_0x541197(0x1e3)](_0x541197(0x20c),{});}async['broadcast'](_0x5282c5,_0x39d26e){const _0x376277=a0_0x22272;return this[_0x376277(0x1e3)](_0x376277(0x1ef),{'message':_0x5282c5,'filter_server':_0x39d26e?.[_0x376277(0x1e5)],'filter_status':_0x39d26e?.[_0x376277(0x1fd)]});}async[a0_0x22272(0x22e)](){const _0x1cd463=a0_0x22272;let _0x528b2c=encodeURIComponent(this[_0x1cd463(0x1ff)]),_0xdda0a8=this[_0x1cd463(0x1e4)]+_0x1cd463(0x1e2)+_0x528b2c,_0x16da15=this[_0x1cd463(0x22c)];while(this[_0x1cd463(0x218)]){try{this[_0x1cd463(0x22a)]=new AbortController();let _0x44d814={'Accept':_0x1cd463(0x215)};if(this['token'])_0x44d814[_0x1cd463(0x1db)]='Bearer\x20'+this['token'];let _0x476f6b=await fetch(_0xdda0a8,{'headers':_0x44d814,'signal':this[_0x1cd463(0x22a)][_0x1cd463(0x20e)]});if(!_0x476f6b['ok']||!_0x476f6b['body']){this[_0x1cd463(0x21f)](_0x1cd463(0x216)+_0x476f6b[_0x1cd463(0x1fd)]),await this[_0x1cd463(0x20d)](_0x16da15),_0x16da15=Math[_0x1cd463(0x1fa)](_0x16da15*1.5,0xea60);continue;}_0x16da15=this[_0x1cd463(0x22c)];let _0x10d115=_0x476f6b[_0x1cd463(0x21d)][_0x1cd463(0x1dd)](),_0x8834f8=new TextDecoder(),_0x19f105='';while(this['running']){let {done:_0x559110,value:_0xff483e}=await _0x10d115[_0x1cd463(0x1f1)]();if(_0x559110)break;_0x19f105+=_0x8834f8[_0x1cd463(0x1da)](_0xff483e,{'stream':!0x0});let _0x29aaeb=_0x19f105[_0x1cd463(0x206)]('\x0a');_0x19f105=_0x29aaeb[_0x1cd463(0x1e1)]()||'';for(let _0x4dd055 of _0x29aaeb){if(!_0x4dd055[_0x1cd463(0x202)](_0x1cd463(0x1d7)))continue;try{let _0x12e54f=JSON[_0x1cd463(0x1fe)](_0x4dd055[_0x1cd463(0x1e7)](0x6));if(_0x12e54f['type']==='connected'){this[_0x1cd463(0x21f)](_0x1cd463(0x1e8)),this[_0x1cd463(0x21a)](_0x1cd463(0x20a));continue;}if(_0x12e54f[_0x1cd463(0x1de)]===_0x1cd463(0x204)||_0x12e54f['type']==='new_message'||_0x12e54f[_0x1cd463(0x1de)]===_0x1cd463(0x1ef))await this['processInbox']();}catch{}}}}catch(_0x3010f2){if(_0x3010f2[_0x1cd463(0x1eb)]==='AbortError')break;this['emit'](_0x1cd463(0x224),_0x3010f2),this[_0x1cd463(0x21f)]('SSE\x20error:\x20'+_0x3010f2[_0x1cd463(0x201)]);}if(this[_0x1cd463(0x218)])this[_0x1cd463(0x21a)](_0x1cd463(0x1fc)),this['log']('SSE\x20reconnecting\x20in\x20'+_0x16da15/0x3e8+'s...'),await this['sleep'](_0x16da15),_0x16da15=Math[_0x1cd463(0x1fa)](_0x16da15*1.5,0xea60);}}async[a0_0x22272(0x1f3)](){const _0x533761=a0_0x22272;try{let _0xdcb018=(await this[_0x533761(0x1e3)](_0x533761(0x212),{'alias':this['alias'],'limit':0xa}))?.[_0x533761(0x219)]||[];for(let _0xbf9ca0 of _0xdcb018)await this[_0x533761(0x1e3)](_0x533761(0x1ee),{'alias':this[_0x533761(0x1ff)],'message_id':_0xbf9ca0['id']}),this[_0x533761(0x21f)]('←\x20'+_0xbf9ca0[_0x533761(0x1d9)]+':\x20'+_0xbf9ca0[_0x533761(0x1f0)][_0x533761(0x1e7)](0x0,0x3c)),this[_0x533761(0x21a)](_0x533761(0x217),_0xbf9ca0),this[_0x533761(0x21a)](_0x533761(0x201),_0xbf9ca0);}catch(_0x694c82){this['log']('inbox\x20error:\x20'+_0x694c82[_0x533761(0x201)]);}}[a0_0x22272(0x20d)](_0x25a416){return new Promise(_0x51a20e=>setTimeout(_0x51a20e,_0x25a416));}}var $=T;export{$ as default,T as CommHub};function a0_0x4497(){const _0x49f37a=['body','report_status','log','application/json,\x20text/event-stream','send_task','reply','toTimeString','error','catch','Bearer\x20','2356662fbCldr','offline','now','sseAbort','66IjQWYn','reconnectDelay','364AFZWeT','connectSSE','application/json','heartbeat\x20failed:\x20','sdk','autoConnect','match','send_reply','data:\x20','351375ndLqmC','from_session','decode','Authorization','heartbeatInterval','getReader','type','abort','stringify','pop','/events/','call','url','server','907694TxwICs','slice','SSE\x20connected','agent','heartbeatTimer','name','result','text','ack_inbox','broadcast','content','read','138680ZgqSpp','processInbox','74220cqgLGE','549TxAKwK','resumeId','completed','2.0','cwd','min','send','disconnected','status','parse','alias','POST','message','startsWith','toString','new_task','tools/call','split','getAllStatus','token','421504tPzbjm','connected','idle','get_all_status','sleep','signal','normal','disconnect','replace','get_inbox','sdk-','registered','text/event-stream','SSE\x20failed:\x20','task','running','messages','emit','9789ilzKqH','send_message'];a0_0x4497=function(){return _0x49f37a;};return a0_0x4497();}
1
+ function a0_0x1757(){const _0x4b51a6=['/events/','heartbeat\x20failed:\x20','tools/call','pop','16OLYuwA','broadcast','body','log','autoConnect','SSE\x20failed:\x20','call','catch','sdk','336gNxkJg','signal','inbox\x20error:\x20','2.0','connected','idle','server','139099SZvnrY','new_task','completed','abort','getReader','connectSSE','getAllStatus','text','token','toTimeString','50834940tMmSiZ','276436NOikMA','report_status','result','Authorization','sseAbort','replace','Bearer\x20','processInbox','slice','now','/mcp','reconnectDelay','get_all_status','content','normal','application/json','decode','alias','send','ack_inbox','10505736ZemRRF','SSE\x20reconnecting\x20in\x20','disconnected','send_message','heartbeatTimer','SSE\x20error:\x20','parse','cwd','AbortError','sleep','type','message','s...','310HiHjVt','stringify','99805VgiEpm','min','new_message','send_task','POST','url','emit','heartbeatInterval',']\x20[commhub:','12YGzrzo','agent','resumeId','status','7VQtCaJ','application/json,\x20text/event-stream','get_inbox','startsWith','1374564CcfBJf','task','read','22gtEjgY','102447IKJzFR','from_session','running','offline'];a0_0x1757=function(){return _0x4b51a6;};return a0_0x1757();}const a0_0x2c7167=a0_0x5dfe;(function(_0x4f18c0,_0x1eaeb6){const _0x5e4c31=a0_0x5dfe,_0x2e1095=_0x4f18c0();while(!![]){try{const _0x1c10d6=-parseInt(_0x5e4c31(0x12f))/0x1*(parseInt(_0x5e4c31(0x11f))/0x2)+parseInt(_0x5e4c31(0x10b))/0x3*(parseInt(_0x5e4c31(0x13a))/0x4)+-parseInt(_0x5e4c31(0x102))/0x5*(parseInt(_0x5e4c31(0x128))/0x6)+-parseInt(_0x5e4c31(0x10f))/0x7*(parseInt(_0x5e4c31(0xf3))/0x8)+-parseInt(_0x5e4c31(0x117))/0x9*(-parseInt(_0x5e4c31(0x100))/0xa)+parseInt(_0x5e4c31(0x116))/0xb*(-parseInt(_0x5e4c31(0x113))/0xc)+parseInt(_0x5e4c31(0x139))/0xd;if(_0x1c10d6===_0x1eaeb6)break;else _0x2e1095['push'](_0x2e1095['shift']());}catch(_0x323fc3){_0x2e1095['push'](_0x2e1095['shift']());}}}(a0_0x1757,0xbb332));import{EventEmitter as a0_0x526b9f}from'events';import{hostname as a0_0xe967db}from'os';class T extends a0_0x526b9f{['url'];[a0_0x2c7167(0xf0)];[a0_0x2c7167(0x137)];[a0_0x2c7167(0x10c)];['resumeId'];[a0_0x2c7167(0x109)];[a0_0x2c7167(0xea)];['heartbeatTimer'];[a0_0x2c7167(0xe3)];[a0_0x2c7167(0x119)]=!0x1;constructor(_0x63ed20){const _0x26c55c=a0_0x2c7167;super();if(this[_0x26c55c(0x107)]=_0x63ed20[_0x26c55c(0x107)][_0x26c55c(0xe4)](/\/$/,''),this['alias']=_0x63ed20[_0x26c55c(0xf0)],this[_0x26c55c(0x137)]=_0x63ed20['token'],this[_0x26c55c(0x10c)]=_0x63ed20[_0x26c55c(0x10c)]||_0x26c55c(0x127),this['resumeId']='sdk-'+_0x63ed20[_0x26c55c(0xf0)]+'-'+Date[_0x26c55c(0xe8)]()['toString'](0x24),this[_0x26c55c(0x109)]=_0x63ed20[_0x26c55c(0x109)]??0x2bf20,this[_0x26c55c(0xea)]=_0x63ed20[_0x26c55c(0xea)]??0xbb8,_0x63ed20[_0x26c55c(0x123)]!==!0x1)this['connect']();}['log'](_0x14dfcc){const _0x363d53=a0_0x2c7167;console['log']('['+new Date()[_0x363d53(0x138)]()[_0x363d53(0xe7)](0x0,0x8)+_0x363d53(0x10a)+this[_0x363d53(0xf0)]+']\x20'+_0x14dfcc);}async['call'](_0x116af9,_0x4d3571){const _0x2da433=a0_0x2c7167;let _0x4bdac2={'Content-Type':_0x2da433(0xee),'Accept':_0x2da433(0x110)};if(this[_0x2da433(0x137)])_0x4bdac2[_0x2da433(0xe2)]=_0x2da433(0xe5)+this['token'];let _0x473a46=await(await fetch(this[_0x2da433(0x107)]+_0x2da433(0xe9),{'method':_0x2da433(0x106),'headers':_0x4bdac2,'body':JSON[_0x2da433(0x101)]({'jsonrpc':_0x2da433(0x12b),'id':Date[_0x2da433(0xe8)](),'method':_0x2da433(0x11d),'params':{'name':_0x116af9,'arguments':_0x4d3571}})}))[_0x2da433(0x136)](),_0x123066=_0x473a46['match'](/data: (.+)/),_0x52fa6b=_0x123066?JSON[_0x2da433(0xf9)](_0x123066[0x1]):JSON['parse'](_0x473a46),_0x507312=_0x52fa6b?.[_0x2da433(0xe1)]?.[_0x2da433(0xec)]?.[0x0]?.[_0x2da433(0x136)];return _0x507312?JSON[_0x2da433(0xf9)](_0x507312):_0x52fa6b;}async['connect'](){const _0x5d8a02=a0_0x2c7167;if(this['running'])return;this[_0x5d8a02(0x119)]=!0x0,await this[_0x5d8a02(0x10e)](_0x5d8a02(0x12d)),this[_0x5d8a02(0x122)]('registered'),this[_0x5d8a02(0xf7)]=setInterval(()=>{const _0x4cce45=_0x5d8a02;this[_0x4cce45(0x10e)](_0x4cce45(0x12d))[_0x4cce45(0x126)](_0x142feb=>this[_0x4cce45(0x122)](_0x4cce45(0x11c)+_0x142feb[_0x4cce45(0xfe)]));},this['heartbeatInterval']),this[_0x5d8a02(0x134)]();}async['disconnect'](){const _0x1bd4cf=a0_0x2c7167;if(this['running']=!0x1,this[_0x1bd4cf(0xe3)]?.[_0x1bd4cf(0x132)](),this[_0x1bd4cf(0xf7)])clearInterval(this['heartbeatTimer']);await this[_0x1bd4cf(0x10e)](_0x1bd4cf(0x11a))[_0x1bd4cf(0x126)](()=>{}),this['log'](_0x1bd4cf(0xf5));}async[a0_0x2c7167(0xf1)](_0x147ca2,_0x5c89aa,_0x3e7019=a0_0x2c7167(0xed)){const _0x1b2031=a0_0x2c7167;return this[_0x1b2031(0x125)](_0x1b2031(0x105),{'alias':_0x147ca2,'task':_0x5c89aa,'priority':_0x3e7019,'from_session':this[_0x1b2031(0xf0)]});}async['message'](_0x1b9fc4,_0x3105ed){const _0x32d173=a0_0x2c7167;return this['call'](_0x32d173(0xf6),{'alias':_0x1b9fc4,'message':_0x3105ed,'from_session':this[_0x32d173(0xf0)]});}async['reply'](_0x12d6ec,_0x407845,_0x5007c5=a0_0x2c7167(0x131)){const _0x5be5e2=a0_0x2c7167;return this[_0x5be5e2(0x125)]('send_reply',{'in_reply_to':_0x12d6ec,'text':_0x407845,'status':_0x5007c5});}async[a0_0x2c7167(0x10e)](_0x1e9327,_0x260236){const _0x11a6b9=a0_0x2c7167;return this['call'](_0x11a6b9(0x13b),{'resume_id':this[_0x11a6b9(0x10d)],'alias':this[_0x11a6b9(0xf0)],'status':_0x1e9327,'server':a0_0xe967db(),'hostname':a0_0xe967db(),'agent':this[_0x11a6b9(0x10c)],'project_dir':process[_0x11a6b9(0xfa)](),..._0x260236});}async[a0_0x2c7167(0x135)](){const _0x3aff72=a0_0x2c7167;return this[_0x3aff72(0x125)](_0x3aff72(0xeb),{});}async['broadcast'](_0x326589,_0x4e90bc){const _0x3f8dde=a0_0x2c7167;return this[_0x3f8dde(0x125)]('broadcast',{'message':_0x326589,'filter_server':_0x4e90bc?.[_0x3f8dde(0x12e)],'filter_status':_0x4e90bc?.[_0x3f8dde(0x10e)]});}async[a0_0x2c7167(0x134)](){const _0x5da21d=a0_0x2c7167;let _0x34ef72=encodeURIComponent(this[_0x5da21d(0xf0)]),_0x476bf5=this[_0x5da21d(0x107)]+_0x5da21d(0x11b)+_0x34ef72,_0x25ca13=this[_0x5da21d(0xea)];while(this['running']){try{this['sseAbort']=new AbortController();let _0x10ad16={'Accept':'text/event-stream'};if(this[_0x5da21d(0x137)])_0x10ad16[_0x5da21d(0xe2)]=_0x5da21d(0xe5)+this[_0x5da21d(0x137)];let _0x48a5d6=await fetch(_0x476bf5,{'headers':_0x10ad16,'signal':this[_0x5da21d(0xe3)][_0x5da21d(0x129)]});if(!_0x48a5d6['ok']||!_0x48a5d6[_0x5da21d(0x121)]){this[_0x5da21d(0x122)](_0x5da21d(0x124)+_0x48a5d6[_0x5da21d(0x10e)]),await this[_0x5da21d(0xfc)](_0x25ca13),_0x25ca13=Math[_0x5da21d(0x103)](_0x25ca13*1.5,0xea60);continue;}_0x25ca13=this[_0x5da21d(0xea)];let _0x2098f8=_0x48a5d6[_0x5da21d(0x121)][_0x5da21d(0x133)](),_0x18dfe7=new TextDecoder(),_0x4b57e9='';while(this[_0x5da21d(0x119)]){let {done:_0x2f17e4,value:_0x833565}=await _0x2098f8[_0x5da21d(0x115)]();if(_0x2f17e4)break;_0x4b57e9+=_0x18dfe7[_0x5da21d(0xef)](_0x833565,{'stream':!0x0});let _0x38f85d=_0x4b57e9['split']('\x0a');_0x4b57e9=_0x38f85d[_0x5da21d(0x11e)]()||'';for(let _0xb16173 of _0x38f85d){if(!_0xb16173[_0x5da21d(0x112)]('data:\x20'))continue;try{let _0x2684f4=JSON[_0x5da21d(0xf9)](_0xb16173['slice'](0x6));if(_0x2684f4['type']===_0x5da21d(0x12c)){this[_0x5da21d(0x122)]('SSE\x20connected'),this[_0x5da21d(0x108)](_0x5da21d(0x12c));continue;}if(_0x2684f4[_0x5da21d(0xfd)]===_0x5da21d(0x130)||_0x2684f4[_0x5da21d(0xfd)]===_0x5da21d(0x104)||_0x2684f4[_0x5da21d(0xfd)]===_0x5da21d(0x120))await this[_0x5da21d(0xe6)]();}catch{}}}}catch(_0x266862){if(_0x266862['name']===_0x5da21d(0xfb))break;this[_0x5da21d(0x108)]('error',_0x266862),this[_0x5da21d(0x122)](_0x5da21d(0xf8)+_0x266862[_0x5da21d(0xfe)]);}if(this['running'])this[_0x5da21d(0x108)](_0x5da21d(0xf5)),this[_0x5da21d(0x122)](_0x5da21d(0xf4)+_0x25ca13/0x3e8+_0x5da21d(0xff)),await this[_0x5da21d(0xfc)](_0x25ca13),_0x25ca13=Math['min'](_0x25ca13*1.5,0xea60);}}async[a0_0x2c7167(0xe6)](){const _0x488417=a0_0x2c7167;try{let _0x276018=(await this['call'](_0x488417(0x111),{'alias':this[_0x488417(0xf0)],'limit':0xa}))?.['messages']||[];for(let _0xbb214a of _0x276018)await this[_0x488417(0x125)](_0x488417(0xf2),{'alias':this[_0x488417(0xf0)],'message_id':_0xbb214a['id']}),this[_0x488417(0x122)]('←\x20'+_0xbb214a[_0x488417(0x118)]+':\x20'+_0xbb214a['content'][_0x488417(0xe7)](0x0,0x3c)),this['emit'](_0x488417(0x114),_0xbb214a),this['emit'](_0x488417(0xfe),_0xbb214a);}catch(_0x385918){this[_0x488417(0x122)](_0x488417(0x12a)+_0x385918['message']);}}[a0_0x2c7167(0xfc)](_0x144d0e){return new Promise(_0x44028d=>setTimeout(_0x44028d,_0x144d0e));}}var $=T;function a0_0x5dfe(_0x464759,_0x40d813){_0x464759=_0x464759-0xe1;const _0x17576b=a0_0x1757();let _0x5dfe2c=_0x17576b[_0x464759];return _0x5dfe2c;}export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x52bbdc=a0_0x250e;(function(_0x18ea8c,_0x39b332){const _0x34b338=a0_0x250e,_0x33e680=_0x18ea8c();while(!![]){try{const _0x351db6=-parseInt(_0x34b338(0x21d))/0x1+parseInt(_0x34b338(0x1eb))/0x2+-parseInt(_0x34b338(0x21f))/0x3*(-parseInt(_0x34b338(0x249))/0x4)+parseInt(_0x34b338(0x220))/0x5+-parseInt(_0x34b338(0x210))/0x6*(parseInt(_0x34b338(0x22d))/0x7)+-parseInt(_0x34b338(0x1ff))/0x8*(-parseInt(_0x34b338(0x20a))/0x9)+-parseInt(_0x34b338(0x213))/0xa*(parseInt(_0x34b338(0x236))/0xb);if(_0x351db6===_0x39b332)break;else _0x33e680['push'](_0x33e680['shift']());}catch(_0x1e73da){_0x33e680['push'](_0x33e680['shift']());}}}(a0_0x4f56,0x28096));import{readFileSync as a0_0x21a876,existsSync as a0_0x2c53d8}from'fs';import{randomUUID as a0_0x16f3a8}from'crypto';import{join as a0_0xacfc47}from'path';import{hostname as a0_0xbe43f3}from'os';import{execSync as a0_0x205802}from'child_process';import{Server as a0_0x30ee14}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x37debf}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x3e6577,CallToolRequestSchema as a0_0x53b3cc}from'@modelcontextprotocol/sdk/types.js';function p(_0xa95185){const _0x290b46=a0_0x250e;if(!a0_0x2c53d8(_0xa95185))return;for(let _0xfb91c4 of a0_0x21a876(_0xa95185,'utf-8')[_0x290b46(0x21b)]('\x0a')){let _0x37fd84=_0xfb91c4[_0x290b46(0x256)]();if(!_0x37fd84||_0x37fd84[_0x290b46(0x20f)]('#'))continue;let _0x4f711c=_0x37fd84['indexOf']('=');if(_0x4f711c<0x0)continue;let _0x4894c8=_0x37fd84['slice'](0x0,_0x4f711c)[_0x290b46(0x256)](),_0x4e6295=_0x37fd84[_0x290b46(0x1e4)](_0x4f711c+0x1)['trim']()[_0x290b46(0x1f1)](/^["']|["']$/g,'');if(!process.env[_0x4894c8])process.env[_0x4894c8]=_0x4e6295;}}var C=process.env.HOME||'~',T=a0_0xacfc47(C,'.claude/channels/commhub');p(a0_0xacfc47(T,a0_0x52bbdc(0x225)));var L=process[a0_0x52bbdc(0x22a)]()['replace'](/\//g,'-');p(a0_0xacfc47(T,L,'.env'));function U(){const _0x34674b=a0_0x52bbdc;try{return a0_0x205802(_0x34674b(0x1f0),{'encoding':_0x34674b(0x1e5),'timeout':0x7d0})[_0x34674b(0x256)]();}catch{return'';}}function v(){const _0x4862a2=a0_0x52bbdc;try{let _0xf66d5d=a0_0xacfc47(C,_0x4862a2(0x268),_0x4862a2(0x227));if(a0_0x2c53d8(_0xf66d5d))return JSON[_0x4862a2(0x1f3)](a0_0x21a876(_0xf66d5d,_0x4862a2(0x1e5)));}catch{}return{};}function a0_0x4f56(){const _0x58d00d=['connected',']\x20[commhub]\x20','Bearer\x20','commhub_send_message','claude-code','notification','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','\x20RESUME_ID=','2025-03-26','application/json,\x20text/event-stream','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','warning:\x20could\x20not\x20register:\x20','398488VBAzZa','end','type','Current\x20task\x20description','→\x20injected\x20task\x20','heartbeat\x20failed:\x20','low','unknown\x20tool','commhub_send_task','catch','join','idle','stdin','trim','from_session','working','priority','initialize','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','result','commhub','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','message','SIGINT','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','stringify','2.0','\x20priority=','normal','POST','send_task','.anet','content','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','setRequestHandler','...\x20TMUX=','connecting\x20to\x20','notifications/claude/channel','starting\x20SSE\x20listener...','Reply\x20text\x20/\x20result\x20summary','slice','utf-8','message_id','status','\x20PROJECT_ENV=','tools/call','\x22\x20(','303504IBpvee','statusText','report_status','SIGTERM','object','tmux\x20display-message\x20-p\x20\x27#S\x27','replace','CommHub\x20init\x20failed:\x20','parse','parse\x20error:\x20','token','commhub_reply','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','get','init\x20failed:\x20','high','task','session\x20disconnected','get_inbox','37616Ddxzsc','completed','Target\x20session\x20alias','Progress\x200-100','body','http://127.0.0.1:9200','application/json','ack_inbox','send_reply','broadcast','new_message','513oQZNRI','hub','fatal:\x20','SSE\x20stream\x20ended,\x20reconnecting...','Message\x20content','startsWith','164472mverKB','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','error','3571430anGwqD','\x20CWD=','get_all_status','pop','/mcp','stderr','Task\x20content','Authorization','split','then','154909VqKhwA','send_message','9whLSzN','61170sCCepQ','SSE\x20error:\x20','set','/events/','from','.env','data:\x20','config.json','0.3.0','blocked','cwd','write','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','14lvVsmv','find','commhub_get_all_status','cancelled','failed','string','shutting\x20down,\x20reporting\x20offline...','text','SSE\x20connection\x20error:\x20','11WFBVWi','length','exit','number','none','messages','replied'];a0_0x4f56=function(){return _0x58d00d;};return a0_0x4f56();}var H=v(),f=process.env.COMMHUB_URL||H['hub']||a0_0x52bbdc(0x204),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0xbe43f3(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x16f3a8(),X=process.env.COMMHUB_TOKEN||H[a0_0x52bbdc(0x1f5)]||'';function a0_0x250e(_0x2e29db,_0x1c3fdd){_0x2e29db=_0x2e29db-0x1de;const _0x4f56d4=a0_0x4f56();let _0x250e5f=_0x4f56d4[_0x2e29db];return _0x250e5f;}function Y(_0x3e0db6){const _0x4d9cdc=a0_0x52bbdc;let _0x11f1a1=new Date()['toTimeString']()['slice'](0x0,0x8);process[_0x4d9cdc(0x218)][_0x4d9cdc(0x22b)]('['+_0x11f1a1+_0x4d9cdc(0x23e)+_0x3e0db6+'\x0a');}function h(_0x52619e){return new Promise(_0x4deee9=>setTimeout(_0x4deee9,_0x52619e));}Y('ENV:\x20URL='+f+'\x20ALIAS='+Z+a0_0x52bbdc(0x244)+w['slice'](0x0,0x8)+a0_0x52bbdc(0x1df)+(j||a0_0x52bbdc(0x23a))+a0_0x52bbdc(0x214)+process[a0_0x52bbdc(0x22a)]()+a0_0x52bbdc(0x1e8)+L);var k=new Map(),K=new a0_0x30ee14({'name':'commhub-channel','version':a0_0x52bbdc(0x228)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x52bbdc(0x261),a0_0x52bbdc(0x25b),a0_0x52bbdc(0x247),a0_0x52bbdc(0x22c),'Session\x20alias:\x20'+Z][a0_0x52bbdc(0x253)]('\x0a')});K['setRequestHandler'](a0_0x3e6577,async()=>({'tools':[{'name':a0_0x52bbdc(0x1f6),'description':a0_0x52bbdc(0x211),'inputSchema':{'type':a0_0x52bbdc(0x1ef),'properties':{'task_id':{'type':a0_0x52bbdc(0x232),'description':a0_0x52bbdc(0x243)},'text':{'type':a0_0x52bbdc(0x232),'description':a0_0x52bbdc(0x1e3)},'status':{'type':a0_0x52bbdc(0x232),'enum':[a0_0x52bbdc(0x200),a0_0x52bbdc(0x231),'cancelled',a0_0x52bbdc(0x229),a0_0x52bbdc(0x212),'in_progress'],'description':a0_0x52bbdc(0x1f8)}},'required':[a0_0x52bbdc(0x234)]}},{'name':'commhub_report_status','description':a0_0x52bbdc(0x26a),'inputSchema':{'type':a0_0x52bbdc(0x1ef),'properties':{'status':{'type':a0_0x52bbdc(0x232),'enum':[a0_0x52bbdc(0x258),a0_0x52bbdc(0x254),a0_0x52bbdc(0x229),a0_0x52bbdc(0x212)]},'task':{'type':a0_0x52bbdc(0x232),'description':a0_0x52bbdc(0x24c)},'progress':{'type':a0_0x52bbdc(0x239),'description':a0_0x52bbdc(0x202)}},'required':[a0_0x52bbdc(0x1e7)]}},{'name':a0_0x52bbdc(0x251),'description':a0_0x52bbdc(0x1f7),'inputSchema':{'type':a0_0x52bbdc(0x1ef),'properties':{'alias':{'type':a0_0x52bbdc(0x232),'description':a0_0x52bbdc(0x201)},'task':{'type':a0_0x52bbdc(0x232),'description':a0_0x52bbdc(0x219)},'priority':{'type':a0_0x52bbdc(0x232),'enum':[a0_0x52bbdc(0x1fb),'normal',a0_0x52bbdc(0x24f)],'description':'Priority\x20(default:\x20normal)'}},'required':['alias',a0_0x52bbdc(0x1fc)]}},{'name':a0_0x52bbdc(0x240),'description':'Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','inputSchema':{'type':a0_0x52bbdc(0x1ef),'properties':{'alias':{'type':a0_0x52bbdc(0x232),'description':a0_0x52bbdc(0x201)},'message':{'type':a0_0x52bbdc(0x232),'description':a0_0x52bbdc(0x20e)}},'required':['alias',a0_0x52bbdc(0x25f)]}},{'name':a0_0x52bbdc(0x22f),'description':a0_0x52bbdc(0x25e),'inputSchema':{'type':a0_0x52bbdc(0x1ef),'properties':{}}}]}));async function P(_0x4ee747,_0x3f61ac){const _0x2d26d3=a0_0x52bbdc;let _0x1db480=await fetch(f+_0x2d26d3(0x217),{'method':_0x2d26d3(0x266),'headers':{'Content-Type':_0x2d26d3(0x205),'Accept':_0x2d26d3(0x246),...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON[_0x2d26d3(0x262)]({'jsonrpc':_0x2d26d3(0x263),'id':0x1,'method':_0x2d26d3(0x25a),'params':{'protocolVersion':_0x2d26d3(0x245),'capabilities':{},'clientInfo':{'name':'commhub-channel','version':_0x2d26d3(0x228)}}})});if(!_0x1db480['ok']){let _0x74db3a=await _0x1db480[_0x2d26d3(0x234)]();return Y(_0x2d26d3(0x1f2)+_0x1db480[_0x2d26d3(0x1e7)]+'\x20'+_0x74db3a[_0x2d26d3(0x1e4)](0x0,0x64)),{'ok':!0x1,'error':_0x2d26d3(0x1fa)+_0x1db480[_0x2d26d3(0x1e7)]};}await _0x1db480[_0x2d26d3(0x234)]();let _0x473466=(await(await fetch(f+_0x2d26d3(0x217),{'method':'POST','headers':{'Content-Type':_0x2d26d3(0x205),'Accept':_0x2d26d3(0x246),...X?{'Authorization':_0x2d26d3(0x23f)+X}:{}},'body':JSON[_0x2d26d3(0x262)]({'jsonrpc':_0x2d26d3(0x263),'id':0x2,'method':_0x2d26d3(0x1e9),'params':{'name':_0x4ee747,'arguments':_0x3f61ac}})}))[_0x2d26d3(0x234)]())[_0x2d26d3(0x21b)]('\x0a')[_0x2d26d3(0x22e)](_0x702a40=>_0x702a40['startsWith'](_0x2d26d3(0x226)));if(_0x473466){let _0x425675=JSON['parse'](_0x473466[_0x2d26d3(0x1e4)](0x6));return _0x425675?.[_0x2d26d3(0x25c)]?.[_0x2d26d3(0x269)]?.[0x0]?.[_0x2d26d3(0x234)]?JSON[_0x2d26d3(0x1f3)](_0x425675[_0x2d26d3(0x25c)][_0x2d26d3(0x269)][0x0][_0x2d26d3(0x234)]):_0x425675;}return{'ok':!0x1,'error':'no\x20response'};}K[a0_0x52bbdc(0x1de)](a0_0x53b3cc,async _0x351ef0=>{const _0x6fef36=a0_0x52bbdc;let {name:_0x190361,arguments:_0x2f7355}=_0x351ef0['params'];if(_0x190361===_0x6fef36(0x1f6)){let {task_id:_0x1b3ec9,text:_0x56a23e,status:_0x386669}=_0x2f7355;if(_0x386669==='completed'||_0x386669===_0x6fef36(0x231)||_0x386669===_0x6fef36(0x230)){let _0x137a8e=_0x386669===_0x6fef36(0x200)?_0x6fef36(0x23c):_0x386669,_0x20fb1c=_0x1b3ec9?k[_0x6fef36(0x1f9)](_0x1b3ec9)||_0x6fef36(0x20b):_0x6fef36(0x20b),_0x26527e=await P(_0x6fef36(0x207),{'alias':_0x20fb1c,'text':_0x56a23e,'in_reply_to':_0x1b3ec9||void 0x0,'status':_0x137a8e,'from_session':Z});if(_0x1b3ec9)k['delete'](_0x1b3ec9);return{'content':[{'type':'text','text':JSON[_0x6fef36(0x262)](_0x26527e)}]};}let _0x80d99a=await P(_0x6fef36(0x1ed),{'resume_id':w,'alias':Z,'status':_0x386669===_0x6fef36(0x229)?_0x6fef36(0x229):_0x386669===_0x6fef36(0x212)?'error':_0x6fef36(0x258),'task':_0x56a23e[_0x6fef36(0x1e4)](0x0,0xc8),'output':_0x56a23e});return{'content':[{'type':_0x6fef36(0x234),'text':JSON['stringify'](_0x80d99a)}]};}if(_0x190361==='commhub_report_status'){let {status:_0x56103d,task:_0x177e8b,progress:_0x4213b1}=_0x2f7355,_0x2fa32f=await P(_0x6fef36(0x1ed),{'resume_id':w,'alias':Z,'status':_0x56103d,'task':_0x177e8b,'progress':_0x4213b1});return{'content':[{'type':_0x6fef36(0x234),'text':JSON[_0x6fef36(0x262)](_0x2fa32f)}]};}if(_0x190361===_0x6fef36(0x251)){let {alias:_0xe65640,task:_0x2a083d,priority:_0x33f281}=_0x2f7355,_0x369a69=await P(_0x6fef36(0x267),{'alias':_0xe65640,'task':_0x2a083d,'priority':_0x33f281||_0x6fef36(0x265),'from_session':Z});return{'content':[{'type':_0x6fef36(0x234),'text':JSON[_0x6fef36(0x262)](_0x369a69)}]};}if(_0x190361===_0x6fef36(0x240)){let {alias:_0x509e7c,message:_0x263b54}=_0x2f7355,_0x4d98f3=await P(_0x6fef36(0x21e),{'alias':_0x509e7c,'message':_0x263b54,'from_session':Z});return{'content':[{'type':_0x6fef36(0x234),'text':JSON[_0x6fef36(0x262)](_0x4d98f3)}]};}if(_0x190361===_0x6fef36(0x22f)){let _0x1affe5=await P(_0x6fef36(0x215),{});return{'content':[{'type':_0x6fef36(0x234),'text':JSON[_0x6fef36(0x262)](_0x1affe5)}]};}return{'content':[{'type':_0x6fef36(0x234),'text':JSON['stringify']({'error':_0x6fef36(0x250)})}]};});async function u(){const _0x31d8f=a0_0x52bbdc;let _0xfac32c=f+_0x31d8f(0x223)+encodeURIComponent(Z),_0x2404f4={};if(X)_0x2404f4[_0x31d8f(0x21a)]=_0x31d8f(0x23f)+X;Y(_0x31d8f(0x1e0)+_0xfac32c);while(!0x0){try{let _0x401695=await fetch(_0xfac32c,{'headers':_0x2404f4});if(!_0x401695['ok']){Y(_0x31d8f(0x221)+_0x401695[_0x31d8f(0x1e7)]+'\x20'+_0x401695[_0x31d8f(0x1ec)]),await h(0x1388);continue;}let _0x30f520=_0x401695[_0x31d8f(0x203)]['getReader'](),_0x2da09e=new TextDecoder(),_0x5a4313='';while(!0x0){let {done:_0x6aae45,value:_0xc53875}=await _0x30f520['read']();if(_0x6aae45)break;_0x5a4313+=_0x2da09e['decode'](_0xc53875,{'stream':!0x0});let _0x5ae5cf=_0x5a4313[_0x31d8f(0x21b)]('\x0a\x0a');_0x5a4313=_0x5ae5cf[_0x31d8f(0x216)]()||'';for(let _0x103939 of _0x5ae5cf){let _0x2b5ddd=_0x103939[_0x31d8f(0x21b)]('\x0a')[_0x31d8f(0x22e)](_0x1b0b1a=>_0x1b0b1a['startsWith'](_0x31d8f(0x226)));if(!_0x2b5ddd)continue;try{let _0x201a7d=JSON[_0x31d8f(0x1f3)](_0x2b5ddd[_0x31d8f(0x1e4)](0x6));await S(_0x201a7d);}catch(_0x4808c9){Y(_0x31d8f(0x1f4)+_0x4808c9);}}}Y(_0x31d8f(0x20d));}catch(_0x5c3b26){Y(_0x31d8f(0x235)+_0x5c3b26);}await h(0xbb8);}}async function S(_0x230ff0){const _0x166403=a0_0x52bbdc;if(_0x230ff0[_0x166403(0x24b)]===_0x166403(0x23d)){Y('SSE\x20connected\x20as\x20\x22'+Z+'\x22');return;}if(_0x230ff0['type']===_0x166403(0x209)){if(Y('←\x20message\x20from\x20'+_0x230ff0[_0x166403(0x224)]+':\x20'+_0x230ff0[_0x166403(0x25f)][_0x166403(0x1e4)](0x0,0x3c)),await K['notification']({'method':_0x166403(0x1e1),'params':{'content':_0x230ff0['message'],'meta':{'sender':_0x230ff0['from']||_0x166403(0x20b),'sender_id':_0x166403(0x25d),'user':_0x230ff0[_0x166403(0x224)]||_0x166403(0x20b),'priority':_0x166403(0x265)}}}),_0x230ff0[_0x166403(0x1e6)])await P(_0x166403(0x206),{'alias':Z,'message_id':_0x230ff0[_0x166403(0x1e6)]});return;}if(_0x230ff0[_0x166403(0x24b)]==='new_task'||_0x230ff0[_0x166403(0x24b)]===_0x166403(0x208)){Y('←\x20'+_0x230ff0['type']+':\x20inbox_count='+_0x230ff0['inbox_count']+_0x166403(0x264)+(_0x230ff0['priority']||_0x166403(0x265)));let _0x3f58e2=await P(_0x166403(0x1fe),{'alias':Z,'limit':0x5});if(_0x3f58e2?.['ok']&&_0x3f58e2[_0x166403(0x23b)]?.[_0x166403(0x237)]>0x0)for(let _0x38e1ab of _0x3f58e2['messages']){let _0x101c3c={'sender':_0x38e1ab[_0x166403(0x257)]||'hub','sender_id':_0x166403(0x25d),'user':_0x38e1ab[_0x166403(0x257)]||_0x166403(0x20b),'task_id':_0x38e1ab['id'],'priority':_0x38e1ab[_0x166403(0x259)]||_0x166403(0x265)};k[_0x166403(0x222)](_0x38e1ab['id'],_0x38e1ab[_0x166403(0x257)]||_0x166403(0x20b)),await K[_0x166403(0x242)]({'method':'notifications/claude/channel','params':{'content':_0x38e1ab[_0x166403(0x269)],'meta':_0x101c3c}}),Y(_0x166403(0x24d)+_0x38e1ab['id'][_0x166403(0x1e4)](0x0,0x8)+'\x20from\x20'+_0x38e1ab[_0x166403(0x257)]+':\x20'+_0x38e1ab[_0x166403(0x269)][_0x166403(0x1e4)](0x0,0x3c)),await P(_0x166403(0x206),{'alias':Z,'message_id':_0x38e1ab['id']});}}}async function A(){const _0x7b3b30=a0_0x52bbdc;let _0x118f0e=new a0_0x37debf();await K['connect'](_0x118f0e),Y('MCP\x20stdio\x20connected'),Y(_0x7b3b30(0x1e2)),u()[_0x7b3b30(0x252)](_0x514f32=>Y('SSE\x20fatal:\x20'+_0x514f32)),P(_0x7b3b30(0x1ed),{'resume_id':w,'alias':Z,'status':_0x7b3b30(0x254),'server':a0_0xbe43f3(),'hostname':a0_0xbe43f3(),'agent':_0x7b3b30(0x241),'project_dir':process[_0x7b3b30(0x22a)](),'tmux_name':j||void 0x0})[_0x7b3b30(0x21c)](()=>Y('registered\x20as\x20\x22'+Z+_0x7b3b30(0x1ea)+w[_0x7b3b30(0x1e4)](0x0,0x8)+')'))['catch'](_0x362126=>Y(_0x7b3b30(0x248)+_0x362126)),setInterval(()=>{const _0x1d3fe1=_0x7b3b30;P(_0x1d3fe1(0x1ed),{'resume_id':w,'alias':Z,'status':_0x1d3fe1(0x254),'server':a0_0xbe43f3(),'hostname':a0_0xbe43f3(),'agent':_0x1d3fe1(0x241),'project_dir':process['cwd'](),'tmux_name':j||void 0x0})[_0x1d3fe1(0x252)](_0x3ecae5=>Y(_0x1d3fe1(0x24e)+_0x3ecae5));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}A()[a0_0x52bbdc(0x252)](_0x272e8b=>{const _0x18e83c=a0_0x52bbdc;Y(_0x18e83c(0x20c)+_0x272e8b),process[_0x18e83c(0x238)](0x1);});async function N(){const _0x2b8b9a=a0_0x52bbdc;Y(_0x2b8b9a(0x233)),await P(_0x2b8b9a(0x1ed),{'resume_id':w,'alias':Z,'status':_0x2b8b9a(0x212),'task':_0x2b8b9a(0x1fd)})[_0x2b8b9a(0x252)](()=>{}),process[_0x2b8b9a(0x238)](0x0);}process[a0_0x52bbdc(0x255)]['on'](a0_0x52bbdc(0x24a),()=>N()),process['on'](a0_0x52bbdc(0x1ee),()=>N()),process['on'](a0_0x52bbdc(0x260),()=>N());
2
+ const a0_0x2cddd2=a0_0x2ae2;function a0_0x2ae2(_0x41711c,_0x532c23){_0x41711c=_0x41711c-0xdd;const _0x4ca864=a0_0x4ca8();let _0x2ae21b=_0x4ca864[_0x41711c];return _0x2ae21b;}(function(_0x15b936,_0x2b1002){const _0x52767b=a0_0x2ae2,_0x1a0151=_0x15b936();while(!![]){try{const _0x5f2267=-parseInt(_0x52767b(0xe9))/0x1+parseInt(_0x52767b(0xe4))/0x2+-parseInt(_0x52767b(0x165))/0x3+parseInt(_0x52767b(0x12c))/0x4+parseInt(_0x52767b(0x134))/0x5*(parseInt(_0x52767b(0x143))/0x6)+-parseInt(_0x52767b(0x102))/0x7*(parseInt(_0x52767b(0xff))/0x8)+-parseInt(_0x52767b(0x14c))/0x9*(parseInt(_0x52767b(0xdf))/0xa);if(_0x5f2267===_0x2b1002)break;else _0x1a0151['push'](_0x1a0151['shift']());}catch(_0x5e3baa){_0x1a0151['push'](_0x1a0151['shift']());}}}(a0_0x4ca8,0x42111));import{readFileSync as a0_0x131fe4,existsSync as a0_0x6292c7}from'fs';import{randomUUID as a0_0x53a27a}from'crypto';import{join as a0_0x3cb4a0}from'path';import{hostname as a0_0x3418b5}from'os';import{execSync as a0_0x2fe0ce}from'child_process';import{Server as a0_0x4a6eee}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x50572c}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0xc5658e,CallToolRequestSchema as a0_0x5e6db6}from'@modelcontextprotocol/sdk/types.js';function p(_0x5ee52b){const _0x226df8=a0_0x2ae2;if(!a0_0x6292c7(_0x5ee52b))return;for(let _0x1ea3ed of a0_0x131fe4(_0x5ee52b,_0x226df8(0xe8))[_0x226df8(0xe0)]('\x0a')){let _0x277150=_0x1ea3ed['trim']();if(!_0x277150||_0x277150[_0x226df8(0x136)]('#'))continue;let _0x4716d7=_0x277150['indexOf']('=');if(_0x4716d7<0x0)continue;let _0x52c638=_0x277150[_0x226df8(0xf8)](0x0,_0x4716d7)[_0x226df8(0xf2)](),_0x37c936=_0x277150[_0x226df8(0xf8)](_0x4716d7+0x1)['trim']()[_0x226df8(0xeb)](/^["']|["']$/g,'');if(!process.env[_0x52c638])process.env[_0x52c638]=_0x37c936;}}var C=process.env.HOME||'~',T=a0_0x3cb4a0(C,a0_0x2cddd2(0x108));p(a0_0x3cb4a0(T,a0_0x2cddd2(0x13e)));var L=process['cwd']()['replace'](/\//g,'-');p(a0_0x3cb4a0(T,L,'.env'));function U(){const _0x1f4516=a0_0x2cddd2;try{return a0_0x2fe0ce(_0x1f4516(0x107),{'encoding':_0x1f4516(0xe8),'timeout':0x7d0})[_0x1f4516(0xf2)]();}catch{return'';}}function v(){const _0x2d7863=a0_0x2cddd2;try{let _0x1a70ea=a0_0x3cb4a0(C,_0x2d7863(0x11b),'config.json');if(a0_0x6292c7(_0x1a70ea))return JSON[_0x2d7863(0x15f)](a0_0x131fe4(_0x1a70ea,_0x2d7863(0xe8)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H['hub']||a0_0x2cddd2(0x161),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x3418b5(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x53a27a(),X=process.env.COMMHUB_TOKEN||H[a0_0x2cddd2(0x15c)]||'';function Y(_0x11c94a){const _0xc824bb=a0_0x2cddd2;let _0x4d9b03=new Date()[_0xc824bb(0xed)]()[_0xc824bb(0xf8)](0x0,0x8);process[_0xc824bb(0x112)][_0xc824bb(0xf6)]('['+_0x4d9b03+_0xc824bb(0x160)+_0x11c94a+'\x0a');}function h(_0x5da42d){return new Promise(_0x277af6=>setTimeout(_0x277af6,_0x5da42d));}Y('ENV:\x20URL='+f+a0_0x2cddd2(0xef)+Z+a0_0x2cddd2(0x10d)+w[a0_0x2cddd2(0xf8)](0x0,0x8)+a0_0x2cddd2(0x119)+(j||a0_0x2cddd2(0xe7))+a0_0x2cddd2(0xfc)+process['cwd']()+'\x20PROJECT_ENV='+L);var k=new Map(),K=new a0_0x4a6eee({'name':a0_0x2cddd2(0x125),'version':a0_0x2cddd2(0x132)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x2cddd2(0x130),a0_0x2cddd2(0x116),a0_0x2cddd2(0xe3),a0_0x2cddd2(0x105),a0_0x2cddd2(0x109)+Z][a0_0x2cddd2(0xf4)]('\x0a')});K[a0_0x2cddd2(0x101)](a0_0xc5658e,async()=>({'tools':[{'name':a0_0x2cddd2(0x104),'description':'Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','inputSchema':{'type':a0_0x2cddd2(0x12a),'properties':{'task_id':{'type':a0_0x2cddd2(0xf1),'description':'The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)'},'text':{'type':a0_0x2cddd2(0xf1),'description':a0_0x2cddd2(0x110)},'status':{'type':a0_0x2cddd2(0xf1),'enum':[a0_0x2cddd2(0x13f),a0_0x2cddd2(0xee),a0_0x2cddd2(0x111),'blocked',a0_0x2cddd2(0x148),a0_0x2cddd2(0x115)],'description':a0_0x2cddd2(0x141)}},'required':[a0_0x2cddd2(0x121)]}},{'name':a0_0x2cddd2(0x157),'description':a0_0x2cddd2(0x152),'inputSchema':{'type':a0_0x2cddd2(0x12a),'properties':{'status':{'type':a0_0x2cddd2(0xf1),'enum':['working',a0_0x2cddd2(0xe5),a0_0x2cddd2(0x150),'error']},'task':{'type':a0_0x2cddd2(0xf1),'description':'Current\x20task\x20description'},'progress':{'type':a0_0x2cddd2(0xf3),'description':'Progress\x200-100'}},'required':['status']}},{'name':a0_0x2cddd2(0x14a),'description':a0_0x2cddd2(0x14b),'inputSchema':{'type':a0_0x2cddd2(0x12a),'properties':{'alias':{'type':a0_0x2cddd2(0xf1),'description':a0_0x2cddd2(0x149)},'task':{'type':'string','description':a0_0x2cddd2(0x122)},'priority':{'type':a0_0x2cddd2(0xf1),'enum':[a0_0x2cddd2(0x11a),'normal','low'],'description':a0_0x2cddd2(0x10c)}},'required':[a0_0x2cddd2(0x126),a0_0x2cddd2(0x137)]}},{'name':a0_0x2cddd2(0x139),'description':a0_0x2cddd2(0x158),'inputSchema':{'type':a0_0x2cddd2(0x12a),'properties':{'alias':{'type':a0_0x2cddd2(0xf1),'description':a0_0x2cddd2(0x149)},'message':{'type':a0_0x2cddd2(0xf1),'description':a0_0x2cddd2(0x145)}},'required':[a0_0x2cddd2(0x126),a0_0x2cddd2(0x11e)]}},{'name':a0_0x2cddd2(0xfd),'description':a0_0x2cddd2(0x12d),'inputSchema':{'type':a0_0x2cddd2(0x12a),'properties':{}}}]}));async function P(_0x51cc60,_0x12561e){const _0x2bdd94=a0_0x2cddd2;let _0x1ca46d=await fetch(f+_0x2bdd94(0x113),{'method':_0x2bdd94(0x14e),'headers':{'Content-Type':_0x2bdd94(0x135),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x2bdd94(0x138)+X}:{}},'body':JSON[_0x2bdd94(0xfb)]({'jsonrpc':_0x2bdd94(0xf0),'id':0x1,'method':_0x2bdd94(0x147),'params':{'protocolVersion':_0x2bdd94(0x12e),'capabilities':{},'clientInfo':{'name':_0x2bdd94(0x125),'version':_0x2bdd94(0x132)}}})});if(!_0x1ca46d['ok']){let _0x8dc6b4=await _0x1ca46d[_0x2bdd94(0x121)]();return Y('CommHub\x20init\x20failed:\x20'+_0x1ca46d[_0x2bdd94(0x10f)]+'\x20'+_0x8dc6b4[_0x2bdd94(0xf8)](0x0,0x64)),{'ok':!0x1,'error':_0x2bdd94(0x120)+_0x1ca46d[_0x2bdd94(0x10f)]};}await _0x1ca46d[_0x2bdd94(0x121)]();let _0xd982e2=(await(await fetch(f+_0x2bdd94(0x113),{'method':_0x2bdd94(0x14e),'headers':{'Content-Type':_0x2bdd94(0x135),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x2bdd94(0x138)+X}:{}},'body':JSON[_0x2bdd94(0xfb)]({'jsonrpc':_0x2bdd94(0xf0),'id':0x2,'method':_0x2bdd94(0x15d),'params':{'name':_0x51cc60,'arguments':_0x12561e}})}))[_0x2bdd94(0x121)]())[_0x2bdd94(0xe0)]('\x0a')[_0x2bdd94(0x131)](_0x4ac3a0=>_0x4ac3a0[_0x2bdd94(0x136)](_0x2bdd94(0x14d)));if(_0xd982e2){let _0x55266f=JSON[_0x2bdd94(0x15f)](_0xd982e2[_0x2bdd94(0xf8)](0x6));return _0x55266f?.[_0x2bdd94(0xde)]?.[_0x2bdd94(0x13d)]?.[0x0]?.[_0x2bdd94(0x121)]?JSON[_0x2bdd94(0x15f)](_0x55266f[_0x2bdd94(0xde)]['content'][0x0][_0x2bdd94(0x121)]):_0x55266f;}return{'ok':!0x1,'error':'no\x20response'};}K[a0_0x2cddd2(0x101)](a0_0x5e6db6,async _0x5cda52=>{const _0x38e297=a0_0x2cddd2;let {name:_0x291335,arguments:_0x367f7e}=_0x5cda52[_0x38e297(0xe6)];if(_0x291335===_0x38e297(0x104)){let {task_id:_0x261ca0,text:_0x114ca5,status:_0x1bc82e}=_0x367f7e;if(_0x1bc82e===_0x38e297(0x13f)||_0x1bc82e===_0x38e297(0xee)||_0x1bc82e===_0x38e297(0x111)){let _0x29584f=_0x1bc82e===_0x38e297(0x13f)?_0x38e297(0x15a):_0x1bc82e,_0x3a311a=_0x261ca0?k['get'](_0x261ca0)||_0x38e297(0x114):'hub',_0x2cf7b7=await P(_0x38e297(0x14f),{'alias':_0x3a311a,'text':_0x114ca5,'in_reply_to':_0x261ca0||void 0x0,'status':_0x29584f,'from_session':Z});if(_0x261ca0)k[_0x38e297(0x103)](_0x261ca0);return{'content':[{'type':_0x38e297(0x121),'text':JSON['stringify'](_0x2cf7b7)}]};}let _0x19655d=await P(_0x38e297(0x15b),{'resume_id':w,'alias':Z,'status':_0x1bc82e===_0x38e297(0x150)?_0x38e297(0x150):_0x1bc82e===_0x38e297(0x148)?_0x38e297(0x148):_0x38e297(0x142),'task':_0x114ca5[_0x38e297(0xf8)](0x0,0xc8),'output':_0x114ca5});return{'content':[{'type':_0x38e297(0x121),'text':JSON[_0x38e297(0xfb)](_0x19655d)}]};}if(_0x291335===_0x38e297(0x157)){let {status:_0x2c4c08,task:_0xaca678,progress:_0x3cfdb4}=_0x367f7e,_0x10a274=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x2c4c08,'task':_0xaca678,'progress':_0x3cfdb4});return{'content':[{'type':_0x38e297(0x121),'text':JSON[_0x38e297(0xfb)](_0x10a274)}]};}if(_0x291335===_0x38e297(0x14a)){let {alias:_0xe89684,task:_0x3d3282,priority:_0x203c82}=_0x367f7e,_0xf6ba98=await P(_0x38e297(0xdd),{'alias':_0xe89684,'task':_0x3d3282,'priority':_0x203c82||'normal','from_session':Z});return{'content':[{'type':_0x38e297(0x121),'text':JSON[_0x38e297(0xfb)](_0xf6ba98)}]};}if(_0x291335===_0x38e297(0x139)){let {alias:_0x590a24,message:_0x4e6cf6}=_0x367f7e,_0x5cdb60=await P(_0x38e297(0x11c),{'alias':_0x590a24,'message':_0x4e6cf6,'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x38e297(0xfb)](_0x5cdb60)}]};}if(_0x291335===_0x38e297(0xfd)){let _0x5aa5c6=await P(_0x38e297(0x11f),{});return{'content':[{'type':_0x38e297(0x121),'text':JSON['stringify'](_0x5aa5c6)}]};}return{'content':[{'type':'text','text':JSON['stringify']({'error':_0x38e297(0x127)})}]};});async function u(){const _0x1a5d59=a0_0x2cddd2;let _0x331027=f+'/events/'+encodeURIComponent(Z),_0x19a202={};if(X)_0x19a202['Authorization']=_0x1a5d59(0x138)+X;Y('connecting\x20to\x20'+_0x331027);while(!0x0){try{let _0x7197fd=await fetch(_0x331027,{'headers':_0x19a202});if(!_0x7197fd['ok']){Y(_0x1a5d59(0x156)+_0x7197fd[_0x1a5d59(0x10f)]+'\x20'+_0x7197fd['statusText']),await h(0x1388);continue;}let _0x4005a1=_0x7197fd['body']['getReader'](),_0x3ab9e3=new TextDecoder(),_0x20755a='';while(!0x0){let {done:_0x347523,value:_0x1258f1}=await _0x4005a1['read']();if(_0x347523)break;_0x20755a+=_0x3ab9e3[_0x1a5d59(0x164)](_0x1258f1,{'stream':!0x0});let _0x401688=_0x20755a['split']('\x0a\x0a');_0x20755a=_0x401688[_0x1a5d59(0x151)]()||'';for(let _0x2cfc3e of _0x401688){let _0x2df111=_0x2cfc3e[_0x1a5d59(0xe0)]('\x0a')[_0x1a5d59(0x131)](_0x3565e7=>_0x3565e7[_0x1a5d59(0x136)](_0x1a5d59(0x14d)));if(!_0x2df111)continue;try{let _0x1f672c=JSON[_0x1a5d59(0x15f)](_0x2df111['slice'](0x6));await S(_0x1f672c);}catch(_0x2cf1af){Y(_0x1a5d59(0xf9)+_0x2cf1af);}}}Y(_0x1a5d59(0x10b));}catch(_0x150078){Y(_0x1a5d59(0x11d)+_0x150078);}await h(0xbb8);}}async function S(_0x1ffc6c){const _0x5b0b37=a0_0x2cddd2;if(_0x1ffc6c['type']===_0x5b0b37(0xf5)){Y(_0x5b0b37(0x128)+Z+'\x22');return;}if(_0x1ffc6c[_0x5b0b37(0x100)]==='new_message'){if(Y(_0x5b0b37(0x159)+_0x1ffc6c[_0x5b0b37(0x13b)]+':\x20'+_0x1ffc6c[_0x5b0b37(0x11e)][_0x5b0b37(0xf8)](0x0,0x3c)),await K[_0x5b0b37(0x133)]({'method':_0x5b0b37(0x140),'params':{'content':_0x1ffc6c[_0x5b0b37(0x11e)],'meta':{'sender':_0x1ffc6c[_0x5b0b37(0x13b)]||_0x5b0b37(0x114),'sender_id':'commhub','user':_0x1ffc6c[_0x5b0b37(0x13b)]||_0x5b0b37(0x114),'priority':_0x5b0b37(0x153)}}}),_0x1ffc6c[_0x5b0b37(0x163)])await P(_0x5b0b37(0xe1),{'alias':Z,'message_id':_0x1ffc6c[_0x5b0b37(0x163)]});return;}if(_0x1ffc6c['type']===_0x5b0b37(0x10a)||_0x1ffc6c['type']==='broadcast'){Y('←\x20'+_0x1ffc6c[_0x5b0b37(0x100)]+':\x20inbox_count='+_0x1ffc6c['inbox_count']+_0x5b0b37(0xfe)+(_0x1ffc6c['priority']||_0x5b0b37(0x153)));let _0x5873ce=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0x5873ce?.['ok']&&_0x5873ce[_0x5b0b37(0x15e)]?.[_0x5b0b37(0xf7)]>0x0)for(let _0x58da81 of _0x5873ce[_0x5b0b37(0x15e)]){let _0x31c5c2={'sender':_0x58da81[_0x5b0b37(0x118)]||'hub','sender_id':'commhub','user':_0x58da81[_0x5b0b37(0x118)]||_0x5b0b37(0x114),'task_id':_0x58da81['id'],'priority':_0x58da81[_0x5b0b37(0xea)]||_0x5b0b37(0x153)};k[_0x5b0b37(0x12f)](_0x58da81['id'],_0x58da81[_0x5b0b37(0x118)]||'hub'),await K[_0x5b0b37(0x133)]({'method':_0x5b0b37(0x140),'params':{'content':_0x58da81[_0x5b0b37(0x13d)],'meta':_0x31c5c2}}),Y(_0x5b0b37(0x162)+_0x58da81['id'][_0x5b0b37(0xf8)](0x0,0x8)+_0x5b0b37(0x144)+_0x58da81[_0x5b0b37(0x118)]+':\x20'+_0x58da81[_0x5b0b37(0x13d)][_0x5b0b37(0xf8)](0x0,0x3c)),await P(_0x5b0b37(0xe1),{'alias':Z,'message_id':_0x58da81['id']});}}}async function A(){const _0x4ab410=a0_0x2cddd2;let _0x57bc14=new a0_0x50572c();await K['connect'](_0x57bc14),Y('MCP\x20stdio\x20connected'),Y(_0x4ab410(0x123)),u()[_0x4ab410(0x10e)](_0x7b8159=>Y(_0x4ab410(0x117)+_0x7b8159)),P(_0x4ab410(0x15b),{'resume_id':w,'alias':Z,'status':_0x4ab410(0xe5),'server':a0_0x3418b5(),'hostname':a0_0x3418b5(),'agent':'claude-code','project_dir':process[_0x4ab410(0x13c)](),'tmux_name':j||void 0x0})[_0x4ab410(0x146)](()=>Y('registered\x20as\x20\x22'+Z+_0x4ab410(0xec)+w[_0x4ab410(0xf8)](0x0,0x8)+')'))[_0x4ab410(0x10e)](_0x30238b=>Y('warning:\x20could\x20not\x20register:\x20'+_0x30238b)),setInterval(()=>{const _0x130d74=_0x4ab410;P('report_status',{'resume_id':w,'alias':Z,'status':_0x130d74(0xe5),'server':a0_0x3418b5(),'hostname':a0_0x3418b5(),'agent':_0x130d74(0x106),'project_dir':process[_0x130d74(0x13c)](),'tmux_name':j||void 0x0})[_0x130d74(0x10e)](_0x11d1bc=>Y(_0x130d74(0x124)+_0x11d1bc));},0x2bf20),Y(_0x4ab410(0x12b));}A()['catch'](_0x2bc8ff=>{const _0x1a7de1=a0_0x2cddd2;Y(_0x1a7de1(0x155)+_0x2bc8ff),process['exit'](0x1);});async function N(){const _0x10b6c1=a0_0x2cddd2;Y('shutting\x20down,\x20reporting\x20offline...'),await P(_0x10b6c1(0x15b),{'resume_id':w,'alias':Z,'status':'error','task':_0x10b6c1(0xe2)})[_0x10b6c1(0x10e)](()=>{}),process[_0x10b6c1(0x129)](0x0);}process[a0_0x2cddd2(0xfa)]['on'](a0_0x2cddd2(0x154),()=>N()),process['on']('SIGTERM',()=>N()),process['on'](a0_0x2cddd2(0x13a),()=>N());function a0_0x4ca8(){const _0x322056=['parse',']\x20[commhub]\x20','http://127.0.0.1:9200','→\x20injected\x20task\x20','message_id','decode','964638iUapSa','send_task','result','10ZyHYvH','split','ack_inbox','session\x20disconnected','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','898656AvXvcJ','idle','params','none','utf-8','226249cWACzh','priority','replace','\x22\x20(','toTimeString','failed','\x20ALIAS=','2.0','string','trim','number','join','connected','write','length','slice','parse\x20error:\x20','stdin','stringify','\x20CWD=','commhub_get_all_status','\x20priority=','206728FqohRy','type','setRequestHandler','7tOmqRi','delete','commhub_reply','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','claude-code','tmux\x20display-message\x20-p\x20\x27#S\x27','.claude/channels/commhub','Session\x20alias:\x20','new_task','SSE\x20stream\x20ended,\x20reconnecting...','Priority\x20(default:\x20normal)','\x20RESUME_ID=','catch','status','Reply\x20text\x20/\x20result\x20summary','cancelled','stderr','/mcp','hub','in_progress','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','SSE\x20fatal:\x20','from_session','...\x20TMUX=','high','.anet','send_message','SSE\x20connection\x20error:\x20','message','get_all_status','init\x20failed:\x20','text','Task\x20content','starting\x20SSE\x20listener...','heartbeat\x20failed:\x20','commhub-channel','alias','unknown\x20tool','SSE\x20connected\x20as\x20\x22','exit','object','ready\x20—\x20waiting\x20for\x20events','945400QrcElN','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','2025-03-26','set','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','find','0.3.0','notification','185ObbNpM','application/json','startsWith','task','Bearer\x20','commhub_send_message','SIGINT','from','cwd','content','.env','completed','notifications/claude/channel','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','working','31362gbxilt','\x20from\x20','Message\x20content','then','initialize','error','Target\x20session\x20alias','commhub_send_task','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','313488Dyrqbs','data:\x20','POST','send_reply','blocked','pop','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','normal','end','fatal:\x20','SSE\x20error:\x20','commhub_report_status','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','←\x20message\x20from\x20','replied','report_status','token','tools/call','messages'];a0_0x4ca8=function(){return _0x322056;};return a0_0x4ca8();}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.1.10-preview.0",
3
+ "version": "2.1.11-preview.0",
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",