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

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_0x7185bd=a0_0x2e94;(function(_0x541c11,_0x256b5f){const _0x471a35=a0_0x2e94,_0x15285a=_0x541c11();while(!![]){try{const _0xa5656a=-parseInt(_0x471a35(0x226))/0x1*(parseInt(_0x471a35(0x20a))/0x2)+parseInt(_0x471a35(0x1f2))/0x3*(-parseInt(_0x471a35(0x228))/0x4)+parseInt(_0x471a35(0x238))/0x5+-parseInt(_0x471a35(0x1ec))/0x6+-parseInt(_0x471a35(0x229))/0x7*(-parseInt(_0x471a35(0x1f1))/0x8)+parseInt(_0x471a35(0x21e))/0x9*(-parseInt(_0x471a35(0x223))/0xa)+parseInt(_0x471a35(0x215))/0xb*(parseInt(_0x471a35(0x212))/0xc);if(_0xa5656a===_0x256b5f)break;else _0x15285a['push'](_0x15285a['shift']());}catch(_0xf93b79){_0x15285a['push'](_0x15285a['shift']());}}}(a0_0x409a,0x689ba));function a0_0x409a(){const _0x2b402b=['call','stringify','reconnectDelay','startsWith','137230FxaBFU','normal','body','109dcGQHf','registered','2740sCVXUR','7609uEyRSu','SSE\x20failed:\x20','/mcp','get_all_status','url','status','tools/call','inbox\x20error:\x20','running','idle','error','sdk','content','cwd','Authorization','3520150rFjWoe','reply','broadcast',']\x20[commhub:','offline','connect','processInbox','type','now','AbortError','task','catch','split','replace','log','send','sleep','959244ZfKSKZ','getReader','slice','disconnect','SSE\x20reconnecting\x20in\x20','5216raWBsT','1605JTOlIX','connectSSE','Bearer\x20','messages','sdk-','data:\x20','heartbeatTimer','send_task','heartbeatInterval','disconnected','autoConnect','emit','parse','pop','token','ack_inbox','min','SSE\x20connected','s...','match','new_task','text/event-stream','application/json','agent','15622VhgsMW','resumeId','2.0','from_session','new_message','connected','report_status','message','12VjGWrJ','get_inbox','decode','12328657CkwPhR','getAllStatus','alias','SSE\x20error:\x20','sseAbort','send_message','server','text','/events/','477sKcxdl'];a0_0x409a=function(){return _0x2b402b;};return a0_0x409a();}import{EventEmitter as a0_0x307851}from'events';import{hostname as a0_0x244e1f}from'os';class T extends a0_0x307851{[a0_0x7185bd(0x22d)];['alias'];['token'];[a0_0x7185bd(0x209)];[a0_0x7185bd(0x20b)];[a0_0x7185bd(0x1fa)];[a0_0x7185bd(0x221)];[a0_0x7185bd(0x1f8)];[a0_0x7185bd(0x219)];[a0_0x7185bd(0x231)]=!0x1;constructor(_0x4f8c31){const _0x26b35e=a0_0x7185bd;super();if(this['url']=_0x4f8c31[_0x26b35e(0x22d)][_0x26b35e(0x1e8)](/\/$/,''),this[_0x26b35e(0x217)]=_0x4f8c31['alias'],this[_0x26b35e(0x200)]=_0x4f8c31[_0x26b35e(0x200)],this[_0x26b35e(0x209)]=_0x4f8c31['agent']||_0x26b35e(0x234),this[_0x26b35e(0x20b)]=_0x26b35e(0x1f6)+_0x4f8c31[_0x26b35e(0x217)]+'-'+Date['now']()['toString'](0x24),this[_0x26b35e(0x1fa)]=_0x4f8c31[_0x26b35e(0x1fa)]??0x2bf20,this[_0x26b35e(0x221)]=_0x4f8c31['reconnectDelay']??0xbb8,_0x4f8c31[_0x26b35e(0x1fc)]!==!0x1)this[_0x26b35e(0x1e0)]();}[a0_0x7185bd(0x1e9)](_0x5a79ba){const _0x5de1fc=a0_0x7185bd;console[_0x5de1fc(0x1e9)]('['+new Date()['toTimeString']()['slice'](0x0,0x8)+_0x5de1fc(0x1de)+this['alias']+']\x20'+_0x5a79ba);}async[a0_0x7185bd(0x21f)](_0x54adb8,_0x2b6e88){const _0x5a09d0=a0_0x7185bd;let _0x38dba2={'Content-Type':_0x5a09d0(0x208),'Accept':'application/json,\x20text/event-stream'};if(this[_0x5a09d0(0x200)])_0x38dba2[_0x5a09d0(0x237)]=_0x5a09d0(0x1f4)+this[_0x5a09d0(0x200)];let _0x237707=await(await fetch(this[_0x5a09d0(0x22d)]+_0x5a09d0(0x22b),{'method':'POST','headers':_0x38dba2,'body':JSON[_0x5a09d0(0x220)]({'jsonrpc':_0x5a09d0(0x20c),'id':Date[_0x5a09d0(0x1e3)](),'method':_0x5a09d0(0x22f),'params':{'name':_0x54adb8,'arguments':_0x2b6e88}})}))[_0x5a09d0(0x21c)](),_0x3aca3d=_0x237707[_0x5a09d0(0x205)](/data: (.+)/),_0x5892b2=_0x3aca3d?JSON['parse'](_0x3aca3d[0x1]):JSON['parse'](_0x237707),_0x241400=_0x5892b2?.['result']?.[_0x5a09d0(0x235)]?.[0x0]?.[_0x5a09d0(0x21c)];return _0x241400?JSON[_0x5a09d0(0x1fe)](_0x241400):_0x5892b2;}async[a0_0x7185bd(0x1e0)](){const _0x263d78=a0_0x7185bd;if(this['running'])return;this['running']=!0x0,await this[_0x263d78(0x22e)](_0x263d78(0x232)),this[_0x263d78(0x1e9)](_0x263d78(0x227)),this[_0x263d78(0x1f8)]=setInterval(()=>{const _0x1884e2=_0x263d78;this[_0x1884e2(0x22e)]('idle')['catch'](_0x3528f3=>this[_0x1884e2(0x1e9)]('heartbeat\x20failed:\x20'+_0x3528f3[_0x1884e2(0x211)]));},this[_0x263d78(0x1fa)]),this[_0x263d78(0x1f3)]();}async[a0_0x7185bd(0x1ef)](){const _0x3588d1=a0_0x7185bd;if(this[_0x3588d1(0x231)]=!0x1,this[_0x3588d1(0x219)]?.['abort'](),this[_0x3588d1(0x1f8)])clearInterval(this[_0x3588d1(0x1f8)]);await this[_0x3588d1(0x22e)](_0x3588d1(0x1df))[_0x3588d1(0x1e6)](()=>{}),this[_0x3588d1(0x1e9)](_0x3588d1(0x1fb));}async[a0_0x7185bd(0x1ea)](_0x3a57d0,_0x350b5a,_0x1aef45=a0_0x7185bd(0x224)){const _0x17cb9b=a0_0x7185bd;return this[_0x17cb9b(0x21f)](_0x17cb9b(0x1f9),{'alias':_0x3a57d0,'task':_0x350b5a,'priority':_0x1aef45,'from_session':this['alias']});}async[a0_0x7185bd(0x211)](_0x411a43,_0x47a3f4){const _0x1d2f2b=a0_0x7185bd;return this[_0x1d2f2b(0x21f)](_0x1d2f2b(0x21a),{'alias':_0x411a43,'message':_0x47a3f4,'from_session':this[_0x1d2f2b(0x217)]});}async['reply'](_0x115d49,_0x2124b3,_0x584561='completed'){const _0x3cc383=a0_0x7185bd;return this[_0x3cc383(0x21f)](_0x3cc383(0x239),{'task_id':_0x115d49,'text':_0x2124b3,'status':_0x584561});}async['status'](_0x397830,_0x4ff097){const _0x3df559=a0_0x7185bd;return this[_0x3df559(0x21f)](_0x3df559(0x210),{'resume_id':this[_0x3df559(0x20b)],'alias':this['alias'],'status':_0x397830,'server':a0_0x244e1f(),'hostname':a0_0x244e1f(),'agent':this[_0x3df559(0x209)],'project_dir':process[_0x3df559(0x236)](),..._0x4ff097});}async[a0_0x7185bd(0x216)](){const _0x30c3cb=a0_0x7185bd;return this['call'](_0x30c3cb(0x22c),{});}async[a0_0x7185bd(0x23a)](_0x240284,_0x3a0d64){const _0x3861af=a0_0x7185bd;return this[_0x3861af(0x21f)](_0x3861af(0x23a),{'message':_0x240284,'filter_server':_0x3a0d64?.[_0x3861af(0x21b)],'filter_status':_0x3a0d64?.[_0x3861af(0x22e)]});}async[a0_0x7185bd(0x1f3)](){const _0x33f16e=a0_0x7185bd;let _0x13c127=encodeURIComponent(this[_0x33f16e(0x217)]),_0x16841f=this[_0x33f16e(0x22d)]+_0x33f16e(0x21d)+_0x13c127,_0x3ba610=this[_0x33f16e(0x221)];while(this[_0x33f16e(0x231)]){try{this[_0x33f16e(0x219)]=new AbortController();let _0x54d029={'Accept':_0x33f16e(0x207)};if(this[_0x33f16e(0x200)])_0x54d029[_0x33f16e(0x237)]=_0x33f16e(0x1f4)+this['token'];let _0xc7f9d6=await fetch(_0x16841f,{'headers':_0x54d029,'signal':this[_0x33f16e(0x219)]['signal']});if(!_0xc7f9d6['ok']||!_0xc7f9d6['body']){this[_0x33f16e(0x1e9)](_0x33f16e(0x22a)+_0xc7f9d6[_0x33f16e(0x22e)]),await this['sleep'](_0x3ba610),_0x3ba610=Math[_0x33f16e(0x202)](_0x3ba610*1.5,0xea60);continue;}_0x3ba610=this[_0x33f16e(0x221)];let _0x4578d8=_0xc7f9d6[_0x33f16e(0x225)][_0x33f16e(0x1ed)](),_0x23d66b=new TextDecoder(),_0x53f87e='';while(this[_0x33f16e(0x231)]){let {done:_0x5c8c9b,value:_0x4008ab}=await _0x4578d8['read']();if(_0x5c8c9b)break;_0x53f87e+=_0x23d66b[_0x33f16e(0x214)](_0x4008ab,{'stream':!0x0});let _0x58e19e=_0x53f87e[_0x33f16e(0x1e7)]('\x0a');_0x53f87e=_0x58e19e[_0x33f16e(0x1ff)]()||'';for(let _0x6c8948 of _0x58e19e){if(!_0x6c8948[_0x33f16e(0x222)](_0x33f16e(0x1f7)))continue;try{let _0x582815=JSON[_0x33f16e(0x1fe)](_0x6c8948[_0x33f16e(0x1ee)](0x6));if(_0x582815[_0x33f16e(0x1e2)]===_0x33f16e(0x20f)){this['log'](_0x33f16e(0x203)),this['emit']('connected');continue;}if(_0x582815[_0x33f16e(0x1e2)]===_0x33f16e(0x206)||_0x582815[_0x33f16e(0x1e2)]===_0x33f16e(0x20e)||_0x582815['type']===_0x33f16e(0x23a))await this[_0x33f16e(0x1e1)]();}catch{}}}}catch(_0x4a832a){if(_0x4a832a['name']===_0x33f16e(0x1e4))break;this['emit'](_0x33f16e(0x233),_0x4a832a),this[_0x33f16e(0x1e9)](_0x33f16e(0x218)+_0x4a832a[_0x33f16e(0x211)]);}if(this[_0x33f16e(0x231)])this[_0x33f16e(0x1fd)](_0x33f16e(0x1fb)),this['log'](_0x33f16e(0x1f0)+_0x3ba610/0x3e8+_0x33f16e(0x204)),await this[_0x33f16e(0x1eb)](_0x3ba610),_0x3ba610=Math[_0x33f16e(0x202)](_0x3ba610*1.5,0xea60);}}async['processInbox'](){const _0x382aa8=a0_0x7185bd;try{let _0x4d3fdf=(await this[_0x382aa8(0x21f)](_0x382aa8(0x213),{'alias':this[_0x382aa8(0x217)],'limit':0xa}))?.[_0x382aa8(0x1f5)]||[];for(let _0x2397c0 of _0x4d3fdf)await this[_0x382aa8(0x21f)](_0x382aa8(0x201),{'alias':this[_0x382aa8(0x217)],'message_id':_0x2397c0['id']}),this[_0x382aa8(0x1e9)]('←\x20'+_0x2397c0[_0x382aa8(0x20d)]+':\x20'+_0x2397c0[_0x382aa8(0x235)][_0x382aa8(0x1ee)](0x0,0x3c)),this[_0x382aa8(0x1fd)](_0x382aa8(0x1e5),_0x2397c0),this[_0x382aa8(0x1fd)]('message',_0x2397c0);}catch(_0x57c473){this[_0x382aa8(0x1e9)](_0x382aa8(0x230)+_0x57c473[_0x382aa8(0x211)]);}}['sleep'](_0x636795){return new Promise(_0x1a25d5=>setTimeout(_0x1a25d5,_0x636795));}}var $=T;function a0_0x2e94(_0x2fe8c4,_0x4f387a){_0x2fe8c4=_0x2fe8c4-0x1de;const _0x409a00=a0_0x409a();let _0x2e94c5=_0x409a00[_0x2fe8c4];return _0x2e94c5;}export{$ as default,T as CommHub};
1
+ const a0_0x36ab34=a0_0x59ae;function a0_0x59ae(_0x3c9991,_0x34f32d){_0x3c9991=_0x3c9991-0x132;const _0x462b58=a0_0x462b();let _0x59ae06=_0x462b58[_0x3c9991];return _0x59ae06;}(function(_0x2900c1,_0x26b461){const _0x5b6dfb=a0_0x59ae,_0x4db72c=_0x2900c1();while(!![]){try{const _0x47f2af=-parseInt(_0x5b6dfb(0x151))/0x1*(-parseInt(_0x5b6dfb(0x188))/0x2)+-parseInt(_0x5b6dfb(0x175))/0x3+-parseInt(_0x5b6dfb(0x142))/0x4*(parseInt(_0x5b6dfb(0x172))/0x5)+-parseInt(_0x5b6dfb(0x136))/0x6*(-parseInt(_0x5b6dfb(0x168))/0x7)+-parseInt(_0x5b6dfb(0x17d))/0x8*(parseInt(_0x5b6dfb(0x148))/0x9)+parseInt(_0x5b6dfb(0x17b))/0xa+parseInt(_0x5b6dfb(0x137))/0xb*(parseInt(_0x5b6dfb(0x161))/0xc);if(_0x47f2af===_0x26b461)break;else _0x4db72c['push'](_0x4db72c['shift']());}catch(_0x4dd444){_0x4db72c['push'](_0x4db72c['shift']());}}}(a0_0x462b,0x8bf14));function a0_0x462b(){const _0x44c345=['sleep','status','abort','8348QonALb','application/json,\x20text/event-stream','startsWith','broadcast','server','split','603LcMJnn','registered','token','log','stringify','heartbeatInterval','connectSSE','name','result','78423AfMgPA','tools/call','message','agent','from_session',']\x20[commhub:','min','autoConnect','resumeId','idle','connected','task','catch','messages','alias','reconnectDelay','4084644tKqjJw','disconnect','processInbox','call','sdk-','POST','replace','154189eGtUTw','offline','send_message','slice','Bearer\x20','type','SSE\x20error:\x20','application/json','running','normal','855pXVFjB','toString','disconnected','2543538HgYfDC','signal','SSE\x20reconnecting\x20in\x20','Authorization','emit','heartbeatTimer','2383650FhHQfB','getAllStatus','58288nbEPIH','url','data:\x20','parse','new_task','getReader','error','sseAbort','connect','new_message','read','20QSXOdC','/mcp','sdk','reply','s...','246jsHZng','11VqZUZb','SSE\x20failed:\x20','2.0','content','report_status','decode','text','pop'];a0_0x462b=function(){return _0x44c345;};return a0_0x462b();}import{EventEmitter as a0_0x224efc}from'events';import{hostname as a0_0x2653de}from'os';class T extends a0_0x224efc{[a0_0x36ab34(0x17e)];['alias'];['token'];[a0_0x36ab34(0x154)];['resumeId'];[a0_0x36ab34(0x14d)];[a0_0x36ab34(0x160)];[a0_0x36ab34(0x17a)];[a0_0x36ab34(0x184)];['running']=!0x1;constructor(_0x4f91e6){const _0x298054=a0_0x36ab34;super();if(this[_0x298054(0x17e)]=_0x4f91e6['url'][_0x298054(0x167)](/\/$/,''),this[_0x298054(0x15f)]=_0x4f91e6[_0x298054(0x15f)],this['token']=_0x4f91e6[_0x298054(0x14a)],this['agent']=_0x4f91e6[_0x298054(0x154)]||_0x298054(0x133),this[_0x298054(0x159)]=_0x298054(0x165)+_0x4f91e6[_0x298054(0x15f)]+'-'+Date['now']()[_0x298054(0x173)](0x24),this[_0x298054(0x14d)]=_0x4f91e6[_0x298054(0x14d)]??0x2bf20,this[_0x298054(0x160)]=_0x4f91e6['reconnectDelay']??0xbb8,_0x4f91e6[_0x298054(0x158)]!==!0x1)this[_0x298054(0x185)]();}[a0_0x36ab34(0x14b)](_0x42b184){const _0x1a45f5=a0_0x36ab34;console[_0x1a45f5(0x14b)]('['+new Date()['toTimeString']()['slice'](0x0,0x8)+_0x1a45f5(0x156)+this['alias']+']\x20'+_0x42b184);}async[a0_0x36ab34(0x164)](_0x22afce,_0x180872){const _0x257ae1=a0_0x36ab34;let _0x26affc={'Content-Type':_0x257ae1(0x16f),'Accept':_0x257ae1(0x143)};if(this[_0x257ae1(0x14a)])_0x26affc[_0x257ae1(0x178)]='Bearer\x20'+this[_0x257ae1(0x14a)];let _0x56386d=await(await fetch(this[_0x257ae1(0x17e)]+_0x257ae1(0x132),{'method':_0x257ae1(0x166),'headers':_0x26affc,'body':JSON[_0x257ae1(0x14c)]({'jsonrpc':_0x257ae1(0x139),'id':Date['now'](),'method':_0x257ae1(0x152),'params':{'name':_0x22afce,'arguments':_0x180872}})}))['text'](),_0x3d16c3=_0x56386d['match'](/data: (.+)/),_0x498037=_0x3d16c3?JSON['parse'](_0x3d16c3[0x1]):JSON['parse'](_0x56386d),_0x48e770=_0x498037?.[_0x257ae1(0x150)]?.[_0x257ae1(0x13a)]?.[0x0]?.[_0x257ae1(0x13d)];return _0x48e770?JSON[_0x257ae1(0x180)](_0x48e770):_0x498037;}async[a0_0x36ab34(0x185)](){const _0x7893a5=a0_0x36ab34;if(this['running'])return;this[_0x7893a5(0x170)]=!0x0,await this['status'](_0x7893a5(0x15a)),this['log'](_0x7893a5(0x149)),this[_0x7893a5(0x17a)]=setInterval(()=>{const _0x160057=_0x7893a5;this[_0x160057(0x140)]('idle')[_0x160057(0x15d)](_0x16efa7=>this['log']('heartbeat\x20failed:\x20'+_0x16efa7[_0x160057(0x153)]));},this['heartbeatInterval']),this[_0x7893a5(0x14e)]();}async[a0_0x36ab34(0x162)](){const _0x241f83=a0_0x36ab34;if(this['running']=!0x1,this['sseAbort']?.[_0x241f83(0x141)](),this[_0x241f83(0x17a)])clearInterval(this['heartbeatTimer']);await this[_0x241f83(0x140)](_0x241f83(0x169))[_0x241f83(0x15d)](()=>{}),this[_0x241f83(0x14b)](_0x241f83(0x174));}async['send'](_0x3712f6,_0x4b620d,_0x2d981f=a0_0x36ab34(0x171)){const _0xc9c2a2=a0_0x36ab34;return this[_0xc9c2a2(0x164)]('send_task',{'alias':_0x3712f6,'task':_0x4b620d,'priority':_0x2d981f,'from_session':this['alias']});}async[a0_0x36ab34(0x153)](_0x3eebf3,_0x44c050){const _0x55db17=a0_0x36ab34;return this[_0x55db17(0x164)](_0x55db17(0x16a),{'alias':_0x3eebf3,'message':_0x44c050,'from_session':this[_0x55db17(0x15f)]});}async[a0_0x36ab34(0x134)](_0x1bf3cf,_0x5b44f5,_0x4376ce='completed'){const _0x3126d9=a0_0x36ab34;return this['call'](_0x3126d9(0x134),{'task_id':_0x1bf3cf,'text':_0x5b44f5,'status':_0x4376ce});}async[a0_0x36ab34(0x140)](_0x1982ce,_0x274a76){const _0x5bba62=a0_0x36ab34;return this[_0x5bba62(0x164)](_0x5bba62(0x13b),{'resume_id':this[_0x5bba62(0x159)],'alias':this['alias'],'status':_0x1982ce,'server':a0_0x2653de(),'hostname':a0_0x2653de(),'agent':this[_0x5bba62(0x154)],'project_dir':process['cwd'](),..._0x274a76});}async[a0_0x36ab34(0x17c)](){return this['call']('get_all_status',{});}async[a0_0x36ab34(0x145)](_0x4417be,_0x3181fb){const _0x586882=a0_0x36ab34;return this[_0x586882(0x164)]('broadcast',{'message':_0x4417be,'filter_server':_0x3181fb?.[_0x586882(0x146)],'filter_status':_0x3181fb?.[_0x586882(0x140)]});}async[a0_0x36ab34(0x14e)](){const _0x5ad8b6=a0_0x36ab34;let _0x43c8d2=encodeURIComponent(this['alias']),_0x86e3a1=this[_0x5ad8b6(0x17e)]+'/events/'+_0x43c8d2,_0xe3497a=this[_0x5ad8b6(0x160)];while(this[_0x5ad8b6(0x170)]){try{this[_0x5ad8b6(0x184)]=new AbortController();let _0x3e4470={'Accept':'text/event-stream'};if(this[_0x5ad8b6(0x14a)])_0x3e4470[_0x5ad8b6(0x178)]=_0x5ad8b6(0x16c)+this[_0x5ad8b6(0x14a)];let _0x20fcd8=await fetch(_0x86e3a1,{'headers':_0x3e4470,'signal':this[_0x5ad8b6(0x184)][_0x5ad8b6(0x176)]});if(!_0x20fcd8['ok']||!_0x20fcd8['body']){this[_0x5ad8b6(0x14b)](_0x5ad8b6(0x138)+_0x20fcd8['status']),await this[_0x5ad8b6(0x13f)](_0xe3497a),_0xe3497a=Math[_0x5ad8b6(0x157)](_0xe3497a*1.5,0xea60);continue;}_0xe3497a=this[_0x5ad8b6(0x160)];let _0x17ba1d=_0x20fcd8['body'][_0x5ad8b6(0x182)](),_0x37edb3=new TextDecoder(),_0x460f54='';while(this[_0x5ad8b6(0x170)]){let {done:_0x3694df,value:_0x573143}=await _0x17ba1d[_0x5ad8b6(0x187)]();if(_0x3694df)break;_0x460f54+=_0x37edb3[_0x5ad8b6(0x13c)](_0x573143,{'stream':!0x0});let _0x1de025=_0x460f54[_0x5ad8b6(0x147)]('\x0a');_0x460f54=_0x1de025[_0x5ad8b6(0x13e)]()||'';for(let _0x5ac659 of _0x1de025){if(!_0x5ac659[_0x5ad8b6(0x144)](_0x5ad8b6(0x17f)))continue;try{let _0x4e0b86=JSON['parse'](_0x5ac659[_0x5ad8b6(0x16b)](0x6));if(_0x4e0b86['type']===_0x5ad8b6(0x15b)){this['log']('SSE\x20connected'),this[_0x5ad8b6(0x179)]('connected');continue;}if(_0x4e0b86[_0x5ad8b6(0x16d)]===_0x5ad8b6(0x181)||_0x4e0b86[_0x5ad8b6(0x16d)]===_0x5ad8b6(0x186)||_0x4e0b86[_0x5ad8b6(0x16d)]===_0x5ad8b6(0x145))await this[_0x5ad8b6(0x163)]();}catch{}}}}catch(_0x1b83d8){if(_0x1b83d8[_0x5ad8b6(0x14f)]==='AbortError')break;this[_0x5ad8b6(0x179)](_0x5ad8b6(0x183),_0x1b83d8),this[_0x5ad8b6(0x14b)](_0x5ad8b6(0x16e)+_0x1b83d8['message']);}if(this['running'])this[_0x5ad8b6(0x179)](_0x5ad8b6(0x174)),this[_0x5ad8b6(0x14b)](_0x5ad8b6(0x177)+_0xe3497a/0x3e8+_0x5ad8b6(0x135)),await this['sleep'](_0xe3497a),_0xe3497a=Math['min'](_0xe3497a*1.5,0xea60);}}async[a0_0x36ab34(0x163)](){const _0x1978f9=a0_0x36ab34;try{let _0x3be511=(await this[_0x1978f9(0x164)]('get_inbox',{'alias':this[_0x1978f9(0x15f)],'limit':0xa}))?.[_0x1978f9(0x15e)]||[];for(let _0x5e6678 of _0x3be511)await this[_0x1978f9(0x164)]('ack_inbox',{'alias':this[_0x1978f9(0x15f)],'message_id':_0x5e6678['id']}),this['log']('←\x20'+_0x5e6678[_0x1978f9(0x155)]+':\x20'+_0x5e6678[_0x1978f9(0x13a)][_0x1978f9(0x16b)](0x0,0x3c)),this['emit'](_0x1978f9(0x15c),_0x5e6678),this[_0x1978f9(0x179)]('message',_0x5e6678);}catch(_0x5174c4){this['log']('inbox\x20error:\x20'+_0x5174c4['message']);}}[a0_0x36ab34(0x13f)](_0xd48943){return new Promise(_0x4fc8b8=>setTimeout(_0x4fc8b8,_0xd48943));}}var $=T;export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x8f5148=a0_0x4b72;(function(_0x410aac,_0x5c7db5){const _0xd4b7b8=a0_0x4b72,_0x44cb21=_0x410aac();while(!![]){try{const _0x1edbb6=parseInt(_0xd4b7b8(0x17d))/0x1+parseInt(_0xd4b7b8(0x142))/0x2*(-parseInt(_0xd4b7b8(0x116))/0x3)+-parseInt(_0xd4b7b8(0x11f))/0x4+parseInt(_0xd4b7b8(0x118))/0x5*(parseInt(_0xd4b7b8(0x149))/0x6)+-parseInt(_0xd4b7b8(0x128))/0x7*(parseInt(_0xd4b7b8(0x161))/0x8)+-parseInt(_0xd4b7b8(0x158))/0x9*(-parseInt(_0xd4b7b8(0x12c))/0xa)+parseInt(_0xd4b7b8(0x159))/0xb;if(_0x1edbb6===_0x5c7db5)break;else _0x44cb21['push'](_0x44cb21['shift']());}catch(_0x4e07be){_0x44cb21['push'](_0x44cb21['shift']());}}}(a0_0x2617,0xbc72a));import{readFileSync as a0_0x379490,existsSync as a0_0x22d452}from'fs';import{join as a0_0x6acbd1}from'path';import{hostname as a0_0x5a5035}from'os';import{execSync as a0_0xf25e4}from'child_process';import{Server as a0_0xc142c6}from'@modelcontextprotocol/sdk/server/index.js';function a0_0x4b72(_0x2fa39b,_0x2c6f08){_0x2fa39b=_0x2fa39b-0x101;const _0x261724=a0_0x2617();let _0x4b72ab=_0x261724[_0x2fa39b];return _0x4b72ab;}import{StdioServerTransport as a0_0x31bc95}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x2bee81,CallToolRequestSchema as a0_0x560778}from'@modelcontextprotocol/sdk/types.js';function p(_0x12245f){const _0x4db61e=a0_0x4b72;if(!a0_0x22d452(_0x12245f))return;for(let _0x1d5bc5 of a0_0x379490(_0x12245f,'utf-8')[_0x4db61e(0x134)]('\x0a')){let _0x13db54=_0x1d5bc5[_0x4db61e(0x17f)]();if(!_0x13db54||_0x13db54[_0x4db61e(0x160)]('#'))continue;let _0x5a0081=_0x13db54[_0x4db61e(0x16c)]('=');if(_0x5a0081<0x0)continue;let _0x4205a9=_0x13db54[_0x4db61e(0x173)](0x0,_0x5a0081)['trim'](),_0x2b9ef8=_0x13db54[_0x4db61e(0x173)](_0x5a0081+0x1)['trim']()['replace'](/^["']|["']$/g,'');if(!process.env[_0x4205a9])process.env[_0x4205a9]=_0x2b9ef8;}}var C=process.env.HOME||'~',T=a0_0x6acbd1(C,a0_0x8f5148(0x16e));p(a0_0x6acbd1(T,a0_0x8f5148(0x185)));var L=process['cwd']()[a0_0x8f5148(0x169)](/\//g,'-');p(a0_0x6acbd1(T,L,a0_0x8f5148(0x185)));function U(){const _0x14e771=a0_0x8f5148;try{return a0_0xf25e4(_0x14e771(0x11e),{'encoding':_0x14e771(0x171),'timeout':0x7d0})[_0x14e771(0x17f)]();}catch{return'';}}function c(){const _0x333dc2=a0_0x8f5148;try{let _0x32f5fb=a0_0x6acbd1(C,'.anet',_0x333dc2(0x176));if(a0_0x22d452(_0x32f5fb))return JSON['parse'](a0_0x379490(_0x32f5fb,_0x333dc2(0x171)));}catch{}return{};}var H=c(),D=process.env.COMMHUB_URL||H[a0_0x8f5148(0x172)]||'http://127.0.0.1:9200',f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0x5a5035(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto[a0_0x8f5148(0x10d)](),X=process.env.COMMHUB_TOKEN||H[a0_0x8f5148(0x110)]||'';function Y(_0x15c34c){const _0x529256=a0_0x8f5148;let _0x245644=new Date()[_0x529256(0x146)]()['slice'](0x0,0x8);process[_0x529256(0x147)]['write']('['+_0x245644+']\x20[commhub]\x20'+_0x15c34c+'\x0a');}function h(_0x42ec53){return new Promise(_0x2d0228=>setTimeout(_0x2d0228,_0x42ec53));}Y('ENV:\x20URL='+D+'\x20ALIAS='+Z+a0_0x8f5148(0x109)+w[a0_0x8f5148(0x173)](0x0,0x8)+'...\x20TMUX='+(f||'none')+a0_0x8f5148(0x127)+process['cwd']()+a0_0x8f5148(0x17a)+L);var k=new Map(),K=new a0_0xc142c6({'name':a0_0x8f5148(0x113),'version':'0.3.0'},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':['Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.',a0_0x8f5148(0x181),a0_0x8f5148(0x108),a0_0x8f5148(0x140)+Z]['join']('\x0a')});K[a0_0x8f5148(0x13c)](a0_0x2bee81,async()=>({'tools':[{'name':a0_0x8f5148(0x141),'description':a0_0x8f5148(0x178),'inputSchema':{'type':a0_0x8f5148(0x179),'properties':{'task_id':{'type':'string','description':'The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)'},'text':{'type':a0_0x8f5148(0x11c),'description':'Reply\x20text\x20/\x20result\x20summary'},'status':{'type':a0_0x8f5148(0x11c),'enum':['completed',a0_0x8f5148(0x17b),'cancelled',a0_0x8f5148(0x180),a0_0x8f5148(0x12d),'in_progress'],'description':a0_0x8f5148(0x104)}},'required':[a0_0x8f5148(0x151)]}},{'name':a0_0x8f5148(0x105),'description':a0_0x8f5148(0x15f),'inputSchema':{'type':a0_0x8f5148(0x179),'properties':{'status':{'type':a0_0x8f5148(0x11c),'enum':[a0_0x8f5148(0x13d),a0_0x8f5148(0x162),a0_0x8f5148(0x180),a0_0x8f5148(0x12d)]},'task':{'type':'string','description':'Current\x20task\x20description'},'progress':{'type':a0_0x8f5148(0x14d),'description':a0_0x8f5148(0x102)}},'required':[a0_0x8f5148(0x124)]}},{'name':'commhub_send_task','description':a0_0x8f5148(0x119),'inputSchema':{'type':a0_0x8f5148(0x179),'properties':{'alias':{'type':a0_0x8f5148(0x11c),'description':a0_0x8f5148(0x117)},'task':{'type':'string','description':'Task\x20content'},'priority':{'type':'string','enum':[a0_0x8f5148(0x12e),a0_0x8f5148(0x13e),'low'],'description':a0_0x8f5148(0x12b)}},'required':['alias','task']}},{'name':a0_0x8f5148(0x10c),'description':'Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','inputSchema':{'type':a0_0x8f5148(0x179),'properties':{'alias':{'type':'string','description':a0_0x8f5148(0x117)},'message':{'type':a0_0x8f5148(0x11c),'description':a0_0x8f5148(0x175)}},'required':[a0_0x8f5148(0x137),'message']}},{'name':a0_0x8f5148(0x154),'description':a0_0x8f5148(0x15a),'inputSchema':{'type':a0_0x8f5148(0x179),'properties':{}}}]}));function a0_0x2617(){const _0x528bee=['split','pop','parse','alias','POST','Authorization','SSE\x20connection\x20error:\x20','←\x20message\x20from\x20','setRequestHandler','working','normal','stringify','Session\x20alias:\x20','commhub_reply','524OFnJqH','body','warning:\x20could\x20not\x20register:\x20','init\x20failed:\x20','toTimeString','stderr',':\x20inbox_count=','1781922aXwBLv','notification','/mcp','from_session','number','\x20priority=','get','SIGTERM','text','send_task','shutting\x20down,\x20reporting\x20offline...','commhub_get_all_status','SIGINT','cancelled','parse\x20error:\x20','441hRhbfQ','1944679FSkmpX','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','result','message','connect','params','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','startsWith','896lfiNfW','idle','cwd','decode','heartbeat\x20failed:\x20','application/json,\x20text/event-stream','priority','SSE\x20error:\x20','replace','length','Bearer\x20','indexOf','statusText','.claude/channels/commhub','SSE\x20fatal:\x20','connecting\x20to\x20','utf-8','hub','slice','find','Message\x20content','config.json','2025-03-26','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','object','\x20PROJECT_ENV=','failed','/events/','631669DvsJNr','completed','trim','blocked','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','fatal:\x20','ack_inbox','\x20from\x20','.env','messages','Progress\x200-100','get_all_status','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','commhub_report_status','connected','data:\x20','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','\x20RESUME_ID=','from','end','commhub_send_message','randomUUID','delete','\x22\x20(','token','SSE\x20stream\x20ended,\x20reconnecting...','report_status','commhub-channel','session\x20disconnected','claude-code','13077SbeSTk','Target\x20session\x20alias','10EvMYmO','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','new_task','application/json','string','get_inbox','tmux\x20display-message\x20-p\x20\x27#S\x27','2422376FiirQP','registered\x20as\x20\x22','catch','unknown\x20tool','commhub','status','SSE\x20connected\x20as\x20\x22','message_id','\x20CWD=','9947UUvIrh','exit','content','Priority\x20(default:\x20normal)','260460VvUxmi','error','high','getReader','type','0.3.0','initialize','→\x20injected\x20task\x20'];a0_0x2617=function(){return _0x528bee;};return a0_0x2617();}async function P(_0x553794,_0xb39268){const _0x1b9134=a0_0x8f5148;let _0x129c28=await fetch(D+'/mcp',{'method':_0x1b9134(0x138),'headers':{'Content-Type':_0x1b9134(0x11b),'Accept':_0x1b9134(0x166),...X?{'Authorization':_0x1b9134(0x16b)+X}:{}},'body':JSON[_0x1b9134(0x13f)]({'jsonrpc':'2.0','id':0x1,'method':_0x1b9134(0x132),'params':{'protocolVersion':_0x1b9134(0x177),'capabilities':{},'clientInfo':{'name':'commhub-channel','version':_0x1b9134(0x131)}}})});if(!_0x129c28['ok']){let _0x5d67ea=await _0x129c28['text']();return Y('CommHub\x20init\x20failed:\x20'+_0x129c28['status']+'\x20'+_0x5d67ea[_0x1b9134(0x173)](0x0,0x64)),{'ok':!0x1,'error':_0x1b9134(0x145)+_0x129c28[_0x1b9134(0x124)]};}await _0x129c28['text']();let _0x25eb11=(await(await fetch(D+_0x1b9134(0x14b),{'method':_0x1b9134(0x138),'headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x1b9134(0x16b)+X}:{}},'body':JSON['stringify']({'jsonrpc':'2.0','id':0x2,'method':'tools/call','params':{'name':_0x553794,'arguments':_0xb39268}})}))['text']())[_0x1b9134(0x134)]('\x0a')[_0x1b9134(0x174)](_0x10a2ba=>_0x10a2ba[_0x1b9134(0x160)](_0x1b9134(0x107)));if(_0x25eb11){let _0x74ef94=JSON['parse'](_0x25eb11[_0x1b9134(0x173)](0x6));return _0x74ef94?.[_0x1b9134(0x15b)]?.['content']?.[0x0]?.[_0x1b9134(0x151)]?JSON[_0x1b9134(0x136)](_0x74ef94[_0x1b9134(0x15b)][_0x1b9134(0x12a)][0x0][_0x1b9134(0x151)]):_0x74ef94;}return{'ok':!0x1,'error':'no\x20response'};}K[a0_0x8f5148(0x13c)](a0_0x560778,async _0x43cbac=>{const _0x42a343=a0_0x8f5148;let {name:_0x2da5f8,arguments:_0x46f44d}=_0x43cbac[_0x42a343(0x15e)];if(_0x2da5f8===_0x42a343(0x141)){let {task_id:_0x50b4a6,text:_0x3e980e,status:_0xbec38c}=_0x46f44d;if(_0xbec38c===_0x42a343(0x17e)||_0xbec38c===_0x42a343(0x17b)||_0xbec38c===_0x42a343(0x156)){let _0x58c305=_0xbec38c===_0x42a343(0x17e)?'replied':_0xbec38c,_0x443479=_0x50b4a6?k[_0x42a343(0x14f)](_0x50b4a6)||_0x42a343(0x172):_0x42a343(0x172),_0x14b40b=await P('send_reply',{'alias':_0x443479,'text':_0x3e980e,'in_reply_to':_0x50b4a6||void 0x0,'status':_0x58c305,'from_session':Z});if(_0x50b4a6)k[_0x42a343(0x10e)](_0x50b4a6);return{'content':[{'type':_0x42a343(0x151),'text':JSON[_0x42a343(0x13f)](_0x14b40b)}]};}let _0xea060a=await P(_0x42a343(0x112),{'resume_id':w,'alias':Z,'status':_0xbec38c===_0x42a343(0x180)?_0x42a343(0x180):_0xbec38c===_0x42a343(0x12d)?_0x42a343(0x12d):_0x42a343(0x13d),'task':_0x3e980e[_0x42a343(0x173)](0x0,0xc8),'output':_0x3e980e});return{'content':[{'type':'text','text':JSON[_0x42a343(0x13f)](_0xea060a)}]};}if(_0x2da5f8==='commhub_report_status'){let {status:_0x47fac5,task:_0x3f6529,progress:_0x24c30c}=_0x46f44d,_0x400597=await P(_0x42a343(0x112),{'resume_id':w,'alias':Z,'status':_0x47fac5,'task':_0x3f6529,'progress':_0x24c30c});return{'content':[{'type':_0x42a343(0x151),'text':JSON['stringify'](_0x400597)}]};}if(_0x2da5f8==='commhub_send_task'){let {alias:_0x1ffbc1,task:_0x23c88a,priority:_0x4af3d2}=_0x46f44d,_0x303055=await P(_0x42a343(0x152),{'alias':_0x1ffbc1,'task':_0x23c88a,'priority':_0x4af3d2||_0x42a343(0x13e),'from_session':Z});return{'content':[{'type':_0x42a343(0x151),'text':JSON[_0x42a343(0x13f)](_0x303055)}]};}if(_0x2da5f8===_0x42a343(0x10c)){let {alias:_0xa67442,message:_0x41c79d}=_0x46f44d,_0x1544be=await P('send_message',{'alias':_0xa67442,'message':_0x41c79d,'from_session':Z});return{'content':[{'type':_0x42a343(0x151),'text':JSON[_0x42a343(0x13f)](_0x1544be)}]};}if(_0x2da5f8==='commhub_get_all_status'){let _0x544f9d=await P(_0x42a343(0x103),{});return{'content':[{'type':_0x42a343(0x151),'text':JSON['stringify'](_0x544f9d)}]};}return{'content':[{'type':_0x42a343(0x151),'text':JSON[_0x42a343(0x13f)]({'error':_0x42a343(0x122)})}]};});async function v(){const _0x8ff8d8=a0_0x8f5148;let _0x2e684a=D+_0x8ff8d8(0x17c)+encodeURIComponent(Z),_0x19d823={};if(X)_0x19d823[_0x8ff8d8(0x139)]=_0x8ff8d8(0x16b)+X;Y(_0x8ff8d8(0x170)+_0x2e684a);while(!0x0){try{let _0x5bbe46=await fetch(_0x2e684a,{'headers':_0x19d823});if(!_0x5bbe46['ok']){Y(_0x8ff8d8(0x168)+_0x5bbe46[_0x8ff8d8(0x124)]+'\x20'+_0x5bbe46[_0x8ff8d8(0x16d)]),await h(0x1388);continue;}let _0x11b1b0=_0x5bbe46[_0x8ff8d8(0x143)][_0x8ff8d8(0x12f)](),_0xbe5f7f=new TextDecoder(),_0x361922='';while(!0x0){let {done:_0x33f4d7,value:_0x5d6d7b}=await _0x11b1b0['read']();if(_0x33f4d7)break;_0x361922+=_0xbe5f7f[_0x8ff8d8(0x164)](_0x5d6d7b,{'stream':!0x0});let _0x4ce829=_0x361922[_0x8ff8d8(0x134)]('\x0a\x0a');_0x361922=_0x4ce829[_0x8ff8d8(0x135)]()||'';for(let _0x56ac56 of _0x4ce829){let _0x4fdd73=_0x56ac56['split']('\x0a')[_0x8ff8d8(0x174)](_0x5db761=>_0x5db761['startsWith'](_0x8ff8d8(0x107)));if(!_0x4fdd73)continue;try{let _0x31d00e=JSON[_0x8ff8d8(0x136)](_0x4fdd73[_0x8ff8d8(0x173)](0x6));await u(_0x31d00e);}catch(_0x51b953){Y(_0x8ff8d8(0x157)+_0x51b953);}}}Y(_0x8ff8d8(0x111));}catch(_0x51034f){Y(_0x8ff8d8(0x13a)+_0x51034f);}await h(0xbb8);}}async function u(_0x22e2a6){const _0x36ec29=a0_0x8f5148;if(_0x22e2a6[_0x36ec29(0x130)]===_0x36ec29(0x106)){Y(_0x36ec29(0x125)+Z+'\x22');return;}if(_0x22e2a6[_0x36ec29(0x130)]==='new_message'){if(Y(_0x36ec29(0x13b)+_0x22e2a6['from']+':\x20'+_0x22e2a6[_0x36ec29(0x15c)][_0x36ec29(0x173)](0x0,0x3c)),await K[_0x36ec29(0x14a)]({'method':'notifications/claude/channel','params':{'content':_0x22e2a6['message'],'meta':{'sender':_0x22e2a6[_0x36ec29(0x10a)]||_0x36ec29(0x172),'sender_id':_0x36ec29(0x123),'user':_0x22e2a6['from']||'hub','priority':_0x36ec29(0x13e)}}}),_0x22e2a6[_0x36ec29(0x126)])await P(_0x36ec29(0x183),{'alias':Z,'message_id':_0x22e2a6['message_id']});return;}if(_0x22e2a6[_0x36ec29(0x130)]===_0x36ec29(0x11a)||_0x22e2a6[_0x36ec29(0x130)]==='broadcast'){Y('←\x20'+_0x22e2a6[_0x36ec29(0x130)]+_0x36ec29(0x148)+_0x22e2a6['inbox_count']+_0x36ec29(0x14e)+(_0x22e2a6[_0x36ec29(0x167)]||_0x36ec29(0x13e)));let _0x3ff92e=await P(_0x36ec29(0x11d),{'alias':Z,'limit':0x5});if(_0x3ff92e?.['ok']&&_0x3ff92e['messages']?.[_0x36ec29(0x16a)]>0x0)for(let _0x318742 of _0x3ff92e[_0x36ec29(0x101)]){let _0x18ee95={'sender':_0x318742['from_session']||_0x36ec29(0x172),'sender_id':_0x36ec29(0x123),'user':_0x318742[_0x36ec29(0x14c)]||'hub','task_id':_0x318742['id'],'priority':_0x318742[_0x36ec29(0x167)]||_0x36ec29(0x13e)};k['set'](_0x318742['id'],_0x318742[_0x36ec29(0x14c)]||'hub'),await K['notification']({'method':'notifications/claude/channel','params':{'content':_0x318742[_0x36ec29(0x12a)],'meta':_0x18ee95}}),Y(_0x36ec29(0x133)+_0x318742['id'][_0x36ec29(0x173)](0x0,0x8)+_0x36ec29(0x184)+_0x318742[_0x36ec29(0x14c)]+':\x20'+_0x318742[_0x36ec29(0x12a)][_0x36ec29(0x173)](0x0,0x3c)),await P(_0x36ec29(0x183),{'alias':Z,'message_id':_0x318742['id']});}}}async function S(){const _0x2e29e2=a0_0x8f5148;let _0x1ff477=new a0_0x31bc95();await K[_0x2e29e2(0x15d)](_0x1ff477),Y('MCP\x20stdio\x20connected'),Y('starting\x20SSE\x20listener...'),v()[_0x2e29e2(0x121)](_0xb7d3ee=>Y(_0x2e29e2(0x16f)+_0xb7d3ee)),P(_0x2e29e2(0x112),{'resume_id':w,'alias':Z,'status':_0x2e29e2(0x162),'server':a0_0x5a5035(),'hostname':a0_0x5a5035(),'agent':_0x2e29e2(0x115),'project_dir':process['cwd'](),'tmux_name':f||void 0x0})['then'](()=>Y(_0x2e29e2(0x120)+Z+_0x2e29e2(0x10f)+w[_0x2e29e2(0x173)](0x0,0x8)+')'))[_0x2e29e2(0x121)](_0x5edfe7=>Y(_0x2e29e2(0x144)+_0x5edfe7)),setInterval(()=>{const _0x2f0fc4=_0x2e29e2;P(_0x2f0fc4(0x112),{'resume_id':w,'alias':Z,'status':_0x2f0fc4(0x162),'server':a0_0x5a5035(),'hostname':a0_0x5a5035(),'agent':_0x2f0fc4(0x115),'project_dir':process[_0x2f0fc4(0x163)](),'tmux_name':f||void 0x0})[_0x2f0fc4(0x121)](_0x551feb=>Y(_0x2f0fc4(0x165)+_0x551feb));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}S()[a0_0x8f5148(0x121)](_0x23a8c0=>{const _0x50c420=a0_0x8f5148;Y(_0x50c420(0x182)+_0x23a8c0),process['exit'](0x1);});async function N(){const _0x5f35a5=a0_0x8f5148;Y(_0x5f35a5(0x153)),await P(_0x5f35a5(0x112),{'resume_id':w,'alias':Z,'status':_0x5f35a5(0x12d),'task':_0x5f35a5(0x114)})['catch'](()=>{}),process[_0x5f35a5(0x129)](0x0);}process['stdin']['on'](a0_0x8f5148(0x10b),()=>N()),process['on'](a0_0x8f5148(0x150),()=>N()),process['on'](a0_0x8f5148(0x155),()=>N());
2
+ const a0_0x4cd9f4=a0_0x2d3e;(function(_0x2a627f,_0x162a7a){const _0x63bbab=a0_0x2d3e,_0x37cee6=_0x2a627f();while(!![]){try{const _0x47c163=parseInt(_0x63bbab(0x121))/0x1+-parseInt(_0x63bbab(0x129))/0x2+-parseInt(_0x63bbab(0x161))/0x3*(parseInt(_0x63bbab(0x145))/0x4)+-parseInt(_0x63bbab(0x162))/0x5+-parseInt(_0x63bbab(0x111))/0x6*(-parseInt(_0x63bbab(0x168))/0x7)+-parseInt(_0x63bbab(0x13a))/0x8+-parseInt(_0x63bbab(0x130))/0x9*(-parseInt(_0x63bbab(0xec))/0xa);if(_0x47c163===_0x162a7a)break;else _0x37cee6['push'](_0x37cee6['shift']());}catch(_0x5546e9){_0x37cee6['push'](_0x37cee6['shift']());}}}(a0_0x3dfe,0x5f4ac));import{readFileSync as a0_0x2fcac7,existsSync as a0_0x1835f5}from'fs';import{join as a0_0x1a91bb}from'path';import{hostname as a0_0x9beab3}from'os';import{execSync as a0_0x10b91e}from'child_process';import{Server as a0_0x4db401}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x4f6eea}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0xbaa772,CallToolRequestSchema as a0_0x3fbd43}from'@modelcontextprotocol/sdk/types.js';function p(_0x3d7e87){const _0x1d1433=a0_0x2d3e;if(!a0_0x1835f5(_0x3d7e87))return;for(let _0x659040 of a0_0x2fcac7(_0x3d7e87,_0x1d1433(0xf6))[_0x1d1433(0x106)]('\x0a')){let _0x22c4b7=_0x659040[_0x1d1433(0xf9)]();if(!_0x22c4b7||_0x22c4b7[_0x1d1433(0x108)]('#'))continue;let _0x221299=_0x22c4b7[_0x1d1433(0x160)]('=');if(_0x221299<0x0)continue;let _0x863dff=_0x22c4b7[_0x1d1433(0x153)](0x0,_0x221299)[_0x1d1433(0xf9)](),_0x4ef7a6=_0x22c4b7[_0x1d1433(0x153)](_0x221299+0x1)['trim']()[_0x1d1433(0x126)](/^["']|["']$/g,'');if(!process.env[_0x863dff])process.env[_0x863dff]=_0x4ef7a6;}}var C=process.env.HOME||'~',T=a0_0x1a91bb(C,'.claude/channels/commhub');p(a0_0x1a91bb(T,'.env'));var L=process[a0_0x4cd9f4(0x14d)]()[a0_0x4cd9f4(0x126)](/\//g,'-');p(a0_0x1a91bb(T,L,'.env'));function U(){const _0x1c271d=a0_0x4cd9f4;try{return a0_0x10b91e('tmux\x20display-message\x20-p\x20\x27#S\x27',{'encoding':_0x1c271d(0xf6),'timeout':0x7d0})['trim']();}catch{return'';}}function c(){const _0x54ba6f=a0_0x4cd9f4;try{let _0x5b07e4=a0_0x1a91bb(C,_0x54ba6f(0xf5),_0x54ba6f(0x146));if(a0_0x1835f5(_0x5b07e4))return JSON[_0x54ba6f(0x134)](a0_0x2fcac7(_0x5b07e4,'utf-8'));}catch{}return{};}var H=c(),D=process.env.COMMHUB_URL||H[a0_0x4cd9f4(0x15c)]||a0_0x4cd9f4(0x136),f=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||f||a0_0x9beab3(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||crypto[a0_0x4cd9f4(0x140)](),X=process.env.COMMHUB_TOKEN||H[a0_0x4cd9f4(0xe0)]||'';function Y(_0x4331a3){const _0x5d6107=a0_0x4cd9f4;let _0x5cb230=new Date()[_0x5d6107(0x11c)]()[_0x5d6107(0x153)](0x0,0x8);process['stderr']['write']('['+_0x5cb230+_0x5d6107(0xe6)+_0x4331a3+'\x0a');}function h(_0x4c303c){return new Promise(_0x556a23=>setTimeout(_0x556a23,_0x4c303c));}Y('ENV:\x20URL='+D+'\x20ALIAS='+Z+a0_0x4cd9f4(0x139)+w[a0_0x4cd9f4(0x153)](0x0,0x8)+a0_0x4cd9f4(0x14f)+(f||a0_0x4cd9f4(0xfb))+a0_0x4cd9f4(0xe2)+process[a0_0x4cd9f4(0x14d)]()+a0_0x4cd9f4(0x11e)+L);var k=new Map(),K=new a0_0x4db401({'name':a0_0x4cd9f4(0x15d),'version':a0_0x4cd9f4(0x158)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':['Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>',a0_0x4cd9f4(0x16c),a0_0x4cd9f4(0x15a),'You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.',a0_0x4cd9f4(0x118)+Z]['join']('\x0a')});K[a0_0x4cd9f4(0x15e)](a0_0xbaa772,async()=>({'tools':[{'name':a0_0x4cd9f4(0xed),'description':a0_0x4cd9f4(0x113),'inputSchema':{'type':a0_0x4cd9f4(0x12d),'properties':{'task_id':{'type':a0_0x4cd9f4(0x12a),'description':'The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)'},'text':{'type':a0_0x4cd9f4(0x12a),'description':'Reply\x20text\x20/\x20result\x20summary'},'status':{'type':a0_0x4cd9f4(0x12a),'enum':[a0_0x4cd9f4(0x144),a0_0x4cd9f4(0x116),a0_0x4cd9f4(0xfe),a0_0x4cd9f4(0x148),a0_0x4cd9f4(0xe1),a0_0x4cd9f4(0x11d)],'description':a0_0x4cd9f4(0xf1)}},'required':[a0_0x4cd9f4(0x150)]}},{'name':a0_0x4cd9f4(0xeb),'description':a0_0x4cd9f4(0x115),'inputSchema':{'type':a0_0x4cd9f4(0x12d),'properties':{'status':{'type':a0_0x4cd9f4(0x12a),'enum':['working',a0_0x4cd9f4(0x12e),a0_0x4cd9f4(0x148),'error']},'task':{'type':'string','description':a0_0x4cd9f4(0x114)},'progress':{'type':a0_0x4cd9f4(0x10e),'description':a0_0x4cd9f4(0x100)}},'required':[a0_0x4cd9f4(0x117)]}},{'name':'commhub_send_task','description':a0_0x4cd9f4(0xf0),'inputSchema':{'type':a0_0x4cd9f4(0x12d),'properties':{'alias':{'type':a0_0x4cd9f4(0x12a),'description':a0_0x4cd9f4(0xe5)},'task':{'type':'string','description':a0_0x4cd9f4(0xf3)},'priority':{'type':a0_0x4cd9f4(0x12a),'enum':[a0_0x4cd9f4(0x163),a0_0x4cd9f4(0x16b),a0_0x4cd9f4(0x10f)],'description':'Priority\x20(default:\x20normal)'}},'required':[a0_0x4cd9f4(0xfc),a0_0x4cd9f4(0x157)]}},{'name':a0_0x4cd9f4(0x13f),'description':a0_0x4cd9f4(0xdf),'inputSchema':{'type':a0_0x4cd9f4(0x12d),'properties':{'alias':{'type':a0_0x4cd9f4(0x12a),'description':a0_0x4cd9f4(0xe5)},'message':{'type':a0_0x4cd9f4(0x12a),'description':'Message\x20content'}},'required':[a0_0x4cd9f4(0xfc),a0_0x4cd9f4(0x11f)]}},{'name':'commhub_get_all_status','description':a0_0x4cd9f4(0x16a),'inputSchema':{'type':'object','properties':{}}}]}));async function P(_0x347b8f,_0x5aed85){const _0x31760d=a0_0x4cd9f4;let _0x531cf2=await fetch(D+'/mcp',{'method':_0x31760d(0x142),'headers':{'Content-Type':'application/json','Accept':_0x31760d(0xf8),...X?{'Authorization':_0x31760d(0x124)+X}:{}},'body':JSON[_0x31760d(0x107)]({'jsonrpc':_0x31760d(0x102),'id':0x1,'method':_0x31760d(0x10c),'params':{'protocolVersion':_0x31760d(0x14b),'capabilities':{},'clientInfo':{'name':_0x31760d(0x15d),'version':'0.3.0'}}})});if(!_0x531cf2['ok']){let _0x3984a7=await _0x531cf2['text']();return Y(_0x31760d(0x123)+_0x531cf2[_0x31760d(0x117)]+'\x20'+_0x3984a7[_0x31760d(0x153)](0x0,0x64)),{'ok':!0x1,'error':'init\x20failed:\x20'+_0x531cf2[_0x31760d(0x117)]};}await _0x531cf2[_0x31760d(0x150)]();let _0x155395=(await(await fetch(D+_0x31760d(0x164),{'method':'POST','headers':{'Content-Type':_0x31760d(0x120),'Accept':_0x31760d(0xf8),...X?{'Authorization':_0x31760d(0x124)+X}:{}},'body':JSON[_0x31760d(0x107)]({'jsonrpc':_0x31760d(0x102),'id':0x2,'method':_0x31760d(0x143),'params':{'name':_0x347b8f,'arguments':_0x5aed85}})}))[_0x31760d(0x150)]())[_0x31760d(0x106)]('\x0a')[_0x31760d(0xf2)](_0x1c6dad=>_0x1c6dad[_0x31760d(0x108)](_0x31760d(0xe9)));if(_0x155395){let _0x2748bb=JSON['parse'](_0x155395[_0x31760d(0x153)](0x6));return _0x2748bb?.[_0x31760d(0x131)]?.[_0x31760d(0x12b)]?.[0x0]?.[_0x31760d(0x150)]?JSON['parse'](_0x2748bb[_0x31760d(0x131)]['content'][0x0][_0x31760d(0x150)]):_0x2748bb;}return{'ok':!0x1,'error':_0x31760d(0x166)};}K[a0_0x4cd9f4(0x15e)](a0_0x3fbd43,async _0x33c14e=>{const _0x71c58e=a0_0x4cd9f4;let {name:_0x30913f,arguments:_0x1a0210}=_0x33c14e['params'];if(_0x30913f==='commhub_reply'){let {task_id:_0x2e6cb8,text:_0x3f5db0,status:_0x2fde4a}=_0x1a0210;if(_0x2fde4a===_0x71c58e(0x144)||_0x2fde4a===_0x71c58e(0x116)||_0x2fde4a===_0x71c58e(0xfe)){let _0x589092=_0x2fde4a===_0x71c58e(0x144)?_0x71c58e(0x169):_0x2fde4a,_0x42cebd=_0x2e6cb8?k['get'](_0x2e6cb8)||'hub':'hub',_0x3ec591=await P(_0x71c58e(0xff),{'alias':_0x42cebd,'text':_0x3f5db0,'in_reply_to':_0x2e6cb8||void 0x0,'status':_0x589092,'from_session':Z});if(_0x2e6cb8)k[_0x71c58e(0x14c)](_0x2e6cb8);return{'content':[{'type':'text','text':JSON['stringify'](_0x3ec591)}]};}let _0x5c0dfe=await P(_0x71c58e(0x103),{'resume_id':w,'alias':Z,'status':_0x2fde4a===_0x71c58e(0x148)?'blocked':_0x2fde4a==='error'?_0x71c58e(0xe1):_0x71c58e(0xea),'task':_0x3f5db0[_0x71c58e(0x153)](0x0,0xc8),'output':_0x3f5db0});return{'content':[{'type':_0x71c58e(0x150),'text':JSON[_0x71c58e(0x107)](_0x5c0dfe)}]};}if(_0x30913f===_0x71c58e(0xeb)){let {status:_0x26e4c4,task:_0xb4a06b,progress:_0x44e1e4}=_0x1a0210,_0x3c1189=await P(_0x71c58e(0x103),{'resume_id':w,'alias':Z,'status':_0x26e4c4,'task':_0xb4a06b,'progress':_0x44e1e4});return{'content':[{'type':'text','text':JSON[_0x71c58e(0x107)](_0x3c1189)}]};}if(_0x30913f===_0x71c58e(0x165)){let {alias:_0x4f1be6,task:_0x4d6f5d,priority:_0x59c468}=_0x1a0210,_0x480bac=await P(_0x71c58e(0x137),{'alias':_0x4f1be6,'task':_0x4d6f5d,'priority':_0x59c468||_0x71c58e(0x16b),'from_session':Z});return{'content':[{'type':_0x71c58e(0x150),'text':JSON[_0x71c58e(0x107)](_0x480bac)}]};}if(_0x30913f===_0x71c58e(0x13f)){let {alias:_0x84ca52,message:_0xf0274d}=_0x1a0210,_0x5c90d5=await P(_0x71c58e(0x13e),{'alias':_0x84ca52,'message':_0xf0274d,'from_session':Z});return{'content':[{'type':_0x71c58e(0x150),'text':JSON[_0x71c58e(0x107)](_0x5c90d5)}]};}if(_0x30913f===_0x71c58e(0x13d)){let _0x23bc8c=await P('get_all_status',{});return{'content':[{'type':_0x71c58e(0x150),'text':JSON[_0x71c58e(0x107)](_0x23bc8c)}]};}return{'content':[{'type':_0x71c58e(0x150),'text':JSON['stringify']({'error':_0x71c58e(0x151)})}]};});async function v(){const _0x58f1a0=a0_0x4cd9f4;let _0x11b970=D+_0x58f1a0(0x132)+encodeURIComponent(Z),_0x233d84={};if(X)_0x233d84[_0x58f1a0(0xe3)]='Bearer\x20'+X;Y(_0x58f1a0(0x104)+_0x11b970);while(!0x0){try{let _0x2e73a6=await fetch(_0x11b970,{'headers':_0x233d84});if(!_0x2e73a6['ok']){Y('SSE\x20error:\x20'+_0x2e73a6[_0x58f1a0(0x117)]+'\x20'+_0x2e73a6[_0x58f1a0(0x125)]),await h(0x1388);continue;}let _0x5b4fcd=_0x2e73a6[_0x58f1a0(0x156)][_0x58f1a0(0xfa)](),_0x1a9204=new TextDecoder(),_0x28dbd9='';while(!0x0){let {done:_0x48bf9a,value:_0x28fa6a}=await _0x5b4fcd[_0x58f1a0(0xee)]();if(_0x48bf9a)break;_0x28dbd9+=_0x1a9204[_0x58f1a0(0x138)](_0x28fa6a,{'stream':!0x0});let _0x106209=_0x28dbd9['split']('\x0a\x0a');_0x28dbd9=_0x106209[_0x58f1a0(0x10a)]()||'';for(let _0x3162f1 of _0x106209){let _0x473762=_0x3162f1['split']('\x0a')[_0x58f1a0(0xf2)](_0x57bf52=>_0x57bf52[_0x58f1a0(0x108)](_0x58f1a0(0xe9)));if(!_0x473762)continue;try{let _0x164a58=JSON['parse'](_0x473762[_0x58f1a0(0x153)](0x6));await u(_0x164a58);}catch(_0x26b26d){Y(_0x58f1a0(0x127)+_0x26b26d);}}}Y('SSE\x20stream\x20ended,\x20reconnecting...');}catch(_0x1fe847){Y(_0x58f1a0(0x147)+_0x1fe847);}await h(0xbb8);}}async function u(_0x1efc1e){const _0x47606e=a0_0x4cd9f4;if(_0x1efc1e[_0x47606e(0x10b)]==='connected'){Y(_0x47606e(0xfd)+Z+'\x22');return;}if(_0x1efc1e[_0x47606e(0x10b)]===_0x47606e(0x128)){if(Y('←\x20message\x20from\x20'+_0x1efc1e[_0x47606e(0x141)]+':\x20'+_0x1efc1e[_0x47606e(0x11f)][_0x47606e(0x153)](0x0,0x3c)),await K[_0x47606e(0x154)]({'method':'notifications/claude/channel','params':{'content':_0x1efc1e[_0x47606e(0x11f)],'meta':{'sender':_0x1efc1e[_0x47606e(0x141)]||_0x47606e(0x15c),'sender_id':'commhub','user':_0x1efc1e[_0x47606e(0x141)]||_0x47606e(0x15c),'priority':_0x47606e(0x16b)}}}),_0x1efc1e[_0x47606e(0x122)])await P(_0x47606e(0x14a),{'alias':Z,'message_id':_0x1efc1e[_0x47606e(0x122)]});return;}if(_0x1efc1e['type']===_0x47606e(0x105)||_0x1efc1e['type']===_0x47606e(0x15b)){Y('←\x20'+_0x1efc1e['type']+_0x47606e(0xf7)+_0x1efc1e[_0x47606e(0x119)]+_0x47606e(0x10d)+(_0x1efc1e['priority']||_0x47606e(0x16b)));let _0x2c75bf=await P(_0x47606e(0x135),{'alias':Z,'limit':0x5});if(_0x2c75bf?.['ok']&&_0x2c75bf[_0x47606e(0x112)]?.[_0x47606e(0x155)]>0x0)for(let _0x57f731 of _0x2c75bf[_0x47606e(0x112)]){let _0x45afa0={'sender':_0x57f731[_0x47606e(0x159)]||_0x47606e(0x15c),'sender_id':'commhub','user':_0x57f731[_0x47606e(0x159)]||'hub','task_id':_0x57f731['id'],'priority':_0x57f731[_0x47606e(0x101)]||_0x47606e(0x16b)};k[_0x47606e(0x12f)](_0x57f731['id'],_0x57f731[_0x47606e(0x159)]||_0x47606e(0x15c)),await K['notification']({'method':_0x47606e(0x11a),'params':{'content':_0x57f731[_0x47606e(0x12b)],'meta':_0x45afa0}}),Y(_0x47606e(0x12c)+_0x57f731['id']['slice'](0x0,0x8)+_0x47606e(0x149)+_0x57f731[_0x47606e(0x159)]+':\x20'+_0x57f731[_0x47606e(0x12b)]['slice'](0x0,0x3c)),await P('ack_inbox',{'alias':Z,'message_id':_0x57f731['id']});}}}async function S(){const _0x51e1ad=a0_0x4cd9f4;let _0x463520=new a0_0x4f6eea();await K[_0x51e1ad(0x15f)](_0x463520),Y(_0x51e1ad(0x109)),Y(_0x51e1ad(0x152)),v()['catch'](_0x1f6443=>Y(_0x51e1ad(0x133)+_0x1f6443)),P(_0x51e1ad(0x103),{'resume_id':w,'alias':Z,'status':_0x51e1ad(0x12e),'server':a0_0x9beab3(),'hostname':a0_0x9beab3(),'agent':_0x51e1ad(0xe8),'project_dir':process['cwd'](),'tmux_name':f||void 0x0})[_0x51e1ad(0x11b)](()=>Y('registered\x20as\x20\x22'+Z+_0x51e1ad(0xde)+w[_0x51e1ad(0x153)](0x0,0x8)+')'))[_0x51e1ad(0xf4)](_0x2e8731=>Y(_0x51e1ad(0x110)+_0x2e8731)),setInterval(()=>{const _0x24a1a9=_0x51e1ad;P(_0x24a1a9(0x103),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x9beab3(),'hostname':a0_0x9beab3(),'agent':_0x24a1a9(0xe8),'project_dir':process[_0x24a1a9(0x14d)](),'tmux_name':f||void 0x0})['catch'](_0xd8cadc=>Y(_0x24a1a9(0x14e)+_0xd8cadc));},0x2bf20),Y('ready\x20—\x20waiting\x20for\x20events');}S()[a0_0x4cd9f4(0xf4)](_0x2a0d47=>{const _0x29c63a=a0_0x4cd9f4;Y(_0x29c63a(0xe4)+_0x2a0d47),process[_0x29c63a(0xe7)](0x1);});function a0_0x3dfe(){const _0x527cd6=['statusText','replace','parse\x20error:\x20','new_message','1299804xyhhHl','string','content','→\x20injected\x20task\x20','object','idle','set','22220271DdENPa','result','/events/','SSE\x20fatal:\x20','parse','get_inbox','http://127.0.0.1:9200','send_task','decode','\x20RESUME_ID=','5856728IWXGae','stdin','shutting\x20down,\x20reporting\x20offline...','commhub_get_all_status','send_message','commhub_send_message','randomUUID','from','POST','tools/call','completed','120xempOk','config.json','SSE\x20connection\x20error:\x20','blocked','\x20from\x20','ack_inbox','2025-03-26','delete','cwd','heartbeat\x20failed:\x20','...\x20TMUX=','text','unknown\x20tool','starting\x20SSE\x20listener...','slice','notification','length','body','task','0.3.0','from_session','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','broadcast','hub','commhub-channel','setRequestHandler','connect','indexOf','40047lFUExk','3878975scJVIz','high','/mcp','commhub_send_task','no\x20response','end','242326qPnsYH','replied','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','normal','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','\x22\x20(','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','token','error','\x20CWD=','Authorization','fatal:\x20','Target\x20session\x20alias',']\x20[commhub]\x20','exit','claude-code','data:\x20','working','commhub_report_status','10LDFDkQ','commhub_reply','read','session\x20disconnected','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','find','Task\x20content','catch','.anet','utf-8',':\x20inbox_count=','application/json,\x20text/event-stream','trim','getReader','none','alias','SSE\x20connected\x20as\x20\x22','cancelled','send_reply','Progress\x200-100','priority','2.0','report_status','connecting\x20to\x20','new_task','split','stringify','startsWith','MCP\x20stdio\x20connected','pop','type','initialize','\x20priority=','number','low','warning:\x20could\x20not\x20register:\x20','54xeFVPk','messages','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','Current\x20task\x20description','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','failed','status','Session\x20alias:\x20','inbox_count','notifications/claude/channel','then','toTimeString','in_progress','\x20PROJECT_ENV=','message','application/json','168093WMDWkP','message_id','CommHub\x20init\x20failed:\x20','Bearer\x20'];a0_0x3dfe=function(){return _0x527cd6;};return a0_0x3dfe();}function a0_0x2d3e(_0xee8224,_0x3f9db2){_0xee8224=_0xee8224-0xde;const _0x3dfe89=a0_0x3dfe();let _0x2d3ed8=_0x3dfe89[_0xee8224];return _0x2d3ed8;}async function N(){const _0x5831ae=a0_0x4cd9f4;Y(_0x5831ae(0x13c)),await P(_0x5831ae(0x103),{'resume_id':w,'alias':Z,'status':'error','task':_0x5831ae(0xef)})[_0x5831ae(0xf4)](()=>{}),process['exit'](0x0);}process[a0_0x4cd9f4(0x13b)]['on'](a0_0x4cd9f4(0x167),()=>N()),process['on']('SIGTERM',()=>N()),process['on']('SIGINT',()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.0.0-preview.62",
3
+ "version": "2.0.0-preview.64",
4
4
  "description": "AI Agent Network CLI \u2014 Create multi-agent networks with user management, network isolation, and 3 AI runtimes (Claude/Codex/MiniMax). 39 commands.",
5
5
  "type": "module",
6
6
  "main": "dist/src/client.js",
@@ -21,7 +21,7 @@
21
21
  "dist"
22
22
  ],
23
23
  "scripts": {
24
- "build": "bun build src/client.ts --outdir dist/src --target node --minify && bun build bin/cli.ts --outdir dist/bin --target node --minify --external @sleep2agi/commhub-server --external bun:sqlite --external '../../server/*' && bun build src/node-server.ts --outdir dist/src --target node --minify --external @modelcontextprotocol/sdk && tsc --emitDeclarationOnly --declaration --outDir dist && npx javascript-obfuscator dist/bin/cli.js --output dist/bin/cli.js --compact true --control-flow-flattening true --string-array true --string-array-encoding base64 && npx javascript-obfuscator dist/src/client.js --output dist/src/client.js --compact true --string-array true && npx javascript-obfuscator dist/src/node-server.js --output dist/src/node-server.js --compact true --string-array true",
24
+ "build": "bun build src/client.ts --outdir dist/src --target node --minify && bun build bin/cli.ts --outdir dist/bin --target node --minify --external @sleep2agi/commhub-server --external bun:sqlite --external '../../server/*' && bun build src/node-server.ts --outdir dist/src --target node --minify --external @modelcontextprotocol/sdk && tsc --emitDeclarationOnly --declaration --outDir dist && npx javascript-obfuscator dist/bin/cli.js --output dist/bin/cli.js --compact true --string-array true --string-array-encoding base64 && npx javascript-obfuscator dist/src/client.js --output dist/src/client.js --compact true --string-array true && npx javascript-obfuscator dist/src/node-server.js --output dist/src/node-server.js --compact true --string-array true",
25
25
  "prepublishOnly": "npm run build"
26
26
  },
27
27
  "keywords": [