@sleep2agi/agent-network 2.1.0 → 2.1.2

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_0x405b(_0x22765c,_0x29f12a){_0x22765c=_0x22765c-0x72;const _0x451c68=a0_0x451c();let _0x405bf5=_0x451c68[_0x22765c];return _0x405bf5;}const a0_0x58c682=a0_0x405b;(function(_0x7e7d53,_0x32c8a7){const _0x349de4=a0_0x405b,_0x471087=_0x7e7d53();while(!![]){try{const _0x1729bd=-parseInt(_0x349de4(0xc6))/0x1+-parseInt(_0x349de4(0x9e))/0x2*(-parseInt(_0x349de4(0x8c))/0x3)+-parseInt(_0x349de4(0x76))/0x4*(-parseInt(_0x349de4(0x9c))/0x5)+-parseInt(_0x349de4(0xac))/0x6*(-parseInt(_0x349de4(0x82))/0x7)+-parseInt(_0x349de4(0xc8))/0x8*(-parseInt(_0x349de4(0xbb))/0x9)+-parseInt(_0x349de4(0xb0))/0xa*(parseInt(_0x349de4(0x97))/0xb)+-parseInt(_0x349de4(0xb8))/0xc*(parseInt(_0x349de4(0x7a))/0xd);if(_0x1729bd===_0x32c8a7)break;else _0x471087['push'](_0x471087['shift']());}catch(_0x23a47f){_0x471087['push'](_0x471087['shift']());}}}(a0_0x451c,0x87fd6));import{EventEmitter as a0_0x1aeff1}from'events';import{hostname as a0_0x45ec76}from'os';class T extends a0_0x1aeff1{[a0_0x58c682(0xa5)];['alias'];[a0_0x58c682(0xa3)];['agent'];[a0_0x58c682(0x80)];['heartbeatInterval'];[a0_0x58c682(0x7d)];[a0_0x58c682(0xb5)];['sseAbort'];[a0_0x58c682(0x7c)]=!0x1;constructor(_0x3224d1){const _0x48ef99=a0_0x58c682;super();if(this[_0x48ef99(0xa5)]=_0x3224d1[_0x48ef99(0xa5)]['replace'](/\/$/,''),this[_0x48ef99(0xa7)]=_0x3224d1[_0x48ef99(0xa7)],this['token']=_0x3224d1['token'],this[_0x48ef99(0x83)]=_0x3224d1[_0x48ef99(0x83)]||'sdk',this[_0x48ef99(0x80)]='sdk-'+_0x3224d1[_0x48ef99(0xa7)]+'-'+Date['now']()[_0x48ef99(0xba)](0x24),this[_0x48ef99(0xc5)]=_0x3224d1[_0x48ef99(0xc5)]??0x2bf20,this[_0x48ef99(0x7d)]=_0x3224d1[_0x48ef99(0x7d)]??0xbb8,_0x3224d1[_0x48ef99(0xc9)]!==!0x1)this['connect']();}[a0_0x58c682(0x98)](_0xc595a4){const _0x4d9b11=a0_0x58c682;console['log']('['+new Date()['toTimeString']()[_0x4d9b11(0x90)](0x0,0x8)+_0x4d9b11(0x85)+this[_0x4d9b11(0xa7)]+']\x20'+_0xc595a4);}async[a0_0x58c682(0xbc)](_0x1f36dd,_0x5e42f6){const _0x3db04e=a0_0x58c682;let _0x544970={'Content-Type':_0x3db04e(0x75),'Accept':_0x3db04e(0xb4)};if(this[_0x3db04e(0xa3)])_0x544970[_0x3db04e(0x99)]=_0x3db04e(0x7f)+this[_0x3db04e(0xa3)];let _0x39d342=await(await fetch(this[_0x3db04e(0xa5)]+_0x3db04e(0x87),{'method':_0x3db04e(0x96),'headers':_0x544970,'body':JSON[_0x3db04e(0x8f)]({'jsonrpc':_0x3db04e(0x94),'id':Date[_0x3db04e(0x8e)](),'method':'tools/call','params':{'name':_0x1f36dd,'arguments':_0x5e42f6}})}))[_0x3db04e(0xb1)](),_0x33033c=_0x39d342[_0x3db04e(0x77)](/data: (.+)/),_0x1393fc=_0x33033c?JSON[_0x3db04e(0xa9)](_0x33033c[0x1]):JSON[_0x3db04e(0xa9)](_0x39d342),_0x4133cc=_0x1393fc?.[_0x3db04e(0x89)]?.[_0x3db04e(0xa6)]?.[0x0]?.[_0x3db04e(0xb1)];return _0x4133cc?JSON[_0x3db04e(0xa9)](_0x4133cc):_0x1393fc;}async['connect'](){const _0x230381=a0_0x58c682;if(this['running'])return;this[_0x230381(0x7c)]=!0x0,await this[_0x230381(0x74)](_0x230381(0x95)),this[_0x230381(0x98)](_0x230381(0xa2)),this[_0x230381(0xb5)]=setInterval(()=>{const _0x17333e=_0x230381;this['status'](_0x17333e(0x95))[_0x17333e(0x84)](_0x5a96f5=>this[_0x17333e(0x98)]('heartbeat\x20failed:\x20'+_0x5a96f5[_0x17333e(0x92)]));},this['heartbeatInterval']),this[_0x230381(0xbf)]();}async[a0_0x58c682(0x73)](){const _0x329888=a0_0x58c682;if(this['running']=!0x1,this['sseAbort']?.[_0x329888(0x91)](),this[_0x329888(0xb5)])clearInterval(this[_0x329888(0xb5)]);await this[_0x329888(0x74)](_0x329888(0x8b))[_0x329888(0x84)](()=>{}),this[_0x329888(0x98)](_0x329888(0xc2));}async[a0_0x58c682(0xbd)](_0x5aed2d,_0x35cfb7,_0x19ee55=a0_0x58c682(0x9b)){const _0x3cf3a5=a0_0x58c682;return this['call']('send_task',{'alias':_0x5aed2d,'task':_0x35cfb7,'priority':_0x19ee55,'from_session':this[_0x3cf3a5(0xa7)]});}async['message'](_0x3c30d9,_0x341063){const _0x5e9cde=a0_0x58c682;return this[_0x5e9cde(0xbc)]('send_message',{'alias':_0x3c30d9,'message':_0x341063,'from_session':this[_0x5e9cde(0xa7)]});}async[a0_0x58c682(0xa0)](_0x4d18cf,_0x5e0411,_0x2226b5=a0_0x58c682(0xcb)){const _0x3997d1=a0_0x58c682;return this['call'](_0x3997d1(0xa0),{'task_id':_0x4d18cf,'text':_0x5e0411,'status':_0x2226b5});}async[a0_0x58c682(0x74)](_0x542135,_0x40623f){const _0xfe3e07=a0_0x58c682;return this[_0xfe3e07(0xbc)](_0xfe3e07(0x9a),{'resume_id':this[_0xfe3e07(0x80)],'alias':this['alias'],'status':_0x542135,'server':a0_0x45ec76(),'hostname':a0_0x45ec76(),'agent':this['agent'],'project_dir':process[_0xfe3e07(0x8d)](),..._0x40623f});}async[a0_0x58c682(0xa1)](){const _0x538400=a0_0x58c682;return this[_0x538400(0xbc)]('get_all_status',{});}async['broadcast'](_0x50ecf2,_0x563288){const _0x40d152=a0_0x58c682;return this[_0x40d152(0xbc)](_0x40d152(0xca),{'message':_0x50ecf2,'filter_server':_0x563288?.[_0x40d152(0x7b)],'filter_status':_0x563288?.[_0x40d152(0x74)]});}async[a0_0x58c682(0xbf)](){const _0x587cc7=a0_0x58c682;let _0x3848fe=encodeURIComponent(this[_0x587cc7(0xa7)]),_0x2311d3=this[_0x587cc7(0xa5)]+'/events/'+_0x3848fe,_0x802ef7=this[_0x587cc7(0x7d)];while(this[_0x587cc7(0x7c)]){try{this[_0x587cc7(0xb7)]=new AbortController();let _0xf5faba={'Accept':_0x587cc7(0xb6)};if(this[_0x587cc7(0xa3)])_0xf5faba['Authorization']=_0x587cc7(0x7f)+this['token'];let _0x2f8ce2=await fetch(_0x2311d3,{'headers':_0xf5faba,'signal':this['sseAbort'][_0x587cc7(0xb3)]});if(!_0x2f8ce2['ok']||!_0x2f8ce2[_0x587cc7(0x79)]){this[_0x587cc7(0x98)](_0x587cc7(0xbe)+_0x2f8ce2['status']),await this[_0x587cc7(0x88)](_0x802ef7),_0x802ef7=Math[_0x587cc7(0xae)](_0x802ef7*1.5,0xea60);continue;}_0x802ef7=this['reconnectDelay'];let _0x3c2bf5=_0x2f8ce2['body'][_0x587cc7(0x8a)](),_0x5bd741=new TextDecoder(),_0x5e693f='';while(this[_0x587cc7(0x7c)]){let {done:_0x494439,value:_0x38b899}=await _0x3c2bf5['read']();if(_0x494439)break;_0x5e693f+=_0x5bd741[_0x587cc7(0xa4)](_0x38b899,{'stream':!0x0});let _0x250d28=_0x5e693f[_0x587cc7(0x7e)]('\x0a');_0x5e693f=_0x250d28[_0x587cc7(0x93)]()||'';for(let _0x4d76eb of _0x250d28){if(!_0x4d76eb[_0x587cc7(0xc0)]('data:\x20'))continue;try{let _0x2604b7=JSON[_0x587cc7(0xa9)](_0x4d76eb['slice'](0x6));if(_0x2604b7['type']===_0x587cc7(0x78)){this['log'](_0x587cc7(0xc7)),this[_0x587cc7(0x72)](_0x587cc7(0x78));continue;}if(_0x2604b7[_0x587cc7(0xb2)]===_0x587cc7(0xc4)||_0x2604b7[_0x587cc7(0xb2)]===_0x587cc7(0x86)||_0x2604b7[_0x587cc7(0xb2)]===_0x587cc7(0xca))await this[_0x587cc7(0xad)]();}catch{}}}}catch(_0x8efa90){if(_0x8efa90['name']===_0x587cc7(0xaf))break;this[_0x587cc7(0x72)](_0x587cc7(0xc1),_0x8efa90),this[_0x587cc7(0x98)](_0x587cc7(0x81)+_0x8efa90[_0x587cc7(0x92)]);}if(this[_0x587cc7(0x7c)])this['emit'](_0x587cc7(0xc2)),this['log'](_0x587cc7(0x9d)+_0x802ef7/0x3e8+_0x587cc7(0xa8)),await this[_0x587cc7(0x88)](_0x802ef7),_0x802ef7=Math['min'](_0x802ef7*1.5,0xea60);}}async[a0_0x58c682(0xad)](){const _0x3701c1=a0_0x58c682;try{let _0x547102=(await this[_0x3701c1(0xbc)](_0x3701c1(0xaa),{'alias':this[_0x3701c1(0xa7)],'limit':0xa}))?.['messages']||[];for(let _0x363ac5 of _0x547102)await this['call'](_0x3701c1(0x9f),{'alias':this[_0x3701c1(0xa7)],'message_id':_0x363ac5['id']}),this[_0x3701c1(0x98)]('←\x20'+_0x363ac5[_0x3701c1(0xab)]+':\x20'+_0x363ac5[_0x3701c1(0xa6)]['slice'](0x0,0x3c)),this[_0x3701c1(0x72)](_0x3701c1(0xb9),_0x363ac5),this[_0x3701c1(0x72)](_0x3701c1(0x92),_0x363ac5);}catch(_0xdb18ea){this['log'](_0x3701c1(0xc3)+_0xdb18ea[_0x3701c1(0x92)]);}}[a0_0x58c682(0x88)](_0x35379d){return new Promise(_0x462af4=>setTimeout(_0x462af4,_0x35379d));}}var $=T;function a0_0x451c(){const _0x2b365d=['SSE\x20failed:\x20','connectSSE','startsWith','error','disconnected','inbox\x20error:\x20','new_task','heartbeatInterval','988702tuNhfE','SSE\x20connected','776NHdAGM','autoConnect','broadcast','completed','emit','disconnect','status','application/json','4sDtmyx','match','connected','body','286GImjBA','server','running','reconnectDelay','split','Bearer\x20','resumeId','SSE\x20error:\x20','1330175KcrtVW','agent','catch',']\x20[commhub:','new_message','/mcp','sleep','result','getReader','offline','3UZRQPh','cwd','now','stringify','slice','abort','message','pop','2.0','idle','POST','1023528DYvcru','log','Authorization','report_status','normal','3479675WSPEle','SSE\x20reconnecting\x20in\x20','2045294EDKRBM','ack_inbox','reply','getAllStatus','registered','token','decode','url','content','alias','s...','parse','get_inbox','from_session','18IVTcyc','processInbox','min','AbortError','10YpBzRK','text','type','signal','application/json,\x20text/event-stream','heartbeatTimer','text/event-stream','sseAbort','382476mPsdmT','task','toString','4761vBfLTf','call','send'];a0_0x451c=function(){return _0x2b365d;};return a0_0x451c();}export{$ as default,T as CommHub};
1
+ const a0_0x3649cd=a0_0x2b65;(function(_0x362644,_0x592b17){const _0x2959d5=a0_0x2b65,_0x1d3385=_0x362644();while(!![]){try{const _0xc9a5f8=-parseInt(_0x2959d5(0x1a2))/0x1+-parseInt(_0x2959d5(0x192))/0x2*(parseInt(_0x2959d5(0x1ce))/0x3)+parseInt(_0x2959d5(0x1d3))/0x4+-parseInt(_0x2959d5(0x1c3))/0x5*(parseInt(_0x2959d5(0x18c))/0x6)+-parseInt(_0x2959d5(0x1ad))/0x7*(-parseInt(_0x2959d5(0x1b3))/0x8)+-parseInt(_0x2959d5(0x1af))/0x9*(parseInt(_0x2959d5(0x1d6))/0xa)+parseInt(_0x2959d5(0x1b4))/0xb;if(_0xc9a5f8===_0x592b17)break;else _0x1d3385['push'](_0x1d3385['shift']());}catch(_0x9b0386){_0x1d3385['push'](_0x1d3385['shift']());}}}(a0_0x3f5b,0x91402));function a0_0x3f5b(){const _0x5532f5=['body',']\x20[commhub:','2.0','578gQvLgq','text','reply','replace','pop','content','tools/call','cwd','/events/','name','registered','type','getAllStatus','Bearer\x20','parse','message','1187655hUIFSg','url','sleep','AbortError','connectSSE','call','SSE\x20failed:\x20','SSE\x20connected','token','server','disconnected','7qUNEJU','sdk','9JfSmJw','text/event-stream','split','POST','7986448PVPMcp','21675225SuRQdI','reconnectDelay','match','toTimeString','offline','startsWith','send_message','emit','normal','disconnect','processInbox','stringify','report_status','decode','SSE\x20error:\x20','25pTvJkB','new_task','alias','resumeId','error','data:\x20','heartbeatInterval','s...','min','get_all_status','toString','11733tWVjnp','connect','log','connected','agent','737216iyTXeG','broadcast','status','510900BACDHq','heartbeat\x20failed:\x20','now','new_message','Authorization','idle','heartbeatTimer','result','inbox\x20error:\x20','sseAbort','running','/mcp','autoConnect','completed','slice','abort','226938BuEjsr','send_task','SSE\x20reconnecting\x20in\x20'];a0_0x3f5b=function(){return _0x5532f5;};return a0_0x3f5b();}import{EventEmitter as a0_0x541063}from'events';import{hostname as a0_0xca84c6}from'os';class T extends a0_0x541063{[a0_0x3649cd(0x1a3)];[a0_0x3649cd(0x1c5)];[a0_0x3649cd(0x1aa)];['agent'];[a0_0x3649cd(0x1c6)];['heartbeatInterval'];['reconnectDelay'];[a0_0x3649cd(0x1dc)];[a0_0x3649cd(0x1df)];[a0_0x3649cd(0x1e0)]=!0x1;constructor(_0x480800){const _0x2882bf=a0_0x3649cd;super();if(this[_0x2882bf(0x1a3)]=_0x480800[_0x2882bf(0x1a3)][_0x2882bf(0x195)](/\/$/,''),this[_0x2882bf(0x1c5)]=_0x480800['alias'],this['token']=_0x480800[_0x2882bf(0x1aa)],this[_0x2882bf(0x1d2)]=_0x480800[_0x2882bf(0x1d2)]||_0x2882bf(0x1ae),this[_0x2882bf(0x1c6)]='sdk-'+_0x480800[_0x2882bf(0x1c5)]+'-'+Date[_0x2882bf(0x1d8)]()[_0x2882bf(0x1cd)](0x24),this['heartbeatInterval']=_0x480800[_0x2882bf(0x1c9)]??0x2bf20,this[_0x2882bf(0x1b5)]=_0x480800[_0x2882bf(0x1b5)]??0xbb8,_0x480800[_0x2882bf(0x188)]!==!0x1)this[_0x2882bf(0x1cf)]();}[a0_0x3649cd(0x1d0)](_0x357428){const _0x8102fe=a0_0x3649cd;console[_0x8102fe(0x1d0)]('['+new Date()[_0x8102fe(0x1b7)]()[_0x8102fe(0x18a)](0x0,0x8)+_0x8102fe(0x190)+this[_0x8102fe(0x1c5)]+']\x20'+_0x357428);}async[a0_0x3649cd(0x1a7)](_0x3247b3,_0xdd10b0){const _0x574a8d=a0_0x3649cd;let _0x33cc21={'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream'};if(this[_0x574a8d(0x1aa)])_0x33cc21[_0x574a8d(0x1da)]=_0x574a8d(0x19f)+this[_0x574a8d(0x1aa)];let _0x18e03c=await(await fetch(this[_0x574a8d(0x1a3)]+_0x574a8d(0x187),{'method':_0x574a8d(0x1b2),'headers':_0x33cc21,'body':JSON[_0x574a8d(0x1bf)]({'jsonrpc':_0x574a8d(0x191),'id':Date[_0x574a8d(0x1d8)](),'method':_0x574a8d(0x198),'params':{'name':_0x3247b3,'arguments':_0xdd10b0}})}))[_0x574a8d(0x193)](),_0x18a041=_0x18e03c[_0x574a8d(0x1b6)](/data: (.+)/),_0x7bbf61=_0x18a041?JSON[_0x574a8d(0x1a0)](_0x18a041[0x1]):JSON[_0x574a8d(0x1a0)](_0x18e03c),_0x57a823=_0x7bbf61?.[_0x574a8d(0x1dd)]?.[_0x574a8d(0x197)]?.[0x0]?.[_0x574a8d(0x193)];return _0x57a823?JSON['parse'](_0x57a823):_0x7bbf61;}async[a0_0x3649cd(0x1cf)](){const _0x1b79a3=a0_0x3649cd;if(this[_0x1b79a3(0x1e0)])return;this[_0x1b79a3(0x1e0)]=!0x0,await this[_0x1b79a3(0x1d5)](_0x1b79a3(0x1db)),this[_0x1b79a3(0x1d0)](_0x1b79a3(0x19c)),this['heartbeatTimer']=setInterval(()=>{const _0x1f03e0=_0x1b79a3;this[_0x1f03e0(0x1d5)](_0x1f03e0(0x1db))['catch'](_0x7a70a8=>this[_0x1f03e0(0x1d0)](_0x1f03e0(0x1d7)+_0x7a70a8[_0x1f03e0(0x1a1)]));},this[_0x1b79a3(0x1c9)]),this[_0x1b79a3(0x1a6)]();}async[a0_0x3649cd(0x1bd)](){const _0x1876d6=a0_0x3649cd;if(this['running']=!0x1,this['sseAbort']?.[_0x1876d6(0x18b)](),this[_0x1876d6(0x1dc)])clearInterval(this[_0x1876d6(0x1dc)]);await this['status'](_0x1876d6(0x1b8))['catch'](()=>{}),this[_0x1876d6(0x1d0)](_0x1876d6(0x1ac));}async['send'](_0x278180,_0x30ede9,_0x3b16c7=a0_0x3649cd(0x1bc)){const _0x397ba3=a0_0x3649cd;return this['call'](_0x397ba3(0x18d),{'alias':_0x278180,'task':_0x30ede9,'priority':_0x3b16c7,'from_session':this[_0x397ba3(0x1c5)]});}async[a0_0x3649cd(0x1a1)](_0x295e44,_0x52c6cc){const _0x532dbc=a0_0x3649cd;return this['call'](_0x532dbc(0x1ba),{'alias':_0x295e44,'message':_0x52c6cc,'from_session':this[_0x532dbc(0x1c5)]});}async[a0_0x3649cd(0x194)](_0x5d6ceb,_0x527b04,_0x437461=a0_0x3649cd(0x189)){const _0x5ebb7b=a0_0x3649cd;return this[_0x5ebb7b(0x1a7)](_0x5ebb7b(0x194),{'task_id':_0x5d6ceb,'text':_0x527b04,'status':_0x437461});}async[a0_0x3649cd(0x1d5)](_0x11219,_0x6b4c36){const _0x210f7d=a0_0x3649cd;return this[_0x210f7d(0x1a7)](_0x210f7d(0x1c0),{'resume_id':this[_0x210f7d(0x1c6)],'alias':this[_0x210f7d(0x1c5)],'status':_0x11219,'server':a0_0xca84c6(),'hostname':a0_0xca84c6(),'agent':this[_0x210f7d(0x1d2)],'project_dir':process[_0x210f7d(0x199)](),..._0x6b4c36});}async[a0_0x3649cd(0x19e)](){const _0x2c40ea=a0_0x3649cd;return this[_0x2c40ea(0x1a7)](_0x2c40ea(0x1cc),{});}async[a0_0x3649cd(0x1d4)](_0x52564a,_0x312a04){const _0x4641e9=a0_0x3649cd;return this[_0x4641e9(0x1a7)]('broadcast',{'message':_0x52564a,'filter_server':_0x312a04?.[_0x4641e9(0x1ab)],'filter_status':_0x312a04?.[_0x4641e9(0x1d5)]});}async[a0_0x3649cd(0x1a6)](){const _0x1a1dc5=a0_0x3649cd;let _0x2b5f6=encodeURIComponent(this[_0x1a1dc5(0x1c5)]),_0x4d2e2b=this[_0x1a1dc5(0x1a3)]+_0x1a1dc5(0x19a)+_0x2b5f6,_0x6b58ac=this[_0x1a1dc5(0x1b5)];while(this['running']){try{this[_0x1a1dc5(0x1df)]=new AbortController();let _0x3064b0={'Accept':_0x1a1dc5(0x1b0)};if(this[_0x1a1dc5(0x1aa)])_0x3064b0[_0x1a1dc5(0x1da)]=_0x1a1dc5(0x19f)+this[_0x1a1dc5(0x1aa)];let _0x58b0d5=await fetch(_0x4d2e2b,{'headers':_0x3064b0,'signal':this[_0x1a1dc5(0x1df)]['signal']});if(!_0x58b0d5['ok']||!_0x58b0d5[_0x1a1dc5(0x18f)]){this[_0x1a1dc5(0x1d0)](_0x1a1dc5(0x1a8)+_0x58b0d5[_0x1a1dc5(0x1d5)]),await this['sleep'](_0x6b58ac),_0x6b58ac=Math[_0x1a1dc5(0x1cb)](_0x6b58ac*1.5,0xea60);continue;}_0x6b58ac=this['reconnectDelay'];let _0x1259c1=_0x58b0d5[_0x1a1dc5(0x18f)]['getReader'](),_0x10a321=new TextDecoder(),_0x133b14='';while(this['running']){let {done:_0xff8fa1,value:_0x374bcc}=await _0x1259c1['read']();if(_0xff8fa1)break;_0x133b14+=_0x10a321[_0x1a1dc5(0x1c1)](_0x374bcc,{'stream':!0x0});let _0x5f6ca7=_0x133b14[_0x1a1dc5(0x1b1)]('\x0a');_0x133b14=_0x5f6ca7[_0x1a1dc5(0x196)]()||'';for(let _0x4a7ec8 of _0x5f6ca7){if(!_0x4a7ec8[_0x1a1dc5(0x1b9)](_0x1a1dc5(0x1c8)))continue;try{let _0x2900f3=JSON[_0x1a1dc5(0x1a0)](_0x4a7ec8[_0x1a1dc5(0x18a)](0x6));if(_0x2900f3[_0x1a1dc5(0x19d)]==='connected'){this[_0x1a1dc5(0x1d0)](_0x1a1dc5(0x1a9)),this[_0x1a1dc5(0x1bb)](_0x1a1dc5(0x1d1));continue;}if(_0x2900f3[_0x1a1dc5(0x19d)]===_0x1a1dc5(0x1c4)||_0x2900f3[_0x1a1dc5(0x19d)]===_0x1a1dc5(0x1d9)||_0x2900f3[_0x1a1dc5(0x19d)]==='broadcast')await this[_0x1a1dc5(0x1be)]();}catch{}}}}catch(_0x16e83c){if(_0x16e83c[_0x1a1dc5(0x19b)]===_0x1a1dc5(0x1a5))break;this['emit'](_0x1a1dc5(0x1c7),_0x16e83c),this[_0x1a1dc5(0x1d0)](_0x1a1dc5(0x1c2)+_0x16e83c[_0x1a1dc5(0x1a1)]);}if(this[_0x1a1dc5(0x1e0)])this['emit']('disconnected'),this[_0x1a1dc5(0x1d0)](_0x1a1dc5(0x18e)+_0x6b58ac/0x3e8+_0x1a1dc5(0x1ca)),await this[_0x1a1dc5(0x1a4)](_0x6b58ac),_0x6b58ac=Math['min'](_0x6b58ac*1.5,0xea60);}}async[a0_0x3649cd(0x1be)](){const _0x394251=a0_0x3649cd;try{let _0x334a4f=(await this[_0x394251(0x1a7)]('get_inbox',{'alias':this[_0x394251(0x1c5)],'limit':0xa}))?.['messages']||[];for(let _0x1d50b4 of _0x334a4f)await this[_0x394251(0x1a7)]('ack_inbox',{'alias':this['alias'],'message_id':_0x1d50b4['id']}),this['log']('←\x20'+_0x1d50b4['from_session']+':\x20'+_0x1d50b4['content']['slice'](0x0,0x3c)),this[_0x394251(0x1bb)]('task',_0x1d50b4),this['emit'](_0x394251(0x1a1),_0x1d50b4);}catch(_0x393cc0){this[_0x394251(0x1d0)](_0x394251(0x1de)+_0x393cc0['message']);}}[a0_0x3649cd(0x1a4)](_0x5856e0){return new Promise(_0x24572e=>setTimeout(_0x24572e,_0x5856e0));}}var $=T;function a0_0x2b65(_0x3dcb05,_0x7529a3){_0x3dcb05=_0x3dcb05-0x187;const _0x3f5bd4=a0_0x3f5b();let _0x2b658c=_0x3f5bd4[_0x3dcb05];return _0x2b658c;}export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x4eb00a=a0_0x279e;(function(_0x357d5e,_0x59c0bf){const _0x459576=a0_0x279e,_0xc7ff5b=_0x357d5e();while(!![]){try{const _0x38bb63=-parseInt(_0x459576(0x211))/0x1*(-parseInt(_0x459576(0x1d5))/0x2)+-parseInt(_0x459576(0x21f))/0x3*(-parseInt(_0x459576(0x206))/0x4)+parseInt(_0x459576(0x1dc))/0x5+-parseInt(_0x459576(0x20b))/0x6*(-parseInt(_0x459576(0x21b))/0x7)+parseInt(_0x459576(0x249))/0x8+parseInt(_0x459576(0x1d6))/0x9*(parseInt(_0x459576(0x23d))/0xa)+-parseInt(_0x459576(0x1de))/0xb*(parseInt(_0x459576(0x227))/0xc);if(_0x38bb63===_0x59c0bf)break;else _0xc7ff5b['push'](_0xc7ff5b['shift']());}catch(_0x4b6cc6){_0xc7ff5b['push'](_0xc7ff5b['shift']());}}}(a0_0x441a,0x546d7));import{readFileSync as a0_0x4a338c,existsSync as a0_0x57606d}from'fs';import{randomUUID as a0_0xa73832}from'crypto';import{join as a0_0x1a3ec3}from'path';import{hostname as a0_0x4680fe}from'os';import{execSync as a0_0x4ee0c6}from'child_process';import{Server as a0_0x4ccaff}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x223c8e}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x271a40,CallToolRequestSchema as a0_0x59ccac}from'@modelcontextprotocol/sdk/types.js';function p(_0x190ee8){const _0x86c244=a0_0x279e;if(!a0_0x57606d(_0x190ee8))return;for(let _0x357265 of a0_0x4a338c(_0x190ee8,_0x86c244(0x1ea))[_0x86c244(0x1e0)]('\x0a')){let _0x1ff25b=_0x357265['trim']();if(!_0x1ff25b||_0x1ff25b['startsWith']('#'))continue;let _0x4b9dad=_0x1ff25b[_0x86c244(0x1fa)]('=');if(_0x4b9dad<0x0)continue;let _0x52dbdb=_0x1ff25b[_0x86c244(0x1cd)](0x0,_0x4b9dad)[_0x86c244(0x248)](),_0x4dcc10=_0x1ff25b['slice'](_0x4b9dad+0x1)[_0x86c244(0x248)]()[_0x86c244(0x20c)](/^["']|["']$/g,'');if(!process.env[_0x52dbdb])process.env[_0x52dbdb]=_0x4dcc10;}}var C=process.env.HOME||'~',T=a0_0x1a3ec3(C,'.claude/channels/commhub');p(a0_0x1a3ec3(T,a0_0x4eb00a(0x20d)));var L=process[a0_0x4eb00a(0x21d)]()[a0_0x4eb00a(0x20c)](/\//g,'-');function a0_0x441a(){const _0x3aaaaa=['data:\x20','Reply\x20text\x20/\x20result\x20summary','idle','MCP\x20stdio\x20connected','60ZjoTEz','exit','failed','from','message','stringify','http://127.0.0.1:9200','type','application/json,\x20text/event-stream','POST','\x22\x20(','session\x20disconnected','parse\x20error:\x20','body','tools/call','connecting\x20to\x20','string','SSE\x20stream\x20ended,\x20reconnecting...','then','warning:\x20could\x20not\x20register:\x20','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','toTimeString','110tQBYgG','commhub_reply','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','messages','commhub','application/json','error','none','claude-code','ack_inbox','init\x20failed:\x20','trim','4098312rnQEjj','commhub_send_message','new_task','Session\x20alias:\x20','SIGINT','getReader','get_inbox','SSE\x20fatal:\x20','end','params','connected','normal','task','replied','shutting\x20down,\x20reporting\x20offline...','/events/','object','number','blocked','slice','Message\x20content','\x20ALIAS=','get_all_status','from_session','CommHub\x20init\x20failed:\x20','unknown\x20tool','stderr','2wPmYbO','332964PaTQxi','Bearer\x20','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','set','working','low','2211990qMojSO','catch','4755212BbyKwO','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','split',':\x20inbox_count=','0.3.0','.anet','send_message','commhub_send_task','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','setRequestHandler','token','report_status','utf-8','SSE\x20error:\x20','notifications/claude/channel','ENV:\x20URL=','message_id','hub','\x20from\x20','no\x20response','Priority\x20(default:\x20normal)','starting\x20SSE\x20listener...','commhub_get_all_status','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','/mcp','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','Authorization','tmux\x20display-message\x20-p\x20\x27#S\x27','indexOf','commhub-channel','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','status','text','parse','priority','get','config.json','notification','pop','read','268ORjOoO','high','SSE\x20connection\x20error:\x20','send_task','alias','6qFeYNn','replace','.env','completed','find','initialize','551788BtzQPN','connect','commhub_report_status','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','content','\x20RESUME_ID=','fatal:\x20','\x20priority=','\x20PROJECT_ENV=','Task\x20content','278747suGrpW','ready\x20—\x20waiting\x20for\x20events','cwd','stdin','24807iFpziQ','new_message','statusText','2025-03-26'];a0_0x441a=function(){return _0x3aaaaa;};return a0_0x441a();}p(a0_0x1a3ec3(T,L,a0_0x4eb00a(0x20d)));function U(){const _0x4c62bb=a0_0x4eb00a;try{return a0_0x4ee0c6(_0x4c62bb(0x1f9),{'encoding':_0x4c62bb(0x1ea),'timeout':0x7d0})[_0x4c62bb(0x248)]();}catch{return'';}}function v(){const _0x43f7d3=a0_0x4eb00a;try{let _0xc60eb7=a0_0x1a3ec3(C,_0x43f7d3(0x1e3),_0x43f7d3(0x202));if(a0_0x57606d(_0xc60eb7))return JSON['parse'](a0_0x4a338c(_0xc60eb7,_0x43f7d3(0x1ea)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x4eb00a(0x1ef)]||a0_0x4eb00a(0x22d),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x4680fe(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0xa73832(),X=process.env.COMMHUB_TOKEN||H[a0_0x4eb00a(0x1e8)]||'';function Y(_0x517774){const _0x399ada=a0_0x4eb00a;let _0x402d88=new Date()[_0x399ada(0x23c)]()[_0x399ada(0x1cd)](0x0,0x8);process[_0x399ada(0x1d4)]['write']('['+_0x402d88+']\x20[commhub]\x20'+_0x517774+'\x0a');}function h(_0x582e65){return new Promise(_0x3d7f22=>setTimeout(_0x3d7f22,_0x582e65));}Y(a0_0x4eb00a(0x1ed)+f+a0_0x4eb00a(0x1cf)+Z+a0_0x4eb00a(0x216)+w[a0_0x4eb00a(0x1cd)](0x0,0x8)+'...\x20TMUX='+(j||a0_0x4eb00a(0x244))+'\x20CWD='+process[a0_0x4eb00a(0x21d)]()+a0_0x4eb00a(0x219)+L);function a0_0x279e(_0x57859b,_0x41d4df){_0x57859b=_0x57859b-0x1be;const _0x441a7b=a0_0x441a();let _0x279e34=_0x441a7b[_0x57859b];return _0x279e34;}var k=new Map(),K=new a0_0x4ccaff({'name':a0_0x4eb00a(0x1fb),'version':a0_0x4eb00a(0x1e2)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x4eb00a(0x1df),a0_0x4eb00a(0x23f),'Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.',a0_0x4eb00a(0x214),a0_0x4eb00a(0x24c)+Z]['join']('\x0a')});K[a0_0x4eb00a(0x1e7)](a0_0x271a40,async()=>({'tools':[{'name':a0_0x4eb00a(0x23e),'description':a0_0x4eb00a(0x1e6),'inputSchema':{'type':'object','properties':{'task_id':{'type':'string','description':a0_0x4eb00a(0x1fc)},'text':{'type':a0_0x4eb00a(0x237),'description':a0_0x4eb00a(0x224)},'status':{'type':'string','enum':[a0_0x4eb00a(0x20e),a0_0x4eb00a(0x229),'cancelled',a0_0x4eb00a(0x1cc),a0_0x4eb00a(0x243),'in_progress'],'description':a0_0x4eb00a(0x23b)}},'required':[a0_0x4eb00a(0x1fe)]}},{'name':a0_0x4eb00a(0x213),'description':a0_0x4eb00a(0x1f7),'inputSchema':{'type':a0_0x4eb00a(0x1ca),'properties':{'status':{'type':a0_0x4eb00a(0x237),'enum':[a0_0x4eb00a(0x1da),a0_0x4eb00a(0x225),a0_0x4eb00a(0x1cc),a0_0x4eb00a(0x243)]},'task':{'type':a0_0x4eb00a(0x237),'description':'Current\x20task\x20description'},'progress':{'type':a0_0x4eb00a(0x1cb),'description':'Progress\x200-100'}},'required':[a0_0x4eb00a(0x1fd)]}},{'name':a0_0x4eb00a(0x1e5),'description':a0_0x4eb00a(0x1d8),'inputSchema':{'type':a0_0x4eb00a(0x1ca),'properties':{'alias':{'type':a0_0x4eb00a(0x237),'description':'Target\x20session\x20alias'},'task':{'type':a0_0x4eb00a(0x237),'description':a0_0x4eb00a(0x21a)},'priority':{'type':a0_0x4eb00a(0x237),'enum':[a0_0x4eb00a(0x207),a0_0x4eb00a(0x1c5),a0_0x4eb00a(0x1db)],'description':a0_0x4eb00a(0x1f2)}},'required':[a0_0x4eb00a(0x20a),a0_0x4eb00a(0x1c6)]}},{'name':a0_0x4eb00a(0x24a),'description':'Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','inputSchema':{'type':a0_0x4eb00a(0x1ca),'properties':{'alias':{'type':'string','description':'Target\x20session\x20alias'},'message':{'type':a0_0x4eb00a(0x237),'description':a0_0x4eb00a(0x1ce)}},'required':[a0_0x4eb00a(0x20a),a0_0x4eb00a(0x22b)]}},{'name':'commhub_get_all_status','description':a0_0x4eb00a(0x1f5),'inputSchema':{'type':a0_0x4eb00a(0x1ca),'properties':{}}}]}));async function P(_0x1f1142,_0xb413a){const _0x499cf6=a0_0x4eb00a;let _0x1c6604=await fetch(f+_0x499cf6(0x1f6),{'method':_0x499cf6(0x230),'headers':{'Content-Type':_0x499cf6(0x242),'Accept':_0x499cf6(0x22f),...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON[_0x499cf6(0x22c)]({'jsonrpc':'2.0','id':0x1,'method':_0x499cf6(0x210),'params':{'protocolVersion':_0x499cf6(0x222),'capabilities':{},'clientInfo':{'name':'commhub-channel','version':_0x499cf6(0x1e2)}}})});if(!_0x1c6604['ok']){let _0x1e7aaa=await _0x1c6604[_0x499cf6(0x1fe)]();return Y(_0x499cf6(0x1d2)+_0x1c6604['status']+'\x20'+_0x1e7aaa[_0x499cf6(0x1cd)](0x0,0x64)),{'ok':!0x1,'error':_0x499cf6(0x247)+_0x1c6604[_0x499cf6(0x1fd)]};}await _0x1c6604['text']();let _0x24c976=(await(await fetch(f+_0x499cf6(0x1f6),{'method':_0x499cf6(0x230),'headers':{'Content-Type':_0x499cf6(0x242),'Accept':_0x499cf6(0x22f),...X?{'Authorization':_0x499cf6(0x1d7)+X}:{}},'body':JSON[_0x499cf6(0x22c)]({'jsonrpc':'2.0','id':0x2,'method':_0x499cf6(0x235),'params':{'name':_0x1f1142,'arguments':_0xb413a}})}))[_0x499cf6(0x1fe)]())['split']('\x0a')[_0x499cf6(0x20f)](_0x497bc5=>_0x497bc5['startsWith']('data:\x20'));if(_0x24c976){let _0x34b291=JSON[_0x499cf6(0x1ff)](_0x24c976[_0x499cf6(0x1cd)](0x6));return _0x34b291?.['result']?.['content']?.[0x0]?.[_0x499cf6(0x1fe)]?JSON[_0x499cf6(0x1ff)](_0x34b291['result'][_0x499cf6(0x215)][0x0][_0x499cf6(0x1fe)]):_0x34b291;}return{'ok':!0x1,'error':_0x499cf6(0x1f1)};}K[a0_0x4eb00a(0x1e7)](a0_0x59ccac,async _0x13d469=>{const _0x35a493=a0_0x4eb00a;let {name:_0x320e8d,arguments:_0x1c2fb6}=_0x13d469[_0x35a493(0x1c3)];if(_0x320e8d===_0x35a493(0x23e)){let {task_id:_0x6d3288,text:_0x3698dd,status:_0x1a0513}=_0x1c2fb6;if(_0x1a0513===_0x35a493(0x20e)||_0x1a0513===_0x35a493(0x229)||_0x1a0513==='cancelled'){let _0x46886e=_0x1a0513===_0x35a493(0x20e)?_0x35a493(0x1c7):_0x1a0513,_0x1e0f39=_0x6d3288?k[_0x35a493(0x201)](_0x6d3288)||_0x35a493(0x1ef):_0x35a493(0x1ef),_0x277356=await P('send_reply',{'alias':_0x1e0f39,'text':_0x3698dd,'in_reply_to':_0x6d3288||void 0x0,'status':_0x46886e,'from_session':Z});if(_0x6d3288)k['delete'](_0x6d3288);return{'content':[{'type':'text','text':JSON[_0x35a493(0x22c)](_0x277356)}]};}let _0x4afaa9=await P(_0x35a493(0x1e9),{'resume_id':w,'alias':Z,'status':_0x1a0513===_0x35a493(0x1cc)?_0x35a493(0x1cc):_0x1a0513===_0x35a493(0x243)?_0x35a493(0x243):_0x35a493(0x1da),'task':_0x3698dd[_0x35a493(0x1cd)](0x0,0xc8),'output':_0x3698dd});return{'content':[{'type':_0x35a493(0x1fe),'text':JSON['stringify'](_0x4afaa9)}]};}if(_0x320e8d===_0x35a493(0x213)){let {status:_0x25a14a,task:_0x1c3302,progress:_0x3afcc2}=_0x1c2fb6,_0x222cae=await P(_0x35a493(0x1e9),{'resume_id':w,'alias':Z,'status':_0x25a14a,'task':_0x1c3302,'progress':_0x3afcc2});return{'content':[{'type':_0x35a493(0x1fe),'text':JSON['stringify'](_0x222cae)}]};}if(_0x320e8d===_0x35a493(0x1e5)){let {alias:_0x317caa,task:_0x2f0361,priority:_0x2ab9e6}=_0x1c2fb6,_0x3b4ff6=await P(_0x35a493(0x209),{'alias':_0x317caa,'task':_0x2f0361,'priority':_0x2ab9e6||'normal','from_session':Z});return{'content':[{'type':_0x35a493(0x1fe),'text':JSON[_0x35a493(0x22c)](_0x3b4ff6)}]};}if(_0x320e8d==='commhub_send_message'){let {alias:_0x273751,message:_0x248b97}=_0x1c2fb6,_0x57afcb=await P(_0x35a493(0x1e4),{'alias':_0x273751,'message':_0x248b97,'from_session':Z});return{'content':[{'type':_0x35a493(0x1fe),'text':JSON[_0x35a493(0x22c)](_0x57afcb)}]};}if(_0x320e8d===_0x35a493(0x1f4)){let _0x36ba85=await P(_0x35a493(0x1d0),{});return{'content':[{'type':_0x35a493(0x1fe),'text':JSON[_0x35a493(0x22c)](_0x36ba85)}]};}return{'content':[{'type':_0x35a493(0x1fe),'text':JSON[_0x35a493(0x22c)]({'error':_0x35a493(0x1d3)})}]};});async function u(){const _0x5321a6=a0_0x4eb00a;let _0x114714=f+_0x5321a6(0x1c9)+encodeURIComponent(Z),_0x34695c={};if(X)_0x34695c[_0x5321a6(0x1f8)]='Bearer\x20'+X;Y(_0x5321a6(0x236)+_0x114714);while(!0x0){try{let _0x597c67=await fetch(_0x114714,{'headers':_0x34695c});if(!_0x597c67['ok']){Y(_0x5321a6(0x1eb)+_0x597c67[_0x5321a6(0x1fd)]+'\x20'+_0x597c67[_0x5321a6(0x221)]),await h(0x1388);continue;}let _0xe53878=_0x597c67[_0x5321a6(0x234)][_0x5321a6(0x1bf)](),_0x3e69e7=new TextDecoder(),_0x46b18a='';while(!0x0){let {done:_0x22e39e,value:_0x374b47}=await _0xe53878[_0x5321a6(0x205)]();if(_0x22e39e)break;_0x46b18a+=_0x3e69e7['decode'](_0x374b47,{'stream':!0x0});let _0x47a0a9=_0x46b18a['split']('\x0a\x0a');_0x46b18a=_0x47a0a9[_0x5321a6(0x204)]()||'';for(let _0x20a756 of _0x47a0a9){let _0x4951a0=_0x20a756[_0x5321a6(0x1e0)]('\x0a')['find'](_0x1f1db3=>_0x1f1db3['startsWith'](_0x5321a6(0x223)));if(!_0x4951a0)continue;try{let _0x16d3b2=JSON[_0x5321a6(0x1ff)](_0x4951a0[_0x5321a6(0x1cd)](0x6));await S(_0x16d3b2);}catch(_0x1a37cd){Y(_0x5321a6(0x233)+_0x1a37cd);}}}Y(_0x5321a6(0x238));}catch(_0x199166){Y(_0x5321a6(0x208)+_0x199166);}await h(0xbb8);}}async function S(_0x35b29e){const _0x2c9b0a=a0_0x4eb00a;if(_0x35b29e['type']===_0x2c9b0a(0x1c4)){Y('SSE\x20connected\x20as\x20\x22'+Z+'\x22');return;}if(_0x35b29e[_0x2c9b0a(0x22e)]===_0x2c9b0a(0x220)){if(Y('←\x20message\x20from\x20'+_0x35b29e[_0x2c9b0a(0x22a)]+':\x20'+_0x35b29e['message'][_0x2c9b0a(0x1cd)](0x0,0x3c)),await K[_0x2c9b0a(0x203)]({'method':_0x2c9b0a(0x1ec),'params':{'content':_0x35b29e[_0x2c9b0a(0x22b)],'meta':{'sender':_0x35b29e[_0x2c9b0a(0x22a)]||_0x2c9b0a(0x1ef),'sender_id':_0x2c9b0a(0x241),'user':_0x35b29e[_0x2c9b0a(0x22a)]||_0x2c9b0a(0x1ef),'priority':_0x2c9b0a(0x1c5)}}}),_0x35b29e[_0x2c9b0a(0x1ee)])await P(_0x2c9b0a(0x246),{'alias':Z,'message_id':_0x35b29e[_0x2c9b0a(0x1ee)]});return;}if(_0x35b29e['type']===_0x2c9b0a(0x24b)||_0x35b29e[_0x2c9b0a(0x22e)]==='broadcast'){Y('←\x20'+_0x35b29e['type']+_0x2c9b0a(0x1e1)+_0x35b29e['inbox_count']+_0x2c9b0a(0x218)+(_0x35b29e[_0x2c9b0a(0x200)]||_0x2c9b0a(0x1c5)));let _0x5459fd=await P(_0x2c9b0a(0x1c0),{'alias':Z,'limit':0x5});if(_0x5459fd?.['ok']&&_0x5459fd[_0x2c9b0a(0x240)]?.['length']>0x0)for(let _0x3d6893 of _0x5459fd[_0x2c9b0a(0x240)]){let _0xcfee30={'sender':_0x3d6893[_0x2c9b0a(0x1d1)]||_0x2c9b0a(0x1ef),'sender_id':_0x2c9b0a(0x241),'user':_0x3d6893['from_session']||_0x2c9b0a(0x1ef),'task_id':_0x3d6893['id'],'priority':_0x3d6893[_0x2c9b0a(0x200)]||_0x2c9b0a(0x1c5)};k[_0x2c9b0a(0x1d9)](_0x3d6893['id'],_0x3d6893[_0x2c9b0a(0x1d1)]||'hub'),await K[_0x2c9b0a(0x203)]({'method':'notifications/claude/channel','params':{'content':_0x3d6893[_0x2c9b0a(0x215)],'meta':_0xcfee30}}),Y('→\x20injected\x20task\x20'+_0x3d6893['id'][_0x2c9b0a(0x1cd)](0x0,0x8)+_0x2c9b0a(0x1f0)+_0x3d6893[_0x2c9b0a(0x1d1)]+':\x20'+_0x3d6893[_0x2c9b0a(0x215)][_0x2c9b0a(0x1cd)](0x0,0x3c)),await P('ack_inbox',{'alias':Z,'message_id':_0x3d6893['id']});}}}async function A(){const _0x53de57=a0_0x4eb00a;let _0x5853e5=new a0_0x223c8e();await K[_0x53de57(0x212)](_0x5853e5),Y(_0x53de57(0x226)),Y(_0x53de57(0x1f3)),u()[_0x53de57(0x1dd)](_0x3b1e9a=>Y(_0x53de57(0x1c1)+_0x3b1e9a)),P(_0x53de57(0x1e9),{'resume_id':w,'alias':Z,'status':_0x53de57(0x225),'server':a0_0x4680fe(),'hostname':a0_0x4680fe(),'agent':_0x53de57(0x245),'project_dir':process['cwd'](),'tmux_name':j||void 0x0})[_0x53de57(0x239)](()=>Y('registered\x20as\x20\x22'+Z+_0x53de57(0x231)+w['slice'](0x0,0x8)+')'))[_0x53de57(0x1dd)](_0x4d5d53=>Y(_0x53de57(0x23a)+_0x4d5d53)),setInterval(()=>{const _0xcb412=_0x53de57;P('report_status',{'resume_id':w,'alias':Z,'status':_0xcb412(0x225),'server':a0_0x4680fe(),'hostname':a0_0x4680fe(),'agent':'claude-code','project_dir':process[_0xcb412(0x21d)](),'tmux_name':j||void 0x0})[_0xcb412(0x1dd)](_0x20b507=>Y('heartbeat\x20failed:\x20'+_0x20b507));},0x2bf20),Y(_0x53de57(0x21c));}A()[a0_0x4eb00a(0x1dd)](_0x1a35c9=>{const _0xae849=a0_0x4eb00a;Y(_0xae849(0x217)+_0x1a35c9),process['exit'](0x1);});async function N(){const _0x23e724=a0_0x4eb00a;Y(_0x23e724(0x1c8)),await P(_0x23e724(0x1e9),{'resume_id':w,'alias':Z,'status':_0x23e724(0x243),'task':_0x23e724(0x232)})[_0x23e724(0x1dd)](()=>{}),process[_0x23e724(0x228)](0x0);}process[a0_0x4eb00a(0x21e)]['on'](a0_0x4eb00a(0x1c2),()=>N()),process['on']('SIGTERM',()=>N()),process['on'](a0_0x4eb00a(0x1be),()=>N());
2
+ const a0_0x203887=a0_0xea19;(function(_0x86b2df,_0x3ee649){const _0x230bb2=a0_0xea19,_0x2b3e26=_0x86b2df();while(!![]){try{const _0x39f959=parseInt(_0x230bb2(0x1ed))/0x1+-parseInt(_0x230bb2(0x21b))/0x2*(parseInt(_0x230bb2(0x201))/0x3)+parseInt(_0x230bb2(0x241))/0x4*(parseInt(_0x230bb2(0x204))/0x5)+parseInt(_0x230bb2(0x212))/0x6+parseInt(_0x230bb2(0x244))/0x7*(-parseInt(_0x230bb2(0x23d))/0x8)+parseInt(_0x230bb2(0x20b))/0x9*(-parseInt(_0x230bb2(0x1f5))/0xa)+-parseInt(_0x230bb2(0x1e5))/0xb*(-parseInt(_0x230bb2(0x1f9))/0xc);if(_0x39f959===_0x3ee649)break;else _0x2b3e26['push'](_0x2b3e26['shift']());}catch(_0x5236da){_0x2b3e26['push'](_0x2b3e26['shift']());}}}(a0_0x4a55,0x685cc));import{readFileSync as a0_0x4ae19d,existsSync as a0_0x1e2c64}from'fs';import{randomUUID as a0_0x5340de}from'crypto';import{join as a0_0xc1d65}from'path';import{hostname as a0_0x3f6dba}from'os';import{execSync as a0_0x58410e}from'child_process';import{Server as a0_0x54b7ce}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x5d108d}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x48c522,CallToolRequestSchema as a0_0x4041ae}from'@modelcontextprotocol/sdk/types.js';function p(_0x2e5581){const _0x319a9e=a0_0xea19;if(!a0_0x1e2c64(_0x2e5581))return;for(let _0x429345 of a0_0x4ae19d(_0x2e5581,_0x319a9e(0x1dc))[_0x319a9e(0x24f)]('\x0a')){let _0x17dec7=_0x429345['trim']();if(!_0x17dec7||_0x17dec7[_0x319a9e(0x1fe)]('#'))continue;let _0x2fd59f=_0x17dec7[_0x319a9e(0x240)]('=');if(_0x2fd59f<0x0)continue;let _0x1366e8=_0x17dec7['slice'](0x0,_0x2fd59f)[_0x319a9e(0x24a)](),_0x3bf613=_0x17dec7[_0x319a9e(0x1da)](_0x2fd59f+0x1)[_0x319a9e(0x24a)]()['replace'](/^["']|["']$/g,'');if(!process.env[_0x1366e8])process.env[_0x1366e8]=_0x3bf613;}}var C=process.env.HOME||'~',T=a0_0xc1d65(C,a0_0x203887(0x1e2));p(a0_0xc1d65(T,a0_0x203887(0x23c)));function a0_0xea19(_0x594169,_0x49d012){_0x594169=_0x594169-0x1c0;const _0x4a553e=a0_0x4a55();let _0xea19d6=_0x4a553e[_0x594169];return _0xea19d6;}var L=process[a0_0x203887(0x1ef)]()[a0_0x203887(0x1eb)](/\//g,'-');p(a0_0xc1d65(T,L,a0_0x203887(0x23c)));function U(){const _0x5f169a=a0_0x203887;try{return a0_0x58410e('tmux\x20display-message\x20-p\x20\x27#S\x27',{'encoding':_0x5f169a(0x1dc),'timeout':0x7d0})[_0x5f169a(0x24a)]();}catch{return'';}}function v(){const _0x35128c=a0_0x203887;try{let _0x190a43=a0_0xc1d65(C,_0x35128c(0x1fa),_0x35128c(0x22d));if(a0_0x1e2c64(_0x190a43))return JSON[_0x35128c(0x234)](a0_0x4ae19d(_0x190a43,_0x35128c(0x1dc)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H['hub']||'http://127.0.0.1:9200',j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x3f6dba(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x5340de(),X=process.env.COMMHUB_TOKEN||H[a0_0x203887(0x1f1)]||'';function Y(_0x160e1f){const _0x262ddc=a0_0x203887;let _0x1beb68=new Date()[_0x262ddc(0x1df)]()[_0x262ddc(0x1da)](0x0,0x8);process[_0x262ddc(0x220)][_0x262ddc(0x1ff)]('['+_0x1beb68+_0x262ddc(0x1fd)+_0x160e1f+'\x0a');}function h(_0x3f4f83){return new Promise(_0x2849f4=>setTimeout(_0x2849f4,_0x3f4f83));}Y(a0_0x203887(0x1d1)+f+a0_0x203887(0x246)+Z+a0_0x203887(0x1db)+w[a0_0x203887(0x1da)](0x0,0x8)+a0_0x203887(0x24c)+(j||a0_0x203887(0x242))+'\x20CWD='+process[a0_0x203887(0x1ef)]()+a0_0x203887(0x1f4)+L);var k=new Map(),K=new a0_0x54b7ce({'name':a0_0x203887(0x1c8),'version':a0_0x203887(0x207)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x203887(0x1ee),a0_0x203887(0x1ea),'Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.',a0_0x203887(0x247)+Z]['join']('\x0a')});K[a0_0x203887(0x1e4)](a0_0x48c522,async()=>({'tools':[{'name':'commhub_reply','description':a0_0x203887(0x209),'inputSchema':{'type':a0_0x203887(0x231),'properties':{'task_id':{'type':a0_0x203887(0x23b),'description':a0_0x203887(0x1c4)},'text':{'type':'string','description':a0_0x203887(0x21c)},'status':{'type':'string','enum':[a0_0x203887(0x229),a0_0x203887(0x237),a0_0x203887(0x230),a0_0x203887(0x232),a0_0x203887(0x224),'in_progress'],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':[a0_0x203887(0x1e0)]}},{'name':'commhub_report_status','description':'Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','inputSchema':{'type':a0_0x203887(0x231),'properties':{'status':{'type':a0_0x203887(0x23b),'enum':['working',a0_0x203887(0x1f3),a0_0x203887(0x232),a0_0x203887(0x224)]},'task':{'type':'string','description':a0_0x203887(0x249)},'progress':{'type':'number','description':a0_0x203887(0x239)}},'required':['status']}},{'name':a0_0x203887(0x23e),'description':a0_0x203887(0x20d),'inputSchema':{'type':a0_0x203887(0x231),'properties':{'alias':{'type':a0_0x203887(0x23b),'description':a0_0x203887(0x23f)},'task':{'type':a0_0x203887(0x23b),'description':a0_0x203887(0x213)},'priority':{'type':a0_0x203887(0x23b),'enum':['high',a0_0x203887(0x205),a0_0x203887(0x200)],'description':'Priority\x20(default:\x20normal)'}},'required':[a0_0x203887(0x1d8),a0_0x203887(0x225)]}},{'name':a0_0x203887(0x235),'description':a0_0x203887(0x238),'inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x203887(0x23b),'description':a0_0x203887(0x23f)},'message':{'type':a0_0x203887(0x23b),'description':a0_0x203887(0x20e)}},'required':[a0_0x203887(0x1d8),a0_0x203887(0x1e3)]}},{'name':a0_0x203887(0x20c),'description':a0_0x203887(0x203),'inputSchema':{'type':a0_0x203887(0x231),'properties':{}}}]}));async function P(_0x45d4cc,_0x59e64f){const _0x51b52c=a0_0x203887;let _0x58cc04=await fetch(f+_0x51b52c(0x1cd),{'method':_0x51b52c(0x248),'headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x51b52c(0x1d2)+X}:{}},'body':JSON[_0x51b52c(0x20a)]({'jsonrpc':'2.0','id':0x1,'method':'initialize','params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x51b52c(0x1c8),'version':_0x51b52c(0x207)}}})});if(!_0x58cc04['ok']){let _0x4fd97a=await _0x58cc04['text']();return Y(_0x51b52c(0x1fc)+_0x58cc04[_0x51b52c(0x1c2)]+'\x20'+_0x4fd97a[_0x51b52c(0x1da)](0x0,0x64)),{'ok':!0x1,'error':_0x51b52c(0x211)+_0x58cc04[_0x51b52c(0x1c2)]};}await _0x58cc04['text']();let _0x3571c3=(await(await fetch(f+_0x51b52c(0x1cd),{'method':_0x51b52c(0x248),'headers':{'Content-Type':_0x51b52c(0x1f0),'Accept':'application/json,\x20text/event-stream',...X?{'Authorization':_0x51b52c(0x1d2)+X}:{}},'body':JSON[_0x51b52c(0x20a)]({'jsonrpc':_0x51b52c(0x1e7),'id':0x2,'method':_0x51b52c(0x1c5),'params':{'name':_0x45d4cc,'arguments':_0x59e64f}})}))[_0x51b52c(0x1e0)]())['split']('\x0a')[_0x51b52c(0x223)](_0x49d84c=>_0x49d84c[_0x51b52c(0x1fe)](_0x51b52c(0x22b)));if(_0x3571c3){let _0x2ffc85=JSON[_0x51b52c(0x234)](_0x3571c3[_0x51b52c(0x1da)](0x6));return _0x2ffc85?.[_0x51b52c(0x1e1)]?.[_0x51b52c(0x217)]?.[0x0]?.['text']?JSON[_0x51b52c(0x234)](_0x2ffc85[_0x51b52c(0x1e1)][_0x51b52c(0x217)][0x0][_0x51b52c(0x1e0)]):_0x2ffc85;}return{'ok':!0x1,'error':_0x51b52c(0x222)};}K[a0_0x203887(0x1e4)](a0_0x4041ae,async _0x559b8d=>{const _0x433077=a0_0x203887;let {name:_0xe9316f,arguments:_0x16c8a4}=_0x559b8d[_0x433077(0x1de)];if(_0xe9316f==='commhub_reply'){let {task_id:_0x35c3d2,text:_0x232b1d,status:_0x2baf97}=_0x16c8a4;if(_0x2baf97===_0x433077(0x229)||_0x2baf97===_0x433077(0x237)||_0x2baf97===_0x433077(0x230)){let _0x5f4d47=_0x2baf97===_0x433077(0x229)?_0x433077(0x243):_0x2baf97,_0x54dbf6=_0x35c3d2?k[_0x433077(0x22e)](_0x35c3d2)||'hub':_0x433077(0x219),_0x20fbfc=await P(_0x433077(0x1fb),{'alias':_0x54dbf6,'text':_0x232b1d,'in_reply_to':_0x35c3d2||void 0x0,'status':_0x5f4d47,'from_session':Z});if(_0x35c3d2)k[_0x433077(0x22a)](_0x35c3d2);return{'content':[{'type':'text','text':JSON[_0x433077(0x20a)](_0x20fbfc)}]};}let _0x1ead61=await P(_0x433077(0x218),{'resume_id':w,'alias':Z,'status':_0x2baf97==='blocked'?'blocked':_0x2baf97===_0x433077(0x224)?'error':_0x433077(0x1cb),'task':_0x232b1d[_0x433077(0x1da)](0x0,0xc8),'output':_0x232b1d});return{'content':[{'type':_0x433077(0x1e0),'text':JSON['stringify'](_0x1ead61)}]};}if(_0xe9316f===_0x433077(0x1f8)){let {status:_0x481a35,task:_0x351fa1,progress:_0x5bd9e6}=_0x16c8a4,_0x53ab94=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x481a35,'task':_0x351fa1,'progress':_0x5bd9e6});return{'content':[{'type':_0x433077(0x1e0),'text':JSON[_0x433077(0x20a)](_0x53ab94)}]};}if(_0xe9316f===_0x433077(0x23e)){let {alias:_0xbc9217,task:_0x4ae665,priority:_0x33869d}=_0x16c8a4,_0x3cd689=await P(_0x433077(0x1c6),{'alias':_0xbc9217,'task':_0x4ae665,'priority':_0x33869d||_0x433077(0x205),'from_session':Z});return{'content':[{'type':_0x433077(0x1e0),'text':JSON[_0x433077(0x20a)](_0x3cd689)}]};}if(_0xe9316f==='commhub_send_message'){let {alias:_0x3b4e04,message:_0x2a6ae6}=_0x16c8a4,_0x624a39=await P('send_message',{'alias':_0x3b4e04,'message':_0x2a6ae6,'from_session':Z});return{'content':[{'type':'text','text':JSON['stringify'](_0x624a39)}]};}if(_0xe9316f===_0x433077(0x20c)){let _0xe08b89=await P('get_all_status',{});return{'content':[{'type':_0x433077(0x1e0),'text':JSON[_0x433077(0x20a)](_0xe08b89)}]};}return{'content':[{'type':_0x433077(0x1e0),'text':JSON['stringify']({'error':_0x433077(0x22c)})}]};});async function u(){const _0x3e3f45=a0_0x203887;let _0x536251=f+_0x3e3f45(0x202)+encodeURIComponent(Z),_0x2e301d={};if(X)_0x2e301d[_0x3e3f45(0x210)]=_0x3e3f45(0x1d2)+X;Y(_0x3e3f45(0x1ca)+_0x536251);while(!0x0){try{let _0x4d71c0=await fetch(_0x536251,{'headers':_0x2e301d});if(!_0x4d71c0['ok']){Y(_0x3e3f45(0x20f)+_0x4d71c0['status']+'\x20'+_0x4d71c0[_0x3e3f45(0x1d6)]),await h(0x1388);continue;}let _0x4790d4=_0x4d71c0[_0x3e3f45(0x236)]['getReader'](),_0x34aa6b=new TextDecoder(),_0x1bf3fe='';while(!0x0){let {done:_0x1f38b2,value:_0xd744c0}=await _0x4790d4[_0x3e3f45(0x1ce)]();if(_0x1f38b2)break;_0x1bf3fe+=_0x34aa6b[_0x3e3f45(0x206)](_0xd744c0,{'stream':!0x0});let _0x10be11=_0x1bf3fe['split']('\x0a\x0a');_0x1bf3fe=_0x10be11[_0x3e3f45(0x250)]()||'';for(let _0x566baf of _0x10be11){let _0x2bfcad=_0x566baf[_0x3e3f45(0x24f)]('\x0a')[_0x3e3f45(0x223)](_0x95156d=>_0x95156d[_0x3e3f45(0x1fe)](_0x3e3f45(0x22b)));if(!_0x2bfcad)continue;try{let _0x32e449=JSON[_0x3e3f45(0x234)](_0x2bfcad[_0x3e3f45(0x1da)](0x6));await S(_0x32e449);}catch(_0x4d3c2f){Y('parse\x20error:\x20'+_0x4d3c2f);}}}Y(_0x3e3f45(0x216));}catch(_0x41c7f1){Y(_0x3e3f45(0x1dd)+_0x41c7f1);}await h(0xbb8);}}async function S(_0x496a5a){const _0x16bbc3=a0_0x203887;if(_0x496a5a[_0x16bbc3(0x21d)]===_0x16bbc3(0x1c9)){Y('SSE\x20connected\x20as\x20\x22'+Z+'\x22');return;}if(_0x496a5a[_0x16bbc3(0x21d)]===_0x16bbc3(0x22f)){if(Y(_0x16bbc3(0x1e9)+_0x496a5a[_0x16bbc3(0x1f6)]+':\x20'+_0x496a5a[_0x16bbc3(0x1e3)]['slice'](0x0,0x3c)),await K[_0x16bbc3(0x228)]({'method':_0x16bbc3(0x1ec),'params':{'content':_0x496a5a['message'],'meta':{'sender':_0x496a5a['from']||_0x16bbc3(0x219),'sender_id':_0x16bbc3(0x1cc),'user':_0x496a5a[_0x16bbc3(0x1f6)]||'hub','priority':_0x16bbc3(0x205)}}}),_0x496a5a[_0x16bbc3(0x1d3)])await P(_0x16bbc3(0x24b),{'alias':Z,'message_id':_0x496a5a[_0x16bbc3(0x1d3)]});return;}if(_0x496a5a[_0x16bbc3(0x21d)]===_0x16bbc3(0x1c3)||_0x496a5a[_0x16bbc3(0x21d)]===_0x16bbc3(0x21f)){Y('←\x20'+_0x496a5a[_0x16bbc3(0x21d)]+_0x16bbc3(0x1e6)+_0x496a5a[_0x16bbc3(0x1f2)]+_0x16bbc3(0x245)+(_0x496a5a[_0x16bbc3(0x227)]||_0x16bbc3(0x205)));let _0x594447=await P(_0x16bbc3(0x1cf),{'alias':Z,'limit':0x5});if(_0x594447?.['ok']&&_0x594447['messages']?.[_0x16bbc3(0x221)]>0x0)for(let _0x3bec41 of _0x594447[_0x16bbc3(0x21e)]){let _0x1969a3={'sender':_0x3bec41['from_session']||'hub','sender_id':_0x16bbc3(0x1cc),'user':_0x3bec41[_0x16bbc3(0x1d9)]||_0x16bbc3(0x219),'task_id':_0x3bec41['id'],'priority':_0x3bec41['priority']||_0x16bbc3(0x205)};k['set'](_0x3bec41['id'],_0x3bec41[_0x16bbc3(0x1d9)]||_0x16bbc3(0x219)),await K['notification']({'method':_0x16bbc3(0x1ec),'params':{'content':_0x3bec41[_0x16bbc3(0x217)],'meta':_0x1969a3}}),Y(_0x16bbc3(0x1e8)+_0x3bec41['id'][_0x16bbc3(0x1da)](0x0,0x8)+_0x16bbc3(0x226)+_0x3bec41[_0x16bbc3(0x1d9)]+':\x20'+_0x3bec41[_0x16bbc3(0x217)][_0x16bbc3(0x1da)](0x0,0x3c)),await P(_0x16bbc3(0x24b),{'alias':Z,'message_id':_0x3bec41['id']});}}}async function A(){const _0x521ca8=a0_0x203887;let _0x4e9fcc=new a0_0x5d108d();await K[_0x521ca8(0x1f7)](_0x4e9fcc),Y(_0x521ca8(0x23a)),Y('starting\x20SSE\x20listener...'),u()[_0x521ca8(0x208)](_0x3ac82e=>Y(_0x521ca8(0x233)+_0x3ac82e)),P('report_status',{'resume_id':w,'alias':Z,'status':_0x521ca8(0x1f3),'server':a0_0x3f6dba(),'hostname':a0_0x3f6dba(),'agent':'claude-code','project_dir':process[_0x521ca8(0x1ef)](),'tmux_name':j||void 0x0})['then'](()=>Y('registered\x20as\x20\x22'+Z+_0x521ca8(0x1d7)+w[_0x521ca8(0x1da)](0x0,0x8)+')'))['catch'](_0x3d4fdc=>Y(_0x521ca8(0x214)+_0x3d4fdc)),setInterval(()=>{const _0x1500d7=_0x521ca8;P(_0x1500d7(0x218),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x3f6dba(),'hostname':a0_0x3f6dba(),'agent':_0x1500d7(0x215),'project_dir':process[_0x1500d7(0x1ef)](),'tmux_name':j||void 0x0})[_0x1500d7(0x208)](_0x10c592=>Y(_0x1500d7(0x1d0)+_0x10c592));},0x2bf20),Y(_0x521ca8(0x1c1));}A()['catch'](_0x5f3029=>{const _0x5f993=a0_0x203887;Y(_0x5f993(0x1c0)+_0x5f3029),process[_0x5f993(0x24d)](0x1);});function a0_0x4a55(){const _0x31c6e1=['Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','Progress\x200-100','MCP\x20stdio\x20connected','string','.env','208eZzdIH','commhub_send_task','Target\x20session\x20alias','indexOf','12XKzPcU','none','replied','145264CvCuBR','\x20priority=','\x20ALIAS=','Session\x20alias:\x20','POST','Current\x20task\x20description','trim','ack_inbox','...\x20TMUX=','exit','SIGTERM','split','pop','fatal:\x20','ready\x20—\x20waiting\x20for\x20events','status','new_task','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','tools/call','send_task','shutting\x20down,\x20reporting\x20offline...','commhub-channel','connected','connecting\x20to\x20','working','commhub','/mcp','read','get_inbox','heartbeat\x20failed:\x20','ENV:\x20URL=','Bearer\x20','message_id','session\x20disconnected','end','statusText','\x22\x20(','alias','from_session','slice','\x20RESUME_ID=','utf-8','SSE\x20connection\x20error:\x20','params','toTimeString','text','result','.claude/channels/commhub','message','setRequestHandler','108779UeQSyX',':\x20inbox_count=','2.0','→\x20injected\x20task\x20','←\x20message\x20from\x20','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','replace','notifications/claude/channel','92471Gdwdbm','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','cwd','application/json','token','inbox_count','idle','\x20PROJECT_ENV=','1097960nvJGJO','from','connect','commhub_report_status','996RPQWkk','.anet','send_reply','CommHub\x20init\x20failed:\x20',']\x20[commhub]\x20','startsWith','write','low','48giPeKA','/events/','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','229745wcKtRO','normal','decode','0.3.0','catch','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','stringify','9uAXFxz','commhub_get_all_status','Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','Message\x20content','SSE\x20error:\x20','Authorization','init\x20failed:\x20','3045978NQMMgv','Task\x20content','warning:\x20could\x20not\x20register:\x20','claude-code','SSE\x20stream\x20ended,\x20reconnecting...','content','report_status','hub','SIGINT','60244KOUfxF','Reply\x20text\x20/\x20result\x20summary','type','messages','broadcast','stderr','length','no\x20response','find','error','task','\x20from\x20','priority','notification','completed','delete','data:\x20','unknown\x20tool','config.json','get','new_message','cancelled','object','blocked','SSE\x20fatal:\x20','parse','commhub_send_message','body','failed'];a0_0x4a55=function(){return _0x31c6e1;};return a0_0x4a55();}async function N(){const _0x1eb927=a0_0x203887;Y(_0x1eb927(0x1c7)),await P(_0x1eb927(0x218),{'resume_id':w,'alias':Z,'status':_0x1eb927(0x224),'task':_0x1eb927(0x1d4)})[_0x1eb927(0x208)](()=>{}),process[_0x1eb927(0x24d)](0x0);}process['stdin']['on'](a0_0x203887(0x1d5),()=>N()),process['on'](a0_0x203887(0x24e),()=>N()),process['on'](a0_0x203887(0x21a),()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "AI Agent Network CLI — Create multi-agent networks with user management, network isolation, and 3 AI runtimes (Claude/Codex/MiniMax). 39 commands.",
5
5
  "type": "module",
6
6
  "main": "dist/src/client.js",
@@ -40,13 +40,19 @@
40
40
  "anet"
41
41
  ],
42
42
  "author": "sleep2agi",
43
- "license": "MIT",
44
- "homepage": "https://anet.vansin.me",
43
+ "license": "Apache-2.0",
44
+ "homepage": "https://anet.sh",
45
45
  "repository": {
46
46
  "type": "git",
47
47
  "url": "https://github.com/sleep2agi/agent-network",
48
48
  "directory": "agent-network"
49
49
  },
50
+ "publishConfig": {
51
+ "access": "public"
52
+ },
53
+ "bugs": {
54
+ "url": "https://github.com/sleep2agi/agent-network/issues"
55
+ },
50
56
  "engines": {
51
57
  "bun": ">=1.2.0"
52
58
  },