@sleep2agi/agent-network 2.2.0 → 2.2.2-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_0x12deed=a0_0x2bb5;(function(_0x53c94e,_0x1d11c4){const _0x41ede7=a0_0x2bb5,_0x26e1dd=_0x53c94e();while(!![]){try{const _0x26b690=-parseInt(_0x41ede7(0xe5))/0x1+parseInt(_0x41ede7(0x114))/0x2+-parseInt(_0x41ede7(0xf7))/0x3*(-parseInt(_0x41ede7(0x109))/0x4)+-parseInt(_0x41ede7(0xc9))/0x5*(-parseInt(_0x41ede7(0x106))/0x6)+-parseInt(_0x41ede7(0xdf))/0x7*(parseInt(_0x41ede7(0xef))/0x8)+-parseInt(_0x41ede7(0xe0))/0x9*(-parseInt(_0x41ede7(0xc5))/0xa)+parseInt(_0x41ede7(0xd8))/0xb*(-parseInt(_0x41ede7(0xc7))/0xc);if(_0x26b690===_0x1d11c4)break;else _0x26e1dd['push'](_0x26e1dd['shift']());}catch(_0x2c421c){_0x26e1dd['push'](_0x26e1dd['shift']());}}}(a0_0xfa7b,0xdeca3));import{EventEmitter as a0_0x2aa4f6}from'events';function a0_0x2bb5(_0x592789,_0x16ed20){_0x592789=_0x592789-0xc4;const _0xfa7b89=a0_0xfa7b();let _0x2bb553=_0xfa7b89[_0x592789];return _0x2bb553;}import{hostname as a0_0x4f4a3e}from'os';function a0_0xfa7b(){const _0x2af9c3=['task','new_task','POST','abort','message','token','connect','910978jSlXcO','error','signal','tools/call','70NNnjSe','disconnect','12IDJnbh','/events/','10NPYPOa','match','SSE\x20reconnecting\x20in\x20','2.0','url','completed','alias','disconnected','now','heartbeatTimer','SSE\x20connected','text/event-stream','heartbeatInterval','body','reconnectDelay','26325277XDAhAW','get_all_status','send','s...','application/json,\x20text/event-stream','connected','offline','77zxXBZr','2106099AerlCx','new_message','heartbeat\x20failed:\x20','registered','connectSSE','92685nxDbjC','send_task','application/json','getAllStatus','idle','name','emit','broadcast','slice','toTimeString','322736RkHdSc','Authorization','from_session','sleep','running','sseAbort','type','agent','16257GNQGPk','parse','SSE\x20error:\x20','server','call','normal','send_message','result','Bearer\x20','processInbox','AbortError','log','autoConnect','catch','min','2530986BNhmCG','getReader','stringify','668uTpZFn','resumeId','status','sdk'];a0_0xfa7b=function(){return _0x2af9c3;};return a0_0xfa7b();}class T extends a0_0x2aa4f6{[a0_0x12deed(0xcd)];[a0_0x12deed(0xcf)];[a0_0x12deed(0x112)];[a0_0x12deed(0xf6)];[a0_0x12deed(0x10a)];[a0_0x12deed(0xd5)];[a0_0x12deed(0xd7)];[a0_0x12deed(0xd2)];[a0_0x12deed(0xf4)];['running']=!0x1;constructor(_0x2be3cf){const _0x505419=a0_0x12deed;super();if(this['url']=_0x2be3cf['url']['replace'](/\/$/,''),this[_0x505419(0xcf)]=_0x2be3cf[_0x505419(0xcf)],this[_0x505419(0x112)]=_0x2be3cf[_0x505419(0x112)],this[_0x505419(0xf6)]=_0x2be3cf['agent']||_0x505419(0x10c),this[_0x505419(0x10a)]='sdk-'+_0x2be3cf[_0x505419(0xcf)]+'-'+Date[_0x505419(0xd1)]()['toString'](0x24),this['heartbeatInterval']=_0x2be3cf['heartbeatInterval']??0x2bf20,this[_0x505419(0xd7)]=_0x2be3cf[_0x505419(0xd7)]??0xbb8,_0x2be3cf[_0x505419(0x103)]!==!0x1)this['connect']();}['log'](_0x2d941d){const _0x1c853a=a0_0x12deed;console[_0x1c853a(0x102)]('['+new Date()[_0x1c853a(0xee)]()[_0x1c853a(0xed)](0x0,0x8)+']\x20[commhub:'+this[_0x1c853a(0xcf)]+']\x20'+_0x2d941d);}async['call'](_0x19c970,_0x1b3948){const _0x27fbd8=a0_0x12deed;let _0x27e058={'Content-Type':_0x27fbd8(0xe7),'Accept':_0x27fbd8(0xdc)};if(this[_0x27fbd8(0x112)])_0x27e058[_0x27fbd8(0xf0)]=_0x27fbd8(0xff)+this[_0x27fbd8(0x112)];let _0x17e091=await(await fetch(this[_0x27fbd8(0xcd)]+'/mcp',{'method':_0x27fbd8(0x10f),'headers':_0x27e058,'body':JSON[_0x27fbd8(0x108)]({'jsonrpc':_0x27fbd8(0xcc),'id':Date[_0x27fbd8(0xd1)](),'method':_0x27fbd8(0xc4),'params':{'name':_0x19c970,'arguments':_0x1b3948}})}))['text'](),_0x3d9f0e=_0x17e091[_0x27fbd8(0xca)](/data: (.+)/),_0x11979f=_0x3d9f0e?JSON['parse'](_0x3d9f0e[0x1]):JSON[_0x27fbd8(0xf8)](_0x17e091),_0x4d775f=_0x11979f?.[_0x27fbd8(0xfe)]?.['content']?.[0x0]?.['text'];return _0x4d775f?JSON[_0x27fbd8(0xf8)](_0x4d775f):_0x11979f;}async[a0_0x12deed(0x113)](){const _0x58356a=a0_0x12deed;if(this['running'])return;this[_0x58356a(0xf3)]=!0x0,await this[_0x58356a(0x10b)]('idle'),this['log'](_0x58356a(0xe3)),this[_0x58356a(0xd2)]=setInterval(()=>{const _0x1d53c5=_0x58356a;this[_0x1d53c5(0x10b)](_0x1d53c5(0xe9))['catch'](_0x3dc340=>this[_0x1d53c5(0x102)](_0x1d53c5(0xe2)+_0x3dc340[_0x1d53c5(0x111)]));},this[_0x58356a(0xd5)]),this[_0x58356a(0xe4)]();}async[a0_0x12deed(0xc6)](){const _0x2d056e=a0_0x12deed;if(this[_0x2d056e(0xf3)]=!0x1,this['sseAbort']?.[_0x2d056e(0x110)](),this['heartbeatTimer'])clearInterval(this[_0x2d056e(0xd2)]);await this[_0x2d056e(0x10b)](_0x2d056e(0xde))[_0x2d056e(0x104)](()=>{}),this[_0x2d056e(0x102)](_0x2d056e(0xd0));}async[a0_0x12deed(0xda)](_0x327653,_0x52ace7,_0x4da68e=a0_0x12deed(0xfc)){const _0x4dcace=a0_0x12deed;return this[_0x4dcace(0xfb)](_0x4dcace(0xe6),{'alias':_0x327653,'task':_0x52ace7,'priority':_0x4da68e,'from_session':this[_0x4dcace(0xcf)]});}async[a0_0x12deed(0x111)](_0x51dece,_0x27aa90){const _0x1521c7=a0_0x12deed;return this[_0x1521c7(0xfb)](_0x1521c7(0xfd),{'alias':_0x51dece,'message':_0x27aa90,'from_session':this['alias']});}async['reply'](_0xe41ad7,_0x43cfec,_0x56e6ce=a0_0x12deed(0xce)){const _0x27e528=a0_0x12deed;return this[_0x27e528(0xfb)]('send_reply',{'in_reply_to':_0xe41ad7,'text':_0x43cfec,'status':_0x56e6ce});}async['status'](_0x1edb1e,_0x2870da){const _0x190862=a0_0x12deed;return this[_0x190862(0xfb)]('report_status',{'resume_id':this[_0x190862(0x10a)],'alias':this[_0x190862(0xcf)],'status':_0x1edb1e,'server':a0_0x4f4a3e(),'hostname':a0_0x4f4a3e(),'agent':this[_0x190862(0xf6)],'project_dir':process['cwd'](),..._0x2870da});}async[a0_0x12deed(0xe8)](){const _0x14e469=a0_0x12deed;return this[_0x14e469(0xfb)](_0x14e469(0xd9),{});}async[a0_0x12deed(0xec)](_0x4743f6,_0x9d2f6f){const _0x467805=a0_0x12deed;return this[_0x467805(0xfb)](_0x467805(0xec),{'message':_0x4743f6,'filter_server':_0x9d2f6f?.[_0x467805(0xfa)],'filter_status':_0x9d2f6f?.[_0x467805(0x10b)]});}async[a0_0x12deed(0xe4)](){const _0x37ec04=a0_0x12deed;let _0xb40d7b=encodeURIComponent(this['alias']),_0x103f8b=this['url']+_0x37ec04(0xc8)+_0xb40d7b,_0x4540ec=this[_0x37ec04(0xd7)];while(this[_0x37ec04(0xf3)]){try{this[_0x37ec04(0xf4)]=new AbortController();let _0x49abfa={'Accept':_0x37ec04(0xd4)};if(this[_0x37ec04(0x112)])_0x49abfa[_0x37ec04(0xf0)]='Bearer\x20'+this[_0x37ec04(0x112)];let _0x56f5f7=await fetch(_0x103f8b,{'headers':_0x49abfa,'signal':this[_0x37ec04(0xf4)][_0x37ec04(0x116)]});if(!_0x56f5f7['ok']||!_0x56f5f7[_0x37ec04(0xd6)]){this['log']('SSE\x20failed:\x20'+_0x56f5f7['status']),await this[_0x37ec04(0xf2)](_0x4540ec),_0x4540ec=Math[_0x37ec04(0x105)](_0x4540ec*1.5,0xea60);continue;}_0x4540ec=this[_0x37ec04(0xd7)];let _0xc6acc6=_0x56f5f7['body'][_0x37ec04(0x107)](),_0x4fc84d=new TextDecoder(),_0x561998='';while(this[_0x37ec04(0xf3)]){let {done:_0x26cf99,value:_0x1acc10}=await _0xc6acc6['read']();if(_0x26cf99)break;_0x561998+=_0x4fc84d['decode'](_0x1acc10,{'stream':!0x0});let _0x4fb816=_0x561998['split']('\x0a');_0x561998=_0x4fb816['pop']()||'';for(let _0xaf9dc2 of _0x4fb816){if(!_0xaf9dc2['startsWith']('data:\x20'))continue;try{let _0x380188=JSON[_0x37ec04(0xf8)](_0xaf9dc2[_0x37ec04(0xed)](0x6));if(_0x380188['type']==='connected'){this['log'](_0x37ec04(0xd3)),this[_0x37ec04(0xeb)](_0x37ec04(0xdd));continue;}if(_0x380188[_0x37ec04(0xf5)]===_0x37ec04(0x10e)||_0x380188[_0x37ec04(0xf5)]===_0x37ec04(0xe1)||_0x380188[_0x37ec04(0xf5)]===_0x37ec04(0xec))await this[_0x37ec04(0x100)]();}catch{}}}}catch(_0x28c3f8){if(_0x28c3f8[_0x37ec04(0xea)]===_0x37ec04(0x101))break;this[_0x37ec04(0xeb)](_0x37ec04(0x115),_0x28c3f8),this['log'](_0x37ec04(0xf9)+_0x28c3f8[_0x37ec04(0x111)]);}if(this[_0x37ec04(0xf3)])this[_0x37ec04(0xeb)](_0x37ec04(0xd0)),this[_0x37ec04(0x102)](_0x37ec04(0xcb)+_0x4540ec/0x3e8+_0x37ec04(0xdb)),await this[_0x37ec04(0xf2)](_0x4540ec),_0x4540ec=Math[_0x37ec04(0x105)](_0x4540ec*1.5,0xea60);}}async[a0_0x12deed(0x100)](){const _0x84777d=a0_0x12deed;try{let _0x190d94=(await this[_0x84777d(0xfb)]('get_inbox',{'alias':this[_0x84777d(0xcf)],'limit':0xa}))?.['messages']||[];for(let _0x5b10f5 of _0x190d94)await this['call']('ack_inbox',{'alias':this[_0x84777d(0xcf)],'message_id':_0x5b10f5['id']}),this['log']('←\x20'+_0x5b10f5[_0x84777d(0xf1)]+':\x20'+_0x5b10f5['content'][_0x84777d(0xed)](0x0,0x3c)),this['emit'](_0x84777d(0x10d),_0x5b10f5),this[_0x84777d(0xeb)](_0x84777d(0x111),_0x5b10f5);}catch(_0x5ad896){this[_0x84777d(0x102)]('inbox\x20error:\x20'+_0x5ad896[_0x84777d(0x111)]);}}[a0_0x12deed(0xf2)](_0x128d44){return new Promise(_0x32bd93=>setTimeout(_0x32bd93,_0x128d44));}}var $=T;export{$ as default,T as CommHub};
1
+ const a0_0x3e5e98=a0_0x5acc;function a0_0x5acc(_0x5d1f43,_0x22e063){_0x5d1f43=_0x5d1f43-0x1b0;const _0x117f34=a0_0x117f();let _0x5acc5f=_0x117f34[_0x5d1f43];return _0x5acc5f;}(function(_0x20d2e7,_0x5f3c79){const _0x35e6b3=a0_0x5acc,_0x288977=_0x20d2e7();while(!![]){try{const _0x52b575=parseInt(_0x35e6b3(0x1bb))/0x1*(parseInt(_0x35e6b3(0x1f3))/0x2)+parseInt(_0x35e6b3(0x1d4))/0x3*(parseInt(_0x35e6b3(0x1c4))/0x4)+parseInt(_0x35e6b3(0x1b4))/0x5+-parseInt(_0x35e6b3(0x205))/0x6*(-parseInt(_0x35e6b3(0x1e6))/0x7)+-parseInt(_0x35e6b3(0x1bd))/0x8+-parseInt(_0x35e6b3(0x1cc))/0x9+-parseInt(_0x35e6b3(0x1bc))/0xa*(parseInt(_0x35e6b3(0x1fa))/0xb);if(_0x52b575===_0x5f3c79)break;else _0x288977['push'](_0x288977['shift']());}catch(_0x414d43){_0x288977['push'](_0x288977['shift']());}}}(a0_0x117f,0xebce5));import{EventEmitter as a0_0x35faba}from'events';import{hostname as a0_0x513164}from'os';class T extends a0_0x35faba{['url'];[a0_0x3e5e98(0x1fd)];[a0_0x3e5e98(0x1c3)];[a0_0x3e5e98(0x201)];[a0_0x3e5e98(0x1f1)];['heartbeatInterval'];[a0_0x3e5e98(0x1d8)];['heartbeatTimer'];[a0_0x3e5e98(0x203)];[a0_0x3e5e98(0x1b9)]=!0x1;constructor(_0x5f1061){const _0x517c34=a0_0x3e5e98;super();if(this[_0x517c34(0x208)]=_0x5f1061[_0x517c34(0x208)][_0x517c34(0x1ce)](/\/$/,''),this[_0x517c34(0x1fd)]=_0x5f1061[_0x517c34(0x1fd)],this[_0x517c34(0x1c3)]=_0x5f1061[_0x517c34(0x1c3)],this['agent']=_0x5f1061[_0x517c34(0x201)]||'sdk',this['resumeId']=_0x517c34(0x1fc)+_0x5f1061[_0x517c34(0x1fd)]+'-'+Date['now']()[_0x517c34(0x1c9)](0x24),this[_0x517c34(0x1e3)]=_0x5f1061[_0x517c34(0x1e3)]??0x2bf20,this['reconnectDelay']=_0x5f1061[_0x517c34(0x1d8)]??0xbb8,_0x5f1061[_0x517c34(0x1c0)]!==!0x1)this[_0x517c34(0x1b8)]();}['log'](_0x42c0f9){const _0x1995b7=a0_0x3e5e98;console[_0x1995b7(0x206)]('['+new Date()[_0x1995b7(0x1f4)]()[_0x1995b7(0x1f5)](0x0,0x8)+_0x1995b7(0x207)+this['alias']+']\x20'+_0x42c0f9);}async['call'](_0x48840a,_0x1c2035){const _0x3a6727=a0_0x3e5e98;let _0x41e975={'Content-Type':_0x3a6727(0x1b0),'Accept':_0x3a6727(0x1b5)};if(this['token'])_0x41e975[_0x3a6727(0x1e4)]=_0x3a6727(0x1eb)+this['token'];let _0x49fa8e=await(await fetch(this['url']+_0x3a6727(0x1f9),{'method':_0x3a6727(0x202),'headers':_0x41e975,'body':JSON['stringify']({'jsonrpc':_0x3a6727(0x200),'id':Date[_0x3a6727(0x1b2)](),'method':_0x3a6727(0x1ec),'params':{'name':_0x48840a,'arguments':_0x1c2035}})}))[_0x3a6727(0x1fb)](),_0x23e2fd=_0x49fa8e[_0x3a6727(0x1f7)](/data: (.+)/),_0x2cfacc=_0x23e2fd?JSON[_0x3a6727(0x1bf)](_0x23e2fd[0x1]):JSON['parse'](_0x49fa8e),_0x58331b=_0x2cfacc?.['result']?.[_0x3a6727(0x1cd)]?.[0x0]?.[_0x3a6727(0x1fb)];return _0x58331b?JSON[_0x3a6727(0x1bf)](_0x58331b):_0x2cfacc;}async[a0_0x3e5e98(0x1b8)](){const _0x42b9ec=a0_0x3e5e98;if(this['running'])return;this[_0x42b9ec(0x1b9)]=!0x0,await this[_0x42b9ec(0x1e5)](_0x42b9ec(0x1df)),this[_0x42b9ec(0x206)](_0x42b9ec(0x209)),this[_0x42b9ec(0x1f6)]=setInterval(()=>{const _0x728a4c=_0x42b9ec;this[_0x728a4c(0x1e5)](_0x728a4c(0x1df))[_0x728a4c(0x1e9)](_0x53c721=>this[_0x728a4c(0x206)](_0x728a4c(0x1c5)+_0x53c721[_0x728a4c(0x1d1)]));},this['heartbeatInterval']),this[_0x42b9ec(0x1f8)]();}async[a0_0x3e5e98(0x1d3)](){const _0x38ce05=a0_0x3e5e98;if(this[_0x38ce05(0x1b9)]=!0x1,this[_0x38ce05(0x203)]?.[_0x38ce05(0x1ef)](),this[_0x38ce05(0x1f6)])clearInterval(this[_0x38ce05(0x1f6)]);await this[_0x38ce05(0x1e5)](_0x38ce05(0x1cf))[_0x38ce05(0x1e9)](()=>{}),this[_0x38ce05(0x206)](_0x38ce05(0x1d5));}async['send'](_0x159e81,_0x388547,_0x534b72=a0_0x3e5e98(0x1d6)){const _0x26b360=a0_0x3e5e98;return this[_0x26b360(0x1e1)]('send_task',{'alias':_0x159e81,'task':_0x388547,'priority':_0x534b72,'from_session':this[_0x26b360(0x1fd)]});}async['message'](_0x165dad,_0x542cf7){const _0x586efe=a0_0x3e5e98;return this[_0x586efe(0x1e1)](_0x586efe(0x204),{'alias':_0x165dad,'message':_0x542cf7,'from_session':this[_0x586efe(0x1fd)]});}async[a0_0x3e5e98(0x1b1)](_0x3dc9b1,_0x37462e,_0xc7831='completed'){const _0xe22f8d=a0_0x3e5e98;return this[_0xe22f8d(0x1e1)](_0xe22f8d(0x1c6),{'in_reply_to':_0x3dc9b1,'text':_0x37462e,'status':_0xc7831});}async[a0_0x3e5e98(0x1e5)](_0x1477a0,_0xc8c67f){const _0x599463=a0_0x3e5e98;return this[_0x599463(0x1e1)](_0x599463(0x1dc),{'resume_id':this[_0x599463(0x1f1)],'alias':this[_0x599463(0x1fd)],'status':_0x1477a0,'server':a0_0x513164(),'hostname':a0_0x513164(),'agent':this[_0x599463(0x201)],'project_dir':process[_0x599463(0x1c1)](),..._0xc8c67f});}async[a0_0x3e5e98(0x1ea)](){const _0x319be4=a0_0x3e5e98;return this[_0x319be4(0x1e1)]('get_all_status',{});}async[a0_0x3e5e98(0x1be)](_0x8fdef2,_0x55a9bc){const _0x426bb3=a0_0x3e5e98;return this[_0x426bb3(0x1e1)](_0x426bb3(0x1be),{'message':_0x8fdef2,'filter_server':_0x55a9bc?.[_0x426bb3(0x1ee)],'filter_status':_0x55a9bc?.['status']});}async[a0_0x3e5e98(0x1f8)](){const _0x19d74b=a0_0x3e5e98;let _0x40b178=encodeURIComponent(this[_0x19d74b(0x1fd)]),_0x325248=this['url']+_0x19d74b(0x1d0)+_0x40b178,_0x4bac5a=this['reconnectDelay'];while(this[_0x19d74b(0x1b9)]){try{this[_0x19d74b(0x203)]=new AbortController();let _0x4ed062={'Accept':_0x19d74b(0x1dd)};if(this[_0x19d74b(0x1c3)])_0x4ed062[_0x19d74b(0x1e4)]='Bearer\x20'+this[_0x19d74b(0x1c3)];let _0x2c66ac=await fetch(_0x325248,{'headers':_0x4ed062,'signal':this['sseAbort'][_0x19d74b(0x1b7)]});if(!_0x2c66ac['ok']||!_0x2c66ac[_0x19d74b(0x1b3)]){this[_0x19d74b(0x206)](_0x19d74b(0x1e7)+_0x2c66ac[_0x19d74b(0x1e5)]),await this[_0x19d74b(0x1b6)](_0x4bac5a),_0x4bac5a=Math[_0x19d74b(0x1c2)](_0x4bac5a*1.5,0xea60);continue;}_0x4bac5a=this[_0x19d74b(0x1d8)];let _0x8fcc4=_0x2c66ac['body']['getReader'](),_0x46f974=new TextDecoder(),_0x1d69fa='';while(this[_0x19d74b(0x1b9)]){let {done:_0x3949aa,value:_0x5da831}=await _0x8fcc4['read']();if(_0x3949aa)break;_0x1d69fa+=_0x46f974[_0x19d74b(0x1ff)](_0x5da831,{'stream':!0x0});let _0x231f5a=_0x1d69fa[_0x19d74b(0x1ba)]('\x0a');_0x1d69fa=_0x231f5a[_0x19d74b(0x1cb)]()||'';for(let _0xea4c03 of _0x231f5a){if(!_0xea4c03[_0x19d74b(0x1ca)](_0x19d74b(0x1e8)))continue;try{let _0x2c2963=JSON[_0x19d74b(0x1bf)](_0xea4c03[_0x19d74b(0x1f5)](0x6));if(_0x2c2963[_0x19d74b(0x1f0)]===_0x19d74b(0x1d2)){this[_0x19d74b(0x206)]('SSE\x20connected'),this[_0x19d74b(0x1de)](_0x19d74b(0x1d2));continue;}if(_0x2c2963[_0x19d74b(0x1f0)]===_0x19d74b(0x1e2)||_0x2c2963[_0x19d74b(0x1f0)]===_0x19d74b(0x1c7)||_0x2c2963[_0x19d74b(0x1f0)]===_0x19d74b(0x1be))await this[_0x19d74b(0x1da)]();}catch{}}}}catch(_0x3a2894){if(_0x3a2894[_0x19d74b(0x1d9)]===_0x19d74b(0x1e0))break;this['emit'](_0x19d74b(0x1ed),_0x3a2894),this[_0x19d74b(0x206)](_0x19d74b(0x1c8)+_0x3a2894[_0x19d74b(0x1d1)]);}if(this['running'])this['emit'](_0x19d74b(0x1d5)),this[_0x19d74b(0x206)]('SSE\x20reconnecting\x20in\x20'+_0x4bac5a/0x3e8+'s...'),await this[_0x19d74b(0x1b6)](_0x4bac5a),_0x4bac5a=Math[_0x19d74b(0x1c2)](_0x4bac5a*1.5,0xea60);}}async[a0_0x3e5e98(0x1da)](){const _0x1aee87=a0_0x3e5e98;try{let _0x35d6a6=(await this[_0x1aee87(0x1e1)](_0x1aee87(0x1fe),{'alias':this[_0x1aee87(0x1fd)],'limit':0xa}))?.[_0x1aee87(0x1db)]||[];for(let _0x5a0c69 of _0x35d6a6)await this[_0x1aee87(0x1e1)](_0x1aee87(0x1f2),{'alias':this[_0x1aee87(0x1fd)],'message_id':_0x5a0c69['id']}),this['log']('←\x20'+_0x5a0c69['from_session']+':\x20'+_0x5a0c69[_0x1aee87(0x1cd)]['slice'](0x0,0x3c)),this[_0x1aee87(0x1de)](_0x1aee87(0x1d7),_0x5a0c69),this[_0x1aee87(0x1de)](_0x1aee87(0x1d1),_0x5a0c69);}catch(_0x435859){this[_0x1aee87(0x206)]('inbox\x20error:\x20'+_0x435859[_0x1aee87(0x1d1)]);}}[a0_0x3e5e98(0x1b6)](_0x4ee17e){return new Promise(_0xfe0263=>setTimeout(_0xfe0263,_0x4ee17e));}}var $=T;function a0_0x117f(){const _0xae2947=['message','connected','disconnect','12846lgJYPu','disconnected','normal','task','reconnectDelay','name','processInbox','messages','report_status','text/event-stream','emit','idle','AbortError','call','new_task','heartbeatInterval','Authorization','status','7396459coExoE','SSE\x20failed:\x20','data:\x20','catch','getAllStatus','Bearer\x20','tools/call','error','server','abort','type','resumeId','ack_inbox','4YUUETw','toTimeString','slice','heartbeatTimer','match','connectSSE','/mcp','1983652hdTYft','text','sdk-','alias','get_inbox','decode','2.0','agent','POST','sseAbort','send_message','6dIEYcP','log',']\x20[commhub:','url','registered','application/json','reply','now','body','4748170OPIAUV','application/json,\x20text/event-stream','sleep','signal','connect','running','split','485519lxaVSd','20vtlSMo','9358864NmtcNI','broadcast','parse','autoConnect','cwd','min','token','188TkZCYE','heartbeat\x20failed:\x20','send_reply','new_message','SSE\x20error:\x20','toString','startsWith','pop','6139620vkljBF','content','replace','offline','/events/'];a0_0x117f=function(){return _0xae2947;};return a0_0x117f();}export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x5426cb=a0_0x5867;(function(_0x3eac44,_0x31c121){const _0xb1c39b=a0_0x5867,_0x46a402=_0x3eac44();while(!![]){try{const _0x5b17a0=parseInt(_0xb1c39b(0x269))/0x1+parseInt(_0xb1c39b(0x256))/0x2*(parseInt(_0xb1c39b(0x1fa))/0x3)+-parseInt(_0xb1c39b(0x267))/0x4*(-parseInt(_0xb1c39b(0x1f0))/0x5)+-parseInt(_0xb1c39b(0x225))/0x6+parseInt(_0xb1c39b(0x25f))/0x7+-parseInt(_0xb1c39b(0x1e1))/0x8+-parseInt(_0xb1c39b(0x1e4))/0x9;if(_0x5b17a0===_0x31c121)break;else _0x46a402['push'](_0x46a402['shift']());}catch(_0x258a07){_0x46a402['push'](_0x46a402['shift']());}}}(a0_0x1b33,0xc4dcd));import{readFileSync as a0_0x5e1a22,existsSync as a0_0x27dc4c}from'fs';import{randomUUID as a0_0x68ff34}from'crypto';import{join as a0_0x1d5732}from'path';import{hostname as a0_0x171ac2}from'os';import{execSync as a0_0x25654c}from'child_process';import{Server as a0_0x2a2aae}from'@modelcontextprotocol/sdk/server/index.js';function a0_0x5867(_0x38233f,_0xf45c0f){_0x38233f=_0x38233f-0x1df;const _0x1b3313=a0_0x1b33();let _0x586773=_0x1b3313[_0x38233f];return _0x586773;}import{StdioServerTransport as a0_0x58ce57}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x281aee,CallToolRequestSchema as a0_0x3401cc}from'@modelcontextprotocol/sdk/types.js';function p(_0x27de4d){const _0x515a16=a0_0x5867;if(!a0_0x27dc4c(_0x27de4d))return;for(let _0x250081 of a0_0x5e1a22(_0x27de4d,_0x515a16(0x217))[_0x515a16(0x1e6)]('\x0a')){let _0x2ef262=_0x250081[_0x515a16(0x209)]();if(!_0x2ef262||_0x2ef262[_0x515a16(0x255)]('#'))continue;let _0xcbf6f1=_0x2ef262[_0x515a16(0x1e2)]('=');if(_0xcbf6f1<0x0)continue;let _0x944f17=_0x2ef262['slice'](0x0,_0xcbf6f1)[_0x515a16(0x209)](),_0x5d5869=_0x2ef262[_0x515a16(0x25b)](_0xcbf6f1+0x1)[_0x515a16(0x209)]()['replace'](/^["']|["']$/g,'');if(!process.env[_0x944f17])process.env[_0x944f17]=_0x5d5869;}}var C=process.env.HOME||'~',T=a0_0x1d5732(C,a0_0x5426cb(0x235));p(a0_0x1d5732(T,a0_0x5426cb(0x24b)));var L=process['cwd']()[a0_0x5426cb(0x22d)](/\//g,'-');p(a0_0x1d5732(T,L,a0_0x5426cb(0x24b)));function U(){const _0xa1f99=a0_0x5426cb;try{return a0_0x25654c(_0xa1f99(0x238),{'encoding':_0xa1f99(0x217),'timeout':0x7d0})['trim']();}catch{return'';}}function v(){const _0x2b3543=a0_0x5426cb;try{let _0x5163e3=a0_0x1d5732(C,_0x2b3543(0x254),'config.json');if(a0_0x27dc4c(_0x5163e3))return JSON[_0x2b3543(0x226)](a0_0x5e1a22(_0x5163e3,'utf-8'));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x5426cb(0x1ec)]||a0_0x5426cb(0x23a),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x171ac2(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x68ff34(),X=process.env.COMMHUB_TOKEN||H['token']||'';function Y(_0x32cc8f){const _0x351ca4=a0_0x5426cb;let _0x2c5313=new Date()['toTimeString']()[_0x351ca4(0x25b)](0x0,0x8);process[_0x351ca4(0x26a)]['write']('['+_0x2c5313+_0x351ca4(0x1f4)+_0x32cc8f+'\x0a');}function h(_0x4ec703){return new Promise(_0x2795e1=>setTimeout(_0x2795e1,_0x4ec703));}Y('ENV:\x20URL='+f+a0_0x5426cb(0x218)+Z+'\x20RESUME_ID='+w['slice'](0x0,0x8)+a0_0x5426cb(0x253)+(j||a0_0x5426cb(0x216))+a0_0x5426cb(0x206)+process[a0_0x5426cb(0x22b)]()+a0_0x5426cb(0x1ee)+L);var k=new Map(),K=new a0_0x2a2aae({'name':a0_0x5426cb(0x1eb),'version':a0_0x5426cb(0x1ef)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x5426cb(0x265),a0_0x5426cb(0x20c),a0_0x5426cb(0x250),a0_0x5426cb(0x24e),a0_0x5426cb(0x259)+Z][a0_0x5426cb(0x234)]('\x0a')});K[a0_0x5426cb(0x241)](a0_0x281aee,async()=>({'tools':[{'name':a0_0x5426cb(0x1f8),'description':'Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','inputSchema':{'type':a0_0x5426cb(0x21f),'properties':{'task_id':{'type':a0_0x5426cb(0x1f2),'description':a0_0x5426cb(0x203)},'text':{'type':a0_0x5426cb(0x1f2),'description':a0_0x5426cb(0x213)},'status':{'type':'string','enum':[a0_0x5426cb(0x236),a0_0x5426cb(0x20e),'cancelled',a0_0x5426cb(0x262),a0_0x5426cb(0x23e),a0_0x5426cb(0x230)],'description':a0_0x5426cb(0x242)}},'required':[a0_0x5426cb(0x261)]}},{'name':a0_0x5426cb(0x1e5),'description':a0_0x5426cb(0x20f),'inputSchema':{'type':'object','properties':{'status':{'type':'string','enum':[a0_0x5426cb(0x221),'idle','blocked',a0_0x5426cb(0x23e)]},'task':{'type':a0_0x5426cb(0x1f2),'description':'Current\x20task\x20description'},'progress':{'type':'number','description':a0_0x5426cb(0x219)}},'required':['status']}},{'name':a0_0x5426cb(0x266),'description':a0_0x5426cb(0x1e3),'inputSchema':{'type':a0_0x5426cb(0x21f),'properties':{'alias':{'type':'string','description':a0_0x5426cb(0x268)},'task':{'type':'string','description':a0_0x5426cb(0x248)},'priority':{'type':a0_0x5426cb(0x1f2),'enum':['high',a0_0x5426cb(0x243),a0_0x5426cb(0x21a)],'description':'Priority\x20(default:\x20normal)'}},'required':[a0_0x5426cb(0x21c),'task']}},{'name':a0_0x5426cb(0x23b),'description':a0_0x5426cb(0x252),'inputSchema':{'type':'object','properties':{'alias':{'type':'string','description':a0_0x5426cb(0x268)},'message':{'type':'string','description':a0_0x5426cb(0x237)}},'required':['alias',a0_0x5426cb(0x223)]}},{'name':a0_0x5426cb(0x247),'description':a0_0x5426cb(0x21e),'inputSchema':{'type':a0_0x5426cb(0x21f),'properties':{}}}]}));async function P(_0x387f7b,_0x148d9e){const _0x41b9cc=a0_0x5426cb;let _0x35de6c=await fetch(f+_0x41b9cc(0x23f),{'method':'POST','headers':{'Content-Type':_0x41b9cc(0x1f1),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON[_0x41b9cc(0x22e)]({'jsonrpc':_0x41b9cc(0x263),'id':0x1,'method':_0x41b9cc(0x25d),'params':{'protocolVersion':_0x41b9cc(0x200),'capabilities':{},'clientInfo':{'name':_0x41b9cc(0x1eb),'version':'0.3.0'}}})});if(!_0x35de6c['ok']){let _0x2de668=await _0x35de6c['text']();return Y(_0x41b9cc(0x212)+_0x35de6c[_0x41b9cc(0x24a)]+'\x20'+_0x2de668[_0x41b9cc(0x25b)](0x0,0x64)),{'ok':!0x1,'error':_0x41b9cc(0x20b)+_0x35de6c[_0x41b9cc(0x24a)]};}await _0x35de6c[_0x41b9cc(0x261)]();let _0x126755=(await(await fetch(f+_0x41b9cc(0x23f),{'method':_0x41b9cc(0x1f7),'headers':{'Content-Type':_0x41b9cc(0x1f1),'Accept':_0x41b9cc(0x1fc),...X?{'Authorization':_0x41b9cc(0x214)+X}:{}},'body':JSON[_0x41b9cc(0x22e)]({'jsonrpc':_0x41b9cc(0x263),'id':0x2,'method':_0x41b9cc(0x1fd),'params':{'name':_0x387f7b,'arguments':_0x148d9e}})}))[_0x41b9cc(0x261)]())[_0x41b9cc(0x1e6)]('\x0a')[_0x41b9cc(0x1fb)](_0x5f6192=>_0x5f6192['startsWith'](_0x41b9cc(0x264)));if(_0x126755){let _0x438036=JSON[_0x41b9cc(0x226)](_0x126755[_0x41b9cc(0x25b)](0x6));return _0x438036?.[_0x41b9cc(0x1ed)]?.[_0x41b9cc(0x231)]?.[0x0]?.[_0x41b9cc(0x261)]?JSON[_0x41b9cc(0x226)](_0x438036[_0x41b9cc(0x1ed)]['content'][0x0]['text']):_0x438036;}return{'ok':!0x1,'error':_0x41b9cc(0x1e9)};}K[a0_0x5426cb(0x241)](a0_0x3401cc,async _0x237f87=>{const _0x78f058=a0_0x5426cb;let {name:_0x4b2118,arguments:_0x1855ba}=_0x237f87[_0x78f058(0x202)];if(_0x4b2118===_0x78f058(0x1f8)){let {task_id:_0x1e08c5,text:_0x591cfa,status:_0x229e09}=_0x1855ba;if(_0x229e09===_0x78f058(0x236)||_0x229e09==='failed'||_0x229e09===_0x78f058(0x1ff)){let _0x8d6d58=_0x229e09===_0x78f058(0x236)?_0x78f058(0x24d):_0x229e09,_0xbbc2d9=_0x1e08c5?k[_0x78f058(0x21d)](_0x1e08c5)||_0x78f058(0x1ec):_0x78f058(0x1ec),_0x430f41=await P(_0x78f058(0x246),{'alias':_0xbbc2d9,'text':_0x591cfa,'in_reply_to':_0x1e08c5||void 0x0,'status':_0x8d6d58,'from_session':Z});if(_0x1e08c5)k[_0x78f058(0x204)](_0x1e08c5);return{'content':[{'type':_0x78f058(0x261),'text':JSON[_0x78f058(0x22e)](_0x430f41)}]};}let _0xe92c87=await P(_0x78f058(0x22a),{'resume_id':w,'alias':Z,'status':_0x229e09==='blocked'?'blocked':_0x229e09==='error'?'error':_0x78f058(0x221),'task':_0x591cfa[_0x78f058(0x25b)](0x0,0xc8),'output':_0x591cfa});return{'content':[{'type':_0x78f058(0x261),'text':JSON[_0x78f058(0x22e)](_0xe92c87)}]};}if(_0x4b2118==='commhub_report_status'){let {status:_0xe04031,task:_0xacbf8d,progress:_0xc4a56a}=_0x1855ba,_0x15eab7=await P(_0x78f058(0x22a),{'resume_id':w,'alias':Z,'status':_0xe04031,'task':_0xacbf8d,'progress':_0xc4a56a});return{'content':[{'type':_0x78f058(0x261),'text':JSON[_0x78f058(0x22e)](_0x15eab7)}]};}if(_0x4b2118==='commhub_send_task'){let {alias:_0x18a8a4,task:_0x411016,priority:_0x3b006b}=_0x1855ba,_0x5b1c6f=await P(_0x78f058(0x25a),{'alias':_0x18a8a4,'task':_0x411016,'priority':_0x3b006b||'normal','from_session':Z});return{'content':[{'type':_0x78f058(0x261),'text':JSON[_0x78f058(0x22e)](_0x5b1c6f)}]};}if(_0x4b2118===_0x78f058(0x23b)){let {alias:_0x34256a,message:_0xe512f2}=_0x1855ba,_0x26b67b=await P(_0x78f058(0x25e),{'alias':_0x34256a,'message':_0xe512f2,'from_session':Z});return{'content':[{'type':_0x78f058(0x261),'text':JSON[_0x78f058(0x22e)](_0x26b67b)}]};}if(_0x4b2118===_0x78f058(0x247)){let _0x1ace3f=await P(_0x78f058(0x1fe),{});return{'content':[{'type':_0x78f058(0x261),'text':JSON[_0x78f058(0x22e)](_0x1ace3f)}]};}return{'content':[{'type':_0x78f058(0x261),'text':JSON[_0x78f058(0x22e)]({'error':_0x78f058(0x244)})}]};});async function u(){const _0x2b82df=a0_0x5426cb;let _0x4c6bc5=f+_0x2b82df(0x23d)+encodeURIComponent(Z),_0x5c9fb0={};if(X)_0x5c9fb0[_0x2b82df(0x25c)]=_0x2b82df(0x214)+X;Y(_0x2b82df(0x20d)+_0x4c6bc5);while(!0x0){try{let _0x17eb52=await fetch(_0x4c6bc5,{'headers':_0x5c9fb0});if(!_0x17eb52['ok']){Y(_0x2b82df(0x1f6)+_0x17eb52[_0x2b82df(0x24a)]+'\x20'+_0x17eb52['statusText']),await h(0x1388);continue;}let _0x4611a6=_0x17eb52[_0x2b82df(0x23c)]['getReader'](),_0x37f829=new TextDecoder(),_0x58d942='';while(!0x0){let {done:_0x1fb04c,value:_0x4f0b92}=await _0x4611a6[_0x2b82df(0x26b)]();if(_0x1fb04c)break;_0x58d942+=_0x37f829['decode'](_0x4f0b92,{'stream':!0x0});let _0x4be363=_0x58d942[_0x2b82df(0x1e6)]('\x0a\x0a');_0x58d942=_0x4be363[_0x2b82df(0x215)]()||'';for(let _0x5c06ba of _0x4be363){let _0x1a1a0a=_0x5c06ba[_0x2b82df(0x1e6)]('\x0a')[_0x2b82df(0x1fb)](_0x5295cb=>_0x5295cb[_0x2b82df(0x255)](_0x2b82df(0x264)));if(!_0x1a1a0a)continue;try{let _0x107eb3=JSON[_0x2b82df(0x226)](_0x1a1a0a[_0x2b82df(0x25b)](0x6));await S(_0x107eb3);}catch(_0x3a02d4){Y(_0x2b82df(0x22c)+_0x3a02d4);}}}Y(_0x2b82df(0x1f9));}catch(_0x162976){Y(_0x2b82df(0x1f3)+_0x162976);}await h(0xbb8);}}async function S(_0x266872){const _0x44f447=a0_0x5426cb;if(_0x266872[_0x44f447(0x222)]==='connected'){Y(_0x44f447(0x257)+Z+'\x22');return;}if(_0x266872['type']==='new_message'){if(Y(_0x44f447(0x260)+_0x266872['from']+':\x20'+_0x266872[_0x44f447(0x223)][_0x44f447(0x25b)](0x0,0x3c)),await K[_0x44f447(0x210)]({'method':'notifications/claude/channel','params':{'content':_0x266872['message'],'meta':{'sender':_0x266872['from']||_0x44f447(0x1ec),'sender_id':'commhub','user':_0x266872['from']||_0x44f447(0x1ec),'priority':_0x44f447(0x243)}}}),_0x266872[_0x44f447(0x20a)])await P(_0x44f447(0x207),{'alias':Z,'message_id':_0x266872[_0x44f447(0x20a)]});return;}if(_0x266872[_0x44f447(0x222)]===_0x44f447(0x1e7)||_0x266872['type']===_0x44f447(0x22f)){Y('←\x20'+_0x266872[_0x44f447(0x222)]+_0x44f447(0x240)+_0x266872[_0x44f447(0x205)]+_0x44f447(0x24c)+(_0x266872[_0x44f447(0x249)]||'normal'));let _0xe7f3bd=await P(_0x44f447(0x227),{'alias':Z,'limit':0x5});if(_0xe7f3bd?.['ok']&&_0xe7f3bd[_0x44f447(0x220)]?.[_0x44f447(0x258)]>0x0)for(let _0x5703b6 of _0xe7f3bd[_0x44f447(0x220)]){let _0x3dfb18={'sender':_0x5703b6[_0x44f447(0x229)]||_0x44f447(0x1ec),'sender_id':'commhub','user':_0x5703b6['from_session']||'hub','task_id':_0x5703b6['id'],'priority':_0x5703b6[_0x44f447(0x249)]||_0x44f447(0x243)};k[_0x44f447(0x201)](_0x5703b6['id'],_0x5703b6[_0x44f447(0x229)]||_0x44f447(0x1ec)),await K['notification']({'method':_0x44f447(0x233),'params':{'content':_0x5703b6[_0x44f447(0x231)],'meta':_0x3dfb18}}),Y(_0x44f447(0x232)+_0x5703b6['id'][_0x44f447(0x25b)](0x0,0x8)+_0x44f447(0x1e0)+_0x5703b6[_0x44f447(0x229)]+':\x20'+_0x5703b6[_0x44f447(0x231)][_0x44f447(0x25b)](0x0,0x3c)),await P(_0x44f447(0x207),{'alias':Z,'message_id':_0x5703b6['id']});}}}async function A(){const _0x290db9=a0_0x5426cb;let _0x59d612=new a0_0x58ce57();await K[_0x290db9(0x24f)](_0x59d612),Y('MCP\x20stdio\x20connected'),Y(_0x290db9(0x251)),u()[_0x290db9(0x245)](_0x5b409c=>Y(_0x290db9(0x211)+_0x5b409c)),P('report_status',{'resume_id':w,'alias':Z,'status':_0x290db9(0x1ea),'server':a0_0x171ac2(),'hostname':a0_0x171ac2(),'agent':_0x290db9(0x1df),'project_dir':process['cwd'](),'tmux_name':j||void 0x0})[_0x290db9(0x239)](()=>Y(_0x290db9(0x224)+Z+'\x22\x20('+w[_0x290db9(0x25b)](0x0,0x8)+')'))[_0x290db9(0x245)](_0x4277e7=>Y(_0x290db9(0x208)+_0x4277e7)),setInterval(()=>{const _0x545132=_0x290db9;P(_0x545132(0x22a),{'resume_id':w,'alias':Z,'status':_0x545132(0x1ea),'server':a0_0x171ac2(),'hostname':a0_0x171ac2(),'agent':_0x545132(0x1df),'project_dir':process[_0x545132(0x22b)](),'tmux_name':j||void 0x0})[_0x545132(0x245)](_0x4f8b25=>Y('heartbeat\x20failed:\x20'+_0x4f8b25));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}A()[a0_0x5426cb(0x245)](_0x250919=>{const _0x5424fb=a0_0x5426cb;Y(_0x5424fb(0x228)+_0x250919),process[_0x5424fb(0x1f5)](0x1);});async function N(){const _0x4174e5=a0_0x5426cb;Y('shutting\x20down,\x20reporting\x20offline...'),await P('report_status',{'resume_id':w,'alias':Z,'status':'error','task':'session\x20disconnected'})[_0x4174e5(0x245)](()=>{}),process['exit'](0x0);}process[a0_0x5426cb(0x21b)]['on'](a0_0x5426cb(0x1e8),()=>N()),process['on']('SIGTERM',()=>N()),process['on']('SIGINT',()=>N());function a0_0x1b33(){const _0x205916=['params','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','delete','inbox_count','\x20CWD=','ack_inbox','warning:\x20could\x20not\x20register:\x20','trim','message_id','init\x20failed:\x20','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','connecting\x20to\x20','failed','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','notification','SSE\x20fatal:\x20','CommHub\x20init\x20failed:\x20','Reply\x20text\x20/\x20result\x20summary','Bearer\x20','pop','none','utf-8','\x20ALIAS=','Progress\x200-100','low','stdin','alias','get','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','object','messages','working','type','message','registered\x20as\x20\x22','6025416CElYfd','parse','get_inbox','fatal:\x20','from_session','report_status','cwd','parse\x20error:\x20','replace','stringify','broadcast','in_progress','content','→\x20injected\x20task\x20','notifications/claude/channel','join','.claude/channels/commhub','completed','Message\x20content','tmux\x20display-message\x20-p\x20\x27#S\x27','then','http://127.0.0.1:9200','commhub_send_message','body','/events/','error','/mcp',':\x20inbox_count=','setRequestHandler','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','normal','unknown\x20tool','catch','send_reply','commhub_get_all_status','Task\x20content','priority','status','.env','\x20priority=','replied','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','connect','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','starting\x20SSE\x20listener...','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','...\x20TMUX=','.anet','startsWith','299494qvSbfA','SSE\x20connected\x20as\x20\x22','length','Session\x20alias:\x20','send_task','slice','Authorization','initialize','send_message','8475390Smldfp','←\x20message\x20from\x20','text','blocked','2.0','data:\x20','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','commhub_send_task','31604gvAmQv','Target\x20session\x20alias','976368VTbSTj','stderr','read','claude-code','\x20from\x20','8155184iHSPep','indexOf','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','3015171YzLSBv','commhub_report_status','split','new_task','end','no\x20response','idle','commhub-channel','hub','result','\x20PROJECT_ENV=','0.3.0','145MoobzY','application/json','string','SSE\x20connection\x20error:\x20',']\x20[commhub]\x20','exit','SSE\x20error:\x20','POST','commhub_reply','SSE\x20stream\x20ended,\x20reconnecting...','15wRbJKl','find','application/json,\x20text/event-stream','tools/call','get_all_status','cancelled','2025-03-26','set'];a0_0x1b33=function(){return _0x205916;};return a0_0x1b33();}
2
+ const a0_0x923dcb=a0_0x2d2b;(function(_0x5a8f08,_0x3aafcb){const _0x477a66=a0_0x2d2b,_0x13c18d=_0x5a8f08();while(!![]){try{const _0x1425c1=parseInt(_0x477a66(0xd7))/0x1+parseInt(_0x477a66(0x10f))/0x2*(-parseInt(_0x477a66(0x143))/0x3)+-parseInt(_0x477a66(0xd5))/0x4+parseInt(_0x477a66(0xc8))/0x5*(-parseInt(_0x477a66(0xec))/0x6)+parseInt(_0x477a66(0x136))/0x7+parseInt(_0x477a66(0x119))/0x8*(-parseInt(_0x477a66(0xd9))/0x9)+parseInt(_0x477a66(0x12f))/0xa;if(_0x1425c1===_0x3aafcb)break;else _0x13c18d['push'](_0x13c18d['shift']());}catch(_0x31739a){_0x13c18d['push'](_0x13c18d['shift']());}}}(a0_0x59ee,0x25b83));import{readFileSync as a0_0x1f5938,existsSync as a0_0x5589c6}from'fs';import{randomUUID as a0_0x13945d}from'crypto';import{join as a0_0x1ed1b6}from'path';import{hostname as a0_0x57e10e}from'os';import{execSync as a0_0x14efb6}from'child_process';import{Server as a0_0xebd3b8}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x4677d3}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x58d468,CallToolRequestSchema as a0_0x4e9b91}from'@modelcontextprotocol/sdk/types.js';function p(_0x2a1625){const _0x23e831=a0_0x2d2b;if(!a0_0x5589c6(_0x2a1625))return;for(let _0x48f1a of a0_0x1f5938(_0x2a1625,_0x23e831(0x148))[_0x23e831(0xfc)]('\x0a')){let _0x286d8f=_0x48f1a[_0x23e831(0x10e)]();if(!_0x286d8f||_0x286d8f[_0x23e831(0x103)]('#'))continue;let _0xa45a13=_0x286d8f[_0x23e831(0xba)]('=');if(_0xa45a13<0x0)continue;let _0x5e0555=_0x286d8f[_0x23e831(0xfd)](0x0,_0xa45a13)[_0x23e831(0x10e)](),_0x424c38=_0x286d8f[_0x23e831(0xfd)](_0xa45a13+0x1)['trim']()[_0x23e831(0xc9)](/^["']|["']$/g,'');if(!process.env[_0x5e0555])process.env[_0x5e0555]=_0x424c38;}}var C=process.env.HOME||'~',T=a0_0x1ed1b6(C,'.claude/channels/commhub');p(a0_0x1ed1b6(T,a0_0x923dcb(0xef)));var L=process[a0_0x923dcb(0x142)]()[a0_0x923dcb(0xc9)](/\//g,'-');p(a0_0x1ed1b6(T,L,a0_0x923dcb(0xef)));function a0_0x59ee(){const _0x21c524=['/events/','1654646BXlrYy','.anet','stringify','ready\x20—\x20waiting\x20for\x20events','→\x20injected\x20task\x20','pop','SSE\x20connection\x20error:\x20','2025-03-26','decode','none','ack_inbox','SSE\x20connected\x20as\x20\x22','cwd','709899SjeKUQ','delete','CommHub\x20init\x20failed:\x20','0.3.0','MCP\x20stdio\x20connected','utf-8','\x20from\x20','indexOf','write','\x20RESUME_ID=','completed','normal','number','claude-code','read','\x20PROJECT_ENV=','setRequestHandler','notifications/claude/channel','parse\x20error:\x20','text','SIGINT','86215UftjCv','replace','Session\x20alias:\x20','content','initialize','set','in_progress','POST','registered\x20as\x20\x22','from','commhub_send_task','commhub-channel','exit','1167532mjTnhJ','notification','251388SSoKph','result','85815OUFTsN','new_task','then','catch','config.json','init\x20failed:\x20','toTimeString',']\x20[commhub]\x20','unknown\x20tool','send_message','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','from_session','Priority\x20(default:\x20normal)','SSE\x20stream\x20ended,\x20reconnecting...','\x22\x20(','get','messages','stdin','Target\x20session\x20alias','42KmfZyO','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','2.0','.env','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','SIGTERM','send_task','connected','tmux\x20display-message\x20-p\x20\x27#S\x27','string','commhub_reply','fatal:\x20','tools/call','object','find','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','split','slice','no\x20response','hub','heartbeat\x20failed:\x20','\x20ALIAS=','Bearer\x20','startsWith','session\x20disconnected','params','alias','\x20priority=','statusText','failed','report_status','connect','status','idle','trim','2XZFMaB','ENV:\x20URL=','high','application/json','parse','Authorization','Message\x20content','priority','Reply\x20text\x20/\x20result\x20summary','SSE\x20fatal:\x20','104qiXqUP','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','message_id','message','blocked','send_reply','http://127.0.0.1:9200',':\x20inbox_count=','application/json,\x20text/event-stream','inbox_count','type','join','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','task','getReader','starting\x20SSE\x20listener...','\x20CWD=','cancelled','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','connecting\x20to\x20','commhub_send_message','working','4399050pKpfrh','error','body','commhub','low','commhub_get_all_status'];a0_0x59ee=function(){return _0x21c524;};return a0_0x59ee();}function U(){const _0x5ef342=a0_0x923dcb;try{return a0_0x14efb6(_0x5ef342(0xf4),{'encoding':_0x5ef342(0x148),'timeout':0x7d0})['trim']();}catch{return'';}}function v(){const _0x2e647c=a0_0x923dcb;try{let _0x110a40=a0_0x1ed1b6(C,_0x2e647c(0x137),_0x2e647c(0xdd));if(a0_0x5589c6(_0x110a40))return JSON[_0x2e647c(0x113)](a0_0x1f5938(_0x110a40,'utf-8'));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x923dcb(0xff)]||a0_0x923dcb(0x11f),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x57e10e(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x13945d(),X=process.env.COMMHUB_TOKEN||H['token']||'';function Y(_0x2d430d){const _0x1234cd=a0_0x923dcb;let _0x2c30f0=new Date()[_0x1234cd(0xdf)]()['slice'](0x0,0x8);process['stderr'][_0x1234cd(0xbb)]('['+_0x2c30f0+_0x1234cd(0xe0)+_0x2d430d+'\x0a');}function h(_0x172eee){return new Promise(_0x17d5b4=>setTimeout(_0x17d5b4,_0x172eee));}Y(a0_0x923dcb(0x110)+f+a0_0x923dcb(0x101)+Z+a0_0x923dcb(0xbc)+w['slice'](0x0,0x8)+'...\x20TMUX='+(j||a0_0x923dcb(0x13f))+a0_0x923dcb(0x129)+process['cwd']()+a0_0x923dcb(0xc2)+L);var k=new Map(),K=new a0_0xebd3b8({'name':a0_0x923dcb(0xd3),'version':a0_0x923dcb(0x146)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x923dcb(0xfb),a0_0x923dcb(0xf0),a0_0x923dcb(0xe3),'You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.',a0_0x923dcb(0xca)+Z][a0_0x923dcb(0x124)]('\x0a')});K[a0_0x923dcb(0xc3)](a0_0x58d468,async()=>({'tools':[{'name':'commhub_reply','description':'Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','inputSchema':{'type':'object','properties':{'task_id':{'type':a0_0x923dcb(0xf5),'description':a0_0x923dcb(0xed)},'text':{'type':a0_0x923dcb(0xf5),'description':a0_0x923dcb(0x117)},'status':{'type':a0_0x923dcb(0xf5),'enum':[a0_0x923dcb(0xbd),a0_0x923dcb(0x109),a0_0x923dcb(0x12a),a0_0x923dcb(0x11d),a0_0x923dcb(0x130),a0_0x923dcb(0xce)],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':[a0_0x923dcb(0xc6)]}},{'name':'commhub_report_status','description':a0_0x923dcb(0x12b),'inputSchema':{'type':'object','properties':{'status':{'type':a0_0x923dcb(0xf5),'enum':[a0_0x923dcb(0x12e),a0_0x923dcb(0x10d),'blocked',a0_0x923dcb(0x130)]},'task':{'type':a0_0x923dcb(0xf5),'description':'Current\x20task\x20description'},'progress':{'type':a0_0x923dcb(0xbf),'description':'Progress\x200-100'}},'required':[a0_0x923dcb(0x10c)]}},{'name':a0_0x923dcb(0xd2),'description':'Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x923dcb(0xf5),'description':a0_0x923dcb(0xeb)},'task':{'type':a0_0x923dcb(0xf5),'description':'Task\x20content'},'priority':{'type':'string','enum':[a0_0x923dcb(0x111),a0_0x923dcb(0xbe),a0_0x923dcb(0x133)],'description':a0_0x923dcb(0xe5)}},'required':[a0_0x923dcb(0x106),a0_0x923dcb(0x126)]}},{'name':a0_0x923dcb(0x12d),'description':a0_0x923dcb(0x11a),'inputSchema':{'type':a0_0x923dcb(0xf9),'properties':{'alias':{'type':a0_0x923dcb(0xf5),'description':a0_0x923dcb(0xeb)},'message':{'type':a0_0x923dcb(0xf5),'description':a0_0x923dcb(0x115)}},'required':[a0_0x923dcb(0x106),a0_0x923dcb(0x11c)]}},{'name':a0_0x923dcb(0x134),'description':a0_0x923dcb(0x125),'inputSchema':{'type':a0_0x923dcb(0xf9),'properties':{}}}]}));async function P(_0x358001,_0x4846cb){const _0x19c9c5=a0_0x923dcb;let _0x5625fd=await fetch(f+'/mcp',{'method':_0x19c9c5(0xcf),'headers':{'Content-Type':_0x19c9c5(0x112),'Accept':_0x19c9c5(0x121),...X?{'Authorization':_0x19c9c5(0x102)+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x19c9c5(0xee),'id':0x1,'method':_0x19c9c5(0xcc),'params':{'protocolVersion':_0x19c9c5(0x13d),'capabilities':{},'clientInfo':{'name':_0x19c9c5(0xd3),'version':_0x19c9c5(0x146)}}})});if(!_0x5625fd['ok']){let _0x30610d=await _0x5625fd[_0x19c9c5(0xc6)]();return Y(_0x19c9c5(0x145)+_0x5625fd[_0x19c9c5(0x10c)]+'\x20'+_0x30610d['slice'](0x0,0x64)),{'ok':!0x1,'error':_0x19c9c5(0xde)+_0x5625fd[_0x19c9c5(0x10c)]};}await _0x5625fd[_0x19c9c5(0xc6)]();let _0x362a6e=(await(await fetch(f+'/mcp',{'method':_0x19c9c5(0xcf),'headers':{'Content-Type':'application/json','Accept':_0x19c9c5(0x121),...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x19c9c5(0xee),'id':0x2,'method':_0x19c9c5(0xf8),'params':{'name':_0x358001,'arguments':_0x4846cb}})}))['text']())[_0x19c9c5(0xfc)]('\x0a')[_0x19c9c5(0xfa)](_0x5860b3=>_0x5860b3[_0x19c9c5(0x103)]('data:\x20'));if(_0x362a6e){let _0x559da1=JSON[_0x19c9c5(0x113)](_0x362a6e[_0x19c9c5(0xfd)](0x6));return _0x559da1?.[_0x19c9c5(0xd8)]?.[_0x19c9c5(0xcb)]?.[0x0]?.['text']?JSON[_0x19c9c5(0x113)](_0x559da1[_0x19c9c5(0xd8)]['content'][0x0][_0x19c9c5(0xc6)]):_0x559da1;}return{'ok':!0x1,'error':_0x19c9c5(0xfe)};}K[a0_0x923dcb(0xc3)](a0_0x4e9b91,async _0x13adc9=>{const _0x3b24d3=a0_0x923dcb;let {name:_0x478fe6,arguments:_0xb089ca}=_0x13adc9[_0x3b24d3(0x105)];if(_0x478fe6===_0x3b24d3(0xf6)){let {task_id:_0x320e0f,text:_0x17cd46,status:_0x355eb3}=_0xb089ca;if(_0x355eb3===_0x3b24d3(0xbd)||_0x355eb3===_0x3b24d3(0x109)||_0x355eb3===_0x3b24d3(0x12a)){let _0x3f000e=_0x355eb3===_0x3b24d3(0xbd)?'replied':_0x355eb3,_0x361c07=_0x320e0f?k[_0x3b24d3(0xe8)](_0x320e0f)||_0x3b24d3(0xff):_0x3b24d3(0xff),_0x153f98=await P(_0x3b24d3(0x11e),{'alias':_0x361c07,'text':_0x17cd46,'in_reply_to':_0x320e0f||void 0x0,'status':_0x3f000e,'from_session':Z});if(_0x320e0f)k[_0x3b24d3(0x144)](_0x320e0f);return{'content':[{'type':'text','text':JSON[_0x3b24d3(0x138)](_0x153f98)}]};}let _0x2a3cdb=await P(_0x3b24d3(0x10a),{'resume_id':w,'alias':Z,'status':_0x355eb3==='blocked'?'blocked':_0x355eb3===_0x3b24d3(0x130)?'error':_0x3b24d3(0x12e),'task':_0x17cd46[_0x3b24d3(0xfd)](0x0,0xc8),'output':_0x17cd46});return{'content':[{'type':'text','text':JSON[_0x3b24d3(0x138)](_0x2a3cdb)}]};}if(_0x478fe6==='commhub_report_status'){let {status:_0x5e9552,task:_0x213c8b,progress:_0x2bf419}=_0xb089ca,_0x383f12=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x5e9552,'task':_0x213c8b,'progress':_0x2bf419});return{'content':[{'type':'text','text':JSON[_0x3b24d3(0x138)](_0x383f12)}]};}if(_0x478fe6==='commhub_send_task'){let {alias:_0x2e1cde,task:_0x2e7deb,priority:_0x4bb4a7}=_0xb089ca,_0x1084ec=await P(_0x3b24d3(0xf2),{'alias':_0x2e1cde,'task':_0x2e7deb,'priority':_0x4bb4a7||_0x3b24d3(0xbe),'from_session':Z});return{'content':[{'type':_0x3b24d3(0xc6),'text':JSON[_0x3b24d3(0x138)](_0x1084ec)}]};}if(_0x478fe6===_0x3b24d3(0x12d)){let {alias:_0xe5410e,message:_0x1864b7}=_0xb089ca,_0x4f7d19=await P(_0x3b24d3(0xe2),{'alias':_0xe5410e,'message':_0x1864b7,'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x3b24d3(0x138)](_0x4f7d19)}]};}if(_0x478fe6===_0x3b24d3(0x134)){let _0x9a58a5=await P('get_all_status',{});return{'content':[{'type':_0x3b24d3(0xc6),'text':JSON[_0x3b24d3(0x138)](_0x9a58a5)}]};}return{'content':[{'type':_0x3b24d3(0xc6),'text':JSON[_0x3b24d3(0x138)]({'error':_0x3b24d3(0xe1)})}]};});async function u(){const _0x1a2d65=a0_0x923dcb;let _0x12d9d8=f+_0x1a2d65(0x135)+encodeURIComponent(Z),_0x57a718={};if(X)_0x57a718[_0x1a2d65(0x114)]=_0x1a2d65(0x102)+X;Y(_0x1a2d65(0x12c)+_0x12d9d8);while(!0x0){try{let _0x1a0be4=await fetch(_0x12d9d8,{'headers':_0x57a718});if(!_0x1a0be4['ok']){Y('SSE\x20error:\x20'+_0x1a0be4['status']+'\x20'+_0x1a0be4[_0x1a2d65(0x108)]),await h(0x1388);continue;}let _0x5a513a=_0x1a0be4[_0x1a2d65(0x131)][_0x1a2d65(0x127)](),_0x40378c=new TextDecoder(),_0x29784c='';while(!0x0){let {done:_0x147f81,value:_0x54f35c}=await _0x5a513a[_0x1a2d65(0xc1)]();if(_0x147f81)break;_0x29784c+=_0x40378c[_0x1a2d65(0x13e)](_0x54f35c,{'stream':!0x0});let _0x2f8bf1=_0x29784c[_0x1a2d65(0xfc)]('\x0a\x0a');_0x29784c=_0x2f8bf1[_0x1a2d65(0x13b)]()||'';for(let _0x2d53ca of _0x2f8bf1){let _0x2f14d7=_0x2d53ca['split']('\x0a')[_0x1a2d65(0xfa)](_0x308252=>_0x308252['startsWith']('data:\x20'));if(!_0x2f14d7)continue;try{let _0x199182=JSON[_0x1a2d65(0x113)](_0x2f14d7[_0x1a2d65(0xfd)](0x6));await S(_0x199182);}catch(_0xf5651e){Y(_0x1a2d65(0xc5)+_0xf5651e);}}}Y(_0x1a2d65(0xe6));}catch(_0x359705){Y(_0x1a2d65(0x13c)+_0x359705);}await h(0xbb8);}}async function S(_0x28b91d){const _0x4ffcc0=a0_0x923dcb;if(_0x28b91d[_0x4ffcc0(0x123)]===_0x4ffcc0(0xf3)){Y(_0x4ffcc0(0x141)+Z+'\x22');return;}if(_0x28b91d['type']==='new_message'){if(Y('←\x20message\x20from\x20'+_0x28b91d[_0x4ffcc0(0xd1)]+':\x20'+_0x28b91d[_0x4ffcc0(0x11c)]['slice'](0x0,0x3c)),await K[_0x4ffcc0(0xd6)]({'method':_0x4ffcc0(0xc4),'params':{'content':_0x28b91d[_0x4ffcc0(0x11c)],'meta':{'sender':_0x28b91d[_0x4ffcc0(0xd1)]||_0x4ffcc0(0xff),'sender_id':_0x4ffcc0(0x132),'user':_0x28b91d[_0x4ffcc0(0xd1)]||_0x4ffcc0(0xff),'priority':_0x4ffcc0(0xbe)}}}),_0x28b91d[_0x4ffcc0(0x11b)])await P('ack_inbox',{'alias':Z,'message_id':_0x28b91d['message_id']});return;}if(_0x28b91d[_0x4ffcc0(0x123)]===_0x4ffcc0(0xda)||_0x28b91d[_0x4ffcc0(0x123)]==='broadcast'){Y('←\x20'+_0x28b91d[_0x4ffcc0(0x123)]+_0x4ffcc0(0x120)+_0x28b91d[_0x4ffcc0(0x122)]+_0x4ffcc0(0x107)+(_0x28b91d[_0x4ffcc0(0x116)]||_0x4ffcc0(0xbe)));let _0x3f7f4f=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0x3f7f4f?.['ok']&&_0x3f7f4f[_0x4ffcc0(0xe9)]?.['length']>0x0)for(let _0x2a6a5b of _0x3f7f4f[_0x4ffcc0(0xe9)]){let _0x41862f={'sender':_0x2a6a5b[_0x4ffcc0(0xe4)]||_0x4ffcc0(0xff),'sender_id':_0x4ffcc0(0x132),'user':_0x2a6a5b['from_session']||_0x4ffcc0(0xff),'task_id':_0x2a6a5b['id'],'priority':_0x2a6a5b[_0x4ffcc0(0x116)]||_0x4ffcc0(0xbe)};k[_0x4ffcc0(0xcd)](_0x2a6a5b['id'],_0x2a6a5b[_0x4ffcc0(0xe4)]||_0x4ffcc0(0xff)),await K['notification']({'method':_0x4ffcc0(0xc4),'params':{'content':_0x2a6a5b[_0x4ffcc0(0xcb)],'meta':_0x41862f}}),Y(_0x4ffcc0(0x13a)+_0x2a6a5b['id'][_0x4ffcc0(0xfd)](0x0,0x8)+_0x4ffcc0(0xb9)+_0x2a6a5b[_0x4ffcc0(0xe4)]+':\x20'+_0x2a6a5b[_0x4ffcc0(0xcb)][_0x4ffcc0(0xfd)](0x0,0x3c)),await P(_0x4ffcc0(0x140),{'alias':Z,'message_id':_0x2a6a5b['id']});}}}async function A(){const _0x37316a=a0_0x923dcb;let _0x1d754c=new a0_0x4677d3();await K[_0x37316a(0x10b)](_0x1d754c),Y(_0x37316a(0x147)),Y(_0x37316a(0x128)),u()[_0x37316a(0xdc)](_0x33d862=>Y(_0x37316a(0x118)+_0x33d862)),P(_0x37316a(0x10a),{'resume_id':w,'alias':Z,'status':_0x37316a(0x10d),'server':a0_0x57e10e(),'hostname':a0_0x57e10e(),'agent':_0x37316a(0xc0),'project_dir':process['cwd'](),'tmux_name':j||void 0x0})[_0x37316a(0xdb)](()=>Y(_0x37316a(0xd0)+Z+_0x37316a(0xe7)+w[_0x37316a(0xfd)](0x0,0x8)+')'))['catch'](_0x5e2371=>Y('warning:\x20could\x20not\x20register:\x20'+_0x5e2371)),setInterval(()=>{const _0xc290a0=_0x37316a;P('report_status',{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x57e10e(),'hostname':a0_0x57e10e(),'agent':_0xc290a0(0xc0),'project_dir':process[_0xc290a0(0x142)](),'tmux_name':j||void 0x0})[_0xc290a0(0xdc)](_0x3101f3=>Y(_0xc290a0(0x100)+_0x3101f3));},0x2bf20),Y(_0x37316a(0x139));}A()[a0_0x923dcb(0xdc)](_0x25a50d=>{const _0x536ef3=a0_0x923dcb;Y(_0x536ef3(0xf7)+_0x25a50d),process[_0x536ef3(0xd4)](0x1);});async function N(){const _0x422dd8=a0_0x923dcb;Y('shutting\x20down,\x20reporting\x20offline...'),await P('report_status',{'resume_id':w,'alias':Z,'status':'error','task':_0x422dd8(0x104)})[_0x422dd8(0xdc)](()=>{}),process[_0x422dd8(0xd4)](0x0);}function a0_0x2d2b(_0x472143,_0x734982){_0x472143=_0x472143-0xb9;const _0x59eef7=a0_0x59ee();let _0x2d2b09=_0x59eef7[_0x472143];return _0x2d2b09;}process[a0_0x923dcb(0xea)]['on']('end',()=>N()),process['on'](a0_0x923dcb(0xf1),()=>N()),process['on'](a0_0x923dcb(0xc7),()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.2.0",
3
+ "version": "2.2.2-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",