@sleep2agi/agent-network 2.0.1-preview.1 → 2.0.1-preview.3

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
- function a0_0x91cc(_0x309140,_0x58b6bc){_0x309140=_0x309140-0x1c3;const _0x35da70=a0_0x35da();let _0x91ccac=_0x35da70[_0x309140];return _0x91ccac;}function a0_0x35da(){const _0x426ded=['sdk-','signal','connect','getReader','reply','autoConnect','replace','707802KyNghk','type','token','text','3085840mCOdqz','alias','call','abort','offline','body','disconnect','log','server','split','Bearer\x20','3507931iUlYso','resumeId','stringify','/events/','match','result','55qjOCYU','parse','heartbeatInterval','toTimeString','registered','connectSSE','catch','sseAbort','slice','text/event-stream','send_task','message','min','broadcast','/mcp','emit','agent','send','SSE\x20failed:\x20','get_all_status','heartbeat\x20failed:\x20','application/json,\x20text/event-stream','now','content','770931CQqxuD','running','url','inbox\x20error:\x20','disconnected','7914BFWwCy','SSE\x20reconnecting\x20in\x20','connected','report_status','reconnectDelay','AbortError','208881qdmrUZ','data:\x20','application/json','2.0','s...','SSE\x20error:\x20','status','from_session','38059030cHJXVW','idle','sleep','decode','Authorization','POST','read','392QsVfQF','794ruKgxB','tools/call','toString','task','processInbox','heartbeatTimer'];a0_0x35da=function(){return _0x426ded;};return a0_0x35da();}const a0_0x4e50cb=a0_0x91cc;(function(_0x166df0,_0x3912ff){const _0x13e9ac=a0_0x91cc,_0x5190c4=_0x166df0();while(!![]){try{const _0x45add6=-parseInt(_0x13e9ac(0x1c7))/0x1+-parseInt(_0x13e9ac(0x1e2))/0x2*(parseInt(_0x13e9ac(0x1cc))/0x3)+-parseInt(_0x13e9ac(0x1f3))/0x4+-parseInt(_0x13e9ac(0x204))/0x5*(-parseInt(_0x13e9ac(0x1ef))/0x6)+-parseInt(_0x13e9ac(0x1fe))/0x7+-parseInt(_0x13e9ac(0x1e1))/0x8*(parseInt(_0x13e9ac(0x1d2))/0x9)+parseInt(_0x13e9ac(0x1da))/0xa;if(_0x45add6===_0x3912ff)break;else _0x5190c4['push'](_0x5190c4['shift']());}catch(_0x20da51){_0x5190c4['push'](_0x5190c4['shift']());}}}(a0_0x35da,0xd5be1));import{EventEmitter as a0_0x122f3a}from'events';import{hostname as a0_0x1ecbc1}from'os';class T extends a0_0x122f3a{[a0_0x4e50cb(0x1c9)];[a0_0x4e50cb(0x1f4)];[a0_0x4e50cb(0x1f1)];[a0_0x4e50cb(0x214)];['resumeId'];['heartbeatInterval'];[a0_0x4e50cb(0x1d0)];['heartbeatTimer'];['sseAbort'];[a0_0x4e50cb(0x1c8)]=!0x1;constructor(_0x2346ab){const _0x45bd7a=a0_0x4e50cb;super();if(this[_0x45bd7a(0x1c9)]=_0x2346ab[_0x45bd7a(0x1c9)][_0x45bd7a(0x1ee)](/\/$/,''),this[_0x45bd7a(0x1f4)]=_0x2346ab[_0x45bd7a(0x1f4)],this[_0x45bd7a(0x1f1)]=_0x2346ab[_0x45bd7a(0x1f1)],this['agent']=_0x2346ab[_0x45bd7a(0x214)]||'sdk',this['resumeId']=_0x45bd7a(0x1e8)+_0x2346ab[_0x45bd7a(0x1f4)]+'-'+Date[_0x45bd7a(0x1c5)]()[_0x45bd7a(0x1e4)](0x24),this[_0x45bd7a(0x206)]=_0x2346ab[_0x45bd7a(0x206)]??0x2bf20,this[_0x45bd7a(0x1d0)]=_0x2346ab['reconnectDelay']??0xbb8,_0x2346ab[_0x45bd7a(0x1ed)]!==!0x1)this[_0x45bd7a(0x1ea)]();}[a0_0x4e50cb(0x1fa)](_0x342b94){const _0x4b4743=a0_0x4e50cb;console[_0x4b4743(0x1fa)]('['+new Date()[_0x4b4743(0x207)]()[_0x4b4743(0x20c)](0x0,0x8)+']\x20[commhub:'+this['alias']+']\x20'+_0x342b94);}async[a0_0x4e50cb(0x1f5)](_0x2e8310,_0x37c275){const _0x513daa=a0_0x4e50cb;let _0x36b76d={'Content-Type':_0x513daa(0x1d4),'Accept':_0x513daa(0x1c4)};if(this[_0x513daa(0x1f1)])_0x36b76d[_0x513daa(0x1de)]=_0x513daa(0x1fd)+this[_0x513daa(0x1f1)];let _0xf6b805=await(await fetch(this['url']+_0x513daa(0x212),{'method':_0x513daa(0x1df),'headers':_0x36b76d,'body':JSON[_0x513daa(0x200)]({'jsonrpc':_0x513daa(0x1d5),'id':Date[_0x513daa(0x1c5)](),'method':_0x513daa(0x1e3),'params':{'name':_0x2e8310,'arguments':_0x37c275}})}))[_0x513daa(0x1f2)](),_0x15f8c6=_0xf6b805[_0x513daa(0x202)](/data: (.+)/),_0x2ac0c6=_0x15f8c6?JSON['parse'](_0x15f8c6[0x1]):JSON[_0x513daa(0x205)](_0xf6b805),_0x5a589d=_0x2ac0c6?.[_0x513daa(0x203)]?.['content']?.[0x0]?.[_0x513daa(0x1f2)];return _0x5a589d?JSON['parse'](_0x5a589d):_0x2ac0c6;}async['connect'](){const _0x751aea=a0_0x4e50cb;if(this['running'])return;this[_0x751aea(0x1c8)]=!0x0,await this[_0x751aea(0x1d8)](_0x751aea(0x1db)),this['log'](_0x751aea(0x208)),this['heartbeatTimer']=setInterval(()=>{const _0x467820=_0x751aea;this['status'](_0x467820(0x1db))[_0x467820(0x20a)](_0x4a82ea=>this[_0x467820(0x1fa)](_0x467820(0x1c3)+_0x4a82ea[_0x467820(0x20f)]));},this[_0x751aea(0x206)]),this[_0x751aea(0x209)]();}async[a0_0x4e50cb(0x1f9)](){const _0x547761=a0_0x4e50cb;if(this[_0x547761(0x1c8)]=!0x1,this[_0x547761(0x20b)]?.[_0x547761(0x1f6)](),this[_0x547761(0x1e7)])clearInterval(this[_0x547761(0x1e7)]);await this[_0x547761(0x1d8)](_0x547761(0x1f7))[_0x547761(0x20a)](()=>{}),this[_0x547761(0x1fa)](_0x547761(0x1cb));}async[a0_0x4e50cb(0x215)](_0x37c972,_0x153c7e,_0x4d213c='normal'){const _0x21dbd1=a0_0x4e50cb;return this['call'](_0x21dbd1(0x20e),{'alias':_0x37c972,'task':_0x153c7e,'priority':_0x4d213c,'from_session':this[_0x21dbd1(0x1f4)]});}async[a0_0x4e50cb(0x20f)](_0x3dc34e,_0x256af8){return this['call']('send_message',{'alias':_0x3dc34e,'message':_0x256af8,'from_session':this['alias']});}async[a0_0x4e50cb(0x1ec)](_0x420179,_0x42bebf,_0x5479ba='completed'){const _0x199a8f=a0_0x4e50cb;return this[_0x199a8f(0x1f5)](_0x199a8f(0x1ec),{'task_id':_0x420179,'text':_0x42bebf,'status':_0x5479ba});}async[a0_0x4e50cb(0x1d8)](_0xa9a1da,_0x288590){const _0x2261ee=a0_0x4e50cb;return this['call'](_0x2261ee(0x1cf),{'resume_id':this[_0x2261ee(0x1ff)],'alias':this[_0x2261ee(0x1f4)],'status':_0xa9a1da,'server':a0_0x1ecbc1(),'hostname':a0_0x1ecbc1(),'agent':this[_0x2261ee(0x214)],'project_dir':process['cwd'](),..._0x288590});}async['getAllStatus'](){const _0x560949=a0_0x4e50cb;return this['call'](_0x560949(0x217),{});}async[a0_0x4e50cb(0x211)](_0x43a17f,_0x105746){const _0x44db4e=a0_0x4e50cb;return this[_0x44db4e(0x1f5)]('broadcast',{'message':_0x43a17f,'filter_server':_0x105746?.[_0x44db4e(0x1fb)],'filter_status':_0x105746?.['status']});}async[a0_0x4e50cb(0x209)](){const _0x54db6a=a0_0x4e50cb;let _0x1d1cc0=encodeURIComponent(this[_0x54db6a(0x1f4)]),_0x4ffebc=this['url']+_0x54db6a(0x201)+_0x1d1cc0,_0x43e7f5=this[_0x54db6a(0x1d0)];while(this[_0x54db6a(0x1c8)]){try{this[_0x54db6a(0x20b)]=new AbortController();let _0x2ef5fc={'Accept':_0x54db6a(0x20d)};if(this['token'])_0x2ef5fc['Authorization']='Bearer\x20'+this['token'];let _0x3e5746=await fetch(_0x4ffebc,{'headers':_0x2ef5fc,'signal':this['sseAbort'][_0x54db6a(0x1e9)]});if(!_0x3e5746['ok']||!_0x3e5746[_0x54db6a(0x1f8)]){this[_0x54db6a(0x1fa)](_0x54db6a(0x216)+_0x3e5746[_0x54db6a(0x1d8)]),await this[_0x54db6a(0x1dc)](_0x43e7f5),_0x43e7f5=Math[_0x54db6a(0x210)](_0x43e7f5*1.5,0xea60);continue;}_0x43e7f5=this[_0x54db6a(0x1d0)];let _0x4def0a=_0x3e5746['body'][_0x54db6a(0x1eb)](),_0x444812=new TextDecoder(),_0x3a0120='';while(this[_0x54db6a(0x1c8)]){let {done:_0x42b3de,value:_0x5f5829}=await _0x4def0a[_0x54db6a(0x1e0)]();if(_0x42b3de)break;_0x3a0120+=_0x444812[_0x54db6a(0x1dd)](_0x5f5829,{'stream':!0x0});let _0x327683=_0x3a0120[_0x54db6a(0x1fc)]('\x0a');_0x3a0120=_0x327683['pop']()||'';for(let _0x282eee of _0x327683){if(!_0x282eee['startsWith'](_0x54db6a(0x1d3)))continue;try{let _0x523b21=JSON[_0x54db6a(0x205)](_0x282eee[_0x54db6a(0x20c)](0x6));if(_0x523b21['type']===_0x54db6a(0x1ce)){this[_0x54db6a(0x1fa)]('SSE\x20connected'),this[_0x54db6a(0x213)](_0x54db6a(0x1ce));continue;}if(_0x523b21[_0x54db6a(0x1f0)]==='new_task'||_0x523b21[_0x54db6a(0x1f0)]==='new_message'||_0x523b21['type']===_0x54db6a(0x211))await this[_0x54db6a(0x1e6)]();}catch{}}}}catch(_0x5de1b4){if(_0x5de1b4['name']===_0x54db6a(0x1d1))break;this[_0x54db6a(0x213)]('error',_0x5de1b4),this[_0x54db6a(0x1fa)](_0x54db6a(0x1d7)+_0x5de1b4['message']);}if(this[_0x54db6a(0x1c8)])this[_0x54db6a(0x213)](_0x54db6a(0x1cb)),this[_0x54db6a(0x1fa)](_0x54db6a(0x1cd)+_0x43e7f5/0x3e8+_0x54db6a(0x1d6)),await this[_0x54db6a(0x1dc)](_0x43e7f5),_0x43e7f5=Math[_0x54db6a(0x210)](_0x43e7f5*1.5,0xea60);}}async[a0_0x4e50cb(0x1e6)](){const _0x2ee228=a0_0x4e50cb;try{let _0x4074a5=(await this['call']('get_inbox',{'alias':this[_0x2ee228(0x1f4)],'limit':0xa}))?.['messages']||[];for(let _0x115670 of _0x4074a5)await this[_0x2ee228(0x1f5)]('ack_inbox',{'alias':this[_0x2ee228(0x1f4)],'message_id':_0x115670['id']}),this[_0x2ee228(0x1fa)]('←\x20'+_0x115670[_0x2ee228(0x1d9)]+':\x20'+_0x115670[_0x2ee228(0x1c6)][_0x2ee228(0x20c)](0x0,0x3c)),this['emit'](_0x2ee228(0x1e5),_0x115670),this[_0x2ee228(0x213)](_0x2ee228(0x20f),_0x115670);}catch(_0x4c6052){this[_0x2ee228(0x1fa)](_0x2ee228(0x1ca)+_0x4c6052[_0x2ee228(0x20f)]);}}[a0_0x4e50cb(0x1dc)](_0x3499d3){return new Promise(_0x62ed29=>setTimeout(_0x62ed29,_0x3499d3));}}var $=T;export{$ as default,T as CommHub};
1
+ function a0_0xb4d0(_0x374df2,_0x314374){_0x374df2=_0x374df2-0x170;const _0x3b2b34=a0_0x3b2b();let _0xb4d05a=_0x3b2b34[_0x374df2];return _0xb4d05a;}const a0_0x2439bb=a0_0xb4d0;(function(_0x4bd88d,_0x140ba5){const _0x29e249=a0_0xb4d0,_0x4c8052=_0x4bd88d();while(!![]){try{const _0x1e3a9b=parseInt(_0x29e249(0x18e))/0x1*(parseInt(_0x29e249(0x19c))/0x2)+parseInt(_0x29e249(0x170))/0x3+parseInt(_0x29e249(0x1bd))/0x4+parseInt(_0x29e249(0x18c))/0x5*(-parseInt(_0x29e249(0x1af))/0x6)+-parseInt(_0x29e249(0x1a1))/0x7*(parseInt(_0x29e249(0x196))/0x8)+-parseInt(_0x29e249(0x17b))/0x9*(-parseInt(_0x29e249(0x1ba))/0xa)+parseInt(_0x29e249(0x1be))/0xb*(parseInt(_0x29e249(0x1b0))/0xc);if(_0x1e3a9b===_0x140ba5)break;else _0x4c8052['push'](_0x4c8052['shift']());}catch(_0x59f793){_0x4c8052['push'](_0x4c8052['shift']());}}}(a0_0x3b2b,0xf1ecf));import{EventEmitter as a0_0x3c1956}from'events';import{hostname as a0_0x5ad6d2}from'os';class T extends a0_0x3c1956{['url'];[a0_0x2439bb(0x1a9)];['token'];[a0_0x2439bb(0x1a7)];[a0_0x2439bb(0x173)];['heartbeatInterval'];[a0_0x2439bb(0x175)];[a0_0x2439bb(0x183)];[a0_0x2439bb(0x190)];[a0_0x2439bb(0x17d)]=!0x1;constructor(_0x5098e6){const _0x2b7450=a0_0x2439bb;super();if(this[_0x2b7450(0x1ac)]=_0x5098e6[_0x2b7450(0x1ac)]['replace'](/\/$/,''),this[_0x2b7450(0x1a9)]=_0x5098e6[_0x2b7450(0x1a9)],this[_0x2b7450(0x17f)]=_0x5098e6[_0x2b7450(0x17f)],this['agent']=_0x5098e6['agent']||'sdk',this[_0x2b7450(0x173)]=_0x2b7450(0x1c0)+_0x5098e6[_0x2b7450(0x1a9)]+'-'+Date['now']()['toString'](0x24),this[_0x2b7450(0x1c6)]=_0x5098e6[_0x2b7450(0x1c6)]??0x2bf20,this[_0x2b7450(0x175)]=_0x5098e6[_0x2b7450(0x175)]??0xbb8,_0x5098e6[_0x2b7450(0x1c1)]!==!0x1)this[_0x2b7450(0x18f)]();}[a0_0x2439bb(0x19b)](_0x4d3005){const _0x3b1ced=a0_0x2439bb;console[_0x3b1ced(0x19b)]('['+new Date()[_0x3b1ced(0x180)]()['slice'](0x0,0x8)+']\x20[commhub:'+this[_0x3b1ced(0x1a9)]+']\x20'+_0x4d3005);}async[a0_0x2439bb(0x1b7)](_0x4db018,_0x93f4e1){const _0x10e652=a0_0x2439bb;let _0x16603e={'Content-Type':_0x10e652(0x1b8),'Accept':_0x10e652(0x178)};if(this[_0x10e652(0x17f)])_0x16603e['Authorization']='Bearer\x20'+this[_0x10e652(0x17f)];let _0x324ec5=await(await fetch(this[_0x10e652(0x1ac)]+_0x10e652(0x176),{'method':_0x10e652(0x182),'headers':_0x16603e,'body':JSON[_0x10e652(0x181)]({'jsonrpc':'2.0','id':Date[_0x10e652(0x1c2)](),'method':_0x10e652(0x1bc),'params':{'name':_0x4db018,'arguments':_0x93f4e1}})}))['text'](),_0x1c84ca=_0x324ec5[_0x10e652(0x1ae)](/data: (.+)/),_0x31d930=_0x1c84ca?JSON[_0x10e652(0x1a0)](_0x1c84ca[0x1]):JSON['parse'](_0x324ec5),_0x32d153=_0x31d930?.['result']?.[_0x10e652(0x1c5)]?.[0x0]?.[_0x10e652(0x189)];return _0x32d153?JSON[_0x10e652(0x1a0)](_0x32d153):_0x31d930;}async['connect'](){const _0x28b35a=a0_0x2439bb;if(this[_0x28b35a(0x17d)])return;this['running']=!0x0,await this['status'](_0x28b35a(0x184)),this[_0x28b35a(0x19b)](_0x28b35a(0x193)),this['heartbeatTimer']=setInterval(()=>{const _0xb10411=_0x28b35a;this['status']('idle')['catch'](_0x132ef2=>this[_0xb10411(0x19b)](_0xb10411(0x188)+_0x132ef2['message']));},this[_0x28b35a(0x1c6)]),this['connectSSE']();}async[a0_0x2439bb(0x1b1)](){const _0x50b698=a0_0x2439bb;if(this[_0x50b698(0x17d)]=!0x1,this['sseAbort']?.['abort'](),this[_0x50b698(0x183)])clearInterval(this[_0x50b698(0x183)]);await this[_0x50b698(0x19d)](_0x50b698(0x195))['catch'](()=>{}),this[_0x50b698(0x19b)]('disconnected');}async[a0_0x2439bb(0x1a8)](_0x143cd5,_0x21e111,_0x58aaec='normal'){const _0xd758fb=a0_0x2439bb;return this[_0xd758fb(0x1b7)](_0xd758fb(0x18a),{'alias':_0x143cd5,'task':_0x21e111,'priority':_0x58aaec,'from_session':this[_0xd758fb(0x1a9)]});}async[a0_0x2439bb(0x197)](_0x240337,_0x40a125){const _0x2fb8a4=a0_0x2439bb;return this[_0x2fb8a4(0x1b7)](_0x2fb8a4(0x1a3),{'alias':_0x240337,'message':_0x40a125,'from_session':this[_0x2fb8a4(0x1a9)]});}async['reply'](_0x40f835,_0x1d64d6,_0x16eeb5='completed'){const _0x35d095=a0_0x2439bb;return this[_0x35d095(0x1b7)]('reply',{'task_id':_0x40f835,'text':_0x1d64d6,'status':_0x16eeb5});}async[a0_0x2439bb(0x19d)](_0x4b2ec3,_0x36a0af){const _0xa9385e=a0_0x2439bb;return this['call'](_0xa9385e(0x177),{'resume_id':this[_0xa9385e(0x173)],'alias':this[_0xa9385e(0x1a9)],'status':_0x4b2ec3,'server':a0_0x5ad6d2(),'hostname':a0_0x5ad6d2(),'agent':this['agent'],'project_dir':process[_0xa9385e(0x18b)](),..._0x36a0af});}async['getAllStatus'](){const _0x592caf=a0_0x2439bb;return this[_0x592caf(0x1b7)](_0x592caf(0x172),{});}async[a0_0x2439bb(0x1a4)](_0x51bf01,_0x3926a2){const _0x117f7b=a0_0x2439bb;return this[_0x117f7b(0x1b7)]('broadcast',{'message':_0x51bf01,'filter_server':_0x3926a2?.[_0x117f7b(0x187)],'filter_status':_0x3926a2?.[_0x117f7b(0x19d)]});}async[a0_0x2439bb(0x1aa)](){const _0x5db93f=a0_0x2439bb;let _0x4cbfe2=encodeURIComponent(this[_0x5db93f(0x1a9)]),_0x57bc9e=this[_0x5db93f(0x1ac)]+'/events/'+_0x4cbfe2,_0x4fdb61=this[_0x5db93f(0x175)];while(this[_0x5db93f(0x17d)]){try{this['sseAbort']=new AbortController();let _0x2bfeab={'Accept':'text/event-stream'};if(this['token'])_0x2bfeab[_0x5db93f(0x174)]=_0x5db93f(0x1ad)+this[_0x5db93f(0x17f)];let _0x19872a=await fetch(_0x57bc9e,{'headers':_0x2bfeab,'signal':this['sseAbort'][_0x5db93f(0x186)]});if(!_0x19872a['ok']||!_0x19872a[_0x5db93f(0x1a2)]){this[_0x5db93f(0x19b)](_0x5db93f(0x198)+_0x19872a[_0x5db93f(0x19d)]),await this[_0x5db93f(0x1b2)](_0x4fdb61),_0x4fdb61=Math['min'](_0x4fdb61*1.5,0xea60);continue;}_0x4fdb61=this[_0x5db93f(0x175)];let _0x3aee6a=_0x19872a[_0x5db93f(0x1a2)][_0x5db93f(0x1b5)](),_0x588f16=new TextDecoder(),_0x5547c2='';while(this[_0x5db93f(0x17d)]){let {done:_0x275eb1,value:_0x172e1a}=await _0x3aee6a[_0x5db93f(0x19f)]();if(_0x275eb1)break;_0x5547c2+=_0x588f16[_0x5db93f(0x179)](_0x172e1a,{'stream':!0x0});let _0x593a4f=_0x5547c2[_0x5db93f(0x1c4)]('\x0a');_0x5547c2=_0x593a4f['pop']()||'';for(let _0x86d7a7 of _0x593a4f){if(!_0x86d7a7[_0x5db93f(0x17a)](_0x5db93f(0x185)))continue;try{let _0x2b0aa6=JSON[_0x5db93f(0x1a0)](_0x86d7a7[_0x5db93f(0x19e)](0x6));if(_0x2b0aa6[_0x5db93f(0x18d)]===_0x5db93f(0x17c)){this[_0x5db93f(0x19b)](_0x5db93f(0x1a5)),this[_0x5db93f(0x1b3)](_0x5db93f(0x17c));continue;}if(_0x2b0aa6[_0x5db93f(0x18d)]===_0x5db93f(0x1ab)||_0x2b0aa6[_0x5db93f(0x18d)]===_0x5db93f(0x1a6)||_0x2b0aa6[_0x5db93f(0x18d)]===_0x5db93f(0x1a4))await this[_0x5db93f(0x1b4)]();}catch{}}}}catch(_0x510e64){if(_0x510e64[_0x5db93f(0x1bf)]===_0x5db93f(0x1c3))break;this[_0x5db93f(0x1b3)](_0x5db93f(0x194),_0x510e64),this[_0x5db93f(0x19b)](_0x5db93f(0x17e)+_0x510e64[_0x5db93f(0x197)]);}if(this[_0x5db93f(0x17d)])this[_0x5db93f(0x1b3)](_0x5db93f(0x199)),this[_0x5db93f(0x19b)](_0x5db93f(0x1b6)+_0x4fdb61/0x3e8+'s...'),await this[_0x5db93f(0x1b2)](_0x4fdb61),_0x4fdb61=Math[_0x5db93f(0x1b9)](_0x4fdb61*1.5,0xea60);}}async[a0_0x2439bb(0x1b4)](){const _0x48912a=a0_0x2439bb;try{let _0x41f73a=(await this[_0x48912a(0x1b7)](_0x48912a(0x192),{'alias':this[_0x48912a(0x1a9)],'limit':0xa}))?.[_0x48912a(0x191)]||[];for(let _0x46f52a of _0x41f73a)await this[_0x48912a(0x1b7)](_0x48912a(0x1bb),{'alias':this[_0x48912a(0x1a9)],'message_id':_0x46f52a['id']}),this[_0x48912a(0x19b)]('←\x20'+_0x46f52a['from_session']+':\x20'+_0x46f52a[_0x48912a(0x1c5)][_0x48912a(0x19e)](0x0,0x3c)),this['emit'](_0x48912a(0x19a),_0x46f52a),this[_0x48912a(0x1b3)](_0x48912a(0x197),_0x46f52a);}catch(_0x5cbadf){this['log'](_0x48912a(0x171)+_0x5cbadf['message']);}}[a0_0x2439bb(0x1b2)](_0x458c94){return new Promise(_0x4337a4=>setTimeout(_0x4337a4,_0x458c94));}}var $=T;function a0_0x3b2b(){const _0x2a3710=['broadcast','SSE\x20connected','new_message','agent','send','alias','connectSSE','new_task','url','Bearer\x20','match','1290ZCRNVw','16476wszAzp','disconnect','sleep','emit','processInbox','getReader','SSE\x20reconnecting\x20in\x20','call','application/json','min','10ASmHGl','ack_inbox','tools/call','5488720MKYByu','3674aEsOEc','name','sdk-','autoConnect','now','AbortError','split','content','heartbeatInterval','354918vdnzju','inbox\x20error:\x20','get_all_status','resumeId','Authorization','reconnectDelay','/mcp','report_status','application/json,\x20text/event-stream','decode','startsWith','3411504HyoFGJ','connected','running','SSE\x20error:\x20','token','toTimeString','stringify','POST','heartbeatTimer','idle','data:\x20','signal','server','heartbeat\x20failed:\x20','text','send_task','cwd','32570WvWOoB','type','8858YsypWm','connect','sseAbort','messages','get_inbox','registered','error','offline','656152jvNdXB','message','SSE\x20failed:\x20','disconnected','task','log','218Khxqwi','status','slice','read','parse','77hacumA','body','send_message'];a0_0x3b2b=function(){return _0x2a3710;};return a0_0x3b2b();}export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x1f921f=a0_0x5b87;(function(_0x92ca2d,_0xdcabd2){const _0xd815c6=a0_0x5b87,_0x56e5cc=_0x92ca2d();while(!![]){try{const _0x283ba2=-parseInt(_0xd815c6(0x22c))/0x1*(parseInt(_0xd815c6(0x1df))/0x2)+-parseInt(_0xd815c6(0x234))/0x3+parseInt(_0xd815c6(0x1f8))/0x4*(parseInt(_0xd815c6(0x21d))/0x5)+-parseInt(_0xd815c6(0x21e))/0x6+parseInt(_0xd815c6(0x232))/0x7*(parseInt(_0xd815c6(0x1de))/0x8)+parseInt(_0xd815c6(0x1d1))/0x9+parseInt(_0xd815c6(0x207))/0xa*(parseInt(_0xd815c6(0x233))/0xb);if(_0x283ba2===_0xdcabd2)break;else _0x56e5cc['push'](_0x56e5cc['shift']());}catch(_0x5c2d9a){_0x56e5cc['push'](_0x56e5cc['shift']());}}}(a0_0x4216,0x594b5));import{readFileSync as a0_0x4f884a,existsSync as a0_0x587c12}from'fs';function a0_0x5b87(_0x25f8d6,_0x412276){_0x25f8d6=_0x25f8d6-0x1d1;const _0x421618=a0_0x4216();let _0x5b8784=_0x421618[_0x25f8d6];return _0x5b8784;}import{randomUUID as a0_0x34b683}from'crypto';import{join as a0_0x1f98a4}from'path';import{hostname as a0_0x116d52}from'os';import{execSync as a0_0x1be896}from'child_process';import{Server as a0_0x146840}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x51fe97}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x140c99,CallToolRequestSchema as a0_0x5560f9}from'@modelcontextprotocol/sdk/types.js';function p(_0x4c8407){const _0x56e4a2=a0_0x5b87;if(!a0_0x587c12(_0x4c8407))return;for(let _0x54e779 of a0_0x4f884a(_0x4c8407,_0x56e4a2(0x25e))[_0x56e4a2(0x201)]('\x0a')){let _0x4abdb9=_0x54e779[_0x56e4a2(0x23a)]();if(!_0x4abdb9||_0x4abdb9[_0x56e4a2(0x20c)]('#'))continue;let _0x45b178=_0x4abdb9['indexOf']('=');if(_0x45b178<0x0)continue;let _0x138b39=_0x4abdb9['slice'](0x0,_0x45b178)[_0x56e4a2(0x23a)](),_0xbaf729=_0x4abdb9['slice'](_0x45b178+0x1)[_0x56e4a2(0x23a)]()[_0x56e4a2(0x223)](/^["']|["']$/g,'');if(!process.env[_0x138b39])process.env[_0x138b39]=_0xbaf729;}}var C=process.env.HOME||'~',T=a0_0x1f98a4(C,'.claude/channels/commhub');p(a0_0x1f98a4(T,a0_0x1f921f(0x211)));var L=process[a0_0x1f921f(0x240)]()['replace'](/\//g,'-');p(a0_0x1f98a4(T,L,'.env'));function U(){const _0xeff77c=a0_0x1f921f;try{return a0_0x1be896(_0xeff77c(0x206),{'encoding':'utf-8','timeout':0x7d0})['trim']();}catch{return'';}}function v(){const _0x3cc6ab=a0_0x1f921f;try{let _0x1cd45a=a0_0x1f98a4(C,_0x3cc6ab(0x23e),_0x3cc6ab(0x248));if(a0_0x587c12(_0x1cd45a))return JSON[_0x3cc6ab(0x1e9)](a0_0x4f884a(_0x1cd45a,_0x3cc6ab(0x25e)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x1f921f(0x251)]||a0_0x1f921f(0x21c),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x116d52(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x34b683(),X=process.env.COMMHUB_TOKEN||H[a0_0x1f921f(0x227)]||'';function Y(_0x4213b6){const _0x422b10=a0_0x1f921f;let _0x5ecf92=new Date()['toTimeString']()[_0x422b10(0x21a)](0x0,0x8);process[_0x422b10(0x20f)]['write']('['+_0x5ecf92+_0x422b10(0x23d)+_0x4213b6+'\x0a');}function h(_0xa02ce3){return new Promise(_0x20421e=>setTimeout(_0x20421e,_0xa02ce3));}Y(a0_0x1f921f(0x21f)+f+a0_0x1f921f(0x222)+Z+a0_0x1f921f(0x20d)+w[a0_0x1f921f(0x21a)](0x0,0x8)+a0_0x1f921f(0x246)+(j||'none')+a0_0x1f921f(0x252)+process['cwd']()+a0_0x1f921f(0x1d2)+L);var k=new Map(),K=new a0_0x146840({'name':a0_0x1f921f(0x237),'version':'0.3.0'},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x1f921f(0x24a),a0_0x1f921f(0x1db),a0_0x1f921f(0x20e),'You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.',a0_0x1f921f(0x24d)+Z][a0_0x1f921f(0x1fa)]('\x0a')});function a0_0x4216(){const _0x105537=['data:\x20','new_task','catch','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','Bearer\x20','number','get_inbox','inbox_count','working','utf-8','182529ZOINzN','\x20PROJECT_ENV=','priority','from','Priority\x20(default:\x20normal)','SSE\x20connected\x20as\x20\x22','end','registered\x20as\x20\x22','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','heartbeat\x20failed:\x20','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','Target\x20session\x20alias','tools/call','8sBXZiU','2BJlfWU','message_id','message','notifications/claude/channel','commhub_send_message','unknown\x20tool','type','no\x20response','commhub','/events/','parse','replied','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','connected','messages','stdin','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','find','2.0','connect','get','read','body','send_reply','session\x20disconnected','500316vXzOOy','initialize','join','commhub_get_all_status','Task\x20content','CommHub\x20init\x20failed:\x20','task','Current\x20task\x20description','text','split','application/json,\x20text/event-stream','idle','cancelled','decode','tmux\x20display-message\x20-p\x20\x27#S\x27','10hhfINw','getReader','new_message','setRequestHandler','/mcp','startsWith','\x20RESUME_ID=','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','stderr','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','.env','SSE\x20connection\x20error:\x20','then','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','object','low','string','2025-03-26','content','slice','←\x20message\x20from\x20','http://127.0.0.1:9200','15TjTHUq','2518674fGuppK','ENV:\x20URL=','statusText','→\x20injected\x20task\x20','\x20ALIAS=','replace','error','Message\x20content','ready\x20—\x20waiting\x20for\x20events','token','SIGTERM','init\x20failed:\x20','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','stringify','440261NqyNjG','length','exit','status','SSE\x20fatal:\x20','ack_inbox','4935679hRftfi','3686155viKmnL','629793vmvGFX','Reply\x20text\x20/\x20result\x20summary','result','commhub-channel','get_all_status','report_status','trim','POST','commhub_reply',']\x20[commhub]\x20','.anet','alias','cwd','normal','failed','completed','claude-code','commhub_report_status','...\x20TMUX=','notification','config.json','blocked','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','application/json','commhub_send_task','Session\x20alias:\x20','\x20priority=','warning:\x20could\x20not\x20register:\x20','0.3.0','hub','\x20CWD=','from_session','send_message'];a0_0x4216=function(){return _0x105537;};return a0_0x4216();}K[a0_0x1f921f(0x20a)](a0_0x140c99,async()=>({'tools':[{'name':a0_0x1f921f(0x23c),'description':a0_0x1f921f(0x22a),'inputSchema':{'type':a0_0x1f921f(0x215),'properties':{'task_id':{'type':a0_0x1f921f(0x217),'description':a0_0x1f921f(0x214)},'text':{'type':'string','description':a0_0x1f921f(0x235)},'status':{'type':'string','enum':[a0_0x1f921f(0x243),a0_0x1f921f(0x242),a0_0x1f921f(0x204),a0_0x1f921f(0x249),'error','in_progress'],'description':a0_0x1f921f(0x210)}},'required':[a0_0x1f921f(0x200)]}},{'name':a0_0x1f921f(0x245),'description':a0_0x1f921f(0x258),'inputSchema':{'type':a0_0x1f921f(0x215),'properties':{'status':{'type':a0_0x1f921f(0x217),'enum':[a0_0x1f921f(0x25d),'idle',a0_0x1f921f(0x249),a0_0x1f921f(0x224)]},'task':{'type':a0_0x1f921f(0x217),'description':a0_0x1f921f(0x1ff)},'progress':{'type':a0_0x1f921f(0x25a),'description':'Progress\x200-100'}},'required':[a0_0x1f921f(0x22f)]}},{'name':a0_0x1f921f(0x24c),'description':a0_0x1f921f(0x1eb),'inputSchema':{'type':a0_0x1f921f(0x215),'properties':{'alias':{'type':a0_0x1f921f(0x217),'description':a0_0x1f921f(0x1dc)},'task':{'type':a0_0x1f921f(0x217),'description':a0_0x1f921f(0x1fc)},'priority':{'type':a0_0x1f921f(0x217),'enum':['high','normal',a0_0x1f921f(0x216)],'description':a0_0x1f921f(0x1d5)}},'required':['alias',a0_0x1f921f(0x1fe)]}},{'name':a0_0x1f921f(0x1e3),'description':a0_0x1f921f(0x1d9),'inputSchema':{'type':a0_0x1f921f(0x215),'properties':{'alias':{'type':a0_0x1f921f(0x217),'description':a0_0x1f921f(0x1dc)},'message':{'type':'string','description':a0_0x1f921f(0x225)}},'required':[a0_0x1f921f(0x23f),a0_0x1f921f(0x1e1)]}},{'name':a0_0x1f921f(0x1fb),'description':a0_0x1f921f(0x1ef),'inputSchema':{'type':a0_0x1f921f(0x215),'properties':{}}}]}));async function P(_0x21579c,_0x2263f1){const _0xf9c0c8=a0_0x1f921f;let _0x4c0e0e=await fetch(f+_0xf9c0c8(0x20b),{'method':_0xf9c0c8(0x23b),'headers':{'Content-Type':_0xf9c0c8(0x24b),'Accept':_0xf9c0c8(0x202),...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON['stringify']({'jsonrpc':'2.0','id':0x1,'method':_0xf9c0c8(0x1f9),'params':{'protocolVersion':_0xf9c0c8(0x218),'capabilities':{},'clientInfo':{'name':_0xf9c0c8(0x237),'version':_0xf9c0c8(0x250)}}})});if(!_0x4c0e0e['ok']){let _0x503d5b=await _0x4c0e0e[_0xf9c0c8(0x200)]();return Y(_0xf9c0c8(0x1fd)+_0x4c0e0e[_0xf9c0c8(0x22f)]+'\x20'+_0x503d5b[_0xf9c0c8(0x21a)](0x0,0x64)),{'ok':!0x1,'error':_0xf9c0c8(0x229)+_0x4c0e0e[_0xf9c0c8(0x22f)]};}await _0x4c0e0e['text']();let _0x4a2b2b=(await(await fetch(f+'/mcp',{'method':_0xf9c0c8(0x23b),'headers':{'Content-Type':'application/json','Accept':_0xf9c0c8(0x202),...X?{'Authorization':_0xf9c0c8(0x259)+X}:{}},'body':JSON[_0xf9c0c8(0x22b)]({'jsonrpc':_0xf9c0c8(0x1f1),'id':0x2,'method':_0xf9c0c8(0x1dd),'params':{'name':_0x21579c,'arguments':_0x2263f1}})}))[_0xf9c0c8(0x200)]())[_0xf9c0c8(0x201)]('\x0a')[_0xf9c0c8(0x1f0)](_0x5aad60=>_0x5aad60[_0xf9c0c8(0x20c)](_0xf9c0c8(0x255)));if(_0x4a2b2b){let _0x2ce1cc=JSON[_0xf9c0c8(0x1e9)](_0x4a2b2b[_0xf9c0c8(0x21a)](0x6));return _0x2ce1cc?.[_0xf9c0c8(0x236)]?.[_0xf9c0c8(0x219)]?.[0x0]?.[_0xf9c0c8(0x200)]?JSON[_0xf9c0c8(0x1e9)](_0x2ce1cc[_0xf9c0c8(0x236)][_0xf9c0c8(0x219)][0x0]['text']):_0x2ce1cc;}return{'ok':!0x1,'error':_0xf9c0c8(0x1e6)};}K[a0_0x1f921f(0x20a)](a0_0x5560f9,async _0x2da047=>{const _0x5df8e8=a0_0x1f921f;let {name:_0x5bd268,arguments:_0x4175d3}=_0x2da047['params'];if(_0x5bd268===_0x5df8e8(0x23c)){let {task_id:_0x4959e8,text:_0x203018,status:_0x3ea46c}=_0x4175d3;if(_0x3ea46c==='completed'||_0x3ea46c===_0x5df8e8(0x242)||_0x3ea46c==='cancelled'){let _0x5ac1e0=_0x3ea46c===_0x5df8e8(0x243)?_0x5df8e8(0x1ea):_0x3ea46c,_0x57d812=_0x4959e8?k[_0x5df8e8(0x1f3)](_0x4959e8)||_0x5df8e8(0x251):_0x5df8e8(0x251),_0x559d4c=await P(_0x5df8e8(0x1f6),{'alias':_0x57d812,'text':_0x203018,'in_reply_to':_0x4959e8||void 0x0,'status':_0x5ac1e0,'from_session':Z});if(_0x4959e8)k['delete'](_0x4959e8);return{'content':[{'type':_0x5df8e8(0x200),'text':JSON[_0x5df8e8(0x22b)](_0x559d4c)}]};}let _0x596c81=await P(_0x5df8e8(0x239),{'resume_id':w,'alias':Z,'status':_0x3ea46c==='blocked'?_0x5df8e8(0x249):_0x3ea46c===_0x5df8e8(0x224)?_0x5df8e8(0x224):_0x5df8e8(0x25d),'task':_0x203018[_0x5df8e8(0x21a)](0x0,0xc8),'output':_0x203018});return{'content':[{'type':_0x5df8e8(0x200),'text':JSON[_0x5df8e8(0x22b)](_0x596c81)}]};}if(_0x5bd268===_0x5df8e8(0x245)){let {status:_0x2dd303,task:_0x33bf6b,progress:_0xf3b3e3}=_0x4175d3,_0x25b3fa=await P(_0x5df8e8(0x239),{'resume_id':w,'alias':Z,'status':_0x2dd303,'task':_0x33bf6b,'progress':_0xf3b3e3});return{'content':[{'type':_0x5df8e8(0x200),'text':JSON[_0x5df8e8(0x22b)](_0x25b3fa)}]};}if(_0x5bd268===_0x5df8e8(0x24c)){let {alias:_0x1e1f5e,task:_0x33477c,priority:_0x2a2ab5}=_0x4175d3,_0x17b25b=await P('send_task',{'alias':_0x1e1f5e,'task':_0x33477c,'priority':_0x2a2ab5||_0x5df8e8(0x241),'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x5df8e8(0x22b)](_0x17b25b)}]};}if(_0x5bd268===_0x5df8e8(0x1e3)){let {alias:_0x49a7bd,message:_0x3595dd}=_0x4175d3,_0x48a20a=await P(_0x5df8e8(0x254),{'alias':_0x49a7bd,'message':_0x3595dd,'from_session':Z});return{'content':[{'type':_0x5df8e8(0x200),'text':JSON[_0x5df8e8(0x22b)](_0x48a20a)}]};}if(_0x5bd268===_0x5df8e8(0x1fb)){let _0x223836=await P(_0x5df8e8(0x238),{});return{'content':[{'type':'text','text':JSON['stringify'](_0x223836)}]};}return{'content':[{'type':_0x5df8e8(0x200),'text':JSON[_0x5df8e8(0x22b)]({'error':_0x5df8e8(0x1e4)})}]};});async function u(){const _0x16cec5=a0_0x1f921f;let _0x575aa7=f+_0x16cec5(0x1e8)+encodeURIComponent(Z),_0x57fe5b={};if(X)_0x57fe5b['Authorization']=_0x16cec5(0x259)+X;Y('connecting\x20to\x20'+_0x575aa7);while(!0x0){try{let _0x25dda5=await fetch(_0x575aa7,{'headers':_0x57fe5b});if(!_0x25dda5['ok']){Y('SSE\x20error:\x20'+_0x25dda5[_0x16cec5(0x22f)]+'\x20'+_0x25dda5[_0x16cec5(0x220)]),await h(0x1388);continue;}let _0x1daa25=_0x25dda5[_0x16cec5(0x1f5)][_0x16cec5(0x208)](),_0x32d971=new TextDecoder(),_0x4c0f86='';while(!0x0){let {done:_0x517ed8,value:_0x55076d}=await _0x1daa25[_0x16cec5(0x1f4)]();if(_0x517ed8)break;_0x4c0f86+=_0x32d971[_0x16cec5(0x205)](_0x55076d,{'stream':!0x0});let _0x25ff0f=_0x4c0f86[_0x16cec5(0x201)]('\x0a\x0a');_0x4c0f86=_0x25ff0f['pop']()||'';for(let _0x1911e4 of _0x25ff0f){let _0x4be4f2=_0x1911e4[_0x16cec5(0x201)]('\x0a')[_0x16cec5(0x1f0)](_0x41ad3e=>_0x41ad3e[_0x16cec5(0x20c)]('data:\x20'));if(!_0x4be4f2)continue;try{let _0x301d3b=JSON[_0x16cec5(0x1e9)](_0x4be4f2['slice'](0x6));await S(_0x301d3b);}catch(_0x2801d8){Y('parse\x20error:\x20'+_0x2801d8);}}}Y('SSE\x20stream\x20ended,\x20reconnecting...');}catch(_0x573617){Y(_0x16cec5(0x212)+_0x573617);}await h(0xbb8);}}async function S(_0x136b3c){const _0x11d270=a0_0x1f921f;if(_0x136b3c[_0x11d270(0x1e5)]===_0x11d270(0x1ec)){Y(_0x11d270(0x1d6)+Z+'\x22');return;}if(_0x136b3c[_0x11d270(0x1e5)]===_0x11d270(0x209)){if(Y(_0x11d270(0x21b)+_0x136b3c[_0x11d270(0x1d4)]+':\x20'+_0x136b3c['message'][_0x11d270(0x21a)](0x0,0x3c)),await K['notification']({'method':_0x11d270(0x1e2),'params':{'content':_0x136b3c[_0x11d270(0x1e1)],'meta':{'sender':_0x136b3c['from']||_0x11d270(0x251),'sender_id':'commhub','user':_0x136b3c['from']||_0x11d270(0x251),'priority':_0x11d270(0x241)}}}),_0x136b3c[_0x11d270(0x1e0)])await P(_0x11d270(0x231),{'alias':Z,'message_id':_0x136b3c[_0x11d270(0x1e0)]});return;}if(_0x136b3c['type']===_0x11d270(0x256)||_0x136b3c['type']==='broadcast'){Y('←\x20'+_0x136b3c[_0x11d270(0x1e5)]+':\x20inbox_count='+_0x136b3c[_0x11d270(0x25c)]+_0x11d270(0x24e)+(_0x136b3c[_0x11d270(0x1d3)]||_0x11d270(0x241)));let _0x35ba66=await P(_0x11d270(0x25b),{'alias':Z,'limit':0x5});if(_0x35ba66?.['ok']&&_0x35ba66[_0x11d270(0x1ed)]?.[_0x11d270(0x22d)]>0x0)for(let _0x3e23a4 of _0x35ba66['messages']){let _0x2f9160={'sender':_0x3e23a4['from_session']||_0x11d270(0x251),'sender_id':_0x11d270(0x1e7),'user':_0x3e23a4[_0x11d270(0x253)]||_0x11d270(0x251),'task_id':_0x3e23a4['id'],'priority':_0x3e23a4[_0x11d270(0x1d3)]||_0x11d270(0x241)};k['set'](_0x3e23a4['id'],_0x3e23a4[_0x11d270(0x253)]||_0x11d270(0x251)),await K[_0x11d270(0x247)]({'method':'notifications/claude/channel','params':{'content':_0x3e23a4['content'],'meta':_0x2f9160}}),Y(_0x11d270(0x221)+_0x3e23a4['id']['slice'](0x0,0x8)+'\x20from\x20'+_0x3e23a4['from_session']+':\x20'+_0x3e23a4[_0x11d270(0x219)][_0x11d270(0x21a)](0x0,0x3c)),await P('ack_inbox',{'alias':Z,'message_id':_0x3e23a4['id']});}}}async function A(){const _0x1a7e37=a0_0x1f921f;let _0x50cce9=new a0_0x51fe97();await K[_0x1a7e37(0x1f2)](_0x50cce9),Y('MCP\x20stdio\x20connected'),Y('starting\x20SSE\x20listener...'),u()[_0x1a7e37(0x257)](_0xac0d9b=>Y(_0x1a7e37(0x230)+_0xac0d9b)),P('report_status',{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x116d52(),'hostname':a0_0x116d52(),'agent':_0x1a7e37(0x244),'project_dir':process[_0x1a7e37(0x240)](),'tmux_name':j||void 0x0})[_0x1a7e37(0x213)](()=>Y(_0x1a7e37(0x1d8)+Z+'\x22\x20('+w['slice'](0x0,0x8)+')'))[_0x1a7e37(0x257)](_0x5dc817=>Y(_0x1a7e37(0x24f)+_0x5dc817)),setInterval(()=>{const _0x7ff878=_0x1a7e37;P('report_status',{'resume_id':w,'alias':Z,'status':_0x7ff878(0x203),'server':a0_0x116d52(),'hostname':a0_0x116d52(),'agent':_0x7ff878(0x244),'project_dir':process['cwd'](),'tmux_name':j||void 0x0})[_0x7ff878(0x257)](_0x24ac6b=>Y(_0x7ff878(0x1da)+_0x24ac6b));},0x2bf20),Y(_0x1a7e37(0x226));}A()[a0_0x1f921f(0x257)](_0x50ad74=>{const _0x1a5465=a0_0x1f921f;Y('fatal:\x20'+_0x50ad74),process[_0x1a5465(0x22e)](0x1);});async function N(){const _0x146193=a0_0x1f921f;Y('shutting\x20down,\x20reporting\x20offline...'),await P(_0x146193(0x239),{'resume_id':w,'alias':Z,'status':'error','task':_0x146193(0x1f7)})[_0x146193(0x257)](()=>{}),process['exit'](0x0);}process[a0_0x1f921f(0x1ee)]['on'](a0_0x1f921f(0x1d7),()=>N()),process['on'](a0_0x1f921f(0x228),()=>N()),process['on']('SIGINT',()=>N());
2
+ function a0_0x55aa(){const _0x22d5ee=['You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','init\x20failed:\x20','commhub_send_message','get_inbox','startsWith','text','shutting\x20down,\x20reporting\x20offline...','tools/call','setRequestHandler','commhub_reply','0.3.0','send_message','cancelled','messages','replied','none','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','data:\x20','inbox_count','commhub_get_all_status','high','report_status','connect','Reply\x20text\x20/\x20result\x20summary','completed','token','2845420SBxpny','\x20PROJECT_ENV=','notification','commhub_report_status','write','1579334oYPOYL','unknown\x20tool',']\x20[commhub]\x20','find','.anet','Session\x20alias:\x20','connecting\x20to\x20','SIGTERM','.claude/channels/commhub','...\x20TMUX=','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','cwd','getReader','1429887qJUOPo','normal','set','Priority\x20(default:\x20normal)','no\x20response','7273070LmsCFX','.env','error','get','replace','Task\x20content','stdin','ready\x20—\x20waiting\x20for\x20events','starting\x20SSE\x20listener...','Progress\x200-100','Message\x20content','message_id','priority','commhub','notifications/claude/channel','from','message','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','read','http://127.0.0.1:9200','\x20priority=','SSE\x20error:\x20','stringify','claude-code','Bearer\x20','idle','/events/','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','855976ywvOBK','new_message','from_session','delete','hub','status','\x20RESUME_ID=','ack_inbox','POST','alias','send_task','decode','body','stderr','toTimeString','result','tmux\x20display-message\x20-p\x20\x27#S\x27','catch','failed','parse','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','2.0','commhub_send_task','object','string','fatal:\x20','content','slice','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','send_reply','586416AaCScW','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','\x20from\x20','params','trim','pop','Target\x20session\x20alias','2025-03-26','working','get_all_status','155112IecCAy','←\x20message\x20from\x20','SSE\x20fatal:\x20','session\x20disconnected','/mcp','application/json','parse\x20error:\x20','ENV:\x20URL=','utf-8','exit','blocked','split','\x20ALIAS=','SIGINT','type','length','new_task','→\x20injected\x20task\x20','task','SSE\x20connection\x20error:\x20'];a0_0x55aa=function(){return _0x22d5ee;};return a0_0x55aa();}const a0_0x478e8c=a0_0x5bab;(function(_0x1b7c71,_0x316567){const _0x4814a4=a0_0x5bab,_0x1f0b53=_0x1b7c71();while(!![]){try{const _0x2c1557=-parseInt(_0x4814a4(0x112))/0x1+parseInt(_0x4814a4(0xc4))/0x2+parseInt(_0x4814a4(0xd1))/0x3+parseInt(_0x4814a4(0xf2))/0x4+parseInt(_0x4814a4(0xbf))/0x5+-parseInt(_0x4814a4(0x11c))/0x6+-parseInt(_0x4814a4(0xd6))/0x7;if(_0x2c1557===_0x316567)break;else _0x1f0b53['push'](_0x1f0b53['shift']());}catch(_0x2e2362){_0x1f0b53['push'](_0x1f0b53['shift']());}}}(a0_0x55aa,0x61310));function a0_0x5bab(_0xaec352,_0x42427f){_0xaec352=_0xaec352-0xa3;const _0x55aa90=a0_0x55aa();let _0x5babb3=_0x55aa90[_0xaec352];return _0x5babb3;}import{readFileSync as a0_0x4e26c0,existsSync as a0_0x360c03}from'fs';import{randomUUID as a0_0x2d189c}from'crypto';import{join as a0_0x567fff}from'path';import{hostname as a0_0x2aaf56}from'os';import{execSync as a0_0xcdb53f}from'child_process';import{Server as a0_0x23e516}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x5a693c}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x230a93,CallToolRequestSchema as a0_0x292ca4}from'@modelcontextprotocol/sdk/types.js';function p(_0x4adf26){const _0x2fd762=a0_0x5bab;if(!a0_0x360c03(_0x4adf26))return;for(let _0x830c56 of a0_0x4e26c0(_0x4adf26,_0x2fd762(0x124))[_0x2fd762(0x127)]('\x0a')){let _0x13a933=_0x830c56['trim']();if(!_0x13a933||_0x13a933['startsWith']('#'))continue;let _0x5b91c9=_0x13a933['indexOf']('=');if(_0x5b91c9<0x0)continue;let _0x3235db=_0x13a933[_0x2fd762(0x10f)](0x0,_0x5b91c9)[_0x2fd762(0x116)](),_0xef2cdb=_0x13a933[_0x2fd762(0x10f)](_0x5b91c9+0x1)[_0x2fd762(0x116)]()[_0x2fd762(0xda)](/^["']|["']$/g,'');if(!process.env[_0x3235db])process.env[_0x3235db]=_0xef2cdb;}}var C=process.env.HOME||'~',T=a0_0x567fff(C,a0_0x478e8c(0xcc));p(a0_0x567fff(T,a0_0x478e8c(0xd7)));var L=process['cwd']()[a0_0x478e8c(0xda)](/\//g,'-');p(a0_0x567fff(T,L,a0_0x478e8c(0xd7)));function U(){const _0x573373=a0_0x478e8c;try{return a0_0xcdb53f(_0x573373(0x102),{'encoding':_0x573373(0x124),'timeout':0x7d0})['trim']();}catch{return'';}}function v(){const _0x31b227=a0_0x478e8c;try{let _0x588e28=a0_0x567fff(C,_0x31b227(0xc8),'config.json');if(a0_0x360c03(_0x588e28))return JSON[_0x31b227(0x105)](a0_0x4e26c0(_0x588e28,'utf-8'));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H['hub']||a0_0x478e8c(0xe9),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x2aaf56(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x2d189c(),X=process.env.COMMHUB_TOKEN||H[a0_0x478e8c(0xbe)]||'';function Y(_0x7e915a){const _0x1da755=a0_0x478e8c;let _0x33902f=new Date()[_0x1da755(0x100)]()[_0x1da755(0x10f)](0x0,0x8);process[_0x1da755(0xff)][_0x1da755(0xc3)]('['+_0x33902f+_0x1da755(0xc6)+_0x7e915a+'\x0a');}function h(_0x31073d){return new Promise(_0x173d03=>setTimeout(_0x173d03,_0x31073d));}Y(a0_0x478e8c(0x123)+f+a0_0x478e8c(0x128)+Z+a0_0x478e8c(0xf8)+w[a0_0x478e8c(0x10f)](0x0,0x8)+a0_0x478e8c(0xcd)+(j||a0_0x478e8c(0xb4))+'\x20CWD='+process['cwd']()+a0_0x478e8c(0xc0)+L);var k=new Map(),K=new a0_0x23e516({'name':'commhub-channel','version':a0_0x478e8c(0xaf)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x478e8c(0xe7),a0_0x478e8c(0x106),a0_0x478e8c(0x110),a0_0x478e8c(0xa5),a0_0x478e8c(0xc9)+Z]['join']('\x0a')});K[a0_0x478e8c(0xad)](a0_0x230a93,async()=>({'tools':[{'name':a0_0x478e8c(0xae),'description':a0_0x478e8c(0xb5),'inputSchema':{'type':a0_0x478e8c(0x10b),'properties':{'task_id':{'type':a0_0x478e8c(0x10c),'description':a0_0x478e8c(0x107)},'text':{'type':a0_0x478e8c(0x10c),'description':a0_0x478e8c(0xbc)},'status':{'type':'string','enum':[a0_0x478e8c(0xbd),'failed',a0_0x478e8c(0xb1),a0_0x478e8c(0x126),a0_0x478e8c(0xd8),'in_progress'],'description':a0_0x478e8c(0xf1)}},'required':[a0_0x478e8c(0xaa)]}},{'name':a0_0x478e8c(0xc2),'description':a0_0x478e8c(0x113),'inputSchema':{'type':'object','properties':{'status':{'type':a0_0x478e8c(0x10c),'enum':['working',a0_0x478e8c(0xef),a0_0x478e8c(0x126),a0_0x478e8c(0xd8)]},'task':{'type':a0_0x478e8c(0x10c),'description':'Current\x20task\x20description'},'progress':{'type':'number','description':a0_0x478e8c(0xdf)}},'required':[a0_0x478e8c(0xf7)]}},{'name':a0_0x478e8c(0x10a),'description':a0_0x478e8c(0xce),'inputSchema':{'type':'object','properties':{'alias':{'type':'string','description':'Target\x20session\x20alias'},'task':{'type':a0_0x478e8c(0x10c),'description':a0_0x478e8c(0xdb)},'priority':{'type':'string','enum':[a0_0x478e8c(0xb9),a0_0x478e8c(0xd2),'low'],'description':a0_0x478e8c(0xd4)}},'required':[a0_0x478e8c(0xfb),a0_0x478e8c(0xa3)]}},{'name':a0_0x478e8c(0xa7),'description':a0_0x478e8c(0x108),'inputSchema':{'type':'object','properties':{'alias':{'type':'string','description':a0_0x478e8c(0x118)},'message':{'type':a0_0x478e8c(0x10c),'description':a0_0x478e8c(0xe0)}},'required':[a0_0x478e8c(0xfb),a0_0x478e8c(0xe6)]}},{'name':a0_0x478e8c(0xb8),'description':'Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','inputSchema':{'type':'object','properties':{}}}]}));async function P(_0x3f08d8,_0x481915){const _0x3dd701=a0_0x478e8c;let _0x628bd8=await fetch(f+_0x3dd701(0x120),{'method':'POST','headers':{'Content-Type':_0x3dd701(0x121),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x3dd701(0xee)+X}:{}},'body':JSON[_0x3dd701(0xec)]({'jsonrpc':_0x3dd701(0x109),'id':0x1,'method':'initialize','params':{'protocolVersion':_0x3dd701(0x119),'capabilities':{},'clientInfo':{'name':'commhub-channel','version':'0.3.0'}}})});if(!_0x628bd8['ok']){let _0xce116=await _0x628bd8[_0x3dd701(0xaa)]();return Y('CommHub\x20init\x20failed:\x20'+_0x628bd8[_0x3dd701(0xf7)]+'\x20'+_0xce116[_0x3dd701(0x10f)](0x0,0x64)),{'ok':!0x1,'error':_0x3dd701(0xa6)+_0x628bd8[_0x3dd701(0xf7)]};}await _0x628bd8['text']();let _0x576ce1=(await(await fetch(f+'/mcp',{'method':_0x3dd701(0xfa),'headers':{'Content-Type':_0x3dd701(0x121),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x3dd701(0xee)+X}:{}},'body':JSON['stringify']({'jsonrpc':'2.0','id':0x2,'method':_0x3dd701(0xac),'params':{'name':_0x3f08d8,'arguments':_0x481915}})}))['text']())[_0x3dd701(0x127)]('\x0a')['find'](_0x473473=>_0x473473[_0x3dd701(0xa9)](_0x3dd701(0xb6)));if(_0x576ce1){let _0x406fe6=JSON['parse'](_0x576ce1[_0x3dd701(0x10f)](0x6));return _0x406fe6?.[_0x3dd701(0x101)]?.[_0x3dd701(0x10e)]?.[0x0]?.['text']?JSON[_0x3dd701(0x105)](_0x406fe6['result']['content'][0x0][_0x3dd701(0xaa)]):_0x406fe6;}return{'ok':!0x1,'error':_0x3dd701(0xd5)};}K['setRequestHandler'](a0_0x292ca4,async _0x44d378=>{const _0x155c96=a0_0x478e8c;let {name:_0x201656,arguments:_0xd5b5e0}=_0x44d378[_0x155c96(0x115)];if(_0x201656==='commhub_reply'){let {task_id:_0x328e67,text:_0x101494,status:_0x4b116f}=_0xd5b5e0;if(_0x4b116f===_0x155c96(0xbd)||_0x4b116f===_0x155c96(0x104)||_0x4b116f===_0x155c96(0xb1)){let _0x27a162=_0x4b116f===_0x155c96(0xbd)?_0x155c96(0xb3):_0x4b116f,_0x38d818=_0x328e67?k[_0x155c96(0xd9)](_0x328e67)||_0x155c96(0xf6):'hub',_0x13e412=await P(_0x155c96(0x111),{'alias':_0x38d818,'text':_0x101494,'in_reply_to':_0x328e67||void 0x0,'status':_0x27a162,'from_session':Z});if(_0x328e67)k[_0x155c96(0xf5)](_0x328e67);return{'content':[{'type':_0x155c96(0xaa),'text':JSON[_0x155c96(0xec)](_0x13e412)}]};}let _0x3bb4b3=await P(_0x155c96(0xba),{'resume_id':w,'alias':Z,'status':_0x4b116f===_0x155c96(0x126)?_0x155c96(0x126):_0x4b116f===_0x155c96(0xd8)?'error':_0x155c96(0x11a),'task':_0x101494[_0x155c96(0x10f)](0x0,0xc8),'output':_0x101494});return{'content':[{'type':_0x155c96(0xaa),'text':JSON['stringify'](_0x3bb4b3)}]};}if(_0x201656==='commhub_report_status'){let {status:_0x273b28,task:_0x1fdaa7,progress:_0x29664f}=_0xd5b5e0,_0x209459=await P(_0x155c96(0xba),{'resume_id':w,'alias':Z,'status':_0x273b28,'task':_0x1fdaa7,'progress':_0x29664f});return{'content':[{'type':_0x155c96(0xaa),'text':JSON['stringify'](_0x209459)}]};}if(_0x201656===_0x155c96(0x10a)){let {alias:_0x519c40,task:_0x50af50,priority:_0x38ec85}=_0xd5b5e0,_0x4c841c=await P(_0x155c96(0xfc),{'alias':_0x519c40,'task':_0x50af50,'priority':_0x38ec85||_0x155c96(0xd2),'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x155c96(0xec)](_0x4c841c)}]};}if(_0x201656==='commhub_send_message'){let {alias:_0x56c10a,message:_0x30cedb}=_0xd5b5e0,_0x4205b6=await P(_0x155c96(0xb0),{'alias':_0x56c10a,'message':_0x30cedb,'from_session':Z});return{'content':[{'type':_0x155c96(0xaa),'text':JSON[_0x155c96(0xec)](_0x4205b6)}]};}if(_0x201656===_0x155c96(0xb8)){let _0x2d5c14=await P(_0x155c96(0x11b),{});return{'content':[{'type':_0x155c96(0xaa),'text':JSON['stringify'](_0x2d5c14)}]};}return{'content':[{'type':_0x155c96(0xaa),'text':JSON['stringify']({'error':_0x155c96(0xc5)})}]};});async function u(){const _0x206761=a0_0x478e8c;let _0x40fd0b=f+_0x206761(0xf0)+encodeURIComponent(Z),_0x426d7d={};if(X)_0x426d7d['Authorization']=_0x206761(0xee)+X;Y(_0x206761(0xca)+_0x40fd0b);while(!0x0){try{let _0x15dd2a=await fetch(_0x40fd0b,{'headers':_0x426d7d});if(!_0x15dd2a['ok']){Y(_0x206761(0xeb)+_0x15dd2a[_0x206761(0xf7)]+'\x20'+_0x15dd2a['statusText']),await h(0x1388);continue;}let _0x4eb9af=_0x15dd2a[_0x206761(0xfe)][_0x206761(0xd0)](),_0x12f36f=new TextDecoder(),_0x521578='';while(!0x0){let {done:_0x169d73,value:_0x41b69e}=await _0x4eb9af[_0x206761(0xe8)]();if(_0x169d73)break;_0x521578+=_0x12f36f[_0x206761(0xfd)](_0x41b69e,{'stream':!0x0});let _0x1302e4=_0x521578[_0x206761(0x127)]('\x0a\x0a');_0x521578=_0x1302e4[_0x206761(0x117)]()||'';for(let _0x1c787f of _0x1302e4){let _0x978c8c=_0x1c787f['split']('\x0a')[_0x206761(0xc7)](_0x2b0f4e=>_0x2b0f4e['startsWith'](_0x206761(0xb6)));if(!_0x978c8c)continue;try{let _0x3de157=JSON['parse'](_0x978c8c['slice'](0x6));await S(_0x3de157);}catch(_0x531286){Y(_0x206761(0x122)+_0x531286);}}}Y('SSE\x20stream\x20ended,\x20reconnecting...');}catch(_0x51f466){Y(_0x206761(0xa4)+_0x51f466);}await h(0xbb8);}}async function S(_0x546ea9){const _0x331f77=a0_0x478e8c;if(_0x546ea9[_0x331f77(0x12a)]==='connected'){Y('SSE\x20connected\x20as\x20\x22'+Z+'\x22');return;}if(_0x546ea9[_0x331f77(0x12a)]===_0x331f77(0xf3)){if(Y(_0x331f77(0x11d)+_0x546ea9[_0x331f77(0xe5)]+':\x20'+_0x546ea9[_0x331f77(0xe6)][_0x331f77(0x10f)](0x0,0x3c)),await K['notification']({'method':_0x331f77(0xe4),'params':{'content':_0x546ea9['message'],'meta':{'sender':_0x546ea9[_0x331f77(0xe5)]||_0x331f77(0xf6),'sender_id':_0x331f77(0xe3),'user':_0x546ea9[_0x331f77(0xe5)]||_0x331f77(0xf6),'priority':_0x331f77(0xd2)}}}),_0x546ea9['message_id'])await P(_0x331f77(0xf9),{'alias':Z,'message_id':_0x546ea9[_0x331f77(0xe1)]});return;}if(_0x546ea9[_0x331f77(0x12a)]===_0x331f77(0x12c)||_0x546ea9[_0x331f77(0x12a)]==='broadcast'){Y('←\x20'+_0x546ea9[_0x331f77(0x12a)]+':\x20inbox_count='+_0x546ea9[_0x331f77(0xb7)]+_0x331f77(0xea)+(_0x546ea9[_0x331f77(0xe2)]||'normal'));let _0x455f12=await P(_0x331f77(0xa8),{'alias':Z,'limit':0x5});if(_0x455f12?.['ok']&&_0x455f12[_0x331f77(0xb2)]?.[_0x331f77(0x12b)]>0x0)for(let _0x33748c of _0x455f12[_0x331f77(0xb2)]){let _0x27c415={'sender':_0x33748c[_0x331f77(0xf4)]||_0x331f77(0xf6),'sender_id':_0x331f77(0xe3),'user':_0x33748c[_0x331f77(0xf4)]||'hub','task_id':_0x33748c['id'],'priority':_0x33748c[_0x331f77(0xe2)]||'normal'};k[_0x331f77(0xd3)](_0x33748c['id'],_0x33748c['from_session']||'hub'),await K[_0x331f77(0xc1)]({'method':_0x331f77(0xe4),'params':{'content':_0x33748c[_0x331f77(0x10e)],'meta':_0x27c415}}),Y(_0x331f77(0x12d)+_0x33748c['id'][_0x331f77(0x10f)](0x0,0x8)+_0x331f77(0x114)+_0x33748c[_0x331f77(0xf4)]+':\x20'+_0x33748c['content'][_0x331f77(0x10f)](0x0,0x3c)),await P(_0x331f77(0xf9),{'alias':Z,'message_id':_0x33748c['id']});}}}async function A(){const _0x4fa91f=a0_0x478e8c;let _0x5197b6=new a0_0x5a693c();await K[_0x4fa91f(0xbb)](_0x5197b6),Y('MCP\x20stdio\x20connected'),Y(_0x4fa91f(0xde)),u()[_0x4fa91f(0x103)](_0x4f5a19=>Y(_0x4fa91f(0x11e)+_0x4f5a19)),P(_0x4fa91f(0xba),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x2aaf56(),'hostname':a0_0x2aaf56(),'agent':_0x4fa91f(0xed),'project_dir':process[_0x4fa91f(0xcf)](),'tmux_name':j||void 0x0})['then'](()=>Y('registered\x20as\x20\x22'+Z+'\x22\x20('+w[_0x4fa91f(0x10f)](0x0,0x8)+')'))['catch'](_0x2044c2=>Y('warning:\x20could\x20not\x20register:\x20'+_0x2044c2)),setInterval(()=>{const _0x1c1d67=_0x4fa91f;P(_0x1c1d67(0xba),{'resume_id':w,'alias':Z,'status':_0x1c1d67(0xef),'server':a0_0x2aaf56(),'hostname':a0_0x2aaf56(),'agent':'claude-code','project_dir':process[_0x1c1d67(0xcf)](),'tmux_name':j||void 0x0})[_0x1c1d67(0x103)](_0x3fe624=>Y('heartbeat\x20failed:\x20'+_0x3fe624));},0x2bf20),Y(_0x4fa91f(0xdd));}A()[a0_0x478e8c(0x103)](_0x23ce00=>{const _0x4f79d2=a0_0x478e8c;Y(_0x4f79d2(0x10d)+_0x23ce00),process[_0x4f79d2(0x125)](0x1);});async function N(){const _0x1302e5=a0_0x478e8c;Y(_0x1302e5(0xab)),await P('report_status',{'resume_id':w,'alias':Z,'status':_0x1302e5(0xd8),'task':_0x1302e5(0x11f)})[_0x1302e5(0x103)](()=>{}),process[_0x1302e5(0x125)](0x0);}process[a0_0x478e8c(0xdc)]['on']('end',()=>N()),process['on'](a0_0x478e8c(0xcb),()=>N()),process['on'](a0_0x478e8c(0x129),()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.0.1-preview.1",
3
+ "version": "2.0.1-preview.3",
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",