@sleep2agi/agent-network 2.0.0-preview.12 → 2.0.0-preview.13

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_0x5f47e6=a0_0x3e42;(function(_0x1399d6,_0x2c2ad0){const _0x53721=a0_0x3e42,_0x150c50=_0x1399d6();while(!![]){try{const _0x489f7b=-parseInt(_0x53721(0x208))/0x1+parseInt(_0x53721(0x20e))/0x2+-parseInt(_0x53721(0x1dc))/0x3*(-parseInt(_0x53721(0x211))/0x4)+parseInt(_0x53721(0x1f3))/0x5*(parseInt(_0x53721(0x20f))/0x6)+parseInt(_0x53721(0x1eb))/0x7*(parseInt(_0x53721(0x20a))/0x8)+-parseInt(_0x53721(0x1f0))/0x9*(parseInt(_0x53721(0x213))/0xa)+-parseInt(_0x53721(0x1d6))/0xb;if(_0x489f7b===_0x2c2ad0)break;else _0x150c50['push'](_0x150c50['shift']());}catch(_0x2989f4){_0x150c50['push'](_0x150c50['shift']());}}}(a0_0x3bd1,0x65eaf));import{EventEmitter as a0_0x5a6e00}from'events';import{hostname as a0_0x407865}from'os';function a0_0x3bd1(){const _0x5f3b9f=['9yYDqPg','agent','catch','10SNjvAF','content','connect','alias','result','/events/','from_session','log','POST','send','toTimeString','emit','application/json','inbox\x20error:\x20','match','message','cwd','decode','slice','messages','2.0','9559fwMqgn','tools/call','1573952prfBdl','token','data:\x20','normal','1107802vWCVuJ','1745922splaHC','sdk','1091188SURUMl','heartbeatInterval','912230TbZaym','connected','heartbeat\x20failed:\x20','ack_inbox','new_task','AbortError','reconnectDelay','sleep','min','text/event-stream','status','SSE\x20error:\x20','call','type','connectSSE','get_inbox','parse','startsWith','task','replace','SSE\x20failed:\x20','new_message','/mcp','body','error','14123153uGXcVR','idle','Authorization','running','resumeId','abort','3iLYgmj','processInbox','url','disconnect','Bearer\x20','sseAbort','get_all_status','SSE\x20connected','sdk-','read','autoConnect','reply','disconnected','send_task','now','14ibnkTL','s...','text','registered','heartbeatTimer'];a0_0x3bd1=function(){return _0x5f3b9f;};return a0_0x3bd1();}class T extends a0_0x5a6e00{[a0_0x5f47e6(0x1de)];['alias'];[a0_0x5f47e6(0x20b)];[a0_0x5f47e6(0x1f1)];[a0_0x5f47e6(0x1da)];[a0_0x5f47e6(0x212)];[a0_0x5f47e6(0x219)];[a0_0x5f47e6(0x1ef)];[a0_0x5f47e6(0x1e1)];[a0_0x5f47e6(0x1d9)]=!0x1;constructor(_0x2d8b00){const _0x4fa404=a0_0x5f47e6;super();if(this[_0x4fa404(0x1de)]=_0x2d8b00[_0x4fa404(0x1de)][_0x4fa404(0x1d0)](/\/$/,''),this[_0x4fa404(0x1f6)]=_0x2d8b00[_0x4fa404(0x1f6)],this[_0x4fa404(0x20b)]=_0x2d8b00['token'],this[_0x4fa404(0x1f1)]=_0x2d8b00[_0x4fa404(0x1f1)]||_0x4fa404(0x210),this['resumeId']=_0x4fa404(0x1e4)+_0x2d8b00[_0x4fa404(0x1f6)]+'-'+Date[_0x4fa404(0x1ea)]()['toString'](0x24),this['heartbeatInterval']=_0x2d8b00[_0x4fa404(0x212)]??0x2bf20,this[_0x4fa404(0x219)]=_0x2d8b00[_0x4fa404(0x219)]??0xbb8,_0x2d8b00[_0x4fa404(0x1e6)]!==!0x1)this[_0x4fa404(0x1f5)]();}[a0_0x5f47e6(0x1fa)](_0x14e83f){const _0x37f7c7=a0_0x5f47e6;console[_0x37f7c7(0x1fa)]('['+new Date()[_0x37f7c7(0x1fd)]()[_0x37f7c7(0x205)](0x0,0x8)+']\x20[commhub:'+this[_0x37f7c7(0x1f6)]+']\x20'+_0x14e83f);}async[a0_0x5f47e6(0x21f)](_0x710ec2,_0x4efafc){const _0x18c421=a0_0x5f47e6;let _0x49c56b={'Content-Type':_0x18c421(0x1ff),'Accept':'application/json,\x20text/event-stream'};if(this['token'])_0x49c56b[_0x18c421(0x1d8)]=_0x18c421(0x1e0)+this[_0x18c421(0x20b)];let _0x3977de=await(await fetch(this[_0x18c421(0x1de)]+_0x18c421(0x1d3),{'method':_0x18c421(0x1fb),'headers':_0x49c56b,'body':JSON['stringify']({'jsonrpc':_0x18c421(0x207),'id':Date[_0x18c421(0x1ea)](),'method':_0x18c421(0x209),'params':{'name':_0x710ec2,'arguments':_0x4efafc}})}))[_0x18c421(0x1ed)](),_0x43e59b=_0x3977de[_0x18c421(0x201)](/data: (.+)/),_0x2ece91=_0x43e59b?JSON[_0x18c421(0x1cd)](_0x43e59b[0x1]):JSON['parse'](_0x3977de),_0x2a8fd2=_0x2ece91?.[_0x18c421(0x1f7)]?.[_0x18c421(0x1f4)]?.[0x0]?.[_0x18c421(0x1ed)];return _0x2a8fd2?JSON['parse'](_0x2a8fd2):_0x2ece91;}async['connect'](){const _0x2d5c6b=a0_0x5f47e6;if(this['running'])return;this['running']=!0x0,await this[_0x2d5c6b(0x21d)]('idle'),this[_0x2d5c6b(0x1fa)](_0x2d5c6b(0x1ee)),this[_0x2d5c6b(0x1ef)]=setInterval(()=>{const _0xa77b29=_0x2d5c6b;this[_0xa77b29(0x21d)](_0xa77b29(0x1d7))[_0xa77b29(0x1f2)](_0x192fc0=>this[_0xa77b29(0x1fa)](_0xa77b29(0x215)+_0x192fc0[_0xa77b29(0x202)]));},this['heartbeatInterval']),this['connectSSE']();}async[a0_0x5f47e6(0x1df)](){const _0x118d53=a0_0x5f47e6;if(this[_0x118d53(0x1d9)]=!0x1,this[_0x118d53(0x1e1)]?.[_0x118d53(0x1db)](),this[_0x118d53(0x1ef)])clearInterval(this[_0x118d53(0x1ef)]);await this[_0x118d53(0x21d)]('offline')['catch'](()=>{}),this[_0x118d53(0x1fa)](_0x118d53(0x1e8));}async[a0_0x5f47e6(0x1fc)](_0x48f702,_0x148f2b,_0x505197=a0_0x5f47e6(0x20d)){const _0x3f153b=a0_0x5f47e6;return this[_0x3f153b(0x21f)](_0x3f153b(0x1e9),{'alias':_0x48f702,'task':_0x148f2b,'priority':_0x505197,'from_session':this[_0x3f153b(0x1f6)]});}async['message'](_0x50dda7,_0x3c6122){const _0x33a960=a0_0x5f47e6;return this['call']('send_message',{'alias':_0x50dda7,'message':_0x3c6122,'from_session':this[_0x33a960(0x1f6)]});}async[a0_0x5f47e6(0x1e7)](_0x53dd0f,_0x2b961e,_0x2a5cde='completed'){const _0x16f98d=a0_0x5f47e6;return this[_0x16f98d(0x21f)](_0x16f98d(0x1e7),{'task_id':_0x53dd0f,'text':_0x2b961e,'status':_0x2a5cde});}async['status'](_0x55efd9,_0x38f786){const _0x32ed0a=a0_0x5f47e6;return this['call']('report_status',{'resume_id':this['resumeId'],'alias':this['alias'],'status':_0x55efd9,'server':a0_0x407865(),'hostname':a0_0x407865(),'agent':this[_0x32ed0a(0x1f1)],'project_dir':process[_0x32ed0a(0x203)](),..._0x38f786});}async['getAllStatus'](){const _0x34a29c=a0_0x5f47e6;return this[_0x34a29c(0x21f)](_0x34a29c(0x1e2),{});}async['broadcast'](_0x50827c,_0x17f9da){const _0x254c9d=a0_0x5f47e6;return this[_0x254c9d(0x21f)]('broadcast',{'message':_0x50827c,'filter_server':_0x17f9da?.['server'],'filter_status':_0x17f9da?.['status']});}async[a0_0x5f47e6(0x221)](){const _0x17bea3=a0_0x5f47e6;let _0x39f9f1=encodeURIComponent(this['alias']),_0x4021be=this['url']+_0x17bea3(0x1f8)+_0x39f9f1,_0x56d2f1=this[_0x17bea3(0x219)];while(this[_0x17bea3(0x1d9)]){try{this[_0x17bea3(0x1e1)]=new AbortController();let _0xde1dd7={'Accept':_0x17bea3(0x21c)};if(this[_0x17bea3(0x20b)])_0xde1dd7[_0x17bea3(0x1d8)]=_0x17bea3(0x1e0)+this[_0x17bea3(0x20b)];let _0x31c6e7=await fetch(_0x4021be,{'headers':_0xde1dd7,'signal':this[_0x17bea3(0x1e1)]['signal']});if(!_0x31c6e7['ok']||!_0x31c6e7[_0x17bea3(0x1d4)]){this[_0x17bea3(0x1fa)](_0x17bea3(0x1d1)+_0x31c6e7[_0x17bea3(0x21d)]),await this[_0x17bea3(0x21a)](_0x56d2f1),_0x56d2f1=Math[_0x17bea3(0x21b)](_0x56d2f1*1.5,0xea60);continue;}_0x56d2f1=this[_0x17bea3(0x219)];let _0x376d2f=_0x31c6e7[_0x17bea3(0x1d4)]['getReader'](),_0x397d22=new TextDecoder(),_0x2d2efb='';while(this[_0x17bea3(0x1d9)]){let {done:_0x5f1c63,value:_0x94cf72}=await _0x376d2f[_0x17bea3(0x1e5)]();if(_0x5f1c63)break;_0x2d2efb+=_0x397d22[_0x17bea3(0x204)](_0x94cf72,{'stream':!0x0});let _0x3bd8d5=_0x2d2efb['split']('\x0a');_0x2d2efb=_0x3bd8d5['pop']()||'';for(let _0x275e70 of _0x3bd8d5){if(!_0x275e70[_0x17bea3(0x1ce)](_0x17bea3(0x20c)))continue;try{let _0x105501=JSON['parse'](_0x275e70[_0x17bea3(0x205)](0x6));if(_0x105501['type']==='connected'){this[_0x17bea3(0x1fa)](_0x17bea3(0x1e3)),this['emit'](_0x17bea3(0x214));continue;}if(_0x105501[_0x17bea3(0x220)]===_0x17bea3(0x217)||_0x105501[_0x17bea3(0x220)]===_0x17bea3(0x1d2)||_0x105501[_0x17bea3(0x220)]==='broadcast')await this[_0x17bea3(0x1dd)]();}catch{}}}}catch(_0xb80dd0){if(_0xb80dd0['name']===_0x17bea3(0x218))break;this['emit'](_0x17bea3(0x1d5),_0xb80dd0),this[_0x17bea3(0x1fa)](_0x17bea3(0x21e)+_0xb80dd0[_0x17bea3(0x202)]);}if(this[_0x17bea3(0x1d9)])this[_0x17bea3(0x1fe)](_0x17bea3(0x1e8)),this[_0x17bea3(0x1fa)]('SSE\x20reconnecting\x20in\x20'+_0x56d2f1/0x3e8+_0x17bea3(0x1ec)),await this['sleep'](_0x56d2f1),_0x56d2f1=Math[_0x17bea3(0x21b)](_0x56d2f1*1.5,0xea60);}}async[a0_0x5f47e6(0x1dd)](){const _0x123775=a0_0x5f47e6;try{let _0x1f2fb1=(await this[_0x123775(0x21f)](_0x123775(0x222),{'alias':this[_0x123775(0x1f6)],'limit':0xa}))?.[_0x123775(0x206)]||[];for(let _0x27c05f of _0x1f2fb1)await this['call'](_0x123775(0x216),{'alias':this[_0x123775(0x1f6)],'message_id':_0x27c05f['id']}),this['log']('←\x20'+_0x27c05f[_0x123775(0x1f9)]+':\x20'+_0x27c05f[_0x123775(0x1f4)][_0x123775(0x205)](0x0,0x3c)),this[_0x123775(0x1fe)](_0x123775(0x1cf),_0x27c05f),this[_0x123775(0x1fe)]('message',_0x27c05f);}catch(_0xd88563){this['log'](_0x123775(0x200)+_0xd88563[_0x123775(0x202)]);}}['sleep'](_0xe3954d){return new Promise(_0xfcc4eb=>setTimeout(_0xfcc4eb,_0xe3954d));}}var $=T;function a0_0x3e42(_0x275463,_0x584f11){_0x275463=_0x275463-0x1cd;const _0x3bd1a0=a0_0x3bd1();let _0x3e421c=_0x3bd1a0[_0x275463];return _0x3e421c;}export{$ as default,T as CommHub};
1
+ function a0_0x1545(){const _0x4bd192=['toTimeString','/events/','report_status','9307760wjiTLc','type','inbox\x20error:\x20','log','Authorization','connect','task','emit','normal','Bearer\x20','get_all_status','now','3727624DLquUP','agent','url','slice','application/json','offline','toString','tools/call','running','alias','POST','heartbeatTimer','cwd','3365985ibzFMJ','ack_inbox','sseAbort','server','data:\x20','autoConnect','message','send','connected','s...','startsWith','processInbox','parse','sdk-','token','read','reply','new_message','reconnectDelay','AbortError','match','name','2.0','error','291031Asjccs','resumeId','heartbeat\x20failed:\x20','content',']\x20[commhub:','pop','send_message','SSE\x20error:\x20','get_inbox','broadcast','12SWzvXI','connectSSE','catch','sdk','5887144VfFiZc','idle','body','send_task','call','text','abort','replace','stringify','2816670jQpowF','status','heartbeatInterval','result','text/event-stream','SSE\x20failed:\x20','178746qipNNd','SSE\x20connected','getAllStatus','/mcp','sleep','decode','min','split','getReader','disconnected'];a0_0x1545=function(){return _0x4bd192;};return a0_0x1545();}const a0_0x4d3f96=a0_0x26b9;(function(_0xde9495,_0x296472){const _0x589162=a0_0x26b9,_0x38ec5b=_0xde9495();while(!![]){try{const _0x10fa18=parseInt(_0x589162(0x1b4))/0x1+-parseInt(_0x589162(0x1cb))/0x2+parseInt(_0x589162(0x1d1))/0x3+parseInt(_0x589162(0x1c2))/0x4+parseInt(_0x589162(0x19c))/0x5*(parseInt(_0x589162(0x1be))/0x6)+-parseInt(_0x589162(0x183))/0x7+parseInt(_0x589162(0x18f))/0x8;if(_0x10fa18===_0x296472)break;else _0x38ec5b['push'](_0x38ec5b['shift']());}catch(_0x4b388a){_0x38ec5b['push'](_0x38ec5b['shift']());}}}(a0_0x1545,0xdaedb));function a0_0x26b9(_0x2222e3,_0x37ff59){_0x2222e3=_0x2222e3-0x179;const _0x1545af=a0_0x1545();let _0x26b94e=_0x1545af[_0x2222e3];return _0x26b94e;}import{EventEmitter as a0_0x14aba8}from'events';import{hostname as a0_0x1ca0e5}from'os';class T extends a0_0x14aba8{[a0_0x4d3f96(0x191)];[a0_0x4d3f96(0x198)];['token'];['agent'];[a0_0x4d3f96(0x1b5)];['heartbeatInterval'];[a0_0x4d3f96(0x1ae)];[a0_0x4d3f96(0x19a)];[a0_0x4d3f96(0x19e)];[a0_0x4d3f96(0x197)]=!0x1;constructor(_0xe595bb){const _0x4a2cc3=a0_0x4d3f96;super();if(this[_0x4a2cc3(0x191)]=_0xe595bb[_0x4a2cc3(0x191)][_0x4a2cc3(0x1c9)](/\/$/,''),this[_0x4a2cc3(0x198)]=_0xe595bb['alias'],this[_0x4a2cc3(0x1aa)]=_0xe595bb[_0x4a2cc3(0x1aa)],this[_0x4a2cc3(0x190)]=_0xe595bb[_0x4a2cc3(0x190)]||_0x4a2cc3(0x1c1),this[_0x4a2cc3(0x1b5)]=_0x4a2cc3(0x1a9)+_0xe595bb[_0x4a2cc3(0x198)]+'-'+Date['now']()[_0x4a2cc3(0x195)](0x24),this[_0x4a2cc3(0x1cd)]=_0xe595bb[_0x4a2cc3(0x1cd)]??0x2bf20,this[_0x4a2cc3(0x1ae)]=_0xe595bb[_0x4a2cc3(0x1ae)]??0xbb8,_0xe595bb[_0x4a2cc3(0x1a1)]!==!0x1)this[_0x4a2cc3(0x188)]();}[a0_0x4d3f96(0x186)](_0x320c60){const _0x10fb4e=a0_0x4d3f96;console[_0x10fb4e(0x186)]('['+new Date()[_0x10fb4e(0x180)]()[_0x10fb4e(0x192)](0x0,0x8)+_0x10fb4e(0x1b8)+this[_0x10fb4e(0x198)]+']\x20'+_0x320c60);}async[a0_0x4d3f96(0x1c6)](_0x4c4c33,_0x10aa38){const _0x942fd3=a0_0x4d3f96;let _0x275ad4={'Content-Type':_0x942fd3(0x193),'Accept':'application/json,\x20text/event-stream'};if(this[_0x942fd3(0x1aa)])_0x275ad4['Authorization']=_0x942fd3(0x18c)+this[_0x942fd3(0x1aa)];let _0x259d6d=await(await fetch(this['url']+_0x942fd3(0x179),{'method':_0x942fd3(0x199),'headers':_0x275ad4,'body':JSON[_0x942fd3(0x1ca)]({'jsonrpc':_0x942fd3(0x1b2),'id':Date[_0x942fd3(0x18e)](),'method':_0x942fd3(0x196),'params':{'name':_0x4c4c33,'arguments':_0x10aa38}})}))[_0x942fd3(0x1c7)](),_0x17893d=_0x259d6d[_0x942fd3(0x1b0)](/data: (.+)/),_0x4cde92=_0x17893d?JSON[_0x942fd3(0x1a8)](_0x17893d[0x1]):JSON[_0x942fd3(0x1a8)](_0x259d6d),_0x14a853=_0x4cde92?.[_0x942fd3(0x1ce)]?.[_0x942fd3(0x1b7)]?.[0x0]?.[_0x942fd3(0x1c7)];return _0x14a853?JSON[_0x942fd3(0x1a8)](_0x14a853):_0x4cde92;}async[a0_0x4d3f96(0x188)](){const _0x25b10c=a0_0x4d3f96;if(this[_0x25b10c(0x197)])return;this[_0x25b10c(0x197)]=!0x0,await this['status'](_0x25b10c(0x1c3)),this[_0x25b10c(0x186)]('registered'),this[_0x25b10c(0x19a)]=setInterval(()=>{const _0x5dbab2=_0x25b10c;this[_0x5dbab2(0x1cc)](_0x5dbab2(0x1c3))['catch'](_0x43401c=>this[_0x5dbab2(0x186)](_0x5dbab2(0x1b6)+_0x43401c[_0x5dbab2(0x1a2)]));},this[_0x25b10c(0x1cd)]),this[_0x25b10c(0x1bf)]();}async['disconnect'](){const _0x4d89bd=a0_0x4d3f96;if(this[_0x4d89bd(0x197)]=!0x1,this[_0x4d89bd(0x19e)]?.[_0x4d89bd(0x1c8)](),this[_0x4d89bd(0x19a)])clearInterval(this[_0x4d89bd(0x19a)]);await this[_0x4d89bd(0x1cc)](_0x4d89bd(0x194))[_0x4d89bd(0x1c0)](()=>{}),this[_0x4d89bd(0x186)](_0x4d89bd(0x17f));}async[a0_0x4d3f96(0x1a3)](_0x42aadf,_0x2acf0a,_0x1126cc=a0_0x4d3f96(0x18b)){const _0x52508c=a0_0x4d3f96;return this[_0x52508c(0x1c6)](_0x52508c(0x1c5),{'alias':_0x42aadf,'task':_0x2acf0a,'priority':_0x1126cc,'from_session':this['alias']});}async[a0_0x4d3f96(0x1a2)](_0x1150f7,_0x535443){const _0x2cb448=a0_0x4d3f96;return this[_0x2cb448(0x1c6)](_0x2cb448(0x1ba),{'alias':_0x1150f7,'message':_0x535443,'from_session':this['alias']});}async[a0_0x4d3f96(0x1ac)](_0x69a753,_0x587fe3,_0x397400='completed'){const _0x26005a=a0_0x4d3f96;return this[_0x26005a(0x1c6)](_0x26005a(0x1ac),{'task_id':_0x69a753,'text':_0x587fe3,'status':_0x397400});}async['status'](_0x2fc5d9,_0x2b4137){const _0x21560f=a0_0x4d3f96;return this['call'](_0x21560f(0x182),{'resume_id':this['resumeId'],'alias':this[_0x21560f(0x198)],'status':_0x2fc5d9,'server':a0_0x1ca0e5(),'hostname':a0_0x1ca0e5(),'agent':this['agent'],'project_dir':process[_0x21560f(0x19b)](),..._0x2b4137});}async[a0_0x4d3f96(0x1d3)](){const _0x5a248a=a0_0x4d3f96;return this['call'](_0x5a248a(0x18d),{});}async[a0_0x4d3f96(0x1bd)](_0x531429,_0x5b4463){const _0x3147ae=a0_0x4d3f96;return this[_0x3147ae(0x1c6)](_0x3147ae(0x1bd),{'message':_0x531429,'filter_server':_0x5b4463?.[_0x3147ae(0x19f)],'filter_status':_0x5b4463?.[_0x3147ae(0x1cc)]});}async[a0_0x4d3f96(0x1bf)](){const _0x4c986e=a0_0x4d3f96;let _0x172a3d=encodeURIComponent(this[_0x4c986e(0x198)]),_0xcb27f6=this[_0x4c986e(0x191)]+_0x4c986e(0x181)+_0x172a3d,_0xf61972=this[_0x4c986e(0x1ae)];while(this[_0x4c986e(0x197)]){try{this[_0x4c986e(0x19e)]=new AbortController();let _0xb1181b={'Accept':_0x4c986e(0x1cf)};if(this[_0x4c986e(0x1aa)])_0xb1181b[_0x4c986e(0x187)]=_0x4c986e(0x18c)+this[_0x4c986e(0x1aa)];let _0x3e869b=await fetch(_0xcb27f6,{'headers':_0xb1181b,'signal':this[_0x4c986e(0x19e)]['signal']});if(!_0x3e869b['ok']||!_0x3e869b[_0x4c986e(0x1c4)]){this['log'](_0x4c986e(0x1d0)+_0x3e869b[_0x4c986e(0x1cc)]),await this[_0x4c986e(0x17a)](_0xf61972),_0xf61972=Math[_0x4c986e(0x17c)](_0xf61972*1.5,0xea60);continue;}_0xf61972=this[_0x4c986e(0x1ae)];let _0x1c0b07=_0x3e869b[_0x4c986e(0x1c4)][_0x4c986e(0x17e)](),_0x1c7b6a=new TextDecoder(),_0xb06e69='';while(this['running']){let {done:_0xe8bfee,value:_0x7915f3}=await _0x1c0b07[_0x4c986e(0x1ab)]();if(_0xe8bfee)break;_0xb06e69+=_0x1c7b6a[_0x4c986e(0x17b)](_0x7915f3,{'stream':!0x0});let _0x1a9a1a=_0xb06e69[_0x4c986e(0x17d)]('\x0a');_0xb06e69=_0x1a9a1a[_0x4c986e(0x1b9)]()||'';for(let _0x12d4b2 of _0x1a9a1a){if(!_0x12d4b2[_0x4c986e(0x1a6)](_0x4c986e(0x1a0)))continue;try{let _0x506c1f=JSON[_0x4c986e(0x1a8)](_0x12d4b2[_0x4c986e(0x192)](0x6));if(_0x506c1f[_0x4c986e(0x184)]===_0x4c986e(0x1a4)){this[_0x4c986e(0x186)](_0x4c986e(0x1d2)),this[_0x4c986e(0x18a)](_0x4c986e(0x1a4));continue;}if(_0x506c1f[_0x4c986e(0x184)]==='new_task'||_0x506c1f[_0x4c986e(0x184)]===_0x4c986e(0x1ad)||_0x506c1f['type']===_0x4c986e(0x1bd))await this[_0x4c986e(0x1a7)]();}catch{}}}}catch(_0x592d3d){if(_0x592d3d[_0x4c986e(0x1b1)]===_0x4c986e(0x1af))break;this[_0x4c986e(0x18a)](_0x4c986e(0x1b3),_0x592d3d),this[_0x4c986e(0x186)](_0x4c986e(0x1bb)+_0x592d3d[_0x4c986e(0x1a2)]);}if(this[_0x4c986e(0x197)])this[_0x4c986e(0x18a)](_0x4c986e(0x17f)),this[_0x4c986e(0x186)]('SSE\x20reconnecting\x20in\x20'+_0xf61972/0x3e8+_0x4c986e(0x1a5)),await this[_0x4c986e(0x17a)](_0xf61972),_0xf61972=Math[_0x4c986e(0x17c)](_0xf61972*1.5,0xea60);}}async['processInbox'](){const _0x1d3e72=a0_0x4d3f96;try{let _0xe14604=(await this[_0x1d3e72(0x1c6)](_0x1d3e72(0x1bc),{'alias':this[_0x1d3e72(0x198)],'limit':0xa}))?.['messages']||[];for(let _0x27ecdf of _0xe14604)await this[_0x1d3e72(0x1c6)](_0x1d3e72(0x19d),{'alias':this[_0x1d3e72(0x198)],'message_id':_0x27ecdf['id']}),this['log']('←\x20'+_0x27ecdf['from_session']+':\x20'+_0x27ecdf['content']['slice'](0x0,0x3c)),this[_0x1d3e72(0x18a)](_0x1d3e72(0x189),_0x27ecdf),this[_0x1d3e72(0x18a)](_0x1d3e72(0x1a2),_0x27ecdf);}catch(_0x54b29c){this[_0x1d3e72(0x186)](_0x1d3e72(0x185)+_0x54b29c['message']);}}[a0_0x4d3f96(0x17a)](_0x54e540){return new Promise(_0x15ae8f=>setTimeout(_0x15ae8f,_0x54e540));}}var $=T;export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x472bdc=a0_0x3900;(function(_0x371ef2,_0x282fd3){const _0x491375=a0_0x3900,_0x3e286e=_0x371ef2();while(!![]){try{const _0x272021=-parseInt(_0x491375(0x1de))/0x1+-parseInt(_0x491375(0x18e))/0x2*(-parseInt(_0x491375(0x173))/0x3)+parseInt(_0x491375(0x1b0))/0x4+parseInt(_0x491375(0x17d))/0x5+-parseInt(_0x491375(0x1cc))/0x6*(-parseInt(_0x491375(0x1d1))/0x7)+-parseInt(_0x491375(0x170))/0x8*(parseInt(_0x491375(0x1df))/0x9)+-parseInt(_0x491375(0x1ac))/0xa;if(_0x272021===_0x282fd3)break;else _0x3e286e['push'](_0x3e286e['shift']());}catch(_0x37c0a9){_0x3e286e['push'](_0x3e286e['shift']());}}}(a0_0x49c7,0xa8563));import{readFileSync as a0_0x49bfde,existsSync as a0_0xb4dbb2}from'fs';import{join as a0_0x4f1ff6}from'path';import{hostname as a0_0x4c7a4a}from'os';import{execSync as a0_0x585ce3}from'child_process';import{Server as a0_0x25635c}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0xc62df2}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x3360a9,CallToolRequestSchema as a0_0x4f2247}from'@modelcontextprotocol/sdk/types.js';function p(_0x5a64cd){const _0x2a45d7=a0_0x3900;if(!a0_0xb4dbb2(_0x5a64cd))return;for(let _0x257d38 of a0_0x49bfde(_0x5a64cd,_0x2a45d7(0x181))[_0x2a45d7(0x19f)]('\x0a')){let _0x183854=_0x257d38['trim']();if(!_0x183854||_0x183854[_0x2a45d7(0x1a6)]('#'))continue;let _0xea025e=_0x183854[_0x2a45d7(0x1b7)]('=');if(_0xea025e<0x0)continue;let _0x4b5764=_0x183854['slice'](0x0,_0xea025e)[_0x2a45d7(0x183)](),_0x4852aa=_0x183854[_0x2a45d7(0x16d)](_0xea025e+0x1)[_0x2a45d7(0x183)]()['replace'](/^["']|["']$/g,'');if(!process.env[_0x4b5764])process.env[_0x4b5764]=_0x4852aa;}}var C=process.env.HOME||'~',T=a0_0x4f1ff6(C,a0_0x472bdc(0x18f));p(a0_0x4f1ff6(T,'.env'));function a0_0x49c7(){const _0x37baae=['new_task','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','messages','2.0','0.3.0','\x20priority=','Current\x20task\x20description','24894AXuvrS','.claude/channels/commhub','send_reply','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','end','token','length','broadcast','no\x20response','stdin','2025-03-26','Task\x20content','tools/call','\x22\x20(','exit','task','get','split','POST','from_session','result','object','application/json','commhub_send_message','startsWith','priority','SSE\x20error:\x20','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','CommHub\x20init\x20failed:\x20','commhub_send_task','7195390LdFYdh','...\x20TMUX=','connecting\x20to\x20','completed','2576648WwdfWL','ENV:\x20URL=','/mcp','working','data:\x20','replace','none','indexOf','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','\x20ALIAS=','stderr','notifications/claude/channel','status','claude-code','get_all_status','low','.env','message','parse','normal','\x20from\x20','find','SSE\x20connection\x20error:\x20','connect','shutting\x20down,\x20reporting\x20offline...','from','params','commhub','6JDbDBU','set','\x20RESUME_ID=','ack_inbox','read','9253727lCKbwJ','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','alias','message_id','\x20PROJECT_ENV=','commhub-channel','stringify','commhub_report_status','string',']\x20[commhub]\x20','commhub_get_all_status','then','Message\x20content','1222308xXPXni','99MiqUnQ','.anet','unknown\x20tool','content','idle','replied','cwd','body','init\x20failed:\x20','blocked','text','\x20CWD=','http://127.0.0.1:9200','application/json,\x20text/event-stream','catch','SSE\x20connected\x20as\x20\x22','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','Session\x20alias:\x20','config.json','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','send_task','Priority\x20(default:\x20normal)','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','Target\x20session\x20alias','cancelled','new_message','slice','report_status','join','923944NAdpjS','SSE\x20stream\x20ended,\x20reconnecting...','decode','237eqrTzf','Reply\x20text\x20/\x20result\x20summary','failed','hub','type','error','tmux\x20display-message\x20-p\x20\x27#S\x27','setRequestHandler','randomUUID','session\x20disconnected','4761705YbYdeN','Authorization','number','Bearer\x20','utf-8','high','trim','write','initialize','pop'];a0_0x49c7=function(){return _0x37baae;};return a0_0x49c7();}var L=process[a0_0x472bdc(0x1e5)]()[a0_0x472bdc(0x1b5)](/\//g,'-');p(a0_0x4f1ff6(T,L,a0_0x472bdc(0x1c0)));function U(){const _0x1818f5=a0_0x472bdc;try{return a0_0x585ce3(_0x1818f5(0x179),{'encoding':_0x1818f5(0x181),'timeout':0x7d0})['trim']();}catch{return'';}}function c(){const _0x3e888d=a0_0x472bdc;try{let _0x4c8025=a0_0x4f1ff6(C,_0x3e888d(0x1e0),_0x3e888d(0x165));if(a0_0xb4dbb2(_0x4c8025))return JSON[_0x3e888d(0x1c2)](a0_0x49bfde(_0x4c8025,_0x3e888d(0x181)));}catch{}return{};}var H=c(),D=process.env.COMMHUB_URL||H['hub']||a0_0x472bdc(0x15f),f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0x4c7a4a(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto[a0_0x472bdc(0x17b)](),X=process.env.COMMHUB_TOKEN||H[a0_0x472bdc(0x193)]||'';function Y(_0x3645d1){const _0x166805=a0_0x472bdc;let _0x33c143=new Date()['toTimeString']()[_0x166805(0x16d)](0x0,0x8);process[_0x166805(0x1ba)][_0x166805(0x184)]('['+_0x33c143+_0x166805(0x1da)+_0x3645d1+'\x0a');}function h(_0x4b7dbf){return new Promise(_0x4ca5c2=>setTimeout(_0x4ca5c2,_0x4b7dbf));}Y(a0_0x472bdc(0x1b1)+D+a0_0x472bdc(0x1b9)+Z+a0_0x472bdc(0x1ce)+w['slice'](0x0,0x8)+a0_0x472bdc(0x1ad)+(f||a0_0x472bdc(0x1b6))+a0_0x472bdc(0x15e)+process['cwd']()+a0_0x472bdc(0x1d5)+L);var k=new Map(),K=new a0_0x25635c({'name':a0_0x472bdc(0x1d6),'version':a0_0x472bdc(0x18b)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x472bdc(0x166),a0_0x472bdc(0x1a9),'Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.',a0_0x472bdc(0x191),a0_0x472bdc(0x164)+Z][a0_0x472bdc(0x16f)]('\x0a')});K['setRequestHandler'](a0_0x3360a9,async()=>({'tools':[{'name':'commhub_reply','description':a0_0x472bdc(0x188),'inputSchema':{'type':a0_0x472bdc(0x1a3),'properties':{'task_id':{'type':'string','description':a0_0x472bdc(0x169)},'text':{'type':'string','description':a0_0x472bdc(0x174)},'status':{'type':a0_0x472bdc(0x1d9),'enum':[a0_0x472bdc(0x1af),a0_0x472bdc(0x175),'cancelled',a0_0x472bdc(0x1e8),a0_0x472bdc(0x178),'in_progress'],'description':a0_0x472bdc(0x1b8)}},'required':[a0_0x472bdc(0x15d)]}},{'name':a0_0x472bdc(0x1d8),'description':a0_0x472bdc(0x163),'inputSchema':{'type':a0_0x472bdc(0x1a3),'properties':{'status':{'type':a0_0x472bdc(0x1d9),'enum':[a0_0x472bdc(0x1b3),a0_0x472bdc(0x1e3),a0_0x472bdc(0x1e8),a0_0x472bdc(0x178)]},'task':{'type':'string','description':a0_0x472bdc(0x18d)},'progress':{'type':a0_0x472bdc(0x17f),'description':'Progress\x200-100'}},'required':[a0_0x472bdc(0x1bc)]}},{'name':a0_0x472bdc(0x1ab),'description':a0_0x472bdc(0x1d2),'inputSchema':{'type':a0_0x472bdc(0x1a3),'properties':{'alias':{'type':a0_0x472bdc(0x1d9),'description':'Target\x20session\x20alias'},'task':{'type':a0_0x472bdc(0x1d9),'description':a0_0x472bdc(0x199)},'priority':{'type':'string','enum':[a0_0x472bdc(0x182),a0_0x472bdc(0x1c3),a0_0x472bdc(0x1bf)],'description':a0_0x472bdc(0x168)}},'required':[a0_0x472bdc(0x1d3),a0_0x472bdc(0x19d)]}},{'name':a0_0x472bdc(0x1a5),'description':'Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','inputSchema':{'type':a0_0x472bdc(0x1a3),'properties':{'alias':{'type':a0_0x472bdc(0x1d9),'description':a0_0x472bdc(0x16a)},'message':{'type':'string','description':a0_0x472bdc(0x1dd)}},'required':[a0_0x472bdc(0x1d3),a0_0x472bdc(0x1c1)]}},{'name':a0_0x472bdc(0x1db),'description':'Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','inputSchema':{'type':'object','properties':{}}}]}));async function P(_0x358a53,_0x5ced8c){const _0x45a561=a0_0x472bdc;let _0x575dd2=await fetch(D+_0x45a561(0x1b2),{'method':_0x45a561(0x1a0),'headers':{'Content-Type':_0x45a561(0x1a4),'Accept':_0x45a561(0x160),...X?{'Authorization':_0x45a561(0x180)+X}:{}},'body':JSON[_0x45a561(0x1d7)]({'jsonrpc':_0x45a561(0x18a),'id':0x1,'method':_0x45a561(0x185),'params':{'protocolVersion':_0x45a561(0x198),'capabilities':{},'clientInfo':{'name':'commhub-channel','version':'0.3.0'}}})});if(!_0x575dd2['ok']){let _0x2ac03e=await _0x575dd2[_0x45a561(0x15d)]();return Y(_0x45a561(0x1aa)+_0x575dd2[_0x45a561(0x1bc)]+'\x20'+_0x2ac03e['slice'](0x0,0x64)),{'ok':!0x1,'error':_0x45a561(0x1e7)+_0x575dd2['status']};}await _0x575dd2['text']();let _0x4185c0=(await(await fetch(D+'/mcp',{'method':_0x45a561(0x1a0),'headers':{'Content-Type':_0x45a561(0x1a4),'Accept':_0x45a561(0x160),...X?{'Authorization':_0x45a561(0x180)+X}:{}},'body':JSON[_0x45a561(0x1d7)]({'jsonrpc':'2.0','id':0x2,'method':_0x45a561(0x19a),'params':{'name':_0x358a53,'arguments':_0x5ced8c}})}))['text']())[_0x45a561(0x19f)]('\x0a')[_0x45a561(0x1c5)](_0x54bf4c=>_0x54bf4c[_0x45a561(0x1a6)](_0x45a561(0x1b4)));if(_0x4185c0){let _0x3c1ed9=JSON['parse'](_0x4185c0[_0x45a561(0x16d)](0x6));return _0x3c1ed9?.['result']?.[_0x45a561(0x1e2)]?.[0x0]?.[_0x45a561(0x15d)]?JSON[_0x45a561(0x1c2)](_0x3c1ed9[_0x45a561(0x1a2)][_0x45a561(0x1e2)][0x0][_0x45a561(0x15d)]):_0x3c1ed9;}return{'ok':!0x1,'error':_0x45a561(0x196)};}K[a0_0x472bdc(0x17a)](a0_0x4f2247,async _0x12925a=>{const _0x5f6e3f=a0_0x472bdc;let {name:_0x995328,arguments:_0x377cea}=_0x12925a[_0x5f6e3f(0x1ca)];if(_0x995328==='commhub_reply'){let {task_id:_0xeb7e2a,text:_0xb9b6c9,status:_0x105410}=_0x377cea;if(_0x105410===_0x5f6e3f(0x1af)||_0x105410===_0x5f6e3f(0x175)||_0x105410===_0x5f6e3f(0x16b)){let _0x4a3af3=_0x105410===_0x5f6e3f(0x1af)?_0x5f6e3f(0x1e4):_0x105410,_0xd8dd59=_0xeb7e2a?k[_0x5f6e3f(0x19e)](_0xeb7e2a)||_0x5f6e3f(0x176):_0x5f6e3f(0x176),_0x274bb2=await P(_0x5f6e3f(0x190),{'alias':_0xd8dd59,'text':_0xb9b6c9,'in_reply_to':_0xeb7e2a||void 0x0,'status':_0x4a3af3,'from_session':Z});if(_0xeb7e2a)k['delete'](_0xeb7e2a);return{'content':[{'type':_0x5f6e3f(0x15d),'text':JSON[_0x5f6e3f(0x1d7)](_0x274bb2)}]};}let _0x22eec7=await P(_0x5f6e3f(0x16e),{'resume_id':w,'alias':Z,'status':_0x105410===_0x5f6e3f(0x1e8)?_0x5f6e3f(0x1e8):_0x105410===_0x5f6e3f(0x178)?_0x5f6e3f(0x178):_0x5f6e3f(0x1b3),'task':_0xb9b6c9['slice'](0x0,0xc8),'output':_0xb9b6c9});return{'content':[{'type':_0x5f6e3f(0x15d),'text':JSON[_0x5f6e3f(0x1d7)](_0x22eec7)}]};}if(_0x995328===_0x5f6e3f(0x1d8)){let {status:_0x5ece8f,task:_0x3d0d96,progress:_0x32c160}=_0x377cea,_0x257130=await P(_0x5f6e3f(0x16e),{'resume_id':w,'alias':Z,'status':_0x5ece8f,'task':_0x3d0d96,'progress':_0x32c160});return{'content':[{'type':_0x5f6e3f(0x15d),'text':JSON[_0x5f6e3f(0x1d7)](_0x257130)}]};}if(_0x995328===_0x5f6e3f(0x1ab)){let {alias:_0x2afc40,task:_0x2b836a,priority:_0x194276}=_0x377cea,_0x42043f=await P(_0x5f6e3f(0x167),{'alias':_0x2afc40,'task':_0x2b836a,'priority':_0x194276||_0x5f6e3f(0x1c3),'from_session':Z});return{'content':[{'type':_0x5f6e3f(0x15d),'text':JSON[_0x5f6e3f(0x1d7)](_0x42043f)}]};}if(_0x995328==='commhub_send_message'){let {alias:_0x5f7f63,message:_0xd99885}=_0x377cea,_0x4a28e1=await P('send_message',{'alias':_0x5f7f63,'message':_0xd99885,'from_session':Z});return{'content':[{'type':_0x5f6e3f(0x15d),'text':JSON[_0x5f6e3f(0x1d7)](_0x4a28e1)}]};}if(_0x995328===_0x5f6e3f(0x1db)){let _0x34dfdf=await P(_0x5f6e3f(0x1be),{});return{'content':[{'type':_0x5f6e3f(0x15d),'text':JSON[_0x5f6e3f(0x1d7)](_0x34dfdf)}]};}return{'content':[{'type':'text','text':JSON[_0x5f6e3f(0x1d7)]({'error':_0x5f6e3f(0x1e1)})}]};});async function v(){const _0x125e76=a0_0x472bdc;let _0xe4823f=D+'/events/'+encodeURIComponent(Z),_0x7c0b37={};if(X)_0x7c0b37[_0x125e76(0x17e)]='Bearer\x20'+X;Y(_0x125e76(0x1ae)+_0xe4823f);while(!0x0){try{let _0x5803f8=await fetch(_0xe4823f,{'headers':_0x7c0b37});if(!_0x5803f8['ok']){Y(_0x125e76(0x1a8)+_0x5803f8['status']+'\x20'+_0x5803f8['statusText']),await h(0x1388);continue;}let _0x2814f2=_0x5803f8[_0x125e76(0x1e6)]['getReader'](),_0x2686c1=new TextDecoder(),_0x5f49e2='';while(!0x0){let {done:_0x559a7c,value:_0x4ea603}=await _0x2814f2[_0x125e76(0x1d0)]();if(_0x559a7c)break;_0x5f49e2+=_0x2686c1[_0x125e76(0x172)](_0x4ea603,{'stream':!0x0});let _0x21b6d8=_0x5f49e2[_0x125e76(0x19f)]('\x0a\x0a');_0x5f49e2=_0x21b6d8[_0x125e76(0x186)]()||'';for(let _0xff8d2 of _0x21b6d8){let _0x5056f3=_0xff8d2[_0x125e76(0x19f)]('\x0a')[_0x125e76(0x1c5)](_0x19df16=>_0x19df16['startsWith'](_0x125e76(0x1b4)));if(!_0x5056f3)continue;try{let _0x302760=JSON[_0x125e76(0x1c2)](_0x5056f3[_0x125e76(0x16d)](0x6));await u(_0x302760);}catch(_0x188ec7){Y('parse\x20error:\x20'+_0x188ec7);}}}Y(_0x125e76(0x171));}catch(_0x27af13){Y(_0x125e76(0x1c6)+_0x27af13);}await h(0xbb8);}}async function u(_0x92fdfa){const _0x1e79b3=a0_0x472bdc;if(_0x92fdfa[_0x1e79b3(0x177)]==='connected'){Y(_0x1e79b3(0x162)+Z+'\x22');return;}if(_0x92fdfa['type']===_0x1e79b3(0x16c)){if(Y('←\x20message\x20from\x20'+_0x92fdfa[_0x1e79b3(0x1c9)]+':\x20'+_0x92fdfa[_0x1e79b3(0x1c1)][_0x1e79b3(0x16d)](0x0,0x3c)),await K['notification']({'method':_0x1e79b3(0x1bb),'params':{'content':_0x92fdfa[_0x1e79b3(0x1c1)],'meta':{'sender':_0x92fdfa[_0x1e79b3(0x1c9)]||_0x1e79b3(0x176),'sender_id':_0x1e79b3(0x1cb),'user':_0x92fdfa['from']||_0x1e79b3(0x176),'priority':_0x1e79b3(0x1c3)}}}),_0x92fdfa[_0x1e79b3(0x1d4)])await P('ack_inbox',{'alias':Z,'message_id':_0x92fdfa['message_id']});return;}if(_0x92fdfa[_0x1e79b3(0x177)]===_0x1e79b3(0x187)||_0x92fdfa[_0x1e79b3(0x177)]===_0x1e79b3(0x195)){Y('←\x20'+_0x92fdfa[_0x1e79b3(0x177)]+':\x20inbox_count='+_0x92fdfa['inbox_count']+_0x1e79b3(0x18c)+(_0x92fdfa[_0x1e79b3(0x1a7)]||'normal'));let _0x209d3b=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0x209d3b?.['ok']&&_0x209d3b[_0x1e79b3(0x189)]?.[_0x1e79b3(0x194)]>0x0)for(let _0x55d4ae of _0x209d3b[_0x1e79b3(0x189)]){let _0x2dd7b2={'sender':_0x55d4ae['from_session']||_0x1e79b3(0x176),'sender_id':_0x1e79b3(0x1cb),'user':_0x55d4ae[_0x1e79b3(0x1a1)]||_0x1e79b3(0x176),'task_id':_0x55d4ae['id'],'priority':_0x55d4ae[_0x1e79b3(0x1a7)]||'normal'};k[_0x1e79b3(0x1cd)](_0x55d4ae['id'],_0x55d4ae[_0x1e79b3(0x1a1)]||_0x1e79b3(0x176)),await K['notification']({'method':'notifications/claude/channel','params':{'content':_0x55d4ae['content'],'meta':_0x2dd7b2}}),Y('→\x20injected\x20task\x20'+_0x55d4ae['id'][_0x1e79b3(0x16d)](0x0,0x8)+_0x1e79b3(0x1c4)+_0x55d4ae[_0x1e79b3(0x1a1)]+':\x20'+_0x55d4ae[_0x1e79b3(0x1e2)][_0x1e79b3(0x16d)](0x0,0x3c)),await P(_0x1e79b3(0x1cf),{'alias':Z,'message_id':_0x55d4ae['id']});}}}function a0_0x3900(_0x553fba,_0x401d66){_0x553fba=_0x553fba-0x15d;const _0x49c7e6=a0_0x49c7();let _0x39007e=_0x49c7e6[_0x553fba];return _0x39007e;}async function S(){const _0x1386a3=a0_0x472bdc;let _0x3d3fdc=new a0_0xc62df2();await K[_0x1386a3(0x1c7)](_0x3d3fdc),Y('MCP\x20stdio\x20connected'),Y('starting\x20SSE\x20listener...'),v()['catch'](_0xb72824=>Y('SSE\x20fatal:\x20'+_0xb72824)),P(_0x1386a3(0x16e),{'resume_id':w,'alias':Z,'status':_0x1386a3(0x1e3),'server':a0_0x4c7a4a(),'hostname':a0_0x4c7a4a(),'agent':_0x1386a3(0x1bd),'project_dir':process['cwd'](),'tmux_name':f||void 0x0})[_0x1386a3(0x1dc)](()=>Y('registered\x20as\x20\x22'+Z+_0x1386a3(0x19b)+w[_0x1386a3(0x16d)](0x0,0x8)+')'))[_0x1386a3(0x161)](_0x4940bf=>Y('warning:\x20could\x20not\x20register:\x20'+_0x4940bf)),setInterval(()=>{const _0x4e82f8=_0x1386a3;P(_0x4e82f8(0x16e),{'resume_id':w,'alias':Z,'status':_0x4e82f8(0x1e3),'server':a0_0x4c7a4a(),'hostname':a0_0x4c7a4a(),'agent':_0x4e82f8(0x1bd),'project_dir':process[_0x4e82f8(0x1e5)](),'tmux_name':f||void 0x0})[_0x4e82f8(0x161)](_0x355b26=>Y('heartbeat\x20failed:\x20'+_0x355b26));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}S()[a0_0x472bdc(0x161)](_0x1ad94d=>{const _0x3a3fc1=a0_0x472bdc;Y('fatal:\x20'+_0x1ad94d),process[_0x3a3fc1(0x19c)](0x1);});async function N(){const _0x30c3c6=a0_0x472bdc;Y(_0x30c3c6(0x1c8)),await P(_0x30c3c6(0x16e),{'resume_id':w,'alias':Z,'status':_0x30c3c6(0x178),'task':_0x30c3c6(0x17c)})[_0x30c3c6(0x161)](()=>{}),process[_0x30c3c6(0x19c)](0x0);}process[a0_0x472bdc(0x197)]['on'](a0_0x472bdc(0x192),()=>N()),process['on']('SIGTERM',()=>N()),process['on']('SIGINT',()=>N());
2
+ const a0_0x282216=a0_0x410e;(function(_0x16f917,_0xa4a54e){const _0x5c1f0c=a0_0x410e,_0x23e761=_0x16f917();while(!![]){try{const _0x58b659=parseInt(_0x5c1f0c(0x207))/0x1*(parseInt(_0x5c1f0c(0x1da))/0x2)+-parseInt(_0x5c1f0c(0x20d))/0x3+parseInt(_0x5c1f0c(0x1eb))/0x4+parseInt(_0x5c1f0c(0x22b))/0x5+-parseInt(_0x5c1f0c(0x1fa))/0x6*(-parseInt(_0x5c1f0c(0x1d3))/0x7)+-parseInt(_0x5c1f0c(0x1e0))/0x8*(parseInt(_0x5c1f0c(0x1fe))/0x9)+-parseInt(_0x5c1f0c(0x1d8))/0xa*(parseInt(_0x5c1f0c(0x21f))/0xb);if(_0x58b659===_0xa4a54e)break;else _0x23e761['push'](_0x23e761['shift']());}catch(_0x10f357){_0x23e761['push'](_0x23e761['shift']());}}}(a0_0x2be5,0x940f0));import{readFileSync as a0_0x582811,existsSync as a0_0xb59d63}from'fs';import{join as a0_0x20b942}from'path';import{hostname as a0_0x25d7c7}from'os';import{execSync as a0_0x184230}from'child_process';import{Server as a0_0x5aded8}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x1876d3}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x2b030a,CallToolRequestSchema as a0_0x197dd9}from'@modelcontextprotocol/sdk/types.js';function p(_0x16c5b2){const _0x8e1824=a0_0x410e;if(!a0_0xb59d63(_0x16c5b2))return;for(let _0x309b3c of a0_0x582811(_0x16c5b2,_0x8e1824(0x1d9))[_0x8e1824(0x1d4)]('\x0a')){let _0x11927f=_0x309b3c[_0x8e1824(0x1dc)]();if(!_0x11927f||_0x11927f[_0x8e1824(0x202)]('#'))continue;let _0x46c9a6=_0x11927f[_0x8e1824(0x224)]('=');if(_0x46c9a6<0x0)continue;let _0x27ffd5=_0x11927f[_0x8e1824(0x1f0)](0x0,_0x46c9a6)['trim'](),_0x21b1d9=_0x11927f['slice'](_0x46c9a6+0x1)[_0x8e1824(0x1dc)]()[_0x8e1824(0x200)](/^["']|["']$/g,'');if(!process.env[_0x27ffd5])process.env[_0x27ffd5]=_0x21b1d9;}}var C=process.env.HOME||'~',T=a0_0x20b942(C,a0_0x282216(0x1e9));p(a0_0x20b942(T,'.env'));var L=process[a0_0x282216(0x1cb)]()[a0_0x282216(0x200)](/\//g,'-');p(a0_0x20b942(T,L,a0_0x282216(0x1cc)));function U(){const _0x14a15e=a0_0x282216;try{return a0_0x184230(_0x14a15e(0x206),{'encoding':'utf-8','timeout':0x7d0})[_0x14a15e(0x1dc)]();}catch{return'';}}function c(){const _0x2dceed=a0_0x282216;try{let _0x4662e1=a0_0x20b942(C,_0x2dceed(0x1de),'config.json');if(a0_0xb59d63(_0x4662e1))return JSON[_0x2dceed(0x1e3)](a0_0x582811(_0x4662e1,'utf-8'));}catch{}return{};}function a0_0x410e(_0x1473da,_0x330d74){_0x1473da=_0x1473da-0x1bc;const _0x2be549=a0_0x2be5();let _0x410ef5=_0x2be549[_0x1473da];return _0x410ef5;}var H=c(),D=process.env.COMMHUB_URL||H[a0_0x282216(0x1f7)]||a0_0x282216(0x221),f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0x25d7c7(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto[a0_0x282216(0x1ee)](),X=process.env.COMMHUB_TOKEN||H['token']||'';function Y(_0x569950){const _0x50dd3b=a0_0x282216;let _0x4be713=new Date()[_0x50dd3b(0x228)]()[_0x50dd3b(0x1f0)](0x0,0x8);process[_0x50dd3b(0x212)][_0x50dd3b(0x1ec)]('['+_0x4be713+']\x20[commhub]\x20'+_0x569950+'\x0a');}function h(_0xd6100c){return new Promise(_0x28a28b=>setTimeout(_0x28a28b,_0xd6100c));}Y(a0_0x282216(0x1bf)+D+a0_0x282216(0x1d6)+Z+'\x20RESUME_ID='+w['slice'](0x0,0x8)+a0_0x282216(0x237)+(f||a0_0x282216(0x1d2))+a0_0x282216(0x1f3)+process[a0_0x282216(0x1cb)]()+a0_0x282216(0x22c)+L);var k=new Map(),K=new a0_0x5aded8({'name':a0_0x282216(0x1f5),'version':a0_0x282216(0x1e5)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':['Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.',a0_0x282216(0x230),a0_0x282216(0x234),'Session\x20alias:\x20'+Z]['join']('\x0a')});K['setRequestHandler'](a0_0x2b030a,async()=>({'tools':[{'name':a0_0x282216(0x241),'description':a0_0x282216(0x204),'inputSchema':{'type':a0_0x282216(0x233),'properties':{'task_id':{'type':'string','description':'The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)'},'text':{'type':a0_0x282216(0x1f4),'description':'Reply\x20text\x20/\x20result\x20summary'},'status':{'type':a0_0x282216(0x1f4),'enum':[a0_0x282216(0x1d1),a0_0x282216(0x227),a0_0x282216(0x232),a0_0x282216(0x203),'error','in_progress'],'description':a0_0x282216(0x1ca)}},'required':[a0_0x282216(0x210)]}},{'name':a0_0x282216(0x22f),'description':a0_0x282216(0x23c),'inputSchema':{'type':a0_0x282216(0x233),'properties':{'status':{'type':a0_0x282216(0x1f4),'enum':['working',a0_0x282216(0x22e),a0_0x282216(0x203),a0_0x282216(0x1be)]},'task':{'type':a0_0x282216(0x1f4),'description':a0_0x282216(0x21e)},'progress':{'type':a0_0x282216(0x20f),'description':'Progress\x200-100'}},'required':['status']}},{'name':'commhub_send_task','description':a0_0x282216(0x1f2),'inputSchema':{'type':'object','properties':{'alias':{'type':'string','description':'Target\x20session\x20alias'},'task':{'type':a0_0x282216(0x1f4),'description':a0_0x282216(0x1e4)},'priority':{'type':a0_0x282216(0x1f4),'enum':['high',a0_0x282216(0x239),'low'],'description':a0_0x282216(0x235)}},'required':[a0_0x282216(0x1c3),'task']}},{'name':'commhub_send_message','description':a0_0x282216(0x1bc),'inputSchema':{'type':a0_0x282216(0x233),'properties':{'alias':{'type':a0_0x282216(0x1f4),'description':'Target\x20session\x20alias'},'message':{'type':a0_0x282216(0x1f4),'description':a0_0x282216(0x1c5)}},'required':['alias',a0_0x282216(0x223)]}},{'name':a0_0x282216(0x20b),'description':'Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','inputSchema':{'type':'object','properties':{}}}]}));async function P(_0x5c5aa5,_0x3b89c5){const _0x42ba4d=a0_0x282216;let _0x3d62ab=await fetch(D+_0x42ba4d(0x229),{'method':'POST','headers':{'Content-Type':_0x42ba4d(0x1c0),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x42ba4d(0x20c)+X}:{}},'body':JSON[_0x42ba4d(0x238)]({'jsonrpc':_0x42ba4d(0x211),'id':0x1,'method':_0x42ba4d(0x21b),'params':{'protocolVersion':_0x42ba4d(0x23b),'capabilities':{},'clientInfo':{'name':_0x42ba4d(0x1f5),'version':_0x42ba4d(0x1e5)}}})});if(!_0x3d62ab['ok']){let _0x4ab89d=await _0x3d62ab[_0x42ba4d(0x210)]();return Y(_0x42ba4d(0x1c8)+_0x3d62ab['status']+'\x20'+_0x4ab89d[_0x42ba4d(0x1f0)](0x0,0x64)),{'ok':!0x1,'error':_0x42ba4d(0x23d)+_0x3d62ab[_0x42ba4d(0x226)]};}await _0x3d62ab['text']();let _0x570217=(await(await fetch(D+_0x42ba4d(0x229),{'method':_0x42ba4d(0x23f),'headers':{'Content-Type':_0x42ba4d(0x1c0),'Accept':_0x42ba4d(0x1ed),...X?{'Authorization':_0x42ba4d(0x20c)+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x42ba4d(0x211),'id':0x2,'method':_0x42ba4d(0x1e7),'params':{'name':_0x5c5aa5,'arguments':_0x3b89c5}})}))['text']())[_0x42ba4d(0x1d4)]('\x0a')[_0x42ba4d(0x1c6)](_0x33f5d2=>_0x33f5d2['startsWith']('data:\x20'));if(_0x570217){let _0xb0f74f=JSON[_0x42ba4d(0x1e3)](_0x570217[_0x42ba4d(0x1f0)](0x6));return _0xb0f74f?.[_0x42ba4d(0x21d)]?.['content']?.[0x0]?.[_0x42ba4d(0x210)]?JSON[_0x42ba4d(0x1e3)](_0xb0f74f[_0x42ba4d(0x21d)][_0x42ba4d(0x21c)][0x0]['text']):_0xb0f74f;}return{'ok':!0x1,'error':'no\x20response'};}K['setRequestHandler'](a0_0x197dd9,async _0x355c60=>{const _0x10e4ff=a0_0x282216;let {name:_0x2c2324,arguments:_0x12cbd6}=_0x355c60[_0x10e4ff(0x240)];if(_0x2c2324==='commhub_reply'){let {task_id:_0x12655e,text:_0x2f4388,status:_0x2f2881}=_0x12cbd6;if(_0x2f2881===_0x10e4ff(0x1d1)||_0x2f2881==='failed'||_0x2f2881===_0x10e4ff(0x232)){let _0x2b712d=_0x2f2881===_0x10e4ff(0x1d1)?_0x10e4ff(0x209):_0x2f2881,_0x472068=_0x12655e?k[_0x10e4ff(0x1f6)](_0x12655e)||'hub':_0x10e4ff(0x1f7),_0x4b8b57=await P(_0x10e4ff(0x236),{'alias':_0x472068,'text':_0x2f4388,'in_reply_to':_0x12655e||void 0x0,'status':_0x2b712d,'from_session':Z});if(_0x12655e)k[_0x10e4ff(0x225)](_0x12655e);return{'content':[{'type':'text','text':JSON[_0x10e4ff(0x238)](_0x4b8b57)}]};}let _0x302feb=await P(_0x10e4ff(0x1e1),{'resume_id':w,'alias':Z,'status':_0x2f2881===_0x10e4ff(0x203)?_0x10e4ff(0x203):_0x2f2881==='error'?_0x10e4ff(0x1be):_0x10e4ff(0x1ea),'task':_0x2f4388[_0x10e4ff(0x1f0)](0x0,0xc8),'output':_0x2f4388});return{'content':[{'type':_0x10e4ff(0x210),'text':JSON[_0x10e4ff(0x238)](_0x302feb)}]};}if(_0x2c2324===_0x10e4ff(0x22f)){let {status:_0x255c26,task:_0xd9fea,progress:_0x5e7e7c}=_0x12cbd6,_0x8493c4=await P(_0x10e4ff(0x1e1),{'resume_id':w,'alias':Z,'status':_0x255c26,'task':_0xd9fea,'progress':_0x5e7e7c});return{'content':[{'type':_0x10e4ff(0x210),'text':JSON[_0x10e4ff(0x238)](_0x8493c4)}]};}if(_0x2c2324==='commhub_send_task'){let {alias:_0x41d6c8,task:_0x5d379e,priority:_0x239bd2}=_0x12cbd6,_0x5f4e67=await P(_0x10e4ff(0x20a),{'alias':_0x41d6c8,'task':_0x5d379e,'priority':_0x239bd2||_0x10e4ff(0x239),'from_session':Z});return{'content':[{'type':_0x10e4ff(0x210),'text':JSON[_0x10e4ff(0x238)](_0x5f4e67)}]};}if(_0x2c2324===_0x10e4ff(0x1bd)){let {alias:_0x53a574,message:_0x4e5e63}=_0x12cbd6,_0x2b93c3=await P(_0x10e4ff(0x1e6),{'alias':_0x53a574,'message':_0x4e5e63,'from_session':Z});return{'content':[{'type':_0x10e4ff(0x210),'text':JSON[_0x10e4ff(0x238)](_0x2b93c3)}]};}if(_0x2c2324===_0x10e4ff(0x20b)){let _0x51e8ac=await P(_0x10e4ff(0x1d5),{});return{'content':[{'type':_0x10e4ff(0x210),'text':JSON[_0x10e4ff(0x238)](_0x51e8ac)}]};}return{'content':[{'type':'text','text':JSON[_0x10e4ff(0x238)]({'error':_0x10e4ff(0x220)})}]};});async function v(){const _0x90be2a=a0_0x282216;let _0x4caa80=D+_0x90be2a(0x1d7)+encodeURIComponent(Z),_0x3dc394={};if(X)_0x3dc394['Authorization']=_0x90be2a(0x20c)+X;Y(_0x90be2a(0x1e2)+_0x4caa80);while(!0x0){try{let _0x47973a=await fetch(_0x4caa80,{'headers':_0x3dc394});if(!_0x47973a['ok']){Y(_0x90be2a(0x1db)+_0x47973a['status']+'\x20'+_0x47973a[_0x90be2a(0x1f1)]),await h(0x1388);continue;}let _0x2acc56=_0x47973a['body'][_0x90be2a(0x22a)](),_0x2225b9=new TextDecoder(),_0xef94fb='';while(!0x0){let {done:_0x230956,value:_0x193290}=await _0x2acc56[_0x90be2a(0x1c7)]();if(_0x230956)break;_0xef94fb+=_0x2225b9['decode'](_0x193290,{'stream':!0x0});let _0x112747=_0xef94fb[_0x90be2a(0x1d4)]('\x0a\x0a');_0xef94fb=_0x112747['pop']()||'';for(let _0x44e8a6 of _0x112747){let _0xb150b=_0x44e8a6[_0x90be2a(0x1d4)]('\x0a')['find'](_0x40949d=>_0x40949d[_0x90be2a(0x202)](_0x90be2a(0x214)));if(!_0xb150b)continue;try{let _0x164103=JSON[_0x90be2a(0x1e3)](_0xb150b[_0x90be2a(0x1f0)](0x6));await u(_0x164103);}catch(_0x1fe34a){Y(_0x90be2a(0x1c1)+_0x1fe34a);}}}Y('SSE\x20stream\x20ended,\x20reconnecting...');}catch(_0x1bfaf7){Y('SSE\x20connection\x20error:\x20'+_0x1bfaf7);}await h(0xbb8);}}async function u(_0x2e5956){const _0x22ce3a=a0_0x282216;if(_0x2e5956[_0x22ce3a(0x1c9)]===_0x22ce3a(0x1c4)){Y(_0x22ce3a(0x205)+Z+'\x22');return;}if(_0x2e5956[_0x22ce3a(0x1c9)]===_0x22ce3a(0x1d0)){if(Y('←\x20message\x20from\x20'+_0x2e5956[_0x22ce3a(0x22d)]+':\x20'+_0x2e5956['message'][_0x22ce3a(0x1f0)](0x0,0x3c)),await K['notification']({'method':'notifications/claude/channel','params':{'content':_0x2e5956[_0x22ce3a(0x223)],'meta':{'sender':_0x2e5956['from']||_0x22ce3a(0x1f7),'sender_id':_0x22ce3a(0x1fb),'user':_0x2e5956[_0x22ce3a(0x22d)]||_0x22ce3a(0x1f7),'priority':_0x22ce3a(0x239)}}}),_0x2e5956['message_id'])await P(_0x22ce3a(0x231),{'alias':Z,'message_id':_0x2e5956['message_id']});return;}if(_0x2e5956[_0x22ce3a(0x1c9)]===_0x22ce3a(0x242)||_0x2e5956[_0x22ce3a(0x1c9)]===_0x22ce3a(0x1ce)){Y('←\x20'+_0x2e5956[_0x22ce3a(0x1c9)]+_0x22ce3a(0x1df)+_0x2e5956[_0x22ce3a(0x21a)]+_0x22ce3a(0x1ff)+(_0x2e5956['priority']||_0x22ce3a(0x239)));let _0x134203=await P(_0x22ce3a(0x219),{'alias':Z,'limit':0x5});if(_0x134203?.['ok']&&_0x134203[_0x22ce3a(0x1cf)]?.['length']>0x0)for(let _0xda3a1a of _0x134203[_0x22ce3a(0x1cf)]){let _0x1f1b0b={'sender':_0xda3a1a['from_session']||'hub','sender_id':'commhub','user':_0xda3a1a['from_session']||_0x22ce3a(0x1f7),'task_id':_0xda3a1a['id'],'priority':_0xda3a1a['priority']||'normal'};k[_0x22ce3a(0x218)](_0xda3a1a['id'],_0xda3a1a['from_session']||_0x22ce3a(0x1f7)),await K[_0x22ce3a(0x215)]({'method':_0x22ce3a(0x1fd),'params':{'content':_0xda3a1a['content'],'meta':_0x1f1b0b}}),Y('→\x20injected\x20task\x20'+_0xda3a1a['id'][_0x22ce3a(0x1f0)](0x0,0x8)+_0x22ce3a(0x201)+_0xda3a1a['from_session']+':\x20'+_0xda3a1a[_0x22ce3a(0x21c)][_0x22ce3a(0x1f0)](0x0,0x3c)),await P(_0x22ce3a(0x231),{'alias':Z,'message_id':_0xda3a1a['id']});}}}async function S(){const _0x2f4cc0=a0_0x282216;let _0x3455b8=new a0_0x1876d3();await K['connect'](_0x3455b8),Y(_0x2f4cc0(0x1ef)),Y(_0x2f4cc0(0x23a)),v()[_0x2f4cc0(0x1f8)](_0x4a9d28=>Y('SSE\x20fatal:\x20'+_0x4a9d28)),P(_0x2f4cc0(0x1e1),{'resume_id':w,'alias':Z,'status':_0x2f4cc0(0x22e),'server':a0_0x25d7c7(),'hostname':a0_0x25d7c7(),'agent':_0x2f4cc0(0x217),'project_dir':process[_0x2f4cc0(0x1cb)](),'tmux_name':f||void 0x0})['then'](()=>Y(_0x2f4cc0(0x1dd)+Z+_0x2f4cc0(0x20e)+w['slice'](0x0,0x8)+')'))['catch'](_0xae3bcc=>Y('warning:\x20could\x20not\x20register:\x20'+_0xae3bcc)),setInterval(()=>{const _0x119793=_0x2f4cc0;P(_0x119793(0x1e1),{'resume_id':w,'alias':Z,'status':_0x119793(0x22e),'server':a0_0x25d7c7(),'hostname':a0_0x25d7c7(),'agent':_0x119793(0x217),'project_dir':process[_0x119793(0x1cb)](),'tmux_name':f||void 0x0})[_0x119793(0x1f8)](_0x528d3c=>Y(_0x119793(0x1f9)+_0x528d3c));},0x2bf20),Y(_0x2f4cc0(0x23e));}S()[a0_0x282216(0x1f8)](_0x4c4e36=>{const _0x52d89b=a0_0x282216;Y(_0x52d89b(0x208)+_0x4c4e36),process['exit'](0x1);});async function N(){const _0x19e7a5=a0_0x282216;Y(_0x19e7a5(0x213)),await P(_0x19e7a5(0x1e1),{'resume_id':w,'alias':Z,'status':_0x19e7a5(0x1be),'task':_0x19e7a5(0x222)})[_0x19e7a5(0x1f8)](()=>{}),process[_0x19e7a5(0x1cd)](0x0);}process[a0_0x282216(0x1c2)]['on'](a0_0x282216(0x216),()=>N()),process['on'](a0_0x282216(0x1e8),()=>N()),process['on'](a0_0x282216(0x1fc),()=>N());function a0_0x2be5(){const _0x4cb177=['catch','heartbeat\x20failed:\x20','2049276CfhLez','commhub','SIGINT','notifications/claude/channel','99RKhYxd','\x20priority=','replace','\x20from\x20','startsWith','blocked','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','SSE\x20connected\x20as\x20\x22','tmux\x20display-message\x20-p\x20\x27#S\x27','591RfDhRc','fatal:\x20','replied','send_task','commhub_get_all_status','Bearer\x20','2700384jqyqxz','\x22\x20(','number','text','2.0','stderr','shutting\x20down,\x20reporting\x20offline...','data:\x20','notification','end','claude-code','set','get_inbox','inbox_count','initialize','content','result','Current\x20task\x20description','53273pWmhGM','unknown\x20tool','http://127.0.0.1:9200','session\x20disconnected','message','indexOf','delete','status','failed','toTimeString','/mcp','getReader','5448960MsUfcu','\x20PROJECT_ENV=','from','idle','commhub_report_status','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','ack_inbox','cancelled','object','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','Priority\x20(default:\x20normal)','send_reply','...\x20TMUX=','stringify','normal','starting\x20SSE\x20listener...','2025-03-26','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','init\x20failed:\x20','ready\x20—\x20waiting\x20for\x20events','POST','params','commhub_reply','new_task','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','commhub_send_message','error','ENV:\x20URL=','application/json','parse\x20error:\x20','stdin','alias','connected','Message\x20content','find','read','CommHub\x20init\x20failed:\x20','type','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','cwd','.env','exit','broadcast','messages','new_message','completed','none','7mtIDeJ','split','get_all_status','\x20ALIAS=','/events/','1460zIqrHT','utf-8','64oqylMQ','SSE\x20error:\x20','trim','registered\x20as\x20\x22','.anet',':\x20inbox_count=','201512RvZHlg','report_status','connecting\x20to\x20','parse','Task\x20content','0.3.0','send_message','tools/call','SIGTERM','.claude/channels/commhub','working','4161932IHgSFP','write','application/json,\x20text/event-stream','randomUUID','MCP\x20stdio\x20connected','slice','statusText','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','\x20CWD=','string','commhub-channel','get','hub'];a0_0x2be5=function(){return _0x4cb177;};return a0_0x2be5();}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.0.0-preview.12",
3
+ "version": "2.0.0-preview.13",
4
4
  "description": "AI Agent Network — Server + Client + Setup in one package. SSE real-time communication for multi-agent orchestration.",
5
5
  "type": "module",
6
6
  "main": "dist/src/client.js",