@sleep2agi/agent-network 2.2.2-preview.0 → 2.2.3-preview.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- const a0_0x3e5e98=a0_0x5acc;function a0_0x5acc(_0x5d1f43,_0x22e063){_0x5d1f43=_0x5d1f43-0x1b0;const _0x117f34=a0_0x117f();let _0x5acc5f=_0x117f34[_0x5d1f43];return _0x5acc5f;}(function(_0x20d2e7,_0x5f3c79){const _0x35e6b3=a0_0x5acc,_0x288977=_0x20d2e7();while(!![]){try{const _0x52b575=parseInt(_0x35e6b3(0x1bb))/0x1*(parseInt(_0x35e6b3(0x1f3))/0x2)+parseInt(_0x35e6b3(0x1d4))/0x3*(parseInt(_0x35e6b3(0x1c4))/0x4)+parseInt(_0x35e6b3(0x1b4))/0x5+-parseInt(_0x35e6b3(0x205))/0x6*(-parseInt(_0x35e6b3(0x1e6))/0x7)+-parseInt(_0x35e6b3(0x1bd))/0x8+-parseInt(_0x35e6b3(0x1cc))/0x9+-parseInt(_0x35e6b3(0x1bc))/0xa*(parseInt(_0x35e6b3(0x1fa))/0xb);if(_0x52b575===_0x5f3c79)break;else _0x288977['push'](_0x288977['shift']());}catch(_0x414d43){_0x288977['push'](_0x288977['shift']());}}}(a0_0x117f,0xebce5));import{EventEmitter as a0_0x35faba}from'events';import{hostname as a0_0x513164}from'os';class T extends a0_0x35faba{['url'];[a0_0x3e5e98(0x1fd)];[a0_0x3e5e98(0x1c3)];[a0_0x3e5e98(0x201)];[a0_0x3e5e98(0x1f1)];['heartbeatInterval'];[a0_0x3e5e98(0x1d8)];['heartbeatTimer'];[a0_0x3e5e98(0x203)];[a0_0x3e5e98(0x1b9)]=!0x1;constructor(_0x5f1061){const _0x517c34=a0_0x3e5e98;super();if(this[_0x517c34(0x208)]=_0x5f1061[_0x517c34(0x208)][_0x517c34(0x1ce)](/\/$/,''),this[_0x517c34(0x1fd)]=_0x5f1061[_0x517c34(0x1fd)],this[_0x517c34(0x1c3)]=_0x5f1061[_0x517c34(0x1c3)],this['agent']=_0x5f1061[_0x517c34(0x201)]||'sdk',this['resumeId']=_0x517c34(0x1fc)+_0x5f1061[_0x517c34(0x1fd)]+'-'+Date['now']()[_0x517c34(0x1c9)](0x24),this[_0x517c34(0x1e3)]=_0x5f1061[_0x517c34(0x1e3)]??0x2bf20,this['reconnectDelay']=_0x5f1061[_0x517c34(0x1d8)]??0xbb8,_0x5f1061[_0x517c34(0x1c0)]!==!0x1)this[_0x517c34(0x1b8)]();}['log'](_0x42c0f9){const _0x1995b7=a0_0x3e5e98;console[_0x1995b7(0x206)]('['+new Date()[_0x1995b7(0x1f4)]()[_0x1995b7(0x1f5)](0x0,0x8)+_0x1995b7(0x207)+this['alias']+']\x20'+_0x42c0f9);}async['call'](_0x48840a,_0x1c2035){const _0x3a6727=a0_0x3e5e98;let _0x41e975={'Content-Type':_0x3a6727(0x1b0),'Accept':_0x3a6727(0x1b5)};if(this['token'])_0x41e975[_0x3a6727(0x1e4)]=_0x3a6727(0x1eb)+this['token'];let _0x49fa8e=await(await fetch(this['url']+_0x3a6727(0x1f9),{'method':_0x3a6727(0x202),'headers':_0x41e975,'body':JSON['stringify']({'jsonrpc':_0x3a6727(0x200),'id':Date[_0x3a6727(0x1b2)](),'method':_0x3a6727(0x1ec),'params':{'name':_0x48840a,'arguments':_0x1c2035}})}))[_0x3a6727(0x1fb)](),_0x23e2fd=_0x49fa8e[_0x3a6727(0x1f7)](/data: (.+)/),_0x2cfacc=_0x23e2fd?JSON[_0x3a6727(0x1bf)](_0x23e2fd[0x1]):JSON['parse'](_0x49fa8e),_0x58331b=_0x2cfacc?.['result']?.[_0x3a6727(0x1cd)]?.[0x0]?.[_0x3a6727(0x1fb)];return _0x58331b?JSON[_0x3a6727(0x1bf)](_0x58331b):_0x2cfacc;}async[a0_0x3e5e98(0x1b8)](){const _0x42b9ec=a0_0x3e5e98;if(this['running'])return;this[_0x42b9ec(0x1b9)]=!0x0,await this[_0x42b9ec(0x1e5)](_0x42b9ec(0x1df)),this[_0x42b9ec(0x206)](_0x42b9ec(0x209)),this[_0x42b9ec(0x1f6)]=setInterval(()=>{const _0x728a4c=_0x42b9ec;this[_0x728a4c(0x1e5)](_0x728a4c(0x1df))[_0x728a4c(0x1e9)](_0x53c721=>this[_0x728a4c(0x206)](_0x728a4c(0x1c5)+_0x53c721[_0x728a4c(0x1d1)]));},this['heartbeatInterval']),this[_0x42b9ec(0x1f8)]();}async[a0_0x3e5e98(0x1d3)](){const _0x38ce05=a0_0x3e5e98;if(this[_0x38ce05(0x1b9)]=!0x1,this[_0x38ce05(0x203)]?.[_0x38ce05(0x1ef)](),this[_0x38ce05(0x1f6)])clearInterval(this[_0x38ce05(0x1f6)]);await this[_0x38ce05(0x1e5)](_0x38ce05(0x1cf))[_0x38ce05(0x1e9)](()=>{}),this[_0x38ce05(0x206)](_0x38ce05(0x1d5));}async['send'](_0x159e81,_0x388547,_0x534b72=a0_0x3e5e98(0x1d6)){const _0x26b360=a0_0x3e5e98;return this[_0x26b360(0x1e1)]('send_task',{'alias':_0x159e81,'task':_0x388547,'priority':_0x534b72,'from_session':this[_0x26b360(0x1fd)]});}async['message'](_0x165dad,_0x542cf7){const _0x586efe=a0_0x3e5e98;return this[_0x586efe(0x1e1)](_0x586efe(0x204),{'alias':_0x165dad,'message':_0x542cf7,'from_session':this[_0x586efe(0x1fd)]});}async[a0_0x3e5e98(0x1b1)](_0x3dc9b1,_0x37462e,_0xc7831='completed'){const _0xe22f8d=a0_0x3e5e98;return this[_0xe22f8d(0x1e1)](_0xe22f8d(0x1c6),{'in_reply_to':_0x3dc9b1,'text':_0x37462e,'status':_0xc7831});}async[a0_0x3e5e98(0x1e5)](_0x1477a0,_0xc8c67f){const _0x599463=a0_0x3e5e98;return this[_0x599463(0x1e1)](_0x599463(0x1dc),{'resume_id':this[_0x599463(0x1f1)],'alias':this[_0x599463(0x1fd)],'status':_0x1477a0,'server':a0_0x513164(),'hostname':a0_0x513164(),'agent':this[_0x599463(0x201)],'project_dir':process[_0x599463(0x1c1)](),..._0xc8c67f});}async[a0_0x3e5e98(0x1ea)](){const _0x319be4=a0_0x3e5e98;return this[_0x319be4(0x1e1)]('get_all_status',{});}async[a0_0x3e5e98(0x1be)](_0x8fdef2,_0x55a9bc){const _0x426bb3=a0_0x3e5e98;return this[_0x426bb3(0x1e1)](_0x426bb3(0x1be),{'message':_0x8fdef2,'filter_server':_0x55a9bc?.[_0x426bb3(0x1ee)],'filter_status':_0x55a9bc?.['status']});}async[a0_0x3e5e98(0x1f8)](){const _0x19d74b=a0_0x3e5e98;let _0x40b178=encodeURIComponent(this[_0x19d74b(0x1fd)]),_0x325248=this['url']+_0x19d74b(0x1d0)+_0x40b178,_0x4bac5a=this['reconnectDelay'];while(this[_0x19d74b(0x1b9)]){try{this[_0x19d74b(0x203)]=new AbortController();let _0x4ed062={'Accept':_0x19d74b(0x1dd)};if(this[_0x19d74b(0x1c3)])_0x4ed062[_0x19d74b(0x1e4)]='Bearer\x20'+this[_0x19d74b(0x1c3)];let _0x2c66ac=await fetch(_0x325248,{'headers':_0x4ed062,'signal':this['sseAbort'][_0x19d74b(0x1b7)]});if(!_0x2c66ac['ok']||!_0x2c66ac[_0x19d74b(0x1b3)]){this[_0x19d74b(0x206)](_0x19d74b(0x1e7)+_0x2c66ac[_0x19d74b(0x1e5)]),await this[_0x19d74b(0x1b6)](_0x4bac5a),_0x4bac5a=Math[_0x19d74b(0x1c2)](_0x4bac5a*1.5,0xea60);continue;}_0x4bac5a=this[_0x19d74b(0x1d8)];let _0x8fcc4=_0x2c66ac['body']['getReader'](),_0x46f974=new TextDecoder(),_0x1d69fa='';while(this[_0x19d74b(0x1b9)]){let {done:_0x3949aa,value:_0x5da831}=await _0x8fcc4['read']();if(_0x3949aa)break;_0x1d69fa+=_0x46f974[_0x19d74b(0x1ff)](_0x5da831,{'stream':!0x0});let _0x231f5a=_0x1d69fa[_0x19d74b(0x1ba)]('\x0a');_0x1d69fa=_0x231f5a[_0x19d74b(0x1cb)]()||'';for(let _0xea4c03 of _0x231f5a){if(!_0xea4c03[_0x19d74b(0x1ca)](_0x19d74b(0x1e8)))continue;try{let _0x2c2963=JSON[_0x19d74b(0x1bf)](_0xea4c03[_0x19d74b(0x1f5)](0x6));if(_0x2c2963[_0x19d74b(0x1f0)]===_0x19d74b(0x1d2)){this[_0x19d74b(0x206)]('SSE\x20connected'),this[_0x19d74b(0x1de)](_0x19d74b(0x1d2));continue;}if(_0x2c2963[_0x19d74b(0x1f0)]===_0x19d74b(0x1e2)||_0x2c2963[_0x19d74b(0x1f0)]===_0x19d74b(0x1c7)||_0x2c2963[_0x19d74b(0x1f0)]===_0x19d74b(0x1be))await this[_0x19d74b(0x1da)]();}catch{}}}}catch(_0x3a2894){if(_0x3a2894[_0x19d74b(0x1d9)]===_0x19d74b(0x1e0))break;this['emit'](_0x19d74b(0x1ed),_0x3a2894),this[_0x19d74b(0x206)](_0x19d74b(0x1c8)+_0x3a2894[_0x19d74b(0x1d1)]);}if(this['running'])this['emit'](_0x19d74b(0x1d5)),this[_0x19d74b(0x206)]('SSE\x20reconnecting\x20in\x20'+_0x4bac5a/0x3e8+'s...'),await this[_0x19d74b(0x1b6)](_0x4bac5a),_0x4bac5a=Math[_0x19d74b(0x1c2)](_0x4bac5a*1.5,0xea60);}}async[a0_0x3e5e98(0x1da)](){const _0x1aee87=a0_0x3e5e98;try{let _0x35d6a6=(await this[_0x1aee87(0x1e1)](_0x1aee87(0x1fe),{'alias':this[_0x1aee87(0x1fd)],'limit':0xa}))?.[_0x1aee87(0x1db)]||[];for(let _0x5a0c69 of _0x35d6a6)await this[_0x1aee87(0x1e1)](_0x1aee87(0x1f2),{'alias':this[_0x1aee87(0x1fd)],'message_id':_0x5a0c69['id']}),this['log']('←\x20'+_0x5a0c69['from_session']+':\x20'+_0x5a0c69[_0x1aee87(0x1cd)]['slice'](0x0,0x3c)),this[_0x1aee87(0x1de)](_0x1aee87(0x1d7),_0x5a0c69),this[_0x1aee87(0x1de)](_0x1aee87(0x1d1),_0x5a0c69);}catch(_0x435859){this[_0x1aee87(0x206)]('inbox\x20error:\x20'+_0x435859[_0x1aee87(0x1d1)]);}}[a0_0x3e5e98(0x1b6)](_0x4ee17e){return new Promise(_0xfe0263=>setTimeout(_0xfe0263,_0x4ee17e));}}var $=T;function a0_0x117f(){const _0xae2947=['message','connected','disconnect','12846lgJYPu','disconnected','normal','task','reconnectDelay','name','processInbox','messages','report_status','text/event-stream','emit','idle','AbortError','call','new_task','heartbeatInterval','Authorization','status','7396459coExoE','SSE\x20failed:\x20','data:\x20','catch','getAllStatus','Bearer\x20','tools/call','error','server','abort','type','resumeId','ack_inbox','4YUUETw','toTimeString','slice','heartbeatTimer','match','connectSSE','/mcp','1983652hdTYft','text','sdk-','alias','get_inbox','decode','2.0','agent','POST','sseAbort','send_message','6dIEYcP','log',']\x20[commhub:','url','registered','application/json','reply','now','body','4748170OPIAUV','application/json,\x20text/event-stream','sleep','signal','connect','running','split','485519lxaVSd','20vtlSMo','9358864NmtcNI','broadcast','parse','autoConnect','cwd','min','token','188TkZCYE','heartbeat\x20failed:\x20','send_reply','new_message','SSE\x20error:\x20','toString','startsWith','pop','6139620vkljBF','content','replace','offline','/events/'];a0_0x117f=function(){return _0xae2947;};return a0_0x117f();}export{$ as default,T as CommHub};
1
+ function a0_0x4b95(){const _0x52e522=['type','report_status','6SNtwpD','7TJcfKa','4RHZGEw','4386800kWsnmF','cwd','result','autoConnect','url','307345YKMEvJ','startsWith','status','sseAbort','server','alias','catch','POST','normal','decode','toTimeString','disconnect','s...','abort','heartbeatInterval','completed','broadcast','replace','pop','1384696yRweCs','getAllStatus','message','get_inbox','/events/','body','read','idle','SSE\x20connected','task','/mcp','22410uWfGzO','send_message','offline','application/json','slice','SSE\x20failed:\x20','log','connected','split','registered','Authorization','agent','toString','sdk-','new_task','messages','stringify','parse','data:\x20','11720462XctyKV','12Eegeym','new_message','tools/call','emit','call','18729FcvENt','content','send','2.0','send_reply','1719OcGfen','running','heartbeat\x20failed:\x20','heartbeatTimer','2zVqcmw','disconnected','Bearer\x20','reconnectDelay','token','min','connect','text','application/json,\x20text/event-stream','reply','sleep','match','error','send_task','2356825CotkWq','resumeId','SSE\x20error:\x20'];a0_0x4b95=function(){return _0x52e522;};return a0_0x4b95();}const a0_0x4977ce=a0_0x1b6f;(function(_0x17e80e,_0x147dbd){const _0x28f046=a0_0x1b6f,_0x2ed8b0=_0x17e80e();while(!![]){try{const _0x456278=parseInt(_0x28f046(0x160))/0x1*(-parseInt(_0x28f046(0x145))/0x2)+parseInt(_0x28f046(0x197))/0x3*(-parseInt(_0x28f046(0x15a))/0x4)+-parseInt(_0x28f046(0x153))/0x5*(parseInt(_0x28f046(0x158))/0x6)+parseInt(_0x28f046(0x159))/0x7*(parseInt(_0x28f046(0x173))/0x8)+parseInt(_0x28f046(0x19c))/0x9*(-parseInt(_0x28f046(0x17e))/0xa)+parseInt(_0x28f046(0x15b))/0xb+-parseInt(_0x28f046(0x192))/0xc*(-parseInt(_0x28f046(0x191))/0xd);if(_0x456278===_0x147dbd)break;else _0x2ed8b0['push'](_0x2ed8b0['shift']());}catch(_0x4e21f9){_0x2ed8b0['push'](_0x2ed8b0['shift']());}}}(a0_0x4b95,0x3f97d));import{EventEmitter as a0_0x18fa14}from'events';import{hostname as a0_0x387df7}from'os';class T extends a0_0x18fa14{[a0_0x4977ce(0x15f)];[a0_0x4977ce(0x165)];[a0_0x4977ce(0x149)];[a0_0x4977ce(0x189)];[a0_0x4977ce(0x154)];['heartbeatInterval'];[a0_0x4977ce(0x148)];[a0_0x4977ce(0x144)];[a0_0x4977ce(0x163)];['running']=!0x1;constructor(_0x3ca0b8){const _0x3165f9=a0_0x4977ce;super();if(this[_0x3165f9(0x15f)]=_0x3ca0b8[_0x3165f9(0x15f)][_0x3165f9(0x171)](/\/$/,''),this[_0x3165f9(0x165)]=_0x3ca0b8[_0x3165f9(0x165)],this[_0x3165f9(0x149)]=_0x3ca0b8[_0x3165f9(0x149)],this[_0x3165f9(0x189)]=_0x3ca0b8[_0x3165f9(0x189)]||'sdk',this[_0x3165f9(0x154)]=_0x3165f9(0x18b)+_0x3ca0b8[_0x3165f9(0x165)]+'-'+Date['now']()[_0x3165f9(0x18a)](0x24),this[_0x3165f9(0x16e)]=_0x3ca0b8[_0x3165f9(0x16e)]??0x2bf20,this['reconnectDelay']=_0x3ca0b8['reconnectDelay']??0xbb8,_0x3ca0b8[_0x3165f9(0x15e)]!==!0x1)this[_0x3165f9(0x14b)]();}['log'](_0x3d29e8){const _0x36163a=a0_0x4977ce;console[_0x36163a(0x184)]('['+new Date()[_0x36163a(0x16a)]()[_0x36163a(0x182)](0x0,0x8)+']\x20[commhub:'+this['alias']+']\x20'+_0x3d29e8);}async[a0_0x4977ce(0x196)](_0x1d0e2d,_0x447b31){const _0x17fed5=a0_0x4977ce;let _0x13c492={'Content-Type':_0x17fed5(0x181),'Accept':_0x17fed5(0x14d)};if(this[_0x17fed5(0x149)])_0x13c492[_0x17fed5(0x188)]='Bearer\x20'+this[_0x17fed5(0x149)];let _0x4410b3=await(await fetch(this[_0x17fed5(0x15f)]+_0x17fed5(0x17d),{'method':_0x17fed5(0x167),'headers':_0x13c492,'body':JSON[_0x17fed5(0x18e)]({'jsonrpc':_0x17fed5(0x19a),'id':Date['now'](),'method':_0x17fed5(0x194),'params':{'name':_0x1d0e2d,'arguments':_0x447b31}})}))[_0x17fed5(0x14c)](),_0x3d4367=_0x4410b3[_0x17fed5(0x150)](/data: (.+)/),_0x369053=_0x3d4367?JSON[_0x17fed5(0x18f)](_0x3d4367[0x1]):JSON[_0x17fed5(0x18f)](_0x4410b3),_0x579f25=_0x369053?.[_0x17fed5(0x15d)]?.[_0x17fed5(0x198)]?.[0x0]?.[_0x17fed5(0x14c)];return _0x579f25?JSON[_0x17fed5(0x18f)](_0x579f25):_0x369053;}async[a0_0x4977ce(0x14b)](){const _0x19057c=a0_0x4977ce;if(this[_0x19057c(0x19d)])return;this[_0x19057c(0x19d)]=!0x0,await this[_0x19057c(0x162)](_0x19057c(0x17a)),this[_0x19057c(0x184)](_0x19057c(0x187)),this[_0x19057c(0x144)]=setInterval(()=>{const _0x292f56=_0x19057c;this[_0x292f56(0x162)](_0x292f56(0x17a))[_0x292f56(0x166)](_0x229e99=>this[_0x292f56(0x184)](_0x292f56(0x19e)+_0x229e99['message']));},this[_0x19057c(0x16e)]),this['connectSSE']();}async[a0_0x4977ce(0x16b)](){const _0x5aeb2f=a0_0x4977ce;if(this[_0x5aeb2f(0x19d)]=!0x1,this[_0x5aeb2f(0x163)]?.[_0x5aeb2f(0x16d)](),this[_0x5aeb2f(0x144)])clearInterval(this[_0x5aeb2f(0x144)]);await this['status'](_0x5aeb2f(0x180))[_0x5aeb2f(0x166)](()=>{}),this[_0x5aeb2f(0x184)](_0x5aeb2f(0x146));}async[a0_0x4977ce(0x199)](_0x57c2cd,_0x2c89a9,_0x4b74f4=a0_0x4977ce(0x168)){const _0x37ab81=a0_0x4977ce;return this[_0x37ab81(0x196)](_0x37ab81(0x152),{'alias':_0x57c2cd,'task':_0x2c89a9,'priority':_0x4b74f4,'from_session':this[_0x37ab81(0x165)]});}async['message'](_0x442530,_0x337924){const _0x3a6d2a=a0_0x4977ce;return this[_0x3a6d2a(0x196)](_0x3a6d2a(0x17f),{'alias':_0x442530,'message':_0x337924,'from_session':this[_0x3a6d2a(0x165)]});}async[a0_0x4977ce(0x14e)](_0x572c66,_0x53b5db,_0x3ca623=a0_0x4977ce(0x16f)){const _0x20ae6b=a0_0x4977ce;return this['call'](_0x20ae6b(0x19b),{'in_reply_to':_0x572c66,'text':_0x53b5db,'status':_0x3ca623});}async[a0_0x4977ce(0x162)](_0x39244d,_0x294aa7){const _0xc50be0=a0_0x4977ce;return this[_0xc50be0(0x196)](_0xc50be0(0x157),{'resume_id':this['resumeId'],'alias':this[_0xc50be0(0x165)],'status':_0x39244d,'server':a0_0x387df7(),'hostname':a0_0x387df7(),'agent':this[_0xc50be0(0x189)],'project_dir':process[_0xc50be0(0x15c)](),..._0x294aa7});}async[a0_0x4977ce(0x174)](){return this['call']('get_all_status',{});}async[a0_0x4977ce(0x170)](_0x226310,_0x50df45){const _0xf810d2=a0_0x4977ce;return this['call'](_0xf810d2(0x170),{'message':_0x226310,'filter_server':_0x50df45?.[_0xf810d2(0x164)],'filter_status':_0x50df45?.[_0xf810d2(0x162)]});}async['connectSSE'](){const _0x4a1913=a0_0x4977ce;let _0x594f42=encodeURIComponent(this['alias']),_0x4df422=this[_0x4a1913(0x15f)]+_0x4a1913(0x177)+_0x594f42,_0x1b3074=this[_0x4a1913(0x148)];while(this[_0x4a1913(0x19d)]){try{this[_0x4a1913(0x163)]=new AbortController();let _0x126713={'Accept':'text/event-stream'};if(this[_0x4a1913(0x149)])_0x126713[_0x4a1913(0x188)]=_0x4a1913(0x147)+this['token'];let _0x1b0c84=await fetch(_0x4df422,{'headers':_0x126713,'signal':this[_0x4a1913(0x163)]['signal']});if(!_0x1b0c84['ok']||!_0x1b0c84[_0x4a1913(0x178)]){this[_0x4a1913(0x184)](_0x4a1913(0x183)+_0x1b0c84[_0x4a1913(0x162)]),await this[_0x4a1913(0x14f)](_0x1b3074),_0x1b3074=Math[_0x4a1913(0x14a)](_0x1b3074*1.5,0xea60);continue;}_0x1b3074=this[_0x4a1913(0x148)];let _0x34c414=_0x1b0c84[_0x4a1913(0x178)]['getReader'](),_0x143ade=new TextDecoder(),_0x185232='';while(this[_0x4a1913(0x19d)]){let {done:_0x7f66ba,value:_0x49660e}=await _0x34c414[_0x4a1913(0x179)]();if(_0x7f66ba)break;_0x185232+=_0x143ade[_0x4a1913(0x169)](_0x49660e,{'stream':!0x0});let _0x265f38=_0x185232[_0x4a1913(0x186)]('\x0a');_0x185232=_0x265f38[_0x4a1913(0x172)]()||'';for(let _0x5ecc91 of _0x265f38){if(!_0x5ecc91[_0x4a1913(0x161)](_0x4a1913(0x190)))continue;try{let _0x4e59b8=JSON[_0x4a1913(0x18f)](_0x5ecc91['slice'](0x6));if(_0x4e59b8[_0x4a1913(0x156)]===_0x4a1913(0x185)){this[_0x4a1913(0x184)](_0x4a1913(0x17b)),this[_0x4a1913(0x195)]('connected');continue;}if(_0x4e59b8[_0x4a1913(0x156)]===_0x4a1913(0x18c)||_0x4e59b8['type']===_0x4a1913(0x193)||_0x4e59b8[_0x4a1913(0x156)]==='broadcast')await this['processInbox']();}catch{}}}}catch(_0x5e4364){if(_0x5e4364['name']==='AbortError')break;this[_0x4a1913(0x195)](_0x4a1913(0x151),_0x5e4364),this[_0x4a1913(0x184)](_0x4a1913(0x155)+_0x5e4364[_0x4a1913(0x175)]);}if(this[_0x4a1913(0x19d)])this[_0x4a1913(0x195)](_0x4a1913(0x146)),this[_0x4a1913(0x184)]('SSE\x20reconnecting\x20in\x20'+_0x1b3074/0x3e8+_0x4a1913(0x16c)),await this[_0x4a1913(0x14f)](_0x1b3074),_0x1b3074=Math[_0x4a1913(0x14a)](_0x1b3074*1.5,0xea60);}}async['processInbox'](){const _0x100879=a0_0x4977ce;try{let _0x4cddaf=(await this['call'](_0x100879(0x176),{'alias':this[_0x100879(0x165)],'limit':0xa}))?.[_0x100879(0x18d)]||[];for(let _0x29df34 of _0x4cddaf)await this[_0x100879(0x196)]('ack_inbox',{'alias':this[_0x100879(0x165)],'message_id':_0x29df34['id']}),this[_0x100879(0x184)]('←\x20'+_0x29df34['from_session']+':\x20'+_0x29df34[_0x100879(0x198)]['slice'](0x0,0x3c)),this[_0x100879(0x195)](_0x100879(0x17c),_0x29df34),this[_0x100879(0x195)](_0x100879(0x175),_0x29df34);}catch(_0x331cd6){this['log']('inbox\x20error:\x20'+_0x331cd6[_0x100879(0x175)]);}}[a0_0x4977ce(0x14f)](_0x3a5dc){return new Promise(_0xd22782=>setTimeout(_0xd22782,_0x3a5dc));}}var $=T;function a0_0x1b6f(_0x2da118,_0x3ab116){_0x2da118=_0x2da118-0x144;const _0x4b9532=a0_0x4b95();let _0x1b6ffd=_0x4b9532[_0x2da118];return _0x1b6ffd;}export{$ as default,T as CommHub};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- const a0_0x923dcb=a0_0x2d2b;(function(_0x5a8f08,_0x3aafcb){const _0x477a66=a0_0x2d2b,_0x13c18d=_0x5a8f08();while(!![]){try{const _0x1425c1=parseInt(_0x477a66(0xd7))/0x1+parseInt(_0x477a66(0x10f))/0x2*(-parseInt(_0x477a66(0x143))/0x3)+-parseInt(_0x477a66(0xd5))/0x4+parseInt(_0x477a66(0xc8))/0x5*(-parseInt(_0x477a66(0xec))/0x6)+parseInt(_0x477a66(0x136))/0x7+parseInt(_0x477a66(0x119))/0x8*(-parseInt(_0x477a66(0xd9))/0x9)+parseInt(_0x477a66(0x12f))/0xa;if(_0x1425c1===_0x3aafcb)break;else _0x13c18d['push'](_0x13c18d['shift']());}catch(_0x31739a){_0x13c18d['push'](_0x13c18d['shift']());}}}(a0_0x59ee,0x25b83));import{readFileSync as a0_0x1f5938,existsSync as a0_0x5589c6}from'fs';import{randomUUID as a0_0x13945d}from'crypto';import{join as a0_0x1ed1b6}from'path';import{hostname as a0_0x57e10e}from'os';import{execSync as a0_0x14efb6}from'child_process';import{Server as a0_0xebd3b8}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x4677d3}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0x58d468,CallToolRequestSchema as a0_0x4e9b91}from'@modelcontextprotocol/sdk/types.js';function p(_0x2a1625){const _0x23e831=a0_0x2d2b;if(!a0_0x5589c6(_0x2a1625))return;for(let _0x48f1a of a0_0x1f5938(_0x2a1625,_0x23e831(0x148))[_0x23e831(0xfc)]('\x0a')){let _0x286d8f=_0x48f1a[_0x23e831(0x10e)]();if(!_0x286d8f||_0x286d8f[_0x23e831(0x103)]('#'))continue;let _0xa45a13=_0x286d8f[_0x23e831(0xba)]('=');if(_0xa45a13<0x0)continue;let _0x5e0555=_0x286d8f[_0x23e831(0xfd)](0x0,_0xa45a13)[_0x23e831(0x10e)](),_0x424c38=_0x286d8f[_0x23e831(0xfd)](_0xa45a13+0x1)['trim']()[_0x23e831(0xc9)](/^["']|["']$/g,'');if(!process.env[_0x5e0555])process.env[_0x5e0555]=_0x424c38;}}var C=process.env.HOME||'~',T=a0_0x1ed1b6(C,'.claude/channels/commhub');p(a0_0x1ed1b6(T,a0_0x923dcb(0xef)));var L=process[a0_0x923dcb(0x142)]()[a0_0x923dcb(0xc9)](/\//g,'-');p(a0_0x1ed1b6(T,L,a0_0x923dcb(0xef)));function a0_0x59ee(){const _0x21c524=['/events/','1654646BXlrYy','.anet','stringify','ready\x20—\x20waiting\x20for\x20events','→\x20injected\x20task\x20','pop','SSE\x20connection\x20error:\x20','2025-03-26','decode','none','ack_inbox','SSE\x20connected\x20as\x20\x22','cwd','709899SjeKUQ','delete','CommHub\x20init\x20failed:\x20','0.3.0','MCP\x20stdio\x20connected','utf-8','\x20from\x20','indexOf','write','\x20RESUME_ID=','completed','normal','number','claude-code','read','\x20PROJECT_ENV=','setRequestHandler','notifications/claude/channel','parse\x20error:\x20','text','SIGINT','86215UftjCv','replace','Session\x20alias:\x20','content','initialize','set','in_progress','POST','registered\x20as\x20\x22','from','commhub_send_task','commhub-channel','exit','1167532mjTnhJ','notification','251388SSoKph','result','85815OUFTsN','new_task','then','catch','config.json','init\x20failed:\x20','toTimeString',']\x20[commhub]\x20','unknown\x20tool','send_message','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','from_session','Priority\x20(default:\x20normal)','SSE\x20stream\x20ended,\x20reconnecting...','\x22\x20(','get','messages','stdin','Target\x20session\x20alias','42KmfZyO','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','2.0','.env','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','SIGTERM','send_task','connected','tmux\x20display-message\x20-p\x20\x27#S\x27','string','commhub_reply','fatal:\x20','tools/call','object','find','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','split','slice','no\x20response','hub','heartbeat\x20failed:\x20','\x20ALIAS=','Bearer\x20','startsWith','session\x20disconnected','params','alias','\x20priority=','statusText','failed','report_status','connect','status','idle','trim','2XZFMaB','ENV:\x20URL=','high','application/json','parse','Authorization','Message\x20content','priority','Reply\x20text\x20/\x20result\x20summary','SSE\x20fatal:\x20','104qiXqUP','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','message_id','message','blocked','send_reply','http://127.0.0.1:9200',':\x20inbox_count=','application/json,\x20text/event-stream','inbox_count','type','join','Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','task','getReader','starting\x20SSE\x20listener...','\x20CWD=','cancelled','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','connecting\x20to\x20','commhub_send_message','working','4399050pKpfrh','error','body','commhub','low','commhub_get_all_status'];a0_0x59ee=function(){return _0x21c524;};return a0_0x59ee();}function U(){const _0x5ef342=a0_0x923dcb;try{return a0_0x14efb6(_0x5ef342(0xf4),{'encoding':_0x5ef342(0x148),'timeout':0x7d0})['trim']();}catch{return'';}}function v(){const _0x2e647c=a0_0x923dcb;try{let _0x110a40=a0_0x1ed1b6(C,_0x2e647c(0x137),_0x2e647c(0xdd));if(a0_0x5589c6(_0x110a40))return JSON[_0x2e647c(0x113)](a0_0x1f5938(_0x110a40,'utf-8'));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x923dcb(0xff)]||a0_0x923dcb(0x11f),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x57e10e(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x13945d(),X=process.env.COMMHUB_TOKEN||H['token']||'';function Y(_0x2d430d){const _0x1234cd=a0_0x923dcb;let _0x2c30f0=new Date()[_0x1234cd(0xdf)]()['slice'](0x0,0x8);process['stderr'][_0x1234cd(0xbb)]('['+_0x2c30f0+_0x1234cd(0xe0)+_0x2d430d+'\x0a');}function h(_0x172eee){return new Promise(_0x17d5b4=>setTimeout(_0x17d5b4,_0x172eee));}Y(a0_0x923dcb(0x110)+f+a0_0x923dcb(0x101)+Z+a0_0x923dcb(0xbc)+w['slice'](0x0,0x8)+'...\x20TMUX='+(j||a0_0x923dcb(0x13f))+a0_0x923dcb(0x129)+process['cwd']()+a0_0x923dcb(0xc2)+L);var k=new Map(),K=new a0_0xebd3b8({'name':a0_0x923dcb(0xd3),'version':a0_0x923dcb(0x146)},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x923dcb(0xfb),a0_0x923dcb(0xf0),a0_0x923dcb(0xe3),'You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.',a0_0x923dcb(0xca)+Z][a0_0x923dcb(0x124)]('\x0a')});K[a0_0x923dcb(0xc3)](a0_0x58d468,async()=>({'tools':[{'name':'commhub_reply','description':'Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','inputSchema':{'type':'object','properties':{'task_id':{'type':a0_0x923dcb(0xf5),'description':a0_0x923dcb(0xed)},'text':{'type':a0_0x923dcb(0xf5),'description':a0_0x923dcb(0x117)},'status':{'type':a0_0x923dcb(0xf5),'enum':[a0_0x923dcb(0xbd),a0_0x923dcb(0x109),a0_0x923dcb(0x12a),a0_0x923dcb(0x11d),a0_0x923dcb(0x130),a0_0x923dcb(0xce)],'description':'Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates'}},'required':[a0_0x923dcb(0xc6)]}},{'name':'commhub_report_status','description':a0_0x923dcb(0x12b),'inputSchema':{'type':'object','properties':{'status':{'type':a0_0x923dcb(0xf5),'enum':[a0_0x923dcb(0x12e),a0_0x923dcb(0x10d),'blocked',a0_0x923dcb(0x130)]},'task':{'type':a0_0x923dcb(0xf5),'description':'Current\x20task\x20description'},'progress':{'type':a0_0x923dcb(0xbf),'description':'Progress\x200-100'}},'required':[a0_0x923dcb(0x10c)]}},{'name':a0_0x923dcb(0xd2),'description':'Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x923dcb(0xf5),'description':a0_0x923dcb(0xeb)},'task':{'type':a0_0x923dcb(0xf5),'description':'Task\x20content'},'priority':{'type':'string','enum':[a0_0x923dcb(0x111),a0_0x923dcb(0xbe),a0_0x923dcb(0x133)],'description':a0_0x923dcb(0xe5)}},'required':[a0_0x923dcb(0x106),a0_0x923dcb(0x126)]}},{'name':a0_0x923dcb(0x12d),'description':a0_0x923dcb(0x11a),'inputSchema':{'type':a0_0x923dcb(0xf9),'properties':{'alias':{'type':a0_0x923dcb(0xf5),'description':a0_0x923dcb(0xeb)},'message':{'type':a0_0x923dcb(0xf5),'description':a0_0x923dcb(0x115)}},'required':[a0_0x923dcb(0x106),a0_0x923dcb(0x11c)]}},{'name':a0_0x923dcb(0x134),'description':a0_0x923dcb(0x125),'inputSchema':{'type':a0_0x923dcb(0xf9),'properties':{}}}]}));async function P(_0x358001,_0x4846cb){const _0x19c9c5=a0_0x923dcb;let _0x5625fd=await fetch(f+'/mcp',{'method':_0x19c9c5(0xcf),'headers':{'Content-Type':_0x19c9c5(0x112),'Accept':_0x19c9c5(0x121),...X?{'Authorization':_0x19c9c5(0x102)+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x19c9c5(0xee),'id':0x1,'method':_0x19c9c5(0xcc),'params':{'protocolVersion':_0x19c9c5(0x13d),'capabilities':{},'clientInfo':{'name':_0x19c9c5(0xd3),'version':_0x19c9c5(0x146)}}})});if(!_0x5625fd['ok']){let _0x30610d=await _0x5625fd[_0x19c9c5(0xc6)]();return Y(_0x19c9c5(0x145)+_0x5625fd[_0x19c9c5(0x10c)]+'\x20'+_0x30610d['slice'](0x0,0x64)),{'ok':!0x1,'error':_0x19c9c5(0xde)+_0x5625fd[_0x19c9c5(0x10c)]};}await _0x5625fd[_0x19c9c5(0xc6)]();let _0x362a6e=(await(await fetch(f+'/mcp',{'method':_0x19c9c5(0xcf),'headers':{'Content-Type':'application/json','Accept':_0x19c9c5(0x121),...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON['stringify']({'jsonrpc':_0x19c9c5(0xee),'id':0x2,'method':_0x19c9c5(0xf8),'params':{'name':_0x358001,'arguments':_0x4846cb}})}))['text']())[_0x19c9c5(0xfc)]('\x0a')[_0x19c9c5(0xfa)](_0x5860b3=>_0x5860b3[_0x19c9c5(0x103)]('data:\x20'));if(_0x362a6e){let _0x559da1=JSON[_0x19c9c5(0x113)](_0x362a6e[_0x19c9c5(0xfd)](0x6));return _0x559da1?.[_0x19c9c5(0xd8)]?.[_0x19c9c5(0xcb)]?.[0x0]?.['text']?JSON[_0x19c9c5(0x113)](_0x559da1[_0x19c9c5(0xd8)]['content'][0x0][_0x19c9c5(0xc6)]):_0x559da1;}return{'ok':!0x1,'error':_0x19c9c5(0xfe)};}K[a0_0x923dcb(0xc3)](a0_0x4e9b91,async _0x13adc9=>{const _0x3b24d3=a0_0x923dcb;let {name:_0x478fe6,arguments:_0xb089ca}=_0x13adc9[_0x3b24d3(0x105)];if(_0x478fe6===_0x3b24d3(0xf6)){let {task_id:_0x320e0f,text:_0x17cd46,status:_0x355eb3}=_0xb089ca;if(_0x355eb3===_0x3b24d3(0xbd)||_0x355eb3===_0x3b24d3(0x109)||_0x355eb3===_0x3b24d3(0x12a)){let _0x3f000e=_0x355eb3===_0x3b24d3(0xbd)?'replied':_0x355eb3,_0x361c07=_0x320e0f?k[_0x3b24d3(0xe8)](_0x320e0f)||_0x3b24d3(0xff):_0x3b24d3(0xff),_0x153f98=await P(_0x3b24d3(0x11e),{'alias':_0x361c07,'text':_0x17cd46,'in_reply_to':_0x320e0f||void 0x0,'status':_0x3f000e,'from_session':Z});if(_0x320e0f)k[_0x3b24d3(0x144)](_0x320e0f);return{'content':[{'type':'text','text':JSON[_0x3b24d3(0x138)](_0x153f98)}]};}let _0x2a3cdb=await P(_0x3b24d3(0x10a),{'resume_id':w,'alias':Z,'status':_0x355eb3==='blocked'?'blocked':_0x355eb3===_0x3b24d3(0x130)?'error':_0x3b24d3(0x12e),'task':_0x17cd46[_0x3b24d3(0xfd)](0x0,0xc8),'output':_0x17cd46});return{'content':[{'type':'text','text':JSON[_0x3b24d3(0x138)](_0x2a3cdb)}]};}if(_0x478fe6==='commhub_report_status'){let {status:_0x5e9552,task:_0x213c8b,progress:_0x2bf419}=_0xb089ca,_0x383f12=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x5e9552,'task':_0x213c8b,'progress':_0x2bf419});return{'content':[{'type':'text','text':JSON[_0x3b24d3(0x138)](_0x383f12)}]};}if(_0x478fe6==='commhub_send_task'){let {alias:_0x2e1cde,task:_0x2e7deb,priority:_0x4bb4a7}=_0xb089ca,_0x1084ec=await P(_0x3b24d3(0xf2),{'alias':_0x2e1cde,'task':_0x2e7deb,'priority':_0x4bb4a7||_0x3b24d3(0xbe),'from_session':Z});return{'content':[{'type':_0x3b24d3(0xc6),'text':JSON[_0x3b24d3(0x138)](_0x1084ec)}]};}if(_0x478fe6===_0x3b24d3(0x12d)){let {alias:_0xe5410e,message:_0x1864b7}=_0xb089ca,_0x4f7d19=await P(_0x3b24d3(0xe2),{'alias':_0xe5410e,'message':_0x1864b7,'from_session':Z});return{'content':[{'type':'text','text':JSON[_0x3b24d3(0x138)](_0x4f7d19)}]};}if(_0x478fe6===_0x3b24d3(0x134)){let _0x9a58a5=await P('get_all_status',{});return{'content':[{'type':_0x3b24d3(0xc6),'text':JSON[_0x3b24d3(0x138)](_0x9a58a5)}]};}return{'content':[{'type':_0x3b24d3(0xc6),'text':JSON[_0x3b24d3(0x138)]({'error':_0x3b24d3(0xe1)})}]};});async function u(){const _0x1a2d65=a0_0x923dcb;let _0x12d9d8=f+_0x1a2d65(0x135)+encodeURIComponent(Z),_0x57a718={};if(X)_0x57a718[_0x1a2d65(0x114)]=_0x1a2d65(0x102)+X;Y(_0x1a2d65(0x12c)+_0x12d9d8);while(!0x0){try{let _0x1a0be4=await fetch(_0x12d9d8,{'headers':_0x57a718});if(!_0x1a0be4['ok']){Y('SSE\x20error:\x20'+_0x1a0be4['status']+'\x20'+_0x1a0be4[_0x1a2d65(0x108)]),await h(0x1388);continue;}let _0x5a513a=_0x1a0be4[_0x1a2d65(0x131)][_0x1a2d65(0x127)](),_0x40378c=new TextDecoder(),_0x29784c='';while(!0x0){let {done:_0x147f81,value:_0x54f35c}=await _0x5a513a[_0x1a2d65(0xc1)]();if(_0x147f81)break;_0x29784c+=_0x40378c[_0x1a2d65(0x13e)](_0x54f35c,{'stream':!0x0});let _0x2f8bf1=_0x29784c[_0x1a2d65(0xfc)]('\x0a\x0a');_0x29784c=_0x2f8bf1[_0x1a2d65(0x13b)]()||'';for(let _0x2d53ca of _0x2f8bf1){let _0x2f14d7=_0x2d53ca['split']('\x0a')[_0x1a2d65(0xfa)](_0x308252=>_0x308252['startsWith']('data:\x20'));if(!_0x2f14d7)continue;try{let _0x199182=JSON[_0x1a2d65(0x113)](_0x2f14d7[_0x1a2d65(0xfd)](0x6));await S(_0x199182);}catch(_0xf5651e){Y(_0x1a2d65(0xc5)+_0xf5651e);}}}Y(_0x1a2d65(0xe6));}catch(_0x359705){Y(_0x1a2d65(0x13c)+_0x359705);}await h(0xbb8);}}async function S(_0x28b91d){const _0x4ffcc0=a0_0x923dcb;if(_0x28b91d[_0x4ffcc0(0x123)]===_0x4ffcc0(0xf3)){Y(_0x4ffcc0(0x141)+Z+'\x22');return;}if(_0x28b91d['type']==='new_message'){if(Y('←\x20message\x20from\x20'+_0x28b91d[_0x4ffcc0(0xd1)]+':\x20'+_0x28b91d[_0x4ffcc0(0x11c)]['slice'](0x0,0x3c)),await K[_0x4ffcc0(0xd6)]({'method':_0x4ffcc0(0xc4),'params':{'content':_0x28b91d[_0x4ffcc0(0x11c)],'meta':{'sender':_0x28b91d[_0x4ffcc0(0xd1)]||_0x4ffcc0(0xff),'sender_id':_0x4ffcc0(0x132),'user':_0x28b91d[_0x4ffcc0(0xd1)]||_0x4ffcc0(0xff),'priority':_0x4ffcc0(0xbe)}}}),_0x28b91d[_0x4ffcc0(0x11b)])await P('ack_inbox',{'alias':Z,'message_id':_0x28b91d['message_id']});return;}if(_0x28b91d[_0x4ffcc0(0x123)]===_0x4ffcc0(0xda)||_0x28b91d[_0x4ffcc0(0x123)]==='broadcast'){Y('←\x20'+_0x28b91d[_0x4ffcc0(0x123)]+_0x4ffcc0(0x120)+_0x28b91d[_0x4ffcc0(0x122)]+_0x4ffcc0(0x107)+(_0x28b91d[_0x4ffcc0(0x116)]||_0x4ffcc0(0xbe)));let _0x3f7f4f=await P('get_inbox',{'alias':Z,'limit':0x5});if(_0x3f7f4f?.['ok']&&_0x3f7f4f[_0x4ffcc0(0xe9)]?.['length']>0x0)for(let _0x2a6a5b of _0x3f7f4f[_0x4ffcc0(0xe9)]){let _0x41862f={'sender':_0x2a6a5b[_0x4ffcc0(0xe4)]||_0x4ffcc0(0xff),'sender_id':_0x4ffcc0(0x132),'user':_0x2a6a5b['from_session']||_0x4ffcc0(0xff),'task_id':_0x2a6a5b['id'],'priority':_0x2a6a5b[_0x4ffcc0(0x116)]||_0x4ffcc0(0xbe)};k[_0x4ffcc0(0xcd)](_0x2a6a5b['id'],_0x2a6a5b[_0x4ffcc0(0xe4)]||_0x4ffcc0(0xff)),await K['notification']({'method':_0x4ffcc0(0xc4),'params':{'content':_0x2a6a5b[_0x4ffcc0(0xcb)],'meta':_0x41862f}}),Y(_0x4ffcc0(0x13a)+_0x2a6a5b['id'][_0x4ffcc0(0xfd)](0x0,0x8)+_0x4ffcc0(0xb9)+_0x2a6a5b[_0x4ffcc0(0xe4)]+':\x20'+_0x2a6a5b[_0x4ffcc0(0xcb)][_0x4ffcc0(0xfd)](0x0,0x3c)),await P(_0x4ffcc0(0x140),{'alias':Z,'message_id':_0x2a6a5b['id']});}}}async function A(){const _0x37316a=a0_0x923dcb;let _0x1d754c=new a0_0x4677d3();await K[_0x37316a(0x10b)](_0x1d754c),Y(_0x37316a(0x147)),Y(_0x37316a(0x128)),u()[_0x37316a(0xdc)](_0x33d862=>Y(_0x37316a(0x118)+_0x33d862)),P(_0x37316a(0x10a),{'resume_id':w,'alias':Z,'status':_0x37316a(0x10d),'server':a0_0x57e10e(),'hostname':a0_0x57e10e(),'agent':_0x37316a(0xc0),'project_dir':process['cwd'](),'tmux_name':j||void 0x0})[_0x37316a(0xdb)](()=>Y(_0x37316a(0xd0)+Z+_0x37316a(0xe7)+w[_0x37316a(0xfd)](0x0,0x8)+')'))['catch'](_0x5e2371=>Y('warning:\x20could\x20not\x20register:\x20'+_0x5e2371)),setInterval(()=>{const _0xc290a0=_0x37316a;P('report_status',{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x57e10e(),'hostname':a0_0x57e10e(),'agent':_0xc290a0(0xc0),'project_dir':process[_0xc290a0(0x142)](),'tmux_name':j||void 0x0})[_0xc290a0(0xdc)](_0x3101f3=>Y(_0xc290a0(0x100)+_0x3101f3));},0x2bf20),Y(_0x37316a(0x139));}A()[a0_0x923dcb(0xdc)](_0x25a50d=>{const _0x536ef3=a0_0x923dcb;Y(_0x536ef3(0xf7)+_0x25a50d),process[_0x536ef3(0xd4)](0x1);});async function N(){const _0x422dd8=a0_0x923dcb;Y('shutting\x20down,\x20reporting\x20offline...'),await P('report_status',{'resume_id':w,'alias':Z,'status':'error','task':_0x422dd8(0x104)})[_0x422dd8(0xdc)](()=>{}),process[_0x422dd8(0xd4)](0x0);}function a0_0x2d2b(_0x472143,_0x734982){_0x472143=_0x472143-0xb9;const _0x59eef7=a0_0x59ee();let _0x2d2b09=_0x59eef7[_0x472143];return _0x2d2b09;}process[a0_0x923dcb(0xea)]['on']('end',()=>N()),process['on'](a0_0x923dcb(0xf1),()=>N()),process['on'](a0_0x923dcb(0xc7),()=>N());
2
+ const a0_0x23baf6=a0_0x5ffd;(function(_0x471f9c,_0x47f5bc){const _0x56f52c=a0_0x5ffd,_0x58a749=_0x471f9c();while(!![]){try{const _0x42c60f=parseInt(_0x56f52c(0xe7))/0x1*(-parseInt(_0x56f52c(0x104))/0x2)+parseInt(_0x56f52c(0x7d))/0x3*(parseInt(_0x56f52c(0x105))/0x4)+-parseInt(_0x56f52c(0x94))/0x5*(parseInt(_0x56f52c(0xa9))/0x6)+parseInt(_0x56f52c(0x9c))/0x7+-parseInt(_0x56f52c(0xa2))/0x8+parseInt(_0x56f52c(0x92))/0x9*(-parseInt(_0x56f52c(0xc3))/0xa)+parseInt(_0x56f52c(0xb3))/0xb;if(_0x42c60f===_0x47f5bc)break;else _0x58a749['push'](_0x58a749['shift']());}catch(_0x50e99e){_0x58a749['push'](_0x58a749['shift']());}}}(a0_0x441a,0x9053a));import{readFileSync as a0_0x50b915,existsSync as a0_0x359098}from'fs';import{randomUUID as a0_0x2692f7}from'crypto';import{join as a0_0x26a64d}from'path';import{hostname as a0_0x201dd8}from'os';import{execSync as a0_0x41dda2}from'child_process';import{Server as a0_0x17a361}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport as a0_0x7d2bfd}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListToolsRequestSchema as a0_0xa68fd7,CallToolRequestSchema as a0_0x1fbed3}from'@modelcontextprotocol/sdk/types.js';function p(_0x4b52ac){const _0x277795=a0_0x5ffd;if(!a0_0x359098(_0x4b52ac))return;for(let _0x4f7c2b of a0_0x50b915(_0x4b52ac,_0x277795(0xd0))[_0x277795(0x8b)]('\x0a')){let _0x50dd00=_0x4f7c2b['trim']();if(!_0x50dd00||_0x50dd00[_0x277795(0x88)]('#'))continue;let _0x2a8831=_0x50dd00[_0x277795(0xde)]('=');if(_0x2a8831<0x0)continue;let _0x573378=_0x50dd00['slice'](0x0,_0x2a8831)[_0x277795(0xc9)](),_0x5efd2b=_0x50dd00[_0x277795(0xdc)](_0x2a8831+0x1)[_0x277795(0xc9)]()[_0x277795(0xcb)](/^["']|["']$/g,'');if(!process.env[_0x573378])process.env[_0x573378]=_0x5efd2b;}}var C=process.env.HOME||'~',T=a0_0x26a64d(C,a0_0x23baf6(0xbc));p(a0_0x26a64d(T,a0_0x23baf6(0xb6)));var L=process[a0_0x23baf6(0x84)]()[a0_0x23baf6(0xcb)](/\//g,'-');p(a0_0x26a64d(T,L,'.env'));function U(){const _0x4a95bb=a0_0x23baf6;try{return a0_0x41dda2(_0x4a95bb(0xab),{'encoding':_0x4a95bb(0xd0),'timeout':0x7d0})[_0x4a95bb(0xc9)]();}catch{return'';}}function v(){const _0x3f15eb=a0_0x23baf6;try{let _0x7a2f27=a0_0x26a64d(C,_0x3f15eb(0xe5),_0x3f15eb(0x9b));if(a0_0x359098(_0x7a2f27))return JSON[_0x3f15eb(0x98)](a0_0x50b915(_0x7a2f27,_0x3f15eb(0xd0)));}catch{}return{};}var H=v(),f=process.env.COMMHUB_URL||H[a0_0x23baf6(0x8c)]||a0_0x23baf6(0x9d),j=process.env.COMMHUB_TMUX||U(),Z=process.env.COMMHUB_ALIAS||j||a0_0x201dd8(),w=process.env.COMMHUB_RESUME_ID||process.env.CLAUDE_RESUME_ID||a0_0x2692f7(),X=process.env.COMMHUB_TOKEN||H[a0_0x23baf6(0x7e)]||'';function Y(_0x2b52fe){const _0x4c940b=a0_0x23baf6;let _0x85b0dd=new Date()[_0x4c940b(0x82)]()['slice'](0x0,0x8);process[_0x4c940b(0xd8)][_0x4c940b(0xa6)]('['+_0x85b0dd+_0x4c940b(0xb1)+_0x2b52fe+'\x0a');}function h(_0x1c8f59){return new Promise(_0x56b374=>setTimeout(_0x56b374,_0x1c8f59));}Y(a0_0x23baf6(0xcf)+f+'\x20ALIAS='+Z+'\x20RESUME_ID='+w['slice'](0x0,0x8)+a0_0x23baf6(0x96)+(j||a0_0x23baf6(0xa8))+a0_0x23baf6(0xcc)+process['cwd']()+'\x20PROJECT_ENV='+L);var k=new Map(),K=new a0_0x17a361({'name':a0_0x23baf6(0xd2),'version':'0.3.0'},{'capabilities':{'experimental':{'claude/channel':{}},'tools':{}},'instructions':[a0_0x23baf6(0x91),a0_0x23baf6(0xb4),a0_0x23baf6(0xaf),'You\x20can\x20also\x20use\x20commhub_report_status\x20to\x20update\x20your\x20session\x20status.','Session\x20alias:\x20'+Z][a0_0x23baf6(0xc0)]('\x0a')});K['setRequestHandler'](a0_0xa68fd7,async()=>({'tools':[{'name':a0_0x23baf6(0xff),'description':a0_0x23baf6(0xba),'inputSchema':{'type':a0_0x23baf6(0x9a),'properties':{'task_id':{'type':a0_0x23baf6(0x103),'description':a0_0x23baf6(0xa4)},'text':{'type':a0_0x23baf6(0x103),'description':a0_0x23baf6(0x89)},'status':{'type':a0_0x23baf6(0x103),'enum':[a0_0x23baf6(0xef),a0_0x23baf6(0xad),a0_0x23baf6(0x80),a0_0x23baf6(0xee),a0_0x23baf6(0xec),'in_progress'],'description':a0_0x23baf6(0xf8)}},'required':[a0_0x23baf6(0xd7)]}},{'name':a0_0x23baf6(0xe0),'description':a0_0x23baf6(0xd1),'inputSchema':{'type':a0_0x23baf6(0x9a),'properties':{'status':{'type':'string','enum':[a0_0x23baf6(0x8a),a0_0x23baf6(0xfd),a0_0x23baf6(0xee),'error']},'task':{'type':'string','description':a0_0x23baf6(0xc6)},'progress':{'type':a0_0x23baf6(0xae),'description':'Progress\x200-100'}},'required':[a0_0x23baf6(0xa3)]}},{'name':'commhub_send_task','description':'Send\x20a\x20task\x20to\x20another\x20session\x20via\x20CommHub.','inputSchema':{'type':'object','properties':{'alias':{'type':a0_0x23baf6(0x103),'description':a0_0x23baf6(0xed)},'task':{'type':a0_0x23baf6(0x103),'description':a0_0x23baf6(0xf1)},'priority':{'type':a0_0x23baf6(0x103),'enum':['high',a0_0x23baf6(0xeb),a0_0x23baf6(0xf4)],'description':a0_0x23baf6(0x81)}},'required':[a0_0x23baf6(0xe2),'task']}},{'name':a0_0x23baf6(0x93),'description':a0_0x23baf6(0xcd),'inputSchema':{'type':a0_0x23baf6(0x9a),'properties':{'alias':{'type':a0_0x23baf6(0x103),'description':a0_0x23baf6(0xed)},'message':{'type':a0_0x23baf6(0x103),'description':a0_0x23baf6(0xc4)}},'required':['alias',a0_0x23baf6(0xc5)]}},{'name':a0_0x23baf6(0xb0),'description':'Get\x20status\x20of\x20all\x20sessions\x20from\x20CommHub.','inputSchema':{'type':a0_0x23baf6(0x9a),'properties':{}}}]}));async function P(_0x21bfb8,_0x328d0d){const _0x18919b=a0_0x23baf6;let _0x2e6aa7=await fetch(f+_0x18919b(0xfb),{'method':_0x18919b(0xdd),'headers':{'Content-Type':'application/json','Accept':_0x18919b(0xf5),...X?{'Authorization':_0x18919b(0x97)+X}:{}},'body':JSON[_0x18919b(0xe3)]({'jsonrpc':'2.0','id':0x1,'method':_0x18919b(0xe6),'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x18919b(0xd2),'version':_0x18919b(0xda)}}})});if(!_0x2e6aa7['ok']){let _0xaa3f07=await _0x2e6aa7[_0x18919b(0xd7)]();return Y(_0x18919b(0xfe)+_0x2e6aa7[_0x18919b(0xa3)]+'\x20'+_0xaa3f07[_0x18919b(0xdc)](0x0,0x64)),{'ok':!0x1,'error':_0x18919b(0x85)+_0x2e6aa7[_0x18919b(0xa3)]};}await _0x2e6aa7[_0x18919b(0xd7)]();let _0x1cadd6=(await(await fetch(f+'/mcp',{'method':_0x18919b(0xdd),'headers':{'Content-Type':_0x18919b(0xf9),'Accept':_0x18919b(0xf5),...X?{'Authorization':'Bearer\x20'+X}:{}},'body':JSON[_0x18919b(0xe3)]({'jsonrpc':'2.0','id':0x2,'method':'tools/call','params':{'name':_0x21bfb8,'arguments':_0x328d0d}})}))[_0x18919b(0xd7)]())[_0x18919b(0x8b)]('\x0a')[_0x18919b(0xdb)](_0x2f0535=>_0x2f0535[_0x18919b(0x88)](_0x18919b(0xbf)));if(_0x1cadd6){let _0xf271b3=JSON[_0x18919b(0x98)](_0x1cadd6[_0x18919b(0xdc)](0x6));return _0xf271b3?.[_0x18919b(0x7c)]?.[_0x18919b(0x83)]?.[0x0]?.['text']?JSON[_0x18919b(0x98)](_0xf271b3[_0x18919b(0x7c)][_0x18919b(0x83)][0x0]['text']):_0xf271b3;}return{'ok':!0x1,'error':'no\x20response'};}K[a0_0x23baf6(0xc1)](a0_0x1fbed3,async _0x474757=>{const _0x148718=a0_0x23baf6;let {name:_0x42d11f,arguments:_0x4ca2b3}=_0x474757[_0x148718(0x8e)];if(_0x42d11f===_0x148718(0xff)){let {task_id:_0x5d587a,text:_0x5f3fb2,status:_0x6454ca}=_0x4ca2b3;if(_0x6454ca===_0x148718(0xef)||_0x6454ca===_0x148718(0xad)||_0x6454ca==='cancelled'){let _0x54ed05=_0x6454ca===_0x148718(0xef)?_0x148718(0xe8):_0x6454ca,_0x37007a=_0x5d587a?k['get'](_0x5d587a)||_0x148718(0x8c):_0x148718(0x8c),_0x2c7e5a=await P(_0x148718(0xc2),{'alias':_0x37007a,'text':_0x5f3fb2,'in_reply_to':_0x5d587a||void 0x0,'status':_0x54ed05,'from_session':Z});if(_0x5d587a)k[_0x148718(0xa5)](_0x5d587a);return{'content':[{'type':_0x148718(0xd7),'text':JSON['stringify'](_0x2c7e5a)}]};}let _0x4cf2ea=await P(_0x148718(0xb5),{'resume_id':w,'alias':Z,'status':_0x6454ca===_0x148718(0xee)?'blocked':_0x6454ca===_0x148718(0xec)?'error':_0x148718(0x8a),'task':_0x5f3fb2[_0x148718(0xdc)](0x0,0xc8),'output':_0x5f3fb2});return{'content':[{'type':_0x148718(0xd7),'text':JSON[_0x148718(0xe3)](_0x4cf2ea)}]};}if(_0x42d11f===_0x148718(0xe0)){let {status:_0x26ac0d,task:_0x486b88,progress:_0x3c206c}=_0x4ca2b3,_0x438cc5=await P('report_status',{'resume_id':w,'alias':Z,'status':_0x26ac0d,'task':_0x486b88,'progress':_0x3c206c});return{'content':[{'type':_0x148718(0xd7),'text':JSON['stringify'](_0x438cc5)}]};}if(_0x42d11f===_0x148718(0xf0)){let {alias:_0x199109,task:_0x503719,priority:_0x46603a}=_0x4ca2b3,_0x148a95=await P(_0x148718(0x7f),{'alias':_0x199109,'task':_0x503719,'priority':_0x46603a||_0x148718(0xeb),'from_session':Z});return{'content':[{'type':_0x148718(0xd7),'text':JSON[_0x148718(0xe3)](_0x148a95)}]};}if(_0x42d11f===_0x148718(0x93)){let {alias:_0x39326c,message:_0x191ac1}=_0x4ca2b3,_0x30066e=await P(_0x148718(0xf2),{'alias':_0x39326c,'message':_0x191ac1,'from_session':Z});return{'content':[{'type':_0x148718(0xd7),'text':JSON[_0x148718(0xe3)](_0x30066e)}]};}if(_0x42d11f===_0x148718(0xb0)){let _0x52583a=await P('get_all_status',{});return{'content':[{'type':_0x148718(0xd7),'text':JSON[_0x148718(0xe3)](_0x52583a)}]};}return{'content':[{'type':_0x148718(0xd7),'text':JSON['stringify']({'error':_0x148718(0xce)})}]};});async function u(){const _0x61582e=a0_0x23baf6;let _0x436adb=f+_0x61582e(0xac)+encodeURIComponent(Z),_0x31a1a2={};if(X)_0x31a1a2[_0x61582e(0xd9)]=_0x61582e(0x97)+X;Y(_0x61582e(0xfc)+_0x436adb);while(!0x0){try{let _0x5c9aff=await fetch(_0x436adb,{'headers':_0x31a1a2});if(!_0x5c9aff['ok']){Y('SSE\x20error:\x20'+_0x5c9aff['status']+'\x20'+_0x5c9aff[_0x61582e(0xe4)]),await h(0x1388);continue;}let _0x106990=_0x5c9aff['body'][_0x61582e(0xca)](),_0x35c5fb=new TextDecoder(),_0x1f7685='';while(!0x0){let {done:_0xe1c95e,value:_0x3dffda}=await _0x106990[_0x61582e(0xe1)]();if(_0xe1c95e)break;_0x1f7685+=_0x35c5fb['decode'](_0x3dffda,{'stream':!0x0});let _0x307deb=_0x1f7685[_0x61582e(0x8b)]('\x0a\x0a');_0x1f7685=_0x307deb['pop']()||'';for(let _0x475fd8 of _0x307deb){let _0x300357=_0x475fd8[_0x61582e(0x8b)]('\x0a')[_0x61582e(0xdb)](_0x257154=>_0x257154[_0x61582e(0x88)](_0x61582e(0xbf)));if(!_0x300357)continue;try{let _0x44cbf1=JSON[_0x61582e(0x98)](_0x300357[_0x61582e(0xdc)](0x6));await S(_0x44cbf1);}catch(_0x5cf525){Y('parse\x20error:\x20'+_0x5cf525);}}}Y(_0x61582e(0x8d));}catch(_0x2e7031){Y(_0x61582e(0x106)+_0x2e7031);}await h(0xbb8);}}async function S(_0x4cd0ac){const _0x5264c4=a0_0x23baf6;if(_0x4cd0ac[_0x5264c4(0x86)]===_0x5264c4(0xd3)){Y('SSE\x20connected\x20as\x20\x22'+Z+'\x22');return;}if(_0x4cd0ac[_0x5264c4(0x86)]===_0x5264c4(0x100)){if(Y('←\x20message\x20from\x20'+_0x4cd0ac[_0x5264c4(0xf6)]+':\x20'+_0x4cd0ac[_0x5264c4(0xc5)]['slice'](0x0,0x3c)),await K[_0x5264c4(0x95)]({'method':'notifications/claude/channel','params':{'content':_0x4cd0ac[_0x5264c4(0xc5)],'meta':{'sender':_0x4cd0ac[_0x5264c4(0xf6)]||'hub','sender_id':_0x5264c4(0xfa),'user':_0x4cd0ac[_0x5264c4(0xf6)]||'hub','priority':_0x5264c4(0xeb)}}}),_0x4cd0ac[_0x5264c4(0xb9)])await P('ack_inbox',{'alias':Z,'message_id':_0x4cd0ac[_0x5264c4(0xb9)]});return;}if(_0x4cd0ac['type']==='new_task'||_0x4cd0ac[_0x5264c4(0x86)]===_0x5264c4(0xdf)){Y('←\x20'+_0x4cd0ac['type']+_0x5264c4(0xb7)+_0x4cd0ac['inbox_count']+_0x5264c4(0x101)+(_0x4cd0ac[_0x5264c4(0x87)]||_0x5264c4(0xeb)));let _0x58f9f3=await P(_0x5264c4(0xc7),{'alias':Z,'limit':0x5});if(_0x58f9f3?.['ok']&&_0x58f9f3[_0x5264c4(0xd6)]?.['length']>0x0)for(let _0x486c18 of _0x58f9f3[_0x5264c4(0xd6)]){let _0x4d2e2c={'sender':_0x486c18[_0x5264c4(0x102)]||_0x5264c4(0x8c),'sender_id':_0x5264c4(0xfa),'user':_0x486c18['from_session']||'hub','task_id':_0x486c18['id'],'priority':_0x486c18[_0x5264c4(0x87)]||_0x5264c4(0xeb)};k[_0x5264c4(0xbb)](_0x486c18['id'],_0x486c18[_0x5264c4(0x102)]||_0x5264c4(0x8c)),await K[_0x5264c4(0x95)]({'method':_0x5264c4(0xd5),'params':{'content':_0x486c18[_0x5264c4(0x83)],'meta':_0x4d2e2c}}),Y(_0x5264c4(0xea)+_0x486c18['id'][_0x5264c4(0xdc)](0x0,0x8)+'\x20from\x20'+_0x486c18[_0x5264c4(0x102)]+':\x20'+_0x486c18[_0x5264c4(0x83)]['slice'](0x0,0x3c)),await P(_0x5264c4(0xf3),{'alias':Z,'message_id':_0x486c18['id']});}}}async function A(){const _0x5994af=a0_0x23baf6;let _0x23da29=new a0_0x7d2bfd();await K['connect'](_0x23da29),Y(_0x5994af(0xf7)),Y(_0x5994af(0xd4)),u()[_0x5994af(0xbe)](_0x5e8382=>Y(_0x5994af(0x99)+_0x5e8382)),P(_0x5994af(0xb5),{'resume_id':w,'alias':Z,'status':'idle','server':a0_0x201dd8(),'hostname':a0_0x201dd8(),'agent':_0x5994af(0x9e),'project_dir':process[_0x5994af(0x84)](),'tmux_name':j||void 0x0})[_0x5994af(0xc8)](()=>Y('registered\x20as\x20\x22'+Z+_0x5994af(0xa1)+w[_0x5994af(0xdc)](0x0,0x8)+')'))[_0x5994af(0xbe)](_0x3b45c6=>Y(_0x5994af(0xa0)+_0x3b45c6)),setInterval(()=>{const _0x427053=_0x5994af;P('report_status',{'resume_id':w,'alias':Z,'status':_0x427053(0xfd),'server':a0_0x201dd8(),'hostname':a0_0x201dd8(),'agent':_0x427053(0x9e),'project_dir':process['cwd'](),'tmux_name':j||void 0x0})[_0x427053(0xbe)](_0x16480e=>Y(_0x427053(0x90)+_0x16480e));},0x2bf20),Y(_0x5994af(0xb2));}A()[a0_0x23baf6(0xbe)](_0x2b71a2=>{const _0x4c12f5=a0_0x23baf6;Y(_0x4c12f5(0xbd)+_0x2b71a2),process[_0x4c12f5(0xb8)](0x1);});function a0_0x441a(){const _0x1d5cef=['normal','error','Target\x20session\x20alias','blocked','completed','commhub_send_task','Task\x20content','send_message','ack_inbox','low','application/json,\x20text/event-stream','from','MCP\x20stdio\x20connected','Task\x20outcome:\x20completed/failed/cancelled\x20for\x20final\x20results,\x20blocked/error/in_progress\x20for\x20status\x20updates','application/json','commhub','/mcp','connecting\x20to\x20','idle','CommHub\x20init\x20failed:\x20','commhub_reply','new_message','\x20priority=','from_session','string','359332RGcoBI','8GWAlwf','SSE\x20connection\x20error:\x20','result','1698609eiWPLe','token','send_task','cancelled','Priority\x20(default:\x20normal)','toTimeString','content','cwd','init\x20failed:\x20','type','priority','startsWith','Reply\x20text\x20/\x20result\x20summary','working','split','hub','SSE\x20stream\x20ended,\x20reconnecting...','params','session\x20disconnected','heartbeat\x20failed:\x20','Messages\x20from\x20CommHub\x20arrive\x20as\x20<channel\x20source=\x22commhub\x22\x20task_id=\x22...\x22\x20priority=\x22...\x22\x20from=\x22...\x22>','4887AsKQdj','commhub_send_message','386765EWFbco','notification','...\x20TMUX=','Bearer\x20','parse','SSE\x20fatal:\x20','object','config.json','5648734FbAZGp','http://127.0.0.1:9200','claude-code','shutting\x20down,\x20reporting\x20offline...','warning:\x20could\x20not\x20register:\x20','\x22\x20(','5627552DJcndO','status','The\x20task_id\x20from\x20the\x20channel\x20message\x20(or\x20\x27hub\x27\x20for\x20general)','delete','write','stdin','none','78GACSqT','SIGINT','tmux\x20display-message\x20-p\x20\x27#S\x27','/events/','failed','number','Reply\x20using\x20the\x20commhub_reply\x20tool\x20to\x20report\x20status\x20or\x20results\x20back.','commhub_get_all_status',']\x20[commhub]\x20','ready\x20—\x20waiting\x20for\x20events','25915450mrAFgb','These\x20are\x20tasks\x20dispatched\x20by\x20the\x20hub\x20or\x20other\x20sessions\x20via\x20the\x20CommHub\x20Server.','report_status','.env',':\x20inbox_count=','exit','message_id','Reply\x20to\x20a\x20CommHub\x20task\x20—\x20report\x20completion\x20or\x20send\x20a\x20message\x20back\x20to\x20the\x20hub.','set','.claude/channels/commhub','fatal:\x20','catch','data:\x20','join','setRequestHandler','send_reply','16890ctWlTA','Message\x20content','message','Current\x20task\x20description','get_inbox','then','trim','getReader','replace','\x20CWD=','Send\x20a\x20message\x20to\x20another\x20session\x20(no\x20task\x20lifecycle,\x20just\x20chat).\x20Use\x20for\x20replies\x20and\x20status\x20updates.','unknown\x20tool','ENV:\x20URL=','utf-8','Update\x20this\x20session\x27s\x20status\x20in\x20CommHub\x20(working/idle/blocked/error).\x20Returns\x20inbox_count.','commhub-channel','connected','starting\x20SSE\x20listener...','notifications/claude/channel','messages','text','stderr','Authorization','0.3.0','find','slice','POST','indexOf','broadcast','commhub_report_status','read','alias','stringify','statusText','.anet','initialize','6HHRiYW','replied','SIGTERM','→\x20injected\x20task\x20'];a0_0x441a=function(){return _0x1d5cef;};return a0_0x441a();}function a0_0x5ffd(_0x5a690b,_0x2b9d7b){_0x5a690b=_0x5a690b-0x7c;const _0x441a57=a0_0x441a();let _0x5ffd46=_0x441a57[_0x5a690b];return _0x5ffd46;}async function N(){const _0x21900e=a0_0x23baf6;Y(_0x21900e(0x9f)),await P('report_status',{'resume_id':w,'alias':Z,'status':_0x21900e(0xec),'task':_0x21900e(0x8f)})[_0x21900e(0xbe)](()=>{}),process[_0x21900e(0xb8)](0x0);}process[a0_0x23baf6(0xa7)]['on']('end',()=>N()),process['on'](a0_0x23baf6(0xe9),()=>N()),process['on'](a0_0x23baf6(0xaa),()=>N());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.2.2-preview.0",
3
+ "version": "2.2.3-preview.0",
4
4
  "description": "AI Agent Network CLI — Create multi-agent networks with user management, network isolation, and 3 AI runtimes (Claude/Codex/MiniMax). 39 commands.",
5
5
  "type": "module",
6
6
  "main": "dist/src/client.js",