@sleep2agi/agent-network 2.1.5 → 2.1.6-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_0x5dd6(_0x3e14ea,_0x21e236){_0x3e14ea=_0x3e14ea-0x13d;const _0xebe5dd=a0_0xebe5();let _0x5dd6ed=_0xebe5dd[_0x3e14ea];return _0x5dd6ed;}const a0_0x5d35ea=a0_0x5dd6;(function(_0x3fec7f,_0xf9ec92){const _0x1051d1=a0_0x5dd6,_0x424377=_0x3fec7f();while(!![]){try{const _0x61bc8c=-parseInt(_0x1051d1(0x171))/0x1*(-parseInt(_0x1051d1(0x18a))/0x2)+-parseInt(_0x1051d1(0x163))/0x3*(parseInt(_0x1051d1(0x13e))/0x4)+-parseInt(_0x1051d1(0x16d))/0x5*(-parseInt(_0x1051d1(0x14e))/0x6)+-parseInt(_0x1051d1(0x174))/0x7*(-parseInt(_0x1051d1(0x192))/0x8)+parseInt(_0x1051d1(0x16e))/0x9+-parseInt(_0x1051d1(0x165))/0xa+-parseInt(_0x1051d1(0x17f))/0xb*(-parseInt(_0x1051d1(0x190))/0xc);if(_0x61bc8c===_0xf9ec92)break;else _0x424377['push'](_0x424377['shift']());}catch(_0x1e480e){_0x424377['push'](_0x424377['shift']());}}}(a0_0xebe5,0xde99e));function a0_0xebe5(){const _0x318b38=['application/json','10119410nfActB','pop','slice','Bearer\x20','SSE\x20failed:\x20','emit','log','text','2772410makpQb','74889ixfEHo','Authorization','send','44kLnMdz',']\x20[commhub:','messages','10913putQpG','server','cwd','running','reconnectDelay','send_task','application/json,\x20text/event-stream','replace','decode','message','alias','7943034QAUjBI','AbortError','task','connect','ack_inbox','disconnect','agent','report_status','idle','send_message','completed','23246DHRPCq','SSE\x20error:\x20','text/event-stream','result','sdk','type','24HtwzfH','call','1200uyEONi','get_all_status','min','2766040zqrOvy','split','content','tools/call','heartbeatTimer','heartbeat\x20failed:\x20','sdk-','parse','abort','get_inbox','from_session','token','body','disconnected','/events/','read','12plhXSX','heartbeatInterval','resumeId','signal','connected','sleep','url','processInbox','offline','s...','SSE\x20reconnecting\x20in\x20','getAllStatus','status','autoConnect','match','registered','normal','broadcast','connectSSE','now','sseAbort','6pckKzP'];a0_0xebe5=function(){return _0x318b38;};return a0_0xebe5();}import{EventEmitter as a0_0x124cf3}from'events';import{hostname as a0_0x12562a}from'os';class T extends a0_0x124cf3{[a0_0x5d35ea(0x154)];[a0_0x5d35ea(0x17e)];[a0_0x5d35ea(0x149)];[a0_0x5d35ea(0x185)];['resumeId'];[a0_0x5d35ea(0x14f)];[a0_0x5d35ea(0x178)];[a0_0x5d35ea(0x142)];[a0_0x5d35ea(0x162)];[a0_0x5d35ea(0x177)]=!0x1;constructor(_0x296ac1){const _0x809086=a0_0x5d35ea;super();if(this[_0x809086(0x154)]=_0x296ac1[_0x809086(0x154)][_0x809086(0x17b)](/\/$/,''),this[_0x809086(0x17e)]=_0x296ac1['alias'],this[_0x809086(0x149)]=_0x296ac1[_0x809086(0x149)],this[_0x809086(0x185)]=_0x296ac1['agent']||_0x809086(0x18e),this['resumeId']=_0x809086(0x144)+_0x296ac1[_0x809086(0x17e)]+'-'+Date[_0x809086(0x161)]()['toString'](0x24),this[_0x809086(0x14f)]=_0x296ac1[_0x809086(0x14f)]??0x2bf20,this[_0x809086(0x178)]=_0x296ac1[_0x809086(0x178)]??0xbb8,_0x296ac1[_0x809086(0x15b)]!==!0x1)this[_0x809086(0x182)]();}['log'](_0x3f1a06){const _0x405053=a0_0x5d35ea;console[_0x405053(0x16b)]('['+new Date()['toTimeString']()[_0x405053(0x167)](0x0,0x8)+_0x405053(0x172)+this[_0x405053(0x17e)]+']\x20'+_0x3f1a06);}async['call'](_0x34cf84,_0x10c6a7){const _0x1f6a3a=a0_0x5d35ea;let _0x459ba0={'Content-Type':_0x1f6a3a(0x164),'Accept':_0x1f6a3a(0x17a)};if(this['token'])_0x459ba0[_0x1f6a3a(0x16f)]='Bearer\x20'+this[_0x1f6a3a(0x149)];let _0x4c6a0e=await(await fetch(this[_0x1f6a3a(0x154)]+'/mcp',{'method':'POST','headers':_0x459ba0,'body':JSON['stringify']({'jsonrpc':'2.0','id':Date[_0x1f6a3a(0x161)](),'method':_0x1f6a3a(0x141),'params':{'name':_0x34cf84,'arguments':_0x10c6a7}})}))[_0x1f6a3a(0x16c)](),_0x2674d9=_0x4c6a0e[_0x1f6a3a(0x15c)](/data: (.+)/),_0x546e61=_0x2674d9?JSON['parse'](_0x2674d9[0x1]):JSON[_0x1f6a3a(0x145)](_0x4c6a0e),_0x55b7a5=_0x546e61?.[_0x1f6a3a(0x18d)]?.[_0x1f6a3a(0x140)]?.[0x0]?.[_0x1f6a3a(0x16c)];return _0x55b7a5?JSON['parse'](_0x55b7a5):_0x546e61;}async[a0_0x5d35ea(0x182)](){const _0x331270=a0_0x5d35ea;if(this[_0x331270(0x177)])return;this[_0x331270(0x177)]=!0x0,await this['status'](_0x331270(0x187)),this[_0x331270(0x16b)](_0x331270(0x15d)),this[_0x331270(0x142)]=setInterval(()=>{const _0x393179=_0x331270;this['status'](_0x393179(0x187))['catch'](_0x1e7aa6=>this[_0x393179(0x16b)](_0x393179(0x143)+_0x1e7aa6[_0x393179(0x17d)]));},this['heartbeatInterval']),this[_0x331270(0x160)]();}async[a0_0x5d35ea(0x184)](){const _0x501a6b=a0_0x5d35ea;if(this[_0x501a6b(0x177)]=!0x1,this[_0x501a6b(0x162)]?.[_0x501a6b(0x146)](),this[_0x501a6b(0x142)])clearInterval(this['heartbeatTimer']);await this[_0x501a6b(0x15a)](_0x501a6b(0x156))['catch'](()=>{}),this[_0x501a6b(0x16b)](_0x501a6b(0x14b));}async[a0_0x5d35ea(0x170)](_0x251230,_0x1fb5f3,_0x1fb244=a0_0x5d35ea(0x15e)){const _0x1ba133=a0_0x5d35ea;return this[_0x1ba133(0x191)](_0x1ba133(0x179),{'alias':_0x251230,'task':_0x1fb5f3,'priority':_0x1fb244,'from_session':this['alias']});}async[a0_0x5d35ea(0x17d)](_0x8fdfc0,_0x35cdd2){const _0x75ceda=a0_0x5d35ea;return this[_0x75ceda(0x191)](_0x75ceda(0x188),{'alias':_0x8fdfc0,'message':_0x35cdd2,'from_session':this[_0x75ceda(0x17e)]});}async['reply'](_0x5b407a,_0x193ae2,_0x23ebb0=a0_0x5d35ea(0x189)){return this['call']('send_reply',{'in_reply_to':_0x5b407a,'text':_0x193ae2,'status':_0x23ebb0});}async[a0_0x5d35ea(0x15a)](_0x4b6ffa,_0x2447a6){const _0x4bd666=a0_0x5d35ea;return this['call'](_0x4bd666(0x186),{'resume_id':this[_0x4bd666(0x150)],'alias':this[_0x4bd666(0x17e)],'status':_0x4b6ffa,'server':a0_0x12562a(),'hostname':a0_0x12562a(),'agent':this[_0x4bd666(0x185)],'project_dir':process[_0x4bd666(0x176)](),..._0x2447a6});}async[a0_0x5d35ea(0x159)](){const _0x5251db=a0_0x5d35ea;return this[_0x5251db(0x191)](_0x5251db(0x193),{});}async[a0_0x5d35ea(0x15f)](_0x223484,_0x3b99d6){const _0xec9d8a=a0_0x5d35ea;return this['call'](_0xec9d8a(0x15f),{'message':_0x223484,'filter_server':_0x3b99d6?.[_0xec9d8a(0x175)],'filter_status':_0x3b99d6?.[_0xec9d8a(0x15a)]});}async[a0_0x5d35ea(0x160)](){const _0x36dc32=a0_0x5d35ea;let _0x168dac=encodeURIComponent(this[_0x36dc32(0x17e)]),_0x35c9c1=this[_0x36dc32(0x154)]+_0x36dc32(0x14c)+_0x168dac,_0x58fd95=this[_0x36dc32(0x178)];while(this[_0x36dc32(0x177)]){try{this[_0x36dc32(0x162)]=new AbortController();let _0x55296b={'Accept':_0x36dc32(0x18c)};if(this['token'])_0x55296b[_0x36dc32(0x16f)]=_0x36dc32(0x168)+this[_0x36dc32(0x149)];let _0x136a90=await fetch(_0x35c9c1,{'headers':_0x55296b,'signal':this['sseAbort'][_0x36dc32(0x151)]});if(!_0x136a90['ok']||!_0x136a90[_0x36dc32(0x14a)]){this[_0x36dc32(0x16b)](_0x36dc32(0x169)+_0x136a90[_0x36dc32(0x15a)]),await this[_0x36dc32(0x153)](_0x58fd95),_0x58fd95=Math[_0x36dc32(0x13d)](_0x58fd95*1.5,0xea60);continue;}_0x58fd95=this[_0x36dc32(0x178)];let _0x20bfaf=_0x136a90['body']['getReader'](),_0x18ac76=new TextDecoder(),_0xf94b61='';while(this[_0x36dc32(0x177)]){let {done:_0xf617a8,value:_0x591953}=await _0x20bfaf[_0x36dc32(0x14d)]();if(_0xf617a8)break;_0xf94b61+=_0x18ac76[_0x36dc32(0x17c)](_0x591953,{'stream':!0x0});let _0x31f397=_0xf94b61[_0x36dc32(0x13f)]('\x0a');_0xf94b61=_0x31f397[_0x36dc32(0x166)]()||'';for(let _0x89c0de of _0x31f397){if(!_0x89c0de['startsWith']('data:\x20'))continue;try{let _0x15721d=JSON[_0x36dc32(0x145)](_0x89c0de[_0x36dc32(0x167)](0x6));if(_0x15721d[_0x36dc32(0x18f)]===_0x36dc32(0x152)){this['log']('SSE\x20connected'),this[_0x36dc32(0x16a)](_0x36dc32(0x152));continue;}if(_0x15721d[_0x36dc32(0x18f)]==='new_task'||_0x15721d['type']==='new_message'||_0x15721d[_0x36dc32(0x18f)]==='broadcast')await this[_0x36dc32(0x155)]();}catch{}}}}catch(_0x4a4559){if(_0x4a4559['name']===_0x36dc32(0x180))break;this[_0x36dc32(0x16a)]('error',_0x4a4559),this['log'](_0x36dc32(0x18b)+_0x4a4559[_0x36dc32(0x17d)]);}if(this[_0x36dc32(0x177)])this[_0x36dc32(0x16a)](_0x36dc32(0x14b)),this[_0x36dc32(0x16b)](_0x36dc32(0x158)+_0x58fd95/0x3e8+_0x36dc32(0x157)),await this[_0x36dc32(0x153)](_0x58fd95),_0x58fd95=Math[_0x36dc32(0x13d)](_0x58fd95*1.5,0xea60);}}async[a0_0x5d35ea(0x155)](){const _0x463e9f=a0_0x5d35ea;try{let _0x7a63ba=(await this[_0x463e9f(0x191)](_0x463e9f(0x147),{'alias':this[_0x463e9f(0x17e)],'limit':0xa}))?.[_0x463e9f(0x173)]||[];for(let _0x325413 of _0x7a63ba)await this[_0x463e9f(0x191)](_0x463e9f(0x183),{'alias':this[_0x463e9f(0x17e)],'message_id':_0x325413['id']}),this[_0x463e9f(0x16b)]('←\x20'+_0x325413[_0x463e9f(0x148)]+':\x20'+_0x325413['content'][_0x463e9f(0x167)](0x0,0x3c)),this[_0x463e9f(0x16a)](_0x463e9f(0x181),_0x325413),this[_0x463e9f(0x16a)](_0x463e9f(0x17d),_0x325413);}catch(_0x3ae789){this[_0x463e9f(0x16b)]('inbox\x20error:\x20'+_0x3ae789['message']);}}[a0_0x5d35ea(0x153)](_0x1ab373){return new Promise(_0x410f13=>setTimeout(_0x410f13,_0x1ab373));}}var $=T;export{$ as default,T as CommHub};
1
+ const a0_0xbb3ad0=a0_0x2b84;(function(_0x3fdca0,_0x281207){const _0x23392c=a0_0x2b84,_0x2c7000=_0x3fdca0();while(!![]){try{const _0x50ef12=-parseInt(_0x23392c(0x216))/0x1*(parseInt(_0x23392c(0x243))/0x2)+-parseInt(_0x23392c(0x201))/0x3*(-parseInt(_0x23392c(0x1f9))/0x4)+parseInt(_0x23392c(0x206))/0x5+parseInt(_0x23392c(0x1fb))/0x6*(parseInt(_0x23392c(0x1f4))/0x7)+-parseInt(_0x23392c(0x22d))/0x8+-parseInt(_0x23392c(0x230))/0x9+-parseInt(_0x23392c(0x1f0))/0xa*(-parseInt(_0x23392c(0x23a))/0xb);if(_0x50ef12===_0x281207)break;else _0x2c7000['push'](_0x2c7000['shift']());}catch(_0x140919){_0x2c7000['push'](_0x2c7000['shift']());}}}(a0_0x12fa,0xdbb4f));function a0_0x2b84(_0x33ed28,_0x48985d){_0x33ed28=_0x33ed28-0x1ea;const _0x12fad9=a0_0x12fa();let _0x2b847c=_0x12fad9[_0x33ed28];return _0x2b847c;}import{EventEmitter as a0_0x5c1b56}from'events';import{hostname as a0_0x15b471}from'os';class T extends a0_0x5c1b56{['url'];[a0_0xbb3ad0(0x20e)];['token'];['agent'];[a0_0xbb3ad0(0x217)];[a0_0xbb3ad0(0x23f)];[a0_0xbb3ad0(0x204)];[a0_0xbb3ad0(0x1ee)];[a0_0xbb3ad0(0x1f8)];[a0_0xbb3ad0(0x1eb)]=!0x1;constructor(_0x594ad6){const _0x2a6c1a=a0_0xbb3ad0;super();if(this['url']=_0x594ad6[_0x2a6c1a(0x209)][_0x2a6c1a(0x22e)](/\/$/,''),this[_0x2a6c1a(0x20e)]=_0x594ad6[_0x2a6c1a(0x20e)],this[_0x2a6c1a(0x233)]=_0x594ad6[_0x2a6c1a(0x233)],this[_0x2a6c1a(0x225)]=_0x594ad6[_0x2a6c1a(0x225)]||_0x2a6c1a(0x23c),this[_0x2a6c1a(0x217)]='sdk-'+_0x594ad6[_0x2a6c1a(0x20e)]+'-'+Date[_0x2a6c1a(0x1f6)]()[_0x2a6c1a(0x229)](0x24),this['heartbeatInterval']=_0x594ad6['heartbeatInterval']??0x2bf20,this[_0x2a6c1a(0x204)]=_0x594ad6[_0x2a6c1a(0x204)]??0xbb8,_0x594ad6['autoConnect']!==!0x1)this[_0x2a6c1a(0x236)]();}[a0_0xbb3ad0(0x237)](_0x2745af){const _0xa1e4f2=a0_0xbb3ad0;console[_0xa1e4f2(0x237)]('['+new Date()[_0xa1e4f2(0x234)]()['slice'](0x0,0x8)+']\x20[commhub:'+this[_0xa1e4f2(0x20e)]+']\x20'+_0x2745af);}async[a0_0xbb3ad0(0x1ff)](_0x92169,_0x5ab50c){const _0x541f3b=a0_0xbb3ad0;let _0x118634={'Content-Type':_0x541f3b(0x1fe),'Accept':_0x541f3b(0x22a)};if(this['token'])_0x118634[_0x541f3b(0x238)]=_0x541f3b(0x21d)+this[_0x541f3b(0x233)];let _0x4c0f9a=await(await fetch(this[_0x541f3b(0x209)]+_0x541f3b(0x202),{'method':_0x541f3b(0x240),'headers':_0x118634,'body':JSON[_0x541f3b(0x22b)]({'jsonrpc':_0x541f3b(0x200),'id':Date[_0x541f3b(0x1f6)](),'method':_0x541f3b(0x1f7),'params':{'name':_0x92169,'arguments':_0x5ab50c}})}))[_0x541f3b(0x1f3)](),_0x1500e1=_0x4c0f9a[_0x541f3b(0x1f5)](/data: (.+)/),_0x4675d9=_0x1500e1?JSON[_0x541f3b(0x231)](_0x1500e1[0x1]):JSON[_0x541f3b(0x231)](_0x4c0f9a),_0xf7aebb=_0x4675d9?.['result']?.[_0x541f3b(0x22c)]?.[0x0]?.['text'];return _0xf7aebb?JSON[_0x541f3b(0x231)](_0xf7aebb):_0x4675d9;}async['connect'](){const _0x1b81de=a0_0xbb3ad0;if(this[_0x1b81de(0x1eb)])return;this[_0x1b81de(0x1eb)]=!0x0,await this[_0x1b81de(0x224)]('idle'),this['log'](_0x1b81de(0x23b)),this['heartbeatTimer']=setInterval(()=>{const _0x365781=_0x1b81de;this[_0x365781(0x224)](_0x365781(0x219))[_0x365781(0x20c)](_0x17c9b6=>this[_0x365781(0x237)](_0x365781(0x210)+_0x17c9b6[_0x365781(0x1fc)]));},this[_0x1b81de(0x23f)]),this[_0x1b81de(0x239)]();}async[a0_0xbb3ad0(0x20d)](){const _0x1d6e28=a0_0xbb3ad0;if(this[_0x1d6e28(0x1eb)]=!0x1,this[_0x1d6e28(0x1f8)]?.[_0x1d6e28(0x1fd)](),this['heartbeatTimer'])clearInterval(this[_0x1d6e28(0x1ee)]);await this[_0x1d6e28(0x224)](_0x1d6e28(0x22f))[_0x1d6e28(0x20c)](()=>{}),this[_0x1d6e28(0x237)](_0x1d6e28(0x20b));}async[a0_0xbb3ad0(0x207)](_0x409cc0,_0x5b2812,_0x32fae4='normal'){const _0xe18499=a0_0xbb3ad0;return this[_0xe18499(0x1ff)](_0xe18499(0x205),{'alias':_0x409cc0,'task':_0x5b2812,'priority':_0x32fae4,'from_session':this[_0xe18499(0x20e)]});}async[a0_0xbb3ad0(0x1fc)](_0x559e47,_0x5910b1){const _0x91177d=a0_0xbb3ad0;return this[_0x91177d(0x1ff)](_0x91177d(0x213),{'alias':_0x559e47,'message':_0x5910b1,'from_session':this[_0x91177d(0x20e)]});}async[a0_0xbb3ad0(0x235)](_0x285fd5,_0x28dabf,_0x25e067=a0_0xbb3ad0(0x226)){const _0x42700b=a0_0xbb3ad0;return this[_0x42700b(0x1ff)](_0x42700b(0x208),{'in_reply_to':_0x285fd5,'text':_0x28dabf,'status':_0x25e067});}async['status'](_0x29912f,_0x143b75){const _0x1db764=a0_0xbb3ad0;return this[_0x1db764(0x1ff)](_0x1db764(0x23e),{'resume_id':this[_0x1db764(0x217)],'alias':this['alias'],'status':_0x29912f,'server':a0_0x15b471(),'hostname':a0_0x15b471(),'agent':this[_0x1db764(0x225)],'project_dir':process['cwd'](),..._0x143b75});}async[a0_0xbb3ad0(0x221)](){const _0x27be2c=a0_0xbb3ad0;return this[_0x27be2c(0x1ff)]('get_all_status',{});}async[a0_0xbb3ad0(0x218)](_0x31253a,_0x37f807){const _0x5cf538=a0_0xbb3ad0;return this[_0x5cf538(0x1ff)]('broadcast',{'message':_0x31253a,'filter_server':_0x37f807?.[_0x5cf538(0x21e)],'filter_status':_0x37f807?.[_0x5cf538(0x224)]});}async[a0_0xbb3ad0(0x239)](){const _0x523ef3=a0_0xbb3ad0;let _0x5ed391=encodeURIComponent(this['alias']),_0x53f311=this[_0x523ef3(0x209)]+'/events/'+_0x5ed391,_0x2fea82=this[_0x523ef3(0x204)];while(this[_0x523ef3(0x1eb)]){try{this[_0x523ef3(0x1f8)]=new AbortController();let _0x3653fe={'Accept':_0x523ef3(0x21c)};if(this['token'])_0x3653fe[_0x523ef3(0x238)]=_0x523ef3(0x21d)+this[_0x523ef3(0x233)];let _0x44bd9a=await fetch(_0x53f311,{'headers':_0x3653fe,'signal':this[_0x523ef3(0x1f8)][_0x523ef3(0x228)]});if(!_0x44bd9a['ok']||!_0x44bd9a[_0x523ef3(0x1ea)]){this['log'](_0x523ef3(0x227)+_0x44bd9a[_0x523ef3(0x224)]),await this[_0x523ef3(0x21a)](_0x2fea82),_0x2fea82=Math[_0x523ef3(0x20a)](_0x2fea82*1.5,0xea60);continue;}_0x2fea82=this[_0x523ef3(0x204)];let _0x3f5d9c=_0x44bd9a['body'][_0x523ef3(0x1ec)](),_0x2ff00f=new TextDecoder(),_0x50bd42='';while(this[_0x523ef3(0x1eb)]){let {done:_0x55c729,value:_0x2578a7}=await _0x3f5d9c[_0x523ef3(0x21b)]();if(_0x55c729)break;_0x50bd42+=_0x2ff00f[_0x523ef3(0x241)](_0x2578a7,{'stream':!0x0});let _0xa11feb=_0x50bd42[_0x523ef3(0x21f)]('\x0a');_0x50bd42=_0xa11feb[_0x523ef3(0x20f)]()||'';for(let _0x35fd31 of _0xa11feb){if(!_0x35fd31[_0x523ef3(0x1f1)](_0x523ef3(0x1f2)))continue;try{let _0x132c94=JSON['parse'](_0x35fd31[_0x523ef3(0x23d)](0x6));if(_0x132c94[_0x523ef3(0x203)]==='connected'){this[_0x523ef3(0x237)]('SSE\x20connected'),this['emit'](_0x523ef3(0x1fa));continue;}if(_0x132c94['type']===_0x523ef3(0x214)||_0x132c94[_0x523ef3(0x203)]===_0x523ef3(0x232)||_0x132c94['type']===_0x523ef3(0x218))await this[_0x523ef3(0x1ed)]();}catch{}}}}catch(_0x1b52c9){if(_0x1b52c9[_0x523ef3(0x244)]===_0x523ef3(0x212))break;this[_0x523ef3(0x211)]('error',_0x1b52c9),this[_0x523ef3(0x237)](_0x523ef3(0x1ef)+_0x1b52c9[_0x523ef3(0x1fc)]);}if(this[_0x523ef3(0x1eb)])this[_0x523ef3(0x211)](_0x523ef3(0x20b)),this['log']('SSE\x20reconnecting\x20in\x20'+_0x2fea82/0x3e8+_0x523ef3(0x215)),await this[_0x523ef3(0x21a)](_0x2fea82),_0x2fea82=Math[_0x523ef3(0x20a)](_0x2fea82*1.5,0xea60);}}async[a0_0xbb3ad0(0x1ed)](){const _0x301b23=a0_0xbb3ad0;try{let _0x14c6a7=(await this[_0x301b23(0x1ff)]('get_inbox',{'alias':this[_0x301b23(0x20e)],'limit':0xa}))?.[_0x301b23(0x222)]||[];for(let _0x2be002 of _0x14c6a7)await this[_0x301b23(0x1ff)](_0x301b23(0x223),{'alias':this[_0x301b23(0x20e)],'message_id':_0x2be002['id']}),this[_0x301b23(0x237)]('←\x20'+_0x2be002[_0x301b23(0x220)]+':\x20'+_0x2be002[_0x301b23(0x22c)][_0x301b23(0x23d)](0x0,0x3c)),this[_0x301b23(0x211)]('task',_0x2be002),this['emit'](_0x301b23(0x1fc),_0x2be002);}catch(_0x18eb05){this[_0x301b23(0x237)](_0x301b23(0x242)+_0x18eb05[_0x301b23(0x1fc)]);}}[a0_0xbb3ad0(0x21a)](_0x431e25){return new Promise(_0x3a1a32=>setTimeout(_0x3a1a32,_0x431e25));}}var $=T;export{$ as default,T as CommHub};function a0_0x12fa(){const _0x3e0c1d=['startsWith','data:\x20','text','14259hwPLXY','match','now','tools/call','sseAbort','4tbUlDE','connected','1662qNGqDV','message','abort','application/json','call','2.0','4083015JnRNAQ','/mcp','type','reconnectDelay','send_task','5546405cqfjWq','send','send_reply','url','min','disconnected','catch','disconnect','alias','pop','heartbeat\x20failed:\x20','emit','AbortError','send_message','new_task','s...','43RtEPVs','resumeId','broadcast','idle','sleep','read','text/event-stream','Bearer\x20','server','split','from_session','getAllStatus','messages','ack_inbox','status','agent','completed','SSE\x20failed:\x20','signal','toString','application/json,\x20text/event-stream','stringify','content','324376Tnxxmm','replace','offline','10602243auYtMb','parse','new_message','token','toTimeString','reply','connect','log','Authorization','connectSSE','1537833zUkVyM','registered','sdk','slice','report_status','heartbeatInterval','POST','decode','inbox\x20error:\x20','62114pkkbCL','name','body','running','getReader','processInbox','heartbeatTimer','SSE\x20error:\x20','30enNgBT'];a0_0x12fa=function(){return _0x3e0c1d;};return a0_0x12fa();}
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0xfc5b33=a0_0x3830;(function(_0x22e298,_0x4f4b0e){const _0x3116f7=a0_0x3830,_0xbbc1dc=_0x22e298();while(!![]){try{const _0x1903fd=parseInt(_0x3116f7(0x20d))/0x1*(parseInt(_0x3116f7(0x23a))/0x2)+-parseInt(_0x3116f7(0x1d4))/0x3*(-parseInt(_0x3116f7(0x213))/0x4)+parseInt(_0x3116f7(0x21f))/0x5+parseInt(_0x3116f7(0x1e7))/0x6*(-parseInt(_0x3116f7(0x1f0))/0x7)+-parseInt(_0x3116f7(0x214))/0x8+-parseInt(_0x3116f7(0x1e2))/0x9+parseInt(_0x3116f7(0x1d0))/0xa*(parseInt(_0x3116f7(0x1f8))/0xb);if(_0x1903fd===_0x4f4b0e)break;else _0xbbc1dc['push'](_0xbbc1dc['shift']());}catch(_0x546b74){_0xbbc1dc['push'](_0xbbc1dc['shift']());}}}(a0_0x18e5,0xcb094));function a0_0x18e5(){const _0x43c011=['task','catch','result','\x22\x20(','length','ENV:\x20URL=','.env','indexOf','\x20PROJECT_ENV=','starting\x20SSE\x20listener...','then','cwd','.claude/channels/commhub','from','\x20priority=','http://127.0.0.1:9200','type','2025-03-26','error','decode','cancelled','commhub','warning:\x20could\x20not\x20register:\x20','messages','Bearer\x20','exit','tmux\x20display-message\x20-p\x20\x27#S\x27','new_message','trim','heartbeat\x20failed:\x20','10dEJfyN','send_reply','new_task','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','74901JwnbJO','message_id','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','slice','SSE\x20connected\x20as\x20\x22','notification','object','replied','\x20from\x20','commhub_reply','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','.anet','2.0','send_task','4064040LZhNVc','connecting\x20to\x20','stderr','report_status','/events/','5179386zevEdA','params','...\x20TMUX=','stringify','end','/mcp','working','initialize','get_all_status','7ycaiLc','commhub_send_message','token','data:\x20','SIGINT','normal','\x20ALIAS=','notifications/claude/channel','6123799sgJCyM','ready\x20—\x20waiting\x20for\x20events','commhub-channel','commhub_send_task','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','connect','from_session','ack_inbox','set','Task\x20content','low','completed','write','priority','text','blocked','status','find','application/json,\x20text/event-stream','message','88397EMOdsR','read','claude-code','number','content','shutting\x20down,\x20reporting\x20offline...','248sSdxdb','10757768lJytec',':\x20inbox_count=','Authorization','registered\x20as\x20\x22','SSE\x20error:\x20','Current\x20task\x20description','getReader','hub','utf-8','stdin','in_progress','302650vDxOav','body','replace','high','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','\x20CWD=','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','split','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','failed','CommHub\x20init\x20failed:\x20','Reply\x20text\x20/\x20result\x20summary','POST','SSE\x20fatal:\x20','delete','alias','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','get_inbox','application/json','string','commhub_get_all_status','pop','fatal:\x20','init\x20failed:\x20',']\x20[commhub]\x20','none','connected','30WweeBe','MCP\x20stdio\x20connected','SIGTERM','Target\x20session\x20alias','setRequestHandler','Progress\x200-100','idle','parse','startsWith'];a0_0x18e5=function(){return _0x43c011;};return a0_0x18e5();}import{readFileSync as a0_0x396ab7,existsSync as a0_0x24e63d}from'fs';import{randomUUID as a0_0x5a8fed}from'crypto';import{join as a0_0xe37398}from'path';import{hostname as a0_0x2512ed}from'os';import{execSync as a0_0x148943}from'child_process';import{Server as a0_0x51c855}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x4500b5}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x59e01d,CallToolRequestSchema as a0_0x107645}from'@modelcontextprotocol/sdk/types.js';function p(_0x1abd5){const _0x262585=a0_0x3830;if(!a0_0x24e63d(_0x1abd5))return;for(let _0x222f06 of a0_0x396ab7(_0x1abd5,_0x262585(0x21c))[_0x262585(0x226)]('\x0a')){let _0x5264a1=_0x222f06['trim']();if(!_0x5264a1||_0x5264a1['startsWith']('#'))continue;let _0x1bf781=_0x5264a1[_0x262585(0x24a)]('=');if(_0x1bf781<0x0)continue;let _0x334851=_0x5264a1[_0x262585(0x1d7)](0x0,_0x1bf781)[_0x262585(0x1ce)](),_0x16c7da=_0x5264a1[_0x262585(0x1d7)](_0x1bf781+0x1)[_0x262585(0x1ce)]()[_0x262585(0x221)](/^["']|["']$/g,'');if(!process.env[_0x334851])process.env[_0x334851]=_0x16c7da;}}var C=process.env.HOME||'~',T=a0_0xe37398(C,a0_0xfc5b33(0x1be));p(a0_0xe37398(T,a0_0xfc5b33(0x249)));var L=process['cwd']()[a0_0xfc5b33(0x221)](/\//g,'-');p(a0_0xe37398(T,L,a0_0xfc5b33(0x249)));function U(){const _0x52432b=a0_0xfc5b33;try{return a0_0x148943(_0x52432b(0x1cc),{'encoding':'utf-8','timeout':0x7d0})['trim']();}catch{return'';}}function v(){const _0x11cfca=a0_0xfc5b33;try{let _0xe4159c=a0_0xe37398(C,_0x11cfca(0x1df),'config.json');if(a0_0x24e63d(_0xe4159c))return JSON['parse'](a0_0x396ab7(_0xe4159c,_0x11cfca(0x21c)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0xfc5b33(0x21b)]||a0_0xfc5b33(0x1c1),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x2512ed(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x5a8fed(),X=process.env.COMMHUB_TOKEN||H[a0_0xfc5b33(0x1f2)]||'';function Y(_0x19be1c){const _0x435ff9=a0_0xfc5b33;let _0x4ecf01=new Date()['toTimeString']()[_0x435ff9(0x1d7)](0x0,0x8);process[_0x435ff9(0x1e4)][_0x435ff9(0x205)]('['+_0x4ecf01+_0x435ff9(0x237)+_0x19be1c+'\x0a');}function h(_0x2974b6){return new Promise(_0x2b78bb=>setTimeout(_0x2b78bb,_0x2974b6));}Y(a0_0xfc5b33(0x248)+f+a0_0xfc5b33(0x1f6)+Z+'\x20RESUME_ID='+w['slice'](0x0,0x8)+a0_0xfc5b33(0x1e9)+(j||a0_0xfc5b33(0x238))+a0_0xfc5b33(0x224)+process['cwd']()+a0_0xfc5b33(0x1ba)+L);var k=new Map(),K=new a0_0x51c855({'name':a0_0xfc5b33(0x1fa),'version':'0.3.0'},{'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>',a0_0xfc5b33(0x1fc),'Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.',a0_0xfc5b33(0x1d3),'Session\x20alias:\x20'+Z]['join']('\x0a')});K[a0_0xfc5b33(0x23e)](a0_0x59e01d,async()=>({'tools':[{'name':a0_0xfc5b33(0x1dd),'description':a0_0xfc5b33(0x223),'inputSchema':{'type':'object','properties':{'task_id':{'type':a0_0xfc5b33(0x232),'description':a0_0xfc5b33(0x227)},'text':{'type':a0_0xfc5b33(0x232),'description':a0_0xfc5b33(0x22a)},'status':{'type':a0_0xfc5b33(0x232),'enum':['completed',a0_0xfc5b33(0x228),a0_0xfc5b33(0x1c6),a0_0xfc5b33(0x208),'error',a0_0xfc5b33(0x21e)],'description':a0_0xfc5b33(0x22f)}},'required':['text']}},{'name':'commhub_report_status','description':a0_0xfc5b33(0x1fd),'inputSchema':{'type':a0_0xfc5b33(0x1da),'properties':{'status':{'type':a0_0xfc5b33(0x232),'enum':['working',a0_0xfc5b33(0x240),'blocked','error']},'task':{'type':'string','description':a0_0xfc5b33(0x219)},'progress':{'type':a0_0xfc5b33(0x210),'description':a0_0xfc5b33(0x23f)}},'required':[a0_0xfc5b33(0x209)]}},{'name':a0_0xfc5b33(0x1fb),'description':a0_0xfc5b33(0x225),'inputSchema':{'type':a0_0xfc5b33(0x1da),'properties':{'alias':{'type':'string','description':a0_0xfc5b33(0x23d)},'task':{'type':'string','description':a0_0xfc5b33(0x202)},'priority':{'type':a0_0xfc5b33(0x232),'enum':[a0_0xfc5b33(0x222),a0_0xfc5b33(0x1f5),a0_0xfc5b33(0x203)],'description':'Priority\x20(default:\x20normal)'}},'required':[a0_0xfc5b33(0x22e),a0_0xfc5b33(0x243)]}},{'name':a0_0xfc5b33(0x1f1),'description':a0_0xfc5b33(0x1d6),'inputSchema':{'type':a0_0xfc5b33(0x1da),'properties':{'alias':{'type':a0_0xfc5b33(0x232),'description':a0_0xfc5b33(0x23d)},'message':{'type':'string','description':'Message\x20content'}},'required':[a0_0xfc5b33(0x22e),a0_0xfc5b33(0x20c)]}},{'name':'commhub_get_all_status','description':a0_0xfc5b33(0x1de),'inputSchema':{'type':a0_0xfc5b33(0x1da),'properties':{}}}]}));async function P(_0xcfdd2f,_0x19acb8){const _0x144421=a0_0xfc5b33;let _0x37e57e=await fetch(f+_0x144421(0x1ec),{'method':_0x144421(0x22b),'headers':{'Content-Type':_0x144421(0x231),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x144421(0x1ca)+X}:{}},'body':JSON[_0x144421(0x1ea)]({'jsonrpc':_0x144421(0x1e0),'id':0x1,'method':_0x144421(0x1ee),'params':{'protocolVersion':_0x144421(0x1c3),'capabilities':{},'clientInfo':{'name':'commhub-channel','version':'0.3.0'}}})});if(!_0x37e57e['ok']){let _0x5dafa4=await _0x37e57e[_0x144421(0x207)]();return Y(_0x144421(0x229)+_0x37e57e['status']+'\x20'+_0x5dafa4[_0x144421(0x1d7)](0x0,0x64)),{'ok':!0x1,'error':_0x144421(0x236)+_0x37e57e['status']};}await _0x37e57e[_0x144421(0x207)]();let _0x1019e9=(await(await fetch(f+_0x144421(0x1ec),{'method':_0x144421(0x22b),'headers':{'Content-Type':_0x144421(0x231),'Accept':_0x144421(0x20b),...X?{'Authorization':_0x144421(0x1ca)+X}:{}},'body':JSON[_0x144421(0x1ea)]({'jsonrpc':_0x144421(0x1e0),'id':0x2,'method':'tools/call','params':{'name':_0xcfdd2f,'arguments':_0x19acb8}})}))['text']())[_0x144421(0x226)]('\x0a')[_0x144421(0x20a)](_0xf0feda=>_0xf0feda[_0x144421(0x242)]('data:\x20'));if(_0x1019e9){let _0x250434=JSON['parse'](_0x1019e9['slice'](0x6));return _0x250434?.[_0x144421(0x245)]?.[_0x144421(0x211)]?.[0x0]?.[_0x144421(0x207)]?JSON[_0x144421(0x241)](_0x250434['result'][_0x144421(0x211)][0x0][_0x144421(0x207)]):_0x250434;}return{'ok':!0x1,'error':'no\x20response'};}function a0_0x3830(_0xc5ce3a,_0xf3a1bb){_0xc5ce3a=_0xc5ce3a-0x1ba;const _0x18e574=a0_0x18e5();let _0x38303a=_0x18e574[_0xc5ce3a];return _0x38303a;}K['setRequestHandler'](a0_0x107645,async _0x5597d0=>{const _0x4381bd=a0_0xfc5b33;let {name:_0x443435,arguments:_0xb51cdd}=_0x5597d0[_0x4381bd(0x1e8)];if(_0x443435===_0x4381bd(0x1dd)){let {task_id:_0xeb2bf8,text:_0x58a608,status:_0x4ac78c}=_0xb51cdd;if(_0x4ac78c===_0x4381bd(0x204)||_0x4ac78c===_0x4381bd(0x228)||_0x4ac78c===_0x4381bd(0x1c6)){let _0x196518=_0x4ac78c===_0x4381bd(0x204)?_0x4381bd(0x1db):_0x4ac78c,_0x42af30=_0xeb2bf8?k['get'](_0xeb2bf8)||'hub':_0x4381bd(0x21b),_0x1931b4=await P(_0x4381bd(0x1d1),{'alias':_0x42af30,'text':_0x58a608,'in_reply_to':_0xeb2bf8||void 0x0,'status':_0x196518,'from_session':Z});if(_0xeb2bf8)k[_0x4381bd(0x22d)](_0xeb2bf8);return{'content':[{'type':'text','text':JSON['stringify'](_0x1931b4)}]};}let _0x179947=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x4ac78c==='blocked'?_0x4381bd(0x208):_0x4ac78c==='error'?'error':_0x4381bd(0x1ed),'task':_0x58a608[_0x4381bd(0x1d7)](0x0,0xc8),'output':_0x58a608});return{'content':[{'type':'text','text':JSON[_0x4381bd(0x1ea)](_0x179947)}]};}if(_0x443435==='commhub_report_status'){let {status:_0x11cb0d,task:_0x1fbae6,progress:_0x99baeb}=_0xb51cdd,_0x3e4de2=await P(_0x4381bd(0x1e5),{'resume_id':w,'alias':Z,'status':_0x11cb0d,'task':_0x1fbae6,'progress':_0x99baeb});return{'content':[{'type':_0x4381bd(0x207),'text':JSON[_0x4381bd(0x1ea)](_0x3e4de2)}]};}if(_0x443435==='commhub_send_task'){let {alias:_0x162857,task:_0x20ec5b,priority:_0x8f7c09}=_0xb51cdd,_0x41827c=await P(_0x4381bd(0x1e1),{'alias':_0x162857,'task':_0x20ec5b,'priority':_0x8f7c09||_0x4381bd(0x1f5),'from_session':Z});return{'content':[{'type':_0x4381bd(0x207),'text':JSON[_0x4381bd(0x1ea)](_0x41827c)}]};}if(_0x443435===_0x4381bd(0x1f1)){let {alias:_0x412300,message:_0x4f1961}=_0xb51cdd,_0x30856b=await P('send_message',{'alias':_0x412300,'message':_0x4f1961,'from_session':Z});return{'content':[{'type':_0x4381bd(0x207),'text':JSON['stringify'](_0x30856b)}]};}if(_0x443435===_0x4381bd(0x233)){let _0x8ffb12=await P(_0x4381bd(0x1ef),{});return{'content':[{'type':_0x4381bd(0x207),'text':JSON['stringify'](_0x8ffb12)}]};}return{'content':[{'type':_0x4381bd(0x207),'text':JSON['stringify']({'error':'unknown\x20tool'})}]};});async function u(){const _0x1dfa89=a0_0xfc5b33;let _0x5926a1=f+_0x1dfa89(0x1e6)+encodeURIComponent(Z),_0xc63ae0={};if(X)_0xc63ae0[_0x1dfa89(0x216)]=_0x1dfa89(0x1ca)+X;Y(_0x1dfa89(0x1e3)+_0x5926a1);while(!0x0){try{let _0x29bb1b=await fetch(_0x5926a1,{'headers':_0xc63ae0});if(!_0x29bb1b['ok']){Y(_0x1dfa89(0x218)+_0x29bb1b[_0x1dfa89(0x209)]+'\x20'+_0x29bb1b['statusText']),await h(0x1388);continue;}let _0x5cb1bc=_0x29bb1b[_0x1dfa89(0x220)][_0x1dfa89(0x21a)](),_0x312b6c=new TextDecoder(),_0x36067b='';while(!0x0){let {done:_0x35cbfa,value:_0x3f8a22}=await _0x5cb1bc[_0x1dfa89(0x20e)]();if(_0x35cbfa)break;_0x36067b+=_0x312b6c[_0x1dfa89(0x1c5)](_0x3f8a22,{'stream':!0x0});let _0x5cbdd5=_0x36067b[_0x1dfa89(0x226)]('\x0a\x0a');_0x36067b=_0x5cbdd5[_0x1dfa89(0x234)]()||'';for(let _0x5b9573 of _0x5cbdd5){let _0x36e6a7=_0x5b9573[_0x1dfa89(0x226)]('\x0a')[_0x1dfa89(0x20a)](_0x4a52e6=>_0x4a52e6[_0x1dfa89(0x242)](_0x1dfa89(0x1f3)));if(!_0x36e6a7)continue;try{let _0x44eb77=JSON['parse'](_0x36e6a7['slice'](0x6));await S(_0x44eb77);}catch(_0x254bd7){Y('parse\x20error:\x20'+_0x254bd7);}}}Y('SSE\x20stream\x20ended,\x20reconnecting...');}catch(_0x45bc72){Y('SSE\x20connection\x20error:\x20'+_0x45bc72);}await h(0xbb8);}}async function S(_0x137c28){const _0x43689c=a0_0xfc5b33;if(_0x137c28[_0x43689c(0x1c2)]===_0x43689c(0x239)){Y(_0x43689c(0x1d8)+Z+'\x22');return;}if(_0x137c28[_0x43689c(0x1c2)]===_0x43689c(0x1cd)){if(Y('←\x20message\x20from\x20'+_0x137c28[_0x43689c(0x1bf)]+':\x20'+_0x137c28[_0x43689c(0x20c)][_0x43689c(0x1d7)](0x0,0x3c)),await K[_0x43689c(0x1d9)]({'method':_0x43689c(0x1f7),'params':{'content':_0x137c28['message'],'meta':{'sender':_0x137c28['from']||'hub','sender_id':_0x43689c(0x1c7),'user':_0x137c28[_0x43689c(0x1bf)]||_0x43689c(0x21b),'priority':_0x43689c(0x1f5)}}}),_0x137c28[_0x43689c(0x1d5)])await P(_0x43689c(0x200),{'alias':Z,'message_id':_0x137c28[_0x43689c(0x1d5)]});return;}if(_0x137c28[_0x43689c(0x1c2)]===_0x43689c(0x1d2)||_0x137c28[_0x43689c(0x1c2)]==='broadcast'){Y('←\x20'+_0x137c28['type']+_0x43689c(0x215)+_0x137c28['inbox_count']+_0x43689c(0x1c0)+(_0x137c28[_0x43689c(0x206)]||_0x43689c(0x1f5)));let _0x5bf6bc=await P(_0x43689c(0x230),{'alias':Z,'limit':0x5});if(_0x5bf6bc?.['ok']&&_0x5bf6bc[_0x43689c(0x1c9)]?.[_0x43689c(0x247)]>0x0)for(let _0x53c7d5 of _0x5bf6bc[_0x43689c(0x1c9)]){let _0x137285={'sender':_0x53c7d5['from_session']||_0x43689c(0x21b),'sender_id':_0x43689c(0x1c7),'user':_0x53c7d5['from_session']||'hub','task_id':_0x53c7d5['id'],'priority':_0x53c7d5[_0x43689c(0x206)]||_0x43689c(0x1f5)};k[_0x43689c(0x201)](_0x53c7d5['id'],_0x53c7d5[_0x43689c(0x1ff)]||_0x43689c(0x21b)),await K[_0x43689c(0x1d9)]({'method':_0x43689c(0x1f7),'params':{'content':_0x53c7d5[_0x43689c(0x211)],'meta':_0x137285}}),Y('→\x20injected\x20task\x20'+_0x53c7d5['id'][_0x43689c(0x1d7)](0x0,0x8)+_0x43689c(0x1dc)+_0x53c7d5[_0x43689c(0x1ff)]+':\x20'+_0x53c7d5[_0x43689c(0x211)][_0x43689c(0x1d7)](0x0,0x3c)),await P(_0x43689c(0x200),{'alias':Z,'message_id':_0x53c7d5['id']});}}}async function A(){const _0x3fc167=a0_0xfc5b33;let _0x1f9c4c=new a0_0x4500b5();await K[_0x3fc167(0x1fe)](_0x1f9c4c),Y(_0x3fc167(0x23b)),Y(_0x3fc167(0x1bb)),u()[_0x3fc167(0x244)](_0x5df341=>Y(_0x3fc167(0x22c)+_0x5df341)),P('report_status',{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x2512ed(),'hostname':a0_0x2512ed(),'agent':_0x3fc167(0x20f),'project_dir':process[_0x3fc167(0x1bd)](),'tmux_name':j||void 0x0})[_0x3fc167(0x1bc)](()=>Y(_0x3fc167(0x217)+Z+_0x3fc167(0x246)+w[_0x3fc167(0x1d7)](0x0,0x8)+')'))[_0x3fc167(0x244)](_0xbc0b21=>Y(_0x3fc167(0x1c8)+_0xbc0b21)),setInterval(()=>{const _0x8cd6f=_0x3fc167;P(_0x8cd6f(0x1e5),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x2512ed(),'hostname':a0_0x2512ed(),'agent':'claude-code','project_dir':process['cwd'](),'tmux_name':j||void 0x0})[_0x8cd6f(0x244)](_0x59ad05=>Y(_0x8cd6f(0x1cf)+_0x59ad05));},0x2bf20),Y(_0x3fc167(0x1f9));}A()[a0_0xfc5b33(0x244)](_0x258f18=>{const _0x18e5e9=a0_0xfc5b33;Y(_0x18e5e9(0x235)+_0x258f18),process[_0x18e5e9(0x1cb)](0x1);});async function N(){const _0x21b051=a0_0xfc5b33;Y(_0x21b051(0x212)),await P(_0x21b051(0x1e5),{'resume_id':w,'alias':Z,'status':_0x21b051(0x1c4),'task':'session\x20disconnected'})[_0x21b051(0x244)](()=>{}),process[_0x21b051(0x1cb)](0x0);}process[a0_0xfc5b33(0x21d)]['on'](a0_0xfc5b33(0x1eb),()=>N()),process['on'](a0_0xfc5b33(0x23c),()=>N()),process['on'](a0_0xfc5b33(0x1f4),()=>N());
2
+ const a0_0x351f11=a0_0x49ca;(function(_0x22ed0a,_0x1bd563){const _0x3f377c=a0_0x49ca,_0x3d5a83=_0x22ed0a();while(!![]){try{const _0x2ecdec=parseInt(_0x3f377c(0xbc))/0x1+-parseInt(_0x3f377c(0x12d))/0x2*(-parseInt(_0x3f377c(0xaf))/0x3)+parseInt(_0x3f377c(0x100))/0x4+-parseInt(_0x3f377c(0xf1))/0x5*(-parseInt(_0x3f377c(0xd6))/0x6)+-parseInt(_0x3f377c(0x102))/0x7*(parseInt(_0x3f377c(0xd3))/0x8)+-parseInt(_0x3f377c(0xe3))/0x9+-parseInt(_0x3f377c(0xd2))/0xa;if(_0x2ecdec===_0x1bd563)break;else _0x3d5a83['push'](_0x3d5a83['shift']());}catch(_0x73e046){_0x3d5a83['push'](_0x3d5a83['shift']());}}}(a0_0xb269,0xbb915));import{readFileSync as a0_0x1a76b2,existsSync as a0_0x1cd2ad}from'fs';import{randomUUID as a0_0x23172e}from'crypto';import{join as a0_0x43c506}from'path';import{hostname as a0_0x348e80}from'os';import{execSync as a0_0x312f12}from'child_process';import{Server as a0_0x19231d}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x19f304}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x1a0704,CallToolRequestSchema as a0_0x44b358}from'@modelcontextprotocol/sdk/types.js';function p(_0x22fea8){const _0x4bddb9=a0_0x49ca;if(!a0_0x1cd2ad(_0x22fea8))return;for(let _0x127d34 of a0_0x1a76b2(_0x22fea8,'utf-8')[_0x4bddb9(0xbb)]('\x0a')){let _0x57581b=_0x127d34['trim']();if(!_0x57581b||_0x57581b['startsWith']('#'))continue;let _0x1f218c=_0x57581b[_0x4bddb9(0xd9)]('=');if(_0x1f218c<0x0)continue;let _0x4576ad=_0x57581b['slice'](0x0,_0x1f218c)[_0x4bddb9(0x104)](),_0x39af5f=_0x57581b[_0x4bddb9(0xa6)](_0x1f218c+0x1)[_0x4bddb9(0x104)]()[_0x4bddb9(0x10f)](/^["']|["']$/g,'');if(!process.env[_0x4576ad])process.env[_0x4576ad]=_0x39af5f;}}var C=process.env.HOME||'~',T=a0_0x43c506(C,a0_0x351f11(0xd8));p(a0_0x43c506(T,a0_0x351f11(0x124)));var L=process['cwd']()[a0_0x351f11(0x10f)](/\//g,'-');p(a0_0x43c506(T,L,a0_0x351f11(0x124)));function U(){const _0x524df8=a0_0x351f11;try{return a0_0x312f12(_0x524df8(0xdb),{'encoding':_0x524df8(0xf7),'timeout':0x7d0})[_0x524df8(0x104)]();}catch{return'';}}function v(){const _0x15f509=a0_0x351f11;try{let _0x14c83d=a0_0x43c506(C,_0x15f509(0xd7),'config.json');if(a0_0x1cd2ad(_0x14c83d))return JSON[_0x15f509(0x103)](a0_0x1a76b2(_0x14c83d,'utf-8'));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x351f11(0xb5)]||a0_0x351f11(0xce),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x348e80(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x23172e(),X=process.env.COMMHUB_TOKEN||H[a0_0x351f11(0xfa)]||'';function Y(_0x2a9f17){const _0x92d34a=a0_0x351f11;let _0x5ac4b4=new Date()[_0x92d34a(0xf0)]()[_0x92d34a(0xa6)](0x0,0x8);process[_0x92d34a(0xcf)][_0x92d34a(0xc9)]('['+_0x5ac4b4+']\x20[commhub]\x20'+_0x2a9f17+'\x0a');}function a0_0x49ca(_0x4fd8b2,_0x400116){_0x4fd8b2=_0x4fd8b2-0xa6;const _0xb269b=a0_0xb269();let _0x49ca74=_0xb269b[_0x4fd8b2];return _0x49ca74;}function h(_0x58d150){return new Promise(_0x181db2=>setTimeout(_0x181db2,_0x58d150));}function a0_0xb269(){const _0x5c540a=['shutting\x20down,\x20reporting\x20offline...','tmux\x20display-message\x20-p\x20\x27#S\x27','connecting\x20to\x20','Progress\x200-100','type','stdin','claude-code','exit','ENV:\x20URL=','3256551adwKoc','catch','application/json,\x20text/event-stream','MCP\x20stdio\x20connected','SSE\x20error:\x20','fatal:\x20','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','→\x20injected\x20task\x20','Session\x20alias:\x20','working','status','starting\x20SSE\x20listener...','number','toTimeString','108370EjVcDX','unknown\x20tool','Current\x20task\x20description','join','message_id','send_reply','utf-8','report_status','connect','token','params','Bearer\x20','replied','cwd','\x20RESUME_ID=','1726440YiQvRr','2.0','10171EwtAWV','parse','trim','0.3.0','broadcast','getReader','get','session\x20disconnected','commhub','notification','task','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','ack_inbox','replace','←\x20message\x20from\x20','low','startsWith','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','messages','commhub_reply','delete','heartbeat\x20failed:\x20','application/json','stringify','Message\x20content','commhub_send_task','commhub_get_all_status','parse\x20error:\x20','in_progress','string','commhub_report_status','from','result','ready\x20—\x20waiting\x20for\x20events','.env','failed','setRequestHandler','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','blocked','Authorization','Reply\x20text\x20/\x20result\x20summary','find','SSE\x20connected\x20as\x20\x22','6MPtdxz','/events/','set','send_task','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','content','commhub-channel','Target\x20session\x20alias','read','idle','slice','...\x20TMUX=','then','registered\x20as\x20\x22','pop','object','completed','CommHub\x20init\x20failed:\x20','Task\x20content','239313cMEXWy','text','statusText','priority','cancelled','SIGTERM','hub','\x20from\x20','alias','decode','\x22\x20(','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','split','242673HMbfuj','body','message','Priority\x20(default:\x20normal)','from_session','\x20CWD=','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','send_message','high','none','notifications/claude/channel','length','SIGINT','write','\x20priority=','error','connected','initialize','http://127.0.0.1:9200','stderr','normal','POST','3306610kylMva','4744tuxwTc','no\x20response','new_message','390AbUQEO','.anet','.claude/channels/commhub','indexOf'];a0_0xb269=function(){return _0x5c540a;};return a0_0xb269();}Y(a0_0x351f11(0xe2)+f+'\x20ALIAS='+Z+a0_0x351f11(0xff)+w['slice'](0x0,0x8)+a0_0x351f11(0xa7)+(j||a0_0x351f11(0xc5))+a0_0x351f11(0xc1)+process['cwd']()+'\x20PROJECT_ENV='+L);var k=new Map(),K=new a0_0x19231d({'name':a0_0x351f11(0x133),'version':a0_0x351f11(0x105)},{'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>',a0_0x351f11(0x127),a0_0x351f11(0xba),a0_0x351f11(0x113),a0_0x351f11(0xeb)+Z][a0_0x351f11(0xf4)]('\x0a')});K[a0_0x351f11(0x126)](a0_0x1a0704,async()=>({'tools':[{'name':a0_0x351f11(0x115),'description':'Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','inputSchema':{'type':a0_0x351f11(0xab),'properties':{'task_id':{'type':a0_0x351f11(0x11f),'description':'The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)'},'text':{'type':'string','description':a0_0x351f11(0x12a)},'status':{'type':'string','enum':[a0_0x351f11(0xac),a0_0x351f11(0x125),a0_0x351f11(0xb3),a0_0x351f11(0x128),'error',a0_0x351f11(0x11e)],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':[a0_0x351f11(0xb0)]}},{'name':a0_0x351f11(0x120),'description':a0_0x351f11(0xc2),'inputSchema':{'type':a0_0x351f11(0xab),'properties':{'status':{'type':a0_0x351f11(0x11f),'enum':[a0_0x351f11(0xec),a0_0x351f11(0x136),'blocked',a0_0x351f11(0xcb)]},'task':{'type':a0_0x351f11(0x11f),'description':a0_0x351f11(0xf3)},'progress':{'type':a0_0x351f11(0xef),'description':a0_0x351f11(0xdd)}},'required':[a0_0x351f11(0xed)]}},{'name':a0_0x351f11(0x11b),'description':a0_0x351f11(0xe9),'inputSchema':{'type':a0_0x351f11(0xab),'properties':{'alias':{'type':'string','description':a0_0x351f11(0x134)},'task':{'type':a0_0x351f11(0x11f),'description':a0_0x351f11(0xae)},'priority':{'type':a0_0x351f11(0x11f),'enum':[a0_0x351f11(0xc4),a0_0x351f11(0xd0),a0_0x351f11(0x111)],'description':a0_0x351f11(0xbf)}},'required':['alias',a0_0x351f11(0x10c)]}},{'name':'commhub_send_message','description':a0_0x351f11(0x10d),'inputSchema':{'type':a0_0x351f11(0xab),'properties':{'alias':{'type':a0_0x351f11(0x11f),'description':a0_0x351f11(0x134)},'message':{'type':a0_0x351f11(0x11f),'description':a0_0x351f11(0x11a)}},'required':[a0_0x351f11(0xb7),a0_0x351f11(0xbe)]}},{'name':a0_0x351f11(0x11c),'description':a0_0x351f11(0x131),'inputSchema':{'type':a0_0x351f11(0xab),'properties':{}}}]}));async function P(_0x257743,_0x41046d){const _0x42026e=a0_0x351f11;let _0x13f529=await fetch(f+'/mcp',{'method':_0x42026e(0xd1),'headers':{'Content-Type':_0x42026e(0x118),'Accept':_0x42026e(0xe5),...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON[_0x42026e(0x119)]({'jsonrpc':_0x42026e(0x101),'id':0x1,'method':_0x42026e(0xcd),'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':'commhub-channel','version':_0x42026e(0x105)}}})});if(!_0x13f529['ok']){let _0x59867e=await _0x13f529['text']();return Y(_0x42026e(0xad)+_0x13f529['status']+'\x20'+_0x59867e['slice'](0x0,0x64)),{'ok':!0x1,'error':'init\x20failed:\x20'+_0x13f529['status']};}await _0x13f529[_0x42026e(0xb0)]();let _0x2ef0a6=(await(await fetch(f+'/mcp',{'method':_0x42026e(0xd1),'headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x42026e(0xfc)+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x42026e(0x101),'id':0x2,'method':'tools/call','params':{'name':_0x257743,'arguments':_0x41046d}})}))[_0x42026e(0xb0)]())['split']('\x0a')['find'](_0x4788cb=>_0x4788cb[_0x42026e(0x112)]('data:\x20'));if(_0x2ef0a6){let _0x58285e=JSON[_0x42026e(0x103)](_0x2ef0a6['slice'](0x6));return _0x58285e?.[_0x42026e(0x122)]?.[_0x42026e(0x132)]?.[0x0]?.[_0x42026e(0xb0)]?JSON[_0x42026e(0x103)](_0x58285e[_0x42026e(0x122)][_0x42026e(0x132)][0x0][_0x42026e(0xb0)]):_0x58285e;}return{'ok':!0x1,'error':_0x42026e(0xd4)};}K[a0_0x351f11(0x126)](a0_0x44b358,async _0x340c26=>{const _0x524d00=a0_0x351f11;let {name:_0x39f733,arguments:_0x3cdede}=_0x340c26[_0x524d00(0xfb)];if(_0x39f733==='commhub_reply'){let {task_id:_0x485cdd,text:_0xb5ff97,status:_0x2e6b0b}=_0x3cdede;if(_0x2e6b0b===_0x524d00(0xac)||_0x2e6b0b===_0x524d00(0x125)||_0x2e6b0b===_0x524d00(0xb3)){let _0x1a85e3=_0x2e6b0b===_0x524d00(0xac)?_0x524d00(0xfd):_0x2e6b0b,_0x3a58be=_0x485cdd?k[_0x524d00(0x108)](_0x485cdd)||_0x524d00(0xb5):_0x524d00(0xb5),_0x4c97ac=await P(_0x524d00(0xf6),{'alias':_0x3a58be,'text':_0xb5ff97,'in_reply_to':_0x485cdd||void 0x0,'status':_0x1a85e3,'from_session':Z});if(_0x485cdd)k[_0x524d00(0x116)](_0x485cdd);return{'content':[{'type':_0x524d00(0xb0),'text':JSON['stringify'](_0x4c97ac)}]};}let _0x3eff8d=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x2e6b0b==='blocked'?'blocked':_0x2e6b0b===_0x524d00(0xcb)?_0x524d00(0xcb):'working','task':_0xb5ff97[_0x524d00(0xa6)](0x0,0xc8),'output':_0xb5ff97});return{'content':[{'type':'text','text':JSON[_0x524d00(0x119)](_0x3eff8d)}]};}if(_0x39f733===_0x524d00(0x120)){let {status:_0x11b92c,task:_0x4d25f0,progress:_0x477b41}=_0x3cdede,_0x1ec9a2=await P(_0x524d00(0xf8),{'resume_id':w,'alias':Z,'status':_0x11b92c,'task':_0x4d25f0,'progress':_0x477b41});return{'content':[{'type':_0x524d00(0xb0),'text':JSON['stringify'](_0x1ec9a2)}]};}if(_0x39f733===_0x524d00(0x11b)){let {alias:_0x362109,task:_0x27c14d,priority:_0x4892a2}=_0x3cdede,_0x492b04=await P(_0x524d00(0x130),{'alias':_0x362109,'task':_0x27c14d,'priority':_0x4892a2||_0x524d00(0xd0),'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x524d00(0x119)](_0x492b04)}]};}if(_0x39f733==='commhub_send_message'){let {alias:_0x58d0fc,message:_0x2bb205}=_0x3cdede,_0x46b454=await P(_0x524d00(0xc3),{'alias':_0x58d0fc,'message':_0x2bb205,'from_session':Z});return{'content':[{'type':_0x524d00(0xb0),'text':JSON['stringify'](_0x46b454)}]};}if(_0x39f733==='commhub_get_all_status'){let _0x4439aa=await P('get_all_status',{});return{'content':[{'type':_0x524d00(0xb0),'text':JSON[_0x524d00(0x119)](_0x4439aa)}]};}return{'content':[{'type':'text','text':JSON[_0x524d00(0x119)]({'error':_0x524d00(0xf2)})}]};});async function u(){const _0x597428=a0_0x351f11;let _0x12d3a2=f+_0x597428(0x12e)+encodeURIComponent(Z),_0x58e07a={};if(X)_0x58e07a[_0x597428(0x129)]='Bearer\x20'+X;Y(_0x597428(0xdc)+_0x12d3a2);while(!0x0){try{let _0x2916be=await fetch(_0x12d3a2,{'headers':_0x58e07a});if(!_0x2916be['ok']){Y(_0x597428(0xe7)+_0x2916be[_0x597428(0xed)]+'\x20'+_0x2916be[_0x597428(0xb1)]),await h(0x1388);continue;}let _0x3ec6f1=_0x2916be[_0x597428(0xbd)][_0x597428(0x107)](),_0x58e6f5=new TextDecoder(),_0x11275d='';while(!0x0){let {done:_0x41a197,value:_0x29682e}=await _0x3ec6f1[_0x597428(0x135)]();if(_0x41a197)break;_0x11275d+=_0x58e6f5[_0x597428(0xb8)](_0x29682e,{'stream':!0x0});let _0x114ed6=_0x11275d['split']('\x0a\x0a');_0x11275d=_0x114ed6[_0x597428(0xaa)]()||'';for(let _0x170ae8 of _0x114ed6){let _0x32132e=_0x170ae8[_0x597428(0xbb)]('\x0a')[_0x597428(0x12b)](_0x30227c=>_0x30227c[_0x597428(0x112)]('data:\x20'));if(!_0x32132e)continue;try{let _0x52f729=JSON[_0x597428(0x103)](_0x32132e[_0x597428(0xa6)](0x6));await S(_0x52f729);}catch(_0xd0bbb8){Y(_0x597428(0x11d)+_0xd0bbb8);}}}Y('SSE\x20stream\x20ended,\x20reconnecting...');}catch(_0x3d3278){Y('SSE\x20connection\x20error:\x20'+_0x3d3278);}await h(0xbb8);}}async function S(_0xedc6cb){const _0x137dd9=a0_0x351f11;if(_0xedc6cb['type']===_0x137dd9(0xcc)){Y(_0x137dd9(0x12c)+Z+'\x22');return;}if(_0xedc6cb[_0x137dd9(0xde)]===_0x137dd9(0xd5)){if(Y(_0x137dd9(0x110)+_0xedc6cb[_0x137dd9(0x121)]+':\x20'+_0xedc6cb[_0x137dd9(0xbe)][_0x137dd9(0xa6)](0x0,0x3c)),await K[_0x137dd9(0x10b)]({'method':'notifications/claude/channel','params':{'content':_0xedc6cb[_0x137dd9(0xbe)],'meta':{'sender':_0xedc6cb[_0x137dd9(0x121)]||_0x137dd9(0xb5),'sender_id':_0x137dd9(0x10a),'user':_0xedc6cb[_0x137dd9(0x121)]||'hub','priority':_0x137dd9(0xd0)}}}),_0xedc6cb[_0x137dd9(0xf5)])await P(_0x137dd9(0x10e),{'alias':Z,'message_id':_0xedc6cb['message_id']});return;}if(_0xedc6cb['type']==='new_task'||_0xedc6cb[_0x137dd9(0xde)]===_0x137dd9(0x106)){Y('←\x20'+_0xedc6cb[_0x137dd9(0xde)]+':\x20inbox_count='+_0xedc6cb['inbox_count']+_0x137dd9(0xca)+(_0xedc6cb[_0x137dd9(0xb2)]||_0x137dd9(0xd0)));let _0xdde97c=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0xdde97c?.['ok']&&_0xdde97c[_0x137dd9(0x114)]?.[_0x137dd9(0xc7)]>0x0)for(let _0x1fd642 of _0xdde97c[_0x137dd9(0x114)]){let _0x11c27f={'sender':_0x1fd642[_0x137dd9(0xc0)]||_0x137dd9(0xb5),'sender_id':'commhub','user':_0x1fd642['from_session']||_0x137dd9(0xb5),'task_id':_0x1fd642['id'],'priority':_0x1fd642['priority']||_0x137dd9(0xd0)};k[_0x137dd9(0x12f)](_0x1fd642['id'],_0x1fd642[_0x137dd9(0xc0)]||'hub'),await K[_0x137dd9(0x10b)]({'method':_0x137dd9(0xc6),'params':{'content':_0x1fd642[_0x137dd9(0x132)],'meta':_0x11c27f}}),Y(_0x137dd9(0xea)+_0x1fd642['id'][_0x137dd9(0xa6)](0x0,0x8)+_0x137dd9(0xb6)+_0x1fd642[_0x137dd9(0xc0)]+':\x20'+_0x1fd642[_0x137dd9(0x132)][_0x137dd9(0xa6)](0x0,0x3c)),await P(_0x137dd9(0x10e),{'alias':Z,'message_id':_0x1fd642['id']});}}}async function A(){const _0x331ca0=a0_0x351f11;let _0xee9870=new a0_0x19f304();await K[_0x331ca0(0xf9)](_0xee9870),Y(_0x331ca0(0xe6)),Y(_0x331ca0(0xee)),u()['catch'](_0x45a825=>Y('SSE\x20fatal:\x20'+_0x45a825)),P('report_status',{'resume_id':w,'alias':Z,'status':_0x331ca0(0x136),'server':a0_0x348e80(),'hostname':a0_0x348e80(),'agent':_0x331ca0(0xe0),'project_dir':process[_0x331ca0(0xfe)](),'tmux_name':j||void 0x0})[_0x331ca0(0xa8)](()=>Y(_0x331ca0(0xa9)+Z+_0x331ca0(0xb9)+w['slice'](0x0,0x8)+')'))[_0x331ca0(0xe4)](_0x5c8306=>Y('warning:\x20could\x20not\x20register:\x20'+_0x5c8306)),setInterval(()=>{const _0x23b2e5=_0x331ca0;P(_0x23b2e5(0xf8),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x348e80(),'hostname':a0_0x348e80(),'agent':_0x23b2e5(0xe0),'project_dir':process[_0x23b2e5(0xfe)](),'tmux_name':j||void 0x0})['catch'](_0x221d85=>Y(_0x23b2e5(0x117)+_0x221d85));},0x2bf20),Y(_0x331ca0(0x123));}A()[a0_0x351f11(0xe4)](_0x4d94cb=>{const _0x56435f=a0_0x351f11;Y(_0x56435f(0xe8)+_0x4d94cb),process['exit'](0x1);});async function N(){const _0x8fe95=a0_0x351f11;Y(_0x8fe95(0xda)),await P('report_status',{'resume_id':w,'alias':Z,'status':_0x8fe95(0xcb),'task':_0x8fe95(0x109)})['catch'](()=>{}),process[_0x8fe95(0xe1)](0x0);}process[a0_0x351f11(0xdf)]['on']('end',()=>N()),process['on'](a0_0x351f11(0xb4),()=>N()),process['on'](a0_0x351f11(0xc8),()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.1.5",
3
+ "version": "2.1.6-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",