@sleep2agi/agent-network 2.1.4-preview.9 → 2.1.5-preview.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- function a0_0x2f20(){const _0x53988c=['sseAbort','split','text','heartbeatInterval','read','message','cwd','24hznPXZ','min','3509289Fqrwlp','inbox\x20error:\x20','stringify','get_inbox','heartbeat\x20failed:\x20','AbortError','report_status','catch','status','application/json','2.0','parse','slice','POST','body','connectSSE','task','log','13094874bjSXxS','send_message','connect','heartbeatTimer','SSE\x20failed:\x20','pop','emit','send_reply','toTimeString','get_all_status','toString','83152MRNUjQ','broadcast','match','135MDnrEe','running','new_message','2746347PRrpbv','content','signal','from_session','11116600yIVNDv','Authorization','s...','Bearer\x20','data:\x20','SSE\x20error:\x20','idle','text/event-stream','autoConnect','type','ack_inbox','decode','2epJSqT','reply','getReader','SSE\x20reconnecting\x20in\x20','sleep','new_task','offline','application/json,\x20text/event-stream','replace','getAllStatus','disconnected','processInbox','registered','completed','agent','call','6042612JHBvPS','abort','alias','url','now','sdk','775639Quaqte','reconnectDelay','result','/events/','token','resumeId','error'];a0_0x2f20=function(){return _0x53988c;};return a0_0x2f20();}function a0_0x1782(_0x14144e,_0x512fef){_0x14144e=_0x14144e-0x173;const _0x2f2012=a0_0x2f20();let _0x178286=_0x2f2012[_0x14144e];return _0x178286;}const a0_0x480d82=a0_0x1782;(function(_0x40476d,_0x21f9ef){const _0x560619=a0_0x1782,_0x448b4c=_0x40476d();while(!![]){try{const _0x3f459f=-parseInt(_0x560619(0x1c1))/0x1*(parseInt(_0x560619(0x1ab))/0x2)+parseInt(_0x560619(0x19b))/0x3+-parseInt(_0x560619(0x195))/0x4*(-parseInt(_0x560619(0x198))/0x5)+-parseInt(_0x560619(0x1bb))/0x6+-parseInt(_0x560619(0x178))/0x7*(parseInt(_0x560619(0x176))/0x8)+parseInt(_0x560619(0x18a))/0x9+parseInt(_0x560619(0x19f))/0xa;if(_0x3f459f===_0x21f9ef)break;else _0x448b4c['push'](_0x448b4c['shift']());}catch(_0x4d937b){_0x448b4c['push'](_0x448b4c['shift']());}}}(a0_0x2f20,0xb8ba9));import{EventEmitter as a0_0x32682b}from'events';import{hostname as a0_0x40dbf6}from'os';class T extends a0_0x32682b{[a0_0x480d82(0x1be)];[a0_0x480d82(0x1bd)];['token'];[a0_0x480d82(0x1b9)];[a0_0x480d82(0x1c6)];[a0_0x480d82(0x1cb)];[a0_0x480d82(0x1c2)];[a0_0x480d82(0x18d)];[a0_0x480d82(0x1c8)];[a0_0x480d82(0x199)]=!0x1;constructor(_0x1b88ad){const _0x17ca5d=a0_0x480d82;super();if(this[_0x17ca5d(0x1be)]=_0x1b88ad[_0x17ca5d(0x1be)][_0x17ca5d(0x1b3)](/\/$/,''),this[_0x17ca5d(0x1bd)]=_0x1b88ad['alias'],this[_0x17ca5d(0x1c5)]=_0x1b88ad[_0x17ca5d(0x1c5)],this['agent']=_0x1b88ad[_0x17ca5d(0x1b9)]||_0x17ca5d(0x1c0),this[_0x17ca5d(0x1c6)]='sdk-'+_0x1b88ad['alias']+'-'+Date[_0x17ca5d(0x1bf)]()[_0x17ca5d(0x194)](0x24),this[_0x17ca5d(0x1cb)]=_0x1b88ad[_0x17ca5d(0x1cb)]??0x2bf20,this['reconnectDelay']=_0x1b88ad[_0x17ca5d(0x1c2)]??0xbb8,_0x1b88ad[_0x17ca5d(0x1a7)]!==!0x1)this[_0x17ca5d(0x18c)]();}[a0_0x480d82(0x189)](_0x1803e1){const _0x5079c9=a0_0x480d82;console['log']('['+new Date()[_0x5079c9(0x192)]()[_0x5079c9(0x184)](0x0,0x8)+']\x20[commhub:'+this[_0x5079c9(0x1bd)]+']\x20'+_0x1803e1);}async[a0_0x480d82(0x1ba)](_0x4f458b,_0x57da91){const _0x52ea40=a0_0x480d82;let _0x2af967={'Content-Type':_0x52ea40(0x181),'Accept':_0x52ea40(0x1b2)};if(this[_0x52ea40(0x1c5)])_0x2af967[_0x52ea40(0x1a0)]=_0x52ea40(0x1a2)+this[_0x52ea40(0x1c5)];let _0x152694=await(await fetch(this[_0x52ea40(0x1be)]+'/mcp',{'method':_0x52ea40(0x185),'headers':_0x2af967,'body':JSON[_0x52ea40(0x17a)]({'jsonrpc':_0x52ea40(0x182),'id':Date[_0x52ea40(0x1bf)](),'method':'tools/call','params':{'name':_0x4f458b,'arguments':_0x57da91}})}))['text'](),_0x5e7e64=_0x152694[_0x52ea40(0x197)](/data: (.+)/),_0x5cacb5=_0x5e7e64?JSON[_0x52ea40(0x183)](_0x5e7e64[0x1]):JSON[_0x52ea40(0x183)](_0x152694),_0x1d6c39=_0x5cacb5?.[_0x52ea40(0x1c3)]?.[_0x52ea40(0x19c)]?.[0x0]?.[_0x52ea40(0x1ca)];return _0x1d6c39?JSON[_0x52ea40(0x183)](_0x1d6c39):_0x5cacb5;}async['connect'](){const _0x3f6dc0=a0_0x480d82;if(this['running'])return;this[_0x3f6dc0(0x199)]=!0x0,await this[_0x3f6dc0(0x180)](_0x3f6dc0(0x1a5)),this[_0x3f6dc0(0x189)](_0x3f6dc0(0x1b7)),this[_0x3f6dc0(0x18d)]=setInterval(()=>{const _0x1d8390=_0x3f6dc0;this[_0x1d8390(0x180)](_0x1d8390(0x1a5))[_0x1d8390(0x17f)](_0x445daa=>this[_0x1d8390(0x189)](_0x1d8390(0x17c)+_0x445daa[_0x1d8390(0x174)]));},this['heartbeatInterval']),this[_0x3f6dc0(0x187)]();}async['disconnect'](){const _0x80416f=a0_0x480d82;if(this[_0x80416f(0x199)]=!0x1,this[_0x80416f(0x1c8)]?.[_0x80416f(0x1bc)](),this[_0x80416f(0x18d)])clearInterval(this[_0x80416f(0x18d)]);await this[_0x80416f(0x180)](_0x80416f(0x1b1))['catch'](()=>{}),this[_0x80416f(0x189)](_0x80416f(0x1b5));}async['send'](_0x23de77,_0x58fe10,_0x23f007='normal'){return this['call']('send_task',{'alias':_0x23de77,'task':_0x58fe10,'priority':_0x23f007,'from_session':this['alias']});}async[a0_0x480d82(0x174)](_0x54a500,_0x22e33d){const _0x4795ab=a0_0x480d82;return this[_0x4795ab(0x1ba)](_0x4795ab(0x18b),{'alias':_0x54a500,'message':_0x22e33d,'from_session':this['alias']});}async[a0_0x480d82(0x1ac)](_0x59c02d,_0x421fd7,_0x265f2a=a0_0x480d82(0x1b8)){const _0x337f16=a0_0x480d82;return this['call'](_0x337f16(0x191),{'in_reply_to':_0x59c02d,'text':_0x421fd7,'status':_0x265f2a});}async[a0_0x480d82(0x180)](_0x3574c6,_0x1dcb4e){const _0x471a81=a0_0x480d82;return this[_0x471a81(0x1ba)](_0x471a81(0x17e),{'resume_id':this[_0x471a81(0x1c6)],'alias':this[_0x471a81(0x1bd)],'status':_0x3574c6,'server':a0_0x40dbf6(),'hostname':a0_0x40dbf6(),'agent':this[_0x471a81(0x1b9)],'project_dir':process[_0x471a81(0x175)](),..._0x1dcb4e});}async[a0_0x480d82(0x1b4)](){const _0x3cb98c=a0_0x480d82;return this['call'](_0x3cb98c(0x193),{});}async[a0_0x480d82(0x196)](_0x5e0349,_0x5e999f){const _0x464a41=a0_0x480d82;return this[_0x464a41(0x1ba)](_0x464a41(0x196),{'message':_0x5e0349,'filter_server':_0x5e999f?.['server'],'filter_status':_0x5e999f?.[_0x464a41(0x180)]});}async[a0_0x480d82(0x187)](){const _0x504832=a0_0x480d82;let _0x5a00ed=encodeURIComponent(this[_0x504832(0x1bd)]),_0x5906a7=this[_0x504832(0x1be)]+_0x504832(0x1c4)+_0x5a00ed,_0x46f572=this['reconnectDelay'];while(this[_0x504832(0x199)]){try{this['sseAbort']=new AbortController();let _0x51dee4={'Accept':_0x504832(0x1a6)};if(this[_0x504832(0x1c5)])_0x51dee4[_0x504832(0x1a0)]='Bearer\x20'+this[_0x504832(0x1c5)];let _0x2db125=await fetch(_0x5906a7,{'headers':_0x51dee4,'signal':this['sseAbort'][_0x504832(0x19d)]});if(!_0x2db125['ok']||!_0x2db125[_0x504832(0x186)]){this[_0x504832(0x189)](_0x504832(0x18e)+_0x2db125[_0x504832(0x180)]),await this[_0x504832(0x1af)](_0x46f572),_0x46f572=Math['min'](_0x46f572*1.5,0xea60);continue;}_0x46f572=this[_0x504832(0x1c2)];let _0x3e6081=_0x2db125[_0x504832(0x186)][_0x504832(0x1ad)](),_0x4793d4=new TextDecoder(),_0x27b4a8='';while(this['running']){let {done:_0x22c5bc,value:_0x53cab0}=await _0x3e6081[_0x504832(0x173)]();if(_0x22c5bc)break;_0x27b4a8+=_0x4793d4[_0x504832(0x1aa)](_0x53cab0,{'stream':!0x0});let _0x26c8e5=_0x27b4a8[_0x504832(0x1c9)]('\x0a');_0x27b4a8=_0x26c8e5[_0x504832(0x18f)]()||'';for(let _0x24e160 of _0x26c8e5){if(!_0x24e160['startsWith'](_0x504832(0x1a3)))continue;try{let _0x4cb17e=JSON[_0x504832(0x183)](_0x24e160[_0x504832(0x184)](0x6));if(_0x4cb17e[_0x504832(0x1a8)]==='connected'){this[_0x504832(0x189)]('SSE\x20connected'),this['emit']('connected');continue;}if(_0x4cb17e[_0x504832(0x1a8)]===_0x504832(0x1b0)||_0x4cb17e[_0x504832(0x1a8)]===_0x504832(0x19a)||_0x4cb17e['type']===_0x504832(0x196))await this['processInbox']();}catch{}}}}catch(_0x138e21){if(_0x138e21['name']===_0x504832(0x17d))break;this[_0x504832(0x190)](_0x504832(0x1c7),_0x138e21),this['log'](_0x504832(0x1a4)+_0x138e21[_0x504832(0x174)]);}if(this[_0x504832(0x199)])this[_0x504832(0x190)](_0x504832(0x1b5)),this[_0x504832(0x189)](_0x504832(0x1ae)+_0x46f572/0x3e8+_0x504832(0x1a1)),await this[_0x504832(0x1af)](_0x46f572),_0x46f572=Math[_0x504832(0x177)](_0x46f572*1.5,0xea60);}}async[a0_0x480d82(0x1b6)](){const _0x3506aa=a0_0x480d82;try{let _0xa586a6=(await this[_0x3506aa(0x1ba)](_0x3506aa(0x17b),{'alias':this['alias'],'limit':0xa}))?.['messages']||[];for(let _0xac745b of _0xa586a6)await this['call'](_0x3506aa(0x1a9),{'alias':this[_0x3506aa(0x1bd)],'message_id':_0xac745b['id']}),this['log']('←\x20'+_0xac745b[_0x3506aa(0x19e)]+':\x20'+_0xac745b[_0x3506aa(0x19c)][_0x3506aa(0x184)](0x0,0x3c)),this[_0x3506aa(0x190)](_0x3506aa(0x188),_0xac745b),this[_0x3506aa(0x190)](_0x3506aa(0x174),_0xac745b);}catch(_0x1ebb9c){this['log'](_0x3506aa(0x179)+_0x1ebb9c[_0x3506aa(0x174)]);}}['sleep'](_0x1b9b2d){return new Promise(_0x5e633f=>setTimeout(_0x5e633f,_0x1b9b2d));}}var $=T;export{$ as default,T as CommHub};
1
+ const a0_0x4bc658=a0_0xd5cd;(function(_0x29ac4f,_0xfbedd9){const _0x383f28=a0_0xd5cd,_0x272908=_0x29ac4f();while(!![]){try{const _0x4c3723=-parseInt(_0x383f28(0xb1))/0x1+-parseInt(_0x383f28(0xb5))/0x2*(parseInt(_0x383f28(0x6b))/0x3)+-parseInt(_0x383f28(0x80))/0x4*(-parseInt(_0x383f28(0xa1))/0x5)+parseInt(_0x383f28(0x89))/0x6*(parseInt(_0x383f28(0x90))/0x7)+parseInt(_0x383f28(0x78))/0x8*(-parseInt(_0x383f28(0x6e))/0x9)+parseInt(_0x383f28(0x6d))/0xa+parseInt(_0x383f28(0xbd))/0xb*(-parseInt(_0x383f28(0x79))/0xc);if(_0x4c3723===_0xfbedd9)break;else _0x272908['push'](_0x272908['shift']());}catch(_0x368b26){_0x272908['push'](_0x272908['shift']());}}}(a0_0x2911,0xecc2a));function a0_0x2911(){const _0x21059a=['tools/call','heartbeatTimer','url','server','402521RYjniU','signal','body','messages','error','Bearer\x20','data:\x20','broadcast','match','startsWith','call','log','processInbox','SSE\x20failed:\x20','send_message','registered','alias','6640KtWGMM','token','send_task','message','resumeId','pop','AbortError','reply','connect','from_session','type','decode','text/event-stream','disconnected','catch','content','1136211vYobWP','sdk-','read','task','42TrUnVf','status','idle','parse','report_status','toString','emit','abort','4614731RXUKPt','sdk','split','autoConnect','heartbeatInterval','28797WSYDYS','POST','4570200RzrNyJ','17874aFeXUh','getAllStatus','send','inbox\x20error:\x20','heartbeat\x20failed:\x20','getReader','sleep','name','completed','get_inbox','3664ssfIqu','12UnfrJg',']\x20[commhub:','result','text','toTimeString','running','sseAbort','4208AIMaOr','/events/','connectSSE','agent','reconnectDelay','connected','2.0','stringify','slice','186nYVSeI','send_reply','new_task'];a0_0x2911=function(){return _0x21059a;};return a0_0x2911();}import{EventEmitter as a0_0x1b6484}from'events';function a0_0xd5cd(_0x3171c9,_0x401c3c){_0x3171c9=_0x3171c9-0x6a;const _0x291102=a0_0x2911();let _0xd5cd00=_0x291102[_0x3171c9];return _0xd5cd00;}import{hostname as a0_0x1296ad}from'os';class T extends a0_0x1b6484{['url'];['alias'];['token'];['agent'];[a0_0x4bc658(0xa5)];[a0_0x4bc658(0x6a)];[a0_0x4bc658(0x84)];['heartbeatTimer'];[a0_0x4bc658(0x7f)];[a0_0x4bc658(0x7e)]=!0x1;constructor(_0x184a2a){const _0x2087f7=a0_0x4bc658;super();if(this[_0x2087f7(0x8e)]=_0x184a2a[_0x2087f7(0x8e)]['replace'](/\/$/,''),this[_0x2087f7(0xa0)]=_0x184a2a[_0x2087f7(0xa0)],this[_0x2087f7(0xa2)]=_0x184a2a[_0x2087f7(0xa2)],this[_0x2087f7(0x83)]=_0x184a2a['agent']||_0x2087f7(0xbe),this[_0x2087f7(0xa5)]=_0x2087f7(0xb2)+_0x184a2a[_0x2087f7(0xa0)]+'-'+Date['now']()[_0x2087f7(0xba)](0x24),this[_0x2087f7(0x6a)]=_0x184a2a[_0x2087f7(0x6a)]??0x2bf20,this['reconnectDelay']=_0x184a2a[_0x2087f7(0x84)]??0xbb8,_0x184a2a[_0x2087f7(0xc0)]!==!0x1)this[_0x2087f7(0xa9)]();}['log'](_0x234872){const _0x5c4357=a0_0x4bc658;console[_0x5c4357(0x9b)]('['+new Date()[_0x5c4357(0x7d)]()[_0x5c4357(0x88)](0x0,0x8)+_0x5c4357(0x7a)+this[_0x5c4357(0xa0)]+']\x20'+_0x234872);}async['call'](_0x1a588d,_0x5d3067){const _0x5ed78f=a0_0x4bc658;let _0x2d7756={'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream'};if(this[_0x5ed78f(0xa2)])_0x2d7756['Authorization']='Bearer\x20'+this['token'];let _0x4c82f0=await(await fetch(this[_0x5ed78f(0x8e)]+'/mcp',{'method':_0x5ed78f(0x6c),'headers':_0x2d7756,'body':JSON[_0x5ed78f(0x87)]({'jsonrpc':_0x5ed78f(0x86),'id':Date['now'](),'method':_0x5ed78f(0x8c),'params':{'name':_0x1a588d,'arguments':_0x5d3067}})}))[_0x5ed78f(0x7c)](),_0x28a743=_0x4c82f0[_0x5ed78f(0x98)](/data: (.+)/),_0x424301=_0x28a743?JSON[_0x5ed78f(0xb8)](_0x28a743[0x1]):JSON['parse'](_0x4c82f0),_0x551f8e=_0x424301?.[_0x5ed78f(0x7b)]?.[_0x5ed78f(0xb0)]?.[0x0]?.[_0x5ed78f(0x7c)];return _0x551f8e?JSON[_0x5ed78f(0xb8)](_0x551f8e):_0x424301;}async[a0_0x4bc658(0xa9)](){const _0x44160e=a0_0x4bc658;if(this[_0x44160e(0x7e)])return;this['running']=!0x0,await this[_0x44160e(0xb6)]('idle'),this[_0x44160e(0x9b)](_0x44160e(0x9f)),this[_0x44160e(0x8d)]=setInterval(()=>{const _0x4a8c36=_0x44160e;this[_0x4a8c36(0xb6)](_0x4a8c36(0xb7))[_0x4a8c36(0xaf)](_0x384b4b=>this[_0x4a8c36(0x9b)](_0x4a8c36(0x72)+_0x384b4b['message']));},this[_0x44160e(0x6a)]),this[_0x44160e(0x82)]();}async['disconnect'](){const _0x27ecfb=a0_0x4bc658;if(this[_0x27ecfb(0x7e)]=!0x1,this[_0x27ecfb(0x7f)]?.[_0x27ecfb(0xbc)](),this[_0x27ecfb(0x8d)])clearInterval(this[_0x27ecfb(0x8d)]);await this['status']('offline')[_0x27ecfb(0xaf)](()=>{}),this['log'](_0x27ecfb(0xae));}async[a0_0x4bc658(0x70)](_0x578730,_0x23cd51,_0x2511c3='normal'){const _0x34ef88=a0_0x4bc658;return this[_0x34ef88(0x9a)](_0x34ef88(0xa3),{'alias':_0x578730,'task':_0x23cd51,'priority':_0x2511c3,'from_session':this[_0x34ef88(0xa0)]});}async[a0_0x4bc658(0xa4)](_0x28752f,_0x18d7fa){const _0x12de29=a0_0x4bc658;return this['call'](_0x12de29(0x9e),{'alias':_0x28752f,'message':_0x18d7fa,'from_session':this[_0x12de29(0xa0)]});}async[a0_0x4bc658(0xa8)](_0x24f4ff,_0x512a20,_0x441dd6=a0_0x4bc658(0x76)){const _0x15267f=a0_0x4bc658;return this[_0x15267f(0x9a)](_0x15267f(0x8a),{'in_reply_to':_0x24f4ff,'text':_0x512a20,'status':_0x441dd6});}async[a0_0x4bc658(0xb6)](_0x982a20,_0x1fc699){const _0x5adacb=a0_0x4bc658;return this['call'](_0x5adacb(0xb9),{'resume_id':this['resumeId'],'alias':this[_0x5adacb(0xa0)],'status':_0x982a20,'server':a0_0x1296ad(),'hostname':a0_0x1296ad(),'agent':this[_0x5adacb(0x83)],'project_dir':process['cwd'](),..._0x1fc699});}async[a0_0x4bc658(0x6f)](){return this['call']('get_all_status',{});}async[a0_0x4bc658(0x97)](_0x48c92a,_0x29a68c){const _0x1d952c=a0_0x4bc658;return this[_0x1d952c(0x9a)](_0x1d952c(0x97),{'message':_0x48c92a,'filter_server':_0x29a68c?.[_0x1d952c(0x8f)],'filter_status':_0x29a68c?.[_0x1d952c(0xb6)]});}async['connectSSE'](){const _0x26a780=a0_0x4bc658;let _0x1382e1=encodeURIComponent(this[_0x26a780(0xa0)]),_0x513181=this[_0x26a780(0x8e)]+_0x26a780(0x81)+_0x1382e1,_0x4b7e74=this['reconnectDelay'];while(this[_0x26a780(0x7e)]){try{this[_0x26a780(0x7f)]=new AbortController();let _0x1c6033={'Accept':_0x26a780(0xad)};if(this[_0x26a780(0xa2)])_0x1c6033['Authorization']=_0x26a780(0x95)+this[_0x26a780(0xa2)];let _0x1f1765=await fetch(_0x513181,{'headers':_0x1c6033,'signal':this[_0x26a780(0x7f)][_0x26a780(0x91)]});if(!_0x1f1765['ok']||!_0x1f1765[_0x26a780(0x92)]){this[_0x26a780(0x9b)](_0x26a780(0x9d)+_0x1f1765['status']),await this['sleep'](_0x4b7e74),_0x4b7e74=Math['min'](_0x4b7e74*1.5,0xea60);continue;}_0x4b7e74=this['reconnectDelay'];let _0x238bbe=_0x1f1765['body'][_0x26a780(0x73)](),_0x2f1358=new TextDecoder(),_0x596b00='';while(this[_0x26a780(0x7e)]){let {done:_0xf37810,value:_0x511d92}=await _0x238bbe[_0x26a780(0xb3)]();if(_0xf37810)break;_0x596b00+=_0x2f1358[_0x26a780(0xac)](_0x511d92,{'stream':!0x0});let _0x3fe0a3=_0x596b00[_0x26a780(0xbf)]('\x0a');_0x596b00=_0x3fe0a3[_0x26a780(0xa6)]()||'';for(let _0x35236f of _0x3fe0a3){if(!_0x35236f[_0x26a780(0x99)](_0x26a780(0x96)))continue;try{let _0x4f6740=JSON['parse'](_0x35236f[_0x26a780(0x88)](0x6));if(_0x4f6740[_0x26a780(0xab)]===_0x26a780(0x85)){this[_0x26a780(0x9b)]('SSE\x20connected'),this[_0x26a780(0xbb)](_0x26a780(0x85));continue;}if(_0x4f6740[_0x26a780(0xab)]===_0x26a780(0x8b)||_0x4f6740[_0x26a780(0xab)]==='new_message'||_0x4f6740['type']===_0x26a780(0x97))await this[_0x26a780(0x9c)]();}catch{}}}}catch(_0x30dddd){if(_0x30dddd[_0x26a780(0x75)]===_0x26a780(0xa7))break;this[_0x26a780(0xbb)](_0x26a780(0x94),_0x30dddd),this[_0x26a780(0x9b)]('SSE\x20error:\x20'+_0x30dddd[_0x26a780(0xa4)]);}if(this[_0x26a780(0x7e)])this['emit'](_0x26a780(0xae)),this[_0x26a780(0x9b)]('SSE\x20reconnecting\x20in\x20'+_0x4b7e74/0x3e8+'s...'),await this[_0x26a780(0x74)](_0x4b7e74),_0x4b7e74=Math['min'](_0x4b7e74*1.5,0xea60);}}async[a0_0x4bc658(0x9c)](){const _0x1dbb23=a0_0x4bc658;try{let _0x16ff02=(await this[_0x1dbb23(0x9a)](_0x1dbb23(0x77),{'alias':this[_0x1dbb23(0xa0)],'limit':0xa}))?.[_0x1dbb23(0x93)]||[];for(let _0x58f1f1 of _0x16ff02)await this['call']('ack_inbox',{'alias':this[_0x1dbb23(0xa0)],'message_id':_0x58f1f1['id']}),this['log']('←\x20'+_0x58f1f1[_0x1dbb23(0xaa)]+':\x20'+_0x58f1f1[_0x1dbb23(0xb0)][_0x1dbb23(0x88)](0x0,0x3c)),this[_0x1dbb23(0xbb)](_0x1dbb23(0xb4),_0x58f1f1),this['emit'](_0x1dbb23(0xa4),_0x58f1f1);}catch(_0x395dd5){this['log'](_0x1dbb23(0x71)+_0x395dd5['message']);}}[a0_0x4bc658(0x74)](_0x463dc4){return new Promise(_0x209071=>setTimeout(_0x209071,_0x463dc4));}}var $=T;export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x361e97=a0_0x3514;(function(_0x52f10d,_0x21fc61){const _0x4aa434=a0_0x3514,_0xa63bf7=_0x52f10d();while(!![]){try{const _0xcd4059=-parseInt(_0x4aa434(0x196))/0x1*(-parseInt(_0x4aa434(0x1f2))/0x2)+-parseInt(_0x4aa434(0x1b7))/0x3+-parseInt(_0x4aa434(0x188))/0x4*(parseInt(_0x4aa434(0x1e4))/0x5)+-parseInt(_0x4aa434(0x19a))/0x6+parseInt(_0x4aa434(0x181))/0x7+-parseInt(_0x4aa434(0x1d7))/0x8+parseInt(_0x4aa434(0x17b))/0x9;if(_0xcd4059===_0x21fc61)break;else _0xa63bf7['push'](_0xa63bf7['shift']());}catch(_0x46ed47){_0xa63bf7['push'](_0xa63bf7['shift']());}}}(a0_0x4d1f,0x9c5e9));import{readFileSync as a0_0x2798d9,existsSync as a0_0x99a115}from'fs';import{randomUUID as a0_0x446c40}from'crypto';import{join as a0_0x4e8f44}from'path';import{hostname as a0_0x4d8c7a}from'os';import{execSync as a0_0x1cd35c}from'child_process';function a0_0x3514(_0x5bab8b,_0x143a2c){_0x5bab8b=_0x5bab8b-0x16b;const _0x4d1f4b=a0_0x4d1f();let _0x351419=_0x4d1f4b[_0x5bab8b];return _0x351419;}import{Server as a0_0x3664ea}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0xd7f421}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x260dd9,CallToolRequestSchema as a0_0x575231}from'@modelcontextprotocol/sdk/types.js';function p(_0x5d9928){const _0x577700=a0_0x3514;if(!a0_0x99a115(_0x5d9928))return;for(let _0x2b4b6d of a0_0x2798d9(_0x5d9928,'utf-8')[_0x577700(0x172)]('\x0a')){let _0x228f21=_0x2b4b6d['trim']();if(!_0x228f21||_0x228f21[_0x577700(0x1c8)]('#'))continue;let _0x255622=_0x228f21[_0x577700(0x1f0)]('=');if(_0x255622<0x0)continue;let _0x558cbb=_0x228f21['slice'](0x0,_0x255622)[_0x577700(0x170)](),_0x5abfe6=_0x228f21['slice'](_0x255622+0x1)[_0x577700(0x170)]()[_0x577700(0x1b0)](/^["']|["']$/g,'');if(!process.env[_0x558cbb])process.env[_0x558cbb]=_0x5abfe6;}}var C=process.env.HOME||'~',T=a0_0x4e8f44(C,a0_0x361e97(0x1e3));p(a0_0x4e8f44(T,a0_0x361e97(0x1ba)));var L=process[a0_0x361e97(0x17f)]()[a0_0x361e97(0x1b0)](/\//g,'-');p(a0_0x4e8f44(T,L,a0_0x361e97(0x1ba)));function U(){const _0x3ff54d=a0_0x361e97;try{return a0_0x1cd35c(_0x3ff54d(0x1e5),{'encoding':_0x3ff54d(0x1f4),'timeout':0x7d0})[_0x3ff54d(0x170)]();}catch{return'';}}function v(){const _0xb31fd3=a0_0x361e97;try{let _0x1ff539=a0_0x4e8f44(C,_0xb31fd3(0x1e2),_0xb31fd3(0x1cd));if(a0_0x99a115(_0x1ff539))return JSON[_0xb31fd3(0x1b9)](a0_0x2798d9(_0x1ff539,_0xb31fd3(0x1f4)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x361e97(0x1a6)]||a0_0x361e97(0x177),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x4d8c7a(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x446c40(),X=process.env.COMMHUB_TOKEN||H[a0_0x361e97(0x18a)]||'';function Y(_0x2d6377){const _0x38e560=a0_0x361e97;let _0x5b4fd3=new Date()[_0x38e560(0x1d9)]()[_0x38e560(0x1c0)](0x0,0x8);process[_0x38e560(0x18d)]['write']('['+_0x5b4fd3+_0x38e560(0x193)+_0x2d6377+'\x0a');}function h(_0x3c0c98){return new Promise(_0x20c87f=>setTimeout(_0x20c87f,_0x3c0c98));}Y(a0_0x361e97(0x1e1)+f+a0_0x361e97(0x1e0)+Z+'\x20RESUME_ID='+w['slice'](0x0,0x8)+a0_0x361e97(0x1ec)+(j||a0_0x361e97(0x195))+a0_0x361e97(0x1b2)+process[a0_0x361e97(0x17f)]()+'\x20PROJECT_ENV='+L);var k=new Map(),K=new a0_0x3664ea({'name':'commhub-channel','version':'0.3.0'},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x361e97(0x1e8),a0_0x361e97(0x180),a0_0x361e97(0x1df),a0_0x361e97(0x19c),a0_0x361e97(0x1d1)+Z][a0_0x361e97(0x16b)]('\x0a')});K[a0_0x361e97(0x1a2)](a0_0x260dd9,async()=>({'tools':[{'name':'commhub_reply','description':a0_0x361e97(0x199),'inputSchema':{'type':'object','properties':{'task_id':{'type':a0_0x361e97(0x1ae),'description':a0_0x361e97(0x1bc)},'text':{'type':a0_0x361e97(0x1ae),'description':a0_0x361e97(0x187)},'status':{'type':'string','enum':['completed',a0_0x361e97(0x1bb),'cancelled','blocked','error','in_progress'],'description':a0_0x361e97(0x176)}},'required':[a0_0x361e97(0x18e)]}},{'name':'commhub_report_status','description':a0_0x361e97(0x198),'inputSchema':{'type':a0_0x361e97(0x1d5),'properties':{'status':{'type':a0_0x361e97(0x1ae),'enum':[a0_0x361e97(0x1f5),'idle',a0_0x361e97(0x185),a0_0x361e97(0x190)]},'task':{'type':a0_0x361e97(0x1ae),'description':a0_0x361e97(0x1bd)},'progress':{'type':a0_0x361e97(0x18b),'description':a0_0x361e97(0x16c)}},'required':[a0_0x361e97(0x16d)]}},{'name':a0_0x361e97(0x178),'description':a0_0x361e97(0x1d8),'inputSchema':{'type':a0_0x361e97(0x1d5),'properties':{'alias':{'type':'string','description':'Target\x20session\x20alias'},'task':{'type':a0_0x361e97(0x1ae),'description':a0_0x361e97(0x1c7)},'priority':{'type':a0_0x361e97(0x1ae),'enum':[a0_0x361e97(0x1bf),a0_0x361e97(0x1d4),a0_0x361e97(0x19d)],'description':a0_0x361e97(0x19f)}},'required':['alias',a0_0x361e97(0x19e)]}},{'name':a0_0x361e97(0x17c),'description':'Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','inputSchema':{'type':a0_0x361e97(0x1d5),'properties':{'alias':{'type':a0_0x361e97(0x1ae),'description':a0_0x361e97(0x1b4)},'message':{'type':'string','description':'Message\x20content'}},'required':[a0_0x361e97(0x173),'message']}},{'name':a0_0x361e97(0x175),'description':a0_0x361e97(0x17a),'inputSchema':{'type':a0_0x361e97(0x1d5),'properties':{}}}]}));async function P(_0x336cb7,_0x47fd93){const _0x40034f=a0_0x361e97;let _0x3afe93=await fetch(f+'/mcp',{'method':_0x40034f(0x17d),'headers':{'Content-Type':_0x40034f(0x1c9),'Accept':_0x40034f(0x1a8),...X?{'Authorization':_0x40034f(0x1b1)+X}:{}},'body':JSON[_0x40034f(0x1f3)]({'jsonrpc':_0x40034f(0x1e9),'id':0x1,'method':'initialize','params':{'protocolVersion':_0x40034f(0x1cf),'capabilities':{},'clientInfo':{'name':_0x40034f(0x191),'version':_0x40034f(0x1be)}}})});if(!_0x3afe93['ok']){let _0x58aa01=await _0x3afe93[_0x40034f(0x18e)]();return Y(_0x40034f(0x1ca)+_0x3afe93[_0x40034f(0x16d)]+'\x20'+_0x58aa01['slice'](0x0,0x64)),{'ok':!0x1,'error':'init\x20failed:\x20'+_0x3afe93['status']};}await _0x3afe93[_0x40034f(0x18e)]();let _0x7f8b2f=(await(await fetch(f+_0x40034f(0x1ed),{'method':_0x40034f(0x17d),'headers':{'Content-Type':'application/json','Accept':_0x40034f(0x1a8),...X?{'Authorization':_0x40034f(0x1b1)+X}:{}},'body':JSON[_0x40034f(0x1f3)]({'jsonrpc':_0x40034f(0x1e9),'id':0x2,'method':'tools/call','params':{'name':_0x336cb7,'arguments':_0x47fd93}})}))['text']())['split']('\x0a')[_0x40034f(0x1c1)](_0x5ba7a4=>_0x5ba7a4['startsWith'](_0x40034f(0x1d0)));if(_0x7f8b2f){let _0x4832ee=JSON[_0x40034f(0x1b9)](_0x7f8b2f[_0x40034f(0x1c0)](0x6));return _0x4832ee?.[_0x40034f(0x1ac)]?.[_0x40034f(0x1e6)]?.[0x0]?.[_0x40034f(0x18e)]?JSON[_0x40034f(0x1b9)](_0x4832ee[_0x40034f(0x1ac)][_0x40034f(0x1e6)][0x0][_0x40034f(0x18e)]):_0x4832ee;}return{'ok':!0x1,'error':_0x40034f(0x1a5)};}K[a0_0x361e97(0x1a2)](a0_0x575231,async _0x5c599b=>{const _0x245e30=a0_0x361e97;let {name:_0x1b6466,arguments:_0x417308}=_0x5c599b[_0x245e30(0x1a1)];if(_0x1b6466==='commhub_reply'){let {task_id:_0x47c6da,text:_0x1ed9f7,status:_0x4b0436}=_0x417308;if(_0x4b0436==='completed'||_0x4b0436===_0x245e30(0x1bb)||_0x4b0436===_0x245e30(0x1db)){let _0x15e2c2=_0x4b0436==='completed'?_0x245e30(0x184):_0x4b0436,_0x39edf5=_0x47c6da?k[_0x245e30(0x1c3)](_0x47c6da)||_0x245e30(0x1a6):_0x245e30(0x1a6),_0x4a2f48=await P(_0x245e30(0x1d6),{'alias':_0x39edf5,'text':_0x1ed9f7,'in_reply_to':_0x47c6da||void 0x0,'status':_0x15e2c2,'from_session':Z});if(_0x47c6da)k[_0x245e30(0x189)](_0x47c6da);return{'content':[{'type':_0x245e30(0x18e),'text':JSON['stringify'](_0x4a2f48)}]};}let _0x284197=await P(_0x245e30(0x1cc),{'resume_id':w,'alias':Z,'status':_0x4b0436===_0x245e30(0x185)?_0x245e30(0x185):_0x4b0436===_0x245e30(0x190)?_0x245e30(0x190):'working','task':_0x1ed9f7['slice'](0x0,0xc8),'output':_0x1ed9f7});return{'content':[{'type':_0x245e30(0x18e),'text':JSON['stringify'](_0x284197)}]};}if(_0x1b6466===_0x245e30(0x1ad)){let {status:_0x3b5dce,task:_0x3d79d1,progress:_0x116bd9}=_0x417308,_0x346afc=await P(_0x245e30(0x1cc),{'resume_id':w,'alias':Z,'status':_0x3b5dce,'task':_0x3d79d1,'progress':_0x116bd9});return{'content':[{'type':_0x245e30(0x18e),'text':JSON[_0x245e30(0x1f3)](_0x346afc)}]};}if(_0x1b6466===_0x245e30(0x178)){let {alias:_0x31a231,task:_0x1c1e8e,priority:_0x2ae804}=_0x417308,_0x27a537=await P(_0x245e30(0x1b5),{'alias':_0x31a231,'task':_0x1c1e8e,'priority':_0x2ae804||_0x245e30(0x1d4),'from_session':Z});return{'content':[{'type':_0x245e30(0x18e),'text':JSON[_0x245e30(0x1f3)](_0x27a537)}]};}if(_0x1b6466===_0x245e30(0x17c)){let {alias:_0x330310,message:_0x534a24}=_0x417308,_0x159a58=await P(_0x245e30(0x1ef),{'alias':_0x330310,'message':_0x534a24,'from_session':Z});return{'content':[{'type':'text','text':JSON['stringify'](_0x159a58)}]};}if(_0x1b6466===_0x245e30(0x175)){let _0x578fb3=await P('get_all_status',{});return{'content':[{'type':_0x245e30(0x18e),'text':JSON[_0x245e30(0x1f3)](_0x578fb3)}]};}return{'content':[{'type':_0x245e30(0x18e),'text':JSON['stringify']({'error':'unknown\x20tool'})}]};});async function u(){const _0x5e9ef9=a0_0x361e97;let _0x5e440e=f+_0x5e9ef9(0x1ea)+encodeURIComponent(Z),_0x40e9d2={};if(X)_0x40e9d2['Authorization']=_0x5e9ef9(0x1b1)+X;Y(_0x5e9ef9(0x1d3)+_0x5e440e);while(!0x0){try{let _0x355852=await fetch(_0x5e440e,{'headers':_0x40e9d2});if(!_0x355852['ok']){Y(_0x5e9ef9(0x192)+_0x355852[_0x5e9ef9(0x16d)]+'\x20'+_0x355852['statusText']),await h(0x1388);continue;}let _0x54992b=_0x355852[_0x5e9ef9(0x1dd)][_0x5e9ef9(0x174)](),_0x4c8cb=new TextDecoder(),_0x7beecb='';while(!0x0){let {done:_0x1afbcf,value:_0x20a3a5}=await _0x54992b['read']();if(_0x1afbcf)break;_0x7beecb+=_0x4c8cb[_0x5e9ef9(0x1c4)](_0x20a3a5,{'stream':!0x0});let _0x5647b0=_0x7beecb[_0x5e9ef9(0x172)]('\x0a\x0a');_0x7beecb=_0x5647b0[_0x5e9ef9(0x1a9)]()||'';for(let _0x246d50 of _0x5647b0){let _0x1d893a=_0x246d50[_0x5e9ef9(0x172)]('\x0a')[_0x5e9ef9(0x1c1)](_0x5e548c=>_0x5e548c[_0x5e9ef9(0x1c8)](_0x5e9ef9(0x1d0)));if(!_0x1d893a)continue;try{let _0x44a014=JSON[_0x5e9ef9(0x1b9)](_0x1d893a[_0x5e9ef9(0x1c0)](0x6));await S(_0x44a014);}catch(_0xb9aa58){Y(_0x5e9ef9(0x1c5)+_0xb9aa58);}}}Y('SSE\x20stream\x20ended,\x20reconnecting...');}catch(_0x451919){Y(_0x5e9ef9(0x1eb)+_0x451919);}await h(0xbb8);}}async function S(_0x1a5f5e){const _0x393604=a0_0x361e97;if(_0x1a5f5e[_0x393604(0x19b)]===_0x393604(0x182)){Y(_0x393604(0x1b3)+Z+'\x22');return;}if(_0x1a5f5e[_0x393604(0x19b)]===_0x393604(0x197)){if(Y(_0x393604(0x186)+_0x1a5f5e[_0x393604(0x1e7)]+':\x20'+_0x1a5f5e[_0x393604(0x17e)][_0x393604(0x1c0)](0x0,0x3c)),await K['notification']({'method':'notifications/claude/channel','params':{'content':_0x1a5f5e[_0x393604(0x17e)],'meta':{'sender':_0x1a5f5e[_0x393604(0x1e7)]||'hub','sender_id':_0x393604(0x194),'user':_0x1a5f5e[_0x393604(0x1e7)]||'hub','priority':_0x393604(0x1d4)}}}),_0x1a5f5e['message_id'])await P(_0x393604(0x1b8),{'alias':Z,'message_id':_0x1a5f5e[_0x393604(0x16f)]});return;}if(_0x1a5f5e[_0x393604(0x19b)]===_0x393604(0x18c)||_0x1a5f5e[_0x393604(0x19b)]===_0x393604(0x1c6)){Y('←\x20'+_0x1a5f5e[_0x393604(0x19b)]+_0x393604(0x1c2)+_0x1a5f5e[_0x393604(0x1ab)]+_0x393604(0x1ce)+(_0x1a5f5e[_0x393604(0x1f1)]||_0x393604(0x1d4)));let _0x48d771=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0x48d771?.['ok']&&_0x48d771[_0x393604(0x1ee)]?.[_0x393604(0x1b6)]>0x0)for(let _0x51859b of _0x48d771[_0x393604(0x1ee)]){let _0x175a6d={'sender':_0x51859b[_0x393604(0x1da)]||_0x393604(0x1a6),'sender_id':_0x393604(0x194),'user':_0x51859b[_0x393604(0x1da)]||'hub','task_id':_0x51859b['id'],'priority':_0x51859b[_0x393604(0x1f1)]||_0x393604(0x1d4)};k[_0x393604(0x1cb)](_0x51859b['id'],_0x51859b['from_session']||_0x393604(0x1a6)),await K[_0x393604(0x1dc)]({'method':_0x393604(0x1a0),'params':{'content':_0x51859b['content'],'meta':_0x175a6d}}),Y(_0x393604(0x1d2)+_0x51859b['id']['slice'](0x0,0x8)+'\x20from\x20'+_0x51859b[_0x393604(0x1da)]+':\x20'+_0x51859b['content'][_0x393604(0x1c0)](0x0,0x3c)),await P(_0x393604(0x1b8),{'alias':Z,'message_id':_0x51859b['id']});}}}async function A(){const _0xfc8f7=a0_0x361e97;let _0x70a60f=new a0_0xd7f421();await K['connect'](_0x70a60f),Y(_0xfc8f7(0x16e)),Y(_0xfc8f7(0x179)),u()[_0xfc8f7(0x1de)](_0x385686=>Y('SSE\x20fatal:\x20'+_0x385686)),P(_0xfc8f7(0x1cc),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x4d8c7a(),'hostname':a0_0x4d8c7a(),'agent':_0xfc8f7(0x1a3),'project_dir':process[_0xfc8f7(0x17f)](),'tmux_name':j||void 0x0})[_0xfc8f7(0x1a4)](()=>Y(_0xfc8f7(0x171)+Z+_0xfc8f7(0x18f)+w[_0xfc8f7(0x1c0)](0x0,0x8)+')'))[_0xfc8f7(0x1de)](_0x4588db=>Y('warning:\x20could\x20not\x20register:\x20'+_0x4588db)),setInterval(()=>{const _0x173b60=_0xfc8f7;P(_0x173b60(0x1cc),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x4d8c7a(),'hostname':a0_0x4d8c7a(),'agent':_0x173b60(0x1a3),'project_dir':process['cwd'](),'tmux_name':j||void 0x0})['catch'](_0x3c4ded=>Y(_0x173b60(0x1a7)+_0x3c4ded));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}function a0_0x4d1f(){const _0x2af353=['\x20CWD=','SSE\x20connected\x20as\x20\x22','Target\x20session\x20alias','send_task','length','875286GWsFyY','ack_inbox','parse','.env','failed','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','Current\x20task\x20description','0.3.0','high','slice','find',':\x20inbox_count=','get','decode','parse\x20error:\x20','broadcast','Task\x20content','startsWith','application/json','CommHub\x20init\x20failed:\x20','set','report_status','config.json','\x20priority=','2025-03-26','data:\x20','Session\x20alias:\x20','→\x20injected\x20task\x20','connecting\x20to\x20','normal','object','send_reply','1959440JiNksV','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','toTimeString','from_session','cancelled','notification','body','catch','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','\x20ALIAS=','ENV:\x20URL=','.anet','.claude/channels/commhub','6123505YsNvwf','tmux\x20display-message\x20-p\x20\x27#S\x27','content','from','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','2.0','/events/','SSE\x20connection\x20error:\x20','...\x20TMUX=','/mcp','messages','send_message','indexOf','priority','2qVgxLp','stringify','utf-8','working','join','Progress\x200-100','status','MCP\x20stdio\x20connected','message_id','trim','registered\x20as\x20\x22','split','alias','getReader','commhub_get_all_status','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','http://127.0.0.1:9200','commhub_send_task','starting\x20SSE\x20listener...','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','12632976aWDrvj','commhub_send_message','POST','message','cwd','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','6315295AGYQiP','connected','session\x20disconnected','replied','blocked','←\x20message\x20from\x20','Reply\x20text\x20/\x20result\x20summary','4mUFVcI','delete','token','number','new_task','stderr','text','\x22\x20(','error','commhub-channel','SSE\x20error:\x20',']\x20[commhub]\x20','commhub','none','476269dBvWpk','new_message','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','2281416mjslQl','type','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','low','task','Priority\x20(default:\x20normal)','notifications/claude/channel','params','setRequestHandler','claude-code','then','no\x20response','hub','heartbeat\x20failed:\x20','application/json,\x20text/event-stream','pop','exit','inbox_count','result','commhub_report_status','string','shutting\x20down,\x20reporting\x20offline...','replace','Bearer\x20'];a0_0x4d1f=function(){return _0x2af353;};return a0_0x4d1f();}A()[a0_0x361e97(0x1de)](_0x48fa3e=>{const _0x4787ce=a0_0x361e97;Y('fatal:\x20'+_0x48fa3e),process[_0x4787ce(0x1aa)](0x1);});async function N(){const _0x65bfff=a0_0x361e97;Y(_0x65bfff(0x1af)),await P(_0x65bfff(0x1cc),{'resume_id':w,'alias':Z,'status':_0x65bfff(0x190),'task':_0x65bfff(0x183)})['catch'](()=>{}),process[_0x65bfff(0x1aa)](0x0);}process['stdin']['on']('end',()=>N()),process['on']('SIGTERM',()=>N()),process['on']('SIGINT',()=>N());
2
+ const a0_0x488107=a0_0x1b28;(function(_0x2141f9,_0x2047ca){const _0x4d9d48=a0_0x1b28,_0x292382=_0x2141f9();while(!![]){try{const _0xfcc46d=parseInt(_0x4d9d48(0x192))/0x1+-parseInt(_0x4d9d48(0x1db))/0x2+parseInt(_0x4d9d48(0x1d9))/0x3*(parseInt(_0x4d9d48(0x1cd))/0x4)+-parseInt(_0x4d9d48(0x1d7))/0x5+parseInt(_0x4d9d48(0x1f9))/0x6+-parseInt(_0x4d9d48(0x1cb))/0x7+parseInt(_0x4d9d48(0x180))/0x8*(parseInt(_0x4d9d48(0x166))/0x9);if(_0xfcc46d===_0x2047ca)break;else _0x292382['push'](_0x292382['shift']());}catch(_0x5635f7){_0x292382['push'](_0x292382['shift']());}}}(a0_0x5646,0x8c6ab));import{readFileSync as a0_0x38f8b4,existsSync as a0_0x487711}from'fs';import{randomUUID as a0_0x17183f}from'crypto';import{join as a0_0x2ed131}from'path';import{hostname as a0_0x520c53}from'os';import{execSync as a0_0x1cb513}from'child_process';import{Server as a0_0x43a47b}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x2a6030}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x545567,CallToolRequestSchema as a0_0x529b1d}from'@modelcontextprotocol/sdk/types.js';function p(_0x50cdb6){const _0x25de38=a0_0x1b28;if(!a0_0x487711(_0x50cdb6))return;for(let _0x543c23 of a0_0x38f8b4(_0x50cdb6,_0x25de38(0x16c))[_0x25de38(0x1f7)]('\x0a')){let _0x6aa53f=_0x543c23[_0x25de38(0x1d2)]();if(!_0x6aa53f||_0x6aa53f['startsWith']('#'))continue;let _0x599134=_0x6aa53f[_0x25de38(0x1f4)]('=');if(_0x599134<0x0)continue;let _0x5c3a2e=_0x6aa53f['slice'](0x0,_0x599134)[_0x25de38(0x1d2)](),_0x48624f=_0x6aa53f[_0x25de38(0x16a)](_0x599134+0x1)[_0x25de38(0x1d2)]()[_0x25de38(0x1e0)](/^["']|["']$/g,'');if(!process.env[_0x5c3a2e])process.env[_0x5c3a2e]=_0x48624f;}}var C=process.env.HOME||'~',T=a0_0x2ed131(C,a0_0x488107(0x1b4));p(a0_0x2ed131(T,'.env'));var L=process[a0_0x488107(0x1b1)]()[a0_0x488107(0x1e0)](/\//g,'-');function a0_0x5646(){const _0x3ba47c=['task','ENV:\x20URL=','config.json','7845054arineB','find','12PmAvVj','commhub','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','\x20PROJECT_ENV=','catch','trim','application/json,\x20text/event-stream','number','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','object','1513715VPMXCf','content','663045AGsWtr','params','1341308cjzkbC','decode','tools/call','SSE\x20connection\x20error:\x20','startsWith','replace','statusText','send_reply','POST','ack_inbox','toTimeString','completed','normal','priority','ready\x20—\x20waiting\x20for\x20events','from','working','hub','shutting\x20down,\x20reporting\x20offline...','Message\x20content','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','result','\x20RESUME_ID=','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','indexOf','connected','/mcp','split','alias','6060390dYJZNd','error','SSE\x20error:\x20','delete','9vAFoRX','warning:\x20could\x20not\x20register:\x20','notification','data:\x20','slice','then','utf-8','high','idle','in_progress','Bearer\x20','getReader','stringify','0.3.0','parse\x20error:\x20','connect','SIGTERM','commhub_get_all_status','\x20priority=','Progress\x200-100','.env','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','get_inbox','commhub_report_status','SSE\x20stream\x20ended,\x20reconnecting...','get','5805944DakMZK','inbox_count','application/json','.anet','none','commhub_send_message',':\x20inbox_count=','new_task','Priority\x20(default:\x20normal)','\x20ALIAS=','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','no\x20response','message_id','Current\x20task\x20description','type','\x20from\x20','starting\x20SSE\x20listener...','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','270413XuuwSt','status','setRequestHandler','get_all_status','Authorization','claude-code','messages','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','join','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','CommHub\x20init\x20failed:\x20','MCP\x20stdio\x20connected','report_status','blocked','new_message',']\x20[commhub]\x20','Target\x20session\x20alias','read','heartbeat\x20failed:\x20','notifications/claude/channel','exit','Session\x20alias:\x20','\x20CWD=','send_message','2.0','write','token','end','send_task','parse','text','cwd','registered\x20as\x20\x22','from_session','.claude/channels/commhub','commhub-channel','replied','cancelled','...\x20TMUX=','failed','tmux\x20display-message\x20-p\x20\x27#S\x27','unknown\x20tool','initialize','string','message','Task\x20content','/events/','commhub_send_task','length','→\x20injected\x20task\x20','init\x20failed:\x20','SSE\x20fatal:\x20','2025-03-26','commhub_reply'];a0_0x5646=function(){return _0x3ba47c;};return a0_0x5646();}p(a0_0x2ed131(T,L,a0_0x488107(0x17a)));function U(){const _0x45682b=a0_0x488107;try{return a0_0x1cb513(_0x45682b(0x1ba),{'encoding':'utf-8','timeout':0x7d0})[_0x45682b(0x1d2)]();}catch{return'';}}function v(){const _0x2e4f83=a0_0x488107;try{let _0x169383=a0_0x2ed131(C,_0x2e4f83(0x183),_0x2e4f83(0x1ca));if(a0_0x487711(_0x169383))return JSON[_0x2e4f83(0x1af)](a0_0x38f8b4(_0x169383,_0x2e4f83(0x16c)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x488107(0x1ec)]||'http://127.0.0.1:9200',j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x520c53(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x17183f(),X=process.env.COMMHUB_TOKEN||H[a0_0x488107(0x1ac)]||'';function Y(_0x24dc37){const _0x3830e5=a0_0x488107;let _0x5301b7=new Date()[_0x3830e5(0x1e5)]()[_0x3830e5(0x16a)](0x0,0x8);process['stderr'][_0x3830e5(0x1ab)]('['+_0x5301b7+_0x3830e5(0x1a1)+_0x24dc37+'\x0a');}function h(_0x257aa7){return new Promise(_0x4786db=>setTimeout(_0x4786db,_0x257aa7));}Y(a0_0x488107(0x1c9)+f+a0_0x488107(0x189)+Z+a0_0x488107(0x1f1)+w[a0_0x488107(0x16a)](0x0,0x8)+a0_0x488107(0x1b8)+(j||a0_0x488107(0x184))+a0_0x488107(0x1a8)+process['cwd']()+a0_0x488107(0x1d0)+L);var k=new Map(),K=new a0_0x43a47b({'name':a0_0x488107(0x1b5),'version':'0.3.0'},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x488107(0x18a),a0_0x488107(0x1f3),a0_0x488107(0x1d5),a0_0x488107(0x19b),a0_0x488107(0x1a7)+Z][a0_0x488107(0x19a)]('\x0a')});K[a0_0x488107(0x194)](a0_0x545567,async()=>({'tools':[{'name':a0_0x488107(0x1c7),'description':a0_0x488107(0x1ef),'inputSchema':{'type':a0_0x488107(0x1d6),'properties':{'task_id':{'type':a0_0x488107(0x1bd),'description':a0_0x488107(0x17b)},'text':{'type':a0_0x488107(0x1bd),'description':'Reply\x20text\x20/\x20result\x20summary'},'status':{'type':a0_0x488107(0x1bd),'enum':[a0_0x488107(0x1e6),a0_0x488107(0x1b9),a0_0x488107(0x1b7),a0_0x488107(0x19f),a0_0x488107(0x1fa),a0_0x488107(0x16f)],'description':a0_0x488107(0x1f2)}},'required':[a0_0x488107(0x1b0)]}},{'name':'commhub_report_status','description':a0_0x488107(0x199),'inputSchema':{'type':'object','properties':{'status':{'type':'string','enum':[a0_0x488107(0x1eb),'idle',a0_0x488107(0x19f),'error']},'task':{'type':a0_0x488107(0x1bd),'description':a0_0x488107(0x18d)},'progress':{'type':a0_0x488107(0x1d4),'description':a0_0x488107(0x179)}},'required':[a0_0x488107(0x193)]}},{'name':'commhub_send_task','description':a0_0x488107(0x1cf),'inputSchema':{'type':a0_0x488107(0x1d6),'properties':{'alias':{'type':a0_0x488107(0x1bd),'description':a0_0x488107(0x1a2)},'task':{'type':'string','description':a0_0x488107(0x1bf)},'priority':{'type':a0_0x488107(0x1bd),'enum':[a0_0x488107(0x16d),a0_0x488107(0x1e7),'low'],'description':a0_0x488107(0x188)}},'required':['alias',a0_0x488107(0x1c8)]}},{'name':a0_0x488107(0x185),'description':a0_0x488107(0x191),'inputSchema':{'type':a0_0x488107(0x1d6),'properties':{'alias':{'type':a0_0x488107(0x1bd),'description':a0_0x488107(0x1a2)},'message':{'type':a0_0x488107(0x1bd),'description':a0_0x488107(0x1ee)}},'required':[a0_0x488107(0x1f8),a0_0x488107(0x1be)]}},{'name':a0_0x488107(0x177),'description':'Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','inputSchema':{'type':a0_0x488107(0x1d6),'properties':{}}}]}));async function P(_0x33ac15,_0x4bb4cf){const _0x241248=a0_0x488107;let _0x16508c=await fetch(f+_0x241248(0x1f6),{'method':_0x241248(0x1e3),'headers':{'Content-Type':_0x241248(0x182),'Accept':_0x241248(0x1d3),...X?{'Authorization':_0x241248(0x170)+X}:{}},'body':JSON[_0x241248(0x172)]({'jsonrpc':_0x241248(0x1aa),'id':0x1,'method':_0x241248(0x1bc),'params':{'protocolVersion':_0x241248(0x1c6),'capabilities':{},'clientInfo':{'name':_0x241248(0x1b5),'version':_0x241248(0x173)}}})});if(!_0x16508c['ok']){let _0x2b9a8f=await _0x16508c[_0x241248(0x1b0)]();return Y(_0x241248(0x19c)+_0x16508c[_0x241248(0x193)]+'\x20'+_0x2b9a8f['slice'](0x0,0x64)),{'ok':!0x1,'error':_0x241248(0x1c4)+_0x16508c[_0x241248(0x193)]};}await _0x16508c['text']();let _0x5044b2=(await(await fetch(f+'/mcp',{'method':_0x241248(0x1e3),'headers':{'Content-Type':_0x241248(0x182),'Accept':_0x241248(0x1d3),...X?{'Authorization':_0x241248(0x170)+X}:{}},'body':JSON[_0x241248(0x172)]({'jsonrpc':_0x241248(0x1aa),'id':0x2,'method':_0x241248(0x1dd),'params':{'name':_0x33ac15,'arguments':_0x4bb4cf}})}))['text']())[_0x241248(0x1f7)]('\x0a')[_0x241248(0x1cc)](_0x28db4e=>_0x28db4e['startsWith']('data:\x20'));if(_0x5044b2){let _0x3702f3=JSON[_0x241248(0x1af)](_0x5044b2[_0x241248(0x16a)](0x6));return _0x3702f3?.['result']?.[_0x241248(0x1d8)]?.[0x0]?.['text']?JSON[_0x241248(0x1af)](_0x3702f3[_0x241248(0x1f0)][_0x241248(0x1d8)][0x0][_0x241248(0x1b0)]):_0x3702f3;}return{'ok':!0x1,'error':_0x241248(0x18b)};}function a0_0x1b28(_0x5a0c58,_0x464c11){_0x5a0c58=_0x5a0c58-0x166;const _0x5646f4=a0_0x5646();let _0x1b2896=_0x5646f4[_0x5a0c58];return _0x1b2896;}K['setRequestHandler'](a0_0x529b1d,async _0x47550b=>{const _0x71fa8=a0_0x488107;let {name:_0x1b4af5,arguments:_0x2a4d57}=_0x47550b[_0x71fa8(0x1da)];if(_0x1b4af5===_0x71fa8(0x1c7)){let {task_id:_0xaf2ca4,text:_0x362601,status:_0x41a5fc}=_0x2a4d57;if(_0x41a5fc===_0x71fa8(0x1e6)||_0x41a5fc===_0x71fa8(0x1b9)||_0x41a5fc===_0x71fa8(0x1b7)){let _0x5353a1=_0x41a5fc==='completed'?_0x71fa8(0x1b6):_0x41a5fc,_0x1fef19=_0xaf2ca4?k[_0x71fa8(0x17f)](_0xaf2ca4)||_0x71fa8(0x1ec):'hub',_0x560102=await P(_0x71fa8(0x1e2),{'alias':_0x1fef19,'text':_0x362601,'in_reply_to':_0xaf2ca4||void 0x0,'status':_0x5353a1,'from_session':Z});if(_0xaf2ca4)k[_0x71fa8(0x1fc)](_0xaf2ca4);return{'content':[{'type':_0x71fa8(0x1b0),'text':JSON['stringify'](_0x560102)}]};}let _0x2a165d=await P(_0x71fa8(0x19e),{'resume_id':w,'alias':Z,'status':_0x41a5fc===_0x71fa8(0x19f)?_0x71fa8(0x19f):_0x41a5fc===_0x71fa8(0x1fa)?_0x71fa8(0x1fa):_0x71fa8(0x1eb),'task':_0x362601[_0x71fa8(0x16a)](0x0,0xc8),'output':_0x362601});return{'content':[{'type':'text','text':JSON[_0x71fa8(0x172)](_0x2a165d)}]};}if(_0x1b4af5===_0x71fa8(0x17d)){let {status:_0x1aebe9,task:_0x43ce67,progress:_0x38f390}=_0x2a4d57,_0x37ecc5=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x1aebe9,'task':_0x43ce67,'progress':_0x38f390});return{'content':[{'type':'text','text':JSON['stringify'](_0x37ecc5)}]};}if(_0x1b4af5===_0x71fa8(0x1c1)){let {alias:_0x72faf,task:_0x479f3e,priority:_0x357ad2}=_0x2a4d57,_0x4c7629=await P(_0x71fa8(0x1ae),{'alias':_0x72faf,'task':_0x479f3e,'priority':_0x357ad2||'normal','from_session':Z});return{'content':[{'type':_0x71fa8(0x1b0),'text':JSON['stringify'](_0x4c7629)}]};}if(_0x1b4af5==='commhub_send_message'){let {alias:_0x48d424,message:_0x58b7ed}=_0x2a4d57,_0xf4fda8=await P(_0x71fa8(0x1a9),{'alias':_0x48d424,'message':_0x58b7ed,'from_session':Z});return{'content':[{'type':_0x71fa8(0x1b0),'text':JSON['stringify'](_0xf4fda8)}]};}if(_0x1b4af5==='commhub_get_all_status'){let _0x447fc6=await P(_0x71fa8(0x195),{});return{'content':[{'type':_0x71fa8(0x1b0),'text':JSON[_0x71fa8(0x172)](_0x447fc6)}]};}return{'content':[{'type':_0x71fa8(0x1b0),'text':JSON['stringify']({'error':_0x71fa8(0x1bb)})}]};});async function u(){const _0x3e2ae8=a0_0x488107;let _0xc5b10c=f+_0x3e2ae8(0x1c0)+encodeURIComponent(Z),_0xa94ada={};if(X)_0xa94ada[_0x3e2ae8(0x196)]=_0x3e2ae8(0x170)+X;Y('connecting\x20to\x20'+_0xc5b10c);while(!0x0){try{let _0x248234=await fetch(_0xc5b10c,{'headers':_0xa94ada});if(!_0x248234['ok']){Y(_0x3e2ae8(0x1fb)+_0x248234[_0x3e2ae8(0x193)]+'\x20'+_0x248234[_0x3e2ae8(0x1e1)]),await h(0x1388);continue;}let _0x42801e=_0x248234['body'][_0x3e2ae8(0x171)](),_0x3a40f2=new TextDecoder(),_0x34c1c8='';while(!0x0){let {done:_0x4e8520,value:_0x3d807e}=await _0x42801e[_0x3e2ae8(0x1a3)]();if(_0x4e8520)break;_0x34c1c8+=_0x3a40f2[_0x3e2ae8(0x1dc)](_0x3d807e,{'stream':!0x0});let _0x192d9e=_0x34c1c8[_0x3e2ae8(0x1f7)]('\x0a\x0a');_0x34c1c8=_0x192d9e['pop']()||'';for(let _0x779d27 of _0x192d9e){let _0x48e1d8=_0x779d27['split']('\x0a')[_0x3e2ae8(0x1cc)](_0x242737=>_0x242737[_0x3e2ae8(0x1df)](_0x3e2ae8(0x169)));if(!_0x48e1d8)continue;try{let _0x56cb73=JSON[_0x3e2ae8(0x1af)](_0x48e1d8[_0x3e2ae8(0x16a)](0x6));await S(_0x56cb73);}catch(_0x495ac9){Y(_0x3e2ae8(0x174)+_0x495ac9);}}}Y(_0x3e2ae8(0x17e));}catch(_0x4ea7f9){Y(_0x3e2ae8(0x1de)+_0x4ea7f9);}await h(0xbb8);}}async function S(_0x4f8dc7){const _0x259e54=a0_0x488107;if(_0x4f8dc7[_0x259e54(0x18e)]===_0x259e54(0x1f5)){Y('SSE\x20connected\x20as\x20\x22'+Z+'\x22');return;}if(_0x4f8dc7[_0x259e54(0x18e)]===_0x259e54(0x1a0)){if(Y('←\x20message\x20from\x20'+_0x4f8dc7[_0x259e54(0x1ea)]+':\x20'+_0x4f8dc7[_0x259e54(0x1be)][_0x259e54(0x16a)](0x0,0x3c)),await K[_0x259e54(0x168)]({'method':'notifications/claude/channel','params':{'content':_0x4f8dc7['message'],'meta':{'sender':_0x4f8dc7[_0x259e54(0x1ea)]||'hub','sender_id':_0x259e54(0x1ce),'user':_0x4f8dc7[_0x259e54(0x1ea)]||_0x259e54(0x1ec),'priority':_0x259e54(0x1e7)}}}),_0x4f8dc7[_0x259e54(0x18c)])await P(_0x259e54(0x1e4),{'alias':Z,'message_id':_0x4f8dc7[_0x259e54(0x18c)]});return;}if(_0x4f8dc7[_0x259e54(0x18e)]===_0x259e54(0x187)||_0x4f8dc7[_0x259e54(0x18e)]==='broadcast'){Y('←\x20'+_0x4f8dc7['type']+_0x259e54(0x186)+_0x4f8dc7[_0x259e54(0x181)]+_0x259e54(0x178)+(_0x4f8dc7['priority']||_0x259e54(0x1e7)));let _0x1793ff=await P(_0x259e54(0x17c),{'alias':Z,'limit':0x5});if(_0x1793ff?.['ok']&&_0x1793ff['messages']?.[_0x259e54(0x1c2)]>0x0)for(let _0x15ee4c of _0x1793ff[_0x259e54(0x198)]){let _0x4db02e={'sender':_0x15ee4c[_0x259e54(0x1b3)]||'hub','sender_id':_0x259e54(0x1ce),'user':_0x15ee4c[_0x259e54(0x1b3)]||_0x259e54(0x1ec),'task_id':_0x15ee4c['id'],'priority':_0x15ee4c[_0x259e54(0x1e8)]||_0x259e54(0x1e7)};k['set'](_0x15ee4c['id'],_0x15ee4c[_0x259e54(0x1b3)]||_0x259e54(0x1ec)),await K['notification']({'method':_0x259e54(0x1a5),'params':{'content':_0x15ee4c[_0x259e54(0x1d8)],'meta':_0x4db02e}}),Y(_0x259e54(0x1c3)+_0x15ee4c['id'][_0x259e54(0x16a)](0x0,0x8)+_0x259e54(0x18f)+_0x15ee4c[_0x259e54(0x1b3)]+':\x20'+_0x15ee4c['content'][_0x259e54(0x16a)](0x0,0x3c)),await P(_0x259e54(0x1e4),{'alias':Z,'message_id':_0x15ee4c['id']});}}}async function A(){const _0x32750c=a0_0x488107;let _0x5871f1=new a0_0x2a6030();await K[_0x32750c(0x175)](_0x5871f1),Y(_0x32750c(0x19d)),Y(_0x32750c(0x190)),u()[_0x32750c(0x1d1)](_0x1a7bbc=>Y(_0x32750c(0x1c5)+_0x1a7bbc)),P('report_status',{'resume_id':w,'alias':Z,'status':_0x32750c(0x16e),'server':a0_0x520c53(),'hostname':a0_0x520c53(),'agent':_0x32750c(0x197),'project_dir':process[_0x32750c(0x1b1)](),'tmux_name':j||void 0x0})[_0x32750c(0x16b)](()=>Y(_0x32750c(0x1b2)+Z+'\x22\x20('+w[_0x32750c(0x16a)](0x0,0x8)+')'))[_0x32750c(0x1d1)](_0x1e2592=>Y(_0x32750c(0x167)+_0x1e2592)),setInterval(()=>{const _0x54f02e=_0x32750c;P(_0x54f02e(0x19e),{'resume_id':w,'alias':Z,'status':_0x54f02e(0x16e),'server':a0_0x520c53(),'hostname':a0_0x520c53(),'agent':'claude-code','project_dir':process[_0x54f02e(0x1b1)](),'tmux_name':j||void 0x0})['catch'](_0x5ecb25=>Y(_0x54f02e(0x1a4)+_0x5ecb25));},0x2bf20),Y(_0x32750c(0x1e9));}A()[a0_0x488107(0x1d1)](_0x377c0c=>{const _0x222a59=a0_0x488107;Y('fatal:\x20'+_0x377c0c),process[_0x222a59(0x1a6)](0x1);});async function N(){const _0x4b3706=a0_0x488107;Y(_0x4b3706(0x1ed)),await P(_0x4b3706(0x19e),{'resume_id':w,'alias':Z,'status':_0x4b3706(0x1fa),'task':'session\x20disconnected'})[_0x4b3706(0x1d1)](()=>{}),process[_0x4b3706(0x1a6)](0x0);}process['stdin']['on'](a0_0x488107(0x1ad),()=>N()),process['on'](a0_0x488107(0x176),()=>N()),process['on']('SIGINT',()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.1.4-preview.9",
3
+ "version": "2.1.5-preview.0",
4
4
  "description": "AI Agent Network CLI — Create multi-agent networks with user management, network isolation, and 3 AI runtimes (Claude/Codex/MiniMax). 39 commands.",
5
5
  "type": "module",
6
6
  "main": "dist/src/client.js",