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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- const a0_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
+ 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,2 +1,2 @@
1
1
  #!/usr/bin/env bun
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());
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());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.1.5-preview.0",
3
+ "version": "2.1.5",
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",