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

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_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
+ const a0_0x7185bd=a0_0x2e94;(function(_0x541c11,_0x256b5f){const _0x471a35=a0_0x2e94,_0x15285a=_0x541c11();while(!![]){try{const _0xa5656a=-parseInt(_0x471a35(0x226))/0x1*(parseInt(_0x471a35(0x20a))/0x2)+parseInt(_0x471a35(0x1f2))/0x3*(-parseInt(_0x471a35(0x228))/0x4)+parseInt(_0x471a35(0x238))/0x5+-parseInt(_0x471a35(0x1ec))/0x6+-parseInt(_0x471a35(0x229))/0x7*(-parseInt(_0x471a35(0x1f1))/0x8)+parseInt(_0x471a35(0x21e))/0x9*(-parseInt(_0x471a35(0x223))/0xa)+parseInt(_0x471a35(0x215))/0xb*(parseInt(_0x471a35(0x212))/0xc);if(_0xa5656a===_0x256b5f)break;else _0x15285a['push'](_0x15285a['shift']());}catch(_0xf93b79){_0x15285a['push'](_0x15285a['shift']());}}}(a0_0x409a,0x689ba));function a0_0x409a(){const _0x2b402b=['call','stringify','reconnectDelay','startsWith','137230FxaBFU','normal','body','109dcGQHf','registered','2740sCVXUR','7609uEyRSu','SSE\x20failed:\x20','/mcp','get_all_status','url','status','tools/call','inbox\x20error:\x20','running','idle','error','sdk','content','cwd','Authorization','3520150rFjWoe','reply','broadcast',']\x20[commhub:','offline','connect','processInbox','type','now','AbortError','task','catch','split','replace','log','send','sleep','959244ZfKSKZ','getReader','slice','disconnect','SSE\x20reconnecting\x20in\x20','5216raWBsT','1605JTOlIX','connectSSE','Bearer\x20','messages','sdk-','data:\x20','heartbeatTimer','send_task','heartbeatInterval','disconnected','autoConnect','emit','parse','pop','token','ack_inbox','min','SSE\x20connected','s...','match','new_task','text/event-stream','application/json','agent','15622VhgsMW','resumeId','2.0','from_session','new_message','connected','report_status','message','12VjGWrJ','get_inbox','decode','12328657CkwPhR','getAllStatus','alias','SSE\x20error:\x20','sseAbort','send_message','server','text','/events/','477sKcxdl'];a0_0x409a=function(){return _0x2b402b;};return a0_0x409a();}import{EventEmitter as a0_0x307851}from'events';import{hostname as a0_0x244e1f}from'os';class T extends a0_0x307851{[a0_0x7185bd(0x22d)];['alias'];['token'];[a0_0x7185bd(0x209)];[a0_0x7185bd(0x20b)];[a0_0x7185bd(0x1fa)];[a0_0x7185bd(0x221)];[a0_0x7185bd(0x1f8)];[a0_0x7185bd(0x219)];[a0_0x7185bd(0x231)]=!0x1;constructor(_0x4f8c31){const _0x26b35e=a0_0x7185bd;super();if(this['url']=_0x4f8c31[_0x26b35e(0x22d)][_0x26b35e(0x1e8)](/\/$/,''),this[_0x26b35e(0x217)]=_0x4f8c31['alias'],this[_0x26b35e(0x200)]=_0x4f8c31[_0x26b35e(0x200)],this[_0x26b35e(0x209)]=_0x4f8c31['agent']||_0x26b35e(0x234),this[_0x26b35e(0x20b)]=_0x26b35e(0x1f6)+_0x4f8c31[_0x26b35e(0x217)]+'-'+Date['now']()['toString'](0x24),this[_0x26b35e(0x1fa)]=_0x4f8c31[_0x26b35e(0x1fa)]??0x2bf20,this[_0x26b35e(0x221)]=_0x4f8c31['reconnectDelay']??0xbb8,_0x4f8c31[_0x26b35e(0x1fc)]!==!0x1)this[_0x26b35e(0x1e0)]();}[a0_0x7185bd(0x1e9)](_0x5a79ba){const _0x5de1fc=a0_0x7185bd;console[_0x5de1fc(0x1e9)]('['+new Date()['toTimeString']()['slice'](0x0,0x8)+_0x5de1fc(0x1de)+this['alias']+']\x20'+_0x5a79ba);}async[a0_0x7185bd(0x21f)](_0x54adb8,_0x2b6e88){const _0x5a09d0=a0_0x7185bd;let _0x38dba2={'Content-Type':_0x5a09d0(0x208),'Accept':'application/json,\x20text/event-stream'};if(this[_0x5a09d0(0x200)])_0x38dba2[_0x5a09d0(0x237)]=_0x5a09d0(0x1f4)+this[_0x5a09d0(0x200)];let _0x237707=await(await fetch(this[_0x5a09d0(0x22d)]+_0x5a09d0(0x22b),{'method':'POST','headers':_0x38dba2,'body':JSON[_0x5a09d0(0x220)]({'jsonrpc':_0x5a09d0(0x20c),'id':Date[_0x5a09d0(0x1e3)](),'method':_0x5a09d0(0x22f),'params':{'name':_0x54adb8,'arguments':_0x2b6e88}})}))[_0x5a09d0(0x21c)](),_0x3aca3d=_0x237707[_0x5a09d0(0x205)](/data: (.+)/),_0x5892b2=_0x3aca3d?JSON['parse'](_0x3aca3d[0x1]):JSON['parse'](_0x237707),_0x241400=_0x5892b2?.['result']?.[_0x5a09d0(0x235)]?.[0x0]?.[_0x5a09d0(0x21c)];return _0x241400?JSON[_0x5a09d0(0x1fe)](_0x241400):_0x5892b2;}async[a0_0x7185bd(0x1e0)](){const _0x263d78=a0_0x7185bd;if(this['running'])return;this['running']=!0x0,await this[_0x263d78(0x22e)](_0x263d78(0x232)),this[_0x263d78(0x1e9)](_0x263d78(0x227)),this[_0x263d78(0x1f8)]=setInterval(()=>{const _0x1884e2=_0x263d78;this[_0x1884e2(0x22e)]('idle')['catch'](_0x3528f3=>this[_0x1884e2(0x1e9)]('heartbeat\x20failed:\x20'+_0x3528f3[_0x1884e2(0x211)]));},this[_0x263d78(0x1fa)]),this[_0x263d78(0x1f3)]();}async[a0_0x7185bd(0x1ef)](){const _0x3588d1=a0_0x7185bd;if(this[_0x3588d1(0x231)]=!0x1,this[_0x3588d1(0x219)]?.['abort'](),this[_0x3588d1(0x1f8)])clearInterval(this[_0x3588d1(0x1f8)]);await this[_0x3588d1(0x22e)](_0x3588d1(0x1df))[_0x3588d1(0x1e6)](()=>{}),this[_0x3588d1(0x1e9)](_0x3588d1(0x1fb));}async[a0_0x7185bd(0x1ea)](_0x3a57d0,_0x350b5a,_0x1aef45=a0_0x7185bd(0x224)){const _0x17cb9b=a0_0x7185bd;return this[_0x17cb9b(0x21f)](_0x17cb9b(0x1f9),{'alias':_0x3a57d0,'task':_0x350b5a,'priority':_0x1aef45,'from_session':this['alias']});}async[a0_0x7185bd(0x211)](_0x411a43,_0x47a3f4){const _0x1d2f2b=a0_0x7185bd;return this[_0x1d2f2b(0x21f)](_0x1d2f2b(0x21a),{'alias':_0x411a43,'message':_0x47a3f4,'from_session':this[_0x1d2f2b(0x217)]});}async['reply'](_0x115d49,_0x2124b3,_0x584561='completed'){const _0x3cc383=a0_0x7185bd;return this[_0x3cc383(0x21f)](_0x3cc383(0x239),{'task_id':_0x115d49,'text':_0x2124b3,'status':_0x584561});}async['status'](_0x397830,_0x4ff097){const _0x3df559=a0_0x7185bd;return this[_0x3df559(0x21f)](_0x3df559(0x210),{'resume_id':this[_0x3df559(0x20b)],'alias':this['alias'],'status':_0x397830,'server':a0_0x244e1f(),'hostname':a0_0x244e1f(),'agent':this[_0x3df559(0x209)],'project_dir':process[_0x3df559(0x236)](),..._0x4ff097});}async[a0_0x7185bd(0x216)](){const _0x30c3cb=a0_0x7185bd;return this['call'](_0x30c3cb(0x22c),{});}async[a0_0x7185bd(0x23a)](_0x240284,_0x3a0d64){const _0x3861af=a0_0x7185bd;return this[_0x3861af(0x21f)](_0x3861af(0x23a),{'message':_0x240284,'filter_server':_0x3a0d64?.[_0x3861af(0x21b)],'filter_status':_0x3a0d64?.[_0x3861af(0x22e)]});}async[a0_0x7185bd(0x1f3)](){const _0x33f16e=a0_0x7185bd;let _0x13c127=encodeURIComponent(this[_0x33f16e(0x217)]),_0x16841f=this[_0x33f16e(0x22d)]+_0x33f16e(0x21d)+_0x13c127,_0x3ba610=this[_0x33f16e(0x221)];while(this[_0x33f16e(0x231)]){try{this[_0x33f16e(0x219)]=new AbortController();let _0x54d029={'Accept':_0x33f16e(0x207)};if(this[_0x33f16e(0x200)])_0x54d029[_0x33f16e(0x237)]=_0x33f16e(0x1f4)+this['token'];let _0xc7f9d6=await fetch(_0x16841f,{'headers':_0x54d029,'signal':this[_0x33f16e(0x219)]['signal']});if(!_0xc7f9d6['ok']||!_0xc7f9d6['body']){this[_0x33f16e(0x1e9)](_0x33f16e(0x22a)+_0xc7f9d6[_0x33f16e(0x22e)]),await this['sleep'](_0x3ba610),_0x3ba610=Math[_0x33f16e(0x202)](_0x3ba610*1.5,0xea60);continue;}_0x3ba610=this[_0x33f16e(0x221)];let _0x4578d8=_0xc7f9d6[_0x33f16e(0x225)][_0x33f16e(0x1ed)](),_0x23d66b=new TextDecoder(),_0x53f87e='';while(this[_0x33f16e(0x231)]){let {done:_0x5c8c9b,value:_0x4008ab}=await _0x4578d8['read']();if(_0x5c8c9b)break;_0x53f87e+=_0x23d66b[_0x33f16e(0x214)](_0x4008ab,{'stream':!0x0});let _0x58e19e=_0x53f87e[_0x33f16e(0x1e7)]('\x0a');_0x53f87e=_0x58e19e[_0x33f16e(0x1ff)]()||'';for(let _0x6c8948 of _0x58e19e){if(!_0x6c8948[_0x33f16e(0x222)](_0x33f16e(0x1f7)))continue;try{let _0x582815=JSON[_0x33f16e(0x1fe)](_0x6c8948[_0x33f16e(0x1ee)](0x6));if(_0x582815[_0x33f16e(0x1e2)]===_0x33f16e(0x20f)){this['log'](_0x33f16e(0x203)),this['emit']('connected');continue;}if(_0x582815[_0x33f16e(0x1e2)]===_0x33f16e(0x206)||_0x582815[_0x33f16e(0x1e2)]===_0x33f16e(0x20e)||_0x582815['type']===_0x33f16e(0x23a))await this[_0x33f16e(0x1e1)]();}catch{}}}}catch(_0x4a832a){if(_0x4a832a['name']===_0x33f16e(0x1e4))break;this['emit'](_0x33f16e(0x233),_0x4a832a),this[_0x33f16e(0x1e9)](_0x33f16e(0x218)+_0x4a832a[_0x33f16e(0x211)]);}if(this[_0x33f16e(0x231)])this[_0x33f16e(0x1fd)](_0x33f16e(0x1fb)),this['log'](_0x33f16e(0x1f0)+_0x3ba610/0x3e8+_0x33f16e(0x204)),await this[_0x33f16e(0x1eb)](_0x3ba610),_0x3ba610=Math[_0x33f16e(0x202)](_0x3ba610*1.5,0xea60);}}async['processInbox'](){const _0x382aa8=a0_0x7185bd;try{let _0x4d3fdf=(await this[_0x382aa8(0x21f)](_0x382aa8(0x213),{'alias':this[_0x382aa8(0x217)],'limit':0xa}))?.[_0x382aa8(0x1f5)]||[];for(let _0x2397c0 of _0x4d3fdf)await this[_0x382aa8(0x21f)](_0x382aa8(0x201),{'alias':this[_0x382aa8(0x217)],'message_id':_0x2397c0['id']}),this[_0x382aa8(0x1e9)]('←\x20'+_0x2397c0[_0x382aa8(0x20d)]+':\x20'+_0x2397c0[_0x382aa8(0x235)][_0x382aa8(0x1ee)](0x0,0x3c)),this[_0x382aa8(0x1fd)](_0x382aa8(0x1e5),_0x2397c0),this[_0x382aa8(0x1fd)]('message',_0x2397c0);}catch(_0x57c473){this[_0x382aa8(0x1e9)](_0x382aa8(0x230)+_0x57c473[_0x382aa8(0x211)]);}}['sleep'](_0x636795){return new Promise(_0x1a25d5=>setTimeout(_0x1a25d5,_0x636795));}}var $=T;function a0_0x2e94(_0x2fe8c4,_0x4f387a){_0x2fe8c4=_0x2fe8c4-0x1de;const _0x409a00=a0_0x409a();let _0x2e94c5=_0x409a00[_0x2fe8c4];return _0x2e94c5;}export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
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());
2
+ const a0_0x8f5148=a0_0x4b72;(function(_0x410aac,_0x5c7db5){const _0xd4b7b8=a0_0x4b72,_0x44cb21=_0x410aac();while(!![]){try{const _0x1edbb6=parseInt(_0xd4b7b8(0x17d))/0x1+parseInt(_0xd4b7b8(0x142))/0x2*(-parseInt(_0xd4b7b8(0x116))/0x3)+-parseInt(_0xd4b7b8(0x11f))/0x4+parseInt(_0xd4b7b8(0x118))/0x5*(parseInt(_0xd4b7b8(0x149))/0x6)+-parseInt(_0xd4b7b8(0x128))/0x7*(parseInt(_0xd4b7b8(0x161))/0x8)+-parseInt(_0xd4b7b8(0x158))/0x9*(-parseInt(_0xd4b7b8(0x12c))/0xa)+parseInt(_0xd4b7b8(0x159))/0xb;if(_0x1edbb6===_0x5c7db5)break;else _0x44cb21['push'](_0x44cb21['shift']());}catch(_0x4e07be){_0x44cb21['push'](_0x44cb21['shift']());}}}(a0_0x2617,0xbc72a));import{readFileSync as a0_0x379490,existsSync as a0_0x22d452}from'fs';import{join as a0_0x6acbd1}from'path';import{hostname as a0_0x5a5035}from'os';import{execSync as a0_0xf25e4}from'child_process';import{Server as a0_0xc142c6}from'@modelcontextprotocol/sdk/server/index.js';function a0_0x4b72(_0x2fa39b,_0x2c6f08){_0x2fa39b=_0x2fa39b-0x101;const _0x261724=a0_0x2617();let _0x4b72ab=_0x261724[_0x2fa39b];return _0x4b72ab;}import{StdioServerTransport as a0_0x31bc95}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x2bee81,CallToolRequestSchema as a0_0x560778}from'@modelcontextprotocol/sdk/types.js';function p(_0x12245f){const _0x4db61e=a0_0x4b72;if(!a0_0x22d452(_0x12245f))return;for(let _0x1d5bc5 of a0_0x379490(_0x12245f,'utf-8')[_0x4db61e(0x134)]('\x0a')){let _0x13db54=_0x1d5bc5[_0x4db61e(0x17f)]();if(!_0x13db54||_0x13db54[_0x4db61e(0x160)]('#'))continue;let _0x5a0081=_0x13db54[_0x4db61e(0x16c)]('=');if(_0x5a0081<0x0)continue;let _0x4205a9=_0x13db54[_0x4db61e(0x173)](0x0,_0x5a0081)['trim'](),_0x2b9ef8=_0x13db54[_0x4db61e(0x173)](_0x5a0081+0x1)['trim']()['replace'](/^["']|["']$/g,'');if(!process.env[_0x4205a9])process.env[_0x4205a9]=_0x2b9ef8;}}var C=process.env.HOME||'~',T=a0_0x6acbd1(C,a0_0x8f5148(0x16e));p(a0_0x6acbd1(T,a0_0x8f5148(0x185)));var L=process['cwd']()[a0_0x8f5148(0x169)](/\//g,'-');p(a0_0x6acbd1(T,L,a0_0x8f5148(0x185)));function U(){const _0x14e771=a0_0x8f5148;try{return a0_0xf25e4(_0x14e771(0x11e),{'encoding':_0x14e771(0x171),'timeout':0x7d0})[_0x14e771(0x17f)]();}catch{return'';}}function c(){const _0x333dc2=a0_0x8f5148;try{let _0x32f5fb=a0_0x6acbd1(C,'.anet',_0x333dc2(0x176));if(a0_0x22d452(_0x32f5fb))return JSON['parse'](a0_0x379490(_0x32f5fb,_0x333dc2(0x171)));}catch{}return{};}var H=c(),D=process.env.COMMHUB_URL||H[a0_0x8f5148(0x172)]||'http://127.0.0.1:9200',f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0x5a5035(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto[a0_0x8f5148(0x10d)](),X=process.env.COMMHUB_TOKEN||H[a0_0x8f5148(0x110)]||'';function Y(_0x15c34c){const _0x529256=a0_0x8f5148;let _0x245644=new Date()[_0x529256(0x146)]()['slice'](0x0,0x8);process[_0x529256(0x147)]['write']('['+_0x245644+']\x20[commhub]\x20'+_0x15c34c+'\x0a');}function h(_0x42ec53){return new Promise(_0x2d0228=>setTimeout(_0x2d0228,_0x42ec53));}Y('ENV:\x20URL='+D+'\x20ALIAS='+Z+a0_0x8f5148(0x109)+w[a0_0x8f5148(0x173)](0x0,0x8)+'...\x20TMUX='+(f||'none')+a0_0x8f5148(0x127)+process['cwd']()+a0_0x8f5148(0x17a)+L);var k=new Map(),K=new a0_0xc142c6({'name':a0_0x8f5148(0x113),'version':'0.3.0'},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':['Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.',a0_0x8f5148(0x181),a0_0x8f5148(0x108),a0_0x8f5148(0x140)+Z]['join']('\x0a')});K[a0_0x8f5148(0x13c)](a0_0x2bee81,async()=>({'tools':[{'name':a0_0x8f5148(0x141),'description':a0_0x8f5148(0x178),'inputSchema':{'type':a0_0x8f5148(0x179),'properties':{'task_id':{'type':'string','description':'The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)'},'text':{'type':a0_0x8f5148(0x11c),'description':'Reply\x20text\x20/\x20result\x20summary'},'status':{'type':a0_0x8f5148(0x11c),'enum':['completed',a0_0x8f5148(0x17b),'cancelled',a0_0x8f5148(0x180),a0_0x8f5148(0x12d),'in_progress'],'description':a0_0x8f5148(0x104)}},'required':[a0_0x8f5148(0x151)]}},{'name':a0_0x8f5148(0x105),'description':a0_0x8f5148(0x15f),'inputSchema':{'type':a0_0x8f5148(0x179),'properties':{'status':{'type':a0_0x8f5148(0x11c),'enum':[a0_0x8f5148(0x13d),a0_0x8f5148(0x162),a0_0x8f5148(0x180),a0_0x8f5148(0x12d)]},'task':{'type':'string','description':'Current\x20task\x20description'},'progress':{'type':a0_0x8f5148(0x14d),'description':a0_0x8f5148(0x102)}},'required':[a0_0x8f5148(0x124)]}},{'name':'commhub_send_task','description':a0_0x8f5148(0x119),'inputSchema':{'type':a0_0x8f5148(0x179),'properties':{'alias':{'type':a0_0x8f5148(0x11c),'description':a0_0x8f5148(0x117)},'task':{'type':'string','description':'Task\x20content'},'priority':{'type':'string','enum':[a0_0x8f5148(0x12e),a0_0x8f5148(0x13e),'low'],'description':a0_0x8f5148(0x12b)}},'required':['alias','task']}},{'name':a0_0x8f5148(0x10c),'description':'Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','inputSchema':{'type':a0_0x8f5148(0x179),'properties':{'alias':{'type':'string','description':a0_0x8f5148(0x117)},'message':{'type':a0_0x8f5148(0x11c),'description':a0_0x8f5148(0x175)}},'required':[a0_0x8f5148(0x137),'message']}},{'name':a0_0x8f5148(0x154),'description':a0_0x8f5148(0x15a),'inputSchema':{'type':a0_0x8f5148(0x179),'properties':{}}}]}));function a0_0x2617(){const _0x528bee=['split','pop','parse','alias','POST','Authorization','SSE\x20connection\x20error:\x20','←\x20message\x20from\x20','setRequestHandler','working','normal','stringify','Session\x20alias:\x20','commhub_reply','524OFnJqH','body','warning:\x20could\x20not\x20register:\x20','init\x20failed:\x20','toTimeString','stderr',':\x20inbox_count=','1781922aXwBLv','notification','/mcp','from_session','number','\x20priority=','get','SIGTERM','text','send_task','shutting\x20down,\x20reporting\x20offline...','commhub_get_all_status','SIGINT','cancelled','parse\x20error:\x20','441hRhbfQ','1944679FSkmpX','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','result','message','connect','params','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','startsWith','896lfiNfW','idle','cwd','decode','heartbeat\x20failed:\x20','application/json,\x20text/event-stream','priority','SSE\x20error:\x20','replace','length','Bearer\x20','indexOf','statusText','.claude/channels/commhub','SSE\x20fatal:\x20','connecting\x20to\x20','utf-8','hub','slice','find','Message\x20content','config.json','2025-03-26','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','object','\x20PROJECT_ENV=','failed','/events/','631669DvsJNr','completed','trim','blocked','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','fatal:\x20','ack_inbox','\x20from\x20','.env','messages','Progress\x200-100','get_all_status','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','commhub_report_status','connected','data:\x20','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','\x20RESUME_ID=','from','end','commhub_send_message','randomUUID','delete','\x22\x20(','token','SSE\x20stream\x20ended,\x20reconnecting...','report_status','commhub-channel','session\x20disconnected','claude-code','13077SbeSTk','Target\x20session\x20alias','10EvMYmO','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','new_task','application/json','string','get_inbox','tmux\x20display-message\x20-p\x20\x27#S\x27','2422376FiirQP','registered\x20as\x20\x22','catch','unknown\x20tool','commhub','status','SSE\x20connected\x20as\x20\x22','message_id','\x20CWD=','9947UUvIrh','exit','content','Priority\x20(default:\x20normal)','260460VvUxmi','error','high','getReader','type','0.3.0','initialize','→\x20injected\x20task\x20'];a0_0x2617=function(){return _0x528bee;};return a0_0x2617();}async function P(_0x553794,_0xb39268){const _0x1b9134=a0_0x8f5148;let _0x129c28=await fetch(D+'/mcp',{'method':_0x1b9134(0x138),'headers':{'Content-Type':_0x1b9134(0x11b),'Accept':_0x1b9134(0x166),...X?{'Authorization':_0x1b9134(0x16b)+X}:{}},'body':JSON[_0x1b9134(0x13f)]({'jsonrpc':'2.0','id':0x1,'method':_0x1b9134(0x132),'params':{'protocolVersion':_0x1b9134(0x177),'capabilities':{},'clientInfo':{'name':'commhub-channel','version':_0x1b9134(0x131)}}})});if(!_0x129c28['ok']){let _0x5d67ea=await _0x129c28['text']();return Y('CommHub\x20init\x20failed:\x20'+_0x129c28['status']+'\x20'+_0x5d67ea[_0x1b9134(0x173)](0x0,0x64)),{'ok':!0x1,'error':_0x1b9134(0x145)+_0x129c28[_0x1b9134(0x124)]};}await _0x129c28['text']();let _0x25eb11=(await(await fetch(D+_0x1b9134(0x14b),{'method':_0x1b9134(0x138),'headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x1b9134(0x16b)+X}:{}},'body':JSON['stringify']({'jsonrpc':'2.0','id':0x2,'method':'tools/call','params':{'name':_0x553794,'arguments':_0xb39268}})}))['text']())[_0x1b9134(0x134)]('\x0a')[_0x1b9134(0x174)](_0x10a2ba=>_0x10a2ba[_0x1b9134(0x160)](_0x1b9134(0x107)));if(_0x25eb11){let _0x74ef94=JSON['parse'](_0x25eb11[_0x1b9134(0x173)](0x6));return _0x74ef94?.[_0x1b9134(0x15b)]?.['content']?.[0x0]?.[_0x1b9134(0x151)]?JSON[_0x1b9134(0x136)](_0x74ef94[_0x1b9134(0x15b)][_0x1b9134(0x12a)][0x0][_0x1b9134(0x151)]):_0x74ef94;}return{'ok':!0x1,'error':'no\x20response'};}K[a0_0x8f5148(0x13c)](a0_0x560778,async _0x43cbac=>{const _0x42a343=a0_0x8f5148;let {name:_0x2da5f8,arguments:_0x46f44d}=_0x43cbac[_0x42a343(0x15e)];if(_0x2da5f8===_0x42a343(0x141)){let {task_id:_0x50b4a6,text:_0x3e980e,status:_0xbec38c}=_0x46f44d;if(_0xbec38c===_0x42a343(0x17e)||_0xbec38c===_0x42a343(0x17b)||_0xbec38c===_0x42a343(0x156)){let _0x58c305=_0xbec38c===_0x42a343(0x17e)?'replied':_0xbec38c,_0x443479=_0x50b4a6?k[_0x42a343(0x14f)](_0x50b4a6)||_0x42a343(0x172):_0x42a343(0x172),_0x14b40b=await P('send_reply',{'alias':_0x443479,'text':_0x3e980e,'in_reply_to':_0x50b4a6||void 0x0,'status':_0x58c305,'from_session':Z});if(_0x50b4a6)k[_0x42a343(0x10e)](_0x50b4a6);return{'content':[{'type':_0x42a343(0x151),'text':JSON[_0x42a343(0x13f)](_0x14b40b)}]};}let _0xea060a=await P(_0x42a343(0x112),{'resume_id':w,'alias':Z,'status':_0xbec38c===_0x42a343(0x180)?_0x42a343(0x180):_0xbec38c===_0x42a343(0x12d)?_0x42a343(0x12d):_0x42a343(0x13d),'task':_0x3e980e[_0x42a343(0x173)](0x0,0xc8),'output':_0x3e980e});return{'content':[{'type':'text','text':JSON[_0x42a343(0x13f)](_0xea060a)}]};}if(_0x2da5f8==='commhub_report_status'){let {status:_0x47fac5,task:_0x3f6529,progress:_0x24c30c}=_0x46f44d,_0x400597=await P(_0x42a343(0x112),{'resume_id':w,'alias':Z,'status':_0x47fac5,'task':_0x3f6529,'progress':_0x24c30c});return{'content':[{'type':_0x42a343(0x151),'text':JSON['stringify'](_0x400597)}]};}if(_0x2da5f8==='commhub_send_task'){let {alias:_0x1ffbc1,task:_0x23c88a,priority:_0x4af3d2}=_0x46f44d,_0x303055=await P(_0x42a343(0x152),{'alias':_0x1ffbc1,'task':_0x23c88a,'priority':_0x4af3d2||_0x42a343(0x13e),'from_session':Z});return{'content':[{'type':_0x42a343(0x151),'text':JSON[_0x42a343(0x13f)](_0x303055)}]};}if(_0x2da5f8===_0x42a343(0x10c)){let {alias:_0xa67442,message:_0x41c79d}=_0x46f44d,_0x1544be=await P('send_message',{'alias':_0xa67442,'message':_0x41c79d,'from_session':Z});return{'content':[{'type':_0x42a343(0x151),'text':JSON[_0x42a343(0x13f)](_0x1544be)}]};}if(_0x2da5f8==='commhub_get_all_status'){let _0x544f9d=await P(_0x42a343(0x103),{});return{'content':[{'type':_0x42a343(0x151),'text':JSON['stringify'](_0x544f9d)}]};}return{'content':[{'type':_0x42a343(0x151),'text':JSON[_0x42a343(0x13f)]({'error':_0x42a343(0x122)})}]};});async function v(){const _0x8ff8d8=a0_0x8f5148;let _0x2e684a=D+_0x8ff8d8(0x17c)+encodeURIComponent(Z),_0x19d823={};if(X)_0x19d823[_0x8ff8d8(0x139)]=_0x8ff8d8(0x16b)+X;Y(_0x8ff8d8(0x170)+_0x2e684a);while(!0x0){try{let _0x5bbe46=await fetch(_0x2e684a,{'headers':_0x19d823});if(!_0x5bbe46['ok']){Y(_0x8ff8d8(0x168)+_0x5bbe46[_0x8ff8d8(0x124)]+'\x20'+_0x5bbe46[_0x8ff8d8(0x16d)]),await h(0x1388);continue;}let _0x11b1b0=_0x5bbe46[_0x8ff8d8(0x143)][_0x8ff8d8(0x12f)](),_0xbe5f7f=new TextDecoder(),_0x361922='';while(!0x0){let {done:_0x33f4d7,value:_0x5d6d7b}=await _0x11b1b0['read']();if(_0x33f4d7)break;_0x361922+=_0xbe5f7f[_0x8ff8d8(0x164)](_0x5d6d7b,{'stream':!0x0});let _0x4ce829=_0x361922[_0x8ff8d8(0x134)]('\x0a\x0a');_0x361922=_0x4ce829[_0x8ff8d8(0x135)]()||'';for(let _0x56ac56 of _0x4ce829){let _0x4fdd73=_0x56ac56['split']('\x0a')[_0x8ff8d8(0x174)](_0x5db761=>_0x5db761['startsWith'](_0x8ff8d8(0x107)));if(!_0x4fdd73)continue;try{let _0x31d00e=JSON[_0x8ff8d8(0x136)](_0x4fdd73[_0x8ff8d8(0x173)](0x6));await u(_0x31d00e);}catch(_0x51b953){Y(_0x8ff8d8(0x157)+_0x51b953);}}}Y(_0x8ff8d8(0x111));}catch(_0x51034f){Y(_0x8ff8d8(0x13a)+_0x51034f);}await h(0xbb8);}}async function u(_0x22e2a6){const _0x36ec29=a0_0x8f5148;if(_0x22e2a6[_0x36ec29(0x130)]===_0x36ec29(0x106)){Y(_0x36ec29(0x125)+Z+'\x22');return;}if(_0x22e2a6[_0x36ec29(0x130)]==='new_message'){if(Y(_0x36ec29(0x13b)+_0x22e2a6['from']+':\x20'+_0x22e2a6[_0x36ec29(0x15c)][_0x36ec29(0x173)](0x0,0x3c)),await K[_0x36ec29(0x14a)]({'method':'notifications/claude/channel','params':{'content':_0x22e2a6['message'],'meta':{'sender':_0x22e2a6[_0x36ec29(0x10a)]||_0x36ec29(0x172),'sender_id':_0x36ec29(0x123),'user':_0x22e2a6['from']||'hub','priority':_0x36ec29(0x13e)}}}),_0x22e2a6[_0x36ec29(0x126)])await P(_0x36ec29(0x183),{'alias':Z,'message_id':_0x22e2a6['message_id']});return;}if(_0x22e2a6[_0x36ec29(0x130)]===_0x36ec29(0x11a)||_0x22e2a6[_0x36ec29(0x130)]==='broadcast'){Y('←\x20'+_0x22e2a6[_0x36ec29(0x130)]+_0x36ec29(0x148)+_0x22e2a6['inbox_count']+_0x36ec29(0x14e)+(_0x22e2a6[_0x36ec29(0x167)]||_0x36ec29(0x13e)));let _0x3ff92e=await P(_0x36ec29(0x11d),{'alias':Z,'limit':0x5});if(_0x3ff92e?.['ok']&&_0x3ff92e['messages']?.[_0x36ec29(0x16a)]>0x0)for(let _0x318742 of _0x3ff92e[_0x36ec29(0x101)]){let _0x18ee95={'sender':_0x318742['from_session']||_0x36ec29(0x172),'sender_id':_0x36ec29(0x123),'user':_0x318742[_0x36ec29(0x14c)]||'hub','task_id':_0x318742['id'],'priority':_0x318742[_0x36ec29(0x167)]||_0x36ec29(0x13e)};k['set'](_0x318742['id'],_0x318742[_0x36ec29(0x14c)]||'hub'),await K['notification']({'method':'notifications/claude/channel','params':{'content':_0x318742[_0x36ec29(0x12a)],'meta':_0x18ee95}}),Y(_0x36ec29(0x133)+_0x318742['id'][_0x36ec29(0x173)](0x0,0x8)+_0x36ec29(0x184)+_0x318742[_0x36ec29(0x14c)]+':\x20'+_0x318742[_0x36ec29(0x12a)][_0x36ec29(0x173)](0x0,0x3c)),await P(_0x36ec29(0x183),{'alias':Z,'message_id':_0x318742['id']});}}}async function S(){const _0x2e29e2=a0_0x8f5148;let _0x1ff477=new a0_0x31bc95();await K[_0x2e29e2(0x15d)](_0x1ff477),Y('MCP\x20stdio\x20connected'),Y('starting\x20SSE\x20listener...'),v()[_0x2e29e2(0x121)](_0xb7d3ee=>Y(_0x2e29e2(0x16f)+_0xb7d3ee)),P(_0x2e29e2(0x112),{'resume_id':w,'alias':Z,'status':_0x2e29e2(0x162),'server':a0_0x5a5035(),'hostname':a0_0x5a5035(),'agent':_0x2e29e2(0x115),'project_dir':process['cwd'](),'tmux_name':f||void 0x0})['then'](()=>Y(_0x2e29e2(0x120)+Z+_0x2e29e2(0x10f)+w[_0x2e29e2(0x173)](0x0,0x8)+')'))[_0x2e29e2(0x121)](_0x5edfe7=>Y(_0x2e29e2(0x144)+_0x5edfe7)),setInterval(()=>{const _0x2f0fc4=_0x2e29e2;P(_0x2f0fc4(0x112),{'resume_id':w,'alias':Z,'status':_0x2f0fc4(0x162),'server':a0_0x5a5035(),'hostname':a0_0x5a5035(),'agent':_0x2f0fc4(0x115),'project_dir':process[_0x2f0fc4(0x163)](),'tmux_name':f||void 0x0})[_0x2f0fc4(0x121)](_0x551feb=>Y(_0x2f0fc4(0x165)+_0x551feb));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}S()[a0_0x8f5148(0x121)](_0x23a8c0=>{const _0x50c420=a0_0x8f5148;Y(_0x50c420(0x182)+_0x23a8c0),process['exit'](0x1);});async function N(){const _0x5f35a5=a0_0x8f5148;Y(_0x5f35a5(0x153)),await P(_0x5f35a5(0x112),{'resume_id':w,'alias':Z,'status':_0x5f35a5(0x12d),'task':_0x5f35a5(0x114)})['catch'](()=>{}),process[_0x5f35a5(0x129)](0x0);}process['stdin']['on'](a0_0x8f5148(0x10b),()=>N()),process['on'](a0_0x8f5148(0x150),()=>N()),process['on'](a0_0x8f5148(0x155),()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.0.0-preview.60",
3
+ "version": "2.0.0-preview.62",
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",