@sleep2agi/agent-network 2.2.8-preview.0 → 2.2.8

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_0x126c(_0x9d5e15,_0x454483){_0x9d5e15=_0x9d5e15-0x19f;const _0x2d9f5a=a0_0x2d9f();let _0x126c53=_0x2d9f5a[_0x9d5e15];return _0x126c53;}const a0_0x2a1977=a0_0x126c;(function(_0x1112c6,_0x482e9d){const _0x2af74f=a0_0x126c,_0x88a286=_0x1112c6();while(!![]){try{const _0x1ef32f=parseInt(_0x2af74f(0x1d4))/0x1+parseInt(_0x2af74f(0x1a5))/0x2*(-parseInt(_0x2af74f(0x1e9))/0x3)+parseInt(_0x2af74f(0x1ac))/0x4*(parseInt(_0x2af74f(0x1b6))/0x5)+-parseInt(_0x2af74f(0x1d3))/0x6*(parseInt(_0x2af74f(0x1cf))/0x7)+parseInt(_0x2af74f(0x1a7))/0x8+-parseInt(_0x2af74f(0x1dd))/0x9*(-parseInt(_0x2af74f(0x1c0))/0xa)+-parseInt(_0x2af74f(0x1d9))/0xb;if(_0x1ef32f===_0x482e9d)break;else _0x88a286['push'](_0x88a286['shift']());}catch(_0x1e4549){_0x88a286['push'](_0x88a286['shift']());}}}(a0_0x2d9f,0x8282c));import{EventEmitter as a0_0x55dfd5}from'events';import{hostname as a0_0x13df40}from'os';class T extends a0_0x55dfd5{[a0_0x2a1977(0x1c5)];[a0_0x2a1977(0x1b8)];[a0_0x2a1977(0x1df)];['agent'];['resumeId'];[a0_0x2a1977(0x1d5)];[a0_0x2a1977(0x1ce)];['heartbeatTimer'];['sseAbort'];['running']=!0x1;constructor(_0x52d248){const _0x4fc0c1=a0_0x2a1977;super();if(this[_0x4fc0c1(0x1c5)]=_0x52d248[_0x4fc0c1(0x1c5)][_0x4fc0c1(0x1a8)](/\/$/,''),this[_0x4fc0c1(0x1b8)]=_0x52d248[_0x4fc0c1(0x1b8)],this[_0x4fc0c1(0x1df)]=_0x52d248[_0x4fc0c1(0x1df)],this['agent']=_0x52d248[_0x4fc0c1(0x1a9)]||_0x4fc0c1(0x1d7),this['resumeId']=_0x4fc0c1(0x1b3)+_0x52d248[_0x4fc0c1(0x1b8)]+'-'+Date[_0x4fc0c1(0x1c2)]()['toString'](0x24),this[_0x4fc0c1(0x1d5)]=_0x52d248[_0x4fc0c1(0x1d5)]??0x2bf20,this['reconnectDelay']=_0x52d248[_0x4fc0c1(0x1ce)]??0xbb8,_0x52d248['autoConnect']!==!0x1)this[_0x4fc0c1(0x1e4)]();}['log'](_0x3d4433){const _0x334914=a0_0x2a1977;console[_0x334914(0x1c8)]('['+new Date()[_0x334914(0x19f)]()[_0x334914(0x1de)](0x0,0x8)+']\x20[commhub:'+this['alias']+']\x20'+_0x3d4433);}async[a0_0x2a1977(0x1d1)](_0x1942ba,_0x11dd5c){const _0x31f739=a0_0x2a1977;let _0x192176={'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream'};if(this[_0x31f739(0x1df)])_0x192176[_0x31f739(0x1f0)]=_0x31f739(0x1c1)+this[_0x31f739(0x1df)];let _0x55a6c0=await(await fetch(this[_0x31f739(0x1c5)]+_0x31f739(0x1a1),{'method':'POST','headers':_0x192176,'body':JSON[_0x31f739(0x1ea)]({'jsonrpc':_0x31f739(0x1ae),'id':Date['now'](),'method':_0x31f739(0x1cb),'params':{'name':_0x1942ba,'arguments':_0x11dd5c}})}))[_0x31f739(0x1e5)](),_0x218020=_0x55a6c0[_0x31f739(0x1aa)](/data: (.+)/),_0x66773d=_0x218020?JSON[_0x31f739(0x1b2)](_0x218020[0x1]):JSON['parse'](_0x55a6c0),_0x5b34a7=_0x66773d?.[_0x31f739(0x1e8)]?.[_0x31f739(0x1b4)]?.[0x0]?.[_0x31f739(0x1e5)];return _0x5b34a7?JSON[_0x31f739(0x1b2)](_0x5b34a7):_0x66773d;}async[a0_0x2a1977(0x1e4)](){const _0x260df2=a0_0x2a1977;if(this[_0x260df2(0x1da)])return;this[_0x260df2(0x1da)]=!0x0,await this['status']('idle'),this[_0x260df2(0x1c8)]('registered'),this['heartbeatTimer']=setInterval(()=>{const _0x31aaef=_0x260df2;this['status']('idle')[_0x31aaef(0x1bf)](_0x4f9b3a=>this[_0x31aaef(0x1c8)](_0x31aaef(0x1db)+_0x4f9b3a[_0x31aaef(0x1d8)]));},this['heartbeatInterval']),this[_0x260df2(0x1b5)]();}async[a0_0x2a1977(0x1af)](){const _0x20b5f7=a0_0x2a1977;if(this[_0x20b5f7(0x1da)]=!0x1,this[_0x20b5f7(0x1ec)]?.['abort'](),this[_0x20b5f7(0x1cd)])clearInterval(this['heartbeatTimer']);await this[_0x20b5f7(0x1ef)]('offline')[_0x20b5f7(0x1bf)](()=>{}),this[_0x20b5f7(0x1c8)](_0x20b5f7(0x1c3));}async[a0_0x2a1977(0x1be)](_0x16bb5d,_0x267873,_0x255f90='normal'){const _0x6dc0e8=a0_0x2a1977;return this[_0x6dc0e8(0x1d1)](_0x6dc0e8(0x1e6),{'alias':_0x16bb5d,'task':_0x267873,'priority':_0x255f90,'from_session':this['alias']});}async['message'](_0x40c11b,_0xf8289e){const _0x26d5f2=a0_0x2a1977;return this[_0x26d5f2(0x1d1)](_0x26d5f2(0x1cc),{'alias':_0x40c11b,'message':_0xf8289e,'from_session':this[_0x26d5f2(0x1b8)]});}async['reply'](_0x4ea6ce,_0x28209b,_0x5986f3=a0_0x2a1977(0x1a3)){const _0x5d7d49=a0_0x2a1977;return this[_0x5d7d49(0x1d1)]('send_reply',{'in_reply_to':_0x4ea6ce,'text':_0x28209b,'status':_0x5986f3});}async['status'](_0x1d7abf,_0x58a898){const _0x2a500f=a0_0x2a1977;return this['call'](_0x2a500f(0x1c9),{'resume_id':this[_0x2a500f(0x1b7)],'alias':this[_0x2a500f(0x1b8)],'status':_0x1d7abf,'server':a0_0x13df40(),'hostname':a0_0x13df40(),'agent':this[_0x2a500f(0x1a9)],'project_dir':process['cwd'](),..._0x58a898});}async[a0_0x2a1977(0x1bb)](){const _0x3c479a=a0_0x2a1977;return this[_0x3c479a(0x1d1)]('get_all_status',{});}async[a0_0x2a1977(0x1b9)](_0x52199c,_0x206caa){const _0x25bb33=a0_0x2a1977;return this['call'](_0x25bb33(0x1b9),{'message':_0x52199c,'filter_server':_0x206caa?.[_0x25bb33(0x1a0)],'filter_status':_0x206caa?.[_0x25bb33(0x1ef)]});}async['connectSSE'](){const _0x1d4a37=a0_0x2a1977;let _0x1a0baf=encodeURIComponent(this['alias']),_0x55ff5b=this['url']+_0x1d4a37(0x1b0)+_0x1a0baf,_0x2b2287=this['reconnectDelay'];while(this[_0x1d4a37(0x1da)]){try{this[_0x1d4a37(0x1ec)]=new AbortController();let _0x1ae577={'Accept':'text/event-stream'};if(this['token'])_0x1ae577[_0x1d4a37(0x1f0)]=_0x1d4a37(0x1c1)+this[_0x1d4a37(0x1df)];let _0x29da24=await fetch(_0x55ff5b,{'headers':_0x1ae577,'signal':this['sseAbort'][_0x1d4a37(0x1ed)]});if(!_0x29da24['ok']||!_0x29da24[_0x1d4a37(0x1e1)]){this[_0x1d4a37(0x1c8)](_0x1d4a37(0x1a4)+_0x29da24[_0x1d4a37(0x1ef)]),await this['sleep'](_0x2b2287),_0x2b2287=Math[_0x1d4a37(0x1d6)](_0x2b2287*1.5,0xea60);continue;}_0x2b2287=this[_0x1d4a37(0x1ce)];let _0xe9bcc2=_0x29da24[_0x1d4a37(0x1e1)][_0x1d4a37(0x1e0)](),_0x259a32=new TextDecoder(),_0x1d2857='';while(this['running']){let {done:_0x5940fd,value:_0x203cc2}=await _0xe9bcc2[_0x1d4a37(0x1bd)]();if(_0x5940fd)break;_0x1d2857+=_0x259a32[_0x1d4a37(0x1c7)](_0x203cc2,{'stream':!0x0});let _0x94d418=_0x1d2857[_0x1d4a37(0x1e2)]('\x0a');_0x1d2857=_0x94d418[_0x1d4a37(0x1e7)]()||'';for(let _0x386506 of _0x94d418){if(!_0x386506[_0x1d4a37(0x1bc)](_0x1d4a37(0x1d2)))continue;try{let _0xd7aabf=JSON[_0x1d4a37(0x1b2)](_0x386506['slice'](0x6));if(_0xd7aabf[_0x1d4a37(0x1a2)]==='connected'){this[_0x1d4a37(0x1c8)](_0x1d4a37(0x1d0)),this[_0x1d4a37(0x1dc)](_0x1d4a37(0x1eb));continue;}if(_0xd7aabf['type']==='new_task'||_0xd7aabf['type']==='new_message'||_0xd7aabf[_0x1d4a37(0x1a2)]===_0x1d4a37(0x1b9))await this['processInbox']();}catch{}}}}catch(_0x270c39){if(_0x270c39[_0x1d4a37(0x1ee)]==='AbortError')break;this['emit'](_0x1d4a37(0x1a6),_0x270c39),this[_0x1d4a37(0x1c8)](_0x1d4a37(0x1c6)+_0x270c39[_0x1d4a37(0x1d8)]);}if(this[_0x1d4a37(0x1da)])this[_0x1d4a37(0x1dc)](_0x1d4a37(0x1c3)),this[_0x1d4a37(0x1c8)](_0x1d4a37(0x1ad)+_0x2b2287/0x3e8+'s...'),await this['sleep'](_0x2b2287),_0x2b2287=Math['min'](_0x2b2287*1.5,0xea60);}}async[a0_0x2a1977(0x1ba)](){const _0x1c8080=a0_0x2a1977;try{let _0x5b9e23=(await this['call'](_0x1c8080(0x1e3),{'alias':this[_0x1c8080(0x1b8)],'limit':0xa}))?.['messages']||[];for(let _0x31cc99 of _0x5b9e23)await this['call'](_0x1c8080(0x1b1),{'alias':this[_0x1c8080(0x1b8)],'message_id':_0x31cc99['id']}),this[_0x1c8080(0x1c8)]('←\x20'+_0x31cc99[_0x1c8080(0x1ca)]+':\x20'+_0x31cc99['content'][_0x1c8080(0x1de)](0x0,0x3c)),this[_0x1c8080(0x1dc)](_0x1c8080(0x1ab),_0x31cc99),this[_0x1c8080(0x1dc)](_0x1c8080(0x1d8),_0x31cc99);}catch(_0x74ba21){this[_0x1c8080(0x1c8)]('inbox\x20error:\x20'+_0x74ba21['message']);}}[a0_0x2a1977(0x1c4)](_0x4c6cc0){return new Promise(_0x1af24b=>setTimeout(_0x1af24b,_0x4c6cc0));}}function a0_0x2d9f(){const _0x40123b=['running','heartbeat\x20failed:\x20','emit','171JgBUet','slice','token','getReader','body','split','get_inbox','connect','text','send_task','pop','result','861xcpYZt','stringify','connected','sseAbort','signal','name','status','Authorization','toTimeString','server','/mcp','type','completed','SSE\x20failed:\x20','514mghZmq','error','2942152akRBDR','replace','agent','match','task','441576cSaUCf','SSE\x20reconnecting\x20in\x20','2.0','disconnect','/events/','ack_inbox','parse','sdk-','content','connectSSE','20RNOjKf','resumeId','alias','broadcast','processInbox','getAllStatus','startsWith','read','send','catch','525430zmQbmn','Bearer\x20','now','disconnected','sleep','url','SSE\x20error:\x20','decode','log','report_status','from_session','tools/call','send_message','heartbeatTimer','reconnectDelay','1566047KGfRIz','SSE\x20connected','call','data:\x20','12dsPWIs','440020JgOWbo','heartbeatInterval','min','sdk','message','13110999BRRHaN'];a0_0x2d9f=function(){return _0x40123b;};return a0_0x2d9f();}var $=T;export{$ as default,T as CommHub};
1
+ const a0_0x4f84ce=a0_0x3ccc;(function(_0x5c8a58,_0x435d33){const _0x198e4c=a0_0x3ccc,_0x18eb97=_0x5c8a58();while(!![]){try{const _0x5458ee=parseInt(_0x198e4c(0x198))/0x1*(parseInt(_0x198e4c(0x165))/0x2)+-parseInt(_0x198e4c(0x1a1))/0x3+-parseInt(_0x198e4c(0x162))/0x4+parseInt(_0x198e4c(0x1b4))/0x5*(parseInt(_0x198e4c(0x170))/0x6)+-parseInt(_0x198e4c(0x16b))/0x7*(parseInt(_0x198e4c(0x197))/0x8)+-parseInt(_0x198e4c(0x18d))/0x9+parseInt(_0x198e4c(0x167))/0xa;if(_0x5458ee===_0x435d33)break;else _0x18eb97['push'](_0x18eb97['shift']());}catch(_0x305de1){_0x18eb97['push'](_0x18eb97['shift']());}}}(a0_0x204d,0x91113));import{EventEmitter as a0_0x1e08c0}from'events';import{hostname as a0_0x710d98}from'os';class T extends a0_0x1e08c0{[a0_0x4f84ce(0x190)];[a0_0x4f84ce(0x17c)];[a0_0x4f84ce(0x176)];[a0_0x4f84ce(0x1b6)];[a0_0x4f84ce(0x183)];[a0_0x4f84ce(0x1ab)];[a0_0x4f84ce(0x19a)];[a0_0x4f84ce(0x19e)];[a0_0x4f84ce(0x169)];[a0_0x4f84ce(0x182)]=!0x1;constructor(_0x474e0f){const _0x5c7c67=a0_0x4f84ce;super();if(this[_0x5c7c67(0x190)]=_0x474e0f[_0x5c7c67(0x190)]['replace'](/\/$/,''),this[_0x5c7c67(0x17c)]=_0x474e0f[_0x5c7c67(0x17c)],this[_0x5c7c67(0x176)]=_0x474e0f['token'],this[_0x5c7c67(0x1b6)]=_0x474e0f[_0x5c7c67(0x1b6)]||'sdk',this[_0x5c7c67(0x183)]=_0x5c7c67(0x192)+_0x474e0f[_0x5c7c67(0x17c)]+'-'+Date[_0x5c7c67(0x181)]()[_0x5c7c67(0x1ae)](0x24),this[_0x5c7c67(0x1ab)]=_0x474e0f['heartbeatInterval']??0x2bf20,this[_0x5c7c67(0x19a)]=_0x474e0f[_0x5c7c67(0x19a)]??0xbb8,_0x474e0f['autoConnect']!==!0x1)this[_0x5c7c67(0x1aa)]();}['log'](_0x1d521b){const _0xb56915=a0_0x4f84ce;console[_0xb56915(0x166)]('['+new Date()[_0xb56915(0x1b1)]()[_0xb56915(0x168)](0x0,0x8)+_0xb56915(0x1b0)+this[_0xb56915(0x17c)]+']\x20'+_0x1d521b);}async[a0_0x4f84ce(0x164)](_0x21e6a2,_0x2312a0){const _0x4b9476=a0_0x4f84ce;let _0x3a4c30={'Content-Type':_0x4b9476(0x18c),'Accept':'application/json,\x20text/event-stream'};if(this[_0x4b9476(0x176)])_0x3a4c30[_0x4b9476(0x174)]=_0x4b9476(0x1a4)+this[_0x4b9476(0x176)];let _0x2e544a=await(await fetch(this[_0x4b9476(0x190)]+_0x4b9476(0x1a5),{'method':_0x4b9476(0x177),'headers':_0x3a4c30,'body':JSON[_0x4b9476(0x196)]({'jsonrpc':_0x4b9476(0x1b5),'id':Date[_0x4b9476(0x181)](),'method':'tools/call','params':{'name':_0x21e6a2,'arguments':_0x2312a0}})}))[_0x4b9476(0x16f)](),_0x41a93d=_0x2e544a[_0x4b9476(0x191)](/data: (.+)/),_0x59479e=_0x41a93d?JSON[_0x4b9476(0x16d)](_0x41a93d[0x1]):JSON[_0x4b9476(0x16d)](_0x2e544a),_0x2a2951=_0x59479e?.[_0x4b9476(0x188)]?.[_0x4b9476(0x1ac)]?.[0x0]?.[_0x4b9476(0x16f)];return _0x2a2951?JSON['parse'](_0x2a2951):_0x59479e;}async['connect'](){const _0x350fa8=a0_0x4f84ce;if(this['running'])return;this[_0x350fa8(0x182)]=!0x0,await this[_0x350fa8(0x199)](_0x350fa8(0x1a3)),this['log']('registered'),this[_0x350fa8(0x19e)]=setInterval(()=>{const _0x52f9e0=_0x350fa8;this[_0x52f9e0(0x199)]('idle')[_0x52f9e0(0x18e)](_0x25ef04=>this[_0x52f9e0(0x166)](_0x52f9e0(0x17f)+_0x25ef04[_0x52f9e0(0x19b)]));},this['heartbeatInterval']),this[_0x350fa8(0x1b2)]();}async['disconnect'](){const _0x2f496f=a0_0x4f84ce;if(this['running']=!0x1,this['sseAbort']?.[_0x2f496f(0x195)](),this[_0x2f496f(0x19e)])clearInterval(this[_0x2f496f(0x19e)]);await this[_0x2f496f(0x199)]('offline')[_0x2f496f(0x18e)](()=>{}),this[_0x2f496f(0x166)]('disconnected');}async[a0_0x4f84ce(0x193)](_0x4f5b3f,_0x2af648,_0x15e079='normal'){const _0x2163af=a0_0x4f84ce;return this[_0x2163af(0x164)](_0x2163af(0x184),{'alias':_0x4f5b3f,'task':_0x2af648,'priority':_0x15e079,'from_session':this[_0x2163af(0x17c)]});}async[a0_0x4f84ce(0x19b)](_0x5a59d4,_0x1349d5){const _0x4d607b=a0_0x4f84ce;return this[_0x4d607b(0x164)]('send_message',{'alias':_0x5a59d4,'message':_0x1349d5,'from_session':this[_0x4d607b(0x17c)]});}async[a0_0x4f84ce(0x1a9)](_0x2086e5,_0x4136f4,_0x4da1a5=a0_0x4f84ce(0x1af)){return this['call']('send_reply',{'in_reply_to':_0x2086e5,'text':_0x4136f4,'status':_0x4da1a5});}async[a0_0x4f84ce(0x199)](_0x1df3f2,_0x557eb4){const _0x34118e=a0_0x4f84ce;return this[_0x34118e(0x164)](_0x34118e(0x18a),{'resume_id':this['resumeId'],'alias':this[_0x34118e(0x17c)],'status':_0x1df3f2,'server':a0_0x710d98(),'hostname':a0_0x710d98(),'agent':this[_0x34118e(0x1b6)],'project_dir':process[_0x34118e(0x19c)](),..._0x557eb4});}async[a0_0x4f84ce(0x17e)](){const _0x5e7bb7=a0_0x4f84ce;return this[_0x5e7bb7(0x164)](_0x5e7bb7(0x16c),{});}async[a0_0x4f84ce(0x17d)](_0x50d251,_0x5bf452){const _0x5cd78c=a0_0x4f84ce;return this[_0x5cd78c(0x164)](_0x5cd78c(0x17d),{'message':_0x50d251,'filter_server':_0x5bf452?.['server'],'filter_status':_0x5bf452?.[_0x5cd78c(0x199)]});}async[a0_0x4f84ce(0x1b2)](){const _0x3da8a1=a0_0x4f84ce;let _0x31208b=encodeURIComponent(this[_0x3da8a1(0x17c)]),_0x15d2a5=this[_0x3da8a1(0x190)]+'/events/'+_0x31208b,_0x48de50=this[_0x3da8a1(0x19a)];while(this[_0x3da8a1(0x182)]){try{this[_0x3da8a1(0x169)]=new AbortController();let _0x20607e={'Accept':_0x3da8a1(0x16e)};if(this[_0x3da8a1(0x176)])_0x20607e['Authorization']=_0x3da8a1(0x1a4)+this[_0x3da8a1(0x176)];let _0x200df8=await fetch(_0x15d2a5,{'headers':_0x20607e,'signal':this[_0x3da8a1(0x169)][_0x3da8a1(0x185)]});if(!_0x200df8['ok']||!_0x200df8[_0x3da8a1(0x19f)]){this[_0x3da8a1(0x166)](_0x3da8a1(0x178)+_0x200df8[_0x3da8a1(0x199)]),await this[_0x3da8a1(0x1a6)](_0x48de50),_0x48de50=Math['min'](_0x48de50*1.5,0xea60);continue;}_0x48de50=this[_0x3da8a1(0x19a)];let _0x2154f0=_0x200df8[_0x3da8a1(0x19f)][_0x3da8a1(0x187)](),_0x3c1348=new TextDecoder(),_0x18ac01='';while(this[_0x3da8a1(0x182)]){let {done:_0x890003,value:_0x242d7b}=await _0x2154f0[_0x3da8a1(0x175)]();if(_0x890003)break;_0x18ac01+=_0x3c1348[_0x3da8a1(0x1ad)](_0x242d7b,{'stream':!0x0});let _0x2425e9=_0x18ac01[_0x3da8a1(0x173)]('\x0a');_0x18ac01=_0x2425e9[_0x3da8a1(0x18f)]()||'';for(let _0x1545aa of _0x2425e9){if(!_0x1545aa[_0x3da8a1(0x17a)]('data:\x20'))continue;try{let _0x4cc2b8=JSON[_0x3da8a1(0x16d)](_0x1545aa['slice'](0x6));if(_0x4cc2b8[_0x3da8a1(0x194)]===_0x3da8a1(0x17b)){this[_0x3da8a1(0x166)](_0x3da8a1(0x19d)),this[_0x3da8a1(0x18b)]('connected');continue;}if(_0x4cc2b8[_0x3da8a1(0x194)]==='new_task'||_0x4cc2b8[_0x3da8a1(0x194)]===_0x3da8a1(0x180)||_0x4cc2b8['type']===_0x3da8a1(0x17d))await this['processInbox']();}catch{}}}}catch(_0x1b750a){if(_0x1b750a['name']==='AbortError')break;this[_0x3da8a1(0x18b)](_0x3da8a1(0x172),_0x1b750a),this[_0x3da8a1(0x166)](_0x3da8a1(0x171)+_0x1b750a[_0x3da8a1(0x19b)]);}if(this['running'])this[_0x3da8a1(0x18b)](_0x3da8a1(0x161)),this[_0x3da8a1(0x166)](_0x3da8a1(0x1a8)+_0x48de50/0x3e8+_0x3da8a1(0x163)),await this[_0x3da8a1(0x1a6)](_0x48de50),_0x48de50=Math[_0x3da8a1(0x1a0)](_0x48de50*1.5,0xea60);}}async[a0_0x4f84ce(0x179)](){const _0x35f35b=a0_0x4f84ce;try{let _0x35c67c=(await this[_0x35f35b(0x164)](_0x35f35b(0x1b3),{'alias':this['alias'],'limit':0xa}))?.[_0x35f35b(0x1a7)]||[];for(let _0x3fb202 of _0x35c67c)await this['call'](_0x35f35b(0x1a2),{'alias':this[_0x35f35b(0x17c)],'message_id':_0x3fb202['id']}),this[_0x35f35b(0x166)]('←\x20'+_0x3fb202[_0x35f35b(0x189)]+':\x20'+_0x3fb202[_0x35f35b(0x1ac)][_0x35f35b(0x168)](0x0,0x3c)),this[_0x35f35b(0x18b)](_0x35f35b(0x186),_0x3fb202),this[_0x35f35b(0x18b)](_0x35f35b(0x19b),_0x3fb202);}catch(_0x4a8952){this['log'](_0x35f35b(0x16a)+_0x4a8952[_0x35f35b(0x19b)]);}}['sleep'](_0x504db0){return new Promise(_0x51af75=>setTimeout(_0x51af75,_0x504db0));}}var $=T;function a0_0x3ccc(_0x285656,_0x3272f6){_0x285656=_0x285656-0x161;const _0x204d7e=a0_0x204d();let _0x3ccc51=_0x204d7e[_0x285656];return _0x3ccc51;}function a0_0x204d(){const _0x173447=['reconnectDelay','message','cwd','SSE\x20connected','heartbeatTimer','body','min','3055989izmwdL','ack_inbox','idle','Bearer\x20','/mcp','sleep','messages','SSE\x20reconnecting\x20in\x20','reply','connect','heartbeatInterval','content','decode','toString','completed',']\x20[commhub:','toTimeString','connectSSE','get_inbox','25NlUckt','2.0','agent','disconnected','796056YbQAcc','s...','call','58dkuiir','log','23816670gygHdW','slice','sseAbort','inbox\x20error:\x20','172550eAzOGe','get_all_status','parse','text/event-stream','text','622176JmgNyT','SSE\x20error:\x20','error','split','Authorization','read','token','POST','SSE\x20failed:\x20','processInbox','startsWith','connected','alias','broadcast','getAllStatus','heartbeat\x20failed:\x20','new_message','now','running','resumeId','send_task','signal','task','getReader','result','from_session','report_status','emit','application/json','8326089ZZaMdS','catch','pop','url','match','sdk-','send','type','abort','stringify','208GpqTuG','16474uCgQya','status'];a0_0x204d=function(){return _0x173447;};return a0_0x204d();}export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x12fd92=a0_0xb9af;(function(_0x6b7d2b,_0x345f46){const _0x3a9f25=a0_0xb9af,_0x13b723=_0x6b7d2b();while(!![]){try{const _0x367df2=parseInt(_0x3a9f25(0x135))/0x1+-parseInt(_0x3a9f25(0xf9))/0x2+-parseInt(_0x3a9f25(0xf6))/0x3+-parseInt(_0x3a9f25(0xfc))/0x4*(parseInt(_0x3a9f25(0x136))/0x5)+parseInt(_0x3a9f25(0xfa))/0x6+parseInt(_0x3a9f25(0xcf))/0x7+parseInt(_0x3a9f25(0x12d))/0x8;if(_0x367df2===_0x345f46)break;else _0x13b723['push'](_0x13b723['shift']());}catch(_0x5ad698){_0x13b723['push'](_0x13b723['shift']());}}}(a0_0x27e7,0x34871));import{readFileSync as a0_0x5e37d4,existsSync as a0_0x139094}from'fs';import{randomUUID as a0_0x318c5c}from'crypto';function a0_0xb9af(_0xc5381c,_0x118927){_0xc5381c=_0xc5381c-0xbb;const _0x27e77b=a0_0x27e7();let _0xb9af67=_0x27e77b[_0xc5381c];return _0xb9af67;}import{join as a0_0x4d66b4}from'path';import{hostname as a0_0x9279cc}from'os';import{execSync as a0_0x487d31}from'child_process';import{Server as a0_0x1c6ad5}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x4739e1}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x4c9982,CallToolRequestSchema as a0_0x12ae3e}from'@modelcontextprotocol/sdk/types.js';function a0_0x27e7(){const _0x2fe38f=['Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','POST','stdin','setRequestHandler','...\x20TMUX=','SSE\x20connected\x20as\x20\x22','delete','Bearer\x20','shutting\x20down,\x20reporting\x20offline...','blocked','init\x20failed:\x20','.anet','/mcp','commhub_reply','number','new_task','397839NXzFbZ','starting\x20SSE\x20listener...','indexOf','393210xyxsOJ','1739604ckvqwD','stderr','1516288BiaspI','SIGTERM','toTimeString','Task\x20content','Session\x20alias:\x20','Target\x20session\x20alias','get','send_task','message_id','send_message','application/json','find','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','message','failed','commhub-channel','claude-code','replace','set','status','2025-03-26','commhub_get_all_status','0.3.0','commhub','length','replied','from_session','Authorization','report_status','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','warning:\x20could\x20not\x20register:\x20','text','SSE\x20fatal:\x20','error','ack_inbox','registered\x20as\x20\x22','new_message','connecting\x20to\x20','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','catch','.claude/channels/commhub','token',':\x20inbox_count=','utf-8','get_all_status','slice','read','parse','4426592FRUMNF','\x20from\x20','2.0','working','CommHub\x20init\x20failed:\x20','params','heartbeat\x20failed:\x20','object','7250bQlrYP','5GaoHWX','parse\x20error:\x20','result','stringify','string','then','/events/','commhub_send_message','notification','trim','get_inbox',']\x20[commhub]\x20','\x20priority=','startsWith','broadcast','ENV:\x20URL=','getReader','http://127.0.0.1:9200','pop','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','\x20ALIAS=','data:\x20','completed','SSE\x20error:\x20','end','content','normal','idle','send_reply','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','split','commhub_send_task','hub','write','statusText','\x22\x20(','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','510545AKwiuQ','config.json','notifications/claude/channel','.env','cancelled','\x20PROJECT_ENV=','tmux\x20display-message\x20-p\x20\x27#S\x27','task','priority','\x20CWD=','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','ready\x20—\x20waiting\x20for\x20events','type','exit','cwd','commhub_report_status','low','connect','connected','Message\x20content','decode','messages','from'];a0_0x27e7=function(){return _0x2fe38f;};return a0_0x27e7();}function p(_0x5d90a8){const _0x1511a4=a0_0xb9af;if(!a0_0x139094(_0x5d90a8))return;for(let _0x239be1 of a0_0x5e37d4(_0x5d90a8,_0x1511a4(0x128))[_0x1511a4(0xc8)]('\x0a')){let _0x36cf39=_0x239be1[_0x1511a4(0x13f)]();if(!_0x36cf39||_0x36cf39[_0x1511a4(0x143)]('#'))continue;let _0x386605=_0x36cf39[_0x1511a4(0xf8)]('=');if(_0x386605<0x0)continue;let _0x3d3658=_0x36cf39[_0x1511a4(0x12a)](0x0,_0x386605)[_0x1511a4(0x13f)](),_0x131433=_0x36cf39['slice'](_0x386605+0x1)['trim']()[_0x1511a4(0x10d)](/^["']|["']$/g,'');if(!process.env[_0x3d3658])process.env[_0x3d3658]=_0x131433;}}var C=process.env.HOME||'~',T=a0_0x4d66b4(C,a0_0x12fd92(0x125));p(a0_0x4d66b4(T,a0_0x12fd92(0xd2)));var L=process[a0_0x12fd92(0xdd)]()[a0_0x12fd92(0x10d)](/\//g,'-');p(a0_0x4d66b4(T,L,a0_0x12fd92(0xd2)));function U(){const _0x38c738=a0_0x12fd92;try{return a0_0x487d31(_0x38c738(0xd5),{'encoding':'utf-8','timeout':0x7d0})[_0x38c738(0x13f)]();}catch{return'';}}function v(){const _0x47695b=a0_0x12fd92;try{let _0x2a8eb9=a0_0x4d66b4(C,_0x47695b(0xf1),_0x47695b(0xd0));if(a0_0x139094(_0x2a8eb9))return JSON['parse'](a0_0x5e37d4(_0x2a8eb9,'utf-8'));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x12fd92(0xca)]||a0_0x12fd92(0xbb),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x9279cc(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x318c5c(),X=process.env.COMMHUB_TOKEN||H[a0_0x12fd92(0x126)]||'';function Y(_0x30e154){const _0x296e82=a0_0x12fd92;let _0x16ec26=new Date()[_0x296e82(0xfe)]()[_0x296e82(0x12a)](0x0,0x8);process[_0x296e82(0xfb)][_0x296e82(0xcb)]('['+_0x16ec26+_0x296e82(0x141)+_0x30e154+'\x0a');}function h(_0x37ede7){return new Promise(_0x14b114=>setTimeout(_0x14b114,_0x37ede7));}Y(a0_0x12fd92(0x145)+f+a0_0x12fd92(0xbe)+Z+'\x20RESUME_ID='+w[a0_0x12fd92(0x12a)](0x0,0x8)+a0_0x12fd92(0xea)+(j||'none')+a0_0x12fd92(0xd8)+process[a0_0x12fd92(0xdd)]()+a0_0x12fd92(0xd4)+L);var k=new Map(),K=new a0_0x1c6ad5({'name':a0_0x12fd92(0x10b),'version':a0_0x12fd92(0x112)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x12fd92(0xce),a0_0x12fd92(0x122),a0_0x12fd92(0xc7),a0_0x12fd92(0x123),a0_0x12fd92(0x100)+Z]['join']('\x0a')});K[a0_0x12fd92(0xe9)](a0_0x4c9982,async()=>({'tools':[{'name':'commhub_reply','description':'Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','inputSchema':{'type':'object','properties':{'task_id':{'type':a0_0x12fd92(0x13a),'description':a0_0x12fd92(0x108)},'text':{'type':a0_0x12fd92(0x13a),'description':'Reply\x20text\x20/\x20result\x20summary'},'status':{'type':a0_0x12fd92(0x13a),'enum':[a0_0x12fd92(0xc0),a0_0x12fd92(0x10a),a0_0x12fd92(0xd3),a0_0x12fd92(0xef),'error','in_progress'],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':['text']}},{'name':a0_0x12fd92(0xde),'description':a0_0x12fd92(0xd9),'inputSchema':{'type':'object','properties':{'status':{'type':'string','enum':[a0_0x12fd92(0x130),a0_0x12fd92(0xc5),a0_0x12fd92(0xef),'error']},'task':{'type':a0_0x12fd92(0x13a),'description':'Current\x20task\x20description'},'progress':{'type':a0_0x12fd92(0xf4),'description':'Progress\x200-100'}},'required':[a0_0x12fd92(0x10f)]}},{'name':a0_0x12fd92(0xc9),'description':a0_0x12fd92(0x119),'inputSchema':{'type':a0_0x12fd92(0x134),'properties':{'alias':{'type':a0_0x12fd92(0x13a),'description':a0_0x12fd92(0x101)},'task':{'type':a0_0x12fd92(0x13a),'description':a0_0x12fd92(0xff)},'priority':{'type':a0_0x12fd92(0x13a),'enum':['high',a0_0x12fd92(0xc4),a0_0x12fd92(0xdf)],'description':'Priority\x20(default:\x20normal)'}},'required':['alias',a0_0x12fd92(0xd6)]}},{'name':a0_0x12fd92(0x13d),'description':a0_0x12fd92(0xbd),'inputSchema':{'type':a0_0x12fd92(0x134),'properties':{'alias':{'type':a0_0x12fd92(0x13a),'description':a0_0x12fd92(0x101)},'message':{'type':a0_0x12fd92(0x13a),'description':a0_0x12fd92(0xe2)}},'required':['alias',a0_0x12fd92(0x109)]}},{'name':a0_0x12fd92(0x111),'description':a0_0x12fd92(0xe6),'inputSchema':{'type':a0_0x12fd92(0x134),'properties':{}}}]}));async function P(_0x3d8f6a,_0x2451f6){const _0x22f130=a0_0x12fd92;let _0x543b42=await fetch(f+_0x22f130(0xf2),{'method':_0x22f130(0xe7),'headers':{'Content-Type':_0x22f130(0x106),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x22f130(0xed)+X}:{}},'body':JSON[_0x22f130(0x139)]({'jsonrpc':_0x22f130(0x12f),'id':0x1,'method':'initialize','params':{'protocolVersion':_0x22f130(0x110),'capabilities':{},'clientInfo':{'name':'commhub-channel','version':'0.3.0'}}})});if(!_0x543b42['ok']){let _0x90c2bd=await _0x543b42['text']();return Y(_0x22f130(0x131)+_0x543b42['status']+'\x20'+_0x90c2bd[_0x22f130(0x12a)](0x0,0x64)),{'ok':!0x1,'error':_0x22f130(0xf0)+_0x543b42[_0x22f130(0x10f)]};}await _0x543b42[_0x22f130(0x11b)]();let _0x4830a2=(await(await fetch(f+'/mcp',{'method':_0x22f130(0xe7),'headers':{'Content-Type':_0x22f130(0x106),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x22f130(0xed)+X}:{}},'body':JSON[_0x22f130(0x139)]({'jsonrpc':_0x22f130(0x12f),'id':0x2,'method':'tools/call','params':{'name':_0x3d8f6a,'arguments':_0x2451f6}})}))[_0x22f130(0x11b)]())[_0x22f130(0xc8)]('\x0a')[_0x22f130(0x107)](_0x4e85c1=>_0x4e85c1[_0x22f130(0x143)](_0x22f130(0xbf)));if(_0x4830a2){let _0x4219be=JSON['parse'](_0x4830a2[_0x22f130(0x12a)](0x6));return _0x4219be?.[_0x22f130(0x138)]?.[_0x22f130(0xc3)]?.[0x0]?.[_0x22f130(0x11b)]?JSON[_0x22f130(0x12c)](_0x4219be[_0x22f130(0x138)][_0x22f130(0xc3)][0x0]['text']):_0x4219be;}return{'ok':!0x1,'error':'no\x20response'};}K[a0_0x12fd92(0xe9)](a0_0x12ae3e,async _0x549de7=>{const _0x37ea36=a0_0x12fd92;let {name:_0x31c40f,arguments:_0x10f8fd}=_0x549de7[_0x37ea36(0x132)];if(_0x31c40f===_0x37ea36(0xf3)){let {task_id:_0x4efe,text:_0x4a4267,status:_0x1b7472}=_0x10f8fd;if(_0x1b7472===_0x37ea36(0xc0)||_0x1b7472==='failed'||_0x1b7472==='cancelled'){let _0x2be706=_0x1b7472===_0x37ea36(0xc0)?_0x37ea36(0x115):_0x1b7472,_0x39b38b=_0x4efe?k[_0x37ea36(0x102)](_0x4efe)||_0x37ea36(0xca):_0x37ea36(0xca),_0x5ad692=await P(_0x37ea36(0xc6),{'alias':_0x39b38b,'text':_0x4a4267,'in_reply_to':_0x4efe||void 0x0,'status':_0x2be706,'from_session':Z});if(_0x4efe)k[_0x37ea36(0xec)](_0x4efe);return{'content':[{'type':'text','text':JSON[_0x37ea36(0x139)](_0x5ad692)}]};}let _0x339078=await P(_0x37ea36(0x118),{'resume_id':w,'alias':Z,'status':_0x1b7472===_0x37ea36(0xef)?'blocked':_0x1b7472===_0x37ea36(0x11d)?_0x37ea36(0x11d):_0x37ea36(0x130),'task':_0x4a4267['slice'](0x0,0xc8),'output':_0x4a4267});return{'content':[{'type':'text','text':JSON[_0x37ea36(0x139)](_0x339078)}]};}if(_0x31c40f===_0x37ea36(0xde)){let {status:_0x3cfbf8,task:_0x5de56c,progress:_0x427f6a}=_0x10f8fd,_0x51bf54=await P(_0x37ea36(0x118),{'resume_id':w,'alias':Z,'status':_0x3cfbf8,'task':_0x5de56c,'progress':_0x427f6a});return{'content':[{'type':'text','text':JSON[_0x37ea36(0x139)](_0x51bf54)}]};}if(_0x31c40f===_0x37ea36(0xc9)){let {alias:_0x51a2ac,task:_0x52cdcb,priority:_0x2ea18c}=_0x10f8fd,_0x9c223b=await P(_0x37ea36(0x103),{'alias':_0x51a2ac,'task':_0x52cdcb,'priority':_0x2ea18c||'normal','from_session':Z});return{'content':[{'type':_0x37ea36(0x11b),'text':JSON[_0x37ea36(0x139)](_0x9c223b)}]};}if(_0x31c40f===_0x37ea36(0x13d)){let {alias:_0x453d95,message:_0x48f7eb}=_0x10f8fd,_0x1603a7=await P(_0x37ea36(0x105),{'alias':_0x453d95,'message':_0x48f7eb,'from_session':Z});return{'content':[{'type':_0x37ea36(0x11b),'text':JSON[_0x37ea36(0x139)](_0x1603a7)}]};}if(_0x31c40f===_0x37ea36(0x111)){let _0x5bf7b6=await P(_0x37ea36(0x129),{});return{'content':[{'type':_0x37ea36(0x11b),'text':JSON[_0x37ea36(0x139)](_0x5bf7b6)}]};}return{'content':[{'type':_0x37ea36(0x11b),'text':JSON['stringify']({'error':'unknown\x20tool'})}]};});async function u(){const _0x411db2=a0_0x12fd92;let _0x5a75f6=f+_0x411db2(0x13c)+encodeURIComponent(Z),_0x41f118={};if(X)_0x41f118[_0x411db2(0x117)]='Bearer\x20'+X;Y(_0x411db2(0x121)+_0x5a75f6);while(!0x0){try{let _0x2c59d5=await fetch(_0x5a75f6,{'headers':_0x41f118});if(!_0x2c59d5['ok']){Y(_0x411db2(0xc1)+_0x2c59d5[_0x411db2(0x10f)]+'\x20'+_0x2c59d5[_0x411db2(0xcc)]),await h(0x1388);continue;}let _0x19418c=_0x2c59d5['body'][_0x411db2(0x146)](),_0x512f12=new TextDecoder(),_0x47e9f4='';while(!0x0){let {done:_0x55acaa,value:_0x35aedd}=await _0x19418c[_0x411db2(0x12b)]();if(_0x55acaa)break;_0x47e9f4+=_0x512f12[_0x411db2(0xe3)](_0x35aedd,{'stream':!0x0});let _0xf265bd=_0x47e9f4[_0x411db2(0xc8)]('\x0a\x0a');_0x47e9f4=_0xf265bd[_0x411db2(0xbc)]()||'';for(let _0x5044ae of _0xf265bd){let _0x38faef=_0x5044ae[_0x411db2(0xc8)]('\x0a')[_0x411db2(0x107)](_0x5ec8f9=>_0x5ec8f9[_0x411db2(0x143)]('data:\x20'));if(!_0x38faef)continue;try{let _0x4dc15f=JSON[_0x411db2(0x12c)](_0x38faef['slice'](0x6));await S(_0x4dc15f);}catch(_0x200d96){Y(_0x411db2(0x137)+_0x200d96);}}}Y('SSE\x20stream\x20ended,\x20reconnecting...');}catch(_0x4f0910){Y('SSE\x20connection\x20error:\x20'+_0x4f0910);}await h(0xbb8);}}async function S(_0x3cd753){const _0x132bd6=a0_0x12fd92;if(_0x3cd753[_0x132bd6(0xdb)]===_0x132bd6(0xe1)){Y(_0x132bd6(0xeb)+Z+'\x22');return;}if(_0x3cd753[_0x132bd6(0xdb)]===_0x132bd6(0x120)){if(Y('←\x20message\x20from\x20'+_0x3cd753[_0x132bd6(0xe5)]+':\x20'+_0x3cd753[_0x132bd6(0x109)][_0x132bd6(0x12a)](0x0,0x3c)),await K[_0x132bd6(0x13e)]({'method':_0x132bd6(0xd1),'params':{'content':_0x3cd753['message'],'meta':{'sender':_0x3cd753['from']||_0x132bd6(0xca),'sender_id':'commhub','user':_0x3cd753[_0x132bd6(0xe5)]||'hub','priority':_0x132bd6(0xc4)}}}),_0x3cd753[_0x132bd6(0x104)])await P(_0x132bd6(0x11e),{'alias':Z,'message_id':_0x3cd753[_0x132bd6(0x104)]});return;}if(_0x3cd753[_0x132bd6(0xdb)]===_0x132bd6(0xf5)||_0x3cd753[_0x132bd6(0xdb)]===_0x132bd6(0x144)){Y('←\x20'+_0x3cd753[_0x132bd6(0xdb)]+_0x132bd6(0x127)+_0x3cd753['inbox_count']+_0x132bd6(0x142)+(_0x3cd753[_0x132bd6(0xd7)]||_0x132bd6(0xc4)));let _0x402bc6=await P(_0x132bd6(0x140),{'alias':Z,'limit':0x5});if(_0x402bc6?.['ok']&&_0x402bc6['messages']?.[_0x132bd6(0x114)]>0x0)for(let _0xe262b1 of _0x402bc6[_0x132bd6(0xe4)]){let _0x324ed1={'sender':_0xe262b1[_0x132bd6(0x116)]||_0x132bd6(0xca),'sender_id':_0x132bd6(0x113),'user':_0xe262b1[_0x132bd6(0x116)]||'hub','task_id':_0xe262b1['id'],'priority':_0xe262b1[_0x132bd6(0xd7)]||_0x132bd6(0xc4)};k[_0x132bd6(0x10e)](_0xe262b1['id'],_0xe262b1['from_session']||_0x132bd6(0xca)),await K[_0x132bd6(0x13e)]({'method':_0x132bd6(0xd1),'params':{'content':_0xe262b1['content'],'meta':_0x324ed1}}),Y('→\x20injected\x20task\x20'+_0xe262b1['id'][_0x132bd6(0x12a)](0x0,0x8)+_0x132bd6(0x12e)+_0xe262b1[_0x132bd6(0x116)]+':\x20'+_0xe262b1[_0x132bd6(0xc3)][_0x132bd6(0x12a)](0x0,0x3c)),await P(_0x132bd6(0x11e),{'alias':Z,'message_id':_0xe262b1['id']});}}}async function A(){const _0x2838c4=a0_0x12fd92;let _0x138631=new a0_0x4739e1();await K[_0x2838c4(0xe0)](_0x138631),Y('MCP\x20stdio\x20connected'),Y(_0x2838c4(0xf7)),u()[_0x2838c4(0x124)](_0x5097e6=>Y(_0x2838c4(0x11c)+_0x5097e6)),P(_0x2838c4(0x118),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x9279cc(),'hostname':a0_0x9279cc(),'agent':'claude-code','project_dir':process[_0x2838c4(0xdd)](),'tmux_name':j||void 0x0})[_0x2838c4(0x13b)](()=>Y(_0x2838c4(0x11f)+Z+_0x2838c4(0xcd)+w[_0x2838c4(0x12a)](0x0,0x8)+')'))[_0x2838c4(0x124)](_0x4b74b2=>Y(_0x2838c4(0x11a)+_0x4b74b2)),setInterval(()=>{const _0x17869c=_0x2838c4;P('report_status',{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x9279cc(),'hostname':a0_0x9279cc(),'agent':_0x17869c(0x10c),'project_dir':process[_0x17869c(0xdd)](),'tmux_name':j||void 0x0})['catch'](_0x2e02f5=>Y(_0x17869c(0x133)+_0x2e02f5));},0x2bf20),Y(_0x2838c4(0xda));}A()['catch'](_0x47e9f5=>{Y('fatal:\x20'+_0x47e9f5),process['exit'](0x1);});async function N(){const _0x3fbdeb=a0_0x12fd92;Y(_0x3fbdeb(0xee)),await P(_0x3fbdeb(0x118),{'resume_id':w,'alias':Z,'status':'offline','task':'session\x20disconnected'})[_0x3fbdeb(0x124)](()=>{}),process[_0x3fbdeb(0xdc)](0x0);}process[a0_0x12fd92(0xe8)]['on'](a0_0x12fd92(0xc2),()=>N()),process['on'](a0_0x12fd92(0xfd),()=>N()),process['on']('SIGINT',()=>N());
2
+ const a0_0x4e5b9b=a0_0x44b6;(function(_0x178274,_0x4af529){const _0x27ac52=a0_0x44b6,_0x116800=_0x178274();while(!![]){try{const _0x282743=-parseInt(_0x27ac52(0x219))/0x1*(-parseInt(_0x27ac52(0x1e8))/0x2)+parseInt(_0x27ac52(0x20f))/0x3*(-parseInt(_0x27ac52(0x1dc))/0x4)+parseInt(_0x27ac52(0x1cf))/0x5*(-parseInt(_0x27ac52(0x1f2))/0x6)+-parseInt(_0x27ac52(0x21b))/0x7*(-parseInt(_0x27ac52(0x208))/0x8)+-parseInt(_0x27ac52(0x1dd))/0x9*(parseInt(_0x27ac52(0x26a))/0xa)+-parseInt(_0x27ac52(0x256))/0xb+-parseInt(_0x27ac52(0x24e))/0xc*(-parseInt(_0x27ac52(0x245))/0xd);if(_0x282743===_0x4af529)break;else _0x116800['push'](_0x116800['shift']());}catch(_0x438bce){_0x116800['push'](_0x116800['shift']());}}}(a0_0x4610,0xd7149));import{readFileSync as a0_0x3780b2,existsSync as a0_0x4630bf}from'fs';import{randomUUID as a0_0x2a66ba}from'crypto';import{join as a0_0x5d4dab}from'path';import{hostname as a0_0x2b25b4}from'os';import{execSync as a0_0x3b8f3c}from'child_process';import{Server as a0_0x500049}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x394e6c}from'@modelcontextprotocol/sdk/server/stdio.js';function a0_0x44b6(_0x97c757,_0x2a1196){_0x97c757=_0x97c757-0x1ce;const _0x461032=a0_0x4610();let _0x44b698=_0x461032[_0x97c757];return _0x44b698;}import{ListToolsRequestSchema as a0_0x1558fa,CallToolRequestSchema as a0_0x2f3eba}from'@modelcontextprotocol/sdk/types.js';function p(_0x4e64ef){const _0x49769f=a0_0x44b6;if(!a0_0x4630bf(_0x4e64ef))return;for(let _0xb37586 of a0_0x3780b2(_0x4e64ef,'utf-8')['split']('\x0a')){let _0x153414=_0xb37586[_0x49769f(0x1ea)]();if(!_0x153414||_0x153414['startsWith']('#'))continue;let _0x124f19=_0x153414[_0x49769f(0x238)]('=');if(_0x124f19<0x0)continue;let _0x491b48=_0x153414[_0x49769f(0x248)](0x0,_0x124f19)[_0x49769f(0x1ea)](),_0x4ca722=_0x153414[_0x49769f(0x248)](_0x124f19+0x1)['trim']()[_0x49769f(0x255)](/^["']|["']$/g,'');if(!process.env[_0x491b48])process.env[_0x491b48]=_0x4ca722;}}var T=process.env.HOME||'~',C=a0_0x5d4dab(T,a0_0x4e5b9b(0x264));p(a0_0x5d4dab(C,'.env'));var L=process['cwd']()[a0_0x4e5b9b(0x255)](/\//g,'-');p(a0_0x5d4dab(C,L,a0_0x4e5b9b(0x1f5)));function U(){const _0x5c183e=a0_0x4e5b9b;try{return a0_0x3b8f3c(_0x5c183e(0x216),{'encoding':'utf-8','timeout':0x7d0})['trim']();}catch{return'';}}function c(){const _0x526158=a0_0x4e5b9b;try{let _0x555cdb=a0_0x5d4dab(T,_0x526158(0x1e5),_0x526158(0x1fc));if(a0_0x4630bf(_0x555cdb))return JSON['parse'](a0_0x3780b2(_0x555cdb,'utf-8'));}catch{}return{};}var I=c(),f=process.env.COMMHUB_URL||I[a0_0x4e5b9b(0x246)]||'http://127.0.0.1:9200',x=process.env.COMMHUB_TMUX||U(),G=process.env.COMMHUB_ALIAS||x||a0_0x2b25b4(),X=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x2a66ba(),F=process.env.COMMHUB_TOKEN||I[a0_0x4e5b9b(0x22e)]||'';function Z(_0x476796){const _0x81e3e=a0_0x4e5b9b;let _0x55ba8b=new Date()[_0x81e3e(0x250)]()['slice'](0x0,0x8);process[_0x81e3e(0x224)][_0x81e3e(0x1d3)]('['+_0x55ba8b+']\x20[commhub]\x20'+_0x476796+'\x0a');}function O(_0x2ff118){return new Promise(_0x19067f=>setTimeout(_0x19067f,_0x2ff118));}Z(a0_0x4e5b9b(0x266)+f+a0_0x4e5b9b(0x237)+G+a0_0x4e5b9b(0x225)+X[a0_0x4e5b9b(0x248)](0x0,0x8)+a0_0x4e5b9b(0x241)+(x||a0_0x4e5b9b(0x211))+a0_0x4e5b9b(0x230)+process[a0_0x4e5b9b(0x24d)]()+a0_0x4e5b9b(0x267)+L);var N=new Map(),y=new a0_0x500049({'name':'commhub-channel','version':'0.3.0'},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x4e5b9b(0x1fd),a0_0x4e5b9b(0x253),a0_0x4e5b9b(0x1d6),a0_0x4e5b9b(0x1e3),a0_0x4e5b9b(0x269)+G][a0_0x4e5b9b(0x254)]('\x0a')});y['setRequestHandler'](a0_0x1558fa,async()=>({'tools':[{'name':a0_0x4e5b9b(0x26c),'description':a0_0x4e5b9b(0x26e),'inputSchema':{'type':a0_0x4e5b9b(0x261),'properties':{'task_id':{'type':a0_0x4e5b9b(0x1e2),'description':a0_0x4e5b9b(0x1db)},'text':{'type':'string','description':a0_0x4e5b9b(0x1da)},'status':{'type':a0_0x4e5b9b(0x1e2),'enum':['completed',a0_0x4e5b9b(0x1ff),a0_0x4e5b9b(0x23d),a0_0x4e5b9b(0x243),'error','in_progress'],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':[a0_0x4e5b9b(0x1f0)]}},{'name':'commhub_report_status','description':a0_0x4e5b9b(0x23e),'inputSchema':{'type':a0_0x4e5b9b(0x261),'properties':{'status':{'type':a0_0x4e5b9b(0x1e2),'enum':[a0_0x4e5b9b(0x21e),'idle',a0_0x4e5b9b(0x243),a0_0x4e5b9b(0x249)]},'task':{'type':a0_0x4e5b9b(0x1e2),'description':'Current\x20task\x20description'},'progress':{'type':'number','description':a0_0x4e5b9b(0x26b)}},'required':[a0_0x4e5b9b(0x262)]}},{'name':a0_0x4e5b9b(0x252),'description':'Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','inputSchema':{'type':a0_0x4e5b9b(0x261),'properties':{'alias':{'type':a0_0x4e5b9b(0x1e2),'description':a0_0x4e5b9b(0x209)},'task':{'type':a0_0x4e5b9b(0x1e2),'description':a0_0x4e5b9b(0x259)},'priority':{'type':'string','enum':['high',a0_0x4e5b9b(0x232),a0_0x4e5b9b(0x1d4)],'description':'Priority\x20(default:\x20normal)'},'parent_task_id':{'type':a0_0x4e5b9b(0x1e2),'description':a0_0x4e5b9b(0x240)},'ttl_seconds':{'type':'number','description':a0_0x4e5b9b(0x1d8)},'context':{'type':a0_0x4e5b9b(0x1e2),'description':a0_0x4e5b9b(0x1ed)},'meta':{'type':'object','description':a0_0x4e5b9b(0x1ce)}},'required':[a0_0x4e5b9b(0x25b),a0_0x4e5b9b(0x22b)]}},{'name':'commhub_send_message','description':'Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','inputSchema':{'type':a0_0x4e5b9b(0x261),'properties':{'alias':{'type':a0_0x4e5b9b(0x1e2),'description':a0_0x4e5b9b(0x209)},'message':{'type':a0_0x4e5b9b(0x1e2),'description':a0_0x4e5b9b(0x25a)}},'required':[a0_0x4e5b9b(0x25b),a0_0x4e5b9b(0x244)]}},{'name':a0_0x4e5b9b(0x1f8),'description':a0_0x4e5b9b(0x1f4),'inputSchema':{'type':a0_0x4e5b9b(0x261),'properties':{}}},{'name':a0_0x4e5b9b(0x1e9),'description':a0_0x4e5b9b(0x1eb),'inputSchema':{'type':a0_0x4e5b9b(0x261),'properties':{'alias':{'type':a0_0x4e5b9b(0x1e2),'description':'Session\x20alias'}},'required':[a0_0x4e5b9b(0x25b)]}},{'name':a0_0x4e5b9b(0x1d5),'description':'Get\x20task\x20details\x20by\x20task_id.\x20Poll\x20this\x20until\x20status\x20is\x20replied\x20or\x20failed.','inputSchema':{'type':'object','properties':{'task_id':{'type':'string','description':a0_0x4e5b9b(0x25f)}},'required':['task_id']}},{'name':a0_0x4e5b9b(0x1f7),'description':a0_0x4e5b9b(0x202),'inputSchema':{'type':'object','properties':{'to_name':{'type':a0_0x4e5b9b(0x1e2),'description':a0_0x4e5b9b(0x1ec)},'from_name':{'type':a0_0x4e5b9b(0x1e2),'description':a0_0x4e5b9b(0x24a)},'status':{'type':a0_0x4e5b9b(0x1e2),'description':a0_0x4e5b9b(0x24b)},'limit':{'type':a0_0x4e5b9b(0x1fb),'description':a0_0x4e5b9b(0x1e4)}}}}]}));async function P(_0x2c178f,_0x3a43b7){const _0x34add9=a0_0x4e5b9b;let _0xea864b=await fetch(f+_0x34add9(0x1d9),{'method':_0x34add9(0x207),'headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream',...F?{'Authorization':'Bearer\x20'+F}:{}},'body':JSON[_0x34add9(0x25e)]({'jsonrpc':_0x34add9(0x22d),'id':0x1,'method':'initialize','params':{'protocolVersion':_0x34add9(0x222),'capabilities':{},'clientInfo':{'name':_0x34add9(0x1fe),'version':_0x34add9(0x1fa)}}})});if(!_0xea864b['ok']){let _0x2692f1=await _0xea864b[_0x34add9(0x1f0)]();return Z('CommHub\x20init\x20failed:\x20'+_0xea864b[_0x34add9(0x262)]+'\x20'+_0x2692f1[_0x34add9(0x248)](0x0,0x64)),{'ok':!0x1,'error':_0x34add9(0x22c)+_0xea864b[_0x34add9(0x262)]};}await _0xea864b[_0x34add9(0x1f0)]();let _0x16bba8=(await(await fetch(f+'/mcp',{'method':_0x34add9(0x207),'headers':{'Content-Type':'application/json','Accept':_0x34add9(0x214),...F?{'Authorization':_0x34add9(0x20c)+F}:{}},'body':JSON[_0x34add9(0x25e)]({'jsonrpc':_0x34add9(0x22d),'id':0x2,'method':_0x34add9(0x235),'params':{'name':_0x2c178f,'arguments':_0x3a43b7}})}))[_0x34add9(0x1f0)]())[_0x34add9(0x226)]('\x0a')[_0x34add9(0x1de)](_0x2efc08=>_0x2efc08[_0x34add9(0x220)](_0x34add9(0x218)));if(_0x16bba8){let _0x377bcb=JSON[_0x34add9(0x21a)](_0x16bba8[_0x34add9(0x248)](0x6));return _0x377bcb?.[_0x34add9(0x1f6)]?.['content']?.[0x0]?.['text']?JSON[_0x34add9(0x21a)](_0x377bcb[_0x34add9(0x1f6)][_0x34add9(0x233)][0x0][_0x34add9(0x1f0)]):_0x377bcb;}return{'ok':!0x1,'error':_0x34add9(0x1f9)};}y[a0_0x4e5b9b(0x22f)](a0_0x2f3eba,async _0x5514c7=>{const _0x238543=a0_0x4e5b9b;let {name:_0x1815b5,arguments:_0xa4d5fb}=_0x5514c7['params'];if(_0x1815b5===_0x238543(0x26c)){let {task_id:_0x2b50c4,text:_0x283f0a,status:_0x5863dc}=_0xa4d5fb;if(_0x5863dc===_0x238543(0x20d)||_0x5863dc===_0x238543(0x1ff)||_0x5863dc===_0x238543(0x23d)){let _0x312d7e=_0x5863dc==='completed'?_0x238543(0x210):_0x5863dc,_0x41d1dc=_0x2b50c4?N[_0x238543(0x229)](_0x2b50c4)||_0x238543(0x246):_0x238543(0x246),_0x89bb2d=await P(_0x238543(0x20e),{'alias':_0x41d1dc,'text':_0x283f0a,'in_reply_to':_0x2b50c4||void 0x0,'status':_0x312d7e,'from_session':G});if(_0x2b50c4)N[_0x238543(0x23c)](_0x2b50c4);return{'content':[{'type':'text','text':JSON['stringify'](_0x89bb2d)}]};}let _0x4293cf=await P(_0x238543(0x204),{'resume_id':X,'alias':G,'status':_0x5863dc===_0x238543(0x243)?_0x238543(0x243):_0x5863dc===_0x238543(0x249)?_0x238543(0x249):'working','task':_0x283f0a[_0x238543(0x248)](0x0,0xc8),'output':_0x283f0a});return{'content':[{'type':_0x238543(0x1f0),'text':JSON['stringify'](_0x4293cf)}]};}if(_0x1815b5===_0x238543(0x265)){let {status:_0x5738f0,task:_0x50952c,progress:_0x1ced98}=_0xa4d5fb,_0x5ef014=await P(_0x238543(0x204),{'resume_id':X,'alias':G,'status':_0x5738f0,'task':_0x50952c,'progress':_0x1ced98});return{'content':[{'type':_0x238543(0x1f0),'text':JSON[_0x238543(0x25e)](_0x5ef014)}]};}if(_0x1815b5==='commhub_send_task'){let {alias:_0x587271,task:_0x1f4639,priority:_0x55b462,parent_task_id:_0x3692ae,ttl_seconds:_0xe32cfa,context:_0x206677,meta:_0x2a6cb8}=_0xa4d5fb,_0x4edf02=await P(_0x238543(0x206),{'alias':_0x587271,'task':_0x1f4639,'priority':_0x55b462||_0x238543(0x232),'parent_task_id':_0x3692ae,'ttl_seconds':_0xe32cfa,'context':_0x206677,'meta':_0x2a6cb8,'from_session':G});return{'content':[{'type':_0x238543(0x1f0),'text':JSON[_0x238543(0x25e)](_0x4edf02)}]};}if(_0x1815b5===_0x238543(0x21f)){let {alias:_0x5717f7,message:_0x361450}=_0xa4d5fb,_0x561e4b=await P('send_message',{'alias':_0x5717f7,'message':_0x361450,'from_session':G});return{'content':[{'type':_0x238543(0x1f0),'text':JSON[_0x238543(0x25e)](_0x561e4b)}]};}if(_0x1815b5===_0x238543(0x1f8)){let _0x2c1b9e=await P(_0x238543(0x231),{});return{'content':[{'type':'text','text':JSON[_0x238543(0x25e)](_0x2c1b9e)}]};}if(_0x1815b5===_0x238543(0x1e9)){let {alias:_0x1875e7}=_0xa4d5fb,_0x31e407=await P(_0x238543(0x221),{'alias':_0x1875e7});return{'content':[{'type':_0x238543(0x1f0),'text':JSON['stringify'](_0x31e407)}]};}if(_0x1815b5===_0x238543(0x1d5)){let {task_id:_0x5d7d4c}=_0xa4d5fb,_0x3b53cf=await P(_0x238543(0x234),{'task_id':_0x5d7d4c});return{'content':[{'type':_0x238543(0x1f0),'text':JSON[_0x238543(0x25e)](_0x3b53cf)}]};}if(_0x1815b5===_0x238543(0x1f7)){let {to_name:_0x4052dd,from_name:_0x2924cd,status:_0x2e5b10,limit:_0x14fe7a}=_0xa4d5fb,_0x12e6e0=await P(_0x238543(0x203),{'to_name':_0x4052dd,'from_name':_0x2924cd,'status':_0x2e5b10,'limit':_0x14fe7a});return{'content':[{'type':_0x238543(0x1f0),'text':JSON[_0x238543(0x25e)](_0x12e6e0)}]};}return{'content':[{'type':_0x238543(0x1f0),'text':JSON['stringify']({'error':_0x238543(0x258)})}]};});async function S(){const _0x5ef33c=a0_0x4e5b9b;let _0x2c50b3=f+'/events/'+encodeURIComponent(G),_0x10c076={};if(F)_0x10c076[_0x5ef33c(0x1df)]=_0x5ef33c(0x20c)+F;Z(_0x5ef33c(0x23b)+_0x2c50b3);while(!0x0){try{let _0x239f2c=await fetch(_0x2c50b3,{'headers':_0x10c076});if(!_0x239f2c['ok']){Z('SSE\x20error:\x20'+_0x239f2c[_0x5ef33c(0x262)]+'\x20'+_0x239f2c['statusText']),await O(0x1388);continue;}let _0x35ce96=_0x239f2c[_0x5ef33c(0x1ef)][_0x5ef33c(0x1d2)](),_0x50196f=new TextDecoder(),_0x23d922='';while(!0x0){let {done:_0x160b82,value:_0x498a9c}=await _0x35ce96[_0x5ef33c(0x236)]();if(_0x160b82)break;_0x23d922+=_0x50196f[_0x5ef33c(0x213)](_0x498a9c,{'stream':!0x0});let _0x153ae4=_0x23d922[_0x5ef33c(0x226)]('\x0a\x0a');_0x23d922=_0x153ae4['pop']()||'';for(let _0xd95c65 of _0x153ae4){let _0x3ff8ce=_0xd95c65[_0x5ef33c(0x226)]('\x0a')[_0x5ef33c(0x1de)](_0x1db378=>_0x1db378['startsWith'](_0x5ef33c(0x218)));if(!_0x3ff8ce)continue;try{let _0x2263ee=JSON[_0x5ef33c(0x21a)](_0x3ff8ce[_0x5ef33c(0x248)](0x6));await A(_0x2263ee);}catch(_0x1f9169){Z(_0x5ef33c(0x242)+_0x1f9169);}}}Z('SSE\x20stream\x20ended,\x20reconnecting...');}catch(_0x4b96eb){Z(_0x5ef33c(0x25c)+_0x4b96eb);}await O(0xbb8);}}async function A(_0x5e1a90){const _0x1cdbd7=a0_0x4e5b9b;if(_0x5e1a90['type']===_0x1cdbd7(0x228)){Z(_0x1cdbd7(0x268)+G+'\x22');return;}if(_0x5e1a90['type']===_0x1cdbd7(0x1ee)){if(Z(_0x1cdbd7(0x25d)+_0x5e1a90['from']+':\x20'+_0x5e1a90[_0x1cdbd7(0x244)][_0x1cdbd7(0x248)](0x0,0x3c)),await y['notification']({'method':'notifications/claude/channel','params':{'content':_0x5e1a90[_0x1cdbd7(0x244)],'meta':{'sender':_0x5e1a90[_0x1cdbd7(0x200)]||'hub','sender_id':'commhub','user':_0x5e1a90['from']||_0x1cdbd7(0x246),'priority':_0x1cdbd7(0x232)}}}),_0x5e1a90['message_id'])await P(_0x1cdbd7(0x1e0),{'alias':G,'message_id':_0x5e1a90['message_id']});return;}if(_0x5e1a90[_0x1cdbd7(0x24f)]===_0x1cdbd7(0x212)||_0x5e1a90[_0x1cdbd7(0x24f)]==='broadcast'){Z('←\x20'+_0x5e1a90[_0x1cdbd7(0x24f)]+_0x1cdbd7(0x1d1)+_0x5e1a90[_0x1cdbd7(0x251)]+_0x1cdbd7(0x1d0)+(_0x5e1a90[_0x1cdbd7(0x1f1)]||_0x1cdbd7(0x232)));let _0x5a891f=await P(_0x1cdbd7(0x24c),{'alias':G,'limit':0x5});if(_0x5a891f?.['ok']&&_0x5a891f[_0x1cdbd7(0x1e6)]?.[_0x1cdbd7(0x257)]>0x0)for(let _0x37d7bc of _0x5a891f[_0x1cdbd7(0x1e6)]){let _0x236012={'sender':_0x37d7bc[_0x1cdbd7(0x23a)]||_0x1cdbd7(0x246),'sender_id':_0x1cdbd7(0x263),'user':_0x37d7bc[_0x1cdbd7(0x23a)]||_0x1cdbd7(0x246),'task_id':_0x37d7bc['id'],'priority':_0x37d7bc[_0x1cdbd7(0x1f1)]||_0x1cdbd7(0x232)};N[_0x1cdbd7(0x20a)](_0x37d7bc['id'],_0x37d7bc[_0x1cdbd7(0x23a)]||_0x1cdbd7(0x246)),await y[_0x1cdbd7(0x26f)]({'method':'notifications/claude/channel','params':{'content':_0x37d7bc['content'],'meta':_0x236012}}),Z('→\x20injected\x20task\x20'+_0x37d7bc['id'][_0x1cdbd7(0x248)](0x0,0x8)+_0x1cdbd7(0x1d7)+_0x37d7bc['from_session']+':\x20'+_0x37d7bc[_0x1cdbd7(0x233)][_0x1cdbd7(0x248)](0x0,0x3c)),await P(_0x1cdbd7(0x1e0),{'alias':G,'message_id':_0x37d7bc['id']});}}}async function u(){const _0x475e2b=a0_0x4e5b9b;let _0x1c2402=new a0_0x394e6c();await y[_0x475e2b(0x21d)](_0x1c2402),Z(_0x475e2b(0x227)),Z(_0x475e2b(0x260)),S()[_0x475e2b(0x217)](_0xc773eb=>Z('SSE\x20fatal:\x20'+_0xc773eb)),P(_0x475e2b(0x204),{'resume_id':X,'alias':G,'status':'idle','server':a0_0x2b25b4(),'hostname':a0_0x2b25b4(),'agent':'claude-code','project_dir':process['cwd'](),'tmux_name':x||void 0x0})[_0x475e2b(0x201)](()=>Z(_0x475e2b(0x223)+G+_0x475e2b(0x215)+X[_0x475e2b(0x248)](0x0,0x8)+')'))[_0x475e2b(0x217)](_0x3b6049=>Z(_0x475e2b(0x22a)+_0x3b6049)),setInterval(()=>{const _0x499611=_0x475e2b;P('report_status',{'resume_id':X,'alias':G,'status':_0x499611(0x21c),'server':a0_0x2b25b4(),'hostname':a0_0x2b25b4(),'agent':_0x499611(0x239),'project_dir':process[_0x499611(0x24d)](),'tmux_name':x||void 0x0})['catch'](_0x14dd3d=>Z('heartbeat\x20failed:\x20'+_0x14dd3d));},0x2bf20),Z('ready\x20—\x20waiting\x20for\x20events');}u()[a0_0x4e5b9b(0x217)](_0x3e066f=>{const _0x2703cb=a0_0x4e5b9b;Z(_0x2703cb(0x1f3)+_0x3e066f),process['exit'](0x1);});async function h(){const _0x4cc68f=a0_0x4e5b9b;Z(_0x4cc68f(0x1e1)),await P(_0x4cc68f(0x204),{'resume_id':X,'alias':G,'status':_0x4cc68f(0x26d),'task':_0x4cc68f(0x1e7)})['catch'](()=>{}),process[_0x4cc68f(0x205)](0x0);}process[a0_0x4e5b9b(0x20b)]['on'](a0_0x4e5b9b(0x247),()=>h()),process['on'](a0_0x4e5b9b(0x23f),()=>h()),process['on']('SIGINT',()=>h());function a0_0x4610(){const _0x2b51b5=['parse','14546QpErKe','idle','connect','working','commhub_send_message','startsWith','get_session_status','2025-03-26','registered\x20as\x20\x22','stderr','\x20RESUME_ID=','split','MCP\x20stdio\x20connected','connected','get','warning:\x20could\x20not\x20register:\x20','task','init\x20failed:\x20','2.0','token','setRequestHandler','\x20CWD=','get_all_status','normal','content','get_task','tools/call','read','\x20ALIAS=','indexOf','claude-code','from_session','connecting\x20to\x20','delete','cancelled','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','SIGTERM','Parent\x20task\x20id\x20for\x20auto-chaining\x20child\x20replies','...\x20TMUX=','parse\x20error:\x20','blocked','message','13NSqLwa','hub','end','slice','error','Filter\x20by\x20sender\x20alias','Filter\x20by\x20status','get_inbox','cwd','46887396Drkstd','type','toTimeString','inbox_count','commhub_send_task','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','join','replace','17463974nRjZlr','length','unknown\x20tool','Task\x20content','Message\x20content','alias','SSE\x20connection\x20error:\x20','←\x20message\x20from\x20','stringify','Task\x20id','starting\x20SSE\x20listener...','object','status','commhub','.claude/channels/commhub','commhub_report_status','ENV:\x20URL=','\x20PROJECT_ENV=','SSE\x20connected\x20as\x20\x22','Session\x20alias:\x20','7318960CxPBLc','Progress\x200-100','commhub_reply','offline','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','notification','Optional\x20structured\x20metadata','535GMfmKu','\x20priority=',':\x20inbox_count=','getReader','write','low','commhub_get_task','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','\x20from\x20','Task\x20TTL\x20in\x20seconds','/mcp','Reply\x20text\x20/\x20result\x20summary','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','871936aiSyjJ','9ZovMsh','find','Authorization','ack_inbox','shutting\x20down,\x20reporting\x20offline...','string','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','Max\x20rows','.anet','messages','session\x20disconnected','1255366nWQkDz','commhub_get_session_status','trim','Get\x20detailed\x20status\x20for\x20a\x20session\x20alias.','Filter\x20by\x20recipient\x20alias','Optional\x20context','new_message','body','text','priority','57258jYPjPG','fatal:\x20','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','.env','result','commhub_list_tasks','commhub_get_all_status','no\x20response','0.3.0','number','config.json','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','commhub-channel','failed','from','then','List\x20tasks\x20with\x20optional\x20filters.','list_tasks','report_status','exit','send_task','POST','472SftnFH','Target\x20session\x20alias','set','stdin','Bearer\x20','completed','send_reply','6bhpWAo','replied','none','new_task','decode','application/json,\x20text/event-stream','\x22\x20(','tmux\x20display-message\x20-p\x20\x27#S\x27','catch','data:\x20','1ynYlop'];a0_0x4610=function(){return _0x2b51b5;};return a0_0x4610();}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.2.8-preview.0",
3
+ "version": "2.2.8",
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",
@@ -42,7 +42,7 @@
42
42
  "homepage": "https://anet.sh",
43
43
  "repository": {
44
44
  "type": "git",
45
- "url": "https://github.com/sleep2agi/agent-network",
45
+ "url": "git+https://github.com/sleep2agi/agent-network.git",
46
46
  "directory": "agent-network"
47
47
  },
48
48
  "publishConfig": {