@sleep2agi/agent-network 2.2.3-preview.0 → 2.2.4-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_0x4b95(){const _0x52e522=['type','report_status','6SNtwpD','7TJcfKa','4RHZGEw','4386800kWsnmF','cwd','result','autoConnect','url','307345YKMEvJ','startsWith','status','sseAbort','server','alias','catch','POST','normal','decode','toTimeString','disconnect','s...','abort','heartbeatInterval','completed','broadcast','replace','pop','1384696yRweCs','getAllStatus','message','get_inbox','/events/','body','read','idle','SSE\x20connected','task','/mcp','22410uWfGzO','send_message','offline','application/json','slice','SSE\x20failed:\x20','log','connected','split','registered','Authorization','agent','toString','sdk-','new_task','messages','stringify','parse','data:\x20','11720462XctyKV','12Eegeym','new_message','tools/call','emit','call','18729FcvENt','content','send','2.0','send_reply','1719OcGfen','running','heartbeat\x20failed:\x20','heartbeatTimer','2zVqcmw','disconnected','Bearer\x20','reconnectDelay','token','min','connect','text','application/json,\x20text/event-stream','reply','sleep','match','error','send_task','2356825CotkWq','resumeId','SSE\x20error:\x20'];a0_0x4b95=function(){return _0x52e522;};return a0_0x4b95();}const a0_0x4977ce=a0_0x1b6f;(function(_0x17e80e,_0x147dbd){const _0x28f046=a0_0x1b6f,_0x2ed8b0=_0x17e80e();while(!![]){try{const _0x456278=parseInt(_0x28f046(0x160))/0x1*(-parseInt(_0x28f046(0x145))/0x2)+parseInt(_0x28f046(0x197))/0x3*(-parseInt(_0x28f046(0x15a))/0x4)+-parseInt(_0x28f046(0x153))/0x5*(parseInt(_0x28f046(0x158))/0x6)+parseInt(_0x28f046(0x159))/0x7*(parseInt(_0x28f046(0x173))/0x8)+parseInt(_0x28f046(0x19c))/0x9*(-parseInt(_0x28f046(0x17e))/0xa)+parseInt(_0x28f046(0x15b))/0xb+-parseInt(_0x28f046(0x192))/0xc*(-parseInt(_0x28f046(0x191))/0xd);if(_0x456278===_0x147dbd)break;else _0x2ed8b0['push'](_0x2ed8b0['shift']());}catch(_0x4e21f9){_0x2ed8b0['push'](_0x2ed8b0['shift']());}}}(a0_0x4b95,0x3f97d));import{EventEmitter as a0_0x18fa14}from'events';import{hostname as a0_0x387df7}from'os';class T extends a0_0x18fa14{[a0_0x4977ce(0x15f)];[a0_0x4977ce(0x165)];[a0_0x4977ce(0x149)];[a0_0x4977ce(0x189)];[a0_0x4977ce(0x154)];['heartbeatInterval'];[a0_0x4977ce(0x148)];[a0_0x4977ce(0x144)];[a0_0x4977ce(0x163)];['running']=!0x1;constructor(_0x3ca0b8){const _0x3165f9=a0_0x4977ce;super();if(this[_0x3165f9(0x15f)]=_0x3ca0b8[_0x3165f9(0x15f)][_0x3165f9(0x171)](/\/$/,''),this[_0x3165f9(0x165)]=_0x3ca0b8[_0x3165f9(0x165)],this[_0x3165f9(0x149)]=_0x3ca0b8[_0x3165f9(0x149)],this[_0x3165f9(0x189)]=_0x3ca0b8[_0x3165f9(0x189)]||'sdk',this[_0x3165f9(0x154)]=_0x3165f9(0x18b)+_0x3ca0b8[_0x3165f9(0x165)]+'-'+Date['now']()[_0x3165f9(0x18a)](0x24),this[_0x3165f9(0x16e)]=_0x3ca0b8[_0x3165f9(0x16e)]??0x2bf20,this['reconnectDelay']=_0x3ca0b8['reconnectDelay']??0xbb8,_0x3ca0b8[_0x3165f9(0x15e)]!==!0x1)this[_0x3165f9(0x14b)]();}['log'](_0x3d29e8){const _0x36163a=a0_0x4977ce;console[_0x36163a(0x184)]('['+new Date()[_0x36163a(0x16a)]()[_0x36163a(0x182)](0x0,0x8)+']\x20[commhub:'+this['alias']+']\x20'+_0x3d29e8);}async[a0_0x4977ce(0x196)](_0x1d0e2d,_0x447b31){const _0x17fed5=a0_0x4977ce;let _0x13c492={'Content-Type':_0x17fed5(0x181),'Accept':_0x17fed5(0x14d)};if(this[_0x17fed5(0x149)])_0x13c492[_0x17fed5(0x188)]='Bearer\x20'+this[_0x17fed5(0x149)];let _0x4410b3=await(await fetch(this[_0x17fed5(0x15f)]+_0x17fed5(0x17d),{'method':_0x17fed5(0x167),'headers':_0x13c492,'body':JSON[_0x17fed5(0x18e)]({'jsonrpc':_0x17fed5(0x19a),'id':Date['now'](),'method':_0x17fed5(0x194),'params':{'name':_0x1d0e2d,'arguments':_0x447b31}})}))[_0x17fed5(0x14c)](),_0x3d4367=_0x4410b3[_0x17fed5(0x150)](/data: (.+)/),_0x369053=_0x3d4367?JSON[_0x17fed5(0x18f)](_0x3d4367[0x1]):JSON[_0x17fed5(0x18f)](_0x4410b3),_0x579f25=_0x369053?.[_0x17fed5(0x15d)]?.[_0x17fed5(0x198)]?.[0x0]?.[_0x17fed5(0x14c)];return _0x579f25?JSON[_0x17fed5(0x18f)](_0x579f25):_0x369053;}async[a0_0x4977ce(0x14b)](){const _0x19057c=a0_0x4977ce;if(this[_0x19057c(0x19d)])return;this[_0x19057c(0x19d)]=!0x0,await this[_0x19057c(0x162)](_0x19057c(0x17a)),this[_0x19057c(0x184)](_0x19057c(0x187)),this[_0x19057c(0x144)]=setInterval(()=>{const _0x292f56=_0x19057c;this[_0x292f56(0x162)](_0x292f56(0x17a))[_0x292f56(0x166)](_0x229e99=>this[_0x292f56(0x184)](_0x292f56(0x19e)+_0x229e99['message']));},this[_0x19057c(0x16e)]),this['connectSSE']();}async[a0_0x4977ce(0x16b)](){const _0x5aeb2f=a0_0x4977ce;if(this[_0x5aeb2f(0x19d)]=!0x1,this[_0x5aeb2f(0x163)]?.[_0x5aeb2f(0x16d)](),this[_0x5aeb2f(0x144)])clearInterval(this[_0x5aeb2f(0x144)]);await this['status'](_0x5aeb2f(0x180))[_0x5aeb2f(0x166)](()=>{}),this[_0x5aeb2f(0x184)](_0x5aeb2f(0x146));}async[a0_0x4977ce(0x199)](_0x57c2cd,_0x2c89a9,_0x4b74f4=a0_0x4977ce(0x168)){const _0x37ab81=a0_0x4977ce;return this[_0x37ab81(0x196)](_0x37ab81(0x152),{'alias':_0x57c2cd,'task':_0x2c89a9,'priority':_0x4b74f4,'from_session':this[_0x37ab81(0x165)]});}async['message'](_0x442530,_0x337924){const _0x3a6d2a=a0_0x4977ce;return this[_0x3a6d2a(0x196)](_0x3a6d2a(0x17f),{'alias':_0x442530,'message':_0x337924,'from_session':this[_0x3a6d2a(0x165)]});}async[a0_0x4977ce(0x14e)](_0x572c66,_0x53b5db,_0x3ca623=a0_0x4977ce(0x16f)){const _0x20ae6b=a0_0x4977ce;return this['call'](_0x20ae6b(0x19b),{'in_reply_to':_0x572c66,'text':_0x53b5db,'status':_0x3ca623});}async[a0_0x4977ce(0x162)](_0x39244d,_0x294aa7){const _0xc50be0=a0_0x4977ce;return this[_0xc50be0(0x196)](_0xc50be0(0x157),{'resume_id':this['resumeId'],'alias':this[_0xc50be0(0x165)],'status':_0x39244d,'server':a0_0x387df7(),'hostname':a0_0x387df7(),'agent':this[_0xc50be0(0x189)],'project_dir':process[_0xc50be0(0x15c)](),..._0x294aa7});}async[a0_0x4977ce(0x174)](){return this['call']('get_all_status',{});}async[a0_0x4977ce(0x170)](_0x226310,_0x50df45){const _0xf810d2=a0_0x4977ce;return this['call'](_0xf810d2(0x170),{'message':_0x226310,'filter_server':_0x50df45?.[_0xf810d2(0x164)],'filter_status':_0x50df45?.[_0xf810d2(0x162)]});}async['connectSSE'](){const _0x4a1913=a0_0x4977ce;let _0x594f42=encodeURIComponent(this['alias']),_0x4df422=this[_0x4a1913(0x15f)]+_0x4a1913(0x177)+_0x594f42,_0x1b3074=this[_0x4a1913(0x148)];while(this[_0x4a1913(0x19d)]){try{this[_0x4a1913(0x163)]=new AbortController();let _0x126713={'Accept':'text/event-stream'};if(this[_0x4a1913(0x149)])_0x126713[_0x4a1913(0x188)]=_0x4a1913(0x147)+this['token'];let _0x1b0c84=await fetch(_0x4df422,{'headers':_0x126713,'signal':this[_0x4a1913(0x163)]['signal']});if(!_0x1b0c84['ok']||!_0x1b0c84[_0x4a1913(0x178)]){this[_0x4a1913(0x184)](_0x4a1913(0x183)+_0x1b0c84[_0x4a1913(0x162)]),await this[_0x4a1913(0x14f)](_0x1b3074),_0x1b3074=Math[_0x4a1913(0x14a)](_0x1b3074*1.5,0xea60);continue;}_0x1b3074=this[_0x4a1913(0x148)];let _0x34c414=_0x1b0c84[_0x4a1913(0x178)]['getReader'](),_0x143ade=new TextDecoder(),_0x185232='';while(this[_0x4a1913(0x19d)]){let {done:_0x7f66ba,value:_0x49660e}=await _0x34c414[_0x4a1913(0x179)]();if(_0x7f66ba)break;_0x185232+=_0x143ade[_0x4a1913(0x169)](_0x49660e,{'stream':!0x0});let _0x265f38=_0x185232[_0x4a1913(0x186)]('\x0a');_0x185232=_0x265f38[_0x4a1913(0x172)]()||'';for(let _0x5ecc91 of _0x265f38){if(!_0x5ecc91[_0x4a1913(0x161)](_0x4a1913(0x190)))continue;try{let _0x4e59b8=JSON[_0x4a1913(0x18f)](_0x5ecc91['slice'](0x6));if(_0x4e59b8[_0x4a1913(0x156)]===_0x4a1913(0x185)){this[_0x4a1913(0x184)](_0x4a1913(0x17b)),this[_0x4a1913(0x195)]('connected');continue;}if(_0x4e59b8[_0x4a1913(0x156)]===_0x4a1913(0x18c)||_0x4e59b8['type']===_0x4a1913(0x193)||_0x4e59b8[_0x4a1913(0x156)]==='broadcast')await this['processInbox']();}catch{}}}}catch(_0x5e4364){if(_0x5e4364['name']==='AbortError')break;this[_0x4a1913(0x195)](_0x4a1913(0x151),_0x5e4364),this[_0x4a1913(0x184)](_0x4a1913(0x155)+_0x5e4364[_0x4a1913(0x175)]);}if(this[_0x4a1913(0x19d)])this[_0x4a1913(0x195)](_0x4a1913(0x146)),this[_0x4a1913(0x184)]('SSE\x20reconnecting\x20in\x20'+_0x1b3074/0x3e8+_0x4a1913(0x16c)),await this[_0x4a1913(0x14f)](_0x1b3074),_0x1b3074=Math[_0x4a1913(0x14a)](_0x1b3074*1.5,0xea60);}}async['processInbox'](){const _0x100879=a0_0x4977ce;try{let _0x4cddaf=(await this['call'](_0x100879(0x176),{'alias':this[_0x100879(0x165)],'limit':0xa}))?.[_0x100879(0x18d)]||[];for(let _0x29df34 of _0x4cddaf)await this[_0x100879(0x196)]('ack_inbox',{'alias':this[_0x100879(0x165)],'message_id':_0x29df34['id']}),this[_0x100879(0x184)]('←\x20'+_0x29df34['from_session']+':\x20'+_0x29df34[_0x100879(0x198)]['slice'](0x0,0x3c)),this[_0x100879(0x195)](_0x100879(0x17c),_0x29df34),this[_0x100879(0x195)](_0x100879(0x175),_0x29df34);}catch(_0x331cd6){this['log']('inbox\x20error:\x20'+_0x331cd6[_0x100879(0x175)]);}}[a0_0x4977ce(0x14f)](_0x3a5dc){return new Promise(_0xd22782=>setTimeout(_0xd22782,_0x3a5dc));}}var $=T;function a0_0x1b6f(_0x2da118,_0x3ab116){_0x2da118=_0x2da118-0x144;const _0x4b9532=a0_0x4b95();let _0x1b6ffd=_0x4b9532[_0x2da118];return _0x1b6ffd;}export{$ as default,T as CommHub};
1
+ const a0_0x471e6e=a0_0x2abd;(function(_0x464f2b,_0x3f7ad4){const _0x4d9374=a0_0x2abd,_0x50f11d=_0x464f2b();while(!![]){try{const _0x4bef6d=-parseInt(_0x4d9374(0xab))/0x1*(-parseInt(_0x4d9374(0xc6))/0x2)+parseInt(_0x4d9374(0xd5))/0x3*(-parseInt(_0x4d9374(0xf4))/0x4)+-parseInt(_0x4d9374(0xc9))/0x5*(parseInt(_0x4d9374(0xb4))/0x6)+parseInt(_0x4d9374(0xd7))/0x7+parseInt(_0x4d9374(0xe2))/0x8*(-parseInt(_0x4d9374(0xed))/0x9)+parseInt(_0x4d9374(0xe3))/0xa*(parseInt(_0x4d9374(0xeb))/0xb)+-parseInt(_0x4d9374(0xb7))/0xc;if(_0x4bef6d===_0x3f7ad4)break;else _0x50f11d['push'](_0x50f11d['shift']());}catch(_0x2df0c8){_0x50f11d['push'](_0x50f11d['shift']());}}}(a0_0x471e,0x79d8b));import{EventEmitter as a0_0x362130}from'events';function a0_0x471e(){const _0x26d322=['6924456QWSpAS','toString','getReader','AbortError','content','inbox\x20error:\x20','send','replace','broadcast','emit','sleep','16OQBhwo','190dhFiGr','match','data:\x20','/mcp','messages','connected','heartbeat\x20failed:\x20','new_message','256696IKolTo','body','1017081bWzegw','/events/','disconnected','abort','text/event-stream','decode','signal','132428QSbcDf','sdk-','token','catch','text','resumeId','from_session','Bearer\x20','registered','heartbeatTimer','toTimeString','get_all_status','agent','processInbox','cwd','offline','min','error','283BNewiK','SSE\x20failed:\x20','running','url','get_inbox','sdk','split','call','now','54942XlEEcw',']\x20[commhub:','disconnect','4456632QPATXS','server','sseAbort','type','2.0','pop','log','s...','report_status','completed','status','application/json','parse','name','send_message','4594bdcfyV','reconnectDelay','reply','195xWJsEo','POST','new_task','connectSSE','slice','Authorization','idle','read','heartbeatInterval','SSE\x20connected','alias','startsWith','57ZnzTnS','message'];a0_0x471e=function(){return _0x26d322;};return a0_0x471e();}function a0_0x2abd(_0x10c960,_0x206b71){_0x10c960=_0x10c960-0xaa;const _0x471e4a=a0_0x471e();let _0x2abd7d=_0x471e4a[_0x10c960];return _0x2abd7d;}import{hostname as a0_0x23e5d0}from'os';class T extends a0_0x362130{[a0_0x471e6e(0xae)];[a0_0x471e6e(0xd3)];[a0_0x471e6e(0xf6)];[a0_0x471e6e(0x100)];['resumeId'];[a0_0x471e6e(0xd1)];['reconnectDelay'];[a0_0x471e6e(0xfd)];[a0_0x471e6e(0xb9)];[a0_0x471e6e(0xad)]=!0x1;constructor(_0x221cf8){const _0x115588=a0_0x471e6e;super();if(this[_0x115588(0xae)]=_0x221cf8['url'][_0x115588(0xde)](/\/$/,''),this['alias']=_0x221cf8['alias'],this[_0x115588(0xf6)]=_0x221cf8['token'],this[_0x115588(0x100)]=_0x221cf8[_0x115588(0x100)]||_0x115588(0xb0),this['resumeId']=_0x115588(0xf5)+_0x221cf8[_0x115588(0xd3)]+'-'+Date[_0x115588(0xb3)]()[_0x115588(0xd8)](0x24),this['heartbeatInterval']=_0x221cf8[_0x115588(0xd1)]??0x2bf20,this[_0x115588(0xc7)]=_0x221cf8[_0x115588(0xc7)]??0xbb8,_0x221cf8['autoConnect']!==!0x1)this['connect']();}[a0_0x471e6e(0xbd)](_0x4ddfcb){const _0x29362c=a0_0x471e6e;console['log']('['+new Date()[_0x29362c(0xfe)]()[_0x29362c(0xcd)](0x0,0x8)+_0x29362c(0xb5)+this['alias']+']\x20'+_0x4ddfcb);}async[a0_0x471e6e(0xb2)](_0x3701d0,_0x187966){const _0x42423f=a0_0x471e6e;let _0x5a41c4={'Content-Type':_0x42423f(0xc2),'Accept':'application/json,\x20text/event-stream'};if(this[_0x42423f(0xf6)])_0x5a41c4[_0x42423f(0xce)]=_0x42423f(0xfb)+this['token'];let _0xd8fa71=await(await fetch(this[_0x42423f(0xae)]+_0x42423f(0xe6),{'method':_0x42423f(0xca),'headers':_0x5a41c4,'body':JSON['stringify']({'jsonrpc':_0x42423f(0xbb),'id':Date[_0x42423f(0xb3)](),'method':'tools/call','params':{'name':_0x3701d0,'arguments':_0x187966}})}))[_0x42423f(0xf8)](),_0x14867c=_0xd8fa71[_0x42423f(0xe4)](/data: (.+)/),_0x1ed607=_0x14867c?JSON['parse'](_0x14867c[0x1]):JSON['parse'](_0xd8fa71),_0x241c4e=_0x1ed607?.['result']?.[_0x42423f(0xdb)]?.[0x0]?.[_0x42423f(0xf8)];return _0x241c4e?JSON[_0x42423f(0xc3)](_0x241c4e):_0x1ed607;}async['connect'](){const _0x4d0354=a0_0x471e6e;if(this[_0x4d0354(0xad)])return;this[_0x4d0354(0xad)]=!0x0,await this['status'](_0x4d0354(0xcf)),this[_0x4d0354(0xbd)](_0x4d0354(0xfc)),this[_0x4d0354(0xfd)]=setInterval(()=>{const _0x2452b2=_0x4d0354;this[_0x2452b2(0xc1)](_0x2452b2(0xcf))[_0x2452b2(0xf7)](_0x21a689=>this[_0x2452b2(0xbd)](_0x2452b2(0xe9)+_0x21a689['message']));},this['heartbeatInterval']),this[_0x4d0354(0xcc)]();}async[a0_0x471e6e(0xb6)](){const _0x56dbe2=a0_0x471e6e;if(this[_0x56dbe2(0xad)]=!0x1,this[_0x56dbe2(0xb9)]?.[_0x56dbe2(0xf0)](),this[_0x56dbe2(0xfd)])clearInterval(this[_0x56dbe2(0xfd)]);await this[_0x56dbe2(0xc1)](_0x56dbe2(0x103))[_0x56dbe2(0xf7)](()=>{}),this['log'](_0x56dbe2(0xef));}async[a0_0x471e6e(0xdd)](_0x2ce38c,_0x2d247f,_0x130f46='normal'){const _0x2405ee=a0_0x471e6e;return this[_0x2405ee(0xb2)]('send_task',{'alias':_0x2ce38c,'task':_0x2d247f,'priority':_0x130f46,'from_session':this[_0x2405ee(0xd3)]});}async['message'](_0x1426d1,_0x2ace65){const _0x1e6701=a0_0x471e6e;return this[_0x1e6701(0xb2)](_0x1e6701(0xc5),{'alias':_0x1426d1,'message':_0x2ace65,'from_session':this[_0x1e6701(0xd3)]});}async[a0_0x471e6e(0xc8)](_0x402e4b,_0x108d62,_0x5a87c9=a0_0x471e6e(0xc0)){const _0x24bbec=a0_0x471e6e;return this[_0x24bbec(0xb2)]('send_reply',{'in_reply_to':_0x402e4b,'text':_0x108d62,'status':_0x5a87c9});}async[a0_0x471e6e(0xc1)](_0x41e70a,_0x2ee5f6){const _0xd1b8a4=a0_0x471e6e;return this['call'](_0xd1b8a4(0xbf),{'resume_id':this[_0xd1b8a4(0xf9)],'alias':this[_0xd1b8a4(0xd3)],'status':_0x41e70a,'server':a0_0x23e5d0(),'hostname':a0_0x23e5d0(),'agent':this['agent'],'project_dir':process[_0xd1b8a4(0x102)](),..._0x2ee5f6});}async['getAllStatus'](){const _0x2f9f57=a0_0x471e6e;return this[_0x2f9f57(0xb2)](_0x2f9f57(0xff),{});}async[a0_0x471e6e(0xdf)](_0x2de141,_0x192be2){const _0x242b0b=a0_0x471e6e;return this['call'](_0x242b0b(0xdf),{'message':_0x2de141,'filter_server':_0x192be2?.[_0x242b0b(0xb8)],'filter_status':_0x192be2?.[_0x242b0b(0xc1)]});}async[a0_0x471e6e(0xcc)](){const _0x4b5e6d=a0_0x471e6e;let _0x4b263c=encodeURIComponent(this['alias']),_0x3b4a89=this[_0x4b5e6d(0xae)]+_0x4b5e6d(0xee)+_0x4b263c,_0x5b9b34=this['reconnectDelay'];while(this[_0x4b5e6d(0xad)]){try{this[_0x4b5e6d(0xb9)]=new AbortController();let _0x1b80da={'Accept':_0x4b5e6d(0xf1)};if(this[_0x4b5e6d(0xf6)])_0x1b80da[_0x4b5e6d(0xce)]=_0x4b5e6d(0xfb)+this[_0x4b5e6d(0xf6)];let _0x368bd1=await fetch(_0x3b4a89,{'headers':_0x1b80da,'signal':this['sseAbort'][_0x4b5e6d(0xf3)]});if(!_0x368bd1['ok']||!_0x368bd1['body']){this[_0x4b5e6d(0xbd)](_0x4b5e6d(0xac)+_0x368bd1[_0x4b5e6d(0xc1)]),await this[_0x4b5e6d(0xe1)](_0x5b9b34),_0x5b9b34=Math[_0x4b5e6d(0x104)](_0x5b9b34*1.5,0xea60);continue;}_0x5b9b34=this[_0x4b5e6d(0xc7)];let _0x4b6c4e=_0x368bd1[_0x4b5e6d(0xec)][_0x4b5e6d(0xd9)](),_0x4e2fbc=new TextDecoder(),_0x1a5e0d='';while(this[_0x4b5e6d(0xad)]){let {done:_0x20904e,value:_0x2be0ad}=await _0x4b6c4e[_0x4b5e6d(0xd0)]();if(_0x20904e)break;_0x1a5e0d+=_0x4e2fbc[_0x4b5e6d(0xf2)](_0x2be0ad,{'stream':!0x0});let _0x508042=_0x1a5e0d[_0x4b5e6d(0xb1)]('\x0a');_0x1a5e0d=_0x508042[_0x4b5e6d(0xbc)]()||'';for(let _0x180f0f of _0x508042){if(!_0x180f0f[_0x4b5e6d(0xd4)](_0x4b5e6d(0xe5)))continue;try{let _0x10f097=JSON[_0x4b5e6d(0xc3)](_0x180f0f[_0x4b5e6d(0xcd)](0x6));if(_0x10f097['type']==='connected'){this[_0x4b5e6d(0xbd)](_0x4b5e6d(0xd2)),this[_0x4b5e6d(0xe0)](_0x4b5e6d(0xe8));continue;}if(_0x10f097[_0x4b5e6d(0xba)]===_0x4b5e6d(0xcb)||_0x10f097[_0x4b5e6d(0xba)]===_0x4b5e6d(0xea)||_0x10f097[_0x4b5e6d(0xba)]==='broadcast')await this[_0x4b5e6d(0x101)]();}catch{}}}}catch(_0x3e9643){if(_0x3e9643[_0x4b5e6d(0xc4)]===_0x4b5e6d(0xda))break;this[_0x4b5e6d(0xe0)](_0x4b5e6d(0xaa),_0x3e9643),this[_0x4b5e6d(0xbd)]('SSE\x20error:\x20'+_0x3e9643['message']);}if(this[_0x4b5e6d(0xad)])this[_0x4b5e6d(0xe0)]('disconnected'),this[_0x4b5e6d(0xbd)]('SSE\x20reconnecting\x20in\x20'+_0x5b9b34/0x3e8+_0x4b5e6d(0xbe)),await this['sleep'](_0x5b9b34),_0x5b9b34=Math['min'](_0x5b9b34*1.5,0xea60);}}async[a0_0x471e6e(0x101)](){const _0xaa479a=a0_0x471e6e;try{let _0x23049c=(await this['call'](_0xaa479a(0xaf),{'alias':this['alias'],'limit':0xa}))?.[_0xaa479a(0xe7)]||[];for(let _0x16d3d9 of _0x23049c)await this['call']('ack_inbox',{'alias':this[_0xaa479a(0xd3)],'message_id':_0x16d3d9['id']}),this['log']('←\x20'+_0x16d3d9[_0xaa479a(0xfa)]+':\x20'+_0x16d3d9[_0xaa479a(0xdb)][_0xaa479a(0xcd)](0x0,0x3c)),this[_0xaa479a(0xe0)]('task',_0x16d3d9),this[_0xaa479a(0xe0)](_0xaa479a(0xd6),_0x16d3d9);}catch(_0x183b6c){this[_0xaa479a(0xbd)](_0xaa479a(0xdc)+_0x183b6c[_0xaa479a(0xd6)]);}}['sleep'](_0x75e542){return new Promise(_0x5187a6=>setTimeout(_0x5187a6,_0x75e542));}}var $=T;export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x23baf6=a0_0x5ffd;(function(_0x471f9c,_0x47f5bc){const _0x56f52c=a0_0x5ffd,_0x58a749=_0x471f9c();while(!![]){try{const _0x42c60f=parseInt(_0x56f52c(0xe7))/0x1*(-parseInt(_0x56f52c(0x104))/0x2)+parseInt(_0x56f52c(0x7d))/0x3*(parseInt(_0x56f52c(0x105))/0x4)+-parseInt(_0x56f52c(0x94))/0x5*(parseInt(_0x56f52c(0xa9))/0x6)+parseInt(_0x56f52c(0x9c))/0x7+-parseInt(_0x56f52c(0xa2))/0x8+parseInt(_0x56f52c(0x92))/0x9*(-parseInt(_0x56f52c(0xc3))/0xa)+parseInt(_0x56f52c(0xb3))/0xb;if(_0x42c60f===_0x47f5bc)break;else _0x58a749['push'](_0x58a749['shift']());}catch(_0x50e99e){_0x58a749['push'](_0x58a749['shift']());}}}(a0_0x441a,0x9053a));import{readFileSync as a0_0x50b915,existsSync as a0_0x359098}from'fs';import{randomUUID as a0_0x2692f7}from'crypto';import{join as a0_0x26a64d}from'path';import{hostname as a0_0x201dd8}from'os';import{execSync as a0_0x41dda2}from'child_process';import{Server as a0_0x17a361}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x7d2bfd}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0xa68fd7,CallToolRequestSchema as a0_0x1fbed3}from'@modelcontextprotocol/sdk/types.js';function p(_0x4b52ac){const _0x277795=a0_0x5ffd;if(!a0_0x359098(_0x4b52ac))return;for(let _0x4f7c2b of a0_0x50b915(_0x4b52ac,_0x277795(0xd0))[_0x277795(0x8b)]('\x0a')){let _0x50dd00=_0x4f7c2b['trim']();if(!_0x50dd00||_0x50dd00[_0x277795(0x88)]('#'))continue;let _0x2a8831=_0x50dd00[_0x277795(0xde)]('=');if(_0x2a8831<0x0)continue;let _0x573378=_0x50dd00['slice'](0x0,_0x2a8831)[_0x277795(0xc9)](),_0x5efd2b=_0x50dd00[_0x277795(0xdc)](_0x2a8831+0x1)[_0x277795(0xc9)]()[_0x277795(0xcb)](/^["']|["']$/g,'');if(!process.env[_0x573378])process.env[_0x573378]=_0x5efd2b;}}var C=process.env.HOME||'~',T=a0_0x26a64d(C,a0_0x23baf6(0xbc));p(a0_0x26a64d(T,a0_0x23baf6(0xb6)));var L=process[a0_0x23baf6(0x84)]()[a0_0x23baf6(0xcb)](/\//g,'-');p(a0_0x26a64d(T,L,'.env'));function U(){const _0x4a95bb=a0_0x23baf6;try{return a0_0x41dda2(_0x4a95bb(0xab),{'encoding':_0x4a95bb(0xd0),'timeout':0x7d0})[_0x4a95bb(0xc9)]();}catch{return'';}}function v(){const _0x3f15eb=a0_0x23baf6;try{let _0x7a2f27=a0_0x26a64d(C,_0x3f15eb(0xe5),_0x3f15eb(0x9b));if(a0_0x359098(_0x7a2f27))return JSON[_0x3f15eb(0x98)](a0_0x50b915(_0x7a2f27,_0x3f15eb(0xd0)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x23baf6(0x8c)]||a0_0x23baf6(0x9d),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x201dd8(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x2692f7(),X=process.env.COMMHUB_TOKEN||H[a0_0x23baf6(0x7e)]||'';function Y(_0x2b52fe){const _0x4c940b=a0_0x23baf6;let _0x85b0dd=new Date()[_0x4c940b(0x82)]()['slice'](0x0,0x8);process[_0x4c940b(0xd8)][_0x4c940b(0xa6)]('['+_0x85b0dd+_0x4c940b(0xb1)+_0x2b52fe+'\x0a');}function h(_0x1c8f59){return new Promise(_0x56b374=>setTimeout(_0x56b374,_0x1c8f59));}Y(a0_0x23baf6(0xcf)+f+'\x20ALIAS='+Z+'\x20RESUME_ID='+w['slice'](0x0,0x8)+a0_0x23baf6(0x96)+(j||a0_0x23baf6(0xa8))+a0_0x23baf6(0xcc)+process['cwd']()+'\x20PROJECT_ENV='+L);var k=new Map(),K=new a0_0x17a361({'name':a0_0x23baf6(0xd2),'version':'0.3.0'},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x23baf6(0x91),a0_0x23baf6(0xb4),a0_0x23baf6(0xaf),'You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','Session\x20alias:\x20'+Z][a0_0x23baf6(0xc0)]('\x0a')});K['setRequestHandler'](a0_0xa68fd7,async()=>({'tools':[{'name':a0_0x23baf6(0xff),'description':a0_0x23baf6(0xba),'inputSchema':{'type':a0_0x23baf6(0x9a),'properties':{'task_id':{'type':a0_0x23baf6(0x103),'description':a0_0x23baf6(0xa4)},'text':{'type':a0_0x23baf6(0x103),'description':a0_0x23baf6(0x89)},'status':{'type':a0_0x23baf6(0x103),'enum':[a0_0x23baf6(0xef),a0_0x23baf6(0xad),a0_0x23baf6(0x80),a0_0x23baf6(0xee),a0_0x23baf6(0xec),'in_progress'],'description':a0_0x23baf6(0xf8)}},'required':[a0_0x23baf6(0xd7)]}},{'name':a0_0x23baf6(0xe0),'description':a0_0x23baf6(0xd1),'inputSchema':{'type':a0_0x23baf6(0x9a),'properties':{'status':{'type':'string','enum':[a0_0x23baf6(0x8a),a0_0x23baf6(0xfd),a0_0x23baf6(0xee),'error']},'task':{'type':'string','description':a0_0x23baf6(0xc6)},'progress':{'type':a0_0x23baf6(0xae),'description':'Progress\x200-100'}},'required':[a0_0x23baf6(0xa3)]}},{'name':'commhub_send_task','description':'Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x23baf6(0x103),'description':a0_0x23baf6(0xed)},'task':{'type':a0_0x23baf6(0x103),'description':a0_0x23baf6(0xf1)},'priority':{'type':a0_0x23baf6(0x103),'enum':['high',a0_0x23baf6(0xeb),a0_0x23baf6(0xf4)],'description':a0_0x23baf6(0x81)}},'required':[a0_0x23baf6(0xe2),'task']}},{'name':a0_0x23baf6(0x93),'description':a0_0x23baf6(0xcd),'inputSchema':{'type':a0_0x23baf6(0x9a),'properties':{'alias':{'type':a0_0x23baf6(0x103),'description':a0_0x23baf6(0xed)},'message':{'type':a0_0x23baf6(0x103),'description':a0_0x23baf6(0xc4)}},'required':['alias',a0_0x23baf6(0xc5)]}},{'name':a0_0x23baf6(0xb0),'description':'Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','inputSchema':{'type':a0_0x23baf6(0x9a),'properties':{}}}]}));async function P(_0x21bfb8,_0x328d0d){const _0x18919b=a0_0x23baf6;let _0x2e6aa7=await fetch(f+_0x18919b(0xfb),{'method':_0x18919b(0xdd),'headers':{'Content-Type':'application/json','Accept':_0x18919b(0xf5),...X?{'Authorization':_0x18919b(0x97)+X}:{}},'body':JSON[_0x18919b(0xe3)]({'jsonrpc':'2.0','id':0x1,'method':_0x18919b(0xe6),'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x18919b(0xd2),'version':_0x18919b(0xda)}}})});if(!_0x2e6aa7['ok']){let _0xaa3f07=await _0x2e6aa7[_0x18919b(0xd7)]();return Y(_0x18919b(0xfe)+_0x2e6aa7[_0x18919b(0xa3)]+'\x20'+_0xaa3f07[_0x18919b(0xdc)](0x0,0x64)),{'ok':!0x1,'error':_0x18919b(0x85)+_0x2e6aa7[_0x18919b(0xa3)]};}await _0x2e6aa7[_0x18919b(0xd7)]();let _0x1cadd6=(await(await fetch(f+'/mcp',{'method':_0x18919b(0xdd),'headers':{'Content-Type':_0x18919b(0xf9),'Accept':_0x18919b(0xf5),...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON[_0x18919b(0xe3)]({'jsonrpc':'2.0','id':0x2,'method':'tools/call','params':{'name':_0x21bfb8,'arguments':_0x328d0d}})}))[_0x18919b(0xd7)]())[_0x18919b(0x8b)]('\x0a')[_0x18919b(0xdb)](_0x2f0535=>_0x2f0535[_0x18919b(0x88)](_0x18919b(0xbf)));if(_0x1cadd6){let _0xf271b3=JSON[_0x18919b(0x98)](_0x1cadd6[_0x18919b(0xdc)](0x6));return _0xf271b3?.[_0x18919b(0x7c)]?.[_0x18919b(0x83)]?.[0x0]?.['text']?JSON[_0x18919b(0x98)](_0xf271b3[_0x18919b(0x7c)][_0x18919b(0x83)][0x0]['text']):_0xf271b3;}return{'ok':!0x1,'error':'no\x20response'};}K[a0_0x23baf6(0xc1)](a0_0x1fbed3,async _0x474757=>{const _0x148718=a0_0x23baf6;let {name:_0x42d11f,arguments:_0x4ca2b3}=_0x474757[_0x148718(0x8e)];if(_0x42d11f===_0x148718(0xff)){let {task_id:_0x5d587a,text:_0x5f3fb2,status:_0x6454ca}=_0x4ca2b3;if(_0x6454ca===_0x148718(0xef)||_0x6454ca===_0x148718(0xad)||_0x6454ca==='cancelled'){let _0x54ed05=_0x6454ca===_0x148718(0xef)?_0x148718(0xe8):_0x6454ca,_0x37007a=_0x5d587a?k['get'](_0x5d587a)||_0x148718(0x8c):_0x148718(0x8c),_0x2c7e5a=await P(_0x148718(0xc2),{'alias':_0x37007a,'text':_0x5f3fb2,'in_reply_to':_0x5d587a||void 0x0,'status':_0x54ed05,'from_session':Z});if(_0x5d587a)k[_0x148718(0xa5)](_0x5d587a);return{'content':[{'type':_0x148718(0xd7),'text':JSON['stringify'](_0x2c7e5a)}]};}let _0x4cf2ea=await P(_0x148718(0xb5),{'resume_id':w,'alias':Z,'status':_0x6454ca===_0x148718(0xee)?'blocked':_0x6454ca===_0x148718(0xec)?'error':_0x148718(0x8a),'task':_0x5f3fb2[_0x148718(0xdc)](0x0,0xc8),'output':_0x5f3fb2});return{'content':[{'type':_0x148718(0xd7),'text':JSON[_0x148718(0xe3)](_0x4cf2ea)}]};}if(_0x42d11f===_0x148718(0xe0)){let {status:_0x26ac0d,task:_0x486b88,progress:_0x3c206c}=_0x4ca2b3,_0x438cc5=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x26ac0d,'task':_0x486b88,'progress':_0x3c206c});return{'content':[{'type':_0x148718(0xd7),'text':JSON['stringify'](_0x438cc5)}]};}if(_0x42d11f===_0x148718(0xf0)){let {alias:_0x199109,task:_0x503719,priority:_0x46603a}=_0x4ca2b3,_0x148a95=await P(_0x148718(0x7f),{'alias':_0x199109,'task':_0x503719,'priority':_0x46603a||_0x148718(0xeb),'from_session':Z});return{'content':[{'type':_0x148718(0xd7),'text':JSON[_0x148718(0xe3)](_0x148a95)}]};}if(_0x42d11f===_0x148718(0x93)){let {alias:_0x39326c,message:_0x191ac1}=_0x4ca2b3,_0x30066e=await P(_0x148718(0xf2),{'alias':_0x39326c,'message':_0x191ac1,'from_session':Z});return{'content':[{'type':_0x148718(0xd7),'text':JSON[_0x148718(0xe3)](_0x30066e)}]};}if(_0x42d11f===_0x148718(0xb0)){let _0x52583a=await P('get_all_status',{});return{'content':[{'type':_0x148718(0xd7),'text':JSON[_0x148718(0xe3)](_0x52583a)}]};}return{'content':[{'type':_0x148718(0xd7),'text':JSON['stringify']({'error':_0x148718(0xce)})}]};});async function u(){const _0x61582e=a0_0x23baf6;let _0x436adb=f+_0x61582e(0xac)+encodeURIComponent(Z),_0x31a1a2={};if(X)_0x31a1a2[_0x61582e(0xd9)]=_0x61582e(0x97)+X;Y(_0x61582e(0xfc)+_0x436adb);while(!0x0){try{let _0x5c9aff=await fetch(_0x436adb,{'headers':_0x31a1a2});if(!_0x5c9aff['ok']){Y('SSE\x20error:\x20'+_0x5c9aff['status']+'\x20'+_0x5c9aff[_0x61582e(0xe4)]),await h(0x1388);continue;}let _0x106990=_0x5c9aff['body'][_0x61582e(0xca)](),_0x35c5fb=new TextDecoder(),_0x1f7685='';while(!0x0){let {done:_0xe1c95e,value:_0x3dffda}=await _0x106990[_0x61582e(0xe1)]();if(_0xe1c95e)break;_0x1f7685+=_0x35c5fb['decode'](_0x3dffda,{'stream':!0x0});let _0x307deb=_0x1f7685[_0x61582e(0x8b)]('\x0a\x0a');_0x1f7685=_0x307deb['pop']()||'';for(let _0x475fd8 of _0x307deb){let _0x300357=_0x475fd8[_0x61582e(0x8b)]('\x0a')[_0x61582e(0xdb)](_0x257154=>_0x257154[_0x61582e(0x88)](_0x61582e(0xbf)));if(!_0x300357)continue;try{let _0x44cbf1=JSON[_0x61582e(0x98)](_0x300357[_0x61582e(0xdc)](0x6));await S(_0x44cbf1);}catch(_0x5cf525){Y('parse\x20error:\x20'+_0x5cf525);}}}Y(_0x61582e(0x8d));}catch(_0x2e7031){Y(_0x61582e(0x106)+_0x2e7031);}await h(0xbb8);}}async function S(_0x4cd0ac){const _0x5264c4=a0_0x23baf6;if(_0x4cd0ac[_0x5264c4(0x86)]===_0x5264c4(0xd3)){Y('SSE\x20connected\x20as\x20\x22'+Z+'\x22');return;}if(_0x4cd0ac[_0x5264c4(0x86)]===_0x5264c4(0x100)){if(Y('←\x20message\x20from\x20'+_0x4cd0ac[_0x5264c4(0xf6)]+':\x20'+_0x4cd0ac[_0x5264c4(0xc5)]['slice'](0x0,0x3c)),await K[_0x5264c4(0x95)]({'method':'notifications/claude/channel','params':{'content':_0x4cd0ac[_0x5264c4(0xc5)],'meta':{'sender':_0x4cd0ac[_0x5264c4(0xf6)]||'hub','sender_id':_0x5264c4(0xfa),'user':_0x4cd0ac[_0x5264c4(0xf6)]||'hub','priority':_0x5264c4(0xeb)}}}),_0x4cd0ac[_0x5264c4(0xb9)])await P('ack_inbox',{'alias':Z,'message_id':_0x4cd0ac[_0x5264c4(0xb9)]});return;}if(_0x4cd0ac['type']==='new_task'||_0x4cd0ac[_0x5264c4(0x86)]===_0x5264c4(0xdf)){Y('←\x20'+_0x4cd0ac['type']+_0x5264c4(0xb7)+_0x4cd0ac['inbox_count']+_0x5264c4(0x101)+(_0x4cd0ac[_0x5264c4(0x87)]||_0x5264c4(0xeb)));let _0x58f9f3=await P(_0x5264c4(0xc7),{'alias':Z,'limit':0x5});if(_0x58f9f3?.['ok']&&_0x58f9f3[_0x5264c4(0xd6)]?.['length']>0x0)for(let _0x486c18 of _0x58f9f3[_0x5264c4(0xd6)]){let _0x4d2e2c={'sender':_0x486c18[_0x5264c4(0x102)]||_0x5264c4(0x8c),'sender_id':_0x5264c4(0xfa),'user':_0x486c18['from_session']||'hub','task_id':_0x486c18['id'],'priority':_0x486c18[_0x5264c4(0x87)]||_0x5264c4(0xeb)};k[_0x5264c4(0xbb)](_0x486c18['id'],_0x486c18[_0x5264c4(0x102)]||_0x5264c4(0x8c)),await K[_0x5264c4(0x95)]({'method':_0x5264c4(0xd5),'params':{'content':_0x486c18[_0x5264c4(0x83)],'meta':_0x4d2e2c}}),Y(_0x5264c4(0xea)+_0x486c18['id'][_0x5264c4(0xdc)](0x0,0x8)+'\x20from\x20'+_0x486c18[_0x5264c4(0x102)]+':\x20'+_0x486c18[_0x5264c4(0x83)]['slice'](0x0,0x3c)),await P(_0x5264c4(0xf3),{'alias':Z,'message_id':_0x486c18['id']});}}}async function A(){const _0x5994af=a0_0x23baf6;let _0x23da29=new a0_0x7d2bfd();await K['connect'](_0x23da29),Y(_0x5994af(0xf7)),Y(_0x5994af(0xd4)),u()[_0x5994af(0xbe)](_0x5e8382=>Y(_0x5994af(0x99)+_0x5e8382)),P(_0x5994af(0xb5),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x201dd8(),'hostname':a0_0x201dd8(),'agent':_0x5994af(0x9e),'project_dir':process[_0x5994af(0x84)](),'tmux_name':j||void 0x0})[_0x5994af(0xc8)](()=>Y('registered\x20as\x20\x22'+Z+_0x5994af(0xa1)+w[_0x5994af(0xdc)](0x0,0x8)+')'))[_0x5994af(0xbe)](_0x3b45c6=>Y(_0x5994af(0xa0)+_0x3b45c6)),setInterval(()=>{const _0x427053=_0x5994af;P('report_status',{'resume_id':w,'alias':Z,'status':_0x427053(0xfd),'server':a0_0x201dd8(),'hostname':a0_0x201dd8(),'agent':_0x427053(0x9e),'project_dir':process['cwd'](),'tmux_name':j||void 0x0})[_0x427053(0xbe)](_0x16480e=>Y(_0x427053(0x90)+_0x16480e));},0x2bf20),Y(_0x5994af(0xb2));}A()[a0_0x23baf6(0xbe)](_0x2b71a2=>{const _0x4c12f5=a0_0x23baf6;Y(_0x4c12f5(0xbd)+_0x2b71a2),process[_0x4c12f5(0xb8)](0x1);});function a0_0x441a(){const _0x1d5cef=['normal','error','Target\x20session\x20alias','blocked','completed','commhub_send_task','Task\x20content','send_message','ack_inbox','low','application/json,\x20text/event-stream','from','MCP\x20stdio\x20connected','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','application/json','commhub','/mcp','connecting\x20to\x20','idle','CommHub\x20init\x20failed:\x20','commhub_reply','new_message','\x20priority=','from_session','string','359332RGcoBI','8GWAlwf','SSE\x20connection\x20error:\x20','result','1698609eiWPLe','token','send_task','cancelled','Priority\x20(default:\x20normal)','toTimeString','content','cwd','init\x20failed:\x20','type','priority','startsWith','Reply\x20text\x20/\x20result\x20summary','working','split','hub','SSE\x20stream\x20ended,\x20reconnecting...','params','session\x20disconnected','heartbeat\x20failed:\x20','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','4887AsKQdj','commhub_send_message','386765EWFbco','notification','...\x20TMUX=','Bearer\x20','parse','SSE\x20fatal:\x20','object','config.json','5648734FbAZGp','http://127.0.0.1:9200','claude-code','shutting\x20down,\x20reporting\x20offline...','warning:\x20could\x20not\x20register:\x20','\x22\x20(','5627552DJcndO','status','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','delete','write','stdin','none','78GACSqT','SIGINT','tmux\x20display-message\x20-p\x20\x27#S\x27','/events/','failed','number','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','commhub_get_all_status',']\x20[commhub]\x20','ready\x20—\x20waiting\x20for\x20events','25915450mrAFgb','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','report_status','.env',':\x20inbox_count=','exit','message_id','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','set','.claude/channels/commhub','fatal:\x20','catch','data:\x20','join','setRequestHandler','send_reply','16890ctWlTA','Message\x20content','message','Current\x20task\x20description','get_inbox','then','trim','getReader','replace','\x20CWD=','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','unknown\x20tool','ENV:\x20URL=','utf-8','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','commhub-channel','connected','starting\x20SSE\x20listener...','notifications/claude/channel','messages','text','stderr','Authorization','0.3.0','find','slice','POST','indexOf','broadcast','commhub_report_status','read','alias','stringify','statusText','.anet','initialize','6HHRiYW','replied','SIGTERM','→\x20injected\x20task\x20'];a0_0x441a=function(){return _0x1d5cef;};return a0_0x441a();}function a0_0x5ffd(_0x5a690b,_0x2b9d7b){_0x5a690b=_0x5a690b-0x7c;const _0x441a57=a0_0x441a();let _0x5ffd46=_0x441a57[_0x5a690b];return _0x5ffd46;}async function N(){const _0x21900e=a0_0x23baf6;Y(_0x21900e(0x9f)),await P('report_status',{'resume_id':w,'alias':Z,'status':_0x21900e(0xec),'task':_0x21900e(0x8f)})[_0x21900e(0xbe)](()=>{}),process[_0x21900e(0xb8)](0x0);}process[a0_0x23baf6(0xa7)]['on']('end',()=>N()),process['on'](a0_0x23baf6(0xe9),()=>N()),process['on'](a0_0x23baf6(0xaa),()=>N());
2
+ const a0_0xe95032=a0_0x2a80;(function(_0x263f32,_0x37a1d2){const _0x5683d0=a0_0x2a80,_0x1eb00c=_0x263f32();while(!![]){try{const _0x103501=parseInt(_0x5683d0(0xaf))/0x1*(parseInt(_0x5683d0(0xeb))/0x2)+parseInt(_0x5683d0(0x84))/0x3+-parseInt(_0x5683d0(0xe0))/0x4*(-parseInt(_0x5683d0(0x9a))/0x5)+-parseInt(_0x5683d0(0xa3))/0x6*(parseInt(_0x5683d0(0xe9))/0x7)+parseInt(_0x5683d0(0xf5))/0x8*(-parseInt(_0x5683d0(0xc2))/0x9)+parseInt(_0x5683d0(0xb2))/0xa+-parseInt(_0x5683d0(0xd9))/0xb;if(_0x103501===_0x37a1d2)break;else _0x1eb00c['push'](_0x1eb00c['shift']());}catch(_0x4aaf8){_0x1eb00c['push'](_0x1eb00c['shift']());}}}(a0_0x213f,0xe6c23));import{readFileSync as a0_0x348b15,existsSync as a0_0x584eb0}from'fs';import{randomUUID as a0_0x254e50}from'crypto';import{join as a0_0x332d3b}from'path';import{hostname as a0_0x43dd0f}from'os';import{execSync as a0_0xc13bcb}from'child_process';import{Server as a0_0x55f531}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x1872f0}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x51df58,CallToolRequestSchema as a0_0x4dc61d}from'@modelcontextprotocol/sdk/types.js';function p(_0x57a4e9){const _0x56c25c=a0_0x2a80;if(!a0_0x584eb0(_0x57a4e9))return;for(let _0x3b458b of a0_0x348b15(_0x57a4e9,_0x56c25c(0x81))[_0x56c25c(0x9d)]('\x0a')){let _0x2e9a91=_0x3b458b[_0x56c25c(0xa0)]();if(!_0x2e9a91||_0x2e9a91['startsWith']('#'))continue;let _0x321dfe=_0x2e9a91[_0x56c25c(0xac)]('=');if(_0x321dfe<0x0)continue;let _0x4d936b=_0x2e9a91[_0x56c25c(0xfd)](0x0,_0x321dfe)[_0x56c25c(0xa0)](),_0x17c10d=_0x2e9a91[_0x56c25c(0xfd)](_0x321dfe+0x1)[_0x56c25c(0xa0)]()['replace'](/^["']|["']$/g,'');if(!process.env[_0x4d936b])process.env[_0x4d936b]=_0x17c10d;}}var C=process.env.HOME||'~',T=a0_0x332d3b(C,a0_0xe95032(0xff));p(a0_0x332d3b(T,a0_0xe95032(0xad)));var L=process[a0_0xe95032(0xa9)]()[a0_0xe95032(0x7d)](/\//g,'-');p(a0_0x332d3b(T,L,'.env'));function a0_0x2a80(_0x1e76fc,_0x56da74){_0x1e76fc=_0x1e76fc-0x75;const _0x213f9d=a0_0x213f();let _0x2a8047=_0x213f9d[_0x1e76fc];return _0x2a8047;}function U(){const _0x44339c=a0_0xe95032;try{return a0_0xc13bcb(_0x44339c(0xee),{'encoding':_0x44339c(0x81),'timeout':0x7d0})[_0x44339c(0xa0)]();}catch{return'';}}function v(){const _0x3223ba=a0_0xe95032;try{let _0x1f53b2=a0_0x332d3b(C,_0x3223ba(0x9e),_0x3223ba(0xb9));if(a0_0x584eb0(_0x1f53b2))return JSON[_0x3223ba(0x78)](a0_0x348b15(_0x1f53b2,_0x3223ba(0x81)));}catch{}return{};}function a0_0x213f(){const _0x24e6d7=['.claude/channels/commhub','low','ENV:\x20URL=','commhub-channel','object','length','\x20CWD=','from','parse','\x20RESUME_ID=','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','connected','completed','replace','shutting\x20down,\x20reporting\x20offline...','ack_inbox','heartbeat\x20failed:\x20','utf-8','\x20priority=','tools/call','2568318eyGtxb','failed','parse\x20error:\x20','cancelled','\x22\x20(','POST','SSE\x20fatal:\x20','commhub','0.3.0','working','message','content','notification','data:\x20','type','initialize',']\x20[commhub]\x20','pop','result','connecting\x20to\x20','Progress\x200-100','unknown\x20tool','280nCGnQE','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','Priority\x20(default:\x20normal)','split','.anet','2.0','trim','string','SSE\x20connection\x20error:\x20','12762XmtvDG','hub','\x20from\x20','commhub_get_all_status','ready\x20—\x20waiting\x20for\x20events','text','cwd','Message\x20content','message_id','indexOf','.env','error','154378tROuCl','setRequestHandler','send_message','18898770EKBirw','broadcast','blocked','notifications/claude/channel','claude-code','normal',':\x20inbox_count=','config.json','commhub_send_task','end','token','catch','init\x20failed:\x20','...\x20TMUX=','\x20PROJECT_ENV=','inbox_count','4905AEHxFZ','commhub_reply','get_all_status','SSE\x20stream\x20ended,\x20reconnecting...','read','idle','warning:\x20could\x20not\x20register:\x20','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','stderr','http://127.0.0.1:9200','/events/','send_task','SSE\x20error:\x20','exit','Bearer\x20','params','new_task','priority','stringify','join','statusText','get','body','1890218wnHeue','Reply\x20text\x20/\x20result\x20summary','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','/mcp','stdin','report_status','startsWith','43004UQOYHI','messages','in_progress','send_reply','SIGINT','commhub_report_status','none','application/json','MCP\x20stdio\x20connected','3283oZVkfp','write','6eEJPzk','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','decode','tmux\x20display-message\x20-p\x20\x27#S\x27','find','from_session','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','status','number','getReader','24904TJoncN','registered\x20as\x20\x22','fatal:\x20','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','SIGTERM','←\x20message\x20from\x20','new_message','commhub_send_message','slice','Target\x20session\x20alias'];a0_0x213f=function(){return _0x24e6d7;};return a0_0x213f();}var H=v(),f=process.env.COMMHUB_URL||H['hub']||a0_0xe95032(0xcb),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x43dd0f(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x254e50(),X=process.env.COMMHUB_TOKEN||H[a0_0xe95032(0xbc)]||'';function Y(_0x25c011){const _0x10be27=a0_0xe95032;let _0x2be634=new Date()['toTimeString']()[_0x10be27(0xfd)](0x0,0x8);process[_0x10be27(0xca)][_0x10be27(0xea)]('['+_0x2be634+_0x10be27(0x94)+_0x25c011+'\x0a');}function h(_0x1e3cb7){return new Promise(_0x85109c=>setTimeout(_0x85109c,_0x1e3cb7));}Y(a0_0xe95032(0x101)+f+'\x20ALIAS='+Z+a0_0xe95032(0x79)+w[a0_0xe95032(0xfd)](0x0,0x8)+a0_0xe95032(0xbf)+(j||a0_0xe95032(0xe6))+a0_0xe95032(0x76)+process[a0_0xe95032(0xa9)]()+a0_0xe95032(0xc0)+L);var k=new Map(),K=new a0_0x55f531({'name':a0_0xe95032(0x102),'version':a0_0xe95032(0x8c)},{'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_0xe95032(0xf8),a0_0xe95032(0xec),a0_0xe95032(0x9b),'Session\x20alias:\x20'+Z][a0_0xe95032(0xd5)]('\x0a')});K[a0_0xe95032(0xb0)](a0_0x51df58,async()=>({'tools':[{'name':a0_0xe95032(0xc3),'description':a0_0xe95032(0x7a),'inputSchema':{'type':a0_0xe95032(0x103),'properties':{'task_id':{'type':a0_0xe95032(0xa1),'description':'The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)'},'text':{'type':'string','description':a0_0xe95032(0xda)},'status':{'type':a0_0xe95032(0xa1),'enum':[a0_0xe95032(0x7c),a0_0xe95032(0x85),a0_0xe95032(0x87),a0_0xe95032(0xb4),a0_0xe95032(0xae),a0_0xe95032(0xe2)],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':['text']}},{'name':'commhub_report_status','description':'Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','inputSchema':{'type':'object','properties':{'status':{'type':a0_0xe95032(0xa1),'enum':['working','idle',a0_0xe95032(0xb4),a0_0xe95032(0xae)]},'task':{'type':a0_0xe95032(0xa1),'description':'Current\x20task\x20description'},'progress':{'type':a0_0xe95032(0xf3),'description':a0_0xe95032(0x98)}},'required':[a0_0xe95032(0xf2)]}},{'name':a0_0xe95032(0xba),'description':a0_0xe95032(0xdb),'inputSchema':{'type':a0_0xe95032(0x103),'properties':{'alias':{'type':a0_0xe95032(0xa1),'description':a0_0xe95032(0xfe)},'task':{'type':a0_0xe95032(0xa1),'description':'Task\x20content'},'priority':{'type':'string','enum':['high',a0_0xe95032(0xb7),a0_0xe95032(0x100)],'description':a0_0xe95032(0x9c)}},'required':['alias','task']}},{'name':a0_0xe95032(0xfc),'description':a0_0xe95032(0xf1),'inputSchema':{'type':a0_0xe95032(0x103),'properties':{'alias':{'type':a0_0xe95032(0xa1),'description':'Target\x20session\x20alias'},'message':{'type':a0_0xe95032(0xa1),'description':a0_0xe95032(0xaa)}},'required':['alias',a0_0xe95032(0x8e)]}},{'name':a0_0xe95032(0xa6),'description':a0_0xe95032(0xc9),'inputSchema':{'type':a0_0xe95032(0x103),'properties':{}}}]}));async function P(_0x4dc0cf,_0x41945e){const _0x33834b=a0_0xe95032;let _0x10c7ff=await fetch(f+_0x33834b(0xdc),{'method':'POST','headers':{'Content-Type':_0x33834b(0xe7),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x33834b(0xd0)+X}:{}},'body':JSON[_0x33834b(0xd4)]({'jsonrpc':_0x33834b(0x9f),'id':0x1,'method':_0x33834b(0x93),'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x33834b(0x102),'version':_0x33834b(0x8c)}}})});if(!_0x10c7ff['ok']){let _0x57fd39=await _0x10c7ff[_0x33834b(0xa8)]();return Y('CommHub\x20init\x20failed:\x20'+_0x10c7ff[_0x33834b(0xf2)]+'\x20'+_0x57fd39[_0x33834b(0xfd)](0x0,0x64)),{'ok':!0x1,'error':_0x33834b(0xbe)+_0x10c7ff[_0x33834b(0xf2)]};}await _0x10c7ff[_0x33834b(0xa8)]();let _0x2e7193=(await(await fetch(f+'/mcp',{'method':_0x33834b(0x89),'headers':{'Content-Type':_0x33834b(0xe7),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x33834b(0xd0)+X}:{}},'body':JSON['stringify']({'jsonrpc':'2.0','id':0x2,'method':_0x33834b(0x83),'params':{'name':_0x4dc0cf,'arguments':_0x41945e}})}))[_0x33834b(0xa8)]())[_0x33834b(0x9d)]('\x0a')[_0x33834b(0xef)](_0x2c4b38=>_0x2c4b38[_0x33834b(0xdf)]('data:\x20'));if(_0x2e7193){let _0x47cf33=JSON[_0x33834b(0x78)](_0x2e7193['slice'](0x6));return _0x47cf33?.[_0x33834b(0x96)]?.['content']?.[0x0]?.[_0x33834b(0xa8)]?JSON[_0x33834b(0x78)](_0x47cf33[_0x33834b(0x96)][_0x33834b(0x8f)][0x0][_0x33834b(0xa8)]):_0x47cf33;}return{'ok':!0x1,'error':'no\x20response'};}K[a0_0xe95032(0xb0)](a0_0x4dc61d,async _0x401cc5=>{const _0x4c2b84=a0_0xe95032;let {name:_0x3d17d8,arguments:_0x38da1c}=_0x401cc5[_0x4c2b84(0xd1)];if(_0x3d17d8==='commhub_reply'){let {task_id:_0x2417ce,text:_0x33aece,status:_0x4897cc}=_0x38da1c;if(_0x4897cc===_0x4c2b84(0x7c)||_0x4897cc===_0x4c2b84(0x85)||_0x4897cc===_0x4c2b84(0x87)){let _0x593b55=_0x4897cc===_0x4c2b84(0x7c)?'replied':_0x4897cc,_0x557cc6=_0x2417ce?k[_0x4c2b84(0xd7)](_0x2417ce)||_0x4c2b84(0xa4):_0x4c2b84(0xa4),_0x549498=await P(_0x4c2b84(0xe3),{'alias':_0x557cc6,'text':_0x33aece,'in_reply_to':_0x2417ce||void 0x0,'status':_0x593b55,'from_session':Z});if(_0x2417ce)k['delete'](_0x2417ce);return{'content':[{'type':'text','text':JSON[_0x4c2b84(0xd4)](_0x549498)}]};}let _0x17bfd5=await P(_0x4c2b84(0xde),{'resume_id':w,'alias':Z,'status':_0x4897cc===_0x4c2b84(0xb4)?'blocked':_0x4897cc===_0x4c2b84(0xae)?_0x4c2b84(0xae):_0x4c2b84(0x8d),'task':_0x33aece[_0x4c2b84(0xfd)](0x0,0xc8),'output':_0x33aece});return{'content':[{'type':_0x4c2b84(0xa8),'text':JSON[_0x4c2b84(0xd4)](_0x17bfd5)}]};}if(_0x3d17d8===_0x4c2b84(0xe5)){let {status:_0x4b55ed,task:_0x51580f,progress:_0x19a821}=_0x38da1c,_0x5ea7c2=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x4b55ed,'task':_0x51580f,'progress':_0x19a821});return{'content':[{'type':_0x4c2b84(0xa8),'text':JSON[_0x4c2b84(0xd4)](_0x5ea7c2)}]};}if(_0x3d17d8===_0x4c2b84(0xba)){let {alias:_0x19fe02,task:_0x16bbc3,priority:_0x575782}=_0x38da1c,_0x5b5e76=await P(_0x4c2b84(0xcd),{'alias':_0x19fe02,'task':_0x16bbc3,'priority':_0x575782||_0x4c2b84(0xb7),'from_session':Z});return{'content':[{'type':_0x4c2b84(0xa8),'text':JSON[_0x4c2b84(0xd4)](_0x5b5e76)}]};}if(_0x3d17d8==='commhub_send_message'){let {alias:_0x5c61a2,message:_0x34536a}=_0x38da1c,_0x6ae74d=await P(_0x4c2b84(0xb1),{'alias':_0x5c61a2,'message':_0x34536a,'from_session':Z});return{'content':[{'type':_0x4c2b84(0xa8),'text':JSON[_0x4c2b84(0xd4)](_0x6ae74d)}]};}if(_0x3d17d8==='commhub_get_all_status'){let _0xfdd231=await P(_0x4c2b84(0xc4),{});return{'content':[{'type':_0x4c2b84(0xa8),'text':JSON['stringify'](_0xfdd231)}]};}return{'content':[{'type':'text','text':JSON['stringify']({'error':_0x4c2b84(0x99)})}]};});async function u(){const _0x82b477=a0_0xe95032;let _0x3a3eb5=f+_0x82b477(0xcc)+encodeURIComponent(Z),_0x110a43={};if(X)_0x110a43['Authorization']=_0x82b477(0xd0)+X;Y(_0x82b477(0x97)+_0x3a3eb5);while(!0x0){try{let _0x141b38=await fetch(_0x3a3eb5,{'headers':_0x110a43});if(!_0x141b38['ok']){Y(_0x82b477(0xce)+_0x141b38[_0x82b477(0xf2)]+'\x20'+_0x141b38[_0x82b477(0xd6)]),await h(0x1388);continue;}let _0x546e76=_0x141b38[_0x82b477(0xd8)][_0x82b477(0xf4)](),_0x4acd7d=new TextDecoder(),_0x20c2ae='';while(!0x0){let {done:_0x2ea0d3,value:_0x44e871}=await _0x546e76[_0x82b477(0xc6)]();if(_0x2ea0d3)break;_0x20c2ae+=_0x4acd7d[_0x82b477(0xed)](_0x44e871,{'stream':!0x0});let _0x4ab9c9=_0x20c2ae['split']('\x0a\x0a');_0x20c2ae=_0x4ab9c9[_0x82b477(0x95)]()||'';for(let _0x23ee99 of _0x4ab9c9){let _0x2a2dd5=_0x23ee99['split']('\x0a')[_0x82b477(0xef)](_0x139fbd=>_0x139fbd[_0x82b477(0xdf)](_0x82b477(0x91)));if(!_0x2a2dd5)continue;try{let _0x161814=JSON[_0x82b477(0x78)](_0x2a2dd5[_0x82b477(0xfd)](0x6));await S(_0x161814);}catch(_0x4bda72){Y(_0x82b477(0x86)+_0x4bda72);}}}Y(_0x82b477(0xc5));}catch(_0x32555e){Y(_0x82b477(0xa2)+_0x32555e);}await h(0xbb8);}}async function S(_0x169db5){const _0x749912=a0_0xe95032;if(_0x169db5[_0x749912(0x92)]===_0x749912(0x7b)){Y('SSE\x20connected\x20as\x20\x22'+Z+'\x22');return;}if(_0x169db5[_0x749912(0x92)]===_0x749912(0xfb)){if(Y(_0x749912(0xfa)+_0x169db5[_0x749912(0x77)]+':\x20'+_0x169db5[_0x749912(0x8e)][_0x749912(0xfd)](0x0,0x3c)),await K[_0x749912(0x90)]({'method':'notifications/claude/channel','params':{'content':_0x169db5[_0x749912(0x8e)],'meta':{'sender':_0x169db5[_0x749912(0x77)]||_0x749912(0xa4),'sender_id':'commhub','user':_0x169db5[_0x749912(0x77)]||_0x749912(0xa4),'priority':'normal'}}}),_0x169db5[_0x749912(0xab)])await P('ack_inbox',{'alias':Z,'message_id':_0x169db5[_0x749912(0xab)]});return;}if(_0x169db5[_0x749912(0x92)]===_0x749912(0xd2)||_0x169db5[_0x749912(0x92)]===_0x749912(0xb3)){Y('←\x20'+_0x169db5['type']+_0x749912(0xb8)+_0x169db5[_0x749912(0xc1)]+_0x749912(0x82)+(_0x169db5[_0x749912(0xd3)]||_0x749912(0xb7)));let _0x453753=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0x453753?.['ok']&&_0x453753[_0x749912(0xe1)]?.[_0x749912(0x75)]>0x0)for(let _0x2108f7 of _0x453753[_0x749912(0xe1)]){let _0x4146ef={'sender':_0x2108f7['from_session']||_0x749912(0xa4),'sender_id':_0x749912(0x8b),'user':_0x2108f7[_0x749912(0xf0)]||_0x749912(0xa4),'task_id':_0x2108f7['id'],'priority':_0x2108f7['priority']||_0x749912(0xb7)};k['set'](_0x2108f7['id'],_0x2108f7[_0x749912(0xf0)]||_0x749912(0xa4)),await K[_0x749912(0x90)]({'method':_0x749912(0xb5),'params':{'content':_0x2108f7['content'],'meta':_0x4146ef}}),Y('→\x20injected\x20task\x20'+_0x2108f7['id'][_0x749912(0xfd)](0x0,0x8)+_0x749912(0xa5)+_0x2108f7[_0x749912(0xf0)]+':\x20'+_0x2108f7[_0x749912(0x8f)][_0x749912(0xfd)](0x0,0x3c)),await P(_0x749912(0x7f),{'alias':Z,'message_id':_0x2108f7['id']});}}}async function A(){const _0xaf3e00=a0_0xe95032;let _0x44640b=new a0_0x1872f0();await K['connect'](_0x44640b),Y(_0xaf3e00(0xe8)),Y('starting\x20SSE\x20listener...'),u()[_0xaf3e00(0xbd)](_0xede9e3=>Y(_0xaf3e00(0x8a)+_0xede9e3)),P(_0xaf3e00(0xde),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x43dd0f(),'hostname':a0_0x43dd0f(),'agent':_0xaf3e00(0xb6),'project_dir':process[_0xaf3e00(0xa9)](),'tmux_name':j||void 0x0})['then'](()=>Y(_0xaf3e00(0xf6)+Z+_0xaf3e00(0x88)+w['slice'](0x0,0x8)+')'))[_0xaf3e00(0xbd)](_0x4d74b3=>Y(_0xaf3e00(0xc8)+_0x4d74b3)),setInterval(()=>{const _0x5bc618=_0xaf3e00;P('report_status',{'resume_id':w,'alias':Z,'status':_0x5bc618(0xc7),'server':a0_0x43dd0f(),'hostname':a0_0x43dd0f(),'agent':_0x5bc618(0xb6),'project_dir':process[_0x5bc618(0xa9)](),'tmux_name':j||void 0x0})[_0x5bc618(0xbd)](_0x3564b1=>Y(_0x5bc618(0x80)+_0x3564b1));},0x2bf20),Y(_0xaf3e00(0xa7));}A()[a0_0xe95032(0xbd)](_0x41f224=>{const _0x17b069=a0_0xe95032;Y(_0x17b069(0xf7)+_0x41f224),process[_0x17b069(0xcf)](0x1);});async function N(){const _0x499075=a0_0xe95032;Y(_0x499075(0x7e)),await P(_0x499075(0xde),{'resume_id':w,'alias':Z,'status':'error','task':'session\x20disconnected'})[_0x499075(0xbd)](()=>{}),process[_0x499075(0xcf)](0x0);}process[a0_0xe95032(0xdd)]['on'](a0_0xe95032(0xbb),()=>N()),process['on'](a0_0xe95032(0xf9),()=>N()),process['on'](a0_0xe95032(0xe4),()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.2.3-preview.0",
3
+ "version": "2.2.4-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",