@sleep2agi/agent-network 2.1.7-preview.2 → 2.1.8-preview.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- const a0_0x2e8ed1=a0_0x415d;(function(_0x2642ad,_0x307c42){const _0x4d61e3=a0_0x415d,_0x1a5dd4=_0x2642ad();while(!![]){try{const _0x32d693=-parseInt(_0x4d61e3(0x1f2))/0x1*(-parseInt(_0x4d61e3(0x202))/0x2)+-parseInt(_0x4d61e3(0x1f9))/0x3+-parseInt(_0x4d61e3(0x20d))/0x4+-parseInt(_0x4d61e3(0x1e6))/0x5+-parseInt(_0x4d61e3(0x1cd))/0x6*(-parseInt(_0x4d61e3(0x1e9))/0x7)+-parseInt(_0x4d61e3(0x20a))/0x8*(parseInt(_0x4d61e3(0x21b))/0x9)+parseInt(_0x4d61e3(0x1fa))/0xa;if(_0x32d693===_0x307c42)break;else _0x1a5dd4['push'](_0x1a5dd4['shift']());}catch(_0x1f5ca4){_0x1a5dd4['push'](_0x1a5dd4['shift']());}}}(a0_0x4bab,0x2d5bc));import{EventEmitter as a0_0xea3667}from'events';import{hostname as a0_0x5edbfc}from'os';class T extends a0_0xea3667{[a0_0x2e8ed1(0x1f3)];[a0_0x2e8ed1(0x1f8)];[a0_0x2e8ed1(0x1e0)];['agent'];[a0_0x2e8ed1(0x204)];[a0_0x2e8ed1(0x1f5)];[a0_0x2e8ed1(0x1d9)];['heartbeatTimer'];[a0_0x2e8ed1(0x213)];[a0_0x2e8ed1(0x1ed)]=!0x1;constructor(_0x2491c5){const _0x25f356=a0_0x2e8ed1;super();if(this[_0x25f356(0x1f3)]=_0x2491c5[_0x25f356(0x1f3)][_0x25f356(0x1eb)](/\/$/,''),this[_0x25f356(0x1f8)]=_0x2491c5[_0x25f356(0x1f8)],this['token']=_0x2491c5[_0x25f356(0x1e0)],this[_0x25f356(0x20e)]=_0x2491c5['agent']||_0x25f356(0x201),this[_0x25f356(0x204)]=_0x25f356(0x214)+_0x2491c5[_0x25f356(0x1f8)]+'-'+Date[_0x25f356(0x1da)]()[_0x25f356(0x21d)](0x24),this[_0x25f356(0x1f5)]=_0x2491c5['heartbeatInterval']??0x2bf20,this[_0x25f356(0x1d9)]=_0x2491c5[_0x25f356(0x1d9)]??0xbb8,_0x2491c5['autoConnect']!==!0x1)this['connect']();}[a0_0x2e8ed1(0x217)](_0xc7c5eb){const _0x211d89=a0_0x2e8ed1;console[_0x211d89(0x217)]('['+new Date()[_0x211d89(0x1f7)]()['slice'](0x0,0x8)+_0x211d89(0x1f1)+this[_0x211d89(0x1f8)]+']\x20'+_0xc7c5eb);}async[a0_0x2e8ed1(0x1e1)](_0x16aa42,_0x1af9e3){const _0x213264=a0_0x2e8ed1;let _0xf52189={'Content-Type':_0x213264(0x1e2),'Accept':'application/json,\x20text/event-stream'};if(this[_0x213264(0x1e0)])_0xf52189[_0x213264(0x207)]=_0x213264(0x1e3)+this[_0x213264(0x1e0)];let _0x23988a=await(await fetch(this['url']+_0x213264(0x1d0),{'method':'POST','headers':_0xf52189,'body':JSON[_0x213264(0x1f4)]({'jsonrpc':_0x213264(0x219),'id':Date[_0x213264(0x1da)](),'method':_0x213264(0x1d2),'params':{'name':_0x16aa42,'arguments':_0x1af9e3}})}))[_0x213264(0x1dc)](),_0x3727e8=_0x23988a[_0x213264(0x223)](/data: (.+)/),_0x2bc306=_0x3727e8?JSON[_0x213264(0x205)](_0x3727e8[0x1]):JSON[_0x213264(0x205)](_0x23988a),_0x3ff4c4=_0x2bc306?.['result']?.[_0x213264(0x1dd)]?.[0x0]?.[_0x213264(0x1dc)];return _0x3ff4c4?JSON['parse'](_0x3ff4c4):_0x2bc306;}async[a0_0x2e8ed1(0x206)](){const _0x1312c6=a0_0x2e8ed1;if(this['running'])return;this[_0x1312c6(0x1ed)]=!0x0,await this['status'](_0x1312c6(0x1df)),this[_0x1312c6(0x217)](_0x1312c6(0x216)),this['heartbeatTimer']=setInterval(()=>{const _0x440e90=_0x1312c6;this['status'](_0x440e90(0x1df))['catch'](_0x29370f=>this[_0x440e90(0x217)](_0x440e90(0x1fe)+_0x29370f[_0x440e90(0x210)]));},this[_0x1312c6(0x1f5)]),this[_0x1312c6(0x1d4)]();}async[a0_0x2e8ed1(0x20f)](){const _0x31a3a5=a0_0x2e8ed1;if(this[_0x31a3a5(0x1ed)]=!0x1,this[_0x31a3a5(0x213)]?.[_0x31a3a5(0x211)](),this[_0x31a3a5(0x1ec)])clearInterval(this[_0x31a3a5(0x1ec)]);await this['status'](_0x31a3a5(0x20c))['catch'](()=>{}),this[_0x31a3a5(0x217)](_0x31a3a5(0x200));}async[a0_0x2e8ed1(0x221)](_0x4aea76,_0x31b16d,_0x521675='normal'){const _0x3cbb3f=a0_0x2e8ed1;return this[_0x3cbb3f(0x1e1)]('send_task',{'alias':_0x4aea76,'task':_0x31b16d,'priority':_0x521675,'from_session':this[_0x3cbb3f(0x1f8)]});}async[a0_0x2e8ed1(0x210)](_0x4a2b81,_0x1a3bc7){const _0x1d9d46=a0_0x2e8ed1;return this[_0x1d9d46(0x1e1)](_0x1d9d46(0x218),{'alias':_0x4a2b81,'message':_0x1a3bc7,'from_session':this[_0x1d9d46(0x1f8)]});}async[a0_0x2e8ed1(0x21f)](_0x26f70e,_0x5572a6,_0x44d3ce=a0_0x2e8ed1(0x1ef)){const _0x5b9ae3=a0_0x2e8ed1;return this['call'](_0x5b9ae3(0x208),{'in_reply_to':_0x26f70e,'text':_0x5572a6,'status':_0x44d3ce});}async[a0_0x2e8ed1(0x1fb)](_0xd82fa,_0x2ac513){const _0x17e311=a0_0x2e8ed1;return this[_0x17e311(0x1e1)](_0x17e311(0x1d7),{'resume_id':this['resumeId'],'alias':this['alias'],'status':_0xd82fa,'server':a0_0x5edbfc(),'hostname':a0_0x5edbfc(),'agent':this[_0x17e311(0x20e)],'project_dir':process['cwd'](),..._0x2ac513});}async[a0_0x2e8ed1(0x1d8)](){const _0x1a72b0=a0_0x2e8ed1;return this[_0x1a72b0(0x1e1)]('get_all_status',{});}async[a0_0x2e8ed1(0x1e4)](_0x13d27a,_0x5a6df0){const _0x4edc32=a0_0x2e8ed1;return this[_0x4edc32(0x1e1)](_0x4edc32(0x1e4),{'message':_0x13d27a,'filter_server':_0x5a6df0?.[_0x4edc32(0x1f0)],'filter_status':_0x5a6df0?.[_0x4edc32(0x1fb)]});}async[a0_0x2e8ed1(0x1d4)](){const _0x419b1f=a0_0x2e8ed1;let _0x5e4b00=encodeURIComponent(this[_0x419b1f(0x1f8)]),_0x4cd247=this[_0x419b1f(0x1f3)]+_0x419b1f(0x1e5)+_0x5e4b00,_0x13c304=this[_0x419b1f(0x1d9)];while(this[_0x419b1f(0x1ed)]){try{this[_0x419b1f(0x213)]=new AbortController();let _0x103871={'Accept':_0x419b1f(0x1e8)};if(this[_0x419b1f(0x1e0)])_0x103871[_0x419b1f(0x207)]=_0x419b1f(0x1e3)+this[_0x419b1f(0x1e0)];let _0x54b951=await fetch(_0x4cd247,{'headers':_0x103871,'signal':this[_0x419b1f(0x213)][_0x419b1f(0x1d6)]});if(!_0x54b951['ok']||!_0x54b951[_0x419b1f(0x1e7)]){this[_0x419b1f(0x217)](_0x419b1f(0x21c)+_0x54b951[_0x419b1f(0x1fb)]),await this['sleep'](_0x13c304),_0x13c304=Math[_0x419b1f(0x222)](_0x13c304*1.5,0xea60);continue;}_0x13c304=this['reconnectDelay'];let _0x498713=_0x54b951[_0x419b1f(0x1e7)]['getReader'](),_0x2df7f4=new TextDecoder(),_0x3abdef='';while(this[_0x419b1f(0x1ed)]){let {done:_0x660435,value:_0x1bc26}=await _0x498713[_0x419b1f(0x1de)]();if(_0x660435)break;_0x3abdef+=_0x2df7f4[_0x419b1f(0x209)](_0x1bc26,{'stream':!0x0});let _0x45a2f5=_0x3abdef['split']('\x0a');_0x3abdef=_0x45a2f5[_0x419b1f(0x1ea)]()||'';for(let _0x470ae0 of _0x45a2f5){if(!_0x470ae0['startsWith'](_0x419b1f(0x203)))continue;try{let _0x452b4d=JSON[_0x419b1f(0x205)](_0x470ae0[_0x419b1f(0x21a)](0x6));if(_0x452b4d[_0x419b1f(0x1f6)]===_0x419b1f(0x215)){this[_0x419b1f(0x217)]('SSE\x20connected'),this[_0x419b1f(0x21e)](_0x419b1f(0x215));continue;}if(_0x452b4d[_0x419b1f(0x1f6)]===_0x419b1f(0x1cf)||_0x452b4d[_0x419b1f(0x1f6)]==='new_message'||_0x452b4d['type']===_0x419b1f(0x1e4))await this[_0x419b1f(0x224)]();}catch{}}}}catch(_0x33f3cf){if(_0x33f3cf[_0x419b1f(0x1db)]===_0x419b1f(0x1ff))break;this['emit'](_0x419b1f(0x1d1),_0x33f3cf),this[_0x419b1f(0x217)](_0x419b1f(0x1d5)+_0x33f3cf[_0x419b1f(0x210)]);}if(this[_0x419b1f(0x1ed)])this[_0x419b1f(0x21e)]('disconnected'),this[_0x419b1f(0x217)](_0x419b1f(0x1ee)+_0x13c304/0x3e8+_0x419b1f(0x1ce)),await this['sleep'](_0x13c304),_0x13c304=Math[_0x419b1f(0x222)](_0x13c304*1.5,0xea60);}}async[a0_0x2e8ed1(0x224)](){const _0x444851=a0_0x2e8ed1;try{let _0x4a4deb=(await this[_0x444851(0x1e1)](_0x444851(0x20b),{'alias':this[_0x444851(0x1f8)],'limit':0xa}))?.[_0x444851(0x1fd)]||[];for(let _0x47c8ca of _0x4a4deb)await this[_0x444851(0x1e1)](_0x444851(0x1d3),{'alias':this[_0x444851(0x1f8)],'message_id':_0x47c8ca['id']}),this[_0x444851(0x217)]('←\x20'+_0x47c8ca[_0x444851(0x1fc)]+':\x20'+_0x47c8ca[_0x444851(0x1dd)]['slice'](0x0,0x3c)),this['emit']('task',_0x47c8ca),this[_0x444851(0x21e)](_0x444851(0x210),_0x47c8ca);}catch(_0x1a5ba5){this['log'](_0x444851(0x212)+_0x1a5ba5[_0x444851(0x210)]);}}[a0_0x2e8ed1(0x220)](_0x756334){return new Promise(_0x15c1db=>setTimeout(_0x15c1db,_0x756334));}}function a0_0x415d(_0x10b92f,_0x4d15ae){_0x10b92f=_0x10b92f-0x1cd;const _0x4babb4=a0_0x4bab();let _0x415d65=_0x4babb4[_0x10b92f];return _0x415d65;}var $=T;function a0_0x4bab(){const _0x393186=[']\x20[commhub:','1diiyPp','url','stringify','heartbeatInterval','type','toTimeString','alias','903606WpDMWb','4421890EDYOwy','status','from_session','messages','heartbeat\x20failed:\x20','AbortError','disconnected','sdk','563266RtfAkH','data:\x20','resumeId','parse','connect','Authorization','send_reply','decode','1288RRwwSD','get_inbox','offline','673748IxZSiI','agent','disconnect','message','abort','inbox\x20error:\x20','sseAbort','sdk-','connected','registered','log','send_message','2.0','slice','5058dAhetc','SSE\x20failed:\x20','toString','emit','reply','sleep','send','min','match','processInbox','6GnCOaF','s...','new_task','/mcp','error','tools/call','ack_inbox','connectSSE','SSE\x20error:\x20','signal','report_status','getAllStatus','reconnectDelay','now','name','text','content','read','idle','token','call','application/json','Bearer\x20','broadcast','/events/','961385jAnsGM','body','text/event-stream','1500548YzUrag','pop','replace','heartbeatTimer','running','SSE\x20reconnecting\x20in\x20','completed','server'];a0_0x4bab=function(){return _0x393186;};return a0_0x4bab();}export{$ as default,T as CommHub};
1
+ const a0_0x7454e9=a0_0x1da5;function a0_0x1da5(_0x1a413e,_0x24d3e0){_0x1a413e=_0x1a413e-0x1c4;const _0x2d2200=a0_0x2d22();let _0x1da5d5=_0x2d2200[_0x1a413e];return _0x1da5d5;}function a0_0x2d22(){const _0x1f8a37=['messages','content','resumeId','AbortError','log',']\x20[commhub:','processInbox','4996BEtAfa','10488699BbXrXq','sseAbort','connectSSE','from_session','heartbeatTimer','get_all_status','emit','send_message','connect','error','idle','broadcast','heartbeatInterval','startsWith','Bearer\x20','7VghLxX','completed','SSE\x20error:\x20','server','autoConnect','toString','running','inbox\x20error:\x20','min','parse','get_inbox','result','2691558VBXSWl','toTimeString','SSE\x20failed:\x20','new_message','send_task','s...','265ElmVDO','alias','agent','slice','new_task','url','getReader','cwd','connected','replace','name','/mcp','SSE\x20connected','offline','379568LLODaq','token','reconnectDelay','send_reply','type','text','data:\x20','heartbeat\x20failed:\x20','1247085xUojEf','application/json','356625sUXuWF','549316tmQZny','sleep','report_status','ack_inbox','body','stringify','registered','now','status','disconnect','catch','Authorization','normal','reply','application/json,\x20text/event-stream','tools/call','disconnected','task','decode','send','sdk-','POST','message','call'];a0_0x2d22=function(){return _0x1f8a37;};return a0_0x2d22();}(function(_0x33c049,_0x4ea16b){const _0x5a6a5c=a0_0x1da5,_0x310e4a=_0x33c049();while(!![]){try{const _0x1539ce=-parseInt(_0x5a6a5c(0x1c5))/0x1+parseInt(_0x5a6a5c(0x1c6))/0x2+-parseInt(_0x5a6a5c(0x21d))/0x3+-parseInt(_0x5a6a5c(0x1e5))/0x4*(-parseInt(_0x5a6a5c(0x207))/0x5)+-parseInt(_0x5a6a5c(0x201))/0x6*(parseInt(_0x5a6a5c(0x1f5))/0x7)+parseInt(_0x5a6a5c(0x215))/0x8+parseInt(_0x5a6a5c(0x1e6))/0x9;if(_0x1539ce===_0x4ea16b)break;else _0x310e4a['push'](_0x310e4a['shift']());}catch(_0x4e1f5d){_0x310e4a['push'](_0x310e4a['shift']());}}}(a0_0x2d22,0x513ff));import{EventEmitter as a0_0x370fc8}from'events';import{hostname as a0_0x5c3251}from'os';class T extends a0_0x370fc8{[a0_0x7454e9(0x20c)];[a0_0x7454e9(0x208)];[a0_0x7454e9(0x216)];[a0_0x7454e9(0x209)];[a0_0x7454e9(0x1e0)];[a0_0x7454e9(0x1f2)];[a0_0x7454e9(0x217)];['heartbeatTimer'];[a0_0x7454e9(0x1e7)];['running']=!0x1;constructor(_0x5e5276){const _0x98efd7=a0_0x7454e9;super();if(this[_0x98efd7(0x20c)]=_0x5e5276[_0x98efd7(0x20c)][_0x98efd7(0x210)](/\/$/,''),this[_0x98efd7(0x208)]=_0x5e5276[_0x98efd7(0x208)],this[_0x98efd7(0x216)]=_0x5e5276[_0x98efd7(0x216)],this[_0x98efd7(0x209)]=_0x5e5276[_0x98efd7(0x209)]||'sdk',this['resumeId']=_0x98efd7(0x1da)+_0x5e5276[_0x98efd7(0x208)]+'-'+Date[_0x98efd7(0x1cd)]()[_0x98efd7(0x1fa)](0x24),this['heartbeatInterval']=_0x5e5276[_0x98efd7(0x1f2)]??0x2bf20,this[_0x98efd7(0x217)]=_0x5e5276[_0x98efd7(0x217)]??0xbb8,_0x5e5276[_0x98efd7(0x1f9)]!==!0x1)this[_0x98efd7(0x1ee)]();}[a0_0x7454e9(0x1e2)](_0x3a4d0a){const _0x518186=a0_0x7454e9;console['log']('['+new Date()[_0x518186(0x202)]()[_0x518186(0x20a)](0x0,0x8)+_0x518186(0x1e3)+this[_0x518186(0x208)]+']\x20'+_0x3a4d0a);}async[a0_0x7454e9(0x1dd)](_0x32445c,_0xd7ab84){const _0x1841b2=a0_0x7454e9;let _0x3137ab={'Content-Type':_0x1841b2(0x1c4),'Accept':_0x1841b2(0x1d4)};if(this[_0x1841b2(0x216)])_0x3137ab[_0x1841b2(0x1d1)]=_0x1841b2(0x1f4)+this[_0x1841b2(0x216)];let _0x3fa80b=await(await fetch(this[_0x1841b2(0x20c)]+_0x1841b2(0x212),{'method':_0x1841b2(0x1db),'headers':_0x3137ab,'body':JSON[_0x1841b2(0x1cb)]({'jsonrpc':'2.0','id':Date[_0x1841b2(0x1cd)](),'method':_0x1841b2(0x1d5),'params':{'name':_0x32445c,'arguments':_0xd7ab84}})}))[_0x1841b2(0x21a)](),_0x12403d=_0x3fa80b['match'](/data: (.+)/),_0x55abcd=_0x12403d?JSON[_0x1841b2(0x1fe)](_0x12403d[0x1]):JSON[_0x1841b2(0x1fe)](_0x3fa80b),_0x31976b=_0x55abcd?.[_0x1841b2(0x200)]?.[_0x1841b2(0x1df)]?.[0x0]?.[_0x1841b2(0x21a)];return _0x31976b?JSON[_0x1841b2(0x1fe)](_0x31976b):_0x55abcd;}async['connect'](){const _0x5b46c7=a0_0x7454e9;if(this[_0x5b46c7(0x1fb)])return;this[_0x5b46c7(0x1fb)]=!0x0,await this[_0x5b46c7(0x1ce)]('idle'),this[_0x5b46c7(0x1e2)](_0x5b46c7(0x1cc)),this['heartbeatTimer']=setInterval(()=>{const _0x14a54b=_0x5b46c7;this[_0x14a54b(0x1ce)](_0x14a54b(0x1f0))['catch'](_0x2f643c=>this[_0x14a54b(0x1e2)](_0x14a54b(0x21c)+_0x2f643c[_0x14a54b(0x1dc)]));},this['heartbeatInterval']),this[_0x5b46c7(0x1e8)]();}async[a0_0x7454e9(0x1cf)](){const _0x107c52=a0_0x7454e9;if(this[_0x107c52(0x1fb)]=!0x1,this[_0x107c52(0x1e7)]?.['abort'](),this[_0x107c52(0x1ea)])clearInterval(this[_0x107c52(0x1ea)]);await this['status'](_0x107c52(0x214))[_0x107c52(0x1d0)](()=>{}),this[_0x107c52(0x1e2)](_0x107c52(0x1d6));}async[a0_0x7454e9(0x1d9)](_0x1dd913,_0x512074,_0x2e419b=a0_0x7454e9(0x1d2)){const _0x5059f8=a0_0x7454e9;return this[_0x5059f8(0x1dd)](_0x5059f8(0x205),{'alias':_0x1dd913,'task':_0x512074,'priority':_0x2e419b,'from_session':this[_0x5059f8(0x208)]});}async[a0_0x7454e9(0x1dc)](_0x133ed2,_0x48d206){const _0x5030de=a0_0x7454e9;return this[_0x5030de(0x1dd)](_0x5030de(0x1ed),{'alias':_0x133ed2,'message':_0x48d206,'from_session':this['alias']});}async[a0_0x7454e9(0x1d3)](_0x3fdb3c,_0x1218b9,_0x5f11e8=a0_0x7454e9(0x1f6)){const _0x50a5d3=a0_0x7454e9;return this[_0x50a5d3(0x1dd)](_0x50a5d3(0x218),{'in_reply_to':_0x3fdb3c,'text':_0x1218b9,'status':_0x5f11e8});}async['status'](_0x2e3125,_0x4eca19){const _0xdd98c4=a0_0x7454e9;return this[_0xdd98c4(0x1dd)](_0xdd98c4(0x1c8),{'resume_id':this[_0xdd98c4(0x1e0)],'alias':this[_0xdd98c4(0x208)],'status':_0x2e3125,'server':a0_0x5c3251(),'hostname':a0_0x5c3251(),'agent':this[_0xdd98c4(0x209)],'project_dir':process[_0xdd98c4(0x20e)](),..._0x4eca19});}async['getAllStatus'](){const _0x3d6310=a0_0x7454e9;return this[_0x3d6310(0x1dd)](_0x3d6310(0x1eb),{});}async[a0_0x7454e9(0x1f1)](_0x2b659a,_0x1eda27){const _0x1a44a4=a0_0x7454e9;return this['call']('broadcast',{'message':_0x2b659a,'filter_server':_0x1eda27?.[_0x1a44a4(0x1f8)],'filter_status':_0x1eda27?.['status']});}async[a0_0x7454e9(0x1e8)](){const _0x428d9f=a0_0x7454e9;let _0x4f0eb6=encodeURIComponent(this['alias']),_0x2be129=this[_0x428d9f(0x20c)]+'/events/'+_0x4f0eb6,_0x4f4a89=this[_0x428d9f(0x217)];while(this[_0x428d9f(0x1fb)]){try{this['sseAbort']=new AbortController();let _0x75c03c={'Accept':'text/event-stream'};if(this[_0x428d9f(0x216)])_0x75c03c[_0x428d9f(0x1d1)]=_0x428d9f(0x1f4)+this[_0x428d9f(0x216)];let _0x3639d7=await fetch(_0x2be129,{'headers':_0x75c03c,'signal':this['sseAbort']['signal']});if(!_0x3639d7['ok']||!_0x3639d7[_0x428d9f(0x1ca)]){this[_0x428d9f(0x1e2)](_0x428d9f(0x203)+_0x3639d7[_0x428d9f(0x1ce)]),await this['sleep'](_0x4f4a89),_0x4f4a89=Math['min'](_0x4f4a89*1.5,0xea60);continue;}_0x4f4a89=this['reconnectDelay'];let _0x1a8f7e=_0x3639d7['body'][_0x428d9f(0x20d)](),_0x42b0e5=new TextDecoder(),_0x3e04a7='';while(this['running']){let {done:_0x180d9e,value:_0x406c71}=await _0x1a8f7e['read']();if(_0x180d9e)break;_0x3e04a7+=_0x42b0e5[_0x428d9f(0x1d8)](_0x406c71,{'stream':!0x0});let _0x1a8836=_0x3e04a7['split']('\x0a');_0x3e04a7=_0x1a8836['pop']()||'';for(let _0x1a9e6d of _0x1a8836){if(!_0x1a9e6d[_0x428d9f(0x1f3)](_0x428d9f(0x21b)))continue;try{let _0x3d9067=JSON['parse'](_0x1a9e6d[_0x428d9f(0x20a)](0x6));if(_0x3d9067[_0x428d9f(0x219)]===_0x428d9f(0x20f)){this[_0x428d9f(0x1e2)](_0x428d9f(0x213)),this[_0x428d9f(0x1ec)](_0x428d9f(0x20f));continue;}if(_0x3d9067[_0x428d9f(0x219)]===_0x428d9f(0x20b)||_0x3d9067[_0x428d9f(0x219)]===_0x428d9f(0x204)||_0x3d9067[_0x428d9f(0x219)]===_0x428d9f(0x1f1))await this[_0x428d9f(0x1e4)]();}catch{}}}}catch(_0x5beb36){if(_0x5beb36[_0x428d9f(0x211)]===_0x428d9f(0x1e1))break;this['emit'](_0x428d9f(0x1ef),_0x5beb36),this[_0x428d9f(0x1e2)](_0x428d9f(0x1f7)+_0x5beb36[_0x428d9f(0x1dc)]);}if(this[_0x428d9f(0x1fb)])this[_0x428d9f(0x1ec)](_0x428d9f(0x1d6)),this['log']('SSE\x20reconnecting\x20in\x20'+_0x4f4a89/0x3e8+_0x428d9f(0x206)),await this['sleep'](_0x4f4a89),_0x4f4a89=Math[_0x428d9f(0x1fd)](_0x4f4a89*1.5,0xea60);}}async[a0_0x7454e9(0x1e4)](){const _0x2398f4=a0_0x7454e9;try{let _0x1c5b8d=(await this[_0x2398f4(0x1dd)](_0x2398f4(0x1ff),{'alias':this[_0x2398f4(0x208)],'limit':0xa}))?.[_0x2398f4(0x1de)]||[];for(let _0x4a96f9 of _0x1c5b8d)await this[_0x2398f4(0x1dd)](_0x2398f4(0x1c9),{'alias':this[_0x2398f4(0x208)],'message_id':_0x4a96f9['id']}),this['log']('←\x20'+_0x4a96f9[_0x2398f4(0x1e9)]+':\x20'+_0x4a96f9[_0x2398f4(0x1df)][_0x2398f4(0x20a)](0x0,0x3c)),this[_0x2398f4(0x1ec)](_0x2398f4(0x1d7),_0x4a96f9),this['emit'](_0x2398f4(0x1dc),_0x4a96f9);}catch(_0x4366a7){this[_0x2398f4(0x1e2)](_0x2398f4(0x1fc)+_0x4366a7['message']);}}[a0_0x7454e9(0x1c7)](_0x377e0b){return new Promise(_0x3bd190=>setTimeout(_0x3bd190,_0x377e0b));}}var $=T;export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x501d01=a0_0x15e2;(function(_0x1b15a9,_0x5d01be){const _0x447607=a0_0x15e2,_0x39d931=_0x1b15a9();while(!![]){try{const _0x40d564=-parseInt(_0x447607(0x11f))/0x1+parseInt(_0x447607(0x139))/0x2*(-parseInt(_0x447607(0x148))/0x3)+-parseInt(_0x447607(0x122))/0x4*(-parseInt(_0x447607(0x130))/0x5)+-parseInt(_0x447607(0x12a))/0x6+-parseInt(_0x447607(0x10b))/0x7+-parseInt(_0x447607(0x109))/0x8*(-parseInt(_0x447607(0x101))/0x9)+parseInt(_0x447607(0xe3))/0xa*(parseInt(_0x447607(0x13e))/0xb);if(_0x40d564===_0x5d01be)break;else _0x39d931['push'](_0x39d931['shift']());}catch(_0x190d22){_0x39d931['push'](_0x39d931['shift']());}}}(a0_0x41d2,0x8ecf6));import{readFileSync as a0_0x10c937,existsSync as a0_0xd42973}from'fs';import{randomUUID as a0_0x103a6a}from'crypto';import{join as a0_0x25eed9}from'path';import{hostname as a0_0x52e9bf}from'os';import{execSync as a0_0x430f67}from'child_process';import{Server as a0_0xdee4d1}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x2c9a6e}from'@modelcontextprotocol/sdk/server/stdio.js';function a0_0x41d2(){const _0x116c18=['cwd','replace','.anet','...\x20TMUX=','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','join','working','body','data:\x20','startsWith','find','stdin','catch','new_message','split','\x20priority=','tools/call','inbox_count','5167359nHEfWV','SSE\x20connection\x20error:\x20','application/json,\x20text/event-stream','.claude/channels/commhub','init\x20failed:\x20','/events/','commhub_send_task','token','16QQMqYQ','Task\x20content','5980814OETSVe','end','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','string','error','object','from','Target\x20session\x20alias','utf-8','notifications/claude/channel','SSE\x20fatal:\x20','ack_inbox','2025-03-26','\x20ALIAS=','alias','text','SSE\x20connected\x20as\x20\x22','toTimeString','message_id','failed','856069VggjhN','connected','exit','28FmACKp','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','content','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','unknown\x20tool','stringify','normal','none','5490678GrOQsq','ready\x20—\x20waiting\x20for\x20events','SIGINT','registered\x20as\x20\x22','write','from_session','496115RzarFT','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','Bearer\x20','then','claude-code','Message\x20content','task','high','report_status','462WpurlN','get_all_status','completed','commhub_send_message','parse','632687TbhWCM','message','starting\x20SSE\x20listener...','status','shutting\x20down,\x20reporting\x20offline...','idle','low','delete','send_task','result','12117XRDGSu','Priority\x20(default:\x20normal)','replied','0.3.0','setRequestHandler','commhub_get_all_status','notification','decode','Authorization','heartbeat\x20failed:\x20','read','http://127.0.0.1:9200','commhub_reply','commhub','.env','slice','/mcp','connect','MCP\x20stdio\x20connected','commhub_report_status','warning:\x20could\x20not\x20register:\x20','application/json','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','priority','in_progress','messages','session\x20disconnected','initialize','Current\x20task\x20description','get_inbox','length','hub','indexOf','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','SIGTERM','commhub-channel','2.0','blocked','fatal:\x20','parse\x20error:\x20','trim','cancelled','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','\x20RESUME_ID=','\x20PROJECT_ENV=','tmux\x20display-message\x20-p\x20\x27#S\x27','400WiMDRL','CommHub\x20init\x20failed:\x20','send_message','config.json','\x22\x20(','get','number','POST','←\x20message\x20from\x20','new_task','type','Progress\x200-100'];a0_0x41d2=function(){return _0x116c18;};return a0_0x41d2();}import{ListToolsRequestSchema as a0_0x353800,CallToolRequestSchema as a0_0x500e15}from'@modelcontextprotocol/sdk/types.js';function p(_0x18d0c5){const _0x1f6b44=a0_0x15e2;if(!a0_0xd42973(_0x18d0c5))return;for(let _0x3e87a2 of a0_0x10c937(_0x18d0c5,_0x1f6b44(0x113))['split']('\x0a')){let _0xd2410c=_0x3e87a2['trim']();if(!_0xd2410c||_0xd2410c[_0x1f6b44(0xf8)]('#'))continue;let _0x28ebf3=_0xd2410c[_0x1f6b44(0x169)]('=');if(_0x28ebf3<0x0)continue;let _0x54c95a=_0xd2410c['slice'](0x0,_0x28ebf3)[_0x1f6b44(0x171)](),_0x1e6edd=_0xd2410c['slice'](_0x28ebf3+0x1)[_0x1f6b44(0x171)]()[_0x1f6b44(0xf0)](/^["']|["']$/g,'');if(!process.env[_0x54c95a])process.env[_0x54c95a]=_0x1e6edd;}}var C=process.env.HOME||'~',T=a0_0x25eed9(C,a0_0x501d01(0x104));p(a0_0x25eed9(T,a0_0x501d01(0x156)));var L=process['cwd']()[a0_0x501d01(0xf0)](/\//g,'-');p(a0_0x25eed9(T,L,a0_0x501d01(0x156)));function U(){const _0x42f4c8=a0_0x501d01;try{return a0_0x430f67(_0x42f4c8(0xe2),{'encoding':'utf-8','timeout':0x7d0})[_0x42f4c8(0x171)]();}catch{return'';}}function v(){const _0x30b010=a0_0x501d01;try{let _0x140a86=a0_0x25eed9(C,_0x30b010(0xf1),_0x30b010(0xe6));if(a0_0xd42973(_0x140a86))return JSON[_0x30b010(0x13d)](a0_0x10c937(_0x140a86,_0x30b010(0x113)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x501d01(0x168)]||a0_0x501d01(0x153),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x52e9bf(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x103a6a(),X=process.env.COMMHUB_TOKEN||H[a0_0x501d01(0x108)]||'';function Y(_0x3c5a74){const _0xbae7c2=a0_0x501d01;let _0x37a7f0=new Date()[_0xbae7c2(0x11c)]()[_0xbae7c2(0x157)](0x0,0x8);process['stderr'][_0xbae7c2(0x12e)]('['+_0x37a7f0+']\x20[commhub]\x20'+_0x3c5a74+'\x0a');}function h(_0x73a2f0){return new Promise(_0x55b9ec=>setTimeout(_0x55b9ec,_0x73a2f0));}Y('ENV:\x20URL='+f+a0_0x501d01(0x118)+Z+a0_0x501d01(0x175)+w[a0_0x501d01(0x157)](0x0,0x8)+a0_0x501d01(0xf2)+(j||a0_0x501d01(0x129))+'\x20CWD='+process['cwd']()+a0_0x501d01(0x176)+L);var k=new Map(),K=new a0_0xdee4d1({'name':a0_0x501d01(0x16c),'version':a0_0x501d01(0x14b)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x501d01(0x10d),a0_0x501d01(0x16a),a0_0x501d01(0x131),a0_0x501d01(0x125),'Session\x20alias:\x20'+Z][a0_0x501d01(0xf4)]('\x0a')});K[a0_0x501d01(0x14c)](a0_0x353800,async()=>({'tools':[{'name':a0_0x501d01(0x154),'description':a0_0x501d01(0xf3),'inputSchema':{'type':a0_0x501d01(0x110),'properties':{'task_id':{'type':a0_0x501d01(0x10e),'description':a0_0x501d01(0x15f)},'text':{'type':a0_0x501d01(0x10e),'description':'Reply\x20text\x20/\x20result\x20summary'},'status':{'type':a0_0x501d01(0x10e),'enum':[a0_0x501d01(0x13b),a0_0x501d01(0x11e),a0_0x501d01(0x172),'blocked',a0_0x501d01(0x10f),a0_0x501d01(0x161)],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':[a0_0x501d01(0x11a)]}},{'name':a0_0x501d01(0x15b),'description':a0_0x501d01(0x15e),'inputSchema':{'type':a0_0x501d01(0x110),'properties':{'status':{'type':a0_0x501d01(0x10e),'enum':[a0_0x501d01(0xf5),a0_0x501d01(0x143),a0_0x501d01(0x16e),a0_0x501d01(0x10f)]},'task':{'type':a0_0x501d01(0x10e),'description':a0_0x501d01(0x165)},'progress':{'type':a0_0x501d01(0xe9),'description':a0_0x501d01(0xee)}},'required':[a0_0x501d01(0x141)]}},{'name':a0_0x501d01(0x107),'description':a0_0x501d01(0x123),'inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x501d01(0x10e),'description':a0_0x501d01(0x112)},'task':{'type':a0_0x501d01(0x10e),'description':a0_0x501d01(0x10a)},'priority':{'type':a0_0x501d01(0x10e),'enum':[a0_0x501d01(0x137),'normal',a0_0x501d01(0x144)],'description':a0_0x501d01(0x149)}},'required':[a0_0x501d01(0x119),a0_0x501d01(0x136)]}},{'name':a0_0x501d01(0x13c),'description':a0_0x501d01(0x174),'inputSchema':{'type':a0_0x501d01(0x110),'properties':{'alias':{'type':'string','description':a0_0x501d01(0x112)},'message':{'type':'string','description':a0_0x501d01(0x135)}},'required':['alias',a0_0x501d01(0x13f)]}},{'name':a0_0x501d01(0x14d),'description':a0_0x501d01(0x173),'inputSchema':{'type':a0_0x501d01(0x110),'properties':{}}}]}));async function P(_0x26575b,_0x7f92c0){const _0x4e0cb7=a0_0x501d01;let _0x6dd215=await fetch(f+_0x4e0cb7(0x158),{'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x4e0cb7(0x132)+X}:{}},'body':JSON[_0x4e0cb7(0x127)]({'jsonrpc':_0x4e0cb7(0x16d),'id':0x1,'method':_0x4e0cb7(0x164),'params':{'protocolVersion':_0x4e0cb7(0x117),'capabilities':{},'clientInfo':{'name':_0x4e0cb7(0x16c),'version':'0.3.0'}}})});if(!_0x6dd215['ok']){let _0x34e68f=await _0x6dd215['text']();return Y(_0x4e0cb7(0xe4)+_0x6dd215[_0x4e0cb7(0x141)]+'\x20'+_0x34e68f[_0x4e0cb7(0x157)](0x0,0x64)),{'ok':!0x1,'error':_0x4e0cb7(0x105)+_0x6dd215['status']};}await _0x6dd215[_0x4e0cb7(0x11a)]();let _0x2aa453=(await(await fetch(f+_0x4e0cb7(0x158),{'method':_0x4e0cb7(0xea),'headers':{'Content-Type':_0x4e0cb7(0x15d),'Accept':_0x4e0cb7(0x103),...X?{'Authorization':_0x4e0cb7(0x132)+X}:{}},'body':JSON[_0x4e0cb7(0x127)]({'jsonrpc':'2.0','id':0x2,'method':_0x4e0cb7(0xff),'params':{'name':_0x26575b,'arguments':_0x7f92c0}})}))[_0x4e0cb7(0x11a)]())['split']('\x0a')[_0x4e0cb7(0xf9)](_0x390467=>_0x390467['startsWith']('data:\x20'));if(_0x2aa453){let _0x226165=JSON[_0x4e0cb7(0x13d)](_0x2aa453[_0x4e0cb7(0x157)](0x6));return _0x226165?.['result']?.[_0x4e0cb7(0x124)]?.[0x0]?.[_0x4e0cb7(0x11a)]?JSON[_0x4e0cb7(0x13d)](_0x226165[_0x4e0cb7(0x147)][_0x4e0cb7(0x124)][0x0][_0x4e0cb7(0x11a)]):_0x226165;}return{'ok':!0x1,'error':'no\x20response'};}K['setRequestHandler'](a0_0x500e15,async _0x2e0b3a=>{const _0xff59ec=a0_0x501d01;let {name:_0x46c3b0,arguments:_0x42b782}=_0x2e0b3a['params'];if(_0x46c3b0===_0xff59ec(0x154)){let {task_id:_0x1d17a5,text:_0xfb3d5e,status:_0x4e5de6}=_0x42b782;if(_0x4e5de6==='completed'||_0x4e5de6===_0xff59ec(0x11e)||_0x4e5de6===_0xff59ec(0x172)){let _0x4f5897=_0x4e5de6===_0xff59ec(0x13b)?_0xff59ec(0x14a):_0x4e5de6,_0x1cae52=_0x1d17a5?k[_0xff59ec(0xe8)](_0x1d17a5)||'hub':'hub',_0x53d75e=await P('send_reply',{'alias':_0x1cae52,'text':_0xfb3d5e,'in_reply_to':_0x1d17a5||void 0x0,'status':_0x4f5897,'from_session':Z});if(_0x1d17a5)k[_0xff59ec(0x145)](_0x1d17a5);return{'content':[{'type':_0xff59ec(0x11a),'text':JSON[_0xff59ec(0x127)](_0x53d75e)}]};}let _0x26413e=await P(_0xff59ec(0x138),{'resume_id':w,'alias':Z,'status':_0x4e5de6===_0xff59ec(0x16e)?_0xff59ec(0x16e):_0x4e5de6===_0xff59ec(0x10f)?_0xff59ec(0x10f):_0xff59ec(0xf5),'task':_0xfb3d5e[_0xff59ec(0x157)](0x0,0xc8),'output':_0xfb3d5e});return{'content':[{'type':_0xff59ec(0x11a),'text':JSON['stringify'](_0x26413e)}]};}if(_0x46c3b0===_0xff59ec(0x15b)){let {status:_0x1afc7c,task:_0x566413,progress:_0x9f9ced}=_0x42b782,_0x2f4b36=await P(_0xff59ec(0x138),{'resume_id':w,'alias':Z,'status':_0x1afc7c,'task':_0x566413,'progress':_0x9f9ced});return{'content':[{'type':_0xff59ec(0x11a),'text':JSON[_0xff59ec(0x127)](_0x2f4b36)}]};}if(_0x46c3b0===_0xff59ec(0x107)){let {alias:_0xc417c,task:_0x3b1abd,priority:_0x52721e}=_0x42b782,_0x343be8=await P(_0xff59ec(0x146),{'alias':_0xc417c,'task':_0x3b1abd,'priority':_0x52721e||_0xff59ec(0x128),'from_session':Z});return{'content':[{'type':_0xff59ec(0x11a),'text':JSON['stringify'](_0x343be8)}]};}if(_0x46c3b0===_0xff59ec(0x13c)){let {alias:_0x32de01,message:_0x31c137}=_0x42b782,_0x1ece13=await P(_0xff59ec(0xe5),{'alias':_0x32de01,'message':_0x31c137,'from_session':Z});return{'content':[{'type':_0xff59ec(0x11a),'text':JSON[_0xff59ec(0x127)](_0x1ece13)}]};}if(_0x46c3b0==='commhub_get_all_status'){let _0x39455a=await P(_0xff59ec(0x13a),{});return{'content':[{'type':'text','text':JSON[_0xff59ec(0x127)](_0x39455a)}]};}return{'content':[{'type':_0xff59ec(0x11a),'text':JSON[_0xff59ec(0x127)]({'error':_0xff59ec(0x126)})}]};});async function u(){const _0x222c3c=a0_0x501d01;let _0x27b323=f+_0x222c3c(0x106)+encodeURIComponent(Z),_0x58ce16={};if(X)_0x58ce16[_0x222c3c(0x150)]=_0x222c3c(0x132)+X;Y('connecting\x20to\x20'+_0x27b323);while(!0x0){try{let _0x38ca7e=await fetch(_0x27b323,{'headers':_0x58ce16});if(!_0x38ca7e['ok']){Y('SSE\x20error:\x20'+_0x38ca7e[_0x222c3c(0x141)]+'\x20'+_0x38ca7e['statusText']),await h(0x1388);continue;}let _0x4fc11e=_0x38ca7e[_0x222c3c(0xf6)]['getReader'](),_0x54dfd5=new TextDecoder(),_0x3c9295='';while(!0x0){let {done:_0x59a5dd,value:_0x15991a}=await _0x4fc11e[_0x222c3c(0x152)]();if(_0x59a5dd)break;_0x3c9295+=_0x54dfd5[_0x222c3c(0x14f)](_0x15991a,{'stream':!0x0});let _0x3a734c=_0x3c9295[_0x222c3c(0xfd)]('\x0a\x0a');_0x3c9295=_0x3a734c['pop']()||'';for(let _0xc425f9 of _0x3a734c){let _0x226c9e=_0xc425f9[_0x222c3c(0xfd)]('\x0a')['find'](_0x5eb137=>_0x5eb137[_0x222c3c(0xf8)](_0x222c3c(0xf7)));if(!_0x226c9e)continue;try{let _0x2a4c08=JSON[_0x222c3c(0x13d)](_0x226c9e[_0x222c3c(0x157)](0x6));await S(_0x2a4c08);}catch(_0x4bdcee){Y(_0x222c3c(0x170)+_0x4bdcee);}}}Y('SSE\x20stream\x20ended,\x20reconnecting...');}catch(_0x30582e){Y(_0x222c3c(0x102)+_0x30582e);}await h(0xbb8);}}function a0_0x15e2(_0x496464,_0x2a66be){_0x496464=_0x496464-0xe2;const _0x41d251=a0_0x41d2();let _0x15e29a=_0x41d251[_0x496464];return _0x15e29a;}async function S(_0x5c8f49){const _0x120b83=a0_0x501d01;if(_0x5c8f49[_0x120b83(0xed)]===_0x120b83(0x120)){Y(_0x120b83(0x11b)+Z+'\x22');return;}if(_0x5c8f49[_0x120b83(0xed)]===_0x120b83(0xfc)){if(Y(_0x120b83(0xeb)+_0x5c8f49[_0x120b83(0x111)]+':\x20'+_0x5c8f49[_0x120b83(0x13f)]['slice'](0x0,0x3c)),await K[_0x120b83(0x14e)]({'method':_0x120b83(0x114),'params':{'content':_0x5c8f49[_0x120b83(0x13f)],'meta':{'sender':_0x5c8f49['from']||_0x120b83(0x168),'sender_id':_0x120b83(0x155),'user':_0x5c8f49[_0x120b83(0x111)]||_0x120b83(0x168),'priority':'normal'}}}),_0x5c8f49[_0x120b83(0x11d)])await P(_0x120b83(0x116),{'alias':Z,'message_id':_0x5c8f49[_0x120b83(0x11d)]});return;}if(_0x5c8f49[_0x120b83(0xed)]===_0x120b83(0xec)||_0x5c8f49['type']==='broadcast'){Y('←\x20'+_0x5c8f49[_0x120b83(0xed)]+':\x20inbox_count='+_0x5c8f49[_0x120b83(0x100)]+_0x120b83(0xfe)+(_0x5c8f49[_0x120b83(0x160)]||_0x120b83(0x128)));let _0x2868da=await P(_0x120b83(0x166),{'alias':Z,'limit':0x5});if(_0x2868da?.['ok']&&_0x2868da['messages']?.[_0x120b83(0x167)]>0x0)for(let _0x1a2952 of _0x2868da[_0x120b83(0x162)]){let _0x7ab3d2={'sender':_0x1a2952[_0x120b83(0x12f)]||'hub','sender_id':_0x120b83(0x155),'user':_0x1a2952[_0x120b83(0x12f)]||_0x120b83(0x168),'task_id':_0x1a2952['id'],'priority':_0x1a2952['priority']||'normal'};k['set'](_0x1a2952['id'],_0x1a2952['from_session']||_0x120b83(0x168)),await K[_0x120b83(0x14e)]({'method':_0x120b83(0x114),'params':{'content':_0x1a2952['content'],'meta':_0x7ab3d2}}),Y('→\x20injected\x20task\x20'+_0x1a2952['id'][_0x120b83(0x157)](0x0,0x8)+'\x20from\x20'+_0x1a2952[_0x120b83(0x12f)]+':\x20'+_0x1a2952[_0x120b83(0x124)][_0x120b83(0x157)](0x0,0x3c)),await P('ack_inbox',{'alias':Z,'message_id':_0x1a2952['id']});}}}async function A(){const _0x5781c3=a0_0x501d01;let _0x52c155=new a0_0x2c9a6e();await K[_0x5781c3(0x159)](_0x52c155),Y(_0x5781c3(0x15a)),Y(_0x5781c3(0x140)),u()[_0x5781c3(0xfb)](_0x73b650=>Y(_0x5781c3(0x115)+_0x73b650)),P(_0x5781c3(0x138),{'resume_id':w,'alias':Z,'status':_0x5781c3(0x143),'server':a0_0x52e9bf(),'hostname':a0_0x52e9bf(),'agent':'claude-code','project_dir':process[_0x5781c3(0xef)](),'tmux_name':j||void 0x0})[_0x5781c3(0x133)](()=>Y(_0x5781c3(0x12d)+Z+_0x5781c3(0xe7)+w['slice'](0x0,0x8)+')'))['catch'](_0x5a796c=>Y(_0x5781c3(0x15c)+_0x5a796c)),setInterval(()=>{const _0x3bdb56=_0x5781c3;P('report_status',{'resume_id':w,'alias':Z,'status':_0x3bdb56(0x143),'server':a0_0x52e9bf(),'hostname':a0_0x52e9bf(),'agent':_0x3bdb56(0x134),'project_dir':process[_0x3bdb56(0xef)](),'tmux_name':j||void 0x0})[_0x3bdb56(0xfb)](_0x3c30fa=>Y(_0x3bdb56(0x151)+_0x3c30fa));},0x2bf20),Y(_0x5781c3(0x12b));}A()[a0_0x501d01(0xfb)](_0x177941=>{const _0x152897=a0_0x501d01;Y(_0x152897(0x16f)+_0x177941),process[_0x152897(0x121)](0x1);});async function N(){const _0x2cb771=a0_0x501d01;Y(_0x2cb771(0x142)),await P('report_status',{'resume_id':w,'alias':Z,'status':_0x2cb771(0x10f),'task':_0x2cb771(0x163)})[_0x2cb771(0xfb)](()=>{}),process['exit'](0x0);}process[a0_0x501d01(0xfa)]['on'](a0_0x501d01(0x10c),()=>N()),process['on'](a0_0x501d01(0x16b),()=>N()),process['on'](a0_0x501d01(0x12c),()=>N());
2
+ const a0_0x89dc75=a0_0x4d2a;(function(_0x2923f3,_0x576966){const _0x5eab70=a0_0x4d2a,_0x206844=_0x2923f3();while(!![]){try{const _0x1043a4=parseInt(_0x5eab70(0x222))/0x1+-parseInt(_0x5eab70(0x204))/0x2+-parseInt(_0x5eab70(0x23b))/0x3*(parseInt(_0x5eab70(0x1e8))/0x4)+-parseInt(_0x5eab70(0x234))/0x5+parseInt(_0x5eab70(0x262))/0x6+-parseInt(_0x5eab70(0x24a))/0x7*(-parseInt(_0x5eab70(0x218))/0x8)+parseInt(_0x5eab70(0x245))/0x9;if(_0x1043a4===_0x576966)break;else _0x206844['push'](_0x206844['shift']());}catch(_0x31f051){_0x206844['push'](_0x206844['shift']());}}}(a0_0x8f4f,0xb703a));import{readFileSync as a0_0x27139e,existsSync as a0_0x419d7d}from'fs';import{randomUUID as a0_0x165dec}from'crypto';import{join as a0_0x2b979e}from'path';import{hostname as a0_0x3ce3c4}from'os';import{execSync as a0_0x3e49b9}from'child_process';import{Server as a0_0x37111e}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x2dff84}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x121631,CallToolRequestSchema as a0_0x3ec5d0}from'@modelcontextprotocol/sdk/types.js';function p(_0x5c0d28){const _0x5a24c2=a0_0x4d2a;if(!a0_0x419d7d(_0x5c0d28))return;for(let _0x21fa5c of a0_0x27139e(_0x5c0d28,'utf-8')[_0x5a24c2(0x224)]('\x0a')){let _0x5a09f7=_0x21fa5c[_0x5a24c2(0x237)]();if(!_0x5a09f7||_0x5a09f7[_0x5a24c2(0x247)]('#'))continue;let _0x188d43=_0x5a09f7[_0x5a24c2(0x252)]('=');if(_0x188d43<0x0)continue;let _0x1372cb=_0x5a09f7[_0x5a24c2(0x1fd)](0x0,_0x188d43)['trim'](),_0xaed8cb=_0x5a09f7[_0x5a24c2(0x1fd)](_0x188d43+0x1)['trim']()[_0x5a24c2(0x1d9)](/^["']|["']$/g,'');if(!process.env[_0x1372cb])process.env[_0x1372cb]=_0xaed8cb;}}var C=process.env.HOME||'~',T=a0_0x2b979e(C,'.claude/channels/commhub');p(a0_0x2b979e(T,a0_0x89dc75(0x261)));var L=process[a0_0x89dc75(0x24e)]()[a0_0x89dc75(0x1d9)](/\//g,'-');p(a0_0x2b979e(T,L,a0_0x89dc75(0x261)));function a0_0x4d2a(_0x5c6d3b,_0x420f14){_0x5c6d3b=_0x5c6d3b-0x1d8;const _0x8f4fb3=a0_0x8f4f();let _0x4d2a1f=_0x8f4fb3[_0x5c6d3b];return _0x4d2a1f;}function U(){const _0x32288c=a0_0x89dc75;try{return a0_0x3e49b9(_0x32288c(0x1e2),{'encoding':_0x32288c(0x244),'timeout':0x7d0})[_0x32288c(0x237)]();}catch{return'';}}function v(){const _0x7ff8ca=a0_0x89dc75;try{let _0x316ba1=a0_0x2b979e(C,_0x7ff8ca(0x22c),_0x7ff8ca(0x254));if(a0_0x419d7d(_0x316ba1))return JSON[_0x7ff8ca(0x215)](a0_0x27139e(_0x316ba1,_0x7ff8ca(0x244)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x89dc75(0x211)]||a0_0x89dc75(0x1f6),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x3ce3c4(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x165dec(),X=process.env.COMMHUB_TOKEN||H['token']||'';function Y(_0x5db0d5){const _0x12914b=a0_0x89dc75;let _0x58a96a=new Date()['toTimeString']()['slice'](0x0,0x8);process[_0x12914b(0x1d8)][_0x12914b(0x1fb)]('['+_0x58a96a+']\x20[commhub]\x20'+_0x5db0d5+'\x0a');}function h(_0x1b5b28){return new Promise(_0x2c1ef8=>setTimeout(_0x2c1ef8,_0x1b5b28));}Y(a0_0x89dc75(0x227)+f+a0_0x89dc75(0x1f0)+Z+a0_0x89dc75(0x24c)+w['slice'](0x0,0x8)+'...\x20TMUX='+(j||'none')+'\x20CWD='+process['cwd']()+'\x20PROJECT_ENV='+L);var k=new Map(),K=new a0_0x37111e({'name':a0_0x89dc75(0x256),'version':a0_0x89dc75(0x1ef)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x89dc75(0x24f),a0_0x89dc75(0x1f3),a0_0x89dc75(0x23d),a0_0x89dc75(0x225),a0_0x89dc75(0x258)+Z]['join']('\x0a')});K[a0_0x89dc75(0x228)](a0_0x121631,async()=>({'tools':[{'name':a0_0x89dc75(0x1e6),'description':a0_0x89dc75(0x217),'inputSchema':{'type':a0_0x89dc75(0x242),'properties':{'task_id':{'type':a0_0x89dc75(0x23c),'description':a0_0x89dc75(0x238)},'text':{'type':a0_0x89dc75(0x23c),'description':a0_0x89dc75(0x24b)},'status':{'type':'string','enum':[a0_0x89dc75(0x25d),a0_0x89dc75(0x20c),a0_0x89dc75(0x230),'blocked',a0_0x89dc75(0x25c),'in_progress'],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':[a0_0x89dc75(0x1e1)]}},{'name':a0_0x89dc75(0x1e9),'description':a0_0x89dc75(0x251),'inputSchema':{'type':a0_0x89dc75(0x242),'properties':{'status':{'type':a0_0x89dc75(0x23c),'enum':[a0_0x89dc75(0x249),'idle',a0_0x89dc75(0x1f7),a0_0x89dc75(0x25c)]},'task':{'type':'string','description':'Current\x20task\x20description'},'progress':{'type':'number','description':a0_0x89dc75(0x264)}},'required':[a0_0x89dc75(0x229)]}},{'name':a0_0x89dc75(0x1dd),'description':a0_0x89dc75(0x260),'inputSchema':{'type':a0_0x89dc75(0x242),'properties':{'alias':{'type':'string','description':a0_0x89dc75(0x1e3)},'task':{'type':a0_0x89dc75(0x23c),'description':a0_0x89dc75(0x1f9)},'priority':{'type':a0_0x89dc75(0x23c),'enum':[a0_0x89dc75(0x1fc),a0_0x89dc75(0x21f),a0_0x89dc75(0x1ec)],'description':a0_0x89dc75(0x226)}},'required':[a0_0x89dc75(0x232),a0_0x89dc75(0x21b)]}},{'name':a0_0x89dc75(0x21e),'description':a0_0x89dc75(0x1ed),'inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x89dc75(0x23c),'description':a0_0x89dc75(0x1e3)},'message':{'type':a0_0x89dc75(0x23c),'description':a0_0x89dc75(0x23f)}},'required':[a0_0x89dc75(0x232),'message']}},{'name':'commhub_get_all_status','description':a0_0x89dc75(0x21a),'inputSchema':{'type':a0_0x89dc75(0x242),'properties':{}}}]}));async function P(_0x1ad581,_0x3d993a){const _0x116a21=a0_0x89dc75;let _0x34b44c=await fetch(f+_0x116a21(0x208),{'method':'POST','headers':{'Content-Type':_0x116a21(0x23a),'Accept':_0x116a21(0x1fe),...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON[_0x116a21(0x1e4)]({'jsonrpc':_0x116a21(0x22b),'id':0x1,'method':_0x116a21(0x20b),'params':{'protocolVersion':_0x116a21(0x1db),'capabilities':{},'clientInfo':{'name':_0x116a21(0x256),'version':_0x116a21(0x1ef)}}})});if(!_0x34b44c['ok']){let _0x40b261=await _0x34b44c[_0x116a21(0x1e1)]();return Y(_0x116a21(0x233)+_0x34b44c[_0x116a21(0x229)]+'\x20'+_0x40b261[_0x116a21(0x1fd)](0x0,0x64)),{'ok':!0x1,'error':_0x116a21(0x1ea)+_0x34b44c['status']};}await _0x34b44c[_0x116a21(0x1e1)]();let _0x12a374=(await(await fetch(f+_0x116a21(0x208),{'method':_0x116a21(0x1f5),'headers':{'Content-Type':_0x116a21(0x23a),'Accept':_0x116a21(0x1fe),...X?{'Authorization':_0x116a21(0x22f)+X}:{}},'body':JSON[_0x116a21(0x1e4)]({'jsonrpc':_0x116a21(0x22b),'id':0x2,'method':_0x116a21(0x243),'params':{'name':_0x1ad581,'arguments':_0x3d993a}})}))[_0x116a21(0x1e1)]())[_0x116a21(0x224)]('\x0a')[_0x116a21(0x1da)](_0x392298=>_0x392298[_0x116a21(0x247)](_0x116a21(0x22a)));if(_0x12a374){let _0x340a32=JSON['parse'](_0x12a374[_0x116a21(0x1fd)](0x6));return _0x340a32?.[_0x116a21(0x1ee)]?.[_0x116a21(0x248)]?.[0x0]?.['text']?JSON['parse'](_0x340a32[_0x116a21(0x1ee)][_0x116a21(0x248)][0x0]['text']):_0x340a32;}return{'ok':!0x1,'error':_0x116a21(0x1de)};}K[a0_0x89dc75(0x228)](a0_0x3ec5d0,async _0x2a702a=>{const _0x3ecdd6=a0_0x89dc75;let {name:_0x44f8a3,arguments:_0x1a8f41}=_0x2a702a[_0x3ecdd6(0x209)];if(_0x44f8a3===_0x3ecdd6(0x1e6)){let {task_id:_0x27c30b,text:_0x2f37f3,status:_0x4df22d}=_0x1a8f41;if(_0x4df22d===_0x3ecdd6(0x25d)||_0x4df22d==='failed'||_0x4df22d===_0x3ecdd6(0x230)){let _0x2c010b=_0x4df22d===_0x3ecdd6(0x25d)?_0x3ecdd6(0x1e0):_0x4df22d,_0x1d5463=_0x27c30b?k[_0x3ecdd6(0x1eb)](_0x27c30b)||_0x3ecdd6(0x211):_0x3ecdd6(0x211),_0x25f66a=await P(_0x3ecdd6(0x25a),{'alias':_0x1d5463,'text':_0x2f37f3,'in_reply_to':_0x27c30b||void 0x0,'status':_0x2c010b,'from_session':Z});if(_0x27c30b)k[_0x3ecdd6(0x24d)](_0x27c30b);return{'content':[{'type':_0x3ecdd6(0x1e1),'text':JSON[_0x3ecdd6(0x1e4)](_0x25f66a)}]};}let _0x5c002f=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x4df22d===_0x3ecdd6(0x1f7)?_0x3ecdd6(0x1f7):_0x4df22d==='error'?_0x3ecdd6(0x25c):_0x3ecdd6(0x249),'task':_0x2f37f3['slice'](0x0,0xc8),'output':_0x2f37f3});return{'content':[{'type':_0x3ecdd6(0x1e1),'text':JSON[_0x3ecdd6(0x1e4)](_0x5c002f)}]};}if(_0x44f8a3===_0x3ecdd6(0x1e9)){let {status:_0x143540,task:_0x2db65e,progress:_0x2c666f}=_0x1a8f41,_0x3d207a=await P(_0x3ecdd6(0x1f1),{'resume_id':w,'alias':Z,'status':_0x143540,'task':_0x2db65e,'progress':_0x2c666f});return{'content':[{'type':_0x3ecdd6(0x1e1),'text':JSON[_0x3ecdd6(0x1e4)](_0x3d207a)}]};}if(_0x44f8a3===_0x3ecdd6(0x1dd)){let {alias:_0x6bdb87,task:_0x58a45c,priority:_0x202da0}=_0x1a8f41,_0x51b0dc=await P(_0x3ecdd6(0x212),{'alias':_0x6bdb87,'task':_0x58a45c,'priority':_0x202da0||'normal','from_session':Z});return{'content':[{'type':_0x3ecdd6(0x1e1),'text':JSON['stringify'](_0x51b0dc)}]};}if(_0x44f8a3===_0x3ecdd6(0x21e)){let {alias:_0x3cc5c3,message:_0x2a6475}=_0x1a8f41,_0x315321=await P(_0x3ecdd6(0x213),{'alias':_0x3cc5c3,'message':_0x2a6475,'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x3ecdd6(0x1e4)](_0x315321)}]};}if(_0x44f8a3===_0x3ecdd6(0x20a)){let _0x342a60=await P(_0x3ecdd6(0x1f8),{});return{'content':[{'type':_0x3ecdd6(0x1e1),'text':JSON[_0x3ecdd6(0x1e4)](_0x342a60)}]};}return{'content':[{'type':_0x3ecdd6(0x1e1),'text':JSON['stringify']({'error':_0x3ecdd6(0x203)})}]};});function a0_0x8f4f(){const _0xda532=['SSE\x20stream\x20ended,\x20reconnecting...','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','168ivuAsk','connected','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','task','set','SSE\x20connection\x20error:\x20','commhub_send_message','normal','/events/','pop','393846fAAFVz','ack_inbox','split','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','Priority\x20(default:\x20normal)','ENV:\x20URL=','setRequestHandler','status','data:\x20','2.0','.anet','getReader','MCP\x20stdio\x20connected','Bearer\x20','cancelled','end','alias','CommHub\x20init\x20failed:\x20','2151390toLsSE','SSE\x20error:\x20','\x20from\x20','trim','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','claude-code','application/json','3AeTgAc','string','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','exit','Message\x20content','SIGTERM','notification','object','tools/call','utf-8','5320476QAGKFZ','body','startsWith','content','working','114527eRnloJ','Reply\x20text\x20/\x20result\x20summary','\x20RESUME_ID=','delete','cwd','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','ready\x20—\x20waiting\x20for\x20events','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','indexOf','priority','config.json','connecting\x20to\x20','commhub-channel','SIGINT','Session\x20alias:\x20','message','send_reply','heartbeat\x20failed:\x20','error','completed','\x20priority=','inbox_count','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','.env','2759538qjRtUl','new_message','Progress\x200-100','stderr','replace','find','2025-03-26','session\x20disconnected','commhub_send_task','no\x20response','type','replied','text','tmux\x20display-message\x20-p\x20\x27#S\x27','Target\x20session\x20alias','stringify','commhub','commhub_reply','then','1640612NKUwhs','commhub_report_status','init\x20failed:\x20','get','low','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','result','0.3.0','\x20ALIAS=','report_status','←\x20message\x20from\x20','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','message_id','POST','http://127.0.0.1:9200','blocked','get_all_status','Task\x20content','SSE\x20connected\x20as\x20\x22','write','high','slice','application/json,\x20text/event-stream','broadcast','idle','shutting\x20down,\x20reporting\x20offline...','connect','unknown\x20tool','396914HPplyS','→\x20injected\x20task\x20','get_inbox','notifications/claude/channel','/mcp','params','commhub_get_all_status','initialize','failed','from_session','starting\x20SSE\x20listener...','Authorization','catch','hub','send_task','send_message','messages','parse'];a0_0x8f4f=function(){return _0xda532;};return a0_0x8f4f();}async function u(){const _0x4a588e=a0_0x89dc75;let _0x1d7ce5=f+_0x4a588e(0x220)+encodeURIComponent(Z),_0x46c71a={};if(X)_0x46c71a[_0x4a588e(0x20f)]=_0x4a588e(0x22f)+X;Y(_0x4a588e(0x255)+_0x1d7ce5);while(!0x0){try{let _0x38d572=await fetch(_0x1d7ce5,{'headers':_0x46c71a});if(!_0x38d572['ok']){Y(_0x4a588e(0x235)+_0x38d572[_0x4a588e(0x229)]+'\x20'+_0x38d572['statusText']),await h(0x1388);continue;}let _0xfd0c1a=_0x38d572[_0x4a588e(0x246)][_0x4a588e(0x22d)](),_0x472bf7=new TextDecoder(),_0x3c1dc3='';while(!0x0){let {done:_0x202610,value:_0x46e703}=await _0xfd0c1a['read']();if(_0x202610)break;_0x3c1dc3+=_0x472bf7['decode'](_0x46e703,{'stream':!0x0});let _0x1ced88=_0x3c1dc3[_0x4a588e(0x224)]('\x0a\x0a');_0x3c1dc3=_0x1ced88[_0x4a588e(0x221)]()||'';for(let _0x50adf2 of _0x1ced88){let _0x14aca0=_0x50adf2[_0x4a588e(0x224)]('\x0a')[_0x4a588e(0x1da)](_0xbd9635=>_0xbd9635['startsWith'](_0x4a588e(0x22a)));if(!_0x14aca0)continue;try{let _0x370ed9=JSON[_0x4a588e(0x215)](_0x14aca0[_0x4a588e(0x1fd)](0x6));await S(_0x370ed9);}catch(_0x2a5161){Y('parse\x20error:\x20'+_0x2a5161);}}}Y(_0x4a588e(0x216));}catch(_0xa7b7fd){Y(_0x4a588e(0x21d)+_0xa7b7fd);}await h(0xbb8);}}async function S(_0xc1cc3e){const _0xdf3ac3=a0_0x89dc75;if(_0xc1cc3e['type']===_0xdf3ac3(0x219)){Y(_0xdf3ac3(0x1fa)+Z+'\x22');return;}if(_0xc1cc3e['type']===_0xdf3ac3(0x263)){if(Y(_0xdf3ac3(0x1f2)+_0xc1cc3e['from']+':\x20'+_0xc1cc3e['message']['slice'](0x0,0x3c)),await K[_0xdf3ac3(0x241)]({'method':_0xdf3ac3(0x207),'params':{'content':_0xc1cc3e[_0xdf3ac3(0x259)],'meta':{'sender':_0xc1cc3e['from']||'hub','sender_id':'commhub','user':_0xc1cc3e['from']||'hub','priority':_0xdf3ac3(0x21f)}}}),_0xc1cc3e[_0xdf3ac3(0x1f4)])await P('ack_inbox',{'alias':Z,'message_id':_0xc1cc3e[_0xdf3ac3(0x1f4)]});return;}if(_0xc1cc3e[_0xdf3ac3(0x1df)]==='new_task'||_0xc1cc3e[_0xdf3ac3(0x1df)]===_0xdf3ac3(0x1ff)){Y('←\x20'+_0xc1cc3e['type']+':\x20inbox_count='+_0xc1cc3e[_0xdf3ac3(0x25f)]+_0xdf3ac3(0x25e)+(_0xc1cc3e[_0xdf3ac3(0x253)]||'normal'));let _0x54bedb=await P(_0xdf3ac3(0x206),{'alias':Z,'limit':0x5});if(_0x54bedb?.['ok']&&_0x54bedb[_0xdf3ac3(0x214)]?.['length']>0x0)for(let _0x2b7e47 of _0x54bedb[_0xdf3ac3(0x214)]){let _0x445c17={'sender':_0x2b7e47[_0xdf3ac3(0x20d)]||_0xdf3ac3(0x211),'sender_id':_0xdf3ac3(0x1e5),'user':_0x2b7e47[_0xdf3ac3(0x20d)]||_0xdf3ac3(0x211),'task_id':_0x2b7e47['id'],'priority':_0x2b7e47['priority']||_0xdf3ac3(0x21f)};k[_0xdf3ac3(0x21c)](_0x2b7e47['id'],_0x2b7e47['from_session']||_0xdf3ac3(0x211)),await K[_0xdf3ac3(0x241)]({'method':'notifications/claude/channel','params':{'content':_0x2b7e47['content'],'meta':_0x445c17}}),Y(_0xdf3ac3(0x205)+_0x2b7e47['id'][_0xdf3ac3(0x1fd)](0x0,0x8)+_0xdf3ac3(0x236)+_0x2b7e47[_0xdf3ac3(0x20d)]+':\x20'+_0x2b7e47['content'][_0xdf3ac3(0x1fd)](0x0,0x3c)),await P(_0xdf3ac3(0x223),{'alias':Z,'message_id':_0x2b7e47['id']});}}}async function A(){const _0x50fdef=a0_0x89dc75;let _0xe15f31=new a0_0x2dff84();await K[_0x50fdef(0x202)](_0xe15f31),Y(_0x50fdef(0x22e)),Y(_0x50fdef(0x20e)),u()[_0x50fdef(0x210)](_0x10b32e=>Y('SSE\x20fatal:\x20'+_0x10b32e)),P('report_status',{'resume_id':w,'alias':Z,'status':_0x50fdef(0x200),'server':a0_0x3ce3c4(),'hostname':a0_0x3ce3c4(),'agent':'claude-code','project_dir':process[_0x50fdef(0x24e)](),'tmux_name':j||void 0x0})[_0x50fdef(0x1e7)](()=>Y('registered\x20as\x20\x22'+Z+'\x22\x20('+w['slice'](0x0,0x8)+')'))[_0x50fdef(0x210)](_0x3de786=>Y('warning:\x20could\x20not\x20register:\x20'+_0x3de786)),setInterval(()=>{const _0x29b5d0=_0x50fdef;P(_0x29b5d0(0x1f1),{'resume_id':w,'alias':Z,'status':_0x29b5d0(0x200),'server':a0_0x3ce3c4(),'hostname':a0_0x3ce3c4(),'agent':_0x29b5d0(0x239),'project_dir':process[_0x29b5d0(0x24e)](),'tmux_name':j||void 0x0})[_0x29b5d0(0x210)](_0x53792a=>Y(_0x29b5d0(0x25b)+_0x53792a));},0x2bf20),Y(_0x50fdef(0x250));}A()[a0_0x89dc75(0x210)](_0x5b44df=>{const _0x483494=a0_0x89dc75;Y('fatal:\x20'+_0x5b44df),process[_0x483494(0x23e)](0x1);});async function N(){const _0x240363=a0_0x89dc75;Y(_0x240363(0x201)),await P(_0x240363(0x1f1),{'resume_id':w,'alias':Z,'status':'error','task':_0x240363(0x1dc)})[_0x240363(0x210)](()=>{}),process['exit'](0x0);}process['stdin']['on'](a0_0x89dc75(0x231),()=>N()),process['on'](a0_0x89dc75(0x240),()=>N()),process['on'](a0_0x89dc75(0x257),()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.1.7-preview.2",
3
+ "version": "2.1.8-preview.0",
4
4
  "description": "AI Agent Network CLI — Create multi-agent networks with user management, network isolation, and 3 AI runtimes (Claude/Codex/MiniMax). 39 commands.",
5
5
  "type": "module",
6
6
  "main": "dist/src/client.js",
@@ -55,7 +55,7 @@
55
55
  "bun": ">=1.2.0"
56
56
  },
57
57
  "dependencies": {
58
- "@inquirer/prompts": "^7.10.1"
58
+ "@inquirer/prompts": "^8.4.3"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@modelcontextprotocol/sdk": "^1.12.0",