@sleep2agi/agent-network 2.0.0-preview.59 → 2.0.0-preview.60

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_0x2ddb81=a0_0x7640;(function(_0x4fa161,_0x571ea0){const _0x3dde95=a0_0x7640,_0x2279ac=_0x4fa161();while(!![]){try{const _0x27f354=parseInt(_0x3dde95(0x16f))/0x1+-parseInt(_0x3dde95(0x17d))/0x2*(parseInt(_0x3dde95(0x16a))/0x3)+-parseInt(_0x3dde95(0x158))/0x4+parseInt(_0x3dde95(0x181))/0x5*(parseInt(_0x3dde95(0x162))/0x6)+-parseInt(_0x3dde95(0x197))/0x7*(parseInt(_0x3dde95(0x191))/0x8)+-parseInt(_0x3dde95(0x19a))/0x9+parseInt(_0x3dde95(0x16e))/0xa;if(_0x27f354===_0x571ea0)break;else _0x2279ac['push'](_0x2279ac['shift']());}catch(_0x28ed93){_0x2279ac['push'](_0x2279ac['shift']());}}}(a0_0x553b,0xa4d4b));import{EventEmitter as a0_0xa68ba1}from'events';import{hostname as a0_0x1bf696}from'os';function a0_0x7640(_0x2f518a,_0x572292){_0x2f518a=_0x2f518a-0x151;const _0x553b2a=a0_0x553b();let _0x76401e=_0x553b2a[_0x2f518a];return _0x76401e;}class T extends a0_0xa68ba1{[a0_0x2ddb81(0x1a3)];[a0_0x2ddb81(0x189)];[a0_0x2ddb81(0x168)];['agent'];['resumeId'];[a0_0x2ddb81(0x16c)];[a0_0x2ddb81(0x15d)];[a0_0x2ddb81(0x188)];[a0_0x2ddb81(0x17a)];['running']=!0x1;constructor(_0x4b8ce8){const _0xf516a7=a0_0x2ddb81;super();if(this[_0xf516a7(0x1a3)]=_0x4b8ce8[_0xf516a7(0x1a3)][_0xf516a7(0x157)](/\/$/,''),this[_0xf516a7(0x189)]=_0x4b8ce8[_0xf516a7(0x189)],this[_0xf516a7(0x168)]=_0x4b8ce8['token'],this['agent']=_0x4b8ce8['agent']||'sdk',this[_0xf516a7(0x1a5)]=_0xf516a7(0x17c)+_0x4b8ce8[_0xf516a7(0x189)]+'-'+Date[_0xf516a7(0x172)]()['toString'](0x24),this[_0xf516a7(0x16c)]=_0x4b8ce8[_0xf516a7(0x16c)]??0x2bf20,this[_0xf516a7(0x15d)]=_0x4b8ce8[_0xf516a7(0x15d)]??0xbb8,_0x4b8ce8[_0xf516a7(0x156)]!==!0x1)this[_0xf516a7(0x196)]();}[a0_0x2ddb81(0x19e)](_0x5beccc){const _0x3a960a=a0_0x2ddb81;console[_0x3a960a(0x19e)]('['+new Date()[_0x3a960a(0x19b)]()[_0x3a960a(0x167)](0x0,0x8)+']\x20[commhub:'+this[_0x3a960a(0x189)]+']\x20'+_0x5beccc);}async[a0_0x2ddb81(0x18f)](_0x3d1633,_0x5555ee){const _0x1c2321=a0_0x2ddb81;let _0x34311b={'Content-Type':_0x1c2321(0x19c),'Accept':_0x1c2321(0x163)};if(this[_0x1c2321(0x168)])_0x34311b[_0x1c2321(0x154)]=_0x1c2321(0x19f)+this['token'];let _0x2241c0=await(await fetch(this[_0x1c2321(0x1a3)]+'/mcp',{'method':_0x1c2321(0x175),'headers':_0x34311b,'body':JSON[_0x1c2321(0x15f)]({'jsonrpc':'2.0','id':Date[_0x1c2321(0x172)](),'method':_0x1c2321(0x18b),'params':{'name':_0x3d1633,'arguments':_0x5555ee}})}))[_0x1c2321(0x1a4)](),_0x3bf8f5=_0x2241c0['match'](/data: (.+)/),_0x485a77=_0x3bf8f5?JSON[_0x1c2321(0x195)](_0x3bf8f5[0x1]):JSON[_0x1c2321(0x195)](_0x2241c0),_0x23fdcf=_0x485a77?.[_0x1c2321(0x198)]?.[_0x1c2321(0x170)]?.[0x0]?.[_0x1c2321(0x1a4)];return _0x23fdcf?JSON[_0x1c2321(0x195)](_0x23fdcf):_0x485a77;}async[a0_0x2ddb81(0x196)](){const _0x390bf0=a0_0x2ddb81;if(this[_0x390bf0(0x1a0)])return;this['running']=!0x0,await this[_0x390bf0(0x176)](_0x390bf0(0x192)),this[_0x390bf0(0x19e)](_0x390bf0(0x185)),this[_0x390bf0(0x188)]=setInterval(()=>{const _0xfa9799=_0x390bf0;this[_0xfa9799(0x176)](_0xfa9799(0x192))[_0xfa9799(0x17b)](_0x466905=>this['log'](_0xfa9799(0x15e)+_0x466905[_0xfa9799(0x19d)]));},this[_0x390bf0(0x16c)]),this[_0x390bf0(0x16b)]();}async[a0_0x2ddb81(0x174)](){const _0x49ad01=a0_0x2ddb81;if(this[_0x49ad01(0x1a0)]=!0x1,this['sseAbort']?.[_0x49ad01(0x15a)](),this['heartbeatTimer'])clearInterval(this['heartbeatTimer']);await this[_0x49ad01(0x176)](_0x49ad01(0x169))['catch'](()=>{}),this[_0x49ad01(0x19e)](_0x49ad01(0x193));}async['send'](_0x391804,_0x5b7311,_0x47d6bd=a0_0x2ddb81(0x184)){const _0x4a3f1e=a0_0x2ddb81;return this['call']('send_task',{'alias':_0x391804,'task':_0x5b7311,'priority':_0x47d6bd,'from_session':this[_0x4a3f1e(0x189)]});}async[a0_0x2ddb81(0x19d)](_0x4b0906,_0x19af9b){const _0x179b41=a0_0x2ddb81;return this[_0x179b41(0x18f)](_0x179b41(0x153),{'alias':_0x4b0906,'message':_0x19af9b,'from_session':this[_0x179b41(0x189)]});}async[a0_0x2ddb81(0x190)](_0x2ed97a,_0x13bf75,_0x1f5902=a0_0x2ddb81(0x18e)){const _0x107b6c=a0_0x2ddb81;return this[_0x107b6c(0x18f)]('reply',{'task_id':_0x2ed97a,'text':_0x13bf75,'status':_0x1f5902});}async[a0_0x2ddb81(0x176)](_0xb17690,_0xa363cb){const _0xfa863e=a0_0x2ddb81;return this[_0xfa863e(0x18f)]('report_status',{'resume_id':this[_0xfa863e(0x1a5)],'alias':this[_0xfa863e(0x189)],'status':_0xb17690,'server':a0_0x1bf696(),'hostname':a0_0x1bf696(),'agent':this['agent'],'project_dir':process[_0xfa863e(0x152)](),..._0xa363cb});}async[a0_0x2ddb81(0x180)](){const _0x32cb66=a0_0x2ddb81;return this[_0x32cb66(0x18f)](_0x32cb66(0x171),{});}async[a0_0x2ddb81(0x15b)](_0x1ee427,_0x547b75){const _0x218233=a0_0x2ddb81;return this[_0x218233(0x18f)]('broadcast',{'message':_0x1ee427,'filter_server':_0x547b75?.['server'],'filter_status':_0x547b75?.[_0x218233(0x176)]});}async[a0_0x2ddb81(0x16b)](){const _0x3297b1=a0_0x2ddb81;let _0x1dd5f2=encodeURIComponent(this['alias']),_0x21d3d9=this[_0x3297b1(0x1a3)]+_0x3297b1(0x161)+_0x1dd5f2,_0x724779=this[_0x3297b1(0x15d)];while(this[_0x3297b1(0x1a0)]){try{this['sseAbort']=new AbortController();let _0x5ee5d0={'Accept':_0x3297b1(0x187)};if(this[_0x3297b1(0x168)])_0x5ee5d0['Authorization']=_0x3297b1(0x19f)+this[_0x3297b1(0x168)];let _0x569538=await fetch(_0x21d3d9,{'headers':_0x5ee5d0,'signal':this[_0x3297b1(0x17a)][_0x3297b1(0x165)]});if(!_0x569538['ok']||!_0x569538[_0x3297b1(0x159)]){this['log']('SSE\x20failed:\x20'+_0x569538['status']),await this[_0x3297b1(0x164)](_0x724779),_0x724779=Math[_0x3297b1(0x183)](_0x724779*1.5,0xea60);continue;}_0x724779=this[_0x3297b1(0x15d)];let _0x3eddb3=_0x569538[_0x3297b1(0x159)]['getReader'](),_0x1fc491=new TextDecoder(),_0x12d758='';while(this[_0x3297b1(0x1a0)]){let {done:_0x59e188,value:_0xbbc878}=await _0x3eddb3[_0x3297b1(0x17f)]();if(_0x59e188)break;_0x12d758+=_0x1fc491[_0x3297b1(0x178)](_0xbbc878,{'stream':!0x0});let _0x48b551=_0x12d758[_0x3297b1(0x199)]('\x0a');_0x12d758=_0x48b551[_0x3297b1(0x17e)]()||'';for(let _0x2257e3 of _0x48b551){if(!_0x2257e3['startsWith'](_0x3297b1(0x1a1)))continue;try{let _0x9542a2=JSON[_0x3297b1(0x195)](_0x2257e3[_0x3297b1(0x167)](0x6));if(_0x9542a2[_0x3297b1(0x155)]==='connected'){this['log'](_0x3297b1(0x177)),this[_0x3297b1(0x15c)](_0x3297b1(0x179));continue;}if(_0x9542a2[_0x3297b1(0x155)]==='new_task'||_0x9542a2[_0x3297b1(0x155)]===_0x3297b1(0x182)||_0x9542a2[_0x3297b1(0x155)]===_0x3297b1(0x15b))await this[_0x3297b1(0x18a)]();}catch{}}}}catch(_0x301d6a){if(_0x301d6a['name']===_0x3297b1(0x186))break;this[_0x3297b1(0x15c)]('error',_0x301d6a),this[_0x3297b1(0x19e)](_0x3297b1(0x18c)+_0x301d6a['message']);}if(this['running'])this[_0x3297b1(0x15c)]('disconnected'),this['log'](_0x3297b1(0x173)+_0x724779/0x3e8+_0x3297b1(0x16d)),await this[_0x3297b1(0x164)](_0x724779),_0x724779=Math[_0x3297b1(0x183)](_0x724779*1.5,0xea60);}}async[a0_0x2ddb81(0x18a)](){const _0x1a1d60=a0_0x2ddb81;try{let _0x1a2b56=(await this[_0x1a1d60(0x18f)](_0x1a1d60(0x166),{'alias':this['alias'],'limit':0xa}))?.[_0x1a1d60(0x151)]||[];for(let _0x44a4df of _0x1a2b56)await this[_0x1a1d60(0x18f)](_0x1a1d60(0x1a2),{'alias':this[_0x1a1d60(0x189)],'message_id':_0x44a4df['id']}),this[_0x1a1d60(0x19e)]('←\x20'+_0x44a4df[_0x1a1d60(0x18d)]+':\x20'+_0x44a4df['content']['slice'](0x0,0x3c)),this[_0x1a1d60(0x15c)](_0x1a1d60(0x194),_0x44a4df),this['emit'](_0x1a1d60(0x19d),_0x44a4df);}catch(_0x365d44){this['log'](_0x1a1d60(0x160)+_0x365d44[_0x1a1d60(0x19d)]);}}['sleep'](_0x4adac9){return new Promise(_0x489ebe=>setTimeout(_0x489ebe,_0x4adac9));}}var $=T;function a0_0x553b(){const _0x58c3f3=['9083781sRzQbP','toTimeString','application/json','message','log','Bearer\x20','running','data:\x20','ack_inbox','url','text','resumeId','messages','cwd','send_message','Authorization','type','autoConnect','replace','3530584ZDAbAm','body','abort','broadcast','emit','reconnectDelay','heartbeat\x20failed:\x20','stringify','inbox\x20error:\x20','/events/','3414084wYWpuz','application/json,\x20text/event-stream','sleep','signal','get_inbox','slice','token','offline','1137687TPzkfl','connectSSE','heartbeatInterval','s...','19776980dJyOau','293874sttZbd','content','get_all_status','now','SSE\x20reconnecting\x20in\x20','disconnect','POST','status','SSE\x20connected','decode','connected','sseAbort','catch','sdk-','2EPQdEu','pop','read','getAllStatus','10jbMYmL','new_message','min','normal','registered','AbortError','text/event-stream','heartbeatTimer','alias','processInbox','tools/call','SSE\x20error:\x20','from_session','completed','call','reply','8CwpoYC','idle','disconnected','task','parse','connect','3242883ENFsQG','result','split'];a0_0x553b=function(){return _0x58c3f3;};return a0_0x553b();}export{$ as default,T as CommHub};
1
+ const a0_0x31904f=a0_0x2e0a;(function(_0x397b54,_0x5d033){const _0x5bb7d3=a0_0x2e0a,_0x405c98=_0x397b54();while(!![]){try{const _0x1cbe9c=-parseInt(_0x5bb7d3(0x12f))/0x1*(parseInt(_0x5bb7d3(0x161))/0x2)+-parseInt(_0x5bb7d3(0x113))/0x3*(parseInt(_0x5bb7d3(0x14f))/0x4)+parseInt(_0x5bb7d3(0x138))/0x5+-parseInt(_0x5bb7d3(0x149))/0x6+parseInt(_0x5bb7d3(0x131))/0x7+-parseInt(_0x5bb7d3(0x16d))/0x8*(-parseInt(_0x5bb7d3(0x129))/0x9)+-parseInt(_0x5bb7d3(0x169))/0xa*(parseInt(_0x5bb7d3(0x13d))/0xb);if(_0x1cbe9c===_0x5d033)break;else _0x405c98['push'](_0x405c98['shift']());}catch(_0x32573){_0x405c98['push'](_0x405c98['shift']());}}}(a0_0xc854,0x91728));import{EventEmitter as a0_0x3841fd}from'events';function a0_0xc854(){const _0x3094da=['inbox\x20error:\x20','connect','/mcp','data:\x20','sdk','report_status','result','body','1768ZztkUw','disconnect','message','catch','broadcast','call','type','send','96070tnNLef','toTimeString','error','Authorization','5634456QhuptM','SSE\x20connected','123ZcTLTb','getAllStatus','toString','disconnected','alias','server','connectSSE','tools/call','/events/','agent','new_task','heartbeatTimer','slice','SSE\x20error:\x20','text/event-stream','now','resumeId','content','normal','token','registered','emit','9IohOEG','url','heartbeat\x20failed:\x20','running','split','sleep','715ThafQu','from_session','7212310aWuShN','sdk-','completed','signal','reconnectDelay','SSE\x20reconnecting\x20in\x20','send_message','5418850JJfEWM','connected','get_all_status','parse',']\x20[commhub:','473cfgIcm','2.0','offline','sseAbort','match','min','AbortError','startsWith','ack_inbox','cwd','POST','application/json,\x20text/event-stream','3900912IFxyIT','send_task','Bearer\x20','stringify','reply','log','51448WLbWmj','idle','text','status','replace','processInbox','read','s...','getReader','heartbeatInterval'];a0_0xc854=function(){return _0x3094da;};return a0_0xc854();}import{hostname as a0_0x258c38}from'os';class T extends a0_0x3841fd{[a0_0x31904f(0x12a)];[a0_0x31904f(0x117)];[a0_0x31904f(0x126)];[a0_0x31904f(0x11c)];[a0_0x31904f(0x123)];[a0_0x31904f(0x158)];['reconnectDelay'];[a0_0x31904f(0x11e)];[a0_0x31904f(0x140)];[a0_0x31904f(0x12c)]=!0x1;constructor(_0x21766c){const _0x269059=a0_0x31904f;super();if(this[_0x269059(0x12a)]=_0x21766c[_0x269059(0x12a)][_0x269059(0x153)](/\/$/,''),this[_0x269059(0x117)]=_0x21766c[_0x269059(0x117)],this[_0x269059(0x126)]=_0x21766c['token'],this['agent']=_0x21766c[_0x269059(0x11c)]||_0x269059(0x15d),this[_0x269059(0x123)]=_0x269059(0x132)+_0x21766c[_0x269059(0x117)]+'-'+Date[_0x269059(0x122)]()[_0x269059(0x115)](0x24),this['heartbeatInterval']=_0x21766c[_0x269059(0x158)]??0x2bf20,this[_0x269059(0x135)]=_0x21766c[_0x269059(0x135)]??0xbb8,_0x21766c['autoConnect']!==!0x1)this[_0x269059(0x15a)]();}[a0_0x31904f(0x14e)](_0x49675c){const _0x488d6f=a0_0x31904f;console[_0x488d6f(0x14e)]('['+new Date()[_0x488d6f(0x16a)]()[_0x488d6f(0x11f)](0x0,0x8)+_0x488d6f(0x13c)+this[_0x488d6f(0x117)]+']\x20'+_0x49675c);}async[a0_0x31904f(0x166)](_0x2f1899,_0x4b2a9b){const _0xe5c2d2=a0_0x31904f;let _0x41b011={'Content-Type':'application/json','Accept':_0xe5c2d2(0x148)};if(this[_0xe5c2d2(0x126)])_0x41b011['Authorization']=_0xe5c2d2(0x14b)+this[_0xe5c2d2(0x126)];let _0x12d317=await(await fetch(this['url']+_0xe5c2d2(0x15b),{'method':_0xe5c2d2(0x147),'headers':_0x41b011,'body':JSON[_0xe5c2d2(0x14c)]({'jsonrpc':_0xe5c2d2(0x13e),'id':Date[_0xe5c2d2(0x122)](),'method':_0xe5c2d2(0x11a),'params':{'name':_0x2f1899,'arguments':_0x4b2a9b}})}))[_0xe5c2d2(0x151)](),_0x2bbd13=_0x12d317[_0xe5c2d2(0x141)](/data: (.+)/),_0x29716e=_0x2bbd13?JSON[_0xe5c2d2(0x13b)](_0x2bbd13[0x1]):JSON[_0xe5c2d2(0x13b)](_0x12d317),_0x17e04f=_0x29716e?.[_0xe5c2d2(0x15f)]?.[_0xe5c2d2(0x124)]?.[0x0]?.[_0xe5c2d2(0x151)];return _0x17e04f?JSON[_0xe5c2d2(0x13b)](_0x17e04f):_0x29716e;}async[a0_0x31904f(0x15a)](){const _0x5279ff=a0_0x31904f;if(this[_0x5279ff(0x12c)])return;this[_0x5279ff(0x12c)]=!0x0,await this[_0x5279ff(0x152)](_0x5279ff(0x150)),this[_0x5279ff(0x14e)](_0x5279ff(0x127)),this['heartbeatTimer']=setInterval(()=>{const _0x267459=_0x5279ff;this[_0x267459(0x152)](_0x267459(0x150))['catch'](_0x32e402=>this[_0x267459(0x14e)](_0x267459(0x12b)+_0x32e402[_0x267459(0x163)]));},this[_0x5279ff(0x158)]),this['connectSSE']();}async[a0_0x31904f(0x162)](){const _0x1fbeab=a0_0x31904f;if(this['running']=!0x1,this[_0x1fbeab(0x140)]?.['abort'](),this[_0x1fbeab(0x11e)])clearInterval(this['heartbeatTimer']);await this['status'](_0x1fbeab(0x13f))[_0x1fbeab(0x164)](()=>{}),this[_0x1fbeab(0x14e)](_0x1fbeab(0x116));}async[a0_0x31904f(0x168)](_0x4e55b6,_0x163387,_0x1ba137=a0_0x31904f(0x125)){const _0x4a6781=a0_0x31904f;return this[_0x4a6781(0x166)](_0x4a6781(0x14a),{'alias':_0x4e55b6,'task':_0x163387,'priority':_0x1ba137,'from_session':this['alias']});}async[a0_0x31904f(0x163)](_0x2b0023,_0x55457c){const _0x3e4d05=a0_0x31904f;return this[_0x3e4d05(0x166)](_0x3e4d05(0x137),{'alias':_0x2b0023,'message':_0x55457c,'from_session':this[_0x3e4d05(0x117)]});}async[a0_0x31904f(0x14d)](_0x21d679,_0x24734a,_0x180ba0=a0_0x31904f(0x133)){const _0xb7ff1d=a0_0x31904f;return this[_0xb7ff1d(0x166)](_0xb7ff1d(0x14d),{'task_id':_0x21d679,'text':_0x24734a,'status':_0x180ba0});}async[a0_0x31904f(0x152)](_0x4e422e,_0xe9a122){const _0x3e4e81=a0_0x31904f;return this['call'](_0x3e4e81(0x15e),{'resume_id':this['resumeId'],'alias':this[_0x3e4e81(0x117)],'status':_0x4e422e,'server':a0_0x258c38(),'hostname':a0_0x258c38(),'agent':this[_0x3e4e81(0x11c)],'project_dir':process[_0x3e4e81(0x146)](),..._0xe9a122});}async[a0_0x31904f(0x114)](){const _0x21598d=a0_0x31904f;return this[_0x21598d(0x166)](_0x21598d(0x13a),{});}async['broadcast'](_0x625117,_0x2c409f){const _0x19a956=a0_0x31904f;return this[_0x19a956(0x166)](_0x19a956(0x165),{'message':_0x625117,'filter_server':_0x2c409f?.[_0x19a956(0x118)],'filter_status':_0x2c409f?.[_0x19a956(0x152)]});}async[a0_0x31904f(0x119)](){const _0x1bc8f6=a0_0x31904f;let _0x3fecd4=encodeURIComponent(this[_0x1bc8f6(0x117)]),_0x5972d5=this[_0x1bc8f6(0x12a)]+_0x1bc8f6(0x11b)+_0x3fecd4,_0x3f0e0a=this[_0x1bc8f6(0x135)];while(this[_0x1bc8f6(0x12c)]){try{this['sseAbort']=new AbortController();let _0x9175f4={'Accept':_0x1bc8f6(0x121)};if(this[_0x1bc8f6(0x126)])_0x9175f4[_0x1bc8f6(0x16c)]=_0x1bc8f6(0x14b)+this[_0x1bc8f6(0x126)];let _0x4a23ce=await fetch(_0x5972d5,{'headers':_0x9175f4,'signal':this[_0x1bc8f6(0x140)][_0x1bc8f6(0x134)]});if(!_0x4a23ce['ok']||!_0x4a23ce[_0x1bc8f6(0x160)]){this[_0x1bc8f6(0x14e)]('SSE\x20failed:\x20'+_0x4a23ce[_0x1bc8f6(0x152)]),await this[_0x1bc8f6(0x12e)](_0x3f0e0a),_0x3f0e0a=Math['min'](_0x3f0e0a*1.5,0xea60);continue;}_0x3f0e0a=this[_0x1bc8f6(0x135)];let _0x583c0d=_0x4a23ce['body'][_0x1bc8f6(0x157)](),_0x373f18=new TextDecoder(),_0x198ee8='';while(this[_0x1bc8f6(0x12c)]){let {done:_0x44202c,value:_0x49aa0d}=await _0x583c0d[_0x1bc8f6(0x155)]();if(_0x44202c)break;_0x198ee8+=_0x373f18['decode'](_0x49aa0d,{'stream':!0x0});let _0x1b221b=_0x198ee8[_0x1bc8f6(0x12d)]('\x0a');_0x198ee8=_0x1b221b['pop']()||'';for(let _0x5f29ae of _0x1b221b){if(!_0x5f29ae[_0x1bc8f6(0x144)](_0x1bc8f6(0x15c)))continue;try{let _0x306e99=JSON[_0x1bc8f6(0x13b)](_0x5f29ae['slice'](0x6));if(_0x306e99[_0x1bc8f6(0x167)]===_0x1bc8f6(0x139)){this['log'](_0x1bc8f6(0x112)),this['emit'](_0x1bc8f6(0x139));continue;}if(_0x306e99[_0x1bc8f6(0x167)]===_0x1bc8f6(0x11d)||_0x306e99[_0x1bc8f6(0x167)]==='new_message'||_0x306e99[_0x1bc8f6(0x167)]===_0x1bc8f6(0x165))await this[_0x1bc8f6(0x154)]();}catch{}}}}catch(_0x3f3449){if(_0x3f3449['name']===_0x1bc8f6(0x143))break;this[_0x1bc8f6(0x128)](_0x1bc8f6(0x16b),_0x3f3449),this[_0x1bc8f6(0x14e)](_0x1bc8f6(0x120)+_0x3f3449[_0x1bc8f6(0x163)]);}if(this[_0x1bc8f6(0x12c)])this[_0x1bc8f6(0x128)](_0x1bc8f6(0x116)),this[_0x1bc8f6(0x14e)](_0x1bc8f6(0x136)+_0x3f0e0a/0x3e8+_0x1bc8f6(0x156)),await this[_0x1bc8f6(0x12e)](_0x3f0e0a),_0x3f0e0a=Math[_0x1bc8f6(0x142)](_0x3f0e0a*1.5,0xea60);}}async['processInbox'](){const _0x1a589d=a0_0x31904f;try{let _0xbd8778=(await this[_0x1a589d(0x166)]('get_inbox',{'alias':this[_0x1a589d(0x117)],'limit':0xa}))?.['messages']||[];for(let _0x230efc of _0xbd8778)await this[_0x1a589d(0x166)](_0x1a589d(0x145),{'alias':this[_0x1a589d(0x117)],'message_id':_0x230efc['id']}),this[_0x1a589d(0x14e)]('←\x20'+_0x230efc[_0x1a589d(0x130)]+':\x20'+_0x230efc[_0x1a589d(0x124)]['slice'](0x0,0x3c)),this[_0x1a589d(0x128)]('task',_0x230efc),this['emit']('message',_0x230efc);}catch(_0x3efbd2){this[_0x1a589d(0x14e)](_0x1a589d(0x159)+_0x3efbd2['message']);}}[a0_0x31904f(0x12e)](_0x4102ef){return new Promise(_0x49d780=>setTimeout(_0x49d780,_0x4102ef));}}function a0_0x2e0a(_0x2873e9,_0x4c7f2d){_0x2873e9=_0x2873e9-0x112;const _0xc8541=a0_0xc854();let _0x2e0a2c=_0xc8541[_0x2873e9];return _0x2e0a2c;}var $=T;export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x16766a=a0_0x2dc8;(function(_0x4193fb,_0x2e981a){const _0x52a6c2=a0_0x2dc8,_0x17fcbd=_0x4193fb();while(!![]){try{const _0x23ceb8=parseInt(_0x52a6c2(0x19a))/0x1+parseInt(_0x52a6c2(0x182))/0x2*(-parseInt(_0x52a6c2(0x1c4))/0x3)+parseInt(_0x52a6c2(0x181))/0x4*(-parseInt(_0x52a6c2(0x162))/0x5)+parseInt(_0x52a6c2(0x1ac))/0x6*(parseInt(_0x52a6c2(0x1a4))/0x7)+-parseInt(_0x52a6c2(0x177))/0x8*(parseInt(_0x52a6c2(0x1eb))/0x9)+parseInt(_0x52a6c2(0x1ad))/0xa+-parseInt(_0x52a6c2(0x195))/0xb;if(_0x23ceb8===_0x2e981a)break;else _0x17fcbd['push'](_0x17fcbd['shift']());}catch(_0x341097){_0x17fcbd['push'](_0x17fcbd['shift']());}}}(a0_0x4247,0x74434));import{readFileSync as a0_0x43b0d8,existsSync as a0_0x4e3f2f}from'fs';import{join as a0_0x2e8ef5}from'path';import{hostname as a0_0x4e00a0}from'os';import{execSync as a0_0x39a5e2}from'child_process';import{Server as a0_0x2d2b60}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x5c0542}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x224a39,CallToolRequestSchema as a0_0x175ca4}from'@modelcontextprotocol/sdk/types.js';function p(_0x4c819f){const _0x26b5b6=a0_0x2dc8;if(!a0_0x4e3f2f(_0x4c819f))return;for(let _0x237c30 of a0_0x43b0d8(_0x4c819f,_0x26b5b6(0x1a2))[_0x26b5b6(0x174)]('\x0a')){let _0x2f81ef=_0x237c30[_0x26b5b6(0x1d3)]();if(!_0x2f81ef||_0x2f81ef[_0x26b5b6(0x1e1)]('#'))continue;let _0x8e6bc6=_0x2f81ef[_0x26b5b6(0x1ab)]('=');if(_0x8e6bc6<0x0)continue;let _0x2379b5=_0x2f81ef[_0x26b5b6(0x197)](0x0,_0x8e6bc6)[_0x26b5b6(0x1d3)](),_0x52166b=_0x2f81ef[_0x26b5b6(0x197)](_0x8e6bc6+0x1)[_0x26b5b6(0x1d3)]()[_0x26b5b6(0x169)](/^["']|["']$/g,'');if(!process.env[_0x2379b5])process.env[_0x2379b5]=_0x52166b;}}var C=process.env.HOME||'~',T=a0_0x2e8ef5(C,a0_0x16766a(0x1e0));p(a0_0x2e8ef5(T,a0_0x16766a(0x184)));var L=process['cwd']()['replace'](/\//g,'-');p(a0_0x2e8ef5(T,L,a0_0x16766a(0x184)));function U(){const _0x2329f7=a0_0x16766a;try{return a0_0x39a5e2(_0x2329f7(0x164),{'encoding':_0x2329f7(0x1a2),'timeout':0x7d0})[_0x2329f7(0x1d3)]();}catch{return'';}}function c(){const _0x3875d5=a0_0x16766a;try{let _0x2c98bb=a0_0x2e8ef5(C,_0x3875d5(0x17f),_0x3875d5(0x18c));if(a0_0x4e3f2f(_0x2c98bb))return JSON[_0x3875d5(0x167)](a0_0x43b0d8(_0x2c98bb,_0x3875d5(0x1a2)));}catch{}return{};}var H=c(),D=process.env.COMMHUB_URL||H[a0_0x16766a(0x1cd)]||a0_0x16766a(0x1ba),f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0x4e00a0(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto['randomUUID'](),X=process.env.COMMHUB_TOKEN||H[a0_0x16766a(0x1c6)]||'';function Y(_0x3ba904){const _0x1d0991=a0_0x16766a;let _0x432937=new Date()[_0x1d0991(0x16d)]()['slice'](0x0,0x8);process[_0x1d0991(0x1a6)][_0x1d0991(0x1ce)]('['+_0x432937+_0x1d0991(0x18d)+_0x3ba904+'\x0a');}function h(_0x2642e1){return new Promise(_0x2baa43=>setTimeout(_0x2baa43,_0x2642e1));}Y(a0_0x16766a(0x198)+D+'\x20ALIAS='+Z+a0_0x16766a(0x1cb)+w[a0_0x16766a(0x197)](0x0,0x8)+a0_0x16766a(0x1b0)+(f||a0_0x16766a(0x1a1))+a0_0x16766a(0x168)+process[a0_0x16766a(0x190)]()+a0_0x16766a(0x173)+L);var k=new Map(),K=new a0_0x2d2b60({'name':a0_0x16766a(0x172),'version':'0.3.0'},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x16766a(0x1b6),'These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.',a0_0x16766a(0x1c3),a0_0x16766a(0x1bc),a0_0x16766a(0x1c5)+Z][a0_0x16766a(0x165)]('\x0a')});K[a0_0x16766a(0x18f)](a0_0x224a39,async()=>({'tools':[{'name':'commhub_reply','description':a0_0x16766a(0x16a),'inputSchema':{'type':a0_0x16766a(0x1b7),'properties':{'task_id':{'type':a0_0x16766a(0x16e),'description':a0_0x16766a(0x1d7)},'text':{'type':'string','description':a0_0x16766a(0x1cc)},'status':{'type':a0_0x16766a(0x16e),'enum':['completed',a0_0x16766a(0x1bd),a0_0x16766a(0x175),a0_0x16766a(0x160),'error','in_progress'],'description':a0_0x16766a(0x1a8)}},'required':[a0_0x16766a(0x15e)]}},{'name':a0_0x16766a(0x1e9),'description':'Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','inputSchema':{'type':'object','properties':{'status':{'type':a0_0x16766a(0x16e),'enum':[a0_0x16766a(0x1e5),a0_0x16766a(0x1bb),a0_0x16766a(0x160),a0_0x16766a(0x179)]},'task':{'type':a0_0x16766a(0x16e),'description':a0_0x16766a(0x1be)},'progress':{'type':a0_0x16766a(0x15f),'description':'Progress\x200-100'}},'required':[a0_0x16766a(0x171)]}},{'name':a0_0x16766a(0x1d9),'description':a0_0x16766a(0x1a0),'inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x16766a(0x16e),'description':a0_0x16766a(0x17c)},'task':{'type':a0_0x16766a(0x16e),'description':a0_0x16766a(0x1d8)},'priority':{'type':a0_0x16766a(0x16e),'enum':['high',a0_0x16766a(0x17a),a0_0x16766a(0x1d2)],'description':a0_0x16766a(0x1df)}},'required':[a0_0x16766a(0x1db),'task']}},{'name':'commhub_send_message','description':a0_0x16766a(0x1bf),'inputSchema':{'type':a0_0x16766a(0x1b7),'properties':{'alias':{'type':a0_0x16766a(0x16e),'description':a0_0x16766a(0x17c)},'message':{'type':a0_0x16766a(0x16e),'description':a0_0x16766a(0x19e)}},'required':[a0_0x16766a(0x1db),a0_0x16766a(0x185)]}},{'name':'commhub_get_all_status','description':a0_0x16766a(0x176),'inputSchema':{'type':a0_0x16766a(0x1b7),'properties':{}}}]}));async function P(_0x278c70,_0x4c07f2){const _0x96a6fc=a0_0x16766a;let _0x4d215a=await fetch(D+_0x96a6fc(0x1d6),{'method':_0x96a6fc(0x189),'headers':{'Content-Type':_0x96a6fc(0x1ec),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x96a6fc(0x199)+X}:{}},'body':JSON[_0x96a6fc(0x1b5)]({'jsonrpc':_0x96a6fc(0x1a9),'id':0x1,'method':_0x96a6fc(0x1ca),'params':{'protocolVersion':_0x96a6fc(0x18a),'capabilities':{},'clientInfo':{'name':_0x96a6fc(0x172),'version':_0x96a6fc(0x16b)}}})});if(!_0x4d215a['ok']){let _0x39a413=await _0x4d215a['text']();return Y(_0x96a6fc(0x1b9)+_0x4d215a[_0x96a6fc(0x171)]+'\x20'+_0x39a413[_0x96a6fc(0x197)](0x0,0x64)),{'ok':!0x1,'error':_0x96a6fc(0x1e2)+_0x4d215a[_0x96a6fc(0x171)]};}await _0x4d215a[_0x96a6fc(0x15e)]();let _0x2fa06e=(await(await fetch(D+_0x96a6fc(0x1d6),{'method':_0x96a6fc(0x189),'headers':{'Content-Type':_0x96a6fc(0x1ec),'Accept':_0x96a6fc(0x170),...X?{'Authorization':_0x96a6fc(0x199)+X}:{}},'body':JSON[_0x96a6fc(0x1b5)]({'jsonrpc':_0x96a6fc(0x1a9),'id':0x2,'method':_0x96a6fc(0x18b),'params':{'name':_0x278c70,'arguments':_0x4c07f2}})}))[_0x96a6fc(0x15e)]())['split']('\x0a')['find'](_0xec12cd=>_0xec12cd[_0x96a6fc(0x1e1)](_0x96a6fc(0x187)));if(_0x2fa06e){let _0x38a12b=JSON[_0x96a6fc(0x167)](_0x2fa06e[_0x96a6fc(0x197)](0x6));return _0x38a12b?.[_0x96a6fc(0x1d5)]?.['content']?.[0x0]?.[_0x96a6fc(0x15e)]?JSON[_0x96a6fc(0x167)](_0x38a12b[_0x96a6fc(0x1d5)][_0x96a6fc(0x1cf)][0x0][_0x96a6fc(0x15e)]):_0x38a12b;}return{'ok':!0x1,'error':_0x96a6fc(0x163)};}K[a0_0x16766a(0x18f)](a0_0x175ca4,async _0x4ba7fe=>{const _0x224045=a0_0x16766a;let {name:_0x2122b0,arguments:_0x295005}=_0x4ba7fe['params'];if(_0x2122b0==='commhub_reply'){let {task_id:_0x233c82,text:_0x3b4d94,status:_0x5255ae}=_0x295005;if(_0x5255ae==='completed'||_0x5255ae===_0x224045(0x1bd)||_0x5255ae===_0x224045(0x175)){let _0x5237bf=_0x5255ae===_0x224045(0x1b1)?_0x224045(0x1da):_0x5255ae,_0x66aee0=_0x233c82?k[_0x224045(0x1e3)](_0x233c82)||_0x224045(0x1cd):_0x224045(0x1cd),_0x51b20f=await P('send_reply',{'alias':_0x66aee0,'text':_0x3b4d94,'in_reply_to':_0x233c82||void 0x0,'status':_0x5237bf,'from_session':Z});if(_0x233c82)k[_0x224045(0x196)](_0x233c82);return{'content':[{'type':'text','text':JSON['stringify'](_0x51b20f)}]};}let _0x673633=await P(_0x224045(0x19b),{'resume_id':w,'alias':Z,'status':_0x5255ae===_0x224045(0x160)?_0x224045(0x160):_0x5255ae===_0x224045(0x179)?_0x224045(0x179):_0x224045(0x1e5),'task':_0x3b4d94['slice'](0x0,0xc8),'output':_0x3b4d94});return{'content':[{'type':_0x224045(0x15e),'text':JSON[_0x224045(0x1b5)](_0x673633)}]};}if(_0x2122b0===_0x224045(0x1e9)){let {status:_0x32e47a,task:_0x62aaf6,progress:_0x417eaf}=_0x295005,_0x4be021=await P(_0x224045(0x19b),{'resume_id':w,'alias':Z,'status':_0x32e47a,'task':_0x62aaf6,'progress':_0x417eaf});return{'content':[{'type':_0x224045(0x15e),'text':JSON[_0x224045(0x1b5)](_0x4be021)}]};}if(_0x2122b0==='commhub_send_task'){let {alias:_0x49b030,task:_0xf94fc7,priority:_0x528679}=_0x295005,_0x4580d2=await P('send_task',{'alias':_0x49b030,'task':_0xf94fc7,'priority':_0x528679||_0x224045(0x17a),'from_session':Z});return{'content':[{'type':_0x224045(0x15e),'text':JSON[_0x224045(0x1b5)](_0x4580d2)}]};}if(_0x2122b0==='commhub_send_message'){let {alias:_0x3b0572,message:_0x4df721}=_0x295005,_0x566a2c=await P('send_message',{'alias':_0x3b0572,'message':_0x4df721,'from_session':Z});return{'content':[{'type':_0x224045(0x15e),'text':JSON[_0x224045(0x1b5)](_0x566a2c)}]};}if(_0x2122b0===_0x224045(0x194)){let _0x2e32f2=await P(_0x224045(0x16f),{});return{'content':[{'type':_0x224045(0x15e),'text':JSON[_0x224045(0x1b5)](_0x2e32f2)}]};}return{'content':[{'type':'text','text':JSON[_0x224045(0x1b5)]({'error':'unknown\x20tool'})}]};});async function v(){const _0xd360b4=a0_0x16766a;let _0x2e54ae=D+_0xd360b4(0x1e7)+encodeURIComponent(Z),_0x20e2be={};if(X)_0x20e2be[_0xd360b4(0x1c0)]='Bearer\x20'+X;Y(_0xd360b4(0x1a5)+_0x2e54ae);while(!0x0){try{let _0x2f3db3=await fetch(_0x2e54ae,{'headers':_0x20e2be});if(!_0x2f3db3['ok']){Y(_0xd360b4(0x19f)+_0x2f3db3[_0xd360b4(0x171)]+'\x20'+_0x2f3db3[_0xd360b4(0x1d4)]),await h(0x1388);continue;}let _0x39bad8=_0x2f3db3[_0xd360b4(0x1a3)][_0xd360b4(0x1e8)](),_0x1f7a57=new TextDecoder(),_0x4a57f3='';while(!0x0){let {done:_0x2affe5,value:_0x532c8c}=await _0x39bad8[_0xd360b4(0x1d1)]();if(_0x2affe5)break;_0x4a57f3+=_0x1f7a57['decode'](_0x532c8c,{'stream':!0x0});let _0x120c8a=_0x4a57f3[_0xd360b4(0x174)]('\x0a\x0a');_0x4a57f3=_0x120c8a['pop']()||'';for(let _0x2f2a84 of _0x120c8a){let _0x21a3e4=_0x2f2a84[_0xd360b4(0x174)]('\x0a')['find'](_0x54bc1a=>_0x54bc1a['startsWith'](_0xd360b4(0x187)));if(!_0x21a3e4)continue;try{let _0x5958d9=JSON[_0xd360b4(0x167)](_0x21a3e4['slice'](0x6));await u(_0x5958d9);}catch(_0x30d7a0){Y(_0xd360b4(0x1af)+_0x30d7a0);}}}Y(_0xd360b4(0x1e4));}catch(_0x28bb77){Y(_0xd360b4(0x1e6)+_0x28bb77);}await h(0xbb8);}}async function u(_0x262405){const _0x3bc459=a0_0x16766a;if(_0x262405[_0x3bc459(0x1d0)]===_0x3bc459(0x180)){Y(_0x3bc459(0x188)+Z+'\x22');return;}if(_0x262405[_0x3bc459(0x1d0)]==='new_message'){if(Y(_0x3bc459(0x1b3)+_0x262405[_0x3bc459(0x178)]+':\x20'+_0x262405[_0x3bc459(0x185)]['slice'](0x0,0x3c)),await K[_0x3bc459(0x183)]({'method':'notifications/claude/channel','params':{'content':_0x262405['message'],'meta':{'sender':_0x262405[_0x3bc459(0x178)]||_0x3bc459(0x1cd),'sender_id':_0x3bc459(0x161),'user':_0x262405[_0x3bc459(0x178)]||_0x3bc459(0x1cd),'priority':_0x3bc459(0x17a)}}}),_0x262405['message_id'])await P(_0x3bc459(0x1a7),{'alias':Z,'message_id':_0x262405[_0x3bc459(0x1ae)]});return;}if(_0x262405['type']===_0x3bc459(0x1b4)||_0x262405['type']===_0x3bc459(0x17e)){Y('←\x20'+_0x262405[_0x3bc459(0x1d0)]+':\x20inbox_count='+_0x262405[_0x3bc459(0x1c1)]+_0x3bc459(0x17b)+(_0x262405[_0x3bc459(0x191)]||'normal'));let _0xdf945f=await P(_0x3bc459(0x192),{'alias':Z,'limit':0x5});if(_0xdf945f?.['ok']&&_0xdf945f[_0x3bc459(0x16c)]?.[_0x3bc459(0x1c7)]>0x0)for(let _0xaf4364 of _0xdf945f['messages']){let _0x343b83={'sender':_0xaf4364['from_session']||_0x3bc459(0x1cd),'sender_id':_0x3bc459(0x161),'user':_0xaf4364[_0x3bc459(0x186)]||_0x3bc459(0x1cd),'task_id':_0xaf4364['id'],'priority':_0xaf4364[_0x3bc459(0x191)]||_0x3bc459(0x17a)};k['set'](_0xaf4364['id'],_0xaf4364[_0x3bc459(0x186)]||'hub'),await K[_0x3bc459(0x183)]({'method':'notifications/claude/channel','params':{'content':_0xaf4364['content'],'meta':_0x343b83}}),Y('→\x20injected\x20task\x20'+_0xaf4364['id'][_0x3bc459(0x197)](0x0,0x8)+_0x3bc459(0x1b2)+_0xaf4364[_0x3bc459(0x186)]+':\x20'+_0xaf4364[_0x3bc459(0x1cf)][_0x3bc459(0x197)](0x0,0x3c)),await P(_0x3bc459(0x1a7),{'alias':Z,'message_id':_0xaf4364['id']});}}}async function S(){const _0x5667c7=a0_0x16766a;let _0x1c2891=new a0_0x5c0542();await K[_0x5667c7(0x1c8)](_0x1c2891),Y(_0x5667c7(0x1b8)),Y(_0x5667c7(0x1de)),v()[_0x5667c7(0x1dc)](_0x498696=>Y(_0x5667c7(0x19d)+_0x498696)),P(_0x5667c7(0x19b),{'resume_id':w,'alias':Z,'status':_0x5667c7(0x1bb),'server':a0_0x4e00a0(),'hostname':a0_0x4e00a0(),'agent':_0x5667c7(0x1aa),'project_dir':process[_0x5667c7(0x190)](),'tmux_name':f||void 0x0})['then'](()=>Y(_0x5667c7(0x1c2)+Z+'\x22\x20('+w['slice'](0x0,0x8)+')'))[_0x5667c7(0x1dc)](_0x552172=>Y(_0x5667c7(0x1dd)+_0x552172)),setInterval(()=>{const _0x3199c9=_0x5667c7;P(_0x3199c9(0x19b),{'resume_id':w,'alias':Z,'status':_0x3199c9(0x1bb),'server':a0_0x4e00a0(),'hostname':a0_0x4e00a0(),'agent':_0x3199c9(0x1aa),'project_dir':process[_0x3199c9(0x190)](),'tmux_name':f||void 0x0})[_0x3199c9(0x1dc)](_0x180d4e=>Y(_0x3199c9(0x19c)+_0x180d4e));},0x2bf20),Y(_0x5667c7(0x1ea));}S()['catch'](_0x589c69=>{Y('fatal:\x20'+_0x589c69),process['exit'](0x1);});function a0_0x2dc8(_0x4fcb7c,_0x378d52){_0x4fcb7c=_0x4fcb7c-0x15e;const _0x424793=a0_0x4247();let _0x2dc8eb=_0x424793[_0x4fcb7c];return _0x2dc8eb;}async function N(){const _0x3eec82=a0_0x16766a;Y(_0x3eec82(0x166)),await P(_0x3eec82(0x19b),{'resume_id':w,'alias':Z,'status':_0x3eec82(0x179),'task':_0x3eec82(0x193)})[_0x3eec82(0x1dc)](()=>{}),process[_0x3eec82(0x1c9)](0x0);}process['stdin']['on']('end',()=>N()),process['on'](a0_0x16766a(0x18e),()=>N()),process['on'](a0_0x16766a(0x17d),()=>N());function a0_0x4247(){const _0x5637f8=['result','/mcp','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','Task\x20content','commhub_send_task','replied','alias','catch','warning:\x20could\x20not\x20register:\x20','starting\x20SSE\x20listener...','Priority\x20(default:\x20normal)','.claude/channels/commhub','startsWith','init\x20failed:\x20','get','SSE\x20stream\x20ended,\x20reconnecting...','working','SSE\x20connection\x20error:\x20','/events/','getReader','commhub_report_status','ready\x20—\x20waiting\x20for\x20events','392760NdVqIY','application/json','text','number','blocked','commhub','734935LpsINA','no\x20response','tmux\x20display-message\x20-p\x20\x27#S\x27','join','shutting\x20down,\x20reporting\x20offline...','parse','\x20CWD=','replace','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','0.3.0','messages','toTimeString','string','get_all_status','application/json,\x20text/event-stream','status','commhub-channel','\x20PROJECT_ENV=','split','cancelled','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','96IixvJT','from','error','normal','\x20priority=','Target\x20session\x20alias','SIGINT','broadcast','.anet','connected','20XeaWJA','2LztPEp','notification','.env','message','from_session','data:\x20','SSE\x20connected\x20as\x20\x22','POST','2025-03-26','tools/call','config.json',']\x20[commhub]\x20','SIGTERM','setRequestHandler','cwd','priority','get_inbox','session\x20disconnected','commhub_get_all_status','3644322sqDRWE','delete','slice','ENV:\x20URL=','Bearer\x20','941249tqCGyW','report_status','heartbeat\x20failed:\x20','SSE\x20fatal:\x20','Message\x20content','SSE\x20error:\x20','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','none','utf-8','body','6422591wGNayJ','connecting\x20to\x20','stderr','ack_inbox','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','2.0','claude-code','indexOf','6TCqaEi','6101560heQssY','message_id','parse\x20error:\x20','...\x20TMUX=','completed','\x20from\x20','←\x20message\x20from\x20','new_task','stringify','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','object','MCP\x20stdio\x20connected','CommHub\x20init\x20failed:\x20','http://127.0.0.1:9200','idle','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','failed','Current\x20task\x20description','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','Authorization','inbox_count','registered\x20as\x20\x22','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','1208367lhKsLu','Session\x20alias:\x20','token','length','connect','exit','initialize','\x20RESUME_ID=','Reply\x20text\x20/\x20result\x20summary','hub','write','content','type','read','low','trim','statusText'];a0_0x4247=function(){return _0x5637f8;};return a0_0x4247();}
2
+ const a0_0x28e694=a0_0xe1c9;(function(_0x170564,_0x411b40){const _0x23135d=a0_0xe1c9,_0x2c4759=_0x170564();while(!![]){try{const _0x4cfb2c=-parseInt(_0x23135d(0x21e))/0x1*(parseInt(_0x23135d(0x23e))/0x2)+parseInt(_0x23135d(0x226))/0x3+-parseInt(_0x23135d(0x229))/0x4*(parseInt(_0x23135d(0x254))/0x5)+parseInt(_0x23135d(0x26a))/0x6+-parseInt(_0x23135d(0x26d))/0x7*(parseInt(_0x23135d(0x249))/0x8)+-parseInt(_0x23135d(0x24f))/0x9+parseInt(_0x23135d(0x25b))/0xa;if(_0x4cfb2c===_0x411b40)break;else _0x2c4759['push'](_0x2c4759['shift']());}catch(_0x589fb){_0x2c4759['push'](_0x2c4759['shift']());}}}(a0_0x5099,0x812bf));import{readFileSync as a0_0x32a021,existsSync as a0_0x2ff1c6}from'fs';import{join as a0_0x17852f}from'path';import{hostname as a0_0x345ca0}from'os';import{execSync as a0_0x32f729}from'child_process';import{Server as a0_0x3f4b6b}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x42cf96}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x206fa2,CallToolRequestSchema as a0_0x4a5706}from'@modelcontextprotocol/sdk/types.js';function p(_0x589740){const _0x1829a0=a0_0xe1c9;if(!a0_0x2ff1c6(_0x589740))return;for(let _0x48b687 of a0_0x32a021(_0x589740,_0x1829a0(0x241))['split']('\x0a')){let _0x1a8525=_0x48b687['trim']();if(!_0x1a8525||_0x1a8525[_0x1829a0(0x20a)]('#'))continue;let _0x5940f6=_0x1a8525[_0x1829a0(0x231)]('=');if(_0x5940f6<0x0)continue;let _0x456805=_0x1a8525[_0x1829a0(0x1fd)](0x0,_0x5940f6)[_0x1829a0(0x26b)](),_0x7e0236=_0x1a8525[_0x1829a0(0x1fd)](_0x5940f6+0x1)['trim']()['replace'](/^["']|["']$/g,'');if(!process.env[_0x456805])process.env[_0x456805]=_0x7e0236;}}var C=process.env.HOME||'~',T=a0_0x17852f(C,a0_0x28e694(0x262));p(a0_0x17852f(T,a0_0x28e694(0x26c)));var L=process[a0_0x28e694(0x1e4)]()['replace'](/\//g,'-');p(a0_0x17852f(T,L,a0_0x28e694(0x26c)));function a0_0xe1c9(_0x165f89,_0x2c8d86){_0x165f89=_0x165f89-0x1e2;const _0x509974=a0_0x5099();let _0xe1c9f8=_0x509974[_0x165f89];return _0xe1c9f8;}function U(){const _0x51acc5=a0_0x28e694;try{return a0_0x32f729(_0x51acc5(0x1e5),{'encoding':_0x51acc5(0x241),'timeout':0x7d0})['trim']();}catch{return'';}}function c(){const _0x2c9704=a0_0x28e694;try{let _0x1f677d=a0_0x17852f(C,_0x2c9704(0x1e6),_0x2c9704(0x228));if(a0_0x2ff1c6(_0x1f677d))return JSON[_0x2c9704(0x1f4)](a0_0x32a021(_0x1f677d,_0x2c9704(0x241)));}catch{}return{};}var H=c(),D=process.env.COMMHUB_URL||H[a0_0x28e694(0x213)]||a0_0x28e694(0x216),f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0x345ca0(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto['randomUUID'](),X=process.env.COMMHUB_TOKEN||H[a0_0x28e694(0x224)]||'';function a0_0x5099(){const _0x2a932e=['none','text','failed','alias','indexOf','string','exit','new_message','object','working','commhub','toTimeString','join','message_id','commhub_send_message','content','session\x20disconnected','4fuSWxq','commhub-channel','2.0','utf-8','send_message','ENV:\x20URL=','parse\x20error:\x20','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','result','normal','SSE\x20error:\x20','5581008hlLAyT','status','\x20ALIAS=','SSE\x20connection\x20error:\x20',']\x20[commhub]\x20','\x20RESUME_ID=','872856IkguWK','blocked','stderr','SIGTERM','body','15HACNKS','commhub_report_status','starting\x20SSE\x20listener...','params','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','Authorization','SSE\x20connected\x20as\x20\x22','27244830GflVfK','broadcast','get_all_status','\x20from\x20','write','notification','inbox_count','.claude/channels/commhub','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','\x20CWD=','high','idle','from_session','report_status','2017872qYaOtW','trim','.env','7TQtfeD','error',':\x20inbox_count=','split','cwd','tmux\x20display-message\x20-p\x20\x27#S\x27','.anet','connecting\x20to\x20','...\x20TMUX=','commhub_send_task','Bearer\x20','shutting\x20down,\x20reporting\x20offline...','completed','application/json,\x20text/event-stream','new_task','CommHub\x20init\x20failed:\x20','SSE\x20fatal:\x20','cancelled','/events/','priority','parse','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','registered\x20as\x20\x22','message','then','Session\x20alias:\x20','notifications/claude/channel','get_inbox','init\x20failed:\x20','slice','\x22\x20(','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','data:\x20','in_progress','0.3.0','stdin','find','ack_inbox','read','commhub_reply','SSE\x20stream\x20ended,\x20reconnecting...','catch','startsWith','stringify','unknown\x20tool','Reply\x20text\x20/\x20result\x20summary','set','from','length','claude-code','type','hub','Priority\x20(default:\x20normal)','send_task','http://127.0.0.1:9200','POST','Progress\x200-100','commhub_get_all_status','delete','connected','→\x20injected\x20task\x20','decode','519989CedzMa','get','Task\x20content','messages','MCP\x20stdio\x20connected','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','token','←\x20message\x20from\x20','36663OeBmVW','SIGINT','config.json','945788TjmflP','task','Target\x20session\x20alias','fatal:\x20'];a0_0x5099=function(){return _0x2a932e;};return a0_0x5099();}function Y(_0x285a60){const _0x548905=a0_0x28e694;let _0x4ef1b8=new Date()[_0x548905(0x238)]()[_0x548905(0x1fd)](0x0,0x8);process[_0x548905(0x251)][_0x548905(0x25f)]('['+_0x4ef1b8+_0x548905(0x24d)+_0x285a60+'\x0a');}function h(_0x8493e2){return new Promise(_0x45de6e=>setTimeout(_0x45de6e,_0x8493e2));}Y(a0_0x28e694(0x243)+D+a0_0x28e694(0x24b)+Z+a0_0x28e694(0x24e)+w[a0_0x28e694(0x1fd)](0x0,0x8)+a0_0x28e694(0x1e8)+(f||a0_0x28e694(0x22d))+a0_0x28e694(0x265)+process[a0_0x28e694(0x1e4)]()+'\x20PROJECT_ENV='+L);var k=new Map(),K=new a0_0x3f4b6b({'name':a0_0x28e694(0x23f),'version':a0_0x28e694(0x202)},{'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_0x28e694(0x263),a0_0x28e694(0x258),'You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.',a0_0x28e694(0x1f9)+Z][a0_0x28e694(0x239)]('\x0a')});K['setRequestHandler'](a0_0x206fa2,async()=>({'tools':[{'name':a0_0x28e694(0x207),'description':a0_0x28e694(0x1f5),'inputSchema':{'type':a0_0x28e694(0x235),'properties':{'task_id':{'type':a0_0x28e694(0x232),'description':a0_0x28e694(0x1ff)},'text':{'type':a0_0x28e694(0x232),'description':a0_0x28e694(0x20d)},'status':{'type':a0_0x28e694(0x232),'enum':['completed','failed',a0_0x28e694(0x1f1),a0_0x28e694(0x250),a0_0x28e694(0x26e),a0_0x28e694(0x201)],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':[a0_0x28e694(0x22e)]}},{'name':a0_0x28e694(0x255),'description':'Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','inputSchema':{'type':'object','properties':{'status':{'type':'string','enum':[a0_0x28e694(0x236),'idle',a0_0x28e694(0x250),a0_0x28e694(0x26e)]},'task':{'type':a0_0x28e694(0x232),'description':'Current\x20task\x20description'},'progress':{'type':'number','description':a0_0x28e694(0x218)}},'required':[a0_0x28e694(0x24a)]}},{'name':'commhub_send_task','description':a0_0x28e694(0x264),'inputSchema':{'type':a0_0x28e694(0x235),'properties':{'alias':{'type':a0_0x28e694(0x232),'description':a0_0x28e694(0x22b)},'task':{'type':a0_0x28e694(0x232),'description':a0_0x28e694(0x220)},'priority':{'type':'string','enum':[a0_0x28e694(0x266),a0_0x28e694(0x247),'low'],'description':a0_0x28e694(0x214)}},'required':[a0_0x28e694(0x230),a0_0x28e694(0x22a)]}},{'name':a0_0x28e694(0x23b),'description':a0_0x28e694(0x245),'inputSchema':{'type':a0_0x28e694(0x235),'properties':{'alias':{'type':a0_0x28e694(0x232),'description':a0_0x28e694(0x22b)},'message':{'type':'string','description':'Message\x20content'}},'required':[a0_0x28e694(0x230),a0_0x28e694(0x1f7)]}},{'name':a0_0x28e694(0x219),'description':a0_0x28e694(0x223),'inputSchema':{'type':'object','properties':{}}}]}));async function P(_0x56684a,_0xf45bed){const _0x139d18=a0_0x28e694;let _0x40fdc3=await fetch(D+'/mcp',{'method':_0x139d18(0x217),'headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream',...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x139d18(0x240),'id':0x1,'method':'initialize','params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x139d18(0x23f),'version':_0x139d18(0x202)}}})});if(!_0x40fdc3['ok']){let _0x45d280=await _0x40fdc3[_0x139d18(0x22e)]();return Y(_0x139d18(0x1ef)+_0x40fdc3[_0x139d18(0x24a)]+'\x20'+_0x45d280[_0x139d18(0x1fd)](0x0,0x64)),{'ok':!0x1,'error':_0x139d18(0x1fc)+_0x40fdc3[_0x139d18(0x24a)]};}await _0x40fdc3[_0x139d18(0x22e)]();let _0x41d8ca=(await(await fetch(D+'/mcp',{'method':'POST','headers':{'Content-Type':'application/json','Accept':_0x139d18(0x1ed),...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x139d18(0x240),'id':0x2,'method':'tools/call','params':{'name':_0x56684a,'arguments':_0xf45bed}})}))[_0x139d18(0x22e)]())[_0x139d18(0x1e3)]('\x0a')['find'](_0x12e0d1=>_0x12e0d1[_0x139d18(0x20a)](_0x139d18(0x200)));if(_0x41d8ca){let _0x13d5b4=JSON[_0x139d18(0x1f4)](_0x41d8ca[_0x139d18(0x1fd)](0x6));return _0x13d5b4?.[_0x139d18(0x246)]?.[_0x139d18(0x23c)]?.[0x0]?.[_0x139d18(0x22e)]?JSON[_0x139d18(0x1f4)](_0x13d5b4['result']['content'][0x0][_0x139d18(0x22e)]):_0x13d5b4;}return{'ok':!0x1,'error':'no\x20response'};}K['setRequestHandler'](a0_0x4a5706,async _0x87954f=>{const _0x47ce39=a0_0x28e694;let {name:_0x3e5a7a,arguments:_0x458668}=_0x87954f[_0x47ce39(0x257)];if(_0x3e5a7a===_0x47ce39(0x207)){let {task_id:_0x1f3bdd,text:_0x55785a,status:_0x189317}=_0x458668;if(_0x189317===_0x47ce39(0x1ec)||_0x189317===_0x47ce39(0x22f)||_0x189317===_0x47ce39(0x1f1)){let _0x3b45b4=_0x189317===_0x47ce39(0x1ec)?'replied':_0x189317,_0x48bedd=_0x1f3bdd?k[_0x47ce39(0x21f)](_0x1f3bdd)||'hub':_0x47ce39(0x213),_0x2376fe=await P('send_reply',{'alias':_0x48bedd,'text':_0x55785a,'in_reply_to':_0x1f3bdd||void 0x0,'status':_0x3b45b4,'from_session':Z});if(_0x1f3bdd)k[_0x47ce39(0x21a)](_0x1f3bdd);return{'content':[{'type':'text','text':JSON[_0x47ce39(0x20b)](_0x2376fe)}]};}let _0x3ed94e=await P(_0x47ce39(0x269),{'resume_id':w,'alias':Z,'status':_0x189317==='blocked'?_0x47ce39(0x250):_0x189317===_0x47ce39(0x26e)?_0x47ce39(0x26e):_0x47ce39(0x236),'task':_0x55785a[_0x47ce39(0x1fd)](0x0,0xc8),'output':_0x55785a});return{'content':[{'type':_0x47ce39(0x22e),'text':JSON[_0x47ce39(0x20b)](_0x3ed94e)}]};}if(_0x3e5a7a==='commhub_report_status'){let {status:_0x59aed5,task:_0x488865,progress:_0x147913}=_0x458668,_0x5358a6=await P(_0x47ce39(0x269),{'resume_id':w,'alias':Z,'status':_0x59aed5,'task':_0x488865,'progress':_0x147913});return{'content':[{'type':_0x47ce39(0x22e),'text':JSON[_0x47ce39(0x20b)](_0x5358a6)}]};}if(_0x3e5a7a===_0x47ce39(0x1e9)){let {alias:_0x203e5a,task:_0x42fabf,priority:_0x483d56}=_0x458668,_0x4c5653=await P(_0x47ce39(0x215),{'alias':_0x203e5a,'task':_0x42fabf,'priority':_0x483d56||_0x47ce39(0x247),'from_session':Z});return{'content':[{'type':_0x47ce39(0x22e),'text':JSON[_0x47ce39(0x20b)](_0x4c5653)}]};}if(_0x3e5a7a==='commhub_send_message'){let {alias:_0x35bebf,message:_0x45f96b}=_0x458668,_0x5f597b=await P(_0x47ce39(0x242),{'alias':_0x35bebf,'message':_0x45f96b,'from_session':Z});return{'content':[{'type':_0x47ce39(0x22e),'text':JSON['stringify'](_0x5f597b)}]};}if(_0x3e5a7a===_0x47ce39(0x219)){let _0x13c6f6=await P(_0x47ce39(0x25d),{});return{'content':[{'type':_0x47ce39(0x22e),'text':JSON[_0x47ce39(0x20b)](_0x13c6f6)}]};}return{'content':[{'type':_0x47ce39(0x22e),'text':JSON['stringify']({'error':_0x47ce39(0x20c)})}]};});async function v(){const _0x1e988c=a0_0x28e694;let _0x5abd5d=D+_0x1e988c(0x1f2)+encodeURIComponent(Z),_0x4473ac={};if(X)_0x4473ac[_0x1e988c(0x259)]=_0x1e988c(0x1ea)+X;Y(_0x1e988c(0x1e7)+_0x5abd5d);while(!0x0){try{let _0x1019da=await fetch(_0x5abd5d,{'headers':_0x4473ac});if(!_0x1019da['ok']){Y(_0x1e988c(0x248)+_0x1019da[_0x1e988c(0x24a)]+'\x20'+_0x1019da['statusText']),await h(0x1388);continue;}let _0x3fda85=_0x1019da[_0x1e988c(0x253)]['getReader'](),_0x308ce0=new TextDecoder(),_0x341d33='';while(!0x0){let {done:_0x2258c0,value:_0x2bf067}=await _0x3fda85[_0x1e988c(0x206)]();if(_0x2258c0)break;_0x341d33+=_0x308ce0[_0x1e988c(0x21d)](_0x2bf067,{'stream':!0x0});let _0x114c73=_0x341d33['split']('\x0a\x0a');_0x341d33=_0x114c73['pop']()||'';for(let _0x5848e3 of _0x114c73){let _0x4e3699=_0x5848e3['split']('\x0a')[_0x1e988c(0x204)](_0x56d793=>_0x56d793[_0x1e988c(0x20a)](_0x1e988c(0x200)));if(!_0x4e3699)continue;try{let _0x12939f=JSON[_0x1e988c(0x1f4)](_0x4e3699[_0x1e988c(0x1fd)](0x6));await u(_0x12939f);}catch(_0x26da38){Y(_0x1e988c(0x244)+_0x26da38);}}}Y(_0x1e988c(0x208));}catch(_0x430ccc){Y(_0x1e988c(0x24c)+_0x430ccc);}await h(0xbb8);}}async function u(_0x2bb88a){const _0x4bca02=a0_0x28e694;if(_0x2bb88a[_0x4bca02(0x212)]===_0x4bca02(0x21b)){Y(_0x4bca02(0x25a)+Z+'\x22');return;}if(_0x2bb88a[_0x4bca02(0x212)]===_0x4bca02(0x234)){if(Y(_0x4bca02(0x225)+_0x2bb88a[_0x4bca02(0x20f)]+':\x20'+_0x2bb88a[_0x4bca02(0x1f7)]['slice'](0x0,0x3c)),await K[_0x4bca02(0x260)]({'method':_0x4bca02(0x1fa),'params':{'content':_0x2bb88a[_0x4bca02(0x1f7)],'meta':{'sender':_0x2bb88a[_0x4bca02(0x20f)]||'hub','sender_id':_0x4bca02(0x237),'user':_0x2bb88a[_0x4bca02(0x20f)]||'hub','priority':'normal'}}}),_0x2bb88a[_0x4bca02(0x23a)])await P(_0x4bca02(0x205),{'alias':Z,'message_id':_0x2bb88a['message_id']});return;}if(_0x2bb88a['type']===_0x4bca02(0x1ee)||_0x2bb88a[_0x4bca02(0x212)]===_0x4bca02(0x25c)){Y('←\x20'+_0x2bb88a[_0x4bca02(0x212)]+_0x4bca02(0x1e2)+_0x2bb88a[_0x4bca02(0x261)]+'\x20priority='+(_0x2bb88a[_0x4bca02(0x1f3)]||_0x4bca02(0x247)));let _0x59f5ad=await P(_0x4bca02(0x1fb),{'alias':Z,'limit':0x5});if(_0x59f5ad?.['ok']&&_0x59f5ad[_0x4bca02(0x221)]?.[_0x4bca02(0x210)]>0x0)for(let _0x5e08bf of _0x59f5ad[_0x4bca02(0x221)]){let _0x5e8547={'sender':_0x5e08bf[_0x4bca02(0x268)]||'hub','sender_id':'commhub','user':_0x5e08bf[_0x4bca02(0x268)]||_0x4bca02(0x213),'task_id':_0x5e08bf['id'],'priority':_0x5e08bf[_0x4bca02(0x1f3)]||_0x4bca02(0x247)};k[_0x4bca02(0x20e)](_0x5e08bf['id'],_0x5e08bf[_0x4bca02(0x268)]||_0x4bca02(0x213)),await K[_0x4bca02(0x260)]({'method':'notifications/claude/channel','params':{'content':_0x5e08bf['content'],'meta':_0x5e8547}}),Y(_0x4bca02(0x21c)+_0x5e08bf['id']['slice'](0x0,0x8)+_0x4bca02(0x25e)+_0x5e08bf[_0x4bca02(0x268)]+':\x20'+_0x5e08bf['content'][_0x4bca02(0x1fd)](0x0,0x3c)),await P(_0x4bca02(0x205),{'alias':Z,'message_id':_0x5e08bf['id']});}}}async function S(){const _0x5bb0d7=a0_0x28e694;let _0x1e9d29=new a0_0x42cf96();await K['connect'](_0x1e9d29),Y(_0x5bb0d7(0x222)),Y(_0x5bb0d7(0x256)),v()[_0x5bb0d7(0x209)](_0x11c1cd=>Y(_0x5bb0d7(0x1f0)+_0x11c1cd)),P('report_status',{'resume_id':w,'alias':Z,'status':_0x5bb0d7(0x267),'server':a0_0x345ca0(),'hostname':a0_0x345ca0(),'agent':'claude-code','project_dir':process[_0x5bb0d7(0x1e4)](),'tmux_name':f||void 0x0})[_0x5bb0d7(0x1f8)](()=>Y(_0x5bb0d7(0x1f6)+Z+_0x5bb0d7(0x1fe)+w[_0x5bb0d7(0x1fd)](0x0,0x8)+')'))[_0x5bb0d7(0x209)](_0x504eab=>Y('warning:\x20could\x20not\x20register:\x20'+_0x504eab)),setInterval(()=>{const _0x162a75=_0x5bb0d7;P(_0x162a75(0x269),{'resume_id':w,'alias':Z,'status':_0x162a75(0x267),'server':a0_0x345ca0(),'hostname':a0_0x345ca0(),'agent':_0x162a75(0x211),'project_dir':process[_0x162a75(0x1e4)](),'tmux_name':f||void 0x0})[_0x162a75(0x209)](_0x1f249e=>Y('heartbeat\x20failed:\x20'+_0x1f249e));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}S()[a0_0x28e694(0x209)](_0x4761c8=>{const _0xb0a653=a0_0x28e694;Y(_0xb0a653(0x22c)+_0x4761c8),process[_0xb0a653(0x233)](0x1);});async function N(){const _0x31fe52=a0_0x28e694;Y(_0x31fe52(0x1eb)),await P('report_status',{'resume_id':w,'alias':Z,'status':_0x31fe52(0x26e),'task':_0x31fe52(0x23d)})[_0x31fe52(0x209)](()=>{}),process[_0x31fe52(0x233)](0x0);}process[a0_0x28e694(0x203)]['on']('end',()=>N()),process['on'](a0_0x28e694(0x252),()=>N()),process['on'](a0_0x28e694(0x227),()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.0.0-preview.59",
3
+ "version": "2.0.0-preview.60",
4
4
  "description": "AI Agent Network CLI \u2014 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",